@slate-collaborate/types
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -56,2 +56,15 @@ "use strict"; | ||
} | ||
else { | ||
let newPath = pathTransformer_1.pathTransform(operation.path, appliedOperation); | ||
if (operation.path[operation.path.length - 1] !== 0) { | ||
const prevPath = Path_1.Path.previous(operation.path); | ||
if (Path_1.Path.isParent(prevPath, appliedOperation.path)) { | ||
return [{ ...operation, path: newPath, position: operation.position - 1 }]; | ||
} | ||
else if (Path_1.Path.equals(prevPath, appliedOperation.path)) { | ||
return [{ ...operation, path: newPath, position: operation.position + appliedOperation.position }]; | ||
} | ||
} | ||
return [{ ...operation, path: newPath }]; | ||
} | ||
} | ||
@@ -58,0 +71,0 @@ else if (appliedOperation.type === "move_node") { |
@@ -53,2 +53,15 @@ import { Path } from "../Path"; | ||
} | ||
else { | ||
let newPath = pathTransform(operation.path, appliedOperation); | ||
if (operation.path[operation.path.length - 1] !== 0) { | ||
const prevPath = Path.previous(operation.path); | ||
if (Path.isParent(prevPath, appliedOperation.path)) { | ||
return [{ ...operation, path: newPath, position: operation.position - 1 }]; | ||
} | ||
else if (Path.equals(prevPath, appliedOperation.path)) { | ||
return [{ ...operation, path: newPath, position: operation.position + appliedOperation.position }]; | ||
} | ||
} | ||
return [{ ...operation, path: newPath }]; | ||
} | ||
} | ||
@@ -55,0 +68,0 @@ else if (appliedOperation.type === "move_node") { |
{ | ||
"name": "@slate-collaborate/types", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"main": "dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/cjs/index.d.ts", |
185144
181
4274