mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 01:33:58 +02:00
Add hanging option to unsetNodes (#5189)
Since this really just calls setNodes, it seems like it should offer the same options. Without this change, doing something like applying a mark to the contents of a selected block with `hanging` works one way, while trying to do the reverse (remove the mark) cannot include the "hang".
This commit is contained in:
5
.changeset/light-moose-jam.md
Normal file
5
.changeset/light-moose-jam.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add hanging option to unsetNodes so it matches setNodes
|
@@ -101,7 +101,7 @@ Options supported: `NodeOptions & {hanging?: boolean, split?: boolean}`. For `op
|
|||||||
|
|
||||||
Unset properties of nodes at the specified location. If no location is specified, use the selection.
|
Unset properties of nodes at the specified location. If no location is specified, use the selection.
|
||||||
|
|
||||||
Options supported: `NodeOptions & {split?: boolean}`. For `options.mode`, `'all'` is also supported.
|
Options supported: `NodeOptions & {hanging?: boolean, split?: boolean}`. For `options.mode`, `'all'` is also supported.
|
||||||
|
|
||||||
#### `Transforms.liftNodes(editor: Editor, options?)`
|
#### `Transforms.liftNodes(editor: Editor, options?)`
|
||||||
|
|
||||||
|
@@ -100,6 +100,7 @@ export interface NodeTransforms {
|
|||||||
at?: Location
|
at?: Location
|
||||||
match?: NodeMatch<T>
|
match?: NodeMatch<T>
|
||||||
mode?: MaximizeMode
|
mode?: MaximizeMode
|
||||||
|
hanging?: boolean
|
||||||
split?: boolean
|
split?: boolean
|
||||||
voids?: boolean
|
voids?: boolean
|
||||||
}
|
}
|
||||||
@@ -825,6 +826,7 @@ export const NodeTransforms: NodeTransforms = {
|
|||||||
at?: Location
|
at?: Location
|
||||||
match?: NodeMatch<T>
|
match?: NodeMatch<T>
|
||||||
mode?: MaximizeMode
|
mode?: MaximizeMode
|
||||||
|
hanging?: boolean
|
||||||
split?: boolean
|
split?: boolean
|
||||||
voids?: boolean
|
voids?: boolean
|
||||||
} = {}
|
} = {}
|
||||||
|
Reference in New Issue
Block a user