@mx-space/cli 0.13.1 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +60 -1
  2. package/ROADMAP.md +11 -8
  3. package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-DTxuYHmG.mjs} +2267 -431
  4. package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-BlCLnfA6.mjs} +47 -10
  5. package/dist/Lexical.prod-CeB9UQuo.mjs +6816 -0
  6. package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-CdFkLR_D.mjs} +131 -39
  7. package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-ktUajxsv.mjs} +2 -2
  8. package/dist/LexicalClipboard.prod-DliyLofW.mjs +429 -0
  9. package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-CL9tHWJX.mjs} +81 -67
  10. package/dist/LexicalCodeCore.prod-BoMSJc29.mjs +651 -0
  11. package/dist/LexicalDragon.dev-CqW7Aq5H.mjs +186 -0
  12. package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-DLXctJyy.mjs} +3 -2
  13. package/dist/LexicalDragon.prod-DHI3T6n5.mjs +121 -0
  14. package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-BP-18zns.mjs} +352 -38
  15. package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-BWH6xbzG.mjs} +9 -4
  16. package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-Cs6OgrDn.mjs} +479 -330
  17. package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-DJp__UcP.mjs} +2 -2
  18. package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-o0v9cIu5.mjs} +2 -2
  19. package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-DoymwFpG.mjs} +327 -269
  20. package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-CVkbWtUA.mjs} +6 -4
  21. package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-C2b3z99k.mjs} +355 -353
  22. package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-7cgLOLIe.mjs} +70 -59
  23. package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-DWFgoXHR.mjs} +211 -212
  24. package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-Ci2iOxFx.mjs} +246 -198
  25. package/dist/LexicalList.prod-D0xX5d3G.mjs +944 -0
  26. package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-C0ZYCyuR.mjs} +130 -38
  27. package/dist/LexicalMarkdown.prod-0M-Nc-rh.mjs +932 -0
  28. package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-Cnr1kDym.mjs} +151 -122
  29. package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-BUJZAiap.mjs} +8 -11
  30. package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +538 -0
  31. package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-C4L7l8OB.mjs} +10 -9
  32. package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-CLKroUMQ.mjs} +4 -4
  33. package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-DzFqpTlw.mjs} +144 -146
  34. package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-Cc9-zqKa.mjs} +186 -121
  35. package/dist/LexicalTable.prod-BgO4nCxy.mjs +2336 -0
  36. package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-BRgK0L6G.mjs} +375 -35
  37. package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-BVAwOkL4.mjs} +24 -12
  38. package/dist/LexicalUtils.prod-C1gtvVDP.mjs +504 -0
  39. package/dist/bin/mxs.mjs +1 -1
  40. package/dist/{esm-DFrz5rIo.mjs → esm-BNu4sUWV.mjs} +220 -185
  41. package/dist/esm-jbwcVZth.mjs +2 -0
  42. package/dist/index.d.mts +46 -17
  43. package/dist/index.mjs +1 -1
  44. package/dist/{mxs-DXpzbUf4.mjs → mxs-zPvjkoNC.mjs} +8235 -6041
  45. package/dist/vendor/litexml/cli.mjs +24150 -0
  46. package/dist/vendor/litexml/litexml-html-preview-client.css +8862 -0
  47. package/dist/vendor/litexml/litexml-html-preview-client.js +163816 -0
  48. package/dist/vendor/litexml/style.css +96 -0
  49. package/package.json +21 -22
  50. package/skills/commands-ai.md +115 -0
  51. package/skills/commands-preview.md +3 -3
  52. package/skills/overview.md +1 -0
  53. package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
  54. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
  55. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
  56. package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
  57. package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
  58. package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
  59. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
  60. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
  61. package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
  62. package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
  63. package/dist/esm-DXO9Afik.mjs +0 -2
@@ -1,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, 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.prod.mjs
1
+ import { H as $getPreviousSelection, I as $getEditor, Ir as getStyleObjectFromCSS, 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.prod.mjs
3
3
  /**
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -7,13 +7,13 @@ import { $ as $isElementNode, F as $getEditor, O as $getCharacterOffsets, R as $
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  *
9
9
  */
10
- function P(e, ...t) {
10
+ function K(e, ...t) {
11
11
  const n = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
12
12
  o.append("code", e);
13
13
  for (const e of t) o.append("v", e);
14
14
  throw n.search = o.toString(), Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
15
15
  }
16
- function K(e) {
16
+ function E(e) {
17
17
  let t = e;
18
18
  for (; null != t;) {
19
19
  if (t.nodeType === Node.TEXT_NODE) return t;
@@ -21,26 +21,26 @@ function K(e) {
21
21
  }
22
22
  return null;
23
23
  }
24
- function E(e) {
24
+ function I(e) {
25
25
  const t = e.parentNode;
26
26
  if (null == t) throw new Error("Should never happen");
27
27
  return [t, Array.from(t.childNodes).indexOf(e)];
28
28
  }
29
- function I(t, n, o, l, r) {
30
- const i = n.getKey(), s = l.getKey(), c = document.createRange();
31
- let f = t.getElementByKey(i), u = t.getElementByKey(s), g = o, d = r;
32
- if ($isTextNode(n) && (f = K(f)), $isTextNode(l) && (u = K(u)), void 0 === n || void 0 === l || null === f || null === u) return null;
33
- "BR" === f.nodeName && ([f, g] = E(f)), "BR" === u.nodeName && ([u, d] = E(u));
34
- const a = f.firstChild;
35
- f === u && null != a && "BR" === a.nodeName && 0 === g && 0 === d && (d = 1);
29
+ function B(n, o, l, r, i) {
30
+ const s = o.getKey(), c = r.getKey(), f = getRootOwnerDocument(n.getRootElement()).createRange();
31
+ let u = n.getElementByKey(s), g = n.getElementByKey(c), d = l, a = i;
32
+ if ($isTextNode(o) && (u = E(u)), $isTextNode(r) && (g = E(g)), void 0 === o || void 0 === r || null === u || null === g) return null;
33
+ "BR" === u.nodeName && ([u, d] = I(u)), "BR" === g.nodeName && ([g, a] = I(g));
34
+ const p = u.firstChild;
35
+ u === g && null != p && "BR" === p.nodeName && 0 === d && 0 === a && (a = 1);
36
36
  try {
37
- c.setStart(f, g), c.setEnd(u, d);
37
+ f.setStart(u, d), f.setEnd(g, a);
38
38
  } catch (e) {
39
39
  return null;
40
40
  }
41
- return !c.collapsed || g === d && i === s || (c.setStart(u, d), c.setEnd(f, g)), c;
41
+ return !f.collapsed || d === a && s === c || (f.setStart(g, a), f.setEnd(u, d)), f;
42
42
  }
43
- function B(e, t) {
43
+ function F(e, t) {
44
44
  const n = e.getRootElement();
45
45
  if (null === n) return [];
46
46
  const o = n.getBoundingClientRect(), l = getComputedStyle(n), r = parseFloat(l.paddingLeft) + parseFloat(l.paddingRight), i = Array.from(t.getClientRects());
@@ -55,30 +55,30 @@ function B(e, t) {
55
55
  }
56
56
  return i;
57
57
  }
58
- function F(e) {
58
+ function b(e) {
59
59
  let t = "";
60
60
  for (const n in e) n && (t += `${n}: ${e[n]};`);
61
61
  return t;
62
62
  }
63
- function b(e) {
64
- const n = $getEditor().getElementByKey(e.getKey());
65
- if (null === n) return null;
66
- const o = n.ownerDocument.defaultView;
67
- return null === o ? null : o.getComputedStyle(n);
68
- }
69
63
  function k(e) {
70
- return b($isRootNode(e) ? e : e.getParentOrThrow());
64
+ const t = $getEditor().getElementByKey(e.getKey());
65
+ if (null === t) return null;
66
+ const o = t.ownerDocument.defaultView;
67
+ return null === o ? null : o.getComputedStyle(t);
71
68
  }
72
69
  function z(e) {
73
- const t = k(e);
70
+ return k($isRootNode(e) ? e : e.getParentOrThrow());
71
+ }
72
+ function R(e) {
73
+ const t = z(e);
74
74
  return null !== t && "rtl" === t.direction;
75
75
  }
76
76
  function O(e, t, n = "self") {
77
77
  const o = e.getStartEndPoints();
78
78
  if (t.isSelected(e) && !$isTokenOrSegmented(t) && null !== o) {
79
- const [l, r] = o, i = e.isBackward(), s = l.getNode(), u = r.getNode(), g = t.is(s), d = t.is(u);
79
+ const [l, r] = o, i = e.isBackward(), s = l.getNode(), c = r.getNode(), g = t.is(s), d = t.is(c);
80
80
  if (g || d) {
81
- const [o, l] = $getCharacterOffsets(e), r = s.is(u), g = t.is(i ? u : s), d = t.is(i ? s : u);
81
+ const [o, l] = $getCharacterOffsets(e), r = s.is(c), g = t.is(i ? c : s), d = t.is(i ? s : c);
82
82
  let a, p = 0;
83
83
  if (r) p = o > l ? l : o, a = o > l ? o : l;
84
84
  else if (g) p = i ? l : o, a = void 0;
@@ -89,51 +89,51 @@ function O(e, t, n = "self") {
89
89
  }
90
90
  return t;
91
91
  }
92
- function R(e) {
92
+ function A(e) {
93
93
  if ("text" === e.type) return e.offset === e.getNode().getTextContentSize();
94
94
  const t = e.getNode();
95
- return $isElementNode(t) || P(177), e.offset === t.getChildrenSize();
95
+ return $isElementNode(t) || K(177), e.offset === t.getChildrenSize();
96
96
  }
97
- function A(t, o, r) {
98
- let i = o.getNode(), c = r;
97
+ function _(e, n, l) {
98
+ let i = n.getNode(), s = l;
99
99
  if ($isElementNode(i)) {
100
- const e = i.getDescendantByIndex(o.offset);
100
+ const e = i.getDescendantByIndex(n.offset);
101
101
  null !== e && (i = e);
102
102
  }
103
- for (; c > 0 && null !== i;) {
103
+ for (; s > 0 && null !== i;) {
104
104
  if ($isElementNode(i)) {
105
105
  const e = i.getLastDescendant();
106
106
  null !== e && (i = e);
107
107
  }
108
- let r = i.getPreviousSibling(), f = 0;
109
- if (null === r) {
108
+ let l = i.getPreviousSibling(), f = 0;
109
+ if (null === l) {
110
110
  let e = i.getParentOrThrow(), t = e.getPreviousSibling();
111
111
  for (; null === t;) {
112
112
  if (e = e.getParent(), null === e) {
113
- r = null;
113
+ l = null;
114
114
  break;
115
115
  }
116
116
  t = e.getPreviousSibling();
117
117
  }
118
- null !== e && (f = e.isInline() ? 0 : 2, r = t);
118
+ null !== e && (f = e.isInline() ? 0 : 2, l = t);
119
119
  }
120
- let a = i.getTextContent();
121
- "" === a && $isElementNode(i) && !i.isInline() && (a = "\n\n");
122
- const p = a.length;
123
- if (!$isTextNode(i) || c >= p) {
120
+ let u = i.getTextContent();
121
+ "" === u && $isElementNode(i) && !i.isInline() && (u = "\n\n");
122
+ const p = u.length;
123
+ if (!$isTextNode(i) || s >= p) {
124
124
  const e = i.getParent();
125
- i.remove(), null == e || 0 !== e.getChildrenSize() || $isRootNode(e) || e.remove(), c -= p + f, i = r;
125
+ i.remove(), null == e || 0 !== e.getChildrenSize() || $isRootNode(e) || e.remove(), s -= p + f, i = l;
126
126
  } else {
127
- const n = i.getKey(), r = t.getEditorState().read(() => {
128
- const t = $getNodeByKey(n);
129
- return $isTextNode(t) && t.isSimpleText() ? t.getTextContent() : null;
130
- }), s = p - c, f = a.slice(0, s);
131
- if (null !== r && r !== a) {
127
+ const o = i.getKey(), l = e.read("latest", () => {
128
+ const e = $getNodeByKey(o);
129
+ return $isTextNode(e) && e.isSimpleText() ? e.getTextContent() : null;
130
+ }), c = p - s, f = u.slice(0, c);
131
+ if (null !== l && l !== u) {
132
132
  const e = $getPreviousSelection();
133
133
  let t = i;
134
- if (i.isSimpleText()) i.setTextContent(r);
134
+ if (i.isSimpleText()) i.setTextContent(l);
135
135
  else {
136
- const e = $createTextNode(r);
136
+ const e = $createTextNode(l);
137
137
  i.replace(e), t = e;
138
138
  }
139
139
  if ($isRangeSelection(e) && e.isCollapsed()) {
@@ -141,10 +141,10 @@ function A(t, o, r) {
141
141
  t.select(n, n);
142
142
  }
143
143
  } else if (i.isSimpleText()) {
144
- const e = o.key === n;
145
- let t = o.offset;
146
- t < c && (t = p);
147
- const l = e ? t - c : 0, r = e ? t : s;
144
+ const e = n.key === o;
145
+ let t = n.offset;
146
+ t < s && (t = p);
147
+ const l = e ? t - s : 0, r = e ? t : c;
148
148
  if (e && 0 === l) {
149
149
  const [e] = i.splitText(l, r);
150
150
  e.remove();
@@ -156,24 +156,24 @@ function A(t, o, r) {
156
156
  const e = $createTextNode(f);
157
157
  i.replace(e);
158
158
  }
159
- c = 0;
159
+ s = 0;
160
160
  }
161
161
  }
162
162
  }
163
- const _ = () => {};
164
- function L(t, n) {
165
- ($isRangeSelection(t) ? t.isCollapsed() : $isTextNode(t) || $isElementNode(t)) || P(280);
166
- const o = getStyleObjectFromCSS($isRangeSelection(t) ? t.style : $isTextNode(t) ? t.getStyle() : t.getTextStyle()), r = F(Object.entries(n).reduce((e, [n, l]) => ("function" == typeof l ? e[n] = l(o[n], t) : null === l ? delete e[n] : e[n] = l, e), { ...o }));
167
- $isRangeSelection(t) || $isTextNode(t) ? t.setStyle(r) : t.setTextStyle(r);
163
+ const L = () => {};
164
+ function M(e, n) {
165
+ ($isRangeSelection(e) ? e.isCollapsed() : $isTextNode(e) || $isElementNode(e)) || K(280);
166
+ const o = getStyleObjectFromCSS($isRangeSelection(e) ? e.style : $isTextNode(e) ? e.getStyle() : e.getTextStyle()), l = b(Object.entries(n).reduce((t, [n, l]) => ("function" == typeof l ? t[n] = l(o[n], e) : null === l ? delete t[n] : t[n] = l, t), { ...o }));
167
+ $isRangeSelection(e) || $isTextNode(e) ? e.setStyle(l) : e.setTextStyle(l);
168
168
  }
169
- function M(e, t) {
169
+ function $(e, t) {
170
170
  if ($isRangeSelection(e) && e.isCollapsed()) {
171
- L(e, t);
171
+ M(e, t);
172
172
  const n = e.anchor.getNode();
173
- $isElementNode(n) && n.isEmpty() && L(n, t);
173
+ $isElementNode(n) && n.isEmpty() && M(n, t);
174
174
  }
175
- $((e) => {
176
- L(e, t);
175
+ D((e) => {
176
+ M(e, t);
177
177
  });
178
178
  const n = e.getNodes();
179
179
  if (n.length > 0) {
@@ -181,35 +181,35 @@ function M(e, t) {
181
181
  for (const o of n) {
182
182
  if (!$isElementNode(o) || !o.canBeEmpty() || 0 !== o.getChildrenSize()) continue;
183
183
  const n = o.getKey();
184
- e.has(n) || (e.add(n), L(o, t));
184
+ e.has(n) || (e.add(n), M(o, t));
185
185
  }
186
186
  }
187
187
  }
188
- function $(t) {
188
+ function D(e) {
189
189
  const n = $getSelection();
190
190
  if (!n) return;
191
- const s = /* @__PURE__ */ new Map(), c = (e) => s.get(e.getKey()) || [0, e.getTextContentSize()];
192
- if ($isRangeSelection(n)) for (const e of $caretRangeFromSelection(n).getTextSlices()) e && s.set(e.caret.origin.getKey(), e.getSliceIndices());
191
+ const o = /* @__PURE__ */ new Map(), c = (e) => o.get(e.getKey()) || [0, e.getTextContentSize()];
192
+ if ($isRangeSelection(n)) for (const e of $caretRangeFromSelection(n).getTextSlices()) e && o.set(e.caret.origin.getKey(), e.getSliceIndices());
193
193
  const f = n.getNodes();
194
194
  for (const n of f) {
195
195
  if (!$isTextNode(n) || !n.canHaveFormat()) continue;
196
196
  const [o, l] = c(n);
197
- if (l !== o) if ($isTokenOrSegmented(n) || 0 === o && l === n.getTextContentSize()) t(n);
198
- else t(n.splitText(o, l)[0 === o ? 0 : 1]);
197
+ if (l !== o) if ($isTokenOrSegmented(n) || 0 === o && l === n.getTextContentSize()) e(n);
198
+ else e(n.splitText(o, l)[0 === o ? 0 : 1]);
199
199
  }
200
- $isRangeSelection(n) && "text" === n.anchor.type && "text" === n.focus.type && n.anchor.key === n.focus.key && D(n);
200
+ $isRangeSelection(n) && "text" === n.anchor.type && "text" === n.focus.type && n.anchor.key === n.focus.key && j(n);
201
201
  }
202
- function D(e) {
202
+ function j(e) {
203
203
  if (e.isBackward()) {
204
204
  const { anchor: t, focus: n } = e, { key: o, offset: l, type: r } = t;
205
205
  t.set(n.key, n.offset, n.type), n.set(o, l, r);
206
206
  }
207
207
  }
208
- function j(e, t) {
208
+ function U(e, t) {
209
209
  const n = e.getFormatType(), o = e.getIndent();
210
210
  n !== t.getFormatType() && t.setFormat(n), o !== t.getIndent() && t.setIndent(o);
211
211
  }
212
- function U(e, t, n = j) {
212
+ function H(e, t, n = U) {
213
213
  if (!e) return;
214
214
  const o = e.getStartEndPoints();
215
215
  let l = !1, r = null;
@@ -241,17 +241,17 @@ function U(e, t, n = j) {
241
241
  n(e, o), e.replace(o, !0);
242
242
  }
243
243
  }
244
- function H(e) {
244
+ function V(e) {
245
245
  return e.getNode().isAttached();
246
246
  }
247
- function V(e) {
247
+ function W(e) {
248
248
  let t = e;
249
249
  for (; null !== t && !$isRootOrShadowRoot(t);) {
250
250
  const e = t.getLatest(), n = t.getParent();
251
251
  0 === e.getChildrenSize() && t.remove(!0), t = n;
252
252
  }
253
253
  }
254
- function W(e, t, n = null) {
254
+ function X(e, t, n = null) {
255
255
  const o = e.getStartEndPoints(), l = o ? o[0] : null, r = e.getNodes(), i = r.length;
256
256
  if (null !== l && (0 === i || 1 === i && "element" === l.type && 0 === l.getNode().getChildrenSize())) {
257
257
  const e = "text" === l.type ? l.getNode().getParentOrThrow() : l.getNode(), o = e.getChildren();
@@ -262,91 +262,89 @@ function W(e, t, n = null) {
262
262
  let s = null, c = [];
263
263
  for (let o = 0; o < i; o++) {
264
264
  const l = r[o];
265
- $isRootOrShadowRoot(l) ? (X(e, c, c.length, t, n), c = [], s = l) : null === s || null !== s && $hasAncestor(l, s) ? c.push(l) : (X(e, c, c.length, t, n), c = [l]);
265
+ $isRootOrShadowRoot(l) ? (q(e, c, c.length, t, n), c = [], s = l) : null === s || null !== s && $hasAncestor(l, s) ? c.push(l) : (q(e, c, c.length, t, n), c = [l]);
266
266
  }
267
- X(e, c, c.length, t, n);
267
+ q(e, c, c.length, t, n);
268
268
  }
269
- function X(e, t, n, o, r = null) {
269
+ function q(e, t, n, o, l = null) {
270
270
  if (0 === t.length) return;
271
- const i = t[0], c = /* @__PURE__ */ new Map(), f = [];
272
- let u = $isElementNode(i) ? i : i.getParentOrThrow();
273
- u.isInline() && (u = u.getParentOrThrow());
274
- let d = !1;
275
- for (; null !== u;) {
276
- const e = u.getPreviousSibling();
271
+ const i = t[0], s = /* @__PURE__ */ new Map(), f = [], u = $isElementNode(i) ? i : i.getParentOrThrow();
272
+ let g = u.isInline() ? u.getParentOrThrow() : u, a = !1;
273
+ for (; null !== g;) {
274
+ const e = g.getPreviousSibling();
277
275
  if (null !== e) {
278
- u = e, d = !0;
276
+ g = e, a = !0;
279
277
  break;
280
278
  }
281
- if (u = u.getParentOrThrow(), $isRootOrShadowRoot(u)) break;
279
+ if (g = g.getParentOrThrow(), $isRootOrShadowRoot(g)) break;
282
280
  }
283
- const a = /* @__PURE__ */ new Set();
281
+ const p = /* @__PURE__ */ new Set();
284
282
  for (let e = 0; e < n; e++) {
285
283
  const n = t[e];
286
- $isElementNode(n) && 0 === n.getChildrenSize() && a.add(n.getKey());
284
+ $isElementNode(n) && 0 === n.getChildrenSize() && p.add(n.getKey());
287
285
  }
288
- const p = /* @__PURE__ */ new Set();
286
+ const h = /* @__PURE__ */ new Set();
289
287
  for (let e = 0; e < n; e++) {
290
288
  const n = t[e];
291
289
  let l = n.getParent();
292
- if (null !== l && l.isInline() && (l = l.getParent()), null !== l && $isLeafNode(n) && !p.has(n.getKey())) {
290
+ if (null !== l && l.isInline() && (l = l.getParent()), null !== l && $isLeafNode(n) && !h.has(n.getKey())) {
293
291
  const e = l.getKey();
294
- if (void 0 === c.get(e)) {
292
+ if (void 0 === s.get(e)) {
295
293
  const t = o();
296
- t.setFormat(l.getFormatType()), t.setIndent(l.getIndent()), f.push(t), c.set(e, t);
294
+ t.setFormat(l.getFormatType()), t.setIndent(l.getIndent()), f.push(t), s.set(e, t);
297
295
  const n = l.getChildren();
298
296
  t.splice(t.getChildrenSize(), 0, n);
299
- for (const e of n) if (p.add(e.getKey()), $isElementNode(e)) for (const t of e.getChildrenKeys()) p.add(t);
300
- V(l);
297
+ for (const e of n) if (h.add(e.getKey()), $isElementNode(e)) for (const t of e.getChildrenKeys()) h.add(t);
298
+ W(l);
301
299
  }
302
- } else if (a.has(n.getKey())) {
303
- $isElementNode(n) || P(179);
300
+ } else if (p.has(n.getKey())) {
301
+ $isElementNode(n) || K(179);
304
302
  const e = o();
305
303
  e.setFormat(n.getFormatType()), e.setIndent(n.getIndent()), f.push(e), n.remove(!0);
306
304
  }
307
305
  }
308
- if (null !== r) for (let e = 0; e < f.length; e++) {
306
+ if (null !== l) for (let e = 0; e < f.length; e++) {
309
307
  const t = f[e];
310
- r.append(t);
308
+ l.append(t);
311
309
  }
312
- let h = null;
313
- if ($isRootOrShadowRoot(u)) if (d) if (null !== r) u.insertAfter(r);
310
+ let y = null;
311
+ if ($isRootOrShadowRoot(g)) if (a) if (null !== l) g.insertAfter(l);
314
312
  else for (let e = f.length - 1; e >= 0; e--) {
315
313
  const t = f[e];
316
- u.insertAfter(t);
314
+ g.insertAfter(t);
317
315
  }
318
316
  else {
319
- const e = u.getFirstChild();
320
- if ($isElementNode(e) && (u = e), null === e) if (r) u.append(r);
321
- else for (let e = 0; e < f.length; e++) {
322
- const t = f[e];
323
- u.append(t), h = t;
324
- }
325
- else if (null !== r) e.insertBefore(r);
317
+ const e = g, t = e.getFirstChild();
318
+ if ($isElementNode(t) && (g = t), null === t) if (l) e.append(l);
326
319
  else for (let t = 0; t < f.length; t++) {
327
320
  const n = f[t];
328
- e.insertBefore(n), h = n;
321
+ e.append(n), y = n;
322
+ }
323
+ else if (null !== l) t.insertBefore(l);
324
+ else for (let e = 0; e < f.length; e++) {
325
+ const n = f[e];
326
+ t.insertBefore(n), y = n;
329
327
  }
330
328
  }
331
- else if (r) u.insertAfter(r);
329
+ else if (l) g.insertAfter(l);
332
330
  else for (let e = f.length - 1; e >= 0; e--) {
333
331
  const t = f[e];
334
- u.insertAfter(t), h = t;
332
+ g.insertAfter(t), y = t;
335
333
  }
336
- const y = $getPreviousSelection();
337
- $isRangeSelection(y) && H(y.anchor) && H(y.focus) ? $setSelection(y.clone()) : null !== h ? h.selectEnd() : e.dirty = !0;
334
+ const m = $getPreviousSelection();
335
+ $isRangeSelection(m) && V(m.anchor) && V(m.focus) ? $setSelection(m.clone()) : null !== y ? y.selectEnd() : e.dirty = !0;
338
336
  }
339
- function q(e) {
340
- const t = G(e);
337
+ function G(e) {
338
+ const t = J(e);
341
339
  return null !== t && "vertical-rl" === t.writingMode;
342
340
  }
343
- function G(e) {
341
+ function J(e) {
344
342
  const t = e.anchor.getNode();
345
- return $isElementNode(t) ? b(t) : k(t);
343
+ return $isElementNode(t) ? k(t) : z(t);
346
344
  }
347
- function J(e, t) {
348
- let n = q(e) ? !t : t;
349
- Y(e) && (n = !n);
345
+ function Q(e, t) {
346
+ let n = G(e) ? !t : t;
347
+ Z(e) && (n = !n);
350
348
  const o = $caretFromPoint(e.focus, n ? "previous" : "next");
351
349
  if ($isExtendableTextPointCaret(o)) return !1;
352
350
  for (const e of $extendCaretToRange(o)) {
@@ -358,47 +356,47 @@ function J(e, t) {
358
356
  }
359
357
  return !1;
360
358
  }
361
- function Q(e, t, n, o) {
359
+ function Y(e, t, n, o) {
362
360
  e.modify(t ? "extend" : "move", n, o);
363
361
  }
364
- function Y(e) {
365
- const t = G(e);
362
+ function Z(e) {
363
+ const t = J(e);
366
364
  return null !== t && "rtl" === t.direction;
367
365
  }
368
- function Z(e, t, n) {
369
- const o = Y(e);
366
+ function ee(e, t, n) {
367
+ const o = Z(e);
370
368
  let l;
371
- l = q(e) || o ? !n : n, Q(e, t, l, "character");
369
+ l = G(e) || o ? !n : n, Y(e, t, l, "character");
372
370
  }
373
- function ee(e, t, n) {
371
+ function te(e, t, n) {
374
372
  const l = getStyleObjectFromCSS(e.getStyle());
375
373
  return null !== l && l[t] || n;
376
374
  }
377
- function te(t, n, o = "") {
378
- let r = null;
379
- const i = t.getNodes();
375
+ function ne(e, n, o = "") {
376
+ let l = null;
377
+ const i = e.getNodes();
380
378
  let s, c;
381
- if ($isRangeSelection(t)) {
382
- if (t.isCollapsed() && "" !== t.style) {
383
- const e = getStyleObjectFromCSS(t.style);
384
- if (null !== e && n in e) return e[n];
379
+ if ($isRangeSelection(e)) {
380
+ if (e.isCollapsed() && "" !== e.style) {
381
+ const t = getStyleObjectFromCSS(e.style);
382
+ if (null !== t && n in t) return t[n];
385
383
  }
386
- const { anchor: o, focus: l } = t, r = t.isBackward(), i = r ? l.getNode() : o.getNode(), f = r ? o.getNode() : l.getNode(), u = r ? l.offset : o.offset, g = r ? o.offset : l.offset;
384
+ const { anchor: o, focus: l } = e, r = e.isBackward(), i = r ? l.getNode() : o.getNode(), f = r ? o.getNode() : l.getNode(), u = r ? l.offset : o.offset, g = r ? o.offset : l.offset;
387
385
  $isTextNode(i) && u === i.getTextContentSize() && (s = i), 0 === g && (c = f);
388
386
  }
389
- for (let t = 0; t < i.length; t++) {
390
- const l = i[t];
391
- if ($isTextNode(l) && !l.is(0 === t ? s : c)) {
392
- const e = ee(l, n, o);
393
- if (null === r) r = e;
394
- else if (r !== e) {
395
- r = "";
387
+ for (let e = 0; e < i.length; e++) {
388
+ const r = i[e];
389
+ if ($isTextNode(r) && !r.is(0 === e ? s : c)) {
390
+ const e = te(r, n, o);
391
+ if (null === l) l = e;
392
+ else if (l !== e) {
393
+ l = "";
396
394
  break;
397
395
  }
398
396
  }
399
397
  }
400
- return null === r ? o : r;
398
+ return null === l ? o : l;
401
399
  }
402
- const ne = getStyleObjectFromCSS, oe = A;
400
+ const oe = getStyleObjectFromCSS, le = _;
403
401
  //#endregion
404
- export { _ as $addNodeStyle, $cloneWithProperties, j as $copyBlockFormatIndent, D as $ensureForwardRangeSelection, $ as $forEachSelectedTextNode, b as $getComputedStyleForElement, k as $getComputedStyleForParent, te as $getSelectionStyleValueForProperty, R as $isAtNodeEnd, Y as $isParentElementRTL, z as $isParentRTL, Q as $moveCaretSelection, Z as $moveCharacter, M as $patchStyleText, $selectAll, U as $setBlocksType, J as $shouldOverrideDefaultCharacterSelection, O as $sliceSelectedTextNodeContent, A as $trimTextContentFromAnchor, W as $wrapNodes, I as createDOMRange, B as createRectsFromDOMRange, F as getCSSFromStyleObject, ne as getStyleObjectFromCSS, oe as trimTextContentFromAnchor };
402
+ export { L as $addNodeStyle, $cloneWithProperties, U as $copyBlockFormatIndent, j as $ensureForwardRangeSelection, D as $forEachSelectedTextNode, k as $getComputedStyleForElement, z as $getComputedStyleForParent, ne as $getSelectionStyleValueForProperty, A as $isAtNodeEnd, Z as $isParentElementRTL, R as $isParentRTL, Y as $moveCaretSelection, ee as $moveCharacter, $ as $patchStyleText, $selectAll, H as $setBlocksType, Q as $shouldOverrideDefaultCharacterSelection, O as $sliceSelectedTextNodeContent, _ as $trimTextContentFromAnchor, X as $wrapNodes, B as createDOMRange, F as createRectsFromDOMRange, b as getCSSFromStyleObject, oe as getStyleObjectFromCSS, le as trimTextContentFromAnchor };