I’ve just tagged ProseMirror version 0.19.0. This release mostly contains a number of bugfixes and minor tweaks that came up in the process of trying to implement some difficult use cases.
The only potentially disruptive change is that selections work somewhat differently—they always have a head and anchor now, so if you’re checking for those properties to determine whether something is a text selection, you have to stop doing that. In general, it is now possible to write custom selection subclasses and set those as the editor selection, so code shouldn’t assume that a selection must be either a node or a text selection. The JSON representation of selections changed to be able to handle custom selections, but the old JSON format will continue to be accepted by
I invite you to consider this and subsequent releases betas for 1.0. Though small incremental improvements in response to problems that people run into are likely to continue, I’m not going to do anything radical to the API anymore and will start preferring backwards-compatibility over elegance (i.e. better to leave a wart than to force people to change their code again).
MarkSpec.inclusiveRight was replaced by
inclusive, which behaves slightly differently.
inclusiveRight will be interpreted as
inclusive (with a warning) until the next release.
inlineContent property on nodes and node types tells you whether a node type supports inline content.
MarkSpec.inclusive can now be used to control whether content inserted at the boundary of a mark receives that mark.
context restrictions can now use node groups, not just node names, to specify valid context.
Selection.between is now called
TextSelection.between, and only returns text selections.
The JSON representation of selections changed.
fromJSON will continue to understand the old representation, but if your own code touches the JSON data, you’ll have to adjust it.
Selection objects now have
$anchor properties, so those can no longer be used to recognize text selections (use
It is now possible to write your own
Selection subclasses and set the editor selection to an instance of them (provided you implement all required methods and register them with
Text selections now have a
$cursor getter which returns a position only if this is a cursor selection.
Transaction.ensureMarks method makes it easier to ensure given set of active marks without needlessly setting
endOfTextblock no longer always returns false for horizontal motion on non-cursor selections, but checks the position of the selection head instead.
Typing after adding/removing a mark no longer briefly shows the new text with the wrong marks.
posAtCoords is now more reliable on modern browsers by using browser APIs.
Fix a bug where the view would in some circumstances leave superfluous DOM nodes around inside marks.
You can now override the selection the editor creates for a given DOM selection with the
A new function
closeHistory can be used to force separation of history events at the start of a given transaction.
You can now use strings (as well as numbers) as client IDs (this already worked, but now the documentation reflects this).
joinBackward at the start of a node that can’t be joined no longer raises an error.
Link marks are now non-inclusive by default.