reactjs-tiptap-editor 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/lib/index.d.cts +59 -59
- package/lib/index.d.ts +59 -59
- package/lib/{locales-D2yZHlj9.js → locales-BrbC7gGY.js} +1 -1
- package/lib/{locales-BYUc-X3A.cjs → locales-DBDSyO37.cjs} +1 -1
- package/lib/reactjs-tiptap-editor.cjs +1 -1
- package/lib/reactjs-tiptap-editor.js +2 -2
- package/lib/style.css +1 -1
- package/lib/{utils-DjVD_MCw.cjs → utils-BUTXoeL7.cjs} +5 -5
- package/lib/{utils-CC0wZtK5.js → utils-CLv76C-_.js} +621 -608
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import { ChevronRight as tr, Check as ai, Circle as ir, ChevronDown as Mt, Chevr
|
|
|
9
9
|
import { B as ce, N as ae, a as ue, m as ne, R as ge, n as oi, b as va, u as ya, E as ka, i as Ca, D as Na, d as Ta, c as Aa, e as La, I as Sa, U as Ma, S as Ia, C as za, f as ct, g as Ha, h as Ea, F as Ra, H as Oa, T as Pa, j as Y, k as Ba, l as Da, o as $a, O as ja, p as Fa, q as Va, r as Ua, L as Wa, s as qa, t as Ga, v as Ka, w as Xa, x as Ct, P as Za, y as Ya, z as Ja, G as Qa, A as eo, J as to, K as io, M as no, Q as ro, V as ao, W as sn, X as ln, Y as dn, Z as ci, _ as si, $ as oo, a0 as co, a1 as so, a2 as lo, a3 as ho, a4 as Mi } from "./tiptap-BGOnVdZm.js";
|
|
10
10
|
import { al as uo, am as ee, an as li, ao as di, ap as mo, aq as hn, ar as fo, as as Se, e as It, d as Me, at as un, au as hi, av as go, P as we, a as _e, a1 as Ue, a2 as qe, aw as xo, ax as Nt, ay as mn, ai as bo } from "./vendor-wdh2A0rt.js";
|
|
11
11
|
import { bundledThemes as fn, bundledLanguages as gn, createHighlighter as po } from "shiki";
|
|
12
|
-
import { u as D, C as wo, E as _o, l as V, B as vo, I as Tt, V as Gt, M as yo, D as xn, a as ko, b as Co, c as Ii, d as bn, e as No, f as Ge, g as Ke, h as ui, T as xt, i as bt, j as pt } from "./locales-
|
|
12
|
+
import { u as D, C as wo, E as _o, l as V, B as vo, I as Tt, V as Gt, M as yo, D as xn, a as ko, b as Co, c as Ii, d as bn, e as No, f as Ge, g as Ke, h as ui, T as xt, i as bt, j as pt } from "./locales-BrbC7gGY.js";
|
|
13
13
|
import * as Z from "@radix-ui/react-select";
|
|
14
14
|
import { Slot as mi } from "@radix-ui/react-slot";
|
|
15
15
|
import fi, { sticky as To } from "tippy.js";
|
|
@@ -60,8 +60,8 @@ const p = Ve.forwardRef(
|
|
|
60
60
|
// loading = false,
|
|
61
61
|
shortcutKeys: c = void 0,
|
|
62
62
|
tooltipOptions: s = {},
|
|
63
|
-
action:
|
|
64
|
-
isActive:
|
|
63
|
+
action: l = void 0,
|
|
64
|
+
isActive: d = void 0,
|
|
65
65
|
children: h,
|
|
66
66
|
asChild: u = !1,
|
|
67
67
|
upload: f = !1,
|
|
@@ -75,8 +75,8 @@ const p = Ve.forwardRef(
|
|
|
75
75
|
size: "sm",
|
|
76
76
|
className: P("richtext-w-[32px] richtext-h-[32px]", o),
|
|
77
77
|
disabled: a,
|
|
78
|
-
onClick:
|
|
79
|
-
"data-state":
|
|
78
|
+
onClick: l,
|
|
79
|
+
"data-state": d != null && d() ? "on" : "off",
|
|
80
80
|
...g,
|
|
81
81
|
children: [
|
|
82
82
|
x && /* @__PURE__ */ r(x, { className: "richtext-w-4 richtext-h-4" }),
|
|
@@ -141,16 +141,16 @@ function Po(e) {
|
|
|
141
141
|
function ut(e, t, i, n) {
|
|
142
142
|
const a = Po, [o, c] = w(a(i)), s = J(o);
|
|
143
143
|
return E(() => {
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
Object.keys(
|
|
147
|
-
(
|
|
144
|
+
const l = () => {
|
|
145
|
+
const d = { ...i, ...e.getAttributes(t) };
|
|
146
|
+
Object.keys(d).forEach((u) => {
|
|
147
|
+
(d[u] === null || d[u] === void 0) && (d[u] = i ? i[u] : null);
|
|
148
148
|
});
|
|
149
|
-
const h = a(
|
|
149
|
+
const h = a(d);
|
|
150
150
|
li(s.current, h) || (c(h), s.current = h);
|
|
151
151
|
};
|
|
152
|
-
return e.on("selectionUpdate",
|
|
153
|
-
e.off("selectionUpdate",
|
|
152
|
+
return e.on("selectionUpdate", l), e.on("transaction", l), () => {
|
|
153
|
+
e.off("selectionUpdate", l), e.off("transaction", l);
|
|
154
154
|
};
|
|
155
155
|
}, [e, i, t, a]), o;
|
|
156
156
|
}
|
|
@@ -607,12 +607,12 @@ function Ko({ editor: e, ...t }) {
|
|
|
607
607
|
const i = ut(e, Fe.name, {
|
|
608
608
|
text: "",
|
|
609
609
|
defaultShowPicker: !1
|
|
610
|
-
}), { text: n, defaultShowPicker: a } = i, [o, c] = w(""), [s,
|
|
611
|
-
e.chain().focus().setKatex({ text: o }).run(),
|
|
610
|
+
}), { text: n, defaultShowPicker: a } = i, [o, c] = w(""), [s, l] = w(!1), d = A(() => e.isActive(Fe.name), [e]), h = A(() => Qe(Fe.name, e), [e]), u = A(() => {
|
|
611
|
+
e.chain().focus().setKatex({ text: o }).run(), l(!1);
|
|
612
612
|
}, [e, o]);
|
|
613
613
|
E(() => {
|
|
614
|
-
a && (
|
|
615
|
-
}, [e, a,
|
|
614
|
+
a && (l(!0), e.chain().updateAttributes(Fe.name, { defaultShowPicker: !1 }).focus().run());
|
|
615
|
+
}, [e, a, l]), E(() => {
|
|
616
616
|
s && c(n || "");
|
|
617
617
|
}, [s]);
|
|
618
618
|
const f = B(() => {
|
|
@@ -630,7 +630,7 @@ function Ko({ editor: e, ...t }) {
|
|
|
630
630
|
{
|
|
631
631
|
editor: e,
|
|
632
632
|
pluginKey: "Katex-bubble-menu",
|
|
633
|
-
shouldShow:
|
|
633
|
+
shouldShow: d,
|
|
634
634
|
tippyOptions: {
|
|
635
635
|
popperOptions: {
|
|
636
636
|
modifiers: [{ name: "flip", enabled: !1 }]
|
|
@@ -639,7 +639,7 @@ function Ko({ editor: e, ...t }) {
|
|
|
639
639
|
offset: [-2, 16],
|
|
640
640
|
zIndex: 9999,
|
|
641
641
|
onHidden: () => {
|
|
642
|
-
|
|
642
|
+
l(!1);
|
|
643
643
|
}
|
|
644
644
|
},
|
|
645
645
|
children: t != null && t.disabled ? /* @__PURE__ */ r(q, {}) : /* @__PURE__ */ r("div", { className: "richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800", children: s ? /* @__PURE__ */ m(q, { children: [
|
|
@@ -661,7 +661,7 @@ function Ko({ editor: e, ...t }) {
|
|
|
661
661
|
/* @__PURE__ */ r("a", { href: "https://katex.org/docs/supported", target: "_blank", rel: "noreferrer noopener", children: /* @__PURE__ */ r(nn, { size: 16 }) })
|
|
662
662
|
] })
|
|
663
663
|
] }) : /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]", children: [
|
|
664
|
-
/* @__PURE__ */ r(p, { tooltip: "Edit", action: () =>
|
|
664
|
+
/* @__PURE__ */ r(p, { tooltip: "Edit", action: () => l(!s), children: /* @__PURE__ */ r(rn, { size: 16 }) }),
|
|
665
665
|
/* @__PURE__ */ r(p, { tooltip: "Delete", action: h, children: /* @__PURE__ */ r(an, { size: 16 }) })
|
|
666
666
|
] }) })
|
|
667
667
|
}
|
|
@@ -727,12 +727,12 @@ const Zo = { padding: "0 12px 12px" }, Ln = ({ width: e, maxWidth: t, height: i,
|
|
|
727
727
|
maxWidth: t
|
|
728
728
|
});
|
|
729
729
|
}, [i, t, e]);
|
|
730
|
-
function d
|
|
731
|
-
|
|
730
|
+
function l(d) {
|
|
731
|
+
d.preventDefault(), d.stopPropagation(), n(c);
|
|
732
732
|
}
|
|
733
733
|
return /* @__PURE__ */ m(se, { modal: !0, children: [
|
|
734
734
|
/* @__PURE__ */ r(le, { asChild: !0, children: a }),
|
|
735
|
-
/* @__PURE__ */ r(re, { children: /* @__PURE__ */ r("div", { style: Zo, children: /* @__PURE__ */ m("form", { className: "richtext-flex richtext-flex-col richtext-gap-2", onSubmit:
|
|
735
|
+
/* @__PURE__ */ r(re, { children: /* @__PURE__ */ r("div", { style: Zo, children: /* @__PURE__ */ m("form", { className: "richtext-flex richtext-flex-col richtext-gap-2", onSubmit: l, children: [
|
|
736
736
|
/* @__PURE__ */ r(ie, { className: "mb-[6px]", children: "Width" }),
|
|
737
737
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
|
|
738
738
|
te,
|
|
@@ -740,7 +740,7 @@ const Zo = { padding: "0 12px 12px" }, Ln = ({ width: e, maxWidth: t, height: i,
|
|
|
740
740
|
type: "number",
|
|
741
741
|
value: c.width,
|
|
742
742
|
required: !0,
|
|
743
|
-
onChange: (
|
|
743
|
+
onChange: (d) => s({ ...c, width: d.target.value })
|
|
744
744
|
}
|
|
745
745
|
) }) }),
|
|
746
746
|
/* @__PURE__ */ r(ie, { className: "mb-[6px]", children: "Max Width" }),
|
|
@@ -750,7 +750,7 @@ const Zo = { padding: "0 12px 12px" }, Ln = ({ width: e, maxWidth: t, height: i,
|
|
|
750
750
|
type: "number",
|
|
751
751
|
value: c.maxWidth,
|
|
752
752
|
required: !0,
|
|
753
|
-
onChange: (
|
|
753
|
+
onChange: (d) => s({ ...c, maxWidth: d.target.value })
|
|
754
754
|
}
|
|
755
755
|
) }) }),
|
|
756
756
|
/* @__PURE__ */ r(ie, { className: "mb-[6px]", children: "Height" }),
|
|
@@ -760,7 +760,7 @@ const Zo = { padding: "0 12px 12px" }, Ln = ({ width: e, maxWidth: t, height: i,
|
|
|
760
760
|
type: "number",
|
|
761
761
|
value: c.height,
|
|
762
762
|
required: !0,
|
|
763
|
-
onChange: (
|
|
763
|
+
onChange: (d) => s({ ...c, height: d.target.value })
|
|
764
764
|
}
|
|
765
765
|
) }) }),
|
|
766
766
|
/* @__PURE__ */ r(U, { type: "submit", className: "richtext-self-end richtext-mt-2", children: o("editor.link.dialog.button.apply") })
|
|
@@ -794,7 +794,7 @@ function Qt(e) {
|
|
|
794
794
|
}
|
|
795
795
|
const oc = 10, cc = 200, Ei = 15, Ri = { width: "100%", height: "100%", maxWidth: "100%" };
|
|
796
796
|
function sc({ editor: e, node: t, updateAttributes: i }) {
|
|
797
|
-
const n = J(null), a = e.isActive(De.name), { data: o, width: c, height: s } = t.attrs, [
|
|
797
|
+
const n = J(null), a = e.isActive(De.name), { data: o, width: c, height: s } = t.attrs, [l, d] = w(null), [h, u] = w(!0), [f, g] = w(null), [x, b] = w(!1), [C, T] = w(100), v = A(
|
|
798
798
|
(N) => {
|
|
799
799
|
N && b(!0);
|
|
800
800
|
},
|
|
@@ -817,7 +817,7 @@ function sc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
817
817
|
if (N || h || f || !x || !o)
|
|
818
818
|
return;
|
|
819
819
|
const O = await n.current(o);
|
|
820
|
-
N || (O.setAttribute("width", "100%"), O.setAttribute("height", "100%"), O.setAttribute("display", "block"),
|
|
820
|
+
N || (O.setAttribute("width", "100%"), O.setAttribute("height", "100%"), O.setAttribute("display", "block"), d(O));
|
|
821
821
|
})(), () => {
|
|
822
822
|
N = !0;
|
|
823
823
|
};
|
|
@@ -857,7 +857,7 @@ function sc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
857
857
|
transform: `scale(${C / 100})`,
|
|
858
858
|
transition: "all ease-in-out .3s"
|
|
859
859
|
},
|
|
860
|
-
dangerouslySetInnerHTML: { __html: (
|
|
860
|
+
dangerouslySetInnerHTML: { __html: (l == null ? void 0 : l.outerHTML) ?? "" }
|
|
861
861
|
}
|
|
862
862
|
),
|
|
863
863
|
/* @__PURE__ */ r("div", { className: nt.title }),
|
|
@@ -907,9 +907,9 @@ function Q(e, t = !1) {
|
|
|
907
907
|
if (a == null || typeof a == "string" && a === "null")
|
|
908
908
|
try {
|
|
909
909
|
const s = i.outerHTML.match(/([\s\S])+?="([\s\S])+?"/g);
|
|
910
|
-
s && s.length && (a = (s.map((
|
|
910
|
+
s && s.length && (a = (s.map((d) => d.trim()).reduce((d, h) => {
|
|
911
911
|
const u = h.indexOf("="), f = [h.slice(0, u), h.slice(u + 1).slice(1, -1)];
|
|
912
|
-
return
|
|
912
|
+
return d[f[0]] = f[1], d;
|
|
913
913
|
}, {})[e.toLowerCase()] || "").replaceAll(""", '"'));
|
|
914
914
|
} catch (c) {
|
|
915
915
|
console.error("Error getDatasetAttribute ", c.message, i);
|
|
@@ -1042,7 +1042,7 @@ function bc(e) {
|
|
|
1042
1042
|
_i().emit(ei, e);
|
|
1043
1043
|
}
|
|
1044
1044
|
const pc = ({ editor: e }) => {
|
|
1045
|
-
const [t, i] = w(null), [n, a] = w({}), [o, c] = w({ elements: [], appState: { isLoading: !1 }, files: null }), [s,
|
|
1045
|
+
const [t, i] = w(null), [n, a] = w({}), [o, c] = w({ elements: [], appState: { isLoading: !1 }, files: null }), [s, l] = w(!1), [d, h] = w(!0), [u, f] = w(null), g = A(
|
|
1046
1046
|
(T) => {
|
|
1047
1047
|
T && import("@excalidraw/excalidraw").then((v) => {
|
|
1048
1048
|
i(v.Excalidraw);
|
|
@@ -1061,38 +1061,38 @@ const pc = ({ editor: e }) => {
|
|
|
1061
1061
|
});
|
|
1062
1062
|
}, []), C = A(() => {
|
|
1063
1063
|
if (!t) {
|
|
1064
|
-
|
|
1064
|
+
l(!1);
|
|
1065
1065
|
return;
|
|
1066
1066
|
}
|
|
1067
|
-
e.chain().focus().setExcalidraw({ data: n }).run(),
|
|
1068
|
-
}, [t, e, n,
|
|
1067
|
+
e.chain().focus().setExcalidraw({ data: n }).run(), l(!1);
|
|
1068
|
+
}, [t, e, n, l]);
|
|
1069
1069
|
return E(() => {
|
|
1070
1070
|
const T = (v) => {
|
|
1071
|
-
|
|
1071
|
+
l(!0), v && c(v.data);
|
|
1072
1072
|
};
|
|
1073
1073
|
return gc(ei, T), () => {
|
|
1074
1074
|
xc(ei, T);
|
|
1075
1075
|
};
|
|
1076
|
-
}, [e,
|
|
1076
|
+
}, [e, l]), /* @__PURE__ */ m(
|
|
1077
1077
|
Ee,
|
|
1078
1078
|
{
|
|
1079
1079
|
open: s,
|
|
1080
|
-
onOpenChange:
|
|
1080
|
+
onOpenChange: l,
|
|
1081
1081
|
children: [
|
|
1082
1082
|
/* @__PURE__ */ r(Re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1083
1083
|
p,
|
|
1084
1084
|
{
|
|
1085
1085
|
icon: "Excalidraw",
|
|
1086
1086
|
tooltip: "Excalidraw",
|
|
1087
|
-
action: () =>
|
|
1087
|
+
action: () => l(!0)
|
|
1088
1088
|
}
|
|
1089
1089
|
) }),
|
|
1090
1090
|
/* @__PURE__ */ m(ke, { className: "!richtext-max-w-[1300px] richtext-z-[99999]", children: [
|
|
1091
1091
|
/* @__PURE__ */ r(Ce, { children: "Excalidraw" }),
|
|
1092
1092
|
/* @__PURE__ */ m("div", { style: { height: "100%", borderWidth: 1 }, children: [
|
|
1093
|
-
|
|
1093
|
+
d && /* @__PURE__ */ r("p", { children: "Loading..." }),
|
|
1094
1094
|
u && /* @__PURE__ */ r("p", { children: u && u.message || "Error" }),
|
|
1095
|
-
/* @__PURE__ */ r("div", { style: { width: "100%", height: 600 }, ref: g, children: !
|
|
1095
|
+
/* @__PURE__ */ r("div", { style: { width: "100%", height: 600 }, ref: g, children: !d && !u && t ? /* @__PURE__ */ r(t, { ref: x, onChange: b, langCode: "en", initialData: o }) : null })
|
|
1096
1096
|
] }),
|
|
1097
1097
|
/* @__PURE__ */ r(it, { children: /* @__PURE__ */ r(
|
|
1098
1098
|
U,
|
|
@@ -1200,17 +1200,17 @@ function _c({ editor: e }) {
|
|
|
1200
1200
|
createUser: "",
|
|
1201
1201
|
width: 0,
|
|
1202
1202
|
height: 0
|
|
1203
|
-
}), { defaultShowPicker: a, createUser: o, width: c, height: s } = n,
|
|
1203
|
+
}), { defaultShowPicker: a, createUser: o, width: c, height: s } = n, l = A(
|
|
1204
1204
|
(f) => {
|
|
1205
1205
|
e.chain().updateAttributes(De.name, f).setNodeSelection(e.state.selection.from).focus().run();
|
|
1206
1206
|
},
|
|
1207
1207
|
[e]
|
|
1208
|
-
),
|
|
1208
|
+
), d = A(() => {
|
|
1209
1209
|
bc(n);
|
|
1210
1210
|
}, [e, n]), h = A(() => e.isActive(De.name), [e]), u = A(() => Qe(De.name, e), [e]);
|
|
1211
1211
|
return E(() => {
|
|
1212
|
-
a && (
|
|
1213
|
-
}, [o, a, e,
|
|
1212
|
+
a && (d(), e.chain().updateAttributes(De.name, { defaultShowPicker: !1 }).focus().run());
|
|
1213
|
+
}, [o, a, e, d]), /* @__PURE__ */ r(
|
|
1214
1214
|
ce,
|
|
1215
1215
|
{
|
|
1216
1216
|
className: "bubble-menu",
|
|
@@ -1233,11 +1233,11 @@ function _c({ editor: e }) {
|
|
|
1233
1233
|
p,
|
|
1234
1234
|
{
|
|
1235
1235
|
icon: "Pencil",
|
|
1236
|
-
action:
|
|
1236
|
+
action: d,
|
|
1237
1237
|
tooltip: t("editor.edit")
|
|
1238
1238
|
}
|
|
1239
1239
|
),
|
|
1240
|
-
/* @__PURE__ */ r(Ln, { width: c, maxWidth: i, height: s, onOk:
|
|
1240
|
+
/* @__PURE__ */ r(Ln, { width: c, maxWidth: i, height: s, onOk: l, children: /* @__PURE__ */ r(
|
|
1241
1241
|
p,
|
|
1242
1242
|
{
|
|
1243
1243
|
icon: "Settings",
|
|
@@ -1273,8 +1273,8 @@ const Nc = {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
};
|
|
1275
1275
|
function Tc({ editor: e, node: t, updateAttributes: i }) {
|
|
1276
|
-
const n = Bt(), { url: a, width: o, height: c } = t.attrs, [s,
|
|
1277
|
-
function
|
|
1276
|
+
const n = Bt(), { url: a, width: o, height: c } = t.attrs, [s, l] = w("");
|
|
1277
|
+
function d() {
|
|
1278
1278
|
s && e.chain().updateAttributes($e.name, {
|
|
1279
1279
|
url: s
|
|
1280
1280
|
}).setNodeSelection(e.state.selection.from).focus().run();
|
|
@@ -1291,14 +1291,14 @@ function Tc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
1291
1291
|
te,
|
|
1292
1292
|
{
|
|
1293
1293
|
value: s,
|
|
1294
|
-
onInput: (u) =>
|
|
1294
|
+
onInput: (u) => l(u.target.value),
|
|
1295
1295
|
type: "url",
|
|
1296
1296
|
className: "richtext-flex-1",
|
|
1297
1297
|
autoFocus: !0,
|
|
1298
1298
|
placeholder: "Enter link"
|
|
1299
1299
|
}
|
|
1300
1300
|
),
|
|
1301
|
-
/* @__PURE__ */ r(U, { className: "richtext-w-[60px]", onClick:
|
|
1301
|
+
/* @__PURE__ */ r(U, { className: "richtext-w-[60px]", onClick: d, children: "OK" })
|
|
1302
1302
|
] }),
|
|
1303
1303
|
a && /* @__PURE__ */ r(
|
|
1304
1304
|
wn,
|
|
@@ -1421,11 +1421,11 @@ function Ac({ editor: e }) {
|
|
|
1421
1421
|
height: 0,
|
|
1422
1422
|
url: "",
|
|
1423
1423
|
defaultShowPicker: !1
|
|
1424
|
-
}), [o, c] = w(!1), [s,
|
|
1424
|
+
}), [o, c] = w(!1), [s, l] = w(""), d = A(() => {
|
|
1425
1425
|
c(!1);
|
|
1426
1426
|
}, [c]);
|
|
1427
1427
|
E(() => {
|
|
1428
|
-
o &&
|
|
1428
|
+
o && l(a);
|
|
1429
1429
|
}, [o, a]);
|
|
1430
1430
|
const h = A(() => {
|
|
1431
1431
|
e.chain().updateAttributes($e.name, {
|
|
@@ -1508,14 +1508,14 @@ function Ac({ editor: e }) {
|
|
|
1508
1508
|
te,
|
|
1509
1509
|
{
|
|
1510
1510
|
value: s,
|
|
1511
|
-
onInput: (C) =>
|
|
1511
|
+
onInput: (C) => l(C.target.value),
|
|
1512
1512
|
type: "url",
|
|
1513
1513
|
autoFocus: !0,
|
|
1514
1514
|
placeholder: "Enter link"
|
|
1515
1515
|
}
|
|
1516
1516
|
),
|
|
1517
1517
|
/* @__PURE__ */ m(it, { children: [
|
|
1518
|
-
/* @__PURE__ */ r(U, { onClick:
|
|
1518
|
+
/* @__PURE__ */ r(U, { onClick: d, children: "Cancel" }),
|
|
1519
1519
|
/* @__PURE__ */ r(U, { onClick: h, children: "OK" })
|
|
1520
1520
|
] })
|
|
1521
1521
|
] })
|
|
@@ -1564,12 +1564,12 @@ function vi(e, t) {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
const Bi = `graph TB
|
|
1566
1566
|
a-->b`, Hc = ({ editor: e, attrs: t, extension: i }) => {
|
|
1567
|
-
const { alt: n, align: a } = t, [o, c] = w(decodeURIComponent(n ?? Bi)), [s,
|
|
1567
|
+
const { alt: n, align: a } = t, [o, c] = w(decodeURIComponent(n ?? Bi)), [s, l] = w(""), [d, h] = w(!1), u = J(null), f = i == null ? void 0 : i.options.upload, g = async (C) => {
|
|
1568
1568
|
try {
|
|
1569
1569
|
const { svg: T } = await At.render("mermaid-svg", C);
|
|
1570
|
-
|
|
1570
|
+
l(T);
|
|
1571
1571
|
} catch {
|
|
1572
|
-
|
|
1572
|
+
l("");
|
|
1573
1573
|
}
|
|
1574
1574
|
}, x = () => {
|
|
1575
1575
|
At.initialize({
|
|
@@ -1581,13 +1581,13 @@ a-->b`, Hc = ({ editor: e, attrs: t, extension: i }) => {
|
|
|
1581
1581
|
}), g(o);
|
|
1582
1582
|
};
|
|
1583
1583
|
return E(() => {
|
|
1584
|
-
|
|
1585
|
-
}, [
|
|
1586
|
-
|
|
1584
|
+
d && x();
|
|
1585
|
+
}, [d]), E(() => {
|
|
1586
|
+
d && g(o);
|
|
1587
1587
|
}, [o]), /* @__PURE__ */ m(
|
|
1588
1588
|
Ee,
|
|
1589
1589
|
{
|
|
1590
|
-
open:
|
|
1590
|
+
open: d,
|
|
1591
1591
|
onOpenChange: h,
|
|
1592
1592
|
children: [
|
|
1593
1593
|
/* @__PURE__ */ r(Re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -1697,9 +1697,9 @@ function Pc(e) {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
function Bc(e) {
|
|
1699
1699
|
const { lang: t } = D(), i = ut(e.editor, en.name), n = Ec(e.editor, en.name), a = ({ editor: c }) => {
|
|
1700
|
-
const { selection: s } = c.view.state, { $from:
|
|
1700
|
+
const { selection: s } = c.view.state, { $from: l, to: d } = s;
|
|
1701
1701
|
let h = !1;
|
|
1702
|
-
return c.view.state.doc.nodesBetween(
|
|
1702
|
+
return c.view.state.doc.nodesBetween(l.pos, d, (u) => {
|
|
1703
1703
|
if (Pc(u))
|
|
1704
1704
|
return h = !0, !1;
|
|
1705
1705
|
}), h;
|
|
@@ -1855,8 +1855,8 @@ function Rn(e) {
|
|
|
1855
1855
|
] }) });
|
|
1856
1856
|
}
|
|
1857
1857
|
function Vc({ editor: e, disabled: t }) {
|
|
1858
|
-
const [i, n] = w(!1), { t: a } = D(), o = A(({ editor:
|
|
1859
|
-
e.commands.updateTweet({ src:
|
|
1858
|
+
const [i, n] = w(!1), { t: a } = D(), o = A(({ editor: l }) => l.isActive(ti.name), []), c = (l) => {
|
|
1859
|
+
e.commands.updateTweet({ src: l }), n(!1);
|
|
1860
1860
|
}, s = A(() => Qe(ti.name, e), [e]);
|
|
1861
1861
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
1862
1862
|
ce,
|
|
@@ -1907,13 +1907,13 @@ function Vc({ editor: e, disabled: t }) {
|
|
|
1907
1907
|
}
|
|
1908
1908
|
function Uc({ editor: e, disabled: t, bubbleMenu: i }) {
|
|
1909
1909
|
const n = e.extensionManager.extensions.map((o) => o.name), a = () => {
|
|
1910
|
-
var o, c, s,
|
|
1910
|
+
var o, c, s, l, d, h, u, f, g, x, b, C, T;
|
|
1911
1911
|
return [
|
|
1912
1912
|
n.includes("columns") && !((o = i == null ? void 0 : i.columnConfig) != null && o.hidden) ? /* @__PURE__ */ r(Zs, { editor: e }, "columns") : null,
|
|
1913
1913
|
n.includes("table") && !((c = i == null ? void 0 : i.tableConfig) != null && c.hidden) ? /* @__PURE__ */ r(js, { editor: e }, "table") : null,
|
|
1914
1914
|
n.includes("link") && !((s = i == null ? void 0 : i.linkConfig) != null && s.hidden) ? /* @__PURE__ */ r(Vs, { editor: e, disabled: t }, "link") : null,
|
|
1915
|
-
n.includes("image") && !((
|
|
1916
|
-
n.includes(Jn.name) && !((
|
|
1915
|
+
n.includes("image") && !((l = i == null ? void 0 : i.imageConfig) != null && l.hidden) ? /* @__PURE__ */ r(Gs, { editor: e, disabled: t }, "image") : null,
|
|
1916
|
+
n.includes(Jn.name) && !((d = i == null ? void 0 : i.imageGifConfig) != null && d.hidden) ? /* @__PURE__ */ r(Ks, { editor: e, disabled: t }, "imageGif") : null,
|
|
1917
1917
|
n.includes("video") && !((h = i == null ? void 0 : i.videoConfig) != null && h.hidden) ? /* @__PURE__ */ r(Xs, { editor: e, disabled: t }, "video") : null,
|
|
1918
1918
|
n.includes("katex") && !((u = i == null ? void 0 : i.katexConfig) != null && u.hidden) ? /* @__PURE__ */ r(Ko, { editor: e, disabled: t }, "katex") : null,
|
|
1919
1919
|
n.includes("excalidraw") && !((f = i == null ? void 0 : i.excalidrawConfig) != null && f.hidden) ? /* @__PURE__ */ r(_c, { editor: e, disabled: t }, "excalidraw") : null,
|
|
@@ -1937,13 +1937,13 @@ function On(e) {
|
|
|
1937
1937
|
setSelectedColor: o,
|
|
1938
1938
|
onChange: c,
|
|
1939
1939
|
colors: s = wo
|
|
1940
|
-
} = e,
|
|
1940
|
+
} = e, l = B(() => {
|
|
1941
1941
|
const g = s, x = [];
|
|
1942
1942
|
for (let b = 0; b < g.length; b += 10)
|
|
1943
1943
|
x.push(g.slice(b, b + 10));
|
|
1944
1944
|
return x;
|
|
1945
|
-
}, [s]), [
|
|
1946
|
-
const x = [...
|
|
1945
|
+
}, [s]), [d, h] = w([]), u = (g) => {
|
|
1946
|
+
const x = [...d], b = x.indexOf(g);
|
|
1947
1947
|
b !== -1 && x.splice(b, 1), x.unshift(g), x.length > 10 && x.pop(), h(x);
|
|
1948
1948
|
};
|
|
1949
1949
|
function f(g) {
|
|
@@ -1979,7 +1979,7 @@ function On(e) {
|
|
|
1979
1979
|
]
|
|
1980
1980
|
}
|
|
1981
1981
|
),
|
|
1982
|
-
|
|
1982
|
+
l.map((g, x) => /* @__PURE__ */ r("span", { className: "richtext-relative richtext-flex richtext-w-full richtext-h-auto richtext-p-0 last:richtext-pb-2", children: g.map((b, C) => /* @__PURE__ */ r(
|
|
1983
1983
|
"span",
|
|
1984
1984
|
{
|
|
1985
1985
|
className: "richtext-w-6 richtext-h-6 richtext-p-0.5 richtext-inline-block richtext-rounded-sm !richtext-border richtext-border-transparent richtext-flex-[0_0_auto] richtext-cursor-pointer hover:richtext-border-border hover:richtext-shadow-sm",
|
|
@@ -2019,7 +2019,7 @@ function On(e) {
|
|
|
2019
2019
|
)) }, x)),
|
|
2020
2020
|
/* @__PURE__ */ m("div", { children: [
|
|
2021
2021
|
/* @__PURE__ */ r("div", { className: "richtext-my-1 richtext-text-sm", children: t("editor.recent") }),
|
|
2022
|
-
/* @__PURE__ */ r("span", { className: "richtext-relative richtext-flex richtext-w-full richtext-h-auto richtext-p-0 last:richtext-pb-2", children:
|
|
2022
|
+
/* @__PURE__ */ r("span", { className: "richtext-relative richtext-flex richtext-w-full richtext-h-auto richtext-p-0 last:richtext-pb-2", children: d == null ? void 0 : d.map((g, x) => /* @__PURE__ */ r(
|
|
2023
2023
|
"span",
|
|
2024
2024
|
{
|
|
2025
2025
|
className: "richtext-w-6 richtext-h-6 richtext-p-0.5 richtext-inline-block richtext-rounded-sm !richtext-border richtext-border-transparent richtext-flex-[0_0_auto] richtext-cursor-pointer hover:richtext-border-border hover:richtext-shadow-sm",
|
|
@@ -2275,21 +2275,21 @@ function Dn(e) {
|
|
|
2275
2275
|
function $n(e, t = {}) {
|
|
2276
2276
|
const { csp: i, prepend: n, priority: a = 0 } = t, o = Yc(n), c = o === "prependQueue", s = document.createElement("style");
|
|
2277
2277
|
s.setAttribute(ji, o), c && a && s.setAttribute(Fi, `${a}`), i != null && i.nonce && (s.nonce = i == null ? void 0 : i.nonce), s.innerHTML = e;
|
|
2278
|
-
const
|
|
2278
|
+
const l = yi(t), { firstChild: d } = l;
|
|
2279
2279
|
if (n) {
|
|
2280
2280
|
if (c) {
|
|
2281
|
-
const h = Dn(
|
|
2281
|
+
const h = Dn(l).filter((u) => {
|
|
2282
2282
|
if (!["prepend", "prependQueue"].includes(u.getAttribute(ji)))
|
|
2283
2283
|
return !1;
|
|
2284
2284
|
const f = Number(u.getAttribute(Fi) || 0);
|
|
2285
2285
|
return a >= f;
|
|
2286
2286
|
});
|
|
2287
2287
|
if (h.length > 0)
|
|
2288
|
-
return
|
|
2288
|
+
return l.insertBefore(s, h.at(-1).nextSibling), s;
|
|
2289
2289
|
}
|
|
2290
|
-
|
|
2290
|
+
d.before(s);
|
|
2291
2291
|
} else
|
|
2292
|
-
|
|
2292
|
+
l.append(s);
|
|
2293
2293
|
return s;
|
|
2294
2294
|
}
|
|
2295
2295
|
function jn(e, t = {}) {
|
|
@@ -2308,12 +2308,12 @@ function Qc(e, t) {
|
|
|
2308
2308
|
}
|
|
2309
2309
|
}
|
|
2310
2310
|
function es(e, t, i = {}) {
|
|
2311
|
-
var c, s,
|
|
2311
|
+
var c, s, l;
|
|
2312
2312
|
const n = yi(i);
|
|
2313
2313
|
Qc(n, i);
|
|
2314
2314
|
const a = jn(t, i);
|
|
2315
2315
|
if (a)
|
|
2316
|
-
return (c = i.csp) != null && c.nonce && a.nonce !== ((s = i.csp) == null ? void 0 : s.nonce) && (a.nonce = (
|
|
2316
|
+
return (c = i.csp) != null && c.nonce && a.nonce !== ((s = i.csp) == null ? void 0 : s.nonce) && (a.nonce = (l = i.csp) == null ? void 0 : l.nonce), a.innerHTML !== e && (a.innerHTML = e), a;
|
|
2317
2317
|
const o = $n(e, i);
|
|
2318
2318
|
return o.setAttribute(Bn(i), t), o;
|
|
2319
2319
|
}
|
|
@@ -2343,7 +2343,7 @@ function is(e, t) {
|
|
|
2343
2343
|
}), ...h].map((f, g) => f.configure({ sort: g }));
|
|
2344
2344
|
}, [n]), c = Se((h) => {
|
|
2345
2345
|
var f;
|
|
2346
|
-
const u =
|
|
2346
|
+
const u = l(h, e.output);
|
|
2347
2347
|
(f = e == null ? void 0 : e.onChangeContent) == null || f.call(e, u);
|
|
2348
2348
|
}, _o), s = ya({
|
|
2349
2349
|
extensions: o,
|
|
@@ -2362,36 +2362,36 @@ function is(e, t) {
|
|
|
2362
2362
|
}, [s, e == null ? void 0 : e.disabled]), E(() => ((e == null ? void 0 : e.resetCSS) !== !1 && es(qc, "react-tiptap-reset"), () => {
|
|
2363
2363
|
Jc("react-tiptap-reset");
|
|
2364
2364
|
}), [e == null ? void 0 : e.resetCSS]);
|
|
2365
|
-
function
|
|
2365
|
+
function l(h, u) {
|
|
2366
2366
|
return e != null && e.removeDefaultWrapper ? u === "html" ? h.isEmpty ? "" : h.getHTML() : u === "json" ? h.isEmpty ? {} : h.getJSON() : u === "text" ? h.isEmpty ? "" : h.getText() : "" : u === "html" ? h.getHTML() : u === "json" ? h.getJSON() : u === "text" ? h.getText() : "";
|
|
2367
2367
|
}
|
|
2368
2368
|
E(() => () => {
|
|
2369
2369
|
var h;
|
|
2370
2370
|
(h = s == null ? void 0 : s.destroy) == null || h.call(s);
|
|
2371
2371
|
}, []);
|
|
2372
|
-
const
|
|
2372
|
+
const d = Mn(s, "characterCount");
|
|
2373
2373
|
return s ? /* @__PURE__ */ r("div", { className: "reactjs-tiptap-editor", children: /* @__PURE__ */ r(Vo, { delayDuration: 0, disableHoverableContent: !0, children: /* @__PURE__ */ r("div", { className: "richtext-rounded-[0.5rem] richtext-bg-background richtext-shadow richtext-overflow-hidden richtext-outline richtext-outline-1", children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-flex-col richtext-w-full richtext-max-h-full", children: [
|
|
2374
2374
|
!(e != null && e.hideToolbar) && /* @__PURE__ */ r(ns, { editor: s, disabled: !!(e != null && e.disabled) }),
|
|
2375
2375
|
/* @__PURE__ */ r(ka, { className: `richtext-relative ${(e == null ? void 0 : e.contentClass) || ""}`, editor: s }),
|
|
2376
|
-
|
|
2376
|
+
d && /* @__PURE__ */ r(ts, { editor: s, extensions: n }),
|
|
2377
2377
|
!(e != null && e.hideBubble) && /* @__PURE__ */ r(Uc, { bubbleMenu: e == null ? void 0 : e.bubbleMenu, editor: s, disabled: e == null ? void 0 : e.disabled })
|
|
2378
2378
|
] }) }) }) }) : /* @__PURE__ */ r(q, {});
|
|
2379
2379
|
}
|
|
2380
|
-
const
|
|
2380
|
+
const Yh = Lt(is);
|
|
2381
2381
|
function ns({ editor: e, disabled: t }) {
|
|
2382
2382
|
const { t: i, lang: n } = D(), a = B(() => {
|
|
2383
|
-
const c = [...e.extensionManager.extensions].sort((
|
|
2384
|
-
const h =
|
|
2383
|
+
const c = [...e.extensionManager.extensions].sort((l, d) => {
|
|
2384
|
+
const h = l.options.sort ?? -1, u = d.options.sort ?? -1;
|
|
2385
2385
|
return h - u;
|
|
2386
2386
|
});
|
|
2387
2387
|
let s = [];
|
|
2388
|
-
for (const
|
|
2389
|
-
const { button:
|
|
2390
|
-
if (!
|
|
2388
|
+
for (const l of c) {
|
|
2389
|
+
const { button: d, divider: h = !1, spacer: u = !1, toolbar: f = !0 } = l.options;
|
|
2390
|
+
if (!d || !rc(d) || !f)
|
|
2391
2391
|
continue;
|
|
2392
|
-
const g =
|
|
2392
|
+
const g = d({
|
|
2393
2393
|
editor: e,
|
|
2394
|
-
extension:
|
|
2394
|
+
extension: l,
|
|
2395
2395
|
t: i
|
|
2396
2396
|
});
|
|
2397
2397
|
if (Array.isArray(g)) {
|
|
@@ -2416,7 +2416,7 @@ function ns({ editor: e, disabled: t }) {
|
|
|
2416
2416
|
opacity: t ? 0.5 : 1
|
|
2417
2417
|
},
|
|
2418
2418
|
children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-flex richtext-flex-wrap richtext-h-auto richtext-gap-y-1 richtext-gap-x-1", children: a.map((o, c) => {
|
|
2419
|
-
var
|
|
2419
|
+
var l, d;
|
|
2420
2420
|
const s = o.button.component;
|
|
2421
2421
|
return /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center", children: [
|
|
2422
2422
|
(o == null ? void 0 : o.spacer) && /* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-h-[16px] !richtext-mx-[10px]" }),
|
|
@@ -2424,7 +2424,7 @@ function ns({ editor: e, disabled: t }) {
|
|
|
2424
2424
|
s,
|
|
2425
2425
|
{
|
|
2426
2426
|
...o.button.componentProps,
|
|
2427
|
-
disabled: t || ((
|
|
2427
|
+
disabled: t || ((d = (l = o == null ? void 0 : o.button) == null ? void 0 : l.componentProps) == null ? void 0 : d.disabled)
|
|
2428
2428
|
}
|
|
2429
2429
|
),
|
|
2430
2430
|
(o == null ? void 0 : o.divider) && /* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-h-auto !richtext-mx-2" })
|
|
@@ -3018,9 +3018,9 @@ function Rs(e, t, i, n) {
|
|
|
3018
3018
|
if (!a || !o || !(o instanceof Me || o instanceof un))
|
|
3019
3019
|
return e;
|
|
3020
3020
|
const { from: c, to: s } = o;
|
|
3021
|
-
return a.nodesBetween(c, s, (
|
|
3022
|
-
const h =
|
|
3023
|
-
return i.includes(h.name) ? (e = ni(e,
|
|
3021
|
+
return a.nodesBetween(c, s, (l, d) => {
|
|
3022
|
+
const h = l.type;
|
|
3023
|
+
return i.includes(h.name) ? (e = ni(e, d, t), !1) : !Ca(l.type.name, n.extensionManager.extensions);
|
|
3024
3024
|
}), e;
|
|
3025
3025
|
}
|
|
3026
3026
|
function ni(e, t, i) {
|
|
@@ -3047,9 +3047,9 @@ function Vi({ delta: e, types: t }) {
|
|
|
3047
3047
|
}
|
|
3048
3048
|
function Os(e) {
|
|
3049
3049
|
var M, L, S;
|
|
3050
|
-
const { pluginKey: t = Ta } = e, { t: i } = D(), [n, a] = w(null), [o, c] = w(-1), s = J(null),
|
|
3050
|
+
const { pluginKey: t = Ta } = e, { t: i } = D(), [n, a] = w(null), [o, c] = w(-1), s = J(null), l = J(null), [d, h] = w(!1), u = e.editor.extensionManager.extensions.some((y) => y.name === "textAlign"), f = e.editor.extensionManager.extensions.some((y) => y.name === "indent"), g = e.editor.extensionManager.extensions.some((y) => y.name === "clear");
|
|
3051
3051
|
E(() => {
|
|
3052
|
-
s.current && !e.editor.isDestroyed && (
|
|
3052
|
+
s.current && !e.editor.isDestroyed && (l.current = Na({
|
|
3053
3053
|
editor: e.editor,
|
|
3054
3054
|
element: s.current,
|
|
3055
3055
|
pluginKey: "ContentItemMenu",
|
|
@@ -3059,7 +3059,7 @@ function Os(e) {
|
|
|
3059
3059
|
moveTransition: "transform 0.15s ease-out"
|
|
3060
3060
|
},
|
|
3061
3061
|
onNodeChange: N
|
|
3062
|
-
}), e.editor.registerPlugin(
|
|
3062
|
+
}), e.editor.registerPlugin(l.current));
|
|
3063
3063
|
}, [e.editor, s]);
|
|
3064
3064
|
function x() {
|
|
3065
3065
|
const y = e.editor.chain();
|
|
@@ -3100,13 +3100,13 @@ function Os(e) {
|
|
|
3100
3100
|
), G(X)) : !0).focus(z).run();
|
|
3101
3101
|
}
|
|
3102
3102
|
}
|
|
3103
|
-
E(() => (
|
|
3103
|
+
E(() => (d ? e.editor.commands.setMeta("lockDragHandle", !0) : e.editor.commands.setMeta("lockDragHandle", !1), () => {
|
|
3104
3104
|
e.editor.commands.setMeta("lockDragHandle", !1);
|
|
3105
|
-
}), [
|
|
3106
|
-
|
|
3105
|
+
}), [d]), E(() => () => {
|
|
3106
|
+
l.current && (e.editor.unregisterPlugin(t), l.current = null);
|
|
3107
3107
|
}, []), E(() => {
|
|
3108
3108
|
var y;
|
|
3109
|
-
(y = e.editor) != null && y.isDestroyed &&
|
|
3109
|
+
(y = e.editor) != null && y.isDestroyed && l.current && (e.editor.unregisterPlugin(t), l.current = null);
|
|
3110
3110
|
}, [(M = e.editor) == null ? void 0 : M.isDestroyed]);
|
|
3111
3111
|
const O = (y) => {
|
|
3112
3112
|
e != null && e.disabled || h(y);
|
|
@@ -3132,7 +3132,7 @@ function Os(e) {
|
|
|
3132
3132
|
children: /* @__PURE__ */ r(F, { name: "Plus", className: "richtext-text-lg richtext-text-neutral-600 dark:richtext-text-neutral-200" })
|
|
3133
3133
|
}
|
|
3134
3134
|
),
|
|
3135
|
-
/* @__PURE__ */ m(ve, { open:
|
|
3135
|
+
/* @__PURE__ */ m(ve, { open: d, onOpenChange: O, children: [
|
|
3136
3136
|
/* @__PURE__ */ m("div", { className: "richtext-relative richtext-flex richtext-flex-col", children: [
|
|
3137
3137
|
/* @__PURE__ */ m(et, { children: [
|
|
3138
3138
|
/* @__PURE__ */ r(tt, { asChild: !0, disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(
|
|
@@ -3256,8 +3256,8 @@ function Bs({ item: e, disabled: t, editor: i }) {
|
|
|
3256
3256
|
}
|
|
3257
3257
|
function Ds(e) {
|
|
3258
3258
|
const { t, lang: i } = D(), n = ({ editor: o }) => {
|
|
3259
|
-
const { selection: c } = o.view.state, { $from: s, to:
|
|
3260
|
-
return s.pos ===
|
|
3259
|
+
const { selection: c } = o.view.state, { $from: s, to: l } = c;
|
|
3260
|
+
return s.pos === l ? !1 : c instanceof Me;
|
|
3261
3261
|
}, a = B(() => e.disabled || !(e != null && e.editor) ? [] : Hs(e.editor, t), [e.disabled, e.editor, i, t]);
|
|
3262
3262
|
return /* @__PURE__ */ r(ce, { shouldShow: n, editor: e == null ? void 0 : e.editor, tippyOptions: Ps, children: a != null && a.length ? /* @__PURE__ */ r("div", { className: "richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background", children: /* @__PURE__ */ r("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px] richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative", children: a == null ? void 0 : a.map((o, c) => (o == null ? void 0 : o.type) === "divider" ? /* @__PURE__ */ r(
|
|
3263
3263
|
he,
|
|
@@ -3384,10 +3384,10 @@ function js({ editor: e, disabled: t }) {
|
|
|
3384
3384
|
function s() {
|
|
3385
3385
|
e.chain().focus().addRowBefore().run();
|
|
3386
3386
|
}
|
|
3387
|
-
function
|
|
3387
|
+
function l() {
|
|
3388
3388
|
e.chain().focus().addRowAfter().run();
|
|
3389
3389
|
}
|
|
3390
|
-
function
|
|
3390
|
+
function d() {
|
|
3391
3391
|
e.chain().focus().deleteRow().run();
|
|
3392
3392
|
}
|
|
3393
3393
|
function h() {
|
|
@@ -3485,7 +3485,7 @@ function js({ editor: e, disabled: t }) {
|
|
|
3485
3485
|
p,
|
|
3486
3486
|
{
|
|
3487
3487
|
icon: "BetweenVerticalStart",
|
|
3488
|
-
action:
|
|
3488
|
+
action: l,
|
|
3489
3489
|
tooltip: n("editor.table.menu.insertRowBelow"),
|
|
3490
3490
|
"tooltip-options": {
|
|
3491
3491
|
sideOffset: 15
|
|
@@ -3497,7 +3497,7 @@ function js({ editor: e, disabled: t }) {
|
|
|
3497
3497
|
p,
|
|
3498
3498
|
{
|
|
3499
3499
|
icon: "DeleteRow",
|
|
3500
|
-
action:
|
|
3500
|
+
action: d,
|
|
3501
3501
|
tooltip: n("editor.table.menu.deleteRow"),
|
|
3502
3502
|
"tooltip-options": {
|
|
3503
3503
|
sideOffset: 15
|
|
@@ -3566,11 +3566,11 @@ function qn(e) {
|
|
|
3566
3566
|
E(() => {
|
|
3567
3567
|
var s;
|
|
3568
3568
|
if (e != null && e.editor) {
|
|
3569
|
-
const { href:
|
|
3569
|
+
const { href: l, target: d } = (s = e.editor) == null ? void 0 : s.getAttributes("link"), { from: h, to: u } = e.editor.state.selection, f = e.editor.state.doc.textBetween(h, u, " ");
|
|
3570
3570
|
n({
|
|
3571
|
-
link:
|
|
3571
|
+
link: l,
|
|
3572
3572
|
text: f
|
|
3573
|
-
}), o(
|
|
3573
|
+
}), o(d === "_blank");
|
|
3574
3574
|
}
|
|
3575
3575
|
}, [e == null ? void 0 : e.editor]);
|
|
3576
3576
|
function c(s) {
|
|
@@ -3663,22 +3663,22 @@ function Fs(e) {
|
|
|
3663
3663
|
}
|
|
3664
3664
|
function Vs({ editor: e, disabled: t }) {
|
|
3665
3665
|
const [i, n] = w(!1), a = B(() => {
|
|
3666
|
-
const { href:
|
|
3667
|
-
return
|
|
3668
|
-
}, [e]), o = A(({ editor:
|
|
3666
|
+
const { href: l } = e.getAttributes("link");
|
|
3667
|
+
return l;
|
|
3668
|
+
}, [e]), o = A(({ editor: l }) => l.isActive("link"), []), c = (l, d, h) => {
|
|
3669
3669
|
e.chain().extendMarkRange("link").insertContent({
|
|
3670
3670
|
type: "text",
|
|
3671
|
-
text:
|
|
3671
|
+
text: d,
|
|
3672
3672
|
marks: [
|
|
3673
3673
|
{
|
|
3674
3674
|
type: "link",
|
|
3675
3675
|
attrs: {
|
|
3676
|
-
href:
|
|
3676
|
+
href: l,
|
|
3677
3677
|
target: h ? "_blank" : ""
|
|
3678
3678
|
}
|
|
3679
3679
|
}
|
|
3680
3680
|
]
|
|
3681
|
-
}).setLink({ href:
|
|
3681
|
+
}).setLink({ href: l }).focus().run(), n(!1);
|
|
3682
3682
|
}, s = A(() => {
|
|
3683
3683
|
e.chain().extendMarkRange("link").unsetLink().focus().run(), n(!1);
|
|
3684
3684
|
}, [e]);
|
|
@@ -3742,11 +3742,11 @@ function qs(e) {
|
|
|
3742
3742
|
function Gs(e) {
|
|
3743
3743
|
const { lang: t } = D(), i = ({ editor: a }) => {
|
|
3744
3744
|
const { selection: o } = a.view.state, { $from: c, to: s } = o;
|
|
3745
|
-
let
|
|
3746
|
-
return a.view.state.doc.nodesBetween(c.pos, s, (
|
|
3747
|
-
if (Us(
|
|
3748
|
-
return
|
|
3749
|
-
}),
|
|
3745
|
+
let l = !1;
|
|
3746
|
+
return a.view.state.doc.nodesBetween(c.pos, s, (d) => {
|
|
3747
|
+
if (Us(d))
|
|
3748
|
+
return l = !0, !1;
|
|
3749
|
+
}), l;
|
|
3750
3750
|
}, n = B(() => e.disabled ? [] : Ss(e.editor), [e.disabled, e.editor, t]);
|
|
3751
3751
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
3752
3752
|
ce,
|
|
@@ -3769,11 +3769,11 @@ function Gs(e) {
|
|
|
3769
3769
|
function Ks(e) {
|
|
3770
3770
|
const { lang: t } = D(), i = ({ editor: a }) => {
|
|
3771
3771
|
const { selection: o } = a.view.state, { $from: c, to: s } = o;
|
|
3772
|
-
let
|
|
3773
|
-
return a.view.state.doc.nodesBetween(c.pos, s, (
|
|
3774
|
-
if (Ws(
|
|
3775
|
-
return
|
|
3776
|
-
}),
|
|
3772
|
+
let l = !1;
|
|
3773
|
+
return a.view.state.doc.nodesBetween(c.pos, s, (d) => {
|
|
3774
|
+
if (Ws(d))
|
|
3775
|
+
return l = !0, !1;
|
|
3776
|
+
}), l;
|
|
3777
3777
|
}, n = B(() => e.disabled ? [] : Ms(e.editor), [e.disabled, e.editor, t]);
|
|
3778
3778
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
3779
3779
|
ce,
|
|
@@ -3796,11 +3796,11 @@ function Ks(e) {
|
|
|
3796
3796
|
function Xs(e) {
|
|
3797
3797
|
const { lang: t } = D(), i = ({ editor: a }) => {
|
|
3798
3798
|
const { selection: o } = a.view.state, { $from: c, to: s } = o;
|
|
3799
|
-
let
|
|
3800
|
-
return a.view.state.doc.nodesBetween(c.pos, s, (
|
|
3801
|
-
if (qs(
|
|
3802
|
-
return
|
|
3803
|
-
}),
|
|
3799
|
+
let l = !1;
|
|
3800
|
+
return a.view.state.doc.nodesBetween(c.pos, s, (d) => {
|
|
3801
|
+
if (qs(d))
|
|
3802
|
+
return l = !0, !1;
|
|
3803
|
+
}), l;
|
|
3804
3804
|
}, n = B(() => e.disabled ? [] : zs(e.editor), [e.editor, e.disabled, t]);
|
|
3805
3805
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
3806
3806
|
ce,
|
|
@@ -3876,7 +3876,7 @@ function Zs({ editor: e }) {
|
|
|
3876
3876
|
}
|
|
3877
3877
|
);
|
|
3878
3878
|
}
|
|
3879
|
-
const
|
|
3879
|
+
const Jh = La.extend({
|
|
3880
3880
|
addOptions() {
|
|
3881
3881
|
var e;
|
|
3882
3882
|
return {
|
|
@@ -3894,7 +3894,7 @@ const Zh = La.extend({
|
|
|
3894
3894
|
})
|
|
3895
3895
|
};
|
|
3896
3896
|
}
|
|
3897
|
-
}),
|
|
3897
|
+
}), Qh = Sa.extend({
|
|
3898
3898
|
addOptions() {
|
|
3899
3899
|
var e;
|
|
3900
3900
|
return {
|
|
@@ -3914,7 +3914,7 @@ const Zh = La.extend({
|
|
|
3914
3914
|
}
|
|
3915
3915
|
};
|
|
3916
3916
|
}
|
|
3917
|
-
}),
|
|
3917
|
+
}), eu = Ma.extend({
|
|
3918
3918
|
addOptions() {
|
|
3919
3919
|
var e;
|
|
3920
3920
|
return {
|
|
@@ -3934,7 +3934,7 @@ const Zh = La.extend({
|
|
|
3934
3934
|
}
|
|
3935
3935
|
};
|
|
3936
3936
|
}
|
|
3937
|
-
}),
|
|
3937
|
+
}), tu = Ia.extend({
|
|
3938
3938
|
addOptions() {
|
|
3939
3939
|
var e;
|
|
3940
3940
|
return {
|
|
@@ -3952,7 +3952,7 @@ const Zh = La.extend({
|
|
|
3952
3952
|
})
|
|
3953
3953
|
};
|
|
3954
3954
|
}
|
|
3955
|
-
}),
|
|
3955
|
+
}), iu = za.extend({
|
|
3956
3956
|
addOptions() {
|
|
3957
3957
|
var e;
|
|
3958
3958
|
return {
|
|
@@ -4022,13 +4022,13 @@ function Ui({
|
|
|
4022
4022
|
}) {
|
|
4023
4023
|
const a = [];
|
|
4024
4024
|
return ct(e, (c) => c.type.name === t).forEach((c) => {
|
|
4025
|
-
let s = c.pos + 1,
|
|
4026
|
-
const
|
|
4025
|
+
let s = c.pos + 1, l = c.node.attrs.language || n;
|
|
4026
|
+
const d = c.node.attrs.theme || i, h = Ys();
|
|
4027
4027
|
if (!h)
|
|
4028
4028
|
return;
|
|
4029
|
-
h.getLoadedLanguages().includes(
|
|
4030
|
-
const u = h.getLoadedThemes().includes(
|
|
4031
|
-
lang:
|
|
4029
|
+
h.getLoadedLanguages().includes(l) || (l = "plaintext");
|
|
4030
|
+
const u = h.getLoadedThemes().includes(d) ? d : h.getLoadedThemes()[0], f = h.codeToTokensBase(c.node.textContent, {
|
|
4031
|
+
lang: l,
|
|
4032
4032
|
theme: u
|
|
4033
4033
|
});
|
|
4034
4034
|
for (const g of f) {
|
|
@@ -4063,8 +4063,8 @@ function el({
|
|
|
4063
4063
|
async initDecorations() {
|
|
4064
4064
|
const s = a.state.doc;
|
|
4065
4065
|
await Qs({ doc: s, name: e, defaultLanguage: t, defaultTheme: i });
|
|
4066
|
-
const
|
|
4067
|
-
a.dispatch(
|
|
4066
|
+
const l = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
|
|
4067
|
+
a.dispatch(l);
|
|
4068
4068
|
}
|
|
4069
4069
|
// When new codeblocks were added and they have missing themes or
|
|
4070
4070
|
// languages, load those and then add code decorations once again.
|
|
@@ -4094,13 +4094,13 @@ function el({
|
|
|
4094
4094
|
defaultTheme: i
|
|
4095
4095
|
}),
|
|
4096
4096
|
apply: (a, o, c, s) => {
|
|
4097
|
-
const
|
|
4097
|
+
const l = c.selection.$head.parent.type.name, d = s.selection.$head.parent.type.name, h = ct(
|
|
4098
4098
|
c.doc,
|
|
4099
4099
|
(g) => g.type.name === e
|
|
4100
4100
|
), u = ct(
|
|
4101
4101
|
s.doc,
|
|
4102
4102
|
(g) => g.type.name === e
|
|
4103
|
-
), f = a.docChanged && ([
|
|
4103
|
+
), f = a.docChanged && ([l, d].includes(e) || u.length !== h.length || a.steps.some((g) => g.from !== void 0 && g.to !== void 0 && h.some((x) => x.pos >= g.from && x.pos + x.node.nodeSize <= g.to)));
|
|
4104
4104
|
return a.getMeta("shikiPluginForceDecoration") || f ? Ui({
|
|
4105
4105
|
doc: a.doc,
|
|
4106
4106
|
name: e,
|
|
@@ -4163,8 +4163,8 @@ function hl({ editor: e, node: { attrs: t }, updateAttributes: i, extension: n }
|
|
|
4163
4163
|
const { isCopied: a, copyToClipboard: o } = dl(), c = B(() => {
|
|
4164
4164
|
var x;
|
|
4165
4165
|
return (x = n.options.languages) != null && x.length ? n.options.languages : xn;
|
|
4166
|
-
}, [n.options.languages]), s = Bt(),
|
|
4167
|
-
return /* @__PURE__ */ m(ae, { className: ee(pe.wrap, !
|
|
4166
|
+
}, [n.options.languages]), s = Bt(), l = (g = (f = e == null ? void 0 : e.options) == null ? void 0 : f.editorProps) == null ? void 0 : g.print, { language: d } = t, h = J(), u = A(() => Qe(ul.name, e), [e]);
|
|
4167
|
+
return /* @__PURE__ */ m(ae, { className: ee(pe.wrap, !l && pe.maxHeight, "render-wrapper"), children: [
|
|
4168
4168
|
/* @__PURE__ */ m(
|
|
4169
4169
|
"div",
|
|
4170
4170
|
{
|
|
@@ -4196,7 +4196,7 @@ function hl({ editor: e, node: { attrs: t }, updateAttributes: i, extension: n }
|
|
|
4196
4196
|
/* @__PURE__ */ r("div", { className: pe.selectLang, children: /* @__PURE__ */ m(
|
|
4197
4197
|
Uo,
|
|
4198
4198
|
{
|
|
4199
|
-
defaultValue:
|
|
4199
|
+
defaultValue: d || "auto",
|
|
4200
4200
|
disabled: !s,
|
|
4201
4201
|
onValueChange: (x) => i({ language: x }),
|
|
4202
4202
|
children: [
|
|
@@ -4226,8 +4226,8 @@ const ul = Ea.extend({
|
|
|
4226
4226
|
return {
|
|
4227
4227
|
component: tl,
|
|
4228
4228
|
componentProps: {
|
|
4229
|
-
action: (
|
|
4230
|
-
language:
|
|
4229
|
+
action: (l = "js") => t.commands.setCodeBlock({
|
|
4230
|
+
language: l
|
|
4231
4231
|
}),
|
|
4232
4232
|
isActive: () => t.isActive("codeBlock") || !1,
|
|
4233
4233
|
disabled: !t.can().toggleCodeBlock(),
|
|
@@ -4257,8 +4257,8 @@ const ul = Ea.extend({
|
|
|
4257
4257
|
function ml(e) {
|
|
4258
4258
|
var a, o, c;
|
|
4259
4259
|
const { t, lang: i } = D(), n = B(() => {
|
|
4260
|
-
var
|
|
4261
|
-
const s = (
|
|
4260
|
+
var d;
|
|
4261
|
+
const s = (d = e == null ? void 0 : e.items) == null ? void 0 : d.find((h) => h.isActive());
|
|
4262
4262
|
return s && !s.default ? {
|
|
4263
4263
|
...s
|
|
4264
4264
|
} : {
|
|
@@ -4279,24 +4279,24 @@ function ml(e) {
|
|
|
4279
4279
|
icon: "MenuDown"
|
|
4280
4280
|
}
|
|
4281
4281
|
) }),
|
|
4282
|
-
/* @__PURE__ */ r(be, { className: "richtext-w-full", children: (c = e == null ? void 0 : e.items) == null ? void 0 : c.map((s,
|
|
4283
|
-
const
|
|
4282
|
+
/* @__PURE__ */ r(be, { className: "richtext-w-full", children: (c = e == null ? void 0 : e.items) == null ? void 0 : c.map((s, l) => {
|
|
4283
|
+
const d = s.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: s.font };
|
|
4284
4284
|
return /* @__PURE__ */ m(dt, { children: [
|
|
4285
|
-
/* @__PURE__ */ r(ze, { checked: (n == null ? void 0 : n.font) === s.font, onClick: s.action, children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", style:
|
|
4285
|
+
/* @__PURE__ */ r(ze, { checked: (n == null ? void 0 : n.font) === s.font, onClick: s.action, children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", style: d, children: s.font }) }),
|
|
4286
4286
|
s.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(Ot, {})
|
|
4287
|
-
] }, `font-family-${
|
|
4287
|
+
] }, `font-family-${l}`);
|
|
4288
4288
|
}) })
|
|
4289
4289
|
] });
|
|
4290
4290
|
}
|
|
4291
|
-
const
|
|
4291
|
+
const nu = Ra.extend({
|
|
4292
4292
|
addOptions() {
|
|
4293
4293
|
var e;
|
|
4294
4294
|
return {
|
|
4295
4295
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
4296
4296
|
fontFamilyList: ko,
|
|
4297
4297
|
button({ editor: t, extension: i, t: n }) {
|
|
4298
|
-
var
|
|
4299
|
-
const { extensions: a = [] } = t.extensionManager ?? [], o = Qt(((
|
|
4298
|
+
var d;
|
|
4299
|
+
const { extensions: a = [] } = t.extensionManager ?? [], o = Qt(((d = i == null ? void 0 : i.options) == null ? void 0 : d.fontFamilyList) || []), c = a.find(
|
|
4300
4300
|
(h) => h.name === "base-kit"
|
|
4301
4301
|
), s = o.map((h) => ({
|
|
4302
4302
|
action: () => {
|
|
@@ -4314,12 +4314,12 @@ const tu = Ra.extend({
|
|
|
4314
4314
|
font: n("editor.fontFamily.default.tooltip"),
|
|
4315
4315
|
title: n("editor.fontFamily.tooltip")
|
|
4316
4316
|
});
|
|
4317
|
-
const
|
|
4317
|
+
const l = s.filter((h) => h.disabled).length === s.length;
|
|
4318
4318
|
return {
|
|
4319
4319
|
component: ml,
|
|
4320
4320
|
componentProps: {
|
|
4321
4321
|
tooltip: n("editor.fontFamily.tooltip"),
|
|
4322
|
-
disabled:
|
|
4322
|
+
disabled: l,
|
|
4323
4323
|
items: s,
|
|
4324
4324
|
editor: t
|
|
4325
4325
|
}
|
|
@@ -4370,15 +4370,15 @@ function fl(e) {
|
|
|
4370
4370
|
}) })
|
|
4371
4371
|
] });
|
|
4372
4372
|
}
|
|
4373
|
-
const
|
|
4373
|
+
const ru = Oa.extend({
|
|
4374
4374
|
addOptions() {
|
|
4375
4375
|
var e;
|
|
4376
4376
|
return {
|
|
4377
4377
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
4378
4378
|
levels: [1, 2, 3, 4, 5, 6],
|
|
4379
4379
|
button({ editor: t, extension: i, t: n }) {
|
|
4380
|
-
var
|
|
4381
|
-
const { extensions: a = [] } = t.extensionManager ?? [], o = ((
|
|
4380
|
+
var d;
|
|
4381
|
+
const { extensions: a = [] } = t.extensionManager ?? [], o = ((d = i.options) == null ? void 0 : d.levels) || [], c = a.find(
|
|
4382
4382
|
(h) => h.name === "base-kit"
|
|
4383
4383
|
), s = o.map((h) => ({
|
|
4384
4384
|
action: () => t.commands.toggleHeading({ level: h }),
|
|
@@ -4396,12 +4396,12 @@ const iu = Oa.extend({
|
|
|
4396
4396
|
title: n("editor.paragraph.tooltip"),
|
|
4397
4397
|
shortcutKeys: ["alt", "mod", "0"]
|
|
4398
4398
|
});
|
|
4399
|
-
const
|
|
4399
|
+
const l = s.filter((h) => h.disabled).length === s.length;
|
|
4400
4400
|
return {
|
|
4401
4401
|
component: fl,
|
|
4402
4402
|
componentProps: {
|
|
4403
4403
|
tooltip: n("editor.heading.tooltip"),
|
|
4404
|
-
disabled:
|
|
4404
|
+
disabled: l,
|
|
4405
4405
|
items: s,
|
|
4406
4406
|
editor: t
|
|
4407
4407
|
}
|
|
@@ -4465,7 +4465,7 @@ function gl(e) {
|
|
|
4465
4465
|
)
|
|
4466
4466
|
] });
|
|
4467
4467
|
}
|
|
4468
|
-
const
|
|
4468
|
+
const au = Pa.extend({
|
|
4469
4469
|
addOptions() {
|
|
4470
4470
|
var e;
|
|
4471
4471
|
return {
|
|
@@ -4476,8 +4476,8 @@ const nu = Pa.extend({
|
|
|
4476
4476
|
extension: i,
|
|
4477
4477
|
t: n
|
|
4478
4478
|
}) {
|
|
4479
|
-
var
|
|
4480
|
-
const a = ((
|
|
4479
|
+
var d;
|
|
4480
|
+
const a = ((d = i.options) == null ? void 0 : d.alignments) || [], o = {
|
|
4481
4481
|
left: ["mod", "Shift", "L"],
|
|
4482
4482
|
center: ["mod", "Shift", "E"],
|
|
4483
4483
|
right: ["mod", "Shift", "R"],
|
|
@@ -4500,13 +4500,13 @@ const nu = Pa.extend({
|
|
|
4500
4500
|
},
|
|
4501
4501
|
disabled: !((g = (f = (u = t == null ? void 0 : t.can) == null ? void 0 : u.call(t)) == null ? void 0 : f.setTextAlign) != null && g.call(f, h))
|
|
4502
4502
|
};
|
|
4503
|
-
}),
|
|
4503
|
+
}), l = s.filter((h) => h.disabled).length === s.length;
|
|
4504
4504
|
return {
|
|
4505
4505
|
component: gl,
|
|
4506
4506
|
componentProps: {
|
|
4507
4507
|
icon: "AlignJustify",
|
|
4508
4508
|
tooltip: n("editor.textalign.tooltip"),
|
|
4509
|
-
disabled:
|
|
4509
|
+
disabled: l,
|
|
4510
4510
|
items: s
|
|
4511
4511
|
}
|
|
4512
4512
|
};
|
|
@@ -4544,7 +4544,7 @@ function xl(e) {
|
|
|
4544
4544
|
)) })
|
|
4545
4545
|
] });
|
|
4546
4546
|
}
|
|
4547
|
-
const
|
|
4547
|
+
const ou = Y.create({
|
|
4548
4548
|
name: "fontSize",
|
|
4549
4549
|
addOptions() {
|
|
4550
4550
|
var e;
|
|
@@ -4553,24 +4553,24 @@ const ru = Y.create({
|
|
|
4553
4553
|
types: ["textStyle"],
|
|
4554
4554
|
fontSizes: [...Co],
|
|
4555
4555
|
button({ editor: t, extension: i, t: n }) {
|
|
4556
|
-
var
|
|
4557
|
-
const a = Qt(((
|
|
4558
|
-
title:
|
|
4556
|
+
var l;
|
|
4557
|
+
const a = Qt(((l = i.options) == null ? void 0 : l.fontSizes) || Ii), o = Qt([Ii])[0], c = a.map((d) => ({
|
|
4558
|
+
title: d.value === o.value ? n("editor.fontSize.default.tooltip") : String(d.name),
|
|
4559
4559
|
isActive: () => {
|
|
4560
4560
|
const { fontSize: h } = t.getAttributes("textStyle");
|
|
4561
|
-
return
|
|
4561
|
+
return d.value === o.value && h === void 0 ? !0 : t.isActive({ fontSize: String(d.value) }) || !1;
|
|
4562
4562
|
},
|
|
4563
4563
|
action: () => {
|
|
4564
|
-
if (
|
|
4564
|
+
if (d.value === o.value) {
|
|
4565
4565
|
t.commands.unsetFontSize();
|
|
4566
4566
|
return;
|
|
4567
4567
|
}
|
|
4568
|
-
t.commands.setFontSize(String(
|
|
4568
|
+
t.commands.setFontSize(String(d.value));
|
|
4569
4569
|
},
|
|
4570
|
-
disabled: !t.can().setFontSize(String(
|
|
4571
|
-
divider:
|
|
4572
|
-
default:
|
|
4573
|
-
})), s = c.filter((
|
|
4570
|
+
disabled: !t.can().setFontSize(String(d.value)),
|
|
4571
|
+
divider: d.value === o.value || !1,
|
|
4572
|
+
default: d.value === o.value || !1
|
|
4573
|
+
})), s = c.filter((d) => d.disabled).length === c.length;
|
|
4574
4574
|
return {
|
|
4575
4575
|
component: xl,
|
|
4576
4576
|
componentProps: {
|
|
@@ -4680,7 +4680,7 @@ function pl(e) {
|
|
|
4680
4680
|
)
|
|
4681
4681
|
] });
|
|
4682
4682
|
}
|
|
4683
|
-
const
|
|
4683
|
+
const cu = Ba.extend({
|
|
4684
4684
|
addOptions() {
|
|
4685
4685
|
var e;
|
|
4686
4686
|
return {
|
|
@@ -4706,7 +4706,7 @@ const au = Ba.extend({
|
|
|
4706
4706
|
}
|
|
4707
4707
|
};
|
|
4708
4708
|
}
|
|
4709
|
-
}),
|
|
4709
|
+
}), su = Da.extend({
|
|
4710
4710
|
addOptions() {
|
|
4711
4711
|
var e;
|
|
4712
4712
|
return {
|
|
@@ -4727,7 +4727,7 @@ const au = Ba.extend({
|
|
|
4727
4727
|
})
|
|
4728
4728
|
};
|
|
4729
4729
|
}
|
|
4730
|
-
}),
|
|
4730
|
+
}), lu = $a.extend({
|
|
4731
4731
|
addOptions() {
|
|
4732
4732
|
var e;
|
|
4733
4733
|
return {
|
|
@@ -4745,7 +4745,7 @@ const au = Ba.extend({
|
|
|
4745
4745
|
})
|
|
4746
4746
|
};
|
|
4747
4747
|
}
|
|
4748
|
-
}),
|
|
4748
|
+
}), du = ue.create({
|
|
4749
4749
|
name: "clear",
|
|
4750
4750
|
addOptions() {
|
|
4751
4751
|
var e;
|
|
@@ -4762,7 +4762,7 @@ const au = Ba.extend({
|
|
|
4762
4762
|
})
|
|
4763
4763
|
};
|
|
4764
4764
|
}
|
|
4765
|
-
}),
|
|
4765
|
+
}), hu = ja.extend({
|
|
4766
4766
|
addOptions() {
|
|
4767
4767
|
var e;
|
|
4768
4768
|
return {
|
|
@@ -4780,7 +4780,7 @@ const au = Ba.extend({
|
|
|
4780
4780
|
})
|
|
4781
4781
|
};
|
|
4782
4782
|
}
|
|
4783
|
-
}),
|
|
4783
|
+
}), uu = Fa.extend({
|
|
4784
4784
|
addOptions() {
|
|
4785
4785
|
var e;
|
|
4786
4786
|
return {
|
|
@@ -4809,7 +4809,7 @@ const au = Ba.extend({
|
|
|
4809
4809
|
addExtensions() {
|
|
4810
4810
|
return [Va.configure(this.options.taskItem)];
|
|
4811
4811
|
}
|
|
4812
|
-
}),
|
|
4812
|
+
}), mu = Ua.extend({
|
|
4813
4813
|
addOptions() {
|
|
4814
4814
|
var e;
|
|
4815
4815
|
return {
|
|
@@ -4849,7 +4849,7 @@ function wl(e) {
|
|
|
4849
4849
|
/* @__PURE__ */ r(re, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(qn, { editor: e.editor, onSetLink: n }) })
|
|
4850
4850
|
] });
|
|
4851
4851
|
}
|
|
4852
|
-
const
|
|
4852
|
+
const fu = Wa.extend({
|
|
4853
4853
|
inclusive: !1,
|
|
4854
4854
|
parseHTML() {
|
|
4855
4855
|
return [
|
|
@@ -4909,14 +4909,14 @@ const uu = Wa.extend({
|
|
|
4909
4909
|
const { schema: i, doc: n, tr: a } = e.state, o = qa(n.resolve(t), i.marks.link);
|
|
4910
4910
|
if (!o)
|
|
4911
4911
|
return !1;
|
|
4912
|
-
const c = n.resolve(o.from), s = n.resolve(o.to),
|
|
4913
|
-
e.dispatch(
|
|
4912
|
+
const c = n.resolve(o.from), s = n.resolve(o.to), l = a.setSelection(new Me(c, s));
|
|
4913
|
+
e.dispatch(l);
|
|
4914
4914
|
}
|
|
4915
4915
|
}
|
|
4916
4916
|
})
|
|
4917
4917
|
];
|
|
4918
4918
|
}
|
|
4919
|
-
}),
|
|
4919
|
+
}), gu = Ga.extend({
|
|
4920
4920
|
renderHTML() {
|
|
4921
4921
|
return [
|
|
4922
4922
|
"div",
|
|
@@ -4949,7 +4949,7 @@ const uu = Wa.extend({
|
|
|
4949
4949
|
}
|
|
4950
4950
|
});
|
|
4951
4951
|
function _l(e) {
|
|
4952
|
-
var
|
|
4952
|
+
var d;
|
|
4953
4953
|
const {
|
|
4954
4954
|
icon: t = void 0,
|
|
4955
4955
|
// title = undefined,
|
|
@@ -4963,7 +4963,7 @@ function _l(e) {
|
|
|
4963
4963
|
action: o = void 0,
|
|
4964
4964
|
isActive: c = void 0,
|
|
4965
4965
|
children: s
|
|
4966
|
-
} = e,
|
|
4966
|
+
} = e, l = gt[t];
|
|
4967
4967
|
return /* @__PURE__ */ m(et, { children: [
|
|
4968
4968
|
/* @__PURE__ */ r(tt, { asChild: !0, children: /* @__PURE__ */ m(
|
|
4969
4969
|
ft,
|
|
@@ -4973,18 +4973,18 @@ function _l(e) {
|
|
|
4973
4973
|
disabled: c == null ? void 0 : c(),
|
|
4974
4974
|
onClick: o,
|
|
4975
4975
|
children: [
|
|
4976
|
-
|
|
4976
|
+
l && /* @__PURE__ */ r(l, { className: "richtext-w-4 richtext-h-4" }),
|
|
4977
4977
|
s && /* @__PURE__ */ r(q, { children: s })
|
|
4978
4978
|
]
|
|
4979
4979
|
}
|
|
4980
4980
|
) }),
|
|
4981
4981
|
i && /* @__PURE__ */ r(He, { ...a, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
|
|
4982
4982
|
/* @__PURE__ */ r("div", { children: i }),
|
|
4983
|
-
!!((
|
|
4983
|
+
!!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */ r("span", { children: Rt(e == null ? void 0 : e.shortcutKeys) })
|
|
4984
4984
|
] }) })
|
|
4985
4985
|
] });
|
|
4986
4986
|
}
|
|
4987
|
-
const vl = ["undo", "redo"],
|
|
4987
|
+
const vl = ["undo", "redo"], xu = Ka.extend({
|
|
4988
4988
|
addOptions() {
|
|
4989
4989
|
var e;
|
|
4990
4990
|
return {
|
|
@@ -5038,8 +5038,8 @@ function Ut({
|
|
|
5038
5038
|
const n = Ct((o) => o.type.name === lt.name)(e.selection), a = Ct((o) => o.type.name === Ni.name)(e.selection);
|
|
5039
5039
|
if (t && n && a) {
|
|
5040
5040
|
const o = n.node, c = a.node.attrs.index, s = o.toJSON();
|
|
5041
|
-
let
|
|
5042
|
-
i === "delete" ? (
|
|
5041
|
+
let l = c;
|
|
5042
|
+
i === "delete" ? (l = c - 1, s.content.splice(c, 1)) : (l = i === "addBefore" ? c : c + 1, s.content.splice(l, 0, {
|
|
5043
5043
|
type: "column",
|
|
5044
5044
|
attrs: {
|
|
5045
5045
|
index: c
|
|
@@ -5052,13 +5052,13 @@ function Ut({
|
|
|
5052
5052
|
})), s.attrs.cols = s.content.length, s.content.forEach((f, g) => {
|
|
5053
5053
|
f.attrs.index = g;
|
|
5054
5054
|
});
|
|
5055
|
-
const
|
|
5055
|
+
const d = xo.fromJSON(e.schema, s);
|
|
5056
5056
|
let h = n.pos;
|
|
5057
|
-
|
|
5058
|
-
x <
|
|
5057
|
+
d.content.forEach((f, g, x) => {
|
|
5058
|
+
x < l && (h += f.nodeSize);
|
|
5059
5059
|
});
|
|
5060
5060
|
const u = e.tr.setTime(Date.now());
|
|
5061
|
-
u.replaceWith(n.pos, n.pos + n.node.nodeSize,
|
|
5061
|
+
u.replaceWith(n.pos, n.pos + n.node.nodeSize, d).setSelection(
|
|
5062
5062
|
Me.near(u.doc.resolve(h))
|
|
5063
5063
|
), t(u);
|
|
5064
5064
|
}
|
|
@@ -5070,12 +5070,12 @@ function Wi({ state: e, dispatch: t, type: i }) {
|
|
|
5070
5070
|
const o = n.node, c = a.node.attrs.index;
|
|
5071
5071
|
let s = 0;
|
|
5072
5072
|
i === "before" ? s = (c - 1 + o.attrs.cols) % o.attrs.cols : s = (c + 1) % o.attrs.cols;
|
|
5073
|
-
let
|
|
5073
|
+
let l = n.pos;
|
|
5074
5074
|
o.content.forEach((h, u, f) => {
|
|
5075
|
-
f < s && (
|
|
5075
|
+
f < s && (l += h.nodeSize);
|
|
5076
5076
|
});
|
|
5077
|
-
const
|
|
5078
|
-
return
|
|
5077
|
+
const d = e.tr.setTime(Date.now());
|
|
5078
|
+
return d.setSelection(Me.near(d.doc.resolve(l))), t(d), !0;
|
|
5079
5079
|
}
|
|
5080
5080
|
return !1;
|
|
5081
5081
|
}
|
|
@@ -5171,7 +5171,7 @@ const Tl = 200, lt = ue.create({
|
|
|
5171
5171
|
renderHTML({ HTMLAttributes: e }) {
|
|
5172
5172
|
return ["div", ne(this.options.HTMLAttributes, e), 0];
|
|
5173
5173
|
}
|
|
5174
|
-
}),
|
|
5174
|
+
}), bu = Y.create({
|
|
5175
5175
|
name: "columnActionButton",
|
|
5176
5176
|
addOptions() {
|
|
5177
5177
|
var e;
|
|
@@ -5338,9 +5338,9 @@ const Ml = Y.create({
|
|
|
5338
5338
|
new we({
|
|
5339
5339
|
key: e,
|
|
5340
5340
|
appendTransaction: (i, n, a) => {
|
|
5341
|
-
const { doc: o, tr: c, schema: s } = a,
|
|
5342
|
-
if (
|
|
5343
|
-
return c.insert(
|
|
5341
|
+
const { doc: o, tr: c, schema: s } = a, l = e.getState(a), d = o.content.size, h = s.nodes[this.options.node];
|
|
5342
|
+
if (l)
|
|
5343
|
+
return c.insert(d, h.create());
|
|
5344
5344
|
},
|
|
5345
5345
|
state: {
|
|
5346
5346
|
init: (i, n) => {
|
|
@@ -5357,15 +5357,15 @@ const Ml = Y.create({
|
|
|
5357
5357
|
})
|
|
5358
5358
|
];
|
|
5359
5359
|
}
|
|
5360
|
-
}),
|
|
5360
|
+
}), pu = Y.create({
|
|
5361
5361
|
name: "base-kit",
|
|
5362
5362
|
addExtensions() {
|
|
5363
5363
|
const e = [];
|
|
5364
5364
|
return this.options.document !== !1 && e.push(yl.configure()), this.options.placeholder !== !1 && e.push(
|
|
5365
5365
|
Za.configure({
|
|
5366
5366
|
placeholder: ({ node: t, pos: i, editor: n }) => {
|
|
5367
|
-
var a, o, c, s,
|
|
5368
|
-
return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((o = t == null ? void 0 : t.content) == null ? void 0 : o.size) !== 0 ? "" : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "heading" ? `${V.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "codeBlock" || ((
|
|
5367
|
+
var a, o, c, s, l;
|
|
5368
|
+
return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((o = t == null ? void 0 : t.content) == null ? void 0 : o.size) !== 0 ? "" : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "heading" ? `${V.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "codeBlock" || ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "table" ? "" : n.extensionManager.extensions.some((d) => d.name === "slashCommand") ? V.t("editor.slash") : i === 0 ? V.t("editor.content") : V.t("editor.content");
|
|
5369
5369
|
},
|
|
5370
5370
|
...this.options.placeholder
|
|
5371
5371
|
})
|
|
@@ -5382,7 +5382,7 @@ const Ml = Y.create({
|
|
|
5382
5382
|
})
|
|
5383
5383
|
), this.options.characterCount !== !1 && e.push(to.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(io.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(no.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(ro.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(ao.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(Ml.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(Al), this.options.multiColumn !== !1 && (e.push(Ni), e.push(lt)), e;
|
|
5384
5384
|
}
|
|
5385
|
-
}),
|
|
5385
|
+
}), wu = Y.create({
|
|
5386
5386
|
name: "subAndSuperScript",
|
|
5387
5387
|
addOptions() {
|
|
5388
5388
|
var e;
|
|
@@ -5407,8 +5407,8 @@ const Ml = Y.create({
|
|
|
5407
5407
|
icon: "Superscript",
|
|
5408
5408
|
tooltip: n("editor.superscript.tooltip")
|
|
5409
5409
|
}
|
|
5410
|
-
},
|
|
5411
|
-
return a !== !1 &&
|
|
5410
|
+
}, l = [];
|
|
5411
|
+
return a !== !1 && l.push(c), o !== !1 && l.push(s), l;
|
|
5412
5412
|
}
|
|
5413
5413
|
};
|
|
5414
5414
|
},
|
|
@@ -5458,7 +5458,7 @@ function Il(e) {
|
|
|
5458
5458
|
)) })
|
|
5459
5459
|
] });
|
|
5460
5460
|
}
|
|
5461
|
-
const
|
|
5461
|
+
const _u = Y.create({
|
|
5462
5462
|
name: "moreMark",
|
|
5463
5463
|
addOptions() {
|
|
5464
5464
|
var e;
|
|
@@ -5479,14 +5479,14 @@ const pu = Y.create({
|
|
|
5479
5479
|
icon: "Superscript",
|
|
5480
5480
|
title: n("editor.superscript.tooltip"),
|
|
5481
5481
|
shortcutKeys: ["mod", ","]
|
|
5482
|
-
},
|
|
5483
|
-
return a !== !1 &&
|
|
5482
|
+
}, l = [];
|
|
5483
|
+
return a !== !1 && l.push(c), o !== !1 && l.push(s), {
|
|
5484
5484
|
component: Il,
|
|
5485
5485
|
componentProps: {
|
|
5486
5486
|
icon: "Type",
|
|
5487
5487
|
tooltip: n("editor.moremark"),
|
|
5488
5488
|
disabled: !t.isEditable,
|
|
5489
|
-
items:
|
|
5489
|
+
items: l
|
|
5490
5490
|
}
|
|
5491
5491
|
};
|
|
5492
5492
|
}
|
|
@@ -5496,7 +5496,7 @@ const pu = Y.create({
|
|
|
5496
5496
|
const e = [];
|
|
5497
5497
|
return this.options.subscript !== !1 && e.push(sn.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(ln.configure(this.options.superscript)), e;
|
|
5498
5498
|
}
|
|
5499
|
-
}),
|
|
5499
|
+
}), vu = Y.create({
|
|
5500
5500
|
name: "indent",
|
|
5501
5501
|
addOptions() {
|
|
5502
5502
|
var e;
|
|
@@ -5578,16 +5578,16 @@ function Hl(e) {
|
|
|
5578
5578
|
c === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(c), n(c);
|
|
5579
5579
|
}
|
|
5580
5580
|
const o = B(() => {
|
|
5581
|
-
const
|
|
5582
|
-
(
|
|
5583
|
-
).options.lineHeights.map((
|
|
5584
|
-
label: zl(
|
|
5585
|
-
value:
|
|
5581
|
+
const l = e.editor.extensionManager.extensions.find(
|
|
5582
|
+
(d) => d.name === "lineHeight"
|
|
5583
|
+
).options.lineHeights.map((d) => ({
|
|
5584
|
+
label: zl(d),
|
|
5585
|
+
value: d
|
|
5586
5586
|
}));
|
|
5587
|
-
return
|
|
5587
|
+
return l.unshift({
|
|
5588
5588
|
label: t("editor.default"),
|
|
5589
5589
|
value: "default"
|
|
5590
|
-
}),
|
|
5590
|
+
}), l;
|
|
5591
5591
|
}, [e]);
|
|
5592
5592
|
return /* @__PURE__ */ m(ve, { children: [
|
|
5593
5593
|
/* @__PURE__ */ r(ye, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -5617,22 +5617,22 @@ function Rl(e, t) {
|
|
|
5617
5617
|
if (!i || !n || !(i instanceof Me || i instanceof un))
|
|
5618
5618
|
return e;
|
|
5619
5619
|
const { from: a, to: o } = i, c = [], s = t && t !== bn ? t : null;
|
|
5620
|
-
if (n.nodesBetween(a, o, (
|
|
5621
|
-
const h =
|
|
5622
|
-
return El.includes(h.name) ? ((
|
|
5623
|
-
node:
|
|
5624
|
-
pos:
|
|
5620
|
+
if (n.nodesBetween(a, o, (l, d) => {
|
|
5621
|
+
const h = l.type;
|
|
5622
|
+
return El.includes(h.name) ? ((l.attrs.lineHeight || null) !== s && c.push({
|
|
5623
|
+
node: l,
|
|
5624
|
+
pos: d,
|
|
5625
5625
|
nodeType: h
|
|
5626
5626
|
}), h.name !== "list_item" && h.name !== "todo_item") : !0;
|
|
5627
5627
|
}), c.length === 0)
|
|
5628
5628
|
return e;
|
|
5629
|
-
for (const
|
|
5630
|
-
const { node:
|
|
5631
|
-
let { attrs: f } =
|
|
5629
|
+
for (const l of c) {
|
|
5630
|
+
const { node: d, pos: h, nodeType: u } = l;
|
|
5631
|
+
let { attrs: f } = d;
|
|
5632
5632
|
f = {
|
|
5633
5633
|
...f,
|
|
5634
5634
|
lineHeight: s
|
|
5635
|
-
}, e = e.setNodeMarkup(h, u, f,
|
|
5635
|
+
}, e = e.setNodeMarkup(h, u, f, d.marks);
|
|
5636
5636
|
}
|
|
5637
5637
|
return e;
|
|
5638
5638
|
}
|
|
@@ -5643,7 +5643,7 @@ function Ol(e) {
|
|
|
5643
5643
|
return a = a.setSelection(n), a = Rl(a, e), a.docChanged ? (i && i(a), !0) : !1;
|
|
5644
5644
|
};
|
|
5645
5645
|
}
|
|
5646
|
-
const
|
|
5646
|
+
const yu = Y.create({
|
|
5647
5647
|
name: "lineHeight",
|
|
5648
5648
|
addOptions() {
|
|
5649
5649
|
var e;
|
|
@@ -5823,19 +5823,19 @@ function Dl(e) {
|
|
|
5823
5823
|
}
|
|
5824
5824
|
function $l(e, t) {
|
|
5825
5825
|
var C, T;
|
|
5826
|
-
const [i, n] = w(0), [a, o] = w(0), c = J(null), { t: s } = D(),
|
|
5826
|
+
const [i, n] = w(0), [a, o] = w(0), c = J(null), { t: s } = D(), l = J([]);
|
|
5827
5827
|
St(t, () => ({
|
|
5828
|
-
onKeyDown:
|
|
5828
|
+
onKeyDown: d
|
|
5829
5829
|
})), E(() => {
|
|
5830
5830
|
if (!c.current)
|
|
5831
5831
|
return;
|
|
5832
|
-
const v = a * 1e3 + i, _ =
|
|
5832
|
+
const v = a * 1e3 + i, _ = l.current[v];
|
|
5833
5833
|
_ && _.scrollIntoView({
|
|
5834
5834
|
behavior: "smooth",
|
|
5835
5835
|
block: "nearest"
|
|
5836
5836
|
});
|
|
5837
5837
|
}, [i, a]);
|
|
5838
|
-
function
|
|
5838
|
+
function d({ event: v }) {
|
|
5839
5839
|
return v.key === "ArrowUp" ? (h(), !0) : v.key === "ArrowDown" ? (u(), !0) : v.key === "Enter" ? (f(), !0) : !1;
|
|
5840
5840
|
}
|
|
5841
5841
|
function h() {
|
|
@@ -5865,7 +5865,7 @@ function $l(e, t) {
|
|
|
5865
5865
|
g(v, _);
|
|
5866
5866
|
}
|
|
5867
5867
|
function b(v, _, k) {
|
|
5868
|
-
|
|
5868
|
+
l.current[v * 1e3 + _] = k;
|
|
5869
5869
|
}
|
|
5870
5870
|
return /* @__PURE__ */ r(
|
|
5871
5871
|
"div",
|
|
@@ -5896,7 +5896,7 @@ function $l(e, t) {
|
|
|
5896
5896
|
}
|
|
5897
5897
|
const jl = Lt($l), Ae = "slashCommand";
|
|
5898
5898
|
let W;
|
|
5899
|
-
const
|
|
5899
|
+
const ku = Y.create({
|
|
5900
5900
|
name: Ae,
|
|
5901
5901
|
priority: 200,
|
|
5902
5902
|
onCreate() {
|
|
@@ -5927,11 +5927,11 @@ const vu = Y.create({
|
|
|
5927
5927
|
startOfLine: !0,
|
|
5928
5928
|
pluginKey: new _e(Ae),
|
|
5929
5929
|
allow: ({ state: e, range: t }) => {
|
|
5930
|
-
var
|
|
5931
|
-
const i = e.doc.resolve(t.from), n = i.depth === 1, a = i.parent.type.name === "paragraph", o = ((
|
|
5930
|
+
var d, h, u;
|
|
5931
|
+
const i = e.doc.resolve(t.from), n = i.depth === 1, a = i.parent.type.name === "paragraph", o = ((d = i.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", c = this.editor.isActive("column"), s = (u = i.parent.textContent) == null ? void 0 : u.slice(
|
|
5932
5932
|
Math.max(0, (h = i.parent.textContent) == null ? void 0 : h.indexOf("/"))
|
|
5933
|
-
),
|
|
5934
|
-
return (n && a && o || c && a && o) &&
|
|
5933
|
+
), l = !(s != null && s.endsWith(" "));
|
|
5934
|
+
return (n && a && o || c && a && o) && l;
|
|
5935
5935
|
},
|
|
5936
5936
|
command: ({ editor: e, range: t, props: i }) => {
|
|
5937
5937
|
const { view: n } = e;
|
|
@@ -5940,12 +5940,12 @@ const vu = Y.create({
|
|
|
5940
5940
|
items: ({ query: e, editor: t }) => Dl(t.extensionManager.extensions).map((c) => ({
|
|
5941
5941
|
...c,
|
|
5942
5942
|
commands: c.commands.filter((s) => {
|
|
5943
|
-
const
|
|
5943
|
+
const l = s.label.toLowerCase().trim(), d = e.toLowerCase().trim();
|
|
5944
5944
|
if (s.aliases) {
|
|
5945
|
-
const h = s.aliases.map((g) => g.toLowerCase().trim()), u =
|
|
5945
|
+
const h = s.aliases.map((g) => g.toLowerCase().trim()), u = l.match(d), f = h.some((g) => g.match(d));
|
|
5946
5946
|
return u || f;
|
|
5947
5947
|
}
|
|
5948
|
-
return
|
|
5948
|
+
return l.match(d);
|
|
5949
5949
|
}).filter(
|
|
5950
5950
|
(s) => s.shouldBeHidden ? !s.shouldBeHidden(this.editor) : !0
|
|
5951
5951
|
)
|
|
@@ -5973,8 +5973,8 @@ const vu = Y.create({
|
|
|
5973
5973
|
return i.editor.storage[Ae].rect;
|
|
5974
5974
|
let s = c.y;
|
|
5975
5975
|
if (c.top + e.element.offsetHeight + 40 > window.innerHeight) {
|
|
5976
|
-
const
|
|
5977
|
-
s = c.y -
|
|
5976
|
+
const l = c.top + e.element.offsetHeight - window.innerHeight + 40;
|
|
5977
|
+
s = c.y - l;
|
|
5978
5978
|
}
|
|
5979
5979
|
return new DOMRect(c.x, s, c.width, c.height);
|
|
5980
5980
|
};
|
|
@@ -6060,7 +6060,7 @@ function Fl(e) {
|
|
|
6060
6060
|
wt.TOP_RIGHT,
|
|
6061
6061
|
wt.BOTTOM_LEFT,
|
|
6062
6062
|
wt.BOTTOM_RIGHT
|
|
6063
|
-
]), [c, s] = w(!1), [
|
|
6063
|
+
]), [c, s] = w(!1), [l, d] = w({
|
|
6064
6064
|
x: 0,
|
|
6065
6065
|
y: 0,
|
|
6066
6066
|
w: 0,
|
|
@@ -6112,7 +6112,7 @@ function Fl(e) {
|
|
|
6112
6112
|
let H = Number(e.node.attrs.width), z = Number(e.node.attrs.height);
|
|
6113
6113
|
const G = t.width;
|
|
6114
6114
|
H && !z ? (H = H > G ? G : H, z = Math.round(H / R)) : z && !H ? (H = Math.round(z * R), H = H > G ? G : H) : !H && !z ? (H = y > G ? G : y, z = Math.round(H / R)) : H = H > G ? G : H, Xe(() => {
|
|
6115
|
-
s(!0),
|
|
6115
|
+
s(!0), d({
|
|
6116
6116
|
x: L.clientX,
|
|
6117
6117
|
y: L.clientY,
|
|
6118
6118
|
w: H,
|
|
@@ -6125,17 +6125,17 @@ function Fl(e) {
|
|
|
6125
6125
|
Se((L) => {
|
|
6126
6126
|
if (L.preventDefault(), L.stopPropagation(), !c)
|
|
6127
6127
|
return;
|
|
6128
|
-
const { x: S, w: y, dir: $ } =
|
|
6128
|
+
const { x: S, w: y, dir: $ } = l, R = (L.clientX - S) * (/l/.test($) ? -1 : 1), H = mn(y + R, ui, t.width);
|
|
6129
6129
|
e.updateAttributes({
|
|
6130
6130
|
width: H,
|
|
6131
6131
|
height: null
|
|
6132
6132
|
});
|
|
6133
6133
|
}, Ke),
|
|
6134
|
-
[c,
|
|
6134
|
+
[c, l, t, e.updateAttributes]
|
|
6135
6135
|
), _ = A(
|
|
6136
6136
|
(L) => {
|
|
6137
6137
|
L.preventDefault(), L.stopPropagation(), c && (Xe(() => {
|
|
6138
|
-
|
|
6138
|
+
d({
|
|
6139
6139
|
x: 0,
|
|
6140
6140
|
y: 0,
|
|
6141
6141
|
w: 0,
|
|
@@ -6197,7 +6197,7 @@ function Fl(e) {
|
|
|
6197
6197
|
);
|
|
6198
6198
|
}
|
|
6199
6199
|
function Vl({ editor: e, imageInline: t, onClose: i }) {
|
|
6200
|
-
const { t: n } = D(), [a, o] = w(!1), c = Ve.useRef(null), [s,
|
|
6200
|
+
const { t: n } = D(), [a, o] = w(!1), c = Ve.useRef(null), [s, l] = Ve.useState(), [d, h] = Ve.useState(""), u = J(null), [f, g] = w({
|
|
6201
6201
|
src: "",
|
|
6202
6202
|
file: null
|
|
6203
6203
|
});
|
|
@@ -6226,7 +6226,7 @@ function Vl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6226
6226
|
async function C() {
|
|
6227
6227
|
var _, k;
|
|
6228
6228
|
try {
|
|
6229
|
-
const N = await vi(
|
|
6229
|
+
const N = await vi(d, ((_ = f == null ? void 0 : f.file) == null ? void 0 : _.name) || "image.png"), I = (k = e.extensionManager.extensions.find(
|
|
6230
6230
|
(M) => M.name === "image"
|
|
6231
6231
|
)) == null ? void 0 : k.options;
|
|
6232
6232
|
let O = "";
|
|
@@ -6263,7 +6263,7 @@ function Vl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6263
6263
|
Ao,
|
|
6264
6264
|
{
|
|
6265
6265
|
crop: s,
|
|
6266
|
-
onChange: (_) =>
|
|
6266
|
+
onChange: (_) => l(_),
|
|
6267
6267
|
onComplete: (_) => x(_),
|
|
6268
6268
|
className: "richtext-w-full",
|
|
6269
6269
|
children: /* @__PURE__ */ r(
|
|
@@ -6316,7 +6316,7 @@ function Vl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6316
6316
|
}
|
|
6317
6317
|
function Ul(e) {
|
|
6318
6318
|
const { t } = D(), i = Pl(), [n, a] = w(""), o = J(null), [c, s] = w(!1);
|
|
6319
|
-
async function
|
|
6319
|
+
async function l(u) {
|
|
6320
6320
|
var C, T;
|
|
6321
6321
|
const f = (C = u == null ? void 0 : u.target) == null ? void 0 : C.files;
|
|
6322
6322
|
if (!e.editor || e.editor.isDestroyed || f.length === 0)
|
|
@@ -6327,7 +6327,7 @@ function Ul(e) {
|
|
|
6327
6327
|
let b = "";
|
|
6328
6328
|
x.upload ? b = await x.upload(g) : b = URL.createObjectURL(g), e.editor.chain().focus().setImageInline({ src: b, inline: c }).run(), je.setOpen(!1), s(!1);
|
|
6329
6329
|
}
|
|
6330
|
-
function
|
|
6330
|
+
function d(u) {
|
|
6331
6331
|
u.preventDefault(), u.stopPropagation(), e.editor.chain().focus().setImageInline({ src: n, inline: c }).run(), je.setOpen(!1), s(!1);
|
|
6332
6332
|
}
|
|
6333
6333
|
function h(u) {
|
|
@@ -6391,11 +6391,11 @@ function Ul(e) {
|
|
|
6391
6391
|
style: {
|
|
6392
6392
|
display: "none"
|
|
6393
6393
|
},
|
|
6394
|
-
onChange:
|
|
6394
|
+
onChange: l
|
|
6395
6395
|
}
|
|
6396
6396
|
)
|
|
6397
6397
|
] }),
|
|
6398
|
-
/* @__PURE__ */ r(Ye, { value: "link", children: /* @__PURE__ */ r("form", { onSubmit:
|
|
6398
|
+
/* @__PURE__ */ r(Ye, { value: "link", children: /* @__PURE__ */ r("form", { onSubmit: d, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
6399
6399
|
/* @__PURE__ */ r(
|
|
6400
6400
|
te,
|
|
6401
6401
|
{
|
|
@@ -6458,12 +6458,12 @@ function Kl({ validateFn: e, onUpload: t, postUpload: i }) {
|
|
|
6458
6458
|
for (const c of n) {
|
|
6459
6459
|
if (e && !e(c))
|
|
6460
6460
|
continue;
|
|
6461
|
-
const s = Date.now().toString(),
|
|
6462
|
-
|
|
6463
|
-
const
|
|
6464
|
-
|
|
6465
|
-
add: [{ id: s, pos: o, src:
|
|
6466
|
-
}), a.dispatch(
|
|
6461
|
+
const s = Date.now().toString(), l = a.state.tr;
|
|
6462
|
+
l.selection.empty || l.deleteSelection();
|
|
6463
|
+
const d = URL.createObjectURL(c);
|
|
6464
|
+
l.setMeta(We, {
|
|
6465
|
+
add: [{ id: s, pos: o, src: d }]
|
|
6466
|
+
}), a.dispatch(l), t(c).then(
|
|
6467
6467
|
async (h) => {
|
|
6468
6468
|
var T;
|
|
6469
6469
|
i && typeof h == "string" && (h = await i(h));
|
|
@@ -6471,7 +6471,7 @@ function Kl({ validateFn: e, onUpload: t, postUpload: i }) {
|
|
|
6471
6471
|
let f = Gl(a.state, s);
|
|
6472
6472
|
if (f === null)
|
|
6473
6473
|
return;
|
|
6474
|
-
const g = typeof h == "object" ?
|
|
6474
|
+
const g = typeof h == "object" ? d : h, x = (T = u.nodes.image) == null ? void 0 : T.create({ src: g });
|
|
6475
6475
|
if (!x)
|
|
6476
6476
|
return;
|
|
6477
6477
|
const { doc: b } = a.state;
|
|
@@ -6515,7 +6515,7 @@ const Yl = {
|
|
|
6515
6515
|
acceptMimes: ["image/jpeg", "image/gif", "image/png", "image/jpg"],
|
|
6516
6516
|
maxSize: 1024 * 1024 * 5
|
|
6517
6517
|
// 5MB
|
|
6518
|
-
},
|
|
6518
|
+
}, Cu = si.extend({
|
|
6519
6519
|
group: "inline",
|
|
6520
6520
|
inline: !0,
|
|
6521
6521
|
defining: !0,
|
|
@@ -6676,30 +6676,33 @@ const Yl = {
|
|
|
6676
6676
|
}
|
|
6677
6677
|
});
|
|
6678
6678
|
function Jl(e) {
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6679
|
+
return /\.(?:mp4|webm|ogg|mov)$/i.test(e);
|
|
6680
|
+
}
|
|
6681
|
+
function Ql(e) {
|
|
6682
|
+
const { t } = D(), [i, n] = w(""), a = J(null), o = Bl(), [c, s] = w("");
|
|
6683
|
+
async function l(u) {
|
|
6684
|
+
var C, T;
|
|
6685
|
+
const f = (C = u == null ? void 0 : u.target) == null ? void 0 : C.files;
|
|
6686
|
+
if (!e.editor || e.editor.isDestroyed || f.length === 0)
|
|
6684
6687
|
return;
|
|
6685
|
-
const
|
|
6686
|
-
(
|
|
6687
|
-
)) == null ? void 0 :
|
|
6688
|
-
let
|
|
6689
|
-
|
|
6690
|
-
src:
|
|
6688
|
+
const g = f[0], x = (T = e.editor.extensionManager.extensions.find(
|
|
6689
|
+
(v) => v.name === td.name
|
|
6690
|
+
)) == null ? void 0 : T.options;
|
|
6691
|
+
let b = "";
|
|
6692
|
+
x.upload ? b = await x.upload(g) : b = URL.createObjectURL(g), e.editor.chain().setVideo({
|
|
6693
|
+
src: b,
|
|
6691
6694
|
width: "100%"
|
|
6692
6695
|
}).focus().run(), ot.setOpen(!1);
|
|
6693
6696
|
}
|
|
6694
|
-
function
|
|
6695
|
-
|
|
6697
|
+
function d(u) {
|
|
6698
|
+
u.preventDefault(), u.stopPropagation(), i && (e.editor.chain().setVideo({
|
|
6696
6699
|
src: i,
|
|
6697
6700
|
width: "100%"
|
|
6698
|
-
}).focus().run(), ot.setOpen(!1);
|
|
6701
|
+
}).focus().run(), ot.setOpen(!1));
|
|
6699
6702
|
}
|
|
6700
|
-
function
|
|
6701
|
-
var
|
|
6702
|
-
|
|
6703
|
+
function h(u) {
|
|
6704
|
+
var f;
|
|
6705
|
+
u.preventDefault(), (f = a.current) == null || f.click();
|
|
6703
6706
|
}
|
|
6704
6707
|
return /* @__PURE__ */ m(Ee, { open: o.isOpen, onOpenChange: ot.setOpen, children: [
|
|
6705
6708
|
/* @__PURE__ */ r(Re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -6725,7 +6728,7 @@ function Jl(e) {
|
|
|
6725
6728
|
] })
|
|
6726
6729
|
] }),
|
|
6727
6730
|
/* @__PURE__ */ m(Ye, { value: "upload", children: [
|
|
6728
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ r(U, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick:
|
|
6731
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ r(U, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: h, children: t("editor.video.dialog.tab.upload") }) }),
|
|
6729
6732
|
/* @__PURE__ */ r(
|
|
6730
6733
|
"input",
|
|
6731
6734
|
{
|
|
@@ -6736,32 +6739,42 @@ function Jl(e) {
|
|
|
6736
6739
|
style: {
|
|
6737
6740
|
display: "none"
|
|
6738
6741
|
},
|
|
6739
|
-
onChange:
|
|
6742
|
+
onChange: l
|
|
6740
6743
|
}
|
|
6741
6744
|
)
|
|
6742
6745
|
] }),
|
|
6743
|
-
/* @__PURE__ */
|
|
6744
|
-
/* @__PURE__ */ r(
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6746
|
+
/* @__PURE__ */ m(Ye, { value: "link", children: [
|
|
6747
|
+
/* @__PURE__ */ r("form", { onSubmit: d, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
6748
|
+
/* @__PURE__ */ r(
|
|
6749
|
+
te,
|
|
6750
|
+
{
|
|
6751
|
+
type: "url",
|
|
6752
|
+
autoFocus: !0,
|
|
6753
|
+
value: i,
|
|
6754
|
+
onChange: (u) => {
|
|
6755
|
+
const f = u.target.value;
|
|
6756
|
+
if (!Jl(f)) {
|
|
6757
|
+
s("Invalid video URL"), n("");
|
|
6758
|
+
return;
|
|
6759
|
+
}
|
|
6760
|
+
s(""), n(f);
|
|
6761
|
+
},
|
|
6762
|
+
required: !0,
|
|
6763
|
+
placeholder: t("editor.video.dialog.placeholder")
|
|
6764
|
+
}
|
|
6765
|
+
),
|
|
6766
|
+
/* @__PURE__ */ r(U, { type: "submit", children: t("editor.video.dialog.button.apply") })
|
|
6767
|
+
] }) }),
|
|
6768
|
+
c && /* @__PURE__ */ r("div", { className: "richtext-text-red-500 richtext-my-[5px]", children: c })
|
|
6769
|
+
] })
|
|
6757
6770
|
] })
|
|
6758
6771
|
] })
|
|
6759
6772
|
] });
|
|
6760
6773
|
}
|
|
6761
|
-
function
|
|
6774
|
+
function ed(e) {
|
|
6762
6775
|
return e = e.replace("https://youtu.be/", "https://www.youtube.com/watch?v=").replace("watch?v=", "embed/"), e = e.replace("https://vimeo.com/", "https://player.vimeo.com/video/"), /^https?:\/\/www.bilibili.com\/video\/.*/i.test(e) && (e = e.replace(/\?.*$/, "").replace("https://www.bilibili.com/video/", "https://player.bilibili.com/player.html?bvid=")), e.includes("drive.google.com") && (e = e.replace("/view", "/preview")), e;
|
|
6763
6776
|
}
|
|
6764
|
-
const
|
|
6777
|
+
const td = ue.create({
|
|
6765
6778
|
name: "video",
|
|
6766
6779
|
group: "block",
|
|
6767
6780
|
atom: !0,
|
|
@@ -6781,7 +6794,7 @@ const ku = ue.create({
|
|
|
6781
6794
|
button: ({ editor: e, t }) => {
|
|
6782
6795
|
var i, n;
|
|
6783
6796
|
return {
|
|
6784
|
-
component:
|
|
6797
|
+
component: Ql,
|
|
6785
6798
|
componentProps: {
|
|
6786
6799
|
action: () => {
|
|
6787
6800
|
},
|
|
@@ -6801,7 +6814,7 @@ const ku = ue.create({
|
|
|
6801
6814
|
src: {
|
|
6802
6815
|
default: null,
|
|
6803
6816
|
renderHTML: ({ src: e }) => ({
|
|
6804
|
-
src: e ?
|
|
6817
|
+
src: e ? ed(e) : null
|
|
6805
6818
|
})
|
|
6806
6819
|
},
|
|
6807
6820
|
width: {
|
|
@@ -6848,7 +6861,7 @@ const ku = ue.create({
|
|
|
6848
6861
|
};
|
|
6849
6862
|
}
|
|
6850
6863
|
});
|
|
6851
|
-
function
|
|
6864
|
+
function id(e, t, i) {
|
|
6852
6865
|
if (!e.doc)
|
|
6853
6866
|
return e;
|
|
6854
6867
|
const n = e.doc.nodeAt(t);
|
|
@@ -6860,19 +6873,19 @@ function ed(e, t, i) {
|
|
|
6860
6873
|
};
|
|
6861
6874
|
return e.setNodeMarkup(t, n.type, a, n.marks);
|
|
6862
6875
|
}
|
|
6863
|
-
function
|
|
6876
|
+
function nd(e, t, i) {
|
|
6864
6877
|
const { doc: n, selection: a } = e;
|
|
6865
6878
|
return !n || !a || !(a instanceof bo) || a.forEachCell((o, c) => {
|
|
6866
|
-
e =
|
|
6879
|
+
e = id(e, c, i);
|
|
6867
6880
|
}), e;
|
|
6868
6881
|
}
|
|
6869
6882
|
function Gi(e, t) {
|
|
6870
6883
|
return ({ tr: i, state: n, dispatch: a }) => {
|
|
6871
6884
|
const { selection: o } = n;
|
|
6872
|
-
return i = i.setSelection(o), i =
|
|
6885
|
+
return i = i.setSelection(o), i = nd(i, t, e), i.docChanged ? (a == null || a(i), !0) : !1;
|
|
6873
6886
|
};
|
|
6874
6887
|
}
|
|
6875
|
-
const
|
|
6888
|
+
const rd = Y.create({
|
|
6876
6889
|
name: "tableCellBackground",
|
|
6877
6890
|
addOptions() {
|
|
6878
6891
|
return {
|
|
@@ -6901,13 +6914,13 @@ const id = Y.create({
|
|
|
6901
6914
|
unsetTableCellBackground: () => Gi("", this.options)
|
|
6902
6915
|
};
|
|
6903
6916
|
}
|
|
6904
|
-
}),
|
|
6917
|
+
}), ad = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, od = /CrOS/, cd = /android|ipad|playbook|silk/i;
|
|
6905
6918
|
function Ki(e = {}) {
|
|
6906
6919
|
let t = e.ua || typeof navigator < "u" && navigator.userAgent;
|
|
6907
|
-
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(
|
|
6920
|
+
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(ad.test(t) && !od.test(t) || e.tablet && cd.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
|
|
6908
6921
|
}
|
|
6909
6922
|
const Xi = (e) => Array.from({ length: e }).map((t, i) => i + 1);
|
|
6910
|
-
function
|
|
6923
|
+
function sd(e) {
|
|
6911
6924
|
var h;
|
|
6912
6925
|
const [t, i] = w(!0), [n, a] = w({
|
|
6913
6926
|
rows: Ki() ? xt : bt,
|
|
@@ -6928,10 +6941,10 @@ function od(e) {
|
|
|
6928
6941
|
cols: f
|
|
6929
6942
|
});
|
|
6930
6943
|
}
|
|
6931
|
-
function
|
|
6932
|
-
e == null || e.createTable({ rows: u, cols: f, withHeaderRow: t }),
|
|
6944
|
+
function l(u, f) {
|
|
6945
|
+
e == null || e.createTable({ rows: u, cols: f, withHeaderRow: t }), d();
|
|
6933
6946
|
}
|
|
6934
|
-
function
|
|
6947
|
+
function d() {
|
|
6935
6948
|
i(!1), a({
|
|
6936
6949
|
rows: bt,
|
|
6937
6950
|
cols: bt
|
|
@@ -6950,7 +6963,7 @@ function od(e) {
|
|
|
6950
6963
|
{
|
|
6951
6964
|
className: `richtext-cursor-pointer richtext-border-border ${g <= o.cols && u <= o.rows && "!richtext-bg-foreground tableCellActive"}`,
|
|
6952
6965
|
onMouseOver: () => s(u, g),
|
|
6953
|
-
onMouseDown: () =>
|
|
6966
|
+
onMouseDown: () => l(u, g),
|
|
6954
6967
|
children: /* @__PURE__ */ r("div", { className: "richtext-w-4 richtext-h-4 richtext-p-1 !richtext-border richtext-rounded-[2px] richtext-box-border richtext-border-solid !richtext-border-border" })
|
|
6955
6968
|
},
|
|
6956
6969
|
`c-${g}`
|
|
@@ -6965,11 +6978,11 @@ function od(e) {
|
|
|
6965
6978
|
] }) })
|
|
6966
6979
|
] });
|
|
6967
6980
|
}
|
|
6968
|
-
function
|
|
6981
|
+
function ld(e) {
|
|
6969
6982
|
function t(i) {
|
|
6970
6983
|
e.disabled || e.editor.chain().focus().insertTable({ ...i, withHeaderRow: !1 }).run();
|
|
6971
6984
|
}
|
|
6972
|
-
return /* @__PURE__ */ r(
|
|
6985
|
+
return /* @__PURE__ */ r(sd, { createTable: t, children: /* @__PURE__ */ r(
|
|
6973
6986
|
p,
|
|
6974
6987
|
{
|
|
6975
6988
|
icon: e == null ? void 0 : e.icon,
|
|
@@ -6981,7 +6994,7 @@ function cd(e) {
|
|
|
6981
6994
|
}
|
|
6982
6995
|
) });
|
|
6983
6996
|
}
|
|
6984
|
-
const
|
|
6997
|
+
const Nu = oo.extend({
|
|
6985
6998
|
addOptions() {
|
|
6986
6999
|
var e;
|
|
6987
7000
|
return {
|
|
@@ -6990,7 +7003,7 @@ const Cu = oo.extend({
|
|
|
6990
7003
|
lastColumnResizable: !0,
|
|
6991
7004
|
allowTableNodeSelection: !1,
|
|
6992
7005
|
button: ({ editor: t, t: i }) => ({
|
|
6993
|
-
component:
|
|
7006
|
+
component: ld,
|
|
6994
7007
|
componentProps: {
|
|
6995
7008
|
disabled: t.isActive("table") || !1,
|
|
6996
7009
|
icon: "Table",
|
|
@@ -7005,10 +7018,10 @@ const Cu = oo.extend({
|
|
|
7005
7018
|
co.configure(this.options.tableRow),
|
|
7006
7019
|
so.configure(this.options.tableHeader),
|
|
7007
7020
|
lo.configure(this.options.tableCell),
|
|
7008
|
-
|
|
7021
|
+
rd.configure(this.options.tableCellBackground)
|
|
7009
7022
|
];
|
|
7010
7023
|
}
|
|
7011
|
-
}),
|
|
7024
|
+
}), Tu = Y.create({
|
|
7012
7025
|
name: "painter",
|
|
7013
7026
|
addOptions() {
|
|
7014
7027
|
var e;
|
|
@@ -7065,8 +7078,8 @@ const Cu = oo.extend({
|
|
|
7065
7078
|
dom: s
|
|
7066
7079
|
} = e;
|
|
7067
7080
|
s.style.cursor = "", o = o.removeMark(c.from, c.to);
|
|
7068
|
-
for (const
|
|
7069
|
-
|
|
7081
|
+
for (const l of i)
|
|
7082
|
+
l.type.name !== "link" && (o = o.addMark(c.from, c.to, l));
|
|
7070
7083
|
a(o.setMeta("painterAction", { type: "end" }));
|
|
7071
7084
|
};
|
|
7072
7085
|
return document.addEventListener("mouseup", n), !0;
|
|
@@ -7077,18 +7090,18 @@ const Cu = oo.extend({
|
|
|
7077
7090
|
];
|
|
7078
7091
|
}
|
|
7079
7092
|
});
|
|
7080
|
-
function
|
|
7081
|
-
const { t: i } = D(), [n, a] = w(-1), [o, c] = w([]), [s,
|
|
7093
|
+
function dd({ editor: e, ...t }) {
|
|
7094
|
+
const { t: i } = D(), [n, a] = w(-1), [o, c] = w([]), [s, l] = w(""), [d, h] = w(""), [u, f] = w(!1), [g, x] = w(!1);
|
|
7082
7095
|
return E(() => {
|
|
7083
|
-
u || (
|
|
7096
|
+
u || (l(""), h(""), a(-1), c([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
|
|
7084
7097
|
}, [e, u]), E(() => {
|
|
7085
7098
|
u && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(s);
|
|
7086
7099
|
}, [u, s, e]), E(() => {
|
|
7087
|
-
u && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(
|
|
7088
|
-
}, [u,
|
|
7100
|
+
u && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(d);
|
|
7101
|
+
}, [u, d, e]), E(() => {
|
|
7089
7102
|
if (!e)
|
|
7090
7103
|
return;
|
|
7091
|
-
const b = e.extensionManager.extensions.find((T) => T.name ===
|
|
7104
|
+
const b = e.extensionManager.extensions.find((T) => T.name === gd.name);
|
|
7092
7105
|
if (!b)
|
|
7093
7106
|
return;
|
|
7094
7107
|
const C = () => {
|
|
@@ -7144,7 +7157,7 @@ function sd({ editor: e, ...t }) {
|
|
|
7144
7157
|
placeholder: "Text",
|
|
7145
7158
|
autoFocus: !0,
|
|
7146
7159
|
value: s,
|
|
7147
|
-
onChange: (b) =>
|
|
7160
|
+
onChange: (b) => l(b.target.value)
|
|
7148
7161
|
}
|
|
7149
7162
|
),
|
|
7150
7163
|
/* @__PURE__ */ r(U, { disabled: !o.length, className: "richtext-flex-1", onClick: e.commands.goToPrevSearchResult, children: /* @__PURE__ */ r(F, { name: "ChevronUp" }) }),
|
|
@@ -7158,7 +7171,7 @@ function sd({ editor: e, ...t }) {
|
|
|
7158
7171
|
required: !0,
|
|
7159
7172
|
className: "richtext-w-80",
|
|
7160
7173
|
placeholder: "Text",
|
|
7161
|
-
value:
|
|
7174
|
+
value: d,
|
|
7162
7175
|
onChange: (b) => h(b.target.value)
|
|
7163
7176
|
}
|
|
7164
7177
|
) }) }),
|
|
@@ -7186,40 +7199,40 @@ function sd({ editor: e, ...t }) {
|
|
|
7186
7199
|
);
|
|
7187
7200
|
}
|
|
7188
7201
|
const at = (e, t) => t(e.tr);
|
|
7189
|
-
function
|
|
7202
|
+
function hd(e, t, i) {
|
|
7190
7203
|
return RegExp(t ? e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&") : e, i ? "gu" : "gui");
|
|
7191
7204
|
}
|
|
7192
|
-
function
|
|
7205
|
+
function ud(e, t, i) {
|
|
7193
7206
|
const n = [];
|
|
7194
7207
|
let a = [];
|
|
7195
7208
|
const o = [];
|
|
7196
7209
|
let c = 0;
|
|
7197
7210
|
if (!t)
|
|
7198
7211
|
return { decorationsToReturn: [], results: [] };
|
|
7199
|
-
e == null || e.descendants((s,
|
|
7212
|
+
e == null || e.descendants((s, l) => {
|
|
7200
7213
|
s.isText ? a[c] ? a[c] = {
|
|
7201
7214
|
text: a[c].text + s.text,
|
|
7202
7215
|
pos: a[c].pos
|
|
7203
7216
|
} : a[c] = {
|
|
7204
7217
|
text: `${s.text}`,
|
|
7205
|
-
pos:
|
|
7218
|
+
pos: l
|
|
7206
7219
|
} : c += 1;
|
|
7207
7220
|
}), a = a.filter(Boolean);
|
|
7208
7221
|
for (let s = 0; s < a.length; s += 1) {
|
|
7209
|
-
const { text:
|
|
7222
|
+
const { text: l, pos: d } = a[s], h = [...l.matchAll(t)];
|
|
7210
7223
|
for (let u = 0; u < h.length; u += 1) {
|
|
7211
7224
|
const f = h[u];
|
|
7212
7225
|
if (f[0] === "")
|
|
7213
7226
|
break;
|
|
7214
7227
|
f.index !== void 0 && o.push({
|
|
7215
|
-
from:
|
|
7216
|
-
to:
|
|
7228
|
+
from: d + f.index,
|
|
7229
|
+
to: d + f.index + f[0].length
|
|
7217
7230
|
});
|
|
7218
7231
|
}
|
|
7219
7232
|
}
|
|
7220
7233
|
for (let s = 0; s < o.length; s += 1) {
|
|
7221
|
-
const
|
|
7222
|
-
n.push(qe.inline(
|
|
7234
|
+
const l = o[s];
|
|
7235
|
+
n.push(qe.inline(l.from, l.to, { class: i }));
|
|
7223
7236
|
}
|
|
7224
7237
|
return {
|
|
7225
7238
|
decorationsToReturn: n,
|
|
@@ -7232,25 +7245,25 @@ function Zi(e, t, { state: i, dispatch: n }) {
|
|
|
7232
7245
|
const { from: o, to: c } = t[0];
|
|
7233
7246
|
n && n(i.tr.insertText(e, o, c));
|
|
7234
7247
|
}
|
|
7235
|
-
function
|
|
7248
|
+
function md(e, t, i, n) {
|
|
7236
7249
|
const a = t + 1;
|
|
7237
7250
|
if (!n[a])
|
|
7238
7251
|
return null;
|
|
7239
|
-
const { from: o, to: c } = n[t], s = c - o - e.length + i, { from:
|
|
7252
|
+
const { from: o, to: c } = n[t], s = c - o - e.length + i, { from: l, to: d } = n[a];
|
|
7240
7253
|
return n[a] = {
|
|
7241
|
-
to:
|
|
7242
|
-
from:
|
|
7254
|
+
to: d - s,
|
|
7255
|
+
from: l - s
|
|
7243
7256
|
}, [s, n];
|
|
7244
7257
|
}
|
|
7245
|
-
function
|
|
7258
|
+
function fd(e, t, { tr: i, dispatch: n }) {
|
|
7246
7259
|
let a = 0, o = t.slice();
|
|
7247
7260
|
if (!o.length)
|
|
7248
7261
|
return !1;
|
|
7249
7262
|
for (let c = 0; c < o.length; c += 1) {
|
|
7250
|
-
const { from: s, to:
|
|
7251
|
-
i.insertText(e, s,
|
|
7252
|
-
const
|
|
7253
|
-
|
|
7263
|
+
const { from: s, to: l } = o[c];
|
|
7264
|
+
i.insertText(e, s, l);
|
|
7265
|
+
const d = md(e, c, a, o);
|
|
7266
|
+
d && (a = d[0], o = d[1]);
|
|
7254
7267
|
}
|
|
7255
7268
|
return n(i), !0;
|
|
7256
7269
|
}
|
|
@@ -7269,7 +7282,7 @@ function Yi({ view: e, tr: t, searchResults: i, searchResultCurrentClass: n, got
|
|
|
7269
7282
|
}
|
|
7270
7283
|
return !1;
|
|
7271
7284
|
}
|
|
7272
|
-
const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri),
|
|
7285
|
+
const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri), gd = Y.create({
|
|
7273
7286
|
name: "search",
|
|
7274
7287
|
addOptions() {
|
|
7275
7288
|
var e;
|
|
@@ -7286,7 +7299,7 @@ const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri), md = Y.create({
|
|
|
7286
7299
|
onChange: () => {
|
|
7287
7300
|
},
|
|
7288
7301
|
button: ({ editor: t, t: i }) => ({
|
|
7289
|
-
component:
|
|
7302
|
+
component: dd,
|
|
7290
7303
|
componentProps: {
|
|
7291
7304
|
action: () => {
|
|
7292
7305
|
},
|
|
@@ -7316,7 +7329,7 @@ const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri), md = Y.create({
|
|
|
7316
7329
|
},
|
|
7317
7330
|
replaceAll: () => ({ state: e, tr: t, dispatch: i }) => {
|
|
7318
7331
|
const { replaceTerm: n } = this.options, { results: a } = this.storage;
|
|
7319
|
-
return
|
|
7332
|
+
return fd(n, a, { tr: t, dispatch: i }), this.storage.currentIndex = -1, this.storage.results = [], window.dispatchEvent(Pe), at(e, i), !1;
|
|
7320
7333
|
},
|
|
7321
7334
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
7322
7335
|
const { searchResultCurrentClass: i } = this.options, { currentIndex: n, results: a } = this.storage, o = (n + a.length - 1) % a.length;
|
|
@@ -7350,21 +7363,21 @@ const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri), md = Y.create({
|
|
|
7350
7363
|
return Ue.empty;
|
|
7351
7364
|
},
|
|
7352
7365
|
apply(t) {
|
|
7353
|
-
const { doc: i, docChanged: n } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: c, disableRegex: s, caseSensitive:
|
|
7366
|
+
const { doc: i, docChanged: n } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: c, disableRegex: s, caseSensitive: l } = e.options;
|
|
7354
7367
|
if (n || a) {
|
|
7355
|
-
const { decorationsToReturn:
|
|
7368
|
+
const { decorationsToReturn: d, results: h } = ud(
|
|
7356
7369
|
i,
|
|
7357
|
-
|
|
7370
|
+
hd(a, s, l),
|
|
7358
7371
|
o
|
|
7359
7372
|
);
|
|
7360
7373
|
if (e.storage.results = h, e.storage.currentIndex > h.length - 1 && (e.storage.currentIndex = 0), window.dispatchEvent(Pe), t.getMeta("directDecoration")) {
|
|
7361
7374
|
const { fromPos: u, toPos: f, attrs: g } = t.getMeta("directDecoration");
|
|
7362
|
-
|
|
7375
|
+
d.push(qe.inline(u, f, g));
|
|
7363
7376
|
} else
|
|
7364
|
-
h.length && (
|
|
7377
|
+
h.length && (d[0] = qe.inline(h[0].from, h[0].to, {
|
|
7365
7378
|
class: c
|
|
7366
7379
|
}));
|
|
7367
|
-
return Ue.create(i,
|
|
7380
|
+
return Ue.create(i, d);
|
|
7368
7381
|
}
|
|
7369
7382
|
return Ue.empty;
|
|
7370
7383
|
}
|
|
@@ -9221,10 +9234,10 @@ Object.keys(Je).reduce((e, t) => {
|
|
|
9221
9234
|
const i = Je[t];
|
|
9222
9235
|
return e[i] = t, e;
|
|
9223
9236
|
}, {});
|
|
9224
|
-
const
|
|
9237
|
+
const xd = Object.keys(Je).map((e) => e);
|
|
9225
9238
|
Object.keys(Je).map((e) => Je[e]);
|
|
9226
|
-
function
|
|
9227
|
-
return
|
|
9239
|
+
function bd(e) {
|
|
9240
|
+
return xd.filter((t) => t.startsWith(e)).map((t) => ({
|
|
9228
9241
|
name: t,
|
|
9229
9242
|
emoji: Je[t]
|
|
9230
9243
|
}));
|
|
@@ -9235,9 +9248,9 @@ const Yn = Lt((e, t) => {
|
|
|
9235
9248
|
u && e.command(u);
|
|
9236
9249
|
}, s = () => {
|
|
9237
9250
|
a((n + e.items.length - 1) % e.items.length);
|
|
9238
|
-
}, d = () => {
|
|
9239
|
-
a((n + 1) % e.items.length);
|
|
9240
9251
|
}, l = () => {
|
|
9252
|
+
a((n + 1) % e.items.length);
|
|
9253
|
+
}, d = () => {
|
|
9241
9254
|
c(n);
|
|
9242
9255
|
};
|
|
9243
9256
|
return E(() => a(0), [e.items]), E(() => {
|
|
@@ -9246,7 +9259,7 @@ const Yn = Lt((e, t) => {
|
|
|
9246
9259
|
const h = i.current.querySelector(`span:nth-of-type(${n + 1})`);
|
|
9247
9260
|
h && gi(h, { behavior: "smooth", scrollMode: "if-needed" });
|
|
9248
9261
|
}, [n]), St(t, () => ({
|
|
9249
|
-
onKeyDown: ({ event: h }) => h.key === "ArrowUp" ? (s(), !0) : h.key === "ArrowDown" ? (
|
|
9262
|
+
onKeyDown: ({ event: h }) => h.key === "ArrowUp" ? (s(), !0) : h.key === "ArrowDown" ? (l(), !0) : h.key === "Enter" ? (d(), !0) : !1
|
|
9250
9263
|
})), /* @__PURE__ */ r("div", { className: "richtext-w-[200px] richtext-max-h-[320px] richtext-overflow-x-hidden richtext-overflow-y-auto richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ r("div", { ref: i, children: e.items.length ? e.items.map((h, u) => /* @__PURE__ */ m(
|
|
9251
9264
|
"span",
|
|
9252
9265
|
{
|
|
@@ -9263,7 +9276,7 @@ const Yn = Lt((e, t) => {
|
|
|
9263
9276
|
)) : /* @__PURE__ */ r("div", { className: "richtext-flex richtext-relative richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors", children: /* @__PURE__ */ r("span", { children: o("no_result_found") }) }) }) });
|
|
9264
9277
|
});
|
|
9265
9278
|
Yn.displayName = "EmojiList";
|
|
9266
|
-
const
|
|
9279
|
+
const pd = [
|
|
9267
9280
|
"😀",
|
|
9268
9281
|
"😃",
|
|
9269
9282
|
"😄",
|
|
@@ -9477,7 +9490,7 @@ const xd = [
|
|
|
9477
9490
|
"🗯",
|
|
9478
9491
|
"💭",
|
|
9479
9492
|
"💤"
|
|
9480
|
-
],
|
|
9493
|
+
], wd = [
|
|
9481
9494
|
"🏧",
|
|
9482
9495
|
"🚮",
|
|
9483
9496
|
"🚰",
|
|
@@ -9779,7 +9792,7 @@ const xd = [
|
|
|
9779
9792
|
"🔘",
|
|
9780
9793
|
"🔳",
|
|
9781
9794
|
"🔲"
|
|
9782
|
-
],
|
|
9795
|
+
], _d = [
|
|
9783
9796
|
"👓",
|
|
9784
9797
|
"🕶️",
|
|
9785
9798
|
"🕶",
|
|
@@ -10079,7 +10092,7 @@ const xd = [
|
|
|
10079
10092
|
"⚱",
|
|
10080
10093
|
"🗿",
|
|
10081
10094
|
"🪧"
|
|
10082
|
-
],
|
|
10095
|
+
], vd = [
|
|
10083
10096
|
"🎃",
|
|
10084
10097
|
"🎄",
|
|
10085
10098
|
"🎆",
|
|
@@ -10175,7 +10188,7 @@ const xd = [
|
|
|
10175
10188
|
"🪡",
|
|
10176
10189
|
"🧶",
|
|
10177
10190
|
"🪢"
|
|
10178
|
-
],
|
|
10191
|
+
], yd = [
|
|
10179
10192
|
"🌍",
|
|
10180
10193
|
"🌎",
|
|
10181
10194
|
"🌏",
|
|
@@ -10440,7 +10453,7 @@ const xd = [
|
|
|
10440
10453
|
"🔥",
|
|
10441
10454
|
"💧",
|
|
10442
10455
|
"🌊"
|
|
10443
|
-
],
|
|
10456
|
+
], kd = [
|
|
10444
10457
|
"🏁",
|
|
10445
10458
|
"🚩",
|
|
10446
10459
|
"🎌",
|
|
@@ -10716,7 +10729,7 @@ const xd = [
|
|
|
10716
10729
|
"🏴",
|
|
10717
10730
|
"🏴",
|
|
10718
10731
|
"🏴"
|
|
10719
|
-
],
|
|
10732
|
+
], Cd = [
|
|
10720
10733
|
"🐵",
|
|
10721
10734
|
"🐒",
|
|
10722
10735
|
"🦍",
|
|
@@ -10864,7 +10877,7 @@ const xd = [
|
|
|
10864
10877
|
"🍁",
|
|
10865
10878
|
"🍂",
|
|
10866
10879
|
"🍃"
|
|
10867
|
-
],
|
|
10880
|
+
], Nd = [
|
|
10868
10881
|
"🍇",
|
|
10869
10882
|
"🍈",
|
|
10870
10883
|
"🍉",
|
|
@@ -10997,7 +11010,7 @@ const xd = [
|
|
|
10997
11010
|
"🔪",
|
|
10998
11011
|
"🏺"
|
|
10999
11012
|
];
|
|
11000
|
-
function
|
|
11013
|
+
function Td() {
|
|
11001
11014
|
return /* @__PURE__ */ r(
|
|
11002
11015
|
"svg",
|
|
11003
11016
|
{
|
|
@@ -11015,7 +11028,7 @@ function Cd() {
|
|
|
11015
11028
|
}
|
|
11016
11029
|
);
|
|
11017
11030
|
}
|
|
11018
|
-
function
|
|
11031
|
+
function Ad() {
|
|
11019
11032
|
return /* @__PURE__ */ m(
|
|
11020
11033
|
"svg",
|
|
11021
11034
|
{
|
|
@@ -11042,7 +11055,7 @@ function Nd() {
|
|
|
11042
11055
|
}
|
|
11043
11056
|
);
|
|
11044
11057
|
}
|
|
11045
|
-
function
|
|
11058
|
+
function Ld() {
|
|
11046
11059
|
return /* @__PURE__ */ r(
|
|
11047
11060
|
"svg",
|
|
11048
11061
|
{
|
|
@@ -11060,7 +11073,7 @@ function Td() {
|
|
|
11060
11073
|
}
|
|
11061
11074
|
);
|
|
11062
11075
|
}
|
|
11063
|
-
function
|
|
11076
|
+
function Sd() {
|
|
11064
11077
|
return /* @__PURE__ */ r(
|
|
11065
11078
|
"svg",
|
|
11066
11079
|
{
|
|
@@ -11078,7 +11091,7 @@ function Ad() {
|
|
|
11078
11091
|
}
|
|
11079
11092
|
);
|
|
11080
11093
|
}
|
|
11081
|
-
function
|
|
11094
|
+
function Md() {
|
|
11082
11095
|
return /* @__PURE__ */ m(
|
|
11083
11096
|
"svg",
|
|
11084
11097
|
{
|
|
@@ -11105,7 +11118,7 @@ function Ld() {
|
|
|
11105
11118
|
}
|
|
11106
11119
|
);
|
|
11107
11120
|
}
|
|
11108
|
-
function
|
|
11121
|
+
function Id() {
|
|
11109
11122
|
return /* @__PURE__ */ r(
|
|
11110
11123
|
"svg",
|
|
11111
11124
|
{
|
|
@@ -11123,7 +11136,7 @@ function Sd() {
|
|
|
11123
11136
|
}
|
|
11124
11137
|
);
|
|
11125
11138
|
}
|
|
11126
|
-
function
|
|
11139
|
+
function zd() {
|
|
11127
11140
|
return /* @__PURE__ */ m(
|
|
11128
11141
|
"svg",
|
|
11129
11142
|
{
|
|
@@ -11150,7 +11163,7 @@ function Md() {
|
|
|
11150
11163
|
}
|
|
11151
11164
|
);
|
|
11152
11165
|
}
|
|
11153
|
-
function
|
|
11166
|
+
function Hd(e, t = null) {
|
|
11154
11167
|
if (typeof window > "u")
|
|
11155
11168
|
throw new Error();
|
|
11156
11169
|
const i = localStorage.getItem(e);
|
|
@@ -11162,7 +11175,7 @@ function Id(e, t = null) {
|
|
|
11162
11175
|
return i;
|
|
11163
11176
|
}
|
|
11164
11177
|
}
|
|
11165
|
-
function
|
|
11178
|
+
function Ed(e, t) {
|
|
11166
11179
|
window.localStorage.setItem(e, `${t}`);
|
|
11167
11180
|
}
|
|
11168
11181
|
class Wt {
|
|
@@ -11174,7 +11187,7 @@ class Wt {
|
|
|
11174
11187
|
this.key = t, this.value = i, this.prev = null, this.next = null;
|
|
11175
11188
|
}
|
|
11176
11189
|
}
|
|
11177
|
-
class
|
|
11190
|
+
class Rd {
|
|
11178
11191
|
constructor(t) {
|
|
11179
11192
|
me(this, "capacity");
|
|
11180
11193
|
me(this, "usedCapacity");
|
|
@@ -11233,16 +11246,16 @@ class Hd {
|
|
|
11233
11246
|
return this.store;
|
|
11234
11247
|
}
|
|
11235
11248
|
}
|
|
11236
|
-
function
|
|
11237
|
-
const i = new
|
|
11249
|
+
function Od(e, t) {
|
|
11250
|
+
const i = new Rd(t);
|
|
11238
11251
|
return {
|
|
11239
11252
|
syncFromStorage() {
|
|
11240
|
-
(
|
|
11253
|
+
(Hd(e) || []).slice().reverse().forEach((o) => {
|
|
11241
11254
|
i.put(o, o);
|
|
11242
11255
|
});
|
|
11243
11256
|
},
|
|
11244
11257
|
syncToStorage() {
|
|
11245
|
-
|
|
11258
|
+
Ed(e, dc(i.keys()));
|
|
11246
11259
|
},
|
|
11247
11260
|
put(a) {
|
|
11248
11261
|
i.put(a, a), this.syncToStorage();
|
|
@@ -11252,49 +11265,49 @@ function Ed(e, t) {
|
|
|
11252
11265
|
}
|
|
11253
11266
|
};
|
|
11254
11267
|
}
|
|
11255
|
-
const Be =
|
|
11268
|
+
const Be = Od("EMOJI_PICKER", 20), Ji = [
|
|
11256
11269
|
{
|
|
11257
11270
|
title: "Smileys & People",
|
|
11258
|
-
data:
|
|
11271
|
+
data: pd,
|
|
11259
11272
|
icon: fa
|
|
11260
11273
|
},
|
|
11261
11274
|
{
|
|
11262
11275
|
title: "Animals & Nature",
|
|
11263
|
-
data:
|
|
11264
|
-
icon:
|
|
11276
|
+
data: Cd,
|
|
11277
|
+
icon: Ad
|
|
11265
11278
|
},
|
|
11266
11279
|
{
|
|
11267
11280
|
title: "Food & Drink",
|
|
11268
|
-
data:
|
|
11269
|
-
icon:
|
|
11281
|
+
data: Nd,
|
|
11282
|
+
icon: Sd
|
|
11270
11283
|
},
|
|
11271
11284
|
{
|
|
11272
11285
|
title: "Activity",
|
|
11273
|
-
data:
|
|
11274
|
-
icon:
|
|
11286
|
+
data: vd,
|
|
11287
|
+
icon: Td
|
|
11275
11288
|
},
|
|
11276
11289
|
{
|
|
11277
11290
|
title: "Travel & Places",
|
|
11278
|
-
data:
|
|
11279
|
-
icon:
|
|
11291
|
+
data: yd,
|
|
11292
|
+
icon: zd
|
|
11280
11293
|
},
|
|
11281
11294
|
{
|
|
11282
11295
|
title: "Object",
|
|
11283
|
-
data:
|
|
11284
|
-
icon:
|
|
11296
|
+
data: _d,
|
|
11297
|
+
icon: Md
|
|
11285
11298
|
},
|
|
11286
11299
|
{
|
|
11287
11300
|
title: "Symbol",
|
|
11288
|
-
data:
|
|
11289
|
-
icon:
|
|
11301
|
+
data: wd,
|
|
11302
|
+
icon: Id
|
|
11290
11303
|
},
|
|
11291
11304
|
{
|
|
11292
11305
|
title: "Flags",
|
|
11293
|
-
data:
|
|
11294
|
-
icon:
|
|
11306
|
+
data: kd,
|
|
11307
|
+
icon: Ld
|
|
11295
11308
|
}
|
|
11296
|
-
],
|
|
11297
|
-
function
|
|
11309
|
+
], Pd = ["😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣"];
|
|
11310
|
+
function Bd({ onSelectEmoji: e, children: t }) {
|
|
11298
11311
|
const [i, n] = w([]), { t: a } = D(), o = B(
|
|
11299
11312
|
() => i.length ? [{ title: "Frequently used", icon: ma, data: i }, ...Ji] : Ji,
|
|
11300
11313
|
[i]
|
|
@@ -11307,11 +11320,11 @@ function Od({ onSelectEmoji: e, children: t }) {
|
|
|
11307
11320
|
return E(() => {
|
|
11308
11321
|
Be.syncFromStorage();
|
|
11309
11322
|
const s = Be.get();
|
|
11310
|
-
s != null && s.length ||
|
|
11311
|
-
Be.put(
|
|
11323
|
+
s != null && s.length || Pd.forEach((d) => {
|
|
11324
|
+
Be.put(d);
|
|
11312
11325
|
});
|
|
11313
|
-
const
|
|
11314
|
-
n(
|
|
11326
|
+
const l = Be.get();
|
|
11327
|
+
n(l);
|
|
11315
11328
|
}, []), /* @__PURE__ */ m(se, { modal: !0, children: [
|
|
11316
11329
|
/* @__PURE__ */ r(le, { asChild: !0, children: t }),
|
|
11317
11330
|
/* @__PURE__ */ r(re, { hideWhenDetached: !0, className: "richtext-w-full richtext-h-full richtext-p-2", align: "start", side: "bottom", children: /* @__PURE__ */ m(wi, { defaultValue: "Frequently used", children: [
|
|
@@ -11330,14 +11343,14 @@ function Od({ onSelectEmoji: e, children: t }) {
|
|
|
11330
11343
|
value: s.title,
|
|
11331
11344
|
children: [
|
|
11332
11345
|
/* @__PURE__ */ r("p", { className: "richtext-mb-[6px] richtext-font-semibold", children: a(s.title) }),
|
|
11333
|
-
/* @__PURE__ */ r("div", { className: "richtext-max-h-[280px] richtext-overflow-y-auto", children: /* @__PURE__ */ r("div", { className: "richtext-grid richtext-grid-cols-8 richtext-gap-1 ", children: (s.data || []).map((
|
|
11346
|
+
/* @__PURE__ */ r("div", { className: "richtext-max-h-[280px] richtext-overflow-y-auto", children: /* @__PURE__ */ r("div", { className: "richtext-grid richtext-grid-cols-8 richtext-gap-1 ", children: (s.data || []).map((l) => /* @__PURE__ */ r(
|
|
11334
11347
|
"div",
|
|
11335
11348
|
{
|
|
11336
|
-
onClick: () => c(
|
|
11349
|
+
onClick: () => c(l),
|
|
11337
11350
|
className: "richtext-text-center richtext-cursor-pointer",
|
|
11338
|
-
children:
|
|
11351
|
+
children: l
|
|
11339
11352
|
},
|
|
11340
|
-
`emoji-picker-${
|
|
11353
|
+
`emoji-picker-${l}`
|
|
11341
11354
|
)) }) })
|
|
11342
11355
|
]
|
|
11343
11356
|
},
|
|
@@ -11346,7 +11359,7 @@ function Od({ onSelectEmoji: e, children: t }) {
|
|
|
11346
11359
|
] }) })
|
|
11347
11360
|
] });
|
|
11348
11361
|
}
|
|
11349
|
-
function
|
|
11362
|
+
function Dd({ editor: e, icon: t, ...i }) {
|
|
11350
11363
|
const n = A(
|
|
11351
11364
|
(a) => {
|
|
11352
11365
|
const { selection: o } = e.state, { $anchor: c } = o;
|
|
@@ -11354,7 +11367,7 @@ function Pd({ editor: e, icon: t, ...i }) {
|
|
|
11354
11367
|
},
|
|
11355
11368
|
[e]
|
|
11356
11369
|
);
|
|
11357
|
-
return /* @__PURE__ */ r(
|
|
11370
|
+
return /* @__PURE__ */ r(Bd, { onSelectEmoji: n, children: /* @__PURE__ */ r(
|
|
11358
11371
|
p,
|
|
11359
11372
|
{
|
|
11360
11373
|
tooltip: i == null ? void 0 : i.tooltip,
|
|
@@ -11362,10 +11375,10 @@ function Pd({ editor: e, icon: t, ...i }) {
|
|
|
11362
11375
|
}
|
|
11363
11376
|
) });
|
|
11364
11377
|
}
|
|
11365
|
-
const
|
|
11378
|
+
const $d = 200, jd = new _e("emoji"), Au = ue.create({
|
|
11366
11379
|
name: "emoji",
|
|
11367
11380
|
content: "text*",
|
|
11368
|
-
priority:
|
|
11381
|
+
priority: $d,
|
|
11369
11382
|
addOptions() {
|
|
11370
11383
|
var e;
|
|
11371
11384
|
return {
|
|
@@ -11373,13 +11386,13 @@ const Bd = 200, Dd = new _e("emoji"), Tu = ue.create({
|
|
|
11373
11386
|
HTMLAttributes: {},
|
|
11374
11387
|
suggestion: {
|
|
11375
11388
|
char: ":",
|
|
11376
|
-
pluginKey:
|
|
11389
|
+
pluginKey: jd,
|
|
11377
11390
|
command: ({ editor: t, range: i, props: n }) => {
|
|
11378
11391
|
t.chain().focus().insertContentAt(i, `${n.emoji} `).run();
|
|
11379
11392
|
}
|
|
11380
11393
|
},
|
|
11381
11394
|
button: ({ editor: t, t: i }) => ({
|
|
11382
|
-
component:
|
|
11395
|
+
component: Dd,
|
|
11383
11396
|
componentProps: {
|
|
11384
11397
|
editor: t,
|
|
11385
11398
|
action: () => {
|
|
@@ -11407,7 +11420,7 @@ const Bd = 200, Dd = new _e("emoji"), Tu = ue.create({
|
|
|
11407
11420
|
}
|
|
11408
11421
|
}).configure({
|
|
11409
11422
|
suggestion: {
|
|
11410
|
-
items: ({ query: e }) =>
|
|
11423
|
+
items: ({ query: e }) => bd(e),
|
|
11411
11424
|
render: () => {
|
|
11412
11425
|
let e, t, i;
|
|
11413
11426
|
return {
|
|
@@ -11442,25 +11455,25 @@ const Bd = 200, Dd = new _e("emoji"), Tu = ue.create({
|
|
|
11442
11455
|
}
|
|
11443
11456
|
}
|
|
11444
11457
|
});
|
|
11445
|
-
function
|
|
11458
|
+
function Fd({ editor: e, ...t }) {
|
|
11446
11459
|
const { t: i } = D(), n = ut(e, Fe.name, {
|
|
11447
11460
|
text: "",
|
|
11448
11461
|
defaultShowPicker: !1
|
|
11449
|
-
}), { text: a, defaultShowPicker: o } = n, [c, s] = w(""),
|
|
11462
|
+
}), { text: a, defaultShowPicker: o } = n, [c, s] = w(""), l = A(() => {
|
|
11450
11463
|
e.chain().focus().setKatex({ text: c }).run(), s("");
|
|
11451
11464
|
}, [e, c]);
|
|
11452
11465
|
E(() => {
|
|
11453
11466
|
o && e.chain().updateAttributes(Fe.name, { defaultShowPicker: !1 }).focus().run();
|
|
11454
11467
|
}, [e, o]);
|
|
11455
|
-
const
|
|
11468
|
+
const d = B(() => {
|
|
11456
11469
|
try {
|
|
11457
11470
|
return xi.renderToString(`${c}`);
|
|
11458
11471
|
} catch {
|
|
11459
11472
|
return c;
|
|
11460
11473
|
}
|
|
11461
11474
|
}, [c]), h = B(
|
|
11462
|
-
() => `${c}`.trim() ? /* @__PURE__ */ r("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html:
|
|
11463
|
-
[c,
|
|
11475
|
+
() => `${c}`.trim() ? /* @__PURE__ */ r("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html: d || "" } }) : null,
|
|
11476
|
+
[c, d]
|
|
11464
11477
|
);
|
|
11465
11478
|
return /* @__PURE__ */ m(se, { modal: !0, children: [
|
|
11466
11479
|
/* @__PURE__ */ r(le, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -11487,13 +11500,13 @@ function $d({ editor: e, ...t }) {
|
|
|
11487
11500
|
) }) }),
|
|
11488
11501
|
h && /* @__PURE__ */ r("div", { className: "richtext-my-[10px] richtext-p-[10px] richtext-rounded-[6px] !richtext-border-[1px] richtext-max-w-[286px] richtext-whitespace-nowrap richtext-overflow-auto", children: h }),
|
|
11489
11502
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
|
|
11490
|
-
/* @__PURE__ */ r(U, { onClick:
|
|
11503
|
+
/* @__PURE__ */ r(U, { onClick: l, className: "richtext-flex-1", children: "Submit" }),
|
|
11491
11504
|
/* @__PURE__ */ r("a", { href: "https://katex.org/docs/supported", target: "_blank", rel: "noreferrer noopener", children: /* @__PURE__ */ r(nn, { size: 16 }) })
|
|
11492
11505
|
] })
|
|
11493
11506
|
] })
|
|
11494
11507
|
] });
|
|
11495
11508
|
}
|
|
11496
|
-
function
|
|
11509
|
+
function Vd(e, t = 1) {
|
|
11497
11510
|
let i = 0, n = 0, a = 0;
|
|
11498
11511
|
if (e.startsWith("rgb")) {
|
|
11499
11512
|
const o = e.replace(/\s/g, "").match(/rgb\((.*)\)$/)[1].split(",");
|
|
@@ -11505,10 +11518,10 @@ function jd(e, t = 1) {
|
|
|
11505
11518
|
return e;
|
|
11506
11519
|
return t > 1 && t <= 100 && (t = t / 100), `rgba(${i},${n},${a},${t})`;
|
|
11507
11520
|
}
|
|
11508
|
-
function
|
|
11521
|
+
function Ud({ node: e }) {
|
|
11509
11522
|
const t = Gc(), { text: i } = e.attrs, n = B(() => {
|
|
11510
11523
|
const c = "rgb(254, 242, 237)";
|
|
11511
|
-
return t === "dark" ?
|
|
11524
|
+
return t === "dark" ? Vd(c, 0.75) : c;
|
|
11512
11525
|
}, [t]), a = B(() => {
|
|
11513
11526
|
try {
|
|
11514
11527
|
return xi.renderToString(`${i}`);
|
|
@@ -11531,7 +11544,7 @@ function Fd({ node: e }) {
|
|
|
11531
11544
|
}
|
|
11532
11545
|
);
|
|
11533
11546
|
}
|
|
11534
|
-
function
|
|
11547
|
+
function Wd(e) {
|
|
11535
11548
|
return (t) => t.getAttribute(e);
|
|
11536
11549
|
}
|
|
11537
11550
|
const Fe = ue.create({
|
|
@@ -11547,7 +11560,7 @@ const Fe = ue.create({
|
|
|
11547
11560
|
class: "katex"
|
|
11548
11561
|
},
|
|
11549
11562
|
button: ({ editor: e, t }) => ({
|
|
11550
|
-
component:
|
|
11563
|
+
component: Fd,
|
|
11551
11564
|
componentProps: {
|
|
11552
11565
|
editor: e,
|
|
11553
11566
|
action: () => {
|
|
@@ -11564,7 +11577,7 @@ const Fe = ue.create({
|
|
|
11564
11577
|
return {
|
|
11565
11578
|
text: {
|
|
11566
11579
|
default: "",
|
|
11567
|
-
parseHTML:
|
|
11580
|
+
parseHTML: Wd("text")
|
|
11568
11581
|
},
|
|
11569
11582
|
defaultShowPicker: {
|
|
11570
11583
|
default: !1
|
|
@@ -11595,10 +11608,10 @@ const Fe = ue.create({
|
|
|
11595
11608
|
];
|
|
11596
11609
|
},
|
|
11597
11610
|
addNodeView() {
|
|
11598
|
-
return ge(
|
|
11611
|
+
return ge(Ud);
|
|
11599
11612
|
}
|
|
11600
11613
|
});
|
|
11601
|
-
function
|
|
11614
|
+
function qd(e) {
|
|
11602
11615
|
const t = document.createElement("iframe");
|
|
11603
11616
|
t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
|
|
11604
11617
|
<!DOCTYPE html>
|
|
@@ -11635,11 +11648,11 @@ function Ud(e) {
|
|
|
11635
11648
|
}, 100);
|
|
11636
11649
|
});
|
|
11637
11650
|
}
|
|
11638
|
-
function
|
|
11651
|
+
function Gd(e) {
|
|
11639
11652
|
const t = e.getHTML();
|
|
11640
|
-
return t ? (
|
|
11653
|
+
return t ? (qd(t), !0) : !1;
|
|
11641
11654
|
}
|
|
11642
|
-
const
|
|
11655
|
+
const Lu = Y.create({
|
|
11643
11656
|
name: "exportPdf",
|
|
11644
11657
|
addOptions() {
|
|
11645
11658
|
var e;
|
|
@@ -11649,7 +11662,7 @@ const Au = Y.create({
|
|
|
11649
11662
|
component: p,
|
|
11650
11663
|
componentProps: {
|
|
11651
11664
|
action: () => {
|
|
11652
|
-
|
|
11665
|
+
Gd(t);
|
|
11653
11666
|
},
|
|
11654
11667
|
icon: "ExportPdf",
|
|
11655
11668
|
tooltip: i("editor.exportPdf.tooltip"),
|
|
@@ -11660,26 +11673,26 @@ const Au = Y.create({
|
|
|
11660
11673
|
};
|
|
11661
11674
|
}
|
|
11662
11675
|
});
|
|
11663
|
-
function
|
|
11676
|
+
function Kd(e, t) {
|
|
11664
11677
|
const i = atob(e.split(",")[1]), n = Array.from({ length: i.length });
|
|
11665
11678
|
for (let o = 0; o < i.length; o++)
|
|
11666
11679
|
n[o] = i.charCodeAt(o);
|
|
11667
11680
|
const a = new Uint8Array(n);
|
|
11668
11681
|
return new Blob([a], { type: t });
|
|
11669
11682
|
}
|
|
11670
|
-
function
|
|
11683
|
+
function Xd(e, t) {
|
|
11671
11684
|
return new File([e], t, { type: e.type });
|
|
11672
11685
|
}
|
|
11673
|
-
function
|
|
11686
|
+
function Zd(e) {
|
|
11674
11687
|
const [t, i] = w(!1), [n, a] = w(), o = J();
|
|
11675
11688
|
function c() {
|
|
11676
11689
|
o.current.click();
|
|
11677
11690
|
}
|
|
11678
11691
|
function s(u) {
|
|
11679
11692
|
const f = u.target.files[0];
|
|
11680
|
-
a(f), f &&
|
|
11693
|
+
a(f), f && d();
|
|
11681
11694
|
}
|
|
11682
|
-
async function
|
|
11695
|
+
async function l(u) {
|
|
11683
11696
|
var C;
|
|
11684
11697
|
const g = new DOMParser().parseFromString(u, "text/html"), x = g.querySelectorAll("img");
|
|
11685
11698
|
if (!x.length)
|
|
@@ -11691,7 +11704,7 @@ function Kd(e) {
|
|
|
11691
11704
|
if (T && typeof T.upload == "function") {
|
|
11692
11705
|
const v = [];
|
|
11693
11706
|
for (const k of x) {
|
|
11694
|
-
const N = k.getAttribute("src"), I =
|
|
11707
|
+
const N = k.getAttribute("src"), I = Kd(N, "image/jpeg"), O = Xd(I, "image.jpeg");
|
|
11695
11708
|
v.push(O);
|
|
11696
11709
|
}
|
|
11697
11710
|
const _ = await T.upload(v);
|
|
@@ -11707,7 +11720,7 @@ function Kd(e) {
|
|
|
11707
11720
|
} else
|
|
11708
11721
|
return console.error("Image extension not found, unable to convert image"), g.body.innerHTML;
|
|
11709
11722
|
}
|
|
11710
|
-
async function
|
|
11723
|
+
async function d() {
|
|
11711
11724
|
if (e.convert) {
|
|
11712
11725
|
const u = await e.convert(n);
|
|
11713
11726
|
h(u);
|
|
@@ -11736,7 +11749,7 @@ function Kd(e) {
|
|
|
11736
11749
|
}
|
|
11737
11750
|
}
|
|
11738
11751
|
async function h(u) {
|
|
11739
|
-
const f = await
|
|
11752
|
+
const f = await l(u);
|
|
11740
11753
|
e.editor.chain().setContent(f, !0).run(), i(!1);
|
|
11741
11754
|
}
|
|
11742
11755
|
return /* @__PURE__ */ m("div", { children: [
|
|
@@ -11755,7 +11768,7 @@ function Kd(e) {
|
|
|
11755
11768
|
)
|
|
11756
11769
|
] });
|
|
11757
11770
|
}
|
|
11758
|
-
const
|
|
11771
|
+
const Su = Y.create({
|
|
11759
11772
|
name: "importWord",
|
|
11760
11773
|
addOptions() {
|
|
11761
11774
|
var e;
|
|
@@ -11766,7 +11779,7 @@ const Lu = Y.create({
|
|
|
11766
11779
|
button: ({ editor: t, extension: i, t: n }) => {
|
|
11767
11780
|
const { convert: a } = i.options;
|
|
11768
11781
|
return {
|
|
11769
|
-
component:
|
|
11782
|
+
component: Zd,
|
|
11770
11783
|
componentProps: {
|
|
11771
11784
|
convert: a,
|
|
11772
11785
|
action: () => t.commands.setHorizontalRule(),
|
|
@@ -11779,15 +11792,15 @@ const Lu = Y.create({
|
|
|
11779
11792
|
}
|
|
11780
11793
|
};
|
|
11781
11794
|
}
|
|
11782
|
-
}),
|
|
11783
|
-
function
|
|
11784
|
-
if (
|
|
11795
|
+
}), Yd = typeof window < "u";
|
|
11796
|
+
function Jd(e, t) {
|
|
11797
|
+
if (Yd) {
|
|
11785
11798
|
const i = window.URL.createObjectURL(e), n = document.createElement("a");
|
|
11786
11799
|
return n.href = i, n.download = t, n.click(), window.URL.revokeObjectURL(i), Promise.resolve();
|
|
11787
11800
|
}
|
|
11788
11801
|
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
11789
11802
|
}
|
|
11790
|
-
const
|
|
11803
|
+
const Qd = {
|
|
11791
11804
|
...Ne,
|
|
11792
11805
|
hardBreak: Ne.hard_break,
|
|
11793
11806
|
codeBlock: Ne.code_block,
|
|
@@ -11799,7 +11812,7 @@ const Yd = {
|
|
|
11799
11812
|
image(e, t) {
|
|
11800
11813
|
e.renderInline(t), e.closeBlock(t);
|
|
11801
11814
|
}
|
|
11802
|
-
},
|
|
11815
|
+
}, eh = new Lo(Qd, So), Mu = Y.create({
|
|
11803
11816
|
name: "exportWord",
|
|
11804
11817
|
addOptions() {
|
|
11805
11818
|
var e;
|
|
@@ -11828,22 +11841,22 @@ const Yd = {
|
|
|
11828
11841
|
const o = await (await fetch(n)).arrayBuffer();
|
|
11829
11842
|
return new Uint8Array(o);
|
|
11830
11843
|
}
|
|
11831
|
-
}, i =
|
|
11832
|
-
return Mo.toBlob(i).then((n) =>
|
|
11844
|
+
}, i = eh.serialize(e.state.doc, t);
|
|
11845
|
+
return Mo.toBlob(i).then((n) => Jd(new Blob([n]), "export-document.docx")), !0;
|
|
11833
11846
|
}
|
|
11834
11847
|
};
|
|
11835
11848
|
}
|
|
11836
|
-
}),
|
|
11837
|
-
toc:
|
|
11838
|
-
visible:
|
|
11839
|
-
list:
|
|
11840
|
-
item:
|
|
11849
|
+
}), th = "_toc_aag8a_1", ih = "_visible_aag8a_7", nh = "_list_aag8a_11", rh = "_item_aag8a_16", _t = {
|
|
11850
|
+
toc: th,
|
|
11851
|
+
visible: ih,
|
|
11852
|
+
list: nh,
|
|
11853
|
+
item: rh,
|
|
11841
11854
|
"item--3": "_item--3_aag8a_19",
|
|
11842
11855
|
"item--4": "_item--4_aag8a_22",
|
|
11843
11856
|
"item--5": "_item--5_aag8a_25",
|
|
11844
11857
|
"item--6": "_item--6_aag8a_28"
|
|
11845
11858
|
};
|
|
11846
|
-
function
|
|
11859
|
+
function ah(e) {
|
|
11847
11860
|
const t = [], i = [t];
|
|
11848
11861
|
return e.forEach((n) => {
|
|
11849
11862
|
let a = -1, o = i[n.level + a];
|
|
@@ -11852,22 +11865,22 @@ function nh(e) {
|
|
|
11852
11865
|
o.push({ ...n, children: i[n.level] = [] });
|
|
11853
11866
|
}), t;
|
|
11854
11867
|
}
|
|
11855
|
-
function
|
|
11868
|
+
function oh({ editor: e }) {
|
|
11856
11869
|
const t = Bt(), [i, n] = w([]), { t: a } = D(), o = A(() => {
|
|
11857
11870
|
const c = [], s = e.state.tr;
|
|
11858
|
-
e.state.doc.descendants((
|
|
11859
|
-
if (
|
|
11871
|
+
e.state.doc.descendants((l, d) => {
|
|
11872
|
+
if (l.type.name === "heading") {
|
|
11860
11873
|
const h = `heading-${c.length + 1}`;
|
|
11861
|
-
|
|
11862
|
-
...
|
|
11874
|
+
l.attrs.id !== h && s.setNodeMarkup(d, void 0, {
|
|
11875
|
+
...l.attrs,
|
|
11863
11876
|
id: h
|
|
11864
11877
|
}), c.push({
|
|
11865
|
-
level:
|
|
11866
|
-
text:
|
|
11878
|
+
level: l.attrs.level,
|
|
11879
|
+
text: l.textContent,
|
|
11867
11880
|
id: h
|
|
11868
11881
|
});
|
|
11869
11882
|
}
|
|
11870
|
-
}), s.setMeta("addToHistory", !1), s.setMeta("preventUpdate", !0), e.view.dispatch(s), n(c), e.eventEmitter && e.eventEmitter.emit("TableOfContents",
|
|
11883
|
+
}), s.setMeta("addToHistory", !1), s.setMeta("preventUpdate", !0), e.view.dispatch(s), n(c), e.eventEmitter && e.eventEmitter.emit("TableOfContents", ah(c));
|
|
11871
11884
|
}, [e]);
|
|
11872
11885
|
return E(() => {
|
|
11873
11886
|
if (e) {
|
|
@@ -11886,10 +11899,10 @@ function rh({ editor: e }) {
|
|
|
11886
11899
|
/* @__PURE__ */ r("ul", { className: _t.list, children: i.map((c, s) => /* @__PURE__ */ r("li", { className: _t.item, style: { paddingLeft: `${c.level - 1}rem` }, children: /* @__PURE__ */ r("a", { href: `#${c.id}`, children: c.text }) }, `table-of-content-${s}`)) })
|
|
11887
11900
|
] }) : null });
|
|
11888
11901
|
}
|
|
11889
|
-
function
|
|
11902
|
+
function ch(e) {
|
|
11890
11903
|
return e && e.type.name === "title";
|
|
11891
11904
|
}
|
|
11892
|
-
function
|
|
11905
|
+
function sh(e, t) {
|
|
11893
11906
|
const n = [e.getJSON()], a = [];
|
|
11894
11907
|
for (; n.length; ) {
|
|
11895
11908
|
const o = n.shift();
|
|
@@ -11897,7 +11910,7 @@ function oh(e, t) {
|
|
|
11897
11910
|
}
|
|
11898
11911
|
return a;
|
|
11899
11912
|
}
|
|
11900
|
-
function
|
|
11913
|
+
function lh(e, ...t) {
|
|
11901
11914
|
const [i, n] = w(!1);
|
|
11902
11915
|
return E(() => {
|
|
11903
11916
|
const a = () => {
|
|
@@ -11908,8 +11921,8 @@ function ch(e, ...t) {
|
|
|
11908
11921
|
};
|
|
11909
11922
|
}, [e, t, n]), i;
|
|
11910
11923
|
}
|
|
11911
|
-
function
|
|
11912
|
-
const n =
|
|
11924
|
+
function dh({ editor: e, icon: t, tooltip: i }) {
|
|
11925
|
+
const n = lh(e, hh.name), a = A(() => {
|
|
11913
11926
|
if (n) {
|
|
11914
11927
|
e.chain().focus().removeTableOfContents().run();
|
|
11915
11928
|
return;
|
|
@@ -11926,7 +11939,7 @@ function sh({ editor: e, icon: t, tooltip: i }) {
|
|
|
11926
11939
|
}
|
|
11927
11940
|
);
|
|
11928
11941
|
}
|
|
11929
|
-
const
|
|
11942
|
+
const hh = ue.create({
|
|
11930
11943
|
name: "tableOfContents",
|
|
11931
11944
|
group: "block",
|
|
11932
11945
|
atom: !0,
|
|
@@ -11940,7 +11953,7 @@ const lh = ue.create({
|
|
|
11940
11953
|
lastColumnResizable: !0,
|
|
11941
11954
|
allowTableNodeSelection: !1,
|
|
11942
11955
|
button: ({ editor: t, t: i }) => ({
|
|
11943
|
-
component:
|
|
11956
|
+
component: dh,
|
|
11944
11957
|
componentProps: {
|
|
11945
11958
|
disabled: !1,
|
|
11946
11959
|
icon: "BookMarked",
|
|
@@ -11961,18 +11974,18 @@ const lh = ue.create({
|
|
|
11961
11974
|
return ["toc", ne(e)];
|
|
11962
11975
|
},
|
|
11963
11976
|
addNodeView() {
|
|
11964
|
-
return ge(
|
|
11977
|
+
return ge(oh);
|
|
11965
11978
|
},
|
|
11966
11979
|
// @ts-expect-error
|
|
11967
11980
|
addCommands() {
|
|
11968
11981
|
return {
|
|
11969
11982
|
setTableOfContents: () => ({ commands: e, editor: t, view: i }) => {
|
|
11970
|
-
if (
|
|
11983
|
+
if (sh(t, this.name).length) {
|
|
11971
11984
|
this.options.onHasOneBeforeInsert();
|
|
11972
11985
|
return;
|
|
11973
11986
|
}
|
|
11974
11987
|
const a = i.props.state.doc.content.firstChild;
|
|
11975
|
-
if (
|
|
11988
|
+
if (ch(a)) {
|
|
11976
11989
|
const o = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
|
|
11977
11990
|
return e.insertContentAt(o, { type: this.name });
|
|
11978
11991
|
}
|
|
@@ -12004,7 +12017,7 @@ const lh = ue.create({
|
|
|
12004
12017
|
];
|
|
12005
12018
|
}
|
|
12006
12019
|
});
|
|
12007
|
-
function
|
|
12020
|
+
function uh(e) {
|
|
12008
12021
|
var i;
|
|
12009
12022
|
const t = B(() => {
|
|
12010
12023
|
var o;
|
|
@@ -12059,7 +12072,7 @@ function dh(e) {
|
|
|
12059
12072
|
)
|
|
12060
12073
|
] });
|
|
12061
12074
|
}
|
|
12062
|
-
const
|
|
12075
|
+
const Iu = Y.create({
|
|
12063
12076
|
name: "text-direction",
|
|
12064
12077
|
addOptions() {
|
|
12065
12078
|
var e;
|
|
@@ -12073,27 +12086,27 @@ const Mu = Y.create({
|
|
|
12073
12086
|
extension: i,
|
|
12074
12087
|
t: n
|
|
12075
12088
|
}) {
|
|
12076
|
-
var
|
|
12077
|
-
const a = ((
|
|
12089
|
+
var l;
|
|
12090
|
+
const a = ((l = i.options) == null ? void 0 : l.directions) || [], o = {
|
|
12078
12091
|
auto: "TextDirection",
|
|
12079
12092
|
ltr: "LeftToRight",
|
|
12080
12093
|
rtl: "RightToLeft"
|
|
12081
|
-
}, c = a.map((
|
|
12082
|
-
title: n(`editor.textDirection.${
|
|
12083
|
-
icon: o[
|
|
12094
|
+
}, c = a.map((d) => ({
|
|
12095
|
+
title: n(`editor.textDirection.${d}.tooltip`),
|
|
12096
|
+
icon: o[d],
|
|
12084
12097
|
isActive: () => !1,
|
|
12085
12098
|
action: () => {
|
|
12086
12099
|
var h, u, f, g;
|
|
12087
|
-
if (
|
|
12100
|
+
if (d === "auto") {
|
|
12088
12101
|
(u = (h = t.commands) == null ? void 0 : h.unsetTextDirection) == null || u.call(h);
|
|
12089
12102
|
return;
|
|
12090
12103
|
}
|
|
12091
|
-
(g = (f = t.commands) == null ? void 0 : f.setTextDirection) == null || g.call(f,
|
|
12104
|
+
(g = (f = t.commands) == null ? void 0 : f.setTextDirection) == null || g.call(f, d);
|
|
12092
12105
|
},
|
|
12093
12106
|
disabled: !1
|
|
12094
|
-
})), s = c.filter((
|
|
12107
|
+
})), s = c.filter((d) => d.disabled).length === c.length;
|
|
12095
12108
|
return {
|
|
12096
|
-
component:
|
|
12109
|
+
component: uh,
|
|
12097
12110
|
componentProps: {
|
|
12098
12111
|
icon: "TextDirection",
|
|
12099
12112
|
tooltip: n("editor.textDirection.tooltip"),
|
|
@@ -12125,38 +12138,38 @@ const Mu = Y.create({
|
|
|
12125
12138
|
unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
|
|
12126
12139
|
};
|
|
12127
12140
|
}
|
|
12128
|
-
}),
|
|
12129
|
-
listUsers:
|
|
12130
|
-
itemUser:
|
|
12131
|
-
selectedUser:
|
|
12132
|
-
},
|
|
12133
|
-
const i = J(), [n, a] = w(0), o = (
|
|
12134
|
-
const h = e.items[
|
|
12141
|
+
}), mh = "_listUsers_en3pm_1", fh = "_itemUser_en3pm_10", gh = "_selectedUser_en3pm_31", vt = {
|
|
12142
|
+
listUsers: mh,
|
|
12143
|
+
itemUser: fh,
|
|
12144
|
+
selectedUser: gh
|
|
12145
|
+
}, xh = Lt((e, t) => {
|
|
12146
|
+
const i = J(), [n, a] = w(0), o = (d) => {
|
|
12147
|
+
const h = e.items[d];
|
|
12135
12148
|
h && e.command({ id: h, label: h });
|
|
12136
12149
|
}, c = () => {
|
|
12137
12150
|
a((n + e.items.length - 1) % e.items.length);
|
|
12138
12151
|
}, s = () => {
|
|
12139
12152
|
a((n + 1) % e.items.length);
|
|
12140
|
-
},
|
|
12153
|
+
}, l = () => {
|
|
12141
12154
|
o(n);
|
|
12142
12155
|
};
|
|
12143
12156
|
return E(() => a(0), [e.items]), E(() => {
|
|
12144
12157
|
if (Number.isNaN(n + 1))
|
|
12145
12158
|
return;
|
|
12146
|
-
const
|
|
12147
|
-
|
|
12159
|
+
const d = i.current.querySelector(`span:nth-of-type(${n + 1})`);
|
|
12160
|
+
d && gi(d, { behavior: "smooth", scrollMode: "if-needed" });
|
|
12148
12161
|
}, [n]), St(t, () => ({
|
|
12149
|
-
onKeyDown: ({ event:
|
|
12150
|
-
})), /* @__PURE__ */ r("div", { className: ee("listUsers", vt.listUsers), children: /* @__PURE__ */ r("div", { ref: i, children: e.items.length ? e.items.map((
|
|
12162
|
+
onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (c(), !0) : d.key === "ArrowDown" ? (s(), !0) : d.key === "Enter" ? (l(), !0) : !1
|
|
12163
|
+
})), /* @__PURE__ */ r("div", { className: ee("listUsers", vt.listUsers), children: /* @__PURE__ */ r("div", { ref: i, children: e.items.length ? e.items.map((d, h) => /* @__PURE__ */ r(
|
|
12151
12164
|
"span",
|
|
12152
12165
|
{
|
|
12153
12166
|
className: ee("itemUser", vt.itemUser, h === n ? vt.selectedUser : ""),
|
|
12154
12167
|
onClick: () => o(h),
|
|
12155
|
-
children:
|
|
12168
|
+
children: d
|
|
12156
12169
|
},
|
|
12157
12170
|
h
|
|
12158
12171
|
)) : /* @__PURE__ */ r("div", { className: ee("itemUserEmpty", vt.itemUser), children: "Empty" }) }) });
|
|
12159
|
-
}),
|
|
12172
|
+
}), bh = [
|
|
12160
12173
|
{
|
|
12161
12174
|
id: "1",
|
|
12162
12175
|
name: "John Doe"
|
|
@@ -12173,13 +12186,13 @@ const Mu = Y.create({
|
|
|
12173
12186
|
id: "4",
|
|
12174
12187
|
name: "Bob"
|
|
12175
12188
|
}
|
|
12176
|
-
],
|
|
12177
|
-
items: async ({ query: e }) =>
|
|
12189
|
+
], ph = {
|
|
12190
|
+
items: async ({ query: e }) => bh.map((i) => i.name).filter((i) => i.toLowerCase().startsWith(e.toLowerCase())),
|
|
12178
12191
|
render: () => {
|
|
12179
12192
|
let e, t;
|
|
12180
12193
|
return {
|
|
12181
12194
|
onStart: (i) => {
|
|
12182
|
-
e = new ci(
|
|
12195
|
+
e = new ci(xh, {
|
|
12183
12196
|
props: i,
|
|
12184
12197
|
editor: i.editor
|
|
12185
12198
|
}), t = fi("body", {
|
|
@@ -12206,7 +12219,7 @@ const Mu = Y.create({
|
|
|
12206
12219
|
}
|
|
12207
12220
|
};
|
|
12208
12221
|
}
|
|
12209
|
-
},
|
|
12222
|
+
}, zu = ho.extend({
|
|
12210
12223
|
addAttributes() {
|
|
12211
12224
|
return {
|
|
12212
12225
|
id: {
|
|
@@ -12223,9 +12236,9 @@ const Mu = Y.create({
|
|
|
12223
12236
|
HTMLAttributes: {
|
|
12224
12237
|
class: "mention"
|
|
12225
12238
|
},
|
|
12226
|
-
suggestion:
|
|
12239
|
+
suggestion: ph
|
|
12227
12240
|
});
|
|
12228
|
-
function
|
|
12241
|
+
function wh(e) {
|
|
12229
12242
|
switch (Ic(e)) {
|
|
12230
12243
|
case "audio":
|
|
12231
12244
|
return /* @__PURE__ */ r(_a, {});
|
|
@@ -12247,12 +12260,12 @@ function bh(e) {
|
|
|
12247
12260
|
return /* @__PURE__ */ r(q, {});
|
|
12248
12261
|
}
|
|
12249
12262
|
}
|
|
12250
|
-
const
|
|
12251
|
-
wrap:
|
|
12263
|
+
const _h = "_wrap_gpqtf_1", qt = {
|
|
12264
|
+
wrap: _h
|
|
12252
12265
|
};
|
|
12253
|
-
function
|
|
12266
|
+
function vh({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension: a }) {
|
|
12254
12267
|
var N;
|
|
12255
|
-
const o = J(), c = Bt(), { hasTrigger: s, fileName:
|
|
12268
|
+
const o = J(), c = Bt(), { hasTrigger: s, fileName: l, fileSize: d, fileExt: h, fileType: u, url: f, error: g } = t.attrs, [x, b] = w(!1), { t: C } = D(), T = (N = a == null ? void 0 : a.options) == null ? void 0 : N.upload, v = A(() => {
|
|
12256
12269
|
!c || f || c && o.current.click();
|
|
12257
12270
|
}, [c, f]), _ = A(
|
|
12258
12271
|
async (I) => {
|
|
@@ -12284,15 +12297,15 @@ function wh({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
12284
12297
|
/* @__PURE__ */ r("input", { ref: o, type: "file", hidden: !0, onChange: _ })
|
|
12285
12298
|
] }) }) : f ? /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ m("div", { className: ee(qt.wrap, "render-wrapper"), onClick: v, children: [
|
|
12286
12299
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
12287
|
-
/* @__PURE__ */ r("span", { children:
|
|
12300
|
+
/* @__PURE__ */ r("span", { children: wh(u) }),
|
|
12288
12301
|
/* @__PURE__ */ m("span", { children: [
|
|
12289
|
-
|
|
12302
|
+
l,
|
|
12290
12303
|
".",
|
|
12291
12304
|
h
|
|
12292
12305
|
] }),
|
|
12293
12306
|
/* @__PURE__ */ m("span", { children: [
|
|
12294
12307
|
"(",
|
|
12295
|
-
Mc(
|
|
12308
|
+
Mc(d),
|
|
12296
12309
|
")"
|
|
12297
12310
|
] })
|
|
12298
12311
|
] }),
|
|
@@ -12306,7 +12319,7 @@ function wh({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
12306
12319
|
)
|
|
12307
12320
|
] }) }) : g !== "null" ? /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r("div", { className: ee(qt.wrap, "render-wrapper"), onClick: v, children: /* @__PURE__ */ r("p", { children: g }) }) }) : /* @__PURE__ */ r(q, {});
|
|
12308
12321
|
}
|
|
12309
|
-
const
|
|
12322
|
+
const Hu = ue.create({
|
|
12310
12323
|
name: "attachment",
|
|
12311
12324
|
content: "",
|
|
12312
12325
|
marks: "",
|
|
@@ -12377,7 +12390,7 @@ const zu = ue.create({
|
|
|
12377
12390
|
};
|
|
12378
12391
|
},
|
|
12379
12392
|
addNodeView() {
|
|
12380
|
-
return ge(
|
|
12393
|
+
return ge(vh);
|
|
12381
12394
|
}
|
|
12382
12395
|
}), yt = {
|
|
12383
12396
|
TOP_LEFT: "tl",
|
|
@@ -12385,7 +12398,7 @@ const zu = ue.create({
|
|
|
12385
12398
|
BOTTOM_LEFT: "bl",
|
|
12386
12399
|
BOTTOM_RIGHT: "br"
|
|
12387
12400
|
};
|
|
12388
|
-
function
|
|
12401
|
+
function yh(e) {
|
|
12389
12402
|
var I, O;
|
|
12390
12403
|
const [t, i] = w({
|
|
12391
12404
|
width: Ge,
|
|
@@ -12398,7 +12411,7 @@ function _h(e) {
|
|
|
12398
12411
|
yt.TOP_RIGHT,
|
|
12399
12412
|
yt.BOTTOM_LEFT,
|
|
12400
12413
|
yt.BOTTOM_RIGHT
|
|
12401
|
-
]), [c, s] = w(!1), [
|
|
12414
|
+
]), [c, s] = w(!1), [l, d] = w({
|
|
12402
12415
|
x: 0,
|
|
12403
12416
|
y: 0,
|
|
12404
12417
|
w: 0,
|
|
@@ -12447,7 +12460,7 @@ function _h(e) {
|
|
|
12447
12460
|
let R = Number(e.node.attrs.width), H = Number(e.node.attrs.height);
|
|
12448
12461
|
const z = t.width;
|
|
12449
12462
|
R && !H ? (R = R > z ? z : R, H = Math.round(R / $)) : H && !R ? (R = Math.round(H * $), R = R > z ? z : R) : !R && !H ? (R = S > z ? z : S, H = Math.round(R / $)) : R = R > z ? z : R, Xe(() => {
|
|
12450
|
-
s(!0),
|
|
12463
|
+
s(!0), d({
|
|
12451
12464
|
x: M.clientX,
|
|
12452
12465
|
y: M.clientY,
|
|
12453
12466
|
w: R,
|
|
@@ -12460,17 +12473,17 @@ function _h(e) {
|
|
|
12460
12473
|
Se((M) => {
|
|
12461
12474
|
if (M.preventDefault(), M.stopPropagation(), !c)
|
|
12462
12475
|
return;
|
|
12463
|
-
const { x: L, w: S, dir: y } =
|
|
12476
|
+
const { x: L, w: S, dir: y } = l, $ = (M.clientX - L) * (/l/.test(y) ? -1 : 1), R = mn(S + $, ui, t.width);
|
|
12464
12477
|
e.updateAttributes({
|
|
12465
12478
|
width: R,
|
|
12466
12479
|
height: null
|
|
12467
12480
|
});
|
|
12468
12481
|
}, Ke),
|
|
12469
|
-
[c,
|
|
12482
|
+
[c, l, t, e.updateAttributes]
|
|
12470
12483
|
), v = A(
|
|
12471
12484
|
(M) => {
|
|
12472
12485
|
M.preventDefault(), M.stopPropagation(), c && (Xe(() => {
|
|
12473
|
-
|
|
12486
|
+
d({
|
|
12474
12487
|
x: 0,
|
|
12475
12488
|
y: 0,
|
|
12476
12489
|
w: 0,
|
|
@@ -12523,11 +12536,11 @@ function _h(e) {
|
|
|
12523
12536
|
}
|
|
12524
12537
|
) });
|
|
12525
12538
|
}
|
|
12526
|
-
function
|
|
12527
|
-
const [n, a] = w([]), [o] = w(15), c = J(null), s = (
|
|
12539
|
+
function kh({ selectImage: e, giphyApiKey: t, children: i }) {
|
|
12540
|
+
const [n, a] = w([]), [o] = w(15), c = J(null), s = (d, h = "search") => {
|
|
12528
12541
|
if (!t)
|
|
12529
12542
|
return;
|
|
12530
|
-
const f = `${h === "search" ? `https://api.giphy.com/v1/gifs/search?q=${
|
|
12543
|
+
const f = `${h === "search" ? `https://api.giphy.com/v1/gifs/search?q=${d}` : `https://api.giphy.com/v1/gifs/trending?q=${d}`}&limit=${o}&api_key=${t}`;
|
|
12531
12544
|
fetch(f).then((g) => g.json()).then((g) => {
|
|
12532
12545
|
a(g.data);
|
|
12533
12546
|
}).catch((g) => {
|
|
@@ -12537,13 +12550,13 @@ function vh({ selectImage: e, giphyApiKey: t, children: i }) {
|
|
|
12537
12550
|
E(() => {
|
|
12538
12551
|
s("", "trend");
|
|
12539
12552
|
}, []);
|
|
12540
|
-
const
|
|
12541
|
-
hi((
|
|
12542
|
-
if (!
|
|
12553
|
+
const l = A(
|
|
12554
|
+
hi((d) => {
|
|
12555
|
+
if (!d.target.value) {
|
|
12543
12556
|
s("", "trend");
|
|
12544
12557
|
return;
|
|
12545
12558
|
}
|
|
12546
|
-
s(
|
|
12559
|
+
s(d.target.value);
|
|
12547
12560
|
}, 350),
|
|
12548
12561
|
// Adjust the debounce delay as needed
|
|
12549
12562
|
[]
|
|
@@ -12557,27 +12570,27 @@ function vh({ selectImage: e, giphyApiKey: t, children: i }) {
|
|
|
12557
12570
|
ref: c,
|
|
12558
12571
|
type: "text",
|
|
12559
12572
|
placeholder: "Search GIF",
|
|
12560
|
-
onChange:
|
|
12573
|
+
onChange: l
|
|
12561
12574
|
}
|
|
12562
12575
|
) }),
|
|
12563
|
-
/* @__PURE__ */ r("div", { className: "richtext-max-h-[280px] richtext-overflow-y-auto", children: /* @__PURE__ */ r("div", { className: "richtext-grid richtext-grid-cols-2 richtext-gap-1 ", children: n != null && n.length ? n == null ? void 0 : n.map((
|
|
12576
|
+
/* @__PURE__ */ r("div", { className: "richtext-max-h-[280px] richtext-overflow-y-auto", children: /* @__PURE__ */ r("div", { className: "richtext-grid richtext-grid-cols-2 richtext-gap-1 ", children: n != null && n.length ? n == null ? void 0 : n.map((d) => /* @__PURE__ */ r(
|
|
12564
12577
|
"img",
|
|
12565
12578
|
{
|
|
12566
12579
|
alt: "giphy",
|
|
12567
12580
|
className: "richtext-text-center richtext-cursor-pointer",
|
|
12568
|
-
onClick: (h) => e(
|
|
12569
|
-
height:
|
|
12570
|
-
width:
|
|
12571
|
-
src:
|
|
12581
|
+
onClick: (h) => e(d),
|
|
12582
|
+
height: d.images.fixed_width_downsampled.height,
|
|
12583
|
+
width: d.images.fixed_width_downsampled.width,
|
|
12584
|
+
src: d.images.fixed_width_downsampled.url
|
|
12572
12585
|
},
|
|
12573
|
-
`giphy-${
|
|
12586
|
+
`giphy-${d.id}`
|
|
12574
12587
|
)) : /* @__PURE__ */ r("p", { children: "No GIFs found" }) }) })
|
|
12575
12588
|
] }) : /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children: "Missing Giphy API Key" }) }) })
|
|
12576
12589
|
] });
|
|
12577
12590
|
}
|
|
12578
|
-
function
|
|
12591
|
+
function Ch({ editor: e, icon: t, giphyApiKey: i, ...n }) {
|
|
12579
12592
|
return /* @__PURE__ */ r(
|
|
12580
|
-
|
|
12593
|
+
kh,
|
|
12581
12594
|
{
|
|
12582
12595
|
selectImage: (o) => {
|
|
12583
12596
|
const { url: c } = o.images.original;
|
|
@@ -12612,7 +12625,7 @@ const Jn = si.extend({
|
|
|
12612
12625
|
var o;
|
|
12613
12626
|
const a = ((o = i == null ? void 0 : i.options) == null ? void 0 : o.GIPHY_API_KEY) || "";
|
|
12614
12627
|
return {
|
|
12615
|
-
component:
|
|
12628
|
+
component: Ch,
|
|
12616
12629
|
componentProps: {
|
|
12617
12630
|
editor: t,
|
|
12618
12631
|
action: () => {
|
|
@@ -12651,7 +12664,7 @@ const Jn = si.extend({
|
|
|
12651
12664
|
};
|
|
12652
12665
|
},
|
|
12653
12666
|
addNodeView() {
|
|
12654
|
-
return ge(
|
|
12667
|
+
return ge(yh);
|
|
12655
12668
|
},
|
|
12656
12669
|
addCommands() {
|
|
12657
12670
|
var e;
|
|
@@ -12705,8 +12718,8 @@ const Jn = si.extend({
|
|
|
12705
12718
|
];
|
|
12706
12719
|
}
|
|
12707
12720
|
}), Qi = `graph TB
|
|
12708
|
-
a-->b`,
|
|
12709
|
-
const [i, n] = w(Qi), [a, o] = w(""), [c, s] = w(!1),
|
|
12721
|
+
a-->b`, Nh = ({ editor: e, upload: t }) => {
|
|
12722
|
+
const [i, n] = w(Qi), [a, o] = w(""), [c, s] = w(!1), l = J(null), d = async (f) => {
|
|
12710
12723
|
try {
|
|
12711
12724
|
const { svg: g } = await At.render("mermaid-svg", f);
|
|
12712
12725
|
o(g);
|
|
@@ -12720,12 +12733,12 @@ a-->b`, kh = ({ editor: e, upload: t }) => {
|
|
|
12720
12733
|
// fontFamily:'',
|
|
12721
12734
|
fontSize: 12,
|
|
12722
12735
|
theme: "base"
|
|
12723
|
-
}),
|
|
12736
|
+
}), d(i);
|
|
12724
12737
|
};
|
|
12725
12738
|
return E(() => {
|
|
12726
12739
|
c && h();
|
|
12727
12740
|
}, [c]), E(() => {
|
|
12728
|
-
c &&
|
|
12741
|
+
c && d(i);
|
|
12729
12742
|
}, [i]), /* @__PURE__ */ m(
|
|
12730
12743
|
Ee,
|
|
12731
12744
|
{
|
|
@@ -12764,7 +12777,7 @@ a-->b`, kh = ({ editor: e, upload: t }) => {
|
|
|
12764
12777
|
{
|
|
12765
12778
|
className: "richtext-flex-1 richtext-flex richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",
|
|
12766
12779
|
style: { height: "100%", borderWidth: 1, minHeight: 500, background: "#fff" },
|
|
12767
|
-
ref:
|
|
12780
|
+
ref: l,
|
|
12768
12781
|
dangerouslySetInnerHTML: { __html: a }
|
|
12769
12782
|
}
|
|
12770
12783
|
)
|
|
@@ -12776,7 +12789,7 @@ a-->b`, kh = ({ editor: e, upload: t }) => {
|
|
|
12776
12789
|
onClick: async () => {
|
|
12777
12790
|
if (i !== "") {
|
|
12778
12791
|
if (i) {
|
|
12779
|
-
const f =
|
|
12792
|
+
const f = l.current.querySelector("svg"), { width: g, height: x } = f.getBoundingClientRect(), b = `mermaid-${En()}.svg`;
|
|
12780
12793
|
let C = hn(f.outerHTML);
|
|
12781
12794
|
if (t) {
|
|
12782
12795
|
const T = vi(C, b);
|
|
@@ -12809,14 +12822,14 @@ a-->b`, kh = ({ editor: e, upload: t }) => {
|
|
|
12809
12822
|
BOTTOM_LEFT: "bl",
|
|
12810
12823
|
BOTTOM_RIGHT: "br"
|
|
12811
12824
|
};
|
|
12812
|
-
function
|
|
12825
|
+
function Th({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a }) {
|
|
12813
12826
|
const [o, c] = w({
|
|
12814
12827
|
width: Ge,
|
|
12815
12828
|
height: Ge
|
|
12816
|
-
}), [s,
|
|
12829
|
+
}), [s, l] = w({
|
|
12817
12830
|
width: 0,
|
|
12818
12831
|
height: 0
|
|
12819
|
-
}), [
|
|
12832
|
+
}), [d] = w([
|
|
12820
12833
|
kt.TOP_LEFT,
|
|
12821
12834
|
kt.TOP_RIGHT,
|
|
12822
12835
|
kt.BOTTOM_LEFT,
|
|
@@ -12844,7 +12857,7 @@ function Ch({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12844
12857
|
return { width: S === "100%" ? S : void 0 };
|
|
12845
12858
|
}, [b]);
|
|
12846
12859
|
function T(S) {
|
|
12847
|
-
|
|
12860
|
+
l({
|
|
12848
12861
|
width: S.target.width,
|
|
12849
12862
|
height: S.target.height
|
|
12850
12863
|
});
|
|
@@ -12932,7 +12945,7 @@ function Ch({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12932
12945
|
onClick: v
|
|
12933
12946
|
}
|
|
12934
12947
|
),
|
|
12935
|
-
e.view.editable && (a || h) && /* @__PURE__ */ r("div", { className: "image-resizer", children:
|
|
12948
|
+
e.view.editable && (a || h) && /* @__PURE__ */ r("div", { className: "image-resizer", children: d == null ? void 0 : d.map((S) => /* @__PURE__ */ r(
|
|
12936
12949
|
"span",
|
|
12937
12950
|
{
|
|
12938
12951
|
className: `image-resizer__handler image-resizer__handler--${S}`,
|
|
@@ -12963,7 +12976,7 @@ const en = si.extend({
|
|
|
12963
12976
|
button: ({ editor: t, t: i, extension: n }) => {
|
|
12964
12977
|
var a;
|
|
12965
12978
|
return {
|
|
12966
|
-
component:
|
|
12979
|
+
component: Nh,
|
|
12967
12980
|
componentProps: {
|
|
12968
12981
|
action: () => {
|
|
12969
12982
|
},
|
|
@@ -13012,7 +13025,7 @@ const en = si.extend({
|
|
|
13012
13025
|
};
|
|
13013
13026
|
},
|
|
13014
13027
|
addNodeView() {
|
|
13015
|
-
return ge(
|
|
13028
|
+
return ge(Th);
|
|
13016
13029
|
},
|
|
13017
13030
|
// @ts-ignore
|
|
13018
13031
|
addCommands() {
|
|
@@ -13065,54 +13078,54 @@ const en = si.extend({
|
|
|
13065
13078
|
}
|
|
13066
13079
|
});
|
|
13067
13080
|
export {
|
|
13068
|
-
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13081
|
+
Mu as A,
|
|
13082
|
+
Jh as B,
|
|
13083
|
+
iu as C,
|
|
13084
|
+
hh as D,
|
|
13085
|
+
Au as E,
|
|
13086
|
+
nu as F,
|
|
13074
13087
|
De as G,
|
|
13075
|
-
|
|
13076
|
-
|
|
13077
|
-
|
|
13088
|
+
ru as H,
|
|
13089
|
+
Qh as I,
|
|
13090
|
+
Iu as J,
|
|
13078
13091
|
Fe as K,
|
|
13079
|
-
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
|
|
13092
|
+
fu as L,
|
|
13093
|
+
_u as M,
|
|
13094
|
+
zu as N,
|
|
13095
|
+
hu as O,
|
|
13096
|
+
Hu as P,
|
|
13084
13097
|
Jn as Q,
|
|
13085
|
-
|
|
13086
|
-
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13098
|
+
Yh as R,
|
|
13099
|
+
tu as S,
|
|
13100
|
+
au as T,
|
|
13101
|
+
eu as U,
|
|
13102
|
+
td as V,
|
|
13090
13103
|
en as W,
|
|
13091
13104
|
ti as X,
|
|
13092
13105
|
ul as a,
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13106
|
+
ou as b,
|
|
13107
|
+
cu as c,
|
|
13108
|
+
su as d,
|
|
13109
|
+
lu as e,
|
|
13110
|
+
du as f,
|
|
13111
|
+
uu as g,
|
|
13112
|
+
mu as h,
|
|
13113
|
+
gu as i,
|
|
13114
|
+
xu as j,
|
|
13115
|
+
pu as k,
|
|
13116
|
+
wu as l,
|
|
13104
13117
|
Xo as m,
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13118
|
+
vu as n,
|
|
13119
|
+
yu as o,
|
|
13120
|
+
ku as p,
|
|
13121
|
+
Cu as q,
|
|
13122
|
+
Nu as r,
|
|
13123
|
+
Tu as s,
|
|
13111
13124
|
Ni as t,
|
|
13112
13125
|
lt as u,
|
|
13113
|
-
|
|
13126
|
+
bu as v,
|
|
13114
13127
|
$e as w,
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13128
|
+
gd as x,
|
|
13129
|
+
Lu as y,
|
|
13130
|
+
Su as z
|
|
13118
13131
|
};
|