@mx-space/cli 0.7.8 → 0.9.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 (68) hide show
  1. package/README.md +30 -0
  2. package/ROADMAP.md +1 -0
  3. package/dist/{Lexical.dev-rcxzwpir.mjs → Lexical.dev-By5dOKBN.mjs} +1486 -356
  4. package/dist/{Lexical.node-BUsI9gWr.mjs → Lexical.node-fXM8Jp7p.mjs} +39 -17
  5. package/dist/{Lexical.prod-C8HtkSD6.mjs → Lexical.prod-BlCvXPGa.mjs} +2279 -1768
  6. package/dist/LexicalClipboard.dev--HxGoSkO.mjs +915 -0
  7. package/dist/{LexicalClipboard.node-CO-MCKx5.mjs → LexicalClipboard.node-C3mRbrmW.mjs} +10 -3
  8. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +371 -0
  9. package/dist/LexicalCodeCore.dev-DjSrd4A4.mjs +1109 -0
  10. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +642 -0
  11. package/dist/{LexicalDragon.dev-gBP8WSRS.mjs → LexicalDragon.dev-DwprRH0z.mjs} +3 -3
  12. package/dist/{LexicalDragon.node-OG6G55nl.mjs → LexicalDragon.node-BVhw4C7s.mjs} +2 -2
  13. package/dist/{LexicalDragon.prod-DP-_Q8cv.mjs → LexicalDragon.prod-nh4J-8vn.mjs} +3 -3
  14. package/dist/{LexicalExtension.dev-DVbjljrm.mjs → LexicalExtension.dev-BPNyvGqe.mjs} +335 -6
  15. package/dist/{LexicalExtension.node-CF3EAPN7.mjs → LexicalExtension.node-BVlcrgOx.mjs} +15 -8
  16. package/dist/{LexicalExtension.prod-DklHHErZ.mjs → LexicalExtension.prod-DFKbiNt-.mjs} +375 -265
  17. package/dist/{LexicalHeadless.dev-DdWLM7Nl.mjs → LexicalHeadless.dev-B-cj7Pr5.mjs} +2 -2
  18. package/dist/{LexicalHeadless.prod-CoiiTDzR.mjs → LexicalHeadless.prod-Byp1vNzT.mjs} +2 -2
  19. package/dist/LexicalHtml.dev-prBAwszN.mjs +2424 -0
  20. package/dist/LexicalHtml.node-BvNF96jZ.mjs +56 -0
  21. package/dist/LexicalHtml.prod-Sz3CW1ht.mjs +1207 -0
  22. package/dist/{LexicalLink.dev-BS1Bf-yD.mjs → LexicalLink.dev-NySTYhVR.mjs} +42 -8
  23. package/dist/{LexicalLink.prod-B_crkoHP.mjs → LexicalLink.prod-BuCM8gts.mjs} +209 -191
  24. package/dist/{LexicalList.dev-OMqmcnQ-.mjs → LexicalList.dev-DIMOvSFD.mjs} +252 -80
  25. package/dist/{LexicalList.prod-CpL1s8vS.mjs → LexicalList.prod-MVqfA6Vo.mjs} +364 -278
  26. package/dist/{LexicalMarkdown.dev-BHSdx_Gr.mjs → LexicalMarkdown.dev-C7aylvCG.mjs} +729 -552
  27. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +868 -0
  28. package/dist/{LexicalRichText.dev-Bz9A_WbM.mjs → LexicalRichText.dev-DfICq6lU.mjs} +272 -77
  29. package/dist/{LexicalRichText.node-DDpwfE-P.mjs → LexicalRichText.node-Bg9jND3Q.mjs} +21 -8
  30. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +550 -0
  31. package/dist/{LexicalSelection.dev-CQ380fnD.mjs → LexicalSelection.dev-DGjj12wW.mjs} +50 -38
  32. package/dist/{LexicalSelection.node-DesBMjIE.mjs → LexicalSelection.node-BU5L4193.mjs} +4 -4
  33. package/dist/{LexicalSelection.prod-D2jivCDB.mjs → LexicalSelection.prod-D-PwRbyK.mjs} +158 -140
  34. package/dist/{LexicalTable.dev-Ca7mQ7Jk.mjs → LexicalTable.dev-ChP7cugd.mjs} +215 -53
  35. package/dist/{LexicalTable.prod-DyPAcC7y.mjs → LexicalTable.prod-Bpr9YRXp.mjs} +668 -573
  36. package/dist/{LexicalUtils.dev-HxM8F0g6.mjs → LexicalUtils.dev-BiFU3789.mjs} +10 -47
  37. package/dist/{LexicalUtils.node-lCWjRjoG.mjs → LexicalUtils.node-j3Llm7Y3.mjs} +2 -2
  38. package/dist/{LexicalUtils.prod-Bti5w4ki.mjs → LexicalUtils.prod-DCvrA78p.mjs} +103 -105
  39. package/dist/bin/mxs.d.mts +1 -1
  40. package/dist/bin/mxs.mjs +1 -1
  41. package/dist/esm-By7trG9K.mjs +2 -0
  42. package/dist/{esm-CK9m5JKX.mjs → esm-Dg-WhPCe.mjs} +989 -989
  43. package/dist/index.d.mts +11 -2
  44. package/dist/index.mjs +1 -1
  45. package/dist/{mxs-BZt1cLW9.mjs → mxs-BR5Y5ash.mjs} +25141 -24672
  46. package/package.json +15 -14
  47. package/skills/commands-auth.md +1 -1
  48. package/skills/commands-category.md +1 -1
  49. package/skills/commands-comment.md +1 -1
  50. package/skills/commands-config.md +1 -1
  51. package/skills/commands-preview.md +1 -1
  52. package/skills/commands-profile.md +1 -1
  53. package/skills/commands-project.md +57 -0
  54. package/skills/commands-topic.md +1 -1
  55. package/skills/output-modes.md +1 -1
  56. package/skills/overview.md +2 -1
  57. package/skills/safety.md +10 -0
  58. package/dist/LexicalClipboard.dev-BpqRwTLP.mjs +0 -494
  59. package/dist/LexicalClipboard.prod-B_xdeiAC.mjs +0 -291
  60. package/dist/LexicalCodeCore.dev-7_cexm39.mjs +0 -537
  61. package/dist/LexicalCodeCore.prod-Bd6WFHcO.mjs +0 -381
  62. package/dist/LexicalHtml.dev-C3ZSWBFZ.mjs +0 -684
  63. package/dist/LexicalHtml.node-D0TD152E.mjs +0 -24
  64. package/dist/LexicalHtml.prod-CX47X0zl.mjs +0 -430
  65. package/dist/LexicalMarkdown.prod-C-S7Ii6-.mjs +0 -754
  66. package/dist/LexicalRichText.prod-C8qXACDL.mjs +0 -427
  67. package/dist/esm-DRbkkY3r.mjs +0 -2
  68. /package/dist/{mxs-CM8-6uAr.d.mts → mxs-iqJBopvE.d.mts} +0 -0
@@ -1,5 +1,5 @@
1
- import { $t as INTERNAL_$isBlock, E as $getCharacterOffsets, K as $isChildCaret, L as $getPreviousSelection, Ln as getStyleObjectFromCSS, P as $getNodeByKey, Q as $isLeafNode, U as $hasAncestor, X as $isExtendableTextPointCaret, Y as $isElementNode, _ as $createTextNode, a as $cloneWithProperties, at as $isRootOrShadowRoot, ct as $isTextNode, gt as $selectAll, i as $caretRangeFromSelection, it as $isRootNode, j as $getEditor, m as $createRangeSelection, o as $cloneWithPropertiesEphemeral, q as $isDecoratorNode, r as $caretFromPoint, rt as $isRangeSelection, ut as $isTokenOrSegmented, v as $extendCaretToRange, vt as $setSelection, y as $findMatchingParent, z as $getSelection } from "./Lexical.node-BUsI9gWr.mjs";
2
- //#region ../../node_modules/.pnpm/@lexical+selection@0.44.0/node_modules/@lexical/selection/LexicalSelection.prod.mjs
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
3
3
  /**
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -7,13 +7,13 @@ import { $t as INTERNAL_$isBlock, E as $getCharacterOffsets, K as $isChildCaret,
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  *
9
9
  */
10
- function E(e, ...t) {
10
+ function P(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 P(e) {
16
+ function K(e) {
17
17
  let t = e;
18
18
  for (; null != t;) {
19
19
  if (t.nodeType === Node.TEXT_NODE) return t;
@@ -21,39 +21,39 @@ function P(e) {
21
21
  }
22
22
  return null;
23
23
  }
24
- function k(e) {
24
+ function E(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
29
  function I(t, n, o, l, r) {
30
- const s = n.getKey(), i = l.getKey(), c = document.createRange();
31
- let f = t.getElementByKey(s), u = t.getElementByKey(i), g = o, a = r;
32
- if ($isTextNode(n) && (f = P(f)), $isTextNode(l) && (u = P(u)), void 0 === n || void 0 === l || null === f || null === u) return null;
33
- "BR" === f.nodeName && ([f, g] = k(f)), "BR" === u.nodeName && ([u, a] = k(u));
34
- const d = f.firstChild;
35
- f === u && null != d && "BR" === d.nodeName && 0 === g && 0 === a && (a = 1);
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);
36
36
  try {
37
- c.setStart(f, g), c.setEnd(u, a);
37
+ c.setStart(f, g), c.setEnd(u, d);
38
38
  } catch (e) {
39
39
  return null;
40
40
  }
41
- return !c.collapsed || g === a && s === i || (c.setStart(u, a), c.setEnd(f, g)), c;
41
+ return !c.collapsed || g === d && i === s || (c.setStart(u, d), c.setEnd(f, g)), c;
42
42
  }
43
43
  function B(e, t) {
44
44
  const n = e.getRootElement();
45
45
  if (null === n) return [];
46
- const o = n.getBoundingClientRect(), l = getComputedStyle(n), r = parseFloat(l.paddingLeft) + parseFloat(l.paddingRight), s = Array.from(t.getClientRects());
47
- let i, c = s.length;
48
- s.sort((e, t) => {
46
+ const o = n.getBoundingClientRect(), l = getComputedStyle(n), r = parseFloat(l.paddingLeft) + parseFloat(l.paddingRight), i = Array.from(t.getClientRects());
47
+ let s, c = i.length;
48
+ i.sort((e, t) => {
49
49
  const n = e.top - t.top;
50
50
  return Math.abs(n) <= 3 ? e.left - t.left : n;
51
51
  });
52
52
  for (let e = 0; e < c; e++) {
53
- const t = s[e], n = i && i.top <= t.top && i.top + i.height > t.top && i.left + i.width > t.left, l = t.width + r === o.width;
54
- n || l ? (s.splice(e--, 1), c--) : i = t;
53
+ const t = i[e], n = s && s.top <= t.top && s.top + s.height > t.top && s.left + s.width > t.left, l = t.width + r === o.width;
54
+ n || l ? (i.splice(e--, 1), c--) : s = t;
55
55
  }
56
- return s;
56
+ return i;
57
57
  }
58
58
  function F(e) {
59
59
  let t = "";
@@ -66,48 +66,48 @@ function b(e) {
66
66
  const o = n.ownerDocument.defaultView;
67
67
  return null === o ? null : o.getComputedStyle(n);
68
68
  }
69
- function z(e) {
69
+ function k(e) {
70
70
  return b($isRootNode(e) ? e : e.getParentOrThrow());
71
71
  }
72
- function O(e) {
73
- const t = z(e);
72
+ function z(e) {
73
+ const t = k(e);
74
74
  return null !== t && "rtl" === t.direction;
75
75
  }
76
- function R(e, t, n = "self") {
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, s = e.isBackward(), i = l.getNode(), u = r.getNode(), g = t.is(i), a = t.is(u);
80
- if (g || a) {
81
- const [o, l] = $getCharacterOffsets(e), r = i.is(u), g = t.is(s ? u : i), a = t.is(s ? i : u);
82
- let d, p = 0;
83
- if (r) p = o > l ? l : o, d = o > l ? o : l;
84
- else if (g) p = s ? l : o, d = void 0;
85
- else if (a) p = 0, d = s ? o : l;
86
- const h = t.__text.slice(p, d);
79
+ const [l, r] = o, i = e.isBackward(), s = l.getNode(), u = r.getNode(), g = t.is(s), d = t.is(u);
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);
82
+ let a, p = 0;
83
+ if (r) p = o > l ? l : o, a = o > l ? o : l;
84
+ else if (g) p = i ? l : o, a = void 0;
85
+ else if (d) p = 0, a = i ? o : l;
86
+ const h = t.__text.slice(p, a);
87
87
  h !== t.__text && ("clone" === n && (t = $cloneWithPropertiesEphemeral(t)), t.__text = h);
88
88
  }
89
89
  }
90
90
  return t;
91
91
  }
92
- function A(e) {
92
+ function R(e) {
93
93
  if ("text" === e.type) return e.offset === e.getNode().getTextContentSize();
94
94
  const t = e.getNode();
95
- return $isElementNode(t) || E(177), e.offset === t.getChildrenSize();
95
+ return $isElementNode(t) || P(177), e.offset === t.getChildrenSize();
96
96
  }
97
- function _(t, o, r) {
98
- let s = o.getNode(), c = r;
99
- if ($isElementNode(s)) {
100
- const e = s.getDescendantByIndex(o.offset);
101
- null !== e && (s = e);
97
+ function A(t, o, r) {
98
+ let i = o.getNode(), c = r;
99
+ if ($isElementNode(i)) {
100
+ const e = i.getDescendantByIndex(o.offset);
101
+ null !== e && (i = e);
102
102
  }
103
- for (; c > 0 && null !== s;) {
104
- if ($isElementNode(s)) {
105
- const e = s.getLastDescendant();
106
- null !== e && (s = e);
103
+ for (; c > 0 && null !== i;) {
104
+ if ($isElementNode(i)) {
105
+ const e = i.getLastDescendant();
106
+ null !== e && (i = e);
107
107
  }
108
- let r = s.getPreviousSibling(), f = 0;
108
+ let r = i.getPreviousSibling(), f = 0;
109
109
  if (null === r) {
110
- let e = s.getParentOrThrow(), t = e.getPreviousSibling();
110
+ let e = i.getParentOrThrow(), t = e.getPreviousSibling();
111
111
  for (; null === t;) {
112
112
  if (e = e.getParent(), null === e) {
113
113
  r = null;
@@ -117,63 +117,63 @@ function _(t, o, r) {
117
117
  }
118
118
  null !== e && (f = e.isInline() ? 0 : 2, r = t);
119
119
  }
120
- let d = s.getTextContent();
121
- "" === d && $isElementNode(s) && !s.isInline() && (d = "\n\n");
122
- const p = d.length;
123
- if (!$isTextNode(s) || c >= p) {
124
- const e = s.getParent();
125
- s.remove(), null == e || 0 !== e.getChildrenSize() || $isRootNode(e) || e.remove(), c -= p + f, s = r;
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) {
124
+ const e = i.getParent();
125
+ i.remove(), null == e || 0 !== e.getChildrenSize() || $isRootNode(e) || e.remove(), c -= p + f, i = r;
126
126
  } else {
127
- const n = s.getKey(), r = t.getEditorState().read(() => {
127
+ const n = i.getKey(), r = t.getEditorState().read(() => {
128
128
  const t = $getNodeByKey(n);
129
129
  return $isTextNode(t) && t.isSimpleText() ? t.getTextContent() : null;
130
- }), i = p - c, f = d.slice(0, i);
131
- if (null !== r && r !== d) {
130
+ }), s = p - c, f = a.slice(0, s);
131
+ if (null !== r && r !== a) {
132
132
  const e = $getPreviousSelection();
133
- let t = s;
134
- if (s.isSimpleText()) s.setTextContent(r);
133
+ let t = i;
134
+ if (i.isSimpleText()) i.setTextContent(r);
135
135
  else {
136
136
  const e = $createTextNode(r);
137
- s.replace(e), t = e;
137
+ i.replace(e), t = e;
138
138
  }
139
139
  if ($isRangeSelection(e) && e.isCollapsed()) {
140
140
  const n = e.anchor.offset;
141
141
  t.select(n, n);
142
142
  }
143
- } else if (s.isSimpleText()) {
143
+ } else if (i.isSimpleText()) {
144
144
  const e = o.key === n;
145
145
  let t = o.offset;
146
146
  t < c && (t = p);
147
- const l = e ? t - c : 0, r = e ? t : i;
147
+ const l = e ? t - c : 0, r = e ? t : s;
148
148
  if (e && 0 === l) {
149
- const [e] = s.splitText(l, r);
149
+ const [e] = i.splitText(l, r);
150
150
  e.remove();
151
151
  } else {
152
- const [, e] = s.splitText(l, r);
152
+ const [, e] = i.splitText(l, r);
153
153
  e.remove();
154
154
  }
155
155
  } else {
156
156
  const e = $createTextNode(f);
157
- s.replace(e);
157
+ i.replace(e);
158
158
  }
159
159
  c = 0;
160
160
  }
161
161
  }
162
162
  }
163
- const L = () => {};
164
- function M(t, n) {
165
- ($isRangeSelection(t) ? t.isCollapsed() : $isTextNode(t) || $isElementNode(t)) || E(280);
163
+ const _ = () => {};
164
+ function L(t, n) {
165
+ ($isRangeSelection(t) ? t.isCollapsed() : $isTextNode(t) || $isElementNode(t)) || P(280);
166
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
167
  $isRangeSelection(t) || $isTextNode(t) ? t.setStyle(r) : t.setTextStyle(r);
168
168
  }
169
- function $(e, t) {
169
+ function M(e, t) {
170
170
  if ($isRangeSelection(e) && e.isCollapsed()) {
171
- M(e, t);
171
+ L(e, t);
172
172
  const n = e.anchor.getNode();
173
- $isElementNode(n) && n.isEmpty() && M(n, t);
173
+ $isElementNode(n) && n.isEmpty() && L(n, t);
174
174
  }
175
- D((e) => {
176
- M(e, t);
175
+ $((e) => {
176
+ L(e, t);
177
177
  });
178
178
  const n = e.getNodes();
179
179
  if (n.length > 0) {
@@ -181,15 +181,15 @@ function $(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), M(o, t));
184
+ e.has(n) || (e.add(n), L(o, t));
185
185
  }
186
186
  }
187
187
  }
188
- function D(t) {
188
+ function $(t) {
189
189
  const n = $getSelection();
190
190
  if (!n) return;
191
- const i = /* @__PURE__ */ new Map(), c = (e) => i.get(e.getKey()) || [0, e.getTextContentSize()];
192
- if ($isRangeSelection(n)) for (const e of $caretRangeFromSelection(n).getTextSlices()) e && i.set(e.caret.origin.getKey(), e.getSliceIndices());
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());
193
193
  const f = n.getNodes();
194
194
  for (const n of f) {
195
195
  if (!$isTextNode(n) || !n.canHaveFormat()) continue;
@@ -197,82 +197,93 @@ function D(t) {
197
197
  if (l !== o) if ($isTokenOrSegmented(n) || 0 === o && l === n.getTextContentSize()) t(n);
198
198
  else t(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 && j(n);
200
+ $isRangeSelection(n) && "text" === n.anchor.type && "text" === n.focus.type && n.anchor.key === n.focus.key && D(n);
201
201
  }
202
- function j(e) {
202
+ function D(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 U(e, t) {
208
+ function j(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 H(e, t, n = U) {
213
- if (null === e) return;
214
- const l = e.getStartEndPoints(), r = /* @__PURE__ */ new Map();
215
- let s = null;
216
- if (l) {
217
- const [e, t] = l;
218
- s = $createRangeSelection(), s.anchor.set(e.key, e.offset, e.type), s.focus.set(t.key, t.offset, t.type);
219
- const n = $findMatchingParent(e.getNode(), INTERNAL_$isBlock), o = $findMatchingParent(t.getNode(), INTERNAL_$isBlock);
220
- $isElementNode(n) && r.set(n.getKey(), n), $isElementNode(o) && r.set(o.getKey(), o);
212
+ function U(e, t, n = j) {
213
+ if (!e) return;
214
+ const o = e.getStartEndPoints();
215
+ let l = !1, r = null;
216
+ const i = /* @__PURE__ */ new Map();
217
+ if (o) {
218
+ const [e, t] = o, n = $findMatchingParent(e.getNode(), INTERNAL_$isBlock);
219
+ r = $findMatchingParent(t.getNode(), INTERNAL_$isBlock), l = $isElementNode(r) && !r.is(n) && function(e, t) {
220
+ if (0 !== e.offset) return !1;
221
+ let n = e.getNode();
222
+ if ($isElementNode(n) && n.isEmpty()) return !1;
223
+ for (; !n.is(t);) {
224
+ if (null !== n.getPreviousSibling()) return !1;
225
+ const e = n.getParent();
226
+ if (null === e) return !1;
227
+ n = e;
228
+ }
229
+ return !0;
230
+ }(t, r), $isElementNode(n) && i.set(n.getKey(), n), $isElementNode(r) && !l && i.set(r.getKey(), r);
221
231
  }
222
- for (const t of e.getNodes()) if ($isElementNode(t) && INTERNAL_$isBlock(t)) r.set(t.getKey(), t);
223
- else if (null === l) {
232
+ for (const t of e.getNodes()) if ($isElementNode(t) && INTERNAL_$isBlock(t)) {
233
+ if (l && t.is(r)) continue;
234
+ i.set(t.getKey(), t);
235
+ } else if (!o) {
224
236
  const e = $findMatchingParent(t, INTERNAL_$isBlock);
225
- $isElementNode(e) && r.set(e.getKey(), e);
237
+ $isElementNode(e) && i.set(e.getKey(), e);
226
238
  }
227
- for (const [e, o] of r) {
228
- const l = t();
229
- n(o, l), o.replace(l, !0), s && (e === s.anchor.key && s.anchor.set(l.getKey(), s.anchor.offset, s.anchor.type), e === s.focus.key && s.focus.set(l.getKey(), s.focus.offset, s.focus.type));
239
+ for (const e of i.values()) {
240
+ const o = t();
241
+ n(e, o), e.replace(o, !0);
230
242
  }
231
- s && e.is($getSelection()) && $setSelection(s);
232
243
  }
233
- function V(e) {
244
+ function H(e) {
234
245
  return e.getNode().isAttached();
235
246
  }
236
- function W(e) {
247
+ function V(e) {
237
248
  let t = e;
238
249
  for (; null !== t && !$isRootOrShadowRoot(t);) {
239
250
  const e = t.getLatest(), n = t.getParent();
240
251
  0 === e.getChildrenSize() && t.remove(!0), t = n;
241
252
  }
242
253
  }
243
- function X(e, t, n = null) {
244
- const o = e.getStartEndPoints(), l = o ? o[0] : null, r = e.getNodes(), s = r.length;
245
- if (null !== l && (0 === s || 1 === s && "element" === l.type && 0 === l.getNode().getChildrenSize())) {
254
+ function W(e, t, n = null) {
255
+ const o = e.getStartEndPoints(), l = o ? o[0] : null, r = e.getNodes(), i = r.length;
256
+ if (null !== l && (0 === i || 1 === i && "element" === l.type && 0 === l.getNode().getChildrenSize())) {
246
257
  const e = "text" === l.type ? l.getNode().getParentOrThrow() : l.getNode(), o = e.getChildren();
247
258
  let r = t();
248
259
  r.setFormat(e.getFormatType()), r.setIndent(e.getIndent()), o.forEach((e) => r.append(e)), n && (r = n.append(r)), e.replace(r);
249
260
  return;
250
261
  }
251
- let i = null, c = [];
252
- for (let o = 0; o < s; o++) {
262
+ let s = null, c = [];
263
+ for (let o = 0; o < i; o++) {
253
264
  const l = r[o];
254
- $isRootOrShadowRoot(l) ? (q(e, c, c.length, t, n), c = [], i = l) : null === i || null !== i && $hasAncestor(l, i) ? c.push(l) : (q(e, c, c.length, t, n), c = [l]);
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]);
255
266
  }
256
- q(e, c, c.length, t, n);
267
+ X(e, c, c.length, t, n);
257
268
  }
258
- function q(e, t, n, o, r = null) {
269
+ function X(e, t, n, o, r = null) {
259
270
  if (0 === t.length) return;
260
- const s = t[0], c = /* @__PURE__ */ new Map(), f = [];
261
- let u = $isElementNode(s) ? s : s.getParentOrThrow();
271
+ const i = t[0], c = /* @__PURE__ */ new Map(), f = [];
272
+ let u = $isElementNode(i) ? i : i.getParentOrThrow();
262
273
  u.isInline() && (u = u.getParentOrThrow());
263
- let a = !1;
274
+ let d = !1;
264
275
  for (; null !== u;) {
265
276
  const e = u.getPreviousSibling();
266
277
  if (null !== e) {
267
- u = e, a = !0;
278
+ u = e, d = !0;
268
279
  break;
269
280
  }
270
281
  if (u = u.getParentOrThrow(), $isRootOrShadowRoot(u)) break;
271
282
  }
272
- const d = /* @__PURE__ */ new Set();
283
+ const a = /* @__PURE__ */ new Set();
273
284
  for (let e = 0; e < n; e++) {
274
285
  const n = t[e];
275
- $isElementNode(n) && 0 === n.getChildrenSize() && d.add(n.getKey());
286
+ $isElementNode(n) && 0 === n.getChildrenSize() && a.add(n.getKey());
276
287
  }
277
288
  const p = /* @__PURE__ */ new Set();
278
289
  for (let e = 0; e < n; e++) {
@@ -282,12 +293,14 @@ function q(e, t, n, o, r = null) {
282
293
  const e = l.getKey();
283
294
  if (void 0 === c.get(e)) {
284
295
  const t = o();
285
- t.setFormat(l.getFormatType()), t.setIndent(l.getIndent()), f.push(t), c.set(e, t), l.getChildren().forEach((e) => {
286
- t.append(e), p.add(e.getKey()), $isElementNode(e) && e.getChildrenKeys().forEach((e) => p.add(e));
287
- }), W(l);
296
+ t.setFormat(l.getFormatType()), t.setIndent(l.getIndent()), f.push(t), c.set(e, t);
297
+ const n = l.getChildren();
298
+ 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);
288
301
  }
289
- } else if (d.has(n.getKey())) {
290
- $isElementNode(n) || E(179);
302
+ } else if (a.has(n.getKey())) {
303
+ $isElementNode(n) || P(179);
291
304
  const e = o();
292
305
  e.setFormat(n.getFormatType()), e.setIndent(n.getIndent()), f.push(e), n.remove(!0);
293
306
  }
@@ -297,7 +310,7 @@ function q(e, t, n, o, r = null) {
297
310
  r.append(t);
298
311
  }
299
312
  let h = null;
300
- if ($isRootOrShadowRoot(u)) if (a) if (null !== r) u.insertAfter(r);
313
+ if ($isRootOrShadowRoot(u)) if (d) if (null !== r) u.insertAfter(r);
301
314
  else for (let e = f.length - 1; e >= 0; e--) {
302
315
  const t = f[e];
303
316
  u.insertAfter(t);
@@ -321,19 +334,19 @@ function q(e, t, n, o, r = null) {
321
334
  u.insertAfter(t), h = t;
322
335
  }
323
336
  const y = $getPreviousSelection();
324
- $isRangeSelection(y) && V(y.anchor) && V(y.focus) ? $setSelection(y.clone()) : null !== h ? h.selectEnd() : e.dirty = !0;
337
+ $isRangeSelection(y) && H(y.anchor) && H(y.focus) ? $setSelection(y.clone()) : null !== h ? h.selectEnd() : e.dirty = !0;
325
338
  }
326
- function G(e) {
327
- const t = J(e);
339
+ function q(e) {
340
+ const t = G(e);
328
341
  return null !== t && "vertical-rl" === t.writingMode;
329
342
  }
330
- function J(e) {
343
+ function G(e) {
331
344
  const t = e.anchor.getNode();
332
- return $isElementNode(t) ? b(t) : z(t);
345
+ return $isElementNode(t) ? b(t) : k(t);
333
346
  }
334
- function Q(e, t) {
335
- let n = G(e) ? !t : t;
336
- Z(e) && (n = !n);
347
+ function J(e, t) {
348
+ let n = q(e) ? !t : t;
349
+ Y(e) && (n = !n);
337
350
  const o = $caretFromPoint(e.focus, n ? "previous" : "next");
338
351
  if ($isExtendableTextPointCaret(o)) return !1;
339
352
  for (const e of $extendCaretToRange(o)) {
@@ -345,33 +358,38 @@ function Q(e, t) {
345
358
  }
346
359
  return !1;
347
360
  }
348
- function Y(e, t, n, o) {
361
+ function Q(e, t, n, o) {
349
362
  e.modify(t ? "extend" : "move", n, o);
350
363
  }
351
- function Z(e) {
352
- const t = J(e);
364
+ function Y(e) {
365
+ const t = G(e);
353
366
  return null !== t && "rtl" === t.direction;
354
367
  }
355
- function ee(e, t, n) {
356
- const o = Z(e);
368
+ function Z(e, t, n) {
369
+ const o = Y(e);
357
370
  let l;
358
- l = G(e) || o ? !n : n, Y(e, t, l, "character");
371
+ l = q(e) || o ? !n : n, Q(e, t, l, "character");
359
372
  }
360
- function te(e, t, n) {
373
+ function ee(e, t, n) {
361
374
  const l = getStyleObjectFromCSS(e.getStyle());
362
375
  return null !== l && l[t] || n;
363
376
  }
364
- function ne(t, n, o = "") {
377
+ function te(t, n, o = "") {
365
378
  let r = null;
366
- const s = t.getNodes(), i = t.anchor, c = t.focus, f = t.isBackward(), u = f ? c.getNode() : i.getNode(), g = f ? i.getNode() : c.getNode(), a = f ? c.offset : i.offset, p = f ? i.offset : c.offset;
367
- if ($isRangeSelection(t) && t.isCollapsed() && "" !== t.style) {
368
- const e = t.style, o = getStyleObjectFromCSS(e);
369
- if (null !== o && n in o) return o[n];
379
+ const i = t.getNodes();
380
+ 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];
385
+ }
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;
387
+ $isTextNode(i) && u === i.getTextContentSize() && (s = i), 0 === g && (c = f);
370
388
  }
371
- for (let t = 0; t < s.length; t++) {
372
- const l = s[t];
373
- if ((0 !== t || !l.is(u) || !$isTextNode(l) || a !== l.getTextContentSize()) && (0 === t || !l.is(g) || 0 !== p) && $isTextNode(l)) {
374
- const e = te(l, n, o);
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);
375
393
  if (null === r) r = e;
376
394
  else if (r !== e) {
377
395
  r = "";
@@ -381,6 +399,6 @@ function ne(t, n, o = "") {
381
399
  }
382
400
  return null === r ? o : r;
383
401
  }
384
- const oe = getStyleObjectFromCSS, le = _;
402
+ const ne = getStyleObjectFromCSS, oe = A;
385
403
  //#endregion
386
- export { L as $addNodeStyle, $cloneWithProperties, U as $copyBlockFormatIndent, j as $ensureForwardRangeSelection, D as $forEachSelectedTextNode, b as $getComputedStyleForElement, z as $getComputedStyleForParent, ne as $getSelectionStyleValueForProperty, A as $isAtNodeEnd, Z as $isParentElementRTL, O as $isParentRTL, Y as $moveCaretSelection, ee as $moveCharacter, $ as $patchStyleText, $selectAll, H as $setBlocksType, Q as $shouldOverrideDefaultCharacterSelection, R as $sliceSelectedTextNodeContent, _ as $trimTextContentFromAnchor, X as $wrapNodes, I as createDOMRange, B as createRectsFromDOMRange, F as getCSSFromStyleObject, oe as getStyleObjectFromCSS, le as trimTextContentFromAnchor };
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 };