@slate-yjs/core 1.0.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/applyToSlate/textEvent.d.ts.map +1 -1
- package/dist/index.cjs +16 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.global.js +14 -4
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/applyToSlate/textEvent.ts +32 -6
- package/src/index.ts +5 -0
package/dist/index.global.js
CHANGED
|
@@ -54,11 +54,13 @@ var SlateYjsCore = (() => {
|
|
|
54
54
|
CursorEditor: () => CursorEditor,
|
|
55
55
|
YHistoryEditor: () => YHistoryEditor,
|
|
56
56
|
YjsEditor: () => YjsEditor,
|
|
57
|
+
applySlateOp: () => applySlateOp,
|
|
57
58
|
relativePositionToSlatePoint: () => relativePositionToSlatePoint,
|
|
58
59
|
relativeRangeToSlateRange: () => relativeRangeToSlateRange,
|
|
59
60
|
slateNodesToInsertDelta: () => slateNodesToInsertDelta,
|
|
60
61
|
slatePointToRelativePosition: () => slatePointToRelativePosition,
|
|
61
62
|
slateRangeToRelativeRange: () => slateRangeToRelativeRange,
|
|
63
|
+
translateYjsEvent: () => translateYjsEvent,
|
|
62
64
|
withCursors: () => withCursors,
|
|
63
65
|
withYHistory: () => withYHistory,
|
|
64
66
|
withYjs: () => withYjs,
|
|
@@ -10300,11 +10302,19 @@ ${err.toString()}`);
|
|
|
10300
10302
|
const childPath = [...slatePath, pathOffset];
|
|
10301
10303
|
if (Text.isText(child)) {
|
|
10302
10304
|
const lastOp = ops[ops.length - 1];
|
|
10305
|
+
let propsOpIndex = ops.length - 1;
|
|
10306
|
+
while (propsOpIndex >= 0 && ops[propsOpIndex].type === "insert_text" && Path.equals(
|
|
10307
|
+
ops[propsOpIndex].path,
|
|
10308
|
+
childPath
|
|
10309
|
+
)) {
|
|
10310
|
+
propsOpIndex -= 1;
|
|
10311
|
+
}
|
|
10312
|
+
const propsOp = ops[propsOpIndex];
|
|
10303
10313
|
let currentProps = getProperties(child);
|
|
10304
|
-
if ((
|
|
10305
|
-
currentProps =
|
|
10306
|
-
} else if ((
|
|
10307
|
-
currentProps = omitNullEntries(__spreadValues(__spreadValues({}, currentProps),
|
|
10314
|
+
if ((propsOp == null ? void 0 : propsOp.type) === "insert_node") {
|
|
10315
|
+
currentProps = propsOp.node;
|
|
10316
|
+
} else if ((propsOp == null ? void 0 : propsOp.type) === "set_node" && Path.equals(propsOp.path, childPath)) {
|
|
10317
|
+
currentProps = omitNullEntries(__spreadValues(__spreadValues({}, currentProps), propsOp.newProperties));
|
|
10308
10318
|
}
|
|
10309
10319
|
let lastPath = [];
|
|
10310
10320
|
if (lastOp != null && (lastOp.type === "insert_node" || lastOp.type === "insert_text" || lastOp.type === "split_node" || lastOp.type === "set_node")) {
|