mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 06:53:25 +02:00
Consistent insert* methods (#5415)
* feat: add reviewpad.yml file * Update reviewpad.yml * ✨ options to `Editor.insert*` * 📝 options to `Editor.insert*` * ✨ getDefaultInsertLocation * ✨ getDefaultInsertLocation * ✨ getDefaultInsertLocation * 📝 consistent selection * Create tasty-lizards-remain.md * Update tasty-lizards-remain.md --------- Co-authored-by: reviewpad[bot] <104832597+reviewpad[bot]@users.noreply.github.com> Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
@@ -38,13 +38,13 @@ Transforms that operate on nodes.
|
||||
|
||||
#### `Transforms.insertFragment(editor: Editor, fragment: Node[], options?)`
|
||||
|
||||
Insert of fragment of nodes at the specified location in the document. If no location is specified, insert at the current selection.
|
||||
Insert of fragment of nodes at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
|
||||
|
||||
Options: `{at?: Location, hanging?: boolean, voids?: boolean}`
|
||||
|
||||
#### `Transforms.insertNodes(editor: Editor, nodes: Node | Node[], options?)`
|
||||
|
||||
Atomically inserts `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.
|
||||
Atomically inserts `nodes` at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
|
||||
|
||||
Options supported: `NodeOptions & {hanging?: boolean, select?: boolean}`.
|
||||
|
||||
@@ -170,7 +170,7 @@ Options: `{at?: Location, distance?: number, unit?: 'character' | 'word' | 'line
|
||||
|
||||
#### `Transforms.insertText(editor: Editor, text: string, options?)`
|
||||
|
||||
Insert a string of text at the specified location in the document. If no location is specified, insert at the current selection.
|
||||
Insert a string of text at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
|
||||
|
||||
Options: `{at?: Location, voids?: boolean}`
|
||||
|
||||
|
Reference in New Issue
Block a user