@mx-space/cli 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/ROADMAP.md +10 -7
- package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-BsbWMhb3.mjs} +2265 -429
- package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-DnR_u_Ke.mjs} +47 -10
- package/dist/Lexical.prod-B7L8eVsO.mjs +6816 -0
- package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-BGSFbuTA.mjs} +131 -39
- package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-CUD_tpWb.mjs} +2 -2
- package/dist/LexicalClipboard.prod-DQXfRt3h.mjs +429 -0
- package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-B9lK_GSN.mjs} +81 -67
- package/dist/LexicalCodeCore.prod-CNWMPXhg.mjs +651 -0
- package/dist/LexicalDragon.dev-DRm2bGZ1.mjs +186 -0
- package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-d8gPruly.mjs} +3 -2
- package/dist/LexicalDragon.prod-ey3uKDJF.mjs +121 -0
- package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-CXtOJb83.mjs} +349 -35
- package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-CMsupJZs.mjs} +9 -4
- package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-BCLGhzcg.mjs} +477 -328
- package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-yVDOBd64.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-B8qauuEA.mjs} +2 -2
- package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-3rdckXIU.mjs} +323 -265
- package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-DagZUjQ_.mjs} +6 -4
- package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-B5AQaJDb.mjs} +354 -352
- package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-CspSwLNB.mjs} +69 -58
- package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-Da-ZW6H5.mjs} +210 -211
- package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-CNXmV6v8.mjs} +246 -198
- package/dist/LexicalList.prod-DgQzj4v9.mjs +944 -0
- package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-0XURdo96.mjs} +129 -37
- package/dist/LexicalMarkdown.prod-qUsIQfJx.mjs +932 -0
- package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-BqsEA7I9.mjs} +151 -122
- package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-D73RR0Ck.mjs} +8 -11
- package/dist/LexicalRichText.prod-4Atyd7OR.mjs +538 -0
- package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-DK5xfxKP.mjs} +10 -9
- package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-pyZyrANz.mjs} +4 -4
- package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-C5GrCbDC.mjs} +144 -146
- package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-DiR_4rdI.mjs} +184 -119
- package/dist/LexicalTable.prod-Cbc5EasT.mjs +2336 -0
- package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-jhPjn1vQ.mjs} +375 -35
- package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-Ck74ludK.mjs} +24 -12
- package/dist/LexicalUtils.prod-nuTBxnk_.mjs +504 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-BumPuCXw.mjs +2 -0
- package/dist/{esm-DFrz5rIo.mjs → esm-DupC6TTP.mjs} +214 -179
- package/dist/index.d.mts +46 -17
- package/dist/index.mjs +1 -1
- package/dist/{mxs-DXpzbUf4.mjs → mxs-BgAyMQdq.mjs} +8384 -6209
- package/package.json +17 -17
- package/skills/commands-ai.md +115 -0
- package/skills/overview.md +1 -0
- package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
- package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
- package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
- package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
- package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
- package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
- package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
- package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
- package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
- package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
- 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-
|
|
2
|
-
import { $ as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
//#region ../../node_modules/.pnpm/@lexical+clipboard@0.
|
|
1
|
+
import { c as configExtension, d as getPeerDependencyFromEditor, r as $getPeerDependency } from "./LexicalExtension.node-CMsupJZs.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-DnR_u_Ke.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-DagZUjQ_.mjs";
|
|
4
|
+
import { a as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-pyZyrANz.mjs";
|
|
5
|
+
import { h as objectKlassEquals } from "./LexicalUtils.node-Ck74ludK.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
|
-
|
|
24
|
-
|
|
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 (
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
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:
|
|
35
|
-
offset:
|
|
102
|
+
node: caretPosition.offsetNode,
|
|
103
|
+
offset: caretPosition.offset
|
|
36
104
|
};
|
|
37
|
-
}
|
|
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}.
|
|
361
|
-
*
|
|
362
|
-
*
|
|
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 {
|
|
449
|
+
* import {RichTextExtension} from '@lexical/rich-text';
|
|
376
450
|
*
|
|
377
451
|
* defineExtension({
|
|
378
452
|
* name: 'app',
|
|
379
453
|
* dependencies: [
|
|
380
|
-
*
|
|
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
|
|
487
|
-
|
|
488
|
-
|
|
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,
|
|
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
|
|
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 =
|
|
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
|
|
730
|
-
const
|
|
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.
|
|
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
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalClipboard.dev-BGSFbuTA.mjs") : import("./LexicalClipboard.prod-DQXfRt3h.mjs"));
|
|
10
10
|
mod.$exportMimeTypeFromSelection;
|
|
11
11
|
mod.$generateJSONFromSelectedNodes;
|
|
12
12
|
mod.$generateNodesFromSerializedNodes;
|