@uva-glass/component-library 3.10.0 → 3.11.1
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-CWyHQUEM.js → Lexical.prod-D8x7Ii0F.js} +469 -469
- package/dist/{Lexical.prod-CWyHQUEM.js.map → Lexical.prod-D8x7Ii0F.js.map} +1 -1
- package/dist/{LexicalClipboard.prod-DbqSWANZ.js → LexicalClipboard.prod-D5GjiArS.js} +16 -16
- package/dist/{LexicalClipboard.prod-DbqSWANZ.js.map → LexicalClipboard.prod-D5GjiArS.js.map} +1 -1
- package/dist/{LexicalLink.prod-DbxnRszt.js → LexicalLink.prod-CkldFE8u.js} +60 -60
- package/dist/{LexicalLink.prod-DbxnRszt.js.map → LexicalLink.prod-CkldFE8u.js.map} +1 -1
- package/dist/{LexicalList.prod-pZmYrwOC.js → LexicalList.prod-CsVDXdmw.js} +215 -215
- package/dist/LexicalList.prod-CsVDXdmw.js.map +1 -0
- package/dist/LexicalSelection.prod-JQDTaUpX.js +90 -0
- package/dist/{LexicalSelection.prod-DkvWlcln.js.map → LexicalSelection.prod-JQDTaUpX.js.map} +1 -1
- package/dist/{LexicalTable.prod-C6duSS2P.js → LexicalTable.prod-rZbTmo9K.js} +125 -125
- package/dist/{LexicalTable.prod-C6duSS2P.js.map → LexicalTable.prod-rZbTmo9K.js.map} +1 -1
- package/dist/{LexicalUtils.prod-Dny9Fu94.js → LexicalUtils.prod-CpMJ4I9h.js} +6 -6
- package/dist/{LexicalUtils.prod-Dny9Fu94.js.map → LexicalUtils.prod-CpMJ4I9h.js.map} +1 -1
- package/dist/{SelectListbox.module-BD2qbcmZ.js → SelectListbox.module-ignbxWNU.js} +21 -21
- package/dist/SelectListbox.module-ignbxWNU.js.map +1 -0
- package/dist/{SortableProvider-Ck_XnBVq.js → SortableProvider-DZggDO3M.js} +20 -20
- package/dist/{SortableProvider-Ck_XnBVq.js.map → SortableProvider-DZggDO3M.js.map} +1 -1
- package/dist/{TablePlugin-Ba6PaBhf.js → TablePlugin-WOgWan8s.js} +36 -36
- package/dist/{TablePlugin-Ba6PaBhf.js.map → TablePlugin-WOgWan8s.js.map} +1 -1
- package/dist/assets/MultiSelectBox.css +1 -0
- package/dist/assets/SelectListbox.css +1 -1
- package/dist/client-EQRlhXX7.js +25200 -0
- package/dist/client-EQRlhXX7.js.map +1 -0
- package/dist/components/Accordion/Accordion.test.js +3 -3
- package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
- package/dist/components/ActionList/ActionList.test.js +3 -3
- package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
- package/dist/components/Attention/Attention.test.js +2 -2
- package/dist/components/Backdrop/Backdrop.test.js +2 -2
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/Button.test.js +2 -2
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.test.js +2 -2
- package/dist/components/Buttons/MenuButton.d.ts +1 -3
- package/dist/components/Buttons/MenuButton.js.map +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +1 -1
- package/dist/components/Buttons/MenuButton.test.js +2 -2
- package/dist/components/Card/Card.test.js +2 -2
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +2 -2
- package/dist/components/CheckboxButton/CheckboxButton.stories.js +1 -1
- package/dist/components/CheckboxButton/CheckboxButton.test.js +2 -2
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
- package/dist/components/CheckboxTree/CheckboxTree.js +3 -3
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -2
- package/dist/components/FormInput/FormInput.js +3 -3
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InputField/InputField.js +17 -17
- package/dist/components/InputField/InputField.stories.js +17 -17
- package/dist/components/Label/Label.test.js +2 -2
- package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +3 -3
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.d.ts +16 -0
- package/dist/components/MultiSelectBox/MultiSelectBox.js +191 -0
- package/dist/components/MultiSelectBox/MultiSelectBox.js.map +1 -0
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.d.ts +5 -0
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +31 -0
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js.map +1 -0
- package/dist/components/MultiSelectBox/MultiSelectBox.test.d.ts +0 -0
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +26 -0
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js.map +1 -0
- package/dist/components/MultiSelectBox/index.d.ts +1 -0
- package/dist/components/MultiSelectBox/index.js +5 -0
- package/dist/components/MultiSelectBox/index.js.map +1 -0
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/OverlayStepBar/OverlayStepBar.js +3 -3
- package/dist/components/PageOverlay/PageOverlay.stories.js +35 -35
- package/dist/components/PageOverlay/PageOverlay.stories.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +3 -3
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +3 -3
- package/dist/components/RadioButton/RadioButton.js +3 -3
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +3 -3
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +14 -14
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +23 -23
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +40 -40
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +3 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +5 -5
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/Providers/LanguageProvider.js +7 -7
- package/dist/components/RteEditor/RteEditor.js +327 -327
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/SelectProvider.js +10 -10
- package/dist/components/SelectListbox/components/SelectButton.js +1 -1
- package/dist/components/SelectListbox/components/SelectContainer.js +1 -1
- package/dist/components/SelectListbox/components/SelectOption.js +1 -1
- package/dist/components/SelectListbox/components/SelectOptionBox.js +1 -1
- package/dist/components/Sortable/Sortable.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/Sortable/SortableProvider.js +1 -1
- package/dist/components/Sortable/components/SortableContainer.js +1 -1
- package/dist/components/Sortable/components/SortableItem.js +15 -15
- package/dist/components/Sortable/sortableReducer.js +21 -21
- package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
- package/dist/components/TextArea/TextArea.js +2 -2
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +3 -3
- package/dist/components/Timeline/Timeline.test.js +5 -5
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +22 -22
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
- package/dist/components/hooks/useDebounce.js +4 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +53 -51
- package/dist/components/index.js.map +1 -1
- package/dist/{helpers-BUwfVZhW.js → helpers-E_SsILnP.js} +10 -10
- package/dist/{helpers-BUwfVZhW.js.map → helpers-E_SsILnP.js.map} +1 -1
- package/dist/{index-DXR-TB1d.js → index-BCvy9BiK.js} +1886 -1886
- package/dist/{index-DXR-TB1d.js.map → index-BCvy9BiK.js.map} +1 -1
- package/dist/{index-dmBn99rF.js → index-BqLi4tOb.js} +908 -908
- package/dist/{index-dmBn99rF.js.map → index-BqLi4tOb.js.map} +1 -1
- package/dist/{index-Ck15_vKo.js → index-CUap8sKR.js} +481 -481
- package/dist/{index-Ck15_vKo.js.map → index-CUap8sKR.js.map} +1 -1
- package/dist/{index-B3c5pcHk.js → index-DllfJcv4.js} +32 -32
- package/dist/{index-B3c5pcHk.js.map → index-DllfJcv4.js.map} +1 -1
- package/dist/index.js +53 -51
- package/dist/index.js.map +1 -1
- package/dist/{react-18-CcyoHPTJ.js → react-18-dpbWrd2-.js} +2 -2
- package/dist/{react-18-CcyoHPTJ.js.map → react-18-dpbWrd2-.js.map} +1 -1
- package/dist/{react.esm-CMg7bmSn.js → react.esm-CsMDid07.js} +4 -4
- package/dist/{react.esm-CMg7bmSn.js.map → react.esm-CsMDid07.js.map} +1 -1
- package/dist/setupTests.js +1 -1
- package/dist/storybook__react.d.js +3 -3
- package/dist/test-utils-ea_YDVtd.js +74 -0
- package/dist/test-utils-ea_YDVtd.js.map +1 -0
- package/package.json +17 -17
- package/dist/LexicalList.prod-pZmYrwOC.js.map +0 -1
- package/dist/LexicalSelection.prod-DkvWlcln.js +0 -90
- package/dist/SelectListbox.module-BD2qbcmZ.js.map +0 -1
- package/dist/client-CTOhtEms.js +0 -33
- package/dist/client-CTOhtEms.js.map +0 -1
- package/dist/test-utils-B2AIdiiO.js +0 -1148
- package/dist/test-utils-B2AIdiiO.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ps = Object.defineProperty;
|
|
2
2
|
var Fs = (n, e, t) => e in n ? Ps(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var re = (n, e, t) => Fs(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
function
|
|
4
|
+
function b(n, ...e) {
|
|
5
5
|
const t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
6
6
|
r.append("code", n);
|
|
7
7
|
for (const i of e) r.append("v", i);
|
|
@@ -20,7 +20,7 @@ function Li(n, e, t, r, i, s) {
|
|
|
20
20
|
let o = n.getFirstChild();
|
|
21
21
|
for (; o !== null; ) {
|
|
22
22
|
const l = o.__key;
|
|
23
|
-
o.__parent === e && (
|
|
23
|
+
o.__parent === e && (C(o) && Li(o, l, t, r, i, s), t.has(l) || s.delete(l), i.push(l)), o = o.getNextSibling();
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
const Gs = 100;
|
|
@@ -30,25 +30,25 @@ function Qs(n) {
|
|
|
30
30
|
}
|
|
31
31
|
function En(n, e, t) {
|
|
32
32
|
const r = n.nodeName === "BR", i = e.__lexicalLineBreak;
|
|
33
|
-
return i && (n === i || r && n.previousSibling === i) || r &&
|
|
33
|
+
return i && (n === i || r && n.previousSibling === i) || r && Cn(n, t) !== void 0;
|
|
34
34
|
}
|
|
35
35
|
function Xs(n, e, t) {
|
|
36
|
-
const r =
|
|
36
|
+
const r = ve(ie(t));
|
|
37
37
|
let i = null, s = null;
|
|
38
38
|
r !== null && r.anchorNode === n && (i = r.anchorOffset, s = r.focusOffset);
|
|
39
39
|
const o = n.nodeValue;
|
|
40
|
-
o !== null &&
|
|
40
|
+
o !== null && kr(e, o, i, s, !1);
|
|
41
41
|
}
|
|
42
42
|
function Ys(n, e, t) {
|
|
43
43
|
if (L(n)) {
|
|
44
44
|
const r = n.anchor.getNode();
|
|
45
45
|
if (r.is(t) && n.format !== r.getFormat()) return !1;
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return Ce(e) && t.isAttached();
|
|
48
48
|
}
|
|
49
49
|
function Zs(n, e, t, r) {
|
|
50
50
|
for (let i = n; i && !rl(i); i = At(i)) {
|
|
51
|
-
const s =
|
|
51
|
+
const s = Cn(i, e);
|
|
52
52
|
if (s !== void 0) {
|
|
53
53
|
const o = j(s, t);
|
|
54
54
|
if (o) return D(o) || !Y(i) ? void 0 : [i, o];
|
|
@@ -71,26 +71,26 @@ function Ai(n, e, t) {
|
|
|
71
71
|
const g = e[f], h = g.type, _ = g.target, p = Zs(_, n, l, o);
|
|
72
72
|
if (!p) continue;
|
|
73
73
|
const [x, m] = p;
|
|
74
|
-
if (h === "characterData") r && P(m) &&
|
|
74
|
+
if (h === "characterData") r && P(m) && Ce(_) && Ys(i, _, m) && Xs(_, m, n);
|
|
75
75
|
else if (h === "childList") {
|
|
76
76
|
c = !0;
|
|
77
77
|
const y = g.addedNodes;
|
|
78
78
|
for (let S = 0; S < y.length; S++) {
|
|
79
|
-
const N = y[S],
|
|
80
|
-
if (
|
|
79
|
+
const N = y[S], k = ps(N), v = N.parentNode;
|
|
80
|
+
if (v != null && N !== a && k === null && !En(N, v, n)) {
|
|
81
81
|
if (we) {
|
|
82
82
|
const F = (Y(N) ? N.innerText : null) || N.nodeValue;
|
|
83
83
|
F && (u += F);
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
v.removeChild(N);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const T = g.removedNodes, w = T.length;
|
|
89
89
|
if (w > 0) {
|
|
90
90
|
let S = 0;
|
|
91
91
|
for (let N = 0; N < w; N++) {
|
|
92
|
-
const
|
|
93
|
-
(En(
|
|
92
|
+
const k = T[N];
|
|
93
|
+
(En(k, _, n) || a === k) && (_.appendChild(k), S++);
|
|
94
94
|
}
|
|
95
95
|
w !== S && s.set(x, m);
|
|
96
96
|
}
|
|
@@ -108,7 +108,7 @@ function Ai(n, e, t) {
|
|
|
108
108
|
}
|
|
109
109
|
t.takeRecords();
|
|
110
110
|
}
|
|
111
|
-
i !== null && (c && ne(i), we &&
|
|
111
|
+
i !== null && (c && ne(i), we && Cs(n) && i.insertRawText(u));
|
|
112
112
|
});
|
|
113
113
|
} finally {
|
|
114
114
|
Kn = !1;
|
|
@@ -204,7 +204,7 @@ function Mr(n, e) {
|
|
|
204
204
|
}, h = (_, p) => {
|
|
205
205
|
const { unknownState: x } = _, m = p ? p.unknownState : void 0;
|
|
206
206
|
if (x) {
|
|
207
|
-
for (const [y,
|
|
207
|
+
for (const [y, T] of Object.entries(x)) if (!f.has(y) && (f.add(y), T !== (m ? m[y] : void 0))) return !0;
|
|
208
208
|
}
|
|
209
209
|
return !1;
|
|
210
210
|
};
|
|
@@ -251,22 +251,22 @@ function zr(n) {
|
|
|
251
251
|
n.set(r.__key, i ? r.getTextContentSize() : 0, "text", !0);
|
|
252
252
|
break;
|
|
253
253
|
}
|
|
254
|
-
if (!
|
|
254
|
+
if (!C(r)) break;
|
|
255
255
|
n.set(r.__key, i ? r.getChildrenSize() : 0, "element", !0);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
let Pe, Q,
|
|
258
|
+
let Pe, Q, vt, hn, jn, $n, We, oe, Un, Ct, R = "", G = "", ae = null, ce = "", ye = "", Ii = !1, kt = !1, jt = null;
|
|
259
259
|
function en(n, e) {
|
|
260
260
|
const t = We.get(n);
|
|
261
261
|
if (e !== null) {
|
|
262
262
|
const r = Hn(n);
|
|
263
263
|
r.parentNode === e && e.removeChild(r);
|
|
264
264
|
}
|
|
265
|
-
if (oe.has(n) || Q._keyToDOMMap.delete(n),
|
|
265
|
+
if (oe.has(n) || Q._keyToDOMMap.delete(n), C(t)) {
|
|
266
266
|
const r = nn(t, We);
|
|
267
267
|
Vn(r, 0, r.length - 1, null);
|
|
268
268
|
}
|
|
269
|
-
t !== void 0 &&
|
|
269
|
+
t !== void 0 && br(Ct, vt, hn, t, "destroyed");
|
|
270
270
|
}
|
|
271
271
|
function Vn(n, e, t, r) {
|
|
272
272
|
let i = e;
|
|
@@ -294,7 +294,7 @@ function zi(n, e) {
|
|
|
294
294
|
}
|
|
295
295
|
function tn(n, e) {
|
|
296
296
|
const t = oe.get(n);
|
|
297
|
-
t === void 0 &&
|
|
297
|
+
t === void 0 && b(60);
|
|
298
298
|
const r = t.createDOM(Pe, Q);
|
|
299
299
|
if (function(i, s, o) {
|
|
300
300
|
const l = o._keyToDOMMap;
|
|
@@ -302,7 +302,7 @@ function tn(n, e) {
|
|
|
302
302
|
const d = `__lexicalKey_${c._key}`;
|
|
303
303
|
a[d] = u;
|
|
304
304
|
})(s, o, i), l.set(i, s);
|
|
305
|
-
}(n, r, Q), P(t) ? r.setAttribute("data-lexical-text", "true") : D(t) && r.setAttribute("data-lexical-decorator", "true"),
|
|
305
|
+
}(n, r, Q), P(t) ? r.setAttribute("data-lexical-text", "true") : D(t) && r.setAttribute("data-lexical-decorator", "true"), C(t)) {
|
|
306
306
|
const i = t.__indent, s = t.__size;
|
|
307
307
|
if (i !== 0 && Di(r, i), s !== 0) {
|
|
308
308
|
const l = s - 1;
|
|
@@ -312,7 +312,7 @@ function tn(n, e) {
|
|
|
312
312
|
})(nn(t, oe), l, t, r);
|
|
313
313
|
}
|
|
314
314
|
const o = t.__format;
|
|
315
|
-
o !== 0 && zi(r, o), t.isInline() || Bi(null, t, r),
|
|
315
|
+
o !== 0 && zi(r, o), t.isInline() || Bi(null, t, r), kn(t) && (R += Se, ye += Se);
|
|
316
316
|
} else {
|
|
317
317
|
const i = t.getTextContent();
|
|
318
318
|
if (D(t)) {
|
|
@@ -321,7 +321,7 @@ function tn(n, e) {
|
|
|
321
321
|
} else P(t) && (t.isDirectionless() || (G += i));
|
|
322
322
|
R += i, ye += i;
|
|
323
323
|
}
|
|
324
|
-
return e !== null && e.insertChild(r),
|
|
324
|
+
return e !== null && e.insertChild(r), br(Ct, vt, hn, t, "created"), r;
|
|
325
325
|
}
|
|
326
326
|
function qn(n, e, t, r, i) {
|
|
327
327
|
const s = R;
|
|
@@ -332,7 +332,7 @@ function qn(n, e, t, r, i) {
|
|
|
332
332
|
const l = oe.get(n[o]);
|
|
333
333
|
l !== null && P(l) && (ae === null && (ae = l.getFormat()), ce === "" && (ce = l.getStyle()));
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
kn(e) && (R += Se), i.element.__lexicalTextContent = R, R = s + R;
|
|
336
336
|
}
|
|
337
337
|
function Br(n, e) {
|
|
338
338
|
if (n) {
|
|
@@ -376,7 +376,7 @@ function Wi(n, e) {
|
|
|
376
376
|
}
|
|
377
377
|
e.dir = s;
|
|
378
378
|
}
|
|
379
|
-
|
|
379
|
+
kt || (n.getWritable().__dir = s);
|
|
380
380
|
}
|
|
381
381
|
jt = s, e.__lexicalDirTextContent = G, e.__lexicalDir = s;
|
|
382
382
|
}
|
|
@@ -408,40 +408,40 @@ function no(n, e, t) {
|
|
|
408
408
|
P(h) && (ae === null && (ae = h.getFormat()), ce === "" && (ce = h.getStyle()));
|
|
409
409
|
} else {
|
|
410
410
|
const f = nn(s, We), g = nn(o, oe);
|
|
411
|
-
if (f.length !== c &&
|
|
411
|
+
if (f.length !== c && b(227), g.length !== u && b(228), c === 0) u !== 0 && qn(g, o, 0, u - 1, l);
|
|
412
412
|
else if (u === 0) {
|
|
413
413
|
if (c !== 0) {
|
|
414
414
|
const h = l.after == null && l.before == null && l.element.__lexicalLineBreak == null;
|
|
415
415
|
Vn(f, 0, c - 1, h ? null : d), h && (d.textContent = "");
|
|
416
416
|
}
|
|
417
417
|
} else (function(h, _, p, x, m, y) {
|
|
418
|
-
const
|
|
419
|
-
let S, N,
|
|
420
|
-
for (;
|
|
421
|
-
const I = _[
|
|
422
|
-
if (I === A)
|
|
418
|
+
const T = x - 1, w = m - 1;
|
|
419
|
+
let S, N, k = y.getFirstChild(), v = 0, F = 0;
|
|
420
|
+
for (; v <= T && F <= w; ) {
|
|
421
|
+
const I = _[v], A = p[F];
|
|
422
|
+
if (I === A) k = Pn(ht(A, y.element)), v++, F++;
|
|
423
423
|
else {
|
|
424
424
|
S === void 0 && (S = new Set(_)), N === void 0 && (N = new Set(p));
|
|
425
425
|
const $ = N.has(I), he = S.has(A);
|
|
426
426
|
if ($) if (he) {
|
|
427
427
|
const ge = it(Q, A);
|
|
428
|
-
ge ===
|
|
429
|
-
} else tn(A, y.withBefore(
|
|
430
|
-
else
|
|
428
|
+
ge === k ? k = Pn(ht(A, y.element)) : (y.withBefore(k).insertChild(ge), ht(A, y.element)), v++, F++;
|
|
429
|
+
} else tn(A, y.withBefore(k)), F++;
|
|
430
|
+
else k = Pn(Hn(I)), en(I, y.element), v++;
|
|
431
431
|
}
|
|
432
432
|
const z = oe.get(A);
|
|
433
433
|
z !== null && P(z) && (ae === null && (ae = z.getFormat()), ce === "" && (ce = z.getStyle()));
|
|
434
434
|
}
|
|
435
|
-
const O =
|
|
435
|
+
const O = v > T, W = F > w;
|
|
436
436
|
if (O && !W) {
|
|
437
437
|
const I = p[w + 1], A = I === void 0 ? null : Q.getElementByKey(I);
|
|
438
438
|
qn(p, h, F, w, y.withBefore(A));
|
|
439
|
-
} else W && !O && Vn(_,
|
|
439
|
+
} else W && !O && Vn(_, v, T, y.element);
|
|
440
440
|
})(o, f, g, c, u, l);
|
|
441
441
|
}
|
|
442
|
-
|
|
443
|
-
}(n, e, e.getDOMSlot(t)), Wi(e, t), i = e, ae == null || ae === i.__textFormat ||
|
|
444
|
-
ce === "" || ce === s.__textStyle ||
|
|
442
|
+
kn(o) && (R += Se), d.__lexicalTextContent = R, R = a + R;
|
|
443
|
+
}(n, e, e.getDOMSlot(t)), Wi(e, t), i = e, ae == null || ae === i.__textFormat || kt || i.setTextFormat(ae), function(s) {
|
|
444
|
+
ce === "" || ce === s.__textStyle || kt || s.setTextStyle(ce);
|
|
445
445
|
}(e), G = r;
|
|
446
446
|
}
|
|
447
447
|
function nn(n, e) {
|
|
@@ -449,17 +449,17 @@ function nn(n, e) {
|
|
|
449
449
|
let r = n.__first;
|
|
450
450
|
for (; r !== null; ) {
|
|
451
451
|
const i = e.get(r);
|
|
452
|
-
i === void 0 &&
|
|
452
|
+
i === void 0 && b(101), t.push(r), r = i.__next;
|
|
453
453
|
}
|
|
454
454
|
return t;
|
|
455
455
|
}
|
|
456
456
|
function ht(n, e) {
|
|
457
457
|
const t = We.get(n);
|
|
458
458
|
let r = oe.get(n);
|
|
459
|
-
t !== void 0 && r !== void 0 ||
|
|
459
|
+
t !== void 0 && r !== void 0 || b(61);
|
|
460
460
|
const i = Ii || $n.has(n) || jn.has(n), s = it(Q, n);
|
|
461
461
|
if (t === r && !i) {
|
|
462
|
-
if (
|
|
462
|
+
if (C(t)) {
|
|
463
463
|
const o = s.__lexicalTextContent;
|
|
464
464
|
o !== void 0 && (R += o, ye += o);
|
|
465
465
|
const l = s.__lexicalDirTextContent;
|
|
@@ -470,15 +470,15 @@ function ht(n, e) {
|
|
|
470
470
|
}
|
|
471
471
|
return s;
|
|
472
472
|
}
|
|
473
|
-
if (t !== r && i &&
|
|
473
|
+
if (t !== r && i && br(Ct, vt, hn, r, "updated"), r.updateDOM(t, s, Pe)) {
|
|
474
474
|
const o = tn(n, null);
|
|
475
|
-
return e === null &&
|
|
475
|
+
return e === null && b(62), e.replaceChild(o, s), en(n, null), o;
|
|
476
476
|
}
|
|
477
|
-
if (
|
|
477
|
+
if (C(t) && C(r)) {
|
|
478
478
|
const o = r.__indent;
|
|
479
479
|
o !== t.__indent && Di(s, o);
|
|
480
480
|
const l = r.__format;
|
|
481
|
-
l !== t.__format && zi(s, l), i && (no(t, r, s), ee(r) || r.isInline() || Bi(t, r, s)),
|
|
481
|
+
l !== t.__format && zi(s, l), i && (no(t, r, s), ee(r) || r.isInline() || Bi(t, r, s)), kn(r) && (R += Se, ye += Se);
|
|
482
482
|
} else {
|
|
483
483
|
const o = r.getTextContent();
|
|
484
484
|
if (D(r)) {
|
|
@@ -487,7 +487,7 @@ function ht(n, e) {
|
|
|
487
487
|
} else P(r) && !r.isDirectionless() && (G += o);
|
|
488
488
|
R += o, ye += o;
|
|
489
489
|
}
|
|
490
|
-
if (!
|
|
490
|
+
if (!kt && ee(r) && r.__cachedText !== ye) {
|
|
491
491
|
const o = r.getWritable();
|
|
492
492
|
o.__cachedText = ye, r = o;
|
|
493
493
|
}
|
|
@@ -507,18 +507,18 @@ function Pn(n) {
|
|
|
507
507
|
return e !== null && e === Q._blockCursorElement && (e = e.nextSibling), e;
|
|
508
508
|
}
|
|
509
509
|
function ro(n, e, t, r, i, s) {
|
|
510
|
-
R = "", ye = "", G = "", Ii = r === nt, jt = null, Q = t, Pe = t._config,
|
|
510
|
+
R = "", ye = "", G = "", Ii = r === nt, jt = null, Q = t, Pe = t._config, vt = t._nodes, hn = Q._listeners.mutation, jn = i, $n = s, We = n._nodeMap, oe = e._nodeMap, kt = e._readOnly, Un = new Map(t._keyToDOMMap);
|
|
511
511
|
const o = /* @__PURE__ */ new Map();
|
|
512
|
-
return
|
|
512
|
+
return Ct = o, ht("root", null), Q = void 0, vt = void 0, jn = void 0, $n = void 0, We = void 0, oe = void 0, Pe = void 0, Un = void 0, Ct = void 0, o;
|
|
513
513
|
}
|
|
514
514
|
function Hn(n) {
|
|
515
515
|
const e = Un.get(n);
|
|
516
|
-
return e === void 0 &&
|
|
516
|
+
return e === void 0 && b(75, n), e;
|
|
517
517
|
}
|
|
518
518
|
function xl(n) {
|
|
519
519
|
return {};
|
|
520
520
|
}
|
|
521
|
-
const Ki = {}, Sl = {}, io = {}, rn = {}, $t = {}, Wr = {}, _t = {}, Ji = {}, Rr = {}, sn = {}, on = {}, Ie = {}, ji = {}, $i = {}, so = {}, oo = {}, lo = {}, ao = {}, co = {}, uo = {}, fo = {}, Gn = {}, ho = {}, go = {}, _o = {}, po = {}, mo = {},
|
|
521
|
+
const Ki = {}, Sl = {}, io = {}, rn = {}, $t = {}, Wr = {}, _t = {}, Ji = {}, Rr = {}, sn = {}, on = {}, Ie = {}, ji = {}, $i = {}, so = {}, oo = {}, lo = {}, ao = {}, co = {}, uo = {}, fo = {}, Gn = {}, ho = {}, go = {}, _o = {}, po = {}, mo = {}, vl = {}, Cl = {}, kl = {}, yo = {}, bl = {}, xo = {}, So = {}, vo = {}, Ui = {}, Vi = {}, Kr = {}, Tl = {}, wl = {}, Nl = {}, El = {}, Co = {}, ko = {}, bo = {}, pe = Object.freeze({}), Qn = 30, Xn = [["keydown", function(n, e) {
|
|
522
522
|
if (pt = n.timeStamp, Yn = n.key, e.isComposing()) return;
|
|
523
523
|
const { key: t, shiftKey: r, ctrlKey: i, metaKey: s, altKey: o } = n;
|
|
524
524
|
if (!E(e, so, n) && t != null) {
|
|
@@ -608,7 +608,7 @@ const Ki = {}, Sl = {}, io = {}, rn = {}, $t = {}, Wr = {}, _t = {}, Ji = {}, Rr
|
|
|
608
608
|
}
|
|
609
609
|
/* @__PURE__ */ (function(l, a, c, u) {
|
|
610
610
|
return l || a || c || u;
|
|
611
|
-
})(i, r, o, s) && E(e,
|
|
611
|
+
})(i, r, o, s) && E(e, bo, n);
|
|
612
612
|
}
|
|
613
613
|
}], ["pointerdown", function(n, e) {
|
|
614
614
|
const t = n.target, r = n.pointerType;
|
|
@@ -633,14 +633,14 @@ const Ki = {}, Sl = {}, io = {}, rn = {}, $t = {}, Wr = {}, _t = {}, Ji = {}, Rr
|
|
|
633
633
|
const t = M(), r = n.data, i = Xi(n);
|
|
634
634
|
if (r != null && L(t) && Gi(t, i, r, n.timeStamp, !1)) {
|
|
635
635
|
ft && (Wt(e, r), ft = !1);
|
|
636
|
-
const s = t.anchor.getNode(), o =
|
|
636
|
+
const s = t.anchor.getNode(), o = ve(ie(e));
|
|
637
637
|
if (o === null) return;
|
|
638
638
|
const l = t.isBackward(), a = l ? t.anchor.offset : t.focus.offset, c = l ? t.focus.offset : t.anchor.offset;
|
|
639
|
-
Gt && !t.isCollapsed() && P(s) && o.anchorNode !== null && s.getTextContent().slice(0, a) + r + s.getTextContent().slice(a + c) ===
|
|
639
|
+
Gt && !t.isCollapsed() && P(s) && o.anchorNode !== null && s.getTextContent().slice(0, a) + r + s.getTextContent().slice(a + c) === vs(o.anchorNode) || E(e, _t, r);
|
|
640
640
|
const u = r.length;
|
|
641
641
|
we && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), St || tt || Qt || !e.isComposing() || (pt = 0, V(null));
|
|
642
642
|
} else
|
|
643
|
-
|
|
643
|
+
Cr(!1, e, r !== null ? r : void 0), ft && (Wt(e, r || void 0), ft = !1);
|
|
644
644
|
(function() {
|
|
645
645
|
H();
|
|
646
646
|
const s = B();
|
|
@@ -649,7 +649,7 @@ const Ki = {}, Sl = {}, io = {}, rn = {}, $t = {}, Wr = {}, _t = {}, Ji = {}, Rr
|
|
|
649
649
|
}, { event: n }), Ge = null;
|
|
650
650
|
}], ["click", function(n, e) {
|
|
651
651
|
Z(e, () => {
|
|
652
|
-
const t = M(), r =
|
|
652
|
+
const t = M(), r = ve(ie(e)), i = at();
|
|
653
653
|
if (r) {
|
|
654
654
|
if (L(t)) {
|
|
655
655
|
const s = t.anchor, o = s.getNode();
|
|
@@ -662,12 +662,12 @@ const Ki = {}, Sl = {}, io = {}, rn = {}, $t = {}, Wr = {}, _t = {}, Ji = {}, Rr
|
|
|
662
662
|
u = u.getParent();
|
|
663
663
|
}
|
|
664
664
|
return null;
|
|
665
|
-
}(o, (a) =>
|
|
666
|
-
|
|
665
|
+
}(o, (a) => C(a) && !a.isInline());
|
|
666
|
+
C(l) && l.select(0);
|
|
667
667
|
}
|
|
668
668
|
} else if (n.pointerType === "touch") {
|
|
669
669
|
const s = r.anchorNode;
|
|
670
|
-
(Y(s) ||
|
|
670
|
+
(Y(s) || Ce(s)) && ne(pn(i, r, e, n));
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
E(e, io, n);
|
|
@@ -675,7 +675,7 @@ const Ki = {}, Sl = {}, io = {}, rn = {}, $t = {}, Wr = {}, _t = {}, Ji = {}, Rr
|
|
|
675
675
|
}], ["cut", pe], ["copy", pe], ["dragstart", pe], ["dragover", pe], ["dragend", pe], ["paste", pe], ["focus", pe], ["blur", pe], ["drop", pe]];
|
|
676
676
|
Gt && Xn.push(["beforeinput", (n, e) => function(t, r) {
|
|
677
677
|
const i = t.inputType, s = Xi(t);
|
|
678
|
-
i === "deleteCompositionText" || we &&
|
|
678
|
+
i === "deleteCompositionText" || we && Cs(r) || i !== "insertCompositionText" && Z(r, () => {
|
|
679
679
|
const o = M();
|
|
680
680
|
if (i === "deleteContentBackward") {
|
|
681
681
|
if (o === null) {
|
|
@@ -692,7 +692,7 @@ Gt && Xn.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
692
692
|
});
|
|
693
693
|
}, Qn), L(o)) {
|
|
694
694
|
const h = o.anchor.getNode();
|
|
695
|
-
h.markDirty(), P(h) ||
|
|
695
|
+
h.markDirty(), P(h) || b(142), Qi(o, h);
|
|
696
696
|
}
|
|
697
697
|
} else {
|
|
698
698
|
V(null), t.preventDefault();
|
|
@@ -710,7 +710,7 @@ Gt && Xn.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
710
710
|
var l;
|
|
711
711
|
if (!L(o)) return;
|
|
712
712
|
const a = t.data;
|
|
713
|
-
Ge !== null &&
|
|
713
|
+
Ge !== null && Cr(!1, r, Ge), o.dirty && Ge === null || !o.isCollapsed() || ee(o.anchor.getNode()) || s === null || o.applyDOMRange(s), Ge = null;
|
|
714
714
|
const c = o.anchor, u = o.focus, d = c.getNode(), f = u.getNode();
|
|
715
715
|
if (i !== "insertText" && i !== "insertTranspose") switch (t.preventDefault(), i) {
|
|
716
716
|
case "insertFromYank":
|
|
@@ -733,7 +733,7 @@ Gt && Xn.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
733
733
|
break;
|
|
734
734
|
case "deleteByComposition":
|
|
735
735
|
(function(g, h) {
|
|
736
|
-
return g !== h ||
|
|
736
|
+
return g !== h || C(g) || C(h) || !g.isToken() || !h.isToken();
|
|
737
737
|
})(d, f) && E(r, Rr, t);
|
|
738
738
|
break;
|
|
739
739
|
case "deleteByDrag":
|
|
@@ -792,19 +792,19 @@ let pt = 0, Yn = null, qi = 0, Ge = null;
|
|
|
792
792
|
const ln = /* @__PURE__ */ new WeakMap();
|
|
793
793
|
let Zn = !1, er = !1, mt = !1, ft = !1, Fn = !1, Ln = "", Me = null, Hi = [0, "", 0, "root", 0];
|
|
794
794
|
function Gi(n, e, t, r, i) {
|
|
795
|
-
const s = n.anchor, o = n.focus, l = s.getNode(), a = B(), c =
|
|
795
|
+
const s = n.anchor, o = n.focus, l = s.getNode(), a = B(), c = ve(ie(a)), u = c !== null ? c.anchorNode : null, d = s.key, f = a.getElementByKey(d), g = t.length;
|
|
796
796
|
return d !== o.key || !P(l) || (!i && (!Gt || qi < r + 50) || l.isDirty() && g < 2 || xs(t)) && s.offset !== o.offset && !l.isComposing() || Qe(l) || l.isDirty() && g > 1 || (i || !Gt) && f !== null && !l.isComposing() && u !== rt(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, _) {
|
|
797
797
|
if (_.isSegmented()) return !0;
|
|
798
798
|
if (!h.isCollapsed()) return !1;
|
|
799
799
|
const p = h.anchor.offset, x = _.getParentOrThrow(), m = _.isToken();
|
|
800
800
|
return p === 0 ? !_.canInsertTextBefore() || !x.canInsertTextBefore() && !_.isComposing() || m || function(y) {
|
|
801
|
-
const
|
|
802
|
-
return (P(
|
|
801
|
+
const T = y.getPreviousSibling();
|
|
802
|
+
return (P(T) || C(T) && T.isInline()) && !T.canInsertTextAfter();
|
|
803
803
|
}(_) : p === _.getTextContentSize() && (!_.canInsertTextAfter() || !x.canInsertTextAfter() && !_.isComposing() || m);
|
|
804
804
|
}(n, l);
|
|
805
805
|
}
|
|
806
806
|
function Jr(n, e) {
|
|
807
|
-
return
|
|
807
|
+
return Ce(n) && n.nodeValue !== null && e !== 0 && e !== n.nodeValue.length;
|
|
808
808
|
}
|
|
809
809
|
function jr(n, e, t) {
|
|
810
810
|
const { anchorNode: r, anchorOffset: i, focusNode: s, focusOffset: o } = n;
|
|
@@ -822,23 +822,23 @@ function jr(n, e, t) {
|
|
|
822
822
|
n.type === "Range" && n.anchorNode === n.focusNode && (l.dirty = !0);
|
|
823
823
|
const u = ie(e).event, d = u ? u.timeStamp : performance.now(), [f, g, h, _, p] = Hi, x = te(), m = e.isComposing() === !1 && x.getTextContent() === "";
|
|
824
824
|
if (d < p + 200 && a.offset === h && a.key === _) Ut(l, f, g);
|
|
825
|
-
else if (a.type === "text") P(c) ||
|
|
825
|
+
else if (a.type === "text") P(c) || b(141), Qi(l, c);
|
|
826
826
|
else if (a.type === "element" && !m) {
|
|
827
|
-
|
|
827
|
+
C(c) || b(259);
|
|
828
828
|
const y = a.getNode();
|
|
829
|
-
y.isEmpty() ? function(
|
|
829
|
+
y.isEmpty() ? function(T, w) {
|
|
830
830
|
const S = w.getTextFormat(), N = w.getTextStyle();
|
|
831
|
-
Ut(
|
|
831
|
+
Ut(T, S, N);
|
|
832
832
|
}(l, y) : Ut(l, 0, "");
|
|
833
833
|
}
|
|
834
834
|
} else {
|
|
835
835
|
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, m = h ? u : d;
|
|
836
|
-
let y = Rs,
|
|
836
|
+
let y = Rs, T = !1;
|
|
837
837
|
for (let w = 0; w < g; w++) {
|
|
838
838
|
const S = f[w], N = S.getTextContentSize();
|
|
839
|
-
if (P(S) && N !== 0 && !(w === 0 && S.__key === x && _ === N || w === g - 1 && S.__key === m && p === 0) && (
|
|
839
|
+
if (P(S) && N !== 0 && !(w === 0 && S.__key === x && _ === N || w === g - 1 && S.__key === m && p === 0) && (T = !0, y &= S.getFormat(), y === 0)) break;
|
|
840
840
|
}
|
|
841
|
-
l.format =
|
|
841
|
+
l.format = T ? y : 0;
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
844
|
E(e, Ki, void 0);
|
|
@@ -860,7 +860,7 @@ function Wt(n, e) {
|
|
|
860
860
|
if (V(null), t !== null && e != null) {
|
|
861
861
|
if (e === "") {
|
|
862
862
|
const r = j(t), i = rt(n.getElementByKey(t));
|
|
863
|
-
return void (i !== null && i.nodeValue !== null && P(r) &&
|
|
863
|
+
return void (i !== null && i.nodeValue !== null && P(r) && kr(r, i.nodeValue, null, null, !0));
|
|
864
864
|
}
|
|
865
865
|
if (e[e.length - 1] === `
|
|
866
866
|
`) {
|
|
@@ -871,7 +871,7 @@ function Wt(n, e) {
|
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
|
|
874
|
+
Cr(!0, n, e);
|
|
875
875
|
}
|
|
876
876
|
function Yi(n) {
|
|
877
877
|
let e = n.__lexicalEventHandles;
|
|
@@ -885,9 +885,9 @@ function Zi(n) {
|
|
|
885
885
|
if (t === null) return;
|
|
886
886
|
er && (er = !1, Z(t, () => {
|
|
887
887
|
const a = at(), c = e.anchorNode;
|
|
888
|
-
(Y(c) ||
|
|
888
|
+
(Y(c) || Ce(c)) && ne(pn(a, e, t, n));
|
|
889
889
|
}));
|
|
890
|
-
const r =
|
|
890
|
+
const r = vr(t), i = r[r.length - 1], s = i._key, o = Ye.get(s), l = o || i;
|
|
891
891
|
l !== t && jr(e, l, !1), jr(e, t, !0), t !== i ? Ye.set(s, t) : o && Ye.delete(s);
|
|
892
892
|
}
|
|
893
893
|
function $r(n) {
|
|
@@ -896,18 +896,18 @@ function $r(n) {
|
|
|
896
896
|
function Ur(n) {
|
|
897
897
|
return n._lexicalHandled === !0;
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function To(n) {
|
|
900
900
|
const e = n.ownerDocument, t = ln.get(e);
|
|
901
901
|
if (t === void 0) return;
|
|
902
902
|
const r = t - 1;
|
|
903
|
-
r >= 0 ||
|
|
904
|
-
const i =
|
|
903
|
+
r >= 0 || b(164), ln.set(e, r), r === 0 && e.removeEventListener("selectionchange", Zi);
|
|
904
|
+
const i = vn(n);
|
|
905
905
|
xr(i) ? (function(o) {
|
|
906
906
|
if (o._parentEditor !== null) {
|
|
907
|
-
const l =
|
|
907
|
+
const l = vr(o), a = l[l.length - 1]._key;
|
|
908
908
|
Ye.get(a) === o && Ye.delete(a);
|
|
909
909
|
} else Ye.delete(o._key);
|
|
910
|
-
}(i), n.__lexicalEditor = null) : i &&
|
|
910
|
+
}(i), n.__lexicalEditor = null) : i && b(198);
|
|
911
911
|
const s = Yi(n);
|
|
912
912
|
for (let o = 0; o < s.length; o++) s[o]();
|
|
913
913
|
n.__lexicalEventHandles = [];
|
|
@@ -918,7 +918,7 @@ function tr(n, e, t) {
|
|
|
918
918
|
if (i === null) return;
|
|
919
919
|
const s = function(l) {
|
|
920
920
|
const a = M();
|
|
921
|
-
if (!L(a) || !
|
|
921
|
+
if (!L(a) || !C(l)) return a;
|
|
922
922
|
const { anchor: c, focus: u } = a, d = c.getNode(), f = u.getNode();
|
|
923
923
|
return nr(d, l) && c.set(l.__key, 0, "element"), nr(f, l) && u.set(l.__key, 0, "element"), a;
|
|
924
924
|
}(n);
|
|
@@ -935,10 +935,10 @@ function tr(n, e, t) {
|
|
|
935
935
|
}
|
|
936
936
|
class gn {
|
|
937
937
|
static getType() {
|
|
938
|
-
|
|
938
|
+
b(64, this.name);
|
|
939
939
|
}
|
|
940
940
|
static clone(e) {
|
|
941
|
-
|
|
941
|
+
b(65, this.name);
|
|
942
942
|
}
|
|
943
943
|
afterCloneFrom(e) {
|
|
944
944
|
this.__parent = e.__parent, this.__next = e.__next, this.__prev = e.__prev, this.__state = e.__state;
|
|
@@ -950,7 +950,7 @@ class gn {
|
|
|
950
950
|
return this.__type;
|
|
951
951
|
}
|
|
952
952
|
isInline() {
|
|
953
|
-
|
|
953
|
+
b(137, this.constructor.name);
|
|
954
954
|
}
|
|
955
955
|
isAttached() {
|
|
956
956
|
let e = this.__key;
|
|
@@ -996,20 +996,20 @@ class gn {
|
|
|
996
996
|
}
|
|
997
997
|
getParentOrThrow() {
|
|
998
998
|
const e = this.getParent();
|
|
999
|
-
return e === null &&
|
|
999
|
+
return e === null && b(66, this.__key), e;
|
|
1000
1000
|
}
|
|
1001
1001
|
getTopLevelElement() {
|
|
1002
1002
|
let e = this;
|
|
1003
1003
|
for (; e !== null; ) {
|
|
1004
1004
|
const t = e.getParent();
|
|
1005
|
-
if (Ae(t)) return
|
|
1005
|
+
if (Ae(t)) return C(e) || e === this && D(e) || b(194), e;
|
|
1006
1006
|
e = t;
|
|
1007
1007
|
}
|
|
1008
1008
|
return null;
|
|
1009
1009
|
}
|
|
1010
1010
|
getTopLevelElementOrThrow() {
|
|
1011
1011
|
const e = this.getTopLevelElement();
|
|
1012
|
-
return e === null &&
|
|
1012
|
+
return e === null && b(67, this.__key), e;
|
|
1013
1013
|
}
|
|
1014
1014
|
getParents() {
|
|
1015
1015
|
const e = [];
|
|
@@ -1045,7 +1045,7 @@ class gn {
|
|
|
1045
1045
|
return e;
|
|
1046
1046
|
}
|
|
1047
1047
|
getCommonAncestor(e) {
|
|
1048
|
-
const t =
|
|
1048
|
+
const t = C(this) ? this : this.getParent(), r = C(e) ? e : e.getParent(), i = t && r ? qt(t, r) : null;
|
|
1049
1049
|
return i ? i.commonAncestor : null;
|
|
1050
1050
|
}
|
|
1051
1051
|
is(e) {
|
|
@@ -1053,7 +1053,7 @@ class gn {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
isBefore(e) {
|
|
1055
1055
|
const t = qt(this, e);
|
|
1056
|
-
return t !== null && (t.type === "descendant" || (t.type === "branch" ? Ns(t) === -1 : (t.type !== "same" && t.type !== "ancestor" &&
|
|
1056
|
+
return t !== null && (t.type === "descendant" || (t.type === "branch" ? Ns(t) === -1 : (t.type !== "same" && t.type !== "ancestor" && b(279), !1)));
|
|
1057
1057
|
}
|
|
1058
1058
|
isParentOf(e) {
|
|
1059
1059
|
const t = qt(this, e);
|
|
@@ -1065,7 +1065,7 @@ class gn {
|
|
|
1065
1065
|
for (; s !== null; ) {
|
|
1066
1066
|
const o = s.__key;
|
|
1067
1067
|
if (i.has(o) || (i.add(o), r.push(s)), s === e) break;
|
|
1068
|
-
const l =
|
|
1068
|
+
const l = C(s) ? t ? s.getFirstChild() : s.getLastChild() : null;
|
|
1069
1069
|
if (l !== null) {
|
|
1070
1070
|
s = l;
|
|
1071
1071
|
continue;
|
|
@@ -1079,7 +1079,7 @@ class gn {
|
|
|
1079
1079
|
if (i.has(c.__key) || r.push(c), c === e) break;
|
|
1080
1080
|
let u = null, d = c;
|
|
1081
1081
|
do {
|
|
1082
|
-
if (d === null &&
|
|
1082
|
+
if (d === null && b(68), u = t ? d.getNextSibling() : d.getPreviousSibling(), d = d.getParent(), d === null) break;
|
|
1083
1083
|
u !== null || i.has(d.__key) || r.push(d);
|
|
1084
1084
|
} while (u === null);
|
|
1085
1085
|
s = u;
|
|
@@ -1092,7 +1092,7 @@ class gn {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
getLatest() {
|
|
1094
1094
|
const e = j(this.__key);
|
|
1095
|
-
return e === null &&
|
|
1095
|
+
return e === null && b(113), e;
|
|
1096
1096
|
}
|
|
1097
1097
|
getWritable() {
|
|
1098
1098
|
H();
|
|
@@ -1108,10 +1108,10 @@ class gn {
|
|
|
1108
1108
|
return this.getTextContent().length;
|
|
1109
1109
|
}
|
|
1110
1110
|
createDOM(e, t) {
|
|
1111
|
-
|
|
1111
|
+
b(70);
|
|
1112
1112
|
}
|
|
1113
1113
|
updateDOM(e, t, r) {
|
|
1114
|
-
|
|
1114
|
+
b(71);
|
|
1115
1115
|
}
|
|
1116
1116
|
exportDOM(e) {
|
|
1117
1117
|
return { element: this.createDOM(e._config, e) };
|
|
@@ -1121,7 +1121,7 @@ class gn {
|
|
|
1121
1121
|
return { type: this.__type, version: 1, ...e };
|
|
1122
1122
|
}
|
|
1123
1123
|
static importJSON(e) {
|
|
1124
|
-
|
|
1124
|
+
b(18, this.name);
|
|
1125
1125
|
}
|
|
1126
1126
|
updateFromJSON(e) {
|
|
1127
1127
|
return function(t, r) {
|
|
@@ -1142,14 +1142,14 @@ class gn {
|
|
|
1142
1142
|
const i = this.getLatest(), s = this.__key, o = e.__key, l = e.getWritable(), a = this.getParentOrThrow().getWritable(), c = a.__size;
|
|
1143
1143
|
De(l);
|
|
1144
1144
|
const u = i.getPreviousSibling(), d = i.getNextSibling(), f = i.__prev, g = i.__next, h = i.__parent;
|
|
1145
|
-
if (tr(i, !1, !0), u === null ? a.__first = o : u.getWritable().__next = o, l.__prev = f, d === null ? a.__last = o : d.getWritable().__prev = o, l.__next = g, l.__parent = h, a.__size = c, t && (
|
|
1145
|
+
if (tr(i, !1, !0), u === null ? a.__first = o : u.getWritable().__next = o, l.__prev = f, d === null ? a.__last = o : d.getWritable().__prev = o, l.__next = g, l.__parent = h, a.__size = c, t && (C(this) && C(l) || b(139), this.getChildren().forEach((_) => {
|
|
1146
1146
|
l.append(_);
|
|
1147
1147
|
})), L(r)) {
|
|
1148
1148
|
ne(r);
|
|
1149
1149
|
const _ = r.anchor, p = r.focus;
|
|
1150
1150
|
_.key === s && Gr(_, l), p.key === s && Gr(p, l);
|
|
1151
1151
|
}
|
|
1152
|
-
return
|
|
1152
|
+
return Te() === s && V(o), l;
|
|
1153
1153
|
}
|
|
1154
1154
|
insertAfter(e, t = !0) {
|
|
1155
1155
|
H(), zn(this, e);
|
|
@@ -1196,7 +1196,7 @@ class gn {
|
|
|
1196
1196
|
H();
|
|
1197
1197
|
const r = this.getPreviousSibling(), i = this.getParentOrThrow();
|
|
1198
1198
|
if (r === null) return i.select(0, 0);
|
|
1199
|
-
if (
|
|
1199
|
+
if (C(r)) return r.select();
|
|
1200
1200
|
if (!P(r)) {
|
|
1201
1201
|
const s = r.getIndexWithinParent() + 1;
|
|
1202
1202
|
return i.select(s, s);
|
|
@@ -1207,7 +1207,7 @@ class gn {
|
|
|
1207
1207
|
H();
|
|
1208
1208
|
const r = this.getNextSibling(), i = this.getParentOrThrow();
|
|
1209
1209
|
if (r === null) return i.select();
|
|
1210
|
-
if (
|
|
1210
|
+
if (C(r)) return r.select(0, 0);
|
|
1211
1211
|
if (!P(r)) {
|
|
1212
1212
|
const s = r.getIndexWithinParent();
|
|
1213
1213
|
return i.select(s, s);
|
|
@@ -1267,20 +1267,20 @@ class Nt extends gn {
|
|
|
1267
1267
|
}(e) ? null : { conversion: wo, priority: 0 } };
|
|
1268
1268
|
}
|
|
1269
1269
|
static importJSON(e) {
|
|
1270
|
-
return
|
|
1270
|
+
return bt().updateFromJSON(e);
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
1273
|
function wo(n) {
|
|
1274
|
-
return { node:
|
|
1274
|
+
return { node: bt() };
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1277
|
-
return
|
|
1276
|
+
function bt() {
|
|
1277
|
+
return bn(new Nt());
|
|
1278
1278
|
}
|
|
1279
1279
|
function Ze(n) {
|
|
1280
1280
|
return n instanceof Nt;
|
|
1281
1281
|
}
|
|
1282
1282
|
function Rt(n) {
|
|
1283
|
-
return
|
|
1283
|
+
return Ce(n) && /^( |\t|\r?\n)+$/.test(n.textContent || "");
|
|
1284
1284
|
}
|
|
1285
1285
|
function An(n, e) {
|
|
1286
1286
|
return 16 & e ? "code" : e & ir ? "mark" : 32 & e ? "sub" : 64 & e ? "sup" : null;
|
|
@@ -1362,7 +1362,7 @@ class lt extends gn {
|
|
|
1362
1362
|
return this.getLatest().__mode === 1;
|
|
1363
1363
|
}
|
|
1364
1364
|
isComposing() {
|
|
1365
|
-
return this.__key ===
|
|
1365
|
+
return this.__key === Te();
|
|
1366
1366
|
}
|
|
1367
1367
|
isSegmented() {
|
|
1368
1368
|
return this.getLatest().__mode === 2;
|
|
@@ -1404,12 +1404,12 @@ class lt extends gn {
|
|
|
1404
1404
|
if ((l === null ? c : l) !== (a === null ? u : a)) return !0;
|
|
1405
1405
|
if (l === a && c !== u) {
|
|
1406
1406
|
const _ = t.firstChild;
|
|
1407
|
-
_ == null &&
|
|
1407
|
+
_ == null && b(48);
|
|
1408
1408
|
const p = document.createElement(u);
|
|
1409
1409
|
return Vr(p, this, 0, o, i, r), t.replaceChild(p, _), !1;
|
|
1410
1410
|
}
|
|
1411
1411
|
let d = t;
|
|
1412
|
-
a !== null && l !== null && (d = t.firstChild, d == null &&
|
|
1412
|
+
a !== null && l !== null && (d = t.firstChild, d == null && b(49)), ts(i, d, this);
|
|
1413
1413
|
const f = r.theme.text;
|
|
1414
1414
|
f !== void 0 && s !== o && es(0, s, o, d, f);
|
|
1415
1415
|
const g = e.__style, h = this.__style;
|
|
@@ -1426,7 +1426,7 @@ class lt extends gn {
|
|
|
1426
1426
|
}
|
|
1427
1427
|
exportDOM(e) {
|
|
1428
1428
|
let { element: t } = super.exportDOM(e);
|
|
1429
|
-
return Y(t) ||
|
|
1429
|
+
return Y(t) || b(132), t.style.whiteSpace = "pre-wrap", this.hasFormat("lowercase") ? t.style.textTransform = "lowercase" : this.hasFormat("uppercase") ? t.style.textTransform = "uppercase" : this.hasFormat("capitalize") && (t.style.textTransform = "capitalize"), this.hasFormat("bold") && (t = Kt(t, "b")), this.hasFormat("italic") && (t = Kt(t, "i")), this.hasFormat("strikethrough") && (t = Kt(t, "s")), this.hasFormat("underline") && (t = Kt(t, "u")), { element: t };
|
|
1430
1430
|
}
|
|
1431
1431
|
exportJSON() {
|
|
1432
1432
|
return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), ...super.exportJSON() };
|
|
@@ -1478,7 +1478,7 @@ class lt extends gn {
|
|
|
1478
1478
|
} else r = 0, i = 0;
|
|
1479
1479
|
if (!L(s)) return is(l, r, l, i, "text", "text");
|
|
1480
1480
|
{
|
|
1481
|
-
const a =
|
|
1481
|
+
const a = Te();
|
|
1482
1482
|
a !== s.anchor.key && a !== s.focus.key || V(l), s.setTextNodeRange(this, r, this, i);
|
|
1483
1483
|
}
|
|
1484
1484
|
return s;
|
|
@@ -1512,12 +1512,12 @@ class lt extends gn {
|
|
|
1512
1512
|
H();
|
|
1513
1513
|
const t = this.getLatest(), r = t.getTextContent();
|
|
1514
1514
|
if (r === "") return [];
|
|
1515
|
-
const i = t.__key, s =
|
|
1516
|
-
e.sort((
|
|
1515
|
+
const i = t.__key, s = Te(), o = r.length;
|
|
1516
|
+
e.sort((k, v) => k - v), e.push(o);
|
|
1517
1517
|
const l = [], a = e.length;
|
|
1518
|
-
for (let
|
|
1519
|
-
const F = e[
|
|
1520
|
-
F >
|
|
1518
|
+
for (let k = 0, v = 0; k < o && v <= a; v++) {
|
|
1519
|
+
const F = e[v];
|
|
1520
|
+
F > k && (l.push(r.slice(k, F)), k = F);
|
|
1521
1521
|
}
|
|
1522
1522
|
const c = l.length;
|
|
1523
1523
|
if (c === 1) return [t];
|
|
@@ -1527,43 +1527,43 @@ class lt extends gn {
|
|
|
1527
1527
|
let p = !1, x = null, m = null;
|
|
1528
1528
|
const y = M();
|
|
1529
1529
|
if (L(y)) {
|
|
1530
|
-
const [
|
|
1531
|
-
|
|
1530
|
+
const [k, v] = y.isBackward() ? [y.focus, y.anchor] : [y.anchor, y.focus];
|
|
1531
|
+
k.type === "text" && k.key === i && (x = k), v.type === "text" && v.key === i && (m = v);
|
|
1532
1532
|
}
|
|
1533
1533
|
t.isSegmented() ? (f = U(u), f.__format = g, f.__style = h, f.__detail = _, p = !0) : (f = t.getWritable(), f.__text = u);
|
|
1534
|
-
const
|
|
1535
|
-
for (let
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1538
|
-
const F =
|
|
1539
|
-
s === i && V(F),
|
|
1534
|
+
const T = [f];
|
|
1535
|
+
for (let k = 1; k < c; k++) {
|
|
1536
|
+
const v = U(l[k]);
|
|
1537
|
+
v.__format = g, v.__style = h, v.__detail = _;
|
|
1538
|
+
const F = v.__key;
|
|
1539
|
+
s === i && V(F), T.push(v);
|
|
1540
1540
|
}
|
|
1541
1541
|
const w = x ? x.offset : null, S = m ? m.offset : null;
|
|
1542
1542
|
let N = 0;
|
|
1543
|
-
for (const
|
|
1543
|
+
for (const k of T) {
|
|
1544
1544
|
if (!x && !m) break;
|
|
1545
|
-
const
|
|
1546
|
-
if (x !== null && w !== null && w <=
|
|
1547
|
-
m.set(
|
|
1545
|
+
const v = N + k.getTextContentSize();
|
|
1546
|
+
if (x !== null && w !== null && w <= v && w >= N && (x.set(k.getKey(), w - N, "text"), w < v && (x = null)), m !== null && S !== null && S <= v && S >= N) {
|
|
1547
|
+
m.set(k.getKey(), S - N, "text");
|
|
1548
1548
|
break;
|
|
1549
1549
|
}
|
|
1550
|
-
N =
|
|
1550
|
+
N = v;
|
|
1551
1551
|
}
|
|
1552
1552
|
if (d !== null) {
|
|
1553
1553
|
(function(F) {
|
|
1554
1554
|
const O = F.getPreviousSibling(), W = F.getNextSibling();
|
|
1555
1555
|
O !== null && fn(O), W !== null && fn(W);
|
|
1556
1556
|
})(this);
|
|
1557
|
-
const
|
|
1558
|
-
p ? (
|
|
1557
|
+
const k = d.getWritable(), v = this.getIndexWithinParent();
|
|
1558
|
+
p ? (k.splice(v, 0, T), this.remove()) : k.splice(v, 1, T), L(y) && an(y, d, v, c - 1);
|
|
1559
1559
|
}
|
|
1560
|
-
return
|
|
1560
|
+
return T;
|
|
1561
1561
|
}
|
|
1562
1562
|
mergeWithSibling(e) {
|
|
1563
1563
|
const t = e === this.getPreviousSibling();
|
|
1564
|
-
t || e === this.getNextSibling() ||
|
|
1564
|
+
t || e === this.getNextSibling() || b(50);
|
|
1565
1565
|
const r = this.__key, i = e.__key, s = this.__text, o = s.length;
|
|
1566
|
-
|
|
1566
|
+
Te() === i && V(r);
|
|
1567
1567
|
const l = M();
|
|
1568
1568
|
if (L(l)) {
|
|
1569
1569
|
const d = l.anchor, f = l.focus;
|
|
@@ -1594,7 +1594,7 @@ function Po(n) {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
function Fo(n) {
|
|
1596
1596
|
const e = n;
|
|
1597
|
-
n.parentElement === null &&
|
|
1597
|
+
n.parentElement === null && b(129);
|
|
1598
1598
|
let t = e.textContent || "";
|
|
1599
1599
|
if (function(r) {
|
|
1600
1600
|
let i, s = r.parentNode;
|
|
@@ -1609,7 +1609,7 @@ function Fo(n) {
|
|
|
1609
1609
|
const l = r[o];
|
|
1610
1610
|
l === `
|
|
1611
1611
|
` || l === `\r
|
|
1612
|
-
` ? i.push(
|
|
1612
|
+
` ? i.push(bt()) : l === " " ? i.push(gr()) : l !== "" && i.push(U(l));
|
|
1613
1613
|
}
|
|
1614
1614
|
return { node: i };
|
|
1615
1615
|
}
|
|
@@ -1651,7 +1651,7 @@ function Hr(n, e) {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
let i = t;
|
|
1653
1653
|
for (; (i = e ? t.firstChild : t.lastChild) !== null; ) t = i;
|
|
1654
|
-
if (
|
|
1654
|
+
if (Ce(t)) return t;
|
|
1655
1655
|
if (t.nodeName === "BR") return null;
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
@@ -1661,7 +1661,7 @@ function me(n) {
|
|
|
1661
1661
|
return e === void 0 ? { node: null } : { forChild: hr(n.style, e), node: null };
|
|
1662
1662
|
}
|
|
1663
1663
|
function U(n = "") {
|
|
1664
|
-
return
|
|
1664
|
+
return bn(new lt(n));
|
|
1665
1665
|
}
|
|
1666
1666
|
function P(n) {
|
|
1667
1667
|
return n instanceof lt;
|
|
@@ -1691,13 +1691,13 @@ class Et extends lt {
|
|
|
1691
1691
|
return gr().updateFromJSON(e);
|
|
1692
1692
|
}
|
|
1693
1693
|
setTextContent(e) {
|
|
1694
|
-
return e !== " " && e !== "" &&
|
|
1694
|
+
return e !== " " && e !== "" && b(126), super.setTextContent(e);
|
|
1695
1695
|
}
|
|
1696
1696
|
setDetail(e) {
|
|
1697
|
-
return e !== 2 &&
|
|
1697
|
+
return e !== 2 && b(127), this;
|
|
1698
1698
|
}
|
|
1699
1699
|
setMode(e) {
|
|
1700
|
-
return e !== "normal" &&
|
|
1700
|
+
return e !== "normal" && b(128), this;
|
|
1701
1701
|
}
|
|
1702
1702
|
canInsertTextBefore() {
|
|
1703
1703
|
return !1;
|
|
@@ -1707,7 +1707,7 @@ class Et extends lt {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
}
|
|
1709
1709
|
function gr() {
|
|
1710
|
-
return
|
|
1710
|
+
return bn(new Et());
|
|
1711
1711
|
}
|
|
1712
1712
|
function Ao(n) {
|
|
1713
1713
|
return n instanceof Et;
|
|
@@ -1724,11 +1724,11 @@ class Oo {
|
|
|
1724
1724
|
}
|
|
1725
1725
|
getNode() {
|
|
1726
1726
|
const e = j(this.key);
|
|
1727
|
-
return e === null &&
|
|
1727
|
+
return e === null && b(20), e;
|
|
1728
1728
|
}
|
|
1729
1729
|
set(e, t, r, i) {
|
|
1730
1730
|
const s = this._selection, o = this.key;
|
|
1731
|
-
i && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r, Pt() || (
|
|
1731
|
+
i && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r, Pt() || (Te() === o && V(e), s !== null && (s.setCachedNodes(null), s.dirty = !0)));
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
1734
|
function de(n, e, t) {
|
|
@@ -1740,7 +1740,7 @@ function Mn(n, e) {
|
|
|
1740
1740
|
i = "text";
|
|
1741
1741
|
const s = e.getTextContentSize();
|
|
1742
1742
|
r > s && (r = s);
|
|
1743
|
-
} else if (!
|
|
1743
|
+
} else if (!C(e)) {
|
|
1744
1744
|
const s = e.getNextSibling();
|
|
1745
1745
|
if (P(s)) t = s.__key, r = 0, i = "text";
|
|
1746
1746
|
else {
|
|
@@ -1751,9 +1751,9 @@ function Mn(n, e) {
|
|
|
1751
1751
|
n.set(t, r, i);
|
|
1752
1752
|
}
|
|
1753
1753
|
function Gr(n, e) {
|
|
1754
|
-
if (
|
|
1754
|
+
if (C(e)) {
|
|
1755
1755
|
const t = e.getLastDescendant();
|
|
1756
|
-
|
|
1756
|
+
C(t) || P(t) ? Mn(n, t) : Mn(n, e);
|
|
1757
1757
|
} else Mn(n, e);
|
|
1758
1758
|
}
|
|
1759
1759
|
class _n {
|
|
@@ -1869,12 +1869,12 @@ class Ve {
|
|
|
1869
1869
|
i.length === 0 ? l.add(u) : (a.add(u), i.push(u));
|
|
1870
1870
|
} else {
|
|
1871
1871
|
const { origin: u } = c;
|
|
1872
|
-
|
|
1872
|
+
C(u) && a.has(u) || i.push(u);
|
|
1873
1873
|
}
|
|
1874
|
-
if (o && i.push(o.caret.origin), st(r.focus) &&
|
|
1874
|
+
if (o && i.push(o.caret.origin), st(r.focus) && C(r.focus.origin) && r.focus.getNodeAtCaret() === null) for (let c = Fe(r.focus.origin, "previous"); fe(c) && l.has(c.origin) && !c.origin.isEmpty() && c.origin.is(i[i.length - 1]); c = Er(c)) l.delete(c.origin), i.pop();
|
|
1875
1875
|
for (; i.length > 1; ) {
|
|
1876
1876
|
const c = i[i.length - 1];
|
|
1877
|
-
if (!
|
|
1877
|
+
if (!C(c) || a.has(c) || c.isEmpty() || l.has(c)) break;
|
|
1878
1878
|
i.pop();
|
|
1879
1879
|
}
|
|
1880
1880
|
if (i.length === 0 && r.isCollapsed()) {
|
|
@@ -1882,7 +1882,7 @@ class Ve {
|
|
|
1882
1882
|
i.push(f);
|
|
1883
1883
|
}
|
|
1884
1884
|
return i;
|
|
1885
|
-
}(Es(
|
|
1885
|
+
}(Es(Ti(this), "next"));
|
|
1886
1886
|
return Pt() || (this._cachedNodes = t), t;
|
|
1887
1887
|
}
|
|
1888
1888
|
setTextNodeRange(e, t, r, i) {
|
|
@@ -1895,7 +1895,7 @@ class Ve {
|
|
|
1895
1895
|
let c = "", u = !0;
|
|
1896
1896
|
for (let d = 0; d < e.length; d++) {
|
|
1897
1897
|
const f = e[d];
|
|
1898
|
-
if (
|
|
1898
|
+
if (C(f) && !f.isInline()) u || (c += `
|
|
1899
1899
|
`), u = !f.isEmpty();
|
|
1900
1900
|
else if (u = !1, P(f)) {
|
|
1901
1901
|
let g = f.getTextContent();
|
|
@@ -1930,7 +1930,7 @@ class Ve {
|
|
|
1930
1930
|
const o = t[s];
|
|
1931
1931
|
o === `
|
|
1932
1932
|
` || o === `\r
|
|
1933
|
-
` ? r.push(
|
|
1933
|
+
` ? r.push(bt()) : o === " " ? r.push(gr()) : r.push(U(o));
|
|
1934
1934
|
}
|
|
1935
1935
|
this.insertNodes(r);
|
|
1936
1936
|
}
|
|
@@ -1938,14 +1938,14 @@ class Ve {
|
|
|
1938
1938
|
const t = this.anchor, r = this.focus, i = this.format, s = this.style;
|
|
1939
1939
|
let o = t, l = r;
|
|
1940
1940
|
!this.isCollapsed() && r.isBefore(t) && (o = r, l = t), o.type === "element" && function(p, x, m, y) {
|
|
1941
|
-
const
|
|
1942
|
-
S.setFormat(m), S.setStyle(y), w === null ?
|
|
1941
|
+
const T = p.getNode(), w = T.getChildAtIndex(p.offset), S = U(), N = ee(T) ? Ne().append(S) : S;
|
|
1942
|
+
S.setFormat(m), S.setStyle(y), w === null ? T.append(N) : w.insertBefore(N), p.is(x) && x.set(S.__key, 0, "text"), p.set(S.__key, 0, "text");
|
|
1943
1943
|
}(o, l, i, s), l.type === "element" && wt(l, ue($e(l, "next")));
|
|
1944
1944
|
const a = o.offset;
|
|
1945
1945
|
let c = l.offset;
|
|
1946
1946
|
const u = this.getNodes(), d = u.length;
|
|
1947
1947
|
let f = u[0];
|
|
1948
|
-
P(f) ||
|
|
1948
|
+
P(f) || b(26);
|
|
1949
1949
|
const g = f.getTextContent().length, h = f.getParentOrThrow();
|
|
1950
1950
|
let _ = u[d - 1];
|
|
1951
1951
|
if (d === 1 && l.type === "element" && (c = g, l.set(o.key, c, "text")), this.isCollapsed() && a === g && (f.isSegmented() || f.isToken() || !f.canInsertTextAfter() || !h.canInsertTextAfter() && f.getNextSibling() === null)) {
|
|
@@ -1959,7 +1959,7 @@ class Ve {
|
|
|
1959
1959
|
p.setFormat(i), f.replace(p), f = p;
|
|
1960
1960
|
} else if (!this.isCollapsed() && e !== "") {
|
|
1961
1961
|
const p = _.getParent();
|
|
1962
|
-
if (!h.canInsertTextBefore() || !h.canInsertTextAfter() ||
|
|
1962
|
+
if (!h.canInsertTextBefore() || !h.canInsertTextAfter() || C(p) && (!p.canInsertTextBefore() || !p.canInsertTextAfter())) return this.insertText(""), ns(this.anchor, this.focus, null), void this.insertText(e);
|
|
1963
1963
|
}
|
|
1964
1964
|
if (d === 1) {
|
|
1965
1965
|
if (f.isToken()) {
|
|
@@ -1977,8 +1977,8 @@ class Ve {
|
|
|
1977
1977
|
const y = U(e);
|
|
1978
1978
|
if (y.setFormat(i), y.setStyle(s), y.select(), a === 0) f.insertBefore(y, !1);
|
|
1979
1979
|
else {
|
|
1980
|
-
const [
|
|
1981
|
-
|
|
1980
|
+
const [T] = f.splitText(a);
|
|
1981
|
+
T.insertAfter(y, !1);
|
|
1982
1982
|
}
|
|
1983
1983
|
return void (y.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
|
|
1984
1984
|
}
|
|
@@ -1987,59 +1987,59 @@ class Ve {
|
|
|
1987
1987
|
const m = c - a;
|
|
1988
1988
|
f = f.spliceText(a, m, e, !0), f.getTextContent() === "" ? f.remove() : this.anchor.type === "text" && (f.isComposing() ? this.anchor.offset -= e.length : (this.format = p, this.style = x));
|
|
1989
1989
|
} else {
|
|
1990
|
-
const p = /* @__PURE__ */ new Set([...f.getParentKeys(), ..._.getParentKeys()]), x =
|
|
1991
|
-
let m =
|
|
1990
|
+
const p = /* @__PURE__ */ new Set([...f.getParentKeys(), ..._.getParentKeys()]), x = C(f) ? f : f.getParentOrThrow();
|
|
1991
|
+
let m = C(_) ? _ : _.getParentOrThrow(), y = _;
|
|
1992
1992
|
if (!x.is(m) && m.isInline()) do
|
|
1993
1993
|
y = m, m = m.getParentOrThrow();
|
|
1994
1994
|
while (m.isInline());
|
|
1995
1995
|
if (l.type === "text" && (c !== 0 || _.getTextContent() === "") || l.type === "element" && _.getIndexWithinParent() < c) if (P(_) && !_.isToken() && c !== _.getTextContentSize()) {
|
|
1996
1996
|
if (_.isSegmented()) {
|
|
1997
|
-
const
|
|
1998
|
-
_.replace(
|
|
1997
|
+
const k = U(_.getTextContent());
|
|
1998
|
+
_.replace(k), _ = k;
|
|
1999
1999
|
}
|
|
2000
2000
|
ee(l.getNode()) || l.type !== "text" || (_ = _.spliceText(0, c, "")), p.add(_.__key);
|
|
2001
2001
|
} else {
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2002
|
+
const k = _.getParentOrThrow();
|
|
2003
|
+
k.canBeEmpty() || k.getChildrenSize() !== 1 ? _.remove() : k.remove();
|
|
2004
2004
|
}
|
|
2005
2005
|
else p.add(_.__key);
|
|
2006
|
-
const
|
|
2007
|
-
for (let
|
|
2008
|
-
const
|
|
2009
|
-
if (
|
|
2010
|
-
|
|
2006
|
+
const T = m.getChildren(), w = new Set(u), S = x.is(m), N = x.isInline() && f.getNextSibling() === null ? x : f;
|
|
2007
|
+
for (let k = T.length - 1; k >= 0; k--) {
|
|
2008
|
+
const v = T[k];
|
|
2009
|
+
if (v.is(f) || C(v) && v.isParentOf(f)) break;
|
|
2010
|
+
v.isAttached() && (!w.has(v) || v.is(y) ? S || N.insertAfter(v, !1) : v.remove());
|
|
2011
2011
|
}
|
|
2012
2012
|
if (!S) {
|
|
2013
|
-
let
|
|
2014
|
-
for (;
|
|
2015
|
-
const F =
|
|
2016
|
-
(O === 0 || F[O - 1].is(
|
|
2013
|
+
let k = m, v = null;
|
|
2014
|
+
for (; k !== null; ) {
|
|
2015
|
+
const F = k.getChildren(), O = F.length;
|
|
2016
|
+
(O === 0 || F[O - 1].is(v)) && (p.delete(k.__key), v = k), k = k.getParent();
|
|
2017
2017
|
}
|
|
2018
2018
|
}
|
|
2019
2019
|
if (f.isToken()) if (a === g) f.select();
|
|
2020
2020
|
else {
|
|
2021
|
-
const
|
|
2022
|
-
|
|
2021
|
+
const k = U(e);
|
|
2022
|
+
k.select(), f.replace(k);
|
|
2023
2023
|
}
|
|
2024
2024
|
else f = f.spliceText(a, g - a, e, !0), f.getTextContent() === "" ? f.remove() : f.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
|
|
2025
|
-
for (let
|
|
2026
|
-
const
|
|
2027
|
-
p.has(F) ||
|
|
2025
|
+
for (let k = 1; k < d; k++) {
|
|
2026
|
+
const v = u[k], F = v.__key;
|
|
2027
|
+
p.has(F) || v.remove();
|
|
2028
2028
|
}
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
2031
|
removeText() {
|
|
2032
2032
|
const e = M() === this;
|
|
2033
|
-
Ht(this, hl(
|
|
2033
|
+
Ht(this, hl(Ti(this))), e && M() !== this && ne(this);
|
|
2034
2034
|
}
|
|
2035
2035
|
formatText(e, t = null) {
|
|
2036
2036
|
if (this.isCollapsed()) return this.toggleFormat(e), void V(null);
|
|
2037
2037
|
const r = this.getNodes(), i = [];
|
|
2038
|
-
for (const
|
|
2039
|
-
const s = (
|
|
2038
|
+
for (const T of r) P(T) && i.push(T);
|
|
2039
|
+
const s = (T) => {
|
|
2040
2040
|
r.forEach((w) => {
|
|
2041
|
-
if (
|
|
2042
|
-
const S = w.getFormatFlags(e,
|
|
2041
|
+
if (C(w)) {
|
|
2042
|
+
const S = w.getFormatFlags(e, T);
|
|
2043
2043
|
w.setTextFormat(S);
|
|
2044
2044
|
}
|
|
2045
2045
|
});
|
|
@@ -2057,7 +2057,7 @@ class Ve {
|
|
|
2057
2057
|
if (h === m) return;
|
|
2058
2058
|
if (Qe(g) || h === 0 && m === g.getTextContentSize()) g.setFormat(_);
|
|
2059
2059
|
else {
|
|
2060
|
-
const
|
|
2060
|
+
const T = g.splitText(h, m), w = h === 0 ? T[0] : T[1];
|
|
2061
2061
|
w.setFormat(_), u.type === "text" && u.set(w.__key, 0, "text"), d.type === "text" && d.set(w.__key, m - h, "text");
|
|
2062
2062
|
}
|
|
2063
2063
|
return void (this.format = _);
|
|
@@ -2065,8 +2065,8 @@ class Ve {
|
|
|
2065
2065
|
h === 0 || Qe(g) || ([, g] = g.splitText(h), h = 0), g.setFormat(_);
|
|
2066
2066
|
const y = x.getFormatFlags(e, _);
|
|
2067
2067
|
m > 0 && (m === x.getTextContentSize() || Qe(x) || ([x] = x.splitText(m)), x.setFormat(y));
|
|
2068
|
-
for (let
|
|
2069
|
-
const w = i[
|
|
2068
|
+
for (let T = f + 1; T < p; T++) {
|
|
2069
|
+
const w = i[T], S = w.getFormatFlags(e, y);
|
|
2070
2070
|
w.setFormat(S);
|
|
2071
2071
|
}
|
|
2072
2072
|
u.type === "text" && u.set(g.__key, h, "text"), d.type === "text" && d.set(x.__key, m, "text"), this.format = _ | y;
|
|
@@ -2076,10 +2076,10 @@ class Ve {
|
|
|
2076
2076
|
if (this.isCollapsed() || this.removeText(), this.anchor.key === "root") {
|
|
2077
2077
|
this.insertParagraph();
|
|
2078
2078
|
const h = M();
|
|
2079
|
-
return L(h) ||
|
|
2079
|
+
return L(h) || b(134), h.insertNodes(e);
|
|
2080
2080
|
}
|
|
2081
|
-
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), r = Wn(t,
|
|
2082
|
-
if (
|
|
2081
|
+
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), r = Wn(t, be), i = e[e.length - 1];
|
|
2082
|
+
if (C(r) && "__language" in r) {
|
|
2083
2083
|
if ("__language" in e[0]) this.insertText(e[0].getTextContent());
|
|
2084
2084
|
else {
|
|
2085
2085
|
const h = In(this);
|
|
@@ -2087,8 +2087,8 @@ class Ve {
|
|
|
2087
2087
|
}
|
|
2088
2088
|
return;
|
|
2089
2089
|
}
|
|
2090
|
-
if (!e.some((h) => (
|
|
2091
|
-
|
|
2090
|
+
if (!e.some((h) => (C(h) || D(h)) && !h.isInline())) {
|
|
2091
|
+
C(r) || b(211, t.constructor.name, t.getType());
|
|
2092
2092
|
const h = In(this);
|
|
2093
2093
|
return r.splice(h, 0, e), void i.selectEnd();
|
|
2094
2094
|
}
|
|
@@ -2097,26 +2097,26 @@ class Ve {
|
|
|
2097
2097
|
let p = null;
|
|
2098
2098
|
for (let x = 0; x < h.length; x++) {
|
|
2099
2099
|
const m = h[x], y = Ze(m);
|
|
2100
|
-
if (y || D(m) && m.isInline() ||
|
|
2100
|
+
if (y || D(m) && m.isInline() || C(m) && m.isInline() || P(m) || m.isParentRequired()) {
|
|
2101
2101
|
if (p === null && (p = m.createParentElementNode(), _.append(p), y)) continue;
|
|
2102
2102
|
p !== null && p.append(m);
|
|
2103
2103
|
} else _.append(m), p = null;
|
|
2104
2104
|
}
|
|
2105
2105
|
return _;
|
|
2106
|
-
}(e), o = s.getLastDescendant(), l = s.getChildren(), a = !
|
|
2106
|
+
}(e), o = s.getLastDescendant(), l = s.getChildren(), a = !C(r) || !r.isEmpty() ? this.insertParagraph() : null, c = l[l.length - 1];
|
|
2107
2107
|
let u = l[0];
|
|
2108
2108
|
var d;
|
|
2109
|
-
|
|
2109
|
+
C(d = u) && be(d) && !d.isEmpty() && C(r) && (!r.isEmpty() || r.canMergeWhenEmpty()) && (C(r) || b(211, t.constructor.name, t.getType()), r.append(...u.getChildren()), u = l[1]), u && (r === null && b(212, t.constructor.name, t.getType()), function(h, _, p) {
|
|
2110
2110
|
const x = _.getParentOrThrow().getLastChild();
|
|
2111
2111
|
let m = _;
|
|
2112
2112
|
const y = [_];
|
|
2113
|
-
for (; m !== x; ) m.getNextSibling() ||
|
|
2114
|
-
let
|
|
2115
|
-
for (const w of y)
|
|
2113
|
+
for (; m !== x; ) m.getNextSibling() || b(140), m = m.getNextSibling(), y.push(m);
|
|
2114
|
+
let T = h;
|
|
2115
|
+
for (const w of y) T = T.insertAfter(w);
|
|
2116
2116
|
}(r, u));
|
|
2117
|
-
const f = Wn(o,
|
|
2118
|
-
a &&
|
|
2119
|
-
const g =
|
|
2117
|
+
const f = Wn(o, be);
|
|
2118
|
+
a && C(f) && (a.canMergeWhenEmpty() || be(c)) && (f.append(...a.getChildren()), a.remove()), C(r) && r.isEmpty() && r.remove(), o.selectEnd();
|
|
2119
|
+
const g = C(r) ? r.getLastChild() : null;
|
|
2120
2120
|
Ze(g) && f !== r && g.remove();
|
|
2121
2121
|
}
|
|
2122
2122
|
insertParagraph() {
|
|
@@ -2124,13 +2124,13 @@ class Ve {
|
|
|
2124
2124
|
const o = Ne();
|
|
2125
2125
|
return te().splice(this.anchor.offset, 0, [o]), o.select(), o;
|
|
2126
2126
|
}
|
|
2127
|
-
const e = In(this), t = Wn(this.anchor.getNode(),
|
|
2128
|
-
|
|
2127
|
+
const e = In(this), t = Wn(this.anchor.getNode(), be);
|
|
2128
|
+
C(t) || b(213);
|
|
2129
2129
|
const r = t.getChildAtIndex(e), i = r ? [r, ...r.getNextSiblings()] : [], s = t.insertNewAfter(this, !1);
|
|
2130
2130
|
return s ? (s.append(...i), s.selectStart(), s) : null;
|
|
2131
2131
|
}
|
|
2132
2132
|
insertLineBreak(e) {
|
|
2133
|
-
const t =
|
|
2133
|
+
const t = bt();
|
|
2134
2134
|
if (this.insertNodes([t]), e) {
|
|
2135
2135
|
const r = t.getParentOrThrow(), i = t.getIndexWithinParent();
|
|
2136
2136
|
r.select(i, i);
|
|
@@ -2161,10 +2161,10 @@ class Ve {
|
|
|
2161
2161
|
}
|
|
2162
2162
|
modify(e, t, r) {
|
|
2163
2163
|
if (ii(this, e, t, r)) return;
|
|
2164
|
-
const i = e === "move", s = B(), o =
|
|
2164
|
+
const i = e === "move", s = B(), o = ve(ie(s));
|
|
2165
2165
|
if (!o) return;
|
|
2166
2166
|
const l = s._blockCursorElement, a = s._rootElement, c = this.focus.getNode();
|
|
2167
|
-
if (a === null || l === null || !
|
|
2167
|
+
if (a === null || l === null || !C(c) || c.isInline() || c.canBeEmpty() || rr(l, s, a), this.dirty) {
|
|
2168
2168
|
let u = it(s, this.anchor.key), d = it(s, this.focus.key);
|
|
2169
2169
|
this.anchor.type === "text" && (u = rt(u)), this.focus.type === "text" && (d = rt(d)), u && d && os(o, u, this.anchor.offset, d, this.focus.offset);
|
|
2170
2170
|
}
|
|
@@ -2181,23 +2181,23 @@ class Ve {
|
|
|
2181
2181
|
}
|
|
2182
2182
|
if (_ && h.length > 0) if (t) {
|
|
2183
2183
|
const p = h[0];
|
|
2184
|
-
|
|
2184
|
+
C(p) ? p.selectStart() : p.getParentOrThrow().selectStart();
|
|
2185
2185
|
} else {
|
|
2186
2186
|
const p = h[h.length - 1];
|
|
2187
|
-
|
|
2187
|
+
C(p) ? p.selectEnd() : p.getParentOrThrow().selectEnd();
|
|
2188
2188
|
}
|
|
2189
2189
|
o.anchorNode === u.startContainer && o.anchorOffset === u.startOffset || function(p) {
|
|
2190
|
-
const x = p.focus, m = p.anchor, y = m.key,
|
|
2191
|
-
m.set(x.key, x.offset, x.type, !0), x.set(y,
|
|
2190
|
+
const x = p.focus, m = p.anchor, y = m.key, T = m.offset, w = m.type;
|
|
2191
|
+
m.set(x.key, x.offset, x.type, !0), x.set(y, T, w, !0);
|
|
2192
2192
|
}(this);
|
|
2193
2193
|
}
|
|
2194
2194
|
}
|
|
2195
2195
|
r === "lineboundary" && ii(this, e, t, r, "decorators");
|
|
2196
2196
|
}
|
|
2197
2197
|
forwardDeletion(e, t, r) {
|
|
2198
|
-
if (!r && (e.type === "element" &&
|
|
2198
|
+
if (!r && (e.type === "element" && C(t) && e.offset === t.getChildrenSize() || e.type === "text" && e.offset === t.getTextContentSize())) {
|
|
2199
2199
|
const i = t.getParent(), s = t.getNextSibling() || (i === null ? null : i.getNextSibling());
|
|
2200
|
-
if (
|
|
2200
|
+
if (C(s) && s.isShadowRoot()) return !0;
|
|
2201
2201
|
}
|
|
2202
2202
|
return !1;
|
|
2203
2203
|
}
|
|
@@ -2207,14 +2207,14 @@ class Ve {
|
|
|
2207
2207
|
const r = this.anchor;
|
|
2208
2208
|
let i = r.getNode();
|
|
2209
2209
|
if (this.forwardDeletion(r, i, e)) return;
|
|
2210
|
-
const s =
|
|
2210
|
+
const s = bs($e(r, e ? "previous" : "next"));
|
|
2211
2211
|
if (s.getTextSlices().every((l) => l === null || l.distance === 0)) {
|
|
2212
2212
|
let l = { type: "initial" };
|
|
2213
2213
|
for (const a of s.iterNodeCarets("shadowRoot")) if (fe(a)) {
|
|
2214
2214
|
if (!a.origin.isInline()) {
|
|
2215
2215
|
if (a.origin.isShadowRoot()) {
|
|
2216
2216
|
if (l.type === "merge-block") break;
|
|
2217
|
-
if (
|
|
2217
|
+
if (C(s.anchor.origin) && s.anchor.origin.isEmpty()) {
|
|
2218
2218
|
const c = ue(a);
|
|
2219
2219
|
Ht(this, je(c, c)), s.anchor.origin.remove();
|
|
2220
2220
|
}
|
|
@@ -2225,14 +2225,14 @@ class Ve {
|
|
|
2225
2225
|
} else {
|
|
2226
2226
|
if (l.type === "merge-block") break;
|
|
2227
2227
|
if (st(a)) {
|
|
2228
|
-
if (
|
|
2228
|
+
if (C(a.origin)) {
|
|
2229
2229
|
if (a.origin.isInline()) {
|
|
2230
2230
|
if (!a.origin.isParentOf(s.anchor.origin)) break;
|
|
2231
2231
|
} else l = { block: a.origin, type: "merge-next-block" };
|
|
2232
2232
|
continue;
|
|
2233
2233
|
}
|
|
2234
2234
|
if (D(a.origin)) {
|
|
2235
|
-
if (!a.origin.isIsolated()) if (l.type === "merge-next-block" && (a.origin.isKeyboardSelectable() || !a.origin.isInline()) &&
|
|
2235
|
+
if (!a.origin.isIsolated()) if (l.type === "merge-next-block" && (a.origin.isKeyboardSelectable() || !a.origin.isInline()) && C(s.anchor.origin) && s.anchor.origin.isEmpty()) {
|
|
2236
2236
|
s.anchor.origin.remove();
|
|
2237
2237
|
const c = ss();
|
|
2238
2238
|
c.add(a.origin.getKey()), ne(c);
|
|
@@ -2263,8 +2263,8 @@ class Ve {
|
|
|
2263
2263
|
const u = a.anchor, d = a.focus, f = u.getNode(), g = d.getNode();
|
|
2264
2264
|
if (f === g && u.type === "text" && d.type === "text") {
|
|
2265
2265
|
const h = u.offset, _ = d.offset, p = h < _, x = p ? h : _, m = p ? _ : h, y = m - 1;
|
|
2266
|
-
x !== y && function(
|
|
2267
|
-
return !(xs(
|
|
2266
|
+
x !== y && function(T) {
|
|
2267
|
+
return !(xs(T) || Mo(T));
|
|
2268
2268
|
}(f.getTextContent().slice(x, m)) && (c ? d.set(d.key, y, d.type) : u.set(u.key, y, u.type));
|
|
2269
2269
|
}
|
|
2270
2270
|
})(this, e);
|
|
@@ -2310,7 +2310,7 @@ function Xr(n) {
|
|
|
2310
2310
|
}
|
|
2311
2311
|
function Yr(n, e) {
|
|
2312
2312
|
for (let t = e; t; t = t.getParent()) {
|
|
2313
|
-
if (
|
|
2313
|
+
if (C(t)) {
|
|
2314
2314
|
if (t.collapseAtStart(n)) return !0;
|
|
2315
2315
|
if (Ae(t)) break;
|
|
2316
2316
|
}
|
|
@@ -2355,23 +2355,23 @@ function ei(n, e, t, r) {
|
|
|
2355
2355
|
else {
|
|
2356
2356
|
let f = Xe(n);
|
|
2357
2357
|
if (f === null) return null;
|
|
2358
|
-
if (
|
|
2358
|
+
if (C(f)) {
|
|
2359
2359
|
const g = r.getElementByKey(f.getKey());
|
|
2360
|
-
g === null &&
|
|
2360
|
+
g === null && b(214), [f, s] = f.getDOMSlot(g).resolveChildIndex(f, g, n, e), C(f) || b(215), o && s >= f.getChildrenSize() && (s = Math.max(0, f.getChildrenSize() - 1));
|
|
2361
2361
|
let _ = f.getChildAtIndex(s);
|
|
2362
|
-
if (
|
|
2362
|
+
if (C(_) && function(p, x, m) {
|
|
2363
2363
|
const y = p.getParent();
|
|
2364
2364
|
return m === null || y === null || !y.canBeEmpty() || y !== m.getNode();
|
|
2365
2365
|
}(_, 0, t)) {
|
|
2366
2366
|
const p = o ? _.getLastDescendant() : _.getFirstDescendant();
|
|
2367
|
-
p === null ? f = _ : (_ = p, f =
|
|
2367
|
+
p === null ? f = _ : (_ = p, f = C(_) ? _ : _.getParentOrThrow()), s = 0;
|
|
2368
2368
|
}
|
|
2369
|
-
P(_) ? (i = _, f = null, s = gi(_, o)) : _ !== f && o && !d && (
|
|
2369
|
+
P(_) ? (i = _, f = null, s = gi(_, o)) : _ !== f && o && !d && (C(f) || b(216), s = Math.min(f.getChildrenSize(), s + 1));
|
|
2370
2370
|
} else {
|
|
2371
2371
|
const g = f.getIndexWithinParent();
|
|
2372
2372
|
s = e === 0 && D(f) && Xe(n) === f ? g : g + 1, f = f.getParentOrThrow();
|
|
2373
2373
|
}
|
|
2374
|
-
if (
|
|
2374
|
+
if (C(f)) return de(f.__key, s, "element");
|
|
2375
2375
|
}
|
|
2376
2376
|
} else i = Xe(n);
|
|
2377
2377
|
return P(i) ? de(i.__key, s, "text") : null;
|
|
@@ -2381,15 +2381,15 @@ function ti(n, e, t) {
|
|
|
2381
2381
|
if (r === 0) {
|
|
2382
2382
|
const s = i.getPreviousSibling(), o = i.getParent();
|
|
2383
2383
|
if (e) {
|
|
2384
|
-
if ((t || !e) && s === null &&
|
|
2384
|
+
if ((t || !e) && s === null && C(o) && o.isInline()) {
|
|
2385
2385
|
const l = o.getPreviousSibling();
|
|
2386
2386
|
P(l) && n.set(l.__key, l.getTextContent().length, "text");
|
|
2387
2387
|
}
|
|
2388
|
-
} else
|
|
2388
|
+
} else C(s) && !t && s.isInline() ? n.set(s.__key, s.getChildrenSize(), "element") : P(s) && n.set(s.__key, s.getTextContent().length, "text");
|
|
2389
2389
|
} else if (r === i.getTextContent().length) {
|
|
2390
2390
|
const s = i.getNextSibling(), o = i.getParent();
|
|
2391
|
-
if (e &&
|
|
2392
|
-
else if ((t || e) && s === null &&
|
|
2391
|
+
if (e && C(s) && s.isInline()) n.set(s.__key, 0, "element");
|
|
2392
|
+
else if ((t || e) && s === null && C(o) && o.isInline() && !o.canInsertTextAfter()) {
|
|
2393
2393
|
const l = o.getNextSibling();
|
|
2394
2394
|
P(l) && n.set(l.__key, 0, "text");
|
|
2395
2395
|
}
|
|
@@ -2419,7 +2419,7 @@ function rs(n, e, t, r, i, s) {
|
|
|
2419
2419
|
return ns(o, l, s), [o, l];
|
|
2420
2420
|
}
|
|
2421
2421
|
function Pl(n) {
|
|
2422
|
-
return
|
|
2422
|
+
return C(n) && !n.isInline();
|
|
2423
2423
|
}
|
|
2424
2424
|
function is(n, e, t, r, i, s) {
|
|
2425
2425
|
const o = Le(), l = new Ve(de(n, e, i), de(t, r, s), 0, "");
|
|
@@ -2480,21 +2480,21 @@ function an(n, e, t, r = 1) {
|
|
|
2480
2480
|
function ni(n) {
|
|
2481
2481
|
const e = n.anchor, t = e.offset, r = n.focus, i = r.offset, s = e.getNode(), o = r.getNode();
|
|
2482
2482
|
if (n.isCollapsed()) {
|
|
2483
|
-
if (!
|
|
2483
|
+
if (!C(s)) return;
|
|
2484
2484
|
const l = s.getChildrenSize(), a = t >= l, c = a ? s.getChildAtIndex(l - 1) : s.getChildAtIndex(t);
|
|
2485
2485
|
if (P(c)) {
|
|
2486
2486
|
let u = 0;
|
|
2487
2487
|
a && (u = c.getTextContentSize()), e.set(c.__key, u, "text"), r.set(c.__key, u, "text");
|
|
2488
2488
|
}
|
|
2489
2489
|
} else {
|
|
2490
|
-
if (
|
|
2490
|
+
if (C(s)) {
|
|
2491
2491
|
const l = s.getChildrenSize(), a = t >= l, c = a ? s.getChildAtIndex(l - 1) : s.getChildAtIndex(t);
|
|
2492
2492
|
if (P(c)) {
|
|
2493
2493
|
let u = 0;
|
|
2494
2494
|
a && (u = c.getTextContentSize()), e.set(c.__key, u, "text");
|
|
2495
2495
|
}
|
|
2496
2496
|
}
|
|
2497
|
-
if (
|
|
2497
|
+
if (C(o)) {
|
|
2498
2498
|
const l = o.getChildrenSize(), a = i >= l, c = a ? o.getChildAtIndex(l - 1) : o.getChildAtIndex(i);
|
|
2499
2499
|
if (P(c)) {
|
|
2500
2500
|
let u = 0;
|
|
@@ -2505,7 +2505,7 @@ function ni(n) {
|
|
|
2505
2505
|
}
|
|
2506
2506
|
function cn(n, e, t, r, i) {
|
|
2507
2507
|
let s = null, o = 0, l = null;
|
|
2508
|
-
r !== null ? (s = r.__key, P(r) ? (o = r.getTextContentSize(), l = "text") :
|
|
2508
|
+
r !== null ? (s = r.__key, P(r) ? (o = r.getTextContentSize(), l = "text") : C(r) && (o = r.getChildrenSize(), l = "element")) : i !== null && (s = i.__key, P(i) ? l = "text" : C(i) && (l = "element")), s !== null && l !== null ? n.set(s, o, l) : (o = e.getIndexWithinParent(), o === -1 && (o = t.getChildrenSize()), n.set(t.__key, o, "element"));
|
|
2509
2509
|
}
|
|
2510
2510
|
function ri(n, e, t, r, i) {
|
|
2511
2511
|
n.type === "text" ? n.set(t, n.offset + (e ? 0 : i), "text") : n.offset > r.getIndexWithinParent() && n.set(n.key, n.offset - 1, "element");
|
|
@@ -2520,16 +2520,16 @@ function Do(n, e, t, r, i, s, o) {
|
|
|
2520
2520
|
const l = r.anchorNode, a = r.focusNode, c = r.anchorOffset, u = r.focusOffset, d = document.activeElement;
|
|
2521
2521
|
if (i.has("collaboration") && d !== s || d !== null && hs(d)) return;
|
|
2522
2522
|
if (!L(e)) return void (n !== null && Sn(t, l, a) && r.removeAllRanges());
|
|
2523
|
-
const f = e.anchor, g = e.focus, h = f.key, _ = g.key, p = it(t, h), x = it(t, _), m = f.offset, y = g.offset,
|
|
2524
|
-
let N = p,
|
|
2523
|
+
const f = e.anchor, g = e.focus, h = f.key, _ = g.key, p = it(t, h), x = it(t, _), m = f.offset, y = g.offset, T = e.format, w = e.style, S = e.isCollapsed();
|
|
2524
|
+
let N = p, k = x, v = !1;
|
|
2525
2525
|
if (f.type === "text") {
|
|
2526
2526
|
N = rt(p);
|
|
2527
2527
|
const z = f.getNode();
|
|
2528
|
-
|
|
2529
|
-
} else L(n) && n.anchor.type === "text" && (
|
|
2528
|
+
v = z.getFormat() !== T || z.getStyle() !== w;
|
|
2529
|
+
} else L(n) && n.anchor.type === "text" && (v = !0);
|
|
2530
2530
|
var F, O, W, I, A;
|
|
2531
|
-
if (g.type === "text" && (
|
|
2532
|
-
if (os(r, N, m,
|
|
2531
|
+
if (g.type === "text" && (k = rt(x)), N !== null && k !== null && (S && (n === null || v || L(n) && (n.format !== T || n.style !== w)) && (F = T, O = w, W = m, I = h, A = performance.now(), Hi = [F, O, W, I, A]), c !== m || u !== y || l !== N || a !== k || r.type === "Range" && S || (d !== null && s.contains(d) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
2532
|
+
if (os(r, N, m, k, y), !i.has("skip-scroll-into-view") && e.isCollapsed() && s !== null && s === document.activeElement) {
|
|
2533
2533
|
const z = L(e) && e.anchor.type === "element" ? N.childNodes[m] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null;
|
|
2534
2534
|
if (z !== null) {
|
|
2535
2535
|
let $;
|
|
@@ -2538,26 +2538,26 @@ function Do(n, e, t, r, i, s, o) {
|
|
|
2538
2538
|
he.selectNode(z), $ = he.getBoundingClientRect();
|
|
2539
2539
|
} else $ = z.getBoundingClientRect();
|
|
2540
2540
|
(function(he, ge, _e) {
|
|
2541
|
-
const ct =
|
|
2541
|
+
const ct = ks(_e), Fr = Tr(ct);
|
|
2542
2542
|
if (ct === null || Fr === null) return;
|
|
2543
|
-
let { top:
|
|
2544
|
-
for (;
|
|
2545
|
-
const Nn =
|
|
2543
|
+
let { top: Tn, bottom: wn } = ge, It = 0, Dt = 0, ke = _e;
|
|
2544
|
+
for (; ke !== null; ) {
|
|
2545
|
+
const Nn = ke === ct.body;
|
|
2546
2546
|
if (Nn) It = 0, Dt = ie(he).innerHeight;
|
|
2547
2547
|
else {
|
|
2548
|
-
const zt =
|
|
2548
|
+
const zt = ke.getBoundingClientRect();
|
|
2549
2549
|
It = zt.top, Dt = zt.bottom;
|
|
2550
2550
|
}
|
|
2551
2551
|
let ut = 0;
|
|
2552
|
-
if (
|
|
2552
|
+
if (Tn < It ? ut = -(It - Tn) : wn > Dt && (ut = wn - Dt), ut !== 0) if (Nn) Fr.scrollBy(0, ut);
|
|
2553
2553
|
else {
|
|
2554
|
-
const zt =
|
|
2555
|
-
|
|
2556
|
-
const Lr =
|
|
2557
|
-
|
|
2554
|
+
const zt = ke.scrollTop;
|
|
2555
|
+
ke.scrollTop += ut;
|
|
2556
|
+
const Lr = ke.scrollTop - zt;
|
|
2557
|
+
Tn -= Lr, wn -= Lr;
|
|
2558
2558
|
}
|
|
2559
2559
|
if (Nn) break;
|
|
2560
|
-
|
|
2560
|
+
ke = At(ke);
|
|
2561
2561
|
}
|
|
2562
2562
|
})(t, $, s);
|
|
2563
2563
|
}
|
|
@@ -2573,10 +2573,10 @@ function In(n) {
|
|
|
2573
2573
|
let e = n;
|
|
2574
2574
|
n.isCollapsed() || e.removeText();
|
|
2575
2575
|
const t = M();
|
|
2576
|
-
L(t) && (e = t), L(e) ||
|
|
2576
|
+
L(t) && (e = t), L(e) || b(161);
|
|
2577
2577
|
const r = e.anchor;
|
|
2578
2578
|
let i = r.getNode(), s = r.offset;
|
|
2579
|
-
for (; !
|
|
2579
|
+
for (; !be(i); ) {
|
|
2580
2580
|
const o = i;
|
|
2581
2581
|
if ([i, s] = zo(i, s), o.is(i)) break;
|
|
2582
2582
|
}
|
|
@@ -2594,7 +2594,7 @@ function zo(n, e) {
|
|
|
2594
2594
|
const s = e === 0 ? 0 : 1;
|
|
2595
2595
|
return [t, i[0].getIndexWithinParent() + s];
|
|
2596
2596
|
}
|
|
2597
|
-
if (!
|
|
2597
|
+
if (!C(n) || e === 0) return [t, n.getIndexWithinParent()];
|
|
2598
2598
|
const r = n.getChildAtIndex(e);
|
|
2599
2599
|
if (r) {
|
|
2600
2600
|
const i = new Ve(de(n.__key, e, "element"), de(n.__key, e, "element"), 0, ""), s = n.insertNewAfter(i);
|
|
@@ -2615,10 +2615,10 @@ function ii(n, e, t, r, i = "decorators-and-blocks") {
|
|
|
2615
2615
|
const { origin: d } = u;
|
|
2616
2616
|
if (!D(d) || d.isIsolated() || (a = u, !o || !d.isInline())) break;
|
|
2617
2617
|
}
|
|
2618
|
-
if (c) for (const u of
|
|
2618
|
+
if (c) for (const u of bs(s).iterNodeCarets(e === "extend" ? "shadowRoot" : "root")) {
|
|
2619
2619
|
if (fe(u)) u.origin.isInline() || (a = u);
|
|
2620
2620
|
else {
|
|
2621
|
-
if (
|
|
2621
|
+
if (C(u.origin)) continue;
|
|
2622
2622
|
D(u.origin) && !u.origin.isInline() && (a = u);
|
|
2623
2623
|
}
|
|
2624
2624
|
break;
|
|
@@ -2637,22 +2637,22 @@ function Pt() {
|
|
|
2637
2637
|
return X || K !== null && K._readOnly;
|
|
2638
2638
|
}
|
|
2639
2639
|
function H() {
|
|
2640
|
-
X &&
|
|
2640
|
+
X && b(13);
|
|
2641
2641
|
}
|
|
2642
2642
|
function ls() {
|
|
2643
|
-
Vt > 99 &&
|
|
2643
|
+
Vt > 99 && b(14);
|
|
2644
2644
|
}
|
|
2645
2645
|
function Le() {
|
|
2646
|
-
return K === null &&
|
|
2646
|
+
return K === null && b(195, as()), K;
|
|
2647
2647
|
}
|
|
2648
2648
|
function B() {
|
|
2649
|
-
return J === null &&
|
|
2649
|
+
return J === null && b(196, as()), J;
|
|
2650
2650
|
}
|
|
2651
2651
|
function as() {
|
|
2652
2652
|
let n = 0;
|
|
2653
2653
|
const e = /* @__PURE__ */ new Set(), t = xn.version;
|
|
2654
2654
|
if (typeof window < "u") for (const i of document.querySelectorAll("[contenteditable]")) {
|
|
2655
|
-
const s =
|
|
2655
|
+
const s = vn(i);
|
|
2656
2656
|
if (xr(s)) n++;
|
|
2657
2657
|
else if (s) {
|
|
2658
2658
|
let o = String(s.constructor.version || "<0.17.1");
|
|
@@ -2668,7 +2668,7 @@ function Bo() {
|
|
|
2668
2668
|
function oi(n, e, t) {
|
|
2669
2669
|
const r = e.__type, i = function(l, a) {
|
|
2670
2670
|
const c = l._nodes.get(a);
|
|
2671
|
-
return c === void 0 &&
|
|
2671
|
+
return c === void 0 && b(30, a), c;
|
|
2672
2672
|
}(n, r);
|
|
2673
2673
|
let s = t.get(r);
|
|
2674
2674
|
s === void 0 && (s = Array.from(i.transforms), t.set(r, s));
|
|
@@ -2690,11 +2690,11 @@ function Al(n) {
|
|
|
2690
2690
|
}
|
|
2691
2691
|
function pr(n, e) {
|
|
2692
2692
|
const t = n.type, r = e.get(t);
|
|
2693
|
-
r === void 0 &&
|
|
2693
|
+
r === void 0 && b(17, t);
|
|
2694
2694
|
const i = r.klass;
|
|
2695
|
-
n.type !== i.getType() &&
|
|
2695
|
+
n.type !== i.getType() && b(18, i.name);
|
|
2696
2696
|
const s = i.importJSON(n), o = n.children;
|
|
2697
|
-
if (
|
|
2697
|
+
if (C(s) && Array.isArray(o)) for (let l = 0; l < o.length; l++) {
|
|
2698
2698
|
const a = pr(o[l], e);
|
|
2699
2699
|
s.append(a);
|
|
2700
2700
|
}
|
|
@@ -2717,8 +2717,8 @@ function xe(n, e) {
|
|
|
2717
2717
|
if (n._pendingEditorState = null, n._editorState = t, !i && a && g !== null) {
|
|
2718
2718
|
J = n, K = t, X = !1, n._updating = !0;
|
|
2719
2719
|
try {
|
|
2720
|
-
const S = n._dirtyType, N = n._dirtyElements,
|
|
2721
|
-
g.disconnect(), h = ro(s, t, n, S, N,
|
|
2720
|
+
const S = n._dirtyType, N = n._dirtyElements, k = n._dirtyLeaves;
|
|
2721
|
+
g.disconnect(), h = ro(s, t, n, S, N, k);
|
|
2722
2722
|
} catch (S) {
|
|
2723
2723
|
if (S instanceof Error && n._onError(S), Dn) throw S;
|
|
2724
2724
|
return ds(n, null, r, t), Mi(n), n._dirtyType = nt, Dn = !0, xe(n, s), void (Dn = !1);
|
|
@@ -2729,24 +2729,24 @@ function xe(n, e) {
|
|
|
2729
2729
|
t._readOnly || (t._readOnly = !0);
|
|
2730
2730
|
const _ = n._dirtyLeaves, p = n._dirtyElements, x = n._normalizedNodes, m = n._updateTags, y = n._deferred;
|
|
2731
2731
|
a && (n._dirtyType = ze, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements = /* @__PURE__ */ new Map(), n._normalizedNodes = /* @__PURE__ */ new Set(), n._updateTags = /* @__PURE__ */ new Set()), function(S, N) {
|
|
2732
|
-
const
|
|
2733
|
-
let
|
|
2732
|
+
const k = S._decorators;
|
|
2733
|
+
let v = S._pendingDecorators || k;
|
|
2734
2734
|
const F = N._nodeMap;
|
|
2735
2735
|
let O;
|
|
2736
|
-
for (O in
|
|
2736
|
+
for (O in v) F.has(O) || (v === k && (v = ms(S)), delete v[O]);
|
|
2737
2737
|
}(n, t);
|
|
2738
|
-
const
|
|
2739
|
-
if (n._editable &&
|
|
2738
|
+
const T = i ? null : ve(ie(n));
|
|
2739
|
+
if (n._editable && T !== null && (a || l === null || l.dirty) && r !== null && !m.has("skip-dom-selection")) {
|
|
2740
2740
|
J = n, K = t;
|
|
2741
2741
|
try {
|
|
2742
2742
|
if (g !== null && g.disconnect(), a || l === null || l.dirty) {
|
|
2743
2743
|
const S = n._blockCursorElement;
|
|
2744
|
-
S !== null && rr(S, n, r), Do(o, l, n,
|
|
2744
|
+
S !== null && rr(S, n, r), Do(o, l, n, T, m, r);
|
|
2745
2745
|
}
|
|
2746
|
-
(function(S, N,
|
|
2747
|
-
let
|
|
2748
|
-
if (L(
|
|
2749
|
-
const F =
|
|
2746
|
+
(function(S, N, k) {
|
|
2747
|
+
let v = S._blockCursorElement;
|
|
2748
|
+
if (L(k) && k.isCollapsed() && k.anchor.type === "element" && N.contains(document.activeElement)) {
|
|
2749
|
+
const F = k.anchor, O = F.getNode(), W = F.offset;
|
|
2750
2750
|
let I = !1, A = null;
|
|
2751
2751
|
if (W === O.getChildrenSize())
|
|
2752
2752
|
Bn(O.getChildAtIndex(W - 1)) && (I = !0);
|
|
@@ -2759,7 +2759,7 @@ function xe(n, e) {
|
|
|
2759
2759
|
}
|
|
2760
2760
|
if (I) {
|
|
2761
2761
|
const z = S.getElementByKey(O.__key);
|
|
2762
|
-
return
|
|
2762
|
+
return v === null && (S._blockCursorElement = v = function($) {
|
|
2763
2763
|
const he = $.theme, ge = document.createElement("div");
|
|
2764
2764
|
ge.contentEditable = "false", ge.setAttribute("data-lexical-cursor", "true");
|
|
2765
2765
|
let _e = he.blockCursor;
|
|
@@ -2771,43 +2771,43 @@ function xe(n, e) {
|
|
|
2771
2771
|
_e !== void 0 && ge.classList.add(..._e);
|
|
2772
2772
|
}
|
|
2773
2773
|
return ge;
|
|
2774
|
-
}(S._config)), N.style.caretColor = "transparent", void (A === null ? z.appendChild(
|
|
2774
|
+
}(S._config)), N.style.caretColor = "transparent", void (A === null ? z.appendChild(v) : z.insertBefore(v, A));
|
|
2775
2775
|
}
|
|
2776
2776
|
}
|
|
2777
|
-
|
|
2777
|
+
v !== null && rr(v, S, N);
|
|
2778
2778
|
})(n, r, l);
|
|
2779
2779
|
} finally {
|
|
2780
2780
|
g !== null && g.observe(r, si), J = d, K = c;
|
|
2781
2781
|
}
|
|
2782
2782
|
}
|
|
2783
|
-
h !== null && function(S, N,
|
|
2783
|
+
h !== null && function(S, N, k, v, F) {
|
|
2784
2784
|
const O = Array.from(S._listeners.mutation), W = O.length;
|
|
2785
2785
|
for (let I = 0; I < W; I++) {
|
|
2786
2786
|
const [A, z] = O[I], $ = N.get(z);
|
|
2787
|
-
$ !== void 0 && A($, { dirtyLeaves:
|
|
2787
|
+
$ !== void 0 && A($, { dirtyLeaves: v, prevEditorState: F, updateTags: k });
|
|
2788
2788
|
}
|
|
2789
2789
|
}(n, h, m, _, s), L(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(Ki, void 0);
|
|
2790
2790
|
const w = n._pendingDecorators;
|
|
2791
|
-
w !== null && (n._decorators = w, n._pendingDecorators = null, yt("decorator", n, !0, w)), function(S, N,
|
|
2792
|
-
const
|
|
2793
|
-
|
|
2791
|
+
w !== null && (n._decorators = w, n._pendingDecorators = null, yt("decorator", n, !0, w)), function(S, N, k) {
|
|
2792
|
+
const v = hi(N), F = hi(k);
|
|
2793
|
+
v !== F && yt("textcontent", S, !0, F);
|
|
2794
2794
|
}(n, e || s, t), yt("update", n, !0, { dirtyElements: p, dirtyLeaves: _, editorState: t, mutatedNodes: h, normalizedNodes: x, prevEditorState: e || s, tags: m }), function(S, N) {
|
|
2795
2795
|
if (S._deferred = [], N.length !== 0) {
|
|
2796
|
-
const
|
|
2796
|
+
const k = S._updating;
|
|
2797
2797
|
S._updating = !0;
|
|
2798
2798
|
try {
|
|
2799
|
-
for (let
|
|
2799
|
+
for (let v = 0; v < N.length; v++) N[v]();
|
|
2800
2800
|
} finally {
|
|
2801
|
-
S._updating =
|
|
2801
|
+
S._updating = k;
|
|
2802
2802
|
}
|
|
2803
2803
|
}
|
|
2804
2804
|
}(n, y), function(S) {
|
|
2805
2805
|
const N = S._updates;
|
|
2806
2806
|
if (N.length !== 0) {
|
|
2807
|
-
const
|
|
2808
|
-
if (
|
|
2809
|
-
const [
|
|
2810
|
-
mr(S,
|
|
2807
|
+
const k = N.shift();
|
|
2808
|
+
if (k) {
|
|
2809
|
+
const [v, F] = k;
|
|
2810
|
+
mr(S, v, F);
|
|
2811
2811
|
}
|
|
2812
2812
|
}
|
|
2813
2813
|
}(n);
|
|
@@ -2833,7 +2833,7 @@ function ci(n, e) {
|
|
|
2833
2833
|
if (o !== void 0) {
|
|
2834
2834
|
if (l = o.onUpdate, o.skipTransforms && (r = !0), o.discrete) {
|
|
2835
2835
|
const a = n._pendingEditorState;
|
|
2836
|
-
a === null &&
|
|
2836
|
+
a === null && b(191), a._flushSync = !0;
|
|
2837
2837
|
}
|
|
2838
2838
|
l && n._deferred.push(l), cs(n, o.tag);
|
|
2839
2839
|
}
|
|
@@ -2854,37 +2854,37 @@ function mr(n, e, t) {
|
|
|
2854
2854
|
const h = n._headless || n.getRootElement() === null;
|
|
2855
2855
|
try {
|
|
2856
2856
|
c && (h ? l._selection !== null && (a._selection = l._selection.clone()) : a._selection = function(m, y) {
|
|
2857
|
-
const
|
|
2858
|
-
return L(
|
|
2857
|
+
const T = m.getEditorState()._selection, w = ve(ie(m));
|
|
2858
|
+
return L(T) || T == null ? pn(T, w, m, y) : T.clone();
|
|
2859
2859
|
}(n, t && t.event || null));
|
|
2860
2860
|
const p = n._compositionKey;
|
|
2861
2861
|
e(), s = ci(n, s), function(m, y) {
|
|
2862
|
-
const
|
|
2862
|
+
const T = y.getEditorState()._selection, w = m._selection;
|
|
2863
2863
|
if (L(w)) {
|
|
2864
2864
|
const S = w.anchor, N = w.focus;
|
|
2865
|
-
let
|
|
2866
|
-
if (S.type === "text" && (
|
|
2867
|
-
const
|
|
2868
|
-
|
|
2865
|
+
let k;
|
|
2866
|
+
if (S.type === "text" && (k = S.getNode(), k.selectionTransform(T, w)), N.type === "text") {
|
|
2867
|
+
const v = N.getNode();
|
|
2868
|
+
k !== v && v.selectionTransform(T, w);
|
|
2869
2869
|
}
|
|
2870
2870
|
}
|
|
2871
2871
|
}(a, n), n._dirtyType !== ze && (s ? function(m, y) {
|
|
2872
|
-
const
|
|
2873
|
-
for (const S of
|
|
2872
|
+
const T = y._dirtyLeaves, w = m._nodeMap;
|
|
2873
|
+
for (const S of T) {
|
|
2874
2874
|
const N = w.get(S);
|
|
2875
2875
|
P(N) && N.isAttached() && N.isSimpleText() && !N.isUnmergeable() && Dr(N);
|
|
2876
2876
|
}
|
|
2877
2877
|
}(a, n) : function(m, y) {
|
|
2878
|
-
const
|
|
2879
|
-
let
|
|
2878
|
+
const T = y._dirtyLeaves, w = y._dirtyElements, S = m._nodeMap, N = Te(), k = /* @__PURE__ */ new Map();
|
|
2879
|
+
let v = T, F = v.size, O = w, W = O.size;
|
|
2880
2880
|
for (; F > 0 || W > 0; ) {
|
|
2881
2881
|
if (F > 0) {
|
|
2882
2882
|
y._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
2883
|
-
for (const I of
|
|
2883
|
+
for (const I of v) {
|
|
2884
2884
|
const A = S.get(I);
|
|
2885
|
-
P(A) && A.isAttached() && A.isSimpleText() && !A.isUnmergeable() && Dr(A), A !== void 0 && li(A, N) && oi(y, A,
|
|
2885
|
+
P(A) && A.isAttached() && A.isSimpleText() && !A.isUnmergeable() && Dr(A), A !== void 0 && li(A, N) && oi(y, A, k), T.add(I);
|
|
2886
2886
|
}
|
|
2887
|
-
if (
|
|
2887
|
+
if (v = y._dirtyLeaves, F = v.size, F > 0) {
|
|
2888
2888
|
Vt++;
|
|
2889
2889
|
continue;
|
|
2890
2890
|
}
|
|
@@ -2894,27 +2894,27 @@ function mr(n, e, t) {
|
|
|
2894
2894
|
const A = I[0], z = I[1];
|
|
2895
2895
|
if (w.set(A, z), !z) continue;
|
|
2896
2896
|
const $ = S.get(A);
|
|
2897
|
-
$ !== void 0 && li($, N) && oi(y, $,
|
|
2897
|
+
$ !== void 0 && li($, N) && oi(y, $, k);
|
|
2898
2898
|
}
|
|
2899
|
-
|
|
2899
|
+
v = y._dirtyLeaves, F = v.size, O = y._dirtyElements, W = O.size, Vt++;
|
|
2900
2900
|
}
|
|
2901
|
-
y._dirtyLeaves =
|
|
2902
|
-
}(a, n), ci(n), function(m, y,
|
|
2903
|
-
const S = m._nodeMap, N = y._nodeMap,
|
|
2904
|
-
for (const [
|
|
2905
|
-
const F = N.get(
|
|
2906
|
-
F !== void 0 && (F.isAttached() || (
|
|
2901
|
+
y._dirtyLeaves = T, y._dirtyElements = w;
|
|
2902
|
+
}(a, n), ci(n), function(m, y, T, w) {
|
|
2903
|
+
const S = m._nodeMap, N = y._nodeMap, k = [];
|
|
2904
|
+
for (const [v] of w) {
|
|
2905
|
+
const F = N.get(v);
|
|
2906
|
+
F !== void 0 && (F.isAttached() || (C(F) && Li(F, v, S, N, k, w), S.has(v) || w.delete(v), k.push(v)));
|
|
2907
2907
|
}
|
|
2908
|
-
for (const
|
|
2909
|
-
for (const
|
|
2910
|
-
const F = N.get(
|
|
2911
|
-
F === void 0 || F.isAttached() || (S.has(
|
|
2908
|
+
for (const v of k) N.delete(v);
|
|
2909
|
+
for (const v of T) {
|
|
2910
|
+
const F = N.get(v);
|
|
2911
|
+
F === void 0 || F.isAttached() || (S.has(v) || T.delete(v), N.delete(v));
|
|
2912
2912
|
}
|
|
2913
2913
|
}(l, a, n._dirtyLeaves, n._dirtyElements)), p !== n._compositionKey && (a._flushSync = !0);
|
|
2914
2914
|
const x = a._selection;
|
|
2915
2915
|
if (L(x)) {
|
|
2916
|
-
const m = a._nodeMap, y = x.anchor.key,
|
|
2917
|
-
m.get(y) !== void 0 && m.get(
|
|
2916
|
+
const m = a._nodeMap, y = x.anchor.key, T = x.focus.key;
|
|
2917
|
+
m.get(y) !== void 0 && m.get(T) !== void 0 || b(19);
|
|
2918
2918
|
} else _r(x) && x._nodes.size === 0 && (a._selection = null);
|
|
2919
2919
|
} catch (p) {
|
|
2920
2920
|
return p instanceof Error && n._onError(p), n._pendingEditorState = l, n._dirtyType = nt, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements.clear(), void xe(n);
|
|
@@ -2949,13 +2949,13 @@ class xt {
|
|
|
2949
2949
|
}
|
|
2950
2950
|
insertChild(e) {
|
|
2951
2951
|
const t = this.before || this.getManagedLineBreak();
|
|
2952
|
-
return t !== null && t.parentElement !== this.element &&
|
|
2952
|
+
return t !== null && t.parentElement !== this.element && b(222), this.element.insertBefore(e, t), this;
|
|
2953
2953
|
}
|
|
2954
2954
|
removeChild(e) {
|
|
2955
|
-
return e.parentElement !== this.element &&
|
|
2955
|
+
return e.parentElement !== this.element && b(223), this.element.removeChild(e), this;
|
|
2956
2956
|
}
|
|
2957
2957
|
replaceChild(e, t) {
|
|
2958
|
-
return t.parentElement !== this.element &&
|
|
2958
|
+
return t.parentElement !== this.element && b(224), this.element.replaceChild(e, t), this;
|
|
2959
2959
|
}
|
|
2960
2960
|
getFirstChild() {
|
|
2961
2961
|
const e = this.after ? this.after.nextSibling : this.element.firstChild;
|
|
@@ -3023,7 +3023,7 @@ function ui(n, e) {
|
|
|
3023
3023
|
for (let s = r.previousSibling; s !== null; s = s.previousSibling) i++;
|
|
3024
3024
|
t.push(i);
|
|
3025
3025
|
}
|
|
3026
|
-
return r !== n &&
|
|
3026
|
+
return r !== n && b(225), t.reverse();
|
|
3027
3027
|
}
|
|
3028
3028
|
class mn extends gn {
|
|
3029
3029
|
constructor(e) {
|
|
@@ -3075,7 +3075,7 @@ class mn extends gn {
|
|
|
3075
3075
|
const e = [];
|
|
3076
3076
|
let t = this.getFirstChild();
|
|
3077
3077
|
for (; t !== null; ) {
|
|
3078
|
-
if (P(t) && e.push(t),
|
|
3078
|
+
if (P(t) && e.push(t), C(t)) {
|
|
3079
3079
|
const r = t.getAllTextNodes();
|
|
3080
3080
|
e.push(...r);
|
|
3081
3081
|
}
|
|
@@ -3085,7 +3085,7 @@ class mn extends gn {
|
|
|
3085
3085
|
}
|
|
3086
3086
|
getFirstDescendant() {
|
|
3087
3087
|
let e = this.getFirstChild();
|
|
3088
|
-
for (;
|
|
3088
|
+
for (; C(e); ) {
|
|
3089
3089
|
const t = e.getFirstChild();
|
|
3090
3090
|
if (t === null) break;
|
|
3091
3091
|
e = t;
|
|
@@ -3094,7 +3094,7 @@ class mn extends gn {
|
|
|
3094
3094
|
}
|
|
3095
3095
|
getLastDescendant() {
|
|
3096
3096
|
let e = this.getLastChild();
|
|
3097
|
-
for (;
|
|
3097
|
+
for (; C(e); ) {
|
|
3098
3098
|
const t = e.getLastChild();
|
|
3099
3099
|
if (t === null) break;
|
|
3100
3100
|
e = t;
|
|
@@ -3105,10 +3105,10 @@ class mn extends gn {
|
|
|
3105
3105
|
const t = this.getChildren(), r = t.length;
|
|
3106
3106
|
if (e >= r) {
|
|
3107
3107
|
const s = t[r - 1];
|
|
3108
|
-
return
|
|
3108
|
+
return C(s) && s.getLastDescendant() || s || null;
|
|
3109
3109
|
}
|
|
3110
3110
|
const i = t[e];
|
|
3111
|
-
return
|
|
3111
|
+
return C(i) && i.getFirstDescendant() || i || null;
|
|
3112
3112
|
}
|
|
3113
3113
|
getFirstChild() {
|
|
3114
3114
|
const e = this.getLatest().__first;
|
|
@@ -3116,7 +3116,7 @@ class mn extends gn {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
getFirstChildOrThrow() {
|
|
3118
3118
|
const e = this.getFirstChild();
|
|
3119
|
-
return e === null &&
|
|
3119
|
+
return e === null && b(45, this.__key), e;
|
|
3120
3120
|
}
|
|
3121
3121
|
getLastChild() {
|
|
3122
3122
|
const e = this.getLatest().__last;
|
|
@@ -3124,7 +3124,7 @@ class mn extends gn {
|
|
|
3124
3124
|
}
|
|
3125
3125
|
getLastChildOrThrow() {
|
|
3126
3126
|
const e = this.getLastChild();
|
|
3127
|
-
return e === null &&
|
|
3127
|
+
return e === null && b(96, this.__key), e;
|
|
3128
3128
|
}
|
|
3129
3129
|
getChildAtIndex(e) {
|
|
3130
3130
|
const t = this.getChildrenSize();
|
|
@@ -3147,7 +3147,7 @@ class mn extends gn {
|
|
|
3147
3147
|
const t = this.getChildren(), r = t.length;
|
|
3148
3148
|
for (let i = 0; i < r; i++) {
|
|
3149
3149
|
const s = t[i];
|
|
3150
|
-
e += s.getTextContent(),
|
|
3150
|
+
e += s.getTextContent(), C(s) && i !== r - 1 && !s.isInline() && (e += Se);
|
|
3151
3151
|
}
|
|
3152
3152
|
return e;
|
|
3153
3153
|
}
|
|
@@ -3156,7 +3156,7 @@ class mn extends gn {
|
|
|
3156
3156
|
const t = this.getChildren(), r = t.length;
|
|
3157
3157
|
for (let i = 0; i < r; i++) {
|
|
3158
3158
|
const s = t[i];
|
|
3159
|
-
e += s.getTextContentSize(),
|
|
3159
|
+
e += s.getTextContentSize(), C(s) && i !== r - 1 && !s.isInline() && (e += Se.length);
|
|
3160
3160
|
}
|
|
3161
3161
|
return e;
|
|
3162
3162
|
}
|
|
@@ -3191,10 +3191,10 @@ class mn extends gn {
|
|
|
3191
3191
|
if (!this.canBeEmpty()) {
|
|
3192
3192
|
if (e === 0 && t === 0) {
|
|
3193
3193
|
const a = this.getFirstChild();
|
|
3194
|
-
if (P(a) ||
|
|
3194
|
+
if (P(a) || C(a)) return a.select(0, 0);
|
|
3195
3195
|
} else if (!(e !== void 0 && e !== o || t !== void 0 && t !== o)) {
|
|
3196
3196
|
const a = this.getLastChild();
|
|
3197
|
-
if (P(a) ||
|
|
3197
|
+
if (P(a) || C(a)) return a.select();
|
|
3198
3198
|
}
|
|
3199
3199
|
}
|
|
3200
3200
|
i === void 0 && (i = o), s === void 0 && (s = o);
|
|
@@ -3239,7 +3239,7 @@ class mn extends gn {
|
|
|
3239
3239
|
}
|
|
3240
3240
|
splice(e, t, r) {
|
|
3241
3241
|
const i = r.length, s = this.getChildrenSize(), o = this.getWritable();
|
|
3242
|
-
e + t <= s ||
|
|
3242
|
+
e + t <= s || b(226, String(e), String(t), String(s));
|
|
3243
3243
|
const l = o.__key, a = [], c = [], u = this.getChildAtIndex(e + t);
|
|
3244
3244
|
let d = null, f = s - t + i;
|
|
3245
3245
|
if (e !== 0) if (e === s) d = this.getLastChild();
|
|
@@ -3250,7 +3250,7 @@ class mn extends gn {
|
|
|
3250
3250
|
if (t > 0) {
|
|
3251
3251
|
let h = d === null ? this.getFirstChild() : d.getNextSibling();
|
|
3252
3252
|
for (let _ = 0; _ < t; _++) {
|
|
3253
|
-
h === null &&
|
|
3253
|
+
h === null && b(100);
|
|
3254
3254
|
const p = h.getNextSibling(), x = h.__key;
|
|
3255
3255
|
De(h.getWritable()), c.push(x), h = p;
|
|
3256
3256
|
}
|
|
@@ -3267,7 +3267,7 @@ class mn extends gn {
|
|
|
3267
3267
|
const m = g.getWritable();
|
|
3268
3268
|
m.__next = x, p.__prev = m.__key;
|
|
3269
3269
|
}
|
|
3270
|
-
_.__key === l &&
|
|
3270
|
+
_.__key === l && b(76), p.__parent = l, a.push(x), g = _;
|
|
3271
3271
|
}
|
|
3272
3272
|
if (e + t === s)
|
|
3273
3273
|
g !== null && (g.getWritable().__next = null, o.__last = g.__key);
|
|
@@ -3358,7 +3358,7 @@ class mn extends gn {
|
|
|
3358
3358
|
}
|
|
3359
3359
|
}
|
|
3360
3360
|
}
|
|
3361
|
-
function
|
|
3361
|
+
function C(n) {
|
|
3362
3362
|
return n instanceof mn;
|
|
3363
3363
|
}
|
|
3364
3364
|
function fi(n, e, t) {
|
|
@@ -3372,7 +3372,7 @@ function fi(n, e, t) {
|
|
|
3372
3372
|
}
|
|
3373
3373
|
class Wo extends gn {
|
|
3374
3374
|
decorate(e, t) {
|
|
3375
|
-
|
|
3375
|
+
b(47);
|
|
3376
3376
|
}
|
|
3377
3377
|
isIsolated() {
|
|
3378
3378
|
return !1;
|
|
@@ -3398,29 +3398,29 @@ class Ft extends mn {
|
|
|
3398
3398
|
super("root"), this.__cachedText = null;
|
|
3399
3399
|
}
|
|
3400
3400
|
getTopLevelElementOrThrow() {
|
|
3401
|
-
|
|
3401
|
+
b(51);
|
|
3402
3402
|
}
|
|
3403
3403
|
getTextContent() {
|
|
3404
3404
|
const e = this.__cachedText;
|
|
3405
3405
|
return !Pt() && B()._dirtyType !== ze || e === null ? super.getTextContent() : e;
|
|
3406
3406
|
}
|
|
3407
3407
|
remove() {
|
|
3408
|
-
|
|
3408
|
+
b(52);
|
|
3409
3409
|
}
|
|
3410
3410
|
replace(e) {
|
|
3411
|
-
|
|
3411
|
+
b(53);
|
|
3412
3412
|
}
|
|
3413
3413
|
insertBefore(e) {
|
|
3414
|
-
|
|
3414
|
+
b(54);
|
|
3415
3415
|
}
|
|
3416
3416
|
insertAfter(e) {
|
|
3417
|
-
|
|
3417
|
+
b(55);
|
|
3418
3418
|
}
|
|
3419
3419
|
updateDOM(e, t) {
|
|
3420
3420
|
return !1;
|
|
3421
3421
|
}
|
|
3422
3422
|
splice(e, t, r) {
|
|
3423
|
-
for (const i of r)
|
|
3423
|
+
for (const i of r) C(i) || D(i) || b(282);
|
|
3424
3424
|
return super.splice(e, t, r);
|
|
3425
3425
|
}
|
|
3426
3426
|
static importJSON(e) {
|
|
@@ -3441,9 +3441,9 @@ function yr() {
|
|
|
3441
3441
|
}
|
|
3442
3442
|
function fs(n) {
|
|
3443
3443
|
const e = n.exportJSON(), t = n.constructor;
|
|
3444
|
-
if (e.type !== t.getType() &&
|
|
3444
|
+
if (e.type !== t.getType() && b(130, t.name), C(n)) {
|
|
3445
3445
|
const r = e.children;
|
|
3446
|
-
Array.isArray(r) ||
|
|
3446
|
+
Array.isArray(r) || b(59, t.name);
|
|
3447
3447
|
const i = n.getChildren();
|
|
3448
3448
|
for (let s = 0; s < i.length; s++) {
|
|
3449
3449
|
const o = fs(i[s]);
|
|
@@ -3530,7 +3530,7 @@ function Ko(n) {
|
|
|
3530
3530
|
return n.style && (e.setFormat(n.style.textAlign), nl(n, e)), { node: e };
|
|
3531
3531
|
}
|
|
3532
3532
|
function Ne() {
|
|
3533
|
-
return
|
|
3533
|
+
return bn(new Lt());
|
|
3534
3534
|
}
|
|
3535
3535
|
function Ol(n) {
|
|
3536
3536
|
return n instanceof Lt;
|
|
@@ -3554,22 +3554,22 @@ function Bl(n) {
|
|
|
3554
3554
|
const S = p;
|
|
3555
3555
|
p = S.replace, x = S.with, m = S.withKlass || null;
|
|
3556
3556
|
}
|
|
3557
|
-
const y = p.getType(),
|
|
3558
|
-
|
|
3557
|
+
const y = p.getType(), T = p.transform(), w = /* @__PURE__ */ new Set();
|
|
3558
|
+
T !== null && w.add(T), g.set(y, { exportDOM: d && d.export ? d.export.get(p) : void 0, klass: p, replace: x, replaceWithKlass: m, transforms: w });
|
|
3559
3559
|
}
|
|
3560
3560
|
}
|
|
3561
3561
|
const h = new xn(o, i, g, { disableEvents: s, namespace: l, theme: r }, u || console.error, function(_, p) {
|
|
3562
|
-
const x = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Set(), y = (
|
|
3563
|
-
Object.keys(
|
|
3562
|
+
const x = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Set(), y = (T) => {
|
|
3563
|
+
Object.keys(T).forEach((w) => {
|
|
3564
3564
|
let S = x.get(w);
|
|
3565
|
-
S === void 0 && (S = [], x.set(w, S)), S.push(
|
|
3565
|
+
S === void 0 && (S = [], x.set(w, S)), S.push(T[w]);
|
|
3566
3566
|
});
|
|
3567
3567
|
};
|
|
3568
|
-
return _.forEach((
|
|
3569
|
-
const w =
|
|
3568
|
+
return _.forEach((T) => {
|
|
3569
|
+
const w = T.klass.importDOM;
|
|
3570
3570
|
if (w == null || m.has(w)) return;
|
|
3571
3571
|
m.add(w);
|
|
3572
|
-
const S = w.call(
|
|
3572
|
+
const S = w.call(T.klass);
|
|
3573
3573
|
S !== null && y(S);
|
|
3574
3574
|
}), p && y(p), x;
|
|
3575
3575
|
}(g, d ? d.import : void 0), f, n);
|
|
@@ -3613,11 +3613,11 @@ class xn {
|
|
|
3613
3613
|
};
|
|
3614
3614
|
}
|
|
3615
3615
|
registerCommand(e, t, r) {
|
|
3616
|
-
r === void 0 &&
|
|
3616
|
+
r === void 0 && b(35);
|
|
3617
3617
|
const i = this._commands;
|
|
3618
3618
|
i.has(e) || i.set(e, [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()]);
|
|
3619
3619
|
const s = i.get(e);
|
|
3620
|
-
s === void 0 &&
|
|
3620
|
+
s === void 0 && b(36, String(e));
|
|
3621
3621
|
const o = s[r];
|
|
3622
3622
|
return o.add(t), () => {
|
|
3623
3623
|
o.delete(t), s.every((l) => l.size === 0) && i.delete(e);
|
|
@@ -3633,14 +3633,14 @@ class xn {
|
|
|
3633
3633
|
}
|
|
3634
3634
|
getRegisteredNode(e) {
|
|
3635
3635
|
const t = this._nodes.get(e.getType());
|
|
3636
|
-
return t === void 0 &&
|
|
3636
|
+
return t === void 0 && b(37, e.name), t;
|
|
3637
3637
|
}
|
|
3638
3638
|
resolveRegisteredNodeAfterReplacements(e) {
|
|
3639
3639
|
for (; e.replaceWithKlass; ) e = this.getRegisteredNode(e.replaceWithKlass);
|
|
3640
3640
|
return e;
|
|
3641
3641
|
}
|
|
3642
3642
|
initializeMutationListener(e, t) {
|
|
3643
|
-
const r = this._editorState, i =
|
|
3643
|
+
const r = this._editorState, i = Ci(r).get(t.getType());
|
|
3644
3644
|
if (!i) return;
|
|
3645
3645
|
const s = /* @__PURE__ */ new Map();
|
|
3646
3646
|
for (const o of i.keys()) s.set(o, "created");
|
|
@@ -3657,7 +3657,7 @@ class xn {
|
|
|
3657
3657
|
i.push(o);
|
|
3658
3658
|
}
|
|
3659
3659
|
return function(o, l) {
|
|
3660
|
-
const a =
|
|
3660
|
+
const a = Ci(o.getEditorState()), c = [];
|
|
3661
3661
|
for (const u of l) {
|
|
3662
3662
|
const d = a.get(u);
|
|
3663
3663
|
d && c.push(d);
|
|
@@ -3694,8 +3694,8 @@ class xn {
|
|
|
3694
3694
|
const t = this._rootElement;
|
|
3695
3695
|
if (e !== t) {
|
|
3696
3696
|
const r = et(this._config.theme, "root"), i = this._pendingEditorState || this._editorState;
|
|
3697
|
-
if (this._rootElement = e, ds(this, t, e, i), t !== null && (this._config.disableEvents ||
|
|
3698
|
-
const s =
|
|
3697
|
+
if (this._rootElement = e, ds(this, t, e, i), t !== null && (this._config.disableEvents || To(t), r != null && t.classList.remove(...r)), e !== null) {
|
|
3698
|
+
const s = Tr(e), o = e.style;
|
|
3699
3699
|
o.userSelect = "text", o.whiteSpace = "pre-wrap", o.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = s, this._dirtyType = nt, Mi(this), this._updateTags.add("history-merge"), xe(this), this._config.disableEvents || function(l, a) {
|
|
3700
3700
|
const c = l.ownerDocument, u = ln.get(c);
|
|
3701
3701
|
(u === void 0 || u < 1) && c.addEventListener("selectionchange", Zi), ln.set(c, (u || 0) + 1), l.__lexicalEditor = a;
|
|
@@ -3719,11 +3719,11 @@ class xn {
|
|
|
3719
3719
|
case "dragover":
|
|
3720
3720
|
return x && E(a, So, p);
|
|
3721
3721
|
case "dragend":
|
|
3722
|
-
return x && E(a,
|
|
3722
|
+
return x && E(a, vo, p);
|
|
3723
3723
|
case "focus":
|
|
3724
|
-
return x && E(a,
|
|
3724
|
+
return x && E(a, Co, p);
|
|
3725
3725
|
case "blur":
|
|
3726
|
-
return x && E(a,
|
|
3726
|
+
return x && E(a, ko, p);
|
|
3727
3727
|
case "drop":
|
|
3728
3728
|
return x && E(a, yo, p);
|
|
3729
3729
|
}
|
|
@@ -3744,7 +3744,7 @@ class xn {
|
|
|
3744
3744
|
return this._editorState;
|
|
3745
3745
|
}
|
|
3746
3746
|
setEditorState(e, t) {
|
|
3747
|
-
e.isEmpty() &&
|
|
3747
|
+
e.isEmpty() && b(38);
|
|
3748
3748
|
let r = e;
|
|
3749
3749
|
r._readOnly && (r = us(e), r._selection = e._selection ? e._selection.clone() : null), Oi(this);
|
|
3750
3750
|
const i = this._pendingEditorState, s = this._updateTags, o = t !== void 0 ? t.tag : null;
|
|
@@ -3785,7 +3785,7 @@ class xn {
|
|
|
3785
3785
|
blur() {
|
|
3786
3786
|
const e = this._rootElement;
|
|
3787
3787
|
e !== null && e.blur();
|
|
3788
|
-
const t =
|
|
3788
|
+
const t = ve(this._window);
|
|
3789
3789
|
t !== null && t.removeAllRanges();
|
|
3790
3790
|
}
|
|
3791
3791
|
isEditable() {
|
|
@@ -3810,7 +3810,7 @@ function hs(n) {
|
|
|
3810
3810
|
const e = document.activeElement;
|
|
3811
3811
|
if (!Y(e)) return !1;
|
|
3812
3812
|
const t = e.nodeName;
|
|
3813
|
-
return D(Sr(n)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" &&
|
|
3813
|
+
return D(Sr(n)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" && vn(e) == null);
|
|
3814
3814
|
}
|
|
3815
3815
|
function Sn(n, e, t) {
|
|
3816
3816
|
const r = n.getRootElement();
|
|
@@ -3826,19 +3826,19 @@ function xr(n) {
|
|
|
3826
3826
|
function gs(n) {
|
|
3827
3827
|
let e = n;
|
|
3828
3828
|
for (; e != null; ) {
|
|
3829
|
-
const t =
|
|
3829
|
+
const t = vn(e);
|
|
3830
3830
|
if (xr(t)) return t;
|
|
3831
3831
|
e = At(e);
|
|
3832
3832
|
}
|
|
3833
3833
|
return null;
|
|
3834
3834
|
}
|
|
3835
|
-
function
|
|
3835
|
+
function vn(n) {
|
|
3836
3836
|
return n ? n.__lexicalEditor : null;
|
|
3837
3837
|
}
|
|
3838
3838
|
function Qe(n) {
|
|
3839
3839
|
return n.isToken() || n.isSegmented();
|
|
3840
3840
|
}
|
|
3841
|
-
function
|
|
3841
|
+
function Ce(n) {
|
|
3842
3842
|
return Ot(n) && n.nodeType === Ms;
|
|
3843
3843
|
}
|
|
3844
3844
|
function $o(n) {
|
|
@@ -3847,7 +3847,7 @@ function $o(n) {
|
|
|
3847
3847
|
function rt(n) {
|
|
3848
3848
|
let e = n;
|
|
3849
3849
|
for (; e != null; ) {
|
|
3850
|
-
if (
|
|
3850
|
+
if (Ce(e)) return e;
|
|
3851
3851
|
e = e.firstChild;
|
|
3852
3852
|
}
|
|
3853
3853
|
return null;
|
|
@@ -3865,7 +3865,7 @@ function _s(n, e) {
|
|
|
3865
3865
|
if (e != null) return void (n.__key = e);
|
|
3866
3866
|
H(), ls();
|
|
3867
3867
|
const t = B(), r = Le(), i = "" + Jo++;
|
|
3868
|
-
r._nodeMap.set(i, n),
|
|
3868
|
+
r._nodeMap.set(i, n), C(n) ? t._dirtyElements.set(i, !0) : t._dirtyLeaves.add(i), t._cloneNotNeeded.add(i), t._dirtyType = Ei, n.__key = i;
|
|
3869
3869
|
}
|
|
3870
3870
|
function De(n) {
|
|
3871
3871
|
const e = n.getParent();
|
|
@@ -3911,7 +3911,7 @@ function fn(n) {
|
|
|
3911
3911
|
}
|
|
3912
3912
|
}(t, s, o);
|
|
3913
3913
|
const l = e.__key;
|
|
3914
|
-
i._dirtyType = Ei,
|
|
3914
|
+
i._dirtyType = Ei, C(n) ? o.set(l, !0) : i._dirtyLeaves.add(l);
|
|
3915
3915
|
}
|
|
3916
3916
|
function V(n) {
|
|
3917
3917
|
H();
|
|
@@ -3927,7 +3927,7 @@ function V(n) {
|
|
|
3927
3927
|
}
|
|
3928
3928
|
}
|
|
3929
3929
|
}
|
|
3930
|
-
function
|
|
3930
|
+
function Te() {
|
|
3931
3931
|
return Pt() ? null : B()._compositionKey;
|
|
3932
3932
|
}
|
|
3933
3933
|
function j(n, e) {
|
|
@@ -3935,10 +3935,10 @@ function j(n, e) {
|
|
|
3935
3935
|
return t === void 0 ? null : t;
|
|
3936
3936
|
}
|
|
3937
3937
|
function ps(n, e) {
|
|
3938
|
-
const t =
|
|
3938
|
+
const t = Cn(n, B());
|
|
3939
3939
|
return t !== void 0 ? j(t, e) : null;
|
|
3940
3940
|
}
|
|
3941
|
-
function
|
|
3941
|
+
function Cn(n, e) {
|
|
3942
3942
|
return n[`__lexicalKey_${e._key}`];
|
|
3943
3943
|
}
|
|
3944
3944
|
function Sr(n, e) {
|
|
@@ -3972,7 +3972,7 @@ function Xe(n) {
|
|
|
3972
3972
|
const e = B(), t = function(r, i) {
|
|
3973
3973
|
let s = r;
|
|
3974
3974
|
for (; s != null; ) {
|
|
3975
|
-
const o =
|
|
3975
|
+
const o = Cn(s, i);
|
|
3976
3976
|
if (o !== void 0) return o;
|
|
3977
3977
|
s = At(s);
|
|
3978
3978
|
}
|
|
@@ -3986,7 +3986,7 @@ function gi(n, e) {
|
|
|
3986
3986
|
function xs(n) {
|
|
3987
3987
|
return /[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n);
|
|
3988
3988
|
}
|
|
3989
|
-
function
|
|
3989
|
+
function vr(n) {
|
|
3990
3990
|
const e = [];
|
|
3991
3991
|
let t = n;
|
|
3992
3992
|
for (; t !== null; ) e.push(t), t = t._parentEditor;
|
|
@@ -3995,27 +3995,27 @@ function Cr(n) {
|
|
|
3995
3995
|
function Ss() {
|
|
3996
3996
|
return Math.random().toString(36).replace(/[^a-z]+/g, "").substring(0, 5);
|
|
3997
3997
|
}
|
|
3998
|
-
function
|
|
3999
|
-
return
|
|
3998
|
+
function vs(n) {
|
|
3999
|
+
return Ce(n) ? n.nodeValue : null;
|
|
4000
4000
|
}
|
|
4001
|
-
function
|
|
4002
|
-
const r =
|
|
4001
|
+
function Cr(n, e, t) {
|
|
4002
|
+
const r = ve(ie(e));
|
|
4003
4003
|
if (r === null) return;
|
|
4004
4004
|
const i = r.anchorNode;
|
|
4005
4005
|
let { anchorOffset: s, focusOffset: o } = r;
|
|
4006
4006
|
if (i !== null) {
|
|
4007
|
-
let l =
|
|
4007
|
+
let l = vs(i);
|
|
4008
4008
|
const a = Sr(i);
|
|
4009
4009
|
if (l !== null && P(a)) {
|
|
4010
4010
|
if (l === dn && t) {
|
|
4011
4011
|
const c = t.length;
|
|
4012
4012
|
l = t, s = c, o = c;
|
|
4013
4013
|
}
|
|
4014
|
-
l !== null &&
|
|
4014
|
+
l !== null && kr(a, l, s, o, n);
|
|
4015
4015
|
}
|
|
4016
4016
|
}
|
|
4017
4017
|
}
|
|
4018
|
-
function
|
|
4018
|
+
function kr(n, e, t, r, i) {
|
|
4019
4019
|
let s = n;
|
|
4020
4020
|
if (s.isAttached() && (i || !s.isDirty())) {
|
|
4021
4021
|
const o = s.isComposing();
|
|
@@ -4035,7 +4035,7 @@ function br(n, e, t, r, i) {
|
|
|
4035
4035
|
}
|
|
4036
4036
|
return;
|
|
4037
4037
|
}
|
|
4038
|
-
const c = s.getParent(), u = at(), d = s.getTextContentSize(), f =
|
|
4038
|
+
const c = s.getParent(), u = at(), d = s.getTextContentSize(), f = Te(), g = s.getKey();
|
|
4039
4039
|
if (s.isToken() || f !== null && g === f && !o || L(u) && (c !== null && !c.canInsertTextBefore() && u.anchor.offset === 0 || u.anchor.key === n.__key && u.anchor.offset === 0 && !s.canInsertTextBefore() && !o || u.focus.key === n.__key && u.focus.offset === d && !s.canInsertTextAfter() && !o)) return void s.markDirty();
|
|
4040
4040
|
const h = M();
|
|
4041
4041
|
if (!L(h) || t === null || r === null) return void s.setTextContent(l);
|
|
@@ -4090,10 +4090,10 @@ function et(n, e) {
|
|
|
4090
4090
|
}
|
|
4091
4091
|
return i;
|
|
4092
4092
|
}
|
|
4093
|
-
function
|
|
4093
|
+
function br(n, e, t, r, i) {
|
|
4094
4094
|
if (t.size === 0) return;
|
|
4095
4095
|
const s = r.__type, o = r.__key, l = e.get(s);
|
|
4096
|
-
l === void 0 &&
|
|
4096
|
+
l === void 0 && b(33, s);
|
|
4097
4097
|
const a = l.klass;
|
|
4098
4098
|
let c = n.get(a);
|
|
4099
4099
|
c === void 0 && (c = /* @__PURE__ */ new Map(), n.set(a, c));
|
|
@@ -4118,13 +4118,13 @@ function Uo(n, e) {
|
|
|
4118
4118
|
}
|
|
4119
4119
|
return null;
|
|
4120
4120
|
}
|
|
4121
|
-
function
|
|
4121
|
+
function Cs(n) {
|
|
4122
4122
|
const e = ie(n).event, t = e && e.inputType;
|
|
4123
4123
|
return t === "insertFromPaste" || t === "insertFromPasteAsQuotation";
|
|
4124
4124
|
}
|
|
4125
4125
|
function E(n, e, t) {
|
|
4126
4126
|
return function(r, i, s) {
|
|
4127
|
-
const o =
|
|
4127
|
+
const o = vr(r);
|
|
4128
4128
|
for (let l = 4; l >= 0; l--) for (let a = 0; a < o.length; a++) {
|
|
4129
4129
|
const c = o[a], u = c._commands.get(i);
|
|
4130
4130
|
if (u !== void 0) {
|
|
@@ -4141,18 +4141,18 @@ function E(n, e, t) {
|
|
|
4141
4141
|
return !1;
|
|
4142
4142
|
}(n, e, t);
|
|
4143
4143
|
}
|
|
4144
|
-
function
|
|
4144
|
+
function kn(n) {
|
|
4145
4145
|
return !ee(n) && !n.isLastChild() && !n.isInline();
|
|
4146
4146
|
}
|
|
4147
4147
|
function it(n, e) {
|
|
4148
4148
|
const t = n._keyToDOMMap.get(e);
|
|
4149
|
-
return t === void 0 &&
|
|
4149
|
+
return t === void 0 && b(75, e), t;
|
|
4150
4150
|
}
|
|
4151
4151
|
function At(n) {
|
|
4152
4152
|
const e = n.assignedSlot || n.parentElement;
|
|
4153
4153
|
return Yo(e) ? e.host : e;
|
|
4154
4154
|
}
|
|
4155
|
-
function
|
|
4155
|
+
function ks(n) {
|
|
4156
4156
|
return $o(n) ? n : Y(n) ? n.ownerDocument : null;
|
|
4157
4157
|
}
|
|
4158
4158
|
function Vo(n) {
|
|
@@ -4169,16 +4169,16 @@ function nr(n, e) {
|
|
|
4169
4169
|
}
|
|
4170
4170
|
return !1;
|
|
4171
4171
|
}
|
|
4172
|
-
function
|
|
4173
|
-
const e =
|
|
4172
|
+
function Tr(n) {
|
|
4173
|
+
const e = ks(n);
|
|
4174
4174
|
return e ? e.defaultView : null;
|
|
4175
4175
|
}
|
|
4176
4176
|
function ie(n) {
|
|
4177
4177
|
const e = n._window;
|
|
4178
|
-
return e === null &&
|
|
4178
|
+
return e === null && b(78), e;
|
|
4179
4179
|
}
|
|
4180
4180
|
function Kl(n) {
|
|
4181
|
-
return
|
|
4181
|
+
return C(n) && n.isInline() || D(n) && n.isInline();
|
|
4182
4182
|
}
|
|
4183
4183
|
function Ho(n) {
|
|
4184
4184
|
let e = n.getParentOrThrow();
|
|
@@ -4189,42 +4189,42 @@ function Ho(n) {
|
|
|
4189
4189
|
return e;
|
|
4190
4190
|
}
|
|
4191
4191
|
function Ae(n) {
|
|
4192
|
-
return ee(n) ||
|
|
4192
|
+
return ee(n) || C(n) && n.isShadowRoot();
|
|
4193
4193
|
}
|
|
4194
4194
|
function Go(n) {
|
|
4195
4195
|
const e = n.constructor.clone(n);
|
|
4196
4196
|
return _s(e, null), e;
|
|
4197
4197
|
}
|
|
4198
|
-
function
|
|
4198
|
+
function bn(n) {
|
|
4199
4199
|
const e = B(), t = n.constructor.getType(), r = e._nodes.get(t);
|
|
4200
|
-
r === void 0 &&
|
|
4200
|
+
r === void 0 && b(200, n.constructor.name, t);
|
|
4201
4201
|
const { replace: i, replaceWithKlass: s } = r;
|
|
4202
4202
|
if (i !== null) {
|
|
4203
4203
|
const o = i(n), l = o.constructor;
|
|
4204
|
-
return s !== null ? o instanceof s ||
|
|
4204
|
+
return s !== null ? o instanceof s || b(201, s.name, s.getType(), l.name, l.getType(), n.constructor.name, t) : o instanceof n.constructor && l !== n.constructor || b(202, l.name, l.getType(), n.constructor.name, t), o.__key === n.__key && b(203, n.constructor.name, t, l.name, l.getType()), o;
|
|
4205
4205
|
}
|
|
4206
4206
|
return n;
|
|
4207
4207
|
}
|
|
4208
4208
|
function zn(n, e) {
|
|
4209
|
-
!ee(n.getParent()) ||
|
|
4209
|
+
!ee(n.getParent()) || C(e) || D(e) || b(99);
|
|
4210
4210
|
}
|
|
4211
4211
|
function Qo(n) {
|
|
4212
4212
|
const e = j(n);
|
|
4213
|
-
return e === null &&
|
|
4213
|
+
return e === null && b(63, n), e;
|
|
4214
4214
|
}
|
|
4215
4215
|
function Bn(n) {
|
|
4216
|
-
return (D(n) ||
|
|
4216
|
+
return (D(n) || C(n) && !n.canBeEmpty()) && !n.isInline();
|
|
4217
4217
|
}
|
|
4218
4218
|
function rr(n, e, t) {
|
|
4219
4219
|
t.style.removeProperty("caret-color"), e._blockCursorElement = null;
|
|
4220
4220
|
const r = n.parentElement;
|
|
4221
4221
|
r !== null && r.removeChild(n);
|
|
4222
4222
|
}
|
|
4223
|
-
function
|
|
4223
|
+
function ve(n) {
|
|
4224
4224
|
return le ? (n || window).getSelection() : null;
|
|
4225
4225
|
}
|
|
4226
4226
|
function Xo(n) {
|
|
4227
|
-
const e =
|
|
4227
|
+
const e = Tr(n);
|
|
4228
4228
|
return e ? e.getSelection() : null;
|
|
4229
4229
|
}
|
|
4230
4230
|
function Jl(n) {
|
|
@@ -4247,9 +4247,9 @@ function Si(n) {
|
|
|
4247
4247
|
const e = new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/, "i");
|
|
4248
4248
|
return n.nodeName.match(e) !== null;
|
|
4249
4249
|
}
|
|
4250
|
-
function
|
|
4250
|
+
function be(n) {
|
|
4251
4251
|
if (D(n) && !n.isInline()) return !0;
|
|
4252
|
-
if (!
|
|
4252
|
+
if (!C(n) || Ae(n)) return !1;
|
|
4253
4253
|
const e = n.getFirstChild(), t = e === null || Ze(e) || P(e) || e.isInline();
|
|
4254
4254
|
return !n.isInline() && n.canBeEmpty() !== !1 && t;
|
|
4255
4255
|
}
|
|
@@ -4261,11 +4261,11 @@ function Wn(n, e) {
|
|
|
4261
4261
|
function jl() {
|
|
4262
4262
|
return B();
|
|
4263
4263
|
}
|
|
4264
|
-
const
|
|
4265
|
-
function
|
|
4264
|
+
const vi = /* @__PURE__ */ new WeakMap(), el = /* @__PURE__ */ new Map();
|
|
4265
|
+
function Ci(n) {
|
|
4266
4266
|
if (!n._readOnly && n.isEmpty()) return el;
|
|
4267
|
-
n._readOnly ||
|
|
4268
|
-
let e =
|
|
4267
|
+
n._readOnly || b(192);
|
|
4268
|
+
let e = vi.get(n);
|
|
4269
4269
|
return e || (e = function(t) {
|
|
4270
4270
|
const r = /* @__PURE__ */ new Map();
|
|
4271
4271
|
for (const [i, s] of t._nodeMap) {
|
|
@@ -4274,7 +4274,7 @@ function ki(n) {
|
|
|
4274
4274
|
l || (l = /* @__PURE__ */ new Map(), r.set(o, l)), l.set(i, s);
|
|
4275
4275
|
}
|
|
4276
4276
|
return r;
|
|
4277
|
-
}(n),
|
|
4277
|
+
}(n), vi.set(n, e)), e;
|
|
4278
4278
|
}
|
|
4279
4279
|
function tl(n) {
|
|
4280
4280
|
const e = n.constructor.clone(n);
|
|
@@ -4296,7 +4296,7 @@ class wr {
|
|
|
4296
4296
|
this.origin = e;
|
|
4297
4297
|
}
|
|
4298
4298
|
[Symbol.iterator]() {
|
|
4299
|
-
return
|
|
4299
|
+
return Ts({ hasNext: st, initial: this.getAdjacentCaret(), map: (e) => e, step: (e) => e.getAdjacentCaret() });
|
|
4300
4300
|
}
|
|
4301
4301
|
getAdjacentCaret() {
|
|
4302
4302
|
return q(this.getNodeAtCaret(), this.direction);
|
|
@@ -4328,7 +4328,7 @@ class wr {
|
|
|
4328
4328
|
const u = a.getParent();
|
|
4329
4329
|
u && u.is(o) && a.remove(), c.replace(a);
|
|
4330
4330
|
}
|
|
4331
|
-
} else c === null &&
|
|
4331
|
+
} else c === null && b(263, Array.from(l).join(" "));
|
|
4332
4332
|
} else s.insert(a);
|
|
4333
4333
|
s = q(a, this.direction);
|
|
4334
4334
|
}
|
|
@@ -4336,7 +4336,7 @@ class wr {
|
|
|
4336
4336
|
return this;
|
|
4337
4337
|
}
|
|
4338
4338
|
}
|
|
4339
|
-
class
|
|
4339
|
+
class Tt extends wr {
|
|
4340
4340
|
constructor() {
|
|
4341
4341
|
super(...arguments);
|
|
4342
4342
|
re(this, "type", "child");
|
|
@@ -4359,7 +4359,7 @@ class vt extends wr {
|
|
|
4359
4359
|
return this;
|
|
4360
4360
|
}
|
|
4361
4361
|
isSameNodeCaret(t) {
|
|
4362
|
-
return t instanceof
|
|
4362
|
+
return t instanceof Tt && this.direction === t.direction && this.origin.is(t.origin);
|
|
4363
4363
|
}
|
|
4364
4364
|
isSamePointCaret(t) {
|
|
4365
4365
|
return this.isSameNodeCaret(t);
|
|
@@ -4388,7 +4388,7 @@ class Re extends wr {
|
|
|
4388
4388
|
return this.origin.getParent();
|
|
4389
4389
|
}
|
|
4390
4390
|
getChildCaret() {
|
|
4391
|
-
return
|
|
4391
|
+
return C(this.origin) ? Fe(this.origin, this.direction) : null;
|
|
4392
4392
|
}
|
|
4393
4393
|
getParentCaret(t = "root") {
|
|
4394
4394
|
return q(Nr(this.getParentAtCaret(), t), this.direction);
|
|
@@ -4443,7 +4443,7 @@ function st(n) {
|
|
|
4443
4443
|
return n instanceof Re;
|
|
4444
4444
|
}
|
|
4445
4445
|
function fe(n) {
|
|
4446
|
-
return n instanceof
|
|
4446
|
+
return n instanceof Tt;
|
|
4447
4447
|
}
|
|
4448
4448
|
const ol = { next: class extends Ke {
|
|
4449
4449
|
constructor() {
|
|
@@ -4489,7 +4489,7 @@ const ol = { next: class extends Ke {
|
|
|
4489
4489
|
insert(e) {
|
|
4490
4490
|
return this.origin.insertBefore(e), this;
|
|
4491
4491
|
}
|
|
4492
|
-
} }, al = { next: class extends
|
|
4492
|
+
} }, al = { next: class extends Tt {
|
|
4493
4493
|
constructor() {
|
|
4494
4494
|
super(...arguments);
|
|
4495
4495
|
re(this, "direction", "next");
|
|
@@ -4500,7 +4500,7 @@ const ol = { next: class extends Ke {
|
|
|
4500
4500
|
insert(e) {
|
|
4501
4501
|
return this.origin.splice(0, 0, [e]), this;
|
|
4502
4502
|
}
|
|
4503
|
-
}, previous: class extends
|
|
4503
|
+
}, previous: class extends Tt {
|
|
4504
4504
|
constructor() {
|
|
4505
4505
|
super(...arguments);
|
|
4506
4506
|
re(this, "direction", "previous");
|
|
@@ -4528,11 +4528,11 @@ function ot(n, e) {
|
|
|
4528
4528
|
o.search = l.toString(), console.warn(`Minified Lexical warning #${i}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
4529
4529
|
}(284, String(e), String(t), n.getKey()), r = r < 0 ? 0 : t), r;
|
|
4530
4530
|
}
|
|
4531
|
-
function
|
|
4531
|
+
function ki(n, e) {
|
|
4532
4532
|
return new ul(n, e);
|
|
4533
4533
|
}
|
|
4534
4534
|
function Fe(n, e) {
|
|
4535
|
-
return
|
|
4535
|
+
return C(n) ? new al[e](n) : null;
|
|
4536
4536
|
}
|
|
4537
4537
|
function cl(n) {
|
|
4538
4538
|
return n && n.getChildCaret() || n;
|
|
@@ -4557,18 +4557,18 @@ class Pr {
|
|
|
4557
4557
|
const s = this[i].getLatest();
|
|
4558
4558
|
return Ee(s) ? function(o, l) {
|
|
4559
4559
|
const { direction: a, origin: c } = o, u = ot(c, l === "focus" ? qe(a) : a);
|
|
4560
|
-
return
|
|
4560
|
+
return ki(o, u - o.offset);
|
|
4561
4561
|
}(s, i) : null;
|
|
4562
4562
|
}, t = e("anchor"), r = e("focus");
|
|
4563
4563
|
if (t && r) {
|
|
4564
4564
|
const { caret: i } = t, { caret: s } = r;
|
|
4565
|
-
if (i.isSameNodeCaret(s)) return [
|
|
4565
|
+
if (i.isSameNodeCaret(s)) return [ki(i, s.offset - i.offset), null];
|
|
4566
4566
|
}
|
|
4567
4567
|
return [t, r];
|
|
4568
4568
|
}
|
|
4569
4569
|
iterNodeCarets(e = "root") {
|
|
4570
4570
|
const t = Ee(this.anchor) ? this.anchor.getSiblingCaret() : this.anchor.getLatest(), r = this.focus.getLatest(), i = Ee(r), s = (o) => o.isSameNodeCaret(r) ? null : Er(o) || o.getParentCaret(e);
|
|
4571
|
-
return
|
|
4571
|
+
return Ts({ hasNext: (o) => o !== null && !(i && r.isSameNodeCaret(o)), initial: t.isSameNodeCaret(r) ? null : s(t), map: (o) => o, step: s });
|
|
4572
4572
|
}
|
|
4573
4573
|
[Symbol.iterator]() {
|
|
4574
4574
|
return this.iterNodeCarets("root");
|
|
@@ -4595,16 +4595,16 @@ class ul {
|
|
|
4595
4595
|
return Je(e.setTextContent(s.slice(0, r) + s.slice(i)), t, r);
|
|
4596
4596
|
}
|
|
4597
4597
|
}
|
|
4598
|
-
function
|
|
4598
|
+
function bs(n) {
|
|
4599
4599
|
return je(n, q(te(), n.direction));
|
|
4600
4600
|
}
|
|
4601
4601
|
function fl(n) {
|
|
4602
4602
|
return je(n, n);
|
|
4603
4603
|
}
|
|
4604
4604
|
function je(n, e) {
|
|
4605
|
-
return n.direction !== e.direction &&
|
|
4605
|
+
return n.direction !== e.direction && b(265), new Pr(n, e, n.direction);
|
|
4606
4606
|
}
|
|
4607
|
-
function
|
|
4607
|
+
function Ts(n) {
|
|
4608
4608
|
const { initial: e, hasNext: t, step: r, map: i } = n;
|
|
4609
4609
|
let s = e;
|
|
4610
4610
|
return { [Symbol.iterator]() {
|
|
@@ -4617,7 +4617,7 @@ function vs(n) {
|
|
|
4617
4617
|
}
|
|
4618
4618
|
function ws(n, e) {
|
|
4619
4619
|
const t = qt(n.origin, e.origin);
|
|
4620
|
-
switch (t === null &&
|
|
4620
|
+
switch (t === null && b(275, n.origin.getKey(), e.origin.getKey()), t.type) {
|
|
4621
4621
|
case "same": {
|
|
4622
4622
|
const r = n.type === "text", i = e.type === "text";
|
|
4623
4623
|
return r && i ? function(s, o) {
|
|
@@ -4644,26 +4644,26 @@ function Ns(n) {
|
|
|
4644
4644
|
function Jt(n, e) {
|
|
4645
4645
|
return e.is(n);
|
|
4646
4646
|
}
|
|
4647
|
-
function
|
|
4648
|
-
return
|
|
4647
|
+
function bi(n) {
|
|
4648
|
+
return C(n) ? [n.getLatest(), null] : [n.getParent(), n.getLatest()];
|
|
4649
4649
|
}
|
|
4650
4650
|
function qt(n, e) {
|
|
4651
4651
|
if (n.is(e)) return { commonAncestor: n, type: "same" };
|
|
4652
4652
|
const t = /* @__PURE__ */ new Map();
|
|
4653
|
-
for (let [r, i] =
|
|
4654
|
-
for (let [r, i] =
|
|
4653
|
+
for (let [r, i] = bi(n); r; i = r, r = r.getParent()) t.set(r, i);
|
|
4654
|
+
for (let [r, i] = bi(e); r; i = r, r = r.getParent()) {
|
|
4655
4655
|
const s = t.get(r);
|
|
4656
|
-
if (s !== void 0) return s === null ? (Jt(n, r) ||
|
|
4656
|
+
if (s !== void 0) return s === null ? (Jt(n, r) || b(276), { commonAncestor: r, type: "ancestor" }) : i === null ? (Jt(e, r) || b(277), { commonAncestor: r, type: "descendant" }) : ((C(s) || Jt(n, s)) && (C(i) || Jt(e, i)) && r.is(s.getParent()) && r.is(i.getParent()) || b(278), { a: s, b: i, commonAncestor: r, type: "branch" });
|
|
4657
4657
|
}
|
|
4658
4658
|
return null;
|
|
4659
4659
|
}
|
|
4660
4660
|
function $e(n, e) {
|
|
4661
4661
|
const { type: t, key: r, offset: i } = n, s = Qo(n.key);
|
|
4662
|
-
return t === "text" ? (P(s) ||
|
|
4662
|
+
return t === "text" ? (P(s) || b(266, s.getType(), r), Je(s, e, i)) : (C(s) || b(267, s.getType(), r), _l(s, n.offset, e));
|
|
4663
4663
|
}
|
|
4664
4664
|
function wt(n, e) {
|
|
4665
4665
|
const { origin: t, direction: r } = e, i = r === "next";
|
|
4666
|
-
Ee(e) ? n.set(t.getKey(), e.offset, "text") : st(e) ? P(t) ? n.set(t.getKey(), ot(t, r), "text") : n.set(t.getParentOrThrow().getKey(), t.getIndexWithinParent() + (i ? 1 : 0), "element") : (fe(e) &&
|
|
4666
|
+
Ee(e) ? n.set(t.getKey(), e.offset, "text") : st(e) ? P(t) ? n.set(t.getKey(), ot(t, r), "text") : n.set(t.getParentOrThrow().getKey(), t.getIndexWithinParent() + (i ? 1 : 0), "element") : (fe(e) && C(t) || b(268), n.set(t.getKey(), i ? 0 : t.getChildrenSize(), "element"));
|
|
4667
4667
|
}
|
|
4668
4668
|
function dl(n) {
|
|
4669
4669
|
const e = M(), t = L(e) ? e : Io();
|
|
@@ -4672,7 +4672,7 @@ function dl(n) {
|
|
|
4672
4672
|
function Ht(n, e) {
|
|
4673
4673
|
wt(n.anchor, e.anchor), wt(n.focus, e.focus);
|
|
4674
4674
|
}
|
|
4675
|
-
function
|
|
4675
|
+
function Ti(n) {
|
|
4676
4676
|
const { anchor: e, focus: t } = n, r = $e(e, "next"), i = $e(t, "next"), s = ws(r, i) <= 0 ? "next" : "previous";
|
|
4677
4677
|
return je(Ue(r, s), Ue(i, s));
|
|
4678
4678
|
}
|
|
@@ -4696,7 +4696,7 @@ function hl(n, e = "removeEmptySlices") {
|
|
|
4696
4696
|
for (const h of s.iterNodeCarets(t)) if (fe(h)) a.add(h.origin.getKey());
|
|
4697
4697
|
else if (st(h)) {
|
|
4698
4698
|
const { origin: _ } = h;
|
|
4699
|
-
|
|
4699
|
+
C(_) && !a.has(_.getKey()) || c.push(_);
|
|
4700
4700
|
}
|
|
4701
4701
|
for (const h of c) h.remove();
|
|
4702
4702
|
for (const h of s.getTextSlices()) {
|
|
@@ -4706,12 +4706,12 @@ function hl(n, e = "removeEmptySlices") {
|
|
|
4706
4706
|
else if (h.distance !== 0) {
|
|
4707
4707
|
i = "removeEmptySlices";
|
|
4708
4708
|
let y = h.removeTextSlice();
|
|
4709
|
-
const
|
|
4709
|
+
const T = h.caret.origin;
|
|
4710
4710
|
if (m === "segmented") {
|
|
4711
4711
|
const w = y.origin, S = U(w.getTextContent()).setStyle(w.getStyle()).setFormat(w.getFormat());
|
|
4712
4712
|
x.replaceOrInsert(S), y = Je(S, r, y.offset);
|
|
4713
4713
|
}
|
|
4714
|
-
|
|
4714
|
+
T.is(o[0].origin) && (o[0] = y), T.is(l[0].origin) && (l[0] = y.getFlipped());
|
|
4715
4715
|
}
|
|
4716
4716
|
}
|
|
4717
4717
|
let u, d;
|
|
@@ -4729,11 +4729,11 @@ function hl(n, e = "removeEmptySlices") {
|
|
|
4729
4729
|
if (!x || !m) return null;
|
|
4730
4730
|
const y = x.getParents().reverse();
|
|
4731
4731
|
y.push(x);
|
|
4732
|
-
const
|
|
4733
|
-
|
|
4734
|
-
const w = Math.min(y.length,
|
|
4732
|
+
const T = m.getParents().reverse();
|
|
4733
|
+
T.push(m);
|
|
4734
|
+
const w = Math.min(y.length, T.length);
|
|
4735
4735
|
let S;
|
|
4736
|
-
for (S = 0; S < w && y[S] ===
|
|
4736
|
+
for (S = 0; S < w && y[S] === T[S]; S++) ;
|
|
4737
4737
|
const N = (F, O) => {
|
|
4738
4738
|
let W;
|
|
4739
4739
|
for (let I = S; I < F.length; I++) {
|
|
@@ -4742,8 +4742,8 @@ function hl(n, e = "removeEmptySlices") {
|
|
|
4742
4742
|
!W && O(A) && (W = A);
|
|
4743
4743
|
}
|
|
4744
4744
|
return W;
|
|
4745
|
-
},
|
|
4746
|
-
return
|
|
4745
|
+
}, k = N(y, be), v = k && N(T, (F) => p.has(F.getKey()) && be(F));
|
|
4746
|
+
return k && v ? [k, v] : null;
|
|
4747
4747
|
}(u, d, a);
|
|
4748
4748
|
if (f) {
|
|
4749
4749
|
const [h, _] = f;
|
|
@@ -4752,7 +4752,7 @@ function hl(n, e = "removeEmptySlices") {
|
|
|
4752
4752
|
const g = [u, d, ...o, ...l].find(Rn);
|
|
4753
4753
|
if (g)
|
|
4754
4754
|
return fl(Ue(ue(g), n.direction));
|
|
4755
|
-
|
|
4755
|
+
b(269, JSON.stringify(o.map((h) => h.origin.__key)));
|
|
4756
4756
|
}
|
|
4757
4757
|
function ue(n) {
|
|
4758
4758
|
const e = function(i) {
|
|
@@ -4791,7 +4791,7 @@ function pl(n) {
|
|
|
4791
4791
|
if (t === ot(e, r)) return n.getSiblingCaret();
|
|
4792
4792
|
if (t === ot(e, qe(r))) return Mt(n.getSiblingCaret());
|
|
4793
4793
|
const [i] = e.splitText(t);
|
|
4794
|
-
return P(i) ||
|
|
4794
|
+
return P(i) || b(281), Ue(q(i, "next"), r);
|
|
4795
4795
|
}
|
|
4796
4796
|
function ml(n, e) {
|
|
4797
4797
|
return !0;
|
|
@@ -4829,17 +4829,17 @@ export {
|
|
|
4829
4829
|
Ml as N,
|
|
4830
4830
|
Vi as O,
|
|
4831
4831
|
Ie as P,
|
|
4832
|
-
|
|
4832
|
+
bl as Q,
|
|
4833
4833
|
_t as R,
|
|
4834
4834
|
mo as S,
|
|
4835
4835
|
Ne as T,
|
|
4836
4836
|
Ae as U,
|
|
4837
|
-
|
|
4837
|
+
Co as V,
|
|
4838
4838
|
Ki as W,
|
|
4839
4839
|
U as X,
|
|
4840
4840
|
P as Y,
|
|
4841
4841
|
wt as Z,
|
|
4842
|
-
|
|
4842
|
+
ve as _,
|
|
4843
4843
|
M as a,
|
|
4844
4844
|
Fl as a0,
|
|
4845
4845
|
Io as a1,
|
|
@@ -4847,7 +4847,7 @@ export {
|
|
|
4847
4847
|
de as a3,
|
|
4848
4848
|
$e as a4,
|
|
4849
4849
|
gl as a5,
|
|
4850
|
-
|
|
4850
|
+
bs as a6,
|
|
4851
4851
|
st as a7,
|
|
4852
4852
|
fe as a8,
|
|
4853
4853
|
q as a9,
|
|
@@ -4866,22 +4866,22 @@ export {
|
|
|
4866
4866
|
yo as aM,
|
|
4867
4867
|
Gn as aN,
|
|
4868
4868
|
$t as aO,
|
|
4869
|
-
|
|
4869
|
+
kl as aP,
|
|
4870
4870
|
Uo as aQ,
|
|
4871
|
-
|
|
4872
|
-
|
|
4871
|
+
Cl as aR,
|
|
4872
|
+
vl as aS,
|
|
4873
4873
|
Ll as aT,
|
|
4874
4874
|
Rr as aU,
|
|
4875
4875
|
gs as aV,
|
|
4876
4876
|
wl as aW,
|
|
4877
|
-
|
|
4877
|
+
Tl as aX,
|
|
4878
4878
|
Er as aa,
|
|
4879
4879
|
Pt as ab,
|
|
4880
4880
|
Be as ac,
|
|
4881
4881
|
Lt as ad,
|
|
4882
4882
|
Ji as ae,
|
|
4883
4883
|
te as af,
|
|
4884
|
-
|
|
4884
|
+
Ts as ag,
|
|
4885
4885
|
dl as ah,
|
|
4886
4886
|
fl as ai,
|
|
4887
4887
|
Ue as aj,
|
|
@@ -4889,21 +4889,21 @@ export {
|
|
|
4889
4889
|
Ee as al,
|
|
4890
4890
|
D as am,
|
|
4891
4891
|
Xr as an,
|
|
4892
|
-
|
|
4892
|
+
be as ao,
|
|
4893
4893
|
so as ap,
|
|
4894
4894
|
El as aq,
|
|
4895
4895
|
Nl as ar,
|
|
4896
4896
|
ji as as,
|
|
4897
4897
|
$i as at,
|
|
4898
4898
|
Ro as au,
|
|
4899
|
-
|
|
4899
|
+
bt as av,
|
|
4900
4900
|
Pl as aw,
|
|
4901
4901
|
Si as ax,
|
|
4902
4902
|
Zo as ay,
|
|
4903
4903
|
tl as az,
|
|
4904
4904
|
Wr as b,
|
|
4905
4905
|
L as c,
|
|
4906
|
-
|
|
4906
|
+
C as d,
|
|
4907
4907
|
Jl as e,
|
|
4908
4908
|
mn as f,
|
|
4909
4909
|
ne as g,
|
|
@@ -4916,7 +4916,7 @@ export {
|
|
|
4916
4916
|
Y as n,
|
|
4917
4917
|
xl as o,
|
|
4918
4918
|
$l as p,
|
|
4919
|
-
|
|
4919
|
+
bn as q,
|
|
4920
4920
|
Ot as r,
|
|
4921
4921
|
j as s,
|
|
4922
4922
|
fo as t,
|
|
@@ -4927,4 +4927,4 @@ export {
|
|
|
4927
4927
|
oo as y,
|
|
4928
4928
|
Fe as z
|
|
4929
4929
|
};
|
|
4930
|
-
//# sourceMappingURL=Lexical.prod-
|
|
4930
|
+
//# sourceMappingURL=Lexical.prod-D8x7Ii0F.js.map
|