plitejs 54.0.0-beta.7 → 54.0.0-beta.8

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 (54) hide show
  1. package/dist/authored/index.d.ts +44 -41
  2. package/dist/authored/index.js +16489 -16181
  3. package/dist/{authored-veto-CferDljr.js → authored-veto-DLmBMIcy.js} +1 -1
  4. package/dist/{clipboard-format-key-CLFcThXH.js → clipboard-format-key-SzffxWqa.js} +1 -1
  5. package/dist/{comparison-plan-7iIABSWG.js → comparison-plan-BqFJWjO4.js} +36 -14
  6. package/dist/{create-editor-acDgsovY.js → create-editor-kU8fg-PF.js} +6 -30
  7. package/dist/diff/index.d.ts +2 -32
  8. package/dist/diff/index.js +7 -378
  9. package/dist/dom/index.d.ts +2 -2
  10. package/dist/dom/index.js +2 -2
  11. package/dist/{dom-B5bAma7X.js → dom-SUWlnfT9.js} +562 -145
  12. package/dist/history/index.d.ts +5 -5
  13. package/dist/history/index.js +2041 -1833
  14. package/dist/history-skip-CcEhIzak.js +35 -0
  15. package/dist/hyperscript/index.d.ts +1 -1
  16. package/dist/hyperscript/index.js +1 -1
  17. package/dist/{hyperscript-BXUV6sdO.js → hyperscript-DdeGYoSc.js} +3 -2
  18. package/dist/{index-CTTjpWgb.d.ts → index-4PpawhYe.d.ts} +1 -1
  19. package/dist/{index-DJvrmSRP.d.ts → index-BsOySJwr.d.ts} +9 -9
  20. package/dist/{index-D8DQ1YFB.d.ts → index-CHEKdrHP.d.ts} +12 -4
  21. package/dist/{comparison-types-CsmDG5r2.d.ts → index-DM-b6jEe.d.ts} +21 -57
  22. package/dist/{index-LhVJuuEf.d.ts → index-DqmhcD_0.d.ts} +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +5 -4
  25. package/dist/internal/index.d.ts +2 -2
  26. package/dist/internal/index.js +66 -5
  27. package/dist/law-check-Bvnz2EKh.js +19271 -0
  28. package/dist/pagination/index.d.ts +1 -1
  29. package/dist/pagination/index.js +1 -1
  30. package/dist/pagination/react.d.ts +2 -2
  31. package/dist/pagination/react.js +92 -46
  32. package/dist/{pagination-CwjmxPoX.js → pagination-XEnxZ1DX.js} +2 -1
  33. package/dist/{plugin-BZCGtqMI.js → plugin-B8uCi-Hr.js} +8758 -19452
  34. package/dist/{range-geometry-CZari453.d.ts → range-geometry-B2f67yLv.d.ts} +1 -1
  35. package/dist/{range-geometry-CqWrwkjH.js → range-geometry-BGKYQHqO.js} +3 -2
  36. package/dist/react/index.d.ts +3 -3
  37. package/dist/react/index.js +7 -6
  38. package/dist/react/virtualized.d.ts +2 -2
  39. package/dist/react/virtualized.js +59 -38
  40. package/dist/{react-DO9IETEQ.js → react-B6B-5z7t.js} +24 -55
  41. package/dist/{retraction-RHEKiF3h.js → retraction-BMzQ2on5.js} +1 -1
  42. package/dist/scroll-root-DudA40xj.js +25 -0
  43. package/dist/{src-fLbHzUjC.js → src--BZ7fZY4.js} +60 -26
  44. package/dist/testing/index.d.ts +2 -2
  45. package/dist/testing/index.js +4 -3
  46. package/dist/{tx-only-1FM45FSj.d.ts → tx-only-D8lpB-sT.d.ts} +338 -147
  47. package/dist/{update-policy-C32RjjGt.js → update-policy-J-4sHmrg.js} +2 -1
  48. package/dist/{use-editor-dom-scope-CUBnNAZV.js → use-editor-dom-scope-BFWvutxn.js} +2837 -2093
  49. package/dist/yjs/index.d.ts +1 -1
  50. package/dist/yjs/index.js +1 -1
  51. package/dist/yjs/react/index.d.ts +3 -3
  52. package/dist/yjs/react/index.js +3 -3
  53. package/dist/{yjs-BMguSAX_.js → yjs-DPngKQWQ.js} +114 -39
  54. package/package.json +2 -3
@@ -1,7 +1,7 @@
1
- import { Ad as getEditorRuntimeRoot, Ai as toEditorCoreStateView, At as isVoid$2, Cd as TextApi, Cu as getCompiledEditorSchema, Df as valueRoot, Dm as countCoreWork, Dn as attachTransactionSpecAfterCommit, Do as getPlacementGeneration, Dt as isInline, Eo as getCaretOwner, Eu as getPluginRegistry, F as evaluateCommandWithState, Fo as placedSince, G as before, Gt as range, H as above, Ho as setSelectionAsView, I as getActiveCommandEditor, Md as hasEditorRuntime, Ms as txLocate, N as dispatchCommand, Od as getEditorRuntime, P as evaluateCommand, Pd as defineCommand, Pm as getDefined, Qf as DocumentIndex, Ro as resolveParkedCaret, Rt as next, Ru as getCompiledSchemaPropertyId, Sn as applyTransactionSpec, Tf as mapInternalDocumentChangePosition, Ti as subscribeCaretTarget, Tu as getPluginContributions, Un as getBaseCallRoot, V as NodeApi, Vi as withUpdateTagContext, Vt as point, W as after, Wi as captureSliceLanding, Xa as readRemovalLanding, _c as getSelectionDOMRange, _u as reportEditorLifecycleError, ar as getEditorReadDepth, au as getPublicExplicitLocationRoot, bd as formatDebugValue, bf as hasInternalDocumentChangeRoot, br as getSetSite, cn as unhangRange, cr as getEditorStateView, dm as LocationApi, ec as getCompiledEditorSchemaFromApi, fn as voidEditor, fo as isTextCell, gr as getNodeTargetRoot, hd as definePluginPoint, hl as getEditorCommitSnapshot, id as EditorSchemaValidationError, ii as resolveEditorNodeKeyForNode, il as createDetachedContentSlice, is as getViewFollowTarget, jd as getEditorSchema, kd as getEditorRuntimeOwner, ko as holdsCaret, l as definePlugin, lt as getSelection$1, m as getInstalledPlugin, md as failInvariant, mi as setEditorFocused, mn as editorCommands, nt as getChildren, ot as getNodeKey, ou as toInternalRoot, pm as PointApi, pt as hasPath, qa as withLandingBlock, rl as ContentSlice, st as getPathByNodeKey, su as toPublicRoot, tc as getInternalEditorSchemaFromApi, ts as getOwnViewPresentation, um as RangeApi, ut as getSnapshot, vd as SelectionApi, vl as getEditorCommitValue, vm as PathApi, vn as afterActiveTransactionEnds, vo as nodes, wf as mapInternalDocumentChangePoint, xc as mapSelectionThroughChange, xl as readRootEntries, xp as getNodeKeyForNode, xt as isBlock, yd as ElementApi, zn as getActiveEditorTransaction } from "./plugin-BZCGtqMI.js";
2
- import { a as transferEntries, c as dispatchPaste, n as checkFilesLanding, r as checkTransfer, u as landPaste } from "./src-fLbHzUjC.js";
3
- import { i as setDOMClipboardFormatKey, n as clearDOMClipboardFormatKey, r as getDOMClipboardFormatKey, t as DEFAULT_CLIPBOARD_FORMAT_KEY$2 } from "./clipboard-format-key-CLFcThXH.js";
4
- import scrollIntoViewIfNeeded from "scroll-into-view-if-needed";
1
+ import { Ai as countCoreWork, Bn as getNodeKeyForNode, G as mapInternalDocumentChangePosition, N as hasInternalDocumentChangeRoot, W as mapInternalDocumentChangePoint, Wi as getDefined, Y as valueRoot, hi as PathApi, ii as PointApi, ni as LocationApi, ti as RangeApi, tn as DocumentIndex } from "./law-check-Bvnz2EKh.js";
2
+ import { At as isVoid$2, Au as getPluginRegistry, Bd as hasEditorRuntime, Bo as placedSince, Cd as definePluginPoint, Co as nodes, Dd as ElementApi, Dn as attachTransactionSpecAfterCommit, Dt as isInline, Du as getCompiledEditorSchema, Ed as SelectionApi, Ei as subscribeCaretTarget, F as evaluateCommandWithState, G as before, Gi as captureSliceLanding, Gt as range, H as above, Hd as defineCommand, Hi as withUpdateTagContext, I as getActiveCommandEditor, Id as getEditorRuntime, Ld as getEditorRuntimeOwner, Ls as txLocate, Mo as getPlacementGeneration, N as dispatchCommand, Od as formatDebugValue, P as evaluateCommand, Po as holdsCaret, Rd as getEditorRuntimeRoot, Rt as next, Sn as applyTransactionSpec, Ud as registerImplicitTargetCommand, Un as getBaseCallRoot, Uo as resolveParkedCaret, Uu as getCompiledSchemaPropertyId, V as NodeApi, Vt as point, W as after, Xa as readRemovalLanding, Xc as createDetachedContentSlice, Yc as ContentSlice, ac as getCompiledEditorSchemaFromApi, ar as getEditorReadDepth, bc as getSelectionDOMRange, bd as failInvariant, br as getSetSite, cn as unhangRange, cr as getEditorStateView, du as toPublicRoot, fn as voidEditor, fo as isTextCell, gr as getNodeTargetRoot, hi as setEditorFocused, ii as resolveEditorNodeKeyForNode, jd as TextApi, ji as toEditorCoreStateView, jo as getCaretOwner, ku as getPluginContributions, l as definePlugin, ls as getViewFollowTarget, lt as getSelection$1, lu as getPublicExplicitLocationRoot, m as getInstalledPlugin, mn as editorCommands, nt as getChildren, oc as getInternalEditorSchemaFromApi, os as getOwnViewPresentation, ot as getNodeKey, pt as hasPath, qa as withLandingBlock, qo as setSelectionAsView, st as getPathByNodeKey, ud as EditorSchemaValidationError, ut as getSnapshot, uu as toInternalRoot, vl as getEditorCommitSnapshot, vn as afterActiveTransactionEnds, wc as mapSelectionThroughChange, wl as readRootEntries, xl as getEditorCommitValue, xt as isBlock, xu as reportEditorLifecycleError, zd as getEditorSchema, zn as getActiveEditorTransaction } from "./plugin-B8uCi-Hr.js";
3
+ import { a as transferEntries, c as dispatchPaste, n as checkFilesLanding, r as checkTransfer, u as landPaste } from "./src--BZ7fZY4.js";
4
+ import { i as setDOMClipboardFormatKey, n as clearDOMClipboardFormatKey, r as getDOMClipboardFormatKey, t as DEFAULT_CLIPBOARD_FORMAT_KEY$2 } from "./clipboard-format-key-SzffxWqa.js";
5
5
  //#region src/dom/utils/dom.ts
6
6
  globalThis.Node;
7
7
  globalThis.Text;
@@ -1102,6 +1102,45 @@ const readDOMTextFlowHost = (host) => {
1102
1102
  text: segments ? readDOMTextFlowRecord(record, segments) : null
1103
1103
  }));
1104
1104
  };
1105
+ const pathsEqual = (left, right) => left !== null && left.length === right.length && left.every((value, index) => value === right[index]);
1106
+ const getDOMTextFlowRestoreSegments = (host, path) => {
1107
+ const index = TEXT_HOST_TO_FLOW_INDEX.get(host);
1108
+ if (!index) return null;
1109
+ let matched = null;
1110
+ if (path) {
1111
+ for (const { record } of index.records.values()) if (pathsEqual(record.path, path)) {
1112
+ matched = record;
1113
+ break;
1114
+ }
1115
+ }
1116
+ if (!matched && index.records.size === 1) matched = index.records.values().next().value?.record ?? null;
1117
+ if (!matched || matched.segments.length === 0) return null;
1118
+ const record = matched;
1119
+ return record.segments.map((segment) => {
1120
+ const bounds = getBindingSegmentBounds({
1121
+ record,
1122
+ segment
1123
+ });
1124
+ return {
1125
+ domLength: segment.domLength,
1126
+ end: bounds.end,
1127
+ replaceTextNode: (nextTextNode) => {
1128
+ if (segment.textNode === nextTextNode) return;
1129
+ segment.textNode[DOM_TEXT_FLOW_SEGMENT] = null;
1130
+ segment.textNode = nextTextNode;
1131
+ nextTextNode[DOM_TEXT_FLOW_SEGMENT] = segment;
1132
+ segment.boundNodes = [
1133
+ segment.rootNode,
1134
+ segment.stringElement,
1135
+ nextTextNode
1136
+ ].filter((node) => !!node);
1137
+ },
1138
+ start: bounds.start,
1139
+ stringElement: segment.stringElement,
1140
+ textNode: segment.textNode
1141
+ };
1142
+ });
1143
+ };
1105
1144
  const resolveDOMTextFlowOffset = (host, node, offset) => {
1106
1145
  if (node.nodeType !== Node.TEXT_NODE) return null;
1107
1146
  const directBinding = getSegmentBinding(node);
@@ -1494,9 +1533,12 @@ const getPliteStringDirectPlacement = ({ root, target, x, y }) => {
1494
1533
  };
1495
1534
  const isOverLetterBefore = (document, [textNode, offset], x, y) => {
1496
1535
  if (offset === 0) return false;
1536
+ const boundaries = getGraphemeBoundaryOffsets(textNode.textContent ?? "");
1537
+ const start = boundaries.findLast((boundary) => boundary < offset) ?? 0;
1538
+ const end = boundaries.find((boundary) => boundary >= offset) ?? offset;
1497
1539
  const letter = document.createRange();
1498
- letter.setStart(textNode, offset - 1);
1499
- letter.setEnd(textNode, offset);
1540
+ letter.setStart(textNode, start);
1541
+ letter.setEnd(textNode, end);
1500
1542
  return getUsableRangeRects(letter).some((candidate) => x >= candidate.left && x < candidate.right && y >= candidate.top && y <= candidate.bottom);
1501
1543
  };
1502
1544
  const getNearestPliteStringRect = ({ strings, x, y }) => {
@@ -3149,11 +3191,21 @@ const EDITOR_DOM_ATTRIBUTES = /* @__PURE__ */ new Set([
3149
3191
  "data-editor-zero-width"
3150
3192
  ]);
3151
3193
  const affectsEditorDOMContract = (mutation) => mutation.type !== "attributes" || mutation.attributeName !== null && EDITOR_DOM_ATTRIBUTES.has(mutation.attributeName);
3152
- const captureSelection = (root) => {
3153
- const selection = root.ownerDocument.getSelection();
3194
+ const captureSelection = (root, readSelection) => {
3195
+ if (readSelection) {
3196
+ const points = readSelection(root);
3197
+ if (!points || !containsShadowAware(root, points.anchor[0]) || !containsShadowAware(root, points.focus[0])) return null;
3198
+ return {
3199
+ anchorNode: points.anchor[0],
3200
+ anchorOffset: points.anchor[1],
3201
+ focusNode: points.focus[0],
3202
+ focusOffset: points.focus[1]
3203
+ };
3204
+ }
3205
+ const selection = getSelection(root.getRootNode());
3154
3206
  const anchorNode = selection?.anchorNode ?? null;
3155
3207
  const focusNode = selection?.focusNode ?? null;
3156
- if (!selection || !anchorNode || !focusNode || !root.contains(anchorNode) || !root.contains(focusNode)) return null;
3208
+ if (!selection || !anchorNode || !focusNode || !containsShadowAware(root, anchorNode) || !containsShadowAware(root, focusNode)) return null;
3157
3209
  return {
3158
3210
  anchorNode,
3159
3211
  anchorOffset: selection.anchorOffset,
@@ -3163,7 +3215,7 @@ const captureSelection = (root) => {
3163
3215
  };
3164
3216
  const maxOffset = (node) => node.nodeType === TEXT_NODE ? node.nodeValue?.length ?? 0 : node.childNodes.length;
3165
3217
  const restoreSelection = (root, snapshot, writeSelection) => {
3166
- if (!snapshot || !writeSelection || !root.contains(snapshot.anchorNode) || !root.contains(snapshot.focusNode)) return;
3218
+ if (!snapshot || !writeSelection || !containsShadowAware(root, snapshot.anchorNode) || !containsShadowAware(root, snapshot.focusNode)) return;
3167
3219
  writeSelection(root, {
3168
3220
  anchor: [snapshot.anchorNode, Math.min(snapshot.anchorOffset, maxOffset(snapshot.anchorNode))],
3169
3221
  focus: [snapshot.focusNode, Math.min(snapshot.focusOffset, maxOffset(snapshot.focusNode))]
@@ -3439,7 +3491,7 @@ var DOMIntegrityObserver = class {
3439
3491
  path: this.options.resolvePath(mutation),
3440
3492
  type: mutation.type
3441
3493
  }));
3442
- const selection = captureSelection(root);
3494
+ const selection = captureSelection(root, this.options.readSelection);
3443
3495
  for (const mutation of mutations.reverse()) restoreMutation(mutation);
3444
3496
  restoreSelection(root, selection, this.options.writeSelection);
3445
3497
  this.repairPassesInFrame += 1;
@@ -4115,7 +4167,10 @@ const readEditableDOMSelectionPoints = (editable, selection) => {
4115
4167
  const tree = editable.getRootNode();
4116
4168
  if (tree.nodeType === tree.DOCUMENT_FRAGMENT_NODE) {
4117
4169
  const composed = readComposedSelectionRange(editable, selection);
4118
- if (composed) return {
4170
+ if (composed) return selection.direction === "backward" ? {
4171
+ anchor: [composed.endContainer, composed.endOffset],
4172
+ focus: [composed.startContainer, composed.startOffset]
4173
+ } : {
4119
4174
  anchor: [composed.startContainer, composed.startOffset],
4120
4175
  focus: [composed.endContainer, composed.endOffset]
4121
4176
  };
@@ -4177,16 +4232,156 @@ const resolveInnermostElementAtPoint = (document, x, y) => {
4177
4232
  for (let inner = element && shadowRootOf(element)?.elementFromPoint(x, y); inner && inner !== element; inner = shadowRootOf(element)?.elementFromPoint(x, y)) element = inner;
4178
4233
  return element;
4179
4234
  };
4180
- const focusedElementOf = (top) => {
4235
+ const focusedElementOf = (top, extraShadowRoots) => {
4181
4236
  let element = top.activeElement;
4182
4237
  while (element) {
4183
- const inner = shadowRootOf(element)?.activeElement ?? element.contentDocument?.activeElement;
4238
+ const inner = (shadowRootOf(element) ?? extraShadowRoots?.get(element))?.activeElement ?? element.contentDocument?.activeElement;
4184
4239
  if (!inner) return element;
4185
4240
  element = inner;
4186
4241
  }
4187
4242
  return null;
4188
4243
  };
4189
- const focusedElementOnPage = (node) => focusedElementOf(pageOf(node.ownerDocument ?? node));
4244
+ const focusedElementOnPage = (node) => {
4245
+ let extraShadowRoots;
4246
+ const element = asElement(node);
4247
+ if (element) {
4248
+ for (const shadowRoot of shadowRootsAbove(element)) if (!shadowRootOf(shadowRoot.host)) {
4249
+ extraShadowRoots ??= /* @__PURE__ */ new Map();
4250
+ extraShadowRoots.set(shadowRoot.host, shadowRoot);
4251
+ }
4252
+ }
4253
+ return focusedElementOf(pageOf(node.ownerDocument ?? node), extraShadowRoots);
4254
+ };
4255
+ const isEventInsideRoot = (root, event, seen) => {
4256
+ if (seen?.has(event)) return true;
4257
+ return (typeof event.composedPath === "function" ? event.composedPath() : []).includes(root) || isDOMNode(event.target) && containsShadowAware(root, event.target);
4258
+ };
4259
+ const getEventTargetInRoot = (root, event) => {
4260
+ const path = typeof event.composedPath === "function" ? event.composedPath() : [];
4261
+ return path.includes(root) ? path[0] ?? event.target : event.target;
4262
+ };
4263
+ const isSlottedIntoShadowRoot = (shadowRoot, target) => {
4264
+ if (!isDOMNode(target)) return false;
4265
+ const slots = shadowRoot.querySelectorAll("slot");
4266
+ if (slots.length === 0) return false;
4267
+ for (const slot of slots) for (const assigned of slot.assignedNodes({ flatten: true })) if (assigned === target || containsShadowAware(assigned, target)) return true;
4268
+ return false;
4269
+ };
4270
+ const observeRootBoundaryEvent = (root, type, listener, { capture = true, filter = "all", scope = "document" } = {}) => {
4271
+ const { ownerDocument } = root;
4272
+ const outerTarget = scope === "window" ? ownerDocument.defaultView : ownerDocument;
4273
+ if (!outerTarget) return () => {};
4274
+ const allShadowRoots = shadowRootsAbove(root);
4275
+ const closedRoots = allShadowRoots.filter((shadowRoot) => shadowRoot.mode === "closed");
4276
+ const emit = (event, inRoot, target) => {
4277
+ if (filter === "inside" && !inRoot) return;
4278
+ if (filter === "outside" && inRoot) return;
4279
+ listener(event, {
4280
+ inRoot,
4281
+ target
4282
+ });
4283
+ };
4284
+ if (filter === "inside") {
4285
+ const insideTarget = allShadowRoots[0] ?? outerTarget;
4286
+ const handleInner = (event) => {
4287
+ const path = typeof event.composedPath === "function" ? event.composedPath() : [];
4288
+ if (!path.includes(root) && !(isDOMNode(event.target) && containsShadowAware(root, event.target))) return;
4289
+ emit(event, true, path[0] ?? event.target);
4290
+ };
4291
+ insideTarget.addEventListener(type, handleInner, capture);
4292
+ return () => {
4293
+ insideTarget.removeEventListener(type, handleInner, capture);
4294
+ };
4295
+ }
4296
+ if (closedRoots.length === 0) {
4297
+ const handleOuter = (event) => {
4298
+ const path = typeof event.composedPath === "function" ? event.composedPath() : [];
4299
+ const inRoot = path.includes(root) || isDOMNode(event.target) && containsShadowAware(root, event.target);
4300
+ const target = inRoot ? path[0] ?? event.target : event.target;
4301
+ emit(event, inRoot, target);
4302
+ };
4303
+ outerTarget.addEventListener(type, handleOuter, capture);
4304
+ return () => {
4305
+ outerTarget.removeEventListener(type, handleOuter, capture);
4306
+ };
4307
+ }
4308
+ const innermostRoot = allShadowRoots[0];
4309
+ if (!capture) {
4310
+ const insideTargets = /* @__PURE__ */ new WeakMap();
4311
+ const resetOnOuterCapture = (event) => {
4312
+ insideTargets.delete(event);
4313
+ };
4314
+ const markInside = (event) => {
4315
+ if (isEventInsideRoot(root, event)) {
4316
+ const path = typeof event.composedPath === "function" ? event.composedPath() : [];
4317
+ insideTargets.set(event, path[0] ?? event.target);
4318
+ }
4319
+ };
4320
+ const handleBubble = (event) => {
4321
+ const hasInside = insideTargets.has(event);
4322
+ const insideTarget = insideTargets.get(event) ?? null;
4323
+ insideTargets.delete(event);
4324
+ const inRoot = hasInside || isEventInsideRoot(root, event);
4325
+ const target = hasInside ? insideTarget ?? event.target : getEventTargetInRoot(root, event);
4326
+ emit(event, inRoot, target);
4327
+ };
4328
+ outerTarget.addEventListener(type, resetOnOuterCapture, true);
4329
+ innermostRoot.addEventListener(type, markInside, true);
4330
+ outerTarget.addEventListener(type, handleBubble, false);
4331
+ return () => {
4332
+ outerTarget.removeEventListener(type, resetOnOuterCapture, true);
4333
+ innermostRoot.removeEventListener(type, markInside, true);
4334
+ outerTarget.removeEventListener(type, handleBubble, false);
4335
+ };
4336
+ }
4337
+ const outerToInnerClosed = [...closedRoots].reverse();
4338
+ const levels = [outerTarget, ...outerToInnerClosed];
4339
+ const handled = /* @__PURE__ */ new WeakSet();
4340
+ const cleanups = [];
4341
+ for (let index = 0; index < levels.length; index += 1) {
4342
+ const levelTarget = levels[index];
4343
+ const nextClosed = outerToInnerClosed[index] ?? null;
4344
+ if (nextClosed) {
4345
+ const nextHost = nextClosed.host;
4346
+ const handleLevelCapture = (event) => {
4347
+ if (index === 0) handled.delete(event);
4348
+ if (handled.has(event)) return;
4349
+ const path = typeof event.composedPath === "function" ? event.composedPath() : [];
4350
+ const deepestTarget = path[0] ?? event.target;
4351
+ if (deepestTarget === nextHost || path.includes(nextHost) && isSlottedIntoShadowRoot(nextClosed, deepestTarget)) return;
4352
+ if (event.composed) handled.add(event);
4353
+ emit(event, false, deepestTarget);
4354
+ };
4355
+ const handleHostFallback = (event) => {
4356
+ if (handled.has(event)) return;
4357
+ if (((typeof event.composedPath === "function" ? event.composedPath() : [])[0] ?? event.target) !== nextHost) return;
4358
+ if (event.composed) handled.add(event);
4359
+ emit(event, false, event.target);
4360
+ };
4361
+ levelTarget.addEventListener(type, handleLevelCapture, true);
4362
+ nextHost.addEventListener(type, handleHostFallback, false);
4363
+ cleanups.push(() => {
4364
+ levelTarget.removeEventListener(type, handleLevelCapture, true);
4365
+ nextHost.removeEventListener(type, handleHostFallback, false);
4366
+ });
4367
+ } else {
4368
+ const handleInnermostCapture = (event) => {
4369
+ if (handled.has(event)) return;
4370
+ if (event.composed) handled.add(event);
4371
+ const path = typeof event.composedPath === "function" ? event.composedPath() : [];
4372
+ const inRoot = path.includes(root) || isDOMNode(event.target) && containsShadowAware(root, event.target);
4373
+ emit(event, inRoot, inRoot ? path[0] ?? event.target : event.target);
4374
+ };
4375
+ levelTarget.addEventListener(type, handleInnermostCapture, true);
4376
+ cleanups.push(() => {
4377
+ levelTarget.removeEventListener(type, handleInnermostCapture, true);
4378
+ });
4379
+ }
4380
+ }
4381
+ return () => {
4382
+ for (const cleanup of cleanups) cleanup();
4383
+ };
4384
+ };
4190
4385
  const movedFocusElsewhere = (element, before, after) => {
4191
4386
  if (!after || after === before || after === element || containsShadowAware(element, after) && !isNestedEditableOrInput(element, after)) return false;
4192
4387
  const ownDoc = element.ownerDocument;
@@ -4310,6 +4505,7 @@ var DOMRootRuntime = class DOMRootRuntime {
4310
4505
  connected = false;
4311
4506
  isComposing;
4312
4507
  isSelectionHeld;
4508
+ exportSelection;
4313
4509
  focusSelection;
4314
4510
  nodeSelectionFocus;
4315
4511
  generation = 0;
@@ -4328,6 +4524,7 @@ var DOMRootRuntime = class DOMRootRuntime {
4328
4524
  constructor(options) {
4329
4525
  this.isComposing = options.isComposing;
4330
4526
  this.isSelectionHeld = options.isSelectionHeld ?? (() => false);
4527
+ this.exportSelection = options.exportSelection ?? (() => void 0);
4331
4528
  this.focusSelection = options.focusSelection ?? (() => false);
4332
4529
  this.nodeSelectionFocus = options.nodeSelectionFocus ?? (() => null);
4333
4530
  this.adapter = options.adapter;
@@ -4346,6 +4543,7 @@ var DOMRootRuntime = class DOMRootRuntime {
4346
4543
  this.schedulerImplementation = this.createScheduler();
4347
4544
  this.domSyncMutationOwnership = new DOMSyncMutationOwnership((phase, label, callback, scheduleOptions) => this.schedulerImplementation?.schedule(phase, label, callback, scheduleOptions) ?? (() => {}));
4348
4545
  this.domIntegrityObserver = new DOMIntegrityObserver({
4546
+ readSelection: (root) => readEditableDOMSelectionPoints(root, getSelection(root.getRootNode())),
4349
4547
  writeSelection: (root, points) => writeEditableDOMSelection(root, points, { editor: this.editor }),
4350
4548
  getAndroidMutationHandler: options.getAndroidMutationHandler,
4351
4549
  isAndroidMutationOwned: options.isAndroidMutationOwned,
@@ -4673,7 +4871,7 @@ var DOMRootRuntime = class DOMRootRuntime {
4673
4871
  this.rootInputActivationCleanup = null;
4674
4872
  const runtime = this;
4675
4873
  const root = this.rootRef.current;
4676
- const activeElement = (root?.getRootNode())?.activeElement;
4874
+ const activeElement = root ? focusedElementOnPage(root) : null;
4677
4875
  const focusedRuntime = activeElement ? findDOMRootRuntime(activeElement) : null;
4678
4876
  const otherFocusedView = focusedRuntime && focusedRuntime.editor === this.editor && focusedRuntime !== runtime;
4679
4877
  if (root && DOM_ROOT_RUNTIME_BY_ROOT.get(root) === runtime) DOM_ROOT_RUNTIME_BY_ROOT.delete(root);
@@ -6120,6 +6318,7 @@ const domCommands = Object.freeze({ insertData: defineCommand("dom.insertData",
6120
6318
  return getInstalledPlugin(editor, "dom") ? withLandingBlock(editor, state, (current) => createDOMDataTransactionSpec(editor, input, current)) : false;
6121
6319
  }
6122
6320
  }) });
6321
+ registerImplicitTargetCommand(domCommands.insertData, void 0, { crossingPolicy: "cancel" });
6123
6322
  const stripRenderOnlyLeafWrappers = (root, ui) => {
6124
6323
  Array.from(root.querySelectorAll("[data-editor-leaf] span:not([data-editor-string]):not([data-editor-zero-width])")).forEach((candidate) => {
6125
6324
  if (candidate.closest("[data-editor-leaf]")) {
@@ -7479,7 +7678,9 @@ const resolveVoidEventRange = (editor, { node, path, target, x, y }) => {
7479
7678
  //#endregion
7480
7679
  //#region src/dom/plugin/dom-scroll-into-view.ts
7481
7680
  const MARGIN = 4;
7681
+ const MAX_IFRAME_DEPTH = 16;
7482
7682
  const SCROLLABLE_RE = /(auto|scroll|overlay)/;
7683
+ const HIDDEN_OVERFLOW_RE = /\bhidden\b/;
7483
7684
  const isUsableScrollRect = (r) => r.width > 0 || r.height > 0 || r.x !== 0 || r.y !== 0 || r.top !== 0 || r.left !== 0 || r.bottom !== 0 || r.right !== 0;
7484
7685
  const toScrollRect = (r) => ({
7485
7686
  bottom: r.bottom,
@@ -7487,28 +7688,105 @@ const toScrollRect = (r) => ({
7487
7688
  right: r.right,
7488
7689
  top: r.top
7489
7690
  });
7691
+ const isDefaultScrollRevealOptions = (options) => options === void 0 || typeof options === "object" && options !== null && (options.scrollMode === void 0 || options.scrollMode === "if-needed") && options.block === void 0 && options.inline === void 0 && options.behavior === void 0 && options.boundary === void 0 && options.skipOverflowHiddenElements === void 0;
7692
+ const normalizeOptions = (options) => {
7693
+ if (isDefaultScrollRevealOptions(options)) return {
7694
+ behavior: "auto",
7695
+ block: "nearest",
7696
+ boundary: null,
7697
+ defaultReveal: true,
7698
+ inline: "nearest",
7699
+ scrollMode: "if-needed",
7700
+ skipOverflowHiddenElements: true
7701
+ };
7702
+ if (typeof options === "boolean") return {
7703
+ behavior: "auto",
7704
+ block: options ? "start" : "end",
7705
+ boundary: null,
7706
+ defaultReveal: false,
7707
+ inline: "nearest",
7708
+ scrollMode: "always",
7709
+ skipOverflowHiddenElements: true
7710
+ };
7711
+ const scrollMode = options?.scrollMode ?? "always";
7712
+ return {
7713
+ behavior: options?.behavior ?? "auto",
7714
+ block: options?.block ?? (scrollMode === "always" ? "center" : "nearest"),
7715
+ boundary: options?.boundary ?? null,
7716
+ defaultReveal: false,
7717
+ inline: options?.inline ?? "nearest",
7718
+ scrollMode,
7719
+ skipOverflowHiddenElements: options?.skipOverflowHiddenElements ?? true
7720
+ };
7721
+ };
7490
7722
  const shiftRect = (r, dx, dy) => ({
7491
7723
  bottom: r.bottom - dy,
7492
7724
  left: r.left - dx,
7493
7725
  right: r.right - dx,
7494
7726
  top: r.top - dy
7495
7727
  });
7496
- const canScroll = (el, style, axis) => {
7728
+ const parsePositivePx = (value) => {
7729
+ const n = Number.parseFloat(value ?? "");
7730
+ return Number.isFinite(n) && n > 0 ? n : 0;
7731
+ };
7732
+ const getElementStyle = (element) => element.ownerDocument.defaultView?.getComputedStyle(element) ?? (isDOMHTMLElement(element) ? element.style : void 0);
7733
+ const readScrollMargins = (element, scrollMarginTopOverride) => {
7734
+ const style = getElementStyle(element);
7735
+ const inlineStyle = isDOMHTMLElement(element) ? element.style : void 0;
7736
+ const top = scrollMarginTopOverride !== void 0 ? Math.max(0, scrollMarginTopOverride) : parsePositivePx(inlineStyle?.scrollMarginTop || style?.scrollMarginTop);
7737
+ return {
7738
+ bottom: parsePositivePx(inlineStyle?.scrollMarginBottom || style?.scrollMarginBottom),
7739
+ left: parsePositivePx(inlineStyle?.scrollMarginLeft || style?.scrollMarginLeft),
7740
+ right: parsePositivePx(inlineStyle?.scrollMarginRight || style?.scrollMarginRight),
7741
+ top
7742
+ };
7743
+ };
7744
+ const canScroll = (el, style, axis, skipOverflowHiddenElements) => {
7497
7745
  const overflow = axis === "y" ? `${style?.overflowY ?? ""} ${style?.overflow ?? ""}` : `${style?.overflowX ?? ""} ${style?.overflow ?? ""}`;
7498
- return SCROLLABLE_RE.test(overflow) && (axis === "y" ? el.scrollHeight > el.clientHeight : el.scrollWidth > el.clientWidth);
7746
+ return (SCROLLABLE_RE.test(overflow) || !skipOverflowHiddenElements && HIDDEN_OVERFLOW_RE.test(overflow)) && (axis === "y" ? el.scrollHeight > el.clientHeight : el.scrollWidth > el.clientWidth);
7499
7747
  };
7500
7748
  const pad = (value, size) => {
7501
7749
  const n = Number.parseFloat(value ?? "");
7502
7750
  if (!Number.isFinite(n) || n <= 0) return 0;
7503
7751
  return value?.trim().endsWith("%") ? n / 100 * size : n;
7504
7752
  };
7505
- const paddedBox = (rect, style) => ({
7506
- bottom: rect.bottom - pad(style?.scrollPaddingBottom, rect.height) - MARGIN,
7507
- left: rect.left + pad(style?.scrollPaddingLeft, rect.width) + MARGIN,
7508
- right: rect.right - pad(style?.scrollPaddingRight, rect.width) - MARGIN,
7509
- top: rect.top + pad(style?.scrollPaddingTop, rect.height) + MARGIN
7753
+ const paddedBox = (rect, style, margin, scaleX = 1, scaleY = 1) => ({
7754
+ bottom: rect.bottom - pad(style?.scrollPaddingBottom, rect.height / scaleY) * scaleY - margin,
7755
+ left: rect.left + pad(style?.scrollPaddingLeft, rect.width / scaleX) * scaleX + margin,
7756
+ right: rect.right - pad(style?.scrollPaddingRight, rect.width / scaleX) * scaleX - margin,
7757
+ top: rect.top + pad(style?.scrollPaddingTop, rect.height / scaleY) * scaleY + margin
7510
7758
  });
7511
- const getVisibleViewportBox = (win, scrollingElement) => {
7759
+ const getElementScale = (el, rect) => {
7760
+ if (!isDOMHTMLElement(el)) return {
7761
+ x: 1,
7762
+ y: 1
7763
+ };
7764
+ return {
7765
+ x: el.offsetWidth > 0 && rect.width > 0 ? rect.width / el.offsetWidth : 1,
7766
+ y: el.offsetHeight > 0 && rect.height > 0 ? rect.height / el.offsetHeight : 1
7767
+ };
7768
+ };
7769
+ const getScrollContainerBox = (el, style, scale, margin) => {
7770
+ const rect = el.getBoundingClientRect();
7771
+ const borderTop = parsePositivePx(style?.borderTopWidth) * scale.y;
7772
+ const borderBottom = parsePositivePx(style?.borderBottomWidth) * scale.y;
7773
+ const borderLeft = parsePositivePx(style?.borderLeftWidth) * scale.x;
7774
+ const borderRight = parsePositivePx(style?.borderRightWidth) * scale.x;
7775
+ const top = rect.top + borderTop;
7776
+ const bottom = el.clientHeight > 0 ? Math.min(rect.bottom - borderBottom, top + el.clientHeight * scale.y) : rect.bottom - borderBottom;
7777
+ const isRtl = style?.direction === "rtl";
7778
+ const left = isRtl && el.clientWidth > 0 ? Math.max(rect.left + borderLeft, rect.right - borderRight - el.clientWidth * scale.x) : rect.left + borderLeft;
7779
+ const right = !isRtl && el.clientWidth > 0 ? Math.min(rect.right - borderRight, left + el.clientWidth * scale.x) : rect.right - borderRight;
7780
+ return paddedBox({
7781
+ bottom,
7782
+ height: Math.max(0, bottom - top),
7783
+ left,
7784
+ right,
7785
+ top,
7786
+ width: Math.max(0, right - left)
7787
+ }, style, margin, scale.x, scale.y);
7788
+ };
7789
+ const getVisibleViewportBox = (win, scrollingElement, margin) => {
7512
7790
  const vv = win.visualViewport;
7513
7791
  const height = vv?.height ?? win.innerHeight;
7514
7792
  const width = vv?.width ?? win.innerWidth;
@@ -7521,10 +7799,15 @@ const getVisibleViewportBox = (win, scrollingElement) => {
7521
7799
  right: left + width,
7522
7800
  top,
7523
7801
  width
7524
- }, win.getComputedStyle(scrollingElement));
7802
+ }, win.getComputedStyle(scrollingElement), margin);
7525
7803
  };
7526
- const axisDelta = (start, end, low, high, ownLow, ownHigh) => {
7804
+ const axisDelta = ({ align, end, high, low, ownHigh, ownLow, rtl = false, scrollMode, start }) => {
7527
7805
  if (low >= high) return 0;
7806
+ if (scrollMode === "if-needed" && start >= low && end <= high) return 0;
7807
+ if (align === "start") return rtl ? end - high : start - low;
7808
+ if (align === "end") return rtl ? start - low : end - high;
7809
+ if (align === "center") return (start + end) / 2 - (low + high) / 2;
7810
+ if (start < low && end > high) return 0;
7528
7811
  if (start < low) {
7529
7812
  const d = low - start;
7530
7813
  return ownHigh === void 0 ? -d : -Math.min(d, Math.max(0, ownHigh - end));
@@ -7535,25 +7818,111 @@ const axisDelta = (start, end, low, high, ownLow, ownHigh) => {
7535
7818
  }
7536
7819
  return 0;
7537
7820
  };
7538
- const scrollAncestors = (startElement, scrollingElement, rect, visibleBox) => {
7821
+ const applyElementScroll = (el, dx, dy, behavior) => {
7822
+ const prevLeft = el.scrollLeft;
7823
+ const prevTop = el.scrollTop;
7824
+ const nextLeft = prevLeft + dx;
7825
+ const nextTop = prevTop + dy;
7826
+ if (behavior === "smooth" && typeof el.scroll === "function") {
7827
+ el.scroll({
7828
+ behavior,
7829
+ left: nextLeft,
7830
+ top: nextTop
7831
+ });
7832
+ return {
7833
+ dx,
7834
+ dy
7835
+ };
7836
+ }
7837
+ if (typeof el.scroll === "function") el.scroll({
7838
+ behavior,
7839
+ left: nextLeft,
7840
+ top: nextTop
7841
+ });
7842
+ if (el.scrollTop === prevTop && dy !== 0) el.scrollTop = nextTop;
7843
+ if (el.scrollLeft === prevLeft && dx !== 0) el.scrollLeft = nextLeft;
7844
+ return {
7845
+ dx: el.scrollLeft - prevLeft,
7846
+ dy: el.scrollTop - prevTop
7847
+ };
7848
+ };
7849
+ const scrollAncestors = (startElement, scrollingElement, rect, visibleBox, options) => {
7539
7850
  let cur = rect;
7851
+ const margin = options.defaultReveal ? MARGIN : 0;
7852
+ if (getElementStyle(startElement)?.position === "fixed") return {
7853
+ cur,
7854
+ stopped: true
7855
+ };
7856
+ if (options.boundary === startElement) return {
7857
+ cur,
7858
+ stopped: true
7859
+ };
7540
7860
  for (let el = getFlatTreeParentElement(startElement); el; el = getFlatTreeParentElement(el)) {
7541
- if (el === scrollingElement) continue;
7542
- const style = el.ownerDocument.defaultView?.getComputedStyle(el);
7543
- const scrollY = canScroll(el, style, "y");
7544
- const scrollX = canScroll(el, style, "x");
7545
- if (!scrollY && !scrollX) continue;
7546
- const own = paddedBox(el.getBoundingClientRect(), style);
7547
- const dy = scrollY ? visibleBox ? axisDelta(cur.top, cur.bottom, Math.max(own.top, visibleBox.top), Math.min(own.bottom, visibleBox.bottom), own.top, own.bottom) : axisDelta(cur.top, cur.bottom, own.top, own.bottom) : 0;
7548
- const dx = scrollX ? visibleBox ? axisDelta(cur.left, cur.right, Math.max(own.left, visibleBox.left), Math.min(own.right, visibleBox.right), own.left, own.right) : axisDelta(cur.left, cur.right, own.left, own.right) : 0;
7549
- if (dy === 0 && dx === 0) continue;
7550
- const prevTop = el.scrollTop;
7551
- const prevLeft = el.scrollLeft;
7552
- el.scrollTop += dy;
7553
- el.scrollLeft += dx;
7554
- cur = shiftRect(cur, el.scrollLeft - prevLeft, el.scrollTop - prevTop);
7555
- }
7556
- return cur;
7861
+ if (typeof options.boundary === "function" && !options.boundary(el)) return {
7862
+ cur,
7863
+ stopped: true
7864
+ };
7865
+ if (el === scrollingElement) return {
7866
+ cur,
7867
+ stopped: options.boundary === el
7868
+ };
7869
+ const style = getElementStyle(el);
7870
+ const scrollY = canScroll(el, style, "y", options.skipOverflowHiddenElements);
7871
+ const scrollX = canScroll(el, style, "x", options.skipOverflowHiddenElements);
7872
+ if (scrollY || scrollX) {
7873
+ const scale = getElementScale(el, el.getBoundingClientRect());
7874
+ const own = getScrollContainerBox(el, style, scale, margin);
7875
+ const isRtl = style?.direction === "rtl";
7876
+ const dy = scrollY ? visibleBox ? axisDelta({
7877
+ align: "nearest",
7878
+ end: cur.bottom,
7879
+ high: Math.min(own.bottom, visibleBox.bottom),
7880
+ low: Math.max(own.top, visibleBox.top),
7881
+ ownHigh: own.bottom,
7882
+ ownLow: own.top,
7883
+ scrollMode: "if-needed",
7884
+ start: cur.top
7885
+ }) : axisDelta({
7886
+ align: options.block,
7887
+ end: cur.bottom,
7888
+ high: own.bottom,
7889
+ low: own.top,
7890
+ scrollMode: options.scrollMode,
7891
+ start: cur.top
7892
+ }) : 0;
7893
+ const dx = scrollX ? visibleBox ? axisDelta({
7894
+ align: "nearest",
7895
+ end: cur.right,
7896
+ high: Math.min(own.right, visibleBox.right),
7897
+ low: Math.max(own.left, visibleBox.left),
7898
+ ownHigh: own.right,
7899
+ ownLow: own.left,
7900
+ rtl: isRtl,
7901
+ scrollMode: "if-needed",
7902
+ start: cur.left
7903
+ }) : axisDelta({
7904
+ align: options.inline,
7905
+ end: cur.right,
7906
+ high: own.right,
7907
+ low: own.left,
7908
+ rtl: isRtl,
7909
+ scrollMode: options.scrollMode,
7910
+ start: cur.left
7911
+ }) : 0;
7912
+ if (dy !== 0 || dx !== 0) {
7913
+ const applied = applyElementScroll(el, dx / scale.x, dy / scale.y, options.behavior);
7914
+ cur = shiftRect(cur, applied.dx * scale.x, applied.dy * scale.y);
7915
+ }
7916
+ }
7917
+ if (style?.position === "fixed" || options.boundary === el) return {
7918
+ cur,
7919
+ stopped: true
7920
+ };
7921
+ }
7922
+ return {
7923
+ cur,
7924
+ stopped: false
7925
+ };
7557
7926
  };
7558
7927
  const outsideBox = (rect, box, tolerance = 0) => rect.top < box.top - tolerance || rect.bottom > box.bottom + tolerance || rect.left < box.left - tolerance || rect.right > box.right + tolerance;
7559
7928
  const setCaretScrollMargin = (el, elRect, caret, top, right, bottom, left) => {
@@ -7563,7 +7932,7 @@ const canPanVisualViewport = (win, scrollingElement, el) => {
7563
7932
  const vv = win.visualViewport;
7564
7933
  return Boolean(vv && isDOMHTMLElement(el) && typeof el.scrollIntoView === "function" && (vv.height < scrollingElement.clientHeight || vv.width < scrollingElement.clientWidth));
7565
7934
  };
7566
- const panVisualViewportNearest = (win, scrollingElement, el, caret) => {
7935
+ const panVisualViewportNearest = (win, scrollingElement, el, caret, margin) => {
7567
7936
  const vv = win.visualViewport;
7568
7937
  if (!vv || !canPanVisualViewport(win, scrollingElement, el)) return caret;
7569
7938
  const elRect = el.getBoundingClientRect();
@@ -7573,20 +7942,20 @@ const panVisualViewportNearest = (win, scrollingElement, el, caret) => {
7573
7942
  const afterRect = el.getBoundingClientRect();
7574
7943
  return shiftRect(caret, elRect.left - afterRect.left, elRect.top - afterRect.top);
7575
7944
  };
7576
- setCaretScrollMargin(el, elRect, caret, MARGIN, MARGIN, MARGIN, MARGIN);
7945
+ setCaretScrollMargin(el, elRect, caret, margin, margin, margin, margin);
7577
7946
  el.scrollIntoView({
7578
7947
  block: "nearest",
7579
7948
  inline: "nearest"
7580
7949
  });
7581
7950
  let nextCaret = caretAfter();
7582
- if (outsideBox(nextCaret, getVisibleViewportBox(win, scrollingElement), 1)) {
7951
+ if (outsideBox(nextCaret, getVisibleViewportBox(win, scrollingElement, margin), 1)) {
7583
7952
  const rootStyle = win.getComputedStyle(scrollingElement);
7584
7953
  const padTop = pad(rootStyle.scrollPaddingTop, vv.height);
7585
7954
  const padRight = pad(rootStyle.scrollPaddingRight, vv.width);
7586
7955
  const padBottom = pad(rootStyle.scrollPaddingBottom, vv.height);
7587
7956
  const padLeft = pad(rootStyle.scrollPaddingLeft, vv.width);
7588
7957
  if (padTop > 0 || padRight > 0 || padBottom > 0 || padLeft > 0) {
7589
- setCaretScrollMargin(el, elRect, caret, MARGIN + padTop, MARGIN + padRight, MARGIN + padBottom, MARGIN + padLeft);
7958
+ setCaretScrollMargin(el, elRect, caret, margin + padTop, margin + padRight, margin + padBottom, margin + padLeft);
7590
7959
  el.scrollIntoView({
7591
7960
  block: "nearest",
7592
7961
  inline: "nearest"
@@ -7598,12 +7967,12 @@ const panVisualViewportNearest = (win, scrollingElement, el, caret) => {
7598
7967
  else el.style.removeProperty("scroll-margin");
7599
7968
  return nextCaret;
7600
7969
  };
7601
- const panVisualViewportCenter = (win, scrollingElement, el, caret) => {
7970
+ const panVisualViewportCenter = (win, scrollingElement, el, caret, margin) => {
7602
7971
  if (!canPanVisualViewport(win, scrollingElement, el)) return;
7603
7972
  const elRect = el.getBoundingClientRect();
7604
7973
  const prev = el.style.getPropertyValue("scroll-margin");
7605
7974
  const priority = el.style.getPropertyPriority("scroll-margin");
7606
- setCaretScrollMargin(el, elRect, caret, MARGIN, MARGIN, MARGIN, MARGIN);
7975
+ setCaretScrollMargin(el, elRect, caret, margin, margin, margin, margin);
7607
7976
  el.scrollIntoView({
7608
7977
  block: "center",
7609
7978
  inline: "nearest"
@@ -7611,27 +7980,101 @@ const panVisualViewportCenter = (win, scrollingElement, el, caret) => {
7611
7980
  if (prev) el.style.setProperty("scroll-margin", prev, priority);
7612
7981
  else el.style.removeProperty("scroll-margin");
7613
7982
  };
7983
+ const getEnclosingFrame = (win) => {
7984
+ try {
7985
+ return win.frameElement;
7986
+ } catch {
7987
+ return null;
7988
+ }
7989
+ };
7990
+ const mapRectIntoParentWindow = (rect, frame) => {
7991
+ const frameRect = frame.getBoundingClientRect();
7992
+ const frameStyle = getElementStyle(frame);
7993
+ const scale = getElementScale(frame, frameRect);
7994
+ const offsetX = frameRect.left + (parsePositivePx(frameStyle?.borderLeftWidth) + parsePositivePx(frameStyle?.paddingLeft)) * scale.x;
7995
+ const offsetY = frameRect.top + (parsePositivePx(frameStyle?.borderTopWidth) + parsePositivePx(frameStyle?.paddingTop)) * scale.y;
7996
+ return {
7997
+ bottom: offsetY + rect.bottom * scale.y,
7998
+ left: offsetX + rect.left * scale.x,
7999
+ right: offsetX + rect.right * scale.x,
8000
+ top: offsetY + rect.top * scale.y
8001
+ };
8002
+ };
8003
+ const scrollRectIntoView = ({ options, rect, scrollMarginTop, startElement }) => {
8004
+ const normalized = normalizeOptions(options);
8005
+ const margin = normalized.defaultReveal ? MARGIN : 0;
8006
+ const margins = readScrollMargins(startElement, scrollMarginTop);
8007
+ let cur = {
8008
+ bottom: rect.bottom + margins.bottom,
8009
+ left: rect.left - margins.left,
8010
+ right: rect.right + margins.right,
8011
+ top: rect.top - margins.top
8012
+ };
8013
+ let currentStart = startElement;
8014
+ for (let depth = 0; depth < MAX_IFRAME_DEPTH; depth += 1) {
8015
+ const doc = currentStart.ownerDocument;
8016
+ const scrollingElement = doc.scrollingElement ?? doc.documentElement;
8017
+ if (!scrollingElement) return;
8018
+ const { cur: afterAncestors, stopped } = scrollAncestors(currentStart, scrollingElement, cur, null, normalized);
8019
+ cur = afterAncestors;
8020
+ if (stopped) return;
8021
+ const win = doc.defaultView;
8022
+ if (!win) return;
8023
+ const isRtl = win.getComputedStyle(scrollingElement)?.direction === "rtl";
8024
+ let visible = getVisibleViewportBox(win, scrollingElement, margin);
8025
+ const dy = scrollingElement.scrollHeight > scrollingElement.clientHeight ? axisDelta({
8026
+ align: normalized.block,
8027
+ end: cur.bottom,
8028
+ high: visible.bottom,
8029
+ low: visible.top,
8030
+ scrollMode: normalized.scrollMode,
8031
+ start: cur.top
8032
+ }) : 0;
8033
+ const dx = scrollingElement.scrollWidth > scrollingElement.clientWidth ? axisDelta({
8034
+ align: normalized.inline,
8035
+ end: cur.right,
8036
+ high: visible.right,
8037
+ low: visible.left,
8038
+ rtl: isRtl,
8039
+ scrollMode: normalized.scrollMode,
8040
+ start: cur.left
8041
+ }) : 0;
8042
+ if (dy !== 0 || dx !== 0) {
8043
+ if (normalized.behavior === "smooth") {
8044
+ win.scrollBy({
8045
+ behavior: "smooth",
8046
+ left: dx,
8047
+ top: dy
8048
+ });
8049
+ cur = shiftRect(cur, dx, dy);
8050
+ } else {
8051
+ const prevY = win.scrollY;
8052
+ const prevX = win.scrollX;
8053
+ win.scrollBy(dx, dy);
8054
+ cur = shiftRect(cur, win.scrollX - prevX, win.scrollY - prevY);
8055
+ }
8056
+ visible = getVisibleViewportBox(win, scrollingElement, margin);
8057
+ }
8058
+ if (normalized.behavior !== "smooth") {
8059
+ if (outsideBox(cur, visible, 1)) {
8060
+ cur = panVisualViewportNearest(win, scrollingElement, currentStart, cur, margin);
8061
+ visible = getVisibleViewportBox(win, scrollingElement, margin);
8062
+ }
8063
+ if (outsideBox(cur, visible)) ({cur} = scrollAncestors(currentStart, scrollingElement, cur, visible, normalized));
8064
+ if (outsideBox(cur, visible, 1)) panVisualViewportCenter(win, scrollingElement, currentStart, cur, margin);
8065
+ }
8066
+ const frame = getEnclosingFrame(win);
8067
+ if (!frame || frame.ownerDocument === doc) return;
8068
+ if (normalized.boundary === frame || typeof normalized.boundary === "function" && !normalized.boundary(frame)) return;
8069
+ cur = mapRectIntoParentWindow(cur, frame);
8070
+ currentStart = frame;
8071
+ }
8072
+ };
7614
8073
  const scrollRectIntoViewIfNeeded = ({ rect, startElement }) => {
7615
- const scrollingElement = startElement.ownerDocument.scrollingElement ?? startElement.ownerDocument.documentElement;
7616
- let cur = scrollAncestors(startElement, scrollingElement, rect, null);
7617
- const win = startElement.ownerDocument.defaultView;
7618
- if (!win) return;
7619
- let visible = getVisibleViewportBox(win, scrollingElement);
7620
- const dy = scrollingElement.scrollHeight > scrollingElement.clientHeight ? axisDelta(cur.top, cur.bottom, visible.top, visible.bottom) : 0;
7621
- const dx = scrollingElement.scrollWidth > scrollingElement.clientWidth ? axisDelta(cur.left, cur.right, visible.left, visible.right) : 0;
7622
- if (dy !== 0 || dx !== 0) {
7623
- const prevY = win.scrollY;
7624
- const prevX = win.scrollX;
7625
- win.scrollBy(dx, dy);
7626
- cur = shiftRect(cur, win.scrollX - prevX, win.scrollY - prevY);
7627
- visible = getVisibleViewportBox(win, scrollingElement);
7628
- }
7629
- if (outsideBox(cur, visible, 1)) {
7630
- cur = panVisualViewportNearest(win, scrollingElement, startElement, cur);
7631
- visible = getVisibleViewportBox(win, scrollingElement);
7632
- }
7633
- if (outsideBox(cur, visible)) cur = scrollAncestors(startElement, scrollingElement, cur, visible);
7634
- if (outsideBox(cur, visible, 1)) panVisualViewportCenter(win, scrollingElement, startElement, cur);
8074
+ scrollRectIntoView({
8075
+ rect,
8076
+ startElement
8077
+ });
7635
8078
  };
7636
8079
  const scrollDOMRangeFocusIntoViewIfNeeded = (domRange, isBackward = false) => {
7637
8080
  const focusRange = domRange.cloneRange();
@@ -7855,29 +8298,6 @@ const nextScrollIntoViewToken = (scope) => {
7855
8298
  VIEW_TO_SCROLL_TOKEN.set(scope, token);
7856
8299
  return token;
7857
8300
  };
7858
- const hasCSSScrollMargin = (element) => {
7859
- const win = element.ownerDocument?.defaultView;
7860
- if (!win) return false;
7861
- const style = win.getComputedStyle(element);
7862
- return (Number.parseFloat(element.style.scrollMarginTop || style.scrollMarginTop) || 0) > 0 || (Number.parseFloat(element.style.scrollMarginBottom || style.scrollMarginBottom) || 0) > 0 || (Number.parseFloat(element.style.scrollMarginLeft || style.scrollMarginLeft) || 0) > 0 || (Number.parseFloat(element.style.scrollMarginRight || style.scrollMarginRight) || 0) > 0;
7863
- };
7864
- const runScrollIntoViewIfNeeded = (element, options) => {
7865
- if (typeof options !== "object" || options === null || typeof options.behavior === "function" || !hasCSSScrollMargin(element)) {
7866
- scrollIntoViewIfNeeded(element, options);
7867
- return;
7868
- }
7869
- const { behavior } = options;
7870
- scrollIntoViewIfNeeded(element, {
7871
- ...options,
7872
- behavior: (actions) => {
7873
- for (const { el, left, top } of actions) if (el.scrollTop !== top || el.scrollLeft !== left) el.scroll({
7874
- behavior,
7875
- left,
7876
- top
7877
- });
7878
- }
7879
- });
7880
- };
7881
8301
  const getScrollIntoViewScope = (editor, fallback) => hasEditorRuntime(editor) ? getOwnViewPresentation(editor) ?? documentOf(editor) : fallback;
7882
8302
  const findMountedAncestorRevealStep = (editor, targetRoot) => {
7883
8303
  if (!hasEditorRuntime(editor)) return null;
@@ -8135,6 +8555,11 @@ const resolveDOMRangeInRoot = (editor, range, root, { checkPageText = false, exp
8135
8555
  }
8136
8556
  return domRange;
8137
8557
  };
8558
+ const isTargetInsideVoid = (editor, target) => {
8559
+ if (!DOMEditor.hasTarget(editor, target)) return false;
8560
+ const editorNode = DOMEditor.resolveNode(editor, target);
8561
+ return !!editorNode && NodeApi.isElement(editorNode) && isVoid$2(editor, editorNode);
8562
+ };
8138
8563
  const DOMEditorImpl = {
8139
8564
  androidPendingDiffs: (editor) => EDITOR_TO_PENDING_DIFFS.get(editor),
8140
8565
  androidScheduleFlush: (editor) => {
@@ -8269,22 +8694,30 @@ const DOMEditorImpl = {
8269
8694
  const syncDomSelection = () => {
8270
8695
  if (findDOMRootRuntime(el)?.isSelectionHeld()) return;
8271
8696
  const innerSelection = resolveNextKeyCaret(editor, el);
8272
- if (innerSelection) {
8273
- const projectedSelection = getSelectionDOMRange(editor, innerSelection);
8274
- if (!projectedSelection) {
8275
- clearEditableDOMSelection(el, { editor });
8276
- return;
8277
- }
8278
- const view = reachAt(editor, projectedSelection);
8279
- const domRange = view && resolveDOMRangeInRoot(view, projectedSelection, void 0, {
8280
- exportingSelection: true,
8281
- rejectStaleText: true
8282
- });
8283
- if (domRange) writeEditableDOMSelection((view && view !== editor ? DOMEditor.editable(view) : null) ?? el, getDOMRangeSelectionPoints(domRange, RangeApi.isBackward(projectedSelection)), {
8284
- editor: view ?? editor,
8285
- policy: "focused"
8286
- });
8697
+ if (!innerSelection) return;
8698
+ const projectedSelection = getSelectionDOMRange(editor, innerSelection);
8699
+ const view = projectedSelection ? reachAt(editor, projectedSelection) : null;
8700
+ const targetEditable = (view && view !== editor ? DOMEditor.editable(view) : null) ?? el;
8701
+ const targetRuntime = findDOMRootRuntime(targetEditable);
8702
+ if (targetRuntime?.isSelectionHeld()) return;
8703
+ if (targetRuntime?.exportSelection({
8704
+ coverageMode: "model-only",
8705
+ forceModelExport: true,
8706
+ requireFocused: true,
8707
+ skipScroll: true
8708
+ }) !== void 0) return;
8709
+ if (!projectedSelection) {
8710
+ clearEditableDOMSelection(el, { editor });
8711
+ return;
8287
8712
  }
8713
+ const domRange = view && resolveDOMRangeInRoot(view, projectedSelection, void 0, {
8714
+ exportingSelection: true,
8715
+ rejectStaleText: true
8716
+ });
8717
+ if (domRange) writeEditableDOMSelection(targetEditable, getDOMRangeSelectionPoints(domRange, RangeApi.isBackward(projectedSelection)), {
8718
+ editor: view ?? editor,
8719
+ policy: "focused"
8720
+ });
8288
8721
  };
8289
8722
  const trySyncDomSelection = () => {
8290
8723
  try {
@@ -8380,7 +8813,7 @@ const DOMEditorImpl = {
8380
8813
  },
8381
8814
  hasEditableTarget: (editor, target) => isDOMNode(target) && DOMEditor.hasDOMNode(editor, target, { editable: true }),
8382
8815
  hasRange: (editor, { anchor, focus }) => hasPointPath(editor, anchor) && hasPointPath(editor, focus),
8383
- hasSelectableTarget: (editor, target) => DOMEditor.hasEditableTarget(editor, target) || DOMEditor.isTargetInsideNonReadonlyVoid(editor, target) || DOMEditor.hasTarget(editor, target) && isSoftLineEndTarget(target),
8816
+ hasSelectableTarget: (editor, target) => DOMEditor.hasEditableTarget(editor, target) || isTargetInsideVoid(editor, target) || DOMEditor.hasTarget(editor, target) && isSoftLineEndTarget(target),
8384
8817
  hasTarget: (editor, target) => isDOMNode(target) && DOMEditor.hasDOMNode(editor, target),
8385
8818
  clipboard: {
8386
8819
  insertData: (editor, data) => insertDOMData(editor, data),
@@ -8393,12 +8826,7 @@ const DOMEditorImpl = {
8393
8826
  isComposing: (editor) => !!IS_COMPOSING.get(editor),
8394
8827
  isFocused: (editor) => !!IS_FOCUSED.get(editor),
8395
8828
  isReadOnly: (editor) => !!IS_READ_ONLY.get(editor),
8396
- isTargetInsideNonReadonlyVoid: (editor, target) => {
8397
- if (IS_READ_ONLY.get(editor)) return false;
8398
- if (!DOMEditor.hasTarget(editor, target)) return false;
8399
- const editorNode = DOMEditor.resolveNode(editor, target);
8400
- return !!editorNode && NodeApi.isElement(editorNode) && isVoid$2(editor, editorNode);
8401
- },
8829
+ isTargetInsideNonReadonlyVoid: (editor, target) => !IS_READ_ONLY.get(editor) && isTargetInsideVoid(editor, target),
8402
8830
  resolveDOMNode: (editor, nodeOrKey) => {
8403
8831
  if (nodeOrKey === editor) return DOMEditor.editable(editor);
8404
8832
  if (DOMEditor.editable(editor)?.isConnected !== true) return null;
@@ -8462,7 +8890,7 @@ const DOMEditorImpl = {
8462
8890
  },
8463
8891
  scroll: (editor) => getRegisteredScrollElement(editor) ?? DOMEditor.root(editor) ?? DOMEditor.editable(editor) ?? null,
8464
8892
  scrollIntoView: (editor, target, options = { scrollMode: "if-needed" }) => {
8465
- const usesDefaultReveal = typeof options === "object" && options !== null && (options.scrollMode === void 0 || options.scrollMode === "if-needed") && options.block === void 0 && options.inline === void 0 && options.behavior === void 0 && options.boundary === void 0 && options.skipOverflowHiddenElements === void 0;
8893
+ const usesDefaultReveal = isDefaultScrollRevealOptions(options);
8466
8894
  const readScrollMarginTop = (element) => {
8467
8895
  const window = element.ownerDocument?.defaultView;
8468
8896
  if (!window) return 0;
@@ -8564,13 +8992,15 @@ const DOMEditorImpl = {
8564
8992
  left: scrollElement.scrollLeft,
8565
8993
  top: scrollElement.scrollTop + elementRect.top - scrollRect.top - requestedScrollMarginTop
8566
8994
  });
8567
- } else if (usesDefaultReveal) {
8995
+ } else {
8568
8996
  const rect = element.getBoundingClientRect();
8569
- if (isUsableScrollRect(rect)) scrollRectIntoViewIfNeeded({
8997
+ if (isUsableScrollRect(rect)) scrollRectIntoView({
8998
+ options,
8570
8999
  rect: toScrollRect(rect),
9000
+ scrollMarginTop: requestedScrollMarginTop,
8571
9001
  startElement: element
8572
9002
  });
8573
- } else runScrollIntoViewIfNeeded(element, options);
9003
+ }
8574
9004
  return;
8575
9005
  }
8576
9006
  const domRange = PointApi.isPoint(target) ? DOMEditor.resolveDOMRange(activeView, {
@@ -8590,31 +9020,14 @@ const DOMEditorImpl = {
8590
9020
  scrollDOMRangeFocusIntoViewIfNeeded(domRange, Boolean(range && RangeApi.isBackward(range)));
8591
9021
  return;
8592
9022
  }
8593
- const hadOwnRect = Object.hasOwn(leafElement, "getBoundingClientRect");
8594
- const originalGetBoundingClientRect = leafElement.getBoundingClientRect;
8595
- const nearestScrollMarginTop = typeof options === "object" && options !== null && (options.block === void 0 || options.block === "nearest") ? readScrollMarginTop(leafElement) : 0;
8596
- leafElement.getBoundingClientRect = () => {
8597
- const rangeRect = domRange.getBoundingClientRect();
8598
- const baseRect = isUsableScrollRect(rangeRect) ? rangeRect : originalGetBoundingClientRect.call(leafElement);
8599
- if (nearestScrollMarginTop <= 0) return baseRect;
8600
- return {
8601
- bottom: baseRect.bottom + nearestScrollMarginTop,
8602
- height: baseRect.height + nearestScrollMarginTop,
8603
- left: baseRect.left,
8604
- right: baseRect.right,
8605
- toJSON: () => baseRect.toJSON?.() ?? {},
8606
- top: baseRect.top,
8607
- width: baseRect.width,
8608
- x: baseRect.x,
8609
- y: baseRect.y
8610
- };
8611
- };
8612
- try {
8613
- runScrollIntoViewIfNeeded(leafElement, options);
8614
- } finally {
8615
- if (hadOwnRect) leafElement.getBoundingClientRect = originalGetBoundingClientRect;
8616
- else Reflect.deleteProperty(leafElement, "getBoundingClientRect");
8617
- }
9023
+ const rangeRect = typeof domRange.getBoundingClientRect === "function" ? domRange.getBoundingClientRect() : null;
9024
+ const baseRect = rangeRect && isUsableScrollRect(rangeRect) ? rangeRect : leafElement.getBoundingClientRect();
9025
+ if (!isUsableScrollRect(baseRect)) return;
9026
+ scrollRectIntoView({
9027
+ options,
9028
+ rect: toScrollRect(baseRect),
9029
+ startElement: leafElement
9030
+ });
8618
9031
  };
8619
9032
  if (!alwaysMode) {
8620
9033
  const cancelInitial = schedulePhase(initialSchedulerView, "dom-editor-scroll-into-view", run);
@@ -9745,7 +10158,11 @@ function isHotkey(hotkey, optionsOrEvent, event) {
9745
10158
  const targetEvent = isKeyboardEventLike(optionsOrEvent) ? optionsOrEvent : event;
9746
10159
  const options = isKeyboardEventLike(optionsOrEvent) ? void 0 : optionsOrEvent;
9747
10160
  if (!targetEvent) throw new TypeError("isHotkey requires a keyboard event");
9748
- return getCachedHotkeyMatcher(hotkey, options ?? { platform: usesAppleDOMHotkeys(targetEvent) ? "apple" : "other" })(targetEvent);
10161
+ const rawPlatform = options?.platform;
10162
+ return getCachedHotkeyMatcher(hotkey, {
10163
+ ignoreModifiers: options?.ignoreModifiers,
10164
+ platform: rawPlatform ?? (usesAppleDOMHotkeys(targetEvent) ? "apple" : "other")
10165
+ })(targetEvent);
9749
10166
  }
9750
10167
  //#endregion
9751
10168
  //#region src/dom/utils/hotkeys.ts
@@ -9891,4 +10308,4 @@ const keyToDataAttribute = (key) => `data-editor-${toKebabCase(key)}`;
9891
10308
  /** Return DOM data attribute names that mirror primitive node properties. */
9892
10309
  const getNodeDataAttributeKeys = (node) => Object.keys(node).filter((key) => typeof node[key] !== "object" && (!TextApi.isText(node) || key !== "text")).map((key) => keyToDataAttribute(key));
9893
10310
  //#endregion
9894
- export { eventCarriesBlockFragment as $, resolveDOMTextFlowInsertTarget as $n, isElementFocused as $t, createDOMEditorCapability as A, isWebKitDOMHost as An, NODE_TO_PARENT as Ar, SOFT_LINE_END as At, resolveWrittenDOMRange as B, getPliteStringEdgeOffset as Bn, isDOMElement as Br, resolveSoftLineEndDOMPoint as Bt, normalizeRange as C, writeDOMSelection as Cn, ELEMENT_TO_NODE as Cr, writeDOMDataTransferFragment as Ct, DOMEditor as D, isAndroidDOMHost as Dn, IS_READ_ONLY as Dr, observeDataTransferInsertion as Dt, verifyDiffState as E, hasDOMHostQuirk as En, IS_NODE_MAP_DIRTY as Er, dataTransferFormats as Et, isFocusRequestedElsewhere as F, getNearestPliteStringRect as Fn, getFlatTreeParentElement as Fr, isSoftLineTextStale as Ft, subscribeEditorDOMScope as G, getPliteTextHostStrings as Gn, isDOMText as Gr, canWriteEditableDOMSelection as Gt, setEditorDOMEditableElement as H, getPliteStringPlacementAtX as Hn, isDOMInputOrTextArea as Hr, resolvePliteNodePath as Ht, isSelectableDOMSelection as I, getOwnedPliteTextStrings as In, getSelection as Ir, noteAfterInsertCaret as It, writeViewSelectionPart as J, hasUsableDOMRect as Jn, normalizeDOMPoint as Jr, findDOMRootRuntime as Jt, supersedeFocusRequest as K, getTextFlowPointAtCoordinates as Kn, isPlainTextOnlyPaste as Kr, clearEditableDOMSelection as Kt, isTrackedMutation as L, getPliteStringCoordinatePlacement as Ln, hasShadowRoot as Lr, readAfterInsertCaret as Lt, focusEditableElement as M, usesAppleDOMHotkeys as Mn, containsShadowAware as Mr, SOFT_LINE_FLAG as Mt, getEditorDOMHostScrollElement as N, caretShowsPointOffTextFlowCharacters as Nn, getActiveElement as Nr, clearAfterInsertCaret as Nt, DOMResolutionError as O, isBlinkDOMHost as On, NODE_TO_ELEMENT as Or, writeDataTransferFragment as Ot, getOrCreateDOMNodeKey as P, createDOMGeometryKernel as Pn, getDefaultView as Pr, isSoftLineEndBetween as Pt, scrollDOMRangeFocusIntoViewIfNeeded as Q, resolveDOMTextFlowEntry as Qn, hasMountedDOMRoot as Qt, resolveDOMPointInRoot as R, getPliteStringDirectPlacement as Rn, isAfter as Rr, readLowerSoftLineEnd as Rt, normalizePoint as S, sameDOMSelectionPoints as Sn, ELEMENT_TO_EDITOR as Sr, domCommands as St, targetRange as T, getDOMHostLanguage as Tn, IS_FOCUSED as Tr, writeDOMRangeData as Tt, setEditorDOMRootElement as U, getPliteStringPlacementDOMPoint as Un, isDOMNode as Ur, DOMRootRuntime as Ut, setEditableRootReveal as V, getPliteStringLength as Vn, isDOMHTMLElement as Vr, findMountedDOMNodeByPath as Vt, setEditorDOMScrollElement as W, getPliteTextHostBounds as Wn, isDOMSelection as Wr, canWriteDOMSelection as Wt, liftCaretOutOfCollapsedSection as X, readDOMTextFlowPaint as Xn, writeClipboardCut as Xr, focusedElementOnPage as Xt, ensureFocusCaret as Y, isDOMTextFlowSegmentSynchronized as Yn, readClipboardCut as Yr, findEditorDOMRootRuntime as Yt, resolveNextKeyCaret as Z, releaseDOMTextFlowRecordIndex as Zn, getEditorDOMRoot as Zt, TRIPLE_CLICK as _, readDOMSelectionPoints as _n, EDITOR_TO_RUNTIME_ID_TO_KEY as _r, takeDragSession as _t, isLeaf as a, shouldClearEditableDOMSelection as an, DOMCoverage as ar, indicateDOMDropTarget as at, longestCommonPrefixLength as b, readsSelectionAsHost as bn, EDITOR_TO_USER_SELECTION as br, subscribeDropIndicator as bt, isText as c, markDOMSyncMutationTarget as cn, EDITOR_TO_FORCE_RENDER as cr, restDOMBlockDrag as ct, Hotkeys as d, enableKernelTraceRetention as dn, EDITOR_TO_PENDING_DIFFS as dr, clearDragScrollRepaint as dt, isSelectionOwnedByEditable as en, resolveDOMTextFlowOffset as er, resolveBlockFragmentDropRange as et, getLineBoundaryKeyboardMove as f, selectDOMInputDefaultActionPhase as fn, EDITOR_TO_PENDING_INSERTION_MARKS as fr, clearDragSession as ft, isHotkey as g, isDOMSelectionWriteEcho as gn, EDITOR_TO_RUNTIME_ID_TO_ELEMENTS as gr, settleDragSession as gt, createCompiledHotkeyMatcher as h, getDOMRangeSelectionPoints as hn, EDITOR_TO_ROOT_VIEW_EDITORS as hr, setDragScrollRepaint as ht, isElement as i, resolveDOMTargetView as in, setDOMTextFlowRecordIndexes as ir, copyIntentOf as it, findDOMPointElementInRoot as j, supportsDOMBeforeInput as jn, closestShadowAware as jr, SOFT_LINE_END_SELECTOR as jt, claimFocusRequest as k, isGeckoDOMHost as kn, NODE_TO_INDEX as kr, Key as kt, isVoid as l, watchDOMSyncTextMarks as ln, EDITOR_TO_KEY_TO_ELEMENT as lr, beginDragSession as lt, ariaKeyShortcuts as m, forgetDOMSelectionRecordWithin as mn, EDITOR_TO_PLACEHOLDER_ELEMENT as mr, readDragSession as mt, getNodeDataAttributeKeys as n, readEditableDOMSelectionPoints as nn, resolveDOMTextFlowRecordText as nr, intersectClipChain as nt, isNode as o, writeEditableDOMSelection as on, isCollapsedDOMCoverageBoundary as or, pointAt as ot, isPasteWithoutFormatting as p, forgetDOMSelectionRecord as pn, EDITOR_TO_PENDING_SELECTION as pr, isDragSessionClaimed as pt, watchFocusSuperseded as q, getUsableRangeRects as qn, markPlainTextPaste as qr, documentOf as qt, isEditor as r, resolveDOMReach as rn, setDOMTextFlowRecordIndex as rr, walkClipChain as rt, isString as s, isDOMSyncMutation as sn, EDITOR_TO_ELEMENT as sr, resolveDOMDropTarget as st, getElements as t, movedFocusElsewhere as tn, resolveDOMTextFlowRecordDOMText as tr, getDragAutoScrollTarget as tt, keyToDataAttribute as u, scheduleEditorDOMPhase as un, EDITOR_TO_PENDING_ACTION as ur, cancelDragRest as ut, dom as v, readDOMSelectionRange as vn, EDITOR_TO_SCHEDULE_FLUSH as vr, publishDropIndicator as vt, normalizeStringDiff as w, CAN_USE_DOM as wn, IS_COMPOSING as wr, writeDOMFragmentData as wt, mergeStringDiffs as x, recordDOMSelection as xn, EDITOR_TO_WINDOW as xr, cleanDOMClipboardContents as xt, applyStringDiff as y, readDOMSelectionRecord as yn, EDITOR_TO_USER_MARKS as yr, readDropIndicator as yt, resolveDOMRangeInRoot as z, getPliteStringDocumentOffset as zn, isBefore as zr, recordSoftLineEnd as zt };
10311
+ export { eventCarriesBlockFragment as $, getDOMTextFlowRestoreSegments as $n, normalizeDOMPoint as $r, hasMountedDOMRoot as $t, createDOMEditorCapability as A, isAndroidDOMHost as An, IS_FOCUSED as Ar, SOFT_LINE_END as At, resolveWrittenDOMRange as B, getPliteStringCoordinatePlacement as Bn, getFlatTreeParentElement as Br, resolveSoftLineEndDOMPoint as Bt, normalizeRange as C, readsSelectionAsHost as Cn, EDITOR_TO_SCHEDULE_FLUSH as Cr, writeDOMDataTransferFragment as Ct, DOMEditor as D, CAN_USE_DOM as Dn, ELEMENT_TO_EDITOR as Dr, observeDataTransferInsertion as Dt, verifyDiffState as E, writeDOMSelection as En, EDITOR_TO_WINDOW as Er, dataTransferFormats as Et, isFocusRequestedElsewhere as F, usesAppleDOMHotkeys as Fn, NODE_TO_PARENT as Fr, isSoftLineTextStale as Ft, subscribeEditorDOMScope as G, getPliteStringPlacementAtX as Gn, isDOMElement as Gr, canWriteEditableDOMSelection as Gt, setEditorDOMEditableElement as H, getPliteStringDocumentOffset as Hn, hasShadowRoot as Hr, resolvePliteNodePath as Ht, isSelectableDOMSelection as I, caretShowsPointOffTextFlowCharacters as In, closestShadowAware as Ir, noteAfterInsertCaret as It, writeViewSelectionPart as J, getPliteTextHostStrings as Jn, isDOMNode as Jr, findDOMRootRuntime as Jt, supersedeFocusRequest as K, getPliteStringPlacementDOMPoint as Kn, isDOMHTMLElement as Kr, clearEditableDOMSelection as Kt, isTrackedMutation as L, createDOMGeometryKernel as Ln, containsShadowAware as Lr, readAfterInsertCaret as Lt, focusEditableElement as M, isGeckoDOMHost as Mn, IS_READ_ONLY as Mr, SOFT_LINE_FLAG as Mt, getEditorDOMHostScrollElement as N, isWebKitDOMHost as Nn, NODE_TO_ELEMENT as Nr, clearAfterInsertCaret as Nt, DOMResolutionError as O, getDOMHostLanguage as On, ELEMENT_TO_NODE as Or, writeDataTransferFragment as Ot, getOrCreateDOMNodeKey as P, supportsDOMBeforeInput as Pn, NODE_TO_INDEX as Pr, isSoftLineEndBetween as Pt, scrollDOMRangeFocusIntoViewIfNeeded as Q, isOnVisualRow as Qn, markPlainTextPaste as Qr, getEventTargetInRoot as Qt, resolveDOMPointInRoot as R, getNearestPliteStringRect as Rn, getActiveElement as Rr, readLowerSoftLineEnd as Rt, normalizePoint as S, readDOMSelectionRecord as Sn, EDITOR_TO_RUNTIME_ID_TO_KEY as Sr, domCommands as St, targetRange as T, sameDOMSelectionPoints as Tn, EDITOR_TO_USER_SELECTION as Tr, writeDOMRangeData as Tt, setEditorDOMRootElement as U, getPliteStringEdgeOffset as Un, isAfter as Ur, DOMRootRuntime as Ut, setEditableRootReveal as V, getPliteStringDirectPlacement as Vn, getSelection as Vr, findMountedDOMNodeByPath as Vt, setEditorDOMScrollElement as W, getPliteStringLength as Wn, isBefore as Wr, canWriteDOMSelection as Wt, liftCaretOutOfCollapsedSection as X, getUsableRangeRects as Xn, isDOMText as Xr, focusedElementOnPage as Xt, ensureFocusCaret as Y, getTextFlowPointAtCoordinates as Yn, isDOMSelection as Yr, findEditorDOMRootRuntime as Yt, resolveNextKeyCaret as Z, hasUsableDOMRect as Zn, isPlainTextOnlyPaste as Zr, getEditorDOMRoot as Zt, TRIPLE_CLICK as _, forgetDOMSelectionRecordWithin as _n, EDITOR_TO_PENDING_INSERTION_MARKS as _r, takeDragSession as _t, isLeaf as a, readEditableDOMSelectionPoints as an, resolveDOMTextFlowOffset as ar, indicateDOMDropTarget as at, longestCommonPrefixLength as b, readDOMSelectionPoints as bn, EDITOR_TO_ROOT_VIEW_EDITORS as br, subscribeDropIndicator as bt, isText as c, shouldClearEditableDOMSelection as cn, setDOMTextFlowRecordIndex as cr, restDOMBlockDrag as ct, Hotkeys as d, markDOMSyncMutationTarget as dn, isCollapsedDOMCoverageBoundary as dr, clearDragScrollRepaint as dt, readClipboardCut as ei, isElementFocused as en, isDOMTextFlowSegmentSynchronized as er, resolveBlockFragmentDropRange as et, getLineBoundaryKeyboardMove as f, watchDOMSyncTextMarks as fn, EDITOR_TO_ELEMENT as fr, clearDragSession as ft, isHotkey as g, forgetDOMSelectionRecord as gn, EDITOR_TO_PENDING_DIFFS as gr, settleDragSession as gt, createCompiledHotkeyMatcher as h, selectDOMInputDefaultActionPhase as hn, EDITOR_TO_PENDING_ACTION as hr, setDragScrollRepaint as ht, isElement as i, observeRootBoundaryEvent as in, resolveDOMTextFlowInsertTarget as ir, copyIntentOf as it, findDOMPointElementInRoot as j, isBlinkDOMHost as jn, IS_NODE_MAP_DIRTY as jr, SOFT_LINE_END_SELECTOR as jt, claimFocusRequest as k, hasDOMHostQuirk as kn, IS_COMPOSING as kr, Key as kt, isVoid as l, writeEditableDOMSelection as ln, setDOMTextFlowRecordIndexes as lr, beginDragSession as lt, ariaKeyShortcuts as m, enableKernelTraceRetention as mn, EDITOR_TO_KEY_TO_ELEMENT as mr, readDragSession as mt, getNodeDataAttributeKeys as n, isSelectionOwnedByEditable as nn, releaseDOMTextFlowRecordIndex as nr, intersectClipChain as nt, isNode as o, resolveDOMReach as on, resolveDOMTextFlowRecordDOMText as or, pointAt as ot, isPasteWithoutFormatting as p, scheduleEditorDOMPhase as pn, EDITOR_TO_FORCE_RENDER as pr, isDragSessionClaimed as pt, watchFocusSuperseded as q, getPliteTextHostBounds as qn, isDOMInputOrTextArea as qr, documentOf as qt, isEditor as r, movedFocusElsewhere as rn, resolveDOMTextFlowEntry as rr, walkClipChain as rt, isString as s, resolveDOMTargetView as sn, resolveDOMTextFlowRecordText as sr, resolveDOMDropTarget as st, getElements as t, writeClipboardCut as ti, isEventInsideRoot as tn, readDOMTextFlowPaint as tr, getDragAutoScrollTarget as tt, keyToDataAttribute as u, isDOMSyncMutation as un, DOMCoverage as ur, cancelDragRest as ut, dom as v, getDOMRangeSelectionPoints as vn, EDITOR_TO_PENDING_SELECTION as vr, publishDropIndicator as vt, normalizeStringDiff as w, recordDOMSelection as wn, EDITOR_TO_USER_MARKS as wr, writeDOMFragmentData as wt, mergeStringDiffs as x, readDOMSelectionRange as xn, EDITOR_TO_RUNTIME_ID_TO_ELEMENTS as xr, cleanDOMClipboardContents as xt, applyStringDiff as y, isDOMSelectionWriteEcho as yn, EDITOR_TO_PLACEHOLDER_ELEMENT as yr, readDropIndicator as yt, resolveDOMRangeInRoot as z, getOwnedPliteTextStrings as zn, getDefaultView as zr, recordSoftLineEnd as zt };