@uva-glass/component-library 3.30.1 → 3.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Lexical.prod-UwAbgYpF.js → Lexical.prod-B84LhBo3.js} +1196 -1224
- package/dist/Lexical.prod-B84LhBo3.js.map +1 -0
- package/dist/{LexicalClipboard.prod-DHIGjydG.js → LexicalClipboard.prod-DLgWWXys.js} +4 -4
- package/dist/{LexicalClipboard.prod-DHIGjydG.js.map → LexicalClipboard.prod-DLgWWXys.js.map} +1 -1
- package/dist/{LexicalLink.prod-Bsa9J7L-.js → LexicalLink.prod-DoU9RL94.js} +3 -3
- package/dist/{LexicalLink.prod-Bsa9J7L-.js.map → LexicalLink.prod-DoU9RL94.js.map} +1 -1
- package/dist/{LexicalList.prod-jxGuZd4b.js → LexicalList.prod-Cw2TK1jY.js} +4 -4
- package/dist/{LexicalList.prod-jxGuZd4b.js.map → LexicalList.prod-Cw2TK1jY.js.map} +1 -1
- package/dist/{LexicalSelection.prod-xk5MiZnZ.js → LexicalSelection.prod-TB5pn9xc.js} +2 -2
- package/dist/{LexicalSelection.prod-xk5MiZnZ.js.map → LexicalSelection.prod-TB5pn9xc.js.map} +1 -1
- package/dist/{LexicalTable.prod-BSjs04iE.js → LexicalTable.prod-9xjyWB0C.js} +4 -4
- package/dist/{LexicalTable.prod-BSjs04iE.js.map → LexicalTable.prod-9xjyWB0C.js.map} +1 -1
- package/dist/{LexicalUtils.prod-cQutjKA3.js → LexicalUtils.prod-CD3xGFhm.js} +2 -2
- package/dist/{LexicalUtils.prod-cQutjKA3.js.map → LexicalUtils.prod-CD3xGFhm.js.map} +1 -1
- package/dist/Sortable.module--kgnzOjW.js +26 -0
- package/dist/Sortable.module--kgnzOjW.js.map +1 -0
- package/dist/SortableProvider-DisCfTTN.js +160 -0
- package/dist/SortableProvider-DisCfTTN.js.map +1 -0
- package/dist/{TablePlugin-NmJsn2fm.js → TablePlugin-oF-gInNx.js} +86 -91
- package/dist/{TablePlugin-NmJsn2fm.js.map → TablePlugin-oF-gInNx.js.map} +1 -1
- package/dist/assets/Backdrop.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/ClipboardButton.css +1 -1
- package/dist/assets/ExpandableInfoPanel.css +1 -1
- package/dist/assets/FormInput.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputField.css +1 -1
- package/dist/assets/LinkContextMenu.css +1 -1
- package/dist/assets/Notification.css +1 -1
- package/dist/assets/OverlayCloseButton.css +1 -1
- package/dist/assets/OverlayStepBar.css +1 -1
- package/dist/assets/PageOverlay.css +1 -1
- package/dist/assets/Sortable.css +1 -1
- package/dist/assets/VarIndicator.css +1 -1
- 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.stories.js +5 -5
- 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 +3 -3
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
- package/dist/components/CheckboxTree/CheckboxTree.js +58 -59
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +58 -59
- package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
- package/dist/components/Chip/Chip.stories.js +5 -5
- package/dist/components/ControlsButton/ControlsButton.stories.js +5 -5
- 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/HorizontalList/HorizontalList.js +7 -7
- package/dist/components/HorizontalList/HorizontalList.js.map +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InputField/InputField.stories.js +10 -10
- package/dist/components/Label/Label.test.js +2 -2
- package/dist/components/ModalDialog/ModalDialog.stories.js +8 -8
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +8 -8
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +3 -3
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.js +66 -70
- package/dist/components/MultiSelectBox/MultiSelectBox.js.map +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -2
- package/dist/components/Notification/Notification.stories.js +6 -6
- package/dist/components/Notification/Notification.test.js +2 -2
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +4 -4
- package/dist/components/OverlayStepBar/OverlayStepBar.stories.js +19 -20
- package/dist/components/OverlayStepBar/OverlayStepBar.stories.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +33 -33
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +4 -4
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +3 -3
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
- package/dist/components/RadioTabSelector/RadioTabSelector.js +3 -3
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
- 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 +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +51 -61
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +79 -89
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
- 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/TableCellContextMenu/TableCellContextMenu.js +19 -19
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +5 -5
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +17 -18
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +31 -32
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +10 -10
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/components/SelectButton.js +31 -32
- package/dist/components/SelectListbox/components/SelectButton.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectOption.js +29 -30
- package/dist/components/SelectListbox/components/SelectOption.js.map +1 -1
- package/dist/components/Sortable/Sortable.d.ts +10 -3
- package/dist/components/Sortable/Sortable.js +38 -23
- package/dist/components/Sortable/Sortable.js.map +1 -1
- package/dist/components/Sortable/Sortable.stories.d.ts +3 -3
- package/dist/components/Sortable/Sortable.stories.js +28 -20
- package/dist/components/Sortable/Sortable.stories.js.map +1 -1
- package/dist/components/Sortable/SortableProvider.d.ts +10 -6
- package/dist/components/Sortable/SortableProvider.js +1 -1
- package/dist/components/Sortable/components/SortableContainer.d.ts +2 -1
- package/dist/components/Sortable/components/SortableContainer.js +2 -2
- package/dist/components/Sortable/components/SortableHandle.js +1 -1
- package/dist/components/Sortable/components/SortableItem.d.ts +3 -1
- package/dist/components/Sortable/components/SortableItem.js +48 -47
- package/dist/components/Sortable/components/SortableItem.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +3 -3
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
- package/dist/components/hooks/usePositionedFloaters.js +39 -39
- package/dist/components/hooks/usePositionedFloaters.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{helpers-DZIm3MiJ.js → helpers-CMG0anwr.js} +4 -4
- package/dist/{helpers-DZIm3MiJ.js.map → helpers-CMG0anwr.js.map} +1 -1
- package/dist/{index-DV47hRzi.js → index-Br0QepD6.js} +8 -10
- package/dist/{index-DV47hRzi.js.map → index-Br0QepD6.js.map} +1 -1
- package/dist/{index-Di9WPZUe.js → index-C2E9FY6V.js} +9149 -9854
- package/dist/index-C2E9FY6V.js.map +1 -0
- package/dist/{index-PaHiqSUg.js → index-Ds1dMTvJ.js} +29 -29
- package/dist/{index-PaHiqSUg.js.map → index-Ds1dMTvJ.js.map} +1 -1
- package/dist/{index-BVAvx58-.js → index-KJPw-7za.js} +2209 -2280
- package/dist/{index-BVAvx58-.js.map → index-KJPw-7za.js.map} +1 -1
- package/dist/{index-DllfJcv4.js → index-nrPtQ1dv.js} +2 -2
- package/dist/{index-DllfJcv4.js.map → index-nrPtQ1dv.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{react.esm-CFMwGdo5.js → react.esm-BKjCIfbB.js} +373 -374
- package/dist/{react.esm-CFMwGdo5.js.map → react.esm-BKjCIfbB.js.map} +1 -1
- package/dist/setupTests.js +6 -9
- package/dist/setupTests.js.map +1 -1
- package/dist/storybook__react.d.js +2056 -2072
- package/dist/storybook__react.d.js.map +1 -1
- package/package.json +14 -14
- package/dist/Lexical.prod-UwAbgYpF.js.map +0 -1
- package/dist/Sortable.module-CekPNg54.js +0 -23
- package/dist/Sortable.module-CekPNg54.js.map +0 -1
- package/dist/SortableProvider-CwX1lFMa.js +0 -152
- package/dist/SortableProvider-CwX1lFMa.js.map +0 -1
- package/dist/index-Di9WPZUe.js.map +0 -1
|
@@ -1,63 +1,60 @@
|
|
|
1
|
-
var Ds = Object.defineProperty;
|
|
2
|
-
var Ps = (n, e, t) => e in n ? Ds(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var se = (n, e, t) => Ps(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
1
|
function T(n, ...e) {
|
|
5
2
|
const t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
6
3
|
r.append("code", n);
|
|
7
4
|
for (const i of e) r.append("v", i);
|
|
8
5
|
throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
9
6
|
}
|
|
10
|
-
const
|
|
11
|
-
function
|
|
7
|
+
const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Os = le && "documentMode" in document ? document.documentMode : null, ue = le && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Re = le && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Gt = !(!le || !("InputEvent" in window) || Os) && "getTargetRanges" in new window.InputEvent("input"), Ct = le && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), rt = le && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ds = le && /Android/.test(navigator.userAgent), wi = le && /^(?=.*Chrome).*/i.test(navigator.userAgent), Pr = le && Ds && wi, Xt = le && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !wi;
|
|
8
|
+
function Qt(...n) {
|
|
12
9
|
const e = [];
|
|
13
10
|
for (const t of n) if (t && typeof t == "string") for (const [r] of t.matchAll(/\S+/g)) e.push(r);
|
|
14
11
|
return e;
|
|
15
12
|
}
|
|
16
|
-
const
|
|
13
|
+
const Ps = 1, Fs = 3, Ls = 9, Is = 11, We = 0, Ei = 1, it = 2, Ks = 0, zs = 1, Bs = 2, Zt = 4, en = 8, sr = 128, Rs = 1792 | (112 | (3 | Zt | en) | sr), or = 1, lr = 2, ar = 3, cr = 4, ur = 5, fr = 6, hn = Ct || rt || Xt ? " " : "", ve = `
|
|
17
14
|
|
|
18
|
-
`,
|
|
19
|
-
function
|
|
15
|
+
`, Ws = Re ? " " : hn, Mi = "֑-߿יִ-﷽ﹰ-ﻼ", Ai = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", Js = new RegExp("^[^" + Ai + "]*[" + Mi + "]"), Us = new RegExp("^[^" + Mi + "]*[" + Ai + "]"), Je = { bold: 1, capitalize: 1024, code: 16, highlight: sr, italic: 2, lowercase: 256, strikethrough: Zt, subscript: 32, superscript: 64, underline: en, uppercase: 512 }, js = { directionless: 1, unmergeable: 2 }, Fr = { center: lr, end: fr, justify: cr, left: or, right: ar, start: ur }, $s = { [lr]: "center", [fr]: "end", [cr]: "justify", [or]: "left", [ar]: "right", [ur]: "start" }, Vs = { normal: 0, segmented: 2, token: 1 }, Ys = { [Ks]: "normal", [Bs]: "segmented", [zs]: "token" }, Hs = "$";
|
|
16
|
+
function Oi(n, e, t, r, i, s) {
|
|
20
17
|
let o = n.getFirstChild();
|
|
21
18
|
for (; o !== null; ) {
|
|
22
19
|
const l = o.__key;
|
|
23
|
-
o.__parent === e && (v(o) &&
|
|
20
|
+
o.__parent === e && (v(o) && Oi(o, l, t, r, i, s), t.has(l) || s.delete(l), i.push(l)), o = o.getNextSibling();
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
function
|
|
29
|
-
|
|
23
|
+
const qs = 100;
|
|
24
|
+
let Un = !1, dr = 0;
|
|
25
|
+
function Gs(n) {
|
|
26
|
+
dr = n.timeStamp;
|
|
30
27
|
}
|
|
31
|
-
function
|
|
28
|
+
function Mn(n, e, t) {
|
|
32
29
|
const r = n.nodeName === "BR", i = e.__lexicalLineBreak;
|
|
33
|
-
return i && (n === i || r && n.previousSibling === i) || r &&
|
|
30
|
+
return i && (n === i || r && n.previousSibling === i) || r && kn(n, t) !== void 0;
|
|
34
31
|
}
|
|
35
|
-
function
|
|
36
|
-
const r =
|
|
32
|
+
function Xs(n, e, t) {
|
|
33
|
+
const r = ke(se(t));
|
|
37
34
|
let i = null, s = null;
|
|
38
35
|
r !== null && r.anchorNode === n && (i = r.anchorOffset, s = r.focusOffset);
|
|
39
36
|
const o = n.nodeValue;
|
|
40
|
-
o !== null &&
|
|
37
|
+
o !== null && Tr(e, o, i, s, !1);
|
|
41
38
|
}
|
|
42
|
-
function
|
|
39
|
+
function Qs(n, e, t) {
|
|
43
40
|
if (O(n)) {
|
|
44
41
|
const r = n.anchor.getNode();
|
|
45
42
|
if (r.is(t) && n.format !== r.getFormat()) return !1;
|
|
46
43
|
}
|
|
47
|
-
return
|
|
44
|
+
return Te(e) && t.isAttached();
|
|
48
45
|
}
|
|
49
|
-
function
|
|
50
|
-
for (let i = n; i && !
|
|
51
|
-
const s =
|
|
46
|
+
function Zs(n, e, t, r) {
|
|
47
|
+
for (let i = n; i && !ol(i); i = Dt(i)) {
|
|
48
|
+
const s = kn(i, e);
|
|
52
49
|
if (s !== void 0) {
|
|
53
50
|
const o = $(s, t);
|
|
54
51
|
if (o) return z(o) || !ee(i) ? void 0 : [i, o];
|
|
55
|
-
} else if (i === r) return [r,
|
|
52
|
+
} else if (i === r) return [r, Cs(t)];
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
const r = performance.now() -
|
|
55
|
+
function Di(n, e, t) {
|
|
56
|
+
Un = !0;
|
|
57
|
+
const r = performance.now() - dr > qs;
|
|
61
58
|
try {
|
|
62
59
|
te(n, () => {
|
|
63
60
|
const i = L() || function(f) {
|
|
@@ -68,17 +65,17 @@ function Pi(n, e, t) {
|
|
|
68
65
|
}(n), s = /* @__PURE__ */ new Map(), o = n.getRootElement(), l = n._editorState, a = n._blockCursorElement;
|
|
69
66
|
let c = !1, u = "";
|
|
70
67
|
for (let f = 0; f < e.length; f++) {
|
|
71
|
-
const g = e[f], d = g.type, _ = g.target, p =
|
|
68
|
+
const g = e[f], d = g.type, _ = g.target, p = Zs(_, n, l, o);
|
|
72
69
|
if (!p) continue;
|
|
73
70
|
const [x, y] = p;
|
|
74
|
-
if (d === "characterData") r && M(y) &&
|
|
71
|
+
if (d === "characterData") r && M(y) && Te(_) && Qs(i, _, y) && Xs(_, y, n);
|
|
75
72
|
else if (d === "childList") {
|
|
76
73
|
c = !0;
|
|
77
74
|
const m = g.addedNodes;
|
|
78
75
|
for (let C = 0; C < m.length; C++) {
|
|
79
|
-
const w = m[C], k =
|
|
80
|
-
if (S != null && w !== a && k === null && !
|
|
81
|
-
if (
|
|
76
|
+
const w = m[C], k = ms(w), S = w.parentNode;
|
|
77
|
+
if (S != null && w !== a && k === null && !Mn(w, S, n)) {
|
|
78
|
+
if (Re) {
|
|
82
79
|
const A = (ee(w) ? w.innerText : null) || w.nodeValue;
|
|
83
80
|
A && (u += A);
|
|
84
81
|
}
|
|
@@ -90,7 +87,7 @@ function Pi(n, e, t) {
|
|
|
90
87
|
let C = 0;
|
|
91
88
|
for (let w = 0; w < N; w++) {
|
|
92
89
|
const k = b[w];
|
|
93
|
-
(
|
|
90
|
+
(Mn(k, _, n) || a === k) && (_.appendChild(k), C++);
|
|
94
91
|
}
|
|
95
92
|
N !== C && s.set(x, y);
|
|
96
93
|
}
|
|
@@ -103,29 +100,29 @@ function Pi(n, e, t) {
|
|
|
103
100
|
const g = h[f], d = g.addedNodes, _ = g.target;
|
|
104
101
|
for (let p = 0; p < d.length; p++) {
|
|
105
102
|
const x = d[p], y = x.parentNode;
|
|
106
|
-
y == null || x.nodeName !== "BR" ||
|
|
103
|
+
y == null || x.nodeName !== "BR" || Mn(x, _, n) || y.removeChild(x);
|
|
107
104
|
}
|
|
108
105
|
}
|
|
109
106
|
t.takeRecords();
|
|
110
107
|
}
|
|
111
|
-
i !== null && (c && ie(i),
|
|
108
|
+
i !== null && (c && ie(i), Re && Ts(n) && i.insertRawText(u));
|
|
112
109
|
});
|
|
113
110
|
} finally {
|
|
114
|
-
|
|
111
|
+
Un = !1;
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
|
-
function
|
|
114
|
+
function Pi(n) {
|
|
118
115
|
const e = n._observer;
|
|
119
|
-
e !== null &&
|
|
116
|
+
e !== null && Di(n, e.takeRecords(), e);
|
|
120
117
|
}
|
|
121
|
-
function
|
|
118
|
+
function Fi(n) {
|
|
122
119
|
(function(e) {
|
|
123
|
-
|
|
120
|
+
dr === 0 && se(e).addEventListener("textInput", Gs, !0);
|
|
124
121
|
})(n), n._observer = new MutationObserver((e, t) => {
|
|
125
|
-
|
|
122
|
+
Di(n, e, t);
|
|
126
123
|
});
|
|
127
124
|
}
|
|
128
|
-
class
|
|
125
|
+
class hr {
|
|
129
126
|
constructor(e, t = /* @__PURE__ */ new Map(), r = void 0, i = /* @__PURE__ */ new Map(), s = void 0) {
|
|
130
127
|
this.node = e, this.sharedConfigMap = t, this.unknownState = r, this.knownState = i;
|
|
131
128
|
const o = s !== void 0 ? s : function(l, a, c) {
|
|
@@ -155,14 +152,14 @@ class gr {
|
|
|
155
152
|
toJSON() {
|
|
156
153
|
const e = { ...this.unknownState };
|
|
157
154
|
for (const [t, r] of this.knownState) t.isEqual(r, t.defaultValue) ? delete e[t.key] : e[t.key] = t.unparse(r);
|
|
158
|
-
return
|
|
155
|
+
return zt(e) ? { [Hs]: e } : {};
|
|
159
156
|
}
|
|
160
157
|
getWritable(e) {
|
|
161
158
|
if (this.node === e) return this;
|
|
162
|
-
const t = new Map(this.knownState), r =
|
|
159
|
+
const t = new Map(this.knownState), r = zt(i = this.unknownState) && { ...i };
|
|
163
160
|
var i;
|
|
164
161
|
if (r) for (const s of t.keys()) delete r[s.key];
|
|
165
|
-
return new
|
|
162
|
+
return new hr(e, this.sharedConfigMap, zt(r), t, this.size);
|
|
166
163
|
}
|
|
167
164
|
updateFromKnown(e, t) {
|
|
168
165
|
const r = e.key;
|
|
@@ -178,17 +175,17 @@ class gr {
|
|
|
178
175
|
const { knownState: t } = this;
|
|
179
176
|
for (const r of t.keys()) t.set(r, r.defaultValue);
|
|
180
177
|
if (this.size = t.size, this.unknownState = {}, e) for (const [r, i] of Object.entries(e)) this.updateFromUnknown(r, i);
|
|
181
|
-
this.unknownState =
|
|
178
|
+
this.unknownState = zt(this.unknownState);
|
|
182
179
|
}
|
|
183
180
|
}
|
|
184
|
-
function
|
|
181
|
+
function zt(n) {
|
|
185
182
|
if (n) for (const e in n) return n;
|
|
186
183
|
}
|
|
187
|
-
function
|
|
188
|
-
const e = n.getWritable(), t = e.__state ? e.__state.getWritable(e) : new
|
|
184
|
+
function eo(n) {
|
|
185
|
+
const e = n.getWritable(), t = e.__state ? e.__state.getWritable(e) : new hr(e);
|
|
189
186
|
return e.__state = t, t;
|
|
190
187
|
}
|
|
191
|
-
function
|
|
188
|
+
function Lr(n, e) {
|
|
192
189
|
const t = n.__mode, r = n.__format, i = n.__style, s = e.__mode, o = e.__format, l = e.__style, a = n.__state, c = e.__state;
|
|
193
190
|
return (t === null || t === s) && (r === null || r === o) && (i === null || i === l) && (n.__state === null || a === c || function(u, h) {
|
|
194
191
|
if (u === h) return !0;
|
|
@@ -211,17 +208,17 @@ function Ir(n, e) {
|
|
|
211
208
|
return !(u && g(u, h) || h && g(h, u) || u && d(u, h) || h && d(h, u));
|
|
212
209
|
}(a, c));
|
|
213
210
|
}
|
|
214
|
-
function
|
|
211
|
+
function Ir(n, e) {
|
|
215
212
|
const t = n.mergeWithSibling(e), r = R()._normalizedNodes;
|
|
216
213
|
return r.add(n.__key), r.add(e.__key), t;
|
|
217
214
|
}
|
|
218
|
-
function
|
|
215
|
+
function Kr(n) {
|
|
219
216
|
let e, t, r = n;
|
|
220
217
|
if (r.__text !== "" || !r.isSimpleText() || r.isUnmergeable()) {
|
|
221
218
|
for (; (e = r.getPreviousSibling()) !== null && M(e) && e.isSimpleText() && !e.isUnmergeable(); ) {
|
|
222
219
|
if (e.__text !== "") {
|
|
223
|
-
if (
|
|
224
|
-
r =
|
|
220
|
+
if (Lr(e, r)) {
|
|
221
|
+
r = Ir(e, r);
|
|
225
222
|
break;
|
|
226
223
|
}
|
|
227
224
|
break;
|
|
@@ -230,8 +227,8 @@ function zr(n) {
|
|
|
230
227
|
}
|
|
231
228
|
for (; (t = r.getNextSibling()) !== null && M(t) && t.isSimpleText() && !t.isUnmergeable(); ) {
|
|
232
229
|
if (t.__text !== "") {
|
|
233
|
-
if (
|
|
234
|
-
r =
|
|
230
|
+
if (Lr(r, t)) {
|
|
231
|
+
r = Ir(r, t);
|
|
235
232
|
break;
|
|
236
233
|
}
|
|
237
234
|
break;
|
|
@@ -240,10 +237,10 @@ function zr(n) {
|
|
|
240
237
|
}
|
|
241
238
|
} else r.remove();
|
|
242
239
|
}
|
|
243
|
-
function
|
|
244
|
-
return
|
|
240
|
+
function jn(n) {
|
|
241
|
+
return zr(n.anchor), zr(n.focus), n;
|
|
245
242
|
}
|
|
246
|
-
function
|
|
243
|
+
function zr(n) {
|
|
247
244
|
for (; n.type === "element"; ) {
|
|
248
245
|
const e = n.getNode(), t = n.offset;
|
|
249
246
|
let r, i;
|
|
@@ -255,47 +252,47 @@ function Br(n) {
|
|
|
255
252
|
n.set(r.__key, i ? r.getChildrenSize() : 0, "element", !0);
|
|
256
253
|
}
|
|
257
254
|
}
|
|
258
|
-
let
|
|
259
|
-
function
|
|
260
|
-
const t =
|
|
255
|
+
let Oe, Q, St, gn, $n, Vn, Ue, oe, Yn, vt, J = "", X = "", ae = null, ce = "", Ce = "", Li = !1, kt = !1, jt = null;
|
|
256
|
+
function tn(n, e) {
|
|
257
|
+
const t = Ue.get(n);
|
|
261
258
|
if (e !== null) {
|
|
262
|
-
const r =
|
|
259
|
+
const r = Gn(n);
|
|
263
260
|
r.parentNode === e && e.removeChild(r);
|
|
264
261
|
}
|
|
265
|
-
if (
|
|
266
|
-
const r =
|
|
267
|
-
|
|
262
|
+
if (oe.has(n) || Q._keyToDOMMap.delete(n), v(t)) {
|
|
263
|
+
const r = rn(t, Ue);
|
|
264
|
+
Hn(r, 0, r.length - 1, null);
|
|
268
265
|
}
|
|
269
|
-
t !== void 0 &&
|
|
266
|
+
t !== void 0 && br(vt, St, gn, t, "destroyed");
|
|
270
267
|
}
|
|
271
|
-
function
|
|
268
|
+
function Hn(n, e, t, r) {
|
|
272
269
|
let i = e;
|
|
273
270
|
for (; i <= t; ++i) {
|
|
274
271
|
const s = n[i];
|
|
275
|
-
s !== void 0 &&
|
|
272
|
+
s !== void 0 && tn(s, r);
|
|
276
273
|
}
|
|
277
274
|
}
|
|
278
|
-
function
|
|
275
|
+
function Le(n, e) {
|
|
279
276
|
n.setProperty("text-align", e);
|
|
280
277
|
}
|
|
281
|
-
const
|
|
282
|
-
function
|
|
283
|
-
const t =
|
|
278
|
+
const to = "40px";
|
|
279
|
+
function Ii(n, e) {
|
|
280
|
+
const t = Oe.theme.indent;
|
|
284
281
|
if (typeof t == "string") {
|
|
285
282
|
const i = n.classList.contains(t);
|
|
286
283
|
e > 0 && !i ? n.classList.add(t) : e < 1 && i && n.classList.remove(t);
|
|
287
284
|
}
|
|
288
|
-
const r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") ||
|
|
285
|
+
const r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") || to;
|
|
289
286
|
n.style.setProperty("padding-inline-start", e === 0 ? "" : `calc(${e} * ${r})`);
|
|
290
287
|
}
|
|
291
|
-
function
|
|
288
|
+
function Ki(n, e) {
|
|
292
289
|
const t = n.style;
|
|
293
|
-
e === 0 ?
|
|
290
|
+
e === 0 ? Le(t, "") : e === or ? Le(t, "left") : e === lr ? Le(t, "center") : e === ar ? Le(t, "right") : e === cr ? Le(t, "justify") : e === ur ? Le(t, "start") : e === fr && Le(t, "end");
|
|
294
291
|
}
|
|
295
|
-
function
|
|
296
|
-
const t =
|
|
292
|
+
function nn(n, e) {
|
|
293
|
+
const t = oe.get(n);
|
|
297
294
|
t === void 0 && T(60);
|
|
298
|
-
const r = t.createDOM(
|
|
295
|
+
const r = t.createDOM(Oe, Q);
|
|
299
296
|
if (function(i, s, o) {
|
|
300
297
|
const l = o._keyToDOMMap;
|
|
301
298
|
(function(a, c, u) {
|
|
@@ -304,63 +301,63 @@ function rn(n, e) {
|
|
|
304
301
|
})(s, o, i), l.set(i, s);
|
|
305
302
|
}(n, r, Q), M(t) ? r.setAttribute("data-lexical-text", "true") : z(t) && r.setAttribute("data-lexical-decorator", "true"), v(t)) {
|
|
306
303
|
const i = t.__indent, s = t.__size;
|
|
307
|
-
if (i !== 0 &&
|
|
304
|
+
if (i !== 0 && Ii(r, i), s !== 0) {
|
|
308
305
|
const l = s - 1;
|
|
309
306
|
(function(a, c, u, h) {
|
|
310
307
|
const f = X;
|
|
311
|
-
X = "",
|
|
312
|
-
})(
|
|
308
|
+
X = "", qn(a, u, 0, c, u.getDOMSlot(h)), Bi(u, h), X = f;
|
|
309
|
+
})(rn(t, oe), l, t, r);
|
|
313
310
|
}
|
|
314
311
|
const o = t.__format;
|
|
315
|
-
o !== 0 &&
|
|
312
|
+
o !== 0 && Ki(r, o), t.isInline() || zi(null, t, r), Tn(t) && (J += ve, Ce += ve);
|
|
316
313
|
} else {
|
|
317
314
|
const i = t.getTextContent();
|
|
318
315
|
if (z(t)) {
|
|
319
|
-
const s = t.decorate(Q,
|
|
320
|
-
s !== null &&
|
|
316
|
+
const s = t.decorate(Q, Oe);
|
|
317
|
+
s !== null && Ri(n, s), r.contentEditable = "false";
|
|
321
318
|
} else M(t) && (t.isDirectionless() || (X += i));
|
|
322
|
-
J += i,
|
|
319
|
+
J += i, Ce += i;
|
|
323
320
|
}
|
|
324
|
-
return e !== null && e.insertChild(r),
|
|
321
|
+
return e !== null && e.insertChild(r), br(vt, St, gn, t, "created"), r;
|
|
325
322
|
}
|
|
326
|
-
function
|
|
323
|
+
function qn(n, e, t, r, i) {
|
|
327
324
|
const s = J;
|
|
328
325
|
J = "";
|
|
329
326
|
let o = t;
|
|
330
327
|
for (; o <= r; ++o) {
|
|
331
|
-
|
|
332
|
-
const l =
|
|
333
|
-
l !== null && M(l) && (
|
|
328
|
+
nn(n[o], i);
|
|
329
|
+
const l = oe.get(n[o]);
|
|
330
|
+
l !== null && M(l) && (ae === null && (ae = l.getFormat()), ce === "" && (ce = l.getStyle()));
|
|
334
331
|
}
|
|
335
|
-
|
|
332
|
+
Tn(e) && (J += ve), i.element.__lexicalTextContent = J, J = s + J;
|
|
336
333
|
}
|
|
337
|
-
function
|
|
334
|
+
function Br(n, e) {
|
|
338
335
|
if (n) {
|
|
339
336
|
const t = n.__last;
|
|
340
337
|
if (t) {
|
|
341
338
|
const r = e.get(t);
|
|
342
|
-
if (r) return
|
|
339
|
+
if (r) return tt(r) ? "line-break" : z(r) && r.isInline() ? "decorator" : null;
|
|
343
340
|
}
|
|
344
341
|
return "empty";
|
|
345
342
|
}
|
|
346
343
|
return null;
|
|
347
344
|
}
|
|
348
|
-
function
|
|
349
|
-
const r =
|
|
345
|
+
function zi(n, e, t) {
|
|
346
|
+
const r = Br(n, Ue), i = Br(e, oe);
|
|
350
347
|
r !== i && e.getDOMSlot(t).setManagedLineBreak(i);
|
|
351
348
|
}
|
|
352
|
-
function
|
|
349
|
+
function Bi(n, e) {
|
|
353
350
|
const t = e.__lexicalDirTextContent || "", r = e.__lexicalDir || "";
|
|
354
|
-
if (t !== X || r !==
|
|
355
|
-
const i = X === "", s = i ?
|
|
356
|
-
return
|
|
351
|
+
if (t !== X || r !== jt) {
|
|
352
|
+
const i = X === "", s = i ? jt : function(o) {
|
|
353
|
+
return Js.test(o) ? "rtl" : Us.test(o) ? "ltr" : null;
|
|
357
354
|
}(X);
|
|
358
355
|
if (s !== r) {
|
|
359
|
-
const o = e.classList, l =
|
|
356
|
+
const o = e.classList, l = Oe.theme;
|
|
360
357
|
let a = r !== null ? l[r] : void 0, c = s !== null ? l[s] : void 0;
|
|
361
358
|
if (a !== void 0) {
|
|
362
359
|
if (typeof a == "string") {
|
|
363
|
-
const u =
|
|
360
|
+
const u = Qt(a);
|
|
364
361
|
a = l[r] = u;
|
|
365
362
|
}
|
|
366
363
|
o.remove(...a);
|
|
@@ -369,30 +366,30 @@ function Ri(n, e) {
|
|
|
369
366
|
else {
|
|
370
367
|
if (c !== void 0) {
|
|
371
368
|
if (typeof c == "string") {
|
|
372
|
-
const u =
|
|
369
|
+
const u = Qt(c);
|
|
373
370
|
c = l[s] = u;
|
|
374
371
|
}
|
|
375
372
|
c !== void 0 && o.add(...c);
|
|
376
373
|
}
|
|
377
374
|
e.dir = s;
|
|
378
375
|
}
|
|
379
|
-
|
|
376
|
+
kt || (n.getWritable().__dir = s);
|
|
380
377
|
}
|
|
381
|
-
|
|
378
|
+
jt = s, e.__lexicalDirTextContent = X, e.__lexicalDir = s;
|
|
382
379
|
}
|
|
383
380
|
}
|
|
384
|
-
function
|
|
381
|
+
function no(n, e, t) {
|
|
385
382
|
const r = X;
|
|
386
383
|
var i;
|
|
387
|
-
X = "",
|
|
384
|
+
X = "", ae = null, ce = "", function(s, o, l) {
|
|
388
385
|
const a = J, c = s.__size, u = o.__size;
|
|
389
386
|
J = "";
|
|
390
387
|
const h = l.element;
|
|
391
388
|
if (c === 1 && u === 1) {
|
|
392
389
|
const f = s.__first, g = o.__first;
|
|
393
|
-
if (f === g)
|
|
390
|
+
if (f === g) gt(f, h);
|
|
394
391
|
else {
|
|
395
|
-
const _ =
|
|
392
|
+
const _ = Gn(f), p = nn(g, null);
|
|
396
393
|
try {
|
|
397
394
|
h.replaceChild(p, _);
|
|
398
395
|
} catch (x) {
|
|
@@ -402,49 +399,49 @@ function so(n, e, t) {
|
|
|
402
399
|
}
|
|
403
400
|
throw x;
|
|
404
401
|
}
|
|
405
|
-
|
|
402
|
+
tn(f, null);
|
|
406
403
|
}
|
|
407
|
-
const d =
|
|
408
|
-
M(d) && (
|
|
404
|
+
const d = oe.get(g);
|
|
405
|
+
M(d) && (ae === null && (ae = d.getFormat()), ce === "" && (ce = d.getStyle()));
|
|
409
406
|
} else {
|
|
410
|
-
const f =
|
|
411
|
-
if (f.length !== c && T(227), g.length !== u && T(228), c === 0) u !== 0 &&
|
|
407
|
+
const f = rn(s, Ue), g = rn(o, oe);
|
|
408
|
+
if (f.length !== c && T(227), g.length !== u && T(228), c === 0) u !== 0 && qn(g, o, 0, u - 1, l);
|
|
412
409
|
else if (u === 0) {
|
|
413
410
|
if (c !== 0) {
|
|
414
411
|
const d = l.after == null && l.before == null && l.element.__lexicalLineBreak == null;
|
|
415
|
-
|
|
412
|
+
Hn(f, 0, c - 1, d ? null : h), d && (h.textContent = "");
|
|
416
413
|
}
|
|
417
414
|
} else (function(d, _, p, x, y, m) {
|
|
418
415
|
const b = x - 1, N = y - 1;
|
|
419
416
|
let C, w, k = m.getFirstChild(), S = 0, A = 0;
|
|
420
417
|
for (; S <= b && A <= N; ) {
|
|
421
418
|
const K = _[S], P = p[A];
|
|
422
|
-
if (K === P) k =
|
|
419
|
+
if (K === P) k = An(gt(P, m.element)), S++, A++;
|
|
423
420
|
else {
|
|
424
421
|
C === void 0 && (C = new Set(_)), w === void 0 && (w = new Set(p));
|
|
425
|
-
const V = w.has(K),
|
|
426
|
-
if (V) if (
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
} else
|
|
430
|
-
else k =
|
|
422
|
+
const V = w.has(K), ge = C.has(P);
|
|
423
|
+
if (V) if (ge) {
|
|
424
|
+
const _e = ot(Q, P);
|
|
425
|
+
_e === k ? k = An(gt(P, m.element)) : (m.withBefore(k).insertChild(_e), gt(P, m.element)), S++, A++;
|
|
426
|
+
} else nn(P, m.withBefore(k)), A++;
|
|
427
|
+
else k = An(Gn(K)), tn(K, m.element), S++;
|
|
431
428
|
}
|
|
432
|
-
const B =
|
|
433
|
-
B !== null && M(B) && (
|
|
429
|
+
const B = oe.get(P);
|
|
430
|
+
B !== null && M(B) && (ae === null && (ae = B.getFormat()), ce === "" && (ce = B.getStyle()));
|
|
434
431
|
}
|
|
435
432
|
const F = S > b, W = A > N;
|
|
436
433
|
if (F && !W) {
|
|
437
434
|
const K = p[N + 1], P = K === void 0 ? null : Q.getElementByKey(K);
|
|
438
|
-
|
|
439
|
-
} else W && !F &&
|
|
435
|
+
qn(p, d, A, N, m.withBefore(P));
|
|
436
|
+
} else W && !F && Hn(_, S, b, m.element);
|
|
440
437
|
})(o, f, g, c, u, l);
|
|
441
438
|
}
|
|
442
|
-
|
|
443
|
-
}(n, e, e.getDOMSlot(t)),
|
|
444
|
-
|
|
439
|
+
Tn(o) && (J += ve), h.__lexicalTextContent = J, J = a + J;
|
|
440
|
+
}(n, e, e.getDOMSlot(t)), Bi(e, t), i = e, ae == null || ae === i.__textFormat || kt || i.setTextFormat(ae), function(s) {
|
|
441
|
+
ce === "" || ce === s.__textStyle || kt || s.setTextStyle(ce);
|
|
445
442
|
}(e), X = r;
|
|
446
443
|
}
|
|
447
|
-
function
|
|
444
|
+
function rn(n, e) {
|
|
448
445
|
const t = [];
|
|
449
446
|
let r = n.__first;
|
|
450
447
|
for (; r !== null; ) {
|
|
@@ -453,199 +450,199 @@ function sn(n, e) {
|
|
|
453
450
|
}
|
|
454
451
|
return t;
|
|
455
452
|
}
|
|
456
|
-
function
|
|
457
|
-
const t =
|
|
458
|
-
let r =
|
|
453
|
+
function gt(n, e) {
|
|
454
|
+
const t = Ue.get(n);
|
|
455
|
+
let r = oe.get(n);
|
|
459
456
|
t !== void 0 && r !== void 0 || T(61);
|
|
460
|
-
const i =
|
|
457
|
+
const i = Li || Vn.has(n) || $n.has(n), s = ot(Q, n);
|
|
461
458
|
if (t === r && !i) {
|
|
462
459
|
if (v(t)) {
|
|
463
460
|
const o = s.__lexicalTextContent;
|
|
464
|
-
o !== void 0 && (J += o,
|
|
461
|
+
o !== void 0 && (J += o, Ce += o);
|
|
465
462
|
const l = s.__lexicalDirTextContent;
|
|
466
463
|
l !== void 0 && (X += l);
|
|
467
464
|
} else {
|
|
468
465
|
const o = t.getTextContent();
|
|
469
|
-
M(t) && !t.isDirectionless() && (X += o),
|
|
466
|
+
M(t) && !t.isDirectionless() && (X += o), Ce += o, J += o;
|
|
470
467
|
}
|
|
471
468
|
return s;
|
|
472
469
|
}
|
|
473
|
-
if (t !== r && i &&
|
|
474
|
-
const o =
|
|
475
|
-
return e === null && T(62), e.replaceChild(o, s),
|
|
470
|
+
if (t !== r && i && br(vt, St, gn, r, "updated"), r.updateDOM(t, s, Oe)) {
|
|
471
|
+
const o = nn(n, null);
|
|
472
|
+
return e === null && T(62), e.replaceChild(o, s), tn(n, null), o;
|
|
476
473
|
}
|
|
477
474
|
if (v(t) && v(r)) {
|
|
478
475
|
const o = r.__indent;
|
|
479
|
-
o !== t.__indent &&
|
|
476
|
+
o !== t.__indent && Ii(s, o);
|
|
480
477
|
const l = r.__format;
|
|
481
|
-
l !== t.__format &&
|
|
478
|
+
l !== t.__format && Ki(s, l), i && (no(t, r, s), ne(r) || r.isInline() || zi(t, r, s)), Tn(r) && (J += ve, Ce += ve);
|
|
482
479
|
} else {
|
|
483
480
|
const o = r.getTextContent();
|
|
484
481
|
if (z(r)) {
|
|
485
|
-
const l = r.decorate(Q,
|
|
486
|
-
l !== null &&
|
|
482
|
+
const l = r.decorate(Q, Oe);
|
|
483
|
+
l !== null && Ri(n, l);
|
|
487
484
|
} else M(r) && !r.isDirectionless() && (X += o);
|
|
488
|
-
J += o,
|
|
485
|
+
J += o, Ce += o;
|
|
489
486
|
}
|
|
490
|
-
if (!
|
|
487
|
+
if (!kt && ne(r) && r.__cachedText !== Ce) {
|
|
491
488
|
const o = r.getWritable();
|
|
492
|
-
o.__cachedText =
|
|
489
|
+
o.__cachedText = Ce, r = o;
|
|
493
490
|
}
|
|
494
491
|
return s;
|
|
495
492
|
}
|
|
496
|
-
function
|
|
493
|
+
function Ri(n, e) {
|
|
497
494
|
let t = Q._pendingDecorators;
|
|
498
495
|
const r = Q._decorators;
|
|
499
496
|
if (t === null) {
|
|
500
497
|
if (r[n] === e) return;
|
|
501
|
-
t =
|
|
498
|
+
t = xs(Q);
|
|
502
499
|
}
|
|
503
500
|
t[n] = e;
|
|
504
501
|
}
|
|
505
|
-
function
|
|
502
|
+
function An(n) {
|
|
506
503
|
let e = n.nextSibling;
|
|
507
504
|
return e !== null && e === Q._blockCursorElement && (e = e.nextSibling), e;
|
|
508
505
|
}
|
|
509
|
-
function
|
|
510
|
-
J = "",
|
|
506
|
+
function ro(n, e, t, r, i, s) {
|
|
507
|
+
J = "", Ce = "", X = "", Li = r === it, jt = null, Q = t, Oe = t._config, St = t._nodes, gn = Q._listeners.mutation, $n = i, Vn = s, Ue = n._nodeMap, oe = e._nodeMap, kt = e._readOnly, Yn = new Map(t._keyToDOMMap);
|
|
511
508
|
const o = /* @__PURE__ */ new Map();
|
|
512
|
-
return
|
|
509
|
+
return vt = o, gt("root", null), Q = void 0, St = void 0, $n = void 0, Vn = void 0, Ue = void 0, oe = void 0, Oe = void 0, Yn = void 0, vt = void 0, o;
|
|
513
510
|
}
|
|
514
|
-
function
|
|
515
|
-
const e =
|
|
511
|
+
function Gn(n) {
|
|
512
|
+
const e = Yn.get(n);
|
|
516
513
|
return e === void 0 && T(75, n), e;
|
|
517
514
|
}
|
|
518
515
|
function D(n) {
|
|
519
516
|
return { type: n };
|
|
520
517
|
}
|
|
521
|
-
const
|
|
522
|
-
if (
|
|
523
|
-
if (
|
|
524
|
-
|
|
525
|
-
}),
|
|
518
|
+
const Wi = D("SELECTION_CHANGE_COMMAND"), Sl = D("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"), io = D("CLICK_COMMAND"), sn = D("DELETE_CHARACTER_COMMAND"), $t = D("INSERT_LINE_BREAK_COMMAND"), Rr = D("INSERT_PARAGRAPH_COMMAND"), _t = D("CONTROLLED_TEXT_INSERTION_COMMAND"), Ji = D("PASTE_COMMAND"), Wr = D("REMOVE_TEXT_COMMAND"), on = D("DELETE_WORD_COMMAND"), ln = D("DELETE_LINE_COMMAND"), Ke = D("FORMAT_TEXT_COMMAND"), Ui = D("UNDO_COMMAND"), ji = D("REDO_COMMAND"), so = D("KEYDOWN_COMMAND"), oo = D("KEY_ARROW_RIGHT_COMMAND"), lo = D("MOVE_TO_END"), ao = D("KEY_ARROW_LEFT_COMMAND"), co = D("MOVE_TO_START"), uo = D("KEY_ARROW_UP_COMMAND"), fo = D("KEY_ARROW_DOWN_COMMAND"), Xn = D("KEY_ENTER_COMMAND"), ho = D("KEY_SPACE_COMMAND"), go = D("KEY_BACKSPACE_COMMAND"), _o = D("KEY_ESCAPE_COMMAND"), po = D("KEY_DELETE_COMMAND"), yo = D("KEY_TAB_COMMAND"), vl = D("INSERT_TAB_COMMAND"), kl = D("INDENT_CONTENT_COMMAND"), Tl = D("OUTDENT_CONTENT_COMMAND"), mo = D("DROP_COMMAND"), bl = D("FORMAT_ELEMENT_COMMAND"), xo = D("DRAGSTART_COMMAND"), Co = D("DRAGOVER_COMMAND"), So = D("DRAGEND_COMMAND"), $i = D("COPY_COMMAND"), Vi = D("CUT_COMMAND"), Jr = D("SELECT_ALL_COMMAND"), Nl = D("CLEAR_EDITOR_COMMAND"), wl = D("CLEAR_HISTORY_COMMAND"), El = D("CAN_REDO_COMMAND"), Ml = D("CAN_UNDO_COMMAND"), vo = D("FOCUS_COMMAND"), ko = D("BLUR_COMMAND"), To = D("KEY_MODIFIER_COMMAND"), ye = Object.freeze({}), Qn = 30, Zn = [["keydown", function(n, e) {
|
|
519
|
+
if (pt = n.timeStamp, Yi = n.key, !e.isComposing() && !E(e, so, n) && n.key != null) {
|
|
520
|
+
if (On && yi(n)) return te(e, () => {
|
|
521
|
+
Bt(e, Dn);
|
|
522
|
+
}), On = !1, void (Dn = "");
|
|
526
523
|
if (function(t) {
|
|
527
524
|
return I(t, "ArrowRight", { shiftKey: "any" });
|
|
528
|
-
}(n)) E(e,
|
|
525
|
+
}(n)) E(e, oo, n);
|
|
529
526
|
else if (function(t) {
|
|
530
|
-
return I(t, "ArrowRight",
|
|
531
|
-
}(n)) E(e,
|
|
527
|
+
return I(t, "ArrowRight", xe);
|
|
528
|
+
}(n)) E(e, lo, n);
|
|
532
529
|
else if (function(t) {
|
|
533
530
|
return I(t, "ArrowLeft", { shiftKey: "any" });
|
|
534
|
-
}(n)) E(e,
|
|
531
|
+
}(n)) E(e, ao, n);
|
|
535
532
|
else if (function(t) {
|
|
536
|
-
return I(t, "ArrowLeft",
|
|
537
|
-
}(n)) E(e,
|
|
533
|
+
return I(t, "ArrowLeft", xe);
|
|
534
|
+
}(n)) E(e, co, n);
|
|
538
535
|
else if (function(t) {
|
|
539
536
|
return I(t, "ArrowUp", { altKey: "any", shiftKey: "any" });
|
|
540
|
-
}(n)) E(e,
|
|
537
|
+
}(n)) E(e, uo, n);
|
|
541
538
|
else if (function(t) {
|
|
542
539
|
return I(t, "ArrowDown", { altKey: "any", shiftKey: "any" });
|
|
543
|
-
}(n)) E(e,
|
|
540
|
+
}(n)) E(e, fo, n);
|
|
544
541
|
else if (function(t) {
|
|
545
542
|
return I(t, "Enter", { altKey: "any", ctrlKey: "any", metaKey: "any", shiftKey: !0 });
|
|
546
|
-
}(n))
|
|
543
|
+
}(n)) yt = !0, E(e, Xn, n);
|
|
547
544
|
else if (function(t) {
|
|
548
545
|
return t.key === " ";
|
|
549
|
-
}(n)) E(e,
|
|
546
|
+
}(n)) E(e, ho, n);
|
|
550
547
|
else if (function(t) {
|
|
551
|
-
return
|
|
552
|
-
}(n)) n.preventDefault(),
|
|
548
|
+
return ue && I(t, "o", { ctrlKey: !0 });
|
|
549
|
+
}(n)) n.preventDefault(), yt = !0, E(e, $t, !0);
|
|
553
550
|
else if (function(t) {
|
|
554
551
|
return I(t, "Enter", { altKey: "any", ctrlKey: "any", metaKey: "any" });
|
|
555
|
-
}(n))
|
|
552
|
+
}(n)) yt = !1, E(e, Xn, n);
|
|
556
553
|
else if (function(t) {
|
|
557
|
-
return I(t, "Backspace", { shiftKey: "any" }) ||
|
|
558
|
-
}(n))
|
|
554
|
+
return I(t, "Backspace", { shiftKey: "any" }) || ue && I(t, "h", { ctrlKey: !0 });
|
|
555
|
+
}(n)) yi(n) ? E(e, go, n) : (n.preventDefault(), E(e, sn, !0));
|
|
559
556
|
else if (function(t) {
|
|
560
557
|
return t.key === "Escape";
|
|
561
|
-
}(n)) E(e,
|
|
558
|
+
}(n)) E(e, _o, n);
|
|
562
559
|
else if (function(t) {
|
|
563
|
-
return I(t, "Delete", {}) ||
|
|
560
|
+
return I(t, "Delete", {}) || ue && I(t, "d", { ctrlKey: !0 });
|
|
564
561
|
}(n)) (function(t) {
|
|
565
562
|
return t.key === "Delete";
|
|
566
|
-
})(n) ? E(e,
|
|
563
|
+
})(n) ? E(e, po, n) : (n.preventDefault(), E(e, sn, !1));
|
|
567
564
|
else if (function(t) {
|
|
568
|
-
return I(t, "Backspace",
|
|
569
|
-
}(n)) n.preventDefault(), E(e,
|
|
565
|
+
return I(t, "Backspace", pi);
|
|
566
|
+
}(n)) n.preventDefault(), E(e, on, !0);
|
|
570
567
|
else if (function(t) {
|
|
571
|
-
return I(t, "Delete",
|
|
572
|
-
}(n)) n.preventDefault(), E(e,
|
|
568
|
+
return I(t, "Delete", pi);
|
|
569
|
+
}(n)) n.preventDefault(), E(e, on, !1);
|
|
573
570
|
else if (function(t) {
|
|
574
|
-
return
|
|
575
|
-
}(n)) n.preventDefault(), E(e,
|
|
571
|
+
return ue && I(t, "Backspace", { metaKey: !0 });
|
|
572
|
+
}(n)) n.preventDefault(), E(e, ln, !0);
|
|
576
573
|
else if (function(t) {
|
|
577
|
-
return
|
|
578
|
-
}(n)) n.preventDefault(), E(e,
|
|
574
|
+
return ue && (I(t, "Delete", { metaKey: !0 }) || I(t, "k", { ctrlKey: !0 }));
|
|
575
|
+
}(n)) n.preventDefault(), E(e, ln, !1);
|
|
579
576
|
else if (function(t) {
|
|
580
|
-
return I(t, "b",
|
|
581
|
-
}(n)) n.preventDefault(), E(e,
|
|
577
|
+
return I(t, "b", xe);
|
|
578
|
+
}(n)) n.preventDefault(), E(e, Ke, "bold");
|
|
582
579
|
else if (function(t) {
|
|
583
|
-
return I(t, "u",
|
|
584
|
-
}(n)) n.preventDefault(), E(e,
|
|
580
|
+
return I(t, "u", xe);
|
|
581
|
+
}(n)) n.preventDefault(), E(e, Ke, "underline");
|
|
585
582
|
else if (function(t) {
|
|
586
|
-
return I(t, "i",
|
|
587
|
-
}(n)) n.preventDefault(), E(e,
|
|
583
|
+
return I(t, "i", xe);
|
|
584
|
+
}(n)) n.preventDefault(), E(e, Ke, "italic");
|
|
588
585
|
else if (function(t) {
|
|
589
586
|
return I(t, "Tab", { shiftKey: "any" });
|
|
590
|
-
}(n)) E(e,
|
|
587
|
+
}(n)) E(e, yo, n);
|
|
591
588
|
else if (function(t) {
|
|
592
|
-
return I(t, "z",
|
|
593
|
-
}(n)) n.preventDefault(), E(e,
|
|
589
|
+
return I(t, "z", xe);
|
|
590
|
+
}(n)) n.preventDefault(), E(e, Ui, void 0);
|
|
594
591
|
else if (function(t) {
|
|
595
|
-
return
|
|
596
|
-
}(n)) n.preventDefault(), E(e,
|
|
592
|
+
return ue ? I(t, "z", { metaKey: !0, shiftKey: !0 }) : I(t, "y", { ctrlKey: !0 }) || I(t, "z", { ctrlKey: !0, shiftKey: !0 });
|
|
593
|
+
}(n)) n.preventDefault(), E(e, ji, void 0);
|
|
597
594
|
else {
|
|
598
595
|
const t = e._editorState._selection;
|
|
599
|
-
t === null || O(t) ?
|
|
600
|
-
return I(r, "c",
|
|
601
|
-
}(n) ? (n.preventDefault(), E(e,
|
|
602
|
-
return I(r, "x",
|
|
603
|
-
}(n) ? (n.preventDefault(), E(e,
|
|
596
|
+
t === null || O(t) ? mi(n) && (n.preventDefault(), E(e, Jr, n)) : function(r) {
|
|
597
|
+
return I(r, "c", xe);
|
|
598
|
+
}(n) ? (n.preventDefault(), E(e, $i, n)) : function(r) {
|
|
599
|
+
return I(r, "x", xe);
|
|
600
|
+
}(n) ? (n.preventDefault(), E(e, Vi, n)) : mi(n) && (n.preventDefault(), E(e, Jr, n));
|
|
604
601
|
}
|
|
605
602
|
(function(t) {
|
|
606
603
|
return t.ctrlKey || t.shiftKey || t.altKey || t.metaKey;
|
|
607
|
-
})(n) && E(e,
|
|
604
|
+
})(n) && E(e, To, n);
|
|
608
605
|
}
|
|
609
606
|
}], ["pointerdown", function(n, e) {
|
|
610
607
|
const t = n.target, r = n.pointerType;
|
|
611
|
-
|
|
612
|
-
|
|
608
|
+
Pt(t) && r !== "touch" && r !== "pen" && n.button === 0 && te(e, () => {
|
|
609
|
+
hi(t) || (tr = !0);
|
|
613
610
|
});
|
|
614
611
|
}], ["compositionstart", function(n, e) {
|
|
615
612
|
te(e, () => {
|
|
616
613
|
const t = L();
|
|
617
614
|
if (O(t) && !e.isComposing()) {
|
|
618
615
|
const r = t.anchor, i = t.anchor.getNode();
|
|
619
|
-
H(r.key), (n.timeStamp <
|
|
616
|
+
H(r.key), (n.timeStamp < pt + Qn || r.type === "element" || !t.isCollapsed() || i.getFormat() !== t.format || M(i) && i.getStyle() !== t.style) && E(e, _t, Ws);
|
|
620
617
|
}
|
|
621
618
|
});
|
|
622
619
|
}], ["compositionend", function(n, e) {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
}) : (
|
|
620
|
+
Re ? ht = !0 : rt || !Ct && !Xt ? te(e, () => {
|
|
621
|
+
Bt(e, n.data);
|
|
622
|
+
}) : (On = !0, Dn = n.data);
|
|
626
623
|
}], ["input", function(n, e) {
|
|
627
624
|
n.stopPropagation(), te(e, () => {
|
|
628
|
-
if (ee(n.target) &&
|
|
629
|
-
const t = L(), r = n.data, i =
|
|
630
|
-
if (r != null && O(t) &&
|
|
631
|
-
|
|
632
|
-
const s = t.anchor.getNode(), o =
|
|
625
|
+
if (ee(n.target) && hi(n.target)) return;
|
|
626
|
+
const t = L(), r = n.data, i = Qi(n);
|
|
627
|
+
if (r != null && O(t) && Gi(t, i, r, n.timeStamp, !1)) {
|
|
628
|
+
ht && (Bt(e, r), ht = !1);
|
|
629
|
+
const s = t.anchor.getNode(), o = ke(se(e));
|
|
633
630
|
if (o === null) return;
|
|
634
631
|
const l = t.isBackward(), a = l ? t.anchor.offset : t.focus.offset, c = l ? t.focus.offset : t.anchor.offset;
|
|
635
|
-
|
|
632
|
+
Gt && !t.isCollapsed() && M(s) && o.anchorNode !== null && s.getTextContent().slice(0, a) + r + s.getTextContent().slice(a + c) === ks(o.anchorNode) || E(e, _t, r);
|
|
636
633
|
const u = r.length;
|
|
637
|
-
|
|
634
|
+
Re && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), Ct || rt || Xt || !e.isComposing() || (pt = 0, H(null));
|
|
638
635
|
} else
|
|
639
|
-
|
|
636
|
+
kr(!1, e, r !== null ? r : void 0), ht && (Bt(e, r || void 0), ht = !1);
|
|
640
637
|
(function() {
|
|
641
638
|
G();
|
|
642
639
|
const s = R();
|
|
643
|
-
|
|
640
|
+
Pi(s);
|
|
644
641
|
})();
|
|
645
|
-
}, { event: n }),
|
|
642
|
+
}, { event: n }), Qe = null;
|
|
646
643
|
}], ["click", function(n, e) {
|
|
647
644
|
te(e, () => {
|
|
648
|
-
const t = L(), r =
|
|
645
|
+
const t = L(), r = ke(se(e)), i = ut();
|
|
649
646
|
if (r) {
|
|
650
647
|
if (O(t)) {
|
|
651
648
|
const s = t.anchor, o = s.getNode();
|
|
@@ -663,41 +660,41 @@ const Ji = D("SELECTION_CHANGE_COMMAND"), bl = D("SELECTION_INSERT_CLIPBOARD_NOD
|
|
|
663
660
|
}
|
|
664
661
|
} else if (n.pointerType === "touch" || n.pointerType === "pen") {
|
|
665
662
|
const s = r.anchorNode;
|
|
666
|
-
(ee(s) ||
|
|
663
|
+
(ee(s) || Te(s)) && ie(yn(i, r, e, n));
|
|
667
664
|
}
|
|
668
665
|
}
|
|
669
|
-
E(e,
|
|
666
|
+
E(e, io, n);
|
|
670
667
|
});
|
|
671
|
-
}], ["cut",
|
|
672
|
-
|
|
673
|
-
const i = t.inputType, s =
|
|
674
|
-
i === "deleteCompositionText" ||
|
|
668
|
+
}], ["cut", ye], ["copy", ye], ["dragstart", ye], ["dragover", ye], ["dragend", ye], ["paste", ye], ["focus", ye], ["blur", ye], ["drop", ye]];
|
|
669
|
+
Gt && Zn.push(["beforeinput", (n, e) => function(t, r) {
|
|
670
|
+
const i = t.inputType, s = Qi(t);
|
|
671
|
+
i === "deleteCompositionText" || Re && Ts(r) || i !== "insertCompositionText" && te(r, () => {
|
|
675
672
|
const o = L();
|
|
676
673
|
if (i === "deleteContentBackward") {
|
|
677
674
|
if (o === null) {
|
|
678
|
-
const g =
|
|
675
|
+
const g = ut();
|
|
679
676
|
if (!O(g)) return;
|
|
680
677
|
ie(g.clone());
|
|
681
678
|
}
|
|
682
679
|
if (O(o)) {
|
|
683
680
|
const g = o.anchor.key === o.focus.key;
|
|
684
|
-
if (l = t.timeStamp,
|
|
685
|
-
if (H(null),
|
|
681
|
+
if (l = t.timeStamp, Yi === "MediaLast" && l < pt + Qn && r.isComposing() && g) {
|
|
682
|
+
if (H(null), pt = 0, setTimeout(() => {
|
|
686
683
|
te(r, () => {
|
|
687
684
|
H(null);
|
|
688
685
|
});
|
|
689
|
-
},
|
|
686
|
+
}, Qn), O(o)) {
|
|
690
687
|
const d = o.anchor.getNode();
|
|
691
|
-
d.markDirty(), M(d) || T(142),
|
|
688
|
+
d.markDirty(), M(d) || T(142), Xi(o, d);
|
|
692
689
|
}
|
|
693
690
|
} else {
|
|
694
691
|
H(null), t.preventDefault();
|
|
695
692
|
const d = o.anchor.getNode(), _ = d.getTextContent(), p = d.canInsertTextAfter(), x = o.anchor.offset === 0 && o.focus.offset === _.length;
|
|
696
|
-
let y =
|
|
697
|
-
if (y && o.isCollapsed() && (y = !z(
|
|
698
|
-
E(r,
|
|
693
|
+
let y = Pr && g && !x && p;
|
|
694
|
+
if (y && o.isCollapsed() && (y = !z(Ho(o.anchor, !0))), !y) {
|
|
695
|
+
E(r, sn, !0);
|
|
699
696
|
const m = L();
|
|
700
|
-
|
|
697
|
+
Pr && O(m) && m.isCollapsed() && (Ie = m, setTimeout(() => Ie = null));
|
|
701
698
|
}
|
|
702
699
|
}
|
|
703
700
|
return;
|
|
@@ -706,130 +703,130 @@ Xt && er.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
706
703
|
var l;
|
|
707
704
|
if (!O(o)) return;
|
|
708
705
|
const a = t.data;
|
|
709
|
-
|
|
706
|
+
Qe !== null && kr(!1, r, Qe), o.dirty && Qe === null || !o.isCollapsed() || ne(o.anchor.getNode()) || s === null || o.applyDOMRange(s), Qe = null;
|
|
710
707
|
const c = o.anchor, u = o.focus, h = c.getNode(), f = u.getNode();
|
|
711
708
|
if (i !== "insertText" && i !== "insertTranspose") switch (t.preventDefault(), i) {
|
|
712
709
|
case "insertFromYank":
|
|
713
710
|
case "insertFromDrop":
|
|
714
711
|
case "insertReplacementText":
|
|
715
|
-
E(r,
|
|
712
|
+
E(r, _t, t);
|
|
716
713
|
break;
|
|
717
714
|
case "insertFromComposition":
|
|
718
|
-
H(null), E(r,
|
|
715
|
+
H(null), E(r, _t, t);
|
|
719
716
|
break;
|
|
720
717
|
case "insertLineBreak":
|
|
721
|
-
H(null), E(r,
|
|
718
|
+
H(null), E(r, $t, !1);
|
|
722
719
|
break;
|
|
723
720
|
case "insertParagraph":
|
|
724
|
-
H(null),
|
|
721
|
+
H(null), yt && !rt ? (yt = !1, E(r, $t, !1)) : E(r, Rr, void 0);
|
|
725
722
|
break;
|
|
726
723
|
case "insertFromPaste":
|
|
727
724
|
case "insertFromPasteAsQuotation":
|
|
728
|
-
E(r,
|
|
725
|
+
E(r, Ji, t);
|
|
729
726
|
break;
|
|
730
727
|
case "deleteByComposition":
|
|
731
728
|
(function(g, d) {
|
|
732
|
-
return g !== d || v(g) || v(d) || !
|
|
733
|
-
})(h, f) && E(r,
|
|
729
|
+
return g !== d || v(g) || v(d) || !ze(g) || !ze(d);
|
|
730
|
+
})(h, f) && E(r, Wr, t);
|
|
734
731
|
break;
|
|
735
732
|
case "deleteByDrag":
|
|
736
733
|
case "deleteByCut":
|
|
737
|
-
E(r,
|
|
734
|
+
E(r, Wr, t);
|
|
738
735
|
break;
|
|
739
736
|
case "deleteContent":
|
|
740
|
-
E(r,
|
|
737
|
+
E(r, sn, !1);
|
|
741
738
|
break;
|
|
742
739
|
case "deleteWordBackward":
|
|
743
|
-
E(r,
|
|
740
|
+
E(r, on, !0);
|
|
744
741
|
break;
|
|
745
742
|
case "deleteWordForward":
|
|
746
|
-
E(r,
|
|
743
|
+
E(r, on, !1);
|
|
747
744
|
break;
|
|
748
745
|
case "deleteHardLineBackward":
|
|
749
746
|
case "deleteSoftLineBackward":
|
|
750
|
-
E(r,
|
|
747
|
+
E(r, ln, !0);
|
|
751
748
|
break;
|
|
752
749
|
case "deleteContentForward":
|
|
753
750
|
case "deleteHardLineForward":
|
|
754
751
|
case "deleteSoftLineForward":
|
|
755
|
-
E(r,
|
|
752
|
+
E(r, ln, !1);
|
|
756
753
|
break;
|
|
757
754
|
case "formatStrikeThrough":
|
|
758
|
-
E(r,
|
|
755
|
+
E(r, Ke, "strikethrough");
|
|
759
756
|
break;
|
|
760
757
|
case "formatBold":
|
|
761
|
-
E(r,
|
|
758
|
+
E(r, Ke, "bold");
|
|
762
759
|
break;
|
|
763
760
|
case "formatItalic":
|
|
764
|
-
E(r,
|
|
761
|
+
E(r, Ke, "italic");
|
|
765
762
|
break;
|
|
766
763
|
case "formatUnderline":
|
|
767
|
-
E(r,
|
|
764
|
+
E(r, Ke, "underline");
|
|
768
765
|
break;
|
|
769
766
|
case "historyUndo":
|
|
770
|
-
E(r,
|
|
767
|
+
E(r, Ui, void 0);
|
|
771
768
|
break;
|
|
772
769
|
case "historyRedo":
|
|
773
|
-
E(r,
|
|
770
|
+
E(r, ji, void 0);
|
|
774
771
|
}
|
|
775
772
|
else {
|
|
776
773
|
if (a === `
|
|
777
|
-
`) t.preventDefault(), E(r,
|
|
778
|
-
else if (a ===
|
|
774
|
+
`) t.preventDefault(), E(r, $t, !1);
|
|
775
|
+
else if (a === ve) t.preventDefault(), E(r, Rr, void 0);
|
|
779
776
|
else if (a == null && t.dataTransfer) {
|
|
780
777
|
const g = t.dataTransfer.getData("text/plain");
|
|
781
778
|
t.preventDefault(), o.insertRawText(g);
|
|
782
|
-
} else a != null &&
|
|
783
|
-
|
|
779
|
+
} else a != null && Gi(o, s, a, t.timeStamp, !0) ? (t.preventDefault(), E(r, _t, a)) : Qe = a;
|
|
780
|
+
Hi = t.timeStamp;
|
|
784
781
|
}
|
|
785
782
|
});
|
|
786
783
|
}(n, e)]);
|
|
787
|
-
let
|
|
788
|
-
const
|
|
789
|
-
let
|
|
790
|
-
function
|
|
791
|
-
const s = n.anchor, o = n.focus, l = s.getNode(), a = R(), c =
|
|
792
|
-
return h !== o.key || !M(l) || (!i && (!
|
|
784
|
+
let pt = 0, Yi = null, Hi = 0, Qe = null;
|
|
785
|
+
const an = /* @__PURE__ */ new WeakMap();
|
|
786
|
+
let er = !1, tr = !1, yt = !1, ht = !1, On = !1, Dn = "", Ie = null, qi = [0, "", 0, "root", 0];
|
|
787
|
+
function Gi(n, e, t, r, i) {
|
|
788
|
+
const s = n.anchor, o = n.focus, l = s.getNode(), a = R(), c = ke(se(a)), u = c !== null ? c.anchorNode : null, h = s.key, f = a.getElementByKey(h), g = t.length;
|
|
789
|
+
return h !== o.key || !M(l) || (!i && (!Gt || Hi < r + 50) || l.isDirty() && g < 2 || Ss(t)) && s.offset !== o.offset && !l.isComposing() || Ne(l) || l.isDirty() && g > 1 || (i || !Gt) && f !== null && !l.isComposing() && u !== st(f) || c !== null && e !== null && (!e.collapsed || e.startContainer !== c.anchorNode || e.startOffset !== c.anchorOffset) || l.getFormat() !== n.format || l.getStyle() !== n.style || function(d, _) {
|
|
793
790
|
if (_.isSegmented()) return !0;
|
|
794
791
|
if (!d.isCollapsed()) return !1;
|
|
795
|
-
const p = d.anchor.offset, x = _.getParentOrThrow(), y =
|
|
792
|
+
const p = d.anchor.offset, x = _.getParentOrThrow(), y = ze(_);
|
|
796
793
|
return p === 0 ? !_.canInsertTextBefore() || !x.canInsertTextBefore() && !_.isComposing() || y || function(m) {
|
|
797
794
|
const b = m.getPreviousSibling();
|
|
798
795
|
return (M(b) || v(b) && b.isInline()) && !b.canInsertTextAfter();
|
|
799
796
|
}(_) : p === _.getTextContentSize() && (!_.canInsertTextAfter() || !x.canInsertTextAfter() && !_.isComposing() || y);
|
|
800
797
|
}(n, l);
|
|
801
798
|
}
|
|
802
|
-
function
|
|
803
|
-
return
|
|
799
|
+
function Ur(n, e) {
|
|
800
|
+
return Te(n) && n.nodeValue !== null && e !== 0 && e !== n.nodeValue.length;
|
|
804
801
|
}
|
|
805
|
-
function
|
|
802
|
+
function jr(n, e, t) {
|
|
806
803
|
const { anchorNode: r, anchorOffset: i, focusNode: s, focusOffset: o } = n;
|
|
807
|
-
|
|
804
|
+
er && (er = !1, Ur(r, i) && Ur(s, o) && !Ie) || te(e, () => {
|
|
808
805
|
if (!t) return void ie(null);
|
|
809
|
-
if (!
|
|
806
|
+
if (!Sn(e, r, s)) return;
|
|
810
807
|
let l = L();
|
|
811
|
-
if (
|
|
812
|
-
const a = l.anchor, c =
|
|
813
|
-
(a.key === c.key && a.offset === c.offset + 1 || a.offset === 1 && c.getNode().is(a.getNode().getPreviousSibling())) && (l =
|
|
808
|
+
if (Ie && O(l) && l.isCollapsed()) {
|
|
809
|
+
const a = l.anchor, c = Ie.anchor;
|
|
810
|
+
(a.key === c.key && a.offset === c.offset + 1 || a.offset === 1 && c.getNode().is(a.getNode().getPreviousSibling())) && (l = Ie.clone(), ie(l));
|
|
814
811
|
}
|
|
815
|
-
if (
|
|
812
|
+
if (Ie = null, O(l)) {
|
|
816
813
|
const a = l.anchor, c = a.getNode();
|
|
817
814
|
if (l.isCollapsed()) {
|
|
818
815
|
n.type === "Range" && n.anchorNode === n.focusNode && (l.dirty = !0);
|
|
819
|
-
const u =
|
|
820
|
-
if (h < p + 200 && a.offset === d && a.key === _)
|
|
821
|
-
else if (a.type === "text") M(c) || T(141),
|
|
816
|
+
const u = se(e).event, h = u ? u.timeStamp : performance.now(), [f, g, d, _, p] = qi, x = re(), y = e.isComposing() === !1 && x.getTextContent() === "";
|
|
817
|
+
if (h < p + 200 && a.offset === d && a.key === _) Vt(l, f, g);
|
|
818
|
+
else if (a.type === "text") M(c) || T(141), Xi(l, c);
|
|
822
819
|
else if (a.type === "element" && !y) {
|
|
823
820
|
v(c) || T(259);
|
|
824
821
|
const m = a.getNode();
|
|
825
822
|
m.isEmpty() ? function(b, N) {
|
|
826
823
|
const C = N.getTextFormat(), w = N.getTextStyle();
|
|
827
|
-
|
|
828
|
-
}(l, m) :
|
|
824
|
+
Vt(b, C, w);
|
|
825
|
+
}(l, m) : Vt(l, 0, "");
|
|
829
826
|
}
|
|
830
827
|
} else {
|
|
831
828
|
const u = a.key, h = l.focus.key, f = l.getNodes(), g = f.length, d = l.isBackward(), _ = d ? o : i, p = d ? i : o, x = d ? h : u, y = d ? u : h;
|
|
832
|
-
let m =
|
|
829
|
+
let m = Rs, b = !1;
|
|
833
830
|
for (let N = 0; N < g; N++) {
|
|
834
831
|
const C = f[N], w = C.getTextContentSize();
|
|
835
832
|
if (M(C) && w !== 0 && !(N === 0 && C.__key === x && _ === w || N === g - 1 && C.__key === y && p === 0) && (b = !0, m &= C.getFormat(), m === 0)) break;
|
|
@@ -837,78 +834,78 @@ function $r(n, e, t) {
|
|
|
837
834
|
l.format = b ? m : 0;
|
|
838
835
|
}
|
|
839
836
|
}
|
|
840
|
-
E(e,
|
|
837
|
+
E(e, Wi, void 0);
|
|
841
838
|
});
|
|
842
839
|
}
|
|
843
|
-
function
|
|
840
|
+
function Vt(n, e, t) {
|
|
844
841
|
n.format === e && n.style === t || (n.format = e, n.style = t, n.dirty = !0);
|
|
845
842
|
}
|
|
846
|
-
function
|
|
847
|
-
|
|
843
|
+
function Xi(n, e) {
|
|
844
|
+
Vt(n, e.getFormat(), e.getStyle());
|
|
848
845
|
}
|
|
849
|
-
function
|
|
846
|
+
function Qi(n) {
|
|
850
847
|
if (!n.getTargetRanges) return null;
|
|
851
848
|
const e = n.getTargetRanges();
|
|
852
849
|
return e.length === 0 ? null : e[0];
|
|
853
850
|
}
|
|
854
|
-
function
|
|
851
|
+
function Bt(n, e) {
|
|
855
852
|
const t = n._compositionKey;
|
|
856
853
|
if (H(null), t !== null && e != null) {
|
|
857
854
|
if (e === "") {
|
|
858
|
-
const r = $(t), i =
|
|
859
|
-
return void (i !== null && i.nodeValue !== null && M(r) &&
|
|
855
|
+
const r = $(t), i = st(n.getElementByKey(t));
|
|
856
|
+
return void (i !== null && i.nodeValue !== null && M(r) && Tr(r, i.nodeValue, null, null, !0));
|
|
860
857
|
}
|
|
861
858
|
if (e[e.length - 1] === `
|
|
862
859
|
`) {
|
|
863
860
|
const r = L();
|
|
864
861
|
if (O(r)) {
|
|
865
862
|
const i = r.focus;
|
|
866
|
-
return r.anchor.set(i.key, i.offset, i.type), void E(n,
|
|
863
|
+
return r.anchor.set(i.key, i.offset, i.type), void E(n, Xn, null);
|
|
867
864
|
}
|
|
868
865
|
}
|
|
869
866
|
}
|
|
870
|
-
|
|
867
|
+
kr(!0, n, e);
|
|
871
868
|
}
|
|
872
|
-
function
|
|
869
|
+
function Zi(n) {
|
|
873
870
|
let e = n.__lexicalEventHandles;
|
|
874
871
|
return e === void 0 && (e = [], n.__lexicalEventHandles = e), e;
|
|
875
872
|
}
|
|
876
|
-
const
|
|
877
|
-
function
|
|
878
|
-
const e =
|
|
873
|
+
const et = /* @__PURE__ */ new Map();
|
|
874
|
+
function es(n) {
|
|
875
|
+
const e = el(n.target);
|
|
879
876
|
if (e === null) return;
|
|
880
|
-
const t =
|
|
877
|
+
const t = ps(e.anchorNode);
|
|
881
878
|
if (t === null) return;
|
|
882
|
-
|
|
883
|
-
const a =
|
|
884
|
-
(ee(c) ||
|
|
879
|
+
tr && (tr = !1, te(t, () => {
|
|
880
|
+
const a = ut(), c = e.anchorNode;
|
|
881
|
+
(ee(c) || Te(c)) && ie(yn(a, e, t, n));
|
|
885
882
|
}));
|
|
886
|
-
const r =
|
|
887
|
-
l !== t &&
|
|
883
|
+
const r = vr(t), i = r[r.length - 1], s = i._key, o = et.get(s), l = o || i;
|
|
884
|
+
l !== t && jr(e, l, !1), jr(e, t, !0), t !== i ? et.set(s, t) : o && et.delete(s);
|
|
888
885
|
}
|
|
889
|
-
function
|
|
886
|
+
function $r(n) {
|
|
890
887
|
n._lexicalHandled = !0;
|
|
891
888
|
}
|
|
892
|
-
function
|
|
889
|
+
function Vr(n) {
|
|
893
890
|
return n._lexicalHandled === !0;
|
|
894
891
|
}
|
|
895
|
-
function
|
|
896
|
-
const e = n.ownerDocument, t =
|
|
892
|
+
function bo(n) {
|
|
893
|
+
const e = n.ownerDocument, t = an.get(e);
|
|
897
894
|
if (t === void 0) return;
|
|
898
895
|
const r = t - 1;
|
|
899
|
-
r >= 0 || T(164),
|
|
900
|
-
const i =
|
|
901
|
-
|
|
896
|
+
r >= 0 || T(164), an.set(e, r), r === 0 && e.removeEventListener("selectionchange", es);
|
|
897
|
+
const i = vn(n);
|
|
898
|
+
Cr(i) ? (function(o) {
|
|
902
899
|
if (o._parentEditor !== null) {
|
|
903
|
-
const l =
|
|
904
|
-
|
|
905
|
-
} else
|
|
900
|
+
const l = vr(o), a = l[l.length - 1]._key;
|
|
901
|
+
et.get(a) === o && et.delete(a);
|
|
902
|
+
} else et.delete(o._key);
|
|
906
903
|
}(i), n.__lexicalEditor = null) : i && T(198);
|
|
907
|
-
const s =
|
|
904
|
+
const s = Zi(n);
|
|
908
905
|
for (let o = 0; o < s.length; o++) s[o]();
|
|
909
906
|
n.__lexicalEventHandles = [];
|
|
910
907
|
}
|
|
911
|
-
function
|
|
908
|
+
function nr(n, e, t) {
|
|
912
909
|
G();
|
|
913
910
|
const r = n.__key, i = n.getParent();
|
|
914
911
|
if (i === null) return;
|
|
@@ -916,20 +913,20 @@ function rr(n, e, t) {
|
|
|
916
913
|
const a = L();
|
|
917
914
|
if (!O(a) || !v(l)) return a;
|
|
918
915
|
const { anchor: c, focus: u } = a, h = c.getNode(), f = u.getNode();
|
|
919
|
-
return
|
|
916
|
+
return rr(h, l) && c.set(l.__key, 0, "element"), rr(f, l) && u.set(l.__key, 0, "element"), a;
|
|
920
917
|
}(n);
|
|
921
918
|
let o = !1;
|
|
922
919
|
if (O(s) && e) {
|
|
923
920
|
const l = s.anchor, a = s.focus;
|
|
924
|
-
l.key === r && (
|
|
925
|
-
} else
|
|
921
|
+
l.key === r && (un(l, n, i, n.getPreviousSibling(), n.getNextSibling()), o = !0), a.key === r && (un(a, n, i, n.getPreviousSibling(), n.getNextSibling()), o = !0);
|
|
922
|
+
} else pr(s) && e && n.isSelected() && n.selectPrevious();
|
|
926
923
|
if (O(s) && e && !o) {
|
|
927
924
|
const l = n.getIndexWithinParent();
|
|
928
|
-
|
|
929
|
-
} else
|
|
930
|
-
t ||
|
|
925
|
+
Be(n), cn(s, i, l, -1);
|
|
926
|
+
} else Be(n);
|
|
927
|
+
t || Fe(i) || i.canBeEmpty() || !i.isEmpty() || nr(i, e), e && s && ne(i) && i.isEmpty() && i.selectEnd();
|
|
931
928
|
}
|
|
932
|
-
class
|
|
929
|
+
class _n {
|
|
933
930
|
static getType() {
|
|
934
931
|
T(64, this.name);
|
|
935
932
|
}
|
|
@@ -940,7 +937,7 @@ class pn {
|
|
|
940
937
|
this.__parent = e.__parent, this.__next = e.__next, this.__prev = e.__prev, this.__state = e.__state;
|
|
941
938
|
}
|
|
942
939
|
constructor(e) {
|
|
943
|
-
this.__type = this.constructor.getType(), this.__parent = null, this.__prev = null, this.__next = null, Object.defineProperty(this, "__state", { configurable: !0, enumerable: !1, value: void 0, writable: !0 }),
|
|
940
|
+
this.__type = this.constructor.getType(), this.__parent = null, this.__prev = null, this.__next = null, Object.defineProperty(this, "__state", { configurable: !0, enumerable: !1, value: void 0, writable: !0 }), ys(this, e);
|
|
944
941
|
}
|
|
945
942
|
getType() {
|
|
946
943
|
return this.__type;
|
|
@@ -998,7 +995,7 @@ class pn {
|
|
|
998
995
|
let e = this;
|
|
999
996
|
for (; e !== null; ) {
|
|
1000
997
|
const t = e.getParent();
|
|
1001
|
-
if (
|
|
998
|
+
if (Fe(t)) return v(e) || e === this && z(e) || T(194), e;
|
|
1002
999
|
e = t;
|
|
1003
1000
|
}
|
|
1004
1001
|
return null;
|
|
@@ -1041,18 +1038,18 @@ class pn {
|
|
|
1041
1038
|
return e;
|
|
1042
1039
|
}
|
|
1043
1040
|
getCommonAncestor(e) {
|
|
1044
|
-
const t = v(this) ? this : this.getParent(), r = v(e) ? e : e.getParent(), i = t && r ?
|
|
1041
|
+
const t = v(this) ? this : this.getParent(), r = v(e) ? e : e.getParent(), i = t && r ? Ht(t, r) : null;
|
|
1045
1042
|
return i ? i.commonAncestor : null;
|
|
1046
1043
|
}
|
|
1047
1044
|
is(e) {
|
|
1048
1045
|
return e != null && this.__key === e.__key;
|
|
1049
1046
|
}
|
|
1050
1047
|
isBefore(e) {
|
|
1051
|
-
const t =
|
|
1052
|
-
return t !== null && (t.type === "descendant" || (t.type === "branch" ?
|
|
1048
|
+
const t = Ht(this, e);
|
|
1049
|
+
return t !== null && (t.type === "descendant" || (t.type === "branch" ? Ms(t) === -1 : (t.type !== "same" && t.type !== "ancestor" && T(279), !1)));
|
|
1053
1050
|
}
|
|
1054
1051
|
isParentOf(e) {
|
|
1055
|
-
const t =
|
|
1052
|
+
const t = Ht(this, e);
|
|
1056
1053
|
return t !== null && t.type === "ancestor";
|
|
1057
1054
|
}
|
|
1058
1055
|
getNodesBetween(e) {
|
|
@@ -1092,10 +1089,10 @@ class pn {
|
|
|
1092
1089
|
}
|
|
1093
1090
|
getWritable() {
|
|
1094
1091
|
G();
|
|
1095
|
-
const e =
|
|
1096
|
-
if (l !== null && l.setCachedNodes(null), o.has(i)) return
|
|
1097
|
-
const a =
|
|
1098
|
-
return o.add(i),
|
|
1092
|
+
const e = Pe(), t = R(), r = e._nodeMap, i = this.__key, s = this.getLatest(), o = t._cloneNotNeeded, l = L();
|
|
1093
|
+
if (l !== null && l.setCachedNodes(null), o.has(i)) return dn(s), s;
|
|
1094
|
+
const a = il(s);
|
|
1095
|
+
return o.add(i), dn(a), r.set(i, a), a;
|
|
1099
1096
|
}
|
|
1100
1097
|
getTextContent() {
|
|
1101
1098
|
return "";
|
|
@@ -1122,38 +1119,38 @@ class pn {
|
|
|
1122
1119
|
updateFromJSON(e) {
|
|
1123
1120
|
return function(t, r) {
|
|
1124
1121
|
const i = t.getWritable();
|
|
1125
|
-
return (r || i.__state) &&
|
|
1122
|
+
return (r || i.__state) && eo(t).updateFromJSON(r), i;
|
|
1126
1123
|
}(this, e.$);
|
|
1127
1124
|
}
|
|
1128
1125
|
static transform() {
|
|
1129
1126
|
return null;
|
|
1130
1127
|
}
|
|
1131
1128
|
remove(e) {
|
|
1132
|
-
|
|
1129
|
+
nr(this, !0, e);
|
|
1133
1130
|
}
|
|
1134
1131
|
replace(e, t) {
|
|
1135
1132
|
G();
|
|
1136
1133
|
let r = L();
|
|
1137
|
-
r !== null && (r = r.clone()),
|
|
1134
|
+
r !== null && (r = r.clone()), Bn(this, e);
|
|
1138
1135
|
const i = this.getLatest(), s = this.__key, o = e.__key, l = e.getWritable(), a = this.getParentOrThrow().getWritable(), c = a.__size;
|
|
1139
|
-
|
|
1136
|
+
Be(l);
|
|
1140
1137
|
const u = i.getPreviousSibling(), h = i.getNextSibling(), f = i.__prev, g = i.__next, d = i.__parent;
|
|
1141
|
-
if (
|
|
1138
|
+
if (nr(i, !1, !0), u === null ? a.__first = o : u.getWritable().__next = o, l.__prev = f, h === null ? a.__last = o : h.getWritable().__prev = o, l.__next = g, l.__parent = d, a.__size = c, t && (v(this) && v(l) || T(139), this.getChildren().forEach((_) => {
|
|
1142
1139
|
l.append(_);
|
|
1143
1140
|
})), O(r)) {
|
|
1144
1141
|
ie(r);
|
|
1145
1142
|
const _ = r.anchor, p = r.focus;
|
|
1146
|
-
_.key === s &&
|
|
1143
|
+
_.key === s && Gr(_, l), p.key === s && Gr(p, l);
|
|
1147
1144
|
}
|
|
1148
|
-
return
|
|
1145
|
+
return Ee() === s && H(o), l;
|
|
1149
1146
|
}
|
|
1150
1147
|
insertAfter(e, t = !0) {
|
|
1151
|
-
G(),
|
|
1148
|
+
G(), Bn(this, e);
|
|
1152
1149
|
const r = this.getWritable(), i = e.getWritable(), s = i.getParent(), o = L();
|
|
1153
1150
|
let l = !1, a = !1;
|
|
1154
1151
|
if (s !== null) {
|
|
1155
1152
|
const g = e.getIndexWithinParent();
|
|
1156
|
-
if (
|
|
1153
|
+
if (Be(i), O(o)) {
|
|
1157
1154
|
const d = s.__key, _ = o.anchor, p = o.focus;
|
|
1158
1155
|
l = _.type === "element" && _.key === d && _.offset === g + 1, a = p.type === "element" && p.key === d && p.offset === g + 1;
|
|
1159
1156
|
}
|
|
@@ -1161,26 +1158,26 @@ class pn {
|
|
|
1161
1158
|
const c = this.getNextSibling(), u = this.getParentOrThrow().getWritable(), h = i.__key, f = r.__next;
|
|
1162
1159
|
if (c === null ? u.__last = h : c.getWritable().__prev = h, u.__size++, r.__next = h, i.__next = f, i.__prev = r.__key, i.__parent = r.__parent, t && O(o)) {
|
|
1163
1160
|
const g = this.getIndexWithinParent();
|
|
1164
|
-
|
|
1161
|
+
cn(o, u, g + 1);
|
|
1165
1162
|
const d = u.__key;
|
|
1166
1163
|
l && o.anchor.set(d, g + 2, "element"), a && o.focus.set(d, g + 2, "element");
|
|
1167
1164
|
}
|
|
1168
1165
|
return e;
|
|
1169
1166
|
}
|
|
1170
1167
|
insertBefore(e, t = !0) {
|
|
1171
|
-
G(),
|
|
1168
|
+
G(), Bn(this, e);
|
|
1172
1169
|
const r = this.getWritable(), i = e.getWritable(), s = i.__key;
|
|
1173
|
-
|
|
1170
|
+
Be(i);
|
|
1174
1171
|
const o = this.getPreviousSibling(), l = this.getParentOrThrow().getWritable(), a = r.__prev, c = this.getIndexWithinParent();
|
|
1175
1172
|
o === null ? l.__first = s : o.getWritable().__next = s, l.__size++, r.__prev = s, i.__prev = a, i.__next = r.__key, i.__parent = r.__parent;
|
|
1176
1173
|
const u = L();
|
|
1177
|
-
return t && O(u) &&
|
|
1174
|
+
return t && O(u) && cn(u, this.getParentOrThrow(), c), e;
|
|
1178
1175
|
}
|
|
1179
1176
|
isParentRequired() {
|
|
1180
1177
|
return !1;
|
|
1181
1178
|
}
|
|
1182
1179
|
createParentElementNode() {
|
|
1183
|
-
return
|
|
1180
|
+
return Me();
|
|
1184
1181
|
}
|
|
1185
1182
|
selectStart() {
|
|
1186
1183
|
return this.selectPrevious();
|
|
@@ -1217,12 +1214,12 @@ class pn {
|
|
|
1217
1214
|
this.markDirty();
|
|
1218
1215
|
}
|
|
1219
1216
|
}
|
|
1220
|
-
class
|
|
1217
|
+
class wt extends _n {
|
|
1221
1218
|
static getType() {
|
|
1222
1219
|
return "linebreak";
|
|
1223
1220
|
}
|
|
1224
1221
|
static clone(e) {
|
|
1225
|
-
return new
|
|
1222
|
+
return new wt(e.__key);
|
|
1226
1223
|
}
|
|
1227
1224
|
constructor(e) {
|
|
1228
1225
|
super(e);
|
|
@@ -1243,57 +1240,57 @@ class Et extends pn {
|
|
|
1243
1240
|
static importDOM() {
|
|
1244
1241
|
return { br: (e) => function(t) {
|
|
1245
1242
|
const r = t.parentElement;
|
|
1246
|
-
if (r !== null &&
|
|
1243
|
+
if (r !== null && Ci(r)) {
|
|
1247
1244
|
const i = r.firstChild;
|
|
1248
|
-
if (i === t || i.nextSibling === t &&
|
|
1245
|
+
if (i === t || i.nextSibling === t && Rt(i)) {
|
|
1249
1246
|
const s = r.lastChild;
|
|
1250
|
-
if (s === t || s.previousSibling === t &&
|
|
1247
|
+
if (s === t || s.previousSibling === t && Rt(s)) return !0;
|
|
1251
1248
|
}
|
|
1252
1249
|
}
|
|
1253
1250
|
return !1;
|
|
1254
1251
|
}(e) || function(t) {
|
|
1255
1252
|
const r = t.parentElement;
|
|
1256
|
-
if (r !== null &&
|
|
1253
|
+
if (r !== null && Ci(r)) {
|
|
1257
1254
|
const i = r.firstChild;
|
|
1258
|
-
if (i === t || i.nextSibling === t &&
|
|
1255
|
+
if (i === t || i.nextSibling === t && Rt(i)) return !1;
|
|
1259
1256
|
const s = r.lastChild;
|
|
1260
|
-
if (s === t || s.previousSibling === t &&
|
|
1257
|
+
if (s === t || s.previousSibling === t && Rt(s)) return !0;
|
|
1261
1258
|
}
|
|
1262
1259
|
return !1;
|
|
1263
|
-
}(e) ? null : { conversion:
|
|
1260
|
+
}(e) ? null : { conversion: No, priority: 0 } };
|
|
1264
1261
|
}
|
|
1265
1262
|
static importJSON(e) {
|
|
1266
|
-
return
|
|
1263
|
+
return Tt().updateFromJSON(e);
|
|
1267
1264
|
}
|
|
1268
1265
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return { node:
|
|
1266
|
+
function No(n) {
|
|
1267
|
+
return { node: Tt() };
|
|
1271
1268
|
}
|
|
1272
|
-
function
|
|
1273
|
-
return
|
|
1269
|
+
function Tt() {
|
|
1270
|
+
return bn(new wt());
|
|
1274
1271
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return n instanceof
|
|
1272
|
+
function tt(n) {
|
|
1273
|
+
return n instanceof wt;
|
|
1277
1274
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return
|
|
1275
|
+
function Rt(n) {
|
|
1276
|
+
return Te(n) && /^( |\t|\r?\n)+$/.test(n.textContent || "");
|
|
1280
1277
|
}
|
|
1281
|
-
function
|
|
1282
|
-
return 16 & e ? "code" : e &
|
|
1278
|
+
function Pn(n, e) {
|
|
1279
|
+
return 16 & e ? "code" : e & sr ? "mark" : 32 & e ? "sub" : 64 & e ? "sup" : null;
|
|
1283
1280
|
}
|
|
1284
|
-
function
|
|
1281
|
+
function Fn(n, e) {
|
|
1285
1282
|
return 1 & e ? "strong" : 2 & e ? "em" : "span";
|
|
1286
1283
|
}
|
|
1287
|
-
function
|
|
1284
|
+
function ts(n, e, t, r, i) {
|
|
1288
1285
|
const s = r.classList;
|
|
1289
|
-
let o =
|
|
1290
|
-
o !== void 0 && s.add(...o), o =
|
|
1286
|
+
let o = nt(i, "base");
|
|
1287
|
+
o !== void 0 && s.add(...o), o = nt(i, "underlineStrikethrough");
|
|
1291
1288
|
let l = !1;
|
|
1292
|
-
const a = e &
|
|
1293
|
-
o !== void 0 && (t &
|
|
1294
|
-
for (const c in
|
|
1295
|
-
const u =
|
|
1296
|
-
if (o =
|
|
1289
|
+
const a = e & en && e & Zt;
|
|
1290
|
+
o !== void 0 && (t & en && t & Zt ? (l = !0, a || s.add(...o)) : a && s.remove(...o));
|
|
1291
|
+
for (const c in Je) {
|
|
1292
|
+
const u = Je[c];
|
|
1293
|
+
if (o = nt(i, c), o !== void 0) if (t & u) {
|
|
1297
1294
|
if (l && (c === "underline" || c === "strikethrough")) {
|
|
1298
1295
|
e & u && s.remove(...o);
|
|
1299
1296
|
continue;
|
|
@@ -1302,12 +1299,12 @@ function ns(n, e, t, r, i) {
|
|
|
1302
1299
|
} else e & u && s.remove(...o);
|
|
1303
1300
|
}
|
|
1304
1301
|
}
|
|
1305
|
-
function
|
|
1306
|
-
const r = e.firstChild, i = t.isComposing(), s = n + (i ?
|
|
1302
|
+
function ns(n, e, t) {
|
|
1303
|
+
const r = e.firstChild, i = t.isComposing(), s = n + (i ? hn : "");
|
|
1307
1304
|
if (r == null) e.textContent = s;
|
|
1308
1305
|
else {
|
|
1309
1306
|
const o = r.nodeValue;
|
|
1310
|
-
if (o !== s) if (i ||
|
|
1307
|
+
if (o !== s) if (i || Re) {
|
|
1311
1308
|
const [l, a, c] = function(u, h) {
|
|
1312
1309
|
const f = u.length, g = h.length;
|
|
1313
1310
|
let d = 0, _ = 0;
|
|
@@ -1319,21 +1316,21 @@ function rs(n, e, t) {
|
|
|
1319
1316
|
} else r.nodeValue = s;
|
|
1320
1317
|
}
|
|
1321
1318
|
}
|
|
1322
|
-
function
|
|
1323
|
-
|
|
1319
|
+
function Yr(n, e, t, r, i, s) {
|
|
1320
|
+
ns(i, n, e);
|
|
1324
1321
|
const o = s.theme.text;
|
|
1325
|
-
o !== void 0 &&
|
|
1322
|
+
o !== void 0 && ts(0, 0, r, n, o);
|
|
1326
1323
|
}
|
|
1327
|
-
function
|
|
1324
|
+
function Wt(n, e) {
|
|
1328
1325
|
const t = document.createElement(e);
|
|
1329
1326
|
return t.appendChild(n), t;
|
|
1330
1327
|
}
|
|
1331
|
-
class
|
|
1328
|
+
class ct extends _n {
|
|
1332
1329
|
static getType() {
|
|
1333
1330
|
return "text";
|
|
1334
1331
|
}
|
|
1335
1332
|
static clone(e) {
|
|
1336
|
-
return new
|
|
1333
|
+
return new ct(e.__text, e.__key);
|
|
1337
1334
|
}
|
|
1338
1335
|
afterCloneFrom(e) {
|
|
1339
1336
|
super.afterCloneFrom(e), this.__text = e.__text, this.__format = e.__format, this.__style = e.__style, this.__mode = e.__mode, this.__detail = e.__detail;
|
|
@@ -1349,7 +1346,7 @@ class ut extends pn {
|
|
|
1349
1346
|
}
|
|
1350
1347
|
getMode() {
|
|
1351
1348
|
const e = this.getLatest();
|
|
1352
|
-
return
|
|
1349
|
+
return Ys[e.__mode];
|
|
1353
1350
|
}
|
|
1354
1351
|
getStyle() {
|
|
1355
1352
|
return this.getLatest().__style;
|
|
@@ -1358,7 +1355,7 @@ class ut extends pn {
|
|
|
1358
1355
|
return this.getLatest().__mode === 1;
|
|
1359
1356
|
}
|
|
1360
1357
|
isComposing() {
|
|
1361
|
-
return this.__key ===
|
|
1358
|
+
return this.__key === Ee();
|
|
1362
1359
|
}
|
|
1363
1360
|
isSegmented() {
|
|
1364
1361
|
return this.getLatest().__mode === 2;
|
|
@@ -1370,7 +1367,7 @@ class ut extends pn {
|
|
|
1370
1367
|
return !!(2 & this.getLatest().__detail);
|
|
1371
1368
|
}
|
|
1372
1369
|
hasFormat(e) {
|
|
1373
|
-
const t =
|
|
1370
|
+
const t = Je[e];
|
|
1374
1371
|
return !!(this.getFormat() & t);
|
|
1375
1372
|
}
|
|
1376
1373
|
isSimpleText() {
|
|
@@ -1380,7 +1377,7 @@ class ut extends pn {
|
|
|
1380
1377
|
return this.getLatest().__text;
|
|
1381
1378
|
}
|
|
1382
1379
|
getFormatFlags(e, t) {
|
|
1383
|
-
return
|
|
1380
|
+
return fn(this.getLatest().__format, e, t);
|
|
1384
1381
|
}
|
|
1385
1382
|
canHaveFormat() {
|
|
1386
1383
|
return !0;
|
|
@@ -1389,30 +1386,30 @@ class ut extends pn {
|
|
|
1389
1386
|
return !0;
|
|
1390
1387
|
}
|
|
1391
1388
|
createDOM(e, t) {
|
|
1392
|
-
const r = this.__format, i =
|
|
1389
|
+
const r = this.__format, i = Pn(0, r), s = Fn(0, r), o = i === null ? s : i, l = document.createElement(o);
|
|
1393
1390
|
let a = l;
|
|
1394
|
-
this.hasFormat("code") && l.setAttribute("spellcheck", "false"), i !== null && (a = document.createElement(s), l.appendChild(a)),
|
|
1391
|
+
this.hasFormat("code") && l.setAttribute("spellcheck", "false"), i !== null && (a = document.createElement(s), l.appendChild(a)), Yr(a, this, 0, r, this.__text, e);
|
|
1395
1392
|
const c = this.__style;
|
|
1396
1393
|
return c !== "" && (l.style.cssText = c), l;
|
|
1397
1394
|
}
|
|
1398
1395
|
updateDOM(e, t, r) {
|
|
1399
|
-
const i = this.__text, s = e.__format, o = this.__format, l =
|
|
1396
|
+
const i = this.__text, s = e.__format, o = this.__format, l = Pn(0, s), a = Pn(0, o), c = Fn(0, s), u = Fn(0, o);
|
|
1400
1397
|
if ((l === null ? c : l) !== (a === null ? u : a)) return !0;
|
|
1401
1398
|
if (l === a && c !== u) {
|
|
1402
1399
|
const _ = t.firstChild;
|
|
1403
1400
|
_ == null && T(48);
|
|
1404
1401
|
const p = document.createElement(u);
|
|
1405
|
-
return
|
|
1402
|
+
return Yr(p, this, 0, o, i, r), t.replaceChild(p, _), !1;
|
|
1406
1403
|
}
|
|
1407
1404
|
let h = t;
|
|
1408
|
-
a !== null && l !== null && (h = t.firstChild, h == null && T(49)),
|
|
1405
|
+
a !== null && l !== null && (h = t.firstChild, h == null && T(49)), ns(i, h, this);
|
|
1409
1406
|
const f = r.theme.text;
|
|
1410
|
-
f !== void 0 && s !== o &&
|
|
1407
|
+
f !== void 0 && s !== o && ts(0, s, o, h, f);
|
|
1411
1408
|
const g = e.__style, d = this.__style;
|
|
1412
1409
|
return g !== d && (t.style.cssText = d), !1;
|
|
1413
1410
|
}
|
|
1414
1411
|
static importDOM() {
|
|
1415
|
-
return { "#text": () => ({ conversion:
|
|
1412
|
+
return { "#text": () => ({ conversion: Ao, priority: 0 }), b: () => ({ conversion: Eo, priority: 0 }), code: () => ({ conversion: me, priority: 0 }), em: () => ({ conversion: me, priority: 0 }), i: () => ({ conversion: me, priority: 0 }), mark: () => ({ conversion: me, priority: 0 }), s: () => ({ conversion: me, priority: 0 }), span: () => ({ conversion: wo, priority: 0 }), strong: () => ({ conversion: me, priority: 0 }), sub: () => ({ conversion: me, priority: 0 }), sup: () => ({ conversion: me, priority: 0 }), u: () => ({ conversion: me, priority: 0 }) };
|
|
1416
1413
|
}
|
|
1417
1414
|
static importJSON(e) {
|
|
1418
1415
|
return Y().updateFromJSON(e);
|
|
@@ -1422,7 +1419,7 @@ class ut extends pn {
|
|
|
1422
1419
|
}
|
|
1423
1420
|
exportDOM(e) {
|
|
1424
1421
|
let { element: t } = super.exportDOM(e);
|
|
1425
|
-
return ee(t) || T(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 =
|
|
1422
|
+
return ee(t) || T(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 = Wt(t, "b")), this.hasFormat("italic") && (t = Wt(t, "i")), this.hasFormat("strikethrough") && (t = Wt(t, "s")), this.hasFormat("underline") && (t = Wt(t, "u")), { element: t };
|
|
1426
1423
|
}
|
|
1427
1424
|
exportJSON() {
|
|
1428
1425
|
return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), ...super.exportJSON() };
|
|
@@ -1431,18 +1428,18 @@ class ut extends pn {
|
|
|
1431
1428
|
}
|
|
1432
1429
|
setFormat(e) {
|
|
1433
1430
|
const t = this.getWritable();
|
|
1434
|
-
return t.__format = typeof e == "string" ?
|
|
1431
|
+
return t.__format = typeof e == "string" ? Je[e] : e, t;
|
|
1435
1432
|
}
|
|
1436
1433
|
setDetail(e) {
|
|
1437
1434
|
const t = this.getWritable();
|
|
1438
|
-
return t.__detail = typeof e == "string" ?
|
|
1435
|
+
return t.__detail = typeof e == "string" ? js[e] : e, t;
|
|
1439
1436
|
}
|
|
1440
1437
|
setStyle(e) {
|
|
1441
1438
|
const t = this.getWritable();
|
|
1442
1439
|
return t.__style = e, t;
|
|
1443
1440
|
}
|
|
1444
1441
|
toggleFormat(e) {
|
|
1445
|
-
const t =
|
|
1442
|
+
const t = fn(this.getFormat(), e, null);
|
|
1446
1443
|
return this.setFormat(t);
|
|
1447
1444
|
}
|
|
1448
1445
|
toggleDirectionless() {
|
|
@@ -1454,7 +1451,7 @@ class ut extends pn {
|
|
|
1454
1451
|
return e.__detail ^= 2, e;
|
|
1455
1452
|
}
|
|
1456
1453
|
setMode(e) {
|
|
1457
|
-
const t =
|
|
1454
|
+
const t = Vs[e];
|
|
1458
1455
|
if (this.__mode === t) return this;
|
|
1459
1456
|
const r = this.getWritable();
|
|
1460
1457
|
return r.__mode = t, r;
|
|
@@ -1472,9 +1469,9 @@ class ut extends pn {
|
|
|
1472
1469
|
const a = o.length;
|
|
1473
1470
|
r === void 0 && (r = a), i === void 0 && (i = a);
|
|
1474
1471
|
} else r = 0, i = 0;
|
|
1475
|
-
if (!O(s)) return
|
|
1472
|
+
if (!O(s)) return os(l, r, l, i, "text", "text");
|
|
1476
1473
|
{
|
|
1477
|
-
const a =
|
|
1474
|
+
const a = Ee();
|
|
1478
1475
|
a !== s.anchor.key && a !== s.focus.key || H(l), s.setTextNodeRange(this, r, this, i);
|
|
1479
1476
|
}
|
|
1480
1477
|
return s;
|
|
@@ -1508,7 +1505,7 @@ class ut extends pn {
|
|
|
1508
1505
|
G();
|
|
1509
1506
|
const t = this.getLatest(), r = t.getTextContent();
|
|
1510
1507
|
if (r === "") return [];
|
|
1511
|
-
const i = t.__key, s =
|
|
1508
|
+
const i = t.__key, s = Ee(), o = r.length;
|
|
1512
1509
|
e.sort((k, S) => k - S), e.push(o);
|
|
1513
1510
|
const l = [], a = e.length;
|
|
1514
1511
|
for (let k = 0, S = 0; k < o && S <= a; S++) {
|
|
@@ -1548,10 +1545,10 @@ class ut extends pn {
|
|
|
1548
1545
|
if (h !== null) {
|
|
1549
1546
|
(function(A) {
|
|
1550
1547
|
const F = A.getPreviousSibling(), W = A.getNextSibling();
|
|
1551
|
-
F !== null &&
|
|
1548
|
+
F !== null && dn(F), W !== null && dn(W);
|
|
1552
1549
|
})(this);
|
|
1553
1550
|
const k = h.getWritable(), S = this.getIndexWithinParent();
|
|
1554
|
-
p ? (k.splice(S, 0, b), this.remove()) : k.splice(S, 1, b), O(m) &&
|
|
1551
|
+
p ? (k.splice(S, 0, b), this.remove()) : k.splice(S, 1, b), O(m) && cn(m, h, S, c - 1);
|
|
1555
1552
|
}
|
|
1556
1553
|
return b;
|
|
1557
1554
|
}
|
|
@@ -1559,11 +1556,11 @@ class ut extends pn {
|
|
|
1559
1556
|
const t = e === this.getPreviousSibling();
|
|
1560
1557
|
t || e === this.getNextSibling() || T(50);
|
|
1561
1558
|
const r = this.__key, i = e.__key, s = this.__text, o = s.length;
|
|
1562
|
-
|
|
1559
|
+
Ee() === i && H(r);
|
|
1563
1560
|
const l = L();
|
|
1564
1561
|
if (O(l)) {
|
|
1565
1562
|
const h = l.anchor, f = l.focus;
|
|
1566
|
-
h !== null && h.key === i &&
|
|
1563
|
+
h !== null && h.key === i && ii(h, t, r, e, o), f !== null && f.key === i && ii(f, t, r, e, o);
|
|
1567
1564
|
}
|
|
1568
1565
|
const a = e.__text, c = t ? a + s : s + a;
|
|
1569
1566
|
this.setTextContent(c);
|
|
@@ -1574,30 +1571,30 @@ class ut extends pn {
|
|
|
1574
1571
|
return !1;
|
|
1575
1572
|
}
|
|
1576
1573
|
}
|
|
1577
|
-
function
|
|
1578
|
-
return { forChild:
|
|
1574
|
+
function wo(n) {
|
|
1575
|
+
return { forChild: gr(n.style), node: null };
|
|
1579
1576
|
}
|
|
1580
|
-
function
|
|
1577
|
+
function Eo(n) {
|
|
1581
1578
|
const e = n, t = e.style.fontWeight === "normal";
|
|
1582
|
-
return { forChild:
|
|
1579
|
+
return { forChild: gr(e.style, t ? void 0 : "bold"), node: null };
|
|
1583
1580
|
}
|
|
1584
|
-
const
|
|
1585
|
-
function
|
|
1581
|
+
const Hr = /* @__PURE__ */ new WeakMap();
|
|
1582
|
+
function Mo(n) {
|
|
1586
1583
|
if (!ee(n)) return !1;
|
|
1587
1584
|
if (n.nodeName === "PRE") return !0;
|
|
1588
1585
|
const e = n.style.whiteSpace;
|
|
1589
1586
|
return typeof e == "string" && e.startsWith("pre");
|
|
1590
1587
|
}
|
|
1591
|
-
function
|
|
1588
|
+
function Ao(n) {
|
|
1592
1589
|
const e = n;
|
|
1593
1590
|
n.parentElement === null && T(129);
|
|
1594
1591
|
let t = e.textContent || "";
|
|
1595
1592
|
if (function(r) {
|
|
1596
1593
|
let i, s = r.parentNode;
|
|
1597
1594
|
const o = [r];
|
|
1598
|
-
for (; s !== null && (i =
|
|
1595
|
+
for (; s !== null && (i = Hr.get(s)) === void 0 && !Mo(s); ) o.push(s), s = s.parentNode;
|
|
1599
1596
|
const l = i === void 0 ? s : i;
|
|
1600
|
-
for (let a = 0; a < o.length; a++)
|
|
1597
|
+
for (let a = 0; a < o.length; a++) Hr.set(o[a], l);
|
|
1601
1598
|
return l;
|
|
1602
1599
|
}(e) !== null) {
|
|
1603
1600
|
const r = t.split(/(\r?\n|\t)/), i = [], s = r.length;
|
|
@@ -1605,14 +1602,14 @@ function Po(n) {
|
|
|
1605
1602
|
const l = r[o];
|
|
1606
1603
|
l === `
|
|
1607
1604
|
` || l === `\r
|
|
1608
|
-
` ? i.push(
|
|
1605
|
+
` ? i.push(Tt()) : l === " " ? i.push(_r()) : l !== "" && i.push(Y(l));
|
|
1609
1606
|
}
|
|
1610
1607
|
return { node: i };
|
|
1611
1608
|
}
|
|
1612
1609
|
if (t = t.replace(/\r/g, "").replace(/[ \t\n]+/g, " "), t === "") return { node: null };
|
|
1613
1610
|
if (t[0] === " ") {
|
|
1614
1611
|
let r = e, i = !0;
|
|
1615
|
-
for (; r !== null && (r =
|
|
1612
|
+
for (; r !== null && (r = qr(r, !1)) !== null; ) {
|
|
1616
1613
|
const s = r.textContent || "";
|
|
1617
1614
|
if (s.length > 0) {
|
|
1618
1615
|
/[ \t\n]$/.test(s) && (t = t.slice(1)), i = !1;
|
|
@@ -1623,7 +1620,7 @@ function Po(n) {
|
|
|
1623
1620
|
}
|
|
1624
1621
|
if (t[t.length - 1] === " ") {
|
|
1625
1622
|
let r = e, i = !0;
|
|
1626
|
-
for (; r !== null && (r =
|
|
1623
|
+
for (; r !== null && (r = qr(r, !0)) !== null; )
|
|
1627
1624
|
if ((r.textContent || "").replace(/^( |\t|\r?\n)+/, "").length > 0) {
|
|
1628
1625
|
i = !1;
|
|
1629
1626
|
break;
|
|
@@ -1632,7 +1629,7 @@ function Po(n) {
|
|
|
1632
1629
|
}
|
|
1633
1630
|
return t === "" ? { node: null } : { node: Y(t) };
|
|
1634
1631
|
}
|
|
1635
|
-
function
|
|
1632
|
+
function qr(n, e) {
|
|
1636
1633
|
let t = n;
|
|
1637
1634
|
for (; ; ) {
|
|
1638
1635
|
let r;
|
|
@@ -1643,35 +1640,35 @@ function Gr(n, e) {
|
|
|
1643
1640
|
}
|
|
1644
1641
|
if (t = r, ee(t)) {
|
|
1645
1642
|
const s = t.style.display;
|
|
1646
|
-
if (s === "" && !
|
|
1643
|
+
if (s === "" && !nl(t) || s !== "" && !s.startsWith("inline")) return null;
|
|
1647
1644
|
}
|
|
1648
1645
|
let i = t;
|
|
1649
1646
|
for (; (i = e ? t.firstChild : t.lastChild) !== null; ) t = i;
|
|
1650
|
-
if (
|
|
1647
|
+
if (Te(t)) return t;
|
|
1651
1648
|
if (t.nodeName === "BR") return null;
|
|
1652
1649
|
}
|
|
1653
1650
|
}
|
|
1654
|
-
const
|
|
1655
|
-
function
|
|
1656
|
-
const e =
|
|
1657
|
-
return e === void 0 ? { node: null } : { forChild:
|
|
1651
|
+
const Oo = { code: "code", em: "italic", i: "italic", mark: "highlight", s: "strikethrough", strong: "bold", sub: "subscript", sup: "superscript", u: "underline" };
|
|
1652
|
+
function me(n) {
|
|
1653
|
+
const e = Oo[n.nodeName.toLowerCase()];
|
|
1654
|
+
return e === void 0 ? { node: null } : { forChild: gr(n.style, e), node: null };
|
|
1658
1655
|
}
|
|
1659
1656
|
function Y(n = "") {
|
|
1660
|
-
return
|
|
1657
|
+
return bn(new ct(n));
|
|
1661
1658
|
}
|
|
1662
1659
|
function M(n) {
|
|
1663
|
-
return n instanceof
|
|
1660
|
+
return n instanceof ct;
|
|
1664
1661
|
}
|
|
1665
|
-
function
|
|
1662
|
+
function gr(n, e) {
|
|
1666
1663
|
const t = n.fontWeight, r = n.textDecoration.split(" "), i = t === "700" || t === "bold", s = r.includes("line-through"), o = n.fontStyle === "italic", l = r.includes("underline"), a = n.verticalAlign;
|
|
1667
1664
|
return (c) => (M(c) && (i && !c.hasFormat("bold") && c.toggleFormat("bold"), s && !c.hasFormat("strikethrough") && c.toggleFormat("strikethrough"), o && !c.hasFormat("italic") && c.toggleFormat("italic"), l && !c.hasFormat("underline") && c.toggleFormat("underline"), a !== "sub" || c.hasFormat("subscript") || c.toggleFormat("subscript"), a !== "super" || c.hasFormat("superscript") || c.toggleFormat("superscript"), e && !c.hasFormat(e) && c.toggleFormat(e)), c);
|
|
1668
1665
|
}
|
|
1669
|
-
class
|
|
1666
|
+
class Et extends ct {
|
|
1670
1667
|
static getType() {
|
|
1671
1668
|
return "tab";
|
|
1672
1669
|
}
|
|
1673
1670
|
static clone(e) {
|
|
1674
|
-
return new
|
|
1671
|
+
return new Et(e.__key);
|
|
1675
1672
|
}
|
|
1676
1673
|
constructor(e) {
|
|
1677
1674
|
super(" ", e), this.__detail = 2;
|
|
@@ -1680,11 +1677,11 @@ class Mt extends ut {
|
|
|
1680
1677
|
return null;
|
|
1681
1678
|
}
|
|
1682
1679
|
createDOM(e) {
|
|
1683
|
-
const t = super.createDOM(e), r =
|
|
1680
|
+
const t = super.createDOM(e), r = nt(e.theme, "tab");
|
|
1684
1681
|
return r !== void 0 && t.classList.add(...r), t;
|
|
1685
1682
|
}
|
|
1686
1683
|
static importJSON(e) {
|
|
1687
|
-
return
|
|
1684
|
+
return _r().updateFromJSON(e);
|
|
1688
1685
|
}
|
|
1689
1686
|
setTextContent(e) {
|
|
1690
1687
|
return e !== " " && e !== "" && T(126), super.setTextContent(" ");
|
|
@@ -1705,13 +1702,13 @@ class Mt extends ut {
|
|
|
1705
1702
|
return !1;
|
|
1706
1703
|
}
|
|
1707
1704
|
}
|
|
1708
|
-
function
|
|
1709
|
-
return
|
|
1705
|
+
function _r() {
|
|
1706
|
+
return bn(new Et());
|
|
1710
1707
|
}
|
|
1711
|
-
function
|
|
1712
|
-
return n instanceof
|
|
1708
|
+
function rs(n) {
|
|
1709
|
+
return n instanceof Et;
|
|
1713
1710
|
}
|
|
1714
|
-
class
|
|
1711
|
+
class Do {
|
|
1715
1712
|
constructor(e, t, r) {
|
|
1716
1713
|
this._selection = null, this.key = e, this.offset = t, this.type = r;
|
|
1717
1714
|
}
|
|
@@ -1719,7 +1716,7 @@ class Lo {
|
|
|
1719
1716
|
return this.key === e.key && this.offset === e.offset && this.type === e.type;
|
|
1720
1717
|
}
|
|
1721
1718
|
isBefore(e) {
|
|
1722
|
-
return this.key === e.key ? this.offset < e.offset :
|
|
1719
|
+
return this.key === e.key ? this.offset < e.offset : Es(fe(He(this, "next")), fe(He(e, "next"))) < 0;
|
|
1723
1720
|
}
|
|
1724
1721
|
getNode() {
|
|
1725
1722
|
const e = $(this.key);
|
|
@@ -1727,13 +1724,13 @@ class Lo {
|
|
|
1727
1724
|
}
|
|
1728
1725
|
set(e, t, r, i) {
|
|
1729
1726
|
const s = this._selection, o = this.key;
|
|
1730
|
-
i && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r,
|
|
1727
|
+
i && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r, Mt() || (Ee() === o && H(e), s !== null && (s.setCachedNodes(null), s.dirty = !0)));
|
|
1731
1728
|
}
|
|
1732
1729
|
}
|
|
1733
|
-
function
|
|
1734
|
-
return new
|
|
1730
|
+
function he(n, e, t) {
|
|
1731
|
+
return new Do(n, e, t);
|
|
1735
1732
|
}
|
|
1736
|
-
function
|
|
1733
|
+
function Ln(n, e) {
|
|
1737
1734
|
let t = e.__key, r = n.offset, i = "element";
|
|
1738
1735
|
if (M(e)) {
|
|
1739
1736
|
i = "text";
|
|
@@ -1749,13 +1746,13 @@ function In(n, e) {
|
|
|
1749
1746
|
}
|
|
1750
1747
|
n.set(t, r, i);
|
|
1751
1748
|
}
|
|
1752
|
-
function
|
|
1749
|
+
function Gr(n, e) {
|
|
1753
1750
|
if (v(e)) {
|
|
1754
1751
|
const t = e.getLastDescendant();
|
|
1755
|
-
v(t) || M(t) ?
|
|
1756
|
-
} else
|
|
1752
|
+
v(t) || M(t) ? Ln(n, t) : Ln(n, e);
|
|
1753
|
+
} else Ln(n, e);
|
|
1757
1754
|
}
|
|
1758
|
-
class
|
|
1755
|
+
class pn {
|
|
1759
1756
|
constructor(e) {
|
|
1760
1757
|
this._cachedNodes = null, this._nodes = e, this.dirty = !1;
|
|
1761
1758
|
}
|
|
@@ -1766,7 +1763,7 @@ class yn {
|
|
|
1766
1763
|
this._cachedNodes = e;
|
|
1767
1764
|
}
|
|
1768
1765
|
is(e) {
|
|
1769
|
-
if (!
|
|
1766
|
+
if (!pr(e)) return !1;
|
|
1770
1767
|
const t = this._nodes, r = e._nodes;
|
|
1771
1768
|
return t.size === r.size && Array.from(t).every((i) => r.has(i));
|
|
1772
1769
|
}
|
|
@@ -1792,7 +1789,7 @@ class yn {
|
|
|
1792
1789
|
return this._nodes.has(e);
|
|
1793
1790
|
}
|
|
1794
1791
|
clone() {
|
|
1795
|
-
return new
|
|
1792
|
+
return new pn(new Set(this._nodes));
|
|
1796
1793
|
}
|
|
1797
1794
|
extract() {
|
|
1798
1795
|
return this.getNodes();
|
|
@@ -1820,7 +1817,7 @@ class yn {
|
|
|
1820
1817
|
const s = $(i);
|
|
1821
1818
|
s !== null && r.push(s);
|
|
1822
1819
|
}
|
|
1823
|
-
return
|
|
1820
|
+
return Mt() || (this._cachedNodes = r), r;
|
|
1824
1821
|
}
|
|
1825
1822
|
getTextContent() {
|
|
1826
1823
|
const e = this.getNodes();
|
|
@@ -1830,17 +1827,17 @@ class yn {
|
|
|
1830
1827
|
}
|
|
1831
1828
|
deleteNodes() {
|
|
1832
1829
|
const e = this.getNodes();
|
|
1833
|
-
if ((L() ||
|
|
1830
|
+
if ((L() || ut()) === this && e[0]) {
|
|
1834
1831
|
const t = q(e[0], "next");
|
|
1835
|
-
|
|
1832
|
+
_l(Ye(t, t));
|
|
1836
1833
|
}
|
|
1837
1834
|
for (const t of e) t.remove();
|
|
1838
1835
|
}
|
|
1839
1836
|
}
|
|
1840
1837
|
function O(n) {
|
|
1841
|
-
return n instanceof
|
|
1838
|
+
return n instanceof Ge;
|
|
1842
1839
|
}
|
|
1843
|
-
class
|
|
1840
|
+
class Ge {
|
|
1844
1841
|
constructor(e, t, r, i) {
|
|
1845
1842
|
this.anchor = e, this.focus = t, e._selection = this, t._selection = this, this._cachedNodes = null, this.format = r, this.style = i, this.dirty = !1;
|
|
1846
1843
|
}
|
|
@@ -1863,26 +1860,26 @@ class Xe {
|
|
|
1863
1860
|
const i = [], [s, o] = r.getTextSlices();
|
|
1864
1861
|
s && i.push(s.caret.origin);
|
|
1865
1862
|
const l = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
1866
|
-
for (const c of r) if (
|
|
1863
|
+
for (const c of r) if (de(c)) {
|
|
1867
1864
|
const { origin: u } = c;
|
|
1868
1865
|
i.length === 0 ? l.add(u) : (a.add(u), i.push(u));
|
|
1869
1866
|
} else {
|
|
1870
1867
|
const { origin: u } = c;
|
|
1871
1868
|
v(u) && a.has(u) || i.push(u);
|
|
1872
1869
|
}
|
|
1873
|
-
if (o && i.push(o.caret.origin),
|
|
1870
|
+
if (o && i.push(o.caret.origin), lt(r.focus) && v(r.focus.origin) && r.focus.getNodeAtCaret() === null) for (let c = De(r.focus.origin, "previous"); de(c) && l.has(c.origin) && !c.origin.isEmpty() && c.origin.is(i[i.length - 1]); c = Mr(c)) l.delete(c.origin), i.pop();
|
|
1874
1871
|
for (; i.length > 1; ) {
|
|
1875
1872
|
const c = i[i.length - 1];
|
|
1876
1873
|
if (!v(c) || a.has(c) || c.isEmpty() || l.has(c)) break;
|
|
1877
1874
|
i.pop();
|
|
1878
1875
|
}
|
|
1879
1876
|
if (i.length === 0 && r.isCollapsed()) {
|
|
1880
|
-
const c =
|
|
1877
|
+
const c = fe(r.anchor), u = fe(r.anchor.getFlipped()), h = (g) => Ae(g) ? g.origin : g.getNodeAtCaret(), f = h(c) || h(u) || (r.anchor.getNodeAtCaret() ? c.origin : u.origin);
|
|
1881
1878
|
i.push(f);
|
|
1882
1879
|
}
|
|
1883
1880
|
return i;
|
|
1884
|
-
}(
|
|
1885
|
-
return
|
|
1881
|
+
}(As(bi(this), "next"));
|
|
1882
|
+
return Mt() || (this._cachedNodes = t), t;
|
|
1886
1883
|
}
|
|
1887
1884
|
setTextNodeRange(e, t, r, i) {
|
|
1888
1885
|
this.anchor.set(e.__key, t, "text"), this.focus.set(r.__key, i, "text");
|
|
@@ -1890,7 +1887,7 @@ class Xe {
|
|
|
1890
1887
|
getTextContent() {
|
|
1891
1888
|
const e = this.getNodes();
|
|
1892
1889
|
if (e.length === 0) return "";
|
|
1893
|
-
const t = e[0], r = e[e.length - 1], i = this.anchor, s = this.focus, o = i.isBefore(s), [l, a] =
|
|
1890
|
+
const t = e[0], r = e[e.length - 1], i = this.anchor, s = this.focus, o = i.isBefore(s), [l, a] = Qr(this);
|
|
1894
1891
|
let c = "", u = !0;
|
|
1895
1892
|
for (let h = 0; h < e.length; h++) {
|
|
1896
1893
|
const f = e[h];
|
|
@@ -1899,28 +1896,28 @@ class Xe {
|
|
|
1899
1896
|
else if (u = !1, M(f)) {
|
|
1900
1897
|
let g = f.getTextContent();
|
|
1901
1898
|
f === t ? f === r ? i.type === "element" && s.type === "element" && s.offset !== i.offset || (g = l < a ? g.slice(l, a) : g.slice(a, l)) : g = o ? g.slice(l) : g.slice(a) : f === r && (g = o ? g.slice(0, a) : g.slice(0, l)), c += g;
|
|
1902
|
-
} else !z(f) && !
|
|
1899
|
+
} else !z(f) && !tt(f) || f === r && this.isCollapsed() || (c += f.getTextContent());
|
|
1903
1900
|
}
|
|
1904
1901
|
return c;
|
|
1905
1902
|
}
|
|
1906
1903
|
applyDOMRange(e) {
|
|
1907
|
-
const t = R(), r = t.getEditorState()._selection, i =
|
|
1904
|
+
const t = R(), r = t.getEditorState()._selection, i = ss(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, r);
|
|
1908
1905
|
if (i === null) return;
|
|
1909
1906
|
const [s, o] = i;
|
|
1910
|
-
this.anchor.set(s.key, s.offset, s.type, !0), this.focus.set(o.key, o.offset, o.type, !0),
|
|
1907
|
+
this.anchor.set(s.key, s.offset, s.type, !0), this.focus.set(o.key, o.offset, o.type, !0), jn(this);
|
|
1911
1908
|
}
|
|
1912
1909
|
clone() {
|
|
1913
1910
|
const e = this.anchor, t = this.focus;
|
|
1914
|
-
return new
|
|
1911
|
+
return new Ge(he(e.key, e.offset, e.type), he(t.key, t.offset, t.type), this.format, this.style);
|
|
1915
1912
|
}
|
|
1916
1913
|
toggleFormat(e) {
|
|
1917
|
-
this.format =
|
|
1914
|
+
this.format = fn(this.format, e, null), this.dirty = !0;
|
|
1918
1915
|
}
|
|
1919
1916
|
setStyle(e) {
|
|
1920
1917
|
this.style = e, this.dirty = !0;
|
|
1921
1918
|
}
|
|
1922
1919
|
hasFormat(e) {
|
|
1923
|
-
const t =
|
|
1920
|
+
const t = Je[e];
|
|
1924
1921
|
return !!(this.format & t);
|
|
1925
1922
|
}
|
|
1926
1923
|
insertRawText(e) {
|
|
@@ -1929,7 +1926,7 @@ class Xe {
|
|
|
1929
1926
|
const o = t[s];
|
|
1930
1927
|
o === `
|
|
1931
1928
|
` || o === `\r
|
|
1932
|
-
` ? r.push(
|
|
1929
|
+
` ? r.push(Tt()) : o === " " ? r.push(_r()) : r.push(Y(o));
|
|
1933
1930
|
}
|
|
1934
1931
|
this.insertNodes(r);
|
|
1935
1932
|
}
|
|
@@ -1937,9 +1934,9 @@ class Xe {
|
|
|
1937
1934
|
const t = this.anchor, r = this.focus, i = this.format, s = this.style;
|
|
1938
1935
|
let o = t, l = r;
|
|
1939
1936
|
!this.isCollapsed() && r.isBefore(t) && (o = r, l = t), o.type === "element" && function(p, x, y, m) {
|
|
1940
|
-
const b = p.getNode(), N = b.getChildAtIndex(p.offset), C = Y(), w = ne(b) ?
|
|
1937
|
+
const b = p.getNode(), N = b.getChildAtIndex(p.offset), C = Y(), w = ne(b) ? Me().append(C) : C;
|
|
1941
1938
|
C.setFormat(y), C.setStyle(m), N === null ? b.append(w) : N.insertBefore(w), p.is(x) && x.set(C.__key, 0, "text"), p.set(C.__key, 0, "text");
|
|
1942
|
-
}(o, l, i, s), l.type === "element" &&
|
|
1939
|
+
}(o, l, i, s), l.type === "element" && Nt(l, fe(He(l, "next")));
|
|
1943
1940
|
const a = o.offset;
|
|
1944
1941
|
let c = l.offset;
|
|
1945
1942
|
const u = this.getNodes(), h = u.length;
|
|
@@ -1947,27 +1944,27 @@ class Xe {
|
|
|
1947
1944
|
M(f) || T(26);
|
|
1948
1945
|
const g = f.getTextContent().length, d = f.getParentOrThrow();
|
|
1949
1946
|
let _ = u[h - 1];
|
|
1950
|
-
if (h === 1 && l.type === "element" && (c = g, l.set(o.key, c, "text")), this.isCollapsed() && a === g && (
|
|
1947
|
+
if (h === 1 && l.type === "element" && (c = g, l.set(o.key, c, "text")), this.isCollapsed() && a === g && (Ne(f) || !f.canInsertTextAfter() || !d.canInsertTextAfter() && f.getNextSibling() === null)) {
|
|
1951
1948
|
let p = f.getNextSibling();
|
|
1952
|
-
if (M(p) && p.canInsertTextBefore() && !
|
|
1953
|
-
} else if (this.isCollapsed() && a === 0 && (
|
|
1949
|
+
if (M(p) && p.canInsertTextBefore() && !Ne(p) || (p = Y(), p.setFormat(i), p.setStyle(s), d.canInsertTextAfter() ? f.insertAfter(p) : d.insertAfter(p)), p.select(0, 0), f = p, e !== "") return void this.insertText(e);
|
|
1950
|
+
} else if (this.isCollapsed() && a === 0 && (Ne(f) || !f.canInsertTextBefore() || !d.canInsertTextBefore() && f.getPreviousSibling() === null)) {
|
|
1954
1951
|
let p = f.getPreviousSibling();
|
|
1955
|
-
if (M(p) && !
|
|
1952
|
+
if (M(p) && !Ne(p) || (p = Y(), p.setFormat(i), d.canInsertTextBefore() ? f.insertBefore(p) : d.insertBefore(p)), p.select(), f = p, e !== "") return void this.insertText(e);
|
|
1956
1953
|
} else if (f.isSegmented() && a !== g) {
|
|
1957
1954
|
const p = Y(f.getTextContent());
|
|
1958
1955
|
p.setFormat(i), f.replace(p), f = p;
|
|
1959
1956
|
} else if (!this.isCollapsed() && e !== "") {
|
|
1960
1957
|
const p = _.getParent();
|
|
1961
|
-
if (!d.canInsertTextBefore() || !d.canInsertTextAfter() || v(p) && (!p.canInsertTextBefore() || !p.canInsertTextAfter())) return this.insertText(""),
|
|
1958
|
+
if (!d.canInsertTextBefore() || !d.canInsertTextAfter() || v(p) && (!p.canInsertTextBefore() || !p.canInsertTextAfter())) return this.insertText(""), is(this.anchor, this.focus, null), void this.insertText(e);
|
|
1962
1959
|
}
|
|
1963
1960
|
if (h === 1) {
|
|
1964
|
-
if (
|
|
1961
|
+
if (ze(f)) {
|
|
1965
1962
|
const m = Y(e);
|
|
1966
1963
|
return m.select(), void f.replace(m);
|
|
1967
1964
|
}
|
|
1968
1965
|
const p = f.getFormat(), x = f.getStyle();
|
|
1969
1966
|
if (a !== c || p === i && x === s) {
|
|
1970
|
-
if (
|
|
1967
|
+
if (rs(f)) {
|
|
1971
1968
|
const m = Y(e);
|
|
1972
1969
|
return m.setFormat(i), m.setStyle(s), m.select(), void f.replace(m);
|
|
1973
1970
|
}
|
|
@@ -1991,7 +1988,7 @@ class Xe {
|
|
|
1991
1988
|
if (!x.is(y) && y.isInline()) do
|
|
1992
1989
|
m = y, y = y.getParentOrThrow();
|
|
1993
1990
|
while (y.isInline());
|
|
1994
|
-
if (l.type === "text" && (c !== 0 || _.getTextContent() === "") || l.type === "element" && _.getIndexWithinParent() < c) if (M(_) && !
|
|
1991
|
+
if (l.type === "text" && (c !== 0 || _.getTextContent() === "") || l.type === "element" && _.getIndexWithinParent() < c) if (M(_) && !ze(_) && c !== _.getTextContentSize()) {
|
|
1995
1992
|
if (_.isSegmented()) {
|
|
1996
1993
|
const k = Y(_.getTextContent());
|
|
1997
1994
|
_.replace(k), _ = k;
|
|
@@ -2015,7 +2012,7 @@ class Xe {
|
|
|
2015
2012
|
(F === 0 || A[F - 1].is(S)) && (p.delete(k.__key), S = k), k = k.getParent();
|
|
2016
2013
|
}
|
|
2017
2014
|
}
|
|
2018
|
-
if (
|
|
2015
|
+
if (ze(f)) if (a === g) f.select();
|
|
2019
2016
|
else {
|
|
2020
2017
|
const k = Y(e);
|
|
2021
2018
|
k.select(), f.replace(k);
|
|
@@ -2029,7 +2026,7 @@ class Xe {
|
|
|
2029
2026
|
}
|
|
2030
2027
|
removeText() {
|
|
2031
2028
|
const e = L() === this;
|
|
2032
|
-
|
|
2029
|
+
qt(this, pl(bi(this))), e && L() !== this && ie(this);
|
|
2033
2030
|
}
|
|
2034
2031
|
formatText(e, t = null) {
|
|
2035
2032
|
if (this.isCollapsed()) return this.toggleFormat(e), void H(null);
|
|
@@ -2054,16 +2051,16 @@ class Xe {
|
|
|
2054
2051
|
const y = h.type === "text" ? h.offset : x.getTextContentSize();
|
|
2055
2052
|
if (g.is(x)) {
|
|
2056
2053
|
if (d === y) return;
|
|
2057
|
-
if (
|
|
2054
|
+
if (Ne(g) || d === 0 && y === g.getTextContentSize()) g.setFormat(_);
|
|
2058
2055
|
else {
|
|
2059
2056
|
const b = g.splitText(d, y), N = d === 0 ? b[0] : b[1];
|
|
2060
2057
|
N.setFormat(_), u.type === "text" && u.set(N.__key, 0, "text"), h.type === "text" && h.set(N.__key, y - d, "text");
|
|
2061
2058
|
}
|
|
2062
2059
|
return void (this.format = _);
|
|
2063
2060
|
}
|
|
2064
|
-
d === 0 ||
|
|
2061
|
+
d === 0 || Ne(g) || ([, g] = g.splitText(d), d = 0), g.setFormat(_);
|
|
2065
2062
|
const m = x.getFormatFlags(e, _);
|
|
2066
|
-
y > 0 && (y === x.getTextContentSize() ||
|
|
2063
|
+
y > 0 && (y === x.getTextContentSize() || Ne(x) || ([x] = x.splitText(y)), x.setFormat(m));
|
|
2067
2064
|
for (let b = f + 1; b < p; b++) {
|
|
2068
2065
|
const N = i[b], C = N.getFormatFlags(e, m);
|
|
2069
2066
|
N.setFormat(C);
|
|
@@ -2077,25 +2074,25 @@ class Xe {
|
|
|
2077
2074
|
const d = L();
|
|
2078
2075
|
return O(d) || T(134), d.insertNodes(e);
|
|
2079
2076
|
}
|
|
2080
|
-
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), r =
|
|
2077
|
+
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), r = Wn(t, we), i = e[e.length - 1];
|
|
2081
2078
|
if (v(r) && "__language" in r) {
|
|
2082
2079
|
if ("__language" in e[0]) this.insertText(e[0].getTextContent());
|
|
2083
2080
|
else {
|
|
2084
|
-
const d =
|
|
2081
|
+
const d = In(this);
|
|
2085
2082
|
r.splice(d, 0, e), i.selectEnd();
|
|
2086
2083
|
}
|
|
2087
2084
|
return;
|
|
2088
2085
|
}
|
|
2089
2086
|
if (!e.some((d) => (v(d) || z(d)) && !d.isInline())) {
|
|
2090
2087
|
v(r) || T(211, t.constructor.name, t.getType());
|
|
2091
|
-
const d =
|
|
2088
|
+
const d = In(this);
|
|
2092
2089
|
return r.splice(d, 0, e), void i.selectEnd();
|
|
2093
2090
|
}
|
|
2094
2091
|
const s = function(d) {
|
|
2095
|
-
const _ =
|
|
2092
|
+
const _ = Me();
|
|
2096
2093
|
let p = null;
|
|
2097
2094
|
for (let x = 0; x < d.length; x++) {
|
|
2098
|
-
const y = d[x], m =
|
|
2095
|
+
const y = d[x], m = tt(y);
|
|
2099
2096
|
if (m || z(y) && y.isInline() || v(y) && y.isInline() || M(y) || y.isParentRequired()) {
|
|
2100
2097
|
if (p === null && (p = y.createParentElementNode(), _.append(p), m)) continue;
|
|
2101
2098
|
p !== null && p.append(y);
|
|
@@ -2105,7 +2102,7 @@ class Xe {
|
|
|
2105
2102
|
}(e), o = s.getLastDescendant(), l = s.getChildren(), a = !v(r) || !r.isEmpty() ? this.insertParagraph() : null, c = l[l.length - 1];
|
|
2106
2103
|
let u = l[0];
|
|
2107
2104
|
var h;
|
|
2108
|
-
v(h = u) &&
|
|
2105
|
+
v(h = u) && we(h) && !h.isEmpty() && v(r) && (!r.isEmpty() || r.canMergeWhenEmpty()) && (v(r) || T(211, t.constructor.name, t.getType()), r.append(...u.getChildren()), u = l[1]), u && (r === null && T(212, t.constructor.name, t.getType()), function(d, _, p) {
|
|
2109
2106
|
const x = _.getParentOrThrow().getLastChild();
|
|
2110
2107
|
let y = _;
|
|
2111
2108
|
const m = [_];
|
|
@@ -2113,23 +2110,23 @@ class Xe {
|
|
|
2113
2110
|
let b = d;
|
|
2114
2111
|
for (const N of m) b = b.insertAfter(N);
|
|
2115
2112
|
}(r, u));
|
|
2116
|
-
const f =
|
|
2117
|
-
a && v(f) && (a.canMergeWhenEmpty() ||
|
|
2113
|
+
const f = Wn(o, we);
|
|
2114
|
+
a && v(f) && (a.canMergeWhenEmpty() || we(c)) && (f.append(...a.getChildren()), a.remove()), v(r) && r.isEmpty() && r.remove(), o.selectEnd();
|
|
2118
2115
|
const g = v(r) ? r.getLastChild() : null;
|
|
2119
|
-
|
|
2116
|
+
tt(g) && f !== r && g.remove();
|
|
2120
2117
|
}
|
|
2121
2118
|
insertParagraph() {
|
|
2122
2119
|
if (this.anchor.key === "root") {
|
|
2123
|
-
const o =
|
|
2120
|
+
const o = Me();
|
|
2124
2121
|
return re().splice(this.anchor.offset, 0, [o]), o.select(), o;
|
|
2125
2122
|
}
|
|
2126
|
-
const e =
|
|
2123
|
+
const e = In(this), t = Wn(this.anchor.getNode(), we);
|
|
2127
2124
|
v(t) || T(213);
|
|
2128
2125
|
const r = t.getChildAtIndex(e), i = r ? [r, ...r.getNextSiblings()] : [], s = t.insertNewAfter(this, !1);
|
|
2129
2126
|
return s ? (s.append(...i), s.selectStart(), s) : null;
|
|
2130
2127
|
}
|
|
2131
2128
|
insertLineBreak(e) {
|
|
2132
|
-
const t =
|
|
2129
|
+
const t = Tt();
|
|
2133
2130
|
if (this.insertNodes([t]), e) {
|
|
2134
2131
|
const r = t.getParentOrThrow(), i = t.getIndexWithinParent();
|
|
2135
2132
|
r.select(i, i);
|
|
@@ -2138,7 +2135,7 @@ class Xe {
|
|
|
2138
2135
|
extract() {
|
|
2139
2136
|
const e = this.getNodes(), t = e.length, r = t - 1, i = this.anchor, s = this.focus;
|
|
2140
2137
|
let o = e[0], l = e[r];
|
|
2141
|
-
const [a, c] =
|
|
2138
|
+
const [a, c] = Qr(this);
|
|
2142
2139
|
if (t === 0) return [];
|
|
2143
2140
|
if (t === 1) {
|
|
2144
2141
|
if (M(o) && !this.isCollapsed()) {
|
|
@@ -2159,24 +2156,24 @@ class Xe {
|
|
|
2159
2156
|
return e;
|
|
2160
2157
|
}
|
|
2161
2158
|
modify(e, t, r) {
|
|
2162
|
-
if (
|
|
2163
|
-
const i = e === "move", s = R(), o =
|
|
2159
|
+
if (si(this, e, t, r)) return;
|
|
2160
|
+
const i = e === "move", s = R(), o = ke(se(s));
|
|
2164
2161
|
if (!o) return;
|
|
2165
2162
|
const l = s._blockCursorElement, a = s._rootElement, c = this.focus.getNode();
|
|
2166
|
-
if (a === null || l === null || !v(c) || c.isInline() || c.canBeEmpty() ||
|
|
2167
|
-
let u =
|
|
2168
|
-
this.anchor.type === "text" && (u =
|
|
2163
|
+
if (a === null || l === null || !v(c) || c.isInline() || c.canBeEmpty() || ir(l, s, a), this.dirty) {
|
|
2164
|
+
let u = ot(s, this.anchor.key), h = ot(s, this.focus.key);
|
|
2165
|
+
this.anchor.type === "text" && (u = st(u)), this.focus.type === "text" && (h = st(h)), u && h && as(o, u, this.anchor.offset, h, this.focus.offset);
|
|
2169
2166
|
}
|
|
2170
2167
|
if (function(u, h, f, g) {
|
|
2171
2168
|
u.modify(h, f, g);
|
|
2172
2169
|
}(o, e, t ? "backward" : "forward", r), o.rangeCount > 0) {
|
|
2173
|
-
const u = o.getRangeAt(0), h = this.anchor.getNode(), f = ne(h) ? h :
|
|
2170
|
+
const u = o.getRangeAt(0), h = this.anchor.getNode(), f = ne(h) ? h : Xo(h);
|
|
2174
2171
|
if (this.applyDOMRange(u), this.dirty = !0, !i) {
|
|
2175
2172
|
const g = this.getNodes(), d = [];
|
|
2176
2173
|
let _ = !1;
|
|
2177
2174
|
for (let p = 0; p < g.length; p++) {
|
|
2178
2175
|
const x = g[p];
|
|
2179
|
-
|
|
2176
|
+
rr(x, f) ? d.push(x) : _ = !0;
|
|
2180
2177
|
}
|
|
2181
2178
|
if (_ && d.length > 0) if (t) {
|
|
2182
2179
|
const p = d[0];
|
|
@@ -2191,7 +2188,7 @@ class Xe {
|
|
|
2191
2188
|
}(this);
|
|
2192
2189
|
}
|
|
2193
2190
|
}
|
|
2194
|
-
r === "lineboundary" &&
|
|
2191
|
+
r === "lineboundary" && si(this, e, t, r, "decorators");
|
|
2195
2192
|
}
|
|
2196
2193
|
forwardDeletion(e, t, r) {
|
|
2197
2194
|
if (!r && (e.type === "element" && v(t) && e.offset === t.getChildrenSize() || e.type === "text" && e.offset === t.getTextContentSize())) {
|
|
@@ -2206,16 +2203,16 @@ class Xe {
|
|
|
2206
2203
|
const r = this.anchor;
|
|
2207
2204
|
let i = r.getNode();
|
|
2208
2205
|
if (this.forwardDeletion(r, i, e)) return;
|
|
2209
|
-
const s =
|
|
2206
|
+
const s = Ns(He(r, e ? "previous" : "next"));
|
|
2210
2207
|
if (s.getTextSlices().every((l) => l === null || l.distance === 0)) {
|
|
2211
2208
|
let l = { type: "initial" };
|
|
2212
|
-
for (const a of s.iterNodeCarets("shadowRoot")) if (
|
|
2209
|
+
for (const a of s.iterNodeCarets("shadowRoot")) if (de(a)) {
|
|
2213
2210
|
if (!a.origin.isInline()) {
|
|
2214
2211
|
if (a.origin.isShadowRoot()) {
|
|
2215
2212
|
if (l.type === "merge-block") break;
|
|
2216
2213
|
if (v(s.anchor.origin) && s.anchor.origin.isEmpty()) {
|
|
2217
|
-
const c =
|
|
2218
|
-
|
|
2214
|
+
const c = fe(a);
|
|
2215
|
+
qt(this, Ye(c, c)), s.anchor.origin.remove();
|
|
2219
2216
|
}
|
|
2220
2217
|
return;
|
|
2221
2218
|
}
|
|
@@ -2223,7 +2220,7 @@ class Xe {
|
|
|
2223
2220
|
}
|
|
2224
2221
|
} else {
|
|
2225
2222
|
if (l.type === "merge-block") break;
|
|
2226
|
-
if (
|
|
2223
|
+
if (lt(a)) {
|
|
2227
2224
|
if (v(a.origin)) {
|
|
2228
2225
|
if (a.origin.isInline()) {
|
|
2229
2226
|
if (!a.origin.isParentOf(s.anchor.origin)) break;
|
|
@@ -2233,7 +2230,7 @@ class Xe {
|
|
|
2233
2230
|
if (z(a.origin)) {
|
|
2234
2231
|
if (!a.origin.isIsolated()) if (l.type === "merge-next-block" && (a.origin.isKeyboardSelectable() || !a.origin.isInline()) && v(s.anchor.origin) && s.anchor.origin.isEmpty()) {
|
|
2235
2232
|
s.anchor.origin.remove();
|
|
2236
|
-
const c =
|
|
2233
|
+
const c = ls();
|
|
2237
2234
|
c.add(a.origin.getKey()), ie(c);
|
|
2238
2235
|
} else a.origin.remove();
|
|
2239
2236
|
return;
|
|
@@ -2243,27 +2240,27 @@ class Xe {
|
|
|
2243
2240
|
}
|
|
2244
2241
|
if (l.type === "merge-block") {
|
|
2245
2242
|
const { caret: a, block: c } = l;
|
|
2246
|
-
return
|
|
2243
|
+
return qt(this, Ye(!a.origin.isEmpty() && c.isEmpty() ? Ft(q(c, a.direction)) : s.anchor, a)), this.removeText();
|
|
2247
2244
|
}
|
|
2248
2245
|
}
|
|
2249
2246
|
const o = this.focus;
|
|
2250
2247
|
if (this.modify("extend", e, "character"), this.isCollapsed()) {
|
|
2251
|
-
if (e && r.offset === 0 &&
|
|
2248
|
+
if (e && r.offset === 0 && Zr(this, r.getNode())) return;
|
|
2252
2249
|
} else {
|
|
2253
2250
|
const l = o.type === "text" ? o.getNode() : null;
|
|
2254
2251
|
if (i = r.type === "text" ? r.getNode() : null, l !== null && l.isSegmented()) {
|
|
2255
2252
|
const a = o.offset, c = l.getTextContentSize();
|
|
2256
|
-
if (l.is(i) || e && a !== c || !e && a !== 0) return void
|
|
2253
|
+
if (l.is(i) || e && a !== c || !e && a !== 0) return void ei(l, e, a);
|
|
2257
2254
|
} else if (i !== null && i.isSegmented()) {
|
|
2258
2255
|
const a = r.offset, c = i.getTextContentSize();
|
|
2259
|
-
if (i.is(l) || e && a !== 0 || !e && a !== c) return void
|
|
2256
|
+
if (i.is(l) || e && a !== 0 || !e && a !== c) return void ei(i, e, a);
|
|
2260
2257
|
}
|
|
2261
2258
|
(function(a, c) {
|
|
2262
2259
|
const u = a.anchor, h = a.focus, f = u.getNode(), g = h.getNode();
|
|
2263
2260
|
if (f === g && u.type === "text" && h.type === "text") {
|
|
2264
2261
|
const d = u.offset, _ = h.offset, p = d < _, x = p ? d : _, y = p ? _ : d, m = y - 1;
|
|
2265
2262
|
x !== m && function(b) {
|
|
2266
|
-
return !(
|
|
2263
|
+
return !(Ss(b) || Po(b));
|
|
2267
2264
|
}(f.getTextContent().slice(x, y)) && (c ? h.set(h.key, m, h.type) : u.set(u.key, m, u.type));
|
|
2268
2265
|
}
|
|
2269
2266
|
})(this, e);
|
|
@@ -2271,7 +2268,7 @@ class Xe {
|
|
|
2271
2268
|
}
|
|
2272
2269
|
if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
|
|
2273
2270
|
const r = this.anchor.getNode();
|
|
2274
|
-
r.isEmpty() && ne(r.getParent()) && r.getPreviousSibling() === null &&
|
|
2271
|
+
r.isEmpty() && ne(r.getParent()) && r.getPreviousSibling() === null && Zr(this, r);
|
|
2275
2272
|
}
|
|
2276
2273
|
}
|
|
2277
2274
|
deleteLine(e) {
|
|
@@ -2292,32 +2289,32 @@ class Xe {
|
|
|
2292
2289
|
return [this.anchor, this.focus];
|
|
2293
2290
|
}
|
|
2294
2291
|
}
|
|
2295
|
-
function
|
|
2296
|
-
return n instanceof
|
|
2292
|
+
function pr(n) {
|
|
2293
|
+
return n instanceof pn;
|
|
2297
2294
|
}
|
|
2298
|
-
function
|
|
2295
|
+
function Xr(n) {
|
|
2299
2296
|
const e = n.offset;
|
|
2300
2297
|
if (n.type === "text") return e;
|
|
2301
2298
|
const t = n.getNode();
|
|
2302
2299
|
return e === t.getChildrenSize() ? t.getTextContent().length : 0;
|
|
2303
2300
|
}
|
|
2304
|
-
function
|
|
2301
|
+
function Qr(n) {
|
|
2305
2302
|
const e = n.getStartEndPoints();
|
|
2306
2303
|
if (e === null) return [0, 0];
|
|
2307
2304
|
const [t, r] = e;
|
|
2308
|
-
return t.type === "element" && r.type === "element" && t.key === r.key && t.offset === r.offset ? [0, 0] : [
|
|
2305
|
+
return t.type === "element" && r.type === "element" && t.key === r.key && t.offset === r.offset ? [0, 0] : [Xr(t), Xr(r)];
|
|
2309
2306
|
}
|
|
2310
|
-
function
|
|
2307
|
+
function Zr(n, e) {
|
|
2311
2308
|
for (let t = e; t; t = t.getParent()) {
|
|
2312
2309
|
if (v(t)) {
|
|
2313
2310
|
if (t.collapseAtStart(n)) return !0;
|
|
2314
|
-
if (
|
|
2311
|
+
if (Fe(t)) break;
|
|
2315
2312
|
}
|
|
2316
2313
|
if (t.getPreviousSibling()) break;
|
|
2317
2314
|
}
|
|
2318
2315
|
return !1;
|
|
2319
2316
|
}
|
|
2320
|
-
const
|
|
2317
|
+
const Po = (() => {
|
|
2321
2318
|
try {
|
|
2322
2319
|
const n = new RegExp("\\p{Emoji}", "u"), e = n.test.bind(n);
|
|
2323
2320
|
if (e("❤️") && e("#️⃣") && e("👍")) return e;
|
|
@@ -2325,7 +2322,7 @@ const Io = (() => {
|
|
|
2325
2322
|
}
|
|
2326
2323
|
return () => !1;
|
|
2327
2324
|
})();
|
|
2328
|
-
function
|
|
2325
|
+
function ei(n, e, t) {
|
|
2329
2326
|
const r = n, i = r.getTextContent().split(/(?=\s)/g), s = i.length;
|
|
2330
2327
|
let o = 0, l = 0;
|
|
2331
2328
|
for (let c = 0; c < s; c++) {
|
|
@@ -2338,7 +2335,7 @@ function ti(n, e, t) {
|
|
|
2338
2335
|
const a = i.join("").trim();
|
|
2339
2336
|
a === "" ? r.remove() : (r.setTextContent(a), r.select(l, l));
|
|
2340
2337
|
}
|
|
2341
|
-
function
|
|
2338
|
+
function ti(n, e, t, r) {
|
|
2342
2339
|
let i, s = e;
|
|
2343
2340
|
if (ee(n)) {
|
|
2344
2341
|
let o = !1;
|
|
@@ -2350,9 +2347,9 @@ function ni(n, e, t, r) {
|
|
|
2350
2347
|
const f = c.parentNode;
|
|
2351
2348
|
n === f && e > Array.prototype.indexOf.call(f.children, c) && s--;
|
|
2352
2349
|
}
|
|
2353
|
-
if (i =
|
|
2350
|
+
if (i = Ze(u), M(i)) s = _i(i, o);
|
|
2354
2351
|
else {
|
|
2355
|
-
let f =
|
|
2352
|
+
let f = Ze(n);
|
|
2356
2353
|
if (f === null) return null;
|
|
2357
2354
|
if (v(f)) {
|
|
2358
2355
|
const g = r.getElementByKey(f.getKey());
|
|
@@ -2365,17 +2362,17 @@ function ni(n, e, t, r) {
|
|
|
2365
2362
|
const p = o ? _.getLastDescendant() : _.getFirstDescendant();
|
|
2366
2363
|
p === null ? f = _ : (_ = p, f = v(_) ? _ : _.getParentOrThrow()), s = 0;
|
|
2367
2364
|
}
|
|
2368
|
-
M(_) ? (i = _, f = null, s =
|
|
2365
|
+
M(_) ? (i = _, f = null, s = _i(_, o)) : _ !== f && o && !h && (v(f) || T(216), s = Math.min(f.getChildrenSize(), s + 1));
|
|
2369
2366
|
} else {
|
|
2370
2367
|
const g = f.getIndexWithinParent();
|
|
2371
|
-
s = e === 0 && z(f) &&
|
|
2368
|
+
s = e === 0 && z(f) && Ze(n) === f ? g : g + 1, f = f.getParentOrThrow();
|
|
2372
2369
|
}
|
|
2373
|
-
if (v(f)) return
|
|
2370
|
+
if (v(f)) return he(f.__key, s, "element");
|
|
2374
2371
|
}
|
|
2375
|
-
} else i =
|
|
2376
|
-
return M(i) ?
|
|
2372
|
+
} else i = Ze(n);
|
|
2373
|
+
return M(i) ? he(i.__key, s, "text") : null;
|
|
2377
2374
|
}
|
|
2378
|
-
function
|
|
2375
|
+
function ni(n, e, t) {
|
|
2379
2376
|
const r = n.offset, i = n.getNode();
|
|
2380
2377
|
if (r === 0) {
|
|
2381
2378
|
const s = i.getPreviousSibling(), o = i.getParent();
|
|
@@ -2394,10 +2391,10 @@ function ri(n, e, t) {
|
|
|
2394
2391
|
}
|
|
2395
2392
|
}
|
|
2396
2393
|
}
|
|
2397
|
-
function
|
|
2394
|
+
function is(n, e, t) {
|
|
2398
2395
|
if (n.type === "text" && e.type === "text") {
|
|
2399
2396
|
const r = n.isBefore(e), i = n.is(e);
|
|
2400
|
-
|
|
2397
|
+
ni(n, r, i), ni(e, !r, i), i && e.set(n.key, n.offset, n.type);
|
|
2401
2398
|
const s = R();
|
|
2402
2399
|
if (s.isComposing() && s._compositionKey !== n.key && O(t)) {
|
|
2403
2400
|
const o = t.anchor, l = t.focus;
|
|
@@ -2405,55 +2402,55 @@ function ss(n, e, t) {
|
|
|
2405
2402
|
}
|
|
2406
2403
|
}
|
|
2407
2404
|
}
|
|
2408
|
-
function
|
|
2409
|
-
if (n === null || t === null || !
|
|
2410
|
-
const o =
|
|
2405
|
+
function ss(n, e, t, r, i, s) {
|
|
2406
|
+
if (n === null || t === null || !Sn(i, n, t)) return null;
|
|
2407
|
+
const o = ti(n, e, O(s) ? s.anchor : null, i);
|
|
2411
2408
|
if (o === null) return null;
|
|
2412
|
-
const l =
|
|
2409
|
+
const l = ti(t, r, O(s) ? s.focus : null, i);
|
|
2413
2410
|
if (l === null) return null;
|
|
2414
2411
|
if (o.type === "element" && l.type === "element") {
|
|
2415
|
-
const a =
|
|
2412
|
+
const a = Ze(n), c = Ze(t);
|
|
2416
2413
|
if (z(a) && z(c)) return null;
|
|
2417
2414
|
}
|
|
2418
|
-
return
|
|
2415
|
+
return is(o, l, s), [o, l];
|
|
2419
2416
|
}
|
|
2420
|
-
function
|
|
2417
|
+
function Al(n) {
|
|
2421
2418
|
return v(n) && !n.isInline();
|
|
2422
2419
|
}
|
|
2423
|
-
function
|
|
2424
|
-
const o =
|
|
2420
|
+
function os(n, e, t, r, i, s) {
|
|
2421
|
+
const o = Pe(), l = new Ge(he(n, e, i), he(t, r, s), 0, "");
|
|
2425
2422
|
return l.dirty = !0, o._selection = l, l;
|
|
2426
2423
|
}
|
|
2427
|
-
function
|
|
2428
|
-
const n =
|
|
2429
|
-
return new
|
|
2424
|
+
function Fo() {
|
|
2425
|
+
const n = he("root", 0, "element"), e = he("root", 0, "element");
|
|
2426
|
+
return new Ge(n, e, 0, "");
|
|
2430
2427
|
}
|
|
2431
|
-
function
|
|
2432
|
-
return new
|
|
2428
|
+
function ls() {
|
|
2429
|
+
return new pn(/* @__PURE__ */ new Set());
|
|
2433
2430
|
}
|
|
2434
|
-
function
|
|
2435
|
-
return
|
|
2431
|
+
function Ol(n, e) {
|
|
2432
|
+
return yn(null, n, e, null);
|
|
2436
2433
|
}
|
|
2437
|
-
function
|
|
2434
|
+
function yn(n, e, t, r) {
|
|
2438
2435
|
const i = t._window;
|
|
2439
2436
|
if (i === null) return null;
|
|
2440
|
-
const s = r || i.event, o = s ? s.type : void 0, l = o === "selectionchange", a = !
|
|
2437
|
+
const s = r || i.event, o = s ? s.type : void 0, l = o === "selectionchange", a = !Un && (l || o === "beforeinput" || o === "compositionstart" || o === "compositionend" || o === "click" && s && s.detail === 3 || o === "drop" || o === void 0);
|
|
2441
2438
|
let c, u, h, f;
|
|
2442
2439
|
if (O(n) && !a) return n.clone();
|
|
2443
2440
|
if (e === null) return null;
|
|
2444
|
-
if (c = e.anchorNode, u = e.focusNode, h = e.anchorOffset, f = e.focusOffset, l && O(n) && !
|
|
2445
|
-
const g =
|
|
2441
|
+
if (c = e.anchorNode, u = e.focusNode, h = e.anchorOffset, f = e.focusOffset, l && O(n) && !Sn(t, c, u)) return n.clone();
|
|
2442
|
+
const g = ss(c, h, u, f, t, n);
|
|
2446
2443
|
if (g === null) return null;
|
|
2447
2444
|
const [d, _] = g;
|
|
2448
|
-
return new
|
|
2445
|
+
return new Ge(d, _, O(n) ? n.format : 0, O(n) ? n.style : "");
|
|
2449
2446
|
}
|
|
2450
2447
|
function L() {
|
|
2451
|
-
return
|
|
2448
|
+
return Pe()._selection;
|
|
2452
2449
|
}
|
|
2453
|
-
function
|
|
2450
|
+
function ut() {
|
|
2454
2451
|
return R()._editorState._selection;
|
|
2455
2452
|
}
|
|
2456
|
-
function
|
|
2453
|
+
function cn(n, e, t, r = 1) {
|
|
2457
2454
|
const i = n.anchor, s = n.focus, o = i.getNode(), l = s.getNode();
|
|
2458
2455
|
if (!e.is(o) && !e.is(l)) return;
|
|
2459
2456
|
const a = e.__key;
|
|
@@ -2461,7 +2458,7 @@ function un(n, e, t, r = 1) {
|
|
|
2461
2458
|
const c = i.offset;
|
|
2462
2459
|
if (t <= c && r > 0 || t < c && r < 0) {
|
|
2463
2460
|
const u = Math.max(0, c + r);
|
|
2464
|
-
i.set(a, u, "element"), s.set(a, u, "element"),
|
|
2461
|
+
i.set(a, u, "element"), s.set(a, u, "element"), ri(n);
|
|
2465
2462
|
}
|
|
2466
2463
|
} else {
|
|
2467
2464
|
const c = n.isBackward(), u = c ? s : i, h = u.getNode(), f = c ? i : s, g = f.getNode();
|
|
@@ -2474,9 +2471,9 @@ function un(n, e, t, r = 1) {
|
|
|
2474
2471
|
(t <= d && r > 0 || t < d && r < 0) && f.set(a, Math.max(0, d + r), "element");
|
|
2475
2472
|
}
|
|
2476
2473
|
}
|
|
2477
|
-
|
|
2474
|
+
ri(n);
|
|
2478
2475
|
}
|
|
2479
|
-
function
|
|
2476
|
+
function ri(n) {
|
|
2480
2477
|
const e = n.anchor, t = e.offset, r = n.focus, i = r.offset, s = e.getNode(), o = r.getNode();
|
|
2481
2478
|
if (n.isCollapsed()) {
|
|
2482
2479
|
if (!v(s)) return;
|
|
@@ -2502,89 +2499,89 @@ function ii(n) {
|
|
|
2502
2499
|
}
|
|
2503
2500
|
}
|
|
2504
2501
|
}
|
|
2505
|
-
function
|
|
2502
|
+
function un(n, e, t, r, i) {
|
|
2506
2503
|
let s = null, o = 0, l = null;
|
|
2507
2504
|
r !== null ? (s = r.__key, M(r) ? (o = r.getTextContentSize(), l = "text") : v(r) && (o = r.getChildrenSize(), l = "element")) : i !== null && (s = i.__key, M(i) ? l = "text" : v(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"));
|
|
2508
2505
|
}
|
|
2509
|
-
function
|
|
2506
|
+
function ii(n, e, t, r, i) {
|
|
2510
2507
|
n.type === "text" ? n.set(t, n.offset + (e ? 0 : i), "text") : n.offset > r.getIndexWithinParent() && n.set(n.key, n.offset - 1, "element");
|
|
2511
2508
|
}
|
|
2512
|
-
function
|
|
2509
|
+
function as(n, e, t, r, i) {
|
|
2513
2510
|
try {
|
|
2514
2511
|
n.setBaseAndExtent(e, t, r, i);
|
|
2515
2512
|
} catch {
|
|
2516
2513
|
}
|
|
2517
2514
|
}
|
|
2518
|
-
function
|
|
2515
|
+
function Lo(n, e, t, r, i, s, o) {
|
|
2519
2516
|
const l = r.anchorNode, a = r.focusNode, c = r.anchorOffset, u = r.focusOffset, h = document.activeElement;
|
|
2520
|
-
if (i.has(
|
|
2521
|
-
if (!O(e)) return void (n !== null &&
|
|
2522
|
-
const f = e.anchor, g = e.focus, d = f.key, _ = g.key, p =
|
|
2517
|
+
if (i.has(Bo) && h !== s || h !== null && _s(h)) return;
|
|
2518
|
+
if (!O(e)) return void (n !== null && Sn(t, l, a) && r.removeAllRanges());
|
|
2519
|
+
const f = e.anchor, g = e.focus, d = f.key, _ = g.key, p = ot(t, d), x = ot(t, _), y = f.offset, m = g.offset, b = e.format, N = e.style, C = e.isCollapsed();
|
|
2523
2520
|
let w = p, k = x, S = !1;
|
|
2524
2521
|
if (f.type === "text") {
|
|
2525
|
-
w =
|
|
2522
|
+
w = st(p);
|
|
2526
2523
|
const B = f.getNode();
|
|
2527
2524
|
S = B.getFormat() !== b || B.getStyle() !== N;
|
|
2528
2525
|
} else O(n) && n.anchor.type === "text" && (S = !0);
|
|
2529
2526
|
var A, F, W, K, P;
|
|
2530
|
-
if (g.type === "text" && (k =
|
|
2531
|
-
if (
|
|
2527
|
+
if (g.type === "text" && (k = st(x)), w !== null && k !== null && (C && (n === null || S || O(n) && (n.format !== b || n.style !== N)) && (A = b, F = N, W = y, K = d, P = performance.now(), qi = [A, F, W, K, P]), c !== y || u !== m || l !== w || a !== k || r.type === "Range" && C || (h !== null && s.contains(h) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
2528
|
+
if (as(r, w, y, k, m), !i.has(Ro) && e.isCollapsed() && s !== null && s === document.activeElement) {
|
|
2532
2529
|
const B = O(e) && e.anchor.type === "element" ? w.childNodes[y] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null;
|
|
2533
2530
|
if (B !== null) {
|
|
2534
2531
|
let V;
|
|
2535
2532
|
if (B instanceof Text) {
|
|
2536
|
-
const
|
|
2537
|
-
|
|
2533
|
+
const ge = document.createRange();
|
|
2534
|
+
ge.selectNode(B), V = ge.getBoundingClientRect();
|
|
2538
2535
|
} else V = B.getBoundingClientRect();
|
|
2539
|
-
(function(_e, pe
|
|
2540
|
-
const
|
|
2541
|
-
if (
|
|
2542
|
-
let { top:
|
|
2543
|
-
for (;
|
|
2544
|
-
const
|
|
2545
|
-
if (
|
|
2536
|
+
(function(ge, _e, pe) {
|
|
2537
|
+
const ft = bs(pe), Or = Nr(ft);
|
|
2538
|
+
if (ft === null || Or === null) return;
|
|
2539
|
+
let { top: Nn, bottom: wn } = _e, Lt = 0, It = 0, be = pe;
|
|
2540
|
+
for (; be !== null; ) {
|
|
2541
|
+
const En = be === ft.body;
|
|
2542
|
+
if (En) Lt = 0, It = se(ge).innerHeight;
|
|
2546
2543
|
else {
|
|
2547
|
-
const
|
|
2548
|
-
|
|
2544
|
+
const Kt = be.getBoundingClientRect();
|
|
2545
|
+
Lt = Kt.top, It = Kt.bottom;
|
|
2549
2546
|
}
|
|
2550
|
-
let
|
|
2551
|
-
if (
|
|
2547
|
+
let dt = 0;
|
|
2548
|
+
if (Nn < Lt ? dt = -(Lt - Nn) : wn > It && (dt = wn - It), dt !== 0) if (En) Or.scrollBy(0, dt);
|
|
2552
2549
|
else {
|
|
2553
|
-
const
|
|
2554
|
-
|
|
2555
|
-
const
|
|
2556
|
-
|
|
2550
|
+
const Kt = be.scrollTop;
|
|
2551
|
+
be.scrollTop += dt;
|
|
2552
|
+
const Dr = be.scrollTop - Kt;
|
|
2553
|
+
Nn -= Dr, wn -= Dr;
|
|
2557
2554
|
}
|
|
2558
|
-
if (
|
|
2559
|
-
|
|
2555
|
+
if (En) break;
|
|
2556
|
+
be = Dt(be);
|
|
2560
2557
|
}
|
|
2561
2558
|
})(t, V, s);
|
|
2562
2559
|
}
|
|
2563
2560
|
}
|
|
2564
|
-
|
|
2561
|
+
er = !0;
|
|
2565
2562
|
}
|
|
2566
2563
|
}
|
|
2567
|
-
function
|
|
2568
|
-
let e = L() ||
|
|
2564
|
+
function Dl(n) {
|
|
2565
|
+
let e = L() || ut();
|
|
2569
2566
|
e === null && (e = re().selectEnd()), e.insertNodes(n);
|
|
2570
2567
|
}
|
|
2571
|
-
function
|
|
2568
|
+
function In(n) {
|
|
2572
2569
|
let e = n;
|
|
2573
2570
|
n.isCollapsed() || e.removeText();
|
|
2574
2571
|
const t = L();
|
|
2575
2572
|
O(t) && (e = t), O(e) || T(161);
|
|
2576
2573
|
const r = e.anchor;
|
|
2577
2574
|
let i = r.getNode(), s = r.offset;
|
|
2578
|
-
for (; !
|
|
2575
|
+
for (; !we(i); ) {
|
|
2579
2576
|
const o = i;
|
|
2580
|
-
if ([i, s] =
|
|
2577
|
+
if ([i, s] = Io(i, s), o.is(i)) break;
|
|
2581
2578
|
}
|
|
2582
2579
|
return s;
|
|
2583
2580
|
}
|
|
2584
|
-
function
|
|
2581
|
+
function Io(n, e) {
|
|
2585
2582
|
const t = n.getParent();
|
|
2586
2583
|
if (!t) {
|
|
2587
|
-
const i =
|
|
2584
|
+
const i = Me();
|
|
2588
2585
|
return re().append(i), i.select(), [re(), 0];
|
|
2589
2586
|
}
|
|
2590
2587
|
if (M(n)) {
|
|
@@ -2596,26 +2593,26 @@ function Bo(n, e) {
|
|
|
2596
2593
|
if (!v(n) || e === 0) return [t, n.getIndexWithinParent()];
|
|
2597
2594
|
const r = n.getChildAtIndex(e);
|
|
2598
2595
|
if (r) {
|
|
2599
|
-
const i = new
|
|
2596
|
+
const i = new Ge(he(n.__key, e, "element"), he(n.__key, e, "element"), 0, ""), s = n.insertNewAfter(i);
|
|
2600
2597
|
s && s.append(r, ...r.getNextSiblings());
|
|
2601
2598
|
}
|
|
2602
2599
|
return [t, n.getIndexWithinParent() + 1];
|
|
2603
2600
|
}
|
|
2604
|
-
function
|
|
2601
|
+
function si(n, e, t, r, i = "decorators-and-blocks") {
|
|
2605
2602
|
if (e === "move" && r === "character" && !n.isCollapsed()) {
|
|
2606
2603
|
const [u, h] = t === n.isBackward() ? [n.focus, n.anchor] : [n.anchor, n.focus];
|
|
2607
2604
|
return h.set(u.key, u.offset, u.type), !0;
|
|
2608
2605
|
}
|
|
2609
|
-
const s =
|
|
2606
|
+
const s = He(n.focus, t ? "previous" : "next"), o = r === "lineboundary", l = e === "move";
|
|
2610
2607
|
let a = s, c = i === "decorators-and-blocks";
|
|
2611
|
-
if (!
|
|
2608
|
+
if (!yl(a)) {
|
|
2612
2609
|
for (const u of a) {
|
|
2613
2610
|
c = !1;
|
|
2614
2611
|
const { origin: h } = u;
|
|
2615
2612
|
if (!z(h) || h.isIsolated() || (a = u, !o || !h.isInline())) break;
|
|
2616
2613
|
}
|
|
2617
|
-
if (c) for (const u of
|
|
2618
|
-
if (
|
|
2614
|
+
if (c) for (const u of Ns(s).iterNodeCarets(e === "extend" ? "shadowRoot" : "root")) {
|
|
2615
|
+
if (de(u)) u.origin.isInline() || (a = u);
|
|
2619
2616
|
else {
|
|
2620
2617
|
if (v(u.origin)) continue;
|
|
2621
2618
|
z(u.origin) && !u.origin.isInline() && (a = u);
|
|
@@ -2625,34 +2622,34 @@ function oi(n, e, t, r, i = "decorators-and-blocks") {
|
|
|
2625
2622
|
}
|
|
2626
2623
|
if (a === s) return !1;
|
|
2627
2624
|
if (l && !o && z(a.origin) && a.origin.isKeyboardSelectable()) {
|
|
2628
|
-
const u =
|
|
2625
|
+
const u = ls();
|
|
2629
2626
|
return u.add(a.origin.getKey()), ie(u), !0;
|
|
2630
2627
|
}
|
|
2631
|
-
return a =
|
|
2628
|
+
return a = fe(a), l && Nt(n.anchor, a), Nt(n.focus, a), c || !o;
|
|
2632
2629
|
}
|
|
2633
|
-
let U = null, j = null, Z = !1,
|
|
2634
|
-
const
|
|
2635
|
-
function
|
|
2630
|
+
let U = null, j = null, Z = !1, Kn = !1, Yt = 0;
|
|
2631
|
+
const oi = { characterData: !0, childList: !0, subtree: !0 };
|
|
2632
|
+
function Mt() {
|
|
2636
2633
|
return Z || U !== null && U._readOnly;
|
|
2637
2634
|
}
|
|
2638
2635
|
function G() {
|
|
2639
2636
|
Z && T(13);
|
|
2640
2637
|
}
|
|
2641
|
-
function
|
|
2642
|
-
|
|
2638
|
+
function cs() {
|
|
2639
|
+
Yt > 99 && T(14);
|
|
2643
2640
|
}
|
|
2644
|
-
function
|
|
2645
|
-
return U === null && T(195,
|
|
2641
|
+
function Pe() {
|
|
2642
|
+
return U === null && T(195, us()), U;
|
|
2646
2643
|
}
|
|
2647
2644
|
function R() {
|
|
2648
|
-
return j === null && T(196,
|
|
2645
|
+
return j === null && T(196, us()), j;
|
|
2649
2646
|
}
|
|
2650
|
-
function
|
|
2647
|
+
function us() {
|
|
2651
2648
|
let n = 0;
|
|
2652
|
-
const e = /* @__PURE__ */ new Set(), t =
|
|
2649
|
+
const e = /* @__PURE__ */ new Set(), t = Cn.version;
|
|
2653
2650
|
if (typeof window < "u") for (const i of document.querySelectorAll("[contenteditable]")) {
|
|
2654
|
-
const s =
|
|
2655
|
-
if (
|
|
2651
|
+
const s = vn(i);
|
|
2652
|
+
if (Cr(s)) n++;
|
|
2656
2653
|
else if (s) {
|
|
2657
2654
|
let o = String(s.constructor.version || "<0.17.1");
|
|
2658
2655
|
o === t && (o += " (separately built, likely a bundler configuration issue)"), e.add(o);
|
|
@@ -2661,10 +2658,10 @@ function fs() {
|
|
|
2661
2658
|
let r = ` Detected on the page: ${n} compatible editor(s) with version ${t}`;
|
|
2662
2659
|
return e.size && (r += ` and incompatible editors with versions ${Array.from(e).join(", ")}`), r;
|
|
2663
2660
|
}
|
|
2664
|
-
function
|
|
2661
|
+
function Ko() {
|
|
2665
2662
|
return j;
|
|
2666
2663
|
}
|
|
2667
|
-
function
|
|
2664
|
+
function li(n, e, t) {
|
|
2668
2665
|
const r = e.__type, i = function(l, a) {
|
|
2669
2666
|
const c = l._nodes.get(a);
|
|
2670
2667
|
return c === void 0 && T(30, a), c;
|
|
@@ -2674,32 +2671,32 @@ function ai(n, e, t) {
|
|
|
2674
2671
|
const o = s.length;
|
|
2675
2672
|
for (let l = 0; l < o && (s[l](e), e.isAttached()); l++) ;
|
|
2676
2673
|
}
|
|
2677
|
-
function
|
|
2674
|
+
function ai(n, e) {
|
|
2678
2675
|
return n !== void 0 && n.__key !== e && n.isAttached();
|
|
2679
2676
|
}
|
|
2680
|
-
function
|
|
2677
|
+
function fs(n, e) {
|
|
2681
2678
|
if (!e) return;
|
|
2682
2679
|
const t = n._updateTags;
|
|
2683
2680
|
let r = e;
|
|
2684
2681
|
Array.isArray(e) || (r = [e]);
|
|
2685
2682
|
for (const i of r) t.add(i);
|
|
2686
2683
|
}
|
|
2687
|
-
function
|
|
2688
|
-
return
|
|
2684
|
+
function Pl(n) {
|
|
2685
|
+
return yr(n, R()._nodes);
|
|
2689
2686
|
}
|
|
2690
|
-
function
|
|
2687
|
+
function yr(n, e) {
|
|
2691
2688
|
const t = n.type, r = e.get(t);
|
|
2692
2689
|
r === void 0 && T(17, t);
|
|
2693
2690
|
const i = r.klass;
|
|
2694
2691
|
n.type !== i.getType() && T(18, i.name);
|
|
2695
2692
|
const s = i.importJSON(n), o = n.children;
|
|
2696
2693
|
if (v(s) && Array.isArray(o)) for (let l = 0; l < o.length; l++) {
|
|
2697
|
-
const a =
|
|
2694
|
+
const a = yr(o[l], e);
|
|
2698
2695
|
s.append(a);
|
|
2699
2696
|
}
|
|
2700
2697
|
return s;
|
|
2701
2698
|
}
|
|
2702
|
-
function
|
|
2699
|
+
function ci(n, e, t) {
|
|
2703
2700
|
const r = U, i = Z, s = j;
|
|
2704
2701
|
U = e, Z = !0, j = n;
|
|
2705
2702
|
try {
|
|
@@ -2708,39 +2705,39 @@ function ui(n, e, t) {
|
|
|
2708
2705
|
U = r, Z = i, j = s;
|
|
2709
2706
|
}
|
|
2710
2707
|
}
|
|
2711
|
-
function
|
|
2708
|
+
function Se(n, e) {
|
|
2712
2709
|
const t = n._pendingEditorState, r = n._rootElement, i = n._headless || r === null;
|
|
2713
2710
|
if (t === null) return;
|
|
2714
|
-
const s = n._editorState, o = s._selection, l = t._selection, a = n._dirtyType !==
|
|
2711
|
+
const s = n._editorState, o = s._selection, l = t._selection, a = n._dirtyType !== We, c = U, u = Z, h = j, f = n._updating, g = n._observer;
|
|
2715
2712
|
let d = null;
|
|
2716
2713
|
if (n._pendingEditorState = null, n._editorState = t, !i && a && g !== null) {
|
|
2717
2714
|
j = n, U = t, Z = !1, n._updating = !0;
|
|
2718
2715
|
try {
|
|
2719
2716
|
const C = n._dirtyType, w = n._dirtyElements, k = n._dirtyLeaves;
|
|
2720
|
-
g.disconnect(), d =
|
|
2717
|
+
g.disconnect(), d = ro(s, t, n, C, w, k);
|
|
2721
2718
|
} catch (C) {
|
|
2722
|
-
if (C instanceof Error && n._onError(C),
|
|
2723
|
-
return
|
|
2719
|
+
if (C instanceof Error && n._onError(C), Kn) throw C;
|
|
2720
|
+
return gs(n, null, r, t), Fi(n), n._dirtyType = it, Kn = !0, Se(n, s), void (Kn = !1);
|
|
2724
2721
|
} finally {
|
|
2725
|
-
g.observe(r,
|
|
2722
|
+
g.observe(r, oi), n._updating = f, U = c, Z = u, j = h;
|
|
2726
2723
|
}
|
|
2727
2724
|
}
|
|
2728
2725
|
t._readOnly || (t._readOnly = !0);
|
|
2729
2726
|
const _ = n._dirtyLeaves, p = n._dirtyElements, x = n._normalizedNodes, y = n._updateTags, m = n._deferred;
|
|
2730
|
-
a && (n._dirtyType =
|
|
2727
|
+
a && (n._dirtyType = We, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements = /* @__PURE__ */ new Map(), n._normalizedNodes = /* @__PURE__ */ new Set(), n._updateTags = /* @__PURE__ */ new Set()), function(C, w) {
|
|
2731
2728
|
const k = C._decorators;
|
|
2732
2729
|
let S = C._pendingDecorators || k;
|
|
2733
2730
|
const A = w._nodeMap;
|
|
2734
2731
|
let F;
|
|
2735
|
-
for (F in S) A.has(F) || (S === k && (S =
|
|
2732
|
+
for (F in S) A.has(F) || (S === k && (S = xs(C)), delete S[F]);
|
|
2736
2733
|
}(n, t);
|
|
2737
|
-
const b = i ? null :
|
|
2738
|
-
if (n._editable && b !== null && (a || l === null || l.dirty) && r !== null && !y.has(
|
|
2734
|
+
const b = i ? null : ke(se(n));
|
|
2735
|
+
if (n._editable && b !== null && (a || l === null || l.dirty) && r !== null && !y.has(Wo)) {
|
|
2739
2736
|
j = n, U = t;
|
|
2740
2737
|
try {
|
|
2741
2738
|
if (g !== null && g.disconnect(), a || l === null || l.dirty) {
|
|
2742
2739
|
const C = n._blockCursorElement;
|
|
2743
|
-
C !== null &&
|
|
2740
|
+
C !== null && ir(C, n, r), Lo(o, l, n, b, y, r);
|
|
2744
2741
|
}
|
|
2745
2742
|
(function(C, w, k) {
|
|
2746
2743
|
let S = C._blockCursorElement;
|
|
@@ -2748,35 +2745,35 @@ function ve(n, e) {
|
|
|
2748
2745
|
const A = k.anchor, F = A.getNode(), W = A.offset;
|
|
2749
2746
|
let K = !1, P = null;
|
|
2750
2747
|
if (W === F.getChildrenSize())
|
|
2751
|
-
|
|
2748
|
+
Rn(F.getChildAtIndex(W - 1)) && (K = !0);
|
|
2752
2749
|
else {
|
|
2753
2750
|
const B = F.getChildAtIndex(W);
|
|
2754
|
-
if (B !== null &&
|
|
2751
|
+
if (B !== null && Rn(B)) {
|
|
2755
2752
|
const V = B.getPreviousSibling();
|
|
2756
|
-
(V === null ||
|
|
2753
|
+
(V === null || Rn(V)) && (K = !0, P = C.getElementByKey(B.__key));
|
|
2757
2754
|
}
|
|
2758
2755
|
}
|
|
2759
2756
|
if (K) {
|
|
2760
2757
|
const B = C.getElementByKey(F.__key);
|
|
2761
2758
|
return S === null && (C._blockCursorElement = S = function(V) {
|
|
2762
|
-
const
|
|
2763
|
-
|
|
2764
|
-
let
|
|
2765
|
-
if (
|
|
2766
|
-
if (typeof
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2759
|
+
const ge = V.theme, _e = document.createElement("div");
|
|
2760
|
+
_e.contentEditable = "false", _e.setAttribute("data-lexical-cursor", "true");
|
|
2761
|
+
let pe = ge.blockCursor;
|
|
2762
|
+
if (pe !== void 0) {
|
|
2763
|
+
if (typeof pe == "string") {
|
|
2764
|
+
const ft = Qt(pe);
|
|
2765
|
+
pe = ge.blockCursor = ft;
|
|
2769
2766
|
}
|
|
2770
|
-
|
|
2767
|
+
pe !== void 0 && _e.classList.add(...pe);
|
|
2771
2768
|
}
|
|
2772
|
-
return
|
|
2769
|
+
return _e;
|
|
2773
2770
|
}(C._config)), w.style.caretColor = "transparent", void (P === null ? B.appendChild(S) : B.insertBefore(S, P));
|
|
2774
2771
|
}
|
|
2775
2772
|
}
|
|
2776
|
-
S !== null &&
|
|
2773
|
+
S !== null && ir(S, C, w);
|
|
2777
2774
|
})(n, r, l);
|
|
2778
2775
|
} finally {
|
|
2779
|
-
g !== null && g.observe(r,
|
|
2776
|
+
g !== null && g.observe(r, oi), j = h, U = c;
|
|
2780
2777
|
}
|
|
2781
2778
|
}
|
|
2782
2779
|
d !== null && function(C, w, k, S, A) {
|
|
@@ -2785,12 +2782,12 @@ function ve(n, e) {
|
|
|
2785
2782
|
const [P, B] = F[K], V = w.get(B);
|
|
2786
2783
|
V !== void 0 && P(V, { dirtyLeaves: S, prevEditorState: A, updateTags: k });
|
|
2787
2784
|
}
|
|
2788
|
-
}(n, d, y, _, s), O(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(
|
|
2785
|
+
}(n, d, y, _, s), O(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(Wi, void 0);
|
|
2789
2786
|
const N = n._pendingDecorators;
|
|
2790
|
-
N !== null && (n._decorators = N, n._pendingDecorators = null,
|
|
2791
|
-
const S =
|
|
2792
|
-
S !== A &&
|
|
2793
|
-
}(n, e || s, t),
|
|
2787
|
+
N !== null && (n._decorators = N, n._pendingDecorators = null, mt("decorator", n, !0, N)), function(C, w, k) {
|
|
2788
|
+
const S = gi(w), A = gi(k);
|
|
2789
|
+
S !== A && mt("textcontent", C, !0, A);
|
|
2790
|
+
}(n, e || s, t), mt("update", n, !0, { dirtyElements: p, dirtyLeaves: _, editorState: t, mutatedNodes: d, normalizedNodes: x, prevEditorState: e || s, tags: y }), function(C, w) {
|
|
2794
2791
|
if (C._deferred = [], w.length !== 0) {
|
|
2795
2792
|
const k = C._updating;
|
|
2796
2793
|
C._updating = !0;
|
|
@@ -2806,12 +2803,12 @@ function ve(n, e) {
|
|
|
2806
2803
|
const k = w.shift();
|
|
2807
2804
|
if (k) {
|
|
2808
2805
|
const [S, A] = k;
|
|
2809
|
-
|
|
2806
|
+
mr(C, S, A);
|
|
2810
2807
|
}
|
|
2811
2808
|
}
|
|
2812
2809
|
}(n);
|
|
2813
2810
|
}
|
|
2814
|
-
function
|
|
2811
|
+
function mt(n, e, t, ...r) {
|
|
2815
2812
|
const i = e._updating;
|
|
2816
2813
|
e._updating = t;
|
|
2817
2814
|
try {
|
|
@@ -2821,7 +2818,7 @@ function xt(n, e, t, ...r) {
|
|
|
2821
2818
|
e._updating = i;
|
|
2822
2819
|
}
|
|
2823
2820
|
}
|
|
2824
|
-
function
|
|
2821
|
+
function ui(n, e) {
|
|
2825
2822
|
const t = n._updates;
|
|
2826
2823
|
let r = e || !1;
|
|
2827
2824
|
for (; t.length !== 0; ) {
|
|
@@ -2834,30 +2831,30 @@ function fi(n, e) {
|
|
|
2834
2831
|
const a = n._pendingEditorState;
|
|
2835
2832
|
a === null && T(191), a._flushSync = !0;
|
|
2836
2833
|
}
|
|
2837
|
-
l && n._deferred.push(l),
|
|
2834
|
+
l && n._deferred.push(l), fs(n, o.tag);
|
|
2838
2835
|
}
|
|
2839
2836
|
s();
|
|
2840
2837
|
}
|
|
2841
2838
|
}
|
|
2842
2839
|
return r;
|
|
2843
2840
|
}
|
|
2844
|
-
function
|
|
2841
|
+
function mr(n, e, t) {
|
|
2845
2842
|
const r = n._updateTags;
|
|
2846
2843
|
let i, s = !1, o = !1;
|
|
2847
|
-
t !== void 0 && (i = t.onUpdate,
|
|
2844
|
+
t !== void 0 && (i = t.onUpdate, fs(n, t.tag), s = t.skipTransforms || !1, o = t.discrete || !1), i && n._deferred.push(i);
|
|
2848
2845
|
const l = n._editorState;
|
|
2849
2846
|
let a = n._pendingEditorState, c = !1;
|
|
2850
|
-
(a === null || a._readOnly) && (a = n._pendingEditorState =
|
|
2847
|
+
(a === null || a._readOnly) && (a = n._pendingEditorState = ds(a || l), c = !0), a._flushSync = o;
|
|
2851
2848
|
const u = U, h = Z, f = j, g = n._updating;
|
|
2852
2849
|
U = a, Z = !1, n._updating = !0, j = n;
|
|
2853
2850
|
const d = n._headless || n.getRootElement() === null;
|
|
2854
2851
|
try {
|
|
2855
2852
|
c && (d ? l._selection !== null && (a._selection = l._selection.clone()) : a._selection = function(y, m) {
|
|
2856
|
-
const b = y.getEditorState()._selection, N =
|
|
2857
|
-
return O(b) || b == null ?
|
|
2853
|
+
const b = y.getEditorState()._selection, N = ke(se(y));
|
|
2854
|
+
return O(b) || b == null ? yn(b, N, y, m) : b.clone();
|
|
2858
2855
|
}(n, t && t.event || null));
|
|
2859
2856
|
const p = n._compositionKey;
|
|
2860
|
-
e(), s =
|
|
2857
|
+
e(), s = ui(n, s), function(y, m) {
|
|
2861
2858
|
const b = m.getEditorState()._selection, N = y._selection;
|
|
2862
2859
|
if (O(N)) {
|
|
2863
2860
|
const C = N.anchor, w = N.focus;
|
|
@@ -2867,24 +2864,24 @@ function xr(n, e, t) {
|
|
|
2867
2864
|
k !== S && S.selectionTransform(b, N);
|
|
2868
2865
|
}
|
|
2869
2866
|
}
|
|
2870
|
-
}(a, n), n._dirtyType !==
|
|
2867
|
+
}(a, n), n._dirtyType !== We && (s ? function(y, m) {
|
|
2871
2868
|
const b = m._dirtyLeaves, N = y._nodeMap;
|
|
2872
2869
|
for (const C of b) {
|
|
2873
2870
|
const w = N.get(C);
|
|
2874
|
-
M(w) && w.isAttached() && w.isSimpleText() && !w.isUnmergeable() &&
|
|
2871
|
+
M(w) && w.isAttached() && w.isSimpleText() && !w.isUnmergeable() && Kr(w);
|
|
2875
2872
|
}
|
|
2876
2873
|
}(a, n) : function(y, m) {
|
|
2877
|
-
const b = m._dirtyLeaves, N = m._dirtyElements, C = y._nodeMap, w =
|
|
2874
|
+
const b = m._dirtyLeaves, N = m._dirtyElements, C = y._nodeMap, w = Ee(), k = /* @__PURE__ */ new Map();
|
|
2878
2875
|
let S = b, A = S.size, F = N, W = F.size;
|
|
2879
2876
|
for (; A > 0 || W > 0; ) {
|
|
2880
2877
|
if (A > 0) {
|
|
2881
2878
|
m._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
2882
2879
|
for (const K of S) {
|
|
2883
2880
|
const P = C.get(K);
|
|
2884
|
-
M(P) && P.isAttached() && P.isSimpleText() && !P.isUnmergeable() &&
|
|
2881
|
+
M(P) && P.isAttached() && P.isSimpleText() && !P.isUnmergeable() && Kr(P), P !== void 0 && ai(P, w) && li(m, P, k), b.add(K);
|
|
2885
2882
|
}
|
|
2886
2883
|
if (S = m._dirtyLeaves, A = S.size, A > 0) {
|
|
2887
|
-
|
|
2884
|
+
Yt++;
|
|
2888
2885
|
continue;
|
|
2889
2886
|
}
|
|
2890
2887
|
}
|
|
@@ -2893,16 +2890,16 @@ function xr(n, e, t) {
|
|
|
2893
2890
|
const P = K[0], B = K[1];
|
|
2894
2891
|
if (N.set(P, B), !B) continue;
|
|
2895
2892
|
const V = C.get(P);
|
|
2896
|
-
V !== void 0 &&
|
|
2893
|
+
V !== void 0 && ai(V, w) && li(m, V, k);
|
|
2897
2894
|
}
|
|
2898
|
-
S = m._dirtyLeaves, A = S.size, F = m._dirtyElements, W = F.size,
|
|
2895
|
+
S = m._dirtyLeaves, A = S.size, F = m._dirtyElements, W = F.size, Yt++;
|
|
2899
2896
|
}
|
|
2900
2897
|
m._dirtyLeaves = b, m._dirtyElements = N;
|
|
2901
|
-
}(a, n),
|
|
2898
|
+
}(a, n), ui(n), function(y, m, b, N) {
|
|
2902
2899
|
const C = y._nodeMap, w = m._nodeMap, k = [];
|
|
2903
2900
|
for (const [S] of N) {
|
|
2904
2901
|
const A = w.get(S);
|
|
2905
|
-
A !== void 0 && (A.isAttached() || (v(A) &&
|
|
2902
|
+
A !== void 0 && (A.isAttached() || (v(A) && Oi(A, S, C, w, k, N), C.has(S) || N.delete(S), k.push(S)));
|
|
2906
2903
|
}
|
|
2907
2904
|
for (const S of k) w.delete(S);
|
|
2908
2905
|
for (const S of b) {
|
|
@@ -2914,37 +2911,37 @@ function xr(n, e, t) {
|
|
|
2914
2911
|
if (O(x)) {
|
|
2915
2912
|
const y = a._nodeMap, m = x.anchor.key, b = x.focus.key;
|
|
2916
2913
|
y.get(m) !== void 0 && y.get(b) !== void 0 || T(19);
|
|
2917
|
-
} else
|
|
2914
|
+
} else pr(x) && x._nodes.size === 0 && (a._selection = null);
|
|
2918
2915
|
} catch (p) {
|
|
2919
|
-
return p instanceof Error && n._onError(p), n._pendingEditorState = l, n._dirtyType =
|
|
2916
|
+
return p instanceof Error && n._onError(p), n._pendingEditorState = l, n._dirtyType = it, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements.clear(), void Se(n);
|
|
2920
2917
|
} finally {
|
|
2921
|
-
U = u, Z = h, j = f, n._updating = g,
|
|
2918
|
+
U = u, Z = h, j = f, n._updating = g, Yt = 0;
|
|
2922
2919
|
}
|
|
2923
|
-
n._dirtyType !==
|
|
2920
|
+
n._dirtyType !== We || n._deferred.length > 0 || function(p, x) {
|
|
2924
2921
|
const y = x.getEditorState()._selection, m = p._selection;
|
|
2925
2922
|
if (m !== null) {
|
|
2926
2923
|
if (m.dirty || !m.is(y)) return !0;
|
|
2927
2924
|
} else if (y !== null) return !0;
|
|
2928
2925
|
return !1;
|
|
2929
|
-
}(a, n) ? a._flushSync ? (a._flushSync = !1,
|
|
2930
|
-
|
|
2926
|
+
}(a, n) ? a._flushSync ? (a._flushSync = !1, Se(n)) : c && $o(() => {
|
|
2927
|
+
Se(n);
|
|
2931
2928
|
}) : (a._flushSync = !1, c && (r.clear(), n._deferred = [], n._pendingEditorState = null));
|
|
2932
2929
|
}
|
|
2933
2930
|
function te(n, e, t) {
|
|
2934
|
-
j === n && t === void 0 ? e() :
|
|
2931
|
+
j === n && t === void 0 ? e() : mr(n, e, t);
|
|
2935
2932
|
}
|
|
2936
|
-
class
|
|
2933
|
+
class xt {
|
|
2937
2934
|
constructor(e, t, r) {
|
|
2938
2935
|
this.element = e, this.before = t || null, this.after = r || null;
|
|
2939
2936
|
}
|
|
2940
2937
|
withBefore(e) {
|
|
2941
|
-
return new
|
|
2938
|
+
return new xt(this.element, e, this.after);
|
|
2942
2939
|
}
|
|
2943
2940
|
withAfter(e) {
|
|
2944
|
-
return new
|
|
2941
|
+
return new xt(this.element, this.before, e);
|
|
2945
2942
|
}
|
|
2946
2943
|
withElement(e) {
|
|
2947
|
-
return this.element === e ? this : new
|
|
2944
|
+
return this.element === e ? this : new xt(e, this.before, this.after);
|
|
2948
2945
|
}
|
|
2949
2946
|
insertChild(e) {
|
|
2950
2947
|
const t = this.before || this.getManagedLineBreak();
|
|
@@ -2966,7 +2963,7 @@ class Ct {
|
|
|
2966
2963
|
setManagedLineBreak(e) {
|
|
2967
2964
|
if (e === null) this.removeManagedLineBreak();
|
|
2968
2965
|
else {
|
|
2969
|
-
const t = e === "decorator" && (
|
|
2966
|
+
const t = e === "decorator" && (rt || Ct);
|
|
2970
2967
|
this.insertManagedLineBreak(t);
|
|
2971
2968
|
}
|
|
2972
2969
|
}
|
|
@@ -2999,9 +2996,9 @@ class Ct {
|
|
|
2999
2996
|
const a = this.getFirstChildOffset();
|
|
3000
2997
|
return [e, Math.min(a + e.getChildrenSize(), Math.max(a, i))];
|
|
3001
2998
|
}
|
|
3002
|
-
const s =
|
|
2999
|
+
const s = fi(t, r);
|
|
3003
3000
|
s.push(i);
|
|
3004
|
-
const o =
|
|
3001
|
+
const o = fi(t, this.element);
|
|
3005
3002
|
let l = e.getIndexWithinParent();
|
|
3006
3003
|
for (let a = 0; a < o.length; a++) {
|
|
3007
3004
|
const c = s[a], u = o[a];
|
|
@@ -3014,7 +3011,7 @@ class Ct {
|
|
|
3014
3011
|
return [e.getParentOrThrow(), l];
|
|
3015
3012
|
}
|
|
3016
3013
|
}
|
|
3017
|
-
function
|
|
3014
|
+
function fi(n, e) {
|
|
3018
3015
|
const t = [];
|
|
3019
3016
|
let r = e;
|
|
3020
3017
|
for (; r !== n && r !== null; r = r.parentNode) {
|
|
@@ -3024,7 +3021,7 @@ function di(n, e) {
|
|
|
3024
3021
|
}
|
|
3025
3022
|
return r !== n && T(225), t.reverse();
|
|
3026
3023
|
}
|
|
3027
|
-
class
|
|
3024
|
+
class mn extends _n {
|
|
3028
3025
|
constructor(e) {
|
|
3029
3026
|
super(e), this.__first = null, this.__last = null, this.__size = 0, this.__format = 0, this.__style = "", this.__indent = 0, this.__dir = null, this.__textFormat = 0, this.__textStyle = "";
|
|
3030
3027
|
}
|
|
@@ -3036,7 +3033,7 @@ class xn extends pn {
|
|
|
3036
3033
|
}
|
|
3037
3034
|
getFormatType() {
|
|
3038
3035
|
const e = this.getFormat();
|
|
3039
|
-
return
|
|
3036
|
+
return $s[e] || "";
|
|
3040
3037
|
}
|
|
3041
3038
|
getStyle() {
|
|
3042
3039
|
return this.getLatest().__style;
|
|
@@ -3146,7 +3143,7 @@ class xn extends pn {
|
|
|
3146
3143
|
const t = this.getChildren(), r = t.length;
|
|
3147
3144
|
for (let i = 0; i < r; i++) {
|
|
3148
3145
|
const s = t[i];
|
|
3149
|
-
e += s.getTextContent(), v(s) && i !== r - 1 && !s.isInline() && (e +=
|
|
3146
|
+
e += s.getTextContent(), v(s) && i !== r - 1 && !s.isInline() && (e += ve);
|
|
3150
3147
|
}
|
|
3151
3148
|
return e;
|
|
3152
3149
|
}
|
|
@@ -3155,7 +3152,7 @@ class xn extends pn {
|
|
|
3155
3152
|
const t = this.getChildren(), r = t.length;
|
|
3156
3153
|
for (let i = 0; i < r; i++) {
|
|
3157
3154
|
const s = t[i];
|
|
3158
|
-
e += s.getTextContentSize(), v(s) && i !== r - 1 && !s.isInline() && (e +=
|
|
3155
|
+
e += s.getTextContentSize(), v(s) && i !== r - 1 && !s.isInline() && (e += ve.length);
|
|
3159
3156
|
}
|
|
3160
3157
|
return e;
|
|
3161
3158
|
}
|
|
@@ -3167,17 +3164,17 @@ class xn extends pn {
|
|
|
3167
3164
|
}
|
|
3168
3165
|
hasFormat(e) {
|
|
3169
3166
|
if (e !== "") {
|
|
3170
|
-
const t =
|
|
3167
|
+
const t = Fr[e];
|
|
3171
3168
|
return !!(this.getFormat() & t);
|
|
3172
3169
|
}
|
|
3173
3170
|
return !1;
|
|
3174
3171
|
}
|
|
3175
3172
|
hasTextFormat(e) {
|
|
3176
|
-
const t =
|
|
3173
|
+
const t = Je[e];
|
|
3177
3174
|
return !!(this.getTextFormat() & t);
|
|
3178
3175
|
}
|
|
3179
3176
|
getFormatFlags(e, t) {
|
|
3180
|
-
return
|
|
3177
|
+
return fn(this.getLatest().__textFormat, e, t);
|
|
3181
3178
|
}
|
|
3182
3179
|
getTextStyle() {
|
|
3183
3180
|
return this.getLatest().__textStyle;
|
|
@@ -3198,7 +3195,7 @@ class xn extends pn {
|
|
|
3198
3195
|
}
|
|
3199
3196
|
i === void 0 && (i = o), s === void 0 && (s = o);
|
|
3200
3197
|
const l = this.__key;
|
|
3201
|
-
return O(r) ? (r.anchor.set(l, i, "element"), r.focus.set(l, s, "element"), r.dirty = !0, r) :
|
|
3198
|
+
return O(r) ? (r.anchor.set(l, i, "element"), r.focus.set(l, s, "element"), r.dirty = !0, r) : os(l, i, l, s, "element", "element");
|
|
3202
3199
|
}
|
|
3203
3200
|
selectStart() {
|
|
3204
3201
|
const e = this.getFirstDescendant();
|
|
@@ -3220,7 +3217,7 @@ class xn extends pn {
|
|
|
3220
3217
|
return t.__dir = e, t;
|
|
3221
3218
|
}
|
|
3222
3219
|
setFormat(e) {
|
|
3223
|
-
return this.getWritable().__format = e !== "" ?
|
|
3220
|
+
return this.getWritable().__format = e !== "" ? Fr[e] : 0, this;
|
|
3224
3221
|
}
|
|
3225
3222
|
setStyle(e) {
|
|
3226
3223
|
return this.getWritable().__style = e || "", this;
|
|
@@ -3251,7 +3248,7 @@ class xn extends pn {
|
|
|
3251
3248
|
for (let _ = 0; _ < t; _++) {
|
|
3252
3249
|
d === null && T(100);
|
|
3253
3250
|
const p = d.getNextSibling(), x = d.__key;
|
|
3254
|
-
|
|
3251
|
+
Be(d.getWritable()), c.push(x), d = p;
|
|
3255
3252
|
}
|
|
3256
3253
|
}
|
|
3257
3254
|
let g = h;
|
|
@@ -3259,7 +3256,7 @@ class xn extends pn {
|
|
|
3259
3256
|
const _ = r[d];
|
|
3260
3257
|
g !== null && _.is(g) && (h = g = g.getPreviousSibling());
|
|
3261
3258
|
const p = _.getWritable();
|
|
3262
|
-
p.__parent === l && f--,
|
|
3259
|
+
p.__parent === l && f--, Be(p);
|
|
3263
3260
|
const x = _.__key;
|
|
3264
3261
|
if (g === null) o.__first = x, p.__prev = null;
|
|
3265
3262
|
else {
|
|
@@ -3281,13 +3278,13 @@ class xn extends pn {
|
|
|
3281
3278
|
const d = L();
|
|
3282
3279
|
if (O(d)) {
|
|
3283
3280
|
const _ = new Set(c), p = new Set(a), { anchor: x, focus: y } = d;
|
|
3284
|
-
|
|
3281
|
+
di(x, _, p) && un(x, x.getNode(), this, h, u), di(y, _, p) && un(y, y.getNode(), this, h, u), f !== 0 || this.canBeEmpty() || Fe(this) || this.remove();
|
|
3285
3282
|
}
|
|
3286
3283
|
}
|
|
3287
3284
|
return o;
|
|
3288
3285
|
}
|
|
3289
3286
|
getDOMSlot(e) {
|
|
3290
|
-
return new
|
|
3287
|
+
return new xt(e);
|
|
3291
3288
|
}
|
|
3292
3289
|
exportDOM(e) {
|
|
3293
3290
|
const { element: t } = super.exportDOM(e);
|
|
@@ -3358,9 +3355,9 @@ class xn extends pn {
|
|
|
3358
3355
|
}
|
|
3359
3356
|
}
|
|
3360
3357
|
function v(n) {
|
|
3361
|
-
return n instanceof
|
|
3358
|
+
return n instanceof mn;
|
|
3362
3359
|
}
|
|
3363
|
-
function
|
|
3360
|
+
function di(n, e, t) {
|
|
3364
3361
|
let r = n.getNode();
|
|
3365
3362
|
for (; r; ) {
|
|
3366
3363
|
const i = r.__key;
|
|
@@ -3369,7 +3366,7 @@ function hi(n, e, t) {
|
|
|
3369
3366
|
}
|
|
3370
3367
|
return !1;
|
|
3371
3368
|
}
|
|
3372
|
-
class
|
|
3369
|
+
class zo extends _n {
|
|
3373
3370
|
decorate(e, t) {
|
|
3374
3371
|
T(47);
|
|
3375
3372
|
}
|
|
@@ -3384,14 +3381,14 @@ class Wo extends pn {
|
|
|
3384
3381
|
}
|
|
3385
3382
|
}
|
|
3386
3383
|
function z(n) {
|
|
3387
|
-
return n instanceof
|
|
3384
|
+
return n instanceof zo;
|
|
3388
3385
|
}
|
|
3389
|
-
class
|
|
3386
|
+
class At extends mn {
|
|
3390
3387
|
static getType() {
|
|
3391
3388
|
return "root";
|
|
3392
3389
|
}
|
|
3393
3390
|
static clone() {
|
|
3394
|
-
return new
|
|
3391
|
+
return new At();
|
|
3395
3392
|
}
|
|
3396
3393
|
constructor() {
|
|
3397
3394
|
super("root"), this.__cachedText = null;
|
|
@@ -3401,7 +3398,7 @@ class Ot extends xn {
|
|
|
3401
3398
|
}
|
|
3402
3399
|
getTextContent() {
|
|
3403
3400
|
const e = this.__cachedText;
|
|
3404
|
-
return !
|
|
3401
|
+
return !Mt() && R()._dirtyType !== We || e === null ? super.getTextContent() : e;
|
|
3405
3402
|
}
|
|
3406
3403
|
remove() {
|
|
3407
3404
|
T(52);
|
|
@@ -3430,28 +3427,28 @@ class Ot extends xn {
|
|
|
3430
3427
|
}
|
|
3431
3428
|
}
|
|
3432
3429
|
function ne(n) {
|
|
3433
|
-
return n instanceof
|
|
3430
|
+
return n instanceof At;
|
|
3434
3431
|
}
|
|
3435
|
-
function
|
|
3436
|
-
return new
|
|
3432
|
+
function ds(n) {
|
|
3433
|
+
return new xn(new Map(n._nodeMap));
|
|
3437
3434
|
}
|
|
3438
|
-
function
|
|
3439
|
-
return new
|
|
3435
|
+
function xr() {
|
|
3436
|
+
return new xn(/* @__PURE__ */ new Map([["root", new At()]]));
|
|
3440
3437
|
}
|
|
3441
|
-
function
|
|
3438
|
+
function hs(n) {
|
|
3442
3439
|
const e = n.exportJSON(), t = n.constructor;
|
|
3443
3440
|
if (e.type !== t.getType() && T(130, t.name), v(n)) {
|
|
3444
3441
|
const r = e.children;
|
|
3445
3442
|
Array.isArray(r) || T(59, t.name);
|
|
3446
3443
|
const i = n.getChildren();
|
|
3447
3444
|
for (let s = 0; s < i.length; s++) {
|
|
3448
|
-
const o =
|
|
3445
|
+
const o = hs(i[s]);
|
|
3449
3446
|
r.push(o);
|
|
3450
3447
|
}
|
|
3451
3448
|
}
|
|
3452
3449
|
return e;
|
|
3453
3450
|
}
|
|
3454
|
-
class
|
|
3451
|
+
class xn {
|
|
3455
3452
|
constructor(e, t) {
|
|
3456
3453
|
this._nodeMap = e, this._selection = t || null, this._flushSync = !1, this._readOnly = !1;
|
|
3457
3454
|
}
|
|
@@ -3459,18 +3456,18 @@ class Cn {
|
|
|
3459
3456
|
return this._nodeMap.size === 1 && this._selection === null;
|
|
3460
3457
|
}
|
|
3461
3458
|
read(e, t) {
|
|
3462
|
-
return
|
|
3459
|
+
return ci(t && t.editor || null, this, e);
|
|
3463
3460
|
}
|
|
3464
3461
|
clone(e) {
|
|
3465
|
-
const t = new
|
|
3462
|
+
const t = new xn(this._nodeMap, e === void 0 ? this._selection : e);
|
|
3466
3463
|
return t._readOnly = !0, t;
|
|
3467
3464
|
}
|
|
3468
3465
|
toJSON() {
|
|
3469
|
-
return
|
|
3466
|
+
return ci(null, this, () => ({ root: hs(re()) }));
|
|
3470
3467
|
}
|
|
3471
3468
|
}
|
|
3472
|
-
const
|
|
3473
|
-
class
|
|
3469
|
+
const Fl = "historic", Ll = "history-push", zn = "history-merge", Il = "paste", Bo = "collaboration", Ro = "skip-scroll-into-view", Wo = "skip-dom-selection";
|
|
3470
|
+
class Jo extends mn {
|
|
3474
3471
|
static getType() {
|
|
3475
3472
|
return "artificial";
|
|
3476
3473
|
}
|
|
@@ -3478,22 +3475,22 @@ class $o extends xn {
|
|
|
3478
3475
|
return document.createElement("div");
|
|
3479
3476
|
}
|
|
3480
3477
|
}
|
|
3481
|
-
class
|
|
3478
|
+
class Ot extends mn {
|
|
3482
3479
|
static getType() {
|
|
3483
3480
|
return "paragraph";
|
|
3484
3481
|
}
|
|
3485
3482
|
static clone(e) {
|
|
3486
|
-
return new
|
|
3483
|
+
return new Ot(e.__key);
|
|
3487
3484
|
}
|
|
3488
3485
|
createDOM(e) {
|
|
3489
|
-
const t = document.createElement("p"), r =
|
|
3486
|
+
const t = document.createElement("p"), r = nt(e.theme, "paragraph");
|
|
3490
3487
|
return r !== void 0 && t.classList.add(...r), t;
|
|
3491
3488
|
}
|
|
3492
3489
|
updateDOM(e, t, r) {
|
|
3493
3490
|
return !1;
|
|
3494
3491
|
}
|
|
3495
3492
|
static importDOM() {
|
|
3496
|
-
return { p: (e) => ({ conversion:
|
|
3493
|
+
return { p: (e) => ({ conversion: Uo, priority: 0 }) };
|
|
3497
3494
|
}
|
|
3498
3495
|
exportDOM(e) {
|
|
3499
3496
|
const { element: t } = super.exportDOM(e);
|
|
@@ -3505,13 +3502,13 @@ class Dt extends xn {
|
|
|
3505
3502
|
return { element: t };
|
|
3506
3503
|
}
|
|
3507
3504
|
static importJSON(e) {
|
|
3508
|
-
return
|
|
3505
|
+
return Me().updateFromJSON(e);
|
|
3509
3506
|
}
|
|
3510
3507
|
exportJSON() {
|
|
3511
3508
|
return { ...super.exportJSON(), textFormat: this.getTextFormat(), textStyle: this.getTextStyle() };
|
|
3512
3509
|
}
|
|
3513
3510
|
insertNewAfter(e, t) {
|
|
3514
|
-
const r =
|
|
3511
|
+
const r = Me();
|
|
3515
3512
|
r.setTextFormat(e.format), r.setTextStyle(e.style);
|
|
3516
3513
|
const i = this.getDirection();
|
|
3517
3514
|
return r.setDirection(i), r.setFormat(this.getFormatType()), r.setStyle(this.getStyle()), this.insertAfter(r, t), r;
|
|
@@ -3525,25 +3522,25 @@ class Dt extends xn {
|
|
|
3525
3522
|
return !1;
|
|
3526
3523
|
}
|
|
3527
3524
|
}
|
|
3528
|
-
function
|
|
3529
|
-
const e =
|
|
3530
|
-
return n.style && (e.setFormat(n.style.textAlign),
|
|
3525
|
+
function Uo(n) {
|
|
3526
|
+
const e = Me();
|
|
3527
|
+
return n.style && (e.setFormat(n.style.textAlign), sl(n, e)), { node: e };
|
|
3531
3528
|
}
|
|
3532
|
-
function
|
|
3533
|
-
return
|
|
3529
|
+
function Me() {
|
|
3530
|
+
return bn(new Ot());
|
|
3534
3531
|
}
|
|
3535
|
-
function
|
|
3536
|
-
return n instanceof
|
|
3532
|
+
function Kl(n) {
|
|
3533
|
+
return n instanceof Ot;
|
|
3537
3534
|
}
|
|
3538
|
-
const
|
|
3539
|
-
function
|
|
3535
|
+
const zl = 0, Bl = 1, Rl = 3, Wl = 4;
|
|
3536
|
+
function gs(n, e, t, r) {
|
|
3540
3537
|
const i = n._keyToDOMMap;
|
|
3541
|
-
i.clear(), n._editorState =
|
|
3538
|
+
i.clear(), n._editorState = xr(), n._pendingEditorState = r, n._compositionKey = null, n._dirtyType = We, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements.clear(), n._normalizedNodes = /* @__PURE__ */ new Set(), n._updateTags = /* @__PURE__ */ new Set(), n._updates = [], n._blockCursorElement = null;
|
|
3542
3539
|
const s = n._observer;
|
|
3543
3540
|
s !== null && (s.disconnect(), n._observer = null), e !== null && (e.textContent = ""), t !== null && (t.textContent = "", i.set("root", t));
|
|
3544
3541
|
}
|
|
3545
|
-
function
|
|
3546
|
-
const e = n || {}, t =
|
|
3542
|
+
function Jl(n) {
|
|
3543
|
+
const e = n || {}, t = Ko(), r = e.theme || {}, i = n === void 0 ? t : e.parentEditor || null, s = e.disableEvents || !1, o = xr(), l = e.namespace || (i !== null ? i._config.namespace : vs()), a = e.editorState, c = [At, ct, wt, Et, Ot, Jo, ...e.nodes || []], { onError: u, html: h } = e, f = e.editable === void 0 || e.editable;
|
|
3547
3544
|
let g;
|
|
3548
3545
|
if (n === void 0 && t !== null) g = t._nodes;
|
|
3549
3546
|
else {
|
|
@@ -3558,7 +3555,7 @@ function Vl(n) {
|
|
|
3558
3555
|
b !== null && N.add(b), g.set(m, { exportDOM: h && h.export ? h.export.get(p) : void 0, klass: p, replace: x, replaceWithKlass: y, transforms: N });
|
|
3559
3556
|
}
|
|
3560
3557
|
}
|
|
3561
|
-
const d = new
|
|
3558
|
+
const d = new Cn(o, i, g, { disableEvents: s, namespace: l, theme: r }, u || console.error, function(_, p) {
|
|
3562
3559
|
const x = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), m = (b) => {
|
|
3563
3560
|
Object.keys(b).forEach((N) => {
|
|
3564
3561
|
let C = x.get(N);
|
|
@@ -3573,11 +3570,11 @@ function Vl(n) {
|
|
|
3573
3570
|
C !== null && m(C);
|
|
3574
3571
|
}), p && m(p), x;
|
|
3575
3572
|
}(g, h ? h.import : void 0), f, n);
|
|
3576
|
-
return a !== void 0 && (d._pendingEditorState = a, d._dirtyType =
|
|
3573
|
+
return a !== void 0 && (d._pendingEditorState = a, d._dirtyType = it), d;
|
|
3577
3574
|
}
|
|
3578
|
-
class
|
|
3575
|
+
class Cn {
|
|
3579
3576
|
constructor(e, t, r, i, s, o, l, a) {
|
|
3580
|
-
this._createEditorArgs = a, this._parentEditor = t, this._rootElement = null, this._editorState = e, this._pendingEditorState = null, this._compositionKey = null, this._deferred = [], this._keyToDOMMap = /* @__PURE__ */ new Map(), this._updates = [], this._updating = !1, this._listeners = { decorator: /* @__PURE__ */ new Set(), editable: /* @__PURE__ */ new Set(), mutation: /* @__PURE__ */ new Map(), root: /* @__PURE__ */ new Set(), textcontent: /* @__PURE__ */ new Set(), update: /* @__PURE__ */ new Set() }, this._commands = /* @__PURE__ */ new Map(), this._config = i, this._nodes = r, this._decorators = {}, this._pendingDecorators = null, this._dirtyType =
|
|
3577
|
+
this._createEditorArgs = a, this._parentEditor = t, this._rootElement = null, this._editorState = e, this._pendingEditorState = null, this._compositionKey = null, this._deferred = [], this._keyToDOMMap = /* @__PURE__ */ new Map(), this._updates = [], this._updating = !1, this._listeners = { decorator: /* @__PURE__ */ new Set(), editable: /* @__PURE__ */ new Set(), mutation: /* @__PURE__ */ new Map(), root: /* @__PURE__ */ new Set(), textcontent: /* @__PURE__ */ new Set(), update: /* @__PURE__ */ new Set() }, this._commands = /* @__PURE__ */ new Map(), this._config = i, this._nodes = r, this._decorators = {}, this._pendingDecorators = null, this._dirtyType = We, this._cloneNotNeeded = /* @__PURE__ */ new Set(), this._dirtyLeaves = /* @__PURE__ */ new Set(), this._dirtyElements = /* @__PURE__ */ new Map(), this._normalizedNodes = /* @__PURE__ */ new Set(), this._updateTags = /* @__PURE__ */ new Set(), this._observer = null, this._key = vs(), this._onError = s, this._htmlConversions = o, this._editable = l, this._headless = t !== null && t._headless, this._window = null, this._blockCursorElement = null;
|
|
3581
3578
|
}
|
|
3582
3579
|
isComposing() {
|
|
3583
3580
|
return this._compositionKey != null;
|
|
@@ -3640,7 +3637,7 @@ class Sn {
|
|
|
3640
3637
|
return e;
|
|
3641
3638
|
}
|
|
3642
3639
|
initializeMutationListener(e, t) {
|
|
3643
|
-
const r = this._editorState, i =
|
|
3640
|
+
const r = this._editorState, i = vi(r).get(t.getType());
|
|
3644
3641
|
if (!i) return;
|
|
3645
3642
|
const s = /* @__PURE__ */ new Map();
|
|
3646
3643
|
for (const o of i.keys()) s.set(o, "created");
|
|
@@ -3657,7 +3654,7 @@ class Sn {
|
|
|
3657
3654
|
i.push(o);
|
|
3658
3655
|
}
|
|
3659
3656
|
return function(o, l) {
|
|
3660
|
-
const a =
|
|
3657
|
+
const a = vi(o.getEditorState()), c = [];
|
|
3661
3658
|
for (const u of l) {
|
|
3662
3659
|
const h = a.get(u);
|
|
3663
3660
|
h && c.push(h);
|
|
@@ -3667,7 +3664,7 @@ class Sn {
|
|
|
3667
3664
|
const f = $(h);
|
|
3668
3665
|
f && f.markDirty();
|
|
3669
3666
|
}
|
|
3670
|
-
}, o._pendingEditorState === null ? { tag:
|
|
3667
|
+
}, o._pendingEditorState === null ? { tag: zn } : void 0);
|
|
3671
3668
|
}(this, i.map((o) => o.klass.getType())), () => {
|
|
3672
3669
|
i.forEach((o) => o.transforms.delete(t));
|
|
3673
3670
|
};
|
|
@@ -3693,39 +3690,39 @@ class Sn {
|
|
|
3693
3690
|
setRootElement(e) {
|
|
3694
3691
|
const t = this._rootElement;
|
|
3695
3692
|
if (e !== t) {
|
|
3696
|
-
const r =
|
|
3697
|
-
if (this._rootElement = e,
|
|
3698
|
-
const s =
|
|
3699
|
-
o.userSelect = "text", o.whiteSpace = "pre-wrap", o.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = s, this._dirtyType =
|
|
3700
|
-
const c = l.ownerDocument, u =
|
|
3701
|
-
(u === void 0 || u < 1) && c.addEventListener("selectionchange",
|
|
3702
|
-
const h =
|
|
3703
|
-
for (let f = 0; f <
|
|
3704
|
-
const [g, d] =
|
|
3705
|
-
|
|
3693
|
+
const r = nt(this._config.theme, "root"), i = this._pendingEditorState || this._editorState;
|
|
3694
|
+
if (this._rootElement = e, gs(this, t, e, i), t !== null && (this._config.disableEvents || bo(t), r != null && t.classList.remove(...r)), e !== null) {
|
|
3695
|
+
const s = Nr(e), o = e.style;
|
|
3696
|
+
o.userSelect = "text", o.whiteSpace = "pre-wrap", o.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = s, this._dirtyType = it, Fi(this), this._updateTags.add(zn), Se(this), this._config.disableEvents || function(l, a) {
|
|
3697
|
+
const c = l.ownerDocument, u = an.get(c);
|
|
3698
|
+
(u === void 0 || u < 1) && c.addEventListener("selectionchange", es), an.set(c, (u || 0) + 1), l.__lexicalEditor = a;
|
|
3699
|
+
const h = Zi(l);
|
|
3700
|
+
for (let f = 0; f < Zn.length; f++) {
|
|
3701
|
+
const [g, d] = Zn[f], _ = typeof d == "function" ? (p) => {
|
|
3702
|
+
Vr(p) || ($r(p), (a.isEditable() || g === "click") && d(p, a));
|
|
3706
3703
|
} : (p) => {
|
|
3707
|
-
if (
|
|
3708
|
-
|
|
3704
|
+
if (Vr(p)) return;
|
|
3705
|
+
$r(p);
|
|
3709
3706
|
const x = a.isEditable();
|
|
3710
3707
|
switch (g) {
|
|
3711
3708
|
case "cut":
|
|
3712
|
-
return x && E(a,
|
|
3709
|
+
return x && E(a, Vi, p);
|
|
3713
3710
|
case "copy":
|
|
3714
|
-
return E(a,
|
|
3711
|
+
return E(a, $i, p);
|
|
3715
3712
|
case "paste":
|
|
3716
|
-
return x && E(a,
|
|
3713
|
+
return x && E(a, Ji, p);
|
|
3717
3714
|
case "dragstart":
|
|
3718
|
-
return x && E(a,
|
|
3715
|
+
return x && E(a, xo, p);
|
|
3719
3716
|
case "dragover":
|
|
3720
|
-
return x && E(a,
|
|
3717
|
+
return x && E(a, Co, p);
|
|
3721
3718
|
case "dragend":
|
|
3722
|
-
return x && E(a,
|
|
3719
|
+
return x && E(a, So, p);
|
|
3723
3720
|
case "focus":
|
|
3724
|
-
return x && E(a,
|
|
3721
|
+
return x && E(a, vo, p);
|
|
3725
3722
|
case "blur":
|
|
3726
|
-
return x && E(a,
|
|
3723
|
+
return x && E(a, ko, p);
|
|
3727
3724
|
case "drop":
|
|
3728
|
-
return x && E(a,
|
|
3725
|
+
return x && E(a, mo, p);
|
|
3729
3726
|
}
|
|
3730
3727
|
};
|
|
3731
3728
|
l.addEventListener(g, _), h.push(() => {
|
|
@@ -3733,8 +3730,8 @@ class Sn {
|
|
|
3733
3730
|
});
|
|
3734
3731
|
}
|
|
3735
3732
|
}(e, this), r != null && e.classList.add(...r);
|
|
3736
|
-
} else this._window = null, this._updateTags.add(
|
|
3737
|
-
|
|
3733
|
+
} else this._window = null, this._updateTags.add(zn), Se(this);
|
|
3734
|
+
mt("root", this, !1, e, t);
|
|
3738
3735
|
}
|
|
3739
3736
|
}
|
|
3740
3737
|
getElementByKey(e) {
|
|
@@ -3746,17 +3743,17 @@ class Sn {
|
|
|
3746
3743
|
setEditorState(e, t) {
|
|
3747
3744
|
e.isEmpty() && T(38);
|
|
3748
3745
|
let r = e;
|
|
3749
|
-
r._readOnly && (r =
|
|
3746
|
+
r._readOnly && (r = ds(e), r._selection = e._selection ? e._selection.clone() : null), Pi(this);
|
|
3750
3747
|
const i = this._pendingEditorState, s = this._updateTags, o = t !== void 0 ? t.tag : null;
|
|
3751
|
-
i === null || i.isEmpty() || (o != null && s.add(o),
|
|
3748
|
+
i === null || i.isEmpty() || (o != null && s.add(o), Se(this)), this._pendingEditorState = r, this._dirtyType = it, this._dirtyElements.set("root", !1), this._compositionKey = null, o != null && s.add(o), this._updating || Se(this);
|
|
3752
3749
|
}
|
|
3753
3750
|
parseEditorState(e, t) {
|
|
3754
3751
|
return function(r, i, s) {
|
|
3755
|
-
const o =
|
|
3752
|
+
const o = xr(), l = U, a = Z, c = j, u = i._dirtyElements, h = i._dirtyLeaves, f = i._cloneNotNeeded, g = i._dirtyType;
|
|
3756
3753
|
i._dirtyElements = /* @__PURE__ */ new Map(), i._dirtyLeaves = /* @__PURE__ */ new Set(), i._cloneNotNeeded = /* @__PURE__ */ new Set(), i._dirtyType = 0, U = o, Z = !1, j = i;
|
|
3757
3754
|
try {
|
|
3758
3755
|
const d = i._nodes;
|
|
3759
|
-
|
|
3756
|
+
yr(r.root, d), s && s(), o._readOnly = !0;
|
|
3760
3757
|
} catch (d) {
|
|
3761
3758
|
d instanceof Error && i._onError(d);
|
|
3762
3759
|
} finally {
|
|
@@ -3766,18 +3763,18 @@ class Sn {
|
|
|
3766
3763
|
}(typeof e == "string" ? JSON.parse(e) : e, this, t);
|
|
3767
3764
|
}
|
|
3768
3765
|
read(e) {
|
|
3769
|
-
return
|
|
3766
|
+
return Se(this), this.getEditorState().read(e, { editor: this });
|
|
3770
3767
|
}
|
|
3771
3768
|
update(e, t) {
|
|
3772
3769
|
(function(r, i, s) {
|
|
3773
|
-
r._updating ? r._updates.push([i, s]) :
|
|
3770
|
+
r._updating ? r._updates.push([i, s]) : mr(r, i, s);
|
|
3774
3771
|
})(this, e, t);
|
|
3775
3772
|
}
|
|
3776
3773
|
focus(e, t = {}) {
|
|
3777
3774
|
const r = this._rootElement;
|
|
3778
3775
|
r !== null && (r.setAttribute("autocapitalize", "off"), te(this, () => {
|
|
3779
3776
|
const i = L(), s = re();
|
|
3780
|
-
i !== null ? i.dirty || ie(i.clone()) : s.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? s.selectStart() : s.selectEnd()),
|
|
3777
|
+
i !== null ? i.dirty || ie(i.clone()) : s.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? s.selectStart() : s.selectEnd()), qo("focus"), Go(() => {
|
|
3781
3778
|
r.removeAttribute("autocapitalize"), e && e();
|
|
3782
3779
|
});
|
|
3783
3780
|
}), this._pendingEditorState === null && r.removeAttribute("autocapitalize"));
|
|
@@ -3785,101 +3782,101 @@ class Sn {
|
|
|
3785
3782
|
blur() {
|
|
3786
3783
|
const e = this._rootElement;
|
|
3787
3784
|
e !== null && e.blur();
|
|
3788
|
-
const t =
|
|
3785
|
+
const t = ke(this._window);
|
|
3789
3786
|
t !== null && t.removeAllRanges();
|
|
3790
3787
|
}
|
|
3791
3788
|
isEditable() {
|
|
3792
3789
|
return this._editable;
|
|
3793
3790
|
}
|
|
3794
3791
|
setEditable(e) {
|
|
3795
|
-
this._editable !== e && (this._editable = e,
|
|
3792
|
+
this._editable !== e && (this._editable = e, mt("editable", this, !0, e));
|
|
3796
3793
|
}
|
|
3797
3794
|
toJSON() {
|
|
3798
3795
|
return { editorState: this._editorState.toJSON() };
|
|
3799
3796
|
}
|
|
3800
3797
|
}
|
|
3801
|
-
|
|
3802
|
-
let
|
|
3803
|
-
const
|
|
3798
|
+
Cn.version = "0.32.1+prod.esm";
|
|
3799
|
+
let jo = 1;
|
|
3800
|
+
const $o = typeof queueMicrotask == "function" ? queueMicrotask : (n) => {
|
|
3804
3801
|
Promise.resolve().then(n);
|
|
3805
3802
|
};
|
|
3806
|
-
function
|
|
3807
|
-
return z(
|
|
3803
|
+
function hi(n) {
|
|
3804
|
+
return z(Sr(n));
|
|
3808
3805
|
}
|
|
3809
|
-
function
|
|
3806
|
+
function _s(n) {
|
|
3810
3807
|
const e = document.activeElement;
|
|
3811
3808
|
if (!ee(e)) return !1;
|
|
3812
3809
|
const t = e.nodeName;
|
|
3813
|
-
return z(
|
|
3810
|
+
return z(Sr(n)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" && vn(e) == null);
|
|
3814
3811
|
}
|
|
3815
|
-
function
|
|
3812
|
+
function Sn(n, e, t) {
|
|
3816
3813
|
const r = n.getRootElement();
|
|
3817
3814
|
try {
|
|
3818
|
-
return r !== null && r.contains(e) && r.contains(t) && e !== null && !
|
|
3815
|
+
return r !== null && r.contains(e) && r.contains(t) && e !== null && !_s(e) && ps(e) === n;
|
|
3819
3816
|
} catch {
|
|
3820
3817
|
return !1;
|
|
3821
3818
|
}
|
|
3822
3819
|
}
|
|
3823
|
-
function
|
|
3824
|
-
return n instanceof
|
|
3820
|
+
function Cr(n) {
|
|
3821
|
+
return n instanceof Cn;
|
|
3825
3822
|
}
|
|
3826
|
-
function
|
|
3823
|
+
function ps(n) {
|
|
3827
3824
|
let e = n;
|
|
3828
3825
|
for (; e != null; ) {
|
|
3829
|
-
const t =
|
|
3830
|
-
if (
|
|
3831
|
-
e =
|
|
3826
|
+
const t = vn(e);
|
|
3827
|
+
if (Cr(t)) return t;
|
|
3828
|
+
e = Dt(e);
|
|
3832
3829
|
}
|
|
3833
3830
|
return null;
|
|
3834
3831
|
}
|
|
3835
|
-
function
|
|
3832
|
+
function vn(n) {
|
|
3836
3833
|
return n ? n.__lexicalEditor : null;
|
|
3837
3834
|
}
|
|
3838
|
-
function
|
|
3839
|
-
return
|
|
3835
|
+
function ze(n) {
|
|
3836
|
+
return rs(n) || n.isToken();
|
|
3840
3837
|
}
|
|
3841
|
-
function
|
|
3842
|
-
return
|
|
3838
|
+
function Ne(n) {
|
|
3839
|
+
return ze(n) || n.isSegmented();
|
|
3843
3840
|
}
|
|
3844
|
-
function
|
|
3845
|
-
return
|
|
3841
|
+
function Te(n) {
|
|
3842
|
+
return Pt(n) && n.nodeType === Fs;
|
|
3846
3843
|
}
|
|
3847
|
-
function
|
|
3848
|
-
return
|
|
3844
|
+
function Vo(n) {
|
|
3845
|
+
return Pt(n) && n.nodeType === Ls;
|
|
3849
3846
|
}
|
|
3850
|
-
function
|
|
3847
|
+
function st(n) {
|
|
3851
3848
|
let e = n;
|
|
3852
3849
|
for (; e != null; ) {
|
|
3853
|
-
if (
|
|
3850
|
+
if (Te(e)) return e;
|
|
3854
3851
|
e = e.firstChild;
|
|
3855
3852
|
}
|
|
3856
3853
|
return null;
|
|
3857
3854
|
}
|
|
3858
|
-
function
|
|
3859
|
-
const r =
|
|
3855
|
+
function fn(n, e, t) {
|
|
3856
|
+
const r = Je[e];
|
|
3860
3857
|
if (t !== null && (n & r) == (t & r)) return n;
|
|
3861
3858
|
let i = n ^ r;
|
|
3862
3859
|
return e === "subscript" ? i &= -65 : e === "superscript" ? i &= -33 : e === "lowercase" ? (i &= -513, i &= -1025) : e === "uppercase" ? (i &= -257, i &= -1025) : e === "capitalize" && (i &= -257, i &= -513), i;
|
|
3863
3860
|
}
|
|
3864
|
-
function
|
|
3865
|
-
return M(n) ||
|
|
3861
|
+
function Ul(n) {
|
|
3862
|
+
return M(n) || tt(n) || z(n);
|
|
3866
3863
|
}
|
|
3867
|
-
function
|
|
3864
|
+
function ys(n, e) {
|
|
3868
3865
|
if (e != null) return void (n.__key = e);
|
|
3869
|
-
G(),
|
|
3870
|
-
const t = R(), r =
|
|
3871
|
-
r._nodeMap.set(i, n), v(n) ? t._dirtyElements.set(i, !0) : t._dirtyLeaves.add(i), t._cloneNotNeeded.add(i), t._dirtyType =
|
|
3866
|
+
G(), cs();
|
|
3867
|
+
const t = R(), r = Pe(), i = "" + jo++;
|
|
3868
|
+
r._nodeMap.set(i, n), v(n) ? t._dirtyElements.set(i, !0) : t._dirtyLeaves.add(i), t._cloneNotNeeded.add(i), t._dirtyType = Ei, n.__key = i;
|
|
3872
3869
|
}
|
|
3873
|
-
function
|
|
3870
|
+
function Be(n) {
|
|
3874
3871
|
const e = n.getParent();
|
|
3875
3872
|
if (e !== null) {
|
|
3876
3873
|
const t = n.getWritable(), r = e.getWritable(), i = n.getPreviousSibling(), s = n.getNextSibling(), o = s !== null ? s.__key : null, l = i !== null ? i.__key : null, a = i !== null ? i.getWritable() : null, c = s !== null ? s.getWritable() : null;
|
|
3877
3874
|
i === null && (r.__first = o), s === null && (r.__last = l), a !== null && (a.__next = o), c !== null && (c.__prev = l), t.__prev = null, t.__next = null, t.__parent = null, r.__size--;
|
|
3878
3875
|
}
|
|
3879
3876
|
}
|
|
3880
|
-
function
|
|
3881
|
-
|
|
3882
|
-
const e = n.getLatest(), t = e.__parent, r =
|
|
3877
|
+
function dn(n) {
|
|
3878
|
+
cs();
|
|
3879
|
+
const e = n.getLatest(), t = e.__parent, r = Pe(), i = R(), s = r._nodeMap, o = i._dirtyElements;
|
|
3883
3880
|
t !== null && function(a, c, u) {
|
|
3884
3881
|
let h = a;
|
|
3885
3882
|
for (; h !== null; ) {
|
|
@@ -3890,7 +3887,7 @@ function hn(n) {
|
|
|
3890
3887
|
}
|
|
3891
3888
|
}(t, s, o);
|
|
3892
3889
|
const l = e.__key;
|
|
3893
|
-
i._dirtyType =
|
|
3890
|
+
i._dirtyType = Ei, v(n) ? o.set(l, !0) : i._dirtyLeaves.add(l);
|
|
3894
3891
|
}
|
|
3895
3892
|
function H(n) {
|
|
3896
3893
|
G();
|
|
@@ -3906,104 +3903,104 @@ function H(n) {
|
|
|
3906
3903
|
}
|
|
3907
3904
|
}
|
|
3908
3905
|
}
|
|
3909
|
-
function
|
|
3910
|
-
return
|
|
3906
|
+
function Ee() {
|
|
3907
|
+
return Mt() ? null : R()._compositionKey;
|
|
3911
3908
|
}
|
|
3912
3909
|
function $(n, e) {
|
|
3913
|
-
const t = (e ||
|
|
3910
|
+
const t = (e || Pe())._nodeMap.get(n);
|
|
3914
3911
|
return t === void 0 ? null : t;
|
|
3915
3912
|
}
|
|
3916
|
-
function
|
|
3917
|
-
const t =
|
|
3913
|
+
function ms(n, e) {
|
|
3914
|
+
const t = kn(n, R());
|
|
3918
3915
|
return t !== void 0 ? $(t, e) : null;
|
|
3919
3916
|
}
|
|
3920
|
-
function
|
|
3917
|
+
function kn(n, e) {
|
|
3921
3918
|
return n[`__lexicalKey_${e._key}`];
|
|
3922
3919
|
}
|
|
3923
|
-
function
|
|
3920
|
+
function Sr(n, e) {
|
|
3924
3921
|
let t = n;
|
|
3925
3922
|
for (; t != null; ) {
|
|
3926
|
-
const r =
|
|
3923
|
+
const r = ms(t, e);
|
|
3927
3924
|
if (r !== null) return r;
|
|
3928
|
-
t =
|
|
3925
|
+
t = Dt(t);
|
|
3929
3926
|
}
|
|
3930
3927
|
return null;
|
|
3931
3928
|
}
|
|
3932
|
-
function
|
|
3929
|
+
function xs(n) {
|
|
3933
3930
|
const e = n._decorators, t = Object.assign({}, e);
|
|
3934
3931
|
return n._pendingDecorators = t, t;
|
|
3935
3932
|
}
|
|
3936
|
-
function
|
|
3933
|
+
function gi(n) {
|
|
3937
3934
|
return n.read(() => re().getTextContent());
|
|
3938
3935
|
}
|
|
3939
3936
|
function re() {
|
|
3940
|
-
return
|
|
3937
|
+
return Cs(Pe());
|
|
3941
3938
|
}
|
|
3942
|
-
function
|
|
3939
|
+
function Cs(n) {
|
|
3943
3940
|
return n._nodeMap.get("root");
|
|
3944
3941
|
}
|
|
3945
3942
|
function ie(n) {
|
|
3946
3943
|
G();
|
|
3947
|
-
const e =
|
|
3944
|
+
const e = Pe();
|
|
3948
3945
|
n !== null && (n.dirty = !0, n.setCachedNodes(null)), e._selection = n;
|
|
3949
3946
|
}
|
|
3950
|
-
function
|
|
3947
|
+
function Ze(n) {
|
|
3951
3948
|
const e = R(), t = function(r, i) {
|
|
3952
3949
|
let s = r;
|
|
3953
3950
|
for (; s != null; ) {
|
|
3954
|
-
const o =
|
|
3951
|
+
const o = kn(s, i);
|
|
3955
3952
|
if (o !== void 0) return o;
|
|
3956
|
-
s =
|
|
3953
|
+
s = Dt(s);
|
|
3957
3954
|
}
|
|
3958
3955
|
return null;
|
|
3959
3956
|
}(n, e);
|
|
3960
3957
|
return t === null ? n === e.getRootElement() ? $("root") : null : $(t);
|
|
3961
3958
|
}
|
|
3962
|
-
function
|
|
3959
|
+
function _i(n, e) {
|
|
3963
3960
|
return e ? n.getTextContentSize() : 0;
|
|
3964
3961
|
}
|
|
3965
|
-
function
|
|
3962
|
+
function Ss(n) {
|
|
3966
3963
|
return /[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n);
|
|
3967
3964
|
}
|
|
3968
|
-
function
|
|
3965
|
+
function vr(n) {
|
|
3969
3966
|
const e = [];
|
|
3970
3967
|
let t = n;
|
|
3971
3968
|
for (; t !== null; ) e.push(t), t = t._parentEditor;
|
|
3972
3969
|
return e;
|
|
3973
3970
|
}
|
|
3974
|
-
function
|
|
3971
|
+
function vs() {
|
|
3975
3972
|
return Math.random().toString(36).replace(/[^a-z]+/g, "").substring(0, 5);
|
|
3976
3973
|
}
|
|
3977
|
-
function
|
|
3978
|
-
return
|
|
3974
|
+
function ks(n) {
|
|
3975
|
+
return Te(n) ? n.nodeValue : null;
|
|
3979
3976
|
}
|
|
3980
|
-
function
|
|
3981
|
-
const r =
|
|
3977
|
+
function kr(n, e, t) {
|
|
3978
|
+
const r = ke(se(e));
|
|
3982
3979
|
if (r === null) return;
|
|
3983
3980
|
const i = r.anchorNode;
|
|
3984
3981
|
let { anchorOffset: s, focusOffset: o } = r;
|
|
3985
3982
|
if (i !== null) {
|
|
3986
|
-
let l =
|
|
3987
|
-
const a =
|
|
3983
|
+
let l = ks(i);
|
|
3984
|
+
const a = Sr(i);
|
|
3988
3985
|
if (l !== null && M(a)) {
|
|
3989
|
-
if (l ===
|
|
3986
|
+
if (l === hn && t) {
|
|
3990
3987
|
const c = t.length;
|
|
3991
3988
|
l = t, s = c, o = c;
|
|
3992
3989
|
}
|
|
3993
|
-
l !== null &&
|
|
3990
|
+
l !== null && Tr(a, l, s, o, n);
|
|
3994
3991
|
}
|
|
3995
3992
|
}
|
|
3996
3993
|
}
|
|
3997
|
-
function
|
|
3994
|
+
function Tr(n, e, t, r, i) {
|
|
3998
3995
|
let s = n;
|
|
3999
3996
|
if (s.isAttached() && (i || !s.isDirty())) {
|
|
4000
3997
|
const o = s.isComposing();
|
|
4001
3998
|
let l = e;
|
|
4002
|
-
(o || i) && e[e.length - 1] ===
|
|
3999
|
+
(o || i) && e[e.length - 1] === hn && (l = e.slice(0, -1));
|
|
4003
4000
|
const a = s.getTextContent();
|
|
4004
4001
|
if (i || l !== a) {
|
|
4005
4002
|
if (l === "") {
|
|
4006
|
-
if (H(null),
|
|
4003
|
+
if (H(null), Ct || rt || Xt) s.remove();
|
|
4007
4004
|
else {
|
|
4008
4005
|
const _ = R();
|
|
4009
4006
|
setTimeout(() => {
|
|
@@ -4014,7 +4011,7 @@ function br(n, e, t, r, i) {
|
|
|
4014
4011
|
}
|
|
4015
4012
|
return;
|
|
4016
4013
|
}
|
|
4017
|
-
const c = s.getParent(), u =
|
|
4014
|
+
const c = s.getParent(), u = ut(), h = s.getTextContentSize(), f = Ee(), g = s.getKey();
|
|
4018
4015
|
if (s.isToken() || f !== null && g === f && !o || O(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 === h && !s.canInsertTextAfter() && !o)) return void s.markDirty();
|
|
4019
4016
|
const d = L();
|
|
4020
4017
|
if (!O(d) || t === null || r === null) return void s.setTextContent(l);
|
|
@@ -4026,46 +4023,46 @@ function br(n, e, t, r, i) {
|
|
|
4026
4023
|
}
|
|
4027
4024
|
}
|
|
4028
4025
|
}
|
|
4029
|
-
function
|
|
4026
|
+
function Jt(n, e, t) {
|
|
4030
4027
|
const r = e[t] || !1;
|
|
4031
4028
|
return r === "any" || r === n[t];
|
|
4032
4029
|
}
|
|
4033
|
-
function
|
|
4034
|
-
return
|
|
4030
|
+
function Yo(n, e) {
|
|
4031
|
+
return Jt(n, e, "altKey") && Jt(n, e, "ctrlKey") && Jt(n, e, "shiftKey") && Jt(n, e, "metaKey");
|
|
4035
4032
|
}
|
|
4036
4033
|
function I(n, e, t) {
|
|
4037
|
-
return
|
|
4034
|
+
return Yo(n, t) && n.key.toLowerCase() === e.toLowerCase();
|
|
4038
4035
|
}
|
|
4039
|
-
const
|
|
4040
|
-
function
|
|
4036
|
+
const xe = { ctrlKey: !ue, metaKey: ue }, pi = { altKey: ue, ctrlKey: !ue };
|
|
4037
|
+
function yi(n) {
|
|
4041
4038
|
return n.key === "Backspace";
|
|
4042
4039
|
}
|
|
4043
|
-
function
|
|
4044
|
-
return I(n, "a",
|
|
4040
|
+
function mi(n) {
|
|
4041
|
+
return I(n, "a", xe);
|
|
4045
4042
|
}
|
|
4046
|
-
function
|
|
4043
|
+
function jl(n) {
|
|
4047
4044
|
const e = re();
|
|
4048
4045
|
if (O(n)) {
|
|
4049
4046
|
const t = n.anchor, r = n.focus, i = t.getNode().getTopLevelElementOrThrow().getParentOrThrow();
|
|
4050
|
-
return t.set(i.getKey(), 0, "element"), r.set(i.getKey(), i.getChildrenSize(), "element"),
|
|
4047
|
+
return t.set(i.getKey(), 0, "element"), r.set(i.getKey(), i.getChildrenSize(), "element"), jn(n), n;
|
|
4051
4048
|
}
|
|
4052
4049
|
{
|
|
4053
4050
|
const t = e.select(0, e.getChildrenSize());
|
|
4054
|
-
return ie(
|
|
4051
|
+
return ie(jn(t)), t;
|
|
4055
4052
|
}
|
|
4056
4053
|
}
|
|
4057
|
-
function
|
|
4054
|
+
function nt(n, e) {
|
|
4058
4055
|
n.__lexicalClassNameCache === void 0 && (n.__lexicalClassNameCache = {});
|
|
4059
4056
|
const t = n.__lexicalClassNameCache, r = t[e];
|
|
4060
4057
|
if (r !== void 0) return r;
|
|
4061
4058
|
const i = n[e];
|
|
4062
4059
|
if (typeof i == "string") {
|
|
4063
|
-
const s =
|
|
4060
|
+
const s = Qt(i);
|
|
4064
4061
|
return t[e] = s, s;
|
|
4065
4062
|
}
|
|
4066
4063
|
return i;
|
|
4067
4064
|
}
|
|
4068
|
-
function
|
|
4065
|
+
function br(n, e, t, r, i) {
|
|
4069
4066
|
if (t.size === 0) return;
|
|
4070
4067
|
const s = r.__type, o = r.__key, l = e.get(s);
|
|
4071
4068
|
l === void 0 && T(33, s);
|
|
@@ -4075,31 +4072,31 @@ function Nr(n, e, t, r, i) {
|
|
|
4075
4072
|
const u = c.get(o), h = u === "destroyed" && i === "created";
|
|
4076
4073
|
(u === void 0 || h) && c.set(o, h ? "updated" : i);
|
|
4077
4074
|
}
|
|
4078
|
-
function
|
|
4075
|
+
function xi(n, e, t) {
|
|
4079
4076
|
const r = n.getParent();
|
|
4080
4077
|
let i = t, s = n;
|
|
4081
4078
|
return r !== null && (e && t === 0 ? (i = s.getIndexWithinParent(), s = r) : e || t !== s.getChildrenSize() || (i = s.getIndexWithinParent() + 1, s = r)), s.getChildAtIndex(e ? i - 1 : i);
|
|
4082
4079
|
}
|
|
4083
|
-
function
|
|
4080
|
+
function Ho(n, e) {
|
|
4084
4081
|
const t = n.offset;
|
|
4085
4082
|
if (n.type === "element")
|
|
4086
|
-
return
|
|
4083
|
+
return xi(n.getNode(), e, t);
|
|
4087
4084
|
{
|
|
4088
4085
|
const r = n.getNode();
|
|
4089
4086
|
if (e && t === 0 || !e && t === r.getTextContentSize()) {
|
|
4090
4087
|
const i = e ? r.getPreviousSibling() : r.getNextSibling();
|
|
4091
|
-
return i === null ?
|
|
4088
|
+
return i === null ? xi(r.getParentOrThrow(), e, r.getIndexWithinParent() + (e ? 0 : 1)) : i;
|
|
4092
4089
|
}
|
|
4093
4090
|
}
|
|
4094
4091
|
return null;
|
|
4095
4092
|
}
|
|
4096
|
-
function
|
|
4097
|
-
const e =
|
|
4093
|
+
function Ts(n) {
|
|
4094
|
+
const e = se(n).event, t = e && e.inputType;
|
|
4098
4095
|
return t === "insertFromPaste" || t === "insertFromPasteAsQuotation";
|
|
4099
4096
|
}
|
|
4100
4097
|
function E(n, e, t) {
|
|
4101
4098
|
return function(r, i, s) {
|
|
4102
|
-
const o =
|
|
4099
|
+
const o = vr(r);
|
|
4103
4100
|
for (let l = 4; l >= 0; l--) for (let a = 0; a < o.length; a++) {
|
|
4104
4101
|
const c = o[a], u = c._commands.get(i);
|
|
4105
4102
|
if (u !== void 0) {
|
|
@@ -4116,27 +4113,27 @@ function E(n, e, t) {
|
|
|
4116
4113
|
return !1;
|
|
4117
4114
|
}(n, e, t);
|
|
4118
4115
|
}
|
|
4119
|
-
function
|
|
4116
|
+
function Tn(n) {
|
|
4120
4117
|
return !ne(n) && !n.isLastChild() && !n.isInline();
|
|
4121
4118
|
}
|
|
4122
|
-
function
|
|
4119
|
+
function ot(n, e) {
|
|
4123
4120
|
const t = n._keyToDOMMap.get(e);
|
|
4124
4121
|
return t === void 0 && T(75, e), t;
|
|
4125
4122
|
}
|
|
4126
|
-
function
|
|
4123
|
+
function Dt(n) {
|
|
4127
4124
|
const e = n.assignedSlot || n.parentElement;
|
|
4128
|
-
return
|
|
4125
|
+
return tl(e) ? e.host : e;
|
|
4129
4126
|
}
|
|
4130
|
-
function
|
|
4131
|
-
return
|
|
4127
|
+
function bs(n) {
|
|
4128
|
+
return Vo(n) ? n : ee(n) ? n.ownerDocument : null;
|
|
4132
4129
|
}
|
|
4133
|
-
function
|
|
4130
|
+
function qo(n) {
|
|
4134
4131
|
G(), R()._updateTags.add(n);
|
|
4135
4132
|
}
|
|
4136
|
-
function
|
|
4133
|
+
function Go(n) {
|
|
4137
4134
|
G(), R()._deferred.push(n);
|
|
4138
4135
|
}
|
|
4139
|
-
function
|
|
4136
|
+
function rr(n, e) {
|
|
4140
4137
|
let t = n.getParent();
|
|
4141
4138
|
for (; t !== null; ) {
|
|
4142
4139
|
if (t.is(e)) return !0;
|
|
@@ -4144,33 +4141,33 @@ function ir(n, e) {
|
|
|
4144
4141
|
}
|
|
4145
4142
|
return !1;
|
|
4146
4143
|
}
|
|
4147
|
-
function
|
|
4148
|
-
const e =
|
|
4144
|
+
function Nr(n) {
|
|
4145
|
+
const e = bs(n);
|
|
4149
4146
|
return e ? e.defaultView : null;
|
|
4150
4147
|
}
|
|
4151
|
-
function
|
|
4148
|
+
function se(n) {
|
|
4152
4149
|
const e = n._window;
|
|
4153
4150
|
return e === null && T(78), e;
|
|
4154
4151
|
}
|
|
4155
|
-
function
|
|
4152
|
+
function $l(n) {
|
|
4156
4153
|
return v(n) && n.isInline() || z(n) && n.isInline();
|
|
4157
4154
|
}
|
|
4158
|
-
function
|
|
4155
|
+
function Xo(n) {
|
|
4159
4156
|
let e = n.getParentOrThrow();
|
|
4160
4157
|
for (; e !== null; ) {
|
|
4161
|
-
if (
|
|
4158
|
+
if (Fe(e)) return e;
|
|
4162
4159
|
e = e.getParentOrThrow();
|
|
4163
4160
|
}
|
|
4164
4161
|
return e;
|
|
4165
4162
|
}
|
|
4166
|
-
function
|
|
4163
|
+
function Fe(n) {
|
|
4167
4164
|
return ne(n) || v(n) && n.isShadowRoot();
|
|
4168
4165
|
}
|
|
4169
|
-
function
|
|
4166
|
+
function Qo(n) {
|
|
4170
4167
|
const e = n.constructor.clone(n);
|
|
4171
|
-
return
|
|
4168
|
+
return ys(e, null), e;
|
|
4172
4169
|
}
|
|
4173
|
-
function
|
|
4170
|
+
function bn(n) {
|
|
4174
4171
|
const e = R(), t = n.constructor.getType(), r = e._nodes.get(t);
|
|
4175
4172
|
r === void 0 && T(200, n.constructor.name, t);
|
|
4176
4173
|
const { replace: i, replaceWithKlass: s } = r;
|
|
@@ -4180,67 +4177,67 @@ function Nn(n) {
|
|
|
4180
4177
|
}
|
|
4181
4178
|
return n;
|
|
4182
4179
|
}
|
|
4183
|
-
function
|
|
4180
|
+
function Bn(n, e) {
|
|
4184
4181
|
!ne(n.getParent()) || v(e) || z(e) || T(99);
|
|
4185
4182
|
}
|
|
4186
|
-
function
|
|
4183
|
+
function Zo(n) {
|
|
4187
4184
|
const e = $(n);
|
|
4188
4185
|
return e === null && T(63, n), e;
|
|
4189
4186
|
}
|
|
4190
|
-
function
|
|
4187
|
+
function Rn(n) {
|
|
4191
4188
|
return (z(n) || v(n) && !n.canBeEmpty()) && !n.isInline();
|
|
4192
4189
|
}
|
|
4193
|
-
function
|
|
4190
|
+
function ir(n, e, t) {
|
|
4194
4191
|
t.style.removeProperty("caret-color"), e._blockCursorElement = null;
|
|
4195
4192
|
const r = n.parentElement;
|
|
4196
4193
|
r !== null && r.removeChild(n);
|
|
4197
4194
|
}
|
|
4198
|
-
function
|
|
4199
|
-
return
|
|
4195
|
+
function ke(n) {
|
|
4196
|
+
return le ? (n || window).getSelection() : null;
|
|
4200
4197
|
}
|
|
4201
|
-
function
|
|
4202
|
-
const e =
|
|
4198
|
+
function el(n) {
|
|
4199
|
+
const e = Nr(n);
|
|
4203
4200
|
return e ? e.getSelection() : null;
|
|
4204
4201
|
}
|
|
4205
|
-
function
|
|
4202
|
+
function Vl(n) {
|
|
4206
4203
|
return ee(n) && n.tagName === "A";
|
|
4207
4204
|
}
|
|
4208
4205
|
function ee(n) {
|
|
4209
|
-
return
|
|
4206
|
+
return Pt(n) && n.nodeType === Ps;
|
|
4210
4207
|
}
|
|
4211
|
-
function
|
|
4208
|
+
function Pt(n) {
|
|
4212
4209
|
return typeof n == "object" && n !== null && "nodeType" in n && typeof n.nodeType == "number";
|
|
4213
4210
|
}
|
|
4214
|
-
function
|
|
4215
|
-
return
|
|
4211
|
+
function tl(n) {
|
|
4212
|
+
return Pt(n) && n.nodeType === Is;
|
|
4216
4213
|
}
|
|
4217
|
-
function
|
|
4214
|
+
function nl(n) {
|
|
4218
4215
|
const e = new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/, "i");
|
|
4219
4216
|
return n.nodeName.match(e) !== null;
|
|
4220
4217
|
}
|
|
4221
|
-
function
|
|
4218
|
+
function Ci(n) {
|
|
4222
4219
|
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");
|
|
4223
4220
|
return n.nodeName.match(e) !== null;
|
|
4224
4221
|
}
|
|
4225
|
-
function
|
|
4222
|
+
function we(n) {
|
|
4226
4223
|
if (z(n) && !n.isInline()) return !0;
|
|
4227
|
-
if (!v(n) ||
|
|
4228
|
-
const e = n.getFirstChild(), t = e === null ||
|
|
4224
|
+
if (!v(n) || Fe(n)) return !1;
|
|
4225
|
+
const e = n.getFirstChild(), t = e === null || tt(e) || M(e) || e.isInline();
|
|
4229
4226
|
return !n.isInline() && n.canBeEmpty() !== !1 && t;
|
|
4230
4227
|
}
|
|
4231
|
-
function
|
|
4228
|
+
function Wn(n, e) {
|
|
4232
4229
|
let t = n;
|
|
4233
4230
|
for (; t !== null && t.getParent() !== null && !e(t); ) t = t.getParentOrThrow();
|
|
4234
4231
|
return e(t) ? t : null;
|
|
4235
4232
|
}
|
|
4236
|
-
function
|
|
4233
|
+
function Yl() {
|
|
4237
4234
|
return R();
|
|
4238
4235
|
}
|
|
4239
|
-
const
|
|
4240
|
-
function
|
|
4241
|
-
if (!n._readOnly && n.isEmpty()) return
|
|
4236
|
+
const Si = /* @__PURE__ */ new WeakMap(), rl = /* @__PURE__ */ new Map();
|
|
4237
|
+
function vi(n) {
|
|
4238
|
+
if (!n._readOnly && n.isEmpty()) return rl;
|
|
4242
4239
|
n._readOnly || T(192);
|
|
4243
|
-
let e =
|
|
4240
|
+
let e = Si.get(n);
|
|
4244
4241
|
return e || (e = function(t) {
|
|
4245
4242
|
const r = /* @__PURE__ */ new Map();
|
|
4246
4243
|
for (const [i, s] of t._nodeMap) {
|
|
@@ -4249,29 +4246,29 @@ function ki(n) {
|
|
|
4249
4246
|
l || (l = /* @__PURE__ */ new Map(), r.set(o, l)), l.set(i, s);
|
|
4250
4247
|
}
|
|
4251
4248
|
return r;
|
|
4252
|
-
}(n),
|
|
4249
|
+
}(n), Si.set(n, e)), e;
|
|
4253
4250
|
}
|
|
4254
|
-
function
|
|
4251
|
+
function il(n) {
|
|
4255
4252
|
const e = n.constructor.clone(n);
|
|
4256
4253
|
return e.afterCloneFrom(n), e;
|
|
4257
4254
|
}
|
|
4258
|
-
function
|
|
4255
|
+
function sl(n, e) {
|
|
4259
4256
|
const t = parseInt(n.style.paddingInlineStart, 10) || 0, r = Math.round(t / 40);
|
|
4260
4257
|
e.setIndent(r);
|
|
4261
4258
|
}
|
|
4262
|
-
function
|
|
4259
|
+
function Hl(n) {
|
|
4263
4260
|
n.__lexicalUnmanaged = !0;
|
|
4264
4261
|
}
|
|
4265
|
-
function
|
|
4262
|
+
function ol(n) {
|
|
4266
4263
|
return n.__lexicalUnmanaged === !0;
|
|
4267
4264
|
}
|
|
4268
|
-
const
|
|
4269
|
-
class
|
|
4265
|
+
const ll = { next: "previous", previous: "next" };
|
|
4266
|
+
class wr {
|
|
4270
4267
|
constructor(e) {
|
|
4271
4268
|
this.origin = e;
|
|
4272
4269
|
}
|
|
4273
4270
|
[Symbol.iterator]() {
|
|
4274
|
-
return
|
|
4271
|
+
return ws({ hasNext: lt, initial: this.getAdjacentCaret(), map: (e) => e, step: (e) => e.getAdjacentCaret() });
|
|
4275
4272
|
}
|
|
4276
4273
|
getAdjacentCaret() {
|
|
4277
4274
|
return q(this.getNodeAtCaret(), this.direction);
|
|
@@ -4311,21 +4308,18 @@ class Er {
|
|
|
4311
4308
|
return this;
|
|
4312
4309
|
}
|
|
4313
4310
|
}
|
|
4314
|
-
class
|
|
4315
|
-
|
|
4316
|
-
super(...arguments);
|
|
4317
|
-
se(this, "type", "child");
|
|
4318
|
-
}
|
|
4311
|
+
class bt extends wr {
|
|
4312
|
+
type = "child";
|
|
4319
4313
|
getLatest() {
|
|
4320
|
-
const
|
|
4321
|
-
return
|
|
4314
|
+
const e = this.origin.getLatest();
|
|
4315
|
+
return e === this.origin ? this : De(e, this.direction);
|
|
4322
4316
|
}
|
|
4323
|
-
getParentCaret(
|
|
4324
|
-
return q(
|
|
4317
|
+
getParentCaret(e = "root") {
|
|
4318
|
+
return q(Er(this.getParentAtCaret(), e), this.direction);
|
|
4325
4319
|
}
|
|
4326
4320
|
getFlipped() {
|
|
4327
|
-
const
|
|
4328
|
-
return q(this.getNodeAtCaret(),
|
|
4321
|
+
const e = Xe(this.direction);
|
|
4322
|
+
return q(this.getNodeAtCaret(), e) || De(this.origin, e);
|
|
4329
4323
|
}
|
|
4330
4324
|
getParentAtCaret() {
|
|
4331
4325
|
return this.origin;
|
|
@@ -4333,28 +4327,25 @@ class Nt extends Er {
|
|
|
4333
4327
|
getChildCaret() {
|
|
4334
4328
|
return this;
|
|
4335
4329
|
}
|
|
4336
|
-
isSameNodeCaret(
|
|
4337
|
-
return
|
|
4330
|
+
isSameNodeCaret(e) {
|
|
4331
|
+
return e instanceof bt && this.direction === e.direction && this.origin.is(e.origin);
|
|
4338
4332
|
}
|
|
4339
|
-
isSamePointCaret(
|
|
4340
|
-
return this.isSameNodeCaret(
|
|
4333
|
+
isSamePointCaret(e) {
|
|
4334
|
+
return this.isSameNodeCaret(e);
|
|
4341
4335
|
}
|
|
4342
4336
|
}
|
|
4343
|
-
const
|
|
4344
|
-
function
|
|
4345
|
-
return
|
|
4337
|
+
const al = { root: ne, shadowRoot: Fe };
|
|
4338
|
+
function Xe(n) {
|
|
4339
|
+
return ll[n];
|
|
4346
4340
|
}
|
|
4347
|
-
function
|
|
4348
|
-
return
|
|
4341
|
+
function Er(n, e = "root") {
|
|
4342
|
+
return al[e](n) ? null : n;
|
|
4349
4343
|
}
|
|
4350
|
-
class
|
|
4351
|
-
|
|
4352
|
-
super(...arguments);
|
|
4353
|
-
se(this, "type", "sibling");
|
|
4354
|
-
}
|
|
4344
|
+
class je extends wr {
|
|
4345
|
+
type = "sibling";
|
|
4355
4346
|
getLatest() {
|
|
4356
|
-
const
|
|
4357
|
-
return
|
|
4347
|
+
const e = this.origin.getLatest();
|
|
4348
|
+
return e === this.origin ? this : q(e, this.direction);
|
|
4358
4349
|
}
|
|
4359
4350
|
getSiblingCaret() {
|
|
4360
4351
|
return this;
|
|
@@ -4363,31 +4354,30 @@ class $e extends Er {
|
|
|
4363
4354
|
return this.origin.getParent();
|
|
4364
4355
|
}
|
|
4365
4356
|
getChildCaret() {
|
|
4366
|
-
return v(this.origin) ?
|
|
4357
|
+
return v(this.origin) ? De(this.origin, this.direction) : null;
|
|
4367
4358
|
}
|
|
4368
|
-
getParentCaret(
|
|
4369
|
-
return q(
|
|
4359
|
+
getParentCaret(e = "root") {
|
|
4360
|
+
return q(Er(this.getParentAtCaret(), e), this.direction);
|
|
4370
4361
|
}
|
|
4371
4362
|
getFlipped() {
|
|
4372
|
-
const
|
|
4373
|
-
return q(this.getNodeAtCaret(),
|
|
4363
|
+
const e = Xe(this.direction);
|
|
4364
|
+
return q(this.getNodeAtCaret(), e) || De(this.origin.getParentOrThrow(), e);
|
|
4374
4365
|
}
|
|
4375
|
-
isSamePointCaret(
|
|
4376
|
-
return
|
|
4366
|
+
isSamePointCaret(e) {
|
|
4367
|
+
return e instanceof je && this.direction === e.direction && this.origin.is(e.origin);
|
|
4377
4368
|
}
|
|
4378
|
-
isSameNodeCaret(
|
|
4379
|
-
return (
|
|
4369
|
+
isSameNodeCaret(e) {
|
|
4370
|
+
return (e instanceof je || e instanceof $e) && this.direction === e.direction && this.origin.is(e.origin);
|
|
4380
4371
|
}
|
|
4381
4372
|
}
|
|
4382
|
-
class
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
this.offset = r;
|
|
4373
|
+
class $e extends wr {
|
|
4374
|
+
type = "text";
|
|
4375
|
+
constructor(e, t) {
|
|
4376
|
+
super(e), this.offset = t;
|
|
4387
4377
|
}
|
|
4388
4378
|
getLatest() {
|
|
4389
|
-
const
|
|
4390
|
-
return
|
|
4379
|
+
const e = this.origin.getLatest();
|
|
4380
|
+
return e === this.origin ? this : Ve(e, this.direction, this.offset);
|
|
4391
4381
|
}
|
|
4392
4382
|
getParentAtCaret() {
|
|
4393
4383
|
return this.origin.getParent();
|
|
@@ -4395,105 +4385,87 @@ class Ve extends Er {
|
|
|
4395
4385
|
getChildCaret() {
|
|
4396
4386
|
return null;
|
|
4397
4387
|
}
|
|
4398
|
-
getParentCaret(
|
|
4399
|
-
return q(
|
|
4388
|
+
getParentCaret(e = "root") {
|
|
4389
|
+
return q(Er(this.getParentAtCaret(), e), this.direction);
|
|
4400
4390
|
}
|
|
4401
4391
|
getFlipped() {
|
|
4402
|
-
return
|
|
4392
|
+
return Ve(this.origin, Xe(this.direction), this.offset);
|
|
4403
4393
|
}
|
|
4404
|
-
isSamePointCaret(
|
|
4405
|
-
return
|
|
4394
|
+
isSamePointCaret(e) {
|
|
4395
|
+
return e instanceof $e && this.direction === e.direction && this.origin.is(e.origin) && this.offset === e.offset;
|
|
4406
4396
|
}
|
|
4407
|
-
isSameNodeCaret(
|
|
4408
|
-
return (
|
|
4397
|
+
isSameNodeCaret(e) {
|
|
4398
|
+
return (e instanceof je || e instanceof $e) && this.direction === e.direction && this.origin.is(e.origin);
|
|
4409
4399
|
}
|
|
4410
4400
|
getSiblingCaret() {
|
|
4411
4401
|
return q(this.origin, this.direction);
|
|
4412
4402
|
}
|
|
4413
4403
|
}
|
|
4414
|
-
function
|
|
4415
|
-
return n instanceof Ve;
|
|
4416
|
-
}
|
|
4417
|
-
function at(n) {
|
|
4404
|
+
function Ae(n) {
|
|
4418
4405
|
return n instanceof $e;
|
|
4419
4406
|
}
|
|
4420
|
-
function
|
|
4421
|
-
return n instanceof
|
|
4407
|
+
function lt(n) {
|
|
4408
|
+
return n instanceof je;
|
|
4422
4409
|
}
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4410
|
+
function de(n) {
|
|
4411
|
+
return n instanceof bt;
|
|
4412
|
+
}
|
|
4413
|
+
const cl = { next: class extends $e {
|
|
4414
|
+
direction = "next";
|
|
4428
4415
|
getNodeAtCaret() {
|
|
4429
4416
|
return this.origin.getNextSibling();
|
|
4430
4417
|
}
|
|
4431
|
-
insert(
|
|
4432
|
-
return this.origin.insertAfter(
|
|
4433
|
-
}
|
|
4434
|
-
}, previous: class extends Ve {
|
|
4435
|
-
constructor() {
|
|
4436
|
-
super(...arguments);
|
|
4437
|
-
se(this, "direction", "previous");
|
|
4418
|
+
insert(n) {
|
|
4419
|
+
return this.origin.insertAfter(n), this;
|
|
4438
4420
|
}
|
|
4421
|
+
}, previous: class extends $e {
|
|
4422
|
+
direction = "previous";
|
|
4439
4423
|
getNodeAtCaret() {
|
|
4440
4424
|
return this.origin.getPreviousSibling();
|
|
4441
4425
|
}
|
|
4442
|
-
insert(
|
|
4443
|
-
return this.origin.insertBefore(
|
|
4444
|
-
}
|
|
4445
|
-
} }, hl = { next: class extends $e {
|
|
4446
|
-
constructor() {
|
|
4447
|
-
super(...arguments);
|
|
4448
|
-
se(this, "direction", "next");
|
|
4426
|
+
insert(n) {
|
|
4427
|
+
return this.origin.insertBefore(n), this;
|
|
4449
4428
|
}
|
|
4429
|
+
} }, ul = { next: class extends je {
|
|
4430
|
+
direction = "next";
|
|
4450
4431
|
getNodeAtCaret() {
|
|
4451
4432
|
return this.origin.getNextSibling();
|
|
4452
4433
|
}
|
|
4453
|
-
insert(
|
|
4454
|
-
return this.origin.insertAfter(
|
|
4455
|
-
}
|
|
4456
|
-
}, previous: class extends $e {
|
|
4457
|
-
constructor() {
|
|
4458
|
-
super(...arguments);
|
|
4459
|
-
se(this, "direction", "previous");
|
|
4434
|
+
insert(n) {
|
|
4435
|
+
return this.origin.insertAfter(n), this;
|
|
4460
4436
|
}
|
|
4437
|
+
}, previous: class extends je {
|
|
4438
|
+
direction = "previous";
|
|
4461
4439
|
getNodeAtCaret() {
|
|
4462
4440
|
return this.origin.getPreviousSibling();
|
|
4463
4441
|
}
|
|
4464
|
-
insert(
|
|
4465
|
-
return this.origin.insertBefore(
|
|
4466
|
-
}
|
|
4467
|
-
} }, gl = { next: class extends Nt {
|
|
4468
|
-
constructor() {
|
|
4469
|
-
super(...arguments);
|
|
4470
|
-
se(this, "direction", "next");
|
|
4442
|
+
insert(n) {
|
|
4443
|
+
return this.origin.insertBefore(n), this;
|
|
4471
4444
|
}
|
|
4445
|
+
} }, fl = { next: class extends bt {
|
|
4446
|
+
direction = "next";
|
|
4472
4447
|
getNodeAtCaret() {
|
|
4473
4448
|
return this.origin.getFirstChild();
|
|
4474
4449
|
}
|
|
4475
|
-
insert(
|
|
4476
|
-
return this.origin.splice(0, 0, [
|
|
4477
|
-
}
|
|
4478
|
-
}, previous: class extends Nt {
|
|
4479
|
-
constructor() {
|
|
4480
|
-
super(...arguments);
|
|
4481
|
-
se(this, "direction", "previous");
|
|
4450
|
+
insert(n) {
|
|
4451
|
+
return this.origin.splice(0, 0, [n]), this;
|
|
4482
4452
|
}
|
|
4453
|
+
}, previous: class extends bt {
|
|
4454
|
+
direction = "previous";
|
|
4483
4455
|
getNodeAtCaret() {
|
|
4484
4456
|
return this.origin.getLastChild();
|
|
4485
4457
|
}
|
|
4486
|
-
insert(
|
|
4487
|
-
return this.origin.splice(this.origin.getChildrenSize(), 0, [
|
|
4458
|
+
insert(n) {
|
|
4459
|
+
return this.origin.splice(this.origin.getChildrenSize(), 0, [n]), this;
|
|
4488
4460
|
}
|
|
4489
4461
|
} };
|
|
4490
4462
|
function q(n, e) {
|
|
4491
|
-
return n ? new
|
|
4463
|
+
return n ? new ul[e](n) : null;
|
|
4492
4464
|
}
|
|
4493
|
-
function
|
|
4494
|
-
return n ? new
|
|
4465
|
+
function Ve(n, e, t) {
|
|
4466
|
+
return n ? new cl[e](n, at(n, t)) : null;
|
|
4495
4467
|
}
|
|
4496
|
-
function
|
|
4468
|
+
function at(n, e) {
|
|
4497
4469
|
const t = n.getTextContentSize();
|
|
4498
4470
|
let r = e === "next" ? t : e === "previous" ? 0 : e;
|
|
4499
4471
|
return (r < 0 || r > t) && (function(i, ...s) {
|
|
@@ -4503,26 +4475,26 @@ function ct(n, e) {
|
|
|
4503
4475
|
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.`);
|
|
4504
4476
|
}(284, String(e), String(t), n.getKey()), r = r < 0 ? 0 : t), r;
|
|
4505
4477
|
}
|
|
4506
|
-
function
|
|
4507
|
-
return new
|
|
4478
|
+
function ki(n, e) {
|
|
4479
|
+
return new hl(n, e);
|
|
4508
4480
|
}
|
|
4509
|
-
function
|
|
4510
|
-
return v(n) ? new
|
|
4481
|
+
function De(n, e) {
|
|
4482
|
+
return v(n) ? new fl[e](n) : null;
|
|
4511
4483
|
}
|
|
4512
|
-
function
|
|
4484
|
+
function dl(n) {
|
|
4513
4485
|
return n && n.getChildCaret() || n;
|
|
4514
4486
|
}
|
|
4515
|
-
function
|
|
4516
|
-
return n &&
|
|
4487
|
+
function Mr(n) {
|
|
4488
|
+
return n && dl(n.getAdjacentCaret());
|
|
4517
4489
|
}
|
|
4518
|
-
class
|
|
4490
|
+
class Ar {
|
|
4491
|
+
type = "node-caret-range";
|
|
4519
4492
|
constructor(e, t, r) {
|
|
4520
|
-
se(this, "type", "node-caret-range");
|
|
4521
4493
|
this.anchor = e, this.focus = t, this.direction = r;
|
|
4522
4494
|
}
|
|
4523
4495
|
getLatest() {
|
|
4524
4496
|
const e = this.anchor.getLatest(), t = this.focus.getLatest();
|
|
4525
|
-
return e === this.anchor && t === this.focus ? this : new
|
|
4497
|
+
return e === this.anchor && t === this.focus ? this : new Ar(e, t, this.direction);
|
|
4526
4498
|
}
|
|
4527
4499
|
isCollapsed() {
|
|
4528
4500
|
return this.anchor.isSamePointCaret(this.focus);
|
|
@@ -4530,28 +4502,28 @@ class Or {
|
|
|
4530
4502
|
getTextSlices() {
|
|
4531
4503
|
const e = (i) => {
|
|
4532
4504
|
const s = this[i].getLatest();
|
|
4533
|
-
return
|
|
4534
|
-
const { direction: a, origin: c } = o, u =
|
|
4535
|
-
return
|
|
4505
|
+
return Ae(s) ? function(o, l) {
|
|
4506
|
+
const { direction: a, origin: c } = o, u = at(c, l === "focus" ? Xe(a) : a);
|
|
4507
|
+
return ki(o, u - o.offset);
|
|
4536
4508
|
}(s, i) : null;
|
|
4537
4509
|
}, t = e("anchor"), r = e("focus");
|
|
4538
4510
|
if (t && r) {
|
|
4539
4511
|
const { caret: i } = t, { caret: s } = r;
|
|
4540
|
-
if (i.isSameNodeCaret(s)) return [
|
|
4512
|
+
if (i.isSameNodeCaret(s)) return [ki(i, s.offset - i.offset), null];
|
|
4541
4513
|
}
|
|
4542
4514
|
return [t, r];
|
|
4543
4515
|
}
|
|
4544
4516
|
iterNodeCarets(e = "root") {
|
|
4545
|
-
const t =
|
|
4546
|
-
return
|
|
4517
|
+
const t = Ae(this.anchor) ? this.anchor.getSiblingCaret() : this.anchor.getLatest(), r = this.focus.getLatest(), i = Ae(r), s = (o) => o.isSameNodeCaret(r) ? null : Mr(o) || o.getParentCaret(e);
|
|
4518
|
+
return ws({ hasNext: (o) => o !== null && !(i && r.isSameNodeCaret(o)), initial: t.isSameNodeCaret(r) ? null : s(t), map: (o) => o, step: s });
|
|
4547
4519
|
}
|
|
4548
4520
|
[Symbol.iterator]() {
|
|
4549
4521
|
return this.iterNodeCarets("root");
|
|
4550
4522
|
}
|
|
4551
4523
|
}
|
|
4552
|
-
class
|
|
4524
|
+
class hl {
|
|
4525
|
+
type = "slice";
|
|
4553
4526
|
constructor(e, t) {
|
|
4554
|
-
se(this, "type", "slice");
|
|
4555
4527
|
this.caret = e, this.distance = t;
|
|
4556
4528
|
}
|
|
4557
4529
|
getSliceIndices() {
|
|
@@ -4567,19 +4539,19 @@ class pl {
|
|
|
4567
4539
|
}
|
|
4568
4540
|
removeTextSlice() {
|
|
4569
4541
|
const { caret: { origin: e, direction: t } } = this, [r, i] = this.getSliceIndices(), s = e.getTextContent();
|
|
4570
|
-
return
|
|
4542
|
+
return Ve(e.setTextContent(s.slice(0, r) + s.slice(i)), t, r);
|
|
4571
4543
|
}
|
|
4572
4544
|
}
|
|
4573
|
-
function
|
|
4574
|
-
return
|
|
4545
|
+
function Ns(n) {
|
|
4546
|
+
return Ye(n, q(re(), n.direction));
|
|
4575
4547
|
}
|
|
4576
|
-
function
|
|
4577
|
-
return
|
|
4548
|
+
function gl(n) {
|
|
4549
|
+
return Ye(n, n);
|
|
4578
4550
|
}
|
|
4579
|
-
function
|
|
4580
|
-
return n.direction !== e.direction && T(265), new
|
|
4551
|
+
function Ye(n, e) {
|
|
4552
|
+
return n.direction !== e.direction && T(265), new Ar(n, e, n.direction);
|
|
4581
4553
|
}
|
|
4582
|
-
function
|
|
4554
|
+
function ws(n) {
|
|
4583
4555
|
const { initial: e, hasNext: t, step: r, map: i } = n;
|
|
4584
4556
|
let s = e;
|
|
4585
4557
|
return { [Symbol.iterator]() {
|
|
@@ -4590,8 +4562,8 @@ function Es(n) {
|
|
|
4590
4562
|
return s = r(s), o;
|
|
4591
4563
|
} };
|
|
4592
4564
|
}
|
|
4593
|
-
function
|
|
4594
|
-
const t =
|
|
4565
|
+
function Es(n, e) {
|
|
4566
|
+
const t = Ht(n.origin, e.origin);
|
|
4595
4567
|
switch (t === null && T(275, n.origin.getKey(), e.origin.getKey()), t.type) {
|
|
4596
4568
|
case "same": {
|
|
4597
4569
|
const r = n.type === "text", i = e.type === "text";
|
|
@@ -4604,10 +4576,10 @@ function Ms(n, e) {
|
|
|
4604
4576
|
case "descendant":
|
|
4605
4577
|
return e.type === "child" ? 1 : -1;
|
|
4606
4578
|
case "branch":
|
|
4607
|
-
return
|
|
4579
|
+
return Ms(t);
|
|
4608
4580
|
}
|
|
4609
4581
|
}
|
|
4610
|
-
function
|
|
4582
|
+
function Ms(n) {
|
|
4611
4583
|
const { a: e, b: t } = n, r = e.__key, i = t.__key;
|
|
4612
4584
|
let s = e, o = t;
|
|
4613
4585
|
for (; s && o; s = s.getNextSibling(), o = o.getNextSibling()) {
|
|
@@ -4616,67 +4588,67 @@ function As(n) {
|
|
|
4616
4588
|
}
|
|
4617
4589
|
return s === null ? 1 : -1;
|
|
4618
4590
|
}
|
|
4619
|
-
function
|
|
4591
|
+
function Ut(n, e) {
|
|
4620
4592
|
return e.is(n);
|
|
4621
4593
|
}
|
|
4622
|
-
function
|
|
4594
|
+
function Ti(n) {
|
|
4623
4595
|
return v(n) ? [n.getLatest(), null] : [n.getParent(), n.getLatest()];
|
|
4624
4596
|
}
|
|
4625
|
-
function
|
|
4597
|
+
function Ht(n, e) {
|
|
4626
4598
|
if (n.is(e)) return { commonAncestor: n, type: "same" };
|
|
4627
4599
|
const t = /* @__PURE__ */ new Map();
|
|
4628
|
-
for (let [r, i] =
|
|
4629
|
-
for (let [r, i] =
|
|
4600
|
+
for (let [r, i] = Ti(n); r; i = r, r = r.getParent()) t.set(r, i);
|
|
4601
|
+
for (let [r, i] = Ti(e); r; i = r, r = r.getParent()) {
|
|
4630
4602
|
const s = t.get(r);
|
|
4631
|
-
if (s !== void 0) return s === null ? (
|
|
4603
|
+
if (s !== void 0) return s === null ? (Ut(n, r) || T(276), { commonAncestor: r, type: "ancestor" }) : i === null ? (Ut(e, r) || T(277), { commonAncestor: r, type: "descendant" }) : ((v(s) || Ut(n, s)) && (v(i) || Ut(e, i)) && r.is(s.getParent()) && r.is(i.getParent()) || T(278), { a: s, b: i, commonAncestor: r, type: "branch" });
|
|
4632
4604
|
}
|
|
4633
4605
|
return null;
|
|
4634
4606
|
}
|
|
4635
|
-
function
|
|
4636
|
-
const { type: t, key: r, offset: i } = n, s =
|
|
4637
|
-
return t === "text" ? (M(s) || T(266, s.getType(), r),
|
|
4607
|
+
function He(n, e) {
|
|
4608
|
+
const { type: t, key: r, offset: i } = n, s = Zo(n.key);
|
|
4609
|
+
return t === "text" ? (M(s) || T(266, s.getType(), r), Ve(s, e, i)) : (v(s) || T(267, s.getType(), r), ml(s, n.offset, e));
|
|
4638
4610
|
}
|
|
4639
|
-
function
|
|
4611
|
+
function Nt(n, e) {
|
|
4640
4612
|
const { origin: t, direction: r } = e, i = r === "next";
|
|
4641
|
-
|
|
4613
|
+
Ae(e) ? n.set(t.getKey(), e.offset, "text") : lt(e) ? M(t) ? n.set(t.getKey(), at(t, r), "text") : n.set(t.getParentOrThrow().getKey(), t.getIndexWithinParent() + (i ? 1 : 0), "element") : (de(e) && v(t) || T(268), n.set(t.getKey(), i ? 0 : t.getChildrenSize(), "element"));
|
|
4642
4614
|
}
|
|
4643
|
-
function
|
|
4644
|
-
const e = L(), t = O(e) ? e :
|
|
4645
|
-
return
|
|
4615
|
+
function _l(n) {
|
|
4616
|
+
const e = L(), t = O(e) ? e : Fo();
|
|
4617
|
+
return qt(t, n), ie(t), t;
|
|
4646
4618
|
}
|
|
4647
|
-
function
|
|
4648
|
-
|
|
4619
|
+
function qt(n, e) {
|
|
4620
|
+
Nt(n.anchor, e.anchor), Nt(n.focus, e.focus);
|
|
4649
4621
|
}
|
|
4650
|
-
function
|
|
4651
|
-
const { anchor: e, focus: t } = n, r =
|
|
4652
|
-
return
|
|
4622
|
+
function bi(n) {
|
|
4623
|
+
const { anchor: e, focus: t } = n, r = He(e, "next"), i = He(t, "next"), s = Es(r, i) <= 0 ? "next" : "previous";
|
|
4624
|
+
return Ye(qe(r, s), qe(i, s));
|
|
4653
4625
|
}
|
|
4654
|
-
function
|
|
4655
|
-
const { direction: e, origin: t } = n, r = q(t,
|
|
4656
|
-
return r ? q(r, e) :
|
|
4626
|
+
function Ft(n) {
|
|
4627
|
+
const { direction: e, origin: t } = n, r = q(t, Xe(e)).getNodeAtCaret();
|
|
4628
|
+
return r ? q(r, e) : De(t.getParentOrThrow(), e);
|
|
4657
4629
|
}
|
|
4658
|
-
function
|
|
4630
|
+
function Ni(n, e = "root") {
|
|
4659
4631
|
const t = [n];
|
|
4660
|
-
for (let r =
|
|
4632
|
+
for (let r = de(n) ? n.getParentCaret(e) : n.getSiblingCaret(); r !== null; r = r.getParentCaret(e)) t.push(Ft(r));
|
|
4661
4633
|
return t;
|
|
4662
4634
|
}
|
|
4663
|
-
function
|
|
4635
|
+
function Jn(n) {
|
|
4664
4636
|
return !!n && n.origin.isAttached();
|
|
4665
4637
|
}
|
|
4666
|
-
function
|
|
4638
|
+
function pl(n, e = "removeEmptySlices") {
|
|
4667
4639
|
if (n.isCollapsed()) return n;
|
|
4668
4640
|
const t = "root", r = "next";
|
|
4669
4641
|
let i = e;
|
|
4670
|
-
const s =
|
|
4671
|
-
for (const d of s.iterNodeCarets(t)) if (
|
|
4672
|
-
else if (
|
|
4642
|
+
const s = As(n, r), o = Ni(s.anchor, t), l = Ni(s.focus.getFlipped(), t), a = /* @__PURE__ */ new Set(), c = [];
|
|
4643
|
+
for (const d of s.iterNodeCarets(t)) if (de(d)) a.add(d.origin.getKey());
|
|
4644
|
+
else if (lt(d)) {
|
|
4673
4645
|
const { origin: _ } = d;
|
|
4674
4646
|
v(_) && !a.has(_.getKey()) || c.push(_);
|
|
4675
4647
|
}
|
|
4676
4648
|
for (const d of c) d.remove();
|
|
4677
4649
|
for (const d of s.getTextSlices()) {
|
|
4678
4650
|
if (!d) continue;
|
|
4679
|
-
const { origin: _ } = d.caret, p = _.getTextContentSize(), x =
|
|
4651
|
+
const { origin: _ } = d.caret, p = _.getTextContentSize(), x = Ft(q(_, r)), y = _.getMode();
|
|
4680
4652
|
if (Math.abs(d.distance) === p && i === "removeEmptySlices" || y === "token" && d.distance !== 0) x.remove();
|
|
4681
4653
|
else if (d.distance !== 0) {
|
|
4682
4654
|
i = "removeEmptySlices";
|
|
@@ -4684,18 +4656,18 @@ function xl(n, e = "removeEmptySlices") {
|
|
|
4684
4656
|
const b = d.caret.origin;
|
|
4685
4657
|
if (y === "segmented") {
|
|
4686
4658
|
const N = m.origin, C = Y(N.getTextContent()).setStyle(N.getStyle()).setFormat(N.getFormat());
|
|
4687
|
-
x.replaceOrInsert(C), m =
|
|
4659
|
+
x.replaceOrInsert(C), m = Ve(C, r, m.offset);
|
|
4688
4660
|
}
|
|
4689
4661
|
b.is(o[0].origin) && (o[0] = m), b.is(l[0].origin) && (l[0] = m.getFlipped());
|
|
4690
4662
|
}
|
|
4691
4663
|
}
|
|
4692
4664
|
let u, h;
|
|
4693
|
-
for (const d of o) if (
|
|
4694
|
-
u =
|
|
4665
|
+
for (const d of o) if (Jn(d)) {
|
|
4666
|
+
u = fe(d);
|
|
4695
4667
|
break;
|
|
4696
4668
|
}
|
|
4697
|
-
for (const d of l) if (
|
|
4698
|
-
h =
|
|
4669
|
+
for (const d of l) if (Jn(d)) {
|
|
4670
|
+
h = fe(d);
|
|
4699
4671
|
break;
|
|
4700
4672
|
}
|
|
4701
4673
|
const f = function(d, _, p) {
|
|
@@ -4713,70 +4685,70 @@ function xl(n, e = "removeEmptySlices") {
|
|
|
4713
4685
|
let W;
|
|
4714
4686
|
for (let K = C; K < A.length; K++) {
|
|
4715
4687
|
const P = A[K];
|
|
4716
|
-
if (
|
|
4688
|
+
if (Fe(P)) return;
|
|
4717
4689
|
!W && F(P) && (W = P);
|
|
4718
4690
|
}
|
|
4719
4691
|
return W;
|
|
4720
|
-
}, k = w(m,
|
|
4692
|
+
}, k = w(m, we), S = k && w(b, (A) => p.has(A.getKey()) && we(A));
|
|
4721
4693
|
return k && S ? [k, S] : null;
|
|
4722
4694
|
}(u, h, a);
|
|
4723
4695
|
if (f) {
|
|
4724
4696
|
const [d, _] = f;
|
|
4725
|
-
|
|
4697
|
+
De(d, "previous").splice(0, _.getChildren()), _.remove();
|
|
4726
4698
|
}
|
|
4727
|
-
const g = [u, h, ...o, ...l].find(
|
|
4699
|
+
const g = [u, h, ...o, ...l].find(Jn);
|
|
4728
4700
|
if (g)
|
|
4729
|
-
return
|
|
4701
|
+
return gl(qe(fe(g), n.direction));
|
|
4730
4702
|
T(269, JSON.stringify(o.map((d) => d.origin.__key)));
|
|
4731
4703
|
}
|
|
4732
|
-
function
|
|
4704
|
+
function fe(n) {
|
|
4733
4705
|
const e = function(i) {
|
|
4734
4706
|
let s = i;
|
|
4735
|
-
for (;
|
|
4736
|
-
const o =
|
|
4737
|
-
if (!
|
|
4707
|
+
for (; de(s); ) {
|
|
4708
|
+
const o = Mr(s);
|
|
4709
|
+
if (!de(o)) break;
|
|
4738
4710
|
s = o;
|
|
4739
4711
|
}
|
|
4740
4712
|
return s;
|
|
4741
4713
|
}(n.getLatest()), { direction: t } = e;
|
|
4742
|
-
if (M(e.origin)) return
|
|
4714
|
+
if (M(e.origin)) return Ae(e) ? e : Ve(e.origin, t, t);
|
|
4743
4715
|
const r = e.getAdjacentCaret();
|
|
4744
|
-
return
|
|
4716
|
+
return lt(r) && M(r.origin) ? Ve(r.origin, t, Xe(t)) : e;
|
|
4745
4717
|
}
|
|
4746
|
-
function
|
|
4747
|
-
return
|
|
4718
|
+
function yl(n) {
|
|
4719
|
+
return Ae(n) && n.offset !== at(n.origin, n.direction);
|
|
4748
4720
|
}
|
|
4749
|
-
function
|
|
4721
|
+
function qe(n, e) {
|
|
4750
4722
|
return n.direction === e ? n : n.getFlipped();
|
|
4751
4723
|
}
|
|
4752
|
-
function
|
|
4753
|
-
return n.direction === e ? n :
|
|
4724
|
+
function As(n, e) {
|
|
4725
|
+
return n.direction === e ? n : Ye(qe(n.focus, e), qe(n.anchor, e));
|
|
4754
4726
|
}
|
|
4755
|
-
function
|
|
4756
|
-
let r =
|
|
4727
|
+
function ml(n, e, t) {
|
|
4728
|
+
let r = De(n, "next");
|
|
4757
4729
|
for (let i = 0; i < e; i++) {
|
|
4758
4730
|
const s = r.getAdjacentCaret();
|
|
4759
4731
|
if (s === null) break;
|
|
4760
4732
|
r = s;
|
|
4761
4733
|
}
|
|
4762
|
-
return
|
|
4734
|
+
return qe(r, t);
|
|
4763
4735
|
}
|
|
4764
|
-
function
|
|
4736
|
+
function xl(n) {
|
|
4765
4737
|
const { origin: e, offset: t, direction: r } = n;
|
|
4766
|
-
if (t ===
|
|
4767
|
-
if (t ===
|
|
4738
|
+
if (t === at(e, r)) return n.getSiblingCaret();
|
|
4739
|
+
if (t === at(e, Xe(r))) return Ft(n.getSiblingCaret());
|
|
4768
4740
|
const [i] = e.splitText(t);
|
|
4769
|
-
return M(i) || T(281),
|
|
4741
|
+
return M(i) || T(281), qe(q(i, "next"), r);
|
|
4770
4742
|
}
|
|
4771
|
-
function
|
|
4743
|
+
function Cl(n, e) {
|
|
4772
4744
|
return !0;
|
|
4773
4745
|
}
|
|
4774
|
-
function
|
|
4775
|
-
if (
|
|
4746
|
+
function ql(n, { $copyElementNode: e = Qo, $splitTextPointCaretNext: t = xl, rootMode: r = "shadowRoot", $shouldSplit: i = Cl } = {}) {
|
|
4747
|
+
if (Ae(n)) return t(n);
|
|
4776
4748
|
const s = n.getParentCaret(r);
|
|
4777
4749
|
if (s) {
|
|
4778
4750
|
const { origin: o } = s;
|
|
4779
|
-
if (
|
|
4751
|
+
if (de(n) && (!o.canBeEmpty() || !i(o, "first"))) return Ft(s);
|
|
4780
4752
|
const l = function(a) {
|
|
4781
4753
|
const c = [];
|
|
4782
4754
|
for (let u = a.getAdjacentCaret(); u; u = u.getAdjacentCaret()) c.push(u.origin);
|
|
@@ -4787,124 +4759,124 @@ function Zl(n, { $copyElementNode: e = tl, $splitTextPointCaretNext: t = vl, roo
|
|
|
4787
4759
|
return s;
|
|
4788
4760
|
}
|
|
4789
4761
|
export {
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4762
|
+
ke as $,
|
|
4763
|
+
uo as A,
|
|
4764
|
+
oo as B,
|
|
4765
|
+
on as C,
|
|
4766
|
+
ln as D,
|
|
4767
|
+
sn as E,
|
|
4768
|
+
Kl as F,
|
|
4769
|
+
Wl as G,
|
|
4770
|
+
go as H,
|
|
4771
|
+
Bl as I,
|
|
4772
|
+
ct as J,
|
|
4773
|
+
Rl as K,
|
|
4774
|
+
zl as L,
|
|
4775
|
+
po as M,
|
|
4804
4776
|
L as N,
|
|
4805
|
-
|
|
4806
|
-
|
|
4777
|
+
_o as O,
|
|
4778
|
+
Me as P,
|
|
4807
4779
|
M as Q,
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4780
|
+
Ke as R,
|
|
4781
|
+
bl as S,
|
|
4782
|
+
ao as T,
|
|
4783
|
+
Vi as U,
|
|
4784
|
+
De as V,
|
|
4785
|
+
_t as W,
|
|
4814
4786
|
Y as X,
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4787
|
+
yo as Y,
|
|
4788
|
+
vo as Z,
|
|
4789
|
+
Wi as _,
|
|
4818
4790
|
ee as a,
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4791
|
+
Fl as a$,
|
|
4792
|
+
Ol as a0,
|
|
4793
|
+
Fo as a1,
|
|
4822
4794
|
ne as a2,
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4795
|
+
he as a3,
|
|
4796
|
+
He as a4,
|
|
4797
|
+
yl as a5,
|
|
4798
|
+
Ns as a6,
|
|
4799
|
+
lt as a7,
|
|
4800
|
+
de as a8,
|
|
4829
4801
|
q as a9,
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4802
|
+
il as aA,
|
|
4803
|
+
tl as aB,
|
|
4804
|
+
_r as aC,
|
|
4805
|
+
$i as aD,
|
|
4806
|
+
Pl as aE,
|
|
4807
|
+
Sn as aF,
|
|
4808
|
+
Jl as aG,
|
|
4809
|
+
zn as aH,
|
|
4810
|
+
ho as aI,
|
|
4811
|
+
_s as aJ,
|
|
4812
|
+
Il as aK,
|
|
4813
|
+
Jr as aL,
|
|
4814
|
+
jl as aM,
|
|
4815
|
+
Co as aN,
|
|
4816
|
+
xo as aO,
|
|
4817
|
+
mo as aP,
|
|
4818
|
+
Xn as aQ,
|
|
4819
|
+
$t as aR,
|
|
4820
|
+
Tl as aS,
|
|
4821
|
+
Ho as aT,
|
|
4822
|
+
kl as aU,
|
|
4823
|
+
vl as aV,
|
|
4824
|
+
Dl as aW,
|
|
4825
|
+
Wr as aX,
|
|
4826
|
+
ps as aY,
|
|
4827
|
+
wl as aZ,
|
|
4828
|
+
Nl as a_,
|
|
4829
|
+
Mr as aa,
|
|
4830
|
+
Mt as ab,
|
|
4831
|
+
Je as ac,
|
|
4832
|
+
Ot as ad,
|
|
4833
|
+
Ji as ae,
|
|
4862
4834
|
re as af,
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4835
|
+
ws as ag,
|
|
4836
|
+
_l as ah,
|
|
4837
|
+
gl as ai,
|
|
4838
|
+
qe as aj,
|
|
4839
|
+
ql as ak,
|
|
4840
|
+
Ae as al,
|
|
4869
4841
|
z as am,
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4842
|
+
Ne as an,
|
|
4843
|
+
Qr as ao,
|
|
4844
|
+
we as ap,
|
|
4845
|
+
so as aq,
|
|
4846
|
+
Ml as ar,
|
|
4847
|
+
El as as,
|
|
4848
|
+
Ui as at,
|
|
4849
|
+
ji as au,
|
|
4850
|
+
Jo as av,
|
|
4851
|
+
Tt as aw,
|
|
4852
|
+
Al as ax,
|
|
4853
|
+
Ci as ay,
|
|
4854
|
+
nl as az,
|
|
4855
|
+
Rr as b,
|
|
4856
|
+
Ll as b0,
|
|
4885
4857
|
O as c,
|
|
4886
4858
|
v as d,
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4859
|
+
Nt as e,
|
|
4860
|
+
mn as f,
|
|
4861
|
+
pr as g,
|
|
4862
|
+
$l as h,
|
|
4863
|
+
Ul as i,
|
|
4864
|
+
tt as j,
|
|
4865
|
+
Hl as k,
|
|
4866
|
+
Sr as l,
|
|
4895
4867
|
ie as m,
|
|
4896
|
-
|
|
4868
|
+
bn as n,
|
|
4897
4869
|
D as o,
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4870
|
+
fe as p,
|
|
4871
|
+
io as q,
|
|
4872
|
+
Sl as r,
|
|
4873
|
+
Pt as s,
|
|
4874
|
+
Fe as t,
|
|
4875
|
+
Vl as u,
|
|
4876
|
+
jn as v,
|
|
4877
|
+
ut as w,
|
|
4878
|
+
Yl as x,
|
|
4907
4879
|
$ as y,
|
|
4908
|
-
|
|
4880
|
+
fo as z
|
|
4909
4881
|
};
|
|
4910
|
-
//# sourceMappingURL=Lexical.prod-
|
|
4882
|
+
//# sourceMappingURL=Lexical.prod-B84LhBo3.js.map
|