@mx-space/cli 0.13.0 → 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.
Files changed (55) hide show
  1. package/README.md +23 -1
  2. package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-BsbWMhb3.mjs} +2265 -429
  3. package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-DnR_u_Ke.mjs} +47 -10
  4. package/dist/Lexical.prod-B7L8eVsO.mjs +6816 -0
  5. package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-BGSFbuTA.mjs} +131 -39
  6. package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-CUD_tpWb.mjs} +2 -2
  7. package/dist/LexicalClipboard.prod-DQXfRt3h.mjs +429 -0
  8. package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-B9lK_GSN.mjs} +81 -67
  9. package/dist/LexicalCodeCore.prod-CNWMPXhg.mjs +651 -0
  10. package/dist/LexicalDragon.dev-DRm2bGZ1.mjs +186 -0
  11. package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-d8gPruly.mjs} +3 -2
  12. package/dist/LexicalDragon.prod-ey3uKDJF.mjs +121 -0
  13. package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-CXtOJb83.mjs} +349 -35
  14. package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-CMsupJZs.mjs} +9 -4
  15. package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-BCLGhzcg.mjs} +477 -328
  16. package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-yVDOBd64.mjs} +2 -2
  17. package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-B8qauuEA.mjs} +2 -2
  18. package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-3rdckXIU.mjs} +323 -265
  19. package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-DagZUjQ_.mjs} +6 -4
  20. package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-B5AQaJDb.mjs} +354 -352
  21. package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-CspSwLNB.mjs} +69 -58
  22. package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-Da-ZW6H5.mjs} +210 -211
  23. package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-CNXmV6v8.mjs} +246 -198
  24. package/dist/LexicalList.prod-DgQzj4v9.mjs +944 -0
  25. package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-0XURdo96.mjs} +129 -37
  26. package/dist/LexicalMarkdown.prod-qUsIQfJx.mjs +932 -0
  27. package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-BqsEA7I9.mjs} +151 -122
  28. package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-D73RR0Ck.mjs} +8 -11
  29. package/dist/LexicalRichText.prod-4Atyd7OR.mjs +538 -0
  30. package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-DK5xfxKP.mjs} +10 -9
  31. package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-pyZyrANz.mjs} +4 -4
  32. package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-C5GrCbDC.mjs} +144 -146
  33. package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-DiR_4rdI.mjs} +184 -119
  34. package/dist/LexicalTable.prod-Cbc5EasT.mjs +2336 -0
  35. package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-jhPjn1vQ.mjs} +375 -35
  36. package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-Ck74ludK.mjs} +24 -12
  37. package/dist/LexicalUtils.prod-nuTBxnk_.mjs +504 -0
  38. package/dist/bin/mxs.mjs +1 -1
  39. package/dist/esm-BumPuCXw.mjs +2 -0
  40. package/dist/{esm-lpolVSUJ.mjs → esm-DupC6TTP.mjs} +172 -172
  41. package/dist/index.d.mts +16 -16
  42. package/dist/index.mjs +1 -1
  43. package/dist/{mxs-PFV8OJ-M.mjs → mxs-BgAyMQdq.mjs} +1595 -314
  44. package/package.json +17 -17
  45. package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
  46. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
  47. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
  48. package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
  49. package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
  50. package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
  51. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
  52. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
  53. package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
  54. package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
  55. package/dist/esm-DGvoYR6n.mjs +0 -2
@@ -0,0 +1,429 @@
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.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 et(r, i, l = null) {
15
+ const c = getRootOwnerDocument(l), s = l ? getDOMShadowRoots(l) : [], u = null !== l && s.length > 0;
16
+ if (u && "function" == typeof c.caretPositionFromPoint) {
17
+ const t = c.caretPositionFromPoint(r, i, { shadowRoots: s });
18
+ if (null !== t && function(t, e) {
19
+ for (let n = t; null !== n;) {
20
+ if (n === e) return !0;
21
+ n = getParentElement(n);
22
+ }
23
+ return !1;
24
+ }(t.offsetNode, l)) return {
25
+ node: t.offsetNode,
26
+ offset: t.offset
27
+ };
28
+ }
29
+ if (u) {
30
+ const t = l.getRootNode();
31
+ if (isDOMShadowRoot(t)) {
32
+ const e = t.elementFromPoint(r, i);
33
+ if (null !== e && l.contains(e)) {
34
+ const t = function(t, e, n, o) {
35
+ const r = o.createRange(), i = (t) => e < t.top ? t.top - e : e > t.bottom ? e - t.bottom : 0, l = (e) => t < e.left ? e.left - t : t > e.right ? t - e.right : 0, c = o.createTreeWalker(n, NodeFilter.SHOW_TEXT);
36
+ let s = null, u = Infinity, a = Infinity;
37
+ for (let t = c.nextNode(); t; t = c.nextNode()) {
38
+ r.selectNodeContents(t);
39
+ for (const e of r.getClientRects()) {
40
+ const n = i(e), o = l(e);
41
+ (n < u || n === u && o < a) && (u = n, a = o, s = t);
42
+ }
43
+ }
44
+ if (null === s) return null;
45
+ let f = 0, p = Infinity, d = Infinity;
46
+ for (let e = 0; e <= s.length; e++) {
47
+ r.setStart(s, e), r.collapse(!0);
48
+ const n = r.getBoundingClientRect(), o = i(n), l = Math.abs(t - n.left);
49
+ (o < p || o === p && l < d) && (p = o, d = l, f = e);
50
+ }
51
+ return {
52
+ node: s,
53
+ offset: f
54
+ };
55
+ }(r, i, e, c);
56
+ if (null !== t) return t;
57
+ }
58
+ }
59
+ }
60
+ if ("function" == typeof c.caretRangeFromPoint) {
61
+ const t = c.caretRangeFromPoint(r, i);
62
+ return null === t ? null : {
63
+ node: t.startContainer,
64
+ offset: t.startOffset
65
+ };
66
+ }
67
+ if ("function" == typeof c.caretPositionFromPoint) {
68
+ const t = c.caretPositionFromPoint(r, i);
69
+ return null === t ? null : {
70
+ node: t.offsetNode,
71
+ offset: t.offset
72
+ };
73
+ }
74
+ return null;
75
+ }
76
+ function nt(t, ...e) {
77
+ const n = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
78
+ o.append("code", t);
79
+ for (const t of e) o.append("v", t);
80
+ throw n.search = o.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.`);
81
+ }
82
+ const ot = {
83
+ "application/x-lexical-editor": 0,
84
+ "text/html": 10,
85
+ "text/plain": 20,
86
+ "text/uri-list": 30
87
+ };
88
+ function rt(t) {
89
+ if (window.trustedTypes && window.trustedTypes.createPolicy) return window.trustedTypes.createPolicy("lexical", { createHTML: (t) => t }).createHTML(t);
90
+ return t;
91
+ }
92
+ const it = (t, e) => {
93
+ if (!$isRangeSelection(e)) return e.insertRawText(t), !0;
94
+ const n = (t) => {
95
+ const e = $getSelection();
96
+ $isRangeSelection(e) && t(e);
97
+ };
98
+ return tokenizeRawText(t, {
99
+ linebreak: () => n((t) => t.insertParagraph()),
100
+ tab: () => n((t) => t.insertNodes([$createTabNode()])),
101
+ text: (t) => n((e) => e.insertText(t))
102
+ }), !0;
103
+ }, lt = {
104
+ "application/x-lexical-editor": [(t, e, n) => {
105
+ try {
106
+ const n = $getEditor(), o = JSON.parse(t);
107
+ if (o && o.namespace === n._config.namespace && Array.isArray(o.nodes)) return Mt(n, $t(o.nodes), e), !0;
108
+ } catch (t) {
109
+ console.error(t);
110
+ }
111
+ return n();
112
+ }],
113
+ "text/html": [(t, e, n) => {
114
+ try {
115
+ const n = $getEditor();
116
+ return Mt(n, $generateNodesFromDOM(n, new DOMParser().parseFromString(rt(t), "text/html")), e), !0;
117
+ } catch (t) {
118
+ return console.error(t), n();
119
+ }
120
+ }],
121
+ "text/plain": [it],
122
+ "text/uri-list": [it]
123
+ };
124
+ function ct(t, e, n, o) {
125
+ if (!t) return !1;
126
+ const r = (i) => !!t[i] && t[i](e, n, r.bind(null, i - 1), o);
127
+ return r(t.length - 1);
128
+ }
129
+ function st(t, e, n) {
130
+ const o = e.getData("text/plain");
131
+ for (const r of function(t) {
132
+ return Object.keys(t.$importMimeType).filter((e) => void 0 !== t.$importMimeType[e]).sort((e, n) => {
133
+ const o = t.priority[e], r = t.priority[n];
134
+ return void 0 === o && void 0 === r ? e < n ? -1 : e > n ? 1 : 0 : void 0 === o ? 1 : void 0 === r ? -1 : o - r;
135
+ });
136
+ }(t)) {
137
+ const i = e.getData(r);
138
+ if (i && ("text/html" !== r || i !== o) && ct(t.$importMimeType[r], i, n, e)) return !0;
139
+ }
140
+ return !1;
141
+ }
142
+ const ut = {
143
+ $importMimeType: lt,
144
+ $insertDataTransfer: (t, e) => st({
145
+ $importMimeType: lt,
146
+ priority: ot
147
+ }, t, e),
148
+ priority: ot
149
+ };
150
+ const at = /* @__PURE__ */ defineExtension({
151
+ build: (t, e) => ({
152
+ $importMimeType: e.$importMimeType,
153
+ $insertDataTransfer: (t, n) => st(e, t, n),
154
+ priority: e.priority
155
+ }),
156
+ config: /* @__PURE__ */ safeCast({
157
+ $importMimeType: lt,
158
+ priority: ot
159
+ }),
160
+ mergeConfig(t, e) {
161
+ const n = shallowMergeConfig(t, e);
162
+ if (e.$importMimeType) {
163
+ const o = { ...t.$importMimeType };
164
+ for (const [t, n] of Object.entries(e.$importMimeType)) if (n) {
165
+ const e = o[t];
166
+ o[t] = e ? [...e, ...n] : n;
167
+ }
168
+ n.$importMimeType = o;
169
+ }
170
+ return e.priority && (n.priority = {
171
+ ...t.priority,
172
+ ...e.priority
173
+ }), n;
174
+ },
175
+ name: "@lexical/clipboard/Import"
176
+ }), ft = /* @__PURE__ */ defineExtension({
177
+ dependencies: [CoreImportExtension, /* @__PURE__ */ configExtension(at, { $importMimeType: { "text/html": [(t, e, n, o) => {
178
+ const l = $generateNodesFromDOMViaExtension(new DOMParser().parseFromString(rt(t), "text/html"), { context: [contextValue(ImportSource, "paste"), contextValue(ImportSourceDataTransfer, o)] });
179
+ return Mt($getEditor(), l, e), !0;
180
+ }] } })],
181
+ name: "@lexical/clipboard/DOMImport"
182
+ });
183
+ function pt(t, e = $getSelection()) {
184
+ return e ?? nt(166), $isRangeSelection(e) && e.isCollapsed() || 0 === e.getNodes().length ? "" : $generateHtmlFromNodes(t, e);
185
+ }
186
+ function dt(t, e = $getSelection()) {
187
+ return e ?? nt(166), $isRangeSelection(e) && e.isCollapsed() || 0 === e.getNodes().length ? null : JSON.stringify(wt(t, e));
188
+ }
189
+ function mt(t, e) {
190
+ const n = t.getData("text/plain") || t.getData("text/uri-list");
191
+ null != n && e.insertRawText(n);
192
+ }
193
+ function gt(t, e, n) {
194
+ (function() {
195
+ const t = $getPeerDependency(at.name);
196
+ return t ? t.output : ut;
197
+ })().$insertDataTransfer(t, e);
198
+ }
199
+ const yt = "application/x-lexical-drag";
200
+ function xt(t, e) {
201
+ const n = { editorKey: e.getKey() };
202
+ t.setData(yt, JSON.stringify(n));
203
+ }
204
+ function ht(t, e, n) {
205
+ const o = t.dataTransfer;
206
+ if (null === o) return !1;
207
+ const r = function(t) {
208
+ const e = t.getData(yt);
209
+ if (!e) return null;
210
+ let n;
211
+ try {
212
+ n = JSON.parse(e);
213
+ } catch (t) {
214
+ return null;
215
+ }
216
+ return null !== (o = n) && "object" == typeof o && "editorKey" in o && "string" == typeof o.editorKey ? n : null;
217
+ var o;
218
+ }(o);
219
+ if (null === r) return !1;
220
+ const i = function(t, e) {
221
+ const n = et(t.clientX, t.clientY, e.getRootElement());
222
+ if (null === n) return null;
223
+ const o = $getNearestNodeFromDOMNode(n.node);
224
+ if (null === o) return null;
225
+ if ($isTextNode(o)) return $getTextPointCaret(o, "next", n.offset);
226
+ if ($isElementNode(o)) return $getChildCaretAtIndex(o, n.offset, "next");
227
+ const r = o.getParent();
228
+ return null === r ? null : $getChildCaretAtIndex(r, o.getIndexWithinParent() + 1, "next");
229
+ }(t, e);
230
+ if (null === i) return !1;
231
+ const l = $splitAtPointCaretNext(i);
232
+ if (null === l) return !1;
233
+ const c = r.editorKey === e.getKey(), u = $getSelection();
234
+ if (c) {
235
+ if (!$isRangeSelection(u) || u.isCollapsed()) return !1;
236
+ if (function(t, e) {
237
+ const { anchor: n, focus: o } = $getCaretRangeInDirection($caretRangeFromSelection(e), "next");
238
+ return $comparePointCaretNext(n, t) < 0 && $comparePointCaretNext(t, o) < 0;
239
+ }(i, u)) return t.preventDefault(), !0;
240
+ u.removeText();
241
+ }
242
+ if (!l.origin.isAttached()) return t.preventDefault(), !0;
243
+ if (n(o, $setSelectionFromCaretRange($getCollapsedCaretRange(l)), e), !c) {
244
+ const t = e.getRootElement(), n = t ? t.ownerDocument : null, o = n ? function(t, e) {
245
+ for (const n of findAllLexicalElementsDeep(e)) {
246
+ const e = getEditorPropertyFromDOMNode(n);
247
+ if (isLexicalEditor(e) && e.getKey() === t && isHTMLElement(n)) return n;
248
+ }
249
+ return null;
250
+ }(r.editorKey, n) : null;
251
+ null !== o && o.dispatchEvent(new InputEvent("beforeinput", {
252
+ bubbles: !0,
253
+ cancelable: !0,
254
+ inputType: "deleteByDrag"
255
+ }));
256
+ }
257
+ return t.preventDefault(), !0;
258
+ }
259
+ function Tt(t, e) {
260
+ return ht(t, e, gt);
261
+ }
262
+ function bt(t, e) {
263
+ return ht(t, e, (t, e) => mt(t, e));
264
+ }
265
+ function Mt(t, e, n) {
266
+ t.dispatchCommand(SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, {
267
+ nodes: e,
268
+ selection: n
269
+ }) || (n.insertNodes(e), function(t) {
270
+ if ($isRangeSelection(t) && t.isCollapsed()) {
271
+ const e = t.anchor;
272
+ let n = null;
273
+ const o = $caretFromPoint(e, "previous");
274
+ if (o) if ($isTextPointCaret(o)) n = o.origin;
275
+ else {
276
+ const t = $getCaretRange(o, $getChildCaret($getRoot(), "next").getFlipped());
277
+ for (const e of t) {
278
+ if ($isTextNode(e.origin)) {
279
+ n = e.origin;
280
+ break;
281
+ }
282
+ if ($isElementNode(e.origin) && !e.origin.isInline()) break;
283
+ }
284
+ }
285
+ if (n && $isTextNode(n)) {
286
+ const e = n.getFormat(), o = n.getStyle();
287
+ t.format === e && t.style === o || (t.format = e, t.style = o, t.dirty = !0);
288
+ }
289
+ }
290
+ }(n));
291
+ }
292
+ function vt(t, e, n, o = []) {
293
+ let r = null === e || n.isSelected(e);
294
+ const i = $isElementNode(n) && n.excludeFromCopy("html");
295
+ let l = n;
296
+ null !== e && $isTextNode(l) && (l = $sliceSelectedTextNodeContent(e, l, "clone"));
297
+ const c = $isElementNode(l) ? l.getChildren() : [], s = function(t) {
298
+ const e = t.exportJSON(), n = t.constructor;
299
+ if (e.type !== n.getType() && nt(58, n.name), $isElementNode(t)) {
300
+ const t = e.children;
301
+ Array.isArray(t) || nt(59, n.name);
302
+ }
303
+ return e;
304
+ }(l);
305
+ $isTextNode(l) && 0 === l.getTextContentSize() && (r = !1);
306
+ const u = r && $isNodeSelection(e) && $isElementNode(n) ? null : e;
307
+ for (let o = 0; o < c.length; o++) {
308
+ const i = c[o], l = vt(t, u, i, s.children);
309
+ !r && $isElementNode(n) && l && n.extractWithChild(i, e, "clone") && (r = !0);
310
+ }
311
+ if (r && !i) {
312
+ const e = $getSlotNames(l);
313
+ if (e.length > 0) {
314
+ const n = {};
315
+ for (const o of e) {
316
+ const e = $getSlot(l, o);
317
+ null === e && nt(366, l.constructor.name, o);
318
+ const r = [];
319
+ vt(t, null, e, r), 1 === r.length && r[0].type === e.getType() || nt(385, o, l.constructor.name, String(r.length), String(r.length > 0 ? r[0].type : "none")), n[o] = r[0];
320
+ }
321
+ s.$slots = n;
322
+ }
323
+ }
324
+ if (r && !i) o.push(s);
325
+ else if (Array.isArray(s.children)) for (let t = 0; t < s.children.length; t++) {
326
+ const e = s.children[t];
327
+ o.push(e);
328
+ }
329
+ return r;
330
+ }
331
+ function wt(t, e) {
332
+ const n = [], o = $getRoot(), r = $isRangeSelection(e) ? e.anchor.getNode() : $isNodeSelection(e) ? e.getNodes()[0] ?? null : null, i = null !== r ? $getSlotFrame(r) : null, l = ($isElementNode(i) ? i : o).getChildren();
333
+ for (let o = 0; o < l.length; o++) vt(t, e, l[o], n);
334
+ return {
335
+ namespace: t._config.namespace,
336
+ nodes: n
337
+ };
338
+ }
339
+ function $t(t) {
340
+ const e = [];
341
+ for (const n of t) e.push($parseSerializedNode(n));
342
+ return e;
343
+ }
344
+ let Ct = null;
345
+ async function Dt(t, e, n) {
346
+ if (null !== Ct) return !1;
347
+ if (null !== e) return new Promise((o, r) => {
348
+ t.update(() => {
349
+ o(Nt(t, e, n));
350
+ });
351
+ });
352
+ const o = t.getRootElement(), r = t._window || window, i = r.document, l = getDOMSelection(r);
353
+ if (null === o || null === l) return !1;
354
+ const c = i.createElement("span");
355
+ c.style.position = "fixed", c.style.top = "-1000px", c.append(i.createTextNode("#")), o.append(c);
356
+ const s = i.createRange();
357
+ return s.setStart(c, 0), s.setEnd(c, 1), l.removeAllRanges(), l.addRange(s), new Promise((e, o) => {
358
+ const l = t.registerCommand(COPY_COMMAND, (o) => (objectKlassEquals(o, ClipboardEvent) && (l(), null !== Ct && (r.clearTimeout(Ct), Ct = null), e(Nt(t, o, n))), !0), COMMAND_PRIORITY_CRITICAL);
359
+ Ct = r.setTimeout(() => {
360
+ l(), Ct = null, e(!1);
361
+ }, 50), i.execCommand("copy"), c.remove();
362
+ });
363
+ }
364
+ function Nt(t, e, n) {
365
+ if (void 0 === n) {
366
+ const e = getDOMSelection(t._window), o = $getSelection();
367
+ if (!o || o.isCollapsed()) return !1;
368
+ if (!e) return !1;
369
+ const r = getDOMSelectionPoints(e, t.getRootElement()), i = r.anchorNode, l = r.focusNode;
370
+ if (null !== i && null !== l && !isSelectionWithinEditor(t, i, l)) return !1;
371
+ n = Rt(o);
372
+ }
373
+ e.preventDefault();
374
+ const o = e.clipboardData;
375
+ return null !== o && (St(o, n), !0);
376
+ }
377
+ const Pt = [["text/html", pt], ["application/x-lexical-editor", dt]];
378
+ function Rt(t = $getSelection()) {
379
+ return function(t, e) {
380
+ const n = { "text/plain": "" };
381
+ for (const [o, r] of Object.entries(t)) if (r) {
382
+ const t = Et(r, e);
383
+ null !== t && (n[o] = t);
384
+ }
385
+ return n;
386
+ }(Ot(), t);
387
+ }
388
+ function St(t, e) {
389
+ for (const [n] of Pt) void 0 === e[n] && t.setData(n, "");
390
+ for (const n in e) {
391
+ const o = e[n];
392
+ void 0 !== o && t.setData(n, o);
393
+ }
394
+ }
395
+ function Ot(t = $getEditor()) {
396
+ const e = getPeerDependencyFromEditor(t, Kt.name);
397
+ return e ? e.output : Ft;
398
+ }
399
+ const Ft = {
400
+ "application/x-lexical-editor": [(t, e) => t ? dt($getEditor(), t) : e()],
401
+ "text/html": [(t, e) => t ? pt($getEditor(), t) : e()],
402
+ "text/plain": [(t, e) => t ? t.getTextContent() : e()]
403
+ };
404
+ function Et(t, e) {
405
+ const n = (o) => t[o] ? t[o](e, n.bind(null, o - 1)) : null;
406
+ return n(t.length - 1);
407
+ }
408
+ function At(t, e = $getSelection()) {
409
+ return Et(Ot()[t] || [], e);
410
+ }
411
+ const Kt = /* @__PURE__ */ defineExtension({
412
+ build: (t, e, n) => e.$exportMimeType,
413
+ config: /* @__PURE__ */ safeCast({ $exportMimeType: Ft }),
414
+ mergeConfig(t, e) {
415
+ const n = shallowMergeConfig(t, e);
416
+ if (e.$exportMimeType) {
417
+ const o = { ...t.$exportMimeType };
418
+ for (const [t, n] of Object.entries(e.$exportMimeType)) if (n) {
419
+ const e = o[t];
420
+ o[t] = e ? [...e, ...n] : n;
421
+ }
422
+ n.$exportMimeType = o;
423
+ }
424
+ return n;
425
+ },
426
+ name: "@lexical/clipboard/GetClipboardData"
427
+ });
428
+ //#endregion
429
+ export { At as $exportMimeTypeFromSelection, wt as $generateJSONFromSelectedNodes, $t as $generateNodesFromSerializedNodes, Rt as $getClipboardDataFromSelection, pt as $getHtmlContent, dt as $getLexicalContent, bt as $handlePlainTextDrop, Tt as $handleRichTextDrop, mt as $insertDataTransferForPlainText, gt as $insertDataTransferForRichText, Mt as $insertGeneratedNodes, xt as $writeDragSourceToDataTransfer, ft as ClipboardDOMImportExtension, at as ClipboardImportExtension, lt as DEFAULT_IMPORT_MIME_TYPE, ot as DEFAULT_IMPORT_MIME_TYPE_PRIORITY, Kt as GetClipboardDataExtension, et as caretFromPoint, Dt as copyToClipboard, St as setLexicalClipboardDataTransfer };