sykpcomposer 0.0.8 → 0.0.9
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/index.es.js +624 -608
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +20 -19
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/plugins/PageMarginPlugin/CustomMarginDialog.d.ts +8 -1
- package/dist/src/components/plugins/PageMarginPlugin/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import Mi, { createContext as ji, useContext as $i, useMemo as ot, useLayoutEffect as en, useEffect as ue, forwardRef as Wi, useState as ne, useCallback as Yt, useRef as
|
|
3
|
-
import { flushSync as yl, createPortal as
|
|
1
|
+
import * as yt from "react";
|
|
2
|
+
import Mi, { createContext as ji, useContext as $i, useMemo as ot, useLayoutEffect as en, useEffect as ue, forwardRef as Wi, useState as ne, useCallback as Yt, useRef as wt, Suspense as _l } from "react";
|
|
3
|
+
import { flushSync as yl, createPortal as Hr } from "react-dom";
|
|
4
4
|
var wr = { exports: {} }, ft = {};
|
|
5
5
|
/*
|
|
6
6
|
object-assign
|
|
@@ -100,10 +100,10 @@ function xl() {
|
|
|
100
100
|
process.env.NODE_ENV !== "production" && function() {
|
|
101
101
|
var e = Mi, t = Bi(), r = 60103, o = 60106;
|
|
102
102
|
n.Fragment = 60107;
|
|
103
|
-
var i = 60108, s = 60114, l = 60109, a = 60110, c = 60112, u = 60113, h = 60120, d = 60115, f = 60116, g = 60121,
|
|
103
|
+
var i = 60108, s = 60114, l = 60109, a = 60110, c = 60112, u = 60113, h = 60120, d = 60115, f = 60116, g = 60121, m = 60122, _ = 60117, x = 60129, y = 60131;
|
|
104
104
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
105
|
-
var
|
|
106
|
-
r =
|
|
105
|
+
var v = Symbol.for;
|
|
106
|
+
r = v("react.element"), o = v("react.portal"), n.Fragment = v("react.fragment"), i = v("react.strict_mode"), s = v("react.profiler"), l = v("react.provider"), a = v("react.context"), c = v("react.forward_ref"), u = v("react.suspense"), h = v("react.suspense_list"), d = v("react.memo"), f = v("react.lazy"), g = v("react.block"), m = v("react.server.block"), _ = v("react.fundamental"), v("react.scope"), v("react.opaque.id"), x = v("react.debug_trace_mode"), v("react.offscreen"), y = v("react.legacy_hidden");
|
|
107
107
|
}
|
|
108
108
|
var S = typeof Symbol == "function" && Symbol.iterator, w = "@@iterator";
|
|
109
109
|
function b(p) {
|
|
@@ -132,7 +132,7 @@ function xl() {
|
|
|
132
132
|
}
|
|
133
133
|
var M = !1;
|
|
134
134
|
function W(p) {
|
|
135
|
-
return !!(typeof p == "string" || typeof p == "function" || p === n.Fragment || p === s || p === x || p === i || p === u || p === h || p ===
|
|
135
|
+
return !!(typeof p == "string" || typeof p == "function" || p === n.Fragment || p === s || p === x || p === i || p === u || p === h || p === y || M || typeof p == "object" && p !== null && (p.$$typeof === f || p.$$typeof === d || p.$$typeof === l || p.$$typeof === a || p.$$typeof === c || p.$$typeof === _ || p.$$typeof === g || p[0] === m));
|
|
136
136
|
}
|
|
137
137
|
function Q(p, E, I) {
|
|
138
138
|
var L = E.displayName || E.name || "";
|
|
@@ -187,14 +187,14 @@ function xl() {
|
|
|
187
187
|
}
|
|
188
188
|
return null;
|
|
189
189
|
}
|
|
190
|
-
var J = 0, se, Oe, je,
|
|
190
|
+
var J = 0, se, Oe, je, Ot, Dt, Rt, st;
|
|
191
191
|
function lt() {
|
|
192
192
|
}
|
|
193
193
|
lt.__reactDisabledLog = !0;
|
|
194
194
|
function at() {
|
|
195
195
|
{
|
|
196
196
|
if (J === 0) {
|
|
197
|
-
se = console.log, Oe = console.info, je = console.warn,
|
|
197
|
+
se = console.log, Oe = console.info, je = console.warn, Ot = console.error, Dt = console.group, Rt = console.groupCollapsed, st = console.groupEnd;
|
|
198
198
|
var p = {
|
|
199
199
|
configurable: !0,
|
|
200
200
|
enumerable: !0,
|
|
@@ -233,13 +233,13 @@ function xl() {
|
|
|
233
233
|
value: je
|
|
234
234
|
}),
|
|
235
235
|
error: t({}, p, {
|
|
236
|
-
value:
|
|
236
|
+
value: Ot
|
|
237
237
|
}),
|
|
238
238
|
group: t({}, p, {
|
|
239
|
-
value:
|
|
239
|
+
value: Dt
|
|
240
240
|
}),
|
|
241
241
|
groupCollapsed: t({}, p, {
|
|
242
|
-
value:
|
|
242
|
+
value: Rt
|
|
243
243
|
}),
|
|
244
244
|
groupEnd: t({}, p, {
|
|
245
245
|
value: st
|
|
@@ -249,30 +249,30 @@ function xl() {
|
|
|
249
249
|
J < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
var pe = N.ReactCurrentDispatcher,
|
|
252
|
+
var pe = N.ReactCurrentDispatcher, He;
|
|
253
253
|
function we(p, E, I) {
|
|
254
254
|
{
|
|
255
|
-
if (
|
|
255
|
+
if (He === void 0)
|
|
256
256
|
try {
|
|
257
257
|
throw Error();
|
|
258
258
|
} catch (K) {
|
|
259
259
|
var L = K.stack.trim().match(/\n( *(at )?)/);
|
|
260
|
-
|
|
260
|
+
He = L && L[1] || "";
|
|
261
261
|
}
|
|
262
262
|
return `
|
|
263
|
-
` +
|
|
263
|
+
` + He + p;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
var $e = !1,
|
|
266
|
+
var $e = !1, qe;
|
|
267
267
|
{
|
|
268
268
|
var Qs = typeof WeakMap == "function" ? WeakMap : Map;
|
|
269
|
-
|
|
269
|
+
qe = new Qs();
|
|
270
270
|
}
|
|
271
271
|
function wo(p, E) {
|
|
272
272
|
if (!p || $e)
|
|
273
273
|
return "";
|
|
274
274
|
{
|
|
275
|
-
var I =
|
|
275
|
+
var I = qe.get(p);
|
|
276
276
|
if (I !== void 0)
|
|
277
277
|
return I;
|
|
278
278
|
}
|
|
@@ -318,18 +318,18 @@ function xl() {
|
|
|
318
318
|
if (Re && L && typeof Re.stack == "string") {
|
|
319
319
|
for (var $ = Re.stack.split(`
|
|
320
320
|
`), le = L.stack.split(`
|
|
321
|
-
`),
|
|
321
|
+
`), q = $.length - 1, X = le.length - 1; q >= 1 && X >= 0 && $[q] !== le[X]; )
|
|
322
322
|
X--;
|
|
323
|
-
for (;
|
|
324
|
-
if ($[
|
|
325
|
-
if (
|
|
323
|
+
for (; q >= 1 && X >= 0; q--, X--)
|
|
324
|
+
if ($[q] !== le[X]) {
|
|
325
|
+
if (q !== 1 || X !== 1)
|
|
326
326
|
do
|
|
327
|
-
if (
|
|
327
|
+
if (q--, X--, X < 0 || $[q] !== le[X]) {
|
|
328
328
|
var De = `
|
|
329
|
-
` + $[
|
|
330
|
-
return typeof p == "function" &&
|
|
329
|
+
` + $[q].replace(" at new ", " at ");
|
|
330
|
+
return typeof p == "function" && qe.set(p, De), De;
|
|
331
331
|
}
|
|
332
|
-
while (
|
|
332
|
+
while (q >= 1 && X >= 0);
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
@@ -337,7 +337,7 @@ function xl() {
|
|
|
337
337
|
$e = !1, pe.current = U, ct(), Error.prepareStackTrace = K;
|
|
338
338
|
}
|
|
339
339
|
var dt = p ? p.displayName || p.name : "", Ao = dt ? we(dt) : "";
|
|
340
|
-
return typeof p == "function" &&
|
|
340
|
+
return typeof p == "function" && qe.set(p, Ao), Ao;
|
|
341
341
|
}
|
|
342
342
|
function So(p, E, I) {
|
|
343
343
|
return wo(p, !1);
|
|
@@ -397,14 +397,14 @@ function xl() {
|
|
|
397
397
|
throw le.name = "Invariant Violation", le;
|
|
398
398
|
}
|
|
399
399
|
$ = p[B](E, B, L, I, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
400
|
-
} catch (
|
|
401
|
-
$ =
|
|
400
|
+
} catch (q) {
|
|
401
|
+
$ = q;
|
|
402
402
|
}
|
|
403
403
|
$ && !($ instanceof Error) && (dn(K), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", L || "React class", I, B, typeof $), dn(null)), $ instanceof Error && !($.message in To) && (To[$.message] = !0, dn(K), k("Failed %s type: %s", I, $.message), dn(null));
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
var
|
|
407
|
+
var It = N.ReactCurrentOwner, rr = Object.prototype.hasOwnProperty, tl = {
|
|
408
408
|
key: !0,
|
|
409
409
|
ref: !0,
|
|
410
410
|
__self: !0,
|
|
@@ -428,9 +428,9 @@ function xl() {
|
|
|
428
428
|
return p.key !== void 0;
|
|
429
429
|
}
|
|
430
430
|
function ol(p, E) {
|
|
431
|
-
if (typeof p.ref == "string" &&
|
|
432
|
-
var I = j(
|
|
433
|
-
or[I] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', j(
|
|
431
|
+
if (typeof p.ref == "string" && It.current && E && It.current.stateNode !== E) {
|
|
432
|
+
var I = j(It.current.type);
|
|
433
|
+
or[I] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', j(It.current.type), p.ref), or[I] = !0);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
function il(p, E) {
|
|
@@ -491,15 +491,15 @@ function xl() {
|
|
|
491
491
|
for (U in E)
|
|
492
492
|
rr.call(E, U) && !tl.hasOwnProperty(U) && (B[U] = E[U]);
|
|
493
493
|
if (p && p.defaultProps) {
|
|
494
|
-
var
|
|
495
|
-
for (U in
|
|
496
|
-
B[U] === void 0 && (B[U] =
|
|
494
|
+
var q = p.defaultProps;
|
|
495
|
+
for (U in q)
|
|
496
|
+
B[U] === void 0 && (B[U] = q[U]);
|
|
497
497
|
}
|
|
498
498
|
if ($ || le) {
|
|
499
499
|
var X = typeof p == "function" ? p.displayName || p.name || "Unknown" : p;
|
|
500
500
|
$ && il(B, X), le && sl(B, X);
|
|
501
501
|
}
|
|
502
|
-
return ll(p, $, le, K, L,
|
|
502
|
+
return ll(p, $, le, K, L, It.current, B);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
var ir = N.ReactCurrentOwner, Po = N.ReactDebugCurrentFrame;
|
|
@@ -628,8 +628,8 @@ Check the top-level render call using <` + I + ">.");
|
|
|
628
628
|
(p === void 0 || typeof p == "object" && p !== null && Object.keys(p).length === 0) && ($ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
629
629
|
var le = cl(K);
|
|
630
630
|
le ? $ += le : $ += Oo();
|
|
631
|
-
var
|
|
632
|
-
p === null ?
|
|
631
|
+
var q;
|
|
632
|
+
p === null ? q = "null" : Array.isArray(p) ? q = "array" : p !== void 0 && p.$$typeof === r ? (q = "<" + (j(p.type) || "Unknown") + " />", $ = " Did you accidentally export a JSX literal instead of a component?") : q = typeof p, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, $);
|
|
633
633
|
}
|
|
634
634
|
var X = al(p, E, I, K, U);
|
|
635
635
|
if (X == null)
|
|
@@ -656,8 +656,8 @@ Check the top-level render call using <` + I + ">.");
|
|
|
656
656
|
function gl(p, E, I) {
|
|
657
657
|
return Fo(p, E, I, !1);
|
|
658
658
|
}
|
|
659
|
-
var pl = gl,
|
|
660
|
-
n.jsx = pl, n.jsxs =
|
|
659
|
+
var pl = gl, ml = hl;
|
|
660
|
+
n.jsx = pl, n.jsxs = ml;
|
|
661
661
|
}();
|
|
662
662
|
}(cr)), cr;
|
|
663
663
|
}
|
|
@@ -666,9 +666,9 @@ var T = wr.exports;
|
|
|
666
666
|
function Cl(n) {
|
|
667
667
|
return {};
|
|
668
668
|
}
|
|
669
|
-
const $n = {}, bl = {}, zi = {}, Qe = {},
|
|
669
|
+
const $n = {}, bl = {}, zi = {}, Qe = {}, vt = {}, bn = {}, xt = {}, qr = {}, Sr = {}, Ht = {}, qt = {}, me = {}, Wn = {}, Bn = {}, wl = {}, Ki = {}, Sl = {}, Ui = {}, Tl = {}, Vi = {}, Ji = {}, wn = {}, kl = {}, Yi = {}, Hi = {}, qi = {}, El = {}, Nl = {}, Pl = {}, $o = {}, Gi = {}, jt = {}, Xi = {}, Qi = {}, Ol = {}, zn = {}, Gr = {}, Tr = {}, Dl = {}, Rl = {}, $t = {}, Wt = {}, Il = {}, Fl = {}, Al = {}, be = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ll = be && "documentMode" in document ? document.documentMode : null, _e = be && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Ue = be && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Sn = !(!be || !("InputEvent" in window) || Ll) && "getTargetRanges" in new window.InputEvent("input"), Xr = be && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Kn = be && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ml = be && /Android/.test(navigator.userAgent), Zi = be && /^(?=.*Chrome).*/i.test(navigator.userAgent), jl = be && Ml && Zi, Qr = be && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Zi, tn = 1, Je = 3, et = 0, es = 1, St = 2, $l = 0, Wl = 1, Bl = 2, Tn = 4, kn = 8, Zr = 128, zl = 112 | (3 | Tn | kn) | Zr, eo = 1, to = 2, no = 3, ro = 4, oo = 5, io = 6, Un = Xr || Kn || Qr ? " " : "", Le = `
|
|
670
670
|
|
|
671
|
-
`, Kl = Ue ? " " : Un, ts = "֑-߿יִ-﷽ﹰ-ﻼ", ns = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", Ul = new RegExp("^[^" + ns + "]*[" + ts + "]"), Vl = new RegExp("^[^" + ts + "]*[" + ns + "]"), Ae = { bold: 1, code: 16, highlight: Zr, italic: 2, strikethrough: Tn, subscript: 32, superscript: 64, underline: kn }, Jl = { directionless: 1, unmergeable: 2 }, Wo = { center: to, end: io, justify: ro, left: eo, right: no, start: oo }, Yl = { [to]: "center", [io]: "end", [ro]: "justify", [eo]: "left", [no]: "right", [oo]: "start" },
|
|
671
|
+
`, Kl = Ue ? " " : Un, ts = "֑-߿יִ-﷽ﹰ-ﻼ", ns = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", Ul = new RegExp("^[^" + ns + "]*[" + ts + "]"), Vl = new RegExp("^[^" + ts + "]*[" + ns + "]"), Ae = { bold: 1, code: 16, highlight: Zr, italic: 2, strikethrough: Tn, subscript: 32, superscript: 64, underline: kn }, Jl = { directionless: 1, unmergeable: 2 }, Wo = { center: to, end: io, justify: ro, left: eo, right: no, start: oo }, Yl = { [to]: "center", [io]: "end", [ro]: "justify", [eo]: "left", [no]: "right", [oo]: "start" }, Hl = { normal: 0, segmented: 2, token: 1 }, ql = { [$l]: "normal", [Bl]: "segmented", [Wl]: "token" };
|
|
672
672
|
function Gl(n) {
|
|
673
673
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
674
674
|
}
|
|
@@ -723,11 +723,11 @@ function rs(n, e, t) {
|
|
|
723
723
|
}(n), i = /* @__PURE__ */ new Map(), s = n.getRootElement(), l = n._editorState, a = n._blockCursorElement;
|
|
724
724
|
let c = !1, u = "";
|
|
725
725
|
for (let d = 0; d < e.length; d++) {
|
|
726
|
-
const f = e[d], g = f.type,
|
|
727
|
-
let
|
|
728
|
-
if (!(
|
|
726
|
+
const f = e[d], g = f.type, m = f.target;
|
|
727
|
+
let _ = tt(m, l);
|
|
728
|
+
if (!(_ === null && m !== s || V(_))) {
|
|
729
729
|
if (g === "characterData")
|
|
730
|
-
r && R(
|
|
730
|
+
r && R(_) && ea(o, m, _) && Zl(m, _, n);
|
|
731
731
|
else if (g === "childList") {
|
|
732
732
|
c = !0;
|
|
733
733
|
const x = f.addedNodes;
|
|
@@ -741,14 +741,14 @@ function rs(n, e, t) {
|
|
|
741
741
|
N.removeChild(w);
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
|
-
const
|
|
745
|
-
if (
|
|
744
|
+
const y = f.removedNodes, v = y.length;
|
|
745
|
+
if (v > 0) {
|
|
746
746
|
let S = 0;
|
|
747
|
-
for (let w = 0; w <
|
|
748
|
-
const b =
|
|
749
|
-
(b.nodeName === "BR" && ur(b,
|
|
747
|
+
for (let w = 0; w < v; w++) {
|
|
748
|
+
const b = y[w];
|
|
749
|
+
(b.nodeName === "BR" && ur(b, m, n) || a === b) && (m.appendChild(b), S++);
|
|
750
750
|
}
|
|
751
|
-
|
|
751
|
+
v !== S && (m === s && (_ = us(l)), i.set(m, _));
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
}
|
|
@@ -757,20 +757,20 @@ function rs(n, e, t) {
|
|
|
757
757
|
for (const [d, f] of i)
|
|
758
758
|
if (C(f)) {
|
|
759
759
|
const g = f.getChildrenKeys();
|
|
760
|
-
let
|
|
761
|
-
for (let
|
|
762
|
-
const x = g[
|
|
763
|
-
|
|
760
|
+
let m = d.firstChild;
|
|
761
|
+
for (let _ = 0; _ < g.length; _++) {
|
|
762
|
+
const x = g[_], y = n.getElementByKey(x);
|
|
763
|
+
y !== null && (m == null ? (d.appendChild(y), m = y) : m !== y && d.replaceChild(y, m), m = m.nextSibling);
|
|
764
764
|
}
|
|
765
765
|
} else
|
|
766
766
|
R(f) && f.markDirty();
|
|
767
767
|
const h = t.takeRecords();
|
|
768
768
|
if (h.length > 0) {
|
|
769
769
|
for (let d = 0; d < h.length; d++) {
|
|
770
|
-
const f = h[d], g = f.addedNodes,
|
|
771
|
-
for (let
|
|
772
|
-
const x = g[
|
|
773
|
-
|
|
770
|
+
const f = h[d], g = f.addedNodes, m = f.target;
|
|
771
|
+
for (let _ = 0; _ < g.length; _++) {
|
|
772
|
+
const x = g[_], y = x.parentNode;
|
|
773
|
+
y == null || x.nodeName !== "BR" || ur(x, m, n) || y.removeChild(x);
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
t.takeRecords();
|
|
@@ -787,7 +787,7 @@ function os(n) {
|
|
|
787
787
|
}
|
|
788
788
|
function is(n) {
|
|
789
789
|
(function(e) {
|
|
790
|
-
so === 0 &&
|
|
790
|
+
so === 0 && Hn(e).addEventListener("textInput", Ql, !0);
|
|
791
791
|
})(n), n._observer = new MutationObserver((e, t) => {
|
|
792
792
|
rs(n, e, t);
|
|
793
793
|
});
|
|
@@ -797,7 +797,7 @@ function Bo(n, e) {
|
|
|
797
797
|
return !(t !== null && t !== i || r !== null && r !== s || o !== null && o !== l);
|
|
798
798
|
}
|
|
799
799
|
function zo(n, e) {
|
|
800
|
-
const t = n.mergeWithSibling(e), r =
|
|
800
|
+
const t = n.mergeWithSibling(e), r = H()._normalizedNodes;
|
|
801
801
|
return r.add(n.__key), r.add(e.__key), t;
|
|
802
802
|
}
|
|
803
803
|
function Ko(n) {
|
|
@@ -903,7 +903,7 @@ function oa(n, e) {
|
|
|
903
903
|
if (e != null)
|
|
904
904
|
return void (n.__key = e);
|
|
905
905
|
fe(), Fs();
|
|
906
|
-
const t =
|
|
906
|
+
const t = H(), r = Me(), o = "" + ta++;
|
|
907
907
|
r._nodeMap.set(o, n), C(n) ? t._dirtyElements.set(o, !0) : t._dirtyLeaves.add(o), t._cloneNotNeeded.add(o), t._dirtyType = es, n.__key = o;
|
|
908
908
|
}
|
|
909
909
|
function Ze(n) {
|
|
@@ -945,7 +945,7 @@ function Ze(n) {
|
|
|
945
945
|
}
|
|
946
946
|
function Pn(n) {
|
|
947
947
|
Fs();
|
|
948
|
-
const e = n.getLatest(), t = e.__parent, r = Me(), o =
|
|
948
|
+
const e = n.getLatest(), t = e.__parent, r = Me(), o = H(), i = r._nodeMap, s = o._dirtyElements;
|
|
949
949
|
t !== null && function(a, c, u) {
|
|
950
950
|
let h = a;
|
|
951
951
|
for (; h !== null; ) {
|
|
@@ -962,7 +962,7 @@ function Pn(n) {
|
|
|
962
962
|
}
|
|
963
963
|
function re(n) {
|
|
964
964
|
fe();
|
|
965
|
-
const e =
|
|
965
|
+
const e = H(), t = e._compositionKey;
|
|
966
966
|
if (n !== t) {
|
|
967
967
|
if (e._compositionKey = n, t !== null) {
|
|
968
968
|
const r = ae(t);
|
|
@@ -975,14 +975,14 @@ function re(n) {
|
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
977
|
function ze() {
|
|
978
|
-
return an() ? null :
|
|
978
|
+
return an() ? null : H()._compositionKey;
|
|
979
979
|
}
|
|
980
980
|
function ae(n, e) {
|
|
981
981
|
const t = (e || Me())._nodeMap.get(n);
|
|
982
982
|
return t === void 0 ? null : t;
|
|
983
983
|
}
|
|
984
984
|
function as(n, e) {
|
|
985
|
-
const t = n[`__lexicalKey_${
|
|
985
|
+
const t = n[`__lexicalKey_${H()._key}`];
|
|
986
986
|
return t !== void 0 ? ae(t, e) : null;
|
|
987
987
|
}
|
|
988
988
|
function tt(n, e) {
|
|
@@ -1013,8 +1013,8 @@ function Ee(n) {
|
|
|
1013
1013
|
const e = Me();
|
|
1014
1014
|
n !== null && (n.dirty = !0, n.setCachedNodes(null)), e._selection = n;
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
const e =
|
|
1016
|
+
function _t(n) {
|
|
1017
|
+
const e = H(), t = function(r, o) {
|
|
1018
1018
|
let i = r;
|
|
1019
1019
|
for (; i != null; ) {
|
|
1020
1020
|
const s = i[`__lexicalKey_${o._key}`];
|
|
@@ -1075,9 +1075,9 @@ function fo(n, e, t, r, o) {
|
|
|
1075
1075
|
if (re(null), Xr || Kn || Qr)
|
|
1076
1076
|
i.remove();
|
|
1077
1077
|
else {
|
|
1078
|
-
const
|
|
1078
|
+
const m = H();
|
|
1079
1079
|
setTimeout(() => {
|
|
1080
|
-
|
|
1080
|
+
m.update(() => {
|
|
1081
1081
|
i.isAttached() && i.remove();
|
|
1082
1082
|
});
|
|
1083
1083
|
}, 20);
|
|
@@ -1091,8 +1091,8 @@ function fo(n, e, t, r, o) {
|
|
|
1091
1091
|
if (!O(g) || t === null || r === null)
|
|
1092
1092
|
return void i.setTextContent(l);
|
|
1093
1093
|
if (g.setTextNodeRange(i, t, i, r), i.isSegmented()) {
|
|
1094
|
-
const
|
|
1095
|
-
i.replace(
|
|
1094
|
+
const m = oe(i.getTextContent());
|
|
1095
|
+
i.replace(m), i = m;
|
|
1096
1096
|
}
|
|
1097
1097
|
i.setTextContent(l);
|
|
1098
1098
|
}
|
|
@@ -1112,23 +1112,23 @@ function ia(n, e) {
|
|
|
1112
1112
|
function Yo(n) {
|
|
1113
1113
|
return n === "ArrowLeft";
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function Ho(n) {
|
|
1116
1116
|
return n === "ArrowRight";
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1119
|
-
return
|
|
1118
|
+
function Bt(n, e) {
|
|
1119
|
+
return _e ? n : e;
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function qo(n) {
|
|
1122
1122
|
return n === "Enter";
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function Ft(n) {
|
|
1125
1125
|
return n === "Backspace";
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function At(n) {
|
|
1128
1128
|
return n === "Delete";
|
|
1129
1129
|
}
|
|
1130
1130
|
function Go(n, e, t) {
|
|
1131
|
-
return n.toLowerCase() === "a" &&
|
|
1131
|
+
return n.toLowerCase() === "a" && Bt(e, t);
|
|
1132
1132
|
}
|
|
1133
1133
|
function sa() {
|
|
1134
1134
|
const n = G();
|
|
@@ -1176,7 +1176,7 @@ function Gt(n, e) {
|
|
|
1176
1176
|
return null;
|
|
1177
1177
|
}
|
|
1178
1178
|
function gs(n) {
|
|
1179
|
-
const e =
|
|
1179
|
+
const e = Hn(n).event, t = e && e.inputType;
|
|
1180
1180
|
return t === "insertFromPaste" || t === "insertFromPasteAsQuotation";
|
|
1181
1181
|
}
|
|
1182
1182
|
function F(n, e, t) {
|
|
@@ -1202,24 +1202,24 @@ function Nr(n, e) {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
return !1;
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function Hn(n) {
|
|
1206
1206
|
const e = n._window;
|
|
1207
1207
|
return e === null && D(78), e;
|
|
1208
1208
|
}
|
|
1209
1209
|
function la(n) {
|
|
1210
1210
|
let e = n.getParentOrThrow();
|
|
1211
1211
|
for (; e !== null; ) {
|
|
1212
|
-
if (
|
|
1212
|
+
if (Tt(e))
|
|
1213
1213
|
return e;
|
|
1214
1214
|
e = e.getParentOrThrow();
|
|
1215
1215
|
}
|
|
1216
1216
|
return e;
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1218
|
+
function Tt(n) {
|
|
1219
1219
|
return ie(n) || C(n) && n.isShadowRoot();
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1222
|
-
const e =
|
|
1221
|
+
function qn(n) {
|
|
1222
|
+
const e = H(), t = n.constructor.getType(), r = e._nodes.get(t);
|
|
1223
1223
|
r === void 0 && D(97);
|
|
1224
1224
|
const o = r.replace;
|
|
1225
1225
|
if (o !== null) {
|
|
@@ -1289,9 +1289,9 @@ function Dn(n) {
|
|
|
1289
1289
|
function pt(n) {
|
|
1290
1290
|
if (ie(n) || V(n) && !n.isInline())
|
|
1291
1291
|
return !0;
|
|
1292
|
-
if (!C(n) ||
|
|
1292
|
+
if (!C(n) || Tt(n))
|
|
1293
1293
|
return !1;
|
|
1294
|
-
const e = n.getFirstChild(), t = e === null ||
|
|
1294
|
+
const e = n.getFirstChild(), t = e === null || bt(e) || R(e) || e.isInline();
|
|
1295
1295
|
return !n.isInline() && n.canBeEmpty() !== !1 && t;
|
|
1296
1296
|
}
|
|
1297
1297
|
function hr(n, e) {
|
|
@@ -1301,7 +1301,7 @@ function hr(n, e) {
|
|
|
1301
1301
|
return e(t) ? t : null;
|
|
1302
1302
|
}
|
|
1303
1303
|
function ca() {
|
|
1304
|
-
return
|
|
1304
|
+
return H();
|
|
1305
1305
|
}
|
|
1306
1306
|
const Qo = /* @__PURE__ */ new WeakMap(), ua = /* @__PURE__ */ new Map();
|
|
1307
1307
|
function da(n) {
|
|
@@ -1319,7 +1319,7 @@ function da(n) {
|
|
|
1319
1319
|
}
|
|
1320
1320
|
return e;
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function mo(n) {
|
|
1323
1323
|
const e = n.constructor.clone(n);
|
|
1324
1324
|
return e.afterCloneFrom(n), e;
|
|
1325
1325
|
}
|
|
@@ -1330,7 +1330,7 @@ function ps(n, e, t, r, o, i) {
|
|
|
1330
1330
|
s.__parent === e && (C(s) && ps(s, l, t, r, o, i), t.has(l) || i.delete(l), o.push(l)), s = s.getNextSibling();
|
|
1331
1331
|
}
|
|
1332
1332
|
}
|
|
1333
|
-
let Ve, de, Xt, Gn, Or, Dr, nt, Ce, Rr, Qt, Z = "", ce = "", Se = null, ye = "", Fe = "",
|
|
1333
|
+
let Ve, de, Xt, Gn, Or, Dr, nt, Ce, Rr, Qt, Z = "", ce = "", Se = null, ye = "", Fe = "", ms = !1, Zt = !1, xn = null;
|
|
1334
1334
|
function Rn(n, e) {
|
|
1335
1335
|
const t = nt.get(n);
|
|
1336
1336
|
if (e !== null) {
|
|
@@ -1354,7 +1354,7 @@ function Ge(n, e) {
|
|
|
1354
1354
|
n.setProperty("text-align", e);
|
|
1355
1355
|
}
|
|
1356
1356
|
const fa = "40px";
|
|
1357
|
-
function
|
|
1357
|
+
function _s(n, e) {
|
|
1358
1358
|
const t = Ve.theme.indent;
|
|
1359
1359
|
if (typeof t == "string") {
|
|
1360
1360
|
const o = n.classList.contains(t);
|
|
@@ -1376,7 +1376,7 @@ function In(n, e, t) {
|
|
|
1376
1376
|
s["__lexicalKey_" + l._key] = i, a.set(i, s);
|
|
1377
1377
|
}(n, o, de), R(r) ? o.setAttribute("data-lexical-text", "true") : V(r) && o.setAttribute("data-lexical-decorator", "true"), C(r)) {
|
|
1378
1378
|
const i = r.__indent, s = r.__size;
|
|
1379
|
-
if (i !== 0 &&
|
|
1379
|
+
if (i !== 0 && _s(o, i), s !== 0) {
|
|
1380
1380
|
const a = s - 1;
|
|
1381
1381
|
(function(c, u, h, d) {
|
|
1382
1382
|
const f = ce;
|
|
@@ -1416,7 +1416,7 @@ function Fr(n, e, t, r, o, i) {
|
|
|
1416
1416
|
}
|
|
1417
1417
|
function Zo(n, e) {
|
|
1418
1418
|
const t = e.get(n);
|
|
1419
|
-
return
|
|
1419
|
+
return bt(t) || V(t) && t.isInline();
|
|
1420
1420
|
}
|
|
1421
1421
|
function vs(n, e, t) {
|
|
1422
1422
|
const r = n !== null && (n.__size === 0 || Zo(n.__last, nt)), o = e.__size === 0 || Zo(e.__last, Ce);
|
|
@@ -1480,17 +1480,17 @@ function ha(n, e, t) {
|
|
|
1480
1480
|
if (Z = "", c === 1 && u === 1) {
|
|
1481
1481
|
const h = i.__first, d = s.__first;
|
|
1482
1482
|
if (h === d)
|
|
1483
|
-
|
|
1483
|
+
zt(h, l);
|
|
1484
1484
|
else {
|
|
1485
|
-
const g = Ar(h),
|
|
1485
|
+
const g = Ar(h), m = In(d, null, null);
|
|
1486
1486
|
try {
|
|
1487
|
-
l.replaceChild(
|
|
1488
|
-
} catch (
|
|
1489
|
-
if (typeof
|
|
1490
|
-
const x = `${
|
|
1487
|
+
l.replaceChild(m, g);
|
|
1488
|
+
} catch (_) {
|
|
1489
|
+
if (typeof _ == "object" && _ != null) {
|
|
1490
|
+
const x = `${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${h}}.`;
|
|
1491
1491
|
throw new Error(x);
|
|
1492
1492
|
}
|
|
1493
|
-
throw
|
|
1493
|
+
throw _;
|
|
1494
1494
|
}
|
|
1495
1495
|
Rn(h, null);
|
|
1496
1496
|
}
|
|
@@ -1506,34 +1506,34 @@ function ha(n, e, t) {
|
|
|
1506
1506
|
Ir(h, 0, c - 1, f ? null : l), f && (l.textContent = "");
|
|
1507
1507
|
}
|
|
1508
1508
|
} else
|
|
1509
|
-
(function(f, g,
|
|
1510
|
-
const
|
|
1511
|
-
let w, b, N = (M =
|
|
1512
|
-
for (var M; k <=
|
|
1513
|
-
const Y = g[k], j =
|
|
1509
|
+
(function(f, g, m, _, x, y) {
|
|
1510
|
+
const v = _ - 1, S = x - 1;
|
|
1511
|
+
let w, b, N = (M = y, M.firstChild), k = 0, P = 0;
|
|
1512
|
+
for (var M; k <= v && P <= S; ) {
|
|
1513
|
+
const Y = g[k], j = m[P];
|
|
1514
1514
|
if (Y === j)
|
|
1515
|
-
N = gr(
|
|
1515
|
+
N = gr(zt(j, y)), k++, P++;
|
|
1516
1516
|
else {
|
|
1517
|
-
w === void 0 && (w = new Set(g)), b === void 0 && (b = new Set(
|
|
1517
|
+
w === void 0 && (w = new Set(g)), b === void 0 && (b = new Set(m));
|
|
1518
1518
|
const se = b.has(Y), Oe = w.has(j);
|
|
1519
1519
|
if (se)
|
|
1520
1520
|
if (Oe) {
|
|
1521
1521
|
const je = On(de, j);
|
|
1522
|
-
je === N ? N = gr(
|
|
1522
|
+
je === N ? N = gr(zt(j, y)) : (N != null ? y.insertBefore(je, N) : y.appendChild(je), zt(j, y)), k++, P++;
|
|
1523
1523
|
} else
|
|
1524
|
-
In(j,
|
|
1524
|
+
In(j, y, N), P++;
|
|
1525
1525
|
else
|
|
1526
|
-
N = gr(Ar(Y)), Rn(Y,
|
|
1526
|
+
N = gr(Ar(Y)), Rn(Y, y), k++;
|
|
1527
1527
|
}
|
|
1528
1528
|
const J = Ce.get(j);
|
|
1529
1529
|
J !== null && R(J) && (Se === null && (Se = J.getFormat()), ye === "" && (ye = J.getStyle()));
|
|
1530
1530
|
}
|
|
1531
|
-
const W = k >
|
|
1531
|
+
const W = k > v, Q = P > S;
|
|
1532
1532
|
if (W && !Q) {
|
|
1533
|
-
const Y =
|
|
1534
|
-
Fr(
|
|
1533
|
+
const Y = m[S + 1];
|
|
1534
|
+
Fr(m, f, P, S, y, Y === void 0 ? null : de.getElementByKey(Y));
|
|
1535
1535
|
} else
|
|
1536
|
-
Q && !W && Ir(g, k,
|
|
1536
|
+
Q && !W && Ir(g, k, v, y);
|
|
1537
1537
|
})(s, h, d, c, u, l);
|
|
1538
1538
|
}
|
|
1539
1539
|
Jn(s) && (Z += Le), l.__lexicalTextContent = Z, Z = a + Z;
|
|
@@ -1550,11 +1550,11 @@ function Fn(n, e) {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
return t;
|
|
1552
1552
|
}
|
|
1553
|
-
function
|
|
1553
|
+
function zt(n, e) {
|
|
1554
1554
|
const t = nt.get(n);
|
|
1555
1555
|
let r = Ce.get(n);
|
|
1556
1556
|
t !== void 0 && r !== void 0 || D(61);
|
|
1557
|
-
const o =
|
|
1557
|
+
const o = ms || Dr.has(n) || Or.has(n), i = On(de, n);
|
|
1558
1558
|
if (t === r && !o) {
|
|
1559
1559
|
if (C(t)) {
|
|
1560
1560
|
const s = i.__lexicalTextContent;
|
|
@@ -1573,7 +1573,7 @@ function Bt(n, e) {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
if (C(t) && C(r)) {
|
|
1575
1575
|
const s = r.__indent;
|
|
1576
|
-
s !== t.__indent &&
|
|
1576
|
+
s !== t.__indent && _s(i, s);
|
|
1577
1577
|
const l = r.__format;
|
|
1578
1578
|
l !== t.__format && ys(i, l), o && (ha(t, r, i), ie(r) || r.isInline() || vs(t, r, i)), Jn(r) && (Z += Le, Fe += Le);
|
|
1579
1579
|
} else {
|
|
@@ -1606,9 +1606,9 @@ function gr(n) {
|
|
|
1606
1606
|
return e !== null && e === de._blockCursorElement && (e = e.nextSibling), e;
|
|
1607
1607
|
}
|
|
1608
1608
|
function ga(n, e, t, r, o, i) {
|
|
1609
|
-
Z = "", Fe = "", ce = "",
|
|
1609
|
+
Z = "", Fe = "", ce = "", ms = r === St, xn = null, de = t, Ve = t._config, Xt = t._nodes, Gn = de._listeners.mutation, Or = o, Dr = i, nt = n._nodeMap, Ce = e._nodeMap, Zt = e._readOnly, Rr = new Map(t._keyToDOMMap);
|
|
1610
1610
|
const s = /* @__PURE__ */ new Map();
|
|
1611
|
-
return Qt = s,
|
|
1611
|
+
return Qt = s, zt("root", null), de = void 0, Xt = void 0, Or = void 0, Dr = void 0, nt = void 0, Ce = void 0, Ve = void 0, Rr = void 0, Qt = void 0, s;
|
|
1612
1612
|
}
|
|
1613
1613
|
function Ar(n) {
|
|
1614
1614
|
const e = Rr.get(n);
|
|
@@ -1619,9 +1619,9 @@ const Ie = Object.freeze({}), Lr = 30, Mr = [["keydown", function(n, e) {
|
|
|
1619
1619
|
return;
|
|
1620
1620
|
const { key: t, shiftKey: r, ctrlKey: o, metaKey: i, altKey: s } = n;
|
|
1621
1621
|
F(e, wl, n) || t != null && (function(l, a, c, u) {
|
|
1622
|
-
return
|
|
1622
|
+
return Ho(l) && !a && !u && !c;
|
|
1623
1623
|
}(t, o, s, i) ? F(e, Ki, n) : function(l, a, c, u, h) {
|
|
1624
|
-
return
|
|
1624
|
+
return Ho(l) && !u && !c && (a || h);
|
|
1625
1625
|
}(t, o, r, s, i) ? F(e, Sl, n) : function(l, a, c, u) {
|
|
1626
1626
|
return Yo(l) && !a && !u && !c;
|
|
1627
1627
|
}(t, o, s, i) ? F(e, Ui, n) : function(l, a, c, u, h) {
|
|
@@ -1635,43 +1635,43 @@ const Ie = Object.freeze({}), Lr = 30, Mr = [["keydown", function(n, e) {
|
|
|
1635
1635
|
return u === "ArrowDown";
|
|
1636
1636
|
}(l) && !a && !c;
|
|
1637
1637
|
}(t, o, i) ? F(e, Ji, n) : function(l, a) {
|
|
1638
|
-
return
|
|
1638
|
+
return qo(l) && a;
|
|
1639
1639
|
}(t, r) ? (Vt = !0, F(e, wn, n)) : function(l) {
|
|
1640
1640
|
return l === " ";
|
|
1641
1641
|
}(t) ? F(e, kl, n) : function(l, a) {
|
|
1642
|
-
return
|
|
1643
|
-
}(t, o) ? (n.preventDefault(), Vt = !0, F(e,
|
|
1644
|
-
return
|
|
1642
|
+
return _e && a && l.toLowerCase() === "o";
|
|
1643
|
+
}(t, o) ? (n.preventDefault(), Vt = !0, F(e, vt, !0)) : function(l, a) {
|
|
1644
|
+
return qo(l) && !a;
|
|
1645
1645
|
}(t, r) ? (Vt = !1, F(e, wn, n)) : function(l, a, c, u) {
|
|
1646
|
-
return
|
|
1647
|
-
}(t, s, i, o) ?
|
|
1646
|
+
return _e ? !a && !c && (Ft(l) || l.toLowerCase() === "h" && u) : !(u || a || c) && Ft(l);
|
|
1647
|
+
}(t, s, i, o) ? Ft(t) ? F(e, Yi, n) : (n.preventDefault(), F(e, Qe, !0)) : function(l) {
|
|
1648
1648
|
return l === "Escape";
|
|
1649
|
-
}(t) ? F(e,
|
|
1650
|
-
return
|
|
1651
|
-
}(t, o, r, s, i) ?
|
|
1652
|
-
return
|
|
1653
|
-
}(t, s, o) ? (n.preventDefault(), F(e,
|
|
1654
|
-
return
|
|
1655
|
-
}(t, s, o) ? (n.preventDefault(), F(e,
|
|
1656
|
-
return
|
|
1657
|
-
}(t, i) ? (n.preventDefault(), F(e,
|
|
1658
|
-
return
|
|
1659
|
-
}(t, i) ? (n.preventDefault(), F(e,
|
|
1660
|
-
return l.toLowerCase() === "b" && !a &&
|
|
1661
|
-
}(t, s, i, o) ? (n.preventDefault(), F(e,
|
|
1662
|
-
return l.toLowerCase() === "u" && !a &&
|
|
1663
|
-
}(t, s, i, o) ? (n.preventDefault(), F(e,
|
|
1664
|
-
return l.toLowerCase() === "i" && !a &&
|
|
1665
|
-
}(t, s, i, o) ? (n.preventDefault(), F(e,
|
|
1649
|
+
}(t) ? F(e, Hi, n) : function(l, a, c, u, h) {
|
|
1650
|
+
return _e ? !(c || u || h) && (At(l) || l.toLowerCase() === "d" && a) : !(a || u || h) && At(l);
|
|
1651
|
+
}(t, o, r, s, i) ? At(t) ? F(e, qi, n) : (n.preventDefault(), F(e, Qe, !1)) : function(l, a, c) {
|
|
1652
|
+
return Ft(l) && (_e ? a : c);
|
|
1653
|
+
}(t, s, o) ? (n.preventDefault(), F(e, Ht, !0)) : function(l, a, c) {
|
|
1654
|
+
return At(l) && (_e ? a : c);
|
|
1655
|
+
}(t, s, o) ? (n.preventDefault(), F(e, Ht, !1)) : function(l, a) {
|
|
1656
|
+
return _e && a && Ft(l);
|
|
1657
|
+
}(t, i) ? (n.preventDefault(), F(e, qt, !0)) : function(l, a) {
|
|
1658
|
+
return _e && a && At(l);
|
|
1659
|
+
}(t, i) ? (n.preventDefault(), F(e, qt, !1)) : function(l, a, c, u) {
|
|
1660
|
+
return l.toLowerCase() === "b" && !a && Bt(c, u);
|
|
1661
|
+
}(t, s, i, o) ? (n.preventDefault(), F(e, me, "bold")) : function(l, a, c, u) {
|
|
1662
|
+
return l.toLowerCase() === "u" && !a && Bt(c, u);
|
|
1663
|
+
}(t, s, i, o) ? (n.preventDefault(), F(e, me, "underline")) : function(l, a, c, u) {
|
|
1664
|
+
return l.toLowerCase() === "i" && !a && Bt(c, u);
|
|
1665
|
+
}(t, s, i, o) ? (n.preventDefault(), F(e, me, "italic")) : function(l, a, c, u) {
|
|
1666
1666
|
return l === "Tab" && !a && !c && !u;
|
|
1667
1667
|
}(t, s, o, i) ? F(e, El, n) : function(l, a, c, u) {
|
|
1668
|
-
return l.toLowerCase() === "z" && !a &&
|
|
1668
|
+
return l.toLowerCase() === "z" && !a && Bt(c, u);
|
|
1669
1669
|
}(t, r, i, o) ? (n.preventDefault(), F(e, Wn, void 0)) : function(l, a, c, u) {
|
|
1670
|
-
return
|
|
1670
|
+
return _e ? l.toLowerCase() === "z" && c && a : l.toLowerCase() === "y" && u || l.toLowerCase() === "z" && u && a;
|
|
1671
1671
|
}(t, r, i, o) ? (n.preventDefault(), F(e, Bn, void 0)) : xe(e._editorState._selection) ? function(l, a, c, u) {
|
|
1672
|
-
return !a && l.toLowerCase() === "c" && (
|
|
1672
|
+
return !a && l.toLowerCase() === "c" && (_e ? c : u);
|
|
1673
1673
|
}(t, r, i, o) ? (n.preventDefault(), F(e, zn, n)) : function(l, a, c, u) {
|
|
1674
|
-
return !a && l.toLowerCase() === "x" && (
|
|
1674
|
+
return !a && l.toLowerCase() === "x" && (_e ? c : u);
|
|
1675
1675
|
}(t, r, i, o) ? (n.preventDefault(), F(e, Gr, n)) : Go(t, i, o) && (n.preventDefault(), F(e, Tr, n)) : !Ue && Go(t, i, o) && (n.preventDefault(), F(e, Tr, n)), function(l, a, c, u) {
|
|
1676
1676
|
return l || a || c || u;
|
|
1677
1677
|
}(o, r, s, i) && F(e, Al, n));
|
|
@@ -1685,29 +1685,29 @@ const Ie = Object.freeze({}), Lr = 30, Mr = [["keydown", function(n, e) {
|
|
|
1685
1685
|
const t = A();
|
|
1686
1686
|
if (O(t) && !e.isComposing()) {
|
|
1687
1687
|
const r = t.anchor, o = t.anchor.getNode();
|
|
1688
|
-
re(r.key), (n.timeStamp < Ut + Lr || r.type === "element" || !t.isCollapsed() || o.getFormat() !== t.format || R(o) && o.getStyle() !== t.style) && F(e,
|
|
1688
|
+
re(r.key), (n.timeStamp < Ut + Lr || r.type === "element" || !t.isCollapsed() || o.getFormat() !== t.format || R(o) && o.getStyle() !== t.style) && F(e, xt, Kl);
|
|
1689
1689
|
}
|
|
1690
1690
|
});
|
|
1691
1691
|
}], ["compositionend", function(n, e) {
|
|
1692
|
-
Ue ?
|
|
1692
|
+
Ue ? Lt = !0 : ge(e, () => {
|
|
1693
1693
|
pr(e, n.data);
|
|
1694
1694
|
});
|
|
1695
1695
|
}], ["input", function(n, e) {
|
|
1696
1696
|
n.stopPropagation(), ge(e, () => {
|
|
1697
1697
|
const t = A(), r = n.data, o = ks(n);
|
|
1698
1698
|
if (r != null && O(t) && Ts(t, o, r, n.timeStamp, !1)) {
|
|
1699
|
-
|
|
1699
|
+
Lt && (pr(e, r), Lt = !1);
|
|
1700
1700
|
const i = t.anchor.getNode(), s = Ne(e._window);
|
|
1701
1701
|
if (s === null)
|
|
1702
1702
|
return;
|
|
1703
1703
|
const l = t.isBackward(), a = l ? t.anchor.offset : t.focus.offset, c = l ? t.focus.offset : t.anchor.offset;
|
|
1704
|
-
Sn && !t.isCollapsed() && R(i) && s.anchorNode !== null && i.getTextContent().slice(0, a) + r + i.getTextContent().slice(a + c) === hs(s.anchorNode) || F(e,
|
|
1704
|
+
Sn && !t.isCollapsed() && R(i) && s.anchorNode !== null && i.getTextContent().slice(0, a) + r + i.getTextContent().slice(a + c) === hs(s.anchorNode) || F(e, xt, r);
|
|
1705
1705
|
const u = r.length;
|
|
1706
1706
|
Ue && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), Xr || Kn || Qr || !e.isComposing() || (Ut = 0, re(null));
|
|
1707
1707
|
} else
|
|
1708
|
-
uo(!1, e, r !== null ? r : void 0),
|
|
1709
|
-
fe(), os(
|
|
1710
|
-
}),
|
|
1708
|
+
uo(!1, e, r !== null ? r : void 0), Lt && (pr(e, r || void 0), Lt = !1);
|
|
1709
|
+
fe(), os(H());
|
|
1710
|
+
}), mt = null;
|
|
1711
1711
|
}], ["click", function(n, e) {
|
|
1712
1712
|
ge(e, () => {
|
|
1713
1713
|
const t = A(), r = Ne(e._window), o = ln();
|
|
@@ -1750,8 +1750,8 @@ Sn && Mr.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
} else {
|
|
1752
1752
|
re(null), t.preventDefault();
|
|
1753
|
-
const g = s.anchor.getNode().getTextContent(),
|
|
1754
|
-
jl && f && !
|
|
1753
|
+
const g = s.anchor.getNode().getTextContent(), m = s.anchor.offset === 0 && s.focus.offset === g.length;
|
|
1754
|
+
jl && f && !m || F(r, Qe, !0);
|
|
1755
1755
|
}
|
|
1756
1756
|
return;
|
|
1757
1757
|
}
|
|
@@ -1760,27 +1760,27 @@ Sn && Mr.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
1760
1760
|
if (!O(s))
|
|
1761
1761
|
return;
|
|
1762
1762
|
const a = t.data;
|
|
1763
|
-
|
|
1763
|
+
mt !== null && uo(!1, r, mt), s.dirty && mt === null || !s.isCollapsed() || ie(s.anchor.getNode()) || i === null || s.applyDOMRange(i), mt = null;
|
|
1764
1764
|
const c = s.anchor, u = s.focus, h = c.getNode(), d = u.getNode();
|
|
1765
1765
|
if (o !== "insertText" && o !== "insertTranspose")
|
|
1766
1766
|
switch (t.preventDefault(), o) {
|
|
1767
1767
|
case "insertFromYank":
|
|
1768
1768
|
case "insertFromDrop":
|
|
1769
1769
|
case "insertReplacementText":
|
|
1770
|
-
F(r,
|
|
1770
|
+
F(r, xt, t);
|
|
1771
1771
|
break;
|
|
1772
1772
|
case "insertFromComposition":
|
|
1773
|
-
re(null), F(r,
|
|
1773
|
+
re(null), F(r, xt, t);
|
|
1774
1774
|
break;
|
|
1775
1775
|
case "insertLineBreak":
|
|
1776
|
-
re(null), F(r,
|
|
1776
|
+
re(null), F(r, vt, !1);
|
|
1777
1777
|
break;
|
|
1778
1778
|
case "insertParagraph":
|
|
1779
|
-
re(null), Vt && !Kn ? (Vt = !1, F(r,
|
|
1779
|
+
re(null), Vt && !Kn ? (Vt = !1, F(r, vt, !1)) : F(r, bn, void 0);
|
|
1780
1780
|
break;
|
|
1781
1781
|
case "insertFromPaste":
|
|
1782
1782
|
case "insertFromPasteAsQuotation":
|
|
1783
|
-
F(r,
|
|
1783
|
+
F(r, qr, t);
|
|
1784
1784
|
break;
|
|
1785
1785
|
case "deleteByComposition":
|
|
1786
1786
|
(function(f, g) {
|
|
@@ -1795,31 +1795,31 @@ Sn && Mr.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
1795
1795
|
F(r, Qe, !1);
|
|
1796
1796
|
break;
|
|
1797
1797
|
case "deleteWordBackward":
|
|
1798
|
-
F(r,
|
|
1798
|
+
F(r, Ht, !0);
|
|
1799
1799
|
break;
|
|
1800
1800
|
case "deleteWordForward":
|
|
1801
|
-
F(r,
|
|
1801
|
+
F(r, Ht, !1);
|
|
1802
1802
|
break;
|
|
1803
1803
|
case "deleteHardLineBackward":
|
|
1804
1804
|
case "deleteSoftLineBackward":
|
|
1805
|
-
F(r,
|
|
1805
|
+
F(r, qt, !0);
|
|
1806
1806
|
break;
|
|
1807
1807
|
case "deleteContentForward":
|
|
1808
1808
|
case "deleteHardLineForward":
|
|
1809
1809
|
case "deleteSoftLineForward":
|
|
1810
|
-
F(r,
|
|
1810
|
+
F(r, qt, !1);
|
|
1811
1811
|
break;
|
|
1812
1812
|
case "formatStrikeThrough":
|
|
1813
|
-
F(r,
|
|
1813
|
+
F(r, me, "strikethrough");
|
|
1814
1814
|
break;
|
|
1815
1815
|
case "formatBold":
|
|
1816
|
-
F(r,
|
|
1816
|
+
F(r, me, "bold");
|
|
1817
1817
|
break;
|
|
1818
1818
|
case "formatItalic":
|
|
1819
|
-
F(r,
|
|
1819
|
+
F(r, me, "italic");
|
|
1820
1820
|
break;
|
|
1821
1821
|
case "formatUnderline":
|
|
1822
|
-
F(r,
|
|
1822
|
+
F(r, me, "underline");
|
|
1823
1823
|
break;
|
|
1824
1824
|
case "historyUndo":
|
|
1825
1825
|
F(r, Wn, void 0);
|
|
@@ -1830,23 +1830,23 @@ Sn && Mr.push(["beforeinput", (n, e) => function(t, r) {
|
|
|
1830
1830
|
else {
|
|
1831
1831
|
if (a === `
|
|
1832
1832
|
`)
|
|
1833
|
-
t.preventDefault(), F(r,
|
|
1833
|
+
t.preventDefault(), F(r, vt, !1);
|
|
1834
1834
|
else if (a === Le)
|
|
1835
1835
|
t.preventDefault(), F(r, bn, void 0);
|
|
1836
1836
|
else if (a == null && t.dataTransfer) {
|
|
1837
1837
|
const f = t.dataTransfer.getData("text/plain");
|
|
1838
1838
|
t.preventDefault(), s.insertRawText(f);
|
|
1839
1839
|
} else
|
|
1840
|
-
a != null && Ts(s, i, a, t.timeStamp, !0) ? (t.preventDefault(), F(r,
|
|
1840
|
+
a != null && Ts(s, i, a, t.timeStamp, !0) ? (t.preventDefault(), F(r, xt, a)) : mt = a;
|
|
1841
1841
|
ws = t.timeStamp;
|
|
1842
1842
|
}
|
|
1843
1843
|
});
|
|
1844
1844
|
}(n, e)]);
|
|
1845
|
-
let Ut = 0, bs = null, ws = 0,
|
|
1845
|
+
let Ut = 0, bs = null, ws = 0, mt = null;
|
|
1846
1846
|
const An = /* @__PURE__ */ new WeakMap();
|
|
1847
|
-
let jr = !1, $r = !1, Vt = !1,
|
|
1847
|
+
let jr = !1, $r = !1, Vt = !1, Lt = !1, Ss = [0, "", 0, "root", 0];
|
|
1848
1848
|
function Ts(n, e, t, r, o) {
|
|
1849
|
-
const i = n.anchor, s = n.focus, l = i.getNode(), a =
|
|
1849
|
+
const i = n.anchor, s = n.focus, l = i.getNode(), a = H(), c = Ne(a._window), u = c !== null ? c.anchorNode : null, h = i.key, d = a.getElementByKey(h), f = t.length;
|
|
1850
1850
|
return h !== s.key || !R(l) || (!o && (!Sn || ws < r + 50) || l.isDirty() && f < 2 || ds(t)) && i.offset !== s.offset && !l.isComposing() || gt(l) || l.isDirty() && f > 1 || (o || !Sn) && d !== null && !l.isComposing() && u !== Nn(d) || c !== null && e !== null && (!e.collapsed || e.startContainer !== c.anchorNode || e.startOffset !== c.anchorOffset) || l.getFormat() !== n.format || l.getStyle() !== n.style || ia(n, l);
|
|
1851
1851
|
}
|
|
1852
1852
|
function ei(n, e) {
|
|
@@ -1864,24 +1864,24 @@ function ti(n, e, t) {
|
|
|
1864
1864
|
const a = l.anchor, c = a.getNode();
|
|
1865
1865
|
if (l.isCollapsed()) {
|
|
1866
1866
|
n.type === "Range" && n.anchorNode === n.focusNode && (l.dirty = !0);
|
|
1867
|
-
const u =
|
|
1868
|
-
if (h <
|
|
1867
|
+
const u = Hn(e).event, h = u ? u.timeStamp : performance.now(), [d, f, g, m, _] = Ss, x = G(), y = e.isComposing() === !1 && x.getTextContent() === "";
|
|
1868
|
+
if (h < _ + 200 && a.offset === g && a.key === m)
|
|
1869
1869
|
l.format = d, l.style = f;
|
|
1870
1870
|
else if (a.type === "text")
|
|
1871
1871
|
R(c) || D(141), l.format = c.getFormat(), l.style = c.getStyle();
|
|
1872
|
-
else if (a.type === "element" && !
|
|
1873
|
-
const
|
|
1874
|
-
l.style = "",
|
|
1872
|
+
else if (a.type === "element" && !y) {
|
|
1873
|
+
const v = a.getNode();
|
|
1874
|
+
l.style = "", v instanceof Et && v.getChildrenSize() === 0 ? (l.format = v.getTextFormat(), l.style = v.getTextStyle()) : l.format = 0;
|
|
1875
1875
|
}
|
|
1876
1876
|
} else {
|
|
1877
|
-
const u = a.key, h = l.focus.key, d = l.getNodes(), f = d.length, g = l.isBackward(),
|
|
1878
|
-
let
|
|
1877
|
+
const u = a.key, h = l.focus.key, d = l.getNodes(), f = d.length, g = l.isBackward(), m = g ? s : o, _ = g ? o : s, x = g ? h : u, y = g ? u : h;
|
|
1878
|
+
let v = zl, S = !1;
|
|
1879
1879
|
for (let w = 0; w < f; w++) {
|
|
1880
1880
|
const b = d[w], N = b.getTextContentSize();
|
|
1881
|
-
if (R(b) && N !== 0 && !(w === 0 && b.__key === x &&
|
|
1881
|
+
if (R(b) && N !== 0 && !(w === 0 && b.__key === x && m === N || w === f - 1 && b.__key === y && _ === 0) && (S = !0, v &= b.getFormat(), v === 0))
|
|
1882
1882
|
break;
|
|
1883
1883
|
}
|
|
1884
|
-
l.format = S ?
|
|
1884
|
+
l.format = S ? v : 0;
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
F(e, $n, void 0);
|
|
@@ -1915,7 +1915,7 @@ function Es(n) {
|
|
|
1915
1915
|
let e = n.__lexicalEventHandles;
|
|
1916
1916
|
return e === void 0 && (e = [], n.__lexicalEventHandles = e), e;
|
|
1917
1917
|
}
|
|
1918
|
-
const
|
|
1918
|
+
const Ct = /* @__PURE__ */ new Map();
|
|
1919
1919
|
function Ns(n) {
|
|
1920
1920
|
const e = n.target, t = Ne(e == null ? null : e.nodeType === 9 ? e.defaultView : e.ownerDocument.defaultView);
|
|
1921
1921
|
if (t === null)
|
|
@@ -1930,8 +1930,8 @@ function Ns(n) {
|
|
|
1930
1930
|
const h = u.nodeType;
|
|
1931
1931
|
h !== tn && h !== Je || Ee(yo(c, t, r, n));
|
|
1932
1932
|
}));
|
|
1933
|
-
const o = co(r), i = o[o.length - 1], s = i._key, l =
|
|
1934
|
-
a !== r && ti(t, a, !1), ti(t, r, !0), r !== i ?
|
|
1933
|
+
const o = co(r), i = o[o.length - 1], s = i._key, l = Ct.get(s), a = l || i;
|
|
1934
|
+
a !== r && ti(t, a, !1), ti(t, r, !0), r !== i ? Ct.set(s, r) : l && Ct.delete(s);
|
|
1935
1935
|
}
|
|
1936
1936
|
function ni(n) {
|
|
1937
1937
|
n._lexicalHandled = !0;
|
|
@@ -1948,9 +1948,9 @@ function pa(n) {
|
|
|
1948
1948
|
ao(o) ? (function(s) {
|
|
1949
1949
|
if (s._parentEditor !== null) {
|
|
1950
1950
|
const l = co(s), a = l[l.length - 1]._key;
|
|
1951
|
-
|
|
1951
|
+
Ct.get(a) === s && Ct.delete(a);
|
|
1952
1952
|
} else
|
|
1953
|
-
|
|
1953
|
+
Ct.delete(s._key);
|
|
1954
1954
|
}(o), n.__lexicalEditor = null) : o && D(198);
|
|
1955
1955
|
const i = Es(n);
|
|
1956
1956
|
for (let s = 0; s < i.length; s++)
|
|
@@ -1980,7 +1980,7 @@ function Wr(n, e, t) {
|
|
|
1980
1980
|
Ze(n), Ln(i, o, l, -1);
|
|
1981
1981
|
} else
|
|
1982
1982
|
Ze(n);
|
|
1983
|
-
t ||
|
|
1983
|
+
t || Tt(o) || o.canBeEmpty() || !o.isEmpty() || Wr(o, e), e && ie(o) && o.isEmpty() && o.selectEnd();
|
|
1984
1984
|
}
|
|
1985
1985
|
class Xn {
|
|
1986
1986
|
static getType() {
|
|
@@ -2059,7 +2059,7 @@ class Xn {
|
|
|
2059
2059
|
let e = this;
|
|
2060
2060
|
for (; e !== null; ) {
|
|
2061
2061
|
const t = e.getParent();
|
|
2062
|
-
if (
|
|
2062
|
+
if (Tt(t))
|
|
2063
2063
|
return C(e) || e === this && V(e) || D(194), e;
|
|
2064
2064
|
e = t;
|
|
2065
2065
|
}
|
|
@@ -2194,7 +2194,7 @@ class Xn {
|
|
|
2194
2194
|
return t || r.reverse(), r;
|
|
2195
2195
|
}
|
|
2196
2196
|
isDirty() {
|
|
2197
|
-
const e =
|
|
2197
|
+
const e = H()._dirtyLeaves;
|
|
2198
2198
|
return e !== null && e.has(this.__key);
|
|
2199
2199
|
}
|
|
2200
2200
|
getLatest() {
|
|
@@ -2203,10 +2203,10 @@ class Xn {
|
|
|
2203
2203
|
}
|
|
2204
2204
|
getWritable() {
|
|
2205
2205
|
fe();
|
|
2206
|
-
const e = Me(), t =
|
|
2206
|
+
const e = Me(), t = H(), r = e._nodeMap, o = this.__key, i = this.getLatest(), s = t._cloneNotNeeded, l = A();
|
|
2207
2207
|
if (l !== null && l.setCachedNodes(null), s.has(o))
|
|
2208
2208
|
return Pn(i), i;
|
|
2209
|
-
const a =
|
|
2209
|
+
const a = mo(i);
|
|
2210
2210
|
return s.add(o), Pn(a), r.set(o, a), a;
|
|
2211
2211
|
}
|
|
2212
2212
|
getTextContent() {
|
|
@@ -2243,12 +2243,12 @@ class Xn {
|
|
|
2243
2243
|
const o = this.getLatest(), i = this.__key, s = e.__key, l = e.getWritable(), a = this.getParentOrThrow().getWritable(), c = a.__size;
|
|
2244
2244
|
Ze(l);
|
|
2245
2245
|
const u = o.getPreviousSibling(), h = o.getNextSibling(), d = o.__prev, f = o.__next, g = o.__parent;
|
|
2246
|
-
if (Wr(o, !1, !0), u === null ? a.__first = s : u.getWritable().__next = s, l.__prev = d, h === null ? a.__last = s : h.getWritable().__prev = s, l.__next = f, l.__parent = g, a.__size = c, t && (C(this) && C(l) || D(139), this.getChildren().forEach((
|
|
2247
|
-
l.append(
|
|
2246
|
+
if (Wr(o, !1, !0), u === null ? a.__first = s : u.getWritable().__next = s, l.__prev = d, h === null ? a.__last = s : h.getWritable().__prev = s, l.__next = f, l.__parent = g, a.__size = c, t && (C(this) && C(l) || D(139), this.getChildren().forEach((m) => {
|
|
2247
|
+
l.append(m);
|
|
2248
2248
|
})), O(r)) {
|
|
2249
2249
|
Ee(r);
|
|
2250
|
-
const
|
|
2251
|
-
|
|
2250
|
+
const m = r.anchor, _ = r.focus;
|
|
2251
|
+
m.key === i && li(m, l), _.key === i && li(_, l);
|
|
2252
2252
|
}
|
|
2253
2253
|
return ze() === i && re(s), l;
|
|
2254
2254
|
}
|
|
@@ -2259,8 +2259,8 @@ class Xn {
|
|
|
2259
2259
|
if (i !== null) {
|
|
2260
2260
|
const f = e.getIndexWithinParent();
|
|
2261
2261
|
if (Ze(o), O(s)) {
|
|
2262
|
-
const g = i.__key,
|
|
2263
|
-
l =
|
|
2262
|
+
const g = i.__key, m = s.anchor, _ = s.focus;
|
|
2263
|
+
l = m.type === "element" && m.key === g && m.offset === f + 1, a = _.type === "element" && _.key === g && _.offset === f + 1;
|
|
2264
2264
|
}
|
|
2265
2265
|
}
|
|
2266
2266
|
const c = this.getNextSibling(), u = this.getParentOrThrow().getWritable(), h = o.__key, d = r.__next;
|
|
@@ -2366,7 +2366,7 @@ class rn extends Xn {
|
|
|
2366
2366
|
return !0;
|
|
2367
2367
|
}
|
|
2368
2368
|
return !1;
|
|
2369
|
-
}(e) ? null : { conversion:
|
|
2369
|
+
}(e) ? null : { conversion: ma, priority: 0 } };
|
|
2370
2370
|
}
|
|
2371
2371
|
static importJSON(e) {
|
|
2372
2372
|
return rt();
|
|
@@ -2375,22 +2375,22 @@ class rn extends Xn {
|
|
|
2375
2375
|
return { type: "linebreak", version: 1 };
|
|
2376
2376
|
}
|
|
2377
2377
|
}
|
|
2378
|
-
function
|
|
2378
|
+
function ma(n) {
|
|
2379
2379
|
return { node: rt() };
|
|
2380
2380
|
}
|
|
2381
2381
|
function rt() {
|
|
2382
|
-
return
|
|
2382
|
+
return qn(new rn());
|
|
2383
2383
|
}
|
|
2384
|
-
function
|
|
2384
|
+
function bt(n) {
|
|
2385
2385
|
return n instanceof rn;
|
|
2386
2386
|
}
|
|
2387
2387
|
function fn(n) {
|
|
2388
2388
|
return n.nodeType === Je && /^( |\t|\r?\n)+$/.test(n.textContent || "");
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2390
|
+
function mr(n, e) {
|
|
2391
2391
|
return 16 & e ? "code" : e & Zr ? "mark" : 32 & e ? "sub" : 64 & e ? "sup" : null;
|
|
2392
2392
|
}
|
|
2393
|
-
function
|
|
2393
|
+
function _r(n, e) {
|
|
2394
2394
|
return 1 & e ? "strong" : 2 & e ? "em" : "span";
|
|
2395
2395
|
}
|
|
2396
2396
|
function Ps(n, e, t, r, o) {
|
|
@@ -2423,12 +2423,12 @@ function Os(n, e, t) {
|
|
|
2423
2423
|
if (o || Ue) {
|
|
2424
2424
|
const [l, a, c] = function(u, h) {
|
|
2425
2425
|
const d = u.length, f = h.length;
|
|
2426
|
-
let g = 0,
|
|
2426
|
+
let g = 0, m = 0;
|
|
2427
2427
|
for (; g < d && g < f && u[g] === h[g]; )
|
|
2428
2428
|
g++;
|
|
2429
|
-
for (;
|
|
2430
|
-
|
|
2431
|
-
return [g, d - g -
|
|
2429
|
+
for (; m + g < d && m + g < f && u[d - m - 1] === h[f - m - 1]; )
|
|
2430
|
+
m++;
|
|
2431
|
+
return [g, d - g - m, h.slice(g, f - m)];
|
|
2432
2432
|
}(s, i);
|
|
2433
2433
|
a !== 0 && r.deleteData(l, a), r.insertData(l, c);
|
|
2434
2434
|
} else
|
|
@@ -2444,12 +2444,12 @@ function hn(n, e) {
|
|
|
2444
2444
|
const t = document.createElement(e);
|
|
2445
2445
|
return t.appendChild(n), t;
|
|
2446
2446
|
}
|
|
2447
|
-
class
|
|
2447
|
+
class kt extends Xn {
|
|
2448
2448
|
static getType() {
|
|
2449
2449
|
return "text";
|
|
2450
2450
|
}
|
|
2451
2451
|
static clone(e) {
|
|
2452
|
-
return new
|
|
2452
|
+
return new kt(e.__text, e.__key);
|
|
2453
2453
|
}
|
|
2454
2454
|
afterCloneFrom(e) {
|
|
2455
2455
|
super.afterCloneFrom(e), this.__format = e.__format, this.__style = e.__style, this.__mode = e.__mode, this.__detail = e.__detail;
|
|
@@ -2465,7 +2465,7 @@ class Tt extends Xn {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
getMode() {
|
|
2467
2467
|
const e = this.getLatest();
|
|
2468
|
-
return
|
|
2468
|
+
return ql[e.__mode];
|
|
2469
2469
|
}
|
|
2470
2470
|
getStyle() {
|
|
2471
2471
|
return this.getLatest().__style;
|
|
@@ -2502,21 +2502,21 @@ class Tt extends Xn {
|
|
|
2502
2502
|
return !0;
|
|
2503
2503
|
}
|
|
2504
2504
|
createDOM(e, t) {
|
|
2505
|
-
const r = this.__format, o =
|
|
2505
|
+
const r = this.__format, o = mr(0, r), i = _r(0, r), s = o === null ? i : o, l = document.createElement(s);
|
|
2506
2506
|
let a = l;
|
|
2507
2507
|
this.hasFormat("code") && l.setAttribute("spellcheck", "false"), o !== null && (a = document.createElement(i), l.appendChild(a)), oi(a, this, 0, r, this.__text, e);
|
|
2508
2508
|
const c = this.__style;
|
|
2509
2509
|
return c !== "" && (l.style.cssText = c), l;
|
|
2510
2510
|
}
|
|
2511
2511
|
updateDOM(e, t, r) {
|
|
2512
|
-
const o = this.__text, i = e.__format, s = this.__format, l =
|
|
2512
|
+
const o = this.__text, i = e.__format, s = this.__format, l = mr(0, i), a = mr(0, s), c = _r(0, i), u = _r(0, s);
|
|
2513
2513
|
if ((l === null ? c : l) !== (a === null ? u : a))
|
|
2514
2514
|
return !0;
|
|
2515
2515
|
if (l === a && c !== u) {
|
|
2516
|
-
const
|
|
2517
|
-
|
|
2518
|
-
const
|
|
2519
|
-
return oi(
|
|
2516
|
+
const m = t.firstChild;
|
|
2517
|
+
m == null && D(48);
|
|
2518
|
+
const _ = document.createElement(u);
|
|
2519
|
+
return oi(_, this, 0, s, o, r), t.replaceChild(_, m), !1;
|
|
2520
2520
|
}
|
|
2521
2521
|
let h = t;
|
|
2522
2522
|
a !== null && l !== null && (h = t.firstChild, h == null && D(49)), Os(o, h, this);
|
|
@@ -2526,7 +2526,7 @@ class Tt extends Xn {
|
|
|
2526
2526
|
return f !== g && (t.style.cssText = g), !1;
|
|
2527
2527
|
}
|
|
2528
2528
|
static importDOM() {
|
|
2529
|
-
return { "#text": () => ({ conversion: xa, priority: 0 }), b: () => ({ conversion: ya, priority: 0 }), code: () => ({ conversion: We, priority: 0 }), em: () => ({ conversion: We, priority: 0 }), i: () => ({ conversion: We, priority: 0 }), s: () => ({ conversion: We, priority: 0 }), span: () => ({ conversion:
|
|
2529
|
+
return { "#text": () => ({ conversion: xa, priority: 0 }), b: () => ({ conversion: ya, priority: 0 }), code: () => ({ conversion: We, priority: 0 }), em: () => ({ conversion: We, priority: 0 }), i: () => ({ conversion: We, priority: 0 }), s: () => ({ conversion: We, priority: 0 }), span: () => ({ conversion: _a, priority: 0 }), strong: () => ({ conversion: We, priority: 0 }), sub: () => ({ conversion: We, priority: 0 }), sup: () => ({ conversion: We, priority: 0 }), u: () => ({ conversion: We, priority: 0 }) };
|
|
2530
2530
|
}
|
|
2531
2531
|
static importJSON(e) {
|
|
2532
2532
|
const t = oe(e.text);
|
|
@@ -2566,7 +2566,7 @@ class Tt extends Xn {
|
|
|
2566
2566
|
return e.__detail ^= 2, e;
|
|
2567
2567
|
}
|
|
2568
2568
|
setMode(e) {
|
|
2569
|
-
const t =
|
|
2569
|
+
const t = Hl[e];
|
|
2570
2570
|
if (this.__mode === t)
|
|
2571
2571
|
return this;
|
|
2572
2572
|
const r = this.getWritable();
|
|
@@ -2634,20 +2634,20 @@ class Tt extends Xn {
|
|
|
2634
2634
|
return [t];
|
|
2635
2635
|
const h = l[0], d = t.getParent();
|
|
2636
2636
|
let f;
|
|
2637
|
-
const g = t.getFormat(),
|
|
2637
|
+
const g = t.getFormat(), m = t.getStyle(), _ = t.__detail;
|
|
2638
2638
|
let x = !1;
|
|
2639
|
-
t.isSegmented() ? (f = oe(h), f.__format = g, f.__style =
|
|
2640
|
-
const
|
|
2639
|
+
t.isSegmented() ? (f = oe(h), f.__format = g, f.__style = m, f.__detail = _, x = !0) : (f = t.getWritable(), f.__text = h);
|
|
2640
|
+
const y = A(), v = [f];
|
|
2641
2641
|
let S = h.length;
|
|
2642
2642
|
for (let w = 1; w < u; w++) {
|
|
2643
2643
|
const b = l[w], N = b.length, k = oe(b).getWritable();
|
|
2644
|
-
k.__format = g, k.__style =
|
|
2644
|
+
k.__format = g, k.__style = m, k.__detail = _;
|
|
2645
2645
|
const P = k.__key, M = S + N;
|
|
2646
|
-
if (O(
|
|
2647
|
-
const W =
|
|
2648
|
-
W.key === o && W.type === "text" && W.offset > S && W.offset <= M && (W.key = P, W.offset -= S,
|
|
2646
|
+
if (O(y)) {
|
|
2647
|
+
const W = y.anchor, Q = y.focus;
|
|
2648
|
+
W.key === o && W.type === "text" && W.offset > S && W.offset <= M && (W.key = P, W.offset -= S, y.dirty = !0), Q.key === o && Q.type === "text" && Q.offset > S && Q.offset <= M && (Q.key = P, Q.offset -= S, y.dirty = !0);
|
|
2649
2649
|
}
|
|
2650
|
-
i === o && re(P), S = M,
|
|
2650
|
+
i === o && re(P), S = M, v.push(k);
|
|
2651
2651
|
}
|
|
2652
2652
|
if (d !== null) {
|
|
2653
2653
|
(function(N) {
|
|
@@ -2655,9 +2655,9 @@ class Tt extends Xn {
|
|
|
2655
2655
|
k !== null && Pn(k), P !== null && Pn(P);
|
|
2656
2656
|
})(this);
|
|
2657
2657
|
const w = d.getWritable(), b = this.getIndexWithinParent();
|
|
2658
|
-
x ? (w.splice(b, 0,
|
|
2658
|
+
x ? (w.splice(b, 0, v), this.remove()) : w.splice(b, 1, v), O(y) && Ln(y, d, b, u - 1);
|
|
2659
2659
|
}
|
|
2660
|
-
return
|
|
2660
|
+
return v;
|
|
2661
2661
|
}
|
|
2662
2662
|
mergeWithSibling(e) {
|
|
2663
2663
|
const t = e === this.getPreviousSibling();
|
|
@@ -2678,12 +2678,12 @@ class Tt extends Xn {
|
|
|
2678
2678
|
return !1;
|
|
2679
2679
|
}
|
|
2680
2680
|
}
|
|
2681
|
-
function
|
|
2682
|
-
return { forChild:
|
|
2681
|
+
function _a(n) {
|
|
2682
|
+
return { forChild: _o(n.style), node: null };
|
|
2683
2683
|
}
|
|
2684
2684
|
function ya(n) {
|
|
2685
2685
|
const e = n, t = e.style.fontWeight === "normal";
|
|
2686
|
-
return { forChild:
|
|
2686
|
+
return { forChild: _o(e.style, t ? void 0 : "bold"), node: null };
|
|
2687
2687
|
}
|
|
2688
2688
|
const ii = /* @__PURE__ */ new WeakMap();
|
|
2689
2689
|
function va(n) {
|
|
@@ -2763,19 +2763,19 @@ function si(n, e) {
|
|
|
2763
2763
|
const Ca = { code: "code", em: "italic", i: "italic", s: "strikethrough", strong: "bold", sub: "subscript", sup: "superscript", u: "underline" };
|
|
2764
2764
|
function We(n) {
|
|
2765
2765
|
const e = Ca[n.nodeName.toLowerCase()];
|
|
2766
|
-
return e === void 0 ? { node: null } : { forChild:
|
|
2766
|
+
return e === void 0 ? { node: null } : { forChild: _o(n.style, e), node: null };
|
|
2767
2767
|
}
|
|
2768
2768
|
function oe(n = "") {
|
|
2769
|
-
return
|
|
2769
|
+
return qn(new kt(n));
|
|
2770
2770
|
}
|
|
2771
2771
|
function R(n) {
|
|
2772
|
-
return n instanceof
|
|
2772
|
+
return n instanceof kt;
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function _o(n, e) {
|
|
2775
2775
|
const t = n.fontWeight, r = n.textDecoration.split(" "), o = t === "700" || t === "bold", i = r.includes("line-through"), s = n.fontStyle === "italic", l = r.includes("underline"), a = n.verticalAlign;
|
|
2776
2776
|
return (c) => (R(c) && (o && !c.hasFormat("bold") && c.toggleFormat("bold"), i && !c.hasFormat("strikethrough") && c.toggleFormat("strikethrough"), s && !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);
|
|
2777
2777
|
}
|
|
2778
|
-
class on extends
|
|
2778
|
+
class on extends kt {
|
|
2779
2779
|
static getType() {
|
|
2780
2780
|
return "tab";
|
|
2781
2781
|
}
|
|
@@ -2815,7 +2815,7 @@ class on extends Tt {
|
|
|
2815
2815
|
}
|
|
2816
2816
|
}
|
|
2817
2817
|
function sn() {
|
|
2818
|
-
return
|
|
2818
|
+
return qn(new on());
|
|
2819
2819
|
}
|
|
2820
2820
|
function ba(n) {
|
|
2821
2821
|
return n instanceof on;
|
|
@@ -3013,12 +3013,12 @@ class Ye {
|
|
|
3013
3013
|
let f = d.getTextContent();
|
|
3014
3014
|
d === t ? d === r ? o.type === "element" && i.type === "element" && i.offset !== o.offset || (f = l < a ? f.slice(l, a) : f.slice(a, l)) : f = s ? f.slice(l) : f.slice(a) : d === r && (f = s ? f.slice(0, a) : f.slice(0, l)), c += f;
|
|
3015
3015
|
} else
|
|
3016
|
-
!V(d) && !
|
|
3016
|
+
!V(d) && !bt(d) || d === r && this.isCollapsed() || (c += d.getTextContent());
|
|
3017
3017
|
}
|
|
3018
3018
|
return c;
|
|
3019
3019
|
}
|
|
3020
3020
|
applyDOMRange(e) {
|
|
3021
|
-
const t =
|
|
3021
|
+
const t = H(), r = t.getEditorState()._selection, o = Rs(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, r);
|
|
3022
3022
|
if (o === null)
|
|
3023
3023
|
return;
|
|
3024
3024
|
const [i, s] = o;
|
|
@@ -3051,9 +3051,9 @@ class Ye {
|
|
|
3051
3051
|
insertText(e) {
|
|
3052
3052
|
const t = this.anchor, r = this.focus, o = this.format, i = this.style;
|
|
3053
3053
|
let s = t, l = r;
|
|
3054
|
-
!this.isCollapsed() && r.isBefore(t) && (s = r, l = t), s.type === "element" && function(
|
|
3055
|
-
const S =
|
|
3056
|
-
b.setFormat(
|
|
3054
|
+
!this.isCollapsed() && r.isBefore(t) && (s = r, l = t), s.type === "element" && function(_, x, y, v) {
|
|
3055
|
+
const S = _.getNode(), w = S.getChildAtIndex(_.offset), b = oe(), N = ie(S) ? ke().append(b) : b;
|
|
3056
|
+
b.setFormat(y), b.setStyle(v), w === null ? S.append(N) : w.insertBefore(N), _.is(x) && x.set(b.__key, 0, "text"), _.set(b.__key, 0, "text");
|
|
3057
3057
|
}(s, l, o, i);
|
|
3058
3058
|
const a = s.offset;
|
|
3059
3059
|
let c = l.offset;
|
|
@@ -3061,81 +3061,81 @@ class Ye {
|
|
|
3061
3061
|
let d = u[0];
|
|
3062
3062
|
R(d) || D(26);
|
|
3063
3063
|
const f = d.getTextContent().length, g = d.getParentOrThrow();
|
|
3064
|
-
let
|
|
3064
|
+
let m = u[h - 1];
|
|
3065
3065
|
if (h === 1 && l.type === "element" && (c = f, l.set(s.key, c, "text")), this.isCollapsed() && a === f && (d.isSegmented() || d.isToken() || !d.canInsertTextAfter() || !g.canInsertTextAfter() && d.getNextSibling() === null)) {
|
|
3066
|
-
let
|
|
3067
|
-
if (R(
|
|
3066
|
+
let _ = d.getNextSibling();
|
|
3067
|
+
if (R(_) && _.canInsertTextBefore() && !gt(_) || (_ = oe(), _.setFormat(o), _.setStyle(i), g.canInsertTextAfter() ? d.insertAfter(_) : g.insertAfter(_)), _.select(0, 0), d = _, e !== "")
|
|
3068
3068
|
return void this.insertText(e);
|
|
3069
3069
|
} else if (this.isCollapsed() && a === 0 && (d.isSegmented() || d.isToken() || !d.canInsertTextBefore() || !g.canInsertTextBefore() && d.getPreviousSibling() === null)) {
|
|
3070
|
-
let
|
|
3071
|
-
if (R(
|
|
3070
|
+
let _ = d.getPreviousSibling();
|
|
3071
|
+
if (R(_) && !gt(_) || (_ = oe(), _.setFormat(o), g.canInsertTextBefore() ? d.insertBefore(_) : g.insertBefore(_)), _.select(), d = _, e !== "")
|
|
3072
3072
|
return void this.insertText(e);
|
|
3073
3073
|
} else if (d.isSegmented() && a !== f) {
|
|
3074
|
-
const
|
|
3075
|
-
|
|
3074
|
+
const _ = oe(d.getTextContent());
|
|
3075
|
+
_.setFormat(o), d.replace(_), d = _;
|
|
3076
3076
|
} else if (!this.isCollapsed() && e !== "") {
|
|
3077
|
-
const
|
|
3078
|
-
if (!g.canInsertTextBefore() || !g.canInsertTextAfter() || C(
|
|
3077
|
+
const _ = m.getParent();
|
|
3078
|
+
if (!g.canInsertTextBefore() || !g.canInsertTextAfter() || C(_) && (!_.canInsertTextBefore() || !_.canInsertTextAfter()))
|
|
3079
3079
|
return this.insertText(""), Ds(this.anchor, this.focus, null), void this.insertText(e);
|
|
3080
3080
|
}
|
|
3081
3081
|
if (h === 1) {
|
|
3082
3082
|
if (d.isToken()) {
|
|
3083
|
-
const
|
|
3084
|
-
return
|
|
3083
|
+
const v = oe(e);
|
|
3084
|
+
return v.select(), void d.replace(v);
|
|
3085
3085
|
}
|
|
3086
|
-
const
|
|
3087
|
-
if (a !== c ||
|
|
3086
|
+
const _ = d.getFormat(), x = d.getStyle();
|
|
3087
|
+
if (a !== c || _ === o && x === i) {
|
|
3088
3088
|
if (ba(d)) {
|
|
3089
|
-
const
|
|
3090
|
-
return
|
|
3089
|
+
const v = oe(e);
|
|
3090
|
+
return v.setFormat(o), v.setStyle(i), v.select(), void d.replace(v);
|
|
3091
3091
|
}
|
|
3092
3092
|
} else {
|
|
3093
3093
|
if (d.getTextContent() !== "") {
|
|
3094
|
-
const
|
|
3095
|
-
if (
|
|
3096
|
-
d.insertBefore(
|
|
3094
|
+
const v = oe(e);
|
|
3095
|
+
if (v.setFormat(o), v.setStyle(i), v.select(), a === 0)
|
|
3096
|
+
d.insertBefore(v, !1);
|
|
3097
3097
|
else {
|
|
3098
3098
|
const [S] = d.splitText(a);
|
|
3099
|
-
S.insertAfter(
|
|
3099
|
+
S.insertAfter(v, !1);
|
|
3100
3100
|
}
|
|
3101
|
-
return void (
|
|
3101
|
+
return void (v.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
|
|
3102
3102
|
}
|
|
3103
3103
|
d.setFormat(o), d.setStyle(i);
|
|
3104
3104
|
}
|
|
3105
|
-
const
|
|
3106
|
-
d = d.spliceText(a,
|
|
3105
|
+
const y = c - a;
|
|
3106
|
+
d = d.spliceText(a, y, e, !0), d.getTextContent() === "" ? d.remove() : this.anchor.type === "text" && (d.isComposing() ? this.anchor.offset -= e.length : (this.format = _, this.style = x));
|
|
3107
3107
|
} else {
|
|
3108
|
-
const
|
|
3109
|
-
let
|
|
3110
|
-
if (!x.is(
|
|
3108
|
+
const _ = /* @__PURE__ */ new Set([...d.getParentKeys(), ...m.getParentKeys()]), x = C(d) ? d : d.getParentOrThrow();
|
|
3109
|
+
let y = C(m) ? m : m.getParentOrThrow(), v = m;
|
|
3110
|
+
if (!x.is(y) && y.isInline())
|
|
3111
3111
|
do
|
|
3112
|
-
|
|
3113
|
-
while (
|
|
3114
|
-
if (l.type === "text" && (c !== 0 ||
|
|
3115
|
-
if (R(
|
|
3116
|
-
if (
|
|
3117
|
-
const k = oe(
|
|
3118
|
-
|
|
3112
|
+
v = y, y = y.getParentOrThrow();
|
|
3113
|
+
while (y.isInline());
|
|
3114
|
+
if (l.type === "text" && (c !== 0 || m.getTextContent() === "") || l.type === "element" && m.getIndexWithinParent() < c)
|
|
3115
|
+
if (R(m) && !m.isToken() && c !== m.getTextContentSize()) {
|
|
3116
|
+
if (m.isSegmented()) {
|
|
3117
|
+
const k = oe(m.getTextContent());
|
|
3118
|
+
m.replace(k), m = k;
|
|
3119
3119
|
}
|
|
3120
|
-
ie(l.getNode()) || l.type !== "text" || (
|
|
3120
|
+
ie(l.getNode()) || l.type !== "text" || (m = m.spliceText(0, c, "")), _.add(m.__key);
|
|
3121
3121
|
} else {
|
|
3122
|
-
const k =
|
|
3123
|
-
k.canBeEmpty() || k.getChildrenSize() !== 1 ?
|
|
3122
|
+
const k = m.getParentOrThrow();
|
|
3123
|
+
k.canBeEmpty() || k.getChildrenSize() !== 1 ? m.remove() : k.remove();
|
|
3124
3124
|
}
|
|
3125
3125
|
else
|
|
3126
|
-
|
|
3127
|
-
const S =
|
|
3126
|
+
_.add(m.__key);
|
|
3127
|
+
const S = y.getChildren(), w = new Set(u), b = x.is(y), N = x.isInline() && d.getNextSibling() === null ? x : d;
|
|
3128
3128
|
for (let k = S.length - 1; k >= 0; k--) {
|
|
3129
3129
|
const P = S[k];
|
|
3130
3130
|
if (P.is(d) || C(P) && P.isParentOf(d))
|
|
3131
3131
|
break;
|
|
3132
|
-
P.isAttached() && (!w.has(P) || P.is(
|
|
3132
|
+
P.isAttached() && (!w.has(P) || P.is(v) ? b || N.insertAfter(P, !1) : P.remove());
|
|
3133
3133
|
}
|
|
3134
3134
|
if (!b) {
|
|
3135
|
-
let k =
|
|
3135
|
+
let k = y, P = null;
|
|
3136
3136
|
for (; k !== null; ) {
|
|
3137
3137
|
const M = k.getChildren(), W = M.length;
|
|
3138
|
-
(W === 0 || M[W - 1].is(P)) && (
|
|
3138
|
+
(W === 0 || M[W - 1].is(P)) && (_.delete(k.__key), P = k), k = k.getParent();
|
|
3139
3139
|
}
|
|
3140
3140
|
}
|
|
3141
3141
|
if (d.isToken())
|
|
@@ -3149,7 +3149,7 @@ class Ye {
|
|
|
3149
3149
|
d = d.spliceText(a, f - a, e, !0), d.getTextContent() === "" ? d.remove() : d.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
|
|
3150
3150
|
for (let k = 1; k < h; k++) {
|
|
3151
3151
|
const P = u[k], M = P.__key;
|
|
3152
|
-
|
|
3152
|
+
_.has(M) || P.remove();
|
|
3153
3153
|
}
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
@@ -3160,8 +3160,8 @@ class Ye {
|
|
|
3160
3160
|
if (this.isCollapsed())
|
|
3161
3161
|
return this.toggleFormat(e), void re(null);
|
|
3162
3162
|
const t = this.getNodes(), r = [];
|
|
3163
|
-
for (const
|
|
3164
|
-
R(
|
|
3163
|
+
for (const y of t)
|
|
3164
|
+
R(y) && r.push(y);
|
|
3165
3165
|
const o = r.length;
|
|
3166
3166
|
if (o === 0)
|
|
3167
3167
|
return this.toggleFormat(e), void re(null);
|
|
@@ -3170,27 +3170,27 @@ class Ye {
|
|
|
3170
3170
|
if (a.type === "text" && d === h.getTextContentSize() && (u = 1, h = r[1], d = 0), h == null)
|
|
3171
3171
|
return;
|
|
3172
3172
|
const f = h.getFormatFlags(e, null), g = o - 1;
|
|
3173
|
-
let
|
|
3174
|
-
const
|
|
3175
|
-
if (h.is(
|
|
3176
|
-
if (d ===
|
|
3173
|
+
let m = r[g];
|
|
3174
|
+
const _ = c.type === "text" ? c.offset : m.getTextContentSize();
|
|
3175
|
+
if (h.is(m)) {
|
|
3176
|
+
if (d === _)
|
|
3177
3177
|
return;
|
|
3178
|
-
if (gt(h) || d === 0 &&
|
|
3178
|
+
if (gt(h) || d === 0 && _ === h.getTextContentSize())
|
|
3179
3179
|
h.setFormat(f);
|
|
3180
3180
|
else {
|
|
3181
|
-
const
|
|
3182
|
-
|
|
3181
|
+
const y = h.splitText(d, _), v = d === 0 ? y[0] : y[1];
|
|
3182
|
+
v.setFormat(f), a.type === "text" && a.set(v.__key, 0, "text"), c.type === "text" && c.set(v.__key, _ - d, "text");
|
|
3183
3183
|
}
|
|
3184
3184
|
return void (this.format = f);
|
|
3185
3185
|
}
|
|
3186
3186
|
d === 0 || gt(h) || ([, h] = h.splitText(d), d = 0), h.setFormat(f);
|
|
3187
|
-
const x =
|
|
3188
|
-
|
|
3189
|
-
for (let
|
|
3190
|
-
const
|
|
3191
|
-
|
|
3187
|
+
const x = m.getFormatFlags(e, f);
|
|
3188
|
+
_ > 0 && (_ === m.getTextContentSize() || gt(m) || ([m] = m.splitText(_)), m.setFormat(x));
|
|
3189
|
+
for (let y = u + 1; y < g; y++) {
|
|
3190
|
+
const v = r[y], S = v.getFormatFlags(e, x);
|
|
3191
|
+
v.setFormat(S);
|
|
3192
3192
|
}
|
|
3193
|
-
a.type === "text" && a.set(h.__key, d, "text"), c.type === "text" && c.set(
|
|
3193
|
+
a.type === "text" && a.set(h.__key, d, "text"), c.type === "text" && c.set(m.__key, _, "text"), this.format = f | x;
|
|
3194
3194
|
}
|
|
3195
3195
|
insertNodes(e) {
|
|
3196
3196
|
if (e.length === 0)
|
|
@@ -3217,34 +3217,34 @@ class Ye {
|
|
|
3217
3217
|
}
|
|
3218
3218
|
const o = function(f) {
|
|
3219
3219
|
const g = ke();
|
|
3220
|
-
let
|
|
3221
|
-
for (let
|
|
3222
|
-
const x = f[
|
|
3223
|
-
if (
|
|
3224
|
-
if (
|
|
3220
|
+
let m = null;
|
|
3221
|
+
for (let _ = 0; _ < f.length; _++) {
|
|
3222
|
+
const x = f[_], y = bt(x);
|
|
3223
|
+
if (y || V(x) && x.isInline() || C(x) && x.isInline() || R(x) || x.isParentRequired()) {
|
|
3224
|
+
if (m === null && (m = x.createParentElementNode(), g.append(m), y))
|
|
3225
3225
|
continue;
|
|
3226
|
-
|
|
3226
|
+
m !== null && m.append(x);
|
|
3227
3227
|
} else
|
|
3228
|
-
g.append(x),
|
|
3228
|
+
g.append(x), m = null;
|
|
3229
3229
|
}
|
|
3230
3230
|
return g;
|
|
3231
3231
|
}(e), i = o.getLastDescendant(), s = o.getChildren(), l = !C(t) || !t.isEmpty() ? this.insertParagraph() : null, a = s[s.length - 1];
|
|
3232
3232
|
let c = s[0];
|
|
3233
3233
|
var u;
|
|
3234
|
-
C(u = c) && pt(u) && !u.isEmpty() && C(t) && (!t.isEmpty() || t.canMergeWhenEmpty()) && (C(t) || D(135), t.append(...c.getChildren()), c = s[1]), c && function(f, g,
|
|
3235
|
-
const
|
|
3234
|
+
C(u = c) && pt(u) && !u.isEmpty() && C(t) && (!t.isEmpty() || t.canMergeWhenEmpty()) && (C(t) || D(135), t.append(...c.getChildren()), c = s[1]), c && function(f, g, m) {
|
|
3235
|
+
const _ = g.getParentOrThrow().getLastChild();
|
|
3236
3236
|
let x = g;
|
|
3237
|
-
const
|
|
3238
|
-
for (; x !==
|
|
3239
|
-
x.getNextSibling() || D(140), x = x.getNextSibling(),
|
|
3240
|
-
let
|
|
3241
|
-
for (const S of
|
|
3242
|
-
|
|
3237
|
+
const y = [g];
|
|
3238
|
+
for (; x !== _; )
|
|
3239
|
+
x.getNextSibling() || D(140), x = x.getNextSibling(), y.push(x);
|
|
3240
|
+
let v = f;
|
|
3241
|
+
for (const S of y)
|
|
3242
|
+
v = v.insertAfter(S);
|
|
3243
3243
|
}(t, c);
|
|
3244
3244
|
const h = hr(i, pt);
|
|
3245
3245
|
l && C(h) && (l.canMergeWhenEmpty() || pt(a)) && (h.append(...l.getChildren()), l.remove()), C(t) && t.isEmpty() && t.remove(), i.selectEnd();
|
|
3246
3246
|
const d = C(t) ? t.getLastChild() : null;
|
|
3247
|
-
|
|
3247
|
+
bt(d) && h !== t && d.remove();
|
|
3248
3248
|
}
|
|
3249
3249
|
insertParagraph() {
|
|
3250
3250
|
if (this.anchor.key === "root") {
|
|
@@ -3301,36 +3301,36 @@ class Ye {
|
|
|
3301
3301
|
}
|
|
3302
3302
|
{
|
|
3303
3303
|
const f = l.getParentOrThrow();
|
|
3304
|
-
let g,
|
|
3305
|
-
return C(d) ? (
|
|
3304
|
+
let g, m;
|
|
3305
|
+
return C(d) ? (m = d.__key, g = t ? d.getChildrenSize() : 0) : (g = l.getIndexWithinParent(), m = f.__key, t || g++), o.set(m, g, "element"), void (s && i.set(m, g, "element"));
|
|
3306
3306
|
}
|
|
3307
3307
|
}
|
|
3308
|
-
const a =
|
|
3308
|
+
const a = H(), c = Ne(a._window);
|
|
3309
3309
|
if (!c)
|
|
3310
3310
|
return;
|
|
3311
3311
|
const u = a._blockCursorElement, h = a._rootElement;
|
|
3312
|
-
if (h === null || u === null || !C(l) || l.isInline() || l.canBeEmpty() || go(u, a, h), function(d, f, g,
|
|
3313
|
-
d.modify(f, g,
|
|
3312
|
+
if (h === null || u === null || !C(l) || l.isInline() || l.canBeEmpty() || go(u, a, h), function(d, f, g, m) {
|
|
3313
|
+
d.modify(f, g, m);
|
|
3314
3314
|
}(c, e, t ? "backward" : "forward", r), c.rangeCount > 0) {
|
|
3315
3315
|
const d = c.getRangeAt(0), f = this.anchor.getNode(), g = ie(f) ? f : la(f);
|
|
3316
3316
|
if (this.applyDOMRange(d), this.dirty = !0, !s) {
|
|
3317
|
-
const
|
|
3317
|
+
const m = this.getNodes(), _ = [];
|
|
3318
3318
|
let x = !1;
|
|
3319
|
-
for (let
|
|
3320
|
-
const
|
|
3321
|
-
Nr(
|
|
3319
|
+
for (let y = 0; y < m.length; y++) {
|
|
3320
|
+
const v = m[y];
|
|
3321
|
+
Nr(v, g) ? _.push(v) : x = !0;
|
|
3322
3322
|
}
|
|
3323
|
-
if (x &&
|
|
3323
|
+
if (x && _.length > 0)
|
|
3324
3324
|
if (t) {
|
|
3325
|
-
const
|
|
3326
|
-
C(
|
|
3325
|
+
const y = _[0];
|
|
3326
|
+
C(y) ? y.selectStart() : y.getParentOrThrow().selectStart();
|
|
3327
3327
|
} else {
|
|
3328
|
-
const
|
|
3329
|
-
C(
|
|
3328
|
+
const y = _[_.length - 1];
|
|
3329
|
+
C(y) ? y.selectEnd() : y.getParentOrThrow().selectEnd();
|
|
3330
3330
|
}
|
|
3331
|
-
c.anchorNode === d.startContainer && c.anchorOffset === d.startOffset || function(
|
|
3332
|
-
const
|
|
3333
|
-
Be(S,
|
|
3331
|
+
c.anchorNode === d.startContainer && c.anchorOffset === d.startOffset || function(y) {
|
|
3332
|
+
const v = y.focus, S = y.anchor, w = S.key, b = S.offset, N = S.type;
|
|
3333
|
+
Be(S, v.key, v.offset, v.type), Be(v, w, b, N), y._cachedNodes = null;
|
|
3334
3334
|
}(this);
|
|
3335
3335
|
}
|
|
3336
3336
|
}
|
|
@@ -3357,7 +3357,7 @@ class Ye {
|
|
|
3357
3357
|
const l = fi();
|
|
3358
3358
|
l.add(s.__key), Ee(l);
|
|
3359
3359
|
} else
|
|
3360
|
-
s.remove(),
|
|
3360
|
+
s.remove(), H().dispatchCommand($n, void 0);
|
|
3361
3361
|
return;
|
|
3362
3362
|
}
|
|
3363
3363
|
if (!e && C(s) && C(o) && o.isEmpty())
|
|
@@ -3379,8 +3379,8 @@ class Ye {
|
|
|
3379
3379
|
(function(a, c) {
|
|
3380
3380
|
const u = a.anchor, h = a.focus, d = u.getNode(), f = h.getNode();
|
|
3381
3381
|
if (d === f && u.type === "text" && h.type === "text") {
|
|
3382
|
-
const g = u.offset,
|
|
3383
|
-
x !==
|
|
3382
|
+
const g = u.offset, m = h.offset, _ = g < m, x = _ ? g : m, y = _ ? m : g, v = y - 1;
|
|
3383
|
+
x !== v && (ds(d.getTextContent().slice(x, y)) || (c ? h.offset = v : u.offset = v));
|
|
3384
3384
|
}
|
|
3385
3385
|
})(this, e);
|
|
3386
3386
|
}
|
|
@@ -3459,18 +3459,18 @@ function ui(n, e, t, r) {
|
|
|
3459
3459
|
const d = c.parentNode;
|
|
3460
3460
|
n === d && e > Array.prototype.indexOf.call(d.children, c) && i--;
|
|
3461
3461
|
}
|
|
3462
|
-
if (o =
|
|
3462
|
+
if (o = _t(u), R(o))
|
|
3463
3463
|
i = Jo(o, s);
|
|
3464
3464
|
else {
|
|
3465
|
-
let d =
|
|
3465
|
+
let d = _t(n);
|
|
3466
3466
|
if (d === null)
|
|
3467
3467
|
return null;
|
|
3468
3468
|
if (C(d)) {
|
|
3469
3469
|
i = Math.min(d.getChildrenSize(), i);
|
|
3470
3470
|
let f = d.getChildAtIndex(i);
|
|
3471
|
-
if (C(f) && function(g,
|
|
3471
|
+
if (C(f) && function(g, m, _) {
|
|
3472
3472
|
const x = g.getParent();
|
|
3473
|
-
return
|
|
3473
|
+
return _ === null || x === null || !x.canBeEmpty() || x !== _.getNode();
|
|
3474
3474
|
}(f, 0, t)) {
|
|
3475
3475
|
const g = s ? f.getLastDescendant() : f.getFirstDescendant();
|
|
3476
3476
|
g === null ? d = f : (f = g, d = C(f) ? f : f.getParentOrThrow()), i = 0;
|
|
@@ -3478,13 +3478,13 @@ function ui(n, e, t, r) {
|
|
|
3478
3478
|
R(f) ? (o = f, d = null, i = Jo(f, s)) : f !== d && s && !h && i++;
|
|
3479
3479
|
} else {
|
|
3480
3480
|
const f = d.getIndexWithinParent();
|
|
3481
|
-
i = e === 0 && V(d) &&
|
|
3481
|
+
i = e === 0 && V(d) && _t(n) === d ? f : f + 1, d = d.getParentOrThrow();
|
|
3482
3482
|
}
|
|
3483
3483
|
if (C(d))
|
|
3484
3484
|
return Pe(d.__key, i, "element");
|
|
3485
3485
|
}
|
|
3486
3486
|
} else
|
|
3487
|
-
o =
|
|
3487
|
+
o = _t(n);
|
|
3488
3488
|
return R(o) ? Pe(o.__key, i, "text") : null;
|
|
3489
3489
|
}
|
|
3490
3490
|
function di(n, e, t) {
|
|
@@ -3512,7 +3512,7 @@ function Ds(n, e, t) {
|
|
|
3512
3512
|
if (n.type === "text" && e.type === "text") {
|
|
3513
3513
|
const r = n.isBefore(e), o = n.is(e);
|
|
3514
3514
|
di(n, r, o), di(e, !r, o), o && (e.key = n.key, e.offset = n.offset, e.type = n.type);
|
|
3515
|
-
const i =
|
|
3515
|
+
const i = H();
|
|
3516
3516
|
if (i.isComposing() && i._compositionKey !== n.key && O(t)) {
|
|
3517
3517
|
const s = t.anchor, l = t.focus;
|
|
3518
3518
|
Be(n, s.key, s.offset, s.type), Be(e, l.key, l.offset, l.type);
|
|
@@ -3529,7 +3529,7 @@ function Rs(n, e, t, r, o, i) {
|
|
|
3529
3529
|
if (l === null)
|
|
3530
3530
|
return null;
|
|
3531
3531
|
if (s.type === "element" && l.type === "element") {
|
|
3532
|
-
const a =
|
|
3532
|
+
const a = _t(n), c = _t(t);
|
|
3533
3533
|
if (V(a) && V(c))
|
|
3534
3534
|
return null;
|
|
3535
3535
|
}
|
|
@@ -3564,14 +3564,14 @@ function yo(n, e, t, r) {
|
|
|
3564
3564
|
const f = Rs(c, h, u, d, t, n);
|
|
3565
3565
|
if (f === null)
|
|
3566
3566
|
return null;
|
|
3567
|
-
const [g,
|
|
3568
|
-
return new Ye(g,
|
|
3567
|
+
const [g, m] = f;
|
|
3568
|
+
return new Ye(g, m, O(n) ? n.format : 0, O(n) ? n.style : "");
|
|
3569
3569
|
}
|
|
3570
3570
|
function A() {
|
|
3571
3571
|
return Me()._selection;
|
|
3572
3572
|
}
|
|
3573
3573
|
function ln() {
|
|
3574
|
-
return
|
|
3574
|
+
return H()._editorState._selection;
|
|
3575
3575
|
}
|
|
3576
3576
|
function Ln(n, e, t, r = 1) {
|
|
3577
3577
|
const o = n.anchor, i = n.focus, s = o.getNode(), l = i.getNode();
|
|
@@ -3637,22 +3637,22 @@ function Ta(n, e, t, r, o, i, s) {
|
|
|
3637
3637
|
return;
|
|
3638
3638
|
if (!O(e))
|
|
3639
3639
|
return void (n !== null && nn(t, l, a) && r.removeAllRanges());
|
|
3640
|
-
const d = e.anchor, f = e.focus, g = d.key,
|
|
3641
|
-
let N =
|
|
3640
|
+
const d = e.anchor, f = e.focus, g = d.key, m = f.key, _ = On(t, g), x = On(t, m), y = d.offset, v = f.offset, S = e.format, w = e.style, b = e.isCollapsed();
|
|
3641
|
+
let N = _, k = x, P = !1;
|
|
3642
3642
|
if (d.type === "text") {
|
|
3643
|
-
N = Nn(
|
|
3643
|
+
N = Nn(_);
|
|
3644
3644
|
const J = d.getNode();
|
|
3645
3645
|
P = J.getFormat() !== S || J.getStyle() !== w;
|
|
3646
3646
|
} else
|
|
3647
3647
|
O(n) && n.anchor.type === "text" && (P = !0);
|
|
3648
3648
|
var M, W, Q, Y, j;
|
|
3649
|
-
if (f.type === "text" && (k = Nn(x)), N !== null && k !== null && (b && (n === null || P || O(n) && (n.format !== S || n.style !== w)) && (M = S, W = w, Q =
|
|
3649
|
+
if (f.type === "text" && (k = Nn(x)), N !== null && k !== null && (b && (n === null || P || O(n) && (n.format !== S || n.style !== w)) && (M = S, W = w, Q = y, Y = g, j = performance.now(), Ss = [M, W, Q, Y, j]), c !== y || u !== v || l !== N || a !== k || r.type === "Range" && b || (h !== null && i.contains(h) || i.focus({ preventScroll: !0 }), d.type === "element"))) {
|
|
3650
3650
|
try {
|
|
3651
|
-
r.setBaseAndExtent(N,
|
|
3651
|
+
r.setBaseAndExtent(N, y, k, v);
|
|
3652
3652
|
} catch {
|
|
3653
3653
|
}
|
|
3654
3654
|
if (!o.has("skip-scroll-into-view") && e.isCollapsed() && i !== null && i === document.activeElement) {
|
|
3655
|
-
const J = e instanceof Ye && e.anchor.type === "element" ? N.childNodes[
|
|
3655
|
+
const J = e instanceof Ye && e.anchor.type === "element" ? N.childNodes[y] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null;
|
|
3656
3656
|
if (J !== null) {
|
|
3657
3657
|
let se;
|
|
3658
3658
|
if (J instanceof Text) {
|
|
@@ -3660,30 +3660,30 @@ function Ta(n, e, t, r, o, i, s) {
|
|
|
3660
3660
|
Oe.selectNode(J), se = Oe.getBoundingClientRect();
|
|
3661
3661
|
} else
|
|
3662
3662
|
se = J.getBoundingClientRect();
|
|
3663
|
-
(function(Oe, je,
|
|
3664
|
-
const
|
|
3665
|
-
if (
|
|
3663
|
+
(function(Oe, je, Ot) {
|
|
3664
|
+
const Dt = Ot.ownerDocument, Rt = Dt.defaultView;
|
|
3665
|
+
if (Rt === null)
|
|
3666
3666
|
return;
|
|
3667
|
-
let { top: st, bottom: lt } = je, at = 0, ct = 0, pe =
|
|
3667
|
+
let { top: st, bottom: lt } = je, at = 0, ct = 0, pe = Ot;
|
|
3668
3668
|
for (; pe !== null; ) {
|
|
3669
|
-
const
|
|
3670
|
-
if (
|
|
3671
|
-
at = 0, ct =
|
|
3669
|
+
const He = pe === Dt.body;
|
|
3670
|
+
if (He)
|
|
3671
|
+
at = 0, ct = Hn(Oe).innerHeight;
|
|
3672
3672
|
else {
|
|
3673
3673
|
const $e = pe.getBoundingClientRect();
|
|
3674
3674
|
at = $e.top, ct = $e.bottom;
|
|
3675
3675
|
}
|
|
3676
3676
|
let we = 0;
|
|
3677
3677
|
if (st < at ? we = -(at - st) : lt > ct && (we = lt - ct), we !== 0)
|
|
3678
|
-
if (
|
|
3679
|
-
|
|
3678
|
+
if (He)
|
|
3679
|
+
Rt.scrollBy(0, we);
|
|
3680
3680
|
else {
|
|
3681
3681
|
const $e = pe.scrollTop;
|
|
3682
3682
|
pe.scrollTop += we;
|
|
3683
|
-
const
|
|
3684
|
-
st -=
|
|
3683
|
+
const qe = pe.scrollTop - $e;
|
|
3684
|
+
st -= qe, lt -= qe;
|
|
3685
3685
|
}
|
|
3686
|
-
if (
|
|
3686
|
+
if (He)
|
|
3687
3687
|
break;
|
|
3688
3688
|
pe = Yn(pe);
|
|
3689
3689
|
}
|
|
@@ -3744,7 +3744,7 @@ function Fs() {
|
|
|
3744
3744
|
function Me() {
|
|
3745
3745
|
return ee === null && D(195, As()), ee;
|
|
3746
3746
|
}
|
|
3747
|
-
function
|
|
3747
|
+
function H() {
|
|
3748
3748
|
return te === null && D(196, As()), te;
|
|
3749
3749
|
}
|
|
3750
3750
|
function As() {
|
|
@@ -3766,7 +3766,7 @@ function As() {
|
|
|
3766
3766
|
function Na() {
|
|
3767
3767
|
return te;
|
|
3768
3768
|
}
|
|
3769
|
-
function
|
|
3769
|
+
function mi(n, e, t) {
|
|
3770
3770
|
const r = e.__type, o = function(l, a) {
|
|
3771
3771
|
const c = l._nodes.get(a);
|
|
3772
3772
|
return c === void 0 && D(30, a), c;
|
|
@@ -3777,11 +3777,11 @@ function _i(n, e, t) {
|
|
|
3777
3777
|
for (let l = 0; l < s && (i[l](e), e.isAttached()); l++)
|
|
3778
3778
|
;
|
|
3779
3779
|
}
|
|
3780
|
-
function
|
|
3780
|
+
function _i(n, e) {
|
|
3781
3781
|
return n !== void 0 && n.__key !== e && n.isAttached();
|
|
3782
3782
|
}
|
|
3783
3783
|
function Pa(n) {
|
|
3784
|
-
return vo(n,
|
|
3784
|
+
return vo(n, H()._nodes);
|
|
3785
3785
|
}
|
|
3786
3786
|
function vo(n, e) {
|
|
3787
3787
|
const t = n.type, r = e.get(t);
|
|
@@ -3819,13 +3819,13 @@ function Ke(n, e) {
|
|
|
3819
3819
|
} catch (b) {
|
|
3820
3820
|
if (b instanceof Error && n._onError(b), xr)
|
|
3821
3821
|
throw b;
|
|
3822
|
-
return $s(n, null, r, t), is(n), n._dirtyType =
|
|
3822
|
+
return $s(n, null, r, t), is(n), n._dirtyType = St, xr = !0, Ke(n, i), void (xr = !1);
|
|
3823
3823
|
} finally {
|
|
3824
3824
|
f.observe(r, pi), n._updating = d, ee = c, he = u, te = h;
|
|
3825
3825
|
}
|
|
3826
3826
|
}
|
|
3827
3827
|
t._readOnly || (t._readOnly = !0);
|
|
3828
|
-
const
|
|
3828
|
+
const m = n._dirtyLeaves, _ = n._dirtyElements, x = n._normalizedNodes, y = n._updateTags, v = n._deferred;
|
|
3829
3829
|
a && (n._dirtyType = et, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements = /* @__PURE__ */ new Map(), n._normalizedNodes = /* @__PURE__ */ new Set(), n._updateTags = /* @__PURE__ */ new Set()), function(b, N) {
|
|
3830
3830
|
const k = b._decorators;
|
|
3831
3831
|
let P = b._pendingDecorators || k;
|
|
@@ -3840,7 +3840,7 @@ function Ke(n, e) {
|
|
|
3840
3840
|
try {
|
|
3841
3841
|
if (f !== null && f.disconnect(), a || l === null || l.dirty) {
|
|
3842
3842
|
const b = n._blockCursorElement;
|
|
3843
|
-
b !== null && go(b, n, r), Ta(s, l, n, S,
|
|
3843
|
+
b !== null && go(b, n, r), Ta(s, l, n, S, y, r);
|
|
3844
3844
|
}
|
|
3845
3845
|
aa(n, r, l), f !== null && f.observe(r, pi);
|
|
3846
3846
|
} finally {
|
|
@@ -3853,12 +3853,12 @@ function Ke(n, e) {
|
|
|
3853
3853
|
const [j, J] = W[Y], se = N.get(J);
|
|
3854
3854
|
se !== void 0 && j(se, { dirtyLeaves: P, prevEditorState: M, updateTags: k });
|
|
3855
3855
|
}
|
|
3856
|
-
}(n, g,
|
|
3856
|
+
}(n, g, y, m, i), O(l) || l === null || s !== null && s.is(l) || n.dispatchCommand($n, void 0);
|
|
3857
3857
|
const w = n._pendingDecorators;
|
|
3858
3858
|
w !== null && (n._decorators = w, n._pendingDecorators = null, Jt("decorator", n, !0, w)), function(b, N, k) {
|
|
3859
3859
|
const P = Vo(N), M = Vo(k);
|
|
3860
3860
|
P !== M && Jt("textcontent", b, !0, M);
|
|
3861
|
-
}(n, e || i, t), Jt("update", n, !0, { dirtyElements:
|
|
3861
|
+
}(n, e || i, t), Jt("update", n, !0, { dirtyElements: _, dirtyLeaves: m, editorState: t, normalizedNodes: x, prevEditorState: e || i, tags: y }), function(b, N) {
|
|
3862
3862
|
if (b._deferred = [], N.length !== 0) {
|
|
3863
3863
|
const k = b._updating;
|
|
3864
3864
|
b._updating = !0;
|
|
@@ -3869,7 +3869,7 @@ function Ke(n, e) {
|
|
|
3869
3869
|
b._updating = k;
|
|
3870
3870
|
}
|
|
3871
3871
|
}
|
|
3872
|
-
}(n,
|
|
3872
|
+
}(n, v), function(b) {
|
|
3873
3873
|
const N = b._updates;
|
|
3874
3874
|
if (N.length !== 0) {
|
|
3875
3875
|
const k = N.shift();
|
|
@@ -3944,13 +3944,13 @@ function Ms(n, e, t) {
|
|
|
3944
3944
|
const h = ee, d = he, f = te, g = n._updating;
|
|
3945
3945
|
ee = c, he = !1, n._updating = !0, te = n;
|
|
3946
3946
|
try {
|
|
3947
|
-
u && (n._headless ? a._selection !== null && (c._selection = a._selection.clone()) : c._selection = function(
|
|
3948
|
-
const
|
|
3949
|
-
return O(
|
|
3947
|
+
u && (n._headless ? a._selection !== null && (c._selection = a._selection.clone()) : c._selection = function(y) {
|
|
3948
|
+
const v = y.getEditorState()._selection, S = Ne(y._window);
|
|
3949
|
+
return O(v) || v == null ? yo(v, S, y, null) : v.clone();
|
|
3950
3950
|
}(n));
|
|
3951
|
-
const
|
|
3952
|
-
e(), s = vi(n, s), function(
|
|
3953
|
-
const S =
|
|
3951
|
+
const _ = n._compositionKey;
|
|
3952
|
+
e(), s = vi(n, s), function(y, v) {
|
|
3953
|
+
const S = v.getEditorState()._selection, w = y._selection;
|
|
3954
3954
|
if (O(w)) {
|
|
3955
3955
|
const b = w.anchor, N = w.focus;
|
|
3956
3956
|
let k;
|
|
@@ -3959,40 +3959,40 @@ function Ms(n, e, t) {
|
|
|
3959
3959
|
k !== P && P.selectionTransform(S, w);
|
|
3960
3960
|
}
|
|
3961
3961
|
}
|
|
3962
|
-
}(c, n), n._dirtyType !== et && (s ? function(
|
|
3963
|
-
const S =
|
|
3962
|
+
}(c, n), n._dirtyType !== et && (s ? function(y, v) {
|
|
3963
|
+
const S = v._dirtyLeaves, w = y._nodeMap;
|
|
3964
3964
|
for (const b of S) {
|
|
3965
3965
|
const N = w.get(b);
|
|
3966
3966
|
R(N) && N.isAttached() && N.isSimpleText() && !N.isUnmergeable() && Ko(N);
|
|
3967
3967
|
}
|
|
3968
|
-
}(c, n) : function(
|
|
3969
|
-
const S =
|
|
3968
|
+
}(c, n) : function(y, v) {
|
|
3969
|
+
const S = v._dirtyLeaves, w = v._dirtyElements, b = y._nodeMap, N = ze(), k = /* @__PURE__ */ new Map();
|
|
3970
3970
|
let P = S, M = P.size, W = w, Q = W.size;
|
|
3971
3971
|
for (; M > 0 || Q > 0; ) {
|
|
3972
3972
|
if (M > 0) {
|
|
3973
|
-
|
|
3973
|
+
v._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
3974
3974
|
for (const Y of P) {
|
|
3975
3975
|
const j = b.get(Y);
|
|
3976
|
-
R(j) && j.isAttached() && j.isSimpleText() && !j.isUnmergeable() && Ko(j), j !== void 0 &&
|
|
3976
|
+
R(j) && j.isAttached() && j.isSimpleText() && !j.isUnmergeable() && Ko(j), j !== void 0 && _i(j, N) && mi(v, j, k), S.add(Y);
|
|
3977
3977
|
}
|
|
3978
|
-
if (P =
|
|
3978
|
+
if (P = v._dirtyLeaves, M = P.size, M > 0) {
|
|
3979
3979
|
Cn++;
|
|
3980
3980
|
continue;
|
|
3981
3981
|
}
|
|
3982
3982
|
}
|
|
3983
|
-
|
|
3983
|
+
v._dirtyLeaves = /* @__PURE__ */ new Set(), v._dirtyElements = /* @__PURE__ */ new Map();
|
|
3984
3984
|
for (const Y of W) {
|
|
3985
3985
|
const j = Y[0], J = Y[1];
|
|
3986
3986
|
if (j !== "root" && !J)
|
|
3987
3987
|
continue;
|
|
3988
3988
|
const se = b.get(j);
|
|
3989
|
-
se !== void 0 &&
|
|
3989
|
+
se !== void 0 && _i(se, N) && mi(v, se, k), w.set(j, J);
|
|
3990
3990
|
}
|
|
3991
|
-
P =
|
|
3991
|
+
P = v._dirtyLeaves, M = P.size, W = v._dirtyElements, Q = W.size, Cn++;
|
|
3992
3992
|
}
|
|
3993
|
-
|
|
3994
|
-
}(c, n), vi(n), function(
|
|
3995
|
-
const b =
|
|
3993
|
+
v._dirtyLeaves = S, v._dirtyElements = w;
|
|
3994
|
+
}(c, n), vi(n), function(y, v, S, w) {
|
|
3995
|
+
const b = y._nodeMap, N = v._nodeMap, k = [];
|
|
3996
3996
|
for (const [P] of w) {
|
|
3997
3997
|
const M = N.get(P);
|
|
3998
3998
|
M !== void 0 && (M.isAttached() || (C(M) && ps(M, P, b, N, k, w), b.has(P) || w.delete(P), k.push(P)));
|
|
@@ -4003,24 +4003,24 @@ function Ms(n, e, t) {
|
|
|
4003
4003
|
const M = N.get(P);
|
|
4004
4004
|
M === void 0 || M.isAttached() || (b.has(P) || S.delete(P), N.delete(P));
|
|
4005
4005
|
}
|
|
4006
|
-
}(a, c, n._dirtyLeaves, n._dirtyElements)),
|
|
4006
|
+
}(a, c, n._dirtyLeaves, n._dirtyElements)), _ !== n._compositionKey && (c._flushSync = !0);
|
|
4007
4007
|
const x = c._selection;
|
|
4008
4008
|
if (O(x)) {
|
|
4009
|
-
const
|
|
4010
|
-
|
|
4009
|
+
const y = c._nodeMap, v = x.anchor.key, S = x.focus.key;
|
|
4010
|
+
y.get(v) !== void 0 && y.get(S) !== void 0 || D(19);
|
|
4011
4011
|
} else
|
|
4012
4012
|
xe(x) && x._nodes.size === 0 && (c._selection = null);
|
|
4013
|
-
} catch (
|
|
4014
|
-
return
|
|
4013
|
+
} catch (_) {
|
|
4014
|
+
return _ instanceof Error && n._onError(_), n._pendingEditorState = a, n._dirtyType = St, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements.clear(), void Ke(n);
|
|
4015
4015
|
} finally {
|
|
4016
4016
|
ee = h, he = d, te = f, n._updating = g, Cn = 0;
|
|
4017
4017
|
}
|
|
4018
|
-
n._dirtyType !== et || function(
|
|
4019
|
-
const
|
|
4020
|
-
if (
|
|
4021
|
-
if (
|
|
4018
|
+
n._dirtyType !== et || function(_, x) {
|
|
4019
|
+
const y = x.getEditorState()._selection, v = _._selection;
|
|
4020
|
+
if (v !== null) {
|
|
4021
|
+
if (v.dirty || !v.is(y))
|
|
4022
4022
|
return !0;
|
|
4023
|
-
} else if (
|
|
4023
|
+
} else if (y !== null)
|
|
4024
4024
|
return !0;
|
|
4025
4025
|
return !1;
|
|
4026
4026
|
}(c, n) ? c._flushSync ? (c._flushSync = !1, Ke(n)) : u && na(() => {
|
|
@@ -4071,7 +4071,7 @@ class Zn extends Xn {
|
|
|
4071
4071
|
return this.getChildrenSize() === 0;
|
|
4072
4072
|
}
|
|
4073
4073
|
isDirty() {
|
|
4074
|
-
const e =
|
|
4074
|
+
const e = H()._dirtyElements;
|
|
4075
4075
|
return e !== null && e.has(this.__key);
|
|
4076
4076
|
}
|
|
4077
4077
|
isLastChild() {
|
|
@@ -4241,42 +4241,42 @@ class Zn extends Xn {
|
|
|
4241
4241
|
}
|
|
4242
4242
|
if (t > 0) {
|
|
4243
4243
|
let g = h === null ? this.getFirstChild() : h.getNextSibling();
|
|
4244
|
-
for (let
|
|
4244
|
+
for (let m = 0; m < t; m++) {
|
|
4245
4245
|
g === null && D(100);
|
|
4246
|
-
const
|
|
4247
|
-
Ze(g.getWritable()), c.push(x), g =
|
|
4246
|
+
const _ = g.getNextSibling(), x = g.__key;
|
|
4247
|
+
Ze(g.getWritable()), c.push(x), g = _;
|
|
4248
4248
|
}
|
|
4249
4249
|
}
|
|
4250
4250
|
let f = h;
|
|
4251
4251
|
for (let g = 0; g < o; g++) {
|
|
4252
|
-
const
|
|
4253
|
-
f !== null &&
|
|
4254
|
-
const
|
|
4255
|
-
|
|
4256
|
-
const x =
|
|
4252
|
+
const m = r[g];
|
|
4253
|
+
f !== null && m.is(f) && (h = f = f.getPreviousSibling());
|
|
4254
|
+
const _ = m.getWritable();
|
|
4255
|
+
_.__parent === l && d--, Ze(_);
|
|
4256
|
+
const x = m.__key;
|
|
4257
4257
|
if (f === null)
|
|
4258
|
-
s.__first = x,
|
|
4258
|
+
s.__first = x, _.__prev = null;
|
|
4259
4259
|
else {
|
|
4260
|
-
const
|
|
4261
|
-
|
|
4260
|
+
const y = f.getWritable();
|
|
4261
|
+
y.__next = x, _.__prev = y.__key;
|
|
4262
4262
|
}
|
|
4263
|
-
|
|
4263
|
+
m.__key === l && D(76), _.__parent = l, a.push(x), f = m;
|
|
4264
4264
|
}
|
|
4265
4265
|
if (e + t === i)
|
|
4266
4266
|
f !== null && (f.getWritable().__next = null, s.__last = f.__key);
|
|
4267
4267
|
else if (u !== null) {
|
|
4268
4268
|
const g = u.getWritable();
|
|
4269
4269
|
if (f !== null) {
|
|
4270
|
-
const
|
|
4271
|
-
g.__prev = f.__key,
|
|
4270
|
+
const m = f.getWritable();
|
|
4271
|
+
g.__prev = f.__key, m.__next = u.__key;
|
|
4272
4272
|
} else
|
|
4273
4273
|
g.__prev = null;
|
|
4274
4274
|
}
|
|
4275
4275
|
if (s.__size = d, c.length) {
|
|
4276
4276
|
const g = A();
|
|
4277
4277
|
if (O(g)) {
|
|
4278
|
-
const
|
|
4279
|
-
xi(x,
|
|
4278
|
+
const m = new Set(c), _ = new Set(a), { anchor: x, focus: y } = g;
|
|
4279
|
+
xi(x, m, _) && Mn(x, x.getNode(), this, h, u), xi(y, m, _) && Mn(y, y.getNode(), this, h, u), d !== 0 || this.canBeEmpty() || Tt(this) || this.remove();
|
|
4280
4280
|
}
|
|
4281
4281
|
}
|
|
4282
4282
|
return s;
|
|
@@ -4375,7 +4375,7 @@ class cn extends Zn {
|
|
|
4375
4375
|
}
|
|
4376
4376
|
getTextContent() {
|
|
4377
4377
|
const e = this.__cachedText;
|
|
4378
|
-
return !an() &&
|
|
4378
|
+
return !an() && H()._dirtyType !== et || e === null ? super.getTextContent() : e;
|
|
4379
4379
|
}
|
|
4380
4380
|
remove() {
|
|
4381
4381
|
D(52);
|
|
@@ -4455,7 +4455,7 @@ class Co extends Zn {
|
|
|
4455
4455
|
return document.createElement("div");
|
|
4456
4456
|
}
|
|
4457
4457
|
}
|
|
4458
|
-
class
|
|
4458
|
+
class Et extends Zn {
|
|
4459
4459
|
constructor(e) {
|
|
4460
4460
|
super(e), this.__textFormat = 0, this.__textStyle = "";
|
|
4461
4461
|
}
|
|
@@ -4481,7 +4481,7 @@ class kt extends Zn {
|
|
|
4481
4481
|
return t.__textStyle = e, t;
|
|
4482
4482
|
}
|
|
4483
4483
|
static clone(e) {
|
|
4484
|
-
return new
|
|
4484
|
+
return new Et(e.__key);
|
|
4485
4485
|
}
|
|
4486
4486
|
afterCloneFrom(e) {
|
|
4487
4487
|
super.afterCloneFrom(e), this.__textFormat = e.__textFormat, this.__textStyle = e.__textStyle;
|
|
@@ -4543,10 +4543,10 @@ function Da(n) {
|
|
|
4543
4543
|
return { node: e };
|
|
4544
4544
|
}
|
|
4545
4545
|
function ke() {
|
|
4546
|
-
return
|
|
4546
|
+
return qn(new Et());
|
|
4547
4547
|
}
|
|
4548
4548
|
function Kr(n) {
|
|
4549
|
-
return n instanceof
|
|
4549
|
+
return n instanceof Et;
|
|
4550
4550
|
}
|
|
4551
4551
|
const z = 0, Ra = 4;
|
|
4552
4552
|
function $s(n, e, t, r) {
|
|
@@ -4556,39 +4556,39 @@ function $s(n, e, t, r) {
|
|
|
4556
4556
|
i !== null && (i.disconnect(), n._observer = null), e !== null && (e.textContent = ""), t !== null && (t.textContent = "", o.set("root", t));
|
|
4557
4557
|
}
|
|
4558
4558
|
function Ia(n) {
|
|
4559
|
-
const e = n || {}, t = Na(), r = e.theme || {}, o = n === void 0 ? t : e.parentEditor || null, i = e.disableEvents || !1, s = xo(), l = e.namespace || (o !== null ? o._config.namespace : fs()), a = e.editorState, c = [cn,
|
|
4559
|
+
const e = n || {}, t = Na(), r = e.theme || {}, o = n === void 0 ? t : e.parentEditor || null, i = e.disableEvents || !1, s = xo(), l = e.namespace || (o !== null ? o._config.namespace : fs()), a = e.editorState, c = [cn, kt, rn, on, Et, Co, ...e.nodes || []], { onError: u, html: h } = e, d = e.editable === void 0 || e.editable;
|
|
4560
4560
|
let f;
|
|
4561
4561
|
if (n === void 0 && t !== null)
|
|
4562
4562
|
f = t._nodes;
|
|
4563
4563
|
else {
|
|
4564
4564
|
f = /* @__PURE__ */ new Map();
|
|
4565
|
-
for (let
|
|
4566
|
-
let
|
|
4567
|
-
if (typeof
|
|
4568
|
-
const b =
|
|
4569
|
-
|
|
4565
|
+
for (let m = 0; m < c.length; m++) {
|
|
4566
|
+
let _ = c[m], x = null, y = null;
|
|
4567
|
+
if (typeof _ != "function") {
|
|
4568
|
+
const b = _;
|
|
4569
|
+
_ = b.replace, x = b.with, y = b.withKlass || null;
|
|
4570
4570
|
}
|
|
4571
|
-
const
|
|
4572
|
-
S !== null && w.add(S), f.set(
|
|
4571
|
+
const v = _.getType(), S = _.transform(), w = /* @__PURE__ */ new Set();
|
|
4572
|
+
S !== null && w.add(S), f.set(v, { exportDOM: h && h.export ? h.export.get(_) : void 0, klass: _, replace: x, replaceWithKlass: y, transforms: w });
|
|
4573
4573
|
}
|
|
4574
4574
|
}
|
|
4575
|
-
const g = new tr(s, o, f, { disableEvents: i, namespace: l, theme: r }, u || console.error, function(
|
|
4576
|
-
const x = /* @__PURE__ */ new Map(),
|
|
4575
|
+
const g = new tr(s, o, f, { disableEvents: i, namespace: l, theme: r }, u || console.error, function(m, _) {
|
|
4576
|
+
const x = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), v = (S) => {
|
|
4577
4577
|
Object.keys(S).forEach((w) => {
|
|
4578
4578
|
let b = x.get(w);
|
|
4579
4579
|
b === void 0 && (b = [], x.set(w, b)), b.push(S[w]);
|
|
4580
4580
|
});
|
|
4581
4581
|
};
|
|
4582
|
-
return
|
|
4582
|
+
return m.forEach((S) => {
|
|
4583
4583
|
const w = S.klass.importDOM;
|
|
4584
|
-
if (w == null ||
|
|
4584
|
+
if (w == null || y.has(w))
|
|
4585
4585
|
return;
|
|
4586
|
-
|
|
4586
|
+
y.add(w);
|
|
4587
4587
|
const b = w.call(S.klass);
|
|
4588
|
-
b !== null &&
|
|
4589
|
-
}),
|
|
4588
|
+
b !== null && v(b);
|
|
4589
|
+
}), _ && v(_), x;
|
|
4590
4590
|
}(f, h ? h.import : void 0), d);
|
|
4591
|
-
return a !== void 0 && (g._pendingEditorState = a, g._dirtyType =
|
|
4591
|
+
return a !== void 0 && (g._pendingEditorState = a, g._dirtyType = St), g;
|
|
4592
4592
|
}
|
|
4593
4593
|
class tr {
|
|
4594
4594
|
constructor(e, t, r, o, i, s, l) {
|
|
@@ -4715,41 +4715,41 @@ class tr {
|
|
|
4715
4715
|
const a = l.ownerDocument;
|
|
4716
4716
|
return a && a.defaultView || null;
|
|
4717
4717
|
}(e), s = e.style;
|
|
4718
|
-
s.userSelect = "text", s.whiteSpace = "pre-wrap", s.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = i, this._dirtyType =
|
|
4718
|
+
s.userSelect = "text", s.whiteSpace = "pre-wrap", s.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = i, this._dirtyType = St, is(this), this._updateTags.add("history-merge"), Ke(this), this._config.disableEvents || function(l, a) {
|
|
4719
4719
|
const c = l.ownerDocument, u = An.get(c);
|
|
4720
4720
|
(u === void 0 || u < 1) && c.addEventListener("selectionchange", Ns), An.set(c, (u || 0) + 1), l.__lexicalEditor = a;
|
|
4721
4721
|
const h = Es(l);
|
|
4722
4722
|
for (let d = 0; d < Mr.length; d++) {
|
|
4723
|
-
const [f, g] = Mr[d],
|
|
4724
|
-
ri(
|
|
4725
|
-
} : (
|
|
4726
|
-
if (ri(
|
|
4723
|
+
const [f, g] = Mr[d], m = typeof g == "function" ? (_) => {
|
|
4724
|
+
ri(_) || (ni(_), (a.isEditable() || f === "click") && g(_, a));
|
|
4725
|
+
} : (_) => {
|
|
4726
|
+
if (ri(_))
|
|
4727
4727
|
return;
|
|
4728
|
-
ni(
|
|
4728
|
+
ni(_);
|
|
4729
4729
|
const x = a.isEditable();
|
|
4730
4730
|
switch (f) {
|
|
4731
4731
|
case "cut":
|
|
4732
|
-
return x && F(a, Gr,
|
|
4732
|
+
return x && F(a, Gr, _);
|
|
4733
4733
|
case "copy":
|
|
4734
|
-
return F(a, zn,
|
|
4734
|
+
return F(a, zn, _);
|
|
4735
4735
|
case "paste":
|
|
4736
|
-
return x && F(a,
|
|
4736
|
+
return x && F(a, qr, _);
|
|
4737
4737
|
case "dragstart":
|
|
4738
|
-
return x && F(a, Xi,
|
|
4738
|
+
return x && F(a, Xi, _);
|
|
4739
4739
|
case "dragover":
|
|
4740
|
-
return x && F(a, Qi,
|
|
4740
|
+
return x && F(a, Qi, _);
|
|
4741
4741
|
case "dragend":
|
|
4742
|
-
return x && F(a, Ol,
|
|
4742
|
+
return x && F(a, Ol, _);
|
|
4743
4743
|
case "focus":
|
|
4744
|
-
return x && F(a, Il,
|
|
4744
|
+
return x && F(a, Il, _);
|
|
4745
4745
|
case "blur":
|
|
4746
|
-
return x && F(a, Fl,
|
|
4746
|
+
return x && F(a, Fl, _);
|
|
4747
4747
|
case "drop":
|
|
4748
|
-
return x && F(a, Gi,
|
|
4748
|
+
return x && F(a, Gi, _);
|
|
4749
4749
|
}
|
|
4750
4750
|
};
|
|
4751
|
-
l.addEventListener(f,
|
|
4752
|
-
l.removeEventListener(f,
|
|
4751
|
+
l.addEventListener(f, m), h.push(() => {
|
|
4752
|
+
l.removeEventListener(f, m);
|
|
4753
4753
|
});
|
|
4754
4754
|
}
|
|
4755
4755
|
}(e, this), r != null && e.classList.add(...r);
|
|
@@ -4767,7 +4767,7 @@ class tr {
|
|
|
4767
4767
|
setEditorState(e, t) {
|
|
4768
4768
|
e.isEmpty() && D(38), os(this);
|
|
4769
4769
|
const r = this._pendingEditorState, o = this._updateTags, i = t !== void 0 ? t.tag : null;
|
|
4770
|
-
r === null || r.isEmpty() || (i != null && o.add(i), Ke(this)), this._pendingEditorState = e, this._dirtyType =
|
|
4770
|
+
r === null || r.isEmpty() || (i != null && o.add(i), Ke(this)), this._pendingEditorState = e, this._dirtyType = St, this._dirtyElements.set("root", !1), this._compositionKey = null, i != null && o.add(i), Ke(this);
|
|
4771
4771
|
}
|
|
4772
4772
|
parseEditorState(e, t) {
|
|
4773
4773
|
return function(r, o, i) {
|
|
@@ -4849,8 +4849,8 @@ function ja({ initialConfig: n, children: e }) {
|
|
|
4849
4849
|
if (f.isEmpty()) {
|
|
4850
4850
|
const g = ke();
|
|
4851
4851
|
f.append(g);
|
|
4852
|
-
const
|
|
4853
|
-
(A() !== null ||
|
|
4852
|
+
const m = Bs ? document.activeElement : null;
|
|
4853
|
+
(A() !== null || m !== null && m === h.getRootElement()) && g.select();
|
|
4854
4854
|
}
|
|
4855
4855
|
}, gn);
|
|
4856
4856
|
else if (d !== null)
|
|
@@ -4956,8 +4956,8 @@ function Ks(n, e) {
|
|
|
4956
4956
|
const [r, o] = t, i = n.isBackward(), s = r.getNode(), l = o.getNode(), a = e.is(s), c = e.is(l);
|
|
4957
4957
|
if (a || c) {
|
|
4958
4958
|
const [u, h] = Br(n), d = s.is(l), f = e.is(i ? l : s), g = e.is(i ? s : l);
|
|
4959
|
-
let
|
|
4960
|
-
return d ? (
|
|
4959
|
+
let m, _ = 0;
|
|
4960
|
+
return d ? (_ = u > h ? h : u, m = u > h ? u : h) : f ? (_ = i ? h : u, m = void 0) : g && (_ = 0, m = i ? u : h), e.__text = e.__text.slice(_, m), e;
|
|
4961
4961
|
}
|
|
4962
4962
|
}
|
|
4963
4963
|
return e;
|
|
@@ -4968,7 +4968,7 @@ function Ci(n) {
|
|
|
4968
4968
|
const e = n.getNode();
|
|
4969
4969
|
return C(e) || Va(177), n.offset === e.getChildrenSize();
|
|
4970
4970
|
}
|
|
4971
|
-
function
|
|
4971
|
+
function Ha(n) {
|
|
4972
4972
|
const e = n.getStyle(), t = Ya(e);
|
|
4973
4973
|
Ja.set(e, t);
|
|
4974
4974
|
}
|
|
@@ -4976,7 +4976,7 @@ function bi(n, e) {
|
|
|
4976
4976
|
const t = Gt(n.focus, e);
|
|
4977
4977
|
return V(t) && !t.isIsolated() || C(t) && !t.isInline() && !t.canBeEmpty();
|
|
4978
4978
|
}
|
|
4979
|
-
function
|
|
4979
|
+
function qa(n, e, t, r) {
|
|
4980
4980
|
n.modify(e ? "extend" : "move", t, r);
|
|
4981
4981
|
}
|
|
4982
4982
|
function Ga(n) {
|
|
@@ -4985,7 +4985,7 @@ function Ga(n) {
|
|
|
4985
4985
|
}
|
|
4986
4986
|
function wi(n, e, t) {
|
|
4987
4987
|
const r = Ga(n);
|
|
4988
|
-
|
|
4988
|
+
qa(n, e, t ? !r : r, "character");
|
|
4989
4989
|
}
|
|
4990
4990
|
function Xa(n) {
|
|
4991
4991
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
@@ -4999,7 +4999,7 @@ var Qa = Xa(function(n) {
|
|
|
4999
4999
|
});
|
|
5000
5000
|
const Us = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Za = Us && "documentMode" in document ? document.documentMode : null;
|
|
5001
5001
|
!(!Us || !("InputEvent" in window) || Za) && "getTargetRanges" in new window.InputEvent("input");
|
|
5002
|
-
function
|
|
5002
|
+
function Nt(...n) {
|
|
5003
5003
|
return () => {
|
|
5004
5004
|
for (let e = n.length - 1; e >= 0; e--)
|
|
5005
5005
|
n[e]();
|
|
@@ -5023,7 +5023,7 @@ function Xe(n, e) {
|
|
|
5023
5023
|
return n !== null && Object.getPrototypeOf(n).constructor.name === e.name;
|
|
5024
5024
|
}
|
|
5025
5025
|
const Vs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? en : ue;
|
|
5026
|
-
function tc({ editor: n, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: r, ariaDescribedBy: o, ariaExpanded: i, ariaLabel: s, ariaLabelledBy: l, ariaMultiline: a, ariaOwns: c, ariaRequired: u, autoCapitalize: h, className: d, id: f, role: g = "textbox", spellCheck:
|
|
5026
|
+
function tc({ editor: n, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: r, ariaDescribedBy: o, ariaExpanded: i, ariaLabel: s, ariaLabelledBy: l, ariaMultiline: a, ariaOwns: c, ariaRequired: u, autoCapitalize: h, className: d, id: f, role: g = "textbox", spellCheck: m = !0, style: _, tabIndex: x, "data-testid": y, ...v }, S) {
|
|
5027
5027
|
const [w, b] = ne(n.isEditable()), N = Yt((P) => {
|
|
5028
5028
|
P && P.ownerDocument && P.ownerDocument.defaultView ? n.setRootElement(P) : n.setRootElement(null);
|
|
5029
5029
|
}, [n]), k = ot(() => function(...P) {
|
|
@@ -5035,7 +5035,7 @@ function tc({ editor: n, ariaActiveDescendant: e, ariaAutoComplete: t, ariaContr
|
|
|
5035
5035
|
}(S, N), [N, S]);
|
|
5036
5036
|
return Vs(() => (b(n.isEditable()), n.registerEditableListener((P) => {
|
|
5037
5037
|
b(P);
|
|
5038
|
-
})), [n]), T.jsx("div", { ...
|
|
5038
|
+
})), [n]), T.jsx("div", { ...v, "aria-activedescendant": w ? e : void 0, "aria-autocomplete": w ? t : "none", "aria-controls": w ? r : void 0, "aria-describedby": o, "aria-expanded": w && g === "combobox" ? !!i : void 0, "aria-label": s, "aria-labelledby": l, "aria-multiline": a, "aria-owns": w ? c : void 0, "aria-readonly": !w || void 0, "aria-required": u, autoCapitalize: h, className: d, contentEditable: w, "data-testid": y, id: f, ref: k, role: w ? g : void 0, spellCheck: m, style: _, tabIndex: x });
|
|
5039
5039
|
}
|
|
5040
5040
|
const nc = Wi(tc);
|
|
5041
5041
|
function Si(n) {
|
|
@@ -5054,7 +5054,7 @@ function ic({ content: n, editor: e }) {
|
|
|
5054
5054
|
const u = Si(s);
|
|
5055
5055
|
a(u);
|
|
5056
5056
|
}
|
|
5057
|
-
return c(),
|
|
5057
|
+
return c(), Nt(s.registerUpdateListener(() => {
|
|
5058
5058
|
c();
|
|
5059
5059
|
}), s.registerEditableListener(() => {
|
|
5060
5060
|
c();
|
|
@@ -5077,13 +5077,13 @@ function cc(n, e, t, r, o) {
|
|
|
5077
5077
|
return sc;
|
|
5078
5078
|
if (!(O(i) && O(s) && s.isCollapsed() && i.isCollapsed()))
|
|
5079
5079
|
return ve;
|
|
5080
|
-
const l = function(x,
|
|
5080
|
+
const l = function(x, y, v) {
|
|
5081
5081
|
const S = x._nodeMap, w = [];
|
|
5082
|
-
for (const b of
|
|
5082
|
+
for (const b of y) {
|
|
5083
5083
|
const N = S.get(b);
|
|
5084
5084
|
N !== void 0 && w.push(N);
|
|
5085
5085
|
}
|
|
5086
|
-
for (const [b, N] of
|
|
5086
|
+
for (const [b, N] of v) {
|
|
5087
5087
|
if (!N)
|
|
5088
5088
|
continue;
|
|
5089
5089
|
const k = S.get(b);
|
|
@@ -5094,8 +5094,8 @@ function cc(n, e, t, r, o) {
|
|
|
5094
5094
|
if (l.length === 0)
|
|
5095
5095
|
return ve;
|
|
5096
5096
|
if (l.length > 1) {
|
|
5097
|
-
const x = e._nodeMap,
|
|
5098
|
-
return
|
|
5097
|
+
const x = e._nodeMap, y = x.get(i.anchor.key), v = x.get(s.anchor.key);
|
|
5098
|
+
return y && v && !n._nodeMap.has(y.__key) && R(y) && y.__text.length === 1 && i.anchor.offset === 1 ? Ti : ve;
|
|
5099
5099
|
}
|
|
5100
5100
|
const a = l[0], c = n._nodeMap.get(a.__key);
|
|
5101
5101
|
if (!R(c) || !R(a) || c.__mode !== a.__mode)
|
|
@@ -5106,8 +5106,8 @@ function cc(n, e, t, r, o) {
|
|
|
5106
5106
|
const d = i.anchor, f = s.anchor;
|
|
5107
5107
|
if (d.key !== f.key || d.type !== "text")
|
|
5108
5108
|
return ve;
|
|
5109
|
-
const g = d.offset,
|
|
5110
|
-
return
|
|
5109
|
+
const g = d.offset, m = f.offset, _ = h.length - u.length;
|
|
5110
|
+
return _ === 1 && m === g - 1 ? Ti : _ === -1 && m === g + 1 ? lc : _ === -1 && m === g ? ac : ve;
|
|
5111
5111
|
}
|
|
5112
5112
|
function uc(n, e) {
|
|
5113
5113
|
let t = Date.now(), r = ve;
|
|
@@ -5121,11 +5121,11 @@ function uc(n, e) {
|
|
|
5121
5121
|
return pn;
|
|
5122
5122
|
if (o === null)
|
|
5123
5123
|
return Ur;
|
|
5124
|
-
const
|
|
5125
|
-
return l.size > 0 || a.size > 0 ? g === !1 && h !== ve && h === r && u < t + e && f || l.size === 1 && function(
|
|
5126
|
-
const
|
|
5127
|
-
return !(O(w) && O(b) && w.anchor.type === "element" && w.focus.type === "element" && b.anchor.type === "text" && b.focus.type === "text" || !R(
|
|
5128
|
-
}(Array.from(l)[0], o, i) ? pn : Ur :
|
|
5124
|
+
const m = i._selection;
|
|
5125
|
+
return l.size > 0 || a.size > 0 ? g === !1 && h !== ve && h === r && u < t + e && f || l.size === 1 && function(_, x, y) {
|
|
5126
|
+
const v = x._nodeMap.get(_), S = y._nodeMap.get(_), w = x._selection, b = y._selection;
|
|
5127
|
+
return !(O(w) && O(b) && w.anchor.type === "element" && w.focus.type === "element" && b.anchor.type === "text" && b.focus.type === "text" || !R(v) || !R(S) || v.__parent !== S.__parent) && JSON.stringify(x.read(() => v.exportJSON())) === JSON.stringify(y.read(() => S.exportJSON()));
|
|
5128
|
+
}(Array.from(l)[0], o, i) ? pn : Ur : m !== null ? pn : Vr;
|
|
5129
5129
|
})();
|
|
5130
5130
|
return t = u, r = h, d;
|
|
5131
5131
|
};
|
|
@@ -5135,27 +5135,27 @@ function ki(n) {
|
|
|
5135
5135
|
}
|
|
5136
5136
|
function dc(n, e, t) {
|
|
5137
5137
|
const r = uc(n, t);
|
|
5138
|
-
return
|
|
5138
|
+
return Nt(n.registerCommand(Wn, () => (function(i, s) {
|
|
5139
5139
|
const l = s.redoStack, a = s.undoStack;
|
|
5140
5140
|
if (a.length !== 0) {
|
|
5141
5141
|
const c = s.current, u = a.pop();
|
|
5142
|
-
c !== null && (l.push(c), i.dispatchCommand(
|
|
5142
|
+
c !== null && (l.push(c), i.dispatchCommand($t, !0)), a.length === 0 && i.dispatchCommand(Wt, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
|
|
5143
5143
|
}
|
|
5144
5144
|
}(n, e), !0), z), n.registerCommand(Bn, () => (function(i, s) {
|
|
5145
5145
|
const l = s.redoStack, a = s.undoStack;
|
|
5146
5146
|
if (l.length !== 0) {
|
|
5147
5147
|
const c = s.current;
|
|
5148
|
-
c !== null && (a.push(c), i.dispatchCommand(
|
|
5148
|
+
c !== null && (a.push(c), i.dispatchCommand(Wt, !0));
|
|
5149
5149
|
const u = l.pop();
|
|
5150
|
-
l.length === 0 && i.dispatchCommand(
|
|
5150
|
+
l.length === 0 && i.dispatchCommand($t, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
|
|
5151
5151
|
}
|
|
5152
|
-
}(n, e), !0), z), n.registerCommand(Dl, () => (ki(e), !1), z), n.registerCommand(Rl, () => (ki(e), n.dispatchCommand(
|
|
5152
|
+
}(n, e), !0), z), n.registerCommand(Dl, () => (ki(e), !1), z), n.registerCommand(Rl, () => (ki(e), n.dispatchCommand($t, !1), n.dispatchCommand(Wt, !1), !0), z), n.registerUpdateListener(({ editorState: i, prevEditorState: s, dirtyLeaves: l, dirtyElements: a, tags: c }) => {
|
|
5153
5153
|
const u = e.current, h = e.redoStack, d = e.undoStack, f = u === null ? null : u.editorState;
|
|
5154
5154
|
if (u !== null && i === f)
|
|
5155
5155
|
return;
|
|
5156
5156
|
const g = r(s, i, u, l, a, c);
|
|
5157
5157
|
if (g === Ur)
|
|
5158
|
-
h.length !== 0 && (e.redoStack = [], n.dispatchCommand(
|
|
5158
|
+
h.length !== 0 && (e.redoStack = [], n.dispatchCommand($t, !1)), u !== null && (d.push({ ...u }), n.dispatchCommand(Wt, !0));
|
|
5159
5159
|
else if (g === Vr)
|
|
5160
5160
|
return;
|
|
5161
5161
|
e.current = { editor: n, editorState: i };
|
|
@@ -5175,9 +5175,9 @@ const gc = typeof window < "u" && window.document !== void 0 && window.document.
|
|
|
5175
5175
|
function pc(n) {
|
|
5176
5176
|
return { initialValueFn: () => n.isEditable(), subscribe: (e) => n.registerEditableListener(e) };
|
|
5177
5177
|
}
|
|
5178
|
-
function
|
|
5178
|
+
function mc() {
|
|
5179
5179
|
return function(n) {
|
|
5180
|
-
const [e] = it(), t = ot(() => n(e), [e, n]), r =
|
|
5180
|
+
const [e] = it(), t = ot(() => n(e), [e, n]), r = wt(t.initialValueFn()), [o, i] = ne(r.current);
|
|
5181
5181
|
return gc(() => {
|
|
5182
5182
|
const { initialValueFn: s, subscribe: l } = t, a = s();
|
|
5183
5183
|
return r.current !== a && (r.current = a, i(a)), l((c) => {
|
|
@@ -5186,7 +5186,7 @@ function _c() {
|
|
|
5186
5186
|
}, [t, n]), o;
|
|
5187
5187
|
}(pc);
|
|
5188
5188
|
}
|
|
5189
|
-
function
|
|
5189
|
+
function _c(n) {
|
|
5190
5190
|
const e = window.location.origin, t = (r) => {
|
|
5191
5191
|
if (r.origin !== e)
|
|
5192
5192
|
return;
|
|
@@ -5208,14 +5208,14 @@ function mc(n) {
|
|
|
5208
5208
|
if (a) {
|
|
5209
5209
|
const [c, u, h, d, f, g] = a;
|
|
5210
5210
|
n.update(() => {
|
|
5211
|
-
const
|
|
5212
|
-
if (O(
|
|
5213
|
-
const
|
|
5214
|
-
let x =
|
|
5215
|
-
if (R(x) && c >= 0 && u >= 0 && (
|
|
5216
|
-
|
|
5211
|
+
const m = A();
|
|
5212
|
+
if (O(m)) {
|
|
5213
|
+
const _ = m.anchor;
|
|
5214
|
+
let x = _.getNode(), y = 0, v = 0;
|
|
5215
|
+
if (R(x) && c >= 0 && u >= 0 && (y = c, v = c + u, m.setTextNodeRange(x, y, x, v)), y === v && h === "" || (m.insertRawText(h), x = _.getNode()), R(x)) {
|
|
5216
|
+
y = d, v = d + f;
|
|
5217
5217
|
const S = x.getTextContentSize();
|
|
5218
|
-
|
|
5218
|
+
y = y > S ? S : y, v = v > S ? S : v, m.setTextNodeRange(x, y, x, v);
|
|
5219
5219
|
}
|
|
5220
5220
|
r.stopImmediatePropagation();
|
|
5221
5221
|
}
|
|
@@ -5236,7 +5236,7 @@ function yc(n, e) {
|
|
|
5236
5236
|
for (let i = 0; i < t.length; i++) {
|
|
5237
5237
|
const s = t[i];
|
|
5238
5238
|
if (!Ys.has(s.nodeName)) {
|
|
5239
|
-
const l =
|
|
5239
|
+
const l = Hs(s, n, o, !1);
|
|
5240
5240
|
l !== null && (r = r.concat(l));
|
|
5241
5241
|
}
|
|
5242
5242
|
}
|
|
@@ -5264,7 +5264,7 @@ function Js(n, e, t, r = null) {
|
|
|
5264
5264
|
const i = C(e) && e.excludeFromCopy("html");
|
|
5265
5265
|
let s = e;
|
|
5266
5266
|
if (r !== null) {
|
|
5267
|
-
let f =
|
|
5267
|
+
let f = mo(e);
|
|
5268
5268
|
f = R(f) && r !== null ? Ks(r, f) : f, s = f;
|
|
5269
5269
|
}
|
|
5270
5270
|
const l = C(s) ? s.getChildren() : [], a = n._nodes.get(s.getType());
|
|
@@ -5275,8 +5275,8 @@ function Js(n, e, t, r = null) {
|
|
|
5275
5275
|
return !1;
|
|
5276
5276
|
const d = document.createDocumentFragment();
|
|
5277
5277
|
for (let f = 0; f < l.length; f++) {
|
|
5278
|
-
const g = l[f],
|
|
5279
|
-
!o && C(e) &&
|
|
5278
|
+
const g = l[f], m = Js(n, g, d, r);
|
|
5279
|
+
!o && C(e) && m && e.extractWithChild(g, r, "html") && (o = !0);
|
|
5280
5280
|
}
|
|
5281
5281
|
if (o && !i) {
|
|
5282
5282
|
if (po(u) && u.append(d), t.append(u), h) {
|
|
@@ -5288,28 +5288,28 @@ function Js(n, e, t, r = null) {
|
|
|
5288
5288
|
return o;
|
|
5289
5289
|
}
|
|
5290
5290
|
const Ys = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
|
|
5291
|
-
function
|
|
5291
|
+
function Hs(n, e, t, r, o = /* @__PURE__ */ new Map(), i) {
|
|
5292
5292
|
let s = [];
|
|
5293
5293
|
if (Ys.has(n.nodeName))
|
|
5294
5294
|
return s;
|
|
5295
5295
|
let l = null;
|
|
5296
|
-
const a = function(g,
|
|
5297
|
-
const { nodeName:
|
|
5298
|
-
let
|
|
5296
|
+
const a = function(g, m) {
|
|
5297
|
+
const { nodeName: _ } = g, x = m._htmlConversions.get(_.toLowerCase());
|
|
5298
|
+
let y = null;
|
|
5299
5299
|
if (x !== void 0)
|
|
5300
|
-
for (const
|
|
5301
|
-
const S =
|
|
5302
|
-
S !== null && (
|
|
5300
|
+
for (const v of x) {
|
|
5301
|
+
const S = v(g);
|
|
5302
|
+
S !== null && (y === null || (y.priority || 0) < (S.priority || 0)) && (y = S);
|
|
5303
5303
|
}
|
|
5304
|
-
return
|
|
5304
|
+
return y !== null ? y.conversion : null;
|
|
5305
5305
|
}(n, e), c = a ? a(n) : null;
|
|
5306
5306
|
let u = null;
|
|
5307
5307
|
if (c !== null) {
|
|
5308
5308
|
u = c.after;
|
|
5309
5309
|
const g = c.node;
|
|
5310
5310
|
if (l = Array.isArray(g) ? g[g.length - 1] : g, l !== null) {
|
|
5311
|
-
for (const [,
|
|
5312
|
-
if (l =
|
|
5311
|
+
for (const [, m] of o)
|
|
5312
|
+
if (l = m(l, i), !l)
|
|
5313
5313
|
break;
|
|
5314
5314
|
l && s.push(...Array.isArray(g) ? g : [l]);
|
|
5315
5315
|
}
|
|
@@ -5317,9 +5317,9 @@ function qs(n, e, t, r, o = /* @__PURE__ */ new Map(), i) {
|
|
|
5317
5317
|
}
|
|
5318
5318
|
const h = n.childNodes;
|
|
5319
5319
|
let d = [];
|
|
5320
|
-
const f = (l == null || !
|
|
5320
|
+
const f = (l == null || !Tt(l)) && (l != null && zr(l) || r);
|
|
5321
5321
|
for (let g = 0; g < h.length; g++)
|
|
5322
|
-
d.push(...
|
|
5322
|
+
d.push(...Hs(h[g], e, t, f, new Map(o), l));
|
|
5323
5323
|
return u != null && (d = u(d)), Dn(n) && (d = xc(n, d, f ? () => {
|
|
5324
5324
|
const g = new Co();
|
|
5325
5325
|
return t.push(g), g;
|
|
@@ -5351,7 +5351,7 @@ var jn = Cc(function(n) {
|
|
|
5351
5351
|
e.append("v", arguments[t]);
|
|
5352
5352
|
throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
5353
5353
|
});
|
|
5354
|
-
const bc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0,
|
|
5354
|
+
const bc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, qs = (n) => bc ? (n || window).getSelection() : null;
|
|
5355
5355
|
function wc(n, e = A()) {
|
|
5356
5356
|
return e == null && jn(166), O(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : vc(n, e);
|
|
5357
5357
|
}
|
|
@@ -5399,7 +5399,7 @@ function Gs(n, e, t, r = []) {
|
|
|
5399
5399
|
const i = C(t) && t.excludeFromCopy("html");
|
|
5400
5400
|
let s = t;
|
|
5401
5401
|
if (e !== null) {
|
|
5402
|
-
let c =
|
|
5402
|
+
let c = mo(t);
|
|
5403
5403
|
c = R(c) && e !== null ? Ks(e, c) : c, s = c;
|
|
5404
5404
|
}
|
|
5405
5405
|
const l = C(s) ? s.getChildren() : [], a = function(c) {
|
|
@@ -5437,7 +5437,7 @@ function kc(n) {
|
|
|
5437
5437
|
const e = [];
|
|
5438
5438
|
for (let t = 0; t < n.length; t++) {
|
|
5439
5439
|
const r = n[t], o = Pa(r);
|
|
5440
|
-
R(o) &&
|
|
5440
|
+
R(o) && Ha(o), e.push(o);
|
|
5441
5441
|
}
|
|
5442
5442
|
return e;
|
|
5443
5443
|
}
|
|
@@ -5451,7 +5451,7 @@ async function Pi(n, e, t) {
|
|
|
5451
5451
|
a(Oi(n, e, t));
|
|
5452
5452
|
});
|
|
5453
5453
|
});
|
|
5454
|
-
const r = n.getRootElement(), o = n._window == null ? window.document : n._window.document, i =
|
|
5454
|
+
const r = n.getRootElement(), o = n._window == null ? window.document : n._window.document, i = qs(n._window);
|
|
5455
5455
|
if (r === null || i === null)
|
|
5456
5456
|
return !1;
|
|
5457
5457
|
const s = o.createElement("span");
|
|
@@ -5466,7 +5466,7 @@ async function Pi(n, e, t) {
|
|
|
5466
5466
|
}
|
|
5467
5467
|
function Oi(n, e, t) {
|
|
5468
5468
|
if (t === void 0) {
|
|
5469
|
-
const o =
|
|
5469
|
+
const o = qs(n._window);
|
|
5470
5470
|
if (!o)
|
|
5471
5471
|
return !1;
|
|
5472
5472
|
const i = o.anchorNode, s = o.focusNode;
|
|
@@ -5510,8 +5510,8 @@ function Di(n, e) {
|
|
|
5510
5510
|
}
|
|
5511
5511
|
return null;
|
|
5512
5512
|
}
|
|
5513
|
-
const
|
|
5514
|
-
function
|
|
5513
|
+
const Pt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = Pt && "documentMode" in document ? document.documentMode : null, Dc = !(!Pt || !("InputEvent" in window) || Oc) && "getTargetRanges" in new window.InputEvent("input"), Rc = Pt && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Ic = Pt && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Fc = Pt && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ac = Pt && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Fc, Ri = Cl();
|
|
5514
|
+
function mn(n) {
|
|
5515
5515
|
let e = null;
|
|
5516
5516
|
if (Xe(n, DragEvent) ? e = n.dataTransfer : Xe(n, ClipboardEvent) && (e = n.clipboardData), e === null)
|
|
5517
5517
|
return [!1, [], !1];
|
|
@@ -5535,24 +5535,24 @@ function Ii(n) {
|
|
|
5535
5535
|
}
|
|
5536
5536
|
return t.size > 0;
|
|
5537
5537
|
}
|
|
5538
|
-
function
|
|
5538
|
+
function _n(n) {
|
|
5539
5539
|
const e = tt(n);
|
|
5540
5540
|
return V(e);
|
|
5541
5541
|
}
|
|
5542
5542
|
function Lc(n) {
|
|
5543
|
-
return
|
|
5543
|
+
return Nt(n.registerCommand(zi, (e) => {
|
|
5544
5544
|
const t = A();
|
|
5545
5545
|
return !!xe(t) && (t.clear(), !0);
|
|
5546
5546
|
}, 0), n.registerCommand(Qe, (e) => {
|
|
5547
5547
|
const t = A();
|
|
5548
5548
|
return !!O(t) && (t.deleteCharacter(e), !0);
|
|
5549
|
-
}, z), n.registerCommand(
|
|
5549
|
+
}, z), n.registerCommand(Ht, (e) => {
|
|
5550
5550
|
const t = A();
|
|
5551
5551
|
return !!O(t) && (t.deleteWord(e), !0);
|
|
5552
|
-
}, z), n.registerCommand(
|
|
5552
|
+
}, z), n.registerCommand(qt, (e) => {
|
|
5553
5553
|
const t = A();
|
|
5554
5554
|
return !!O(t) && (t.deleteLine(e), !0);
|
|
5555
|
-
}, z), n.registerCommand(
|
|
5555
|
+
}, z), n.registerCommand(xt, (e) => {
|
|
5556
5556
|
const t = A();
|
|
5557
5557
|
if (typeof e == "string")
|
|
5558
5558
|
t !== null && t.insertText(e);
|
|
@@ -5571,10 +5571,10 @@ function Lc(n) {
|
|
|
5571
5571
|
}, z), n.registerCommand(Sr, () => {
|
|
5572
5572
|
const e = A();
|
|
5573
5573
|
return !!O(e) && (e.removeText(), !0);
|
|
5574
|
-
}, z), n.registerCommand(
|
|
5574
|
+
}, z), n.registerCommand(me, (e) => {
|
|
5575
5575
|
const t = A();
|
|
5576
5576
|
return !!O(t) && (t.formatText(e), !0);
|
|
5577
|
-
}, z), n.registerCommand(
|
|
5577
|
+
}, z), n.registerCommand(jt, (e) => {
|
|
5578
5578
|
const t = A();
|
|
5579
5579
|
if (!O(t) && !xe(t))
|
|
5580
5580
|
return !1;
|
|
@@ -5584,7 +5584,7 @@ function Lc(n) {
|
|
|
5584
5584
|
i !== null && i.setFormat(e);
|
|
5585
5585
|
}
|
|
5586
5586
|
return !0;
|
|
5587
|
-
}, z), n.registerCommand(
|
|
5587
|
+
}, z), n.registerCommand(vt, (e) => {
|
|
5588
5588
|
const t = A();
|
|
5589
5589
|
return !!O(t) && (t.insertLineBreak(e), !0);
|
|
5590
5590
|
}, z), n.registerCommand(bn, () => {
|
|
@@ -5598,7 +5598,7 @@ function Lc(n) {
|
|
|
5598
5598
|
t > 0 && e.setIndent(t - 1);
|
|
5599
5599
|
}), z), n.registerCommand(Vi, (e) => {
|
|
5600
5600
|
const t = A();
|
|
5601
|
-
if (xe(t) && !
|
|
5601
|
+
if (xe(t) && !_n(e.target)) {
|
|
5602
5602
|
const r = t.getNodes();
|
|
5603
5603
|
if (r.length > 0)
|
|
5604
5604
|
return r[0].selectPrevious(), !0;
|
|
@@ -5641,7 +5641,7 @@ function Lc(n) {
|
|
|
5641
5641
|
return !1;
|
|
5642
5642
|
}, z), n.registerCommand(Ki, (e) => {
|
|
5643
5643
|
const t = A();
|
|
5644
|
-
if (xe(t) && !
|
|
5644
|
+
if (xe(t) && !_n(e.target)) {
|
|
5645
5645
|
const o = t.getNodes();
|
|
5646
5646
|
if (o.length > 0)
|
|
5647
5647
|
return e.preventDefault(), o[0].selectNext(0, 0), !0;
|
|
@@ -5651,7 +5651,7 @@ function Lc(n) {
|
|
|
5651
5651
|
const r = e.shiftKey;
|
|
5652
5652
|
return !!bi(t, !1) && (e.preventDefault(), wi(t, r, !1), !0);
|
|
5653
5653
|
}, z), n.registerCommand(Yi, (e) => {
|
|
5654
|
-
if (
|
|
5654
|
+
if (_n(e.target))
|
|
5655
5655
|
return !1;
|
|
5656
5656
|
const t = A();
|
|
5657
5657
|
if (!O(t))
|
|
@@ -5659,8 +5659,8 @@ function Lc(n) {
|
|
|
5659
5659
|
e.preventDefault();
|
|
5660
5660
|
const { anchor: r } = t, o = r.getNode();
|
|
5661
5661
|
return t.isCollapsed() && r.offset === 0 && !ie(o) && ec(o).getIndent() > 0 ? n.dispatchCommand($o, void 0) : n.dispatchCommand(Qe, !0);
|
|
5662
|
-
}, z), n.registerCommand(
|
|
5663
|
-
if (
|
|
5662
|
+
}, z), n.registerCommand(qi, (e) => {
|
|
5663
|
+
if (_n(e.target))
|
|
5664
5664
|
return !1;
|
|
5665
5665
|
const t = A();
|
|
5666
5666
|
return !!O(t) && (e.preventDefault(), n.dispatchCommand(Qe, !1));
|
|
@@ -5672,14 +5672,14 @@ function Lc(n) {
|
|
|
5672
5672
|
if ((Ic || Rc || Ac) && Dc)
|
|
5673
5673
|
return !1;
|
|
5674
5674
|
if (e.preventDefault(), e.shiftKey)
|
|
5675
|
-
return n.dispatchCommand(
|
|
5675
|
+
return n.dispatchCommand(vt, !1);
|
|
5676
5676
|
}
|
|
5677
5677
|
return n.dispatchCommand(bn, void 0);
|
|
5678
|
-
}, z), n.registerCommand(
|
|
5678
|
+
}, z), n.registerCommand(Hi, () => {
|
|
5679
5679
|
const e = A();
|
|
5680
5680
|
return !!O(e) && (n.blur(), !0);
|
|
5681
5681
|
}, z), n.registerCommand(Gi, (e) => {
|
|
5682
|
-
const [, t] =
|
|
5682
|
+
const [, t] = mn(e);
|
|
5683
5683
|
if (t.length > 0) {
|
|
5684
5684
|
const o = Di(e.clientX, e.clientY);
|
|
5685
5685
|
if (o !== null) {
|
|
@@ -5702,10 +5702,10 @@ function Lc(n) {
|
|
|
5702
5702
|
const r = A();
|
|
5703
5703
|
return !!O(r);
|
|
5704
5704
|
}, z), n.registerCommand(Xi, (e) => {
|
|
5705
|
-
const [t] =
|
|
5705
|
+
const [t] = mn(e), r = A();
|
|
5706
5706
|
return !(t && !O(r));
|
|
5707
5707
|
}, z), n.registerCommand(Qi, (e) => {
|
|
5708
|
-
const [t] =
|
|
5708
|
+
const [t] = mn(e), r = A();
|
|
5709
5709
|
if (t && !O(r))
|
|
5710
5710
|
return !1;
|
|
5711
5711
|
const o = Di(e.clientX, e.clientY);
|
|
@@ -5719,8 +5719,8 @@ function Lc(n) {
|
|
|
5719
5719
|
const o = A();
|
|
5720
5720
|
O(o) ? o.removeText() : xe(o) && o.getNodes().forEach((i) => i.remove());
|
|
5721
5721
|
});
|
|
5722
|
-
}(e, n), !0), z), n.registerCommand(
|
|
5723
|
-
const [, t, r] =
|
|
5722
|
+
}(e, n), !0), z), n.registerCommand(qr, (e) => {
|
|
5723
|
+
const [, t, r] = mn(e);
|
|
5724
5724
|
return t.length > 0 && !r ? (n.dispatchCommand(Ri, t), !0) : lo(e.target) ? !1 : A() !== null && (function(o, i) {
|
|
5725
5725
|
o.preventDefault(), i.update(() => {
|
|
5726
5726
|
const s = A(), l = Xe(o, InputEvent) || Xe(o, KeyboardEvent) ? null : o.clipboardData;
|
|
@@ -5745,14 +5745,14 @@ function Mc({ contentEditable: n, placeholder: e = null, ErrorBoundary: t }) {
|
|
|
5745
5745
|
}, [i]), ot(() => {
|
|
5746
5746
|
const c = [], u = Object.keys(l);
|
|
5747
5747
|
for (let h = 0; h < u.length; h++) {
|
|
5748
|
-
const d = u[h], f = T.jsx(s, { onError: (
|
|
5749
|
-
g !== null && c.push(
|
|
5748
|
+
const d = u[h], f = T.jsx(s, { onError: (m) => i._onError(m), children: T.jsx(_l, { fallback: null, children: l[d] }) }), g = i.getElementByKey(d);
|
|
5749
|
+
g !== null && c.push(Hr(f, g, d));
|
|
5750
5750
|
}
|
|
5751
5751
|
return c;
|
|
5752
5752
|
}, [s, l, i]);
|
|
5753
5753
|
}(r, t);
|
|
5754
5754
|
return function(i) {
|
|
5755
|
-
Jr(() =>
|
|
5755
|
+
Jr(() => Nt(Lc(i), _c(i)), [i]);
|
|
5756
5756
|
}(r), T.jsxs(T.Fragment, { children: [n, T.jsx(jc, { content: e }), o] });
|
|
5757
5757
|
}
|
|
5758
5758
|
function jc({ content: n }) {
|
|
@@ -5763,13 +5763,13 @@ function jc({ content: n }) {
|
|
|
5763
5763
|
const a = Fi(o);
|
|
5764
5764
|
s(a);
|
|
5765
5765
|
}
|
|
5766
|
-
return l(),
|
|
5766
|
+
return l(), Nt(o.registerUpdateListener(() => {
|
|
5767
5767
|
l();
|
|
5768
5768
|
}), o.registerEditableListener(() => {
|
|
5769
5769
|
l();
|
|
5770
5770
|
}));
|
|
5771
5771
|
}, [o]), i;
|
|
5772
|
-
}(e), r =
|
|
5772
|
+
}(e), r = mc();
|
|
5773
5773
|
return t ? typeof n == "function" ? n(r) : n : null;
|
|
5774
5774
|
}
|
|
5775
5775
|
function Yr(n, e) {
|
|
@@ -5806,21 +5806,21 @@ var Ai = { error: null }, $c = function(n) {
|
|
|
5806
5806
|
var i = this.state.error, s = this.props, l = s.fallbackRender, a = s.FallbackComponent, c = s.fallback;
|
|
5807
5807
|
if (i !== null) {
|
|
5808
5808
|
var u = { error: i, resetErrorBoundary: this.resetErrorBoundary };
|
|
5809
|
-
if (
|
|
5809
|
+
if (yt.isValidElement(c))
|
|
5810
5810
|
return c;
|
|
5811
5811
|
if (typeof l == "function")
|
|
5812
5812
|
return l(u);
|
|
5813
5813
|
if (a)
|
|
5814
|
-
return
|
|
5814
|
+
return yt.createElement(a, u);
|
|
5815
5815
|
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
5816
5816
|
}
|
|
5817
5817
|
return this.props.children;
|
|
5818
5818
|
}, r;
|
|
5819
|
-
}(
|
|
5819
|
+
}(yt.Component);
|
|
5820
5820
|
function Wc({ children: n, onError: e }) {
|
|
5821
5821
|
return T.jsx($c, { fallback: T.jsx("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: n });
|
|
5822
5822
|
}
|
|
5823
|
-
var Te = /* @__PURE__ */ ((n) => (n.normal = "
|
|
5823
|
+
var Te = /* @__PURE__ */ ((n) => (n.normal = "96px", n.narrow = "48px", n.moderate = "96px 72px", n.wide = "96px 192px", n))(Te || {});
|
|
5824
5824
|
const Bc = ji({
|
|
5825
5825
|
margin: { bottom: "", left: "", right: "", top: "" },
|
|
5826
5826
|
pageMarginValue: "",
|
|
@@ -5835,7 +5835,7 @@ function zc({
|
|
|
5835
5835
|
title: t,
|
|
5836
5836
|
closeOnClickOutside: r
|
|
5837
5837
|
}) {
|
|
5838
|
-
const o =
|
|
5838
|
+
const o = wt(null);
|
|
5839
5839
|
return ue(() => {
|
|
5840
5840
|
o.current !== null && o.current.focus();
|
|
5841
5841
|
}, []), ue(() => {
|
|
@@ -5870,7 +5870,7 @@ function Kc({
|
|
|
5870
5870
|
title: t,
|
|
5871
5871
|
closeOnClickOutside: r = !1
|
|
5872
5872
|
}) {
|
|
5873
|
-
return
|
|
5873
|
+
return Hr(
|
|
5874
5874
|
/* @__PURE__ */ T.jsx(
|
|
5875
5875
|
zc,
|
|
5876
5876
|
{
|
|
@@ -5911,14 +5911,14 @@ function Uc() {
|
|
|
5911
5911
|
);
|
|
5912
5912
|
return [r, o];
|
|
5913
5913
|
}
|
|
5914
|
-
const Xs =
|
|
5915
|
-
function
|
|
5914
|
+
const Xs = yt.createContext(null), Li = 4;
|
|
5915
|
+
function Mt({
|
|
5916
5916
|
children: n,
|
|
5917
5917
|
className: e,
|
|
5918
5918
|
onClick: t,
|
|
5919
5919
|
title: r
|
|
5920
5920
|
}) {
|
|
5921
|
-
const o =
|
|
5921
|
+
const o = wt(null), i = yt.useContext(Xs);
|
|
5922
5922
|
if (i === null)
|
|
5923
5923
|
throw new Error("DropDownItem must be used within a DropDown");
|
|
5924
5924
|
const { registerItem: s } = i;
|
|
@@ -5975,15 +5975,15 @@ function Jc({
|
|
|
5975
5975
|
children: i,
|
|
5976
5976
|
stopCloseOnClickSelf: s
|
|
5977
5977
|
}) {
|
|
5978
|
-
const l =
|
|
5978
|
+
const l = wt(null), a = wt(null), [c, u] = ne(!1), h = () => {
|
|
5979
5979
|
u(!1), a && a.current && a.current.focus();
|
|
5980
5980
|
};
|
|
5981
5981
|
return ue(() => {
|
|
5982
5982
|
const d = a.current, f = l.current;
|
|
5983
5983
|
if (c && d !== null && f !== null) {
|
|
5984
|
-
const { top: g, left:
|
|
5984
|
+
const { top: g, left: m } = d.getBoundingClientRect();
|
|
5985
5985
|
f.style.top = `${g + d.offsetHeight + Li}px`, f.style.left = `${Math.min(
|
|
5986
|
-
|
|
5986
|
+
m,
|
|
5987
5987
|
window.innerWidth - f.offsetWidth - 20
|
|
5988
5988
|
)}px`;
|
|
5989
5989
|
}
|
|
@@ -5991,8 +5991,8 @@ function Jc({
|
|
|
5991
5991
|
const d = a.current;
|
|
5992
5992
|
if (d !== null && c) {
|
|
5993
5993
|
const f = (g) => {
|
|
5994
|
-
const
|
|
5995
|
-
s && l.current && l.current.contains(
|
|
5994
|
+
const m = g.target;
|
|
5995
|
+
s && l.current && l.current.contains(m) || d.contains(m) || u(!1);
|
|
5996
5996
|
};
|
|
5997
5997
|
return document.addEventListener("click", f), () => {
|
|
5998
5998
|
document.removeEventListener("click", f);
|
|
@@ -6003,8 +6003,8 @@ function Jc({
|
|
|
6003
6003
|
if (c) {
|
|
6004
6004
|
const f = a.current, g = l.current;
|
|
6005
6005
|
if (f !== null && g !== null) {
|
|
6006
|
-
const { top:
|
|
6007
|
-
|
|
6006
|
+
const { top: m } = f.getBoundingClientRect(), _ = m + f.offsetHeight + Li;
|
|
6007
|
+
_ !== g.getBoundingClientRect().top && (g.style.top = `${_}px`);
|
|
6008
6008
|
}
|
|
6009
6009
|
}
|
|
6010
6010
|
};
|
|
@@ -6028,7 +6028,7 @@ function Jc({
|
|
|
6028
6028
|
]
|
|
6029
6029
|
}
|
|
6030
6030
|
),
|
|
6031
|
-
c &&
|
|
6031
|
+
c && Hr(
|
|
6032
6032
|
/* @__PURE__ */ T.jsx(Vc, { dropDownRef: l, onClose: h, children: i }),
|
|
6033
6033
|
document.body
|
|
6034
6034
|
)
|
|
@@ -6037,7 +6037,7 @@ function Jc({
|
|
|
6037
6037
|
function Yc(...n) {
|
|
6038
6038
|
return n.filter(Boolean).join(" ");
|
|
6039
6039
|
}
|
|
6040
|
-
function
|
|
6040
|
+
function Hc({
|
|
6041
6041
|
"data-test-id": n,
|
|
6042
6042
|
children: e,
|
|
6043
6043
|
className: t,
|
|
@@ -6064,7 +6064,7 @@ function qc({
|
|
|
6064
6064
|
}
|
|
6065
6065
|
);
|
|
6066
6066
|
}
|
|
6067
|
-
function
|
|
6067
|
+
function qc({
|
|
6068
6068
|
"data-test-id": n,
|
|
6069
6069
|
children: e
|
|
6070
6070
|
}) {
|
|
@@ -6098,9 +6098,24 @@ function yn({
|
|
|
6098
6098
|
] });
|
|
6099
6099
|
}
|
|
6100
6100
|
const Gc = ({ onClose: n }) => {
|
|
6101
|
-
const { margin: e, updatePageMarginValue: t, updateCustomMargin: r } = nr(), o = () => {
|
|
6102
|
-
const { top:
|
|
6103
|
-
|
|
6101
|
+
const { margin: e, updatePageMarginValue: t, updateCustomMargin: r } = nr(), [o, i] = yt.useState(""), s = () => {
|
|
6102
|
+
const { top: h, right: d, bottom: f, left: g } = e, m = (816 - 100) / 2, _ = (1156 - 25) / 2, x = [];
|
|
6103
|
+
if (+h * 96 > _ && x.push(
|
|
6104
|
+
`*Top margin is too large, maximum allowed is ${(_ / 96).toFixed(2)} inches.`
|
|
6105
|
+
), +d * 96 > m && x.push(
|
|
6106
|
+
`*Right margin is too large, maximum allowed is ${(m / 96).toFixed(2)} inches.`
|
|
6107
|
+
), +f * 96 > _ && x.push(
|
|
6108
|
+
`*Bottom margin is too large, maximum allowed is ${(_ / 96).toFixed(2)} inches.`
|
|
6109
|
+
), +g * 96 > m && x.push(
|
|
6110
|
+
`*Left margin is too large, maximum allowed is ${(m / 96).toFixed(2)} inches.`
|
|
6111
|
+
), x != null && x.length) {
|
|
6112
|
+
i(x.join(`
|
|
6113
|
+
`));
|
|
6114
|
+
return;
|
|
6115
|
+
} else {
|
|
6116
|
+
const y = `${+h * 96}px ${+d * 96}px ${+f * 96}px ${+g * 96}px`;
|
|
6117
|
+
t(y), n();
|
|
6118
|
+
}
|
|
6104
6119
|
};
|
|
6105
6120
|
return /* @__PURE__ */ T.jsxs(T.Fragment, { children: [
|
|
6106
6121
|
/* @__PURE__ */ T.jsx(
|
|
@@ -6147,7 +6162,8 @@ const Gc = ({ onClose: n }) => {
|
|
|
6147
6162
|
name: "left"
|
|
6148
6163
|
}
|
|
6149
6164
|
),
|
|
6150
|
-
/* @__PURE__ */ T.jsx(
|
|
6165
|
+
/* @__PURE__ */ T.jsx("div", { style: { color: "red", whiteSpace: "pre-line" }, children: o }),
|
|
6166
|
+
/* @__PURE__ */ T.jsx(qc, { "data-test-id": "table-model-confirm-insert", children: /* @__PURE__ */ T.jsx(Hc, { onClick: s, children: "Confirm" }) })
|
|
6151
6167
|
] });
|
|
6152
6168
|
}, vn = (n) => n ? "active dropdown-item-active" : "", Xc = ({ isEditable: n }) => {
|
|
6153
6169
|
const { pageMarginValue: e, updatePageMarginValue: t } = nr(), [r, o] = Uc();
|
|
@@ -6162,7 +6178,7 @@ const Gc = ({ onClose: n }) => {
|
|
|
6162
6178
|
buttonIconClassName: " plus",
|
|
6163
6179
|
children: [
|
|
6164
6180
|
/* @__PURE__ */ T.jsx(
|
|
6165
|
-
|
|
6181
|
+
Mt,
|
|
6166
6182
|
{
|
|
6167
6183
|
onClick: () => t(Te.normal),
|
|
6168
6184
|
className: "item " + vn(e === Te.normal),
|
|
@@ -6170,7 +6186,7 @@ const Gc = ({ onClose: n }) => {
|
|
|
6170
6186
|
}
|
|
6171
6187
|
),
|
|
6172
6188
|
/* @__PURE__ */ T.jsx(
|
|
6173
|
-
|
|
6189
|
+
Mt,
|
|
6174
6190
|
{
|
|
6175
6191
|
onClick: () => t(Te.narrow),
|
|
6176
6192
|
className: "item " + vn(e === Te.narrow),
|
|
@@ -6178,7 +6194,7 @@ const Gc = ({ onClose: n }) => {
|
|
|
6178
6194
|
}
|
|
6179
6195
|
),
|
|
6180
6196
|
/* @__PURE__ */ T.jsx(
|
|
6181
|
-
|
|
6197
|
+
Mt,
|
|
6182
6198
|
{
|
|
6183
6199
|
onClick: () => t(Te.moderate),
|
|
6184
6200
|
className: "item " + vn(e === Te.moderate),
|
|
@@ -6186,7 +6202,7 @@ const Gc = ({ onClose: n }) => {
|
|
|
6186
6202
|
}
|
|
6187
6203
|
),
|
|
6188
6204
|
/* @__PURE__ */ T.jsx(
|
|
6189
|
-
|
|
6205
|
+
Mt,
|
|
6190
6206
|
{
|
|
6191
6207
|
onClick: () => t(Te.wide),
|
|
6192
6208
|
className: "item " + vn(e === Te.wide),
|
|
@@ -6194,7 +6210,7 @@ const Gc = ({ onClose: n }) => {
|
|
|
6194
6210
|
}
|
|
6195
6211
|
),
|
|
6196
6212
|
/* @__PURE__ */ T.jsx(
|
|
6197
|
-
|
|
6213
|
+
Mt,
|
|
6198
6214
|
{
|
|
6199
6215
|
onClick: () => {
|
|
6200
6216
|
o("Custom Margin", (i) => /* @__PURE__ */ T.jsx(Gc, { onClose: i }));
|
|
@@ -6226,43 +6242,43 @@ function br() {
|
|
|
6226
6242
|
return /* @__PURE__ */ T.jsx("div", { className: "divider" });
|
|
6227
6243
|
}
|
|
6228
6244
|
function eu() {
|
|
6229
|
-
const [n] = it(), { updatePageMarginValue: e } = nr(), t =
|
|
6230
|
-
function x(
|
|
6231
|
-
}
|
|
6232
|
-
const
|
|
6233
|
-
const
|
|
6234
|
-
if (O(
|
|
6235
|
-
const S = Zc(
|
|
6236
|
-
a(
|
|
6245
|
+
const [n] = it(), { updatePageMarginValue: e } = nr(), t = wt(null), [r, o] = ne(!1), [i, s] = ne(!1), [l, a] = ne(!1), [c, u] = ne(!1), [h, d] = ne(!1), [f, g] = ne(!1), [m, _] = ne(() => n.isEditable());
|
|
6246
|
+
function x(v) {
|
|
6247
|
+
}
|
|
6248
|
+
const y = Yt(() => {
|
|
6249
|
+
const v = A();
|
|
6250
|
+
if (O(v)) {
|
|
6251
|
+
const S = Zc(v), w = S.getParent();
|
|
6252
|
+
a(v.hasFormat("bold")), u(v.hasFormat("italic")), d(v.hasFormat("underline")), g(v.hasFormat("strikethrough"));
|
|
6237
6253
|
let b;
|
|
6238
|
-
|
|
6254
|
+
bt(w) && (b = Qc(
|
|
6239
6255
|
S,
|
|
6240
6256
|
(N) => C(N) && !N.isInline()
|
|
6241
6257
|
)), C(b) ? b.getFormatType() : C(S) ? S.getFormatType() : w != null && w.getFormatType(), e(Te);
|
|
6242
6258
|
}
|
|
6243
6259
|
}, []);
|
|
6244
|
-
return ue(() =>
|
|
6245
|
-
n.registerUpdateListener(({ editorState:
|
|
6246
|
-
|
|
6247
|
-
|
|
6260
|
+
return ue(() => Nt(
|
|
6261
|
+
n.registerUpdateListener(({ editorState: v }) => {
|
|
6262
|
+
v.read(() => {
|
|
6263
|
+
y();
|
|
6248
6264
|
});
|
|
6249
6265
|
}),
|
|
6250
6266
|
n.registerCommand(
|
|
6251
6267
|
$n,
|
|
6252
|
-
(
|
|
6268
|
+
(v, S) => (y(), !1),
|
|
6253
6269
|
Cr
|
|
6254
6270
|
),
|
|
6255
6271
|
n.registerCommand(
|
|
6256
|
-
|
|
6257
|
-
(
|
|
6272
|
+
Wt,
|
|
6273
|
+
(v) => (o(v), !1),
|
|
6258
6274
|
Cr
|
|
6259
6275
|
),
|
|
6260
6276
|
n.registerCommand(
|
|
6261
|
-
|
|
6262
|
-
(
|
|
6277
|
+
$t,
|
|
6278
|
+
(v) => (s(v), !1),
|
|
6263
6279
|
Cr
|
|
6264
6280
|
)
|
|
6265
|
-
), [n,
|
|
6281
|
+
), [n, y]), /* @__PURE__ */ T.jsxs("div", { className: "toolbar", ref: t, children: [
|
|
6266
6282
|
/* @__PURE__ */ T.jsx(
|
|
6267
6283
|
"button",
|
|
6268
6284
|
{
|
|
@@ -6292,7 +6308,7 @@ function eu() {
|
|
|
6292
6308
|
"button",
|
|
6293
6309
|
{
|
|
6294
6310
|
onClick: () => {
|
|
6295
|
-
n.dispatchCommand(
|
|
6311
|
+
n.dispatchCommand(me, "bold");
|
|
6296
6312
|
},
|
|
6297
6313
|
className: "toolbar-item spaced " + (l ? "active" : ""),
|
|
6298
6314
|
"aria-label": "Format Bold",
|
|
@@ -6303,7 +6319,7 @@ function eu() {
|
|
|
6303
6319
|
"button",
|
|
6304
6320
|
{
|
|
6305
6321
|
onClick: () => {
|
|
6306
|
-
n.dispatchCommand(
|
|
6322
|
+
n.dispatchCommand(me, "italic");
|
|
6307
6323
|
},
|
|
6308
6324
|
className: "toolbar-item spaced " + (c ? "active" : ""),
|
|
6309
6325
|
"aria-label": "Format Italics",
|
|
@@ -6314,7 +6330,7 @@ function eu() {
|
|
|
6314
6330
|
"button",
|
|
6315
6331
|
{
|
|
6316
6332
|
onClick: () => {
|
|
6317
|
-
n.dispatchCommand(
|
|
6333
|
+
n.dispatchCommand(me, "underline");
|
|
6318
6334
|
},
|
|
6319
6335
|
className: "toolbar-item spaced " + (h ? "active" : ""),
|
|
6320
6336
|
"aria-label": "Format Underline",
|
|
@@ -6325,7 +6341,7 @@ function eu() {
|
|
|
6325
6341
|
"button",
|
|
6326
6342
|
{
|
|
6327
6343
|
onClick: () => {
|
|
6328
|
-
n.dispatchCommand(
|
|
6344
|
+
n.dispatchCommand(me, "strikethrough");
|
|
6329
6345
|
},
|
|
6330
6346
|
className: "toolbar-item spaced " + (f ? "active" : ""),
|
|
6331
6347
|
"aria-label": "Format Strikethrough",
|
|
@@ -6337,7 +6353,7 @@ function eu() {
|
|
|
6337
6353
|
"button",
|
|
6338
6354
|
{
|
|
6339
6355
|
onClick: () => {
|
|
6340
|
-
n.dispatchCommand(
|
|
6356
|
+
n.dispatchCommand(jt, "left");
|
|
6341
6357
|
},
|
|
6342
6358
|
className: "toolbar-item spaced",
|
|
6343
6359
|
"aria-label": "Left Align",
|
|
@@ -6348,7 +6364,7 @@ function eu() {
|
|
|
6348
6364
|
"button",
|
|
6349
6365
|
{
|
|
6350
6366
|
onClick: () => {
|
|
6351
|
-
n.dispatchCommand(
|
|
6367
|
+
n.dispatchCommand(jt, "center");
|
|
6352
6368
|
},
|
|
6353
6369
|
className: "toolbar-item spaced",
|
|
6354
6370
|
"aria-label": "Center Align",
|
|
@@ -6359,7 +6375,7 @@ function eu() {
|
|
|
6359
6375
|
"button",
|
|
6360
6376
|
{
|
|
6361
6377
|
onClick: () => {
|
|
6362
|
-
n.dispatchCommand(
|
|
6378
|
+
n.dispatchCommand(jt, "right");
|
|
6363
6379
|
},
|
|
6364
6380
|
className: "toolbar-item spaced",
|
|
6365
6381
|
"aria-label": "Right Align",
|
|
@@ -6370,7 +6386,7 @@ function eu() {
|
|
|
6370
6386
|
"button",
|
|
6371
6387
|
{
|
|
6372
6388
|
onClick: () => {
|
|
6373
|
-
n.dispatchCommand(
|
|
6389
|
+
n.dispatchCommand(jt, "justify");
|
|
6374
6390
|
},
|
|
6375
6391
|
className: "toolbar-item",
|
|
6376
6392
|
"aria-label": "Justify Align",
|
|
@@ -6379,7 +6395,7 @@ function eu() {
|
|
|
6379
6395
|
),
|
|
6380
6396
|
" ",
|
|
6381
6397
|
/* @__PURE__ */ T.jsx(br, {}),
|
|
6382
|
-
/* @__PURE__ */ T.jsx(Xc, { isEditable:
|
|
6398
|
+
/* @__PURE__ */ T.jsx(Xc, { isEditable: m })
|
|
6383
6399
|
] });
|
|
6384
6400
|
}
|
|
6385
6401
|
const tu = {
|