cvnert-editor 0.1.0 → 0.1.2
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 +4 -4
- package/dist/cvnert-editor.js +211 -202
- package/dist/cvnert-editor.umd.cjs +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/types.d.ts +2 -0
- package/package.json +2 -1
package/dist/cvnert-editor.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as i, jsxs as m, Fragment as R } from "react/jsx-runtime";
|
|
2
2
|
import * as Dt from "react";
|
|
3
|
-
import { useState as A, useEffect as L, useRef as Z, useCallback as x, createContext as et, useContext as De, useMemo as
|
|
3
|
+
import { useState as A, useEffect as L, useRef as Z, useCallback as x, createContext as et, useContext as De, useMemo as N, forwardRef as V, isValidElement as ur, version as Ca, cloneElement as hn, Fragment as ga, memo as M, useLayoutEffect as On } from "react";
|
|
4
4
|
import { useEditorState as Kr, useCurrentEditor as ma, findParentNodeClosestToPos as ba, isNodeSelection as ht, mergeAttributes as qr, NodeViewWrapper as Ut, NodeViewContent as va, ReactNodeViewRenderer as Pn, Node as wa, posToDOMRect as ya, isTextSelection as Gr, EditorContext as Zn, useEditor as xa, EditorContent as Ia } from "@tiptap/react";
|
|
5
5
|
import { createPortal as Ta } from "react-dom";
|
|
6
6
|
import { StarterKit as La } from "@tiptap/starter-kit";
|
|
7
7
|
import { Mention as Aa } from "@tiptap/extension-mention";
|
|
8
8
|
import { TaskList as Ma, TaskItem as Sa } from "@tiptap/extension-list";
|
|
9
9
|
import { TextStyle as Ha, Color as ka } from "@tiptap/extension-text-style";
|
|
10
|
-
import { Selection as Ra, Placeholder as
|
|
11
|
-
import { Typography as
|
|
10
|
+
import { Selection as Ra, Placeholder as Ea } from "@tiptap/extensions";
|
|
11
|
+
import { Typography as Na } from "@tiptap/extension-typography";
|
|
12
12
|
import { Highlight as Va } from "@tiptap/extension-highlight";
|
|
13
13
|
import { Superscript as Ba } from "@tiptap/extension-superscript";
|
|
14
14
|
import { Subscript as Da } from "@tiptap/extension-subscript";
|
|
@@ -151,7 +151,7 @@ const A1 = (e, t, n = !0) => {
|
|
|
151
151
|
}, J = (e) => {
|
|
152
152
|
const { shortcutKeys: t, delimiter: n = "+", capitalize: o = !0 } = e;
|
|
153
153
|
return t ? t.split(n).map((r) => r.trim()).map((r) => A1(r, L1(), o)) : [];
|
|
154
|
-
},
|
|
154
|
+
}, Ee = (e, t) => t?.schema ? t.schema.spec.marks.get(e) !== void 0 : !1, ne = (e, t) => t?.schema ? t.schema.spec.nodes.get(e) !== void 0 : !1;
|
|
155
155
|
function M1(e) {
|
|
156
156
|
const { state: t, view: n } = e, { doc: o, selection: r } = t, l = Ot.findFrom(r.$to, 1, !0);
|
|
157
157
|
if (l)
|
|
@@ -293,7 +293,7 @@ function Yn(e, t, n, o) {
|
|
|
293
293
|
}
|
|
294
294
|
return r;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function E1(e) {
|
|
297
297
|
const { selection: t, doc: n } = e.state;
|
|
298
298
|
if (!t.empty) return;
|
|
299
299
|
const o = t.$from;
|
|
@@ -386,7 +386,7 @@ function sl(e, t) {
|
|
|
386
386
|
), null);
|
|
387
387
|
}
|
|
388
388
|
const al = "hideFloatingToolbar";
|
|
389
|
-
function
|
|
389
|
+
function N1(e) {
|
|
390
390
|
const { editor: t, isSelectionValid: n, extraHideWhen: o = !1 } = e, [r, l] = A(!1), s = Z(!1);
|
|
391
391
|
return L(() => {
|
|
392
392
|
if (!t) return;
|
|
@@ -518,7 +518,7 @@ const U1 = ({
|
|
|
518
518
|
onUpdateAttributes: f,
|
|
519
519
|
getPos: h
|
|
520
520
|
}) => {
|
|
521
|
-
const [p, g] = A(), [C, b] = A(s), [v, w] = A(!1), I = Z(!1), y = Z(!0), S = Z(null), k = Z(null),
|
|
521
|
+
const [p, g] = A(), [C, b] = A(s), [v, w] = A(!1), I = Z(!1), y = Z(!0), S = Z(null), k = Z(null), E = Z(null), D = Z(null);
|
|
522
522
|
L(() => {
|
|
523
523
|
if (!n || !a) return;
|
|
524
524
|
const U = () => {
|
|
@@ -587,7 +587,7 @@ const U1 = ({
|
|
|
587
587
|
}, F = () => {
|
|
588
588
|
n?.isEditable && y.current && w(!0);
|
|
589
589
|
}, j = (U) => {
|
|
590
|
-
y.current && (U.relatedTarget === k.current || U.relatedTarget ===
|
|
590
|
+
y.current && (U.relatedTarget === k.current || U.relatedTarget === E.current || p || n?.isEditable && w(!1));
|
|
591
591
|
}, ae = () => {
|
|
592
592
|
n?.isEditable && y.current && w(!0);
|
|
593
593
|
};
|
|
@@ -642,7 +642,7 @@ const U1 = ({
|
|
|
642
642
|
/* @__PURE__ */ i(
|
|
643
643
|
"div",
|
|
644
644
|
{
|
|
645
|
-
ref:
|
|
645
|
+
ref: E,
|
|
646
646
|
className: "tiptap-image-handle tiptap-image-handle-right",
|
|
647
647
|
onMouseDown: z,
|
|
648
648
|
onTouchStart: B
|
|
@@ -1058,16 +1058,16 @@ function q1(e) {
|
|
|
1058
1058
|
topOffset: s = 0,
|
|
1059
1059
|
maxShowCount: a = 20,
|
|
1060
1060
|
showTitle: c = !0
|
|
1061
|
-
} = n.options, d = t.attrs ?? {}, { backgroundColor: u } = d, f = d.topOffset ?? s, h = d.maxShowCount ?? a, p = d.showTitle ?? c, g =
|
|
1061
|
+
} = n.options, d = t.attrs ?? {}, { backgroundColor: u } = d, f = d.topOffset ?? s, h = d.maxShowCount ?? a, p = d.showTitle ?? c, g = N(
|
|
1062
1062
|
() => o ?? [],
|
|
1063
1063
|
[o]
|
|
1064
|
-
), C =
|
|
1064
|
+
), C = N(
|
|
1065
1065
|
() => g.slice(0, h),
|
|
1066
1066
|
[g, h]
|
|
1067
|
-
), b =
|
|
1067
|
+
), b = N(
|
|
1068
1068
|
() => l(C),
|
|
1069
1069
|
[C, l]
|
|
1070
|
-
), v =
|
|
1070
|
+
), v = N(() => C.map((S, k) => ({
|
|
1071
1071
|
item: S,
|
|
1072
1072
|
depth: b[k] ?? 1
|
|
1073
1073
|
})), [C, b]), w = x(
|
|
@@ -1097,7 +1097,7 @@ function q1(e) {
|
|
|
1097
1097
|
className: "tiptap-table-of-contents-item notranslate",
|
|
1098
1098
|
"data-depth": S.depth,
|
|
1099
1099
|
style: { "--toc-depth": S.depth },
|
|
1100
|
-
onClick: (
|
|
1100
|
+
onClick: (E) => w(E, S.item),
|
|
1101
1101
|
children: S.item.textContent
|
|
1102
1102
|
},
|
|
1103
1103
|
S.item.id ?? `${k}-${S.item.textContent}`
|
|
@@ -1210,7 +1210,7 @@ function j1({
|
|
|
1210
1210
|
}), p = a1(f, {
|
|
1211
1211
|
enabled: n == null
|
|
1212
1212
|
}), g = ll(f), C = c1(f, { role: "tooltip" }), b = il([h, p, g, C]);
|
|
1213
|
-
return
|
|
1213
|
+
return N(
|
|
1214
1214
|
() => ({
|
|
1215
1215
|
open: c,
|
|
1216
1216
|
setOpen: d,
|
|
@@ -1310,7 +1310,7 @@ const Y1 = ({
|
|
|
1310
1310
|
size: s,
|
|
1311
1311
|
...a
|
|
1312
1312
|
}, c) => {
|
|
1313
|
-
const d =
|
|
1313
|
+
const d = N(
|
|
1314
1314
|
() => J({ shortcutKeys: r }),
|
|
1315
1315
|
[r]
|
|
1316
1316
|
);
|
|
@@ -2761,7 +2761,7 @@ const Al = (e, t) => {
|
|
|
2761
2761
|
}, Y.emitUpdate();
|
|
2762
2762
|
const e = Y.editor;
|
|
2763
2763
|
e.view.dispatch(e.state.tr.setMeta(Re, null));
|
|
2764
|
-
},
|
|
2764
|
+
}, Ec = Ue.create({
|
|
2765
2765
|
name: "tableHandleExtension",
|
|
2766
2766
|
addCommands() {
|
|
2767
2767
|
return {
|
|
@@ -2778,7 +2778,7 @@ const Al = (e, t) => {
|
|
|
2778
2778
|
];
|
|
2779
2779
|
}
|
|
2780
2780
|
});
|
|
2781
|
-
function
|
|
2781
|
+
function Nc(e, t, n) {
|
|
2782
2782
|
if (n?.draggedCellOrientation === "row") {
|
|
2783
2783
|
const o = n.mousePos + (n.initialOffset ?? 0), r = Ke(o, t.y, t.bottom - e.height);
|
|
2784
2784
|
return new DOMRect(t.x, r, t.width, e.height);
|
|
@@ -2818,7 +2818,7 @@ function Uc(e) {
|
|
|
2818
2818
|
function Oc(e, t, n, o) {
|
|
2819
2819
|
switch (e) {
|
|
2820
2820
|
case "row":
|
|
2821
|
-
return
|
|
2821
|
+
return Nc(t, n, o);
|
|
2822
2822
|
case "col":
|
|
2823
2823
|
return Vc(t, n, o);
|
|
2824
2824
|
default:
|
|
@@ -2826,7 +2826,7 @@ function Oc(e, t, n, o) {
|
|
|
2826
2826
|
}
|
|
2827
2827
|
}
|
|
2828
2828
|
function un(e, t, n, o, r) {
|
|
2829
|
-
const l =
|
|
2829
|
+
const l = N(() => Dc(e), [e]), s = N(() => Uc(e), [e]), { refs: a, update: c, context: d, floatingStyles: u } = bt({
|
|
2830
2830
|
open: t,
|
|
2831
2831
|
placement: l,
|
|
2832
2832
|
middleware: [
|
|
@@ -2869,7 +2869,7 @@ function un(e, t, n, o, r) {
|
|
|
2869
2869
|
r
|
|
2870
2870
|
)
|
|
2871
2871
|
});
|
|
2872
|
-
}, [a, e, n, o, r]),
|
|
2872
|
+
}, [a, e, n, o, r]), N(
|
|
2873
2873
|
() => ({
|
|
2874
2874
|
isMounted: f,
|
|
2875
2875
|
ref: a.setFloating,
|
|
@@ -2902,7 +2902,7 @@ function Pc(e, t, n, o) {
|
|
|
2902
2902
|
n,
|
|
2903
2903
|
o
|
|
2904
2904
|
);
|
|
2905
|
-
return
|
|
2905
|
+
return N(
|
|
2906
2906
|
() => ({ rowHandle: r, colHandle: l, cellHandle: s }),
|
|
2907
2907
|
[r, l, s]
|
|
2908
2908
|
);
|
|
@@ -3104,7 +3104,7 @@ function ot({
|
|
|
3104
3104
|
s.open === void 0 && d(g), o?.(g);
|
|
3105
3105
|
},
|
|
3106
3106
|
[s.open, o]
|
|
3107
|
-
), h =
|
|
3107
|
+
), h = N(
|
|
3108
3108
|
() => ({
|
|
3109
3109
|
isRootMenu: a,
|
|
3110
3110
|
open: s.open ?? c
|
|
@@ -3531,7 +3531,7 @@ function Rl(e) {
|
|
|
3531
3531
|
tablePos: r
|
|
3532
3532
|
});
|
|
3533
3533
|
return g && s?.(), g;
|
|
3534
|
-
}, [a, n, o, r, s]), h =
|
|
3534
|
+
}, [a, n, o, r, s]), h = N(() => Jc[c?.orientation || "row"], [c]);
|
|
3535
3535
|
return {
|
|
3536
3536
|
isVisible: d,
|
|
3537
3537
|
canDuplicateRowColumn: u,
|
|
@@ -3611,7 +3611,7 @@ const lo = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
|
3611
3611
|
}
|
|
3612
3612
|
));
|
|
3613
3613
|
lo.displayName = "ArrowLeftIcon";
|
|
3614
|
-
const
|
|
3614
|
+
const El = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
3615
3615
|
"svg",
|
|
3616
3616
|
{
|
|
3617
3617
|
width: "24",
|
|
@@ -3632,8 +3632,8 @@ const Nl = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
|
3632
3632
|
)
|
|
3633
3633
|
}
|
|
3634
3634
|
));
|
|
3635
|
-
|
|
3636
|
-
const
|
|
3635
|
+
El.displayName = "ArrowRightIcon";
|
|
3636
|
+
const Nl = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
3637
3637
|
"svg",
|
|
3638
3638
|
{
|
|
3639
3639
|
width: "24",
|
|
@@ -3654,7 +3654,7 @@ const El = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
|
3654
3654
|
)
|
|
3655
3655
|
}
|
|
3656
3656
|
));
|
|
3657
|
-
|
|
3657
|
+
Nl.displayName = "ArrowUpIcon";
|
|
3658
3658
|
const Vl = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
3659
3659
|
"svg",
|
|
3660
3660
|
{
|
|
@@ -3689,10 +3689,10 @@ const Bl = ["tableHandleExtension"], l2 = {
|
|
|
3689
3689
|
right: "Move column right"
|
|
3690
3690
|
}
|
|
3691
3691
|
}, i2 = {
|
|
3692
|
-
up:
|
|
3692
|
+
up: Nl,
|
|
3693
3693
|
down: Vl,
|
|
3694
3694
|
left: lo,
|
|
3695
|
-
right:
|
|
3695
|
+
right: El
|
|
3696
3696
|
};
|
|
3697
3697
|
function s2(e, t, n) {
|
|
3698
3698
|
try {
|
|
@@ -3857,7 +3857,7 @@ function at(e) {
|
|
|
3857
3857
|
tablePos: r
|
|
3858
3858
|
});
|
|
3859
3859
|
return C && a?.(), C;
|
|
3860
|
-
}, [c, n, o, l, r, a]), p =
|
|
3860
|
+
}, [c, n, o, l, r, a]), p = N(() => l2[d?.orientation || "row"][l] || `Move ${d?.orientation} ${l}`, [d, l]), g = N(() => i2[l], [l]);
|
|
3861
3861
|
return {
|
|
3862
3862
|
isVisible: u,
|
|
3863
3863
|
canMoveRowColumn: f,
|
|
@@ -4111,7 +4111,7 @@ function _t(e = {}) {
|
|
|
4111
4111
|
resetAttrs: s
|
|
4112
4112
|
});
|
|
4113
4113
|
return C && a?.(), C;
|
|
4114
|
-
}, [c, n, o, r, s, a]), p =
|
|
4114
|
+
}, [c, n, o, r, s, a]), p = N(() => d ? f2[d.orientation] : "Clear contents", [d]);
|
|
4115
4115
|
return {
|
|
4116
4116
|
isVisible: u,
|
|
4117
4117
|
canClearRowColumnContent: f,
|
|
@@ -4785,7 +4785,7 @@ function jl(e) {
|
|
|
4785
4785
|
tablePos: r
|
|
4786
4786
|
});
|
|
4787
4787
|
return p && s?.(), p;
|
|
4788
|
-
}, [a, n, o, r, s]), h =
|
|
4788
|
+
}, [a, n, o, r, s]), h = N(() => H2[c?.orientation || "row"], [c]);
|
|
4789
4789
|
return {
|
|
4790
4790
|
isVisible: d,
|
|
4791
4791
|
canDeleteRowColumn: u,
|
|
@@ -4794,7 +4794,7 @@ function jl(e) {
|
|
|
4794
4794
|
Icon: Kt
|
|
4795
4795
|
};
|
|
4796
4796
|
}
|
|
4797
|
-
const
|
|
4797
|
+
const E2 = V(
|
|
4798
4798
|
({
|
|
4799
4799
|
editor: e,
|
|
4800
4800
|
index: t,
|
|
@@ -4844,7 +4844,7 @@ const N2 = V(
|
|
|
4844
4844
|
) : null;
|
|
4845
4845
|
}
|
|
4846
4846
|
);
|
|
4847
|
-
|
|
4847
|
+
E2.displayName = "TableSortRowColumnButton";
|
|
4848
4848
|
const ho = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
4849
4849
|
"svg",
|
|
4850
4850
|
{
|
|
@@ -4921,7 +4921,7 @@ const Yl = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
|
4921
4921
|
}
|
|
4922
4922
|
));
|
|
4923
4923
|
Yl.displayName = "ArrowDownZAIcon";
|
|
4924
|
-
const Xl = ["tableHandleExtension"],
|
|
4924
|
+
const Xl = ["tableHandleExtension"], N2 = {
|
|
4925
4925
|
row: {
|
|
4926
4926
|
asc: "Sort row A-Z",
|
|
4927
4927
|
desc: "Sort row Z-A"
|
|
@@ -5074,7 +5074,7 @@ function vn(e = { direction: "asc" }) {
|
|
|
5074
5074
|
tablePos: r
|
|
5075
5075
|
});
|
|
5076
5076
|
return C && a?.(), C;
|
|
5077
|
-
}, [c, n, o, l, r, a]), p =
|
|
5077
|
+
}, [c, n, o, l, r, a]), p = N(() => N2[d?.orientation || "row"][l] || `Sort ${d?.orientation} ${l}`, [d, l]), g = N(() => V2[l] || ho, [l]);
|
|
5078
5078
|
return {
|
|
5079
5079
|
isVisible: u,
|
|
5080
5080
|
canSortRowColumn: f,
|
|
@@ -5160,7 +5160,7 @@ const Ct = V(
|
|
|
5160
5160
|
s?.(S), !S.defaultPrevented && C();
|
|
5161
5161
|
},
|
|
5162
5162
|
[C, s]
|
|
5163
|
-
), y =
|
|
5163
|
+
), y = N(
|
|
5164
5164
|
() => ({
|
|
5165
5165
|
...c,
|
|
5166
5166
|
"--color-text-button-color": t
|
|
@@ -5289,7 +5289,7 @@ const wn = "mod+shift+t", xt = [
|
|
|
5289
5289
|
}
|
|
5290
5290
|
];
|
|
5291
5291
|
function Gt(e) {
|
|
5292
|
-
if (!e || !e.isEditable || !
|
|
5292
|
+
if (!e || !e.isEditable || !Ee("textStyle", e) || ue(e, ["image"]))
|
|
5293
5293
|
return !1;
|
|
5294
5294
|
try {
|
|
5295
5295
|
return e.can().setMark("textStyle", { color: "currentColor" });
|
|
@@ -5302,7 +5302,7 @@ function P2(e, t) {
|
|
|
5302
5302
|
}
|
|
5303
5303
|
function Z2(e) {
|
|
5304
5304
|
const { editor: t, hideWhenUnavailable: n } = e;
|
|
5305
|
-
return t ? n ? !t.isEditable || !
|
|
5305
|
+
return t ? n ? !t.isEditable || !Ee("textStyle", t) ? !1 : t.isActive("code") ? !0 : Gt(t) : !0 : !1;
|
|
5306
5306
|
}
|
|
5307
5307
|
function Jl(e) {
|
|
5308
5308
|
const {
|
|
@@ -5330,7 +5330,7 @@ function Jl(e) {
|
|
|
5330
5330
|
);
|
|
5331
5331
|
}
|
|
5332
5332
|
setTimeout(() => {
|
|
5333
|
-
|
|
5333
|
+
E1(s);
|
|
5334
5334
|
const p = s.chain().focus().toggleMark("textStyle", { color: o }).run();
|
|
5335
5335
|
return p && l?.({ color: o, label: n }), p;
|
|
5336
5336
|
}, 0);
|
|
@@ -5395,7 +5395,7 @@ const Je = V(
|
|
|
5395
5395
|
a?.(k), !k.defaultPrevented && v();
|
|
5396
5396
|
},
|
|
5397
5397
|
[v, a]
|
|
5398
|
-
), S =
|
|
5398
|
+
), S = N(
|
|
5399
5399
|
() => ({
|
|
5400
5400
|
...d,
|
|
5401
5401
|
"--highlight-color": t
|
|
@@ -5533,7 +5533,7 @@ function z2(e, t = !1) {
|
|
|
5533
5533
|
function je(e, t = "mark") {
|
|
5534
5534
|
if (!e || !e.isEditable) return !1;
|
|
5535
5535
|
if (t === "mark")
|
|
5536
|
-
return !
|
|
5536
|
+
return !Ee("highlight", e) || ue(e, ["image"]) ? !1 : e.can().setMark("highlight");
|
|
5537
5537
|
if (!O(e, ["nodeBackground"])) return !1;
|
|
5538
5538
|
try {
|
|
5539
5539
|
return e.can().toggleNodeBackgroundColor("test");
|
|
@@ -5568,7 +5568,7 @@ function _2(e) {
|
|
|
5568
5568
|
return !0;
|
|
5569
5569
|
if (!t.isEditable) return !1;
|
|
5570
5570
|
if (o === "mark") {
|
|
5571
|
-
if (!
|
|
5571
|
+
if (!Ee("highlight", t)) return !1;
|
|
5572
5572
|
} else if (!O(t, ["nodeBackground"])) return !1;
|
|
5573
5573
|
return t.isActive("code") ? !0 : je(t, o);
|
|
5574
5574
|
}
|
|
@@ -5766,7 +5766,7 @@ const Xe = V(
|
|
|
5766
5766
|
({ className: e, ...t }, n) => /* @__PURE__ */ i("div", { ref: n, className: P("tiptap-card-body", e), ...t })
|
|
5767
5767
|
);
|
|
5768
5768
|
Xe.displayName = "CardBody";
|
|
5769
|
-
const
|
|
5769
|
+
const Ne = V(({ className: e, orientation: t = "vertical", ...n }, o) => /* @__PURE__ */ i(
|
|
5770
5770
|
"div",
|
|
5771
5771
|
{
|
|
5772
5772
|
ref: o,
|
|
@@ -5775,7 +5775,7 @@ const Ee = V(({ className: e, orientation: t = "vertical", ...n }, o) => /* @__P
|
|
|
5775
5775
|
...n
|
|
5776
5776
|
}
|
|
5777
5777
|
));
|
|
5778
|
-
|
|
5778
|
+
Ne.displayName = "CardItemGroup";
|
|
5779
5779
|
const gt = V(
|
|
5780
5780
|
({ className: e, ...t }, n) => /* @__PURE__ */ i(
|
|
5781
5781
|
"div",
|
|
@@ -5915,7 +5915,7 @@ function Y2({
|
|
|
5915
5915
|
editor: o,
|
|
5916
5916
|
resolveColorValue: r
|
|
5917
5917
|
}) {
|
|
5918
|
-
return e.length === 0 ? null : /* @__PURE__ */ m(
|
|
5918
|
+
return e.length === 0 ? null : /* @__PURE__ */ m(Ne, { children: [
|
|
5919
5919
|
/* @__PURE__ */ i(gt, { children: "Recently used" }),
|
|
5920
5920
|
/* @__PURE__ */ i(Ce, { children: e.map((l, s) => /* @__PURE__ */ i(Ce, { children: /* @__PURE__ */ i(
|
|
5921
5921
|
j2,
|
|
@@ -5937,22 +5937,22 @@ function X2({
|
|
|
5937
5937
|
editor: o,
|
|
5938
5938
|
resolveColorValue: r
|
|
5939
5939
|
}) {
|
|
5940
|
-
const { recentColors: l, addRecentColor: s, isInitialized: a } = It(t), c = Z(null), d =
|
|
5940
|
+
const { recentColors: l, addRecentColor: s, isInitialized: a } = It(t), c = Z(null), d = N(
|
|
5941
5941
|
() => Cr(xt, e),
|
|
5942
5942
|
[e]
|
|
5943
|
-
), u =
|
|
5943
|
+
), u = N(
|
|
5944
5944
|
() => Cr(Ge, e),
|
|
5945
5945
|
[e]
|
|
5946
|
-
), f =
|
|
5946
|
+
), f = N(() => d.flat(), [d]), h = N(
|
|
5947
5947
|
() => u.flat(),
|
|
5948
5948
|
[u]
|
|
5949
|
-
), p =
|
|
5949
|
+
), p = N(
|
|
5950
5950
|
() => a ? l.length : 0,
|
|
5951
5951
|
[a, l.length]
|
|
5952
|
-
), g =
|
|
5952
|
+
), g = N(
|
|
5953
5953
|
() => p + f.length,
|
|
5954
5954
|
[p, f.length]
|
|
5955
|
-
), C =
|
|
5955
|
+
), C = N(() => {
|
|
5956
5956
|
const w = [];
|
|
5957
5957
|
return a && l.length > 0 && w.push(
|
|
5958
5958
|
...l.map((I) => ({
|
|
@@ -6008,7 +6008,7 @@ function X2({
|
|
|
6008
6008
|
resolveColorValue: r
|
|
6009
6009
|
}
|
|
6010
6010
|
),
|
|
6011
|
-
/* @__PURE__ */ m(
|
|
6011
|
+
/* @__PURE__ */ m(Ne, { children: [
|
|
6012
6012
|
/* @__PURE__ */ i(gt, { children: "Text color" }),
|
|
6013
6013
|
/* @__PURE__ */ i(
|
|
6014
6014
|
Sr,
|
|
@@ -6023,7 +6023,7 @@ function X2({
|
|
|
6023
6023
|
}
|
|
6024
6024
|
)
|
|
6025
6025
|
] }),
|
|
6026
|
-
/* @__PURE__ */ m(
|
|
6026
|
+
/* @__PURE__ */ m(Ne, { children: [
|
|
6027
6027
|
/* @__PURE__ */ i(gt, { children: "Highlight color" }),
|
|
6028
6028
|
/* @__PURE__ */ i(
|
|
6029
6029
|
Sr,
|
|
@@ -6177,7 +6177,7 @@ function ed(e) {
|
|
|
6177
6177
|
editor: t,
|
|
6178
6178
|
hideWhenUnavailable: n = !1,
|
|
6179
6179
|
onColorChanged: o
|
|
6180
|
-
} = e || {}, { editor: r } = T(t), [l, s] = A(!0), a =
|
|
6180
|
+
} = e || {}, { editor: r } = T(t), [l, s] = A(!0), a = Ee("textStyle", r), c = Ee("highlight", r), d = gr(r, "textStyle") || {}, u = gr(r, "highlight") || {}, f = Gt(r) || je(r);
|
|
6181
6181
|
L(() => {
|
|
6182
6182
|
if (!r) return;
|
|
6183
6183
|
const p = () => {
|
|
@@ -6908,7 +6908,7 @@ function $e(e) {
|
|
|
6908
6908
|
orientation: l
|
|
6909
6909
|
});
|
|
6910
6910
|
return b && a?.(o), b;
|
|
6911
|
-
}, [c, n, o, r, l, a]), g =
|
|
6911
|
+
}, [c, n, o, r, l, a]), g = N(() => n === "text" ? Hr.text[o] : Hr.vertical[o], [n, o]), C = N(() => n === "text" ? kr.text[o] : kr.vertical[o], [n, o]);
|
|
6912
6912
|
return {
|
|
6913
6913
|
isVisible: d,
|
|
6914
6914
|
canAlignCell: u,
|
|
@@ -7151,7 +7151,7 @@ function nn() {
|
|
|
7151
7151
|
return e;
|
|
7152
7152
|
}
|
|
7153
7153
|
function si(e, t) {
|
|
7154
|
-
const { editor: n, orientation: o, index: r, tableNode: l, tablePos: s } = nn(), [a, c] = A(!1), [d, u] = A(!1), f =
|
|
7154
|
+
const { editor: n, orientation: o, index: r, tableNode: l, tablePos: s } = nn(), [a, c] = A(!1), [d, u] = A(!1), f = N(
|
|
7155
7155
|
() => cd[o],
|
|
7156
7156
|
[o]
|
|
7157
7157
|
), h = x(() => {
|
|
@@ -7276,7 +7276,7 @@ function ud() {
|
|
|
7276
7276
|
orientation: "column",
|
|
7277
7277
|
side: "right",
|
|
7278
7278
|
hideWhenUnavailable: !0
|
|
7279
|
-
}), w =
|
|
7279
|
+
}), w = N(
|
|
7280
7280
|
() => ({
|
|
7281
7281
|
moveUp: u,
|
|
7282
7282
|
moveDown: f,
|
|
@@ -7284,7 +7284,7 @@ function ud() {
|
|
|
7284
7284
|
moveRight: p
|
|
7285
7285
|
}),
|
|
7286
7286
|
[u, f, h, p]
|
|
7287
|
-
), I =
|
|
7287
|
+
), I = N(
|
|
7288
7288
|
() => ({
|
|
7289
7289
|
addAbove: g,
|
|
7290
7290
|
addBelow: C,
|
|
@@ -7292,7 +7292,7 @@ function ud() {
|
|
|
7292
7292
|
addRight: v
|
|
7293
7293
|
}),
|
|
7294
7294
|
[g, C, b, v]
|
|
7295
|
-
), y =
|
|
7295
|
+
), y = N(
|
|
7296
7296
|
() => ({
|
|
7297
7297
|
sortAsc: s,
|
|
7298
7298
|
sortDesc: a
|
|
@@ -7334,7 +7334,7 @@ function ud() {
|
|
|
7334
7334
|
disabled: !I.addRight.canAddRowColumn,
|
|
7335
7335
|
onClick: I.addRight.handleAdd
|
|
7336
7336
|
})), D;
|
|
7337
|
-
}, [n, I]),
|
|
7337
|
+
}, [n, I]), E = x(() => {
|
|
7338
7338
|
const D = [];
|
|
7339
7339
|
return n === "row" ? (w.moveUp.isVisible && D.push({
|
|
7340
7340
|
icon: w.moveUp.Icon,
|
|
@@ -7364,7 +7364,7 @@ function ud() {
|
|
|
7364
7364
|
clearContentAction: c,
|
|
7365
7365
|
headerAction: d,
|
|
7366
7366
|
addItems: k(),
|
|
7367
|
-
moveItems:
|
|
7367
|
+
moveItems: E(),
|
|
7368
7368
|
sortItems: S()
|
|
7369
7369
|
};
|
|
7370
7370
|
}
|
|
@@ -7485,7 +7485,7 @@ const Ze = ({
|
|
|
7485
7485
|
onOpenChange: s,
|
|
7486
7486
|
dragStart: a
|
|
7487
7487
|
}) => {
|
|
7488
|
-
const { editor: c } = T(e), d =
|
|
7488
|
+
const { editor: c } = T(e), d = N(
|
|
7489
7489
|
() => ({
|
|
7490
7490
|
editor: c,
|
|
7491
7491
|
orientation: t,
|
|
@@ -7555,7 +7555,7 @@ function ai({
|
|
|
7555
7555
|
rowButton: t,
|
|
7556
7556
|
columnButton: n
|
|
7557
7557
|
}) {
|
|
7558
|
-
const { editor: o } = T(e), r = to({ editor: o }), [l, s] = A(!0), [a, c] = A(!0), [d, u] = A(null), f =
|
|
7558
|
+
const { editor: o } = T(e), r = to({ editor: o }), [l, s] = A(!0), [a, c] = A(!0), [d, u] = A(null), f = N(() => {
|
|
7559
7559
|
if (r?.draggingState)
|
|
7560
7560
|
return {
|
|
7561
7561
|
draggedCellOrientation: r.draggingState.draggedCellOrientation,
|
|
@@ -7567,13 +7567,13 @@ function ai({
|
|
|
7567
7567
|
r?.referencePosCell || null,
|
|
7568
7568
|
r?.referencePosTable || null,
|
|
7569
7569
|
f
|
|
7570
|
-
), g = x((
|
|
7571
|
-
s(
|
|
7572
|
-
}, []), C = x((
|
|
7573
|
-
c(
|
|
7570
|
+
), g = x((E) => {
|
|
7571
|
+
s(E);
|
|
7572
|
+
}, []), C = x((E) => {
|
|
7573
|
+
c(E);
|
|
7574
7574
|
}, []), b = x(
|
|
7575
|
-
(
|
|
7576
|
-
u(D ?
|
|
7575
|
+
(E, D) => {
|
|
7576
|
+
u(D ? E : null);
|
|
7577
7577
|
},
|
|
7578
7578
|
[]
|
|
7579
7579
|
);
|
|
@@ -7590,7 +7590,7 @@ function ai({
|
|
|
7590
7590
|
tableNode: r.block,
|
|
7591
7591
|
onToggleOtherHandle: C,
|
|
7592
7592
|
dragStart: kc,
|
|
7593
|
-
onOpenChange: (
|
|
7593
|
+
onOpenChange: (E) => b("row", E)
|
|
7594
7594
|
}
|
|
7595
7595
|
) }),
|
|
7596
7596
|
y && /* @__PURE__ */ i("div", { ref: p.ref, style: p.style, children: /* @__PURE__ */ i(
|
|
@@ -7603,7 +7603,7 @@ function ai({
|
|
|
7603
7603
|
tableNode: r.block,
|
|
7604
7604
|
onToggleOtherHandle: g,
|
|
7605
7605
|
dragStart: Hc,
|
|
7606
|
-
onOpenChange: (
|
|
7606
|
+
onOpenChange: (E) => b("column", E)
|
|
7607
7607
|
}
|
|
7608
7608
|
) })
|
|
7609
7609
|
] });
|
|
@@ -7827,7 +7827,7 @@ const gd = 5, md = (e, t, n, o) => {
|
|
|
7827
7827
|
window.addEventListener("mousemove", z), window.addEventListener("mouseup", B);
|
|
7828
7828
|
},
|
|
7829
7829
|
[r, a, p, n]
|
|
7830
|
-
),
|
|
7830
|
+
), E = x(() => {
|
|
7831
7831
|
if (!r) {
|
|
7832
7832
|
h(null);
|
|
7833
7833
|
return;
|
|
@@ -7850,12 +7850,12 @@ const gd = 5, md = (e, t, n, o) => {
|
|
|
7850
7850
|
if (L(() => {
|
|
7851
7851
|
if (!r) return;
|
|
7852
7852
|
const $ = () => {
|
|
7853
|
-
S(),
|
|
7853
|
+
S(), E();
|
|
7854
7854
|
};
|
|
7855
|
-
return r.on("selectionUpdate", $), S(),
|
|
7855
|
+
return r.on("selectionUpdate", $), S(), E(), () => {
|
|
7856
7856
|
r.off("selectionUpdate", $);
|
|
7857
7857
|
};
|
|
7858
|
-
}, [r, S,
|
|
7858
|
+
}, [r, S, E]), L(() => {
|
|
7859
7859
|
const $ = f?.querySelector(
|
|
7860
7860
|
".table-selection-overlay-container"
|
|
7861
7861
|
);
|
|
@@ -8234,7 +8234,7 @@ const ui = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
|
8234
8234
|
}
|
|
8235
8235
|
));
|
|
8236
8236
|
ui.displayName = "Grip4Icon";
|
|
8237
|
-
function
|
|
8237
|
+
function Ed() {
|
|
8238
8238
|
const e = In({ action: "merge" }), t = In({ action: "split" }), n = _t({ resetAttrs: !0 }), o = {
|
|
8239
8239
|
icon: e.Icon,
|
|
8240
8240
|
label: e.label,
|
|
@@ -8257,7 +8257,7 @@ function Nd() {
|
|
|
8257
8257
|
clearAction: l
|
|
8258
8258
|
};
|
|
8259
8259
|
}
|
|
8260
|
-
function
|
|
8260
|
+
function Nd({ editor: e }) {
|
|
8261
8261
|
const [t, n] = A(!1), o = x(() => {
|
|
8262
8262
|
n(!1), e?.commands.unfreezeHandles();
|
|
8263
8263
|
}, [e]), r = x(
|
|
@@ -8287,7 +8287,7 @@ const fn = ({ action: e }) => {
|
|
|
8287
8287
|
}
|
|
8288
8288
|
);
|
|
8289
8289
|
}, Vd = ({ onClose: e }) => {
|
|
8290
|
-
const { mergeAction: t, splitAction: n, clearAction: o } =
|
|
8290
|
+
const { mergeAction: t, splitAction: n, clearAction: o } = Ed(), r = t.isAvailable || n.isAvailable;
|
|
8291
8291
|
return /* @__PURE__ */ m(rt, { autoFocusOnShow: !0, modal: !0, onClose: e, children: [
|
|
8292
8292
|
/* @__PURE__ */ i(no, { style: jn }),
|
|
8293
8293
|
/* @__PURE__ */ m(nt, { style: { minWidth: "15rem" }, children: [
|
|
@@ -8304,7 +8304,7 @@ const fn = ({ action: e }) => {
|
|
|
8304
8304
|
] })
|
|
8305
8305
|
] });
|
|
8306
8306
|
}, fi = V(({ editor: e, onOpenChange: t, className: n, ...o }, r) => {
|
|
8307
|
-
const { editor: l } = T(e), { isMenuOpen: s, handleMenuToggle: a, closeMenu: c } =
|
|
8307
|
+
const { editor: l } = T(e), { isMenuOpen: s, handleMenuToggle: a, closeMenu: c } = Nd({
|
|
8308
8308
|
editor: l
|
|
8309
8309
|
});
|
|
8310
8310
|
return L(() => {
|
|
@@ -8366,7 +8366,7 @@ const Bd = {
|
|
|
8366
8366
|
sizeProperty: "height"
|
|
8367
8367
|
}
|
|
8368
8368
|
};
|
|
8369
|
-
function
|
|
8369
|
+
function Er(e, t, n) {
|
|
8370
8370
|
const o = Bd[e], { refs: r, update: l, context: s, floatingStyles: a } = bt({
|
|
8371
8371
|
open: t,
|
|
8372
8372
|
placement: o.placement,
|
|
@@ -8389,7 +8389,7 @@ function Nr(e, t, n) {
|
|
|
8389
8389
|
);
|
|
8390
8390
|
return L(() => {
|
|
8391
8391
|
n && (r.setReference(u(n)), l());
|
|
8392
|
-
}, [n, r, l, u]),
|
|
8392
|
+
}, [n, r, l, u]), N(
|
|
8393
8393
|
() => ({
|
|
8394
8394
|
isMounted: c,
|
|
8395
8395
|
ref: r.setFloating,
|
|
@@ -8403,16 +8403,16 @@ function Nr(e, t, n) {
|
|
|
8403
8403
|
);
|
|
8404
8404
|
}
|
|
8405
8405
|
function Dd(e, t, n) {
|
|
8406
|
-
const o =
|
|
8406
|
+
const o = Er(
|
|
8407
8407
|
"row",
|
|
8408
8408
|
t,
|
|
8409
8409
|
n
|
|
8410
|
-
), r =
|
|
8410
|
+
), r = Er(
|
|
8411
8411
|
"column",
|
|
8412
8412
|
e,
|
|
8413
8413
|
n
|
|
8414
8414
|
);
|
|
8415
|
-
return
|
|
8415
|
+
return N(
|
|
8416
8416
|
() => ({
|
|
8417
8417
|
rowButton: o,
|
|
8418
8418
|
columnButton: r
|
|
@@ -8420,7 +8420,7 @@ function Dd(e, t, n) {
|
|
|
8420
8420
|
[o, r]
|
|
8421
8421
|
);
|
|
8422
8422
|
}
|
|
8423
|
-
const
|
|
8423
|
+
const Nr = ({
|
|
8424
8424
|
editor: e,
|
|
8425
8425
|
onMouseDown: t,
|
|
8426
8426
|
onMouseUp: n,
|
|
@@ -8447,16 +8447,16 @@ const Er = ({
|
|
|
8447
8447
|
if (!d || !l || !s) return;
|
|
8448
8448
|
const p = (C) => {
|
|
8449
8449
|
c.current = !0;
|
|
8450
|
-
const v = (a ? C.clientY : C.clientX) - d.startPos, w = a ? lc : st, I = _e.get(s.block), y = a ? I.height : I.width, S = a ? d.originalHeight : d.originalWidth,
|
|
8450
|
+
const v = (a ? C.clientY : C.clientX) - d.startPos, w = a ? lc : st, I = _e.get(s.block), y = a ? I.height : I.width, S = a ? d.originalHeight : d.originalWidth, E = Math.max(
|
|
8451
8451
|
1,
|
|
8452
8452
|
S + fc(v / w, 0.3)
|
|
8453
8453
|
) - y;
|
|
8454
|
-
|
|
8454
|
+
E !== 0 && (E > 0 ? cn(l, () => {
|
|
8455
8455
|
dn(l, s.block, s.blockPos, o);
|
|
8456
|
-
for (let D = 0; D <
|
|
8456
|
+
for (let D = 0; D < E; D++)
|
|
8457
8457
|
a ? l.commands.addRowAfter() : l.commands.addColumnAfter();
|
|
8458
8458
|
}) : cn(l, () => {
|
|
8459
|
-
const D = Math.abs(
|
|
8459
|
+
const D = Math.abs(E), ie = a ? dc(l, s.blockPos) : uc(l, s.blockPos), $ = Math.min(D, ie, y - 1);
|
|
8460
8460
|
dn(l, s.block, s.blockPos, o);
|
|
8461
8461
|
for (let G = 0; G < $; G++)
|
|
8462
8462
|
a ? l.commands.deleteRow() : l.commands.deleteColumn();
|
|
@@ -8494,7 +8494,7 @@ const Er = ({
|
|
|
8494
8494
|
}, [o, n]);
|
|
8495
8495
|
return r ? /* @__PURE__ */ m(Wt, { root: r.widgetContainer, children: [
|
|
8496
8496
|
/* @__PURE__ */ i("div", { ref: s.ref, style: s.style, children: /* @__PURE__ */ i(
|
|
8497
|
-
|
|
8497
|
+
Nr,
|
|
8498
8498
|
{
|
|
8499
8499
|
editor: o,
|
|
8500
8500
|
orientation: "row",
|
|
@@ -8504,7 +8504,7 @@ const Er = ({
|
|
|
8504
8504
|
}
|
|
8505
8505
|
) }),
|
|
8506
8506
|
/* @__PURE__ */ i("div", { ref: l.ref, style: l.style, children: /* @__PURE__ */ i(
|
|
8507
|
-
|
|
8507
|
+
Nr,
|
|
8508
8508
|
{
|
|
8509
8509
|
editor: o,
|
|
8510
8510
|
orientation: "column",
|
|
@@ -8541,7 +8541,7 @@ function pi(e, t, n, o, r) {
|
|
|
8541
8541
|
a.setReference({
|
|
8542
8542
|
getBoundingClientRect: C
|
|
8543
8543
|
});
|
|
8544
|
-
}, [t, a]),
|
|
8544
|
+
}, [t, a]), N(
|
|
8545
8545
|
() => ({
|
|
8546
8546
|
isMounted: u,
|
|
8547
8547
|
ref: a.setFloating,
|
|
@@ -8621,9 +8621,9 @@ const ko = ({
|
|
|
8621
8621
|
},
|
|
8622
8622
|
...t
|
|
8623
8623
|
}
|
|
8624
|
-
),
|
|
8624
|
+
), E = Z(s);
|
|
8625
8625
|
L(() => {
|
|
8626
|
-
|
|
8626
|
+
E.current = s;
|
|
8627
8627
|
}, [s]);
|
|
8628
8628
|
const D = x(() => {
|
|
8629
8629
|
d(!1);
|
|
@@ -8634,7 +8634,7 @@ const ko = ({
|
|
|
8634
8634
|
a.state.plugins.find(
|
|
8635
8635
|
(B) => B.spec.key === l
|
|
8636
8636
|
) && a.unregisterPlugin(l);
|
|
8637
|
-
const _ =
|
|
8637
|
+
const _ = E.current.char ?? "@", K = a.extensionManager.extensions.find((B) => {
|
|
8638
8638
|
if (B.name !== "mention") return !1;
|
|
8639
8639
|
const F = B.options?.suggestions;
|
|
8640
8640
|
return F?.length ? F.some(
|
|
@@ -8680,14 +8680,14 @@ const ko = ({
|
|
|
8680
8680
|
if (Ie.name !== "mention") return !1;
|
|
8681
8681
|
const Be = Ie.options?.suggestions;
|
|
8682
8682
|
return Be?.length ? Be.some(
|
|
8683
|
-
(Qe) => (Qe.char ?? "@") ===
|
|
8684
|
-
) : (Ie.options?.suggestion?.char ?? "@") ===
|
|
8683
|
+
(Qe) => (Qe.char ?? "@") === E.current.char
|
|
8684
|
+
) : (Ie.options?.suggestion?.char ?? "@") === E.current.char;
|
|
8685
8685
|
}
|
|
8686
8686
|
)) {
|
|
8687
8687
|
const Ie = U.$from.pos, Be = U.$head?.nodeBefore, Qe = Be ? Od(
|
|
8688
8688
|
Ie,
|
|
8689
8689
|
Be,
|
|
8690
|
-
|
|
8690
|
+
E.current.char
|
|
8691
8691
|
) : U.$from.start(), pa = ve.tr.deleteRange(
|
|
8692
8692
|
Qe,
|
|
8693
8693
|
Ie
|
|
@@ -8713,7 +8713,7 @@ const ko = ({
|
|
|
8713
8713
|
f(null), p(null), C([]), v(""), w(null), d(!1);
|
|
8714
8714
|
}
|
|
8715
8715
|
}),
|
|
8716
|
-
...
|
|
8716
|
+
...E.current
|
|
8717
8717
|
});
|
|
8718
8718
|
return a.registerPlugin(z), () => {
|
|
8719
8719
|
a.isDestroyed || a.unregisterPlugin(l);
|
|
@@ -8856,7 +8856,7 @@ const gi = (e, t, n = ["imageUpload", "horizontalRule"]) => {
|
|
|
8856
8856
|
selectedIndex: t,
|
|
8857
8857
|
onSelect: n
|
|
8858
8858
|
}) => {
|
|
8859
|
-
const o =
|
|
8859
|
+
const o = N(() => {
|
|
8860
8860
|
const r = [];
|
|
8861
8861
|
return e.forEach((l, s) => {
|
|
8862
8862
|
l.context && r.push(
|
|
@@ -8880,7 +8880,7 @@ const gi = (e, t, n = ["imageUpload", "horizontalRule"]) => {
|
|
|
8880
8880
|
style: {
|
|
8881
8881
|
maxHeight: "var(--suggestion-menu-max-height)"
|
|
8882
8882
|
},
|
|
8883
|
-
children: /* @__PURE__ */ i(Xe, { children: /* @__PURE__ */ i(
|
|
8883
|
+
children: /* @__PURE__ */ i(Xe, { children: /* @__PURE__ */ i(Ne, { children: o }) })
|
|
8884
8884
|
}
|
|
8885
8885
|
) : null;
|
|
8886
8886
|
}, mi = et(void 0), bi = () => {
|
|
@@ -8908,7 +8908,7 @@ const gi = (e, t, n = ["imageUpload", "horizontalRule"]) => {
|
|
|
8908
8908
|
a(f);
|
|
8909
8909
|
},
|
|
8910
8910
|
[]
|
|
8911
|
-
), d =
|
|
8911
|
+
), d = N(
|
|
8912
8912
|
() => ({
|
|
8913
8913
|
imageLoadingStatus: s,
|
|
8914
8914
|
onImageLoadingStatusChange: c,
|
|
@@ -9071,7 +9071,7 @@ const Yd = async (e) => {
|
|
|
9071
9071
|
selectedIndex: t,
|
|
9072
9072
|
onSelect: n
|
|
9073
9073
|
}) => {
|
|
9074
|
-
const o =
|
|
9074
|
+
const o = N(() => {
|
|
9075
9075
|
const r = [];
|
|
9076
9076
|
return e.forEach((l, s) => {
|
|
9077
9077
|
r.push(
|
|
@@ -9093,10 +9093,10 @@ const Yd = async (e) => {
|
|
|
9093
9093
|
style: {
|
|
9094
9094
|
maxHeight: "var(--suggestion-menu-max-height)"
|
|
9095
9095
|
},
|
|
9096
|
-
children: /* @__PURE__ */ i(Xe, { children: /* @__PURE__ */ i(
|
|
9096
|
+
children: /* @__PURE__ */ i(Xe, { children: /* @__PURE__ */ i(Ne, { children: o }) })
|
|
9097
9097
|
}
|
|
9098
9098
|
) : null;
|
|
9099
|
-
},
|
|
9099
|
+
}, Eo = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
9100
9100
|
"svg",
|
|
9101
9101
|
{
|
|
9102
9102
|
width: "24",
|
|
@@ -9137,8 +9137,8 @@ const Yd = async (e) => {
|
|
|
9137
9137
|
]
|
|
9138
9138
|
}
|
|
9139
9139
|
));
|
|
9140
|
-
|
|
9141
|
-
const
|
|
9140
|
+
Eo.displayName = "CodeBlockIcon";
|
|
9141
|
+
const No = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
9142
9142
|
"svg",
|
|
9143
9143
|
{
|
|
9144
9144
|
width: "24",
|
|
@@ -9166,7 +9166,7 @@ const Eo = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
|
9166
9166
|
]
|
|
9167
9167
|
}
|
|
9168
9168
|
));
|
|
9169
|
-
|
|
9169
|
+
No.displayName = "HeadingOneIcon";
|
|
9170
9170
|
const Vo = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
9171
9171
|
"svg",
|
|
9172
9172
|
{
|
|
@@ -10036,7 +10036,7 @@ const Dr = {
|
|
|
10036
10036
|
title: "Heading 1",
|
|
10037
10037
|
subtext: "Top-level heading",
|
|
10038
10038
|
keywords: ["h", "heading1", "h1"],
|
|
10039
|
-
badge:
|
|
10039
|
+
badge: No,
|
|
10040
10040
|
group: "Style"
|
|
10041
10041
|
},
|
|
10042
10042
|
heading_2: {
|
|
@@ -10085,7 +10085,7 @@ const Dr = {
|
|
|
10085
10085
|
title: "Code Block",
|
|
10086
10086
|
subtext: "Code block with syntax highlighting",
|
|
10087
10087
|
keywords: ["code", "pre"],
|
|
10088
|
-
badge:
|
|
10088
|
+
badge: Eo,
|
|
10089
10089
|
group: "Style"
|
|
10090
10090
|
},
|
|
10091
10091
|
// Insert
|
|
@@ -10316,7 +10316,7 @@ const Cu = (e) => {
|
|
|
10316
10316
|
onSelect: n,
|
|
10317
10317
|
config: o
|
|
10318
10318
|
}) => {
|
|
10319
|
-
const r =
|
|
10319
|
+
const r = N(() => {
|
|
10320
10320
|
const l = [];
|
|
10321
10321
|
if (!(o?.showGroups !== !1))
|
|
10322
10322
|
return e.forEach((c, d) => {
|
|
@@ -10353,7 +10353,7 @@ const Cu = (e) => {
|
|
|
10353
10353
|
);
|
|
10354
10354
|
});
|
|
10355
10355
|
c ? l.push(
|
|
10356
|
-
/* @__PURE__ */ m(
|
|
10356
|
+
/* @__PURE__ */ m(Ne, { children: [
|
|
10357
10357
|
/* @__PURE__ */ i(gt, { children: c }),
|
|
10358
10358
|
f
|
|
10359
10359
|
] }, `group-${u}-${c}`)
|
|
@@ -10603,12 +10603,12 @@ function Ri(e) {
|
|
|
10603
10603
|
Icon: Si
|
|
10604
10604
|
};
|
|
10605
10605
|
}
|
|
10606
|
-
function
|
|
10606
|
+
function Ei({
|
|
10607
10607
|
shortcutKeys: e = Mn
|
|
10608
10608
|
}) {
|
|
10609
10609
|
return /* @__PURE__ */ i(te, { children: J({ shortcutKeys: e }) });
|
|
10610
10610
|
}
|
|
10611
|
-
const
|
|
10611
|
+
const Ni = V(
|
|
10612
10612
|
({
|
|
10613
10613
|
editor: e,
|
|
10614
10614
|
text: t,
|
|
@@ -10644,13 +10644,13 @@ const Ei = V(
|
|
|
10644
10644
|
children: s ?? /* @__PURE__ */ m(R, { children: [
|
|
10645
10645
|
/* @__PURE__ */ i(g, { className: "tiptap-button-icon" }),
|
|
10646
10646
|
t && /* @__PURE__ */ i("span", { className: "tiptap-button-text", children: t }),
|
|
10647
|
-
r && /* @__PURE__ */ i(
|
|
10647
|
+
r && /* @__PURE__ */ i(Ei, { shortcutKeys: p })
|
|
10648
10648
|
] })
|
|
10649
10649
|
}
|
|
10650
10650
|
) : null;
|
|
10651
10651
|
}
|
|
10652
10652
|
);
|
|
10653
|
-
|
|
10653
|
+
Ni.displayName = "DuplicateButton";
|
|
10654
10654
|
const Mn = "mod+d";
|
|
10655
10655
|
function Vi(e) {
|
|
10656
10656
|
if (!e || !e.isEditable) return !1;
|
|
@@ -11147,7 +11147,7 @@ async function Ru(e, t, n) {
|
|
|
11147
11147
|
return console.error("Failed to copy node ID to clipboard:", s), !1;
|
|
11148
11148
|
}
|
|
11149
11149
|
}
|
|
11150
|
-
function
|
|
11150
|
+
function Eu(e) {
|
|
11151
11151
|
const { editor: t, hideWhenUnavailable: n } = e;
|
|
11152
11152
|
if (!Ki(t)) return !1;
|
|
11153
11153
|
const o = !!wt(t);
|
|
@@ -11164,7 +11164,7 @@ function ji(e) {
|
|
|
11164
11164
|
L(() => {
|
|
11165
11165
|
if (!s) return;
|
|
11166
11166
|
const h = () => {
|
|
11167
|
-
d(
|
|
11167
|
+
d(Eu({ editor: s, hideWhenUnavailable: n }));
|
|
11168
11168
|
};
|
|
11169
11169
|
return h(), s.on("selectionUpdate", h), () => {
|
|
11170
11170
|
s.off("selectionUpdate", h);
|
|
@@ -11197,7 +11197,7 @@ function ji(e) {
|
|
|
11197
11197
|
Icon: Tt
|
|
11198
11198
|
};
|
|
11199
11199
|
}
|
|
11200
|
-
function
|
|
11200
|
+
function Nu({
|
|
11201
11201
|
shortcutKeys: e = Rn
|
|
11202
11202
|
}) {
|
|
11203
11203
|
return /* @__PURE__ */ i(te, { children: J({ shortcutKeys: e }) });
|
|
@@ -11250,7 +11250,7 @@ const Yi = V(
|
|
|
11250
11250
|
children: a ?? /* @__PURE__ */ m(R, { children: [
|
|
11251
11251
|
/* @__PURE__ */ i(b, { className: "tiptap-button-icon" }),
|
|
11252
11252
|
t && /* @__PURE__ */ i("span", { className: "tiptap-button-text", children: t }),
|
|
11253
|
-
l && /* @__PURE__ */ i(
|
|
11253
|
+
l && /* @__PURE__ */ i(Nu, { shortcutKeys: C })
|
|
11254
11254
|
] })
|
|
11255
11255
|
}
|
|
11256
11256
|
) : null;
|
|
@@ -11365,7 +11365,7 @@ function es(e) {
|
|
|
11365
11365
|
};
|
|
11366
11366
|
}
|
|
11367
11367
|
function Ou({
|
|
11368
|
-
shortcutKeys: e =
|
|
11368
|
+
shortcutKeys: e = En
|
|
11369
11369
|
}) {
|
|
11370
11370
|
return /* @__PURE__ */ i(te, { children: J({ shortcutKeys: e }) });
|
|
11371
11371
|
}
|
|
@@ -11424,7 +11424,7 @@ const ts = V(
|
|
|
11424
11424
|
}
|
|
11425
11425
|
);
|
|
11426
11426
|
ts.displayName = "TextButton";
|
|
11427
|
-
const
|
|
11427
|
+
const En = "mod+alt+0";
|
|
11428
11428
|
function qo(e, t = !0) {
|
|
11429
11429
|
return !e || !e.schema.nodes.paragraph ? !1 : t ? Me(e, [
|
|
11430
11430
|
"paragraph",
|
|
@@ -11497,7 +11497,7 @@ function ns(e) {
|
|
|
11497
11497
|
return f && o?.(), f;
|
|
11498
11498
|
}, [r, o]);
|
|
11499
11499
|
return ge(
|
|
11500
|
-
|
|
11500
|
+
En,
|
|
11501
11501
|
(f) => {
|
|
11502
11502
|
f.preventDefault(), u();
|
|
11503
11503
|
},
|
|
@@ -11512,7 +11512,7 @@ function ns(e) {
|
|
|
11512
11512
|
handleToggle: u,
|
|
11513
11513
|
canToggle: c,
|
|
11514
11514
|
label: "Text",
|
|
11515
|
-
shortcutKeys:
|
|
11515
|
+
shortcutKeys: En,
|
|
11516
11516
|
Icon: Zo
|
|
11517
11517
|
};
|
|
11518
11518
|
}
|
|
@@ -11669,7 +11669,7 @@ const is = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
|
11669
11669
|
));
|
|
11670
11670
|
is.displayName = "HeadingSixIcon";
|
|
11671
11671
|
const Wu = {
|
|
11672
|
-
1:
|
|
11672
|
+
1: No,
|
|
11673
11673
|
2: Vo,
|
|
11674
11674
|
3: Bo,
|
|
11675
11675
|
4: rs,
|
|
@@ -11795,7 +11795,7 @@ const Rt = V(
|
|
|
11795
11795
|
label: C,
|
|
11796
11796
|
shortcutKeys: b,
|
|
11797
11797
|
Icon: v
|
|
11798
|
-
} =
|
|
11798
|
+
} = Et({
|
|
11799
11799
|
editor: u,
|
|
11800
11800
|
type: t,
|
|
11801
11801
|
hideWhenUnavailable: o,
|
|
@@ -11941,7 +11941,7 @@ function Qu(e) {
|
|
|
11941
11941
|
const { editor: t, type: n, hideWhenUnavailable: o } = e;
|
|
11942
11942
|
return t ? o ? !t.isEditable || !ne(n, t) ? !1 : t.isActive("code") ? !0 : Go(t, n) : !0 : !1;
|
|
11943
11943
|
}
|
|
11944
|
-
function
|
|
11944
|
+
function Et(e) {
|
|
11945
11945
|
const {
|
|
11946
11946
|
editor: t,
|
|
11947
11947
|
type: n,
|
|
@@ -12247,11 +12247,11 @@ function ps(e) {
|
|
|
12247
12247
|
canToggle: a,
|
|
12248
12248
|
label: "Code Block",
|
|
12249
12249
|
shortcutKeys: hs,
|
|
12250
|
-
Icon:
|
|
12250
|
+
Icon: Eo
|
|
12251
12251
|
};
|
|
12252
12252
|
}
|
|
12253
12253
|
function l7({
|
|
12254
|
-
shortcutKeys: e =
|
|
12254
|
+
shortcutKeys: e = Nn
|
|
12255
12255
|
}) {
|
|
12256
12256
|
return /* @__PURE__ */ i(te, { children: J({ shortcutKeys: e }) });
|
|
12257
12257
|
}
|
|
@@ -12333,7 +12333,7 @@ const Cs = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
|
12333
12333
|
}
|
|
12334
12334
|
));
|
|
12335
12335
|
Cs.displayName = "PlusIcon";
|
|
12336
|
-
const
|
|
12336
|
+
const Nn = "mod+/";
|
|
12337
12337
|
function Qo(e, t, n) {
|
|
12338
12338
|
if (!e || !e.isEditable || ue(e, ["image"])) return !1;
|
|
12339
12339
|
if (t || X(n)) {
|
|
@@ -12404,7 +12404,7 @@ function a7(e) {
|
|
|
12404
12404
|
return p && s?.(r), p;
|
|
12405
12405
|
}, [a, r, n, o, s]);
|
|
12406
12406
|
return ge(
|
|
12407
|
-
|
|
12407
|
+
Nn,
|
|
12408
12408
|
(p) => {
|
|
12409
12409
|
p.preventDefault(), h();
|
|
12410
12410
|
},
|
|
@@ -12419,7 +12419,7 @@ function a7(e) {
|
|
|
12419
12419
|
handleSlashCommand: h,
|
|
12420
12420
|
canInsert: f,
|
|
12421
12421
|
label: "Insert block",
|
|
12422
|
-
shortcutKeys:
|
|
12422
|
+
shortcutKeys: Nn,
|
|
12423
12423
|
trigger: r,
|
|
12424
12424
|
Icon: Cs
|
|
12425
12425
|
};
|
|
@@ -12739,7 +12739,7 @@ const er = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
|
12739
12739
|
));
|
|
12740
12740
|
er.displayName = "Repeat2Icon";
|
|
12741
12741
|
const m7 = () => {
|
|
12742
|
-
const e = ns(), t = kt({ level: 1 }), n = kt({ level: 2 }), o = kt({ level: 3 }), r =
|
|
12742
|
+
const e = ns(), t = kt({ level: 1 }), n = kt({ level: 2 }), o = kt({ level: 3 }), r = Et({ type: "bulletList" }), l = Et({ type: "orderedList" }), s = Et({ type: "taskList" }), a = us(), c = ps(), d = (h) => ({
|
|
12743
12743
|
icon: h.Icon,
|
|
12744
12744
|
label: h.label,
|
|
12745
12745
|
onClick: h.handleToggle,
|
|
@@ -12893,7 +12893,7 @@ const m7 = () => {
|
|
|
12893
12893
|
label: n,
|
|
12894
12894
|
onClick: e,
|
|
12895
12895
|
disabled: !t,
|
|
12896
|
-
shortcutBadge: /* @__PURE__ */ i(
|
|
12896
|
+
shortcutBadge: /* @__PURE__ */ i(Ei, {})
|
|
12897
12897
|
}
|
|
12898
12898
|
),
|
|
12899
12899
|
/* @__PURE__ */ i(
|
|
@@ -12943,10 +12943,10 @@ const m7 = () => {
|
|
|
12943
12943
|
L(() => {
|
|
12944
12944
|
r && (r.commands.setLockDragHandle(a), r.commands.setMeta("lockDragHandle", a));
|
|
12945
12945
|
}, [r, a]);
|
|
12946
|
-
const g = 16, C =
|
|
12946
|
+
const g = 16, C = N(() => ({
|
|
12947
12947
|
middleware: [
|
|
12948
12948
|
tt((y) => {
|
|
12949
|
-
const { rects: S } = y, k = S.reference.height,
|
|
12949
|
+
const { rects: S } = y, k = S.reference.height, E = S.floating.height, D = k / 2 - E / 2;
|
|
12950
12950
|
return {
|
|
12951
12951
|
mainAxis: g,
|
|
12952
12952
|
// if height is more than 40px, then it's likely a block node
|
|
@@ -12956,10 +12956,10 @@ const m7 = () => {
|
|
|
12956
12956
|
]
|
|
12957
12957
|
}), []), b = x(() => {
|
|
12958
12958
|
r && r.commands.setMeta("hideDragHandle", !0);
|
|
12959
|
-
}, [r]), v = x(() => {
|
|
12960
|
-
r && r.commands.setIsDragging(!0);
|
|
12961
|
-
}, [r]), w = x(() => {
|
|
12962
|
-
r && (r.commands.setIsDragging(!1), setTimeout(() => {
|
|
12959
|
+
}, [r]), v = x((y) => {
|
|
12960
|
+
y.stopPropagation(), r && r.commands.setIsDragging(!0);
|
|
12961
|
+
}, [r]), w = x((y) => {
|
|
12962
|
+
y.stopPropagation(), r && (r.commands.setIsDragging(!1), setTimeout(() => {
|
|
12963
12963
|
r.view.dom.blur(), r.view.focus();
|
|
12964
12964
|
}, 0));
|
|
12965
12965
|
}, [r]);
|
|
@@ -13210,7 +13210,7 @@ const Vn = V(
|
|
|
13210
13210
|
children: a,
|
|
13211
13211
|
...c
|
|
13212
13212
|
}, d) => {
|
|
13213
|
-
const { editor: u } = T(e), { isVisible: f, handleAction: h, label: p, canExecute: g, Icon: C, shortcutKeys: b } =
|
|
13213
|
+
const { editor: u } = T(e), { isVisible: f, handleAction: h, label: p, canExecute: g, Icon: C, shortcutKeys: b } = E7({
|
|
13214
13214
|
editor: u,
|
|
13215
13215
|
action: t,
|
|
13216
13216
|
hideWhenUnavailable: o,
|
|
@@ -13317,7 +13317,7 @@ function R7(e) {
|
|
|
13317
13317
|
const { editor: t, hideWhenUnavailable: n, action: o } = e;
|
|
13318
13318
|
return t ? n ? t.isEditable ? t.isActive("code") ? !0 : tr(t, o) : !1 : !0 : !1;
|
|
13319
13319
|
}
|
|
13320
|
-
function
|
|
13320
|
+
function E7(e) {
|
|
13321
13321
|
const {
|
|
13322
13322
|
editor: t,
|
|
13323
13323
|
action: n,
|
|
@@ -13347,7 +13347,7 @@ function N7(e) {
|
|
|
13347
13347
|
Icon: H7[n]
|
|
13348
13348
|
};
|
|
13349
13349
|
}
|
|
13350
|
-
function
|
|
13350
|
+
function N7() {
|
|
13351
13351
|
return /* @__PURE__ */ m("header", { className: "omnibox-editor-header", children: [
|
|
13352
13352
|
/* @__PURE__ */ i(yt, {}),
|
|
13353
13353
|
/* @__PURE__ */ m("div", { className: "omnibox-editor-header__actions", children: [
|
|
@@ -13373,7 +13373,7 @@ const V7 = (e) => {
|
|
|
13373
13373
|
trailing: !0
|
|
13374
13374
|
};
|
|
13375
13375
|
function As(e, t = 250, n = [], o = B7) {
|
|
13376
|
-
const r =
|
|
13376
|
+
const r = N(
|
|
13377
13377
|
() => y1(e, t, o),
|
|
13378
13378
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13379
13379
|
n
|
|
@@ -13460,7 +13460,7 @@ function Hs({
|
|
|
13460
13460
|
]),
|
|
13461
13461
|
useColorValue: n = !1
|
|
13462
13462
|
}) {
|
|
13463
|
-
const { handleRemoveHighlight: o } = Yt({ editor: e }), r = se(), l = Z(null), s =
|
|
13463
|
+
const { handleRemoveHighlight: o } = Yt({ editor: e }), r = se(), l = Z(null), s = N(
|
|
13464
13464
|
() => [...t, { label: "Remove highlight", value: "none" }],
|
|
13465
13465
|
[t]
|
|
13466
13466
|
), { selectedIndex: a } = Xt({
|
|
@@ -13482,7 +13482,7 @@ function Hs({
|
|
|
13482
13482
|
ref: l,
|
|
13483
13483
|
tabIndex: 0,
|
|
13484
13484
|
style: r ? { boxShadow: "none", border: 0 } : {},
|
|
13485
|
-
children: /* @__PURE__ */ i(Xe, { style: r ? { padding: 0 } : {}, children: /* @__PURE__ */ m(
|
|
13485
|
+
children: /* @__PURE__ */ i(Xe, { style: r ? { padding: 0 } : {}, children: /* @__PURE__ */ m(Ne, { orientation: "horizontal", children: [
|
|
13486
13486
|
/* @__PURE__ */ i(Ce, { children: t.map((c, d) => /* @__PURE__ */ i(Ce, { children: /* @__PURE__ */ i(
|
|
13487
13487
|
Je,
|
|
13488
13488
|
{
|
|
@@ -13723,7 +13723,7 @@ const Rs = M(({ className: e, ...t }) => /* @__PURE__ */ i(
|
|
|
13723
13723
|
}
|
|
13724
13724
|
));
|
|
13725
13725
|
Rs.displayName = "CornerDownLeftIcon";
|
|
13726
|
-
const
|
|
13726
|
+
const Es = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
13727
13727
|
"svg",
|
|
13728
13728
|
{
|
|
13729
13729
|
width: "24",
|
|
@@ -13751,7 +13751,7 @@ const Ns = M(({ className: e, ...t }) => /* @__PURE__ */ m(
|
|
|
13751
13751
|
]
|
|
13752
13752
|
}
|
|
13753
13753
|
));
|
|
13754
|
-
|
|
13754
|
+
Es.displayName = "ExternalLinkIcon";
|
|
13755
13755
|
const lr = V(
|
|
13756
13756
|
({ className: e, children: t, ...n }, o) => /* @__PURE__ */ i(
|
|
13757
13757
|
H,
|
|
@@ -13770,7 +13770,7 @@ const lr = V(
|
|
|
13770
13770
|
)
|
|
13771
13771
|
);
|
|
13772
13772
|
lr.displayName = "LinkButton";
|
|
13773
|
-
const
|
|
13773
|
+
const Ns = ({
|
|
13774
13774
|
url: e,
|
|
13775
13775
|
setUrl: t,
|
|
13776
13776
|
setLink: n,
|
|
@@ -13793,7 +13793,7 @@ const Es = ({
|
|
|
13793
13793
|
style: {
|
|
13794
13794
|
...s ? { padding: 0 } : {}
|
|
13795
13795
|
},
|
|
13796
|
-
children: /* @__PURE__ */ m(
|
|
13796
|
+
children: /* @__PURE__ */ m(Ne, { orientation: "horizontal", children: [
|
|
13797
13797
|
/* @__PURE__ */ i(
|
|
13798
13798
|
Zc,
|
|
13799
13799
|
{
|
|
@@ -13830,7 +13830,7 @@ const Es = ({
|
|
|
13830
13830
|
title: "Open in new window",
|
|
13831
13831
|
disabled: !e && !l,
|
|
13832
13832
|
variant: "ghost",
|
|
13833
|
-
children: /* @__PURE__ */ i(
|
|
13833
|
+
children: /* @__PURE__ */ i(Es, { className: "tiptap-button-icon" })
|
|
13834
13834
|
}
|
|
13835
13835
|
) }),
|
|
13836
13836
|
/* @__PURE__ */ i(Ce, { children: /* @__PURE__ */ i(
|
|
@@ -13854,7 +13854,7 @@ const Es = ({
|
|
|
13854
13854
|
const t = Bs({
|
|
13855
13855
|
editor: e
|
|
13856
13856
|
});
|
|
13857
|
-
return /* @__PURE__ */ i(
|
|
13857
|
+
return /* @__PURE__ */ i(Ns, { ...t });
|
|
13858
13858
|
}, ir = V(
|
|
13859
13859
|
({
|
|
13860
13860
|
editor: e,
|
|
@@ -13886,7 +13886,7 @@ const Es = ({
|
|
|
13886
13886
|
f(ie), o?.(ie);
|
|
13887
13887
|
},
|
|
13888
13888
|
[o]
|
|
13889
|
-
),
|
|
13889
|
+
), E = x(() => {
|
|
13890
13890
|
v(), f(!1);
|
|
13891
13891
|
}, [v]), D = x(
|
|
13892
13892
|
(ie) => {
|
|
@@ -13912,11 +13912,11 @@ const Es = ({
|
|
|
13912
13912
|
}
|
|
13913
13913
|
) }),
|
|
13914
13914
|
/* @__PURE__ */ i(en, { collisionPadding: 4, children: /* @__PURE__ */ i(
|
|
13915
|
-
|
|
13915
|
+
Ns,
|
|
13916
13916
|
{
|
|
13917
13917
|
url: C,
|
|
13918
13918
|
setUrl: b,
|
|
13919
|
-
setLink:
|
|
13919
|
+
setLink: E,
|
|
13920
13920
|
removeLink: w,
|
|
13921
13921
|
openLink: I,
|
|
13922
13922
|
isActive: g
|
|
@@ -13940,7 +13940,7 @@ function Vs(e) {
|
|
|
13940
13940
|
function W7(e) {
|
|
13941
13941
|
const { editor: t, hideWhenUnavailable: n } = e;
|
|
13942
13942
|
if (!t || !t.isEditable) return !1;
|
|
13943
|
-
const o =
|
|
13943
|
+
const o = Ee("link", t);
|
|
13944
13944
|
return n ? o ? t.isActive("code") ? !0 : sr(t) : !1 : !0;
|
|
13945
13945
|
}
|
|
13946
13946
|
function F7(e) {
|
|
@@ -14318,7 +14318,7 @@ const q7 = {
|
|
|
14318
14318
|
subscript: "mod+,"
|
|
14319
14319
|
};
|
|
14320
14320
|
function ln(e, t) {
|
|
14321
|
-
return !e || !e.isEditable || !
|
|
14321
|
+
return !e || !e.isEditable || !Ee(t, e) || ue(e, ["image"]) ? !1 : e.can().toggleMark(t);
|
|
14322
14322
|
}
|
|
14323
14323
|
function G7(e, t) {
|
|
14324
14324
|
return !e || !e.isEditable ? !1 : e.isActive(t);
|
|
@@ -14328,7 +14328,7 @@ function j7(e, t) {
|
|
|
14328
14328
|
}
|
|
14329
14329
|
function Y7(e) {
|
|
14330
14330
|
const { editor: t, type: n, hideWhenUnavailable: o } = e;
|
|
14331
|
-
return t ? o ? !t.isEditable || !
|
|
14331
|
+
return t ? o ? !t.isEditable || !Ee(n, t) ? !1 : t.isActive("code") ? !0 : ln(t, n) : !0 : !1;
|
|
14332
14332
|
}
|
|
14333
14333
|
function X7(e) {
|
|
14334
14334
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
@@ -15337,16 +15337,16 @@ const Ht = {
|
|
|
15337
15337
|
right: 0,
|
|
15338
15338
|
bottom: 0,
|
|
15339
15339
|
left: 0
|
|
15340
|
-
}, la = typeof window > "u", A4 = !la && typeof ResizeObserver < "u",
|
|
15340
|
+
}, la = typeof window > "u", A4 = !la && typeof ResizeObserver < "u", Nt = () => !la;
|
|
15341
15341
|
function M4({
|
|
15342
15342
|
element: e,
|
|
15343
15343
|
enabled: t = !0,
|
|
15344
15344
|
throttleMs: n = 100,
|
|
15345
15345
|
useResizeObserver: o = !0
|
|
15346
15346
|
} = {}) {
|
|
15347
|
-
const [r, l] = A(Ht), s = x(() => !t || !
|
|
15347
|
+
const [r, l] = A(Ht), s = x(() => !t || !Nt() ? null : e ? typeof e == "string" ? document.querySelector(e) : "current" in e ? e.current : e : document.body, [e, t]), a = As(
|
|
15348
15348
|
() => {
|
|
15349
|
-
if (!t || !
|
|
15349
|
+
if (!t || !Nt()) return;
|
|
15350
15350
|
const c = s();
|
|
15351
15351
|
if (!c) {
|
|
15352
15352
|
l(Ht);
|
|
@@ -15369,7 +15369,7 @@ function M4({
|
|
|
15369
15369
|
{ leading: !0, trailing: !0 }
|
|
15370
15370
|
);
|
|
15371
15371
|
return L(() => {
|
|
15372
|
-
if (!t || !
|
|
15372
|
+
if (!t || !Nt()) {
|
|
15373
15373
|
l(Ht);
|
|
15374
15374
|
return;
|
|
15375
15375
|
}
|
|
@@ -15394,7 +15394,7 @@ function M4({
|
|
|
15394
15394
|
function S4(e = {}) {
|
|
15395
15395
|
return M4({
|
|
15396
15396
|
...e,
|
|
15397
|
-
element:
|
|
15397
|
+
element: Nt() ? document.body : null
|
|
15398
15398
|
});
|
|
15399
15399
|
}
|
|
15400
15400
|
function H4({
|
|
@@ -15609,7 +15609,7 @@ const Un = {
|
|
|
15609
15609
|
left: aa,
|
|
15610
15610
|
center: ia,
|
|
15611
15611
|
right: sa
|
|
15612
|
-
},
|
|
15612
|
+
}, E4 = {
|
|
15613
15613
|
left: "Image align left",
|
|
15614
15614
|
center: "Image align center",
|
|
15615
15615
|
right: "Image align right"
|
|
@@ -15617,7 +15617,7 @@ const Un = {
|
|
|
15617
15617
|
function cr(e, t, n = "image", o = "data-align") {
|
|
15618
15618
|
return !e || !e.isEditable || !O(e, [n]) ? !1 : e.can().updateAttributes(n, { [o]: t });
|
|
15619
15619
|
}
|
|
15620
|
-
function
|
|
15620
|
+
function N4(e, t, n = "image", o = "data-align") {
|
|
15621
15621
|
return !e || !e.isEditable || !O(e, [n]) ? !1 : (e.getAttributes(n)[o] || "left") === t;
|
|
15622
15622
|
}
|
|
15623
15623
|
function V4(e, t, n = "image", o = "data-align") {
|
|
@@ -15648,7 +15648,7 @@ function D4(e) {
|
|
|
15648
15648
|
attributeName: r = "data-align",
|
|
15649
15649
|
hideWhenUnavailable: l = !1,
|
|
15650
15650
|
onAligned: s
|
|
15651
|
-
} = e, { editor: a } = T(t), c = se(), [d, u] = A(!0), f = cr(a, n, o, r), h =
|
|
15651
|
+
} = e, { editor: a } = T(t), c = se(), [d, u] = A(!0), f = cr(a, n, o, r), h = N4(
|
|
15652
15652
|
a,
|
|
15653
15653
|
n,
|
|
15654
15654
|
o,
|
|
@@ -15691,7 +15691,7 @@ function D4(e) {
|
|
|
15691
15691
|
isActive: h,
|
|
15692
15692
|
handleImageAlign: p,
|
|
15693
15693
|
canAlign: f,
|
|
15694
|
-
label:
|
|
15694
|
+
label: E4[n],
|
|
15695
15695
|
shortcutKeys: Un[n],
|
|
15696
15696
|
Icon: R4[n]
|
|
15697
15697
|
};
|
|
@@ -16081,7 +16081,7 @@ function Y4({ editor: e }) {
|
|
|
16081
16081
|
] }),
|
|
16082
16082
|
/* @__PURE__ */ i(oe, { orientation: "horizontal" }),
|
|
16083
16083
|
/* @__PURE__ */ m(Fe, { children: [
|
|
16084
|
-
/* @__PURE__ */ i(pe, { asChild: !0, children: /* @__PURE__ */ i(
|
|
16084
|
+
/* @__PURE__ */ i(pe, { asChild: !0, children: /* @__PURE__ */ i(Ni, { text: "Duplicate node", showShortcut: !t }) }),
|
|
16085
16085
|
/* @__PURE__ */ i(pe, { asChild: !0, children: /* @__PURE__ */ i(
|
|
16086
16086
|
Ui,
|
|
16087
16087
|
{
|
|
@@ -16192,7 +16192,7 @@ function t5({
|
|
|
16192
16192
|
] });
|
|
16193
16193
|
}
|
|
16194
16194
|
function n5({ editor: e }) {
|
|
16195
|
-
const { editor: t } = T(e), n = se("max", 480), o = Z(null), r = $4(n), l =
|
|
16195
|
+
const { editor: t } = T(e), n = se("max", 480), o = Z(null), r = $4(n), l = N(() => W4(), []), s = r.isMainView ? null : l[r.viewId], { height: a } = Ms(), c = H4({
|
|
16196
16196
|
editor: t,
|
|
16197
16197
|
overlayHeight: o.current?.getBoundingClientRect().height ?? 0
|
|
16198
16198
|
});
|
|
@@ -16257,9 +16257,9 @@ const ha = V(
|
|
|
16257
16257
|
y.view.dispatch(B);
|
|
16258
16258
|
}
|
|
16259
16259
|
S(z);
|
|
16260
|
-
},
|
|
16260
|
+
}, E = N(() => l || (() => w.current ? I.current(w.current) : null), [l]), { isMounted: D, ref: ie, style: $, getFloatingProps: G } = pi(
|
|
16261
16261
|
p,
|
|
16262
|
-
|
|
16262
|
+
E,
|
|
16263
16263
|
o,
|
|
16264
16264
|
{
|
|
16265
16265
|
placement: "top",
|
|
@@ -16343,7 +16343,7 @@ const ha = V(
|
|
|
16343
16343
|
}, [y, _]), L(() => {
|
|
16344
16344
|
y && _();
|
|
16345
16345
|
}, [y, _]);
|
|
16346
|
-
const K =
|
|
16346
|
+
const K = N(
|
|
16347
16347
|
() => u && Object.keys(u).length > 0 ? u : $,
|
|
16348
16348
|
[u, $]
|
|
16349
16349
|
), ce = zn([ie, h, C]);
|
|
@@ -16369,7 +16369,7 @@ const zr = (e, t) => {
|
|
|
16369
16369
|
["[data-radix-popper-content-wrapper]", "[data-base-ui-portal]"].join(",")
|
|
16370
16370
|
) !== null : !1;
|
|
16371
16371
|
function o5() {
|
|
16372
|
-
const { editor: e } = T(), t = se("max", 480), { lockDragHandle: n, commentInputVisible: o } = Gn(e), { shouldShow: r } =
|
|
16372
|
+
const { editor: e } = T(), t = se("max", 480), { lockDragHandle: n, commentInputVisible: o } = Gn(e), { shouldShow: r } = N1({
|
|
16373
16373
|
editor: e,
|
|
16374
16374
|
isSelectionValid: gi,
|
|
16375
16375
|
extraHideWhen: !!o
|
|
@@ -16484,29 +16484,29 @@ function s5({
|
|
|
16484
16484
|
topOffset: n = 0,
|
|
16485
16485
|
...o
|
|
16486
16486
|
}) {
|
|
16487
|
-
const { tocContent: r, navigateToHeading: l, normalizeHeadingDepths: s } = Qn(), a = Z(!1), c = Z(null), [d, u] = A(null), f =
|
|
16487
|
+
const { tocContent: r, navigateToHeading: l, normalizeHeadingDepths: s } = Qn(), a = Z(!1), c = Z(null), [d, u] = A(null), f = N(
|
|
16488
16488
|
() => r ?? [],
|
|
16489
16489
|
[r]
|
|
16490
|
-
), h =
|
|
16490
|
+
), h = N(
|
|
16491
16491
|
() => f.slice(0, t),
|
|
16492
16492
|
[f, t]
|
|
16493
|
-
), p =
|
|
16493
|
+
), p = N(
|
|
16494
16494
|
() => s(h),
|
|
16495
16495
|
[h, s]
|
|
16496
|
-
), g =
|
|
16496
|
+
), g = N(() => {
|
|
16497
16497
|
const k = /* @__PURE__ */ new Map();
|
|
16498
|
-
return h.forEach((
|
|
16499
|
-
k.set(
|
|
16498
|
+
return h.forEach((E, D) => {
|
|
16499
|
+
k.set(E.id, p[D] ?? 1);
|
|
16500
16500
|
}), k;
|
|
16501
|
-
}, [h, p]), C =
|
|
16501
|
+
}, [h, p]), C = N(
|
|
16502
16502
|
() => [...f].reverse().find((k) => k.isActive) ?? null,
|
|
16503
16503
|
[f]
|
|
16504
|
-
), b =
|
|
16504
|
+
), b = N(
|
|
16505
16505
|
() => f.find((k) => k.isActive)?.id ?? null,
|
|
16506
16506
|
[f]
|
|
16507
|
-
), v =
|
|
16508
|
-
(k,
|
|
16509
|
-
k.preventDefault(), k.stopPropagation(), u(
|
|
16507
|
+
), v = N(() => d || (C?.id ? C.id : b || f[0]?.id), [d, C, b, f]), w = x(
|
|
16508
|
+
(k, E) => {
|
|
16509
|
+
k.preventDefault(), k.stopPropagation(), u(E.id), c.current = Date.now(), l(E, { topOffset: n });
|
|
16510
16510
|
},
|
|
16511
16511
|
[l, n]
|
|
16512
16512
|
);
|
|
@@ -16515,8 +16515,8 @@ function s5({
|
|
|
16515
16515
|
return;
|
|
16516
16516
|
const k = window.location.hash.replace(/^#/, "");
|
|
16517
16517
|
if (!k) return;
|
|
16518
|
-
const
|
|
16519
|
-
|
|
16518
|
+
const E = f.find((D) => D.id === k);
|
|
16519
|
+
E && (u(E.id), a.current = !0);
|
|
16520
16520
|
}, [f]);
|
|
16521
16521
|
const I = Z(null), y = Z(d);
|
|
16522
16522
|
y.current = d, L(() => {
|
|
@@ -16524,15 +16524,15 @@ function s5({
|
|
|
16524
16524
|
const k = () => {
|
|
16525
16525
|
const D = Date.now(), ie = c.current;
|
|
16526
16526
|
ie && D - ie < 500 || y.current !== null && u(null);
|
|
16527
|
-
},
|
|
16528
|
-
return window.addEventListener("scroll", k, { passive: !0 }),
|
|
16529
|
-
window.removeEventListener("scroll", k),
|
|
16527
|
+
}, E = I.current ? dl(I.current) : null;
|
|
16528
|
+
return window.addEventListener("scroll", k, { passive: !0 }), E && !(E instanceof Window) && E.addEventListener("scroll", k, { passive: !0 }), () => {
|
|
16529
|
+
window.removeEventListener("scroll", k), E && !(E instanceof Window) && E.removeEventListener("scroll", k);
|
|
16530
16530
|
};
|
|
16531
16531
|
}, []);
|
|
16532
16532
|
const S = f.length > 0;
|
|
16533
16533
|
return /* @__PURE__ */ i("div", { ref: I, className: P("toc-sidebar", e), ...o, children: /* @__PURE__ */ i("div", { className: "toc-sidebar-wrapper", children: /* @__PURE__ */ m("div", { className: "toc-sidebar-inner", children: [
|
|
16534
16534
|
/* @__PURE__ */ i("div", { className: "toc-sidebar-progress", children: h.map((k) => {
|
|
16535
|
-
const
|
|
16535
|
+
const E = g.get(k.id) ?? 1, D = v === k.id;
|
|
16536
16536
|
return /* @__PURE__ */ i(
|
|
16537
16537
|
"div",
|
|
16538
16538
|
{
|
|
@@ -16540,8 +16540,8 @@ function s5({
|
|
|
16540
16540
|
"toc-sidebar-progress-line",
|
|
16541
16541
|
D && "toc-sidebar-progress-line--active"
|
|
16542
16542
|
),
|
|
16543
|
-
"data-depth":
|
|
16544
|
-
style: { "--toc-depth":
|
|
16543
|
+
"data-depth": E,
|
|
16544
|
+
style: { "--toc-depth": E }
|
|
16545
16545
|
},
|
|
16546
16546
|
k.id
|
|
16547
16547
|
);
|
|
@@ -16555,7 +16555,7 @@ function s5({
|
|
|
16555
16555
|
),
|
|
16556
16556
|
"aria-label": "Table of contents",
|
|
16557
16557
|
children: /* @__PURE__ */ i("div", { className: "toc-sidebar-popover", children: h.map((k) => {
|
|
16558
|
-
const
|
|
16558
|
+
const E = g.get(k.id) ?? 1, D = v === k.id;
|
|
16559
16559
|
return /* @__PURE__ */ i(
|
|
16560
16560
|
"a",
|
|
16561
16561
|
{
|
|
@@ -16565,8 +16565,8 @@ function s5({
|
|
|
16565
16565
|
"toc-sidebar-item notranslate",
|
|
16566
16566
|
D && "toc-sidebar-item--active"
|
|
16567
16567
|
),
|
|
16568
|
-
"data-depth":
|
|
16569
|
-
style: { "--toc-depth":
|
|
16568
|
+
"data-depth": E,
|
|
16569
|
+
style: { "--toc-depth": E },
|
|
16570
16570
|
onClick: (ie) => w(ie, k),
|
|
16571
16571
|
"aria-current": D ? "location" : void 0,
|
|
16572
16572
|
children: k.textContent
|
|
@@ -16848,7 +16848,15 @@ function g5({ text: e = "Connecting..." }) {
|
|
|
16848
16848
|
}
|
|
16849
16849
|
function m5() {
|
|
16850
16850
|
const { editor: e } = De(Zn), { isDragging: t } = Gn(e);
|
|
16851
|
-
return V1(),
|
|
16851
|
+
return V1(), L(() => {
|
|
16852
|
+
if (!e) return;
|
|
16853
|
+
const n = (o) => {
|
|
16854
|
+
e.storage.uiState?.isDragging && o.stopPropagation();
|
|
16855
|
+
};
|
|
16856
|
+
return document.addEventListener("dragenter", n), document.addEventListener("dragover", n), document.addEventListener("dragleave", n), document.addEventListener("drop", n), () => {
|
|
16857
|
+
document.removeEventListener("dragenter", n), document.removeEventListener("dragover", n), document.removeEventListener("dragleave", n), document.removeEventListener("drop", n);
|
|
16858
|
+
};
|
|
16859
|
+
}, [e]), e ? /* @__PURE__ */ m(
|
|
16852
16860
|
Ia,
|
|
16853
16861
|
{
|
|
16854
16862
|
editor: e,
|
|
@@ -16911,7 +16919,7 @@ function b5(e) {
|
|
|
16911
16919
|
}),
|
|
16912
16920
|
B1,
|
|
16913
16921
|
Ua.configure({ types: ["heading", "paragraph"] }),
|
|
16914
|
-
|
|
16922
|
+
Ea.configure({
|
|
16915
16923
|
placeholder: n,
|
|
16916
16924
|
emptyNodeClass: "is-empty with-slash"
|
|
16917
16925
|
}),
|
|
@@ -16959,7 +16967,7 @@ function b5(e) {
|
|
|
16959
16967
|
p(w);
|
|
16960
16968
|
}
|
|
16961
16969
|
}),
|
|
16962
|
-
|
|
16970
|
+
Ec,
|
|
16963
16971
|
a5,
|
|
16964
16972
|
f5,
|
|
16965
16973
|
rc.configure({
|
|
@@ -16983,7 +16991,7 @@ function b5(e) {
|
|
|
16983
16991
|
"tocNode"
|
|
16984
16992
|
]
|
|
16985
16993
|
}),
|
|
16986
|
-
|
|
16994
|
+
Na,
|
|
16987
16995
|
x1,
|
|
16988
16996
|
G1.configure({
|
|
16989
16997
|
topOffset: 48
|
|
@@ -16999,7 +17007,7 @@ function b5(e) {
|
|
|
16999
17007
|
g ? "omnibox-editor-wrapper--embedded" : "omnibox-editor-wrapper--page"
|
|
17000
17008
|
),
|
|
17001
17009
|
children: /* @__PURE__ */ m(Zn.Provider, { value: { editor: v }, children: [
|
|
17002
|
-
C ? /* @__PURE__ */ i(
|
|
17010
|
+
C ? /* @__PURE__ */ i(N7, {}) : null,
|
|
17003
17011
|
/* @__PURE__ */ m(
|
|
17004
17012
|
"div",
|
|
17005
17013
|
{
|
|
@@ -17065,5 +17073,6 @@ function n0({
|
|
|
17065
17073
|
) });
|
|
17066
17074
|
}
|
|
17067
17075
|
export {
|
|
17076
|
+
n0 as CvnertEditor,
|
|
17068
17077
|
n0 as OmniboxEditor
|
|
17069
17078
|
};
|