@mx-space/cli 0.14.1 → 0.15.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.
- package/README.md +35 -11
- package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-Cck4n26y.mjs} +998 -584
- package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-D6wf2D5M.mjs} +15 -5
- package/dist/Lexical.prod-DCwS1oTq.mjs +7170 -0
- package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CMkPHV7O.mjs} +6 -6
- package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-m4nZ7IYw.mjs} +2 -2
- package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-B_rN1vE1.mjs} +10 -8
- package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DyJw3i8V.mjs} +62 -72
- package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-DPXLHQLF.mjs} +212 -213
- package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-ZkNfMwrE.mjs} +3 -3
- package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-Ds9oLUFh.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-B58ic2av.mjs} +5 -4
- package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-DvwHs1Xv.mjs} +79 -67
- package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-5OymZQfy.mjs} +4 -2
- package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-Ce0T5smQ.mjs} +372 -358
- package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-DA0WldSR.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-1kQgKB6c.mjs} +2 -2
- package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-BDB7CUrx.mjs} +14 -12
- package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-DpVNt7It.mjs} +4 -4
- package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-HkxM5scw.mjs} +331 -300
- package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-C5zNJlrm.mjs} +65 -59
- package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-Bkt9hQAt.mjs} +196 -201
- package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B7VgME-m.mjs} +55 -82
- package/dist/LexicalList.prod-B8c7TDjH.mjs +951 -0
- package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-B5z9kLbV.mjs} +62 -42
- package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-wKzw7FFH.mjs} +255 -202
- package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-CUd6Li5F.mjs} +399 -120
- package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-BKfaQ-CH.mjs} +12 -8
- package/dist/LexicalRichText.prod-SBewjJHx.mjs +708 -0
- package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-D27JOCqj.mjs} +48 -17
- package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-DBEwPjBu.mjs} +5 -4
- package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-OaYhXHOL.mjs} +101 -92
- package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-6IFFOAE0.mjs} +590 -259
- package/dist/LexicalTable.prod-2CaLZ7fH.mjs +2524 -0
- package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-DJA7J_7v.mjs} +15 -19
- package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-Df9oPTlA.mjs} +6 -6
- package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-Bb7V4Ewg.mjs} +155 -159
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-CDcJmHkG.mjs +2 -0
- package/dist/{esm-BNu4sUWV.mjs → esm-DLzrv7gD.mjs} +1837 -6015
- package/dist/index.d.mts +57 -62
- package/dist/index.mjs +1 -1
- package/dist/{mxs-CMX2yklg.mjs → mxs-BIRW5Axj.mjs} +13579 -8682
- package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
- package/dist/vendor/litexml/cli.mjs +7043 -6207
- package/dist/vendor/litexml/litexml-html-preview-client.css +80 -47
- package/dist/vendor/litexml/litexml-html-preview-client.js +14422 -10838
- package/dist/vendor/litexml/style.css +6 -2
- package/package.json +23 -23
- package/skills/commands-ai.md +45 -12
- package/skills/overview.md +1 -1
- package/dist/Lexical.prod-CeB9UQuo.mjs +0 -6816
- package/dist/LexicalList.prod-D0xX5d3G.mjs +0 -944
- package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +0 -538
- package/dist/LexicalTable.prod-BgO4nCxy.mjs +0 -2336
- package/dist/esm-jbwcVZth.mjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { o as createRectsFromDOMRange, t as $
|
|
3
|
-
//#region ../../node_modules/.pnpm/@lexical+utils@0.
|
|
1
|
+
import { $r as isHTMLElement, A as $getChildCaret, An as IS_APPLE_WEBKIT, At as $rewindSiblingCaret, Br as getRootOwnerDocument, Bt as $splitNode, Ct as $isTextPointCaret, D as $getCaretRange, Dn as IS_ANDROID, E as $getCaretInDirection, Et as $normalizeCaret, F as $getDOMTextNode, Fr as getDOMTextNode, Ft as $setSelection, G as $getSelection, In as IS_IOS, It as $setSelectionFromCaretRange, J as $getSlotFrame, K as $getSiblingCaret, Lt as $setState, M as $getChildCaretOrSelf, Mn as IS_CHROME, Mr as getDOMSelectionPoints, N as $getCollapsedCaretRange, O as $getCaretRangeInDirection, On as IS_ANDROID_CHROME, P as $getDOMSlot, Pn as IS_FIREFOX, Qr as isHTMLAnchorElement, Rn as IS_SAFARI, Rr as getParentElement, S as $fullReconcile, St as $isTextNode, T as $getAdjacentSiblingOrParentSiblingCaret, U as $getPreviousSelection, Ut as CAN_USE_BEFORE_INPUT, W as $getRoot, Wr as isBlockDomNode, Wt as CAN_USE_DOM, X as $getSlotNames, Y as $getSlotHost, Z as $getState, a as $caretRangeFromSelection, b as $findMatchingParent, bt as $isSlotHost, c as $comparePointCaretNext, ci as mergeRegister, et as $insertNodeToNearestRootAtCaret, fi as removeClassNamesFromElement, i as $caretFromPoint, kn as IS_APPLE, kt as $removeTextFromCaretRange, mt as $isRangeSelection, o as $cloneWithProperties, ot as $isElementNode, p as $createParagraphNode, q as $getSlot, rt as $isChildCaret, si as makeStepwiseIterator, ti as isInlineDomNode, ui as registerEventListener, vr as addClassNamesToElement, w as $getAdjacentChildCaret, yt as $isSiblingCaret, zt as $splitAtPointCaretNext } from "./Lexical.node-D6wf2D5M.mjs";
|
|
2
|
+
import { o as createRectsFromDOMRange, t as $isAtEdgeOfElement } from "./LexicalSelection.node-DBEwPjBu.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/@lexical+utils@0.49.0_typescript@6.0.3/node_modules/@lexical/utils/dist/LexicalUtils.prod.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
6
|
*
|
|
@@ -8,13 +8,13 @@ import { o as createRectsFromDOMRange, t as $isAtNodeEnd } from "./LexicalSelect
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
function
|
|
11
|
+
function Z(t, ...e) {
|
|
12
12
|
const n = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
13
13
|
o.append("code", t);
|
|
14
14
|
for (const t of e) o.append("v", t);
|
|
15
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
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function tt(t) {
|
|
18
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
19
|
for (const o of Array.from(t)) if (!(o.width < .5 || o.height < .5 || n.some((t) => e(o, t)))) {
|
|
20
20
|
for (let t = n.length - 1; t >= 0; t--) e(n[t], o) && n.splice(t, 1);
|
|
@@ -22,113 +22,113 @@ function Q(t) {
|
|
|
22
22
|
}
|
|
23
23
|
return n;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function et(t) {
|
|
26
26
|
return `${t}px`;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const nt = {
|
|
29
29
|
attributes: !0,
|
|
30
30
|
characterData: !0,
|
|
31
31
|
childList: !0,
|
|
32
32
|
subtree: !0
|
|
33
33
|
};
|
|
34
|
-
function
|
|
35
|
-
let
|
|
36
|
-
const
|
|
37
|
-
function
|
|
38
|
-
null ===
|
|
39
|
-
const { left:
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
for (let t = 0; t <
|
|
44
|
-
const e =
|
|
45
|
-
"absolute" !==
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
34
|
+
function ot(e, r, i) {
|
|
35
|
+
let l = null, s = null, u = null, c = [];
|
|
36
|
+
const f = getRootOwnerDocument(e.getRootElement()).createElement("div");
|
|
37
|
+
function d() {
|
|
38
|
+
null === l && Z(182), null === s && Z(183);
|
|
39
|
+
const { left: o, top: u } = s.getBoundingClientRect(), d = tt(createRectsFromDOMRange(e, r));
|
|
40
|
+
var a, g;
|
|
41
|
+
f.isConnected || (g = f, (a = s).insertBefore(g, a.firstChild));
|
|
42
|
+
let p = !1;
|
|
43
|
+
for (let t = 0; t < d.length; t++) {
|
|
44
|
+
const e = d[t], r = c[t] || getRootOwnerDocument(l).createElement("div"), i = r.style;
|
|
45
|
+
"absolute" !== i.position && (i.position = "absolute", p = !0);
|
|
46
|
+
const s = et(e.left - o);
|
|
47
|
+
i.left !== s && (i.left = s, p = !0);
|
|
48
|
+
const a = et(e.top - u);
|
|
49
|
+
i.top !== a && (r.style.top = a, p = !0);
|
|
50
|
+
const g = et(e.width);
|
|
51
|
+
i.width !== g && (r.style.width = g, p = !0);
|
|
52
|
+
const h = et(e.height);
|
|
53
|
+
i.height !== h && (r.style.height = h, p = !0), r.parentNode !== f && (f.append(r), p = !0), c[t] = r;
|
|
54
54
|
}
|
|
55
|
-
for (;
|
|
56
|
-
|
|
55
|
+
for (; c.length > d.length;) c.pop()?.remove();
|
|
56
|
+
p && i(c);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
for (const t of
|
|
61
|
-
|
|
58
|
+
function a() {
|
|
59
|
+
s = null, l = null, null !== u && u.disconnect(), u = null, f.remove();
|
|
60
|
+
for (const t of c) t.remove();
|
|
61
|
+
c = [];
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
if (null ===
|
|
67
|
-
const r =
|
|
68
|
-
if (!isHTMLElement(r)) return
|
|
69
|
-
|
|
63
|
+
f.style.position = "relative";
|
|
64
|
+
const g = e.registerRootListener(function t() {
|
|
65
|
+
const n = e.getRootElement();
|
|
66
|
+
if (null === n) return a();
|
|
67
|
+
const r = n.parentElement;
|
|
68
|
+
if (!isHTMLElement(r)) return a();
|
|
69
|
+
a(), l = n, s = r, u = new MutationObserver((n) => {
|
|
70
70
|
const o = e.getRootElement(), r = o && o.parentElement;
|
|
71
|
-
if (o !==
|
|
72
|
-
for (const t of n) if (!
|
|
73
|
-
}),
|
|
71
|
+
if (o !== l || r !== s) return t();
|
|
72
|
+
for (const t of n) if (!f.contains(t.target)) return d();
|
|
73
|
+
}), u.observe(r, nt), d();
|
|
74
74
|
});
|
|
75
75
|
return () => {
|
|
76
|
-
|
|
76
|
+
g(), a();
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function rt(t, e, n, o) {
|
|
80
80
|
if ("text" !== e.type && $isElementNode(n)) {
|
|
81
81
|
const r = $getDOMSlot(n, o, t);
|
|
82
82
|
return [r.element, r.getFirstChildOffset() + e.offset];
|
|
83
83
|
}
|
|
84
84
|
return [($isTextNode(n) ? $getDOMTextNode(n, o, t) : getDOMTextNode(o)) || o, e.offset];
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function it(t) {
|
|
87
87
|
for (const e of t) {
|
|
88
88
|
const t = e.style;
|
|
89
|
-
"Highlight" !== t.background && (t.background = "Highlight"), "HighlightText" !== t.color && (t.color = "HighlightText"), t.marginTop !==
|
|
89
|
+
"Highlight" !== t.background && (t.background = "Highlight"), "HighlightText" !== t.color && (t.color = "HighlightText"), t.marginTop !== et(-1.5) && (t.marginTop = et(-1.5)), t.paddingTop !== et(4) && (t.paddingTop = et(4)), t.paddingBottom !== et(0) && (t.paddingBottom = et(0));
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
let n = null,
|
|
94
|
-
function a(
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
if (!$isRangeSelection(
|
|
92
|
+
function lt(t, e = it) {
|
|
93
|
+
let n = null, o = null, s = null, u = null, c = null, f = null, d = () => {};
|
|
94
|
+
function a(r) {
|
|
95
|
+
r.read(() => {
|
|
96
|
+
const r = $getSelection();
|
|
97
|
+
if (!$isRangeSelection(r)) return n = null, s = null, u = null, f = null, d(), void (d = () => {});
|
|
98
98
|
const [a, g] = function(t) {
|
|
99
99
|
const e = t.getStartEndPoints();
|
|
100
100
|
return t.isBackward() ? [e[1], e[0]] : e;
|
|
101
|
-
}(
|
|
102
|
-
if ((
|
|
101
|
+
}(r), 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), x = null === n || w !== o || m !== s || h !== n.getKey(), S = null === u || C !== c || E !== f || v !== u.getKey();
|
|
102
|
+
if ((x || S) && null !== w && null !== C) {
|
|
103
103
|
const n = function(t, e, n, o, r, i, l) {
|
|
104
104
|
const s = (t._window ? t._window.document : document).createRange();
|
|
105
|
-
return s.setStart(...
|
|
105
|
+
return s.setStart(...rt(t, e, n, o)), s.setEnd(...rt(t, r, i, l)), s;
|
|
106
106
|
}(t, a, p, w, g, y, C);
|
|
107
|
-
d(), d =
|
|
107
|
+
d(), d = ot(t, n, e);
|
|
108
108
|
}
|
|
109
|
-
n = p,
|
|
109
|
+
n = p, o = w, s = m, u = y, c = C, f = E;
|
|
110
110
|
}, { editor: t });
|
|
111
111
|
}
|
|
112
112
|
return a(t.getEditorState()), mergeRegister(t.registerUpdateListener(({ editorState: t }) => a(t)), () => {
|
|
113
113
|
d();
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function st(t, e) {
|
|
117
117
|
let n = null;
|
|
118
118
|
const o = () => {
|
|
119
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 =
|
|
120
|
+
null !== l && null !== o && o.contains(l) ? null !== n && (n(), n = null) : null === n && (n = lt(t, e));
|
|
121
121
|
};
|
|
122
122
|
return t.registerRootListener((t) => {
|
|
123
123
|
if (t) {
|
|
124
|
-
const e = t.ownerDocument
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
const e = t.ownerDocument, i = mergeRegister(registerEventListener(e, "selectionchange", o), () => {
|
|
125
|
+
null !== n && n();
|
|
126
|
+
});
|
|
127
|
+
return o(), i;
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function ut(t, e) {
|
|
132
132
|
const n = t.ownerDocument, o = n.defaultView || window;
|
|
133
133
|
let r = o.getComputedStyle(t);
|
|
134
134
|
const i = "absolute" === r.position, l = e ? /(auto|scroll|hidden)/ : /(auto|scroll)/;
|
|
@@ -136,11 +136,11 @@ function lt(t, e) {
|
|
|
136
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
137
|
return n.body;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function ct(t, e) {
|
|
140
140
|
for (const n of e) if (t.type.startsWith(n)) return !0;
|
|
141
141
|
return !1;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function ft(t, e) {
|
|
144
144
|
const n = t[Symbol.iterator]();
|
|
145
145
|
return new Promise((t, o) => {
|
|
146
146
|
const r = [], i = () => {
|
|
@@ -153,37 +153,37 @@ function ut(t, e) {
|
|
|
153
153
|
file: s,
|
|
154
154
|
result: t
|
|
155
155
|
}), i();
|
|
156
|
-
}),
|
|
156
|
+
}), ct(s, e) ? u.readAsDataURL(s) : i();
|
|
157
157
|
};
|
|
158
158
|
i();
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
return Array.from(
|
|
161
|
+
function dt(t, e) {
|
|
162
|
+
return Array.from(pt(t, e));
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function at(t) {
|
|
165
165
|
return t ? t.getAdjacentCaret() : null;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
return Array.from(
|
|
167
|
+
function gt(t, e) {
|
|
168
|
+
return Array.from(St(t, e));
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
return
|
|
170
|
+
function pt(t, e) {
|
|
171
|
+
return Et("next", t, e);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
return Array.from(
|
|
173
|
+
function ht(t, e) {
|
|
174
|
+
return Array.from(mt(t, e));
|
|
175
175
|
}
|
|
176
|
-
function*
|
|
177
|
-
for (const n of
|
|
176
|
+
function* mt(t, e) {
|
|
177
|
+
for (const n of Et("next", t, e)) {
|
|
178
178
|
yield n;
|
|
179
179
|
const { node: t, depth: o } = n;
|
|
180
180
|
if ($isSlotHost(t) && !t.is(e)) for (const e of $getSlotNames(t)) {
|
|
181
181
|
const n = $getSlot(t, e);
|
|
182
|
-
null !== n && (yield*
|
|
182
|
+
null !== n && (yield* yt(n, o + 1));
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
function*
|
|
186
|
+
function* yt(t, e) {
|
|
187
187
|
yield {
|
|
188
188
|
depth: e,
|
|
189
189
|
node: t
|
|
@@ -191,17 +191,17 @@ function* ht(t, e) {
|
|
|
191
191
|
const n = e + 1;
|
|
192
192
|
if ($isSlotHost(t)) for (const e of $getSlotNames(t)) {
|
|
193
193
|
const o = $getSlot(t, e);
|
|
194
|
-
null !== o && (yield*
|
|
194
|
+
null !== o && (yield* yt(o, n));
|
|
195
195
|
}
|
|
196
|
-
if ($isElementNode(t)) for (const e of t.getChildren()) yield*
|
|
196
|
+
if ($isElementNode(t)) for (const e of t.getChildren()) yield* yt(e, n);
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function vt(t, e) {
|
|
199
199
|
const n = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(t, e));
|
|
200
200
|
return n && n[0];
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
const o = $getRoot(), r = e || o, i = $isElementNode(r) ? $getChildCaret(r, t) : $getSiblingCaret(r, t),
|
|
204
|
-
let c =
|
|
202
|
+
function Et(t, e, n) {
|
|
203
|
+
const o = $getRoot(), r = e || o, i = $isElementNode(r) ? $getChildCaret(r, t) : $getSiblingCaret(r, t), l = Ct(r), u = n ? $getAdjacentChildCaret($getChildCaretOrSelf($getSiblingCaret(n, t))) || vt(n, t) : vt(r, t);
|
|
204
|
+
let c = l;
|
|
205
205
|
return makeStepwiseIterator({
|
|
206
206
|
hasNext: (t) => null !== t,
|
|
207
207
|
initial: i,
|
|
@@ -217,31 +217,31 @@ function yt(t, e, n) {
|
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function wt(t) {
|
|
221
221
|
const e = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(t, "next"));
|
|
222
222
|
return e && [e[0].origin, e[1]];
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Ct(t) {
|
|
225
225
|
let e = -1;
|
|
226
226
|
for (let n = t; null !== n; n = n.getParent() ?? $getSlotHost(n)) e++;
|
|
227
227
|
return e;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function xt(t) {
|
|
230
230
|
const n = $getAdjacentSiblingOrParentSiblingCaret($getChildCaretOrSelf($getSiblingCaret(t, "previous")), "root");
|
|
231
231
|
return n && n[0].origin;
|
|
232
232
|
}
|
|
233
|
-
function Ct(t, e) {
|
|
234
|
-
return yt("previous", t, e);
|
|
235
|
-
}
|
|
236
233
|
function St(t, e) {
|
|
237
|
-
return
|
|
234
|
+
return Et("previous", t, e);
|
|
238
235
|
}
|
|
239
|
-
function
|
|
236
|
+
function Nt(t, e) {
|
|
237
|
+
return Array.from(At(t, e));
|
|
238
|
+
}
|
|
239
|
+
function* At(t, e) {
|
|
240
240
|
const n = [];
|
|
241
|
-
for (const o of
|
|
241
|
+
for (const o of Et("previous", t, e)) {
|
|
242
242
|
for (; n.length > 0 && o.depth <= n[n.length - 1].depth;) {
|
|
243
243
|
const t = n.pop();
|
|
244
|
-
yield*
|
|
244
|
+
yield* bt(t.node, t.depth + 1);
|
|
245
245
|
}
|
|
246
246
|
yield o;
|
|
247
247
|
const { node: t, depth: r } = o;
|
|
@@ -252,17 +252,17 @@ function* xt(t, e) {
|
|
|
252
252
|
}
|
|
253
253
|
for (; n.length > 0;) {
|
|
254
254
|
const t = n.pop();
|
|
255
|
-
yield*
|
|
255
|
+
yield* bt(t.node, t.depth + 1);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
function*
|
|
258
|
+
function* bt(t, e) {
|
|
259
259
|
const n = $getSlotNames(t);
|
|
260
260
|
for (let o = n.length - 1; o >= 0; o--) {
|
|
261
261
|
const r = $getSlot(t, n[o]);
|
|
262
|
-
null !== r && (yield*
|
|
262
|
+
null !== r && (yield* Rt(r, e));
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
function*
|
|
265
|
+
function* Rt(t, e) {
|
|
266
266
|
yield {
|
|
267
267
|
depth: e,
|
|
268
268
|
node: t
|
|
@@ -270,11 +270,11 @@ function* At(t, e) {
|
|
|
270
270
|
const n = e + 1;
|
|
271
271
|
if ($isElementNode(t)) {
|
|
272
272
|
const e = t.getChildren();
|
|
273
|
-
for (let t = e.length - 1; t >= 0; t--) yield*
|
|
273
|
+
for (let t = e.length - 1; t >= 0; t--) yield* Rt(e[t], n);
|
|
274
274
|
}
|
|
275
|
-
$isSlotHost(t) && (yield*
|
|
275
|
+
$isSlotHost(t) && (yield* bt(t, n));
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function _t(t, e) {
|
|
278
278
|
let n = t;
|
|
279
279
|
for (; null != n;) {
|
|
280
280
|
if (n instanceof e) return n;
|
|
@@ -282,17 +282,17 @@ function bt(t, e) {
|
|
|
282
282
|
}
|
|
283
283
|
return null;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function It(t) {
|
|
286
286
|
const e = $findMatchingParent(t, (t) => $isElementNode(t) && !t.isInline());
|
|
287
|
-
return $isElementNode(e) ||
|
|
287
|
+
return $isElementNode(e) || Z(4, t.__key), e;
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function Lt(t, e) {
|
|
290
290
|
const n = $getCaretRangeInDirection($isRangeSelection(e) ? $caretRangeFromSelection(e) : e, "next"), o = $getSlotFrame(n.anchor.origin), r = $getSlotFrame(t.getLatest());
|
|
291
291
|
if (null === o ? null !== r : !o.is(r)) return !1;
|
|
292
|
-
const
|
|
293
|
-
return $comparePointCaretNext(n.anchor,
|
|
292
|
+
const i = $normalizeCaret($getChildCaret(t, "next")), s = $getCaretInDirection($normalizeCaret($getChildCaret(t, "previous")), "next");
|
|
293
|
+
return $comparePointCaretNext(n.anchor, i) <= 0 && $comparePointCaretNext(n.focus, s) >= 0;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Pt(t, e, n, o) {
|
|
296
296
|
const r = (t) => t instanceof e;
|
|
297
297
|
return t.registerNodeTransform(e, (t) => {
|
|
298
298
|
const e = ((t) => {
|
|
@@ -330,7 +330,7 @@ function Dt(t, e) {
|
|
|
330
330
|
const r = e._selection;
|
|
331
331
|
$setSelection(null === r ? null : r.clone());
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Bt(t) {
|
|
334
334
|
const e = $getSelection() || $getPreviousSelection();
|
|
335
335
|
let n;
|
|
336
336
|
if ($isRangeSelection(e)) n = $caretFromPoint(e.focus, "next");
|
|
@@ -341,10 +341,10 @@ function It(t) {
|
|
|
341
341
|
}
|
|
342
342
|
n = n || $getChildCaret($getRoot(), "previous").getFlipped().insert($createParagraphNode());
|
|
343
343
|
}
|
|
344
|
-
const o = $insertNodeToNearestRootAtCaret(t, n),
|
|
345
|
-
return $setSelectionFromCaretRange($getCollapsedCaretRange($isChildCaret(
|
|
344
|
+
const o = $insertNodeToNearestRootAtCaret(t, n), r = $getAdjacentChildCaret(o);
|
|
345
|
+
return $setSelectionFromCaretRange($getCollapsedCaretRange($isChildCaret(r) ? $normalizeCaret(r) : o)), t.getLatest();
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ot(t) {
|
|
348
348
|
const e = $getSelection();
|
|
349
349
|
if (!$isRangeSelection(e)) return void (e && e.insertNodes([t]));
|
|
350
350
|
let o = $getCaretRangeInDirection($removeTextFromCaretRange($caretRangeFromSelection(e)), "next").anchor;
|
|
@@ -353,19 +353,19 @@ function Pt(t) {
|
|
|
353
353
|
if (!t) return;
|
|
354
354
|
o = t;
|
|
355
355
|
}
|
|
356
|
-
const
|
|
357
|
-
|
|
356
|
+
const r = o.getFlipped();
|
|
357
|
+
r.insert(t), $setSelectionFromCaretRange($getCaretRange(r, r));
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Tt(t, e) {
|
|
360
360
|
const n = e();
|
|
361
361
|
return t.replace(n), n.append(t), n;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Mt(t, e) {
|
|
364
364
|
return null !== t && Object.getPrototypeOf(t).constructor.name === e.name;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Ft(t) {
|
|
367
367
|
let e = null;
|
|
368
|
-
if (
|
|
368
|
+
if (Mt(t, DragEvent) ? e = t.dataTransfer : Mt(t, ClipboardEvent) && (e = t.clipboardData), null === e) return [
|
|
369
369
|
!1,
|
|
370
370
|
[],
|
|
371
371
|
!1
|
|
@@ -377,7 +377,7 @@ function Tt(t) {
|
|
|
377
377
|
r
|
|
378
378
|
];
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Kt(t, e) {
|
|
381
381
|
const n = [];
|
|
382
382
|
for (let o = 0; o < t.length; o++) {
|
|
383
383
|
const r = e(t[o]);
|
|
@@ -385,64 +385,64 @@ function Ft(t, e) {
|
|
|
385
385
|
}
|
|
386
386
|
return n;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function $t(t) {
|
|
389
389
|
const e = $getSelection();
|
|
390
390
|
if (!$isRangeSelection(e)) return !1;
|
|
391
391
|
const n = /* @__PURE__ */ new Set(), o = e.getNodes();
|
|
392
392
|
for (let e = 0; e < o.length; e++) {
|
|
393
393
|
const r = o[e], i = r.getKey();
|
|
394
394
|
if (n.has(i)) continue;
|
|
395
|
-
const
|
|
396
|
-
if (null ===
|
|
397
|
-
const u =
|
|
398
|
-
|
|
395
|
+
const l = $findMatchingParent(r, (t) => $isElementNode(t) && !t.isInline());
|
|
396
|
+
if (null === l) continue;
|
|
397
|
+
const u = l.getKey();
|
|
398
|
+
l.canIndent() && !n.has(u) && (n.add(u), t(l));
|
|
399
399
|
}
|
|
400
400
|
return n.size > 0;
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Ht(t, e) {
|
|
403
403
|
$getChildCaret(t, "next").insert(e);
|
|
404
404
|
}
|
|
405
|
-
let
|
|
406
|
-
function
|
|
405
|
+
let kt = !(IS_FIREFOX || !CAN_USE_DOM) && void 0;
|
|
406
|
+
function Ut(t, e = !1) {
|
|
407
407
|
let n = 1;
|
|
408
408
|
if (function() {
|
|
409
|
-
if (void 0 ===
|
|
409
|
+
if (void 0 === kt) {
|
|
410
410
|
const t = document.createElement("div");
|
|
411
411
|
t.style.position = "absolute", t.style.opacity = "0", t.style.width = "100px", t.style.left = "-1000px", document.body.appendChild(t);
|
|
412
412
|
const e = t.getBoundingClientRect();
|
|
413
|
-
t.style.setProperty("zoom", "2"),
|
|
413
|
+
t.style.setProperty("zoom", "2"), kt = t.getBoundingClientRect().width === e.width, document.body.removeChild(t);
|
|
414
414
|
}
|
|
415
|
-
return
|
|
415
|
+
return kt;
|
|
416
416
|
}() || e) {
|
|
417
417
|
const e = t && t.ownerDocument.defaultView || window;
|
|
418
418
|
for (; t;) n *= Number(e.getComputedStyle(t).getPropertyValue("zoom")), t = getParentElement(t);
|
|
419
419
|
}
|
|
420
420
|
return n;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function jt(t) {
|
|
423
423
|
return null !== t._parentEditor;
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
return
|
|
425
|
+
function zt(t, e) {
|
|
426
|
+
return Vt(t, e, null);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Vt(t, e, n) {
|
|
429
429
|
let o = !1;
|
|
430
|
-
for (const r of
|
|
430
|
+
for (const r of Gt(t)) e(r) ? null !== n && n(r) : (o = !0, $isElementNode(r) && Vt(r, e, n || ((t) => r.insertAfter(t))), r.remove());
|
|
431
431
|
return o;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function Wt(t, e) {
|
|
434
434
|
const n = [], o = Array.from(t).reverse();
|
|
435
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
|
|
436
|
+
else if ($isElementNode(t)) for (const e of Gt(t)) o.push(e);
|
|
437
437
|
return n;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
return
|
|
439
|
+
function Xt(t) {
|
|
440
|
+
return Yt($getChildCaret(t, "next"));
|
|
441
441
|
}
|
|
442
|
-
function
|
|
443
|
-
return
|
|
442
|
+
function Gt(t) {
|
|
443
|
+
return Yt($getChildCaret(t, "previous"));
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function Yt(t) {
|
|
446
446
|
return makeStepwiseIterator({
|
|
447
447
|
hasNext: $isSiblingCaret,
|
|
448
448
|
initial: t.getAdjacentCaret(),
|
|
@@ -450,10 +450,10 @@ function Xt(t) {
|
|
|
450
450
|
step: (t) => t.getAdjacentCaret()
|
|
451
451
|
});
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function qt(t) {
|
|
454
454
|
$rewindSiblingCaret($getSiblingCaret(t, "next")).splice(1, t.getChildren());
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function Jt(t) {
|
|
457
457
|
const e = (e) => $getState(e, t), n = (e, n) => $setState(e, t, n);
|
|
458
458
|
return {
|
|
459
459
|
$get: e,
|
|
@@ -468,37 +468,33 @@ function Yt(t) {
|
|
|
468
468
|
stateConfig: t
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function Qt(t, e) {
|
|
472
472
|
const n = $getSelection();
|
|
473
473
|
if ($isRangeSelection(n) && n.isCollapsed()) {
|
|
474
474
|
const o = $findMatchingParent(n.anchor.getNode(), t);
|
|
475
475
|
if (o) {
|
|
476
476
|
const t = o.getParent();
|
|
477
|
-
if (null !== t && t.getFirstChild() === o &&
|
|
477
|
+
if (null !== t && t.getFirstChild() === o && te(n.anchor, o)) return o.insertBefore($createParagraphNode()).selectEnd(), e && e.preventDefault(), !0;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
return !1;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Zt(t, e) {
|
|
483
483
|
const n = $getSelection();
|
|
484
484
|
if ($isRangeSelection(n) && n.isCollapsed()) {
|
|
485
485
|
const o = $findMatchingParent(n.anchor.getNode(), t);
|
|
486
486
|
if (o) {
|
|
487
487
|
const t = o.getParent();
|
|
488
|
-
if (null !== t && t.getLastChild() === o &&
|
|
488
|
+
if (null !== t && t.getLastChild() === o && ee(n.anchor, o)) return o.insertAfter($createParagraphNode()).selectEnd(), e && e.preventDefault(), !0;
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
return !1;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
|
|
495
|
-
const n = e.getFirstDescendant() ?? e, o = t.getNode();
|
|
496
|
-
return o === n || $isElementNode(o) && o.getFirstDescendant() === n;
|
|
493
|
+
function te(t, n) {
|
|
494
|
+
return $isAtEdgeOfElement(t, n, "previous");
|
|
497
495
|
}
|
|
498
|
-
function
|
|
499
|
-
|
|
500
|
-
const o = n.getLastDescendant() ?? n, r = t.getNode();
|
|
501
|
-
return r === o || $isElementNode(r) && r.getLastDescendant() === o;
|
|
496
|
+
function ee(t, n) {
|
|
497
|
+
return $isAtEdgeOfElement(t, n, "next");
|
|
502
498
|
}
|
|
503
499
|
//#endregion
|
|
504
|
-
export {
|
|
500
|
+
export { Wt as $descendantsMatching, dt as $dfs, pt as $dfsIterator, ht as $dfsWithSlots, mt as $dfsWithSlotsIterator, Kt as $filter, $findMatchingParent, Xt as $firstToLastIterator, at as $getAdjacentCaret, $getAdjacentSiblingOrParentSiblingCaret, Ct as $getDepth, It as $getNearestBlockElementAncestorOrThrow, _t as $getNearestNodeOfType, xt as $getNextRightPreorderNode, wt as $getNextSiblingOrParentSibling, $t as $handleIndentAndOutdent, Ht as $insertFirst, Ot as $insertNodeIntoLeaf, Bt as $insertNodeToNearestRoot, $insertNodeToNearestRootAtCaret, ee as $isAtEndOfNode, te as $isAtStartOfNode, Lt as $isBlockFullySelected, jt as $isEditorIsNestedEditor, Gt as $lastToFirstIterator, Zt as $onEscapeDown, Qt as $onEscapeUp, Dt as $restoreEditorState, gt as $reverseDfs, St as $reverseDfsIterator, Nt as $reverseDfsWithSlots, At as $reverseDfsWithSlotsIterator, $splitNode, zt as $unwrapAndFilterDescendants, qt as $unwrapNode, Tt 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, Ut as calculateZoomLevel, tt as dedupeSelectionRects, Ft as eventFiles, ut as getScrollParent, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, ct as isMimeType, Jt as makeStateWrapper, lt as markSelection, ft as mediaFileReader, mergeRegister, Mt as objectKlassEquals, ot as positionNodeOnRange, Pt as registerNestedElementResolver, removeClassNamesFromElement, st as selectionAlwaysOnDisplay };
|
package/dist/bin/mxs.mjs
CHANGED