@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
@@ -0,0 +1,538 @@
1
+ import { f as namedSignals, l as effect, o as NormalizeInlineElementsExtension, p as signal, s as NormalizeTripleClickSelectionExtension } from "./LexicalExtension.node-BWH6xbzG.mjs";
2
+ import { $n as PASTE_COMMAND, $t as CONTROLLED_TEXT_INSERTION_COMMAND, At as $setFormatFromDOM, Bn as KEY_ARROW_LEFT_COMMAND, En as IS_APPLE_WEBKIT, G as $getSiblingCaret, Gn as KEY_ENTER_COMMAND, Hn as KEY_ARROW_UP_COMMAND, Ht as CLICK_COMMAND, Jn as KEY_TAB_COMMAND, Kn as KEY_ESCAPE_COMMAND, Mn as IS_IOS, Mt as $setSelection, Ot as $selectAll, Pn as IS_SAFARI, Qn as OUTDENT_CONTENT_COMMAND, R as $getNearestNodeFromDOMNode, U as $getRoot, Un as KEY_BACKSPACE_COMMAND, Vn as KEY_ARROW_RIGHT_COMMAND, Vr as isDOMNode, W as $getSelection, Wn as KEY_DELETE_COMMAND, Xn as MOVE_TO_END, Zn as MOVE_TO_START, _ as $createTabNode, ai as safeCast, an as DELETE_LINE_COMMAND, at as $isElementNode, b as $findMatchingParent, bn as INSERT_PARAGRAPH_COMMAND, br as defineExtension, bt as $isTextNode, c as $comparePointCaretNext, ci as setNodeIndentFromDOM, cn as DRAGSTART_COMMAND, dn as ElementNode, dt as $isNodeSelection, en as COPY_COMMAND, er as PASTE_TAG, et as $insertNodes, gr as createCommand, gt as $isSelectionCapturedInDecoratorInput, h as $createRangeSelection, hr as configExtension, in as DELETE_CHARACTER_COMMAND, kt as $setDirectionFromDOM, li as shallowMergeConfig, ln as DROP_COMMAND, mn as FORMAT_TEXT_COMMAND, mt as $isRootNode, n as $applyNodeReplacement, ni as mergeRegister, nn as CUT_TAG, nr as REMOVE_TEXT_COMMAND, on as DELETE_WORD_COMMAND, or as SELECT_ALL_COMMAND, p as $createParagraphNode, pn as FORMAT_ELEMENT_COMMAND, pr as addClassNamesToElement, pt as $isRangeSelection, q as $getSlotFrame, qn as KEY_SPACE_COMMAND, qr as isHTMLElement, qt as COMMAND_PRIORITY_EDITOR, rt as $isDecoratorNode, sn as DRAGOVER_COMMAND, tn as CUT_COMMAND, vn as INDENT_CONTENT_COMMAND, w as $getAdjacentNode, wt as $normalizeSelection__EXPERIMENTAL, xn as INSERT_TAB_COMMAND, yn as INSERT_LINE_BREAK_COMMAND, zn as KEY_ARROW_DOWN_COMMAND, zt as CAN_USE_BEFORE_INPUT } from "./Lexical.node-BlCLnfA6.mjs";
3
+ import { c as DOMImportExtension, h as defineImportRule, s as CoreImportExtension, v as sel } from "./LexicalHtml.node-CVkbWtUA.mjs";
4
+ import { i as $shouldOverrideDefaultCharacterSelection, n as $isParentRTL, r as $moveCharacter } from "./LexicalSelection.node-CLKroUMQ.mjs";
5
+ import { a as $handleIndentAndOutdent, h as objectKlassEquals, m as eventFiles, r as $getNearestBlockElementAncestorOrThrow } from "./LexicalUtils.node-BVAwOkL4.mjs";
6
+ import { a as caretFromPoint, i as $writeDragSourceToDataTransfer, n as $handleRichTextDrop, o as copyToClipboard, r as $insertDataTransferForRichText, s as setLexicalClipboardDataTransfer, t as $getClipboardDataFromSelection } from "./LexicalClipboard.node-ktUajxsv.mjs";
7
+ import { t as DragonExtension } from "./LexicalDragon.node-DLXctJyy.mjs";
8
+ //#region ../../node_modules/.pnpm/@lexical+rich-text@0.46.0_typescript@6.0.3/node_modules/@lexical/rich-text/dist/LexicalRichText.prod.mjs
9
+ /**
10
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ *
15
+ */
16
+ const Be = [
17
+ /* @__PURE__ */ defineImportRule({
18
+ $import: (e, t) => {
19
+ const r = nt(t.nodeName.toLowerCase());
20
+ return setNodeIndentFromDOM(t, r), $setFormatFromDOM(r, t), $setDirectionFromDOM(r, t), [r.splice(0, 0, e.$importChildren(t))];
21
+ },
22
+ match: sel.tag("h1", "h2", "h3", "h4", "h5", "h6"),
23
+ name: "@lexical/rich-text/heading"
24
+ }),
25
+ /* @__PURE__ */ defineImportRule({
26
+ $import: (e, t) => {
27
+ const r = Ue();
28
+ return $setFormatFromDOM(r, t), setNodeIndentFromDOM(t, r), $setDirectionFromDOM(r, t), [r.splice(0, 0, e.$importChildren(t))];
29
+ },
30
+ match: sel.tag("blockquote"),
31
+ name: "@lexical/rich-text/blockquote"
32
+ }),
33
+ /* @__PURE__ */ defineImportRule({
34
+ $import: (e, t, r) => {
35
+ const n = t.firstChild;
36
+ return n && isHTMLElement(o = n) && "SPAN" === o.nodeName && "26pt" === o.style.fontSize ? e.$importChildren(t) : r();
37
+ var o;
38
+ },
39
+ match: sel.tag("p"),
40
+ name: "@lexical/rich-text/google-docs-title-p"
41
+ }),
42
+ /* @__PURE__ */ defineImportRule({
43
+ $import: (e, t, r) => "26pt" !== t.style.fontSize ? r() : [nt("h1").splice(0, 0, e.$importChildren(t))],
44
+ match: sel.tag("span"),
45
+ name: "@lexical/rich-text/google-docs-title-span"
46
+ })
47
+ ];
48
+ function Ge(e, t) {
49
+ return e && null !== t ? shallowMergeConfig(e, t) : t;
50
+ }
51
+ const Xe = /* @__PURE__ */ defineExtension({
52
+ build: (e, t) => namedSignals(t),
53
+ config: /* @__PURE__ */ safeCast({ escapeFormatTriggers: {
54
+ capitalize: {
55
+ enter: !0,
56
+ space: !0,
57
+ tab: !0
58
+ },
59
+ lowercase: {
60
+ enter: !0,
61
+ space: !0,
62
+ tab: !0
63
+ },
64
+ uppercase: {
65
+ enter: !0,
66
+ space: !0,
67
+ tab: !0
68
+ }
69
+ } }),
70
+ conflictsWith: ["@lexical/plain-text"],
71
+ dependencies: [
72
+ DragonExtension,
73
+ NormalizeInlineElementsExtension,
74
+ NormalizeTripleClickSelectionExtension,
75
+ CoreImportExtension,
76
+ /* @__PURE__ */ configExtension(DOMImportExtension, { rules: Be })
77
+ ],
78
+ mergeConfig: function(e, t) {
79
+ const r = shallowMergeConfig(e, t);
80
+ return t.escapeFormatTriggers && (r.escapeFormatTriggers = function(e, t) {
81
+ const r = shallowMergeConfig(e, t);
82
+ for (const n of Object.keys(t)) r[n] = Ge(e[n], t[n]);
83
+ return r;
84
+ }(e.escapeFormatTriggers, t.escapeFormatTriggers)), r;
85
+ },
86
+ name: "@lexical/rich-text",
87
+ nodes: () => [Ze, Qe],
88
+ register: (e, t, r) => effect(() => lt(e, r.getOutput().escapeFormatTriggers))
89
+ }), Ye = /* @__PURE__ */ defineExtension({
90
+ dependencies: [Xe],
91
+ name: "@lexical/rich-text/Import"
92
+ }), He = /* @__PURE__ */ createCommand("DRAG_DROP_PASTE_FILE");
93
+ var Qe = class Qe extends ElementNode {
94
+ static getType() {
95
+ return "quote";
96
+ }
97
+ static clone(e) {
98
+ return new Qe(e.__key);
99
+ }
100
+ createDOM(e) {
101
+ const t = document.createElement("blockquote");
102
+ return addClassNamesToElement(t, e.theme.quote), t;
103
+ }
104
+ updateDOM(e, t) {
105
+ return !1;
106
+ }
107
+ static importDOM() {
108
+ return { blockquote: (e) => ({
109
+ conversion: rt,
110
+ priority: 0
111
+ }) };
112
+ }
113
+ exportDOM(e) {
114
+ const { element: t } = super.exportDOM(e);
115
+ if (isHTMLElement(t)) {
116
+ this.isEmpty() && t.append(document.createElement("br"));
117
+ const e = this.getFormatType();
118
+ e && (t.style.textAlign = e);
119
+ const r = this.getDirection();
120
+ r && (t.dir = r);
121
+ }
122
+ return { element: t };
123
+ }
124
+ static importJSON(e) {
125
+ return Ue().updateFromJSON(e);
126
+ }
127
+ insertNewAfter(e, t) {
128
+ const r = $createParagraphNode(), n = this.getDirection();
129
+ return r.setDirection(n), this.insertAfter(r, t), r;
130
+ }
131
+ collapseAtStart() {
132
+ const e = $createParagraphNode();
133
+ return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
134
+ }
135
+ canMergeWhenEmpty() {
136
+ return !0;
137
+ }
138
+ };
139
+ function Ue() {
140
+ return $applyNodeReplacement(new Qe());
141
+ }
142
+ function Ve(e) {
143
+ return e instanceof Qe;
144
+ }
145
+ var Ze = class Ze extends ElementNode {
146
+ __tag;
147
+ static getType() {
148
+ return "heading";
149
+ }
150
+ static clone(e) {
151
+ return new Ze(e.__tag, e.__key);
152
+ }
153
+ afterCloneFrom(e) {
154
+ super.afterCloneFrom(e), this.__tag = e.__tag;
155
+ }
156
+ constructor(e = "h1", t) {
157
+ super(t), this.__tag = e;
158
+ }
159
+ getTag() {
160
+ return this.getLatest().__tag;
161
+ }
162
+ setTag(e) {
163
+ const t = this.getWritable();
164
+ return t.__tag = e, t;
165
+ }
166
+ createDOM(e) {
167
+ const t = this.__tag, r = document.createElement(t), n = e.theme.heading;
168
+ if (void 0 !== n) {
169
+ const e = n[t];
170
+ addClassNamesToElement(r, e);
171
+ }
172
+ return r;
173
+ }
174
+ updateDOM(e, t, r) {
175
+ return e.__tag !== this.__tag;
176
+ }
177
+ static importDOM() {
178
+ return {
179
+ h1: (e) => ({
180
+ conversion: tt,
181
+ priority: 0
182
+ }),
183
+ h2: (e) => ({
184
+ conversion: tt,
185
+ priority: 0
186
+ }),
187
+ h3: (e) => ({
188
+ conversion: tt,
189
+ priority: 0
190
+ }),
191
+ h4: (e) => ({
192
+ conversion: tt,
193
+ priority: 0
194
+ }),
195
+ h5: (e) => ({
196
+ conversion: tt,
197
+ priority: 0
198
+ }),
199
+ h6: (e) => ({
200
+ conversion: tt,
201
+ priority: 0
202
+ }),
203
+ p: (e) => {
204
+ const t = e.firstChild;
205
+ return null !== t && et(t) ? {
206
+ conversion: () => ({ node: null }),
207
+ priority: 3
208
+ } : null;
209
+ },
210
+ span: (e) => et(e) ? {
211
+ conversion: (e) => ({ node: nt("h1") }),
212
+ priority: 3
213
+ } : null
214
+ };
215
+ }
216
+ exportDOM(e) {
217
+ const { element: t } = super.exportDOM(e);
218
+ if (isHTMLElement(t)) {
219
+ this.isEmpty() && t.append(document.createElement("br"));
220
+ const e = this.getFormatType();
221
+ e && (t.style.textAlign = e);
222
+ const r = this.getDirection();
223
+ r && (t.dir = r);
224
+ }
225
+ return { element: t };
226
+ }
227
+ static importJSON(e) {
228
+ return nt(e.tag).updateFromJSON(e);
229
+ }
230
+ updateFromJSON(e) {
231
+ return super.updateFromJSON(e).setTag(e.tag);
232
+ }
233
+ exportJSON() {
234
+ return {
235
+ ...super.exportJSON(),
236
+ tag: this.getTag()
237
+ };
238
+ }
239
+ insertNewAfter(e, t = !0) {
240
+ const r = e ? e.anchor.offset : 0, n = this.getLastDescendant(), o = !n || e && e.anchor.key === n.getKey() && r === n.getTextContentSize() || !e ? $createParagraphNode() : nt(this.getTag()), i = this.getDirection();
241
+ if (o.setDirection(i), this.insertAfter(o, t), 0 === r && !this.isEmpty() && e) {
242
+ const e = $createParagraphNode();
243
+ e.select(), this.replace(e, !0);
244
+ }
245
+ return o;
246
+ }
247
+ collapseAtStart() {
248
+ if (this.isEmpty()) {
249
+ const e = $createParagraphNode();
250
+ this.getChildren().forEach((t) => e.append(t)), this.replace(e);
251
+ }
252
+ return !0;
253
+ }
254
+ extractWithChild() {
255
+ return !0;
256
+ }
257
+ };
258
+ function et(e) {
259
+ return "span" === e.nodeName.toLowerCase() && "26pt" === e.style.fontSize;
260
+ }
261
+ function tt(e) {
262
+ const t = e.nodeName.toLowerCase();
263
+ let r = null;
264
+ return "h1" !== t && "h2" !== t && "h3" !== t && "h4" !== t && "h5" !== t && "h6" !== t || (r = nt(t), setNodeIndentFromDOM(e, r), $setFormatFromDOM(r, e), $setDirectionFromDOM(r, e)), { node: r };
265
+ }
266
+ function rt(e) {
267
+ const t = Ue();
268
+ return $setFormatFromDOM(t, e), setNodeIndentFromDOM(e, t), $setDirectionFromDOM(t, e), { node: t };
269
+ }
270
+ function nt(e = "h1") {
271
+ return $applyNodeReplacement(new Ze(e));
272
+ }
273
+ function ot(e) {
274
+ return e instanceof Ze;
275
+ }
276
+ function it(e) {
277
+ return $isDecoratorNode($getNearestNodeFromDOMNode(e));
278
+ }
279
+ function st(e, t, r, n) {
280
+ let o = !1, i = null;
281
+ if (e.isCollapsed() && "text" === e.anchor.type) {
282
+ const t = e.anchor.getNode();
283
+ if ($isTextNode(t)) {
284
+ i = t;
285
+ const n = e.anchor.offset, s = n === t.getTextContentSize() && null === t.getNextSibling(), a = 0 === n && null === t.getPreviousSibling();
286
+ o = "end" === r && s || "start" === r && a || "both" === r && (s || a);
287
+ }
288
+ }
289
+ let s = !1;
290
+ for (const [r, a] of Object.entries(n)) {
291
+ if (null == a || !a[t]) continue;
292
+ const n = r;
293
+ if (a.onlyAtBoundary) {
294
+ if (!(o && i && $isTextNode(i) && i.hasFormat(n))) continue;
295
+ s = !0;
296
+ }
297
+ e.hasFormat(n) && e.toggleFormat(n);
298
+ }
299
+ s && e.setStyle("");
300
+ }
301
+ const at = {
302
+ capitalize: {
303
+ enter: !0,
304
+ space: !0,
305
+ tab: !0
306
+ },
307
+ lowercase: {
308
+ enter: !0,
309
+ space: !0,
310
+ tab: !0
311
+ },
312
+ uppercase: {
313
+ enter: !0,
314
+ space: !0,
315
+ tab: !0
316
+ }
317
+ };
318
+ function ct(e, t, r) {
319
+ r.preventDefault(), r.stopPropagation();
320
+ const n = e.getNodes();
321
+ if (0 === n.length) return !0;
322
+ const o = n.map((e) => $getSiblingCaret(e, "next")).sort($comparePointCaretNext), i = (t ? o[0] : o[o.length - 1]).origin, s = $findMatchingParent(i, (e) => e !== i && $isElementNode(e) && !e.isInline()) ?? $getRoot(), a = t ? 0 : s.getChildrenSize();
323
+ return s.select(a, a), !0;
324
+ }
325
+ function lt(a, c = signal(at)) {
326
+ return mergeRegister(a.registerCommand(CLICK_COMMAND, () => {
327
+ const e = $getSelection();
328
+ return $isNodeSelection(e) ? (e.clear(), !0) : ($isRangeSelection(e) && st(e, "click", "both", c.peek()), !1);
329
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(DELETE_CHARACTER_COMMAND, (e) => {
330
+ const t = $getSelection();
331
+ return $isRangeSelection(t) ? (t.deleteCharacter(e), !0) : !!$isNodeSelection(t) && (t.deleteNodes(), !0);
332
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(DELETE_WORD_COMMAND, (e) => {
333
+ const t = $getSelection();
334
+ return !!$isRangeSelection(t) && (t.deleteWord(e), !0);
335
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(DELETE_LINE_COMMAND, (e) => {
336
+ const t = $getSelection();
337
+ return !!$isRangeSelection(t) && (t.deleteLine(e), !0);
338
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(CONTROLLED_TEXT_INSERTION_COMMAND, (t) => {
339
+ const r = $getSelection();
340
+ if ("string" == typeof t) null !== r && r.insertText(t);
341
+ else {
342
+ if (null === r) return !1;
343
+ const n = t.dataTransfer;
344
+ if (null != n) $insertDataTransferForRichText(n, r, a);
345
+ else if ($isRangeSelection(r)) {
346
+ const e = t.data;
347
+ return e && r.insertText(e), !0;
348
+ }
349
+ }
350
+ return !0;
351
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(REMOVE_TEXT_COMMAND, () => {
352
+ const e = $getSelection();
353
+ return !!$isRangeSelection(e) && (e.removeText(), !0);
354
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(FORMAT_TEXT_COMMAND, (e) => {
355
+ const t = $getSelection();
356
+ return !!$isRangeSelection(t) && (t.formatText(e), !0);
357
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(FORMAT_ELEMENT_COMMAND, (e) => {
358
+ const t = $getSelection();
359
+ if (!$isRangeSelection(t) && !$isNodeSelection(t)) return !1;
360
+ const r = t.getNodes();
361
+ for (const t of r) {
362
+ const r = $findMatchingParent(t, (e) => $isElementNode(e) && !e.isInline());
363
+ null !== r && r.setFormat(e);
364
+ }
365
+ return !0;
366
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(INSERT_LINE_BREAK_COMMAND, (e) => {
367
+ const t = $getSelection();
368
+ return !!$isRangeSelection(t) && (t.insertLineBreak(e), !0);
369
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(INSERT_PARAGRAPH_COMMAND, () => {
370
+ const e = $getSelection();
371
+ return !!$isRangeSelection(e) && (e.insertParagraph(), !0);
372
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(INSERT_TAB_COMMAND, () => {
373
+ const e = $createTabNode(), t = $getSelection();
374
+ return $isRangeSelection(t) && (e.setFormat(t.format), e.setStyle(t.style)), $insertNodes([e]), !0;
375
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(INDENT_CONTENT_COMMAND, () => $handleIndentAndOutdent((e) => {
376
+ const t = e.getIndent();
377
+ e.setIndent(t + 1);
378
+ }), COMMAND_PRIORITY_EDITOR), a.registerCommand(OUTDENT_CONTENT_COMMAND, () => $handleIndentAndOutdent((e) => {
379
+ const t = e.getIndent();
380
+ t > 0 && e.setIndent(Math.max(0, t - 1));
381
+ }), COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_ARROW_UP_COMMAND, (e) => {
382
+ const t = $getSelection();
383
+ if ($isNodeSelection(t)) {
384
+ const r = t.getNodes();
385
+ if (r.length > 0) return e.preventDefault(), r[0].selectPrevious(), !0;
386
+ } else if ($isRangeSelection(t)) {
387
+ const r = $getAdjacentNode(t.focus, !0);
388
+ if (!e.shiftKey && $isDecoratorNode(r) && !r.isIsolated() && !r.isInline()) return r.selectPrevious(), e.preventDefault(), !0;
389
+ }
390
+ return !1;
391
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_ARROW_DOWN_COMMAND, (e) => {
392
+ const t = $getSelection();
393
+ if ($isNodeSelection(t)) {
394
+ const r = t.getNodes();
395
+ if (r.length > 0) return e.preventDefault(), r[0].selectNext(0, 0), !0;
396
+ } else if ($isRangeSelection(t)) {
397
+ if (function(e) {
398
+ const t = e.focus;
399
+ return "root" === t.key && t.offset === $getRoot().getChildrenSize();
400
+ }(t)) return e.preventDefault(), !0;
401
+ const r = $getAdjacentNode(t.focus, !1);
402
+ if (!e.shiftKey && $isDecoratorNode(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), e.preventDefault(), !0;
403
+ }
404
+ return !1;
405
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_ARROW_LEFT_COMMAND, (e) => {
406
+ const t = $getSelection();
407
+ if ($isNodeSelection(t)) {
408
+ const r = t.getNodes();
409
+ if (r.length > 0) return e.preventDefault(), $isParentRTL(r[0]) ? r[0].selectNext(0, 0) : r[0].selectPrevious(), !0;
410
+ }
411
+ if (!$isRangeSelection(t)) return !1;
412
+ if (e.shiftKey || st(t, "arrow", "start", c.peek()), $shouldOverrideDefaultCharacterSelection(t, !0)) {
413
+ const r = e.shiftKey;
414
+ return e.preventDefault(), $moveCharacter(t, r, !0), !0;
415
+ }
416
+ return !1;
417
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_ARROW_RIGHT_COMMAND, (e) => {
418
+ const t = $getSelection();
419
+ if ($isNodeSelection(t)) {
420
+ const r = t.getNodes();
421
+ if (r.length > 0) return e.preventDefault(), $isParentRTL(r[0]) ? r[0].selectPrevious() : r[0].selectNext(0, 0), !0;
422
+ }
423
+ if (!$isRangeSelection(t)) return !1;
424
+ if (e.shiftKey || st(t, "arrow", "end", c.peek()), $shouldOverrideDefaultCharacterSelection(t, !1)) {
425
+ const r = e.shiftKey;
426
+ return e.preventDefault(), $moveCharacter(t, r, !1), !0;
427
+ }
428
+ return !1;
429
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_BACKSPACE_COMMAND, (e) => {
430
+ const t = $getSelection();
431
+ if (!$isNodeSelection(t) && it(e.target)) return !1;
432
+ if ($isRangeSelection(t)) {
433
+ if (function(e) {
434
+ if (!e.isCollapsed()) return !1;
435
+ const { anchor: t } = e;
436
+ if (0 !== t.offset) return !1;
437
+ const r = t.getNode();
438
+ if ($isRootNode(r)) return !1;
439
+ const n = $getNearestBlockElementAncestorOrThrow(r);
440
+ return n.getIndent() > 0 && (n.is(r) || r.is(n.getFirstDescendant()));
441
+ }(t)) return e.preventDefault(), a.dispatchCommand(OUTDENT_CONTENT_COMMAND, void 0);
442
+ if (IS_IOS && CAN_USE_BEFORE_INPUT) return !1;
443
+ } else if (!$isNodeSelection(t)) return !1;
444
+ return e.preventDefault(), a.dispatchCommand(DELETE_CHARACTER_COMMAND, !0);
445
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_DELETE_COMMAND, (e) => {
446
+ const t = $getSelection();
447
+ return !(!$isNodeSelection(t) && it(e.target)) && !(!$isRangeSelection(t) && !$isNodeSelection(t)) && (e.preventDefault(), a.dispatchCommand(DELETE_CHARACTER_COMMAND, !1));
448
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_ENTER_COMMAND, (e) => {
449
+ let t = $getSelection();
450
+ if ($isNodeSelection(t)) {
451
+ const e = t.getNodes();
452
+ 1 === e.length && $isDecoratorNode(e[0]) && !e[0].isInline() && (t = e[0].selectNext());
453
+ }
454
+ if (!$isRangeSelection(t)) return !1;
455
+ if (st(t, "enter", "both", c.peek()), null !== e) {
456
+ if ((IS_IOS || IS_SAFARI || IS_APPLE_WEBKIT) && CAN_USE_BEFORE_INPUT) return !1;
457
+ if (e.preventDefault(), e.shiftKey) return a.dispatchCommand(INSERT_LINE_BREAK_COMMAND, !1);
458
+ }
459
+ return a.dispatchCommand(INSERT_PARAGRAPH_COMMAND, void 0);
460
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_ESCAPE_COMMAND, () => {
461
+ return !!$isRangeSelection($getSelection()) && (a.blur(), !0);
462
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(DROP_COMMAND, (e) => {
463
+ const [, n] = eventFiles(e);
464
+ if (n.length > 0) {
465
+ const r = e.clientX, o = e.clientY, i = caretFromPoint(r, o, a.getRootElement());
466
+ if (null !== i) {
467
+ const { offset: e, node: t } = i, r = $getNearestNodeFromDOMNode(t);
468
+ if (null !== r) {
469
+ const t = $createRangeSelection();
470
+ if ($isTextNode(r)) t.anchor.set(r.getKey(), e, "text"), t.focus.set(r.getKey(), e, "text");
471
+ else {
472
+ const e = r.getParentOrThrow().getKey(), n = r.getIndexWithinParent() + 1;
473
+ t.anchor.set(e, n, "element"), t.focus.set(e, n, "element");
474
+ }
475
+ $setSelection($normalizeSelection__EXPERIMENTAL(t));
476
+ }
477
+ a.dispatchCommand(He, n);
478
+ }
479
+ return e.preventDefault(), !0;
480
+ }
481
+ return $handleRichTextDrop(e, a);
482
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(DRAGSTART_COMMAND, (e) => {
483
+ const [t] = eventFiles(e), r = $getSelection();
484
+ return !(t && !$isRangeSelection(r)) && ($isRangeSelection(r) && !r.isCollapsed() && null !== e.dataTransfer && (setLexicalClipboardDataTransfer(e.dataTransfer, $getClipboardDataFromSelection(r)), $writeDragSourceToDataTransfer(e.dataTransfer, a)), !0);
485
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(DRAGOVER_COMMAND, (e) => {
486
+ const [t] = eventFiles(e), r = $getSelection();
487
+ return !(t && !$isRangeSelection(r)) && (e.preventDefault(), !0);
488
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(SELECT_ALL_COMMAND, () => {
489
+ const e = $getSelection();
490
+ return $selectAll($isRangeSelection(e) && null !== $getSlotFrame(e.anchor.getNode()) ? e : null), !0;
491
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(COPY_COMMAND, (e) => (copyToClipboard(a, objectKlassEquals(e, ClipboardEvent) ? e : null), !0), COMMAND_PRIORITY_EDITOR), a.registerCommand(CUT_COMMAND, (e) => (async function(e, t) {
492
+ await copyToClipboard(t, objectKlassEquals(e, ClipboardEvent) ? e : null), t.update(() => {
493
+ const e = $getSelection();
494
+ $isRangeSelection(e) ? e.removeText() : $isNodeSelection(e) && e.getNodes().forEach((e) => e.remove());
495
+ }, { tag: CUT_TAG });
496
+ }(e, a), !0), COMMAND_PRIORITY_EDITOR), a.registerCommand(PASTE_COMMAND, (t) => {
497
+ const [, r, n] = eventFiles(t);
498
+ if (r.length > 0 && !n) return a.dispatchCommand(He, r), !0;
499
+ if (isDOMNode(t.target) && $isSelectionCapturedInDecoratorInput(t.target)) return !1;
500
+ return null !== $getSelection() && (function(t, r) {
501
+ t.preventDefault(), r.update(() => {
502
+ const n = $getSelection(), o = objectKlassEquals(t, InputEvent) || objectKlassEquals(t, KeyboardEvent) ? null : t.clipboardData;
503
+ null != o && null !== n && $insertDataTransferForRichText(o, n, r);
504
+ }, { tag: PASTE_TAG });
505
+ }(t, a), !0);
506
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_SPACE_COMMAND, () => {
507
+ const e = $getSelection();
508
+ return $isRangeSelection(e) && st(e, "space", "both", c.peek()), !1;
509
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(KEY_TAB_COMMAND, () => {
510
+ const e = $getSelection();
511
+ return $isRangeSelection(e) && st(e, "tab", "both", c.peek()), !1;
512
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(MOVE_TO_END, (e) => {
513
+ const t = $getSelection();
514
+ if ($isNodeSelection(t)) return ct(t, !1, e);
515
+ if (!$isRangeSelection(t)) return !1;
516
+ const { anchor: r } = t;
517
+ if ("element" !== r.type || 0 !== r.offset) return !1;
518
+ const n = r.getNode();
519
+ if (!$isElementNode(n)) return !1;
520
+ const o = n.getFirstChild();
521
+ if (!$isDecoratorNode(o) || !o.isInline()) return !1;
522
+ const i = n.getKey(), s = n.selectEnd();
523
+ return e.shiftKey && s.anchor.set(i, 0, "element"), e.preventDefault(), e.stopPropagation(), !0;
524
+ }, COMMAND_PRIORITY_EDITOR), a.registerCommand(MOVE_TO_START, (e) => {
525
+ const t = $getSelection();
526
+ if ($isNodeSelection(t)) return ct(t, !0, e);
527
+ if (!$isRangeSelection(t)) return !1;
528
+ const { anchor: r, focus: n } = t, o = $findMatchingParent(n.getNode(), (e) => $isElementNode(e) && !e.isInline());
529
+ if (null === o) return !1;
530
+ const i = o.getFirstChild();
531
+ if (!$isDecoratorNode(i) || !i.isInline()) return !1;
532
+ if ($findMatchingParent(r.getNode(), (e) => $isElementNode(e) && !e.isInline()) !== o) return !1;
533
+ const s = o.getKey();
534
+ return ("element" !== n.type || n.key !== s || 0 !== n.offset) && (t.focus.set(s, 0, "element"), e.shiftKey || t.anchor.set(s, 0, "element"), e.preventDefault(), e.stopPropagation(), !0);
535
+ }, COMMAND_PRIORITY_EDITOR));
536
+ }
537
+ //#endregion
538
+ export { nt as $createHeadingNode, Ue as $createQuoteNode, ot as $isHeadingNode, Ve as $isQuoteNode, He as DRAG_DROP_PASTE, Ze as HeadingNode, Qe as QuoteNode, Xe as RichTextExtension, Ye as RichTextImportExtension, Be as RichTextImportRules, eventFiles, lt as registerRichText };
@@ -1,5 +1,5 @@
1
- import { $ as $isElementNode, F as $getEditor, O as $getCharacterOffsets, R as $getNodeByKey, U as $getSelection, V as $getPreviousSelection, X as $isChildCaret, Z as $isDecoratorNode, _ as $createTextNode, a as $cloneWithProperties, bt as $selectAll, ct as $isRootNode, et as $isExtendableTextPointCaret, ft as $isTextNode, i as $caretRangeFromSelection, lt as $isRootOrShadowRoot, mt as $isTokenOrSegmented, nt as $isLeafNode, o as $cloneWithPropertiesEphemeral, pr as getStyleObjectFromCSS$1, q as $hasAncestor, r as $caretFromPoint, st as $isRangeSelection, un as INTERNAL_$isBlock, v as $extendCaretToRange, wt as $setSelection, y as $findMatchingParent } from "./Lexical.node-fXM8Jp7p.mjs";
2
- //#region ../../node_modules/.pnpm/@lexical+selection@0.45.0/node_modules/@lexical/selection/dist/LexicalSelection.dev.mjs
1
+ import { H as $getPreviousSelection, I as $getEditor, Ir as getStyleObjectFromCSS$1, Mt as $setSelection, Ot as $selectAll, Pr as getRootOwnerDocument, Q as $hasAncestor, Sn as INTERNAL_$isBlock, St as $isTokenOrSegmented, W as $getSelection, a as $caretRangeFromSelection, at as $isElementNode, b as $findMatchingParent, bt as $isTextNode, ct as $isLeafNode, ht as $isRootOrShadowRoot, i as $caretFromPoint, k as $getCharacterOffsets, mt as $isRootNode, nt as $isChildCaret, o as $cloneWithProperties, ot as $isExtendableTextPointCaret, pt as $isRangeSelection, rt as $isDecoratorNode, s as $cloneWithPropertiesEphemeral, v as $createTextNode, y as $extendCaretToRange, z as $getNodeByKey } from "./Lexical.node-BlCLnfA6.mjs";
2
+ //#region ../../node_modules/.pnpm/@lexical+selection@0.46.0_typescript@6.0.3/node_modules/@lexical/selection/dist/LexicalSelection.dev.mjs
3
3
  /**
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -65,7 +65,7 @@ function getDOMIndexWithinParent(node) {
65
65
  function createDOMRange(editor, anchorNode, _anchorOffset, focusNode, _focusOffset) {
66
66
  const anchorKey = anchorNode.getKey();
67
67
  const focusKey = focusNode.getKey();
68
- const range = document.createRange();
68
+ const range = getRootOwnerDocument(editor.getRootElement()).createRange();
69
69
  let anchorDOM = editor.getElementByKey(anchorKey);
70
70
  let focusDOM = editor.getElementByKey(focusKey);
71
71
  let anchorOffset = _anchorOffset;
@@ -266,7 +266,7 @@ function $trimTextContentFromAnchor(editor, anchor, delCount) {
266
266
  currentNode = nextNode;
267
267
  } else {
268
268
  const key = currentNode.getKey();
269
- const prevTextContent = editor.getEditorState().read(() => {
269
+ const prevTextContent = editor.read("latest", () => {
270
270
  const prevNode = $getNodeByKey(key);
271
271
  if ($isTextNode(prevNode) && prevNode.isSimpleText()) return prevNode.getTextContent();
272
272
  return null;
@@ -511,8 +511,8 @@ function $wrapNodesImpl(selection, nodes, nodesLength, createElement, wrappingEl
511
511
  const firstNode = nodes[0];
512
512
  const elementMapping = /* @__PURE__ */ new Map();
513
513
  const elements = [];
514
- let target = $isElementNode(firstNode) ? firstNode : firstNode.getParentOrThrow();
515
- if (target.isInline()) target = target.getParentOrThrow();
514
+ const firstNodeBlock = $isElementNode(firstNode) ? firstNode : firstNode.getParentOrThrow();
515
+ let target = firstNodeBlock.isInline() ? firstNodeBlock.getParentOrThrow() : firstNodeBlock;
516
516
  let targetIsPrevSibling = false;
517
517
  while (target !== null) {
518
518
  const prevSibling = target.getPreviousSibling();
@@ -570,12 +570,13 @@ function $wrapNodesImpl(selection, nodes, nodesLength, createElement, wrappingEl
570
570
  target.insertAfter(element);
571
571
  }
572
572
  else {
573
- const firstChild = target.getFirstChild();
573
+ const rootTarget = target;
574
+ const firstChild = rootTarget.getFirstChild();
574
575
  if ($isElementNode(firstChild)) target = firstChild;
575
- if (firstChild === null) if (wrappingElement) target.append(wrappingElement);
576
+ if (firstChild === null) if (wrappingElement) rootTarget.append(wrappingElement);
576
577
  else for (let i = 0; i < elements.length; i++) {
577
578
  const element = elements[i];
578
- target.append(element);
579
+ rootTarget.append(element);
579
580
  lastElement = element;
580
581
  }
581
582
  else if (wrappingElement !== null) firstChild.insertBefore(wrappingElement);
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@lexical+selection@0.45.0/node_modules/@lexical/selection/dist/LexicalSelection.node.mjs
1
+ //#region ../../node_modules/.pnpm/@lexical+selection@0.46.0_typescript@6.0.3/node_modules/@lexical/selection/dist/LexicalSelection.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("./LexicalSelection.dev-DGjj12wW.mjs") : import("./LexicalSelection.prod-D-PwRbyK.mjs"));
9
+ const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalSelection.dev-C4L7l8OB.mjs") : import("./LexicalSelection.prod-DzFqpTlw.mjs"));
10
10
  mod.$addNodeStyle;
11
11
  mod.$cloneWithProperties;
12
12
  mod.$copyBlockFormatIndent;
@@ -15,7 +15,7 @@ mod.$forEachSelectedTextNode;
15
15
  mod.$getComputedStyleForElement;
16
16
  mod.$getComputedStyleForParent;
17
17
  mod.$getSelectionStyleValueForProperty;
18
- mod.$isAtNodeEnd;
18
+ const $isAtNodeEnd = mod.$isAtNodeEnd;
19
19
  mod.$isParentElementRTL;
20
20
  const $isParentRTL = mod.$isParentRTL;
21
21
  mod.$moveCaretSelection;
@@ -33,4 +33,4 @@ mod.getCSSFromStyleObject;
33
33
  mod.getStyleObjectFromCSS;
34
34
  mod.trimTextContentFromAnchor;
35
35
  //#endregion
36
- export { createRectsFromDOMRange as a, $sliceSelectedTextNodeContent as i, $moveCharacter as n, $shouldOverrideDefaultCharacterSelection as r, $isParentRTL as t };
36
+ export { $sliceSelectedTextNodeContent as a, $shouldOverrideDefaultCharacterSelection as i, $isParentRTL as n, createRectsFromDOMRange as o, $moveCharacter as r, $isAtNodeEnd as t };