reactjs-tiptap-editor 0.1.15 → 0.2.0
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/lib/{RichTextEditor-CqUsKvdf.js → RichTextEditor-CC602P8F.js} +951 -749
- package/lib/RichTextEditor-abeFC8IX.cjs +138 -0
- package/lib/extension-bundle.cjs +2 -2
- package/lib/extension-bundle.d.cts +52 -69
- package/lib/extension-bundle.d.ts +52 -69
- package/lib/extension-bundle.js +4782 -4564
- package/lib/{index-BQSRMhtZ.js → index-C0LiugNd.js} +4 -2
- package/lib/{index-CHZh3C0I.cjs → index-D9RG-bm0.cjs} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +52 -67
- package/lib/index.d.ts +52 -67
- package/lib/index.js +2 -2
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +51 -66
- package/lib/locale-bundle.d.ts +51 -66
- package/lib/locale-bundle.js +1 -1
- package/lib/style.css +1 -1
- package/lib/{tiptap-CB5MO02_.js → tiptap-BAutNX9u.js} +727 -726
- package/lib/{tiptap-DkTOfBkj.cjs → tiptap-ktk3za0X.cjs} +12 -12
- package/lib/vendor-CFOlvngC.js +60442 -0
- package/lib/vendor-CY5IU8Xa.cjs +457 -0
- package/package.json +63 -65
- package/lib/RichTextEditor-BFCJg7ap.cjs +0 -138
- package/lib/vendor-BH8HYOJ4.cjs +0 -354
- package/lib/vendor-DiKgVtSS.js +0 -49042
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { jsxs as u, jsx as i, Fragment as _ } from "react/jsx-runtime";
|
|
2
2
|
import * as E from "react";
|
|
3
3
|
import Oe, { useState as w, useCallback as C, useEffect as I, useRef as nt, useMemo as P, Fragment as _e, forwardRef as Si, useImperativeHandle as Ai } from "react";
|
|
4
|
-
import { f as
|
|
5
|
-
import { u as V, m as _i, I as Ot, f as _t, g as Pe, C as Hi, h as Z, B as Pi, i as Ht, V as fe, E as Di } from "./index-
|
|
4
|
+
import { f as Rt, N as dt, m as it, i as Mi, a as ut, R as xt, n as ce, I as He, b as me, c as Li, B as Y, d as Ii, D as Ei, e as zi, u as Ri, E as Oi } from "./tiptap-BAutNX9u.js";
|
|
5
|
+
import { u as V, m as _i, I as Ot, f as _t, g as Pe, C as Hi, h as Z, B as Pi, i as Ht, V as fe, E as Di } from "./index-C0LiugNd.js";
|
|
6
6
|
import * as De from "@radix-ui/react-separator";
|
|
7
|
-
import { ap as Bi, aq as Pt, ao as Be, ar as $e, as as Vt, at as Ve, T as bt, N as $i, A as Vi, au as We, av as Wi, aw as ge, ax as wt, ay as ji, az as je,
|
|
7
|
+
import { ap as Bi, aq as Pt, ao as Be, ar as $e, as as Vt, at as Ve, T as bt, N as $i, A as Vi, au as We, av as Wi, aw as ge, ax as wt, ay as ji, az as je, aA as Fi, H as Wt, aB as Gi, aC as Ui } from "./vendor-CFOlvngC.js";
|
|
8
8
|
import * as X from "@radix-ui/react-toast";
|
|
9
|
-
import { ChevronRight as
|
|
9
|
+
import { ChevronRight as Ki, Check as Zi, Circle as Xi, X as Fe, FlipHorizontal as qi, FlipVertical as Yi, CropIcon as Ji, ChevronUp as Qi, Paperclip as tr, Eye as er, Settings as ir, ZoomOut as rr, ZoomIn as nr, BookMarked as cr, Sigma as ar, SmilePlusIcon as or, Replace as pe, SmilePlus as sr, Frame as lr, Columns2 as we, PanelRight as hr, PanelLeft as dr, Clipboard as ur, Copy as xr, GripVertical as mr, Plus as Ge, Columns4 as fr, Columns3 as gr, Heading6 as pr, Heading5 as wr, Heading4 as vr, Heading3 as br, Heading2 as yr, Heading1 as Cr, ChevronsUpDown as Nr, Trash as Tr, Trash2 as Ue, TableCellsSplit as kr, TableCellsMerge as Sr, BetweenVerticalEnd as Ar, BetweenVerticalStart as Mr, BetweenHorizonalStart as Lr, BetweenHorizonalEnd as Ir, Unlink as Er, Pencil as Ke, Sparkles as zr, Table as Rr, Minimize as Or, Maximize as _r, Video as Hr, ImageUp as Pr, Link as Dr, ListTodo as Br, ListOrdered as $r, List as Vr, IndentDecrease as Wr, IndentIncrease as jr, Type as Fr, CodeXml as Gr, Code as Ur, Superscript as Kr, Subscript as Zr, ChevronDown as Xr, Undo2 as qr, Redo2 as Yr, PaintRoller as Jr, Eraser as Qr, Minus as tn, Strikethrough as en, Quote as rn, Underline as nn, Italic as cn, LoaderCircle as an, Bold as on, HelpCircle as Ze } from "lucide-react";
|
|
10
10
|
import * as yt from "@radix-ui/react-tooltip";
|
|
11
11
|
import ae from "katex";
|
|
12
12
|
import { Slot as Xe } from "@radix-ui/react-slot";
|
|
13
13
|
import * as qe from "@radix-ui/react-toggle";
|
|
14
|
-
import { TextAlignRightIcon as
|
|
14
|
+
import { TextAlignRightIcon as sn, TextAlignLeftIcon as ln, TextAlignJustifyIcon as hn, TextAlignCenterIcon as dn } from "@radix-ui/react-icons";
|
|
15
15
|
import * as vt from "@radix-ui/react-popover";
|
|
16
16
|
import * as Ye from "@radix-ui/react-label";
|
|
17
|
-
import { Resizable as Je } from "re-resizable";
|
|
18
17
|
import * as q from "@radix-ui/react-dialog";
|
|
18
|
+
import { Resizable as Je } from "re-resizable";
|
|
19
19
|
import Dt from "mermaid";
|
|
20
20
|
import { flushSync as Bt } from "react-dom";
|
|
21
|
-
import { Tweet as dn } from "react-tweet";
|
|
22
21
|
import { sticky as un } from "tippy.js";
|
|
23
22
|
import { HexColorPicker as xn } from "react-colorful";
|
|
24
23
|
import * as Yt from "@radix-ui/react-switch";
|
|
25
24
|
import * as D from "@radix-ui/react-dropdown-menu";
|
|
25
|
+
function L(...t) {
|
|
26
|
+
return Bi(Pt(t));
|
|
27
|
+
}
|
|
26
28
|
let Gt;
|
|
27
29
|
function Ut() {
|
|
28
30
|
return Gt === void 0 && (Gt = navigator.platform.includes("Mac")), Gt;
|
|
@@ -33,9 +35,6 @@ function mn(t) {
|
|
|
33
35
|
function fn(t) {
|
|
34
36
|
return t.map(mn).join(" ");
|
|
35
37
|
}
|
|
36
|
-
function L(...t) {
|
|
37
|
-
return Bi(Pt(t));
|
|
38
|
-
}
|
|
39
38
|
const v = Oe.forwardRef(
|
|
40
39
|
(t, e) => {
|
|
41
40
|
const {
|
|
@@ -59,26 +58,34 @@ const v = Oe.forwardRef(
|
|
|
59
58
|
/* @__PURE__ */ i(di, { asChild: !0, children: /* @__PURE__ */ u(
|
|
60
59
|
m ? Xe : li,
|
|
61
60
|
{
|
|
61
|
+
"data-state": d != null && d() ? "on" : "off",
|
|
62
|
+
onClick: h,
|
|
62
63
|
ref: e,
|
|
63
64
|
size: "sm",
|
|
64
65
|
className: L("richtext-w-[32px] richtext-h-[32px]", c),
|
|
65
66
|
disabled: a,
|
|
66
|
-
onClick: h,
|
|
67
|
-
"data-state": d != null && d() ? "on" : "off",
|
|
68
67
|
...p,
|
|
69
68
|
children: [
|
|
70
|
-
b && /* @__PURE__ */ i(b, { className: "richtext-
|
|
69
|
+
b && /* @__PURE__ */ i(b, { className: "richtext-size-4" }),
|
|
71
70
|
x
|
|
72
71
|
]
|
|
73
72
|
}
|
|
74
73
|
) }),
|
|
75
|
-
n && /* @__PURE__ */ i(oe, { ...l, children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center
|
|
74
|
+
n && /* @__PURE__ */ i(oe, { ...l, children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
|
|
76
75
|
/* @__PURE__ */ i("div", { children: n }),
|
|
77
76
|
!!(s != null && s.length) && /* @__PURE__ */ i("span", { children: fn(s) })
|
|
78
77
|
] }) })
|
|
79
78
|
] });
|
|
80
79
|
}
|
|
81
|
-
);
|
|
80
|
+
), Qe = Be(!1);
|
|
81
|
+
function gn() {
|
|
82
|
+
return $e(Qe);
|
|
83
|
+
}
|
|
84
|
+
const pn = {
|
|
85
|
+
setDisable: (t) => {
|
|
86
|
+
Qe(t);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
82
89
|
function Ct(t, e) {
|
|
83
90
|
const { state: r } = e, n = r.selection.$anchor;
|
|
84
91
|
let a = !1;
|
|
@@ -98,23 +105,14 @@ function Ct(t, e) {
|
|
|
98
105
|
}
|
|
99
106
|
return a;
|
|
100
107
|
}
|
|
101
|
-
const Qe = Be(!1);
|
|
102
|
-
function gn() {
|
|
103
|
-
return $e(Qe);
|
|
104
|
-
}
|
|
105
|
-
const pn = {
|
|
106
|
-
setDisable: (t) => {
|
|
107
|
-
Qe(t);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
108
|
function ti(t, e, r) {
|
|
111
109
|
return t < e ? e : t > r ? r : t;
|
|
112
110
|
}
|
|
113
111
|
const wn = (t) => typeof t == "number", vn = (t) => typeof t == "string", bn = (t) => typeof t == "function";
|
|
114
|
-
function
|
|
112
|
+
function uo(t, e = "px") {
|
|
115
113
|
if (!t)
|
|
116
114
|
return t;
|
|
117
|
-
const r = wn(t) ? String(t) : t, n = Number.parseFloat(r), a = r.match(/[a-z
|
|
115
|
+
const r = wn(t) ? String(t) : t, n = Number.parseFloat(r), a = r.match(/[%a-z]+$/i), c = a ? a[0] : e;
|
|
118
116
|
return Number.isNaN(n) ? t : n + c;
|
|
119
117
|
}
|
|
120
118
|
function yn(t, e) {
|
|
@@ -123,7 +121,7 @@ function yn(t, e) {
|
|
|
123
121
|
const { extensions: r = [] } = (t == null ? void 0 : t.extensionManager) ?? {};
|
|
124
122
|
return !!r.find((a) => a.name === e);
|
|
125
123
|
}
|
|
126
|
-
function
|
|
124
|
+
function xo(t) {
|
|
127
125
|
return t.map((e) => vn(e) ? { value: e, name: e } : e);
|
|
128
126
|
}
|
|
129
127
|
const Cn = Vt(
|
|
@@ -173,7 +171,7 @@ const Nn = D.Root, Tn = D.Trigger, ve = D.Portal, be = D.Sub, Jt = E.forwardRef(
|
|
|
173
171
|
...n,
|
|
174
172
|
children: [
|
|
175
173
|
r,
|
|
176
|
-
/* @__PURE__ */ i(
|
|
174
|
+
/* @__PURE__ */ i(Ki, { className: "richtext-ml-auto richtext-h-4 richtext-w-4" })
|
|
177
175
|
]
|
|
178
176
|
}
|
|
179
177
|
));
|
|
@@ -227,7 +225,7 @@ const kn = E.forwardRef(({ className: t, children: e, checked: r, ...n }, a) =>
|
|
|
227
225
|
checked: r,
|
|
228
226
|
...n,
|
|
229
227
|
children: [
|
|
230
|
-
/* @__PURE__ */ i("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ i(D.ItemIndicator, { children: /* @__PURE__ */ i(
|
|
228
|
+
/* @__PURE__ */ i("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ i(D.ItemIndicator, { children: /* @__PURE__ */ i(Zi, { className: "richtext-h-4 richtext-w-4" }) }) }),
|
|
231
229
|
e
|
|
232
230
|
]
|
|
233
231
|
}
|
|
@@ -243,7 +241,7 @@ const Sn = E.forwardRef(({ className: t, children: e, ...r }, n) => /* @__PURE__
|
|
|
243
241
|
),
|
|
244
242
|
...r,
|
|
245
243
|
children: [
|
|
246
|
-
/* @__PURE__ */ i("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ i(D.ItemIndicator, { children: /* @__PURE__ */ i(
|
|
244
|
+
/* @__PURE__ */ i("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ i(D.ItemIndicator, { children: /* @__PURE__ */ i(Xi, { className: "richtext-h-2 richtext-w-2 richtext-fill-current" }) }) }),
|
|
247
245
|
e
|
|
248
246
|
]
|
|
249
247
|
}
|
|
@@ -395,7 +393,7 @@ const En = Vt(
|
|
|
395
393
|
}
|
|
396
394
|
));
|
|
397
395
|
ci.displayName = X.Root.displayName;
|
|
398
|
-
const
|
|
396
|
+
const zn = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
399
397
|
X.Action,
|
|
400
398
|
{
|
|
401
399
|
ref: r,
|
|
@@ -406,7 +404,7 @@ const Rn = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
|
406
404
|
...e
|
|
407
405
|
}
|
|
408
406
|
));
|
|
409
|
-
|
|
407
|
+
zn.displayName = X.Action.displayName;
|
|
410
408
|
const ai = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
411
409
|
X.Close,
|
|
412
410
|
{
|
|
@@ -439,7 +437,7 @@ const si = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
|
439
437
|
}
|
|
440
438
|
));
|
|
441
439
|
si.displayName = X.Description.displayName;
|
|
442
|
-
const
|
|
440
|
+
const Rn = Vt(
|
|
443
441
|
"richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",
|
|
444
442
|
{
|
|
445
443
|
variants: {
|
|
@@ -462,7 +460,7 @@ const zn = Vt(
|
|
|
462
460
|
qe.Root,
|
|
463
461
|
{
|
|
464
462
|
ref: a,
|
|
465
|
-
className: L(
|
|
463
|
+
className: L(Rn({ variant: e, size: r, className: t })),
|
|
466
464
|
...n
|
|
467
465
|
}
|
|
468
466
|
));
|
|
@@ -536,10 +534,10 @@ function Dn(t, e) {
|
|
|
536
534
|
}
|
|
537
535
|
}
|
|
538
536
|
const Et = [];
|
|
539
|
-
let
|
|
537
|
+
let zt = { toasts: [] };
|
|
540
538
|
function pt(t) {
|
|
541
|
-
|
|
542
|
-
e(
|
|
539
|
+
zt = Dn(zt, t), Et.forEach((e) => {
|
|
540
|
+
e(zt);
|
|
543
541
|
});
|
|
544
542
|
}
|
|
545
543
|
function Bn({ ...t }) {
|
|
@@ -564,7 +562,7 @@ function Bn({ ...t }) {
|
|
|
564
562
|
};
|
|
565
563
|
}
|
|
566
564
|
function $n() {
|
|
567
|
-
const [t, e] = E.useState(
|
|
565
|
+
const [t, e] = E.useState(zt);
|
|
568
566
|
return E.useEffect(() => (Et.push(e), () => {
|
|
569
567
|
const r = Et.indexOf(e);
|
|
570
568
|
r > -1 && Et.splice(r, 1);
|
|
@@ -810,104 +808,104 @@ function sc() {
|
|
|
810
808
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548", color: "currentColor" }) });
|
|
811
809
|
}
|
|
812
810
|
const ui = {
|
|
813
|
-
Bold:
|
|
814
|
-
LoaderCircle:
|
|
815
|
-
Italic:
|
|
816
|
-
Underline:
|
|
817
|
-
Quote:
|
|
811
|
+
Bold: on,
|
|
812
|
+
LoaderCircle: an,
|
|
813
|
+
Italic: cn,
|
|
814
|
+
Underline: nn,
|
|
815
|
+
Quote: rn,
|
|
818
816
|
TextQuote: Wn,
|
|
819
|
-
Strikethrough:
|
|
820
|
-
Minus:
|
|
821
|
-
Eraser:
|
|
822
|
-
PaintRoller:
|
|
823
|
-
Redo2:
|
|
824
|
-
Undo2:
|
|
825
|
-
AlignCenter:
|
|
826
|
-
AlignJustify:
|
|
827
|
-
AlignLeft:
|
|
828
|
-
AlignRight:
|
|
829
|
-
ChevronDown:
|
|
830
|
-
Subscript:
|
|
831
|
-
Superscript:
|
|
832
|
-
Code:
|
|
833
|
-
Code2:
|
|
834
|
-
Type:
|
|
835
|
-
IndentIncrease:
|
|
836
|
-
IndentDecrease:
|
|
837
|
-
List:
|
|
838
|
-
ListOrdered:
|
|
839
|
-
ListTodo:
|
|
840
|
-
Link:
|
|
841
|
-
ImageUp:
|
|
842
|
-
Video:
|
|
843
|
-
Maximize:
|
|
844
|
-
Minimize:
|
|
817
|
+
Strikethrough: en,
|
|
818
|
+
Minus: tn,
|
|
819
|
+
Eraser: Qr,
|
|
820
|
+
PaintRoller: Jr,
|
|
821
|
+
Redo2: Yr,
|
|
822
|
+
Undo2: qr,
|
|
823
|
+
AlignCenter: dn,
|
|
824
|
+
AlignJustify: hn,
|
|
825
|
+
AlignLeft: ln,
|
|
826
|
+
AlignRight: sn,
|
|
827
|
+
ChevronDown: Xr,
|
|
828
|
+
Subscript: Zr,
|
|
829
|
+
Superscript: Kr,
|
|
830
|
+
Code: Ur,
|
|
831
|
+
Code2: Gr,
|
|
832
|
+
Type: Fr,
|
|
833
|
+
IndentIncrease: jr,
|
|
834
|
+
IndentDecrease: Wr,
|
|
835
|
+
List: Vr,
|
|
836
|
+
ListOrdered: $r,
|
|
837
|
+
ListTodo: Br,
|
|
838
|
+
Link: Dr,
|
|
839
|
+
ImageUp: Pr,
|
|
840
|
+
Video: Hr,
|
|
841
|
+
Maximize: _r,
|
|
842
|
+
Minimize: Or,
|
|
845
843
|
Table: Rr,
|
|
846
|
-
Sparkles:
|
|
844
|
+
Sparkles: zr,
|
|
847
845
|
Pencil: Ke,
|
|
848
|
-
Unlink:
|
|
849
|
-
BetweenHorizonalEnd:
|
|
850
|
-
BetweenHorizonalStart:
|
|
851
|
-
BetweenVerticalStart:
|
|
852
|
-
BetweenVerticalEnd:
|
|
853
|
-
TableCellsMerge:
|
|
854
|
-
TableCellsSplit:
|
|
846
|
+
Unlink: Er,
|
|
847
|
+
BetweenHorizonalEnd: Ir,
|
|
848
|
+
BetweenHorizonalStart: Lr,
|
|
849
|
+
BetweenVerticalStart: Mr,
|
|
850
|
+
BetweenVerticalEnd: Ar,
|
|
851
|
+
TableCellsMerge: Sr,
|
|
852
|
+
TableCellsSplit: kr,
|
|
855
853
|
Trash2: Ue,
|
|
856
|
-
Trash:
|
|
854
|
+
Trash: Tr,
|
|
857
855
|
Replace: pe,
|
|
858
|
-
ChevronsUpDown:
|
|
856
|
+
ChevronsUpDown: Nr,
|
|
859
857
|
LineHeight: Un,
|
|
860
858
|
Word: Gn,
|
|
861
|
-
Heading1:
|
|
862
|
-
Heading2:
|
|
863
|
-
Heading3:
|
|
864
|
-
Heading4:
|
|
865
|
-
Heading5:
|
|
866
|
-
Heading6:
|
|
859
|
+
Heading1: Cr,
|
|
860
|
+
Heading2: yr,
|
|
861
|
+
Heading3: br,
|
|
862
|
+
Heading4: vr,
|
|
863
|
+
Heading5: wr,
|
|
864
|
+
Heading6: pr,
|
|
867
865
|
Columns2: we,
|
|
868
|
-
Columns3:
|
|
869
|
-
Columns4:
|
|
866
|
+
Columns3: gr,
|
|
867
|
+
Columns4: fr,
|
|
870
868
|
Plus: Ge,
|
|
871
|
-
Grip:
|
|
872
|
-
Copy:
|
|
873
|
-
Clipboard:
|
|
874
|
-
PanelLeft:
|
|
875
|
-
PanelRight:
|
|
869
|
+
Grip: mr,
|
|
870
|
+
Copy: xr,
|
|
871
|
+
Clipboard: ur,
|
|
872
|
+
PanelLeft: dr,
|
|
873
|
+
PanelRight: hr,
|
|
876
874
|
Columns: we,
|
|
877
|
-
Iframe:
|
|
875
|
+
Iframe: lr,
|
|
878
876
|
MenuDown: Kn,
|
|
879
877
|
SizeS: qn,
|
|
880
878
|
SizeM: Xn,
|
|
881
879
|
SizeL: Zn,
|
|
882
880
|
AspectRatio: Vn,
|
|
883
|
-
Emoji:
|
|
881
|
+
Emoji: sr,
|
|
884
882
|
DeleteColumn: jn,
|
|
885
883
|
DeleteRow: Fn,
|
|
886
884
|
SearchAndReplace: pe,
|
|
887
|
-
EmojiIcon:
|
|
888
|
-
KatexIcon:
|
|
885
|
+
EmojiIcon: or,
|
|
886
|
+
KatexIcon: ar,
|
|
889
887
|
ExportPdf: Jn,
|
|
890
888
|
ExportWord: Qn,
|
|
891
889
|
ImportWord: Yn,
|
|
892
890
|
ColumnAddLeft: tc,
|
|
893
891
|
ColumnAddRight: ec,
|
|
894
|
-
BookMarked:
|
|
892
|
+
BookMarked: cr,
|
|
895
893
|
Excalidraw: ic,
|
|
896
|
-
ZoomIn:
|
|
897
|
-
ZoomOut:
|
|
898
|
-
Settings:
|
|
899
|
-
Eye:
|
|
894
|
+
ZoomIn: nr,
|
|
895
|
+
ZoomOut: rr,
|
|
896
|
+
Settings: ir,
|
|
897
|
+
Eye: er,
|
|
900
898
|
TextDirection: rc,
|
|
901
899
|
LeftToRight: nc,
|
|
902
900
|
RightToLeft: cc,
|
|
903
|
-
Attachment:
|
|
901
|
+
Attachment: tr,
|
|
904
902
|
GifIcon: ac,
|
|
905
|
-
ChevronUp:
|
|
906
|
-
Crop:
|
|
903
|
+
ChevronUp: Qi,
|
|
904
|
+
Crop: Ji,
|
|
907
905
|
Mermaid: oc,
|
|
908
906
|
Twitter: sc,
|
|
909
|
-
FlipX:
|
|
910
|
-
FlipY:
|
|
907
|
+
FlipX: Yi,
|
|
908
|
+
FlipY: qi
|
|
911
909
|
};
|
|
912
910
|
function lc({ fill: t }) {
|
|
913
911
|
return /* @__PURE__ */ i(
|
|
@@ -1020,47 +1018,67 @@ function dc(t) {
|
|
|
1020
1018
|
function o(s) {
|
|
1021
1019
|
s.preventDefault(), s.stopPropagation(), t == null || t.onSetLink(r.link, r.text, a);
|
|
1022
1020
|
}
|
|
1023
|
-
return /* @__PURE__ */ i("div", { className: "
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
J,
|
|
1040
|
-
{
|
|
1041
|
-
type: "url",
|
|
1042
|
-
value: r.link,
|
|
1043
|
-
required: !0,
|
|
1044
|
-
className: "richtext-pl-10",
|
|
1045
|
-
onChange: (s) => n({ ...r, link: s.target.value })
|
|
1046
|
-
}
|
|
1047
|
-
),
|
|
1048
|
-
/* @__PURE__ */ i("span", { className: "richtext-absolute richtext-inset-y-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2 richtext-start-0", children: /* @__PURE__ */ i(G, { className: "richtext-size-5 richtext-text-muted-foreground", name: "Link" }) })
|
|
1049
|
-
] }) }),
|
|
1050
|
-
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-space-x-2", children: [
|
|
1051
|
-
/* @__PURE__ */ i(et, { children: e("editor.link.dialog.openInNewTab") }),
|
|
1052
|
-
/* @__PURE__ */ i(
|
|
1053
|
-
ri,
|
|
1054
|
-
{
|
|
1055
|
-
checked: a,
|
|
1056
|
-
onCheckedChange: (s) => {
|
|
1057
|
-
c(s);
|
|
1021
|
+
return /* @__PURE__ */ i("div", { className: "border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ u(
|
|
1022
|
+
"form",
|
|
1023
|
+
{
|
|
1024
|
+
className: "richtext-flex richtext-flex-col richtext-gap-2",
|
|
1025
|
+
onSubmit: o,
|
|
1026
|
+
children: [
|
|
1027
|
+
/* @__PURE__ */ i(et, { className: "mb-[6px]", children: e("editor.link.dialog.text") }),
|
|
1028
|
+
/* @__PURE__ */ i("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ i(
|
|
1029
|
+
J,
|
|
1030
|
+
{
|
|
1031
|
+
className: "richtext-w-80",
|
|
1032
|
+
onChange: (s) => n({ ...r, text: s.target.value }),
|
|
1033
|
+
placeholder: "Text",
|
|
1034
|
+
required: !0,
|
|
1035
|
+
type: "text",
|
|
1036
|
+
value: r.text
|
|
1058
1037
|
}
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1038
|
+
) }) }),
|
|
1039
|
+
/* @__PURE__ */ i(et, { className: "mb-[6px]", children: e("editor.link.dialog.link") }),
|
|
1040
|
+
/* @__PURE__ */ i("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ u("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: [
|
|
1041
|
+
/* @__PURE__ */ i(
|
|
1042
|
+
J,
|
|
1043
|
+
{
|
|
1044
|
+
className: "richtext-pl-10",
|
|
1045
|
+
onChange: (s) => n({ ...r, link: s.target.value }),
|
|
1046
|
+
required: !0,
|
|
1047
|
+
type: "url",
|
|
1048
|
+
value: r.link
|
|
1049
|
+
}
|
|
1050
|
+
),
|
|
1051
|
+
/* @__PURE__ */ i("span", { className: "richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2", children: /* @__PURE__ */ i(
|
|
1052
|
+
G,
|
|
1053
|
+
{
|
|
1054
|
+
className: "richtext-size-5 richtext-text-muted-foreground",
|
|
1055
|
+
name: "Link"
|
|
1056
|
+
}
|
|
1057
|
+
) })
|
|
1058
|
+
] }) }),
|
|
1059
|
+
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-space-x-2", children: [
|
|
1060
|
+
/* @__PURE__ */ i(et, { children: e("editor.link.dialog.openInNewTab") }),
|
|
1061
|
+
/* @__PURE__ */ i(
|
|
1062
|
+
ri,
|
|
1063
|
+
{
|
|
1064
|
+
checked: a,
|
|
1065
|
+
onCheckedChange: (s) => {
|
|
1066
|
+
c(s);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
)
|
|
1070
|
+
] }),
|
|
1071
|
+
/* @__PURE__ */ i(
|
|
1072
|
+
U,
|
|
1073
|
+
{
|
|
1074
|
+
className: "richtext-mt-2 richtext-self-end",
|
|
1075
|
+
type: "submit",
|
|
1076
|
+
children: e("editor.link.dialog.button.apply")
|
|
1077
|
+
}
|
|
1078
|
+
)
|
|
1079
|
+
]
|
|
1080
|
+
}
|
|
1081
|
+
) });
|
|
1064
1082
|
}
|
|
1065
1083
|
function uc(t, e, r = null) {
|
|
1066
1084
|
return r ? t.createChecked({ index: e }, r) : t.createAndFill({ index: e });
|
|
@@ -1087,7 +1105,7 @@ function Xt({
|
|
|
1087
1105
|
dispatch: e,
|
|
1088
1106
|
type: r
|
|
1089
1107
|
}) {
|
|
1090
|
-
const n =
|
|
1108
|
+
const n = Rt((c) => c.type.name === $t.name)(t.selection), a = Rt((c) => c.type.name === xi.name)(t.selection);
|
|
1091
1109
|
if (e && n && a) {
|
|
1092
1110
|
const c = n.node, o = a.node.attrs.index, s = c.toJSON();
|
|
1093
1111
|
let l = o;
|
|
@@ -1117,7 +1135,7 @@ function Xt({
|
|
|
1117
1135
|
return !0;
|
|
1118
1136
|
}
|
|
1119
1137
|
function Ce({ state: t, dispatch: e, type: r }) {
|
|
1120
|
-
const n =
|
|
1138
|
+
const n = Rt((c) => c.type.name === $t.name)(t.selection), a = Rt((c) => c.type.name === xi.name)(t.selection);
|
|
1121
1139
|
if (e && n && a) {
|
|
1122
1140
|
const c = n.node, o = a.node.attrs.index;
|
|
1123
1141
|
let s = 0;
|
|
@@ -1253,7 +1271,7 @@ function ee(t, e, r) {
|
|
|
1253
1271
|
};
|
|
1254
1272
|
return t.setNodeMarkup(e, n.type, s, n.marks);
|
|
1255
1273
|
}
|
|
1256
|
-
function
|
|
1274
|
+
function mo({ delta: t, types: e }) {
|
|
1257
1275
|
return ({ state: r, dispatch: n, editor: a }) => {
|
|
1258
1276
|
const { selection: c } = r;
|
|
1259
1277
|
let { tr: o } = r;
|
|
@@ -1347,19 +1365,19 @@ const vc = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
|
1347
1365
|
}
|
|
1348
1366
|
));
|
|
1349
1367
|
vc.displayName = q.Description.displayName;
|
|
1350
|
-
function
|
|
1368
|
+
function fo(t) {
|
|
1351
1369
|
return t.replace(/^.*\/|\..+$/g, "");
|
|
1352
1370
|
}
|
|
1353
|
-
function
|
|
1371
|
+
function go(t) {
|
|
1354
1372
|
return t.split(".").pop();
|
|
1355
1373
|
}
|
|
1356
|
-
function
|
|
1374
|
+
function po(t) {
|
|
1357
1375
|
return t < 1024 ? `${t} Byte` : t < 1024 * 1024 ? `${(t / 1024).toFixed(2)} KB` : `${(t / 1024 / 1024).toFixed(2)} MB`;
|
|
1358
1376
|
}
|
|
1359
|
-
function
|
|
1377
|
+
function wo(t) {
|
|
1360
1378
|
return t ? t === "application/pdf" ? "pdf" : t.startsWith("application/") && [".document", "word"].some((e) => t.includes(e)) ? "word" : t.startsWith("application/") && ["presentation"].some((e) => t.includes(e)) ? "excel" : t.startsWith("application/") && ["sheet"].some((e) => t.includes(e)) ? "ppt" : t.startsWith("image") ? "image" : t.startsWith("audio") ? "audio" : t.startsWith("video") ? "video" : "file" : "file";
|
|
1361
1379
|
}
|
|
1362
|
-
function
|
|
1380
|
+
function vo(t) {
|
|
1363
1381
|
return new Promise((e) => {
|
|
1364
1382
|
const r = new FileReader();
|
|
1365
1383
|
r.addEventListener(
|
|
@@ -1382,54 +1400,11 @@ function gi(t, e) {
|
|
|
1382
1400
|
o[c] = a.charCodeAt(c);
|
|
1383
1401
|
return new File([o], e, { type: n });
|
|
1384
1402
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
} catch {
|
|
1389
|
-
return JSON.stringify({});
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
function ht(t, e = !1) {
|
|
1393
|
-
return (r) => {
|
|
1394
|
-
const n = t.startsWith("data-") ? t : `data-${t}`;
|
|
1395
|
-
let a = decodeURIComponent(r.getAttribute(n));
|
|
1396
|
-
if (a == null || typeof a == "string" && a === "null")
|
|
1397
|
-
try {
|
|
1398
|
-
const s = r.outerHTML.match(/([\s\S])+?="([\s\S])+?"/g);
|
|
1399
|
-
s && s.length && (a = (s.map((h) => h.trim()).reduce((h, d) => {
|
|
1400
|
-
const x = d.indexOf("="), m = [d.slice(0, x), d.slice(x + 1).slice(1, -1)];
|
|
1401
|
-
return h[m[0]] = m[1], h;
|
|
1402
|
-
}, {})[t.toLowerCase()] || "").replaceAll(""", '"'));
|
|
1403
|
-
} catch (o) {
|
|
1404
|
-
console.error("Error getDatasetAttribute ", o.message, r);
|
|
1405
|
-
}
|
|
1406
|
-
if (e)
|
|
1407
|
-
try {
|
|
1408
|
-
return JSON.parse(a);
|
|
1409
|
-
} catch {
|
|
1410
|
-
return {};
|
|
1411
|
-
}
|
|
1412
|
-
if (a.includes("%") || a.includes("auto"))
|
|
1413
|
-
return a;
|
|
1414
|
-
const c = Number.parseInt(a);
|
|
1415
|
-
return c !== c ? a : c;
|
|
1416
|
-
};
|
|
1417
|
-
}
|
|
1418
|
-
function yc(t) {
|
|
1419
|
-
const { attrs: e } = t;
|
|
1420
|
-
return Object.keys(e).reduce((r, n) => {
|
|
1421
|
-
const a = e[n];
|
|
1422
|
-
if (a == null)
|
|
1423
|
-
return r;
|
|
1424
|
-
let c = "";
|
|
1425
|
-
return typeof a == "object" ? c = bc(a) : c = a, r[n] = c, r;
|
|
1426
|
-
}, /* @__PURE__ */ Object.create(null));
|
|
1427
|
-
}
|
|
1428
|
-
const Cc = "_wrap_5y04w_1", Nc = "_innerWrap_5y04w_15", Ne = {
|
|
1429
|
-
wrap: Cc,
|
|
1430
|
-
innerWrap: Nc
|
|
1403
|
+
const bc = "_wrap_5y04w_1", yc = "_innerWrap_5y04w_15", Ne = {
|
|
1404
|
+
wrap: bc,
|
|
1405
|
+
innerWrap: yc
|
|
1431
1406
|
};
|
|
1432
|
-
function
|
|
1407
|
+
function Cc({ editor: t, node: e, updateAttributes: r }) {
|
|
1433
1408
|
const n = gn(), { url: a, width: c, height: o } = e.attrs, [s, l] = w("");
|
|
1434
1409
|
function h() {
|
|
1435
1410
|
s && t.chain().updateAttributes(ot.name, {
|
|
@@ -1443,19 +1418,26 @@ function Tc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
1443
1418
|
[r]
|
|
1444
1419
|
);
|
|
1445
1420
|
return /* @__PURE__ */ u(ut, { children: [
|
|
1446
|
-
!a && /* @__PURE__ */ u("div", { className: "richtext-
|
|
1421
|
+
!a && /* @__PURE__ */ u("div", { className: "richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-[#ccc] richtext-p-[10px]", children: [
|
|
1447
1422
|
/* @__PURE__ */ i(
|
|
1448
1423
|
J,
|
|
1449
1424
|
{
|
|
1450
|
-
|
|
1425
|
+
autoFocus: !0,
|
|
1426
|
+
className: "richtext-flex-1",
|
|
1451
1427
|
onInput: (x) => l(x.target.value),
|
|
1428
|
+
placeholder: "Enter link",
|
|
1452
1429
|
type: "url",
|
|
1453
|
-
|
|
1454
|
-
autoFocus: !0,
|
|
1455
|
-
placeholder: "Enter link"
|
|
1430
|
+
value: s
|
|
1456
1431
|
}
|
|
1457
1432
|
),
|
|
1458
|
-
/* @__PURE__ */ i(
|
|
1433
|
+
/* @__PURE__ */ i(
|
|
1434
|
+
U,
|
|
1435
|
+
{
|
|
1436
|
+
className: "richtext-w-[60px]",
|
|
1437
|
+
onClick: h,
|
|
1438
|
+
children: "OK"
|
|
1439
|
+
}
|
|
1440
|
+
)
|
|
1459
1441
|
] }),
|
|
1460
1442
|
a && /* @__PURE__ */ i(
|
|
1461
1443
|
Je,
|
|
@@ -1467,17 +1449,67 @@ function Tc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
1467
1449
|
height: Number.parseInt(o) + p.height
|
|
1468
1450
|
});
|
|
1469
1451
|
},
|
|
1470
|
-
children: /* @__PURE__ */ i("div", { className: Pt(Ne.wrap, "render-wrapper"), children: /* @__PURE__ */ i(
|
|
1471
|
-
"
|
|
1452
|
+
children: /* @__PURE__ */ i("div", { className: Pt(Ne.wrap, "render-wrapper"), children: /* @__PURE__ */ i(
|
|
1453
|
+
"div",
|
|
1472
1454
|
{
|
|
1473
|
-
|
|
1474
|
-
|
|
1455
|
+
className: Ne.innerWrap,
|
|
1456
|
+
style: { pointerEvents: n ? "none" : "auto" },
|
|
1457
|
+
children: /* @__PURE__ */ i(
|
|
1458
|
+
"iframe",
|
|
1459
|
+
{
|
|
1460
|
+
className: "richtext-my-[12px] ",
|
|
1461
|
+
src: a
|
|
1462
|
+
}
|
|
1463
|
+
)
|
|
1475
1464
|
}
|
|
1476
|
-
) })
|
|
1465
|
+
) })
|
|
1477
1466
|
}
|
|
1478
1467
|
)
|
|
1479
1468
|
] });
|
|
1480
1469
|
}
|
|
1470
|
+
function Nc(t) {
|
|
1471
|
+
try {
|
|
1472
|
+
return JSON.stringify(t);
|
|
1473
|
+
} catch {
|
|
1474
|
+
return JSON.stringify({});
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
function ht(t, e = !1) {
|
|
1478
|
+
return (r) => {
|
|
1479
|
+
const n = t.startsWith("data-") ? t : `data-${t}`;
|
|
1480
|
+
let a = decodeURIComponent(r.getAttribute(n));
|
|
1481
|
+
if (a == null || typeof a == "string" && a === "null")
|
|
1482
|
+
try {
|
|
1483
|
+
const s = r.outerHTML.match(/([\S\s])+?="([\S\s])+?"/g);
|
|
1484
|
+
s && s.length > 0 && (a = (s.map((h) => h.trim()).reduce((h, d) => {
|
|
1485
|
+
const x = d.indexOf("="), m = [d.slice(0, x), d.slice(x + 1).slice(1, -1)];
|
|
1486
|
+
return h[m[0]] = m[1], h;
|
|
1487
|
+
}, {})[t.toLowerCase()] || "").replaceAll(""", '"'));
|
|
1488
|
+
} catch (o) {
|
|
1489
|
+
console.error("Error getDatasetAttribute ", o.message, r);
|
|
1490
|
+
}
|
|
1491
|
+
if (e)
|
|
1492
|
+
try {
|
|
1493
|
+
return JSON.parse(a);
|
|
1494
|
+
} catch {
|
|
1495
|
+
return {};
|
|
1496
|
+
}
|
|
1497
|
+
if (a.includes("%") || a.includes("auto"))
|
|
1498
|
+
return a;
|
|
1499
|
+
const c = Number.parseInt(a);
|
|
1500
|
+
return c !== c ? a : c;
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
function Tc(t) {
|
|
1504
|
+
const { attrs: e } = t;
|
|
1505
|
+
return Object.keys(e).reduce((r, n) => {
|
|
1506
|
+
const a = e[n];
|
|
1507
|
+
if (a == null)
|
|
1508
|
+
return r;
|
|
1509
|
+
let c = "";
|
|
1510
|
+
return typeof a == "object" ? c = Nc(a) : c = a, r[n] = c, r;
|
|
1511
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
1512
|
+
}
|
|
1481
1513
|
const ot = dt.create({
|
|
1482
1514
|
name: "iframe",
|
|
1483
1515
|
content: "",
|
|
@@ -1569,7 +1601,7 @@ const ot = dt.create({
|
|
|
1569
1601
|
];
|
|
1570
1602
|
},
|
|
1571
1603
|
addNodeView() {
|
|
1572
|
-
return xt(
|
|
1604
|
+
return xt(Cc);
|
|
1573
1605
|
}
|
|
1574
1606
|
}), St = E.forwardRef(
|
|
1575
1607
|
({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
@@ -1621,38 +1653,68 @@ function Sc({ editor: t, ...e }) {
|
|
|
1621
1653
|
return o;
|
|
1622
1654
|
}
|
|
1623
1655
|
}, [o]), d = P(
|
|
1624
|
-
() => `${o}`.trim() ? /* @__PURE__ */ i(
|
|
1656
|
+
() => `${o}`.trim() ? /* @__PURE__ */ i(
|
|
1657
|
+
"span",
|
|
1658
|
+
{
|
|
1659
|
+
contentEditable: !1,
|
|
1660
|
+
dangerouslySetInnerHTML: { __html: h || "" }
|
|
1661
|
+
}
|
|
1662
|
+
) : null,
|
|
1625
1663
|
[o, h]
|
|
1626
1664
|
);
|
|
1627
1665
|
return /* @__PURE__ */ u(mt, { modal: !0, children: [
|
|
1628
1666
|
/* @__PURE__ */ i(ft, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1629
1667
|
v,
|
|
1630
1668
|
{
|
|
1631
|
-
|
|
1632
|
-
|
|
1669
|
+
icon: e == null ? void 0 : e.icon,
|
|
1670
|
+
tooltip: e == null ? void 0 : e.tooltip
|
|
1633
1671
|
}
|
|
1634
1672
|
) }),
|
|
1635
|
-
/* @__PURE__ */ u(
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1673
|
+
/* @__PURE__ */ u(
|
|
1674
|
+
ct,
|
|
1675
|
+
{
|
|
1676
|
+
align: "start",
|
|
1677
|
+
className: "richtext-size-full richtext-p-2",
|
|
1678
|
+
hideWhenDetached: !0,
|
|
1679
|
+
side: "bottom",
|
|
1680
|
+
children: [
|
|
1681
|
+
/* @__PURE__ */ i(et, { className: "richtext-mb-[6px]", children: r("editor.formula.dialog.text") }),
|
|
1682
|
+
/* @__PURE__ */ i("div", { className: "richtext-mb-[16px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ i(
|
|
1683
|
+
St,
|
|
1684
|
+
{
|
|
1685
|
+
autoFocus: !0,
|
|
1686
|
+
className: "richtext-w-full",
|
|
1687
|
+
defaultValue: a,
|
|
1688
|
+
onChange: (x) => s(x.target.value),
|
|
1689
|
+
placeholder: "Text",
|
|
1690
|
+
required: !0,
|
|
1691
|
+
rows: 3,
|
|
1692
|
+
value: o
|
|
1693
|
+
}
|
|
1694
|
+
) }) }),
|
|
1695
|
+
d && /* @__PURE__ */ i("div", { className: "richtext-my-[10px] richtext-max-w-[286px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]", children: d }),
|
|
1696
|
+
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
|
|
1697
|
+
/* @__PURE__ */ i(
|
|
1698
|
+
U,
|
|
1699
|
+
{
|
|
1700
|
+
className: "richtext-flex-1",
|
|
1701
|
+
onClick: l,
|
|
1702
|
+
children: "Submit"
|
|
1703
|
+
}
|
|
1704
|
+
),
|
|
1705
|
+
/* @__PURE__ */ i(
|
|
1706
|
+
"a",
|
|
1707
|
+
{
|
|
1708
|
+
href: "https://katex.org/docs/supported",
|
|
1709
|
+
rel: "noreferrer noopener",
|
|
1710
|
+
target: "_blank",
|
|
1711
|
+
children: /* @__PURE__ */ i(Ze, { size: 16 })
|
|
1712
|
+
}
|
|
1713
|
+
)
|
|
1714
|
+
] })
|
|
1715
|
+
]
|
|
1716
|
+
}
|
|
1717
|
+
)
|
|
1656
1718
|
] });
|
|
1657
1719
|
}
|
|
1658
1720
|
const pi = Be("light");
|
|
@@ -1721,8 +1783,7 @@ const lt = dt.create({
|
|
|
1721
1783
|
component: Sc,
|
|
1722
1784
|
componentProps: {
|
|
1723
1785
|
editor: t,
|
|
1724
|
-
action: () =>
|
|
1725
|
-
},
|
|
1786
|
+
action: () => !0,
|
|
1726
1787
|
isActive: () => !1,
|
|
1727
1788
|
disabled: !1,
|
|
1728
1789
|
icon: "KatexIcon",
|
|
@@ -1768,21 +1829,120 @@ const lt = dt.create({
|
|
|
1768
1829
|
addNodeView() {
|
|
1769
1830
|
return xt(Ic);
|
|
1770
1831
|
}
|
|
1771
|
-
})
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1832
|
+
});
|
|
1833
|
+
let qt;
|
|
1834
|
+
function se() {
|
|
1835
|
+
try {
|
|
1836
|
+
return qt || (qt = _i()), qt;
|
|
1837
|
+
} catch {
|
|
1838
|
+
throw new Error("Error EventEmitter");
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
const ie = "OPEN_EXCALIDRAW_SETTING_MODAL";
|
|
1842
|
+
function zc(t, e) {
|
|
1843
|
+
se().on(t, e);
|
|
1844
|
+
}
|
|
1845
|
+
function Rc(t, e) {
|
|
1846
|
+
se().off(t, e);
|
|
1847
|
+
}
|
|
1848
|
+
function Oc(t) {
|
|
1849
|
+
se().emit(ie, t);
|
|
1850
|
+
}
|
|
1851
|
+
const _c = ({ editor: t }) => {
|
|
1852
|
+
const [e, r] = w(null), [n, a] = w({}), [c, o] = w({ elements: [], appState: { isLoading: !1 }, files: null }), [s, l] = w(!1), [h, d] = w(!0), [x, m] = w(null), f = C(
|
|
1853
|
+
(k) => {
|
|
1854
|
+
k && import("@excalidraw/excalidraw").then((z) => {
|
|
1855
|
+
r(z.Excalidraw);
|
|
1856
|
+
}).catch(m).finally(() => d(!1));
|
|
1857
|
+
},
|
|
1858
|
+
[d]
|
|
1859
|
+
), p = C((k) => {
|
|
1860
|
+
setTimeout(() => {
|
|
1861
|
+
k.refresh();
|
|
1862
|
+
});
|
|
1863
|
+
}, []), b = C((k, z, $) => {
|
|
1864
|
+
a({
|
|
1865
|
+
elements: k,
|
|
1866
|
+
appState: { isLoading: !1 },
|
|
1867
|
+
files: $
|
|
1868
|
+
});
|
|
1869
|
+
}, []), T = C(() => {
|
|
1870
|
+
if (!e) {
|
|
1871
|
+
l(!1);
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1874
|
+
t.chain().focus().setExcalidraw({ data: n }).run(), l(!1);
|
|
1875
|
+
}, [e, t, n, l]);
|
|
1876
|
+
return I(() => {
|
|
1877
|
+
const k = (z) => {
|
|
1878
|
+
l(!0), z && o(z.data);
|
|
1879
|
+
};
|
|
1880
|
+
return zc(ie, k), () => {
|
|
1881
|
+
Rc(ie, k);
|
|
1882
|
+
};
|
|
1883
|
+
}, [t, l]), /* @__PURE__ */ u(
|
|
1884
|
+
jt,
|
|
1885
|
+
{
|
|
1886
|
+
onOpenChange: l,
|
|
1887
|
+
open: s,
|
|
1888
|
+
children: [
|
|
1889
|
+
/* @__PURE__ */ i(Ft, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1890
|
+
v,
|
|
1891
|
+
{
|
|
1892
|
+
action: () => l(!0),
|
|
1893
|
+
icon: "Excalidraw",
|
|
1894
|
+
tooltip: "Excalidraw"
|
|
1895
|
+
}
|
|
1896
|
+
) }),
|
|
1897
|
+
/* @__PURE__ */ u(Nt, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
1898
|
+
/* @__PURE__ */ i(kt, { children: "Excalidraw" }),
|
|
1899
|
+
/* @__PURE__ */ u("div", { style: { height: "100%", borderWidth: 1 }, children: [
|
|
1900
|
+
h && /* @__PURE__ */ i("p", { children: "Loading..." }),
|
|
1901
|
+
x && /* @__PURE__ */ i("p", { children: x && x.message || "Error" }),
|
|
1902
|
+
/* @__PURE__ */ i(
|
|
1903
|
+
"div",
|
|
1904
|
+
{
|
|
1905
|
+
ref: f,
|
|
1906
|
+
style: { width: "100%", height: 600 },
|
|
1907
|
+
children: !h && !x && e ? /* @__PURE__ */ i(
|
|
1908
|
+
e,
|
|
1909
|
+
{
|
|
1910
|
+
initialData: c,
|
|
1911
|
+
langCode: "en",
|
|
1912
|
+
onChange: b,
|
|
1913
|
+
ref: p
|
|
1914
|
+
}
|
|
1915
|
+
) : null
|
|
1916
|
+
}
|
|
1917
|
+
)
|
|
1918
|
+
] }),
|
|
1919
|
+
/* @__PURE__ */ i(Tt, { children: /* @__PURE__ */ i(
|
|
1920
|
+
U,
|
|
1921
|
+
{
|
|
1922
|
+
onClick: T,
|
|
1923
|
+
type: "button",
|
|
1924
|
+
children: "Save changes"
|
|
1925
|
+
}
|
|
1926
|
+
) })
|
|
1927
|
+
] })
|
|
1928
|
+
]
|
|
1929
|
+
}
|
|
1930
|
+
);
|
|
1931
|
+
}, Hc = "_wrap_15k3c_1", Pc = "_renderWrap_15k3c_7", Dc = "_title_15k3c_14", Bc = "_handlerWrap_15k3c_30", gt = {
|
|
1932
|
+
wrap: Hc,
|
|
1933
|
+
renderWrap: Pc,
|
|
1934
|
+
title: Dc,
|
|
1935
|
+
handlerWrap: Bc
|
|
1936
|
+
}, $c = 10, Vc = 200, Te = 15, ke = { width: "100%", height: "100%", maxWidth: "100%" };
|
|
1937
|
+
function Wc({ editor: t, node: e, updateAttributes: r }) {
|
|
1938
|
+
const n = nt(null), a = t.isActive(st.name), { data: c, width: o, height: s } = e.attrs, [l, h] = w(null), [d, x] = w(!0), [m, f] = w(null), [p, b] = w(!1), [T, k] = w(100), z = C(
|
|
1779
1939
|
(M) => {
|
|
1780
1940
|
M && b(!0);
|
|
1781
1941
|
},
|
|
1782
1942
|
[b]
|
|
1783
1943
|
), $ = C((M) => () => {
|
|
1784
1944
|
k(
|
|
1785
|
-
(B) => ti(M === "minus" ? B - Te : B + Te,
|
|
1945
|
+
(B) => ti(M === "minus" ? B - Te : B + Te, $c, Vc)
|
|
1786
1946
|
);
|
|
1787
1947
|
}, []);
|
|
1788
1948
|
I(() => {
|
|
@@ -1806,7 +1966,7 @@ function Dc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
1806
1966
|
const F = (M) => {
|
|
1807
1967
|
r({ width: M.width, height: M.height });
|
|
1808
1968
|
};
|
|
1809
|
-
return /* @__PURE__ */ i(ut, { className: Pt(gt.wrap, a && gt.isActive), children: /* @__PURE__ */ i(Wi, { onChange:
|
|
1969
|
+
return /* @__PURE__ */ i(ut, { className: Pt(gt.wrap, a && gt.isActive), children: /* @__PURE__ */ i(Wi, { onChange: z, children: /* @__PURE__ */ i(
|
|
1810
1970
|
Je,
|
|
1811
1971
|
{
|
|
1812
1972
|
size: { width: Number.parseInt(o), height: Number.parseInt(s) },
|
|
@@ -1827,6 +1987,7 @@ function Dc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
1827
1987
|
!d && !m && p && /* @__PURE__ */ i(
|
|
1828
1988
|
"div",
|
|
1829
1989
|
{
|
|
1990
|
+
dangerouslySetInnerHTML: { __html: (l == null ? void 0 : l.outerHTML) ?? "" },
|
|
1830
1991
|
style: {
|
|
1831
1992
|
height: "100%",
|
|
1832
1993
|
maxHeight: "100%",
|
|
@@ -1837,8 +1998,7 @@ function Dc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
1837
1998
|
alignItems: "center",
|
|
1838
1999
|
transform: `scale(${T / 100})`,
|
|
1839
2000
|
transition: "all ease-in-out .3s"
|
|
1840
|
-
}
|
|
1841
|
-
dangerouslySetInnerHTML: { __html: (l == null ? void 0 : l.outerHTML) ?? "" }
|
|
2001
|
+
}
|
|
1842
2002
|
}
|
|
1843
2003
|
),
|
|
1844
2004
|
/* @__PURE__ */ i("div", { className: gt.title }),
|
|
@@ -1846,16 +2006,16 @@ function Dc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
1846
2006
|
/* @__PURE__ */ i(
|
|
1847
2007
|
v,
|
|
1848
2008
|
{
|
|
1849
|
-
icon: "ZoomOut",
|
|
1850
2009
|
action: $("minus"),
|
|
2010
|
+
icon: "ZoomOut",
|
|
1851
2011
|
tooltip: "Zoom Out"
|
|
1852
2012
|
}
|
|
1853
2013
|
),
|
|
1854
2014
|
/* @__PURE__ */ i(
|
|
1855
2015
|
v,
|
|
1856
2016
|
{
|
|
1857
|
-
icon: "ZoomIn",
|
|
1858
2017
|
action: $("plus"),
|
|
2018
|
+
icon: "ZoomIn",
|
|
1859
2019
|
tooltip: "Zoom In"
|
|
1860
2020
|
}
|
|
1861
2021
|
)
|
|
@@ -1866,91 +2026,7 @@ function Dc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
1866
2026
|
}
|
|
1867
2027
|
) }) });
|
|
1868
2028
|
}
|
|
1869
|
-
const
|
|
1870
|
-
let qt;
|
|
1871
|
-
function se() {
|
|
1872
|
-
try {
|
|
1873
|
-
return qt || (qt = _i()), qt;
|
|
1874
|
-
} catch {
|
|
1875
|
-
throw new Error("Error EventEmitter");
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
const ie = "OPEN_EXCALIDRAW_SETTING_MODAL";
|
|
1879
|
-
function $c(t, e) {
|
|
1880
|
-
se().on(t, e);
|
|
1881
|
-
}
|
|
1882
|
-
function Vc(t, e) {
|
|
1883
|
-
se().off(t, e);
|
|
1884
|
-
}
|
|
1885
|
-
function Wc(t) {
|
|
1886
|
-
se().emit(ie, t);
|
|
1887
|
-
}
|
|
1888
|
-
const jc = ({ editor: t }) => {
|
|
1889
|
-
const [e, r] = w(null), [n, a] = w({}), [c, o] = w({ elements: [], appState: { isLoading: !1 }, files: null }), [s, l] = w(!1), [h, d] = w(!0), [x, m] = w(null), f = C(
|
|
1890
|
-
(k) => {
|
|
1891
|
-
k && import("@excalidraw/excalidraw").then((R) => {
|
|
1892
|
-
r(R.Excalidraw);
|
|
1893
|
-
}).catch(m).finally(() => d(!1));
|
|
1894
|
-
},
|
|
1895
|
-
[d]
|
|
1896
|
-
), p = C((k) => {
|
|
1897
|
-
setTimeout(() => {
|
|
1898
|
-
k.refresh();
|
|
1899
|
-
});
|
|
1900
|
-
}, []), b = C((k, R, $) => {
|
|
1901
|
-
a({
|
|
1902
|
-
elements: k,
|
|
1903
|
-
appState: { isLoading: !1 },
|
|
1904
|
-
files: $
|
|
1905
|
-
});
|
|
1906
|
-
}, []), T = C(() => {
|
|
1907
|
-
if (!e) {
|
|
1908
|
-
l(!1);
|
|
1909
|
-
return;
|
|
1910
|
-
}
|
|
1911
|
-
t.chain().focus().setExcalidraw({ data: n }).run(), l(!1);
|
|
1912
|
-
}, [e, t, n, l]);
|
|
1913
|
-
return I(() => {
|
|
1914
|
-
const k = (R) => {
|
|
1915
|
-
l(!0), R && o(R.data);
|
|
1916
|
-
};
|
|
1917
|
-
return $c(ie, k), () => {
|
|
1918
|
-
Vc(ie, k);
|
|
1919
|
-
};
|
|
1920
|
-
}, [t, l]), /* @__PURE__ */ u(
|
|
1921
|
-
jt,
|
|
1922
|
-
{
|
|
1923
|
-
open: s,
|
|
1924
|
-
onOpenChange: l,
|
|
1925
|
-
children: [
|
|
1926
|
-
/* @__PURE__ */ i(Ft, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1927
|
-
v,
|
|
1928
|
-
{
|
|
1929
|
-
icon: "Excalidraw",
|
|
1930
|
-
tooltip: "Excalidraw",
|
|
1931
|
-
action: () => l(!0)
|
|
1932
|
-
}
|
|
1933
|
-
) }),
|
|
1934
|
-
/* @__PURE__ */ u(Nt, { className: "!richtext-max-w-[1300px] richtext-z-[99999]", children: [
|
|
1935
|
-
/* @__PURE__ */ i(kt, { children: "Excalidraw" }),
|
|
1936
|
-
/* @__PURE__ */ u("div", { style: { height: "100%", borderWidth: 1 }, children: [
|
|
1937
|
-
h && /* @__PURE__ */ i("p", { children: "Loading..." }),
|
|
1938
|
-
x && /* @__PURE__ */ i("p", { children: x && x.message || "Error" }),
|
|
1939
|
-
/* @__PURE__ */ i("div", { style: { width: "100%", height: 600 }, ref: f, children: !h && !x && e ? /* @__PURE__ */ i(e, { ref: p, onChange: b, langCode: "en", initialData: c }) : null })
|
|
1940
|
-
] }),
|
|
1941
|
-
/* @__PURE__ */ i(Tt, { children: /* @__PURE__ */ i(
|
|
1942
|
-
U,
|
|
1943
|
-
{
|
|
1944
|
-
type: "button",
|
|
1945
|
-
onClick: T,
|
|
1946
|
-
children: "Save changes"
|
|
1947
|
-
}
|
|
1948
|
-
) })
|
|
1949
|
-
] })
|
|
1950
|
-
]
|
|
1951
|
-
}
|
|
1952
|
-
);
|
|
1953
|
-
}, Se = { elements: [] }, st = dt.create({
|
|
2029
|
+
const jc = Oe.memo(Wc, (t, e) => !!We(t.node.attrs, e.node.attrs)), Se = { elements: [] }, st = dt.create({
|
|
1954
2030
|
name: "excalidraw",
|
|
1955
2031
|
group: "block",
|
|
1956
2032
|
selectable: !0,
|
|
@@ -1987,7 +2063,7 @@ const jc = ({ editor: t }) => {
|
|
|
1987
2063
|
class: "excalidraw"
|
|
1988
2064
|
},
|
|
1989
2065
|
button: ({ editor: e }) => ({
|
|
1990
|
-
component:
|
|
2066
|
+
component: _c,
|
|
1991
2067
|
componentProps: {
|
|
1992
2068
|
editor: e
|
|
1993
2069
|
}
|
|
@@ -2002,7 +2078,7 @@ const jc = ({ editor: t }) => {
|
|
|
2002
2078
|
];
|
|
2003
2079
|
},
|
|
2004
2080
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
2005
|
-
return ["div", it(this.options.HTMLAttributes, t,
|
|
2081
|
+
return ["div", it(this.options.HTMLAttributes, t, Tc(e))];
|
|
2006
2082
|
},
|
|
2007
2083
|
addCommands() {
|
|
2008
2084
|
return {
|
|
@@ -2016,7 +2092,7 @@ const jc = ({ editor: t }) => {
|
|
|
2016
2092
|
};
|
|
2017
2093
|
},
|
|
2018
2094
|
addNodeView() {
|
|
2019
|
-
return xt(
|
|
2095
|
+
return xt(jc);
|
|
2020
2096
|
},
|
|
2021
2097
|
addInputRules() {
|
|
2022
2098
|
return [
|
|
@@ -2027,13 +2103,94 @@ const jc = ({ editor: t }) => {
|
|
|
2027
2103
|
})
|
|
2028
2104
|
];
|
|
2029
2105
|
}
|
|
2030
|
-
})
|
|
2106
|
+
});
|
|
2107
|
+
function Fc({ selectImage: t, giphyApiKey: e, children: r }) {
|
|
2108
|
+
const [n, a] = w([]), [c] = w(15), o = nt(null), s = (h, d = "search") => {
|
|
2109
|
+
if (!e)
|
|
2110
|
+
return;
|
|
2111
|
+
const m = `${d === "search" ? `https://api.giphy.com/v1/gifs/search?q=${h}` : `https://api.giphy.com/v1/gifs/trending?q=${h}`}&limit=${c}&api_key=${e}`;
|
|
2112
|
+
fetch(m).then((f) => f.json()).then((f) => {
|
|
2113
|
+
a(f.data);
|
|
2114
|
+
}).catch((f) => {
|
|
2115
|
+
console.log(f);
|
|
2116
|
+
});
|
|
2117
|
+
};
|
|
2118
|
+
I(() => {
|
|
2119
|
+
s("", "trend");
|
|
2120
|
+
}, []);
|
|
2121
|
+
const l = C(
|
|
2122
|
+
Ve((h) => {
|
|
2123
|
+
if (!h.target.value) {
|
|
2124
|
+
s("", "trend");
|
|
2125
|
+
return;
|
|
2126
|
+
}
|
|
2127
|
+
s(h.target.value);
|
|
2128
|
+
}, 350),
|
|
2129
|
+
// Adjust the debounce delay as needed
|
|
2130
|
+
[]
|
|
2131
|
+
);
|
|
2132
|
+
return /* @__PURE__ */ u(mt, { modal: !0, children: [
|
|
2133
|
+
/* @__PURE__ */ i(ft, { asChild: !0, children: r }),
|
|
2134
|
+
/* @__PURE__ */ i(
|
|
2135
|
+
ct,
|
|
2136
|
+
{
|
|
2137
|
+
align: "start",
|
|
2138
|
+
className: "richtext-size-full richtext-p-2",
|
|
2139
|
+
hideWhenDetached: !0,
|
|
2140
|
+
side: "bottom",
|
|
2141
|
+
children: e ? /* @__PURE__ */ u(_, { children: [
|
|
2142
|
+
/* @__PURE__ */ i("div", { className: "richtext-mb-[10px] richtext-w-full", children: /* @__PURE__ */ i(
|
|
2143
|
+
J,
|
|
2144
|
+
{
|
|
2145
|
+
onChange: l,
|
|
2146
|
+
placeholder: "Search GIF",
|
|
2147
|
+
ref: o,
|
|
2148
|
+
type: "text"
|
|
2149
|
+
}
|
|
2150
|
+
) }),
|
|
2151
|
+
/* @__PURE__ */ i("div", { className: "richtext-max-h-[280px] richtext-overflow-y-auto", children: /* @__PURE__ */ i("div", { className: "richtext-grid richtext-grid-cols-2 richtext-gap-1 ", children: n != null && n.length ? n == null ? void 0 : n.map((h) => /* @__PURE__ */ i(
|
|
2152
|
+
"img",
|
|
2153
|
+
{
|
|
2154
|
+
alt: "giphy",
|
|
2155
|
+
className: "richtext-cursor-pointer richtext-text-center",
|
|
2156
|
+
height: h.images.fixed_width_downsampled.height,
|
|
2157
|
+
onClick: () => t(h),
|
|
2158
|
+
src: h.images.fixed_width_downsampled.url,
|
|
2159
|
+
width: h.images.fixed_width_downsampled.width
|
|
2160
|
+
},
|
|
2161
|
+
`giphy-${h.id}`
|
|
2162
|
+
)) : /* @__PURE__ */ i("p", { children: "No GIFs found" }) }) })
|
|
2163
|
+
] }) : /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("p", { children: "Missing Giphy API Key" }) })
|
|
2164
|
+
}
|
|
2165
|
+
)
|
|
2166
|
+
] });
|
|
2167
|
+
}
|
|
2168
|
+
function Gc({ editor: t, icon: e, giphyApiKey: r, ...n }) {
|
|
2169
|
+
return /* @__PURE__ */ i(
|
|
2170
|
+
Fc,
|
|
2171
|
+
{
|
|
2172
|
+
giphyApiKey: r,
|
|
2173
|
+
selectImage: (c) => {
|
|
2174
|
+
const { url: o } = c.images.original;
|
|
2175
|
+
t.chain().focus().setImageGif({ src: o }).run();
|
|
2176
|
+
},
|
|
2177
|
+
children: /* @__PURE__ */ i(
|
|
2178
|
+
v,
|
|
2179
|
+
{
|
|
2180
|
+
icon: e,
|
|
2181
|
+
tooltip: n == null ? void 0 : n.tooltip
|
|
2182
|
+
}
|
|
2183
|
+
)
|
|
2184
|
+
}
|
|
2185
|
+
);
|
|
2186
|
+
}
|
|
2187
|
+
const Lt = {
|
|
2031
2188
|
TOP_LEFT: "tl",
|
|
2032
2189
|
TOP_RIGHT: "tr",
|
|
2033
2190
|
BOTTOM_LEFT: "bl",
|
|
2034
2191
|
BOTTOM_RIGHT: "br"
|
|
2035
2192
|
};
|
|
2036
|
-
function
|
|
2193
|
+
function Uc(t) {
|
|
2037
2194
|
var B, W;
|
|
2038
2195
|
const [e, r] = w({
|
|
2039
2196
|
width: Ot,
|
|
@@ -2053,8 +2210,8 @@ function Fc(t) {
|
|
|
2053
2210
|
h: 0,
|
|
2054
2211
|
dir: ""
|
|
2055
2212
|
}), { align: d } = (B = t == null ? void 0 : t.node) == null ? void 0 : B.attrs, x = P(() => {
|
|
2056
|
-
var
|
|
2057
|
-
const { src: N, alt: H, width: y, height: g } = (
|
|
2213
|
+
var R;
|
|
2214
|
+
const { src: N, alt: H, width: y, height: g } = (R = t == null ? void 0 : t.node) == null ? void 0 : R.attrs, O = ge(y) ? `${y}px` : y, S = ge(g) ? `${g}px` : g;
|
|
2058
2215
|
return {
|
|
2059
2216
|
src: N || void 0,
|
|
2060
2217
|
alt: H || void 0,
|
|
@@ -2092,14 +2249,14 @@ function Fc(t) {
|
|
|
2092
2249
|
function T(N, H) {
|
|
2093
2250
|
N.preventDefault(), N.stopPropagation();
|
|
2094
2251
|
const y = n.width, g = n.height, O = y / g;
|
|
2095
|
-
let S = Number(t.node.attrs.width),
|
|
2252
|
+
let S = Number(t.node.attrs.width), R = Number(t.node.attrs.height);
|
|
2096
2253
|
const A = e.width;
|
|
2097
|
-
S && !
|
|
2254
|
+
S && !R ? (S = S > A ? A : S, R = Math.round(S / O)) : R && !S ? (S = Math.round(R * O), S = S > A ? A : S) : !S && !R ? (S = y > A ? A : y, R = Math.round(S / O)) : S = S > A ? A : S, Bt(() => {
|
|
2098
2255
|
s(!0), h({
|
|
2099
2256
|
x: N.clientX,
|
|
2100
2257
|
y: N.clientY,
|
|
2101
2258
|
w: S,
|
|
2102
|
-
h:
|
|
2259
|
+
h: R,
|
|
2103
2260
|
dir: H
|
|
2104
2261
|
});
|
|
2105
2262
|
});
|
|
@@ -2115,7 +2272,7 @@ function Fc(t) {
|
|
|
2115
2272
|
});
|
|
2116
2273
|
}, _t),
|
|
2117
2274
|
[o, l, e, t.updateAttributes]
|
|
2118
|
-
),
|
|
2275
|
+
), z = C(
|
|
2119
2276
|
(N) => {
|
|
2120
2277
|
N.preventDefault(), N.stopPropagation(), o && (Bt(() => {
|
|
2121
2278
|
h({
|
|
@@ -2129,114 +2286,50 @@ function Fc(t) {
|
|
|
2129
2286
|
},
|
|
2130
2287
|
[o, p]
|
|
2131
2288
|
), $ = C(() => {
|
|
2132
|
-
document == null || document.addEventListener("mousemove", k, !0), document == null || document.addEventListener("mouseup",
|
|
2133
|
-
}, [k,
|
|
2134
|
-
document == null || document.removeEventListener("mousemove", k, !0), document == null || document.removeEventListener("mouseup",
|
|
2135
|
-
}, [k,
|
|
2289
|
+
document == null || document.addEventListener("mousemove", k, !0), document == null || document.addEventListener("mouseup", z, !0);
|
|
2290
|
+
}, [k, z]), F = C(() => {
|
|
2291
|
+
document == null || document.removeEventListener("mousemove", k, !0), document == null || document.removeEventListener("mouseup", z, !0);
|
|
2292
|
+
}, [k, z]);
|
|
2136
2293
|
I(() => (o ? $() : F(), () => {
|
|
2137
2294
|
F();
|
|
2138
2295
|
}), [o, $, F]);
|
|
2139
2296
|
const M = P(() => new ResizeObserver(() => b()), [b]);
|
|
2140
|
-
return I(() => (M.observe(t.editor.view.dom), () => {
|
|
2141
|
-
M.disconnect();
|
|
2142
|
-
}), [t.editor.view.dom, M]), /* @__PURE__ */ i(
|
|
2143
|
-
|
|
2144
|
-
{
|
|
2145
|
-
draggable: "true",
|
|
2146
|
-
"data-drag-handle": !0,
|
|
2147
|
-
className: `image-view__body ${t != null && t.selected ? "image-view__body--focused" : ""} ${o ? "image-view__body--resizing" : ""}`,
|
|
2148
|
-
style: m,
|
|
2149
|
-
children: [
|
|
2150
|
-
/* @__PURE__ */ i(
|
|
2151
|
-
"img",
|
|
2152
|
-
{
|
|
2153
|
-
src: x.src,
|
|
2154
|
-
alt: x.alt,
|
|
2155
|
-
style: x.style,
|
|
2156
|
-
height: "auto",
|
|
2157
|
-
className: "image-view__body__image block",
|
|
2158
|
-
onLoad: f,
|
|
2159
|
-
onClick: p
|
|
2160
|
-
}
|
|
2161
|
-
),
|
|
2162
|
-
(t == null ? void 0 : t.editor.view.editable) && ((t == null ? void 0 : t.selected) || o) && /* @__PURE__ */ i("div", { className: "image-resizer", children: c == null ? void 0 : c.map((N) => /* @__PURE__ */ i(
|
|
2163
|
-
"span",
|
|
2164
|
-
{
|
|
2165
|
-
className: `image-resizer__handler image-resizer__handler--${N}`,
|
|
2166
|
-
onMouseDown: (H) => T(H, N)
|
|
2167
|
-
},
|
|
2168
|
-
`image-dir-${N}`
|
|
2169
|
-
)) })
|
|
2170
|
-
]
|
|
2171
|
-
}
|
|
2172
|
-
) });
|
|
2173
|
-
}
|
|
2174
|
-
function Gc({ selectImage: t, giphyApiKey: e, children: r }) {
|
|
2175
|
-
const [n, a] = w([]), [c] = w(15), o = nt(null), s = (h, d = "search") => {
|
|
2176
|
-
if (!e)
|
|
2177
|
-
return;
|
|
2178
|
-
const m = `${d === "search" ? `https://api.giphy.com/v1/gifs/search?q=${h}` : `https://api.giphy.com/v1/gifs/trending?q=${h}`}&limit=${c}&api_key=${e}`;
|
|
2179
|
-
fetch(m).then((f) => f.json()).then((f) => {
|
|
2180
|
-
a(f.data);
|
|
2181
|
-
}).catch((f) => {
|
|
2182
|
-
console.log(f);
|
|
2183
|
-
});
|
|
2184
|
-
};
|
|
2185
|
-
I(() => {
|
|
2186
|
-
s("", "trend");
|
|
2187
|
-
}, []);
|
|
2188
|
-
const l = C(
|
|
2189
|
-
Ve((h) => {
|
|
2190
|
-
if (!h.target.value) {
|
|
2191
|
-
s("", "trend");
|
|
2192
|
-
return;
|
|
2193
|
-
}
|
|
2194
|
-
s(h.target.value);
|
|
2195
|
-
}, 350),
|
|
2196
|
-
// Adjust the debounce delay as needed
|
|
2197
|
-
[]
|
|
2198
|
-
);
|
|
2199
|
-
return /* @__PURE__ */ u(mt, { modal: !0, children: [
|
|
2200
|
-
/* @__PURE__ */ i(ft, { asChild: !0, children: r }),
|
|
2201
|
-
/* @__PURE__ */ i(ct, { hideWhenDetached: !0, className: "richtext-w-full richtext-h-full richtext-p-2", align: "start", side: "bottom", children: e ? /* @__PURE__ */ u(_, { children: [
|
|
2202
|
-
/* @__PURE__ */ i("div", { className: "richtext-w-full richtext-mb-[10px]", children: /* @__PURE__ */ i(
|
|
2203
|
-
J,
|
|
2204
|
-
{
|
|
2205
|
-
ref: o,
|
|
2206
|
-
type: "text",
|
|
2207
|
-
placeholder: "Search GIF",
|
|
2208
|
-
onChange: l
|
|
2209
|
-
}
|
|
2210
|
-
) }),
|
|
2211
|
-
/* @__PURE__ */ i("div", { className: "richtext-max-h-[280px] richtext-overflow-y-auto", children: /* @__PURE__ */ i("div", { className: "richtext-grid richtext-grid-cols-2 richtext-gap-1 ", children: n != null && n.length ? n == null ? void 0 : n.map((h) => /* @__PURE__ */ i(
|
|
2212
|
-
"img",
|
|
2213
|
-
{
|
|
2214
|
-
alt: "giphy",
|
|
2215
|
-
className: "richtext-text-center richtext-cursor-pointer",
|
|
2216
|
-
onClick: (d) => t(h),
|
|
2217
|
-
height: h.images.fixed_width_downsampled.height,
|
|
2218
|
-
width: h.images.fixed_width_downsampled.width,
|
|
2219
|
-
src: h.images.fixed_width_downsampled.url
|
|
2220
|
-
},
|
|
2221
|
-
`giphy-${h.id}`
|
|
2222
|
-
)) : /* @__PURE__ */ i("p", { children: "No GIFs found" }) }) })
|
|
2223
|
-
] }) : /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("p", { children: "Missing Giphy API Key" }) }) })
|
|
2224
|
-
] });
|
|
2225
|
-
}
|
|
2226
|
-
function Uc({ editor: t, icon: e, giphyApiKey: r, ...n }) {
|
|
2227
|
-
return /* @__PURE__ */ i(
|
|
2228
|
-
Gc,
|
|
2297
|
+
return I(() => (M.observe(t.editor.view.dom), () => {
|
|
2298
|
+
M.disconnect();
|
|
2299
|
+
}), [t.editor.view.dom, M]), /* @__PURE__ */ i(
|
|
2300
|
+
ut,
|
|
2229
2301
|
{
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
giphyApiKey: r,
|
|
2235
|
-
children: /* @__PURE__ */ i(
|
|
2236
|
-
v,
|
|
2302
|
+
className: "image-view",
|
|
2303
|
+
style: { ...m, width: "100%", textAlign: d },
|
|
2304
|
+
children: /* @__PURE__ */ u(
|
|
2305
|
+
"div",
|
|
2237
2306
|
{
|
|
2238
|
-
|
|
2239
|
-
|
|
2307
|
+
"data-drag-handle": !0,
|
|
2308
|
+
draggable: "true",
|
|
2309
|
+
style: m,
|
|
2310
|
+
className: `image-view__body ${t != null && t.selected ? "image-view__body--focused" : ""} ${o ? "image-view__body--resizing" : ""}`,
|
|
2311
|
+
children: [
|
|
2312
|
+
/* @__PURE__ */ i(
|
|
2313
|
+
"img",
|
|
2314
|
+
{
|
|
2315
|
+
alt: x.alt,
|
|
2316
|
+
className: "image-view__body__image block",
|
|
2317
|
+
height: "auto",
|
|
2318
|
+
onClick: p,
|
|
2319
|
+
onLoad: f,
|
|
2320
|
+
src: x.src,
|
|
2321
|
+
style: x.style
|
|
2322
|
+
}
|
|
2323
|
+
),
|
|
2324
|
+
(t == null ? void 0 : t.editor.view.editable) && ((t == null ? void 0 : t.selected) || o) && /* @__PURE__ */ i("div", { className: "image-resizer", children: c == null ? void 0 : c.map((N) => /* @__PURE__ */ i(
|
|
2325
|
+
"span",
|
|
2326
|
+
{
|
|
2327
|
+
className: `image-resizer__handler image-resizer__handler--${N}`,
|
|
2328
|
+
onMouseDown: (H) => T(H, N)
|
|
2329
|
+
},
|
|
2330
|
+
`image-dir-${N}`
|
|
2331
|
+
)) })
|
|
2332
|
+
]
|
|
2240
2333
|
}
|
|
2241
2334
|
)
|
|
2242
2335
|
}
|
|
@@ -2260,7 +2353,7 @@ const wi = He.extend({
|
|
|
2260
2353
|
var c;
|
|
2261
2354
|
const a = ((c = r == null ? void 0 : r.options) == null ? void 0 : c.GIPHY_API_KEY) || "";
|
|
2262
2355
|
return {
|
|
2263
|
-
component:
|
|
2356
|
+
component: Gc,
|
|
2264
2357
|
componentProps: {
|
|
2265
2358
|
editor: e,
|
|
2266
2359
|
action: () => {
|
|
@@ -2299,7 +2392,7 @@ const wi = He.extend({
|
|
|
2299
2392
|
};
|
|
2300
2393
|
},
|
|
2301
2394
|
addNodeView() {
|
|
2302
|
-
return xt(
|
|
2395
|
+
return xt(Uc);
|
|
2303
2396
|
},
|
|
2304
2397
|
addCommands() {
|
|
2305
2398
|
var t;
|
|
@@ -2381,31 +2474,31 @@ a-->b`, Kc = ({ editor: t, upload: e }) => {
|
|
|
2381
2474
|
}, [r]), /* @__PURE__ */ u(
|
|
2382
2475
|
jt,
|
|
2383
2476
|
{
|
|
2384
|
-
open: o,
|
|
2385
2477
|
onOpenChange: s,
|
|
2478
|
+
open: o,
|
|
2386
2479
|
children: [
|
|
2387
2480
|
/* @__PURE__ */ i(Ft, { asChild: !0, children: /* @__PURE__ */ i(
|
|
2388
2481
|
v,
|
|
2389
2482
|
{
|
|
2483
|
+
action: () => s(!0),
|
|
2390
2484
|
icon: "Mermaid",
|
|
2391
|
-
tooltip: "Mermaid"
|
|
2392
|
-
action: () => s(!0)
|
|
2485
|
+
tooltip: "Mermaid"
|
|
2393
2486
|
}
|
|
2394
2487
|
) }),
|
|
2395
|
-
/* @__PURE__ */ u(Nt, { className: "
|
|
2488
|
+
/* @__PURE__ */ u(Nt, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
2396
2489
|
/* @__PURE__ */ i(kt, { children: "Mermaid" }),
|
|
2397
2490
|
/* @__PURE__ */ i("div", { style: { height: "100%", borderWidth: 1 }, children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
|
|
2398
2491
|
/* @__PURE__ */ i(
|
|
2399
2492
|
St,
|
|
2400
2493
|
{
|
|
2494
|
+
autoFocus: !0,
|
|
2401
2495
|
className: "richtext-flex-1",
|
|
2402
|
-
|
|
2496
|
+
defaultValue: Ae,
|
|
2403
2497
|
onChange: (m) => n(m.target.value),
|
|
2404
|
-
|
|
2498
|
+
placeholder: "Text",
|
|
2405
2499
|
required: !0,
|
|
2406
2500
|
rows: 10,
|
|
2407
|
-
|
|
2408
|
-
placeholder: "Text",
|
|
2501
|
+
value: r,
|
|
2409
2502
|
style: {
|
|
2410
2503
|
color: "hsl(var(--richtext-foreground))"
|
|
2411
2504
|
}
|
|
@@ -2414,17 +2507,16 @@ a-->b`, Kc = ({ editor: t, upload: e }) => {
|
|
|
2414
2507
|
/* @__PURE__ */ i(
|
|
2415
2508
|
"div",
|
|
2416
2509
|
{
|
|
2417
|
-
className: "richtext-flex
|
|
2418
|
-
|
|
2510
|
+
className: "richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",
|
|
2511
|
+
dangerouslySetInnerHTML: { __html: a },
|
|
2419
2512
|
ref: l,
|
|
2420
|
-
|
|
2513
|
+
style: { height: "100%", borderWidth: 1, minHeight: 500, background: "#fff" }
|
|
2421
2514
|
}
|
|
2422
2515
|
)
|
|
2423
2516
|
] }) }),
|
|
2424
2517
|
/* @__PURE__ */ i(Tt, { children: /* @__PURE__ */ i(
|
|
2425
2518
|
U,
|
|
2426
2519
|
{
|
|
2427
|
-
type: "button",
|
|
2428
2520
|
onClick: async () => {
|
|
2429
2521
|
if (r !== "") {
|
|
2430
2522
|
if (r) {
|
|
@@ -2448,6 +2540,7 @@ a-->b`, Kc = ({ editor: t, upload: e }) => {
|
|
|
2448
2540
|
s(!1);
|
|
2449
2541
|
}
|
|
2450
2542
|
},
|
|
2543
|
+
type: "button",
|
|
2451
2544
|
children: "Save changes"
|
|
2452
2545
|
}
|
|
2453
2546
|
) })
|
|
@@ -2480,12 +2573,12 @@ function Zc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
2480
2573
|
h: 0,
|
|
2481
2574
|
dir: ""
|
|
2482
2575
|
}), { align: p } = e == null ? void 0 : e.attrs, b = P(() => {
|
|
2483
|
-
const { src: y, alt: g, width: O, height: S } = e == null ? void 0 : e.attrs,
|
|
2576
|
+
const { src: y, alt: g, width: O, height: S } = e == null ? void 0 : e.attrs, R = me(O) ? `${O}px` : O, A = me(S) ? `${S}px` : S;
|
|
2484
2577
|
return {
|
|
2485
2578
|
src: y || void 0,
|
|
2486
2579
|
alt: g || void 0,
|
|
2487
2580
|
style: {
|
|
2488
|
-
width:
|
|
2581
|
+
width: R || void 0,
|
|
2489
2582
|
height: A || void 0
|
|
2490
2583
|
}
|
|
2491
2584
|
};
|
|
@@ -2501,7 +2594,7 @@ function Zc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
2501
2594
|
height: y.target.height
|
|
2502
2595
|
});
|
|
2503
2596
|
}
|
|
2504
|
-
function
|
|
2597
|
+
function z() {
|
|
2505
2598
|
t.commands.setNodeSelection(n());
|
|
2506
2599
|
}
|
|
2507
2600
|
const $ = C(
|
|
@@ -2516,10 +2609,10 @@ function Zc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
2516
2609
|
);
|
|
2517
2610
|
function F(y, g) {
|
|
2518
2611
|
y.preventDefault(), y.stopPropagation();
|
|
2519
|
-
const O = s.width, S = s.height,
|
|
2612
|
+
const O = s.width, S = s.height, R = O / S;
|
|
2520
2613
|
let A = Number(e.attrs.width), K = Number(e.attrs.height);
|
|
2521
2614
|
const j = c.width;
|
|
2522
|
-
A && !K ? (A = A > j ? j : A, K = Math.round(A /
|
|
2615
|
+
A && !K ? (A = A > j ? j : A, K = Math.round(A / R)) : K && !A ? (A = Math.round(K * R), A = A > j ? j : A) : !A && !K ? (A = O > j ? j : O, K = Math.round(A / R)) : A = A > j ? j : A, Bt(() => {
|
|
2523
2616
|
x(!0), f({
|
|
2524
2617
|
x: y.clientX,
|
|
2525
2618
|
y: y.clientY,
|
|
@@ -2533,7 +2626,7 @@ function Zc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
2533
2626
|
wt((y) => {
|
|
2534
2627
|
if (y.preventDefault(), y.stopPropagation(), !d)
|
|
2535
2628
|
return;
|
|
2536
|
-
const { x: g, w: O, dir: S } = m,
|
|
2629
|
+
const { x: g, w: O, dir: S } = m, R = (y.clientX - g) * (/l/.test(S) ? -1 : 1), A = ti(O + R, Pe, c.width);
|
|
2537
2630
|
r({
|
|
2538
2631
|
width: A,
|
|
2539
2632
|
height: null
|
|
@@ -2550,9 +2643,9 @@ function Zc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
2550
2643
|
h: 0,
|
|
2551
2644
|
dir: ""
|
|
2552
2645
|
}), x(!1);
|
|
2553
|
-
}),
|
|
2646
|
+
}), z());
|
|
2554
2647
|
},
|
|
2555
|
-
[d,
|
|
2648
|
+
[d, z]
|
|
2556
2649
|
), W = C(() => {
|
|
2557
2650
|
document == null || document.addEventListener("mousemove", M, !0), document == null || document.addEventListener("mouseup", B, !0);
|
|
2558
2651
|
}, [M, B]), N = C(() => {
|
|
@@ -2564,37 +2657,44 @@ function Zc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
2564
2657
|
const H = P(() => new ResizeObserver(() => $()), [$]);
|
|
2565
2658
|
return I(() => (H.observe(t.view.dom), () => {
|
|
2566
2659
|
H.disconnect();
|
|
2567
|
-
}), [t.view.dom, H]), /* @__PURE__ */ i(
|
|
2568
|
-
|
|
2660
|
+
}), [t.view.dom, H]), /* @__PURE__ */ i(
|
|
2661
|
+
ut,
|
|
2569
2662
|
{
|
|
2570
|
-
|
|
2571
|
-
"
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
"
|
|
2577
|
-
{
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2663
|
+
className: "image-view",
|
|
2664
|
+
style: { ...T, width: "100%", textAlign: p },
|
|
2665
|
+
children: /* @__PURE__ */ u(
|
|
2666
|
+
"div",
|
|
2667
|
+
{
|
|
2668
|
+
"data-drag-handle": !0,
|
|
2669
|
+
draggable: "true",
|
|
2670
|
+
style: { ...T, background: "#fff" },
|
|
2671
|
+
className: `image-view__body ${a ? "image-view__body--focused" : ""} ${d ? "image-view__body--resizing" : ""}`,
|
|
2672
|
+
children: [
|
|
2673
|
+
/* @__PURE__ */ i(
|
|
2674
|
+
"img",
|
|
2675
|
+
{
|
|
2676
|
+
alt: b.alt,
|
|
2677
|
+
className: "image-view__body__image block",
|
|
2678
|
+
height: "auto",
|
|
2679
|
+
onClick: z,
|
|
2680
|
+
onLoad: k,
|
|
2681
|
+
src: b.src,
|
|
2682
|
+
style: b.style
|
|
2683
|
+
}
|
|
2684
|
+
),
|
|
2685
|
+
t.view.editable && (a || d) && /* @__PURE__ */ i("div", { className: "image-resizer", children: h == null ? void 0 : h.map((y) => /* @__PURE__ */ i(
|
|
2686
|
+
"span",
|
|
2687
|
+
{
|
|
2688
|
+
className: `image-resizer__handler image-resizer__handler--${y}`,
|
|
2689
|
+
onMouseDown: (g) => F(g, y)
|
|
2690
|
+
},
|
|
2691
|
+
`image-dir-${y}`
|
|
2692
|
+
)) })
|
|
2693
|
+
]
|
|
2694
|
+
}
|
|
2695
|
+
)
|
|
2596
2696
|
}
|
|
2597
|
-
)
|
|
2697
|
+
);
|
|
2598
2698
|
}
|
|
2599
2699
|
const Me = He.extend({
|
|
2600
2700
|
name: "mermaid",
|
|
@@ -2617,8 +2717,7 @@ const Me = He.extend({
|
|
|
2617
2717
|
return {
|
|
2618
2718
|
component: Kc,
|
|
2619
2719
|
componentProps: {
|
|
2620
|
-
action: () =>
|
|
2621
|
-
},
|
|
2720
|
+
action: () => !0,
|
|
2622
2721
|
isActive: () => !1,
|
|
2623
2722
|
disabled: !1,
|
|
2624
2723
|
editor: e,
|
|
@@ -2719,7 +2818,7 @@ const Me = He.extend({
|
|
|
2719
2818
|
function Xc({ node: t }) {
|
|
2720
2819
|
var n;
|
|
2721
2820
|
const e = ((n = t == null ? void 0 : t.attrs) == null ? void 0 : n.src) || "", r = e == null ? void 0 : e.split("/").pop();
|
|
2722
|
-
return r ? /* @__PURE__ */ i(ut, { children: /* @__PURE__ */ i("div", { "data-twitter": "", children: /* @__PURE__ */ i(
|
|
2821
|
+
return r ? /* @__PURE__ */ i(ut, { children: /* @__PURE__ */ i("div", { "data-twitter": "", children: /* @__PURE__ */ i(Fi, { id: r }) }) }) : null;
|
|
2723
2822
|
}
|
|
2724
2823
|
function bi(t) {
|
|
2725
2824
|
const { t: e } = V(), [r, n] = w("");
|
|
@@ -2733,21 +2832,35 @@ function bi(t) {
|
|
|
2733
2832
|
function a(c) {
|
|
2734
2833
|
c.preventDefault(), c.stopPropagation(), t == null || t.onSetLink(r);
|
|
2735
2834
|
}
|
|
2736
|
-
return /* @__PURE__ */ i("div", { className: "
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2835
|
+
return /* @__PURE__ */ i("div", { className: "border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ u(
|
|
2836
|
+
"form",
|
|
2837
|
+
{
|
|
2838
|
+
className: "richtext-flex richtext-flex-col richtext-gap-2",
|
|
2839
|
+
onSubmit: a,
|
|
2840
|
+
children: [
|
|
2841
|
+
/* @__PURE__ */ i(et, { className: "mb-[6px]", children: e("editor.link.dialog.text") }),
|
|
2842
|
+
/* @__PURE__ */ i("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ i(
|
|
2843
|
+
J,
|
|
2844
|
+
{
|
|
2845
|
+
className: "richtext-w-80",
|
|
2846
|
+
onChange: (c) => n(c.target.value),
|
|
2847
|
+
placeholder: "Text",
|
|
2848
|
+
required: !0,
|
|
2849
|
+
type: "text",
|
|
2850
|
+
value: r
|
|
2851
|
+
}
|
|
2852
|
+
) }) }),
|
|
2853
|
+
/* @__PURE__ */ i(
|
|
2854
|
+
U,
|
|
2855
|
+
{
|
|
2856
|
+
className: "richtext-mt-2 richtext-self-end",
|
|
2857
|
+
type: "submit",
|
|
2858
|
+
children: e("editor.link.dialog.button.apply")
|
|
2859
|
+
}
|
|
2860
|
+
)
|
|
2861
|
+
]
|
|
2862
|
+
}
|
|
2863
|
+
) });
|
|
2751
2864
|
}
|
|
2752
2865
|
function qc(t) {
|
|
2753
2866
|
function e(r) {
|
|
@@ -2979,7 +3092,7 @@ function ia({ editor: t }) {
|
|
|
2979
3092
|
},
|
|
2980
3093
|
[t]
|
|
2981
3094
|
), h = C(() => {
|
|
2982
|
-
|
|
3095
|
+
Oc(n);
|
|
2983
3096
|
}, [t, n]), d = C(() => t.isActive(st.name), [t]), x = C(() => Ct(st.name, t), [t]);
|
|
2984
3097
|
return I(() => {
|
|
2985
3098
|
a && (h(), t.chain().updateAttributes(st.name, { defaultShowPicker: !1 }).focus().run());
|
|
@@ -3163,31 +3276,31 @@ a-->b`, na = ({ editor: t, attrs: e, extension: r }) => {
|
|
|
3163
3276
|
}, [c]), /* @__PURE__ */ u(
|
|
3164
3277
|
jt,
|
|
3165
3278
|
{
|
|
3166
|
-
open: h,
|
|
3167
3279
|
onOpenChange: d,
|
|
3280
|
+
open: h,
|
|
3168
3281
|
children: [
|
|
3169
3282
|
/* @__PURE__ */ i(Ft, { asChild: !0, children: /* @__PURE__ */ i(
|
|
3170
3283
|
v,
|
|
3171
3284
|
{
|
|
3285
|
+
action: () => d(!0),
|
|
3172
3286
|
icon: "Pencil",
|
|
3173
|
-
tooltip: "Edit Mermaid"
|
|
3174
|
-
action: () => d(!0)
|
|
3287
|
+
tooltip: "Edit Mermaid"
|
|
3175
3288
|
}
|
|
3176
3289
|
) }),
|
|
3177
|
-
/* @__PURE__ */ u(Nt, { className: "
|
|
3290
|
+
/* @__PURE__ */ u(Nt, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
3178
3291
|
/* @__PURE__ */ i(kt, { children: "Edit Mermaid" }),
|
|
3179
3292
|
/* @__PURE__ */ i("div", { style: { height: "100%", border: "1px solid hsl(var(--border))" }, children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
|
|
3180
3293
|
/* @__PURE__ */ i(
|
|
3181
3294
|
St,
|
|
3182
3295
|
{
|
|
3296
|
+
autoFocus: !0,
|
|
3183
3297
|
className: "richtext-flex-1",
|
|
3184
|
-
|
|
3298
|
+
defaultValue: Ie,
|
|
3185
3299
|
onChange: (T) => o(T.target.value),
|
|
3186
|
-
|
|
3300
|
+
placeholder: "Text",
|
|
3187
3301
|
required: !0,
|
|
3188
3302
|
rows: 10,
|
|
3189
|
-
|
|
3190
|
-
placeholder: "Text",
|
|
3303
|
+
value: c,
|
|
3191
3304
|
style: {
|
|
3192
3305
|
color: "hsl(var(--richtext-foreground))"
|
|
3193
3306
|
}
|
|
@@ -3196,21 +3309,20 @@ a-->b`, na = ({ editor: t, attrs: e, extension: r }) => {
|
|
|
3196
3309
|
/* @__PURE__ */ i(
|
|
3197
3310
|
"div",
|
|
3198
3311
|
{
|
|
3199
|
-
className: "richtext-flex
|
|
3200
|
-
|
|
3312
|
+
className: "richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",
|
|
3313
|
+
dangerouslySetInnerHTML: { __html: s },
|
|
3201
3314
|
ref: x,
|
|
3202
|
-
|
|
3315
|
+
style: { height: "100%", border: "1px solid hsl(var(--border))", minHeight: 500, background: "#fff" }
|
|
3203
3316
|
}
|
|
3204
3317
|
)
|
|
3205
3318
|
] }) }),
|
|
3206
3319
|
/* @__PURE__ */ i(Tt, { children: /* @__PURE__ */ i(
|
|
3207
3320
|
U,
|
|
3208
3321
|
{
|
|
3209
|
-
type: "button",
|
|
3210
3322
|
onClick: async () => {
|
|
3211
3323
|
if (c !== "") {
|
|
3212
3324
|
if (c) {
|
|
3213
|
-
const T = x.current.querySelector("svg"), { width: k, height:
|
|
3325
|
+
const T = x.current.querySelector("svg"), { width: k, height: z } = T.getBoundingClientRect(), $ = `mermaid-${vi()}.svg`;
|
|
3214
3326
|
let F = je(T.outerHTML);
|
|
3215
3327
|
if (m) {
|
|
3216
3328
|
const M = gi(F, $);
|
|
@@ -3222,7 +3334,7 @@ a-->b`, na = ({ editor: t, attrs: e, extension: r }) => {
|
|
|
3222
3334
|
src: F,
|
|
3223
3335
|
alt: encodeURIComponent(c),
|
|
3224
3336
|
width: k,
|
|
3225
|
-
height:
|
|
3337
|
+
height: z
|
|
3226
3338
|
},
|
|
3227
3339
|
!!c
|
|
3228
3340
|
).run(), t == null || t.commands.setAlignImageMermaid(a);
|
|
@@ -3230,6 +3342,7 @@ a-->b`, na = ({ editor: t, attrs: e, extension: r }) => {
|
|
|
3230
3342
|
d(!1);
|
|
3231
3343
|
}
|
|
3232
3344
|
},
|
|
3345
|
+
type: "button",
|
|
3233
3346
|
children: "Save changes"
|
|
3234
3347
|
}
|
|
3235
3348
|
) })
|
|
@@ -3259,12 +3372,18 @@ const aa = {
|
|
|
3259
3372
|
function oa({ item: t, disabled: e, editor: r }) {
|
|
3260
3373
|
var a;
|
|
3261
3374
|
const n = t.component;
|
|
3262
|
-
return n ? /* @__PURE__ */ i(_e, { children: t.type === "divider" ? /* @__PURE__ */ i(
|
|
3375
|
+
return n ? /* @__PURE__ */ i(_e, { children: t.type === "divider" ? /* @__PURE__ */ i(
|
|
3376
|
+
Q,
|
|
3377
|
+
{
|
|
3378
|
+
className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
|
|
3379
|
+
orientation: "vertical"
|
|
3380
|
+
}
|
|
3381
|
+
) : /* @__PURE__ */ i(
|
|
3263
3382
|
n,
|
|
3264
3383
|
{
|
|
3265
3384
|
...t.componentProps,
|
|
3266
|
-
|
|
3267
|
-
|
|
3385
|
+
disabled: e || ((a = t == null ? void 0 : t.componentProps) == null ? void 0 : a.disabled),
|
|
3386
|
+
editor: r
|
|
3268
3387
|
}
|
|
3269
3388
|
) }) : /* @__PURE__ */ i(_, {});
|
|
3270
3389
|
}
|
|
@@ -3283,23 +3402,23 @@ function la(t) {
|
|
|
3283
3402
|
return /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(
|
|
3284
3403
|
Y,
|
|
3285
3404
|
{
|
|
3286
|
-
shouldShow: a,
|
|
3287
3405
|
editor: t == null ? void 0 : t.editor,
|
|
3406
|
+
shouldShow: a,
|
|
3288
3407
|
tippyOptions: aa,
|
|
3289
|
-
children: c != null && c.length ? /* @__PURE__ */ i("div", { className: "richtext-
|
|
3408
|
+
children: c != null && c.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: c == null ? void 0 : c.map((o, s) => o.type === "edit" && (r != null && r.src) ? /* @__PURE__ */ i(
|
|
3290
3409
|
na,
|
|
3291
3410
|
{
|
|
3292
|
-
editor: t.editor,
|
|
3293
3411
|
attrs: r,
|
|
3412
|
+
editor: t.editor,
|
|
3294
3413
|
extension: n
|
|
3295
3414
|
},
|
|
3296
3415
|
`bubbleMenu-mermaid-${s}`
|
|
3297
3416
|
) : /* @__PURE__ */ i(
|
|
3298
3417
|
oa,
|
|
3299
3418
|
{
|
|
3300
|
-
item: o,
|
|
3301
3419
|
disabled: t.disabled,
|
|
3302
|
-
editor: t.editor
|
|
3420
|
+
editor: t.editor,
|
|
3421
|
+
item: o
|
|
3303
3422
|
},
|
|
3304
3423
|
`bubbleMenu-mermaid-${s}`
|
|
3305
3424
|
)) }) }) : /* @__PURE__ */ i(_, {})
|
|
@@ -3329,27 +3448,27 @@ function ha({ editor: t, disabled: e }) {
|
|
|
3329
3448
|
children: e ? /* @__PURE__ */ i(_, {}) : /* @__PURE__ */ i(_, { children: r ? /* @__PURE__ */ i(
|
|
3330
3449
|
bi,
|
|
3331
3450
|
{
|
|
3332
|
-
|
|
3333
|
-
|
|
3451
|
+
editor: t,
|
|
3452
|
+
onSetLink: o
|
|
3334
3453
|
}
|
|
3335
|
-
) : /* @__PURE__ */ i("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-
|
|
3454
|
+
) : /* @__PURE__ */ i("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-nowrap", children: [
|
|
3336
3455
|
/* @__PURE__ */ i(
|
|
3337
3456
|
v,
|
|
3338
3457
|
{
|
|
3339
3458
|
icon: "Pencil",
|
|
3340
3459
|
tooltip: a("editor.link.edit.tooltip"),
|
|
3460
|
+
tooltipOptions: { sideOffset: 15 },
|
|
3341
3461
|
action: () => {
|
|
3342
3462
|
n(!0);
|
|
3343
|
-
}
|
|
3344
|
-
tooltipOptions: { sideOffset: 15 }
|
|
3463
|
+
}
|
|
3345
3464
|
}
|
|
3346
3465
|
),
|
|
3347
3466
|
/* @__PURE__ */ i(
|
|
3348
3467
|
v,
|
|
3349
3468
|
{
|
|
3469
|
+
action: s,
|
|
3350
3470
|
icon: "Trash",
|
|
3351
3471
|
tooltip: a("editor.delete"),
|
|
3352
|
-
action: s,
|
|
3353
3472
|
tooltipOptions: { sideOffset: 15 }
|
|
3354
3473
|
}
|
|
3355
3474
|
)
|
|
@@ -3363,7 +3482,7 @@ function da({ editor: t, disabled: e, bubbleMenu: r }) {
|
|
|
3363
3482
|
return [
|
|
3364
3483
|
n.includes("columns") && !((c = r == null ? void 0 : r.columnConfig) != null && c.hidden) ? /* @__PURE__ */ i(Ba, { editor: t }, "columns") : null,
|
|
3365
3484
|
n.includes("table") && !((o = r == null ? void 0 : r.tableConfig) != null && o.hidden) ? /* @__PURE__ */ i(Ia, { editor: t }, "table") : null,
|
|
3366
|
-
n.includes("link") && !((s = r == null ? void 0 : r.linkConfig) != null && s.hidden) ? /* @__PURE__ */ i(
|
|
3485
|
+
n.includes("link") && !((s = r == null ? void 0 : r.linkConfig) != null && s.hidden) ? /* @__PURE__ */ i(za, { editor: t, disabled: e }, "link") : null,
|
|
3367
3486
|
n.includes("image") && !((l = r == null ? void 0 : r.imageConfig) != null && l.hidden) ? /* @__PURE__ */ i(Ha, { editor: t, disabled: e }, "image") : null,
|
|
3368
3487
|
n.includes(wi.name) && !((h = r == null ? void 0 : r.imageGifConfig) != null && h.hidden) ? /* @__PURE__ */ i(Pa, { editor: t, disabled: e }, "imageGif") : null,
|
|
3369
3488
|
n.includes("video") && !((d = r == null ? void 0 : r.videoConfig) != null && d.hidden) ? /* @__PURE__ */ i(Da, { editor: t, disabled: e }, "video") : null,
|
|
@@ -3406,102 +3525,126 @@ function ua(t) {
|
|
|
3406
3525
|
/^#([\da-f]{3}){1,2}$/i.test(f) && (c == null || c(f), o == null || o(f), x(f));
|
|
3407
3526
|
}
|
|
3408
3527
|
return /* @__PURE__ */ u(mt, { modal: !0, children: [
|
|
3409
|
-
/* @__PURE__ */ i(
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
"
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
onClick: () => m(b),
|
|
3439
|
-
children: /* @__PURE__ */ i(
|
|
3440
|
-
"span",
|
|
3528
|
+
/* @__PURE__ */ i(
|
|
3529
|
+
ft,
|
|
3530
|
+
{
|
|
3531
|
+
asChild: !0,
|
|
3532
|
+
className: "!richtext-p-0",
|
|
3533
|
+
disabled: n,
|
|
3534
|
+
children: t == null ? void 0 : t.children
|
|
3535
|
+
}
|
|
3536
|
+
),
|
|
3537
|
+
/* @__PURE__ */ i(
|
|
3538
|
+
ct,
|
|
3539
|
+
{
|
|
3540
|
+
align: "start",
|
|
3541
|
+
className: "richtext-size-full richtext-p-2",
|
|
3542
|
+
hideWhenDetached: !0,
|
|
3543
|
+
side: "bottom",
|
|
3544
|
+
children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col", children: [
|
|
3545
|
+
r ? /* @__PURE__ */ u(
|
|
3546
|
+
"div",
|
|
3547
|
+
{
|
|
3548
|
+
className: "rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",
|
|
3549
|
+
onClick: () => m(void 0),
|
|
3550
|
+
children: [
|
|
3551
|
+
/* @__PURE__ */ i(Ee, {}),
|
|
3552
|
+
/* @__PURE__ */ i("span", { className: "richtext-ml-1 richtext-text-sm", children: e("editor.nofill") })
|
|
3553
|
+
]
|
|
3554
|
+
}
|
|
3555
|
+
) : /* @__PURE__ */ u(
|
|
3556
|
+
"div",
|
|
3441
3557
|
{
|
|
3442
|
-
|
|
3443
|
-
|
|
3558
|
+
className: "rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",
|
|
3559
|
+
onClick: () => {
|
|
3560
|
+
m(void 0);
|
|
3444
3561
|
},
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
"
|
|
3448
|
-
|
|
3449
|
-
className: "richtext-absolute richtext-block richtext-top-[-1px] richtext-left-[1px] richtext-w-3 richtext-h-3",
|
|
3450
|
-
viewBox: "0 0 18 18",
|
|
3451
|
-
style: {
|
|
3452
|
-
fill: "rgb(255, 255, 255)"
|
|
3453
|
-
},
|
|
3454
|
-
children: /* @__PURE__ */ i("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
3455
|
-
}
|
|
3456
|
-
) : /* @__PURE__ */ i(
|
|
3457
|
-
"svg",
|
|
3458
|
-
{
|
|
3459
|
-
viewBox: "0 0 18 18",
|
|
3460
|
-
style: {
|
|
3461
|
-
fill: "rgb(255, 255, 255)",
|
|
3462
|
-
display: "none"
|
|
3463
|
-
},
|
|
3464
|
-
children: /* @__PURE__ */ i("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
3465
|
-
}
|
|
3466
|
-
)
|
|
3562
|
+
children: [
|
|
3563
|
+
/* @__PURE__ */ i(Ee, {}),
|
|
3564
|
+
/* @__PURE__ */ i("span", { className: "richtext-ml-1 richtext-text-sm", children: e("editor.default") })
|
|
3565
|
+
]
|
|
3467
3566
|
}
|
|
3468
|
-
)
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3567
|
+
),
|
|
3568
|
+
l.map((f, p) => /* @__PURE__ */ i(
|
|
3569
|
+
"span",
|
|
3570
|
+
{
|
|
3571
|
+
className: "richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",
|
|
3572
|
+
children: f.map((b, T) => /* @__PURE__ */ i(
|
|
3573
|
+
"span",
|
|
3574
|
+
{
|
|
3575
|
+
className: "richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",
|
|
3576
|
+
onClick: () => m(b),
|
|
3577
|
+
children: /* @__PURE__ */ i(
|
|
3578
|
+
"span",
|
|
3579
|
+
{
|
|
3580
|
+
className: "richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",
|
|
3581
|
+
style: {
|
|
3582
|
+
backgroundColor: b
|
|
3583
|
+
},
|
|
3584
|
+
children: b === a ? /* @__PURE__ */ i(
|
|
3585
|
+
"svg",
|
|
3586
|
+
{
|
|
3587
|
+
className: "richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",
|
|
3588
|
+
viewBox: "0 0 18 18",
|
|
3589
|
+
style: {
|
|
3590
|
+
fill: "rgb(255, 255, 255)"
|
|
3591
|
+
},
|
|
3592
|
+
children: /* @__PURE__ */ i("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
3593
|
+
}
|
|
3594
|
+
) : /* @__PURE__ */ i(
|
|
3595
|
+
"svg",
|
|
3596
|
+
{
|
|
3597
|
+
viewBox: "0 0 18 18",
|
|
3598
|
+
style: {
|
|
3599
|
+
fill: "rgb(255, 255, 255)",
|
|
3600
|
+
display: "none"
|
|
3601
|
+
},
|
|
3602
|
+
children: /* @__PURE__ */ i("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
3603
|
+
}
|
|
3604
|
+
)
|
|
3605
|
+
}
|
|
3606
|
+
)
|
|
3607
|
+
},
|
|
3608
|
+
`sub-color-${T}`
|
|
3609
|
+
))
|
|
3610
|
+
},
|
|
3611
|
+
p
|
|
3612
|
+
)),
|
|
3613
|
+
/* @__PURE__ */ u("div", { children: [
|
|
3614
|
+
/* @__PURE__ */ i("div", { className: "richtext-my-1 richtext-text-sm", children: e("editor.recent") }),
|
|
3615
|
+
/* @__PURE__ */ i("span", { className: "richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2", children: h == null ? void 0 : h.map((f, p) => /* @__PURE__ */ i(
|
|
3480
3616
|
"span",
|
|
3481
3617
|
{
|
|
3482
|
-
className: "richtext-
|
|
3483
|
-
|
|
3484
|
-
backgroundColor: f
|
|
3485
|
-
},
|
|
3618
|
+
className: "richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",
|
|
3619
|
+
onClick: () => m(f),
|
|
3486
3620
|
children: /* @__PURE__ */ i(
|
|
3487
|
-
"
|
|
3621
|
+
"span",
|
|
3488
3622
|
{
|
|
3489
|
-
|
|
3623
|
+
className: "richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",
|
|
3490
3624
|
style: {
|
|
3491
|
-
|
|
3492
|
-
display: "none"
|
|
3625
|
+
backgroundColor: f
|
|
3493
3626
|
},
|
|
3494
|
-
children: /* @__PURE__ */ i(
|
|
3627
|
+
children: /* @__PURE__ */ i(
|
|
3628
|
+
"svg",
|
|
3629
|
+
{
|
|
3630
|
+
viewBox: "0 0 18 18",
|
|
3631
|
+
style: {
|
|
3632
|
+
fill: "rgb(255, 255, 255)",
|
|
3633
|
+
display: "none"
|
|
3634
|
+
},
|
|
3635
|
+
children: /* @__PURE__ */ i("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
3636
|
+
}
|
|
3637
|
+
)
|
|
3495
3638
|
}
|
|
3496
3639
|
)
|
|
3497
|
-
}
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3640
|
+
},
|
|
3641
|
+
`sub-color-recent-${p}`
|
|
3642
|
+
)) })
|
|
3643
|
+
] }),
|
|
3644
|
+
/* @__PURE__ */ i(xa, { setColor: m })
|
|
3645
|
+
] })
|
|
3646
|
+
}
|
|
3647
|
+
)
|
|
3505
3648
|
] });
|
|
3506
3649
|
}
|
|
3507
3650
|
function xa({ setColor: t }) {
|
|
@@ -3512,10 +3655,10 @@ function xa({ setColor: t }) {
|
|
|
3512
3655
|
/* @__PURE__ */ i(ft, { asChild: !0, children: /* @__PURE__ */ u(
|
|
3513
3656
|
"div",
|
|
3514
3657
|
{
|
|
3658
|
+
className: "richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",
|
|
3515
3659
|
onClick: (o) => {
|
|
3516
3660
|
o.preventDefault(), a(!0);
|
|
3517
3661
|
},
|
|
3518
|
-
className: "richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent richtext-py-1.5 richtext-px-1.5",
|
|
3519
3662
|
children: [
|
|
3520
3663
|
c("editor.color.more"),
|
|
3521
3664
|
"..."
|
|
@@ -3524,16 +3667,22 @@ function xa({ setColor: t }) {
|
|
|
3524
3667
|
) }),
|
|
3525
3668
|
/* @__PURE__ */ u(ct, { children: [
|
|
3526
3669
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-justify-center", children: [
|
|
3527
|
-
/* @__PURE__ */ i(
|
|
3670
|
+
/* @__PURE__ */ i(
|
|
3671
|
+
xn,
|
|
3672
|
+
{
|
|
3673
|
+
color: e,
|
|
3674
|
+
onChange: r
|
|
3675
|
+
}
|
|
3676
|
+
),
|
|
3528
3677
|
/* @__PURE__ */ i(
|
|
3529
3678
|
J,
|
|
3530
3679
|
{
|
|
3531
3680
|
className: "richtext-mt-[8px] richtext-w-full",
|
|
3532
3681
|
type: "text",
|
|
3682
|
+
value: e.slice(1),
|
|
3533
3683
|
onChange: (o) => {
|
|
3534
3684
|
o.preventDefault(), r(`#${o.target.value}`);
|
|
3535
|
-
}
|
|
3536
|
-
value: e.slice(1)
|
|
3685
|
+
}
|
|
3537
3686
|
}
|
|
3538
3687
|
)
|
|
3539
3688
|
] }),
|
|
@@ -3541,10 +3690,10 @@ function xa({ setColor: t }) {
|
|
|
3541
3690
|
/* @__PURE__ */ i(
|
|
3542
3691
|
U,
|
|
3543
3692
|
{
|
|
3693
|
+
className: "richtext-w-full",
|
|
3544
3694
|
onClick: (o) => {
|
|
3545
3695
|
o.preventDefault(), t(e), a(!1);
|
|
3546
3696
|
},
|
|
3547
|
-
className: "richtext-w-full",
|
|
3548
3697
|
children: /* @__PURE__ */ i(Ge, { size: 16 })
|
|
3549
3698
|
}
|
|
3550
3699
|
)
|
|
@@ -3573,8 +3722,8 @@ function ma({ editor: t, disabled: e, toolbar: r }) {
|
|
|
3573
3722
|
t: n
|
|
3574
3723
|
});
|
|
3575
3724
|
if (Array.isArray(T)) {
|
|
3576
|
-
const k = T.map((
|
|
3577
|
-
button:
|
|
3725
|
+
const k = T.map((z, $) => ({
|
|
3726
|
+
button: z,
|
|
3578
3727
|
divider: $ === T.length - 1 ? f : !1,
|
|
3579
3728
|
spacer: $ === 0 ? p : !1,
|
|
3580
3729
|
type: x.type,
|
|
@@ -3811,8 +3960,7 @@ function Na(t) {
|
|
|
3811
3960
|
editor: t,
|
|
3812
3961
|
tooltip: Z.t("editor.edit"),
|
|
3813
3962
|
icon: "Pencil",
|
|
3814
|
-
action: () =>
|
|
3815
|
-
}
|
|
3963
|
+
action: () => !0
|
|
3816
3964
|
}
|
|
3817
3965
|
},
|
|
3818
3966
|
{
|
|
@@ -3891,7 +4039,7 @@ function Sa(t) {
|
|
|
3891
4039
|
function k(g) {
|
|
3892
4040
|
t.editor.commands.setTextAlign(g);
|
|
3893
4041
|
}
|
|
3894
|
-
function
|
|
4042
|
+
function z() {
|
|
3895
4043
|
const g = ee(t.editor.state.tr, c, 1);
|
|
3896
4044
|
g.setMeta("hideDragHandle", !0), t.editor.view.dispatch && t.editor.view.dispatch(g);
|
|
3897
4045
|
}
|
|
@@ -3908,8 +4056,8 @@ function Sa(t) {
|
|
|
3908
4056
|
function B() {
|
|
3909
4057
|
var g;
|
|
3910
4058
|
if (c !== -1) {
|
|
3911
|
-
const O = (n == null ? void 0 : n.nodeSize) || 0, S = c + O,
|
|
3912
|
-
t.editor.chain().command(({ dispatch: K, tr: j, state: Mt }) => K ? (
|
|
4059
|
+
const O = (n == null ? void 0 : n.nodeSize) || 0, S = c + O, R = (n == null ? void 0 : n.type.name) === "paragraph" && ((g = n == null ? void 0 : n.content) == null ? void 0 : g.size) === 0, A = R ? c + 2 : S + 2;
|
|
4060
|
+
t.editor.chain().command(({ dispatch: K, tr: j, state: Mt }) => K ? (R ? j.insertText("/", c, c + 1) : j.insert(
|
|
3913
4061
|
S,
|
|
3914
4062
|
Mt.schema.nodes.paragraph.create(null, [Mt.schema.text("/")])
|
|
3915
4063
|
), K(j)) : !0).focus(A).run();
|
|
@@ -4023,7 +4171,7 @@ function Sa(t) {
|
|
|
4023
4171
|
tt,
|
|
4024
4172
|
{
|
|
4025
4173
|
className: "richtext-flex richtext-gap-3",
|
|
4026
|
-
onClick:
|
|
4174
|
+
onClick: z,
|
|
4027
4175
|
disabled: ((H = n == null ? void 0 : n.attrs) == null ? void 0 : H.indent) >= te.max,
|
|
4028
4176
|
children: [
|
|
4029
4177
|
/* @__PURE__ */ i(G, { name: "IndentIncrease" }),
|
|
@@ -4064,8 +4212,8 @@ function Ma({ item: t, disabled: e, editor: r }) {
|
|
|
4064
4212
|
n,
|
|
4065
4213
|
{
|
|
4066
4214
|
...t.componentProps,
|
|
4067
|
-
|
|
4068
|
-
|
|
4215
|
+
disabled: e || ((a = t == null ? void 0 : t.componentProps) == null ? void 0 : a.disabled),
|
|
4216
|
+
editor: r
|
|
4069
4217
|
}
|
|
4070
4218
|
) : /* @__PURE__ */ i(_, {});
|
|
4071
4219
|
}
|
|
@@ -4074,26 +4222,34 @@ function La(t) {
|
|
|
4074
4222
|
const { selection: o } = c.view.state, { $from: s, to: l } = o;
|
|
4075
4223
|
return s.pos === l ? !1 : o instanceof bt;
|
|
4076
4224
|
}, a = P(() => t.disabled || !(t != null && t.editor) ? [] : ka(t.editor, e), [t.disabled, t.editor, r, e]);
|
|
4077
|
-
return /* @__PURE__ */ i(
|
|
4078
|
-
|
|
4079
|
-
{
|
|
4080
|
-
orientation: "vertical",
|
|
4081
|
-
className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"
|
|
4082
|
-
},
|
|
4083
|
-
`bubbleMenu-divider-${o}`
|
|
4084
|
-
) : /* @__PURE__ */ i(
|
|
4085
|
-
Ma,
|
|
4225
|
+
return /* @__PURE__ */ i(
|
|
4226
|
+
Y,
|
|
4086
4227
|
{
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4228
|
+
editor: t == null ? void 0 : t.editor,
|
|
4229
|
+
shouldShow: n,
|
|
4230
|
+
tippyOptions: Aa,
|
|
4231
|
+
children: a != null && a.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-gap-[4px] richtext-whitespace-nowrap", children: a == null ? void 0 : a.map((c, o) => (c == null ? void 0 : c.type) === "divider" ? /* @__PURE__ */ i(
|
|
4232
|
+
Q,
|
|
4233
|
+
{
|
|
4234
|
+
className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
|
|
4235
|
+
orientation: "vertical"
|
|
4236
|
+
},
|
|
4237
|
+
`bubbleMenu-divider-${o}`
|
|
4238
|
+
) : /* @__PURE__ */ i(
|
|
4239
|
+
Ma,
|
|
4240
|
+
{
|
|
4241
|
+
disabled: t.disabled,
|
|
4242
|
+
editor: t.editor,
|
|
4243
|
+
item: c
|
|
4244
|
+
},
|
|
4245
|
+
`bubbleMenu-text-${o}`
|
|
4246
|
+
)) }) }) : /* @__PURE__ */ i(_, {})
|
|
4247
|
+
}
|
|
4248
|
+
);
|
|
4093
4249
|
}
|
|
4094
4250
|
function Ia({ editor: t, disabled: e }) {
|
|
4095
|
-
var b, T, k,
|
|
4096
|
-
const r = ({ editor: j }) =>
|
|
4251
|
+
var b, T, k, z, $, F, M, B, W, N, H, y, g, O, S, R, A, K;
|
|
4252
|
+
const r = ({ editor: j }) => zi(j.view.state, "table"), { t: n } = V();
|
|
4097
4253
|
function a() {
|
|
4098
4254
|
t.chain().focus().addColumnBefore().run();
|
|
4099
4255
|
}
|
|
@@ -4175,7 +4331,7 @@ function Ia({ editor: t, disabled: e }) {
|
|
|
4175
4331
|
"tooltip-options": {
|
|
4176
4332
|
sideOffset: 15
|
|
4177
4333
|
},
|
|
4178
|
-
disabled: !((
|
|
4334
|
+
disabled: !((z = (k = t == null ? void 0 : t.can()) == null ? void 0 : k.addColumnAfter) != null && z.call(k))
|
|
4179
4335
|
}
|
|
4180
4336
|
),
|
|
4181
4337
|
/* @__PURE__ */ i(
|
|
@@ -4249,7 +4405,7 @@ function Ia({ editor: t, disabled: e }) {
|
|
|
4249
4405
|
"tooltip-options": {
|
|
4250
4406
|
sideOffset: 15
|
|
4251
4407
|
},
|
|
4252
|
-
disabled: !((
|
|
4408
|
+
disabled: !((R = (S = t == null ? void 0 : t.can()) == null ? void 0 : S.splitCell) != null && R.call(S))
|
|
4253
4409
|
}
|
|
4254
4410
|
),
|
|
4255
4411
|
/* @__PURE__ */ i(Q, { orientation: "vertical", className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]" }),
|
|
@@ -4290,7 +4446,7 @@ function Ea(t) {
|
|
|
4290
4446
|
target: "_blank",
|
|
4291
4447
|
rel: "noopener noreferrer",
|
|
4292
4448
|
className: "richtext-text-sm richtext-underline richtext-break-all",
|
|
4293
|
-
children:
|
|
4449
|
+
children: Gi(t == null ? void 0 : t.link, {
|
|
4294
4450
|
length: 50,
|
|
4295
4451
|
omission: "…"
|
|
4296
4452
|
})
|
|
@@ -4323,7 +4479,7 @@ function Ea(t) {
|
|
|
4323
4479
|
] })
|
|
4324
4480
|
] });
|
|
4325
4481
|
}
|
|
4326
|
-
function
|
|
4482
|
+
function za({ editor: t, disabled: e }) {
|
|
4327
4483
|
const [r, n] = w(!1), a = P(() => {
|
|
4328
4484
|
const { href: l } = t.getAttributes("link");
|
|
4329
4485
|
return l;
|
|
@@ -4383,16 +4539,22 @@ const le = {
|
|
|
4383
4539
|
function he({ item: t, disabled: e, editor: r }) {
|
|
4384
4540
|
var a;
|
|
4385
4541
|
const n = t.component;
|
|
4386
|
-
return n ? /* @__PURE__ */ i(_e, { children: t.type === "divider" ? /* @__PURE__ */ i(
|
|
4542
|
+
return n ? /* @__PURE__ */ i(_e, { children: t.type === "divider" ? /* @__PURE__ */ i(
|
|
4543
|
+
Q,
|
|
4544
|
+
{
|
|
4545
|
+
className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
|
|
4546
|
+
orientation: "vertical"
|
|
4547
|
+
}
|
|
4548
|
+
) : /* @__PURE__ */ i(
|
|
4387
4549
|
n,
|
|
4388
4550
|
{
|
|
4389
4551
|
...t.componentProps,
|
|
4390
|
-
|
|
4391
|
-
|
|
4552
|
+
disabled: e || ((a = t == null ? void 0 : t.componentProps) == null ? void 0 : a.disabled),
|
|
4553
|
+
editor: r
|
|
4392
4554
|
}
|
|
4393
4555
|
) }) : /* @__PURE__ */ i(_, {});
|
|
4394
4556
|
}
|
|
4395
|
-
function
|
|
4557
|
+
function Ra(t) {
|
|
4396
4558
|
return t.type.name === "image";
|
|
4397
4559
|
}
|
|
4398
4560
|
function Oa(t) {
|
|
@@ -4406,22 +4568,22 @@ function Ha(t) {
|
|
|
4406
4568
|
const { selection: c } = a.view.state, { $from: o, to: s } = c;
|
|
4407
4569
|
let l = !1;
|
|
4408
4570
|
return a.view.state.doc.nodesBetween(o.pos, s, (h) => {
|
|
4409
|
-
if (
|
|
4571
|
+
if (Ra(h))
|
|
4410
4572
|
return l = !0, !1;
|
|
4411
4573
|
}), l;
|
|
4412
4574
|
}, n = P(() => t.disabled ? [] : ya(t.editor), [t.disabled, t.editor, e]);
|
|
4413
4575
|
return /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(
|
|
4414
4576
|
Y,
|
|
4415
4577
|
{
|
|
4416
|
-
shouldShow: r,
|
|
4417
4578
|
editor: t == null ? void 0 : t.editor,
|
|
4579
|
+
shouldShow: r,
|
|
4418
4580
|
tippyOptions: le,
|
|
4419
|
-
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-
|
|
4581
|
+
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((a, c) => /* @__PURE__ */ i(
|
|
4420
4582
|
he,
|
|
4421
4583
|
{
|
|
4422
|
-
item: a,
|
|
4423
4584
|
disabled: t.disabled,
|
|
4424
|
-
editor: t.editor
|
|
4585
|
+
editor: t.editor,
|
|
4586
|
+
item: a
|
|
4425
4587
|
},
|
|
4426
4588
|
`bubbleMenu-image-${c}`
|
|
4427
4589
|
)) }) }) : /* @__PURE__ */ i(_, {})
|
|
@@ -4440,15 +4602,15 @@ function Pa(t) {
|
|
|
4440
4602
|
return /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(
|
|
4441
4603
|
Y,
|
|
4442
4604
|
{
|
|
4443
|
-
shouldShow: r,
|
|
4444
4605
|
editor: t == null ? void 0 : t.editor,
|
|
4606
|
+
shouldShow: r,
|
|
4445
4607
|
tippyOptions: le,
|
|
4446
|
-
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-
|
|
4608
|
+
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((a, c) => /* @__PURE__ */ i(
|
|
4447
4609
|
he,
|
|
4448
4610
|
{
|
|
4449
|
-
item: a,
|
|
4450
4611
|
disabled: t.disabled,
|
|
4451
|
-
editor: t.editor
|
|
4612
|
+
editor: t.editor,
|
|
4613
|
+
item: a
|
|
4452
4614
|
},
|
|
4453
4615
|
`bubbleMenu-image-gif-${c}`
|
|
4454
4616
|
)) }) }) : /* @__PURE__ */ i(_, {})
|
|
@@ -4467,15 +4629,15 @@ function Da(t) {
|
|
|
4467
4629
|
return /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(
|
|
4468
4630
|
Y,
|
|
4469
4631
|
{
|
|
4470
|
-
shouldShow: r,
|
|
4471
4632
|
editor: t == null ? void 0 : t.editor,
|
|
4633
|
+
shouldShow: r,
|
|
4472
4634
|
tippyOptions: le,
|
|
4473
|
-
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-
|
|
4635
|
+
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((a, c) => /* @__PURE__ */ i(
|
|
4474
4636
|
he,
|
|
4475
4637
|
{
|
|
4476
|
-
item: a,
|
|
4477
4638
|
disabled: t.disabled,
|
|
4478
|
-
editor: t.editor
|
|
4639
|
+
editor: t.editor,
|
|
4640
|
+
item: a
|
|
4479
4641
|
},
|
|
4480
4642
|
`bubbleMenu-video-${c}`
|
|
4481
4643
|
)) }) }) : /* @__PURE__ */ i(_, {})
|
|
@@ -4538,21 +4700,45 @@ function Ba({ editor: t }) {
|
|
|
4538
4700
|
}
|
|
4539
4701
|
);
|
|
4540
4702
|
}
|
|
4541
|
-
function $a() {
|
|
4703
|
+
function $a({ editor: t, extensions: e }) {
|
|
4704
|
+
const { t: r } = V(), n = P(() => {
|
|
4705
|
+
var a, c, o;
|
|
4706
|
+
return (o = (c = (a = e == null ? void 0 : e.find((s) => s.name === "base-kit")) == null ? void 0 : a.options) == null ? void 0 : c.characterCount) == null ? void 0 : o.limit;
|
|
4707
|
+
}, [e]);
|
|
4708
|
+
return n ? /* @__PURE__ */ i("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-flex-col", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm", children: /* @__PURE__ */ u("span", { children: [
|
|
4709
|
+
t.storage.characterCount.characters(),
|
|
4710
|
+
"/",
|
|
4711
|
+
n,
|
|
4712
|
+
" ",
|
|
4713
|
+
r("editor.characters")
|
|
4714
|
+
] }) }) }) }) : /* @__PURE__ */ i("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-flex-col", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm", children: /* @__PURE__ */ u("span", { children: [
|
|
4715
|
+
t.storage.characterCount.characters(),
|
|
4716
|
+
" ",
|
|
4717
|
+
r("editor.characters")
|
|
4718
|
+
] }) }) }) });
|
|
4719
|
+
}
|
|
4720
|
+
function Va() {
|
|
4542
4721
|
const { toasts: t } = $n();
|
|
4543
4722
|
return /* @__PURE__ */ u(In, { children: [
|
|
4544
|
-
t.map(({ id: e, title: r, description: n, action: a, ...c }) => /* @__PURE__ */ u(
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4723
|
+
t.map(({ id: e, title: r, description: n, action: a, ...c }) => /* @__PURE__ */ u(
|
|
4724
|
+
ci,
|
|
4725
|
+
{
|
|
4726
|
+
...c,
|
|
4727
|
+
children: [
|
|
4728
|
+
/* @__PURE__ */ u("div", { className: "richtext-grid richtext-gap-1", children: [
|
|
4729
|
+
r && /* @__PURE__ */ i(oi, { children: r }),
|
|
4730
|
+
n && /* @__PURE__ */ i(si, { children: n })
|
|
4731
|
+
] }),
|
|
4732
|
+
a,
|
|
4733
|
+
/* @__PURE__ */ i(ai, {})
|
|
4734
|
+
]
|
|
4735
|
+
},
|
|
4736
|
+
e
|
|
4737
|
+
)),
|
|
4552
4738
|
/* @__PURE__ */ i(ni, {})
|
|
4553
4739
|
] });
|
|
4554
4740
|
}
|
|
4555
|
-
const
|
|
4741
|
+
const Wa = `
|
|
4556
4742
|
.reactjs-tiptap-editor, .richtext-dialog-content {
|
|
4557
4743
|
button,
|
|
4558
4744
|
input:where([type=button]),
|
|
@@ -4687,8 +4873,8 @@ video {
|
|
|
4687
4873
|
height: auto
|
|
4688
4874
|
}
|
|
4689
4875
|
}
|
|
4690
|
-
`,
|
|
4691
|
-
function
|
|
4876
|
+
`, ze = "data-rc-order", Re = "data-rc-priority", ja = "rc-util-key", ne = /* @__PURE__ */ new Map();
|
|
4877
|
+
function Fa(t, e) {
|
|
4692
4878
|
if (!t)
|
|
4693
4879
|
return !1;
|
|
4694
4880
|
if (t.contains)
|
|
@@ -4702,12 +4888,12 @@ function ja(t, e) {
|
|
|
4702
4888
|
return !1;
|
|
4703
4889
|
}
|
|
4704
4890
|
function Ci({ mark: t } = {}) {
|
|
4705
|
-
return t ? t.startsWith("data-") ? t : `data-${t}` :
|
|
4891
|
+
return t ? t.startsWith("data-") ? t : `data-${t}` : ja;
|
|
4706
4892
|
}
|
|
4707
4893
|
function de(t) {
|
|
4708
4894
|
return t.attachTo ? t.attachTo : document.querySelector("head") || document.body;
|
|
4709
4895
|
}
|
|
4710
|
-
function
|
|
4896
|
+
function Ga(t) {
|
|
4711
4897
|
return t === "queue" ? "prependQueue" : t ? "prepend" : "append";
|
|
4712
4898
|
}
|
|
4713
4899
|
function Ni(t) {
|
|
@@ -4716,15 +4902,15 @@ function Ni(t) {
|
|
|
4716
4902
|
);
|
|
4717
4903
|
}
|
|
4718
4904
|
function Ti(t, e = {}) {
|
|
4719
|
-
const { csp: r, prepend: n, priority: a = 0 } = e, c =
|
|
4720
|
-
s.setAttribute(
|
|
4905
|
+
const { csp: r, prepend: n, priority: a = 0 } = e, c = Ga(n), o = c === "prependQueue", s = document.createElement("style");
|
|
4906
|
+
s.setAttribute(ze, c), o && a && s.setAttribute(Re, `${a}`), r != null && r.nonce && (s.nonce = r == null ? void 0 : r.nonce), s.innerHTML = t;
|
|
4721
4907
|
const l = de(e), { firstChild: h } = l;
|
|
4722
4908
|
if (n) {
|
|
4723
4909
|
if (o) {
|
|
4724
4910
|
const d = Ni(l).filter((x) => {
|
|
4725
|
-
if (!["prepend", "prependQueue"].includes(x.getAttribute(
|
|
4911
|
+
if (!["prepend", "prependQueue"].includes(x.getAttribute(ze)))
|
|
4726
4912
|
return !1;
|
|
4727
|
-
const m = Number(x.getAttribute(
|
|
4913
|
+
const m = Number(x.getAttribute(Re) || 0);
|
|
4728
4914
|
return a >= m;
|
|
4729
4915
|
});
|
|
4730
4916
|
if (d.length > 0)
|
|
@@ -4739,47 +4925,30 @@ function ki(t, e = {}) {
|
|
|
4739
4925
|
const r = de(e);
|
|
4740
4926
|
return Ni(r).find((n) => n.getAttribute(Ci(e)) === t);
|
|
4741
4927
|
}
|
|
4742
|
-
function
|
|
4928
|
+
function Ua(t, e = {}) {
|
|
4743
4929
|
const r = ki(t, e);
|
|
4744
4930
|
r && r.remove();
|
|
4745
4931
|
}
|
|
4746
|
-
function
|
|
4932
|
+
function Ka(t, e) {
|
|
4747
4933
|
const r = ne.get(t);
|
|
4748
|
-
if (!r || !
|
|
4934
|
+
if (!r || !Fa(document, r)) {
|
|
4749
4935
|
const n = Ti("", e), { parentNode: a } = n;
|
|
4750
4936
|
ne.set(t, a), n.remove();
|
|
4751
4937
|
}
|
|
4752
4938
|
}
|
|
4753
|
-
function
|
|
4939
|
+
function Za(t, e, r = {}) {
|
|
4754
4940
|
var o, s, l;
|
|
4755
4941
|
const n = de(r);
|
|
4756
|
-
|
|
4942
|
+
Ka(n, r);
|
|
4757
4943
|
const a = ki(e, r);
|
|
4758
4944
|
if (a)
|
|
4759
4945
|
return (o = r.csp) != null && o.nonce && a.nonce !== ((s = r.csp) == null ? void 0 : s.nonce) && (a.nonce = (l = r.csp) == null ? void 0 : l.nonce), a.innerHTML !== t && (a.innerHTML = t), a;
|
|
4760
4946
|
const c = Ti(t, r);
|
|
4761
4947
|
return c.setAttribute(Ci(r), e), c;
|
|
4762
4948
|
}
|
|
4763
|
-
function Za({ editor: t, extensions: e }) {
|
|
4764
|
-
const { t: r } = V(), n = P(() => {
|
|
4765
|
-
var a, c, o;
|
|
4766
|
-
return (o = (c = (a = e == null ? void 0 : e.find((s) => s.name === "base-kit")) == null ? void 0 : a.options) == null ? void 0 : c.characterCount) == null ? void 0 : o.limit;
|
|
4767
|
-
}, [e]);
|
|
4768
|
-
return n ? /* @__PURE__ */ i("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-flex-col", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm", children: /* @__PURE__ */ u("span", { children: [
|
|
4769
|
-
t.storage.characterCount.characters(),
|
|
4770
|
-
"/",
|
|
4771
|
-
n,
|
|
4772
|
-
" ",
|
|
4773
|
-
r("editor.characters")
|
|
4774
|
-
] }) }) }) }) : /* @__PURE__ */ i("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-flex-col", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm", children: /* @__PURE__ */ u("span", { children: [
|
|
4775
|
-
t.storage.characterCount.characters(),
|
|
4776
|
-
" ",
|
|
4777
|
-
r("editor.characters")
|
|
4778
|
-
] }) }) }) });
|
|
4779
|
-
}
|
|
4780
4949
|
function Xa(t, e) {
|
|
4781
4950
|
const { content: r, extensions: n, useEditorOptions: a = {} } = t, c = P(() => {
|
|
4782
|
-
const d =
|
|
4951
|
+
const d = Ui(n, n, "name");
|
|
4783
4952
|
return [...n.map((m) => {
|
|
4784
4953
|
const f = n.find((p) => p.name === m.name);
|
|
4785
4954
|
return f ? m.configure(f.options) : m;
|
|
@@ -4788,7 +4957,7 @@ function Xa(t, e) {
|
|
|
4788
4957
|
var m;
|
|
4789
4958
|
const x = l(d, t.output);
|
|
4790
4959
|
(m = t == null ? void 0 : t.onChangeContent) == null || m.call(t, x);
|
|
4791
|
-
}, Di), s =
|
|
4960
|
+
}, Di), s = Ri({
|
|
4792
4961
|
extensions: c,
|
|
4793
4962
|
content: r,
|
|
4794
4963
|
onUpdate: ({ editor: d }) => {
|
|
@@ -4802,8 +4971,8 @@ function Xa(t, e) {
|
|
|
4802
4971
|
document.documentElement.classList.toggle("dark", t.dark), Mc.setTheme(t.dark ? "dark" : "light");
|
|
4803
4972
|
}, [t.dark]), I(() => {
|
|
4804
4973
|
s == null || s.setEditable(!(t != null && t.disabled)), pn.setDisable(!(t != null && t.disabled));
|
|
4805
|
-
}, [s, t == null ? void 0 : t.disabled]), I(() => ((t == null ? void 0 : t.resetCSS) !== !1 &&
|
|
4806
|
-
|
|
4974
|
+
}, [s, t == null ? void 0 : t.disabled]), I(() => ((t == null ? void 0 : t.resetCSS) !== !1 && Za(Wa, "react-tiptap-reset"), () => {
|
|
4975
|
+
Ua("react-tiptap-reset");
|
|
4807
4976
|
}), [t == null ? void 0 : t.resetCSS]);
|
|
4808
4977
|
function l(d, x) {
|
|
4809
4978
|
return t != null && t.removeDefaultWrapper ? x === "html" ? d.isEmpty ? "" : d.getHTML() : x === "json" ? d.isEmpty ? {} : d.getJSON() : x === "text" ? d.isEmpty ? "" : d.getText() : "" : x === "html" ? d.getHTML() : x === "json" ? d.getJSON() : x === "text" ? d.getText() : "";
|
|
@@ -4814,16 +4983,49 @@ function Xa(t, e) {
|
|
|
4814
4983
|
}, []);
|
|
4815
4984
|
const h = yn(s, "characterCount");
|
|
4816
4985
|
return s ? /* @__PURE__ */ u("div", { className: "reactjs-tiptap-editor", children: [
|
|
4817
|
-
/* @__PURE__ */ i(
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4986
|
+
/* @__PURE__ */ i(
|
|
4987
|
+
On,
|
|
4988
|
+
{
|
|
4989
|
+
delayDuration: 0,
|
|
4990
|
+
disableHoverableContent: !0,
|
|
4991
|
+
children: /* @__PURE__ */ i("div", { className: "richtext-overflow-hidden richtext-rounded-[0.5rem] richtext-bg-background richtext-shadow richtext-outline richtext-outline-1", children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-max-h-full richtext-w-full richtext-flex-col", children: [
|
|
4992
|
+
!(t != null && t.hideToolbar) && /* @__PURE__ */ i(
|
|
4993
|
+
ma,
|
|
4994
|
+
{
|
|
4995
|
+
disabled: !!(t != null && t.disabled),
|
|
4996
|
+
editor: s,
|
|
4997
|
+
toolbar: t.toolbar
|
|
4998
|
+
}
|
|
4999
|
+
),
|
|
5000
|
+
/* @__PURE__ */ i(
|
|
5001
|
+
Oi,
|
|
5002
|
+
{
|
|
5003
|
+
className: `richtext-relative ${(t == null ? void 0 : t.contentClass) || ""}`,
|
|
5004
|
+
editor: s
|
|
5005
|
+
}
|
|
5006
|
+
),
|
|
5007
|
+
h && /* @__PURE__ */ i(
|
|
5008
|
+
$a,
|
|
5009
|
+
{
|
|
5010
|
+
editor: s,
|
|
5011
|
+
extensions: n
|
|
5012
|
+
}
|
|
5013
|
+
),
|
|
5014
|
+
!(t != null && t.hideBubble) && /* @__PURE__ */ i(
|
|
5015
|
+
da,
|
|
5016
|
+
{
|
|
5017
|
+
bubbleMenu: t == null ? void 0 : t.bubbleMenu,
|
|
5018
|
+
disabled: t == null ? void 0 : t.disabled,
|
|
5019
|
+
editor: s
|
|
5020
|
+
}
|
|
5021
|
+
)
|
|
5022
|
+
] }) })
|
|
5023
|
+
}
|
|
5024
|
+
),
|
|
5025
|
+
/* @__PURE__ */ i(Va, {})
|
|
4824
5026
|
] }) : /* @__PURE__ */ i(_, {});
|
|
4825
5027
|
}
|
|
4826
|
-
const
|
|
5028
|
+
const bo = Si(Xa);
|
|
4827
5029
|
export {
|
|
4828
5030
|
ot as $,
|
|
4829
5031
|
v as A,
|
|
@@ -4832,27 +5034,27 @@ export {
|
|
|
4832
5034
|
Nn as D,
|
|
4833
5035
|
Tt as E,
|
|
4834
5036
|
gi as F,
|
|
4835
|
-
|
|
5037
|
+
vo as G,
|
|
4836
5038
|
hc as H,
|
|
4837
5039
|
G as I,
|
|
4838
5040
|
et as J,
|
|
4839
5041
|
J as K,
|
|
4840
5042
|
dc as L,
|
|
4841
5043
|
$t as M,
|
|
4842
|
-
|
|
5044
|
+
uo as N,
|
|
4843
5045
|
$n as O,
|
|
4844
5046
|
mt as P,
|
|
4845
5047
|
yn as Q,
|
|
4846
|
-
|
|
5048
|
+
bo as R,
|
|
4847
5049
|
ri as S,
|
|
4848
5050
|
hi as T,
|
|
4849
5051
|
ht as U,
|
|
4850
|
-
|
|
5052
|
+
wo as V,
|
|
4851
5053
|
Qn as W,
|
|
4852
5054
|
Jn as X,
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
5055
|
+
go as Y,
|
|
5056
|
+
fo as Z,
|
|
5057
|
+
po as _,
|
|
4856
5058
|
di as a,
|
|
4857
5059
|
lt as a0,
|
|
4858
5060
|
st as a1,
|
|
@@ -4869,7 +5071,7 @@ export {
|
|
|
4869
5071
|
ui as i,
|
|
4870
5072
|
kn as j,
|
|
4871
5073
|
ii as k,
|
|
4872
|
-
|
|
5074
|
+
xo as l,
|
|
4873
5075
|
Mn as m,
|
|
4874
5076
|
mn as n,
|
|
4875
5077
|
ft as o,
|
|
@@ -4877,7 +5079,7 @@ export {
|
|
|
4877
5079
|
li as q,
|
|
4878
5080
|
xi as r,
|
|
4879
5081
|
Kn as s,
|
|
4880
|
-
|
|
5082
|
+
mo as t,
|
|
4881
5083
|
gn as u,
|
|
4882
5084
|
te as v,
|
|
4883
5085
|
jt as w,
|