commspliant-html-editor 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/components/Editor.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +401 -392
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as b, jsx as a, Fragment as Se } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as pd, useContext as gd, useMemo as
|
|
2
|
+
import { createContext as pd, useContext as gd, useMemo as Ee, useId as Z, useRef as D, useLayoutEffect as He, useEffect as G, useState as T, useCallback as K, forwardRef as Nl, useImperativeHandle as Sp } from "react";
|
|
3
3
|
import { createPortal as Ml } from "react-dom";
|
|
4
4
|
function Pp({ className: e }) {
|
|
5
5
|
return /* @__PURE__ */ b(
|
|
@@ -2472,7 +2472,7 @@ const Ll = {
|
|
|
2472
2472
|
commentPanelCloseAria: "Cerrar panel de comentarios"
|
|
2473
2473
|
}, xg = { en: Ll, es: Tg }, Nd = pd((e) => Ll[e]);
|
|
2474
2474
|
function Eg({ locale: e = "en", children: t }) {
|
|
2475
|
-
const n =
|
|
2475
|
+
const n = Ee(() => {
|
|
2476
2476
|
const r = xg[e] ?? Ll;
|
|
2477
2477
|
return (o) => r[o];
|
|
2478
2478
|
}, [e]);
|
|
@@ -2673,7 +2673,7 @@ function Bg(e, t) {
|
|
|
2673
2673
|
return e.button === 2 || e.ctrlKey ? !0 : !Fg(t);
|
|
2674
2674
|
}
|
|
2675
2675
|
const vr = "data-page", Wo = "data-page-bg", Go = "commspliant-background";
|
|
2676
|
-
function
|
|
2676
|
+
function Pt(e) {
|
|
2677
2677
|
return e instanceof HTMLElement && (e.id === Go || e.hasAttribute(Wo));
|
|
2678
2678
|
}
|
|
2679
2679
|
function Hg(e) {
|
|
@@ -2681,7 +2681,7 @@ function Hg(e) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
function Il(e) {
|
|
2683
2683
|
const t = Hg(e), n = /* @__PURE__ */ new Set(), r = [], o = (i) => {
|
|
2684
|
-
i instanceof HTMLElement &&
|
|
2684
|
+
i instanceof HTMLElement && Pt(i) && !n.has(i) && (n.add(i), r.push(i));
|
|
2685
2685
|
};
|
|
2686
2686
|
o(t.querySelector(`#${Go}`));
|
|
2687
2687
|
for (const i of t.querySelectorAll(`[${Wo}]`)) o(i);
|
|
@@ -2713,7 +2713,7 @@ function Og(e) {
|
|
|
2713
2713
|
const t = Rd(e);
|
|
2714
2714
|
if (t.length !== 1) return null;
|
|
2715
2715
|
const n = t[0];
|
|
2716
|
-
return n.tagName.toLowerCase() !== "div" ||
|
|
2716
|
+
return n.tagName.toLowerCase() !== "div" || Pt(n) ? null : n;
|
|
2717
2717
|
}
|
|
2718
2718
|
function Kg(e) {
|
|
2719
2719
|
const t = Tr(e);
|
|
@@ -2756,7 +2756,7 @@ function tt(e) {
|
|
|
2756
2756
|
const t = e.trim();
|
|
2757
2757
|
return t ? t.includes(Qa) ? e.split(Qa).map((n) => n.trim()) : [e] : [""];
|
|
2758
2758
|
}
|
|
2759
|
-
function
|
|
2759
|
+
function Ft(e) {
|
|
2760
2760
|
return e.length === 0 ? "" : e.length === 1 ? e[0] ?? "" : e.join(`
|
|
2761
2761
|
${Qa}
|
|
2762
2762
|
`);
|
|
@@ -2895,7 +2895,7 @@ const Yg = /* @__PURE__ */ new Set([
|
|
|
2895
2895
|
function me(e, t) {
|
|
2896
2896
|
return t ? e === t || e.contains(t) : !1;
|
|
2897
2897
|
}
|
|
2898
|
-
function
|
|
2898
|
+
function Dt(e) {
|
|
2899
2899
|
return Yg.has(e.tagName.toLowerCase());
|
|
2900
2900
|
}
|
|
2901
2901
|
function Xg(e, t) {
|
|
@@ -2912,7 +2912,7 @@ function Ye(e) {
|
|
|
2912
2912
|
o.nodeValue && Xg(e, o) && n.push(o);
|
|
2913
2913
|
return n;
|
|
2914
2914
|
}
|
|
2915
|
-
function
|
|
2915
|
+
function St(e) {
|
|
2916
2916
|
const t = e.startContainer, n = e.startOffset;
|
|
2917
2917
|
if (t.nodeType === Node.TEXT_NODE) {
|
|
2918
2918
|
const i = t;
|
|
@@ -3035,7 +3035,7 @@ function nh(e) {
|
|
|
3035
3035
|
return e.replace(/"/g, '"').replace(/</g, "<").replace(/&/g, "&");
|
|
3036
3036
|
}
|
|
3037
3037
|
const rh = new RegExp(`<link\\b[^>]*\\b${fi}\\b[^>]*>`, "gi");
|
|
3038
|
-
function
|
|
3038
|
+
function De(e) {
|
|
3039
3039
|
if (!e.includes(fi))
|
|
3040
3040
|
return { hrefs: [], body: e };
|
|
3041
3041
|
const t = [], n = e.replace(rh, (r) => {
|
|
@@ -3066,11 +3066,11 @@ function oh(e, t) {
|
|
|
3066
3066
|
return !1;
|
|
3067
3067
|
}
|
|
3068
3068
|
function Do(e, t, n = []) {
|
|
3069
|
-
const r =
|
|
3069
|
+
const r = De(t).hrefs, o = n.filter((i) => i.css && oh(e, i.family)).map((i) => i.css ?? "");
|
|
3070
3070
|
return pi([...r, ...o]);
|
|
3071
3071
|
}
|
|
3072
3072
|
function ih(e, t = []) {
|
|
3073
|
-
const n =
|
|
3073
|
+
const n = De(e).hrefs, r = t.map((o) => o.css ?? "");
|
|
3074
3074
|
return pi([...n, ...r]);
|
|
3075
3075
|
}
|
|
3076
3076
|
function ah(e) {
|
|
@@ -3098,7 +3098,7 @@ function lh(e, t) {
|
|
|
3098
3098
|
let n = t;
|
|
3099
3099
|
for (; n.parentElement && n.parentElement !== e; ) {
|
|
3100
3100
|
const r = n.parentElement;
|
|
3101
|
-
if (!
|
|
3101
|
+
if (!Dt(r) || !nl(r)) {
|
|
3102
3102
|
n = r;
|
|
3103
3103
|
continue;
|
|
3104
3104
|
}
|
|
@@ -3125,7 +3125,7 @@ function rl(e, t) {
|
|
|
3125
3125
|
const n = Hd(e);
|
|
3126
3126
|
if (!n || n.collapsed) return !1;
|
|
3127
3127
|
const r = t != null && t.trim() ? t.trim() : null;
|
|
3128
|
-
|
|
3128
|
+
St(n);
|
|
3129
3129
|
const o = Ye(n).filter((i) => i.data.length > 0);
|
|
3130
3130
|
for (const i of o) {
|
|
3131
3131
|
const l = zl(e, i);
|
|
@@ -3181,7 +3181,7 @@ function ol(e, t) {
|
|
|
3181
3181
|
let n = t;
|
|
3182
3182
|
for (; n.parentElement && n.parentElement !== e; ) {
|
|
3183
3183
|
const r = n.parentElement;
|
|
3184
|
-
if (!
|
|
3184
|
+
if (!Dt(r) || !nl(r)) {
|
|
3185
3185
|
n = r;
|
|
3186
3186
|
continue;
|
|
3187
3187
|
}
|
|
@@ -3292,7 +3292,7 @@ img {
|
|
|
3292
3292
|
}
|
|
3293
3293
|
`.trim();
|
|
3294
3294
|
function il(e, t, n = "") {
|
|
3295
|
-
const { hrefs: r, body: o } =
|
|
3295
|
+
const { hrefs: r, body: o } = De(t), i = e.createElement("meta");
|
|
3296
3296
|
i.setAttribute("charset", "utf-8");
|
|
3297
3297
|
const l = e.createElement("title");
|
|
3298
3298
|
l.textContent = n;
|
|
@@ -3586,7 +3586,7 @@ function Zl(e) {
|
|
|
3586
3586
|
function st(e) {
|
|
3587
3587
|
return e instanceof HTMLElement && ge(e) === "li";
|
|
3588
3588
|
}
|
|
3589
|
-
function
|
|
3589
|
+
function Tt(e) {
|
|
3590
3590
|
const t = window.getSelection();
|
|
3591
3591
|
if (!t || t.rangeCount === 0) return null;
|
|
3592
3592
|
const n = t.getRangeAt(0);
|
|
@@ -3624,7 +3624,7 @@ function Yl(e, t, n) {
|
|
|
3624
3624
|
o == null || o.removeAllRanges(), o == null || o.addRange(r);
|
|
3625
3625
|
}
|
|
3626
3626
|
function Un(e, t) {
|
|
3627
|
-
const n =
|
|
3627
|
+
const n = Tt(e);
|
|
3628
3628
|
if (!n) return !1;
|
|
3629
3629
|
const r = Fn(e, n.startContainer, n.startOffset), o = Fn(e, n.endContainer, n.endOffset), i = Math.min(r, o), l = Math.max(r, o), c = t();
|
|
3630
3630
|
return Yl(e, i, l), c;
|
|
@@ -3645,7 +3645,7 @@ function gt(e) {
|
|
|
3645
3645
|
function Dh(e, t) {
|
|
3646
3646
|
let n = Nr(t);
|
|
3647
3647
|
for (; n && n !== e; ) {
|
|
3648
|
-
if (Md(n, e) ||
|
|
3648
|
+
if (Md(n, e) || Pt(n)) {
|
|
3649
3649
|
n = n.parentElement;
|
|
3650
3650
|
continue;
|
|
3651
3651
|
}
|
|
@@ -3657,7 +3657,7 @@ function Dh(e, t) {
|
|
|
3657
3657
|
return null;
|
|
3658
3658
|
}
|
|
3659
3659
|
function Wn(e) {
|
|
3660
|
-
const t =
|
|
3660
|
+
const t = Tt(e);
|
|
3661
3661
|
if (!t) return [];
|
|
3662
3662
|
const n = /* @__PURE__ */ new Set(), r = [];
|
|
3663
3663
|
for (const o of ql(t)) {
|
|
@@ -3669,7 +3669,7 @@ function Wn(e) {
|
|
|
3669
3669
|
function al(e) {
|
|
3670
3670
|
if (e.nodeType === Node.TEXT_NODE || e.nodeType === Node.COMMENT_NODE || !(e instanceof Element)) return !0;
|
|
3671
3671
|
const t = ge(e);
|
|
3672
|
-
return Vl.has(t) || jl.has(t) ? !1 :
|
|
3672
|
+
return Vl.has(t) || jl.has(t) ? !1 : Dt(e) || t === "br" || t === "a" || t === "img" || t === "span";
|
|
3673
3673
|
}
|
|
3674
3674
|
function Th(e, t) {
|
|
3675
3675
|
let n = Nr(t);
|
|
@@ -3695,14 +3695,14 @@ function Eh(e, t) {
|
|
|
3695
3695
|
}
|
|
3696
3696
|
function ll(e) {
|
|
3697
3697
|
for (const t of e.childNodes)
|
|
3698
|
-
if (!(t instanceof HTMLElement &&
|
|
3698
|
+
if (!(t instanceof HTMLElement && Pt(t)))
|
|
3699
3699
|
return t;
|
|
3700
3700
|
return null;
|
|
3701
3701
|
}
|
|
3702
3702
|
function Nh(e, t, n) {
|
|
3703
3703
|
if (n.startContainer === e) {
|
|
3704
3704
|
const r = e.childNodes[Math.min(n.startOffset, Math.max(0, e.childNodes.length - 1))] ?? e.firstChild;
|
|
3705
|
-
return r instanceof HTMLElement &&
|
|
3705
|
+
return r instanceof HTMLElement && Pt(r) ? ll(e) : r;
|
|
3706
3706
|
}
|
|
3707
3707
|
return n.startContainer === t && e !== t ? ll(e) : xh(e, n.startContainer);
|
|
3708
3708
|
}
|
|
@@ -3714,7 +3714,7 @@ function Mh(e, t) {
|
|
|
3714
3714
|
return l.appendChild(document.createElement("br")), n.appendChild(l), l;
|
|
3715
3715
|
}
|
|
3716
3716
|
const r = Nh(n, e, t);
|
|
3717
|
-
if (!r || r instanceof HTMLElement &&
|
|
3717
|
+
if (!r || r instanceof HTMLElement && Pt(r) || r instanceof Element && jl.has(ge(r)) || r instanceof HTMLElement && Vl.has(ge(r)) || !al(r)) return null;
|
|
3718
3718
|
const o = Eh(n, r), i = document.createElement("p");
|
|
3719
3719
|
n.insertBefore(i, o[0]);
|
|
3720
3720
|
for (const l of o) i.appendChild(l);
|
|
@@ -3723,7 +3723,7 @@ function Mh(e, t) {
|
|
|
3723
3723
|
function Mr(e) {
|
|
3724
3724
|
const t = Wn(e);
|
|
3725
3725
|
if (t.length > 0) return t;
|
|
3726
|
-
const n =
|
|
3726
|
+
const n = Tt(e);
|
|
3727
3727
|
if (!n) return [];
|
|
3728
3728
|
const r = Mh(e, n);
|
|
3729
3729
|
return r ? [r] : [];
|
|
@@ -3797,7 +3797,7 @@ function Ih(e) {
|
|
|
3797
3797
|
const t = e.trim().toLowerCase();
|
|
3798
3798
|
return t === "" || t === "transparent" || t === "inherit" || t === "initial" || t === "unset" || t === "currentcolor" || t === "currentColor";
|
|
3799
3799
|
}
|
|
3800
|
-
function
|
|
3800
|
+
function Te(e) {
|
|
3801
3801
|
const t = e.trim();
|
|
3802
3802
|
if (!t || Ih(t)) return null;
|
|
3803
3803
|
const n = Ha(t);
|
|
@@ -3828,7 +3828,7 @@ function De(e) {
|
|
|
3828
3828
|
}
|
|
3829
3829
|
function Gd(e, t) {
|
|
3830
3830
|
const n = t === "color" ? e.style.color : e.style.backgroundColor;
|
|
3831
|
-
return n ?
|
|
3831
|
+
return n ? Te(n) : null;
|
|
3832
3832
|
}
|
|
3833
3833
|
function Vo(e, t, n) {
|
|
3834
3834
|
let r = _h(t);
|
|
@@ -3860,7 +3860,7 @@ function Fh(e, t, n) {
|
|
|
3860
3860
|
let r = t;
|
|
3861
3861
|
for (; r.parentElement && r.parentElement !== e; ) {
|
|
3862
3862
|
const o = r.parentElement;
|
|
3863
|
-
if (!
|
|
3863
|
+
if (!Dt(o) || !jo(o, n)) {
|
|
3864
3864
|
r = o;
|
|
3865
3865
|
continue;
|
|
3866
3866
|
}
|
|
@@ -3886,9 +3886,9 @@ function Zo(e, t) {
|
|
|
3886
3886
|
function br(e, t, n) {
|
|
3887
3887
|
const r = jd(e);
|
|
3888
3888
|
if (!r || r.collapsed) return !1;
|
|
3889
|
-
const o = n === null ? null :
|
|
3889
|
+
const o = n === null ? null : Te(n);
|
|
3890
3890
|
if (n !== null && o === null) return !1;
|
|
3891
|
-
|
|
3891
|
+
St(r);
|
|
3892
3892
|
const i = Ye(r).filter((l) => l.data.length > 0);
|
|
3893
3893
|
for (const l of i) {
|
|
3894
3894
|
const c = Vo(e, l, t);
|
|
@@ -3908,7 +3908,7 @@ function iu(e, t, n) {
|
|
|
3908
3908
|
Jl(e, t);
|
|
3909
3909
|
return;
|
|
3910
3910
|
}
|
|
3911
|
-
const r =
|
|
3911
|
+
const r = Te(n.value);
|
|
3912
3912
|
r && Vd(e, t, r);
|
|
3913
3913
|
}
|
|
3914
3914
|
function Bh(e) {
|
|
@@ -3943,7 +3943,7 @@ function Zd(e, t, n) {
|
|
|
3943
3943
|
let r = t;
|
|
3944
3944
|
for (; r.parentElement && r.parentElement !== e; ) {
|
|
3945
3945
|
const o = r.parentElement;
|
|
3946
|
-
if (!
|
|
3946
|
+
if (!Dt(o) || !n.some((i) => jo(o, i))) {
|
|
3947
3947
|
r = o;
|
|
3948
3948
|
continue;
|
|
3949
3949
|
}
|
|
@@ -4091,7 +4091,7 @@ function es() {
|
|
|
4091
4091
|
breakBeforeMixed: !1
|
|
4092
4092
|
};
|
|
4093
4093
|
}
|
|
4094
|
-
function
|
|
4094
|
+
function zt(e, t) {
|
|
4095
4095
|
return Ue.every((n) => lt(e[n], t[n]));
|
|
4096
4096
|
}
|
|
4097
4097
|
function em(e, t) {
|
|
@@ -4208,7 +4208,7 @@ function ob(e) {
|
|
|
4208
4208
|
l.push(d);
|
|
4209
4209
|
continue;
|
|
4210
4210
|
}
|
|
4211
|
-
const f =
|
|
4211
|
+
const f = Te(c);
|
|
4212
4212
|
if (f) {
|
|
4213
4213
|
i = f;
|
|
4214
4214
|
continue;
|
|
@@ -4250,7 +4250,7 @@ function ab(e) {
|
|
|
4250
4250
|
return Yh.has(t) ? t : "none";
|
|
4251
4251
|
}
|
|
4252
4252
|
function im(e) {
|
|
4253
|
-
const t = ab(e.style.borderStyle || e.style.borderTopStyle), n = En(e, "border-width") ?? En(e, "border-top-width"), r = e.style.borderColor || e.style.borderTopColor, o = r ?
|
|
4253
|
+
const t = ab(e.style.borderStyle || e.style.borderTopStyle), n = En(e, "border-width") ?? En(e, "border-top-width"), r = e.style.borderColor || e.style.borderTopColor, o = r ? Te(r) : null;
|
|
4254
4254
|
return { style: t, width: n, color: o };
|
|
4255
4255
|
}
|
|
4256
4256
|
function lb(e, t) {
|
|
@@ -4290,10 +4290,10 @@ function ub(e, t) {
|
|
|
4290
4290
|
}
|
|
4291
4291
|
function cm(e) {
|
|
4292
4292
|
const t = e.style.backgroundColor;
|
|
4293
|
-
return t ?
|
|
4293
|
+
return t ? Te(t) : null;
|
|
4294
4294
|
}
|
|
4295
4295
|
function db(e, t) {
|
|
4296
|
-
const n = t ?
|
|
4296
|
+
const n = t ? Te(t) : null;
|
|
4297
4297
|
return cm(e) === n ? !1 : (n ? e.style.backgroundColor = n : e.style.removeProperty("background-color"), !0);
|
|
4298
4298
|
}
|
|
4299
4299
|
function um(e) {
|
|
@@ -4330,9 +4330,9 @@ function fb(e) {
|
|
|
4330
4330
|
const r = n.map(Gn), o = r[0];
|
|
4331
4331
|
return {
|
|
4332
4332
|
margin: o.margin,
|
|
4333
|
-
marginMixed: r.some((i) => !
|
|
4333
|
+
marginMixed: r.some((i) => !zt(i.margin, o.margin)),
|
|
4334
4334
|
padding: o.padding,
|
|
4335
|
-
paddingMixed: r.some((i) => !
|
|
4335
|
+
paddingMixed: r.some((i) => !zt(i.padding, o.padding)),
|
|
4336
4336
|
lineHeight: o.lineHeight,
|
|
4337
4337
|
lineHeightMixed: r.some((i) => !em(i.lineHeight, o.lineHeight)),
|
|
4338
4338
|
border: o.border,
|
|
@@ -4455,7 +4455,7 @@ function bb(e) {
|
|
|
4455
4455
|
function gn(e) {
|
|
4456
4456
|
return bb(Sr(e));
|
|
4457
4457
|
}
|
|
4458
|
-
function
|
|
4458
|
+
function kt(e, t) {
|
|
4459
4459
|
return Sr(e) || !Sr(t) ? e : mm(e, gn(t));
|
|
4460
4460
|
}
|
|
4461
4461
|
function yb(e) {
|
|
@@ -4522,7 +4522,7 @@ function Pb(e) {
|
|
|
4522
4522
|
if (!t) return;
|
|
4523
4523
|
const n = [], r = [];
|
|
4524
4524
|
for (const c of e) {
|
|
4525
|
-
const d =
|
|
4525
|
+
const d = De(c);
|
|
4526
4526
|
n.push(...d.hrefs), r.push(d.body);
|
|
4527
4527
|
}
|
|
4528
4528
|
const o = r.map((c, d) => `<div style="${d < r.length - 1 ? "page-break-after: always;" : ""}">${c}</div>`).join(""), i = kb(e), l = [
|
|
@@ -4547,11 +4547,11 @@ function Db(e) {
|
|
|
4547
4547
|
const t = e.onOpen ? await e.onOpen() : await qg();
|
|
4548
4548
|
if (t !== null) {
|
|
4549
4549
|
if (Array.isArray(t)) {
|
|
4550
|
-
e.setHtml(
|
|
4550
|
+
e.setHtml(Ft(t));
|
|
4551
4551
|
return;
|
|
4552
4552
|
}
|
|
4553
4553
|
if (e.isMultiPagesEnabled()) {
|
|
4554
|
-
e.setHtml(
|
|
4554
|
+
e.setHtml(Ft([t]));
|
|
4555
4555
|
return;
|
|
4556
4556
|
}
|
|
4557
4557
|
e.setHtml(t);
|
|
@@ -5037,7 +5037,7 @@ function cl(e, t, n) {
|
|
|
5037
5037
|
const o = qb(e);
|
|
5038
5038
|
if (!o || o.collapsed) return !1;
|
|
5039
5039
|
const i = $l(r.value, r.unit);
|
|
5040
|
-
|
|
5040
|
+
St(o);
|
|
5041
5041
|
const l = Ye(o).filter((c) => c.data.length > 0);
|
|
5042
5042
|
for (const c of l) {
|
|
5043
5043
|
const d = hm(e, c);
|
|
@@ -5098,7 +5098,7 @@ function ty(e, t) {
|
|
|
5098
5098
|
return "";
|
|
5099
5099
|
}
|
|
5100
5100
|
function vm(e) {
|
|
5101
|
-
const t =
|
|
5101
|
+
const t = Tt(e);
|
|
5102
5102
|
if (!t) return { value: null, mixed: !1 };
|
|
5103
5103
|
const n = t.collapsed ? [] : Ye(t).filter((d) => d.data.length > 0), i = (n.length > 0 ? n : [t.startContainer]).map((d) => ty(e, d)).map((d) => d.trim()), l = i[0] ?? "";
|
|
5104
5104
|
return i.every((d) => d === l) ? { value: l || null, mixed: !1 } : { value: null, mixed: !0 };
|
|
@@ -5110,9 +5110,9 @@ function km(e, t) {
|
|
|
5110
5110
|
function Am(e, t) {
|
|
5111
5111
|
const n = bi(t);
|
|
5112
5112
|
if (!n) return !1;
|
|
5113
|
-
const r =
|
|
5113
|
+
const r = Tt(e);
|
|
5114
5114
|
if (!r || r.collapsed) return !1;
|
|
5115
|
-
|
|
5115
|
+
St(r);
|
|
5116
5116
|
const o = Ye(r).filter((i) => i.data.length > 0);
|
|
5117
5117
|
if (o.length === 0) return !1;
|
|
5118
5118
|
for (const i of o)
|
|
@@ -5134,7 +5134,7 @@ const ct = ["bold", "italic", "underline", "strikethrough"], Nn = {
|
|
|
5134
5134
|
underline: /* @__PURE__ */ new Set(["u"]),
|
|
5135
5135
|
strikethrough: /* @__PURE__ */ new Set(["s", "strike", "del"])
|
|
5136
5136
|
}, oy = /* @__PURE__ */ new Set(["underline", "line-through", "overline"]);
|
|
5137
|
-
function
|
|
5137
|
+
function Ht() {
|
|
5138
5138
|
return {
|
|
5139
5139
|
bold: !1,
|
|
5140
5140
|
italic: !1,
|
|
@@ -5283,7 +5283,7 @@ function uy(e, t, n) {
|
|
|
5283
5283
|
let r = t;
|
|
5284
5284
|
for (; r.parentElement && r.parentElement !== e; ) {
|
|
5285
5285
|
const o = r.parentElement;
|
|
5286
|
-
if (!
|
|
5286
|
+
if (!Dt(o) || !Qo(o, n)) {
|
|
5287
5287
|
r = o;
|
|
5288
5288
|
continue;
|
|
5289
5289
|
}
|
|
@@ -5305,7 +5305,7 @@ function dy(e, t, n) {
|
|
|
5305
5305
|
return r.length === 0 ? On(e, t.startContainer, n) : r.every((o) => On(e, o, n));
|
|
5306
5306
|
}
|
|
5307
5307
|
function my(e, t, n, r) {
|
|
5308
|
-
|
|
5308
|
+
St(t);
|
|
5309
5309
|
const o = Ye(t).filter((i) => i.data.length > 0);
|
|
5310
5310
|
for (const i of o)
|
|
5311
5311
|
r ? On(e, i, n) || cy(i, n) : uy(e, i, n);
|
|
@@ -5313,14 +5313,14 @@ function my(e, t, n, r) {
|
|
|
5313
5313
|
}
|
|
5314
5314
|
function Mn(e) {
|
|
5315
5315
|
const t = window.getSelection();
|
|
5316
|
-
if (!t || t.rangeCount === 0) return
|
|
5316
|
+
if (!t || t.rangeCount === 0) return Ht();
|
|
5317
5317
|
const n = t.getRangeAt(0);
|
|
5318
|
-
if (!me(e, n.commonAncestorContainer)) return
|
|
5318
|
+
if (!me(e, n.commonAncestorContainer)) return Ht();
|
|
5319
5319
|
if (n.collapsed)
|
|
5320
5320
|
return dl(e, n);
|
|
5321
5321
|
const r = Ye(n).filter((i) => i.data.length > 0);
|
|
5322
5322
|
if (r.length === 0) return dl(e, n);
|
|
5323
|
-
const o =
|
|
5323
|
+
const o = Ht();
|
|
5324
5324
|
for (const i of ct)
|
|
5325
5325
|
o[i] = On(e, r[0], i);
|
|
5326
5326
|
for (let i = 1; i < r.length; i += 1)
|
|
@@ -5329,7 +5329,7 @@ function Mn(e) {
|
|
|
5329
5329
|
return o;
|
|
5330
5330
|
}
|
|
5331
5331
|
function dl(e, t) {
|
|
5332
|
-
const n =
|
|
5332
|
+
const n = Ht();
|
|
5333
5333
|
for (const r of ct)
|
|
5334
5334
|
n[r] = On(e, t.startContainer, r);
|
|
5335
5335
|
return n;
|
|
@@ -5370,7 +5370,7 @@ function py(e, t, n) {
|
|
|
5370
5370
|
let o = r;
|
|
5371
5371
|
for (; o.parentElement && o.parentElement !== e; ) {
|
|
5372
5372
|
const d = o.parentElement;
|
|
5373
|
-
if (!
|
|
5373
|
+
if (!Dt(d)) {
|
|
5374
5374
|
o = d;
|
|
5375
5375
|
continue;
|
|
5376
5376
|
}
|
|
@@ -5437,12 +5437,12 @@ function Cy(e) {
|
|
|
5437
5437
|
return e instanceof Element && yi.has(ge(e));
|
|
5438
5438
|
}
|
|
5439
5439
|
function Nm(e) {
|
|
5440
|
-
return e instanceof HTMLElement && !
|
|
5440
|
+
return e instanceof HTMLElement && !Pt(e) && xm.has(ge(e));
|
|
5441
5441
|
}
|
|
5442
5442
|
function fl(e) {
|
|
5443
5443
|
if (e.nodeType === Node.TEXT_NODE || e.nodeType === Node.COMMENT_NODE || !(e instanceof Element)) return !0;
|
|
5444
5444
|
const t = ge(e);
|
|
5445
|
-
return xm.has(t) || yi.has(t) ? !1 :
|
|
5445
|
+
return xm.has(t) || yi.has(t) ? !1 : Dt(e) || t === "br" || t === "a" || t === "img" || t === "span";
|
|
5446
5446
|
}
|
|
5447
5447
|
function vy(e, t) {
|
|
5448
5448
|
let n = Nr(t);
|
|
@@ -5489,14 +5489,14 @@ function Sy(e, t) {
|
|
|
5489
5489
|
}
|
|
5490
5490
|
function pl(e) {
|
|
5491
5491
|
for (const t of e.childNodes)
|
|
5492
|
-
if (!(t instanceof HTMLElement &&
|
|
5492
|
+
if (!(t instanceof HTMLElement && Pt(t)))
|
|
5493
5493
|
return t;
|
|
5494
5494
|
return null;
|
|
5495
5495
|
}
|
|
5496
5496
|
function Py(e, t, n) {
|
|
5497
5497
|
if (n.startContainer === e) {
|
|
5498
5498
|
const r = e.childNodes[Math.min(n.startOffset, Math.max(0, e.childNodes.length - 1))] ?? e.firstChild;
|
|
5499
|
-
return r instanceof HTMLElement &&
|
|
5499
|
+
return r instanceof HTMLElement && Pt(r) ? pl(e) : r;
|
|
5500
5500
|
}
|
|
5501
5501
|
return n.startContainer === t && e !== t ? pl(e) : Ay(e, n.startContainer);
|
|
5502
5502
|
}
|
|
@@ -5508,14 +5508,14 @@ function Dy(e, t, n) {
|
|
|
5508
5508
|
return c.appendChild(document.createElement("br")), r.appendChild(c), !0;
|
|
5509
5509
|
}
|
|
5510
5510
|
const o = Py(r, e, t);
|
|
5511
|
-
if (!o || o instanceof HTMLElement &&
|
|
5511
|
+
if (!o || o instanceof HTMLElement && Pt(o) || Cy(o) || Nm(o) || !fl(o)) return !1;
|
|
5512
5512
|
const i = Sy(r, o), l = document.createElement(n);
|
|
5513
5513
|
r.insertBefore(l, i[0]);
|
|
5514
5514
|
for (const c of i) l.appendChild(c);
|
|
5515
5515
|
return !0;
|
|
5516
5516
|
}
|
|
5517
5517
|
function Ty(e) {
|
|
5518
|
-
const t =
|
|
5518
|
+
const t = Tt(e);
|
|
5519
5519
|
if (!t) return yy();
|
|
5520
5520
|
const n = ql(t).map((o) => {
|
|
5521
5521
|
const i = Mm(e, o);
|
|
@@ -5525,7 +5525,7 @@ function Ty(e) {
|
|
|
5525
5525
|
}
|
|
5526
5526
|
function xy(e, t) {
|
|
5527
5527
|
if (!Em(t)) return !1;
|
|
5528
|
-
const n =
|
|
5528
|
+
const n = Tt(e);
|
|
5529
5529
|
if (!n) return !1;
|
|
5530
5530
|
const r = Fn(e, n.startContainer, n.startOffset), o = Fn(e, n.endContainer, n.endOffset), i = Math.min(r, o), l = Math.max(r, o), c = ky(e, n);
|
|
5531
5531
|
let d = !1;
|
|
@@ -5827,7 +5827,7 @@ function Gy(e, t) {
|
|
|
5827
5827
|
function os(e) {
|
|
5828
5828
|
return qe(e, as(e));
|
|
5829
5829
|
}
|
|
5830
|
-
function
|
|
5830
|
+
function xt(e) {
|
|
5831
5831
|
return ni(e, as(e));
|
|
5832
5832
|
}
|
|
5833
5833
|
function $m(e) {
|
|
@@ -5877,7 +5877,7 @@ function jy(e, t) {
|
|
|
5877
5877
|
}
|
|
5878
5878
|
function gl(e, t) {
|
|
5879
5879
|
var g, C, y, w;
|
|
5880
|
-
const n =
|
|
5880
|
+
const n = xt(e);
|
|
5881
5881
|
if (!n) return !1;
|
|
5882
5882
|
const r = qe(e, n);
|
|
5883
5883
|
if (!r) return !1;
|
|
@@ -5906,7 +5906,7 @@ function gl(e, t) {
|
|
|
5906
5906
|
}
|
|
5907
5907
|
function fu(e, t) {
|
|
5908
5908
|
var f, p, g, C;
|
|
5909
|
-
const n =
|
|
5909
|
+
const n = xt(e);
|
|
5910
5910
|
if (!n) return !1;
|
|
5911
5911
|
const r = qe(e, n);
|
|
5912
5912
|
if (!r) return !1;
|
|
@@ -5928,7 +5928,7 @@ function fu(e, t) {
|
|
|
5928
5928
|
}
|
|
5929
5929
|
function Zy(e) {
|
|
5930
5930
|
var C, y;
|
|
5931
|
-
const t =
|
|
5931
|
+
const t = xt(e);
|
|
5932
5932
|
if (!t) return !1;
|
|
5933
5933
|
const n = qe(e, t);
|
|
5934
5934
|
if (!n) return !1;
|
|
@@ -5948,7 +5948,7 @@ function Zy(e) {
|
|
|
5948
5948
|
}
|
|
5949
5949
|
function qy(e) {
|
|
5950
5950
|
var f, p, g;
|
|
5951
|
-
const t =
|
|
5951
|
+
const t = xt(e);
|
|
5952
5952
|
if (!t) return !1;
|
|
5953
5953
|
const n = qe(e, t);
|
|
5954
5954
|
if (!n) return !1;
|
|
@@ -5964,7 +5964,7 @@ function qy(e) {
|
|
|
5964
5964
|
return d && Ze(d), !0;
|
|
5965
5965
|
}
|
|
5966
5966
|
function Yy(e, t) {
|
|
5967
|
-
const n =
|
|
5967
|
+
const n = xt(e);
|
|
5968
5968
|
if (!n) return !1;
|
|
5969
5969
|
const r = qe(e, n);
|
|
5970
5970
|
if (!r) return !1;
|
|
@@ -5986,7 +5986,7 @@ function pu(e) {
|
|
|
5986
5986
|
return Um(e) !== null;
|
|
5987
5987
|
}
|
|
5988
5988
|
function gu(e) {
|
|
5989
|
-
const t =
|
|
5989
|
+
const t = xt(e);
|
|
5990
5990
|
if (!t) return !1;
|
|
5991
5991
|
const n = wi(t);
|
|
5992
5992
|
return n.colSpan > 1 || n.rowSpan > 1;
|
|
@@ -5998,13 +5998,13 @@ function Jy(e) {
|
|
|
5998
5998
|
return n ? Wm(n, t) : !1;
|
|
5999
5999
|
}
|
|
6000
6000
|
function Qy(e) {
|
|
6001
|
-
const t =
|
|
6001
|
+
const t = xt(e);
|
|
6002
6002
|
if (!t) return !1;
|
|
6003
6003
|
const n = qe(e, t);
|
|
6004
6004
|
return n ? Gm(n, t) : !1;
|
|
6005
6005
|
}
|
|
6006
6006
|
function e1(e, t, n) {
|
|
6007
|
-
const r =
|
|
6007
|
+
const r = xt(e);
|
|
6008
6008
|
if (!r) return !1;
|
|
6009
6009
|
const o = qe(e, r);
|
|
6010
6010
|
if (!o) return !1;
|
|
@@ -6166,7 +6166,7 @@ function jm(e) {
|
|
|
6166
6166
|
if (t.length > 0)
|
|
6167
6167
|
return bu(t.map(ri));
|
|
6168
6168
|
const n = Wn(e);
|
|
6169
|
-
return n.length === 0 ?
|
|
6169
|
+
return n.length === 0 ? Tt(e) ? { align: "left", mixed: !1 } : { align: null, mixed: !1 } : bu(n.map(ri));
|
|
6170
6170
|
}
|
|
6171
6171
|
function Zm(e, t) {
|
|
6172
6172
|
return Vm.includes(t) ? Un(e, () => {
|
|
@@ -6814,7 +6814,7 @@ function yw() {
|
|
|
6814
6814
|
return {
|
|
6815
6815
|
size: null,
|
|
6816
6816
|
unit: mn,
|
|
6817
|
-
marks:
|
|
6817
|
+
marks: Ht(),
|
|
6818
6818
|
fontFamily: null,
|
|
6819
6819
|
fontFamilyMixed: !1,
|
|
6820
6820
|
fontColor: null,
|
|
@@ -6844,7 +6844,7 @@ function ww(e) {
|
|
|
6844
6844
|
marks: l,
|
|
6845
6845
|
fontFamily: d || null,
|
|
6846
6846
|
fontFamilyMixed: !1,
|
|
6847
|
-
fontColor: c ?
|
|
6847
|
+
fontColor: c ? Te(c) : null,
|
|
6848
6848
|
highlightColor: null,
|
|
6849
6849
|
fontColorMixed: !1,
|
|
6850
6850
|
highlightColorMixed: !1
|
|
@@ -6865,8 +6865,8 @@ function vw(e, t) {
|
|
|
6865
6865
|
}
|
|
6866
6866
|
function kw(e, t) {
|
|
6867
6867
|
if (t.fontColorMixed) return !1;
|
|
6868
|
-
const n = t.fontColor ?
|
|
6869
|
-
return (e.style.color ?
|
|
6868
|
+
const n = t.fontColor ? Te(t.fontColor) : null;
|
|
6869
|
+
return (e.style.color ? Te(e.style.color) : null) === n ? !1 : (n ? e.style.color = n : e.style.removeProperty("color"), !0);
|
|
6870
6870
|
}
|
|
6871
6871
|
function Aw(e, t) {
|
|
6872
6872
|
let n = !1;
|
|
@@ -6916,7 +6916,7 @@ function Dw(e) {
|
|
|
6916
6916
|
};
|
|
6917
6917
|
}
|
|
6918
6918
|
function Tw(e, t) {
|
|
6919
|
-
const n =
|
|
6919
|
+
const n = Tt(e), r = n ? Fn(e, n.startContainer, n.startOffset) : null, o = n ? Fn(e, n.endContainer, n.endOffset) : null, i = Tr(e), l = Kg(e);
|
|
6920
6920
|
Oo(l);
|
|
6921
6921
|
const c = Sw(l, t.font), d = Vn(l, Pw(t)), f = bw(l, t.backgroundImage);
|
|
6922
6922
|
mi(e);
|
|
@@ -7017,13 +7017,13 @@ function zw(e, t) {
|
|
|
7017
7017
|
for (const r of n) nt(r);
|
|
7018
7018
|
}
|
|
7019
7019
|
function Ow(e, t, n) {
|
|
7020
|
-
|
|
7020
|
+
St(t);
|
|
7021
7021
|
const r = Ye(t).filter((c) => c.data.length > 0);
|
|
7022
7022
|
zw(e, r), r.length > 0 && bn(r);
|
|
7023
7023
|
const o = window.getSelection();
|
|
7024
7024
|
if (!o || o.rangeCount === 0) return !1;
|
|
7025
7025
|
const i = o.getRangeAt(0);
|
|
7026
|
-
|
|
7026
|
+
St(i);
|
|
7027
7027
|
const l = document.createElement("a");
|
|
7028
7028
|
fs(l, n);
|
|
7029
7029
|
try {
|
|
@@ -7094,7 +7094,7 @@ function Vw(e, t) {
|
|
|
7094
7094
|
return Gw(i, n), !0;
|
|
7095
7095
|
if (o.collapsed)
|
|
7096
7096
|
return Su(o, n), !0;
|
|
7097
|
-
|
|
7097
|
+
St(o);
|
|
7098
7098
|
const l = document.createElement("span");
|
|
7099
7099
|
l.id = n;
|
|
7100
7100
|
try {
|
|
@@ -7173,7 +7173,7 @@ function xu(e, t) {
|
|
|
7173
7173
|
}
|
|
7174
7174
|
function Sl(e, t, n) {
|
|
7175
7175
|
if (!me(e, n.commonAncestorContainer)) return !1;
|
|
7176
|
-
|
|
7176
|
+
St(n);
|
|
7177
7177
|
const r = document.createElement("span");
|
|
7178
7178
|
r.setAttribute(Oe, t);
|
|
7179
7179
|
try {
|
|
@@ -7369,7 +7369,7 @@ function dC(e, t) {
|
|
|
7369
7369
|
let n = t;
|
|
7370
7370
|
for (; n.parentElement && n.parentElement !== e; ) {
|
|
7371
7371
|
const r = n.parentElement;
|
|
7372
|
-
if (!
|
|
7372
|
+
if (!Dt(r)) {
|
|
7373
7373
|
n = r;
|
|
7374
7374
|
continue;
|
|
7375
7375
|
}
|
|
@@ -7385,10 +7385,10 @@ function dC(e, t) {
|
|
|
7385
7385
|
}
|
|
7386
7386
|
}
|
|
7387
7387
|
function mC(e) {
|
|
7388
|
-
const t =
|
|
7388
|
+
const t = Tt(e);
|
|
7389
7389
|
if (!t || t.collapsed) return !1;
|
|
7390
7390
|
const n = e.innerHTML;
|
|
7391
|
-
|
|
7391
|
+
St(t);
|
|
7392
7392
|
const r = Ye(t).filter((o) => o.data.length > 0);
|
|
7393
7393
|
if (r.length === 0) return !1;
|
|
7394
7394
|
for (const o of r)
|
|
@@ -7686,7 +7686,7 @@ function UC(e, t) {
|
|
|
7686
7686
|
}
|
|
7687
7687
|
function WC(e) {
|
|
7688
7688
|
const t = ge(e);
|
|
7689
|
-
return
|
|
7689
|
+
return Dt(e) || t === "a";
|
|
7690
7690
|
}
|
|
7691
7691
|
function _u(e) {
|
|
7692
7692
|
GC(e) && e.appendChild(document.createElement("br"));
|
|
@@ -7723,19 +7723,19 @@ function QC() {
|
|
|
7723
7723
|
function e0(e) {
|
|
7724
7724
|
return Pf(e, QC());
|
|
7725
7725
|
}
|
|
7726
|
-
const
|
|
7726
|
+
const Ot = 16;
|
|
7727
7727
|
function Iu(e) {
|
|
7728
|
-
return Math.min(Kn.px.max, Math.max(
|
|
7728
|
+
return Math.min(Kn.px.max, Math.max(Ot, e));
|
|
7729
7729
|
}
|
|
7730
7730
|
function t0(e) {
|
|
7731
7731
|
return e.width > 0 && e.height > 0 ? e.width / e.height : 1;
|
|
7732
7732
|
}
|
|
7733
7733
|
function n0(e, t) {
|
|
7734
|
-
const n = Math.max(
|
|
7734
|
+
const n = Math.max(Ot, Ot * t), r = Math.min(Kn.px.max, Kn.px.max * t), o = Math.min(r, Math.max(n, e));
|
|
7735
7735
|
return { width: o, height: o / t };
|
|
7736
7736
|
}
|
|
7737
7737
|
function r0(e, t) {
|
|
7738
|
-
const n = Math.max(
|
|
7738
|
+
const n = Math.max(Ot, Ot / t), r = Math.min(Kn.px.max, Kn.px.max / t), o = Math.min(r, Math.max(n, e));
|
|
7739
7739
|
return { width: o * t, height: o };
|
|
7740
7740
|
}
|
|
7741
7741
|
function o0(e, t, n) {
|
|
@@ -7748,12 +7748,12 @@ function o0(e, t, n) {
|
|
|
7748
7748
|
function i0(e) {
|
|
7749
7749
|
const t = e.getBoundingClientRect(), n = e.offsetWidth || t.width, r = e.offsetHeight || t.height;
|
|
7750
7750
|
return {
|
|
7751
|
-
width: n > 0 ? n :
|
|
7752
|
-
height: r > 0 ? r :
|
|
7751
|
+
width: n > 0 ? n : Ot,
|
|
7752
|
+
height: r > 0 ? r : Ot
|
|
7753
7753
|
};
|
|
7754
7754
|
}
|
|
7755
7755
|
function a0(e, t, n) {
|
|
7756
|
-
const r = $n(Math.max(
|
|
7756
|
+
const r = $n(Math.max(Ot, t), "px"), o = $n(Math.max(Ot, n), "px");
|
|
7757
7757
|
return !r || !o ? !1 : nf(e, {
|
|
7758
7758
|
...tf(e),
|
|
7759
7759
|
sizeMode: "lock",
|
|
@@ -7880,7 +7880,7 @@ function w0(e, t) {
|
|
|
7880
7880
|
return k0(e, t.color) && (n = !0), bl(e, t.textAlign) && (n = !0), S0(e, t.verticalAlign) && (n = !0), P0(e, t.width) && (n = !0), n && gt(e), n;
|
|
7881
7881
|
}
|
|
7882
7882
|
function C0(e) {
|
|
7883
|
-
const t =
|
|
7883
|
+
const t = xt(e);
|
|
7884
7884
|
return t ? y0(t) : null;
|
|
7885
7885
|
}
|
|
7886
7886
|
function v0(e, t) {
|
|
@@ -7889,7 +7889,7 @@ function v0(e, t) {
|
|
|
7889
7889
|
let r = !1;
|
|
7890
7890
|
for (const i of n)
|
|
7891
7891
|
w0(i, t) && (r = !0);
|
|
7892
|
-
const o =
|
|
7892
|
+
const o = xt(e);
|
|
7893
7893
|
if (o) {
|
|
7894
7894
|
const i = wi(o);
|
|
7895
7895
|
(i.colSpan !== t.colSpan || i.rowSpan !== t.rowSpan) && e1(e, t.colSpan, t.rowSpan) && (r = !0);
|
|
@@ -7898,10 +7898,10 @@ function v0(e, t) {
|
|
|
7898
7898
|
}
|
|
7899
7899
|
function Tf(e) {
|
|
7900
7900
|
const t = e.style.color;
|
|
7901
|
-
return t ?
|
|
7901
|
+
return t ? Te(t) : null;
|
|
7902
7902
|
}
|
|
7903
7903
|
function k0(e, t) {
|
|
7904
|
-
const n = t ?
|
|
7904
|
+
const n = t ? Te(t) : null;
|
|
7905
7905
|
return Tf(e) === n ? !1 : (n ? e.style.color = n : e.style.removeProperty("color"), !0);
|
|
7906
7906
|
}
|
|
7907
7907
|
function A0(e) {
|
|
@@ -7974,18 +7974,18 @@ function M0(e, t) {
|
|
|
7974
7974
|
}
|
|
7975
7975
|
function Ef(e) {
|
|
7976
7976
|
const t = e.style.backgroundColor;
|
|
7977
|
-
return t ?
|
|
7977
|
+
return t ? Te(t) : null;
|
|
7978
7978
|
}
|
|
7979
7979
|
function R0(e, t) {
|
|
7980
|
-
const n = t ?
|
|
7980
|
+
const n = t ? Te(t) : null;
|
|
7981
7981
|
return Ef(e) === n ? !1 : (n ? e.style.backgroundColor = n : e.style.removeProperty("background-color"), !0);
|
|
7982
7982
|
}
|
|
7983
7983
|
function Nf(e) {
|
|
7984
7984
|
const t = e.style.color;
|
|
7985
|
-
return t ?
|
|
7985
|
+
return t ? Te(t) : null;
|
|
7986
7986
|
}
|
|
7987
7987
|
function _0(e, t) {
|
|
7988
|
-
const n = t ?
|
|
7988
|
+
const n = t ? Te(t) : null;
|
|
7989
7989
|
return Nf(e) === n ? !1 : (n ? e.style.color = n : e.style.removeProperty("color"), !0);
|
|
7990
7990
|
}
|
|
7991
7991
|
function Mf(e) {
|
|
@@ -8091,7 +8091,7 @@ function Hu() {
|
|
|
8091
8091
|
return Pl;
|
|
8092
8092
|
}
|
|
8093
8093
|
function O0(e) {
|
|
8094
|
-
const t =
|
|
8094
|
+
const t = Te(e);
|
|
8095
8095
|
t && (Pl = [t, ...Pl.filter((n) => n !== t)].slice(0, z0), Dl.forEach((n) => n()));
|
|
8096
8096
|
}
|
|
8097
8097
|
function K0(e) {
|
|
@@ -8100,7 +8100,7 @@ function K0(e) {
|
|
|
8100
8100
|
};
|
|
8101
8101
|
}
|
|
8102
8102
|
function No(e) {
|
|
8103
|
-
const t =
|
|
8103
|
+
const t = Te(e);
|
|
8104
8104
|
return t ? {
|
|
8105
8105
|
r: Number.parseInt(t.slice(1, 3), 16),
|
|
8106
8106
|
g: Number.parseInt(t.slice(3, 5), 16),
|
|
@@ -8133,7 +8133,7 @@ async function $0() {
|
|
|
8133
8133
|
const e = window.EyeDropper;
|
|
8134
8134
|
try {
|
|
8135
8135
|
const t = await new e().open();
|
|
8136
|
-
return
|
|
8136
|
+
return Te(t.sRGBHex);
|
|
8137
8137
|
} catch {
|
|
8138
8138
|
return null;
|
|
8139
8139
|
}
|
|
@@ -8182,25 +8182,25 @@ function gs({
|
|
|
8182
8182
|
const Q = $a(I);
|
|
8183
8183
|
k(Q), x({ r: String(I.r), g: String(I.g), b: String(I.b) }), E(un(I.r, I.g, I.b));
|
|
8184
8184
|
}, [C, l]);
|
|
8185
|
-
const R = (I, Q,
|
|
8186
|
-
I && (M.current = I),
|
|
8187
|
-
}, N = (I, Q,
|
|
8185
|
+
const R = (I, Q, ue) => {
|
|
8186
|
+
I && (M.current = I), ue && I && O0(I), c(I), Q && (d == null || d(I));
|
|
8187
|
+
}, N = (I, Q, ue) => {
|
|
8188
8188
|
const X = un(I.r, I.g, I.b);
|
|
8189
|
-
k($a(I)), x({ r: String(I.r), g: String(I.g), b: String(I.b) }), E(X), R(X, Q,
|
|
8190
|
-
}, z = (I, Q,
|
|
8189
|
+
k($a(I)), x({ r: String(I.r), g: String(I.g), b: String(I.b) }), E(X), R(X, Q, ue);
|
|
8190
|
+
}, z = (I, Q, ue) => {
|
|
8191
8191
|
const X = Ua(I), Pe = un(X.r, X.g, X.b);
|
|
8192
|
-
k(I), x({ r: String(X.r), g: String(X.g), b: String(X.b) }), E(Pe), R(Pe, Q,
|
|
8192
|
+
k(I), x({ r: String(X.r), g: String(X.g), b: String(X.b) }), E(Pe), R(Pe, Q, ue);
|
|
8193
8193
|
}, q = (I) => {
|
|
8194
8194
|
if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(I.key)) return;
|
|
8195
|
-
const
|
|
8195
|
+
const ue = [...I.currentTarget.querySelectorAll("button")], X = ue.findIndex((xe) => xe === document.activeElement);
|
|
8196
8196
|
if (X < 0) return;
|
|
8197
8197
|
I.preventDefault();
|
|
8198
|
-
const Pe = I.key === "ArrowLeft" ? -1 : I.key === "ArrowRight" ? 1 : I.key === "ArrowUp" ? -Fu : Fu, Ge =
|
|
8198
|
+
const Pe = I.key === "ArrowLeft" ? -1 : I.key === "ArrowRight" ? 1 : I.key === "ArrowUp" ? -Fu : Fu, Ge = ue[Math.max(0, Math.min(ue.length - 1, X + Pe))];
|
|
8199
8199
|
Ge == null || Ge.focus();
|
|
8200
8200
|
}, j = (I, Q) => {
|
|
8201
|
-
const
|
|
8202
|
-
if (!
|
|
8203
|
-
const X =
|
|
8201
|
+
const ue = H.current;
|
|
8202
|
+
if (!ue || o) return;
|
|
8203
|
+
const X = ue.getBoundingClientRect(), Pe = Math.max(0, Math.min(1, (I.clientX - X.left) / X.width)), Ge = Math.max(0, Math.min(1, 1 - (I.clientY - X.top) / X.height));
|
|
8204
8204
|
z({ h: A.h, s: Pe, v: Ge }, Q, Q);
|
|
8205
8205
|
}, ne = (I) => {
|
|
8206
8206
|
o || (I.currentTarget.setPointerCapture(I.pointerId), j(I, !1));
|
|
@@ -8239,7 +8239,7 @@ function gs({
|
|
|
8239
8239
|
"aria-selected": i ? void 0 : Q,
|
|
8240
8240
|
disabled: o,
|
|
8241
8241
|
style: { backgroundColor: I },
|
|
8242
|
-
onMouseDown: (
|
|
8242
|
+
onMouseDown: (ue) => ue.preventDefault(),
|
|
8243
8243
|
onClick: () => R(I, !0, !1)
|
|
8244
8244
|
},
|
|
8245
8245
|
I
|
|
@@ -8318,7 +8318,7 @@ function gs({
|
|
|
8318
8318
|
value: S[I],
|
|
8319
8319
|
disabled: o,
|
|
8320
8320
|
onChange: (Q) => {
|
|
8321
|
-
x((
|
|
8321
|
+
x((ue) => ({ ...ue, [I]: Q.target.value }));
|
|
8322
8322
|
},
|
|
8323
8323
|
onBlur: () => {
|
|
8324
8324
|
const Q = ov(S[I]);
|
|
@@ -8344,7 +8344,7 @@ function gs({
|
|
|
8344
8344
|
disabled: o,
|
|
8345
8345
|
onChange: (I) => E(I.target.value),
|
|
8346
8346
|
onBlur: () => {
|
|
8347
|
-
const I =
|
|
8347
|
+
const I = Te(L);
|
|
8348
8348
|
if (!I) {
|
|
8349
8349
|
E(ke);
|
|
8350
8350
|
return;
|
|
@@ -8759,7 +8759,7 @@ function nk({ commands: e, queries: t, disabled: n }) {
|
|
|
8759
8759
|
}
|
|
8760
8760
|
);
|
|
8761
8761
|
}
|
|
8762
|
-
const rk = "_wrap_58i0x_1", ok = "_wrapToolbar_58i0x_9", ik = "_field_58i0x_14", ak = "_input_58i0x_22", lk = "_toggle_58i0x_41", sk = "_chevron_58i0x_42", ck = "_unit_58i0x_80", uk = "_list_58i0x_110", dk = "_option_58i0x_125",
|
|
8762
|
+
const rk = "_wrap_58i0x_1", ok = "_wrapToolbar_58i0x_9", ik = "_field_58i0x_14", ak = "_input_58i0x_22", lk = "_toggle_58i0x_41", sk = "_chevron_58i0x_42", ck = "_unit_58i0x_80", uk = "_list_58i0x_110", dk = "_option_58i0x_125", Ne = {
|
|
8763
8763
|
wrap: rk,
|
|
8764
8764
|
wrapToolbar: ok,
|
|
8765
8765
|
field: ik,
|
|
@@ -8833,7 +8833,7 @@ function Lf({
|
|
|
8833
8833
|
"ul",
|
|
8834
8834
|
{
|
|
8835
8835
|
ref: C,
|
|
8836
|
-
className:
|
|
8836
|
+
className: Ne.list,
|
|
8837
8837
|
role: "listbox",
|
|
8838
8838
|
id: f,
|
|
8839
8839
|
style: { top: x.top, left: x.left, minWidth: x.width },
|
|
@@ -8841,7 +8841,7 @@ function Lf({
|
|
|
8841
8841
|
"button",
|
|
8842
8842
|
{
|
|
8843
8843
|
type: "button",
|
|
8844
|
-
className:
|
|
8844
|
+
className: Ne.option,
|
|
8845
8845
|
role: "option",
|
|
8846
8846
|
"aria-selected": e === R,
|
|
8847
8847
|
onMouseDown: (N) => N.preventDefault(),
|
|
@@ -8852,13 +8852,13 @@ function Lf({
|
|
|
8852
8852
|
}
|
|
8853
8853
|
) }, R))
|
|
8854
8854
|
}
|
|
8855
|
-
) }) : null, M = /* @__PURE__ */ b("div", { className: `${
|
|
8856
|
-
/* @__PURE__ */ b("div", { className:
|
|
8855
|
+
) }) : null, M = /* @__PURE__ */ b("div", { className: `${Ne.wrap}${c ? ` ${Ne.wrapToolbar}` : ""}`, ref: p, children: [
|
|
8856
|
+
/* @__PURE__ */ b("div", { className: Ne.field, ref: g, children: [
|
|
8857
8857
|
/* @__PURE__ */ a(
|
|
8858
8858
|
"input",
|
|
8859
8859
|
{
|
|
8860
8860
|
id: l,
|
|
8861
|
-
className:
|
|
8861
|
+
className: Ne.input,
|
|
8862
8862
|
value: y,
|
|
8863
8863
|
disabled: o,
|
|
8864
8864
|
"aria-label": d("commandFontSizeAria"),
|
|
@@ -8881,7 +8881,7 @@ function Lf({
|
|
|
8881
8881
|
"button",
|
|
8882
8882
|
{
|
|
8883
8883
|
type: "button",
|
|
8884
|
-
className:
|
|
8884
|
+
className: Ne.toggle,
|
|
8885
8885
|
tabIndex: -1,
|
|
8886
8886
|
disabled: o,
|
|
8887
8887
|
"aria-label": d("commandFontSizeAria"),
|
|
@@ -8892,11 +8892,11 @@ function Lf({
|
|
|
8892
8892
|
}
|
|
8893
8893
|
)
|
|
8894
8894
|
] }),
|
|
8895
|
-
/* @__PURE__ */ b("div", { className:
|
|
8895
|
+
/* @__PURE__ */ b("div", { className: Ne.field, children: [
|
|
8896
8896
|
/* @__PURE__ */ a(
|
|
8897
8897
|
"select",
|
|
8898
8898
|
{
|
|
8899
|
-
className:
|
|
8899
|
+
className: Ne.unit,
|
|
8900
8900
|
value: t,
|
|
8901
8901
|
disabled: o,
|
|
8902
8902
|
"aria-label": d("commandFontSizeUnitAria"),
|
|
@@ -8906,7 +8906,7 @@ function Lf({
|
|
|
8906
8906
|
children: Kl.map((R) => /* @__PURE__ */ a("option", { value: R, children: d(mk[R]) }, R))
|
|
8907
8907
|
}
|
|
8908
8908
|
),
|
|
8909
|
-
/* @__PURE__ */ a("span", { className:
|
|
8909
|
+
/* @__PURE__ */ a("span", { className: Ne.chevron, "aria-hidden": "true" })
|
|
8910
8910
|
] }),
|
|
8911
8911
|
H
|
|
8912
8912
|
] });
|
|
@@ -9532,7 +9532,7 @@ function ai({
|
|
|
9532
9532
|
"ul",
|
|
9533
9533
|
{
|
|
9534
9534
|
ref: p,
|
|
9535
|
-
className:
|
|
9535
|
+
className: Ne.list,
|
|
9536
9536
|
role: "listbox",
|
|
9537
9537
|
id: l,
|
|
9538
9538
|
style: { top: S.top, left: S.left, minWidth: S.width },
|
|
@@ -9540,7 +9540,7 @@ function ai({
|
|
|
9540
9540
|
"button",
|
|
9541
9541
|
{
|
|
9542
9542
|
type: "button",
|
|
9543
|
-
className:
|
|
9543
|
+
className: Ne.option,
|
|
9544
9544
|
role: "option",
|
|
9545
9545
|
"aria-selected": _ === M,
|
|
9546
9546
|
onMouseDown: (R) => R.preventDefault(),
|
|
@@ -9554,13 +9554,13 @@ function ai({
|
|
|
9554
9554
|
) }) : null;
|
|
9555
9555
|
return /* @__PURE__ */ b("div", { className: u.lengthField, children: [
|
|
9556
9556
|
/* @__PURE__ */ a("label", { className: u.sideLabel, htmlFor: c, children: e }),
|
|
9557
|
-
/* @__PURE__ */ b("div", { className: `${
|
|
9558
|
-
/* @__PURE__ */ b("div", { className:
|
|
9557
|
+
/* @__PURE__ */ b("div", { className: `${Ne.wrap} ${u.lengthRow}`, ref: d, children: [
|
|
9558
|
+
/* @__PURE__ */ b("div", { className: Ne.field, ref: f, children: [
|
|
9559
9559
|
/* @__PURE__ */ a(
|
|
9560
9560
|
"input",
|
|
9561
9561
|
{
|
|
9562
9562
|
id: c,
|
|
9563
|
-
className:
|
|
9563
|
+
className: Ne.input,
|
|
9564
9564
|
value: C,
|
|
9565
9565
|
disabled: r,
|
|
9566
9566
|
"aria-label": t,
|
|
@@ -9583,7 +9583,7 @@ function ai({
|
|
|
9583
9583
|
"button",
|
|
9584
9584
|
{
|
|
9585
9585
|
type: "button",
|
|
9586
|
-
className:
|
|
9586
|
+
className: Ne.toggle,
|
|
9587
9587
|
tabIndex: -1,
|
|
9588
9588
|
disabled: r,
|
|
9589
9589
|
"aria-label": t,
|
|
@@ -9594,11 +9594,11 @@ function ai({
|
|
|
9594
9594
|
}
|
|
9595
9595
|
)
|
|
9596
9596
|
] }),
|
|
9597
|
-
/* @__PURE__ */ b("div", { className:
|
|
9597
|
+
/* @__PURE__ */ b("div", { className: Ne.field, children: [
|
|
9598
9598
|
/* @__PURE__ */ a(
|
|
9599
9599
|
"select",
|
|
9600
9600
|
{
|
|
9601
|
-
className:
|
|
9601
|
+
className: Ne.unit,
|
|
9602
9602
|
value: g,
|
|
9603
9603
|
disabled: r,
|
|
9604
9604
|
"aria-label": i("imagePropertiesSizeUnitAria"),
|
|
@@ -9613,7 +9613,7 @@ function ai({
|
|
|
9613
9613
|
children: Qm.map((M) => /* @__PURE__ */ a("option", { value: M, children: i(pA[M]) }, M))
|
|
9614
9614
|
}
|
|
9615
9615
|
),
|
|
9616
|
-
/* @__PURE__ */ a("span", { className:
|
|
9616
|
+
/* @__PURE__ */ a("span", { className: Ne.chevron, "aria-hidden": "true" })
|
|
9617
9617
|
] }),
|
|
9618
9618
|
H
|
|
9619
9619
|
] })
|
|
@@ -9931,9 +9931,9 @@ function ys({
|
|
|
9931
9931
|
onChange: p
|
|
9932
9932
|
}) {
|
|
9933
9933
|
const g = Y(), C = r ? xA().filter((P) => r.includes(P.id)) : If, y = Z(), w = Z(), h = Z(), A = Z(), [k, S] = T(
|
|
9934
|
-
() =>
|
|
9934
|
+
() => zt(t.margin, gr(t.margin.top))
|
|
9935
9935
|
), [x, L] = T(
|
|
9936
|
-
() =>
|
|
9936
|
+
() => zt(t.padding, gr(t.padding.top))
|
|
9937
9937
|
), E = (P, _, H, M) => {
|
|
9938
9938
|
const R = t[P], N = _ ? gr(M) : { ...R, [H]: M };
|
|
9939
9939
|
p({
|
|
@@ -10919,9 +10919,9 @@ function UA({
|
|
|
10919
10919
|
return;
|
|
10920
10920
|
}
|
|
10921
10921
|
if (Q.key !== "Tab" || !ae) return;
|
|
10922
|
-
const
|
|
10923
|
-
if (
|
|
10924
|
-
const X =
|
|
10922
|
+
const ue = [...ae.querySelectorAll(ju)];
|
|
10923
|
+
if (ue.length === 0) return;
|
|
10924
|
+
const X = ue[0], Pe = ue[ue.length - 1];
|
|
10925
10925
|
Q.shiftKey && document.activeElement === X ? (Q.preventDefault(), Pe.focus()) : !Q.shiftKey && document.activeElement === Pe && (Q.preventDefault(), X.focus());
|
|
10926
10926
|
};
|
|
10927
10927
|
return document.addEventListener("keydown", I, !0), () => document.removeEventListener("keydown", I, !0);
|
|
@@ -11179,7 +11179,7 @@ function jA({
|
|
|
11179
11179
|
onApply: r,
|
|
11180
11180
|
onClose: o
|
|
11181
11181
|
}) {
|
|
11182
|
-
const i = Y(), l = Z(), c = Z(), d = Z(), f = D(null), [p, g] = T(""), [C, y] = T(!1), w =
|
|
11182
|
+
const i = Y(), l = Z(), c = Z(), d = Z(), f = D(null), [p, g] = T(""), [C, y] = T(!1), w = Ee(() => new Set(t), [t]), h = gf(p, w);
|
|
11183
11183
|
if (G(() => {
|
|
11184
11184
|
e && (g(""), y(!1));
|
|
11185
11185
|
}, [e]), G(() => {
|
|
@@ -11299,8 +11299,8 @@ function YA({
|
|
|
11299
11299
|
if (de.key !== "Tab" || !te) return;
|
|
11300
11300
|
const I = [...te.querySelectorAll(Yu)];
|
|
11301
11301
|
if (I.length === 0) return;
|
|
11302
|
-
const Q = I[0],
|
|
11303
|
-
de.shiftKey && document.activeElement === Q ? (de.preventDefault(),
|
|
11302
|
+
const Q = I[0], ue = I[I.length - 1];
|
|
11303
|
+
de.shiftKey && document.activeElement === Q ? (de.preventDefault(), ue.focus()) : !de.shiftKey && document.activeElement === ue && (de.preventDefault(), Q.focus());
|
|
11304
11304
|
};
|
|
11305
11305
|
return document.addEventListener("keydown", ae, !0), () => document.removeEventListener("keydown", ae, !0);
|
|
11306
11306
|
}, [e, i]), !e) return null;
|
|
@@ -11652,7 +11652,7 @@ function cS({
|
|
|
11652
11652
|
onChange: i
|
|
11653
11653
|
}) {
|
|
11654
11654
|
const l = Y(), c = Z(), d = Z(), f = Z(), [p, g] = T(
|
|
11655
|
-
() =>
|
|
11655
|
+
() => zt(t.margin, ja(t.margin.top))
|
|
11656
11656
|
), C = t.align === "center", y = (h, A) => {
|
|
11657
11657
|
if (t.sizeMode === "lock" && A) {
|
|
11658
11658
|
const k = wr(h, A, n);
|
|
@@ -12195,17 +12195,17 @@ function yS({
|
|
|
12195
12195
|
if (!e) return;
|
|
12196
12196
|
const X = E.current, Pe = X == null ? void 0 : X.querySelector(Qu);
|
|
12197
12197
|
Pe == null || Pe.focus();
|
|
12198
|
-
const Ge = (
|
|
12199
|
-
if (
|
|
12198
|
+
const Ge = (xe) => {
|
|
12199
|
+
if (xe.key === "Escape") {
|
|
12200
12200
|
if (document.querySelector('[role="listbox"], [data-color-picker]')) return;
|
|
12201
|
-
|
|
12201
|
+
xe.preventDefault(), xe.stopPropagation(), w();
|
|
12202
12202
|
return;
|
|
12203
12203
|
}
|
|
12204
|
-
if (
|
|
12204
|
+
if (xe.key !== "Tab" || !X) return;
|
|
12205
12205
|
const on = [...X.querySelectorAll(Qu)];
|
|
12206
12206
|
if (on.length === 0) return;
|
|
12207
12207
|
const Lr = on[0], Zn = on[on.length - 1];
|
|
12208
|
-
|
|
12208
|
+
xe.shiftKey && document.activeElement === Lr ? (xe.preventDefault(), Zn.focus()) : !xe.shiftKey && document.activeElement === Zn && (xe.preventDefault(), Lr.focus());
|
|
12209
12209
|
};
|
|
12210
12210
|
return document.addEventListener("keydown", Ge, !0), () => document.removeEventListener("keydown", Ge, !0);
|
|
12211
12211
|
}, [e, w, t, j]), !e) return null;
|
|
@@ -12219,7 +12219,7 @@ function yS({
|
|
|
12219
12219
|
}), Q = () => {
|
|
12220
12220
|
const X = P.trim();
|
|
12221
12221
|
!X || g || y({ ...I(), href: X });
|
|
12222
|
-
},
|
|
12222
|
+
}, ue = () => {
|
|
12223
12223
|
!ae || g || y({ ...I(), href: `#${ae}` });
|
|
12224
12224
|
};
|
|
12225
12225
|
return /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a("div", { className: u.backdrop, role: "presentation", onMouseDown: w, children: /* @__PURE__ */ b(
|
|
@@ -12384,7 +12384,7 @@ function yS({
|
|
|
12384
12384
|
type: "button",
|
|
12385
12385
|
className: u.action,
|
|
12386
12386
|
disabled: g || !ae,
|
|
12387
|
-
onClick:
|
|
12387
|
+
onClick: ue,
|
|
12388
12388
|
children: h("linkDialogSelect")
|
|
12389
12389
|
}
|
|
12390
12390
|
),
|
|
@@ -12979,10 +12979,10 @@ function qa(e) {
|
|
|
12979
12979
|
}
|
|
12980
12980
|
function FS({ value: e, disabled: t, onChange: n }) {
|
|
12981
12981
|
const r = Y(), o = Z(), i = Z(), l = Z(), [c, d] = T(
|
|
12982
|
-
() =>
|
|
12982
|
+
() => zt(e.padding, Io(qa(e.padding)))
|
|
12983
12983
|
);
|
|
12984
12984
|
return G(() => {
|
|
12985
|
-
d(
|
|
12985
|
+
d(zt(e.padding, Io(qa(e.padding))));
|
|
12986
12986
|
}, [e.padding]), /* @__PURE__ */ b("div", { className: u.body, children: [
|
|
12987
12987
|
/* @__PURE__ */ a(
|
|
12988
12988
|
ut,
|
|
@@ -13223,10 +13223,10 @@ function Ya(e) {
|
|
|
13223
13223
|
}
|
|
13224
13224
|
function OS({ value: e, disabled: t, onChange: n }) {
|
|
13225
13225
|
const r = Y(), o = Z(), [i, l] = T(
|
|
13226
|
-
() =>
|
|
13226
|
+
() => zt(e.padding, Fo(Ya(e.padding)))
|
|
13227
13227
|
);
|
|
13228
13228
|
return G(() => {
|
|
13229
|
-
l(
|
|
13229
|
+
l(zt(e.padding, Fo(Ya(e.padding))));
|
|
13230
13230
|
}, [e.padding]), /* @__PURE__ */ b("div", { className: u.body, children: [
|
|
13231
13231
|
/* @__PURE__ */ a(
|
|
13232
13232
|
ut,
|
|
@@ -13382,7 +13382,7 @@ function KS({
|
|
|
13382
13382
|
}
|
|
13383
13383
|
) }) }) : null;
|
|
13384
13384
|
}
|
|
13385
|
-
const $S = "_backdrop_9d3gw_1", US = "_dialog_9d3gw_12", WS = "_headerRow_9d3gw_29", GS = "_header_9d3gw_29", VS = "_close_9d3gw_44", jS = "_body_9d3gw_66", ZS = "_frame_9d3gw_75", qS = "_actions_9d3gw_83", YS = "_action_9d3gw_83",
|
|
13385
|
+
const $S = "_backdrop_9d3gw_1", US = "_dialog_9d3gw_12", WS = "_headerRow_9d3gw_29", GS = "_header_9d3gw_29", VS = "_close_9d3gw_44", jS = "_body_9d3gw_66", ZS = "_frame_9d3gw_75", qS = "_actions_9d3gw_83", YS = "_action_9d3gw_83", It = {
|
|
13386
13386
|
backdrop: $S,
|
|
13387
13387
|
dialog: US,
|
|
13388
13388
|
headerRow: WS,
|
|
@@ -13416,34 +13416,34 @@ function XS({ open: e, html: t, onClose: n }) {
|
|
|
13416
13416
|
if (!e) return;
|
|
13417
13417
|
const c = (d = l.current) == null ? void 0 : d.contentDocument;
|
|
13418
13418
|
c && il(c, t, r("previewDialogTitle"));
|
|
13419
|
-
}, [e, t, r]), e ? /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a("div", { className:
|
|
13419
|
+
}, [e, t, r]), e ? /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a("div", { className: It.backdrop, role: "presentation", onMouseDown: n, children: /* @__PURE__ */ b(
|
|
13420
13420
|
"div",
|
|
13421
13421
|
{
|
|
13422
13422
|
ref: i,
|
|
13423
|
-
className:
|
|
13423
|
+
className: It.dialog,
|
|
13424
13424
|
role: "dialog",
|
|
13425
13425
|
"aria-modal": "true",
|
|
13426
13426
|
"aria-labelledby": o,
|
|
13427
13427
|
onMouseDown: (c) => c.stopPropagation(),
|
|
13428
13428
|
children: [
|
|
13429
|
-
/* @__PURE__ */ b("div", { className:
|
|
13430
|
-
/* @__PURE__ */ a("h2", { className:
|
|
13429
|
+
/* @__PURE__ */ b("div", { className: It.headerRow, children: [
|
|
13430
|
+
/* @__PURE__ */ a("h2", { className: It.header, id: o, children: r("previewDialogTitle") }),
|
|
13431
13431
|
/* @__PURE__ */ a(
|
|
13432
13432
|
"button",
|
|
13433
13433
|
{
|
|
13434
13434
|
type: "button",
|
|
13435
|
-
className:
|
|
13435
|
+
className: It.close,
|
|
13436
13436
|
"aria-label": r("previewDialogCloseAria"),
|
|
13437
13437
|
onClick: n,
|
|
13438
13438
|
children: /* @__PURE__ */ a(We, {})
|
|
13439
13439
|
}
|
|
13440
13440
|
)
|
|
13441
13441
|
] }),
|
|
13442
|
-
/* @__PURE__ */ a("div", { className:
|
|
13442
|
+
/* @__PURE__ */ a("div", { className: It.body, children: /* @__PURE__ */ a(
|
|
13443
13443
|
"iframe",
|
|
13444
13444
|
{
|
|
13445
13445
|
ref: l,
|
|
13446
|
-
className:
|
|
13446
|
+
className: It.frame,
|
|
13447
13447
|
title: r("previewDialogTitle"),
|
|
13448
13448
|
sandbox: "allow-same-origin",
|
|
13449
13449
|
tabIndex: -1,
|
|
@@ -13454,7 +13454,7 @@ function XS({ open: e, html: t, onClose: n }) {
|
|
|
13454
13454
|
}
|
|
13455
13455
|
}
|
|
13456
13456
|
) }),
|
|
13457
|
-
/* @__PURE__ */ a("div", { className:
|
|
13457
|
+
/* @__PURE__ */ a("div", { className: It.actions, children: /* @__PURE__ */ a("button", { type: "button", className: It.action, onClick: n, children: r("previewDialogClose") }) })
|
|
13458
13458
|
]
|
|
13459
13459
|
}
|
|
13460
13460
|
) }) }) : null;
|
|
@@ -13550,7 +13550,7 @@ function vP({
|
|
|
13550
13550
|
var h;
|
|
13551
13551
|
(h = p.current) == null || h.focus();
|
|
13552
13552
|
}, [e == null ? void 0 : e.id]);
|
|
13553
|
-
const g = !n && r && d.trim().length > 0, C =
|
|
13553
|
+
const g = !n && r && d.trim().length > 0, C = Ee(() => (e == null ? void 0 : e.messages) ?? [], [e == null ? void 0 : e.messages]), y = C.length === 0 ? c("commentPlaceholder") : c("commentReplyPlaceholder");
|
|
13554
13554
|
if (!e) return null;
|
|
13555
13555
|
const w = () => {
|
|
13556
13556
|
const h = d.trim();
|
|
@@ -13737,10 +13737,10 @@ function en(e, t) {
|
|
|
13737
13737
|
function li(e, t) {
|
|
13738
13738
|
return t ? t.ariaLabel ? t.ariaLabel : t.ariaKey ? e(t.ariaKey) : en(e, t) : "";
|
|
13739
13739
|
}
|
|
13740
|
-
const
|
|
13740
|
+
const At = "fullscreen", Tl = "commspliant-html-editor.toolbarCustomization";
|
|
13741
13741
|
function xl(e) {
|
|
13742
|
-
const t = e.filter((n) => n !==
|
|
13743
|
-
return e.includes(
|
|
13742
|
+
const t = e.filter((n) => n !== At);
|
|
13743
|
+
return e.includes(At) ? [...t, At] : t;
|
|
13744
13744
|
}
|
|
13745
13745
|
function ws(e, t) {
|
|
13746
13746
|
if (!t || t.length === 0) return xl(e);
|
|
@@ -13811,7 +13811,7 @@ function NP(e, t, n, r) {
|
|
|
13811
13811
|
}
|
|
13812
13812
|
function Uf(e, t, n, r) {
|
|
13813
13813
|
const o = Cs(e, t), i = [...(e == null ? void 0 : e.hiddenItemIds) ?? []];
|
|
13814
|
-
if (n ===
|
|
13814
|
+
if (n === At || r === At)
|
|
13815
13815
|
return { groupOrder: o, hiddenItemIds: i };
|
|
13816
13816
|
const l = o.indexOf(n), c = o.indexOf(r);
|
|
13817
13817
|
if (l < 0 || c < 0 || l === c)
|
|
@@ -13823,7 +13823,7 @@ function Uf(e, t, n, r) {
|
|
|
13823
13823
|
};
|
|
13824
13824
|
}
|
|
13825
13825
|
function ud(e, t, n, r) {
|
|
13826
|
-
const o = Cs(e, t), i = o.filter((d) => d !==
|
|
13826
|
+
const o = Cs(e, t), i = o.filter((d) => d !== At), l = i.indexOf(n), c = l + r;
|
|
13827
13827
|
return l < 0 || c < 0 || c >= i.length ? { groupOrder: o, hiddenItemIds: [...(e == null ? void 0 : e.hiddenItemIds) ?? []] } : Uf(e, t, n, i[c]);
|
|
13828
13828
|
}
|
|
13829
13829
|
const MP = "_backdrop_11w4e_1", RP = "_dialog_11w4e_12", _P = "_header_11w4e_31", LP = "_body_11w4e_39", IP = "_group_11w4e_49", FP = "_groupDragging_11w4e_55", BP = "_groupDropTarget_11w4e_59", HP = "_groupHeader_11w4e_64", zP = "_groupTitle_11w4e_72", OP = "_dragHandle_11w4e_77", KP = "_moveButton_11w4e_78", $P = "_items_11w4e_119", UP = "_item_11w4e_119", WP = "_itemIcon_11w4e_135", GP = "_itemTitle_11w4e_144", VP = "_itemCheckbox_11w4e_151", jP = "_actions_11w4e_155", ZP = "_action_11w4e_155", qP = "_spinnerWrap_11w4e_191", YP = "_spinner_11w4e_191", ye = {
|
|
@@ -13893,14 +13893,14 @@ function JP({
|
|
|
13893
13893
|
};
|
|
13894
13894
|
return document.addEventListener("keydown", q, !0), () => document.removeEventListener("keydown", q, !0);
|
|
13895
13895
|
}, [e, f]), !e) return null;
|
|
13896
|
-
const P = L.map((N) => N.id).filter((N) => N !==
|
|
13897
|
-
if (E || z ===
|
|
13896
|
+
const P = L.map((N) => N.id).filter((N) => N !== At), _ = (N, z) => {
|
|
13897
|
+
if (E || z === At) {
|
|
13898
13898
|
N.preventDefault();
|
|
13899
13899
|
return;
|
|
13900
13900
|
}
|
|
13901
13901
|
N.dataTransfer.setData("text/plain", z), N.dataTransfer.effectAllowed = "move", w(z);
|
|
13902
13902
|
}, H = (N, z) => {
|
|
13903
|
-
E || z ===
|
|
13903
|
+
E || z === At || !y || y === z || (N.preventDefault(), N.dataTransfer && (N.dataTransfer.dropEffect = "move"), A(z));
|
|
13904
13904
|
}, M = (N, z) => {
|
|
13905
13905
|
var j;
|
|
13906
13906
|
N.preventDefault();
|
|
@@ -13931,7 +13931,7 @@ function JP({
|
|
|
13931
13931
|
children: /* @__PURE__ */ a("span", { className: ye.spinner, "aria-hidden": "true" })
|
|
13932
13932
|
}
|
|
13933
13933
|
) : L.map((N) => {
|
|
13934
|
-
const z = t.groups[N.id], q = z ? en(p, z) : N.id, j = N.id ===
|
|
13934
|
+
const z = t.groups[N.id], q = z ? en(p, z) : N.id, j = N.id === At, ne = P.indexOf(N.id);
|
|
13935
13935
|
return /* @__PURE__ */ b(
|
|
13936
13936
|
"section",
|
|
13937
13937
|
{
|
|
@@ -14246,7 +14246,7 @@ function oD({
|
|
|
14246
14246
|
}
|
|
14247
14247
|
);
|
|
14248
14248
|
}
|
|
14249
|
-
const iD = "_wrap_1gtdc_1", aD = "_wrapToolbar_1gtdc_7", lD = "_field_1gtdc_12", sD = "_trigger_1gtdc_20", cD = "_chevron_1gtdc_46", uD = "_list_1gtdc_69", dD = "_option_1gtdc_84", mD = "_separator_1gtdc_113",
|
|
14249
|
+
const iD = "_wrap_1gtdc_1", aD = "_wrapToolbar_1gtdc_7", lD = "_field_1gtdc_12", sD = "_trigger_1gtdc_20", cD = "_chevron_1gtdc_46", uD = "_list_1gtdc_69", dD = "_option_1gtdc_84", mD = "_separator_1gtdc_113", Bt = {
|
|
14250
14250
|
wrap: iD,
|
|
14251
14251
|
wrapToolbar: aD,
|
|
14252
14252
|
field: lD,
|
|
@@ -14345,7 +14345,7 @@ function Gf({
|
|
|
14345
14345
|
"ul",
|
|
14346
14346
|
{
|
|
14347
14347
|
ref: i,
|
|
14348
|
-
className:
|
|
14348
|
+
className: Bt.list,
|
|
14349
14349
|
role: "listbox",
|
|
14350
14350
|
id: o,
|
|
14351
14351
|
style: l,
|
|
@@ -14356,7 +14356,7 @@ function Gf({
|
|
|
14356
14356
|
"button",
|
|
14357
14357
|
{
|
|
14358
14358
|
type: "button",
|
|
14359
|
-
className:
|
|
14359
|
+
className: Bt.option,
|
|
14360
14360
|
role: "option",
|
|
14361
14361
|
"aria-selected": w === k,
|
|
14362
14362
|
disabled: n,
|
|
@@ -14366,13 +14366,13 @@ function Gf({
|
|
|
14366
14366
|
children: y(El[k])
|
|
14367
14367
|
}
|
|
14368
14368
|
) }, k)),
|
|
14369
|
-
h && (f || d.length > 0) ? /* @__PURE__ */ a("li", { role: "separator", className:
|
|
14369
|
+
h && (f || d.length > 0) ? /* @__PURE__ */ a("li", { role: "separator", className: Bt.separator }) : null,
|
|
14370
14370
|
h && f ? /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ a(md, {}) }) : null,
|
|
14371
14371
|
h && !f ? d.map((k) => /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ a(
|
|
14372
14372
|
"button",
|
|
14373
14373
|
{
|
|
14374
14374
|
type: "button",
|
|
14375
|
-
className:
|
|
14375
|
+
className: Bt.option,
|
|
14376
14376
|
role: "option",
|
|
14377
14377
|
"aria-selected": !1,
|
|
14378
14378
|
disabled: n,
|
|
@@ -14419,13 +14419,13 @@ function pD({ commands: e, queries: t, disabled: n }) {
|
|
|
14419
14419
|
document.removeEventListener("pointerdown", E), document.removeEventListener("keydown", P, !0);
|
|
14420
14420
|
};
|
|
14421
14421
|
}, [d]);
|
|
14422
|
-
const L = /* @__PURE__ */ b("div", { className: `${
|
|
14423
|
-
/* @__PURE__ */ b("div", { className:
|
|
14422
|
+
const L = /* @__PURE__ */ b("div", { className: `${Bt.wrap} ${Bt.wrapToolbar}`, ref: i, children: [
|
|
14423
|
+
/* @__PURE__ */ b("div", { className: Bt.field, ref: l, children: [
|
|
14424
14424
|
/* @__PURE__ */ a(
|
|
14425
14425
|
"button",
|
|
14426
14426
|
{
|
|
14427
14427
|
type: "button",
|
|
14428
|
-
className:
|
|
14428
|
+
className: Bt.trigger,
|
|
14429
14429
|
disabled: C,
|
|
14430
14430
|
"aria-label": r("commandParagraphStyleAria"),
|
|
14431
14431
|
"aria-haspopup": "listbox",
|
|
@@ -14436,7 +14436,7 @@ function pD({ commands: e, queries: t, disabled: n }) {
|
|
|
14436
14436
|
children: h
|
|
14437
14437
|
}
|
|
14438
14438
|
),
|
|
14439
|
-
/* @__PURE__ */ a("span", { className:
|
|
14439
|
+
/* @__PURE__ */ a("span", { className: Bt.chevron, "aria-hidden": "true" })
|
|
14440
14440
|
] }),
|
|
14441
14441
|
d ? /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a(
|
|
14442
14442
|
Gf,
|
|
@@ -15990,7 +15990,7 @@ const BD = "_root_3hjd3_1", HD = "_fullscreen_3hjd3_36", zD = "_exitFullscreen_3
|
|
|
15990
15990
|
}
|
|
15991
15991
|
}));
|
|
15992
15992
|
const k = K((x, L) => {
|
|
15993
|
-
const E = Hn(
|
|
15993
|
+
const E = Hn(De(L).body);
|
|
15994
15994
|
x.innerHTML !== E && (x.innerHTML = E), mi(x), _r(x, L);
|
|
15995
15995
|
}, []);
|
|
15996
15996
|
He(() => {
|
|
@@ -16079,11 +16079,11 @@ function mT({
|
|
|
16079
16079
|
disableBuiltinVideoInsert: de,
|
|
16080
16080
|
disableHtmlFileDrop: I = !1,
|
|
16081
16081
|
toolbarCustomization: Q,
|
|
16082
|
-
darkMode:
|
|
16082
|
+
darkMode: ue = !1,
|
|
16083
16083
|
darkModePersistence: X,
|
|
16084
16084
|
toolbarPosition: Pe = "top",
|
|
16085
16085
|
toolbarPositionPersistence: Ge,
|
|
16086
|
-
enableMultiPages:
|
|
16086
|
+
enableMultiPages: xe = !1,
|
|
16087
16087
|
pages: on,
|
|
16088
16088
|
defaultPages: Lr,
|
|
16089
16089
|
onPagesChange: Zn,
|
|
@@ -16096,24 +16096,24 @@ function mT({
|
|
|
16096
16096
|
}) {
|
|
16097
16097
|
const le = !!(y || w), qn = !!y, Jf = Qc(
|
|
16098
16098
|
Lr ?? (t.trim() ? [t] : [tl()])
|
|
16099
|
-
), Qf =
|
|
16099
|
+
), Qf = xe ? Ft(Jf) : t, ep = xe && on !== void 0 ? Ft(Qc(on)) : e, [_e, vs] = Eo({
|
|
16100
16100
|
value: ep,
|
|
16101
16101
|
defaultValue: Qf,
|
|
16102
|
-
onChange:
|
|
16102
|
+
onChange: xe ? void 0 : n
|
|
16103
16103
|
}), [Ae, ks] = Eo({
|
|
16104
16104
|
value: l,
|
|
16105
16105
|
defaultValue: c,
|
|
16106
16106
|
onChange: d
|
|
16107
|
-
}), [
|
|
16107
|
+
}), [Et, Yn] = Eo({
|
|
16108
16108
|
value: f,
|
|
16109
16109
|
defaultValue: p,
|
|
16110
16110
|
onChange: g
|
|
16111
|
-
}), [yt, tp] = T(Zf), [wt,
|
|
16111
|
+
}), [yt, tp] = T(Zf), [wt, Nt] = T(null), [yn, Xn] = Eo({
|
|
16112
16112
|
value: qf,
|
|
16113
16113
|
defaultValue: Yf,
|
|
16114
16114
|
onChange: Xf
|
|
16115
|
-
}), B = D(null), Ai = D(null), As = D(null), Fr = D(null), Xe = D(null), $e = D(
|
|
16116
|
-
$e.current =
|
|
16115
|
+
}), B = D(null), Ai = D(null), As = D(null), Fr = D(null), Xe = D(null), $e = D(xe);
|
|
16116
|
+
$e.current = xe;
|
|
16117
16117
|
const an = D(Ve);
|
|
16118
16118
|
an.current = Ve;
|
|
16119
16119
|
const Ss = D(w);
|
|
@@ -16126,30 +16126,30 @@ function mT({
|
|
|
16126
16126
|
Hr.current = yn;
|
|
16127
16127
|
const zr = D(Zn);
|
|
16128
16128
|
zr.current = Zn;
|
|
16129
|
-
const [wn, Ds] = T(0),
|
|
16130
|
-
|
|
16129
|
+
const [wn, Ds] = T(0), Kt = D(wn);
|
|
16130
|
+
Kt.current = wn;
|
|
16131
16131
|
const Si = D(null);
|
|
16132
16132
|
Si.current === null && (Si.current = PP(_e));
|
|
16133
|
-
const ot = Si.current,
|
|
16134
|
-
|
|
16133
|
+
const ot = Si.current, se = D(_e);
|
|
16134
|
+
se.current = _e;
|
|
16135
16135
|
const Or = D(!0), Pi = D(""), Cn = D(null), $ = D(Ae);
|
|
16136
16136
|
$.current = Ae;
|
|
16137
|
-
const Ts = D(
|
|
16138
|
-
Ts.current =
|
|
16139
|
-
const
|
|
16137
|
+
const Ts = D(Et);
|
|
16138
|
+
Ts.current = Et;
|
|
16139
|
+
const Me = D(null), [, np] = T(0), Jn = D(null);
|
|
16140
16140
|
Jn.current === null && (Jn.current = bC(() => {
|
|
16141
16141
|
np((s) => s + 1);
|
|
16142
16142
|
}));
|
|
16143
16143
|
const Kr = D(z);
|
|
16144
16144
|
Kr.current = z;
|
|
16145
|
-
const it = D({}), Je = D(null), at = D(null), dt = D(null), mt = D(null),
|
|
16145
|
+
const it = D({}), Je = D(null), at = D(null), dt = D(null), mt = D(null), $t = D(null), Qe = D(null), [$r, Di] = T(Ht), Ti = D($r);
|
|
16146
16146
|
Ti.current = $r;
|
|
16147
|
-
const
|
|
16147
|
+
const Mt = D(mn), [Qn, Ur] = T({
|
|
16148
16148
|
value: null,
|
|
16149
16149
|
unit: mn,
|
|
16150
16150
|
mixed: !1
|
|
16151
|
-
}),
|
|
16152
|
-
|
|
16151
|
+
}), Ut = D(Qn);
|
|
16152
|
+
Ut.current = Qn;
|
|
16153
16153
|
const [er, xi] = T({
|
|
16154
16154
|
value: null,
|
|
16155
16155
|
mixed: !1
|
|
@@ -16188,7 +16188,7 @@ function mT({
|
|
|
16188
16188
|
const [lr, jr] = T({
|
|
16189
16189
|
open: !1,
|
|
16190
16190
|
tab: "general"
|
|
16191
|
-
}), [$i, Fs] = T(!1), [sr, Bs] = T({ open: !1, html: "" }), [Ui, Zr] = T(null), [rp, Wi] = T(!1), [op, Gi] = T(!1), [vn, qr] = T(() => X ?
|
|
16191
|
+
}), [$i, Fs] = T(!1), [sr, Bs] = T({ open: !1, html: "" }), [Ui, Zr] = T(null), [rp, Wi] = T(!1), [op, Gi] = T(!1), [vn, qr] = T(() => X ? ue : ld() ?? ue), [ft, Yr] = T(() => Ge ? Pe : sd() ?? Pe), [Xr, ip] = T(
|
|
16192
16192
|
() => nP() ?? "fitWidth"
|
|
16193
16193
|
), [Vi, ap] = T(1), [ln, Jr] = T({
|
|
16194
16194
|
open: !1,
|
|
@@ -16278,16 +16278,16 @@ function mT({
|
|
|
16278
16278
|
lc.current = ke;
|
|
16279
16279
|
const sc = D(de);
|
|
16280
16280
|
sc.current = de;
|
|
16281
|
-
const ma = D(0), dr = D(0), cc = D(0), uo = D(0), uc = D(0), mo = D(0), dc = D(0),
|
|
16282
|
-
Sn.current =
|
|
16283
|
-
const fa =
|
|
16284
|
-
() => ih(_e,
|
|
16281
|
+
const ma = D(0), dr = D(0), cc = D(0), uo = D(0), uc = D(0), mo = D(0), dc = D(0), Wt = Ee(() => Fd(N), [N]), Sn = D(Wt);
|
|
16282
|
+
Sn.current = Wt;
|
|
16283
|
+
const fa = Ee(
|
|
16284
|
+
() => ih(_e, Wt).join(`
|
|
16285
16285
|
`),
|
|
16286
|
-
[_e,
|
|
16287
|
-
), fo =
|
|
16288
|
-
() => tt(_e).map((s) =>
|
|
16286
|
+
[_e, Wt]
|
|
16287
|
+
), fo = Ee(
|
|
16288
|
+
() => tt(_e).map((s) => De(s).body),
|
|
16289
16289
|
[_e]
|
|
16290
|
-
), mc =
|
|
16290
|
+
), mc = Ee(() => xe ? fo[wn] ?? "" : De(_e).body, [xe, fo, wn, _e]), fc = Ee(
|
|
16291
16291
|
() => m1(gn(mc)),
|
|
16292
16292
|
[mc]
|
|
16293
16293
|
);
|
|
@@ -16380,7 +16380,7 @@ function mT({
|
|
|
16380
16380
|
G(() => {
|
|
16381
16381
|
const s = X;
|
|
16382
16382
|
if (!(s != null && s.load) || !s.save) {
|
|
16383
|
-
qr(ld() ??
|
|
16383
|
+
qr(ld() ?? ue);
|
|
16384
16384
|
return;
|
|
16385
16385
|
}
|
|
16386
16386
|
const m = ++uo.current;
|
|
@@ -16388,15 +16388,15 @@ function mT({
|
|
|
16388
16388
|
try {
|
|
16389
16389
|
const v = await s.load();
|
|
16390
16390
|
if (m !== uo.current) return;
|
|
16391
|
-
qr(typeof v == "boolean" ? v :
|
|
16391
|
+
qr(typeof v == "boolean" ? v : ue);
|
|
16392
16392
|
} catch {
|
|
16393
16393
|
if (m !== uo.current) return;
|
|
16394
|
-
qr(
|
|
16394
|
+
qr(ue);
|
|
16395
16395
|
}
|
|
16396
16396
|
})(), () => {
|
|
16397
16397
|
uo.current += 1;
|
|
16398
16398
|
};
|
|
16399
|
-
}, [X,
|
|
16399
|
+
}, [X, ue]), He(() => {
|
|
16400
16400
|
if (Ae !== "visual") return;
|
|
16401
16401
|
const s = As.current;
|
|
16402
16402
|
if (!s) return;
|
|
@@ -16451,10 +16451,10 @@ function mT({
|
|
|
16451
16451
|
(s) => {
|
|
16452
16452
|
var v, F;
|
|
16453
16453
|
const m = ((v = Kr.current) == null ? void 0 : v.call(Kr, s)) ?? s;
|
|
16454
|
-
return m !==
|
|
16454
|
+
return m !== se.current && (Or.current = !0), vs(m), $e.current && ((F = zr.current) == null || F.call(
|
|
16455
16455
|
zr,
|
|
16456
16456
|
tt(m),
|
|
16457
|
-
|
|
16457
|
+
Kt.current
|
|
16458
16458
|
)), m;
|
|
16459
16459
|
},
|
|
16460
16460
|
[vs]
|
|
@@ -16467,8 +16467,8 @@ function mT({
|
|
|
16467
16467
|
), dp = K(
|
|
16468
16468
|
(s) => {
|
|
16469
16469
|
if ($e.current) {
|
|
16470
|
-
const m = tt(
|
|
16471
|
-
F[v] = s, be(
|
|
16470
|
+
const m = tt(se.current), v = Kt.current, F = [...m];
|
|
16471
|
+
F[v] = s, be(Ft(F), !1);
|
|
16472
16472
|
return;
|
|
16473
16473
|
}
|
|
16474
16474
|
be(s, !1);
|
|
@@ -16477,73 +16477,73 @@ function mT({
|
|
|
16477
16477
|
), mr = kP({
|
|
16478
16478
|
enabled: !le && !I,
|
|
16479
16479
|
onHtml: dp
|
|
16480
|
-
}),
|
|
16480
|
+
}), ce = K(
|
|
16481
16481
|
(s, m) => be(
|
|
16482
16482
|
Po(
|
|
16483
16483
|
s,
|
|
16484
|
-
Do(s,
|
|
16484
|
+
Do(s, se.current, Sn.current)
|
|
16485
16485
|
),
|
|
16486
16486
|
m
|
|
16487
16487
|
),
|
|
16488
16488
|
[be]
|
|
16489
16489
|
), mp = K(
|
|
16490
|
-
(s, m) =>
|
|
16491
|
-
[
|
|
16490
|
+
(s, m) => ce(kt(s, se.current), m),
|
|
16491
|
+
[ce]
|
|
16492
16492
|
), go = K((s, m) => Po(
|
|
16493
16493
|
s,
|
|
16494
16494
|
Do(s, m, Sn.current)
|
|
16495
|
-
), []),
|
|
16495
|
+
), []), Rt = K(() => {
|
|
16496
16496
|
const s = Fr.current;
|
|
16497
|
-
return (s == null ? void 0 : s.getContainer()) ? tt(
|
|
16497
|
+
return (s == null ? void 0 : s.getContainer()) ? tt(se.current).map((F, W) => {
|
|
16498
16498
|
const J = s == null ? void 0 : s.flushPageHtml(W);
|
|
16499
16499
|
if (J === null) return F;
|
|
16500
|
-
const Fe =
|
|
16500
|
+
const Fe = kt(J, De(F).body);
|
|
16501
16501
|
return go(Fe, F);
|
|
16502
|
-
}) : tt(
|
|
16502
|
+
}) : tt(se.current);
|
|
16503
16503
|
}, [go]), pa = K(
|
|
16504
16504
|
(s, m, v) => {
|
|
16505
|
-
const F = tt(
|
|
16506
|
-
W[s] = go(m, F[s] ?? ""), be(
|
|
16505
|
+
const F = tt(se.current), W = [...F];
|
|
16506
|
+
W[s] = go(m, F[s] ?? ""), be(Ft(W), v);
|
|
16507
16507
|
},
|
|
16508
16508
|
[be, go]
|
|
16509
16509
|
), ie = K(
|
|
16510
16510
|
(s, m) => {
|
|
16511
16511
|
var F;
|
|
16512
16512
|
if (!$e.current) {
|
|
16513
|
-
|
|
16513
|
+
ce(kt(s.innerHTML, se.current), m);
|
|
16514
16514
|
return;
|
|
16515
16515
|
}
|
|
16516
16516
|
const v = (F = Fr.current) == null ? void 0 : F.getContainer();
|
|
16517
16517
|
if (!v) {
|
|
16518
|
-
|
|
16518
|
+
ce(kt(s.innerHTML, se.current), m);
|
|
16519
16519
|
return;
|
|
16520
16520
|
}
|
|
16521
|
-
for (let W = 0; W < tt(
|
|
16521
|
+
for (let W = 0; W < tt(se.current).length; W += 1)
|
|
16522
16522
|
if (Ko(v, W) === s) {
|
|
16523
|
-
const J = tt(
|
|
16523
|
+
const J = tt(se.current)[W] ?? "";
|
|
16524
16524
|
pa(
|
|
16525
16525
|
W,
|
|
16526
|
-
|
|
16526
|
+
kt(s.innerHTML, De(J).body),
|
|
16527
16527
|
m
|
|
16528
16528
|
);
|
|
16529
16529
|
return;
|
|
16530
16530
|
}
|
|
16531
|
-
|
|
16531
|
+
ce(kt(s.innerHTML, se.current), m);
|
|
16532
16532
|
},
|
|
16533
|
-
[pa,
|
|
16533
|
+
[pa, ce]
|
|
16534
16534
|
), yc = K(
|
|
16535
16535
|
(s, m) => {
|
|
16536
16536
|
Ss.current || ie(s, m);
|
|
16537
16537
|
},
|
|
16538
16538
|
[ie]
|
|
16539
16539
|
), wc = K(() => {
|
|
16540
|
-
const s = $e.current ?
|
|
16541
|
-
return s[
|
|
16542
|
-
}, [
|
|
16540
|
+
const s = $e.current ? Rt() : tt(se.current);
|
|
16541
|
+
return s[Kt.current] ?? s[0] ?? "";
|
|
16542
|
+
}, [Rt]), ho = K(() => $e.current ? Rt() : [se.current], [Rt]), Cc = K(() => {
|
|
16543
16543
|
if (!$e.current || $.current !== "visual") return;
|
|
16544
|
-
const s =
|
|
16545
|
-
v.splice(m, 0, tl()), be(
|
|
16546
|
-
}, [
|
|
16544
|
+
const s = Rt(), m = Kt.current + 1, v = [...s];
|
|
16545
|
+
v.splice(m, 0, tl()), be(Ft(v), !1), Ds(m);
|
|
16546
|
+
}, [Rt, be]), bo = K(() => {
|
|
16547
16547
|
const s = ot.undo();
|
|
16548
16548
|
s !== null && (ot.markApplying(), Pn(s));
|
|
16549
16549
|
}, [Pn, ot]), yo = K(() => {
|
|
@@ -16554,7 +16554,7 @@ function mT({
|
|
|
16554
16554
|
ot.syncExternal(_e);
|
|
16555
16555
|
}, [_e, ot]);
|
|
16556
16556
|
const O = K(() => {
|
|
16557
|
-
|
|
16557
|
+
Me.current = vt({
|
|
16558
16558
|
mode: $.current,
|
|
16559
16559
|
visualEl: B.current,
|
|
16560
16560
|
htmlEl: Xe.current
|
|
@@ -16570,16 +16570,16 @@ function mT({
|
|
|
16570
16570
|
mode: $.current,
|
|
16571
16571
|
visualEl: B.current,
|
|
16572
16572
|
htmlEl: Xe.current
|
|
16573
|
-
}), m =
|
|
16574
|
-
ru(m, s) || (
|
|
16573
|
+
}), m = Me.current;
|
|
16574
|
+
ru(m, s) || (Me.current = s);
|
|
16575
16575
|
}, []), ha = K(() => {
|
|
16576
16576
|
const s = B.current;
|
|
16577
16577
|
if ($.current !== "visual" || !s) {
|
|
16578
|
-
Ur({ value: null, unit:
|
|
16578
|
+
Ur({ value: null, unit: Mt.current, mixed: !1 });
|
|
16579
16579
|
return;
|
|
16580
16580
|
}
|
|
16581
|
-
const m = wm(s,
|
|
16582
|
-
Je.current && (m.value = Je.current.value, m.unit = Je.current.unit, m.mixed = !1),
|
|
16581
|
+
const m = wm(s, Mt.current);
|
|
16582
|
+
Je.current && (m.value = Je.current.value, m.unit = Je.current.unit, m.mixed = !1), Mt.current = m.unit, Ur(
|
|
16583
16583
|
(v) => v.value === m.value && v.unit === m.unit && v.mixed === m.mixed ? v : m
|
|
16584
16584
|
);
|
|
16585
16585
|
}, []), ba = K(() => {
|
|
@@ -16633,16 +16633,16 @@ function mT({
|
|
|
16633
16633
|
}, []), U = K(() => {
|
|
16634
16634
|
const s = B.current;
|
|
16635
16635
|
if ($.current !== "visual" || !s) {
|
|
16636
|
-
Di(
|
|
16636
|
+
Di(Ht()), zi(!1), ha(), ba(), ya(), wa(), Ca();
|
|
16637
16637
|
return;
|
|
16638
16638
|
}
|
|
16639
|
-
const m =
|
|
16639
|
+
const m = Me.current, v = !!(m && !m.collapsed);
|
|
16640
16640
|
zi((W) => W === v ? W : v);
|
|
16641
16641
|
const F = Sm(Mn(s), it.current);
|
|
16642
16642
|
Di((W) => iy(W, F) ? W : F), ha(), ba(), ya(), wa(), Ca();
|
|
16643
16643
|
}, [ha, ba, ya, wa, Ca]), vc = K(() => {
|
|
16644
|
-
const s =
|
|
16645
|
-
!m || !s || s.collapsed && s.start === m.start && s.end === m.end || (it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null,
|
|
16644
|
+
const s = Me.current, m = Qe.current;
|
|
16645
|
+
!m || !s || s.collapsed && s.start === m.start && s.end === m.end || (it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null, $t.current = null, Qe.current = null);
|
|
16646
16646
|
}, []);
|
|
16647
16647
|
G(() => {
|
|
16648
16648
|
Or.current = !0;
|
|
@@ -16651,7 +16651,7 @@ function mT({
|
|
|
16651
16651
|
U();
|
|
16652
16652
|
return;
|
|
16653
16653
|
}
|
|
16654
|
-
it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null,
|
|
16654
|
+
it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null, $t.current = null, Qe.current = null, Di(Ht()), Ur({ value: null, unit: Mt.current, mixed: !1 }), xi({ value: null, mixed: !1 }), Ei({ value: null, mixed: !1 }), Ni({ value: null, mixed: !1 }), Ri({ tag: null, mixed: !1 }), Li({ align: null, mixed: !1 }), Fi({ type: null, mixed: !1 }), Bi(!1), zi(!1);
|
|
16655
16655
|
}, [Ae, U]);
|
|
16656
16656
|
const Dn = K(
|
|
16657
16657
|
(s, m, v) => {
|
|
@@ -16659,10 +16659,16 @@ function mT({
|
|
|
16659
16659
|
snapshot: s,
|
|
16660
16660
|
visualEl: B.current,
|
|
16661
16661
|
htmlEl: Xe.current,
|
|
16662
|
-
getHtml: () => $.current === "visual" && B.current ? B.current.innerHTML :
|
|
16662
|
+
getHtml: () => $.current === "visual" && B.current ? B.current.innerHTML : se.current,
|
|
16663
16663
|
setHtml: (F) => {
|
|
16664
16664
|
if ($.current === "visual") {
|
|
16665
|
-
|
|
16665
|
+
ce(
|
|
16666
|
+
kt(
|
|
16667
|
+
De(F).body,
|
|
16668
|
+
De(se.current).body
|
|
16669
|
+
),
|
|
16670
|
+
!1
|
|
16671
|
+
);
|
|
16666
16672
|
return;
|
|
16667
16673
|
}
|
|
16668
16674
|
be(F, !1);
|
|
@@ -16671,38 +16677,41 @@ function mT({
|
|
|
16671
16677
|
asHtml: v
|
|
16672
16678
|
});
|
|
16673
16679
|
},
|
|
16674
|
-
[be,
|
|
16680
|
+
[be, ce]
|
|
16675
16681
|
), kc = K(
|
|
16676
16682
|
(s) => {
|
|
16677
16683
|
if ($.current === "visual" && s === "html") {
|
|
16678
16684
|
if ($e.current) {
|
|
16679
|
-
const m =
|
|
16680
|
-
m !==
|
|
16685
|
+
const m = Ft(Rt());
|
|
16686
|
+
m !== se.current && be(m, !0);
|
|
16681
16687
|
} else if (B.current) {
|
|
16682
|
-
const m =
|
|
16688
|
+
const m = kt(
|
|
16689
|
+
B.current.innerHTML,
|
|
16690
|
+
De(se.current).body
|
|
16691
|
+
), v = Po(
|
|
16683
16692
|
m,
|
|
16684
|
-
Do(m,
|
|
16693
|
+
Do(m, se.current, Sn.current)
|
|
16685
16694
|
);
|
|
16686
|
-
v !==
|
|
16695
|
+
v !== se.current && be(v, !0);
|
|
16687
16696
|
}
|
|
16688
16697
|
}
|
|
16689
16698
|
ks(s);
|
|
16690
16699
|
},
|
|
16691
|
-
[be, ks,
|
|
16700
|
+
[be, ks, Rt]
|
|
16692
16701
|
);
|
|
16693
16702
|
G(() => {
|
|
16694
|
-
if (!
|
|
16703
|
+
if (!Et) return;
|
|
16695
16704
|
const s = document.body.style.overflow;
|
|
16696
16705
|
return document.body.style.overflow = "hidden", () => {
|
|
16697
16706
|
document.body.style.overflow = s;
|
|
16698
16707
|
};
|
|
16699
|
-
}, [
|
|
16700
|
-
if (!
|
|
16708
|
+
}, [Et]), G(() => {
|
|
16709
|
+
if (!Et) return;
|
|
16701
16710
|
const s = (m) => {
|
|
16702
16711
|
m.key === "Escape" && (m.defaultPrevented || lr.open || Qr.open || ln.open || sn.open || Qi.open || ao.open || lo.open || so.open || $i || sr.open || (m.preventDefault(), Yn(!1)));
|
|
16703
16712
|
};
|
|
16704
16713
|
return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
|
|
16705
|
-
}, [
|
|
16714
|
+
}, [Et, Yn, lr.open, Qr.open, ln.open, sn.open, Qi.open, ao.open, lo.open, so.open, $i, sr.open]), G(() => {
|
|
16706
16715
|
const s = () => {
|
|
16707
16716
|
if ($.current !== "visual" || !B.current) return;
|
|
16708
16717
|
const m = window.getSelection();
|
|
@@ -16713,8 +16722,8 @@ function mT({
|
|
|
16713
16722
|
Cn.current = null;
|
|
16714
16723
|
const F = B.current;
|
|
16715
16724
|
if (!(!F || $.current !== "visual") && (O(), vc(), U(), An(qt(F)), Ct(F), an.current && Br.current && !((W = Ai.current) != null && W.contains(document.activeElement)))) {
|
|
16716
|
-
const J =
|
|
16717
|
-
J &&
|
|
16725
|
+
const J = Me.current;
|
|
16726
|
+
J && Nt(xu(F, J));
|
|
16718
16727
|
}
|
|
16719
16728
|
}));
|
|
16720
16729
|
};
|
|
@@ -16722,7 +16731,7 @@ function mT({
|
|
|
16722
16731
|
document.removeEventListener("selectionchange", s), Cn.current !== null && (window.cancelAnimationFrame(Cn.current), Cn.current = null);
|
|
16723
16732
|
};
|
|
16724
16733
|
}, [O, vc, U, Ct]), G(() => {
|
|
16725
|
-
(!Ve || Ae !== "visual" || !yt) &&
|
|
16734
|
+
(!Ve || Ae !== "visual" || !yt) && Nt(null);
|
|
16726
16735
|
}, [Ve, Ae, yt]), G(() => {
|
|
16727
16736
|
if (!wt) return;
|
|
16728
16737
|
const s = (m) => {
|
|
@@ -16730,7 +16739,7 @@ function mT({
|
|
|
16730
16739
|
const v = m.target;
|
|
16731
16740
|
if ((W = Ai.current) != null && W.contains(v)) return;
|
|
16732
16741
|
const F = B.current;
|
|
16733
|
-
F && Nu(F, v) ||
|
|
16742
|
+
F && Nu(F, v) || Nt(null);
|
|
16734
16743
|
};
|
|
16735
16744
|
return document.addEventListener("pointerdown", s), () => document.removeEventListener("pointerdown", s);
|
|
16736
16745
|
}, [wt]), G(() => {
|
|
@@ -16756,60 +16765,60 @@ function mT({
|
|
|
16756
16765
|
mode: "visual",
|
|
16757
16766
|
visualEl: s,
|
|
16758
16767
|
htmlEl: Xe.current
|
|
16759
|
-
}), v =
|
|
16760
|
-
|
|
16768
|
+
}), v = Me.current, F = ru(v, m) ? v : m.visualRange ? m : v ?? m;
|
|
16769
|
+
Me.current = F, s.focus();
|
|
16761
16770
|
const W = Sh(s, F);
|
|
16762
16771
|
if (W) {
|
|
16763
16772
|
const J = window.getSelection();
|
|
16764
16773
|
try {
|
|
16765
|
-
J == null || J.removeAllRanges(), J == null || J.addRange(W),
|
|
16774
|
+
J == null || J.removeAllRanges(), J == null || J.addRange(W), Me.current = { ...F, visualRange: W };
|
|
16766
16775
|
} catch {
|
|
16767
16776
|
}
|
|
16768
16777
|
}
|
|
16769
|
-
return
|
|
16770
|
-
}, []),
|
|
16778
|
+
return Me.current ?? F;
|
|
16779
|
+
}, []), _t = K(() => {
|
|
16771
16780
|
Gr.current = null, Vr.current = null, Rs(!1);
|
|
16772
16781
|
}, []), Ac = K(() => {
|
|
16773
16782
|
if (!Wr.current || !Gr.current || !Vr.current || $.current !== "visual") return;
|
|
16774
16783
|
const s = B.current;
|
|
16775
16784
|
if (!s) return;
|
|
16776
16785
|
O();
|
|
16777
|
-
const m =
|
|
16778
|
-
!m || m.collapsed || fC(m, Vr.current) || (V(s), gC(s, Gr.current), ie(s, !1), O(), U(),
|
|
16779
|
-
}, [O, V,
|
|
16786
|
+
const m = Me.current;
|
|
16787
|
+
!m || m.collapsed || fC(m, Vr.current) || (V(s), gC(s, Gr.current), ie(s, !1), O(), U(), _t());
|
|
16788
|
+
}, [O, V, ce, U, _t]), Sc = K(() => {
|
|
16780
16789
|
if ($.current !== "visual") {
|
|
16781
|
-
|
|
16790
|
+
_t();
|
|
16782
16791
|
return;
|
|
16783
16792
|
}
|
|
16784
16793
|
if (Wr.current) {
|
|
16785
|
-
|
|
16794
|
+
_t();
|
|
16786
16795
|
return;
|
|
16787
16796
|
}
|
|
16788
16797
|
const s = B.current;
|
|
16789
16798
|
if (!s) {
|
|
16790
|
-
|
|
16799
|
+
_t();
|
|
16791
16800
|
return;
|
|
16792
16801
|
}
|
|
16793
16802
|
const m = V(s);
|
|
16794
16803
|
if (m.collapsed) {
|
|
16795
|
-
|
|
16804
|
+
_t();
|
|
16796
16805
|
return;
|
|
16797
16806
|
}
|
|
16798
16807
|
Gr.current = pC(s), Vr.current = { ...m }, Rs(!0), O();
|
|
16799
|
-
}, [
|
|
16808
|
+
}, [_t, V, O]), Pc = K(() => {
|
|
16800
16809
|
Ac();
|
|
16801
16810
|
}, [Ac]);
|
|
16802
16811
|
G(() => {
|
|
16803
|
-
(Ae !== "visual" || le) &&
|
|
16804
|
-
}, [Ae, le,
|
|
16812
|
+
(Ae !== "visual" || le) && _t();
|
|
16813
|
+
}, [Ae, le, _t]);
|
|
16805
16814
|
const va = K(
|
|
16806
16815
|
(s, m) => {
|
|
16807
16816
|
if ($.current !== "visual") return;
|
|
16808
16817
|
const v = B.current;
|
|
16809
16818
|
if (!v) return;
|
|
16810
|
-
const F = m ??
|
|
16819
|
+
const F = m ?? Mt.current, W = fn(s, F);
|
|
16811
16820
|
if (!W) return;
|
|
16812
|
-
|
|
16821
|
+
Mt.current = W.unit;
|
|
16813
16822
|
const J = V(v);
|
|
16814
16823
|
if (J.collapsed) {
|
|
16815
16824
|
Je.current = W, Qe.current = { start: J.start, end: J.end }, U();
|
|
@@ -16817,7 +16826,7 @@ function mT({
|
|
|
16817
16826
|
}
|
|
16818
16827
|
Je.current = null, cl(v, W.value, W.unit) && (ie(v, !1), O(), U());
|
|
16819
16828
|
},
|
|
16820
|
-
[V,
|
|
16829
|
+
[V, ce, O, U]
|
|
16821
16830
|
), Dc = K(
|
|
16822
16831
|
(s) => {
|
|
16823
16832
|
if ($.current !== "visual") return;
|
|
@@ -16830,7 +16839,7 @@ function mT({
|
|
|
16830
16839
|
}
|
|
16831
16840
|
at.current = null, rl(m, s) && (ie(m, !1), O(), U());
|
|
16832
16841
|
},
|
|
16833
|
-
[V,
|
|
16842
|
+
[V, ce, O, U]
|
|
16834
16843
|
), ka = K(
|
|
16835
16844
|
(s, m) => {
|
|
16836
16845
|
if ($.current !== "visual") return;
|
|
@@ -16843,7 +16852,7 @@ function mT({
|
|
|
16843
16852
|
}
|
|
16844
16853
|
W.current = null, br(v, s, m) && (ie(v, !1), O(), U());
|
|
16845
16854
|
},
|
|
16846
|
-
[V,
|
|
16855
|
+
[V, ce, O, U]
|
|
16847
16856
|
), Aa = K(
|
|
16848
16857
|
(s) => {
|
|
16849
16858
|
if ($.current !== "visual") return;
|
|
@@ -16853,7 +16862,7 @@ function mT({
|
|
|
16853
16862
|
if (jr({ open: !1, tab: "general" }), v.collapsed) {
|
|
16854
16863
|
if (s.size !== null) {
|
|
16855
16864
|
const Fe = fn(s.size, s.unit);
|
|
16856
|
-
Fe && (Je.current = Fe,
|
|
16865
|
+
Fe && (Je.current = Fe, Mt.current = Fe.unit);
|
|
16857
16866
|
}
|
|
16858
16867
|
const W = Mn(m), J = {};
|
|
16859
16868
|
for (const Fe of ct)
|
|
@@ -16863,14 +16872,14 @@ function mT({
|
|
|
16863
16872
|
}
|
|
16864
16873
|
if (it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null, Qe.current = null, s.size !== null) {
|
|
16865
16874
|
const W = fn(s.size, s.unit);
|
|
16866
|
-
W && (
|
|
16875
|
+
W && (Mt.current = W.unit, cl(m, W.value, W.unit));
|
|
16867
16876
|
}
|
|
16868
16877
|
const F = Mn(m);
|
|
16869
16878
|
for (const W of ct)
|
|
16870
16879
|
s.marks[W] !== F[W] && ml(m, W);
|
|
16871
16880
|
s.fontFamilyMixed || rl(m, s.fontFamily), s.fontColorMixed || br(m, "color", s.fontColor), s.highlightColorMixed || br(m, "backgroundColor", s.highlightColor), ie(m, !1), O(), U();
|
|
16872
16881
|
},
|
|
16873
|
-
[V,
|
|
16882
|
+
[V, ce, O, U]
|
|
16874
16883
|
), Tc = K(
|
|
16875
16884
|
(s) => {
|
|
16876
16885
|
if ($.current !== "visual") return;
|
|
@@ -16883,7 +16892,7 @@ function mT({
|
|
|
16883
16892
|
ie(m, !1), O(), U();
|
|
16884
16893
|
}
|
|
16885
16894
|
},
|
|
16886
|
-
[V,
|
|
16895
|
+
[V, ce, O, U]
|
|
16887
16896
|
), xc = K(
|
|
16888
16897
|
(s) => {
|
|
16889
16898
|
if ($.current !== "visual") return;
|
|
@@ -16895,30 +16904,30 @@ function mT({
|
|
|
16895
16904
|
return;
|
|
16896
16905
|
}
|
|
16897
16906
|
if (v.collapsed) {
|
|
16898
|
-
|
|
16907
|
+
$t.current = s, Qe.current = { start: v.start, end: v.end }, U();
|
|
16899
16908
|
return;
|
|
16900
16909
|
}
|
|
16901
|
-
if (
|
|
16910
|
+
if ($t.current = null, !Am(m, s)) {
|
|
16902
16911
|
O(), U();
|
|
16903
16912
|
return;
|
|
16904
16913
|
}
|
|
16905
16914
|
ie(m, !1), O(), U();
|
|
16906
16915
|
},
|
|
16907
|
-
[V,
|
|
16916
|
+
[V, ce, O, U]
|
|
16908
16917
|
), Ec = K(
|
|
16909
16918
|
(s) => {
|
|
16910
16919
|
if ($.current !== "visual") return;
|
|
16911
16920
|
const m = B.current;
|
|
16912
16921
|
if (!m) return;
|
|
16913
16922
|
V(m), kn((J) => ({ ...J, open: !1 }));
|
|
16914
|
-
const v = $e.current ? tt(
|
|
16923
|
+
const v = $e.current ? tt(se.current)[Kt.current] ?? "" : se.current, F = JSON.stringify(s.atRule) !== JSON.stringify(gn(De(v).body)), W = Tw(m, s);
|
|
16915
16924
|
if (F && _r(m, W.pageHtml), !W.changed && !F) {
|
|
16916
16925
|
O(), U();
|
|
16917
16926
|
return;
|
|
16918
16927
|
}
|
|
16919
|
-
|
|
16928
|
+
ce(De(W.pageHtml).body, !1), O(), U();
|
|
16920
16929
|
},
|
|
16921
|
-
[V,
|
|
16930
|
+
[V, ce, O, U]
|
|
16922
16931
|
), Nc = K(
|
|
16923
16932
|
(s) => {
|
|
16924
16933
|
if ($.current !== "visual") return;
|
|
@@ -16931,7 +16940,7 @@ function mT({
|
|
|
16931
16940
|
ie(m, !1), O(), U();
|
|
16932
16941
|
}
|
|
16933
16942
|
},
|
|
16934
|
-
[V,
|
|
16943
|
+
[V, ce, O, U]
|
|
16935
16944
|
), Mc = K(
|
|
16936
16945
|
(s) => {
|
|
16937
16946
|
if ($.current !== "visual") return;
|
|
@@ -16944,7 +16953,7 @@ function mT({
|
|
|
16944
16953
|
ie(m, !1), O(), U();
|
|
16945
16954
|
}
|
|
16946
16955
|
},
|
|
16947
|
-
[V,
|
|
16956
|
+
[V, ce, O, U]
|
|
16948
16957
|
), wo = K(
|
|
16949
16958
|
(s) => {
|
|
16950
16959
|
if ($.current !== "visual") return;
|
|
@@ -16957,7 +16966,7 @@ function mT({
|
|
|
16957
16966
|
ie(m, !1), O(), U();
|
|
16958
16967
|
}
|
|
16959
16968
|
},
|
|
16960
|
-
[V,
|
|
16969
|
+
[V, ce, O, U]
|
|
16961
16970
|
), Co = K(
|
|
16962
16971
|
(s) => {
|
|
16963
16972
|
if ($.current !== "visual") return;
|
|
@@ -16970,7 +16979,7 @@ function mT({
|
|
|
16970
16979
|
ie(m, !1), O(), U();
|
|
16971
16980
|
}
|
|
16972
16981
|
},
|
|
16973
|
-
[V,
|
|
16982
|
+
[V, ce, O, U]
|
|
16974
16983
|
), Rc = K(
|
|
16975
16984
|
(s) => {
|
|
16976
16985
|
if ($.current !== "visual") return;
|
|
@@ -16983,7 +16992,7 @@ function mT({
|
|
|
16983
16992
|
ie(m, !1), O(), U();
|
|
16984
16993
|
}
|
|
16985
16994
|
},
|
|
16986
|
-
[V,
|
|
16995
|
+
[V, ce, O, U]
|
|
16987
16996
|
), _c = K(
|
|
16988
16997
|
(s) => {
|
|
16989
16998
|
if ($.current !== "visual") return;
|
|
@@ -16996,7 +17005,7 @@ function mT({
|
|
|
16996
17005
|
ie(m, !1), O(), U(), Ct(m);
|
|
16997
17006
|
}
|
|
16998
17007
|
},
|
|
16999
|
-
[V,
|
|
17008
|
+
[V, ce, O, U, Ct]
|
|
17000
17009
|
), Lc = K(
|
|
17001
17010
|
(s) => {
|
|
17002
17011
|
if ($.current !== "visual") return;
|
|
@@ -17009,7 +17018,7 @@ function mT({
|
|
|
17009
17018
|
ie(m, !1), O(), U();
|
|
17010
17019
|
}
|
|
17011
17020
|
},
|
|
17012
|
-
[V,
|
|
17021
|
+
[V, ce, O, U]
|
|
17013
17022
|
), Ic = K(
|
|
17014
17023
|
(s) => {
|
|
17015
17024
|
if ($.current !== "visual") return;
|
|
@@ -17022,7 +17031,7 @@ function mT({
|
|
|
17022
17031
|
ie(m, !1), O(), U(), Ct(m);
|
|
17023
17032
|
}
|
|
17024
17033
|
},
|
|
17025
|
-
[V,
|
|
17034
|
+
[V, ce, O, U, Ct]
|
|
17026
17035
|
), Fc = K(
|
|
17027
17036
|
(s) => {
|
|
17028
17037
|
if ($.current !== "visual") return;
|
|
@@ -17035,8 +17044,8 @@ function mT({
|
|
|
17035
17044
|
ie(m, !1), O(), U();
|
|
17036
17045
|
}
|
|
17037
17046
|
},
|
|
17038
|
-
[V,
|
|
17039
|
-
),
|
|
17047
|
+
[V, ce, O, U]
|
|
17048
|
+
), Lt = K(
|
|
17040
17049
|
(s) => {
|
|
17041
17050
|
if ($.current !== "visual") return;
|
|
17042
17051
|
const m = B.current;
|
|
@@ -17048,7 +17057,7 @@ function mT({
|
|
|
17048
17057
|
ie(m, !1), O(), U(), Ct(m);
|
|
17049
17058
|
}
|
|
17050
17059
|
},
|
|
17051
|
-
[V,
|
|
17060
|
+
[V, ce, O, U, Ct]
|
|
17052
17061
|
), Sa = K(
|
|
17053
17062
|
(s) => {
|
|
17054
17063
|
wo({
|
|
@@ -17084,7 +17093,7 @@ function mT({
|
|
|
17084
17093
|
ie(m, !1), O(), U();
|
|
17085
17094
|
}
|
|
17086
17095
|
},
|
|
17087
|
-
[V,
|
|
17096
|
+
[V, ce, O, U]
|
|
17088
17097
|
), Bc = K(
|
|
17089
17098
|
(s) => {
|
|
17090
17099
|
if ($.current !== "visual") return;
|
|
@@ -17097,7 +17106,7 @@ function mT({
|
|
|
17097
17106
|
ie(m, !1), O(), U();
|
|
17098
17107
|
}
|
|
17099
17108
|
},
|
|
17100
|
-
[V,
|
|
17109
|
+
[V, ce, O, U]
|
|
17101
17110
|
), fp = K(
|
|
17102
17111
|
(s, m) => {
|
|
17103
17112
|
Ie != null && Ie.isConnected && a0(Ie, s, m);
|
|
@@ -17106,36 +17115,36 @@ function mT({
|
|
|
17106
17115
|
), pp = K(() => {
|
|
17107
17116
|
const s = B.current;
|
|
17108
17117
|
!s || !(Ie != null && Ie.isConnected) || (ie(s, !1), Oa(s, Ie), O(), U());
|
|
17109
|
-
}, [Ie,
|
|
17118
|
+
}, [Ie, ce, O, U]), Gt = K(() => {
|
|
17110
17119
|
if ($e.current) {
|
|
17111
17120
|
if ($.current === "visual") {
|
|
17112
|
-
const s =
|
|
17113
|
-
if (m !==
|
|
17121
|
+
const s = Rt(), m = Ft(s);
|
|
17122
|
+
if (m !== se.current)
|
|
17114
17123
|
return be(m, !0);
|
|
17115
17124
|
}
|
|
17116
|
-
return
|
|
17125
|
+
return se.current;
|
|
17117
17126
|
}
|
|
17118
17127
|
if ($.current === "visual" && B.current) {
|
|
17119
|
-
const s =
|
|
17128
|
+
const s = kt(
|
|
17120
17129
|
B.current.innerHTML,
|
|
17121
|
-
|
|
17130
|
+
De(se.current).body
|
|
17122
17131
|
), m = Po(
|
|
17123
17132
|
s,
|
|
17124
|
-
Do(s,
|
|
17133
|
+
Do(s, se.current, Sn.current)
|
|
17125
17134
|
);
|
|
17126
|
-
if (m !==
|
|
17135
|
+
if (m !== se.current)
|
|
17127
17136
|
return be(m, !0);
|
|
17128
17137
|
}
|
|
17129
|
-
return
|
|
17138
|
+
return se.current;
|
|
17130
17139
|
}, [be]), Ta = K(() => {
|
|
17131
17140
|
if (!Or.current && Pi.current)
|
|
17132
17141
|
return Pi.current;
|
|
17133
17142
|
const s = JSON.stringify(ho());
|
|
17134
17143
|
return Pi.current = s, Or.current = !1, s;
|
|
17135
|
-
}, [ho]), gp = K(() => $e.current ? Ta() :
|
|
17144
|
+
}, [ho]), gp = K(() => $e.current ? Ta() : Gt(), [Gt, Ta]);
|
|
17136
17145
|
H0({
|
|
17137
17146
|
onAutoSave: r ? () => {
|
|
17138
|
-
const s = $e.current ? JSON.parse(Ta()) :
|
|
17147
|
+
const s = $e.current ? JSON.parse(Ta()) : Gt();
|
|
17139
17148
|
return r(s);
|
|
17140
17149
|
} : void 0,
|
|
17141
17150
|
getHtml: gp
|
|
@@ -17143,9 +17152,9 @@ function mT({
|
|
|
17143
17152
|
var s;
|
|
17144
17153
|
(s = Jn.current) == null || s.cancel();
|
|
17145
17154
|
}, []);
|
|
17146
|
-
const fe =
|
|
17155
|
+
const fe = Ee(
|
|
17147
17156
|
() => ({
|
|
17148
|
-
getHtml:
|
|
17157
|
+
getHtml: Gt,
|
|
17149
17158
|
setHtml: (s) => {
|
|
17150
17159
|
be(s, !1);
|
|
17151
17160
|
},
|
|
@@ -17167,16 +17176,16 @@ function mT({
|
|
|
17167
17176
|
Fs(!0);
|
|
17168
17177
|
},
|
|
17169
17178
|
openDocumentPreview: () => {
|
|
17170
|
-
Bs({ open: !0, html:
|
|
17179
|
+
Bs({ open: !0, html: Gt() });
|
|
17171
17180
|
},
|
|
17172
17181
|
toggleReadAloud: () => {
|
|
17173
17182
|
const s = Jn.current;
|
|
17174
17183
|
if (!s) return;
|
|
17175
|
-
const m =
|
|
17184
|
+
const m = Me.current ?? vt({
|
|
17176
17185
|
mode: $.current,
|
|
17177
17186
|
visualEl: B.current,
|
|
17178
17187
|
htmlEl: Xe.current
|
|
17179
|
-
}), v = Ru(To(m),
|
|
17188
|
+
}), v = Ru(To(m), Gt());
|
|
17180
17189
|
v && s.toggle(v);
|
|
17181
17190
|
},
|
|
17182
17191
|
isReadingAloud: () => {
|
|
@@ -17185,19 +17194,19 @@ function mT({
|
|
|
17185
17194
|
},
|
|
17186
17195
|
canReadAloud: () => {
|
|
17187
17196
|
if (!Uo()) return !1;
|
|
17188
|
-
const s =
|
|
17197
|
+
const s = Me.current ?? vt({
|
|
17189
17198
|
mode: $.current,
|
|
17190
17199
|
visualEl: B.current,
|
|
17191
17200
|
htmlEl: Xe.current
|
|
17192
17201
|
});
|
|
17193
|
-
return Ru(To(s),
|
|
17202
|
+
return Ru(To(s), Gt()) !== null;
|
|
17194
17203
|
},
|
|
17195
17204
|
undo: bo,
|
|
17196
17205
|
redo: yo,
|
|
17197
17206
|
canUndo: () => ot.canUndo(),
|
|
17198
17207
|
canRedo: () => ot.canRedo(),
|
|
17199
17208
|
getSelection: () => {
|
|
17200
|
-
const s =
|
|
17209
|
+
const s = Me.current ?? vt({
|
|
17201
17210
|
mode: $.current,
|
|
17202
17211
|
visualEl: B.current,
|
|
17203
17212
|
htmlEl: Xe.current
|
|
@@ -17205,7 +17214,7 @@ function mT({
|
|
|
17205
17214
|
return To(s);
|
|
17206
17215
|
},
|
|
17207
17216
|
insertText: (s) => {
|
|
17208
|
-
const m =
|
|
17217
|
+
const m = Me.current ?? vt({
|
|
17209
17218
|
mode: $.current,
|
|
17210
17219
|
visualEl: B.current,
|
|
17211
17220
|
htmlEl: Xe.current
|
|
@@ -17213,7 +17222,7 @@ function mT({
|
|
|
17213
17222
|
Dn(m, s, !1);
|
|
17214
17223
|
},
|
|
17215
17224
|
insertHtml: (s, m) => {
|
|
17216
|
-
const v =
|
|
17225
|
+
const v = Me.current ?? vt({
|
|
17217
17226
|
mode: $.current,
|
|
17218
17227
|
visualEl: B.current,
|
|
17219
17228
|
htmlEl: Xe.current
|
|
@@ -17235,7 +17244,7 @@ function mT({
|
|
|
17235
17244
|
clearFormatting: () => {
|
|
17236
17245
|
if ($.current !== "visual") return;
|
|
17237
17246
|
const s = B.current;
|
|
17238
|
-
!s || V(s).collapsed || (it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null,
|
|
17247
|
+
!s || V(s).collapsed || (it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null, $t.current = null, Qe.current = null, mC(s) && (ie(s, !1), O(), U()));
|
|
17239
17248
|
},
|
|
17240
17249
|
toggleFormatBrush: Sc,
|
|
17241
17250
|
isFormatBrushActive: () => Wr.current,
|
|
@@ -17246,9 +17255,9 @@ function mT({
|
|
|
17246
17255
|
},
|
|
17247
17256
|
setFontSizeUnit: (s) => {
|
|
17248
17257
|
var Fe;
|
|
17249
|
-
const m = B.current, v =
|
|
17258
|
+
const m = B.current, v = Ut.current;
|
|
17250
17259
|
if ($.current !== "visual" || !m || v.value === null || v.mixed) {
|
|
17251
|
-
|
|
17260
|
+
Mt.current = s, Ur((fr) => ({ ...fr, unit: s }));
|
|
17252
17261
|
return;
|
|
17253
17262
|
}
|
|
17254
17263
|
const F = V(m), W = Zb(m, ((Fe = F.visualRange) == null ? void 0 : Fe.startContainer) ?? m), J = Kd(
|
|
@@ -17260,9 +17269,9 @@ function mT({
|
|
|
17260
17269
|
);
|
|
17261
17270
|
va(J, s);
|
|
17262
17271
|
},
|
|
17263
|
-
getFontSize: () =>
|
|
17264
|
-
getFontSizeUnit: () =>
|
|
17265
|
-
isFontSizeMixed: () =>
|
|
17272
|
+
getFontSize: () => Ut.current.value,
|
|
17273
|
+
getFontSizeUnit: () => Ut.current.unit,
|
|
17274
|
+
isFontSizeMixed: () => Ut.current.mixed,
|
|
17266
17275
|
setFontFamily: (s) => {
|
|
17267
17276
|
Dc(s);
|
|
17268
17277
|
},
|
|
@@ -17343,13 +17352,13 @@ function mT({
|
|
|
17343
17352
|
if ($.current !== "visual") return;
|
|
17344
17353
|
const m = B.current;
|
|
17345
17354
|
m && V(m);
|
|
17346
|
-
const v = $e.current ? tt(
|
|
17355
|
+
const v = $e.current ? tt(se.current)[Kt.current] ?? "" : se.current, F = m ? Dw(m) : kl();
|
|
17347
17356
|
kn({
|
|
17348
17357
|
open: !0,
|
|
17349
17358
|
tab: s ?? "font",
|
|
17350
17359
|
value: {
|
|
17351
17360
|
...F,
|
|
17352
|
-
atRule: gn(
|
|
17361
|
+
atRule: gn(De(v).body)
|
|
17353
17362
|
}
|
|
17354
17363
|
});
|
|
17355
17364
|
},
|
|
@@ -17369,8 +17378,8 @@ function mT({
|
|
|
17369
17378
|
open: !0,
|
|
17370
17379
|
mode: "create",
|
|
17371
17380
|
font: {
|
|
17372
|
-
size:
|
|
17373
|
-
unit:
|
|
17381
|
+
size: Ut.current.mixed ? null : Ut.current.value,
|
|
17382
|
+
unit: Ut.current.unit,
|
|
17374
17383
|
marks: { ...Ti.current },
|
|
17375
17384
|
fontFamily: tr.current.mixed ? null : tr.current.value,
|
|
17376
17385
|
fontColor: rr.current.mixed ? null : rr.current.value,
|
|
@@ -17549,28 +17558,28 @@ function mT({
|
|
|
17549
17558
|
Fc(s);
|
|
17550
17559
|
},
|
|
17551
17560
|
insertRowBelow: () => {
|
|
17552
|
-
|
|
17561
|
+
Lt((s) => gl(s, "below"));
|
|
17553
17562
|
},
|
|
17554
17563
|
insertRowBefore: () => {
|
|
17555
|
-
|
|
17564
|
+
Lt((s) => gl(s, "before"));
|
|
17556
17565
|
},
|
|
17557
17566
|
deleteRow: () => {
|
|
17558
|
-
|
|
17567
|
+
Lt((s) => Zy(s));
|
|
17559
17568
|
},
|
|
17560
17569
|
insertColumnAfter: () => {
|
|
17561
|
-
|
|
17570
|
+
Lt((s) => fu(s, "after"));
|
|
17562
17571
|
},
|
|
17563
17572
|
insertColumnBefore: () => {
|
|
17564
|
-
|
|
17573
|
+
Lt((s) => fu(s, "before"));
|
|
17565
17574
|
},
|
|
17566
17575
|
deleteColumn: () => {
|
|
17567
|
-
|
|
17576
|
+
Lt((s) => qy(s));
|
|
17568
17577
|
},
|
|
17569
17578
|
mergeCells: () => {
|
|
17570
|
-
|
|
17579
|
+
Lt((s) => Jy(s));
|
|
17571
17580
|
},
|
|
17572
17581
|
unmergeCells: () => {
|
|
17573
|
-
|
|
17582
|
+
Lt((s) => Qy(s));
|
|
17574
17583
|
},
|
|
17575
17584
|
cut: async () => {
|
|
17576
17585
|
if ($.current !== "visual") return;
|
|
@@ -17593,13 +17602,13 @@ function mT({
|
|
|
17593
17602
|
if (!s) return;
|
|
17594
17603
|
const m = V(s), v = xu(s, m);
|
|
17595
17604
|
if (v) {
|
|
17596
|
-
|
|
17605
|
+
Nt(v);
|
|
17597
17606
|
return;
|
|
17598
17607
|
}
|
|
17599
17608
|
const F = Yw(s, m);
|
|
17600
17609
|
if (!F) return;
|
|
17601
17610
|
const W = tC(F);
|
|
17602
|
-
Xw(s, W.id, m) && (Mu(s, W.id), O(), yc(s, !1), Xn([...Hr.current, W]),
|
|
17611
|
+
Xw(s, W.id, m) && (Mu(s, W.id), O(), yc(s, !1), Xn([...Hr.current, W]), Nt(W.id));
|
|
17603
17612
|
},
|
|
17604
17613
|
toggleCommentsVisible: () => {
|
|
17605
17614
|
tp((s) => {
|
|
@@ -17614,7 +17623,7 @@ function mT({
|
|
|
17614
17623
|
setCommentThreads: (s) => Xn(s),
|
|
17615
17624
|
openCommentThread: (s) => {
|
|
17616
17625
|
const m = B.current;
|
|
17617
|
-
!m || $.current !== "visual" || Mu(m, s) && (O(),
|
|
17626
|
+
!m || $.current !== "visual" || Mu(m, s) && (O(), Nt(s));
|
|
17618
17627
|
},
|
|
17619
17628
|
isContentLocked: () => Ps.current,
|
|
17620
17629
|
isLink: () => Is.current,
|
|
@@ -17629,9 +17638,9 @@ function mT({
|
|
|
17629
17638
|
onOpen: () => Xs.current()
|
|
17630
17639
|
} : {}
|
|
17631
17640
|
}),
|
|
17632
|
-
[be,
|
|
17641
|
+
[be, ce, ie, yc, kc, Yn, gc, hc, bc, Dn, bo, yo, O, U, V, va, Dc, ka, Aa, xc, Tc, Ec, Nc, Mc, wo, Co, Rc, Bc, _c, Lc, Ic, Fc, Lt, Sa, Pa, Da, Gt, wc, ho, Cc, Sc, o, i, y, Xn]
|
|
17633
17642
|
), Hc = K(() => {
|
|
17634
|
-
const s =
|
|
17643
|
+
const s = Me.current ?? vt({
|
|
17635
17644
|
mode: $.current,
|
|
17636
17645
|
visualEl: B.current,
|
|
17637
17646
|
htmlEl: Xe.current
|
|
@@ -17649,28 +17658,28 @@ function mT({
|
|
|
17649
17658
|
Dn(s, F ? m : v, F);
|
|
17650
17659
|
}
|
|
17651
17660
|
};
|
|
17652
|
-
}, [Dn, fe.getHtml, be]), { catalog: vo, layout: zc } =
|
|
17661
|
+
}, [Dn, fe.getHtml, be]), { catalog: vo, layout: zc } = Ee(
|
|
17653
17662
|
() => Cg(R, vD, kD),
|
|
17654
17663
|
[R]
|
|
17655
|
-
), ko =
|
|
17664
|
+
), ko = Ee(
|
|
17656
17665
|
() => QP(zc, M),
|
|
17657
17666
|
[zc, M]
|
|
17658
|
-
), xa =
|
|
17667
|
+
), xa = Ee(
|
|
17659
17668
|
() => ({
|
|
17660
17669
|
...ko,
|
|
17661
17670
|
iconGroups: DP(ko.iconGroups, Ui)
|
|
17662
17671
|
}),
|
|
17663
17672
|
[ko, Ui]
|
|
17664
|
-
), Ea =
|
|
17673
|
+
), Ea = Ee(
|
|
17665
17674
|
() => Ve ? DD(vo, yt) : vo,
|
|
17666
17675
|
[vo, Ve, yt]
|
|
17667
|
-
), Na =
|
|
17676
|
+
), Na = Ee(
|
|
17668
17677
|
() => Ve ? TD(xa) : xa,
|
|
17669
17678
|
[xa, Ve]
|
|
17670
|
-
), Ma =
|
|
17679
|
+
), Ma = Ee(
|
|
17671
17680
|
() => ({ disabled: qn, readOnly: w, enableComments: Ve }),
|
|
17672
17681
|
[qn, w, Ve]
|
|
17673
|
-
), Oc =
|
|
17682
|
+
), Oc = Ee(
|
|
17674
17683
|
() => wt ? oC(yn, wt) : null,
|
|
17675
17684
|
[wt, yn]
|
|
17676
17685
|
), hp = K(
|
|
@@ -17680,21 +17689,21 @@ function mT({
|
|
|
17680
17689
|
Xn(rC(Hr.current, wt, m));
|
|
17681
17690
|
},
|
|
17682
17691
|
[wt, Ir, y, Xn]
|
|
17683
|
-
), Tn =
|
|
17692
|
+
), Tn = Ee(
|
|
17684
17693
|
() => ({
|
|
17685
17694
|
...Ub(fe),
|
|
17686
17695
|
...vg(R, Hc)
|
|
17687
17696
|
}),
|
|
17688
17697
|
[fe, R, Hc]
|
|
17689
|
-
), Ra =
|
|
17698
|
+
), Ra = Ee(
|
|
17690
17699
|
() => Wb(fe),
|
|
17691
|
-
[fe, $r, Qn, er, nr, or, Mi, Zi, qi, ca,
|
|
17700
|
+
[fe, $r, Qn, er, nr, or, Mi, Zi, qi, ca, Wt, Ie, aa, la, sa, Hi, Ki, vn, ft, Xr]
|
|
17692
17701
|
), Kc = K(
|
|
17693
17702
|
(s) => {
|
|
17694
17703
|
if (le || s.inputType !== "insertText" && s.inputType !== "insertReplacementText" || !s.data || !ay(it.current) && !Je.current && !ch(at.current) && !Bh({
|
|
17695
17704
|
color: dt.current,
|
|
17696
17705
|
backgroundColor: mt.current
|
|
17697
|
-
}) && !ry(
|
|
17706
|
+
}) && !ry($t.current))
|
|
17698
17707
|
return;
|
|
17699
17708
|
const m = B.current;
|
|
17700
17709
|
m && (s.preventDefault(), hy(
|
|
@@ -17707,10 +17716,10 @@ function mT({
|
|
|
17707
17716
|
backgroundColor: mt.current
|
|
17708
17717
|
},
|
|
17709
17718
|
at.current,
|
|
17710
|
-
|
|
17711
|
-
), it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null,
|
|
17719
|
+
$t.current
|
|
17720
|
+
), it.current = {}, Je.current = null, at.current = null, dt.current = null, mt.current = null, $t.current = null, Qe.current = null, ie(m, !0), O(), U());
|
|
17712
17721
|
},
|
|
17713
|
-
[le,
|
|
17722
|
+
[le, ce, O, U]
|
|
17714
17723
|
), $c = K(
|
|
17715
17724
|
(s) => {
|
|
17716
17725
|
if (le || !Bg(s, Gs.current)) return;
|
|
@@ -17741,7 +17750,7 @@ function mT({
|
|
|
17741
17750
|
visualEl: m,
|
|
17742
17751
|
htmlEl: Xe.current
|
|
17743
17752
|
});
|
|
17744
|
-
|
|
17753
|
+
Me.current = J, oa({
|
|
17745
17754
|
open: !0,
|
|
17746
17755
|
x: s.clientX,
|
|
17747
17756
|
y: s.clientY,
|
|
@@ -17759,7 +17768,7 @@ function mT({
|
|
|
17759
17768
|
const F = Nu(m, s.target);
|
|
17760
17769
|
if (F) {
|
|
17761
17770
|
const W = F.getAttribute("data-comment-thread");
|
|
17762
|
-
W &&
|
|
17771
|
+
W && Nt(W);
|
|
17763
17772
|
return;
|
|
17764
17773
|
}
|
|
17765
17774
|
}
|
|
@@ -17825,27 +17834,27 @@ function mT({
|
|
|
17825
17834
|
}
|
|
17826
17835
|
m === "p" && !s.shiftKey && (s.preventDefault(), Tn.print());
|
|
17827
17836
|
},
|
|
17828
|
-
[le, bo, yo, fe, Tn, V,
|
|
17837
|
+
[le, bo, yo, fe, Tn, V, ce, O, U, Ct]
|
|
17829
17838
|
), bp = K(
|
|
17830
17839
|
(s) => {
|
|
17831
17840
|
if (s.key === "Escape" && wt) {
|
|
17832
|
-
s.preventDefault(),
|
|
17841
|
+
s.preventDefault(), Nt(null);
|
|
17833
17842
|
return;
|
|
17834
17843
|
}
|
|
17835
17844
|
Wc(s);
|
|
17836
17845
|
},
|
|
17837
17846
|
[wt, Wc]
|
|
17838
|
-
), yp = [we.root, Ja(vn).className,
|
|
17847
|
+
), yp = [we.root, Ja(vn).className, Et ? we.fullscreen : "", h].filter(Boolean).join(" "), wp = oT({
|
|
17839
17848
|
toolbarBackground: k,
|
|
17840
17849
|
menuColor: S,
|
|
17841
17850
|
menuBackground: x,
|
|
17842
17851
|
menuFontSize: L,
|
|
17843
17852
|
menuFontFamily: E,
|
|
17844
17853
|
border: P
|
|
17845
|
-
}), Cp = Ja(vn)["data-wysiwyg-theme"], vp =
|
|
17854
|
+
}), Cp = Ja(vn)["data-wysiwyg-theme"], vp = Ee(() => {
|
|
17846
17855
|
if (!(Ae !== "visual" || Vi === 1))
|
|
17847
17856
|
return { transform: `scale(${Vi})` };
|
|
17848
|
-
}, [Ae, Vi]), Gc = Ae === "visual" ?
|
|
17857
|
+
}, [Ae, Vi]), Gc = Ae === "visual" ? xe ? /* @__PURE__ */ a(
|
|
17849
17858
|
rT,
|
|
17850
17859
|
{
|
|
17851
17860
|
ref: Fr,
|
|
@@ -17858,10 +17867,10 @@ function mT({
|
|
|
17858
17867
|
m instanceof HTMLDivElement && (B.current = m);
|
|
17859
17868
|
},
|
|
17860
17869
|
onPageChange: (s, m) => {
|
|
17861
|
-
const v = tt(
|
|
17870
|
+
const v = tt(se.current)[s] ?? "";
|
|
17862
17871
|
pa(
|
|
17863
17872
|
s,
|
|
17864
|
-
|
|
17873
|
+
kt(m, De(v).body),
|
|
17865
17874
|
!0
|
|
17866
17875
|
);
|
|
17867
17876
|
},
|
|
@@ -17878,7 +17887,7 @@ function mT({
|
|
|
17878
17887
|
nT,
|
|
17879
17888
|
{
|
|
17880
17889
|
ref: B,
|
|
17881
|
-
html:
|
|
17890
|
+
html: De(_e).body,
|
|
17882
17891
|
onChange: (s) => mp(s, !0),
|
|
17883
17892
|
onBeforeInput: Kc,
|
|
17884
17893
|
onPointerDown: Uc,
|
|
@@ -17902,7 +17911,7 @@ function mT({
|
|
|
17902
17911
|
{
|
|
17903
17912
|
className: yp,
|
|
17904
17913
|
style: wp,
|
|
17905
|
-
"data-fullscreen":
|
|
17914
|
+
"data-fullscreen": Et ? "" : void 0,
|
|
17906
17915
|
"data-wysiwyg-theme": Cp,
|
|
17907
17916
|
"data-toolbar-position": ft,
|
|
17908
17917
|
"data-comments-visible": Ve && yt ? "" : void 0,
|
|
@@ -17973,7 +17982,7 @@ function mT({
|
|
|
17973
17982
|
]
|
|
17974
17983
|
}
|
|
17975
17984
|
),
|
|
17976
|
-
|
|
17985
|
+
Et ? /* @__PURE__ */ a(iT, { onClick: () => Yn(!1) }) : null,
|
|
17977
17986
|
/* @__PURE__ */ a(
|
|
17978
17987
|
JP,
|
|
17979
17988
|
{
|
|
@@ -18015,7 +18024,7 @@ function mT({
|
|
|
18015
18024
|
fontColorMixed: nr.mixed,
|
|
18016
18025
|
highlightColor: or.value,
|
|
18017
18026
|
highlightColorMixed: or.mixed,
|
|
18018
|
-
fonts:
|
|
18027
|
+
fonts: Wt,
|
|
18019
18028
|
disabled: le,
|
|
18020
18029
|
onTabChange: (s) => jr({ open: !0, tab: s }),
|
|
18021
18030
|
onApply: (s) => fe.applyFontProperties(s),
|
|
@@ -18050,7 +18059,7 @@ function mT({
|
|
|
18050
18059
|
open: sn.open,
|
|
18051
18060
|
tab: sn.tab,
|
|
18052
18061
|
value: sn.value,
|
|
18053
|
-
fonts:
|
|
18062
|
+
fonts: Wt,
|
|
18054
18063
|
disabled: le,
|
|
18055
18064
|
customImagePicker: re,
|
|
18056
18065
|
onCustomImagePick: () => {
|
|
@@ -18073,8 +18082,8 @@ function mT({
|
|
|
18073
18082
|
onResetAtRule: () => {
|
|
18074
18083
|
const s = B.current;
|
|
18075
18084
|
if (!s || $.current !== "visual") return;
|
|
18076
|
-
const m = $e.current ? tt(
|
|
18077
|
-
v.changed && (
|
|
18085
|
+
const m = $e.current ? tt(se.current)[Kt.current] ?? "" : De(se.current).body, v = xw(s, m);
|
|
18086
|
+
v.changed && (ce(De(v.pageHtml).body, !1), kn((F) => ({
|
|
18078
18087
|
...F,
|
|
18079
18088
|
value: {
|
|
18080
18089
|
...F.value,
|
|
@@ -18095,14 +18104,14 @@ function mT({
|
|
|
18095
18104
|
font: Le.open ? Le.mode === "edit" ? Le.style.font : Le.font : {
|
|
18096
18105
|
size: null,
|
|
18097
18106
|
unit: mn,
|
|
18098
|
-
marks:
|
|
18107
|
+
marks: Ht(),
|
|
18099
18108
|
fontFamily: null,
|
|
18100
18109
|
fontColor: null,
|
|
18101
18110
|
highlightColor: null
|
|
18102
18111
|
},
|
|
18103
18112
|
paragraph: Le.open ? Le.mode === "edit" ? Le.style.paragraph : Le.paragraph : void 0,
|
|
18104
18113
|
canDelete: !!ne,
|
|
18105
|
-
fonts:
|
|
18114
|
+
fonts: Wt,
|
|
18106
18115
|
busy: lp,
|
|
18107
18116
|
disabled: le,
|
|
18108
18117
|
onSave: async (s) => {
|
|
@@ -18268,7 +18277,7 @@ function mT({
|
|
|
18268
18277
|
disabled: y,
|
|
18269
18278
|
commentAuthor: Ir,
|
|
18270
18279
|
onPost: hp,
|
|
18271
|
-
onClose: () =>
|
|
18280
|
+
onClose: () => Nt(null)
|
|
18272
18281
|
}
|
|
18273
18282
|
) : null,
|
|
18274
18283
|
/* @__PURE__ */ a(
|
|
@@ -18345,7 +18354,7 @@ function fT(e) {
|
|
|
18345
18354
|
export {
|
|
18346
18355
|
mT as Editor,
|
|
18347
18356
|
Qa as PAGE_SEPARATOR,
|
|
18348
|
-
|
|
18357
|
+
Ft as joinPagesToHtml,
|
|
18349
18358
|
tt as splitPagesFromHtml,
|
|
18350
18359
|
fT as stripCommentAnchors
|
|
18351
18360
|
};
|