@mx-space/cli 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/ROADMAP.md +10 -7
- package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-BsbWMhb3.mjs} +2265 -429
- package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-DnR_u_Ke.mjs} +47 -10
- package/dist/Lexical.prod-B7L8eVsO.mjs +6816 -0
- package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-BGSFbuTA.mjs} +131 -39
- package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-CUD_tpWb.mjs} +2 -2
- package/dist/LexicalClipboard.prod-DQXfRt3h.mjs +429 -0
- package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-B9lK_GSN.mjs} +81 -67
- package/dist/LexicalCodeCore.prod-CNWMPXhg.mjs +651 -0
- package/dist/LexicalDragon.dev-DRm2bGZ1.mjs +186 -0
- package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-d8gPruly.mjs} +3 -2
- package/dist/LexicalDragon.prod-ey3uKDJF.mjs +121 -0
- package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-CXtOJb83.mjs} +349 -35
- package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-CMsupJZs.mjs} +9 -4
- package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-BCLGhzcg.mjs} +477 -328
- package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-yVDOBd64.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-B8qauuEA.mjs} +2 -2
- package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-3rdckXIU.mjs} +323 -265
- package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-DagZUjQ_.mjs} +6 -4
- package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-B5AQaJDb.mjs} +354 -352
- package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-CspSwLNB.mjs} +69 -58
- package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-Da-ZW6H5.mjs} +210 -211
- package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-CNXmV6v8.mjs} +246 -198
- package/dist/LexicalList.prod-DgQzj4v9.mjs +944 -0
- package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-0XURdo96.mjs} +129 -37
- package/dist/LexicalMarkdown.prod-qUsIQfJx.mjs +932 -0
- package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-BqsEA7I9.mjs} +151 -122
- package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-D73RR0Ck.mjs} +8 -11
- package/dist/LexicalRichText.prod-4Atyd7OR.mjs +538 -0
- package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-DK5xfxKP.mjs} +10 -9
- package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-pyZyrANz.mjs} +4 -4
- package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-C5GrCbDC.mjs} +144 -146
- package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-DiR_4rdI.mjs} +184 -119
- package/dist/LexicalTable.prod-Cbc5EasT.mjs +2336 -0
- package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-jhPjn1vQ.mjs} +375 -35
- package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-Ck74ludK.mjs} +24 -12
- package/dist/LexicalUtils.prod-nuTBxnk_.mjs +504 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-BumPuCXw.mjs +2 -0
- package/dist/{esm-DFrz5rIo.mjs → esm-DupC6TTP.mjs} +214 -179
- package/dist/index.d.mts +46 -17
- package/dist/index.mjs +1 -1
- package/dist/{mxs-DXpzbUf4.mjs → mxs-BgAyMQdq.mjs} +8384 -6209
- package/package.json +17 -17
- package/skills/commands-ai.md +115 -0
- 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
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
import { $ as $insertNodeToNearestRootAtCaret, A as $getChildCaret, An as IS_FIREFOX, Bt as CAN_USE_DOM, C as $getAdjacentChildCaret, Cn as IS_ANDROID, Ct as $normalizeCaret, D as $getCaretRange, Dt as $rewindSiblingCaret, E as $getCaretInDirection, En as IS_APPLE_WEBKIT, Er as getDOMSelectionPoints, Et as $removeTextFromCaretRange, F as $getDOMTextNode, Ft as $splitAtPointCaretNext, G as $getSiblingCaret, H as $getPreviousSelection, It as $splitNode, J as $getSlotHost, K as $getSlot, Kr as isHTMLAnchorElement, M as $getChildCaretOrSelf, Mn as IS_IOS, Mr as getParentElement, Mt as $setSelection, N as $getCollapsedCaretRange, Nt as $setSelectionFromCaretRange, O as $getCaretRangeInDirection, On as IS_CHROME, P as $getDOMSlot, Pn as IS_SAFARI, Pt as $setState, Rr as isBlockDomNode, T as $getAdjacentSiblingOrParentSiblingCaret, Tn as IS_APPLE, U as $getRoot, W as $getSelection, X as $getState, Y as $getSlotNames, Yr as isInlineDomNode, _t as $isSiblingCaret, a as $caretRangeFromSelection, at as $isElementNode, b as $findMatchingParent, bt as $isTextNode, c as $comparePointCaretNext, i as $caretFromPoint, ii as removeClassNamesFromElement, kr as getDOMTextNode, ni as mergeRegister, nt as $isChildCaret, o as $cloneWithProperties, p as $createParagraphNode, pr as addClassNamesToElement, pt as $isRangeSelection, q as $getSlotFrame, qr as isHTMLElement, ti as makeStepwiseIterator, vt as $isSlotHost, wn as IS_ANDROID_CHROME, x as $fullReconcile, xt as $isTextPointCaret, zt as CAN_USE_BEFORE_INPUT } from "./Lexical.node-DnR_u_Ke.mjs";
|
|
2
|
+
import { o as createRectsFromDOMRange, t as $isAtNodeEnd } from "./LexicalSelection.node-pyZyrANz.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/@lexical+utils@0.46.0_typescript@6.0.3/node_modules/@lexical/utils/dist/LexicalUtils.prod.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
function J(t, ...e) {
|
|
12
|
+
const n = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
13
|
+
o.append("code", t);
|
|
14
|
+
for (const t of e) o.append("v", t);
|
|
15
|
+
throw n.search = o.toString(), Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
16
|
+
}
|
|
17
|
+
function Q(t) {
|
|
18
|
+
const e = (t, e) => e.left >= t.left - 1 && e.top >= t.top - 1 && e.right <= t.right + 1 && e.bottom <= t.bottom + 1, n = [];
|
|
19
|
+
for (const o of Array.from(t)) if (!(o.width < .5 || o.height < .5 || n.some((t) => e(o, t)))) {
|
|
20
|
+
for (let t = n.length - 1; t >= 0; t--) e(n[t], o) && n.splice(t, 1);
|
|
21
|
+
n.push(o);
|
|
22
|
+
}
|
|
23
|
+
return n;
|
|
24
|
+
}
|
|
25
|
+
function Z(t) {
|
|
26
|
+
return `${t}px`;
|
|
27
|
+
}
|
|
28
|
+
const tt = {
|
|
29
|
+
attributes: !0,
|
|
30
|
+
characterData: !0,
|
|
31
|
+
childList: !0,
|
|
32
|
+
subtree: !0
|
|
33
|
+
};
|
|
34
|
+
function et(e, o, r) {
|
|
35
|
+
let i = null, l = null, s = null, u = [];
|
|
36
|
+
const c = document.createElement("div");
|
|
37
|
+
function f() {
|
|
38
|
+
null === i && J(182), null === l && J(183);
|
|
39
|
+
const { left: n, top: s } = l.getBoundingClientRect(), f = Q(createRectsFromDOMRange(e, o));
|
|
40
|
+
var d, a;
|
|
41
|
+
c.isConnected || (a = c, (d = l).insertBefore(a, d.firstChild));
|
|
42
|
+
let g = !1;
|
|
43
|
+
for (let t = 0; t < f.length; t++) {
|
|
44
|
+
const e = f[t], o = u[t] || document.createElement("div"), r = o.style;
|
|
45
|
+
"absolute" !== r.position && (r.position = "absolute", g = !0);
|
|
46
|
+
const i = Z(e.left - n);
|
|
47
|
+
r.left !== i && (r.left = i, g = !0);
|
|
48
|
+
const l = Z(e.top - s);
|
|
49
|
+
r.top !== l && (o.style.top = l, g = !0);
|
|
50
|
+
const d = Z(e.width);
|
|
51
|
+
r.width !== d && (o.style.width = d, g = !0);
|
|
52
|
+
const a = Z(e.height);
|
|
53
|
+
r.height !== a && (o.style.height = a, g = !0), o.parentNode !== c && (c.append(o), g = !0), u[t] = o;
|
|
54
|
+
}
|
|
55
|
+
for (; u.length > f.length;) u.pop();
|
|
56
|
+
g && r(u);
|
|
57
|
+
}
|
|
58
|
+
function d() {
|
|
59
|
+
l = null, i = null, null !== s && s.disconnect(), s = null, c.remove();
|
|
60
|
+
for (const t of u) t.remove();
|
|
61
|
+
u = [];
|
|
62
|
+
}
|
|
63
|
+
c.style.position = "relative";
|
|
64
|
+
const a = e.registerRootListener(function t() {
|
|
65
|
+
const o = e.getRootElement();
|
|
66
|
+
if (null === o) return d();
|
|
67
|
+
const r = o.parentElement;
|
|
68
|
+
if (!isHTMLElement(r)) return d();
|
|
69
|
+
d(), i = o, l = r, s = new MutationObserver((n) => {
|
|
70
|
+
const o = e.getRootElement(), r = o && o.parentElement;
|
|
71
|
+
if (o !== i || r !== l) return t();
|
|
72
|
+
for (const t of n) if (!c.contains(t.target)) return f();
|
|
73
|
+
}), s.observe(r, tt), f();
|
|
74
|
+
});
|
|
75
|
+
return () => {
|
|
76
|
+
a(), d();
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function nt(t, e, n, o) {
|
|
80
|
+
if ("text" !== e.type && $isElementNode(n)) {
|
|
81
|
+
const r = $getDOMSlot(n, o, t);
|
|
82
|
+
return [r.element, r.getFirstChildOffset() + e.offset];
|
|
83
|
+
}
|
|
84
|
+
return [($isTextNode(n) ? $getDOMTextNode(n, o, t) : getDOMTextNode(o)) || o, e.offset];
|
|
85
|
+
}
|
|
86
|
+
function ot(t) {
|
|
87
|
+
for (const e of t) {
|
|
88
|
+
const t = e.style;
|
|
89
|
+
"Highlight" !== t.background && (t.background = "Highlight"), "HighlightText" !== t.color && (t.color = "HighlightText"), t.marginTop !== Z(-1.5) && (t.marginTop = Z(-1.5)), t.paddingTop !== Z(4) && (t.paddingTop = Z(4)), t.paddingBottom !== Z(0) && (t.paddingBottom = Z(0));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function rt(t, e = ot) {
|
|
93
|
+
let n = null, l = null, s = null, u = null, c = null, f = null, d = () => {};
|
|
94
|
+
function a(o) {
|
|
95
|
+
o.read(() => {
|
|
96
|
+
const o = $getSelection();
|
|
97
|
+
if (!$isRangeSelection(o)) return n = null, s = null, u = null, f = null, d(), void (d = () => {});
|
|
98
|
+
const [a, g] = function(t) {
|
|
99
|
+
const e = t.getStartEndPoints();
|
|
100
|
+
return t.isBackward() ? [e[1], e[0]] : e;
|
|
101
|
+
}(o), p = a.getNode(), h = p.getKey(), m = a.offset, y = g.getNode(), v = y.getKey(), E = g.offset, w = t.getElementByKey(h), C = t.getElementByKey(v), S = null === n || w !== l || m !== s || h !== n.getKey(), x = null === u || C !== c || E !== f || v !== u.getKey();
|
|
102
|
+
if ((S || x) && null !== w && null !== C) {
|
|
103
|
+
const n = function(t, e, n, o, r, i, l) {
|
|
104
|
+
const s = (t._window ? t._window.document : document).createRange();
|
|
105
|
+
return s.setStart(...nt(t, e, n, o)), s.setEnd(...nt(t, r, i, l)), s;
|
|
106
|
+
}(t, a, p, w, g, y, C);
|
|
107
|
+
d(), d = et(t, n, e);
|
|
108
|
+
}
|
|
109
|
+
n = p, l = w, s = m, u = y, c = C, f = E;
|
|
110
|
+
}, { editor: t });
|
|
111
|
+
}
|
|
112
|
+
return a(t.getEditorState()), mergeRegister(t.registerUpdateListener(({ editorState: t }) => a(t)), () => {
|
|
113
|
+
d();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function it(t, e) {
|
|
117
|
+
let n = null;
|
|
118
|
+
const o = () => {
|
|
119
|
+
const o = t.getRootElement(), r = null !== o ? o.ownerDocument.defaultView : null, i = null !== r ? r.getSelection() : null, l = null !== i ? getDOMSelectionPoints(i, o).anchorNode : null;
|
|
120
|
+
null !== l && null !== o && o.contains(l) ? null !== n && (n(), n = null) : null === n && (n = rt(t, e));
|
|
121
|
+
};
|
|
122
|
+
return t.registerRootListener((t) => {
|
|
123
|
+
if (t) {
|
|
124
|
+
const e = t.ownerDocument;
|
|
125
|
+
return e.addEventListener("selectionchange", o), o(), () => {
|
|
126
|
+
null !== n && n(), e.removeEventListener("selectionchange", o);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function lt(t, e) {
|
|
132
|
+
const n = t.ownerDocument, o = n.defaultView || window;
|
|
133
|
+
let r = o.getComputedStyle(t);
|
|
134
|
+
const i = "absolute" === r.position, l = e ? /(auto|scroll|hidden)/ : /(auto|scroll)/;
|
|
135
|
+
if ("fixed" === r.position) return n.body;
|
|
136
|
+
for (let e = t; e = getParentElement(e);) if (r = o.getComputedStyle(e), (!i || "static" !== r.position) && l.test(r.overflow + r.overflowY + r.overflowX)) return e;
|
|
137
|
+
return n.body;
|
|
138
|
+
}
|
|
139
|
+
function st(t, e) {
|
|
140
|
+
for (const n of e) if (t.type.startsWith(n)) return !0;
|
|
141
|
+
return !1;
|
|
142
|
+
}
|
|
143
|
+
function ut(t, e) {
|
|
144
|
+
const n = t[Symbol.iterator]();
|
|
145
|
+
return new Promise((t, o) => {
|
|
146
|
+
const r = [], i = () => {
|
|
147
|
+
const { done: l, value: s } = n.next();
|
|
148
|
+
if (l) return t(r);
|
|
149
|
+
const u = new FileReader();
|
|
150
|
+
u.addEventListener("error", o), u.addEventListener("load", () => {
|
|
151
|
+
const t = u.result;
|
|
152
|
+
"string" == typeof t && r.push({
|
|
153
|
+
file: s,
|
|
154
|
+
result: t
|
|
155
|
+
}), i();
|
|
156
|
+
}), st(s, e) ? u.readAsDataURL(s) : i();
|
|
157
|
+
};
|
|
158
|
+
i();
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function ct(t, e) {
|
|
162
|
+
return Array.from(at(t, e));
|
|
163
|
+
}
|
|
164
|
+
function ft(t) {
|
|
165
|
+
return t ? t.getAdjacentCaret() : null;
|
|
166
|
+
}
|
|
167
|
+
function dt(t, e) {
|
|
168
|
+
return Array.from(Ct(t, e));
|
|
169
|
+
}
|
|
170
|
+
function at(t, e) {
|
|
171
|
+
return yt("next", t, e);
|
|
172
|
+
}
|
|
173
|
+
function gt(t, e) {
|
|
174
|
+
return Array.from(pt(t, e));
|
|
175
|
+
}
|
|
176
|
+
function* pt(t, e) {
|
|
177
|
+
for (const n of yt("next", t, e)) {
|
|
178
|
+
yield n;
|
|
179
|
+
const { node: t, depth: o } = n;
|
|
180
|
+
if ($isSlotHost(t) && !t.is(e)) for (const e of $getSlotNames(t)) {
|
|
181
|
+
const n = $getSlot(t, e);
|
|
182
|
+
null !== n && (yield* ht(n, o + 1));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function* ht(t, e) {
|
|
187
|
+
yield {
|
|
188
|
+
depth: e,
|
|
189
|
+
node: t
|
|
190
|
+
};
|
|
191
|
+
const n = e + 1;
|
|
192
|
+
if ($isSlotHost(t)) for (const e of $getSlotNames(t)) {
|
|
193
|
+
const o = $getSlot(t, e);
|
|
194
|
+
null !== o && (yield* ht(o, n));
|
|
195
|
+
}
|
|
196
|
+
if ($isElementNode(t)) for (const e of t.getChildren()) yield* ht(e, n);
|
|
197
|
+
}
|
|
198
|
+
function mt(t, e) {
|
|
199
|
+
const n = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(t, e));
|
|
200
|
+
return n && n[0];
|
|
201
|
+
}
|
|
202
|
+
function yt(t, e, n) {
|
|
203
|
+
const o = $getRoot(), r = e || o, i = $isElementNode(r) ? $getChildCaret(r, t) : $getSiblingCaret(r, t), s = Et(r), u = n ? $getAdjacentChildCaret($getChildCaretOrSelf($getSiblingCaret(n, t))) || mt(n, t) : mt(r, t);
|
|
204
|
+
let c = s;
|
|
205
|
+
return makeStepwiseIterator({
|
|
206
|
+
hasNext: (t) => null !== t,
|
|
207
|
+
initial: i,
|
|
208
|
+
map: (t) => ({
|
|
209
|
+
depth: c,
|
|
210
|
+
node: t.origin
|
|
211
|
+
}),
|
|
212
|
+
step: (t) => {
|
|
213
|
+
if (t.isSameNodeCaret(u)) return null;
|
|
214
|
+
$isChildCaret(t) && c++;
|
|
215
|
+
const e = $getAdjacentSiblingOrParentSiblingCaret(t);
|
|
216
|
+
return !e || e[0].isSameNodeCaret(u) ? null : (c += e[1], e[0]);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function vt(t) {
|
|
221
|
+
const e = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(t, "next"));
|
|
222
|
+
return e && [e[0].origin, e[1]];
|
|
223
|
+
}
|
|
224
|
+
function Et(t) {
|
|
225
|
+
let e = -1;
|
|
226
|
+
for (let n = t; null !== n; n = n.getParent() ?? $getSlotHost(n)) e++;
|
|
227
|
+
return e;
|
|
228
|
+
}
|
|
229
|
+
function wt(t) {
|
|
230
|
+
const n = $getAdjacentSiblingOrParentSiblingCaret($getChildCaretOrSelf($getSiblingCaret(t, "previous")), "root");
|
|
231
|
+
return n && n[0].origin;
|
|
232
|
+
}
|
|
233
|
+
function Ct(t, e) {
|
|
234
|
+
return yt("previous", t, e);
|
|
235
|
+
}
|
|
236
|
+
function St(t, e) {
|
|
237
|
+
return Array.from(xt(t, e));
|
|
238
|
+
}
|
|
239
|
+
function* xt(t, e) {
|
|
240
|
+
const n = [];
|
|
241
|
+
for (const o of yt("previous", t, e)) {
|
|
242
|
+
for (; n.length > 0 && o.depth <= n[n.length - 1].depth;) {
|
|
243
|
+
const t = n.pop();
|
|
244
|
+
yield* Nt(t.node, t.depth + 1);
|
|
245
|
+
}
|
|
246
|
+
yield o;
|
|
247
|
+
const { node: t, depth: r } = o;
|
|
248
|
+
$isSlotHost(t) && $getSlotNames(t).length > 0 && !t.is(e) && n.push({
|
|
249
|
+
depth: r,
|
|
250
|
+
node: t
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
for (; n.length > 0;) {
|
|
254
|
+
const t = n.pop();
|
|
255
|
+
yield* Nt(t.node, t.depth + 1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function* Nt(t, e) {
|
|
259
|
+
const n = $getSlotNames(t);
|
|
260
|
+
for (let o = n.length - 1; o >= 0; o--) {
|
|
261
|
+
const r = $getSlot(t, n[o]);
|
|
262
|
+
null !== r && (yield* At(r, e));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function* At(t, e) {
|
|
266
|
+
yield {
|
|
267
|
+
depth: e,
|
|
268
|
+
node: t
|
|
269
|
+
};
|
|
270
|
+
const n = e + 1;
|
|
271
|
+
if ($isElementNode(t)) {
|
|
272
|
+
const e = t.getChildren();
|
|
273
|
+
for (let t = e.length - 1; t >= 0; t--) yield* At(e[t], n);
|
|
274
|
+
}
|
|
275
|
+
$isSlotHost(t) && (yield* Nt(t, n));
|
|
276
|
+
}
|
|
277
|
+
function bt(t, e) {
|
|
278
|
+
let n = t;
|
|
279
|
+
for (; null != n;) {
|
|
280
|
+
if (n instanceof e) return n;
|
|
281
|
+
n = n.getParent();
|
|
282
|
+
}
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
function _t(t) {
|
|
286
|
+
const e = $findMatchingParent(t, (t) => $isElementNode(t) && !t.isInline());
|
|
287
|
+
return $isElementNode(e) || J(4, t.__key), e;
|
|
288
|
+
}
|
|
289
|
+
function Rt(t, e) {
|
|
290
|
+
const n = $getCaretRangeInDirection($isRangeSelection(e) ? $caretRangeFromSelection(e) : e, "next"), o = $getSlotFrame(n.anchor.origin), r = $getSlotFrame(t.getLatest());
|
|
291
|
+
if (null === o ? null !== r : !o.is(r)) return !1;
|
|
292
|
+
const l = $normalizeCaret($getChildCaret(t, "next")), s = $getCaretInDirection($normalizeCaret($getChildCaret(t, "previous")), "next");
|
|
293
|
+
return $comparePointCaretNext(n.anchor, l) <= 0 && $comparePointCaretNext(n.focus, s) >= 0;
|
|
294
|
+
}
|
|
295
|
+
function Lt(t, e, n, o) {
|
|
296
|
+
const r = (t) => t instanceof e;
|
|
297
|
+
return t.registerNodeTransform(e, (t) => {
|
|
298
|
+
const e = ((t) => {
|
|
299
|
+
const e = t.getChildren();
|
|
300
|
+
for (let t = 0; t < e.length; t++) {
|
|
301
|
+
const n = e[t];
|
|
302
|
+
if (r(n)) return null;
|
|
303
|
+
}
|
|
304
|
+
let n = t, o = t;
|
|
305
|
+
for (; null !== n;) if (o = n, n = n.getParent(), r(n)) return {
|
|
306
|
+
child: o,
|
|
307
|
+
parent: n
|
|
308
|
+
};
|
|
309
|
+
return null;
|
|
310
|
+
})(t);
|
|
311
|
+
if (null !== e) {
|
|
312
|
+
const { child: r, parent: i } = e;
|
|
313
|
+
if (r.is(t)) {
|
|
314
|
+
o(i, t);
|
|
315
|
+
const e = r.getNextSiblings(), l = e.length;
|
|
316
|
+
if (i.insertAfter(r), 0 !== l) {
|
|
317
|
+
const t = n(i);
|
|
318
|
+
r.insertAfter(t);
|
|
319
|
+
for (let n = 0; n < l; n++) t.append(e[n]);
|
|
320
|
+
}
|
|
321
|
+
i.canBeEmpty() || 0 !== i.getChildrenSize() || i.remove();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
function Dt(t, e) {
|
|
327
|
+
const n = /* @__PURE__ */ new Map(), o = t._pendingEditorState;
|
|
328
|
+
for (const [t, o] of e._nodeMap) n.set(t, $cloneWithProperties(o));
|
|
329
|
+
o && (o._nodeMap = n), $fullReconcile();
|
|
330
|
+
const r = e._selection;
|
|
331
|
+
$setSelection(null === r ? null : r.clone());
|
|
332
|
+
}
|
|
333
|
+
function It(t) {
|
|
334
|
+
const e = $getSelection() || $getPreviousSelection();
|
|
335
|
+
let n;
|
|
336
|
+
if ($isRangeSelection(e)) n = $caretFromPoint(e.focus, "next");
|
|
337
|
+
else {
|
|
338
|
+
if (null != e) {
|
|
339
|
+
const t = e.getNodes(), o = t[t.length - 1];
|
|
340
|
+
o && (n = $getSiblingCaret(o, "next"));
|
|
341
|
+
}
|
|
342
|
+
n = n || $getChildCaret($getRoot(), "previous").getFlipped().insert($createParagraphNode());
|
|
343
|
+
}
|
|
344
|
+
const o = $insertNodeToNearestRootAtCaret(t, n), l = $getAdjacentChildCaret(o);
|
|
345
|
+
return $setSelectionFromCaretRange($getCollapsedCaretRange($isChildCaret(l) ? $normalizeCaret(l) : o)), t.getLatest();
|
|
346
|
+
}
|
|
347
|
+
function Pt(t) {
|
|
348
|
+
const e = $getSelection();
|
|
349
|
+
if (!$isRangeSelection(e)) return void (e && e.insertNodes([t]));
|
|
350
|
+
let o = $getCaretRangeInDirection($removeTextFromCaretRange($caretRangeFromSelection(e)), "next").anchor;
|
|
351
|
+
if ($isTextPointCaret(o)) {
|
|
352
|
+
const t = $splitAtPointCaretNext(o);
|
|
353
|
+
if (!t) return;
|
|
354
|
+
o = t;
|
|
355
|
+
}
|
|
356
|
+
const l = o.getFlipped();
|
|
357
|
+
l.insert(t), $setSelectionFromCaretRange($getCaretRange(l, l));
|
|
358
|
+
}
|
|
359
|
+
function Bt(t, e) {
|
|
360
|
+
const n = e();
|
|
361
|
+
return t.replace(n), n.append(t), n;
|
|
362
|
+
}
|
|
363
|
+
function Ot(t, e) {
|
|
364
|
+
return null !== t && Object.getPrototypeOf(t).constructor.name === e.name;
|
|
365
|
+
}
|
|
366
|
+
function Tt(t) {
|
|
367
|
+
let e = null;
|
|
368
|
+
if (Ot(t, DragEvent) ? e = t.dataTransfer : Ot(t, ClipboardEvent) && (e = t.clipboardData), null === e) return [
|
|
369
|
+
!1,
|
|
370
|
+
[],
|
|
371
|
+
!1
|
|
372
|
+
];
|
|
373
|
+
const n = e.types, o = n.includes("Files"), r = n.includes("text/html") || n.includes("text/plain");
|
|
374
|
+
return [
|
|
375
|
+
o,
|
|
376
|
+
Array.from(e.files),
|
|
377
|
+
r
|
|
378
|
+
];
|
|
379
|
+
}
|
|
380
|
+
function Ft(t, e) {
|
|
381
|
+
const n = [];
|
|
382
|
+
for (let o = 0; o < t.length; o++) {
|
|
383
|
+
const r = e(t[o]);
|
|
384
|
+
null !== r && n.push(r);
|
|
385
|
+
}
|
|
386
|
+
return n;
|
|
387
|
+
}
|
|
388
|
+
function Mt(t) {
|
|
389
|
+
const e = $getSelection();
|
|
390
|
+
if (!$isRangeSelection(e)) return !1;
|
|
391
|
+
const n = /* @__PURE__ */ new Set(), o = e.getNodes();
|
|
392
|
+
for (let e = 0; e < o.length; e++) {
|
|
393
|
+
const r = o[e], i = r.getKey();
|
|
394
|
+
if (n.has(i)) continue;
|
|
395
|
+
const s = $findMatchingParent(r, (t) => $isElementNode(t) && !t.isInline());
|
|
396
|
+
if (null === s) continue;
|
|
397
|
+
const u = s.getKey();
|
|
398
|
+
s.canIndent() && !n.has(u) && (n.add(u), t(s));
|
|
399
|
+
}
|
|
400
|
+
return n.size > 0;
|
|
401
|
+
}
|
|
402
|
+
function Kt(t, e) {
|
|
403
|
+
$getChildCaret(t, "next").insert(e);
|
|
404
|
+
}
|
|
405
|
+
let $t = !(IS_FIREFOX || !CAN_USE_DOM) && void 0;
|
|
406
|
+
function Ht(t, e = !1) {
|
|
407
|
+
let n = 1;
|
|
408
|
+
if (function() {
|
|
409
|
+
if (void 0 === $t) {
|
|
410
|
+
const t = document.createElement("div");
|
|
411
|
+
t.style.position = "absolute", t.style.opacity = "0", t.style.width = "100px", t.style.left = "-1000px", document.body.appendChild(t);
|
|
412
|
+
const e = t.getBoundingClientRect();
|
|
413
|
+
t.style.setProperty("zoom", "2"), $t = t.getBoundingClientRect().width === e.width, document.body.removeChild(t);
|
|
414
|
+
}
|
|
415
|
+
return $t;
|
|
416
|
+
}() || e) {
|
|
417
|
+
const e = t && t.ownerDocument.defaultView || window;
|
|
418
|
+
for (; t;) n *= Number(e.getComputedStyle(t).getPropertyValue("zoom")), t = getParentElement(t);
|
|
419
|
+
}
|
|
420
|
+
return n;
|
|
421
|
+
}
|
|
422
|
+
function kt(t) {
|
|
423
|
+
return null !== t._parentEditor;
|
|
424
|
+
}
|
|
425
|
+
function Ut(t, e) {
|
|
426
|
+
return jt(t, e, null);
|
|
427
|
+
}
|
|
428
|
+
function jt(t, e, n) {
|
|
429
|
+
let o = !1;
|
|
430
|
+
for (const r of Wt(t)) e(r) ? null !== n && n(r) : (o = !0, $isElementNode(r) && jt(r, e, n || ((t) => r.insertAfter(t))), r.remove());
|
|
431
|
+
return o;
|
|
432
|
+
}
|
|
433
|
+
function zt(t, e) {
|
|
434
|
+
const n = [], o = Array.from(t).reverse();
|
|
435
|
+
for (let t = o.pop(); void 0 !== t; t = o.pop()) if (e(t)) n.push(t);
|
|
436
|
+
else if ($isElementNode(t)) for (const e of Wt(t)) o.push(e);
|
|
437
|
+
return n;
|
|
438
|
+
}
|
|
439
|
+
function Vt(t) {
|
|
440
|
+
return Xt($getChildCaret(t, "next"));
|
|
441
|
+
}
|
|
442
|
+
function Wt(t) {
|
|
443
|
+
return Xt($getChildCaret(t, "previous"));
|
|
444
|
+
}
|
|
445
|
+
function Xt(t) {
|
|
446
|
+
return makeStepwiseIterator({
|
|
447
|
+
hasNext: $isSiblingCaret,
|
|
448
|
+
initial: t.getAdjacentCaret(),
|
|
449
|
+
map: (t) => t.origin.getLatest(),
|
|
450
|
+
step: (t) => t.getAdjacentCaret()
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
function Gt(t) {
|
|
454
|
+
$rewindSiblingCaret($getSiblingCaret(t, "next")).splice(1, t.getChildren());
|
|
455
|
+
}
|
|
456
|
+
function Yt(t) {
|
|
457
|
+
const e = (e) => $getState(e, t), n = (e, n) => $setState(e, t, n);
|
|
458
|
+
return {
|
|
459
|
+
$get: e,
|
|
460
|
+
$set: n,
|
|
461
|
+
accessors: [e, n],
|
|
462
|
+
makeGetterMethod: () => function() {
|
|
463
|
+
return e(this);
|
|
464
|
+
},
|
|
465
|
+
makeSetterMethod: () => function(t) {
|
|
466
|
+
return n(this, t);
|
|
467
|
+
},
|
|
468
|
+
stateConfig: t
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
function qt(t, e) {
|
|
472
|
+
const n = $getSelection();
|
|
473
|
+
if ($isRangeSelection(n) && n.isCollapsed()) {
|
|
474
|
+
const o = $findMatchingParent(n.anchor.getNode(), t);
|
|
475
|
+
if (o) {
|
|
476
|
+
const t = o.getParent();
|
|
477
|
+
if (null !== t && t.getFirstChild() === o && Qt(n.anchor, o)) return o.insertBefore($createParagraphNode()).selectEnd(), e && e.preventDefault(), !0;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return !1;
|
|
481
|
+
}
|
|
482
|
+
function Jt(t, e) {
|
|
483
|
+
const n = $getSelection();
|
|
484
|
+
if ($isRangeSelection(n) && n.isCollapsed()) {
|
|
485
|
+
const o = $findMatchingParent(n.anchor.getNode(), t);
|
|
486
|
+
if (o) {
|
|
487
|
+
const t = o.getParent();
|
|
488
|
+
if (null !== t && t.getLastChild() === o && Zt(n.anchor, o)) return o.insertAfter($createParagraphNode()).selectEnd(), e && e.preventDefault(), !0;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
return !1;
|
|
492
|
+
}
|
|
493
|
+
function Qt(t, e) {
|
|
494
|
+
if (0 !== t.offset) return !1;
|
|
495
|
+
const n = e.getFirstDescendant() ?? e, o = t.getNode();
|
|
496
|
+
return o === n || $isElementNode(o) && o.getFirstDescendant() === n;
|
|
497
|
+
}
|
|
498
|
+
function Zt(t, n) {
|
|
499
|
+
if (!$isAtNodeEnd(t)) return !1;
|
|
500
|
+
const o = n.getLastDescendant() ?? n, r = t.getNode();
|
|
501
|
+
return r === o || $isElementNode(r) && r.getLastDescendant() === o;
|
|
502
|
+
}
|
|
503
|
+
//#endregion
|
|
504
|
+
export { zt as $descendantsMatching, ct as $dfs, at as $dfsIterator, gt as $dfsWithSlots, pt as $dfsWithSlotsIterator, Ft as $filter, $findMatchingParent, Vt as $firstToLastIterator, ft as $getAdjacentCaret, $getAdjacentSiblingOrParentSiblingCaret, Et as $getDepth, _t as $getNearestBlockElementAncestorOrThrow, bt as $getNearestNodeOfType, wt as $getNextRightPreorderNode, vt as $getNextSiblingOrParentSibling, Mt as $handleIndentAndOutdent, Kt as $insertFirst, Pt as $insertNodeIntoLeaf, It as $insertNodeToNearestRoot, $insertNodeToNearestRootAtCaret, Zt as $isAtEndOfNode, Qt as $isAtStartOfNode, Rt as $isBlockFullySelected, kt as $isEditorIsNestedEditor, Wt as $lastToFirstIterator, Jt as $onEscapeDown, qt as $onEscapeUp, Dt as $restoreEditorState, dt as $reverseDfs, Ct as $reverseDfsIterator, St as $reverseDfsWithSlots, xt as $reverseDfsWithSlotsIterator, $splitNode, Ut as $unwrapAndFilterDescendants, Gt as $unwrapNode, Bt as $wrapNodeInElement, CAN_USE_BEFORE_INPUT, CAN_USE_DOM, IS_ANDROID, IS_ANDROID_CHROME, IS_APPLE, IS_APPLE_WEBKIT, IS_CHROME, IS_FIREFOX, IS_IOS, IS_SAFARI, addClassNamesToElement, Ht as calculateZoomLevel, Q as dedupeSelectionRects, Tt as eventFiles, lt as getScrollParent, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, st as isMimeType, Yt as makeStateWrapper, rt as markSelection, ut as mediaFileReader, mergeRegister, Ot as objectKlassEquals, et as positionNodeOnRange, Lt as registerNestedElementResolver, removeClassNamesFromElement, it as selectionAlwaysOnDisplay };
|
package/dist/bin/mxs.mjs
CHANGED