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 fromJSON
.
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).
Enjoy!
Release Notes
prosemirror-model 0.19.0 (2017-03-16)
Breaking changes
MarkSpec.inclusiveRight
was replaced by inclusive
, which behaves slightly differently. inclusiveRight
will be interpreted as inclusive
(with a warning) until the next release.
New features
The new 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.
Parse rule context
restrictions can now use node groups, not just node names, to specify valid context.
prosemirror-state 0.19.0 (2017-03-16)
Breaking changes
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.
All Selection
objects now have $head
/$anchor
properties, so those can no longer be used to recognize text selections (use $cursor
or instanceof
).
New features
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 Selection.jsonID
).
Text selections now have a $cursor
getter which returns a position only if this is a cursor selection.
The new Transaction.ensureMarks
method makes it easier to ensure given set of active marks without needlessly setting storedMarks
.
prosemirror-view 0.19.0 (2017-03-16)
Breaking changes
endOfTextblock
no longer always returns false for horizontal motion on non-cursor selections, but checks the position of the selection head instead.
Bug fixes
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.
New features
You can now override the selection the editor creates for a given DOM selection with the createSelectionBetween
prop.
prosemirror-history 0.19.0 (2017-03-16)
New features
A new function closeHistory
can be used to force separation of history events at the start of a given transaction.
prosemirror-collab 0.19.0 (2017-03-16)
New features
You can now use strings (as well as numbers) as client IDs (this already worked, but now the documentation reflects this).
prosemirror-commands 0.19.0 (2017-03-16)
Bug fixes
Calling joinBackward
at the start of a node that can’t be joined no longer raises an error.
prosemirror-schema-basic 0.19.0 (2017-03-16)
Breaking changes
Link marks are now non-inclusive by default.