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