reactjs-tiptap-editor 0.1.10 → 0.1.12
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/bundle-full.cjs +420 -0
- package/lib/bundle-full.js +66070 -0
- package/lib/{reactjs-tiptap-editor.cjs → index.cjs} +1 -1
- package/lib/index.d.cts +71 -67
- package/lib/index.d.ts +71 -67
- package/lib/{reactjs-tiptap-editor.js → index.js} +2 -2
- package/lib/{locales-DVkllJxt.js → locales-0_7hd40-.js} +24 -26
- package/lib/locales-BA8KlukH.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/{utils-Cz6APHbz.js → utils-BwnMHOHQ.js} +946 -946
- package/lib/utils-DLIpWZgM.cjs +152 -0
- package/package.json +18 -8
- package/lib/locales-BC6dbJkS.cjs +0 -1
- package/lib/utils-DVSn7b8y.cjs +0 -152
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var tr = Object.defineProperty;
|
|
2
2
|
var ir = (e, t, i) => t in e ? tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
3
|
var me = (e, t, i) => ir(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
-
import { jsxs as m, jsx as r, Fragment as
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
4
|
+
import { jsxs as m, jsx as r, Fragment as W } from "react/jsx-runtime";
|
|
5
|
+
import * as V from "react";
|
|
6
|
+
import Fe, { useState as w, useRef as J, useEffect as H, useCallback as T, useMemo as P, Fragment as dt, forwardRef as Lt, useImperativeHandle as St } from "react";
|
|
7
7
|
import "@radix-ui/react-toast";
|
|
8
|
-
import { ChevronRight as nr, Check as ai, Circle as rr, ChevronDown as Mt, ChevronUp as tn, HelpCircle as nn, Pencil as rn, Trash2 as an, X as ar, Plus as on, Bold as or, LoaderCircle as cr, Italic as sr, Underline as lr, Quote as dr, Strikethrough as hr, Minus as ur, Eraser as mr, PaintRoller as fr, Redo2 as gr, Undo2 as xr, Subscript as br, Superscript as pr, Code as wr, CodeXml as _r, Type as vr, IndentIncrease as yr, IndentDecrease as kr, List as Cr, ListOrdered as Nr, ListTodo as Tr, Link as Ar, ImageUp as Lr, Video as Sr, Maximize as Mr, Minimize as Ir, Table as zr, Sparkles as Er, Unlink as Hr, BetweenHorizonalEnd as Rr, BetweenHorizonalStart as Or, BetweenVerticalStart as Pr, BetweenVerticalEnd as Dr, TableCellsMerge as Br, TableCellsSplit as $r, Trash as
|
|
9
|
-
import { B as ce, N as ae, a as ue, m as ne, R as ge, n as oi, b as ka, u as Ca, E as Na, i as Ta, D as Aa, d as La, c as Sa, e as Ma, I as Ia, U as za, S as Ea, C as Ha, f as ct, g as Ra, h as Oa, F as Pa, H as Da, T as Ba, j as Y, k as $a, l as
|
|
8
|
+
import { ChevronRight as nr, Check as ai, Circle as rr, ChevronDown as Mt, ChevronUp as tn, HelpCircle as nn, Pencil as rn, Trash2 as an, X as ar, Plus as on, Bold as or, LoaderCircle as cr, Italic as sr, Underline as lr, Quote as dr, Strikethrough as hr, Minus as ur, Eraser as mr, PaintRoller as fr, Redo2 as gr, Undo2 as xr, Subscript as br, Superscript as pr, Code as wr, CodeXml as _r, Type as vr, IndentIncrease as yr, IndentDecrease as kr, List as Cr, ListOrdered as Nr, ListTodo as Tr, Link as Ar, ImageUp as Lr, Video as Sr, Maximize as Mr, Minimize as Ir, Table as zr, Sparkles as Er, Unlink as Hr, BetweenHorizonalEnd as Rr, BetweenHorizonalStart as Or, BetweenVerticalStart as Pr, BetweenVerticalEnd as Dr, TableCellsMerge as Br, TableCellsSplit as $r, Trash as Vr, Replace as Li, ChevronsUpDown as jr, Heading1 as Fr, Heading2 as Ur, Heading3 as Wr, Heading4 as qr, Heading5 as Gr, Heading6 as Kr, Columns2 as Si, Columns3 as Xr, Columns4 as Zr, GripVertical as Yr, Copy as cn, Clipboard as Jr, PanelLeft as Qr, PanelRight as ea, Frame as ta, SmilePlus as ia, SmilePlusIcon as na, Sigma as ra, BookMarked as aa, ZoomIn as oa, ZoomOut as ca, Settings as sa, Eye as la, Paperclip as da, CropIcon as ha, FlipVertical as ua, FlipHorizontal as ma, CopyCheck as fa, Clock3 as ga, Laugh as xa, LucideAudioLines as ba, LucideVideo as pa, LucideFile as wa, LucideImage as _a, LucideSheet as va, LucideTableProperties as ya } from "lucide-react";
|
|
9
|
+
import { B as ce, N as ae, a as ue, m as ne, R as ge, n as oi, b as ka, u as Ca, E as Na, i as Ta, D as Aa, d as La, c as Sa, e as Ma, I as Ia, U as za, S as Ea, C as Ha, f as ct, g as Ra, h as Oa, F as Pa, H as Da, T as Ba, j as Y, k as $a, l as Va, o as ja, O as Fa, p as Ua, q as Wa, r as qa, L as Ga, s as Ka, t as Xa, v as Za, w as Ya, x as Ct, P as Ja, y as Qa, z as eo, G as to, A as io, J as no, K as ro, M as ao, Q as oo, V as co, W as sn, X as ln, Y as dn, Z as ci, _ as si, $ as so, a0 as lo, a1 as ho, a2 as uo, a3 as mo, a4 as Mi } from "./tiptap-BSVYcz58.js";
|
|
10
10
|
import { am as fo, an as ee, ao as li, ap as di, aq as go, ar as hn, as as xo, at as Se, e as It, d as Me, au as un, av as hi, aw as bo, P as we, a as _e, a2 as Ue, a3 as qe, J as po, ax as Nt, ay as mn, aj as wo, az as _o } from "./vendor-C2GXVsjz.js";
|
|
11
11
|
import { bundledThemes as fn, bundledLanguages as gn, createHighlighter as vo } from "shiki";
|
|
12
|
-
import { u as B, C as yo, E as ko, l as
|
|
12
|
+
import { u as B, C as yo, E as ko, l as F, B as Co, I as Tt, V as Gt, M as No, D as xn, a as To, b as Ao, c as Ii, d as bn, e as Lo, f as Ge, g as Ke, h as ui, T as xt, i as bt, j as pt } from "./locales-0_7hd40-.js";
|
|
13
13
|
import * as Z from "@radix-ui/react-select";
|
|
14
14
|
import { Slot as mi } from "@radix-ui/react-slot";
|
|
15
15
|
import fi, { sticky as So } from "tippy.js";
|
|
16
16
|
import { flushSync as Xe } from "react-dom";
|
|
17
17
|
import Mo from "react-image-crop";
|
|
18
|
-
import {
|
|
18
|
+
import { createSignal as zt, useSignalValue as Et } from "reactjs-signal";
|
|
19
19
|
import * as Kt from "@radix-ui/react-checkbox";
|
|
20
20
|
import gi from "scroll-into-view-if-needed";
|
|
21
21
|
import * as Ie from "@radix-ui/react-tabs";
|
|
@@ -45,10 +45,10 @@ function Ht(e) {
|
|
|
45
45
|
function Rt(e) {
|
|
46
46
|
return e.map(Ht).join(" ");
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function D(...e) {
|
|
49
49
|
return fo(ee(e));
|
|
50
50
|
}
|
|
51
|
-
const p =
|
|
51
|
+
const p = Fe.forwardRef(
|
|
52
52
|
(e, t) => {
|
|
53
53
|
const {
|
|
54
54
|
icon: i = void 0,
|
|
@@ -57,40 +57,40 @@ const p = Ve.forwardRef(
|
|
|
57
57
|
disabled: a = !1,
|
|
58
58
|
customClass: o = "",
|
|
59
59
|
// color = undefined,
|
|
60
|
-
|
|
61
|
-
shortcutKeys:
|
|
62
|
-
tooltipOptions:
|
|
63
|
-
action:
|
|
64
|
-
isActive:
|
|
65
|
-
children:
|
|
60
|
+
loading: c = void 0,
|
|
61
|
+
shortcutKeys: s = void 0,
|
|
62
|
+
tooltipOptions: l = {},
|
|
63
|
+
action: d = void 0,
|
|
64
|
+
isActive: h = void 0,
|
|
65
|
+
children: f,
|
|
66
66
|
asChild: u = !1,
|
|
67
|
-
upload:
|
|
68
|
-
...
|
|
69
|
-
} = e,
|
|
67
|
+
upload: g = !1,
|
|
68
|
+
...x
|
|
69
|
+
} = e, b = gt[i];
|
|
70
70
|
return /* @__PURE__ */ m(et, { children: [
|
|
71
71
|
/* @__PURE__ */ r(tt, { asChild: !0, children: /* @__PURE__ */ m(
|
|
72
72
|
u ? mi : ft,
|
|
73
73
|
{
|
|
74
74
|
ref: t,
|
|
75
75
|
size: "sm",
|
|
76
|
-
className:
|
|
76
|
+
className: D("richtext-w-[32px] richtext-h-[32px]", o),
|
|
77
77
|
disabled: a,
|
|
78
|
-
onClick:
|
|
79
|
-
"data-state":
|
|
80
|
-
...
|
|
78
|
+
onClick: d,
|
|
79
|
+
"data-state": h != null && h() ? "on" : "off",
|
|
80
|
+
...x,
|
|
81
81
|
children: [
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
b && /* @__PURE__ */ r(b, { className: "richtext-w-4 richtext-h-4" }),
|
|
83
|
+
f
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
) }),
|
|
87
|
-
n && /* @__PURE__ */ r(Ee, { ...
|
|
87
|
+
n && /* @__PURE__ */ r(Ee, { ...l, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
|
|
88
88
|
/* @__PURE__ */ r("div", { children: n }),
|
|
89
|
-
!!(
|
|
89
|
+
!!(s != null && s.length) && /* @__PURE__ */ r("span", { children: Rt(s) })
|
|
90
90
|
] }) })
|
|
91
91
|
] });
|
|
92
92
|
}
|
|
93
|
-
), bi =
|
|
93
|
+
), bi = Fe.forwardRef(
|
|
94
94
|
({ asChild: e, ...t }, i) => {
|
|
95
95
|
var o;
|
|
96
96
|
const n = gt[t.icon];
|
|
@@ -143,8 +143,8 @@ function ut(e, t, i, n) {
|
|
|
143
143
|
return H(() => {
|
|
144
144
|
const l = () => {
|
|
145
145
|
const d = { ...i, ...e.getAttributes(t) };
|
|
146
|
-
Object.keys(d).forEach((
|
|
147
|
-
(d[
|
|
146
|
+
Object.keys(d).forEach((f) => {
|
|
147
|
+
(d[f] === null || d[f] === void 0) && (d[f] = i ? i[f] : null);
|
|
148
148
|
});
|
|
149
149
|
const h = a(d);
|
|
150
150
|
li(s.current, h) || (c(h), s.current = h);
|
|
@@ -154,11 +154,11 @@ function ut(e, t, i, n) {
|
|
|
154
154
|
};
|
|
155
155
|
}, [e, i, t, a]), o;
|
|
156
156
|
}
|
|
157
|
-
const mt =
|
|
157
|
+
const mt = V.forwardRef(
|
|
158
158
|
({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
159
159
|
"textarea",
|
|
160
160
|
{
|
|
161
|
-
className:
|
|
161
|
+
className: D(
|
|
162
162
|
"richtext-flex richtext-min-h-[80px] richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder: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-cursor-not-allowed disabled:richtext-opacity-50",
|
|
163
163
|
e
|
|
164
164
|
),
|
|
@@ -168,7 +168,7 @@ const mt = j.forwardRef(
|
|
|
168
168
|
)
|
|
169
169
|
);
|
|
170
170
|
mt.displayName = "Textarea";
|
|
171
|
-
const
|
|
171
|
+
const Vo = di(
|
|
172
172
|
"richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors 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",
|
|
173
173
|
{
|
|
174
174
|
variants: {
|
|
@@ -192,22 +192,22 @@ const jo = di(
|
|
|
192
192
|
size: "default"
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
), U =
|
|
195
|
+
), U = V.forwardRef(
|
|
196
196
|
({ className: e, variant: t, size: i, asChild: n = !1, ...a }, o) => /* @__PURE__ */ r(
|
|
197
197
|
n ? mi : "button",
|
|
198
198
|
{
|
|
199
|
-
className:
|
|
199
|
+
className: D(Vo({ variant: t, size: i, className: e })),
|
|
200
200
|
ref: o,
|
|
201
201
|
...a
|
|
202
202
|
}
|
|
203
203
|
)
|
|
204
204
|
);
|
|
205
205
|
U.displayName = "Button";
|
|
206
|
-
const ve = K.Root, ye = K.Trigger, zi = K.Portal, Ei = K.Sub, Zt =
|
|
206
|
+
const ve = K.Root, ye = K.Trigger, zi = K.Portal, Ei = K.Sub, Zt = V.forwardRef(({ className: e, inset: t, children: i, ...n }, a) => /* @__PURE__ */ m(
|
|
207
207
|
K.SubTrigger,
|
|
208
208
|
{
|
|
209
209
|
ref: a,
|
|
210
|
-
className:
|
|
210
|
+
className: D(
|
|
211
211
|
"richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",
|
|
212
212
|
t && "richtext-pl-8",
|
|
213
213
|
e
|
|
@@ -220,11 +220,11 @@ const ve = K.Root, ye = K.Trigger, zi = K.Portal, Ei = K.Sub, Zt = j.forwardRef(
|
|
|
220
220
|
}
|
|
221
221
|
));
|
|
222
222
|
Zt.displayName = K.SubTrigger.displayName;
|
|
223
|
-
const Yt =
|
|
223
|
+
const Yt = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
224
224
|
K.SubContent,
|
|
225
225
|
{
|
|
226
226
|
ref: i,
|
|
227
|
-
className:
|
|
227
|
+
className: D(
|
|
228
228
|
"richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-lg data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
|
|
229
229
|
e
|
|
230
230
|
),
|
|
@@ -232,12 +232,12 @@ const Yt = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
232
232
|
}
|
|
233
233
|
));
|
|
234
234
|
Yt.displayName = K.SubContent.displayName;
|
|
235
|
-
const be =
|
|
235
|
+
const be = V.forwardRef(({ className: e, sideOffset: t = 4, ...i }, n) => /* @__PURE__ */ r(K.Portal, { children: /* @__PURE__ */ r(
|
|
236
236
|
K.Content,
|
|
237
237
|
{
|
|
238
238
|
ref: n,
|
|
239
239
|
sideOffset: t,
|
|
240
|
-
className:
|
|
240
|
+
className: D(
|
|
241
241
|
"richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
|
|
242
242
|
e
|
|
243
243
|
),
|
|
@@ -245,11 +245,11 @@ const be = j.forwardRef(({ className: e, sideOffset: t = 4, ...i }, n) => /* @__
|
|
|
245
245
|
}
|
|
246
246
|
) }));
|
|
247
247
|
be.displayName = K.Content.displayName;
|
|
248
|
-
const de =
|
|
248
|
+
const de = V.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */ r(
|
|
249
249
|
K.Item,
|
|
250
250
|
{
|
|
251
251
|
ref: n,
|
|
252
|
-
className:
|
|
252
|
+
className: D(
|
|
253
253
|
"richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
|
|
254
254
|
t && "richtext-pl-8",
|
|
255
255
|
e
|
|
@@ -258,11 +258,11 @@ const de = j.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */
|
|
|
258
258
|
}
|
|
259
259
|
));
|
|
260
260
|
de.displayName = K.Item.displayName;
|
|
261
|
-
const ze =
|
|
261
|
+
const ze = V.forwardRef(({ className: e, children: t, checked: i, ...n }, a) => /* @__PURE__ */ m(
|
|
262
262
|
K.CheckboxItem,
|
|
263
263
|
{
|
|
264
264
|
ref: a,
|
|
265
|
-
className:
|
|
265
|
+
className: D(
|
|
266
266
|
"richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
|
|
267
267
|
e
|
|
268
268
|
),
|
|
@@ -275,11 +275,11 @@ const ze = j.forwardRef(({ className: e, children: t, checked: i, ...n }, a) =>
|
|
|
275
275
|
}
|
|
276
276
|
));
|
|
277
277
|
ze.displayName = K.CheckboxItem.displayName;
|
|
278
|
-
const
|
|
278
|
+
const jo = V.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ m(
|
|
279
279
|
K.RadioItem,
|
|
280
280
|
{
|
|
281
281
|
ref: n,
|
|
282
|
-
className:
|
|
282
|
+
className: D(
|
|
283
283
|
"richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
|
|
284
284
|
e
|
|
285
285
|
),
|
|
@@ -290,12 +290,12 @@ const Fo = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__
|
|
|
290
290
|
]
|
|
291
291
|
}
|
|
292
292
|
));
|
|
293
|
-
|
|
294
|
-
const
|
|
293
|
+
jo.displayName = K.RadioItem.displayName;
|
|
294
|
+
const Fo = V.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */ r(
|
|
295
295
|
K.Label,
|
|
296
296
|
{
|
|
297
297
|
ref: n,
|
|
298
|
-
className:
|
|
298
|
+
className: D(
|
|
299
299
|
"richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",
|
|
300
300
|
t && "richtext-pl-8",
|
|
301
301
|
e
|
|
@@ -303,12 +303,12 @@ const Vo = j.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */
|
|
|
303
303
|
...i
|
|
304
304
|
}
|
|
305
305
|
));
|
|
306
|
-
|
|
307
|
-
const Ot =
|
|
306
|
+
Fo.displayName = K.Label.displayName;
|
|
307
|
+
const Ot = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
308
308
|
K.Separator,
|
|
309
309
|
{
|
|
310
310
|
ref: i,
|
|
311
|
-
className:
|
|
311
|
+
className: D("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", e),
|
|
312
312
|
...t
|
|
313
313
|
}
|
|
314
314
|
));
|
|
@@ -320,18 +320,18 @@ function yn({
|
|
|
320
320
|
return /* @__PURE__ */ r(
|
|
321
321
|
"span",
|
|
322
322
|
{
|
|
323
|
-
className:
|
|
323
|
+
className: D("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", e),
|
|
324
324
|
...t
|
|
325
325
|
}
|
|
326
326
|
);
|
|
327
327
|
}
|
|
328
328
|
yn.displayName = "DropdownMenuShortcut";
|
|
329
|
-
const te =
|
|
329
|
+
const te = V.forwardRef(
|
|
330
330
|
({ className: e, type: t, ...i }, n) => /* @__PURE__ */ r(
|
|
331
331
|
"input",
|
|
332
332
|
{
|
|
333
333
|
type: t,
|
|
334
|
-
className:
|
|
334
|
+
className: D(
|
|
335
335
|
"richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",
|
|
336
336
|
e
|
|
337
337
|
),
|
|
@@ -343,22 +343,22 @@ const te = j.forwardRef(
|
|
|
343
343
|
te.displayName = "Input";
|
|
344
344
|
const Uo = di(
|
|
345
345
|
"richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"
|
|
346
|
-
), ie =
|
|
346
|
+
), ie = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
347
347
|
pn.Root,
|
|
348
348
|
{
|
|
349
349
|
ref: i,
|
|
350
|
-
className:
|
|
350
|
+
className: D(Uo(), e),
|
|
351
351
|
...t
|
|
352
352
|
}
|
|
353
353
|
));
|
|
354
354
|
ie.displayName = pn.Root.displayName;
|
|
355
|
-
const se = st.Root, le = st.Trigger, re =
|
|
355
|
+
const se = st.Root, le = st.Trigger, re = V.forwardRef(({ className: e, align: t = "center", sideOffset: i = 4, ...n }, a) => /* @__PURE__ */ r(st.Portal, { children: /* @__PURE__ */ r(
|
|
356
356
|
st.Content,
|
|
357
357
|
{
|
|
358
358
|
ref: a,
|
|
359
359
|
align: t,
|
|
360
360
|
sideOffset: i,
|
|
361
|
-
className:
|
|
361
|
+
className: D(
|
|
362
362
|
"richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
|
|
363
363
|
e
|
|
364
364
|
),
|
|
@@ -366,14 +366,14 @@ const se = st.Root, le = st.Trigger, re = j.forwardRef(({ className: e, align: t
|
|
|
366
366
|
}
|
|
367
367
|
) }));
|
|
368
368
|
re.displayName = st.Content.displayName;
|
|
369
|
-
const he =
|
|
369
|
+
const he = V.forwardRef(
|
|
370
370
|
({ className: e, orientation: t = "horizontal", decorative: i = !0, ...n }, a) => /* @__PURE__ */ r(
|
|
371
371
|
_n.Root,
|
|
372
372
|
{
|
|
373
373
|
ref: a,
|
|
374
374
|
decorative: i,
|
|
375
375
|
orientation: t,
|
|
376
|
-
className:
|
|
376
|
+
className: D(
|
|
377
377
|
"richtext-shrink-0 richtext-bg-border",
|
|
378
378
|
t === "horizontal" ? "richtext-h-[1px] richtext-w-full" : "richtext-h-full richtext-w-[1px]",
|
|
379
379
|
e
|
|
@@ -383,10 +383,10 @@ const he = j.forwardRef(
|
|
|
383
383
|
)
|
|
384
384
|
);
|
|
385
385
|
he.displayName = _n.Root.displayName;
|
|
386
|
-
const pi =
|
|
386
|
+
const pi = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
387
387
|
Xt.Root,
|
|
388
388
|
{
|
|
389
|
-
className:
|
|
389
|
+
className: D(
|
|
390
390
|
"richtext-peer richtext-inline-flex richtext-h-6 richtext-w-11 richtext-shrink-0 richtext-cursor-pointer richtext-items-center richtext-rounded-full richtext-border-2 richtext-border-transparent richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 focus-visible:richtext-ring-offset-background disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 data-[state=checked]:richtext-bg-primary data-[state=unchecked]:richtext-bg-input",
|
|
391
391
|
e
|
|
392
392
|
),
|
|
@@ -395,7 +395,7 @@ const pi = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
395
395
|
children: /* @__PURE__ */ r(
|
|
396
396
|
Xt.Thumb,
|
|
397
397
|
{
|
|
398
|
-
className:
|
|
398
|
+
className: D(
|
|
399
399
|
"richtext-pointer-events-none richtext-block richtext-h-5 richtext-w-5 richtext-rounded-full richtext-bg-background richtext-shadow-lg richtext-ring-0 richtext-transition-transform data-[state=checked]:richtext-translate-x-5 data-[state=unchecked]:richtext-translate-x-0"
|
|
400
400
|
)
|
|
401
401
|
}
|
|
@@ -403,11 +403,11 @@ const pi = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
403
403
|
}
|
|
404
404
|
));
|
|
405
405
|
pi.displayName = Xt.Root.displayName;
|
|
406
|
-
const wi = Ie.Root, Pt =
|
|
406
|
+
const wi = Ie.Root, Pt = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
407
407
|
Ie.List,
|
|
408
408
|
{
|
|
409
409
|
ref: i,
|
|
410
|
-
className:
|
|
410
|
+
className: D(
|
|
411
411
|
"richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",
|
|
412
412
|
e
|
|
413
413
|
),
|
|
@@ -415,11 +415,11 @@ const wi = Ie.Root, Pt = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE_
|
|
|
415
415
|
}
|
|
416
416
|
));
|
|
417
417
|
Pt.displayName = Ie.List.displayName;
|
|
418
|
-
const Ze =
|
|
418
|
+
const Ze = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
419
419
|
Ie.Trigger,
|
|
420
420
|
{
|
|
421
421
|
ref: i,
|
|
422
|
-
className:
|
|
422
|
+
className: D(
|
|
423
423
|
"richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all 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=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",
|
|
424
424
|
e
|
|
425
425
|
),
|
|
@@ -427,11 +427,11 @@ const Ze = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
427
427
|
}
|
|
428
428
|
));
|
|
429
429
|
Ze.displayName = Ie.Trigger.displayName;
|
|
430
|
-
const Ye =
|
|
430
|
+
const Ye = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
431
431
|
Ie.Content,
|
|
432
432
|
{
|
|
433
433
|
ref: i,
|
|
434
|
-
className:
|
|
434
|
+
className: D(
|
|
435
435
|
"richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2",
|
|
436
436
|
e
|
|
437
437
|
),
|
|
@@ -458,21 +458,21 @@ const Wo = di(
|
|
|
458
458
|
size: "default"
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
), ft =
|
|
461
|
+
), ft = V.forwardRef(({ className: e, variant: t, size: i, ...n }, a) => /* @__PURE__ */ r(
|
|
462
462
|
vn.Root,
|
|
463
463
|
{
|
|
464
464
|
ref: a,
|
|
465
|
-
className:
|
|
465
|
+
className: D(Wo({ variant: t, size: i, className: e })),
|
|
466
466
|
...n
|
|
467
467
|
}
|
|
468
468
|
));
|
|
469
469
|
ft.displayName = vn.Root.displayName;
|
|
470
|
-
const qo = ht.Provider, et = ht.Root, tt = ht.Trigger, Ee =
|
|
470
|
+
const qo = ht.Provider, et = ht.Root, tt = ht.Trigger, Ee = V.forwardRef(({ className: e, sideOffset: t = 4, ...i }, n) => /* @__PURE__ */ r(
|
|
471
471
|
ht.Content,
|
|
472
472
|
{
|
|
473
473
|
ref: n,
|
|
474
474
|
sideOffset: t,
|
|
475
|
-
className:
|
|
475
|
+
className: D(
|
|
476
476
|
"richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-popover-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
|
|
477
477
|
e
|
|
478
478
|
),
|
|
@@ -480,11 +480,11 @@ const qo = ht.Provider, et = ht.Root, tt = ht.Trigger, Ee = j.forwardRef(({ clas
|
|
|
480
480
|
}
|
|
481
481
|
));
|
|
482
482
|
Ee.displayName = ht.Content.displayName;
|
|
483
|
-
const Go = Z.Root, Ko = Z.Value, kn =
|
|
483
|
+
const Go = Z.Root, Ko = Z.Value, kn = V.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ m(
|
|
484
484
|
Z.Trigger,
|
|
485
485
|
{
|
|
486
486
|
ref: n,
|
|
487
|
-
className:
|
|
487
|
+
className: D(
|
|
488
488
|
"richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",
|
|
489
489
|
e
|
|
490
490
|
),
|
|
@@ -496,11 +496,11 @@ const Go = Z.Root, Ko = Z.Value, kn = j.forwardRef(({ className: e, children: t,
|
|
|
496
496
|
}
|
|
497
497
|
));
|
|
498
498
|
kn.displayName = Z.Trigger.displayName;
|
|
499
|
-
const Cn =
|
|
499
|
+
const Cn = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
500
500
|
Z.ScrollUpButton,
|
|
501
501
|
{
|
|
502
502
|
ref: i,
|
|
503
|
-
className:
|
|
503
|
+
className: D(
|
|
504
504
|
"richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
|
|
505
505
|
e
|
|
506
506
|
),
|
|
@@ -509,11 +509,11 @@ const Cn = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
509
509
|
}
|
|
510
510
|
));
|
|
511
511
|
Cn.displayName = Z.ScrollUpButton.displayName;
|
|
512
|
-
const Nn =
|
|
512
|
+
const Nn = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
513
513
|
Z.ScrollDownButton,
|
|
514
514
|
{
|
|
515
515
|
ref: i,
|
|
516
|
-
className:
|
|
516
|
+
className: D(
|
|
517
517
|
"richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
|
|
518
518
|
e
|
|
519
519
|
),
|
|
@@ -522,11 +522,11 @@ const Nn = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
522
522
|
}
|
|
523
523
|
));
|
|
524
524
|
Nn.displayName = Z.ScrollDownButton.displayName;
|
|
525
|
-
const Tn =
|
|
525
|
+
const Tn = V.forwardRef(({ className: e, children: t, position: i = "popper", ...n }, a) => /* @__PURE__ */ r(Z.Portal, { children: /* @__PURE__ */ m(
|
|
526
526
|
Z.Content,
|
|
527
527
|
{
|
|
528
528
|
ref: a,
|
|
529
|
-
className:
|
|
529
|
+
className: D(
|
|
530
530
|
"richtext-relative richtext-z-50 richtext-max-h-60 richtext-overflow-y-auto richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md richtext-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
|
|
531
531
|
i === "popper" && "data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",
|
|
532
532
|
e
|
|
@@ -538,7 +538,7 @@ const Tn = j.forwardRef(({ className: e, children: t, position: i = "popper", ..
|
|
|
538
538
|
/* @__PURE__ */ r(
|
|
539
539
|
Z.Viewport,
|
|
540
540
|
{
|
|
541
|
-
className:
|
|
541
|
+
className: D(
|
|
542
542
|
"richtext-p-1",
|
|
543
543
|
i === "popper" && "richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"
|
|
544
544
|
),
|
|
@@ -550,20 +550,20 @@ const Tn = j.forwardRef(({ className: e, children: t, position: i = "popper", ..
|
|
|
550
550
|
}
|
|
551
551
|
) }));
|
|
552
552
|
Tn.displayName = Z.Content.displayName;
|
|
553
|
-
const Xo =
|
|
553
|
+
const Xo = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
554
554
|
Z.Label,
|
|
555
555
|
{
|
|
556
556
|
ref: i,
|
|
557
|
-
className:
|
|
557
|
+
className: D("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold", e),
|
|
558
558
|
...t
|
|
559
559
|
}
|
|
560
560
|
));
|
|
561
561
|
Xo.displayName = Z.Label.displayName;
|
|
562
|
-
const Jt =
|
|
562
|
+
const Jt = V.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ m(
|
|
563
563
|
Z.Item,
|
|
564
564
|
{
|
|
565
565
|
ref: n,
|
|
566
|
-
className:
|
|
566
|
+
className: D(
|
|
567
567
|
"richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
|
|
568
568
|
e
|
|
569
569
|
),
|
|
@@ -575,20 +575,20 @@ const Jt = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__
|
|
|
575
575
|
}
|
|
576
576
|
));
|
|
577
577
|
Jt.displayName = Z.Item.displayName;
|
|
578
|
-
const Zo =
|
|
578
|
+
const Zo = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
579
579
|
Z.Separator,
|
|
580
580
|
{
|
|
581
581
|
ref: i,
|
|
582
|
-
className:
|
|
582
|
+
className: D("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", e),
|
|
583
583
|
...t
|
|
584
584
|
}
|
|
585
585
|
));
|
|
586
586
|
Zo.displayName = Z.Separator.displayName;
|
|
587
|
-
const An =
|
|
587
|
+
const An = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
588
588
|
Kt.Root,
|
|
589
589
|
{
|
|
590
590
|
ref: i,
|
|
591
|
-
className:
|
|
591
|
+
className: D(
|
|
592
592
|
"!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-p-0 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-2 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",
|
|
593
593
|
e
|
|
594
594
|
),
|
|
@@ -596,7 +596,7 @@ const An = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
596
596
|
children: /* @__PURE__ */ r(
|
|
597
597
|
Kt.Indicator,
|
|
598
598
|
{
|
|
599
|
-
className:
|
|
599
|
+
className: D("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),
|
|
600
600
|
children: /* @__PURE__ */ r(ai, { className: "!richtext-h-4 !richtext-w-4" })
|
|
601
601
|
}
|
|
602
602
|
)
|
|
@@ -604,26 +604,26 @@ const An = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
604
604
|
));
|
|
605
605
|
An.displayName = Kt.Root.displayName;
|
|
606
606
|
function Yo({ editor: e, ...t }) {
|
|
607
|
-
const i = ut(e,
|
|
607
|
+
const i = ut(e, je.name, {
|
|
608
608
|
text: "",
|
|
609
609
|
defaultShowPicker: !1
|
|
610
|
-
}), { text: n, defaultShowPicker: a } = i, [o, c] = w(""), [s, l] = w(!1), d =
|
|
610
|
+
}), { text: n, defaultShowPicker: a } = i, [o, c] = w(""), [s, l] = w(!1), d = T(() => e.isActive(je.name), [e]), h = T(() => Qe(je.name, e), [e]), f = T(() => {
|
|
611
611
|
e.chain().focus().setKatex({ text: o }).run(), l(!1);
|
|
612
612
|
}, [e, o]);
|
|
613
613
|
H(() => {
|
|
614
|
-
a && (l(!0), e.chain().updateAttributes(
|
|
614
|
+
a && (l(!0), e.chain().updateAttributes(je.name, { defaultShowPicker: !1 }).focus().run());
|
|
615
615
|
}, [e, a, l]), H(() => {
|
|
616
616
|
s && c(n || "");
|
|
617
617
|
}, [s]);
|
|
618
|
-
const
|
|
618
|
+
const u = P(() => {
|
|
619
619
|
try {
|
|
620
620
|
return xi.renderToString(`${o}`);
|
|
621
621
|
} catch {
|
|
622
622
|
return o;
|
|
623
623
|
}
|
|
624
|
-
}, [o]), g =
|
|
625
|
-
() => `${o}`.trim() ? /* @__PURE__ */ r("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html:
|
|
626
|
-
[o,
|
|
624
|
+
}, [o]), g = P(
|
|
625
|
+
() => `${o}`.trim() ? /* @__PURE__ */ r("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html: u || "" } }) : null,
|
|
626
|
+
[o, u]
|
|
627
627
|
);
|
|
628
628
|
return /* @__PURE__ */ r(
|
|
629
629
|
ce,
|
|
@@ -642,7 +642,7 @@ function Yo({ editor: e, ...t }) {
|
|
|
642
642
|
l(!1);
|
|
643
643
|
}
|
|
644
644
|
},
|
|
645
|
-
children: t != null && t.disabled ? /* @__PURE__ */ r(
|
|
645
|
+
children: t != null && t.disabled ? /* @__PURE__ */ r(W, {}) : /* @__PURE__ */ r("div", { className: "richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800", children: s ? /* @__PURE__ */ m(W, { children: [
|
|
646
646
|
/* @__PURE__ */ r(
|
|
647
647
|
mt,
|
|
648
648
|
{
|
|
@@ -657,7 +657,7 @@ function Yo({ editor: e, ...t }) {
|
|
|
657
657
|
),
|
|
658
658
|
g && /* @__PURE__ */ r("div", { className: "richtext-my-[10px] richtext-p-[10px] richtext-rounded-[6px] !richtext-border-[1px] richtext-whitespace-nowrap richtext-overflow-auto", children: g }),
|
|
659
659
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
|
|
660
|
-
/* @__PURE__ */ r(U, { onClick:
|
|
660
|
+
/* @__PURE__ */ r(U, { onClick: f, className: "richtext-flex-1", children: "Submit" }),
|
|
661
661
|
/* @__PURE__ */ r("a", { href: "https://katex.org/docs/supported", target: "_blank", rel: "noreferrer noopener", children: /* @__PURE__ */ r(nn, { size: 16 }) })
|
|
662
662
|
] })
|
|
663
663
|
] }) : /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]", children: [
|
|
@@ -794,13 +794,13 @@ function Qt(e) {
|
|
|
794
794
|
}
|
|
795
795
|
const lc = 10, dc = 200, Hi = 15, Ri = { width: "100%", height: "100%", maxWidth: "100%" };
|
|
796
796
|
function hc({ editor: e, node: t, updateAttributes: i }) {
|
|
797
|
-
const n = J(null), a = e.isActive(Be.name), { data: o, width: c, height: s } = t.attrs, [l, d] = w(null), [h,
|
|
797
|
+
const n = J(null), a = e.isActive(Be.name), { data: o, width: c, height: s } = t.attrs, [l, d] = w(null), [h, f] = w(!0), [u, g] = w(null), [x, b] = w(!1), [C, A] = w(100), v = T(
|
|
798
798
|
(N) => {
|
|
799
799
|
N && b(!0);
|
|
800
800
|
},
|
|
801
801
|
[b]
|
|
802
|
-
), _ =
|
|
803
|
-
|
|
802
|
+
), _ = T((N) => () => {
|
|
803
|
+
A(
|
|
804
804
|
(I) => Sn(N === "minus" ? I - Hi : I + Hi, lc, dc)
|
|
805
805
|
);
|
|
806
806
|
}, []);
|
|
@@ -808,20 +808,20 @@ function hc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
808
808
|
let N = !1;
|
|
809
809
|
return import("@excalidraw/excalidraw").then((I) => {
|
|
810
810
|
N || (n.current = I.exportToSvg);
|
|
811
|
-
}).catch((I) => !N && g(I)).finally(() => !N &&
|
|
811
|
+
}).catch((I) => !N && g(I)).finally(() => !N && f(!1)), () => {
|
|
812
812
|
N = !0;
|
|
813
813
|
};
|
|
814
|
-
}, [
|
|
814
|
+
}, [f, o]), H(() => {
|
|
815
815
|
let N = !1;
|
|
816
816
|
return (async () => {
|
|
817
|
-
if (N || h ||
|
|
817
|
+
if (N || h || u || !x || !o)
|
|
818
818
|
return;
|
|
819
819
|
const O = await n.current(o);
|
|
820
820
|
N || (O.setAttribute("width", "100%"), O.setAttribute("height", "100%"), O.setAttribute("display", "block"), d(O));
|
|
821
821
|
})(), () => {
|
|
822
822
|
N = !0;
|
|
823
823
|
};
|
|
824
|
-
}, [o, h,
|
|
824
|
+
}, [o, h, u, x]);
|
|
825
825
|
const k = (N) => {
|
|
826
826
|
i({ width: N.width, height: N.height });
|
|
827
827
|
};
|
|
@@ -841,9 +841,9 @@ function hc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
841
841
|
className: ee(nt.renderWrap, "render-wrapper"),
|
|
842
842
|
style: { ...Ri, overflow: "hidden" },
|
|
843
843
|
children: [
|
|
844
|
-
|
|
844
|
+
u && /* @__PURE__ */ r("div", { style: Ri, children: /* @__PURE__ */ r("p", { children: u.message || u }) }),
|
|
845
845
|
h && /* @__PURE__ */ r("p", { children: "Loading..." }),
|
|
846
|
-
!h && !
|
|
846
|
+
!h && !u && x && /* @__PURE__ */ r(
|
|
847
847
|
"div",
|
|
848
848
|
{
|
|
849
849
|
style: {
|
|
@@ -885,7 +885,7 @@ function hc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
885
885
|
}
|
|
886
886
|
) }) });
|
|
887
887
|
}
|
|
888
|
-
const uc =
|
|
888
|
+
const uc = Fe.memo(hc, (e, t) => !!li(e.node.attrs, t.node.attrs));
|
|
889
889
|
function mc(e, t = "{}") {
|
|
890
890
|
try {
|
|
891
891
|
return JSON.stringify(e);
|
|
@@ -908,8 +908,8 @@ function Q(e, t = !1) {
|
|
|
908
908
|
try {
|
|
909
909
|
const s = i.outerHTML.match(/([\s\S])+?="([\s\S])+?"/g);
|
|
910
910
|
s && s.length && (a = (s.map((d) => d.trim()).reduce((d, h) => {
|
|
911
|
-
const
|
|
912
|
-
return d[
|
|
911
|
+
const f = h.indexOf("="), u = [h.slice(0, f), h.slice(f + 1).slice(1, -1)];
|
|
912
|
+
return d[u[0]] = u[1], d;
|
|
913
913
|
}, {})[e.toLowerCase()] || "").replaceAll(""", '"'));
|
|
914
914
|
} catch (c) {
|
|
915
915
|
console.error("Error getDatasetAttribute ", c.message, i);
|
|
@@ -936,11 +936,11 @@ function gc(e) {
|
|
|
936
936
|
return typeof a == "object" ? o = fc(a) : o = a, i[n] = o, i;
|
|
937
937
|
}, /* @__PURE__ */ Object.create(null));
|
|
938
938
|
}
|
|
939
|
-
const He = oe.Root, Re = oe.Trigger, xc = oe.Portal, In =
|
|
939
|
+
const He = oe.Root, Re = oe.Trigger, xc = oe.Portal, In = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
940
940
|
oe.Overlay,
|
|
941
941
|
{
|
|
942
942
|
ref: i,
|
|
943
|
-
className:
|
|
943
|
+
className: D(
|
|
944
944
|
"richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 richtext- data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",
|
|
945
945
|
e
|
|
946
946
|
),
|
|
@@ -948,13 +948,13 @@ const He = oe.Root, Re = oe.Trigger, xc = oe.Portal, In = j.forwardRef(({ classN
|
|
|
948
948
|
}
|
|
949
949
|
));
|
|
950
950
|
In.displayName = oe.Overlay.displayName;
|
|
951
|
-
const ke =
|
|
951
|
+
const ke = V.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ m(xc, { children: [
|
|
952
952
|
/* @__PURE__ */ r(In, {}),
|
|
953
953
|
/* @__PURE__ */ m(
|
|
954
954
|
oe.Content,
|
|
955
955
|
{
|
|
956
956
|
ref: n,
|
|
957
|
-
className:
|
|
957
|
+
className: D(
|
|
958
958
|
"richtext-dialog-content richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",
|
|
959
959
|
e
|
|
960
960
|
),
|
|
@@ -977,7 +977,7 @@ function zn({
|
|
|
977
977
|
return /* @__PURE__ */ r(
|
|
978
978
|
"div",
|
|
979
979
|
{
|
|
980
|
-
className:
|
|
980
|
+
className: D(
|
|
981
981
|
"richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",
|
|
982
982
|
e
|
|
983
983
|
),
|
|
@@ -993,7 +993,7 @@ function it({
|
|
|
993
993
|
return /* @__PURE__ */ r(
|
|
994
994
|
"div",
|
|
995
995
|
{
|
|
996
|
-
className:
|
|
996
|
+
className: D(
|
|
997
997
|
"richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",
|
|
998
998
|
e
|
|
999
999
|
),
|
|
@@ -1002,11 +1002,11 @@ function it({
|
|
|
1002
1002
|
);
|
|
1003
1003
|
}
|
|
1004
1004
|
it.displayName = "DialogFooter";
|
|
1005
|
-
const Ce =
|
|
1005
|
+
const Ce = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
1006
1006
|
oe.Title,
|
|
1007
1007
|
{
|
|
1008
1008
|
ref: i,
|
|
1009
|
-
className:
|
|
1009
|
+
className: D(
|
|
1010
1010
|
"richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",
|
|
1011
1011
|
e
|
|
1012
1012
|
),
|
|
@@ -1014,19 +1014,19 @@ const Ce = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
1014
1014
|
}
|
|
1015
1015
|
));
|
|
1016
1016
|
Ce.displayName = oe.Title.displayName;
|
|
1017
|
-
const bc =
|
|
1017
|
+
const bc = V.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
1018
1018
|
oe.Description,
|
|
1019
1019
|
{
|
|
1020
1020
|
ref: i,
|
|
1021
|
-
className:
|
|
1021
|
+
className: D("richtext-text-sm richtext-text-muted-foreground", e),
|
|
1022
1022
|
...t
|
|
1023
1023
|
}
|
|
1024
1024
|
));
|
|
1025
1025
|
bc.displayName = oe.Description.displayName;
|
|
1026
|
-
let
|
|
1026
|
+
let Vt;
|
|
1027
1027
|
function _i() {
|
|
1028
1028
|
try {
|
|
1029
|
-
return
|
|
1029
|
+
return Vt || (Vt = Jo()), Vt;
|
|
1030
1030
|
} catch {
|
|
1031
1031
|
throw new Error("Error EventEmitter");
|
|
1032
1032
|
}
|
|
@@ -1042,24 +1042,24 @@ function _c(e) {
|
|
|
1042
1042
|
_i().emit(ei, e);
|
|
1043
1043
|
}
|
|
1044
1044
|
const vc = ({ editor: e }) => {
|
|
1045
|
-
const [t, i] = w(null), [n, a] = w({}), [o, c] = w({ elements: [], appState: { isLoading: !1 }, files: null }), [s, l] = w(!1), [d, h] = w(!0), [
|
|
1046
|
-
(
|
|
1047
|
-
|
|
1045
|
+
const [t, i] = w(null), [n, a] = w({}), [o, c] = w({ elements: [], appState: { isLoading: !1 }, files: null }), [s, l] = w(!1), [d, h] = w(!0), [f, u] = w(null), g = T(
|
|
1046
|
+
(A) => {
|
|
1047
|
+
A && import("@excalidraw/excalidraw").then((v) => {
|
|
1048
1048
|
i(v.Excalidraw);
|
|
1049
|
-
}).catch(
|
|
1049
|
+
}).catch(u).finally(() => h(!1));
|
|
1050
1050
|
},
|
|
1051
1051
|
[h]
|
|
1052
|
-
), x =
|
|
1052
|
+
), x = T((A) => {
|
|
1053
1053
|
setTimeout(() => {
|
|
1054
|
-
|
|
1054
|
+
A.refresh();
|
|
1055
1055
|
});
|
|
1056
|
-
}, []), b =
|
|
1056
|
+
}, []), b = T((A, v, _) => {
|
|
1057
1057
|
a({
|
|
1058
|
-
elements:
|
|
1058
|
+
elements: A,
|
|
1059
1059
|
appState: { isLoading: !1 },
|
|
1060
1060
|
files: _
|
|
1061
1061
|
});
|
|
1062
|
-
}, []), C =
|
|
1062
|
+
}, []), C = T(() => {
|
|
1063
1063
|
if (!t) {
|
|
1064
1064
|
l(!1);
|
|
1065
1065
|
return;
|
|
@@ -1067,11 +1067,11 @@ const vc = ({ editor: e }) => {
|
|
|
1067
1067
|
e.chain().focus().setExcalidraw({ data: n }).run(), l(!1);
|
|
1068
1068
|
}, [t, e, n, l]);
|
|
1069
1069
|
return H(() => {
|
|
1070
|
-
const
|
|
1070
|
+
const A = (v) => {
|
|
1071
1071
|
l(!0), v && c(v.data);
|
|
1072
1072
|
};
|
|
1073
|
-
return pc(ei,
|
|
1074
|
-
wc(ei,
|
|
1073
|
+
return pc(ei, A), () => {
|
|
1074
|
+
wc(ei, A);
|
|
1075
1075
|
};
|
|
1076
1076
|
}, [e, l]), /* @__PURE__ */ m(
|
|
1077
1077
|
He,
|
|
@@ -1091,8 +1091,8 @@ const vc = ({ editor: e }) => {
|
|
|
1091
1091
|
/* @__PURE__ */ r(Ce, { children: "Excalidraw" }),
|
|
1092
1092
|
/* @__PURE__ */ m("div", { style: { height: "100%", borderWidth: 1 }, children: [
|
|
1093
1093
|
d && /* @__PURE__ */ r("p", { children: "Loading..." }),
|
|
1094
|
-
|
|
1095
|
-
/* @__PURE__ */ r("div", { style: { width: "100%", height: 600 }, ref: g, children: !d && !
|
|
1094
|
+
f && /* @__PURE__ */ r("p", { children: f && f.message || "Error" }),
|
|
1095
|
+
/* @__PURE__ */ r("div", { style: { width: "100%", height: 600 }, ref: g, children: !d && !f && t ? /* @__PURE__ */ r(t, { ref: x, onChange: b, langCode: "en", initialData: o }) : null })
|
|
1096
1096
|
] }),
|
|
1097
1097
|
/* @__PURE__ */ r(it, { children: /* @__PURE__ */ r(
|
|
1098
1098
|
U,
|
|
@@ -1200,14 +1200,14 @@ function kc({ editor: e }) {
|
|
|
1200
1200
|
createUser: "",
|
|
1201
1201
|
width: 0,
|
|
1202
1202
|
height: 0
|
|
1203
|
-
}), { defaultShowPicker: a, createUser: o, width: c, height: s } = n, l =
|
|
1204
|
-
(
|
|
1205
|
-
e.chain().updateAttributes(Be.name,
|
|
1203
|
+
}), { defaultShowPicker: a, createUser: o, width: c, height: s } = n, l = T(
|
|
1204
|
+
(u) => {
|
|
1205
|
+
e.chain().updateAttributes(Be.name, u).setNodeSelection(e.state.selection.from).focus().run();
|
|
1206
1206
|
},
|
|
1207
1207
|
[e]
|
|
1208
|
-
), d =
|
|
1208
|
+
), d = T(() => {
|
|
1209
1209
|
_c(n);
|
|
1210
|
-
}, [e, n]), h =
|
|
1210
|
+
}, [e, n]), h = T(() => e.isActive(Be.name), [e]), f = T(() => Qe(Be.name, e), [e]);
|
|
1211
1211
|
return H(() => {
|
|
1212
1212
|
a && (d(), e.chain().updateAttributes(Be.name, { defaultShowPicker: !1 }).focus().run());
|
|
1213
1213
|
}, [o, a, e, d]), /* @__PURE__ */ r(
|
|
@@ -1248,7 +1248,7 @@ function kc({ editor: e }) {
|
|
|
1248
1248
|
p,
|
|
1249
1249
|
{
|
|
1250
1250
|
icon: "Trash2",
|
|
1251
|
-
action:
|
|
1251
|
+
action: f,
|
|
1252
1252
|
tooltip: t("editor.delete")
|
|
1253
1253
|
}
|
|
1254
1254
|
)
|
|
@@ -1261,15 +1261,13 @@ const Cc = "_wrap_5y04w_1", Nc = "_handlerWrap_5y04w_11", Tc = "_innerWrap_5y04w
|
|
|
1261
1261
|
handlerWrap: Nc,
|
|
1262
1262
|
innerWrap: Tc,
|
|
1263
1263
|
emptyWrap: Ac
|
|
1264
|
-
}, En = zt(
|
|
1265
|
-
disable: !1
|
|
1266
|
-
});
|
|
1264
|
+
}, En = zt(!1);
|
|
1267
1265
|
function Dt() {
|
|
1268
|
-
return Et(En)
|
|
1266
|
+
return Et(En);
|
|
1269
1267
|
}
|
|
1270
1268
|
const Lc = {
|
|
1271
1269
|
setDisable: (e) => {
|
|
1272
|
-
En.
|
|
1270
|
+
En.set(e);
|
|
1273
1271
|
}
|
|
1274
1272
|
};
|
|
1275
1273
|
function Sc({ editor: e, node: t, updateAttributes: i }) {
|
|
@@ -1279,9 +1277,9 @@ function Sc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
1279
1277
|
url: s
|
|
1280
1278
|
}).setNodeSelection(e.state.selection.from).focus().run();
|
|
1281
1279
|
}
|
|
1282
|
-
const h =
|
|
1283
|
-
(
|
|
1284
|
-
i({ width:
|
|
1280
|
+
const h = T(
|
|
1281
|
+
(f) => {
|
|
1282
|
+
i({ width: f.width, height: f.height });
|
|
1285
1283
|
},
|
|
1286
1284
|
[i]
|
|
1287
1285
|
);
|
|
@@ -1291,7 +1289,7 @@ function Sc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
1291
1289
|
te,
|
|
1292
1290
|
{
|
|
1293
1291
|
value: s,
|
|
1294
|
-
onInput: (
|
|
1292
|
+
onInput: (f) => l(f.target.value),
|
|
1295
1293
|
type: "url",
|
|
1296
1294
|
className: "richtext-flex-1",
|
|
1297
1295
|
autoFocus: !0,
|
|
@@ -1304,7 +1302,7 @@ function Sc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
1304
1302
|
wn,
|
|
1305
1303
|
{
|
|
1306
1304
|
size: { width: Number.parseInt(o), height: Number.parseInt(c) },
|
|
1307
|
-
onResizeStop: (
|
|
1305
|
+
onResizeStop: (f, u, g, x) => {
|
|
1308
1306
|
h({
|
|
1309
1307
|
width: Number.parseInt(o) + x.width,
|
|
1310
1308
|
height: Number.parseInt(c) + x.height
|
|
@@ -1421,27 +1419,27 @@ function Mc({ editor: e }) {
|
|
|
1421
1419
|
height: 0,
|
|
1422
1420
|
url: "",
|
|
1423
1421
|
defaultShowPicker: !1
|
|
1424
|
-
}), [o, c] = w(!1), [s, l] = w(""), d =
|
|
1422
|
+
}), [o, c] = w(!1), [s, l] = w(""), d = T(() => {
|
|
1425
1423
|
c(!1);
|
|
1426
1424
|
}, [c]);
|
|
1427
1425
|
H(() => {
|
|
1428
1426
|
o && l(a);
|
|
1429
1427
|
}, [o, a]);
|
|
1430
|
-
const h =
|
|
1428
|
+
const h = T(() => {
|
|
1431
1429
|
e.chain().updateAttributes($e.name, {
|
|
1432
1430
|
url: s
|
|
1433
1431
|
}).setNodeSelection(e.state.selection.from).focus().run(), c(!1);
|
|
1434
|
-
}, [e, s, c]),
|
|
1432
|
+
}, [e, s, c]), f = T(() => {
|
|
1435
1433
|
window.open(a, "_blank");
|
|
1436
|
-
}, [a]),
|
|
1434
|
+
}, [a]), u = T(() => {
|
|
1437
1435
|
c(!0);
|
|
1438
|
-
}, [c]), g =
|
|
1436
|
+
}, [c]), g = T(
|
|
1439
1437
|
(C) => {
|
|
1440
1438
|
e.chain().updateAttributes($e.name, C).setNodeSelection(e.state.selection.from).focus().run();
|
|
1441
1439
|
},
|
|
1442
1440
|
[e]
|
|
1443
|
-
), x =
|
|
1444
|
-
return /* @__PURE__ */ m(
|
|
1441
|
+
), x = T(() => e.isActive($e.name) && !a, [e, a]), b = T(() => Qe($e.name, e), [e]);
|
|
1442
|
+
return /* @__PURE__ */ m(W, { children: [
|
|
1445
1443
|
/* @__PURE__ */ r(
|
|
1446
1444
|
ce,
|
|
1447
1445
|
{
|
|
@@ -1464,7 +1462,7 @@ function Mc({ editor: e }) {
|
|
|
1464
1462
|
/* @__PURE__ */ r(
|
|
1465
1463
|
p,
|
|
1466
1464
|
{
|
|
1467
|
-
action:
|
|
1465
|
+
action: f,
|
|
1468
1466
|
icon: "Eye",
|
|
1469
1467
|
tooltip: "Visit Link"
|
|
1470
1468
|
}
|
|
@@ -1472,7 +1470,7 @@ function Mc({ editor: e }) {
|
|
|
1472
1470
|
/* @__PURE__ */ r(
|
|
1473
1471
|
p,
|
|
1474
1472
|
{
|
|
1475
|
-
action:
|
|
1473
|
+
action: u,
|
|
1476
1474
|
icon: "Pencil",
|
|
1477
1475
|
tooltip: "Open Edit Link"
|
|
1478
1476
|
}
|
|
@@ -1564,10 +1562,10 @@ function vi(e, t) {
|
|
|
1564
1562
|
}
|
|
1565
1563
|
const Di = `graph TB
|
|
1566
1564
|
a-->b`, Rc = ({ editor: e, attrs: t, extension: i }) => {
|
|
1567
|
-
const { alt: n, align: a } = t, [o, c] = w(decodeURIComponent(n ?? Di)), [s, l] = w(""), [d, h] = w(!1),
|
|
1565
|
+
const { alt: n, align: a } = t, [o, c] = w(decodeURIComponent(n ?? Di)), [s, l] = w(""), [d, h] = w(!1), f = J(null), u = i == null ? void 0 : i.options.upload, g = async (C) => {
|
|
1568
1566
|
try {
|
|
1569
|
-
const { svg:
|
|
1570
|
-
l(
|
|
1567
|
+
const { svg: A } = await At.render("mermaid-svg", C);
|
|
1568
|
+
l(A);
|
|
1571
1569
|
} catch {
|
|
1572
1570
|
l("");
|
|
1573
1571
|
}
|
|
@@ -1622,7 +1620,7 @@ a-->b`, Rc = ({ editor: e, attrs: t, extension: i }) => {
|
|
|
1622
1620
|
{
|
|
1623
1621
|
className: "richtext-flex-1 richtext-flex richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",
|
|
1624
1622
|
style: { height: "100%", border: "1px solid hsl(var(--border))", minHeight: 500, background: "#fff" },
|
|
1625
|
-
ref:
|
|
1623
|
+
ref: f,
|
|
1626
1624
|
dangerouslySetInnerHTML: { __html: s }
|
|
1627
1625
|
}
|
|
1628
1626
|
)
|
|
@@ -1634,18 +1632,18 @@ a-->b`, Rc = ({ editor: e, attrs: t, extension: i }) => {
|
|
|
1634
1632
|
onClick: async () => {
|
|
1635
1633
|
if (o !== "") {
|
|
1636
1634
|
if (o) {
|
|
1637
|
-
const C =
|
|
1635
|
+
const C = f.current.querySelector("svg"), { width: A, height: v } = C.getBoundingClientRect(), _ = `mermaid-${Hn()}.svg`;
|
|
1638
1636
|
let k = hn(C.outerHTML);
|
|
1639
|
-
if (
|
|
1637
|
+
if (u) {
|
|
1640
1638
|
const N = vi(k, _);
|
|
1641
|
-
k = await
|
|
1639
|
+
k = await u(N);
|
|
1642
1640
|
}
|
|
1643
1641
|
e == null || e.chain().focus().setMermaid(
|
|
1644
1642
|
{
|
|
1645
1643
|
type: "mermaid",
|
|
1646
1644
|
src: k,
|
|
1647
1645
|
alt: encodeURIComponent(o),
|
|
1648
|
-
width:
|
|
1646
|
+
width: A,
|
|
1649
1647
|
height: v
|
|
1650
1648
|
},
|
|
1651
1649
|
!!o
|
|
@@ -1690,7 +1688,7 @@ function Dc({ item: e, disabled: t, editor: i }) {
|
|
|
1690
1688
|
editor: i,
|
|
1691
1689
|
disabled: t || ((a = e == null ? void 0 : e.componentProps) == null ? void 0 : a.disabled)
|
|
1692
1690
|
}
|
|
1693
|
-
) }) : /* @__PURE__ */ r(
|
|
1691
|
+
) }) : /* @__PURE__ */ r(W, {});
|
|
1694
1692
|
}
|
|
1695
1693
|
function Bc(e) {
|
|
1696
1694
|
return e.type.name === "mermaid";
|
|
@@ -1699,12 +1697,12 @@ function $c(e) {
|
|
|
1699
1697
|
const { lang: t } = B(), i = ut(e.editor, en.name), n = Oc(e.editor, en.name), a = ({ editor: c }) => {
|
|
1700
1698
|
const { selection: s } = c.view.state, { $from: l, to: d } = s;
|
|
1701
1699
|
let h = !1;
|
|
1702
|
-
return c.view.state.doc.nodesBetween(l.pos, d, (
|
|
1703
|
-
if (Bc(
|
|
1700
|
+
return c.view.state.doc.nodesBetween(l.pos, d, (f) => {
|
|
1701
|
+
if (Bc(f))
|
|
1704
1702
|
return h = !0, !1;
|
|
1705
1703
|
}), h;
|
|
1706
|
-
}, o =
|
|
1707
|
-
return /* @__PURE__ */ r(
|
|
1704
|
+
}, o = P(() => e.disabled ? [] : Es(e.editor), [e.disabled, e.editor, t]);
|
|
1705
|
+
return /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
1708
1706
|
ce,
|
|
1709
1707
|
{
|
|
1710
1708
|
shouldShow: a,
|
|
@@ -1726,16 +1724,16 @@ function $c(e) {
|
|
|
1726
1724
|
editor: e.editor
|
|
1727
1725
|
},
|
|
1728
1726
|
`bubbleMenu-mermaid-${s}`
|
|
1729
|
-
)) }) }) : /* @__PURE__ */ r(
|
|
1727
|
+
)) }) }) : /* @__PURE__ */ r(W, {})
|
|
1730
1728
|
}
|
|
1731
1729
|
) });
|
|
1732
1730
|
}
|
|
1733
|
-
function
|
|
1731
|
+
function Vc({ node: e }) {
|
|
1734
1732
|
var n;
|
|
1735
1733
|
const t = ((n = e == null ? void 0 : e.attrs) == null ? void 0 : n.src) || "", i = t == null ? void 0 : t.split("/").pop();
|
|
1736
1734
|
return i ? /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r("div", { "data-twitter": "", children: /* @__PURE__ */ r(Ho, { id: i }) }) }) : null;
|
|
1737
1735
|
}
|
|
1738
|
-
function
|
|
1736
|
+
function jc(e) {
|
|
1739
1737
|
function t(i) {
|
|
1740
1738
|
e.action && e.action(i);
|
|
1741
1739
|
}
|
|
@@ -1746,13 +1744,13 @@ function Fc(e) {
|
|
|
1746
1744
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1747
1745
|
isActive: e == null ? void 0 : e.isActive,
|
|
1748
1746
|
disabled: e == null ? void 0 : e.disabled,
|
|
1749
|
-
children: /* @__PURE__ */ r(
|
|
1747
|
+
children: /* @__PURE__ */ r(j, { name: e == null ? void 0 : e.icon })
|
|
1750
1748
|
}
|
|
1751
1749
|
) }),
|
|
1752
1750
|
/* @__PURE__ */ r(re, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(On, { editor: e.editor, onSetLink: t }) })
|
|
1753
1751
|
] });
|
|
1754
1752
|
}
|
|
1755
|
-
const
|
|
1753
|
+
const Fc = /(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g, Uc = /^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;
|
|
1756
1754
|
function Bi(e) {
|
|
1757
1755
|
return e.match(Uc);
|
|
1758
1756
|
}
|
|
@@ -1767,7 +1765,7 @@ const ti = ue.create({
|
|
|
1767
1765
|
inline: !1,
|
|
1768
1766
|
origin: "",
|
|
1769
1767
|
button: ({ editor: e, t }) => ({
|
|
1770
|
-
component:
|
|
1768
|
+
component: jc,
|
|
1771
1769
|
componentProps: {
|
|
1772
1770
|
action: (i) => {
|
|
1773
1771
|
e.commands.setTweet({ src: i });
|
|
@@ -1782,7 +1780,7 @@ const ti = ue.create({
|
|
|
1782
1780
|
};
|
|
1783
1781
|
},
|
|
1784
1782
|
addNodeView() {
|
|
1785
|
-
return ge(
|
|
1783
|
+
return ge(Vc, { attrs: this.options.HTMLAttributes });
|
|
1786
1784
|
},
|
|
1787
1785
|
inline() {
|
|
1788
1786
|
return this.options.inline;
|
|
@@ -1816,7 +1814,7 @@ const ti = ue.create({
|
|
|
1816
1814
|
addPasteRules() {
|
|
1817
1815
|
return this.options.addPasteHandler ? [
|
|
1818
1816
|
ka({
|
|
1819
|
-
find:
|
|
1817
|
+
find: Fc,
|
|
1820
1818
|
type: this.type,
|
|
1821
1819
|
getAttributes: (e) => ({ src: e.input })
|
|
1822
1820
|
})
|
|
@@ -1855,10 +1853,10 @@ function On(e) {
|
|
|
1855
1853
|
] }) });
|
|
1856
1854
|
}
|
|
1857
1855
|
function Wc({ editor: e, disabled: t }) {
|
|
1858
|
-
const [i, n] = w(!1), { t: a } = B(), o =
|
|
1856
|
+
const [i, n] = w(!1), { t: a } = B(), o = T(({ editor: l }) => l.isActive(ti.name), []), c = (l) => {
|
|
1859
1857
|
e.commands.updateTweet({ src: l }), n(!1);
|
|
1860
|
-
}, s =
|
|
1861
|
-
return /* @__PURE__ */ r(
|
|
1858
|
+
}, s = T(() => Qe(ti.name, e), [e]);
|
|
1859
|
+
return /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
1862
1860
|
ce,
|
|
1863
1861
|
{
|
|
1864
1862
|
editor: e,
|
|
@@ -1874,7 +1872,7 @@ function Wc({ editor: e, disabled: t }) {
|
|
|
1874
1872
|
n(!1);
|
|
1875
1873
|
}
|
|
1876
1874
|
},
|
|
1877
|
-
children: t ? /* @__PURE__ */ r(
|
|
1875
|
+
children: t ? /* @__PURE__ */ r(W, {}) : /* @__PURE__ */ r(W, { children: i ? /* @__PURE__ */ r(
|
|
1878
1876
|
On,
|
|
1879
1877
|
{
|
|
1880
1878
|
onSetLink: c,
|
|
@@ -1907,21 +1905,21 @@ function Wc({ editor: e, disabled: t }) {
|
|
|
1907
1905
|
}
|
|
1908
1906
|
function qc({ editor: e, disabled: t, bubbleMenu: i }) {
|
|
1909
1907
|
const n = e.extensionManager.extensions.map((o) => o.name), a = () => {
|
|
1910
|
-
var o, c, s, l, d, h,
|
|
1908
|
+
var o, c, s, l, d, h, f, u, g, x, b, C, A;
|
|
1911
1909
|
return [
|
|
1912
1910
|
n.includes("columns") && !((o = i == null ? void 0 : i.columnConfig) != null && o.hidden) ? /* @__PURE__ */ r(Js, { editor: e }, "columns") : null,
|
|
1913
|
-
n.includes("table") && !((c = i == null ? void 0 : i.tableConfig) != null && c.hidden) ? /* @__PURE__ */ r(
|
|
1911
|
+
n.includes("table") && !((c = i == null ? void 0 : i.tableConfig) != null && c.hidden) ? /* @__PURE__ */ r(Fs, { editor: e }, "table") : null,
|
|
1914
1912
|
n.includes("link") && !((s = i == null ? void 0 : i.linkConfig) != null && s.hidden) ? /* @__PURE__ */ r(Ws, { editor: e, disabled: t }, "link") : null,
|
|
1915
1913
|
n.includes("image") && !((l = i == null ? void 0 : i.imageConfig) != null && l.hidden) ? /* @__PURE__ */ r(Xs, { editor: e, disabled: t }, "image") : null,
|
|
1916
1914
|
n.includes(er.name) && !((d = i == null ? void 0 : i.imageGifConfig) != null && d.hidden) ? /* @__PURE__ */ r(Zs, { editor: e, disabled: t }, "imageGif") : null,
|
|
1917
1915
|
n.includes("video") && !((h = i == null ? void 0 : i.videoConfig) != null && h.hidden) ? /* @__PURE__ */ r(Ys, { editor: e, disabled: t }, "video") : null,
|
|
1918
|
-
n.includes("katex") && !((
|
|
1919
|
-
n.includes("excalidraw") && !((
|
|
1916
|
+
n.includes("katex") && !((f = i == null ? void 0 : i.katexConfig) != null && f.hidden) ? /* @__PURE__ */ r(Yo, { editor: e, disabled: t }, "katex") : null,
|
|
1917
|
+
n.includes("excalidraw") && !((u = i == null ? void 0 : i.excalidrawConfig) != null && u.hidden) ? /* @__PURE__ */ r(kc, { editor: e, disabled: t }, "excalidraw") : null,
|
|
1920
1918
|
n.includes("mermaid") && !((g = i == null ? void 0 : i.mermaidConfig) != null && g.hidden) ? /* @__PURE__ */ r($c, { editor: e, disabled: t }, "mermaid") : null,
|
|
1921
1919
|
n.includes("iframe") && !((x = i == null ? void 0 : i.iframeConfig) != null && x.hidden) ? /* @__PURE__ */ r(Mc, { editor: e, disabled: t }, "iframe") : null,
|
|
1922
1920
|
n.includes("twitter") && !((b = i == null ? void 0 : i.twitterConfig) != null && b.hidden) ? /* @__PURE__ */ r(Wc, { editor: e, disabled: t }, "twitter") : null,
|
|
1923
1921
|
(C = i == null ? void 0 : i.floatingMenuConfig) != null && C.hidden ? null : /* @__PURE__ */ r(Ds, { editor: e, disabled: t }, "content"),
|
|
1924
|
-
(
|
|
1922
|
+
(A = i == null ? void 0 : i.textConfig) != null && A.hidden ? null : /* @__PURE__ */ r(Vs, { editor: e, disabled: t }, "text")
|
|
1925
1923
|
];
|
|
1926
1924
|
};
|
|
1927
1925
|
return i != null && i.render ? i.render({ editor: e, disabled: t || !1, bubbleMenu: i }, a()) : a().filter(Boolean);
|
|
@@ -1937,21 +1935,21 @@ function Pn(e) {
|
|
|
1937
1935
|
setSelectedColor: o,
|
|
1938
1936
|
onChange: c,
|
|
1939
1937
|
colors: s = yo
|
|
1940
|
-
} = e, l =
|
|
1938
|
+
} = e, l = P(() => {
|
|
1941
1939
|
const g = s, x = [];
|
|
1942
1940
|
for (let b = 0; b < g.length; b += 10)
|
|
1943
1941
|
x.push(g.slice(b, b + 10));
|
|
1944
1942
|
return x;
|
|
1945
|
-
}, [s]), [d, h] = w([]),
|
|
1943
|
+
}, [s]), [d, h] = w([]), f = (g) => {
|
|
1946
1944
|
const x = [...d], b = x.indexOf(g);
|
|
1947
1945
|
b !== -1 && x.splice(b, 1), x.unshift(g), x.length > 10 && x.pop(), h(x);
|
|
1948
1946
|
};
|
|
1949
|
-
function
|
|
1947
|
+
function u(g) {
|
|
1950
1948
|
if (g === void 0) {
|
|
1951
1949
|
o == null || o(g), c == null || c(g);
|
|
1952
1950
|
return;
|
|
1953
1951
|
}
|
|
1954
|
-
/^#([\da-f]{3}){1,2}$/i.test(g) && (o == null || o(g), c == null || c(g),
|
|
1952
|
+
/^#([\da-f]{3}){1,2}$/i.test(g) && (o == null || o(g), c == null || c(g), f(g));
|
|
1955
1953
|
}
|
|
1956
1954
|
return /* @__PURE__ */ m(se, { modal: !0, children: [
|
|
1957
1955
|
/* @__PURE__ */ r(le, { className: "!richtext-p-0", disabled: n, asChild: !0, children: e == null ? void 0 : e.children }),
|
|
@@ -1960,7 +1958,7 @@ function Pn(e) {
|
|
|
1960
1958
|
"div",
|
|
1961
1959
|
{
|
|
1962
1960
|
className: "richtext-flex richtext-items-center richtext-p-1 richtext-cursor-pointer rd-1 richtext-gap-[4px] hover:richtext-bg-accent",
|
|
1963
|
-
onClick: () =>
|
|
1961
|
+
onClick: () => u(void 0),
|
|
1964
1962
|
children: [
|
|
1965
1963
|
/* @__PURE__ */ r($i, {}),
|
|
1966
1964
|
/* @__PURE__ */ r("span", { className: "richtext-ml-1 richtext-text-sm", children: t("editor.nofill") })
|
|
@@ -1971,7 +1969,7 @@ function Pn(e) {
|
|
|
1971
1969
|
{
|
|
1972
1970
|
className: "richtext-flex richtext-items-center richtext-p-1 richtext-cursor-pointer rd-1 richtext-gap-[4px] hover:richtext-bg-accent",
|
|
1973
1971
|
onClick: () => {
|
|
1974
|
-
|
|
1972
|
+
u(void 0);
|
|
1975
1973
|
},
|
|
1976
1974
|
children: [
|
|
1977
1975
|
/* @__PURE__ */ r($i, {}),
|
|
@@ -1983,7 +1981,7 @@ function Pn(e) {
|
|
|
1983
1981
|
"span",
|
|
1984
1982
|
{
|
|
1985
1983
|
className: "richtext-w-6 richtext-h-6 richtext-p-0.5 richtext-inline-block richtext-rounded-sm !richtext-border richtext-border-transparent richtext-flex-[0_0_auto] richtext-cursor-pointer hover:richtext-border-border hover:richtext-shadow-sm",
|
|
1986
|
-
onClick: () =>
|
|
1984
|
+
onClick: () => u(b),
|
|
1987
1985
|
children: /* @__PURE__ */ r(
|
|
1988
1986
|
"span",
|
|
1989
1987
|
{
|
|
@@ -2023,7 +2021,7 @@ function Pn(e) {
|
|
|
2023
2021
|
"span",
|
|
2024
2022
|
{
|
|
2025
2023
|
className: "richtext-w-6 richtext-h-6 richtext-p-0.5 richtext-inline-block richtext-rounded-sm !richtext-border richtext-border-transparent richtext-flex-[0_0_auto] richtext-cursor-pointer hover:richtext-border-border hover:richtext-shadow-sm",
|
|
2026
|
-
onClick: () =>
|
|
2024
|
+
onClick: () => u(g),
|
|
2027
2025
|
children: /* @__PURE__ */ r(
|
|
2028
2026
|
"span",
|
|
2029
2027
|
{
|
|
@@ -2048,7 +2046,7 @@ function Pn(e) {
|
|
|
2048
2046
|
`sub-color-recent-${x}`
|
|
2049
2047
|
)) })
|
|
2050
2048
|
] }),
|
|
2051
|
-
/* @__PURE__ */ r(Gc, { setColor:
|
|
2049
|
+
/* @__PURE__ */ r(Gc, { setColor: u })
|
|
2052
2050
|
] }) })
|
|
2053
2051
|
] });
|
|
2054
2052
|
}
|
|
@@ -2234,17 +2232,15 @@ video {
|
|
|
2234
2232
|
height: auto
|
|
2235
2233
|
}
|
|
2236
2234
|
}
|
|
2237
|
-
`, Dn = zt(
|
|
2238
|
-
theme: "light"
|
|
2239
|
-
});
|
|
2235
|
+
`, Dn = zt("light");
|
|
2240
2236
|
function Xc() {
|
|
2241
|
-
return Et(Dn)
|
|
2237
|
+
return Et(Dn);
|
|
2242
2238
|
}
|
|
2243
2239
|
const Zc = {
|
|
2244
2240
|
setTheme: (e) => {
|
|
2245
|
-
Dn.
|
|
2241
|
+
Dn.set(e);
|
|
2246
2242
|
}
|
|
2247
|
-
},
|
|
2243
|
+
}, Vi = "data-rc-order", ji = "data-rc-priority", Yc = "rc-util-key", ii = /* @__PURE__ */ new Map();
|
|
2248
2244
|
function Jc(e, t) {
|
|
2249
2245
|
if (!e)
|
|
2250
2246
|
return !1;
|
|
@@ -2272,17 +2268,17 @@ function $n(e) {
|
|
|
2272
2268
|
(t) => t.tagName === "STYLE"
|
|
2273
2269
|
);
|
|
2274
2270
|
}
|
|
2275
|
-
function
|
|
2271
|
+
function Vn(e, t = {}) {
|
|
2276
2272
|
const { csp: i, prepend: n, priority: a = 0 } = t, o = Qc(n), c = o === "prependQueue", s = document.createElement("style");
|
|
2277
|
-
s.setAttribute(
|
|
2273
|
+
s.setAttribute(Vi, o), c && a && s.setAttribute(ji, `${a}`), i != null && i.nonce && (s.nonce = i == null ? void 0 : i.nonce), s.innerHTML = e;
|
|
2278
2274
|
const l = yi(t), { firstChild: d } = l;
|
|
2279
2275
|
if (n) {
|
|
2280
2276
|
if (c) {
|
|
2281
|
-
const h = $n(l).filter((
|
|
2282
|
-
if (!["prepend", "prependQueue"].includes(
|
|
2277
|
+
const h = $n(l).filter((f) => {
|
|
2278
|
+
if (!["prepend", "prependQueue"].includes(f.getAttribute(Vi)))
|
|
2283
2279
|
return !1;
|
|
2284
|
-
const
|
|
2285
|
-
return a >=
|
|
2280
|
+
const u = Number(f.getAttribute(ji) || 0);
|
|
2281
|
+
return a >= u;
|
|
2286
2282
|
});
|
|
2287
2283
|
if (h.length > 0)
|
|
2288
2284
|
return l.insertBefore(s, h.at(-1).nextSibling), s;
|
|
@@ -2292,18 +2288,18 @@ function jn(e, t = {}) {
|
|
|
2292
2288
|
l.append(s);
|
|
2293
2289
|
return s;
|
|
2294
2290
|
}
|
|
2295
|
-
function
|
|
2291
|
+
function jn(e, t = {}) {
|
|
2296
2292
|
const i = yi(t);
|
|
2297
2293
|
return $n(i).find((n) => n.getAttribute(Bn(t)) === e);
|
|
2298
2294
|
}
|
|
2299
2295
|
function es(e, t = {}) {
|
|
2300
|
-
const i =
|
|
2296
|
+
const i = jn(e, t);
|
|
2301
2297
|
i && i.remove();
|
|
2302
2298
|
}
|
|
2303
2299
|
function ts(e, t) {
|
|
2304
2300
|
const i = ii.get(e);
|
|
2305
2301
|
if (!i || !Jc(document, i)) {
|
|
2306
|
-
const n =
|
|
2302
|
+
const n = Vn("", t), { parentNode: a } = n;
|
|
2307
2303
|
ii.set(e, a), n.remove();
|
|
2308
2304
|
}
|
|
2309
2305
|
}
|
|
@@ -2311,14 +2307,14 @@ function is(e, t, i = {}) {
|
|
|
2311
2307
|
var c, s, l;
|
|
2312
2308
|
const n = yi(i);
|
|
2313
2309
|
ts(n, i);
|
|
2314
|
-
const a =
|
|
2310
|
+
const a = jn(t, i);
|
|
2315
2311
|
if (a)
|
|
2316
2312
|
return (c = i.csp) != null && c.nonce && a.nonce !== ((s = i.csp) == null ? void 0 : s.nonce) && (a.nonce = (l = i.csp) == null ? void 0 : l.nonce), a.innerHTML !== e && (a.innerHTML = e), a;
|
|
2317
|
-
const o =
|
|
2313
|
+
const o = Vn(e, i);
|
|
2318
2314
|
return o.setAttribute(Bn(i), t), o;
|
|
2319
2315
|
}
|
|
2320
2316
|
function ns({ editor: e, extensions: t }) {
|
|
2321
|
-
const { t: i } = B(), n =
|
|
2317
|
+
const { t: i } = B(), n = P(() => {
|
|
2322
2318
|
var a, o, c;
|
|
2323
2319
|
return (c = (o = (a = t == null ? void 0 : t.find((s) => s.name === "base-kit")) == null ? void 0 : a.options) == null ? void 0 : o.characterCount) == null ? void 0 : c.limit;
|
|
2324
2320
|
}, [t]);
|
|
@@ -2335,16 +2331,16 @@ function ns({ editor: e, extensions: t }) {
|
|
|
2335
2331
|
] }) }) }) });
|
|
2336
2332
|
}
|
|
2337
2333
|
function rs(e, t) {
|
|
2338
|
-
const { content: i, extensions: n, useEditorOptions: a = {} } = e, o =
|
|
2334
|
+
const { content: i, extensions: n, useEditorOptions: a = {} } = e, o = P(() => {
|
|
2339
2335
|
const h = xo(n, n, "name");
|
|
2340
|
-
return [...n.map((
|
|
2341
|
-
const g = n.find((x) => x.name ===
|
|
2342
|
-
return g ?
|
|
2343
|
-
}), ...h].map((
|
|
2336
|
+
return [...n.map((u) => {
|
|
2337
|
+
const g = n.find((x) => x.name === u.name);
|
|
2338
|
+
return g ? u.configure(g.options) : u;
|
|
2339
|
+
}), ...h].map((u, g) => u.configure({ sort: g }));
|
|
2344
2340
|
}, [n]), c = Se((h) => {
|
|
2345
|
-
var
|
|
2346
|
-
const
|
|
2347
|
-
(
|
|
2341
|
+
var u;
|
|
2342
|
+
const f = l(h, e.output);
|
|
2343
|
+
(u = e == null ? void 0 : e.onChangeContent) == null || u.call(e, f);
|
|
2348
2344
|
}, ko), s = Ca({
|
|
2349
2345
|
extensions: o,
|
|
2350
2346
|
content: i,
|
|
@@ -2362,8 +2358,8 @@ function rs(e, t) {
|
|
|
2362
2358
|
}, [s, e == null ? void 0 : e.disabled]), H(() => ((e == null ? void 0 : e.resetCSS) !== !1 && is(Kc, "react-tiptap-reset"), () => {
|
|
2363
2359
|
es("react-tiptap-reset");
|
|
2364
2360
|
}), [e == null ? void 0 : e.resetCSS]);
|
|
2365
|
-
function l(h,
|
|
2366
|
-
return e != null && e.removeDefaultWrapper ?
|
|
2361
|
+
function l(h, f) {
|
|
2362
|
+
return e != null && e.removeDefaultWrapper ? f === "html" ? h.isEmpty ? "" : h.getHTML() : f === "json" ? h.isEmpty ? {} : h.getJSON() : f === "text" ? h.isEmpty ? "" : h.getText() : "" : f === "html" ? h.getHTML() : f === "json" ? h.getJSON() : f === "text" ? h.getText() : "";
|
|
2367
2363
|
}
|
|
2368
2364
|
H(() => () => {
|
|
2369
2365
|
var h;
|
|
@@ -2375,19 +2371,19 @@ function rs(e, t) {
|
|
|
2375
2371
|
/* @__PURE__ */ r(Na, { className: `richtext-relative ${(e == null ? void 0 : e.contentClass) || ""}`, editor: s }),
|
|
2376
2372
|
d && /* @__PURE__ */ r(ns, { editor: s, extensions: n }),
|
|
2377
2373
|
!(e != null && e.hideBubble) && /* @__PURE__ */ r(qc, { bubbleMenu: e == null ? void 0 : e.bubbleMenu, editor: s, disabled: e == null ? void 0 : e.disabled })
|
|
2378
|
-
] }) }) }) }) : /* @__PURE__ */ r(
|
|
2374
|
+
] }) }) }) }) : /* @__PURE__ */ r(W, {});
|
|
2379
2375
|
}
|
|
2380
|
-
const
|
|
2376
|
+
const iu = Lt(rs);
|
|
2381
2377
|
function as({ editor: e, disabled: t }) {
|
|
2382
|
-
const { t: i, lang: n } = B(), a =
|
|
2378
|
+
const { t: i, lang: n } = B(), a = P(() => {
|
|
2383
2379
|
const c = [...e.extensionManager.extensions].sort((l, d) => {
|
|
2384
|
-
const h = l.options.sort ?? -1,
|
|
2385
|
-
return h -
|
|
2380
|
+
const h = l.options.sort ?? -1, f = d.options.sort ?? -1;
|
|
2381
|
+
return h - f;
|
|
2386
2382
|
});
|
|
2387
2383
|
let s = [];
|
|
2388
2384
|
for (const l of c) {
|
|
2389
|
-
const { button: d, divider: h = !1, spacer:
|
|
2390
|
-
if (!d || !cc(d) || !
|
|
2385
|
+
const { button: d, divider: h = !1, spacer: f = !1, toolbar: u = !0 } = l.options;
|
|
2386
|
+
if (!d || !cc(d) || !u)
|
|
2391
2387
|
continue;
|
|
2392
2388
|
const g = d({
|
|
2393
2389
|
editor: e,
|
|
@@ -2398,12 +2394,12 @@ function as({ editor: e, disabled: t }) {
|
|
|
2398
2394
|
const x = g.map((b, C) => ({
|
|
2399
2395
|
button: b,
|
|
2400
2396
|
divider: C === g.length - 1 ? h : !1,
|
|
2401
|
-
spacer: C === 0 ?
|
|
2397
|
+
spacer: C === 0 ? f : !1
|
|
2402
2398
|
}));
|
|
2403
2399
|
s = [...s, ...x];
|
|
2404
2400
|
continue;
|
|
2405
2401
|
}
|
|
2406
|
-
s.push({ button: g, divider: h, spacer:
|
|
2402
|
+
s.push({ button: g, divider: h, spacer: f });
|
|
2407
2403
|
}
|
|
2408
2404
|
return s;
|
|
2409
2405
|
}, [e, i, n]);
|
|
@@ -2518,7 +2514,7 @@ function ds(e) {
|
|
|
2518
2514
|
}
|
|
2519
2515
|
) });
|
|
2520
2516
|
}
|
|
2521
|
-
function
|
|
2517
|
+
function j(e) {
|
|
2522
2518
|
const t = gt[e.name];
|
|
2523
2519
|
return t ? /* @__PURE__ */ r(t, { onClick: e == null ? void 0 : e.onClick, className: `richtext-w-4 richtext-h-4 ${(e == null ? void 0 : e.className) || ""}` }) : null;
|
|
2524
2520
|
}
|
|
@@ -2531,7 +2527,7 @@ function hs(e) {
|
|
|
2531
2527
|
}
|
|
2532
2528
|
) });
|
|
2533
2529
|
}
|
|
2534
|
-
function
|
|
2530
|
+
function Fn(e) {
|
|
2535
2531
|
return /* @__PURE__ */ r(
|
|
2536
2532
|
"svg",
|
|
2537
2533
|
{
|
|
@@ -2712,12 +2708,12 @@ const gt = {
|
|
|
2712
2708
|
TableCellsMerge: Br,
|
|
2713
2709
|
TableCellsSplit: $r,
|
|
2714
2710
|
Trash2: an,
|
|
2715
|
-
Trash:
|
|
2711
|
+
Trash: Vr,
|
|
2716
2712
|
Replace: Li,
|
|
2717
|
-
ChevronsUpDown:
|
|
2713
|
+
ChevronsUpDown: jr,
|
|
2718
2714
|
LineHeight: hs,
|
|
2719
2715
|
Word: ds,
|
|
2720
|
-
Heading1:
|
|
2716
|
+
Heading1: Fr,
|
|
2721
2717
|
Heading2: Ur,
|
|
2722
2718
|
Heading3: Wr,
|
|
2723
2719
|
Heading4: qr,
|
|
@@ -2734,7 +2730,7 @@ const gt = {
|
|
|
2734
2730
|
PanelRight: ea,
|
|
2735
2731
|
Columns: Si,
|
|
2736
2732
|
Iframe: ta,
|
|
2737
|
-
MenuDown:
|
|
2733
|
+
MenuDown: Fn,
|
|
2738
2734
|
SizeS: fs,
|
|
2739
2735
|
SizeM: ms,
|
|
2740
2736
|
SizeL: us,
|
|
@@ -2778,7 +2774,7 @@ function Ns(e) {
|
|
|
2778
2774
|
type: `image-${n}`,
|
|
2779
2775
|
component: p,
|
|
2780
2776
|
componentProps: {
|
|
2781
|
-
tooltip:
|
|
2777
|
+
tooltip: F.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
2782
2778
|
icon: i[a],
|
|
2783
2779
|
action: () => e.commands.updateImage({ width: Tt[n] }),
|
|
2784
2780
|
isActive: () => e.isActive("image", { width: Tt[n] })
|
|
@@ -2795,7 +2791,7 @@ function Ts(e) {
|
|
|
2795
2791
|
type: `image-${n}`,
|
|
2796
2792
|
component: p,
|
|
2797
2793
|
componentProps: {
|
|
2798
|
-
tooltip:
|
|
2794
|
+
tooltip: F.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
2799
2795
|
icon: i[a],
|
|
2800
2796
|
action: () => e.commands.updateImageGif({ width: Tt[n] }),
|
|
2801
2797
|
isActive: () => e.isActive("image", { width: Tt[n] })
|
|
@@ -2812,7 +2808,7 @@ function As(e) {
|
|
|
2812
2808
|
type: `image-${n}`,
|
|
2813
2809
|
component: p,
|
|
2814
2810
|
componentProps: {
|
|
2815
|
-
tooltip:
|
|
2811
|
+
tooltip: F.t(`editor.textalign.${n}.tooltip`),
|
|
2816
2812
|
icon: i[n],
|
|
2817
2813
|
action: () => {
|
|
2818
2814
|
var a, o;
|
|
@@ -2833,7 +2829,7 @@ function Ls(e) {
|
|
|
2833
2829
|
type: `image-${n}`,
|
|
2834
2830
|
component: p,
|
|
2835
2831
|
componentProps: {
|
|
2836
|
-
tooltip:
|
|
2832
|
+
tooltip: F.t(`editor.textalign.${n}.tooltip`),
|
|
2837
2833
|
icon: i[n],
|
|
2838
2834
|
action: () => {
|
|
2839
2835
|
var a, o;
|
|
@@ -2854,7 +2850,7 @@ function Ss(e) {
|
|
|
2854
2850
|
type: `image-${n}`,
|
|
2855
2851
|
component: p,
|
|
2856
2852
|
componentProps: {
|
|
2857
|
-
tooltip:
|
|
2853
|
+
tooltip: F.t(`editor.textalign.${n}.tooltip`),
|
|
2858
2854
|
icon: i[n],
|
|
2859
2855
|
action: () => {
|
|
2860
2856
|
var a, o;
|
|
@@ -2875,7 +2871,7 @@ function Ms(e) {
|
|
|
2875
2871
|
type: `video-${n}`,
|
|
2876
2872
|
component: p,
|
|
2877
2873
|
componentProps: {
|
|
2878
|
-
tooltip:
|
|
2874
|
+
tooltip: F.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
2879
2875
|
icon: i[a],
|
|
2880
2876
|
action: () => e.commands.updateVideo({ width: Gt[n] }),
|
|
2881
2877
|
isActive: () => e.isActive("video", { width: Gt[n] })
|
|
@@ -2889,7 +2885,7 @@ function Is(e) {
|
|
|
2889
2885
|
component: p,
|
|
2890
2886
|
componentProps: {
|
|
2891
2887
|
editor: e,
|
|
2892
|
-
tooltip:
|
|
2888
|
+
tooltip: F.t("editor.tooltip.flipX"),
|
|
2893
2889
|
icon: "FlipX",
|
|
2894
2890
|
action: () => {
|
|
2895
2891
|
const t = e.getAttributes("image"), { flipX: i } = t;
|
|
@@ -2904,7 +2900,7 @@ function Is(e) {
|
|
|
2904
2900
|
component: p,
|
|
2905
2901
|
componentProps: {
|
|
2906
2902
|
editor: e,
|
|
2907
|
-
tooltip:
|
|
2903
|
+
tooltip: F.t("editor.tooltip.flipY"),
|
|
2908
2904
|
icon: "FlipY",
|
|
2909
2905
|
action: () => {
|
|
2910
2906
|
const t = e.getAttributes("image"), { flipY: i } = t;
|
|
@@ -2921,7 +2917,7 @@ function Is(e) {
|
|
|
2921
2917
|
component: p,
|
|
2922
2918
|
componentProps: {
|
|
2923
2919
|
editor: e,
|
|
2924
|
-
tooltip:
|
|
2920
|
+
tooltip: F.t("editor.remove"),
|
|
2925
2921
|
icon: "Trash2",
|
|
2926
2922
|
action: () => {
|
|
2927
2923
|
const { state: t, dispatch: i } = e.view;
|
|
@@ -2940,7 +2936,7 @@ function zs(e) {
|
|
|
2940
2936
|
component: p,
|
|
2941
2937
|
componentProps: {
|
|
2942
2938
|
editor: e,
|
|
2943
|
-
tooltip:
|
|
2939
|
+
tooltip: F.t("editor.remove"),
|
|
2944
2940
|
icon: "Trash2",
|
|
2945
2941
|
action: () => {
|
|
2946
2942
|
const { state: t, dispatch: i } = e.view;
|
|
@@ -2958,7 +2954,7 @@ function Es(e) {
|
|
|
2958
2954
|
component: p,
|
|
2959
2955
|
componentProps: {
|
|
2960
2956
|
editor: e,
|
|
2961
|
-
tooltip:
|
|
2957
|
+
tooltip: F.t("editor.edit"),
|
|
2962
2958
|
icon: "Pencil",
|
|
2963
2959
|
action: () => {
|
|
2964
2960
|
}
|
|
@@ -2969,7 +2965,7 @@ function Es(e) {
|
|
|
2969
2965
|
component: p,
|
|
2970
2966
|
componentProps: {
|
|
2971
2967
|
editor: e,
|
|
2972
|
-
tooltip:
|
|
2968
|
+
tooltip: F.t("editor.remove"),
|
|
2973
2969
|
icon: "Trash2",
|
|
2974
2970
|
action: () => {
|
|
2975
2971
|
const { state: t, dispatch: i } = e.view;
|
|
@@ -2987,7 +2983,7 @@ function Hs(e) {
|
|
|
2987
2983
|
component: p,
|
|
2988
2984
|
componentProps: {
|
|
2989
2985
|
editor: e,
|
|
2990
|
-
tooltip:
|
|
2986
|
+
tooltip: F.t("editor.remove"),
|
|
2991
2987
|
icon: "Trash2",
|
|
2992
2988
|
action: () => {
|
|
2993
2989
|
const { state: t, dispatch: i } = e.view;
|
|
@@ -3038,7 +3034,7 @@ function ni(e, t, i) {
|
|
|
3038
3034
|
};
|
|
3039
3035
|
return e.setNodeMarkup(t, n.type, s, n.marks);
|
|
3040
3036
|
}
|
|
3041
|
-
function
|
|
3037
|
+
function Fi({ delta: e, types: t }) {
|
|
3042
3038
|
return ({ state: i, dispatch: n, editor: a }) => {
|
|
3043
3039
|
const { selection: o } = i;
|
|
3044
3040
|
let { tr: c } = i;
|
|
@@ -3047,7 +3043,7 @@ function Vi({ delta: e, types: t }) {
|
|
|
3047
3043
|
}
|
|
3048
3044
|
function Ds(e) {
|
|
3049
3045
|
var M, L, S;
|
|
3050
|
-
const { pluginKey: t = La } = e, { t: i } = B(), [n, a] = w(null), [o, c] = w(-1), s = J(null), l = J(null), [d, h] = w(!1),
|
|
3046
|
+
const { pluginKey: t = La } = e, { t: i } = B(), [n, a] = w(null), [o, c] = w(-1), s = J(null), l = J(null), [d, h] = w(!1), f = e.editor.extensionManager.extensions.some((y) => y.name === "textAlign"), u = e.editor.extensionManager.extensions.some((y) => y.name === "indent"), g = e.editor.extensionManager.extensions.some((y) => y.name === "clear");
|
|
3051
3047
|
H(() => {
|
|
3052
3048
|
s.current && !e.editor.isDestroyed && (l.current = Aa({
|
|
3053
3049
|
editor: e.editor,
|
|
@@ -3073,7 +3069,7 @@ function Ds(e) {
|
|
|
3073
3069
|
const { $anchor: y } = e.editor.state.selection, $ = y.node(1) || e.editor.state.selection.node;
|
|
3074
3070
|
e.editor.chain().setMeta("hideDragHandle", !0).insertContentAt(o + ((n == null ? void 0 : n.nodeSize) || 0), $.toJSON()).run();
|
|
3075
3071
|
}
|
|
3076
|
-
function
|
|
3072
|
+
function A(y) {
|
|
3077
3073
|
e.editor.commands.setTextAlign(y);
|
|
3078
3074
|
}
|
|
3079
3075
|
function v() {
|
|
@@ -3129,7 +3125,7 @@ function Ds(e) {
|
|
|
3129
3125
|
disabled: e == null ? void 0 : e.disabled,
|
|
3130
3126
|
onClick: I,
|
|
3131
3127
|
type: "button",
|
|
3132
|
-
children: /* @__PURE__ */ r(
|
|
3128
|
+
children: /* @__PURE__ */ r(j, { name: "Plus", className: "richtext-text-lg richtext-text-neutral-600 dark:richtext-text-neutral-200" })
|
|
3133
3129
|
}
|
|
3134
3130
|
),
|
|
3135
3131
|
/* @__PURE__ */ m(ve, { open: d, onOpenChange: O, children: [
|
|
@@ -3146,7 +3142,7 @@ function Ds(e) {
|
|
|
3146
3142
|
y.preventDefault(), !(e != null && e.disabled) && h(!0);
|
|
3147
3143
|
},
|
|
3148
3144
|
type: "button",
|
|
3149
|
-
children: /* @__PURE__ */ r(
|
|
3145
|
+
children: /* @__PURE__ */ r(j, { name: "Grip", className: "richtext-text-sm dark:richtext-text-neutral-200 richtext-text-neutral-600" })
|
|
3150
3146
|
}
|
|
3151
3147
|
) }),
|
|
3152
3148
|
/* @__PURE__ */ r(Ee, { children: i("editor.draghandle.tooltip") })
|
|
@@ -3160,47 +3156,47 @@ function Ds(e) {
|
|
|
3160
3156
|
onClick: k,
|
|
3161
3157
|
className: "richtext-flex richtext-gap-3 focus:richtext-text-red-500 focus:richtext-bg-red-400 hover:richtext-bg-red-400 dark:hover:richtext-text-red-500 richtext-bg-opacity-10 hover:richtext-bg-opacity-20 focus:richtext-bg-opacity-30 dark:hover:richtext-bg-opacity-20",
|
|
3162
3158
|
children: [
|
|
3163
|
-
/* @__PURE__ */ r(
|
|
3159
|
+
/* @__PURE__ */ r(j, { name: "Trash2" }),
|
|
3164
3160
|
/* @__PURE__ */ r("span", { children: i("editor.remove") })
|
|
3165
3161
|
]
|
|
3166
3162
|
}
|
|
3167
3163
|
),
|
|
3168
3164
|
g ? /* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: x, children: [
|
|
3169
|
-
/* @__PURE__ */ r(
|
|
3165
|
+
/* @__PURE__ */ r(j, { name: "PaintRoller" }),
|
|
3170
3166
|
/* @__PURE__ */ r("span", { children: i("editor.clear.tooltip") })
|
|
3171
3167
|
] }) : null,
|
|
3172
3168
|
/* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: b, children: [
|
|
3173
|
-
/* @__PURE__ */ r(
|
|
3169
|
+
/* @__PURE__ */ r(j, { name: "Clipboard" }),
|
|
3174
3170
|
/* @__PURE__ */ r("span", { children: i("editor.copyToClipboard") })
|
|
3175
3171
|
] }),
|
|
3176
3172
|
/* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: C, children: [
|
|
3177
|
-
/* @__PURE__ */ r(
|
|
3173
|
+
/* @__PURE__ */ r(j, { name: "Copy" }),
|
|
3178
3174
|
/* @__PURE__ */ r("span", { children: i("editor.copy") })
|
|
3179
3175
|
] }),
|
|
3180
|
-
|
|
3181
|
-
|
|
3176
|
+
f || u ? /* @__PURE__ */ r(Ot, {}) : null,
|
|
3177
|
+
f ? /* @__PURE__ */ m(Ei, { children: [
|
|
3182
3178
|
/* @__PURE__ */ m(Zt, { className: "richtext-flex richtext-gap-3", children: [
|
|
3183
|
-
/* @__PURE__ */ r(
|
|
3179
|
+
/* @__PURE__ */ r(j, { name: "AlignCenter" }),
|
|
3184
3180
|
/* @__PURE__ */ r("span", { children: i("editor.textalign.tooltip") })
|
|
3185
3181
|
] }),
|
|
3186
3182
|
/* @__PURE__ */ r(zi, { children: /* @__PURE__ */ m(Yt, { children: [
|
|
3187
|
-
/* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: () =>
|
|
3188
|
-
/* @__PURE__ */ r(
|
|
3183
|
+
/* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: () => A("left"), children: [
|
|
3184
|
+
/* @__PURE__ */ r(j, { name: "AlignLeft" }),
|
|
3189
3185
|
/* @__PURE__ */ r("span", { children: i("editor.textalign.left.tooltip") })
|
|
3190
3186
|
] }),
|
|
3191
|
-
/* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: () =>
|
|
3192
|
-
/* @__PURE__ */ r(
|
|
3187
|
+
/* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: () => A("center"), children: [
|
|
3188
|
+
/* @__PURE__ */ r(j, { name: "AlignCenter" }),
|
|
3193
3189
|
/* @__PURE__ */ r("span", { children: i("editor.textalign.center.tooltip") })
|
|
3194
3190
|
] }),
|
|
3195
|
-
/* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: () =>
|
|
3196
|
-
/* @__PURE__ */ r(
|
|
3191
|
+
/* @__PURE__ */ m(de, { className: "richtext-flex richtext-gap-3", onClick: () => A("right"), children: [
|
|
3192
|
+
/* @__PURE__ */ r(j, { name: "AlignRight" }),
|
|
3197
3193
|
/* @__PURE__ */ r("span", { children: i("editor.textalign.right.tooltip") })
|
|
3198
3194
|
] })
|
|
3199
3195
|
] }) })
|
|
3200
3196
|
] }) : null,
|
|
3201
|
-
|
|
3197
|
+
u ? /* @__PURE__ */ m(Ei, { children: [
|
|
3202
3198
|
/* @__PURE__ */ m(Zt, { className: "richtext-flex richtext-gap-3", children: [
|
|
3203
|
-
/* @__PURE__ */ r(
|
|
3199
|
+
/* @__PURE__ */ r(j, { name: "IndentIncrease" }),
|
|
3204
3200
|
/* @__PURE__ */ r("span", { children: i("editor.indent") })
|
|
3205
3201
|
] }),
|
|
3206
3202
|
/* @__PURE__ */ r(zi, { children: /* @__PURE__ */ m(Yt, { children: [
|
|
@@ -3211,7 +3207,7 @@ function Ds(e) {
|
|
|
3211
3207
|
onClick: v,
|
|
3212
3208
|
disabled: ((L = n == null ? void 0 : n.attrs) == null ? void 0 : L.indent) >= Le.max,
|
|
3213
3209
|
children: [
|
|
3214
|
-
/* @__PURE__ */ r(
|
|
3210
|
+
/* @__PURE__ */ r(j, { name: "IndentIncrease" }),
|
|
3215
3211
|
/* @__PURE__ */ r("span", { children: i("editor.indent.tooltip") })
|
|
3216
3212
|
]
|
|
3217
3213
|
}
|
|
@@ -3223,7 +3219,7 @@ function Ds(e) {
|
|
|
3223
3219
|
onClick: _,
|
|
3224
3220
|
disabled: ((S = n == null ? void 0 : n.attrs) == null ? void 0 : S.indent) <= Le.min,
|
|
3225
3221
|
children: [
|
|
3226
|
-
/* @__PURE__ */ r(
|
|
3222
|
+
/* @__PURE__ */ r(j, { name: "IndentDecrease" }),
|
|
3227
3223
|
/* @__PURE__ */ r("span", { children: i("editor.outdent.tooltip") })
|
|
3228
3224
|
]
|
|
3229
3225
|
}
|
|
@@ -3252,13 +3248,13 @@ function $s({ item: e, disabled: t, editor: i }) {
|
|
|
3252
3248
|
editor: i,
|
|
3253
3249
|
disabled: t || ((a = e == null ? void 0 : e.componentProps) == null ? void 0 : a.disabled)
|
|
3254
3250
|
}
|
|
3255
|
-
) : /* @__PURE__ */ r(
|
|
3251
|
+
) : /* @__PURE__ */ r(W, {});
|
|
3256
3252
|
}
|
|
3257
|
-
function
|
|
3253
|
+
function Vs(e) {
|
|
3258
3254
|
const { t, lang: i } = B(), n = ({ editor: o }) => {
|
|
3259
3255
|
const { selection: c } = o.view.state, { $from: s, to: l } = c;
|
|
3260
3256
|
return s.pos === l ? !1 : c instanceof Me;
|
|
3261
|
-
}, a =
|
|
3257
|
+
}, a = P(() => e.disabled || !(e != null && e.editor) ? [] : Rs(e.editor, t), [e.disabled, e.editor, i, t]);
|
|
3262
3258
|
return /* @__PURE__ */ r(ce, { shouldShow: n, editor: e == null ? void 0 : e.editor, tippyOptions: Bs, children: a != null && a.length ? /* @__PURE__ */ r("div", { className: "richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background", children: /* @__PURE__ */ r("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px] richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative", children: a == null ? void 0 : a.map((o, c) => (o == null ? void 0 : o.type) === "divider" ? /* @__PURE__ */ r(
|
|
3263
3259
|
he,
|
|
3264
3260
|
{
|
|
@@ -3274,9 +3270,9 @@ function js(e) {
|
|
|
3274
3270
|
editor: e.editor
|
|
3275
3271
|
},
|
|
3276
3272
|
`bubbleMenu-text-${c}`
|
|
3277
|
-
)) }) }) : /* @__PURE__ */ r(
|
|
3273
|
+
)) }) }) : /* @__PURE__ */ r(W, {}) });
|
|
3278
3274
|
}
|
|
3279
|
-
function
|
|
3275
|
+
function js({ fill: e }) {
|
|
3280
3276
|
return /* @__PURE__ */ r(
|
|
3281
3277
|
"svg",
|
|
3282
3278
|
{
|
|
@@ -3338,7 +3334,7 @@ function qn(e) {
|
|
|
3338
3334
|
var c;
|
|
3339
3335
|
(c = e.action) == null || c.call(e, t);
|
|
3340
3336
|
}
|
|
3341
|
-
const o =
|
|
3337
|
+
const o = T(
|
|
3342
3338
|
hi((c) => {
|
|
3343
3339
|
i(c);
|
|
3344
3340
|
}, 350),
|
|
@@ -3353,7 +3349,7 @@ function qn(e) {
|
|
|
3353
3349
|
action: a,
|
|
3354
3350
|
tooltipOptions: e == null ? void 0 : e.tooltipOptions,
|
|
3355
3351
|
shortcutKeys: e == null ? void 0 : e.shortcutKeys,
|
|
3356
|
-
children: /* @__PURE__ */ r("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ r(
|
|
3352
|
+
children: /* @__PURE__ */ r("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ r(js, { fill: t }) })
|
|
3357
3353
|
}
|
|
3358
3354
|
),
|
|
3359
3355
|
/* @__PURE__ */ r(
|
|
@@ -3364,13 +3360,13 @@ function qn(e) {
|
|
|
3364
3360
|
onChange: n,
|
|
3365
3361
|
highlight: !0,
|
|
3366
3362
|
disabled: e == null ? void 0 : e.disabled,
|
|
3367
|
-
children: /* @__PURE__ */ r(U, { variant: "ghost", size: "icon", className: "!richtext-w-3 !richtext-h-[32px]", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(
|
|
3363
|
+
children: /* @__PURE__ */ r(U, { variant: "ghost", size: "icon", className: "!richtext-w-3 !richtext-h-[32px]", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(j, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
|
|
3368
3364
|
}
|
|
3369
3365
|
)
|
|
3370
3366
|
] });
|
|
3371
3367
|
}
|
|
3372
|
-
function
|
|
3373
|
-
var b, C,
|
|
3368
|
+
function Fs({ editor: e, disabled: t }) {
|
|
3369
|
+
var b, C, A, v, _, k, N, I, O, M, L, S, y, $, R, E, z, G;
|
|
3374
3370
|
const i = ({ editor: X }) => Sa(X.view.state, "table"), { t: n } = B();
|
|
3375
3371
|
function a() {
|
|
3376
3372
|
e.chain().focus().addColumnBefore().run();
|
|
@@ -3393,10 +3389,10 @@ function Vs({ editor: e, disabled: t }) {
|
|
|
3393
3389
|
function h() {
|
|
3394
3390
|
e.chain().focus().mergeCells().run();
|
|
3395
3391
|
}
|
|
3396
|
-
function
|
|
3392
|
+
function f() {
|
|
3397
3393
|
e == null || e.chain().focus().splitCell().run();
|
|
3398
3394
|
}
|
|
3399
|
-
function
|
|
3395
|
+
function u() {
|
|
3400
3396
|
e.chain().focus().deleteTable().run();
|
|
3401
3397
|
}
|
|
3402
3398
|
function g(X) {
|
|
@@ -3431,7 +3427,7 @@ function Vs({ editor: e, disabled: t }) {
|
|
|
3431
3427
|
plugins: [So],
|
|
3432
3428
|
sticky: "popper"
|
|
3433
3429
|
},
|
|
3434
|
-
children: t ? /* @__PURE__ */ r(
|
|
3430
|
+
children: t ? /* @__PURE__ */ r(W, {}) : /* @__PURE__ */ m("div", { className: "richtext-min-w-32 richtext-flex richtext-flex-row richtext-h-full richtext-items-center richtext-leading-none richtext-gap-0.5 richtext-p-2 richtext-w-full richtext-bg-background richtext-rounded-lg richtext-shadow-sm !richtext-border richtext-border-border", children: [
|
|
3435
3431
|
/* @__PURE__ */ r(
|
|
3436
3432
|
p,
|
|
3437
3433
|
{
|
|
@@ -3453,7 +3449,7 @@ function Vs({ editor: e, disabled: t }) {
|
|
|
3453
3449
|
"tooltip-options": {
|
|
3454
3450
|
sideOffset: 15
|
|
3455
3451
|
},
|
|
3456
|
-
disabled: !((v = (
|
|
3452
|
+
disabled: !((v = (A = e == null ? void 0 : e.can()) == null ? void 0 : A.addColumnAfter) != null && v.call(A))
|
|
3457
3453
|
}
|
|
3458
3454
|
),
|
|
3459
3455
|
/* @__PURE__ */ r(
|
|
@@ -3522,7 +3518,7 @@ function Vs({ editor: e, disabled: t }) {
|
|
|
3522
3518
|
p,
|
|
3523
3519
|
{
|
|
3524
3520
|
icon: "TableCellsSplit",
|
|
3525
|
-
action:
|
|
3521
|
+
action: f,
|
|
3526
3522
|
tooltip: n("editor.table.menu.splitCells"),
|
|
3527
3523
|
"tooltip-options": {
|
|
3528
3524
|
sideOffset: 15
|
|
@@ -3547,7 +3543,7 @@ function Vs({ editor: e, disabled: t }) {
|
|
|
3547
3543
|
{
|
|
3548
3544
|
icon: "Trash2",
|
|
3549
3545
|
tooltip: n("editor.table.menu.deleteTable"),
|
|
3550
|
-
action:
|
|
3546
|
+
action: u,
|
|
3551
3547
|
"tooltip-options": {
|
|
3552
3548
|
sideOffset: 15
|
|
3553
3549
|
},
|
|
@@ -3566,10 +3562,10 @@ function Gn(e) {
|
|
|
3566
3562
|
H(() => {
|
|
3567
3563
|
var s;
|
|
3568
3564
|
if (e != null && e.editor) {
|
|
3569
|
-
const { href: l, target: d } = (s = e.editor) == null ? void 0 : s.getAttributes("link"), { from: h, to:
|
|
3565
|
+
const { href: l, target: d } = (s = e.editor) == null ? void 0 : s.getAttributes("link"), { from: h, to: f } = e.editor.state.selection, u = e.editor.state.doc.textBetween(h, f, " ");
|
|
3570
3566
|
n({
|
|
3571
3567
|
link: l,
|
|
3572
|
-
text:
|
|
3568
|
+
text: u
|
|
3573
3569
|
}), o(d === "_blank");
|
|
3574
3570
|
}
|
|
3575
3571
|
}, [e == null ? void 0 : e.editor]);
|
|
@@ -3601,7 +3597,7 @@ function Gn(e) {
|
|
|
3601
3597
|
onChange: (s) => n({ ...i, link: s.target.value })
|
|
3602
3598
|
}
|
|
3603
3599
|
),
|
|
3604
|
-
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-inset-y-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2 richtext-start-0", children: /* @__PURE__ */ r(
|
|
3600
|
+
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-inset-y-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2 richtext-start-0", children: /* @__PURE__ */ r(j, { className: "richtext-size-5 richtext-text-muted-foreground", name: "Link" }) })
|
|
3605
3601
|
] }) }),
|
|
3606
3602
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-space-x-2", children: [
|
|
3607
3603
|
/* @__PURE__ */ r(ie, { children: t("editor.link.dialog.openInNewTab") }),
|
|
@@ -3662,10 +3658,10 @@ function Us(e) {
|
|
|
3662
3658
|
] });
|
|
3663
3659
|
}
|
|
3664
3660
|
function Ws({ editor: e, disabled: t }) {
|
|
3665
|
-
const [i, n] = w(!1), a =
|
|
3661
|
+
const [i, n] = w(!1), a = P(() => {
|
|
3666
3662
|
const { href: l } = e.getAttributes("link");
|
|
3667
3663
|
return l;
|
|
3668
|
-
}, [e]), o =
|
|
3664
|
+
}, [e]), o = T(({ editor: l }) => l.isActive("link"), []), c = (l, d, h) => {
|
|
3669
3665
|
e.chain().extendMarkRange("link").insertContent({
|
|
3670
3666
|
type: "text",
|
|
3671
3667
|
text: d,
|
|
@@ -3679,10 +3675,10 @@ function Ws({ editor: e, disabled: t }) {
|
|
|
3679
3675
|
}
|
|
3680
3676
|
]
|
|
3681
3677
|
}).setLink({ href: l }).focus().run(), n(!1);
|
|
3682
|
-
}, s =
|
|
3678
|
+
}, s = T(() => {
|
|
3683
3679
|
e.chain().extendMarkRange("link").unsetLink().focus().run(), n(!1);
|
|
3684
3680
|
}, [e]);
|
|
3685
|
-
return /* @__PURE__ */ r(
|
|
3681
|
+
return /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
3686
3682
|
ce,
|
|
3687
3683
|
{
|
|
3688
3684
|
editor: e,
|
|
@@ -3698,7 +3694,7 @@ function Ws({ editor: e, disabled: t }) {
|
|
|
3698
3694
|
n(!1);
|
|
3699
3695
|
}
|
|
3700
3696
|
},
|
|
3701
|
-
children: t ? /* @__PURE__ */ r(
|
|
3697
|
+
children: t ? /* @__PURE__ */ r(W, {}) : /* @__PURE__ */ r(W, { children: i ? /* @__PURE__ */ r(Gn, { onSetLink: c, editor: e }) : /* @__PURE__ */ r(
|
|
3702
3698
|
Us,
|
|
3703
3699
|
{
|
|
3704
3700
|
editor: e,
|
|
@@ -3728,7 +3724,7 @@ function Ci({ item: e, disabled: t, editor: i }) {
|
|
|
3728
3724
|
editor: i,
|
|
3729
3725
|
disabled: t || ((a = e == null ? void 0 : e.componentProps) == null ? void 0 : a.disabled)
|
|
3730
3726
|
}
|
|
3731
|
-
) }) : /* @__PURE__ */ r(
|
|
3727
|
+
) }) : /* @__PURE__ */ r(W, {});
|
|
3732
3728
|
}
|
|
3733
3729
|
function qs(e) {
|
|
3734
3730
|
return e.type.name === "image";
|
|
@@ -3747,8 +3743,8 @@ function Xs(e) {
|
|
|
3747
3743
|
if (qs(d))
|
|
3748
3744
|
return l = !0, !1;
|
|
3749
3745
|
}), l;
|
|
3750
|
-
}, n =
|
|
3751
|
-
return /* @__PURE__ */ r(
|
|
3746
|
+
}, n = P(() => e.disabled ? [] : Is(e.editor), [e.disabled, e.editor, t]);
|
|
3747
|
+
return /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
3752
3748
|
ce,
|
|
3753
3749
|
{
|
|
3754
3750
|
shouldShow: i,
|
|
@@ -3762,7 +3758,7 @@ function Xs(e) {
|
|
|
3762
3758
|
editor: e.editor
|
|
3763
3759
|
},
|
|
3764
3760
|
`bubbleMenu-image-${o}`
|
|
3765
|
-
)) }) }) : /* @__PURE__ */ r(
|
|
3761
|
+
)) }) }) : /* @__PURE__ */ r(W, {})
|
|
3766
3762
|
}
|
|
3767
3763
|
) });
|
|
3768
3764
|
}
|
|
@@ -3774,8 +3770,8 @@ function Zs(e) {
|
|
|
3774
3770
|
if (Gs(d))
|
|
3775
3771
|
return l = !0, !1;
|
|
3776
3772
|
}), l;
|
|
3777
|
-
}, n =
|
|
3778
|
-
return /* @__PURE__ */ r(
|
|
3773
|
+
}, n = P(() => e.disabled ? [] : zs(e.editor), [e.disabled, e.editor, t]);
|
|
3774
|
+
return /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
3779
3775
|
ce,
|
|
3780
3776
|
{
|
|
3781
3777
|
shouldShow: i,
|
|
@@ -3789,7 +3785,7 @@ function Zs(e) {
|
|
|
3789
3785
|
editor: e.editor
|
|
3790
3786
|
},
|
|
3791
3787
|
`bubbleMenu-image-gif-${o}`
|
|
3792
|
-
)) }) }) : /* @__PURE__ */ r(
|
|
3788
|
+
)) }) }) : /* @__PURE__ */ r(W, {})
|
|
3793
3789
|
}
|
|
3794
3790
|
) });
|
|
3795
3791
|
}
|
|
@@ -3801,8 +3797,8 @@ function Ys(e) {
|
|
|
3801
3797
|
if (Ks(d))
|
|
3802
3798
|
return l = !0, !1;
|
|
3803
3799
|
}), l;
|
|
3804
|
-
}, n =
|
|
3805
|
-
return /* @__PURE__ */ r(
|
|
3800
|
+
}, n = P(() => e.disabled ? [] : Hs(e.editor), [e.editor, e.disabled, t]);
|
|
3801
|
+
return /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
3806
3802
|
ce,
|
|
3807
3803
|
{
|
|
3808
3804
|
shouldShow: i,
|
|
@@ -3816,12 +3812,12 @@ function Ys(e) {
|
|
|
3816
3812
|
editor: e.editor
|
|
3817
3813
|
},
|
|
3818
3814
|
`bubbleMenu-video-${o}`
|
|
3819
|
-
)) }) }) : /* @__PURE__ */ r(
|
|
3815
|
+
)) }) }) : /* @__PURE__ */ r(W, {})
|
|
3820
3816
|
}
|
|
3821
3817
|
) });
|
|
3822
3818
|
}
|
|
3823
3819
|
function Js({ editor: e }) {
|
|
3824
|
-
const { t } = B(), i =
|
|
3820
|
+
const { t } = B(), i = T(() => e.isActive(lt.name), [e]), n = T(() => Qe(lt.name, e), [e]), a = T(() => e.chain().focus().addColBefore().run(), [e]), o = T(() => e.chain().focus().addColAfter().run(), [e]), c = T(() => e.chain().focus().deleteCol().run(), [e]);
|
|
3825
3821
|
return /* @__PURE__ */ r(
|
|
3826
3822
|
ce,
|
|
3827
3823
|
{
|
|
@@ -3876,7 +3872,7 @@ function Js({ editor: e }) {
|
|
|
3876
3872
|
}
|
|
3877
3873
|
);
|
|
3878
3874
|
}
|
|
3879
|
-
const
|
|
3875
|
+
const nu = Ma.extend({
|
|
3880
3876
|
addOptions() {
|
|
3881
3877
|
var e;
|
|
3882
3878
|
return {
|
|
@@ -3894,7 +3890,7 @@ const iu = Ma.extend({
|
|
|
3894
3890
|
})
|
|
3895
3891
|
};
|
|
3896
3892
|
}
|
|
3897
|
-
}),
|
|
3893
|
+
}), ru = Ia.extend({
|
|
3898
3894
|
addOptions() {
|
|
3899
3895
|
var e;
|
|
3900
3896
|
return {
|
|
@@ -3914,7 +3910,7 @@ const iu = Ma.extend({
|
|
|
3914
3910
|
}
|
|
3915
3911
|
};
|
|
3916
3912
|
}
|
|
3917
|
-
}),
|
|
3913
|
+
}), au = za.extend({
|
|
3918
3914
|
addOptions() {
|
|
3919
3915
|
var e;
|
|
3920
3916
|
return {
|
|
@@ -3934,7 +3930,7 @@ const iu = Ma.extend({
|
|
|
3934
3930
|
}
|
|
3935
3931
|
};
|
|
3936
3932
|
}
|
|
3937
|
-
}),
|
|
3933
|
+
}), ou = Ea.extend({
|
|
3938
3934
|
addOptions() {
|
|
3939
3935
|
var e;
|
|
3940
3936
|
return {
|
|
@@ -3952,7 +3948,7 @@ const iu = Ma.extend({
|
|
|
3952
3948
|
})
|
|
3953
3949
|
};
|
|
3954
3950
|
}
|
|
3955
|
-
}),
|
|
3951
|
+
}), cu = Ha.extend({
|
|
3956
3952
|
addOptions() {
|
|
3957
3953
|
var e;
|
|
3958
3954
|
return {
|
|
@@ -3972,7 +3968,7 @@ const iu = Ma.extend({
|
|
|
3972
3968
|
}
|
|
3973
3969
|
});
|
|
3974
3970
|
let fe, rt;
|
|
3975
|
-
const
|
|
3971
|
+
const jt = /* @__PURE__ */ new Set(), Ft = /* @__PURE__ */ new Set();
|
|
3976
3972
|
function Qs() {
|
|
3977
3973
|
return fe;
|
|
3978
3974
|
}
|
|
@@ -3991,10 +3987,10 @@ function el(e) {
|
|
|
3991
3987
|
return rt;
|
|
3992
3988
|
}
|
|
3993
3989
|
async function Kn(e) {
|
|
3994
|
-
return fe && !fe.getLoadedThemes().includes(e) && !
|
|
3990
|
+
return fe && !fe.getLoadedThemes().includes(e) && !Ft.has(e) && e in fn ? (Ft.add(e), await fe.loadTheme(e), Ft.delete(e), !0) : !1;
|
|
3995
3991
|
}
|
|
3996
3992
|
async function Xn(e) {
|
|
3997
|
-
return fe && !fe.getLoadedLanguages().includes(e) && !
|
|
3993
|
+
return fe && !fe.getLoadedLanguages().includes(e) && !jt.has(e) && e in gn ? (jt.add(e), await fe.loadLanguage(e), jt.delete(e), !0) : !1;
|
|
3998
3994
|
}
|
|
3999
3995
|
async function tl({
|
|
4000
3996
|
doc: e,
|
|
@@ -4027,11 +4023,11 @@ function Ui({
|
|
|
4027
4023
|
if (!h)
|
|
4028
4024
|
return;
|
|
4029
4025
|
h.getLoadedLanguages().includes(l) || (l = "plaintext");
|
|
4030
|
-
const
|
|
4026
|
+
const f = h.getLoadedThemes().includes(d) ? d : h.getLoadedThemes()[0], u = h.codeToTokensBase(c.node.textContent, {
|
|
4031
4027
|
lang: l,
|
|
4032
|
-
theme:
|
|
4028
|
+
theme: f
|
|
4033
4029
|
});
|
|
4034
|
-
for (const g of
|
|
4030
|
+
for (const g of u) {
|
|
4035
4031
|
for (const x of g) {
|
|
4036
4032
|
const b = s + x.content.length, C = qe.inline(s, b, {
|
|
4037
4033
|
style: `color: ${x.color}`
|
|
@@ -4097,11 +4093,11 @@ function il({
|
|
|
4097
4093
|
const l = c.selection.$head.parent.type.name, d = s.selection.$head.parent.type.name, h = ct(
|
|
4098
4094
|
c.doc,
|
|
4099
4095
|
(g) => g.type.name === e
|
|
4100
|
-
),
|
|
4096
|
+
), f = ct(
|
|
4101
4097
|
s.doc,
|
|
4102
4098
|
(g) => g.type.name === e
|
|
4103
|
-
),
|
|
4104
|
-
return a.getMeta("shikiPluginForceDecoration") ||
|
|
4099
|
+
), u = a.docChanged && ([l, d].includes(e) || f.length !== h.length || a.steps.some((g) => g.from !== void 0 && g.to !== void 0 && h.some((x) => x.pos >= g.from && x.pos + x.node.nodeSize <= g.to)));
|
|
4100
|
+
return a.getMeta("shikiPluginForceDecoration") || u ? Ui({
|
|
4105
4101
|
doc: a.doc,
|
|
4106
4102
|
name: e,
|
|
4107
4103
|
defaultLanguage: t,
|
|
@@ -4120,7 +4116,7 @@ function il({
|
|
|
4120
4116
|
function nl({ action: e, languages: t, ...i }) {
|
|
4121
4117
|
const n = (o) => {
|
|
4122
4118
|
e(o);
|
|
4123
|
-
}, a =
|
|
4119
|
+
}, a = P(() => t == null ? void 0 : t.map((o) => ({
|
|
4124
4120
|
title: No[o] || o,
|
|
4125
4121
|
// icon: language.icon,
|
|
4126
4122
|
language: o
|
|
@@ -4159,11 +4155,11 @@ function ul() {
|
|
|
4159
4155
|
} };
|
|
4160
4156
|
}
|
|
4161
4157
|
function ml({ editor: e, node: { attrs: t }, updateAttributes: i, extension: n }) {
|
|
4162
|
-
var
|
|
4163
|
-
const { isCopied: a, copyToClipboard: o } = ul(), c =
|
|
4158
|
+
var u, g;
|
|
4159
|
+
const { isCopied: a, copyToClipboard: o } = ul(), c = P(() => {
|
|
4164
4160
|
var x;
|
|
4165
4161
|
return (x = n.options.languages) != null && x.length ? n.options.languages : xn;
|
|
4166
|
-
}, [n.options.languages]), s = Dt(), l = (g = (
|
|
4162
|
+
}, [n.options.languages]), s = Dt(), l = (g = (u = e == null ? void 0 : e.options) == null ? void 0 : u.editorProps) == null ? void 0 : g.print, { language: d } = t, h = J(), f = T(() => Qe(fl.name, e), [e]);
|
|
4167
4163
|
return /* @__PURE__ */ m(ae, { className: ee(pe.wrap, !l && pe.maxHeight, "render-wrapper"), children: [
|
|
4168
4164
|
/* @__PURE__ */ m(
|
|
4169
4165
|
"div",
|
|
@@ -4183,10 +4179,10 @@ function ml({ editor: e, node: { attrs: t }, updateAttributes: i, extension: n }
|
|
|
4183
4179
|
/* @__PURE__ */ r(
|
|
4184
4180
|
"span",
|
|
4185
4181
|
{
|
|
4186
|
-
onClick:
|
|
4182
|
+
onClick: f,
|
|
4187
4183
|
className: pe.btnDelete,
|
|
4188
4184
|
children: /* @__PURE__ */ r(
|
|
4189
|
-
|
|
4185
|
+
j,
|
|
4190
4186
|
{
|
|
4191
4187
|
name: "Trash2"
|
|
4192
4188
|
}
|
|
@@ -4256,7 +4252,7 @@ const fl = Oa.extend({
|
|
|
4256
4252
|
});
|
|
4257
4253
|
function gl(e) {
|
|
4258
4254
|
var a, o, c;
|
|
4259
|
-
const { t, lang: i } = B(), n =
|
|
4255
|
+
const { t, lang: i } = B(), n = P(() => {
|
|
4260
4256
|
var d;
|
|
4261
4257
|
const s = (d = e == null ? void 0 : e.items) == null ? void 0 : d.find((h) => h.isActive());
|
|
4262
4258
|
return s && !s.default ? {
|
|
@@ -4288,7 +4284,7 @@ function gl(e) {
|
|
|
4288
4284
|
}) })
|
|
4289
4285
|
] });
|
|
4290
4286
|
}
|
|
4291
|
-
const
|
|
4287
|
+
const su = Pa.extend({
|
|
4292
4288
|
addOptions() {
|
|
4293
4289
|
var e;
|
|
4294
4290
|
return {
|
|
@@ -4330,7 +4326,7 @@ const cu = Pa.extend({
|
|
|
4330
4326
|
});
|
|
4331
4327
|
function xl(e) {
|
|
4332
4328
|
var i;
|
|
4333
|
-
const t =
|
|
4329
|
+
const t = P(() => {
|
|
4334
4330
|
var o;
|
|
4335
4331
|
const n = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((c) => c.isActive());
|
|
4336
4332
|
return n && !n.default ? {
|
|
@@ -4370,7 +4366,7 @@ function xl(e) {
|
|
|
4370
4366
|
}) })
|
|
4371
4367
|
] });
|
|
4372
4368
|
}
|
|
4373
|
-
const
|
|
4369
|
+
const lu = Da.extend({
|
|
4374
4370
|
addOptions() {
|
|
4375
4371
|
var e;
|
|
4376
4372
|
return {
|
|
@@ -4412,7 +4408,7 @@ const su = Da.extend({
|
|
|
4412
4408
|
});
|
|
4413
4409
|
function bl(e) {
|
|
4414
4410
|
var i;
|
|
4415
|
-
const t =
|
|
4411
|
+
const t = P(() => {
|
|
4416
4412
|
var o;
|
|
4417
4413
|
const n = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((c) => c.isActive());
|
|
4418
4414
|
return n && !n.default ? {
|
|
@@ -4432,7 +4428,7 @@ function bl(e) {
|
|
|
4432
4428
|
icon: e == null ? void 0 : e.icon,
|
|
4433
4429
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
4434
4430
|
disabled: e == null ? void 0 : e.disabled,
|
|
4435
|
-
children: /* @__PURE__ */ r(
|
|
4431
|
+
children: /* @__PURE__ */ r(j, { className: "richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500", name: "MenuDown" })
|
|
4436
4432
|
}
|
|
4437
4433
|
) }),
|
|
4438
4434
|
/* @__PURE__ */ r(
|
|
@@ -4452,7 +4448,7 @@ function bl(e) {
|
|
|
4452
4448
|
className: "richtext-p-1 richtext-w-7 richtext-h-7",
|
|
4453
4449
|
pressed: t.title === n.title,
|
|
4454
4450
|
"data-state": t.title === n.title ? "on" : "off",
|
|
4455
|
-
children: (n == null ? void 0 : n.icon) && /* @__PURE__ */ r(
|
|
4451
|
+
children: (n == null ? void 0 : n.icon) && /* @__PURE__ */ r(j, { name: n.icon })
|
|
4456
4452
|
}
|
|
4457
4453
|
) }),
|
|
4458
4454
|
/* @__PURE__ */ m(Ee, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
@@ -4465,7 +4461,7 @@ function bl(e) {
|
|
|
4465
4461
|
)
|
|
4466
4462
|
] });
|
|
4467
4463
|
}
|
|
4468
|
-
const
|
|
4464
|
+
const du = Ba.extend({
|
|
4469
4465
|
addOptions() {
|
|
4470
4466
|
var e;
|
|
4471
4467
|
return {
|
|
@@ -4488,7 +4484,7 @@ const lu = Ba.extend({
|
|
|
4488
4484
|
right: "AlignRight",
|
|
4489
4485
|
justify: "AlignJustify"
|
|
4490
4486
|
}, s = a.map((h) => {
|
|
4491
|
-
var
|
|
4487
|
+
var f, u, g;
|
|
4492
4488
|
return {
|
|
4493
4489
|
title: n(`editor.textalign.${h}.tooltip`),
|
|
4494
4490
|
icon: c[h],
|
|
@@ -4498,7 +4494,7 @@ const lu = Ba.extend({
|
|
|
4498
4494
|
var x, b;
|
|
4499
4495
|
return (b = (x = t.commands) == null ? void 0 : x.setTextAlign) == null ? void 0 : b.call(x, h);
|
|
4500
4496
|
},
|
|
4501
|
-
disabled: !((g = (
|
|
4497
|
+
disabled: !((g = (u = (f = t == null ? void 0 : t.can) == null ? void 0 : f.call(t)) == null ? void 0 : u.setTextAlign) != null && g.call(u, h))
|
|
4502
4498
|
};
|
|
4503
4499
|
}), l = s.filter((h) => h.disabled).length === s.length;
|
|
4504
4500
|
return {
|
|
@@ -4516,7 +4512,7 @@ const lu = Ba.extend({
|
|
|
4516
4512
|
});
|
|
4517
4513
|
function pl(e) {
|
|
4518
4514
|
var n;
|
|
4519
|
-
const { t } = B(), i =
|
|
4515
|
+
const { t } = B(), i = P(() => {
|
|
4520
4516
|
const a = (e.items || []).find((c) => c.isActive());
|
|
4521
4517
|
return a || {
|
|
4522
4518
|
title: t("editor.fontSize.default.tooltip"),
|
|
@@ -4544,7 +4540,7 @@ function pl(e) {
|
|
|
4544
4540
|
)) })
|
|
4545
4541
|
] });
|
|
4546
4542
|
}
|
|
4547
|
-
const
|
|
4543
|
+
const hu = Y.create({
|
|
4548
4544
|
name: "fontSize",
|
|
4549
4545
|
addOptions() {
|
|
4550
4546
|
var e;
|
|
@@ -4658,7 +4654,7 @@ function _l(e) {
|
|
|
4658
4654
|
var c;
|
|
4659
4655
|
(c = e.action) == null || c.call(e, t);
|
|
4660
4656
|
}
|
|
4661
|
-
const o =
|
|
4657
|
+
const o = T(
|
|
4662
4658
|
hi((c) => {
|
|
4663
4659
|
i(c);
|
|
4664
4660
|
}, 350),
|
|
@@ -4675,12 +4671,12 @@ function _l(e) {
|
|
|
4675
4671
|
disabled: e == null ? void 0 : e.disabled,
|
|
4676
4672
|
colors: e == null ? void 0 : e.colors,
|
|
4677
4673
|
defaultColor: e == null ? void 0 : e.defaultColor,
|
|
4678
|
-
children: /* @__PURE__ */ r(U, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(
|
|
4674
|
+
children: /* @__PURE__ */ r(U, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(j, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
|
|
4679
4675
|
}
|
|
4680
4676
|
)
|
|
4681
4677
|
] });
|
|
4682
4678
|
}
|
|
4683
|
-
const
|
|
4679
|
+
const uu = $a.extend({
|
|
4684
4680
|
addOptions() {
|
|
4685
4681
|
var e;
|
|
4686
4682
|
return {
|
|
@@ -4706,7 +4702,7 @@ const hu = $a.extend({
|
|
|
4706
4702
|
}
|
|
4707
4703
|
};
|
|
4708
4704
|
}
|
|
4709
|
-
}),
|
|
4705
|
+
}), mu = Va.extend({
|
|
4710
4706
|
addOptions() {
|
|
4711
4707
|
var e;
|
|
4712
4708
|
return {
|
|
@@ -4727,7 +4723,7 @@ const hu = $a.extend({
|
|
|
4727
4723
|
})
|
|
4728
4724
|
};
|
|
4729
4725
|
}
|
|
4730
|
-
}),
|
|
4726
|
+
}), fu = ja.extend({
|
|
4731
4727
|
addOptions() {
|
|
4732
4728
|
var e;
|
|
4733
4729
|
return {
|
|
@@ -4745,7 +4741,7 @@ const hu = $a.extend({
|
|
|
4745
4741
|
})
|
|
4746
4742
|
};
|
|
4747
4743
|
}
|
|
4748
|
-
}),
|
|
4744
|
+
}), gu = ue.create({
|
|
4749
4745
|
name: "clear",
|
|
4750
4746
|
addOptions() {
|
|
4751
4747
|
var e;
|
|
@@ -4762,7 +4758,7 @@ const hu = $a.extend({
|
|
|
4762
4758
|
})
|
|
4763
4759
|
};
|
|
4764
4760
|
}
|
|
4765
|
-
}),
|
|
4761
|
+
}), xu = Fa.extend({
|
|
4766
4762
|
addOptions() {
|
|
4767
4763
|
var e;
|
|
4768
4764
|
return {
|
|
@@ -4780,7 +4776,7 @@ const hu = $a.extend({
|
|
|
4780
4776
|
})
|
|
4781
4777
|
};
|
|
4782
4778
|
}
|
|
4783
|
-
}),
|
|
4779
|
+
}), bu = Ua.extend({
|
|
4784
4780
|
addOptions() {
|
|
4785
4781
|
var e;
|
|
4786
4782
|
return {
|
|
@@ -4809,7 +4805,7 @@ const hu = $a.extend({
|
|
|
4809
4805
|
addExtensions() {
|
|
4810
4806
|
return [Wa.configure(this.options.taskItem)];
|
|
4811
4807
|
}
|
|
4812
|
-
}),
|
|
4808
|
+
}), pu = qa.extend({
|
|
4813
4809
|
addOptions() {
|
|
4814
4810
|
var e;
|
|
4815
4811
|
return {
|
|
@@ -4843,13 +4839,13 @@ function vl(e) {
|
|
|
4843
4839
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
4844
4840
|
isActive: e == null ? void 0 : e.isActive,
|
|
4845
4841
|
disabled: e == null ? void 0 : e.disabled,
|
|
4846
|
-
children: /* @__PURE__ */ r(
|
|
4842
|
+
children: /* @__PURE__ */ r(j, { name: e == null ? void 0 : e.icon })
|
|
4847
4843
|
}
|
|
4848
4844
|
) }),
|
|
4849
4845
|
/* @__PURE__ */ r(re, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(Gn, { editor: e.editor, onSetLink: n }) })
|
|
4850
4846
|
] });
|
|
4851
4847
|
}
|
|
4852
|
-
const
|
|
4848
|
+
const wu = Ga.extend({
|
|
4853
4849
|
inclusive: !1,
|
|
4854
4850
|
parseHTML() {
|
|
4855
4851
|
return [
|
|
@@ -4916,7 +4912,7 @@ const pu = Ga.extend({
|
|
|
4916
4912
|
})
|
|
4917
4913
|
];
|
|
4918
4914
|
}
|
|
4919
|
-
}),
|
|
4915
|
+
}), _u = Xa.extend({
|
|
4920
4916
|
renderHTML() {
|
|
4921
4917
|
return [
|
|
4922
4918
|
"div",
|
|
@@ -4974,7 +4970,7 @@ function yl(e) {
|
|
|
4974
4970
|
onClick: o,
|
|
4975
4971
|
children: [
|
|
4976
4972
|
l && /* @__PURE__ */ r(l, { className: "richtext-w-4 richtext-h-4" }),
|
|
4977
|
-
s && /* @__PURE__ */ r(
|
|
4973
|
+
s && /* @__PURE__ */ r(W, { children: s })
|
|
4978
4974
|
]
|
|
4979
4975
|
}
|
|
4980
4976
|
) }),
|
|
@@ -4984,7 +4980,7 @@ function yl(e) {
|
|
|
4984
4980
|
] }) })
|
|
4985
4981
|
] });
|
|
4986
4982
|
}
|
|
4987
|
-
const kl = ["undo", "redo"],
|
|
4983
|
+
const kl = ["undo", "redo"], vu = Za.extend({
|
|
4988
4984
|
addOptions() {
|
|
4989
4985
|
var e;
|
|
4990
4986
|
return {
|
|
@@ -5049,18 +5045,18 @@ function Ut({
|
|
|
5049
5045
|
type: "paragraph"
|
|
5050
5046
|
}
|
|
5051
5047
|
]
|
|
5052
|
-
})), s.attrs.cols = s.content.length, s.content.forEach((
|
|
5053
|
-
|
|
5048
|
+
})), s.attrs.cols = s.content.length, s.content.forEach((u, g) => {
|
|
5049
|
+
u.attrs.index = g;
|
|
5054
5050
|
});
|
|
5055
5051
|
const d = po.fromJSON(e.schema, s);
|
|
5056
5052
|
let h = n.pos;
|
|
5057
|
-
d.content.forEach((
|
|
5058
|
-
x < l && (h +=
|
|
5053
|
+
d.content.forEach((u, g, x) => {
|
|
5054
|
+
x < l && (h += u.nodeSize);
|
|
5059
5055
|
});
|
|
5060
|
-
const
|
|
5061
|
-
|
|
5062
|
-
Me.near(
|
|
5063
|
-
), t(
|
|
5056
|
+
const f = e.tr.setTime(Date.now());
|
|
5057
|
+
f.replaceWith(n.pos, n.pos + n.node.nodeSize, d).setSelection(
|
|
5058
|
+
Me.near(f.doc.resolve(h))
|
|
5059
|
+
), t(f);
|
|
5064
5060
|
}
|
|
5065
5061
|
return !0;
|
|
5066
5062
|
}
|
|
@@ -5071,8 +5067,8 @@ function Wi({ state: e, dispatch: t, type: i }) {
|
|
|
5071
5067
|
let s = 0;
|
|
5072
5068
|
i === "before" ? s = (c - 1 + o.attrs.cols) % o.attrs.cols : s = (c + 1) % o.attrs.cols;
|
|
5073
5069
|
let l = n.pos;
|
|
5074
|
-
o.content.forEach((h,
|
|
5075
|
-
|
|
5070
|
+
o.content.forEach((h, f, u) => {
|
|
5071
|
+
u < s && (l += h.nodeSize);
|
|
5076
5072
|
});
|
|
5077
5073
|
const d = e.tr.setTime(Date.now());
|
|
5078
5074
|
return d.setSelection(Me.near(d.doc.resolve(l))), t(d), !0;
|
|
@@ -5171,7 +5167,7 @@ const Ll = 200, lt = ue.create({
|
|
|
5171
5167
|
renderHTML({ HTMLAttributes: e }) {
|
|
5172
5168
|
return ["div", ne(this.options.HTMLAttributes, e), 0];
|
|
5173
5169
|
}
|
|
5174
|
-
}),
|
|
5170
|
+
}), yu = Y.create({
|
|
5175
5171
|
name: "columnActionButton",
|
|
5176
5172
|
addOptions() {
|
|
5177
5173
|
var e;
|
|
@@ -5210,7 +5206,7 @@ const Ll = 200, lt = ue.create({
|
|
|
5210
5206
|
}
|
|
5211
5207
|
});
|
|
5212
5208
|
function Ml(e) {
|
|
5213
|
-
const { t } = B(), i =
|
|
5209
|
+
const { t } = B(), i = P(() => [
|
|
5214
5210
|
{
|
|
5215
5211
|
name: "paragraph",
|
|
5216
5212
|
label: t("editor.paragraph.tooltip"),
|
|
@@ -5274,7 +5270,7 @@ function Ml(e) {
|
|
|
5274
5270
|
iconName: "Code2",
|
|
5275
5271
|
action: () => e.editor.chain().focus().clearNodes().toggleCodeBlock().run()
|
|
5276
5272
|
}
|
|
5277
|
-
], [e.editor, t]), n =
|
|
5273
|
+
], [e.editor, t]), n = P(() => i.filter((a) => a.isActive()).pop() ?? {
|
|
5278
5274
|
label: "Empty"
|
|
5279
5275
|
}, [i]);
|
|
5280
5276
|
return /* @__PURE__ */ m(ve, { children: [
|
|
@@ -5357,7 +5353,7 @@ const zl = Y.create({
|
|
|
5357
5353
|
})
|
|
5358
5354
|
];
|
|
5359
5355
|
}
|
|
5360
|
-
}),
|
|
5356
|
+
}), ku = Y.create({
|
|
5361
5357
|
name: "base-kit",
|
|
5362
5358
|
addExtensions() {
|
|
5363
5359
|
const e = [];
|
|
@@ -5365,7 +5361,7 @@ const zl = Y.create({
|
|
|
5365
5361
|
Ja.configure({
|
|
5366
5362
|
placeholder: ({ node: t, pos: i, editor: n }) => {
|
|
5367
5363
|
var a, o, c, s, l;
|
|
5368
|
-
return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((o = t == null ? void 0 : t.content) == null ? void 0 : o.size) !== 0 ? "" : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "heading" ? `${
|
|
5364
|
+
return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((o = t == null ? void 0 : t.content) == null ? void 0 : o.size) !== 0 ? "" : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "heading" ? `${F.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "codeBlock" || ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "table" ? "" : n.extensionManager.extensions.some((d) => d.name === "slashCommand") ? F.t("editor.slash") : i === 0 ? F.t("editor.content") : F.t("editor.content");
|
|
5369
5365
|
},
|
|
5370
5366
|
...this.options.placeholder
|
|
5371
5367
|
})
|
|
@@ -5382,7 +5378,7 @@ const zl = Y.create({
|
|
|
5382
5378
|
})
|
|
5383
5379
|
), this.options.characterCount !== !1 && e.push(no.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(ro.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(ao.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(oo.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(co.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(zl.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(Sl), this.options.multiColumn !== !1 && (e.push(Ni), e.push(lt)), e;
|
|
5384
5380
|
}
|
|
5385
|
-
}),
|
|
5381
|
+
}), Cu = Y.create({
|
|
5386
5382
|
name: "subAndSuperScript",
|
|
5387
5383
|
addOptions() {
|
|
5388
5384
|
var e;
|
|
@@ -5419,7 +5415,7 @@ const zl = Y.create({
|
|
|
5419
5415
|
});
|
|
5420
5416
|
function El(e) {
|
|
5421
5417
|
var i;
|
|
5422
|
-
const t =
|
|
5418
|
+
const t = P(() => {
|
|
5423
5419
|
var o;
|
|
5424
5420
|
const n = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((c) => c.isActive());
|
|
5425
5421
|
return n && !n.default ? {
|
|
@@ -5439,7 +5435,7 @@ function El(e) {
|
|
|
5439
5435
|
icon: e == null ? void 0 : e.icon,
|
|
5440
5436
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
5441
5437
|
disabled: e == null ? void 0 : e.disabled,
|
|
5442
|
-
children: /* @__PURE__ */ r(
|
|
5438
|
+
children: /* @__PURE__ */ r(Fn, { className: "richtext-w-3 richtext-h-3 richtext-text-gray-500" })
|
|
5443
5439
|
}
|
|
5444
5440
|
) }),
|
|
5445
5441
|
/* @__PURE__ */ r(be, { className: "w-full", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((n, a) => /* @__PURE__ */ m(
|
|
@@ -5449,7 +5445,7 @@ function El(e) {
|
|
|
5449
5445
|
onClick: n.action,
|
|
5450
5446
|
className: "richtext-flex richtext-items-center richtext-gap-3",
|
|
5451
5447
|
children: [
|
|
5452
|
-
/* @__PURE__ */ r(
|
|
5448
|
+
/* @__PURE__ */ r(j, { name: n == null ? void 0 : n.icon }),
|
|
5453
5449
|
/* @__PURE__ */ r("span", { className: "richtext-ml-1", children: n.title }),
|
|
5454
5450
|
!!(n != null && n.shortcutKeys) && /* @__PURE__ */ r("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: Rt(n.shortcutKeys) })
|
|
5455
5451
|
]
|
|
@@ -5458,7 +5454,7 @@ function El(e) {
|
|
|
5458
5454
|
)) })
|
|
5459
5455
|
] });
|
|
5460
5456
|
}
|
|
5461
|
-
const
|
|
5457
|
+
const Nu = Y.create({
|
|
5462
5458
|
name: "moreMark",
|
|
5463
5459
|
addOptions() {
|
|
5464
5460
|
var e;
|
|
@@ -5496,7 +5492,7 @@ const Cu = Y.create({
|
|
|
5496
5492
|
const e = [];
|
|
5497
5493
|
return this.options.subscript !== !1 && e.push(sn.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(ln.configure(this.options.superscript)), e;
|
|
5498
5494
|
}
|
|
5499
|
-
}),
|
|
5495
|
+
}), Tu = Y.create({
|
|
5500
5496
|
name: "indent",
|
|
5501
5497
|
addOptions() {
|
|
5502
5498
|
var e;
|
|
@@ -5552,11 +5548,11 @@ const Cu = Y.create({
|
|
|
5552
5548
|
},
|
|
5553
5549
|
addCommands() {
|
|
5554
5550
|
return {
|
|
5555
|
-
indent: () =>
|
|
5551
|
+
indent: () => Fi({
|
|
5556
5552
|
delta: Le.more,
|
|
5557
5553
|
types: this.options.types
|
|
5558
5554
|
}),
|
|
5559
|
-
outdent: () =>
|
|
5555
|
+
outdent: () => Fi({
|
|
5560
5556
|
delta: Le.less,
|
|
5561
5557
|
types: this.options.types
|
|
5562
5558
|
})
|
|
@@ -5577,7 +5573,7 @@ function Rl(e) {
|
|
|
5577
5573
|
function a(c) {
|
|
5578
5574
|
c === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(c), n(c);
|
|
5579
5575
|
}
|
|
5580
|
-
const o =
|
|
5576
|
+
const o = P(() => {
|
|
5581
5577
|
const l = e.editor.extensionManager.extensions.find(
|
|
5582
5578
|
(d) => d.name === "lineHeight"
|
|
5583
5579
|
).options.lineHeights.map((d) => ({
|
|
@@ -5597,7 +5593,7 @@ function Rl(e) {
|
|
|
5597
5593
|
icon: "LineHeight",
|
|
5598
5594
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
5599
5595
|
disabled: e == null ? void 0 : e.disabled,
|
|
5600
|
-
children: /* @__PURE__ */ r(
|
|
5596
|
+
children: /* @__PURE__ */ r(j, { className: "richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500", name: "MenuDown" })
|
|
5601
5597
|
}
|
|
5602
5598
|
) }),
|
|
5603
5599
|
/* @__PURE__ */ r(be, { className: "richtext-min-w-24", children: o == null ? void 0 : o.map((c, s) => /* @__PURE__ */ r(
|
|
@@ -5627,12 +5623,12 @@ function Pl(e, t) {
|
|
|
5627
5623
|
}), c.length === 0)
|
|
5628
5624
|
return e;
|
|
5629
5625
|
for (const l of c) {
|
|
5630
|
-
const { node: d, pos: h, nodeType:
|
|
5631
|
-
let { attrs:
|
|
5632
|
-
|
|
5633
|
-
...
|
|
5626
|
+
const { node: d, pos: h, nodeType: f } = l;
|
|
5627
|
+
let { attrs: u } = d;
|
|
5628
|
+
u = {
|
|
5629
|
+
...u,
|
|
5634
5630
|
lineHeight: s
|
|
5635
|
-
}, e = e.setNodeMarkup(h,
|
|
5631
|
+
}, e = e.setNodeMarkup(h, f, u, d.marks);
|
|
5636
5632
|
}
|
|
5637
5633
|
return e;
|
|
5638
5634
|
}
|
|
@@ -5643,7 +5639,7 @@ function Dl(e) {
|
|
|
5643
5639
|
return a = a.setSelection(n), a = Pl(a, e), a.docChanged ? (i && i(a), !0) : !1;
|
|
5644
5640
|
};
|
|
5645
5641
|
}
|
|
5646
|
-
const
|
|
5642
|
+
const Au = Y.create({
|
|
5647
5643
|
name: "lineHeight",
|
|
5648
5644
|
addOptions() {
|
|
5649
5645
|
var e;
|
|
@@ -5683,37 +5679,33 @@ const Tu = Y.create({
|
|
|
5683
5679
|
unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
|
|
5684
5680
|
};
|
|
5685
5681
|
}
|
|
5686
|
-
}), Zn = zt(
|
|
5687
|
-
isOpen: !1
|
|
5688
|
-
});
|
|
5682
|
+
}), Zn = zt(!1);
|
|
5689
5683
|
function Bl() {
|
|
5690
5684
|
return Et(Zn);
|
|
5691
5685
|
}
|
|
5692
|
-
const
|
|
5686
|
+
const Ve = {
|
|
5693
5687
|
setOpen: (e) => {
|
|
5694
|
-
Zn.
|
|
5688
|
+
Zn.set(e);
|
|
5695
5689
|
}
|
|
5696
|
-
}, Yn = zt(
|
|
5697
|
-
isOpen: !1
|
|
5698
|
-
});
|
|
5690
|
+
}, Yn = zt(!1);
|
|
5699
5691
|
function $l() {
|
|
5700
5692
|
return Et(Yn);
|
|
5701
5693
|
}
|
|
5702
5694
|
const ot = {
|
|
5703
5695
|
setOpen: (e) => {
|
|
5704
|
-
Yn.
|
|
5696
|
+
Yn.set(e);
|
|
5705
5697
|
}
|
|
5706
5698
|
};
|
|
5707
|
-
function
|
|
5699
|
+
function Vl(e) {
|
|
5708
5700
|
const t = [
|
|
5709
5701
|
{
|
|
5710
5702
|
name: "format",
|
|
5711
|
-
title:
|
|
5703
|
+
title: F.t("editor.slash.format"),
|
|
5712
5704
|
commands: []
|
|
5713
5705
|
},
|
|
5714
5706
|
{
|
|
5715
5707
|
name: "insert",
|
|
5716
|
-
title:
|
|
5708
|
+
title: F.t("editor.slash.insert"),
|
|
5717
5709
|
commands: []
|
|
5718
5710
|
}
|
|
5719
5711
|
];
|
|
@@ -5721,7 +5713,7 @@ function jl(e) {
|
|
|
5721
5713
|
i.name.toLowerCase() === "heading" && i.options.levels.forEach((n) => {
|
|
5722
5714
|
t[0].commands.push({
|
|
5723
5715
|
name: `heading${n}`,
|
|
5724
|
-
label:
|
|
5716
|
+
label: F.t(`editor.heading.h${n}.tooltip`),
|
|
5725
5717
|
aliases: [`h${n}`, "bt", `bt${n}`],
|
|
5726
5718
|
iconName: `Heading${n}`,
|
|
5727
5719
|
action: ({ editor: a, range: o }) => {
|
|
@@ -5730,7 +5722,7 @@ function jl(e) {
|
|
|
5730
5722
|
});
|
|
5731
5723
|
}), i.name.toLowerCase() === "bulletlist" && t[0].commands.push({
|
|
5732
5724
|
name: "bulletList",
|
|
5733
|
-
label:
|
|
5725
|
+
label: F.t("editor.bulletlist.tooltip"),
|
|
5734
5726
|
aliases: ["ul", "yxlb"],
|
|
5735
5727
|
iconName: "List",
|
|
5736
5728
|
action: ({ editor: n, range: a }) => {
|
|
@@ -5738,7 +5730,7 @@ function jl(e) {
|
|
|
5738
5730
|
}
|
|
5739
5731
|
}), i.name.toLowerCase() === "orderedlist" && t[0].commands.push({
|
|
5740
5732
|
name: "numberedList",
|
|
5741
|
-
label:
|
|
5733
|
+
label: F.t("editor.orderedlist.tooltip"),
|
|
5742
5734
|
aliases: ["ol", "yxlb"],
|
|
5743
5735
|
iconName: "ListOrdered",
|
|
5744
5736
|
action: ({ editor: n, range: a }) => {
|
|
@@ -5746,7 +5738,7 @@ function jl(e) {
|
|
|
5746
5738
|
}
|
|
5747
5739
|
}), i.name.toLowerCase() === "tasklist" && t[0].commands.push({
|
|
5748
5740
|
name: "taskList",
|
|
5749
|
-
label:
|
|
5741
|
+
label: F.t("editor.tasklist.tooltip"),
|
|
5750
5742
|
iconName: "ListTodo",
|
|
5751
5743
|
description: "Task list with todo items",
|
|
5752
5744
|
aliases: ["todo"],
|
|
@@ -5755,7 +5747,7 @@ function jl(e) {
|
|
|
5755
5747
|
}
|
|
5756
5748
|
}), i.name.toLowerCase() === "blockquote" && t[0].commands.push({
|
|
5757
5749
|
name: "blockquote",
|
|
5758
|
-
label:
|
|
5750
|
+
label: F.t("editor.blockquote.tooltip"),
|
|
5759
5751
|
description: "插入引入格式",
|
|
5760
5752
|
aliases: ["yr"],
|
|
5761
5753
|
iconName: "TextQuote",
|
|
@@ -5764,7 +5756,7 @@ function jl(e) {
|
|
|
5764
5756
|
}
|
|
5765
5757
|
}), i.name.toLowerCase() === "codeblock" && t[0].commands.push({
|
|
5766
5758
|
name: "codeBlock",
|
|
5767
|
-
label:
|
|
5759
|
+
label: F.t("editor.codeblock.tooltip"),
|
|
5768
5760
|
iconName: "Code2",
|
|
5769
5761
|
description: "Code block with syntax highlighting",
|
|
5770
5762
|
shouldBeHidden: (n) => n.isActive("columns"),
|
|
@@ -5773,17 +5765,17 @@ function jl(e) {
|
|
|
5773
5765
|
}
|
|
5774
5766
|
}), i.name.toLowerCase() === "image" && t[1].commands.push({
|
|
5775
5767
|
name: "image",
|
|
5776
|
-
label:
|
|
5768
|
+
label: F.t("editor.image.tooltip"),
|
|
5777
5769
|
iconName: "ImageUp",
|
|
5778
5770
|
description: "Insert a image",
|
|
5779
5771
|
aliases: ["image", "tp", "tupian"],
|
|
5780
5772
|
shouldBeHidden: (n) => n.isActive("columns"),
|
|
5781
5773
|
action: ({ editor: n, range: a }) => {
|
|
5782
|
-
n.chain().focus().deleteRange(a).run(),
|
|
5774
|
+
n.chain().focus().deleteRange(a).run(), Ve.setOpen(!0);
|
|
5783
5775
|
}
|
|
5784
5776
|
}), i.name.toLowerCase() === "video" && t[1].commands.push({
|
|
5785
5777
|
name: "video",
|
|
5786
|
-
label:
|
|
5778
|
+
label: F.t("editor.video.tooltip"),
|
|
5787
5779
|
iconName: "Video",
|
|
5788
5780
|
description: "Insert a video",
|
|
5789
5781
|
aliases: ["video", "sp", "shipin"],
|
|
@@ -5793,7 +5785,7 @@ function jl(e) {
|
|
|
5793
5785
|
}
|
|
5794
5786
|
}), i.name.toLowerCase() === "table" && t[1].commands.push({
|
|
5795
5787
|
name: "table",
|
|
5796
|
-
label:
|
|
5788
|
+
label: F.t("editor.table.tooltip"),
|
|
5797
5789
|
iconName: "Table",
|
|
5798
5790
|
description: "Insert a table",
|
|
5799
5791
|
aliases: ["table", "bg", "biaoge", "biao"],
|
|
@@ -5803,7 +5795,7 @@ function jl(e) {
|
|
|
5803
5795
|
}
|
|
5804
5796
|
}), i.name.toLowerCase() === "horizontalrule" && t[1].commands.push({
|
|
5805
5797
|
name: "horizontalRule",
|
|
5806
|
-
label:
|
|
5798
|
+
label: F.t("editor.horizontalrule.tooltip"),
|
|
5807
5799
|
iconName: "Minus",
|
|
5808
5800
|
description: "Insert a horizontal divider",
|
|
5809
5801
|
aliases: ["hr", "fgx", "fg"],
|
|
@@ -5812,7 +5804,7 @@ function jl(e) {
|
|
|
5812
5804
|
}
|
|
5813
5805
|
}), i.name.toLowerCase() === "columns" && t[1].commands.push({
|
|
5814
5806
|
name: "columns",
|
|
5815
|
-
label:
|
|
5807
|
+
label: F.t("editor.columns.tooltip"),
|
|
5816
5808
|
iconName: "Columns2",
|
|
5817
5809
|
description: "Add two column content",
|
|
5818
5810
|
action: ({ editor: n }) => {
|
|
@@ -5821,8 +5813,8 @@ function jl(e) {
|
|
|
5821
5813
|
});
|
|
5822
5814
|
}), t;
|
|
5823
5815
|
}
|
|
5824
|
-
function
|
|
5825
|
-
var C,
|
|
5816
|
+
function jl(e, t) {
|
|
5817
|
+
var C, A;
|
|
5826
5818
|
const [i, n] = w(0), [a, o] = w(0), c = J(null), { t: s } = B(), l = J([]);
|
|
5827
5819
|
St(t, () => ({
|
|
5828
5820
|
onKeyDown: d
|
|
@@ -5836,7 +5828,7 @@ function Fl(e, t) {
|
|
|
5836
5828
|
});
|
|
5837
5829
|
}, [i, a]);
|
|
5838
5830
|
function d({ event: v }) {
|
|
5839
|
-
return v.key === "ArrowUp" ? (h(), !0) : v.key === "ArrowDown" ? (
|
|
5831
|
+
return v.key === "ArrowUp" ? (h(), !0) : v.key === "ArrowDown" ? (f(), !0) : v.key === "Enter" ? (u(), !0) : !1;
|
|
5840
5832
|
}
|
|
5841
5833
|
function h() {
|
|
5842
5834
|
var k;
|
|
@@ -5845,14 +5837,14 @@ function Fl(e, t) {
|
|
|
5845
5837
|
let v = i - 1, _ = a;
|
|
5846
5838
|
v < 0 && (_ = a - 1, v = ((k = e.items[_]) == null ? void 0 : k.commands.length) - 1 || 0), _ < 0 && (_ = e.items.length - 1, v = e.items[_].commands.length - 1), n(v), o(_);
|
|
5847
5839
|
}
|
|
5848
|
-
function
|
|
5840
|
+
function f() {
|
|
5849
5841
|
if (e.items.length === 0)
|
|
5850
5842
|
return !1;
|
|
5851
5843
|
const v = e.items[a].commands;
|
|
5852
5844
|
let _ = i + 1, k = a;
|
|
5853
5845
|
v.length - 1 < _ && (_ = 0, k = a + 1), e.items.length - 1 < k && (k = 0), n(_), o(k);
|
|
5854
5846
|
}
|
|
5855
|
-
function
|
|
5847
|
+
function u() {
|
|
5856
5848
|
if (e.items.length === 0 || a === -1 || i === -1)
|
|
5857
5849
|
return !1;
|
|
5858
5850
|
g(a, i);
|
|
@@ -5872,19 +5864,19 @@ function Fl(e, t) {
|
|
|
5872
5864
|
{
|
|
5873
5865
|
className: "!richtext-bg-white richtext-rounded-lg dark:!richtext-bg-black richtext-shadow-sm !richtext-border !richtext-border-neutral-200 dark:!richtext-border-neutral-800 !richtext-text-black richtext-max-h-[min(80vh,24rem)] richtext-overflow-auto richtext-flex-wrap richtext-mb-8 richtext-p-1",
|
|
5874
5866
|
ref: c,
|
|
5875
|
-
children: (C = e == null ? void 0 : e.items) != null && C.length ? /* @__PURE__ */ r("div", { className: "richtext-grid richtext-grid-cols-1 richtext-gap-0.5 richtext-min-w-48", children: (
|
|
5867
|
+
children: (C = e == null ? void 0 : e.items) != null && C.length ? /* @__PURE__ */ r("div", { className: "richtext-grid richtext-grid-cols-1 richtext-gap-0.5 richtext-min-w-48", children: (A = e == null ? void 0 : e.items) == null ? void 0 : A.map((v, _) => /* @__PURE__ */ m(dt, { children: [
|
|
5876
5868
|
/* @__PURE__ */ r("div", { className: "!richtext-text-neutral-500 richtext-text-[0.65rem] richtext-col-[1/-1] richtext-mx-2 richtext-mt-2 richtext-font-semibold richtext-tracking-wider richtext-select-none richtext-uppercase first:richtext-mt-0.5", children: v.title }),
|
|
5877
5869
|
v.commands.map((k, N) => /* @__PURE__ */ m(
|
|
5878
5870
|
"button",
|
|
5879
5871
|
{
|
|
5880
|
-
className:
|
|
5872
|
+
className: D("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm !richtext-text-neutral-800 dark:!richtext-text-neutral-200 richtext-text-left richtext-w-full richtext-rounded-sm richtext-outline-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ", {
|
|
5881
5873
|
"slash-command-active": a === _ && i === N
|
|
5882
5874
|
}),
|
|
5883
5875
|
ref: (I) => b(_, N, I),
|
|
5884
5876
|
onClick: () => x(_, N),
|
|
5885
5877
|
children: [
|
|
5886
5878
|
k.iconUrl && /* @__PURE__ */ r("img", { className: "richtext-w-6 richtext-h-6", src: k.iconUrl, alt: "" }),
|
|
5887
|
-
k.iconName && /* @__PURE__ */ r(
|
|
5879
|
+
k.iconName && /* @__PURE__ */ r(j, { name: k.iconName, className: "!richtext-mr-1 !richtext-text-lg" }),
|
|
5888
5880
|
k.label
|
|
5889
5881
|
]
|
|
5890
5882
|
},
|
|
@@ -5894,13 +5886,13 @@ function Fl(e, t) {
|
|
|
5894
5886
|
}
|
|
5895
5887
|
);
|
|
5896
5888
|
}
|
|
5897
|
-
const
|
|
5898
|
-
let
|
|
5899
|
-
const
|
|
5889
|
+
const Fl = Lt(jl), Ae = "slashCommand";
|
|
5890
|
+
let q;
|
|
5891
|
+
const Lu = Y.create({
|
|
5900
5892
|
name: Ae,
|
|
5901
5893
|
priority: 200,
|
|
5902
5894
|
onCreate() {
|
|
5903
|
-
|
|
5895
|
+
q = fi("body", {
|
|
5904
5896
|
interactive: !0,
|
|
5905
5897
|
trigger: "manual",
|
|
5906
5898
|
placement: "bottom-start",
|
|
@@ -5927,8 +5919,8 @@ const Au = Y.create({
|
|
|
5927
5919
|
startOfLine: !0,
|
|
5928
5920
|
pluginKey: new _e(Ae),
|
|
5929
5921
|
allow: ({ state: e, range: t }) => {
|
|
5930
|
-
var d, h,
|
|
5931
|
-
const i = e.doc.resolve(t.from), n = i.depth === 1, a = i.parent.type.name === "paragraph", o = ((d = i.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", c = this.editor.isActive("column"), s = (
|
|
5922
|
+
var d, h, f;
|
|
5923
|
+
const i = e.doc.resolve(t.from), n = i.depth === 1, a = i.parent.type.name === "paragraph", o = ((d = i.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", c = this.editor.isActive("column"), s = (f = i.parent.textContent) == null ? void 0 : f.slice(
|
|
5932
5924
|
Math.max(0, (h = i.parent.textContent) == null ? void 0 : h.indexOf("/"))
|
|
5933
5925
|
), l = !(s != null && s.endsWith(" "));
|
|
5934
5926
|
return (n && a && o || c && a && o) && l;
|
|
@@ -5937,13 +5929,13 @@ const Au = Y.create({
|
|
|
5937
5929
|
const { view: n } = e;
|
|
5938
5930
|
i.action({ editor: e, range: t }), n.focus();
|
|
5939
5931
|
},
|
|
5940
|
-
items: ({ query: e, editor: t }) =>
|
|
5932
|
+
items: ({ query: e, editor: t }) => Vl(t.extensionManager.extensions).map((c) => ({
|
|
5941
5933
|
...c,
|
|
5942
5934
|
commands: c.commands.filter((s) => {
|
|
5943
5935
|
const l = s.label.toLowerCase().trim(), d = e.toLowerCase().trim();
|
|
5944
5936
|
if (s.aliases) {
|
|
5945
|
-
const h = s.aliases.map((g) => g.toLowerCase().trim()),
|
|
5946
|
-
return
|
|
5937
|
+
const h = s.aliases.map((g) => g.toLowerCase().trim()), f = l.match(d), u = h.some((g) => g.match(d));
|
|
5938
|
+
return f || u;
|
|
5947
5939
|
}
|
|
5948
5940
|
return l.match(d);
|
|
5949
5941
|
}).filter(
|
|
@@ -5961,7 +5953,7 @@ const Au = Y.create({
|
|
|
5961
5953
|
return {
|
|
5962
5954
|
onStart: (i) => {
|
|
5963
5955
|
var o;
|
|
5964
|
-
e = new ci(
|
|
5956
|
+
e = new ci(Fl, {
|
|
5965
5957
|
props: i,
|
|
5966
5958
|
editor: i.editor
|
|
5967
5959
|
});
|
|
@@ -5979,14 +5971,14 @@ const Au = Y.create({
|
|
|
5979
5971
|
return new DOMRect(c.x, s, c.width, c.height);
|
|
5980
5972
|
};
|
|
5981
5973
|
t = () => {
|
|
5982
|
-
|
|
5974
|
+
q == null || q[0].setProps({
|
|
5983
5975
|
getReferenceClientRect: a
|
|
5984
5976
|
});
|
|
5985
|
-
}, (o = n.dom.parentElement) == null || o.addEventListener("scroll", t),
|
|
5977
|
+
}, (o = n.dom.parentElement) == null || o.addEventListener("scroll", t), q == null || q[0].setProps({
|
|
5986
5978
|
getReferenceClientRect: a,
|
|
5987
5979
|
appendTo: () => document.body,
|
|
5988
5980
|
content: e.element
|
|
5989
|
-
}),
|
|
5981
|
+
}), q == null || q[0].show();
|
|
5990
5982
|
},
|
|
5991
5983
|
onUpdate(i) {
|
|
5992
5984
|
var c;
|
|
@@ -5997,7 +5989,7 @@ const Au = Y.create({
|
|
|
5997
5989
|
const s = i.clientRect();
|
|
5998
5990
|
return s ? new DOMRect(s.x, s.y, s.width, s.height) : i.editor.storage[Ae].rect;
|
|
5999
5991
|
}, o = () => {
|
|
6000
|
-
|
|
5992
|
+
q == null || q[0].setProps({
|
|
6001
5993
|
getReferenceClientRect: a
|
|
6002
5994
|
});
|
|
6003
5995
|
};
|
|
@@ -6008,17 +6000,17 @@ const Au = Y.create({
|
|
|
6008
6000
|
top: 0,
|
|
6009
6001
|
right: 0,
|
|
6010
6002
|
bottom: 0
|
|
6011
|
-
},
|
|
6003
|
+
}, q == null || q[0].setProps({
|
|
6012
6004
|
getReferenceClientRect: a
|
|
6013
6005
|
});
|
|
6014
6006
|
},
|
|
6015
6007
|
onKeyDown(i) {
|
|
6016
6008
|
var n;
|
|
6017
|
-
return i.event.key === "Escape" ? (
|
|
6009
|
+
return i.event.key === "Escape" ? (q == null || q[0].hide(), !0) : (q != null && q[0].state.isShown || q == null || q[0].show(), (n = e.ref) == null ? void 0 : n.onKeyDown(i));
|
|
6018
6010
|
},
|
|
6019
6011
|
onExit(i) {
|
|
6020
6012
|
var n;
|
|
6021
|
-
if (
|
|
6013
|
+
if (q == null || q[0].hide(), t) {
|
|
6022
6014
|
const { view: a } = i.editor;
|
|
6023
6015
|
(n = a.dom.parentElement) == null || n.removeEventListener("scroll", t);
|
|
6024
6016
|
}
|
|
@@ -6066,7 +6058,7 @@ function Ul(e) {
|
|
|
6066
6058
|
w: 0,
|
|
6067
6059
|
h: 0,
|
|
6068
6060
|
dir: ""
|
|
6069
|
-
}), { align: h, inline:
|
|
6061
|
+
}), { align: h, inline: f } = (O = e == null ? void 0 : e.node) == null ? void 0 : O.attrs, u = P(() => {
|
|
6070
6062
|
var xe;
|
|
6071
6063
|
const { src: L, alt: S, width: y, height: $, flipX: R, flipY: E } = (xe = e == null ? void 0 : e.node) == null ? void 0 : xe.attrs, z = Nt(y) ? `${y}px` : y, G = Nt($) ? `${$}px` : $, X = [];
|
|
6072
6064
|
R && X.push("rotateX(180deg)"), E && X.push("rotateY(180deg)");
|
|
@@ -6080,12 +6072,12 @@ function Ul(e) {
|
|
|
6080
6072
|
transform: Oe || "none"
|
|
6081
6073
|
}
|
|
6082
6074
|
};
|
|
6083
|
-
}, [(M = e == null ? void 0 : e.node) == null ? void 0 : M.attrs]), g =
|
|
6075
|
+
}, [(M = e == null ? void 0 : e.node) == null ? void 0 : M.attrs]), g = P(() => {
|
|
6084
6076
|
const {
|
|
6085
6077
|
style: { width: L }
|
|
6086
|
-
} =
|
|
6078
|
+
} = u;
|
|
6087
6079
|
return { width: L === "100%" ? L : void 0 };
|
|
6088
|
-
}, [
|
|
6080
|
+
}, [u]);
|
|
6089
6081
|
function x(L) {
|
|
6090
6082
|
a({
|
|
6091
6083
|
width: L.target.width,
|
|
@@ -6096,7 +6088,7 @@ function Ul(e) {
|
|
|
6096
6088
|
const { editor: L, getPos: S } = e;
|
|
6097
6089
|
L.commands.setNodeSelection(S());
|
|
6098
6090
|
}
|
|
6099
|
-
const C =
|
|
6091
|
+
const C = T(
|
|
6100
6092
|
Se(() => {
|
|
6101
6093
|
const { editor: L } = e, { width: S } = getComputedStyle(L.view.dom);
|
|
6102
6094
|
i((y) => ({
|
|
@@ -6106,7 +6098,7 @@ function Ul(e) {
|
|
|
6106
6098
|
}, Ke),
|
|
6107
6099
|
[e == null ? void 0 : e.editor]
|
|
6108
6100
|
);
|
|
6109
|
-
function
|
|
6101
|
+
function A(L, S) {
|
|
6110
6102
|
L.preventDefault(), L.stopPropagation();
|
|
6111
6103
|
const y = n.width, $ = n.height, R = y / $;
|
|
6112
6104
|
let E = Number(e.node.attrs.width), z = Number(e.node.attrs.height);
|
|
@@ -6121,7 +6113,7 @@ function Ul(e) {
|
|
|
6121
6113
|
});
|
|
6122
6114
|
});
|
|
6123
6115
|
}
|
|
6124
|
-
const v =
|
|
6116
|
+
const v = T(
|
|
6125
6117
|
Se((L) => {
|
|
6126
6118
|
if (L.preventDefault(), L.stopPropagation(), !c)
|
|
6127
6119
|
return;
|
|
@@ -6132,7 +6124,7 @@ function Ul(e) {
|
|
|
6132
6124
|
});
|
|
6133
6125
|
}, Ke),
|
|
6134
6126
|
[c, l, t, e.updateAttributes]
|
|
6135
|
-
), _ =
|
|
6127
|
+
), _ = T(
|
|
6136
6128
|
(L) => {
|
|
6137
6129
|
L.preventDefault(), L.stopPropagation(), c && (Xe(() => {
|
|
6138
6130
|
d({
|
|
@@ -6145,23 +6137,23 @@ function Ul(e) {
|
|
|
6145
6137
|
}), b());
|
|
6146
6138
|
},
|
|
6147
6139
|
[c, b]
|
|
6148
|
-
), k =
|
|
6140
|
+
), k = T(() => {
|
|
6149
6141
|
document == null || document.addEventListener("mousemove", v, !0), document == null || document.addEventListener("mouseup", _, !0);
|
|
6150
|
-
}, [v, _]), N =
|
|
6142
|
+
}, [v, _]), N = T(() => {
|
|
6151
6143
|
document == null || document.removeEventListener("mousemove", v, !0), document == null || document.removeEventListener("mouseup", _, !0);
|
|
6152
6144
|
}, [v, _]);
|
|
6153
6145
|
H(() => (c ? k() : N(), () => {
|
|
6154
6146
|
N();
|
|
6155
6147
|
}), [c, k, N]);
|
|
6156
|
-
const I =
|
|
6148
|
+
const I = P(() => new ResizeObserver(() => C()), [C]);
|
|
6157
6149
|
return H(() => (I.observe(e.editor.view.dom), () => {
|
|
6158
6150
|
I.disconnect();
|
|
6159
6151
|
}), [e.editor.view.dom, I]), /* @__PURE__ */ r(
|
|
6160
6152
|
ae,
|
|
6161
6153
|
{
|
|
6162
6154
|
className: "image-view",
|
|
6163
|
-
style: { ...g, textAlign: h, display:
|
|
6164
|
-
as:
|
|
6155
|
+
style: { ...g, textAlign: h, display: f ? "inline" : "block" },
|
|
6156
|
+
as: f ? "span" : "div",
|
|
6165
6157
|
children: /* @__PURE__ */ m(
|
|
6166
6158
|
"div",
|
|
6167
6159
|
{
|
|
@@ -6173,9 +6165,9 @@ function Ul(e) {
|
|
|
6173
6165
|
/* @__PURE__ */ r(
|
|
6174
6166
|
"img",
|
|
6175
6167
|
{
|
|
6176
|
-
src:
|
|
6177
|
-
alt:
|
|
6178
|
-
style:
|
|
6168
|
+
src: u.src,
|
|
6169
|
+
alt: u.alt,
|
|
6170
|
+
style: u.style,
|
|
6179
6171
|
height: "auto",
|
|
6180
6172
|
className: "image-view__body__image block",
|
|
6181
6173
|
onLoad: x,
|
|
@@ -6186,7 +6178,7 @@ function Ul(e) {
|
|
|
6186
6178
|
"span",
|
|
6187
6179
|
{
|
|
6188
6180
|
className: `image-resizer__handler image-resizer__handler--${L}`,
|
|
6189
|
-
onMouseDown: (S) =>
|
|
6181
|
+
onMouseDown: (S) => A(S, L)
|
|
6190
6182
|
},
|
|
6191
6183
|
`image-dir-${L}`
|
|
6192
6184
|
)) })
|
|
@@ -6197,7 +6189,7 @@ function Ul(e) {
|
|
|
6197
6189
|
);
|
|
6198
6190
|
}
|
|
6199
6191
|
function Wl({ editor: e, imageInline: t, onClose: i }) {
|
|
6200
|
-
const { t: n } = B(), [a, o] = w(!1), c =
|
|
6192
|
+
const { t: n } = B(), [a, o] = w(!1), c = Fe.useRef(null), [s, l] = Fe.useState(), [d, h] = Fe.useState(""), f = J(null), [u, g] = w({
|
|
6201
6193
|
src: "",
|
|
6202
6194
|
file: null
|
|
6203
6195
|
});
|
|
@@ -6226,7 +6218,7 @@ function Wl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6226
6218
|
async function C() {
|
|
6227
6219
|
var _, k;
|
|
6228
6220
|
try {
|
|
6229
|
-
const N = await vi(d, ((_ =
|
|
6221
|
+
const N = await vi(d, ((_ = u == null ? void 0 : u.file) == null ? void 0 : _.name) || "image.png"), I = (k = e.extensionManager.extensions.find(
|
|
6230
6222
|
(M) => M.name === "image"
|
|
6231
6223
|
)) == null ? void 0 : k.options;
|
|
6232
6224
|
let O = "";
|
|
@@ -6238,9 +6230,9 @@ function Wl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6238
6230
|
console.log("Error cropping image", N);
|
|
6239
6231
|
}
|
|
6240
6232
|
}
|
|
6241
|
-
function
|
|
6233
|
+
function A(_) {
|
|
6242
6234
|
var k;
|
|
6243
|
-
_.preventDefault(), (k =
|
|
6235
|
+
_.preventDefault(), (k = f.current) == null || k.click();
|
|
6244
6236
|
}
|
|
6245
6237
|
const v = async (_) => {
|
|
6246
6238
|
var O;
|
|
@@ -6253,13 +6245,13 @@ function Wl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6253
6245
|
file: N
|
|
6254
6246
|
});
|
|
6255
6247
|
};
|
|
6256
|
-
return /* @__PURE__ */ m(
|
|
6257
|
-
/* @__PURE__ */ r(U, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick:
|
|
6248
|
+
return /* @__PURE__ */ m(W, { children: [
|
|
6249
|
+
/* @__PURE__ */ r(U, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: A, children: n("editor.image.dialog.tab.uploadCrop") }),
|
|
6258
6250
|
/* @__PURE__ */ m(He, { open: a, children: [
|
|
6259
6251
|
/* @__PURE__ */ r(Re, {}),
|
|
6260
6252
|
/* @__PURE__ */ m(ke, { children: [
|
|
6261
6253
|
/* @__PURE__ */ r(Ce, { children: n("editor.image.dialog.tab.uploadCrop") }),
|
|
6262
|
-
/* @__PURE__ */ r("div", { children:
|
|
6254
|
+
/* @__PURE__ */ r("div", { children: u.src && /* @__PURE__ */ r(
|
|
6263
6255
|
Mo,
|
|
6264
6256
|
{
|
|
6265
6257
|
crop: s,
|
|
@@ -6271,7 +6263,7 @@ function Wl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6271
6263
|
{
|
|
6272
6264
|
ref: c,
|
|
6273
6265
|
alt: "Crop me",
|
|
6274
|
-
src:
|
|
6266
|
+
src: u.src
|
|
6275
6267
|
}
|
|
6276
6268
|
)
|
|
6277
6269
|
}
|
|
@@ -6288,13 +6280,13 @@ function Wl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6288
6280
|
},
|
|
6289
6281
|
children: [
|
|
6290
6282
|
n("editor.imageUpload.cancel"),
|
|
6291
|
-
/* @__PURE__ */ r(
|
|
6283
|
+
/* @__PURE__ */ r(j, { name: "Trash2", className: "richtext-ml-[4px]" })
|
|
6292
6284
|
]
|
|
6293
6285
|
}
|
|
6294
6286
|
),
|
|
6295
6287
|
/* @__PURE__ */ m(U, { className: "richtext-w-fit", onClick: C, children: [
|
|
6296
6288
|
n("editor.imageUpload.crop"),
|
|
6297
|
-
/* @__PURE__ */ r(
|
|
6289
|
+
/* @__PURE__ */ r(j, { name: "Crop", className: "richtext-ml-[4px]" })
|
|
6298
6290
|
] })
|
|
6299
6291
|
] })
|
|
6300
6292
|
] })
|
|
@@ -6304,7 +6296,7 @@ function Wl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6304
6296
|
{
|
|
6305
6297
|
type: "file",
|
|
6306
6298
|
accept: "image/*",
|
|
6307
|
-
ref:
|
|
6299
|
+
ref: f,
|
|
6308
6300
|
multiple: !0,
|
|
6309
6301
|
style: {
|
|
6310
6302
|
display: "none"
|
|
@@ -6315,101 +6307,104 @@ function Wl({ editor: e, imageInline: t, onClose: i }) {
|
|
|
6315
6307
|
] });
|
|
6316
6308
|
}
|
|
6317
6309
|
function ql(e) {
|
|
6318
|
-
const { t } = B(), i = Bl(), [n, a] = w(""), o = J(null), [c, s] = w(!1)
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6310
|
+
const { t } = B(), i = Bl(), [n, a] = w(""), o = J(null), [c, s] = w(!1), l = P(() => {
|
|
6311
|
+
var g;
|
|
6312
|
+
return (g = e.editor.extensionManager.extensions.find(
|
|
6313
|
+
(x) => x.name === ed.name
|
|
6314
|
+
)) == null ? void 0 : g.options;
|
|
6315
|
+
}, [e.editor]);
|
|
6316
|
+
async function d(u) {
|
|
6317
|
+
var C;
|
|
6318
|
+
const g = (C = u == null ? void 0 : u.target) == null ? void 0 : C.files;
|
|
6319
|
+
if (!e.editor || e.editor.isDestroyed || g.length === 0)
|
|
6323
6320
|
return;
|
|
6324
|
-
const
|
|
6325
|
-
(v) => v.name === "image"
|
|
6326
|
-
)) == null ? void 0 : T.options;
|
|
6321
|
+
const x = g[0];
|
|
6327
6322
|
let b = "";
|
|
6328
|
-
|
|
6329
|
-
}
|
|
6330
|
-
function d(u) {
|
|
6331
|
-
u.preventDefault(), u.stopPropagation(), e.editor.chain().focus().setImageInline({ src: n, inline: c }).run(), je.setOpen(!1), s(!1);
|
|
6323
|
+
l.upload ? b = await l.upload(x) : b = URL.createObjectURL(x), e.editor.chain().focus().setImageInline({ src: b, inline: c }).run(), Ve.setOpen(!1), s(!1);
|
|
6332
6324
|
}
|
|
6333
6325
|
function h(u) {
|
|
6334
|
-
|
|
6335
|
-
u.preventDefault(), (f = o.current) == null || f.click();
|
|
6326
|
+
u.preventDefault(), u.stopPropagation(), e.editor.chain().focus().setImageInline({ src: n, inline: c }).run(), Ve.setOpen(!1), s(!1);
|
|
6336
6327
|
}
|
|
6337
|
-
|
|
6328
|
+
function f(u) {
|
|
6329
|
+
var g;
|
|
6330
|
+
u.preventDefault(), (g = o.current) == null || g.click();
|
|
6331
|
+
}
|
|
6332
|
+
return /* @__PURE__ */ m(He, { open: i, onOpenChange: Ve.setOpen, children: [
|
|
6338
6333
|
/* @__PURE__ */ r(Re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
6339
6334
|
p,
|
|
6340
6335
|
{
|
|
6341
6336
|
icon: e.icon,
|
|
6342
|
-
action: () =>
|
|
6337
|
+
action: () => Ve.setOpen(!0),
|
|
6343
6338
|
tooltip: e.tooltip
|
|
6344
6339
|
}
|
|
6345
6340
|
) }),
|
|
6346
6341
|
/* @__PURE__ */ m(ke, { children: [
|
|
6347
6342
|
/* @__PURE__ */ r(Ce, { children: t("editor.image.dialog.title") }),
|
|
6348
|
-
/* @__PURE__ */ m(
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
}
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
}
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6343
|
+
/* @__PURE__ */ m(
|
|
6344
|
+
wi,
|
|
6345
|
+
{
|
|
6346
|
+
defaultValue: l.resourceImage === "both" || l.resourceImage === "upload" ? "upload" : "link",
|
|
6347
|
+
activationMode: "manual",
|
|
6348
|
+
children: [
|
|
6349
|
+
/* @__PURE__ */ m(Pt, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
|
|
6350
|
+
l.resourceImage === "both" || l.resourceImage === "upload" ? /* @__PURE__ */ r(Ze, { value: "upload", children: t("editor.image.dialog.tab.upload") }) : /* @__PURE__ */ r(W, {}),
|
|
6351
|
+
l.resourceImage === "both" || l.resourceImage === "link" ? /* @__PURE__ */ r(Ze, { value: "link", children: t("editor.image.dialog.tab.url") }) : /* @__PURE__ */ r(W, {})
|
|
6352
|
+
] }),
|
|
6353
|
+
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px] richtext-my-[10px]", children: [
|
|
6354
|
+
/* @__PURE__ */ r(
|
|
6355
|
+
An,
|
|
6356
|
+
{
|
|
6357
|
+
checked: c,
|
|
6358
|
+
onCheckedChange: (u) => {
|
|
6359
|
+
s(u);
|
|
6360
|
+
}
|
|
6361
|
+
}
|
|
6362
|
+
),
|
|
6363
|
+
/* @__PURE__ */ r(ie, { children: t("editor.link.dialog.inline") })
|
|
6364
|
+
] }),
|
|
6365
|
+
/* @__PURE__ */ m(Ye, { value: "upload", children: [
|
|
6366
|
+
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
6367
|
+
/* @__PURE__ */ r(U, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: f, children: t("editor.image.dialog.tab.upload") }),
|
|
6368
|
+
/* @__PURE__ */ r(
|
|
6369
|
+
Wl,
|
|
6370
|
+
{
|
|
6371
|
+
editor: e.editor,
|
|
6372
|
+
imageInline: c,
|
|
6373
|
+
onClose: () => Ve.setOpen(!1)
|
|
6374
|
+
}
|
|
6375
|
+
)
|
|
6376
|
+
] }),
|
|
6377
|
+
/* @__PURE__ */ r(
|
|
6378
|
+
"input",
|
|
6379
|
+
{
|
|
6380
|
+
type: "file",
|
|
6381
|
+
accept: "image/*",
|
|
6382
|
+
ref: o,
|
|
6383
|
+
multiple: !0,
|
|
6384
|
+
style: {
|
|
6385
|
+
display: "none"
|
|
6386
|
+
},
|
|
6387
|
+
onChange: d
|
|
6388
|
+
}
|
|
6389
|
+
)
|
|
6390
|
+
] }),
|
|
6391
|
+
/* @__PURE__ */ r(Ye, { value: "link", children: /* @__PURE__ */ r("form", { onSubmit: h, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
6392
|
+
/* @__PURE__ */ r(
|
|
6393
|
+
te,
|
|
6394
|
+
{
|
|
6395
|
+
type: "url",
|
|
6396
|
+
autoFocus: !0,
|
|
6397
|
+
value: n,
|
|
6398
|
+
onChange: (u) => a(u.target.value),
|
|
6399
|
+
required: !0,
|
|
6400
|
+
placeholder: t("editor.image.dialog.placeholder")
|
|
6401
|
+
}
|
|
6402
|
+
),
|
|
6403
|
+
/* @__PURE__ */ r(U, { type: "submit", children: t("editor.image.dialog.button.apply") })
|
|
6404
|
+
] }) }) })
|
|
6405
|
+
]
|
|
6406
|
+
}
|
|
6407
|
+
)
|
|
6413
6408
|
] })
|
|
6414
6409
|
] });
|
|
6415
6410
|
}
|
|
@@ -6465,18 +6460,18 @@ function Zl({ validateFn: e, onUpload: t, postUpload: i }) {
|
|
|
6465
6460
|
add: [{ id: s, pos: o, src: d }]
|
|
6466
6461
|
}), a.dispatch(l), t(c).then(
|
|
6467
6462
|
async (h) => {
|
|
6468
|
-
var
|
|
6463
|
+
var A;
|
|
6469
6464
|
i && typeof h == "string" && (h = await i(h));
|
|
6470
|
-
const { schema:
|
|
6471
|
-
let
|
|
6472
|
-
if (
|
|
6465
|
+
const { schema: f } = a.state;
|
|
6466
|
+
let u = Xl(a.state, s);
|
|
6467
|
+
if (u === null)
|
|
6473
6468
|
return;
|
|
6474
|
-
const g = typeof h == "object" ? d : h, x = (
|
|
6469
|
+
const g = typeof h == "object" ? d : h, x = (A = f.nodes.image) == null ? void 0 : A.create({ src: g });
|
|
6475
6470
|
if (!x)
|
|
6476
6471
|
return;
|
|
6477
6472
|
const { doc: b } = a.state;
|
|
6478
|
-
|
|
6479
|
-
const C = a.state.tr.replaceWith(
|
|
6473
|
+
u > b.content.size && (u = b.content.size - 1);
|
|
6474
|
+
const C = a.state.tr.replaceWith(u, u, x).setMeta(We, { remove: [s] });
|
|
6480
6475
|
a.dispatch(C);
|
|
6481
6476
|
},
|
|
6482
6477
|
() => {
|
|
@@ -6513,9 +6508,10 @@ function Jl(e, t, i, n) {
|
|
|
6513
6508
|
}
|
|
6514
6509
|
const Ql = {
|
|
6515
6510
|
acceptMimes: ["image/jpeg", "image/gif", "image/png", "image/jpg"],
|
|
6516
|
-
maxSize: 1024 * 1024 * 5
|
|
6511
|
+
maxSize: 1024 * 1024 * 5,
|
|
6517
6512
|
// 5MB
|
|
6518
|
-
|
|
6513
|
+
resourceImage: "both"
|
|
6514
|
+
}, ed = si.extend({
|
|
6519
6515
|
group: "inline",
|
|
6520
6516
|
inline: !0,
|
|
6521
6517
|
defining: !0,
|
|
@@ -6675,36 +6671,39 @@ const Ql = {
|
|
|
6675
6671
|
];
|
|
6676
6672
|
}
|
|
6677
6673
|
});
|
|
6678
|
-
function
|
|
6674
|
+
function td(e) {
|
|
6679
6675
|
return /\.(?:mp4|webm|ogg|mov)$/i.test(e);
|
|
6680
6676
|
}
|
|
6681
|
-
function
|
|
6682
|
-
const { t } = B(), [i, n] = w(""), a = J(null), o = $l(), [c, s] = w("")
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6677
|
+
function id(e) {
|
|
6678
|
+
const { t } = B(), [i, n] = w(""), a = J(null), o = $l(), [c, s] = w(""), l = P(() => {
|
|
6679
|
+
var g;
|
|
6680
|
+
return (g = e.editor.extensionManager.extensions.find(
|
|
6681
|
+
(x) => x.name === rd.name
|
|
6682
|
+
)) == null ? void 0 : g.options;
|
|
6683
|
+
}, [e.editor]);
|
|
6684
|
+
async function d(u) {
|
|
6685
|
+
var C;
|
|
6686
|
+
const g = (C = u == null ? void 0 : u.target) == null ? void 0 : C.files;
|
|
6687
|
+
if (!e.editor || e.editor.isDestroyed || g.length === 0)
|
|
6687
6688
|
return;
|
|
6688
|
-
const
|
|
6689
|
-
(v) => v.name === nd.name
|
|
6690
|
-
)) == null ? void 0 : T.options;
|
|
6689
|
+
const x = g[0];
|
|
6691
6690
|
let b = "";
|
|
6692
|
-
|
|
6691
|
+
l.upload ? b = await l.upload(x) : b = URL.createObjectURL(x), e.editor.chain().setVideo({
|
|
6693
6692
|
src: b,
|
|
6694
6693
|
width: "100%"
|
|
6695
6694
|
}).focus().run(), ot.setOpen(!1);
|
|
6696
6695
|
}
|
|
6697
|
-
function
|
|
6696
|
+
function h(u) {
|
|
6698
6697
|
u.preventDefault(), u.stopPropagation(), i && (e.editor.chain().setVideo({
|
|
6699
6698
|
src: i,
|
|
6700
6699
|
width: "100%"
|
|
6701
6700
|
}).focus().run(), ot.setOpen(!1));
|
|
6702
6701
|
}
|
|
6703
|
-
function
|
|
6704
|
-
var
|
|
6705
|
-
u.preventDefault(), (
|
|
6702
|
+
function f(u) {
|
|
6703
|
+
var g;
|
|
6704
|
+
u.preventDefault(), (g = a.current) == null || g.click();
|
|
6706
6705
|
}
|
|
6707
|
-
return /* @__PURE__ */ m(He, { open: o
|
|
6706
|
+
return /* @__PURE__ */ m(He, { open: o, onOpenChange: ot.setOpen, children: [
|
|
6708
6707
|
/* @__PURE__ */ r(Re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
6709
6708
|
p,
|
|
6710
6709
|
{
|
|
@@ -6715,66 +6714,66 @@ function td(e) {
|
|
|
6715
6714
|
) }),
|
|
6716
6715
|
/* @__PURE__ */ m(ke, { children: [
|
|
6717
6716
|
/* @__PURE__ */ r(Ce, { children: t("editor.video.dialog.title") }),
|
|
6718
|
-
/* @__PURE__ */ m(
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
}
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6717
|
+
/* @__PURE__ */ m(
|
|
6718
|
+
wi,
|
|
6719
|
+
{
|
|
6720
|
+
defaultValue: (l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload" ? "upload" : "link",
|
|
6721
|
+
activationMode: "manual",
|
|
6722
|
+
children: [
|
|
6723
|
+
/* @__PURE__ */ m(Pt, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
|
|
6724
|
+
((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload") && /* @__PURE__ */ r(Ze, { value: "upload", children: t("editor.video.dialog.tab.upload") }),
|
|
6725
|
+
((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "link") && /* @__PURE__ */ r(Ze, { value: "link", children: t("editor.video.dialog.link") })
|
|
6726
|
+
] }),
|
|
6727
|
+
/* @__PURE__ */ m(Ye, { value: "upload", children: [
|
|
6728
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ r(U, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: f, children: t("editor.video.dialog.tab.upload") }) }),
|
|
6729
|
+
/* @__PURE__ */ r(
|
|
6730
|
+
"input",
|
|
6731
|
+
{
|
|
6732
|
+
type: "file",
|
|
6733
|
+
accept: "video/*",
|
|
6734
|
+
ref: a,
|
|
6735
|
+
multiple: !0,
|
|
6736
|
+
style: {
|
|
6737
|
+
display: "none"
|
|
6738
|
+
},
|
|
6739
|
+
onChange: d
|
|
6740
|
+
}
|
|
6741
|
+
)
|
|
6742
|
+
] }),
|
|
6743
|
+
/* @__PURE__ */ m(Ye, { value: "link", children: [
|
|
6744
|
+
/* @__PURE__ */ r("form", { onSubmit: h, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
6745
|
+
/* @__PURE__ */ r(
|
|
6746
|
+
te,
|
|
6747
|
+
{
|
|
6748
|
+
type: "url",
|
|
6749
|
+
autoFocus: !0,
|
|
6750
|
+
value: i,
|
|
6751
|
+
onChange: (u) => {
|
|
6752
|
+
const g = u.target.value;
|
|
6753
|
+
if (!td(g)) {
|
|
6754
|
+
s("Invalid video URL"), n("");
|
|
6755
|
+
return;
|
|
6756
|
+
}
|
|
6757
|
+
s(""), n(g);
|
|
6758
|
+
},
|
|
6759
|
+
required: !0,
|
|
6760
|
+
placeholder: t("editor.video.dialog.placeholder")
|
|
6759
6761
|
}
|
|
6760
|
-
|
|
6761
|
-
}
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
c && /* @__PURE__ */ r("div", { className: "richtext-text-red-500 richtext-my-[5px]", children: c })
|
|
6769
|
-
] })
|
|
6770
|
-
] })
|
|
6762
|
+
),
|
|
6763
|
+
/* @__PURE__ */ r(U, { type: "submit", children: t("editor.video.dialog.button.apply") })
|
|
6764
|
+
] }) }),
|
|
6765
|
+
c && /* @__PURE__ */ r("div", { className: "richtext-text-red-500 richtext-my-[5px]", children: c })
|
|
6766
|
+
] })
|
|
6767
|
+
]
|
|
6768
|
+
}
|
|
6769
|
+
)
|
|
6771
6770
|
] })
|
|
6772
6771
|
] });
|
|
6773
6772
|
}
|
|
6774
|
-
function
|
|
6773
|
+
function nd(e) {
|
|
6775
6774
|
return e = e.replace("https://youtu.be/", "https://www.youtube.com/watch?v=").replace("watch?v=", "embed/"), e = e.replace("https://vimeo.com/", "https://player.vimeo.com/video/"), /^https?:\/\/www.bilibili.com\/video\/.*/i.test(e) && (e = e.replace(/\?.*$/, "").replace("https://www.bilibili.com/video/", "https://player.bilibili.com/player.html?bvid=")), e.includes("drive.google.com") && (e = e.replace("/view", "/preview")), e;
|
|
6776
6775
|
}
|
|
6777
|
-
const
|
|
6776
|
+
const rd = ue.create({
|
|
6778
6777
|
name: "video",
|
|
6779
6778
|
group: "block",
|
|
6780
6779
|
atom: !0,
|
|
@@ -6786,6 +6785,7 @@ const nd = ue.create({
|
|
|
6786
6785
|
allowFullscreen: !0,
|
|
6787
6786
|
upload: void 0,
|
|
6788
6787
|
frameborder: !1,
|
|
6788
|
+
resourceVideo: "both",
|
|
6789
6789
|
width: Gt["size-medium"],
|
|
6790
6790
|
HTMLAttributes: {
|
|
6791
6791
|
class: "iframe-wrapper",
|
|
@@ -6794,7 +6794,7 @@ const nd = ue.create({
|
|
|
6794
6794
|
button: ({ editor: e, t }) => {
|
|
6795
6795
|
var i, n;
|
|
6796
6796
|
return {
|
|
6797
|
-
component:
|
|
6797
|
+
component: id,
|
|
6798
6798
|
componentProps: {
|
|
6799
6799
|
action: () => {
|
|
6800
6800
|
},
|
|
@@ -6814,7 +6814,7 @@ const nd = ue.create({
|
|
|
6814
6814
|
src: {
|
|
6815
6815
|
default: null,
|
|
6816
6816
|
renderHTML: ({ src: e }) => ({
|
|
6817
|
-
src: e ?
|
|
6817
|
+
src: e ? nd(e) : null
|
|
6818
6818
|
})
|
|
6819
6819
|
},
|
|
6820
6820
|
width: {
|
|
@@ -6861,7 +6861,7 @@ const nd = ue.create({
|
|
|
6861
6861
|
};
|
|
6862
6862
|
}
|
|
6863
6863
|
});
|
|
6864
|
-
function
|
|
6864
|
+
function ad(e, t, i) {
|
|
6865
6865
|
if (!e.doc)
|
|
6866
6866
|
return e;
|
|
6867
6867
|
const n = e.doc.nodeAt(t);
|
|
@@ -6873,19 +6873,19 @@ function rd(e, t, i) {
|
|
|
6873
6873
|
};
|
|
6874
6874
|
return e.setNodeMarkup(t, n.type, a, n.marks);
|
|
6875
6875
|
}
|
|
6876
|
-
function
|
|
6876
|
+
function od(e, t, i) {
|
|
6877
6877
|
const { doc: n, selection: a } = e;
|
|
6878
6878
|
return !n || !a || !(a instanceof wo) || a.forEachCell((o, c) => {
|
|
6879
|
-
e =
|
|
6879
|
+
e = ad(e, c, i);
|
|
6880
6880
|
}), e;
|
|
6881
6881
|
}
|
|
6882
6882
|
function Gi(e, t) {
|
|
6883
6883
|
return ({ tr: i, state: n, dispatch: a }) => {
|
|
6884
6884
|
const { selection: o } = n;
|
|
6885
|
-
return i = i.setSelection(o), i =
|
|
6885
|
+
return i = i.setSelection(o), i = od(i, t, e), i.docChanged ? (a == null || a(i), !0) : !1;
|
|
6886
6886
|
};
|
|
6887
6887
|
}
|
|
6888
|
-
const
|
|
6888
|
+
const cd = Y.create({
|
|
6889
6889
|
name: "tableCellBackground",
|
|
6890
6890
|
addOptions() {
|
|
6891
6891
|
return {
|
|
@@ -6914,13 +6914,13 @@ const od = Y.create({
|
|
|
6914
6914
|
unsetTableCellBackground: () => Gi("", this.options)
|
|
6915
6915
|
};
|
|
6916
6916
|
}
|
|
6917
|
-
}),
|
|
6917
|
+
}), sd = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, ld = /CrOS/, dd = /android|ipad|playbook|silk/i;
|
|
6918
6918
|
function Ki(e = {}) {
|
|
6919
6919
|
let t = e.ua || typeof navigator < "u" && navigator.userAgent;
|
|
6920
|
-
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(
|
|
6920
|
+
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(sd.test(t) && !ld.test(t) || e.tablet && dd.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
|
|
6921
6921
|
}
|
|
6922
6922
|
const Xi = (e) => Array.from({ length: e }).map((t, i) => i + 1);
|
|
6923
|
-
function
|
|
6923
|
+
function hd(e) {
|
|
6924
6924
|
var h;
|
|
6925
6925
|
const [t, i] = w(!0), [n, a] = w({
|
|
6926
6926
|
rows: Ki() ? xt : bt,
|
|
@@ -6929,20 +6929,20 @@ function dd(e) {
|
|
|
6929
6929
|
rows: pt,
|
|
6930
6930
|
cols: pt
|
|
6931
6931
|
});
|
|
6932
|
-
function s(
|
|
6933
|
-
|
|
6932
|
+
function s(f, u) {
|
|
6933
|
+
f === n.rows && a((g) => ({
|
|
6934
6934
|
...g,
|
|
6935
|
-
rows: Math.min(
|
|
6936
|
-
})),
|
|
6935
|
+
rows: Math.min(f + 1, xt)
|
|
6936
|
+
})), u === n.cols && a((g) => ({
|
|
6937
6937
|
...g,
|
|
6938
|
-
cols: Math.min(
|
|
6938
|
+
cols: Math.min(u + 1, xt)
|
|
6939
6939
|
})), c({
|
|
6940
|
-
rows:
|
|
6941
|
-
cols:
|
|
6940
|
+
rows: f,
|
|
6941
|
+
cols: u
|
|
6942
6942
|
});
|
|
6943
6943
|
}
|
|
6944
|
-
function l(
|
|
6945
|
-
e == null || e.createTable({ rows:
|
|
6944
|
+
function l(f, u) {
|
|
6945
|
+
e == null || e.createTable({ rows: f, cols: u, withHeaderRow: t }), d();
|
|
6946
6946
|
}
|
|
6947
6947
|
function d() {
|
|
6948
6948
|
i(!1), a({
|
|
@@ -6956,18 +6956,18 @@ function dd(e) {
|
|
|
6956
6956
|
return /* @__PURE__ */ m(se, { modal: !0, children: [
|
|
6957
6957
|
/* @__PURE__ */ r(le, { asChild: !0, children: e == null ? void 0 : e.children }),
|
|
6958
6958
|
/* @__PURE__ */ r(re, { className: "richtext-w-full !richtext-p-2", align: "start", side: "bottom", children: /* @__PURE__ */ m("div", { className: "richtext-p-0 table-grid-size-editor", children: [
|
|
6959
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (h = Xi(n == null ? void 0 : n.rows)) == null ? void 0 : h.map((
|
|
6960
|
-
var
|
|
6961
|
-
return /* @__PURE__ */ r("div", { className: "richtext-flex richtext-gap-1", children: (
|
|
6959
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (h = Xi(n == null ? void 0 : n.rows)) == null ? void 0 : h.map((f) => {
|
|
6960
|
+
var u;
|
|
6961
|
+
return /* @__PURE__ */ r("div", { className: "richtext-flex richtext-gap-1", children: (u = Xi(n == null ? void 0 : n.cols)) == null ? void 0 : u.map((g) => /* @__PURE__ */ r(
|
|
6962
6962
|
"div",
|
|
6963
6963
|
{
|
|
6964
|
-
className: `richtext-cursor-pointer richtext-border-border ${g <= o.cols &&
|
|
6965
|
-
onMouseOver: () => s(
|
|
6966
|
-
onMouseDown: () => l(
|
|
6964
|
+
className: `richtext-cursor-pointer richtext-border-border ${g <= o.cols && f <= o.rows && "!richtext-bg-foreground tableCellActive"}`,
|
|
6965
|
+
onMouseOver: () => s(f, g),
|
|
6966
|
+
onMouseDown: () => l(f, g),
|
|
6967
6967
|
children: /* @__PURE__ */ r("div", { className: "richtext-w-4 richtext-h-4 richtext-p-1 !richtext-border richtext-rounded-[2px] richtext-box-border richtext-border-solid !richtext-border-border" })
|
|
6968
6968
|
},
|
|
6969
6969
|
`c-${g}`
|
|
6970
|
-
)) }, `r-${
|
|
6970
|
+
)) }, `r-${f}`);
|
|
6971
6971
|
}) }),
|
|
6972
6972
|
/* @__PURE__ */ m("div", { className: "richtext-mt-2 richtext-text-sm richtext-text-center richtext-text-zinc-600", children: [
|
|
6973
6973
|
o.rows,
|
|
@@ -6978,11 +6978,11 @@ function dd(e) {
|
|
|
6978
6978
|
] }) })
|
|
6979
6979
|
] });
|
|
6980
6980
|
}
|
|
6981
|
-
function
|
|
6981
|
+
function ud(e) {
|
|
6982
6982
|
function t(i) {
|
|
6983
6983
|
e.disabled || e.editor.chain().focus().insertTable({ ...i, withHeaderRow: !1 }).run();
|
|
6984
6984
|
}
|
|
6985
|
-
return /* @__PURE__ */ r(
|
|
6985
|
+
return /* @__PURE__ */ r(hd, { createTable: t, children: /* @__PURE__ */ r(
|
|
6986
6986
|
p,
|
|
6987
6987
|
{
|
|
6988
6988
|
icon: e == null ? void 0 : e.icon,
|
|
@@ -7003,7 +7003,7 @@ const Su = so.extend({
|
|
|
7003
7003
|
lastColumnResizable: !0,
|
|
7004
7004
|
allowTableNodeSelection: !1,
|
|
7005
7005
|
button: ({ editor: t, t: i }) => ({
|
|
7006
|
-
component:
|
|
7006
|
+
component: ud,
|
|
7007
7007
|
componentProps: {
|
|
7008
7008
|
disabled: t.isActive("table") || !1,
|
|
7009
7009
|
icon: "Table",
|
|
@@ -7018,7 +7018,7 @@ const Su = so.extend({
|
|
|
7018
7018
|
lo.configure(this.options.tableRow),
|
|
7019
7019
|
ho.configure(this.options.tableHeader),
|
|
7020
7020
|
uo.configure(this.options.tableCell),
|
|
7021
|
-
|
|
7021
|
+
cd.configure(this.options.tableCellBackground)
|
|
7022
7022
|
];
|
|
7023
7023
|
}
|
|
7024
7024
|
}), Mu = Y.create({
|
|
@@ -7090,34 +7090,34 @@ const Su = so.extend({
|
|
|
7090
7090
|
];
|
|
7091
7091
|
}
|
|
7092
7092
|
});
|
|
7093
|
-
function
|
|
7094
|
-
const { t: i } = B(), [n, a] = w(-1), [o, c] = w([]), [s, l] = w(""), [d, h] = w(""), [
|
|
7093
|
+
function md({ editor: e, ...t }) {
|
|
7094
|
+
const { t: i } = B(), [n, a] = w(-1), [o, c] = w([]), [s, l] = w(""), [d, h] = w(""), [f, u] = w(!1), [g, x] = w(!1);
|
|
7095
7095
|
return H(() => {
|
|
7096
|
-
|
|
7097
|
-
}, [e,
|
|
7098
|
-
|
|
7099
|
-
}, [
|
|
7100
|
-
|
|
7101
|
-
}, [
|
|
7096
|
+
f || (l(""), h(""), a(-1), c([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
|
|
7097
|
+
}, [e, f]), H(() => {
|
|
7098
|
+
f && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(s);
|
|
7099
|
+
}, [f, s, e]), H(() => {
|
|
7100
|
+
f && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(d);
|
|
7101
|
+
}, [f, d, e]), H(() => {
|
|
7102
7102
|
if (!e)
|
|
7103
7103
|
return;
|
|
7104
|
-
const b = e.extensionManager.extensions.find((
|
|
7104
|
+
const b = e.extensionManager.extensions.find((A) => A.name === pd.name);
|
|
7105
7105
|
if (!b)
|
|
7106
7106
|
return;
|
|
7107
7107
|
const C = () => {
|
|
7108
|
-
if (!
|
|
7108
|
+
if (!f)
|
|
7109
7109
|
return;
|
|
7110
|
-
const
|
|
7111
|
-
a((_) => _ !==
|
|
7110
|
+
const A = b ? b.storage.currentIndex : -1, v = b ? b.storage.results : [];
|
|
7111
|
+
a((_) => _ !== A ? A : _), c((_) => li(_, v) ? _ : v);
|
|
7112
7112
|
};
|
|
7113
7113
|
return window.addEventListener(ri, C), () => {
|
|
7114
7114
|
b && window.removeEventListener(ri, C);
|
|
7115
7115
|
};
|
|
7116
|
-
}, [
|
|
7116
|
+
}, [f, e]), /* @__PURE__ */ m(
|
|
7117
7117
|
se,
|
|
7118
7118
|
{
|
|
7119
|
-
open:
|
|
7120
|
-
onOpenChange:
|
|
7119
|
+
open: f,
|
|
7120
|
+
onOpenChange: u,
|
|
7121
7121
|
children: [
|
|
7122
7122
|
/* @__PURE__ */ r(
|
|
7123
7123
|
le,
|
|
@@ -7130,7 +7130,7 @@ function ud({ editor: e, ...t }) {
|
|
|
7130
7130
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
7131
7131
|
isActive: t == null ? void 0 : t.isActive,
|
|
7132
7132
|
disabled: t == null ? void 0 : t.disabled,
|
|
7133
|
-
children: /* @__PURE__ */ r(
|
|
7133
|
+
children: /* @__PURE__ */ r(j, { name: t == null ? void 0 : t.icon })
|
|
7134
7134
|
}
|
|
7135
7135
|
)
|
|
7136
7136
|
}
|
|
@@ -7160,8 +7160,8 @@ function ud({ editor: e, ...t }) {
|
|
|
7160
7160
|
onChange: (b) => l(b.target.value)
|
|
7161
7161
|
}
|
|
7162
7162
|
),
|
|
7163
|
-
/* @__PURE__ */ r(U, { disabled: !o.length, className: "richtext-flex-1", onClick: e.commands.goToPrevSearchResult, children: /* @__PURE__ */ r(
|
|
7164
|
-
/* @__PURE__ */ r(U, { disabled: !o.length, className: "richtext-flex-1", onClick: e.commands.goToNextSearchResult, children: /* @__PURE__ */ r(
|
|
7163
|
+
/* @__PURE__ */ r(U, { disabled: !o.length, className: "richtext-flex-1", onClick: e.commands.goToPrevSearchResult, children: /* @__PURE__ */ r(j, { name: "ChevronUp" }) }),
|
|
7164
|
+
/* @__PURE__ */ r(U, { disabled: !o.length, className: "richtext-flex-1", onClick: e.commands.goToNextSearchResult, children: /* @__PURE__ */ r(j, { name: "ChevronDown" }) })
|
|
7165
7165
|
] }),
|
|
7166
7166
|
/* @__PURE__ */ r(ie, { className: "richtext-mb-[6px]", children: i("editor.replace.dialog.text") }),
|
|
7167
7167
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[5px]", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
|
|
@@ -7199,10 +7199,10 @@ function ud({ editor: e, ...t }) {
|
|
|
7199
7199
|
);
|
|
7200
7200
|
}
|
|
7201
7201
|
const at = (e, t) => t(e.tr);
|
|
7202
|
-
function
|
|
7202
|
+
function fd(e, t, i) {
|
|
7203
7203
|
return RegExp(t ? e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&") : e, i ? "gu" : "gui");
|
|
7204
7204
|
}
|
|
7205
|
-
function
|
|
7205
|
+
function gd(e, t, i) {
|
|
7206
7206
|
const n = [];
|
|
7207
7207
|
let a = [];
|
|
7208
7208
|
const o = [];
|
|
@@ -7220,13 +7220,13 @@ function fd(e, t, i) {
|
|
|
7220
7220
|
}), a = a.filter(Boolean);
|
|
7221
7221
|
for (let s = 0; s < a.length; s += 1) {
|
|
7222
7222
|
const { text: l, pos: d } = a[s], h = [...l.matchAll(t)];
|
|
7223
|
-
for (let
|
|
7224
|
-
const
|
|
7225
|
-
if (
|
|
7223
|
+
for (let f = 0; f < h.length; f += 1) {
|
|
7224
|
+
const u = h[f];
|
|
7225
|
+
if (u[0] === "")
|
|
7226
7226
|
break;
|
|
7227
|
-
|
|
7228
|
-
from: d +
|
|
7229
|
-
to: d +
|
|
7227
|
+
u.index !== void 0 && o.push({
|
|
7228
|
+
from: d + u.index,
|
|
7229
|
+
to: d + u.index + u[0].length
|
|
7230
7230
|
});
|
|
7231
7231
|
}
|
|
7232
7232
|
}
|
|
@@ -7245,7 +7245,7 @@ function Zi(e, t, { state: i, dispatch: n }) {
|
|
|
7245
7245
|
const { from: o, to: c } = t[0];
|
|
7246
7246
|
n && n(i.tr.insertText(e, o, c));
|
|
7247
7247
|
}
|
|
7248
|
-
function
|
|
7248
|
+
function xd(e, t, i, n) {
|
|
7249
7249
|
const a = t + 1;
|
|
7250
7250
|
if (!n[a])
|
|
7251
7251
|
return null;
|
|
@@ -7255,14 +7255,14 @@ function gd(e, t, i, n) {
|
|
|
7255
7255
|
from: l - s
|
|
7256
7256
|
}, [s, n];
|
|
7257
7257
|
}
|
|
7258
|
-
function
|
|
7258
|
+
function bd(e, t, { tr: i, dispatch: n }) {
|
|
7259
7259
|
let a = 0, o = t.slice();
|
|
7260
7260
|
if (!o.length)
|
|
7261
7261
|
return !1;
|
|
7262
7262
|
for (let c = 0; c < o.length; c += 1) {
|
|
7263
7263
|
const { from: s, to: l } = o[c];
|
|
7264
7264
|
i.insertText(e, s, l);
|
|
7265
|
-
const d =
|
|
7265
|
+
const d = xd(e, c, a, o);
|
|
7266
7266
|
d && (a = d[0], o = d[1]);
|
|
7267
7267
|
}
|
|
7268
7268
|
return n(i), !0;
|
|
@@ -7282,7 +7282,7 @@ function Yi({ view: e, tr: t, searchResults: i, searchResultCurrentClass: n, got
|
|
|
7282
7282
|
}
|
|
7283
7283
|
return !1;
|
|
7284
7284
|
}
|
|
7285
|
-
const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri),
|
|
7285
|
+
const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri), pd = Y.create({
|
|
7286
7286
|
name: "search",
|
|
7287
7287
|
addOptions() {
|
|
7288
7288
|
var e;
|
|
@@ -7299,7 +7299,7 @@ const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri), bd = Y.create({
|
|
|
7299
7299
|
onChange: () => {
|
|
7300
7300
|
},
|
|
7301
7301
|
button: ({ editor: t, t: i }) => ({
|
|
7302
|
-
component:
|
|
7302
|
+
component: md,
|
|
7303
7303
|
componentProps: {
|
|
7304
7304
|
action: () => {
|
|
7305
7305
|
},
|
|
@@ -7329,7 +7329,7 @@ const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri), bd = Y.create({
|
|
|
7329
7329
|
},
|
|
7330
7330
|
replaceAll: () => ({ state: e, tr: t, dispatch: i }) => {
|
|
7331
7331
|
const { replaceTerm: n } = this.options, { results: a } = this.storage;
|
|
7332
|
-
return
|
|
7332
|
+
return bd(n, a, { tr: t, dispatch: i }), this.storage.currentIndex = -1, this.storage.results = [], window.dispatchEvent(Pe), at(e, i), !1;
|
|
7333
7333
|
},
|
|
7334
7334
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
7335
7335
|
const { searchResultCurrentClass: i } = this.options, { currentIndex: n, results: a } = this.storage, o = (n + a.length - 1) % a.length;
|
|
@@ -7365,14 +7365,14 @@ const ri = "ON_SEARCH_RESULTS", Pe = new CustomEvent(ri), bd = Y.create({
|
|
|
7365
7365
|
apply(t) {
|
|
7366
7366
|
const { doc: i, docChanged: n } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: c, disableRegex: s, caseSensitive: l } = e.options;
|
|
7367
7367
|
if (n || a) {
|
|
7368
|
-
const { decorationsToReturn: d, results: h } =
|
|
7368
|
+
const { decorationsToReturn: d, results: h } = gd(
|
|
7369
7369
|
i,
|
|
7370
|
-
|
|
7370
|
+
fd(a, s, l),
|
|
7371
7371
|
o
|
|
7372
7372
|
);
|
|
7373
7373
|
if (e.storage.results = h, e.storage.currentIndex > h.length - 1 && (e.storage.currentIndex = 0), window.dispatchEvent(Pe), t.getMeta("directDecoration")) {
|
|
7374
|
-
const { fromPos:
|
|
7375
|
-
d.push(qe.inline(
|
|
7374
|
+
const { fromPos: f, toPos: u, attrs: g } = t.getMeta("directDecoration");
|
|
7375
|
+
d.push(qe.inline(f, u, g));
|
|
7376
7376
|
} else
|
|
7377
7377
|
h.length && (d[0] = qe.inline(h[0].from, h[0].to, {
|
|
7378
7378
|
class: c
|
|
@@ -9234,18 +9234,18 @@ Object.keys(Je).reduce((e, t) => {
|
|
|
9234
9234
|
const i = Je[t];
|
|
9235
9235
|
return e[i] = t, e;
|
|
9236
9236
|
}, {});
|
|
9237
|
-
const
|
|
9237
|
+
const wd = Object.keys(Je).map((e) => e);
|
|
9238
9238
|
Object.keys(Je).map((e) => Je[e]);
|
|
9239
|
-
function
|
|
9240
|
-
return
|
|
9239
|
+
function _d(e) {
|
|
9240
|
+
return wd.filter((t) => t.startsWith(e)).map((t) => ({
|
|
9241
9241
|
name: t,
|
|
9242
9242
|
emoji: Je[t]
|
|
9243
9243
|
}));
|
|
9244
9244
|
}
|
|
9245
9245
|
const Jn = Lt((e, t) => {
|
|
9246
9246
|
const i = J(), [n, a] = w(0), { t: o } = B(), c = (h) => {
|
|
9247
|
-
const
|
|
9248
|
-
|
|
9247
|
+
const f = e.items[h];
|
|
9248
|
+
f && e.command(f);
|
|
9249
9249
|
}, s = () => {
|
|
9250
9250
|
a((n + e.items.length - 1) % e.items.length);
|
|
9251
9251
|
}, l = () => {
|
|
@@ -9260,11 +9260,11 @@ const Jn = Lt((e, t) => {
|
|
|
9260
9260
|
h && gi(h, { behavior: "smooth", scrollMode: "if-needed" });
|
|
9261
9261
|
}, [n]), St(t, () => ({
|
|
9262
9262
|
onKeyDown: ({ event: h }) => h.key === "ArrowUp" ? (s(), !0) : h.key === "ArrowDown" ? (l(), !0) : h.key === "Enter" ? (d(), !0) : !1
|
|
9263
|
-
})), /* @__PURE__ */ r("div", { className: "richtext-w-[200px] richtext-max-h-[320px] richtext-overflow-x-hidden richtext-overflow-y-auto richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ r("div", { ref: i, children: e.items.length ? e.items.map((h,
|
|
9263
|
+
})), /* @__PURE__ */ r("div", { className: "richtext-w-[200px] richtext-max-h-[320px] richtext-overflow-x-hidden richtext-overflow-y-auto richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ r("div", { ref: i, children: e.items.length ? e.items.map((h, f) => /* @__PURE__ */ m(
|
|
9264
9264
|
"span",
|
|
9265
9265
|
{
|
|
9266
|
-
className: ee(" richtext-flex richtext-relative richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground hover:richtext-bg-accent",
|
|
9267
|
-
onClick: () => c(
|
|
9266
|
+
className: ee(" richtext-flex richtext-relative richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground hover:richtext-bg-accent", f === n ? "bg-accent" : ""),
|
|
9267
|
+
onClick: () => c(f),
|
|
9268
9268
|
children: [
|
|
9269
9269
|
h.fallbackImage ? /* @__PURE__ */ r("img", { src: h.fallbackImage, className: "richtext-w-[1em] richtext-h-[1em]" }) : h.emoji,
|
|
9270
9270
|
":",
|
|
@@ -9272,11 +9272,11 @@ const Jn = Lt((e, t) => {
|
|
|
9272
9272
|
":"
|
|
9273
9273
|
]
|
|
9274
9274
|
},
|
|
9275
|
-
`emoji-list-code-${
|
|
9275
|
+
`emoji-list-code-${f}`
|
|
9276
9276
|
)) : /* @__PURE__ */ r("div", { className: "richtext-flex richtext-relative richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors", children: /* @__PURE__ */ r("span", { children: o("no_result_found") }) }) }) });
|
|
9277
9277
|
});
|
|
9278
9278
|
Jn.displayName = "EmojiList";
|
|
9279
|
-
const
|
|
9279
|
+
const vd = [
|
|
9280
9280
|
"😀",
|
|
9281
9281
|
"😃",
|
|
9282
9282
|
"😄",
|
|
@@ -9490,7 +9490,7 @@ const _d = [
|
|
|
9490
9490
|
"🗯",
|
|
9491
9491
|
"💭",
|
|
9492
9492
|
"💤"
|
|
9493
|
-
],
|
|
9493
|
+
], yd = [
|
|
9494
9494
|
"🏧",
|
|
9495
9495
|
"🚮",
|
|
9496
9496
|
"🚰",
|
|
@@ -9792,7 +9792,7 @@ const _d = [
|
|
|
9792
9792
|
"🔘",
|
|
9793
9793
|
"🔳",
|
|
9794
9794
|
"🔲"
|
|
9795
|
-
],
|
|
9795
|
+
], kd = [
|
|
9796
9796
|
"👓",
|
|
9797
9797
|
"🕶️",
|
|
9798
9798
|
"🕶",
|
|
@@ -10092,7 +10092,7 @@ const _d = [
|
|
|
10092
10092
|
"⚱",
|
|
10093
10093
|
"🗿",
|
|
10094
10094
|
"🪧"
|
|
10095
|
-
],
|
|
10095
|
+
], Cd = [
|
|
10096
10096
|
"🎃",
|
|
10097
10097
|
"🎄",
|
|
10098
10098
|
"🎆",
|
|
@@ -10188,7 +10188,7 @@ const _d = [
|
|
|
10188
10188
|
"🪡",
|
|
10189
10189
|
"🧶",
|
|
10190
10190
|
"🪢"
|
|
10191
|
-
],
|
|
10191
|
+
], Nd = [
|
|
10192
10192
|
"🌍",
|
|
10193
10193
|
"🌎",
|
|
10194
10194
|
"🌏",
|
|
@@ -10453,7 +10453,7 @@ const _d = [
|
|
|
10453
10453
|
"🔥",
|
|
10454
10454
|
"💧",
|
|
10455
10455
|
"🌊"
|
|
10456
|
-
],
|
|
10456
|
+
], Td = [
|
|
10457
10457
|
"🏁",
|
|
10458
10458
|
"🚩",
|
|
10459
10459
|
"🎌",
|
|
@@ -10729,7 +10729,7 @@ const _d = [
|
|
|
10729
10729
|
"🏴",
|
|
10730
10730
|
"🏴",
|
|
10731
10731
|
"🏴"
|
|
10732
|
-
],
|
|
10732
|
+
], Ad = [
|
|
10733
10733
|
"🐵",
|
|
10734
10734
|
"🐒",
|
|
10735
10735
|
"🦍",
|
|
@@ -10877,7 +10877,7 @@ const _d = [
|
|
|
10877
10877
|
"🍁",
|
|
10878
10878
|
"🍂",
|
|
10879
10879
|
"🍃"
|
|
10880
|
-
],
|
|
10880
|
+
], Ld = [
|
|
10881
10881
|
"🍇",
|
|
10882
10882
|
"🍈",
|
|
10883
10883
|
"🍉",
|
|
@@ -11010,7 +11010,7 @@ const _d = [
|
|
|
11010
11010
|
"🔪",
|
|
11011
11011
|
"🏺"
|
|
11012
11012
|
];
|
|
11013
|
-
function
|
|
11013
|
+
function Sd() {
|
|
11014
11014
|
return /* @__PURE__ */ r(
|
|
11015
11015
|
"svg",
|
|
11016
11016
|
{
|
|
@@ -11028,7 +11028,7 @@ function Ld() {
|
|
|
11028
11028
|
}
|
|
11029
11029
|
);
|
|
11030
11030
|
}
|
|
11031
|
-
function
|
|
11031
|
+
function Md() {
|
|
11032
11032
|
return /* @__PURE__ */ m(
|
|
11033
11033
|
"svg",
|
|
11034
11034
|
{
|
|
@@ -11055,7 +11055,7 @@ function Sd() {
|
|
|
11055
11055
|
}
|
|
11056
11056
|
);
|
|
11057
11057
|
}
|
|
11058
|
-
function
|
|
11058
|
+
function Id() {
|
|
11059
11059
|
return /* @__PURE__ */ r(
|
|
11060
11060
|
"svg",
|
|
11061
11061
|
{
|
|
@@ -11073,7 +11073,7 @@ function Md() {
|
|
|
11073
11073
|
}
|
|
11074
11074
|
);
|
|
11075
11075
|
}
|
|
11076
|
-
function
|
|
11076
|
+
function zd() {
|
|
11077
11077
|
return /* @__PURE__ */ r(
|
|
11078
11078
|
"svg",
|
|
11079
11079
|
{
|
|
@@ -11091,7 +11091,7 @@ function Id() {
|
|
|
11091
11091
|
}
|
|
11092
11092
|
);
|
|
11093
11093
|
}
|
|
11094
|
-
function
|
|
11094
|
+
function Ed() {
|
|
11095
11095
|
return /* @__PURE__ */ m(
|
|
11096
11096
|
"svg",
|
|
11097
11097
|
{
|
|
@@ -11118,7 +11118,7 @@ function zd() {
|
|
|
11118
11118
|
}
|
|
11119
11119
|
);
|
|
11120
11120
|
}
|
|
11121
|
-
function
|
|
11121
|
+
function Hd() {
|
|
11122
11122
|
return /* @__PURE__ */ r(
|
|
11123
11123
|
"svg",
|
|
11124
11124
|
{
|
|
@@ -11136,7 +11136,7 @@ function Ed() {
|
|
|
11136
11136
|
}
|
|
11137
11137
|
);
|
|
11138
11138
|
}
|
|
11139
|
-
function
|
|
11139
|
+
function Rd() {
|
|
11140
11140
|
return /* @__PURE__ */ m(
|
|
11141
11141
|
"svg",
|
|
11142
11142
|
{
|
|
@@ -11163,7 +11163,7 @@ function Hd() {
|
|
|
11163
11163
|
}
|
|
11164
11164
|
);
|
|
11165
11165
|
}
|
|
11166
|
-
function
|
|
11166
|
+
function Od(e, t = null) {
|
|
11167
11167
|
if (typeof window > "u")
|
|
11168
11168
|
throw new Error();
|
|
11169
11169
|
const i = localStorage.getItem(e);
|
|
@@ -11175,7 +11175,7 @@ function Rd(e, t = null) {
|
|
|
11175
11175
|
return i;
|
|
11176
11176
|
}
|
|
11177
11177
|
}
|
|
11178
|
-
function
|
|
11178
|
+
function Pd(e, t) {
|
|
11179
11179
|
window.localStorage.setItem(e, `${t}`);
|
|
11180
11180
|
}
|
|
11181
11181
|
class Wt {
|
|
@@ -11187,7 +11187,7 @@ class Wt {
|
|
|
11187
11187
|
this.key = t, this.value = i, this.prev = null, this.next = null;
|
|
11188
11188
|
}
|
|
11189
11189
|
}
|
|
11190
|
-
class
|
|
11190
|
+
class Dd {
|
|
11191
11191
|
constructor(t) {
|
|
11192
11192
|
me(this, "capacity");
|
|
11193
11193
|
me(this, "usedCapacity");
|
|
@@ -11246,16 +11246,16 @@ class Pd {
|
|
|
11246
11246
|
return this.store;
|
|
11247
11247
|
}
|
|
11248
11248
|
}
|
|
11249
|
-
function
|
|
11250
|
-
const i = new
|
|
11249
|
+
function Bd(e, t) {
|
|
11250
|
+
const i = new Dd(t);
|
|
11251
11251
|
return {
|
|
11252
11252
|
syncFromStorage() {
|
|
11253
|
-
(
|
|
11253
|
+
(Od(e) || []).slice().reverse().forEach((o) => {
|
|
11254
11254
|
i.put(o, o);
|
|
11255
11255
|
});
|
|
11256
11256
|
},
|
|
11257
11257
|
syncToStorage() {
|
|
11258
|
-
|
|
11258
|
+
Pd(e, mc(i.keys()));
|
|
11259
11259
|
},
|
|
11260
11260
|
put(a) {
|
|
11261
11261
|
i.put(a, a), this.syncToStorage();
|
|
@@ -11265,53 +11265,53 @@ function Dd(e, t) {
|
|
|
11265
11265
|
}
|
|
11266
11266
|
};
|
|
11267
11267
|
}
|
|
11268
|
-
const De =
|
|
11268
|
+
const De = Bd("EMOJI_PICKER", 20), Ji = [
|
|
11269
11269
|
{
|
|
11270
11270
|
title: "Smileys & People",
|
|
11271
|
-
data:
|
|
11271
|
+
data: vd,
|
|
11272
11272
|
icon: xa
|
|
11273
11273
|
},
|
|
11274
11274
|
{
|
|
11275
11275
|
title: "Animals & Nature",
|
|
11276
|
-
data:
|
|
11277
|
-
icon:
|
|
11276
|
+
data: Ad,
|
|
11277
|
+
icon: Md
|
|
11278
11278
|
},
|
|
11279
11279
|
{
|
|
11280
11280
|
title: "Food & Drink",
|
|
11281
|
-
data:
|
|
11282
|
-
icon:
|
|
11281
|
+
data: Ld,
|
|
11282
|
+
icon: zd
|
|
11283
11283
|
},
|
|
11284
11284
|
{
|
|
11285
11285
|
title: "Activity",
|
|
11286
|
-
data:
|
|
11287
|
-
icon:
|
|
11286
|
+
data: Cd,
|
|
11287
|
+
icon: Sd
|
|
11288
11288
|
},
|
|
11289
11289
|
{
|
|
11290
11290
|
title: "Travel & Places",
|
|
11291
|
-
data:
|
|
11292
|
-
icon:
|
|
11291
|
+
data: Nd,
|
|
11292
|
+
icon: Rd
|
|
11293
11293
|
},
|
|
11294
11294
|
{
|
|
11295
11295
|
title: "Object",
|
|
11296
|
-
data:
|
|
11297
|
-
icon:
|
|
11296
|
+
data: kd,
|
|
11297
|
+
icon: Ed
|
|
11298
11298
|
},
|
|
11299
11299
|
{
|
|
11300
11300
|
title: "Symbol",
|
|
11301
|
-
data:
|
|
11302
|
-
icon:
|
|
11301
|
+
data: yd,
|
|
11302
|
+
icon: Hd
|
|
11303
11303
|
},
|
|
11304
11304
|
{
|
|
11305
11305
|
title: "Flags",
|
|
11306
|
-
data:
|
|
11307
|
-
icon:
|
|
11306
|
+
data: Td,
|
|
11307
|
+
icon: Id
|
|
11308
11308
|
}
|
|
11309
|
-
],
|
|
11310
|
-
function
|
|
11311
|
-
const [i, n] = w([]), { t: a } = B(), o =
|
|
11309
|
+
], $d = ["😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣"];
|
|
11310
|
+
function Vd({ onSelectEmoji: e, children: t }) {
|
|
11311
|
+
const [i, n] = w([]), { t: a } = B(), o = P(
|
|
11312
11312
|
() => i.length ? [{ title: "Frequently used", icon: ga, data: i }, ...Ji] : Ji,
|
|
11313
11313
|
[i]
|
|
11314
|
-
), c =
|
|
11314
|
+
), c = T(
|
|
11315
11315
|
(s) => {
|
|
11316
11316
|
De.put(s), n(De.get()), e && e(s);
|
|
11317
11317
|
},
|
|
@@ -11320,7 +11320,7 @@ function $d({ onSelectEmoji: e, children: t }) {
|
|
|
11320
11320
|
return H(() => {
|
|
11321
11321
|
De.syncFromStorage();
|
|
11322
11322
|
const s = De.get();
|
|
11323
|
-
s != null && s.length ||
|
|
11323
|
+
s != null && s.length || $d.forEach((d) => {
|
|
11324
11324
|
De.put(d);
|
|
11325
11325
|
});
|
|
11326
11326
|
const l = De.get();
|
|
@@ -11360,14 +11360,14 @@ function $d({ onSelectEmoji: e, children: t }) {
|
|
|
11360
11360
|
] });
|
|
11361
11361
|
}
|
|
11362
11362
|
function jd({ editor: e, icon: t, ...i }) {
|
|
11363
|
-
const n =
|
|
11363
|
+
const n = T(
|
|
11364
11364
|
(a) => {
|
|
11365
11365
|
const { selection: o } = e.state, { $anchor: c } = o;
|
|
11366
11366
|
return e.chain().insertContentAt(c.pos, a).run();
|
|
11367
11367
|
},
|
|
11368
11368
|
[e]
|
|
11369
11369
|
);
|
|
11370
|
-
return /* @__PURE__ */ r(
|
|
11370
|
+
return /* @__PURE__ */ r(Vd, { onSelectEmoji: n, children: /* @__PURE__ */ r(
|
|
11371
11371
|
p,
|
|
11372
11372
|
{
|
|
11373
11373
|
tooltip: i == null ? void 0 : i.tooltip,
|
|
@@ -11375,7 +11375,7 @@ function jd({ editor: e, icon: t, ...i }) {
|
|
|
11375
11375
|
}
|
|
11376
11376
|
) });
|
|
11377
11377
|
}
|
|
11378
|
-
const Fd = 200,
|
|
11378
|
+
const Fd = 200, Ud = new _e("emoji"), Iu = ue.create({
|
|
11379
11379
|
name: "emoji",
|
|
11380
11380
|
content: "text*",
|
|
11381
11381
|
priority: Fd,
|
|
@@ -11386,7 +11386,7 @@ const Fd = 200, Vd = new _e("emoji"), Iu = ue.create({
|
|
|
11386
11386
|
HTMLAttributes: {},
|
|
11387
11387
|
suggestion: {
|
|
11388
11388
|
char: ":",
|
|
11389
|
-
pluginKey:
|
|
11389
|
+
pluginKey: Ud,
|
|
11390
11390
|
command: ({ editor: t, range: i, props: n }) => {
|
|
11391
11391
|
t.chain().focus().insertContentAt(i, `${n.emoji} `).run();
|
|
11392
11392
|
}
|
|
@@ -11420,7 +11420,7 @@ const Fd = 200, Vd = new _e("emoji"), Iu = ue.create({
|
|
|
11420
11420
|
}
|
|
11421
11421
|
}).configure({
|
|
11422
11422
|
suggestion: {
|
|
11423
|
-
items: ({ query: e }) =>
|
|
11423
|
+
items: ({ query: e }) => _d(e),
|
|
11424
11424
|
render: () => {
|
|
11425
11425
|
let e, t, i;
|
|
11426
11426
|
return {
|
|
@@ -11455,23 +11455,23 @@ const Fd = 200, Vd = new _e("emoji"), Iu = ue.create({
|
|
|
11455
11455
|
}
|
|
11456
11456
|
}
|
|
11457
11457
|
});
|
|
11458
|
-
function
|
|
11459
|
-
const { t: i } = B(), n = ut(e,
|
|
11458
|
+
function Wd({ editor: e, ...t }) {
|
|
11459
|
+
const { t: i } = B(), n = ut(e, je.name, {
|
|
11460
11460
|
text: "",
|
|
11461
11461
|
defaultShowPicker: !1
|
|
11462
|
-
}), { text: a, defaultShowPicker: o } = n, [c, s] = w(""), l =
|
|
11462
|
+
}), { text: a, defaultShowPicker: o } = n, [c, s] = w(""), l = T(() => {
|
|
11463
11463
|
e.chain().focus().setKatex({ text: c }).run(), s("");
|
|
11464
11464
|
}, [e, c]);
|
|
11465
11465
|
H(() => {
|
|
11466
|
-
o && e.chain().updateAttributes(
|
|
11466
|
+
o && e.chain().updateAttributes(je.name, { defaultShowPicker: !1 }).focus().run();
|
|
11467
11467
|
}, [e, o]);
|
|
11468
|
-
const d =
|
|
11468
|
+
const d = P(() => {
|
|
11469
11469
|
try {
|
|
11470
11470
|
return xi.renderToString(`${c}`);
|
|
11471
11471
|
} catch {
|
|
11472
11472
|
return c;
|
|
11473
11473
|
}
|
|
11474
|
-
}, [c]), h =
|
|
11474
|
+
}, [c]), h = P(
|
|
11475
11475
|
() => `${c}`.trim() ? /* @__PURE__ */ r("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html: d || "" } }) : null,
|
|
11476
11476
|
[c, d]
|
|
11477
11477
|
);
|
|
@@ -11489,7 +11489,7 @@ function Ud({ editor: e, ...t }) {
|
|
|
11489
11489
|
mt,
|
|
11490
11490
|
{
|
|
11491
11491
|
value: c,
|
|
11492
|
-
onChange: (
|
|
11492
|
+
onChange: (f) => s(f.target.value),
|
|
11493
11493
|
autoFocus: !0,
|
|
11494
11494
|
required: !0,
|
|
11495
11495
|
rows: 3,
|
|
@@ -11506,7 +11506,7 @@ function Ud({ editor: e, ...t }) {
|
|
|
11506
11506
|
] })
|
|
11507
11507
|
] });
|
|
11508
11508
|
}
|
|
11509
|
-
function
|
|
11509
|
+
function qd(e, t = 1) {
|
|
11510
11510
|
let i = 0, n = 0, a = 0;
|
|
11511
11511
|
if (e.startsWith("rgb")) {
|
|
11512
11512
|
const o = e.replace(/\s/g, "").match(/rgb\((.*)\)$/)[1].split(",");
|
|
@@ -11518,17 +11518,17 @@ function Wd(e, t = 1) {
|
|
|
11518
11518
|
return e;
|
|
11519
11519
|
return t > 1 && t <= 100 && (t = t / 100), `rgba(${i},${n},${a},${t})`;
|
|
11520
11520
|
}
|
|
11521
|
-
function
|
|
11522
|
-
const t = Xc(), { text: i } = e.attrs, n =
|
|
11521
|
+
function Gd({ node: e }) {
|
|
11522
|
+
const t = Xc(), { text: i } = e.attrs, n = P(() => {
|
|
11523
11523
|
const c = "rgb(254, 242, 237)";
|
|
11524
|
-
return t === "dark" ?
|
|
11525
|
-
}, [t]), a =
|
|
11524
|
+
return t === "dark" ? qd(c, 0.75) : c;
|
|
11525
|
+
}, [t]), a = P(() => {
|
|
11526
11526
|
try {
|
|
11527
11527
|
return xi.renderToString(`${i}`);
|
|
11528
11528
|
} catch {
|
|
11529
11529
|
return i;
|
|
11530
11530
|
}
|
|
11531
|
-
}, [i]), o =
|
|
11531
|
+
}, [i]), o = P(
|
|
11532
11532
|
() => i.trim() ? /* @__PURE__ */ r("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html: a } }) : /* @__PURE__ */ r("span", { contentEditable: !1, children: "Not enter a formula" }),
|
|
11533
11533
|
[i, a]
|
|
11534
11534
|
);
|
|
@@ -11544,10 +11544,10 @@ function qd({ node: e }) {
|
|
|
11544
11544
|
}
|
|
11545
11545
|
);
|
|
11546
11546
|
}
|
|
11547
|
-
function
|
|
11547
|
+
function Kd(e) {
|
|
11548
11548
|
return (t) => t.getAttribute(e);
|
|
11549
11549
|
}
|
|
11550
|
-
const
|
|
11550
|
+
const je = ue.create({
|
|
11551
11551
|
name: "katex",
|
|
11552
11552
|
group: "inline",
|
|
11553
11553
|
inline: !0,
|
|
@@ -11560,7 +11560,7 @@ const Fe = ue.create({
|
|
|
11560
11560
|
class: "katex"
|
|
11561
11561
|
},
|
|
11562
11562
|
button: ({ editor: e, t }) => ({
|
|
11563
|
-
component:
|
|
11563
|
+
component: Wd,
|
|
11564
11564
|
componentProps: {
|
|
11565
11565
|
editor: e,
|
|
11566
11566
|
action: () => {
|
|
@@ -11577,7 +11577,7 @@ const Fe = ue.create({
|
|
|
11577
11577
|
return {
|
|
11578
11578
|
text: {
|
|
11579
11579
|
default: "",
|
|
11580
|
-
parseHTML:
|
|
11580
|
+
parseHTML: Kd("text")
|
|
11581
11581
|
},
|
|
11582
11582
|
defaultShowPicker: {
|
|
11583
11583
|
default: !1
|
|
@@ -11608,10 +11608,10 @@ const Fe = ue.create({
|
|
|
11608
11608
|
];
|
|
11609
11609
|
},
|
|
11610
11610
|
addNodeView() {
|
|
11611
|
-
return ge(
|
|
11611
|
+
return ge(Gd);
|
|
11612
11612
|
}
|
|
11613
11613
|
});
|
|
11614
|
-
function
|
|
11614
|
+
function Xd(e) {
|
|
11615
11615
|
const t = document.createElement("iframe");
|
|
11616
11616
|
t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
|
|
11617
11617
|
<!DOCTYPE html>
|
|
@@ -11648,9 +11648,9 @@ function Kd(e) {
|
|
|
11648
11648
|
}, 100);
|
|
11649
11649
|
});
|
|
11650
11650
|
}
|
|
11651
|
-
function
|
|
11651
|
+
function Zd(e) {
|
|
11652
11652
|
const t = e.getHTML();
|
|
11653
|
-
return t ? (
|
|
11653
|
+
return t ? (Xd(t), !0) : !1;
|
|
11654
11654
|
}
|
|
11655
11655
|
const zu = Y.create({
|
|
11656
11656
|
name: "exportPdf",
|
|
@@ -11662,7 +11662,7 @@ const zu = Y.create({
|
|
|
11662
11662
|
component: p,
|
|
11663
11663
|
componentProps: {
|
|
11664
11664
|
action: () => {
|
|
11665
|
-
|
|
11665
|
+
Zd(t);
|
|
11666
11666
|
},
|
|
11667
11667
|
icon: "ExportPdf",
|
|
11668
11668
|
tooltip: i("editor.exportPdf.tooltip"),
|
|
@@ -11673,41 +11673,41 @@ const zu = Y.create({
|
|
|
11673
11673
|
};
|
|
11674
11674
|
}
|
|
11675
11675
|
});
|
|
11676
|
-
function
|
|
11676
|
+
function Yd(e, t) {
|
|
11677
11677
|
const i = atob(e.split(",")[1]), n = Array.from({ length: i.length });
|
|
11678
11678
|
for (let o = 0; o < i.length; o++)
|
|
11679
11679
|
n[o] = i.charCodeAt(o);
|
|
11680
11680
|
const a = new Uint8Array(n);
|
|
11681
11681
|
return new Blob([a], { type: t });
|
|
11682
11682
|
}
|
|
11683
|
-
function
|
|
11683
|
+
function Jd(e, t) {
|
|
11684
11684
|
return new File([e], t, { type: e.type });
|
|
11685
11685
|
}
|
|
11686
|
-
function
|
|
11686
|
+
function Qd(e) {
|
|
11687
11687
|
const [t, i] = w(!1), [n, a] = w(), o = J();
|
|
11688
11688
|
function c() {
|
|
11689
11689
|
o.current.click();
|
|
11690
11690
|
}
|
|
11691
|
-
function s(
|
|
11692
|
-
const
|
|
11693
|
-
a(
|
|
11691
|
+
function s(f) {
|
|
11692
|
+
const u = f.target.files[0];
|
|
11693
|
+
a(u), u && d();
|
|
11694
11694
|
}
|
|
11695
|
-
async function l(
|
|
11695
|
+
async function l(f) {
|
|
11696
11696
|
var C;
|
|
11697
|
-
const g = new DOMParser().parseFromString(
|
|
11697
|
+
const g = new DOMParser().parseFromString(f, "text/html"), x = g.querySelectorAll("img");
|
|
11698
11698
|
if (!x.length)
|
|
11699
11699
|
return g.body.innerHTML;
|
|
11700
11700
|
if (Mn(e.editor, "image")) {
|
|
11701
|
-
const
|
|
11701
|
+
const A = (C = e.editor.extensionManager.extensions.find(
|
|
11702
11702
|
(v) => v.name === "importWord"
|
|
11703
11703
|
)) == null ? void 0 : C.options;
|
|
11704
|
-
if (
|
|
11704
|
+
if (A && typeof A.upload == "function") {
|
|
11705
11705
|
const v = [];
|
|
11706
11706
|
for (const k of x) {
|
|
11707
|
-
const N = k.getAttribute("src"), I =
|
|
11707
|
+
const N = k.getAttribute("src"), I = Yd(N, "image/jpeg"), O = Jd(I, "image.jpeg");
|
|
11708
11708
|
v.push(O);
|
|
11709
11709
|
}
|
|
11710
|
-
const _ = await
|
|
11710
|
+
const _ = await A.upload(v);
|
|
11711
11711
|
for (let k = 0; k < x.length; k++) {
|
|
11712
11712
|
const N = x[k];
|
|
11713
11713
|
N.setAttribute("src", _[k].src);
|
|
@@ -11722,10 +11722,10 @@ function Jd(e) {
|
|
|
11722
11722
|
}
|
|
11723
11723
|
async function d() {
|
|
11724
11724
|
if (e.convert) {
|
|
11725
|
-
const
|
|
11726
|
-
h(
|
|
11725
|
+
const f = await e.convert(n);
|
|
11726
|
+
h(f);
|
|
11727
11727
|
} else {
|
|
11728
|
-
const
|
|
11728
|
+
const f = new FormData(), u = JSON.stringify({
|
|
11729
11729
|
collaboration_features: {
|
|
11730
11730
|
comments: !0,
|
|
11731
11731
|
user_id: "e3",
|
|
@@ -11738,9 +11738,9 @@ function Jd(e) {
|
|
|
11738
11738
|
comments: "basic"
|
|
11739
11739
|
}
|
|
11740
11740
|
});
|
|
11741
|
-
|
|
11741
|
+
f.append("config", u), f.append("file", n), i(!0), fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html", {
|
|
11742
11742
|
method: "POST",
|
|
11743
|
-
body:
|
|
11743
|
+
body: f
|
|
11744
11744
|
}).then((g) => g.json()).then(async (g) => {
|
|
11745
11745
|
h(g.html);
|
|
11746
11746
|
}).catch((g) => {
|
|
@@ -11748,9 +11748,9 @@ function Jd(e) {
|
|
|
11748
11748
|
});
|
|
11749
11749
|
}
|
|
11750
11750
|
}
|
|
11751
|
-
async function h(
|
|
11752
|
-
const
|
|
11753
|
-
e.editor.chain().setContent(
|
|
11751
|
+
async function h(f) {
|
|
11752
|
+
const u = await l(f);
|
|
11753
|
+
e.editor.chain().setContent(u, !0).run(), i(!1);
|
|
11754
11754
|
}
|
|
11755
11755
|
return /* @__PURE__ */ m("div", { children: [
|
|
11756
11756
|
/* @__PURE__ */ r(p, { loading: t, disabled: e == null ? void 0 : e.disabled, icon: e == null ? void 0 : e.icon, tooltip: e == null ? void 0 : e.tooltip, action: c }),
|
|
@@ -11779,7 +11779,7 @@ const Eu = Y.create({
|
|
|
11779
11779
|
button: ({ editor: t, extension: i, t: n }) => {
|
|
11780
11780
|
const { convert: a } = i.options;
|
|
11781
11781
|
return {
|
|
11782
|
-
component:
|
|
11782
|
+
component: Qd,
|
|
11783
11783
|
componentProps: {
|
|
11784
11784
|
convert: a,
|
|
11785
11785
|
action: () => t.commands.setHorizontalRule(),
|
|
@@ -11792,15 +11792,15 @@ const Eu = Y.create({
|
|
|
11792
11792
|
}
|
|
11793
11793
|
};
|
|
11794
11794
|
}
|
|
11795
|
-
}),
|
|
11796
|
-
function
|
|
11797
|
-
if (
|
|
11795
|
+
}), eh = typeof window < "u";
|
|
11796
|
+
function th(e, t) {
|
|
11797
|
+
if (eh) {
|
|
11798
11798
|
const i = window.URL.createObjectURL(e), n = document.createElement("a");
|
|
11799
11799
|
return n.href = i, n.download = t, n.click(), window.URL.revokeObjectURL(i), Promise.resolve();
|
|
11800
11800
|
}
|
|
11801
11801
|
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
11802
11802
|
}
|
|
11803
|
-
const
|
|
11803
|
+
const ih = {
|
|
11804
11804
|
...Ne,
|
|
11805
11805
|
hardBreak: Ne.hard_break,
|
|
11806
11806
|
codeBlock: Ne.code_block,
|
|
@@ -11812,7 +11812,7 @@ const th = {
|
|
|
11812
11812
|
image(e, t) {
|
|
11813
11813
|
e.renderInline(t), e.closeBlock(t);
|
|
11814
11814
|
}
|
|
11815
|
-
},
|
|
11815
|
+
}, nh = new Io(ih, zo), Hu = Y.create({
|
|
11816
11816
|
name: "exportWord",
|
|
11817
11817
|
addOptions() {
|
|
11818
11818
|
var e;
|
|
@@ -11841,22 +11841,22 @@ const th = {
|
|
|
11841
11841
|
const o = await (await fetch(n)).arrayBuffer();
|
|
11842
11842
|
return new Uint8Array(o);
|
|
11843
11843
|
}
|
|
11844
|
-
}, i =
|
|
11845
|
-
return Eo.toBlob(i).then((n) =>
|
|
11844
|
+
}, i = nh.serialize(e.state.doc, t);
|
|
11845
|
+
return Eo.toBlob(i).then((n) => th(new Blob([n]), "export-document.docx")), !0;
|
|
11846
11846
|
}
|
|
11847
11847
|
};
|
|
11848
11848
|
}
|
|
11849
|
-
}),
|
|
11850
|
-
toc:
|
|
11851
|
-
visible:
|
|
11852
|
-
list:
|
|
11853
|
-
item:
|
|
11849
|
+
}), rh = "_toc_aag8a_1", ah = "_visible_aag8a_7", oh = "_list_aag8a_11", ch = "_item_aag8a_16", _t = {
|
|
11850
|
+
toc: rh,
|
|
11851
|
+
visible: ah,
|
|
11852
|
+
list: oh,
|
|
11853
|
+
item: ch,
|
|
11854
11854
|
"item--3": "_item--3_aag8a_19",
|
|
11855
11855
|
"item--4": "_item--4_aag8a_22",
|
|
11856
11856
|
"item--5": "_item--5_aag8a_25",
|
|
11857
11857
|
"item--6": "_item--6_aag8a_28"
|
|
11858
11858
|
};
|
|
11859
|
-
function
|
|
11859
|
+
function sh(e) {
|
|
11860
11860
|
const t = [], i = [t];
|
|
11861
11861
|
return e.forEach((n) => {
|
|
11862
11862
|
let a = -1, o = i[n.level + a];
|
|
@@ -11865,8 +11865,8 @@ function ch(e) {
|
|
|
11865
11865
|
o.push({ ...n, children: i[n.level] = [] });
|
|
11866
11866
|
}), t;
|
|
11867
11867
|
}
|
|
11868
|
-
function
|
|
11869
|
-
const t = Dt(), [i, n] = w([]), { t: a } = B(), o =
|
|
11868
|
+
function lh({ editor: e }) {
|
|
11869
|
+
const t = Dt(), [i, n] = w([]), { t: a } = B(), o = T(() => {
|
|
11870
11870
|
const c = [], s = e.state.tr;
|
|
11871
11871
|
e.state.doc.descendants((l, d) => {
|
|
11872
11872
|
if (l.type.name === "heading") {
|
|
@@ -11880,7 +11880,7 @@ function sh({ editor: e }) {
|
|
|
11880
11880
|
id: h
|
|
11881
11881
|
});
|
|
11882
11882
|
}
|
|
11883
|
-
}), s.setMeta("addToHistory", !1), s.setMeta("preventUpdate", !0), e.view.dispatch(s), n(c), e.eventEmitter && e.eventEmitter.emit("TableOfContents",
|
|
11883
|
+
}), s.setMeta("addToHistory", !1), s.setMeta("preventUpdate", !0), e.view.dispatch(s), n(c), e.eventEmitter && e.eventEmitter.emit("TableOfContents", sh(c));
|
|
11884
11884
|
}, [e]);
|
|
11885
11885
|
return H(() => {
|
|
11886
11886
|
if (e) {
|
|
@@ -11899,10 +11899,10 @@ function sh({ editor: e }) {
|
|
|
11899
11899
|
/* @__PURE__ */ r("ul", { className: _t.list, children: i.map((c, s) => /* @__PURE__ */ r("li", { className: _t.item, style: { paddingLeft: `${c.level - 1}rem` }, children: /* @__PURE__ */ r("a", { href: `#${c.id}`, children: c.text }) }, `table-of-content-${s}`)) })
|
|
11900
11900
|
] }) : null });
|
|
11901
11901
|
}
|
|
11902
|
-
function
|
|
11902
|
+
function dh(e) {
|
|
11903
11903
|
return e && e.type.name === "title";
|
|
11904
11904
|
}
|
|
11905
|
-
function
|
|
11905
|
+
function hh(e, t) {
|
|
11906
11906
|
const n = [e.getJSON()], a = [];
|
|
11907
11907
|
for (; n.length; ) {
|
|
11908
11908
|
const o = n.shift();
|
|
@@ -11910,7 +11910,7 @@ function dh(e, t) {
|
|
|
11910
11910
|
}
|
|
11911
11911
|
return a;
|
|
11912
11912
|
}
|
|
11913
|
-
function
|
|
11913
|
+
function uh(e, ...t) {
|
|
11914
11914
|
const [i, n] = w(!1);
|
|
11915
11915
|
return H(() => {
|
|
11916
11916
|
const a = () => {
|
|
@@ -11921,8 +11921,8 @@ function hh(e, ...t) {
|
|
|
11921
11921
|
};
|
|
11922
11922
|
}, [e, t, n]), i;
|
|
11923
11923
|
}
|
|
11924
|
-
function
|
|
11925
|
-
const n =
|
|
11924
|
+
function mh({ editor: e, icon: t, tooltip: i }) {
|
|
11925
|
+
const n = uh(e, fh.name), a = T(() => {
|
|
11926
11926
|
if (n) {
|
|
11927
11927
|
e.chain().focus().removeTableOfContents().run();
|
|
11928
11928
|
return;
|
|
@@ -11939,7 +11939,7 @@ function uh({ editor: e, icon: t, tooltip: i }) {
|
|
|
11939
11939
|
}
|
|
11940
11940
|
);
|
|
11941
11941
|
}
|
|
11942
|
-
const
|
|
11942
|
+
const fh = ue.create({
|
|
11943
11943
|
name: "tableOfContents",
|
|
11944
11944
|
group: "block",
|
|
11945
11945
|
atom: !0,
|
|
@@ -11953,7 +11953,7 @@ const mh = ue.create({
|
|
|
11953
11953
|
lastColumnResizable: !0,
|
|
11954
11954
|
allowTableNodeSelection: !1,
|
|
11955
11955
|
button: ({ editor: t, t: i }) => ({
|
|
11956
|
-
component:
|
|
11956
|
+
component: mh,
|
|
11957
11957
|
componentProps: {
|
|
11958
11958
|
disabled: !1,
|
|
11959
11959
|
icon: "BookMarked",
|
|
@@ -11974,18 +11974,18 @@ const mh = ue.create({
|
|
|
11974
11974
|
return ["toc", ne(e)];
|
|
11975
11975
|
},
|
|
11976
11976
|
addNodeView() {
|
|
11977
|
-
return ge(
|
|
11977
|
+
return ge(lh);
|
|
11978
11978
|
},
|
|
11979
11979
|
// @ts-expect-error
|
|
11980
11980
|
addCommands() {
|
|
11981
11981
|
return {
|
|
11982
11982
|
setTableOfContents: () => ({ commands: e, editor: t, view: i }) => {
|
|
11983
|
-
if (
|
|
11983
|
+
if (hh(t, this.name).length) {
|
|
11984
11984
|
this.options.onHasOneBeforeInsert();
|
|
11985
11985
|
return;
|
|
11986
11986
|
}
|
|
11987
11987
|
const a = i.props.state.doc.content.firstChild;
|
|
11988
|
-
if (
|
|
11988
|
+
if (dh(a)) {
|
|
11989
11989
|
const o = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
|
|
11990
11990
|
return e.insertContentAt(o, { type: this.name });
|
|
11991
11991
|
}
|
|
@@ -12017,9 +12017,9 @@ const mh = ue.create({
|
|
|
12017
12017
|
];
|
|
12018
12018
|
}
|
|
12019
12019
|
});
|
|
12020
|
-
function
|
|
12020
|
+
function gh(e) {
|
|
12021
12021
|
var i;
|
|
12022
|
-
const t =
|
|
12022
|
+
const t = P(() => {
|
|
12023
12023
|
var o;
|
|
12024
12024
|
const n = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((c) => c.isActive());
|
|
12025
12025
|
return n && !n.default ? {
|
|
@@ -12039,7 +12039,7 @@ function fh(e) {
|
|
|
12039
12039
|
icon: e == null ? void 0 : e.icon,
|
|
12040
12040
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
12041
12041
|
disabled: e == null ? void 0 : e.disabled,
|
|
12042
|
-
children: /* @__PURE__ */ r(
|
|
12042
|
+
children: /* @__PURE__ */ r(j, { className: "richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500", name: "MenuDown" })
|
|
12043
12043
|
}
|
|
12044
12044
|
) }),
|
|
12045
12045
|
/* @__PURE__ */ r(
|
|
@@ -12059,7 +12059,7 @@ function fh(e) {
|
|
|
12059
12059
|
className: "richtext-p-1 richtext-w-7 richtext-h-7",
|
|
12060
12060
|
pressed: t.title === n.title,
|
|
12061
12061
|
"data-state": t.title === n.title ? "on" : "off",
|
|
12062
|
-
children: (n == null ? void 0 : n.icon) && /* @__PURE__ */ r(
|
|
12062
|
+
children: (n == null ? void 0 : n.icon) && /* @__PURE__ */ r(j, { name: n.icon })
|
|
12063
12063
|
}
|
|
12064
12064
|
) }),
|
|
12065
12065
|
/* @__PURE__ */ m(Ee, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
@@ -12096,17 +12096,17 @@ const Ru = Y.create({
|
|
|
12096
12096
|
icon: o[d],
|
|
12097
12097
|
isActive: () => !1,
|
|
12098
12098
|
action: () => {
|
|
12099
|
-
var h,
|
|
12099
|
+
var h, f, u, g;
|
|
12100
12100
|
if (d === "auto") {
|
|
12101
|
-
(
|
|
12101
|
+
(f = (h = t.commands) == null ? void 0 : h.unsetTextDirection) == null || f.call(h);
|
|
12102
12102
|
return;
|
|
12103
12103
|
}
|
|
12104
|
-
(g = (
|
|
12104
|
+
(g = (u = t.commands) == null ? void 0 : u.setTextDirection) == null || g.call(u, d);
|
|
12105
12105
|
},
|
|
12106
12106
|
disabled: !1
|
|
12107
12107
|
})), s = c.filter((d) => d.disabled).length === c.length;
|
|
12108
12108
|
return {
|
|
12109
|
-
component:
|
|
12109
|
+
component: gh,
|
|
12110
12110
|
componentProps: {
|
|
12111
12111
|
icon: "TextDirection",
|
|
12112
12112
|
tooltip: n("editor.textDirection.tooltip"),
|
|
@@ -12138,11 +12138,11 @@ const Ru = Y.create({
|
|
|
12138
12138
|
unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
|
|
12139
12139
|
};
|
|
12140
12140
|
}
|
|
12141
|
-
}),
|
|
12142
|
-
listUsers:
|
|
12143
|
-
itemUser:
|
|
12144
|
-
selectedUser:
|
|
12145
|
-
},
|
|
12141
|
+
}), xh = "_listUsers_en3pm_1", bh = "_itemUser_en3pm_10", ph = "_selectedUser_en3pm_31", vt = {
|
|
12142
|
+
listUsers: xh,
|
|
12143
|
+
itemUser: bh,
|
|
12144
|
+
selectedUser: ph
|
|
12145
|
+
}, wh = Lt((e, t) => {
|
|
12146
12146
|
const i = J(), [n, a] = w(0), o = (d) => {
|
|
12147
12147
|
const h = e.items[d];
|
|
12148
12148
|
h && e.command({ id: h, label: h });
|
|
@@ -12169,7 +12169,7 @@ const Ru = Y.create({
|
|
|
12169
12169
|
},
|
|
12170
12170
|
h
|
|
12171
12171
|
)) : /* @__PURE__ */ r("div", { className: ee("itemUserEmpty", vt.itemUser), children: "Empty" }) }) });
|
|
12172
|
-
}),
|
|
12172
|
+
}), _h = [
|
|
12173
12173
|
{
|
|
12174
12174
|
id: "1",
|
|
12175
12175
|
name: "John Doe"
|
|
@@ -12186,13 +12186,13 @@ const Ru = Y.create({
|
|
|
12186
12186
|
id: "4",
|
|
12187
12187
|
name: "Bob"
|
|
12188
12188
|
}
|
|
12189
|
-
],
|
|
12190
|
-
items: async ({ query: e }) =>
|
|
12189
|
+
], vh = {
|
|
12190
|
+
items: async ({ query: e }) => _h.map((i) => i.name).filter((i) => i.toLowerCase().startsWith(e.toLowerCase())),
|
|
12191
12191
|
render: () => {
|
|
12192
12192
|
let e, t;
|
|
12193
12193
|
return {
|
|
12194
12194
|
onStart: (i) => {
|
|
12195
|
-
e = new ci(
|
|
12195
|
+
e = new ci(wh, {
|
|
12196
12196
|
props: i,
|
|
12197
12197
|
editor: i.editor
|
|
12198
12198
|
}), t = fi("body", {
|
|
@@ -12236,9 +12236,9 @@ const Ru = Y.create({
|
|
|
12236
12236
|
HTMLAttributes: {
|
|
12237
12237
|
class: "mention"
|
|
12238
12238
|
},
|
|
12239
|
-
suggestion:
|
|
12239
|
+
suggestion: vh
|
|
12240
12240
|
});
|
|
12241
|
-
function
|
|
12241
|
+
function yh(e) {
|
|
12242
12242
|
const t = _o.renderToStaticMarkup(e), a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
|
|
12243
12243
|
"svg",
|
|
12244
12244
|
{
|
|
@@ -12255,7 +12255,7 @@ function vh(e) {
|
|
|
12255
12255
|
}
|
|
12256
12256
|
}), o;
|
|
12257
12257
|
}
|
|
12258
|
-
const
|
|
12258
|
+
const kh = {
|
|
12259
12259
|
audio: /* @__PURE__ */ r(ba, {}),
|
|
12260
12260
|
video: /* @__PURE__ */ r(pa, {}),
|
|
12261
12261
|
file: /* @__PURE__ */ r(wa, {}),
|
|
@@ -12266,18 +12266,18 @@ const yh = {
|
|
|
12266
12266
|
ppt: /* @__PURE__ */ r(ya, {})
|
|
12267
12267
|
};
|
|
12268
12268
|
function Qn(e, t = !1) {
|
|
12269
|
-
const i = Ec(e), n =
|
|
12270
|
-
return t ?
|
|
12269
|
+
const i = Ec(e), n = kh[i] || /* @__PURE__ */ r(W, {});
|
|
12270
|
+
return t ? yh(n) : n;
|
|
12271
12271
|
}
|
|
12272
|
-
const
|
|
12273
|
-
attachment:
|
|
12274
|
-
wrap:
|
|
12272
|
+
const Ch = "_attachment_1x1ms_1", Nh = "_wrap_1x1ms_2", qt = {
|
|
12273
|
+
attachment: Ch,
|
|
12274
|
+
wrap: Nh
|
|
12275
12275
|
};
|
|
12276
|
-
function
|
|
12276
|
+
function Th({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension: a }) {
|
|
12277
12277
|
var N;
|
|
12278
|
-
const o = J(), c = Dt(), { hasTrigger: s, fileName: l, fileSize: d, fileExt: h, fileType:
|
|
12279
|
-
!c ||
|
|
12280
|
-
}, [c,
|
|
12278
|
+
const o = J(), c = Dt(), { hasTrigger: s, fileName: l, fileSize: d, fileExt: h, fileType: f, url: u, error: g } = t.attrs, [x, b] = w(!1), { t: C } = B(), A = (N = a == null ? void 0 : a.options) == null ? void 0 : N.upload, v = T(() => {
|
|
12279
|
+
!c || u || c && o.current.click();
|
|
12280
|
+
}, [c, u]), _ = T(
|
|
12281
12281
|
async (I) => {
|
|
12282
12282
|
const O = I.target.files && I.target.files[0];
|
|
12283
12283
|
if (!O)
|
|
@@ -12290,7 +12290,7 @@ function Nh({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
12290
12290
|
};
|
|
12291
12291
|
b(!0);
|
|
12292
12292
|
try {
|
|
12293
|
-
const L = await
|
|
12293
|
+
const L = await A(O);
|
|
12294
12294
|
i({ ...M, url: L }), b(!1);
|
|
12295
12295
|
} catch (L) {
|
|
12296
12296
|
i({ error: `File upload fail: ${L && L.message}` || "Unknown error" }), b(!1), o.current.value = "";
|
|
@@ -12299,15 +12299,15 @@ function Nh({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
12299
12299
|
[b, i]
|
|
12300
12300
|
);
|
|
12301
12301
|
H(() => {
|
|
12302
|
-
!
|
|
12303
|
-
}, [
|
|
12304
|
-
const k =
|
|
12305
|
-
return c && !
|
|
12302
|
+
!u && !s && (v(), i({ hasTrigger: !0 }));
|
|
12303
|
+
}, [u, s, v, i]);
|
|
12304
|
+
const k = T(() => n(), [e]);
|
|
12305
|
+
return c && !u ? /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ m("div", { className: ee(qt.wrap, "render-wrapper"), children: [
|
|
12306
12306
|
/* @__PURE__ */ r("p", { style: { cursor: "pointer" }, onClick: v, children: x ? /* @__PURE__ */ r("span", { children: C("editor.attachment.uploading") }) : /* @__PURE__ */ r("span", { children: C("editor.attachment.please_upload") }) }),
|
|
12307
12307
|
/* @__PURE__ */ r("input", { ref: o, type: "file", hidden: !0, onChange: _ })
|
|
12308
|
-
] }) }) :
|
|
12308
|
+
] }) }) : u ? /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ m("div", { className: ee(qt.wrap, "render-wrapper"), onClick: v, children: [
|
|
12309
12309
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
12310
|
-
/* @__PURE__ */ r("span", { children: Qn(
|
|
12310
|
+
/* @__PURE__ */ r("span", { children: Qn(f) }),
|
|
12311
12311
|
/* @__PURE__ */ m("span", { children: [
|
|
12312
12312
|
l,
|
|
12313
12313
|
".",
|
|
@@ -12327,7 +12327,7 @@ function Nh({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
12327
12327
|
tooltip: C("editor.delete")
|
|
12328
12328
|
}
|
|
12329
12329
|
)
|
|
12330
|
-
] }) }) : g !== "null" ? /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r("div", { className: ee(qt.wrap, "render-wrapper"), onClick: v, children: /* @__PURE__ */ r("p", { children: g }) }) }) : /* @__PURE__ */ r(
|
|
12330
|
+
] }) }) : g !== "null" ? /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r("div", { className: ee(qt.wrap, "render-wrapper"), onClick: v, children: /* @__PURE__ */ r("p", { children: g }) }) }) : /* @__PURE__ */ r(W, {});
|
|
12331
12331
|
}
|
|
12332
12332
|
const Pu = ue.create({
|
|
12333
12333
|
name: "attachment",
|
|
@@ -12428,7 +12428,7 @@ const Pu = ue.create({
|
|
|
12428
12428
|
};
|
|
12429
12429
|
},
|
|
12430
12430
|
addNodeView() {
|
|
12431
|
-
return ge(
|
|
12431
|
+
return ge(Th);
|
|
12432
12432
|
}
|
|
12433
12433
|
}), yt = {
|
|
12434
12434
|
TOP_LEFT: "tl",
|
|
@@ -12436,7 +12436,7 @@ const Pu = ue.create({
|
|
|
12436
12436
|
BOTTOM_LEFT: "bl",
|
|
12437
12437
|
BOTTOM_RIGHT: "br"
|
|
12438
12438
|
};
|
|
12439
|
-
function
|
|
12439
|
+
function Ah(e) {
|
|
12440
12440
|
var I, O;
|
|
12441
12441
|
const [t, i] = w({
|
|
12442
12442
|
width: Ge,
|
|
@@ -12455,7 +12455,7 @@ function Th(e) {
|
|
|
12455
12455
|
w: 0,
|
|
12456
12456
|
h: 0,
|
|
12457
12457
|
dir: ""
|
|
12458
|
-
}), { align: h } = (I = e == null ? void 0 : e.node) == null ? void 0 : I.attrs,
|
|
12458
|
+
}), { align: h } = (I = e == null ? void 0 : e.node) == null ? void 0 : I.attrs, f = P(() => {
|
|
12459
12459
|
var E;
|
|
12460
12460
|
const { src: M, alt: L, width: S, height: y } = (E = e == null ? void 0 : e.node) == null ? void 0 : E.attrs, $ = Nt(S) ? `${S}px` : S, R = Nt(y) ? `${y}px` : y;
|
|
12461
12461
|
return {
|
|
@@ -12466,12 +12466,12 @@ function Th(e) {
|
|
|
12466
12466
|
height: R || void 0
|
|
12467
12467
|
}
|
|
12468
12468
|
};
|
|
12469
|
-
}, [(O = e == null ? void 0 : e.node) == null ? void 0 : O.attrs]),
|
|
12469
|
+
}, [(O = e == null ? void 0 : e.node) == null ? void 0 : O.attrs]), u = P(() => {
|
|
12470
12470
|
const {
|
|
12471
12471
|
style: { width: M }
|
|
12472
|
-
} =
|
|
12472
|
+
} = f;
|
|
12473
12473
|
return { width: M === "100%" ? M : void 0 };
|
|
12474
|
-
}, [
|
|
12474
|
+
}, [f]);
|
|
12475
12475
|
function g(M) {
|
|
12476
12476
|
a({
|
|
12477
12477
|
width: M.target.width,
|
|
@@ -12482,7 +12482,7 @@ function Th(e) {
|
|
|
12482
12482
|
const { editor: M, getPos: L } = e;
|
|
12483
12483
|
M.commands.setNodeSelection(L());
|
|
12484
12484
|
}
|
|
12485
|
-
const b =
|
|
12485
|
+
const b = T(
|
|
12486
12486
|
Se(() => {
|
|
12487
12487
|
const { editor: M } = e, { width: L } = getComputedStyle(M.view.dom);
|
|
12488
12488
|
i((S) => ({
|
|
@@ -12507,7 +12507,7 @@ function Th(e) {
|
|
|
12507
12507
|
});
|
|
12508
12508
|
});
|
|
12509
12509
|
}
|
|
12510
|
-
const
|
|
12510
|
+
const A = T(
|
|
12511
12511
|
Se((M) => {
|
|
12512
12512
|
if (M.preventDefault(), M.stopPropagation(), !c)
|
|
12513
12513
|
return;
|
|
@@ -12518,7 +12518,7 @@ function Th(e) {
|
|
|
12518
12518
|
});
|
|
12519
12519
|
}, Ke),
|
|
12520
12520
|
[c, l, t, e.updateAttributes]
|
|
12521
|
-
), v =
|
|
12521
|
+
), v = T(
|
|
12522
12522
|
(M) => {
|
|
12523
12523
|
M.preventDefault(), M.stopPropagation(), c && (Xe(() => {
|
|
12524
12524
|
d({
|
|
@@ -12531,31 +12531,31 @@ function Th(e) {
|
|
|
12531
12531
|
}), x());
|
|
12532
12532
|
},
|
|
12533
12533
|
[c, x]
|
|
12534
|
-
), _ =
|
|
12535
|
-
document == null || document.addEventListener("mousemove",
|
|
12536
|
-
}, [
|
|
12537
|
-
document == null || document.removeEventListener("mousemove",
|
|
12538
|
-
}, [
|
|
12534
|
+
), _ = T(() => {
|
|
12535
|
+
document == null || document.addEventListener("mousemove", A, !0), document == null || document.addEventListener("mouseup", v, !0);
|
|
12536
|
+
}, [A, v]), k = T(() => {
|
|
12537
|
+
document == null || document.removeEventListener("mousemove", A, !0), document == null || document.removeEventListener("mouseup", v, !0);
|
|
12538
|
+
}, [A, v]);
|
|
12539
12539
|
H(() => (c ? _() : k(), () => {
|
|
12540
12540
|
k();
|
|
12541
12541
|
}), [c, _, k]);
|
|
12542
|
-
const N =
|
|
12542
|
+
const N = P(() => new ResizeObserver(() => b()), [b]);
|
|
12543
12543
|
return H(() => (N.observe(e.editor.view.dom), () => {
|
|
12544
12544
|
N.disconnect();
|
|
12545
|
-
}), [e.editor.view.dom, N]), /* @__PURE__ */ r(ae, { className: "image-view", style: { ...
|
|
12545
|
+
}), [e.editor.view.dom, N]), /* @__PURE__ */ r(ae, { className: "image-view", style: { ...u, width: "100%", textAlign: h }, children: /* @__PURE__ */ m(
|
|
12546
12546
|
"div",
|
|
12547
12547
|
{
|
|
12548
12548
|
draggable: "true",
|
|
12549
12549
|
"data-drag-handle": !0,
|
|
12550
12550
|
className: `image-view__body ${e != null && e.selected ? "image-view__body--focused" : ""} ${c ? "image-view__body--resizing" : ""}`,
|
|
12551
|
-
style:
|
|
12551
|
+
style: u,
|
|
12552
12552
|
children: [
|
|
12553
12553
|
/* @__PURE__ */ r(
|
|
12554
12554
|
"img",
|
|
12555
12555
|
{
|
|
12556
|
-
src:
|
|
12557
|
-
alt:
|
|
12558
|
-
style:
|
|
12556
|
+
src: f.src,
|
|
12557
|
+
alt: f.alt,
|
|
12558
|
+
style: f.style,
|
|
12559
12559
|
height: "auto",
|
|
12560
12560
|
className: "image-view__body__image block",
|
|
12561
12561
|
onLoad: g,
|
|
@@ -12574,12 +12574,12 @@ function Th(e) {
|
|
|
12574
12574
|
}
|
|
12575
12575
|
) });
|
|
12576
12576
|
}
|
|
12577
|
-
function
|
|
12577
|
+
function Lh({ selectImage: e, giphyApiKey: t, children: i }) {
|
|
12578
12578
|
const [n, a] = w([]), [o] = w(15), c = J(null), s = (d, h = "search") => {
|
|
12579
12579
|
if (!t)
|
|
12580
12580
|
return;
|
|
12581
|
-
const
|
|
12582
|
-
fetch(
|
|
12581
|
+
const u = `${h === "search" ? `https://api.giphy.com/v1/gifs/search?q=${d}` : `https://api.giphy.com/v1/gifs/trending?q=${d}`}&limit=${o}&api_key=${t}`;
|
|
12582
|
+
fetch(u).then((g) => g.json()).then((g) => {
|
|
12583
12583
|
a(g.data);
|
|
12584
12584
|
}).catch((g) => {
|
|
12585
12585
|
console.log(g);
|
|
@@ -12588,7 +12588,7 @@ function Ah({ selectImage: e, giphyApiKey: t, children: i }) {
|
|
|
12588
12588
|
H(() => {
|
|
12589
12589
|
s("", "trend");
|
|
12590
12590
|
}, []);
|
|
12591
|
-
const l =
|
|
12591
|
+
const l = T(
|
|
12592
12592
|
hi((d) => {
|
|
12593
12593
|
if (!d.target.value) {
|
|
12594
12594
|
s("", "trend");
|
|
@@ -12601,7 +12601,7 @@ function Ah({ selectImage: e, giphyApiKey: t, children: i }) {
|
|
|
12601
12601
|
);
|
|
12602
12602
|
return /* @__PURE__ */ m(se, { modal: !0, children: [
|
|
12603
12603
|
/* @__PURE__ */ r(le, { asChild: !0, children: i }),
|
|
12604
|
-
/* @__PURE__ */ r(re, { hideWhenDetached: !0, className: "richtext-w-full richtext-h-full richtext-p-2", align: "start", side: "bottom", children: t ? /* @__PURE__ */ m(
|
|
12604
|
+
/* @__PURE__ */ r(re, { hideWhenDetached: !0, className: "richtext-w-full richtext-h-full richtext-p-2", align: "start", side: "bottom", children: t ? /* @__PURE__ */ m(W, { children: [
|
|
12605
12605
|
/* @__PURE__ */ r("div", { className: "richtext-w-full richtext-mb-[10px]", children: /* @__PURE__ */ r(
|
|
12606
12606
|
te,
|
|
12607
12607
|
{
|
|
@@ -12626,9 +12626,9 @@ function Ah({ selectImage: e, giphyApiKey: t, children: i }) {
|
|
|
12626
12626
|
] }) : /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children: "Missing Giphy API Key" }) }) })
|
|
12627
12627
|
] });
|
|
12628
12628
|
}
|
|
12629
|
-
function
|
|
12629
|
+
function Sh({ editor: e, icon: t, giphyApiKey: i, ...n }) {
|
|
12630
12630
|
return /* @__PURE__ */ r(
|
|
12631
|
-
|
|
12631
|
+
Lh,
|
|
12632
12632
|
{
|
|
12633
12633
|
selectImage: (o) => {
|
|
12634
12634
|
const { url: c } = o.images.original;
|
|
@@ -12663,7 +12663,7 @@ const er = si.extend({
|
|
|
12663
12663
|
var o;
|
|
12664
12664
|
const a = ((o = i == null ? void 0 : i.options) == null ? void 0 : o.GIPHY_API_KEY) || "";
|
|
12665
12665
|
return {
|
|
12666
|
-
component:
|
|
12666
|
+
component: Sh,
|
|
12667
12667
|
componentProps: {
|
|
12668
12668
|
editor: t,
|
|
12669
12669
|
action: () => {
|
|
@@ -12702,7 +12702,7 @@ const er = si.extend({
|
|
|
12702
12702
|
};
|
|
12703
12703
|
},
|
|
12704
12704
|
addNodeView() {
|
|
12705
|
-
return ge(
|
|
12705
|
+
return ge(Ah);
|
|
12706
12706
|
},
|
|
12707
12707
|
addCommands() {
|
|
12708
12708
|
var e;
|
|
@@ -12756,10 +12756,10 @@ const er = si.extend({
|
|
|
12756
12756
|
];
|
|
12757
12757
|
}
|
|
12758
12758
|
}), Qi = `graph TB
|
|
12759
|
-
a-->b`,
|
|
12760
|
-
const [i, n] = w(Qi), [a, o] = w(""), [c, s] = w(!1), l = J(null), d = async (
|
|
12759
|
+
a-->b`, Mh = ({ editor: e, upload: t }) => {
|
|
12760
|
+
const [i, n] = w(Qi), [a, o] = w(""), [c, s] = w(!1), l = J(null), d = async (u) => {
|
|
12761
12761
|
try {
|
|
12762
|
-
const { svg: g } = await At.render("mermaid-svg",
|
|
12762
|
+
const { svg: g } = await At.render("mermaid-svg", u);
|
|
12763
12763
|
o(g);
|
|
12764
12764
|
} catch {
|
|
12765
12765
|
o("");
|
|
@@ -12799,7 +12799,7 @@ a-->b`, Sh = ({ editor: e, upload: t }) => {
|
|
|
12799
12799
|
{
|
|
12800
12800
|
className: "richtext-flex-1",
|
|
12801
12801
|
value: i,
|
|
12802
|
-
onChange: (
|
|
12802
|
+
onChange: (u) => n(u.target.value),
|
|
12803
12803
|
autoFocus: !0,
|
|
12804
12804
|
required: !0,
|
|
12805
12805
|
rows: 10,
|
|
@@ -12827,11 +12827,11 @@ a-->b`, Sh = ({ editor: e, upload: t }) => {
|
|
|
12827
12827
|
onClick: async () => {
|
|
12828
12828
|
if (i !== "") {
|
|
12829
12829
|
if (i) {
|
|
12830
|
-
const
|
|
12831
|
-
let C = hn(
|
|
12830
|
+
const u = l.current.querySelector("svg"), { width: g, height: x } = u.getBoundingClientRect(), b = `mermaid-${Hn()}.svg`;
|
|
12831
|
+
let C = hn(u.outerHTML);
|
|
12832
12832
|
if (t) {
|
|
12833
|
-
const
|
|
12834
|
-
C = await t(
|
|
12833
|
+
const A = vi(C, b);
|
|
12834
|
+
C = await t(A);
|
|
12835
12835
|
}
|
|
12836
12836
|
e == null || e.chain().focus().setMermaid(
|
|
12837
12837
|
{
|
|
@@ -12860,7 +12860,7 @@ a-->b`, Sh = ({ editor: e, upload: t }) => {
|
|
|
12860
12860
|
BOTTOM_LEFT: "bl",
|
|
12861
12861
|
BOTTOM_RIGHT: "br"
|
|
12862
12862
|
};
|
|
12863
|
-
function
|
|
12863
|
+
function Ih({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a }) {
|
|
12864
12864
|
const [o, c] = w({
|
|
12865
12865
|
width: Ge,
|
|
12866
12866
|
height: Ge
|
|
@@ -12872,13 +12872,13 @@ function Mh({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12872
12872
|
kt.TOP_RIGHT,
|
|
12873
12873
|
kt.BOTTOM_LEFT,
|
|
12874
12874
|
kt.BOTTOM_RIGHT
|
|
12875
|
-
]), [h,
|
|
12875
|
+
]), [h, f] = w(!1), [u, g] = w({
|
|
12876
12876
|
x: 0,
|
|
12877
12877
|
y: 0,
|
|
12878
12878
|
w: 0,
|
|
12879
12879
|
h: 0,
|
|
12880
12880
|
dir: ""
|
|
12881
|
-
}), { align: x } = t == null ? void 0 : t.attrs, b =
|
|
12881
|
+
}), { align: x } = t == null ? void 0 : t.attrs, b = P(() => {
|
|
12882
12882
|
const { src: S, alt: y, width: $, height: R } = t == null ? void 0 : t.attrs, E = Mi($) ? `${$}px` : $, z = Mi(R) ? `${R}px` : R;
|
|
12883
12883
|
return {
|
|
12884
12884
|
src: S || void 0,
|
|
@@ -12888,13 +12888,13 @@ function Mh({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12888
12888
|
height: z || void 0
|
|
12889
12889
|
}
|
|
12890
12890
|
};
|
|
12891
|
-
}, [t == null ? void 0 : t.attrs]), C =
|
|
12891
|
+
}, [t == null ? void 0 : t.attrs]), C = P(() => {
|
|
12892
12892
|
const {
|
|
12893
12893
|
style: { width: S }
|
|
12894
12894
|
} = b;
|
|
12895
12895
|
return { width: S === "100%" ? S : void 0 };
|
|
12896
12896
|
}, [b]);
|
|
12897
|
-
function
|
|
12897
|
+
function A(S) {
|
|
12898
12898
|
l({
|
|
12899
12899
|
width: S.target.width,
|
|
12900
12900
|
height: S.target.height
|
|
@@ -12903,7 +12903,7 @@ function Mh({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12903
12903
|
function v() {
|
|
12904
12904
|
e.commands.setNodeSelection(n());
|
|
12905
12905
|
}
|
|
12906
|
-
const _ =
|
|
12906
|
+
const _ = T(
|
|
12907
12907
|
Se(() => {
|
|
12908
12908
|
const { width: S } = getComputedStyle(e.view.dom);
|
|
12909
12909
|
c((y) => ({
|
|
@@ -12919,7 +12919,7 @@ function Mh({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12919
12919
|
let z = Number(t.attrs.width), G = Number(t.attrs.height);
|
|
12920
12920
|
const X = o.width;
|
|
12921
12921
|
z && !G ? (z = z > X ? X : z, G = Math.round(z / E)) : G && !z ? (z = Math.round(G * E), z = z > X ? X : z) : !z && !G ? (z = $ > X ? X : $, G = Math.round(z / E)) : z = z > X ? X : z, Xe(() => {
|
|
12922
|
-
|
|
12922
|
+
f(!0), g({
|
|
12923
12923
|
x: S.clientX,
|
|
12924
12924
|
y: S.clientY,
|
|
12925
12925
|
w: z,
|
|
@@ -12928,18 +12928,18 @@ function Mh({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12928
12928
|
});
|
|
12929
12929
|
});
|
|
12930
12930
|
}
|
|
12931
|
-
const N =
|
|
12931
|
+
const N = T(
|
|
12932
12932
|
Se((S) => {
|
|
12933
12933
|
if (S.preventDefault(), S.stopPropagation(), !h)
|
|
12934
12934
|
return;
|
|
12935
|
-
const { x: y, w: $, dir: R } =
|
|
12935
|
+
const { x: y, w: $, dir: R } = u, E = (S.clientX - y) * (/l/.test(R) ? -1 : 1), z = Sn($ + E, ui, o.width);
|
|
12936
12936
|
i({
|
|
12937
12937
|
width: z,
|
|
12938
12938
|
height: null
|
|
12939
12939
|
});
|
|
12940
12940
|
}, Ke),
|
|
12941
|
-
[h,
|
|
12942
|
-
), I =
|
|
12941
|
+
[h, u, o, i]
|
|
12942
|
+
), I = T(
|
|
12943
12943
|
(S) => {
|
|
12944
12944
|
S.preventDefault(), S.stopPropagation(), h && (Xe(() => {
|
|
12945
12945
|
g({
|
|
@@ -12948,19 +12948,19 @@ function Mh({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12948
12948
|
w: 0,
|
|
12949
12949
|
h: 0,
|
|
12950
12950
|
dir: ""
|
|
12951
|
-
}),
|
|
12951
|
+
}), f(!1);
|
|
12952
12952
|
}), v());
|
|
12953
12953
|
},
|
|
12954
12954
|
[h, v]
|
|
12955
|
-
), O =
|
|
12955
|
+
), O = T(() => {
|
|
12956
12956
|
document == null || document.addEventListener("mousemove", N, !0), document == null || document.addEventListener("mouseup", I, !0);
|
|
12957
|
-
}, [N, I]), M =
|
|
12957
|
+
}, [N, I]), M = T(() => {
|
|
12958
12958
|
document == null || document.removeEventListener("mousemove", N, !0), document == null || document.removeEventListener("mouseup", I, !0);
|
|
12959
12959
|
}, [N, I]);
|
|
12960
12960
|
H(() => (h ? O() : M(), () => {
|
|
12961
12961
|
M();
|
|
12962
12962
|
}), [h, O, M]);
|
|
12963
|
-
const L =
|
|
12963
|
+
const L = P(() => new ResizeObserver(() => _()), [_]);
|
|
12964
12964
|
return H(() => (L.observe(e.view.dom), () => {
|
|
12965
12965
|
L.disconnect();
|
|
12966
12966
|
}), [e.view.dom, L]), /* @__PURE__ */ r(ae, { className: "image-view", style: { ...C, width: "100%", textAlign: x }, children: /* @__PURE__ */ m(
|
|
@@ -12979,7 +12979,7 @@ function Mh({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12979
12979
|
style: b.style,
|
|
12980
12980
|
height: "auto",
|
|
12981
12981
|
className: "image-view__body__image block",
|
|
12982
|
-
onLoad:
|
|
12982
|
+
onLoad: A,
|
|
12983
12983
|
onClick: v
|
|
12984
12984
|
}
|
|
12985
12985
|
),
|
|
@@ -13014,7 +13014,7 @@ const en = si.extend({
|
|
|
13014
13014
|
button: ({ editor: t, t: i, extension: n }) => {
|
|
13015
13015
|
var a;
|
|
13016
13016
|
return {
|
|
13017
|
-
component:
|
|
13017
|
+
component: Mh,
|
|
13018
13018
|
componentProps: {
|
|
13019
13019
|
action: () => {
|
|
13020
13020
|
},
|
|
@@ -13063,7 +13063,7 @@ const en = si.extend({
|
|
|
13063
13063
|
};
|
|
13064
13064
|
},
|
|
13065
13065
|
addNodeView() {
|
|
13066
|
-
return ge(
|
|
13066
|
+
return ge(Ih);
|
|
13067
13067
|
},
|
|
13068
13068
|
// @ts-ignore
|
|
13069
13069
|
addCommands() {
|
|
@@ -13117,53 +13117,53 @@ const en = si.extend({
|
|
|
13117
13117
|
});
|
|
13118
13118
|
export {
|
|
13119
13119
|
Hu as A,
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13120
|
+
nu as B,
|
|
13121
|
+
cu as C,
|
|
13122
|
+
fh as D,
|
|
13123
13123
|
Iu as E,
|
|
13124
|
-
|
|
13124
|
+
su as F,
|
|
13125
13125
|
Be as G,
|
|
13126
|
-
|
|
13127
|
-
|
|
13126
|
+
lu as H,
|
|
13127
|
+
ru as I,
|
|
13128
13128
|
Ru as J,
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13129
|
+
je as K,
|
|
13130
|
+
wu as L,
|
|
13131
|
+
Nu as M,
|
|
13132
13132
|
Ou as N,
|
|
13133
|
-
|
|
13133
|
+
xu as O,
|
|
13134
13134
|
Pu as P,
|
|
13135
13135
|
er as Q,
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13136
|
+
iu as R,
|
|
13137
|
+
ou as S,
|
|
13138
|
+
du as T,
|
|
13139
|
+
au as U,
|
|
13140
|
+
rd as V,
|
|
13141
13141
|
en as W,
|
|
13142
13142
|
ti as X,
|
|
13143
13143
|
fl as a,
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13144
|
+
hu as b,
|
|
13145
|
+
uu as c,
|
|
13146
|
+
mu as d,
|
|
13147
|
+
fu as e,
|
|
13148
|
+
gu as f,
|
|
13149
|
+
bu as g,
|
|
13150
|
+
pu as h,
|
|
13151
|
+
_u as i,
|
|
13152
|
+
vu as j,
|
|
13153
|
+
ku as k,
|
|
13154
|
+
Cu as l,
|
|
13155
13155
|
Jo as m,
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13156
|
+
Tu as n,
|
|
13157
|
+
Au as o,
|
|
13158
|
+
Lu as p,
|
|
13159
|
+
ed as q,
|
|
13160
13160
|
Su as r,
|
|
13161
13161
|
Mu as s,
|
|
13162
13162
|
Ni as t,
|
|
13163
13163
|
lt as u,
|
|
13164
|
-
|
|
13164
|
+
yu as v,
|
|
13165
13165
|
$e as w,
|
|
13166
|
-
|
|
13166
|
+
pd as x,
|
|
13167
13167
|
zu as y,
|
|
13168
13168
|
Eu as z
|
|
13169
13169
|
};
|