@mx-space/cli 0.14.0 → 0.14.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/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-CtGmYDoh.mjs} +770 -271
- package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-8sRFmq2X.mjs} +15 -5
- package/dist/Lexical.prod-D-VfeKDz.mjs +7200 -0
- package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CzQ15z6E.mjs} +6 -6
- package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-D4gMGws6.mjs} +2 -2
- package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-CltkQpzS.mjs} +10 -8
- package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DkYBZRGB.mjs} +11 -9
- package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-COc3_QL8.mjs} +178 -167
- package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-Dv5_WUae.mjs} +3 -3
- package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-DgjrmWkd.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-DnpbDe-_.mjs} +5 -4
- package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-JMH_6-OZ.mjs} +73 -52
- package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-BUozzx4t.mjs} +4 -2
- package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-UiyDgmou.mjs} +370 -347
- package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-BfLGciiX.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-CWF7edmQ.mjs} +2 -2
- package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-D5EF5PGW.mjs} +13 -11
- package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-BYbzHNVe.mjs} +4 -4
- package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-D_FfkvVD.mjs} +330 -299
- package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-D3Pgh6ik.mjs} +53 -23
- package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-XZoAYVYD.mjs} +217 -198
- package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B5d3ObhB.mjs} +49 -44
- package/dist/LexicalList.prod-OQDpVAEb.mjs +967 -0
- package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-BkM8G3DG.mjs} +61 -42
- package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-DcVXCex6.mjs} +254 -202
- package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-DppD7IrA.mjs} +337 -52
- package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-CPSn7dkg.mjs} +12 -8
- package/dist/LexicalRichText.prod-h7JPxFNp.mjs +718 -0
- package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-CD0SLbxP.mjs} +48 -17
- package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-CGlJgUlZ.mjs} +5 -4
- package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-DbVZN5AV.mjs} +101 -92
- package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-D0HU14UV.mjs} +340 -138
- package/dist/LexicalTable.prod-BcPNSrxP.mjs +2468 -0
- package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-iKy_TrRT.mjs} +15 -19
- package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-CIgMS8cG.mjs} +6 -6
- package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-DIAsKJzu.mjs} +155 -159
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-CH7CrOvh.mjs +2 -0
- package/dist/{esm-BNu4sUWV.mjs → esm-CwXl1N0a.mjs} +1801 -6013
- package/dist/index.d.mts +57 -62
- package/dist/index.mjs +1 -1
- package/dist/{mxs-BUqt-N3N.mjs → mxs-iW9DgqSZ.mjs} +14960 -9235
- package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
- package/dist/vendor/litexml/cli.mjs +6693 -5762
- package/dist/vendor/litexml/litexml-html-preview-client.js +11912 -8698
- package/package.json +31 -30
- package/LICENSE +0 -33
- 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,8 +1,8 @@
|
|
|
1
|
-
import { a as HorizontalRuleNode, d as getPeerDependencyFromEditor, i as HorizontalRuleExtension, n as $getExtensionOutput, t as $createHorizontalRuleNode, u as getKnownTypesAndNodes } from "./LexicalExtension.node-
|
|
2
|
-
import {
|
|
3
|
-
import { a as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-
|
|
4
|
-
import {
|
|
5
|
-
//#region ../../node_modules/.pnpm/@lexical+html@0.
|
|
1
|
+
import { a as HorizontalRuleNode, d as getPeerDependencyFromEditor, i as HorizontalRuleExtension, n as $getExtensionOutput, t as $createHorizontalRuleNode, u as getKnownTypesAndNodes } from "./LexicalExtension.node-BUozzx4t.mjs";
|
|
2
|
+
import { $r as isHTMLElement, Bn as IS_SUBSCRIPT, C as $generateNodesFromRawText, Cr as createState, Fn as IS_HIGHLIGHT, Hn as IS_UNDERLINE, Ht as ArtificialNode__DO_NOT_USE, I as $getDocument, J as $getSlotFrame, Kr as isDOMDocumentNode, L as $getEditor, Ln as IS_ITALIC, Mt as $setDirectionFromDOM, Nn as IS_CODE, Nt as $setFormatFromDOM, R as $getEditorDOMRenderConfig, S as $fullReconcile, St as $isTextNode, Tr as defineExtension, Vn as IS_SUPERSCRIPT, W as $getRoot, Wr as isBlockDomNode, Xr as isDocumentFragment, Yr as isDOMTextNode, _i as shallowMergeConfig, br as configExtension, d as $createLineBreakNode, dt as $isLineBreakNode, ft as $isNodeSelection, gi as setNodeIndentFromDOM, gt as $isRootOrShadowRoot, ii as isOnlyChildInBlockNode, it as $isDecoratorNode, jn as IS_BOLD, mt as $isRangeSelection, ni as isLastChildInBlockNode, nt as $isBlockElementNode, oi as iterStaticNodeConfigChain, ot as $isElementNode, p as $createParagraphNode, r as $assumeActiveEditor, sn as DEFAULT_EDITOR_DOM_CONFIG, sr as RootNode, ti as isInlineDomNode, ut as $isLexicalNode, v as $createTextNode, zn as IS_STRIKETHROUGH, zr as getRegisteredSubtypeMap } from "./Lexical.node-8sRFmq2X.mjs";
|
|
3
|
+
import { a as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-CGlJgUlZ.mjs";
|
|
4
|
+
import { m as objectKlassEquals } from "./LexicalUtils.node-CIgMS8cG.mjs";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@lexical+html@0.48.0_typescript@6.0.3/node_modules/@lexical/html/dist/LexicalHtml.prod.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
8
|
*
|
|
@@ -10,81 +10,81 @@ import { h as objectKlassEquals } from "./LexicalUtils.node-BVAwOkL4.mjs";
|
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
function
|
|
13
|
+
function nt(t, ...e) {
|
|
14
14
|
const n = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
15
15
|
o.append("code", t);
|
|
16
16
|
for (const t of e) o.append("v", t);
|
|
17
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
18
|
}
|
|
19
|
-
let
|
|
20
|
-
function
|
|
19
|
+
let ot;
|
|
20
|
+
function rt(t, e) {
|
|
21
21
|
const { key: n } = e;
|
|
22
22
|
return t && n in t ? t[n] : e.defaultValue;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function st(t) {
|
|
25
|
+
return ot && ot.editor === t ? ot : void 0;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const n =
|
|
27
|
+
function it(t, e) {
|
|
28
|
+
const n = st(e);
|
|
29
29
|
return n && n[t];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function ct(t, e) {
|
|
32
32
|
if ("cfg" in e) {
|
|
33
33
|
const { cfg: n, updater: o } = e;
|
|
34
|
-
return [n, o(
|
|
34
|
+
return [n, o(rt(t, n))];
|
|
35
35
|
}
|
|
36
36
|
return e;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function lt(t, e) {
|
|
39
39
|
let n = e;
|
|
40
40
|
for (const o of t) {
|
|
41
|
-
const [t, r] =
|
|
42
|
-
if (n === e &&
|
|
43
|
-
const i = n === e || void 0 === n ?
|
|
41
|
+
const [t, r] = ct(n, o), s = t.key;
|
|
42
|
+
if (n === e && rt(n, t) === r) continue;
|
|
43
|
+
const i = n === e || void 0 === n ? ut(e) : n;
|
|
44
44
|
i[s] = r, n = i;
|
|
45
45
|
}
|
|
46
46
|
return n;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function ut(t) {
|
|
49
49
|
return Object.create(t || null);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function ft(t, e) {
|
|
52
52
|
return [t, e];
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function at(t, e) {
|
|
55
55
|
return {
|
|
56
56
|
cfg: t,
|
|
57
57
|
updater: e
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
const s =
|
|
60
|
+
function dt(t, n, o, r = $getEditor()) {
|
|
61
|
+
const s = ot, i = st(r);
|
|
62
62
|
try {
|
|
63
|
-
return
|
|
63
|
+
return ot = {
|
|
64
64
|
...i,
|
|
65
65
|
editor: r,
|
|
66
66
|
[t]: n
|
|
67
67
|
}, o();
|
|
68
68
|
} finally {
|
|
69
|
-
|
|
69
|
+
ot = s;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function pt(t, n = () => {}) {
|
|
73
73
|
return (o, r = $getEditor()) => (e) => {
|
|
74
|
-
const s =
|
|
75
|
-
return c && c !== i ?
|
|
74
|
+
const s = st(r), i = s && s[t], c = lt(o, i || n(r));
|
|
75
|
+
return c && c !== i ? dt(t, c, e, r) : e();
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ht(t, e, o, r) {
|
|
79
79
|
return Object.assign(createState(Symbol(e), {
|
|
80
80
|
isEqual: r,
|
|
81
81
|
parse: o
|
|
82
82
|
}), { [t]: !0 });
|
|
83
83
|
}
|
|
84
|
-
const
|
|
85
|
-
|
|
84
|
+
const gt = (t, e, n) => {
|
|
85
|
+
mt(t), n();
|
|
86
86
|
};
|
|
87
|
-
function
|
|
87
|
+
function mt(t) {
|
|
88
88
|
if (!isDOMDocumentNode(t)) return;
|
|
89
89
|
const e = t;
|
|
90
90
|
if (null === e.querySelector("style")) return;
|
|
@@ -126,110 +126,116 @@ function gt(t) {
|
|
|
126
126
|
}
|
|
127
127
|
} catch (t) {}
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
function
|
|
135
|
-
|
|
129
|
+
const yt = "@lexical/html/DOM";
|
|
130
|
+
const xt = Symbol.for("@lexical/html/DOMExportContext");
|
|
131
|
+
const St = "@lexical/html/DOMImport";
|
|
132
|
+
const $t = Symbol.for("@lexical/html/DOMImportContext");
|
|
133
|
+
const vt = () => !0;
|
|
134
|
+
function Ct(t, e, n) {
|
|
135
|
+
return ht(xt, t, e, n);
|
|
136
|
+
}
|
|
137
|
+
const bt = /* @__PURE__ */ Ct("root", Boolean);
|
|
138
|
+
const kt = /* @__PURE__ */ Ct("isExport", Boolean);
|
|
139
|
+
function Dt(t) {
|
|
140
|
+
const e = getPeerDependencyFromEditor(t, yt);
|
|
136
141
|
return e ? e.output.defaults : void 0;
|
|
137
142
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
140
|
-
return
|
|
143
|
+
function wt(t, n = $getEditor()) {
|
|
144
|
+
return rt(function(t) {
|
|
145
|
+
return it(xt, t) || Dt(t);
|
|
141
146
|
}(n), t);
|
|
142
147
|
}
|
|
143
|
-
function
|
|
144
|
-
const e = getPeerDependencyFromEditor(t,
|
|
148
|
+
function Ot(t) {
|
|
149
|
+
const e = getPeerDependencyFromEditor(t, yt);
|
|
145
150
|
return e ? e.output.runtime : void 0;
|
|
146
151
|
}
|
|
147
|
-
function
|
|
148
|
-
const r =
|
|
152
|
+
function Mt(t, n, o = $getEditor()) {
|
|
153
|
+
const r = Ot(o);
|
|
149
154
|
r && r.setContextValue(t, n);
|
|
150
155
|
}
|
|
151
|
-
function
|
|
152
|
-
const r =
|
|
153
|
-
r && r.setContextValue(t, n(
|
|
156
|
+
function At(t, n, o = $getEditor()) {
|
|
157
|
+
const r = Ot(o);
|
|
158
|
+
r && r.setContextValue(t, n(rt(r.editorContext, t)));
|
|
154
159
|
}
|
|
155
|
-
function
|
|
156
|
-
const n =
|
|
160
|
+
function Nt(t = $getEditor()) {
|
|
161
|
+
const n = Ot(t);
|
|
157
162
|
return n ? n.getSessionConfig() : $getEditorDOMRenderConfig(t);
|
|
158
163
|
}
|
|
159
|
-
const
|
|
160
|
-
function
|
|
164
|
+
const Et = pt(xt, Dt);
|
|
165
|
+
function It(t, e, n) {
|
|
161
166
|
return {
|
|
162
167
|
...e,
|
|
163
168
|
...n,
|
|
164
169
|
nodes: t
|
|
165
170
|
};
|
|
166
171
|
}
|
|
167
|
-
function
|
|
172
|
+
function Wt(t) {
|
|
168
173
|
return (e) => e instanceof t;
|
|
169
174
|
}
|
|
170
|
-
function
|
|
171
|
-
if ("*" === e) return
|
|
175
|
+
function Rt(t, { nodes: e }) {
|
|
176
|
+
if ("*" === e) return vt;
|
|
172
177
|
let n = {};
|
|
173
178
|
const o = [];
|
|
174
179
|
for (const r of e) if ("getType" in r) {
|
|
175
180
|
const e = r.getType();
|
|
176
181
|
if (n) {
|
|
177
182
|
const o = t.get(e);
|
|
178
|
-
void 0 === o &&
|
|
183
|
+
void 0 === o && nt(339, r.name, e);
|
|
179
184
|
for (const t of o) n[t] = !0;
|
|
180
185
|
}
|
|
181
|
-
o.push(
|
|
186
|
+
o.push(Wt(r));
|
|
182
187
|
} else n = void 0, o.push(r);
|
|
183
188
|
return n || (1 === o.length ? o[0] : (t) => {
|
|
184
189
|
for (const e of o) if (e(t)) return !0;
|
|
185
190
|
return !1;
|
|
186
191
|
});
|
|
187
192
|
}
|
|
188
|
-
function
|
|
193
|
+
function Ft(t) {
|
|
189
194
|
return (e, n, o) => t(e, o);
|
|
190
195
|
}
|
|
191
|
-
function
|
|
196
|
+
function Tt(t) {
|
|
192
197
|
return (e, n, o, r) => t(e, n, r);
|
|
193
198
|
}
|
|
194
|
-
function
|
|
199
|
+
function Pt(t) {
|
|
195
200
|
return (e, n, o, r, s) => t(e, n, o, s);
|
|
196
201
|
}
|
|
197
|
-
function
|
|
202
|
+
function jt(t) {
|
|
198
203
|
return (e, n, o, r, s, i) => t(e, n, o, r, i);
|
|
199
204
|
}
|
|
200
|
-
function
|
|
205
|
+
function zt(t, e) {
|
|
201
206
|
return (n, o) => {
|
|
202
207
|
const r = () => t(n, o), s = e(n);
|
|
203
208
|
return s ? s(n, r, o) : r();
|
|
204
209
|
};
|
|
205
210
|
}
|
|
206
|
-
function
|
|
211
|
+
function _t(t, e) {
|
|
207
212
|
return (n, o, r) => {
|
|
208
213
|
const s = () => t(n, o, r), i = e(n);
|
|
209
214
|
return i ? i(n, o, s, r) : s();
|
|
210
215
|
};
|
|
211
216
|
}
|
|
212
|
-
const
|
|
213
|
-
|
|
217
|
+
const Lt = _t;
|
|
218
|
+
const Ut = Tt;
|
|
219
|
+
function Bt(t, e) {
|
|
214
220
|
return (n, o, r, s) => {
|
|
215
221
|
const i = () => t(n, o, r, s), c = e(n);
|
|
216
222
|
return c ? c(n, o, r, i, s) : i();
|
|
217
223
|
};
|
|
218
224
|
}
|
|
219
|
-
function
|
|
225
|
+
function Vt(t, e) {
|
|
220
226
|
return (n, o, r, s, i) => {
|
|
221
227
|
const c = () => t(n, o, r, s, i), l = e(n);
|
|
222
228
|
return l ? l(n, o, r, s, c, i) : c();
|
|
223
229
|
};
|
|
224
230
|
}
|
|
225
|
-
function
|
|
231
|
+
function qt(t, e) {
|
|
226
232
|
return (n, o, r, s) => {
|
|
227
233
|
t(n, o, r, s);
|
|
228
234
|
const i = e(n);
|
|
229
235
|
i && i(n, o, r, s);
|
|
230
236
|
};
|
|
231
237
|
}
|
|
232
|
-
function
|
|
238
|
+
function Gt(t, e, n, o, r) {
|
|
233
239
|
let s = n[e];
|
|
234
240
|
for (const n of t[e]) if ("function" == typeof n[0]) {
|
|
235
241
|
const [t, e] = n;
|
|
@@ -247,7 +253,7 @@ function qt(t, e, n, o, r) {
|
|
|
247
253
|
}
|
|
248
254
|
n[e] = s;
|
|
249
255
|
}
|
|
250
|
-
function
|
|
256
|
+
function Ht(t, e, n, o) {
|
|
251
257
|
if (!o) return;
|
|
252
258
|
const r = t[e];
|
|
253
259
|
if ("function" == typeof n) r.push([n, o]);
|
|
@@ -261,10 +267,10 @@ function Gt(t, e, n, o) {
|
|
|
261
267
|
}
|
|
262
268
|
}
|
|
263
269
|
}
|
|
264
|
-
function
|
|
270
|
+
function Jt(t) {
|
|
265
271
|
return "*" === t.nodes;
|
|
266
272
|
}
|
|
267
|
-
function
|
|
273
|
+
function Qt(t, e) {
|
|
268
274
|
const n = getRegisteredSubtypeMap(getKnownTypesAndNodes(t).nodes), o = {
|
|
269
275
|
$createDOM: [],
|
|
270
276
|
$decorateDOM: [],
|
|
@@ -278,7 +284,7 @@ function Jt(t, e) {
|
|
|
278
284
|
};
|
|
279
285
|
for (const t of function(t) {
|
|
280
286
|
const e = [], n = [], o = [];
|
|
281
|
-
for (const r of t) if (
|
|
287
|
+
for (const r of t) if (Jt(r)) e.push(r);
|
|
282
288
|
else if (Array.isArray(r.nodes)) for (const t of r.nodes) $isLexicalNode(t.prototype) ? o.push(1 === r.nodes.length ? r : {
|
|
283
289
|
...r,
|
|
284
290
|
nodes: [t]
|
|
@@ -301,33 +307,33 @@ function Jt(t, e) {
|
|
|
301
307
|
...e
|
|
302
308
|
];
|
|
303
309
|
}(e)) {
|
|
304
|
-
const e =
|
|
305
|
-
for (const n in o)
|
|
310
|
+
const e = Rt(n, t);
|
|
311
|
+
for (const n in o) Ht(o, n, e, t[n]);
|
|
306
312
|
}
|
|
307
313
|
return o;
|
|
308
314
|
}
|
|
309
|
-
function
|
|
315
|
+
function Kt(t) {
|
|
310
316
|
return t;
|
|
311
317
|
}
|
|
312
|
-
function
|
|
313
|
-
const n =
|
|
318
|
+
function Yt(t, { overrides: e }) {
|
|
319
|
+
const n = Qt(t, e), o = {
|
|
314
320
|
...DEFAULT_EDITOR_DOM_CONFIG,
|
|
315
321
|
...t.dom
|
|
316
322
|
};
|
|
317
|
-
return
|
|
318
|
-
}
|
|
319
|
-
function Yt(t) {
|
|
320
|
-
return { get: (e) => ot(t, e) };
|
|
323
|
+
return Gt(n, "$createDOM", o, zt, Ft), Gt(n, "$exportDOM", o, zt, Ft), Gt(n, "$extractWithChild", o, Vt, jt), Gt(n, "$getDOMSlot", o, Lt, Ut), Gt(n, "$shouldExclude", o, _t, Tt), Gt(n, "$shouldInclude", o, _t, Tt), Gt(n, "$getSlotTargetElement", o, Bt, Pt), Gt(n, "$updateDOM", o, Bt, Pt), Gt(n, "$decorateDOM", o, qt, Kt), o;
|
|
321
324
|
}
|
|
322
325
|
function Zt(t) {
|
|
326
|
+
return { get: (e) => rt(t, e) };
|
|
327
|
+
}
|
|
328
|
+
function Xt(t) {
|
|
323
329
|
const e = Object.create(null);
|
|
324
|
-
return
|
|
330
|
+
return lt(t, e) || e;
|
|
325
331
|
}
|
|
326
|
-
function
|
|
327
|
-
const n =
|
|
332
|
+
function te(t, e) {
|
|
333
|
+
const n = Zt(e);
|
|
328
334
|
return t.filter((t) => !(t.disabledForEditor && t.disabledForEditor(n)));
|
|
329
335
|
}
|
|
330
|
-
function
|
|
336
|
+
function ee(t) {
|
|
331
337
|
if ("*" === t.nodes) return () => !0;
|
|
332
338
|
const e = t.nodes.map((t) => {
|
|
333
339
|
const e = t;
|
|
@@ -335,7 +341,7 @@ function te(t) {
|
|
|
335
341
|
});
|
|
336
342
|
return (t) => e.some((e) => e(t));
|
|
337
343
|
}
|
|
338
|
-
var
|
|
344
|
+
var ne = class {
|
|
339
345
|
editor;
|
|
340
346
|
initialEditorConfig;
|
|
341
347
|
overrides;
|
|
@@ -344,12 +350,12 @@ var ee = class {
|
|
|
344
350
|
installed;
|
|
345
351
|
sessionCache = /* @__PURE__ */ new Map();
|
|
346
352
|
constructor(t, e, n, o) {
|
|
347
|
-
this.editor = t, this.initialEditorConfig = e, this.overrides = n, this.editorContext = o, this.installed =
|
|
353
|
+
this.editor = t, this.initialEditorConfig = e, this.overrides = n, this.editorContext = o, this.installed = te(n, o), this.hasSessionGates = n.some((t) => t.disabledForSession);
|
|
348
354
|
}
|
|
349
355
|
setContextValue(t, e) {
|
|
350
356
|
const n = this.installed;
|
|
351
357
|
this.editorContext[t.key] = e;
|
|
352
|
-
const o =
|
|
358
|
+
const o = te(this.overrides, this.editorContext);
|
|
353
359
|
if (function(t, e) {
|
|
354
360
|
if (t.length !== e.length) return !1;
|
|
355
361
|
for (let n = 0; n < t.length; n++) if (t[n] !== e[n]) return !1;
|
|
@@ -362,11 +368,11 @@ var ee = class {
|
|
|
362
368
|
return r;
|
|
363
369
|
}(n, o);
|
|
364
370
|
this.installed = o, this.sessionCache.clear();
|
|
365
|
-
const s =
|
|
371
|
+
const s = Yt(this.initialEditorConfig, { overrides: o });
|
|
366
372
|
this.editor._config.dom = s;
|
|
367
373
|
const i = function(t) {
|
|
368
374
|
const e = [];
|
|
369
|
-
for (const n of t) (n.$createDOM || n.$getDOMSlot || n.$decorateDOM) && e.push(
|
|
375
|
+
for (const n of t) (n.$createDOM || n.$getDOMSlot || n.$decorateDOM) && e.push(ee(n));
|
|
370
376
|
return 0 === e.length ? null : (t) => e.some((e) => e(t));
|
|
371
377
|
}(r);
|
|
372
378
|
if (!i) return;
|
|
@@ -376,21 +382,21 @@ var ee = class {
|
|
|
376
382
|
getSessionConfig() {
|
|
377
383
|
const t = this.editor._config.dom || DEFAULT_EDITOR_DOM_CONFIG;
|
|
378
384
|
if (!this.hasSessionGates) return t;
|
|
379
|
-
const e =
|
|
385
|
+
const e = Zt(it(xt, this.editor) || this.editorContext), n = [], o = [];
|
|
380
386
|
if (this.installed.forEach((t, r) => {
|
|
381
387
|
t.disabledForSession && t.disabledForSession(e) ? n.push(String(r)) : o.push(t);
|
|
382
388
|
}), 0 === n.length) return t;
|
|
383
389
|
const r = n.join(",");
|
|
384
390
|
let s = this.sessionCache.get(r);
|
|
385
|
-
return s || (s =
|
|
391
|
+
return s || (s = Yt(this.initialEditorConfig, { overrides: o }), this.sessionCache.set(r, s)), s;
|
|
386
392
|
}
|
|
387
393
|
};
|
|
388
|
-
const
|
|
394
|
+
const oe = /* @__PURE__ */ defineExtension({
|
|
389
395
|
build(t, e, n) {
|
|
390
|
-
const { initialEditorConfig: o } = n.getInitResult(), r =
|
|
396
|
+
const { initialEditorConfig: o } = n.getInitResult(), r = Xt(e.contextDefaults);
|
|
391
397
|
return {
|
|
392
398
|
defaults: r,
|
|
393
|
-
runtime: new
|
|
399
|
+
runtime: new ne(t, o, e.overrides, r)
|
|
394
400
|
};
|
|
395
401
|
},
|
|
396
402
|
config: {
|
|
@@ -398,24 +404,25 @@ const ne = /* @__PURE__ */ defineExtension({
|
|
|
398
404
|
overrides: []
|
|
399
405
|
},
|
|
400
406
|
html: { export: /* @__PURE__ */ new Map([[RootNode, () => {
|
|
401
|
-
const t =
|
|
407
|
+
const t = $getDocument().createElement("div");
|
|
402
408
|
return t.role = "textbox", { element: t };
|
|
403
409
|
}]]) },
|
|
404
410
|
init(t, e) {
|
|
405
411
|
const n = {
|
|
406
412
|
dom: t.dom,
|
|
407
413
|
nodes: t.nodes
|
|
408
|
-
}, o =
|
|
409
|
-
return t.dom =
|
|
414
|
+
}, o = Xt(e.contextDefaults);
|
|
415
|
+
return t.dom = Yt(t, { overrides: te(e.overrides, o) }), { initialEditorConfig: n };
|
|
410
416
|
},
|
|
411
417
|
mergeConfig(t, e) {
|
|
412
418
|
const n = shallowMergeConfig(t, e);
|
|
413
419
|
for (const o of ["overrides", "contextDefaults"]) e[o] && (n[o] = [...t[o], ...e[o]]);
|
|
414
420
|
return n;
|
|
415
421
|
},
|
|
416
|
-
name:
|
|
417
|
-
})
|
|
418
|
-
|
|
422
|
+
name: yt
|
|
423
|
+
});
|
|
424
|
+
const re = Symbol.for("@lexical/html/SelectorImpl");
|
|
425
|
+
function se(t, e) {
|
|
419
426
|
const n = {
|
|
420
427
|
kind: "element",
|
|
421
428
|
predicate: (o = e, 0 === o.length ? isHTMLElement : 1 === o.length ? o[0] : (t, e) => {
|
|
@@ -425,13 +432,13 @@ function re(t, e) {
|
|
|
425
432
|
tags: t
|
|
426
433
|
};
|
|
427
434
|
var o;
|
|
428
|
-
const s = (n) =>
|
|
435
|
+
const s = (n) => se(t, [...e, n]);
|
|
429
436
|
return {
|
|
430
|
-
[
|
|
431
|
-
attr: (t, e, n) => s(
|
|
432
|
-
classAll: (...t) => s(
|
|
437
|
+
[re]: n,
|
|
438
|
+
attr: (t, e, n) => s(le(t, e, n)),
|
|
439
|
+
classAll: (...t) => s(ce(t)),
|
|
433
440
|
classAny: (...t) => s(function(t) {
|
|
434
|
-
const e =
|
|
441
|
+
const e = ie(t);
|
|
435
442
|
if (0 === e.length) return () => !1;
|
|
436
443
|
return (t) => {
|
|
437
444
|
if (!isHTMLElement(t)) return !1;
|
|
@@ -452,17 +459,17 @@ function re(t, e) {
|
|
|
452
459
|
return null !== c && (void 0 !== o && (n[o] = c), !0);
|
|
453
460
|
};
|
|
454
461
|
}
|
|
455
|
-
|
|
462
|
+
nt(362, JSON.stringify(t));
|
|
456
463
|
}(t, e, n))
|
|
457
464
|
};
|
|
458
465
|
}
|
|
459
|
-
function
|
|
466
|
+
function ie(t) {
|
|
460
467
|
const e = [];
|
|
461
468
|
for (const n of t) n && e.push(n);
|
|
462
469
|
return e;
|
|
463
470
|
}
|
|
464
|
-
function
|
|
465
|
-
const e =
|
|
471
|
+
function ce(t) {
|
|
472
|
+
const e = ie(t);
|
|
466
473
|
return 0 === e.length ? () => !0 : (t) => {
|
|
467
474
|
if (!isHTMLElement(t)) return !1;
|
|
468
475
|
const n = t.classList;
|
|
@@ -470,7 +477,7 @@ function ie(t) {
|
|
|
470
477
|
return !0;
|
|
471
478
|
};
|
|
472
479
|
}
|
|
473
|
-
function
|
|
480
|
+
function le(t, e, n) {
|
|
474
481
|
if (!0 === e) return (e) => isHTMLElement(e) && e.hasAttribute(t);
|
|
475
482
|
if ("string" == typeof e) return (n) => isHTMLElement(n) && n.getAttribute(t) === e;
|
|
476
483
|
if (e instanceof RegExp) {
|
|
@@ -483,32 +490,36 @@ function ce(t, e, n) {
|
|
|
483
490
|
return null !== c && (void 0 !== o && (n[o] = c), !0);
|
|
484
491
|
};
|
|
485
492
|
}
|
|
486
|
-
|
|
493
|
+
nt(361, JSON.stringify(t));
|
|
487
494
|
}
|
|
488
|
-
const
|
|
495
|
+
const ue = {
|
|
489
496
|
kind: "text",
|
|
490
497
|
predicate: isDOMTextNode,
|
|
491
498
|
tags: /* @__PURE__ */ new Set()
|
|
492
|
-
}
|
|
499
|
+
};
|
|
500
|
+
const fe = { [re]: ue };
|
|
501
|
+
const ae = {
|
|
493
502
|
kind: "comment",
|
|
494
503
|
predicate: (t) => 8 === t.nodeType,
|
|
495
504
|
tags: /* @__PURE__ */ new Set()
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
|
|
505
|
+
};
|
|
506
|
+
const de = { [re]: ae };
|
|
507
|
+
const pe = {
|
|
508
|
+
any: () => se(/* @__PURE__ */ new Set(), []),
|
|
509
|
+
comment: () => de,
|
|
499
510
|
tag(...t) {
|
|
500
|
-
t.length > 0 ||
|
|
511
|
+
t.length > 0 || nt(363);
|
|
501
512
|
const e = /* @__PURE__ */ new Set();
|
|
502
513
|
for (const n of t) e.add(n.toUpperCase());
|
|
503
|
-
return
|
|
514
|
+
return se(e, []);
|
|
504
515
|
},
|
|
505
|
-
text: () =>
|
|
516
|
+
text: () => fe
|
|
506
517
|
};
|
|
507
|
-
function
|
|
518
|
+
function he(t, e) {
|
|
508
519
|
return isHTMLElement(t) && t.nodeName === e.toUpperCase();
|
|
509
520
|
}
|
|
510
|
-
const
|
|
511
|
-
var
|
|
521
|
+
const ge = /[A-Za-z0-9_-]/;
|
|
522
|
+
var me = class {
|
|
512
523
|
constructor(t, e) {
|
|
513
524
|
this.source = t, this.pos = e;
|
|
514
525
|
}
|
|
@@ -526,7 +537,7 @@ var ge = class {
|
|
|
526
537
|
}
|
|
527
538
|
readIdent() {
|
|
528
539
|
const t = this.pos;
|
|
529
|
-
for (; !this.eof() &&
|
|
540
|
+
for (; !this.eof() && ge.test(this.peek());) this.pos++;
|
|
530
541
|
return this.source.slice(t, this.pos);
|
|
531
542
|
}
|
|
532
543
|
readQuoted() {
|
|
@@ -539,13 +550,13 @@ var ge = class {
|
|
|
539
550
|
return this.pos++, n.replace(/\\(.)/g, "$1");
|
|
540
551
|
}
|
|
541
552
|
assert(t, e) {
|
|
542
|
-
t ||
|
|
553
|
+
t || nt(364, String(this.pos + 1), e, this.source);
|
|
543
554
|
}
|
|
544
555
|
};
|
|
545
|
-
function
|
|
556
|
+
function ye(t) {
|
|
546
557
|
const e = /* @__PURE__ */ new Set(), n = [], o = [];
|
|
547
558
|
if (t.skipWhitespace(), "*" === t.peek()) t.consume();
|
|
548
|
-
else if (
|
|
559
|
+
else if (ge.test(t.peek())) {
|
|
549
560
|
const n = t.readIdent();
|
|
550
561
|
n && e.add(n.toUpperCase());
|
|
551
562
|
}
|
|
@@ -558,7 +569,7 @@ function me(t) {
|
|
|
558
569
|
} else if ("#" === e) {
|
|
559
570
|
t.consume();
|
|
560
571
|
const e = t.readIdent();
|
|
561
|
-
t.assert("" !== e, "expected id after \"#\""), n.push(
|
|
572
|
+
t.assert("" !== e, "expected id after \"#\""), n.push(le("id", e));
|
|
562
573
|
} else {
|
|
563
574
|
if ("[" !== e) break;
|
|
564
575
|
{
|
|
@@ -571,26 +582,26 @@ function me(t) {
|
|
|
571
582
|
const e = t.peek();
|
|
572
583
|
"\"" === e || "'" === e ? o = t.readQuoted() : (o = t.readIdent(), t.assert("" !== o, "expected attribute value")), t.skipWhitespace();
|
|
573
584
|
}
|
|
574
|
-
t.assert("]" === t.peek(), "expected \"]\""), t.consume(), n.push(
|
|
585
|
+
t.assert("]" === t.peek(), "expected \"]\""), t.consume(), n.push(le(e, o));
|
|
575
586
|
}
|
|
576
587
|
}
|
|
577
588
|
}
|
|
578
|
-
return o.length > 0 && n.push(
|
|
589
|
+
return o.length > 0 && n.push(ce(o)), {
|
|
579
590
|
predicates: n,
|
|
580
591
|
tags: e
|
|
581
592
|
};
|
|
582
593
|
}
|
|
583
|
-
function
|
|
584
|
-
const e = new
|
|
594
|
+
function xe(t) {
|
|
595
|
+
const e = new me(t, 0), n = [];
|
|
585
596
|
for (;;) {
|
|
586
|
-
const t =
|
|
597
|
+
const t = ye(e);
|
|
587
598
|
if (n.push(t), e.skipWhitespace(), e.eof()) break;
|
|
588
599
|
e.assert("," === e.peek(), "expected \",\" (selector lists are the only supported combinator)"), e.consume(), e.skipWhitespace();
|
|
589
600
|
}
|
|
590
|
-
if (1 === n.length) return
|
|
601
|
+
if (1 === n.length) return se(n[0].tags, n[0].predicates);
|
|
591
602
|
const o = /* @__PURE__ */ new Set();
|
|
592
603
|
for (const t of n) for (const e of t.tags) o.add(e);
|
|
593
|
-
return
|
|
604
|
+
return se(o, [(t, e) => {
|
|
594
605
|
for (const o of n) {
|
|
595
606
|
const n = t.nodeName;
|
|
596
607
|
if (o.tags.size > 0 && !o.tags.has(n)) continue;
|
|
@@ -604,106 +615,115 @@ function ye(t) {
|
|
|
604
615
|
return !1;
|
|
605
616
|
}]);
|
|
606
617
|
}
|
|
607
|
-
function
|
|
618
|
+
function Se(t) {
|
|
608
619
|
return t;
|
|
609
620
|
}
|
|
610
|
-
function
|
|
611
|
-
return
|
|
621
|
+
function $e(t, e, n) {
|
|
622
|
+
return ht($t, t, e, n);
|
|
612
623
|
}
|
|
613
|
-
const
|
|
614
|
-
|
|
624
|
+
const ve = /* @__PURE__ */ $e("importSource", () => "unknown");
|
|
625
|
+
const Ce = /* @__PURE__ */ $e("importSourceDataTransfer", () => null);
|
|
626
|
+
const be = /* @__PURE__ */ $e("textFormat", () => 0);
|
|
627
|
+
const ke = /* @__PURE__ */ $e("textStyle", () => ({}));
|
|
628
|
+
function De(t) {
|
|
615
629
|
if (!isHTMLElement(t)) return !1;
|
|
616
630
|
if ("PRE" === t.nodeName) return !0;
|
|
617
631
|
const e = t.style.whiteSpace;
|
|
618
632
|
return "string" == typeof e && e.startsWith("pre");
|
|
619
633
|
}
|
|
620
|
-
function
|
|
634
|
+
function we(t) {
|
|
621
635
|
if (isDOMTextNode(t)) return !0;
|
|
622
636
|
if (!isHTMLElement(t)) return !1;
|
|
623
637
|
const e = t.style.display;
|
|
624
638
|
return e ? e.startsWith("inline") : !isBlockDomNode(t) && isInlineDomNode(t);
|
|
625
639
|
}
|
|
626
|
-
const
|
|
627
|
-
isInline:
|
|
628
|
-
preservesWhitespace:
|
|
629
|
-
}))
|
|
630
|
-
|
|
640
|
+
const Oe = /* @__PURE__ */ $e("whitespaceConfig", () => ({
|
|
641
|
+
isInline: we,
|
|
642
|
+
preservesWhitespace: De
|
|
643
|
+
}));
|
|
644
|
+
const Me = /* @__PURE__ */ $e("importOverlays", () => []);
|
|
645
|
+
var Ae = class {
|
|
631
646
|
constructor(t) {
|
|
632
647
|
this.record = t;
|
|
633
648
|
}
|
|
634
649
|
get(t) {
|
|
635
|
-
return
|
|
650
|
+
return rt(this.record, t);
|
|
636
651
|
}
|
|
637
652
|
set(t, e) {
|
|
638
653
|
this.record[t.key] = e;
|
|
639
654
|
}
|
|
640
655
|
update(t, e) {
|
|
641
|
-
this.record[t.key] = e(
|
|
656
|
+
this.record[t.key] = e(rt(this.record, t));
|
|
642
657
|
}
|
|
643
658
|
has(t) {
|
|
644
659
|
return Object.prototype.hasOwnProperty.call(this.record, t.key);
|
|
645
660
|
}
|
|
646
661
|
};
|
|
647
|
-
function
|
|
648
|
-
const e = getPeerDependencyFromEditor(t,
|
|
662
|
+
function Ne(t) {
|
|
663
|
+
const e = getPeerDependencyFromEditor(t, St);
|
|
649
664
|
return e ? e.output.defaults : void 0;
|
|
650
665
|
}
|
|
651
|
-
function
|
|
652
|
-
return
|
|
653
|
-
return
|
|
666
|
+
function Ee(t, n = $getEditor()) {
|
|
667
|
+
return rt(function(t) {
|
|
668
|
+
return it($t, t) || Ne(t);
|
|
654
669
|
}(n), t);
|
|
655
670
|
}
|
|
656
|
-
const
|
|
657
|
-
function
|
|
671
|
+
const Ie = pt($t, Ne);
|
|
672
|
+
function We(t) {
|
|
658
673
|
return $isBlockElementNode(t) || $isDecoratorNode(t) && !t.isInline();
|
|
659
674
|
}
|
|
660
|
-
function
|
|
675
|
+
function Re(t, e) {
|
|
661
676
|
const n = [];
|
|
662
677
|
let o = [];
|
|
663
678
|
const r = () => {
|
|
664
679
|
0 !== o.length && (n.push(e().splice(0, 0, o)), o = []);
|
|
665
680
|
};
|
|
666
|
-
for (const s of t) if (
|
|
681
|
+
for (const s of t) if (We(s)) {
|
|
667
682
|
if (r(), $isElementNode(s)) {
|
|
668
|
-
const t =
|
|
683
|
+
const t = Re(s.getChildren(), e);
|
|
669
684
|
s.splice(0, s.getChildrenSize(), t);
|
|
670
685
|
}
|
|
671
686
|
n.push(s);
|
|
672
687
|
} else o.push(s);
|
|
673
688
|
return r(), n;
|
|
674
689
|
}
|
|
675
|
-
function
|
|
690
|
+
function Fe(t, e) {
|
|
676
691
|
if (!isHTMLElement(e)) return t;
|
|
677
692
|
const n = e.style.textAlign;
|
|
678
|
-
if (!
|
|
693
|
+
if (!Be(n)) return t;
|
|
679
694
|
for (const e of t) $isBlockElementNode(e) && "" === e.getFormatType() && e.setFormat(n);
|
|
680
695
|
return t;
|
|
681
696
|
}
|
|
682
|
-
function
|
|
697
|
+
function Te(t, e, n) {
|
|
683
698
|
1 === t.length && $isLineBreakNode(t[0]) && (t = []);
|
|
684
699
|
const o = $createParagraphNode();
|
|
685
700
|
if (isHTMLElement(n)) {
|
|
686
701
|
const t = n.style.textAlign;
|
|
687
|
-
|
|
702
|
+
Be(t) && o.setFormat(t);
|
|
688
703
|
}
|
|
689
704
|
return [o.splice(0, 0, t)];
|
|
690
705
|
}
|
|
691
|
-
const
|
|
692
|
-
$accepts:
|
|
693
|
-
$packageRun:
|
|
706
|
+
const Pe = {
|
|
707
|
+
$accepts: We,
|
|
708
|
+
$packageRun: Te,
|
|
694
709
|
name: "BlockSchema"
|
|
695
|
-
}
|
|
696
|
-
|
|
710
|
+
};
|
|
711
|
+
const je = {
|
|
712
|
+
$accepts: (t) => !We(t),
|
|
697
713
|
name: "InlineSchema"
|
|
698
|
-
}
|
|
699
|
-
|
|
714
|
+
};
|
|
715
|
+
const ze = {
|
|
716
|
+
$accepts: We,
|
|
700
717
|
$packageRun: (t) => t,
|
|
701
718
|
name: "NestedBlockSchema"
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
$
|
|
719
|
+
};
|
|
720
|
+
const _e = {
|
|
721
|
+
$accepts: We,
|
|
722
|
+
$packageRun: Te,
|
|
705
723
|
name: "RootSchema"
|
|
706
|
-
}
|
|
724
|
+
};
|
|
725
|
+
const Le = pe;
|
|
726
|
+
const Ue = /* @__PURE__ */ new Set([
|
|
707
727
|
"center",
|
|
708
728
|
"end",
|
|
709
729
|
"justify",
|
|
@@ -711,10 +731,10 @@ const Te = {
|
|
|
711
731
|
"right",
|
|
712
732
|
"start"
|
|
713
733
|
]);
|
|
714
|
-
function
|
|
715
|
-
return
|
|
734
|
+
function Be(t) {
|
|
735
|
+
return Ue.has(t);
|
|
716
736
|
}
|
|
717
|
-
const
|
|
737
|
+
const Ve = {
|
|
718
738
|
B: { fontWeight: "bold" },
|
|
719
739
|
EM: { fontStyle: "italic" },
|
|
720
740
|
I: { fontStyle: "italic" },
|
|
@@ -723,19 +743,20 @@ const Be = {
|
|
|
723
743
|
SUB: { verticalAlign: "sub" },
|
|
724
744
|
SUP: { verticalAlign: "super" },
|
|
725
745
|
U: { textDecoration: "underline" }
|
|
726
|
-
}
|
|
746
|
+
};
|
|
747
|
+
const qe = {
|
|
727
748
|
CODE: IS_CODE,
|
|
728
749
|
MARK: IS_HIGHLIGHT
|
|
729
750
|
};
|
|
730
|
-
const
|
|
751
|
+
const Ge = /* @__PURE__ */ new Set([
|
|
731
752
|
"font-weight",
|
|
732
753
|
"font-style",
|
|
733
754
|
"text-decoration",
|
|
734
755
|
"vertical-align"
|
|
735
756
|
]);
|
|
736
|
-
const
|
|
757
|
+
const He = /* @__PURE__ */ Se({
|
|
737
758
|
$import: (t, e) => {
|
|
738
|
-
const n = t.get(
|
|
759
|
+
const n = t.get(be), o = Ve[e.nodeName], r = function(t) {
|
|
739
760
|
return {
|
|
740
761
|
fontStyle: t.style.fontStyle,
|
|
741
762
|
fontWeight: t.style.fontWeight,
|
|
@@ -762,13 +783,13 @@ const Ge = /* @__PURE__ */ xe({
|
|
|
762
783
|
};
|
|
763
784
|
}(s), u & ~f.clear | f.set);
|
|
764
785
|
var u, f;
|
|
765
|
-
const a =
|
|
766
|
-
return a && (l |= a), l === n ? t.$importChildren(e) : t.$importChildren(e, { context: [
|
|
786
|
+
const a = qe[e.nodeName];
|
|
787
|
+
return a && (l |= a), l === n ? t.$importChildren(e) : t.$importChildren(e, { context: [ft(be, l)] });
|
|
767
788
|
},
|
|
768
|
-
match:
|
|
789
|
+
match: Le.tag("b", "strong", "em", "i", "code", "mark", "s", "sub", "sup", "u", "span"),
|
|
769
790
|
name: "@lexical/html/inline-format"
|
|
770
791
|
});
|
|
771
|
-
function
|
|
792
|
+
function Je(t, e, n) {
|
|
772
793
|
let o = t;
|
|
773
794
|
for (;;) {
|
|
774
795
|
let t = null;
|
|
@@ -784,23 +805,23 @@ function He(t, e, n) {
|
|
|
784
805
|
if ("BR" === o.nodeName) return null;
|
|
785
806
|
}
|
|
786
807
|
}
|
|
787
|
-
function
|
|
808
|
+
function Qe(t, e) {
|
|
788
809
|
return 0 !== e && $isTextNode(t) ? t.setFormat(e) : t;
|
|
789
810
|
}
|
|
790
|
-
function
|
|
811
|
+
function Ke(t, e) {
|
|
791
812
|
if ($isTextNode(t)) {
|
|
792
813
|
const n = function(t) {
|
|
793
814
|
let e = "";
|
|
794
|
-
for (const n in t)
|
|
815
|
+
for (const n in t) Ge.has(n) || (e += `${n}: ${t[n]}; `);
|
|
795
816
|
return e.trimEnd();
|
|
796
817
|
}(e);
|
|
797
818
|
"" !== n && t.setStyle(n);
|
|
798
819
|
}
|
|
799
820
|
return t;
|
|
800
821
|
}
|
|
801
|
-
const
|
|
822
|
+
const Ye = /* @__PURE__ */ Se({
|
|
802
823
|
$import: (t, e) => {
|
|
803
|
-
const n = t.get(
|
|
824
|
+
const n = t.get(be), o = t.get(ke), r = t.get(Oe);
|
|
804
825
|
if (function(t, e) {
|
|
805
826
|
let n = t.parentNode;
|
|
806
827
|
for (; null !== n;) {
|
|
@@ -810,7 +831,7 @@ const Ke = /* @__PURE__ */ xe({
|
|
|
810
831
|
return !1;
|
|
811
832
|
}(e, r)) {
|
|
812
833
|
const t = $generateNodesFromRawText(e.textContent || "");
|
|
813
|
-
for (const e of t)
|
|
834
|
+
for (const e of t) Qe(e, n), Ke(e, o);
|
|
814
835
|
return t;
|
|
815
836
|
}
|
|
816
837
|
const s = function(t, e) {
|
|
@@ -818,7 +839,7 @@ const Ke = /* @__PURE__ */ xe({
|
|
|
818
839
|
if (0 === n.length) return "";
|
|
819
840
|
if (" " === n[0]) {
|
|
820
841
|
let o = t, r = !0;
|
|
821
|
-
for (; null !== o && null !== (o =
|
|
842
|
+
for (; null !== o && null !== (o = Je(o, !1, e));) {
|
|
822
843
|
const t = o.textContent || "";
|
|
823
844
|
if (t.length > 0) {
|
|
824
845
|
/[ \t\n]$/.test(t) && (n = n.slice(1)), r = !1;
|
|
@@ -829,7 +850,7 @@ const Ke = /* @__PURE__ */ xe({
|
|
|
829
850
|
}
|
|
830
851
|
if (n.length > 0 && " " === n[n.length - 1]) {
|
|
831
852
|
let o = t, r = !0;
|
|
832
|
-
for (; null !== o && null !== (o =
|
|
853
|
+
for (; null !== o && null !== (o = Je(o, !0, e));) if ((o.textContent || "").replace(/^( |\t|\r?\n)+/, "").length > 0) {
|
|
833
854
|
r = !1;
|
|
834
855
|
break;
|
|
835
856
|
}
|
|
@@ -839,47 +860,52 @@ const Ke = /* @__PURE__ */ xe({
|
|
|
839
860
|
}(e, r);
|
|
840
861
|
if ("" === s) return [];
|
|
841
862
|
const i = $createTextNode(s);
|
|
842
|
-
return
|
|
863
|
+
return Qe(i, n), Ke(i, o), [i];
|
|
843
864
|
},
|
|
844
|
-
match:
|
|
865
|
+
match: Le.text(),
|
|
845
866
|
name: "@lexical/html/#text"
|
|
846
|
-
})
|
|
867
|
+
});
|
|
868
|
+
const Ze = /* @__PURE__ */ Se({
|
|
847
869
|
$import: () => [],
|
|
848
|
-
match:
|
|
870
|
+
match: Le.tag("script", "style"),
|
|
849
871
|
name: "@lexical/html/script-style-ignore"
|
|
850
|
-
})
|
|
872
|
+
});
|
|
873
|
+
const Xe = /* @__PURE__ */ Se({
|
|
851
874
|
$import: (t, e) => isOnlyChildInBlockNode(e) || isLastChildInBlockNode(e) ? [] : [$createLineBreakNode()],
|
|
852
|
-
match:
|
|
875
|
+
match: Le.tag("br"),
|
|
853
876
|
name: "@lexical/html/br"
|
|
854
|
-
})
|
|
877
|
+
});
|
|
878
|
+
const tn = /* @__PURE__ */ Se({
|
|
855
879
|
$import: (t, e) => {
|
|
856
880
|
const n = $createParagraphNode();
|
|
857
881
|
if ($setFormatFromDOM(n, e), setNodeIndentFromDOM(e, n), "" === n.getFormatType()) {
|
|
858
882
|
const t = e.getAttribute("align");
|
|
859
|
-
t &&
|
|
883
|
+
t && Be(t) && n.setFormat(t);
|
|
860
884
|
}
|
|
861
885
|
return $setDirectionFromDOM(n, e), [n.splice(0, 0, t.$importChildren(e))];
|
|
862
886
|
},
|
|
863
|
-
match:
|
|
887
|
+
match: Le.tag("p"),
|
|
864
888
|
name: "@lexical/html/p"
|
|
865
|
-
})
|
|
889
|
+
});
|
|
890
|
+
const en = /* @__PURE__ */ Se({
|
|
866
891
|
$import: (t, n, o) => $getEditor().hasNode(HorizontalRuleNode) ? [$createHorizontalRuleNode()] : o(),
|
|
867
|
-
match:
|
|
892
|
+
match: Le.tag("hr"),
|
|
868
893
|
name: "@lexical/html/hr"
|
|
869
|
-
})
|
|
870
|
-
|
|
871
|
-
|
|
894
|
+
});
|
|
895
|
+
const nn = [
|
|
896
|
+
Ze,
|
|
872
897
|
tn,
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
898
|
+
en,
|
|
899
|
+
/* @__PURE__ */ Se({
|
|
900
|
+
$import: (t, e, n) => isBlockDomNode(e) ? Fe(t.$importChildren(e, { schema: Pe }), e) : n(),
|
|
901
|
+
match: Le.any(),
|
|
876
902
|
name: "@lexical/html/transparent-block"
|
|
877
903
|
}),
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
904
|
+
Ye,
|
|
905
|
+
Xe,
|
|
906
|
+
He
|
|
881
907
|
];
|
|
882
|
-
function
|
|
908
|
+
function on(t, e) {
|
|
883
909
|
const n = [];
|
|
884
910
|
let o = 0, r = 0;
|
|
885
911
|
for (; o < t.length && r < e.length;) t[o] <= e[r] ? n.push(t[o++]) : n.push(e[r++]);
|
|
@@ -887,12 +913,12 @@ function nn(t, e) {
|
|
|
887
913
|
for (; r < e.length;) n.push(e[r++]);
|
|
888
914
|
return n;
|
|
889
915
|
}
|
|
890
|
-
function
|
|
916
|
+
function rn(t) {
|
|
891
917
|
const e = [], n = /* @__PURE__ */ new Map(), o = [], r = [], s = [], i = /* @__PURE__ */ new Set();
|
|
892
918
|
t.forEach((t, c) => {
|
|
893
919
|
const l = function(t) {
|
|
894
|
-
const e = t[
|
|
895
|
-
return void 0 === e &&
|
|
920
|
+
const e = t[re];
|
|
921
|
+
return void 0 === e && nt(360), e;
|
|
896
922
|
}(t.match), u = t.name || function(t, e) {
|
|
897
923
|
if ("text" === t.kind) return `#text@${e}`;
|
|
898
924
|
if ("comment" === t.kind) return `#comment@${e}`;
|
|
@@ -913,7 +939,7 @@ function on(t) {
|
|
|
913
939
|
});
|
|
914
940
|
const c = /* @__PURE__ */ new Map();
|
|
915
941
|
if (0 === o.length) for (const [t, e] of n) c.set(t, e);
|
|
916
|
-
else for (const [t, e] of n) c.set(t,
|
|
942
|
+
else for (const [t, e] of n) c.set(t, on(e, o));
|
|
917
943
|
return {
|
|
918
944
|
byTag: c,
|
|
919
945
|
commentIndices: s,
|
|
@@ -922,50 +948,50 @@ function on(t) {
|
|
|
922
948
|
wildcardIndices: o
|
|
923
949
|
};
|
|
924
950
|
}
|
|
925
|
-
function
|
|
926
|
-
return isDOMTextNode(e) ? t.textIndices : 8 === e.nodeType ? t.commentIndices : isHTMLElement(e) ? t.byTag.get(e.nodeName) || t.wildcardIndices :
|
|
951
|
+
function sn(t, e) {
|
|
952
|
+
return isDOMTextNode(e) ? t.textIndices : 8 === e.nodeType ? t.commentIndices : isHTMLElement(e) ? t.byTag.get(e.nodeName) || t.wildcardIndices : cn;
|
|
927
953
|
}
|
|
928
|
-
const
|
|
929
|
-
function
|
|
954
|
+
const cn = Object.freeze([]);
|
|
955
|
+
function ln(t) {
|
|
930
956
|
const e = [];
|
|
931
|
-
for (const n of t) if (
|
|
957
|
+
for (const n of t) if (un(n)) for (const t of n.rules) e.push(t);
|
|
932
958
|
else e.push(n);
|
|
933
959
|
return e;
|
|
934
960
|
}
|
|
935
|
-
function
|
|
961
|
+
function un(t) {
|
|
936
962
|
return "object" == typeof t && null !== t && "__type" in t && "CompiledOverlayRules" === t.__type;
|
|
937
963
|
}
|
|
938
|
-
function
|
|
939
|
-
const e =
|
|
964
|
+
function fn(t) {
|
|
965
|
+
const e = ln(t);
|
|
940
966
|
return {
|
|
941
967
|
__type: "CompiledOverlayRules",
|
|
942
|
-
dispatch:
|
|
968
|
+
dispatch: rn(e),
|
|
943
969
|
rules: e
|
|
944
970
|
};
|
|
945
971
|
}
|
|
946
|
-
const
|
|
947
|
-
function
|
|
972
|
+
const an = Object.freeze({});
|
|
973
|
+
function dn(t, e) {
|
|
948
974
|
return {
|
|
949
975
|
$importChildren: (e, n) => function(t, e, n) {
|
|
950
976
|
const o = n && n.rules ? n.rules.dispatch : void 0;
|
|
951
977
|
o && t.overlays.push(o);
|
|
952
978
|
try {
|
|
953
|
-
const o = () =>
|
|
954
|
-
return n && n.context ?
|
|
979
|
+
const o = () => pn(t, e, n);
|
|
980
|
+
return n && n.context ? Ie(n.context, t.editor)(o) : o();
|
|
955
981
|
} finally {
|
|
956
982
|
o && t.overlays.pop();
|
|
957
983
|
}
|
|
958
984
|
}(t, e, n),
|
|
959
|
-
$importOne: (e, n) =>
|
|
985
|
+
$importOne: (e, n) => hn(t, e, n),
|
|
960
986
|
captures: e,
|
|
961
|
-
get: (e) =>
|
|
987
|
+
get: (e) => Ee(e, t.editor),
|
|
962
988
|
session: t.session
|
|
963
989
|
};
|
|
964
990
|
}
|
|
965
|
-
function
|
|
991
|
+
function pn(t, e, n) {
|
|
966
992
|
const o = n && n.$onChild, r = [];
|
|
967
993
|
for (const n of Array.from(e.childNodes)) {
|
|
968
|
-
const e =
|
|
994
|
+
const e = hn(t, n, void 0);
|
|
969
995
|
for (const t of e) {
|
|
970
996
|
const e = o ? o(t) : t;
|
|
971
997
|
null != e && r.push(e);
|
|
@@ -991,25 +1017,25 @@ function dn(t, e, n) {
|
|
|
991
1017
|
return i(), t.$finalize ? t.$finalize(r, n) : r;
|
|
992
1018
|
}(i, s, null, e) : s;
|
|
993
1019
|
}
|
|
994
|
-
function
|
|
1020
|
+
function hn(t, e, n) {
|
|
995
1021
|
const o = () => function(t, e) {
|
|
996
1022
|
const n = function(t, e) {
|
|
997
1023
|
const n = [];
|
|
998
1024
|
for (let o = t.overlays.length - 1; o >= 0; o--) {
|
|
999
|
-
const r = t.overlays[o], s =
|
|
1025
|
+
const r = t.overlays[o], s = sn(r, e);
|
|
1000
1026
|
s.length > 0 && n.push({
|
|
1001
1027
|
dispatch: r,
|
|
1002
1028
|
indices: s
|
|
1003
1029
|
});
|
|
1004
1030
|
}
|
|
1005
|
-
const o =
|
|
1031
|
+
const o = sn(t.dispatch, e);
|
|
1006
1032
|
o.length > 0 && n.push({
|
|
1007
1033
|
dispatch: t.dispatch,
|
|
1008
1034
|
indices: o
|
|
1009
1035
|
});
|
|
1010
1036
|
return n;
|
|
1011
1037
|
}(t, e);
|
|
1012
|
-
if (0 === n.length) return
|
|
1038
|
+
if (0 === n.length) return gn(t, e);
|
|
1013
1039
|
let o = 0, r = 0;
|
|
1014
1040
|
const s = () => {
|
|
1015
1041
|
for (; o < n.length;) {
|
|
@@ -1017,7 +1043,7 @@ function pn(t, e, n) {
|
|
|
1017
1043
|
for (; r < c.length;) {
|
|
1018
1044
|
const n = c[r++], o = i.rules[n], l = {};
|
|
1019
1045
|
if (o.predicate(e, l)) {
|
|
1020
|
-
const n =
|
|
1046
|
+
const n = dn(t, 0 === Object.keys(l).length ? an : l);
|
|
1021
1047
|
try {
|
|
1022
1048
|
return o.$import(n, e, s);
|
|
1023
1049
|
} catch (t) {
|
|
@@ -1027,53 +1053,54 @@ function pn(t, e, n) {
|
|
|
1027
1053
|
}
|
|
1028
1054
|
o++, r = 0;
|
|
1029
1055
|
}
|
|
1030
|
-
return
|
|
1056
|
+
return gn(t, e);
|
|
1031
1057
|
};
|
|
1032
1058
|
return s();
|
|
1033
1059
|
}(t, e);
|
|
1034
|
-
return n && n.context ?
|
|
1060
|
+
return n && n.context ? Ie(n.context, t.editor)(o) : o();
|
|
1035
1061
|
}
|
|
1036
|
-
function
|
|
1062
|
+
function gn(t, e) {
|
|
1037
1063
|
if (0 === e.childNodes.length) return [];
|
|
1038
1064
|
const n = [];
|
|
1039
1065
|
for (const o of Array.from(e.childNodes)) {
|
|
1040
|
-
const e =
|
|
1066
|
+
const e = hn(t, o, void 0);
|
|
1041
1067
|
for (const t of e) n.push(t);
|
|
1042
1068
|
}
|
|
1043
1069
|
return n;
|
|
1044
1070
|
}
|
|
1045
|
-
const
|
|
1071
|
+
const mn = /* @__PURE__ */ Se({
|
|
1046
1072
|
$import: (t, e) => t.$importChildren(e),
|
|
1047
|
-
match:
|
|
1073
|
+
match: pe.any(),
|
|
1048
1074
|
name: "@lexical/html/default-hoist"
|
|
1049
|
-
})
|
|
1075
|
+
});
|
|
1076
|
+
const yn = /* @__PURE__ */ defineExtension({
|
|
1050
1077
|
build(t, e) {
|
|
1051
|
-
const n =
|
|
1078
|
+
const n = rn(ln(e.rules)), r = lt(e.contextDefaults, void 0), s = e.preprocess;
|
|
1052
1079
|
return {
|
|
1053
1080
|
$generateNodesFromDOM: (e, i) => {
|
|
1054
|
-
const c = i && i.context ?
|
|
1081
|
+
const c = it($t, t) || r, l = i && i.context ? lt(i.context, c) : c, u = void 0 !== l && l !== c ? l : Object.create(c || null), f = new Ae(u), a = { session: f };
|
|
1055
1082
|
return function(t, e, n) {
|
|
1056
1083
|
let o = t.length - 1;
|
|
1057
1084
|
const r = () => {
|
|
1058
1085
|
for (; o >= 0;) return void (0, t[o--])(e, n, r);
|
|
1059
1086
|
};
|
|
1060
1087
|
r();
|
|
1061
|
-
}(i && i.preprocess ? [...s, ...i.preprocess] : s, e,
|
|
1062
|
-
return
|
|
1088
|
+
}(i && i.preprocess ? [...s, ...i.preprocess] : s, e, a), dt($t, u, () => function(t, e, n, r) {
|
|
1089
|
+
return pn({
|
|
1063
1090
|
dispatch: t,
|
|
1064
1091
|
editor: e,
|
|
1065
|
-
overlays: r.get(
|
|
1092
|
+
overlays: r.get(Me).map((t) => t.dispatch),
|
|
1066
1093
|
session: r
|
|
1067
|
-
}, isDOMDocumentNode(n) ? n.body : n, { schema:
|
|
1068
|
-
}(n, t, e,
|
|
1094
|
+
}, isDOMDocumentNode(n) ? n.body : n, { schema: _e });
|
|
1095
|
+
}(n, t, e, f), t);
|
|
1069
1096
|
},
|
|
1070
1097
|
defaults: r
|
|
1071
1098
|
};
|
|
1072
1099
|
},
|
|
1073
1100
|
config: {
|
|
1074
1101
|
contextDefaults: [],
|
|
1075
|
-
preprocess: [
|
|
1076
|
-
rules: [
|
|
1102
|
+
preprocess: [gt],
|
|
1103
|
+
rules: [mn]
|
|
1077
1104
|
},
|
|
1078
1105
|
mergeConfig: (t, e) => shallowMergeConfig(t, {
|
|
1079
1106
|
...e,
|
|
@@ -1081,29 +1108,33 @@ const gn = /* @__PURE__ */ xe({
|
|
|
1081
1108
|
...e.preprocess && { preprocess: [...t.preprocess, ...e.preprocess] },
|
|
1082
1109
|
...e.rules && { rules: [...e.rules, ...t.rules] }
|
|
1083
1110
|
}),
|
|
1084
|
-
name:
|
|
1111
|
+
name: St
|
|
1085
1112
|
});
|
|
1086
|
-
function
|
|
1087
|
-
return $getExtensionOutput(
|
|
1113
|
+
function xn(t, e) {
|
|
1114
|
+
return $getExtensionOutput(yn).$generateNodesFromDOM(t, e);
|
|
1088
1115
|
}
|
|
1089
|
-
const
|
|
1090
|
-
dependencies: [/* @__PURE__ */ configExtension(
|
|
1116
|
+
const Sn = /* @__PURE__ */ defineExtension({
|
|
1117
|
+
dependencies: [/* @__PURE__ */ configExtension(yn, { rules: nn })],
|
|
1091
1118
|
name: "@lexical/html/CoreImport"
|
|
1092
|
-
})
|
|
1093
|
-
|
|
1119
|
+
});
|
|
1120
|
+
const $n = [en];
|
|
1121
|
+
const vn = /* @__PURE__ */ defineExtension({
|
|
1122
|
+
dependencies: [HorizontalRuleExtension, Sn],
|
|
1094
1123
|
name: "@lexical/html/HorizontalRuleImport"
|
|
1095
|
-
})
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1124
|
+
});
|
|
1125
|
+
const Cn = {
|
|
1126
|
+
any: pe.any,
|
|
1127
|
+
comment: pe.comment,
|
|
1128
|
+
css: xe,
|
|
1129
|
+
tag: pe.tag,
|
|
1130
|
+
text: pe.text
|
|
1131
|
+
};
|
|
1132
|
+
const bn = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
|
|
1133
|
+
function kn(t, e) {
|
|
1134
|
+
mt(e);
|
|
1104
1135
|
const n = isDOMDocumentNode(e) ? e.body.childNodes : e.childNodes, r = [], s = [];
|
|
1105
|
-
for (const e of n) if (!
|
|
1106
|
-
const n =
|
|
1136
|
+
for (const e of n) if (!bn.has(e.nodeName)) {
|
|
1137
|
+
const n = Nn(e, t, s, !1);
|
|
1107
1138
|
if (null !== n) for (const t of n) r.push(t);
|
|
1108
1139
|
}
|
|
1109
1140
|
return function(t) {
|
|
@@ -1114,49 +1145,49 @@ function bn(t, e) {
|
|
|
1114
1145
|
}
|
|
1115
1146
|
}(s), r;
|
|
1116
1147
|
}
|
|
1117
|
-
function
|
|
1118
|
-
return
|
|
1119
|
-
const e = $getRoot(), r =
|
|
1120
|
-
for (const t of ($isElementNode(s) ? s : e).getChildren())
|
|
1148
|
+
function Dn(t, n = null, o = $getEditor()) {
|
|
1149
|
+
return Et([ft(kt, !0)], o)(() => {
|
|
1150
|
+
const e = $getRoot(), r = Nt(o), s = $isRangeSelection(n) ? $getSlotFrame(n.anchor.getNode()) : null, i = t.append.bind(t);
|
|
1151
|
+
for (const t of ($isElementNode(s) ? s : e).getChildren()) Mn(o, t, i, n, r);
|
|
1121
1152
|
return t;
|
|
1122
1153
|
});
|
|
1123
1154
|
}
|
|
1124
|
-
function
|
|
1155
|
+
function wn(t, n = $getRoot()) {
|
|
1125
1156
|
const o = $getEditor();
|
|
1126
|
-
return
|
|
1127
|
-
const e =
|
|
1128
|
-
return
|
|
1157
|
+
return Et([ft(kt, !0), ft(bt, !0)], o)(() => {
|
|
1158
|
+
const e = Nt(o), r = t.append.bind(t);
|
|
1159
|
+
return Mn(o, n, r, null, e), t;
|
|
1129
1160
|
});
|
|
1130
1161
|
}
|
|
1131
|
-
function
|
|
1132
|
-
return ("undefined" == typeof document || "undefined" == typeof window && void 0 === global.window) &&
|
|
1162
|
+
function On(t, e = null) {
|
|
1163
|
+
return ("undefined" == typeof document || "undefined" == typeof window && void 0 === global.window) && nt(338), $assumeActiveEditor(t), Dn($getDocument().createElement("div"), e, t).innerHTML;
|
|
1133
1164
|
}
|
|
1134
|
-
function
|
|
1165
|
+
function Mn(e, n, o, i = null, c = $getEditorDOMRenderConfig(e)) {
|
|
1135
1166
|
let l = c.$shouldInclude(n, i, e);
|
|
1136
1167
|
const u = c.$shouldExclude(n, i, e);
|
|
1137
1168
|
let f = n;
|
|
1138
1169
|
null !== i && $isTextNode(n) && (f = $sliceSelectedTextNodeContent(i, n, "clone"));
|
|
1139
|
-
const { element: d, after: p, append:
|
|
1170
|
+
const { element: d, after: p, append: g, $getChildNodes: m } = c.$exportDOM(f, e);
|
|
1140
1171
|
if (!d) return !1;
|
|
1141
|
-
const
|
|
1142
|
-
for (const t of
|
|
1143
|
-
const o =
|
|
1172
|
+
const y = $getDocument().createDocumentFragment(), S = m ? m() : $isElementNode(f) ? f.getChildren() : [], $ = l && $isNodeSelection(i) && $isElementNode(n) ? null : i, v = y.append.bind(y);
|
|
1173
|
+
for (const t of S) {
|
|
1174
|
+
const o = Mn(e, t, v, $, c);
|
|
1144
1175
|
!l && o && c.$extractWithChild(n, t, i, "html", e) && (l = !0);
|
|
1145
1176
|
}
|
|
1146
1177
|
if (l && !u) {
|
|
1147
|
-
if ((isHTMLElement(d) || isDocumentFragment(d)) && (
|
|
1178
|
+
if ((isHTMLElement(d) || isDocumentFragment(d)) && (g ? g(y) : d.append(y)), o(d), p) {
|
|
1148
1179
|
const t = p.call(f, d);
|
|
1149
1180
|
t && (isDocumentFragment(d) ? d.replaceChildren(t) : d.replaceWith(t));
|
|
1150
1181
|
}
|
|
1151
|
-
} else o(
|
|
1182
|
+
} else o(y);
|
|
1152
1183
|
return l;
|
|
1153
1184
|
}
|
|
1154
|
-
function
|
|
1155
|
-
return
|
|
1185
|
+
function An(t, e, n, o = null) {
|
|
1186
|
+
return Mn(t, e, n.append.bind(n), o, Nt(t));
|
|
1156
1187
|
}
|
|
1157
|
-
function
|
|
1188
|
+
function Nn(t, e, n, o, r = /* @__PURE__ */ new Map(), s) {
|
|
1158
1189
|
const i = [];
|
|
1159
|
-
if (
|
|
1190
|
+
if (bn.has(t.nodeName)) return i;
|
|
1160
1191
|
let c = null;
|
|
1161
1192
|
const l = function(t, e) {
|
|
1162
1193
|
const { nodeName: n } = t, o = e._htmlConversions.get(n.toLowerCase());
|
|
@@ -1180,8 +1211,8 @@ function An(t, e, n, o, r = /* @__PURE__ */ new Map(), s) {
|
|
|
1180
1211
|
const a = t.childNodes;
|
|
1181
1212
|
let d = [];
|
|
1182
1213
|
const p = (null == c || !$isRootOrShadowRoot(c)) && (null != c && $isBlockElementNode(c) || o);
|
|
1183
|
-
for (let t = 0; t < a.length; t++) d.push(...
|
|
1184
|
-
if (null != f && (d = f(d)), isBlockDomNode(t) && (d =
|
|
1214
|
+
for (let t = 0; t < a.length; t++) d.push(...Nn(a[t], e, n, p, new Map(r), c));
|
|
1215
|
+
if (null != f && (d = f(d)), isBlockDomNode(t) && (d = En(t, d, p ? () => {
|
|
1185
1216
|
const t = new ArtificialNode__DO_NOT_USE();
|
|
1186
1217
|
return n.push(t), t;
|
|
1187
1218
|
} : $createParagraphNode)), null == c) if (d.length > 0) for (const t of d) i.push(t);
|
|
@@ -1192,7 +1223,7 @@ function An(t, e, n, o, r = /* @__PURE__ */ new Map(), s) {
|
|
|
1192
1223
|
else $isElementNode(c) && c.append(...d);
|
|
1193
1224
|
return i;
|
|
1194
1225
|
}
|
|
1195
|
-
function
|
|
1226
|
+
function En(t, e, n) {
|
|
1196
1227
|
const o = t.style.textAlign, r = [];
|
|
1197
1228
|
let s = [];
|
|
1198
1229
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -1206,4 +1237,4 @@ function Nn(t, e, n) {
|
|
|
1206
1237
|
return r;
|
|
1207
1238
|
}
|
|
1208
1239
|
//#endregion
|
|
1209
|
-
export {
|
|
1240
|
+
export { An as $appendNodeToHTML, Re as $distributeInlineWrapper, Dn as $generateDOMFromNodes, wn as $generateDOMFromRoot, On as $generateHtmlFromNodes, kn as $generateNodesFromDOM, xn as $generateNodesFromDOMViaExtension, Ee as $getImportContextValue, wt as $getRenderContextValue, Nt as $getSessionDOMRenderConfig, gt as $inlineStylesFromStyleSheets, We as $isBlockLevel, Fe as $propagateTextAlignToBlockChildren, Mt as $setRenderContextValue, At as $updateRenderContextValue, Ie as $withImportContext, Et as $withRenderContext, Pe as BlockSchema, Sn as CoreImportExtension, nn as CoreImportRules, yn as DOMImportExtension, oe as DOMRenderExtension, vn as HorizontalRuleImportExtension, $n as HorizontalRuleImportRules, Me as ImportOverlays, ve as ImportSource, Ce as ImportSourceDataTransfer, be as ImportTextFormat, ke as ImportTextStyle, Oe as ImportWhitespaceConfig, je as InlineSchema, ze as NestedBlockSchema, kt as RenderContextExport, bt as RenderContextRoot, _e as RootSchema, at as contextUpdater, ft as contextValue, $e as createImportState, Ct as createRenderState, we as defaultIsInline, De as defaultPreservesWhitespace, Se as defineImportRule, fn as defineOverlayRules, It as domOverride, he as isElementOfTag, xe as parseSelector, Cn as sel };
|