1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

Add pass option to Editor.nodes (#5843)

This commit is contained in:
Joe Anderson
2025-04-15 16:41:31 +01:00
committed by GitHub
parent 5adb8ededf
commit 63c0db5b86
6 changed files with 51 additions and 6 deletions

View File

@@ -141,7 +141,7 @@ Options: `depth?: number, edge?: 'start' | 'end'`
At any given `Location` or `Span` in the editor provided by `at` (default is the current selection), the method returns a Generator of `NodeEntry` objects that represent the nodes that include `at`. At the top of the hierarchy is the `Editor` object itself.
Options: `{at?: Location | Span, match?: NodeMatch, mode?: 'all' | 'highest' | 'lowest', universal?: boolean, reverse?: boolean, voids?: boolean}`
Options: `{at?: Location | Span, match?: NodeMatch, mode?: 'all' | 'highest' | 'lowest', universal?: boolean, reverse?: boolean, voids?: boolean, pass?: (node: NodeEntry => boolean), ignoreNonSelectable?: boolean}`
`options.match`: Provide a value to the `match?` option to limit the `NodeEntry` objects that are returned.
@@ -151,6 +151,8 @@ Options: `{at?: Location | Span, match?: NodeMatch, mode?: 'all' | 'highest' | '
- `'highest'`: in a hierarchy of nodes, only return the highest level matching nodes
- `'lowest'`: in a hierarchy of nodes, only return the lowest level matching nodes
`options.pass`: Skip the descendants of certain nodes (but not the nodes themselves).
#### `Editor.parent(editor: Editor, at: Location, options?) => NodeEntry<Ancestor>`
Get the parent node of a location.