@uva-glass/component-library 3.50.6 → 3.50.7
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-DBU6xTBY.js → Lexical.prod-BAE-wnll.js} +873 -863
- package/dist/Lexical.prod-BAE-wnll.js.map +1 -0
- package/dist/LexicalClipboard.prod-BS4qAkmJ.js +263 -0
- package/dist/LexicalClipboard.prod-BS4qAkmJ.js.map +1 -0
- package/dist/{LexicalLink.prod-DV9kT537.js → LexicalLink.prod-C6Or2Yo6.js} +97 -97
- package/dist/{LexicalLink.prod-DV9kT537.js.map → LexicalLink.prod-C6Or2Yo6.js.map} +1 -1
- package/dist/{LexicalList.prod-2UfLUgO1.js → LexicalList.prod-rTq41CO0.js} +24 -24
- package/dist/{LexicalList.prod-2UfLUgO1.js.map → LexicalList.prod-rTq41CO0.js.map} +1 -1
- package/dist/LexicalSelection.prod-fLzEGOT_.js +116 -0
- package/dist/LexicalSelection.prod-fLzEGOT_.js.map +1 -0
- package/dist/{LexicalTable.prod-CZ1mYUR-.js → LexicalTable.prod-BBI7yaOy.js} +118 -118
- package/dist/LexicalTable.prod-BBI7yaOy.js.map +1 -0
- package/dist/{LexicalUtils.prod-C3vvQk50.js → LexicalUtils.prod-D8DAKg7O.js} +36 -36
- package/dist/{LexicalUtils.prod-C3vvQk50.js.map → LexicalUtils.prod-D8DAKg7O.js.map} +1 -1
- package/dist/{TableCellResizerPlugin-CxFy7dbe.js → TableCellResizerPlugin-HPo4ZkHo.js} +39 -39
- package/dist/{TableCellResizerPlugin-CxFy7dbe.js.map → TableCellResizerPlugin-HPo4ZkHo.js.map} +1 -1
- package/dist/{TablePlugin-8TKXJMYE.js → TablePlugin-CeZO4BR1.js} +70 -70
- package/dist/{TablePlugin-8TKXJMYE.js.map → TablePlugin-CeZO4BR1.js.map} +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +7 -7
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +41 -41
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +14 -14
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +12 -12
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +16 -16
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +219 -219
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +15 -15
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/Lexical.prod-DBU6xTBY.js.map +0 -1
- package/dist/LexicalClipboard.prod-CzGBnMdD.js +0 -272
- package/dist/LexicalClipboard.prod-CzGBnMdD.js.map +0 -1
- package/dist/LexicalSelection.prod-C1JYA_go.js +0 -114
- package/dist/LexicalSelection.prod-C1JYA_go.js.map +0 -1
- package/dist/LexicalTable.prod-CZ1mYUR-.js.map +0 -1
|
@@ -4,62 +4,62 @@ function T(n, ...e) {
|
|
|
4
4
|
for (const i of e) r.append("v", i);
|
|
5
5
|
throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function Ti(n, ...e) {
|
|
8
8
|
const t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
9
9
|
r.append("code", n);
|
|
10
10
|
for (const i of e) r.append("v", i);
|
|
11
11
|
t.search = r.toString(), console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
12
12
|
}
|
|
13
|
-
const ae = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0,
|
|
14
|
-
function
|
|
13
|
+
const ae = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ps = ae && "documentMode" in document ? document.documentMode : null, oe = ae && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Be = ae && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Qt = !(!ae || !("InputEvent" in window) || Ps) && "getTargetRanges" in new window.InputEvent("input"), St = ae && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), st = ae && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ds = ae && /Android/.test(navigator.userAgent), bi = ae && /^(?=.*Chrome).*/i.test(navigator.userAgent), br = ae && Ds && bi, vt = ae && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && oe && !bi;
|
|
14
|
+
function Ni(...n) {
|
|
15
15
|
const e = [];
|
|
16
16
|
for (const t of n) if (t && typeof t == "string") for (const [r] of t.matchAll(/\S+/g)) e.push(r);
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const Fs = 0, Ls = 1, Is = 2, wi = 128, Ks = 1, zs = 2, Bs = 3, Rs = 4, Ws = 5, Js = 6, hn = St || st || vt ? " " : "", Oe = `
|
|
20
20
|
|
|
21
|
-
`,
|
|
22
|
-
function
|
|
21
|
+
`, $s = Be ? " " : hn, Re = { bold: 1, capitalize: 1024, code: 16, highlight: wi, italic: 2, lowercase: 256, strikethrough: 4, subscript: 32, superscript: 64, underline: 8, uppercase: 512 }, js = { directionless: 1, unmergeable: 2 }, Nr = { center: 2, end: 6, justify: 4, left: 1, right: 3, start: 5 }, Us = { [zs]: "center", [Js]: "end", [Rs]: "justify", [Ks]: "left", [Bs]: "right", [Ws]: "start" }, Vs = { normal: 0, segmented: 2, token: 1 }, Ys = { [Fs]: "normal", [Is]: "segmented", [Ls]: "token" }, wr = "$config";
|
|
22
|
+
function Ei(n, e, t, r, i, s) {
|
|
23
23
|
let o = n.getFirstChild();
|
|
24
24
|
for (; o !== null; ) {
|
|
25
25
|
const l = o.__key;
|
|
26
|
-
o.__parent === e && (v(o) &&
|
|
26
|
+
o.__parent === e && (v(o) && Ei(o, l, t, r, i, s), t.has(l) || s.delete(l), i.push(l)), o = o.getNextSibling();
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
let
|
|
30
|
-
function
|
|
31
|
-
|
|
29
|
+
let Bn = !1, rr = 0;
|
|
30
|
+
function Hs(n) {
|
|
31
|
+
rr = n.timeStamp;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Nn(n, e, t) {
|
|
34
34
|
const r = n.nodeName === "BR", i = e.__lexicalLineBreak;
|
|
35
|
-
return i && (n === i || r && n.previousSibling === i) || r &&
|
|
35
|
+
return i && (n === i || r && n.previousSibling === i) || r && Cn(n, t) !== void 0;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function qs(n, e, t) {
|
|
38
38
|
const r = Se(se(t));
|
|
39
39
|
let i = null, s = null;
|
|
40
40
|
r !== null && r.anchorNode === n && (i = r.anchorOffset, s = r.focusOffset);
|
|
41
41
|
const o = n.nodeValue;
|
|
42
|
-
o !== null &&
|
|
42
|
+
o !== null && _r(e, o, i, s, !1);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Gs(n, e, t) {
|
|
45
45
|
if (A(n)) {
|
|
46
46
|
const r = n.anchor.getNode();
|
|
47
47
|
if (r.is(t) && n.format !== r.getFormat()) return !1;
|
|
48
48
|
}
|
|
49
49
|
return ve(e) && t.isAttached();
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
for (let i = n; i && !
|
|
53
|
-
const s =
|
|
51
|
+
function Xs(n, e, t, r) {
|
|
52
|
+
for (let i = n; i && !ol(i); i = Lt(i)) {
|
|
53
|
+
const s = Cn(i, e);
|
|
54
54
|
if (s !== void 0) {
|
|
55
55
|
const o = U(s, t);
|
|
56
56
|
if (o) return B(o) || !ee(i) ? void 0 : [i, o];
|
|
57
|
-
} else if (i === r) return [r,
|
|
57
|
+
} else if (i === r) return [r, Cs(t)];
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
const r = performance.now() -
|
|
60
|
+
function Mi(n, e, t) {
|
|
61
|
+
Bn = !0;
|
|
62
|
+
const r = performance.now() - rr > 100;
|
|
63
63
|
try {
|
|
64
64
|
ne(n, () => {
|
|
65
65
|
const i = L() || (function(f) {
|
|
@@ -70,16 +70,16 @@ function Ei(n, e, t) {
|
|
|
70
70
|
})(n), s = /* @__PURE__ */ new Map(), o = n.getRootElement(), l = n._editorState, a = n._blockCursorElement;
|
|
71
71
|
let c = !1, u = "";
|
|
72
72
|
for (let f = 0; f < e.length; f++) {
|
|
73
|
-
const g = e[f], h = g.type, _ = g.target, p =
|
|
73
|
+
const g = e[f], h = g.type, _ = g.target, p = Xs(_, n, l, o);
|
|
74
74
|
if (!p) continue;
|
|
75
75
|
const [x, y] = p;
|
|
76
|
-
if (h === "characterData") r && M(y) && ve(_) &&
|
|
76
|
+
if (h === "characterData") r && M(y) && ve(_) && Gs(i, _, y) && qs(_, y, n);
|
|
77
77
|
else if (h === "childList") {
|
|
78
78
|
c = !0;
|
|
79
79
|
const m = g.addedNodes;
|
|
80
80
|
for (let C = 0; C < m.length; C++) {
|
|
81
|
-
const w = m[C], k =
|
|
82
|
-
if (S != null && w !== a && k === null && !
|
|
81
|
+
const w = m[C], k = ms(w), S = w.parentNode;
|
|
82
|
+
if (S != null && w !== a && k === null && !Nn(w, S, n)) {
|
|
83
83
|
if (Be) {
|
|
84
84
|
const O = (ee(w) ? w.innerText : null) || w.nodeValue;
|
|
85
85
|
O && (u += O);
|
|
@@ -92,7 +92,7 @@ function Ei(n, e, t) {
|
|
|
92
92
|
let C = 0;
|
|
93
93
|
for (let w = 0; w < N; w++) {
|
|
94
94
|
const k = b[w];
|
|
95
|
-
(
|
|
95
|
+
(Nn(k, _, n) || a === k) && (_.appendChild(k), C++);
|
|
96
96
|
}
|
|
97
97
|
N !== C && s.set(x, y);
|
|
98
98
|
}
|
|
@@ -105,32 +105,32 @@ function Ei(n, e, t) {
|
|
|
105
105
|
const g = d[f], h = g.addedNodes, _ = g.target;
|
|
106
106
|
for (let p = 0; p < h.length; p++) {
|
|
107
107
|
const x = h[p], y = x.parentNode;
|
|
108
|
-
y == null || x.nodeName !== "BR" ||
|
|
108
|
+
y == null || x.nodeName !== "BR" || Nn(x, _, n) || y.removeChild(x);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
t.takeRecords();
|
|
112
112
|
}
|
|
113
|
-
i !== null && (c && re(i), Be &&
|
|
113
|
+
i !== null && (c && re(i), Be && Ts(n) && i.insertRawText(u));
|
|
114
114
|
});
|
|
115
115
|
} finally {
|
|
116
|
-
|
|
116
|
+
Bn = !1;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Oi(n) {
|
|
120
120
|
const e = n._observer;
|
|
121
|
-
e !== null &&
|
|
121
|
+
e !== null && Mi(n, e.takeRecords(), e);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Ai(n) {
|
|
124
124
|
(function(e) {
|
|
125
|
-
|
|
125
|
+
rr === 0 && se(e).addEventListener("textInput", Hs, !0);
|
|
126
126
|
})(n), n._observer = new MutationObserver((e, t) => {
|
|
127
|
-
|
|
127
|
+
Mi(n, e, t);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Qs(n) {
|
|
131
131
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
132
132
|
for (let r = typeof n == "function" ? n : n.replace; r.prototype && r.prototype.getType !== void 0; r = Object.getPrototypeOf(r)) {
|
|
133
|
-
const { ownNodeConfig: i } =
|
|
133
|
+
const { ownNodeConfig: i } = mr(r);
|
|
134
134
|
if (i && i.stateConfigs) for (const s of i.stateConfigs) {
|
|
135
135
|
let o;
|
|
136
136
|
"stateConfig" in s ? (o = s.stateConfig, s.flat && t.add(o.key)) : o = s, e.set(o.key, o);
|
|
@@ -138,7 +138,7 @@ function qs(n) {
|
|
|
138
138
|
}
|
|
139
139
|
return { flatKeys: t, sharedConfigMap: e };
|
|
140
140
|
}
|
|
141
|
-
class
|
|
141
|
+
class ir {
|
|
142
142
|
node;
|
|
143
143
|
knownState;
|
|
144
144
|
unknownState;
|
|
@@ -174,12 +174,12 @@ class rr {
|
|
|
174
174
|
const e = { ...this.unknownState }, t = {};
|
|
175
175
|
for (const [r, i] of this.knownState) r.isEqual(i, r.defaultValue) ? delete e[r.key] : e[r.key] = r.unparse(i);
|
|
176
176
|
for (const r of this.sharedNodeState.flatKeys) r in e && (t[r] = e[r], delete e[r]);
|
|
177
|
-
return
|
|
177
|
+
return Er(e) && (t.$ = e), t;
|
|
178
178
|
}
|
|
179
179
|
getWritable(e) {
|
|
180
180
|
if (this.node === e) return this;
|
|
181
181
|
const { sharedNodeState: t, unknownState: r } = this, i = new Map(this.knownState);
|
|
182
|
-
return new
|
|
182
|
+
return new ir(e, t, (function(s, o, l) {
|
|
183
183
|
let a;
|
|
184
184
|
if (l) for (const [c, u] of Object.entries(l)) {
|
|
185
185
|
const d = s.get(c);
|
|
@@ -192,7 +192,7 @@ class rr {
|
|
|
192
192
|
const r = e.key;
|
|
193
193
|
this.sharedNodeState.sharedConfigMap.set(r, e);
|
|
194
194
|
const { knownState: i, unknownState: s } = this;
|
|
195
|
-
i.has(e) || s && r in s || (s && (delete s[r], this.unknownState =
|
|
195
|
+
i.has(e) || s && r in s || (s && (delete s[r], this.unknownState = Er(s)), this.size++), i.set(e, t);
|
|
196
196
|
}
|
|
197
197
|
updateFromUnknown(e, t) {
|
|
198
198
|
const r = this.sharedNodeState.sharedConfigMap.get(e);
|
|
@@ -204,17 +204,17 @@ class rr {
|
|
|
204
204
|
if (this.size = t.size, this.unknownState = void 0, e) for (const [r, i] of Object.entries(e)) this.updateFromUnknown(r, i);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
const e = n.getWritable(), t = e.__state ? e.__state.getWritable(e) : new
|
|
207
|
+
function Zs(n) {
|
|
208
|
+
const e = n.getWritable(), t = e.__state ? e.__state.getWritable(e) : new ir(e, Pi(e));
|
|
209
209
|
return e.__state = t, t;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
212
|
-
return n.__state ? n.__state.sharedNodeState :
|
|
211
|
+
function Pi(n) {
|
|
212
|
+
return n.__state ? n.__state.sharedNodeState : hs(rl(), n.getType()).sharedNodeState;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Er(n) {
|
|
215
215
|
if (n) for (const e in n) return n;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Mr(n, e, t) {
|
|
218
218
|
for (const [r, i] of e.knownState) {
|
|
219
219
|
if (n.has(r.key)) continue;
|
|
220
220
|
n.add(r.key);
|
|
@@ -223,7 +223,7 @@ function Er(n, e, t) {
|
|
|
223
223
|
}
|
|
224
224
|
return !1;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function Or(n, e, t) {
|
|
227
227
|
const { unknownState: r } = e, i = t ? t.unknownState : void 0;
|
|
228
228
|
if (r) {
|
|
229
229
|
for (const [s, o] of Object.entries(r))
|
|
@@ -232,30 +232,30 @@ function Mr(n, e, t) {
|
|
|
232
232
|
}
|
|
233
233
|
return !1;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Ar(n, e) {
|
|
236
236
|
const t = n.__state;
|
|
237
237
|
return t && t.node === n ? t.getWritable(e) : t;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Pr(n, e) {
|
|
240
240
|
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;
|
|
241
241
|
return (t === null || t === s) && (r === null || r === o) && (i === null || i === l) && (n.__state === null || a === c || (function(u, d) {
|
|
242
242
|
if (u === d) return !0;
|
|
243
243
|
if (u && d && u.size !== d.size) return !1;
|
|
244
244
|
const f = /* @__PURE__ */ new Set();
|
|
245
|
-
return !(u &&
|
|
245
|
+
return !(u && Mr(f, u, d) || d && Mr(f, d, u) || u && Or(f, u, d) || d && Or(f, d, u));
|
|
246
246
|
})(a, c));
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Dr(n, e) {
|
|
249
249
|
const t = n.mergeWithSibling(e), r = R()._normalizedNodes;
|
|
250
250
|
return r.add(n.__key), r.add(e.__key), t;
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function Fr(n) {
|
|
253
253
|
let e, t, r = n;
|
|
254
254
|
if (r.__text !== "" || !r.isSimpleText() || r.isUnmergeable()) {
|
|
255
255
|
for (; (e = r.getPreviousSibling()) !== null && M(e) && e.isSimpleText() && !e.isUnmergeable(); ) {
|
|
256
256
|
if (e.__text !== "") {
|
|
257
|
-
if (
|
|
258
|
-
r =
|
|
257
|
+
if (Pr(e, r)) {
|
|
258
|
+
r = Dr(e, r);
|
|
259
259
|
break;
|
|
260
260
|
}
|
|
261
261
|
break;
|
|
@@ -264,8 +264,8 @@ function Dr(n) {
|
|
|
264
264
|
}
|
|
265
265
|
for (; (t = r.getNextSibling()) !== null && M(t) && t.isSimpleText() && !t.isUnmergeable(); ) {
|
|
266
266
|
if (t.__text !== "") {
|
|
267
|
-
if (
|
|
268
|
-
r =
|
|
267
|
+
if (Pr(r, t)) {
|
|
268
|
+
r = Dr(r, t);
|
|
269
269
|
break;
|
|
270
270
|
}
|
|
271
271
|
break;
|
|
@@ -274,10 +274,10 @@ function Dr(n) {
|
|
|
274
274
|
}
|
|
275
275
|
} else r.remove();
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
return
|
|
277
|
+
function Rn(n) {
|
|
278
|
+
return Lr(n.anchor), Lr(n.focus), n;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function Lr(n) {
|
|
281
281
|
for (; n.type === "element"; ) {
|
|
282
282
|
const e = n.getNode(), t = n.offset;
|
|
283
283
|
let r, i;
|
|
@@ -289,18 +289,18 @@ function Fr(n) {
|
|
|
289
289
|
n.set(r.__key, i ? r.getChildrenSize() : 0, "element", !0);
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
let We, Q, kt,
|
|
292
|
+
let We, Q, kt, gn, Wn, Jn, Je, le, $n, Tt, J = "", ce = null, ue = "", xe = "", Ze = !1, Zt = !1;
|
|
293
293
|
function en(n, e) {
|
|
294
294
|
const t = Je.get(n);
|
|
295
295
|
if (e !== null) {
|
|
296
|
-
const r =
|
|
296
|
+
const r = Yn(n);
|
|
297
297
|
r.parentNode === e && e.removeChild(r);
|
|
298
298
|
}
|
|
299
299
|
if (le.has(n) || Q._keyToDOMMap.delete(n), v(t)) {
|
|
300
300
|
const r = nn(t, Je);
|
|
301
301
|
jn(r, 0, r.length - 1, null);
|
|
302
302
|
}
|
|
303
|
-
t !== void 0 &&
|
|
303
|
+
t !== void 0 && pr(Tt, kt, gn, t, "destroyed");
|
|
304
304
|
}
|
|
305
305
|
function jn(n, e, t, r) {
|
|
306
306
|
let i = e;
|
|
@@ -312,27 +312,27 @@ function jn(n, e, t, r) {
|
|
|
312
312
|
function Fe(n, e) {
|
|
313
313
|
n.setProperty("text-align", e);
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
function
|
|
315
|
+
const eo = "40px";
|
|
316
|
+
function Di(n, e) {
|
|
317
317
|
const t = We.theme.indent;
|
|
318
318
|
if (typeof t == "string") {
|
|
319
319
|
const i = n.classList.contains(t);
|
|
320
320
|
e > 0 && !i ? n.classList.add(t) : e < 1 && i && n.classList.remove(t);
|
|
321
321
|
}
|
|
322
|
-
const r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") ||
|
|
322
|
+
const r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") || eo;
|
|
323
323
|
n.style.setProperty("padding-inline-start", e === 0 ? "" : `calc(${e} * ${r})`);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Fi(n, e) {
|
|
326
326
|
const t = n.style;
|
|
327
327
|
e === 0 ? Fe(t, "") : e === 1 ? Fe(t, "left") : e === 2 ? Fe(t, "center") : e === 3 ? Fe(t, "right") : e === 4 ? Fe(t, "justify") : e === 5 ? Fe(t, "start") : e === 6 && Fe(t, "end");
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Un(n, e) {
|
|
330
330
|
const t = (function(r) {
|
|
331
331
|
const i = r.__dir;
|
|
332
332
|
if (i !== null) return i;
|
|
333
|
-
if (
|
|
333
|
+
if (H(r)) return null;
|
|
334
334
|
const s = r.getParentOrThrow();
|
|
335
|
-
return
|
|
335
|
+
return H(s) && s.__dir === null ? "auto" : null;
|
|
336
336
|
})(e);
|
|
337
337
|
t !== null ? n.dir = t : n.removeAttribute("dir");
|
|
338
338
|
}
|
|
@@ -348,23 +348,23 @@ function tn(n, e) {
|
|
|
348
348
|
})(s, o, i), l.set(i, s);
|
|
349
349
|
})(n, r, Q), M(t) ? r.setAttribute("data-lexical-text", "true") : B(t) && r.setAttribute("data-lexical-decorator", "true"), v(t)) {
|
|
350
350
|
const i = t.__indent, s = t.__size;
|
|
351
|
-
if (
|
|
351
|
+
if (Un(r, t), i !== 0 && Di(r, i), s !== 0) {
|
|
352
352
|
const l = s - 1;
|
|
353
|
-
|
|
353
|
+
Vn(nn(t, le), t, 0, l, t.getDOMSlot(r));
|
|
354
354
|
}
|
|
355
355
|
const o = t.__format;
|
|
356
|
-
o !== 0 &&
|
|
356
|
+
o !== 0 && Fi(r, o), t.isInline() || Li(null, t, r), Sn(t) && (J += Oe, xe += Oe);
|
|
357
357
|
} else {
|
|
358
358
|
const i = t.getTextContent();
|
|
359
359
|
if (B(t)) {
|
|
360
360
|
const s = t.decorate(Q, We);
|
|
361
|
-
s !== null &&
|
|
361
|
+
s !== null && Ii(n, s), r.contentEditable = "false";
|
|
362
362
|
}
|
|
363
363
|
J += i, xe += i;
|
|
364
364
|
}
|
|
365
|
-
return e !== null && e.insertChild(r),
|
|
365
|
+
return e !== null && e.insertChild(r), pr(Tt, kt, gn, t, "created"), r;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Vn(n, e, t, r, i) {
|
|
368
368
|
const s = J;
|
|
369
369
|
J = "";
|
|
370
370
|
let o = t;
|
|
@@ -373,9 +373,9 @@ function Un(n, e, t, r, i) {
|
|
|
373
373
|
const l = le.get(n[o]);
|
|
374
374
|
l !== null && M(l) && (ce === null && (ce = l.getFormat()), ue === "" && (ue = l.getStyle()));
|
|
375
375
|
}
|
|
376
|
-
|
|
376
|
+
Sn(e) && (J += Oe), i.element.__lexicalTextContent = J, J = s + J;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Ir(n, e) {
|
|
379
379
|
if (n) {
|
|
380
380
|
const t = n.__last;
|
|
381
381
|
if (t) {
|
|
@@ -386,11 +386,11 @@ function Lr(n, e) {
|
|
|
386
386
|
}
|
|
387
387
|
return null;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
const r =
|
|
389
|
+
function Li(n, e, t) {
|
|
390
|
+
const r = Ir(n, Je), i = Ir(e, le);
|
|
391
391
|
r !== i && e.getDOMSlot(t).setManagedLineBreak(i);
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function to(n, e, t) {
|
|
394
394
|
var r;
|
|
395
395
|
ce = null, ue = "", (function(i, s, o) {
|
|
396
396
|
const l = J, a = i.__size, c = s.__size;
|
|
@@ -400,7 +400,7 @@ function Qs(n, e, t) {
|
|
|
400
400
|
const d = i.__first, f = s.__first;
|
|
401
401
|
if (d === f) _t(d, u);
|
|
402
402
|
else {
|
|
403
|
-
const h =
|
|
403
|
+
const h = Yn(d), _ = tn(f, null);
|
|
404
404
|
try {
|
|
405
405
|
u.replaceChild(_, h);
|
|
406
406
|
} catch (p) {
|
|
@@ -416,7 +416,7 @@ function Qs(n, e, t) {
|
|
|
416
416
|
M(g) && (ce === null && (ce = g.getFormat()), ue === "" && (ue = g.getStyle()));
|
|
417
417
|
} else {
|
|
418
418
|
const d = nn(i, Je), f = nn(s, le);
|
|
419
|
-
if (d.length !== a && T(227), f.length !== c && T(228), a === 0) c !== 0 &&
|
|
419
|
+
if (d.length !== a && T(227), f.length !== c && T(228), a === 0) c !== 0 && Vn(f, s, 0, c - 1, o);
|
|
420
420
|
else if (c === 0) {
|
|
421
421
|
if (a !== 0) {
|
|
422
422
|
const g = o.after == null && o.before == null && o.element.__lexicalLineBreak == null;
|
|
@@ -427,15 +427,15 @@ function Qs(n, e, t) {
|
|
|
427
427
|
let N, C, w = y.getFirstChild(), k = 0, S = 0;
|
|
428
428
|
for (; k <= m && S <= b; ) {
|
|
429
429
|
const z = h[k], F = _[S];
|
|
430
|
-
if (z === F) w =
|
|
430
|
+
if (z === F) w = wn(_t(F, y.element)), k++, S++;
|
|
431
431
|
else {
|
|
432
432
|
N === void 0 && (N = new Set(h)), C === void 0 && (C = new Set(_));
|
|
433
433
|
const W = C.has(z), G = N.has(F);
|
|
434
434
|
if (W) if (G) {
|
|
435
|
-
const te =
|
|
436
|
-
te === w ? w =
|
|
435
|
+
const te = $e(Q, F);
|
|
436
|
+
te === w ? w = wn(_t(F, y.element)) : (y.withBefore(w).insertChild(te), _t(F, y.element)), k++, S++;
|
|
437
437
|
} else tn(F, y.withBefore(w)), S++;
|
|
438
|
-
else w =
|
|
438
|
+
else w = wn(Yn(z)), en(z, y.element), k++;
|
|
439
439
|
}
|
|
440
440
|
const I = le.get(F);
|
|
441
441
|
I !== null && M(I) && (ce === null && (ce = I.getFormat()), ue === "" && (ue = I.getStyle()));
|
|
@@ -443,11 +443,11 @@ function Qs(n, e, t) {
|
|
|
443
443
|
const O = k > m, D = S > b;
|
|
444
444
|
if (O && !D) {
|
|
445
445
|
const z = _[b + 1], F = z === void 0 ? null : Q.getElementByKey(z);
|
|
446
|
-
|
|
446
|
+
Vn(_, g, S, b, y.withBefore(F));
|
|
447
447
|
} else D && !O && jn(h, k, m, y.element);
|
|
448
448
|
})(s, d, f, a, c, o);
|
|
449
449
|
}
|
|
450
|
-
|
|
450
|
+
Sn(s) && (J += Oe), u.__lexicalTextContent = J, J = l + J;
|
|
451
451
|
})(n, e, e.getDOMSlot(t)), r = e, ce == null || ce === r.__textFormat || Zt || r.setTextFormat(ce), (function(i) {
|
|
452
452
|
ue === "" || ue === i.__textStyle || Zt || i.setTextStyle(ue);
|
|
453
453
|
})(e);
|
|
@@ -465,7 +465,7 @@ function _t(n, e) {
|
|
|
465
465
|
const t = Je.get(n);
|
|
466
466
|
let r = le.get(n);
|
|
467
467
|
t !== void 0 && r !== void 0 || T(61);
|
|
468
|
-
const i = Ze ||
|
|
468
|
+
const i = Ze || Jn.has(n) || Wn.has(n), s = $e(Q, n);
|
|
469
469
|
if (t === r && !i) {
|
|
470
470
|
if (v(t)) {
|
|
471
471
|
const o = s.__lexicalTextContent;
|
|
@@ -476,83 +476,83 @@ function _t(n, e) {
|
|
|
476
476
|
}
|
|
477
477
|
return s;
|
|
478
478
|
}
|
|
479
|
-
if (t !== r && i &&
|
|
479
|
+
if (t !== r && i && pr(Tt, kt, gn, r, "updated"), r.updateDOM(t, s, We)) {
|
|
480
480
|
const o = tn(n, null);
|
|
481
481
|
return e === null && T(62), e.replaceChild(o, s), en(n, null), o;
|
|
482
482
|
}
|
|
483
483
|
if (v(t) && v(r)) {
|
|
484
484
|
const o = r.__indent;
|
|
485
|
-
(Ze || o !== t.__indent) &&
|
|
485
|
+
(Ze || o !== t.__indent) && Di(s, o);
|
|
486
486
|
const l = r.__format;
|
|
487
|
-
if ((Ze || l !== t.__format) &&
|
|
487
|
+
if ((Ze || l !== t.__format) && Fi(s, l), i && (to(t, r, s), H(r) || r.isInline() || Li(t, r, s)), Sn(r) && (J += Oe, xe += Oe), (Ze || r.__dir !== t.__dir) && (Un(s, r), H(r) && !Ze)) for (const a of r.getChildren()) v(a) && Un($e(Q, a.getKey()), a);
|
|
488
488
|
} else {
|
|
489
489
|
const o = r.getTextContent();
|
|
490
490
|
if (B(r)) {
|
|
491
491
|
const l = r.decorate(Q, We);
|
|
492
|
-
l !== null &&
|
|
492
|
+
l !== null && Ii(n, l);
|
|
493
493
|
}
|
|
494
494
|
J += o, xe += o;
|
|
495
495
|
}
|
|
496
|
-
if (!Zt &&
|
|
496
|
+
if (!Zt && H(r) && r.__cachedText !== xe) {
|
|
497
497
|
const o = r.getWritable();
|
|
498
498
|
o.__cachedText = xe, r = o;
|
|
499
499
|
}
|
|
500
500
|
return s;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function Ii(n, e) {
|
|
503
503
|
let t = Q._pendingDecorators;
|
|
504
504
|
const r = Q._decorators;
|
|
505
505
|
if (t === null) {
|
|
506
506
|
if (r[n] === e) return;
|
|
507
|
-
t =
|
|
507
|
+
t = xs(Q);
|
|
508
508
|
}
|
|
509
509
|
t[n] = e;
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function wn(n) {
|
|
512
512
|
let e = n.nextSibling;
|
|
513
513
|
return e !== null && e === Q._blockCursorElement && (e = e.nextSibling), e;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
J = "", xe = "", Ze = r === 2, Q = t, We = t._config, kt = t._nodes,
|
|
515
|
+
function no(n, e, t, r, i, s) {
|
|
516
|
+
J = "", xe = "", Ze = r === 2, Q = t, We = t._config, kt = t._nodes, gn = Q._listeners.mutation, Wn = i, Jn = s, Je = n._nodeMap, le = e._nodeMap, Zt = e._readOnly, $n = new Map(t._keyToDOMMap);
|
|
517
517
|
const o = /* @__PURE__ */ new Map();
|
|
518
|
-
return Tt = o, _t("root", null), Q = void 0, kt = void 0,
|
|
518
|
+
return Tt = o, _t("root", null), Q = void 0, kt = void 0, Wn = void 0, Jn = void 0, Je = void 0, le = void 0, We = void 0, $n = void 0, Tt = void 0, o;
|
|
519
519
|
}
|
|
520
|
-
function
|
|
521
|
-
const e =
|
|
520
|
+
function Yn(n) {
|
|
521
|
+
const e = $n.get(n);
|
|
522
522
|
return e === void 0 && T(75, n), e;
|
|
523
523
|
}
|
|
524
524
|
function P(n) {
|
|
525
525
|
return { type: n };
|
|
526
526
|
}
|
|
527
|
-
const
|
|
528
|
-
if (yt = n.timeStamp,
|
|
529
|
-
if (
|
|
530
|
-
Wt(e,
|
|
531
|
-
}),
|
|
527
|
+
const Ki = P("SELECTION_CHANGE_COMMAND"), Sl = P("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"), ro = P("CLICK_COMMAND"), rn = P("DELETE_CHARACTER_COMMAND"), Vt = P("INSERT_LINE_BREAK_COMMAND"), Kr = P("INSERT_PARAGRAPH_COMMAND"), pt = P("CONTROLLED_TEXT_INSERTION_COMMAND"), zi = P("PASTE_COMMAND"), zr = P("REMOVE_TEXT_COMMAND"), sn = P("DELETE_WORD_COMMAND"), on = P("DELETE_LINE_COMMAND"), Ie = P("FORMAT_TEXT_COMMAND"), Bi = P("UNDO_COMMAND"), Ri = P("REDO_COMMAND"), io = P("KEYDOWN_COMMAND"), so = P("KEY_ARROW_RIGHT_COMMAND"), oo = P("MOVE_TO_END"), lo = P("KEY_ARROW_LEFT_COMMAND"), ao = P("MOVE_TO_START"), co = P("KEY_ARROW_UP_COMMAND"), uo = P("KEY_ARROW_DOWN_COMMAND"), Hn = P("KEY_ENTER_COMMAND"), fo = P("KEY_SPACE_COMMAND"), ho = P("KEY_BACKSPACE_COMMAND"), go = P("KEY_ESCAPE_COMMAND"), _o = P("KEY_DELETE_COMMAND"), po = P("KEY_TAB_COMMAND"), vl = P("INSERT_TAB_COMMAND"), kl = P("INDENT_CONTENT_COMMAND"), Tl = P("OUTDENT_CONTENT_COMMAND"), yo = P("DROP_COMMAND"), bl = P("FORMAT_ELEMENT_COMMAND"), mo = P("DRAGSTART_COMMAND"), xo = P("DRAGOVER_COMMAND"), Co = P("DRAGEND_COMMAND"), Wi = P("COPY_COMMAND"), Ji = P("CUT_COMMAND"), Br = P("SELECT_ALL_COMMAND"), Nl = P("CLEAR_EDITOR_COMMAND"), wl = P("CLEAR_HISTORY_COMMAND"), El = P("CAN_REDO_COMMAND"), Ml = P("CAN_UNDO_COMMAND"), So = P("FOCUS_COMMAND"), vo = P("BLUR_COMMAND"), ko = P("KEY_MODIFIER_COMMAND"), pe = Object.freeze({}), qn = [["keydown", function(n, e) {
|
|
528
|
+
if (yt = n.timeStamp, $i = n.key, !e.isComposing() && !E(e, io, n) && n.key != null) {
|
|
529
|
+
if (En && gi(n)) return ne(e, () => {
|
|
530
|
+
Wt(e, Mn);
|
|
531
|
+
}), En = !1, void (Mn = "");
|
|
532
532
|
if ((function(t) {
|
|
533
533
|
return K(t, "ArrowRight", { shiftKey: "any" });
|
|
534
|
-
})(n)) E(e,
|
|
534
|
+
})(n)) E(e, so, n);
|
|
535
535
|
else if ((function(t) {
|
|
536
536
|
return K(t, "ArrowRight", me);
|
|
537
|
-
})(n)) E(e,
|
|
537
|
+
})(n)) E(e, oo, n);
|
|
538
538
|
else if ((function(t) {
|
|
539
539
|
return K(t, "ArrowLeft", { shiftKey: "any" });
|
|
540
|
-
})(n)) E(e,
|
|
540
|
+
})(n)) E(e, lo, n);
|
|
541
541
|
else if ((function(t) {
|
|
542
542
|
return K(t, "ArrowLeft", me);
|
|
543
|
-
})(n)) E(e,
|
|
543
|
+
})(n)) E(e, ao, n);
|
|
544
544
|
else if ((function(t) {
|
|
545
545
|
return K(t, "ArrowUp", { altKey: "any", shiftKey: "any" });
|
|
546
|
-
})(n)) E(e,
|
|
546
|
+
})(n)) E(e, co, n);
|
|
547
547
|
else if ((function(t) {
|
|
548
548
|
return K(t, "ArrowDown", { altKey: "any", shiftKey: "any" });
|
|
549
|
-
})(n)) E(e,
|
|
549
|
+
})(n)) E(e, uo, n);
|
|
550
550
|
else if ((function(t) {
|
|
551
551
|
return K(t, "Enter", { altKey: "any", ctrlKey: "any", metaKey: "any", shiftKey: !0 });
|
|
552
552
|
})(n)) mt = !0, E(e, Hn, n);
|
|
553
553
|
else if ((function(t) {
|
|
554
554
|
return t.key === " ";
|
|
555
|
-
})(n)) E(e,
|
|
555
|
+
})(n)) E(e, fo, n);
|
|
556
556
|
else if ((function(t) {
|
|
557
557
|
return oe && K(t, "o", { ctrlKey: !0 });
|
|
558
558
|
})(n)) n.preventDefault(), mt = !0, E(e, Vt, !0);
|
|
@@ -561,20 +561,20 @@ const Ii = P("SELECTION_CHANGE_COMMAND"), xl = P("SELECTION_INSERT_CLIPBOARD_NOD
|
|
|
561
561
|
})(n)) mt = !1, E(e, Hn, n);
|
|
562
562
|
else if ((function(t) {
|
|
563
563
|
return K(t, "Backspace", { shiftKey: "any" }) || oe && K(t, "h", { ctrlKey: !0 });
|
|
564
|
-
})(n))
|
|
564
|
+
})(n)) gi(n) ? E(e, ho, n) : (n.preventDefault(), E(e, rn, !0));
|
|
565
565
|
else if ((function(t) {
|
|
566
566
|
return t.key === "Escape";
|
|
567
|
-
})(n)) E(e,
|
|
567
|
+
})(n)) E(e, go, n);
|
|
568
568
|
else if ((function(t) {
|
|
569
569
|
return K(t, "Delete", {}) || oe && K(t, "d", { ctrlKey: !0 });
|
|
570
570
|
})(n)) (function(t) {
|
|
571
571
|
return t.key === "Delete";
|
|
572
|
-
})(n) ? E(e,
|
|
572
|
+
})(n) ? E(e, _o, n) : (n.preventDefault(), E(e, rn, !1));
|
|
573
573
|
else if ((function(t) {
|
|
574
|
-
return K(t, "Backspace",
|
|
574
|
+
return K(t, "Backspace", hi);
|
|
575
575
|
})(n)) n.preventDefault(), E(e, sn, !0);
|
|
576
576
|
else if ((function(t) {
|
|
577
|
-
return K(t, "Delete",
|
|
577
|
+
return K(t, "Delete", hi);
|
|
578
578
|
})(n)) n.preventDefault(), E(e, sn, !1);
|
|
579
579
|
else if ((function(t) {
|
|
580
580
|
return oe && K(t, "Backspace", { metaKey: !0 });
|
|
@@ -593,60 +593,60 @@ const Ii = P("SELECTION_CHANGE_COMMAND"), xl = P("SELECTION_INSERT_CLIPBOARD_NOD
|
|
|
593
593
|
})(n)) n.preventDefault(), E(e, Ie, "italic");
|
|
594
594
|
else if ((function(t) {
|
|
595
595
|
return K(t, "Tab", { shiftKey: "any" });
|
|
596
|
-
})(n)) E(e,
|
|
596
|
+
})(n)) E(e, po, n);
|
|
597
597
|
else if ((function(t) {
|
|
598
598
|
return K(t, "z", me);
|
|
599
|
-
})(n)) n.preventDefault(), E(e,
|
|
599
|
+
})(n)) n.preventDefault(), E(e, Bi, void 0);
|
|
600
600
|
else if ((function(t) {
|
|
601
601
|
return oe ? K(t, "z", { metaKey: !0, shiftKey: !0 }) : K(t, "y", { ctrlKey: !0 }) || K(t, "z", { ctrlKey: !0, shiftKey: !0 });
|
|
602
|
-
})(n)) n.preventDefault(), E(e,
|
|
602
|
+
})(n)) n.preventDefault(), E(e, Ri, void 0);
|
|
603
603
|
else {
|
|
604
604
|
const t = e._editorState._selection;
|
|
605
|
-
t === null || A(t) ?
|
|
605
|
+
t === null || A(t) ? _i(n) && (n.preventDefault(), E(e, Br, n)) : (function(r) {
|
|
606
606
|
return K(r, "c", me);
|
|
607
|
-
})(n) ? (n.preventDefault(), E(e,
|
|
607
|
+
})(n) ? (n.preventDefault(), E(e, Wi, n)) : (function(r) {
|
|
608
608
|
return K(r, "x", me);
|
|
609
|
-
})(n) ? (n.preventDefault(), E(e,
|
|
609
|
+
})(n) ? (n.preventDefault(), E(e, Ji, n)) : _i(n) && (n.preventDefault(), E(e, Br, n));
|
|
610
610
|
}
|
|
611
611
|
(function(t) {
|
|
612
612
|
return t.ctrlKey || t.shiftKey || t.altKey || t.metaKey;
|
|
613
|
-
})(n) && E(e,
|
|
613
|
+
})(n) && E(e, ko, n);
|
|
614
614
|
}
|
|
615
615
|
}], ["pointerdown", function(n, e) {
|
|
616
616
|
const t = n.target, r = n.pointerType;
|
|
617
617
|
It(t) && r !== "touch" && r !== "pen" && n.button === 0 && ne(e, () => {
|
|
618
|
-
|
|
618
|
+
ui(t) || (Qn = !0);
|
|
619
619
|
});
|
|
620
620
|
}], ["compositionstart", function(n, e) {
|
|
621
621
|
ne(e, () => {
|
|
622
622
|
const t = L();
|
|
623
623
|
if (A(t) && !e.isComposing()) {
|
|
624
624
|
const r = t.anchor, i = t.anchor.getNode();
|
|
625
|
-
|
|
625
|
+
Y(r.key), (n.timeStamp < yt + 30 || r.type === "element" || !t.isCollapsed() || i.getFormat() !== t.format || M(i) && i.getStyle() !== t.style) && E(e, pt, $s);
|
|
626
626
|
}
|
|
627
627
|
});
|
|
628
628
|
}], ["compositionend", function(n, e) {
|
|
629
629
|
Be ? ht = !0 : st || !St && !vt ? ne(e, () => {
|
|
630
630
|
Wt(e, n.data);
|
|
631
|
-
}) : (
|
|
631
|
+
}) : (En = !0, Mn = n.data);
|
|
632
632
|
}], ["input", function(n, e) {
|
|
633
633
|
n.stopPropagation(), ne(e, () => {
|
|
634
|
-
if (ee(n.target) &&
|
|
634
|
+
if (ee(n.target) && ui(n.target)) return;
|
|
635
635
|
const t = L(), r = n.data, i = Hi(n);
|
|
636
|
-
if (r != null && A(t) &&
|
|
636
|
+
if (r != null && A(t) && Vi(t, i, r, n.timeStamp, !1)) {
|
|
637
637
|
ht && (Wt(e, r), ht = !1);
|
|
638
638
|
const s = t.anchor.getNode(), o = Se(se(e));
|
|
639
639
|
if (o === null) return;
|
|
640
640
|
const l = t.isBackward(), a = l ? t.anchor.offset : t.focus.offset, c = l ? t.focus.offset : t.anchor.offset;
|
|
641
|
-
Qt && !t.isCollapsed() && M(s) && o.anchorNode !== null && s.getTextContent().slice(0, a) + r + s.getTextContent().slice(a + c) ===
|
|
641
|
+
Qt && !t.isCollapsed() && M(s) && o.anchorNode !== null && s.getTextContent().slice(0, a) + r + s.getTextContent().slice(a + c) === ks(o.anchorNode) || E(e, pt, r);
|
|
642
642
|
const u = r.length;
|
|
643
|
-
Be && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), St || st || vt || !e.isComposing() || (yt = 0,
|
|
643
|
+
Be && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), St || st || vt || !e.isComposing() || (yt = 0, Y(null));
|
|
644
644
|
} else
|
|
645
|
-
|
|
645
|
+
gr(!1, e, r !== null ? r : void 0), ht && (Wt(e, r || void 0), ht = !1);
|
|
646
646
|
(function() {
|
|
647
647
|
X();
|
|
648
648
|
const s = R();
|
|
649
|
-
|
|
649
|
+
Oi(s);
|
|
650
650
|
})();
|
|
651
651
|
}, { event: n }), et = null;
|
|
652
652
|
}], ["click", function(n, e) {
|
|
@@ -655,22 +655,22 @@ const Ii = P("SELECTION_CHANGE_COMMAND"), xl = P("SELECTION_INSERT_CLIPBOARD_NOD
|
|
|
655
655
|
if (r) {
|
|
656
656
|
if (A(t)) {
|
|
657
657
|
const s = t.anchor, o = s.getNode();
|
|
658
|
-
if (s.type === "element" && s.offset === 0 && t.isCollapsed() && !
|
|
658
|
+
if (s.type === "element" && s.offset === 0 && t.isCollapsed() && !H(o) && ie().getChildrenSize() === 1 && o.getTopLevelElementOrThrow().isEmpty() && i !== null && t.is(i)) r.removeAllRanges(), t.dirty = !0;
|
|
659
659
|
else if (n.detail === 3 && !t.isCollapsed() && o !== t.focus.getNode()) {
|
|
660
660
|
const l = qt(o, (a) => v(a) && !a.isInline());
|
|
661
661
|
v(l) && l.select(0);
|
|
662
662
|
}
|
|
663
663
|
} else if (n.pointerType === "touch" || n.pointerType === "pen") {
|
|
664
664
|
const s = r.anchorNode;
|
|
665
|
-
(ee(s) || ve(s)) && re(
|
|
665
|
+
(ee(s) || ve(s)) && re(pn(i, r, e, n));
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
E(e,
|
|
668
|
+
E(e, ro, n);
|
|
669
669
|
});
|
|
670
670
|
}], ["cut", pe], ["copy", pe], ["dragstart", pe], ["dragover", pe], ["dragend", pe], ["paste", pe], ["focus", pe], ["blur", pe], ["drop", pe]];
|
|
671
|
-
Qt &&
|
|
671
|
+
Qt && qn.push(["beforeinput", (n, e) => (function(t, r) {
|
|
672
672
|
const i = t.inputType, s = Hi(t);
|
|
673
|
-
i === "deleteCompositionText" || Be &&
|
|
673
|
+
i === "deleteCompositionText" || Be && Ts(r) || i !== "insertCompositionText" && ne(r, () => {
|
|
674
674
|
const o = L();
|
|
675
675
|
if (i === "deleteContentBackward") {
|
|
676
676
|
if (o === null) {
|
|
@@ -680,23 +680,23 @@ Qt && Yn.push(["beforeinput", (n, e) => (function(t, r) {
|
|
|
680
680
|
}
|
|
681
681
|
if (A(o)) {
|
|
682
682
|
const g = o.anchor.key === o.focus.key;
|
|
683
|
-
if (l = t.timeStamp,
|
|
684
|
-
if (
|
|
683
|
+
if (l = t.timeStamp, $i === "MediaLast" && l < yt + 30 && r.isComposing() && g) {
|
|
684
|
+
if (Y(null), yt = 0, setTimeout(() => {
|
|
685
685
|
ne(r, () => {
|
|
686
|
-
|
|
686
|
+
Y(null);
|
|
687
687
|
});
|
|
688
688
|
}, 30), A(o)) {
|
|
689
689
|
const h = o.anchor.getNode();
|
|
690
|
-
h.markDirty(), M(h) || T(142),
|
|
690
|
+
h.markDirty(), M(h) || T(142), Yi(o, h);
|
|
691
691
|
}
|
|
692
692
|
} else {
|
|
693
|
-
|
|
693
|
+
Y(null), t.preventDefault();
|
|
694
694
|
const h = o.anchor.getNode(), _ = h.getTextContent(), p = h.canInsertTextAfter(), x = o.anchor.offset === 0 && o.focus.offset === _.length;
|
|
695
|
-
let y =
|
|
696
|
-
if (y && o.isCollapsed() && (y = !B(
|
|
695
|
+
let y = br && g && !x && p;
|
|
696
|
+
if (y && o.isCollapsed() && (y = !B(Ho(o.anchor, !0))), !y) {
|
|
697
697
|
E(r, rn, !0);
|
|
698
698
|
const m = L();
|
|
699
|
-
|
|
699
|
+
br && A(m) && m.isCollapsed() && (Le = m, setTimeout(() => Le = null));
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
return;
|
|
@@ -705,7 +705,7 @@ Qt && Yn.push(["beforeinput", (n, e) => (function(t, r) {
|
|
|
705
705
|
var l;
|
|
706
706
|
if (!A(o)) return;
|
|
707
707
|
const a = t.data;
|
|
708
|
-
et !== null &&
|
|
708
|
+
et !== null && gr(!1, r, et), o.dirty && et === null || !o.isCollapsed() || H(o.anchor.getNode()) || s === null || o.applyDOMRange(s), et = null;
|
|
709
709
|
const c = o.anchor, u = o.focus, d = c.getNode(), f = u.getNode();
|
|
710
710
|
if (i !== "insertText" && i !== "insertTranspose") switch (t.preventDefault(), i) {
|
|
711
711
|
case "insertFromYank":
|
|
@@ -714,26 +714,26 @@ Qt && Yn.push(["beforeinput", (n, e) => (function(t, r) {
|
|
|
714
714
|
E(r, pt, t);
|
|
715
715
|
break;
|
|
716
716
|
case "insertFromComposition":
|
|
717
|
-
|
|
717
|
+
Y(null), E(r, pt, t);
|
|
718
718
|
break;
|
|
719
719
|
case "insertLineBreak":
|
|
720
|
-
|
|
720
|
+
Y(null), E(r, Vt, !1);
|
|
721
721
|
break;
|
|
722
722
|
case "insertParagraph":
|
|
723
|
-
|
|
723
|
+
Y(null), mt && !st ? (mt = !1, E(r, Vt, !1)) : E(r, Kr, void 0);
|
|
724
724
|
break;
|
|
725
725
|
case "insertFromPaste":
|
|
726
726
|
case "insertFromPasteAsQuotation":
|
|
727
|
-
E(r,
|
|
727
|
+
E(r, zi, t);
|
|
728
728
|
break;
|
|
729
729
|
case "deleteByComposition":
|
|
730
730
|
(function(g, h) {
|
|
731
731
|
return g !== h || v(g) || v(h) || !Ke(g) || !Ke(h);
|
|
732
|
-
})(d, f) && E(r,
|
|
732
|
+
})(d, f) && E(r, zr, t);
|
|
733
733
|
break;
|
|
734
734
|
case "deleteByDrag":
|
|
735
735
|
case "deleteByCut":
|
|
736
|
-
E(r,
|
|
736
|
+
E(r, zr, t);
|
|
737
737
|
break;
|
|
738
738
|
case "deleteContent":
|
|
739
739
|
E(r, rn, !1);
|
|
@@ -766,29 +766,29 @@ Qt && Yn.push(["beforeinput", (n, e) => (function(t, r) {
|
|
|
766
766
|
E(r, Ie, "underline");
|
|
767
767
|
break;
|
|
768
768
|
case "historyUndo":
|
|
769
|
-
E(r,
|
|
769
|
+
E(r, Bi, void 0);
|
|
770
770
|
break;
|
|
771
771
|
case "historyRedo":
|
|
772
|
-
E(r,
|
|
772
|
+
E(r, Ri, void 0);
|
|
773
773
|
}
|
|
774
774
|
else {
|
|
775
775
|
if (a === `
|
|
776
776
|
`) t.preventDefault(), E(r, Vt, !1);
|
|
777
|
-
else if (a === Oe) t.preventDefault(), E(r,
|
|
777
|
+
else if (a === Oe) t.preventDefault(), E(r, Kr, void 0);
|
|
778
778
|
else if (a == null && t.dataTransfer) {
|
|
779
779
|
const g = t.dataTransfer.getData("text/plain");
|
|
780
780
|
t.preventDefault(), o.insertRawText(g);
|
|
781
|
-
} else a != null &&
|
|
781
|
+
} else a != null && Vi(o, s, a, t.timeStamp, !0) ? (t.preventDefault(), E(r, pt, a)) : et = a;
|
|
782
782
|
ji = t.timeStamp;
|
|
783
783
|
}
|
|
784
784
|
});
|
|
785
785
|
})(n, e)]);
|
|
786
|
-
let yt = 0,
|
|
787
|
-
const
|
|
788
|
-
let
|
|
789
|
-
function
|
|
786
|
+
let yt = 0, $i = null, ji = 0, et = null;
|
|
787
|
+
const Gn = /* @__PURE__ */ new WeakMap(), ln = /* @__PURE__ */ new WeakMap();
|
|
788
|
+
let Xn = !1, Qn = !1, mt = !1, ht = !1, En = !1, Mn = "", Le = null, Ui = [0, "", 0, "root", 0];
|
|
789
|
+
function Vi(n, e, t, r, i) {
|
|
790
790
|
const s = n.anchor, o = n.focus, l = s.getNode(), a = R(), c = Se(se(a)), u = c !== null ? c.anchorNode : null, d = s.key, f = a.getElementByKey(d), g = t.length;
|
|
791
|
-
return d !== o.key || !M(l) || (!i && (!Qt || ji < r + 50) || l.isDirty() && g < 2 ||
|
|
791
|
+
return d !== o.key || !M(l) || (!i && (!Qt || ji < r + 50) || l.isDirty() && g < 2 || Ss(t)) && s.offset !== o.offset && !l.isComposing() || Te(l) || l.isDirty() && g > 1 || (i || !Qt) && f !== null && !l.isComposing() && u !== lt(f) || c !== null && e !== null && (!e.collapsed || e.startContainer !== c.anchorNode || e.startOffset !== c.anchorOffset) || l.getFormat() !== n.format || l.getStyle() !== n.style || (function(h, _) {
|
|
792
792
|
if (_.isSegmented()) return !0;
|
|
793
793
|
if (!h.isCollapsed()) return !1;
|
|
794
794
|
const p = h.anchor.offset, x = _.getParentOrThrow(), y = Ke(_);
|
|
@@ -798,14 +798,14 @@ function Ui(n, e, t, r, i) {
|
|
|
798
798
|
})(_) : p === _.getTextContentSize() && (!_.canInsertTextAfter() || !x.canInsertTextAfter() && !_.isComposing() || y);
|
|
799
799
|
})(n, l);
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function Rr(n, e) {
|
|
802
802
|
return ve(n) && n.nodeValue !== null && e !== 0 && e !== n.nodeValue.length;
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function Wr(n, e, t) {
|
|
805
805
|
const { anchorNode: r, anchorOffset: i, focusNode: s, focusOffset: o } = n;
|
|
806
|
-
|
|
806
|
+
Xn && (Xn = !1, Rr(r, i) && Rr(s, o) && !Le) || ne(e, () => {
|
|
807
807
|
if (!t) return void re(null);
|
|
808
|
-
if (!
|
|
808
|
+
if (!mn(e, r, s)) return;
|
|
809
809
|
let l = L();
|
|
810
810
|
if (Le && A(l) && l.isCollapsed()) {
|
|
811
811
|
const a = l.anchor, c = Le.anchor;
|
|
@@ -815,16 +815,16 @@ function Rr(n, e, t) {
|
|
|
815
815
|
const a = l.anchor, c = a.getNode();
|
|
816
816
|
if (l.isCollapsed()) {
|
|
817
817
|
n.type === "Range" && n.anchorNode === n.focusNode && (l.dirty = !0);
|
|
818
|
-
const u = se(e).event, d = u ? u.timeStamp : performance.now(), [f, g, h, _, p] =
|
|
819
|
-
if (d < p + 200 && a.offset === h && a.key === _)
|
|
820
|
-
else if (a.type === "text") M(c) || T(141),
|
|
818
|
+
const u = se(e).event, d = u ? u.timeStamp : performance.now(), [f, g, h, _, p] = Ui, x = ie(), y = e.isComposing() === !1 && x.getTextContent() === "";
|
|
819
|
+
if (d < p + 200 && a.offset === h && a.key === _) Yt(l, f, g);
|
|
820
|
+
else if (a.type === "text") M(c) || T(141), Yi(l, c);
|
|
821
821
|
else if (a.type === "element" && !y) {
|
|
822
822
|
v(c) || T(259);
|
|
823
823
|
const m = a.getNode();
|
|
824
824
|
m.isEmpty() ? (function(b, N) {
|
|
825
825
|
const C = N.getTextFormat(), w = N.getTextStyle();
|
|
826
|
-
|
|
827
|
-
})(l, m) :
|
|
826
|
+
Yt(b, C, w);
|
|
827
|
+
})(l, m) : Yt(l, 0, "");
|
|
828
828
|
}
|
|
829
829
|
} else {
|
|
830
830
|
const u = a.key, d = l.focus.key, f = l.getNodes(), g = f.length, h = l.isBackward(), _ = h ? o : i, p = h ? i : o, x = h ? d : u, y = h ? u : d;
|
|
@@ -836,14 +836,14 @@ function Rr(n, e, t) {
|
|
|
836
836
|
l.format = b ? m : 0;
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
E(e,
|
|
839
|
+
E(e, Ki, void 0);
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function Yt(n, e, t) {
|
|
843
843
|
n.format === e && n.style === t || (n.format = e, n.style = t, n.dirty = !0);
|
|
844
844
|
}
|
|
845
|
-
function
|
|
846
|
-
|
|
845
|
+
function Yi(n, e) {
|
|
846
|
+
Yt(n, e.getFormat(), e.getStyle());
|
|
847
847
|
}
|
|
848
848
|
function Hi(n) {
|
|
849
849
|
if (!n.getTargetRanges) return null;
|
|
@@ -852,10 +852,10 @@ function Hi(n) {
|
|
|
852
852
|
}
|
|
853
853
|
function Wt(n, e) {
|
|
854
854
|
const t = n._compositionKey;
|
|
855
|
-
if (
|
|
855
|
+
if (Y(null), t !== null && e != null) {
|
|
856
856
|
if (e === "") {
|
|
857
857
|
const r = U(t), i = lt(n.getElementByKey(t));
|
|
858
|
-
return void (i !== null && i.nodeValue !== null && M(r) &&
|
|
858
|
+
return void (i !== null && i.nodeValue !== null && M(r) && _r(r, i.nodeValue, null, null, !0));
|
|
859
859
|
}
|
|
860
860
|
if (e[e.length - 1] === `
|
|
861
861
|
`) {
|
|
@@ -866,50 +866,50 @@ function Wt(n, e) {
|
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
|
-
|
|
869
|
+
gr(!0, n, e);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function qi(n) {
|
|
872
872
|
let e = n.__lexicalEventHandles;
|
|
873
873
|
return e === void 0 && (e = [], n.__lexicalEventHandles = e), e;
|
|
874
874
|
}
|
|
875
875
|
const nt = /* @__PURE__ */ new Map();
|
|
876
|
-
function
|
|
877
|
-
const e =
|
|
876
|
+
function Gi(n) {
|
|
877
|
+
const e = el(n.target);
|
|
878
878
|
if (e === null) return;
|
|
879
|
-
const t =
|
|
879
|
+
const t = ps(e.anchorNode);
|
|
880
880
|
if (t === null) return;
|
|
881
|
-
|
|
881
|
+
Qn && (Qn = !1, ne(t, () => {
|
|
882
882
|
const a = ut(), c = e.anchorNode;
|
|
883
|
-
(ee(c) || ve(c)) && re(
|
|
883
|
+
(ee(c) || ve(c)) && re(pn(a, e, t, n));
|
|
884
884
|
}));
|
|
885
|
-
const r =
|
|
886
|
-
l !== t &&
|
|
885
|
+
const r = hr(t), i = r[r.length - 1], s = i._key, o = nt.get(s), l = o || i;
|
|
886
|
+
l !== t && Wr(e, l, !1), Wr(e, t, !0), t !== i ? nt.set(s, t) : o && nt.delete(s);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Jr(n) {
|
|
889
889
|
n._lexicalHandled = !0;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function $r(n) {
|
|
892
892
|
return n._lexicalHandled === !0;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
const e =
|
|
894
|
+
function To(n) {
|
|
895
|
+
const e = Gn.get(n);
|
|
896
896
|
if (e === void 0) return;
|
|
897
897
|
const t = ln.get(e);
|
|
898
898
|
if (t === void 0) return;
|
|
899
899
|
const r = t - 1;
|
|
900
|
-
r >= 0 || T(164),
|
|
901
|
-
const i =
|
|
902
|
-
|
|
900
|
+
r >= 0 || T(164), Gn.delete(n), ln.set(e, r), r === 0 && e.removeEventListener("selectionchange", Gi);
|
|
901
|
+
const i = xn(n);
|
|
902
|
+
fr(i) ? ((function(o) {
|
|
903
903
|
if (o._parentEditor !== null) {
|
|
904
|
-
const l =
|
|
904
|
+
const l = hr(o), a = l[l.length - 1]._key;
|
|
905
905
|
nt.get(a) === o && nt.delete(a);
|
|
906
906
|
} else nt.delete(o._key);
|
|
907
907
|
})(i), n.__lexicalEditor = null) : i && T(198);
|
|
908
|
-
const s =
|
|
908
|
+
const s = qi(n);
|
|
909
909
|
for (let o = 0; o < s.length; o++) s[o]();
|
|
910
910
|
n.__lexicalEventHandles = [];
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function Zn(n, e, t) {
|
|
913
913
|
X();
|
|
914
914
|
const r = n.__key, i = n.getParent();
|
|
915
915
|
if (i === null) return;
|
|
@@ -917,22 +917,26 @@ function Qn(n, e, t) {
|
|
|
917
917
|
const a = L();
|
|
918
918
|
if (!A(a) || !v(l)) return a;
|
|
919
919
|
const { anchor: c, focus: u } = a, d = c.getNode(), f = u.getNode();
|
|
920
|
-
return
|
|
920
|
+
return tr(d, l) && c.set(l.__key, 0, "element"), tr(f, l) && u.set(l.__key, 0, "element"), a;
|
|
921
921
|
})(n);
|
|
922
922
|
let o = !1;
|
|
923
923
|
if (A(s) && e) {
|
|
924
924
|
const l = s.anchor, a = s.focus;
|
|
925
|
-
l.key === r && (
|
|
926
|
-
} else
|
|
925
|
+
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);
|
|
926
|
+
} else lr(s) && e && n.isSelected() && n.selectPrevious();
|
|
927
927
|
if (A(s) && e && !o) {
|
|
928
928
|
const l = n.getIndexWithinParent();
|
|
929
|
-
ze(n),
|
|
929
|
+
ze(n), cn(s, i, l, -1);
|
|
930
930
|
} else ze(n);
|
|
931
|
-
t || De(i) || i.canBeEmpty() || !i.isEmpty() ||
|
|
931
|
+
t || De(i) || i.canBeEmpty() || !i.isEmpty() || Zn(i, e), e && s && H(i) && i.isEmpty() && i.selectEnd();
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function Ol(n) {
|
|
934
934
|
return n;
|
|
935
935
|
}
|
|
936
|
+
const Xi = Symbol.for("ephemeral");
|
|
937
|
+
function an(n) {
|
|
938
|
+
return n[Xi] || !1;
|
|
939
|
+
}
|
|
936
940
|
class we {
|
|
937
941
|
__type;
|
|
938
942
|
__key;
|
|
@@ -941,7 +945,7 @@ class we {
|
|
|
941
945
|
__next;
|
|
942
946
|
__state;
|
|
943
947
|
static getType() {
|
|
944
|
-
const { ownNodeType: e } =
|
|
948
|
+
const { ownNodeType: e } = mr(this);
|
|
945
949
|
return e === void 0 && T(64, this.name), e;
|
|
946
950
|
}
|
|
947
951
|
static clone(e) {
|
|
@@ -959,7 +963,7 @@ class we {
|
|
|
959
963
|
}
|
|
960
964
|
static importDOM;
|
|
961
965
|
constructor(e) {
|
|
962
|
-
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 }),
|
|
966
|
+
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);
|
|
963
967
|
}
|
|
964
968
|
getType() {
|
|
965
969
|
return this.__type;
|
|
@@ -1068,7 +1072,7 @@ class we {
|
|
|
1068
1072
|
}
|
|
1069
1073
|
isBefore(e) {
|
|
1070
1074
|
const t = Gt(this, e);
|
|
1071
|
-
return t !== null && (t.type === "descendant" || (t.type === "branch" ?
|
|
1075
|
+
return t !== null && (t.type === "descendant" || (t.type === "branch" ? Os(t) === -1 : (t.type !== "same" && t.type !== "ancestor" && T(279), !1)));
|
|
1072
1076
|
}
|
|
1073
1077
|
isParentOf(e) {
|
|
1074
1078
|
const t = Gt(this, e);
|
|
@@ -1106,15 +1110,17 @@ class we {
|
|
|
1106
1110
|
return e !== null && e.has(this.__key);
|
|
1107
1111
|
}
|
|
1108
1112
|
getLatest() {
|
|
1113
|
+
if (an(this)) return this;
|
|
1109
1114
|
const e = U(this.__key);
|
|
1110
1115
|
return e === null && T(113), e;
|
|
1111
1116
|
}
|
|
1112
1117
|
getWritable() {
|
|
1118
|
+
if (an(this)) return this;
|
|
1113
1119
|
X();
|
|
1114
1120
|
const e = Pe(), t = R(), r = e._nodeMap, i = this.__key, s = this.getLatest(), o = t._cloneNotNeeded, l = L();
|
|
1115
|
-
if (l !== null && l.setCachedNodes(null), o.has(i)) return
|
|
1116
|
-
const a =
|
|
1117
|
-
return o.add(i),
|
|
1121
|
+
if (l !== null && l.setCachedNodes(null), o.has(i)) return dn(s), s;
|
|
1122
|
+
const a = Ns(s);
|
|
1123
|
+
return o.add(i), dn(a), r.set(i, a), a;
|
|
1118
1124
|
}
|
|
1119
1125
|
getTextContent() {
|
|
1120
1126
|
return "";
|
|
@@ -1142,34 +1148,34 @@ class we {
|
|
|
1142
1148
|
return (function(t, r) {
|
|
1143
1149
|
const i = t.getWritable(), s = r.$;
|
|
1144
1150
|
let o = s;
|
|
1145
|
-
for (const l of
|
|
1146
|
-
return (i.__state || o) &&
|
|
1151
|
+
for (const l of Pi(i).flatKeys) l in r && (o !== void 0 && o !== s || (o = { ...s }), o[l] = r[l]);
|
|
1152
|
+
return (i.__state || o) && Zs(t).updateFromJSON(o), i;
|
|
1147
1153
|
})(this, e);
|
|
1148
1154
|
}
|
|
1149
1155
|
static transform() {
|
|
1150
1156
|
return null;
|
|
1151
1157
|
}
|
|
1152
1158
|
remove(e) {
|
|
1153
|
-
|
|
1159
|
+
Zn(this, !0, e);
|
|
1154
1160
|
}
|
|
1155
1161
|
replace(e, t) {
|
|
1156
1162
|
X();
|
|
1157
1163
|
let r = L();
|
|
1158
|
-
r !== null && (r = r.clone()),
|
|
1164
|
+
r !== null && (r = r.clone()), In(this, e);
|
|
1159
1165
|
const i = this.getLatest(), s = this.__key, o = e.__key, l = e.getWritable(), a = this.getParentOrThrow().getWritable(), c = a.__size;
|
|
1160
1166
|
ze(l);
|
|
1161
1167
|
const u = i.getPreviousSibling(), d = i.getNextSibling(), f = i.__prev, g = i.__next, h = i.__parent;
|
|
1162
|
-
if (
|
|
1168
|
+
if (Zn(i, !1, !0), u === null ? a.__first = o : u.getWritable().__next = o, l.__prev = f, d === null ? a.__last = o : d.getWritable().__prev = o, l.__next = g, l.__parent = h, a.__size = c, t && (v(this) && v(l) || T(139), this.getChildren().forEach((_) => {
|
|
1163
1169
|
l.append(_);
|
|
1164
1170
|
})), A(r)) {
|
|
1165
1171
|
re(r);
|
|
1166
1172
|
const _ = r.anchor, p = r.focus;
|
|
1167
|
-
_.key === s &&
|
|
1173
|
+
_.key === s && Yr(_, l), p.key === s && Yr(p, l);
|
|
1168
1174
|
}
|
|
1169
|
-
return Ne() === s &&
|
|
1175
|
+
return Ne() === s && Y(o), l;
|
|
1170
1176
|
}
|
|
1171
1177
|
insertAfter(e, t = !0) {
|
|
1172
|
-
X(),
|
|
1178
|
+
X(), In(this, e);
|
|
1173
1179
|
const r = this.getWritable(), i = e.getWritable(), s = i.getParent(), o = L();
|
|
1174
1180
|
let l = !1, a = !1;
|
|
1175
1181
|
if (s !== null) {
|
|
@@ -1182,20 +1188,20 @@ class we {
|
|
|
1182
1188
|
const c = this.getNextSibling(), u = this.getParentOrThrow().getWritable(), d = i.__key, f = r.__next;
|
|
1183
1189
|
if (c === null ? u.__last = d : c.getWritable().__prev = d, u.__size++, r.__next = d, i.__next = f, i.__prev = r.__key, i.__parent = r.__parent, t && A(o)) {
|
|
1184
1190
|
const g = this.getIndexWithinParent();
|
|
1185
|
-
|
|
1191
|
+
cn(o, u, g + 1);
|
|
1186
1192
|
const h = u.__key;
|
|
1187
1193
|
l && o.anchor.set(h, g + 2, "element"), a && o.focus.set(h, g + 2, "element");
|
|
1188
1194
|
}
|
|
1189
1195
|
return e;
|
|
1190
1196
|
}
|
|
1191
1197
|
insertBefore(e, t = !0) {
|
|
1192
|
-
X(),
|
|
1198
|
+
X(), In(this, e);
|
|
1193
1199
|
const r = this.getWritable(), i = e.getWritable(), s = i.__key;
|
|
1194
1200
|
ze(i);
|
|
1195
1201
|
const o = this.getPreviousSibling(), l = this.getParentOrThrow().getWritable(), a = r.__prev, c = this.getIndexWithinParent();
|
|
1196
1202
|
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;
|
|
1197
1203
|
const u = L();
|
|
1198
|
-
return t && A(u) &&
|
|
1204
|
+
return t && A(u) && cn(u, this.getParentOrThrow(), c), e;
|
|
1199
1205
|
}
|
|
1200
1206
|
isParentRequired() {
|
|
1201
1207
|
return !1;
|
|
@@ -1238,7 +1244,7 @@ class we {
|
|
|
1238
1244
|
this.markDirty();
|
|
1239
1245
|
}
|
|
1240
1246
|
}
|
|
1241
|
-
const
|
|
1247
|
+
const Al = "historic", Pl = "history-push", On = "history-merge", Dl = "paste", bo = "collaboration", No = "skip-scroll-into-view", wo = "skip-dom-selection", Eo = "skip-selection-focus";
|
|
1242
1248
|
class Et extends we {
|
|
1243
1249
|
static getType() {
|
|
1244
1250
|
return "linebreak";
|
|
@@ -1265,7 +1271,7 @@ class Et extends we {
|
|
|
1265
1271
|
static importDOM() {
|
|
1266
1272
|
return { br: (e) => (function(t) {
|
|
1267
1273
|
const r = t.parentElement;
|
|
1268
|
-
if (r !== null &&
|
|
1274
|
+
if (r !== null && yi(r)) {
|
|
1269
1275
|
const i = r.firstChild;
|
|
1270
1276
|
if (i === t || i.nextSibling === t && Jt(i)) {
|
|
1271
1277
|
const s = r.lastChild;
|
|
@@ -1275,24 +1281,24 @@ class Et extends we {
|
|
|
1275
1281
|
return !1;
|
|
1276
1282
|
})(e) || (function(t) {
|
|
1277
1283
|
const r = t.parentElement;
|
|
1278
|
-
if (r !== null &&
|
|
1284
|
+
if (r !== null && yi(r)) {
|
|
1279
1285
|
const i = r.firstChild;
|
|
1280
1286
|
if (i === t || i.nextSibling === t && Jt(i)) return !1;
|
|
1281
1287
|
const s = r.lastChild;
|
|
1282
1288
|
if (s === t || s.previousSibling === t && Jt(s)) return !0;
|
|
1283
1289
|
}
|
|
1284
1290
|
return !1;
|
|
1285
|
-
})(e) ? null : { conversion:
|
|
1291
|
+
})(e) ? null : { conversion: Mo, priority: 0 } };
|
|
1286
1292
|
}
|
|
1287
1293
|
static importJSON(e) {
|
|
1288
1294
|
return bt().updateFromJSON(e);
|
|
1289
1295
|
}
|
|
1290
1296
|
}
|
|
1291
|
-
function
|
|
1297
|
+
function Mo(n) {
|
|
1292
1298
|
return { node: bt() };
|
|
1293
1299
|
}
|
|
1294
1300
|
function bt() {
|
|
1295
|
-
return
|
|
1301
|
+
return vn(new Et());
|
|
1296
1302
|
}
|
|
1297
1303
|
function rt(n) {
|
|
1298
1304
|
return n instanceof Et;
|
|
@@ -1300,13 +1306,13 @@ function rt(n) {
|
|
|
1300
1306
|
function Jt(n) {
|
|
1301
1307
|
return ve(n) && /^( |\t|\r?\n)+$/.test(n.textContent || "");
|
|
1302
1308
|
}
|
|
1303
|
-
function On(n, e) {
|
|
1304
|
-
return 16 & e ? "code" : e & Ni ? "mark" : 32 & e ? "sub" : 64 & e ? "sup" : null;
|
|
1305
|
-
}
|
|
1306
1309
|
function An(n, e) {
|
|
1310
|
+
return 16 & e ? "code" : e & wi ? "mark" : 32 & e ? "sub" : 64 & e ? "sup" : null;
|
|
1311
|
+
}
|
|
1312
|
+
function Pn(n, e) {
|
|
1307
1313
|
return 1 & e ? "strong" : 2 & e ? "em" : "span";
|
|
1308
1314
|
}
|
|
1309
|
-
function
|
|
1315
|
+
function Qi(n, e, t, r, i) {
|
|
1310
1316
|
const s = r.classList;
|
|
1311
1317
|
let o = it(i, "base");
|
|
1312
1318
|
o !== void 0 && s.add(...o), o = it(i, "underlineStrikethrough");
|
|
@@ -1324,8 +1330,8 @@ function Gi(n, e, t, r, i) {
|
|
|
1324
1330
|
} else e & u && s.remove(...o);
|
|
1325
1331
|
}
|
|
1326
1332
|
}
|
|
1327
|
-
function
|
|
1328
|
-
const r = e.firstChild, i = t.isComposing(), s = n + (i ?
|
|
1333
|
+
function Zi(n, e, t) {
|
|
1334
|
+
const r = e.firstChild, i = t.isComposing(), s = n + (i ? hn : "");
|
|
1329
1335
|
if (r == null) e.textContent = s;
|
|
1330
1336
|
else {
|
|
1331
1337
|
const o = r.nodeValue;
|
|
@@ -1342,11 +1348,11 @@ function Xi(n, e, t) {
|
|
|
1342
1348
|
}
|
|
1343
1349
|
}
|
|
1344
1350
|
function jr(n, e, t, r, i, s) {
|
|
1345
|
-
|
|
1351
|
+
Zi(i, n, e);
|
|
1346
1352
|
const o = s.theme.text;
|
|
1347
|
-
o !== void 0 &&
|
|
1353
|
+
o !== void 0 && Qi(0, 0, r, n, o);
|
|
1348
1354
|
}
|
|
1349
|
-
function
|
|
1355
|
+
function $t(n, e) {
|
|
1350
1356
|
const t = document.createElement(e);
|
|
1351
1357
|
return t.appendChild(n), t;
|
|
1352
1358
|
}
|
|
@@ -1376,7 +1382,7 @@ class ct extends we {
|
|
|
1376
1382
|
}
|
|
1377
1383
|
getMode() {
|
|
1378
1384
|
const e = this.getLatest();
|
|
1379
|
-
return
|
|
1385
|
+
return Ys[e.__mode];
|
|
1380
1386
|
}
|
|
1381
1387
|
getStyle() {
|
|
1382
1388
|
return this.getLatest().__style;
|
|
@@ -1407,7 +1413,7 @@ class ct extends we {
|
|
|
1407
1413
|
return this.getLatest().__text;
|
|
1408
1414
|
}
|
|
1409
1415
|
getFormatFlags(e, t) {
|
|
1410
|
-
return
|
|
1416
|
+
return fn(this.getLatest().__format, e, t);
|
|
1411
1417
|
}
|
|
1412
1418
|
canHaveFormat() {
|
|
1413
1419
|
return !0;
|
|
@@ -1416,14 +1422,14 @@ class ct extends we {
|
|
|
1416
1422
|
return !0;
|
|
1417
1423
|
}
|
|
1418
1424
|
createDOM(e, t) {
|
|
1419
|
-
const r = this.__format, i =
|
|
1425
|
+
const r = this.__format, i = An(0, r), s = Pn(0, r), o = i === null ? s : i, l = document.createElement(o);
|
|
1420
1426
|
let a = l;
|
|
1421
1427
|
this.hasFormat("code") && l.setAttribute("spellcheck", "false"), i !== null && (a = document.createElement(s), l.appendChild(a)), jr(a, this, 0, r, this.__text, e);
|
|
1422
1428
|
const c = this.__style;
|
|
1423
1429
|
return c !== "" && (l.style.cssText = c), l;
|
|
1424
1430
|
}
|
|
1425
1431
|
updateDOM(e, t, r) {
|
|
1426
|
-
const i = this.__text, s = e.__format, o = this.__format, l =
|
|
1432
|
+
const i = this.__text, s = e.__format, o = this.__format, l = An(0, s), a = An(0, o), c = Pn(0, s), u = Pn(0, o);
|
|
1427
1433
|
if ((l === null ? c : l) !== (a === null ? u : a)) return !0;
|
|
1428
1434
|
if (l === a && c !== u) {
|
|
1429
1435
|
const _ = t.firstChild;
|
|
@@ -1432,14 +1438,14 @@ class ct extends we {
|
|
|
1432
1438
|
return jr(p, this, 0, o, i, r), t.replaceChild(p, _), !1;
|
|
1433
1439
|
}
|
|
1434
1440
|
let d = t;
|
|
1435
|
-
a !== null && l !== null && (d = t.firstChild, d == null && T(49)),
|
|
1441
|
+
a !== null && l !== null && (d = t.firstChild, d == null && T(49)), Zi(i, d, this);
|
|
1436
1442
|
const f = r.theme.text;
|
|
1437
|
-
f !== void 0 && s !== o &&
|
|
1443
|
+
f !== void 0 && s !== o && Qi(0, s, o, d, f);
|
|
1438
1444
|
const g = e.__style, h = this.__style;
|
|
1439
1445
|
return g !== h && (t.style.cssText = h), !1;
|
|
1440
1446
|
}
|
|
1441
1447
|
static importDOM() {
|
|
1442
|
-
return { "#text": () => ({ conversion:
|
|
1448
|
+
return { "#text": () => ({ conversion: Do, priority: 0 }), b: () => ({ conversion: Ao, priority: 0 }), code: () => ({ conversion: ye, priority: 0 }), em: () => ({ conversion: ye, priority: 0 }), i: () => ({ conversion: ye, priority: 0 }), mark: () => ({ conversion: ye, priority: 0 }), s: () => ({ conversion: ye, priority: 0 }), span: () => ({ conversion: Oo, priority: 0 }), strong: () => ({ conversion: ye, priority: 0 }), sub: () => ({ conversion: ye, priority: 0 }), sup: () => ({ conversion: ye, priority: 0 }), u: () => ({ conversion: ye, priority: 0 }) };
|
|
1443
1449
|
}
|
|
1444
1450
|
static importJSON(e) {
|
|
1445
1451
|
return V().updateFromJSON(e);
|
|
@@ -1449,7 +1455,7 @@ class ct extends we {
|
|
|
1449
1455
|
}
|
|
1450
1456
|
exportDOM(e) {
|
|
1451
1457
|
let { element: t } = super.exportDOM(e);
|
|
1452
|
-
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 =
|
|
1458
|
+
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 = $t(t, "b")), this.hasFormat("italic") && (t = $t(t, "i")), this.hasFormat("strikethrough") && (t = $t(t, "s")), this.hasFormat("underline") && (t = $t(t, "u")), { element: t };
|
|
1453
1459
|
}
|
|
1454
1460
|
exportJSON() {
|
|
1455
1461
|
return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), ...super.exportJSON() };
|
|
@@ -1462,14 +1468,14 @@ class ct extends we {
|
|
|
1462
1468
|
}
|
|
1463
1469
|
setDetail(e) {
|
|
1464
1470
|
const t = this.getWritable();
|
|
1465
|
-
return t.__detail = typeof e == "string" ?
|
|
1471
|
+
return t.__detail = typeof e == "string" ? js[e] : e, t;
|
|
1466
1472
|
}
|
|
1467
1473
|
setStyle(e) {
|
|
1468
1474
|
const t = this.getWritable();
|
|
1469
1475
|
return t.__style = e, t;
|
|
1470
1476
|
}
|
|
1471
1477
|
toggleFormat(e) {
|
|
1472
|
-
const t =
|
|
1478
|
+
const t = fn(this.getFormat(), e, null);
|
|
1473
1479
|
return this.setFormat(t);
|
|
1474
1480
|
}
|
|
1475
1481
|
toggleDirectionless() {
|
|
@@ -1481,7 +1487,7 @@ class ct extends we {
|
|
|
1481
1487
|
return e.__detail ^= 2, e;
|
|
1482
1488
|
}
|
|
1483
1489
|
setMode(e) {
|
|
1484
|
-
const t =
|
|
1490
|
+
const t = Vs[e];
|
|
1485
1491
|
if (this.__mode === t) return this;
|
|
1486
1492
|
const r = this.getWritable();
|
|
1487
1493
|
return r.__mode = t, r;
|
|
@@ -1499,10 +1505,10 @@ class ct extends we {
|
|
|
1499
1505
|
const a = o.length;
|
|
1500
1506
|
r === void 0 && (r = a), i === void 0 && (i = a);
|
|
1501
1507
|
} else r = 0, i = 0;
|
|
1502
|
-
if (!A(s)) return
|
|
1508
|
+
if (!A(s)) return rs(l, r, l, i, "text", "text");
|
|
1503
1509
|
{
|
|
1504
1510
|
const a = Ne();
|
|
1505
|
-
a !== s.anchor.key && a !== s.focus.key ||
|
|
1511
|
+
a !== s.anchor.key && a !== s.focus.key || Y(l), s.setTextNodeRange(this, r, this, i);
|
|
1506
1512
|
}
|
|
1507
1513
|
return s;
|
|
1508
1514
|
}
|
|
@@ -1553,13 +1559,13 @@ class ct extends we {
|
|
|
1553
1559
|
const [k, S] = m.isBackward() ? [m.focus, m.anchor] : [m.anchor, m.focus];
|
|
1554
1560
|
k.type === "text" && k.key === i && (x = k), S.type === "text" && S.key === i && (y = S);
|
|
1555
1561
|
}
|
|
1556
|
-
t.isSegmented() ? (f = V(u), f.__format = g, f.__style = h, f.__detail = _, f.__state =
|
|
1562
|
+
t.isSegmented() ? (f = V(u), f.__format = g, f.__style = h, f.__detail = _, f.__state = Ar(t, f), p = !0) : f = t.setTextContent(u);
|
|
1557
1563
|
const b = [f];
|
|
1558
1564
|
for (let k = 1; k < c; k++) {
|
|
1559
1565
|
const S = V(l[k]);
|
|
1560
|
-
S.__format = g, S.__style = h, S.__detail = _, S.__state =
|
|
1566
|
+
S.__format = g, S.__style = h, S.__detail = _, S.__state = Ar(t, S);
|
|
1561
1567
|
const O = S.__key;
|
|
1562
|
-
s === i &&
|
|
1568
|
+
s === i && Y(O), b.push(S);
|
|
1563
1569
|
}
|
|
1564
1570
|
const N = x ? x.offset : null, C = y ? y.offset : null;
|
|
1565
1571
|
let w = 0;
|
|
@@ -1575,10 +1581,10 @@ class ct extends we {
|
|
|
1575
1581
|
if (d !== null) {
|
|
1576
1582
|
(function(O) {
|
|
1577
1583
|
const D = O.getPreviousSibling(), z = O.getNextSibling();
|
|
1578
|
-
D !== null &&
|
|
1584
|
+
D !== null && dn(D), z !== null && dn(z);
|
|
1579
1585
|
})(this);
|
|
1580
1586
|
const k = d.getWritable(), S = this.getIndexWithinParent();
|
|
1581
|
-
p ? (k.splice(S, 0, b), this.remove()) : k.splice(S, 1, b), A(m) &&
|
|
1587
|
+
p ? (k.splice(S, 0, b), this.remove()) : k.splice(S, 1, b), A(m) && cn(m, d, S, c - 1);
|
|
1582
1588
|
}
|
|
1583
1589
|
return b;
|
|
1584
1590
|
}
|
|
@@ -1586,11 +1592,11 @@ class ct extends we {
|
|
|
1586
1592
|
const t = e === this.getPreviousSibling();
|
|
1587
1593
|
t || e === this.getNextSibling() || T(50);
|
|
1588
1594
|
const r = this.__key, i = e.__key, s = this.__text, o = s.length;
|
|
1589
|
-
Ne() === i &&
|
|
1595
|
+
Ne() === i && Y(r);
|
|
1590
1596
|
const l = L();
|
|
1591
1597
|
if (A(l)) {
|
|
1592
1598
|
const d = l.anchor, f = l.focus;
|
|
1593
|
-
d !== null && d.key === i &&
|
|
1599
|
+
d !== null && d.key === i && ti(d, t, r, e, o), f !== null && f.key === i && ti(f, t, r, e, o);
|
|
1594
1600
|
}
|
|
1595
1601
|
const a = e.__text, c = t ? a + s : s + a;
|
|
1596
1602
|
this.setTextContent(c);
|
|
@@ -1601,30 +1607,30 @@ class ct extends we {
|
|
|
1601
1607
|
return !1;
|
|
1602
1608
|
}
|
|
1603
1609
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return { forChild:
|
|
1610
|
+
function Oo(n) {
|
|
1611
|
+
return { forChild: sr(n.style), node: null };
|
|
1606
1612
|
}
|
|
1607
|
-
function
|
|
1613
|
+
function Ao(n) {
|
|
1608
1614
|
const e = n, t = e.style.fontWeight === "normal";
|
|
1609
|
-
return { forChild:
|
|
1615
|
+
return { forChild: sr(e.style, t ? void 0 : "bold"), node: null };
|
|
1610
1616
|
}
|
|
1611
|
-
const
|
|
1612
|
-
function
|
|
1617
|
+
const Ur = /* @__PURE__ */ new WeakMap();
|
|
1618
|
+
function Po(n) {
|
|
1613
1619
|
if (!ee(n)) return !1;
|
|
1614
1620
|
if (n.nodeName === "PRE") return !0;
|
|
1615
1621
|
const e = n.style.whiteSpace;
|
|
1616
1622
|
return typeof e == "string" && e.startsWith("pre");
|
|
1617
1623
|
}
|
|
1618
|
-
function
|
|
1624
|
+
function Do(n) {
|
|
1619
1625
|
const e = n;
|
|
1620
1626
|
n.parentElement === null && T(129);
|
|
1621
1627
|
let t = e.textContent || "";
|
|
1622
1628
|
if ((function(r) {
|
|
1623
1629
|
let i, s = r.parentNode;
|
|
1624
1630
|
const o = [r];
|
|
1625
|
-
for (; s !== null && (i =
|
|
1631
|
+
for (; s !== null && (i = Ur.get(s)) === void 0 && !Po(s); ) o.push(s), s = s.parentNode;
|
|
1626
1632
|
const l = i === void 0 ? s : i;
|
|
1627
|
-
for (let a = 0; a < o.length; a++)
|
|
1633
|
+
for (let a = 0; a < o.length; a++) Ur.set(o[a], l);
|
|
1628
1634
|
return l;
|
|
1629
1635
|
})(e) !== null) {
|
|
1630
1636
|
const r = t.split(/(\r?\n|\t)/), i = [], s = r.length;
|
|
@@ -1632,14 +1638,14 @@ function Oo(n) {
|
|
|
1632
1638
|
const l = r[o];
|
|
1633
1639
|
l === `
|
|
1634
1640
|
` || l === `\r
|
|
1635
|
-
` ? i.push(bt()) : l === " " ? i.push(
|
|
1641
|
+
` ? i.push(bt()) : l === " " ? i.push(or()) : l !== "" && i.push(V(l));
|
|
1636
1642
|
}
|
|
1637
1643
|
return { node: i };
|
|
1638
1644
|
}
|
|
1639
1645
|
if (t = t.replace(/\r/g, "").replace(/[ \t\n]+/g, " "), t === "") return { node: null };
|
|
1640
1646
|
if (t[0] === " ") {
|
|
1641
1647
|
let r = e, i = !0;
|
|
1642
|
-
for (; r !== null && (r =
|
|
1648
|
+
for (; r !== null && (r = Vr(r, !1)) !== null; ) {
|
|
1643
1649
|
const s = r.textContent || "";
|
|
1644
1650
|
if (s.length > 0) {
|
|
1645
1651
|
/[ \t\n]$/.test(s) && (t = t.slice(1)), i = !1;
|
|
@@ -1650,7 +1656,7 @@ function Oo(n) {
|
|
|
1650
1656
|
}
|
|
1651
1657
|
if (t[t.length - 1] === " ") {
|
|
1652
1658
|
let r = e, i = !0;
|
|
1653
|
-
for (; r !== null && (r =
|
|
1659
|
+
for (; r !== null && (r = Vr(r, !0)) !== null; )
|
|
1654
1660
|
if ((r.textContent || "").replace(/^( |\t|\r?\n)+/, "").length > 0) {
|
|
1655
1661
|
i = !1;
|
|
1656
1662
|
break;
|
|
@@ -1659,7 +1665,7 @@ function Oo(n) {
|
|
|
1659
1665
|
}
|
|
1660
1666
|
return t === "" ? { node: null } : { node: V(t) };
|
|
1661
1667
|
}
|
|
1662
|
-
function
|
|
1668
|
+
function Vr(n, e) {
|
|
1663
1669
|
let t = n;
|
|
1664
1670
|
for (; ; ) {
|
|
1665
1671
|
let r;
|
|
@@ -1670,7 +1676,7 @@ function Ur(n, e) {
|
|
|
1670
1676
|
}
|
|
1671
1677
|
if (t = r, ee(t)) {
|
|
1672
1678
|
const s = t.style.display;
|
|
1673
|
-
if (s === "" && !
|
|
1679
|
+
if (s === "" && !nl(t) || s !== "" && !s.startsWith("inline")) return null;
|
|
1674
1680
|
}
|
|
1675
1681
|
let i = t;
|
|
1676
1682
|
for (; (i = e ? t.firstChild : t.lastChild) !== null; ) t = i;
|
|
@@ -1678,18 +1684,18 @@ function Ur(n, e) {
|
|
|
1678
1684
|
if (t.nodeName === "BR") return null;
|
|
1679
1685
|
}
|
|
1680
1686
|
}
|
|
1681
|
-
const
|
|
1687
|
+
const Fo = { code: "code", em: "italic", i: "italic", mark: "highlight", s: "strikethrough", strong: "bold", sub: "subscript", sup: "superscript", u: "underline" };
|
|
1682
1688
|
function ye(n) {
|
|
1683
|
-
const e =
|
|
1684
|
-
return e === void 0 ? { node: null } : { forChild:
|
|
1689
|
+
const e = Fo[n.nodeName.toLowerCase()];
|
|
1690
|
+
return e === void 0 ? { node: null } : { forChild: sr(n.style, e), node: null };
|
|
1685
1691
|
}
|
|
1686
1692
|
function V(n = "") {
|
|
1687
|
-
return
|
|
1693
|
+
return vn(new ct(n));
|
|
1688
1694
|
}
|
|
1689
1695
|
function M(n) {
|
|
1690
1696
|
return n instanceof ct;
|
|
1691
1697
|
}
|
|
1692
|
-
function
|
|
1698
|
+
function sr(n, e) {
|
|
1693
1699
|
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;
|
|
1694
1700
|
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);
|
|
1695
1701
|
}
|
|
@@ -1711,10 +1717,10 @@ class Mt extends ct {
|
|
|
1711
1717
|
return r !== void 0 && t.classList.add(...r), t;
|
|
1712
1718
|
}
|
|
1713
1719
|
static importJSON(e) {
|
|
1714
|
-
return
|
|
1720
|
+
return or().updateFromJSON(e);
|
|
1715
1721
|
}
|
|
1716
1722
|
setTextContent(e) {
|
|
1717
|
-
return e !== " " && e !== "" &&
|
|
1723
|
+
return e !== " " && e !== "" && Ti(126), super.setTextContent(" ");
|
|
1718
1724
|
}
|
|
1719
1725
|
spliceText(e, t, r, i) {
|
|
1720
1726
|
return r === "" && t === 0 || r === " " && t === 1 || T(286), this;
|
|
@@ -1732,13 +1738,13 @@ class Mt extends ct {
|
|
|
1732
1738
|
return !1;
|
|
1733
1739
|
}
|
|
1734
1740
|
}
|
|
1735
|
-
function
|
|
1736
|
-
return
|
|
1741
|
+
function or() {
|
|
1742
|
+
return vn(new Mt());
|
|
1737
1743
|
}
|
|
1738
|
-
function
|
|
1744
|
+
function es(n) {
|
|
1739
1745
|
return n instanceof Mt;
|
|
1740
1746
|
}
|
|
1741
|
-
class
|
|
1747
|
+
class Lo {
|
|
1742
1748
|
key;
|
|
1743
1749
|
offset;
|
|
1744
1750
|
type;
|
|
@@ -1750,7 +1756,7 @@ class Po {
|
|
|
1750
1756
|
return this.key === e.key && this.offset === e.offset && this.type === e.type;
|
|
1751
1757
|
}
|
|
1752
1758
|
isBefore(e) {
|
|
1753
|
-
return this.key === e.key ? this.offset < e.offset :
|
|
1759
|
+
return this.key === e.key ? this.offset < e.offset : Ms(fe(He(this, "next")), fe(He(e, "next"))) < 0;
|
|
1754
1760
|
}
|
|
1755
1761
|
getNode() {
|
|
1756
1762
|
const e = U(this.key);
|
|
@@ -1758,13 +1764,13 @@ class Po {
|
|
|
1758
1764
|
}
|
|
1759
1765
|
set(e, t, r, i) {
|
|
1760
1766
|
const s = this._selection, o = this.key;
|
|
1761
|
-
i && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r, Ot() || (Ne() === o &&
|
|
1767
|
+
i && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r, Ot() || (Ne() === o && Y(e), s !== null && (s.setCachedNodes(null), s.dirty = !0)));
|
|
1762
1768
|
}
|
|
1763
1769
|
}
|
|
1764
1770
|
function ge(n, e, t) {
|
|
1765
|
-
return new
|
|
1771
|
+
return new Lo(n, e, t);
|
|
1766
1772
|
}
|
|
1767
|
-
function
|
|
1773
|
+
function Dn(n, e) {
|
|
1768
1774
|
let t = e.__key, r = n.offset, i = "element";
|
|
1769
1775
|
if (M(e)) {
|
|
1770
1776
|
i = "text";
|
|
@@ -1780,13 +1786,13 @@ function Pn(n, e) {
|
|
|
1780
1786
|
}
|
|
1781
1787
|
n.set(t, r, i);
|
|
1782
1788
|
}
|
|
1783
|
-
function
|
|
1789
|
+
function Yr(n, e) {
|
|
1784
1790
|
if (v(e)) {
|
|
1785
1791
|
const t = e.getLastDescendant();
|
|
1786
|
-
v(t) || M(t) ?
|
|
1787
|
-
} else
|
|
1792
|
+
v(t) || M(t) ? Dn(n, t) : Dn(n, e);
|
|
1793
|
+
} else Dn(n, e);
|
|
1788
1794
|
}
|
|
1789
|
-
class
|
|
1795
|
+
class _n {
|
|
1790
1796
|
_nodes;
|
|
1791
1797
|
_cachedNodes;
|
|
1792
1798
|
dirty;
|
|
@@ -1800,7 +1806,7 @@ class gn {
|
|
|
1800
1806
|
this._cachedNodes = e;
|
|
1801
1807
|
}
|
|
1802
1808
|
is(e) {
|
|
1803
|
-
if (!
|
|
1809
|
+
if (!lr(e)) return !1;
|
|
1804
1810
|
const t = this._nodes, r = e._nodes;
|
|
1805
1811
|
return t.size === r.size && Array.from(t).every((i) => r.has(i));
|
|
1806
1812
|
}
|
|
@@ -1826,7 +1832,7 @@ class gn {
|
|
|
1826
1832
|
return this._nodes.has(e);
|
|
1827
1833
|
}
|
|
1828
1834
|
clone() {
|
|
1829
|
-
return new
|
|
1835
|
+
return new _n(new Set(this._nodes));
|
|
1830
1836
|
}
|
|
1831
1837
|
extract() {
|
|
1832
1838
|
return this.getNodes();
|
|
@@ -1866,7 +1872,7 @@ class gn {
|
|
|
1866
1872
|
const e = this.getNodes();
|
|
1867
1873
|
if ((L() || ut()) === this && e[0]) {
|
|
1868
1874
|
const t = q(e[0], "next");
|
|
1869
|
-
|
|
1875
|
+
_l(Ye(t, t));
|
|
1870
1876
|
}
|
|
1871
1877
|
for (const t of e) t.remove();
|
|
1872
1878
|
}
|
|
@@ -1910,7 +1916,7 @@ class Ge {
|
|
|
1910
1916
|
const { origin: u } = c;
|
|
1911
1917
|
v(u) && a.has(u) || i.push(u);
|
|
1912
1918
|
}
|
|
1913
|
-
if (o && i.push(o.caret.origin), at(r.focus) && v(r.focus.origin) && r.focus.getNodeAtCaret() === null) for (let c = Ae(r.focus.origin, "previous"); de(c) && l.has(c.origin) && !c.origin.isEmpty() && c.origin.is(i[i.length - 1]); c =
|
|
1919
|
+
if (o && i.push(o.caret.origin), at(r.focus) && v(r.focus.origin) && r.focus.getNodeAtCaret() === null) for (let c = Ae(r.focus.origin, "previous"); de(c) && l.has(c.origin) && !c.origin.isEmpty() && c.origin.is(i[i.length - 1]); c = Sr(c)) l.delete(c.origin), i.pop();
|
|
1914
1920
|
for (; i.length > 1; ) {
|
|
1915
1921
|
const c = i[i.length - 1];
|
|
1916
1922
|
if (!v(c) || a.has(c) || c.isEmpty() || l.has(c)) break;
|
|
@@ -1921,7 +1927,7 @@ class Ge {
|
|
|
1921
1927
|
i.push(f);
|
|
1922
1928
|
}
|
|
1923
1929
|
return i;
|
|
1924
|
-
})(
|
|
1930
|
+
})(As(vi(this), "next"));
|
|
1925
1931
|
return Ot() || (this._cachedNodes = t), t;
|
|
1926
1932
|
}
|
|
1927
1933
|
setTextNodeRange(e, t, r, i) {
|
|
@@ -1930,7 +1936,7 @@ class Ge {
|
|
|
1930
1936
|
getTextContent() {
|
|
1931
1937
|
const e = this.getNodes();
|
|
1932
1938
|
if (e.length === 0) return "";
|
|
1933
|
-
const t = e[0], r = e[e.length - 1], i = this.anchor, s = this.focus, o = i.isBefore(s), [l, a] =
|
|
1939
|
+
const t = e[0], r = e[e.length - 1], i = this.anchor, s = this.focus, o = i.isBefore(s), [l, a] = qr(this);
|
|
1934
1940
|
let c = "", u = !0;
|
|
1935
1941
|
for (let d = 0; d < e.length; d++) {
|
|
1936
1942
|
const f = e[d];
|
|
@@ -1944,17 +1950,17 @@ class Ge {
|
|
|
1944
1950
|
return c;
|
|
1945
1951
|
}
|
|
1946
1952
|
applyDOMRange(e) {
|
|
1947
|
-
const t = R(), r = t.getEditorState()._selection, i =
|
|
1953
|
+
const t = R(), r = t.getEditorState()._selection, i = ns(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, r);
|
|
1948
1954
|
if (i === null) return;
|
|
1949
1955
|
const [s, o] = i;
|
|
1950
|
-
this.anchor.set(s.key, s.offset, s.type, !0), this.focus.set(o.key, o.offset, o.type, !0),
|
|
1956
|
+
this.anchor.set(s.key, s.offset, s.type, !0), this.focus.set(o.key, o.offset, o.type, !0), Rn(this);
|
|
1951
1957
|
}
|
|
1952
1958
|
clone() {
|
|
1953
1959
|
const e = this.anchor, t = this.focus;
|
|
1954
1960
|
return new Ge(ge(e.key, e.offset, e.type), ge(t.key, t.offset, t.type), this.format, this.style);
|
|
1955
1961
|
}
|
|
1956
1962
|
toggleFormat(e) {
|
|
1957
|
-
this.format =
|
|
1963
|
+
this.format = fn(this.format, e, null), this.dirty = !0;
|
|
1958
1964
|
}
|
|
1959
1965
|
setFormat(e) {
|
|
1960
1966
|
this.format = e, this.dirty = !0;
|
|
@@ -1972,7 +1978,7 @@ class Ge {
|
|
|
1972
1978
|
const o = t[s];
|
|
1973
1979
|
o === `
|
|
1974
1980
|
` || o === `\r
|
|
1975
|
-
` ? r.push(bt()) : o === " " ? r.push(
|
|
1981
|
+
` ? r.push(bt()) : o === " " ? r.push(or()) : r.push(V(o));
|
|
1976
1982
|
}
|
|
1977
1983
|
this.insertNodes(r);
|
|
1978
1984
|
}
|
|
@@ -1981,13 +1987,13 @@ class Ge {
|
|
|
1981
1987
|
let o = t, l = r;
|
|
1982
1988
|
!this.isCollapsed() && r.isBefore(t) && (o = r, l = t), o.type === "element" && (function(p, x, y, m) {
|
|
1983
1989
|
const b = p.getNode(), N = b.getChildAtIndex(p.offset), C = V();
|
|
1984
|
-
if (C.setFormat(y), C.setStyle(m),
|
|
1990
|
+
if (C.setFormat(y), C.setStyle(m), $o(N)) N.splice(0, 0, [C]);
|
|
1985
1991
|
else {
|
|
1986
|
-
const w =
|
|
1992
|
+
const w = H(b) ? Ee().append(C) : C;
|
|
1987
1993
|
N === null ? b.append(w) : N.insertBefore(w);
|
|
1988
1994
|
}
|
|
1989
1995
|
p.is(x) && x.set(C.__key, 0, "text"), p.set(C.__key, 0, "text");
|
|
1990
|
-
})(o, l, i, s), l.type === "element" && wt(l, fe(
|
|
1996
|
+
})(o, l, i, s), l.type === "element" && wt(l, fe(He(l, "next")));
|
|
1991
1997
|
const a = o.offset;
|
|
1992
1998
|
let c = l.offset;
|
|
1993
1999
|
const u = this.getNodes(), d = u.length;
|
|
@@ -2006,7 +2012,7 @@ class Ge {
|
|
|
2006
2012
|
p.setFormat(i), f.replace(p), f = p;
|
|
2007
2013
|
} else if (!this.isCollapsed() && e !== "") {
|
|
2008
2014
|
const p = _.getParent();
|
|
2009
|
-
if (!h.canInsertTextBefore() || !h.canInsertTextAfter() || v(p) && (!p.canInsertTextBefore() || !p.canInsertTextAfter())) return this.insertText(""),
|
|
2015
|
+
if (!h.canInsertTextBefore() || !h.canInsertTextAfter() || v(p) && (!p.canInsertTextBefore() || !p.canInsertTextAfter())) return this.insertText(""), ts(this.anchor, this.focus, null), void this.insertText(e);
|
|
2010
2016
|
}
|
|
2011
2017
|
if (d === 1) {
|
|
2012
2018
|
if (Ke(f)) {
|
|
@@ -2015,7 +2021,7 @@ class Ge {
|
|
|
2015
2021
|
}
|
|
2016
2022
|
const p = f.getFormat(), x = f.getStyle();
|
|
2017
2023
|
if (a !== c || p === i && x === s) {
|
|
2018
|
-
if (
|
|
2024
|
+
if (es(f)) {
|
|
2019
2025
|
const m = V(e);
|
|
2020
2026
|
return m.setFormat(i), m.setStyle(s), m.select(), void f.replace(m);
|
|
2021
2027
|
}
|
|
@@ -2044,7 +2050,7 @@ class Ge {
|
|
|
2044
2050
|
const k = V(_.getTextContent());
|
|
2045
2051
|
_.replace(k), _ = k;
|
|
2046
2052
|
}
|
|
2047
|
-
|
|
2053
|
+
H(l.getNode()) || l.type !== "text" || (_ = _.spliceText(0, c, "")), p.add(_.__key);
|
|
2048
2054
|
} else {
|
|
2049
2055
|
const k = _.getParentOrThrow();
|
|
2050
2056
|
k.canBeEmpty() || k.getChildrenSize() !== 1 ? _.remove() : k.remove();
|
|
@@ -2077,10 +2083,10 @@ class Ge {
|
|
|
2077
2083
|
}
|
|
2078
2084
|
removeText() {
|
|
2079
2085
|
const e = L() === this;
|
|
2080
|
-
Xt(this,
|
|
2086
|
+
Xt(this, pl(vi(this))), e && L() !== this && re(this);
|
|
2081
2087
|
}
|
|
2082
2088
|
formatText(e, t = null) {
|
|
2083
|
-
if (this.isCollapsed()) return this.toggleFormat(e), void
|
|
2089
|
+
if (this.isCollapsed()) return this.toggleFormat(e), void Y(null);
|
|
2084
2090
|
const r = this.getNodes(), i = [];
|
|
2085
2091
|
for (const b of r) M(b) && i.push(b);
|
|
2086
2092
|
const s = (b) => {
|
|
@@ -2091,7 +2097,7 @@ class Ge {
|
|
|
2091
2097
|
}
|
|
2092
2098
|
});
|
|
2093
2099
|
}, o = i.length;
|
|
2094
|
-
if (o === 0) return this.toggleFormat(e),
|
|
2100
|
+
if (o === 0) return this.toggleFormat(e), Y(null), void s(t);
|
|
2095
2101
|
const l = this.anchor, a = this.focus, c = this.isBackward(), u = c ? a : l, d = c ? l : a;
|
|
2096
2102
|
let f = 0, g = i[0], h = u.type === "element" ? 0 : u.offset;
|
|
2097
2103
|
if (u.type === "text" && h === g.getTextContentSize() && (f = 1, g = i[1], h = 0), g == null) return;
|
|
@@ -2129,14 +2135,14 @@ class Ge {
|
|
|
2129
2135
|
if (v(r) && "__language" in r) {
|
|
2130
2136
|
if ("__language" in e[0]) this.insertText(e[0].getTextContent());
|
|
2131
2137
|
else {
|
|
2132
|
-
const h =
|
|
2138
|
+
const h = Fn(this);
|
|
2133
2139
|
r.splice(h, 0, e), i.selectEnd();
|
|
2134
2140
|
}
|
|
2135
2141
|
return;
|
|
2136
2142
|
}
|
|
2137
2143
|
if (!e.some((h) => (v(h) || B(h)) && !h.isInline())) {
|
|
2138
2144
|
v(r) || T(211, t.constructor.name, t.getType());
|
|
2139
|
-
const h =
|
|
2145
|
+
const h = Fn(this);
|
|
2140
2146
|
return r.splice(h, 0, e), void i.selectEnd();
|
|
2141
2147
|
}
|
|
2142
2148
|
const s = (function(h) {
|
|
@@ -2171,7 +2177,7 @@ class Ge {
|
|
|
2171
2177
|
const o = Ee();
|
|
2172
2178
|
return ie().splice(this.anchor.offset, 0, [o]), o.select(), o;
|
|
2173
2179
|
}
|
|
2174
|
-
const e =
|
|
2180
|
+
const e = Fn(this), t = qt(this.anchor.getNode(), be);
|
|
2175
2181
|
v(t) || T(213);
|
|
2176
2182
|
const r = t.getChildAtIndex(e), i = r ? [r, ...r.getNextSiblings()] : [], s = t.insertNewAfter(this, !1);
|
|
2177
2183
|
return s ? (s.append(...i), s.selectStart(), s) : null;
|
|
@@ -2186,7 +2192,7 @@ class Ge {
|
|
|
2186
2192
|
extract() {
|
|
2187
2193
|
const e = [...this.getNodes()], t = e.length;
|
|
2188
2194
|
let r = e[0], i = e[t - 1];
|
|
2189
|
-
const [s, o] =
|
|
2195
|
+
const [s, o] = qr(this), l = this.isBackward(), [a, c] = l ? [this.focus, this.anchor] : [this.anchor, this.focus], [u, d] = l ? [o, s] : [s, o];
|
|
2190
2196
|
if (t === 0) return [];
|
|
2191
2197
|
if (t === 1) {
|
|
2192
2198
|
if (M(r) && !this.isCollapsed()) {
|
|
@@ -2202,24 +2208,24 @@ class Ge {
|
|
|
2202
2208
|
return e;
|
|
2203
2209
|
}
|
|
2204
2210
|
modify(e, t, r) {
|
|
2205
|
-
if (
|
|
2211
|
+
if (ni(this, e, t, r)) return;
|
|
2206
2212
|
const i = e === "move", s = R(), o = Se(se(s));
|
|
2207
2213
|
if (!o) return;
|
|
2208
2214
|
const l = s._blockCursorElement, a = s._rootElement, c = this.focus.getNode();
|
|
2209
|
-
if (a === null || l === null || !v(c) || c.isInline() || c.canBeEmpty() ||
|
|
2210
|
-
let u =
|
|
2211
|
-
this.anchor.type === "text" && (u = lt(u)), this.focus.type === "text" && (d = lt(d)), u && d &&
|
|
2215
|
+
if (a === null || l === null || !v(c) || c.isInline() || c.canBeEmpty() || nr(l, s, a), this.dirty) {
|
|
2216
|
+
let u = $e(s, this.anchor.key), d = $e(s, this.focus.key);
|
|
2217
|
+
this.anchor.type === "text" && (u = lt(u)), this.focus.type === "text" && (d = lt(d)), u && d && ss(o, u, this.anchor.offset, d, this.focus.offset);
|
|
2212
2218
|
}
|
|
2213
2219
|
if ((function(u, d, f, g) {
|
|
2214
2220
|
u.modify(d, f, g);
|
|
2215
2221
|
})(o, e, t ? "backward" : "forward", r), o.rangeCount > 0) {
|
|
2216
|
-
const u = o.getRangeAt(0), d = this.anchor.getNode(), f =
|
|
2222
|
+
const u = o.getRangeAt(0), d = this.anchor.getNode(), f = H(d) ? d : Xo(d);
|
|
2217
2223
|
if (this.applyDOMRange(u), this.dirty = !0, !i) {
|
|
2218
2224
|
const g = this.getNodes(), h = [];
|
|
2219
2225
|
let _ = !1;
|
|
2220
2226
|
for (let p = 0; p < g.length; p++) {
|
|
2221
2227
|
const x = g[p];
|
|
2222
|
-
|
|
2228
|
+
tr(x, f) ? h.push(x) : _ = !0;
|
|
2223
2229
|
}
|
|
2224
2230
|
if (_ && h.length > 0) if (t) {
|
|
2225
2231
|
const p = h[0];
|
|
@@ -2234,7 +2240,7 @@ class Ge {
|
|
|
2234
2240
|
})(this);
|
|
2235
2241
|
}
|
|
2236
2242
|
}
|
|
2237
|
-
r === "lineboundary" &&
|
|
2243
|
+
r === "lineboundary" && ni(this, e, t, r, "decorators");
|
|
2238
2244
|
}
|
|
2239
2245
|
forwardDeletion(e, t, r) {
|
|
2240
2246
|
if (!r && (e.type === "element" && v(t) && e.offset === t.getChildrenSize() || e.type === "text" && e.offset === t.getTextContentSize())) {
|
|
@@ -2249,7 +2255,7 @@ class Ge {
|
|
|
2249
2255
|
const r = this.anchor;
|
|
2250
2256
|
let i = r.getNode();
|
|
2251
2257
|
if (this.forwardDeletion(r, i, e)) return;
|
|
2252
|
-
const s =
|
|
2258
|
+
const s = ws(He(r, e ? "previous" : "next"));
|
|
2253
2259
|
if (s.getTextSlices().every((l) => l === null || l.distance === 0)) {
|
|
2254
2260
|
let l = { type: "initial" };
|
|
2255
2261
|
for (const a of s.iterNodeCarets("shadowRoot")) if (de(a)) {
|
|
@@ -2258,7 +2264,7 @@ class Ge {
|
|
|
2258
2264
|
if (l.type === "merge-block") break;
|
|
2259
2265
|
if (v(s.anchor.origin) && s.anchor.origin.isEmpty()) {
|
|
2260
2266
|
const c = fe(a);
|
|
2261
|
-
Xt(this,
|
|
2267
|
+
Xt(this, Ye(c, c)), s.anchor.origin.remove();
|
|
2262
2268
|
}
|
|
2263
2269
|
return;
|
|
2264
2270
|
}
|
|
@@ -2276,7 +2282,7 @@ class Ge {
|
|
|
2276
2282
|
if (B(a.origin)) {
|
|
2277
2283
|
if (!a.origin.isIsolated()) if (l.type === "merge-next-block" && (a.origin.isKeyboardSelectable() || !a.origin.isInline()) && v(s.anchor.origin) && s.anchor.origin.isEmpty()) {
|
|
2278
2284
|
s.anchor.origin.remove();
|
|
2279
|
-
const c =
|
|
2285
|
+
const c = is();
|
|
2280
2286
|
c.add(a.origin.getKey()), re(c);
|
|
2281
2287
|
} else a.origin.remove();
|
|
2282
2288
|
return;
|
|
@@ -2286,27 +2292,27 @@ class Ge {
|
|
|
2286
2292
|
}
|
|
2287
2293
|
if (l.type === "merge-block") {
|
|
2288
2294
|
const { caret: a, block: c } = l;
|
|
2289
|
-
return Xt(this,
|
|
2295
|
+
return Xt(this, Ye(!a.origin.isEmpty() && c.isEmpty() ? Kt(q(c, a.direction)) : s.anchor, a)), this.removeText();
|
|
2290
2296
|
}
|
|
2291
2297
|
}
|
|
2292
2298
|
const o = this.focus;
|
|
2293
2299
|
if (this.modify("extend", e, "character"), this.isCollapsed()) {
|
|
2294
|
-
if (e && r.offset === 0 &&
|
|
2300
|
+
if (e && r.offset === 0 && Gr(this, r.getNode())) return;
|
|
2295
2301
|
} else {
|
|
2296
2302
|
const l = o.type === "text" ? o.getNode() : null;
|
|
2297
2303
|
if (i = r.type === "text" ? r.getNode() : null, l !== null && l.isSegmented()) {
|
|
2298
2304
|
const a = o.offset, c = l.getTextContentSize();
|
|
2299
|
-
if (l.is(i) || e && a !== c || !e && a !== 0) return void
|
|
2305
|
+
if (l.is(i) || e && a !== c || !e && a !== 0) return void Xr(l, e, a);
|
|
2300
2306
|
} else if (i !== null && i.isSegmented()) {
|
|
2301
2307
|
const a = r.offset, c = i.getTextContentSize();
|
|
2302
|
-
if (i.is(l) || e && a !== 0 || !e && a !== c) return void
|
|
2308
|
+
if (i.is(l) || e && a !== 0 || !e && a !== c) return void Xr(i, e, a);
|
|
2303
2309
|
}
|
|
2304
2310
|
(function(a, c) {
|
|
2305
2311
|
const u = a.anchor, d = a.focus, f = u.getNode(), g = d.getNode();
|
|
2306
2312
|
if (f === g && u.type === "text" && d.type === "text") {
|
|
2307
2313
|
const h = u.offset, _ = d.offset, p = h < _, x = p ? h : _, y = p ? _ : h, m = y - 1;
|
|
2308
2314
|
x !== m && (function(b) {
|
|
2309
|
-
return !(
|
|
2315
|
+
return !(Ss(b) || Io(b));
|
|
2310
2316
|
})(f.getTextContent().slice(x, y)) && (c ? d.set(d.key, m, d.type) : u.set(u.key, m, u.type));
|
|
2311
2317
|
}
|
|
2312
2318
|
})(this, e);
|
|
@@ -2314,7 +2320,7 @@ class Ge {
|
|
|
2314
2320
|
}
|
|
2315
2321
|
if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
|
|
2316
2322
|
const r = this.anchor.getNode();
|
|
2317
|
-
r.isEmpty() &&
|
|
2323
|
+
r.isEmpty() && H(r.getParent()) && r.getPreviousSibling() === null && Gr(this, r);
|
|
2318
2324
|
}
|
|
2319
2325
|
}
|
|
2320
2326
|
deleteLine(e) {
|
|
@@ -2335,8 +2341,8 @@ class Ge {
|
|
|
2335
2341
|
return [this.anchor, this.focus];
|
|
2336
2342
|
}
|
|
2337
2343
|
}
|
|
2338
|
-
function
|
|
2339
|
-
return n instanceof
|
|
2344
|
+
function lr(n) {
|
|
2345
|
+
return n instanceof _n;
|
|
2340
2346
|
}
|
|
2341
2347
|
function Hr(n) {
|
|
2342
2348
|
const e = n.offset;
|
|
@@ -2344,13 +2350,13 @@ function Hr(n) {
|
|
|
2344
2350
|
const t = n.getNode();
|
|
2345
2351
|
return e === t.getChildrenSize() ? t.getTextContent().length : 0;
|
|
2346
2352
|
}
|
|
2347
|
-
function
|
|
2353
|
+
function qr(n) {
|
|
2348
2354
|
const e = n.getStartEndPoints();
|
|
2349
2355
|
if (e === null) return [0, 0];
|
|
2350
2356
|
const [t, r] = e;
|
|
2351
2357
|
return t.type === "element" && r.type === "element" && t.key === r.key && t.offset === r.offset ? [0, 0] : [Hr(t), Hr(r)];
|
|
2352
2358
|
}
|
|
2353
|
-
function
|
|
2359
|
+
function Gr(n, e) {
|
|
2354
2360
|
for (let t = e; t; t = t.getParent()) {
|
|
2355
2361
|
if (v(t)) {
|
|
2356
2362
|
if (t.collapseAtStart(n)) return !0;
|
|
@@ -2360,7 +2366,7 @@ function qr(n, e) {
|
|
|
2360
2366
|
}
|
|
2361
2367
|
return !1;
|
|
2362
2368
|
}
|
|
2363
|
-
const
|
|
2369
|
+
const Io = (() => {
|
|
2364
2370
|
try {
|
|
2365
2371
|
const n = new RegExp("\\p{Emoji}", "u"), e = n.test.bind(n);
|
|
2366
2372
|
if (e("❤️") && e("#️⃣") && e("👍")) return e;
|
|
@@ -2368,7 +2374,7 @@ const Do = (() => {
|
|
|
2368
2374
|
}
|
|
2369
2375
|
return () => !1;
|
|
2370
2376
|
})();
|
|
2371
|
-
function
|
|
2377
|
+
function Xr(n, e, t) {
|
|
2372
2378
|
const r = n, i = r.getTextContent().split(/(?=\s)/g), s = i.length;
|
|
2373
2379
|
let o = 0, l = 0;
|
|
2374
2380
|
for (let c = 0; c < s; c++) {
|
|
@@ -2381,7 +2387,7 @@ function Gr(n, e, t) {
|
|
|
2381
2387
|
const a = i.join("").trim();
|
|
2382
2388
|
a === "" ? r.remove() : (r.setTextContent(a), r.select(l, l));
|
|
2383
2389
|
}
|
|
2384
|
-
function
|
|
2390
|
+
function Qr(n, e, t, r) {
|
|
2385
2391
|
let i, s = e;
|
|
2386
2392
|
if (ee(n)) {
|
|
2387
2393
|
let o = !1;
|
|
@@ -2418,7 +2424,7 @@ function Xr(n, e, t, r) {
|
|
|
2418
2424
|
} else i = tt(n);
|
|
2419
2425
|
return M(i) ? ge(i.__key, he(i, s, "clamp"), "text") : null;
|
|
2420
2426
|
}
|
|
2421
|
-
function
|
|
2427
|
+
function Zr(n, e, t) {
|
|
2422
2428
|
const r = n.offset, i = n.getNode();
|
|
2423
2429
|
if (r === 0) {
|
|
2424
2430
|
const s = i.getPreviousSibling(), o = i.getParent();
|
|
@@ -2437,10 +2443,10 @@ function Qr(n, e, t) {
|
|
|
2437
2443
|
}
|
|
2438
2444
|
}
|
|
2439
2445
|
}
|
|
2440
|
-
function
|
|
2446
|
+
function ts(n, e, t) {
|
|
2441
2447
|
if (n.type === "text" && e.type === "text") {
|
|
2442
2448
|
const r = n.isBefore(e), i = n.is(e);
|
|
2443
|
-
|
|
2449
|
+
Zr(n, r, i), Zr(e, !r, i), i && e.set(n.key, n.offset, n.type);
|
|
2444
2450
|
const s = R();
|
|
2445
2451
|
if (s.isComposing() && s._compositionKey !== n.key && A(t)) {
|
|
2446
2452
|
const o = t.anchor, l = t.focus;
|
|
@@ -2448,44 +2454,44 @@ function Zi(n, e, t) {
|
|
|
2448
2454
|
}
|
|
2449
2455
|
}
|
|
2450
2456
|
}
|
|
2451
|
-
function
|
|
2452
|
-
if (n === null || t === null || !
|
|
2453
|
-
const o =
|
|
2457
|
+
function ns(n, e, t, r, i, s) {
|
|
2458
|
+
if (n === null || t === null || !mn(i, n, t)) return null;
|
|
2459
|
+
const o = Qr(n, e, A(s) ? s.anchor : null, i);
|
|
2454
2460
|
if (o === null) return null;
|
|
2455
|
-
const l =
|
|
2461
|
+
const l = Qr(t, r, A(s) ? s.focus : null, i);
|
|
2456
2462
|
if (l === null) return null;
|
|
2457
2463
|
if (o.type === "element" && l.type === "element") {
|
|
2458
2464
|
const a = tt(n), c = tt(t);
|
|
2459
2465
|
if (B(a) && B(c)) return null;
|
|
2460
2466
|
}
|
|
2461
|
-
return
|
|
2467
|
+
return ts(o, l, s), [o, l];
|
|
2462
2468
|
}
|
|
2463
|
-
function
|
|
2469
|
+
function Fl(n) {
|
|
2464
2470
|
return v(n) && !n.isInline();
|
|
2465
2471
|
}
|
|
2466
|
-
function
|
|
2472
|
+
function rs(n, e, t, r, i, s) {
|
|
2467
2473
|
const o = Pe(), l = new Ge(ge(n, e, i), ge(t, r, s), 0, "");
|
|
2468
2474
|
return l.dirty = !0, o._selection = l, l;
|
|
2469
2475
|
}
|
|
2470
|
-
function
|
|
2476
|
+
function Ko() {
|
|
2471
2477
|
const n = ge("root", 0, "element"), e = ge("root", 0, "element");
|
|
2472
2478
|
return new Ge(n, e, 0, "");
|
|
2473
2479
|
}
|
|
2474
|
-
function
|
|
2475
|
-
return new
|
|
2480
|
+
function is() {
|
|
2481
|
+
return new _n(/* @__PURE__ */ new Set());
|
|
2476
2482
|
}
|
|
2477
|
-
function
|
|
2478
|
-
return
|
|
2483
|
+
function Ll(n, e) {
|
|
2484
|
+
return pn(null, n, e, null);
|
|
2479
2485
|
}
|
|
2480
|
-
function
|
|
2486
|
+
function pn(n, e, t, r) {
|
|
2481
2487
|
const i = t._window;
|
|
2482
2488
|
if (i === null) return null;
|
|
2483
|
-
const s = r || i.event, o = s ? s.type : void 0, l = o === "selectionchange", a = !
|
|
2489
|
+
const s = r || i.event, o = s ? s.type : void 0, l = o === "selectionchange", a = !Bn && (l || o === "beforeinput" || o === "compositionstart" || o === "compositionend" || o === "click" && s && s.detail === 3 || o === "drop" || o === void 0);
|
|
2484
2490
|
let c, u, d, f;
|
|
2485
2491
|
if (A(n) && !a) return n.clone();
|
|
2486
2492
|
if (e === null) return null;
|
|
2487
|
-
if (c = e.anchorNode, u = e.focusNode, d = e.anchorOffset, f = e.focusOffset, l && A(n) && !
|
|
2488
|
-
const g =
|
|
2493
|
+
if (c = e.anchorNode, u = e.focusNode, d = e.anchorOffset, f = e.focusOffset, l && A(n) && !mn(t, c, u)) return n.clone();
|
|
2494
|
+
const g = ns(c, d, u, f, t, n);
|
|
2489
2495
|
if (g === null) return null;
|
|
2490
2496
|
const [h, _] = g;
|
|
2491
2497
|
return new Ge(h, _, A(n) ? n.format : 0, A(n) ? n.style : "");
|
|
@@ -2496,7 +2502,7 @@ function L() {
|
|
|
2496
2502
|
function ut() {
|
|
2497
2503
|
return R()._editorState._selection;
|
|
2498
2504
|
}
|
|
2499
|
-
function
|
|
2505
|
+
function cn(n, e, t, r = 1) {
|
|
2500
2506
|
const i = n.anchor, s = n.focus, o = i.getNode(), l = s.getNode();
|
|
2501
2507
|
if (!e.is(o) && !e.is(l)) return;
|
|
2502
2508
|
const a = e.__key;
|
|
@@ -2504,7 +2510,7 @@ function an(n, e, t, r = 1) {
|
|
|
2504
2510
|
const c = i.offset;
|
|
2505
2511
|
if (t <= c && r > 0 || t < c && r < 0) {
|
|
2506
2512
|
const u = Math.max(0, c + r);
|
|
2507
|
-
i.set(a, u, "element"), s.set(a, u, "element"),
|
|
2513
|
+
i.set(a, u, "element"), s.set(a, u, "element"), ei(n);
|
|
2508
2514
|
}
|
|
2509
2515
|
} else {
|
|
2510
2516
|
const c = n.isBackward(), u = c ? s : i, d = u.getNode(), f = c ? i : s, g = f.getNode();
|
|
@@ -2517,9 +2523,9 @@ function an(n, e, t, r = 1) {
|
|
|
2517
2523
|
(t <= h && r > 0 || t < h && r < 0) && f.set(a, Math.max(0, h + r), "element");
|
|
2518
2524
|
}
|
|
2519
2525
|
}
|
|
2520
|
-
|
|
2526
|
+
ei(n);
|
|
2521
2527
|
}
|
|
2522
|
-
function
|
|
2528
|
+
function ei(n) {
|
|
2523
2529
|
const e = n.anchor, t = e.offset, r = n.focus, i = r.offset, s = e.getNode(), o = r.getNode();
|
|
2524
2530
|
if (n.isCollapsed()) {
|
|
2525
2531
|
if (!v(s)) return;
|
|
@@ -2545,24 +2551,24 @@ function Zr(n) {
|
|
|
2545
2551
|
}
|
|
2546
2552
|
}
|
|
2547
2553
|
}
|
|
2548
|
-
function
|
|
2554
|
+
function un(n, e, t, r, i) {
|
|
2549
2555
|
let s = null, o = 0, l = null;
|
|
2550
2556
|
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"));
|
|
2551
2557
|
}
|
|
2552
|
-
function
|
|
2558
|
+
function ti(n, e, t, r, i) {
|
|
2553
2559
|
n.type === "text" ? n.set(t, n.offset + (e ? 0 : i), "text") : n.offset > r.getIndexWithinParent() && n.set(n.key, n.offset - 1, "element");
|
|
2554
2560
|
}
|
|
2555
|
-
function
|
|
2561
|
+
function ss(n, e, t, r, i) {
|
|
2556
2562
|
try {
|
|
2557
2563
|
n.setBaseAndExtent(e, t, r, i);
|
|
2558
2564
|
} catch {
|
|
2559
2565
|
}
|
|
2560
2566
|
}
|
|
2561
|
-
function
|
|
2567
|
+
function zo(n, e, t, r, i, s, o) {
|
|
2562
2568
|
const l = r.anchorNode, a = r.focusNode, c = r.anchorOffset, u = r.focusOffset, d = document.activeElement;
|
|
2563
|
-
if (i.has(
|
|
2564
|
-
if (!A(e)) return void (n !== null &&
|
|
2565
|
-
const f = e.anchor, g = e.focus, h = f.key, _ = g.key, p =
|
|
2569
|
+
if (i.has(bo) && d !== s || d !== null && _s(d)) return;
|
|
2570
|
+
if (!A(e)) return void (n !== null && mn(t, l, a) && r.removeAllRanges());
|
|
2571
|
+
const f = e.anchor, g = e.focus, h = f.key, _ = g.key, p = $e(t, h), x = $e(t, _), y = f.offset, m = g.offset, b = e.format, N = e.style, C = e.isCollapsed();
|
|
2566
2572
|
let w = p, k = x, S = !1;
|
|
2567
2573
|
if (f.type === "text") {
|
|
2568
2574
|
w = lt(p);
|
|
@@ -2570,8 +2576,8 @@ function Lo(n, e, t, r, i, s, o) {
|
|
|
2570
2576
|
S = W.getFormat() !== b || W.getStyle() !== N;
|
|
2571
2577
|
} else A(n) && n.anchor.type === "text" && (S = !0);
|
|
2572
2578
|
var O, D, z, F, I;
|
|
2573
|
-
if (g.type === "text" && (k = lt(x)), w !== null && k !== null && (C && (n === null || S || A(n) && (n.format !== b || n.style !== N)) && (O = b, D = N, z = y, F = h, I = performance.now(),
|
|
2574
|
-
if (
|
|
2579
|
+
if (g.type === "text" && (k = lt(x)), w !== null && k !== null && (C && (n === null || S || A(n) && (n.format !== b || n.style !== N)) && (O = b, D = N, z = y, F = h, I = performance.now(), Ui = [O, D, z, F, I]), c !== y || u !== m || l !== w || a !== k || r.type === "Range" && C || (d !== null && s.contains(d) || i.has(Eo) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
2580
|
+
if (ss(r, w, y, k, m), !i.has(No) && e.isCollapsed() && s !== null && s === document.activeElement) {
|
|
2575
2581
|
const W = A(e) && e.anchor.type === "element" ? w.childNodes[y] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null;
|
|
2576
2582
|
if (W !== null) {
|
|
2577
2583
|
let G;
|
|
@@ -2580,38 +2586,38 @@ function Lo(n, e, t, r, i, s, o) {
|
|
|
2580
2586
|
te.selectNode(W), G = te.getBoundingClientRect();
|
|
2581
2587
|
} else G = W.getBoundingClientRect();
|
|
2582
2588
|
(function(te, Qe, _e) {
|
|
2583
|
-
const ft =
|
|
2584
|
-
if (ft === null ||
|
|
2585
|
-
let { top:
|
|
2589
|
+
const ft = bs(_e), kr = yr(ft);
|
|
2590
|
+
if (ft === null || kr === null) return;
|
|
2591
|
+
let { top: kn, bottom: Tn } = Qe, zt = 0, Bt = 0, ke = _e;
|
|
2586
2592
|
for (; ke !== null; ) {
|
|
2587
|
-
const
|
|
2588
|
-
if (
|
|
2593
|
+
const bn = ke === ft.body;
|
|
2594
|
+
if (bn) zt = 0, Bt = se(te).innerHeight;
|
|
2589
2595
|
else {
|
|
2590
2596
|
const Rt = ke.getBoundingClientRect();
|
|
2591
2597
|
zt = Rt.top, Bt = Rt.bottom;
|
|
2592
2598
|
}
|
|
2593
2599
|
let dt = 0;
|
|
2594
|
-
if (
|
|
2600
|
+
if (kn < zt ? dt = -(zt - kn) : Tn > Bt && (dt = Tn - Bt), dt !== 0) if (bn) kr.scrollBy(0, dt);
|
|
2595
2601
|
else {
|
|
2596
2602
|
const Rt = ke.scrollTop;
|
|
2597
2603
|
ke.scrollTop += dt;
|
|
2598
|
-
const
|
|
2599
|
-
|
|
2604
|
+
const Tr = ke.scrollTop - Rt;
|
|
2605
|
+
kn -= Tr, Tn -= Tr;
|
|
2600
2606
|
}
|
|
2601
|
-
if (
|
|
2607
|
+
if (bn) break;
|
|
2602
2608
|
ke = Lt(ke);
|
|
2603
2609
|
}
|
|
2604
2610
|
})(t, G, s);
|
|
2605
2611
|
}
|
|
2606
2612
|
}
|
|
2607
|
-
|
|
2613
|
+
Xn = !0;
|
|
2608
2614
|
}
|
|
2609
2615
|
}
|
|
2610
|
-
function
|
|
2616
|
+
function Il(n) {
|
|
2611
2617
|
let e = L() || ut();
|
|
2612
2618
|
e === null && (e = ie().selectEnd()), e.insertNodes(n);
|
|
2613
2619
|
}
|
|
2614
|
-
function
|
|
2620
|
+
function Fn(n) {
|
|
2615
2621
|
let e = n;
|
|
2616
2622
|
n.isCollapsed() || e.removeText();
|
|
2617
2623
|
const t = L();
|
|
@@ -2620,11 +2626,11 @@ function Dn(n) {
|
|
|
2620
2626
|
let i = r.getNode(), s = r.offset;
|
|
2621
2627
|
for (; !be(i); ) {
|
|
2622
2628
|
const o = i;
|
|
2623
|
-
if ([i, s] =
|
|
2629
|
+
if ([i, s] = Bo(i, s), o.is(i)) break;
|
|
2624
2630
|
}
|
|
2625
2631
|
return s;
|
|
2626
2632
|
}
|
|
2627
|
-
function
|
|
2633
|
+
function Bo(n, e) {
|
|
2628
2634
|
const t = n.getParent();
|
|
2629
2635
|
if (!t) {
|
|
2630
2636
|
const i = Ee();
|
|
@@ -2644,20 +2650,20 @@ function Io(n, e) {
|
|
|
2644
2650
|
}
|
|
2645
2651
|
return [t, n.getIndexWithinParent() + 1];
|
|
2646
2652
|
}
|
|
2647
|
-
function
|
|
2653
|
+
function ni(n, e, t, r, i = "decorators-and-blocks") {
|
|
2648
2654
|
if (e === "move" && r === "character" && !n.isCollapsed()) {
|
|
2649
2655
|
const [u, d] = t === n.isBackward() ? [n.focus, n.anchor] : [n.anchor, n.focus];
|
|
2650
2656
|
return d.set(u.key, u.offset, u.type), !0;
|
|
2651
2657
|
}
|
|
2652
|
-
const s =
|
|
2658
|
+
const s = He(n.focus, t ? "previous" : "next"), o = r === "lineboundary", l = e === "move";
|
|
2653
2659
|
let a = s, c = i === "decorators-and-blocks";
|
|
2654
|
-
if (!
|
|
2660
|
+
if (!yl(a)) {
|
|
2655
2661
|
for (const u of a) {
|
|
2656
2662
|
c = !1;
|
|
2657
2663
|
const { origin: d } = u;
|
|
2658
2664
|
if (!B(d) || d.isIsolated() || (a = u, !o || !d.isInline())) break;
|
|
2659
2665
|
}
|
|
2660
|
-
if (c) for (const u of
|
|
2666
|
+
if (c) for (const u of ws(s).iterNodeCarets(e === "extend" ? "shadowRoot" : "root")) {
|
|
2661
2667
|
if (de(u)) u.origin.isInline() || (a = u);
|
|
2662
2668
|
else {
|
|
2663
2669
|
if (v(u.origin)) continue;
|
|
@@ -2668,34 +2674,34 @@ function ti(n, e, t, r, i = "decorators-and-blocks") {
|
|
|
2668
2674
|
}
|
|
2669
2675
|
if (a === s) return !1;
|
|
2670
2676
|
if (l && !o && B(a.origin) && a.origin.isKeyboardSelectable()) {
|
|
2671
|
-
const u =
|
|
2677
|
+
const u = is();
|
|
2672
2678
|
return u.add(a.origin.getKey()), re(u), !0;
|
|
2673
2679
|
}
|
|
2674
2680
|
return a = fe(a), l && wt(n.anchor, a), wt(n.focus, a), c || !o;
|
|
2675
2681
|
}
|
|
2676
|
-
let
|
|
2677
|
-
const
|
|
2682
|
+
let $ = null, j = null, Z = !1, Ln = !1, Ht = 0;
|
|
2683
|
+
const ri = { characterData: !0, childList: !0, subtree: !0 };
|
|
2678
2684
|
function Ot() {
|
|
2679
|
-
return Z ||
|
|
2685
|
+
return Z || $ !== null && $._readOnly;
|
|
2680
2686
|
}
|
|
2681
2687
|
function X() {
|
|
2682
2688
|
Z && T(13);
|
|
2683
2689
|
}
|
|
2684
|
-
function
|
|
2685
|
-
|
|
2690
|
+
function os() {
|
|
2691
|
+
Ht > 99 && T(14);
|
|
2686
2692
|
}
|
|
2687
2693
|
function Pe() {
|
|
2688
|
-
return
|
|
2694
|
+
return $ === null && T(195, ls()), $;
|
|
2689
2695
|
}
|
|
2690
2696
|
function R() {
|
|
2691
|
-
return
|
|
2697
|
+
return j === null && T(196, ls()), j;
|
|
2692
2698
|
}
|
|
2693
|
-
function
|
|
2699
|
+
function ls() {
|
|
2694
2700
|
let n = 0;
|
|
2695
2701
|
const e = /* @__PURE__ */ new Set(), t = ot.version;
|
|
2696
2702
|
if (typeof window < "u") for (const i of document.querySelectorAll("[contenteditable]")) {
|
|
2697
|
-
const s =
|
|
2698
|
-
if (
|
|
2703
|
+
const s = xn(i);
|
|
2704
|
+
if (fr(s)) n++;
|
|
2699
2705
|
else if (s) {
|
|
2700
2706
|
let o = String(s.constructor.version || "<0.17.1");
|
|
2701
2707
|
o === t && (o += " (separately built, likely a bundler configuration issue)"), e.add(o);
|
|
@@ -2704,65 +2710,65 @@ function ss() {
|
|
|
2704
2710
|
let r = ` Detected on the page: ${n} compatible editor(s) with version ${t}`;
|
|
2705
2711
|
return e.size && (r += ` and incompatible editors with versions ${Array.from(e).join(", ")}`), r;
|
|
2706
2712
|
}
|
|
2707
|
-
function
|
|
2708
|
-
return
|
|
2713
|
+
function Ro() {
|
|
2714
|
+
return j;
|
|
2709
2715
|
}
|
|
2710
|
-
function
|
|
2711
|
-
const r = e.__type, i =
|
|
2716
|
+
function ii(n, e, t) {
|
|
2717
|
+
const r = e.__type, i = hs(n, r);
|
|
2712
2718
|
let s = t.get(r);
|
|
2713
2719
|
s === void 0 && (s = Array.from(i.transforms), t.set(r, s));
|
|
2714
2720
|
const o = s.length;
|
|
2715
2721
|
for (let l = 0; l < o && (s[l](e), e.isAttached()); l++) ;
|
|
2716
2722
|
}
|
|
2717
|
-
function
|
|
2723
|
+
function si(n, e) {
|
|
2718
2724
|
return n !== void 0 && n.__key !== e && n.isAttached();
|
|
2719
2725
|
}
|
|
2720
|
-
function
|
|
2726
|
+
function as(n, e) {
|
|
2721
2727
|
if (!e) return;
|
|
2722
2728
|
const t = n._updateTags;
|
|
2723
2729
|
let r = e;
|
|
2724
2730
|
Array.isArray(e) || (r = [e]);
|
|
2725
2731
|
for (const i of r) t.add(i);
|
|
2726
2732
|
}
|
|
2727
|
-
function
|
|
2728
|
-
return
|
|
2733
|
+
function Kl(n) {
|
|
2734
|
+
return ar(n, R()._nodes);
|
|
2729
2735
|
}
|
|
2730
|
-
function
|
|
2736
|
+
function ar(n, e) {
|
|
2731
2737
|
const t = n.type, r = e.get(t);
|
|
2732
2738
|
r === void 0 && T(17, t);
|
|
2733
2739
|
const i = r.klass;
|
|
2734
2740
|
n.type !== i.getType() && T(18, i.name);
|
|
2735
2741
|
const s = i.importJSON(n), o = n.children;
|
|
2736
2742
|
if (v(s) && Array.isArray(o)) for (let l = 0; l < o.length; l++) {
|
|
2737
|
-
const a =
|
|
2743
|
+
const a = ar(o[l], e);
|
|
2738
2744
|
s.append(a);
|
|
2739
2745
|
}
|
|
2740
2746
|
return s;
|
|
2741
2747
|
}
|
|
2742
|
-
function
|
|
2743
|
-
const r =
|
|
2744
|
-
|
|
2748
|
+
function oi(n, e, t) {
|
|
2749
|
+
const r = $, i = Z, s = j;
|
|
2750
|
+
$ = e, Z = !0, j = n;
|
|
2745
2751
|
try {
|
|
2746
2752
|
return t();
|
|
2747
2753
|
} finally {
|
|
2748
|
-
|
|
2754
|
+
$ = r, Z = i, j = s;
|
|
2749
2755
|
}
|
|
2750
2756
|
}
|
|
2751
2757
|
function Ce(n, e) {
|
|
2752
2758
|
const t = n._pendingEditorState, r = n._rootElement, i = n._headless || r === null;
|
|
2753
2759
|
if (t === null) return;
|
|
2754
|
-
const s = n._editorState, o = s._selection, l = t._selection, a = n._dirtyType !== 0, c =
|
|
2760
|
+
const s = n._editorState, o = s._selection, l = t._selection, a = n._dirtyType !== 0, c = $, u = Z, d = j, f = n._updating, g = n._observer;
|
|
2755
2761
|
let h = null;
|
|
2756
2762
|
if (n._pendingEditorState = null, n._editorState = t, !i && a && g !== null) {
|
|
2757
|
-
|
|
2763
|
+
j = n, $ = t, Z = !1, n._updating = !0;
|
|
2758
2764
|
try {
|
|
2759
2765
|
const C = n._dirtyType, w = n._dirtyElements, k = n._dirtyLeaves;
|
|
2760
|
-
g.disconnect(), h =
|
|
2766
|
+
g.disconnect(), h = no(s, t, n, C, w, k);
|
|
2761
2767
|
} catch (C) {
|
|
2762
|
-
if (C instanceof Error && n._onError(C),
|
|
2763
|
-
return
|
|
2768
|
+
if (C instanceof Error && n._onError(C), Ln) throw C;
|
|
2769
|
+
return ds(n, null, r, t), Ai(n), n._dirtyType = 2, Ln = !0, Ce(n, s), void (Ln = !1);
|
|
2764
2770
|
} finally {
|
|
2765
|
-
g.observe(r,
|
|
2771
|
+
g.observe(r, ri), n._updating = f, $ = c, Z = u, j = d;
|
|
2766
2772
|
}
|
|
2767
2773
|
}
|
|
2768
2774
|
t._readOnly || (t._readOnly = !0);
|
|
@@ -2772,15 +2778,15 @@ function Ce(n, e) {
|
|
|
2772
2778
|
let S = C._pendingDecorators || k;
|
|
2773
2779
|
const O = w._nodeMap;
|
|
2774
2780
|
let D;
|
|
2775
|
-
for (D in S) O.has(D) || (S === k && (S =
|
|
2781
|
+
for (D in S) O.has(D) || (S === k && (S = xs(C)), delete S[D]);
|
|
2776
2782
|
})(n, t);
|
|
2777
2783
|
const b = i ? null : Se(se(n));
|
|
2778
|
-
if (n._editable && b !== null && (a || l === null || l.dirty) && r !== null && !y.has(
|
|
2779
|
-
|
|
2784
|
+
if (n._editable && b !== null && (a || l === null || l.dirty) && r !== null && !y.has(wo)) {
|
|
2785
|
+
j = n, $ = t;
|
|
2780
2786
|
try {
|
|
2781
2787
|
if (g !== null && g.disconnect(), a || l === null || l.dirty) {
|
|
2782
2788
|
const C = n._blockCursorElement;
|
|
2783
|
-
C !== null &&
|
|
2789
|
+
C !== null && nr(C, n, r), zo(o, l, n, b, y, r);
|
|
2784
2790
|
}
|
|
2785
2791
|
(function(C, w, k) {
|
|
2786
2792
|
let S = C._blockCursorElement;
|
|
@@ -2788,12 +2794,12 @@ function Ce(n, e) {
|
|
|
2788
2794
|
const O = k.anchor, D = O.getNode(), z = O.offset;
|
|
2789
2795
|
let F = !1, I = null;
|
|
2790
2796
|
if (z === D.getChildrenSize())
|
|
2791
|
-
|
|
2797
|
+
Kn(D.getChildAtIndex(z - 1)) && (F = !0);
|
|
2792
2798
|
else {
|
|
2793
2799
|
const W = D.getChildAtIndex(z);
|
|
2794
|
-
if (W !== null &&
|
|
2800
|
+
if (W !== null && Kn(W)) {
|
|
2795
2801
|
const G = W.getPreviousSibling();
|
|
2796
|
-
(G === null ||
|
|
2802
|
+
(G === null || Kn(G)) && (F = !0, I = C.getElementByKey(W.__key));
|
|
2797
2803
|
}
|
|
2798
2804
|
}
|
|
2799
2805
|
if (F) {
|
|
@@ -2804,7 +2810,7 @@ function Ce(n, e) {
|
|
|
2804
2810
|
let _e = te.blockCursor;
|
|
2805
2811
|
if (_e !== void 0) {
|
|
2806
2812
|
if (typeof _e == "string") {
|
|
2807
|
-
const ft =
|
|
2813
|
+
const ft = Ni(_e);
|
|
2808
2814
|
_e = te.blockCursor = ft;
|
|
2809
2815
|
}
|
|
2810
2816
|
_e !== void 0 && Qe.classList.add(..._e);
|
|
@@ -2813,10 +2819,10 @@ function Ce(n, e) {
|
|
|
2813
2819
|
})(C._config)), w.style.caretColor = "transparent", void (I === null ? W.appendChild(S) : W.insertBefore(S, I));
|
|
2814
2820
|
}
|
|
2815
2821
|
}
|
|
2816
|
-
S !== null &&
|
|
2822
|
+
S !== null && nr(S, C, w);
|
|
2817
2823
|
})(n, r, l);
|
|
2818
2824
|
} finally {
|
|
2819
|
-
g !== null && g.observe(r,
|
|
2825
|
+
g !== null && g.observe(r, ri), j = d, $ = c;
|
|
2820
2826
|
}
|
|
2821
2827
|
}
|
|
2822
2828
|
h !== null && (function(C, w, k, S, O) {
|
|
@@ -2828,10 +2834,10 @@ function Ce(n, e) {
|
|
|
2828
2834
|
te !== void 0 && I(te, { dirtyLeaves: S, prevEditorState: O, updateTags: k });
|
|
2829
2835
|
}
|
|
2830
2836
|
}
|
|
2831
|
-
})(n, h, y, _, s), A(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(
|
|
2837
|
+
})(n, h, y, _, s), A(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(Ki, void 0);
|
|
2832
2838
|
const N = n._pendingDecorators;
|
|
2833
2839
|
N !== null && (n._decorators = N, n._pendingDecorators = null, xt("decorator", n, !0, N)), (function(C, w, k) {
|
|
2834
|
-
const S =
|
|
2840
|
+
const S = fi(w), O = fi(k);
|
|
2835
2841
|
S !== O && xt("textcontent", C, !0, O);
|
|
2836
2842
|
})(n, e || s, t), xt("update", n, !0, { dirtyElements: p, dirtyLeaves: _, editorState: t, mutatedNodes: h, normalizedNodes: x, prevEditorState: e || s, tags: y }), (function(C, w) {
|
|
2837
2843
|
if (C._deferred = [], w.length !== 0) {
|
|
@@ -2849,7 +2855,7 @@ function Ce(n, e) {
|
|
|
2849
2855
|
const k = w.shift();
|
|
2850
2856
|
if (k) {
|
|
2851
2857
|
const [S, O] = k;
|
|
2852
|
-
|
|
2858
|
+
yn(C, S, O);
|
|
2853
2859
|
}
|
|
2854
2860
|
}
|
|
2855
2861
|
})(n);
|
|
@@ -2864,7 +2870,7 @@ function xt(n, e, t, ...r) {
|
|
|
2864
2870
|
e._updating = i;
|
|
2865
2871
|
}
|
|
2866
2872
|
}
|
|
2867
|
-
function
|
|
2873
|
+
function li(n, e) {
|
|
2868
2874
|
const t = n._updates;
|
|
2869
2875
|
let r = e || !1;
|
|
2870
2876
|
for (; t.length !== 0; ) {
|
|
@@ -2872,29 +2878,29 @@ function oi(n, e) {
|
|
|
2872
2878
|
if (i) {
|
|
2873
2879
|
const [s, o] = i, l = n._pendingEditorState;
|
|
2874
2880
|
let a;
|
|
2875
|
-
o !== void 0 && (a = o.onUpdate, o.skipTransforms && (r = !0), o.discrete && (l === null && T(191), l._flushSync = !0), a && n._deferred.push(a),
|
|
2881
|
+
o !== void 0 && (a = o.onUpdate, o.skipTransforms && (r = !0), o.discrete && (l === null && T(191), l._flushSync = !0), a && n._deferred.push(a), as(n, o.tag)), l == null ? yn(n, s, o) : s();
|
|
2876
2882
|
}
|
|
2877
2883
|
}
|
|
2878
2884
|
return r;
|
|
2879
2885
|
}
|
|
2880
|
-
function
|
|
2886
|
+
function yn(n, e, t) {
|
|
2881
2887
|
const r = n._updateTags;
|
|
2882
2888
|
let i, s = !1, o = !1;
|
|
2883
|
-
t !== void 0 && (i = t.onUpdate,
|
|
2889
|
+
t !== void 0 && (i = t.onUpdate, as(n, t.tag), s = t.skipTransforms || !1, o = t.discrete || !1), i && n._deferred.push(i);
|
|
2884
2890
|
const l = n._editorState;
|
|
2885
2891
|
let a = n._pendingEditorState, c = !1;
|
|
2886
|
-
(a === null || a._readOnly) && (a = n._pendingEditorState =
|
|
2887
|
-
const u =
|
|
2888
|
-
|
|
2892
|
+
(a === null || a._readOnly) && (a = n._pendingEditorState = us(a || l), c = !0), a._flushSync = o;
|
|
2893
|
+
const u = $, d = Z, f = j, g = n._updating;
|
|
2894
|
+
$ = a, Z = !1, n._updating = !0, j = n;
|
|
2889
2895
|
const h = n._headless || n.getRootElement() === null;
|
|
2890
|
-
|
|
2896
|
+
ur(null);
|
|
2891
2897
|
try {
|
|
2892
2898
|
c && (h ? l._selection !== null && (a._selection = l._selection.clone()) : a._selection = (function(y, m) {
|
|
2893
2899
|
const b = y.getEditorState()._selection, N = Se(se(y));
|
|
2894
|
-
return A(b) || b == null ?
|
|
2900
|
+
return A(b) || b == null ? pn(b, N, y, m) : b.clone();
|
|
2895
2901
|
})(n, t && t.event || null));
|
|
2896
2902
|
const p = n._compositionKey;
|
|
2897
|
-
e(), s =
|
|
2903
|
+
e(), s = li(n, s), (function(y, m) {
|
|
2898
2904
|
const b = m.getEditorState()._selection, N = y._selection;
|
|
2899
2905
|
if (A(N)) {
|
|
2900
2906
|
const C = N.anchor, w = N.focus;
|
|
@@ -2908,7 +2914,7 @@ function pn(n, e, t) {
|
|
|
2908
2914
|
const b = m._dirtyLeaves, N = y._nodeMap;
|
|
2909
2915
|
for (const C of b) {
|
|
2910
2916
|
const w = N.get(C);
|
|
2911
|
-
M(w) && w.isAttached() && w.isSimpleText() && !w.isUnmergeable() &&
|
|
2917
|
+
M(w) && w.isAttached() && w.isSimpleText() && !w.isUnmergeable() && Fr(w);
|
|
2912
2918
|
}
|
|
2913
2919
|
})(a, n) : (function(y, m) {
|
|
2914
2920
|
const b = m._dirtyLeaves, N = m._dirtyElements, C = y._nodeMap, w = Ne(), k = /* @__PURE__ */ new Map();
|
|
@@ -2918,10 +2924,10 @@ function pn(n, e, t) {
|
|
|
2918
2924
|
m._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
2919
2925
|
for (const F of S) {
|
|
2920
2926
|
const I = C.get(F);
|
|
2921
|
-
M(I) && I.isAttached() && I.isSimpleText() && !I.isUnmergeable() &&
|
|
2927
|
+
M(I) && I.isAttached() && I.isSimpleText() && !I.isUnmergeable() && Fr(I), I !== void 0 && si(I, w) && ii(m, I, k), b.add(F);
|
|
2922
2928
|
}
|
|
2923
2929
|
if (S = m._dirtyLeaves, O = S.size, O > 0) {
|
|
2924
|
-
|
|
2930
|
+
Ht++;
|
|
2925
2931
|
continue;
|
|
2926
2932
|
}
|
|
2927
2933
|
}
|
|
@@ -2930,16 +2936,16 @@ function pn(n, e, t) {
|
|
|
2930
2936
|
const I = F[0], W = F[1];
|
|
2931
2937
|
if (N.set(I, W), !W) continue;
|
|
2932
2938
|
const G = C.get(I);
|
|
2933
|
-
G !== void 0 &&
|
|
2939
|
+
G !== void 0 && si(G, w) && ii(m, G, k);
|
|
2934
2940
|
}
|
|
2935
|
-
S = m._dirtyLeaves, O = S.size, D = m._dirtyElements, z = D.size,
|
|
2941
|
+
S = m._dirtyLeaves, O = S.size, D = m._dirtyElements, z = D.size, Ht++;
|
|
2936
2942
|
}
|
|
2937
2943
|
m._dirtyLeaves = b, m._dirtyElements = N;
|
|
2938
|
-
})(a, n),
|
|
2944
|
+
})(a, n), li(n), (function(y, m, b, N) {
|
|
2939
2945
|
const C = y._nodeMap, w = m._nodeMap, k = [];
|
|
2940
2946
|
for (const [S] of N) {
|
|
2941
2947
|
const O = w.get(S);
|
|
2942
|
-
O !== void 0 && (O.isAttached() || (v(O) &&
|
|
2948
|
+
O !== void 0 && (O.isAttached() || (v(O) && Ei(O, S, C, w, k, N), C.has(S) || N.delete(S), k.push(S)));
|
|
2943
2949
|
}
|
|
2944
2950
|
for (const S of k) w.delete(S);
|
|
2945
2951
|
for (const S of b) {
|
|
@@ -2951,11 +2957,11 @@ function pn(n, e, t) {
|
|
|
2951
2957
|
if (A(x)) {
|
|
2952
2958
|
const y = a._nodeMap, m = x.anchor.key, b = x.focus.key;
|
|
2953
2959
|
y.get(m) !== void 0 && y.get(b) !== void 0 || T(19);
|
|
2954
|
-
} else
|
|
2960
|
+
} else lr(x) && x._nodes.size === 0 && (a._selection = null);
|
|
2955
2961
|
} catch (p) {
|
|
2956
2962
|
return p instanceof Error && n._onError(p), n._pendingEditorState = l, n._dirtyType = 2, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements.clear(), void Ce(n);
|
|
2957
2963
|
} finally {
|
|
2958
|
-
|
|
2964
|
+
$ = u, Z = d, j = f, n._updating = g, Ht = 0;
|
|
2959
2965
|
}
|
|
2960
2966
|
n._dirtyType !== 0 || n._deferred.length > 0 || (function(p, x) {
|
|
2961
2967
|
const y = x.getEditorState()._selection, m = p._selection;
|
|
@@ -2963,12 +2969,12 @@ function pn(n, e, t) {
|
|
|
2963
2969
|
if (m.dirty || !m.is(y)) return !0;
|
|
2964
2970
|
} else if (y !== null) return !0;
|
|
2965
2971
|
return !1;
|
|
2966
|
-
})(a, n) ? a._flushSync ? (a._flushSync = !1, Ce(n)) : c &&
|
|
2972
|
+
})(a, n) ? a._flushSync ? (a._flushSync = !1, Ce(n)) : c && Uo(() => {
|
|
2967
2973
|
Ce(n);
|
|
2968
2974
|
}) : (a._flushSync = !1, c && (r.clear(), n._deferred = [], n._pendingEditorState = null));
|
|
2969
2975
|
}
|
|
2970
2976
|
function ne(n, e, t) {
|
|
2971
|
-
|
|
2977
|
+
j === n && t === void 0 ? e() : yn(n, e, t);
|
|
2972
2978
|
}
|
|
2973
2979
|
class Ct {
|
|
2974
2980
|
element;
|
|
@@ -3039,9 +3045,9 @@ class Ct {
|
|
|
3039
3045
|
const a = this.getFirstChildOffset();
|
|
3040
3046
|
return [e, Math.min(a + e.getChildrenSize(), Math.max(a, i))];
|
|
3041
3047
|
}
|
|
3042
|
-
const s =
|
|
3048
|
+
const s = ai(t, r);
|
|
3043
3049
|
s.push(i);
|
|
3044
|
-
const o =
|
|
3050
|
+
const o = ai(t, this.element);
|
|
3045
3051
|
let l = e.getIndexWithinParent();
|
|
3046
3052
|
for (let a = 0; a < o.length; a++) {
|
|
3047
3053
|
const c = s[a], u = o[a];
|
|
@@ -3054,7 +3060,7 @@ class Ct {
|
|
|
3054
3060
|
return [e.getParentOrThrow(), l];
|
|
3055
3061
|
}
|
|
3056
3062
|
}
|
|
3057
|
-
function
|
|
3063
|
+
function ai(n, e) {
|
|
3058
3064
|
const t = [];
|
|
3059
3065
|
let r = e;
|
|
3060
3066
|
for (; r !== n && r !== null; r = r.parentNode) {
|
|
@@ -3085,7 +3091,7 @@ class At extends we {
|
|
|
3085
3091
|
}
|
|
3086
3092
|
getFormatType() {
|
|
3087
3093
|
const e = this.getFormat();
|
|
3088
|
-
return
|
|
3094
|
+
return Us[e] || "";
|
|
3089
3095
|
}
|
|
3090
3096
|
getStyle() {
|
|
3091
3097
|
return this.getLatest().__style;
|
|
@@ -3216,7 +3222,7 @@ class At extends we {
|
|
|
3216
3222
|
}
|
|
3217
3223
|
hasFormat(e) {
|
|
3218
3224
|
if (e !== "") {
|
|
3219
|
-
const t =
|
|
3225
|
+
const t = Nr[e];
|
|
3220
3226
|
return (this.getFormat() & t) !== 0;
|
|
3221
3227
|
}
|
|
3222
3228
|
return !1;
|
|
@@ -3226,7 +3232,7 @@ class At extends we {
|
|
|
3226
3232
|
return (this.getTextFormat() & t) !== 0;
|
|
3227
3233
|
}
|
|
3228
3234
|
getFormatFlags(e, t) {
|
|
3229
|
-
return
|
|
3235
|
+
return fn(this.getLatest().__textFormat, e, t);
|
|
3230
3236
|
}
|
|
3231
3237
|
getTextStyle() {
|
|
3232
3238
|
return this.getLatest().__textStyle;
|
|
@@ -3247,7 +3253,7 @@ class At extends we {
|
|
|
3247
3253
|
}
|
|
3248
3254
|
i === void 0 && (i = o), s === void 0 && (s = o);
|
|
3249
3255
|
const l = this.__key;
|
|
3250
|
-
return A(r) ? (r.anchor.set(l, i, "element"), r.focus.set(l, s, "element"), r.dirty = !0, r) :
|
|
3256
|
+
return A(r) ? (r.anchor.set(l, i, "element"), r.focus.set(l, s, "element"), r.dirty = !0, r) : rs(l, i, l, s, "element", "element");
|
|
3251
3257
|
}
|
|
3252
3258
|
selectStart() {
|
|
3253
3259
|
const e = this.getFirstDescendant();
|
|
@@ -3269,7 +3275,7 @@ class At extends we {
|
|
|
3269
3275
|
return t.__dir = e, t;
|
|
3270
3276
|
}
|
|
3271
3277
|
setFormat(e) {
|
|
3272
|
-
return this.getWritable().__format = e !== "" ?
|
|
3278
|
+
return this.getWritable().__format = e !== "" ? Nr[e] : 0, this;
|
|
3273
3279
|
}
|
|
3274
3280
|
setStyle(e) {
|
|
3275
3281
|
return this.getWritable().__style = e || "", this;
|
|
@@ -3286,54 +3292,54 @@ class At extends we {
|
|
|
3286
3292
|
return this.getWritable().__indent = e, this;
|
|
3287
3293
|
}
|
|
3288
3294
|
splice(e, t, r) {
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3295
|
+
an(this) && T(324, this.__key, this.__type);
|
|
3296
|
+
const i = this.getChildrenSize(), s = this.getWritable();
|
|
3297
|
+
e + t <= i || T(226, String(e), String(t), String(i));
|
|
3298
|
+
const o = s.__key, l = [], a = [], c = this.getChildAtIndex(e + t);
|
|
3299
|
+
let u = null, d = i - t + r.length;
|
|
3300
|
+
if (e !== 0) if (e === i) u = this.getLastChild();
|
|
3294
3301
|
else {
|
|
3295
|
-
const
|
|
3296
|
-
|
|
3302
|
+
const g = this.getChildAtIndex(e);
|
|
3303
|
+
g !== null && (u = g.getPreviousSibling());
|
|
3297
3304
|
}
|
|
3298
3305
|
if (t > 0) {
|
|
3299
|
-
let
|
|
3300
|
-
for (let
|
|
3301
|
-
|
|
3302
|
-
const
|
|
3303
|
-
ze(
|
|
3306
|
+
let g = u === null ? this.getFirstChild() : u.getNextSibling();
|
|
3307
|
+
for (let h = 0; h < t; h++) {
|
|
3308
|
+
g === null && T(100);
|
|
3309
|
+
const _ = g.getNextSibling(), p = g.__key;
|
|
3310
|
+
ze(g.getWritable()), a.push(p), g = _;
|
|
3304
3311
|
}
|
|
3305
3312
|
}
|
|
3306
|
-
let
|
|
3307
|
-
for (
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
if (g === null) o.__first = x, p.__prev = null;
|
|
3313
|
+
let f = u;
|
|
3314
|
+
for (const g of r) {
|
|
3315
|
+
f !== null && g.is(f) && (u = f = f.getPreviousSibling());
|
|
3316
|
+
const h = g.getWritable();
|
|
3317
|
+
h.__parent === o && d--, ze(h);
|
|
3318
|
+
const _ = g.__key;
|
|
3319
|
+
if (f === null) s.__first = _, h.__prev = null;
|
|
3314
3320
|
else {
|
|
3315
|
-
const
|
|
3316
|
-
|
|
3321
|
+
const p = f.getWritable();
|
|
3322
|
+
p.__next = _, h.__prev = p.__key;
|
|
3317
3323
|
}
|
|
3318
|
-
|
|
3319
|
-
}
|
|
3320
|
-
if (e + t ===
|
|
3321
|
-
|
|
3322
|
-
else if (
|
|
3323
|
-
const
|
|
3324
|
-
if (
|
|
3325
|
-
const
|
|
3326
|
-
|
|
3327
|
-
} else
|
|
3328
|
-
}
|
|
3329
|
-
if (
|
|
3330
|
-
const
|
|
3331
|
-
if (A(
|
|
3332
|
-
const
|
|
3333
|
-
|
|
3324
|
+
g.__key === o && T(76), h.__parent = o, l.push(_), f = g;
|
|
3325
|
+
}
|
|
3326
|
+
if (e + t === i)
|
|
3327
|
+
f !== null && (f.getWritable().__next = null, s.__last = f.__key);
|
|
3328
|
+
else if (c !== null) {
|
|
3329
|
+
const g = c.getWritable();
|
|
3330
|
+
if (f !== null) {
|
|
3331
|
+
const h = f.getWritable();
|
|
3332
|
+
g.__prev = f.__key, h.__next = c.__key;
|
|
3333
|
+
} else g.__prev = null;
|
|
3334
|
+
}
|
|
3335
|
+
if (s.__size = d, a.length) {
|
|
3336
|
+
const g = L();
|
|
3337
|
+
if (A(g)) {
|
|
3338
|
+
const h = new Set(a), _ = new Set(l), { anchor: p, focus: x } = g;
|
|
3339
|
+
ci(p, h, _) && un(p, p.getNode(), this, u, c), ci(x, h, _) && un(x, x.getNode(), this, u, c), d !== 0 || this.canBeEmpty() || De(this) || this.remove();
|
|
3334
3340
|
}
|
|
3335
3341
|
}
|
|
3336
|
-
return
|
|
3342
|
+
return s;
|
|
3337
3343
|
}
|
|
3338
3344
|
getDOMSlot(e) {
|
|
3339
3345
|
return new Ct(e);
|
|
@@ -3409,7 +3415,7 @@ class At extends we {
|
|
|
3409
3415
|
function v(n) {
|
|
3410
3416
|
return n instanceof At;
|
|
3411
3417
|
}
|
|
3412
|
-
function
|
|
3418
|
+
function ci(n, e, t) {
|
|
3413
3419
|
let r = n.getNode();
|
|
3414
3420
|
for (; r; ) {
|
|
3415
3421
|
const i = r.__key;
|
|
@@ -3418,7 +3424,7 @@ function ai(n, e, t) {
|
|
|
3418
3424
|
}
|
|
3419
3425
|
return !1;
|
|
3420
3426
|
}
|
|
3421
|
-
class
|
|
3427
|
+
class cs extends we {
|
|
3422
3428
|
decorate(e, t) {
|
|
3423
3429
|
return null;
|
|
3424
3430
|
}
|
|
@@ -3433,7 +3439,7 @@ class ls extends we {
|
|
|
3433
3439
|
}
|
|
3434
3440
|
}
|
|
3435
3441
|
function B(n) {
|
|
3436
|
-
return n instanceof
|
|
3442
|
+
return n instanceof cs;
|
|
3437
3443
|
}
|
|
3438
3444
|
class Pt extends At {
|
|
3439
3445
|
__cachedText;
|
|
@@ -3479,29 +3485,29 @@ class Pt extends At {
|
|
|
3479
3485
|
return !0;
|
|
3480
3486
|
}
|
|
3481
3487
|
}
|
|
3482
|
-
function
|
|
3488
|
+
function H(n) {
|
|
3483
3489
|
return n instanceof Pt;
|
|
3484
3490
|
}
|
|
3485
|
-
function
|
|
3491
|
+
function us(n) {
|
|
3486
3492
|
return new Dt(new Map(n._nodeMap));
|
|
3487
3493
|
}
|
|
3488
|
-
function
|
|
3494
|
+
function cr() {
|
|
3489
3495
|
return new Dt(/* @__PURE__ */ new Map([["root", new Pt()]]));
|
|
3490
3496
|
}
|
|
3491
|
-
function
|
|
3497
|
+
function fs(n) {
|
|
3492
3498
|
const e = n.exportJSON(), t = n.constructor;
|
|
3493
3499
|
if (e.type !== t.getType() && T(130, t.name), v(n)) {
|
|
3494
3500
|
const r = e.children;
|
|
3495
3501
|
Array.isArray(r) || T(59, t.name);
|
|
3496
3502
|
const i = n.getChildren();
|
|
3497
3503
|
for (let s = 0; s < i.length; s++) {
|
|
3498
|
-
const o =
|
|
3504
|
+
const o = fs(i[s]);
|
|
3499
3505
|
r.push(o);
|
|
3500
3506
|
}
|
|
3501
3507
|
}
|
|
3502
3508
|
return e;
|
|
3503
3509
|
}
|
|
3504
|
-
function
|
|
3510
|
+
function zl(n) {
|
|
3505
3511
|
return n instanceof Dt;
|
|
3506
3512
|
}
|
|
3507
3513
|
class Dt {
|
|
@@ -3516,17 +3522,17 @@ class Dt {
|
|
|
3516
3522
|
return this._nodeMap.size === 1 && this._selection === null;
|
|
3517
3523
|
}
|
|
3518
3524
|
read(e, t) {
|
|
3519
|
-
return
|
|
3525
|
+
return oi(t && t.editor || null, this, e);
|
|
3520
3526
|
}
|
|
3521
3527
|
clone(e) {
|
|
3522
3528
|
const t = new Dt(this._nodeMap, e === void 0 ? this._selection : e);
|
|
3523
3529
|
return t._readOnly = !0, t;
|
|
3524
3530
|
}
|
|
3525
3531
|
toJSON() {
|
|
3526
|
-
return
|
|
3532
|
+
return oi(null, this, () => ({ root: fs(ie()) }));
|
|
3527
3533
|
}
|
|
3528
3534
|
}
|
|
3529
|
-
class
|
|
3535
|
+
class Wo extends At {
|
|
3530
3536
|
static getType() {
|
|
3531
3537
|
return "artificial";
|
|
3532
3538
|
}
|
|
@@ -3549,7 +3555,7 @@ class Ft extends At {
|
|
|
3549
3555
|
return !1;
|
|
3550
3556
|
}
|
|
3551
3557
|
static importDOM() {
|
|
3552
|
-
return { p: (e) => ({ conversion:
|
|
3558
|
+
return { p: (e) => ({ conversion: Jo, priority: 0 }) };
|
|
3553
3559
|
}
|
|
3554
3560
|
exportDOM(e) {
|
|
3555
3561
|
const { element: t } = super.exportDOM(e);
|
|
@@ -3581,25 +3587,25 @@ class Ft extends At {
|
|
|
3581
3587
|
return !1;
|
|
3582
3588
|
}
|
|
3583
3589
|
}
|
|
3584
|
-
function
|
|
3590
|
+
function Jo(n) {
|
|
3585
3591
|
const e = Ee();
|
|
3586
|
-
return n.style && (e.setFormat(n.style.textAlign),
|
|
3592
|
+
return n.style && (e.setFormat(n.style.textAlign), sl(n, e)), { node: e };
|
|
3587
3593
|
}
|
|
3588
3594
|
function Ee() {
|
|
3589
|
-
return
|
|
3595
|
+
return vn(new Ft());
|
|
3590
3596
|
}
|
|
3591
|
-
function
|
|
3597
|
+
function $o(n) {
|
|
3592
3598
|
return n instanceof Ft;
|
|
3593
3599
|
}
|
|
3594
|
-
const
|
|
3595
|
-
function
|
|
3600
|
+
const Bl = 0, Rl = 1, Wl = 2, Jl = 3, $l = 4;
|
|
3601
|
+
function ds(n, e, t, r) {
|
|
3596
3602
|
const i = n._keyToDOMMap;
|
|
3597
|
-
i.clear(), n._editorState =
|
|
3603
|
+
i.clear(), n._editorState = cr(), n._pendingEditorState = r, n._compositionKey = null, n._dirtyType = 0, 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;
|
|
3598
3604
|
const s = n._observer;
|
|
3599
3605
|
s !== null && (s.disconnect(), n._observer = null), e !== null && (e.textContent = ""), t !== null && (t.textContent = "", i.set("root", t));
|
|
3600
3606
|
}
|
|
3601
|
-
function
|
|
3602
|
-
const e = n || {}, t =
|
|
3607
|
+
function jl(n) {
|
|
3608
|
+
const e = n || {}, t = Ro(), r = e.theme || {}, i = n === void 0 ? t : e.parentEditor || null, s = e.disableEvents || !1, o = cr(), l = e.namespace || (i !== null ? i._config.namespace : vs()), a = e.editorState, c = [Pt, ct, Et, Mt, Ft, Wo, ...e.nodes || []], { onError: u, html: d } = e, f = e.editable === void 0 || e.editable;
|
|
3603
3609
|
let g;
|
|
3604
3610
|
if (n === void 0 && t !== null) g = t._nodes;
|
|
3605
3611
|
else {
|
|
@@ -3610,8 +3616,8 @@ function Jl(n) {
|
|
|
3610
3616
|
const w = p;
|
|
3611
3617
|
p = w.replace, x = w.with, y = w.withKlass || null;
|
|
3612
3618
|
}
|
|
3613
|
-
const { ownNodeConfig: m } =
|
|
3614
|
-
m && m.$transform && C.add(m.$transform), N !== null && C.add(N), g.set(b, { exportDOM: d && d.export ? d.export.get(p) : void 0, klass: p, replace: x, replaceWithKlass: y, sharedNodeState:
|
|
3619
|
+
const { ownNodeConfig: m } = mr(p), b = p.getType(), N = p.transform(), C = /* @__PURE__ */ new Set();
|
|
3620
|
+
m && m.$transform && C.add(m.$transform), N !== null && C.add(N), g.set(b, { exportDOM: d && d.export ? d.export.get(p) : void 0, klass: p, replace: x, replaceWithKlass: y, sharedNodeState: Qs(c[_]), transforms: C });
|
|
3615
3621
|
}
|
|
3616
3622
|
}
|
|
3617
3623
|
const h = new ot(o, i, g, { disableEvents: s, namespace: l, theme: r }, u || console.error, (function(_, p) {
|
|
@@ -3664,7 +3670,7 @@ class ot {
|
|
|
3664
3670
|
_blockCursorElement;
|
|
3665
3671
|
_createEditorArgs;
|
|
3666
3672
|
constructor(e, t, r, i, s, o, l, a) {
|
|
3667
|
-
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 = 0, 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 =
|
|
3673
|
+
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 = 0, 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;
|
|
3668
3674
|
}
|
|
3669
3675
|
isComposing() {
|
|
3670
3676
|
return this._compositionKey != null;
|
|
@@ -3728,7 +3734,7 @@ class ot {
|
|
|
3728
3734
|
return e;
|
|
3729
3735
|
}
|
|
3730
3736
|
initializeMutationListener(e, t) {
|
|
3731
|
-
const r = this._editorState, i =
|
|
3737
|
+
const r = this._editorState, i = xi(r).get(t.getType());
|
|
3732
3738
|
if (!i) return;
|
|
3733
3739
|
const s = /* @__PURE__ */ new Map();
|
|
3734
3740
|
for (const o of i.keys()) s.set(o, "created");
|
|
@@ -3745,7 +3751,7 @@ class ot {
|
|
|
3745
3751
|
i.push(o);
|
|
3746
3752
|
}
|
|
3747
3753
|
return (function(o, l) {
|
|
3748
|
-
const a =
|
|
3754
|
+
const a = xi(o.getEditorState()), c = [];
|
|
3749
3755
|
for (const u of l) {
|
|
3750
3756
|
const d = a.get(u);
|
|
3751
3757
|
d && c.push(d);
|
|
@@ -3755,7 +3761,7 @@ class ot {
|
|
|
3755
3761
|
const f = U(d);
|
|
3756
3762
|
f && f.markDirty();
|
|
3757
3763
|
}
|
|
3758
|
-
}, o._pendingEditorState === null ? { tag:
|
|
3764
|
+
}, o._pendingEditorState === null ? { tag: On } : void 0);
|
|
3759
3765
|
})(this, i.map((o) => o.klass.getType())), () => {
|
|
3760
3766
|
i.forEach((o) => o.transforms.delete(t));
|
|
3761
3767
|
};
|
|
@@ -3782,40 +3788,40 @@ class ot {
|
|
|
3782
3788
|
const t = this._rootElement;
|
|
3783
3789
|
if (e !== t) {
|
|
3784
3790
|
const r = it(this._config.theme, "root"), i = this._pendingEditorState || this._editorState;
|
|
3785
|
-
if (this._rootElement = e,
|
|
3786
|
-
const s =
|
|
3787
|
-
o.userSelect = "text", o.whiteSpace = "pre-wrap", o.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = s, this._dirtyType = 2,
|
|
3791
|
+
if (this._rootElement = e, ds(this, t, e, i), t !== null && (this._config.disableEvents || To(t), r != null && t.classList.remove(...r)), e !== null) {
|
|
3792
|
+
const s = yr(e), o = e.style;
|
|
3793
|
+
o.userSelect = "text", o.whiteSpace = "pre-wrap", o.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = s, this._dirtyType = 2, Ai(this), this._updateTags.add(On), Ce(this), this._config.disableEvents || (function(l, a) {
|
|
3788
3794
|
const c = l.ownerDocument;
|
|
3789
|
-
|
|
3795
|
+
Gn.set(l, c);
|
|
3790
3796
|
const u = ln.get(c) ?? 0;
|
|
3791
|
-
u < 1 && c.addEventListener("selectionchange",
|
|
3792
|
-
const d =
|
|
3793
|
-
for (let f = 0; f <
|
|
3794
|
-
const [g, h] =
|
|
3795
|
-
|
|
3797
|
+
u < 1 && c.addEventListener("selectionchange", Gi), ln.set(c, u + 1), l.__lexicalEditor = a;
|
|
3798
|
+
const d = qi(l);
|
|
3799
|
+
for (let f = 0; f < qn.length; f++) {
|
|
3800
|
+
const [g, h] = qn[f], _ = typeof h == "function" ? (p) => {
|
|
3801
|
+
$r(p) || (Jr(p), (a.isEditable() || g === "click") && h(p, a));
|
|
3796
3802
|
} : (p) => {
|
|
3797
|
-
if (
|
|
3798
|
-
|
|
3803
|
+
if ($r(p)) return;
|
|
3804
|
+
Jr(p);
|
|
3799
3805
|
const x = a.isEditable();
|
|
3800
3806
|
switch (g) {
|
|
3801
3807
|
case "cut":
|
|
3802
|
-
return x && E(a,
|
|
3808
|
+
return x && E(a, Ji, p);
|
|
3803
3809
|
case "copy":
|
|
3804
|
-
return E(a,
|
|
3810
|
+
return E(a, Wi, p);
|
|
3805
3811
|
case "paste":
|
|
3806
|
-
return x && E(a,
|
|
3812
|
+
return x && E(a, zi, p);
|
|
3807
3813
|
case "dragstart":
|
|
3808
|
-
return x && E(a,
|
|
3814
|
+
return x && E(a, mo, p);
|
|
3809
3815
|
case "dragover":
|
|
3810
|
-
return x && E(a,
|
|
3816
|
+
return x && E(a, xo, p);
|
|
3811
3817
|
case "dragend":
|
|
3812
|
-
return x && E(a,
|
|
3818
|
+
return x && E(a, Co, p);
|
|
3813
3819
|
case "focus":
|
|
3814
|
-
return x && E(a,
|
|
3820
|
+
return x && E(a, So, p);
|
|
3815
3821
|
case "blur":
|
|
3816
|
-
return x && E(a,
|
|
3822
|
+
return x && E(a, vo, p);
|
|
3817
3823
|
case "drop":
|
|
3818
|
-
return x && E(a,
|
|
3824
|
+
return x && E(a, yo, p);
|
|
3819
3825
|
}
|
|
3820
3826
|
};
|
|
3821
3827
|
l.addEventListener(g, _), d.push(() => {
|
|
@@ -3823,7 +3829,7 @@ class ot {
|
|
|
3823
3829
|
});
|
|
3824
3830
|
}
|
|
3825
3831
|
})(e, this), r != null && e.classList.add(...r);
|
|
3826
|
-
} else this._window = null, this._updateTags.add(
|
|
3832
|
+
} else this._window = null, this._updateTags.add(On), Ce(this);
|
|
3827
3833
|
xt("root", this, !1, e, t);
|
|
3828
3834
|
}
|
|
3829
3835
|
}
|
|
@@ -3836,21 +3842,21 @@ class ot {
|
|
|
3836
3842
|
setEditorState(e, t) {
|
|
3837
3843
|
e.isEmpty() && T(38);
|
|
3838
3844
|
let r = e;
|
|
3839
|
-
r._readOnly && (r =
|
|
3845
|
+
r._readOnly && (r = us(e), r._selection = e._selection ? e._selection.clone() : null), Oi(this);
|
|
3840
3846
|
const i = this._pendingEditorState, s = this._updateTags, o = t !== void 0 ? t.tag : null;
|
|
3841
3847
|
i === null || i.isEmpty() || (o != null && s.add(o), Ce(this)), this._pendingEditorState = r, this._dirtyType = 2, this._dirtyElements.set("root", !1), this._compositionKey = null, o != null && s.add(o), this._updating || Ce(this);
|
|
3842
3848
|
}
|
|
3843
3849
|
parseEditorState(e, t) {
|
|
3844
3850
|
return (function(r, i, s) {
|
|
3845
|
-
const o =
|
|
3846
|
-
i._dirtyElements = /* @__PURE__ */ new Map(), i._dirtyLeaves = /* @__PURE__ */ new Set(), i._cloneNotNeeded = /* @__PURE__ */ new Set(), i._dirtyType = 0,
|
|
3851
|
+
const o = cr(), l = $, a = Z, c = j, u = i._dirtyElements, d = i._dirtyLeaves, f = i._cloneNotNeeded, g = i._dirtyType;
|
|
3852
|
+
i._dirtyElements = /* @__PURE__ */ new Map(), i._dirtyLeaves = /* @__PURE__ */ new Set(), i._cloneNotNeeded = /* @__PURE__ */ new Set(), i._dirtyType = 0, $ = o, Z = !1, j = i, ur(null);
|
|
3847
3853
|
try {
|
|
3848
3854
|
const h = i._nodes;
|
|
3849
|
-
|
|
3855
|
+
ar(r.root, h), s && s(), o._readOnly = !0;
|
|
3850
3856
|
} catch (h) {
|
|
3851
3857
|
h instanceof Error && i._onError(h);
|
|
3852
3858
|
} finally {
|
|
3853
|
-
i._dirtyElements = u, i._dirtyLeaves = d, i._cloneNotNeeded = f, i._dirtyType = g,
|
|
3859
|
+
i._dirtyElements = u, i._dirtyLeaves = d, i._cloneNotNeeded = f, i._dirtyType = g, $ = l, Z = a, j = c;
|
|
3854
3860
|
}
|
|
3855
3861
|
return o;
|
|
3856
3862
|
})(typeof e == "string" ? JSON.parse(e) : e, this, t);
|
|
@@ -3860,14 +3866,14 @@ class ot {
|
|
|
3860
3866
|
}
|
|
3861
3867
|
update(e, t) {
|
|
3862
3868
|
(function(r, i, s) {
|
|
3863
|
-
r._updating ? r._updates.push([i, s]) :
|
|
3869
|
+
r._updating ? r._updates.push([i, s]) : yn(r, i, s);
|
|
3864
3870
|
})(this, e, t);
|
|
3865
3871
|
}
|
|
3866
3872
|
focus(e, t = {}) {
|
|
3867
3873
|
const r = this._rootElement;
|
|
3868
3874
|
r !== null && (r.setAttribute("autocapitalize", "off"), ne(this, () => {
|
|
3869
3875
|
const i = L(), s = ie();
|
|
3870
|
-
i !== null ? i.dirty || re(i.clone()) : s.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? s.selectStart() : s.selectEnd()),
|
|
3876
|
+
i !== null ? i.dirty || re(i.clone()) : s.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? s.selectStart() : s.selectEnd()), qo("focus"), Go(() => {
|
|
3871
3877
|
r.removeAttribute("autocapitalize"), e && e();
|
|
3872
3878
|
});
|
|
3873
3879
|
}), this._pendingEditorState === null && r.removeAttribute("autocapitalize"));
|
|
@@ -3888,56 +3894,56 @@ class ot {
|
|
|
3888
3894
|
return { editorState: this._editorState.toJSON() };
|
|
3889
3895
|
}
|
|
3890
3896
|
}
|
|
3891
|
-
ot.version = "0.
|
|
3892
|
-
let
|
|
3893
|
-
function
|
|
3894
|
-
|
|
3897
|
+
ot.version = "0.37.0+prod.esm";
|
|
3898
|
+
let er = null;
|
|
3899
|
+
function ur(n) {
|
|
3900
|
+
er = n;
|
|
3895
3901
|
}
|
|
3896
|
-
let
|
|
3897
|
-
function
|
|
3898
|
-
const t =
|
|
3902
|
+
let jo = 1;
|
|
3903
|
+
function hs(n, e) {
|
|
3904
|
+
const t = gs(n, e);
|
|
3899
3905
|
return t === void 0 && T(30, e), t;
|
|
3900
3906
|
}
|
|
3901
|
-
function
|
|
3907
|
+
function gs(n, e) {
|
|
3902
3908
|
return n._nodes.get(e);
|
|
3903
3909
|
}
|
|
3904
|
-
const
|
|
3910
|
+
const Uo = typeof queueMicrotask == "function" ? queueMicrotask : (n) => {
|
|
3905
3911
|
Promise.resolve().then(n);
|
|
3906
3912
|
};
|
|
3907
|
-
function
|
|
3908
|
-
return B(
|
|
3913
|
+
function ui(n) {
|
|
3914
|
+
return B(dr(n));
|
|
3909
3915
|
}
|
|
3910
|
-
function
|
|
3916
|
+
function _s(n) {
|
|
3911
3917
|
const e = document.activeElement;
|
|
3912
3918
|
if (!ee(e)) return !1;
|
|
3913
3919
|
const t = e.nodeName;
|
|
3914
|
-
return B(
|
|
3920
|
+
return B(dr(n)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" && xn(e) == null);
|
|
3915
3921
|
}
|
|
3916
|
-
function
|
|
3922
|
+
function mn(n, e, t) {
|
|
3917
3923
|
const r = n.getRootElement();
|
|
3918
3924
|
try {
|
|
3919
|
-
return r !== null && r.contains(e) && r.contains(t) && e !== null && !
|
|
3925
|
+
return r !== null && r.contains(e) && r.contains(t) && e !== null && !_s(e) && ps(e) === n;
|
|
3920
3926
|
} catch {
|
|
3921
3927
|
return !1;
|
|
3922
3928
|
}
|
|
3923
3929
|
}
|
|
3924
|
-
function
|
|
3930
|
+
function fr(n) {
|
|
3925
3931
|
return n instanceof ot;
|
|
3926
3932
|
}
|
|
3927
|
-
function
|
|
3933
|
+
function ps(n) {
|
|
3928
3934
|
let e = n;
|
|
3929
3935
|
for (; e != null; ) {
|
|
3930
|
-
const t =
|
|
3931
|
-
if (
|
|
3936
|
+
const t = xn(e);
|
|
3937
|
+
if (fr(t)) return t;
|
|
3932
3938
|
e = Lt(e);
|
|
3933
3939
|
}
|
|
3934
3940
|
return null;
|
|
3935
3941
|
}
|
|
3936
|
-
function
|
|
3942
|
+
function xn(n) {
|
|
3937
3943
|
return n ? n.__lexicalEditor : null;
|
|
3938
3944
|
}
|
|
3939
3945
|
function Ke(n) {
|
|
3940
|
-
return
|
|
3946
|
+
return es(n) || n.isToken();
|
|
3941
3947
|
}
|
|
3942
3948
|
function Te(n) {
|
|
3943
3949
|
return Ke(n) || n.isSegmented();
|
|
@@ -3945,7 +3951,7 @@ function Te(n) {
|
|
|
3945
3951
|
function ve(n) {
|
|
3946
3952
|
return It(n) && n.nodeType === 3;
|
|
3947
3953
|
}
|
|
3948
|
-
function
|
|
3954
|
+
function Vo(n) {
|
|
3949
3955
|
return It(n) && n.nodeType === 9;
|
|
3950
3956
|
}
|
|
3951
3957
|
function lt(n) {
|
|
@@ -3956,23 +3962,23 @@ function lt(n) {
|
|
|
3956
3962
|
}
|
|
3957
3963
|
return null;
|
|
3958
3964
|
}
|
|
3959
|
-
function
|
|
3965
|
+
function fn(n, e, t) {
|
|
3960
3966
|
const r = Re[e];
|
|
3961
3967
|
if (t !== null && (n & r) === (t & r)) return n;
|
|
3962
3968
|
let i = n ^ r;
|
|
3963
3969
|
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;
|
|
3964
3970
|
}
|
|
3965
|
-
function
|
|
3971
|
+
function Ul(n) {
|
|
3966
3972
|
return M(n) || rt(n) || B(n);
|
|
3967
3973
|
}
|
|
3968
|
-
function
|
|
3974
|
+
function ys(n, e) {
|
|
3969
3975
|
const t = (function() {
|
|
3970
|
-
const o =
|
|
3971
|
-
return
|
|
3976
|
+
const o = er;
|
|
3977
|
+
return er = null, o;
|
|
3972
3978
|
})();
|
|
3973
3979
|
if ((e = e || t && t.__key) != null) return void (n.__key = e);
|
|
3974
|
-
X(),
|
|
3975
|
-
const r = R(), i = Pe(), s = "" +
|
|
3980
|
+
X(), os();
|
|
3981
|
+
const r = R(), i = Pe(), s = "" + jo++;
|
|
3976
3982
|
i._nodeMap.set(s, n), v(n) ? r._dirtyElements.set(s, !0) : r._dirtyLeaves.add(s), r._cloneNotNeeded.add(s), r._dirtyType = 1, n.__key = s;
|
|
3977
3983
|
}
|
|
3978
3984
|
function ze(n) {
|
|
@@ -3982,8 +3988,8 @@ function ze(n) {
|
|
|
3982
3988
|
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--;
|
|
3983
3989
|
}
|
|
3984
3990
|
}
|
|
3985
|
-
function
|
|
3986
|
-
|
|
3991
|
+
function dn(n) {
|
|
3992
|
+
os(), an(n) && T(323, n.__key, n.__type);
|
|
3987
3993
|
const e = n.getLatest(), t = e.__parent, r = Pe(), i = R(), s = r._nodeMap, o = i._dirtyElements;
|
|
3988
3994
|
t !== null && (function(a, c, u) {
|
|
3989
3995
|
let d = a;
|
|
@@ -3997,7 +4003,7 @@ function fn(n) {
|
|
|
3997
4003
|
const l = e.__key;
|
|
3998
4004
|
i._dirtyType = 1, v(n) ? o.set(l, !0) : i._dirtyLeaves.add(l);
|
|
3999
4005
|
}
|
|
4000
|
-
function
|
|
4006
|
+
function Y(n) {
|
|
4001
4007
|
X();
|
|
4002
4008
|
const e = R(), t = e._compositionKey;
|
|
4003
4009
|
if (n !== t) {
|
|
@@ -4018,33 +4024,33 @@ function U(n, e) {
|
|
|
4018
4024
|
const t = (e || Pe())._nodeMap.get(n);
|
|
4019
4025
|
return t === void 0 ? null : t;
|
|
4020
4026
|
}
|
|
4021
|
-
function
|
|
4022
|
-
const t =
|
|
4027
|
+
function ms(n, e) {
|
|
4028
|
+
const t = Cn(n, R());
|
|
4023
4029
|
return t !== void 0 ? U(t, e) : null;
|
|
4024
4030
|
}
|
|
4025
|
-
function
|
|
4031
|
+
function Cn(n, e) {
|
|
4026
4032
|
return n[`__lexicalKey_${e._key}`];
|
|
4027
4033
|
}
|
|
4028
|
-
function
|
|
4034
|
+
function dr(n, e) {
|
|
4029
4035
|
let t = n;
|
|
4030
4036
|
for (; t != null; ) {
|
|
4031
|
-
const r =
|
|
4037
|
+
const r = ms(t, e);
|
|
4032
4038
|
if (r !== null) return r;
|
|
4033
4039
|
t = Lt(t);
|
|
4034
4040
|
}
|
|
4035
4041
|
return null;
|
|
4036
4042
|
}
|
|
4037
|
-
function
|
|
4043
|
+
function xs(n) {
|
|
4038
4044
|
const e = n._decorators, t = Object.assign({}, e);
|
|
4039
4045
|
return n._pendingDecorators = t, t;
|
|
4040
4046
|
}
|
|
4041
|
-
function
|
|
4047
|
+
function fi(n) {
|
|
4042
4048
|
return n.read(() => ie().getTextContent());
|
|
4043
4049
|
}
|
|
4044
4050
|
function ie() {
|
|
4045
|
-
return
|
|
4051
|
+
return Cs(Pe());
|
|
4046
4052
|
}
|
|
4047
|
-
function
|
|
4053
|
+
function Cs(n) {
|
|
4048
4054
|
return n._nodeMap.get("root");
|
|
4049
4055
|
}
|
|
4050
4056
|
function re(n) {
|
|
@@ -4056,7 +4062,7 @@ function tt(n) {
|
|
|
4056
4062
|
const e = R(), t = (function(r, i) {
|
|
4057
4063
|
let s = r;
|
|
4058
4064
|
for (; s != null; ) {
|
|
4059
|
-
const o =
|
|
4065
|
+
const o = Cn(s, i);
|
|
4060
4066
|
if (o !== void 0) return o;
|
|
4061
4067
|
s = Lt(s);
|
|
4062
4068
|
}
|
|
@@ -4064,48 +4070,48 @@ function tt(n) {
|
|
|
4064
4070
|
})(n, e);
|
|
4065
4071
|
return t === null ? n === e.getRootElement() ? U("root") : null : U(t);
|
|
4066
4072
|
}
|
|
4067
|
-
function
|
|
4073
|
+
function Ss(n) {
|
|
4068
4074
|
return /[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n);
|
|
4069
4075
|
}
|
|
4070
|
-
function
|
|
4076
|
+
function hr(n) {
|
|
4071
4077
|
const e = [];
|
|
4072
4078
|
let t = n;
|
|
4073
4079
|
for (; t !== null; ) e.push(t), t = t._parentEditor;
|
|
4074
4080
|
return e;
|
|
4075
4081
|
}
|
|
4076
|
-
function
|
|
4082
|
+
function vs() {
|
|
4077
4083
|
return Math.random().toString(36).replace(/[^a-z]+/g, "").substring(0, 5);
|
|
4078
4084
|
}
|
|
4079
|
-
function
|
|
4085
|
+
function ks(n) {
|
|
4080
4086
|
return ve(n) ? n.nodeValue : null;
|
|
4081
4087
|
}
|
|
4082
|
-
function
|
|
4088
|
+
function gr(n, e, t) {
|
|
4083
4089
|
const r = Se(se(e));
|
|
4084
4090
|
if (r === null) return;
|
|
4085
4091
|
const i = r.anchorNode;
|
|
4086
4092
|
let { anchorOffset: s, focusOffset: o } = r;
|
|
4087
4093
|
if (i !== null) {
|
|
4088
|
-
let l =
|
|
4089
|
-
const a =
|
|
4094
|
+
let l = ks(i);
|
|
4095
|
+
const a = dr(i);
|
|
4090
4096
|
if (l !== null && M(a)) {
|
|
4091
|
-
if (l ===
|
|
4097
|
+
if (l === hn && t) {
|
|
4092
4098
|
const c = t.length;
|
|
4093
4099
|
l = t, s = c, o = c;
|
|
4094
4100
|
}
|
|
4095
|
-
l !== null &&
|
|
4101
|
+
l !== null && _r(a, l, s, o, n);
|
|
4096
4102
|
}
|
|
4097
4103
|
}
|
|
4098
4104
|
}
|
|
4099
|
-
function
|
|
4105
|
+
function _r(n, e, t, r, i) {
|
|
4100
4106
|
let s = n;
|
|
4101
4107
|
if (s.isAttached() && (i || !s.isDirty())) {
|
|
4102
4108
|
const o = s.isComposing();
|
|
4103
4109
|
let l = e;
|
|
4104
|
-
(o || i) && e[e.length - 1] ===
|
|
4110
|
+
(o || i) && e[e.length - 1] === hn && (l = e.slice(0, -1));
|
|
4105
4111
|
const a = s.getTextContent();
|
|
4106
4112
|
if (i || l !== a) {
|
|
4107
4113
|
if (l === "") {
|
|
4108
|
-
if (
|
|
4114
|
+
if (Y(null), St || st || vt) s.remove();
|
|
4109
4115
|
else {
|
|
4110
4116
|
const _ = R();
|
|
4111
4117
|
setTimeout(() => {
|
|
@@ -4119,16 +4125,16 @@ function gr(n, e, t, r, i) {
|
|
|
4119
4125
|
const c = s.getParent(), u = ut(), d = s.getTextContentSize(), f = Ne(), g = s.getKey();
|
|
4120
4126
|
if (s.isToken() || f !== null && g === f && !o || A(u) && (c !== null && !c.canInsertTextBefore() && u.anchor.offset === 0 || u.anchor.key === n.__key && u.anchor.offset === 0 && !s.canInsertTextBefore() && !o || u.focus.key === n.__key && u.focus.offset === d && !s.canInsertTextAfter() && !o)) return void s.markDirty();
|
|
4121
4127
|
const h = L();
|
|
4122
|
-
if (!A(h) || t === null || r === null) return void
|
|
4128
|
+
if (!A(h) || t === null || r === null) return void di(s, l, h);
|
|
4123
4129
|
if (h.setTextNodeRange(s, t, s, r), s.isSegmented()) {
|
|
4124
4130
|
const _ = V(s.getTextContent());
|
|
4125
4131
|
s.replace(_), s = _;
|
|
4126
4132
|
}
|
|
4127
|
-
|
|
4133
|
+
di(s, l, h);
|
|
4128
4134
|
}
|
|
4129
4135
|
}
|
|
4130
4136
|
}
|
|
4131
|
-
function
|
|
4137
|
+
function di(n, e, t) {
|
|
4132
4138
|
if (n.setTextContent(e), A(t)) {
|
|
4133
4139
|
const r = n.getKey();
|
|
4134
4140
|
for (const i of ["anchor", "focus"]) {
|
|
@@ -4137,32 +4143,32 @@ function fi(n, e, t) {
|
|
|
4137
4143
|
}
|
|
4138
4144
|
}
|
|
4139
4145
|
}
|
|
4140
|
-
function
|
|
4146
|
+
function jt(n, e, t) {
|
|
4141
4147
|
const r = e[t] || !1;
|
|
4142
4148
|
return r === "any" || r === n[t];
|
|
4143
4149
|
}
|
|
4144
|
-
function
|
|
4145
|
-
return
|
|
4150
|
+
function Yo(n, e) {
|
|
4151
|
+
return jt(n, e, "altKey") && jt(n, e, "ctrlKey") && jt(n, e, "shiftKey") && jt(n, e, "metaKey");
|
|
4146
4152
|
}
|
|
4147
4153
|
function K(n, e, t) {
|
|
4148
|
-
return
|
|
4154
|
+
return Yo(n, t) && n.key.toLowerCase() === e.toLowerCase();
|
|
4149
4155
|
}
|
|
4150
|
-
const me = { ctrlKey: !oe, metaKey: oe },
|
|
4151
|
-
function
|
|
4156
|
+
const me = { ctrlKey: !oe, metaKey: oe }, hi = { altKey: oe, ctrlKey: !oe };
|
|
4157
|
+
function gi(n) {
|
|
4152
4158
|
return n.key === "Backspace";
|
|
4153
4159
|
}
|
|
4154
|
-
function
|
|
4160
|
+
function _i(n) {
|
|
4155
4161
|
return K(n, "a", me);
|
|
4156
4162
|
}
|
|
4157
|
-
function
|
|
4163
|
+
function Vl(n) {
|
|
4158
4164
|
const e = ie();
|
|
4159
4165
|
if (A(n)) {
|
|
4160
4166
|
const t = n.anchor, r = n.focus, i = t.getNode().getTopLevelElementOrThrow().getParentOrThrow();
|
|
4161
|
-
return t.set(i.getKey(), 0, "element"), r.set(i.getKey(), i.getChildrenSize(), "element"),
|
|
4167
|
+
return t.set(i.getKey(), 0, "element"), r.set(i.getKey(), i.getChildrenSize(), "element"), Rn(n), n;
|
|
4162
4168
|
}
|
|
4163
4169
|
{
|
|
4164
4170
|
const t = e.select(0, e.getChildrenSize());
|
|
4165
|
-
return re(
|
|
4171
|
+
return re(Rn(t)), t;
|
|
4166
4172
|
}
|
|
4167
4173
|
}
|
|
4168
4174
|
function it(n, e) {
|
|
@@ -4171,12 +4177,12 @@ function it(n, e) {
|
|
|
4171
4177
|
if (r !== void 0) return r;
|
|
4172
4178
|
const i = n[e];
|
|
4173
4179
|
if (typeof i == "string") {
|
|
4174
|
-
const s =
|
|
4180
|
+
const s = Ni(i);
|
|
4175
4181
|
return t[e] = s, s;
|
|
4176
4182
|
}
|
|
4177
4183
|
return i;
|
|
4178
4184
|
}
|
|
4179
|
-
function
|
|
4185
|
+
function pr(n, e, t, r, i) {
|
|
4180
4186
|
if (t.size === 0) return;
|
|
4181
4187
|
const s = r.__type, o = r.__key, l = e.get(s);
|
|
4182
4188
|
l === void 0 && T(33, s);
|
|
@@ -4186,31 +4192,31 @@ function _r(n, e, t, r, i) {
|
|
|
4186
4192
|
const u = c.get(o), d = u === "destroyed" && i === "created";
|
|
4187
4193
|
(u === void 0 || d) && c.set(o, d ? "updated" : i);
|
|
4188
4194
|
}
|
|
4189
|
-
function
|
|
4195
|
+
function pi(n, e, t) {
|
|
4190
4196
|
const r = n.getParent();
|
|
4191
4197
|
let i = t, s = n;
|
|
4192
4198
|
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);
|
|
4193
4199
|
}
|
|
4194
|
-
function
|
|
4200
|
+
function Ho(n, e) {
|
|
4195
4201
|
const t = n.offset;
|
|
4196
4202
|
if (n.type === "element")
|
|
4197
|
-
return
|
|
4203
|
+
return pi(n.getNode(), e, t);
|
|
4198
4204
|
{
|
|
4199
4205
|
const r = n.getNode();
|
|
4200
4206
|
if (e && t === 0 || !e && t === r.getTextContentSize()) {
|
|
4201
4207
|
const i = e ? r.getPreviousSibling() : r.getNextSibling();
|
|
4202
|
-
return i === null ?
|
|
4208
|
+
return i === null ? pi(r.getParentOrThrow(), e, r.getIndexWithinParent() + (e ? 0 : 1)) : i;
|
|
4203
4209
|
}
|
|
4204
4210
|
}
|
|
4205
4211
|
return null;
|
|
4206
4212
|
}
|
|
4207
|
-
function
|
|
4213
|
+
function Ts(n) {
|
|
4208
4214
|
const e = se(n).event, t = e && e.inputType;
|
|
4209
4215
|
return t === "insertFromPaste" || t === "insertFromPasteAsQuotation";
|
|
4210
4216
|
}
|
|
4211
4217
|
function E(n, e, t) {
|
|
4212
4218
|
return (function(r, i, s) {
|
|
4213
|
-
const o =
|
|
4219
|
+
const o = hr(r);
|
|
4214
4220
|
for (let l = 4; l >= 0; l--) for (let a = 0; a < o.length; a++) {
|
|
4215
4221
|
const c = o[a], u = c._commands.get(i);
|
|
4216
4222
|
if (u !== void 0) {
|
|
@@ -4227,27 +4233,27 @@ function E(n, e, t) {
|
|
|
4227
4233
|
return !1;
|
|
4228
4234
|
})(n, e, t);
|
|
4229
4235
|
}
|
|
4230
|
-
function
|
|
4231
|
-
return !
|
|
4236
|
+
function Sn(n) {
|
|
4237
|
+
return !H(n) && !n.isLastChild() && !n.isInline();
|
|
4232
4238
|
}
|
|
4233
|
-
function
|
|
4239
|
+
function $e(n, e) {
|
|
4234
4240
|
const t = n._keyToDOMMap.get(e);
|
|
4235
4241
|
return t === void 0 && T(75, e), t;
|
|
4236
4242
|
}
|
|
4237
4243
|
function Lt(n) {
|
|
4238
4244
|
const e = n.assignedSlot || n.parentElement;
|
|
4239
|
-
return
|
|
4245
|
+
return tl(e) ? e.host : e;
|
|
4240
4246
|
}
|
|
4241
|
-
function
|
|
4242
|
-
return
|
|
4247
|
+
function bs(n) {
|
|
4248
|
+
return Vo(n) ? n : ee(n) ? n.ownerDocument : null;
|
|
4243
4249
|
}
|
|
4244
|
-
function
|
|
4250
|
+
function qo(n) {
|
|
4245
4251
|
X(), R()._updateTags.add(n);
|
|
4246
4252
|
}
|
|
4247
|
-
function
|
|
4253
|
+
function Go(n) {
|
|
4248
4254
|
X(), R()._deferred.push(n);
|
|
4249
4255
|
}
|
|
4250
|
-
function
|
|
4256
|
+
function tr(n, e) {
|
|
4251
4257
|
let t = n.getParent();
|
|
4252
4258
|
for (; t !== null; ) {
|
|
4253
4259
|
if (t.is(e)) return !0;
|
|
@@ -4255,18 +4261,18 @@ function er(n, e) {
|
|
|
4255
4261
|
}
|
|
4256
4262
|
return !1;
|
|
4257
4263
|
}
|
|
4258
|
-
function
|
|
4259
|
-
const e =
|
|
4264
|
+
function yr(n) {
|
|
4265
|
+
const e = bs(n);
|
|
4260
4266
|
return e ? e.defaultView : null;
|
|
4261
4267
|
}
|
|
4262
4268
|
function se(n) {
|
|
4263
4269
|
const e = n._window;
|
|
4264
4270
|
return e === null && T(78), e;
|
|
4265
4271
|
}
|
|
4266
|
-
function
|
|
4272
|
+
function Yl(n) {
|
|
4267
4273
|
return v(n) && n.isInline() || B(n) && n.isInline();
|
|
4268
4274
|
}
|
|
4269
|
-
function
|
|
4275
|
+
function Xo(n) {
|
|
4270
4276
|
let e = n.getParentOrThrow();
|
|
4271
4277
|
for (; e !== null; ) {
|
|
4272
4278
|
if (De(e)) return e;
|
|
@@ -4275,14 +4281,14 @@ function Yo(n) {
|
|
|
4275
4281
|
return e;
|
|
4276
4282
|
}
|
|
4277
4283
|
function De(n) {
|
|
4278
|
-
return
|
|
4284
|
+
return H(n) || v(n) && n.isShadowRoot();
|
|
4279
4285
|
}
|
|
4280
|
-
function
|
|
4286
|
+
function Qo(n) {
|
|
4281
4287
|
const e = n.constructor.clone(n);
|
|
4282
|
-
return
|
|
4288
|
+
return ys(e, null), e.afterCloneFrom(n), e;
|
|
4283
4289
|
}
|
|
4284
|
-
function
|
|
4285
|
-
const e = R(), t = n.getType(), r =
|
|
4290
|
+
function vn(n) {
|
|
4291
|
+
const e = R(), t = n.getType(), r = gs(e, t);
|
|
4286
4292
|
r === void 0 && T(200, n.constructor.name, t);
|
|
4287
4293
|
const { replace: i, replaceWithKlass: s } = r;
|
|
4288
4294
|
if (i !== null) {
|
|
@@ -4291,17 +4297,17 @@ function Sn(n) {
|
|
|
4291
4297
|
}
|
|
4292
4298
|
return n;
|
|
4293
4299
|
}
|
|
4294
|
-
function
|
|
4295
|
-
!
|
|
4300
|
+
function In(n, e) {
|
|
4301
|
+
!H(n.getParent()) || v(e) || B(e) || T(99);
|
|
4296
4302
|
}
|
|
4297
|
-
function
|
|
4303
|
+
function Zo(n) {
|
|
4298
4304
|
const e = U(n);
|
|
4299
4305
|
return e === null && T(63, n), e;
|
|
4300
4306
|
}
|
|
4301
|
-
function
|
|
4307
|
+
function Kn(n) {
|
|
4302
4308
|
return (B(n) || v(n) && !n.canBeEmpty()) && !n.isInline();
|
|
4303
4309
|
}
|
|
4304
|
-
function
|
|
4310
|
+
function nr(n, e, t) {
|
|
4305
4311
|
t.style.removeProperty("caret-color"), e._blockCursorElement = null;
|
|
4306
4312
|
const r = n.parentElement;
|
|
4307
4313
|
r !== null && r.removeChild(n);
|
|
@@ -4309,11 +4315,11 @@ function tr(n, e, t) {
|
|
|
4309
4315
|
function Se(n) {
|
|
4310
4316
|
return ae ? (n || window).getSelection() : null;
|
|
4311
4317
|
}
|
|
4312
|
-
function
|
|
4313
|
-
const e =
|
|
4318
|
+
function el(n) {
|
|
4319
|
+
const e = yr(n);
|
|
4314
4320
|
return e ? e.getSelection() : null;
|
|
4315
4321
|
}
|
|
4316
|
-
function
|
|
4322
|
+
function Hl(n) {
|
|
4317
4323
|
return ee(n) && n.tagName === "A";
|
|
4318
4324
|
}
|
|
4319
4325
|
function ee(n) {
|
|
@@ -4322,14 +4328,14 @@ function ee(n) {
|
|
|
4322
4328
|
function It(n) {
|
|
4323
4329
|
return typeof n == "object" && n !== null && "nodeType" in n && typeof n.nodeType == "number";
|
|
4324
4330
|
}
|
|
4325
|
-
function
|
|
4331
|
+
function tl(n) {
|
|
4326
4332
|
return It(n) && n.nodeType === 11;
|
|
4327
4333
|
}
|
|
4328
|
-
function
|
|
4334
|
+
function nl(n) {
|
|
4329
4335
|
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");
|
|
4330
4336
|
return n.nodeName.match(e) !== null;
|
|
4331
4337
|
}
|
|
4332
|
-
function
|
|
4338
|
+
function yi(n) {
|
|
4333
4339
|
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");
|
|
4334
4340
|
return n.nodeName.match(e) !== null;
|
|
4335
4341
|
}
|
|
@@ -4339,14 +4345,14 @@ function be(n) {
|
|
|
4339
4345
|
const e = n.getFirstChild(), t = e === null || rt(e) || M(e) || e.isInline();
|
|
4340
4346
|
return !n.isInline() && n.canBeEmpty() !== !1 && t;
|
|
4341
4347
|
}
|
|
4342
|
-
function
|
|
4348
|
+
function rl() {
|
|
4343
4349
|
return R();
|
|
4344
4350
|
}
|
|
4345
|
-
const
|
|
4346
|
-
function
|
|
4347
|
-
if (!n._readOnly && n.isEmpty()) return
|
|
4351
|
+
const mi = /* @__PURE__ */ new WeakMap(), il = /* @__PURE__ */ new Map();
|
|
4352
|
+
function xi(n) {
|
|
4353
|
+
if (!n._readOnly && n.isEmpty()) return il;
|
|
4348
4354
|
n._readOnly || T(192);
|
|
4349
|
-
let e =
|
|
4355
|
+
let e = mi.get(n);
|
|
4350
4356
|
return e || (e = (function(t) {
|
|
4351
4357
|
const r = /* @__PURE__ */ new Map();
|
|
4352
4358
|
for (const [i, s] of t._nodeMap) {
|
|
@@ -4355,20 +4361,24 @@ function mi(n) {
|
|
|
4355
4361
|
l || (l = /* @__PURE__ */ new Map(), r.set(o, l)), l.set(i, s);
|
|
4356
4362
|
}
|
|
4357
4363
|
return r;
|
|
4358
|
-
})(n),
|
|
4364
|
+
})(n), mi.set(n, e)), e;
|
|
4359
4365
|
}
|
|
4360
|
-
function
|
|
4366
|
+
function Ns(n) {
|
|
4361
4367
|
const e = n.constructor.clone(n);
|
|
4362
4368
|
return e.afterCloneFrom(n), e;
|
|
4363
4369
|
}
|
|
4364
|
-
function
|
|
4370
|
+
function ql(n) {
|
|
4371
|
+
return (e = Ns(n))[Xi] = !0, e;
|
|
4372
|
+
var e;
|
|
4373
|
+
}
|
|
4374
|
+
function sl(n, e) {
|
|
4365
4375
|
const t = parseInt(n.style.paddingInlineStart, 10) || 0, r = Math.round(t / 40);
|
|
4366
4376
|
e.setIndent(r);
|
|
4367
4377
|
}
|
|
4368
|
-
function
|
|
4378
|
+
function Gl(n) {
|
|
4369
4379
|
n.__lexicalUnmanaged = !0;
|
|
4370
4380
|
}
|
|
4371
|
-
function
|
|
4381
|
+
function ol(n) {
|
|
4372
4382
|
return n.__lexicalUnmanaged === !0;
|
|
4373
4383
|
}
|
|
4374
4384
|
function gt(n, e) {
|
|
@@ -4376,8 +4386,8 @@ function gt(n, e) {
|
|
|
4376
4386
|
return Object.prototype.hasOwnProperty.call(t, r);
|
|
4377
4387
|
})(n, e) && n[e] !== we[e];
|
|
4378
4388
|
}
|
|
4379
|
-
function
|
|
4380
|
-
const e =
|
|
4389
|
+
function mr(n) {
|
|
4390
|
+
const e = wr in n.prototype ? n.prototype[wr]() : void 0, t = (function(o) {
|
|
4381
4391
|
if (!(o === we || o.prototype instanceof we)) {
|
|
4382
4392
|
let l = "<unknown>", a = "<unknown>";
|
|
4383
4393
|
try {
|
|
@@ -4390,12 +4400,12 @@ function yr(n) {
|
|
|
4390
4400
|
}
|
|
4391
4401
|
T(290, o.name, l, a);
|
|
4392
4402
|
}
|
|
4393
|
-
return o ===
|
|
4403
|
+
return o === cs || o === At || o === we;
|
|
4394
4404
|
})(n), r = !t && gt(n, "getType") ? n.getType() : void 0;
|
|
4395
4405
|
let i, s = r;
|
|
4396
4406
|
if (e) if (r) i = e[r];
|
|
4397
4407
|
else for (const [o, l] of Object.entries(e)) s = o, i = l;
|
|
4398
|
-
if (!t && s && (gt(n, "getType") || (n.getType = () => s), gt(n, "clone") || (n.clone = (o) => (
|
|
4408
|
+
if (!t && s && (gt(n, "getType") || (n.getType = () => s), gt(n, "clone") || (n.clone = (o) => (ur(o), new n())), gt(n, "importJSON") || (n.importJSON = i && i.$importJSON || ((o) => new n().updateFromJSON(o))), !gt(n, "importDOM") && i)) {
|
|
4399
4409
|
const { importDOM: o } = i;
|
|
4400
4410
|
o && (n.importDOM = () => o);
|
|
4401
4411
|
}
|
|
@@ -4403,19 +4413,19 @@ function yr(n) {
|
|
|
4403
4413
|
}
|
|
4404
4414
|
const qt = (n, e) => {
|
|
4405
4415
|
let t = n;
|
|
4406
|
-
for (; t != null && !
|
|
4416
|
+
for (; t != null && !H(t); ) {
|
|
4407
4417
|
if (e(t)) return t;
|
|
4408
4418
|
t = t.getParent();
|
|
4409
4419
|
}
|
|
4410
4420
|
return null;
|
|
4411
|
-
},
|
|
4412
|
-
class
|
|
4421
|
+
}, ll = { next: "previous", previous: "next" };
|
|
4422
|
+
class xr {
|
|
4413
4423
|
origin;
|
|
4414
4424
|
constructor(e) {
|
|
4415
4425
|
this.origin = e;
|
|
4416
4426
|
}
|
|
4417
4427
|
[Symbol.iterator]() {
|
|
4418
|
-
return
|
|
4428
|
+
return Es({ hasNext: at, initial: this.getAdjacentCaret(), map: (e) => e, step: (e) => e.getAdjacentCaret() });
|
|
4419
4429
|
}
|
|
4420
4430
|
getAdjacentCaret() {
|
|
4421
4431
|
return q(this.getNodeAtCaret(), this.direction);
|
|
@@ -4455,14 +4465,14 @@ class mr {
|
|
|
4455
4465
|
return this;
|
|
4456
4466
|
}
|
|
4457
4467
|
}
|
|
4458
|
-
class Nt extends
|
|
4468
|
+
class Nt extends xr {
|
|
4459
4469
|
type = "child";
|
|
4460
4470
|
getLatest() {
|
|
4461
4471
|
const e = this.origin.getLatest();
|
|
4462
4472
|
return e === this.origin ? this : Ae(e, this.direction);
|
|
4463
4473
|
}
|
|
4464
4474
|
getParentCaret(e = "root") {
|
|
4465
|
-
return q(
|
|
4475
|
+
return q(Cr(this.getParentAtCaret(), e), this.direction);
|
|
4466
4476
|
}
|
|
4467
4477
|
getFlipped() {
|
|
4468
4478
|
const e = Xe(this.direction);
|
|
@@ -4481,14 +4491,14 @@ class Nt extends mr {
|
|
|
4481
4491
|
return this.isSameNodeCaret(e);
|
|
4482
4492
|
}
|
|
4483
4493
|
}
|
|
4484
|
-
const
|
|
4494
|
+
const al = { root: H, shadowRoot: De };
|
|
4485
4495
|
function Xe(n) {
|
|
4486
|
-
return
|
|
4496
|
+
return ll[n];
|
|
4487
4497
|
}
|
|
4488
|
-
function
|
|
4489
|
-
return
|
|
4498
|
+
function Cr(n, e = "root") {
|
|
4499
|
+
return al[e](n) ? null : n;
|
|
4490
4500
|
}
|
|
4491
|
-
class
|
|
4501
|
+
class je extends xr {
|
|
4492
4502
|
type = "sibling";
|
|
4493
4503
|
getLatest() {
|
|
4494
4504
|
const e = this.origin.getLatest();
|
|
@@ -4504,20 +4514,20 @@ class $e extends mr {
|
|
|
4504
4514
|
return v(this.origin) ? Ae(this.origin, this.direction) : null;
|
|
4505
4515
|
}
|
|
4506
4516
|
getParentCaret(e = "root") {
|
|
4507
|
-
return q(
|
|
4517
|
+
return q(Cr(this.getParentAtCaret(), e), this.direction);
|
|
4508
4518
|
}
|
|
4509
4519
|
getFlipped() {
|
|
4510
4520
|
const e = Xe(this.direction);
|
|
4511
4521
|
return q(this.getNodeAtCaret(), e) || Ae(this.origin.getParentOrThrow(), e);
|
|
4512
4522
|
}
|
|
4513
4523
|
isSamePointCaret(e) {
|
|
4514
|
-
return e instanceof
|
|
4524
|
+
return e instanceof je && this.direction === e.direction && this.origin.is(e.origin);
|
|
4515
4525
|
}
|
|
4516
4526
|
isSameNodeCaret(e) {
|
|
4517
|
-
return (e instanceof
|
|
4527
|
+
return (e instanceof je || e instanceof Ue) && this.direction === e.direction && this.origin.is(e.origin);
|
|
4518
4528
|
}
|
|
4519
4529
|
}
|
|
4520
|
-
class Ue extends
|
|
4530
|
+
class Ue extends xr {
|
|
4521
4531
|
type = "text";
|
|
4522
4532
|
offset;
|
|
4523
4533
|
constructor(e, t) {
|
|
@@ -4534,7 +4544,7 @@ class Ue extends mr {
|
|
|
4534
4544
|
return null;
|
|
4535
4545
|
}
|
|
4536
4546
|
getParentCaret(e = "root") {
|
|
4537
|
-
return q(
|
|
4547
|
+
return q(Cr(this.getParentAtCaret(), e), this.direction);
|
|
4538
4548
|
}
|
|
4539
4549
|
getFlipped() {
|
|
4540
4550
|
return Ve(this.origin, Xe(this.direction), this.offset);
|
|
@@ -4543,7 +4553,7 @@ class Ue extends mr {
|
|
|
4543
4553
|
return e instanceof Ue && this.direction === e.direction && this.origin.is(e.origin) && this.offset === e.offset;
|
|
4544
4554
|
}
|
|
4545
4555
|
isSameNodeCaret(e) {
|
|
4546
|
-
return (e instanceof
|
|
4556
|
+
return (e instanceof je || e instanceof Ue) && this.direction === e.direction && this.origin.is(e.origin);
|
|
4547
4557
|
}
|
|
4548
4558
|
getSiblingCaret() {
|
|
4549
4559
|
return q(this.origin, this.direction);
|
|
@@ -4553,12 +4563,12 @@ function Me(n) {
|
|
|
4553
4563
|
return n instanceof Ue;
|
|
4554
4564
|
}
|
|
4555
4565
|
function at(n) {
|
|
4556
|
-
return n instanceof
|
|
4566
|
+
return n instanceof je;
|
|
4557
4567
|
}
|
|
4558
4568
|
function de(n) {
|
|
4559
4569
|
return n instanceof Nt;
|
|
4560
4570
|
}
|
|
4561
|
-
const
|
|
4571
|
+
const cl = { next: class extends Ue {
|
|
4562
4572
|
direction = "next";
|
|
4563
4573
|
getNodeAtCaret() {
|
|
4564
4574
|
return this.origin.getNextSibling();
|
|
@@ -4574,7 +4584,7 @@ const ll = { next: class extends Ue {
|
|
|
4574
4584
|
insert(n) {
|
|
4575
4585
|
return this.origin.insertBefore(n), this;
|
|
4576
4586
|
}
|
|
4577
|
-
} },
|
|
4587
|
+
} }, ul = { next: class extends je {
|
|
4578
4588
|
direction = "next";
|
|
4579
4589
|
getNodeAtCaret() {
|
|
4580
4590
|
return this.origin.getNextSibling();
|
|
@@ -4582,7 +4592,7 @@ const ll = { next: class extends Ue {
|
|
|
4582
4592
|
insert(n) {
|
|
4583
4593
|
return this.origin.insertAfter(n), this;
|
|
4584
4594
|
}
|
|
4585
|
-
}, previous: class extends
|
|
4595
|
+
}, previous: class extends je {
|
|
4586
4596
|
direction = "previous";
|
|
4587
4597
|
getNodeAtCaret() {
|
|
4588
4598
|
return this.origin.getPreviousSibling();
|
|
@@ -4590,7 +4600,7 @@ const ll = { next: class extends Ue {
|
|
|
4590
4600
|
insert(n) {
|
|
4591
4601
|
return this.origin.insertBefore(n), this;
|
|
4592
4602
|
}
|
|
4593
|
-
} },
|
|
4603
|
+
} }, fl = { next: class extends Nt {
|
|
4594
4604
|
direction = "next";
|
|
4595
4605
|
getNodeAtCaret() {
|
|
4596
4606
|
return this.origin.getFirstChild();
|
|
@@ -4608,29 +4618,29 @@ const ll = { next: class extends Ue {
|
|
|
4608
4618
|
}
|
|
4609
4619
|
} };
|
|
4610
4620
|
function q(n, e) {
|
|
4611
|
-
return n ? new
|
|
4621
|
+
return n ? new ul[e](n) : null;
|
|
4612
4622
|
}
|
|
4613
4623
|
function Ve(n, e, t) {
|
|
4614
|
-
return n ? new
|
|
4624
|
+
return n ? new cl[e](n, he(n, t)) : null;
|
|
4615
4625
|
}
|
|
4616
4626
|
function he(n, e, t = "error") {
|
|
4617
4627
|
const r = n.getTextContentSize();
|
|
4618
4628
|
let i = e === "next" ? r : e === "previous" ? 0 : e;
|
|
4619
|
-
return (i < 0 || i > r) && (t !== "clamp" &&
|
|
4629
|
+
return (i < 0 || i > r) && (t !== "clamp" && Ti(284, String(e), String(r), n.getKey()), i = i < 0 ? 0 : r), i;
|
|
4620
4630
|
}
|
|
4621
|
-
function
|
|
4622
|
-
return new
|
|
4631
|
+
function Ci(n, e) {
|
|
4632
|
+
return new hl(n, e);
|
|
4623
4633
|
}
|
|
4624
4634
|
function Ae(n, e) {
|
|
4625
|
-
return v(n) ? new
|
|
4635
|
+
return v(n) ? new fl[e](n) : null;
|
|
4626
4636
|
}
|
|
4627
|
-
function
|
|
4637
|
+
function dl(n) {
|
|
4628
4638
|
return n && n.getChildCaret() || n;
|
|
4629
4639
|
}
|
|
4630
|
-
function
|
|
4631
|
-
return n &&
|
|
4640
|
+
function Sr(n) {
|
|
4641
|
+
return n && dl(n.getAdjacentCaret());
|
|
4632
4642
|
}
|
|
4633
|
-
class
|
|
4643
|
+
class vr {
|
|
4634
4644
|
type = "node-caret-range";
|
|
4635
4645
|
direction;
|
|
4636
4646
|
anchor;
|
|
@@ -4640,7 +4650,7 @@ class Sr {
|
|
|
4640
4650
|
}
|
|
4641
4651
|
getLatest() {
|
|
4642
4652
|
const e = this.anchor.getLatest(), t = this.focus.getLatest();
|
|
4643
|
-
return e === this.anchor && t === this.focus ? this : new
|
|
4653
|
+
return e === this.anchor && t === this.focus ? this : new vr(e, t, this.direction);
|
|
4644
4654
|
}
|
|
4645
4655
|
isCollapsed() {
|
|
4646
4656
|
return this.anchor.isSamePointCaret(this.focus);
|
|
@@ -4650,24 +4660,24 @@ class Sr {
|
|
|
4650
4660
|
const s = this[i].getLatest();
|
|
4651
4661
|
return Me(s) ? (function(o, l) {
|
|
4652
4662
|
const { direction: a, origin: c } = o, u = he(c, l === "focus" ? Xe(a) : a);
|
|
4653
|
-
return
|
|
4663
|
+
return Ci(o, u - o.offset);
|
|
4654
4664
|
})(s, i) : null;
|
|
4655
4665
|
}, t = e("anchor"), r = e("focus");
|
|
4656
4666
|
if (t && r) {
|
|
4657
4667
|
const { caret: i } = t, { caret: s } = r;
|
|
4658
|
-
if (i.isSameNodeCaret(s)) return [
|
|
4668
|
+
if (i.isSameNodeCaret(s)) return [Ci(i, s.offset - i.offset), null];
|
|
4659
4669
|
}
|
|
4660
4670
|
return [t, r];
|
|
4661
4671
|
}
|
|
4662
4672
|
iterNodeCarets(e = "root") {
|
|
4663
|
-
const t = Me(this.anchor) ? this.anchor.getSiblingCaret() : this.anchor.getLatest(), r = this.focus.getLatest(), i = Me(r), s = (o) => o.isSameNodeCaret(r) ? null :
|
|
4664
|
-
return
|
|
4673
|
+
const t = Me(this.anchor) ? this.anchor.getSiblingCaret() : this.anchor.getLatest(), r = this.focus.getLatest(), i = Me(r), s = (o) => o.isSameNodeCaret(r) ? null : Sr(o) || o.getParentCaret(e);
|
|
4674
|
+
return Es({ hasNext: (o) => o !== null && !(i && r.isSameNodeCaret(o)), initial: t.isSameNodeCaret(r) ? null : s(t), map: (o) => o, step: s });
|
|
4665
4675
|
}
|
|
4666
4676
|
[Symbol.iterator]() {
|
|
4667
4677
|
return this.iterNodeCarets("root");
|
|
4668
4678
|
}
|
|
4669
4679
|
}
|
|
4670
|
-
class
|
|
4680
|
+
class hl {
|
|
4671
4681
|
type = "slice";
|
|
4672
4682
|
caret;
|
|
4673
4683
|
distance;
|
|
@@ -4690,16 +4700,16 @@ class fl {
|
|
|
4690
4700
|
return Ve(e.setTextContent(s.slice(0, r) + s.slice(i)), t, r);
|
|
4691
4701
|
}
|
|
4692
4702
|
}
|
|
4693
|
-
function
|
|
4694
|
-
return
|
|
4703
|
+
function ws(n) {
|
|
4704
|
+
return Ye(n, q(ie(), n.direction));
|
|
4695
4705
|
}
|
|
4696
|
-
function
|
|
4697
|
-
return
|
|
4706
|
+
function gl(n) {
|
|
4707
|
+
return Ye(n, n);
|
|
4698
4708
|
}
|
|
4699
|
-
function
|
|
4700
|
-
return n.direction !== e.direction && T(265), new
|
|
4709
|
+
function Ye(n, e) {
|
|
4710
|
+
return n.direction !== e.direction && T(265), new vr(n, e, n.direction);
|
|
4701
4711
|
}
|
|
4702
|
-
function
|
|
4712
|
+
function Es(n) {
|
|
4703
4713
|
const { initial: e, hasNext: t, step: r, map: i } = n;
|
|
4704
4714
|
let s = e;
|
|
4705
4715
|
return { [Symbol.iterator]() {
|
|
@@ -4710,7 +4720,7 @@ function bs(n) {
|
|
|
4710
4720
|
return s = r(s), o;
|
|
4711
4721
|
} };
|
|
4712
4722
|
}
|
|
4713
|
-
function
|
|
4723
|
+
function Ms(n, e) {
|
|
4714
4724
|
const t = Gt(n.origin, e.origin);
|
|
4715
4725
|
switch (t === null && T(275, n.origin.getKey(), e.origin.getKey()), t.type) {
|
|
4716
4726
|
case "same": {
|
|
@@ -4724,10 +4734,10 @@ function Ns(n, e) {
|
|
|
4724
4734
|
case "descendant":
|
|
4725
4735
|
return e.type === "child" ? 1 : -1;
|
|
4726
4736
|
case "branch":
|
|
4727
|
-
return
|
|
4737
|
+
return Os(t);
|
|
4728
4738
|
}
|
|
4729
4739
|
}
|
|
4730
|
-
function
|
|
4740
|
+
function Os(n) {
|
|
4731
4741
|
const { a: e, b: t } = n, r = e.__key, i = t.__key;
|
|
4732
4742
|
let s = e, o = t;
|
|
4733
4743
|
for (; s && o; s = s.getNextSibling(), o = o.getNextSibling()) {
|
|
@@ -4739,55 +4749,55 @@ function ws(n) {
|
|
|
4739
4749
|
function Ut(n, e) {
|
|
4740
4750
|
return e.is(n);
|
|
4741
4751
|
}
|
|
4742
|
-
function
|
|
4752
|
+
function Si(n) {
|
|
4743
4753
|
return v(n) ? [n.getLatest(), null] : [n.getParent(), n.getLatest()];
|
|
4744
4754
|
}
|
|
4745
4755
|
function Gt(n, e) {
|
|
4746
4756
|
if (n.is(e)) return { commonAncestor: n, type: "same" };
|
|
4747
4757
|
const t = /* @__PURE__ */ new Map();
|
|
4748
|
-
for (let [r, i] =
|
|
4749
|
-
for (let [r, i] =
|
|
4758
|
+
for (let [r, i] = Si(n); r; i = r, r = r.getParent()) t.set(r, i);
|
|
4759
|
+
for (let [r, i] = Si(e); r; i = r, r = r.getParent()) {
|
|
4750
4760
|
const s = t.get(r);
|
|
4751
4761
|
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" });
|
|
4752
4762
|
}
|
|
4753
4763
|
return null;
|
|
4754
4764
|
}
|
|
4755
|
-
function
|
|
4756
|
-
const { type: t, key: r, offset: i } = n, s =
|
|
4757
|
-
return t === "text" ? (M(s) || T(266, s.getType(), r), Ve(s, e, i)) : (v(s) || T(267, s.getType(), r),
|
|
4765
|
+
function He(n, e) {
|
|
4766
|
+
const { type: t, key: r, offset: i } = n, s = Zo(n.key);
|
|
4767
|
+
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));
|
|
4758
4768
|
}
|
|
4759
4769
|
function wt(n, e) {
|
|
4760
4770
|
const { origin: t, direction: r } = e, i = r === "next";
|
|
4761
4771
|
Me(e) ? n.set(t.getKey(), e.offset, "text") : at(e) ? M(t) ? n.set(t.getKey(), he(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"));
|
|
4762
4772
|
}
|
|
4763
|
-
function
|
|
4764
|
-
const e = L(), t = A(e) ? e :
|
|
4773
|
+
function _l(n) {
|
|
4774
|
+
const e = L(), t = A(e) ? e : Ko();
|
|
4765
4775
|
return Xt(t, n), re(t), t;
|
|
4766
4776
|
}
|
|
4767
4777
|
function Xt(n, e) {
|
|
4768
4778
|
wt(n.anchor, e.anchor), wt(n.focus, e.focus);
|
|
4769
4779
|
}
|
|
4770
|
-
function
|
|
4771
|
-
const { anchor: e, focus: t } = n, r =
|
|
4772
|
-
return
|
|
4780
|
+
function vi(n) {
|
|
4781
|
+
const { anchor: e, focus: t } = n, r = He(e, "next"), i = He(t, "next"), s = Ms(r, i) <= 0 ? "next" : "previous";
|
|
4782
|
+
return Ye(qe(r, s), qe(i, s));
|
|
4773
4783
|
}
|
|
4774
4784
|
function Kt(n) {
|
|
4775
4785
|
const { direction: e, origin: t } = n, r = q(t, Xe(e)).getNodeAtCaret();
|
|
4776
4786
|
return r ? q(r, e) : Ae(t.getParentOrThrow(), e);
|
|
4777
4787
|
}
|
|
4778
|
-
function
|
|
4788
|
+
function ki(n, e = "root") {
|
|
4779
4789
|
const t = [n];
|
|
4780
4790
|
for (let r = de(n) ? n.getParentCaret(e) : n.getSiblingCaret(); r !== null; r = r.getParentCaret(e)) t.push(Kt(r));
|
|
4781
4791
|
return t;
|
|
4782
4792
|
}
|
|
4783
|
-
function
|
|
4793
|
+
function zn(n) {
|
|
4784
4794
|
return !!n && n.origin.isAttached();
|
|
4785
4795
|
}
|
|
4786
|
-
function
|
|
4796
|
+
function pl(n, e = "removeEmptySlices") {
|
|
4787
4797
|
if (n.isCollapsed()) return n;
|
|
4788
4798
|
const t = "root", r = "next";
|
|
4789
4799
|
let i = e;
|
|
4790
|
-
const s =
|
|
4800
|
+
const s = As(n, r), o = ki(s.anchor, t), l = ki(s.focus.getFlipped(), t), a = /* @__PURE__ */ new Set(), c = [];
|
|
4791
4801
|
for (const h of s.iterNodeCarets(t)) if (de(h)) a.add(h.origin.getKey());
|
|
4792
4802
|
else if (at(h)) {
|
|
4793
4803
|
const { origin: _ } = h;
|
|
@@ -4810,11 +4820,11 @@ function gl(n, e = "removeEmptySlices") {
|
|
|
4810
4820
|
}
|
|
4811
4821
|
}
|
|
4812
4822
|
let u, d;
|
|
4813
|
-
for (const h of o) if (
|
|
4823
|
+
for (const h of o) if (zn(h)) {
|
|
4814
4824
|
u = fe(h);
|
|
4815
4825
|
break;
|
|
4816
4826
|
}
|
|
4817
|
-
for (const h of l) if (
|
|
4827
|
+
for (const h of l) if (zn(h)) {
|
|
4818
4828
|
d = fe(h);
|
|
4819
4829
|
break;
|
|
4820
4830
|
}
|
|
@@ -4844,16 +4854,16 @@ function gl(n, e = "removeEmptySlices") {
|
|
|
4844
4854
|
const [h, _] = f;
|
|
4845
4855
|
Ae(h, "previous").splice(0, _.getChildren()), _.remove();
|
|
4846
4856
|
}
|
|
4847
|
-
const g = [u, d, ...o, ...l].find(
|
|
4857
|
+
const g = [u, d, ...o, ...l].find(zn);
|
|
4848
4858
|
if (g)
|
|
4849
|
-
return
|
|
4859
|
+
return gl(qe(fe(g), n.direction));
|
|
4850
4860
|
T(269, JSON.stringify(o.map((h) => h.origin.__key)));
|
|
4851
4861
|
}
|
|
4852
4862
|
function fe(n) {
|
|
4853
4863
|
const e = (function(i) {
|
|
4854
4864
|
let s = i;
|
|
4855
4865
|
for (; de(s); ) {
|
|
4856
|
-
const o =
|
|
4866
|
+
const o = Sr(s);
|
|
4857
4867
|
if (!de(o)) break;
|
|
4858
4868
|
s = o;
|
|
4859
4869
|
}
|
|
@@ -4863,16 +4873,16 @@ function fe(n) {
|
|
|
4863
4873
|
const r = e.getAdjacentCaret();
|
|
4864
4874
|
return at(r) && M(r.origin) ? Ve(r.origin, t, Xe(t)) : e;
|
|
4865
4875
|
}
|
|
4866
|
-
function
|
|
4876
|
+
function yl(n) {
|
|
4867
4877
|
return Me(n) && n.offset !== he(n.origin, n.direction);
|
|
4868
4878
|
}
|
|
4869
4879
|
function qe(n, e) {
|
|
4870
4880
|
return n.direction === e ? n : n.getFlipped();
|
|
4871
4881
|
}
|
|
4872
|
-
function
|
|
4873
|
-
return n.direction === e ? n :
|
|
4882
|
+
function As(n, e) {
|
|
4883
|
+
return n.direction === e ? n : Ye(qe(n.focus, e), qe(n.anchor, e));
|
|
4874
4884
|
}
|
|
4875
|
-
function
|
|
4885
|
+
function ml(n, e, t) {
|
|
4876
4886
|
let r = Ae(n, "next");
|
|
4877
4887
|
for (let i = 0; i < e; i++) {
|
|
4878
4888
|
const s = r.getAdjacentCaret();
|
|
@@ -4881,17 +4891,17 @@ function pl(n, e, t) {
|
|
|
4881
4891
|
}
|
|
4882
4892
|
return qe(r, t);
|
|
4883
4893
|
}
|
|
4884
|
-
function
|
|
4894
|
+
function xl(n) {
|
|
4885
4895
|
const { origin: e, offset: t, direction: r } = n;
|
|
4886
4896
|
if (t === he(e, r)) return n.getSiblingCaret();
|
|
4887
4897
|
if (t === he(e, Xe(r))) return Kt(n.getSiblingCaret());
|
|
4888
4898
|
const [i] = e.splitText(t);
|
|
4889
4899
|
return M(i) || T(281), qe(q(i, "next"), r);
|
|
4890
4900
|
}
|
|
4891
|
-
function
|
|
4901
|
+
function Cl(n, e) {
|
|
4892
4902
|
return !0;
|
|
4893
4903
|
}
|
|
4894
|
-
function
|
|
4904
|
+
function Xl(n, { $copyElementNode: e = Qo, $splitTextPointCaretNext: t = xl, rootMode: r = "shadowRoot", $shouldSplit: i = Cl } = {}) {
|
|
4895
4905
|
if (Me(n)) return t(n);
|
|
4896
4906
|
const s = n.getParentCaret(r);
|
|
4897
4907
|
if (s) {
|
|
@@ -4906,153 +4916,153 @@ function Yl(n, { $copyElementNode: e = qo, $splitTextPointCaretNext: t = yl, roo
|
|
|
4906
4916
|
}
|
|
4907
4917
|
return s;
|
|
4908
4918
|
}
|
|
4909
|
-
function
|
|
4919
|
+
function Ql(n) {
|
|
4910
4920
|
return n;
|
|
4911
4921
|
}
|
|
4912
|
-
function
|
|
4922
|
+
function Zl(...n) {
|
|
4913
4923
|
return n;
|
|
4914
4924
|
}
|
|
4915
|
-
function
|
|
4925
|
+
function ea(n) {
|
|
4916
4926
|
return n;
|
|
4917
4927
|
}
|
|
4918
|
-
function
|
|
4928
|
+
function ta(n, e) {
|
|
4919
4929
|
if (!e || n === e) return n;
|
|
4920
4930
|
for (const t in e) if (n[t] !== e[t]) return { ...n, ...e };
|
|
4921
4931
|
return n;
|
|
4922
4932
|
}
|
|
4923
4933
|
export {
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4934
|
+
So as $,
|
|
4935
|
+
Ee as A,
|
|
4936
|
+
rt as B,
|
|
4937
|
+
rl as C,
|
|
4938
|
+
Bl as D,
|
|
4939
|
+
lo as E,
|
|
4930
4940
|
Rl as F,
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4941
|
+
Ot as G,
|
|
4942
|
+
so as H,
|
|
4943
|
+
Jl as I,
|
|
4944
|
+
sn as J,
|
|
4945
|
+
on as K,
|
|
4936
4946
|
Re as L,
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4947
|
+
rn as M,
|
|
4948
|
+
$l as N,
|
|
4949
|
+
ho as O,
|
|
4950
|
+
$o as P,
|
|
4951
|
+
Ae as Q,
|
|
4952
|
+
_o as R,
|
|
4953
|
+
Ji as S,
|
|
4954
|
+
go as T,
|
|
4955
|
+
Ie as U,
|
|
4956
|
+
bl as V,
|
|
4957
|
+
pt as W,
|
|
4958
|
+
po as X,
|
|
4959
|
+
ct as Y,
|
|
4950
4960
|
P as Z,
|
|
4951
|
-
|
|
4961
|
+
It as _,
|
|
4952
4962
|
L as a,
|
|
4953
|
-
|
|
4954
|
-
|
|
4963
|
+
xo as a$,
|
|
4964
|
+
Ki as a0,
|
|
4955
4965
|
re as a1,
|
|
4956
4966
|
Se as a2,
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4967
|
+
Ll as a3,
|
|
4968
|
+
Ko as a4,
|
|
4969
|
+
H as a5,
|
|
4970
|
+
He as a6,
|
|
4971
|
+
yl as a7,
|
|
4972
|
+
ws as a8,
|
|
4963
4973
|
at as a9,
|
|
4964
|
-
|
|
4965
|
-
|
|
4974
|
+
Fl as aA,
|
|
4975
|
+
yi as aB,
|
|
4966
4976
|
nl as aC,
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
+
gs as aD,
|
|
4978
|
+
tl as aE,
|
|
4979
|
+
or as aF,
|
|
4980
|
+
Wi as aG,
|
|
4981
|
+
Ye as aH,
|
|
4982
|
+
Kl as aI,
|
|
4983
|
+
mn as aJ,
|
|
4984
|
+
jl as aK,
|
|
4985
|
+
ta as aL,
|
|
4986
|
+
Ql as aM,
|
|
4977
4987
|
Pt as aN,
|
|
4978
4988
|
Et as aO,
|
|
4979
4989
|
Mt as aP,
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4990
|
+
ea as aQ,
|
|
4991
|
+
zl as aR,
|
|
4992
|
+
On as aS,
|
|
4993
|
+
Hl as aT,
|
|
4994
|
+
ps as aU,
|
|
4995
|
+
lr as aV,
|
|
4996
|
+
fo as aW,
|
|
4997
|
+
_s as aX,
|
|
4998
|
+
Dl as aY,
|
|
4999
|
+
Br as aZ,
|
|
5000
|
+
Vl as a_,
|
|
4991
5001
|
de as aa,
|
|
4992
5002
|
q as ab,
|
|
4993
|
-
|
|
5003
|
+
Sr as ac,
|
|
4994
5004
|
Ft as ad,
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
5005
|
+
zi as ae,
|
|
5006
|
+
Wl as af,
|
|
5007
|
+
Es as ag,
|
|
4998
5008
|
ie as ah,
|
|
4999
|
-
|
|
5000
|
-
|
|
5009
|
+
_l as ai,
|
|
5010
|
+
gl as aj,
|
|
5001
5011
|
qe as ak,
|
|
5002
|
-
|
|
5012
|
+
Xl as al,
|
|
5003
5013
|
Me as am,
|
|
5004
5014
|
B as an,
|
|
5005
5015
|
Te as ao,
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5016
|
+
qr as ap,
|
|
5017
|
+
ql as aq,
|
|
5018
|
+
be as ar,
|
|
5019
|
+
io as as,
|
|
5020
|
+
Ml as at,
|
|
5021
|
+
El as au,
|
|
5012
5022
|
Bi as av,
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5023
|
+
Ri as aw,
|
|
5024
|
+
Vo as ax,
|
|
5025
|
+
Wo as ay,
|
|
5026
|
+
bt as az,
|
|
5027
|
+
Kr as b,
|
|
5028
|
+
mo as b0,
|
|
5029
|
+
yo as b1,
|
|
5020
5030
|
Hn as b2,
|
|
5021
5031
|
Vt as b3,
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5032
|
+
Tl as b4,
|
|
5033
|
+
Ho as b5,
|
|
5034
|
+
kl as b6,
|
|
5035
|
+
vl as b7,
|
|
5036
|
+
Il as b8,
|
|
5037
|
+
zr as b9,
|
|
5038
|
+
wl as ba,
|
|
5039
|
+
Nl as bb,
|
|
5040
|
+
Al as bc,
|
|
5041
|
+
Pl as bd,
|
|
5042
|
+
Zl as be,
|
|
5043
|
+
U as c,
|
|
5044
|
+
qt as d,
|
|
5045
|
+
De as e,
|
|
5046
|
+
wt as f,
|
|
5047
|
+
ee as g,
|
|
5048
|
+
A as h,
|
|
5049
|
+
Yl as i,
|
|
5050
|
+
dr as j,
|
|
5051
|
+
Ol as k,
|
|
5052
|
+
ge as l,
|
|
5053
|
+
Rn as m,
|
|
5054
|
+
V as n,
|
|
5055
|
+
vn as o,
|
|
5056
|
+
At as p,
|
|
5057
|
+
ro as q,
|
|
5058
|
+
M as r,
|
|
5059
|
+
Ul as s,
|
|
5060
|
+
Sl as t,
|
|
5061
|
+
ut as u,
|
|
5062
|
+
fe as v,
|
|
5063
|
+
Gl as w,
|
|
5064
|
+
uo as x,
|
|
5065
|
+
v as y,
|
|
5066
|
+
co as z
|
|
5057
5067
|
};
|
|
5058
|
-
//# sourceMappingURL=Lexical.prod-
|
|
5068
|
+
//# sourceMappingURL=Lexical.prod-BAE-wnll.js.map
|