@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.
@@ -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 ((lastOp == null ? void 0 : lastOp.type) === "insert_node") {
10305
- currentProps = lastOp.node;
10306
- } else if ((lastOp == null ? void 0 : lastOp.type) === "set_node" && Path.equals(lastOp.path, childPath)) {
10307
- currentProps = omitNullEntries(__spreadValues(__spreadValues({}, currentProps), lastOp.newProperties));
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")) {