1
0
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:
Jason Tamulonis
2020-07-02 08:25:13 -07:00
committed by GitHub
parent 1e495a5cde
commit b1f291ef88
4 changed files with 0 additions and 10 deletions

View File

@@ -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:

View File

@@ -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)
}

View File

@@ -4,7 +4,6 @@ export const input = {
type: 'merge_node',
path: [0],
position: 0,
target: 0,
properties: {},
}

View File

@@ -4,7 +4,6 @@ export const input = {
type: 'split_node',
path: [0],
position: 0,
target: 0,
properties: {},
}