@mx-space/cli 0.13.1 → 0.13.3

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 (63) hide show
  1. package/README.md +60 -1
  2. package/ROADMAP.md +11 -8
  3. package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-DTxuYHmG.mjs} +2267 -431
  4. package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-BlCLnfA6.mjs} +47 -10
  5. package/dist/Lexical.prod-CeB9UQuo.mjs +6816 -0
  6. package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-CdFkLR_D.mjs} +131 -39
  7. package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-ktUajxsv.mjs} +2 -2
  8. package/dist/LexicalClipboard.prod-DliyLofW.mjs +429 -0
  9. package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-CL9tHWJX.mjs} +81 -67
  10. package/dist/LexicalCodeCore.prod-BoMSJc29.mjs +651 -0
  11. package/dist/LexicalDragon.dev-CqW7Aq5H.mjs +186 -0
  12. package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-DLXctJyy.mjs} +3 -2
  13. package/dist/LexicalDragon.prod-DHI3T6n5.mjs +121 -0
  14. package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-BP-18zns.mjs} +352 -38
  15. package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-BWH6xbzG.mjs} +9 -4
  16. package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-Cs6OgrDn.mjs} +479 -330
  17. package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-DJp__UcP.mjs} +2 -2
  18. package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-o0v9cIu5.mjs} +2 -2
  19. package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-DoymwFpG.mjs} +327 -269
  20. package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-CVkbWtUA.mjs} +6 -4
  21. package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-C2b3z99k.mjs} +355 -353
  22. package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-7cgLOLIe.mjs} +70 -59
  23. package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-DWFgoXHR.mjs} +211 -212
  24. package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-Ci2iOxFx.mjs} +246 -198
  25. package/dist/LexicalList.prod-D0xX5d3G.mjs +944 -0
  26. package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-C0ZYCyuR.mjs} +130 -38
  27. package/dist/LexicalMarkdown.prod-0M-Nc-rh.mjs +932 -0
  28. package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-Cnr1kDym.mjs} +151 -122
  29. package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-BUJZAiap.mjs} +8 -11
  30. package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +538 -0
  31. package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-C4L7l8OB.mjs} +10 -9
  32. package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-CLKroUMQ.mjs} +4 -4
  33. package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-DzFqpTlw.mjs} +144 -146
  34. package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-Cc9-zqKa.mjs} +186 -121
  35. package/dist/LexicalTable.prod-BgO4nCxy.mjs +2336 -0
  36. package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-BRgK0L6G.mjs} +375 -35
  37. package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-BVAwOkL4.mjs} +24 -12
  38. package/dist/LexicalUtils.prod-C1gtvVDP.mjs +504 -0
  39. package/dist/bin/mxs.mjs +1 -1
  40. package/dist/{esm-DFrz5rIo.mjs → esm-BNu4sUWV.mjs} +220 -185
  41. package/dist/esm-jbwcVZth.mjs +2 -0
  42. package/dist/index.d.mts +46 -17
  43. package/dist/index.mjs +1 -1
  44. package/dist/{mxs-DXpzbUf4.mjs → mxs-zPvjkoNC.mjs} +8235 -6041
  45. package/dist/vendor/litexml/cli.mjs +24150 -0
  46. package/dist/vendor/litexml/litexml-html-preview-client.css +8862 -0
  47. package/dist/vendor/litexml/litexml-html-preview-client.js +163816 -0
  48. package/dist/vendor/litexml/style.css +96 -0
  49. package/package.json +21 -22
  50. package/skills/commands-ai.md +115 -0
  51. package/skills/commands-preview.md +3 -3
  52. package/skills/overview.md +1 -0
  53. package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
  54. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
  55. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
  56. package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
  57. package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
  58. package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
  59. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
  60. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
  61. package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
  62. package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
  63. package/dist/esm-DXO9Afik.mjs +0 -2
@@ -1,9 +1,9 @@
1
- import { c as configExtension, d as getPeerDependencyFromEditor, r as $getPeerDependency } from "./LexicalExtension.node-BVlcrgOx.mjs";
2
- import { $ as $isElementNode, A as $getChildCaretAtIndex, D as $getCaretRangeInDirection, Dt as $splitAtPointCaretNext, E as $getCaretRange, Er as isSelectionWithinEditor, F as $getEditor, Fr as shallowMergeConfig, H as $getRoot, K as $getTextPointCaret, L as $getNearestNodeFromDOMNode, Lt as COMMAND_PRIORITY_CRITICAL, M as $getCollapsedCaretRange, Rr as tokenizeRawText, Tt as $setSelectionFromCaretRange, U as $getSelection, Ut as COPY_COMMAND, _t as $parseSerializedNode, cr as defineExtension, ft as $isTextNode, g as $createTabNode, i as $caretRangeFromSelection, jr as safeCast, k as $getChildCaret, lr as getDOMSelection, pt as $isTextPointCaret, qn as SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, r as $caretFromPoint, s as $comparePointCaretNext, st as $isRangeSelection } from "./Lexical.node-fXM8Jp7p.mjs";
3
- import { c as ImportSource, f as contextValue, i as $generateNodesFromDOMViaExtension, l as ImportSourceDataTransfer, n as $generateHtmlFromNodes, r as $generateNodesFromDOM } from "./LexicalHtml.node-BvNF96jZ.mjs";
4
- import { i as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-BU5L4193.mjs";
5
- import { g as objectKlassEquals } from "./LexicalUtils.node-j3Llm7Y3.mjs";
6
- //#region ../../node_modules/.pnpm/@lexical+clipboard@0.45.0/node_modules/@lexical/clipboard/dist/LexicalClipboard.dev.mjs
1
+ import { c as configExtension, d as getPeerDependencyFromEditor, r as $getPeerDependency } from "./LexicalExtension.node-BWH6xbzG.mjs";
2
+ import { $r as isSelectionWithinEditor, A as $getChildCaret, Ar as getEditorPropertyFromDOMNode, D as $getCaretRange, Er as getDOMSelectionPoints, Ft as $splitAtPointCaretNext, Hr as isDOMShadowRoot, I as $getEditor, K as $getSlot, Kt as COMMAND_PRIORITY_CRITICAL, Mr as getParentElement, N as $getCollapsedCaretRange, Nt as $setSelectionFromCaretRange, O as $getCaretRangeInDirection, Or as getDOMShadowRoots, Pr as getRootOwnerDocument, R as $getNearestNodeFromDOMNode, Tr as getDOMSelection, Tt as $parseSerializedNode, U as $getRoot, W as $getSelection, Y as $getSlotNames, Z as $getTextPointCaret, Zr as isLexicalEditor, _ as $createTabNode, a as $caretRangeFromSelection, ai as safeCast, ar as SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, at as $isElementNode, br as defineExtension, bt as $isTextNode, c as $comparePointCaretNext, dt as $isNodeSelection, en as COPY_COMMAND, fi as tokenizeRawText, i as $caretFromPoint, j as $getChildCaretAtIndex, li as shallowMergeConfig, pt as $isRangeSelection, q as $getSlotFrame, qr as isHTMLElement, xr as findAllLexicalElementsDeep, xt as $isTextPointCaret } from "./Lexical.node-BlCLnfA6.mjs";
3
+ import { d as ImportSourceDataTransfer, i as $generateNodesFromDOMViaExtension, m as contextValue, n as $generateHtmlFromNodes, r as $generateNodesFromDOM, s as CoreImportExtension, u as ImportSource } from "./LexicalHtml.node-CVkbWtUA.mjs";
4
+ import { a as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-CLKroUMQ.mjs";
5
+ import { h as objectKlassEquals } from "./LexicalUtils.node-BVAwOkL4.mjs";
6
+ //#region ../../node_modules/.pnpm/@lexical+clipboard@0.46.0_typescript@6.0.3/node_modules/@lexical/clipboard/dist/LexicalClipboard.dev.mjs
7
7
  /**
8
8
  * Copyright (c) Meta Platforms, Inc. and affiliates.
9
9
  *
@@ -18,23 +18,92 @@ import { g as objectKlassEquals } from "./LexicalUtils.node-j3Llm7Y3.mjs";
18
18
  * LICENSE file in the root directory of this source tree.
19
19
  *
20
20
  */
21
+ function isWithinComposedTree(node, rootElement) {
22
+ for (let current = node; current !== null;) {
23
+ if (current === rootElement) return true;
24
+ current = getParentElement(current);
25
+ }
26
+ return false;
27
+ }
28
+ function findTextOffsetAtPoint(x, y, container, doc) {
29
+ const range = doc.createRange();
30
+ const vDist = (r) => y < r.top ? r.top - y : y > r.bottom ? y - r.bottom : 0;
31
+ const hDist = (r) => x < r.left ? r.left - x : x > r.right ? x - r.right : 0;
32
+ const walker = doc.createTreeWalker(container, NodeFilter.SHOW_TEXT);
33
+ let bestNode = null;
34
+ let bestV = Infinity;
35
+ let bestH = Infinity;
36
+ for (let n = walker.nextNode(); n; n = walker.nextNode()) {
37
+ range.selectNodeContents(n);
38
+ for (const r of range.getClientRects()) {
39
+ const v = vDist(r);
40
+ const h = hDist(r);
41
+ if (v < bestV || v === bestV && h < bestH) {
42
+ bestV = v;
43
+ bestH = h;
44
+ bestNode = n;
45
+ }
46
+ }
47
+ }
48
+ if (bestNode === null) return null;
49
+ let bestOffset = 0;
50
+ let offV = Infinity;
51
+ let offH = Infinity;
52
+ for (let i = 0; i <= bestNode.length; i++) {
53
+ range.setStart(bestNode, i);
54
+ range.collapse(true);
55
+ const r = range.getBoundingClientRect();
56
+ const v = vDist(r);
57
+ const h = Math.abs(x - r.left);
58
+ if (v < offV || v === offV && h < offH) {
59
+ offV = v;
60
+ offH = h;
61
+ bestOffset = i;
62
+ }
63
+ }
64
+ return {
65
+ node: bestNode,
66
+ offset: bestOffset
67
+ };
68
+ }
21
69
  /** @internal */
22
- function caretFromPoint(x, y) {
23
- if (typeof document.caretRangeFromPoint !== "undefined") {
24
- const range = document.caretRangeFromPoint(x, y);
70
+ function caretFromPoint(x, y, rootElement = null) {
71
+ const doc = getRootOwnerDocument(rootElement);
72
+ const shadowRoots = rootElement ? getDOMShadowRoots(rootElement) : [];
73
+ const hasShadow = rootElement !== null && shadowRoots.length > 0;
74
+ if (hasShadow && typeof doc.caretPositionFromPoint === "function") {
75
+ const caretPosition = doc.caretPositionFromPoint(x, y, { shadowRoots });
76
+ if (caretPosition !== null && isWithinComposedTree(caretPosition.offsetNode, rootElement)) return {
77
+ node: caretPosition.offsetNode,
78
+ offset: caretPosition.offset
79
+ };
80
+ }
81
+ if (hasShadow) {
82
+ const rootNode = rootElement.getRootNode();
83
+ if (isDOMShadowRoot(rootNode)) {
84
+ const element = rootNode.elementFromPoint(x, y);
85
+ if (element !== null && rootElement.contains(element)) {
86
+ const result = findTextOffsetAtPoint(x, y, element, doc);
87
+ if (result !== null) return result;
88
+ }
89
+ }
90
+ }
91
+ if (typeof doc.caretRangeFromPoint === "function") {
92
+ const range = doc.caretRangeFromPoint(x, y);
25
93
  if (range === null) return null;
26
94
  return {
27
95
  node: range.startContainer,
28
96
  offset: range.startOffset
29
97
  };
30
- } else if (document.caretPositionFromPoint !== "undefined") {
31
- const range = document.caretPositionFromPoint(x, y);
32
- if (range === null) return null;
98
+ } else if (typeof doc.caretPositionFromPoint === "function") {
99
+ const caretPosition = doc.caretPositionFromPoint(x, y);
100
+ if (caretPosition === null) return null;
33
101
  return {
34
- node: range.offsetNode,
35
- offset: range.offset
102
+ node: caretPosition.offsetNode,
103
+ offset: caretPosition.offset
36
104
  };
37
- } else return null;
105
+ }
106
+ return null;
38
107
  }
39
108
  /**
40
109
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -323,13 +392,13 @@ function $getImportOutput() {
323
392
  * });
324
393
  * ```
325
394
  */
326
- const ClipboardImportExtension = defineExtension({
395
+ const ClipboardImportExtension = /* @__PURE__ */ defineExtension({
327
396
  build: (_editor, config) => ({
328
397
  $importMimeType: config.$importMimeType,
329
398
  $insertDataTransfer: (dataTransfer, selection) => $runImport(config, dataTransfer, selection),
330
399
  priority: config.priority
331
400
  }),
332
- config: safeCast({
401
+ config: /* @__PURE__ */ safeCast({
333
402
  $importMimeType: DEFAULT_IMPORT_MIME_TYPE,
334
403
  priority: DEFAULT_IMPORT_MIME_TYPE_PRIORITY
335
404
  }),
@@ -357,9 +426,14 @@ const ClipboardImportExtension = defineExtension({
357
426
  * Drop-in extension that routes `text/html` clipboard pastes and drops
358
427
  * through the {@link DOMImportExtension} pipeline (rules, schemas,
359
428
  * preprocessors, overlays) instead of the legacy
360
- * {@link $generateNodesFromDOM}. Add to your extension dependencies along
361
- * with the per-package import extensions you want active
362
- * ({@link CoreImportExtension}, {@link RichTextImportExtension}, etc.).
429
+ * {@link $generateNodesFromDOM}. Node-providing extensions
430
+ * (`RichTextExtension`, `ListExtension`, `LinkExtension`,
431
+ * `TableExtension`, `CodeExtension`, …) register their own import rules,
432
+ * so adding this extension to an editor built from them is all it takes
433
+ * to activate the pipeline for pastes. {@link CoreImportExtension} (the
434
+ * paragraph/text/inline-format baseline) is a dependency of this
435
+ * extension, so even an editor with no rule-contributing node extensions
436
+ * gets sensible text handling.
363
437
  *
364
438
  * The original {@link DataTransfer} and `'paste'` source kind are forwarded
365
439
  * into the import context so rules and preprocessors can read them via
@@ -372,20 +446,19 @@ const ClipboardImportExtension = defineExtension({
372
446
  * ```ts
373
447
  * import {defineExtension} from 'lexical';
374
448
  * import {ClipboardDOMImportExtension} from '@lexical/clipboard';
375
- * import {CoreImportExtension, RichTextImportExtension} from '@lexical/html';
449
+ * import {RichTextExtension} from '@lexical/rich-text';
376
450
  *
377
451
  * defineExtension({
378
452
  * name: 'app',
379
453
  * dependencies: [
380
- * CoreImportExtension,
381
- * RichTextImportExtension,
454
+ * RichTextExtension,
382
455
  * ClipboardDOMImportExtension,
383
456
  * ],
384
457
  * });
385
458
  * ```
386
459
  */
387
- const ClipboardDOMImportExtension = defineExtension({
388
- dependencies: [configExtension(ClipboardImportExtension, { $importMimeType: { "text/html": [(html, selection, _$next, dataTransfer) => {
460
+ const ClipboardDOMImportExtension = /* @__PURE__ */ defineExtension({
461
+ dependencies: [CoreImportExtension, /* @__PURE__ */ configExtension(ClipboardImportExtension, { $importMimeType: { "text/html": [(html, selection, _$next, dataTransfer) => {
389
462
  const nodes = $generateNodesFromDOMViaExtension(new DOMParser().parseFromString(trustHTML(html), "text/html"), { context: [contextValue(ImportSource, "paste"), contextValue(ImportSourceDataTransfer, dataTransfer)] });
390
463
  $insertGeneratedNodes($getEditor(), nodes, selection);
391
464
  return true;
@@ -483,15 +556,14 @@ function readDragMarker(dataTransfer) {
483
556
  return isLexicalDragMarker(parsed) ? parsed : null;
484
557
  }
485
558
  function findEditorRootByKey(key, doc) {
486
- const elements = doc.querySelectorAll("[data-lexical-editor=\"true\"]");
487
- for (const el of Array.from(elements)) {
488
- const editor = el.__lexicalEditor;
489
- if (editor && editor.getKey() === key) return el;
559
+ for (const el of findAllLexicalElementsDeep(doc)) {
560
+ const editor = getEditorPropertyFromDOMNode(el);
561
+ if (isLexicalEditor(editor) && editor.getKey() === key && isHTMLElement(el)) return el;
490
562
  }
491
563
  return null;
492
564
  }
493
- function $resolveDropPointCaret(event) {
494
- const hit = caretFromPoint(event.clientX, event.clientY);
565
+ function $resolveDropPointCaret(event, editor) {
566
+ const hit = caretFromPoint(event.clientX, event.clientY, editor.getRootElement());
495
567
  if (hit === null) return null;
496
568
  const node = $getNearestNodeFromDOMNode(hit.node);
497
569
  if (node === null) return null;
@@ -510,7 +582,7 @@ function $doDrop(event, editor, $insertDataTransfer) {
510
582
  if (dataTransfer === null) return false;
511
583
  const marker = readDragMarker(dataTransfer);
512
584
  if (marker === null) return false;
513
- const dropCaret = $resolveDropPointCaret(event);
585
+ const dropCaret = $resolveDropPointCaret(event, editor);
514
586
  if (dropCaret === null) return false;
515
587
  const stableDropCaret = $splitAtPointCaretNext(dropCaret);
516
588
  if (stableDropCaret === null) return false;
@@ -622,11 +694,27 @@ function $appendNodesToJSON(editor, selection, currentNode, targetArray = []) {
622
694
  const children = $isElementNode(target) ? target.getChildren() : [];
623
695
  const serializedNode = exportNodeToJSON(target);
624
696
  if ($isTextNode(target) && target.getTextContentSize() === 0) shouldInclude = false;
697
+ const childSelection = shouldInclude && $isNodeSelection(selection) && $isElementNode(currentNode) ? null : selection;
625
698
  for (let i = 0; i < children.length; i++) {
626
699
  const childNode = children[i];
627
- const shouldIncludeChild = $appendNodesToJSON(editor, selection, childNode, serializedNode.children);
700
+ const shouldIncludeChild = $appendNodesToJSON(editor, childSelection, childNode, serializedNode.children);
628
701
  if (!shouldInclude && $isElementNode(currentNode) && shouldIncludeChild && currentNode.extractWithChild(childNode, selection, "clone")) shouldInclude = true;
629
702
  }
703
+ if (shouldInclude && !shouldExclude) {
704
+ const slotNames = $getSlotNames(target);
705
+ if (slotNames.length > 0) {
706
+ const serializedSlots = {};
707
+ for (const name of slotNames) {
708
+ const slotNode = $getSlot(target, name);
709
+ if (!(slotNode !== null)) formatDevErrorMessage(`LexicalNode: Node ${target.constructor.name} has slot "${name}" but it resolved to no node during export.`);
710
+ const slotArray = [];
711
+ $appendNodesToJSON(editor, null, slotNode, slotArray);
712
+ if (!(slotArray.length === 1 && slotArray[0].type === slotNode.getType())) formatDevErrorMessage(`LexicalNode: slot "${name}" on ${target.constructor.name} did not serialize to exactly the slot value node (got ${String(slotArray.length)} of type ${String(slotArray.length > 0 ? slotArray[0].type : "none")}); a slot value must not be excluded from copy.`);
713
+ serializedSlots[name] = slotArray[0];
714
+ }
715
+ serializedNode.$slots = serializedSlots;
716
+ }
717
+ }
630
718
  if (shouldInclude && !shouldExclude) targetArray.push(serializedNode);
631
719
  else if (Array.isArray(serializedNode.children)) for (let i = 0; i < serializedNode.children.length; i++) {
632
720
  const serializedChildNode = serializedNode.children[i];
@@ -643,7 +731,10 @@ function $appendNodesToJSON(editor, selection, currentNode, targetArray = []) {
643
731
  */
644
732
  function $generateJSONFromSelectedNodes(editor, selection) {
645
733
  const nodes = [];
646
- const topLevelChildren = $getRoot().getChildren();
734
+ const root = $getRoot();
735
+ const slotFrameAnchor = $isRangeSelection(selection) ? selection.anchor.getNode() : $isNodeSelection(selection) ? selection.getNodes()[0] ?? null : null;
736
+ const slotFrame = slotFrameAnchor !== null ? $getSlotFrame(slotFrameAnchor) : null;
737
+ const topLevelChildren = ($isElementNode(slotFrame) ? slotFrame : root).getChildren();
647
738
  for (let i = 0; i < topLevelChildren.length; i++) {
648
739
  const topLevelNode = topLevelChildren[i];
649
740
  $appendNodesToJSON(editor, selection, topLevelNode, nodes);
@@ -694,7 +785,7 @@ async function copyToClipboard(editor, event, data) {
694
785
  element.style.top = "-1000px";
695
786
  element.append(windowDocument.createTextNode("#"));
696
787
  rootElement.append(element);
697
- const range = new Range();
788
+ const range = windowDocument.createRange();
698
789
  range.setStart(element, 0);
699
790
  range.setEnd(element, 1);
700
791
  domSelection.removeAllRanges();
@@ -726,8 +817,9 @@ function $copyToClipboardEvent(editor, event, data) {
726
817
  const selection = $getSelection();
727
818
  if (!selection || selection.isCollapsed()) return false;
728
819
  if (!domSelection) return false;
729
- const anchorDOM = domSelection.anchorNode;
730
- const focusDOM = domSelection.focusNode;
820
+ const points = getDOMSelectionPoints(domSelection, editor.getRootElement());
821
+ const anchorDOM = points.anchorNode;
822
+ const focusDOM = points.focusNode;
731
823
  if (anchorDOM !== null && focusDOM !== null && !isSelectionWithinEditor(editor, anchorDOM, focusDOM)) return false;
732
824
  data = $getClipboardDataFromSelection(selection);
733
825
  }
@@ -892,11 +984,11 @@ function $exportMimeTypeFromSelection(mimeType, selection = $getSelection()) {
892
984
  * });
893
985
  * ```
894
986
  */
895
- const GetClipboardDataExtension = defineExtension({
987
+ const GetClipboardDataExtension = /* @__PURE__ */ defineExtension({
896
988
  build(editor, config, state) {
897
989
  return config.$exportMimeType;
898
990
  },
899
- config: safeCast({ $exportMimeType: DEFAULT_EXPORT_MIME_TYPE }),
991
+ config: /* @__PURE__ */ safeCast({ $exportMimeType: DEFAULT_EXPORT_MIME_TYPE }),
900
992
  mergeConfig(config, partial) {
901
993
  const merged = shallowMergeConfig(config, partial);
902
994
  if (partial.$exportMimeType) {
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@lexical+clipboard@0.45.0/node_modules/@lexical/clipboard/dist/LexicalClipboard.node.mjs
1
+ //#region ../../node_modules/.pnpm/@lexical+clipboard@0.46.0_typescript@6.0.3/node_modules/@lexical/clipboard/dist/LexicalClipboard.node.mjs
2
2
  /**
3
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
4
4
  *
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  */
9
- const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalClipboard.dev--HxGoSkO.mjs") : import("./LexicalClipboard.prod-DNJzFMcT.mjs"));
9
+ const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalClipboard.dev-CdFkLR_D.mjs") : import("./LexicalClipboard.prod-DliyLofW.mjs"));
10
10
  mod.$exportMimeTypeFromSelection;
11
11
  mod.$generateJSONFromSelectedNodes;
12
12
  mod.$generateNodesFromSerializedNodes;