import { v4 as uuid } from "uuid";
function withLocalChanges(editor) {
  editor.localChanges = /* @__PURE__ */ new Map();
  editor.recentLocalChanges = [];
  editor.currentKey = "";
  const _onChange = editor.onChange;
  editor.onChange = (options) => {
    _onChange(options);
    if (editor == null || options?.operation == null)
      return;
    const key = uuid();
    editor.localChanges.set(key, { selection: editor.selection, time: performance.now() });
    editor.currentKey = key;
  };
  return editor;
}
export {
  withLocalChanges
};
//# sourceMappingURL=index.js.map