mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 09:59:48 +02:00
Remove legacy target operation property (#3743)
This commit is contained in:
@@ -20,7 +20,6 @@ export type MergeNodeOperation = {
|
||||
type: 'merge_node'
|
||||
path: Path
|
||||
position: number
|
||||
target: number | null
|
||||
properties: Partial<Node>
|
||||
[key: string]: unknown
|
||||
}
|
||||
@@ -79,7 +78,6 @@ export type SplitNodeOperation = {
|
||||
type: 'split_node'
|
||||
path: Path
|
||||
position: number
|
||||
target: number | null
|
||||
properties: Partial<Node>
|
||||
[key: string]: unknown
|
||||
}
|
||||
@@ -135,7 +133,6 @@ export const Operation = {
|
||||
case 'merge_node':
|
||||
return (
|
||||
typeof value.position === 'number' &&
|
||||
(typeof value.target === 'number' || value.target === null) &&
|
||||
Path.isPath(value.path) &&
|
||||
isPlainObject(value.properties)
|
||||
)
|
||||
@@ -166,7 +163,6 @@ export const Operation = {
|
||||
return (
|
||||
Path.isPath(value.path) &&
|
||||
typeof value.position === 'number' &&
|
||||
(typeof value.target === 'number' || value.target === null) &&
|
||||
isPlainObject(value.properties)
|
||||
)
|
||||
default:
|
||||
|
@@ -323,7 +323,6 @@ export const NodeTransforms = {
|
||||
type: 'merge_node',
|
||||
path: newPath,
|
||||
position,
|
||||
target: null,
|
||||
properties,
|
||||
})
|
||||
}
|
||||
@@ -611,7 +610,6 @@ export const NodeTransforms = {
|
||||
const [, highestPath] = highest
|
||||
const lowestPath = at.path.slice(0, depth)
|
||||
let position = height === 0 ? at.offset : at.path[depth] + nudge
|
||||
let target: number | null = null
|
||||
|
||||
for (const [node, path] of Editor.levels(editor, {
|
||||
at: lowestPath,
|
||||
@@ -638,12 +636,10 @@ export const NodeTransforms = {
|
||||
type: 'split_node',
|
||||
path,
|
||||
position,
|
||||
target,
|
||||
properties,
|
||||
})
|
||||
}
|
||||
|
||||
target = position
|
||||
position = path[path.length - 1] + (split || isEnd ? 1 : 0)
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,6 @@ export const input = {
|
||||
type: 'merge_node',
|
||||
path: [0],
|
||||
position: 0,
|
||||
target: 0,
|
||||
properties: {},
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,6 @@ export const input = {
|
||||
type: 'split_node',
|
||||
path: [0],
|
||||
position: 0,
|
||||
target: 0,
|
||||
properties: {},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user