options
. This includes options specific to the transform, and general NodeOptions
to specify which Nodes in the document that the transform is applied to.at
option selects a Location in the editor. It defaults to the user's current selection. Learn more about the at
option​match
option filters the set of Nodes with a custom function. Learn more about the match
option​mode
option also filters the set of nodes.Transforms.insertFragment(editor: Editor, fragment: Node[], options?)
{at?: Location, hanging?: boolean, voids?: boolean}
Transforms.insertNodes(editor: Editor, nodes: Node | Node[], options?)
nodes
at the specified location in the document. If no location is specified, inserts at the current selection. If there is no selection, inserts at the end of the document.NodeOptions & {hanging?: boolean, select?: boolean}
.Transforms.removeNodes(editor: Editor, options?)
NodeOptions & {hanging?: boolean}
Transforms.mergeNodes(editor: Editor, options?)
NodeOptions & {hanging?: boolean}
Transforms.splitNodes(editor: Editor, options?)
NodeOptions & {height?: number, always?: boolean}
Transforms.wrapNodes(editor: Editor, element: Element, options?)
element
container. If no location is specified, wrap the selection.NodeOptions & {split?: boolean}
.options.mode
: 'all'
is also supported.options.split
indicates that it's okay to split a node in order to wrap the location. For example, if ipsum
was selected in a Text
node with lorem ipsum dolar
, split: true
would wrap the word ipsum
only, resulting in splitting the Text
node. If split: false
, the entire Text
node lorem ipsum dolar
would be wrapped.Transforms.unwrapNodes(editor: Editor, options?)
NodeOptions & {split?: boolean}
. For options.mode
, 'all'
is also supported.Transforms.setNodes(editor: Editor, props: Partial<Node>, options?)
NodeOptions & {hanging?: boolean, split?: boolean}
. For options.mode
, 'all'
is also supported.Transforms.unsetNodes(editor: Editor, props: string | string[], options?)
NodeOptions & {split?: boolean}
. For options.mode
, 'all'
is also supported.Transforms.liftNodes(editor: Editor, options?)
NodeOptions
. For options.mode
, 'all'
is also supported.Transforms.moveNodes(editor: Editor, options)
options
. If no origin is specified, move the selection.NodeOptions & {to: Path}
. For options.mode
, 'all'
is also supported.Transforms.collapse(editor: Editor, options?)
{edge?: 'anchor' | 'focus' | 'start' | 'end'}
Transforms.select(editor: Editor, target: Location)
target
. When a selection already exists, this method is just a proxy for setSelection
and will update the existing value.Transforms.deselect(editor: Editor)
Transforms.move(editor: Editor, options?)
{distance?: number, unit?: 'offset' | 'character' | 'word' | 'line', reverse?: boolean, edge?: 'anchor' | 'focus' | 'start' | 'end'}
Transforms.setPoint(editor: Editor, props: Partial<Point>, options?)
{edge?: 'anchor' | 'focus' | 'start' | 'end'}
Transforms.setSelection(editor: Editor, props: Partial<Range>)
Partial<Range>
, this method can only handle updates to an existing selection. If there is no active selection the operation will be void. Use select
if you'd like to create a selection when there is none.Transforms.delete(editor: Editor, options?)
{at?: Location, distance?: number, unit?: 'character' | 'word' | 'line' | 'block', reverse?: boolean, hanging?: boolean, voids?: boolean}
Transforms.insertText(editor: Editor, text: string, options?)
{at?: Location, voids?: boolean}
Transforms.transform(editor: Editor, transform: Transform)
editor
by an operation
.