Fix a regression in dropPoint
that caused it to dereference undefined in some circumstances.
Fix a crash in Transform.replaceRange
when called with under specific circumstances.
Fix an issue where dropPoint
could return an invalid drop point.
The various properties of subclasses of Step
(ReplaceStep
, ReplaceAroundStep
, AddMarkStep
, and RemoveMarkStep
) are now part of the public interface.
Fix a bug where merging replace steps with the structure
flag could create steps that couldn't be applied.
Fix an issue in Transform.removeMark
where the mark type was passed through to be removed instead of the mark itself.
Fix an issue where Transform.removeMark
, when given a mark type, would only remove the first instance from nodes that had multiple marks of the type.
Fix an issue where AddMarkStep
would mark inline nodes with content.
Fix an issue where fitting a slice at the top level of the document would, in some circumstances, crash.
Fix an issue where in some cases replace fitting would insert an additional bogus node when fitting content into nodes with strict content restrictions.
Fix an issue where creating a replace step would sometimes fail due to unmatchable close tokens after the replaced range.
Rewrite the slice-fitting code used by replaceStep
to handle a few more corner cases.
Fix joinPoint
to return check whether the parent node allows a given join.
Fix a crash in deleteRange
that occurred when deleting a region that spans to the ends of two nodes at different depths.
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
The file referred to in the package's module
field now is compiled down to ES5.
Add a module
field to package json file.
Fixes an issue where deleting a range from the start of block A to the end of block B would leave you with an empty block of type B.
Fix crash in building replace steps for open-ended slices with complicated node content expressions.
Mapping.invert
is now part of the documented API (it was intented to be public from the start, but a typo prevented it from showing up in the docs).
Fix an issue where a replace could needlessly drop content when the first node of the slice didn't fit the target context.
replaceRange
now more aggressively expands the replaced region if replace
fails to place the slice.
Replacing from a code block into a paragraph that has marks, or similar scenarios that would join content with the wrong marks into a node, no longer crashes.
Fix issue where replaceRange
might create invalid nodes.
Fix issues in the new dropPoint
function.
Transform.getMirror
, usable in obscure circumstances for inspecting the mirroring structure or a transform, is now a public method.
New utility function dropPoint
, which tries to find a valid position for dropping a slice near a given document position.
Transform.setBlockType
no longer drops marks on the nodes it updates.
Fix a bug that made replaceStep
unable to generate wrapper nodes in some circumstances.
Fixes an issue where replaceStep
could generate slices that internally violated the schema.
Transform.deleteRange
will cover unmatched opening at the start of the deleted range.
Throw errors, rather than constructing invalid objects, when deserializing from invalid JSON data.
replaceStep
will now return null rather than an empty step when it fails to place the slice.
Avoid duplicating defining parent nodes in replaceRange
.
Fix overeager closing of destination nodes when fitting a slice during replacing.
Fix a problem where slice-placing didn't handle content matches correctly and might generate invalid steps or fail to generate steps though a valid one exists.
Allows adjacent nodes from an inserted slice to be placed in different parent nodes, allowing Transform.replace
to create fits that weren't previously found.
Fixes a crash in replace
.
The errors raised by Transform.step
now properly inherit from Error.
When setBlockType
comes across a textblock that can't be changed due to schema constraints, it skips it instead of failing.
canSplit
now returns false when the requested split goes through isolating nodes.
The setNodeType
method on transforms is now more descriptively called setNodeMarkup
. The old name will continue to work with a warning until the next release.
Step.toJSON
no longer has a default implementation.
Steps no longer have an offset
method. Map them through a map created with StepMap.offset
instead.
The clearMarkup
method on Transform
is no longer supported (you probably needed clearIncompatible
anyway).
Pasting a list item at the start of a non-empty textblock now wraps the textblock in a list.
Marks on open nodes at the left of a slice are no longer dropped by Transform.replace
.
StepMap
now has a static method offset
, which can be used to create a map that offsets all positions by a given distance.
Transform objects now have a clearIncompatible
method that can help make sure a node's content matches another node type.
Fix another bug in the way canSplit
interpreted its typesAfter
argument.
Fix crash in canSplit
when an array containing null fields is passed as fourth argument.
canSplit
now returns false when given custom after-split node types that don't match the content at that point.
Fixes canLift
incorrectly returning null when lifting into an isolating node.
addMark
no longer assumes marks always exclude only themselves.
replaceRange
](https://prosemirror.net/docs/ref/version/0.21.0.html#transform.Transform.replaceRange) and deleteRange
will no longer expand the range across isolating node boundaries.
Fixes issue where replacing would sometimes unexpectedly split 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 Transaction
subclass.
Mapping
instances now have invert
and appendMappingInverted
methods to make mapping through them in reverse easier.
Fix bug where pasted/inserted content would sometimes get incorrectly closed at the right side.
Fix issue where Transform.replace
would, in specific circumstances, unneccessarily drop content.
The new Transform
method replaceRange
, replaceRangeWith
, and deleteRange
provide a way to replace and delete content in a 'do what I mean' way, automatically expanding the replaced region over empty parent nodes and including the parent nodes in the inserted content when appropriate.
Fix bug in Transform.setBlockType
when used in a transform that already has steps.
Mapped positions now count as deleted when the token to the
side specified by the assoc
parameter is deleted, rather than when
both tokens around them are deleted. (This is usually what you already
wanted anyway.)
Moved into a separate module.
The Remapping
class was renamed to Mapping
and works differently
(simpler, grows in only one direction, and has provision for mapping
through only a part of it).
Transform
objects now build up a Mapping
instead of an array of maps.
PosMap
was renamed to StepMap
to make it
clearer that this applies only to a single step (as opposed to
Mapping
.
The arguments to canSplit
and
split
were changed to make it
possible to specify multiple split-off node types for splits with a
depth greater than 1.
Rename joinable
to canJoin
.
Steps can now be merged in some circumstances, which can be useful when storing a lot of them.