prosemirror-state
1.4.4 · 23 Oct 2025MIT41.4M / weekRepositoryHomepagenpmAtom feed
0.24.0 is the newest release of 0.19.x.
Release note
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.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.