prosemirror-state
Advanced tools
Changelog
0.17.0 (2017-01-05)
The way state is updated was changed. Instead of applying an action (a raw object with a type
property), it is now done by applying a Transaction
.
The EditorTransform
class was renamed Transaction
, and extended to allow changing the set of stored marks and attaching custom metadata.
Plugins now accept a filterTransaction
option that can be used to filter out transactions as they come in.
Plugins also got an appendTransaction
option making it possible to follow up transactions with another transaction.
Changelog
0.16.0 (2016-12-23)
Plugins now take a view
option that can be used to interact with the editor view.
Changelog
0.15.0 (2016-12-10)
Selection actions no longer scroll the new selection into view by default (they never were supposed to, but due to a bug they did). Add a scrollIntoView
property to the action to get this behavior.
Changelog
0.14.0 (2016-11-28)
Selection actions now have a time
field and an (optional) origin
field.
Changelog
0.13.0 (2016-11-11)
EditorTransform.replaceSelection
now takes a slice, no longer a node. The new replaceSelectionWith
method should be used to replace the selection with a node. Until the next release, calling it the old way will still work and emit a warning.
The documentation for applyAction
now actually reflects the arguments this method is given.
A state field's applyAction
method is now passed the previous state as 4th argument, so that it has access to the new doc and selection.
EditorTransform.replaceSelection
now accepts a slice (or, as before, as a node), and uses a revised algorithm, relying on the defining
node flag.
The TextSelection
and NodeSelection
classes now have a static create
convenience method for creating selections from unresolved positions.
Allow transform actions to be extended during dispatch using extendTransformAction
. Introduce sealed
flag to indicate when this is not safe.
A new utility function NodeSelection.isSelectable
can be used to test whether a node can be the target of a node selection.
Changelog
0.12.0 (2016-10-21)
The interace to
EditorState.toJSON
and
EditorState.fromJSON
has changed.
The way plugins declare their state
field has changed. Only one
state field per plugin is supported, and state fields no longer have
hard-coded names. Plugin.getState
is the
way to access plugin state now.
Plugin dependencies are no longer supported.
Plugin.reconfigure
is gone. Plugins are now always created
with new Plugin
.
Plugins no longer have a config
field.
Node selections are now properly dropped when mapped over a change that replaces their nodes.
Plugin keys can now be used to find plugins by identity.
Transform actions now have a
time
field containing the timestamp when the change was made.