0.18 is out, with a long list of bugfixes, a few new features, and three cosmetic breaking changes, which rename properties for the sake of consistency (the old properties will continue to work, with a warning, until the next release).
Significant new features include:
- The ability to control which marks can coexist in a more fine-grained way
- A way to make parse rules only match inside a given ancestor node
- The possibility to project steps onto and out of sub-documents
- A more convenient way to update props
Access to the transactions that initially created the steps when sending steps in a collaborative setup
- A new command that splits blocks (i.e. the enter key) without resetting the set of active marks
schema.markSpec have been deprecated in favor of
schema.spec. The properties still work with a warning in this release, but will be dropped in the next.
Node objects now have a
check method which can be used to assert that they conform to the schema.
Node specs now support an
atom property, and nodes an
isAtom accessor, which is currently only used to determine whether such nodes should be directly selectable (for example when they are rendered as an uneditable node view).
excludes field on mark specs can be used to control the marks that this mark may coexist with. Mark type objects also gained an
excludes method to querty this relation.
Mark specs now support a
group property, and marks can be referred to by group name in content specs.
Schema class now provides its whole spec under its
The name of a schema’s default top-level node is now configurable. You can use
schema.topNodeType to retrieve the top node type.
Parse rules now support a
context field that can be used to only make the rule match inside certain ancestor nodes.
Transform.setNodeType now takes an optional argument to set the new node’s attributes.
Steps now provide an
offset method, which makes it possible to create a copy the step with its position offset by a given amount.
docChanged is now a property on the
Transform class, rather than its
Mapping instances now have
appendMappingInverted methods to make mapping through them in reverse easier.
Plugin objects now store their spec under a
spec instead of an
options property. The
options property still works with a warning in this release.
Decoration objects now store their definition object under
options. The old property name still works, with a warning, until the next release.
Fix bug where calling
focus when there was a text selection would sometimes result in
state.selection receiving an incorrect value.
EditorView.props now has its
state property updated when you call
Putting decorations on or inside a node view with an
update method now works.
Plugin view update methods are now passed the view’s previous state as second argument.
place agument to the
EditorView constructor can now be an object with a
mount property to directly provide the node that should be made editable.
EditorView.setProps method makes it easier to update individual props.
keydownHandler function, which takes a keymap and produces a
handleKeydown prop-style function.
Fix a problem where simultaneous collaborative editing could break the undo history.
sendableSteps now also returns information about the original transactions that produced the steps.
splitBlockKeepMarks which splits a block but preserves the marks at the cursor.