@qwanyx/stack 0.2.19 → 0.2.21
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.cjs.js +14 -14
- package/dist/index.esm.js +287 -289
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Rl = Object.defineProperty;
|
|
|
2
2
|
var jl = (r, e, t) => e in r ? Rl(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var or = (r, e, t) => jl(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as ss from "react";
|
|
5
|
-
import Ks, { useState as Q, useCallback as Z, useEffect as
|
|
5
|
+
import Ks, { useState as Q, useCallback as Z, useEffect as ge, useMemo as Pt, useRef as bs, createContext as Il, useContext as Ml, useLayoutEffect as er, Suspense as $l, forwardRef as Qo } from "react";
|
|
6
6
|
import { flushSync as ql, createPortal as zl } from "react-dom";
|
|
7
7
|
class cf {
|
|
8
8
|
constructor(e) {
|
|
@@ -3919,7 +3919,7 @@ function da(r, e, t = {}) {
|
|
|
3919
3919
|
}
|
|
3920
3920
|
}
|
|
3921
3921
|
}, [r, JSON.stringify(e), n, o, i]);
|
|
3922
|
-
return
|
|
3922
|
+
return ge(() => {
|
|
3923
3923
|
s && h();
|
|
3924
3924
|
}, [h, s]), {
|
|
3925
3925
|
data: u,
|
|
@@ -4097,18 +4097,18 @@ function ha() {
|
|
|
4097
4097
|
}
|
|
4098
4098
|
return null;
|
|
4099
4099
|
}
|
|
4100
|
-
var I = Object.assign, W = 0,
|
|
4101
|
-
function
|
|
4100
|
+
var I = Object.assign, W = 0, ee, Se, Me, vt, ut, ae, Xe;
|
|
4101
|
+
function $e() {
|
|
4102
4102
|
}
|
|
4103
|
-
|
|
4103
|
+
$e.__reactDisabledLog = !0;
|
|
4104
4104
|
function lt() {
|
|
4105
4105
|
{
|
|
4106
4106
|
if (W === 0) {
|
|
4107
|
-
|
|
4107
|
+
ee = console.log, Se = console.info, Me = console.warn, vt = console.error, ut = console.group, ae = console.groupCollapsed, Xe = console.groupEnd;
|
|
4108
4108
|
var m = {
|
|
4109
4109
|
configurable: !0,
|
|
4110
4110
|
enumerable: !0,
|
|
4111
|
-
value:
|
|
4111
|
+
value: $e,
|
|
4112
4112
|
writable: !0
|
|
4113
4113
|
};
|
|
4114
4114
|
Object.defineProperties(console, {
|
|
@@ -4134,13 +4134,13 @@ function ha() {
|
|
|
4134
4134
|
};
|
|
4135
4135
|
Object.defineProperties(console, {
|
|
4136
4136
|
log: I({}, m, {
|
|
4137
|
-
value:
|
|
4137
|
+
value: ee
|
|
4138
4138
|
}),
|
|
4139
4139
|
info: I({}, m, {
|
|
4140
4140
|
value: Se
|
|
4141
4141
|
}),
|
|
4142
4142
|
warn: I({}, m, {
|
|
4143
|
-
value:
|
|
4143
|
+
value: Me
|
|
4144
4144
|
}),
|
|
4145
4145
|
error: I({}, m, {
|
|
4146
4146
|
value: vt
|
|
@@ -4152,7 +4152,7 @@ function ha() {
|
|
|
4152
4152
|
value: ae
|
|
4153
4153
|
}),
|
|
4154
4154
|
groupEnd: I({}, m, {
|
|
4155
|
-
value:
|
|
4155
|
+
value: Xe
|
|
4156
4156
|
})
|
|
4157
4157
|
});
|
|
4158
4158
|
}
|
|
@@ -4173,13 +4173,13 @@ function ha() {
|
|
|
4173
4173
|
` + Ze + m;
|
|
4174
4174
|
}
|
|
4175
4175
|
}
|
|
4176
|
-
var
|
|
4176
|
+
var qe = !1, et;
|
|
4177
4177
|
{
|
|
4178
4178
|
var Gn = typeof WeakMap == "function" ? WeakMap : Map;
|
|
4179
4179
|
et = new Gn();
|
|
4180
4180
|
}
|
|
4181
4181
|
function Hr(m, T) {
|
|
4182
|
-
if (!m ||
|
|
4182
|
+
if (!m || qe)
|
|
4183
4183
|
return "";
|
|
4184
4184
|
{
|
|
4185
4185
|
var R = et.get(m);
|
|
@@ -4187,7 +4187,7 @@ function ha() {
|
|
|
4187
4187
|
return R;
|
|
4188
4188
|
}
|
|
4189
4189
|
var q;
|
|
4190
|
-
|
|
4190
|
+
qe = !0;
|
|
4191
4191
|
var J = Error.prepareStackTrace;
|
|
4192
4192
|
Error.prepareStackTrace = void 0;
|
|
4193
4193
|
var X;
|
|
@@ -4244,7 +4244,7 @@ function ha() {
|
|
|
4244
4244
|
}
|
|
4245
4245
|
}
|
|
4246
4246
|
} finally {
|
|
4247
|
-
|
|
4247
|
+
qe = !1, ve.current = X, at(), Error.prepareStackTrace = J;
|
|
4248
4248
|
}
|
|
4249
4249
|
var qt = m ? m.displayName || m.name : "", Dt = qt ? Te(qt) : "";
|
|
4250
4250
|
return typeof m == "function" && et.set(m, Dt), Dt;
|
|
@@ -4336,7 +4336,7 @@ function ha() {
|
|
|
4336
4336
|
if (se(m))
|
|
4337
4337
|
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(m)), Be(m);
|
|
4338
4338
|
}
|
|
4339
|
-
var
|
|
4339
|
+
var ze = D.ReactCurrentOwner, Zn = {
|
|
4340
4340
|
key: !0,
|
|
4341
4341
|
ref: !0,
|
|
4342
4342
|
__self: !0,
|
|
@@ -4359,7 +4359,7 @@ function ha() {
|
|
|
4359
4359
|
return m.key !== void 0;
|
|
4360
4360
|
}
|
|
4361
4361
|
function bl(m, T) {
|
|
4362
|
-
typeof m.ref == "string" &&
|
|
4362
|
+
typeof m.ref == "string" && ze.current;
|
|
4363
4363
|
}
|
|
4364
4364
|
function Dl(m, T) {
|
|
4365
4365
|
{
|
|
@@ -4427,7 +4427,7 @@ function ha() {
|
|
|
4427
4427
|
var oe = typeof m == "function" ? m.displayName || m.name || "Unknown" : m;
|
|
4428
4428
|
V && Dl(K, oe), me && wl(K, oe);
|
|
4429
4429
|
}
|
|
4430
|
-
return Cl(m, V, me, J, q,
|
|
4430
|
+
return Cl(m, V, me, J, q, ze.current, K);
|
|
4431
4431
|
}
|
|
4432
4432
|
}
|
|
4433
4433
|
var es = D.ReactCurrentOwner, Di = D.ReactDebugCurrentFrame;
|
|
@@ -4704,7 +4704,7 @@ function hf({
|
|
|
4704
4704
|
let I = g;
|
|
4705
4705
|
return u && w && l.length > 0 && (I = as.search(I, w, l)), Object.keys(C).length > 0 && (I = as.filterByFields(I, C)), as.paginate(I, k, f);
|
|
4706
4706
|
}, [g, w, C, k, f, u, l]);
|
|
4707
|
-
|
|
4707
|
+
ge(() => {
|
|
4708
4708
|
A(1);
|
|
4709
4709
|
}, [w, C]);
|
|
4710
4710
|
const P = () => {
|
|
@@ -4828,11 +4828,11 @@ function hf({
|
|
|
4828
4828
|
borderBottom: t === "list" ? `1px solid ${F.border}` : "none",
|
|
4829
4829
|
transition: "all 0.15s ease"
|
|
4830
4830
|
},
|
|
4831
|
-
onMouseEnter: (
|
|
4832
|
-
d && (
|
|
4831
|
+
onMouseEnter: (ee) => {
|
|
4832
|
+
d && (ee.currentTarget.style.background = F.border);
|
|
4833
4833
|
},
|
|
4834
|
-
onMouseLeave: (
|
|
4835
|
-
|
|
4834
|
+
onMouseLeave: (ee) => {
|
|
4835
|
+
ee.currentTarget.style.background = F.cardBackground;
|
|
4836
4836
|
},
|
|
4837
4837
|
children: $(I, W)
|
|
4838
4838
|
},
|
|
@@ -4996,7 +4996,7 @@ function mf({
|
|
|
4996
4996
|
const A = Math.floor(Math.random() * k.length);
|
|
4997
4997
|
return k[A];
|
|
4998
4998
|
}, [r]), y = Z(() => Math.random() * (n - t) + t, [t, n]);
|
|
4999
|
-
|
|
4999
|
+
ge(() => {
|
|
5000
5000
|
if (r.length === 0) {
|
|
5001
5001
|
a([]), f([]);
|
|
5002
5002
|
return;
|
|
@@ -5032,8 +5032,8 @@ function mf({
|
|
|
5032
5032
|
}), f((P) => {
|
|
5033
5033
|
const F = [...P], $ = [
|
|
5034
5034
|
(S ? c[b] : l[b])._id,
|
|
5035
|
-
...l.filter((W,
|
|
5036
|
-
...P.filter((W,
|
|
5035
|
+
...l.filter((W, ee) => ee !== b).map((W) => W._id),
|
|
5036
|
+
...P.filter((W, ee) => ee !== b).map((W) => W._id)
|
|
5037
5037
|
], I = D($);
|
|
5038
5038
|
return I && (F[b] = I), F;
|
|
5039
5039
|
}), setTimeout(() => {
|
|
@@ -5044,7 +5044,7 @@ function mf({
|
|
|
5044
5044
|
}, k);
|
|
5045
5045
|
_.current[b] = A;
|
|
5046
5046
|
}, [y, D, l, c, p]), x = bs(!1);
|
|
5047
|
-
|
|
5047
|
+
ge(() => {
|
|
5048
5048
|
if (!(l.length === 0 || r.length <= 1) && !x.current) {
|
|
5049
5049
|
x.current = !0;
|
|
5050
5050
|
for (let b = 0; b < l.length; b++)
|
|
@@ -5197,7 +5197,7 @@ function yf({
|
|
|
5197
5197
|
renderLoading: y,
|
|
5198
5198
|
theme: w = {}
|
|
5199
5199
|
}) {
|
|
5200
|
-
const x = { ...ga, ...w }, [C, b] = Q([]), [k, A] = Q(!1), [S, P] = Q(null), [F, U] = Q(/* @__PURE__ */ new Set()), [$, I] = Q(null), [W,
|
|
5200
|
+
const x = { ...ga, ...w }, [C, b] = Q([]), [k, A] = Q(!1), [S, P] = Q(null), [F, U] = Q(/* @__PURE__ */ new Set()), [$, I] = Q(null), [W, ee] = Q(null), [Se, Me] = Q(null), [vt, ut] = Q(!1), ae = Pt(() => e ? new la({ baseUrl: r, system_id: e }) : null, [r, e]), Xe = Z(async () => {
|
|
5201
5201
|
if (ae) {
|
|
5202
5202
|
A(!0), P(null);
|
|
5203
5203
|
try {
|
|
@@ -5210,37 +5210,35 @@ function yf({
|
|
|
5210
5210
|
A(!1);
|
|
5211
5211
|
}
|
|
5212
5212
|
}, [ae, t, n, s, d, h]);
|
|
5213
|
-
|
|
5214
|
-
l &&
|
|
5215
|
-
}, [
|
|
5216
|
-
|
|
5217
|
-
}, [s]);
|
|
5218
|
-
const qe = Z(async (M) => {
|
|
5213
|
+
ge(() => {
|
|
5214
|
+
b([]), U(/* @__PURE__ */ new Set()), ee(null), P(null), l && Xe();
|
|
5215
|
+
}, [s, l]);
|
|
5216
|
+
const $e = Z(async (M) => {
|
|
5219
5217
|
if (ae) {
|
|
5220
|
-
|
|
5218
|
+
ee(M), Me(null), ut(!0);
|
|
5221
5219
|
try {
|
|
5222
5220
|
const z = await ae.getEmailParsed(t, M.uid, s || "INBOX");
|
|
5223
|
-
z != null && z.body &&
|
|
5221
|
+
z != null && z.body && Me(z.body);
|
|
5224
5222
|
} catch (z) {
|
|
5225
5223
|
console.error("Failed to fetch email body:", z);
|
|
5226
5224
|
}
|
|
5227
5225
|
ut(!1);
|
|
5228
5226
|
}
|
|
5229
5227
|
}, [ae, t, s]), lt = Z((M) => {
|
|
5230
|
-
a == null || a(M), i &&
|
|
5231
|
-
}, [a, i,
|
|
5228
|
+
a == null || a(M), i && $e(M);
|
|
5229
|
+
}, [a, i, $e]), at = Z((M, z, se) => {
|
|
5232
5230
|
if (!o) {
|
|
5233
|
-
a == null || a(M), i &&
|
|
5231
|
+
a == null || a(M), i && $e(M);
|
|
5234
5232
|
return;
|
|
5235
5233
|
}
|
|
5236
5234
|
const Be = M.uid;
|
|
5237
5235
|
if (se.shiftKey && $ !== null) {
|
|
5238
|
-
const Ae = Math.min($, z),
|
|
5236
|
+
const Ae = Math.min($, z), ze = Math.max($, z), Zn = C.slice(Ae, ze + 1).map((Qr) => Qr.uid), ir = new Set(Zn);
|
|
5239
5237
|
U(ir), c == null || c(Array.from(ir));
|
|
5240
5238
|
} else if (se.ctrlKey || se.metaKey)
|
|
5241
5239
|
U((Ae) => {
|
|
5242
|
-
const
|
|
5243
|
-
return
|
|
5240
|
+
const ze = new Set(Ae);
|
|
5241
|
+
return ze.has(Be) ? ze.delete(Be) : ze.add(Be), c == null || c(Array.from(ze)), ze;
|
|
5244
5242
|
}), I(z);
|
|
5245
5243
|
else {
|
|
5246
5244
|
const Ae = /* @__PURE__ */ new Set([Be]);
|
|
@@ -5283,14 +5281,14 @@ function yf({
|
|
|
5283
5281
|
const M = new Set(C.map((z) => z.uid));
|
|
5284
5282
|
U(M), c == null || c(Array.from(M));
|
|
5285
5283
|
}
|
|
5286
|
-
}, [C, F.size, c]),
|
|
5284
|
+
}, [C, F.size, c]), qe = Z(() => {
|
|
5287
5285
|
U(/* @__PURE__ */ new Set()), c == null || c([]);
|
|
5288
5286
|
}, [c]), et = {
|
|
5289
5287
|
delete: ve,
|
|
5290
5288
|
archive: Ze,
|
|
5291
|
-
refresh:
|
|
5289
|
+
refresh: Xe,
|
|
5292
5290
|
selectAll: Te,
|
|
5293
|
-
clearSelection:
|
|
5291
|
+
clearSelection: qe
|
|
5294
5292
|
}, Gn = (M) => {
|
|
5295
5293
|
if (!M) return "";
|
|
5296
5294
|
const z = new Date(M), se = /* @__PURE__ */ new Date();
|
|
@@ -5601,14 +5599,14 @@ function _a(r, e) {
|
|
|
5601
5599
|
return e ?? null;
|
|
5602
5600
|
} };
|
|
5603
5601
|
}
|
|
5604
|
-
function
|
|
5602
|
+
function Qe() {
|
|
5605
5603
|
const r = Ml(eu);
|
|
5606
5604
|
return r == null && ya(8), r;
|
|
5607
5605
|
}
|
|
5608
5606
|
function Pr(r) {
|
|
5609
5607
|
return {};
|
|
5610
5608
|
}
|
|
5611
|
-
const Hs = {}, xa = {}, tu = {}, Et = {}, Ht = {}, kr = {}, Gt = {}, Fn = {}, Cs = {}, Sr = {}, Tr = {},
|
|
5609
|
+
const Hs = {}, xa = {}, tu = {}, Et = {}, Ht = {}, kr = {}, Gt = {}, Fn = {}, Cs = {}, Sr = {}, Tr = {}, Re = {}, Gs = {}, Js = {}, va = {}, ru = {}, ba = {}, nu = {}, Da = {}, su = {}, iu = {}, fn = {}, wa = {}, ou = {}, uu = {}, lu = {}, Ca = {}, Aa = {}, Ea = {}, Ii = {}, au = {}, ka = {}, cu = {}, du = {}, Sa = {}, Ln = {}, Qs = {}, As = {}, Ta = {}, Ba = {}, Zr = {}, en = {}, Na = {}, Fa = {}, La = {}, Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Pa = Ie && "documentMode" in document ? document.documentMode : null, Le = Ie && /Mac|iPod|iPhone|iPad/.test(navigator.platform), mt = Ie && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), hn = !(!Ie || !("InputEvent" in window) || Pa) && "getTargetRanges" in new window.InputEvent("input"), Pn = Ie && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Or = Ie && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Oa = Ie && /Android/.test(navigator.userAgent), fu = Ie && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ra = Ie && Oa && fu, Ys = Ie && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !fu, Rr = 1, _t = 3, Tt = 0, hu = 1, Yt = 2, ja = 0, Ia = 1, Ma = 2, pn = 4, gn = 8, Xs = 128, $a = 112 | (3 | pn | gn) | Xs, Zs = 1, ei = 2, ti = 3, ri = 4, ni = 5, si = 6, On = Pn || Or || Ys ? " " : "", nt = `
|
|
5612
5610
|
|
|
5613
5611
|
`, qa = mt ? " " : On, pu = "֑-߿יִ-﷽ﹰ-ﻼ", gu = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", za = new RegExp("^[^" + gu + "]*[" + pu + "]"), Ua = new RegExp("^[^" + pu + "]*[" + gu + "]"), Bt = { bold: 1, code: 16, highlight: Xs, italic: 2, strikethrough: pn, subscript: 32, superscript: 64, underline: gn }, Wa = { directionless: 1, unmergeable: 2 }, Mi = { center: ei, end: si, justify: ri, left: Zs, right: ti, start: ni }, Va = { [ei]: "center", [si]: "end", [ri]: "justify", [Zs]: "left", [ti]: "right", [ni]: "start" }, Ka = { normal: 0, segmented: 2, token: 1 }, Ha = { [ja]: "normal", [Ma]: "segmented", [Ia]: "token" };
|
|
5614
5612
|
function Ga(r) {
|
|
@@ -5652,7 +5650,7 @@ function Za(r, e, t, n) {
|
|
|
5652
5650
|
for (let s = r; s && !fc(s); s = Ir(s)) {
|
|
5653
5651
|
const o = jn(s, e);
|
|
5654
5652
|
if (o !== void 0) {
|
|
5655
|
-
const i =
|
|
5653
|
+
const i = pe(o, t);
|
|
5656
5654
|
if (i) return Y(i) ? void 0 : [s, i];
|
|
5657
5655
|
} else if (s === n) return [n, Cu(t)];
|
|
5658
5656
|
}
|
|
@@ -5710,7 +5708,7 @@ function mu(r, e, t) {
|
|
|
5710
5708
|
}
|
|
5711
5709
|
t.takeRecords();
|
|
5712
5710
|
}
|
|
5713
|
-
s !== null && (a && (s.dirty = !0,
|
|
5711
|
+
s !== null && (a && (s.dirty = !0, He(s)), mt && Su(r) && s.insertRawText(c));
|
|
5714
5712
|
});
|
|
5715
5713
|
} finally {
|
|
5716
5714
|
Es = !1;
|
|
@@ -5732,7 +5730,7 @@ function $i(r, e) {
|
|
|
5732
5730
|
return !(t !== null && t !== o || n !== null && n !== i || s !== null && s !== u);
|
|
5733
5731
|
}
|
|
5734
5732
|
function qi(r, e) {
|
|
5735
|
-
const t = r.mergeWithSibling(e), n =
|
|
5733
|
+
const t = r.mergeWithSibling(e), n = re()._normalizedNodes;
|
|
5736
5734
|
return n.add(r.__key), n.add(e.__key), t;
|
|
5737
5735
|
}
|
|
5738
5736
|
function zi(r) {
|
|
@@ -5834,7 +5832,7 @@ function bu(r) {
|
|
|
5834
5832
|
function nc(r, e) {
|
|
5835
5833
|
if (e != null) return void (r.__key = e);
|
|
5836
5834
|
De(), Gu();
|
|
5837
|
-
const t =
|
|
5835
|
+
const t = re(), n = it(), s = "" + ec++;
|
|
5838
5836
|
n._nodeMap.set(s, r), E(r) ? t._dirtyElements.set(s, !0) : t._dirtyLeaves.add(s), t._cloneNotNeeded.add(s), t._dirtyType = hu, r.__key = s;
|
|
5839
5837
|
}
|
|
5840
5838
|
function kt(r) {
|
|
@@ -5870,7 +5868,7 @@ function kt(r) {
|
|
|
5870
5868
|
}
|
|
5871
5869
|
function xn(r) {
|
|
5872
5870
|
Gu();
|
|
5873
|
-
const e = r.getLatest(), t = e.__parent, n = it(), s =
|
|
5871
|
+
const e = r.getLatest(), t = e.__parent, n = it(), s = re(), o = n._nodeMap, i = s._dirtyElements;
|
|
5874
5872
|
t !== null && function(l, a, c) {
|
|
5875
5873
|
let f = l;
|
|
5876
5874
|
for (; f !== null; ) {
|
|
@@ -5885,28 +5883,28 @@ function xn(r) {
|
|
|
5885
5883
|
}
|
|
5886
5884
|
function he(r) {
|
|
5887
5885
|
De();
|
|
5888
|
-
const e =
|
|
5886
|
+
const e = re(), t = e._compositionKey;
|
|
5889
5887
|
if (r !== t) {
|
|
5890
5888
|
if (e._compositionKey = r, t !== null) {
|
|
5891
|
-
const n =
|
|
5889
|
+
const n = pe(t);
|
|
5892
5890
|
n !== null && n.getWritable();
|
|
5893
5891
|
}
|
|
5894
5892
|
if (r !== null) {
|
|
5895
|
-
const n =
|
|
5893
|
+
const n = pe(r);
|
|
5896
5894
|
n !== null && n.getWritable();
|
|
5897
5895
|
}
|
|
5898
5896
|
}
|
|
5899
5897
|
}
|
|
5900
5898
|
function ht() {
|
|
5901
|
-
return Ur() ? null :
|
|
5899
|
+
return Ur() ? null : re()._compositionKey;
|
|
5902
5900
|
}
|
|
5903
|
-
function
|
|
5901
|
+
function pe(r, e) {
|
|
5904
5902
|
const t = (e || it())._nodeMap.get(r);
|
|
5905
5903
|
return t === void 0 ? null : t;
|
|
5906
5904
|
}
|
|
5907
5905
|
function Du(r, e) {
|
|
5908
|
-
const t = jn(r,
|
|
5909
|
-
return t !== void 0 ?
|
|
5906
|
+
const t = jn(r, re());
|
|
5907
|
+
return t !== void 0 ? pe(t, e) : null;
|
|
5910
5908
|
}
|
|
5911
5909
|
function jn(r, e) {
|
|
5912
5910
|
return r[`__lexicalKey_${e._key}`];
|
|
@@ -5925,21 +5923,21 @@ function wu(r) {
|
|
|
5925
5923
|
return r._pendingDecorators = t, t;
|
|
5926
5924
|
}
|
|
5927
5925
|
function Wi(r) {
|
|
5928
|
-
return r.read(() =>
|
|
5926
|
+
return r.read(() => ne().getTextContent());
|
|
5929
5927
|
}
|
|
5930
|
-
function
|
|
5928
|
+
function ne() {
|
|
5931
5929
|
return Cu(it());
|
|
5932
5930
|
}
|
|
5933
5931
|
function Cu(r) {
|
|
5934
5932
|
return r._nodeMap.get("root");
|
|
5935
5933
|
}
|
|
5936
|
-
function
|
|
5934
|
+
function He(r) {
|
|
5937
5935
|
De();
|
|
5938
5936
|
const e = it();
|
|
5939
5937
|
r !== null && (r.dirty = !0, r.setCachedNodes(null)), e._selection = r;
|
|
5940
5938
|
}
|
|
5941
5939
|
function Vt(r) {
|
|
5942
|
-
const e =
|
|
5940
|
+
const e = re(), t = function(n, s) {
|
|
5943
5941
|
let o = n;
|
|
5944
5942
|
for (; o != null; ) {
|
|
5945
5943
|
const i = jn(o, s);
|
|
@@ -5948,7 +5946,7 @@ function Vt(r) {
|
|
|
5948
5946
|
}
|
|
5949
5947
|
return null;
|
|
5950
5948
|
}(r, e);
|
|
5951
|
-
return t === null ? r === e.getRootElement() ?
|
|
5949
|
+
return t === null ? r === e.getRootElement() ? pe("root") : null : pe(t);
|
|
5952
5950
|
}
|
|
5953
5951
|
function Vi(r, e) {
|
|
5954
5952
|
return e ? r.getTextContentSize() : 0;
|
|
@@ -5996,7 +5994,7 @@ function ci(r, e, t, n, s) {
|
|
|
5996
5994
|
if (u === "") {
|
|
5997
5995
|
if (he(null), Pn || Or || Ys) o.remove();
|
|
5998
5996
|
else {
|
|
5999
|
-
const g =
|
|
5997
|
+
const g = re();
|
|
6000
5998
|
setTimeout(() => {
|
|
6001
5999
|
g.update(() => {
|
|
6002
6000
|
o.isAttached() && o.remove();
|
|
@@ -6033,7 +6031,7 @@ function Hi(r) {
|
|
|
6033
6031
|
return r === "ArrowRight";
|
|
6034
6032
|
}
|
|
6035
6033
|
function gr(r, e) {
|
|
6036
|
-
return
|
|
6034
|
+
return Le ? r : e;
|
|
6037
6035
|
}
|
|
6038
6036
|
function Gi(r) {
|
|
6039
6037
|
return r === "Enter";
|
|
@@ -6048,8 +6046,8 @@ function Ji(r, e, t) {
|
|
|
6048
6046
|
return r.toLowerCase() === "a" && gr(e, t);
|
|
6049
6047
|
}
|
|
6050
6048
|
function ic() {
|
|
6051
|
-
const r =
|
|
6052
|
-
|
|
6049
|
+
const r = ne();
|
|
6050
|
+
He(xu(r.select(0, r.getChildrenSize())));
|
|
6053
6051
|
}
|
|
6054
6052
|
function br(r, e) {
|
|
6055
6053
|
r.__lexicalClassNameCache === void 0 && (r.__lexicalClassNameCache = {});
|
|
@@ -6123,16 +6121,16 @@ function Mn(r) {
|
|
|
6123
6121
|
function oc(r) {
|
|
6124
6122
|
let e = r.getParentOrThrow();
|
|
6125
6123
|
for (; e !== null; ) {
|
|
6126
|
-
if (
|
|
6124
|
+
if (Ge(e)) return e;
|
|
6127
6125
|
e = e.getParentOrThrow();
|
|
6128
6126
|
}
|
|
6129
6127
|
return e;
|
|
6130
6128
|
}
|
|
6131
|
-
function
|
|
6129
|
+
function Ge(r) {
|
|
6132
6130
|
return _e(r) || E(r) && r.isShadowRoot();
|
|
6133
6131
|
}
|
|
6134
|
-
function
|
|
6135
|
-
const e =
|
|
6132
|
+
function Ye(r) {
|
|
6133
|
+
const e = re(), t = r.constructor.getType(), n = e._nodes.get(t);
|
|
6136
6134
|
n === void 0 && N(200, r.constructor.name, t);
|
|
6137
6135
|
const { replace: s, replaceWithKlass: o } = n;
|
|
6138
6136
|
if (s !== null) {
|
|
@@ -6186,7 +6184,7 @@ function uc(r, e, t) {
|
|
|
6186
6184
|
n !== null && fi(n, r, e);
|
|
6187
6185
|
}
|
|
6188
6186
|
function Fe(r) {
|
|
6189
|
-
return
|
|
6187
|
+
return Ie ? (r || window).getSelection() : null;
|
|
6190
6188
|
}
|
|
6191
6189
|
function lc(r) {
|
|
6192
6190
|
return st(r) && r.tagName === "A";
|
|
@@ -6207,7 +6205,7 @@ function bn(r) {
|
|
|
6207
6205
|
}
|
|
6208
6206
|
function dt(r) {
|
|
6209
6207
|
if (Y(r) && !r.isInline()) return !0;
|
|
6210
|
-
if (!E(r) ||
|
|
6208
|
+
if (!E(r) || Ge(r)) return !1;
|
|
6211
6209
|
const e = r.getFirstChild(), t = e === null || St(e) || L(e) || e.isInline();
|
|
6212
6210
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
6213
6211
|
}
|
|
@@ -6217,7 +6215,7 @@ function dr(r, e) {
|
|
|
6217
6215
|
return e(t) ? t : null;
|
|
6218
6216
|
}
|
|
6219
6217
|
function ac() {
|
|
6220
|
-
return
|
|
6218
|
+
return re();
|
|
6221
6219
|
}
|
|
6222
6220
|
const Xi = /* @__PURE__ */ new WeakMap(), cc = /* @__PURE__ */ new Map();
|
|
6223
6221
|
function dc(r) {
|
|
@@ -6252,14 +6250,14 @@ function Tu(r, e, t, n, s, o) {
|
|
|
6252
6250
|
i.__parent === e && (E(i) && Tu(i, u, t, n, s, o), t.has(u) || o.delete(u), s.push(u)), i = i.getNextSibling();
|
|
6253
6251
|
}
|
|
6254
6252
|
}
|
|
6255
|
-
let yt, xe, Nr, $n, Ss, Ts, Nt,
|
|
6253
|
+
let yt, xe, Nr, $n, Ss, Ts, Nt, je, Bs, Fr, ue = "", ye = "", Ue = null, Pe = "", rt = "", Bu = !1, Lr = !1, ln = null;
|
|
6256
6254
|
function Dn(r, e) {
|
|
6257
6255
|
const t = Nt.get(r);
|
|
6258
6256
|
if (e !== null) {
|
|
6259
6257
|
const n = Ls(r);
|
|
6260
6258
|
n.parentNode === e && e.removeChild(n);
|
|
6261
6259
|
}
|
|
6262
|
-
if (
|
|
6260
|
+
if (je.has(r) || xe._keyToDOMMap.delete(r), E(t)) {
|
|
6263
6261
|
const n = Cn(t, Nt);
|
|
6264
6262
|
Ns(n, 0, n.length - 1, null);
|
|
6265
6263
|
}
|
|
@@ -6290,7 +6288,7 @@ function Fu(r, e) {
|
|
|
6290
6288
|
e === 0 ? wt(t, "") : e === Zs ? wt(t, "left") : e === ei ? wt(t, "center") : e === ti ? wt(t, "right") : e === ri ? wt(t, "justify") : e === ni ? wt(t, "start") : e === si && wt(t, "end");
|
|
6291
6289
|
}
|
|
6292
6290
|
function wn(r, e) {
|
|
6293
|
-
const t =
|
|
6291
|
+
const t = je.get(r);
|
|
6294
6292
|
t === void 0 && N(60);
|
|
6295
6293
|
const n = t.createDOM(yt, xe);
|
|
6296
6294
|
if (function(s, o, i) {
|
|
@@ -6305,7 +6303,7 @@ function wn(r, e) {
|
|
|
6305
6303
|
(function(l, a, c, f) {
|
|
6306
6304
|
const d = ye;
|
|
6307
6305
|
ye = "", Fs(l, c, 0, a, c.getDOMSlot(f)), Pu(c, f), ye = d;
|
|
6308
|
-
})(Cn(t,
|
|
6306
|
+
})(Cn(t, je), u, t, n);
|
|
6309
6307
|
}
|
|
6310
6308
|
const i = t.__format;
|
|
6311
6309
|
i !== 0 && Fu(n, i), t.isInline() || Lu(null, t, n), In(t) && (ue += nt, rt += nt);
|
|
@@ -6325,8 +6323,8 @@ function Fs(r, e, t, n, s) {
|
|
|
6325
6323
|
let i = t;
|
|
6326
6324
|
for (; i <= n; ++i) {
|
|
6327
6325
|
wn(r[i], s);
|
|
6328
|
-
const u =
|
|
6329
|
-
u !== null && L(u) && (
|
|
6326
|
+
const u = je.get(r[i]);
|
|
6327
|
+
u !== null && L(u) && (Ue === null && (Ue = u.getFormat()), Pe === "" && (Pe = u.getStyle()));
|
|
6330
6328
|
}
|
|
6331
6329
|
In(e) && (ue += nt), s.element.__lexicalTextContent = ue, ue = o + ue;
|
|
6332
6330
|
}
|
|
@@ -6342,7 +6340,7 @@ function Zi(r, e) {
|
|
|
6342
6340
|
return null;
|
|
6343
6341
|
}
|
|
6344
6342
|
function Lu(r, e, t) {
|
|
6345
|
-
const n = Zi(r, Nt), s = Zi(e,
|
|
6343
|
+
const n = Zi(r, Nt), s = Zi(e, je);
|
|
6346
6344
|
n !== s && e.getDOMSlot(t).setManagedLineBreak(s);
|
|
6347
6345
|
}
|
|
6348
6346
|
function Pu(r, e) {
|
|
@@ -6379,7 +6377,7 @@ function Pu(r, e) {
|
|
|
6379
6377
|
function pc(r, e, t) {
|
|
6380
6378
|
const n = ye;
|
|
6381
6379
|
var s;
|
|
6382
|
-
ye = "",
|
|
6380
|
+
ye = "", Ue = null, Pe = "", function(o, i, u) {
|
|
6383
6381
|
const l = ue, a = o.__size, c = i.__size;
|
|
6384
6382
|
ue = "";
|
|
6385
6383
|
const f = u.element;
|
|
@@ -6399,10 +6397,10 @@ function pc(r, e, t) {
|
|
|
6399
6397
|
}
|
|
6400
6398
|
Dn(d, null);
|
|
6401
6399
|
}
|
|
6402
|
-
const p =
|
|
6403
|
-
L(p) && (
|
|
6400
|
+
const p = je.get(h);
|
|
6401
|
+
L(p) && (Ue === null && (Ue = p.getFormat()), Pe === "" && (Pe = p.getStyle()));
|
|
6404
6402
|
} else {
|
|
6405
|
-
const d = Cn(o, Nt), h = Cn(i,
|
|
6403
|
+
const d = Cn(o, Nt), h = Cn(i, je);
|
|
6406
6404
|
if (d.length !== a && N(227), h.length !== c && N(228), a === 0) c !== 0 && Fs(h, i, 0, c - 1, u);
|
|
6407
6405
|
else if (c === 0) {
|
|
6408
6406
|
if (a !== 0) {
|
|
@@ -6417,15 +6415,15 @@ function pc(r, e, t) {
|
|
|
6417
6415
|
if ($ === I) A = hs(mr(I, w.element)), S++, P++;
|
|
6418
6416
|
else {
|
|
6419
6417
|
b === void 0 && (b = new Set(g)), k === void 0 && (k = new Set(_));
|
|
6420
|
-
const
|
|
6421
|
-
if (
|
|
6422
|
-
const
|
|
6423
|
-
|
|
6418
|
+
const ee = k.has($), Se = b.has(I);
|
|
6419
|
+
if (ee) if (Se) {
|
|
6420
|
+
const Me = vn(xe, I);
|
|
6421
|
+
Me === A ? A = hs(mr(I, w.element)) : (w.withBefore(A).insertChild(Me), mr(I, w.element)), S++, P++;
|
|
6424
6422
|
} else wn(I, w.withBefore(A)), P++;
|
|
6425
6423
|
else A = hs(Ls($)), Dn($, w.element), S++;
|
|
6426
6424
|
}
|
|
6427
|
-
const W =
|
|
6428
|
-
W !== null && L(W) && (
|
|
6425
|
+
const W = je.get(I);
|
|
6426
|
+
W !== null && L(W) && (Ue === null && (Ue = W.getFormat()), Pe === "" && (Pe = W.getStyle()));
|
|
6429
6427
|
}
|
|
6430
6428
|
const F = S > x, U = P > C;
|
|
6431
6429
|
if (F && !U) {
|
|
@@ -6435,8 +6433,8 @@ function pc(r, e, t) {
|
|
|
6435
6433
|
})(i, d, h, a, c, u);
|
|
6436
6434
|
}
|
|
6437
6435
|
In(i) && (ue += nt), f.__lexicalTextContent = ue, ue = l + ue;
|
|
6438
|
-
}(r, e, e.getDOMSlot(t)), Pu(e, t), Zt(s = e) &&
|
|
6439
|
-
Zt(o) &&
|
|
6436
|
+
}(r, e, e.getDOMSlot(t)), Pu(e, t), Zt(s = e) && Ue != null && Ue !== s.__textFormat && !Lr && (s.setTextFormat(Ue), s.setTextStyle(Pe)), function(o) {
|
|
6437
|
+
Zt(o) && Pe !== "" && Pe !== o.__textStyle && !Lr && o.setTextStyle(Pe);
|
|
6440
6438
|
}(e), ye = n;
|
|
6441
6439
|
}
|
|
6442
6440
|
function Cn(r, e) {
|
|
@@ -6450,7 +6448,7 @@ function Cn(r, e) {
|
|
|
6450
6448
|
}
|
|
6451
6449
|
function mr(r, e) {
|
|
6452
6450
|
const t = Nt.get(r);
|
|
6453
|
-
let n =
|
|
6451
|
+
let n = je.get(r);
|
|
6454
6452
|
t !== void 0 && n !== void 0 || N(61);
|
|
6455
6453
|
const s = Bu || Ts.has(r) || Ss.has(r), o = vn(xe, r);
|
|
6456
6454
|
if (t === n && !s) {
|
|
@@ -6502,9 +6500,9 @@ function hs(r) {
|
|
|
6502
6500
|
return e !== null && e === xe._blockCursorElement && (e = e.nextSibling), e;
|
|
6503
6501
|
}
|
|
6504
6502
|
function gc(r, e, t, n, s, o) {
|
|
6505
|
-
ue = "", rt = "", ye = "", Bu = n === Yt, ln = null, xe = t, yt = t._config, Nr = t._nodes, $n = xe._listeners.mutation, Ss = s, Ts = o, Nt = r._nodeMap,
|
|
6503
|
+
ue = "", rt = "", ye = "", Bu = n === Yt, ln = null, xe = t, yt = t._config, Nr = t._nodes, $n = xe._listeners.mutation, Ss = s, Ts = o, Nt = r._nodeMap, je = e._nodeMap, Lr = e._readOnly, Bs = new Map(t._keyToDOMMap);
|
|
6506
6504
|
const i = /* @__PURE__ */ new Map();
|
|
6507
|
-
return Fr = i, mr("root", null), xe = void 0, Nr = void 0, Ss = void 0, Ts = void 0, Nt = void 0,
|
|
6505
|
+
return Fr = i, mr("root", null), xe = void 0, Nr = void 0, Ss = void 0, Ts = void 0, Nt = void 0, je = void 0, yt = void 0, Bs = void 0, Fr = void 0, i;
|
|
6508
6506
|
}
|
|
6509
6507
|
function Ls(r) {
|
|
6510
6508
|
const e = Bs.get(r);
|
|
@@ -6543,41 +6541,41 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6543
6541
|
return u === " ";
|
|
6544
6542
|
}(t)) O(e, wa, r);
|
|
6545
6543
|
else if (function(u, l) {
|
|
6546
|
-
return
|
|
6544
|
+
return Le && l && u.toLowerCase() === "o";
|
|
6547
6545
|
}(t, s)) r.preventDefault(), Cr = !0, O(e, Ht, !0);
|
|
6548
6546
|
else if (function(u, l) {
|
|
6549
6547
|
return Gi(u) && !l;
|
|
6550
6548
|
}(t, n)) Cr = !1, O(e, fn, r);
|
|
6551
6549
|
else if (function(u, l, a, c) {
|
|
6552
|
-
return
|
|
6550
|
+
return Le ? !l && !a && (ar(u) || u.toLowerCase() === "h" && c) : !(c || l || a) && ar(u);
|
|
6553
6551
|
}(t, i, o, s)) ar(t) ? O(e, ou, r) : (r.preventDefault(), O(e, Et, !0));
|
|
6554
6552
|
else if (/* @__PURE__ */ function(u) {
|
|
6555
6553
|
return u === "Escape";
|
|
6556
6554
|
}(t)) O(e, uu, r);
|
|
6557
6555
|
else if (function(u, l, a, c, f) {
|
|
6558
|
-
return
|
|
6556
|
+
return Le ? !(a || c || f) && (cr(u) || u.toLowerCase() === "d" && l) : !(l || c || f) && cr(u);
|
|
6559
6557
|
}(t, s, n, i, o)) cr(t) ? O(e, lu, r) : (r.preventDefault(), O(e, Et, !1));
|
|
6560
6558
|
else if (function(u, l, a) {
|
|
6561
|
-
return ar(u) && (
|
|
6559
|
+
return ar(u) && (Le ? l : a);
|
|
6562
6560
|
}(t, i, s)) r.preventDefault(), O(e, Sr, !0);
|
|
6563
6561
|
else if (function(u, l, a) {
|
|
6564
|
-
return cr(u) && (
|
|
6562
|
+
return cr(u) && (Le ? l : a);
|
|
6565
6563
|
}(t, i, s)) r.preventDefault(), O(e, Sr, !1);
|
|
6566
6564
|
else if (function(u, l) {
|
|
6567
|
-
return
|
|
6565
|
+
return Le && l && ar(u);
|
|
6568
6566
|
}(t, o)) r.preventDefault(), O(e, Tr, !0);
|
|
6569
6567
|
else if (function(u, l) {
|
|
6570
|
-
return
|
|
6568
|
+
return Le && l && cr(u);
|
|
6571
6569
|
}(t, o)) r.preventDefault(), O(e, Tr, !1);
|
|
6572
6570
|
else if (function(u, l, a, c) {
|
|
6573
6571
|
return u.toLowerCase() === "b" && !l && gr(a, c);
|
|
6574
|
-
}(t, i, o, s)) r.preventDefault(), O(e,
|
|
6572
|
+
}(t, i, o, s)) r.preventDefault(), O(e, Re, "bold");
|
|
6575
6573
|
else if (function(u, l, a, c) {
|
|
6576
6574
|
return u.toLowerCase() === "u" && !l && gr(a, c);
|
|
6577
|
-
}(t, i, o, s)) r.preventDefault(), O(e,
|
|
6575
|
+
}(t, i, o, s)) r.preventDefault(), O(e, Re, "underline");
|
|
6578
6576
|
else if (function(u, l, a, c) {
|
|
6579
6577
|
return u.toLowerCase() === "i" && !l && gr(a, c);
|
|
6580
|
-
}(t, i, o, s)) r.preventDefault(), O(e,
|
|
6578
|
+
}(t, i, o, s)) r.preventDefault(), O(e, Re, "italic");
|
|
6581
6579
|
else if (/* @__PURE__ */ function(u, l, a, c) {
|
|
6582
6580
|
return u === "Tab" && !l && !a && !c;
|
|
6583
6581
|
}(t, i, s, o)) O(e, Ca, r);
|
|
@@ -6585,14 +6583,14 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6585
6583
|
return u.toLowerCase() === "z" && !l && gr(a, c);
|
|
6586
6584
|
}(t, n, o, s)) r.preventDefault(), O(e, Gs, void 0);
|
|
6587
6585
|
else if (function(u, l, a, c) {
|
|
6588
|
-
return
|
|
6586
|
+
return Le ? u.toLowerCase() === "z" && a && l : u.toLowerCase() === "y" && c || u.toLowerCase() === "z" && c && l;
|
|
6589
6587
|
}(t, n, o, s)) r.preventDefault(), O(e, Js, void 0);
|
|
6590
6588
|
else {
|
|
6591
6589
|
const u = e._editorState._selection;
|
|
6592
6590
|
u === null || B(u) ? !mt && Ji(t, o, s) && (r.preventDefault(), O(e, As, r)) : function(l, a, c, f) {
|
|
6593
|
-
return !a && l.toLowerCase() === "c" && (
|
|
6591
|
+
return !a && l.toLowerCase() === "c" && (Le ? c : f);
|
|
6594
6592
|
}(t, n, o, s) ? (r.preventDefault(), O(e, Ln, r)) : function(l, a, c, f) {
|
|
6595
|
-
return !a && l.toLowerCase() === "x" && (
|
|
6593
|
+
return !a && l.toLowerCase() === "x" && (Le ? c : f);
|
|
6596
6594
|
}(t, n, o, s) ? (r.preventDefault(), O(e, Qs, r)) : Ji(t, o, s) && (r.preventDefault(), O(e, As, r));
|
|
6597
6595
|
}
|
|
6598
6596
|
/* @__PURE__ */ (function(u, l, a, c) {
|
|
@@ -6629,7 +6627,7 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6629
6627
|
mt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), Pn || Or || Ys || !e.isComposing() || (wr = 0, he(null));
|
|
6630
6628
|
} else
|
|
6631
6629
|
ai(!1, e, n !== null ? n : void 0), fr && (ps(e, n || void 0), fr = !1);
|
|
6632
|
-
De(), yu(
|
|
6630
|
+
De(), yu(re());
|
|
6633
6631
|
}), Wt = null;
|
|
6634
6632
|
}], ["click", function(r, e) {
|
|
6635
6633
|
Ee(e, () => {
|
|
@@ -6637,12 +6635,12 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6637
6635
|
if (n) {
|
|
6638
6636
|
if (B(t)) {
|
|
6639
6637
|
const o = t.anchor, i = o.getNode();
|
|
6640
|
-
o.type === "element" && o.offset === 0 && t.isCollapsed() && !_e(i) &&
|
|
6638
|
+
o.type === "element" && o.offset === 0 && t.isCollapsed() && !_e(i) && ne().getChildrenSize() === 1 && i.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (n.removeAllRanges(), t.dirty = !0) : r.detail === 3 && !t.isCollapsed() && i !== t.focus.getNode() && (E(i) ? i.select(0) : i.getParentOrThrow().select(0));
|
|
6641
6639
|
} else if (r.pointerType === "touch") {
|
|
6642
6640
|
const o = n.anchorNode;
|
|
6643
6641
|
if (o !== null) {
|
|
6644
6642
|
const i = o.nodeType;
|
|
6645
|
-
(i === Rr || i === _t) &&
|
|
6643
|
+
(i === Rr || i === _t) && He(mi(s, n, e, r));
|
|
6646
6644
|
}
|
|
6647
6645
|
}
|
|
6648
6646
|
}
|
|
@@ -6657,7 +6655,7 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6657
6655
|
if (i === null) {
|
|
6658
6656
|
const h = zr();
|
|
6659
6657
|
if (!B(h)) return;
|
|
6660
|
-
|
|
6658
|
+
He(h.clone());
|
|
6661
6659
|
}
|
|
6662
6660
|
if (B(i)) {
|
|
6663
6661
|
const h = i.anchor.key === i.focus.key;
|
|
@@ -6730,16 +6728,16 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6730
6728
|
O(n, Tr, !1);
|
|
6731
6729
|
break;
|
|
6732
6730
|
case "formatStrikeThrough":
|
|
6733
|
-
O(n,
|
|
6731
|
+
O(n, Re, "strikethrough");
|
|
6734
6732
|
break;
|
|
6735
6733
|
case "formatBold":
|
|
6736
|
-
O(n,
|
|
6734
|
+
O(n, Re, "bold");
|
|
6737
6735
|
break;
|
|
6738
6736
|
case "formatItalic":
|
|
6739
|
-
O(n,
|
|
6737
|
+
O(n, Re, "italic");
|
|
6740
6738
|
break;
|
|
6741
6739
|
case "formatUnderline":
|
|
6742
|
-
O(n,
|
|
6740
|
+
O(n, Re, "underline");
|
|
6743
6741
|
break;
|
|
6744
6742
|
case "historyUndo":
|
|
6745
6743
|
O(n, Gs, void 0);
|
|
@@ -6763,7 +6761,7 @@ let wr = 0, Ru = null, ju = 0, Wt = null;
|
|
|
6763
6761
|
const An = /* @__PURE__ */ new WeakMap();
|
|
6764
6762
|
let Rs = !1, js = !1, Cr = !1, fr = !1, Iu = [0, "", 0, "root", 0];
|
|
6765
6763
|
function Mu(r, e, t, n, s) {
|
|
6766
|
-
const o = r.anchor, i = r.focus, u = o.getNode(), l =
|
|
6764
|
+
const o = r.anchor, i = r.focus, u = o.getNode(), l = re(), a = Fe(l._window), c = a !== null ? a.anchorNode : null, f = o.key, d = l.getElementByKey(f), h = t.length;
|
|
6767
6765
|
return f !== i.key || !L(u) || (!s && (!hn || ju < n + 50) || u.isDirty() && h < 2 || Au(t)) && o.offset !== i.offset && !u.isComposing() || Ct(u) || u.isDirty() && h > 1 || (s || !hn) && d !== null && !u.isComposing() && c !== yn(d) || a !== null && e !== null && (!e.collapsed || e.startContainer !== a.anchorNode || e.startOffset !== a.anchorOffset) || u.getFormat() !== r.format || u.getStyle() !== r.style || sc(r, u);
|
|
6768
6766
|
}
|
|
6769
6767
|
function eo(r, e) {
|
|
@@ -6772,14 +6770,14 @@ function eo(r, e) {
|
|
|
6772
6770
|
function to(r, e, t) {
|
|
6773
6771
|
const { anchorNode: n, anchorOffset: s, focusNode: o, focusOffset: i } = r;
|
|
6774
6772
|
Rs && (Rs = !1, eo(n, s) && eo(o, i)) || Ee(e, () => {
|
|
6775
|
-
if (!t) return void
|
|
6773
|
+
if (!t) return void He(null);
|
|
6776
6774
|
if (!jr(e, n, o)) return;
|
|
6777
6775
|
const u = j();
|
|
6778
6776
|
if (B(u)) {
|
|
6779
6777
|
const l = u.anchor, a = l.getNode();
|
|
6780
6778
|
if (u.isCollapsed()) {
|
|
6781
6779
|
r.type === "Range" && r.anchorNode === r.focusNode && (u.dirty = !0);
|
|
6782
|
-
const c = Mn(e).event, f = c ? c.timeStamp : performance.now(), [d, h, p, g, _] = Iu, D =
|
|
6780
|
+
const c = Mn(e).event, f = c ? c.timeStamp : performance.now(), [d, h, p, g, _] = Iu, D = ne(), y = e.isComposing() === !1 && D.getTextContent() === "";
|
|
6783
6781
|
if (f < _ + 200 && l.offset === p && l.key === g) u.format = d, u.style = h;
|
|
6784
6782
|
else if (l.type === "text") L(a) || N(141), u.format = a.getFormat(), u.style = a.getStyle();
|
|
6785
6783
|
else if (l.type === "element" && !y) {
|
|
@@ -6808,7 +6806,7 @@ function ps(r, e) {
|
|
|
6808
6806
|
const t = r._compositionKey;
|
|
6809
6807
|
if (he(null), t !== null && e != null) {
|
|
6810
6808
|
if (e === "") {
|
|
6811
|
-
const n =
|
|
6809
|
+
const n = pe(t), s = yn(r.getElementByKey(t));
|
|
6812
6810
|
return void (s !== null && s.nodeValue !== null && L(n) && ci(n, s.nodeValue, null, null, !0));
|
|
6813
6811
|
}
|
|
6814
6812
|
if (e[e.length - 1] === `
|
|
@@ -6836,7 +6834,7 @@ function zu(r) {
|
|
|
6836
6834
|
const a = zr(), c = t.anchorNode;
|
|
6837
6835
|
if (c === null) return;
|
|
6838
6836
|
const f = c.nodeType;
|
|
6839
|
-
f !== Rr && f !== _t ||
|
|
6837
|
+
f !== Rr && f !== _t || He(mi(a, t, n, r));
|
|
6840
6838
|
}));
|
|
6841
6839
|
const s = li(n), o = s[s.length - 1], i = o._key, u = Jt.get(i), l = u || o;
|
|
6842
6840
|
l !== n && to(t, l, !1), to(t, n, !0), n !== o ? Jt.set(i, n) : u && Jt.delete(i);
|
|
@@ -6877,12 +6875,12 @@ function Is(r, e, t) {
|
|
|
6877
6875
|
if (B(o) && e) {
|
|
6878
6876
|
const u = o.anchor, l = o.focus;
|
|
6879
6877
|
u.key === n && (kn(u, r, s, r.getPreviousSibling(), r.getNextSibling()), i = !0), l.key === n && (kn(l, r, s, r.getPreviousSibling(), r.getNextSibling()), i = !0);
|
|
6880
|
-
} else
|
|
6878
|
+
} else We(o) && e && r.isSelected() && r.selectPrevious();
|
|
6881
6879
|
if (B(o) && e && !i) {
|
|
6882
6880
|
const u = r.getIndexWithinParent();
|
|
6883
6881
|
kt(r), En(o, s, u, -1);
|
|
6884
6882
|
} else kt(r);
|
|
6885
|
-
t ||
|
|
6883
|
+
t || Ge(s) || s.canBeEmpty() || !s.isEmpty() || Is(s, e), e && _e(s) && s.isEmpty() && s.selectEnd();
|
|
6886
6884
|
}
|
|
6887
6885
|
class qn {
|
|
6888
6886
|
static getType() {
|
|
@@ -6907,7 +6905,7 @@ class qn {
|
|
|
6907
6905
|
let e = this.__key;
|
|
6908
6906
|
for (; e !== null; ) {
|
|
6909
6907
|
if (e === "root") return !0;
|
|
6910
|
-
const t =
|
|
6908
|
+
const t = pe(e);
|
|
6911
6909
|
if (t === null) break;
|
|
6912
6910
|
e = t.__parent;
|
|
6913
6911
|
}
|
|
@@ -6943,7 +6941,7 @@ class qn {
|
|
|
6943
6941
|
}
|
|
6944
6942
|
getParent() {
|
|
6945
6943
|
const e = this.getLatest().__parent;
|
|
6946
|
-
return e === null ? null :
|
|
6944
|
+
return e === null ? null : pe(e);
|
|
6947
6945
|
}
|
|
6948
6946
|
getParentOrThrow() {
|
|
6949
6947
|
const e = this.getParent();
|
|
@@ -6953,7 +6951,7 @@ class qn {
|
|
|
6953
6951
|
let e = this;
|
|
6954
6952
|
for (; e !== null; ) {
|
|
6955
6953
|
const t = e.getParent();
|
|
6956
|
-
if (
|
|
6954
|
+
if (Ge(t)) return E(e) || e === this && Y(e) || N(194), e;
|
|
6957
6955
|
e = t;
|
|
6958
6956
|
}
|
|
6959
6957
|
return null;
|
|
@@ -6976,7 +6974,7 @@ class qn {
|
|
|
6976
6974
|
}
|
|
6977
6975
|
getPreviousSibling() {
|
|
6978
6976
|
const e = this.getLatest().__prev;
|
|
6979
|
-
return e === null ? null :
|
|
6977
|
+
return e === null ? null : pe(e);
|
|
6980
6978
|
}
|
|
6981
6979
|
getPreviousSiblings() {
|
|
6982
6980
|
const e = [], t = this.getParent();
|
|
@@ -6987,7 +6985,7 @@ class qn {
|
|
|
6987
6985
|
}
|
|
6988
6986
|
getNextSibling() {
|
|
6989
6987
|
const e = this.getLatest().__next;
|
|
6990
|
-
return e === null ? null :
|
|
6988
|
+
return e === null ? null : pe(e);
|
|
6991
6989
|
}
|
|
6992
6990
|
getNextSiblings() {
|
|
6993
6991
|
const e = [];
|
|
@@ -7072,16 +7070,16 @@ class qn {
|
|
|
7072
7070
|
return t || n.reverse(), n;
|
|
7073
7071
|
}
|
|
7074
7072
|
isDirty() {
|
|
7075
|
-
const e =
|
|
7073
|
+
const e = re()._dirtyLeaves;
|
|
7076
7074
|
return e !== null && e.has(this.__key);
|
|
7077
7075
|
}
|
|
7078
7076
|
getLatest() {
|
|
7079
|
-
const e =
|
|
7077
|
+
const e = pe(this.__key);
|
|
7080
7078
|
return e === null && N(113), e;
|
|
7081
7079
|
}
|
|
7082
7080
|
getWritable() {
|
|
7083
7081
|
De();
|
|
7084
|
-
const e = it(), t =
|
|
7082
|
+
const e = it(), t = re(), n = e._nodeMap, s = this.__key, o = this.getLatest(), i = t._cloneNotNeeded, u = j();
|
|
7085
7083
|
if (u !== null && u.setCachedNodes(null), i.has(s)) return xn(o), o;
|
|
7086
7084
|
const l = hi(o);
|
|
7087
7085
|
return i.add(s), xn(l), n.set(s, l), l;
|
|
@@ -7123,7 +7121,7 @@ class qn {
|
|
|
7123
7121
|
if (Is(s, !1, !0), c === null ? l.__first = i : c.getWritable().__next = i, u.__prev = d, f === null ? l.__last = i : f.getWritable().__prev = i, u.__next = h, u.__parent = p, l.__size = a, t && (E(this) && E(u) || N(139), this.getChildren().forEach((g) => {
|
|
7124
7122
|
u.append(g);
|
|
7125
7123
|
})), B(n)) {
|
|
7126
|
-
|
|
7124
|
+
He(n);
|
|
7127
7125
|
const g = n.anchor, _ = n.focus;
|
|
7128
7126
|
g.key === o && uo(g, u), _.key === o && uo(_, u);
|
|
7129
7127
|
}
|
|
@@ -7252,7 +7250,7 @@ function yc(r) {
|
|
|
7252
7250
|
return { node: Ft() };
|
|
7253
7251
|
}
|
|
7254
7252
|
function Ft() {
|
|
7255
|
-
return
|
|
7253
|
+
return Ye(new Mr());
|
|
7256
7254
|
}
|
|
7257
7255
|
function St(r) {
|
|
7258
7256
|
return r instanceof Mr;
|
|
@@ -7616,7 +7614,7 @@ function ct(r) {
|
|
|
7616
7614
|
return e === void 0 ? { node: null } : { forChild: gi(r.style, e), node: null };
|
|
7617
7615
|
}
|
|
7618
7616
|
function ce(r = "") {
|
|
7619
|
-
return
|
|
7617
|
+
return Ye(new tr(r));
|
|
7620
7618
|
}
|
|
7621
7619
|
function L(r) {
|
|
7622
7620
|
return r instanceof tr;
|
|
@@ -7665,7 +7663,7 @@ class $r extends tr {
|
|
|
7665
7663
|
}
|
|
7666
7664
|
}
|
|
7667
7665
|
function qr() {
|
|
7668
|
-
return
|
|
7666
|
+
return Ye(new $r());
|
|
7669
7667
|
}
|
|
7670
7668
|
function wc(r) {
|
|
7671
7669
|
return r instanceof $r;
|
|
@@ -7691,7 +7689,7 @@ class Cc {
|
|
|
7691
7689
|
return t === n ? s < o : t.isBefore(n);
|
|
7692
7690
|
}
|
|
7693
7691
|
getNode() {
|
|
7694
|
-
const e =
|
|
7692
|
+
const e = pe(this.key);
|
|
7695
7693
|
return e === null && N(20), e;
|
|
7696
7694
|
}
|
|
7697
7695
|
set(e, t, n) {
|
|
@@ -7699,7 +7697,7 @@ class Cc {
|
|
|
7699
7697
|
this.key = e, this.offset = t, this.type = n, Ur() || (ht() === o && he(e), s !== null && (s.setCachedNodes(null), s.dirty = !0));
|
|
7700
7698
|
}
|
|
7701
7699
|
}
|
|
7702
|
-
function
|
|
7700
|
+
function Je(r, e, t) {
|
|
7703
7701
|
return new Cc(r, e, t);
|
|
7704
7702
|
}
|
|
7705
7703
|
function ys(r, e) {
|
|
@@ -7738,7 +7736,7 @@ class zn {
|
|
|
7738
7736
|
this._cachedNodes = e;
|
|
7739
7737
|
}
|
|
7740
7738
|
is(e) {
|
|
7741
|
-
if (!
|
|
7739
|
+
if (!We(e)) return !1;
|
|
7742
7740
|
const t = this._nodes, n = e._nodes;
|
|
7743
7741
|
return t.size === n.size && Array.from(t).every((s) => n.has(s));
|
|
7744
7742
|
}
|
|
@@ -7789,7 +7787,7 @@ class zn {
|
|
|
7789
7787
|
if (e !== null) return e;
|
|
7790
7788
|
const t = this._nodes, n = [];
|
|
7791
7789
|
for (const s of t) {
|
|
7792
|
-
const o =
|
|
7790
|
+
const o = pe(s);
|
|
7793
7791
|
o !== null && n.push(o);
|
|
7794
7792
|
}
|
|
7795
7793
|
return Ur() || (this._cachedNodes = n), n;
|
|
@@ -7857,14 +7855,14 @@ class xt {
|
|
|
7857
7855
|
return a;
|
|
7858
7856
|
}
|
|
7859
7857
|
applyDOMRange(e) {
|
|
7860
|
-
const t =
|
|
7858
|
+
const t = re(), n = t.getEditorState()._selection, s = Ku(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, n);
|
|
7861
7859
|
if (s === null) return;
|
|
7862
7860
|
const [o, i] = s;
|
|
7863
7861
|
ft(this.anchor, o.key, o.offset, o.type), ft(this.focus, i.key, i.offset, i.type), this._cachedNodes = null;
|
|
7864
7862
|
}
|
|
7865
7863
|
clone() {
|
|
7866
7864
|
const e = this.anchor, t = this.focus;
|
|
7867
|
-
return new xt(
|
|
7865
|
+
return new xt(Je(e.key, e.offset, e.type), Je(t.key, t.offset, t.type), this.format, this.style);
|
|
7868
7866
|
}
|
|
7869
7867
|
toggleFormat(e) {
|
|
7870
7868
|
this.format = _n(this.format, e, null), this.dirty = !0;
|
|
@@ -8095,7 +8093,7 @@ class xt {
|
|
|
8095
8093
|
insertParagraph() {
|
|
8096
8094
|
if (this.anchor.key === "root") {
|
|
8097
8095
|
const i = le();
|
|
8098
|
-
return
|
|
8096
|
+
return ne().splice(this.anchor.offset, 0, [i]), i.select(), i;
|
|
8099
8097
|
}
|
|
8100
8098
|
const e = _s(this), t = dr(this.anchor.getNode(), dt);
|
|
8101
8099
|
E(t) || N(213);
|
|
@@ -8137,7 +8135,7 @@ class xt {
|
|
|
8137
8135
|
if (Y(u) && !u.isIsolated()) {
|
|
8138
8136
|
if (i && u.isKeyboardSelectable()) {
|
|
8139
8137
|
const h = ho();
|
|
8140
|
-
return h.add(u.__key), void
|
|
8138
|
+
return h.add(u.__key), void He(h);
|
|
8141
8139
|
}
|
|
8142
8140
|
const d = t ? u.getPreviousSibling() : u.getNextSibling();
|
|
8143
8141
|
if (L(d)) {
|
|
@@ -8150,7 +8148,7 @@ class xt {
|
|
|
8150
8148
|
return E(d) ? (g = d.__key, p = t ? d.getChildrenSize() : 0) : (p = u.getIndexWithinParent(), g = h.__key, t || p++), s.set(g, p, "element"), void (i && o.set(g, p, "element"));
|
|
8151
8149
|
}
|
|
8152
8150
|
}
|
|
8153
|
-
const l =
|
|
8151
|
+
const l = re(), a = Fe(l._window);
|
|
8154
8152
|
if (!a) return;
|
|
8155
8153
|
const c = l._blockCursorElement, f = l._rootElement;
|
|
8156
8154
|
if (f === null || c === null || !E(u) || u.isInline() || u.canBeEmpty() || fi(c, l, f), function(d, h, p, g) {
|
|
@@ -8196,9 +8194,9 @@ class xt {
|
|
|
8196
8194
|
if (i.isKeyboardSelectable() && E(s) && s.getChildrenSize() === 0) {
|
|
8197
8195
|
s.remove();
|
|
8198
8196
|
const u = ho();
|
|
8199
|
-
u.add(i.__key),
|
|
8197
|
+
u.add(i.__key), He(u);
|
|
8200
8198
|
} else
|
|
8201
|
-
i.remove(),
|
|
8199
|
+
i.remove(), re().dispatchCommand(Hs, void 0);
|
|
8202
8200
|
return;
|
|
8203
8201
|
}
|
|
8204
8202
|
if (!e && E(i) && E(s) && s.isEmpty()) return s.remove(), void i.selectStart();
|
|
@@ -8253,7 +8251,7 @@ class xt {
|
|
|
8253
8251
|
return [this.anchor, this.focus];
|
|
8254
8252
|
}
|
|
8255
8253
|
}
|
|
8256
|
-
function
|
|
8254
|
+
function We(r) {
|
|
8257
8255
|
return r instanceof zn;
|
|
8258
8256
|
}
|
|
8259
8257
|
function lo(r) {
|
|
@@ -8313,10 +8311,10 @@ function co(r, e, t, n) {
|
|
|
8313
8311
|
const h = d.getIndexWithinParent();
|
|
8314
8312
|
o = e === 0 && Y(d) && Vt(r) === d ? h : h + 1, d = d.getParentOrThrow();
|
|
8315
8313
|
}
|
|
8316
|
-
if (E(d)) return
|
|
8314
|
+
if (E(d)) return Je(d.__key, o, "element");
|
|
8317
8315
|
}
|
|
8318
8316
|
} else s = Vt(r);
|
|
8319
|
-
return L(s) ?
|
|
8317
|
+
return L(s) ? Je(s.__key, o, "text") : null;
|
|
8320
8318
|
}
|
|
8321
8319
|
function fo(r, e, t) {
|
|
8322
8320
|
const n = r.offset, s = r.getNode();
|
|
@@ -8341,7 +8339,7 @@ function Vu(r, e, t) {
|
|
|
8341
8339
|
if (r.type === "text" && e.type === "text") {
|
|
8342
8340
|
const n = r.isBefore(e), s = r.is(e);
|
|
8343
8341
|
fo(r, n, s), fo(e, !n, s), s && (e.key = r.key, e.offset = r.offset, e.type = r.type);
|
|
8344
|
-
const o =
|
|
8342
|
+
const o = re();
|
|
8345
8343
|
if (o.isComposing() && o._compositionKey !== r.key && B(t)) {
|
|
8346
8344
|
const i = t.anchor, u = t.focus;
|
|
8347
8345
|
ft(r, i.key, i.offset, i.type), ft(e, u.key, u.offset, u.type);
|
|
@@ -8364,11 +8362,11 @@ function $s(r) {
|
|
|
8364
8362
|
return E(r) && !r.isInline();
|
|
8365
8363
|
}
|
|
8366
8364
|
function Hu(r, e, t, n, s, o) {
|
|
8367
|
-
const i = it(), u = new xt(
|
|
8365
|
+
const i = it(), u = new xt(Je(r, e, s), Je(t, n, o), 0, "");
|
|
8368
8366
|
return u.dirty = !0, i._selection = u, u;
|
|
8369
8367
|
}
|
|
8370
8368
|
function Ac() {
|
|
8371
|
-
const r =
|
|
8369
|
+
const r = Je("root", 0, "element"), e = Je("root", 0, "element");
|
|
8372
8370
|
return new xt(r, e, 0, "");
|
|
8373
8371
|
}
|
|
8374
8372
|
function ho() {
|
|
@@ -8391,7 +8389,7 @@ function j() {
|
|
|
8391
8389
|
return it()._selection;
|
|
8392
8390
|
}
|
|
8393
8391
|
function zr() {
|
|
8394
|
-
return
|
|
8392
|
+
return re()._editorState._selection;
|
|
8395
8393
|
}
|
|
8396
8394
|
function En(r, e, t, n = 1) {
|
|
8397
8395
|
const s = r.anchor, o = r.focus, i = s.getNode(), u = o.getNode();
|
|
@@ -8469,34 +8467,34 @@ function Ec(r, e, t, n, s, o, i) {
|
|
|
8469
8467
|
if (!s.has("skip-scroll-into-view") && e.isCollapsed() && o !== null && o === document.activeElement) {
|
|
8470
8468
|
const W = e instanceof xt && e.anchor.type === "element" ? k.childNodes[y] || null : n.rangeCount > 0 ? n.getRangeAt(0) : null;
|
|
8471
8469
|
if (W !== null) {
|
|
8472
|
-
let
|
|
8470
|
+
let ee;
|
|
8473
8471
|
if (W instanceof Text) {
|
|
8474
8472
|
const Se = document.createRange();
|
|
8475
|
-
Se.selectNode(W),
|
|
8476
|
-
} else
|
|
8477
|
-
(function(Se,
|
|
8473
|
+
Se.selectNode(W), ee = Se.getBoundingClientRect();
|
|
8474
|
+
} else ee = W.getBoundingClientRect();
|
|
8475
|
+
(function(Se, Me, vt) {
|
|
8478
8476
|
const ut = vt.ownerDocument, ae = ut.defaultView;
|
|
8479
8477
|
if (ae === null) return;
|
|
8480
|
-
let { top:
|
|
8478
|
+
let { top: Xe, bottom: $e } = Me, lt = 0, at = 0, ve = vt;
|
|
8481
8479
|
for (; ve !== null; ) {
|
|
8482
8480
|
const Ze = ve === ut.body;
|
|
8483
8481
|
if (Ze) lt = 0, at = Mn(Se).innerHeight;
|
|
8484
8482
|
else {
|
|
8485
|
-
const
|
|
8486
|
-
lt =
|
|
8483
|
+
const qe = ve.getBoundingClientRect();
|
|
8484
|
+
lt = qe.top, at = qe.bottom;
|
|
8487
8485
|
}
|
|
8488
8486
|
let Te = 0;
|
|
8489
|
-
if (
|
|
8487
|
+
if (Xe < lt ? Te = -(lt - Xe) : $e > at && (Te = $e - at), Te !== 0) if (Ze) ae.scrollBy(0, Te);
|
|
8490
8488
|
else {
|
|
8491
|
-
const
|
|
8489
|
+
const qe = ve.scrollTop;
|
|
8492
8490
|
ve.scrollTop += Te;
|
|
8493
|
-
const et = ve.scrollTop -
|
|
8494
|
-
|
|
8491
|
+
const et = ve.scrollTop - qe;
|
|
8492
|
+
Xe -= et, $e -= et;
|
|
8495
8493
|
}
|
|
8496
8494
|
if (Ze) break;
|
|
8497
8495
|
ve = Ir(ve);
|
|
8498
8496
|
}
|
|
8499
|
-
})(t,
|
|
8497
|
+
})(t, ee, o);
|
|
8500
8498
|
}
|
|
8501
8499
|
}
|
|
8502
8500
|
Rs = !0;
|
|
@@ -8504,7 +8502,7 @@ function Ec(r, e, t, n, s, o, i) {
|
|
|
8504
8502
|
}
|
|
8505
8503
|
function kc(r) {
|
|
8506
8504
|
let e = j() || zr();
|
|
8507
|
-
e === null && (e =
|
|
8505
|
+
e === null && (e = ne().selectEnd()), e.insertNodes(r);
|
|
8508
8506
|
}
|
|
8509
8507
|
function _s(r) {
|
|
8510
8508
|
let e = r;
|
|
@@ -8520,7 +8518,7 @@ function Sc(r, e) {
|
|
|
8520
8518
|
const t = r.getParent();
|
|
8521
8519
|
if (!t) {
|
|
8522
8520
|
const s = le();
|
|
8523
|
-
return
|
|
8521
|
+
return ne().append(s), s.select(), [ne(), 0];
|
|
8524
8522
|
}
|
|
8525
8523
|
if (L(r)) {
|
|
8526
8524
|
const s = r.splitText(e);
|
|
@@ -8531,7 +8529,7 @@ function Sc(r, e) {
|
|
|
8531
8529
|
if (!E(r) || e === 0) return [t, r.getIndexWithinParent()];
|
|
8532
8530
|
const n = r.getChildAtIndex(e);
|
|
8533
8531
|
if (n) {
|
|
8534
|
-
const s = new xt(
|
|
8532
|
+
const s = new xt(Je(r.__key, e, "element"), Je(r.__key, e, "element"), 0, ""), o = r.insertNewAfter(s);
|
|
8535
8533
|
o && o.append(n, ...n.getNextSiblings());
|
|
8536
8534
|
}
|
|
8537
8535
|
return [t, r.getIndexWithinParent() + 1];
|
|
@@ -8550,7 +8548,7 @@ function Gu() {
|
|
|
8550
8548
|
function it() {
|
|
8551
8549
|
return de === null && N(195, Ju()), de;
|
|
8552
8550
|
}
|
|
8553
|
-
function
|
|
8551
|
+
function re() {
|
|
8554
8552
|
return fe === null && N(196, Ju()), fe;
|
|
8555
8553
|
}
|
|
8556
8554
|
function Ju() {
|
|
@@ -8591,7 +8589,7 @@ function Qu(r, e) {
|
|
|
8591
8589
|
for (const s of n) t.add(s);
|
|
8592
8590
|
}
|
|
8593
8591
|
function Bc(r) {
|
|
8594
|
-
return yi(r,
|
|
8592
|
+
return yi(r, re()._nodes);
|
|
8595
8593
|
}
|
|
8596
8594
|
function yi(r, e) {
|
|
8597
8595
|
const t = r.type, n = e.get(t);
|
|
@@ -8656,8 +8654,8 @@ function pt(r, e) {
|
|
|
8656
8654
|
p !== null && function(b, k, A, S, P) {
|
|
8657
8655
|
const F = Array.from(b._listeners.mutation), U = F.length;
|
|
8658
8656
|
for (let $ = 0; $ < U; $++) {
|
|
8659
|
-
const [I, W] = F[$],
|
|
8660
|
-
|
|
8657
|
+
const [I, W] = F[$], ee = k.get(W);
|
|
8658
|
+
ee !== void 0 && I(ee, { dirtyLeaves: S, prevEditorState: P, updateTags: A });
|
|
8661
8659
|
}
|
|
8662
8660
|
}(r, p, y, g, o), B(u) || u === null || i !== null && i.is(u) || r.dispatchCommand(Hs, void 0);
|
|
8663
8661
|
const C = r._pendingDecorators;
|
|
@@ -8807,7 +8805,7 @@ function Xu(r, e, t) {
|
|
|
8807
8805
|
if (B(_)) {
|
|
8808
8806
|
const D = l._nodeMap, y = _.anchor.key, w = _.focus.key;
|
|
8809
8807
|
D.get(y) !== void 0 && D.get(w) !== void 0 || N(19);
|
|
8810
|
-
} else
|
|
8808
|
+
} else We(_) && _._nodes.size === 0 && (l._selection = null);
|
|
8811
8809
|
} catch (g) {
|
|
8812
8810
|
return g instanceof Error && r._onError(g), r._pendingEditorState = u, r._dirtyType = Yt, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void pt(r);
|
|
8813
8811
|
} finally {
|
|
@@ -8956,7 +8954,7 @@ class ot extends qn {
|
|
|
8956
8954
|
return this.getChildrenSize() === 0;
|
|
8957
8955
|
}
|
|
8958
8956
|
isDirty() {
|
|
8959
|
-
const e =
|
|
8957
|
+
const e = re()._dirtyElements;
|
|
8960
8958
|
return e !== null && e.has(this.__key);
|
|
8961
8959
|
}
|
|
8962
8960
|
isLastChild() {
|
|
@@ -9004,7 +9002,7 @@ class ot extends qn {
|
|
|
9004
9002
|
}
|
|
9005
9003
|
getFirstChild() {
|
|
9006
9004
|
const e = this.getLatest().__first;
|
|
9007
|
-
return e === null ? null :
|
|
9005
|
+
return e === null ? null : pe(e);
|
|
9008
9006
|
}
|
|
9009
9007
|
getFirstChildOrThrow() {
|
|
9010
9008
|
const e = this.getFirstChild();
|
|
@@ -9012,7 +9010,7 @@ class ot extends qn {
|
|
|
9012
9010
|
}
|
|
9013
9011
|
getLastChild() {
|
|
9014
9012
|
const e = this.getLatest().__last;
|
|
9015
|
-
return e === null ? null :
|
|
9013
|
+
return e === null ? null : pe(e);
|
|
9016
9014
|
}
|
|
9017
9015
|
getLastChildOrThrow() {
|
|
9018
9016
|
const e = this.getLastChild();
|
|
@@ -9153,7 +9151,7 @@ class ot extends qn {
|
|
|
9153
9151
|
const p = j();
|
|
9154
9152
|
if (B(p)) {
|
|
9155
9153
|
const g = new Set(a), _ = new Set(l), { anchor: D, focus: y } = p;
|
|
9156
|
-
Do(D, g, _) && kn(D, D.getNode(), this, f, c), Do(y, g, _) && kn(y, y.getNode(), this, f, c), d !== 0 || this.canBeEmpty() ||
|
|
9154
|
+
Do(D, g, _) && kn(D, D.getNode(), this, f, c), Do(y, g, _) && kn(y, y.getNode(), this, f, c), d !== 0 || this.canBeEmpty() || Ge(this) || this.remove();
|
|
9157
9155
|
}
|
|
9158
9156
|
}
|
|
9159
9157
|
return i;
|
|
@@ -9270,7 +9268,7 @@ class Wr extends ot {
|
|
|
9270
9268
|
}
|
|
9271
9269
|
getTextContent() {
|
|
9272
9270
|
const e = this.__cachedText;
|
|
9273
|
-
return !Ur() &&
|
|
9271
|
+
return !Ur() && re()._dirtyType !== Tt || e === null ? super.getTextContent() : e;
|
|
9274
9272
|
}
|
|
9275
9273
|
remove() {
|
|
9276
9274
|
N(52);
|
|
@@ -9295,7 +9293,7 @@ class Wr extends ot {
|
|
|
9295
9293
|
return super.append(...e);
|
|
9296
9294
|
}
|
|
9297
9295
|
static importJSON(e) {
|
|
9298
|
-
const t =
|
|
9296
|
+
const t = ne();
|
|
9299
9297
|
return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t;
|
|
9300
9298
|
}
|
|
9301
9299
|
exportJSON() {
|
|
@@ -9342,7 +9340,7 @@ class Un {
|
|
|
9342
9340
|
return t._readOnly = !0, t;
|
|
9343
9341
|
}
|
|
9344
9342
|
toJSON() {
|
|
9345
|
-
return xo(null, this, () => ({ root: el(
|
|
9343
|
+
return xo(null, this, () => ({ root: el(ne()) }));
|
|
9346
9344
|
}
|
|
9347
9345
|
}
|
|
9348
9346
|
class xi extends ot {
|
|
@@ -9435,7 +9433,7 @@ function Fc(r) {
|
|
|
9435
9433
|
return r.style && (e.setFormat(r.style.textAlign), pi(r, e)), { node: e };
|
|
9436
9434
|
}
|
|
9437
9435
|
function le() {
|
|
9438
|
-
return
|
|
9436
|
+
return Ye(new rr());
|
|
9439
9437
|
}
|
|
9440
9438
|
function Zt(r) {
|
|
9441
9439
|
return r instanceof rr;
|
|
@@ -9565,7 +9563,7 @@ class Wn {
|
|
|
9565
9563
|
return i = this, u = e.getType(), Ee(i, () => {
|
|
9566
9564
|
const l = it();
|
|
9567
9565
|
if (l.isEmpty()) return;
|
|
9568
|
-
if (u === "root") return void
|
|
9566
|
+
if (u === "root") return void ne().markDirty();
|
|
9569
9567
|
const a = l._nodeMap;
|
|
9570
9568
|
for (const [, c] of a) c.markDirty();
|
|
9571
9569
|
}, i._pendingEditorState === null ? { tag: "history-merge" } : void 0), () => {
|
|
@@ -9677,7 +9675,7 @@ class Wn {
|
|
|
9677
9675
|
focus(e, t = {}) {
|
|
9678
9676
|
const n = this._rootElement;
|
|
9679
9677
|
n !== null && (n.setAttribute("autocapitalize", "off"), Ee(this, () => {
|
|
9680
|
-
const s = j(), o =
|
|
9678
|
+
const s = j(), o = ne();
|
|
9681
9679
|
s !== null ? s.dirty = !0 : o.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? o.selectStart() : o.selectEnd());
|
|
9682
9680
|
}, { onUpdate: () => {
|
|
9683
9681
|
n.removeAttribute("autocapitalize"), e && e();
|
|
@@ -9700,14 +9698,14 @@ class Wn {
|
|
|
9700
9698
|
}
|
|
9701
9699
|
}
|
|
9702
9700
|
Wn.version = "0.21.0+prod.esm";
|
|
9703
|
-
const rl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = rl ? er :
|
|
9701
|
+
const rl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = rl ? er : ge, nn = { tag: "history-merge" };
|
|
9704
9702
|
function Rc({ initialConfig: r, children: e }) {
|
|
9705
9703
|
const t = Pt(() => {
|
|
9706
9704
|
const { theme: n, namespace: s, nodes: o, onError: i, editorState: u, html: l } = r, a = _a(null, n), c = Pc({ editable: r.editable, html: l, namespace: s, nodes: o, onError: (f) => i(f, c), theme: n });
|
|
9707
9705
|
return function(f, d) {
|
|
9708
9706
|
if (d !== null) {
|
|
9709
9707
|
if (d === void 0) f.update(() => {
|
|
9710
|
-
const h =
|
|
9708
|
+
const h = ne();
|
|
9711
9709
|
if (h.isEmpty()) {
|
|
9712
9710
|
const p = le();
|
|
9713
9711
|
h.append(p);
|
|
@@ -9726,7 +9724,7 @@ function Rc({ initialConfig: r, children: e }) {
|
|
|
9726
9724
|
break;
|
|
9727
9725
|
case "function":
|
|
9728
9726
|
f.update(() => {
|
|
9729
|
-
|
|
9727
|
+
ne().isEmpty() && d(f);
|
|
9730
9728
|
}, nn);
|
|
9731
9729
|
}
|
|
9732
9730
|
}
|
|
@@ -9737,13 +9735,13 @@ function Rc({ initialConfig: r, children: e }) {
|
|
|
9737
9735
|
s.setEditable(n === void 0 || n);
|
|
9738
9736
|
}, []), v.jsx(eu.Provider, { value: t, children: e });
|
|
9739
9737
|
}
|
|
9740
|
-
const jc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
9738
|
+
const jc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
|
|
9741
9739
|
function Ic(r) {
|
|
9742
9740
|
return { initialValueFn: () => r.isEditable(), subscribe: (e) => r.registerEditableListener(e) };
|
|
9743
9741
|
}
|
|
9744
9742
|
function Mc() {
|
|
9745
9743
|
return function(r) {
|
|
9746
|
-
const [e] =
|
|
9744
|
+
const [e] = Qe(), t = Pt(() => r(e), [e, r]), [n, s] = Q(() => t.initialValueFn()), o = bs(n);
|
|
9747
9745
|
return jc(() => {
|
|
9748
9746
|
const { initialValueFn: i, subscribe: u } = t, l = i();
|
|
9749
9747
|
return o.current !== l && (o.current = l, s(l)), u((a) => {
|
|
@@ -9753,7 +9751,7 @@ function Mc() {
|
|
|
9753
9751
|
}(Ic);
|
|
9754
9752
|
}
|
|
9755
9753
|
function $c() {
|
|
9756
|
-
return
|
|
9754
|
+
return ne().getTextContent();
|
|
9757
9755
|
}
|
|
9758
9756
|
function qc(r, e = !0) {
|
|
9759
9757
|
if (r) return !1;
|
|
@@ -9762,7 +9760,7 @@ function qc(r, e = !0) {
|
|
|
9762
9760
|
}
|
|
9763
9761
|
function zc(r) {
|
|
9764
9762
|
if (!qc(r, !1)) return !1;
|
|
9765
|
-
const e =
|
|
9763
|
+
const e = ne().getChildren(), t = e.length;
|
|
9766
9764
|
if (t > 1) return !1;
|
|
9767
9765
|
for (let n = 0; n < t; n++) {
|
|
9768
9766
|
const s = e[n];
|
|
@@ -9830,7 +9828,7 @@ function Jc(r, e) {
|
|
|
9830
9828
|
if (r === null) return;
|
|
9831
9829
|
const t = r.getStartEndPoints(), n = t ? t[0] : null;
|
|
9832
9830
|
if (n !== null && n.key === "root") {
|
|
9833
|
-
const i = e(), u =
|
|
9831
|
+
const i = e(), u = ne(), l = u.getFirstChild();
|
|
9834
9832
|
return void (l ? l.replace(i, !0) : u.append(i));
|
|
9835
9833
|
}
|
|
9836
9834
|
const s = r.getNodes(), o = n !== null && function(i, u) {
|
|
@@ -9863,7 +9861,7 @@ function Co(r, e, t) {
|
|
|
9863
9861
|
Qc(r, e, t ? !n : n, "character");
|
|
9864
9862
|
}
|
|
9865
9863
|
function Ao(r) {
|
|
9866
|
-
if (Y(r) || !E(r) ||
|
|
9864
|
+
if (Y(r) || !E(r) || Ge(r)) return !1;
|
|
9867
9865
|
const e = r.getFirstChild(), t = e === null || St(e) || L(e) || e.isInline();
|
|
9868
9866
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
9869
9867
|
}
|
|
@@ -9911,7 +9909,7 @@ function rd(r) {
|
|
|
9911
9909
|
}
|
|
9912
9910
|
const Vn = (r, e) => {
|
|
9913
9911
|
let t = r;
|
|
9914
|
-
for (; t !==
|
|
9912
|
+
for (; t !== ne() && t != null; ) {
|
|
9915
9913
|
if (e(t)) return t;
|
|
9916
9914
|
t = t.getParent();
|
|
9917
9915
|
}
|
|
@@ -9983,7 +9981,7 @@ function ll(r, e) {
|
|
|
9983
9981
|
}
|
|
9984
9982
|
function al(r, e) {
|
|
9985
9983
|
if (typeof document > "u" || typeof window > "u" && global.window === void 0) throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");
|
|
9986
|
-
const t = document.createElement("div"), n =
|
|
9984
|
+
const t = document.createElement("div"), n = ne().getChildren();
|
|
9987
9985
|
for (let s = 0; s < n.length; s++)
|
|
9988
9986
|
cl(r, n[s], t, e);
|
|
9989
9987
|
return t.innerHTML;
|
|
@@ -10040,7 +10038,7 @@ function fl(r, e, t, n, s = /* @__PURE__ */ new Map(), o) {
|
|
|
10040
10038
|
}
|
|
10041
10039
|
const f = r.childNodes;
|
|
10042
10040
|
let d = [];
|
|
10043
|
-
const h = (u == null || !
|
|
10041
|
+
const h = (u == null || !Ge(u)) && (u != null && $s(u) || n);
|
|
10044
10042
|
for (let p = 0; p < f.length; p++) d.push(...fl(f[p], e, t, h, new Map(s), u));
|
|
10045
10043
|
return c != null && (d = c(d)), bn(r) && (d = sd(r, d, h ? () => {
|
|
10046
10044
|
const p = new xi();
|
|
@@ -10143,7 +10141,7 @@ function hl(r, e, t, n = []) {
|
|
|
10143
10141
|
return s;
|
|
10144
10142
|
}
|
|
10145
10143
|
function ld(r, e) {
|
|
10146
|
-
const t = [], n =
|
|
10144
|
+
const t = [], n = ne().getChildren();
|
|
10147
10145
|
for (let s = 0; s < n.length; s++)
|
|
10148
10146
|
hl(r, e, n[s], t);
|
|
10149
10147
|
return { namespace: r._config.namespace, nodes: t };
|
|
@@ -10271,7 +10269,7 @@ class Kn extends ot {
|
|
|
10271
10269
|
}
|
|
10272
10270
|
}
|
|
10273
10271
|
function vi() {
|
|
10274
|
-
return
|
|
10272
|
+
return Ye(new Kn());
|
|
10275
10273
|
}
|
|
10276
10274
|
class Hn extends ot {
|
|
10277
10275
|
static getType() {
|
|
@@ -10350,7 +10348,7 @@ function _d(r) {
|
|
|
10350
10348
|
return r.style !== null && (e.setFormat(r.style.textAlign), pi(r, e)), { node: e };
|
|
10351
10349
|
}
|
|
10352
10350
|
function yr(r) {
|
|
10353
|
-
return
|
|
10351
|
+
return Ye(new Hn(r));
|
|
10354
10352
|
}
|
|
10355
10353
|
function sn(r) {
|
|
10356
10354
|
let e = null;
|
|
@@ -10379,7 +10377,7 @@ function on(r) {
|
|
|
10379
10377
|
function xd(r) {
|
|
10380
10378
|
return Ot(r.registerCommand(tu, (e) => {
|
|
10381
10379
|
const t = j();
|
|
10382
|
-
return !!
|
|
10380
|
+
return !!We(t) && (t.clear(), !0);
|
|
10383
10381
|
}, 0), r.registerCommand(Et, (e) => {
|
|
10384
10382
|
const t = j();
|
|
10385
10383
|
return !!B(t) && (t.deleteCharacter(e), !0);
|
|
@@ -10405,12 +10403,12 @@ function xd(r) {
|
|
|
10405
10403
|
}, G), r.registerCommand(Cs, () => {
|
|
10406
10404
|
const e = j();
|
|
10407
10405
|
return !!B(e) && (e.removeText(), !0);
|
|
10408
|
-
}, G), r.registerCommand(
|
|
10406
|
+
}, G), r.registerCommand(Re, (e) => {
|
|
10409
10407
|
const t = j();
|
|
10410
10408
|
return !!B(t) && (t.formatText(e), !0);
|
|
10411
10409
|
}, G), r.registerCommand(ka, (e) => {
|
|
10412
10410
|
const t = j();
|
|
10413
|
-
if (!B(t) && !
|
|
10411
|
+
if (!B(t) && !We(t)) return !1;
|
|
10414
10412
|
const n = t.getNodes();
|
|
10415
10413
|
for (const s of n) {
|
|
10416
10414
|
const o = Vn(s, (i) => E(i) && !i.isInline());
|
|
@@ -10431,7 +10429,7 @@ function xd(r) {
|
|
|
10431
10429
|
t > 0 && e.setIndent(t - 1);
|
|
10432
10430
|
}), G), r.registerCommand(su, (e) => {
|
|
10433
10431
|
const t = j();
|
|
10434
|
-
if (
|
|
10432
|
+
if (We(t) && !on(e.target)) {
|
|
10435
10433
|
const n = t.getNodes();
|
|
10436
10434
|
if (n.length > 0) return n[0].selectPrevious(), !0;
|
|
10437
10435
|
} else if (B(t)) {
|
|
@@ -10441,13 +10439,13 @@ function xd(r) {
|
|
|
10441
10439
|
return !1;
|
|
10442
10440
|
}, G), r.registerCommand(iu, (e) => {
|
|
10443
10441
|
const t = j();
|
|
10444
|
-
if (
|
|
10442
|
+
if (We(t)) {
|
|
10445
10443
|
const n = t.getNodes();
|
|
10446
10444
|
if (n.length > 0) return n[0].selectNext(0, 0), !0;
|
|
10447
10445
|
} else if (B(t)) {
|
|
10448
10446
|
if (function(s) {
|
|
10449
10447
|
const o = s.focus;
|
|
10450
|
-
return o.key === "root" && o.offset ===
|
|
10448
|
+
return o.key === "root" && o.offset === ne().getChildrenSize();
|
|
10451
10449
|
}(t)) return e.preventDefault(), !0;
|
|
10452
10450
|
const n = Br(t.focus, !1);
|
|
10453
10451
|
if (!e.shiftKey && Y(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), e.preventDefault(), !0;
|
|
@@ -10455,7 +10453,7 @@ function xd(r) {
|
|
|
10455
10453
|
return !1;
|
|
10456
10454
|
}, G), r.registerCommand(nu, (e) => {
|
|
10457
10455
|
const t = j();
|
|
10458
|
-
if (
|
|
10456
|
+
if (We(t)) {
|
|
10459
10457
|
const n = t.getNodes();
|
|
10460
10458
|
if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
|
|
10461
10459
|
}
|
|
@@ -10467,7 +10465,7 @@ function xd(r) {
|
|
|
10467
10465
|
return !1;
|
|
10468
10466
|
}, G), r.registerCommand(ru, (e) => {
|
|
10469
10467
|
const t = j();
|
|
10470
|
-
if (
|
|
10468
|
+
if (We(t) && !on(e.target)) {
|
|
10471
10469
|
const s = t.getNodes();
|
|
10472
10470
|
if (s.length > 0) return e.preventDefault(), s[0].selectNext(0, 0), !0;
|
|
10473
10471
|
}
|
|
@@ -10509,7 +10507,7 @@ function xd(r) {
|
|
|
10509
10507
|
l.anchor.set(c, f, "element"), l.focus.set(c, f, "element");
|
|
10510
10508
|
}
|
|
10511
10509
|
const a = xu(l);
|
|
10512
|
-
|
|
10510
|
+
He(a);
|
|
10513
10511
|
}
|
|
10514
10512
|
r.dispatchCommand(Fo, t);
|
|
10515
10513
|
}
|
|
@@ -10532,7 +10530,7 @@ function xd(r) {
|
|
|
10532
10530
|
}, G), r.registerCommand(As, () => (ic(), !0), G), r.registerCommand(Ln, (e) => (So(r, gt(e, ClipboardEvent) ? e : null), !0), G), r.registerCommand(Qs, (e) => (async function(t, n) {
|
|
10533
10531
|
await So(n, gt(t, ClipboardEvent) ? t : null), n.update(() => {
|
|
10534
10532
|
const s = j();
|
|
10535
|
-
B(s) ? s.removeText() :
|
|
10533
|
+
B(s) ? s.removeText() : We(s) && s.getNodes().forEach((o) => o.remove());
|
|
10536
10534
|
});
|
|
10537
10535
|
}(e, r), !0), G), r.registerCommand(Fn, (e) => {
|
|
10538
10536
|
const [, t, n] = sn(e);
|
|
@@ -10544,18 +10542,18 @@ function xd(r) {
|
|
|
10544
10542
|
}(e, r), !0);
|
|
10545
10543
|
}, G));
|
|
10546
10544
|
}
|
|
10547
|
-
const qs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10545
|
+
const qs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
|
|
10548
10546
|
function Oo(r) {
|
|
10549
10547
|
return r.getEditorState().read(nl(r.isComposing()));
|
|
10550
10548
|
}
|
|
10551
10549
|
function vd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
10552
|
-
const [n] =
|
|
10550
|
+
const [n] = Qe(), s = function(o, i) {
|
|
10553
10551
|
const [u, l] = Q(() => o.getDecorators());
|
|
10554
10552
|
return qs(() => o.registerDecoratorListener((a) => {
|
|
10555
10553
|
ql(() => {
|
|
10556
10554
|
l(a);
|
|
10557
10555
|
});
|
|
10558
|
-
}), [o]),
|
|
10556
|
+
}), [o]), ge(() => {
|
|
10559
10557
|
l(o.getDecorators());
|
|
10560
10558
|
}, [o]), Pt(() => {
|
|
10561
10559
|
const a = [], c = Object.keys(u);
|
|
@@ -10571,7 +10569,7 @@ function vd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
|
10571
10569
|
}(n), v.jsxs(v.Fragment, { children: [r, v.jsx(bd, { content: e }), s] });
|
|
10572
10570
|
}
|
|
10573
10571
|
function bd({ content: r }) {
|
|
10574
|
-
const [e] =
|
|
10572
|
+
const [e] = Qe(), t = function(s) {
|
|
10575
10573
|
const [o, i] = Q(() => Oo(s));
|
|
10576
10574
|
return qs(() => {
|
|
10577
10575
|
function u() {
|
|
@@ -10587,7 +10585,7 @@ function bd({ content: r }) {
|
|
|
10587
10585
|
}(e), n = Mc();
|
|
10588
10586
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
10589
10587
|
}
|
|
10590
|
-
const pl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10588
|
+
const pl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
|
|
10591
10589
|
function Dd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: o, ariaExpanded: i, ariaInvalid: u, ariaLabel: l, ariaLabelledBy: a, ariaMultiline: c, ariaOwns: f, ariaRequired: d, autoCapitalize: h, className: p, id: g, role: _ = "textbox", spellCheck: D = !0, style: y, tabIndex: w, "data-testid": x, ...C }, b) {
|
|
10592
10590
|
const [k, A] = Q(r.isEditable()), S = Z((F) => {
|
|
10593
10591
|
F && F.ownerDocument && F.ownerDocument.defaultView ? r.setRootElement(F) : r.setRootElement(null);
|
|
@@ -10608,7 +10606,7 @@ function Ro(r) {
|
|
|
10608
10606
|
}
|
|
10609
10607
|
const Cd = Qo(Ad);
|
|
10610
10608
|
function Ad(r, e) {
|
|
10611
|
-
const { placeholder: t, ...n } = r, [s] =
|
|
10609
|
+
const { placeholder: t, ...n } = r, [s] = Qe();
|
|
10612
10610
|
return v.jsxs(v.Fragment, { children: [v.jsx(wd, { editor: s, ...n, ref: e }), t != null && v.jsx(Ed, { editor: s, content: t })] });
|
|
10613
10611
|
}
|
|
10614
10612
|
function Ed({ content: r, editor: e }) {
|
|
@@ -10632,12 +10630,12 @@ function Ed({ content: r, editor: e }) {
|
|
|
10632
10630
|
let o = null;
|
|
10633
10631
|
return typeof r == "function" ? o = r(n) : r !== null && (o = r), o === null ? null : v.jsx("div", { "aria-hidden": !0, children: o });
|
|
10634
10632
|
}
|
|
10635
|
-
const un = 0, zs = 1, Us = 2,
|
|
10633
|
+
const un = 0, zs = 1, Us = 2, Oe = 0, kd = 1, jo = 2, Sd = 3, Td = 4;
|
|
10636
10634
|
function Bd(r, e, t, n, s) {
|
|
10637
|
-
if (r === null || t.size === 0 && n.size === 0 && !s) return
|
|
10635
|
+
if (r === null || t.size === 0 && n.size === 0 && !s) return Oe;
|
|
10638
10636
|
const o = e._selection, i = r._selection;
|
|
10639
10637
|
if (s) return kd;
|
|
10640
|
-
if (!(B(o) && B(i) && i.isCollapsed() && o.isCollapsed())) return
|
|
10638
|
+
if (!(B(o) && B(i) && i.isCollapsed() && o.isCollapsed())) return Oe;
|
|
10641
10639
|
const u = function(D, y, w) {
|
|
10642
10640
|
const x = D._nodeMap, C = [];
|
|
10643
10641
|
for (const b of y) {
|
|
@@ -10651,31 +10649,31 @@ function Bd(r, e, t, n, s) {
|
|
|
10651
10649
|
}
|
|
10652
10650
|
return C;
|
|
10653
10651
|
}(e, t, n);
|
|
10654
|
-
if (u.length === 0) return
|
|
10652
|
+
if (u.length === 0) return Oe;
|
|
10655
10653
|
if (u.length > 1) {
|
|
10656
10654
|
const D = e._nodeMap, y = D.get(o.anchor.key), w = D.get(i.anchor.key);
|
|
10657
|
-
return y && w && !r._nodeMap.has(y.__key) && L(y) && y.__text.length === 1 && o.anchor.offset === 1 ? jo :
|
|
10655
|
+
return y && w && !r._nodeMap.has(y.__key) && L(y) && y.__text.length === 1 && o.anchor.offset === 1 ? jo : Oe;
|
|
10658
10656
|
}
|
|
10659
10657
|
const l = u[0], a = r._nodeMap.get(l.__key);
|
|
10660
|
-
if (!L(a) || !L(l) || a.__mode !== l.__mode) return
|
|
10658
|
+
if (!L(a) || !L(l) || a.__mode !== l.__mode) return Oe;
|
|
10661
10659
|
const c = a.__text, f = l.__text;
|
|
10662
|
-
if (c === f) return
|
|
10660
|
+
if (c === f) return Oe;
|
|
10663
10661
|
const d = o.anchor, h = i.anchor;
|
|
10664
|
-
if (d.key !== h.key || d.type !== "text") return
|
|
10662
|
+
if (d.key !== h.key || d.type !== "text") return Oe;
|
|
10665
10663
|
const p = d.offset, g = h.offset, _ = f.length - c.length;
|
|
10666
|
-
return _ === 1 && g === p - 1 ? jo : _ === -1 && g === p + 1 ? Sd : _ === -1 && g === p ? Td :
|
|
10664
|
+
return _ === 1 && g === p - 1 ? jo : _ === -1 && g === p + 1 ? Sd : _ === -1 && g === p ? Td : Oe;
|
|
10667
10665
|
}
|
|
10668
10666
|
function Nd(r, e) {
|
|
10669
|
-
let t = Date.now(), n =
|
|
10667
|
+
let t = Date.now(), n = Oe;
|
|
10670
10668
|
return (s, o, i, u, l, a) => {
|
|
10671
10669
|
const c = Date.now();
|
|
10672
|
-
if (a.has("historic")) return n =
|
|
10670
|
+
if (a.has("historic")) return n = Oe, t = c, Us;
|
|
10673
10671
|
const f = Bd(s, o, u, l, r.isComposing()), d = (() => {
|
|
10674
10672
|
const h = i === null || i.editor === r, p = a.has("history-push");
|
|
10675
10673
|
if (!p && h && a.has("history-merge")) return un;
|
|
10676
10674
|
if (s === null) return zs;
|
|
10677
10675
|
const g = o._selection;
|
|
10678
|
-
return u.size > 0 || l.size > 0 ? p === !1 && f !==
|
|
10676
|
+
return u.size > 0 || l.size > 0 ? p === !1 && f !== Oe && f === n && c < t + e && h || u.size === 1 && function(_, D, y) {
|
|
10679
10677
|
const w = D._nodeMap.get(_), x = y._nodeMap.get(_), C = D._selection, b = y._selection;
|
|
10680
10678
|
return !(B(C) && B(b) && C.anchor.type === "element" && C.focus.type === "element" && b.anchor.type === "text" && b.focus.type === "text" || !L(w) || !L(x) || w.__parent !== x.__parent) && JSON.stringify(D.read(() => w.exportJSON())) === JSON.stringify(y.read(() => x.exportJSON()));
|
|
10681
10679
|
}(Array.from(u)[0], s, o) ? un : zs : g !== null ? un : Us;
|
|
@@ -10715,15 +10713,15 @@ function Ld() {
|
|
|
10715
10713
|
return { current: null, redoStack: [], undoStack: [] };
|
|
10716
10714
|
}
|
|
10717
10715
|
function Pd({ delay: r, externalHistoryState: e }) {
|
|
10718
|
-
const [t] =
|
|
10716
|
+
const [t] = Qe();
|
|
10719
10717
|
return function(n, s, o = 1e3) {
|
|
10720
10718
|
const i = Pt(() => s || Ld(), [s]);
|
|
10721
|
-
|
|
10719
|
+
ge(() => Fd(n, i, o), [o, n, i]);
|
|
10722
10720
|
}(t, e, r), null;
|
|
10723
10721
|
}
|
|
10724
|
-
const Od = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10722
|
+
const Od = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
|
|
10725
10723
|
function Rd({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
|
|
10726
|
-
const [n] =
|
|
10724
|
+
const [n] = Qe();
|
|
10727
10725
|
return Od(() => {
|
|
10728
10726
|
if (t) return n.registerUpdateListener(({ editorState: s, dirtyElements: o, dirtyLeaves: i, prevEditorState: u, tags: l }) => {
|
|
10729
10727
|
e && o.size === 0 && i.size === 0 || r && l.has("history-merge") || u.isEmpty() || t(s, n, l);
|
|
@@ -10776,7 +10774,7 @@ function Id({ children: r, onError: e }) {
|
|
|
10776
10774
|
function Md(r) {
|
|
10777
10775
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
10778
10776
|
}
|
|
10779
|
-
var
|
|
10777
|
+
var Ve = Md(function(r) {
|
|
10780
10778
|
const e = new URLSearchParams();
|
|
10781
10779
|
e.append("code", r);
|
|
10782
10780
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
@@ -10785,13 +10783,13 @@ var Ke = Md(function(r) {
|
|
|
10785
10783
|
function $d(r) {
|
|
10786
10784
|
let e = 1, t = r.getParent();
|
|
10787
10785
|
for (; t != null; ) {
|
|
10788
|
-
if (
|
|
10786
|
+
if (te(t)) {
|
|
10789
10787
|
const n = t.getParent();
|
|
10790
10788
|
if (H(n)) {
|
|
10791
10789
|
e++, t = n.getParent();
|
|
10792
10790
|
continue;
|
|
10793
10791
|
}
|
|
10794
|
-
|
|
10792
|
+
Ve(40);
|
|
10795
10793
|
}
|
|
10796
10794
|
return e;
|
|
10797
10795
|
}
|
|
@@ -10799,28 +10797,28 @@ function $d(r) {
|
|
|
10799
10797
|
}
|
|
10800
10798
|
function Vs(r) {
|
|
10801
10799
|
let e = r.getParent();
|
|
10802
|
-
H(e) ||
|
|
10800
|
+
H(e) || Ve(40);
|
|
10803
10801
|
let t = e;
|
|
10804
10802
|
for (; t !== null; ) t = t.getParent(), H(t) && (e = t);
|
|
10805
10803
|
return e;
|
|
10806
10804
|
}
|
|
10807
10805
|
function gl(r) {
|
|
10808
10806
|
let e = [];
|
|
10809
|
-
const t = r.getChildren().filter(
|
|
10807
|
+
const t = r.getChildren().filter(te);
|
|
10810
10808
|
for (let n = 0; n < t.length; n++) {
|
|
10811
10809
|
const s = t[n], o = s.getFirstChild();
|
|
10812
10810
|
H(o) ? e = e.concat(gl(o)) : e.push(s);
|
|
10813
10811
|
}
|
|
10814
10812
|
return e;
|
|
10815
10813
|
}
|
|
10816
|
-
function
|
|
10817
|
-
return
|
|
10814
|
+
function Ke(r) {
|
|
10815
|
+
return te(r) && H(r.getFirstChild());
|
|
10818
10816
|
}
|
|
10819
10817
|
function $o(r) {
|
|
10820
10818
|
return ke().append(r);
|
|
10821
10819
|
}
|
|
10822
10820
|
function ml(r, e) {
|
|
10823
|
-
return
|
|
10821
|
+
return te(r) && (e.length === 0 || e.length === 1 && r.is(e[0]) && r.getChildrenSize() === 0);
|
|
10824
10822
|
}
|
|
10825
10823
|
function qo(r, e) {
|
|
10826
10824
|
r.update(() => {
|
|
@@ -10829,15 +10827,15 @@ function qo(r, e) {
|
|
|
10829
10827
|
const n = t.getNodes();
|
|
10830
10828
|
if (B(t)) {
|
|
10831
10829
|
const o = t.getStartEndPoints();
|
|
10832
|
-
o === null &&
|
|
10830
|
+
o === null && Ve(143);
|
|
10833
10831
|
const [i] = o, u = i.getNode(), l = u.getParent();
|
|
10834
10832
|
if (ml(u, n)) {
|
|
10835
10833
|
const a = Ce(e);
|
|
10836
|
-
if (
|
|
10834
|
+
if (Ge(l)) {
|
|
10837
10835
|
u.replace(a);
|
|
10838
10836
|
const c = ke();
|
|
10839
10837
|
E(u) && (c.setFormat(u.getFormatType()), c.setIndent(u.getIndent())), a.append(c);
|
|
10840
|
-
} else if (
|
|
10838
|
+
} else if (te(u)) {
|
|
10841
10839
|
const c = u.getParentOrThrow();
|
|
10842
10840
|
Lt(a, c.getChildren()), c.replace(a);
|
|
10843
10841
|
}
|
|
@@ -10847,7 +10845,7 @@ function qo(r, e) {
|
|
|
10847
10845
|
const s = /* @__PURE__ */ new Set();
|
|
10848
10846
|
for (let o = 0; o < n.length; o++) {
|
|
10849
10847
|
const i = n[o];
|
|
10850
|
-
if (!E(i) || !i.isEmpty() ||
|
|
10848
|
+
if (!E(i) || !i.isEmpty() || te(i) || s.has(i.getKey())) {
|
|
10851
10849
|
if (bu(i)) {
|
|
10852
10850
|
let u = i.getParent();
|
|
10853
10851
|
for (; u != null; ) {
|
|
@@ -10861,7 +10859,7 @@ function qo(r, e) {
|
|
|
10861
10859
|
}
|
|
10862
10860
|
{
|
|
10863
10861
|
const a = u.getParent();
|
|
10864
|
-
if (
|
|
10862
|
+
if (Ge(a) && !s.has(l)) {
|
|
10865
10863
|
s.add(l), zo(u, e);
|
|
10866
10864
|
break;
|
|
10867
10865
|
}
|
|
@@ -10891,7 +10889,7 @@ function zo(r, e) {
|
|
|
10891
10889
|
}
|
|
10892
10890
|
function bi(r, e) {
|
|
10893
10891
|
const t = r.getLastChild(), n = e.getFirstChild();
|
|
10894
|
-
t && n &&
|
|
10892
|
+
t && n && Ke(t) && Ke(n) && (bi(t.getFirstChild(), n.getFirstChild()), n.remove());
|
|
10895
10893
|
const s = e.getChildren();
|
|
10896
10894
|
s.length > 0 && r.append(...s), e.remove();
|
|
10897
10895
|
}
|
|
@@ -10922,22 +10920,22 @@ function qd(r) {
|
|
|
10922
10920
|
}
|
|
10923
10921
|
function zd(r) {
|
|
10924
10922
|
const e = /* @__PURE__ */ new Set();
|
|
10925
|
-
if (
|
|
10923
|
+
if (Ke(r) || e.has(r.getKey())) return;
|
|
10926
10924
|
const t = r.getParent(), n = r.getNextSibling(), s = r.getPreviousSibling();
|
|
10927
|
-
if (
|
|
10925
|
+
if (Ke(n) && Ke(s)) {
|
|
10928
10926
|
const o = s.getFirstChild();
|
|
10929
10927
|
if (H(o)) {
|
|
10930
10928
|
o.append(r);
|
|
10931
10929
|
const i = n.getFirstChild();
|
|
10932
10930
|
H(i) && (Lt(o, i.getChildren()), n.remove(), e.add(n.getKey()));
|
|
10933
10931
|
}
|
|
10934
|
-
} else if (
|
|
10932
|
+
} else if (Ke(n)) {
|
|
10935
10933
|
const o = n.getFirstChild();
|
|
10936
10934
|
if (H(o)) {
|
|
10937
10935
|
const i = o.getFirstChild();
|
|
10938
10936
|
i !== null && i.insertBefore(r);
|
|
10939
10937
|
}
|
|
10940
|
-
} else if (
|
|
10938
|
+
} else if (Ke(s)) {
|
|
10941
10939
|
const o = s.getFirstChild();
|
|
10942
10940
|
H(o) && o.append(r);
|
|
10943
10941
|
} else if (H(t)) {
|
|
@@ -10946,9 +10944,9 @@ function zd(r) {
|
|
|
10946
10944
|
}
|
|
10947
10945
|
}
|
|
10948
10946
|
function Ud(r) {
|
|
10949
|
-
if (
|
|
10947
|
+
if (Ke(r)) return;
|
|
10950
10948
|
const e = r.getParent(), t = e ? e.getParent() : void 0;
|
|
10951
|
-
if (H(t ? t.getParent() : void 0) &&
|
|
10949
|
+
if (H(t ? t.getParent() : void 0) && te(t) && H(e)) {
|
|
10952
10950
|
const n = e ? e.getFirstChild() : void 0, s = e ? e.getLastChild() : void 0;
|
|
10953
10951
|
if (r.is(n)) t.insertBefore(r), e.isEmpty() && t.remove();
|
|
10954
10952
|
else if (r.is(s)) t.insertAfter(r), e.isEmpty() && t.remove();
|
|
@@ -10964,14 +10962,14 @@ function Wd() {
|
|
|
10964
10962
|
const r = j();
|
|
10965
10963
|
if (!B(r) || !r.isCollapsed()) return !1;
|
|
10966
10964
|
const e = r.anchor.getNode();
|
|
10967
|
-
if (!
|
|
10965
|
+
if (!te(e) || e.getChildrenSize() !== 0) return !1;
|
|
10968
10966
|
const t = Vs(e), n = e.getParent();
|
|
10969
|
-
H(n) ||
|
|
10967
|
+
H(n) || Ve(40);
|
|
10970
10968
|
const s = n.getParent();
|
|
10971
10969
|
let o;
|
|
10972
|
-
if (
|
|
10970
|
+
if (Ge(s)) o = le(), t.insertAfter(o);
|
|
10973
10971
|
else {
|
|
10974
|
-
if (!
|
|
10972
|
+
if (!te(s)) return !1;
|
|
10975
10973
|
o = ke(), s.insertAfter(o);
|
|
10976
10974
|
}
|
|
10977
10975
|
o.select();
|
|
@@ -10991,7 +10989,7 @@ function Wd() {
|
|
|
10991
10989
|
let l = u;
|
|
10992
10990
|
for (; l.getNextSibling() == null && l.getPreviousSibling() == null; ) {
|
|
10993
10991
|
const a = l.getParent();
|
|
10994
|
-
if (a == null || !
|
|
10992
|
+
if (a == null || !te(l) && !H(l)) break;
|
|
10995
10993
|
l = a;
|
|
10996
10994
|
}
|
|
10997
10995
|
l.remove();
|
|
@@ -11022,7 +11020,7 @@ class Rt extends ot {
|
|
|
11022
11020
|
}
|
|
11023
11021
|
static transform() {
|
|
11024
11022
|
return (e) => {
|
|
11025
|
-
if (
|
|
11023
|
+
if (te(e) || Ve(144), e.__checked == null) return;
|
|
11026
11024
|
const t = e.getParent();
|
|
11027
11025
|
H(t) && t.getListType() !== "check" && e.getChecked() != null && e.setChecked(void 0);
|
|
11028
11026
|
};
|
|
@@ -11052,7 +11050,7 @@ class Rt extends ot {
|
|
|
11052
11050
|
return this;
|
|
11053
11051
|
}
|
|
11054
11052
|
replace(e, t) {
|
|
11055
|
-
if (
|
|
11053
|
+
if (te(e)) return super.replace(e);
|
|
11056
11054
|
this.setIndent(0);
|
|
11057
11055
|
const n = this.getParentOrThrow();
|
|
11058
11056
|
if (!H(n)) return e;
|
|
@@ -11067,13 +11065,13 @@ class Rt extends ot {
|
|
|
11067
11065
|
}
|
|
11068
11066
|
n.insertAfter(e), e.insertAfter(s);
|
|
11069
11067
|
}
|
|
11070
|
-
return t && (E(e) ||
|
|
11068
|
+
return t && (E(e) || Ve(139), this.getChildren().forEach((s) => {
|
|
11071
11069
|
e.append(s);
|
|
11072
11070
|
})), this.remove(), n.getChildrenSize() === 0 && n.remove(), e;
|
|
11073
11071
|
}
|
|
11074
11072
|
insertAfter(e, t = !0) {
|
|
11075
11073
|
const n = this.getParentOrThrow();
|
|
11076
|
-
if (H(n) ||
|
|
11074
|
+
if (H(n) || Ve(39), te(e)) return super.insertAfter(e, t);
|
|
11077
11075
|
const s = this.getNextSiblings();
|
|
11078
11076
|
if (n.insertAfter(e, t), s.length !== 0) {
|
|
11079
11077
|
const o = Ce(n.getListType());
|
|
@@ -11083,7 +11081,7 @@ class Rt extends ot {
|
|
|
11083
11081
|
}
|
|
11084
11082
|
remove(e) {
|
|
11085
11083
|
const t = this.getPreviousSibling(), n = this.getNextSibling();
|
|
11086
|
-
super.remove(e), t && n &&
|
|
11084
|
+
super.remove(e), t && n && Ke(t) && Ke(n) && (bi(t.getFirstChild(), n.getFirstChild()), n.remove());
|
|
11087
11085
|
}
|
|
11088
11086
|
insertNewAfter(e, t = !0) {
|
|
11089
11087
|
const n = ke(this.__checked == null && void 0);
|
|
@@ -11092,7 +11090,7 @@ class Rt extends ot {
|
|
|
11092
11090
|
collapseAtStart(e) {
|
|
11093
11091
|
const t = le();
|
|
11094
11092
|
this.getChildren().forEach((i) => t.append(i));
|
|
11095
|
-
const n = this.getParentOrThrow(), s = n.getParentOrThrow(), o =
|
|
11093
|
+
const n = this.getParentOrThrow(), s = n.getParentOrThrow(), o = te(s);
|
|
11096
11094
|
if (n.getChildrenSize() === 1) if (o) n.remove(), s.select();
|
|
11097
11095
|
else {
|
|
11098
11096
|
n.insertBefore(t), n.remove();
|
|
@@ -11124,23 +11122,23 @@ class Rt extends ot {
|
|
|
11124
11122
|
const e = this.getParent();
|
|
11125
11123
|
if (e === null) return this.getLatest().__indent;
|
|
11126
11124
|
let t = e.getParentOrThrow(), n = 0;
|
|
11127
|
-
for (;
|
|
11125
|
+
for (; te(t); ) t = t.getParentOrThrow().getParentOrThrow(), n++;
|
|
11128
11126
|
return n;
|
|
11129
11127
|
}
|
|
11130
11128
|
setIndent(e) {
|
|
11131
|
-
typeof e != "number" &&
|
|
11129
|
+
typeof e != "number" && Ve(117), (e = Math.floor(e)) >= 0 || Ve(199);
|
|
11132
11130
|
let t = this.getIndent();
|
|
11133
11131
|
for (; t !== e; ) t < e ? (zd(this), t++) : (Ud(this), t--);
|
|
11134
11132
|
return this;
|
|
11135
11133
|
}
|
|
11136
11134
|
canInsertAfter(e) {
|
|
11137
|
-
return
|
|
11135
|
+
return te(e);
|
|
11138
11136
|
}
|
|
11139
11137
|
canReplaceWith(e) {
|
|
11140
|
-
return
|
|
11138
|
+
return te(e);
|
|
11141
11139
|
}
|
|
11142
11140
|
canMergeWith(e) {
|
|
11143
|
-
return Zt(e) ||
|
|
11141
|
+
return Zt(e) || te(e);
|
|
11144
11142
|
}
|
|
11145
11143
|
extractWithChild(e, t) {
|
|
11146
11144
|
if (!B(t)) return !1;
|
|
@@ -11184,9 +11182,9 @@ function Kd(r) {
|
|
|
11184
11182
|
return r.getAttribute("type") !== "checkbox" ? { node: null } : { node: ke(r.hasAttribute("checked")) };
|
|
11185
11183
|
}
|
|
11186
11184
|
function ke(r) {
|
|
11187
|
-
return
|
|
11185
|
+
return Ye(new Rt(void 0, r));
|
|
11188
11186
|
}
|
|
11189
|
-
function
|
|
11187
|
+
function te(r) {
|
|
11190
11188
|
return r instanceof Rt;
|
|
11191
11189
|
}
|
|
11192
11190
|
class sr extends ot {
|
|
@@ -11224,13 +11222,13 @@ class sr extends ot {
|
|
|
11224
11222
|
}
|
|
11225
11223
|
static transform() {
|
|
11226
11224
|
return (e) => {
|
|
11227
|
-
H(e) ||
|
|
11225
|
+
H(e) || Ve(163), function(t) {
|
|
11228
11226
|
const n = t.getNextSibling();
|
|
11229
11227
|
H(n) && t.getListType() === n.getListType() && bi(t, n);
|
|
11230
11228
|
}(e), function(t) {
|
|
11231
11229
|
const n = t.getListType() !== "check";
|
|
11232
11230
|
let s = t.getStart();
|
|
11233
|
-
for (const o of t.getChildren())
|
|
11231
|
+
for (const o of t.getChildren()) te(o) && (o.getValue() !== s && o.setValue(s), n && o.getLatest().__checked != null && o.setChecked(void 0), H(o.getFirstChild()) || s++);
|
|
11234
11232
|
}(e);
|
|
11235
11233
|
};
|
|
11236
11234
|
}
|
|
@@ -11257,7 +11255,7 @@ class sr extends ot {
|
|
|
11257
11255
|
append(...e) {
|
|
11258
11256
|
for (let t = 0; t < e.length; t++) {
|
|
11259
11257
|
const n = e[t];
|
|
11260
|
-
if (
|
|
11258
|
+
if (te(n)) super.append(n);
|
|
11261
11259
|
else {
|
|
11262
11260
|
const s = ke();
|
|
11263
11261
|
if (H(n)) s.append(n);
|
|
@@ -11273,7 +11271,7 @@ class sr extends ot {
|
|
|
11273
11271
|
return this;
|
|
11274
11272
|
}
|
|
11275
11273
|
extractWithChild(e) {
|
|
11276
|
-
return
|
|
11274
|
+
return te(e);
|
|
11277
11275
|
}
|
|
11278
11276
|
}
|
|
11279
11277
|
function Vo(r, e, t) {
|
|
@@ -11297,7 +11295,7 @@ function Hd(r) {
|
|
|
11297
11295
|
const e = [];
|
|
11298
11296
|
for (let t = 0; t < r.length; t++) {
|
|
11299
11297
|
const n = r[t];
|
|
11300
|
-
if (
|
|
11298
|
+
if (te(n)) {
|
|
11301
11299
|
e.push(n);
|
|
11302
11300
|
const s = n.getChildren();
|
|
11303
11301
|
s.length > 1 && s.forEach((o) => {
|
|
@@ -11318,7 +11316,7 @@ function Ko(r) {
|
|
|
11318
11316
|
}
|
|
11319
11317
|
const Ho = { ol: "number", ul: "bullet" };
|
|
11320
11318
|
function Ce(r, e = 1) {
|
|
11321
|
-
return
|
|
11319
|
+
return Ye(new sr(r, e));
|
|
11322
11320
|
}
|
|
11323
11321
|
function H(r) {
|
|
11324
11322
|
return r instanceof sr;
|
|
@@ -11328,11 +11326,11 @@ function Jd(r) {
|
|
|
11328
11326
|
return Ot(r.registerCommand(_l, () => (qo(r, "number"), !0), Kt), r.registerCommand(yl, () => (qo(r, "bullet"), !0), Kt), r.registerCommand(Gd, () => (qd(r), !0), Kt), r.registerCommand(kr, () => !!Wd(), Kt));
|
|
11329
11327
|
}
|
|
11330
11328
|
function Qd() {
|
|
11331
|
-
const [r] =
|
|
11332
|
-
return
|
|
11329
|
+
const [r] = Qe();
|
|
11330
|
+
return ge(() => {
|
|
11333
11331
|
if (!r.hasNodes([sr, Rt])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
11334
11332
|
}, [r]), function(e) {
|
|
11335
|
-
|
|
11333
|
+
ge(() => Jd(e), [e]);
|
|
11336
11334
|
}(r), null;
|
|
11337
11335
|
}
|
|
11338
11336
|
const Yd = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
|
|
@@ -11439,7 +11437,7 @@ function Xd(r) {
|
|
|
11439
11437
|
return { node: e };
|
|
11440
11438
|
}
|
|
11441
11439
|
function Bn(r, e) {
|
|
11442
|
-
return
|
|
11440
|
+
return Ye(new jt(r, e));
|
|
11443
11441
|
}
|
|
11444
11442
|
function hr(r) {
|
|
11445
11443
|
return r instanceof jt;
|
|
@@ -11487,7 +11485,7 @@ class Kr extends jt {
|
|
|
11487
11485
|
}
|
|
11488
11486
|
}
|
|
11489
11487
|
function Go(r, e) {
|
|
11490
|
-
return
|
|
11488
|
+
return Ye(new Kr(r, e));
|
|
11491
11489
|
}
|
|
11492
11490
|
function Zd(r) {
|
|
11493
11491
|
return r instanceof Kr;
|
|
@@ -11532,8 +11530,8 @@ function vs(r, e = {}) {
|
|
|
11532
11530
|
}
|
|
11533
11531
|
}
|
|
11534
11532
|
function ef({ validateUrl: r, attributes: e }) {
|
|
11535
|
-
const [t] =
|
|
11536
|
-
return
|
|
11533
|
+
const [t] = Qe();
|
|
11534
|
+
return ge(() => {
|
|
11537
11535
|
if (!t.hasNodes([jt])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
11538
11536
|
return Ot(t.registerCommand(Jo, (n) => {
|
|
11539
11537
|
if (n === null) return vs(n), !0;
|
|
@@ -11583,12 +11581,12 @@ const tf = {
|
|
|
11583
11581
|
}
|
|
11584
11582
|
};
|
|
11585
11583
|
function nf({ theme: r, disabled: e }) {
|
|
11586
|
-
const [t] =
|
|
11587
|
-
t.dispatchCommand(
|
|
11584
|
+
const [t] = Qe(), n = Z(() => {
|
|
11585
|
+
t.dispatchCommand(Re, "bold");
|
|
11588
11586
|
}, [t]), s = Z(() => {
|
|
11589
|
-
t.dispatchCommand(
|
|
11587
|
+
t.dispatchCommand(Re, "italic");
|
|
11590
11588
|
}, [t]), o = Z(() => {
|
|
11591
|
-
t.dispatchCommand(
|
|
11589
|
+
t.dispatchCommand(Re, "underline");
|
|
11592
11590
|
}, [t]), i = Z(() => {
|
|
11593
11591
|
t.dispatchCommand(yl, void 0);
|
|
11594
11592
|
}, [t]), u = Z(() => {
|
|
@@ -11743,10 +11741,10 @@ function nf({ theme: r, disabled: e }) {
|
|
|
11743
11741
|
);
|
|
11744
11742
|
}
|
|
11745
11743
|
function sf({ html: r }) {
|
|
11746
|
-
const [e] =
|
|
11747
|
-
return
|
|
11744
|
+
const [e] = Qe();
|
|
11745
|
+
return ge(() => {
|
|
11748
11746
|
r && e.update(() => {
|
|
11749
|
-
const t =
|
|
11747
|
+
const t = ne();
|
|
11750
11748
|
t.clear();
|
|
11751
11749
|
const s = new DOMParser().parseFromString(r, "text/html"), o = ll(e, s);
|
|
11752
11750
|
o.length > 0 ? t.append(...o) : t.append(le());
|