@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.
- package/README.md +30 -0
- package/ROADMAP.md +1 -0
- package/dist/{Lexical.dev-rcxzwpir.mjs → Lexical.dev-By5dOKBN.mjs} +1486 -356
- package/dist/{Lexical.node-BUsI9gWr.mjs → Lexical.node-fXM8Jp7p.mjs} +39 -17
- package/dist/{Lexical.prod-C8HtkSD6.mjs → Lexical.prod-BlCvXPGa.mjs} +2279 -1768
- package/dist/LexicalClipboard.dev--HxGoSkO.mjs +915 -0
- package/dist/{LexicalClipboard.node-CO-MCKx5.mjs → LexicalClipboard.node-C3mRbrmW.mjs} +10 -3
- package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +371 -0
- package/dist/LexicalCodeCore.dev-DjSrd4A4.mjs +1109 -0
- package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +642 -0
- package/dist/{LexicalDragon.dev-gBP8WSRS.mjs → LexicalDragon.dev-DwprRH0z.mjs} +3 -3
- package/dist/{LexicalDragon.node-OG6G55nl.mjs → LexicalDragon.node-BVhw4C7s.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DP-_Q8cv.mjs → LexicalDragon.prod-nh4J-8vn.mjs} +3 -3
- package/dist/{LexicalExtension.dev-DVbjljrm.mjs → LexicalExtension.dev-BPNyvGqe.mjs} +335 -6
- package/dist/{LexicalExtension.node-CF3EAPN7.mjs → LexicalExtension.node-BVlcrgOx.mjs} +15 -8
- package/dist/{LexicalExtension.prod-DklHHErZ.mjs → LexicalExtension.prod-DFKbiNt-.mjs} +375 -265
- package/dist/{LexicalHeadless.dev-DdWLM7Nl.mjs → LexicalHeadless.dev-B-cj7Pr5.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-CoiiTDzR.mjs → LexicalHeadless.prod-Byp1vNzT.mjs} +2 -2
- package/dist/LexicalHtml.dev-prBAwszN.mjs +2424 -0
- package/dist/LexicalHtml.node-BvNF96jZ.mjs +56 -0
- package/dist/LexicalHtml.prod-Sz3CW1ht.mjs +1207 -0
- package/dist/{LexicalLink.dev-BS1Bf-yD.mjs → LexicalLink.dev-NySTYhVR.mjs} +42 -8
- package/dist/{LexicalLink.prod-B_crkoHP.mjs → LexicalLink.prod-BuCM8gts.mjs} +209 -191
- package/dist/{LexicalList.dev-OMqmcnQ-.mjs → LexicalList.dev-DIMOvSFD.mjs} +252 -80
- package/dist/{LexicalList.prod-CpL1s8vS.mjs → LexicalList.prod-MVqfA6Vo.mjs} +364 -278
- package/dist/{LexicalMarkdown.dev-BHSdx_Gr.mjs → LexicalMarkdown.dev-C7aylvCG.mjs} +729 -552
- package/dist/LexicalMarkdown.prod-CfQSM406.mjs +868 -0
- package/dist/{LexicalRichText.dev-Bz9A_WbM.mjs → LexicalRichText.dev-DfICq6lU.mjs} +272 -77
- package/dist/{LexicalRichText.node-DDpwfE-P.mjs → LexicalRichText.node-Bg9jND3Q.mjs} +21 -8
- package/dist/LexicalRichText.prod-GsFzCK-o.mjs +550 -0
- package/dist/{LexicalSelection.dev-CQ380fnD.mjs → LexicalSelection.dev-DGjj12wW.mjs} +50 -38
- package/dist/{LexicalSelection.node-DesBMjIE.mjs → LexicalSelection.node-BU5L4193.mjs} +4 -4
- package/dist/{LexicalSelection.prod-D2jivCDB.mjs → LexicalSelection.prod-D-PwRbyK.mjs} +158 -140
- package/dist/{LexicalTable.dev-Ca7mQ7Jk.mjs → LexicalTable.dev-ChP7cugd.mjs} +215 -53
- package/dist/{LexicalTable.prod-DyPAcC7y.mjs → LexicalTable.prod-Bpr9YRXp.mjs} +668 -573
- package/dist/{LexicalUtils.dev-HxM8F0g6.mjs → LexicalUtils.dev-BiFU3789.mjs} +10 -47
- package/dist/{LexicalUtils.node-lCWjRjoG.mjs → LexicalUtils.node-j3Llm7Y3.mjs} +2 -2
- package/dist/{LexicalUtils.prod-Bti5w4ki.mjs → LexicalUtils.prod-DCvrA78p.mjs} +103 -105
- package/dist/bin/mxs.d.mts +1 -1
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-By7trG9K.mjs +2 -0
- package/dist/{esm-CK9m5JKX.mjs → esm-Dg-WhPCe.mjs} +989 -989
- package/dist/index.d.mts +11 -2
- package/dist/index.mjs +1 -1
- package/dist/{mxs-BZt1cLW9.mjs → mxs-BR5Y5ash.mjs} +25141 -24672
- package/package.json +15 -14
- package/skills/commands-auth.md +1 -1
- package/skills/commands-category.md +1 -1
- package/skills/commands-comment.md +1 -1
- package/skills/commands-config.md +1 -1
- package/skills/commands-preview.md +1 -1
- package/skills/commands-profile.md +1 -1
- package/skills/commands-project.md +57 -0
- package/skills/commands-topic.md +1 -1
- package/skills/output-modes.md +1 -1
- package/skills/overview.md +2 -1
- package/skills/safety.md +10 -0
- package/dist/LexicalClipboard.dev-BpqRwTLP.mjs +0 -494
- package/dist/LexicalClipboard.prod-B_xdeiAC.mjs +0 -291
- package/dist/LexicalCodeCore.dev-7_cexm39.mjs +0 -537
- package/dist/LexicalCodeCore.prod-Bd6WFHcO.mjs +0 -381
- package/dist/LexicalHtml.dev-C3ZSWBFZ.mjs +0 -684
- package/dist/LexicalHtml.node-D0TD152E.mjs +0 -24
- package/dist/LexicalHtml.prod-CX47X0zl.mjs +0 -430
- package/dist/LexicalMarkdown.prod-C-S7Ii6-.mjs +0 -754
- package/dist/LexicalRichText.prod-C8qXACDL.mjs +0 -427
- package/dist/esm-DRbkkY3r.mjs +0 -2
- /package/dist/{mxs-CM8-6uAr.d.mts → mxs-iqJBopvE.d.mts} +0 -0
|
@@ -0,0 +1,1207 @@
|
|
|
1
|
+
import { d as getPeerDependencyFromEditor, i as HorizontalRuleExtension, n as $getExtensionOutput, t as $createHorizontalRuleNode, u as getKnownTypesAndNodes } from "./LexicalExtension.node-BVlcrgOx.mjs";
|
|
2
|
+
import { $ as $isElementNode, At as ArtificialNode__DO_NOT_USE, Cn as IS_STRIKETHROUGH, En as IS_UNDERLINE, F as $getEditor, Fr as shallowMergeConfig, Gn as RootNode, Gt as DEFAULT_EDITOR_DOM_CONFIG, H as $getRoot, I as $getEditorDOMRenderConfig, Pr as setNodeIndentFromDOM, Sr as isHTMLElement, St as $setFormatFromDOM, Tn as IS_SUPERSCRIPT, Y as $isBlockElementNode, Z as $isDecoratorNode, _ as $createTextNode, _n as IS_CODE, _r as isDOMDocumentNode, b as $fullReconcile, br as isDocumentFragment, cr as defineExtension, f as $createParagraphNode, fr as getStaticNodeConfig, ft as $isTextNode, hn as IS_BOLD, hr as isBlockDomNode, lt as $isRootOrShadowRoot, or as createState, rr as configExtension, rt as $isLexicalNode, u as $createLineBreakNode, wn as IS_SUBSCRIPT, wr as isInlineDomNode, x as $generateNodesFromRawText, xn as IS_ITALIC, xt as $setDirectionFromDOM, yn as IS_HIGHLIGHT, yr as isDOMTextNode } from "./Lexical.node-fXM8Jp7p.mjs";
|
|
3
|
+
import { i as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-BU5L4193.mjs";
|
|
4
|
+
import { g as objectKlassEquals } from "./LexicalUtils.node-j3Llm7Y3.mjs";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@lexical+html@0.45.0/node_modules/@lexical/html/dist/LexicalHtml.prod.mjs
|
|
6
|
+
/**
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
function G(t, ...e) {
|
|
14
|
+
const n = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
15
|
+
o.append("code", t);
|
|
16
|
+
for (const t of e) o.append("v", t);
|
|
17
|
+
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.`);
|
|
18
|
+
}
|
|
19
|
+
let H;
|
|
20
|
+
function J(t, e) {
|
|
21
|
+
const { key: n } = e;
|
|
22
|
+
return t && n in t ? t[n] : e.defaultValue;
|
|
23
|
+
}
|
|
24
|
+
function Q(t) {
|
|
25
|
+
return H && H.editor === t ? H : void 0;
|
|
26
|
+
}
|
|
27
|
+
function K(t, e) {
|
|
28
|
+
const n = Q(e);
|
|
29
|
+
return n && n[t];
|
|
30
|
+
}
|
|
31
|
+
function Y(t, e) {
|
|
32
|
+
if ("cfg" in e) {
|
|
33
|
+
const { cfg: n, updater: o } = e;
|
|
34
|
+
return [n, o(J(t, n))];
|
|
35
|
+
}
|
|
36
|
+
return e;
|
|
37
|
+
}
|
|
38
|
+
function Z(t, e) {
|
|
39
|
+
let n = e;
|
|
40
|
+
for (const o of t) {
|
|
41
|
+
const [t, r] = Y(n, o), s = t.key;
|
|
42
|
+
if (n === e && J(n, t) === r) continue;
|
|
43
|
+
const i = n === e || void 0 === n ? X(e) : n;
|
|
44
|
+
i[s] = r, n = i;
|
|
45
|
+
}
|
|
46
|
+
return n;
|
|
47
|
+
}
|
|
48
|
+
function X(t) {
|
|
49
|
+
return Object.create(t || null);
|
|
50
|
+
}
|
|
51
|
+
function tt(t, e) {
|
|
52
|
+
return [t, e];
|
|
53
|
+
}
|
|
54
|
+
function et(t, e) {
|
|
55
|
+
return {
|
|
56
|
+
cfg: t,
|
|
57
|
+
updater: e
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function nt(t, n, o, r = $getEditor()) {
|
|
61
|
+
const s = H, i = Q(r);
|
|
62
|
+
try {
|
|
63
|
+
return H = {
|
|
64
|
+
...i,
|
|
65
|
+
editor: r,
|
|
66
|
+
[t]: n
|
|
67
|
+
}, o();
|
|
68
|
+
} finally {
|
|
69
|
+
H = s;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function ot(t, n = () => {}) {
|
|
73
|
+
return (o, r = $getEditor()) => (e) => {
|
|
74
|
+
const s = Q(r), i = s && s[t], c = Z(o, i || n(r));
|
|
75
|
+
return c && c !== i ? nt(t, c, e, r) : e();
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function rt(t, e, o, r) {
|
|
79
|
+
return Object.assign(createState(Symbol(e), {
|
|
80
|
+
isEqual: r,
|
|
81
|
+
parse: o
|
|
82
|
+
}), { [t]: !0 });
|
|
83
|
+
}
|
|
84
|
+
const st = (t, e, n) => {
|
|
85
|
+
it(t), n();
|
|
86
|
+
};
|
|
87
|
+
function it(t) {
|
|
88
|
+
if (!isDOMDocumentNode(t)) return;
|
|
89
|
+
const e = t;
|
|
90
|
+
if (null === e.querySelector("style")) return;
|
|
91
|
+
const n = /* @__PURE__ */ new Map();
|
|
92
|
+
function s(t) {
|
|
93
|
+
let e = n.get(t);
|
|
94
|
+
if (void 0 === e) {
|
|
95
|
+
e = /* @__PURE__ */ new Set();
|
|
96
|
+
for (let n = 0; n < t.style.length; n++) e.add(t.style[n]);
|
|
97
|
+
n.set(t, e);
|
|
98
|
+
}
|
|
99
|
+
return e;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
for (const t of Array.from(e.styleSheets)) {
|
|
103
|
+
let n;
|
|
104
|
+
try {
|
|
105
|
+
n = t.cssRules;
|
|
106
|
+
} catch (t) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
for (const t of Array.from(n)) {
|
|
110
|
+
if (!objectKlassEquals(t, CSSStyleRule)) continue;
|
|
111
|
+
let n;
|
|
112
|
+
try {
|
|
113
|
+
n = e.querySelectorAll(t.selectorText);
|
|
114
|
+
} catch (t) {
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
for (const e of Array.from(n)) {
|
|
118
|
+
if (!isHTMLElement(e)) continue;
|
|
119
|
+
const n = s(e);
|
|
120
|
+
for (let o = 0; o < t.style.length; o++) {
|
|
121
|
+
const r = t.style[o];
|
|
122
|
+
n.has(r) || e.style.setProperty(r, t.style.getPropertyValue(r), t.style.getPropertyPriority(r));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
} catch (t) {}
|
|
128
|
+
}
|
|
129
|
+
const ct = "@lexical/html/DOM", lt = Symbol.for("@lexical/html/DOMExportContext"), ut = "@lexical/html/DOMImport", ft = Symbol.for("@lexical/html/DOMImportContext"), at = () => !0;
|
|
130
|
+
function pt(t, e, n) {
|
|
131
|
+
return rt(lt, t, e, n);
|
|
132
|
+
}
|
|
133
|
+
const dt = pt("root", Boolean), ht = pt("isExport", Boolean);
|
|
134
|
+
function gt(t) {
|
|
135
|
+
const e = getPeerDependencyFromEditor(t, ct);
|
|
136
|
+
return e ? e.output.defaults : void 0;
|
|
137
|
+
}
|
|
138
|
+
function mt(t, n = $getEditor()) {
|
|
139
|
+
return J(function(t) {
|
|
140
|
+
return K(lt, t) || gt(t);
|
|
141
|
+
}(n), t);
|
|
142
|
+
}
|
|
143
|
+
function yt(t) {
|
|
144
|
+
const e = getPeerDependencyFromEditor(t, ct);
|
|
145
|
+
return e ? e.output.runtime : void 0;
|
|
146
|
+
}
|
|
147
|
+
function xt(t, n, o = $getEditor()) {
|
|
148
|
+
const r = yt(o);
|
|
149
|
+
r && r.setContextValue(t, n);
|
|
150
|
+
}
|
|
151
|
+
function St(t, n, o = $getEditor()) {
|
|
152
|
+
const r = yt(o);
|
|
153
|
+
r && r.setContextValue(t, n(J(r.editorContext, t)));
|
|
154
|
+
}
|
|
155
|
+
function $t(t = $getEditor()) {
|
|
156
|
+
const n = yt(t);
|
|
157
|
+
return n ? n.getSessionConfig() : $getEditorDOMRenderConfig(t);
|
|
158
|
+
}
|
|
159
|
+
const vt = ot(lt, gt);
|
|
160
|
+
function bt(t, e, n) {
|
|
161
|
+
return {
|
|
162
|
+
...e,
|
|
163
|
+
...n,
|
|
164
|
+
nodes: t
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function Ct(t) {
|
|
168
|
+
return (e) => e instanceof t;
|
|
169
|
+
}
|
|
170
|
+
function kt(t, { nodes: e }) {
|
|
171
|
+
if ("*" === e) return at;
|
|
172
|
+
let n = {};
|
|
173
|
+
const o = [];
|
|
174
|
+
for (const r of e) if ("getType" in r) {
|
|
175
|
+
const e = r.getType();
|
|
176
|
+
if (n) {
|
|
177
|
+
const o = t[e];
|
|
178
|
+
void 0 === o && G(339, r.name, e), n = Object.assign(n, o.types);
|
|
179
|
+
}
|
|
180
|
+
o.push(Ct(r));
|
|
181
|
+
} else n = void 0, o.push(r);
|
|
182
|
+
return n || (1 === o.length ? o[0] : (t) => {
|
|
183
|
+
for (const e of o) if (e(t)) return !0;
|
|
184
|
+
return !1;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function Ot(t) {
|
|
188
|
+
return (e, n, o) => t(e, o);
|
|
189
|
+
}
|
|
190
|
+
function wt(t) {
|
|
191
|
+
return (e, n, o, r) => t(e, n, r);
|
|
192
|
+
}
|
|
193
|
+
function Dt(t) {
|
|
194
|
+
return (e, n, o, r, s) => t(e, n, o, s);
|
|
195
|
+
}
|
|
196
|
+
function Mt(t) {
|
|
197
|
+
return (e, n, o, r, s, i) => t(e, n, o, r, i);
|
|
198
|
+
}
|
|
199
|
+
function At(t, e) {
|
|
200
|
+
return (n, o) => {
|
|
201
|
+
const r = () => t(n, o), s = e(n);
|
|
202
|
+
return s ? s(n, r, o) : r();
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function Nt(t, e) {
|
|
206
|
+
return (n, o, r) => {
|
|
207
|
+
const s = () => t(n, o, r), i = e(n);
|
|
208
|
+
return i ? i(n, o, s, r) : s();
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const It = Nt, Et = wt;
|
|
212
|
+
function Wt(t, e) {
|
|
213
|
+
return (n, o, r, s) => {
|
|
214
|
+
const i = () => t(n, o, r, s), c = e(n);
|
|
215
|
+
return c ? c(n, o, r, i, s) : i();
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function Rt(t, e) {
|
|
219
|
+
return (n, o, r, s, i) => {
|
|
220
|
+
const c = () => t(n, o, r, s, i), l = e(n);
|
|
221
|
+
return l ? l(n, o, r, s, c, i) : c();
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function jt(t, e) {
|
|
225
|
+
return (n, o, r, s) => {
|
|
226
|
+
t(n, o, r, s);
|
|
227
|
+
const i = e(n);
|
|
228
|
+
i && i(n, o, r, s);
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function Tt(t, e, n, o, r) {
|
|
232
|
+
let s = n[e];
|
|
233
|
+
for (const n of t[e]) if ("function" == typeof n[0]) {
|
|
234
|
+
const [t, e] = n;
|
|
235
|
+
s = o(s, (n) => t(n) && e || void 0);
|
|
236
|
+
} else {
|
|
237
|
+
const t = n[1], e = {};
|
|
238
|
+
for (const n in t) {
|
|
239
|
+
const r = t[n];
|
|
240
|
+
r && (e[n] = r.reduce((t, e) => o(t, () => e), s));
|
|
241
|
+
}
|
|
242
|
+
s = o(s, (t) => {
|
|
243
|
+
const n = e[t.getType()];
|
|
244
|
+
return n && r(n);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
n[e] = s;
|
|
248
|
+
}
|
|
249
|
+
function Ft(t, e, n, o) {
|
|
250
|
+
if (!o) return;
|
|
251
|
+
const r = t[e];
|
|
252
|
+
if ("function" == typeof n) r.push([n, o]);
|
|
253
|
+
else {
|
|
254
|
+
const t = r[r.length - 1];
|
|
255
|
+
let e;
|
|
256
|
+
t && "types" === t[0] ? e = t[1] : (e = {}, r.push(["types", e]));
|
|
257
|
+
for (const t in n) {
|
|
258
|
+
const n = e[t] || [];
|
|
259
|
+
e[t] = n, n.push(o);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function Pt(t) {
|
|
264
|
+
return "*" === t.nodes;
|
|
265
|
+
}
|
|
266
|
+
function zt(t, e) {
|
|
267
|
+
const n = function(t) {
|
|
268
|
+
const e = {}, { nodes: n } = getKnownTypesAndNodes(t);
|
|
269
|
+
for (const t of n) e[t.getType()] = {
|
|
270
|
+
klass: t,
|
|
271
|
+
types: {}
|
|
272
|
+
};
|
|
273
|
+
for (const t of Object.values(e)) if (t) {
|
|
274
|
+
const n = t.klass.getType();
|
|
275
|
+
for (let { klass: o } = t; $isLexicalNode(o.prototype); o = Object.getPrototypeOf(o)) {
|
|
276
|
+
const { ownNodeType: t } = getStaticNodeConfig(o), r = t && e[t];
|
|
277
|
+
r && (r.types[n] = !0);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return e;
|
|
281
|
+
}(t), o = {
|
|
282
|
+
$createDOM: [],
|
|
283
|
+
$decorateDOM: [],
|
|
284
|
+
$exportDOM: [],
|
|
285
|
+
$extractWithChild: [],
|
|
286
|
+
$getDOMSlot: [],
|
|
287
|
+
$shouldExclude: [],
|
|
288
|
+
$shouldInclude: [],
|
|
289
|
+
$updateDOM: []
|
|
290
|
+
};
|
|
291
|
+
for (const t of function(t) {
|
|
292
|
+
const e = [], n = [], o = [];
|
|
293
|
+
for (const r of t) if (Pt(r)) e.push(r);
|
|
294
|
+
else if (Array.isArray(r.nodes)) for (const t of r.nodes) $isLexicalNode(t.prototype) ? o.push(1 === r.nodes.length ? r : {
|
|
295
|
+
...r,
|
|
296
|
+
nodes: [t]
|
|
297
|
+
}) : n.push(1 === r.nodes.length ? r : {
|
|
298
|
+
...r,
|
|
299
|
+
nodes: [t]
|
|
300
|
+
});
|
|
301
|
+
const r = /* @__PURE__ */ new Map(), s = (t) => {
|
|
302
|
+
let e = r.get(t);
|
|
303
|
+
if (void 0 === e) {
|
|
304
|
+
e = 0;
|
|
305
|
+
for (let n = t; $isLexicalNode(n.prototype); n = Object.getPrototypeOf(n)) e++;
|
|
306
|
+
r.set(t, e);
|
|
307
|
+
}
|
|
308
|
+
return e;
|
|
309
|
+
};
|
|
310
|
+
return o.sort((t, e) => s(t.nodes[0]) - s(e.nodes[0])), [
|
|
311
|
+
...o,
|
|
312
|
+
...n,
|
|
313
|
+
...e
|
|
314
|
+
];
|
|
315
|
+
}(e)) {
|
|
316
|
+
const e = kt(n, t);
|
|
317
|
+
for (const n in o) Ft(o, n, e, t[n]);
|
|
318
|
+
}
|
|
319
|
+
return o;
|
|
320
|
+
}
|
|
321
|
+
function _t(t) {
|
|
322
|
+
return t;
|
|
323
|
+
}
|
|
324
|
+
function Lt(t, { overrides: e }) {
|
|
325
|
+
const n = zt(t, e), o = {
|
|
326
|
+
...DEFAULT_EDITOR_DOM_CONFIG,
|
|
327
|
+
...t.dom
|
|
328
|
+
};
|
|
329
|
+
return Tt(n, "$createDOM", o, At, Ot), Tt(n, "$exportDOM", o, At, Ot), Tt(n, "$extractWithChild", o, Rt, Mt), Tt(n, "$getDOMSlot", o, It, Et), Tt(n, "$shouldExclude", o, Nt, wt), Tt(n, "$shouldInclude", o, Nt, wt), Tt(n, "$updateDOM", o, Wt, Dt), Tt(n, "$decorateDOM", o, jt, _t), o;
|
|
330
|
+
}
|
|
331
|
+
function Ut(t) {
|
|
332
|
+
return { get: (e) => J(t, e) };
|
|
333
|
+
}
|
|
334
|
+
function Bt(t) {
|
|
335
|
+
const e = Object.create(null);
|
|
336
|
+
return Z(t, e) || e;
|
|
337
|
+
}
|
|
338
|
+
function Vt(t, e) {
|
|
339
|
+
const n = Ut(e);
|
|
340
|
+
return t.filter((t) => !(t.disabledForEditor && t.disabledForEditor(n)));
|
|
341
|
+
}
|
|
342
|
+
function qt(t) {
|
|
343
|
+
if ("*" === t.nodes) return () => !0;
|
|
344
|
+
const e = t.nodes.map((t) => {
|
|
345
|
+
const e = t;
|
|
346
|
+
return $isLexicalNode(e.prototype) ? (t) => t instanceof e : t;
|
|
347
|
+
});
|
|
348
|
+
return (t) => e.some((e) => e(t));
|
|
349
|
+
}
|
|
350
|
+
var Gt = class {
|
|
351
|
+
editor;
|
|
352
|
+
initialEditorConfig;
|
|
353
|
+
overrides;
|
|
354
|
+
editorContext;
|
|
355
|
+
hasSessionGates;
|
|
356
|
+
installed;
|
|
357
|
+
sessionCache = /* @__PURE__ */ new Map();
|
|
358
|
+
constructor(t, e, n, o) {
|
|
359
|
+
this.editor = t, this.initialEditorConfig = e, this.overrides = n, this.editorContext = o, this.installed = Vt(n, o), this.hasSessionGates = n.some((t) => t.disabledForSession);
|
|
360
|
+
}
|
|
361
|
+
setContextValue(t, e) {
|
|
362
|
+
const n = this.installed;
|
|
363
|
+
this.editorContext[t.key] = e;
|
|
364
|
+
const o = Vt(this.overrides, this.editorContext);
|
|
365
|
+
if (function(t, e) {
|
|
366
|
+
if (t.length !== e.length) return !1;
|
|
367
|
+
for (let n = 0; n < t.length; n++) if (t[n] !== e[n]) return !1;
|
|
368
|
+
return !0;
|
|
369
|
+
}(n, o)) return;
|
|
370
|
+
const r = function(t, e) {
|
|
371
|
+
const n = new Set(t), o = new Set(e), r = [];
|
|
372
|
+
for (const e of t) o.has(e) || r.push(e);
|
|
373
|
+
for (const t of e) n.has(t) || r.push(t);
|
|
374
|
+
return r;
|
|
375
|
+
}(n, o);
|
|
376
|
+
this.installed = o, this.sessionCache.clear();
|
|
377
|
+
const s = Lt(this.initialEditorConfig, { overrides: o });
|
|
378
|
+
this.editor._config.dom = s;
|
|
379
|
+
const i = function(t) {
|
|
380
|
+
const e = [];
|
|
381
|
+
for (const n of t) (n.$createDOM || n.$getDOMSlot || n.$decorateDOM) && e.push(qt(n));
|
|
382
|
+
return 0 === e.length ? null : (t) => e.some((e) => e(t));
|
|
383
|
+
}(r);
|
|
384
|
+
if (!i) return;
|
|
385
|
+
const c = s.$updateDOM;
|
|
386
|
+
s.$updateDOM = (t, e, n, o) => !!i(t) || c(t, e, n, o), this.editor.update($fullReconcile, { discrete: !0 }), s.$updateDOM = c;
|
|
387
|
+
}
|
|
388
|
+
getSessionConfig() {
|
|
389
|
+
const t = this.editor._config.dom || DEFAULT_EDITOR_DOM_CONFIG;
|
|
390
|
+
if (!this.hasSessionGates) return t;
|
|
391
|
+
const e = Ut(K(lt, this.editor) || this.editorContext), n = [], o = [];
|
|
392
|
+
if (this.installed.forEach((t, r) => {
|
|
393
|
+
t.disabledForSession && t.disabledForSession(e) ? n.push(String(r)) : o.push(t);
|
|
394
|
+
}), 0 === n.length) return t;
|
|
395
|
+
const r = n.join(",");
|
|
396
|
+
let s = this.sessionCache.get(r);
|
|
397
|
+
return s || (s = Lt(this.initialEditorConfig, { overrides: o }), this.sessionCache.set(r, s)), s;
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
const Ht = defineExtension({
|
|
401
|
+
build(t, e, n) {
|
|
402
|
+
const { initialEditorConfig: o } = n.getInitResult(), r = Bt(e.contextDefaults);
|
|
403
|
+
return {
|
|
404
|
+
defaults: r,
|
|
405
|
+
runtime: new Gt(t, o, e.overrides, r)
|
|
406
|
+
};
|
|
407
|
+
},
|
|
408
|
+
config: {
|
|
409
|
+
contextDefaults: [],
|
|
410
|
+
overrides: []
|
|
411
|
+
},
|
|
412
|
+
html: { export: new Map([[RootNode, () => {
|
|
413
|
+
const t = document.createElement("div");
|
|
414
|
+
return t.role = "textbox", { element: t };
|
|
415
|
+
}]]) },
|
|
416
|
+
init(t, e) {
|
|
417
|
+
const n = {
|
|
418
|
+
dom: t.dom,
|
|
419
|
+
nodes: t.nodes
|
|
420
|
+
}, o = Bt(e.contextDefaults);
|
|
421
|
+
return t.dom = Lt(t, { overrides: Vt(e.overrides, o) }), { initialEditorConfig: n };
|
|
422
|
+
},
|
|
423
|
+
mergeConfig(t, e) {
|
|
424
|
+
const n = shallowMergeConfig(t, e);
|
|
425
|
+
for (const o of ["overrides", "contextDefaults"]) e[o] && (n[o] = [...t[o], ...e[o]]);
|
|
426
|
+
return n;
|
|
427
|
+
},
|
|
428
|
+
name: ct
|
|
429
|
+
}), Jt = Symbol.for("@lexical/html/SelectorImpl");
|
|
430
|
+
function Qt(t, e) {
|
|
431
|
+
const n = {
|
|
432
|
+
kind: "element",
|
|
433
|
+
predicate: (o = e, 0 === o.length ? isHTMLElement : 1 === o.length ? o[0] : (t, e) => {
|
|
434
|
+
for (const n of o) if (!n(t, e)) return !1;
|
|
435
|
+
return !0;
|
|
436
|
+
}),
|
|
437
|
+
tags: t
|
|
438
|
+
};
|
|
439
|
+
var o;
|
|
440
|
+
const s = (n) => Qt(t, [...e, n]);
|
|
441
|
+
return {
|
|
442
|
+
[Jt]: n,
|
|
443
|
+
attr: (t, e, n) => s(Zt(t, e, n)),
|
|
444
|
+
classAll: (...t) => s(Yt(t)),
|
|
445
|
+
classAny: (...t) => s(function(t) {
|
|
446
|
+
const e = Kt(t);
|
|
447
|
+
if (0 === e.length) return () => !1;
|
|
448
|
+
return (t) => {
|
|
449
|
+
if (!isHTMLElement(t)) return !1;
|
|
450
|
+
const n = t.classList;
|
|
451
|
+
for (const t of e) if (n.contains(t)) return !0;
|
|
452
|
+
return !1;
|
|
453
|
+
};
|
|
454
|
+
}(t)),
|
|
455
|
+
styleAny: (t, e, n) => s(function(t, e, n) {
|
|
456
|
+
if ("string" == typeof e) return (n) => isHTMLElement(n) && n.style.getPropertyValue(t) === e;
|
|
457
|
+
if (e instanceof RegExp) {
|
|
458
|
+
const o = n && n.capture, s = e;
|
|
459
|
+
return (e, n) => {
|
|
460
|
+
if (!isHTMLElement(e)) return !1;
|
|
461
|
+
const i = e.style.getPropertyValue(t);
|
|
462
|
+
if (!i) return !1;
|
|
463
|
+
const c = i.match(s);
|
|
464
|
+
return null !== c && (void 0 !== o && (n[o] = c), !0);
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
G(362, JSON.stringify(t));
|
|
468
|
+
}(t, e, n))
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
function Kt(t) {
|
|
472
|
+
const e = [];
|
|
473
|
+
for (const n of t) n && e.push(n);
|
|
474
|
+
return e;
|
|
475
|
+
}
|
|
476
|
+
function Yt(t) {
|
|
477
|
+
const e = Kt(t);
|
|
478
|
+
return 0 === e.length ? () => !0 : (t) => {
|
|
479
|
+
if (!isHTMLElement(t)) return !1;
|
|
480
|
+
const n = t.classList;
|
|
481
|
+
for (const t of e) if (!n.contains(t)) return !1;
|
|
482
|
+
return !0;
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
function Zt(t, e, n) {
|
|
486
|
+
if (!0 === e) return (e) => isHTMLElement(e) && e.hasAttribute(t);
|
|
487
|
+
if ("string" == typeof e) return (n) => isHTMLElement(n) && n.getAttribute(t) === e;
|
|
488
|
+
if (e instanceof RegExp) {
|
|
489
|
+
const o = n && n.capture, s = e;
|
|
490
|
+
return (e, n) => {
|
|
491
|
+
if (!isHTMLElement(e)) return !1;
|
|
492
|
+
const i = e.getAttribute(t);
|
|
493
|
+
if (null == i) return !1;
|
|
494
|
+
const c = i.match(s);
|
|
495
|
+
return null !== c && (void 0 !== o && (n[o] = c), !0);
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
G(361, JSON.stringify(t));
|
|
499
|
+
}
|
|
500
|
+
const Xt = {
|
|
501
|
+
kind: "text",
|
|
502
|
+
predicate: isDOMTextNode,
|
|
503
|
+
tags: /* @__PURE__ */ new Set()
|
|
504
|
+
}, te = { [Jt]: Xt }, ee = {
|
|
505
|
+
kind: "comment",
|
|
506
|
+
predicate: (t) => 8 === t.nodeType,
|
|
507
|
+
tags: /* @__PURE__ */ new Set()
|
|
508
|
+
}, ne = { [Jt]: ee }, oe = {
|
|
509
|
+
any: () => Qt(/* @__PURE__ */ new Set(), []),
|
|
510
|
+
comment: () => ne,
|
|
511
|
+
tag(...t) {
|
|
512
|
+
t.length > 0 || G(363);
|
|
513
|
+
const e = /* @__PURE__ */ new Set();
|
|
514
|
+
for (const n of t) e.add(n.toUpperCase());
|
|
515
|
+
return Qt(e, []);
|
|
516
|
+
},
|
|
517
|
+
text: () => te
|
|
518
|
+
};
|
|
519
|
+
function re(t, e) {
|
|
520
|
+
return isHTMLElement(t) && t.nodeName === e.toUpperCase();
|
|
521
|
+
}
|
|
522
|
+
const se = /[A-Za-z0-9_-]/;
|
|
523
|
+
var ie = class {
|
|
524
|
+
constructor(t, e) {
|
|
525
|
+
this.source = t, this.pos = e;
|
|
526
|
+
}
|
|
527
|
+
peek(t = 0) {
|
|
528
|
+
return this.source[this.pos + t] || "";
|
|
529
|
+
}
|
|
530
|
+
consume() {
|
|
531
|
+
return this.source[this.pos++] || "";
|
|
532
|
+
}
|
|
533
|
+
eof() {
|
|
534
|
+
return this.pos >= this.source.length;
|
|
535
|
+
}
|
|
536
|
+
skipWhitespace() {
|
|
537
|
+
for (; !this.eof() && /\s/.test(this.peek());) this.pos++;
|
|
538
|
+
}
|
|
539
|
+
readIdent() {
|
|
540
|
+
const t = this.pos;
|
|
541
|
+
for (; !this.eof() && se.test(this.peek());) this.pos++;
|
|
542
|
+
return this.source.slice(t, this.pos);
|
|
543
|
+
}
|
|
544
|
+
readQuoted() {
|
|
545
|
+
const t = this.consume();
|
|
546
|
+
this.assert("\"" === t || "'" === t, "expected quote");
|
|
547
|
+
const e = this.pos;
|
|
548
|
+
for (; !this.eof() && this.peek() !== t;) "\\" === this.peek() ? this.pos += 2 : this.pos++;
|
|
549
|
+
this.assert(!this.eof(), "unterminated string");
|
|
550
|
+
const n = this.source.slice(e, this.pos);
|
|
551
|
+
return this.pos++, n.replace(/\\(.)/g, "$1");
|
|
552
|
+
}
|
|
553
|
+
assert(t, e) {
|
|
554
|
+
t || G(364, String(this.pos + 1), e, this.source);
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
function ce(t) {
|
|
558
|
+
const e = /* @__PURE__ */ new Set(), n = [], o = [];
|
|
559
|
+
if (t.skipWhitespace(), "*" === t.peek()) t.consume();
|
|
560
|
+
else if (se.test(t.peek())) {
|
|
561
|
+
const n = t.readIdent();
|
|
562
|
+
n && e.add(n.toUpperCase());
|
|
563
|
+
}
|
|
564
|
+
for (; !t.eof();) {
|
|
565
|
+
const e = t.peek();
|
|
566
|
+
if ("." === e) {
|
|
567
|
+
t.consume();
|
|
568
|
+
const e = t.readIdent();
|
|
569
|
+
t.assert("" !== e, "expected class name after \".\""), o.push(e);
|
|
570
|
+
} else if ("#" === e) {
|
|
571
|
+
t.consume();
|
|
572
|
+
const e = t.readIdent();
|
|
573
|
+
t.assert("" !== e, "expected id after \"#\""), n.push(Zt("id", e));
|
|
574
|
+
} else {
|
|
575
|
+
if ("[" !== e) break;
|
|
576
|
+
{
|
|
577
|
+
t.consume(), t.skipWhitespace();
|
|
578
|
+
const e = t.readIdent();
|
|
579
|
+
t.assert("" !== e, "expected attribute name after \"[\""), t.skipWhitespace();
|
|
580
|
+
let o = !0;
|
|
581
|
+
if ("=" === t.peek()) {
|
|
582
|
+
t.consume(), t.skipWhitespace();
|
|
583
|
+
const e = t.peek();
|
|
584
|
+
"\"" === e || "'" === e ? o = t.readQuoted() : (o = t.readIdent(), t.assert("" !== o, "expected attribute value")), t.skipWhitespace();
|
|
585
|
+
}
|
|
586
|
+
t.assert("]" === t.peek(), "expected \"]\""), t.consume(), n.push(Zt(e, o));
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return o.length > 0 && n.push(Yt(o)), {
|
|
591
|
+
predicates: n,
|
|
592
|
+
tags: e
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
function le(t) {
|
|
596
|
+
const e = new ie(t, 0), n = [];
|
|
597
|
+
for (;;) {
|
|
598
|
+
const t = ce(e);
|
|
599
|
+
if (n.push(t), e.skipWhitespace(), e.eof()) break;
|
|
600
|
+
e.assert("," === e.peek(), "expected \",\" (selector lists are the only supported combinator)"), e.consume(), e.skipWhitespace();
|
|
601
|
+
}
|
|
602
|
+
if (1 === n.length) return Qt(n[0].tags, n[0].predicates);
|
|
603
|
+
const o = /* @__PURE__ */ new Set();
|
|
604
|
+
for (const t of n) for (const e of t.tags) o.add(e);
|
|
605
|
+
return Qt(o, [(t, e) => {
|
|
606
|
+
for (const o of n) {
|
|
607
|
+
const n = t.nodeName;
|
|
608
|
+
if (o.tags.size > 0 && !o.tags.has(n)) continue;
|
|
609
|
+
let r = !0;
|
|
610
|
+
for (const n of o.predicates) if (!n(t, e)) {
|
|
611
|
+
r = !1;
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
if (r) return !0;
|
|
615
|
+
}
|
|
616
|
+
return !1;
|
|
617
|
+
}]);
|
|
618
|
+
}
|
|
619
|
+
function ue(t) {
|
|
620
|
+
return t;
|
|
621
|
+
}
|
|
622
|
+
function fe(t, e, n) {
|
|
623
|
+
return rt(ft, t, e, n);
|
|
624
|
+
}
|
|
625
|
+
const ae = fe("importSource", () => "unknown"), pe = fe("importSourceDataTransfer", () => null), de = fe("textFormat", () => 0), he = fe("textStyle", () => ({}));
|
|
626
|
+
function ge(t) {
|
|
627
|
+
if (!isHTMLElement(t)) return !1;
|
|
628
|
+
if ("PRE" === t.nodeName) return !0;
|
|
629
|
+
const e = t.style.whiteSpace;
|
|
630
|
+
return "string" == typeof e && e.startsWith("pre");
|
|
631
|
+
}
|
|
632
|
+
function me(t) {
|
|
633
|
+
if (isDOMTextNode(t)) return !0;
|
|
634
|
+
if (!isHTMLElement(t)) return !1;
|
|
635
|
+
const e = t.style.display;
|
|
636
|
+
return e ? e.startsWith("inline") : !isBlockDomNode(t) && isInlineDomNode(t);
|
|
637
|
+
}
|
|
638
|
+
const ye = fe("whitespaceConfig", () => ({
|
|
639
|
+
isInline: me,
|
|
640
|
+
preservesWhitespace: ge
|
|
641
|
+
})), xe = fe("importOverlays", () => []);
|
|
642
|
+
var Se = class {
|
|
643
|
+
constructor(t) {
|
|
644
|
+
this.record = t;
|
|
645
|
+
}
|
|
646
|
+
get(t) {
|
|
647
|
+
return J(this.record, t);
|
|
648
|
+
}
|
|
649
|
+
set(t, e) {
|
|
650
|
+
this.record[t.key] = e;
|
|
651
|
+
}
|
|
652
|
+
update(t, e) {
|
|
653
|
+
this.record[t.key] = e(J(this.record, t));
|
|
654
|
+
}
|
|
655
|
+
has(t) {
|
|
656
|
+
return Object.prototype.hasOwnProperty.call(this.record, t.key);
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
function $e(t) {
|
|
660
|
+
const e = getPeerDependencyFromEditor(t, ut);
|
|
661
|
+
return e ? e.output.defaults : void 0;
|
|
662
|
+
}
|
|
663
|
+
function ve(t, n = $getEditor()) {
|
|
664
|
+
return J(function(t) {
|
|
665
|
+
return K(ft, t) || $e(t);
|
|
666
|
+
}(n), t);
|
|
667
|
+
}
|
|
668
|
+
const be = ot(ft, $e), Ce = oe, ke = new Set([
|
|
669
|
+
"center",
|
|
670
|
+
"end",
|
|
671
|
+
"justify",
|
|
672
|
+
"left",
|
|
673
|
+
"right",
|
|
674
|
+
"start"
|
|
675
|
+
]);
|
|
676
|
+
function Oe(t) {
|
|
677
|
+
return ke.has(t);
|
|
678
|
+
}
|
|
679
|
+
const we = {
|
|
680
|
+
B: { fontWeight: "bold" },
|
|
681
|
+
EM: { fontStyle: "italic" },
|
|
682
|
+
I: { fontStyle: "italic" },
|
|
683
|
+
S: { textDecoration: "line-through" },
|
|
684
|
+
STRONG: { fontWeight: "bold" },
|
|
685
|
+
SUB: { verticalAlign: "sub" },
|
|
686
|
+
SUP: { verticalAlign: "super" },
|
|
687
|
+
U: { textDecoration: "underline" }
|
|
688
|
+
}, De = {
|
|
689
|
+
CODE: IS_CODE,
|
|
690
|
+
MARK: IS_HIGHLIGHT
|
|
691
|
+
};
|
|
692
|
+
const Me = new Set([
|
|
693
|
+
"font-weight",
|
|
694
|
+
"font-style",
|
|
695
|
+
"text-decoration",
|
|
696
|
+
"vertical-align"
|
|
697
|
+
]);
|
|
698
|
+
const Ae = {
|
|
699
|
+
$import: (t, e) => {
|
|
700
|
+
const n = t.get(de), o = we[e.nodeName], r = function(t) {
|
|
701
|
+
return {
|
|
702
|
+
fontStyle: t.style.fontStyle,
|
|
703
|
+
fontWeight: t.style.fontWeight,
|
|
704
|
+
textDecoration: t.style.textDecoration,
|
|
705
|
+
verticalAlign: t.style.verticalAlign
|
|
706
|
+
};
|
|
707
|
+
}(e), s = o ? (i = o, {
|
|
708
|
+
fontStyle: (c = r).fontStyle || i.fontStyle,
|
|
709
|
+
fontWeight: c.fontWeight || i.fontWeight,
|
|
710
|
+
textDecoration: c.textDecoration || i.textDecoration,
|
|
711
|
+
verticalAlign: c.verticalAlign || i.verticalAlign
|
|
712
|
+
}) : r;
|
|
713
|
+
var i, c;
|
|
714
|
+
let l = (u = n, f = function(t) {
|
|
715
|
+
let e = 0, n = 0;
|
|
716
|
+
const { fontWeight: o, fontStyle: r, textDecoration: s, verticalAlign: i } = t;
|
|
717
|
+
if ("700" === o || "bold" === o ? e |= IS_BOLD : "normal" !== o && "400" !== o || (n |= IS_BOLD), "italic" === r ? e |= IS_ITALIC : "normal" === r && (n |= IS_ITALIC), s) {
|
|
718
|
+
const t = s.split(" ");
|
|
719
|
+
t.includes("underline") && (e |= IS_UNDERLINE), t.includes("line-through") && (e |= IS_STRIKETHROUGH), t.includes("none") && (n |= IS_UNDERLINE | IS_STRIKETHROUGH);
|
|
720
|
+
}
|
|
721
|
+
return "sub" === i ? (e |= IS_SUBSCRIPT, n |= IS_SUPERSCRIPT) : "super" === i ? (e |= IS_SUPERSCRIPT, n |= IS_SUBSCRIPT) : "baseline" === i && (n |= IS_SUBSCRIPT | IS_SUPERSCRIPT), {
|
|
722
|
+
clear: n,
|
|
723
|
+
set: e
|
|
724
|
+
};
|
|
725
|
+
}(s), u & ~f.clear | f.set);
|
|
726
|
+
var u, f;
|
|
727
|
+
const a = De[e.nodeName];
|
|
728
|
+
return a && (l |= a), l === n ? t.$importChildren(e) : t.$importChildren(e, { context: [tt(de, l)] });
|
|
729
|
+
},
|
|
730
|
+
match: Ce.tag("b", "strong", "em", "i", "code", "mark", "s", "sub", "sup", "u", "span"),
|
|
731
|
+
name: "@lexical/html/inline-format"
|
|
732
|
+
};
|
|
733
|
+
function Ne(t, e, n) {
|
|
734
|
+
let o = t;
|
|
735
|
+
for (;;) {
|
|
736
|
+
let t = null;
|
|
737
|
+
for (; null === (t = e ? o.nextSibling : o.previousSibling);) {
|
|
738
|
+
const t = o.parentNode;
|
|
739
|
+
if (null === t) return null;
|
|
740
|
+
o = t;
|
|
741
|
+
}
|
|
742
|
+
if (o = t, !n.isInline(o)) return null;
|
|
743
|
+
let r = o;
|
|
744
|
+
for (; null !== (r = e ? o.firstChild : o.lastChild);) o = r;
|
|
745
|
+
if (isDOMTextNode(o)) return o;
|
|
746
|
+
if ("BR" === o.nodeName) return null;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function Ie(t, e) {
|
|
750
|
+
return 0 !== e && $isTextNode(t) ? t.setFormat(e) : t;
|
|
751
|
+
}
|
|
752
|
+
function Ee(t, e) {
|
|
753
|
+
if ($isTextNode(t)) {
|
|
754
|
+
const n = function(t) {
|
|
755
|
+
let e = "";
|
|
756
|
+
for (const n in t) Me.has(n) || (e += `${n}: ${t[n]}; `);
|
|
757
|
+
return e.trimEnd();
|
|
758
|
+
}(e);
|
|
759
|
+
"" !== n && t.setStyle(n);
|
|
760
|
+
}
|
|
761
|
+
return t;
|
|
762
|
+
}
|
|
763
|
+
const We = {
|
|
764
|
+
$import: (t, e) => {
|
|
765
|
+
const n = t.get(de), o = t.get(he), r = t.get(ye);
|
|
766
|
+
if (function(t, e) {
|
|
767
|
+
let n = t.parentNode;
|
|
768
|
+
for (; null !== n;) {
|
|
769
|
+
if (e.preservesWhitespace(n)) return !0;
|
|
770
|
+
n = n.parentNode;
|
|
771
|
+
}
|
|
772
|
+
return !1;
|
|
773
|
+
}(e, r)) {
|
|
774
|
+
const t = $generateNodesFromRawText(e.textContent || "");
|
|
775
|
+
for (const e of t) Ie(e, n), Ee(e, o);
|
|
776
|
+
return t;
|
|
777
|
+
}
|
|
778
|
+
const s = function(t, e) {
|
|
779
|
+
let n = (t.textContent || "").replace(/\r/g, "").replace(/[ \t\n]+/g, " ");
|
|
780
|
+
if (0 === n.length) return "";
|
|
781
|
+
if (" " === n[0]) {
|
|
782
|
+
let o = t, r = !0;
|
|
783
|
+
for (; null !== o && null !== (o = Ne(o, !1, e));) {
|
|
784
|
+
const t = o.textContent || "";
|
|
785
|
+
if (t.length > 0) {
|
|
786
|
+
/[ \t\n]$/.test(t) && (n = n.slice(1)), r = !1;
|
|
787
|
+
break;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
r && (n = n.slice(1));
|
|
791
|
+
}
|
|
792
|
+
if (n.length > 0 && " " === n[n.length - 1]) {
|
|
793
|
+
let o = t, r = !0;
|
|
794
|
+
for (; null !== o && null !== (o = Ne(o, !0, e));) if ((o.textContent || "").replace(/^( |\t|\r?\n)+/, "").length > 0) {
|
|
795
|
+
r = !1;
|
|
796
|
+
break;
|
|
797
|
+
}
|
|
798
|
+
r && (n = n.slice(0, -1));
|
|
799
|
+
}
|
|
800
|
+
return n;
|
|
801
|
+
}(e, r);
|
|
802
|
+
if ("" === s) return [];
|
|
803
|
+
const i = $createTextNode(s);
|
|
804
|
+
return Ie(i, n), Ee(i, o), [i];
|
|
805
|
+
},
|
|
806
|
+
match: Ce.text(),
|
|
807
|
+
name: "@lexical/html/#text"
|
|
808
|
+
}, Re = {
|
|
809
|
+
$import: () => [],
|
|
810
|
+
match: Ce.tag("script", "style"),
|
|
811
|
+
name: "@lexical/html/script-style-ignore"
|
|
812
|
+
}, je = {
|
|
813
|
+
$import: () => [$createLineBreakNode()],
|
|
814
|
+
match: Ce.tag("br"),
|
|
815
|
+
name: "@lexical/html/br"
|
|
816
|
+
}, Te = [
|
|
817
|
+
Re,
|
|
818
|
+
{
|
|
819
|
+
$import: (t, e) => {
|
|
820
|
+
const n = $createParagraphNode();
|
|
821
|
+
if ($setFormatFromDOM(n, e), setNodeIndentFromDOM(e, n), "" === n.getFormatType()) {
|
|
822
|
+
const t = e.getAttribute("align");
|
|
823
|
+
t && Oe(t) && n.setFormat(t);
|
|
824
|
+
}
|
|
825
|
+
return $setDirectionFromDOM(n, e), [n.splice(0, 0, t.$importChildren(e))];
|
|
826
|
+
},
|
|
827
|
+
match: Ce.tag("p"),
|
|
828
|
+
name: "@lexical/html/p"
|
|
829
|
+
},
|
|
830
|
+
We,
|
|
831
|
+
je,
|
|
832
|
+
Ae
|
|
833
|
+
];
|
|
834
|
+
function Fe(t, e) {
|
|
835
|
+
const n = [];
|
|
836
|
+
let o = 0, r = 0;
|
|
837
|
+
for (; o < t.length && r < e.length;) t[o] <= e[r] ? n.push(t[o++]) : n.push(e[r++]);
|
|
838
|
+
for (; o < t.length;) n.push(t[o++]);
|
|
839
|
+
for (; r < e.length;) n.push(e[r++]);
|
|
840
|
+
return n;
|
|
841
|
+
}
|
|
842
|
+
function Pe(t) {
|
|
843
|
+
const e = [], n = /* @__PURE__ */ new Map(), o = [], r = [], s = [], i = /* @__PURE__ */ new Set();
|
|
844
|
+
t.forEach((t, c) => {
|
|
845
|
+
const l = function(t) {
|
|
846
|
+
const e = t[Jt];
|
|
847
|
+
return void 0 === e && G(360), e;
|
|
848
|
+
}(t.match), u = t.name || function(t, e) {
|
|
849
|
+
if ("text" === t.kind) return `#text@${e}`;
|
|
850
|
+
if ("comment" === t.kind) return `#comment@${e}`;
|
|
851
|
+
if (0 === t.tags.size) return `*@${e}`;
|
|
852
|
+
return `${Array.from(t.tags).join(",").toLowerCase()}@${e}`;
|
|
853
|
+
}(l, c);
|
|
854
|
+
if (t.name && i.add(t.name), e.push({
|
|
855
|
+
$import: t.$import,
|
|
856
|
+
name: u,
|
|
857
|
+
predicate: l.predicate
|
|
858
|
+
}), "text" === l.kind) r.push(c);
|
|
859
|
+
else if ("comment" === l.kind) s.push(c);
|
|
860
|
+
else if (0 === l.tags.size) o.push(c);
|
|
861
|
+
else for (const t of l.tags) {
|
|
862
|
+
let e = n.get(t);
|
|
863
|
+
e || (e = [], n.set(t, e)), e.push(c);
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
const c = /* @__PURE__ */ new Map();
|
|
867
|
+
if (0 === o.length) for (const [t, e] of n) c.set(t, e);
|
|
868
|
+
else for (const [t, e] of n) c.set(t, Fe(e, o));
|
|
869
|
+
return {
|
|
870
|
+
byTag: c,
|
|
871
|
+
commentIndices: s,
|
|
872
|
+
rules: e,
|
|
873
|
+
textIndices: r,
|
|
874
|
+
wildcardIndices: o
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
function ze(t, e) {
|
|
878
|
+
return isDOMTextNode(e) ? t.textIndices : 8 === e.nodeType ? t.commentIndices : isHTMLElement(e) ? t.byTag.get(e.nodeName) || t.wildcardIndices : _e;
|
|
879
|
+
}
|
|
880
|
+
const _e = Object.freeze([]);
|
|
881
|
+
function Le(t) {
|
|
882
|
+
const e = [];
|
|
883
|
+
for (const n of t) if (Ue(n)) for (const t of n.rules) e.push(t);
|
|
884
|
+
else e.push(n);
|
|
885
|
+
return e;
|
|
886
|
+
}
|
|
887
|
+
function Ue(t) {
|
|
888
|
+
return "object" == typeof t && null !== t && "__type" in t && "CompiledOverlayRules" === t.__type;
|
|
889
|
+
}
|
|
890
|
+
function Be(t) {
|
|
891
|
+
const e = Le(t);
|
|
892
|
+
return {
|
|
893
|
+
__type: "CompiledOverlayRules",
|
|
894
|
+
dispatch: Pe(e),
|
|
895
|
+
rules: e
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
function Ve(t) {
|
|
899
|
+
return $isBlockElementNode(t) || $isDecoratorNode(t) && !t.isInline();
|
|
900
|
+
}
|
|
901
|
+
function qe(t, e) {
|
|
902
|
+
const n = [];
|
|
903
|
+
let o = [];
|
|
904
|
+
const r = () => {
|
|
905
|
+
0 !== o.length && (n.push(e().splice(0, 0, o)), o = []);
|
|
906
|
+
};
|
|
907
|
+
for (const s of t) if (Ve(s)) {
|
|
908
|
+
if (r(), $isElementNode(s)) {
|
|
909
|
+
const t = qe(s.getChildren(), e);
|
|
910
|
+
s.splice(0, s.getChildrenSize(), t);
|
|
911
|
+
}
|
|
912
|
+
n.push(s);
|
|
913
|
+
} else o.push(s);
|
|
914
|
+
return r(), n;
|
|
915
|
+
}
|
|
916
|
+
function Ge(t, e, n) {
|
|
917
|
+
const o = $createParagraphNode();
|
|
918
|
+
if (isHTMLElement(n)) {
|
|
919
|
+
const t = n.style.textAlign;
|
|
920
|
+
Oe(t) && o.setFormat(t);
|
|
921
|
+
}
|
|
922
|
+
return [o.splice(0, 0, t)];
|
|
923
|
+
}
|
|
924
|
+
const He = {
|
|
925
|
+
$accepts: Ve,
|
|
926
|
+
$packageRun: Ge,
|
|
927
|
+
name: "BlockSchema"
|
|
928
|
+
}, Je = {
|
|
929
|
+
$accepts: (t) => !Ve(t),
|
|
930
|
+
name: "InlineSchema"
|
|
931
|
+
}, Qe = {
|
|
932
|
+
$accepts: Ve,
|
|
933
|
+
$packageRun: (t) => t,
|
|
934
|
+
name: "NestedBlockSchema"
|
|
935
|
+
}, Ke = {
|
|
936
|
+
$accepts: Ve,
|
|
937
|
+
$packageRun: Ge,
|
|
938
|
+
name: "RootSchema"
|
|
939
|
+
}, Ye = Object.freeze({});
|
|
940
|
+
function Ze(t, e) {
|
|
941
|
+
return {
|
|
942
|
+
$importChildren: (e, n) => function(t, e, n) {
|
|
943
|
+
const o = n && n.rules ? n.rules.dispatch : void 0;
|
|
944
|
+
o && t.overlays.push(o);
|
|
945
|
+
try {
|
|
946
|
+
const o = () => Xe(t, e, n);
|
|
947
|
+
return n && n.context ? be(n.context, t.editor)(o) : o();
|
|
948
|
+
} finally {
|
|
949
|
+
o && t.overlays.pop();
|
|
950
|
+
}
|
|
951
|
+
}(t, e, n),
|
|
952
|
+
$importOne: (e, n) => tn(t, e, n),
|
|
953
|
+
captures: e,
|
|
954
|
+
get: (e) => ve(e, t.editor),
|
|
955
|
+
session: t.session
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
function Xe(t, e, n) {
|
|
959
|
+
const o = n && n.$onChild, r = [];
|
|
960
|
+
for (const n of Array.from(e.childNodes)) {
|
|
961
|
+
const e = tn(t, n, void 0);
|
|
962
|
+
for (const t of e) {
|
|
963
|
+
const e = o ? o(t) : t;
|
|
964
|
+
null != e && r.push(e);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
const s = n && n.$after ? n.$after(r) : r, i = n && n.schema;
|
|
968
|
+
return i ? function(t, e, n, o) {
|
|
969
|
+
const r = [];
|
|
970
|
+
let s = null;
|
|
971
|
+
const i = () => {
|
|
972
|
+
if (null === s) return;
|
|
973
|
+
const e = s;
|
|
974
|
+
if (s = null, t.$packageRun) {
|
|
975
|
+
const s = t.$packageRun(e, n, o);
|
|
976
|
+
if (s.length > 0) {
|
|
977
|
+
for (const t of s) r.push(t);
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
if ("hoist" === t.onReject) for (const t of e) r.push(t);
|
|
982
|
+
};
|
|
983
|
+
for (const o of e) t.$accepts(o, n) ? (i(), r.push(o)) : (null === s && (s = []), s.push(o));
|
|
984
|
+
return i(), t.$finalize ? t.$finalize(r, n) : r;
|
|
985
|
+
}(i, s, null, e) : s;
|
|
986
|
+
}
|
|
987
|
+
function tn(t, e, n) {
|
|
988
|
+
const o = () => function(t, e) {
|
|
989
|
+
const n = function(t, e) {
|
|
990
|
+
const n = [];
|
|
991
|
+
for (let o = t.overlays.length - 1; o >= 0; o--) {
|
|
992
|
+
const r = t.overlays[o], s = ze(r, e);
|
|
993
|
+
s.length > 0 && n.push({
|
|
994
|
+
dispatch: r,
|
|
995
|
+
indices: s
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
const o = ze(t.dispatch, e);
|
|
999
|
+
o.length > 0 && n.push({
|
|
1000
|
+
dispatch: t.dispatch,
|
|
1001
|
+
indices: o
|
|
1002
|
+
});
|
|
1003
|
+
return n;
|
|
1004
|
+
}(t, e);
|
|
1005
|
+
if (0 === n.length) return en(t, e);
|
|
1006
|
+
let o = 0, r = 0;
|
|
1007
|
+
const s = () => {
|
|
1008
|
+
for (; o < n.length;) {
|
|
1009
|
+
const { dispatch: i, indices: c } = n[o];
|
|
1010
|
+
for (; r < c.length;) {
|
|
1011
|
+
const n = c[r++], o = i.rules[n], l = {};
|
|
1012
|
+
if (o.predicate(e, l)) {
|
|
1013
|
+
const n = Ze(t, 0 === Object.keys(l).length ? Ye : l);
|
|
1014
|
+
try {
|
|
1015
|
+
return o.$import(n, e, s);
|
|
1016
|
+
} catch (t) {
|
|
1017
|
+
throw t;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
o++, r = 0;
|
|
1022
|
+
}
|
|
1023
|
+
return en(t, e);
|
|
1024
|
+
};
|
|
1025
|
+
return s();
|
|
1026
|
+
}(t, e);
|
|
1027
|
+
return n && n.context ? be(n.context, t.editor)(o) : o();
|
|
1028
|
+
}
|
|
1029
|
+
function en(t, e) {
|
|
1030
|
+
if (0 === e.childNodes.length) return [];
|
|
1031
|
+
const n = [];
|
|
1032
|
+
for (const o of Array.from(e.childNodes)) {
|
|
1033
|
+
const e = tn(t, o, void 0);
|
|
1034
|
+
for (const t of e) n.push(t);
|
|
1035
|
+
}
|
|
1036
|
+
return n;
|
|
1037
|
+
}
|
|
1038
|
+
const nn = {
|
|
1039
|
+
$import: (t, e) => t.$importChildren(e),
|
|
1040
|
+
match: oe.any(),
|
|
1041
|
+
name: "@lexical/html/default-hoist"
|
|
1042
|
+
}, on = defineExtension({
|
|
1043
|
+
build(t, e) {
|
|
1044
|
+
const n = Pe(Le(e.rules)), r = Z(e.contextDefaults, void 0), s = e.preprocess;
|
|
1045
|
+
return {
|
|
1046
|
+
$generateNodesFromDOM: (e, i) => {
|
|
1047
|
+
const c = i && i.context ? Z(i.context, r) : r, l = void 0 !== c && c !== r ? c : Object.create(r || null), u = new Se(l), f = { session: u };
|
|
1048
|
+
return function(t, e, n) {
|
|
1049
|
+
let o = t.length - 1;
|
|
1050
|
+
const r = () => {
|
|
1051
|
+
for (; o >= 0;) return void (0, t[o--])(e, n, r);
|
|
1052
|
+
};
|
|
1053
|
+
r();
|
|
1054
|
+
}(i && i.preprocess ? [...s, ...i.preprocess] : s, e, f), nt(ft, l, () => function(t, e, n, r) {
|
|
1055
|
+
return Xe({
|
|
1056
|
+
dispatch: t,
|
|
1057
|
+
editor: e,
|
|
1058
|
+
overlays: r.get(xe).map((t) => t.dispatch),
|
|
1059
|
+
session: r
|
|
1060
|
+
}, isDOMDocumentNode(n) ? n.body : n, { schema: Ke });
|
|
1061
|
+
}(n, t, e, u), t);
|
|
1062
|
+
},
|
|
1063
|
+
defaults: r
|
|
1064
|
+
};
|
|
1065
|
+
},
|
|
1066
|
+
config: {
|
|
1067
|
+
contextDefaults: [],
|
|
1068
|
+
preprocess: [st],
|
|
1069
|
+
rules: [nn]
|
|
1070
|
+
},
|
|
1071
|
+
mergeConfig: (t, e) => shallowMergeConfig(t, {
|
|
1072
|
+
...e,
|
|
1073
|
+
...e.contextDefaults && { contextDefaults: [...t.contextDefaults, ...e.contextDefaults] },
|
|
1074
|
+
...e.preprocess && { preprocess: [...t.preprocess, ...e.preprocess] },
|
|
1075
|
+
...e.rules && { rules: [...e.rules, ...t.rules] }
|
|
1076
|
+
}),
|
|
1077
|
+
name: ut
|
|
1078
|
+
});
|
|
1079
|
+
function rn(t, e) {
|
|
1080
|
+
return $getExtensionOutput(on).$generateNodesFromDOM(t, e);
|
|
1081
|
+
}
|
|
1082
|
+
const sn = defineExtension({
|
|
1083
|
+
dependencies: [configExtension(on, { rules: Te })],
|
|
1084
|
+
name: "@lexical/html/CoreImport"
|
|
1085
|
+
}), cn = [{
|
|
1086
|
+
$import: () => [$createHorizontalRuleNode()],
|
|
1087
|
+
match: oe.tag("hr"),
|
|
1088
|
+
name: "@lexical/html/hr"
|
|
1089
|
+
}], ln = defineExtension({
|
|
1090
|
+
dependencies: [
|
|
1091
|
+
sn,
|
|
1092
|
+
HorizontalRuleExtension,
|
|
1093
|
+
configExtension(on, { rules: cn })
|
|
1094
|
+
],
|
|
1095
|
+
name: "@lexical/html/HorizontalRuleImport"
|
|
1096
|
+
}), un = {
|
|
1097
|
+
any: oe.any,
|
|
1098
|
+
comment: oe.comment,
|
|
1099
|
+
css: le,
|
|
1100
|
+
tag: oe.tag,
|
|
1101
|
+
text: oe.text
|
|
1102
|
+
}, fn = new Set(["STYLE", "SCRIPT"]);
|
|
1103
|
+
function an(t, e) {
|
|
1104
|
+
it(e);
|
|
1105
|
+
const n = isDOMDocumentNode(e) ? e.body.childNodes : e.childNodes, r = [], s = [];
|
|
1106
|
+
for (const e of n) if (!fn.has(e.nodeName)) {
|
|
1107
|
+
const n = mn(e, t, s, !1);
|
|
1108
|
+
if (null !== n) for (const t of n) r.push(t);
|
|
1109
|
+
}
|
|
1110
|
+
return function(t) {
|
|
1111
|
+
for (const e of t) e.getParent() && e.getNextSibling() instanceof ArtificialNode__DO_NOT_USE && e.insertAfter($createLineBreakNode());
|
|
1112
|
+
for (const e of t) {
|
|
1113
|
+
const t = e.getParent();
|
|
1114
|
+
t && t.splice(e.getIndexWithinParent(), 1, e.getChildren());
|
|
1115
|
+
}
|
|
1116
|
+
}(s), r;
|
|
1117
|
+
}
|
|
1118
|
+
function pn(t, n = null, o = $getEditor()) {
|
|
1119
|
+
return vt([tt(ht, !0)], o)(() => {
|
|
1120
|
+
const e = $getRoot(), r = $t(o), s = t.append.bind(t);
|
|
1121
|
+
for (const t of e.getChildren()) gn(o, t, s, n, r);
|
|
1122
|
+
return t;
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
function dn(t, n = $getRoot()) {
|
|
1126
|
+
const o = $getEditor();
|
|
1127
|
+
return vt([tt(ht, !0), tt(dt, !0)], o)(() => {
|
|
1128
|
+
const e = $t(o);
|
|
1129
|
+
return gn(o, n, t.append.bind(t), null, e), t;
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
function hn(t, e = null) {
|
|
1133
|
+
return ("undefined" == typeof document || "undefined" == typeof window && void 0 === global.window) && G(338), pn(document.createElement("div"), e, t).innerHTML;
|
|
1134
|
+
}
|
|
1135
|
+
function gn(e, n, o, i = null, c = $getEditorDOMRenderConfig(e)) {
|
|
1136
|
+
let l = c.$shouldInclude(n, i, e);
|
|
1137
|
+
const u = c.$shouldExclude(n, i, e);
|
|
1138
|
+
let f = n;
|
|
1139
|
+
null !== i && $isTextNode(n) && (f = $sliceSelectedTextNodeContent(i, n, "clone"));
|
|
1140
|
+
const { element: p, after: d, append: h, $getChildNodes: g } = c.$exportDOM(f, e);
|
|
1141
|
+
if (!p) return !1;
|
|
1142
|
+
const m = document.createDocumentFragment(), y = g ? g() : $isElementNode(f) ? f.getChildren() : [], x = m.append.bind(m);
|
|
1143
|
+
for (const t of y) {
|
|
1144
|
+
const o = gn(e, t, x, i, c);
|
|
1145
|
+
!l && o && c.$extractWithChild(n, t, i, "html", e) && (l = !0);
|
|
1146
|
+
}
|
|
1147
|
+
if (l && !u) {
|
|
1148
|
+
if ((isHTMLElement(p) || isDocumentFragment(p)) && (h ? h(m) : p.append(m)), o(p), d) {
|
|
1149
|
+
const t = d.call(f, p);
|
|
1150
|
+
t && (isDocumentFragment(p) ? p.replaceChildren(t) : p.replaceWith(t));
|
|
1151
|
+
}
|
|
1152
|
+
} else o(m);
|
|
1153
|
+
return l;
|
|
1154
|
+
}
|
|
1155
|
+
function mn(t, e, n, o, r = /* @__PURE__ */ new Map(), s) {
|
|
1156
|
+
const i = [];
|
|
1157
|
+
if (fn.has(t.nodeName)) return i;
|
|
1158
|
+
let c = null;
|
|
1159
|
+
const l = function(t, e) {
|
|
1160
|
+
const { nodeName: n } = t, o = e._htmlConversions.get(n.toLowerCase());
|
|
1161
|
+
let r = null;
|
|
1162
|
+
if (void 0 !== o) for (const e of o) {
|
|
1163
|
+
const n = e(t);
|
|
1164
|
+
null !== n && (null === r || (r.priority || 0) <= (n.priority || 0)) && (r = n);
|
|
1165
|
+
}
|
|
1166
|
+
return null !== r ? r.conversion : null;
|
|
1167
|
+
}(t, e), u = l ? l(t) : null;
|
|
1168
|
+
let f = null;
|
|
1169
|
+
if (null !== u) {
|
|
1170
|
+
f = u.after;
|
|
1171
|
+
const e = u.node;
|
|
1172
|
+
if (c = Array.isArray(e) ? e[e.length - 1] : e, null !== c) {
|
|
1173
|
+
for (const [, t] of r) if (c = t(c, s), !c) break;
|
|
1174
|
+
c && i.push(...Array.isArray(e) ? e : [c]);
|
|
1175
|
+
}
|
|
1176
|
+
null != u.forChild && r.set(t.nodeName, u.forChild);
|
|
1177
|
+
}
|
|
1178
|
+
const a = t.childNodes;
|
|
1179
|
+
let p = [];
|
|
1180
|
+
const d = (null == c || !$isRootOrShadowRoot(c)) && (null != c && $isBlockElementNode(c) || o);
|
|
1181
|
+
for (let t = 0; t < a.length; t++) p.push(...mn(a[t], e, n, d, new Map(r), c));
|
|
1182
|
+
if (null != f && (p = f(p)), isBlockDomNode(t) && (p = yn(t, p, d ? () => {
|
|
1183
|
+
const t = new ArtificialNode__DO_NOT_USE();
|
|
1184
|
+
return n.push(t), t;
|
|
1185
|
+
} : $createParagraphNode)), null == c) if (p.length > 0) for (const t of p) i.push(t);
|
|
1186
|
+
else isBlockDomNode(t) && function(t) {
|
|
1187
|
+
if (null == t.nextSibling || null == t.previousSibling) return !1;
|
|
1188
|
+
return isInlineDomNode(t.nextSibling) && isInlineDomNode(t.previousSibling);
|
|
1189
|
+
}(t) && i.push($createLineBreakNode());
|
|
1190
|
+
else $isElementNode(c) && c.append(...p);
|
|
1191
|
+
return i;
|
|
1192
|
+
}
|
|
1193
|
+
function yn(t, e, n) {
|
|
1194
|
+
const o = t.style.textAlign, r = [];
|
|
1195
|
+
let s = [];
|
|
1196
|
+
for (let t = 0; t < e.length; t++) {
|
|
1197
|
+
const i = e[t];
|
|
1198
|
+
if ($isBlockElementNode(i)) o && !i.getFormat() && i.setFormat(o), r.push(i);
|
|
1199
|
+
else if (s.push(i), t === e.length - 1 || t < e.length - 1 && $isBlockElementNode(e[t + 1])) {
|
|
1200
|
+
const t = n();
|
|
1201
|
+
t.setFormat(o), t.append(...s), r.push(t), s = [];
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
return r;
|
|
1205
|
+
}
|
|
1206
|
+
//#endregion
|
|
1207
|
+
export { qe as $distributeInlineWrapper, pn as $generateDOMFromNodes, dn as $generateDOMFromRoot, hn as $generateHtmlFromNodes, an as $generateNodesFromDOM, rn as $generateNodesFromDOMViaExtension, ve as $getImportContextValue, mt as $getRenderContextValue, $t as $getSessionDOMRenderConfig, st as $inlineStylesFromStyleSheets, Ve as $isBlockLevel, xt as $setRenderContextValue, St as $updateRenderContextValue, be as $withImportContext, vt as $withRenderContext, He as BlockSchema, sn as CoreImportExtension, Te as CoreImportRules, on as DOMImportExtension, Ht as DOMRenderExtension, ln as HorizontalRuleImportExtension, cn as HorizontalRuleImportRules, xe as ImportOverlays, ae as ImportSource, pe as ImportSourceDataTransfer, de as ImportTextFormat, he as ImportTextStyle, ye as ImportWhitespaceConfig, Je as InlineSchema, Qe as NestedBlockSchema, ht as RenderContextExport, dt as RenderContextRoot, Ke as RootSchema, et as contextUpdater, tt as contextValue, fe as createImportState, pt as createRenderState, me as defaultIsInline, ge as defaultPreservesWhitespace, ue as defineImportRule, Be as defineOverlayRules, bt as domOverride, re as isElementOfTag, le as parseSelector, un as sel };
|