@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.
- package/README.md +60 -1
- package/ROADMAP.md +11 -8
- package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-DTxuYHmG.mjs} +2267 -431
- package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-BlCLnfA6.mjs} +47 -10
- package/dist/Lexical.prod-CeB9UQuo.mjs +6816 -0
- package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-CdFkLR_D.mjs} +131 -39
- package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-ktUajxsv.mjs} +2 -2
- package/dist/LexicalClipboard.prod-DliyLofW.mjs +429 -0
- package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-CL9tHWJX.mjs} +81 -67
- package/dist/LexicalCodeCore.prod-BoMSJc29.mjs +651 -0
- package/dist/LexicalDragon.dev-CqW7Aq5H.mjs +186 -0
- package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-DLXctJyy.mjs} +3 -2
- package/dist/LexicalDragon.prod-DHI3T6n5.mjs +121 -0
- package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-BP-18zns.mjs} +352 -38
- package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-BWH6xbzG.mjs} +9 -4
- package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-Cs6OgrDn.mjs} +479 -330
- package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-DJp__UcP.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-o0v9cIu5.mjs} +2 -2
- package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-DoymwFpG.mjs} +327 -269
- package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-CVkbWtUA.mjs} +6 -4
- package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-C2b3z99k.mjs} +355 -353
- package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-7cgLOLIe.mjs} +70 -59
- package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-DWFgoXHR.mjs} +211 -212
- package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-Ci2iOxFx.mjs} +246 -198
- package/dist/LexicalList.prod-D0xX5d3G.mjs +944 -0
- package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-C0ZYCyuR.mjs} +130 -38
- package/dist/LexicalMarkdown.prod-0M-Nc-rh.mjs +932 -0
- package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-Cnr1kDym.mjs} +151 -122
- package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-BUJZAiap.mjs} +8 -11
- package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +538 -0
- package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-C4L7l8OB.mjs} +10 -9
- package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-CLKroUMQ.mjs} +4 -4
- package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-DzFqpTlw.mjs} +144 -146
- package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-Cc9-zqKa.mjs} +186 -121
- package/dist/LexicalTable.prod-BgO4nCxy.mjs +2336 -0
- package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-BRgK0L6G.mjs} +375 -35
- package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-BVAwOkL4.mjs} +24 -12
- package/dist/LexicalUtils.prod-C1gtvVDP.mjs +504 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/{esm-DFrz5rIo.mjs → esm-BNu4sUWV.mjs} +220 -185
- package/dist/esm-jbwcVZth.mjs +2 -0
- package/dist/index.d.mts +46 -17
- package/dist/index.mjs +1 -1
- package/dist/{mxs-DXpzbUf4.mjs → mxs-zPvjkoNC.mjs} +8235 -6041
- package/dist/vendor/litexml/cli.mjs +24150 -0
- package/dist/vendor/litexml/litexml-html-preview-client.css +8862 -0
- package/dist/vendor/litexml/litexml-html-preview-client.js +163816 -0
- package/dist/vendor/litexml/style.css +96 -0
- package/package.json +21 -22
- package/skills/commands-ai.md +115 -0
- package/skills/commands-preview.md +3 -3
- package/skills/overview.md +1 -0
- package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
- package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
- package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
- package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
- package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
- package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
- package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
- package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
- package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
- package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
- package/dist/esm-DXO9Afik.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region ../../node_modules/.pnpm/@lexical+selection@0.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
if ($isTextNode(
|
|
33
|
-
"BR" ===
|
|
34
|
-
const
|
|
35
|
-
|
|
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
|
-
|
|
37
|
+
f.setStart(u, d), f.setEnd(g, a);
|
|
38
38
|
} catch (e) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
return !
|
|
41
|
+
return !f.collapsed || d === a && s === c || (f.setStart(g, a), f.setEnd(u, d)), f;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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(),
|
|
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(
|
|
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
|
|
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) ||
|
|
95
|
+
return $isElementNode(t) || K(177), e.offset === t.getChildrenSize();
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
let i =
|
|
97
|
+
function _(e, n, l) {
|
|
98
|
+
let i = n.getNode(), s = l;
|
|
99
99
|
if ($isElementNode(i)) {
|
|
100
|
-
const e = i.getDescendantByIndex(
|
|
100
|
+
const e = i.getDescendantByIndex(n.offset);
|
|
101
101
|
null !== e && (i = e);
|
|
102
102
|
}
|
|
103
|
-
for (;
|
|
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
|
|
109
|
-
if (null ===
|
|
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
|
-
|
|
113
|
+
l = null;
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
t = e.getPreviousSibling();
|
|
117
117
|
}
|
|
118
|
-
null !== e && (f = e.isInline() ? 0 : 2,
|
|
118
|
+
null !== e && (f = e.isInline() ? 0 : 2, l = t);
|
|
119
119
|
}
|
|
120
|
-
let
|
|
121
|
-
"" ===
|
|
122
|
-
const p =
|
|
123
|
-
if (!$isTextNode(i) ||
|
|
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(),
|
|
125
|
+
i.remove(), null == e || 0 !== e.getChildrenSize() || $isRootNode(e) || e.remove(), s -= p + f, i = l;
|
|
126
126
|
} else {
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
return $isTextNode(
|
|
130
|
-
}),
|
|
131
|
-
if (null !==
|
|
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(
|
|
134
|
+
if (i.isSimpleText()) i.setTextContent(l);
|
|
135
135
|
else {
|
|
136
|
-
const e = $createTextNode(
|
|
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 =
|
|
145
|
-
let t =
|
|
146
|
-
t <
|
|
147
|
-
const l = e ? t -
|
|
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
|
-
|
|
159
|
+
s = 0;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const
|
|
164
|
-
function
|
|
165
|
-
($isRangeSelection(
|
|
166
|
-
const o = getStyleObjectFromCSS($isRangeSelection(
|
|
167
|
-
$isRangeSelection(
|
|
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
|
|
169
|
+
function $(e, t) {
|
|
170
170
|
if ($isRangeSelection(e) && e.isCollapsed()) {
|
|
171
|
-
|
|
171
|
+
M(e, t);
|
|
172
172
|
const n = e.anchor.getNode();
|
|
173
|
-
$isElementNode(n) && n.isEmpty() &&
|
|
173
|
+
$isElementNode(n) && n.isEmpty() && M(n, t);
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
|
|
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),
|
|
184
|
+
e.has(n) || (e.add(n), M(o, t));
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function D(e) {
|
|
189
189
|
const n = $getSelection();
|
|
190
190
|
if (!n) return;
|
|
191
|
-
const
|
|
192
|
-
if ($isRangeSelection(n)) for (const e of $caretRangeFromSelection(n).getTextSlices()) e &&
|
|
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())
|
|
198
|
-
else
|
|
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 &&
|
|
200
|
+
$isRangeSelection(n) && "text" === n.anchor.type && "text" === n.focus.type && n.anchor.key === n.focus.key && j(n);
|
|
201
201
|
}
|
|
202
|
-
function
|
|
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
|
|
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
|
|
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
|
|
244
|
+
function V(e) {
|
|
245
245
|
return e.getNode().isAttached();
|
|
246
246
|
}
|
|
247
|
-
function
|
|
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
|
|
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) ? (
|
|
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
|
-
|
|
267
|
+
q(e, c, c.length, t, n);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function q(e, t, n, o, l = null) {
|
|
270
270
|
if (0 === t.length) return;
|
|
271
|
-
const i = t[0],
|
|
272
|
-
let
|
|
273
|
-
|
|
274
|
-
|
|
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
|
-
|
|
276
|
+
g = e, a = !0;
|
|
279
277
|
break;
|
|
280
278
|
}
|
|
281
|
-
if (
|
|
279
|
+
if (g = g.getParentOrThrow(), $isRootOrShadowRoot(g)) break;
|
|
282
280
|
}
|
|
283
|
-
const
|
|
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() &&
|
|
284
|
+
$isElementNode(n) && 0 === n.getChildrenSize() && p.add(n.getKey());
|
|
287
285
|
}
|
|
288
|
-
const
|
|
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) && !
|
|
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 ===
|
|
292
|
+
if (void 0 === s.get(e)) {
|
|
295
293
|
const t = o();
|
|
296
|
-
t.setFormat(l.getFormatType()), t.setIndent(l.getIndent()), f.push(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 (
|
|
300
|
-
|
|
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 (
|
|
303
|
-
$isElementNode(n) ||
|
|
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 !==
|
|
306
|
+
if (null !== l) for (let e = 0; e < f.length; e++) {
|
|
309
307
|
const t = f[e];
|
|
310
|
-
|
|
308
|
+
l.append(t);
|
|
311
309
|
}
|
|
312
|
-
let
|
|
313
|
-
if ($isRootOrShadowRoot(
|
|
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
|
-
|
|
314
|
+
g.insertAfter(t);
|
|
317
315
|
}
|
|
318
316
|
else {
|
|
319
|
-
const e =
|
|
320
|
-
if ($isElementNode(
|
|
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.
|
|
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 (
|
|
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
|
-
|
|
332
|
+
g.insertAfter(t), y = t;
|
|
335
333
|
}
|
|
336
|
-
const
|
|
337
|
-
$isRangeSelection(
|
|
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
|
|
340
|
-
const t =
|
|
337
|
+
function G(e) {
|
|
338
|
+
const t = J(e);
|
|
341
339
|
return null !== t && "vertical-rl" === t.writingMode;
|
|
342
340
|
}
|
|
343
|
-
function
|
|
341
|
+
function J(e) {
|
|
344
342
|
const t = e.anchor.getNode();
|
|
345
|
-
return $isElementNode(t) ?
|
|
343
|
+
return $isElementNode(t) ? k(t) : z(t);
|
|
346
344
|
}
|
|
347
|
-
function
|
|
348
|
-
let n =
|
|
349
|
-
|
|
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
|
|
359
|
+
function Y(e, t, n, o) {
|
|
362
360
|
e.modify(t ? "extend" : "move", n, o);
|
|
363
361
|
}
|
|
364
|
-
function
|
|
365
|
-
const t =
|
|
362
|
+
function Z(e) {
|
|
363
|
+
const t = J(e);
|
|
366
364
|
return null !== t && "rtl" === t.direction;
|
|
367
365
|
}
|
|
368
|
-
function
|
|
369
|
-
const o =
|
|
366
|
+
function ee(e, t, n) {
|
|
367
|
+
const o = Z(e);
|
|
370
368
|
let l;
|
|
371
|
-
l =
|
|
369
|
+
l = G(e) || o ? !n : n, Y(e, t, l, "character");
|
|
372
370
|
}
|
|
373
|
-
function
|
|
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
|
|
378
|
-
let
|
|
379
|
-
const i =
|
|
375
|
+
function ne(e, n, o = "") {
|
|
376
|
+
let l = null;
|
|
377
|
+
const i = e.getNodes();
|
|
380
378
|
let s, c;
|
|
381
|
-
if ($isRangeSelection(
|
|
382
|
-
if (
|
|
383
|
-
const
|
|
384
|
-
if (null !==
|
|
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 } =
|
|
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
|
|
390
|
-
const
|
|
391
|
-
if ($isTextNode(
|
|
392
|
-
const e =
|
|
393
|
-
if (null ===
|
|
394
|
-
else if (
|
|
395
|
-
|
|
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 ===
|
|
398
|
+
return null === l ? o : l;
|
|
401
399
|
}
|
|
402
|
-
const
|
|
400
|
+
const oe = getStyleObjectFromCSS, le = _;
|
|
403
401
|
//#endregion
|
|
404
|
-
export {
|
|
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 };
|