@tryghost/koenig-lexical 0.0.34 → 0.0.35
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/koenig-lexical.js +421 -429
- package/dist/koenig-lexical.js.map +1 -1
- package/dist/koenig-lexical.umd.js +26 -26
- package/dist/koenig-lexical.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/koenig-lexical.js
CHANGED
|
@@ -2,7 +2,7 @@ var mu = Object.defineProperty;
|
|
|
2
2
|
var _u = (t, e, n) => e in t ? mu(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var xe = (t, e, n) => (_u(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
4
|
import * as v from "react";
|
|
5
|
-
import R, { useState as uo, useEffect as
|
|
5
|
+
import R, { useState as uo, useEffect as nr } from "react";
|
|
6
6
|
import vu, { createPortal as Cu } from "react-dom";
|
|
7
7
|
const Cl = (t) => /* @__PURE__ */ v.createElement("svg", {
|
|
8
8
|
width: 16,
|
|
@@ -123,7 +123,7 @@ const Cl = (t) => /* @__PURE__ */ v.createElement("svg", {
|
|
|
123
123
|
}, /* @__PURE__ */ v.createElement("path", {
|
|
124
124
|
d: "M9 7h5c.552 0 1 .448 1 1s-.448 1-1 1H9v5c0 .552-.448 1-1 1s-1-.448-1-1V9H2c-.552 0-1-.448-1-1s.448-1 1-1h5V2c0-.552.448-1 1-1s1 .448 1 1v5z",
|
|
125
125
|
fillRule: "nonzero"
|
|
126
|
-
})),
|
|
126
|
+
})), Gn = (t) => /* @__PURE__ */ v.createElement("svg", {
|
|
127
127
|
width: 16,
|
|
128
128
|
height: 16,
|
|
129
129
|
viewBox: "0 0 16 16",
|
|
@@ -787,7 +787,7 @@ function Gu(t) {
|
|
|
787
787
|
});
|
|
788
788
|
}), n;
|
|
789
789
|
}
|
|
790
|
-
var
|
|
790
|
+
var vr = { exports: {} }, Cr = {};
|
|
791
791
|
/**
|
|
792
792
|
* @license React
|
|
793
793
|
* react-jsx-runtime.production.min.js
|
|
@@ -808,18 +808,18 @@ function kl(t, e, n) {
|
|
|
808
808
|
i[r] === void 0 && (i[r] = e[r]);
|
|
809
809
|
return { $$typeof: Zu, type: t, key: o, ref: l, props: i, _owner: Qu.current };
|
|
810
810
|
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
811
|
+
Cr.Fragment = Ju;
|
|
812
|
+
Cr.jsx = kl;
|
|
813
|
+
Cr.jsxs = kl;
|
|
814
814
|
(function(t) {
|
|
815
|
-
t.exports =
|
|
816
|
-
})(
|
|
817
|
-
const
|
|
815
|
+
t.exports = Cr;
|
|
816
|
+
})(vr);
|
|
817
|
+
const wn = vr.exports.Fragment, f = vr.exports.jsx, Y = vr.exports.jsxs, ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
818
818
|
__proto__: null,
|
|
819
|
-
Fragment:
|
|
819
|
+
Fragment: wn,
|
|
820
820
|
jsx: f,
|
|
821
821
|
jsxs: Y
|
|
822
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
822
|
+
}, Symbol.toStringTag, { value: "Module" })), l0 = () => {
|
|
823
823
|
return /* @__PURE__ */ Y("div", {
|
|
824
824
|
className: "koenig-lexical",
|
|
825
825
|
children: [/* @__PURE__ */ f(t, {
|
|
@@ -887,7 +887,7 @@ const Cr = _r.exports.Fragment, f = _r.exports.jsx, Y = _r.exports.jsxs, ec = /*
|
|
|
887
887
|
Icon: ei
|
|
888
888
|
}), /* @__PURE__ */ f(o, {}), /* @__PURE__ */ f(i, {
|
|
889
889
|
label: "Save as snippet",
|
|
890
|
-
Icon:
|
|
890
|
+
Icon: Gn
|
|
891
891
|
})]
|
|
892
892
|
})
|
|
893
893
|
});
|
|
@@ -914,7 +914,7 @@ const Cr = _r.exports.Fragment, f = _r.exports.jsx, Y = _r.exports.jsxs, ec = /*
|
|
|
914
914
|
Icon: Rl
|
|
915
915
|
}), /* @__PURE__ */ f(o, {}), /* @__PURE__ */ f(i, {
|
|
916
916
|
label: "Save as snippet",
|
|
917
|
-
Icon:
|
|
917
|
+
Icon: Gn
|
|
918
918
|
})]
|
|
919
919
|
})
|
|
920
920
|
});
|
|
@@ -929,7 +929,7 @@ const Cr = _r.exports.Fragment, f = _r.exports.jsx, Y = _r.exports.jsxs, ec = /*
|
|
|
929
929
|
Icon: Ol
|
|
930
930
|
}), /* @__PURE__ */ f(o, {}), /* @__PURE__ */ f(i, {
|
|
931
931
|
label: "Save as snippet",
|
|
932
|
-
Icon:
|
|
932
|
+
Icon: Gn
|
|
933
933
|
})]
|
|
934
934
|
})
|
|
935
935
|
});
|
|
@@ -1267,7 +1267,7 @@ yr.useLexicalComposerContext = function() {
|
|
|
1267
1267
|
};
|
|
1268
1268
|
const tc = yr;
|
|
1269
1269
|
var ge = tc, O = {};
|
|
1270
|
-
let Pl = {}, bl = {}, fn = {}, rn = {}, ni = {}, At = {}, $i = {}, ri = {}, hn = {}, pn = {}, tt = {}, Ai = {}, Mi = {}, Fl = {}, Bl = {}, zl = {}, Hl = {}, Kl = {}, Wl = {},
|
|
1270
|
+
let Pl = {}, bl = {}, fn = {}, rn = {}, ni = {}, At = {}, $i = {}, ri = {}, hn = {}, pn = {}, tt = {}, Ai = {}, Mi = {}, Fl = {}, Bl = {}, zl = {}, Hl = {}, Kl = {}, Wl = {}, rr = {}, Ul = {}, Vl = {}, Yl = {}, Gl = {}, jl = {}, Zl = {}, Jl = {}, Xl = {}, Ql = {}, ki = {}, Di = {}, ql = {}, es = {}, ts = {};
|
|
1271
1271
|
function D(t) {
|
|
1272
1272
|
throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?code=${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
1273
1273
|
}
|
|
@@ -1293,7 +1293,7 @@ function ns(t, e, n) {
|
|
|
1293
1293
|
var o = /* @__PURE__ */ new Map(), l = t.getRootElement(), s = t._editorState;
|
|
1294
1294
|
let a = !1, u = "";
|
|
1295
1295
|
for (var c = 0; c < e.length; c++) {
|
|
1296
|
-
var d = e[c], g = d.type, m = d.target, h =
|
|
1296
|
+
var d = e[c], g = d.type, m = d.target, h = Rn(m, s);
|
|
1297
1297
|
if (!(h === null && m !== l || ne(h))) {
|
|
1298
1298
|
if (g === "characterData") {
|
|
1299
1299
|
if (d = r && I(h))
|
|
@@ -1364,7 +1364,7 @@ function Tr(t, e, n) {
|
|
|
1364
1364
|
var i;
|
|
1365
1365
|
if (i = r !== null && r.contains(e) && r.contains(n) && e !== null) {
|
|
1366
1366
|
let o = document.activeElement, l = o !== null ? o.nodeName : null;
|
|
1367
|
-
i = !ne(
|
|
1367
|
+
i = !ne(Rn(e)) || l !== "INPUT" && l !== "TEXTAREA";
|
|
1368
1368
|
}
|
|
1369
1369
|
return i && os(e) === t;
|
|
1370
1370
|
} catch {
|
|
@@ -1383,7 +1383,7 @@ function os(t) {
|
|
|
1383
1383
|
function oi(t) {
|
|
1384
1384
|
return t.isToken() || t.isSegmented();
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function ir(t) {
|
|
1387
1387
|
for (; t != null; ) {
|
|
1388
1388
|
if (t.nodeType === 3)
|
|
1389
1389
|
return t;
|
|
@@ -1397,7 +1397,7 @@ function ls(t, e, n) {
|
|
|
1397
1397
|
function ss(t) {
|
|
1398
1398
|
return I(t) || xn(t) || ne(t);
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1400
|
+
function jn(t) {
|
|
1401
1401
|
var e = t.getParent();
|
|
1402
1402
|
if (e !== null) {
|
|
1403
1403
|
e = e.getWritable().__children;
|
|
@@ -1441,7 +1441,7 @@ function as(t, e) {
|
|
|
1441
1441
|
let n = ae();
|
|
1442
1442
|
return t = t[`__lexicalKey_${n._key}`], t !== void 0 ? J(t, e) : null;
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1444
|
+
function Rn(t, e) {
|
|
1445
1445
|
for (; t != null; ) {
|
|
1446
1446
|
let n = as(t, e);
|
|
1447
1447
|
if (n !== null)
|
|
@@ -1508,7 +1508,7 @@ function gs(t, e) {
|
|
|
1508
1508
|
var n = Se ? window.getSelection() : null;
|
|
1509
1509
|
if (n !== null) {
|
|
1510
1510
|
var r = n.anchorNode, { anchorOffset: i, focusOffset: o } = n;
|
|
1511
|
-
if (r !== null && r.nodeType === 3 && (n =
|
|
1511
|
+
if (r !== null && r.nodeType === 3 && (n = Rn(r), I(n))) {
|
|
1512
1512
|
if (r = r.nodeValue, r === Nr && e) {
|
|
1513
1513
|
let l = e.length;
|
|
1514
1514
|
r = e, o = i = l;
|
|
@@ -1534,7 +1534,7 @@ function Pi(t, e, n, r, i) {
|
|
|
1534
1534
|
}, 20);
|
|
1535
1535
|
}
|
|
1536
1536
|
else
|
|
1537
|
-
i = o.getParent(), e =
|
|
1537
|
+
i = o.getParent(), e = $n(), o.isToken() || nt() !== null && !l || i !== null && z(e) && !i.canInsertTextBefore() && e.anchor.offset === 0 ? o.markDirty() : (l = j(), z(l) && n !== null && r !== null && (l.setTextNodeRange(o, n, o, r), o.isSegmented() && (n = o.getTextContent(), n = fe(n), o.replace(n), o = n)), o.setTextContent(t));
|
|
1538
1538
|
}
|
|
1539
1539
|
}
|
|
1540
1540
|
function mc(t, e) {
|
|
@@ -1551,7 +1551,7 @@ function fs(t, e) {
|
|
|
1551
1551
|
var o = Se ? window.getSelection() : null;
|
|
1552
1552
|
o = o !== null ? o.anchorNode : null;
|
|
1553
1553
|
let l = n.key, s = ae().getElementByKey(l), a = e.length;
|
|
1554
|
-
return l !== r.key || !I(i) || (2 > a || cs(e)) && n.offset !== r.offset && !i.isComposing() || oi(i) || i.isDirty() && 1 < a || s !== null && !i.isComposing() && o !==
|
|
1554
|
+
return l !== r.key || !I(i) || (2 > a || cs(e)) && n.offset !== r.offset && !i.isComposing() || oi(i) || i.isDirty() && 1 < a || s !== null && !i.isComposing() && o !== ir(s) || i.getFormat() !== t.format || mc(t, i);
|
|
1555
1555
|
}
|
|
1556
1556
|
function on(t, e) {
|
|
1557
1557
|
var n = t[e];
|
|
@@ -1574,16 +1574,16 @@ function ps(t) {
|
|
|
1574
1574
|
function li(t) {
|
|
1575
1575
|
return !ze(t) && !t.isLastChild() && !t.isInline();
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function or(t, e) {
|
|
1578
1578
|
return t = t._keyToDOMMap.get(e), t === void 0 && D(75), t;
|
|
1579
1579
|
}
|
|
1580
1580
|
function _c(t, e = 0) {
|
|
1581
1581
|
if (e !== 0 && D(1), e = j(), !z(e) || !A(t))
|
|
1582
1582
|
return e;
|
|
1583
1583
|
let { anchor: n, focus: r } = e, i = n.getNode(), o = r.getNode();
|
|
1584
|
-
return
|
|
1584
|
+
return lr(i, t) && n.set(t.__key, 0, "element"), lr(o, t) && r.set(t.__key, 0, "element"), e;
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function lr(t, e) {
|
|
1587
1587
|
for (t = t.getParent(); t !== null; ) {
|
|
1588
1588
|
if (t.is(e))
|
|
1589
1589
|
return !0;
|
|
@@ -1663,8 +1663,8 @@ function _o(t) {
|
|
|
1663
1663
|
t.set(e.__key, n ? e.getChildrenSize() : 0, "element");
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
1666
|
-
let ce = "", Ne = "", je = "", _t, Te, mn, ys = !1, Fi = !1, wr,
|
|
1667
|
-
function
|
|
1666
|
+
let ce = "", Ne = "", je = "", _t, Te, mn, ys = !1, Fi = !1, wr, Zn = null, si, ai, _n, Pt, ui, vn;
|
|
1667
|
+
function Jn(t, e) {
|
|
1668
1668
|
let n = _n.get(t);
|
|
1669
1669
|
if (e !== null) {
|
|
1670
1670
|
let r = gi(t);
|
|
@@ -1675,7 +1675,7 @@ function Zn(t, e) {
|
|
|
1675
1675
|
function ci(t, e, n, r) {
|
|
1676
1676
|
for (; e <= n; ++e) {
|
|
1677
1677
|
let i = t[e];
|
|
1678
|
-
i !== void 0 &&
|
|
1678
|
+
i !== void 0 && Jn(i, r);
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
function Zt(t, e) {
|
|
@@ -1687,7 +1687,7 @@ function Es(t, e) {
|
|
|
1687
1687
|
function xs(t, e) {
|
|
1688
1688
|
t = t.style, e === 0 ? Zt(t, "") : e === 1 ? Zt(t, "left") : e === 2 ? Zt(t, "center") : e === 3 ? Zt(t, "right") : e === 4 && Zt(t, "justify");
|
|
1689
1689
|
}
|
|
1690
|
-
function
|
|
1690
|
+
function Xn(t, e, n) {
|
|
1691
1691
|
let r = Pt.get(t);
|
|
1692
1692
|
r === void 0 && D(60);
|
|
1693
1693
|
let i = r.createDOM(_t, Te);
|
|
@@ -1712,7 +1712,7 @@ function Jn(t, e, n) {
|
|
|
1712
1712
|
function di(t, e, n, r, i) {
|
|
1713
1713
|
let o = ce;
|
|
1714
1714
|
for (ce = ""; e <= n; ++e)
|
|
1715
|
-
|
|
1715
|
+
Xn(t[e], r, i);
|
|
1716
1716
|
r.__lexicalTextContent = ce, ce = o + ce;
|
|
1717
1717
|
}
|
|
1718
1718
|
function vo(t, e) {
|
|
@@ -1723,10 +1723,10 @@ function Ns(t, e, n) {
|
|
|
1723
1723
|
}
|
|
1724
1724
|
function Ts(t, e) {
|
|
1725
1725
|
var n = e.__lexicalDir;
|
|
1726
|
-
if (e.__lexicalDirTextContent !== Ne || n !==
|
|
1726
|
+
if (e.__lexicalDirTextContent !== Ne || n !== Zn) {
|
|
1727
1727
|
let o = Ne === "";
|
|
1728
1728
|
if (o)
|
|
1729
|
-
var r =
|
|
1729
|
+
var r = Zn;
|
|
1730
1730
|
else
|
|
1731
1731
|
r = Ne, r = oc.test(r) ? "rtl" : lc.test(r) ? "ltr" : null;
|
|
1732
1732
|
if (r !== n) {
|
|
@@ -1735,18 +1735,18 @@ function Ts(t, e) {
|
|
|
1735
1735
|
let a = r !== null ? s[r] : void 0;
|
|
1736
1736
|
i !== void 0 && (typeof i == "string" && (i = i.split(" "), i = s[n] = i), l.remove(...i)), r === null || o && r === "ltr" ? e.removeAttribute("dir") : (a !== void 0 && (typeof a == "string" && (n = a.split(" "), a = s[r] = n), a !== void 0 && l.add(...a)), e.dir = r), Fi || (t.getWritable().__dir = r);
|
|
1737
1737
|
}
|
|
1738
|
-
|
|
1738
|
+
Zn = r, e.__lexicalDirTextContent = Ne, e.__lexicalDir = r;
|
|
1739
1739
|
}
|
|
1740
1740
|
}
|
|
1741
1741
|
function Qt(t, e) {
|
|
1742
1742
|
var n = _n.get(t), r = Pt.get(t);
|
|
1743
1743
|
n !== void 0 && r !== void 0 || D(61);
|
|
1744
1744
|
var i = ys || ai.has(t) || si.has(t);
|
|
1745
|
-
let o =
|
|
1745
|
+
let o = or(Te, t);
|
|
1746
1746
|
if (n === r && !i)
|
|
1747
1747
|
return A(n) ? (r = o.__lexicalTextContent, r !== void 0 && (ce += r, je += r), r = o.__lexicalDirTextContent, r !== void 0 && (Ne += r)) : (r = n.getTextContent(), I(n) && !n.isDirectionless() && (Ne += r), je += r, ce += r), o;
|
|
1748
1748
|
if (n !== r && i && bi(vn, mn, wr, r, "updated"), r.updateDOM(n, o, _t))
|
|
1749
|
-
return r =
|
|
1749
|
+
return r = Xn(t, null, null), e === null && D(62), e.replaceChild(r, o), Jn(t, null), r;
|
|
1750
1750
|
if (A(n) && A(r)) {
|
|
1751
1751
|
if (t = r.__indent, t !== n.__indent && Es(o, t), t = r.__format, t !== n.__format && xs(o, t), t = n.__children, n = r.__children, t !== n || i) {
|
|
1752
1752
|
var l = t, s = n;
|
|
@@ -1760,7 +1760,7 @@ function Qt(t, e) {
|
|
|
1760
1760
|
Qt(c, o);
|
|
1761
1761
|
else {
|
|
1762
1762
|
var d = gi(c);
|
|
1763
|
-
s =
|
|
1763
|
+
s = Xn(s, null, null), o.replaceChild(s, d), Jn(c, null);
|
|
1764
1764
|
}
|
|
1765
1765
|
} else if (a === 0)
|
|
1766
1766
|
u !== 0 && di(s, 0, u - 1, o, null);
|
|
@@ -1778,7 +1778,7 @@ function Qt(t, e) {
|
|
|
1778
1778
|
else {
|
|
1779
1779
|
c === void 0 && (c = new Set(l)), d === void 0 && (d = new Set(s));
|
|
1780
1780
|
let p = d.has(g), _ = c.has(S);
|
|
1781
|
-
p ? (_ ? (g =
|
|
1781
|
+
p ? (_ ? (g = or(Te, S), g === C ? C = Qt(S, o).nextSibling : (C != null ? o.insertBefore(g, C) : o.appendChild(g), Qt(S, o)), N++) : Xn(S, o, C), u++) : (C = gi(g).nextSibling, Jn(g, o), N++);
|
|
1782
1782
|
}
|
|
1783
1783
|
}
|
|
1784
1784
|
c = N > h, d = u > a, c && !d ? (c = s[a + 1], c = c === void 0 ? null : Te.getElementByKey(c), di(s, u, a, o, c)) : d && !c && ci(l, N, h, o);
|
|
@@ -1846,7 +1846,7 @@ function yo(t, e, n) {
|
|
|
1846
1846
|
}
|
|
1847
1847
|
function Cc(t, e) {
|
|
1848
1848
|
Me(e, () => {
|
|
1849
|
-
let n = j(), r = Se ? window.getSelection() : null, i =
|
|
1849
|
+
let n = j(), r = Se ? window.getSelection() : null, i = $n();
|
|
1850
1850
|
if (z(n)) {
|
|
1851
1851
|
let o = n.anchor, l = o.getNode();
|
|
1852
1852
|
r && o.type === "element" && o.offset === 0 && n.isCollapsed() && !ze(l) && st().getChildrenSize() === 1 && l.getTopLevelElementOrThrow().isEmpty() && i !== null && n.is(i) && (r.removeAllRanges(), n.dirty = !0);
|
|
@@ -1857,7 +1857,7 @@ function Cc(t, e) {
|
|
|
1857
1857
|
function yc(t, e) {
|
|
1858
1858
|
let n = t.target;
|
|
1859
1859
|
n instanceof Node && Me(e, () => {
|
|
1860
|
-
ne(
|
|
1860
|
+
ne(Rn(n)) || (pi = !0);
|
|
1861
1861
|
});
|
|
1862
1862
|
}
|
|
1863
1863
|
function Ec(t, e) {
|
|
@@ -1872,7 +1872,7 @@ function Nc(t, e) {
|
|
|
1872
1872
|
let r = j();
|
|
1873
1873
|
if (n === "deleteContentBackward") {
|
|
1874
1874
|
if (r === null) {
|
|
1875
|
-
var i =
|
|
1875
|
+
var i = $n();
|
|
1876
1876
|
if (!z(i))
|
|
1877
1877
|
return;
|
|
1878
1878
|
Ft(i.clone());
|
|
@@ -1987,12 +1987,12 @@ function mi(t, e) {
|
|
|
1987
1987
|
var n = t._compositionKey;
|
|
1988
1988
|
if (he(null), n !== null && e != null) {
|
|
1989
1989
|
if (e === "") {
|
|
1990
|
-
e = J(n), t =
|
|
1990
|
+
e = J(n), t = ir(t.getElementByKey(n)), t !== null && t.nodeValue !== null && I(e) && Pi(e, t.nodeValue, null, null, !0);
|
|
1991
1991
|
return;
|
|
1992
1992
|
}
|
|
1993
1993
|
if (e[e.length - 1] === `
|
|
1994
1994
|
` && (n = j(), z(n))) {
|
|
1995
|
-
e = n.focus, n.anchor.set(e.key, e.offset, e.type), k(t,
|
|
1995
|
+
e = n.focus, n.anchor.set(e.key, e.offset, e.type), k(t, rr, null);
|
|
1996
1996
|
return;
|
|
1997
1997
|
}
|
|
1998
1998
|
}
|
|
@@ -2013,16 +2013,16 @@ function Rc(t, e) {
|
|
|
2013
2013
|
if (n !== 38 || i || o)
|
|
2014
2014
|
if (n !== 40 || i || o)
|
|
2015
2015
|
if (n === 13 && r)
|
|
2016
|
-
sn = !0, k(e,
|
|
2016
|
+
sn = !0, k(e, rr, t);
|
|
2017
2017
|
else if (n === 32)
|
|
2018
2018
|
k(e, Ul, t);
|
|
2019
2019
|
else if (we && i && n === 79)
|
|
2020
2020
|
t.preventDefault(), sn = !0, k(e, rn, !0);
|
|
2021
2021
|
else if (n !== 13 || r) {
|
|
2022
2022
|
var s = we ? l || o ? !1 : n === 8 || n === 72 && i : i || l || o ? !1 : n === 8;
|
|
2023
|
-
s ? n === 8 ? k(e, Vl, t) : (t.preventDefault(), k(e, fn, !0)) : n === 27 ? k(e, Yl, t) : (s = we ? r || l || o ? !1 : n === 46 || n === 68 && i : i || l || o ? !1 : n === 46, s ? n === 46 ? k(e, Gl, t) : (t.preventDefault(), k(e, fn, !1)) : n === 8 && (we ? l : i) ? (t.preventDefault(), k(e, hn, !0)) : n === 46 && (we ? l : i) ? (t.preventDefault(), k(e, hn, !1)) : we && o && n === 8 ? (t.preventDefault(), k(e, pn, !0)) : we && o && n === 46 ? (t.preventDefault(), k(e, pn, !1)) : n === 66 && !l && (we ? o : i) ? (t.preventDefault(), k(e, tt, "bold")) : n === 85 && !l && (we ? o : i) ? (t.preventDefault(), k(e, tt, "underline")) : n === 73 && !l && (we ? o : i) ? (t.preventDefault(), k(e, tt, "italic")) : n !== 9 || l || i || o ? n === 90 && !r && (we ? o : i) ? (t.preventDefault(), k(e, Ai, void 0)) : (s = we ? n === 90 && o && r : n === 89 && i || n === 90 && i && r, s ? (t.preventDefault(), k(e, Mi, void 0)) :
|
|
2023
|
+
s ? n === 8 ? k(e, Vl, t) : (t.preventDefault(), k(e, fn, !0)) : n === 27 ? k(e, Yl, t) : (s = we ? r || l || o ? !1 : n === 46 || n === 68 && i : i || l || o ? !1 : n === 46, s ? n === 46 ? k(e, Gl, t) : (t.preventDefault(), k(e, fn, !1)) : n === 8 && (we ? l : i) ? (t.preventDefault(), k(e, hn, !0)) : n === 46 && (we ? l : i) ? (t.preventDefault(), k(e, hn, !1)) : we && o && n === 8 ? (t.preventDefault(), k(e, pn, !0)) : we && o && n === 46 ? (t.preventDefault(), k(e, pn, !1)) : n === 66 && !l && (we ? o : i) ? (t.preventDefault(), k(e, tt, "bold")) : n === 85 && !l && (we ? o : i) ? (t.preventDefault(), k(e, tt, "underline")) : n === 73 && !l && (we ? o : i) ? (t.preventDefault(), k(e, tt, "italic")) : n !== 9 || l || i || o ? n === 90 && !r && (we ? o : i) ? (t.preventDefault(), k(e, Ai, void 0)) : (s = we ? n === 90 && o && r : n === 89 && i || n === 90 && i && r, s ? (t.preventDefault(), k(e, Mi, void 0)) : On(e._editorState._selection) && (s = r ? !1 : n === 67 ? we ? o : i : !1, s ? (t.preventDefault(), k(e, ki, t)) : (s = r ? !1 : n === 88 ? we ? o : i : !1, s && (t.preventDefault(), k(e, Di, t))))) : k(e, jl, t));
|
|
2024
2024
|
} else
|
|
2025
|
-
sn = !1, k(e,
|
|
2025
|
+
sn = !1, k(e, rr, t);
|
|
2026
2026
|
else
|
|
2027
2027
|
k(e, Wl, t);
|
|
2028
2028
|
else
|
|
@@ -2049,7 +2049,7 @@ function $s() {
|
|
|
2049
2049
|
var e = os(t.anchorNode);
|
|
2050
2050
|
if (e !== null) {
|
|
2051
2051
|
pi && (pi = !1, Me(e, () => {
|
|
2052
|
-
var l =
|
|
2052
|
+
var l = $n(), s = t.anchorNode;
|
|
2053
2053
|
s !== null && (s = s.nodeType, s === 1 || s === 3) && (l = Ls(l, t, e), Ft(l));
|
|
2054
2054
|
}));
|
|
2055
2055
|
var n = Ii(e);
|
|
@@ -2150,7 +2150,7 @@ class Rr {
|
|
|
2150
2150
|
this.dirty = !1, this._nodes = e, this._cachedNodes = null;
|
|
2151
2151
|
}
|
|
2152
2152
|
is(e) {
|
|
2153
|
-
if (!
|
|
2153
|
+
if (!On(e))
|
|
2154
2154
|
return !1;
|
|
2155
2155
|
let n = this._nodes, r = e._nodes;
|
|
2156
2156
|
return n.size === r.size && Array.from(n).every((i) => r.has(i));
|
|
@@ -2230,7 +2230,7 @@ class Or {
|
|
|
2230
2230
|
return this.focus.isBefore(this.anchor);
|
|
2231
2231
|
}
|
|
2232
2232
|
getCharacterOffsets() {
|
|
2233
|
-
return
|
|
2233
|
+
return Qn(this);
|
|
2234
2234
|
}
|
|
2235
2235
|
extract() {
|
|
2236
2236
|
return this.getNodes();
|
|
@@ -2314,7 +2314,7 @@ class Bt {
|
|
|
2314
2314
|
let e = this.getNodes();
|
|
2315
2315
|
if (e.length === 0)
|
|
2316
2316
|
return "";
|
|
2317
|
-
let n = e[0], r = e[e.length - 1], i = this.anchor.isBefore(this.focus), [o, l] =
|
|
2317
|
+
let n = e[0], r = e[e.length - 1], i = this.anchor.isBefore(this.focus), [o, l] = Qn(this), s = "", a = !0;
|
|
2318
2318
|
for (let u = 0; u < e.length; u++) {
|
|
2319
2319
|
let c = e[u];
|
|
2320
2320
|
if (A(c) && !c.isInline())
|
|
@@ -2560,13 +2560,13 @@ class Bt {
|
|
|
2560
2560
|
r.type === "element" && (r = r.getNode(), ze(r) && this.insertParagraph()), e ? this.insertNodes([n], !0) : this.insertNodes([n]) && n.selectNext(0, 0);
|
|
2561
2561
|
}
|
|
2562
2562
|
getCharacterOffsets() {
|
|
2563
|
-
return
|
|
2563
|
+
return Qn(this);
|
|
2564
2564
|
}
|
|
2565
2565
|
extract() {
|
|
2566
2566
|
var e = this.getNodes(), n = e.length, r = n - 1, i = this.anchor;
|
|
2567
2567
|
let o = this.focus;
|
|
2568
2568
|
var l = e[0];
|
|
2569
|
-
let s = e[r], [a, u] =
|
|
2569
|
+
let s = e[r], [a, u] = Qn(this);
|
|
2570
2570
|
return n === 0 ? [] : n === 1 ? I(l) && !this.isCollapsed() ? (e = a > u ? u : a, r = l.splitText(e, a > u ? a : u), e = e === 0 ? r[0] : r[1], e != null ? [e] : []) : [l] : (n = i.isBefore(o), I(l) && (i = n ? a : u, i === l.getTextContentSize() ? e.shift() : i !== 0 && ([, l] = l.splitText(i), e[0] = l)), I(s) && (l = s.getTextContent().length, n = n ? u : a, n === 0 ? e.pop() : n !== l && ([s] = s.splitText(n), e[r] = s)), e);
|
|
2571
2571
|
}
|
|
2572
2572
|
modify(e, n, r) {
|
|
@@ -2577,7 +2577,7 @@ class Bt {
|
|
|
2577
2577
|
l = this.getNodes(), e = [], r = !1;
|
|
2578
2578
|
for (let a = 0; a < l.length; a++) {
|
|
2579
2579
|
let u = l[a];
|
|
2580
|
-
|
|
2580
|
+
lr(u, s) ? e.push(u) : r = !0;
|
|
2581
2581
|
}
|
|
2582
2582
|
r && 0 < e.length && (n ? (n = e[0], A(n) ? n.selectStart() : n.getParentOrThrow().selectStart()) : (n = e[e.length - 1], A(n) ? n.selectEnd() : n.getParentOrThrow().selectEnd())), (i.anchorNode !== o.startContainer || i.anchorOffset !== o.startOffset) && (n = this.focus, l = this.anchor, i = l.key, o = l.offset, s = l.type, et(l, n.key, n.offset, n.type), et(n, i, o, s), this._cachedNodes = null);
|
|
2583
2583
|
}
|
|
@@ -2621,14 +2621,14 @@ class Bt {
|
|
|
2621
2621
|
this.isCollapsed() && this.modify("extend", e, "word"), this.removeText();
|
|
2622
2622
|
}
|
|
2623
2623
|
}
|
|
2624
|
-
function
|
|
2624
|
+
function On(t) {
|
|
2625
2625
|
return t instanceof Rr;
|
|
2626
2626
|
}
|
|
2627
2627
|
function No(t) {
|
|
2628
2628
|
let e = t.offset;
|
|
2629
2629
|
return t.type === "text" ? e : (t = t.getNode(), e === t.getChildrenSize() ? t.getTextContent().length : 0);
|
|
2630
2630
|
}
|
|
2631
|
-
function
|
|
2631
|
+
function Qn(t) {
|
|
2632
2632
|
let e = t.anchor;
|
|
2633
2633
|
return t = t.focus, e.type === "element" && t.type === "element" && e.key === t.key && e.offset === t.offset ? [0, 0] : [No(e), No(t)];
|
|
2634
2634
|
}
|
|
@@ -2686,7 +2686,7 @@ function Ds() {
|
|
|
2686
2686
|
}
|
|
2687
2687
|
function $c(t) {
|
|
2688
2688
|
let e = t.getEditorState()._selection, n = Se ? window.getSelection() : null;
|
|
2689
|
-
return
|
|
2689
|
+
return On(e) || Bi(e) ? e.clone() : Ls(e, n, t);
|
|
2690
2690
|
}
|
|
2691
2691
|
function Ls(t, e, n) {
|
|
2692
2692
|
var r = n._window;
|
|
@@ -2710,10 +2710,10 @@ function Ls(t, e, n) {
|
|
|
2710
2710
|
function j() {
|
|
2711
2711
|
return Ue()._selection;
|
|
2712
2712
|
}
|
|
2713
|
-
function
|
|
2713
|
+
function $n() {
|
|
2714
2714
|
return ae()._editorState._selection;
|
|
2715
2715
|
}
|
|
2716
|
-
function
|
|
2716
|
+
function sr(t, e, n, r = 1) {
|
|
2717
2717
|
var i = t.anchor, o = t.focus, l = i.getNode(), s = o.getNode();
|
|
2718
2718
|
if (e.is(l) || e.is(s))
|
|
2719
2719
|
if (l = e.__key, t.isCollapsed())
|
|
@@ -2746,7 +2746,7 @@ function Ac(t, e) {
|
|
|
2746
2746
|
n.type === "text" && (i = n.getNode(), i.selectionTransform(e, t)), r.type === "text" && (n = r.getNode(), i !== n && n.selectionTransform(e, t));
|
|
2747
2747
|
}
|
|
2748
2748
|
}
|
|
2749
|
-
function
|
|
2749
|
+
function ar(t, e, n, r, i) {
|
|
2750
2750
|
let o = null, l = 0, s = null;
|
|
2751
2751
|
r !== null ? (o = r.__key, I(r) ? (l = r.getTextContentSize(), s = "text") : A(r) && (l = r.getChildrenSize(), s = "element")) : i !== null && (o = i.__key, I(i) ? s = "text" : A(i) && (s = "element")), o !== null && s !== null ? t.set(o, l, s) : (l = e.getIndexWithinParent(), l === -1 && (l = n.getChildrenSize()), t.set(n.__key, l, "element"));
|
|
2752
2752
|
}
|
|
@@ -2823,7 +2823,7 @@ function ft(t) {
|
|
|
2823
2823
|
de = t, Ee = e, se = !1, t._updating = !0;
|
|
2824
2824
|
try {
|
|
2825
2825
|
var h = t._dirtyType, C = t._dirtyElements, N = t._dirtyLeaves;
|
|
2826
|
-
g.disconnect(), Ne = je = ce = "", ys = h === 2,
|
|
2826
|
+
g.disconnect(), Ne = je = ce = "", ys = h === 2, Zn = null, Te = t, _t = t._config, mn = t._nodes, wr = Te._listeners.mutation, si = C, ai = N, _n = i._nodeMap, Pt = e._nodeMap, Fi = e._readOnly, ui = new Map(t._keyToDOMMap);
|
|
2827
2827
|
var S = /* @__PURE__ */ new Map();
|
|
2828
2828
|
vn = S, Qt("root", null), vn = ui = _t = Pt = _n = ai = si = mn = Te = void 0, m = S;
|
|
2829
2829
|
} catch (q) {
|
|
@@ -2846,10 +2846,10 @@ function ft(t) {
|
|
|
2846
2846
|
let q = r.anchorNode, ie = r.focusNode, Nt = r.anchorOffset, te = r.focusOffset, oe = document.activeElement;
|
|
2847
2847
|
if (!h.has("collaboration") || oe === n)
|
|
2848
2848
|
if (z(l)) {
|
|
2849
|
-
var _ = l.anchor, w = l.focus, T = _.key, E = w.key, $ =
|
|
2849
|
+
var _ = l.anchor, w = l.focus, T = _.key, E = w.key, $ = or(t, T), L = or(t, E), M = _.offset, W = w.offset, b = l.format, H = l.isCollapsed();
|
|
2850
2850
|
s = $, E = L;
|
|
2851
2851
|
var ee = !1;
|
|
2852
|
-
if (_.type === "text" && (s =
|
|
2852
|
+
if (_.type === "text" && (s = ir($), ee = _.getNode().getFormat() !== b), w.type === "text" && (E = ir(L)), s !== null && E !== null) {
|
|
2853
2853
|
if (H && (o === null || ee || z(o) && o.format !== b)) {
|
|
2854
2854
|
var Q = performance.now();
|
|
2855
2855
|
Rs = [b, M, T, Q];
|
|
@@ -2871,8 +2871,8 @@ function ft(t) {
|
|
|
2871
2871
|
else if (0 > le.top)
|
|
2872
2872
|
Ie.scrollIntoView();
|
|
2873
2873
|
else {
|
|
2874
|
-
let
|
|
2875
|
-
Math.floor(le.bottom) > Math.floor(
|
|
2874
|
+
let Fn = n.getBoundingClientRect();
|
|
2875
|
+
Math.floor(le.bottom) > Math.floor(Fn.bottom) ? Ie.scrollIntoView(!1) : Math.floor(le.top) < Math.floor(Fn.top) && Ie.scrollIntoView();
|
|
2876
2876
|
}
|
|
2877
2877
|
h.add("scroll-into-view");
|
|
2878
2878
|
}
|
|
@@ -2972,7 +2972,7 @@ function Is(t, e, n) {
|
|
|
2972
2972
|
let m = l._nodeMap, h = g.focus.key;
|
|
2973
2973
|
m.get(g.anchor.key) !== void 0 && m.get(h) !== void 0 || D(19);
|
|
2974
2974
|
} else
|
|
2975
|
-
|
|
2975
|
+
On(g) && g._nodes.size === 0 && (l._selection = null);
|
|
2976
2976
|
} catch (d) {
|
|
2977
2977
|
d instanceof Error && t._onError(d), t._pendingEditorState = n, t._dirtyType = 2, t._cloneNotNeeded.clear(), t._dirtyLeaves = /* @__PURE__ */ new Set(), t._dirtyElements.clear(), ft(t);
|
|
2978
2978
|
return;
|
|
@@ -2995,9 +2995,9 @@ function _i(t, e, n) {
|
|
|
2995
2995
|
if (z(o) && e) {
|
|
2996
2996
|
var s = o.anchor;
|
|
2997
2997
|
let a = o.focus;
|
|
2998
|
-
s.key === r && (
|
|
2998
|
+
s.key === r && (ar(s, t, i, t.getPreviousSibling(), t.getNextSibling()), l = !0), a.key === r && (ar(a, t, i, t.getPreviousSibling(), t.getNextSibling()), l = !0);
|
|
2999
2999
|
}
|
|
3000
|
-
s = i.getWritable().__children, r = s.indexOf(r), r === -1 && D(31), Mt(t), s.splice(r, 1), t.getWritable().__parent = null, z(o) && e && !l &&
|
|
3000
|
+
s = i.getWritable().__children, r = s.indexOf(r), r === -1 && D(31), Mt(t), s.splice(r, 1), t.getWritable().__parent = null, z(o) && e && !l && sr(o, i, r, -1), n || it(i) || i.canBeEmpty() || !i.isEmpty() || _i(i, e), ze(i) && i.isEmpty() && i.selectEnd();
|
|
3001
3001
|
}
|
|
3002
3002
|
}
|
|
3003
3003
|
function Do(t) {
|
|
@@ -3229,7 +3229,7 @@ class $r {
|
|
|
3229
3229
|
replace(e) {
|
|
3230
3230
|
$e();
|
|
3231
3231
|
let n = this.__key;
|
|
3232
|
-
e = e.getWritable(),
|
|
3232
|
+
e = e.getWritable(), jn(e);
|
|
3233
3233
|
var r = this.getParentOrThrow(), i = r.getWritable().__children;
|
|
3234
3234
|
let o = i.indexOf(this.__key), l = e.__key;
|
|
3235
3235
|
return o === -1 && D(31), i.splice(o, 0, l), e.__parent = r.__key, _i(this, !1), Mt(e), i = j(), z(i) && (r = i.anchor, i = i.focus, r.key === n && Eo(r, e), i.key === n && Eo(i, e)), nt() === n && he(l), e;
|
|
@@ -3239,17 +3239,17 @@ class $r {
|
|
|
3239
3239
|
var n = this.getWritable(), r = e.getWritable(), i = r.getParent();
|
|
3240
3240
|
let o = j();
|
|
3241
3241
|
var l = e.getIndexWithinParent(), s = !1, a = !1;
|
|
3242
|
-
i !== null && (
|
|
3242
|
+
i !== null && (jn(r), z(o) && (a = i.__key, s = o.anchor, i = o.focus, s = s.type === "element" && s.key === a && s.offset === l + 1, a = i.type === "element" && i.key === a && i.offset === l + 1)), l = this.getParentOrThrow().getWritable(), i = r.__key, r.__parent = n.__parent;
|
|
3243
3243
|
let u = l.__children;
|
|
3244
|
-
return n = u.indexOf(n.__key), n === -1 && D(31), u.splice(n + 1, 0, i), Mt(r), z(o) && (
|
|
3244
|
+
return n = u.indexOf(n.__key), n === -1 && D(31), u.splice(n + 1, 0, i), Mt(r), z(o) && (sr(o, l, n + 1), r = l.__key, s && o.anchor.set(r, n + 2, "element"), a && o.focus.set(r, n + 2, "element")), e;
|
|
3245
3245
|
}
|
|
3246
3246
|
insertBefore(e) {
|
|
3247
3247
|
var n = this.getWritable(), r = e.getWritable();
|
|
3248
|
-
|
|
3248
|
+
jn(r);
|
|
3249
3249
|
let i = this.getParentOrThrow().getWritable(), o = r.__key;
|
|
3250
3250
|
r.__parent = n.__parent;
|
|
3251
3251
|
let l = i.__children;
|
|
3252
|
-
return n = l.indexOf(n.__key), n === -1 && D(31), l.splice(n, 0, o), Mt(r), r = j(), z(r) &&
|
|
3252
|
+
return n = l.indexOf(n.__key), n === -1 && D(31), l.splice(n, 0, o), Mt(r), r = j(), z(r) && sr(r, i, n), e;
|
|
3253
3253
|
}
|
|
3254
3254
|
selectPrevious(e, n) {
|
|
3255
3255
|
$e();
|
|
@@ -3445,7 +3445,7 @@ class xt extends $r {
|
|
|
3445
3445
|
var a = [];
|
|
3446
3446
|
for (let u = 0; u < s; u++) {
|
|
3447
3447
|
let c = r[u], d = c.getWritable();
|
|
3448
|
-
c.__key === o && D(76),
|
|
3448
|
+
c.__key === o && D(76), jn(d), d.__parent = o, a.push(d.__key);
|
|
3449
3449
|
}
|
|
3450
3450
|
if ((r = this.getChildAtIndex(e - 1)) && It(r), (o = this.getChildAtIndex(e + n)) && It(o), e === l.length ? (l.push(...a), e = []) : e = l.splice(
|
|
3451
3451
|
e,
|
|
@@ -3463,7 +3463,7 @@ class xt extends $r {
|
|
|
3463
3463
|
return !1;
|
|
3464
3464
|
};
|
|
3465
3465
|
let { anchor: d, focus: g } = n;
|
|
3466
|
-
for (a(d) &&
|
|
3466
|
+
for (a(d) && ar(d, d.getNode(), this, r, o), a(g) && ar(g, g.getNode(), this, r, o), a = e.length, n = 0; n < a; n++)
|
|
3467
3467
|
r = J(e[n]), r != null && (r.getWritable().__parent = null);
|
|
3468
3468
|
l.length !== 0 || this.canBeEmpty() || it(this) || this.remove();
|
|
3469
3469
|
}
|
|
@@ -3848,7 +3848,7 @@ class Kt extends $r {
|
|
|
3848
3848
|
}
|
|
3849
3849
|
o === i && he(S), c = C, h.__parent = u, a.push(h);
|
|
3850
3850
|
}
|
|
3851
|
-
return Mt(this), o = r.getWritable().__children, i = o.indexOf(i), e = a.map((N) => N.__key), s ? (o.splice(i, 0, ...e), this.remove()) : o.splice(i, 1, ...e), z(n) &&
|
|
3851
|
+
return Mt(this), o = r.getWritable().__children, i = o.indexOf(i), e = a.map((N) => N.__key), s ? (o.splice(i, 0, ...e), this.remove()) : o.splice(i, 1, ...e), z(n) && sr(n, r, i, l - 1), a;
|
|
3852
3852
|
}
|
|
3853
3853
|
mergeWithSibling(e) {
|
|
3854
3854
|
var n = e === this.getPreviousSibling();
|
|
@@ -4147,17 +4147,17 @@ O.$createRangeSelection = function() {
|
|
|
4147
4147
|
};
|
|
4148
4148
|
O.$createTextNode = fe;
|
|
4149
4149
|
O.$getDecoratorNode = hs;
|
|
4150
|
-
O.$getNearestNodeFromDOMNode =
|
|
4150
|
+
O.$getNearestNodeFromDOMNode = Rn;
|
|
4151
4151
|
O.$getNearestRootOrShadowRoot = ms;
|
|
4152
4152
|
O.$getNodeByKey = J;
|
|
4153
|
-
O.$getPreviousSelection =
|
|
4153
|
+
O.$getPreviousSelection = $n;
|
|
4154
4154
|
O.$getRoot = st;
|
|
4155
4155
|
O.$getSelection = j;
|
|
4156
4156
|
O.$getTextContent = function() {
|
|
4157
4157
|
let t = j();
|
|
4158
4158
|
return t === null ? "" : t.getTextContent();
|
|
4159
4159
|
};
|
|
4160
|
-
O.$hasAncestor =
|
|
4160
|
+
O.$hasAncestor = lr;
|
|
4161
4161
|
O.$insertNodes = function(t, e) {
|
|
4162
4162
|
let n = j();
|
|
4163
4163
|
return n === null && (n = st().selectEnd()), n.insertNodes(t, e);
|
|
@@ -4169,7 +4169,7 @@ O.$isInlineElementOrDecoratorNode = function(t) {
|
|
|
4169
4169
|
};
|
|
4170
4170
|
O.$isLeafNode = ss;
|
|
4171
4171
|
O.$isLineBreakNode = xn;
|
|
4172
|
-
O.$isNodeSelection =
|
|
4172
|
+
O.$isNodeSelection = On;
|
|
4173
4173
|
O.$isParagraphNode = function(t) {
|
|
4174
4174
|
return t instanceof Wt;
|
|
4175
4175
|
};
|
|
@@ -4238,7 +4238,7 @@ O.KEY_ARROW_RIGHT_COMMAND = Fl;
|
|
|
4238
4238
|
O.KEY_ARROW_UP_COMMAND = Kl;
|
|
4239
4239
|
O.KEY_BACKSPACE_COMMAND = Vl;
|
|
4240
4240
|
O.KEY_DELETE_COMMAND = Gl;
|
|
4241
|
-
O.KEY_ENTER_COMMAND =
|
|
4241
|
+
O.KEY_ENTER_COMMAND = rr;
|
|
4242
4242
|
O.KEY_ESCAPE_COMMAND = Yl;
|
|
4243
4243
|
O.KEY_MODIFIER_COMMAND = ts;
|
|
4244
4244
|
O.KEY_SPACE_COMMAND = Ul;
|
|
@@ -4272,8 +4272,8 @@ O.createEditor = function(t) {
|
|
|
4272
4272
|
return r = new Hc(l, i, t, { disableEvents: o, namespace: s, theme: r }, c || console.error, zc(t), e), a !== void 0 && (r._pendingEditorState = a, r._dirtyType = 2), r;
|
|
4273
4273
|
};
|
|
4274
4274
|
const Kc = O;
|
|
4275
|
-
var x = Kc, Lo = ge, en = x,
|
|
4276
|
-
let
|
|
4275
|
+
var x = Kc, Lo = ge, en = x, ur = R, Wc = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? ur.useLayoutEffect : ur.useEffect;
|
|
4276
|
+
let Kn = { tag: "history-merge" };
|
|
4277
4277
|
function Uc(t, e) {
|
|
4278
4278
|
if (e !== null) {
|
|
4279
4279
|
if (e === void 0)
|
|
@@ -4283,25 +4283,25 @@ function Uc(t, e) {
|
|
|
4283
4283
|
let r = en.$createParagraphNode();
|
|
4284
4284
|
n.append(r), n = document.activeElement, (en.$getSelection() !== null || n !== null && n === t.getRootElement()) && r.select();
|
|
4285
4285
|
}
|
|
4286
|
-
},
|
|
4286
|
+
}, Kn);
|
|
4287
4287
|
else if (e !== null)
|
|
4288
4288
|
switch (typeof e) {
|
|
4289
4289
|
case "string":
|
|
4290
4290
|
let n = t.parseEditorState(e);
|
|
4291
|
-
t.setEditorState(n,
|
|
4291
|
+
t.setEditorState(n, Kn);
|
|
4292
4292
|
break;
|
|
4293
4293
|
case "object":
|
|
4294
|
-
t.setEditorState(e,
|
|
4294
|
+
t.setEditorState(e, Kn);
|
|
4295
4295
|
break;
|
|
4296
4296
|
case "function":
|
|
4297
4297
|
t.update(() => {
|
|
4298
4298
|
en.$getRoot().isEmpty() && e(t);
|
|
4299
|
-
},
|
|
4299
|
+
}, Kn);
|
|
4300
4300
|
}
|
|
4301
4301
|
}
|
|
4302
4302
|
}
|
|
4303
4303
|
Dl.LexicalComposer = function({ initialConfig: t, children: e }) {
|
|
4304
|
-
let n =
|
|
4304
|
+
let n = ur.useMemo(() => {
|
|
4305
4305
|
const { theme: r, namespace: i, editor__DEPRECATED: o, nodes: l, onError: s, editorState: a } = t, u = Lo.createLexicalComposerContext(null, r);
|
|
4306
4306
|
let c = o || null;
|
|
4307
4307
|
if (c === null) {
|
|
@@ -4313,7 +4313,7 @@ Dl.LexicalComposer = function({ initialConfig: t, children: e }) {
|
|
|
4313
4313
|
return Wc(() => {
|
|
4314
4314
|
let r = t.editable, [i] = n;
|
|
4315
4315
|
i.setEditable(r !== void 0 ? r : !0);
|
|
4316
|
-
}, []),
|
|
4316
|
+
}, []), ur.createElement(Lo.LexicalComposerContext.Provider, { value: n }, e);
|
|
4317
4317
|
};
|
|
4318
4318
|
const Vc = Dl;
|
|
4319
4319
|
var Yc = Vc, _e = {}, De = {}, ye = x;
|
|
@@ -4449,7 +4449,7 @@ De.removeClassNamesFromElement = function(t, ...e) {
|
|
|
4449
4449
|
De.unstable_convertLegacyJSONEditorState = js;
|
|
4450
4450
|
const jc = De;
|
|
4451
4451
|
var ve = jc, V = x, Nn = ve;
|
|
4452
|
-
function
|
|
4452
|
+
function An(t) {
|
|
4453
4453
|
throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?code=${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
4454
4454
|
}
|
|
4455
4455
|
function Zs(t) {
|
|
@@ -4460,14 +4460,14 @@ function Zs(t) {
|
|
|
4460
4460
|
e++, t = t.getParent();
|
|
4461
4461
|
continue;
|
|
4462
4462
|
}
|
|
4463
|
-
|
|
4463
|
+
An(40);
|
|
4464
4464
|
}
|
|
4465
4465
|
break;
|
|
4466
4466
|
}
|
|
4467
4467
|
return e;
|
|
4468
4468
|
}
|
|
4469
4469
|
function vi(t) {
|
|
4470
|
-
t = t.getParent(), K(t) ||
|
|
4470
|
+
t = t.getParent(), K(t) || An(40);
|
|
4471
4471
|
let e = t;
|
|
4472
4472
|
for (; e !== null; )
|
|
4473
4473
|
e = e.getParent(), K(e) && (t = e);
|
|
@@ -4516,7 +4516,7 @@ function Ae(t, e) {
|
|
|
4516
4516
|
if (G(o)) {
|
|
4517
4517
|
let l = o.getValue();
|
|
4518
4518
|
var n = o, r = n.getParent(), i = 1;
|
|
4519
|
-
for (r != null && (K(r) ? i = r.getStart() :
|
|
4519
|
+
for (r != null && (K(r) ? i = r.getStart() : An(44)), n = n.getPreviousSiblings(), r = 0; r < n.length; r++) {
|
|
4520
4520
|
let s = n[r];
|
|
4521
4521
|
G(s) && !K(s.getFirstChild()) && i++;
|
|
4522
4522
|
}
|
|
@@ -4655,7 +4655,7 @@ class Ct extends V.ElementNode {
|
|
|
4655
4655
|
}
|
|
4656
4656
|
insertAfter(e) {
|
|
4657
4657
|
var n = this.getParentOrThrow();
|
|
4658
|
-
K(n) ||
|
|
4658
|
+
K(n) || An(39);
|
|
4659
4659
|
var r = this.getNextSiblings();
|
|
4660
4660
|
if (G(e))
|
|
4661
4661
|
return n = super.insertAfter(e), e = e.getParentOrThrow(), K(e) && Ae(e), n;
|
|
@@ -4773,12 +4773,12 @@ function Le(t) {
|
|
|
4773
4773
|
function G(t) {
|
|
4774
4774
|
return t instanceof Ct;
|
|
4775
4775
|
}
|
|
4776
|
-
class
|
|
4776
|
+
class Mn extends V.ElementNode {
|
|
4777
4777
|
static getType() {
|
|
4778
4778
|
return "list";
|
|
4779
4779
|
}
|
|
4780
4780
|
static clone(e) {
|
|
4781
|
-
return new
|
|
4781
|
+
return new Mn(e.__listType || Ho[e.__tag], e.__start, e.__key);
|
|
4782
4782
|
}
|
|
4783
4783
|
constructor(e, n, r) {
|
|
4784
4784
|
super(r), this.__listType = e = Ho[e] || e, this.__tag = e === "number" ? "ol" : "ul", this.__start = n;
|
|
@@ -4864,10 +4864,10 @@ function zo(t) {
|
|
|
4864
4864
|
}
|
|
4865
4865
|
let Ho = { ol: "number", ul: "bullet" };
|
|
4866
4866
|
function ke(t, e = 1) {
|
|
4867
|
-
return new
|
|
4867
|
+
return new Mn(t, e);
|
|
4868
4868
|
}
|
|
4869
4869
|
function K(t) {
|
|
4870
|
-
return t instanceof
|
|
4870
|
+
return t instanceof Mn;
|
|
4871
4871
|
}
|
|
4872
4872
|
let Qc = V.createCommand("INSERT_UNORDERED_LIST_COMMAND"), qc = V.createCommand("INSERT_ORDERED_LIST_COMMAND"), ed = V.createCommand("INSERT_CHECK_LIST_COMMAND"), td = V.createCommand("REMOVE_LIST_COMMAND");
|
|
4873
4873
|
_e.$createListItemNode = Le;
|
|
@@ -4878,7 +4878,7 @@ _e.$handleListInsertParagraph = function() {
|
|
|
4878
4878
|
if (!V.$isRangeSelection(t) || !t.isCollapsed() || (t = t.anchor.getNode(), !G(t) || t.getTextContent() !== ""))
|
|
4879
4879
|
return !1;
|
|
4880
4880
|
var e = vi(t), n = t.getParent();
|
|
4881
|
-
K(n) ||
|
|
4881
|
+
K(n) || An(40);
|
|
4882
4882
|
let r = n.getParent(), i;
|
|
4883
4883
|
if (V.$isRootOrShadowRoot(r))
|
|
4884
4884
|
i = V.$createParagraphNode(), e.insertAfter(i);
|
|
@@ -4900,7 +4900,7 @@ _e.INSERT_CHECK_LIST_COMMAND = ed;
|
|
|
4900
4900
|
_e.INSERT_ORDERED_LIST_COMMAND = qc;
|
|
4901
4901
|
_e.INSERT_UNORDERED_LIST_COMMAND = Qc;
|
|
4902
4902
|
_e.ListItemNode = Ct;
|
|
4903
|
-
_e.ListNode =
|
|
4903
|
+
_e.ListNode = Mn;
|
|
4904
4904
|
_e.REMOVE_LIST_COMMAND = td;
|
|
4905
4905
|
_e.indentList = function() {
|
|
4906
4906
|
ea("indent");
|
|
@@ -4969,7 +4969,7 @@ _e.removeList = function(t) {
|
|
|
4969
4969
|
};
|
|
4970
4970
|
const nd = _e;
|
|
4971
4971
|
var yt = nd, Ve = {}, Xe = {}, Ki = {}, ue = {}, F = x;
|
|
4972
|
-
let
|
|
4972
|
+
let cr = /* @__PURE__ */ new Map();
|
|
4973
4973
|
function rd(t) {
|
|
4974
4974
|
return { nodeMap: t.getNodes().map((e) => {
|
|
4975
4975
|
const n = e.getKey();
|
|
@@ -5001,8 +5001,8 @@ function ta(t) {
|
|
|
5001
5001
|
return e;
|
|
5002
5002
|
}
|
|
5003
5003
|
function Wi(t) {
|
|
5004
|
-
let e =
|
|
5005
|
-
return e === void 0 && (e = ta(t),
|
|
5004
|
+
let e = cr.get(t);
|
|
5005
|
+
return e === void 0 && (e = ta(t), cr.set(t, e)), e;
|
|
5006
5006
|
}
|
|
5007
5007
|
function id(t) {
|
|
5008
5008
|
let e = "";
|
|
@@ -5016,7 +5016,7 @@ function od(t) {
|
|
|
5016
5016
|
e.__children.length === 0 && t.remove(!0), t = n;
|
|
5017
5017
|
}
|
|
5018
5018
|
}
|
|
5019
|
-
function
|
|
5019
|
+
function qn(t, e, n, r, i = null) {
|
|
5020
5020
|
if (e.length !== 0) {
|
|
5021
5021
|
var o = e[0], l = /* @__PURE__ */ new Map(), s = [];
|
|
5022
5022
|
o = F.$isElementNode(o) ? o : o.getParentOrThrow(), o.isInline() && (o = o.getParentOrThrow());
|
|
@@ -5106,12 +5106,12 @@ function Mr(t) {
|
|
|
5106
5106
|
}
|
|
5107
5107
|
function Xt(t, e) {
|
|
5108
5108
|
var n = Wi(t.getStyle());
|
|
5109
|
-
e = Object.entries(e).reduce((r, [i, o]) => (o === null ? delete r[i] : r[i] = o, r), { ...n }), n = id(e), t.setStyle(n),
|
|
5109
|
+
e = Object.entries(e).reduce((r, [i, o]) => (o === null ? delete r[i] : r[i] = o, r), { ...n }), n = id(e), t.setStyle(n), cr.set(n, e);
|
|
5110
5110
|
}
|
|
5111
5111
|
ue.$addNodeStyle = function(t) {
|
|
5112
5112
|
t = t.getStyle();
|
|
5113
5113
|
let e = ta(t);
|
|
5114
|
-
|
|
5114
|
+
cr.set(t, e);
|
|
5115
5115
|
};
|
|
5116
5116
|
ue.$cloneContents = function(t) {
|
|
5117
5117
|
var e = { nodeMap: [], range: [] };
|
|
@@ -5230,15 +5230,15 @@ ue.$wrapNodes = function(t, e, n = null) {
|
|
|
5230
5230
|
var l = [];
|
|
5231
5231
|
for (let s = 0; s < i; s++) {
|
|
5232
5232
|
let a = r[s];
|
|
5233
|
-
F.$isRootOrShadowRoot(a) ? (
|
|
5233
|
+
F.$isRootOrShadowRoot(a) ? (qn(t, l, l.length, e, n), l = [], o = a) : o === null || o !== null && F.$hasAncestor(
|
|
5234
5234
|
a,
|
|
5235
5235
|
o
|
|
5236
|
-
) ? l.push(a) : (
|
|
5236
|
+
) ? l.push(a) : (qn(t, l, l.length, e, n), l = [a]);
|
|
5237
5237
|
}
|
|
5238
|
-
|
|
5238
|
+
qn(t, l, l.length, e, n);
|
|
5239
5239
|
}
|
|
5240
5240
|
};
|
|
5241
|
-
ue.$wrapNodesImpl =
|
|
5241
|
+
ue.$wrapNodesImpl = qn;
|
|
5242
5242
|
ue.createDOMRange = function(t, e, n, r, i) {
|
|
5243
5243
|
let o = e.getKey(), l = r.getKey(), s = document.createRange(), a = t.getElementByKey(o);
|
|
5244
5244
|
if (t = t.getElementByKey(l), F.$isTextNode(e) && (a = Ko(a)), F.$isTextNode(r) && (t = Ko(t)), e === void 0 || r === void 0 || a === null || t === null)
|
|
@@ -5539,17 +5539,17 @@ Xe.copyToClipboard__EXPERIMENTAL = async function(t, e) {
|
|
|
5539
5539
|
});
|
|
5540
5540
|
};
|
|
5541
5541
|
const dd = Xe;
|
|
5542
|
-
var gd = dd,
|
|
5542
|
+
var gd = dd, dr = gd, Wn = He, Dt = ve, y = x;
|
|
5543
5543
|
let Ut = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", fd = Ut && "documentMode" in document ? document.documentMode : null;
|
|
5544
5544
|
Ut && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
5545
5545
|
Ut && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
|
|
5546
5546
|
let hd = Ut && "InputEvent" in window && !fd ? "getTargetRanges" in new window.InputEvent("input") : !1, pd = Ut && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), md = Ut && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ei = y.createCommand("DRAG_DROP_PASTE_FILE");
|
|
5547
|
-
class
|
|
5547
|
+
class kn extends y.ElementNode {
|
|
5548
5548
|
static getType() {
|
|
5549
5549
|
return "quote";
|
|
5550
5550
|
}
|
|
5551
5551
|
static clone(e) {
|
|
5552
|
-
return new
|
|
5552
|
+
return new kn(e.__key);
|
|
5553
5553
|
}
|
|
5554
5554
|
constructor(e) {
|
|
5555
5555
|
super(e);
|
|
@@ -5581,14 +5581,14 @@ class Mn extends y.ElementNode {
|
|
|
5581
5581
|
}
|
|
5582
5582
|
}
|
|
5583
5583
|
function Ui() {
|
|
5584
|
-
return new
|
|
5584
|
+
return new kn();
|
|
5585
5585
|
}
|
|
5586
|
-
class
|
|
5586
|
+
class Dn extends y.ElementNode {
|
|
5587
5587
|
static getType() {
|
|
5588
5588
|
return "heading";
|
|
5589
5589
|
}
|
|
5590
5590
|
static clone(e) {
|
|
5591
|
-
return new
|
|
5591
|
+
return new Dn(e.__tag, e.__key);
|
|
5592
5592
|
}
|
|
5593
5593
|
constructor(e, n) {
|
|
5594
5594
|
super(n), this.__tag = e;
|
|
@@ -5607,10 +5607,10 @@ class kn extends y.ElementNode {
|
|
|
5607
5607
|
return { h1: () => ({ conversion: St, priority: 0 }), h2: () => ({ conversion: St, priority: 0 }), h3: () => ({ conversion: St, priority: 0 }), h4: () => ({ conversion: St, priority: 0 }), h5: () => ({
|
|
5608
5608
|
conversion: St,
|
|
5609
5609
|
priority: 0
|
|
5610
|
-
}), h6: () => ({ conversion: St, priority: 0 }), p: (e) => (e = e.firstChild, e !== null && jo(e) ? { conversion: () => ({ node: null }), priority: 3 } : null), span: (e) => jo(e) ? { conversion: () => ({ node:
|
|
5610
|
+
}), h6: () => ({ conversion: St, priority: 0 }), p: (e) => (e = e.firstChild, e !== null && jo(e) ? { conversion: () => ({ node: null }), priority: 3 } : null), span: (e) => jo(e) ? { conversion: () => ({ node: gr("h1") }), priority: 3 } : null };
|
|
5611
5611
|
}
|
|
5612
5612
|
static importJSON(e) {
|
|
5613
|
-
let n =
|
|
5613
|
+
let n = gr(e.tag);
|
|
5614
5614
|
return n.setFormat(e.format), n.setIndent(e.indent), n.setDirection(e.direction), n;
|
|
5615
5615
|
}
|
|
5616
5616
|
exportJSON() {
|
|
@@ -5634,22 +5634,22 @@ function jo(t) {
|
|
|
5634
5634
|
function St(t) {
|
|
5635
5635
|
t = t.nodeName.toLowerCase();
|
|
5636
5636
|
let e = null;
|
|
5637
|
-
return (t === "h1" || t === "h2" || t === "h3" || t === "h4" || t === "h5" || t === "h6") && (e =
|
|
5637
|
+
return (t === "h1" || t === "h2" || t === "h3" || t === "h4" || t === "h5" || t === "h6") && (e = gr(t)), { node: e };
|
|
5638
5638
|
}
|
|
5639
5639
|
function _d() {
|
|
5640
5640
|
return { node: Ui() };
|
|
5641
5641
|
}
|
|
5642
|
-
function
|
|
5643
|
-
return new
|
|
5642
|
+
function gr(t) {
|
|
5643
|
+
return new Dn(t);
|
|
5644
5644
|
}
|
|
5645
5645
|
function vd(t, e) {
|
|
5646
5646
|
t.preventDefault(), e.update(() => {
|
|
5647
5647
|
let n = y.$getSelection(), r = t instanceof InputEvent || t instanceof KeyboardEvent ? null : t.clipboardData;
|
|
5648
|
-
r != null && (y.$isRangeSelection(n) || y.DEPRECATED_$isGridSelection(n)) &&
|
|
5648
|
+
r != null && (y.$isRangeSelection(n) || y.DEPRECATED_$isGridSelection(n)) && dr.$insertDataTransferForRichText(r, n, e);
|
|
5649
5649
|
}, { tag: "paste" });
|
|
5650
5650
|
}
|
|
5651
5651
|
async function Cd(t, e) {
|
|
5652
|
-
e.getEditorState().read(() => y.$getSelection()) != null && (await
|
|
5652
|
+
e.getEditorState().read(() => y.$getSelection()) != null && (await dr.copyToClipboard__EXPERIMENTAL(e, t instanceof ClipboardEvent ? t : null), e.update(() => {
|
|
5653
5653
|
let n = y.$getSelection();
|
|
5654
5654
|
y.$isRangeSelection(n) ? n.removeText() : y.$isNodeSelection(n) && n.getNodes().forEach((r) => r.remove());
|
|
5655
5655
|
}));
|
|
@@ -5670,20 +5670,20 @@ function Zo(t, e) {
|
|
|
5670
5670
|
}
|
|
5671
5671
|
}
|
|
5672
5672
|
}
|
|
5673
|
-
function
|
|
5673
|
+
function Un(t) {
|
|
5674
5674
|
return t = y.$getNearestNodeFromDOMNode(t), y.$isDecoratorNode(t);
|
|
5675
5675
|
}
|
|
5676
|
-
Ve.$createHeadingNode =
|
|
5676
|
+
Ve.$createHeadingNode = gr;
|
|
5677
5677
|
Ve.$createQuoteNode = Ui;
|
|
5678
5678
|
Ve.$isHeadingNode = function(t) {
|
|
5679
|
-
return t instanceof
|
|
5679
|
+
return t instanceof Dn;
|
|
5680
5680
|
};
|
|
5681
5681
|
Ve.$isQuoteNode = function(t) {
|
|
5682
|
-
return t instanceof
|
|
5682
|
+
return t instanceof kn;
|
|
5683
5683
|
};
|
|
5684
5684
|
Ve.DRAG_DROP_PASTE = Ei;
|
|
5685
|
-
Ve.HeadingNode =
|
|
5686
|
-
Ve.QuoteNode =
|
|
5685
|
+
Ve.HeadingNode = Dn;
|
|
5686
|
+
Ve.QuoteNode = kn;
|
|
5687
5687
|
Ve.eventFiles = tn;
|
|
5688
5688
|
Ve.registerRichText = function(t) {
|
|
5689
5689
|
return Dt.mergeRegister(
|
|
@@ -5711,7 +5711,7 @@ Ve.registerRichText = function(t) {
|
|
|
5711
5711
|
if (!y.$isRangeSelection(n) && !y.DEPRECATED_$isGridSelection(n))
|
|
5712
5712
|
return !1;
|
|
5713
5713
|
const r = e.dataTransfer;
|
|
5714
|
-
r != null ?
|
|
5714
|
+
r != null ? dr.$insertDataTransferForRichText(r, n, t) : y.$isRangeSelection(n) && (e = e.data) && n.insertText(e);
|
|
5715
5715
|
}
|
|
5716
5716
|
return !0;
|
|
5717
5717
|
}, y.COMMAND_PRIORITY_EDITOR),
|
|
@@ -5758,7 +5758,7 @@ Ve.registerRichText = function(t) {
|
|
|
5758
5758
|
}), !0), y.COMMAND_PRIORITY_EDITOR),
|
|
5759
5759
|
t.registerCommand(y.KEY_ARROW_UP_COMMAND, (e) => {
|
|
5760
5760
|
const n = y.$getSelection();
|
|
5761
|
-
return y.$isNodeSelection(n) && !
|
|
5761
|
+
return y.$isNodeSelection(n) && !Un(e.target) && (e = n.getNodes(), 0 < e.length) ? (e[0].selectPrevious(), !0) : !1;
|
|
5762
5762
|
}, y.COMMAND_PRIORITY_EDITOR),
|
|
5763
5763
|
t.registerCommand(y.KEY_ARROW_DOWN_COMMAND, () => {
|
|
5764
5764
|
var e = y.$getSelection();
|
|
@@ -5771,24 +5771,24 @@ Ve.registerRichText = function(t) {
|
|
|
5771
5771
|
if (0 < r.length)
|
|
5772
5772
|
return e.preventDefault(), r[0].selectPrevious(), !0;
|
|
5773
5773
|
}
|
|
5774
|
-
return y.$isRangeSelection(n) &&
|
|
5774
|
+
return y.$isRangeSelection(n) && Wn.$shouldOverrideDefaultCharacterSelection(
|
|
5775
5775
|
n,
|
|
5776
5776
|
!0
|
|
5777
|
-
) ? (r = e.shiftKey, e.preventDefault(),
|
|
5777
|
+
) ? (r = e.shiftKey, e.preventDefault(), Wn.$moveCharacter(n, r, !0), !0) : !1;
|
|
5778
5778
|
}, y.COMMAND_PRIORITY_EDITOR),
|
|
5779
5779
|
t.registerCommand(y.KEY_ARROW_RIGHT_COMMAND, (e) => {
|
|
5780
5780
|
const n = y.$getSelection();
|
|
5781
|
-
if (y.$isNodeSelection(n) && !
|
|
5781
|
+
if (y.$isNodeSelection(n) && !Un(e.target)) {
|
|
5782
5782
|
var r = n.getNodes();
|
|
5783
5783
|
if (0 < r.length)
|
|
5784
5784
|
return e.preventDefault(), r[0].selectNext(0, 0), !0;
|
|
5785
5785
|
}
|
|
5786
|
-
return y.$isRangeSelection(n) ? (r = e.shiftKey,
|
|
5786
|
+
return y.$isRangeSelection(n) ? (r = e.shiftKey, Wn.$shouldOverrideDefaultCharacterSelection(n, !1) ? (e.preventDefault(), Wn.$moveCharacter(n, r, !1), !0) : !1) : !1;
|
|
5787
5787
|
}, y.COMMAND_PRIORITY_EDITOR),
|
|
5788
5788
|
t.registerCommand(
|
|
5789
5789
|
y.KEY_BACKSPACE_COMMAND,
|
|
5790
5790
|
(e) => {
|
|
5791
|
-
if (
|
|
5791
|
+
if (Un(e.target))
|
|
5792
5792
|
return !1;
|
|
5793
5793
|
const n = y.$getSelection();
|
|
5794
5794
|
if (!y.$isRangeSelection(n))
|
|
@@ -5800,7 +5800,7 @@ Ve.registerRichText = function(t) {
|
|
|
5800
5800
|
y.COMMAND_PRIORITY_EDITOR
|
|
5801
5801
|
),
|
|
5802
5802
|
t.registerCommand(y.KEY_DELETE_COMMAND, (e) => {
|
|
5803
|
-
if (
|
|
5803
|
+
if (Un(e.target))
|
|
5804
5804
|
return !1;
|
|
5805
5805
|
const n = y.$getSelection();
|
|
5806
5806
|
return y.$isRangeSelection(n) ? (e.preventDefault(), t.dispatchCommand(y.DELETE_CHARACTER_COMMAND, !1)) : !1;
|
|
@@ -5849,7 +5849,7 @@ Ve.registerRichText = function(t) {
|
|
|
5849
5849
|
const [n] = tn(e), r = y.$getSelection();
|
|
5850
5850
|
return n && !y.$isRangeSelection(r) ? !1 : (e.preventDefault(), !0);
|
|
5851
5851
|
}, y.COMMAND_PRIORITY_EDITOR),
|
|
5852
|
-
t.registerCommand(y.COPY_COMMAND, (e) => (
|
|
5852
|
+
t.registerCommand(y.COPY_COMMAND, (e) => (dr.copyToClipboard__EXPERIMENTAL(t, e instanceof ClipboardEvent ? e : null), !0), y.COMMAND_PRIORITY_EDITOR),
|
|
5853
5853
|
t.registerCommand(y.CUT_COMMAND, (e) => (Cd(e, t), !0), y.COMMAND_PRIORITY_EDITOR),
|
|
5854
5854
|
t.registerCommand(y.PASTE_COMMAND, (e) => {
|
|
5855
5855
|
var [, n] = tn(e);
|
|
@@ -5948,12 +5948,12 @@ function Tn(t, e) {
|
|
|
5948
5948
|
function ct(t) {
|
|
5949
5949
|
return t instanceof Vt;
|
|
5950
5950
|
}
|
|
5951
|
-
class
|
|
5951
|
+
class Ln extends Vt {
|
|
5952
5952
|
static getType() {
|
|
5953
5953
|
return "autolink";
|
|
5954
5954
|
}
|
|
5955
5955
|
static clone(e) {
|
|
5956
|
-
return new
|
|
5956
|
+
return new Ln(e.__url, { rel: e.__rel, target: e.__target }, e.__key);
|
|
5957
5957
|
}
|
|
5958
5958
|
static importJSON(e) {
|
|
5959
5959
|
let n = xi(e.url, { rel: e.rel, target: e.target });
|
|
@@ -5974,7 +5974,7 @@ class Dn extends Vt {
|
|
|
5974
5974
|
}
|
|
5975
5975
|
}
|
|
5976
5976
|
function xi(t, e) {
|
|
5977
|
-
return new
|
|
5977
|
+
return new Ln(t, e);
|
|
5978
5978
|
}
|
|
5979
5979
|
let Nd = ot.createCommand("TOGGLE_LINK_COMMAND");
|
|
5980
5980
|
function Td(t) {
|
|
@@ -5988,10 +5988,10 @@ function Sd(t, e) {
|
|
|
5988
5988
|
Qe.$createAutoLinkNode = xi;
|
|
5989
5989
|
Qe.$createLinkNode = Tn;
|
|
5990
5990
|
Qe.$isAutoLinkNode = function(t) {
|
|
5991
|
-
return t instanceof
|
|
5991
|
+
return t instanceof Ln;
|
|
5992
5992
|
};
|
|
5993
5993
|
Qe.$isLinkNode = ct;
|
|
5994
|
-
Qe.AutoLinkNode =
|
|
5994
|
+
Qe.AutoLinkNode = Ln;
|
|
5995
5995
|
Qe.LinkNode = Vt;
|
|
5996
5996
|
Qe.TOGGLE_LINK_COMMAND = Nd;
|
|
5997
5997
|
Qe.toggleLink = function(t, e = {}) {
|
|
@@ -6083,7 +6083,7 @@ function Rd() {
|
|
|
6083
6083
|
function Yi() {
|
|
6084
6084
|
return new kr();
|
|
6085
6085
|
}
|
|
6086
|
-
var fa = {}, Od = ge, ut = x,
|
|
6086
|
+
var fa = {}, Od = ge, ut = x, Vn = R;
|
|
6087
6087
|
function Jo(t, e) {
|
|
6088
6088
|
return t.getEditorState().read(() => {
|
|
6089
6089
|
let n = ut.$getNodeByKey(e);
|
|
@@ -6091,16 +6091,16 @@ function Jo(t, e) {
|
|
|
6091
6091
|
});
|
|
6092
6092
|
}
|
|
6093
6093
|
fa.useLexicalNodeSelection = function(t) {
|
|
6094
|
-
let [e] = Od.useLexicalComposerContext(), [n, r] =
|
|
6095
|
-
|
|
6094
|
+
let [e] = Od.useLexicalComposerContext(), [n, r] = Vn.useState(() => Jo(e, t));
|
|
6095
|
+
Vn.useEffect(() => e.registerUpdateListener(() => {
|
|
6096
6096
|
r(Jo(e, t));
|
|
6097
6097
|
}), [e, t]);
|
|
6098
|
-
let i =
|
|
6098
|
+
let i = Vn.useCallback((l) => {
|
|
6099
6099
|
e.update(() => {
|
|
6100
6100
|
let s = ut.$getSelection();
|
|
6101
6101
|
ut.$isNodeSelection(s) || (s = ut.$createNodeSelection(), ut.$setSelection(s)), l ? s.add(t) : s.delete(t);
|
|
6102
6102
|
});
|
|
6103
|
-
}, [e, t]), o =
|
|
6103
|
+
}, [e, t]), o = Vn.useCallback(() => {
|
|
6104
6104
|
e.update(() => {
|
|
6105
6105
|
const l = ut.$getSelection();
|
|
6106
6106
|
ut.$isNodeSelection(l) && l.clear();
|
|
@@ -6324,7 +6324,7 @@ function Id(t) {
|
|
|
6324
6324
|
return t instanceof ht;
|
|
6325
6325
|
}
|
|
6326
6326
|
const Pd = ({ el: t, value: e }) => {
|
|
6327
|
-
|
|
6327
|
+
nr(() => {
|
|
6328
6328
|
const n = t.current;
|
|
6329
6329
|
if (n) {
|
|
6330
6330
|
n.style.height = "0px";
|
|
@@ -6563,7 +6563,7 @@ function Ud({
|
|
|
6563
6563
|
})
|
|
6564
6564
|
});
|
|
6565
6565
|
}
|
|
6566
|
-
function
|
|
6566
|
+
function fr({ fileInputRef: t }) {
|
|
6567
6567
|
t.current.click();
|
|
6568
6568
|
}
|
|
6569
6569
|
function Ea({
|
|
@@ -6583,38 +6583,31 @@ function Ea({
|
|
|
6583
6583
|
}
|
|
6584
6584
|
function Vd({
|
|
6585
6585
|
src: t,
|
|
6586
|
-
alt: e
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
src: t,
|
|
6590
|
-
alt: e
|
|
6591
|
-
});
|
|
6592
|
-
}
|
|
6593
|
-
function Yd({
|
|
6594
|
-
previewSrc: t,
|
|
6595
|
-
progress: e
|
|
6586
|
+
alt: e,
|
|
6587
|
+
previewSrc: n,
|
|
6588
|
+
progress: r
|
|
6596
6589
|
}) {
|
|
6597
|
-
const
|
|
6598
|
-
width: `${
|
|
6590
|
+
const i = {
|
|
6591
|
+
width: `${r == null ? void 0 : r.toFixed(0)}%`
|
|
6599
6592
|
};
|
|
6600
6593
|
return /* @__PURE__ */ Y("div", {
|
|
6601
6594
|
children: [/* @__PURE__ */ f("img", {
|
|
6602
|
-
|
|
6603
|
-
src: t,
|
|
6604
|
-
alt: `upload in progress, ${
|
|
6605
|
-
}), /* @__PURE__ */ f("div", {
|
|
6595
|
+
className: n ? "opacity-40" : "",
|
|
6596
|
+
src: n || t,
|
|
6597
|
+
alt: e || `upload in progress, ${r} `
|
|
6598
|
+
}), n && r && !t ? /* @__PURE__ */ f("div", {
|
|
6606
6599
|
className: "absolute inset-0 flex items-center min-w-full bg-white/50 justify-center overflow-hidden",
|
|
6607
6600
|
children: /* @__PURE__ */ f("div", {
|
|
6608
6601
|
className: "not-kg-prose bg-grey-200 rounded-full shadow w-[60%]",
|
|
6609
6602
|
children: /* @__PURE__ */ f("div", {
|
|
6610
6603
|
className: "bg-green rounded-full text-xs leading-none py-1 text-center text-white",
|
|
6611
|
-
style:
|
|
6604
|
+
style: i
|
|
6612
6605
|
})
|
|
6613
6606
|
})
|
|
6614
|
-
})]
|
|
6607
|
+
}) : /* @__PURE__ */ f(wn, {})]
|
|
6615
6608
|
});
|
|
6616
6609
|
}
|
|
6617
|
-
function
|
|
6610
|
+
function Yd({
|
|
6618
6611
|
onFileChange: t,
|
|
6619
6612
|
setFileInputRef: e,
|
|
6620
6613
|
handleDrag: n,
|
|
@@ -6622,18 +6615,18 @@ function Gd({
|
|
|
6622
6615
|
isDraggedOver: i
|
|
6623
6616
|
}) {
|
|
6624
6617
|
const o = R.useRef(null);
|
|
6625
|
-
return /* @__PURE__ */ Y(
|
|
6618
|
+
return /* @__PURE__ */ Y(wn, {
|
|
6626
6619
|
children: [/* @__PURE__ */ f(Ud, {
|
|
6627
6620
|
handleDrag: n,
|
|
6628
6621
|
handleDrop: r,
|
|
6629
|
-
filePicker: () =>
|
|
6622
|
+
filePicker: () => fr({
|
|
6630
6623
|
fileInputRef: o
|
|
6631
6624
|
}),
|
|
6632
6625
|
desc: "Click to select an image",
|
|
6633
6626
|
Icon: ti,
|
|
6634
6627
|
isDraggedOver: i
|
|
6635
6628
|
}), /* @__PURE__ */ f(Ea, {
|
|
6636
|
-
filePicker: () =>
|
|
6629
|
+
filePicker: () => fr({
|
|
6637
6630
|
fileInputRef: o
|
|
6638
6631
|
}),
|
|
6639
6632
|
onFileChange: t,
|
|
@@ -6643,7 +6636,7 @@ function Gd({
|
|
|
6643
6636
|
})]
|
|
6644
6637
|
});
|
|
6645
6638
|
}
|
|
6646
|
-
const
|
|
6639
|
+
const Gd = ({
|
|
6647
6640
|
src: t,
|
|
6648
6641
|
altText: e,
|
|
6649
6642
|
previewSrc: n,
|
|
@@ -6653,13 +6646,12 @@ const jd = ({
|
|
|
6653
6646
|
handleDrag: l,
|
|
6654
6647
|
handleDrop: s,
|
|
6655
6648
|
isDraggedOver: a
|
|
6656
|
-
}) => n
|
|
6649
|
+
}) => n || t ? /* @__PURE__ */ f(Vd, {
|
|
6650
|
+
src: t,
|
|
6651
|
+
alt: e,
|
|
6657
6652
|
previewSrc: n,
|
|
6658
6653
|
progress: r
|
|
6659
|
-
}) :
|
|
6660
|
-
src: t,
|
|
6661
|
-
alt: e
|
|
6662
|
-
}) : /* @__PURE__ */ f(Gd, {
|
|
6654
|
+
}) : /* @__PURE__ */ f(Yd, {
|
|
6663
6655
|
handleDrag: l,
|
|
6664
6656
|
onFileChange: i,
|
|
6665
6657
|
setFileInputRef: o,
|
|
@@ -6686,11 +6678,11 @@ function xa({
|
|
|
6686
6678
|
const C = R.useRef(null);
|
|
6687
6679
|
return R.useEffect(() => {
|
|
6688
6680
|
s && s(C);
|
|
6689
|
-
}, [C, s]), /* @__PURE__ */ f(
|
|
6681
|
+
}, [C, s]), /* @__PURE__ */ f(wn, {
|
|
6690
6682
|
children: /* @__PURE__ */ Y("figure", {
|
|
6691
6683
|
"data-kg-card-width": g,
|
|
6692
6684
|
ref: C,
|
|
6693
|
-
children: [/* @__PURE__ */ f(
|
|
6685
|
+
children: [/* @__PURE__ */ f(Gd, {
|
|
6694
6686
|
src: e,
|
|
6695
6687
|
altText: o,
|
|
6696
6688
|
previewSrc: m,
|
|
@@ -6725,7 +6717,7 @@ xa.propTypes = {
|
|
|
6725
6717
|
previewSrc: Re.exports.string,
|
|
6726
6718
|
uploadProgress: Re.exports.number
|
|
6727
6719
|
};
|
|
6728
|
-
const
|
|
6720
|
+
const jd = (t) => /* @__PURE__ */ v.createElement("svg", {
|
|
6729
6721
|
width: 16,
|
|
6730
6722
|
height: 16,
|
|
6731
6723
|
viewBox: "0 0 16 16",
|
|
@@ -6735,7 +6727,7 @@ const Zd = (t) => /* @__PURE__ */ v.createElement("svg", {
|
|
|
6735
6727
|
fillRule: "evenodd",
|
|
6736
6728
|
clipRule: "evenodd",
|
|
6737
6729
|
d: "M4 8.00011H6C6.26522 8.00011 6.51957 8.10546 6.70711 8.293C6.89464 8.48054 7 8.73489 7 9.00011V13.0001C7 13.2653 6.89464 13.5197 6.70711 13.7072C6.51957 13.8947 6.26522 14.0001 6 14.0001H3C2.73478 14.0001 2.48043 13.8947 2.29289 13.7072C2.10536 13.5197 2 13.2653 2 13.0001V5.08211C2 3.90611 2.906 2.96211 4.538 2.11311C4.65448 2.05244 4.78177 2.0153 4.91261 2.00383C5.04344 1.99235 5.17525 2.00675 5.30052 2.04622C5.42579 2.08568 5.54205 2.14944 5.64268 2.23383C5.74331 2.31823 5.82633 2.42162 5.887 2.53811C5.94767 2.65459 5.9848 2.78188 5.99628 2.91271C6.00776 3.04355 5.99335 3.17536 5.95389 3.30063C5.91442 3.42589 5.85067 3.54216 5.76627 3.64279C5.68187 3.74342 5.57848 3.82644 5.462 3.88711C4.884 4.18711 4.469 4.47611 4.222 4.73411C4.054 4.90811 4 5.02011 4 5.08211V8.00011ZM13 8.00011C13.2652 8.00011 13.5196 8.10546 13.7071 8.293C13.8946 8.48054 14 8.73489 14 9.00011V9.5366C13.6143 9.60243 13.2536 9.7523 12.937 9.9445L12.9298 9.9489L12.4315 10.2608C11.9856 10.5357 11.5 11.0479 11.5 11.8252C11.5 12.5688 11.9611 13.2015 12.6323 13.4311V14.0001H10C9.73478 14.0001 9.48043 13.8947 9.29289 13.7072C9.10536 13.5197 9 13.2653 9 13.0001V5.08211C9 3.90611 9.906 2.96211 11.538 2.11311C11.6545 2.05244 11.7818 2.0153 11.9126 2.00383C12.0434 1.99235 12.1753 2.00675 12.3005 2.04622C12.4258 2.08568 12.5421 2.14944 12.6427 2.23383C12.7433 2.31823 12.8263 2.42162 12.887 2.53811C12.9477 2.65459 12.9848 2.78188 12.9963 2.91271C13.0078 3.04355 12.9934 3.17536 12.9539 3.30063C12.9144 3.42589 12.8507 3.54216 12.7663 3.64279C12.6819 3.74342 12.5785 3.82644 12.462 3.88711C11.884 4.18711 11.469 4.47611 11.222 4.73411C11.054 4.90811 11 5.02011 11 5.08211V8.00011H13ZM14.5428 15.4344C14.1182 15.4344 13.8823 15.1783 13.8823 14.7267V11.96H13.8722L13.6397 12.1082C13.4274 12.2329 13.3229 12.2734 13.1948 12.2734C12.9354 12.2734 12.75 12.0846 12.75 11.8252C12.75 11.6297 12.8646 11.4612 13.0904 11.323L13.5858 11.013C13.8688 10.8411 14.1587 10.7501 14.4249 10.7501C14.8933 10.7501 15.2 11.0635 15.2 11.5488V14.7267C15.2 15.1817 14.9641 15.4344 14.5428 15.4344Z"
|
|
6738
|
-
})),
|
|
6730
|
+
})), Zd = (t) => /* @__PURE__ */ v.createElement("svg", {
|
|
6739
6731
|
width: 16,
|
|
6740
6732
|
height: 16,
|
|
6741
6733
|
viewBox: "0 0 16 16",
|
|
@@ -6746,28 +6738,28 @@ const Zd = (t) => /* @__PURE__ */ v.createElement("svg", {
|
|
|
6746
6738
|
fillRule: "evenodd",
|
|
6747
6739
|
clipRule: "evenodd",
|
|
6748
6740
|
d: "M4 8.00015H6C6.26522 8.00015 6.51957 8.1055 6.70711 8.29304C6.89464 8.48058 7 8.73493 7 9.00015V13.0001C7 13.2654 6.89464 13.5197 6.70711 13.7073C6.51957 13.8948 6.26522 14.0001 6 14.0001H3C2.73478 14.0001 2.48043 13.8948 2.29289 13.7073C2.10536 13.5197 2 13.2654 2 13.0001V5.08215C2 3.90615 2.906 2.96215 4.538 2.11315C4.65448 2.05248 4.78177 2.01534 4.91261 2.00387C5.04344 1.99239 5.17525 2.00679 5.30052 2.04626C5.42579 2.08572 5.54205 2.14948 5.64268 2.23387C5.74331 2.31827 5.82633 2.42166 5.887 2.53815C5.94767 2.65463 5.9848 2.78192 5.99628 2.91275C6.00776 3.04359 5.99335 3.1754 5.95389 3.30067C5.91442 3.42593 5.85067 3.5422 5.76627 3.64283C5.68187 3.74346 5.57848 3.82648 5.462 3.88715C4.884 4.18715 4.469 4.47615 4.222 4.73415C4.054 4.90815 4 5.02015 4 5.08215V8.00015ZM13 8.00015C13.2652 8.00015 13.5196 8.1055 13.7071 8.29304C13.8946 8.48058 14 8.73493 14 9.00015V9.51812C13.4378 9.57694 12.9087 9.77735 12.4803 10.0918C11.9785 10.4601 11.5 11.0848 11.5 11.9043C11.5 12.3632 11.6772 12.8135 12.0264 13.1451C12.0604 13.1774 12.0955 13.208 12.1312 13.2369C11.9419 13.4409 11.7509 13.6922 11.6323 14.0001H10C9.73478 14.0001 9.48043 13.8948 9.29289 13.7073C9.10536 13.5197 9 13.2654 9 13.0001V5.08215C9 3.90615 9.906 2.96215 11.538 2.11315C11.6545 2.05248 11.7818 2.01534 11.9126 2.00387C12.0434 1.99239 12.1753 2.00679 12.3005 2.04626C12.4258 2.08572 12.5421 2.14948 12.6427 2.23387C12.7433 2.31827 12.8263 2.42166 12.887 2.53815C12.9477 2.65463 12.9848 2.78192 12.9963 2.91275C13.0078 3.04359 12.9934 3.1754 12.9539 3.30067C12.9144 3.42593 12.8507 3.5422 12.7663 3.64283C12.6819 3.74346 12.5785 3.82648 12.462 3.88715C11.884 4.18715 11.469 4.47615 11.222 4.73415C11.054 4.90815 11 5.02015 11 5.08215V8.00015H13ZM13.2256 15.1428C12.8903 15.1428 12.6626 14.9404 12.6626 14.6432C12.6626 14.4218 12.7891 14.2257 13.1591 13.8779L14.1616 12.907C14.4937 12.5876 14.6391 12.3789 14.6391 12.1607C14.6391 11.9045 14.4526 11.7337 14.1806 11.7337C13.9687 11.7337 13.8169 11.8255 13.6556 12.0532C13.4785 12.2872 13.3457 12.3694 13.1402 12.3694C12.8524 12.3694 12.65 12.1765 12.65 11.9045C12.65 11.2973 13.371 10.7502 14.247 10.7502C15.1546 10.7502 15.825 11.2973 15.825 12.0373C15.825 12.4959 15.5879 12.926 15.0787 13.3908L14.2881 14.1245V14.172H15.4203C15.765 14.172 15.98 14.3585 15.98 14.6621C15.98 14.9626 15.7713 15.1428 15.4203 15.1428H13.2256Z"
|
|
6749
|
-
})),
|
|
6741
|
+
})), Jd = (t) => /* @__PURE__ */ v.createElement("svg", {
|
|
6750
6742
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6751
6743
|
viewBox: "0 0 24 24",
|
|
6752
6744
|
...t
|
|
6753
6745
|
}, /* @__PURE__ */ v.createElement("path", {
|
|
6754
6746
|
d: "M16.19 3.51a.51.51 0 0 0-.71 0L4.07 14.92a.5.5 0 0 0 0 .71l4.28 4.28a.48.48 0 0 0 .7 0L20.47 8.5a.51.51 0 0 0 0-.71ZM3 16.71a.51.51 0 0 0-.47-.13.48.48 0 0 0-.36.33L0 23.33a.49.49 0 0 0 .12.51.5.5 0 0 0 .54.16l6.42-2.14a.52.52 0 0 0 .33-.36.49.49 0 0 0-.14-.5ZM23 1a3.6 3.6 0 0 0-5 0l-.71.71a.5.5 0 0 0 0 .71l4.28 4.28a.51.51 0 0 0 .7 0L23 6a3.53 3.53 0 0 0 0-5Z"
|
|
6755
|
-
})),
|
|
6747
|
+
})), Xd = {
|
|
6756
6748
|
bold: Cl,
|
|
6757
6749
|
italic: yl,
|
|
6758
6750
|
headingOne: El,
|
|
6759
6751
|
headingTwo: xl,
|
|
6760
6752
|
quote: Nl,
|
|
6761
|
-
quoteOne:
|
|
6762
|
-
quoteTwo:
|
|
6753
|
+
quoteOne: jd,
|
|
6754
|
+
quoteTwo: Zd,
|
|
6763
6755
|
link: ei,
|
|
6764
6756
|
imageRegular: Tl,
|
|
6765
6757
|
imageWide: Sl,
|
|
6766
6758
|
imageFull: wl,
|
|
6767
6759
|
imageReplace: Rl,
|
|
6768
6760
|
add: Ol,
|
|
6769
|
-
edit:
|
|
6770
|
-
snippet:
|
|
6761
|
+
edit: Jd,
|
|
6762
|
+
snippet: Gn
|
|
6771
6763
|
};
|
|
6772
6764
|
function Na({
|
|
6773
6765
|
children: t,
|
|
@@ -6786,7 +6778,7 @@ function Fe({
|
|
|
6786
6778
|
icon: r,
|
|
6787
6779
|
...i
|
|
6788
6780
|
}) {
|
|
6789
|
-
const o =
|
|
6781
|
+
const o = Xd[r];
|
|
6790
6782
|
return /* @__PURE__ */ f("li", {
|
|
6791
6783
|
className: "m-0 flex p-0 first:m-0",
|
|
6792
6784
|
...i,
|
|
@@ -6807,7 +6799,7 @@ function Ni() {
|
|
|
6807
6799
|
className: "m-0 mx-1 h-5 w-px bg-grey-900"
|
|
6808
6800
|
});
|
|
6809
6801
|
}
|
|
6810
|
-
function
|
|
6802
|
+
function Qd({
|
|
6811
6803
|
isVisible: t,
|
|
6812
6804
|
children: e,
|
|
6813
6805
|
...n
|
|
@@ -6819,7 +6811,7 @@ function qd({
|
|
|
6819
6811
|
children: e
|
|
6820
6812
|
});
|
|
6821
6813
|
}
|
|
6822
|
-
async function
|
|
6814
|
+
async function qd(t) {
|
|
6823
6815
|
const e = new Image();
|
|
6824
6816
|
return e.src = t, new Promise((n, r) => {
|
|
6825
6817
|
e.onload = () => {
|
|
@@ -6834,13 +6826,13 @@ const Ti = async (t, e, n, r) => {
|
|
|
6834
6826
|
i && await n.update(() => {
|
|
6835
6827
|
x.$getNodeByKey(e).setPreviewSrc(i);
|
|
6836
6828
|
});
|
|
6837
|
-
const { width: o, height: l } = await
|
|
6829
|
+
const { width: o, height: l } = await qd(i), s = await r.imageUploader(t);
|
|
6838
6830
|
await n.update(() => {
|
|
6839
6831
|
const a = x.$getNodeByKey(e);
|
|
6840
6832
|
a.setImgWidth(o), a.setImgHeight(l), a.setSrc(s.src);
|
|
6841
6833
|
});
|
|
6842
6834
|
};
|
|
6843
|
-
function
|
|
6835
|
+
function e1({
|
|
6844
6836
|
nodeKey: t,
|
|
6845
6837
|
src: e,
|
|
6846
6838
|
altText: n,
|
|
@@ -6870,7 +6862,7 @@ function t1({
|
|
|
6870
6862
|
if (!i)
|
|
6871
6863
|
return;
|
|
6872
6864
|
const E = setTimeout(() => {
|
|
6873
|
-
|
|
6865
|
+
fr({
|
|
6874
6866
|
fileInputRef: m
|
|
6875
6867
|
}), l.update(() => {
|
|
6876
6868
|
x.$getNodeByKey(t).setTriggerFileDialog(!1);
|
|
@@ -6892,7 +6884,7 @@ function t1({
|
|
|
6892
6884
|
$ && (a(!1), await Ti($, t, l, u));
|
|
6893
6885
|
}
|
|
6894
6886
|
}, T = (u == null ? void 0 : u.uploadProgress) || 0;
|
|
6895
|
-
return /* @__PURE__ */ Y(
|
|
6887
|
+
return /* @__PURE__ */ Y(wn, {
|
|
6896
6888
|
children: [/* @__PURE__ */ f(xa, {
|
|
6897
6889
|
isSelected: c,
|
|
6898
6890
|
fileInputRef: m,
|
|
@@ -6908,7 +6900,7 @@ function t1({
|
|
|
6908
6900
|
cardWidth: d,
|
|
6909
6901
|
previewSrc: o,
|
|
6910
6902
|
uploadProgress: T
|
|
6911
|
-
}), /* @__PURE__ */ Y(
|
|
6903
|
+
}), /* @__PURE__ */ Y(Qd, {
|
|
6912
6904
|
isVisible: e && c,
|
|
6913
6905
|
"data-kg-card-toolbar": "image",
|
|
6914
6906
|
children: [/* @__PURE__ */ f(Ea, {
|
|
@@ -6938,7 +6930,7 @@ function t1({
|
|
|
6938
6930
|
label: "Replace",
|
|
6939
6931
|
icon: "imageReplace",
|
|
6940
6932
|
isActive: !1,
|
|
6941
|
-
onClick: () =>
|
|
6933
|
+
onClick: () => fr({
|
|
6942
6934
|
fileInputRef: h
|
|
6943
6935
|
})
|
|
6944
6936
|
}), /* @__PURE__ */ f(Ni, {}), /* @__PURE__ */ f(Fe, {
|
|
@@ -6952,7 +6944,7 @@ function t1({
|
|
|
6952
6944
|
}
|
|
6953
6945
|
const Ji = x.createCommand();
|
|
6954
6946
|
x.createCommand();
|
|
6955
|
-
function
|
|
6947
|
+
function t1(t) {
|
|
6956
6948
|
if (t instanceof HTMLImageElement) {
|
|
6957
6949
|
const {
|
|
6958
6950
|
alt: e,
|
|
@@ -7029,7 +7021,7 @@ const so = class extends x.DecoratorNode {
|
|
|
7029
7021
|
static importDom() {
|
|
7030
7022
|
return {
|
|
7031
7023
|
img: (n = Node) => ({
|
|
7032
|
-
conversion:
|
|
7024
|
+
conversion: t1,
|
|
7033
7025
|
priority: 1
|
|
7034
7026
|
})
|
|
7035
7027
|
};
|
|
@@ -7112,7 +7104,7 @@ const so = class extends x.DecoratorNode {
|
|
|
7112
7104
|
return /* @__PURE__ */ f(ji, {
|
|
7113
7105
|
nodeKey: this.getKey(),
|
|
7114
7106
|
width: this.__cardWidth,
|
|
7115
|
-
children: /* @__PURE__ */ f(
|
|
7107
|
+
children: /* @__PURE__ */ f(e1, {
|
|
7116
7108
|
nodeKey: this.getKey(),
|
|
7117
7109
|
src: this.__src,
|
|
7118
7110
|
altText: this.__altText,
|
|
@@ -7136,10 +7128,10 @@ xe(Ke, "kgMenu", {
|
|
|
7136
7128
|
queryParams: ["src"]
|
|
7137
7129
|
}), xe(Ke, "extensionTypes", ["gif", "jpg", "jpeg", "png", "svg", "svgz", "webp"]), xe(Ke, "mimeTypes", ["image/gif", "image/jpg", "image/jpeg", "image/png", "image/svg+xml", "image/webp"]);
|
|
7138
7130
|
const Lr = (t) => (t.src && delete t.triggerFileDialog, new Ke(t));
|
|
7139
|
-
function
|
|
7131
|
+
function n1(t) {
|
|
7140
7132
|
return t instanceof Ke;
|
|
7141
7133
|
}
|
|
7142
|
-
const
|
|
7134
|
+
const r1 = [
|
|
7143
7135
|
Je.HeadingNode,
|
|
7144
7136
|
yt.ListNode,
|
|
7145
7137
|
yt.ListItemNode,
|
|
@@ -7149,7 +7141,7 @@ const i1 = [
|
|
|
7149
7141
|
Yt,
|
|
7150
7142
|
ht,
|
|
7151
7143
|
Ke
|
|
7152
|
-
],
|
|
7144
|
+
], i1 = {
|
|
7153
7145
|
paragraph: void 0,
|
|
7154
7146
|
heading: {
|
|
7155
7147
|
h1: void 0,
|
|
@@ -7182,20 +7174,20 @@ const i1 = [
|
|
|
7182
7174
|
},
|
|
7183
7175
|
code: void 0
|
|
7184
7176
|
};
|
|
7185
|
-
function
|
|
7177
|
+
function o1(t) {
|
|
7186
7178
|
console.error(t);
|
|
7187
7179
|
}
|
|
7188
|
-
const
|
|
7180
|
+
const l1 = {
|
|
7189
7181
|
namespace: "KoenigEditor",
|
|
7190
|
-
theme:
|
|
7191
|
-
},
|
|
7182
|
+
theme: i1
|
|
7183
|
+
}, s0 = ({
|
|
7192
7184
|
initialEditorState: t,
|
|
7193
|
-
nodes: e = [...
|
|
7194
|
-
onError: n =
|
|
7185
|
+
nodes: e = [...r1],
|
|
7186
|
+
onError: n = o1,
|
|
7195
7187
|
imageUploadFunction: r,
|
|
7196
7188
|
children: i
|
|
7197
7189
|
}) => {
|
|
7198
|
-
const o = R.useMemo(() => Object.assign({},
|
|
7190
|
+
const o = R.useMemo(() => Object.assign({}, l1, {
|
|
7199
7191
|
nodes: e,
|
|
7200
7192
|
editorState: t,
|
|
7201
7193
|
onError: n
|
|
@@ -7325,8 +7317,8 @@ at.registerLexicalTextEntity = function(t, e, n, r) {
|
|
|
7325
7317
|
a === null || a.start !== 0 ? i(l) : s.length > a.end ? l.splitText(a.end) : (s = l.getPreviousSibling(), Oe.$isTextNode(s) && s.isTextEntity() && (i(s), i(l)), s = l.getNextSibling(), Oe.$isTextNode(s) && s.isTextEntity() && (i(s), l instanceof n && i(l)));
|
|
7326
7318
|
}), [o, t];
|
|
7327
7319
|
};
|
|
7328
|
-
const
|
|
7329
|
-
var
|
|
7320
|
+
const s1 = at;
|
|
7321
|
+
var a1 = s1, Ra = {}, Yn = x;
|
|
7330
7322
|
Ra.registerDragonSupport = function(t) {
|
|
7331
7323
|
let e = (n) => {
|
|
7332
7324
|
var r = t.getRootElement();
|
|
@@ -7339,11 +7331,11 @@ Ra.registerDragonSupport = function(t) {
|
|
|
7339
7331
|
if (i && i.protocol === "nuanria_messaging" && i.type === "request" && (i = i.payload) && i.functionId === "makeChanges" && (i = i.args)) {
|
|
7340
7332
|
const [o, l, s, a, u] = i;
|
|
7341
7333
|
t.update(() => {
|
|
7342
|
-
const c =
|
|
7343
|
-
if (
|
|
7334
|
+
const c = Yn.$getSelection();
|
|
7335
|
+
if (Yn.$isRangeSelection(c)) {
|
|
7344
7336
|
var d = c.anchor;
|
|
7345
7337
|
let g = d.getNode(), m = 0, h = 0;
|
|
7346
|
-
|
|
7338
|
+
Yn.$isTextNode(g) && 0 <= o && 0 <= l && (m = o, h = o + l, c.setTextNodeRange(g, m, g, h)), (m !== h || s !== "") && (c.insertRawText(s), g = d.getNode()), Yn.$isTextNode(g) && (m = a, h = a + u, d = g.getTextContentSize(), m = m > d ? d : m, h = h > d ? d : h, c.setTextNodeRange(g, m, g, h)), n.stopImmediatePropagation();
|
|
7347
7339
|
}
|
|
7348
7340
|
});
|
|
7349
7341
|
}
|
|
@@ -7353,12 +7345,12 @@ Ra.registerDragonSupport = function(t) {
|
|
|
7353
7345
|
window.removeEventListener("message", e, !0);
|
|
7354
7346
|
};
|
|
7355
7347
|
};
|
|
7356
|
-
const
|
|
7357
|
-
var
|
|
7348
|
+
const u1 = Ra;
|
|
7349
|
+
var c1 = u1, d1 = ge, Be = R, g1 = a1, Oa = ve, Xo = vu, f1 = c1, h1 = Je, Qi = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? Be.useLayoutEffect : Be.useEffect;
|
|
7358
7350
|
function Qo(t) {
|
|
7359
|
-
return t.getEditorState().read(
|
|
7351
|
+
return t.getEditorState().read(g1.$canShowPlaceholderCurry(t.isComposing(), t.isEditable()));
|
|
7360
7352
|
}
|
|
7361
|
-
function
|
|
7353
|
+
function p1(t) {
|
|
7362
7354
|
let [e, n] = Be.useState(() => Qo(t));
|
|
7363
7355
|
return Qi(() => {
|
|
7364
7356
|
function r() {
|
|
@@ -7372,7 +7364,7 @@ function m1(t) {
|
|
|
7372
7364
|
}));
|
|
7373
7365
|
}, [t]), e;
|
|
7374
7366
|
}
|
|
7375
|
-
function
|
|
7367
|
+
function m1(t, e) {
|
|
7376
7368
|
let [n, r] = Be.useState(() => t.getDecorators());
|
|
7377
7369
|
return Qi(() => t.registerDecoratorListener((i) => {
|
|
7378
7370
|
Xo.flushSync(() => {
|
|
@@ -7390,33 +7382,33 @@ function _1(t, e) {
|
|
|
7390
7382
|
return i;
|
|
7391
7383
|
}, [e, n, t]);
|
|
7392
7384
|
}
|
|
7393
|
-
function
|
|
7394
|
-
Qi(() => Oa.mergeRegister(
|
|
7385
|
+
function _1(t) {
|
|
7386
|
+
Qi(() => Oa.mergeRegister(h1.registerRichText(t), f1.registerDragonSupport(t)), [t]);
|
|
7395
7387
|
}
|
|
7396
7388
|
Ta.RichTextPlugin = function({ contentEditable: t, placeholder: e, ErrorBoundary: n }) {
|
|
7397
|
-
let [r] =
|
|
7398
|
-
return n =
|
|
7389
|
+
let [r] = d1.useLexicalComposerContext(), i = p1(r);
|
|
7390
|
+
return n = m1(r, n), _1(r), Be.createElement(Be.Fragment, null, t, i && e, n);
|
|
7399
7391
|
};
|
|
7400
|
-
const
|
|
7401
|
-
var
|
|
7402
|
-
const
|
|
7403
|
-
var
|
|
7392
|
+
const v1 = Ta;
|
|
7393
|
+
var C1 = v1;
|
|
7394
|
+
const y1 = /* @__PURE__ */ Gu(ec);
|
|
7395
|
+
var E1 = y1.jsx, er = R;
|
|
7404
7396
|
function Si(t, e) {
|
|
7405
7397
|
return Si = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
7406
7398
|
return n.__proto__ = r, n;
|
|
7407
7399
|
}, Si(t, e);
|
|
7408
7400
|
}
|
|
7409
|
-
function
|
|
7401
|
+
function x1(t, e) {
|
|
7410
7402
|
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, Si(t, e);
|
|
7411
7403
|
}
|
|
7412
|
-
function
|
|
7404
|
+
function N1(t, e) {
|
|
7413
7405
|
return t === void 0 && (t = []), e === void 0 && (e = []), t.length !== e.length || t.some(function(n, r) {
|
|
7414
7406
|
return !Object.is(n, e[r]);
|
|
7415
7407
|
});
|
|
7416
7408
|
}
|
|
7417
7409
|
var qo = {
|
|
7418
7410
|
error: null
|
|
7419
|
-
},
|
|
7411
|
+
}, T1 = function(t) {
|
|
7420
7412
|
function e() {
|
|
7421
7413
|
for (var r, i = arguments.length, o = Array(i), l = 0; l < i; l++)
|
|
7422
7414
|
o[l] = arguments[l];
|
|
@@ -7426,7 +7418,7 @@ var qo = {
|
|
|
7426
7418
|
r.props.onReset == null || (s = r.props).onReset.apply(s, u), r.reset();
|
|
7427
7419
|
}, r;
|
|
7428
7420
|
}
|
|
7429
|
-
|
|
7421
|
+
x1(e, t), e.getDerivedStateFromError = function(r) {
|
|
7430
7422
|
return {
|
|
7431
7423
|
error: r
|
|
7432
7424
|
};
|
|
@@ -7439,7 +7431,7 @@ var qo = {
|
|
|
7439
7431
|
(o = (l = this.props).onError) == null || o.call(l, r, i);
|
|
7440
7432
|
}, n.componentDidUpdate = function(r, i) {
|
|
7441
7433
|
var o = this.props.resetKeys;
|
|
7442
|
-
if (this.state.error !== null && i.error !== null &&
|
|
7434
|
+
if (this.state.error !== null && i.error !== null && N1(r.resetKeys, o)) {
|
|
7443
7435
|
var l, s;
|
|
7444
7436
|
(l = (s = this.props).onResetKeysChange) == null || l.call(s, r.resetKeys, o), this.reset();
|
|
7445
7437
|
}
|
|
@@ -7449,22 +7441,22 @@ var qo = {
|
|
|
7449
7441
|
if (r = {
|
|
7450
7442
|
error: r,
|
|
7451
7443
|
resetErrorBoundary: this.resetErrorBoundary
|
|
7452
|
-
},
|
|
7444
|
+
}, er.isValidElement(i))
|
|
7453
7445
|
return i;
|
|
7454
7446
|
if (typeof o == "function")
|
|
7455
7447
|
return o(r);
|
|
7456
7448
|
if (l)
|
|
7457
|
-
return
|
|
7449
|
+
return er.createElement(l, r);
|
|
7458
7450
|
throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
7459
7451
|
}
|
|
7460
7452
|
return this.props.children;
|
|
7461
7453
|
}, e;
|
|
7462
|
-
}(
|
|
7454
|
+
}(er.Component), S1 = function({
|
|
7463
7455
|
children: t,
|
|
7464
7456
|
onError: e
|
|
7465
7457
|
}) {
|
|
7466
|
-
return
|
|
7467
|
-
fallback: /* @__PURE__ */
|
|
7458
|
+
return er.createElement(T1, {
|
|
7459
|
+
fallback: /* @__PURE__ */ E1("div", {
|
|
7468
7460
|
style: {
|
|
7469
7461
|
border: "1px solid #f00",
|
|
7470
7462
|
color: "#f00",
|
|
@@ -7475,22 +7467,22 @@ var qo = {
|
|
|
7475
7467
|
onError: e
|
|
7476
7468
|
}, t);
|
|
7477
7469
|
};
|
|
7478
|
-
const
|
|
7479
|
-
var
|
|
7470
|
+
const w1 = S1;
|
|
7471
|
+
var R1 = w1, $a = {}, O1 = ge, cn = R, $1 = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? cn.useLayoutEffect : cn.useEffect;
|
|
7480
7472
|
$a.ContentEditable = function({ ariaActiveDescendantID: t, ariaAutoComplete: e, ariaControls: n, ariaDescribedBy: r, ariaExpanded: i, ariaLabel: o, ariaLabelledBy: l, ariaMultiline: s, ariaOwneeID: a, ariaRequired: u, autoCapitalize: c, autoComplete: d, autoCorrect: g, className: m, id: h, role: C = "textbox", spellCheck: N = !0, style: S, tabIndex: p, testid: _ }) {
|
|
7481
|
-
let [w] =
|
|
7473
|
+
let [w] = O1.useLexicalComposerContext(), [T, E] = cn.useState(!1), $ = cn.useCallback((L) => {
|
|
7482
7474
|
w.setRootElement(L);
|
|
7483
7475
|
}, [w]);
|
|
7484
|
-
return
|
|
7476
|
+
return $1(
|
|
7485
7477
|
() => (E(w.isEditable()), w.registerEditableListener((L) => {
|
|
7486
7478
|
E(L);
|
|
7487
7479
|
})),
|
|
7488
7480
|
[w]
|
|
7489
7481
|
), cn.createElement("div", { "aria-activedescendant": T ? t : null, "aria-autocomplete": T ? e : null, "aria-controls": T ? n : null, "aria-describedby": r, "aria-expanded": T && C === "combobox" ? !!i : null, "aria-label": o, "aria-labelledby": l, "aria-multiline": s, "aria-owns": T ? a : null, "aria-required": u, autoCapitalize: c !== void 0 ? String(c) : void 0, autoComplete: d, autoCorrect: g !== void 0 ? String(g) : void 0, className: m, contentEditable: T, "data-testid": _, id: h, ref: $, role: T ? C : void 0, spellCheck: N, style: S, tabIndex: p });
|
|
7490
7482
|
};
|
|
7491
|
-
const
|
|
7492
|
-
var
|
|
7493
|
-
function
|
|
7483
|
+
const A1 = $a;
|
|
7484
|
+
var M1 = A1, qi = {}, eo = {}, k1 = ve, Z = x;
|
|
7485
|
+
function D1(t, e, n, r, i) {
|
|
7494
7486
|
if (t === null || n.size === 0 && r.size === 0 && !i)
|
|
7495
7487
|
return 0;
|
|
7496
7488
|
var o = e._selection, l = t._selection;
|
|
@@ -7506,13 +7498,13 @@ function L1(t, e, n, r, i) {
|
|
|
7506
7498
|
u && (r = i.get(a), r === void 0 || Z.$isRootNode(r) || s.push(r));
|
|
7507
7499
|
return s.length === 0 ? 0 : 1 < s.length ? (r = e._nodeMap, e = r.get(o.anchor.key), l = r.get(l.anchor.key), e && l && !t._nodeMap.has(e.__key) && Z.$isTextNode(e) && e.__text.length === 1 && o.anchor.offset === 1 ? 2 : 0) : (e = s[0], t = t._nodeMap.get(e.__key), !Z.$isTextNode(t) || !Z.$isTextNode(e) || t.__mode !== e.__mode || (t = t.__text, e = e.__text, t === e) || (o = o.anchor, l = l.anchor, o.key !== l.key || o.type !== "text") ? 0 : (o = o.offset, l = l.offset, t = e.length - t.length, t === 1 && l === o - 1 ? 2 : t === -1 && l === o + 1 ? 3 : t === -1 && l === o ? 4 : 0));
|
|
7508
7500
|
}
|
|
7509
|
-
function
|
|
7501
|
+
function L1(t, e) {
|
|
7510
7502
|
let n = Date.now(), r = 0;
|
|
7511
7503
|
return (i, o, l, s, a, u) => {
|
|
7512
7504
|
let c = Date.now();
|
|
7513
7505
|
if (u.has("historic"))
|
|
7514
7506
|
return r = 0, n = c, 2;
|
|
7515
|
-
let d =
|
|
7507
|
+
let d = D1(i, o, s, a, t.isComposing()), g = (() => {
|
|
7516
7508
|
var m = l === null || l.editor === t, h = u.has("history-push");
|
|
7517
7509
|
if (!h && m && u.has("history-merge"))
|
|
7518
7510
|
return 0;
|
|
@@ -7528,7 +7520,7 @@ eo.createEmptyHistoryState = function() {
|
|
|
7528
7520
|
return { current: null, redoStack: [], undoStack: [] };
|
|
7529
7521
|
};
|
|
7530
7522
|
eo.registerHistory = function(t, e, n) {
|
|
7531
|
-
let r =
|
|
7523
|
+
let r = L1(t, n);
|
|
7532
7524
|
n = ({ editorState: l, prevEditorState: s, dirtyLeaves: a, dirtyElements: u, tags: c }) => {
|
|
7533
7525
|
const d = e.current, g = e.redoStack, m = e.undoStack, h = d === null ? null : d.editorState;
|
|
7534
7526
|
if (d === null || l !== h) {
|
|
@@ -7539,7 +7531,7 @@ eo.registerHistory = function(t, e, n) {
|
|
|
7539
7531
|
e.current = { editor: t, editorState: l };
|
|
7540
7532
|
}
|
|
7541
7533
|
};
|
|
7542
|
-
let i =
|
|
7534
|
+
let i = k1.mergeRegister(
|
|
7543
7535
|
t.registerCommand(
|
|
7544
7536
|
Z.UNDO_COMMAND,
|
|
7545
7537
|
() => {
|
|
@@ -7569,46 +7561,46 @@ eo.registerHistory = function(t, e, n) {
|
|
|
7569
7561
|
i(), o();
|
|
7570
7562
|
};
|
|
7571
7563
|
};
|
|
7572
|
-
const
|
|
7573
|
-
var
|
|
7574
|
-
function
|
|
7564
|
+
const I1 = eo;
|
|
7565
|
+
var P1 = I1, b1 = ge, wi = P1, el = R;
|
|
7566
|
+
function F1(t, e, n = 1e3) {
|
|
7575
7567
|
let r = el.useMemo(() => e || wi.createEmptyHistoryState(), [e]);
|
|
7576
7568
|
el.useEffect(() => wi.registerHistory(t, r, n), [n, t, r]);
|
|
7577
7569
|
}
|
|
7578
7570
|
qi.createEmptyHistoryState = wi.createEmptyHistoryState;
|
|
7579
7571
|
qi.HistoryPlugin = function({ externalHistoryState: t }) {
|
|
7580
|
-
let [e] =
|
|
7581
|
-
return
|
|
7572
|
+
let [e] = b1.useLexicalComposerContext();
|
|
7573
|
+
return F1(e, t), null;
|
|
7582
7574
|
};
|
|
7583
|
-
const
|
|
7584
|
-
var
|
|
7575
|
+
const B1 = qi;
|
|
7576
|
+
var z1 = B1, Aa = {}, H1 = ge, tl = R, K1 = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? tl.useLayoutEffect : tl.useEffect;
|
|
7585
7577
|
Aa.OnChangePlugin = function({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
|
|
7586
|
-
let [r] =
|
|
7587
|
-
return
|
|
7578
|
+
let [r] = H1.useLexicalComposerContext();
|
|
7579
|
+
return K1(() => {
|
|
7588
7580
|
if (n)
|
|
7589
7581
|
return r.registerUpdateListener(({ editorState: i, dirtyElements: o, dirtyLeaves: l, prevEditorState: s, tags: a }) => {
|
|
7590
7582
|
e && o.size === 0 && l.size === 0 || t && a.has("history-merge") || s.isEmpty() || n(i, r);
|
|
7591
7583
|
});
|
|
7592
7584
|
}, [r, t, e, n]), null;
|
|
7593
7585
|
};
|
|
7594
|
-
const
|
|
7595
|
-
var
|
|
7596
|
-
function
|
|
7597
|
-
ka.useEffect(() =>
|
|
7586
|
+
const W1 = Aa;
|
|
7587
|
+
var U1 = W1, Ma = {}, Pe = yt, V1 = ge, ka = R, Y1 = ve, Ge = x;
|
|
7588
|
+
function G1(t) {
|
|
7589
|
+
ka.useEffect(() => Y1.mergeRegister(t.registerCommand(Ge.INDENT_CONTENT_COMMAND, () => (Pe.indentList(), !1), Ge.COMMAND_PRIORITY_LOW), t.registerCommand(Ge.OUTDENT_CONTENT_COMMAND, () => (Pe.outdentList(), !1), Ge.COMMAND_PRIORITY_LOW), t.registerCommand(Pe.INSERT_ORDERED_LIST_COMMAND, () => (Pe.insertList(t, "number"), !0), Ge.COMMAND_PRIORITY_LOW), t.registerCommand(Pe.INSERT_UNORDERED_LIST_COMMAND, () => (Pe.insertList(t, "bullet"), !0), Ge.COMMAND_PRIORITY_LOW), t.registerCommand(
|
|
7598
7590
|
Pe.REMOVE_LIST_COMMAND,
|
|
7599
7591
|
() => (Pe.removeList(t), !0),
|
|
7600
7592
|
Ge.COMMAND_PRIORITY_LOW
|
|
7601
7593
|
), t.registerCommand(Ge.INSERT_PARAGRAPH_COMMAND, () => !!Pe.$handleListInsertParagraph(), Ge.COMMAND_PRIORITY_LOW)), [t]);
|
|
7602
7594
|
}
|
|
7603
7595
|
Ma.ListPlugin = function() {
|
|
7604
|
-
let [t] =
|
|
7596
|
+
let [t] = V1.useLexicalComposerContext();
|
|
7605
7597
|
return ka.useEffect(() => {
|
|
7606
7598
|
if (!t.hasNodes([Pe.ListNode, Pe.ListItemNode]))
|
|
7607
7599
|
throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
7608
|
-
}, [t]),
|
|
7600
|
+
}, [t]), G1(t), null;
|
|
7609
7601
|
};
|
|
7610
|
-
const
|
|
7611
|
-
var
|
|
7602
|
+
const j1 = Ma;
|
|
7603
|
+
var Z1 = j1;
|
|
7612
7604
|
const nl = 10;
|
|
7613
7605
|
function wt(t) {
|
|
7614
7606
|
const e = x.$createNodeSelection();
|
|
@@ -7619,7 +7611,7 @@ function rl(t) {
|
|
|
7619
7611
|
const e = "[data-lexical-editor] > *";
|
|
7620
7612
|
return t.closest(e);
|
|
7621
7613
|
}
|
|
7622
|
-
function
|
|
7614
|
+
function J1({
|
|
7623
7615
|
editor: t,
|
|
7624
7616
|
containerElem: e
|
|
7625
7617
|
}) {
|
|
@@ -7700,11 +7692,11 @@ function X1({
|
|
|
7700
7692
|
}
|
|
7701
7693
|
}, x.COMMAND_PRIORITY_HIGH))), null;
|
|
7702
7694
|
}
|
|
7703
|
-
function
|
|
7695
|
+
function X1({
|
|
7704
7696
|
containerElem: t = document.querySelector(".koenig-editor")
|
|
7705
7697
|
}) {
|
|
7706
7698
|
const [e] = ge.useLexicalComposerContext();
|
|
7707
|
-
return
|
|
7699
|
+
return J1({
|
|
7708
7700
|
editor: e,
|
|
7709
7701
|
containerElem: t
|
|
7710
7702
|
});
|
|
@@ -7973,22 +7965,22 @@ var X = {}, re = {}, Da = { exports: {} };
|
|
|
7973
7965
|
if (Q) {
|
|
7974
7966
|
if (le = u(Nt, oe, p, ee), !le || le.index >= p.length)
|
|
7975
7967
|
break;
|
|
7976
|
-
var
|
|
7977
|
-
for (qe += te.value.length;
|
|
7968
|
+
var Bn = le.index, Fn = le.index + le[0].length, qe = oe;
|
|
7969
|
+
for (qe += te.value.length; Bn >= qe; )
|
|
7978
7970
|
te = te.next, qe += te.value.length;
|
|
7979
7971
|
if (qe -= te.value.length, oe = qe, te.value instanceof a)
|
|
7980
7972
|
continue;
|
|
7981
|
-
for (var jt = te; jt !== _.tail && (qe <
|
|
7973
|
+
for (var jt = te; jt !== _.tail && (qe < Fn || typeof jt.value == "string"); jt = jt.next)
|
|
7982
7974
|
Ie++, qe += jt.value.length;
|
|
7983
7975
|
Ie--, Ce = p.slice(oe, qe), le.index -= oe;
|
|
7984
7976
|
} else if (le = u(Nt, 0, Ce, ee), !le)
|
|
7985
7977
|
continue;
|
|
7986
|
-
var
|
|
7978
|
+
var Bn = le.index, zn = le[0], Fr = Ce.slice(0, Bn), ao = Ce.slice(Bn + zn.length), Br = oe + Ce.length;
|
|
7987
7979
|
$ && Br > $.reach && ($.reach = Br);
|
|
7988
|
-
var
|
|
7989
|
-
Fr && (
|
|
7990
|
-
var pu = new a(L, H ? s.tokenize(
|
|
7991
|
-
if (te = g(_,
|
|
7980
|
+
var Hn = te.prev;
|
|
7981
|
+
Fr && (Hn = g(_, Hn, Fr), oe += Fr.length), m(_, Hn, Ie);
|
|
7982
|
+
var pu = new a(L, H ? s.tokenize(zn, H) : zn, q, zn);
|
|
7983
|
+
if (te = g(_, Hn, pu), ao && g(_, te, ao), Ie > 1) {
|
|
7992
7984
|
var zr = {
|
|
7993
7985
|
cause: L + "," + W,
|
|
7994
7986
|
reach: Br
|
|
@@ -9524,13 +9516,13 @@ class lt extends P.ElementNode {
|
|
|
9524
9516
|
return e = e.__language, r ? r !== e && n.setAttribute("data-highlight-language", r) : e && n.removeAttribute("data-highlight-language"), !1;
|
|
9525
9517
|
}
|
|
9526
9518
|
static importDOM() {
|
|
9527
|
-
return { code: (e) => e.textContent != null && (/\r?\n/.test(e.textContent) || ba(e, "BR")) ? { conversion: ol, priority: 1 } : null, div: () => ({ conversion:
|
|
9519
|
+
return { code: (e) => e.textContent != null && (/\r?\n/.test(e.textContent) || ba(e, "BR")) ? { conversion: ol, priority: 1 } : null, div: () => ({ conversion: Q1, priority: 1 }), pre: () => ({ conversion: ol, priority: 0 }), table: (e) => Zr(e) ? { conversion: q1, priority: 4 } : null, td: (e) => {
|
|
9528
9520
|
let n = e.closest("table");
|
|
9529
|
-
return e.classList.contains("js-file-line") ? { conversion:
|
|
9521
|
+
return e.classList.contains("js-file-line") ? { conversion: eg, priority: 4 } : n && Zr(n) ? { conversion: ll, priority: 4 } : null;
|
|
9530
9522
|
}, tr: (e) => (e = e.closest("table")) && Zr(e) ? { conversion: ll, priority: 4 } : null };
|
|
9531
9523
|
}
|
|
9532
9524
|
static importJSON(e) {
|
|
9533
|
-
let n =
|
|
9525
|
+
let n = In(e.language);
|
|
9534
9526
|
return n.setFormat(e.format), n.setIndent(e.indent), n.setDirection(e.direction), n;
|
|
9535
9527
|
}
|
|
9536
9528
|
exportJSON() {
|
|
@@ -9570,32 +9562,32 @@ class lt extends P.ElementNode {
|
|
|
9570
9562
|
return this.getLatest().__language;
|
|
9571
9563
|
}
|
|
9572
9564
|
}
|
|
9573
|
-
function
|
|
9565
|
+
function In(t) {
|
|
9574
9566
|
return new lt(t);
|
|
9575
9567
|
}
|
|
9576
9568
|
function Ir(t) {
|
|
9577
9569
|
return t instanceof lt;
|
|
9578
9570
|
}
|
|
9579
9571
|
function ol() {
|
|
9580
|
-
return { node:
|
|
9572
|
+
return { node: In(), preformatted: !0 };
|
|
9581
9573
|
}
|
|
9582
|
-
function
|
|
9574
|
+
function Q1(t) {
|
|
9583
9575
|
let e = t.style.fontFamily.match("monospace") !== null;
|
|
9584
|
-
return e ||
|
|
9576
|
+
return e || tg(t) ? { after: (n) => {
|
|
9585
9577
|
let r = t.parentNode;
|
|
9586
9578
|
return r != null && t !== r.lastChild && n.push(P.$createLineBreakNode()), n;
|
|
9587
|
-
}, node: e ?
|
|
9579
|
+
}, node: e ? In() : null, preformatted: e } : { node: null };
|
|
9588
9580
|
}
|
|
9589
|
-
function
|
|
9590
|
-
return { node:
|
|
9581
|
+
function q1() {
|
|
9582
|
+
return { node: In(), preformatted: !0 };
|
|
9591
9583
|
}
|
|
9592
9584
|
function ll() {
|
|
9593
9585
|
return { node: null };
|
|
9594
9586
|
}
|
|
9595
|
-
function
|
|
9587
|
+
function eg(t) {
|
|
9596
9588
|
return { after: (e) => (t.parentNode && t.parentNode.nextSibling && e.push(P.$createLineBreakNode()), e), node: null };
|
|
9597
9589
|
}
|
|
9598
|
-
function
|
|
9590
|
+
function tg(t) {
|
|
9599
9591
|
for (t = t.parentElement; t !== null; ) {
|
|
9600
9592
|
if (t.style.fontFamily.match("monospace") !== null)
|
|
9601
9593
|
return !0;
|
|
@@ -9609,7 +9601,7 @@ function Zr(t) {
|
|
|
9609
9601
|
let Fa = { tokenize(t, e) {
|
|
9610
9602
|
return Lt.tokenize(t, Lt.languages[e || ""] || Lt.languages.javascript);
|
|
9611
9603
|
} };
|
|
9612
|
-
function
|
|
9604
|
+
function hr(t, e) {
|
|
9613
9605
|
var n = t.length;
|
|
9614
9606
|
let r = -1;
|
|
9615
9607
|
if (e)
|
|
@@ -9635,14 +9627,14 @@ function Ba(t) {
|
|
|
9635
9627
|
var i = r.pop();
|
|
9636
9628
|
if (pe(i)) {
|
|
9637
9629
|
var o = i.getTextContent();
|
|
9638
|
-
o =
|
|
9630
|
+
o = hr(o, !0), o !== -1 && (e = i, n = o);
|
|
9639
9631
|
}
|
|
9640
9632
|
if (P.$isLineBreakNode(i))
|
|
9641
9633
|
break;
|
|
9642
9634
|
}
|
|
9643
9635
|
if (e === null)
|
|
9644
9636
|
for (t = t.getNextSiblings(); 0 < t.length; ) {
|
|
9645
|
-
if (r = t.shift(), pe(r) && (i = r.getTextContent(), i =
|
|
9637
|
+
if (r = t.shift(), pe(r) && (i = r.getTextContent(), i = hr(i, !0), i !== -1)) {
|
|
9646
9638
|
e = r, n = i;
|
|
9647
9639
|
break;
|
|
9648
9640
|
}
|
|
@@ -9658,14 +9650,14 @@ function za(t) {
|
|
|
9658
9650
|
var i = r.shift();
|
|
9659
9651
|
if (pe(i)) {
|
|
9660
9652
|
var o = i.getTextContent();
|
|
9661
|
-
o =
|
|
9653
|
+
o = hr(o, !1), o !== -1 && (e = i, n = o + 1);
|
|
9662
9654
|
}
|
|
9663
9655
|
if (P.$isLineBreakNode(i))
|
|
9664
9656
|
break;
|
|
9665
9657
|
}
|
|
9666
9658
|
if (e === null)
|
|
9667
9659
|
for (t = t.getPreviousSiblings(); 0 < t.length; ) {
|
|
9668
|
-
if (r = t.pop(), pe(r) && (i = r.getTextContent(), i =
|
|
9660
|
+
if (r = t.pop(), pe(r) && (i = r.getTextContent(), i = hr(i, !1), i !== -1)) {
|
|
9669
9661
|
e = r, n = i + 1;
|
|
9670
9662
|
break;
|
|
9671
9663
|
}
|
|
@@ -9682,7 +9674,7 @@ let Jr = /* @__PURE__ */ new Set();
|
|
|
9682
9674
|
function Ha(t, e, n) {
|
|
9683
9675
|
let r = t.getKey();
|
|
9684
9676
|
Jr.has(r) || (Jr.add(r), t.getLanguage() === void 0 && t.setLanguage("javascript"), e.update(() => {
|
|
9685
|
-
|
|
9677
|
+
ng(r, () => {
|
|
9686
9678
|
var i = P.$getNodeByKey(r);
|
|
9687
9679
|
if (!Ir(i) || !i.isAttached())
|
|
9688
9680
|
return !1;
|
|
@@ -9724,7 +9716,7 @@ function Ka(t) {
|
|
|
9724
9716
|
({ content: r } = n), typeof r == "string" ? e.push(pt(r, n.type)) : Array.isArray(r) && r.length === 1 && typeof r[0] == "string" ? e.push(pt(r[0], n.type)) : Array.isArray(r) && e.push(...Ka(r));
|
|
9725
9717
|
}), e;
|
|
9726
9718
|
}
|
|
9727
|
-
function
|
|
9719
|
+
function ng(t, e) {
|
|
9728
9720
|
if (t = P.$getNodeByKey(t), Ir(t) && t.isAttached()) {
|
|
9729
9721
|
var n = P.$getSelection();
|
|
9730
9722
|
if (P.$isRangeSelection(n)) {
|
|
@@ -9815,7 +9807,7 @@ function gl(t, e) {
|
|
|
9815
9807
|
return t ? { node: s, offset: a } = Ba(l) : { node: s, offset: a } = za(l), s !== null && a !== -1 && n.setTextNodeRange(s, a, s, a), e.preventDefault(), e.stopPropagation(), !0;
|
|
9816
9808
|
}
|
|
9817
9809
|
re.$createCodeHighlightNode = pt;
|
|
9818
|
-
re.$createCodeNode =
|
|
9810
|
+
re.$createCodeNode = In;
|
|
9819
9811
|
re.$isCodeHighlightNode = pe;
|
|
9820
9812
|
re.$isCodeNode = Ir;
|
|
9821
9813
|
re.CODE_LANGUAGE_FRIENDLY_NAME_MAP = La;
|
|
@@ -9873,8 +9865,8 @@ re.registerCodeHighlighting = function(t, e) {
|
|
|
9873
9865
|
t.registerCommand(P.MOVE_TO_START, (n) => gl(P.MOVE_TO_START, n), P.COMMAND_PRIORITY_LOW)
|
|
9874
9866
|
);
|
|
9875
9867
|
};
|
|
9876
|
-
const
|
|
9877
|
-
var
|
|
9868
|
+
const rg = re;
|
|
9869
|
+
var ig = rg, U = x, gn = ig, me = yt, rt = Je, og = ve, Xr = Vi;
|
|
9878
9870
|
function Oi(t, e) {
|
|
9879
9871
|
let n = {};
|
|
9880
9872
|
for (let r of t)
|
|
@@ -9884,37 +9876,37 @@ function Oi(t, e) {
|
|
|
9884
9876
|
function to(t) {
|
|
9885
9877
|
return t = Oi(t, (e) => e.type), { element: t.element || [], textFormat: t["text-format"] || [], textMatch: t["text-match"] || [] };
|
|
9886
9878
|
}
|
|
9887
|
-
let
|
|
9888
|
-
function
|
|
9879
|
+
let pr = /[!-/:-@[-`{-~\s]/;
|
|
9880
|
+
function lg(t) {
|
|
9889
9881
|
let e = to(t), n = e.textFormat.filter((r) => r.format.length === 1);
|
|
9890
9882
|
return () => {
|
|
9891
9883
|
let r = [];
|
|
9892
9884
|
var i = U.$getRoot().getChildren();
|
|
9893
9885
|
for (let o of i)
|
|
9894
|
-
i =
|
|
9886
|
+
i = sg(o, e.element, n, e.textMatch), i != null && r.push(i);
|
|
9895
9887
|
return r.join(`
|
|
9896
9888
|
|
|
9897
9889
|
`);
|
|
9898
9890
|
};
|
|
9899
9891
|
}
|
|
9900
|
-
function
|
|
9892
|
+
function sg(t, e, n, r) {
|
|
9901
9893
|
for (let i of e)
|
|
9902
|
-
if (e = i.export(t, (o) =>
|
|
9894
|
+
if (e = i.export(t, (o) => mr(o, n, r)), e != null)
|
|
9903
9895
|
return e;
|
|
9904
|
-
return U.$isElementNode(t) ?
|
|
9896
|
+
return U.$isElementNode(t) ? mr(t, n, r) : null;
|
|
9905
9897
|
}
|
|
9906
|
-
function
|
|
9898
|
+
function mr(t, e, n) {
|
|
9907
9899
|
let r = [];
|
|
9908
9900
|
t = t.getChildren();
|
|
9909
9901
|
e:
|
|
9910
9902
|
for (let i of t) {
|
|
9911
9903
|
for (let o of n)
|
|
9912
|
-
if (t = o.export(i, (l) =>
|
|
9904
|
+
if (t = o.export(i, (l) => mr(l, e, n), (l, s) => fl(l, s, e)), t != null) {
|
|
9913
9905
|
r.push(t);
|
|
9914
9906
|
continue e;
|
|
9915
9907
|
}
|
|
9916
9908
|
U.$isLineBreakNode(i) ? r.push(`
|
|
9917
|
-
`) : U.$isTextNode(i) ? r.push(fl(i, i.getTextContent(), e)) : U.$isElementNode(i) && r.push(
|
|
9909
|
+
`) : U.$isTextNode(i) ? r.push(fl(i, i.getTextContent(), e)) : U.$isElementNode(i) && r.push(mr(i, e, n));
|
|
9918
9910
|
}
|
|
9919
9911
|
return r.join("");
|
|
9920
9912
|
}
|
|
@@ -9951,13 +9943,13 @@ function hl(t, e) {
|
|
|
9951
9943
|
function Qr(t, e) {
|
|
9952
9944
|
return U.$isTextNode(t) && t.hasFormat(e);
|
|
9953
9945
|
}
|
|
9954
|
-
let Gt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u",
|
|
9946
|
+
let Gt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", ag = Gt && "documentMode" in document ? document.documentMode : null;
|
|
9955
9947
|
Gt && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
9956
9948
|
Gt && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
|
|
9957
|
-
Gt && "InputEvent" in window && !
|
|
9958
|
-
let pl = Gt && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), ml = Gt && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream,
|
|
9959
|
-
function
|
|
9960
|
-
let e = to(t), n =
|
|
9949
|
+
Gt && "InputEvent" in window && !ag && "getTargetRanges" in new window.InputEvent("input");
|
|
9950
|
+
let pl = Gt && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), ml = Gt && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, ug = /^\s{0,3}$/, _l = /^```(\w{1,10})?\s?$/;
|
|
9951
|
+
function cg(t) {
|
|
9952
|
+
let e = to(t), n = gg(e.textFormat);
|
|
9961
9953
|
return (r) => {
|
|
9962
9954
|
var i = r.split(`
|
|
9963
9955
|
`), o = i.length;
|
|
@@ -9988,18 +9980,18 @@ function dg(t) {
|
|
|
9988
9980
|
c.setTextContent(u.slice(g[0].length)), p(l, [c], g, !0);
|
|
9989
9981
|
break;
|
|
9990
9982
|
}
|
|
9991
|
-
|
|
9983
|
+
tr(c, d, s), l.isAttached() && 0 < a.length && (u = l.getPreviousSibling(), U.$isParagraphNode(u) || rt.$isQuoteNode(u) || me.$isListNode(u)) && (d = u, me.$isListNode(u) && (u = u.getLastDescendant(), d = u == null ? null : og.$findMatchingParent(u, me.$isListItemNode)), d != null && 0 < d.getTextContentSize() && (d.splice(d.getChildrenSize(), 0, [U.$createLineBreakNode(), ...l.getChildren()]), l.remove()));
|
|
9992
9984
|
}
|
|
9993
9985
|
}
|
|
9994
9986
|
i = r.getChildren();
|
|
9995
9987
|
for (let h of i)
|
|
9996
|
-
i = h, U.$isParagraphNode(i) ? (o = i.getFirstChild(), i = o == null || i.getChildrenSize() === 1 && U.$isTextNode(o) &&
|
|
9988
|
+
i = h, U.$isParagraphNode(i) ? (o = i.getFirstChild(), i = o == null || i.getChildrenSize() === 1 && U.$isTextNode(o) && ug.test(o.getTextContent())) : i = !1, i && h.remove();
|
|
9997
9989
|
r.selectEnd();
|
|
9998
9990
|
};
|
|
9999
9991
|
}
|
|
10000
|
-
function
|
|
9992
|
+
function tr(t, e, n) {
|
|
10001
9993
|
var r = t.getTextContent();
|
|
10002
|
-
let i =
|
|
9994
|
+
let i = dg(r, e);
|
|
10003
9995
|
if (i) {
|
|
10004
9996
|
var o, l;
|
|
10005
9997
|
if (i[0] === r)
|
|
@@ -10012,7 +10004,7 @@ function er(t, e, n) {
|
|
|
10012
10004
|
if (s.setTextContent(i[2]), t = e.transformersByTag[i[1]])
|
|
10013
10005
|
for (let a of t.format)
|
|
10014
10006
|
s.hasFormat(a) || s.toggleFormat(a);
|
|
10015
|
-
s.hasFormat("code") ||
|
|
10007
|
+
s.hasFormat("code") || tr(s, e, n), l && tr(l, e, n), o && tr(o, e, n);
|
|
10016
10008
|
} else
|
|
10017
10009
|
Wa(t, n);
|
|
10018
10010
|
}
|
|
@@ -10030,7 +10022,7 @@ function Wa(t, e) {
|
|
|
10030
10022
|
break;
|
|
10031
10023
|
}
|
|
10032
10024
|
}
|
|
10033
|
-
function
|
|
10025
|
+
function dg(t, e) {
|
|
10034
10026
|
var n = t.match(e.openTagsRegExp);
|
|
10035
10027
|
if (n == null)
|
|
10036
10028
|
return null;
|
|
@@ -10040,13 +10032,13 @@ function gg(t, e) {
|
|
|
10040
10032
|
if (r.intraword !== !1)
|
|
10041
10033
|
return n;
|
|
10042
10034
|
var { index: i = 0 } = n;
|
|
10043
|
-
if (r = t[i - 1], i = t[i + n[0].length], !(r && !
|
|
10035
|
+
if (r = t[i - 1], i = t[i + n[0].length], !(r && !pr.test(r) || i && !pr.test(i)))
|
|
10044
10036
|
return n;
|
|
10045
10037
|
}
|
|
10046
10038
|
}
|
|
10047
10039
|
return null;
|
|
10048
10040
|
}
|
|
10049
|
-
function
|
|
10041
|
+
function gg(t) {
|
|
10050
10042
|
let e = {}, n = {}, r = [];
|
|
10051
10043
|
for (let i of t) {
|
|
10052
10044
|
({ tag: t } = i), e[t] = i;
|
|
@@ -10124,7 +10116,7 @@ let Va = (t) => (e, n, r) => {
|
|
|
10124
10116
|
const e = t.getTextContent();
|
|
10125
10117
|
return "```" + (t.getLanguage() || "") + (e ? `
|
|
10126
10118
|
` + e : "") + "\n```";
|
|
10127
|
-
}, regExp: /^```(\w{1,10})?\s/, replace: Va((t) => gn.$createCodeNode(t ? t[1] : void 0)), type: "element" }, Za = { dependencies: [me.ListNode, me.ListItemNode], export: (t, e) => me.$isListNode(t) ? Pr(t, e, 0) : null, regExp: /^(\s*)[-*+]\s/, replace: no("bullet"), type: "element" },
|
|
10119
|
+
}, regExp: /^```(\w{1,10})?\s/, replace: Va((t) => gn.$createCodeNode(t ? t[1] : void 0)), type: "element" }, Za = { dependencies: [me.ListNode, me.ListItemNode], export: (t, e) => me.$isListNode(t) ? Pr(t, e, 0) : null, regExp: /^(\s*)[-*+]\s/, replace: no("bullet"), type: "element" }, fg = { dependencies: [me.ListNode, me.ListItemNode], export: (t, e) => me.$isListNode(t) ? Pr(t, e, 0) : null, regExp: /^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i, replace: no("check"), type: "element" }, Ja = { dependencies: [me.ListNode, me.ListItemNode], export: (t, e) => me.$isListNode(t) ? Pr(t, e, 0) : null, regExp: /^(\s*)(\d{1,})\.\s/, replace: no("number"), type: "element" }, Xa = { format: ["code"], tag: "`", type: "text-format" }, Qa = { format: ["bold", "italic"], tag: "***", type: "text-format" }, qa = { format: ["bold", "italic"], intraword: !1, tag: "___", type: "text-format" }, eu = { format: ["bold"], tag: "**", type: "text-format" }, tu = { format: ["bold"], intraword: !1, tag: "__", type: "text-format" }, nu = { format: ["strikethrough"], tag: "~~", type: "text-format" }, ru = { format: ["italic"], tag: "*", type: "text-format" }, iu = {
|
|
10128
10120
|
format: ["italic"],
|
|
10129
10121
|
intraword: !1,
|
|
10130
10122
|
tag: "_",
|
|
@@ -10142,16 +10134,16 @@ let Va = (t) => (e, n, r) => {
|
|
|
10142
10134
|
i.setFormat(t.getFormat()), e.append(i), t.replace(e);
|
|
10143
10135
|
}, trigger: ")", type: "text-match" }, lu = [Ya, Ga, ja, Za, Ja], su = [Xa, Qa, qa, eu, tu, ru, iu, nu], au = [ou], br = [...lu, ...su, ...au];
|
|
10144
10136
|
X.$convertFromMarkdownString = function(t, e = br) {
|
|
10145
|
-
return
|
|
10137
|
+
return cg(e)(t);
|
|
10146
10138
|
};
|
|
10147
10139
|
X.$convertToMarkdownString = function(t = br) {
|
|
10148
|
-
return
|
|
10140
|
+
return lg(t)();
|
|
10149
10141
|
};
|
|
10150
10142
|
X.BOLD_ITALIC_STAR = Qa;
|
|
10151
10143
|
X.BOLD_ITALIC_UNDERSCORE = qa;
|
|
10152
10144
|
X.BOLD_STAR = eu;
|
|
10153
10145
|
X.BOLD_UNDERSCORE = tu;
|
|
10154
|
-
X.CHECK_LIST =
|
|
10146
|
+
X.CHECK_LIST = fg;
|
|
10155
10147
|
X.CODE = ja;
|
|
10156
10148
|
X.ELEMENT_TRANSFORMERS = lu;
|
|
10157
10149
|
X.HEADING = Ya;
|
|
@@ -10222,11 +10214,11 @@ X.registerMarkdownShortcuts = function(t, e = br) {
|
|
|
10222
10214
|
var { tag: _ } = T;
|
|
10223
10215
|
S = _.length;
|
|
10224
10216
|
let E = m - S + 1;
|
|
10225
|
-
if (!(1 < S && !Ua(C, E, _, 0, S) || C[E - 1] === " ") && (N = C[m + 1], T.intraword !== !1 || !N ||
|
|
10217
|
+
if (!(1 < S && !Ua(C, E, _, 0, S) || C[E - 1] === " ") && (N = C[m + 1], T.intraword !== !1 || !N || pr.test(N))) {
|
|
10226
10218
|
g = N = d, h = vl(C, E, _);
|
|
10227
10219
|
for (var w = g; 0 > h && (w = w.getPreviousSibling()) && !U.$isLineBreakNode(w); )
|
|
10228
10220
|
U.$isTextNode(w) && (h = w.getTextContent(), g = w, h = vl(h, h.length, _));
|
|
10229
|
-
if (!(0 > h || g === N && h + S === E || (_ = g.getTextContent(), 0 < h && _[h - 1] === p || (w = _[h - 1], T.intraword === !1 && w && !
|
|
10221
|
+
if (!(0 > h || g === N && h + S === E || (_ = g.getTextContent(), 0 < h && _[h - 1] === p || (w = _[h - 1], T.intraword === !1 && w && !pr.test(w))))) {
|
|
10230
10222
|
C = N.getTextContent(), C = C.slice(0, E) + C.slice(m + 1), N.setTextContent(C), C = g === N ? C : _, g.setTextContent(C.slice(0, h) + C.slice(h + S)), C = U.$getSelection(), p = U.$createRangeSelection(), U.$setSelection(p), m = m - S * (g === N ? 2 : 1) + 1, p.anchor.set(g.__key, h, "text"), p.focus.set(N.__key, m, "text");
|
|
10231
10223
|
for (let $ of T.format)
|
|
10232
10224
|
p.hasFormat($) || p.formatText($);
|
|
@@ -10247,29 +10239,29 @@ X.registerMarkdownShortcuts = function(t, e = br) {
|
|
|
10247
10239
|
}
|
|
10248
10240
|
});
|
|
10249
10241
|
};
|
|
10250
|
-
const
|
|
10251
|
-
var dt =
|
|
10252
|
-
let
|
|
10253
|
-
function
|
|
10254
|
-
let [e] =
|
|
10255
|
-
return nn.useEffect(() =>
|
|
10242
|
+
const hg = X;
|
|
10243
|
+
var dt = hg, ro = {}, Pn = {}, pg = ge, mg = ha, _g = ve, be = x, nn = R;
|
|
10244
|
+
let vg = be.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
|
|
10245
|
+
function Cg({ nodeKey: t }) {
|
|
10246
|
+
let [e] = pg.useLexicalComposerContext(), n = nn.useRef(null), [r, i, o] = mg.useLexicalNodeSelection(t), l = nn.useCallback((s) => (r && be.$isNodeSelection(be.$getSelection()) && (s.preventDefault(), s = be.$getNodeByKey(t), uu(s) && s.remove(), i(!1)), !1), [r, t, i]);
|
|
10247
|
+
return nn.useEffect(() => _g.mergeRegister(e.registerCommand(be.CLICK_COMMAND, (s) => s.target === n.current ? (s.shiftKey || o(), i(!r), !0) : !1, be.COMMAND_PRIORITY_LOW), e.registerCommand(be.KEY_DELETE_COMMAND, l, be.COMMAND_PRIORITY_LOW), e.registerCommand(
|
|
10256
10248
|
be.KEY_BACKSPACE_COMMAND,
|
|
10257
10249
|
l,
|
|
10258
10250
|
be.COMMAND_PRIORITY_LOW
|
|
10259
10251
|
)), [o, e, r, l, i]), nn.createElement("hr", { ref: n, className: r ? "selected" : void 0 });
|
|
10260
10252
|
}
|
|
10261
|
-
class
|
|
10253
|
+
class bn extends be.DecoratorNode {
|
|
10262
10254
|
static getType() {
|
|
10263
10255
|
return "horizontalrule";
|
|
10264
10256
|
}
|
|
10265
10257
|
static clone(e) {
|
|
10266
|
-
return new
|
|
10258
|
+
return new bn(e.__key);
|
|
10267
10259
|
}
|
|
10268
10260
|
static importJSON() {
|
|
10269
10261
|
return io();
|
|
10270
10262
|
}
|
|
10271
10263
|
static importDOM() {
|
|
10272
|
-
return { hr: () => ({ conversion:
|
|
10264
|
+
return { hr: () => ({ conversion: yg, priority: 0 }) };
|
|
10273
10265
|
}
|
|
10274
10266
|
exportJSON() {
|
|
10275
10267
|
return { type: "horizontalrule", version: 1 };
|
|
@@ -10292,35 +10284,35 @@ class Pn extends be.DecoratorNode {
|
|
|
10292
10284
|
return !1;
|
|
10293
10285
|
}
|
|
10294
10286
|
decorate() {
|
|
10295
|
-
return nn.createElement(
|
|
10287
|
+
return nn.createElement(Cg, { nodeKey: this.__key });
|
|
10296
10288
|
}
|
|
10297
10289
|
}
|
|
10298
|
-
function
|
|
10290
|
+
function yg() {
|
|
10299
10291
|
return { node: io() };
|
|
10300
10292
|
}
|
|
10301
10293
|
function io() {
|
|
10302
|
-
return new
|
|
10294
|
+
return new bn();
|
|
10303
10295
|
}
|
|
10304
10296
|
function uu(t) {
|
|
10305
|
-
return t instanceof
|
|
10306
|
-
}
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
const
|
|
10312
|
-
var
|
|
10297
|
+
return t instanceof bn;
|
|
10298
|
+
}
|
|
10299
|
+
Pn.$createHorizontalRuleNode = io;
|
|
10300
|
+
Pn.$isHorizontalRuleNode = uu;
|
|
10301
|
+
Pn.HorizontalRuleNode = bn;
|
|
10302
|
+
Pn.INSERT_HORIZONTAL_RULE_COMMAND = vg;
|
|
10303
|
+
const Eg = Pn;
|
|
10304
|
+
var xg = Eg, cu = dt, Ng = ge, qr = xg, Tg = R;
|
|
10313
10305
|
let du = [{ dependencies: [qr.HorizontalRuleNode], export: (t) => qr.$isHorizontalRuleNode(t) ? "***" : null, regExp: /^(---|\*\*\*|___)\s?$/, replace: (t, e, n, r) => {
|
|
10314
10306
|
e = qr.$createHorizontalRuleNode(), r || t.getNextSibling() != null ? t.replace(e) : t.insertBefore(e), e.selectNext();
|
|
10315
10307
|
}, type: "element" }, ...cu.TRANSFORMERS];
|
|
10316
10308
|
ro.DEFAULT_TRANSFORMERS = du;
|
|
10317
10309
|
ro.MarkdownShortcutPlugin = function({ transformers: t = du }) {
|
|
10318
|
-
let [e] =
|
|
10319
|
-
return
|
|
10310
|
+
let [e] = Ng.useLexicalComposerContext();
|
|
10311
|
+
return Tg.useEffect(() => cu.registerMarkdownShortcuts(e, t), [e, t]), null;
|
|
10320
10312
|
};
|
|
10321
|
-
const
|
|
10322
|
-
var
|
|
10323
|
-
const
|
|
10313
|
+
const Sg = ro;
|
|
10314
|
+
var wg = Sg;
|
|
10315
|
+
const Rg = {
|
|
10324
10316
|
dependencies: [ht],
|
|
10325
10317
|
export: (t) => Id(t) ? "---" : null,
|
|
10326
10318
|
regExp: /^(---|\*\*\*|___)\s?$/,
|
|
@@ -10329,7 +10321,7 @@ const Og = {
|
|
|
10329
10321
|
r || t.getNextSibling() != null ? t.replace(i) : t.insertBefore(i), i.selectNext();
|
|
10330
10322
|
},
|
|
10331
10323
|
type: "element"
|
|
10332
|
-
},
|
|
10324
|
+
}, Og = {
|
|
10333
10325
|
dependencies: [Yt],
|
|
10334
10326
|
export: (t) => {
|
|
10335
10327
|
if (!Fd(t))
|
|
@@ -10344,10 +10336,10 @@ const Og = {
|
|
|
10344
10336
|
t.replace(o);
|
|
10345
10337
|
},
|
|
10346
10338
|
type: "element"
|
|
10347
|
-
},
|
|
10339
|
+
}, $g = {
|
|
10348
10340
|
dependencies: [Ke],
|
|
10349
10341
|
export: (t) => {
|
|
10350
|
-
if (
|
|
10342
|
+
if (n1(t)) {
|
|
10351
10343
|
const {
|
|
10352
10344
|
src: e,
|
|
10353
10345
|
alt: n
|
|
@@ -10365,19 +10357,19 @@ const Og = {
|
|
|
10365
10357
|
t.replace(o);
|
|
10366
10358
|
},
|
|
10367
10359
|
type: "element"
|
|
10368
|
-
},
|
|
10369
|
-
function
|
|
10370
|
-
transformers: t =
|
|
10360
|
+
}, Ag = [dt.HEADING, dt.QUOTE, dt.UNORDERED_LIST, dt.ORDERED_LIST, Rg, Og, $g], Mg = [...Ag, ...dt.TEXT_FORMAT_TRANSFORMERS, ...dt.TEXT_MATCH_TRANSFORMERS];
|
|
10361
|
+
function kg({
|
|
10362
|
+
transformers: t = Mg
|
|
10371
10363
|
} = {}) {
|
|
10372
|
-
return
|
|
10364
|
+
return wg.MarkdownShortcutPlugin({
|
|
10373
10365
|
transformers: t
|
|
10374
10366
|
});
|
|
10375
10367
|
}
|
|
10376
|
-
function
|
|
10368
|
+
function _r(t) {
|
|
10377
10369
|
const e = t.anchor, n = t.focus, r = t.anchor.getNode(), i = t.focus.getNode();
|
|
10378
10370
|
return r === i ? r : t.isBackward() ? He.$isAtNodeEnd(n) ? r : i : He.$isAtNodeEnd(e) ? i : r;
|
|
10379
10371
|
}
|
|
10380
|
-
function
|
|
10372
|
+
function Dg({
|
|
10381
10373
|
onClick: t
|
|
10382
10374
|
}) {
|
|
10383
10375
|
return /* @__PURE__ */ f("div", {
|
|
@@ -10394,7 +10386,7 @@ function Lg({
|
|
|
10394
10386
|
})
|
|
10395
10387
|
});
|
|
10396
10388
|
}
|
|
10397
|
-
function
|
|
10389
|
+
function Lg({
|
|
10398
10390
|
children: t
|
|
10399
10391
|
}) {
|
|
10400
10392
|
return /* @__PURE__ */ f("div", {
|
|
@@ -10403,7 +10395,7 @@ function Ig({
|
|
|
10403
10395
|
children: t
|
|
10404
10396
|
});
|
|
10405
10397
|
}
|
|
10406
|
-
const
|
|
10398
|
+
const Ig = ({
|
|
10407
10399
|
label: t,
|
|
10408
10400
|
children: e,
|
|
10409
10401
|
...n
|
|
@@ -10421,7 +10413,7 @@ const Pg = ({
|
|
|
10421
10413
|
role: "menu",
|
|
10422
10414
|
children: e
|
|
10423
10415
|
})]
|
|
10424
|
-
}),
|
|
10416
|
+
}), Pg = ({
|
|
10425
10417
|
label: t,
|
|
10426
10418
|
desc: e,
|
|
10427
10419
|
isSelected: n,
|
|
@@ -10457,7 +10449,7 @@ const Pg = ({
|
|
|
10457
10449
|
})]
|
|
10458
10450
|
})]
|
|
10459
10451
|
})
|
|
10460
|
-
}),
|
|
10452
|
+
}), bg = ({
|
|
10461
10453
|
label: t,
|
|
10462
10454
|
isSelected: e,
|
|
10463
10455
|
Icon: n,
|
|
@@ -10500,21 +10492,21 @@ const Pg = ({
|
|
|
10500
10492
|
queryParams: a.queryParams
|
|
10501
10493
|
});
|
|
10502
10494
|
};
|
|
10503
|
-
!a.type || a.type === "card" ? s.push(/* @__PURE__ */ f(
|
|
10495
|
+
!a.type || a.type === "card" ? s.push(/* @__PURE__ */ f(Pg, {
|
|
10504
10496
|
label: a.label,
|
|
10505
10497
|
desc: a.desc,
|
|
10506
10498
|
Icon: a.Icon,
|
|
10507
10499
|
isSelected: u,
|
|
10508
10500
|
onClick: c,
|
|
10509
10501
|
"data-kg-cardmenu-idx": i
|
|
10510
|
-
}, i)) : a.type === "snippet" && s.push(/* @__PURE__ */ f(
|
|
10502
|
+
}, i)) : a.type === "snippet" && s.push(/* @__PURE__ */ f(bg, {
|
|
10511
10503
|
label: a.label,
|
|
10512
10504
|
Icon: a.Icon,
|
|
10513
10505
|
isSelected: u,
|
|
10514
10506
|
onClick: c,
|
|
10515
10507
|
"data-kg-cardmenu-idx": i
|
|
10516
10508
|
}, i)), i = i + 1;
|
|
10517
|
-
}), r.push(/* @__PURE__ */ f(
|
|
10509
|
+
}), r.push(/* @__PURE__ */ f(Ig, {
|
|
10518
10510
|
label: o,
|
|
10519
10511
|
children: s
|
|
10520
10512
|
}, o));
|
|
@@ -10545,7 +10537,7 @@ function fu(t, { query: e } = {}) {
|
|
|
10545
10537
|
Array.isArray(l.kgMenu) ? l.kgMenu.forEach((s) => i({ nodeType: o, ...s })) : i({ nodeType: o, ...l.kgMenu });
|
|
10546
10538
|
return { menu: n, maxItemIndex: r };
|
|
10547
10539
|
}
|
|
10548
|
-
function
|
|
10540
|
+
function Fg(t) {
|
|
10549
10541
|
var W;
|
|
10550
10542
|
const [e, n] = R.useState(!1), [r, i] = R.useState(!1), [o, l] = R.useState(0), [s, a] = R.useState(null), [u, c] = R.useState({}), d = R.useRef(null);
|
|
10551
10543
|
function g(b) {
|
|
@@ -10578,7 +10570,7 @@ function Bg(t) {
|
|
|
10578
10570
|
N();
|
|
10579
10571
|
return;
|
|
10580
10572
|
}
|
|
10581
|
-
const H =
|
|
10573
|
+
const H = _r(b);
|
|
10582
10574
|
if (!x.$isParagraphNode(H) || H.getTextContent() !== "") {
|
|
10583
10575
|
N();
|
|
10584
10576
|
return;
|
|
@@ -10663,9 +10655,9 @@ function Bg(t) {
|
|
|
10663
10655
|
style: M,
|
|
10664
10656
|
ref: d,
|
|
10665
10657
|
"data-kg-plus-container": !0,
|
|
10666
|
-
children: [e && /* @__PURE__ */ f(
|
|
10658
|
+
children: [e && /* @__PURE__ */ f(Dg, {
|
|
10667
10659
|
onClick: S
|
|
10668
|
-
}), r && /* @__PURE__ */ f(
|
|
10660
|
+
}), r && /* @__PURE__ */ f(Lg, {
|
|
10669
10661
|
children: /* @__PURE__ */ f(gu, {
|
|
10670
10662
|
menu: u.menu,
|
|
10671
10663
|
insert: w
|
|
@@ -10673,11 +10665,11 @@ function Bg(t) {
|
|
|
10673
10665
|
})]
|
|
10674
10666
|
}) : null;
|
|
10675
10667
|
}
|
|
10676
|
-
function
|
|
10668
|
+
function Bg() {
|
|
10677
10669
|
const [t] = ge.useLexicalComposerContext();
|
|
10678
|
-
return
|
|
10670
|
+
return Fg(t);
|
|
10679
10671
|
}
|
|
10680
|
-
function
|
|
10672
|
+
function zg({
|
|
10681
10673
|
children: t
|
|
10682
10674
|
}) {
|
|
10683
10675
|
return /* @__PURE__ */ f("div", {
|
|
@@ -10685,7 +10677,7 @@ function Hg({
|
|
|
10685
10677
|
children: t
|
|
10686
10678
|
});
|
|
10687
10679
|
}
|
|
10688
|
-
function
|
|
10680
|
+
function Hg(t) {
|
|
10689
10681
|
var w;
|
|
10690
10682
|
const [e, n] = R.useState(!1), [r, i] = R.useState(0), [o, l] = R.useState(""), [s, a] = R.useState([]), [u, c] = R.useState({}), [d, g] = R.useState(0), m = R.useRef(null), h = R.useRef(null);
|
|
10691
10683
|
function C(T) {
|
|
@@ -10727,7 +10719,7 @@ function Kg(t) {
|
|
|
10727
10719
|
p();
|
|
10728
10720
|
return;
|
|
10729
10721
|
}
|
|
10730
|
-
const E =
|
|
10722
|
+
const E = _r(T).getTopLevelElement();
|
|
10731
10723
|
if (!E || !x.$isParagraphNode(E) || !E.getTextContent().startsWith("/")) {
|
|
10732
10724
|
p();
|
|
10733
10725
|
return;
|
|
@@ -10754,7 +10746,7 @@ function Kg(t) {
|
|
|
10754
10746
|
altKey: H
|
|
10755
10747
|
} = E;
|
|
10756
10748
|
$ !== "/" || L || M || W || b || H || !t.getRootElement().matches(":focus") || t.getEditorState().read(() => {
|
|
10757
|
-
const Q = x.$getSelection(), q =
|
|
10749
|
+
const Q = x.$getSelection(), q = _r(Q).getTopLevelElement();
|
|
10758
10750
|
if (!q || !x.$isParagraphNode(q))
|
|
10759
10751
|
return;
|
|
10760
10752
|
const ie = q.getTextContentSize(), Nt = Q.isCollapsed() && q.getTextContent() === "", te = !Q.isCollapsed() && (Q.anchor.offset === 0 && Q.focus.offset === ie || Q.anchor.offset === ie && Q.focus.offset === 0);
|
|
@@ -10813,7 +10805,7 @@ function Kg(t) {
|
|
|
10813
10805
|
},
|
|
10814
10806
|
ref: h,
|
|
10815
10807
|
"data-kg-slash-container": !0,
|
|
10816
|
-
children: /* @__PURE__ */ f(
|
|
10808
|
+
children: /* @__PURE__ */ f(zg, {
|
|
10817
10809
|
children: /* @__PURE__ */ f(gu, {
|
|
10818
10810
|
menu: u.menu,
|
|
10819
10811
|
selectedItemIndex: d,
|
|
@@ -10822,14 +10814,14 @@ function Kg(t) {
|
|
|
10822
10814
|
})
|
|
10823
10815
|
}) : null;
|
|
10824
10816
|
}
|
|
10825
|
-
function
|
|
10817
|
+
function Kg() {
|
|
10826
10818
|
const [t] = ge.useLexicalComposerContext();
|
|
10827
|
-
return
|
|
10819
|
+
return Hg(t);
|
|
10828
10820
|
}
|
|
10829
|
-
const
|
|
10830
|
-
function
|
|
10821
|
+
const Wg = 10;
|
|
10822
|
+
function Ug(t, e, n, r = {}) {
|
|
10831
10823
|
r = Object.assign({
|
|
10832
|
-
verticalGap:
|
|
10824
|
+
verticalGap: Wg,
|
|
10833
10825
|
controlOpacity: !1
|
|
10834
10826
|
}, r);
|
|
10835
10827
|
const i = n.parentElement;
|
|
@@ -10841,7 +10833,7 @@ function Vg(t, e, n, r = {}) {
|
|
|
10841
10833
|
let a = t.top - o.height - r.verticalGap, u = t.left + t.width / 2 - o.width / 2;
|
|
10842
10834
|
u < s.left && (u = s.left), u + o.width > s.right && (u = s.right - o.width), a -= l.top, u -= l.left, r.controlOpacity && (e.style.opacity = "1"), e.style.top = `${a}px`, e.style.left = `${u}px`;
|
|
10843
10835
|
}
|
|
10844
|
-
function
|
|
10836
|
+
function Vg(t, e) {
|
|
10845
10837
|
const n = t.getRangeAt(0);
|
|
10846
10838
|
let r;
|
|
10847
10839
|
if (t.anchorNode === e) {
|
|
@@ -10862,7 +10854,7 @@ function hu(t) {
|
|
|
10862
10854
|
return null;
|
|
10863
10855
|
return hu(t.parentNode) || document.body;
|
|
10864
10856
|
}
|
|
10865
|
-
const
|
|
10857
|
+
const Yg = {
|
|
10866
10858
|
bullet: "Bulleted List",
|
|
10867
10859
|
check: "Check List",
|
|
10868
10860
|
code: "Code Block",
|
|
@@ -10877,7 +10869,7 @@ const Gg = {
|
|
|
10877
10869
|
quote: "Quote",
|
|
10878
10870
|
aside: "Aside"
|
|
10879
10871
|
};
|
|
10880
|
-
function
|
|
10872
|
+
function Gg({
|
|
10881
10873
|
isText: t,
|
|
10882
10874
|
editor: e,
|
|
10883
10875
|
anchorElem: n,
|
|
@@ -10906,8 +10898,8 @@ function jg({
|
|
|
10906
10898
|
return;
|
|
10907
10899
|
const C = x.$getSelection(), N = window.getSelection(), S = e.getRootElement();
|
|
10908
10900
|
if (C !== null && N !== null && !N.isCollapsed && S !== null && S.contains(N.anchorNode)) {
|
|
10909
|
-
const p =
|
|
10910
|
-
l ||
|
|
10901
|
+
const p = Vg(N, S);
|
|
10902
|
+
l || Ug(p, h, n);
|
|
10911
10903
|
}
|
|
10912
10904
|
}, [e, n, l]), m = R.useCallback(() => {
|
|
10913
10905
|
t !== !1 && (a.current.style.opacity = "1");
|
|
@@ -10995,7 +10987,7 @@ function jg({
|
|
|
10995
10987
|
})
|
|
10996
10988
|
});
|
|
10997
10989
|
}
|
|
10998
|
-
function
|
|
10990
|
+
function jg(t, e) {
|
|
10999
10991
|
const [n, r] = R.useState(!1), [i, o] = R.useState(!1), [l, s] = R.useState(!1), [a, u] = R.useState("paragraph"), c = R.useCallback(() => {
|
|
11000
10992
|
t.getEditorState().read(() => {
|
|
11001
10993
|
if (t.isComposing())
|
|
@@ -11007,24 +10999,24 @@ function Zg(t, e) {
|
|
|
11007
10999
|
}
|
|
11008
11000
|
if (!x.$isRangeSelection(d))
|
|
11009
11001
|
return;
|
|
11010
|
-
const h =
|
|
11002
|
+
const h = _r(d), C = h.getKey() === "root" ? h : h.getTopLevelElementOrThrow(), N = C.getKey(), S = t.getElementByKey(N);
|
|
11011
11003
|
if (o(d.hasFormat("bold")), s(d.hasFormat("italic")), S !== null)
|
|
11012
11004
|
if (yt.$isListNode(C)) {
|
|
11013
11005
|
const p = ve.$getNearestNodeOfType(h, yt.ListNode), _ = p ? p.getListType() : C.getListType();
|
|
11014
11006
|
u(_);
|
|
11015
11007
|
} else {
|
|
11016
11008
|
const p = Je.$isHeadingNode(C) ? C.getTag() : C.getType();
|
|
11017
|
-
p in
|
|
11009
|
+
p in Yg && u(p);
|
|
11018
11010
|
}
|
|
11019
11011
|
d.getTextContent() !== "" ? r(x.$isTextNode(h)) : r(!1);
|
|
11020
11012
|
});
|
|
11021
11013
|
}, [t]);
|
|
11022
|
-
if (
|
|
11014
|
+
if (nr(() => (document.addEventListener("selectionchange", c), () => {
|
|
11023
11015
|
document.removeEventListener("selectionchange", c);
|
|
11024
|
-
}), [c]),
|
|
11016
|
+
}), [c]), nr(() => t.registerUpdateListener(() => {
|
|
11025
11017
|
c();
|
|
11026
11018
|
}), [t, c]), !!n)
|
|
11027
|
-
return Cu(/* @__PURE__ */ f(
|
|
11019
|
+
return Cu(/* @__PURE__ */ f(Gg, {
|
|
11028
11020
|
isText: n,
|
|
11029
11021
|
editor: t,
|
|
11030
11022
|
anchorElem: e,
|
|
@@ -11033,13 +11025,13 @@ function Zg(t, e) {
|
|
|
11033
11025
|
isItalic: l
|
|
11034
11026
|
}), e);
|
|
11035
11027
|
}
|
|
11036
|
-
function
|
|
11028
|
+
function Zg({
|
|
11037
11029
|
anchorElem: t = document.body
|
|
11038
11030
|
}) {
|
|
11039
11031
|
const [e] = ge.useLexicalComposerContext();
|
|
11040
|
-
return
|
|
11032
|
+
return jg(e, t);
|
|
11041
11033
|
}
|
|
11042
|
-
const
|
|
11034
|
+
const Jg = () => {
|
|
11043
11035
|
const [t] = ge.useLexicalComposerContext(), {
|
|
11044
11036
|
imageUploader: e
|
|
11045
11037
|
} = R.useContext(Dr), n = R.useCallback(async (r, i) => {
|
|
@@ -11072,11 +11064,11 @@ const Xg = () => {
|
|
|
11072
11064
|
);
|
|
11073
11065
|
}, [t, e, n]), null;
|
|
11074
11066
|
};
|
|
11075
|
-
function
|
|
11067
|
+
function Xg(t, e) {
|
|
11076
11068
|
const n = t.type;
|
|
11077
11069
|
return Object.keys(e).find((i) => e[i].includes(n));
|
|
11078
11070
|
}
|
|
11079
|
-
function
|
|
11071
|
+
function Qg(t, e) {
|
|
11080
11072
|
const n = t[Symbol.iterator]();
|
|
11081
11073
|
return new Promise((r, i) => {
|
|
11082
11074
|
const o = [];
|
|
@@ -11095,13 +11087,13 @@ function qg(t, e) {
|
|
|
11095
11087
|
c.addEventListener("error", i), c.addEventListener("load", () => {
|
|
11096
11088
|
typeof c.result == "string" && o.push(u), s();
|
|
11097
11089
|
});
|
|
11098
|
-
const d =
|
|
11090
|
+
const d = Xg(u, e);
|
|
11099
11091
|
d ? (c.readAsDataURL(u), l = d) : (console.error("unsupported file type"), s());
|
|
11100
11092
|
};
|
|
11101
11093
|
s();
|
|
11102
11094
|
});
|
|
11103
11095
|
}
|
|
11104
|
-
async function
|
|
11096
|
+
async function qg(t) {
|
|
11105
11097
|
const e = oo(t);
|
|
11106
11098
|
let n = {};
|
|
11107
11099
|
for (const [r, i] of e)
|
|
@@ -11110,7 +11102,7 @@ async function e0(t) {
|
|
|
11110
11102
|
acceptableMimeTypes: n
|
|
11111
11103
|
};
|
|
11112
11104
|
}
|
|
11113
|
-
function
|
|
11105
|
+
function e0() {
|
|
11114
11106
|
const [t] = ge.useLexicalComposerContext(), e = R.useCallback((i) => {
|
|
11115
11107
|
i.preventDefault(), i.stopPropagation();
|
|
11116
11108
|
}, []), n = R.useCallback(async (i) => {
|
|
@@ -11125,10 +11117,10 @@ function t0() {
|
|
|
11125
11117
|
const r = R.useCallback(async (i) => {
|
|
11126
11118
|
const {
|
|
11127
11119
|
acceptableMimeTypes: o
|
|
11128
|
-
} = await
|
|
11120
|
+
} = await qg(t), {
|
|
11129
11121
|
processed: l,
|
|
11130
11122
|
node: s
|
|
11131
|
-
} = await
|
|
11123
|
+
} = await Qg(i, o);
|
|
11132
11124
|
l.length && s === "image" && t.dispatchCommand(Ji, l);
|
|
11133
11125
|
}, [t]);
|
|
11134
11126
|
return R.useEffect(() => t.registerCommand(Je.DRAG_DROP_PASTE, async (i) => {
|
|
@@ -11139,9 +11131,9 @@ function t0() {
|
|
|
11139
11131
|
}
|
|
11140
11132
|
}, x.COMMAND_PRIORITY_LOW), [t, r]), null;
|
|
11141
11133
|
}
|
|
11142
|
-
const
|
|
11134
|
+
const t0 = () => {
|
|
11143
11135
|
const [t] = ge.useLexicalComposerContext();
|
|
11144
|
-
return
|
|
11136
|
+
return nr(() => {
|
|
11145
11137
|
if (!t.hasNodes([])) {
|
|
11146
11138
|
console.error("HorizontalRulePlugin: HorizontalRuleNode not registered");
|
|
11147
11139
|
return;
|
|
@@ -11158,13 +11150,13 @@ const n0 = () => {
|
|
|
11158
11150
|
}, x.COMMAND_PRIORITY_EDITOR);
|
|
11159
11151
|
}, [t]), null;
|
|
11160
11152
|
};
|
|
11161
|
-
function
|
|
11153
|
+
function n0() {
|
|
11162
11154
|
return /* @__PURE__ */ f("div", {
|
|
11163
11155
|
className: "pointer-events-none absolute top-0 left-0 min-w-full cursor-text font-serif text-xl text-grey-500",
|
|
11164
11156
|
children: "Begin writing your post..."
|
|
11165
11157
|
});
|
|
11166
11158
|
}
|
|
11167
|
-
const
|
|
11159
|
+
const a0 = ({
|
|
11168
11160
|
onChange: t,
|
|
11169
11161
|
markdownTransformers: e
|
|
11170
11162
|
}) => {
|
|
@@ -11179,38 +11171,38 @@ const u0 = ({
|
|
|
11179
11171
|
return /* @__PURE__ */ Y("div", {
|
|
11180
11172
|
className: "koenig-lexical",
|
|
11181
11173
|
ref: r,
|
|
11182
|
-
children: [/* @__PURE__ */ f(
|
|
11174
|
+
children: [/* @__PURE__ */ f(C1.RichTextPlugin, {
|
|
11183
11175
|
contentEditable: /* @__PURE__ */ f("div", {
|
|
11184
11176
|
ref: l,
|
|
11185
|
-
children: /* @__PURE__ */ f(
|
|
11177
|
+
children: /* @__PURE__ */ f(M1.ContentEditable, {
|
|
11186
11178
|
className: "kg-prose"
|
|
11187
11179
|
})
|
|
11188
11180
|
}),
|
|
11189
|
-
placeholder: /* @__PURE__ */ f(
|
|
11190
|
-
ErrorBoundary:
|
|
11191
|
-
}), /* @__PURE__ */ f(
|
|
11181
|
+
placeholder: /* @__PURE__ */ f(n0, {}),
|
|
11182
|
+
ErrorBoundary: R1
|
|
11183
|
+
}), /* @__PURE__ */ f(U1.OnChangePlugin, {
|
|
11192
11184
|
onChange: n
|
|
11193
|
-
}), /* @__PURE__ */ f(
|
|
11185
|
+
}), /* @__PURE__ */ f(z1.HistoryPlugin, {}), " ", /* @__PURE__ */ f(Z1.ListPlugin, {}), " ", /* @__PURE__ */ f(X1, {
|
|
11194
11186
|
containerElem: r
|
|
11195
|
-
}), /* @__PURE__ */ f(
|
|
11187
|
+
}), /* @__PURE__ */ f(kg, {
|
|
11196
11188
|
transformers: e
|
|
11197
|
-
}), /* @__PURE__ */ f(
|
|
11189
|
+
}), /* @__PURE__ */ f(Bg, {}), /* @__PURE__ */ f(Kg, {}), i && /* @__PURE__ */ f(Zg, {
|
|
11198
11190
|
anchorElem: i
|
|
11199
|
-
}), /* @__PURE__ */ f(
|
|
11191
|
+
}), /* @__PURE__ */ f(Jg, {}), /* @__PURE__ */ f(e0, {}), /* @__PURE__ */ f(t0, {})]
|
|
11200
11192
|
});
|
|
11201
11193
|
};
|
|
11202
11194
|
export {
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11195
|
+
Og as CODE_BLOCK_TRANSFORMER,
|
|
11196
|
+
r1 as DEFAULT_NODES,
|
|
11197
|
+
Mg as DEFAULT_TRANSFORMERS,
|
|
11198
|
+
l0 as DesignSandbox,
|
|
11199
|
+
Ag as ELEMENT_TRANSFORMERS,
|
|
11200
|
+
Zg as FloatingFormatToolbarPlugin,
|
|
11201
|
+
Rg as HR_TRANSFORMER,
|
|
11202
|
+
X1 as KoenigBehaviourPlugin,
|
|
11203
|
+
s0 as KoenigComposer,
|
|
11204
|
+
a0 as KoenigEditor,
|
|
11205
|
+
kg as MarkdownShortcutPlugin,
|
|
11206
|
+
Bg as PlusCardMenuPlugin
|
|
11215
11207
|
};
|
|
11216
11208
|
//# sourceMappingURL=koenig-lexical.js.map
|