@uva-glass/component-library 3.34.0 → 3.34.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.prod-BjpEXQJZ.js → Lexical.prod-C7FcGFd7.js} +528 -522
- package/dist/Lexical.prod-C7FcGFd7.js.map +1 -0
- package/dist/{LexicalClipboard.prod-B4j0EyWx.js → LexicalClipboard.prod-CeOlk1NB.js} +104 -104
- package/dist/{LexicalClipboard.prod-B4j0EyWx.js.map → LexicalClipboard.prod-CeOlk1NB.js.map} +1 -1
- package/dist/{LexicalLink.prod-CYNCWmMx.js → LexicalLink.prod-CSI9BSPD.js} +46 -46
- package/dist/{LexicalLink.prod-CYNCWmMx.js.map → LexicalLink.prod-CSI9BSPD.js.map} +1 -1
- package/dist/{LexicalList.prod-BRwEushm.js → LexicalList.prod-TMA2LN4v.js} +46 -46
- package/dist/{LexicalList.prod-BRwEushm.js.map → LexicalList.prod-TMA2LN4v.js.map} +1 -1
- package/dist/{LexicalSelection.prod-DYo5_Y2k.js → LexicalSelection.prod-DDwSrdAV.js} +31 -31
- package/dist/{LexicalSelection.prod-DYo5_Y2k.js.map → LexicalSelection.prod-DDwSrdAV.js.map} +1 -1
- package/dist/{LexicalTable.prod-BArw8Dt5.js → LexicalTable.prod-DYP5JQC0.js} +268 -268
- package/dist/{LexicalTable.prod-BArw8Dt5.js.map → LexicalTable.prod-DYP5JQC0.js.map} +1 -1
- package/dist/{LexicalUtils.prod-DJRX2pwP.js → LexicalUtils.prod-D_SPJ6vo.js} +42 -42
- package/dist/{LexicalUtils.prod-DJRX2pwP.js.map → LexicalUtils.prod-D_SPJ6vo.js.map} +1 -1
- package/dist/{TablePlugin-BagQHe1w.js → TablePlugin-CI_6HCsd.js} +56 -56
- package/dist/{TablePlugin-BagQHe1w.js.map → TablePlugin-CI_6HCsd.js.map} +1 -1
- package/dist/assets/MultiSelectBox.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.js +24 -24
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +6 -6
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +10 -10
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +43 -43
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +30 -30
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +12 -12
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +17 -17
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +201 -201
- package/dist/components/RteEditor/helpers.js +6 -6
- package/dist/components/index.js +1 -1
- package/dist/{helpers-DM8qHaKY.js → helpers-CYiLlioz.js} +38 -38
- package/dist/{helpers-DM8qHaKY.js.map → helpers-CYiLlioz.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/Lexical.prod-BjpEXQJZ.js.map +0 -1
|
@@ -4,15 +4,15 @@ function T(n, ...e) {
|
|
|
4
4
|
for (const i of e) r.append("v", i);
|
|
5
5
|
throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
6
6
|
}
|
|
7
|
-
const ae = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0,
|
|
7
|
+
const ae = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, js = ae && "documentMode" in document ? document.documentMode : null, fe = ae && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Re = ae && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Qt = !(!ae || !("InputEvent" in window) || js) && "getTargetRanges" in new window.InputEvent("input"), vt = ae && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), rt = ae && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, $s = ae && /Android/.test(navigator.userAgent), Li = ae && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ir = ae && $s && Li, Zt = ae && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Li;
|
|
8
8
|
function en(...n) {
|
|
9
9
|
const e = [];
|
|
10
10
|
for (const t of n) if (t && typeof t == "string") for (const [r] of t.matchAll(/\S+/g)) e.push(r);
|
|
11
11
|
return e;
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const Us = 1, Vs = 3, Ys = 9, Hs = 11, We = 0, Ii = 1, it = 2, qs = 0, Gs = 1, Xs = 2, tn = 4, nn = 8, or = 128, Qs = 1792 | (112 | (3 | tn | nn) | or), lr = 1, ar = 2, cr = 3, ur = 4, fr = 5, dr = 6, _n = vt || rt || Zt ? " " : "", ve = `
|
|
14
14
|
|
|
15
|
-
`,
|
|
15
|
+
`, Zs = Re ? " " : _n, zi = "֑-߿יִ-﷽ﹰ-ﻼ", Ki = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", eo = new RegExp("^[^" + Ki + "]*[" + zi + "]"), to = new RegExp("^[^" + zi + "]*[" + Ki + "]"), Je = { bold: 1, capitalize: 1024, code: 16, highlight: or, italic: 2, lowercase: 256, strikethrough: tn, subscript: 32, superscript: 64, underline: nn, uppercase: 512 }, no = { directionless: 1, unmergeable: 2 }, zr = { center: ar, end: dr, justify: ur, left: lr, right: cr, start: fr }, ro = { [ar]: "center", [dr]: "end", [ur]: "justify", [lr]: "left", [cr]: "right", [fr]: "start" }, io = { normal: 0, segmented: 2, token: 1 }, so = { [qs]: "normal", [Xs]: "segmented", [Gs]: "token" }, Kr = "$config";
|
|
16
16
|
function Bi(n, e, t, r, i, s) {
|
|
17
17
|
let o = n.getFirstChild();
|
|
18
18
|
for (; o !== null; ) {
|
|
@@ -20,41 +20,41 @@ function Bi(n, e, t, r, i, s) {
|
|
|
20
20
|
o.__parent === e && (v(o) && Bi(o, l, t, r, i, s), t.has(l) || s.delete(l), i.push(l)), o = o.getNextSibling();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const oo = 100;
|
|
24
24
|
let jn = !1, hr = 0;
|
|
25
|
-
function
|
|
25
|
+
function lo(n) {
|
|
26
26
|
hr = n.timeStamp;
|
|
27
27
|
}
|
|
28
28
|
function Mn(n, e, t) {
|
|
29
29
|
const r = n.nodeName === "BR", i = e.__lexicalLineBreak;
|
|
30
30
|
return i && (n === i || r && n.previousSibling === i) || r && kn(n, t) !== void 0;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function ao(n, e, t) {
|
|
33
33
|
const r = ke(oe(t));
|
|
34
34
|
let i = null, s = null;
|
|
35
35
|
r !== null && r.anchorNode === n && (i = r.anchorOffset, s = r.focusOffset);
|
|
36
36
|
const o = n.nodeValue;
|
|
37
37
|
o !== null && br(e, o, i, s, !1);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function co(n, e, t) {
|
|
40
40
|
if (A(n)) {
|
|
41
41
|
const r = n.anchor.getNode();
|
|
42
42
|
if (r.is(t) && n.format !== r.getFormat()) return !1;
|
|
43
43
|
}
|
|
44
44
|
return Te(e) && t.isAttached();
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
for (let i = n; i && !
|
|
46
|
+
function uo(n, e, t, r) {
|
|
47
|
+
for (let i = n; i && !ml(i); i = Lt(i)) {
|
|
48
48
|
const s = kn(i, e);
|
|
49
49
|
if (s !== void 0) {
|
|
50
50
|
const o = U(s, t);
|
|
51
|
-
if (o) return
|
|
52
|
-
} else if (i === r) return [r,
|
|
51
|
+
if (o) return K(o) || !ee(i) ? void 0 : [i, o];
|
|
52
|
+
} else if (i === r) return [r, Ds(t)];
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
function Ri(n, e, t) {
|
|
56
56
|
jn = !0;
|
|
57
|
-
const r = performance.now() - hr >
|
|
57
|
+
const r = performance.now() - hr > oo;
|
|
58
58
|
try {
|
|
59
59
|
te(n, () => {
|
|
60
60
|
const i = L() || function(f) {
|
|
@@ -65,15 +65,15 @@ function Ri(n, e, t) {
|
|
|
65
65
|
}(n), s = /* @__PURE__ */ new Map(), o = n.getRootElement(), l = n._editorState, a = n._blockCursorElement;
|
|
66
66
|
let c = !1, u = "";
|
|
67
67
|
for (let f = 0; f < e.length; f++) {
|
|
68
|
-
const g = e[f], h = g.type, _ = g.target, p =
|
|
68
|
+
const g = e[f], h = g.type, _ = g.target, p = uo(_, n, l, o);
|
|
69
69
|
if (!p) continue;
|
|
70
70
|
const [x, y] = p;
|
|
71
|
-
if (h === "characterData") r && M(y) && Te(_) &&
|
|
71
|
+
if (h === "characterData") r && M(y) && Te(_) && co(i, _, y) && ao(_, y, n);
|
|
72
72
|
else if (h === "childList") {
|
|
73
73
|
c = !0;
|
|
74
74
|
const m = g.addedNodes;
|
|
75
75
|
for (let C = 0; C < m.length; C++) {
|
|
76
|
-
const w = m[C], k =
|
|
76
|
+
const w = m[C], k = Os(w), S = w.parentNode;
|
|
77
77
|
if (S != null && w !== a && k === null && !Mn(w, S, n)) {
|
|
78
78
|
if (Re) {
|
|
79
79
|
const O = (ee(w) ? w.innerText : null) || w.nodeValue;
|
|
@@ -105,7 +105,7 @@ function Ri(n, e, t) {
|
|
|
105
105
|
}
|
|
106
106
|
t.takeRecords();
|
|
107
107
|
}
|
|
108
|
-
i !== null && (c && ie(i), Re &&
|
|
108
|
+
i !== null && (c && ie(i), Re && Is(n) && i.insertRawText(u));
|
|
109
109
|
});
|
|
110
110
|
} finally {
|
|
111
111
|
jn = !1;
|
|
@@ -117,12 +117,12 @@ function Wi(n) {
|
|
|
117
117
|
}
|
|
118
118
|
function Ji(n) {
|
|
119
119
|
(function(e) {
|
|
120
|
-
hr === 0 && oe(e).addEventListener("textInput",
|
|
120
|
+
hr === 0 && oe(e).addEventListener("textInput", lo, !0);
|
|
121
121
|
})(n), n._observer = new MutationObserver((e, t) => {
|
|
122
122
|
Ri(n, e, t);
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function fo(n) {
|
|
126
126
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
127
127
|
for (let r = typeof n == "function" ? n : n.replace; r.prototype && r.prototype.getType !== void 0; r = Object.getPrototypeOf(r)) {
|
|
128
128
|
const { ownNodeConfig: i } = Mr(r);
|
|
@@ -194,12 +194,13 @@ class gr {
|
|
|
194
194
|
if (this.size = t.size, this.unknownState = void 0, e) for (const [r, i] of Object.entries(e)) this.updateFromUnknown(r, i);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
const e = n.getWritable(), t = e.__state ? e.__state.getWritable(e) : new gr(e,
|
|
199
|
-
return Ts(hl(), r.getType()).sharedNodeState;
|
|
200
|
-
}(e));
|
|
197
|
+
function ho(n) {
|
|
198
|
+
const e = n.getWritable(), t = e.__state ? e.__state.getWritable(e) : new gr(e, ji(e));
|
|
201
199
|
return e.__state = t, t;
|
|
202
200
|
}
|
|
201
|
+
function ji(n) {
|
|
202
|
+
return n.__state ? n.__state.sharedNodeState : Ns(gl(), n.getType()).sharedNodeState;
|
|
203
|
+
}
|
|
203
204
|
function Br(n) {
|
|
204
205
|
if (n) for (const e in n) return n;
|
|
205
206
|
}
|
|
@@ -278,7 +279,7 @@ function Vr(n) {
|
|
|
278
279
|
n.set(r.__key, i ? r.getChildrenSize() : 0, "element", !0);
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
|
-
let Ae, Q, kt, pn, Un, Vn, je, le,
|
|
282
|
+
let Ae, Q, kt, pn, Un, Vn, je, le, Yn, Tt, J = "", X = "", ce = null, ue = "", Ce = "", $i = !1, Nt = !1, Vt = null;
|
|
282
283
|
function rn(n, e) {
|
|
283
284
|
const t = je.get(n);
|
|
284
285
|
if (e !== null) {
|
|
@@ -287,11 +288,11 @@ function rn(n, e) {
|
|
|
287
288
|
}
|
|
288
289
|
if (le.has(n) || Q._keyToDOMMap.delete(n), v(t)) {
|
|
289
290
|
const r = on(t, je);
|
|
290
|
-
|
|
291
|
+
Hn(r, 0, r.length - 1, null);
|
|
291
292
|
}
|
|
292
293
|
t !== void 0 && wr(Tt, kt, pn, t, "destroyed");
|
|
293
294
|
}
|
|
294
|
-
function
|
|
295
|
+
function Hn(n, e, t, r) {
|
|
295
296
|
let i = e;
|
|
296
297
|
for (; i <= t; ++i) {
|
|
297
298
|
const s = n[i];
|
|
@@ -301,17 +302,17 @@ function Yn(n, e, t, r) {
|
|
|
301
302
|
function Le(n, e) {
|
|
302
303
|
n.setProperty("text-align", e);
|
|
303
304
|
}
|
|
304
|
-
const
|
|
305
|
-
function
|
|
305
|
+
const go = "40px";
|
|
306
|
+
function Ui(n, e) {
|
|
306
307
|
const t = Ae.theme.indent;
|
|
307
308
|
if (typeof t == "string") {
|
|
308
309
|
const i = n.classList.contains(t);
|
|
309
310
|
e > 0 && !i ? n.classList.add(t) : e < 1 && i && n.classList.remove(t);
|
|
310
311
|
}
|
|
311
|
-
const r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") ||
|
|
312
|
+
const r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") || go;
|
|
312
313
|
n.style.setProperty("padding-inline-start", e === 0 ? "" : `calc(${e} * ${r})`);
|
|
313
314
|
}
|
|
314
|
-
function
|
|
315
|
+
function Vi(n, e) {
|
|
315
316
|
const t = n.style;
|
|
316
317
|
e === 0 ? Le(t, "") : e === lr ? Le(t, "left") : e === ar ? Le(t, "center") : e === cr ? Le(t, "right") : e === ur ? Le(t, "justify") : e === fr ? Le(t, "start") : e === dr && Le(t, "end");
|
|
317
318
|
}
|
|
@@ -325,9 +326,9 @@ function sn(n, e) {
|
|
|
325
326
|
const d = `__lexicalKey_${c._key}`;
|
|
326
327
|
a[d] = u;
|
|
327
328
|
})(s, o, i), l.set(i, s);
|
|
328
|
-
}(n, r, Q), M(t) ? r.setAttribute("data-lexical-text", "true") :
|
|
329
|
+
}(n, r, Q), M(t) ? r.setAttribute("data-lexical-text", "true") : K(t) && r.setAttribute("data-lexical-decorator", "true"), v(t)) {
|
|
329
330
|
const i = t.__indent, s = t.__size;
|
|
330
|
-
if (i !== 0 &&
|
|
331
|
+
if (i !== 0 && Ui(r, i), s !== 0) {
|
|
331
332
|
const l = s - 1;
|
|
332
333
|
(function(a, c, u, d) {
|
|
333
334
|
const f = X;
|
|
@@ -335,12 +336,12 @@ function sn(n, e) {
|
|
|
335
336
|
})(on(t, le), l, t, r);
|
|
336
337
|
}
|
|
337
338
|
const o = t.__format;
|
|
338
|
-
o !== 0 &&
|
|
339
|
+
o !== 0 && Vi(r, o), t.isInline() || Yi(null, t, r), Tn(t) && (J += ve, Ce += ve);
|
|
339
340
|
} else {
|
|
340
341
|
const i = t.getTextContent();
|
|
341
|
-
if (
|
|
342
|
+
if (K(t)) {
|
|
342
343
|
const s = t.decorate(Q, Ae);
|
|
343
|
-
s !== null &&
|
|
344
|
+
s !== null && qi(n, s), r.contentEditable = "false";
|
|
344
345
|
} else M(t) && (t.isDirectionless() || (X += i));
|
|
345
346
|
J += i, Ce += i;
|
|
346
347
|
}
|
|
@@ -357,26 +358,26 @@ function qn(n, e, t, r, i) {
|
|
|
357
358
|
}
|
|
358
359
|
Tn(e) && (J += ve), i.element.__lexicalTextContent = J, J = s + J;
|
|
359
360
|
}
|
|
360
|
-
function
|
|
361
|
+
function Yr(n, e) {
|
|
361
362
|
if (n) {
|
|
362
363
|
const t = n.__last;
|
|
363
364
|
if (t) {
|
|
364
365
|
const r = e.get(t);
|
|
365
|
-
if (r) return tt(r) ? "line-break" :
|
|
366
|
+
if (r) return tt(r) ? "line-break" : K(r) && r.isInline() ? "decorator" : null;
|
|
366
367
|
}
|
|
367
368
|
return "empty";
|
|
368
369
|
}
|
|
369
370
|
return null;
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
-
const r =
|
|
372
|
+
function Yi(n, e, t) {
|
|
373
|
+
const r = Yr(n, je), i = Yr(e, le);
|
|
373
374
|
r !== i && e.getDOMSlot(t).setManagedLineBreak(i);
|
|
374
375
|
}
|
|
375
376
|
function Hi(n, e) {
|
|
376
377
|
const t = e.__lexicalDirTextContent || "", r = e.__lexicalDir || "";
|
|
377
378
|
if (t !== X || r !== Vt) {
|
|
378
379
|
const i = X === "", s = i ? Vt : function(o) {
|
|
379
|
-
return
|
|
380
|
+
return eo.test(o) ? "rtl" : to.test(o) ? "ltr" : null;
|
|
380
381
|
}(X);
|
|
381
382
|
if (s !== r) {
|
|
382
383
|
const o = e.classList, l = Ae.theme;
|
|
@@ -404,7 +405,7 @@ function Hi(n, e) {
|
|
|
404
405
|
Vt = s, e.__lexicalDirTextContent = X, e.__lexicalDir = s;
|
|
405
406
|
}
|
|
406
407
|
}
|
|
407
|
-
function
|
|
408
|
+
function _o(n, e, t) {
|
|
408
409
|
const r = X;
|
|
409
410
|
var i;
|
|
410
411
|
X = "", ce = null, ue = "", function(s, o, l) {
|
|
@@ -435,31 +436,31 @@ function go(n, e, t) {
|
|
|
435
436
|
else if (u === 0) {
|
|
436
437
|
if (c !== 0) {
|
|
437
438
|
const h = l.after == null && l.before == null && l.element.__lexicalLineBreak == null;
|
|
438
|
-
|
|
439
|
+
Hn(f, 0, c - 1, h ? null : d), h && (d.textContent = "");
|
|
439
440
|
}
|
|
440
441
|
} else (function(h, _, p, x, y, m) {
|
|
441
442
|
const N = x - 1, b = y - 1;
|
|
442
443
|
let C, w, k = m.getFirstChild(), S = 0, O = 0;
|
|
443
444
|
for (; S <= N && O <= b; ) {
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
445
|
+
const z = _[S], P = p[O];
|
|
446
|
+
if (z === P) k = On(pt(P, m.element)), S++, O++;
|
|
446
447
|
else {
|
|
447
448
|
C === void 0 && (C = new Set(_)), w === void 0 && (w = new Set(p));
|
|
448
|
-
const q = w.has(
|
|
449
|
+
const q = w.has(z), se = C.has(P);
|
|
449
450
|
if (q) if (se) {
|
|
450
451
|
const _e = ot(Q, P);
|
|
451
452
|
_e === k ? k = On(pt(P, m.element)) : (m.withBefore(k).insertChild(_e), pt(P, m.element)), S++, O++;
|
|
452
453
|
} else sn(P, m.withBefore(k)), O++;
|
|
453
|
-
else k = On(Gn(
|
|
454
|
+
else k = On(Gn(z)), rn(z, m.element), S++;
|
|
454
455
|
}
|
|
455
456
|
const B = le.get(P);
|
|
456
457
|
B !== null && M(B) && (ce === null && (ce = B.getFormat()), ue === "" && (ue = B.getStyle()));
|
|
457
458
|
}
|
|
458
459
|
const F = S > N, W = O > b;
|
|
459
460
|
if (F && !W) {
|
|
460
|
-
const
|
|
461
|
+
const z = p[b + 1], P = z === void 0 ? null : Q.getElementByKey(z);
|
|
461
462
|
qn(p, h, O, b, m.withBefore(P));
|
|
462
|
-
} else W && !F &&
|
|
463
|
+
} else W && !F && Hn(_, S, N, m.element);
|
|
463
464
|
})(o, f, g, c, u, l);
|
|
464
465
|
}
|
|
465
466
|
Tn(o) && (J += ve), d.__lexicalTextContent = J, J = a + J;
|
|
@@ -480,7 +481,7 @@ function pt(n, e) {
|
|
|
480
481
|
const t = je.get(n);
|
|
481
482
|
let r = le.get(n);
|
|
482
483
|
t !== void 0 && r !== void 0 || T(61);
|
|
483
|
-
const i =
|
|
484
|
+
const i = $i || Vn.has(n) || Un.has(n), s = ot(Q, n);
|
|
484
485
|
if (t === r && !i) {
|
|
485
486
|
if (v(t)) {
|
|
486
487
|
const o = s.__lexicalTextContent;
|
|
@@ -499,14 +500,14 @@ function pt(n, e) {
|
|
|
499
500
|
}
|
|
500
501
|
if (v(t) && v(r)) {
|
|
501
502
|
const o = r.__indent;
|
|
502
|
-
o !== t.__indent &&
|
|
503
|
+
o !== t.__indent && Ui(s, o);
|
|
503
504
|
const l = r.__format;
|
|
504
|
-
l !== t.__format &&
|
|
505
|
+
l !== t.__format && Vi(s, l), i && (_o(t, r, s), ne(r) || r.isInline() || Yi(t, r, s)), Tn(r) && (J += ve, Ce += ve);
|
|
505
506
|
} else {
|
|
506
507
|
const o = r.getTextContent();
|
|
507
|
-
if (
|
|
508
|
+
if (K(r)) {
|
|
508
509
|
const l = r.decorate(Q, Ae);
|
|
509
|
-
l !== null &&
|
|
510
|
+
l !== null && qi(n, l);
|
|
510
511
|
} else M(r) && !r.isDirectionless() && (X += o);
|
|
511
512
|
J += o, Ce += o;
|
|
512
513
|
}
|
|
@@ -516,12 +517,12 @@ function pt(n, e) {
|
|
|
516
517
|
}
|
|
517
518
|
return s;
|
|
518
519
|
}
|
|
519
|
-
function
|
|
520
|
+
function qi(n, e) {
|
|
520
521
|
let t = Q._pendingDecorators;
|
|
521
522
|
const r = Q._decorators;
|
|
522
523
|
if (t === null) {
|
|
523
524
|
if (r[n] === e) return;
|
|
524
|
-
t =
|
|
525
|
+
t = As(Q);
|
|
525
526
|
}
|
|
526
527
|
t[n] = e;
|
|
527
528
|
}
|
|
@@ -529,64 +530,64 @@ function On(n) {
|
|
|
529
530
|
let e = n.nextSibling;
|
|
530
531
|
return e !== null && e === Q._blockCursorElement && (e = e.nextSibling), e;
|
|
531
532
|
}
|
|
532
|
-
function
|
|
533
|
-
J = "", Ce = "", X = "",
|
|
533
|
+
function po(n, e, t, r, i, s) {
|
|
534
|
+
J = "", Ce = "", X = "", $i = r === it, Vt = null, Q = t, Ae = t._config, kt = t._nodes, pn = Q._listeners.mutation, Un = i, Vn = s, je = n._nodeMap, le = e._nodeMap, Nt = e._readOnly, Yn = new Map(t._keyToDOMMap);
|
|
534
535
|
const o = /* @__PURE__ */ new Map();
|
|
535
|
-
return Tt = o, pt("root", null), Q = void 0, kt = void 0, Un = void 0, Vn = void 0, je = void 0, le = void 0, Ae = void 0,
|
|
536
|
+
return Tt = o, pt("root", null), Q = void 0, kt = void 0, Un = void 0, Vn = void 0, je = void 0, le = void 0, Ae = void 0, Yn = void 0, Tt = void 0, o;
|
|
536
537
|
}
|
|
537
538
|
function Gn(n) {
|
|
538
|
-
const e =
|
|
539
|
+
const e = Yn.get(n);
|
|
539
540
|
return e === void 0 && T(75, n), e;
|
|
540
541
|
}
|
|
541
542
|
function D(n) {
|
|
542
543
|
return { type: n };
|
|
543
544
|
}
|
|
544
|
-
const
|
|
545
|
-
if (mt = n.timeStamp,
|
|
545
|
+
const Gi = D("SELECTION_CHANGE_COMMAND"), Pl = D("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"), yo = D("CLICK_COMMAND"), ln = D("DELETE_CHARACTER_COMMAND"), Yt = D("INSERT_LINE_BREAK_COMMAND"), Hr = D("INSERT_PARAGRAPH_COMMAND"), yt = D("CONTROLLED_TEXT_INSERTION_COMMAND"), Xi = D("PASTE_COMMAND"), qr = D("REMOVE_TEXT_COMMAND"), an = D("DELETE_WORD_COMMAND"), cn = D("DELETE_LINE_COMMAND"), ze = D("FORMAT_TEXT_COMMAND"), Qi = D("UNDO_COMMAND"), Zi = D("REDO_COMMAND"), mo = D("KEYDOWN_COMMAND"), xo = D("KEY_ARROW_RIGHT_COMMAND"), Co = D("MOVE_TO_END"), So = D("KEY_ARROW_LEFT_COMMAND"), vo = D("MOVE_TO_START"), ko = D("KEY_ARROW_UP_COMMAND"), To = D("KEY_ARROW_DOWN_COMMAND"), Xn = D("KEY_ENTER_COMMAND"), No = D("KEY_SPACE_COMMAND"), bo = D("KEY_BACKSPACE_COMMAND"), wo = D("KEY_ESCAPE_COMMAND"), Eo = D("KEY_DELETE_COMMAND"), Mo = D("KEY_TAB_COMMAND"), Fl = D("INSERT_TAB_COMMAND"), Ll = D("INDENT_CONTENT_COMMAND"), Il = D("OUTDENT_CONTENT_COMMAND"), Oo = D("DROP_COMMAND"), zl = D("FORMAT_ELEMENT_COMMAND"), Ao = D("DRAGSTART_COMMAND"), Do = D("DRAGOVER_COMMAND"), Po = D("DRAGEND_COMMAND"), es = D("COPY_COMMAND"), ts = D("CUT_COMMAND"), Gr = D("SELECT_ALL_COMMAND"), Kl = D("CLEAR_EDITOR_COMMAND"), Bl = D("CLEAR_HISTORY_COMMAND"), Rl = D("CAN_REDO_COMMAND"), Wl = D("CAN_UNDO_COMMAND"), Fo = D("FOCUS_COMMAND"), Lo = D("BLUR_COMMAND"), Io = D("KEY_MODIFIER_COMMAND"), ye = Object.freeze({}), Qn = 30, Zn = [["keydown", function(n, e) {
|
|
546
|
+
if (mt = n.timeStamp, ns = n.key, !e.isComposing() && !E(e, mo, n) && n.key != null) {
|
|
546
547
|
if (An && Ni(n)) return te(e, () => {
|
|
547
548
|
Wt(e, Dn);
|
|
548
549
|
}), An = !1, void (Dn = "");
|
|
549
550
|
if (function(t) {
|
|
550
551
|
return I(t, "ArrowRight", { shiftKey: "any" });
|
|
551
|
-
}(n)) E(e,
|
|
552
|
+
}(n)) E(e, xo, n);
|
|
552
553
|
else if (function(t) {
|
|
553
554
|
return I(t, "ArrowRight", xe);
|
|
554
|
-
}(n)) E(e,
|
|
555
|
+
}(n)) E(e, Co, n);
|
|
555
556
|
else if (function(t) {
|
|
556
557
|
return I(t, "ArrowLeft", { shiftKey: "any" });
|
|
557
|
-
}(n)) E(e,
|
|
558
|
+
}(n)) E(e, So, n);
|
|
558
559
|
else if (function(t) {
|
|
559
560
|
return I(t, "ArrowLeft", xe);
|
|
560
|
-
}(n)) E(e,
|
|
561
|
+
}(n)) E(e, vo, n);
|
|
561
562
|
else if (function(t) {
|
|
562
563
|
return I(t, "ArrowUp", { altKey: "any", shiftKey: "any" });
|
|
563
|
-
}(n)) E(e,
|
|
564
|
+
}(n)) E(e, ko, n);
|
|
564
565
|
else if (function(t) {
|
|
565
566
|
return I(t, "ArrowDown", { altKey: "any", shiftKey: "any" });
|
|
566
|
-
}(n)) E(e,
|
|
567
|
+
}(n)) E(e, To, n);
|
|
567
568
|
else if (function(t) {
|
|
568
569
|
return I(t, "Enter", { altKey: "any", ctrlKey: "any", metaKey: "any", shiftKey: !0 });
|
|
569
570
|
}(n)) xt = !0, E(e, Xn, n);
|
|
570
571
|
else if (function(t) {
|
|
571
572
|
return t.key === " ";
|
|
572
|
-
}(n)) E(e,
|
|
573
|
+
}(n)) E(e, No, n);
|
|
573
574
|
else if (function(t) {
|
|
574
575
|
return fe && I(t, "o", { ctrlKey: !0 });
|
|
575
|
-
}(n)) n.preventDefault(), xt = !0, E(e,
|
|
576
|
+
}(n)) n.preventDefault(), xt = !0, E(e, Yt, !0);
|
|
576
577
|
else if (function(t) {
|
|
577
578
|
return I(t, "Enter", { altKey: "any", ctrlKey: "any", metaKey: "any" });
|
|
578
579
|
}(n)) xt = !1, E(e, Xn, n);
|
|
579
580
|
else if (function(t) {
|
|
580
581
|
return I(t, "Backspace", { shiftKey: "any" }) || fe && I(t, "h", { ctrlKey: !0 });
|
|
581
|
-
}(n)) Ni(n) ? E(e,
|
|
582
|
+
}(n)) Ni(n) ? E(e, bo, n) : (n.preventDefault(), E(e, ln, !0));
|
|
582
583
|
else if (function(t) {
|
|
583
584
|
return t.key === "Escape";
|
|
584
|
-
}(n)) E(e,
|
|
585
|
+
}(n)) E(e, wo, n);
|
|
585
586
|
else if (function(t) {
|
|
586
587
|
return I(t, "Delete", {}) || fe && I(t, "d", { ctrlKey: !0 });
|
|
587
588
|
}(n)) (function(t) {
|
|
588
589
|
return t.key === "Delete";
|
|
589
|
-
})(n) ? E(e,
|
|
590
|
+
})(n) ? E(e, Eo, n) : (n.preventDefault(), E(e, ln, !1));
|
|
590
591
|
else if (function(t) {
|
|
591
592
|
return I(t, "Backspace", Ti);
|
|
592
593
|
}(n)) n.preventDefault(), E(e, an, !0);
|
|
@@ -601,33 +602,33 @@ const qi = D("SELECTION_CHANGE_COMMAND"), Dl = D("SELECTION_INSERT_CLIPBOARD_NOD
|
|
|
601
602
|
}(n)) n.preventDefault(), E(e, cn, !1);
|
|
602
603
|
else if (function(t) {
|
|
603
604
|
return I(t, "b", xe);
|
|
604
|
-
}(n)) n.preventDefault(), E(e,
|
|
605
|
+
}(n)) n.preventDefault(), E(e, ze, "bold");
|
|
605
606
|
else if (function(t) {
|
|
606
607
|
return I(t, "u", xe);
|
|
607
|
-
}(n)) n.preventDefault(), E(e,
|
|
608
|
+
}(n)) n.preventDefault(), E(e, ze, "underline");
|
|
608
609
|
else if (function(t) {
|
|
609
610
|
return I(t, "i", xe);
|
|
610
|
-
}(n)) n.preventDefault(), E(e,
|
|
611
|
+
}(n)) n.preventDefault(), E(e, ze, "italic");
|
|
611
612
|
else if (function(t) {
|
|
612
613
|
return I(t, "Tab", { shiftKey: "any" });
|
|
613
|
-
}(n)) E(e,
|
|
614
|
+
}(n)) E(e, Mo, n);
|
|
614
615
|
else if (function(t) {
|
|
615
616
|
return I(t, "z", xe);
|
|
616
|
-
}(n)) n.preventDefault(), E(e,
|
|
617
|
+
}(n)) n.preventDefault(), E(e, Qi, void 0);
|
|
617
618
|
else if (function(t) {
|
|
618
619
|
return fe ? I(t, "z", { metaKey: !0, shiftKey: !0 }) : I(t, "y", { ctrlKey: !0 }) || I(t, "z", { ctrlKey: !0, shiftKey: !0 });
|
|
619
|
-
}(n)) n.preventDefault(), E(e,
|
|
620
|
+
}(n)) n.preventDefault(), E(e, Zi, void 0);
|
|
620
621
|
else {
|
|
621
622
|
const t = e._editorState._selection;
|
|
622
623
|
t === null || A(t) ? bi(n) && (n.preventDefault(), E(e, Gr, n)) : function(r) {
|
|
623
624
|
return I(r, "c", xe);
|
|
624
|
-
}(n) ? (n.preventDefault(), E(e,
|
|
625
|
+
}(n) ? (n.preventDefault(), E(e, es, n)) : function(r) {
|
|
625
626
|
return I(r, "x", xe);
|
|
626
|
-
}(n) ? (n.preventDefault(), E(e,
|
|
627
|
+
}(n) ? (n.preventDefault(), E(e, ts, n)) : bi(n) && (n.preventDefault(), E(e, Gr, n));
|
|
627
628
|
}
|
|
628
629
|
(function(t) {
|
|
629
630
|
return t.ctrlKey || t.shiftKey || t.altKey || t.metaKey;
|
|
630
|
-
})(n) && E(e,
|
|
631
|
+
})(n) && E(e, Io, n);
|
|
631
632
|
}
|
|
632
633
|
}], ["pointerdown", function(n, e) {
|
|
633
634
|
const t = n.target, r = n.pointerType;
|
|
@@ -639,7 +640,7 @@ const qi = D("SELECTION_CHANGE_COMMAND"), Dl = D("SELECTION_INSERT_CLIPBOARD_NOD
|
|
|
639
640
|
const t = L();
|
|
640
641
|
if (A(t) && !e.isComposing()) {
|
|
641
642
|
const r = t.anchor, i = t.anchor.getNode();
|
|
642
|
-
|
|
643
|
+
Y(r.key), (n.timeStamp < mt + Qn || r.type === "element" || !t.isCollapsed() || i.getFormat() !== t.format || M(i) && i.getStyle() !== t.style) && E(e, yt, Zs);
|
|
643
644
|
}
|
|
644
645
|
});
|
|
645
646
|
}], ["compositionend", function(n, e) {
|
|
@@ -649,15 +650,15 @@ const qi = D("SELECTION_CHANGE_COMMAND"), Dl = D("SELECTION_INSERT_CLIPBOARD_NOD
|
|
|
649
650
|
}], ["input", function(n, e) {
|
|
650
651
|
n.stopPropagation(), te(e, () => {
|
|
651
652
|
if (ee(n.target) && Si(n.target)) return;
|
|
652
|
-
const t = L(), r = n.data, i =
|
|
653
|
-
if (r != null && A(t) &&
|
|
653
|
+
const t = L(), r = n.data, i = ls(n);
|
|
654
|
+
if (r != null && A(t) && ss(t, i, r, n.timeStamp, !1)) {
|
|
654
655
|
gt && (Wt(e, r), gt = !1);
|
|
655
656
|
const s = t.anchor.getNode(), o = ke(oe(e));
|
|
656
657
|
if (o === null) return;
|
|
657
658
|
const l = t.isBackward(), a = l ? t.anchor.offset : t.focus.offset, c = l ? t.focus.offset : t.anchor.offset;
|
|
658
|
-
Qt && !t.isCollapsed() && M(s) && o.anchorNode !== null && s.getTextContent().slice(0, a) + r + s.getTextContent().slice(a + c) ===
|
|
659
|
+
Qt && !t.isCollapsed() && M(s) && o.anchorNode !== null && s.getTextContent().slice(0, a) + r + s.getTextContent().slice(a + c) === Ls(o.anchorNode) || E(e, yt, r);
|
|
659
660
|
const u = r.length;
|
|
660
|
-
Re && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), vt || rt || Zt || !e.isComposing() || (mt = 0,
|
|
661
|
+
Re && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), vt || rt || Zt || !e.isComposing() || (mt = 0, Y(null));
|
|
661
662
|
} else
|
|
662
663
|
Nr(!1, e, r !== null ? r : void 0), gt && (Wt(e, r || void 0), gt = !1);
|
|
663
664
|
(function() {
|
|
@@ -689,12 +690,12 @@ const qi = D("SELECTION_CHANGE_COMMAND"), Dl = D("SELECTION_INSERT_CLIPBOARD_NOD
|
|
|
689
690
|
(ee(s) || Te(s)) && ie(mn(i, r, e, n));
|
|
690
691
|
}
|
|
691
692
|
}
|
|
692
|
-
E(e,
|
|
693
|
+
E(e, yo, n);
|
|
693
694
|
});
|
|
694
695
|
}], ["cut", ye], ["copy", ye], ["dragstart", ye], ["dragover", ye], ["dragend", ye], ["paste", ye], ["focus", ye], ["blur", ye], ["drop", ye]];
|
|
695
696
|
Qt && Zn.push(["beforeinput", (n, e) => function(t, r) {
|
|
696
|
-
const i = t.inputType, s =
|
|
697
|
-
i === "deleteCompositionText" || Re &&
|
|
697
|
+
const i = t.inputType, s = ls(t);
|
|
698
|
+
i === "deleteCompositionText" || Re && Is(r) || i !== "insertCompositionText" && te(r, () => {
|
|
698
699
|
const o = L();
|
|
699
700
|
if (i === "deleteContentBackward") {
|
|
700
701
|
if (o === null) {
|
|
@@ -704,20 +705,20 @@ Qt && Zn.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
704
705
|
}
|
|
705
706
|
if (A(o)) {
|
|
706
707
|
const g = o.anchor.key === o.focus.key;
|
|
707
|
-
if (l = t.timeStamp,
|
|
708
|
-
if (
|
|
708
|
+
if (l = t.timeStamp, ns === "MediaLast" && l < mt + Qn && r.isComposing() && g) {
|
|
709
|
+
if (Y(null), mt = 0, setTimeout(() => {
|
|
709
710
|
te(r, () => {
|
|
710
|
-
|
|
711
|
+
Y(null);
|
|
711
712
|
});
|
|
712
713
|
}, Qn), A(o)) {
|
|
713
714
|
const h = o.anchor.getNode();
|
|
714
|
-
h.markDirty(), M(h) || T(142),
|
|
715
|
+
h.markDirty(), M(h) || T(142), os(o, h);
|
|
715
716
|
}
|
|
716
717
|
} else {
|
|
717
|
-
|
|
718
|
+
Y(null), t.preventDefault();
|
|
718
719
|
const h = o.anchor.getNode(), _ = h.getTextContent(), p = h.canInsertTextAfter(), x = o.anchor.offset === 0 && o.focus.offset === _.length;
|
|
719
720
|
let y = Ir && g && !x && p;
|
|
720
|
-
if (y && o.isCollapsed() && (y = !
|
|
721
|
+
if (y && o.isCollapsed() && (y = !K(sl(o.anchor, !0))), !y) {
|
|
721
722
|
E(r, ln, !0);
|
|
722
723
|
const m = L();
|
|
723
724
|
Ir && A(m) && m.isCollapsed() && (Ie = m, setTimeout(() => Ie = null));
|
|
@@ -738,21 +739,21 @@ Qt && Zn.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
738
739
|
E(r, yt, t);
|
|
739
740
|
break;
|
|
740
741
|
case "insertFromComposition":
|
|
741
|
-
|
|
742
|
+
Y(null), E(r, yt, t);
|
|
742
743
|
break;
|
|
743
744
|
case "insertLineBreak":
|
|
744
|
-
|
|
745
|
+
Y(null), E(r, Yt, !1);
|
|
745
746
|
break;
|
|
746
747
|
case "insertParagraph":
|
|
747
|
-
|
|
748
|
+
Y(null), xt && !rt ? (xt = !1, E(r, Yt, !1)) : E(r, Hr, void 0);
|
|
748
749
|
break;
|
|
749
750
|
case "insertFromPaste":
|
|
750
751
|
case "insertFromPasteAsQuotation":
|
|
751
|
-
E(r,
|
|
752
|
+
E(r, Xi, t);
|
|
752
753
|
break;
|
|
753
754
|
case "deleteByComposition":
|
|
754
755
|
(function(g, h) {
|
|
755
|
-
return g !== h || v(g) || v(h) || !
|
|
756
|
+
return g !== h || v(g) || v(h) || !Ke(g) || !Ke(h);
|
|
756
757
|
})(d, f) && E(r, qr, t);
|
|
757
758
|
break;
|
|
758
759
|
case "deleteByDrag":
|
|
@@ -778,44 +779,44 @@ Qt && Zn.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
778
779
|
E(r, cn, !1);
|
|
779
780
|
break;
|
|
780
781
|
case "formatStrikeThrough":
|
|
781
|
-
E(r,
|
|
782
|
+
E(r, ze, "strikethrough");
|
|
782
783
|
break;
|
|
783
784
|
case "formatBold":
|
|
784
|
-
E(r,
|
|
785
|
+
E(r, ze, "bold");
|
|
785
786
|
break;
|
|
786
787
|
case "formatItalic":
|
|
787
|
-
E(r,
|
|
788
|
+
E(r, ze, "italic");
|
|
788
789
|
break;
|
|
789
790
|
case "formatUnderline":
|
|
790
|
-
E(r,
|
|
791
|
+
E(r, ze, "underline");
|
|
791
792
|
break;
|
|
792
793
|
case "historyUndo":
|
|
793
|
-
E(r,
|
|
794
|
+
E(r, Qi, void 0);
|
|
794
795
|
break;
|
|
795
796
|
case "historyRedo":
|
|
796
|
-
E(r,
|
|
797
|
+
E(r, Zi, void 0);
|
|
797
798
|
}
|
|
798
799
|
else {
|
|
799
800
|
if (a === `
|
|
800
|
-
`) t.preventDefault(), E(r,
|
|
801
|
-
else if (a === ve) t.preventDefault(), E(r,
|
|
801
|
+
`) t.preventDefault(), E(r, Yt, !1);
|
|
802
|
+
else if (a === ve) t.preventDefault(), E(r, Hr, void 0);
|
|
802
803
|
else if (a == null && t.dataTransfer) {
|
|
803
804
|
const g = t.dataTransfer.getData("text/plain");
|
|
804
805
|
t.preventDefault(), o.insertRawText(g);
|
|
805
|
-
} else a != null &&
|
|
806
|
-
|
|
806
|
+
} else a != null && ss(o, s, a, t.timeStamp, !0) ? (t.preventDefault(), E(r, yt, a)) : Qe = a;
|
|
807
|
+
rs = t.timeStamp;
|
|
807
808
|
}
|
|
808
809
|
});
|
|
809
810
|
}(n, e)]);
|
|
810
|
-
let mt = 0,
|
|
811
|
+
let mt = 0, ns = null, rs = 0, Qe = null;
|
|
811
812
|
const un = /* @__PURE__ */ new WeakMap();
|
|
812
|
-
let er = !1, tr = !1, xt = !1, gt = !1, An = !1, Dn = "", Ie = null,
|
|
813
|
-
function
|
|
813
|
+
let er = !1, tr = !1, xt = !1, gt = !1, An = !1, Dn = "", Ie = null, is = [0, "", 0, "root", 0];
|
|
814
|
+
function ss(n, e, t, r, i) {
|
|
814
815
|
const s = n.anchor, o = n.focus, l = s.getNode(), a = R(), c = ke(oe(a)), u = c !== null ? c.anchorNode : null, d = s.key, f = a.getElementByKey(d), g = t.length;
|
|
815
|
-
return d !== o.key || !M(l) || (!i && (!Qt ||
|
|
816
|
+
return d !== o.key || !M(l) || (!i && (!Qt || rs < r + 50) || l.isDirty() && g < 2 || Ps(t)) && s.offset !== o.offset && !l.isComposing() || be(l) || l.isDirty() && g > 1 || (i || !Qt) && f !== null && !l.isComposing() && u !== st(f) || c !== null && e !== null && (!e.collapsed || e.startContainer !== c.anchorNode || e.startOffset !== c.anchorOffset) || l.getFormat() !== n.format || l.getStyle() !== n.style || function(h, _) {
|
|
816
817
|
if (_.isSegmented()) return !0;
|
|
817
818
|
if (!h.isCollapsed()) return !1;
|
|
818
|
-
const p = h.anchor.offset, x = _.getParentOrThrow(), y =
|
|
819
|
+
const p = h.anchor.offset, x = _.getParentOrThrow(), y = Ke(_);
|
|
819
820
|
return p === 0 ? !_.canInsertTextBefore() || !x.canInsertTextBefore() && !_.isComposing() || y || function(m) {
|
|
820
821
|
const N = m.getPreviousSibling();
|
|
821
822
|
return (M(N) || v(N) && N.isInline()) && !N.canInsertTextAfter();
|
|
@@ -839,20 +840,20 @@ function Qr(n, e, t) {
|
|
|
839
840
|
const a = l.anchor, c = a.getNode();
|
|
840
841
|
if (l.isCollapsed()) {
|
|
841
842
|
n.type === "Range" && n.anchorNode === n.focusNode && (l.dirty = !0);
|
|
842
|
-
const u = oe(e).event, d = u ? u.timeStamp : performance.now(), [f, g, h, _, p] =
|
|
843
|
-
if (d < p + 200 && a.offset === h && a.key === _)
|
|
844
|
-
else if (a.type === "text") M(c) || T(141),
|
|
843
|
+
const u = oe(e).event, d = u ? u.timeStamp : performance.now(), [f, g, h, _, p] = is, x = re(), y = e.isComposing() === !1 && x.getTextContent() === "";
|
|
844
|
+
if (d < p + 200 && a.offset === h && a.key === _) Ht(l, f, g);
|
|
845
|
+
else if (a.type === "text") M(c) || T(141), os(l, c);
|
|
845
846
|
else if (a.type === "element" && !y) {
|
|
846
847
|
v(c) || T(259);
|
|
847
848
|
const m = a.getNode();
|
|
848
849
|
m.isEmpty() ? function(N, b) {
|
|
849
850
|
const C = b.getTextFormat(), w = b.getTextStyle();
|
|
850
|
-
|
|
851
|
-
}(l, m) :
|
|
851
|
+
Ht(N, C, w);
|
|
852
|
+
}(l, m) : Ht(l, 0, "");
|
|
852
853
|
}
|
|
853
854
|
} else {
|
|
854
855
|
const u = a.key, d = l.focus.key, f = l.getNodes(), g = f.length, h = l.isBackward(), _ = h ? o : i, p = h ? i : o, x = h ? d : u, y = h ? u : d;
|
|
855
|
-
let m =
|
|
856
|
+
let m = Qs, N = !1;
|
|
856
857
|
for (let b = 0; b < g; b++) {
|
|
857
858
|
const C = f[b], w = C.getTextContentSize();
|
|
858
859
|
if (M(C) && w !== 0 && !(b === 0 && C.__key === x && _ === w || b === g - 1 && C.__key === y && p === 0) && (N = !0, m &= C.getFormat(), m === 0)) break;
|
|
@@ -860,23 +861,23 @@ function Qr(n, e, t) {
|
|
|
860
861
|
l.format = N ? m : 0;
|
|
861
862
|
}
|
|
862
863
|
}
|
|
863
|
-
E(e,
|
|
864
|
+
E(e, Gi, void 0);
|
|
864
865
|
});
|
|
865
866
|
}
|
|
866
|
-
function
|
|
867
|
+
function Ht(n, e, t) {
|
|
867
868
|
n.format === e && n.style === t || (n.format = e, n.style = t, n.dirty = !0);
|
|
868
869
|
}
|
|
869
|
-
function
|
|
870
|
-
|
|
870
|
+
function os(n, e) {
|
|
871
|
+
Ht(n, e.getFormat(), e.getStyle());
|
|
871
872
|
}
|
|
872
|
-
function
|
|
873
|
+
function ls(n) {
|
|
873
874
|
if (!n.getTargetRanges) return null;
|
|
874
875
|
const e = n.getTargetRanges();
|
|
875
876
|
return e.length === 0 ? null : e[0];
|
|
876
877
|
}
|
|
877
878
|
function Wt(n, e) {
|
|
878
879
|
const t = n._compositionKey;
|
|
879
|
-
if (
|
|
880
|
+
if (Y(null), t !== null && e != null) {
|
|
880
881
|
if (e === "") {
|
|
881
882
|
const r = U(t), i = st(n.getElementByKey(t));
|
|
882
883
|
return void (i !== null && i.nodeValue !== null && M(r) && br(r, i.nodeValue, null, null, !0));
|
|
@@ -892,15 +893,15 @@ function Wt(n, e) {
|
|
|
892
893
|
}
|
|
893
894
|
Nr(!0, n, e);
|
|
894
895
|
}
|
|
895
|
-
function
|
|
896
|
+
function as(n) {
|
|
896
897
|
let e = n.__lexicalEventHandles;
|
|
897
898
|
return e === void 0 && (e = [], n.__lexicalEventHandles = e), e;
|
|
898
899
|
}
|
|
899
900
|
const et = /* @__PURE__ */ new Map();
|
|
900
|
-
function
|
|
901
|
-
const e =
|
|
901
|
+
function cs(n) {
|
|
902
|
+
const e = fl(n.target);
|
|
902
903
|
if (e === null) return;
|
|
903
|
-
const t =
|
|
904
|
+
const t = Es(e.anchorNode);
|
|
904
905
|
if (t === null) return;
|
|
905
906
|
tr && (tr = !1, te(t, () => {
|
|
906
907
|
const a = ft(), c = e.anchorNode;
|
|
@@ -915,11 +916,11 @@ function Zr(n) {
|
|
|
915
916
|
function ei(n) {
|
|
916
917
|
return n._lexicalHandled === !0;
|
|
917
918
|
}
|
|
918
|
-
function
|
|
919
|
+
function zo(n) {
|
|
919
920
|
const e = n.ownerDocument, t = un.get(e);
|
|
920
921
|
if (t === void 0) return;
|
|
921
922
|
const r = t - 1;
|
|
922
|
-
r >= 0 || T(164), un.set(e, r), r === 0 && e.removeEventListener("selectionchange",
|
|
923
|
+
r >= 0 || T(164), un.set(e, r), r === 0 && e.removeEventListener("selectionchange", cs);
|
|
923
924
|
const i = vn(n);
|
|
924
925
|
vr(i) ? (function(o) {
|
|
925
926
|
if (o._parentEditor !== null) {
|
|
@@ -927,7 +928,7 @@ function Io(n) {
|
|
|
927
928
|
et.get(a) === o && et.delete(a);
|
|
928
929
|
} else et.delete(o._key);
|
|
929
930
|
}(i), n.__lexicalEditor = null) : i && T(198);
|
|
930
|
-
const s =
|
|
931
|
+
const s = as(n);
|
|
931
932
|
for (let o = 0; o < s.length; o++) s[o]();
|
|
932
933
|
n.__lexicalEventHandles = [];
|
|
933
934
|
}
|
|
@@ -952,7 +953,7 @@ function nr(n, e, t) {
|
|
|
952
953
|
} else Be(n);
|
|
953
954
|
t || Fe(i) || i.canBeEmpty() || !i.isEmpty() || nr(i, e), e && s && ne(i) && i.isEmpty() && i.selectEnd();
|
|
954
955
|
}
|
|
955
|
-
function
|
|
956
|
+
function Jl(n) {
|
|
956
957
|
return n;
|
|
957
958
|
}
|
|
958
959
|
class ct {
|
|
@@ -974,7 +975,7 @@ class ct {
|
|
|
974
975
|
this.__key === e.__key ? (this.__parent = e.__parent, this.__next = e.__next, this.__prev = e.__prev, this.__state = e.__state) : e.__state && (this.__state = e.__state.getWritable(this));
|
|
975
976
|
}
|
|
976
977
|
constructor(e) {
|
|
977
|
-
this.__type = this.constructor.getType(), this.__parent = null, this.__prev = null, this.__next = null, Object.defineProperty(this, "__state", { configurable: !0, enumerable: !1, value: void 0, writable: !0 }),
|
|
978
|
+
this.__type = this.constructor.getType(), this.__parent = null, this.__prev = null, this.__next = null, Object.defineProperty(this, "__state", { configurable: !0, enumerable: !1, value: void 0, writable: !0 }), Ms(this, e);
|
|
978
979
|
}
|
|
979
980
|
getType() {
|
|
980
981
|
return this.__type;
|
|
@@ -1000,7 +1001,7 @@ class ct {
|
|
|
1000
1001
|
if (A(t) && t.anchor.type === "element" && t.focus.type === "element") {
|
|
1001
1002
|
if (t.isCollapsed()) return !1;
|
|
1002
1003
|
const i = this.getParent();
|
|
1003
|
-
if (
|
|
1004
|
+
if (K(this) && this.isInline() && i) {
|
|
1004
1005
|
const s = t.isBackward() ? t.focus : t.anchor;
|
|
1005
1006
|
if (i.is(s.getNode()) && s.offset === i.getChildrenSize() && this.is(i.getLastChild())) return !1;
|
|
1006
1007
|
}
|
|
@@ -1032,7 +1033,7 @@ class ct {
|
|
|
1032
1033
|
let e = this;
|
|
1033
1034
|
for (; e !== null; ) {
|
|
1034
1035
|
const t = e.getParent();
|
|
1035
|
-
if (Fe(t)) return v(e) || e === this &&
|
|
1036
|
+
if (Fe(t)) return v(e) || e === this && K(e) || T(194), e;
|
|
1036
1037
|
e = t;
|
|
1037
1038
|
}
|
|
1038
1039
|
return null;
|
|
@@ -1083,7 +1084,7 @@ class ct {
|
|
|
1083
1084
|
}
|
|
1084
1085
|
isBefore(e) {
|
|
1085
1086
|
const t = Gt(this, e);
|
|
1086
|
-
return t !== null && (t.type === "descendant" || (t.type === "branch" ?
|
|
1087
|
+
return t !== null && (t.type === "descendant" || (t.type === "branch" ? Ws(t) === -1 : (t.type !== "same" && t.type !== "ancestor" && T(279), !1)));
|
|
1087
1088
|
}
|
|
1088
1089
|
isParentOf(e) {
|
|
1089
1090
|
const t = Gt(this, e);
|
|
@@ -1128,7 +1129,7 @@ class ct {
|
|
|
1128
1129
|
G();
|
|
1129
1130
|
const e = Pe(), t = R(), r = e._nodeMap, i = this.__key, s = this.getLatest(), o = t._cloneNotNeeded, l = L();
|
|
1130
1131
|
if (l !== null && l.setCachedNodes(null), o.has(i)) return gn(s), s;
|
|
1131
|
-
const a =
|
|
1132
|
+
const a = pl(s);
|
|
1132
1133
|
return o.add(i), gn(a), r.set(i, a), a;
|
|
1133
1134
|
}
|
|
1134
1135
|
getTextContent() {
|
|
@@ -1155,9 +1156,11 @@ class ct {
|
|
|
1155
1156
|
}
|
|
1156
1157
|
updateFromJSON(e) {
|
|
1157
1158
|
return function(t, r) {
|
|
1158
|
-
const i = t.getWritable()
|
|
1159
|
-
|
|
1160
|
-
|
|
1159
|
+
const i = t.getWritable(), s = r.$;
|
|
1160
|
+
let o = s;
|
|
1161
|
+
for (const l of ji(i).flatKeys) l in r && (o !== void 0 && o !== s || (o = { ...s }), o[l] = r[l]);
|
|
1162
|
+
return (i.__state || o) && ho(t).updateFromJSON(o), i;
|
|
1163
|
+
}(this, e);
|
|
1161
1164
|
}
|
|
1162
1165
|
static transform() {
|
|
1163
1166
|
return null;
|
|
@@ -1179,7 +1182,7 @@ class ct {
|
|
|
1179
1182
|
const _ = r.anchor, p = r.focus;
|
|
1180
1183
|
_.key === s && ii(_, l), p.key === s && ii(p, l);
|
|
1181
1184
|
}
|
|
1182
|
-
return Ee() === s &&
|
|
1185
|
+
return Ee() === s && Y(o), l;
|
|
1183
1186
|
}
|
|
1184
1187
|
insertAfter(e, t = !0) {
|
|
1185
1188
|
G(), Bn(this, e);
|
|
@@ -1318,7 +1321,7 @@ function Pn(n, e) {
|
|
|
1318
1321
|
function Fn(n, e) {
|
|
1319
1322
|
return 1 & e ? "strong" : 2 & e ? "em" : "span";
|
|
1320
1323
|
}
|
|
1321
|
-
function
|
|
1324
|
+
function us(n, e, t, r, i) {
|
|
1322
1325
|
const s = r.classList;
|
|
1323
1326
|
let o = nt(i, "base");
|
|
1324
1327
|
o !== void 0 && s.add(...o), o = nt(i, "underlineStrikethrough");
|
|
@@ -1336,7 +1339,7 @@ function cs(n, e, t, r, i) {
|
|
|
1336
1339
|
} else e & u && s.remove(...o);
|
|
1337
1340
|
}
|
|
1338
1341
|
}
|
|
1339
|
-
function
|
|
1342
|
+
function fs(n, e, t) {
|
|
1340
1343
|
const r = e.firstChild, i = t.isComposing(), s = n + (i ? _n : "");
|
|
1341
1344
|
if (r == null) e.textContent = s;
|
|
1342
1345
|
else {
|
|
@@ -1354,9 +1357,9 @@ function us(n, e, t) {
|
|
|
1354
1357
|
}
|
|
1355
1358
|
}
|
|
1356
1359
|
function ti(n, e, t, r, i, s) {
|
|
1357
|
-
|
|
1360
|
+
fs(i, n, e);
|
|
1358
1361
|
const o = s.theme.text;
|
|
1359
|
-
o !== void 0 &&
|
|
1362
|
+
o !== void 0 && us(0, 0, r, n, o);
|
|
1360
1363
|
}
|
|
1361
1364
|
function jt(n, e) {
|
|
1362
1365
|
const t = document.createElement(e);
|
|
@@ -1383,7 +1386,7 @@ class ut extends ct {
|
|
|
1383
1386
|
}
|
|
1384
1387
|
getMode() {
|
|
1385
1388
|
const e = this.getLatest();
|
|
1386
|
-
return
|
|
1389
|
+
return so[e.__mode];
|
|
1387
1390
|
}
|
|
1388
1391
|
getStyle() {
|
|
1389
1392
|
return this.getLatest().__style;
|
|
@@ -1439,14 +1442,14 @@ class ut extends ct {
|
|
|
1439
1442
|
return ti(p, this, 0, o, i, r), t.replaceChild(p, _), !1;
|
|
1440
1443
|
}
|
|
1441
1444
|
let d = t;
|
|
1442
|
-
a !== null && l !== null && (d = t.firstChild, d == null && T(49)),
|
|
1445
|
+
a !== null && l !== null && (d = t.firstChild, d == null && T(49)), fs(i, d, this);
|
|
1443
1446
|
const f = r.theme.text;
|
|
1444
|
-
f !== void 0 && s !== o &&
|
|
1447
|
+
f !== void 0 && s !== o && us(0, s, o, d, f);
|
|
1445
1448
|
const g = e.__style, h = this.__style;
|
|
1446
1449
|
return g !== h && (t.style.cssText = h), !1;
|
|
1447
1450
|
}
|
|
1448
1451
|
static importDOM() {
|
|
1449
|
-
return { "#text": () => ({ conversion:
|
|
1452
|
+
return { "#text": () => ({ conversion: Jo, priority: 0 }), b: () => ({ conversion: Ro, priority: 0 }), code: () => ({ conversion: me, priority: 0 }), em: () => ({ conversion: me, priority: 0 }), i: () => ({ conversion: me, priority: 0 }), mark: () => ({ conversion: me, priority: 0 }), s: () => ({ conversion: me, priority: 0 }), span: () => ({ conversion: Bo, priority: 0 }), strong: () => ({ conversion: me, priority: 0 }), sub: () => ({ conversion: me, priority: 0 }), sup: () => ({ conversion: me, priority: 0 }), u: () => ({ conversion: me, priority: 0 }) };
|
|
1450
1453
|
}
|
|
1451
1454
|
static importJSON(e) {
|
|
1452
1455
|
return V().updateFromJSON(e);
|
|
@@ -1469,7 +1472,7 @@ class ut extends ct {
|
|
|
1469
1472
|
}
|
|
1470
1473
|
setDetail(e) {
|
|
1471
1474
|
const t = this.getWritable();
|
|
1472
|
-
return t.__detail = typeof e == "string" ?
|
|
1475
|
+
return t.__detail = typeof e == "string" ? no[e] : e, t;
|
|
1473
1476
|
}
|
|
1474
1477
|
setStyle(e) {
|
|
1475
1478
|
const t = this.getWritable();
|
|
@@ -1488,7 +1491,7 @@ class ut extends ct {
|
|
|
1488
1491
|
return e.__detail ^= 2, e;
|
|
1489
1492
|
}
|
|
1490
1493
|
setMode(e) {
|
|
1491
|
-
const t =
|
|
1494
|
+
const t = io[e];
|
|
1492
1495
|
if (this.__mode === t) return this;
|
|
1493
1496
|
const r = this.getWritable();
|
|
1494
1497
|
return r.__mode = t, r;
|
|
@@ -1506,10 +1509,10 @@ class ut extends ct {
|
|
|
1506
1509
|
const a = o.length;
|
|
1507
1510
|
r === void 0 && (r = a), i === void 0 && (i = a);
|
|
1508
1511
|
} else r = 0, i = 0;
|
|
1509
|
-
if (!A(s)) return
|
|
1512
|
+
if (!A(s)) return _s(l, r, l, i, "text", "text");
|
|
1510
1513
|
{
|
|
1511
1514
|
const a = Ee();
|
|
1512
|
-
a !== s.anchor.key && a !== s.focus.key ||
|
|
1515
|
+
a !== s.anchor.key && a !== s.focus.key || Y(l), s.setTextNodeRange(this, r, this, i);
|
|
1513
1516
|
}
|
|
1514
1517
|
return s;
|
|
1515
1518
|
}
|
|
@@ -1566,7 +1569,7 @@ class ut extends ct {
|
|
|
1566
1569
|
const S = V(l[k]);
|
|
1567
1570
|
S.__format = g, S.__style = h, S.__detail = _, S.__state = Jr(t, S);
|
|
1568
1571
|
const O = S.__key;
|
|
1569
|
-
s === i &&
|
|
1572
|
+
s === i && Y(O), N.push(S);
|
|
1570
1573
|
}
|
|
1571
1574
|
const b = x ? x.offset : null, C = y ? y.offset : null;
|
|
1572
1575
|
let w = 0;
|
|
@@ -1593,7 +1596,7 @@ class ut extends ct {
|
|
|
1593
1596
|
const t = e === this.getPreviousSibling();
|
|
1594
1597
|
t || e === this.getNextSibling() || T(50);
|
|
1595
1598
|
const r = this.__key, i = e.__key, s = this.__text, o = s.length;
|
|
1596
|
-
Ee() === i &&
|
|
1599
|
+
Ee() === i && Y(r);
|
|
1597
1600
|
const l = L();
|
|
1598
1601
|
if (A(l)) {
|
|
1599
1602
|
const d = l.anchor, f = l.focus;
|
|
@@ -1608,28 +1611,28 @@ class ut extends ct {
|
|
|
1608
1611
|
return !1;
|
|
1609
1612
|
}
|
|
1610
1613
|
}
|
|
1611
|
-
function
|
|
1614
|
+
function Bo(n) {
|
|
1612
1615
|
return { forChild: _r(n.style), node: null };
|
|
1613
1616
|
}
|
|
1614
|
-
function
|
|
1617
|
+
function Ro(n) {
|
|
1615
1618
|
const e = n, t = e.style.fontWeight === "normal";
|
|
1616
1619
|
return { forChild: _r(e.style, t ? void 0 : "bold"), node: null };
|
|
1617
1620
|
}
|
|
1618
1621
|
const ni = /* @__PURE__ */ new WeakMap();
|
|
1619
|
-
function
|
|
1622
|
+
function Wo(n) {
|
|
1620
1623
|
if (!ee(n)) return !1;
|
|
1621
1624
|
if (n.nodeName === "PRE") return !0;
|
|
1622
1625
|
const e = n.style.whiteSpace;
|
|
1623
1626
|
return typeof e == "string" && e.startsWith("pre");
|
|
1624
1627
|
}
|
|
1625
|
-
function
|
|
1628
|
+
function Jo(n) {
|
|
1626
1629
|
const e = n;
|
|
1627
1630
|
n.parentElement === null && T(129);
|
|
1628
1631
|
let t = e.textContent || "";
|
|
1629
1632
|
if (function(r) {
|
|
1630
1633
|
let i, s = r.parentNode;
|
|
1631
1634
|
const o = [r];
|
|
1632
|
-
for (; s !== null && (i = ni.get(s)) === void 0 && !
|
|
1635
|
+
for (; s !== null && (i = ni.get(s)) === void 0 && !Wo(s); ) o.push(s), s = s.parentNode;
|
|
1633
1636
|
const l = i === void 0 ? s : i;
|
|
1634
1637
|
for (let a = 0; a < o.length; a++) ni.set(o[a], l);
|
|
1635
1638
|
return l;
|
|
@@ -1677,7 +1680,7 @@ function ri(n, e) {
|
|
|
1677
1680
|
}
|
|
1678
1681
|
if (t = r, ee(t)) {
|
|
1679
1682
|
const s = t.style.display;
|
|
1680
|
-
if (s === "" && !
|
|
1683
|
+
if (s === "" && !hl(t) || s !== "" && !s.startsWith("inline")) return null;
|
|
1681
1684
|
}
|
|
1682
1685
|
let i = t;
|
|
1683
1686
|
for (; (i = e ? t.firstChild : t.lastChild) !== null; ) t = i;
|
|
@@ -1685,9 +1688,9 @@ function ri(n, e) {
|
|
|
1685
1688
|
if (t.nodeName === "BR") return null;
|
|
1686
1689
|
}
|
|
1687
1690
|
}
|
|
1688
|
-
const
|
|
1691
|
+
const jo = { code: "code", em: "italic", i: "italic", mark: "highlight", s: "strikethrough", strong: "bold", sub: "subscript", sup: "superscript", u: "underline" };
|
|
1689
1692
|
function me(n) {
|
|
1690
|
-
const e =
|
|
1693
|
+
const e = jo[n.nodeName.toLowerCase()];
|
|
1691
1694
|
return e === void 0 ? { node: null } : { forChild: _r(n.style, e), node: null };
|
|
1692
1695
|
}
|
|
1693
1696
|
function V(n = "") {
|
|
@@ -1742,10 +1745,10 @@ class Ot extends ut {
|
|
|
1742
1745
|
function pr() {
|
|
1743
1746
|
return Nn(new Ot());
|
|
1744
1747
|
}
|
|
1745
|
-
function
|
|
1748
|
+
function ds(n) {
|
|
1746
1749
|
return n instanceof Ot;
|
|
1747
1750
|
}
|
|
1748
|
-
class
|
|
1751
|
+
class $o {
|
|
1749
1752
|
constructor(e, t, r) {
|
|
1750
1753
|
this._selection = null, this.key = e, this.offset = t, this.type = r;
|
|
1751
1754
|
}
|
|
@@ -1753,7 +1756,7 @@ class jo {
|
|
|
1753
1756
|
return this.key === e.key && this.offset === e.offset && this.type === e.type;
|
|
1754
1757
|
}
|
|
1755
1758
|
isBefore(e) {
|
|
1756
|
-
return this.key === e.key ? this.offset < e.offset :
|
|
1759
|
+
return this.key === e.key ? this.offset < e.offset : Rs(de(He(this, "next")), de(He(e, "next"))) < 0;
|
|
1757
1760
|
}
|
|
1758
1761
|
getNode() {
|
|
1759
1762
|
const e = U(this.key);
|
|
@@ -1761,11 +1764,11 @@ class jo {
|
|
|
1761
1764
|
}
|
|
1762
1765
|
set(e, t, r, i) {
|
|
1763
1766
|
const s = this._selection, o = this.key;
|
|
1764
|
-
i && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r, At() || (Ee() === o &&
|
|
1767
|
+
i && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r, At() || (Ee() === o && Y(e), s !== null && (s.setCachedNodes(null), s.dirty = !0)));
|
|
1765
1768
|
}
|
|
1766
1769
|
}
|
|
1767
1770
|
function ge(n, e, t) {
|
|
1768
|
-
return new
|
|
1771
|
+
return new $o(n, e, t);
|
|
1769
1772
|
}
|
|
1770
1773
|
function Ln(n, e) {
|
|
1771
1774
|
let t = e.__key, r = n.offset, i = "element";
|
|
@@ -1865,8 +1868,8 @@ class yn {
|
|
|
1865
1868
|
deleteNodes() {
|
|
1866
1869
|
const e = this.getNodes();
|
|
1867
1870
|
if ((L() || ft()) === this && e[0]) {
|
|
1868
|
-
const t =
|
|
1869
|
-
|
|
1871
|
+
const t = H(e[0], "next");
|
|
1872
|
+
wl(Ye(t, t));
|
|
1870
1873
|
}
|
|
1871
1874
|
for (const t of e) t.remove();
|
|
1872
1875
|
}
|
|
@@ -1915,7 +1918,7 @@ class Ge {
|
|
|
1915
1918
|
i.push(f);
|
|
1916
1919
|
}
|
|
1917
1920
|
return i;
|
|
1918
|
-
}(
|
|
1921
|
+
}(Js(Pi(this), "next"));
|
|
1919
1922
|
return At() || (this._cachedNodes = t), t;
|
|
1920
1923
|
}
|
|
1921
1924
|
setTextNodeRange(e, t, r, i) {
|
|
@@ -1933,12 +1936,12 @@ class Ge {
|
|
|
1933
1936
|
else if (u = !1, M(f)) {
|
|
1934
1937
|
let g = f.getTextContent();
|
|
1935
1938
|
f === t ? f === r ? i.type === "element" && s.type === "element" && s.offset !== i.offset || (g = l < a ? g.slice(l, a) : g.slice(a, l)) : g = o ? g.slice(l) : g.slice(a) : f === r && (g = o ? g.slice(0, a) : g.slice(0, l)), c += g;
|
|
1936
|
-
} else !
|
|
1939
|
+
} else !K(f) && !tt(f) || f === r && this.isCollapsed() || (c += f.getTextContent());
|
|
1937
1940
|
}
|
|
1938
1941
|
return c;
|
|
1939
1942
|
}
|
|
1940
1943
|
applyDOMRange(e) {
|
|
1941
|
-
const t = R(), r = t.getEditorState()._selection, i =
|
|
1944
|
+
const t = R(), r = t.getEditorState()._selection, i = gs(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, r);
|
|
1942
1945
|
if (i === null) return;
|
|
1943
1946
|
const [s, o] = i;
|
|
1944
1947
|
this.anchor.set(s.key, s.offset, s.type, !0), this.focus.set(o.key, o.offset, o.type, !0), $n(this);
|
|
@@ -1950,6 +1953,9 @@ class Ge {
|
|
|
1950
1953
|
toggleFormat(e) {
|
|
1951
1954
|
this.format = hn(this.format, e, null), this.dirty = !0;
|
|
1952
1955
|
}
|
|
1956
|
+
setFormat(e) {
|
|
1957
|
+
this.format = e, this.dirty = !0;
|
|
1958
|
+
}
|
|
1953
1959
|
setStyle(e) {
|
|
1954
1960
|
this.style = e, this.dirty = !0;
|
|
1955
1961
|
}
|
|
@@ -1973,7 +1979,7 @@ class Ge {
|
|
|
1973
1979
|
!this.isCollapsed() && r.isBefore(t) && (o = r, l = t), o.type === "element" && function(p, x, y, m) {
|
|
1974
1980
|
const N = p.getNode(), b = N.getChildAtIndex(p.offset), C = V(), w = ne(N) ? Me().append(C) : C;
|
|
1975
1981
|
C.setFormat(y), C.setStyle(m), b === null ? N.append(w) : b.insertBefore(w), p.is(x) && x.set(C.__key, 0, "text"), p.set(C.__key, 0, "text");
|
|
1976
|
-
}(o, l, i, s), l.type === "element" && Et(l, de(
|
|
1982
|
+
}(o, l, i, s), l.type === "element" && Et(l, de(He(l, "next")));
|
|
1977
1983
|
const a = o.offset;
|
|
1978
1984
|
let c = l.offset;
|
|
1979
1985
|
const u = this.getNodes(), d = u.length;
|
|
@@ -1992,16 +1998,16 @@ class Ge {
|
|
|
1992
1998
|
p.setFormat(i), f.replace(p), f = p;
|
|
1993
1999
|
} else if (!this.isCollapsed() && e !== "") {
|
|
1994
2000
|
const p = _.getParent();
|
|
1995
|
-
if (!h.canInsertTextBefore() || !h.canInsertTextAfter() || v(p) && (!p.canInsertTextBefore() || !p.canInsertTextAfter())) return this.insertText(""),
|
|
2001
|
+
if (!h.canInsertTextBefore() || !h.canInsertTextAfter() || v(p) && (!p.canInsertTextBefore() || !p.canInsertTextAfter())) return this.insertText(""), hs(this.anchor, this.focus, null), void this.insertText(e);
|
|
1996
2002
|
}
|
|
1997
2003
|
if (d === 1) {
|
|
1998
|
-
if (
|
|
2004
|
+
if (Ke(f)) {
|
|
1999
2005
|
const m = V(e);
|
|
2000
2006
|
return m.select(), void f.replace(m);
|
|
2001
2007
|
}
|
|
2002
2008
|
const p = f.getFormat(), x = f.getStyle();
|
|
2003
2009
|
if (a !== c || p === i && x === s) {
|
|
2004
|
-
if (
|
|
2010
|
+
if (ds(f)) {
|
|
2005
2011
|
const m = V(e);
|
|
2006
2012
|
return m.setFormat(i), m.setStyle(s), m.select(), void f.replace(m);
|
|
2007
2013
|
}
|
|
@@ -2025,7 +2031,7 @@ class Ge {
|
|
|
2025
2031
|
if (!x.is(y) && y.isInline()) do
|
|
2026
2032
|
m = y, y = y.getParentOrThrow();
|
|
2027
2033
|
while (y.isInline());
|
|
2028
|
-
if (l.type === "text" && (c !== 0 || _.getTextContent() === "") || l.type === "element" && _.getIndexWithinParent() < c) if (M(_) && !
|
|
2034
|
+
if (l.type === "text" && (c !== 0 || _.getTextContent() === "") || l.type === "element" && _.getIndexWithinParent() < c) if (M(_) && !Ke(_) && c !== _.getTextContentSize()) {
|
|
2029
2035
|
if (_.isSegmented()) {
|
|
2030
2036
|
const k = V(_.getTextContent());
|
|
2031
2037
|
_.replace(k), _ = k;
|
|
@@ -2049,7 +2055,7 @@ class Ge {
|
|
|
2049
2055
|
(F === 0 || O[F - 1].is(S)) && (p.delete(k.__key), S = k), k = k.getParent();
|
|
2050
2056
|
}
|
|
2051
2057
|
}
|
|
2052
|
-
if (
|
|
2058
|
+
if (Ke(f)) if (a === g) f.select();
|
|
2053
2059
|
else {
|
|
2054
2060
|
const k = V(e);
|
|
2055
2061
|
k.select(), f.replace(k);
|
|
@@ -2063,10 +2069,10 @@ class Ge {
|
|
|
2063
2069
|
}
|
|
2064
2070
|
removeText() {
|
|
2065
2071
|
const e = L() === this;
|
|
2066
|
-
Xt(this,
|
|
2072
|
+
Xt(this, El(Pi(this))), e && L() !== this && ie(this);
|
|
2067
2073
|
}
|
|
2068
2074
|
formatText(e, t = null) {
|
|
2069
|
-
if (this.isCollapsed()) return this.toggleFormat(e), void
|
|
2075
|
+
if (this.isCollapsed()) return this.toggleFormat(e), void Y(null);
|
|
2070
2076
|
const r = this.getNodes(), i = [];
|
|
2071
2077
|
for (const N of r) M(N) && i.push(N);
|
|
2072
2078
|
const s = (N) => {
|
|
@@ -2077,7 +2083,7 @@ class Ge {
|
|
|
2077
2083
|
}
|
|
2078
2084
|
});
|
|
2079
2085
|
}, o = i.length;
|
|
2080
|
-
if (o === 0) return this.toggleFormat(e),
|
|
2086
|
+
if (o === 0) return this.toggleFormat(e), Y(null), void s(t);
|
|
2081
2087
|
const l = this.anchor, a = this.focus, c = this.isBackward(), u = c ? a : l, d = c ? l : a;
|
|
2082
2088
|
let f = 0, g = i[0], h = u.type === "element" ? 0 : u.offset;
|
|
2083
2089
|
if (u.type === "text" && h === g.getTextContentSize() && (f = 1, g = i[1], h = 0), g == null) return;
|
|
@@ -2120,7 +2126,7 @@ class Ge {
|
|
|
2120
2126
|
}
|
|
2121
2127
|
return;
|
|
2122
2128
|
}
|
|
2123
|
-
if (!e.some((h) => (v(h) ||
|
|
2129
|
+
if (!e.some((h) => (v(h) || K(h)) && !h.isInline())) {
|
|
2124
2130
|
v(r) || T(211, t.constructor.name, t.getType());
|
|
2125
2131
|
const h = In(this);
|
|
2126
2132
|
return r.splice(h, 0, e), void i.selectEnd();
|
|
@@ -2130,7 +2136,7 @@ class Ge {
|
|
|
2130
2136
|
let p = null;
|
|
2131
2137
|
for (let x = 0; x < h.length; x++) {
|
|
2132
2138
|
const y = h[x], m = tt(y);
|
|
2133
|
-
if (m ||
|
|
2139
|
+
if (m || K(y) && y.isInline() || v(y) && y.isInline() || M(y) || y.isParentRequired()) {
|
|
2134
2140
|
if (p === null && (p = y.createParentElementNode(), _.append(p), m)) continue;
|
|
2135
2141
|
p !== null && p.append(y);
|
|
2136
2142
|
} else _.append(y), p = null;
|
|
@@ -2199,12 +2205,12 @@ class Ge {
|
|
|
2199
2205
|
const l = s._blockCursorElement, a = s._rootElement, c = this.focus.getNode();
|
|
2200
2206
|
if (a === null || l === null || !v(c) || c.isInline() || c.canBeEmpty() || sr(l, s, a), this.dirty) {
|
|
2201
2207
|
let u = ot(s, this.anchor.key), d = ot(s, this.focus.key);
|
|
2202
|
-
this.anchor.type === "text" && (u = st(u)), this.focus.type === "text" && (d = st(d)), u && d &&
|
|
2208
|
+
this.anchor.type === "text" && (u = st(u)), this.focus.type === "text" && (d = st(d)), u && d && ys(o, u, this.anchor.offset, d, this.focus.offset);
|
|
2203
2209
|
}
|
|
2204
2210
|
if (function(u, d, f, g) {
|
|
2205
2211
|
u.modify(d, f, g);
|
|
2206
2212
|
}(o, e, t ? "backward" : "forward", r), o.rangeCount > 0) {
|
|
2207
|
-
const u = o.getRangeAt(0), d = this.anchor.getNode(), f = ne(d) ? d :
|
|
2213
|
+
const u = o.getRangeAt(0), d = this.anchor.getNode(), f = ne(d) ? d : al(d);
|
|
2208
2214
|
if (this.applyDOMRange(u), this.dirty = !0, !i) {
|
|
2209
2215
|
const g = this.getNodes(), h = [];
|
|
2210
2216
|
let _ = !1;
|
|
@@ -2240,7 +2246,7 @@ class Ge {
|
|
|
2240
2246
|
const r = this.anchor;
|
|
2241
2247
|
let i = r.getNode();
|
|
2242
2248
|
if (this.forwardDeletion(r, i, e)) return;
|
|
2243
|
-
const s = Ks(
|
|
2249
|
+
const s = Ks(He(r, e ? "previous" : "next"));
|
|
2244
2250
|
if (s.getTextSlices().every((l) => l === null || l.distance === 0)) {
|
|
2245
2251
|
let l = { type: "initial" };
|
|
2246
2252
|
for (const a of s.iterNodeCarets("shadowRoot")) if (he(a)) {
|
|
@@ -2249,7 +2255,7 @@ class Ge {
|
|
|
2249
2255
|
if (l.type === "merge-block") break;
|
|
2250
2256
|
if (v(s.anchor.origin) && s.anchor.origin.isEmpty()) {
|
|
2251
2257
|
const c = de(a);
|
|
2252
|
-
Xt(this,
|
|
2258
|
+
Xt(this, Ye(c, c)), s.anchor.origin.remove();
|
|
2253
2259
|
}
|
|
2254
2260
|
return;
|
|
2255
2261
|
}
|
|
@@ -2264,10 +2270,10 @@ class Ge {
|
|
|
2264
2270
|
} else l = { block: a.origin, type: "merge-next-block" };
|
|
2265
2271
|
continue;
|
|
2266
2272
|
}
|
|
2267
|
-
if (
|
|
2273
|
+
if (K(a.origin)) {
|
|
2268
2274
|
if (!a.origin.isIsolated()) if (l.type === "merge-next-block" && (a.origin.isKeyboardSelectable() || !a.origin.isInline()) && v(s.anchor.origin) && s.anchor.origin.isEmpty()) {
|
|
2269
2275
|
s.anchor.origin.remove();
|
|
2270
|
-
const c =
|
|
2276
|
+
const c = ps();
|
|
2271
2277
|
c.add(a.origin.getKey()), ie(c);
|
|
2272
2278
|
} else a.origin.remove();
|
|
2273
2279
|
return;
|
|
@@ -2277,7 +2283,7 @@ class Ge {
|
|
|
2277
2283
|
}
|
|
2278
2284
|
if (l.type === "merge-block") {
|
|
2279
2285
|
const { caret: a, block: c } = l;
|
|
2280
|
-
return Xt(this,
|
|
2286
|
+
return Xt(this, Ye(!a.origin.isEmpty() && c.isEmpty() ? zt(H(c, a.direction)) : s.anchor, a)), this.removeText();
|
|
2281
2287
|
}
|
|
2282
2288
|
}
|
|
2283
2289
|
const o = this.focus;
|
|
@@ -2297,7 +2303,7 @@ class Ge {
|
|
|
2297
2303
|
if (f === g && u.type === "text" && d.type === "text") {
|
|
2298
2304
|
const h = u.offset, _ = d.offset, p = h < _, x = p ? h : _, y = p ? _ : h, m = y - 1;
|
|
2299
2305
|
x !== m && function(N) {
|
|
2300
|
-
return !(
|
|
2306
|
+
return !(Ps(N) || Uo(N));
|
|
2301
2307
|
}(f.getTextContent().slice(x, y)) && (c ? d.set(d.key, m, d.type) : u.set(u.key, m, u.type));
|
|
2302
2308
|
}
|
|
2303
2309
|
})(this, e);
|
|
@@ -2351,7 +2357,7 @@ function li(n, e) {
|
|
|
2351
2357
|
}
|
|
2352
2358
|
return !1;
|
|
2353
2359
|
}
|
|
2354
|
-
const
|
|
2360
|
+
const Uo = (() => {
|
|
2355
2361
|
try {
|
|
2356
2362
|
const n = new RegExp("\\p{Emoji}", "u"), e = n.test.bind(n);
|
|
2357
2363
|
if (e("❤️") && e("#️⃣") && e("👍")) return e;
|
|
@@ -2402,7 +2408,7 @@ function ci(n, e, t, r) {
|
|
|
2402
2408
|
M(_) ? (i = _, f = null, s = ki(_, o)) : _ !== f && o && !d && (v(f) || T(216), s = Math.min(f.getChildrenSize(), s + 1));
|
|
2403
2409
|
} else {
|
|
2404
2410
|
const g = f.getIndexWithinParent();
|
|
2405
|
-
s = e === 0 &&
|
|
2411
|
+
s = e === 0 && K(f) && Ze(n) === f ? g : g + 1, f = f.getParentOrThrow();
|
|
2406
2412
|
}
|
|
2407
2413
|
if (v(f)) return ge(f.__key, s, "element");
|
|
2408
2414
|
}
|
|
@@ -2428,7 +2434,7 @@ function ui(n, e, t) {
|
|
|
2428
2434
|
}
|
|
2429
2435
|
}
|
|
2430
2436
|
}
|
|
2431
|
-
function
|
|
2437
|
+
function hs(n, e, t) {
|
|
2432
2438
|
if (n.type === "text" && e.type === "text") {
|
|
2433
2439
|
const r = n.isBefore(e), i = n.is(e);
|
|
2434
2440
|
ui(n, r, i), ui(e, !r, i), i && e.set(n.key, n.offset, n.type);
|
|
@@ -2439,7 +2445,7 @@ function ds(n, e, t) {
|
|
|
2439
2445
|
}
|
|
2440
2446
|
}
|
|
2441
2447
|
}
|
|
2442
|
-
function
|
|
2448
|
+
function gs(n, e, t, r, i, s) {
|
|
2443
2449
|
if (n === null || t === null || !Sn(i, n, t)) return null;
|
|
2444
2450
|
const o = ci(n, e, A(s) ? s.anchor : null, i);
|
|
2445
2451
|
if (o === null) return null;
|
|
@@ -2447,25 +2453,25 @@ function hs(n, e, t, r, i, s) {
|
|
|
2447
2453
|
if (l === null) return null;
|
|
2448
2454
|
if (o.type === "element" && l.type === "element") {
|
|
2449
2455
|
const a = Ze(n), c = Ze(t);
|
|
2450
|
-
if (
|
|
2456
|
+
if (K(a) && K(c)) return null;
|
|
2451
2457
|
}
|
|
2452
|
-
return
|
|
2458
|
+
return hs(o, l, s), [o, l];
|
|
2453
2459
|
}
|
|
2454
|
-
function
|
|
2460
|
+
function jl(n) {
|
|
2455
2461
|
return v(n) && !n.isInline();
|
|
2456
2462
|
}
|
|
2457
|
-
function
|
|
2463
|
+
function _s(n, e, t, r, i, s) {
|
|
2458
2464
|
const o = Pe(), l = new Ge(ge(n, e, i), ge(t, r, s), 0, "");
|
|
2459
2465
|
return l.dirty = !0, o._selection = l, l;
|
|
2460
2466
|
}
|
|
2461
|
-
function
|
|
2467
|
+
function Vo() {
|
|
2462
2468
|
const n = ge("root", 0, "element"), e = ge("root", 0, "element");
|
|
2463
2469
|
return new Ge(n, e, 0, "");
|
|
2464
2470
|
}
|
|
2465
|
-
function
|
|
2471
|
+
function ps() {
|
|
2466
2472
|
return new yn(/* @__PURE__ */ new Set());
|
|
2467
2473
|
}
|
|
2468
|
-
function
|
|
2474
|
+
function $l(n, e) {
|
|
2469
2475
|
return mn(null, n, e, null);
|
|
2470
2476
|
}
|
|
2471
2477
|
function mn(n, e, t, r) {
|
|
@@ -2476,7 +2482,7 @@ function mn(n, e, t, r) {
|
|
|
2476
2482
|
if (A(n) && !a) return n.clone();
|
|
2477
2483
|
if (e === null) return null;
|
|
2478
2484
|
if (c = e.anchorNode, u = e.focusNode, d = e.anchorOffset, f = e.focusOffset, l && A(n) && !Sn(t, c, u)) return n.clone();
|
|
2479
|
-
const g =
|
|
2485
|
+
const g = gs(c, d, u, f, t, n);
|
|
2480
2486
|
if (g === null) return null;
|
|
2481
2487
|
const [h, _] = g;
|
|
2482
2488
|
return new Ge(h, _, A(n) ? n.format : 0, A(n) ? n.style : "");
|
|
@@ -2543,15 +2549,15 @@ function dn(n, e, t, r, i) {
|
|
|
2543
2549
|
function di(n, e, t, r, i) {
|
|
2544
2550
|
n.type === "text" ? n.set(t, n.offset + (e ? 0 : i), "text") : n.offset > r.getIndexWithinParent() && n.set(n.key, n.offset - 1, "element");
|
|
2545
2551
|
}
|
|
2546
|
-
function
|
|
2552
|
+
function ys(n, e, t, r, i) {
|
|
2547
2553
|
try {
|
|
2548
2554
|
n.setBaseAndExtent(e, t, r, i);
|
|
2549
2555
|
} catch {
|
|
2550
2556
|
}
|
|
2551
2557
|
}
|
|
2552
|
-
function
|
|
2558
|
+
function Yo(n, e, t, r, i, s, o) {
|
|
2553
2559
|
const l = r.anchorNode, a = r.focusNode, c = r.anchorOffset, u = r.focusOffset, d = document.activeElement;
|
|
2554
|
-
if (i.has(
|
|
2560
|
+
if (i.has(Go) && d !== s || d !== null && ws(d)) return;
|
|
2555
2561
|
if (!A(e)) return void (n !== null && Sn(t, l, a) && r.removeAllRanges());
|
|
2556
2562
|
const f = e.anchor, g = e.focus, h = f.key, _ = g.key, p = ot(t, h), x = ot(t, _), y = f.offset, m = g.offset, N = e.format, b = e.style, C = e.isCollapsed();
|
|
2557
2563
|
let w = p, k = x, S = !1;
|
|
@@ -2560,9 +2566,9 @@ function Vo(n, e, t, r, i, s, o) {
|
|
|
2560
2566
|
const B = f.getNode();
|
|
2561
2567
|
S = B.getFormat() !== N || B.getStyle() !== b;
|
|
2562
2568
|
} else A(n) && n.anchor.type === "text" && (S = !0);
|
|
2563
|
-
var O, F, W,
|
|
2564
|
-
if (g.type === "text" && (k = st(x)), w !== null && k !== null && (C && (n === null || S || A(n) && (n.format !== N || n.style !== b)) && (O = N, F = b, W = y,
|
|
2565
|
-
if (
|
|
2569
|
+
var O, F, W, z, P;
|
|
2570
|
+
if (g.type === "text" && (k = st(x)), w !== null && k !== null && (C && (n === null || S || A(n) && (n.format !== N || n.style !== b)) && (O = N, F = b, W = y, z = h, P = performance.now(), is = [O, F, W, z, P]), c !== y || u !== m || l !== w || a !== k || r.type === "Range" && C || (d !== null && s.contains(d) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
2571
|
+
if (ys(r, w, y, k, m), !i.has(Xo) && e.isCollapsed() && s !== null && s === document.activeElement) {
|
|
2566
2572
|
const B = A(e) && e.anchor.type === "element" ? w.childNodes[y] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null;
|
|
2567
2573
|
if (B !== null) {
|
|
2568
2574
|
let q;
|
|
@@ -2571,18 +2577,18 @@ function Vo(n, e, t, r, i, s, o) {
|
|
|
2571
2577
|
se.selectNode(B), q = se.getBoundingClientRect();
|
|
2572
2578
|
} else q = B.getBoundingClientRect();
|
|
2573
2579
|
(function(se, _e, pe) {
|
|
2574
|
-
const dt =
|
|
2580
|
+
const dt = zs(pe), Fr = Er(dt);
|
|
2575
2581
|
if (dt === null || Fr === null) return;
|
|
2576
|
-
let { top: bn, bottom: wn } = _e,
|
|
2582
|
+
let { top: bn, bottom: wn } = _e, Kt = 0, Bt = 0, Ne = pe;
|
|
2577
2583
|
for (; Ne !== null; ) {
|
|
2578
2584
|
const En = Ne === dt.body;
|
|
2579
|
-
if (En)
|
|
2585
|
+
if (En) Kt = 0, Bt = oe(se).innerHeight;
|
|
2580
2586
|
else {
|
|
2581
2587
|
const Rt = Ne.getBoundingClientRect();
|
|
2582
|
-
|
|
2588
|
+
Kt = Rt.top, Bt = Rt.bottom;
|
|
2583
2589
|
}
|
|
2584
2590
|
let ht = 0;
|
|
2585
|
-
if (bn <
|
|
2591
|
+
if (bn < Kt ? ht = -(Kt - bn) : wn > Bt && (ht = wn - Bt), ht !== 0) if (En) Fr.scrollBy(0, ht);
|
|
2586
2592
|
else {
|
|
2587
2593
|
const Rt = Ne.scrollTop;
|
|
2588
2594
|
Ne.scrollTop += ht;
|
|
@@ -2598,7 +2604,7 @@ function Vo(n, e, t, r, i, s, o) {
|
|
|
2598
2604
|
er = !0;
|
|
2599
2605
|
}
|
|
2600
2606
|
}
|
|
2601
|
-
function
|
|
2607
|
+
function Ul(n) {
|
|
2602
2608
|
let e = L() || ft();
|
|
2603
2609
|
e === null && (e = re().selectEnd()), e.insertNodes(n);
|
|
2604
2610
|
}
|
|
@@ -2640,31 +2646,31 @@ function hi(n, e, t, r, i = "decorators-and-blocks") {
|
|
|
2640
2646
|
const [u, d] = t === n.isBackward() ? [n.focus, n.anchor] : [n.anchor, n.focus];
|
|
2641
2647
|
return d.set(u.key, u.offset, u.type), !0;
|
|
2642
2648
|
}
|
|
2643
|
-
const s =
|
|
2649
|
+
const s = He(n.focus, t ? "previous" : "next"), o = r === "lineboundary", l = e === "move";
|
|
2644
2650
|
let a = s, c = i === "decorators-and-blocks";
|
|
2645
|
-
if (!
|
|
2651
|
+
if (!Ml(a)) {
|
|
2646
2652
|
for (const u of a) {
|
|
2647
2653
|
c = !1;
|
|
2648
2654
|
const { origin: d } = u;
|
|
2649
|
-
if (!
|
|
2655
|
+
if (!K(d) || d.isIsolated() || (a = u, !o || !d.isInline())) break;
|
|
2650
2656
|
}
|
|
2651
2657
|
if (c) for (const u of Ks(s).iterNodeCarets(e === "extend" ? "shadowRoot" : "root")) {
|
|
2652
2658
|
if (he(u)) u.origin.isInline() || (a = u);
|
|
2653
2659
|
else {
|
|
2654
2660
|
if (v(u.origin)) continue;
|
|
2655
|
-
|
|
2661
|
+
K(u.origin) && !u.origin.isInline() && (a = u);
|
|
2656
2662
|
}
|
|
2657
2663
|
break;
|
|
2658
2664
|
}
|
|
2659
2665
|
}
|
|
2660
2666
|
if (a === s) return !1;
|
|
2661
|
-
if (l && !o &&
|
|
2662
|
-
const u =
|
|
2667
|
+
if (l && !o && K(a.origin) && a.origin.isKeyboardSelectable()) {
|
|
2668
|
+
const u = ps();
|
|
2663
2669
|
return u.add(a.origin.getKey()), ie(u), !0;
|
|
2664
2670
|
}
|
|
2665
2671
|
return a = de(a), l && Et(n.anchor, a), Et(n.focus, a), c || !o;
|
|
2666
2672
|
}
|
|
2667
|
-
let j = null, $ = null, Z = !1,
|
|
2673
|
+
let j = null, $ = null, Z = !1, zn = !1, qt = 0;
|
|
2668
2674
|
const gi = { characterData: !0, childList: !0, subtree: !0 };
|
|
2669
2675
|
function At() {
|
|
2670
2676
|
return Z || j !== null && j._readOnly;
|
|
@@ -2672,16 +2678,16 @@ function At() {
|
|
|
2672
2678
|
function G() {
|
|
2673
2679
|
Z && T(13);
|
|
2674
2680
|
}
|
|
2675
|
-
function
|
|
2681
|
+
function ms() {
|
|
2676
2682
|
qt > 99 && T(14);
|
|
2677
2683
|
}
|
|
2678
2684
|
function Pe() {
|
|
2679
|
-
return j === null && T(195,
|
|
2685
|
+
return j === null && T(195, xs()), j;
|
|
2680
2686
|
}
|
|
2681
2687
|
function R() {
|
|
2682
|
-
return $ === null && T(196,
|
|
2688
|
+
return $ === null && T(196, xs()), $;
|
|
2683
2689
|
}
|
|
2684
|
-
function
|
|
2690
|
+
function xs() {
|
|
2685
2691
|
let n = 0;
|
|
2686
2692
|
const e = /* @__PURE__ */ new Set(), t = Cn.version;
|
|
2687
2693
|
if (typeof window < "u") for (const i of document.querySelectorAll("[contenteditable]")) {
|
|
@@ -2695,11 +2701,11 @@ function ms() {
|
|
|
2695
2701
|
let r = ` Detected on the page: ${n} compatible editor(s) with version ${t}`;
|
|
2696
2702
|
return e.size && (r += ` and incompatible editors with versions ${Array.from(e).join(", ")}`), r;
|
|
2697
2703
|
}
|
|
2698
|
-
function
|
|
2704
|
+
function qo() {
|
|
2699
2705
|
return $;
|
|
2700
2706
|
}
|
|
2701
2707
|
function _i(n, e, t) {
|
|
2702
|
-
const r = e.__type, i =
|
|
2708
|
+
const r = e.__type, i = Ns(n, r);
|
|
2703
2709
|
let s = t.get(r);
|
|
2704
2710
|
s === void 0 && (s = Array.from(i.transforms), t.set(r, s));
|
|
2705
2711
|
const o = s.length;
|
|
@@ -2708,14 +2714,14 @@ function _i(n, e, t) {
|
|
|
2708
2714
|
function pi(n, e) {
|
|
2709
2715
|
return n !== void 0 && n.__key !== e && n.isAttached();
|
|
2710
2716
|
}
|
|
2711
|
-
function
|
|
2717
|
+
function Cs(n, e) {
|
|
2712
2718
|
if (!e) return;
|
|
2713
2719
|
const t = n._updateTags;
|
|
2714
2720
|
let r = e;
|
|
2715
2721
|
Array.isArray(e) || (r = [e]);
|
|
2716
2722
|
for (const i of r) t.add(i);
|
|
2717
2723
|
}
|
|
2718
|
-
function
|
|
2724
|
+
function Vl(n) {
|
|
2719
2725
|
return mr(n, R()._nodes);
|
|
2720
2726
|
}
|
|
2721
2727
|
function mr(n, e) {
|
|
@@ -2748,10 +2754,10 @@ function Se(n, e) {
|
|
|
2748
2754
|
$ = n, j = t, Z = !1, n._updating = !0;
|
|
2749
2755
|
try {
|
|
2750
2756
|
const C = n._dirtyType, w = n._dirtyElements, k = n._dirtyLeaves;
|
|
2751
|
-
g.disconnect(), h =
|
|
2757
|
+
g.disconnect(), h = po(s, t, n, C, w, k);
|
|
2752
2758
|
} catch (C) {
|
|
2753
|
-
if (C instanceof Error && n._onError(C),
|
|
2754
|
-
return
|
|
2759
|
+
if (C instanceof Error && n._onError(C), zn) throw C;
|
|
2760
|
+
return Ts(n, null, r, t), Ji(n), n._dirtyType = it, zn = !0, Se(n, s), void (zn = !1);
|
|
2755
2761
|
} finally {
|
|
2756
2762
|
g.observe(r, gi), n._updating = f, j = c, Z = u, $ = d;
|
|
2757
2763
|
}
|
|
@@ -2763,31 +2769,31 @@ function Se(n, e) {
|
|
|
2763
2769
|
let S = C._pendingDecorators || k;
|
|
2764
2770
|
const O = w._nodeMap;
|
|
2765
2771
|
let F;
|
|
2766
|
-
for (F in S) O.has(F) || (S === k && (S =
|
|
2772
|
+
for (F in S) O.has(F) || (S === k && (S = As(C)), delete S[F]);
|
|
2767
2773
|
}(n, t);
|
|
2768
2774
|
const N = i ? null : ke(oe(n));
|
|
2769
|
-
if (n._editable && N !== null && (a || l === null || l.dirty) && r !== null && !y.has(
|
|
2775
|
+
if (n._editable && N !== null && (a || l === null || l.dirty) && r !== null && !y.has(Qo)) {
|
|
2770
2776
|
$ = n, j = t;
|
|
2771
2777
|
try {
|
|
2772
2778
|
if (g !== null && g.disconnect(), a || l === null || l.dirty) {
|
|
2773
2779
|
const C = n._blockCursorElement;
|
|
2774
|
-
C !== null && sr(C, n, r),
|
|
2780
|
+
C !== null && sr(C, n, r), Yo(o, l, n, N, y, r);
|
|
2775
2781
|
}
|
|
2776
2782
|
(function(C, w, k) {
|
|
2777
2783
|
let S = C._blockCursorElement;
|
|
2778
2784
|
if (A(k) && k.isCollapsed() && k.anchor.type === "element" && w.contains(document.activeElement)) {
|
|
2779
2785
|
const O = k.anchor, F = O.getNode(), W = O.offset;
|
|
2780
|
-
let
|
|
2786
|
+
let z = !1, P = null;
|
|
2781
2787
|
if (W === F.getChildrenSize())
|
|
2782
|
-
Rn(F.getChildAtIndex(W - 1)) && (
|
|
2788
|
+
Rn(F.getChildAtIndex(W - 1)) && (z = !0);
|
|
2783
2789
|
else {
|
|
2784
2790
|
const B = F.getChildAtIndex(W);
|
|
2785
2791
|
if (B !== null && Rn(B)) {
|
|
2786
2792
|
const q = B.getPreviousSibling();
|
|
2787
|
-
(q === null || Rn(q)) && (
|
|
2793
|
+
(q === null || Rn(q)) && (z = !0, P = C.getElementByKey(B.__key));
|
|
2788
2794
|
}
|
|
2789
2795
|
}
|
|
2790
|
-
if (
|
|
2796
|
+
if (z) {
|
|
2791
2797
|
const B = C.getElementByKey(F.__key);
|
|
2792
2798
|
return S === null && (C._blockCursorElement = S = function(q) {
|
|
2793
2799
|
const se = q.theme, _e = document.createElement("div");
|
|
@@ -2812,14 +2818,14 @@ function Se(n, e) {
|
|
|
2812
2818
|
}
|
|
2813
2819
|
h !== null && function(C, w, k, S, O) {
|
|
2814
2820
|
const F = Array.from(C._listeners.mutation), W = F.length;
|
|
2815
|
-
for (let
|
|
2816
|
-
const [P, B] = F[
|
|
2821
|
+
for (let z = 0; z < W; z++) {
|
|
2822
|
+
const [P, B] = F[z];
|
|
2817
2823
|
for (const q of B) {
|
|
2818
2824
|
const se = w.get(q);
|
|
2819
2825
|
se !== void 0 && P(se, { dirtyLeaves: S, prevEditorState: O, updateTags: k });
|
|
2820
2826
|
}
|
|
2821
2827
|
}
|
|
2822
|
-
}(n, h, y, _, s), A(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(
|
|
2828
|
+
}(n, h, y, _, s), A(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(Gi, void 0);
|
|
2823
2829
|
const b = n._pendingDecorators;
|
|
2824
2830
|
b !== null && (n._decorators = b, n._pendingDecorators = null, Ct("decorator", n, !0, b)), function(C, w, k) {
|
|
2825
2831
|
const S = vi(w), O = vi(k);
|
|
@@ -2868,7 +2874,7 @@ function mi(n, e) {
|
|
|
2868
2874
|
const a = n._pendingEditorState;
|
|
2869
2875
|
a === null && T(191), a._flushSync = !0;
|
|
2870
2876
|
}
|
|
2871
|
-
l && n._deferred.push(l),
|
|
2877
|
+
l && n._deferred.push(l), Cs(n, o.tag);
|
|
2872
2878
|
}
|
|
2873
2879
|
s();
|
|
2874
2880
|
}
|
|
@@ -2878,10 +2884,10 @@ function mi(n, e) {
|
|
|
2878
2884
|
function xr(n, e, t) {
|
|
2879
2885
|
const r = n._updateTags;
|
|
2880
2886
|
let i, s = !1, o = !1;
|
|
2881
|
-
t !== void 0 && (i = t.onUpdate,
|
|
2887
|
+
t !== void 0 && (i = t.onUpdate, Cs(n, t.tag), s = t.skipTransforms || !1, o = t.discrete || !1), i && n._deferred.push(i);
|
|
2882
2888
|
const l = n._editorState;
|
|
2883
2889
|
let a = n._pendingEditorState, c = !1;
|
|
2884
|
-
(a === null || a._readOnly) && (a = n._pendingEditorState =
|
|
2890
|
+
(a === null || a._readOnly) && (a = n._pendingEditorState = vs(a || l), c = !0), a._flushSync = o;
|
|
2885
2891
|
const u = j, d = Z, f = $, g = n._updating;
|
|
2886
2892
|
j = a, Z = !1, n._updating = !0, $ = n;
|
|
2887
2893
|
const h = n._headless || n.getRootElement() === null;
|
|
@@ -2914,9 +2920,9 @@ function xr(n, e, t) {
|
|
|
2914
2920
|
for (; O > 0 || W > 0; ) {
|
|
2915
2921
|
if (O > 0) {
|
|
2916
2922
|
m._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
2917
|
-
for (const
|
|
2918
|
-
const P = C.get(
|
|
2919
|
-
M(P) && P.isAttached() && P.isSimpleText() && !P.isUnmergeable() && Ur(P), P !== void 0 && pi(P, w) && _i(m, P, k), N.add(
|
|
2923
|
+
for (const z of S) {
|
|
2924
|
+
const P = C.get(z);
|
|
2925
|
+
M(P) && P.isAttached() && P.isSimpleText() && !P.isUnmergeable() && Ur(P), P !== void 0 && pi(P, w) && _i(m, P, k), N.add(z);
|
|
2920
2926
|
}
|
|
2921
2927
|
if (S = m._dirtyLeaves, O = S.size, O > 0) {
|
|
2922
2928
|
qt++;
|
|
@@ -2924,8 +2930,8 @@ function xr(n, e, t) {
|
|
|
2924
2930
|
}
|
|
2925
2931
|
}
|
|
2926
2932
|
m._dirtyLeaves = /* @__PURE__ */ new Set(), m._dirtyElements = /* @__PURE__ */ new Map(), F.delete("root") && F.set("root", !0);
|
|
2927
|
-
for (const
|
|
2928
|
-
const P =
|
|
2933
|
+
for (const z of F) {
|
|
2934
|
+
const P = z[0], B = z[1];
|
|
2929
2935
|
if (b.set(P, B), !B) continue;
|
|
2930
2936
|
const q = C.get(P);
|
|
2931
2937
|
q !== void 0 && pi(q, w) && _i(m, q, k);
|
|
@@ -2961,7 +2967,7 @@ function xr(n, e, t) {
|
|
|
2961
2967
|
if (m.dirty || !m.is(y)) return !0;
|
|
2962
2968
|
} else if (y !== null) return !0;
|
|
2963
2969
|
return !1;
|
|
2964
|
-
}(a, n) ? a._flushSync ? (a._flushSync = !1, Se(n)) : c &&
|
|
2970
|
+
}(a, n) ? a._flushSync ? (a._flushSync = !1, Se(n)) : c && nl(() => {
|
|
2965
2971
|
Se(n);
|
|
2966
2972
|
}) : (a._flushSync = !1, c && (r.clear(), n._deferred = [], n._pendingEditorState = null));
|
|
2967
2973
|
}
|
|
@@ -3071,7 +3077,7 @@ class Dt extends ct {
|
|
|
3071
3077
|
}
|
|
3072
3078
|
getFormatType() {
|
|
3073
3079
|
const e = this.getFormat();
|
|
3074
|
-
return
|
|
3080
|
+
return ro[e] || "";
|
|
3075
3081
|
}
|
|
3076
3082
|
getStyle() {
|
|
3077
3083
|
return this.getLatest().__style;
|
|
@@ -3202,7 +3208,7 @@ class Dt extends ct {
|
|
|
3202
3208
|
}
|
|
3203
3209
|
hasFormat(e) {
|
|
3204
3210
|
if (e !== "") {
|
|
3205
|
-
const t =
|
|
3211
|
+
const t = zr[e];
|
|
3206
3212
|
return !!(this.getFormat() & t);
|
|
3207
3213
|
}
|
|
3208
3214
|
return !1;
|
|
@@ -3233,7 +3239,7 @@ class Dt extends ct {
|
|
|
3233
3239
|
}
|
|
3234
3240
|
i === void 0 && (i = o), s === void 0 && (s = o);
|
|
3235
3241
|
const l = this.__key;
|
|
3236
|
-
return A(r) ? (r.anchor.set(l, i, "element"), r.focus.set(l, s, "element"), r.dirty = !0, r) :
|
|
3242
|
+
return A(r) ? (r.anchor.set(l, i, "element"), r.focus.set(l, s, "element"), r.dirty = !0, r) : _s(l, i, l, s, "element", "element");
|
|
3237
3243
|
}
|
|
3238
3244
|
selectStart() {
|
|
3239
3245
|
const e = this.getFirstDescendant();
|
|
@@ -3255,7 +3261,7 @@ class Dt extends ct {
|
|
|
3255
3261
|
return t.__dir = e, t;
|
|
3256
3262
|
}
|
|
3257
3263
|
setFormat(e) {
|
|
3258
|
-
return this.getWritable().__format = e !== "" ?
|
|
3264
|
+
return this.getWritable().__format = e !== "" ? zr[e] : 0, this;
|
|
3259
3265
|
}
|
|
3260
3266
|
setStyle(e) {
|
|
3261
3267
|
return this.getWritable().__style = e || "", this;
|
|
@@ -3404,7 +3410,7 @@ function Ci(n, e, t) {
|
|
|
3404
3410
|
}
|
|
3405
3411
|
return !1;
|
|
3406
3412
|
}
|
|
3407
|
-
class
|
|
3413
|
+
class Ss extends ct {
|
|
3408
3414
|
decorate(e, t) {
|
|
3409
3415
|
T(47);
|
|
3410
3416
|
}
|
|
@@ -3418,8 +3424,8 @@ class Cs extends ct {
|
|
|
3418
3424
|
return !0;
|
|
3419
3425
|
}
|
|
3420
3426
|
}
|
|
3421
|
-
function
|
|
3422
|
-
return n instanceof
|
|
3427
|
+
function K(n) {
|
|
3428
|
+
return n instanceof Ss;
|
|
3423
3429
|
}
|
|
3424
3430
|
class Pt extends Dt {
|
|
3425
3431
|
static getType() {
|
|
@@ -3454,7 +3460,7 @@ class Pt extends Dt {
|
|
|
3454
3460
|
return !1;
|
|
3455
3461
|
}
|
|
3456
3462
|
splice(e, t, r) {
|
|
3457
|
-
for (const i of r) v(i) ||
|
|
3463
|
+
for (const i of r) v(i) || K(i) || T(282);
|
|
3458
3464
|
return super.splice(e, t, r);
|
|
3459
3465
|
}
|
|
3460
3466
|
static importJSON(e) {
|
|
@@ -3467,20 +3473,20 @@ class Pt extends Dt {
|
|
|
3467
3473
|
function ne(n) {
|
|
3468
3474
|
return n instanceof Pt;
|
|
3469
3475
|
}
|
|
3470
|
-
function
|
|
3476
|
+
function vs(n) {
|
|
3471
3477
|
return new xn(new Map(n._nodeMap));
|
|
3472
3478
|
}
|
|
3473
3479
|
function Cr() {
|
|
3474
3480
|
return new xn(/* @__PURE__ */ new Map([["root", new Pt()]]));
|
|
3475
3481
|
}
|
|
3476
|
-
function
|
|
3482
|
+
function ks(n) {
|
|
3477
3483
|
const e = n.exportJSON(), t = n.constructor;
|
|
3478
3484
|
if (e.type !== t.getType() && T(130, t.name), v(n)) {
|
|
3479
3485
|
const r = e.children;
|
|
3480
3486
|
Array.isArray(r) || T(59, t.name);
|
|
3481
3487
|
const i = n.getChildren();
|
|
3482
3488
|
for (let s = 0; s < i.length; s++) {
|
|
3483
|
-
const o =
|
|
3489
|
+
const o = ks(i[s]);
|
|
3484
3490
|
r.push(o);
|
|
3485
3491
|
}
|
|
3486
3492
|
}
|
|
@@ -3501,11 +3507,11 @@ class xn {
|
|
|
3501
3507
|
return t._readOnly = !0, t;
|
|
3502
3508
|
}
|
|
3503
3509
|
toJSON() {
|
|
3504
|
-
return yi(null, this, () => ({ root:
|
|
3510
|
+
return yi(null, this, () => ({ root: ks(re()) }));
|
|
3505
3511
|
}
|
|
3506
3512
|
}
|
|
3507
|
-
const
|
|
3508
|
-
class
|
|
3513
|
+
const Yl = "historic", Hl = "history-push", Kn = "history-merge", ql = "paste", Go = "collaboration", Xo = "skip-scroll-into-view", Qo = "skip-dom-selection";
|
|
3514
|
+
class Zo extends Dt {
|
|
3509
3515
|
static getType() {
|
|
3510
3516
|
return "artificial";
|
|
3511
3517
|
}
|
|
@@ -3528,7 +3534,7 @@ class Ft extends Dt {
|
|
|
3528
3534
|
return !1;
|
|
3529
3535
|
}
|
|
3530
3536
|
static importDOM() {
|
|
3531
|
-
return { p: (e) => ({ conversion:
|
|
3537
|
+
return { p: (e) => ({ conversion: el, priority: 0 }) };
|
|
3532
3538
|
}
|
|
3533
3539
|
exportDOM(e) {
|
|
3534
3540
|
const { element: t } = super.exportDOM(e);
|
|
@@ -3560,25 +3566,25 @@ class Ft extends Dt {
|
|
|
3560
3566
|
return !1;
|
|
3561
3567
|
}
|
|
3562
3568
|
}
|
|
3563
|
-
function
|
|
3569
|
+
function el(n) {
|
|
3564
3570
|
const e = Me();
|
|
3565
|
-
return n.style && (e.setFormat(n.style.textAlign),
|
|
3571
|
+
return n.style && (e.setFormat(n.style.textAlign), yl(n, e)), { node: e };
|
|
3566
3572
|
}
|
|
3567
3573
|
function Me() {
|
|
3568
3574
|
return Nn(new Ft());
|
|
3569
3575
|
}
|
|
3570
|
-
function
|
|
3576
|
+
function Gl(n) {
|
|
3571
3577
|
return n instanceof Ft;
|
|
3572
3578
|
}
|
|
3573
|
-
const
|
|
3574
|
-
function
|
|
3579
|
+
const Xl = 0, Ql = 1, Zl = 3, ea = 4;
|
|
3580
|
+
function Ts(n, e, t, r) {
|
|
3575
3581
|
const i = n._keyToDOMMap;
|
|
3576
3582
|
i.clear(), n._editorState = Cr(), n._pendingEditorState = r, n._compositionKey = null, n._dirtyType = We, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements.clear(), n._normalizedNodes = /* @__PURE__ */ new Set(), n._updateTags = /* @__PURE__ */ new Set(), n._updates = [], n._blockCursorElement = null;
|
|
3577
3583
|
const s = n._observer;
|
|
3578
3584
|
s !== null && (s.disconnect(), n._observer = null), e !== null && (e.textContent = ""), t !== null && (t.textContent = "", i.set("root", t));
|
|
3579
3585
|
}
|
|
3580
|
-
function
|
|
3581
|
-
const e = n || {}, t =
|
|
3586
|
+
function ta(n) {
|
|
3587
|
+
const e = n || {}, t = qo(), r = e.theme || {}, i = n === void 0 ? t : e.parentEditor || null, s = e.disableEvents || !1, o = Cr(), l = e.namespace || (i !== null ? i._config.namespace : Fs()), a = e.editorState, c = [Pt, ut, Mt, Ot, Ft, Zo, ...e.nodes || []], { onError: u, html: d } = e, f = e.editable === void 0 || e.editable;
|
|
3582
3588
|
let g;
|
|
3583
3589
|
if (n === void 0 && t !== null) g = t._nodes;
|
|
3584
3590
|
else {
|
|
@@ -3590,7 +3596,7 @@ function ea(n) {
|
|
|
3590
3596
|
p = w.replace, x = w.with, y = w.withKlass || null;
|
|
3591
3597
|
}
|
|
3592
3598
|
const { ownNodeConfig: m } = Mr(p), N = p.getType(), b = p.transform(), C = /* @__PURE__ */ new Set();
|
|
3593
|
-
m && m.$transform && C.add(m.$transform), b !== null && C.add(b), g.set(N, { exportDOM: d && d.export ? d.export.get(p) : void 0, klass: p, replace: x, replaceWithKlass: y, sharedNodeState:
|
|
3599
|
+
m && m.$transform && C.add(m.$transform), b !== null && C.add(b), g.set(N, { exportDOM: d && d.export ? d.export.get(p) : void 0, klass: p, replace: x, replaceWithKlass: y, sharedNodeState: fo(c[_]), transforms: C });
|
|
3594
3600
|
}
|
|
3595
3601
|
}
|
|
3596
3602
|
const h = new Cn(o, i, g, { disableEvents: s, namespace: l, theme: r }, u || console.error, function(_, p) {
|
|
@@ -3612,7 +3618,7 @@ function ea(n) {
|
|
|
3612
3618
|
}
|
|
3613
3619
|
class Cn {
|
|
3614
3620
|
constructor(e, t, r, i, s, o, l, a) {
|
|
3615
|
-
this._createEditorArgs = a, this._parentEditor = t, this._rootElement = null, this._editorState = e, this._pendingEditorState = null, this._compositionKey = null, this._deferred = [], this._keyToDOMMap = /* @__PURE__ */ new Map(), this._updates = [], this._updating = !1, this._listeners = { decorator: /* @__PURE__ */ new Set(), editable: /* @__PURE__ */ new Set(), mutation: /* @__PURE__ */ new Map(), root: /* @__PURE__ */ new Set(), textcontent: /* @__PURE__ */ new Set(), update: /* @__PURE__ */ new Set() }, this._commands = /* @__PURE__ */ new Map(), this._config = i, this._nodes = r, this._decorators = {}, this._pendingDecorators = null, this._dirtyType = We, this._cloneNotNeeded = /* @__PURE__ */ new Set(), this._dirtyLeaves = /* @__PURE__ */ new Set(), this._dirtyElements = /* @__PURE__ */ new Map(), this._normalizedNodes = /* @__PURE__ */ new Set(), this._updateTags = /* @__PURE__ */ new Set(), this._observer = null, this._key =
|
|
3621
|
+
this._createEditorArgs = a, this._parentEditor = t, this._rootElement = null, this._editorState = e, this._pendingEditorState = null, this._compositionKey = null, this._deferred = [], this._keyToDOMMap = /* @__PURE__ */ new Map(), this._updates = [], this._updating = !1, this._listeners = { decorator: /* @__PURE__ */ new Set(), editable: /* @__PURE__ */ new Set(), mutation: /* @__PURE__ */ new Map(), root: /* @__PURE__ */ new Set(), textcontent: /* @__PURE__ */ new Set(), update: /* @__PURE__ */ new Set() }, this._commands = /* @__PURE__ */ new Map(), this._config = i, this._nodes = r, this._decorators = {}, this._pendingDecorators = null, this._dirtyType = We, this._cloneNotNeeded = /* @__PURE__ */ new Set(), this._dirtyLeaves = /* @__PURE__ */ new Set(), this._dirtyElements = /* @__PURE__ */ new Map(), this._normalizedNodes = /* @__PURE__ */ new Set(), this._updateTags = /* @__PURE__ */ new Set(), this._observer = null, this._key = Fs(), this._onError = s, this._htmlConversions = o, this._editable = l, this._headless = t !== null && t._headless, this._window = null, this._blockCursorElement = null;
|
|
3616
3622
|
}
|
|
3617
3623
|
isComposing() {
|
|
3618
3624
|
return this._compositionKey != null;
|
|
@@ -3703,7 +3709,7 @@ class Cn {
|
|
|
3703
3709
|
const f = U(d);
|
|
3704
3710
|
f && f.markDirty();
|
|
3705
3711
|
}
|
|
3706
|
-
}, o._pendingEditorState === null ? { tag:
|
|
3712
|
+
}, o._pendingEditorState === null ? { tag: Kn } : void 0);
|
|
3707
3713
|
}(this, i.map((o) => o.klass.getType())), () => {
|
|
3708
3714
|
i.forEach((o) => o.transforms.delete(t));
|
|
3709
3715
|
};
|
|
@@ -3730,12 +3736,12 @@ class Cn {
|
|
|
3730
3736
|
const t = this._rootElement;
|
|
3731
3737
|
if (e !== t) {
|
|
3732
3738
|
const r = nt(this._config.theme, "root"), i = this._pendingEditorState || this._editorState;
|
|
3733
|
-
if (this._rootElement = e,
|
|
3739
|
+
if (this._rootElement = e, Ts(this, t, e, i), t !== null && (this._config.disableEvents || zo(t), r != null && t.classList.remove(...r)), e !== null) {
|
|
3734
3740
|
const s = Er(e), o = e.style;
|
|
3735
|
-
o.userSelect = "text", o.whiteSpace = "pre-wrap", o.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = s, this._dirtyType = it, Ji(this), this._updateTags.add(
|
|
3741
|
+
o.userSelect = "text", o.whiteSpace = "pre-wrap", o.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = s, this._dirtyType = it, Ji(this), this._updateTags.add(Kn), Se(this), this._config.disableEvents || function(l, a) {
|
|
3736
3742
|
const c = l.ownerDocument, u = un.get(c);
|
|
3737
|
-
(u === void 0 || u < 1) && c.addEventListener("selectionchange",
|
|
3738
|
-
const d =
|
|
3743
|
+
(u === void 0 || u < 1) && c.addEventListener("selectionchange", cs), un.set(c, (u || 0) + 1), l.__lexicalEditor = a;
|
|
3744
|
+
const d = as(l);
|
|
3739
3745
|
for (let f = 0; f < Zn.length; f++) {
|
|
3740
3746
|
const [g, h] = Zn[f], _ = typeof h == "function" ? (p) => {
|
|
3741
3747
|
ei(p) || (Zr(p), (a.isEditable() || g === "click") && h(p, a));
|
|
@@ -3745,23 +3751,23 @@ class Cn {
|
|
|
3745
3751
|
const x = a.isEditable();
|
|
3746
3752
|
switch (g) {
|
|
3747
3753
|
case "cut":
|
|
3748
|
-
return x && E(a,
|
|
3754
|
+
return x && E(a, ts, p);
|
|
3749
3755
|
case "copy":
|
|
3750
|
-
return E(a,
|
|
3756
|
+
return E(a, es, p);
|
|
3751
3757
|
case "paste":
|
|
3752
|
-
return x && E(a,
|
|
3758
|
+
return x && E(a, Xi, p);
|
|
3753
3759
|
case "dragstart":
|
|
3754
|
-
return x && E(a, Oo, p);
|
|
3755
|
-
case "dragover":
|
|
3756
3760
|
return x && E(a, Ao, p);
|
|
3757
|
-
case "
|
|
3761
|
+
case "dragover":
|
|
3758
3762
|
return x && E(a, Do, p);
|
|
3759
|
-
case "
|
|
3763
|
+
case "dragend":
|
|
3760
3764
|
return x && E(a, Po, p);
|
|
3761
|
-
case "
|
|
3765
|
+
case "focus":
|
|
3762
3766
|
return x && E(a, Fo, p);
|
|
3767
|
+
case "blur":
|
|
3768
|
+
return x && E(a, Lo, p);
|
|
3763
3769
|
case "drop":
|
|
3764
|
-
return x && E(a,
|
|
3770
|
+
return x && E(a, Oo, p);
|
|
3765
3771
|
}
|
|
3766
3772
|
};
|
|
3767
3773
|
l.addEventListener(g, _), d.push(() => {
|
|
@@ -3769,7 +3775,7 @@ class Cn {
|
|
|
3769
3775
|
});
|
|
3770
3776
|
}
|
|
3771
3777
|
}(e, this), r != null && e.classList.add(...r);
|
|
3772
|
-
} else this._window = null, this._updateTags.add(
|
|
3778
|
+
} else this._window = null, this._updateTags.add(Kn), Se(this);
|
|
3773
3779
|
Ct("root", this, !1, e, t);
|
|
3774
3780
|
}
|
|
3775
3781
|
}
|
|
@@ -3782,7 +3788,7 @@ class Cn {
|
|
|
3782
3788
|
setEditorState(e, t) {
|
|
3783
3789
|
e.isEmpty() && T(38);
|
|
3784
3790
|
let r = e;
|
|
3785
|
-
r._readOnly && (r =
|
|
3791
|
+
r._readOnly && (r = vs(e), r._selection = e._selection ? e._selection.clone() : null), Wi(this);
|
|
3786
3792
|
const i = this._pendingEditorState, s = this._updateTags, o = t !== void 0 ? t.tag : null;
|
|
3787
3793
|
i === null || i.isEmpty() || (o != null && s.add(o), Se(this)), this._pendingEditorState = r, this._dirtyType = it, this._dirtyElements.set("root", !1), this._compositionKey = null, o != null && s.add(o), this._updating || Se(this);
|
|
3788
3794
|
}
|
|
@@ -3813,7 +3819,7 @@ class Cn {
|
|
|
3813
3819
|
const r = this._rootElement;
|
|
3814
3820
|
r !== null && (r.setAttribute("autocapitalize", "off"), te(this, () => {
|
|
3815
3821
|
const i = L(), s = re();
|
|
3816
|
-
i !== null ? i.dirty || ie(i.clone()) : s.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? s.selectStart() : s.selectEnd()),
|
|
3822
|
+
i !== null ? i.dirty || ie(i.clone()) : s.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? s.selectStart() : s.selectEnd()), ol("focus"), ll(() => {
|
|
3817
3823
|
r.removeAttribute("autocapitalize"), e && e();
|
|
3818
3824
|
});
|
|
3819
3825
|
}), this._pendingEditorState === null && r.removeAttribute("autocapitalize"));
|
|
@@ -3834,35 +3840,35 @@ class Cn {
|
|
|
3834
3840
|
return { editorState: this._editorState.toJSON() };
|
|
3835
3841
|
}
|
|
3836
3842
|
}
|
|
3837
|
-
Cn.version = "0.33.
|
|
3843
|
+
Cn.version = "0.33.1+prod.esm";
|
|
3838
3844
|
let rr = null;
|
|
3839
3845
|
function Sr(n) {
|
|
3840
3846
|
rr = n;
|
|
3841
3847
|
}
|
|
3842
|
-
let
|
|
3843
|
-
function
|
|
3844
|
-
const t =
|
|
3848
|
+
let tl = 1;
|
|
3849
|
+
function Ns(n, e) {
|
|
3850
|
+
const t = bs(n, e);
|
|
3845
3851
|
return t === void 0 && T(30, e), t;
|
|
3846
3852
|
}
|
|
3847
|
-
function
|
|
3853
|
+
function bs(n, e) {
|
|
3848
3854
|
return n._nodes.get(e);
|
|
3849
3855
|
}
|
|
3850
|
-
const
|
|
3856
|
+
const nl = typeof queueMicrotask == "function" ? queueMicrotask : (n) => {
|
|
3851
3857
|
Promise.resolve().then(n);
|
|
3852
3858
|
};
|
|
3853
3859
|
function Si(n) {
|
|
3854
|
-
return
|
|
3860
|
+
return K(kr(n));
|
|
3855
3861
|
}
|
|
3856
|
-
function
|
|
3862
|
+
function ws(n) {
|
|
3857
3863
|
const e = document.activeElement;
|
|
3858
3864
|
if (!ee(e)) return !1;
|
|
3859
3865
|
const t = e.nodeName;
|
|
3860
|
-
return
|
|
3866
|
+
return K(kr(n)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" && vn(e) == null);
|
|
3861
3867
|
}
|
|
3862
3868
|
function Sn(n, e, t) {
|
|
3863
3869
|
const r = n.getRootElement();
|
|
3864
3870
|
try {
|
|
3865
|
-
return r !== null && r.contains(e) && r.contains(t) && e !== null && !
|
|
3871
|
+
return r !== null && r.contains(e) && r.contains(t) && e !== null && !ws(e) && Es(e) === n;
|
|
3866
3872
|
} catch {
|
|
3867
3873
|
return !1;
|
|
3868
3874
|
}
|
|
@@ -3870,7 +3876,7 @@ function Sn(n, e, t) {
|
|
|
3870
3876
|
function vr(n) {
|
|
3871
3877
|
return n instanceof Cn;
|
|
3872
3878
|
}
|
|
3873
|
-
function
|
|
3879
|
+
function Es(n) {
|
|
3874
3880
|
let e = n;
|
|
3875
3881
|
for (; e != null; ) {
|
|
3876
3882
|
const t = vn(e);
|
|
@@ -3882,18 +3888,18 @@ function ws(n) {
|
|
|
3882
3888
|
function vn(n) {
|
|
3883
3889
|
return n ? n.__lexicalEditor : null;
|
|
3884
3890
|
}
|
|
3885
|
-
function
|
|
3886
|
-
return
|
|
3891
|
+
function Ke(n) {
|
|
3892
|
+
return ds(n) || n.isToken();
|
|
3887
3893
|
}
|
|
3888
3894
|
function be(n) {
|
|
3889
|
-
return
|
|
3895
|
+
return Ke(n) || n.isSegmented();
|
|
3890
3896
|
}
|
|
3891
3897
|
function Te(n) {
|
|
3892
|
-
return It(n) && n.nodeType === Us;
|
|
3893
|
-
}
|
|
3894
|
-
function nl(n) {
|
|
3895
3898
|
return It(n) && n.nodeType === Vs;
|
|
3896
3899
|
}
|
|
3900
|
+
function rl(n) {
|
|
3901
|
+
return It(n) && n.nodeType === Ys;
|
|
3902
|
+
}
|
|
3897
3903
|
function st(n) {
|
|
3898
3904
|
let e = n;
|
|
3899
3905
|
for (; e != null; ) {
|
|
@@ -3908,17 +3914,17 @@ function hn(n, e, t) {
|
|
|
3908
3914
|
let i = n ^ r;
|
|
3909
3915
|
return e === "subscript" ? i &= -65 : e === "superscript" ? i &= -33 : e === "lowercase" ? (i &= -513, i &= -1025) : e === "uppercase" ? (i &= -257, i &= -1025) : e === "capitalize" && (i &= -257, i &= -513), i;
|
|
3910
3916
|
}
|
|
3911
|
-
function
|
|
3912
|
-
return M(n) || tt(n) ||
|
|
3917
|
+
function na(n) {
|
|
3918
|
+
return M(n) || tt(n) || K(n);
|
|
3913
3919
|
}
|
|
3914
|
-
function
|
|
3920
|
+
function Ms(n, e) {
|
|
3915
3921
|
const t = function() {
|
|
3916
3922
|
const o = rr;
|
|
3917
3923
|
return rr = null, o;
|
|
3918
3924
|
}();
|
|
3919
3925
|
if ((e = e || t && t.__key) != null) return void (n.__key = e);
|
|
3920
|
-
G(),
|
|
3921
|
-
const r = R(), i = Pe(), s = "" +
|
|
3926
|
+
G(), ms();
|
|
3927
|
+
const r = R(), i = Pe(), s = "" + tl++;
|
|
3922
3928
|
i._nodeMap.set(s, n), v(n) ? r._dirtyElements.set(s, !0) : r._dirtyLeaves.add(s), r._cloneNotNeeded.add(s), r._dirtyType = Ii, n.__key = s;
|
|
3923
3929
|
}
|
|
3924
3930
|
function Be(n) {
|
|
@@ -3929,7 +3935,7 @@ function Be(n) {
|
|
|
3929
3935
|
}
|
|
3930
3936
|
}
|
|
3931
3937
|
function gn(n) {
|
|
3932
|
-
|
|
3938
|
+
ms();
|
|
3933
3939
|
const e = n.getLatest(), t = e.__parent, r = Pe(), i = R(), s = r._nodeMap, o = i._dirtyElements;
|
|
3934
3940
|
t !== null && function(a, c, u) {
|
|
3935
3941
|
let d = a;
|
|
@@ -3943,7 +3949,7 @@ function gn(n) {
|
|
|
3943
3949
|
const l = e.__key;
|
|
3944
3950
|
i._dirtyType = Ii, v(n) ? o.set(l, !0) : i._dirtyLeaves.add(l);
|
|
3945
3951
|
}
|
|
3946
|
-
function
|
|
3952
|
+
function Y(n) {
|
|
3947
3953
|
G();
|
|
3948
3954
|
const e = R(), t = e._compositionKey;
|
|
3949
3955
|
if (n !== t) {
|
|
@@ -3964,7 +3970,7 @@ function U(n, e) {
|
|
|
3964
3970
|
const t = (e || Pe())._nodeMap.get(n);
|
|
3965
3971
|
return t === void 0 ? null : t;
|
|
3966
3972
|
}
|
|
3967
|
-
function
|
|
3973
|
+
function Os(n, e) {
|
|
3968
3974
|
const t = kn(n, R());
|
|
3969
3975
|
return t !== void 0 ? U(t, e) : null;
|
|
3970
3976
|
}
|
|
@@ -3974,13 +3980,13 @@ function kn(n, e) {
|
|
|
3974
3980
|
function kr(n, e) {
|
|
3975
3981
|
let t = n;
|
|
3976
3982
|
for (; t != null; ) {
|
|
3977
|
-
const r =
|
|
3983
|
+
const r = Os(t, e);
|
|
3978
3984
|
if (r !== null) return r;
|
|
3979
3985
|
t = Lt(t);
|
|
3980
3986
|
}
|
|
3981
3987
|
return null;
|
|
3982
3988
|
}
|
|
3983
|
-
function
|
|
3989
|
+
function As(n) {
|
|
3984
3990
|
const e = n._decorators, t = Object.assign({}, e);
|
|
3985
3991
|
return n._pendingDecorators = t, t;
|
|
3986
3992
|
}
|
|
@@ -3988,9 +3994,9 @@ function vi(n) {
|
|
|
3988
3994
|
return n.read(() => re().getTextContent());
|
|
3989
3995
|
}
|
|
3990
3996
|
function re() {
|
|
3991
|
-
return
|
|
3997
|
+
return Ds(Pe());
|
|
3992
3998
|
}
|
|
3993
|
-
function
|
|
3999
|
+
function Ds(n) {
|
|
3994
4000
|
return n._nodeMap.get("root");
|
|
3995
4001
|
}
|
|
3996
4002
|
function ie(n) {
|
|
@@ -4013,7 +4019,7 @@ function Ze(n) {
|
|
|
4013
4019
|
function ki(n, e) {
|
|
4014
4020
|
return e ? n.getTextContentSize() : 0;
|
|
4015
4021
|
}
|
|
4016
|
-
function
|
|
4022
|
+
function Ps(n) {
|
|
4017
4023
|
return /[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n);
|
|
4018
4024
|
}
|
|
4019
4025
|
function Tr(n) {
|
|
@@ -4022,10 +4028,10 @@ function Tr(n) {
|
|
|
4022
4028
|
for (; t !== null; ) e.push(t), t = t._parentEditor;
|
|
4023
4029
|
return e;
|
|
4024
4030
|
}
|
|
4025
|
-
function
|
|
4031
|
+
function Fs() {
|
|
4026
4032
|
return Math.random().toString(36).replace(/[^a-z]+/g, "").substring(0, 5);
|
|
4027
4033
|
}
|
|
4028
|
-
function
|
|
4034
|
+
function Ls(n) {
|
|
4029
4035
|
return Te(n) ? n.nodeValue : null;
|
|
4030
4036
|
}
|
|
4031
4037
|
function Nr(n, e, t) {
|
|
@@ -4034,7 +4040,7 @@ function Nr(n, e, t) {
|
|
|
4034
4040
|
const i = r.anchorNode;
|
|
4035
4041
|
let { anchorOffset: s, focusOffset: o } = r;
|
|
4036
4042
|
if (i !== null) {
|
|
4037
|
-
let l =
|
|
4043
|
+
let l = Ls(i);
|
|
4038
4044
|
const a = kr(i);
|
|
4039
4045
|
if (l !== null && M(a)) {
|
|
4040
4046
|
if (l === _n && t) {
|
|
@@ -4054,7 +4060,7 @@ function br(n, e, t, r, i) {
|
|
|
4054
4060
|
const a = s.getTextContent();
|
|
4055
4061
|
if (i || l !== a) {
|
|
4056
4062
|
if (l === "") {
|
|
4057
|
-
if (
|
|
4063
|
+
if (Y(null), vt || rt || Zt) s.remove();
|
|
4058
4064
|
else {
|
|
4059
4065
|
const _ = R();
|
|
4060
4066
|
setTimeout(() => {
|
|
@@ -4081,11 +4087,11 @@ function $t(n, e, t) {
|
|
|
4081
4087
|
const r = e[t] || !1;
|
|
4082
4088
|
return r === "any" || r === n[t];
|
|
4083
4089
|
}
|
|
4084
|
-
function
|
|
4090
|
+
function il(n, e) {
|
|
4085
4091
|
return $t(n, e, "altKey") && $t(n, e, "ctrlKey") && $t(n, e, "shiftKey") && $t(n, e, "metaKey");
|
|
4086
4092
|
}
|
|
4087
4093
|
function I(n, e, t) {
|
|
4088
|
-
return
|
|
4094
|
+
return il(n, t) && n.key.toLowerCase() === e.toLowerCase();
|
|
4089
4095
|
}
|
|
4090
4096
|
const xe = { ctrlKey: !fe, metaKey: fe }, Ti = { altKey: fe, ctrlKey: !fe };
|
|
4091
4097
|
function Ni(n) {
|
|
@@ -4094,7 +4100,7 @@ function Ni(n) {
|
|
|
4094
4100
|
function bi(n) {
|
|
4095
4101
|
return I(n, "a", xe);
|
|
4096
4102
|
}
|
|
4097
|
-
function
|
|
4103
|
+
function ra(n) {
|
|
4098
4104
|
const e = re();
|
|
4099
4105
|
if (A(n)) {
|
|
4100
4106
|
const t = n.anchor, r = n.focus, i = t.getNode().getTopLevelElementOrThrow().getParentOrThrow();
|
|
@@ -4131,7 +4137,7 @@ function wi(n, e, t) {
|
|
|
4131
4137
|
let i = t, s = n;
|
|
4132
4138
|
return r !== null && (e && t === 0 ? (i = s.getIndexWithinParent(), s = r) : e || t !== s.getChildrenSize() || (i = s.getIndexWithinParent() + 1, s = r)), s.getChildAtIndex(e ? i - 1 : i);
|
|
4133
4139
|
}
|
|
4134
|
-
function
|
|
4140
|
+
function sl(n, e) {
|
|
4135
4141
|
const t = n.offset;
|
|
4136
4142
|
if (n.type === "element")
|
|
4137
4143
|
return wi(n.getNode(), e, t);
|
|
@@ -4144,7 +4150,7 @@ function il(n, e) {
|
|
|
4144
4150
|
}
|
|
4145
4151
|
return null;
|
|
4146
4152
|
}
|
|
4147
|
-
function
|
|
4153
|
+
function Is(n) {
|
|
4148
4154
|
const e = oe(n).event, t = e && e.inputType;
|
|
4149
4155
|
return t === "insertFromPaste" || t === "insertFromPasteAsQuotation";
|
|
4150
4156
|
}
|
|
@@ -4176,15 +4182,15 @@ function ot(n, e) {
|
|
|
4176
4182
|
}
|
|
4177
4183
|
function Lt(n) {
|
|
4178
4184
|
const e = n.assignedSlot || n.parentElement;
|
|
4179
|
-
return
|
|
4185
|
+
return dl(e) ? e.host : e;
|
|
4180
4186
|
}
|
|
4181
|
-
function
|
|
4182
|
-
return
|
|
4187
|
+
function zs(n) {
|
|
4188
|
+
return rl(n) ? n : ee(n) ? n.ownerDocument : null;
|
|
4183
4189
|
}
|
|
4184
|
-
function
|
|
4190
|
+
function ol(n) {
|
|
4185
4191
|
G(), R()._updateTags.add(n);
|
|
4186
4192
|
}
|
|
4187
|
-
function
|
|
4193
|
+
function ll(n) {
|
|
4188
4194
|
G(), R()._deferred.push(n);
|
|
4189
4195
|
}
|
|
4190
4196
|
function ir(n, e) {
|
|
@@ -4196,17 +4202,17 @@ function ir(n, e) {
|
|
|
4196
4202
|
return !1;
|
|
4197
4203
|
}
|
|
4198
4204
|
function Er(n) {
|
|
4199
|
-
const e =
|
|
4205
|
+
const e = zs(n);
|
|
4200
4206
|
return e ? e.defaultView : null;
|
|
4201
4207
|
}
|
|
4202
4208
|
function oe(n) {
|
|
4203
4209
|
const e = n._window;
|
|
4204
4210
|
return e === null && T(78), e;
|
|
4205
4211
|
}
|
|
4206
|
-
function
|
|
4207
|
-
return v(n) && n.isInline() ||
|
|
4212
|
+
function ia(n) {
|
|
4213
|
+
return v(n) && n.isInline() || K(n) && n.isInline();
|
|
4208
4214
|
}
|
|
4209
|
-
function
|
|
4215
|
+
function al(n) {
|
|
4210
4216
|
let e = n.getParentOrThrow();
|
|
4211
4217
|
for (; e !== null; ) {
|
|
4212
4218
|
if (Fe(e)) return e;
|
|
@@ -4217,12 +4223,12 @@ function ll(n) {
|
|
|
4217
4223
|
function Fe(n) {
|
|
4218
4224
|
return ne(n) || v(n) && n.isShadowRoot();
|
|
4219
4225
|
}
|
|
4220
|
-
function
|
|
4226
|
+
function cl(n) {
|
|
4221
4227
|
const e = n.constructor.clone(n);
|
|
4222
|
-
return
|
|
4228
|
+
return Ms(e, null), e.afterCloneFrom(n), e;
|
|
4223
4229
|
}
|
|
4224
4230
|
function Nn(n) {
|
|
4225
|
-
const e = R(), t = n.getType(), r =
|
|
4231
|
+
const e = R(), t = n.getType(), r = bs(e, t);
|
|
4226
4232
|
r === void 0 && T(200, n.constructor.name, t);
|
|
4227
4233
|
const { replace: i, replaceWithKlass: s } = r;
|
|
4228
4234
|
if (i !== null) {
|
|
@@ -4232,14 +4238,14 @@ function Nn(n) {
|
|
|
4232
4238
|
return n;
|
|
4233
4239
|
}
|
|
4234
4240
|
function Bn(n, e) {
|
|
4235
|
-
!ne(n.getParent()) || v(e) ||
|
|
4241
|
+
!ne(n.getParent()) || v(e) || K(e) || T(99);
|
|
4236
4242
|
}
|
|
4237
|
-
function
|
|
4243
|
+
function ul(n) {
|
|
4238
4244
|
const e = U(n);
|
|
4239
4245
|
return e === null && T(63, n), e;
|
|
4240
4246
|
}
|
|
4241
4247
|
function Rn(n) {
|
|
4242
|
-
return (
|
|
4248
|
+
return (K(n) || v(n) && !n.canBeEmpty()) && !n.isInline();
|
|
4243
4249
|
}
|
|
4244
4250
|
function sr(n, e, t) {
|
|
4245
4251
|
t.style.removeProperty("caret-color"), e._blockCursorElement = null;
|
|
@@ -4249,23 +4255,23 @@ function sr(n, e, t) {
|
|
|
4249
4255
|
function ke(n) {
|
|
4250
4256
|
return ae ? (n || window).getSelection() : null;
|
|
4251
4257
|
}
|
|
4252
|
-
function
|
|
4258
|
+
function fl(n) {
|
|
4253
4259
|
const e = Er(n);
|
|
4254
4260
|
return e ? e.getSelection() : null;
|
|
4255
4261
|
}
|
|
4256
|
-
function
|
|
4262
|
+
function sa(n) {
|
|
4257
4263
|
return ee(n) && n.tagName === "A";
|
|
4258
4264
|
}
|
|
4259
4265
|
function ee(n) {
|
|
4260
|
-
return It(n) && n.nodeType ===
|
|
4266
|
+
return It(n) && n.nodeType === Us;
|
|
4261
4267
|
}
|
|
4262
4268
|
function It(n) {
|
|
4263
4269
|
return typeof n == "object" && n !== null && "nodeType" in n && typeof n.nodeType == "number";
|
|
4264
4270
|
}
|
|
4265
|
-
function
|
|
4271
|
+
function dl(n) {
|
|
4266
4272
|
return It(n) && n.nodeType === Hs;
|
|
4267
4273
|
}
|
|
4268
|
-
function
|
|
4274
|
+
function hl(n) {
|
|
4269
4275
|
const e = new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/, "i");
|
|
4270
4276
|
return n.nodeName.match(e) !== null;
|
|
4271
4277
|
}
|
|
@@ -4274,7 +4280,7 @@ function Ei(n) {
|
|
|
4274
4280
|
return n.nodeName.match(e) !== null;
|
|
4275
4281
|
}
|
|
4276
4282
|
function we(n) {
|
|
4277
|
-
if (
|
|
4283
|
+
if (K(n) && !n.isInline()) return !0;
|
|
4278
4284
|
if (!v(n) || Fe(n)) return !1;
|
|
4279
4285
|
const e = n.getFirstChild(), t = e === null || tt(e) || M(e) || e.isInline();
|
|
4280
4286
|
return !n.isInline() && n.canBeEmpty() !== !1 && t;
|
|
@@ -4284,12 +4290,12 @@ function Wn(n, e) {
|
|
|
4284
4290
|
for (; t !== null && t.getParent() !== null && !e(t); ) t = t.getParentOrThrow();
|
|
4285
4291
|
return e(t) ? t : null;
|
|
4286
4292
|
}
|
|
4287
|
-
function
|
|
4293
|
+
function gl() {
|
|
4288
4294
|
return R();
|
|
4289
4295
|
}
|
|
4290
|
-
const Mi = /* @__PURE__ */ new WeakMap(),
|
|
4296
|
+
const Mi = /* @__PURE__ */ new WeakMap(), _l = /* @__PURE__ */ new Map();
|
|
4291
4297
|
function Oi(n) {
|
|
4292
|
-
if (!n._readOnly && n.isEmpty()) return
|
|
4298
|
+
if (!n._readOnly && n.isEmpty()) return _l;
|
|
4293
4299
|
n._readOnly || T(192);
|
|
4294
4300
|
let e = Mi.get(n);
|
|
4295
4301
|
return e || (e = function(t) {
|
|
@@ -4302,18 +4308,18 @@ function Oi(n) {
|
|
|
4302
4308
|
return r;
|
|
4303
4309
|
}(n), Mi.set(n, e)), e;
|
|
4304
4310
|
}
|
|
4305
|
-
function
|
|
4311
|
+
function pl(n) {
|
|
4306
4312
|
const e = n.constructor.clone(n);
|
|
4307
4313
|
return e.afterCloneFrom(n), e;
|
|
4308
4314
|
}
|
|
4309
|
-
function
|
|
4315
|
+
function yl(n, e) {
|
|
4310
4316
|
const t = parseInt(n.style.paddingInlineStart, 10) || 0, r = Math.round(t / 40);
|
|
4311
4317
|
e.setIndent(r);
|
|
4312
4318
|
}
|
|
4313
|
-
function
|
|
4319
|
+
function oa(n) {
|
|
4314
4320
|
n.__lexicalUnmanaged = !0;
|
|
4315
4321
|
}
|
|
4316
|
-
function
|
|
4322
|
+
function ml(n) {
|
|
4317
4323
|
return n.__lexicalUnmanaged === !0;
|
|
4318
4324
|
}
|
|
4319
4325
|
function _t(n, e) {
|
|
@@ -4322,8 +4328,8 @@ function _t(n, e) {
|
|
|
4322
4328
|
}(n, e) && n[e] !== ct[e];
|
|
4323
4329
|
}
|
|
4324
4330
|
function Mr(n) {
|
|
4325
|
-
const e =
|
|
4326
|
-
return o ===
|
|
4331
|
+
const e = Kr in n.prototype ? n.prototype[Kr]() : void 0, t = /* @__PURE__ */ function(o) {
|
|
4332
|
+
return o === Ss || o === Dt || o === ct;
|
|
4327
4333
|
}(n), r = !t && _t(n, "getType") ? n.getType() : void 0;
|
|
4328
4334
|
let i, s = r;
|
|
4329
4335
|
if (e) if (r) i = e[r];
|
|
@@ -4334,19 +4340,19 @@ function Mr(n) {
|
|
|
4334
4340
|
}
|
|
4335
4341
|
return { ownNodeConfig: i, ownNodeType: s };
|
|
4336
4342
|
}
|
|
4337
|
-
const
|
|
4343
|
+
const xl = { next: "previous", previous: "next" };
|
|
4338
4344
|
class Or {
|
|
4339
4345
|
constructor(e) {
|
|
4340
4346
|
this.origin = e;
|
|
4341
4347
|
}
|
|
4342
4348
|
[Symbol.iterator]() {
|
|
4343
|
-
return
|
|
4349
|
+
return Bs({ hasNext: lt, initial: this.getAdjacentCaret(), map: (e) => e, step: (e) => e.getAdjacentCaret() });
|
|
4344
4350
|
}
|
|
4345
4351
|
getAdjacentCaret() {
|
|
4346
|
-
return
|
|
4352
|
+
return H(this.getNodeAtCaret(), this.direction);
|
|
4347
4353
|
}
|
|
4348
4354
|
getSiblingCaret() {
|
|
4349
|
-
return
|
|
4355
|
+
return H(this.origin, this.direction);
|
|
4350
4356
|
}
|
|
4351
4357
|
remove() {
|
|
4352
4358
|
const e = this.getNodeAtCaret();
|
|
@@ -4374,7 +4380,7 @@ class Or {
|
|
|
4374
4380
|
}
|
|
4375
4381
|
} else c === null && T(263, Array.from(l).join(" "));
|
|
4376
4382
|
} else s.insert(a);
|
|
4377
|
-
s =
|
|
4383
|
+
s = H(a, this.direction);
|
|
4378
4384
|
}
|
|
4379
4385
|
for (const a of l.values()) a.remove();
|
|
4380
4386
|
return this;
|
|
@@ -4387,11 +4393,11 @@ class wt extends Or {
|
|
|
4387
4393
|
return e === this.origin ? this : De(e, this.direction);
|
|
4388
4394
|
}
|
|
4389
4395
|
getParentCaret(e = "root") {
|
|
4390
|
-
return
|
|
4396
|
+
return H(Ar(this.getParentAtCaret(), e), this.direction);
|
|
4391
4397
|
}
|
|
4392
4398
|
getFlipped() {
|
|
4393
4399
|
const e = Xe(this.direction);
|
|
4394
|
-
return
|
|
4400
|
+
return H(this.getNodeAtCaret(), e) || De(this.origin, e);
|
|
4395
4401
|
}
|
|
4396
4402
|
getParentAtCaret() {
|
|
4397
4403
|
return this.origin;
|
|
@@ -4406,18 +4412,18 @@ class wt extends Or {
|
|
|
4406
4412
|
return this.isSameNodeCaret(e);
|
|
4407
4413
|
}
|
|
4408
4414
|
}
|
|
4409
|
-
const
|
|
4415
|
+
const Cl = { root: ne, shadowRoot: Fe };
|
|
4410
4416
|
function Xe(n) {
|
|
4411
|
-
return
|
|
4417
|
+
return xl[n];
|
|
4412
4418
|
}
|
|
4413
4419
|
function Ar(n, e = "root") {
|
|
4414
|
-
return
|
|
4420
|
+
return Cl[e](n) ? null : n;
|
|
4415
4421
|
}
|
|
4416
4422
|
class $e extends Or {
|
|
4417
4423
|
type = "sibling";
|
|
4418
4424
|
getLatest() {
|
|
4419
4425
|
const e = this.origin.getLatest();
|
|
4420
|
-
return e === this.origin ? this :
|
|
4426
|
+
return e === this.origin ? this : H(e, this.direction);
|
|
4421
4427
|
}
|
|
4422
4428
|
getSiblingCaret() {
|
|
4423
4429
|
return this;
|
|
@@ -4429,11 +4435,11 @@ class $e extends Or {
|
|
|
4429
4435
|
return v(this.origin) ? De(this.origin, this.direction) : null;
|
|
4430
4436
|
}
|
|
4431
4437
|
getParentCaret(e = "root") {
|
|
4432
|
-
return
|
|
4438
|
+
return H(Ar(this.getParentAtCaret(), e), this.direction);
|
|
4433
4439
|
}
|
|
4434
4440
|
getFlipped() {
|
|
4435
4441
|
const e = Xe(this.direction);
|
|
4436
|
-
return
|
|
4442
|
+
return H(this.getNodeAtCaret(), e) || De(this.origin.getParentOrThrow(), e);
|
|
4437
4443
|
}
|
|
4438
4444
|
isSamePointCaret(e) {
|
|
4439
4445
|
return e instanceof $e && this.direction === e.direction && this.origin.is(e.origin);
|
|
@@ -4458,7 +4464,7 @@ class Ue extends Or {
|
|
|
4458
4464
|
return null;
|
|
4459
4465
|
}
|
|
4460
4466
|
getParentCaret(e = "root") {
|
|
4461
|
-
return
|
|
4467
|
+
return H(Ar(this.getParentAtCaret(), e), this.direction);
|
|
4462
4468
|
}
|
|
4463
4469
|
getFlipped() {
|
|
4464
4470
|
return Ve(this.origin, Xe(this.direction), this.offset);
|
|
@@ -4470,7 +4476,7 @@ class Ue extends Or {
|
|
|
4470
4476
|
return (e instanceof $e || e instanceof Ue) && this.direction === e.direction && this.origin.is(e.origin);
|
|
4471
4477
|
}
|
|
4472
4478
|
getSiblingCaret() {
|
|
4473
|
-
return
|
|
4479
|
+
return H(this.origin, this.direction);
|
|
4474
4480
|
}
|
|
4475
4481
|
}
|
|
4476
4482
|
function Oe(n) {
|
|
@@ -4482,7 +4488,7 @@ function lt(n) {
|
|
|
4482
4488
|
function he(n) {
|
|
4483
4489
|
return n instanceof wt;
|
|
4484
4490
|
}
|
|
4485
|
-
const
|
|
4491
|
+
const Sl = { next: class extends Ue {
|
|
4486
4492
|
direction = "next";
|
|
4487
4493
|
getNodeAtCaret() {
|
|
4488
4494
|
return this.origin.getNextSibling();
|
|
@@ -4498,7 +4504,7 @@ const Cl = { next: class extends Ue {
|
|
|
4498
4504
|
insert(n) {
|
|
4499
4505
|
return this.origin.insertBefore(n), this;
|
|
4500
4506
|
}
|
|
4501
|
-
} },
|
|
4507
|
+
} }, vl = { next: class extends $e {
|
|
4502
4508
|
direction = "next";
|
|
4503
4509
|
getNodeAtCaret() {
|
|
4504
4510
|
return this.origin.getNextSibling();
|
|
@@ -4514,7 +4520,7 @@ const Cl = { next: class extends Ue {
|
|
|
4514
4520
|
insert(n) {
|
|
4515
4521
|
return this.origin.insertBefore(n), this;
|
|
4516
4522
|
}
|
|
4517
|
-
} },
|
|
4523
|
+
} }, kl = { next: class extends wt {
|
|
4518
4524
|
direction = "next";
|
|
4519
4525
|
getNodeAtCaret() {
|
|
4520
4526
|
return this.origin.getFirstChild();
|
|
@@ -4531,11 +4537,11 @@ const Cl = { next: class extends Ue {
|
|
|
4531
4537
|
return this.origin.splice(this.origin.getChildrenSize(), 0, [n]), this;
|
|
4532
4538
|
}
|
|
4533
4539
|
} };
|
|
4534
|
-
function
|
|
4535
|
-
return n ? new
|
|
4540
|
+
function H(n, e) {
|
|
4541
|
+
return n ? new vl[e](n) : null;
|
|
4536
4542
|
}
|
|
4537
4543
|
function Ve(n, e, t) {
|
|
4538
|
-
return n ? new
|
|
4544
|
+
return n ? new Sl[e](n, at(n, t)) : null;
|
|
4539
4545
|
}
|
|
4540
4546
|
function at(n, e) {
|
|
4541
4547
|
const t = n.getTextContentSize();
|
|
@@ -4548,16 +4554,16 @@ function at(n, e) {
|
|
|
4548
4554
|
}(284, String(e), String(t), n.getKey()), r = r < 0 ? 0 : t), r;
|
|
4549
4555
|
}
|
|
4550
4556
|
function Ai(n, e) {
|
|
4551
|
-
return new
|
|
4557
|
+
return new Nl(n, e);
|
|
4552
4558
|
}
|
|
4553
4559
|
function De(n, e) {
|
|
4554
|
-
return v(n) ? new
|
|
4560
|
+
return v(n) ? new kl[e](n) : null;
|
|
4555
4561
|
}
|
|
4556
|
-
function
|
|
4562
|
+
function Tl(n) {
|
|
4557
4563
|
return n && n.getChildCaret() || n;
|
|
4558
4564
|
}
|
|
4559
4565
|
function Dr(n) {
|
|
4560
|
-
return n &&
|
|
4566
|
+
return n && Tl(n.getAdjacentCaret());
|
|
4561
4567
|
}
|
|
4562
4568
|
class Pr {
|
|
4563
4569
|
type = "node-caret-range";
|
|
@@ -4587,13 +4593,13 @@ class Pr {
|
|
|
4587
4593
|
}
|
|
4588
4594
|
iterNodeCarets(e = "root") {
|
|
4589
4595
|
const t = Oe(this.anchor) ? this.anchor.getSiblingCaret() : this.anchor.getLatest(), r = this.focus.getLatest(), i = Oe(r), s = (o) => o.isSameNodeCaret(r) ? null : Dr(o) || o.getParentCaret(e);
|
|
4590
|
-
return
|
|
4596
|
+
return Bs({ hasNext: (o) => o !== null && !(i && r.isSameNodeCaret(o)), initial: t.isSameNodeCaret(r) ? null : s(t), map: (o) => o, step: s });
|
|
4591
4597
|
}
|
|
4592
4598
|
[Symbol.iterator]() {
|
|
4593
4599
|
return this.iterNodeCarets("root");
|
|
4594
4600
|
}
|
|
4595
4601
|
}
|
|
4596
|
-
class
|
|
4602
|
+
class Nl {
|
|
4597
4603
|
type = "slice";
|
|
4598
4604
|
constructor(e, t) {
|
|
4599
4605
|
this.caret = e, this.distance = t;
|
|
@@ -4615,15 +4621,15 @@ class Tl {
|
|
|
4615
4621
|
}
|
|
4616
4622
|
}
|
|
4617
4623
|
function Ks(n) {
|
|
4618
|
-
return
|
|
4624
|
+
return Ye(n, H(re(), n.direction));
|
|
4619
4625
|
}
|
|
4620
|
-
function
|
|
4621
|
-
return
|
|
4626
|
+
function bl(n) {
|
|
4627
|
+
return Ye(n, n);
|
|
4622
4628
|
}
|
|
4623
|
-
function
|
|
4629
|
+
function Ye(n, e) {
|
|
4624
4630
|
return n.direction !== e.direction && T(265), new Pr(n, e, n.direction);
|
|
4625
4631
|
}
|
|
4626
|
-
function
|
|
4632
|
+
function Bs(n) {
|
|
4627
4633
|
const { initial: e, hasNext: t, step: r, map: i } = n;
|
|
4628
4634
|
let s = e;
|
|
4629
4635
|
return { [Symbol.iterator]() {
|
|
@@ -4634,7 +4640,7 @@ function zs(n) {
|
|
|
4634
4640
|
return s = r(s), o;
|
|
4635
4641
|
} };
|
|
4636
4642
|
}
|
|
4637
|
-
function
|
|
4643
|
+
function Rs(n, e) {
|
|
4638
4644
|
const t = Gt(n.origin, e.origin);
|
|
4639
4645
|
switch (t === null && T(275, n.origin.getKey(), e.origin.getKey()), t.type) {
|
|
4640
4646
|
case "same": {
|
|
@@ -4648,10 +4654,10 @@ function Bs(n, e) {
|
|
|
4648
4654
|
case "descendant":
|
|
4649
4655
|
return e.type === "child" ? 1 : -1;
|
|
4650
4656
|
case "branch":
|
|
4651
|
-
return
|
|
4657
|
+
return Ws(t);
|
|
4652
4658
|
}
|
|
4653
4659
|
}
|
|
4654
|
-
function
|
|
4660
|
+
function Ws(n) {
|
|
4655
4661
|
const { a: e, b: t } = n, r = e.__key, i = t.__key;
|
|
4656
4662
|
let s = e, o = t;
|
|
4657
4663
|
for (; s && o; s = s.getNextSibling(), o = o.getNextSibling()) {
|
|
@@ -4676,42 +4682,42 @@ function Gt(n, e) {
|
|
|
4676
4682
|
}
|
|
4677
4683
|
return null;
|
|
4678
4684
|
}
|
|
4679
|
-
function
|
|
4680
|
-
const { type: t, key: r, offset: i } = n, s =
|
|
4681
|
-
return t === "text" ? (M(s) || T(266, s.getType(), r), Ve(s, e, i)) : (v(s) || T(267, s.getType(), r),
|
|
4685
|
+
function He(n, e) {
|
|
4686
|
+
const { type: t, key: r, offset: i } = n, s = ul(n.key);
|
|
4687
|
+
return t === "text" ? (M(s) || T(266, s.getType(), r), Ve(s, e, i)) : (v(s) || T(267, s.getType(), r), Ol(s, n.offset, e));
|
|
4682
4688
|
}
|
|
4683
4689
|
function Et(n, e) {
|
|
4684
4690
|
const { origin: t, direction: r } = e, i = r === "next";
|
|
4685
4691
|
Oe(e) ? n.set(t.getKey(), e.offset, "text") : lt(e) ? M(t) ? n.set(t.getKey(), at(t, r), "text") : n.set(t.getParentOrThrow().getKey(), t.getIndexWithinParent() + (i ? 1 : 0), "element") : (he(e) && v(t) || T(268), n.set(t.getKey(), i ? 0 : t.getChildrenSize(), "element"));
|
|
4686
4692
|
}
|
|
4687
|
-
function
|
|
4688
|
-
const e = L(), t = A(e) ? e :
|
|
4693
|
+
function wl(n) {
|
|
4694
|
+
const e = L(), t = A(e) ? e : Vo();
|
|
4689
4695
|
return Xt(t, n), ie(t), t;
|
|
4690
4696
|
}
|
|
4691
4697
|
function Xt(n, e) {
|
|
4692
4698
|
Et(n.anchor, e.anchor), Et(n.focus, e.focus);
|
|
4693
4699
|
}
|
|
4694
4700
|
function Pi(n) {
|
|
4695
|
-
const { anchor: e, focus: t } = n, r =
|
|
4696
|
-
return
|
|
4701
|
+
const { anchor: e, focus: t } = n, r = He(e, "next"), i = He(t, "next"), s = Rs(r, i) <= 0 ? "next" : "previous";
|
|
4702
|
+
return Ye(qe(r, s), qe(i, s));
|
|
4697
4703
|
}
|
|
4698
|
-
function
|
|
4699
|
-
const { direction: e, origin: t } = n, r =
|
|
4700
|
-
return r ?
|
|
4704
|
+
function zt(n) {
|
|
4705
|
+
const { direction: e, origin: t } = n, r = H(t, Xe(e)).getNodeAtCaret();
|
|
4706
|
+
return r ? H(r, e) : De(t.getParentOrThrow(), e);
|
|
4701
4707
|
}
|
|
4702
4708
|
function Fi(n, e = "root") {
|
|
4703
4709
|
const t = [n];
|
|
4704
|
-
for (let r = he(n) ? n.getParentCaret(e) : n.getSiblingCaret(); r !== null; r = r.getParentCaret(e)) t.push(
|
|
4710
|
+
for (let r = he(n) ? n.getParentCaret(e) : n.getSiblingCaret(); r !== null; r = r.getParentCaret(e)) t.push(zt(r));
|
|
4705
4711
|
return t;
|
|
4706
4712
|
}
|
|
4707
4713
|
function Jn(n) {
|
|
4708
4714
|
return !!n && n.origin.isAttached();
|
|
4709
4715
|
}
|
|
4710
|
-
function
|
|
4716
|
+
function El(n, e = "removeEmptySlices") {
|
|
4711
4717
|
if (n.isCollapsed()) return n;
|
|
4712
4718
|
const t = "root", r = "next";
|
|
4713
4719
|
let i = e;
|
|
4714
|
-
const s =
|
|
4720
|
+
const s = Js(n, r), o = Fi(s.anchor, t), l = Fi(s.focus.getFlipped(), t), a = /* @__PURE__ */ new Set(), c = [];
|
|
4715
4721
|
for (const h of s.iterNodeCarets(t)) if (he(h)) a.add(h.origin.getKey());
|
|
4716
4722
|
else if (lt(h)) {
|
|
4717
4723
|
const { origin: _ } = h;
|
|
@@ -4720,7 +4726,7 @@ function wl(n, e = "removeEmptySlices") {
|
|
|
4720
4726
|
for (const h of c) h.remove();
|
|
4721
4727
|
for (const h of s.getTextSlices()) {
|
|
4722
4728
|
if (!h) continue;
|
|
4723
|
-
const { origin: _ } = h.caret, p = _.getTextContentSize(), x =
|
|
4729
|
+
const { origin: _ } = h.caret, p = _.getTextContentSize(), x = zt(H(_, r)), y = _.getMode();
|
|
4724
4730
|
if (Math.abs(h.distance) === p && i === "removeEmptySlices" || y === "token" && h.distance !== 0) x.remove();
|
|
4725
4731
|
else if (h.distance !== 0) {
|
|
4726
4732
|
i = "removeEmptySlices";
|
|
@@ -4755,8 +4761,8 @@ function wl(n, e = "removeEmptySlices") {
|
|
|
4755
4761
|
for (C = 0; C < b && m[C] === N[C]; C++) ;
|
|
4756
4762
|
const w = (O, F) => {
|
|
4757
4763
|
let W;
|
|
4758
|
-
for (let
|
|
4759
|
-
const P = O[
|
|
4764
|
+
for (let z = C; z < O.length; z++) {
|
|
4765
|
+
const P = O[z];
|
|
4760
4766
|
if (Fe(P)) return;
|
|
4761
4767
|
!W && F(P) && (W = P);
|
|
4762
4768
|
}
|
|
@@ -4770,7 +4776,7 @@ function wl(n, e = "removeEmptySlices") {
|
|
|
4770
4776
|
}
|
|
4771
4777
|
const g = [u, d, ...o, ...l].find(Jn);
|
|
4772
4778
|
if (g)
|
|
4773
|
-
return
|
|
4779
|
+
return bl(qe(de(g), n.direction));
|
|
4774
4780
|
T(269, JSON.stringify(o.map((h) => h.origin.__key)));
|
|
4775
4781
|
}
|
|
4776
4782
|
function de(n) {
|
|
@@ -4787,16 +4793,16 @@ function de(n) {
|
|
|
4787
4793
|
const r = e.getAdjacentCaret();
|
|
4788
4794
|
return lt(r) && M(r.origin) ? Ve(r.origin, t, Xe(t)) : e;
|
|
4789
4795
|
}
|
|
4790
|
-
function
|
|
4796
|
+
function Ml(n) {
|
|
4791
4797
|
return Oe(n) && n.offset !== at(n.origin, n.direction);
|
|
4792
4798
|
}
|
|
4793
4799
|
function qe(n, e) {
|
|
4794
4800
|
return n.direction === e ? n : n.getFlipped();
|
|
4795
4801
|
}
|
|
4796
|
-
function
|
|
4797
|
-
return n.direction === e ? n :
|
|
4802
|
+
function Js(n, e) {
|
|
4803
|
+
return n.direction === e ? n : Ye(qe(n.focus, e), qe(n.anchor, e));
|
|
4798
4804
|
}
|
|
4799
|
-
function
|
|
4805
|
+
function Ol(n, e, t) {
|
|
4800
4806
|
let r = De(n, "next");
|
|
4801
4807
|
for (let i = 0; i < e; i++) {
|
|
4802
4808
|
const s = r.getAdjacentCaret();
|
|
@@ -4805,22 +4811,22 @@ function Ml(n, e, t) {
|
|
|
4805
4811
|
}
|
|
4806
4812
|
return qe(r, t);
|
|
4807
4813
|
}
|
|
4808
|
-
function
|
|
4814
|
+
function Al(n) {
|
|
4809
4815
|
const { origin: e, offset: t, direction: r } = n;
|
|
4810
4816
|
if (t === at(e, r)) return n.getSiblingCaret();
|
|
4811
|
-
if (t === at(e, Xe(r))) return
|
|
4817
|
+
if (t === at(e, Xe(r))) return zt(n.getSiblingCaret());
|
|
4812
4818
|
const [i] = e.splitText(t);
|
|
4813
|
-
return M(i) || T(281), qe(
|
|
4819
|
+
return M(i) || T(281), qe(H(i, "next"), r);
|
|
4814
4820
|
}
|
|
4815
|
-
function
|
|
4821
|
+
function Dl(n, e) {
|
|
4816
4822
|
return !0;
|
|
4817
4823
|
}
|
|
4818
|
-
function
|
|
4824
|
+
function la(n, { $copyElementNode: e = cl, $splitTextPointCaretNext: t = Al, rootMode: r = "shadowRoot", $shouldSplit: i = Dl } = {}) {
|
|
4819
4825
|
if (Oe(n)) return t(n);
|
|
4820
4826
|
const s = n.getParentCaret(r);
|
|
4821
4827
|
if (s) {
|
|
4822
4828
|
const { origin: o } = s;
|
|
4823
|
-
if (he(n) && (!o.canBeEmpty() || !i(o, "first"))) return
|
|
4829
|
+
if (he(n) && (!o.canBeEmpty() || !i(o, "first"))) return zt(s);
|
|
4824
4830
|
const l = function(a) {
|
|
4825
4831
|
const c = [];
|
|
4826
4832
|
for (let u = a.getAdjacentCaret(); u; u = u.getAdjacentCaret()) c.push(u.origin);
|
|
@@ -4831,127 +4837,127 @@ function oa(n, { $copyElementNode: e = al, $splitTextPointCaretNext: t = Ol, roo
|
|
|
4831
4837
|
return s;
|
|
4832
4838
|
}
|
|
4833
4839
|
export {
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4840
|
+
Ql as $,
|
|
4841
|
+
an as A,
|
|
4842
|
+
Me as B,
|
|
4843
|
+
cn as C,
|
|
4844
|
+
ko as D,
|
|
4845
|
+
$n as E,
|
|
4846
|
+
ft as F,
|
|
4847
|
+
ln as G,
|
|
4848
|
+
bo as H,
|
|
4849
|
+
Jl as I,
|
|
4844
4850
|
Xl as J,
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4851
|
+
Eo as K,
|
|
4852
|
+
ts as L,
|
|
4853
|
+
ie as M,
|
|
4854
|
+
ze as N,
|
|
4855
|
+
de as O,
|
|
4856
|
+
L as P,
|
|
4857
|
+
zl as Q,
|
|
4858
|
+
yt as R,
|
|
4859
|
+
U as S,
|
|
4860
|
+
ee as T,
|
|
4855
4861
|
Zl as U,
|
|
4856
|
-
|
|
4862
|
+
ea as V,
|
|
4857
4863
|
Gl as W,
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
+
Mo as X,
|
|
4865
|
+
Fo as Y,
|
|
4866
|
+
Gi as Z,
|
|
4867
|
+
A as _,
|
|
4868
|
+
Hr as a,
|
|
4869
|
+
Es as a$,
|
|
4864
4870
|
ke as a0,
|
|
4865
|
-
|
|
4866
|
-
|
|
4871
|
+
$l as a1,
|
|
4872
|
+
Vo as a2,
|
|
4867
4873
|
ne as a3,
|
|
4868
4874
|
ge as a4,
|
|
4869
|
-
|
|
4870
|
-
|
|
4875
|
+
He as a5,
|
|
4876
|
+
Ml as a6,
|
|
4871
4877
|
Ks as a7,
|
|
4872
4878
|
lt as a8,
|
|
4873
4879
|
he as a9,
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4880
|
+
hl as aA,
|
|
4881
|
+
pl as aB,
|
|
4882
|
+
bs as aC,
|
|
4883
|
+
dl as aD,
|
|
4878
4884
|
pr as aE,
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4885
|
+
es as aF,
|
|
4886
|
+
Ye as aG,
|
|
4887
|
+
Vl as aH,
|
|
4882
4888
|
Sn as aI,
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4889
|
+
ta as aJ,
|
|
4890
|
+
Kn as aK,
|
|
4891
|
+
No as aL,
|
|
4892
|
+
ws as aM,
|
|
4893
|
+
ql as aN,
|
|
4888
4894
|
Gr as aO,
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4895
|
+
ra as aP,
|
|
4896
|
+
Do as aQ,
|
|
4897
|
+
Ao as aR,
|
|
4898
|
+
Oo as aS,
|
|
4893
4899
|
Xn as aT,
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
+
Yt as aU,
|
|
4901
|
+
Il as aV,
|
|
4902
|
+
sl as aW,
|
|
4903
|
+
Ll as aX,
|
|
4904
|
+
Fl as aY,
|
|
4905
|
+
Ul as aZ,
|
|
4900
4906
|
qr as a_,
|
|
4901
|
-
|
|
4907
|
+
H as aa,
|
|
4902
4908
|
Dr as ab,
|
|
4903
4909
|
At as ac,
|
|
4904
4910
|
Je as ad,
|
|
4905
4911
|
Ft as ae,
|
|
4906
|
-
|
|
4912
|
+
Xi as af,
|
|
4907
4913
|
re as ag,
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4914
|
+
Bs as ah,
|
|
4915
|
+
wl as ai,
|
|
4916
|
+
bl as aj,
|
|
4911
4917
|
qe as ak,
|
|
4912
|
-
|
|
4918
|
+
la as al,
|
|
4913
4919
|
Oe as am,
|
|
4914
|
-
|
|
4920
|
+
K as an,
|
|
4915
4921
|
be as ao,
|
|
4916
4922
|
oi as ap,
|
|
4917
4923
|
we as aq,
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
+
mo as ar,
|
|
4925
|
+
Wl as as,
|
|
4926
|
+
Rl as at,
|
|
4927
|
+
Qi as au,
|
|
4928
|
+
Zi as av,
|
|
4929
|
+
Zo as aw,
|
|
4924
4930
|
bt as ax,
|
|
4925
|
-
|
|
4931
|
+
jl as ay,
|
|
4926
4932
|
Ei as az,
|
|
4927
|
-
|
|
4928
|
-
|
|
4933
|
+
na as b,
|
|
4934
|
+
Bl as b0,
|
|
4929
4935
|
Kl as b1,
|
|
4930
|
-
|
|
4936
|
+
Yl as b2,
|
|
4931
4937
|
Hl as b3,
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4938
|
+
sa as c,
|
|
4939
|
+
D as d,
|
|
4940
|
+
ia as e,
|
|
4941
|
+
Fe as f,
|
|
4942
|
+
Nn as g,
|
|
4943
|
+
tt as h,
|
|
4944
|
+
V as i,
|
|
4945
|
+
oa as j,
|
|
4946
|
+
gl as k,
|
|
4947
|
+
kr as l,
|
|
4948
|
+
Dt as m,
|
|
4949
|
+
yo as n,
|
|
4950
|
+
De as o,
|
|
4951
|
+
Pl as p,
|
|
4952
|
+
ut as q,
|
|
4953
|
+
It as r,
|
|
4954
|
+
M as s,
|
|
4955
|
+
To as t,
|
|
4956
|
+
So as u,
|
|
4957
|
+
Et as v,
|
|
4958
|
+
xo as w,
|
|
4959
|
+
v as x,
|
|
4960
|
+
yr as y,
|
|
4961
|
+
wo as z
|
|
4956
4962
|
};
|
|
4957
|
-
//# sourceMappingURL=Lexical.prod-
|
|
4963
|
+
//# sourceMappingURL=Lexical.prod-C7FcGFd7.js.map
|