Patch Changes
- #3952 by @zbeyens –
- Fix
editor.api.last(at, { level: 0 })
when editor has no children, it should returnundefined
. Fixes error on cmd+a > backspace. - Fix
editor.tf.removeNodes
whenpreviousEmptyBlock
is true withoutat
option, it should return early.- Fixes #3960
- Add
RangeApi.contains
to check if a range fully contains another range (both start and end points). - Add
editor.api.isSelected(target, { contains?: boolean })
to check if a path or range is selected by the current selection. Whencontains
is true, checks if selection fully contains the target. editor.tf.insertText
now support both legacy slate transformseditor.insertText
andTransforms.insertText
:editor.insertText
->editor.tf.insertText
withoutat
option. In addition,marks: false
option can be used to exclude current marks. Default istrue
.Transforms.insertText
->editor.tf.insertText
withat
option
- Add
editor.api.next
optionfrom
:from?: 'after' | 'child'
(default:'after'
): Determines where to start traversing from'after'
: Start from the point after the current location'child'
: Start from the first child of the current path.at
must be a path.
- Add
editor.api.previous
optionfrom
:from?: 'before' | 'parent'
(default:'before'
): Determines where to start traversing from'before'
: Start from the point before the current location'parent'
: Start from the parent of the current path.at
must be a path.
- Fix