@portabletext/editor 6.1.0 → 6.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/lib/index.js CHANGED
@@ -10751,6 +10751,11 @@ function createUndoSteps({
10751
10751
  const lastOp = lastStep.operations.at(-1);
10752
10752
  return lastOp && op.type === "insert_text" && lastOp.type === "insert_text" && op.offset === lastOp.offset + lastOp.text.length && Path.equals(op.path, lastOp.path) && op.text !== " " || lastOp && op.type === "remove_text" && lastOp.type === "remove_text" && op.offset + op.text.length === lastOp.offset && Path.equals(op.path, lastOp.path) ? mergeIntoLastStep(steps, lastStep, op) : createNewStep(steps, op, editor);
10753
10753
  }
10754
+ if (currentUndoStepId !== void 0 && previousUndoStepId !== void 0 && currentUndoStepId !== previousUndoStepId) {
10755
+ const lastOp = lastStep.operations.at(-1);
10756
+ if (lastOp && op.type === "insert_text" && lastOp.type === "insert_text" && op.offset === lastOp.offset + lastOp.text.length && Path.equals(op.path, lastOp.path) && op.text !== " " || lastOp && op.type === "remove_text" && lastOp.type === "remove_text" && op.offset + op.text.length === lastOp.offset && Path.equals(op.path, lastOp.path))
10757
+ return mergeIntoLastStep(steps, lastStep, op);
10758
+ }
10754
10759
  return createNewStep(steps, op, editor);
10755
10760
  }
10756
10761
  function createNewStep(steps, op, editor) {