Another release today, this time with a lot of bugfixes and small features driven by some real-world ProseMirror work I’ve been doing, along with a handful of minor breaking changes that clean up some bad decisions from the past.
The most meaningful change in this release (which was already foreshadowed in 0.19.0) is that selections are represented in a more generic way, and get more control over how they behave when they are deleted or replaced. If your code still assumes a selection is either a text selection or a node selection, you should write it in a different way.
Release notes
prosemirror-model 0.20.0 (2017-04-03)
Breaking changes
Newlines in the text are now normalized to spaces when parsing except when you set preserveWhitespace to "full" in your options or in a parse rule.
Bug fixes
Fix crash in IE when parsing DOM content.
New features
Fragments now have nodesBetween and descendants methods, providing the same functionality as the methods by the same name on nodes.
Resolved positions now have max and min methods to easily find a maximum or minimum position.
prosemirror-transform 0.20.0 (2017-04-03)
Bug fixes
Fixes issue where replacing would sometimes unexpectedly split nodes.
prosemirror-state 0.20.0 (2017-04-03)
Breaking changes
Selection.near no longer accepts a textOnly parameter.
Bug fixes
TextSelection.between may now return a node selection when the document does not contain a valid cursor position.
New features
Selection objects now implement a content method that returns their content. This is used to determine what ends up on the clipboard when the selection is copied or dragged.
Selections may now specify multiple ranges that they cover, to generalize to more types of selections. The Selection superclass constructor takes an array of ranges as optional third argument.
Selections gained new methods replace and replaceWith to provide subclasses more control over how selections of that type respond to being deleted or overwritten.
Selections have a new method getBookmark that custom selection classes can implement to allow the undo history to accurately store and restore them.
The new selection class AllSelection can be used to select the entire document.
prosemirror-view 0.20.0 (2017-04-03)
Breaking changes
The inclusiveLeft and inclusiveRight options to inline decorations were renamed to inclusiveStart and inclusiveEnd so that they also make sense in right-to-left text. The old names work with a warning until the next release.
The default styling for lists and blockquotes was removed from prosemirror.css. (They were moved to the example-setup module.)
Bug fixes
Fixes reading of selection in Chrome in a shadow DOM.
Registering DOM event handlers that the editor doesn’t listen to by default with the handleDOMEvents prop should work again.
Backspacing after turning off a mark now works again in Firefox.
New features
The new props handlePaste and handleDrop can be used to override drop and paste behavior.
prosemirror-inputrules 0.20.0 (2017-04-03)
Breaking changes
The input rules plugin no longer implicitly binds backspace to undo the last applied rule.
New features
This module now exposes a command undoInputRule, which will revert an input rule when run directly after one was applied.
prosemirror-history 0.20.0 (2017-04-03)
Bug fixes
Appended transactions no longer generate undo history events.
prosemirror-commands 0.20.0 (2017-04-03)
New features
The new selectAll command, bound to Mod-a in the base keymap, sets the selection to an AllSelection.
prosemirror-schema-list 0.20.0 (2017-04-03)
New features
The liftListItem command can now lift items out of a list entirely, when the parent node isn’t another list.
positioning the cursor after nodeViews or nodes with contenteditble==false is still broken in the examples (as I described