@mx-space/cli 0.7.8 → 0.8.0

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 (55) hide show
  1. package/dist/{Lexical.dev-rcxzwpir.mjs → Lexical.dev-By5dOKBN.mjs} +1486 -356
  2. package/dist/{Lexical.node-BUsI9gWr.mjs → Lexical.node-fXM8Jp7p.mjs} +39 -17
  3. package/dist/{Lexical.prod-C8HtkSD6.mjs → Lexical.prod-BlCvXPGa.mjs} +2279 -1768
  4. package/dist/LexicalClipboard.dev--HxGoSkO.mjs +915 -0
  5. package/dist/{LexicalClipboard.node-CO-MCKx5.mjs → LexicalClipboard.node-C3mRbrmW.mjs} +10 -3
  6. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +371 -0
  7. package/dist/LexicalCodeCore.dev-DjSrd4A4.mjs +1109 -0
  8. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +642 -0
  9. package/dist/{LexicalDragon.dev-gBP8WSRS.mjs → LexicalDragon.dev-DwprRH0z.mjs} +3 -3
  10. package/dist/{LexicalDragon.node-OG6G55nl.mjs → LexicalDragon.node-BVhw4C7s.mjs} +2 -2
  11. package/dist/{LexicalDragon.prod-DP-_Q8cv.mjs → LexicalDragon.prod-nh4J-8vn.mjs} +3 -3
  12. package/dist/{LexicalExtension.dev-DVbjljrm.mjs → LexicalExtension.dev-BPNyvGqe.mjs} +335 -6
  13. package/dist/{LexicalExtension.node-CF3EAPN7.mjs → LexicalExtension.node-BVlcrgOx.mjs} +15 -8
  14. package/dist/{LexicalExtension.prod-DklHHErZ.mjs → LexicalExtension.prod-DFKbiNt-.mjs} +375 -265
  15. package/dist/{LexicalHeadless.dev-DdWLM7Nl.mjs → LexicalHeadless.dev-B-cj7Pr5.mjs} +2 -2
  16. package/dist/{LexicalHeadless.prod-CoiiTDzR.mjs → LexicalHeadless.prod-Byp1vNzT.mjs} +2 -2
  17. package/dist/LexicalHtml.dev-prBAwszN.mjs +2424 -0
  18. package/dist/LexicalHtml.node-BvNF96jZ.mjs +56 -0
  19. package/dist/LexicalHtml.prod-Sz3CW1ht.mjs +1207 -0
  20. package/dist/{LexicalLink.dev-BS1Bf-yD.mjs → LexicalLink.dev-NySTYhVR.mjs} +42 -8
  21. package/dist/{LexicalLink.prod-B_crkoHP.mjs → LexicalLink.prod-BuCM8gts.mjs} +209 -191
  22. package/dist/{LexicalList.dev-OMqmcnQ-.mjs → LexicalList.dev-DIMOvSFD.mjs} +252 -80
  23. package/dist/{LexicalList.prod-CpL1s8vS.mjs → LexicalList.prod-MVqfA6Vo.mjs} +364 -278
  24. package/dist/{LexicalMarkdown.dev-BHSdx_Gr.mjs → LexicalMarkdown.dev-C7aylvCG.mjs} +729 -552
  25. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +868 -0
  26. package/dist/{LexicalRichText.dev-Bz9A_WbM.mjs → LexicalRichText.dev-DfICq6lU.mjs} +272 -77
  27. package/dist/{LexicalRichText.node-DDpwfE-P.mjs → LexicalRichText.node-Bg9jND3Q.mjs} +21 -8
  28. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +550 -0
  29. package/dist/{LexicalSelection.dev-CQ380fnD.mjs → LexicalSelection.dev-DGjj12wW.mjs} +50 -38
  30. package/dist/{LexicalSelection.node-DesBMjIE.mjs → LexicalSelection.node-BU5L4193.mjs} +4 -4
  31. package/dist/{LexicalSelection.prod-D2jivCDB.mjs → LexicalSelection.prod-D-PwRbyK.mjs} +158 -140
  32. package/dist/{LexicalTable.dev-Ca7mQ7Jk.mjs → LexicalTable.dev-ChP7cugd.mjs} +215 -53
  33. package/dist/{LexicalTable.prod-DyPAcC7y.mjs → LexicalTable.prod-Bpr9YRXp.mjs} +668 -573
  34. package/dist/{LexicalUtils.dev-HxM8F0g6.mjs → LexicalUtils.dev-BiFU3789.mjs} +10 -47
  35. package/dist/{LexicalUtils.node-lCWjRjoG.mjs → LexicalUtils.node-j3Llm7Y3.mjs} +2 -2
  36. package/dist/{LexicalUtils.prod-Bti5w4ki.mjs → LexicalUtils.prod-DCvrA78p.mjs} +103 -105
  37. package/dist/bin/mxs.d.mts +1 -1
  38. package/dist/bin/mxs.mjs +1 -1
  39. package/dist/esm-By7trG9K.mjs +2 -0
  40. package/dist/{esm-CK9m5JKX.mjs → esm-Dg-WhPCe.mjs} +989 -989
  41. package/dist/index.d.mts +1 -1
  42. package/dist/index.mjs +1 -1
  43. package/dist/{mxs-BZt1cLW9.mjs → mxs-DT0oYk6U.mjs} +11935 -11866
  44. package/package.json +15 -14
  45. package/dist/LexicalClipboard.dev-BpqRwTLP.mjs +0 -494
  46. package/dist/LexicalClipboard.prod-B_xdeiAC.mjs +0 -291
  47. package/dist/LexicalCodeCore.dev-7_cexm39.mjs +0 -537
  48. package/dist/LexicalCodeCore.prod-Bd6WFHcO.mjs +0 -381
  49. package/dist/LexicalHtml.dev-C3ZSWBFZ.mjs +0 -684
  50. package/dist/LexicalHtml.node-D0TD152E.mjs +0 -24
  51. package/dist/LexicalHtml.prod-CX47X0zl.mjs +0 -430
  52. package/dist/LexicalMarkdown.prod-C-S7Ii6-.mjs +0 -754
  53. package/dist/LexicalRichText.prod-C8qXACDL.mjs +0 -427
  54. package/dist/esm-DRbkkY3r.mjs +0 -2
  55. /package/dist/{mxs-CM8-6uAr.d.mts → mxs-iqJBopvE.d.mts} +0 -0
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@lexical+clipboard@0.44.0/node_modules/@lexical/clipboard/LexicalClipboard.node.mjs
1
+ //#region ../../node_modules/.pnpm/@lexical+clipboard@0.45.0/node_modules/@lexical/clipboard/dist/LexicalClipboard.node.mjs
2
2
  /**
3
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
4
4
  *
@@ -6,7 +6,8 @@
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-BpqRwTLP.mjs") : import("./LexicalClipboard.prod-B_xdeiAC.mjs"));
9
+ const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalClipboard.dev--HxGoSkO.mjs") : import("./LexicalClipboard.prod-DNJzFMcT.mjs"));
10
+ mod.$exportMimeTypeFromSelection;
10
11
  mod.$generateJSONFromSelectedNodes;
11
12
  mod.$generateNodesFromSerializedNodes;
12
13
  const $getClipboardDataFromSelection = mod.$getClipboardDataFromSelection;
@@ -18,7 +19,13 @@ mod.$insertDataTransferForPlainText;
18
19
  const $insertDataTransferForRichText = mod.$insertDataTransferForRichText;
19
20
  mod.$insertGeneratedNodes;
20
21
  const $writeDragSourceToDataTransfer = mod.$writeDragSourceToDataTransfer;
22
+ mod.ClipboardDOMImportExtension;
23
+ mod.ClipboardImportExtension;
24
+ mod.DEFAULT_IMPORT_MIME_TYPE;
25
+ mod.DEFAULT_IMPORT_MIME_TYPE_PRIORITY;
26
+ mod.GetClipboardDataExtension;
27
+ const caretFromPoint = mod.caretFromPoint;
21
28
  const copyToClipboard = mod.copyToClipboard;
22
29
  const setLexicalClipboardDataTransfer = mod.setLexicalClipboardDataTransfer;
23
30
  //#endregion
24
- export { copyToClipboard as a, $writeDragSourceToDataTransfer as i, $handleRichTextDrop as n, setLexicalClipboardDataTransfer as o, $insertDataTransferForRichText as r, $getClipboardDataFromSelection as t };
31
+ export { caretFromPoint as a, $writeDragSourceToDataTransfer as i, $handleRichTextDrop as n, copyToClipboard as o, $insertDataTransferForRichText as r, setLexicalClipboardDataTransfer as s, $getClipboardDataFromSelection as t };
@@ -0,0 +1,371 @@
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.prod.mjs
7
+ /**
8
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ *
13
+ */
14
+ function k(t, e) {
15
+ if (void 0 !== document.caretRangeFromPoint) {
16
+ const n = document.caretRangeFromPoint(t, e);
17
+ return null === n ? null : {
18
+ node: n.startContainer,
19
+ offset: n.startOffset
20
+ };
21
+ }
22
+ if ("undefined" !== document.caretPositionFromPoint) {
23
+ const n = document.caretPositionFromPoint(t, e);
24
+ return null === n ? null : {
25
+ node: n.offsetNode,
26
+ offset: n.offset
27
+ };
28
+ }
29
+ return null;
30
+ }
31
+ function H(t, ...e) {
32
+ const n = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
33
+ r.append("code", t);
34
+ for (const t of e) r.append("v", t);
35
+ throw n.search = r.toString(), Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
36
+ }
37
+ const U = {
38
+ "application/x-lexical-editor": 0,
39
+ "text/html": 10,
40
+ "text/plain": 20,
41
+ "text/uri-list": 30
42
+ };
43
+ function W(t) {
44
+ if (window.trustedTypes && window.trustedTypes.createPolicy) return window.trustedTypes.createPolicy("lexical", { createHTML: (t) => t }).createHTML(t);
45
+ return t;
46
+ }
47
+ const q = (t, e) => {
48
+ if (!$isRangeSelection(e)) return e.insertRawText(t), !0;
49
+ const n = (t) => {
50
+ const e = $getSelection();
51
+ $isRangeSelection(e) && t(e);
52
+ };
53
+ return tokenizeRawText(t, {
54
+ linebreak: () => n((t) => t.insertParagraph()),
55
+ tab: () => n((t) => t.insertNodes([$createTabNode()])),
56
+ text: (t) => n((e) => e.insertText(t))
57
+ }), !0;
58
+ }, z = {
59
+ "application/x-lexical-editor": [(t, e, n) => {
60
+ try {
61
+ const n = $getEditor(), r = JSON.parse(t);
62
+ if (r && r.namespace === n._config.namespace && Array.isArray(r.nodes)) return ct(n, at(r.nodes), e), !0;
63
+ } catch (t) {
64
+ console.error(t);
65
+ }
66
+ return n();
67
+ }],
68
+ "text/html": [(t, e, n) => {
69
+ try {
70
+ const n = $getEditor();
71
+ return ct(n, $generateNodesFromDOM(n, new DOMParser().parseFromString(W(t), "text/html")), e), !0;
72
+ } catch (t) {
73
+ return console.error(t), n();
74
+ }
75
+ }],
76
+ "text/plain": [q],
77
+ "text/uri-list": [q]
78
+ };
79
+ function B(t, e, n, r) {
80
+ if (!t) return !1;
81
+ const o = (i) => !!t[i] && t[i](e, n, o.bind(null, i - 1), r);
82
+ return o(t.length - 1);
83
+ }
84
+ function G(t, e, n) {
85
+ const r = e.getData("text/plain");
86
+ for (const o of function(t) {
87
+ return Object.keys(t.$importMimeType).filter((e) => void 0 !== t.$importMimeType[e]).sort((e, n) => {
88
+ const r = t.priority[e], o = t.priority[n];
89
+ return void 0 === r && void 0 === o ? e < n ? -1 : e > n ? 1 : 0 : void 0 === r ? 1 : void 0 === o ? -1 : r - o;
90
+ });
91
+ }(t)) {
92
+ const i = e.getData(o);
93
+ if (i && ("text/html" !== o || i !== r) && B(t.$importMimeType[o], i, n, e)) return !0;
94
+ }
95
+ return !1;
96
+ }
97
+ const X = {
98
+ $importMimeType: z,
99
+ $insertDataTransfer: (t, e) => G({
100
+ $importMimeType: z,
101
+ priority: U
102
+ }, t, e),
103
+ priority: U
104
+ };
105
+ const Y = defineExtension({
106
+ build: (t, e) => ({
107
+ $importMimeType: e.$importMimeType,
108
+ $insertDataTransfer: (t, n) => G(e, t, n),
109
+ priority: e.priority
110
+ }),
111
+ config: safeCast({
112
+ $importMimeType: z,
113
+ priority: U
114
+ }),
115
+ mergeConfig(t, e) {
116
+ const n = shallowMergeConfig(t, e);
117
+ if (e.$importMimeType) {
118
+ const r = { ...t.$importMimeType };
119
+ for (const [t, n] of Object.entries(e.$importMimeType)) if (n) {
120
+ const e = r[t];
121
+ r[t] = e ? [...e, ...n] : n;
122
+ }
123
+ n.$importMimeType = r;
124
+ }
125
+ return e.priority && (n.priority = {
126
+ ...t.priority,
127
+ ...e.priority
128
+ }), n;
129
+ },
130
+ name: "@lexical/clipboard/Import"
131
+ }), Q = defineExtension({
132
+ dependencies: [configExtension(Y, { $importMimeType: { "text/html": [(t, e, n, c) => {
133
+ const u = $generateNodesFromDOMViaExtension(new DOMParser().parseFromString(W(t), "text/html"), { context: [contextValue(ImportSource, "paste"), contextValue(ImportSourceDataTransfer, c)] });
134
+ return ct($getEditor(), u, e), !0;
135
+ }] } })],
136
+ name: "@lexical/clipboard/DOMImport"
137
+ });
138
+ function V(t, e = $getSelection()) {
139
+ return e ?? H(166), $isRangeSelection(e) && e.isCollapsed() || 0 === e.getNodes().length ? "" : $generateHtmlFromNodes(t, e);
140
+ }
141
+ function Z(t, e = $getSelection()) {
142
+ return e ?? H(166), $isRangeSelection(e) && e.isCollapsed() || 0 === e.getNodes().length ? null : JSON.stringify(ut(t, e));
143
+ }
144
+ function tt(t, e) {
145
+ const n = t.getData("text/plain") || t.getData("text/uri-list");
146
+ null != n && e.insertRawText(n);
147
+ }
148
+ function et(t, n, r) {
149
+ (function() {
150
+ const t = $getPeerDependency(Y.name);
151
+ return t ? t.output : X;
152
+ })().$insertDataTransfer(t, n);
153
+ }
154
+ const nt = "application/x-lexical-drag";
155
+ function rt(t, e) {
156
+ const n = { editorKey: e.getKey() };
157
+ t.setData(nt, JSON.stringify(n));
158
+ }
159
+ function ot(t, e, n) {
160
+ const r = t.dataTransfer;
161
+ if (null === r) return !1;
162
+ const o = function(t) {
163
+ const e = t.getData(nt);
164
+ if (!e) return null;
165
+ let n;
166
+ try {
167
+ n = JSON.parse(e);
168
+ } catch (t) {
169
+ return null;
170
+ }
171
+ return null !== (r = n) && "object" == typeof r && "editorKey" in r && "string" == typeof r.editorKey ? n : null;
172
+ var r;
173
+ }(r);
174
+ if (null === o) return !1;
175
+ const i = function(t) {
176
+ const e = k(t.clientX, t.clientY);
177
+ if (null === e) return null;
178
+ const n = $getNearestNodeFromDOMNode(e.node);
179
+ if (null === n) return null;
180
+ if ($isTextNode(n)) return $getTextPointCaret(n, "next", e.offset);
181
+ if ($isElementNode(n)) return $getChildCaretAtIndex(n, e.offset, "next");
182
+ const r = n.getParent();
183
+ return null === r ? null : $getChildCaretAtIndex(r, n.getIndexWithinParent() + 1, "next");
184
+ }(t);
185
+ if (null === i) return !1;
186
+ const l = $splitAtPointCaretNext(i);
187
+ if (null === l) return !1;
188
+ const c = o.editorKey === e.getKey(), s = $getSelection();
189
+ if (c) {
190
+ if (!$isRangeSelection(s) || s.isCollapsed()) return !1;
191
+ if (function(t, e) {
192
+ const { anchor: n, focus: r } = $getCaretRangeInDirection($caretRangeFromSelection(e), "next");
193
+ return $comparePointCaretNext(n, t) < 0 && $comparePointCaretNext(t, r) < 0;
194
+ }(i, s)) return t.preventDefault(), !0;
195
+ s.removeText();
196
+ }
197
+ if (!l.origin.isAttached()) return t.preventDefault(), !0;
198
+ if (n(r, $setSelectionFromCaretRange($getCollapsedCaretRange(l)), e), !c) {
199
+ const t = e.getRootElement(), n = t ? t.ownerDocument : null, r = n ? function(t, e) {
200
+ const n = e.querySelectorAll("[data-lexical-editor=\"true\"]");
201
+ for (const e of Array.from(n)) {
202
+ const n = e.__lexicalEditor;
203
+ if (n && n.getKey() === t) return e;
204
+ }
205
+ return null;
206
+ }(o.editorKey, n) : null;
207
+ null !== r && r.dispatchEvent(new InputEvent("beforeinput", {
208
+ bubbles: !0,
209
+ cancelable: !0,
210
+ inputType: "deleteByDrag"
211
+ }));
212
+ }
213
+ return t.preventDefault(), !0;
214
+ }
215
+ function it(t, e) {
216
+ return ot(t, e, et);
217
+ }
218
+ function lt(t, e) {
219
+ return ot(t, e, (t, e) => tt(t, e));
220
+ }
221
+ function ct(t, e, n) {
222
+ t.dispatchCommand(SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, {
223
+ nodes: e,
224
+ selection: n
225
+ }) || (n.insertNodes(e), function(t) {
226
+ if ($isRangeSelection(t) && t.isCollapsed()) {
227
+ const e = t.anchor;
228
+ let n = null;
229
+ const r = $caretFromPoint(e, "previous");
230
+ if (r) if ($isTextPointCaret(r)) n = r.origin;
231
+ else {
232
+ const t = $getCaretRange(r, $getChildCaret($getRoot(), "next").getFlipped());
233
+ for (const e of t) {
234
+ if ($isTextNode(e.origin)) {
235
+ n = e.origin;
236
+ break;
237
+ }
238
+ if ($isElementNode(e.origin) && !e.origin.isInline()) break;
239
+ }
240
+ }
241
+ if (n && $isTextNode(n)) {
242
+ const e = n.getFormat(), r = n.getStyle();
243
+ t.format === e && t.style === r || (t.format = e, t.style = r, t.dirty = !0);
244
+ }
245
+ }
246
+ }(n));
247
+ }
248
+ function st(t, e, n, r = []) {
249
+ let o = null === e || n.isSelected(e);
250
+ const i = $isElementNode(n) && n.excludeFromCopy("html");
251
+ let l = n;
252
+ null !== e && $isTextNode(l) && (l = $sliceSelectedTextNodeContent(e, l, "clone"));
253
+ const c = $isElementNode(l) ? l.getChildren() : [], s = function(t) {
254
+ const e = t.exportJSON(), n = t.constructor;
255
+ if (e.type !== n.getType() && H(58, n.name), $isElementNode(t)) {
256
+ const t = e.children;
257
+ Array.isArray(t) || H(59, n.name);
258
+ }
259
+ return e;
260
+ }(l);
261
+ $isTextNode(l) && 0 === l.getTextContentSize() && (o = !1);
262
+ for (let r = 0; r < c.length; r++) {
263
+ const i = c[r], l = st(t, e, i, s.children);
264
+ !o && $isElementNode(n) && l && n.extractWithChild(i, e, "clone") && (o = !0);
265
+ }
266
+ if (o && !i) r.push(s);
267
+ else if (Array.isArray(s.children)) for (let t = 0; t < s.children.length; t++) {
268
+ const e = s.children[t];
269
+ r.push(e);
270
+ }
271
+ return o;
272
+ }
273
+ function ut(t, e) {
274
+ const n = [], r = $getRoot().getChildren();
275
+ for (let o = 0; o < r.length; o++) st(t, e, r[o], n);
276
+ return {
277
+ namespace: t._config.namespace,
278
+ nodes: n
279
+ };
280
+ }
281
+ function at(t) {
282
+ const e = [];
283
+ for (const n of t) e.push($parseSerializedNode(n));
284
+ return e;
285
+ }
286
+ let ft = null;
287
+ async function pt(t, e, n) {
288
+ if (null !== ft) return !1;
289
+ if (null !== e) return new Promise((r, o) => {
290
+ t.update(() => {
291
+ r(dt(t, e, n));
292
+ });
293
+ });
294
+ const r = t.getRootElement(), o = t._window || window, i = o.document, l = getDOMSelection(o);
295
+ if (null === r || null === l) return !1;
296
+ const c = i.createElement("span");
297
+ c.style.position = "fixed", c.style.top = "-1000px", c.append(i.createTextNode("#")), r.append(c);
298
+ const s = new Range();
299
+ return s.setStart(c, 0), s.setEnd(c, 1), l.removeAllRanges(), l.addRange(s), new Promise((e, r) => {
300
+ const l = t.registerCommand(COPY_COMMAND, (r) => (objectKlassEquals(r, ClipboardEvent) && (l(), null !== ft && (o.clearTimeout(ft), ft = null), e(dt(t, r, n))), !0), COMMAND_PRIORITY_CRITICAL);
301
+ ft = o.setTimeout(() => {
302
+ l(), ft = null, e(!1);
303
+ }, 50), i.execCommand("copy"), c.remove();
304
+ });
305
+ }
306
+ function dt(t, e, n) {
307
+ if (void 0 === n) {
308
+ const e = getDOMSelection(t._window), r = $getSelection();
309
+ if (!r || r.isCollapsed()) return !1;
310
+ if (!e) return !1;
311
+ const o = e.anchorNode, i = e.focusNode;
312
+ if (null !== o && null !== i && !isSelectionWithinEditor(t, o, i)) return !1;
313
+ n = yt(r);
314
+ }
315
+ e.preventDefault();
316
+ const r = e.clipboardData;
317
+ return null !== r && (xt(r, n), !0);
318
+ }
319
+ const mt = [["text/html", V], ["application/x-lexical-editor", Z]];
320
+ function yt(t = $getSelection()) {
321
+ return function(t, e) {
322
+ const n = { "text/plain": "" };
323
+ for (const [r, o] of Object.entries(t)) if (o) {
324
+ const t = Tt(o, e);
325
+ null !== t && (n[r] = t);
326
+ }
327
+ return n;
328
+ }(gt(), t);
329
+ }
330
+ function xt(t, e) {
331
+ for (const [n] of mt) void 0 === e[n] && t.setData(n, "");
332
+ for (const n in e) {
333
+ const r = e[n];
334
+ void 0 !== r && t.setData(n, r);
335
+ }
336
+ }
337
+ function gt(t = $getEditor()) {
338
+ const e = getPeerDependencyFromEditor(t, wt.name);
339
+ return e ? e.output : ht;
340
+ }
341
+ const ht = {
342
+ "application/x-lexical-editor": [(t, e) => t ? Z($getEditor(), t) : e()],
343
+ "text/html": [(t, e) => t ? V($getEditor(), t) : e()],
344
+ "text/plain": [(t, e) => t ? t.getTextContent() : e()]
345
+ };
346
+ function Tt(t, e) {
347
+ const n = (r) => t[r] ? t[r](e, n.bind(null, r - 1)) : null;
348
+ return n(t.length - 1);
349
+ }
350
+ function vt(t, e = $getSelection()) {
351
+ return Tt(gt()[t] || [], e);
352
+ }
353
+ const wt = defineExtension({
354
+ build: (t, e, n) => e.$exportMimeType,
355
+ config: safeCast({ $exportMimeType: ht }),
356
+ mergeConfig(t, e) {
357
+ const n = shallowMergeConfig(t, e);
358
+ if (e.$exportMimeType) {
359
+ const r = { ...t.$exportMimeType };
360
+ for (const [t, n] of Object.entries(e.$exportMimeType)) if (n) {
361
+ const e = r[t];
362
+ r[t] = e ? [...e, ...n] : n;
363
+ }
364
+ n.$exportMimeType = r;
365
+ }
366
+ return n;
367
+ },
368
+ name: "@lexical/clipboard/GetClipboardData"
369
+ });
370
+ //#endregion
371
+ export { vt as $exportMimeTypeFromSelection, ut as $generateJSONFromSelectedNodes, at as $generateNodesFromSerializedNodes, yt as $getClipboardDataFromSelection, V as $getHtmlContent, Z as $getLexicalContent, lt as $handlePlainTextDrop, it as $handleRichTextDrop, tt as $insertDataTransferForPlainText, et as $insertDataTransferForRichText, ct as $insertGeneratedNodes, rt as $writeDragSourceToDataTransfer, Q as ClipboardDOMImportExtension, Y as ClipboardImportExtension, z as DEFAULT_IMPORT_MIME_TYPE, U as DEFAULT_IMPORT_MIME_TYPE_PRIORITY, wt as GetClipboardDataExtension, k as caretFromPoint, pt as copyToClipboard, xt as setLexicalClipboardDataTransfer };