Make splitBlock
smart enough to split blocks when the cursor is inside a nested inline node.
joinBackward
will, when moving a node into a block, no longer join that block with the block after when the two have compatible content but aren't of the same type.
Fix an issue in splitBlock
that caused it to return true without doing anything when the schema makes splitting at the cursor impossible.
Support implicit conversion between hard break nodes and newlines in the joinForward
and joinBackward
commands.
Fix an issue where joinBackward
couldn't lift the block with the cursor when the block before it was isolating.
toggleMark
now takes an option that controls its behavior when only part of the selection has the mark already.
The function given to splitBlockAs
now has access to the split position via a third parameter.
toggleMark
now takes an enterInlineAtoms
option that controls whether it descends into atom nodes.
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Fix joinTextblockBackward
not applying when the textblock before was wrapped in another node.
The new splitBlockAs
command-builder allows you to pass in custom logic to determine the type of block that should be split off.
Make setBlockType
act on all selection ranges in selections that have them.
The new joinTextblockForward
and joinTextblockBackward
commands provide a more primitive command for delete/backspace behavior when you don't want the extra strategies implemented by joinForward
/joinBackward
.
Make sure toggleMark
doesn't add marks to top nodes with non-inline content.
Include TypeScript type declarations.
Don't override behavior of Home and End keys in base keymap.
Fix an issue where joinBackward
and joinForward
would return true when activated with the cursor in an empty but undeletable block, but not make any change.
Add a workaround for a bug on macOS where Ctrl-a and Ctrl-e getting stuck at the edge of inline nodes.
The new selectTextblockEnd
and selectTextblockStart
commands move the cursor to the start/end of the textblock, when inside one.
Ctrl-a/e on macOS and Home/End on other platforms are now bound to selectTextblockEnd
and selectTextblockStart
.
Fix issue where the default PC keymap was used on recent versions of iPhone or iPad operating systems.
Add a binding for Shift-Backspace to the base keymap, so that shift or caps-lock won't interfere with backspace behavior.
Fix an issue in autoJoin
that made it ignore a third argument if it was passed one.
Make joinBackward
capable of joining textblocks wrapped in parent nodes when the parent nodes themselves can't be joined (for example two list items which allow only a single paragraph).
Fix a regression where splitBlock
could crash when splitting at the end of a non-default block.
Fix a crash in splitBlock
that occurred with certain types of schemas.
Fix a regression where createParagraphNear
no longer fired for gap cursor selections.
Improve behavior of enter when the entire document is selected.
joinBackward
and joinForward
will now, when the textblock after the cut can't be moved into the structure before the cut, try to just join the inline content onto the last child in the structure before the cut.
toggleMark
will now skip whitespace at the start and end of the selection when adding a mark.
selectNodeForward
and selectNodeBackward
will now also select nodes next to a gap cursor (or other custom empty selection type).
Fix an issue where, since version 1.7.4 of prosemirror-model, splitBlock
fails to create the expected new textblock in some schemas.
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.
Fix a crash caused by using a position potentially outside the document in splitBlock
.
Fixes an issue where joinBackward
might create a selection pointing into the old document.
The setBlockType
command command is now considered applicable when any of the selected textblocks can be changed (it used to only look at the first one).
Fix crash when calling splitBlock
when the selection isn't in a block node (by disabling the command in that case).
Fixes an issue where joinForward
might create a selection pointing into the old document.
Fix crash in splitBlock
when defaultContentType
returns null.
Pressing delete in front of an isolating node no longer opens it.
Fix issue where joinBackward
would sometimes create an invalid selection.
splitBlock
no longer crashes when used in a block that's it's parent node's only allowed child.
The setBlockType
command can now be used to change the types of multiple selected textblocks (rather than only one).
The platform-dependent versions of the base keymap are now exported separately as pcBaseKeymap
and macBaseKeymap
.
joinForward
and joinBackward
no longer fall back to selecting the next node when no other behavior is possible. There are now separate commands selectNodeForward
and selectNodeBackward
that do this, which the base keymap binds as fallback behavior.
baseKeymap
no longer binds keys for joinUp
, joinDown
, lift
, and selectParentNode
.
New commands selectNodeForward
and selectNodeBackward
added.
The new selectAll
command, bound to Mod-a in the base keymap, sets the selection to an AllSelection
.
Calling joinBackward
at the start of a node that can't be joined no longer raises an error.
New command splitBlockKeepMarks
which splits a block but preserves the marks at the cursor.
Make sure toggleMark
also works in the top-level node (when it is a textblock).
The dispatch
function passed to commands is now passed a Transaction
, not an action object.
Drops suppport for delete(Char|Word)(Before|After)
and move(Back|For)ward
, since we are now letting the browser handle those natively.
The joinForward
and joinBackward
commands can now strip out markup and nodes that aren't allowed in the joined node.
A new command exitCode
allows a user to exit a code block by creating a new paragraph below it.
The joinForward
and joinBackward
commands now use a bidirectional-text-aware way to determine whether the cursor is at the proper side of its parent textblock when they are passed a view.
The autoJoin
function allows you to wrap command functions so that when the command makes nodes of a certain type occur next to each other, they are automatically joined.
Fix crash when backspacing into nodes with complex content expressions.
Moved into a separate module.
The interface for command functions was changed to work with the new state/action abstractions.