plitejs 54.0.0-beta.3 → 54.0.0-beta.5

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.
Files changed (56) hide show
  1. package/dist/annotations/index.d.ts +1 -1
  2. package/dist/annotations/index.js +1 -1
  3. package/dist/authored/index.d.ts +2 -2
  4. package/dist/authored/index.js +168 -46
  5. package/dist/{authored-veto-DSnQcHGR.js → authored-veto-Cu-5JdVj.js} +1 -1
  6. package/dist/{comparison-plan-CEQL0ooW.js → comparison-plan-BJxnVPcS.js} +1 -1
  7. package/dist/{comparison-types-Dt-unJZY.d.ts → comparison-types-Bvvxzxq2.d.ts} +1 -1
  8. package/dist/{create-editor-CkHtPWXV.js → create-editor-XvI_4sYc.js} +2 -1
  9. package/dist/diff/index.d.ts +2 -2
  10. package/dist/diff/index.js +2 -2
  11. package/dist/dom/index.d.ts +1 -1
  12. package/dist/dom/index.js +1 -1
  13. package/dist/{dom-Cgfscvnm.js → dom-BjspML2h.js} +71 -46
  14. package/dist/{editor-owner-IUmkTeXz.js → editor-owner-CRgIQ625.js} +1 -1
  15. package/dist/history/index.d.ts +1 -1
  16. package/dist/history/index.js +2 -2
  17. package/dist/hyperscript/index.d.ts +1 -1
  18. package/dist/hyperscript/index.js +1 -1
  19. package/dist/{hyperscript-FPuoArEi.js → hyperscript-BFypA5qW.js} +2 -2
  20. package/dist/{index-Cw-oC2ps.d.ts → index-BUJsM0oV.d.ts} +1 -1
  21. package/dist/{index-HPYawTae.d.ts → index-BwmXxqbi.d.ts} +1 -1
  22. package/dist/{index-DPWyk3lG.d.ts → index-CRmyGzS8.d.ts} +7 -1
  23. package/dist/{index-K0Za9YXc.d.ts → index-CYac3_ID.d.ts} +26 -22
  24. package/dist/{index-BpQx2UG4.d.ts → index-DaXz-4c7.d.ts} +10 -8
  25. package/dist/{index-DpltOCot.d.ts → index-QuqD4Dyj.d.ts} +109 -27
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js +4 -4
  28. package/dist/internal/index.d.ts +2 -2
  29. package/dist/internal/index.js +4 -4
  30. package/dist/{mapped-view-store-ld-6uxEU.js → mapped-view-store-XUJ-fnHE.js} +1 -1
  31. package/dist/{native-grouping-input-DMNcsIaW.js → native-grouping-input-8kO12VK9.js} +1 -1
  32. package/dist/pagination/index.d.ts +1 -1
  33. package/dist/pagination/index.js +1 -1
  34. package/dist/pagination/react.d.ts +2 -2
  35. package/dist/pagination/react.js +5 -5
  36. package/dist/{pagination-D_A8iPJP.js → pagination-ChDBJtdC.js} +1 -1
  37. package/dist/{plugin-DWzkJbnJ.js → plugin-BvM4s-Lr.js} +1481 -964
  38. package/dist/{range-geometry-BjeLHOnl.js → range-geometry-B5CITwMp.js} +2 -2
  39. package/dist/{range-geometry-BLAHRE11.d.ts → range-geometry-wFuJaBlA.d.ts} +1 -1
  40. package/dist/react/index.d.ts +5 -5
  41. package/dist/react/index.js +6 -6
  42. package/dist/react/virtualized.d.ts +2 -2
  43. package/dist/react/virtualized.js +1 -1
  44. package/dist/{react-DZ15gmz2.js → react-cmFeNP6P.js} +16 -8
  45. package/dist/{retraction-BMem8Rfk.js → retraction-lXQwo2Ia.js} +1 -1
  46. package/dist/{src-cT1OTKP_.js → src-BA6F9yxN.js} +195 -3
  47. package/dist/{store-Cz2mXyDe.js → store-Bllfuqp4.js} +24 -11
  48. package/dist/testing/index.d.ts +2 -2
  49. package/dist/testing/index.js +3 -3
  50. package/dist/{use-editor-dom-scope-BbMDSCpW.js → use-editor-dom-scope-B4gF9t_Y.js} +572 -524
  51. package/dist/yjs/index.d.ts +1 -1
  52. package/dist/yjs/index.js +1 -1
  53. package/dist/yjs/react/index.d.ts +3 -3
  54. package/dist/yjs/react/index.js +3 -3
  55. package/dist/{yjs-DOK-m7kl.js → yjs-CWdWDrpv.js} +5 -2
  56. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { Aa as nodes, B as NodeApi, Bt as point, Cu as getEditorRuntime, Dn as attachTransactionSpecAfterCommit, Du as hasEditorRuntime, Ei as withUpdateTagContext, El as getCompiledSchemaPropertyId, Et as isInline, Eu as getEditorSchema, F as getActiveCommandEditor, Fd as DocumentIndex, Fn as getActiveEditorTransaction, Is as EditorSchemaValidationError, Jc as getPublicExplicitLocationRoot, Kr as resolveEditorNodeKeyForNode, Lt as next, M as dispatchCommand, N as evaluateCommand, P as evaluateCommandWithState, Ra as getCaretOwner, Sn as applyTransactionSpec, Ss as mapSelectionThroughChange, Tu as getEditorRuntimeRoot, U as after, V as above, Va as holdsCaret, W as before, Wt as range, Xa as resolveParkedCaret, Xc as toPublicRoot, Yc as toInternalRoot, Zf as countCoreWork, al as reportEditorLifecycleError, at as getNodeKey, au as ElementApi, bt as isBlock, ct as getSelection$1, dl as getCompiledEditorSchema, dn as voidEditor, do as getOwnViewPresentation, eo as setSelectionAsView, eu as failInvariant, fi as subscribeCaretTarget, ft as hasPath, fu as LocationApi, gd as valueRoot, gi as toEditorCoreStateView, hc as getEditorCommitSnapshot, hu as PointApi, ic as createDetachedContentSlice, if as getNodeKeyForNode, ip as getDefined, is as getInternalEditorSchemaFromApi, iu as SelectionApi, ki as captureSliceLanding, kt as isVoid$2, ku as defineCommand, l as definePlugin, la as readRemovalLanding, lt as getSnapshot, lu as TextApi, m as getInstalledPlugin, md as mapInternalDocumentChangePosition, ml as getPluginRegistry, mn as editorCommands, mo as getViewFollowTarget, mr as getSetSite, mu as RangeApi, ni as setEditorFocused, nr as getEditorStateView, oa as withLandingBlock, ot as getPathByNodeKey, ou as formatDebugValue, pd as mapInternalDocumentChangePoint, pl as getPluginContributions, qa as placedSince, rc as ContentSlice, rs as getCompiledEditorSchemaFromApi, sn as unhangRange, tt as getChildren, tu as definePluginPoint, ud as hasInternalDocumentChangeRoot, ur as getNodeTargetRoot, vc as getEditorCommitValue, vn as afterActiveTransactionEnds, wa as isTextCell, wu as getEditorRuntimeOwner, xu as PathApi, ys as getSelectionDOMRange, za as getPlacementGeneration, zn as getBaseCallRoot, zo as txLocate } from "./plugin-DWzkJbnJ.js";
2
- import { a as transferEntries, n as checkFilesLanding, r as checkTransfer } from "./src-cT1OTKP_.js";
1
+ import { $a as resolveParkedCaret, Ai as captureSliceLanding, Au as hasEditorRuntime, B as NodeApi, Bt as point, Da as isTextCell, Di as withUpdateTagContext, Dl as getPluginRegistry, Du as getEditorRuntimeOwner, El as getPluginContributions, En as attachTransactionSpecAfterCommit, Es as getSelectionDOMRange, Et as isInline, Eu as getEditorRuntime, F as getActiveCommandEditor, Ha as getPlacementGeneration, Jf as RangeApi, Ko as txLocate, Lt as next, M as dispatchCommand, Mu as defineCommand, N as evaluateCommand, Na as nodes, Ou as getEditorRuntimeRoot, P as evaluateCommandWithState, Pn as getActiveEditorTransaction, Qn as getEditorReadDepth, Rd as DocumentIndex, Rn as getBaseCallRoot, Sc as getEditorCommitSnapshot, Su as TextApi, Tc as getEditorCommitValue, U as after, Us as EditorSchemaValidationError, V as above, Va as getCaretOwner, W as before, Wa as holdsCaret, Wt as range, Xa as placedSince, Yf as LocationApi, Zf as PointApi, _d as mapInternalDocumentChangePosition, _i as toEditorCoreStateView, _n as afterActiveTransactionEnds, _u as SelectionApi, at as getNodeKey, bt as isBlock, cl as toInternalRoot, ct as getSelection$1, dc as createDetachedContentSlice, dn as voidEditor, dp as countCoreWork, ds as getInternalEditorSchemaFromApi, fa as readRemovalLanding, ft as hasPath, gd as mapInternalDocumentChangePoint, go as getOwnViewPresentation, ks as mapSelectionThroughChange, kt as isVoid$2, ku as getEditorSchema, l as definePlugin, la as withLandingBlock, ll as toPublicRoot, lr as getNodeTargetRoot, lt as getSnapshot, m as getInstalledPlugin, mu as definePluginPoint, np as PathApi, ot as getPathByNodeKey, pd as hasInternalDocumentChangeRoot, pi as subscribeCaretTarget, pn as editorCommands, pr as getSetSite, pu as failInvariant, qr as resolveEditorNodeKeyForNode, ri as setEditorFocused, ro as setSelectionAsView, sf as getNodeKeyForNode, sl as getPublicExplicitLocationRoot, sn as unhangRange, tr as getEditorStateView, tt as getChildren, uc as ContentSlice, us as getCompiledEditorSchemaFromApi, vl as reportEditorLifecycleError, vp as getDefined, vu as ElementApi, wl as getCompiledEditorSchema, xn as applyTransactionSpec, yd as valueRoot, yo as getViewFollowTarget, yu as formatDebugValue, zl as getCompiledSchemaPropertyId } from "./plugin-BvM4s-Lr.js";
2
+ import { a as transferEntries, n as checkFilesLanding, r as checkTransfer } from "./src-BA6F9yxN.js";
3
3
  import scrollIntoViewIfNeeded from "scroll-into-view-if-needed";
4
4
  //#region src/dom/utils/dom.ts
5
5
  globalThis.Node;
@@ -200,6 +200,10 @@ const getFlatTreeParentElement = (element) => {
200
200
  const ShadowRootConstructor = element.ownerDocument.defaultView?.ShadowRoot;
201
201
  return ShadowRootConstructor && root instanceof ShadowRootConstructor ? root.host : null;
202
202
  };
203
+ const pageOf = (document) => {
204
+ const frame = document.defaultView?.frameElement;
205
+ return frame ? pageOf(frame.ownerDocument) : document;
206
+ };
203
207
  /**
204
208
  * Retrieves the deepest active element in the DOM, considering nested shadow DOMs.
205
209
  */
@@ -3893,6 +3897,28 @@ const registerTreesAbove = (element) => {
3893
3897
  }
3894
3898
  };
3895
3899
  const shadowRootOf = (host) => host.shadowRoot ?? SHADOW_ROOT_BY_HOST.get(host);
3900
+ /**
3901
+ * Whether the element itself holds focus. It walks up from the element, so a
3902
+ * closed shadow root nobody registered counts, and a host whose own shadow
3903
+ * tree holds focus does not.
3904
+ */
3905
+ const isElementFocused = (element) => {
3906
+ const frameDocument = "contentDocument" in element ? element.contentDocument : null;
3907
+ const inner = shadowRootOf(element) ?? frameDocument;
3908
+ if (inner?.activeElement && inner.activeElement !== frameDocument?.body) return false;
3909
+ let node = element;
3910
+ for (;;) {
3911
+ const tree = node.getRootNode();
3912
+ if (tree.activeElement !== node) return false;
3913
+ if ("host" in tree) {
3914
+ node = tree.host;
3915
+ continue;
3916
+ }
3917
+ const frame = tree.defaultView?.frameElement;
3918
+ if (!frame) return true;
3919
+ node = frame;
3920
+ }
3921
+ };
3896
3922
  const resolveInnermostElementAtPoint = (document, x, y) => {
3897
3923
  let element = document.elementFromPoint(x, y);
3898
3924
  for (let inner = element && shadowRootOf(element)?.elementFromPoint(x, y); inner && inner !== element; inner = shadowRootOf(element)?.elementFromPoint(x, y)) element = inner;
@@ -3907,6 +3933,7 @@ const focusedElementOf = (top) => {
3907
3933
  }
3908
3934
  return null;
3909
3935
  };
3936
+ const focusedElementOnPage = (node) => focusedElementOf(pageOf(node.ownerDocument ?? node));
3910
3937
  const outerElementOf = (element) => {
3911
3938
  if (element.parentElement) return element.parentElement;
3912
3939
  const parent = element.parentNode;
@@ -7212,7 +7239,7 @@ const resolveNextKeyCaret = (view, editable) => {
7212
7239
  };
7213
7240
  const ensureFocusCaret = (view, editable) => {
7214
7241
  const caret = resolveNextKeyCaret(view, editable);
7215
- if (!caret) {
7242
+ if (!caret && getEditorReadDepth(getEditorRuntimeOwner(view)) === 0) {
7216
7243
  const start = view.read.points.start([]);
7217
7244
  if (start) setSelectionAsView(view, start);
7218
7245
  }
@@ -7222,19 +7249,26 @@ const ensureFocusCaret = (view, editable) => {
7222
7249
  //#region src/dom/plugin/dom-editor.ts
7223
7250
  const EDITOR_TO_CANCEL_FOCUS_RETRY = /* @__PURE__ */ new WeakMap();
7224
7251
  const EDITOR_TO_FOCUS_REQUEST_GENERATION = /* @__PURE__ */ new WeakMap();
7225
- const ROOT_TO_FOCUS_REQUEST_OWNER = /* @__PURE__ */ new WeakMap();
7252
+ const PAGE_TO_FOCUS_REQUEST_OWNER = /* @__PURE__ */ new WeakMap();
7226
7253
  const supersedeFocusRequest = (editor) => {
7227
7254
  EDITOR_TO_FOCUS_REQUEST_GENERATION.set(editor, (EDITOR_TO_FOCUS_REQUEST_GENERATION.get(editor) ?? 0) + 1);
7228
7255
  EDITOR_TO_CANCEL_FOCUS_RETRY.get(editor)?.();
7229
7256
  EDITOR_TO_CANCEL_FOCUS_RETRY.delete(editor);
7230
7257
  };
7231
- const focusRetries = (options) => options?.retries ?? 50;
7232
- const claimFocusRequest = (editor, root) => {
7258
+ const readFocusRequest = (node) => node && PAGE_TO_FOCUS_REQUEST_OWNER.get(pageOf(node.ownerDocument ?? node));
7259
+ const watchFocusSuperseded = (editor, node) => {
7260
+ const page = node ?? resolveLastEditorWindow(editor)?.document;
7261
+ const generation = EDITOR_TO_FOCUS_REQUEST_GENERATION.get(editor);
7262
+ const owner = readFocusRequest(page);
7263
+ return () => EDITOR_TO_FOCUS_REQUEST_GENERATION.get(editor) !== generation || readFocusRequest(page) !== owner;
7264
+ };
7265
+ const isFocusRequestedElsewhere = (editor, node) => {
7266
+ const holder = readFocusRequest(node)?.editor.deref();
7267
+ return !!holder && holder !== editor && holder !== reachView(editor);
7268
+ };
7269
+ const claimFocusRequest = (editor, element) => {
7233
7270
  supersedeFocusRequest(editor);
7234
- ROOT_TO_FOCUS_REQUEST_OWNER.set(root, {
7235
- editor,
7236
- generation: EDITOR_TO_FOCUS_REQUEST_GENERATION.get(editor) ?? 0
7237
- });
7271
+ PAGE_TO_FOCUS_REQUEST_OWNER.set(pageOf(element.ownerDocument), { editor: new WeakRef(editor) });
7238
7272
  };
7239
7273
  const getLastChildren = (element) => {
7240
7274
  if (element.childElementCount > 0) return getLastChildren(element.children[0]);
@@ -7581,8 +7615,9 @@ const DOMEditorImpl = {
7581
7615
  const el = DOMEditor.editable(editor);
7582
7616
  const root = DOMEditor.resolveDocumentOrShadowRoot(editor);
7583
7617
  if (!el || !root) return;
7584
- if (ROOT_TO_FOCUS_REQUEST_OWNER.get(root)?.editor === editor) ROOT_TO_FOCUS_REQUEST_OWNER.delete(root);
7585
- if (root.activeElement === el) el.blur();
7618
+ const focusElement = findDOMRootRuntime(el)?.nodeSelectionFocus();
7619
+ if (focusElement && isElementFocused(focusElement)) focusElement.blur();
7620
+ else if (isElementFocused(el)) el.blur();
7586
7621
  },
7587
7622
  deselect: (editor) => {
7588
7623
  const selection = editor.read((state) => state.selection());
@@ -7667,25 +7702,25 @@ const DOMEditorImpl = {
7667
7702
  },
7668
7703
  resolvePath: (editor, node) => resolvePliteNodePath(editor, node),
7669
7704
  focus: (editor, options = {}) => {
7670
- const retries = focusRetries(options);
7671
- const focusRequestGeneration = (EDITOR_TO_FOCUS_REQUEST_GENERATION.get(editor) ?? 0) + 1;
7672
- EDITOR_TO_FOCUS_REQUEST_GENERATION.set(editor, focusRequestGeneration);
7705
+ const retries = options.retries ?? 50;
7706
+ supersedeFocusRequest(editor);
7673
7707
  const el = DOMEditor.editable(editor);
7674
7708
  const root = DOMEditor.resolveDocumentOrShadowRoot(editor);
7675
7709
  if (!el || !root) return;
7676
- const focusRequestOwner = {
7677
- editor,
7678
- generation: focusRequestGeneration
7679
- };
7680
- ROOT_TO_FOCUS_REQUEST_OWNER.set(root, focusRequestOwner);
7681
7710
  if (retries <= 0) return;
7711
+ PAGE_TO_FOCUS_REQUEST_OWNER.set(pageOf(el.ownerDocument), { editor: new WeakRef(editor) });
7712
+ const superseded = watchFocusSuperseded(editor, el);
7713
+ const markAndFocus = () => {
7714
+ IS_FOCUSED.set(editor, true);
7715
+ setEditorFocused(editor, true);
7716
+ el.focus({ preventScroll: true });
7717
+ };
7682
7718
  if (IS_NODE_MAP_DIRTY.get(editor)) {
7683
- EDITOR_TO_CANCEL_FOCUS_RETRY.get(editor)?.();
7684
7719
  let cancel = () => {};
7685
7720
  const generation = getPlacementGeneration(editor);
7686
7721
  cancel = scheduleEditorDOMPhase(editor, "dom-write", "dom-editor-focus-retry", () => {
7687
7722
  if (EDITOR_TO_CANCEL_FOCUS_RETRY.get(editor) === cancel) EDITOR_TO_CANCEL_FOCUS_RETRY.delete(editor);
7688
- if (ROOT_TO_FOCUS_REQUEST_OWNER.get(root) !== focusRequestOwner || placedSince(editor, generation)) return;
7723
+ if (superseded() || placedSince(editor, generation)) return;
7689
7724
  DOMEditor.focus(editor, { retries: retries - 1 });
7690
7725
  }, {
7691
7726
  delay: 10,
@@ -7695,9 +7730,9 @@ const DOMEditorImpl = {
7695
7730
  EDITOR_TO_CANCEL_FOCUS_RETRY.set(editor, cancel);
7696
7731
  return;
7697
7732
  }
7698
- EDITOR_TO_CANCEL_FOCUS_RETRY.get(editor)?.();
7699
- EDITOR_TO_CANCEL_FOCUS_RETRY.delete(editor);
7733
+ if (findDOMRootRuntime(el)?.focusSelection(el)) return;
7700
7734
  const selection = ensureFocusCaret(editor, el);
7735
+ if (superseded()) return;
7701
7736
  const selectionAtFocus = selection ? getSelectionDOMRange(editor, selection) : null;
7702
7737
  const syncDomSelection = () => {
7703
7738
  if (findDOMRootRuntime(el)?.isSelectionHeld()) return;
@@ -7726,7 +7761,7 @@ const DOMEditorImpl = {
7726
7761
  };
7727
7762
  let ownedActiveElement = root.activeElement === el || root.activeElement && containsShadowAware(el, root.activeElement) ? root.activeElement : null;
7728
7763
  const settleFocus = () => {
7729
- if (EDITOR_TO_FOCUS_REQUEST_GENERATION.get(editor) !== focusRequestGeneration || ROOT_TO_FOCUS_REQUEST_OWNER.get(root) !== focusRequestOwner) return;
7764
+ if (superseded()) return;
7730
7765
  if (DOMEditor.editable(editor) !== el || !el.isConnected || el.getRootNode() !== root) return;
7731
7766
  const rootActiveElement = root.activeElement;
7732
7767
  const shadowHost = "host" in root ? root.host : null;
@@ -7740,9 +7775,8 @@ const DOMEditorImpl = {
7740
7775
  return;
7741
7776
  }
7742
7777
  if (!(activeElement === null || activeElement === el.ownerDocument.body || rootActiveElement === null && activeElement === shadowHost || activeElement === ownedActiveElement && !activeElement.isConnected)) return;
7743
- IS_FOCUSED.set(editor, true);
7744
- setEditorFocused(editor, true);
7745
- el.focus({ preventScroll: true });
7778
+ markAndFocus();
7779
+ if (superseded()) return;
7746
7780
  trySyncDomSelection();
7747
7781
  };
7748
7782
  const scheduleFocusSettle = () => {
@@ -7761,14 +7795,16 @@ const DOMEditorImpl = {
7761
7795
  });
7762
7796
  };
7763
7797
  if (root.activeElement !== el) {
7764
- IS_FOCUSED.set(editor, true);
7765
- setEditorFocused(editor, true);
7766
7798
  const { activeElement } = root;
7767
- if (isDOMElement(activeElement) && containsShadowAware(el, activeElement) && "blur" in activeElement && typeof activeElement.blur === "function") activeElement.blur();
7768
- el.focus({ preventScroll: true });
7799
+ if (isDOMElement(activeElement) && containsShadowAware(el, activeElement) && "blur" in activeElement && typeof activeElement.blur === "function") {
7800
+ activeElement.blur();
7801
+ if (superseded()) return;
7802
+ }
7803
+ markAndFocus();
7804
+ if (superseded()) return;
7769
7805
  trySyncDomSelection();
7770
7806
  if (selectionAtFocus) scheduleEditorDOMPhase(editor, "selection-repair", "dom-editor-focus-selection-sync", () => {
7771
- if (root.activeElement !== el) return;
7807
+ if (superseded() || !isElementFocused(el)) return;
7772
7808
  const currentSelection = getSelectionDOMRange(editor, resolveNextKeyCaret(editor, el));
7773
7809
  if (!currentSelection || !RangeApi.equals(currentSelection, selectionAtFocus)) return;
7774
7810
  trySyncDomSelection();
@@ -8418,12 +8454,7 @@ const createDOMEditorCapability = (editor) => {
8418
8454
  };
8419
8455
  const capability = {
8420
8456
  blur: () => {
8421
- const view = reachView(editor);
8422
- const el = DOMEditorImpl.editable(view);
8423
- const focusElement = el && findDOMRootRuntime(el)?.nodeSelectionFocus();
8424
- const held = !!focusElement && focusElement.getRootNode().activeElement === focusElement;
8425
- DOMEditorImpl.blur(view);
8426
- if (held) focusElement.blur();
8457
+ DOMEditor.blur(editor);
8427
8458
  },
8428
8459
  deselect: () => {
8429
8460
  DOMEditor.deselect(editor);
@@ -8435,12 +8466,6 @@ const createDOMEditorCapability = (editor) => {
8435
8466
  findKey: (node) => DOMEditor.findKey(editor, node),
8436
8467
  assertPath: (node) => DOMEditor.assertPath(editor, node),
8437
8468
  focus: (options) => {
8438
- const view = reachView(editor);
8439
- const el = DOMEditorImpl.editable(view);
8440
- if (focusRetries(options) > 0 && el) {
8441
- claimFocusRequest(view, el.getRootNode());
8442
- if (findDOMRootRuntime(el)?.focusSelection(el)) return;
8443
- }
8444
8469
  DOMEditor.focus(editor, options);
8445
8470
  },
8446
8471
  getWindow: () => DOMEditor.getWindow(editor),
@@ -9217,4 +9242,4 @@ const keyToDataAttribute = (key) => `data-editor-${toKebabCase(key)}`;
9217
9242
  /** Return DOM data attribute names that mirror primitive node properties. */
9218
9243
  const getNodeDataAttributeKeys = (node) => Object.keys(node).filter((key) => typeof node[key] !== "object" && (!TextApi.isText(node) || key !== "text")).map((key) => keyToDataAttribute(key));
9219
9244
  //#endregion
9220
- export { copyIntentOf as $, EDITOR_TO_RUNTIME_ID_TO_ELEMENTS as $n, readDOMSelectionPoints as $t, findDOMPointElementInRoot as A, getUsableRangeRects as An, isSoftLineEndBetween as At, setEditorDOMRootElement as B, setDOMTextFlowRecordIndex as Bn, findDOMRootRuntime as Bt, normalizeRange as C, getPliteStringEdgeOffset as Cn, isDOMElement as Cr, observeDataTransferInsertion as Ct, DOMEditor as D, getPliteTextHostBounds as Dn, isPlainTextOnlyPaste as Dr, SOFT_LINE_END_SELECTOR as Dt, verifyDiffState as E, getPliteStringPlacementDOMPoint as En, isDOMText as Er, SOFT_LINE_END as Et, resolveDOMPointInRoot as F, resolveDOMTextFlowEntry as Fn, recordSoftLineEnd as Ft, ensureFocusCaret as G, EDITOR_TO_FORCE_RENDER as Gn, isDOMSyncMutation as Gt, subscribeEditorDOMScope as H, DOMCoverage as Hn, getEditorDOMRoot as Ht, resolveDOMRangeInRoot as I, resolveDOMTextFlowInsertTarget as In, resolveSoftLineEndDOMPoint as It, eventCarriesBlockFragment as J, EDITOR_TO_PENDING_DIFFS as Jn, scheduleEditorDOMPhase as Jt, liftCaretOutOfCollapsedSection as K, EDITOR_TO_KEY_TO_ELEMENT as Kn, markDOMSyncMutationTarget as Kt, resolveWrittenDOMRange as L, resolveDOMTextFlowOffset as Ln, findMountedDOMNodeByPath as Lt, getOrCreateDOMNodeKey as M, isDOMTextFlowSegmentSynchronized as Mn, noteAfterInsertCaret as Mt, isSelectableDOMSelection as N, readDOMTextFlowPaint as Nn, readAfterInsertCaret as Nt, DOMResolutionError as O, getPliteTextHostStrings as On, markPlainTextPaste as Or, SOFT_LINE_FLAG as Ot, isTrackedMutation as P, releaseDOMTextFlowRecordIndex as Pn, readLowerSoftLineEnd as Pt, walkClipChain as Q, EDITOR_TO_ROOT_VIEW_EDITORS as Qn, getDOMRangeSelectionPoints as Qt, setEditableRootReveal as R, resolveDOMTextFlowRecordDOMText as Rn, resolvePliteNodePath as Rt, normalizePoint as S, getPliteStringDocumentOffset as Sn, isBefore as Sr, dataTransferFormats as St, targetRange as T, getPliteStringPlacementAtX as Tn, isDOMSelection as Tr, Key as Tt, supersedeFocusRequest as U, isCollapsedDOMCoverageBoundary as Un, resolveDOMReach as Ut, setEditorDOMScrollElement as V, setDOMTextFlowRecordIndexes as Vn, findEditorDOMRootRuntime as Vt, writeViewSelectionPart as W, EDITOR_TO_ELEMENT as Wn, resolveDOMTargetView as Wt, getDragAutoScrollTarget as X, EDITOR_TO_PENDING_SELECTION as Xn, forgetDOMSelectionRecord as Xt, resolveBlockFragmentDropRange as Y, EDITOR_TO_PENDING_INSERTION_MARKS as Yn, changeDOMSelection as Yt, intersectClipChain as Z, EDITOR_TO_PLACEHOLDER_ELEMENT as Zn, forgetDOMSelectionRecordWithin as Zt, TRIPLE_CLICK as _, createDOMGeometryKernel as _n, getDefaultView as _r, domCommands as _t, isLeaf as a, writeDOMSelection as an, ELEMENT_TO_EDITOR as ar, cancelDragRest as at, longestCommonPrefixLength as b, getPliteStringCoordinatePlacement as bn, hasShadowRoot as br, writeDOMFragmentData as bt, isText as c, CAN_USE_DOM as cn, IS_FOCUSED as cr, isDragSessionClaimed as ct, Hotkeys as d, isAndroidDOMHost as dn, NODE_TO_ELEMENT as dr, settleDragSession as dt, readDOMSelectionRange as en, EDITOR_TO_RUNTIME_ID_TO_KEY as er, indicateDOMDropTarget as et, getLineBoundaryKeyboardMove as f, isBlinkDOMHost as fn, NODE_TO_INDEX as fr, takeDragSession as ft, isHotkey as g, usesAppleDOMHotkeys as gn, getActiveElement as gr, cleanDOMClipboardContents as gt, createCompiledHotkeyMatcher as h, supportsDOMBeforeInput as hn, containsShadowAware as hr, subscribeDropIndicator as ht, isElement as i, sameDOMSelectionPoints as in, EDITOR_TO_WINDOW as ir, beginDragSession as it, getEditorDOMHostScrollElement as j, hasUsableDOMRect as jn, isSoftLineTextStale as jt, createDOMEditorCapability as k, getTextFlowPointAtCoordinates as kn, normalizeDOMPoint as kr, clearAfterInsertCaret as kt, isVoid as l, getDOMHostLanguage as ln, IS_NODE_MAP_DIRTY as lr, readDragSession as lt, ariaKeyShortcuts as m, isWebKitDOMHost as mn, closestShadowAware as mr, readDropIndicator as mt, getNodeDataAttributeKeys as n, readsSelectionAsHost as nn, EDITOR_TO_USER_MARKS as nr, resolveDOMDropTarget as nt, isNode as o, enableKernelTraceRetention as on, ELEMENT_TO_NODE as or, clearDragScrollRepaint as ot, isPasteWithoutFormatting as p, isGeckoDOMHost as pn, NODE_TO_PARENT as pr, publishDropIndicator as pt, resolveNextKeyCaret as q, EDITOR_TO_PENDING_ACTION as qn, watchDOMSyncTextMarks as qt, isEditor as r, recordDOMSelection as rn, EDITOR_TO_USER_SELECTION as rr, restDOMBlockDrag as rt, isString as s, selectDOMInputDefaultActionPhase as sn, IS_COMPOSING as sr, clearDragSession as st, getElements as t, readDOMSelectionRecord as tn, EDITOR_TO_SCHEDULE_FLUSH as tr, pointAt as tt, keyToDataAttribute as u, hasDOMHostQuirk as un, IS_READ_ONLY as ur, setDragScrollRepaint as ut, dom as v, getNearestPliteStringRect as vn, getFlatTreeParentElement as vr, getDOMClipboardFormatKey as vt, normalizeStringDiff as w, getPliteStringLength as wn, isDOMNode as wr, writeDataTransferFragment as wt, mergeStringDiffs as x, getPliteStringDirectPlacement as xn, isAfter as xr, writeDOMRangeData as xt, applyStringDiff as y, getOwnedPliteTextStrings as yn, getSelection as yr, writeDOMDataTransferFragment as yt, setEditorDOMEditableElement as z, resolveDOMTextFlowRecordText as zn, DOMRootRuntime as zt };
9245
+ export { getDragAutoScrollTarget as $, EDITOR_TO_PENDING_DIFFS as $n, scheduleEditorDOMPhase as $t, createDOMEditorCapability as A, getPliteStringPlacementAtX as An, isDOMSelection as Ar, SOFT_LINE_END_SELECTOR as At, setEditableRootReveal as B, resolveDOMTextFlowEntry as Bn, findMountedDOMNodeByPath as Bt, normalizeRange as C, getNearestPliteStringRect as Cn, getFlatTreeParentElement as Cr, writeDOMFragmentData as Ct, DOMEditor as D, getPliteStringDocumentOffset as Dn, isBefore as Dr, writeDataTransferFragment as Dt, verifyDiffState as E, getPliteStringDirectPlacement as En, isAfter as Er, observeDataTransferInsertion as Et, isSelectableDOMSelection as F, getUsableRangeRects as Fn, noteAfterInsertCaret as Ft, supersedeFocusRequest as G, setDOMTextFlowRecordIndex as Gn, focusedElementOnPage as Gt, setEditorDOMRootElement as H, resolveDOMTextFlowOffset as Hn, DOMRootRuntime as Ht, isTrackedMutation as I, hasUsableDOMRect as In, readAfterInsertCaret as It, ensureFocusCaret as J, isCollapsedDOMCoverageBoundary as Jn, resolveDOMReach as Jt, watchFocusSuperseded as K, setDOMTextFlowRecordIndexes as Kn, getEditorDOMRoot as Kt, resolveDOMPointInRoot as L, isDOMTextFlowSegmentSynchronized as Ln, readLowerSoftLineEnd as Lt, getEditorDOMHostScrollElement as M, getPliteTextHostBounds as Mn, isPlainTextOnlyPaste as Mr, clearAfterInsertCaret as Mt, getOrCreateDOMNodeKey as N, getPliteTextHostStrings as Nn, markPlainTextPaste as Nr, isSoftLineEndBetween as Nt, DOMResolutionError as O, getPliteStringEdgeOffset as On, isDOMElement as Or, Key as Ot, isFocusRequestedElsewhere as P, getTextFlowPointAtCoordinates as Pn, normalizeDOMPoint as Pr, isSoftLineTextStale as Pt, resolveBlockFragmentDropRange as Q, EDITOR_TO_PENDING_ACTION as Qn, watchDOMSyncTextMarks as Qt, resolveDOMRangeInRoot as R, readDOMTextFlowPaint as Rn, recordSoftLineEnd as Rt, normalizePoint as S, createDOMGeometryKernel as Sn, getDefaultView as Sr, writeDOMDataTransferFragment as St, targetRange as T, getPliteStringCoordinatePlacement as Tn, hasShadowRoot as Tr, dataTransferFormats as Tt, setEditorDOMScrollElement as U, resolveDOMTextFlowRecordDOMText as Un, findDOMRootRuntime as Ut, setEditorDOMEditableElement as V, resolveDOMTextFlowInsertTarget as Vn, resolvePliteNodePath as Vt, subscribeEditorDOMScope as W, resolveDOMTextFlowRecordText as Wn, findEditorDOMRootRuntime as Wt, resolveNextKeyCaret as X, EDITOR_TO_FORCE_RENDER as Xn, isDOMSyncMutation as Xt, liftCaretOutOfCollapsedSection as Y, EDITOR_TO_ELEMENT as Yn, resolveDOMTargetView as Yt, eventCarriesBlockFragment as Z, EDITOR_TO_KEY_TO_ELEMENT as Zn, markDOMSyncMutationTarget as Zt, TRIPLE_CLICK as _, isBlinkDOMHost as _n, NODE_TO_INDEX as _r, readDropIndicator as _t, isLeaf as a, readDOMSelectionRange as an, EDITOR_TO_RUNTIME_ID_TO_KEY as ar, resolveDOMDropTarget as at, longestCommonPrefixLength as b, supportsDOMBeforeInput as bn, containsShadowAware as br, domCommands as bt, isText as c, recordDOMSelection as cn, EDITOR_TO_USER_SELECTION as cr, cancelDragRest as ct, Hotkeys as d, enableKernelTraceRetention as dn, ELEMENT_TO_NODE as dr, isDragSessionClaimed as dt, changeDOMSelection as en, EDITOR_TO_PENDING_INSERTION_MARKS as er, intersectClipChain as et, getLineBoundaryKeyboardMove as f, selectDOMInputDefaultActionPhase as fn, IS_COMPOSING as fr, readDragSession as ft, isHotkey as g, isAndroidDOMHost as gn, NODE_TO_ELEMENT as gr, publishDropIndicator as gt, createCompiledHotkeyMatcher as h, hasDOMHostQuirk as hn, IS_READ_ONLY as hr, takeDragSession as ht, isElement as i, readDOMSelectionPoints as in, EDITOR_TO_RUNTIME_ID_TO_ELEMENTS as ir, pointAt as it, findDOMPointElementInRoot as j, getPliteStringPlacementDOMPoint as jn, isDOMText as jr, SOFT_LINE_FLAG as jt, claimFocusRequest as k, getPliteStringLength as kn, isDOMNode as kr, SOFT_LINE_END as kt, isVoid as l, sameDOMSelectionPoints as ln, EDITOR_TO_WINDOW as lr, clearDragScrollRepaint as lt, ariaKeyShortcuts as m, getDOMHostLanguage as mn, IS_NODE_MAP_DIRTY as mr, settleDragSession as mt, getNodeDataAttributeKeys as n, forgetDOMSelectionRecordWithin as nn, EDITOR_TO_PLACEHOLDER_ELEMENT as nr, copyIntentOf as nt, isNode as o, readDOMSelectionRecord as on, EDITOR_TO_SCHEDULE_FLUSH as or, restDOMBlockDrag as ot, isPasteWithoutFormatting as p, CAN_USE_DOM as pn, IS_FOCUSED as pr, setDragScrollRepaint as pt, writeViewSelectionPart as q, DOMCoverage as qn, isElementFocused as qt, isEditor as r, getDOMRangeSelectionPoints as rn, EDITOR_TO_ROOT_VIEW_EDITORS as rr, indicateDOMDropTarget as rt, isString as s, readsSelectionAsHost as sn, EDITOR_TO_USER_MARKS as sr, beginDragSession as st, getElements as t, forgetDOMSelectionRecord as tn, EDITOR_TO_PENDING_SELECTION as tr, walkClipChain as tt, keyToDataAttribute as u, writeDOMSelection as un, ELEMENT_TO_EDITOR as ur, clearDragSession as ut, dom as v, isGeckoDOMHost as vn, NODE_TO_PARENT as vr, subscribeDropIndicator as vt, normalizeStringDiff as w, getOwnedPliteTextStrings as wn, getSelection as wr, writeDOMRangeData as wt, mergeStringDiffs as x, usesAppleDOMHotkeys as xn, getActiveElement as xr, getDOMClipboardFormatKey as xt, applyStringDiff as y, isWebKitDOMHost as yn, closestShadowAware as yr, cleanDOMClipboardContents as yt, resolveWrittenDOMRange as z, releaseDOMTextFlowRecordIndex as zn, resolveSoftLineEndDOMPoint as zt };
@@ -1,4 +1,4 @@
1
- import { Zf as countCoreWork, u as destroyEditor, w as startEditor, wu as getEditorRuntimeOwner, x as releaseEditor } from "./plugin-DWzkJbnJ.js";
1
+ import { Du as getEditorRuntimeOwner, dp as countCoreWork, u as destroyEditor, w as startEditor, x as releaseEditor } from "./plugin-BvM4s-Lr.js";
2
2
  //#region src/core/same-result.ts
3
3
  const MAX_VALUES = 100;
4
4
  const MAX_DEPTH = 64;
@@ -1,4 +1,4 @@
1
- import { Am as TxOnlyMethod, Dc as Editor, Lm as DocumentChange, Om as TxDeclaredMethod, Qd as PluginTypeProvider, Qt as encodeEditorEffect, _a as CarriedRun, bf as Value, bt as encodeEditorSelection, fd as HistoryApi, ga as RootFactsJson, lo as EditorSchemaIdentity, nh as Selection, rl as EditorEffect, xd as Plugin } from "../index-DpltOCot.js";
1
+ import { $t as encodeEditorEffect, Km as DocumentChange, Lm as TxDeclaredMethod, Od as Plugin, Of as Value, af as PluginTypeProvider, ba as RootFactsJson, dh as Selection, jc as Editor, po as EditorSchemaIdentity, sl as EditorEffect, vd as HistoryApi, xa as CarriedRun, xt as encodeEditorSelection, zm as TxOnlyMethod } from "../index-QuqD4Dyj.js";
2
2
  //#region src/history/history.d.ts
3
3
  interface Batch<_V extends Value = Value> {
4
4
  /** Canonical change to apply when this batch is consumed. */
@@ -1,5 +1,5 @@
1
- import { $a as sameCarets, An as documentReplacement, Ar as isInTransaction, As as constructCanonicalDocumentChange, Bo as txOnly, Br as recordEditorHistoryReplayReceipt, Cc as getDocumentChangeRelocations, Cd as addSection, Cu as getEditorRuntime, Dd as getDocumentPropertyContext, Ed as applyPropertyModificationsToSlice, Es as withLandedMarks, Eu as getEditorSchema, Fd as DocumentIndex, Fl as propertyTargetsReadParents, Fs as EditorNoncanonicalChangeError, Fu as UNKNOWN_FACTS, Gu as invertCarriedRun, Hd as normalizeSetValues, Hf as invertEffect, Hu as carriedLetterPairs, Ia as consumeCommitCarets, Is as EditorSchemaValidationError, Iu as composeFacts, Ja as resolveBookmark, Jd as getDocumentSliceNodeKeys, Ju as widenRun, Kc as stageAnchorHistoryRecovery, Kd as closeToken, Kn as getCurrentSelectionRoot, Ku as landCarriedRuns, La as getBookmark, Ll as readEditorSchemaIdentity, Lu as factsFromJSON, Md as markReadBack, Nd as joinsOf, Nu as NO_FACTS, Or as isBuildingTransactionSpec, Pa as changedBookmarks, Pc as getAuthoredUpdateView, Pd as liftOf, Pu as NO_ROOT_FACTS, Qa as rootChildrenOf, Qd as openToken, Qf as readCoreWork, Qu as createInternalDocumentChange, Rd as decodeNodes, Ru as factsToJSON, Sc as snapshotIndexOf, Sd as RootChange, Ss as mapSelectionThroughChange, Td as applyPropertyModifications, Uc as mapAnchorHistoryRecovery, Uf as mapEffect, Ur as registerEditorTransactionGuard, Uu as carriesRun, Vc as consumeAnchorHistoryCapture, Vf as defineUpdateAnnotation, Vr as registerEditorHistoryRuntime, Vu as recordedFacts, Wc as mergeAnchorHistoryRecovery, Wd as PreparedTokenSlice, Wu as exactRunOn, Xc as toPublicRoot, Xd as isTextNode, Xu as alignedDocumentChange, Yd as isElementNode, Yn as getEditorDocumentValue, Yu as DocumentChange, Za as restoreHistoryCarets, Zd as nodeProps, Zf as countCoreWork, Zu as collapseDocumentElementPropertyWrites, _c as getEditorCommitUnsettle, _d as valueRootIndex, _s as decodeEditorSelection, _u as MAIN_ROOT_KEY, ad as getInternalDocumentChangeEntries, al as reportEditorLifecycleError, au as ElementApi, bd as withInternalDocumentRootChange, bl as areEditorSchemaIdentitiesEqual, cc as getEditorCommitAdmission, cd as getInternalDocumentChangeRootKeys, ct as getSelection, dc as getEditorCommitFacts, dl as getCompiledEditorSchema, ef as textToken, fd as isInternalDocumentChangeNoop, gc as getEditorCommitStartedAt, gd as valueRoot, gf as hasRecord, gs as assertSelectionSupported, gu as isObject, hc as getEditorCommitSnapshot, hd as transformInternalDocumentChange, hf as getValueRecords, id as getInternalDocumentChangeClassificationEntries, ip as getDefined, iu as SelectionApi, jf as encodeEditorEffect, ju as classifyDocumentChange, kd as mapRootChangePositionBackward, kf as decodeEditorEffect, l as definePlugin, lc as getEditorCommitCarriedRuns, ld as getInternalDocumentRootChange, md as mapInternalDocumentChangePosition, ml as getPluginRegistry, mu as RangeApi, nf as tokensEqual, np as jsonEqual, od as getInternalDocumentChangeRanges, pc as getEditorCommitRest, pf as getRecordText, qu as mapCarriedRunThrough, rr as getEditorUpdateRoot, sd as getInternalDocumentChangeRecords, td as documentChangeWritesOnlyElementProperties, tf as tokenLength, uc as getEditorCommitCompletedTextDeletion, uf as getRecordEntries, ui as setTypedMarks, vs as encodeEditorSelection, wi as withEditorUpdateRootScope, wu as getEditorRuntimeOwner, xd as withoutRetainedRecordSets, xn as applyDocumentChange, yc as historyReplayClaim, yr as getUpdateView, zf as createEditorEffect, zo as txLocate, zu as flipFacts } from "../plugin-DWzkJbnJ.js";
2
- import { t as nativeGroupingInput } from "../native-grouping-input-DMNcsIaW.js";
1
+ import { $d as isTextNode, $u as alignedDocumentChange, Ac as getDocumentChangeRelocations, Ad as getDocumentPropertyContext, Ar as isInTransaction, Ba as getBookmark, Bc as getAuthoredUpdateView, Bu as factsFromJSON, Cc as getEditorCommitStartedAt, Cd as withInternalDocumentRootChange, Cs as assertSelectionSupported, Dl as getPluginRegistry, Du as getEditorRuntimeOwner, Ec as historyReplayClaim, Ed as addSection, Eu as getEditorRuntime, Fd as markReadBack, Gd as normalizeSetValues, Gf as invertEffect, Gn as getCurrentSelectionRoot, Gu as carriedLetterPairs, Hf as createEditorEffect, Hr as registerEditorHistoryRuntime, Hs as EditorNoncanonicalChangeError, Hu as flipFacts, Id as joinsOf, Iu as NO_FACTS, Jf as RangeApi, Jl as propertyTargetsReadParents, Jn as getEditorDocumentValue, Ju as invertCarriedRun, Kf as mapEffect, Ko as txLocate, Ku as carriesRun, La as changedBookmarks, Ld as liftOf, Ls as constructCanonicalDocumentChange, Lu as NO_ROOT_FACTS, Md as mapRootChangePositionBackward, Mf as decodeEditorEffect, Nl as areEditorSchemaIdentitiesEqual, Ns as withLandedMarks, Od as applyPropertyModifications, Or as isBuildingTransactionSpec, Pf as encodeEditorEffect, Pu as classifyDocumentChange, Qc as consumeAnchorHistoryCapture, Qd as isElementNode, Qf as MAIN_ROOT_KEY, Qu as DocumentChange, Rd as DocumentIndex, Ru as UNKNOWN_FACTS, Sc as getEditorCommitSnapshot, Td as RootChange, Ti as withEditorUpdateRootScope, Ts as encodeEditorSelection, Us as EditorSchemaValidationError, Vd as decodeNodes, Vr as recordEditorHistoryReplayReceipt, Vu as factsToJSON, Wf as defineUpdateAnnotation, Wr as registerEditorTransactionGuard, Wu as recordedFacts, Xl as readEditorSchemaIdentity, Xu as mapCarriedRunThrough, Yd as closeToken, Yu as landCarriedRuns, Za as resolveBookmark, Zd as getDocumentSliceNodeKeys, Zu as widenRun, _c as getEditorCommitCompletedTextDeletion, _d as mapInternalDocumentChangePosition, _u as SelectionApi, af as tokensEqual, al as stageAnchorHistoryRecovery, bc as getEditorCommitRest, bd as valueRootIndex, bn as applyDocumentChange, cd as getInternalDocumentChangeEntries, ct as getSelection, dd as getInternalDocumentChangeRootKeys, di as setTypedMarks, dp as countCoreWork, ed as collapseDocumentElementPropertyWrites, ef as nodeProps, eo as restoreHistoryCarets, fd as getInternalDocumentRootChange, fp as readCoreWork, gc as getEditorCommitCarriedRuns, gf as getRecordText, gp as jsonEqual, hc as getEditorCommitAdmission, hd as isInternalDocumentChangeNoop, id as documentChangeWritesOnlyElementProperties, if as tokenLength, kc as snapshotIndexOf, kd as applyPropertyModificationsToSlice, kn as documentReplacement, ks as mapSelectionThroughChange, ku as getEditorSchema, l as definePlugin, ld as getInternalDocumentChangeRanges, ll as toPublicRoot, nl as mergeAnchorHistoryRecovery, no as sameCarets, nr as getEditorUpdateRoot, pf as getRecordEntries, qd as PreparedTokenSlice, qo as txOnly, qu as exactRunOn, rf as textToken, rp as isObject, sd as getInternalDocumentChangeClassificationEntries, td as createInternalDocumentChange, tf as openToken, tl as mapAnchorHistoryRecovery, to as rootChildrenOf, ud as getInternalDocumentChangeRecords, vc as getEditorCommitFacts, vd as transformInternalDocumentChange, vf as getValueRecords, vl as reportEditorLifecycleError, vp as getDefined, vr as getUpdateView, vu as ElementApi, wc as getEditorCommitUnsettle, wd as withoutRetainedRecordSets, wl as getCompiledEditorSchema, ws as decodeEditorSelection, yd as valueRoot, yf as hasRecord, za as consumeCommitCarets, zu as composeFacts } from "../plugin-BvM4s-Lr.js";
2
+ import { t as nativeGroupingInput } from "../native-grouping-input-8kO12VK9.js";
3
3
  //#region src/core/change/carried-projection.ts
4
4
  /** A projection the documents leave no place for. */
5
5
  var CarriedProjectionError = class extends Error {
@@ -1,2 +1,2 @@
1
- import { a as HyperscriptEditorFixture, c as createText, i as createHyperscript, n as HyperscriptCreators, o as createEditor, r as HyperscriptShorthands, s as createEditorFixture, t as jsx } from "../index-HPYawTae.js";
1
+ import { a as HyperscriptEditorFixture, c as createText, i as createHyperscript, n as HyperscriptCreators, o as createEditor, r as HyperscriptShorthands, s as createEditorFixture, t as jsx } from "../index-BwmXxqbi.js";
2
2
  export { type HyperscriptCreators, type HyperscriptEditorFixture, type HyperscriptShorthands, createEditor, createEditorFixture, createHyperscript, createText, jsx };
@@ -1,2 +1,2 @@
1
- import { a as createText, i as createEditorFixture, n as createHyperscript, r as createEditor, t as jsx } from "../hyperscript-FPuoArEi.js";
1
+ import { a as createText, i as createEditorFixture, n as createHyperscript, r as createEditor, t as jsx } from "../hyperscript-BFypA5qW.js";
2
2
  export { createEditor, createEditorFixture, createHyperscript, createText, jsx };
@@ -1,5 +1,5 @@
1
- import { B as NodeApi, Jt as replace, au as ElementApi, iu as SelectionApi, lu as TextApi, mu as RangeApi } from "./plugin-DWzkJbnJ.js";
2
- import { a as createEditor$1 } from "./create-editor-CkHtPWXV.js";
1
+ import { B as NodeApi, Jf as RangeApi, Jt as replace, Su as TextApi, _u as SelectionApi, vu as ElementApi } from "./plugin-BvM4s-Lr.js";
2
+ import { a as createEditor$1 } from "./create-editor-XvI_4sYc.js";
3
3
  //#region src/hyperscript/tokens.ts
4
4
  /**
5
5
  * A weak map to hold anchor tokens.
@@ -1,4 +1,4 @@
1
- import { Id as PluginFactoryTypeLambda, Ld as PluginFactoryTypeProvider, _g as Range, xd as Plugin } from "./index-DpltOCot.js";
1
+ import { Od as Plugin, Og as Range, Ud as PluginFactoryTypeLambda, Wd as PluginFactoryTypeProvider } from "./index-QuqD4Dyj.js";
2
2
  import * as Y from "yjs";
3
3
  //#region src/yjs/core/editor-adapter.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Dc as Editor, Mg as Path, Qs as Element, mc as Text, nh as Selection, oh as TextSelection, vh as Descendant } from "./index-DpltOCot.js";
1
+ import { Dh as Descendant, Ug as Path, dh as Selection, hh as TextSelection, jc as Editor, nc as Element, vc as Text } from "./index-QuqD4Dyj.js";
2
2
  //#region src/hyperscript/tokens.d.ts
3
3
  /**
4
4
  * All tokens inherit from a single constructor for `instanceof` checking.
@@ -1,4 +1,4 @@
1
- import { Dc as Editor, _g as Range, bf as Value, lg as Anchor, vd as NodeKey } from "./index-DpltOCot.js";
1
+ import { Of as Value, Og as Range, jc as Editor, vg as Anchor, wd as NodeKey } from "./index-QuqD4Dyj.js";
2
2
  //#region src/internal/view/view-source.d.ts
3
3
  type ViewSourcePhase = 'project' | 'read' | 'resolve';
4
4
  /** Diagnostic emitted when an optional view source is deactivated. */
@@ -44,6 +44,12 @@ type AnnotationRefreshOptions = Readonly<{
44
44
  reason?: 'annotation' | 'external' | 'refresh';
45
45
  }>;
46
46
  type AnnotationStoreOptions = Readonly<{
47
+ /**
48
+ * Resolve an annotation whose range covers no letter and no whole void to
49
+ * `range: null`. It still follows the nodes its range touches, so an edit
50
+ * there that brings content back resolves it again.
51
+ */
52
+ hideEmpty?: boolean;
47
53
  id?: string;
48
54
  onError?: ViewSourceErrorSink;
49
55
  }>;
@@ -1,7 +1,7 @@
1
- import { $u as EditorUpdatePolicy, Bc as EditorCommandInput, Cc as CompatibleEditorCommand, Cn as TransferPlugin, Dc as Editor$2, Fd as PluginDependencyReferenceFor, In as TransferOutcome, Kc as EditorCommitContext, Lc as EditorCommandDescriptor, Mg as Path, Mn as TransferInput, Nd as PluginDependencyContractReference, Qs as Element$1, Sn as TransferApi, Tc as CreateEditorOptions$1, Th as Node$1, Uc as EditorCommit, Ud as PluginPortal, Yd as PluginReference, Zu as EditorUpdateContext, _d as NamedRootKey, _g as Range, bc as AnyEditor, bf as Value, bl as EditorLifecycleErrorSink, ch as DecorationAttributes, dd as EditorViewOptions, gf as StateFieldValueInput, gg as BaseRange, hu as EditorStateView, if as PluginsOf, kn as TransferCheck, mc as Text, n as PluginsFromOptions, nu as EditorStateField, of as RootKey, pd as HistoryOutcome, rd as EditorUpdateTransaction, t as EditorValueFromOptions, tu as EditorSnapshot, uh as DecorationSource, vd as NodeKey, xd as Plugin, xf as ValueOf, yd as NodeTarget, zt as CheckedEditorOptions } from "./index-DpltOCot.js";
2
- import { a as AnnotationSnapshot, f as ViewSourceErrorSink, l as ResolvedAnnotation, o as AnnotationStore, t as Annotation } from "./index-DPWyk3lG.js";
3
- import { B as DOMApi, I as DOMEditorOptions, It as DOMCoverageReason, L as DOMPlugin, Mt as DOMCoverageMaterializeReason, O as DataTransferDiagnostic, R as DOMPluginTypes, Rt as DOMCoverageSelectionPolicy, Tt as DOMCoverageBoundary, V as DOMClipboardApi, W as DOMEditor, jt as DOMCoverageMaterializeRangeRole, kt as DOMCoverageCopyPolicy, vt as DropIndicator } from "./index-BpQx2UG4.js";
4
- import { r as ViewportRect, t as RangeGeometry } from "./range-geometry-BLAHRE11.js";
1
+ import { An as TransferCheck, Bd as PluginDependencyContractReference, Bt as CheckedEditorOptions, Cd as NamedRootKey, Cf as StateFieldValueInput, Cn as TransferApi, Dc as CompatibleEditorCommand, Dg as BaseRange, Hd as PluginDependencyReferenceFor, Ln as TransferOutcome, Nn as TransferInput, Od as Plugin, Of as Value, Og as Range, Ph as Node$1, Td as NodeTarget, Tl as EditorLifecycleErrorSink, Ug as Path, Vc as EditorCommandDescriptor, Wc as EditorCommandInput, Xc as EditorCommitContext, Xd as PluginPortal, _h as DecorationAttributes, bu as EditorStateView, cd as EditorUpdateTransaction, df as PluginsOf, gd as EditorViewOptions, id as EditorUpdatePolicy, jc as Editor$2, kc as CreateEditorOptions$1, kf as ValueOf, n as PluginsFromOptions, nc as Element$1, nd as EditorUpdateContext, nf as PluginReference, ou as EditorSnapshot, pf as RootKey, qc as EditorCommit, su as EditorStateField, t as EditorValueFromOptions, vc as Text, wc as AnyEditor, wd as NodeKey, wn as TransferPlugin, yd as HistoryOutcome, yh as DecorationSource } from "./index-QuqD4Dyj.js";
2
+ import { a as AnnotationSnapshot, f as ViewSourceErrorSink, l as ResolvedAnnotation, o as AnnotationStore, t as Annotation } from "./index-CRmyGzS8.js";
3
+ import { B as DOMApi, I as DOMEditorOptions, It as DOMCoverageReason, L as DOMPlugin, Mt as DOMCoverageMaterializeReason, O as DataTransferDiagnostic, R as DOMPluginTypes, Rt as DOMCoverageSelectionPolicy, Tt as DOMCoverageBoundary, V as DOMClipboardApi, W as DOMEditor, jt as DOMCoverageMaterializeRangeRole, kt as DOMCoverageCopyPolicy, vt as DropIndicator } from "./index-DaXz-4c7.js";
4
+ import { r as ViewportRect, t as RangeGeometry } from "./range-geometry-wFuJaBlA.js";
5
5
  import React$1, { CSSProperties, DependencyList, HTMLAttributes, KeyboardEvent as KeyboardEvent$1, MouseEventHandler, ReactNode, Ref, RefObject, TextareaHTMLAttributes } from "react";
6
6
  import "lodash";
7
7
  //#region src/react/editable/runtime-editor-api.d.ts
@@ -531,15 +531,22 @@ type EditableContentRootSlotOptions = {
531
531
  id?: string;
532
532
  /**
533
533
  * The element that takes focus in place of this root's editable when the
534
- * editor moves focus here, as after an undo or on a call to
535
- * `editor.api.dom.focus()`, while there is no selection or a node selection
536
- * holds only top-level blocks of this root. It does not take focus while the
537
- * editor shows a caret or a text selection, even a range drawn on the page
538
- * that reaches into this root, and a click that selects an object in this
539
- * root focuses the editable. When the render that follows a focus call
540
- * replaces the element, focus falls to the page. Unless the element is a
541
- * control, such as a button, the editor reads no keys from it, so it must
542
- * handle the keys it needs, such as undo and redo.
534
+ * editor moves focus here, as after an undo, on a click that selects an
535
+ * object or on a call to `editor.api.dom.focus()`. It takes focus only while
536
+ * no range is shown into this root and the root's own selection is none or
537
+ * a node selection of its top-level blocks, including a node selection the
538
+ * root kept while the caret was in another root. Once the element holds
539
+ * focus, that kept node selection becomes the selection again, so a key the
540
+ * element handles acts on it. It does not come back when the element's focus
541
+ * handler leaves focus on another element, asks for focus elsewhere or
542
+ * changes the selection. A focus call made inside an update or a read focuses
543
+ * the editable instead, as on a root without this element. When the render
544
+ * that follows a focus call replaces the element, focus falls to the page.
545
+ * Give the element `contentEditable={false}`: one that inherits editing runs
546
+ * the editable's own focus handler, which in Firefox moves focus to the
547
+ * editable. Unless the element is a control, such as a button, the editor
548
+ * reads no keys from it, so it must handle the keys it needs, such as undo
549
+ * and redo.
543
550
  */
544
551
  nodeSelectionFocus?: NodeSelectionFocus;
545
552
  placeholder?: ReactNode;
@@ -1158,15 +1165,12 @@ type UseRootEditorOptions = {
1158
1165
  * It obeys the read-only state and the authored view of the mounted view that
1159
1166
  * shows its root, and of the view around the hook while none shows it. Inside
1160
1167
  * a view, that mounted view is the one this view mounts for the root, such as
1161
- * its own board when two editing areas show the same board. While its
1162
- * `EditorRoot` is writable, shows no editing area and the caret is in its
1163
- * root, it follows the editing area that holds the caret, for that area's DOM
1164
- * and the read-only state of that area's `EditorRoot`. It keeps its own
1165
- * `EditorRoot`'s authored view there, and a write that places the caret, even
1166
- * where the caret already is, moves the caret into its own `EditorRoot`, which
1167
- * ends the follow. Use it for root-specific toolbar/sidebar commands. Pass
1168
- * `readOnly: true` when UI only needs read APIs. Exact plugin capability comes
1169
- * from `editor.plugin(Plugin)`.
1168
+ * its own board when two editing areas show the same board. It acts only
1169
+ * under its own `EditorRoot`, so while that `EditorRoot` shows no editing
1170
+ * area for its root, `api.dom.editable()` returns `null`, even when an
1171
+ * editing area in another `EditorRoot` holds the caret. Use it for
1172
+ * root-specific toolbar/sidebar commands. Pass `readOnly: true` when UI only
1173
+ * needs read APIs. Exact plugin capability comes from `editor.plugin(Plugin)`.
1170
1174
  */
1171
1175
  declare function useRootEditor<const TRoot extends RootKey = RootKey>(root?: NamedRootKey<TRoot>, options?: UseRootEditorOptions): Editor;
1172
1176
  /**
@@ -1,4 +1,4 @@
1
- import { Dc as Editor, Mg as Path, Nc as EditorCommand, Og as Point, Qs as Element$1, Th as Node$1, Xc as EditorCoreStateView, _g as Range$1, bc as AnyEditor, bf as Value, cn as ContentSlice, eh as NodeSelection, ih as SelectionAssociation, mc as Text$1, of as RootKey, vd as NodeKey, vh as Descendant, vs as SchemaProperty, xd as Plugin } from "./index-DpltOCot.js";
1
+ import { Dh as Descendant, Lc as EditorCommand, Od as Plugin, Of as Value, Og as Range$1, Ph as Node$1, Ss as SchemaProperty, Ug as Path, el as EditorCoreStateView, jc as Editor, lh as NodeSelection, ln as ContentSlice, nc as Element$1, pf as RootKey, ph as SelectionAssociation, vc as Text$1, wc as AnyEditor, wd as NodeKey, zg as Point } from "./index-QuqD4Dyj.js";
2
2
  import { StandardBehaviorOptions } from "scroll-into-view-if-needed";
3
3
  //#region src/dom/utils/dom.d.ts
4
4
  /**
@@ -451,11 +451,10 @@ interface DOMApi {
451
451
  /**
452
452
  * The DOM document or shadow root holding the Editable of the view this
453
453
  * editor's calls run in. A view's own editor runs in its own view. A
454
- * `useRootEditor` editor runs in a view of its root from its `EditorRoot`.
455
- * While that `EditorRoot` shows no editing area and the caret is in the
456
- * editor's root, it runs in the view that holds the caret. The editor
457
- * `createEditor` returns runs in a view of the selection's root,
458
- * else of main. When the caret was placed in that root from an
454
+ * `useRootEditor` editor runs in a view of its root from its `EditorRoot`,
455
+ * and gets null while that `EditorRoot` shows no editing area for its root.
456
+ * The editor `createEditor` returns runs in a view of the selection's
457
+ * root, else of main. When the caret was placed in that root from an
459
458
  * `EditorRoot`, only that `EditorRoot`'s views of the root count, even
460
459
  * after this editor moves the caret within it. Of the views that count, it
461
460
  * takes the only one, else the one that holds focus, through iframes and
@@ -468,8 +467,11 @@ interface DOMApi {
468
467
  assertPath: (node: Node$1) => Path;
469
468
  /**
470
469
  * Focus the editor's view. The root's `nodeSelectionFocus` element takes
471
- * focus while there is no selection or a node selection holds only the
472
- * root's top-level blocks, and a range shown across roots stays shown.
470
+ * focus while no range is shown into the root and the root's own selection
471
+ * is none or a node selection of its top-level blocks, including one the
472
+ * root kept while the caret was in another root. A range shown into the root
473
+ * stays shown. Inside an open update or read, such a root's editable takes
474
+ * focus instead.
473
475
  */
474
476
  focus: (options?: {
475
477
  retries?: number;