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