1
0
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:
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' 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:

View File

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

View File

@@ -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: {},
} }

View File

@@ -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: {},
} }