reactjs-tiptap-editor 0.0.51 → 0.0.53
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/index.d.cts +64 -64
- package/lib/index.d.ts +64 -64
- package/lib/{locales-CV1FzvUW.js → locales-Bl_k4WJe.js} +1 -1
- package/lib/{locales-CuAW1LOw.cjs → locales-oL23c42S.cjs} +1 -1
- package/lib/reactjs-tiptap-editor.cjs +1 -1
- package/lib/reactjs-tiptap-editor.js +2 -2
- package/lib/style.css +1 -1
- package/lib/utils-C-pvrAo1.cjs +151 -0
- package/lib/{utils-CtONRhPR.js → utils-D-EBAPSE.js} +611 -613
- package/package.json +1 -1
- package/lib/utils-F9_asFLh.cjs +0 -151
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Bn = Object.defineProperty;
|
|
2
|
+
var jn = (e, t, i) => t in e ? Bn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var fe = (e, t, i) => jn(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
4
|
import { jsxs as u, jsx as r, Fragment as q } from "react/jsx-runtime";
|
|
5
5
|
import * as j from "react";
|
|
6
|
-
import Pe, { useState as w, useRef as X, useEffect as z, useCallback as M, useMemo as O, Fragment as nt, forwardRef as
|
|
6
|
+
import Pe, { useState as w, useRef as X, useEffect as z, useCallback as M, useMemo as O, Fragment as nt, forwardRef as Nt, useImperativeHandle as Tt } from "react";
|
|
7
7
|
import "@radix-ui/react-toast";
|
|
8
|
-
import { ChevronRight as
|
|
9
|
-
import { B as
|
|
10
|
-
import { ah as
|
|
11
|
-
import { bundledThemes as
|
|
12
|
-
import { u as F, C as
|
|
8
|
+
import { ChevronRight as Fn, Check as qi, Circle as Un, ChevronDown as Lt, ChevronUp as Ki, HelpCircle as Gi, Pencil as Zi, Trash2 as Ji, X as Vn, Plus as Xi, Bold as Wn, LoaderCircle as qn, Italic as Kn, Underline as Gn, Quote as Zn, Strikethrough as Jn, Minus as Xn, Eraser as Yn, PaintRoller as Qn, Redo2 as er, Undo2 as tr, Subscript as ir, Superscript as nr, Code as rr, CodeXml as ar, Type as or, IndentIncrease as cr, IndentDecrease as sr, List as lr, ListOrdered as dr, ListTodo as hr, Link as ur, ImageUp as mr, Video as fr, Maximize as gr, Minimize as xr, Table as pr, Sparkles as br, Unlink as wr, BetweenHorizonalEnd as _r, BetweenHorizonalStart as vr, BetweenVerticalStart as yr, BetweenVerticalEnd as kr, TableCellsMerge as Cr, TableCellsSplit as Nr, Trash as Tr, Replace as _i, ChevronsUpDown as Lr, Heading1 as Ar, Heading2 as Sr, Heading3 as Mr, Heading4 as Ir, Heading5 as zr, Heading6 as Hr, Columns2 as vi, Columns3 as Er, Columns4 as Rr, GripVertical as Or, Copy as Yi, Clipboard as Pr, PanelLeft as Dr, PanelRight as $r, Frame as Br, SmilePlus as jr, SmilePlusIcon as Fr, Sigma as Ur, BookMarked as Vr, ZoomIn as Wr, ZoomOut as qr, Settings as Kr, Eye as Gr, Paperclip as Zr, CropIcon as Jr, CopyCheck as Xr, Clock3 as Yr, Laugh as Qr, LucideTableProperties as ea, LucideSheet as ta, LucideImage as ia, LucideFile as na, LucideVideo as ra, LucideAudioLines as aa } from "lucide-react";
|
|
9
|
+
import { B as ue, N as ne, a as ce, m as se, R as me, n as Xt, u as oa, E as ca, i as sa, b as la, c as da, I as ha, U as ua, S as ma, C as fa, f as et, d as ga, e as xa, F as pa, H as ba, T as wa, g as Z, h as _a, j as va, k as ya, O as ka, l as Ca, o as Na, p as Ta, L as La, q as Aa, r as Sa, s as Ma, D as Ia, t as vt, P as za, v as Ha, w as Ea, G as Ra, x as Oa, y as Pa, z as Da, A as $a, J as Ba, K as ja, M as Qi, Q as en, V as tn, W as Yt, X as Qt, Y as Fa, Z as Ua, _ as Va, $ as Wa, a0 as qa, a1 as yi } from "./tiptap-BjeL17_y.js";
|
|
10
|
+
import { ah as Ka, ai as ee, aj as ei, ak as ti, al as Ga, am as nn, an as Za, ao as Le, e as At, d as Ae, ap as rn, aq as ii, ar as Ja, P as be, a as we, Z as De, _ as Be, as as Xa, at as yt, au as an, ae as Ya } from "./vendor-CXgFM3bq.js";
|
|
11
|
+
import { bundledThemes as on, bundledLanguages as cn, createHighlighter as Qa } from "shiki";
|
|
12
|
+
import { u as F, C as eo, E as to, l as W, B as io, I as kt, V as jt, M as no, D as sn, a as ro, b as ao, c as ki, d as ln, e as oo, f as je, g as Fe, h as ni, T as mt, i as ft, j as gt } from "./locales-Bl_k4WJe.js";
|
|
13
13
|
import * as G from "@radix-ui/react-select";
|
|
14
14
|
import { Slot as ri } from "@radix-ui/react-slot";
|
|
15
|
-
import ai, { sticky as
|
|
15
|
+
import ai, { sticky as co } from "tippy.js";
|
|
16
16
|
import { flushSync as Ue } from "react-dom";
|
|
17
|
-
import
|
|
17
|
+
import so from "react-image-crop";
|
|
18
18
|
import oi from "scroll-into-view-if-needed";
|
|
19
|
-
import * as
|
|
20
|
-
import { defaultNodes as
|
|
21
|
-
import { Packer as
|
|
19
|
+
import * as Se from "@radix-ui/react-tabs";
|
|
20
|
+
import { defaultNodes as ye, DocxSerializer as lo, defaultMarks as ho } from "prosemirror-docx";
|
|
21
|
+
import { Packer as uo } from "docx";
|
|
22
22
|
import Ct from "mermaid";
|
|
23
23
|
import * as oe from "@radix-ui/react-dialog";
|
|
24
24
|
import ci from "katex";
|
|
25
|
-
import { proxy as
|
|
25
|
+
import { proxy as mo, useSnapshot as fo } from "valtio";
|
|
26
26
|
import * as tt from "@radix-ui/react-popover";
|
|
27
|
-
import * as
|
|
28
|
-
import { Resizable as
|
|
29
|
-
import * as
|
|
30
|
-
import { HexColorPicker as
|
|
31
|
-
import { TextAlignCenterIcon as
|
|
32
|
-
import * as
|
|
33
|
-
import { DragHandlePlugin as
|
|
27
|
+
import * as dn from "@radix-ui/react-label";
|
|
28
|
+
import { Resizable as hn } from "re-resizable";
|
|
29
|
+
import * as un from "@radix-ui/react-separator";
|
|
30
|
+
import { HexColorPicker as go } from "react-colorful";
|
|
31
|
+
import { TextAlignCenterIcon as xo, TextAlignJustifyIcon as po, TextAlignLeftIcon as bo, TextAlignRightIcon as wo } from "@radix-ui/react-icons";
|
|
32
|
+
import * as Ft from "@radix-ui/react-switch";
|
|
33
|
+
import { DragHandlePlugin as _o, dragHandlePluginDefaultKey as vo } from "echo-drag-handle-plugin";
|
|
34
34
|
import * as K from "@radix-ui/react-dropdown-menu";
|
|
35
35
|
import * as rt from "@radix-ui/react-tooltip";
|
|
36
|
-
import * as
|
|
37
|
-
let
|
|
38
|
-
function
|
|
39
|
-
return
|
|
36
|
+
import * as mn from "@radix-ui/react-toggle";
|
|
37
|
+
let Ht;
|
|
38
|
+
function Et() {
|
|
39
|
+
return Ht === void 0 && (Ht = navigator.platform.includes("Mac")), Ht;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return `${e}`.toLowerCase() === "mod" ?
|
|
41
|
+
function St(e) {
|
|
42
|
+
return `${e}`.toLowerCase() === "mod" ? Et() ? "⌘" : "Ctrl" : `${e}`.toLowerCase() === "alt" ? Et() ? "⌥" : "Alt" : `${e}`.toLowerCase() === "shift" ? Et() ? "⇧" : "Shift" : e;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return e.map(
|
|
44
|
+
function Mt(e) {
|
|
45
|
+
return e.map(St).join(" ");
|
|
46
46
|
}
|
|
47
47
|
function P(...e) {
|
|
48
|
-
return
|
|
48
|
+
return Ka(ee(e));
|
|
49
49
|
}
|
|
50
50
|
const _ = Pe.forwardRef(
|
|
51
51
|
(e, t) => {
|
|
@@ -85,7 +85,7 @@ const _ = Pe.forwardRef(
|
|
|
85
85
|
) }),
|
|
86
86
|
n && /* @__PURE__ */ r(Ie, { ...s, children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
|
|
87
87
|
/* @__PURE__ */ r("div", { children: n }),
|
|
88
|
-
!!(c != null && c.length) && /* @__PURE__ */ r("span", { children:
|
|
88
|
+
!!(c != null && c.length) && /* @__PURE__ */ r("span", { children: Mt(c) })
|
|
89
89
|
] }) })
|
|
90
90
|
] });
|
|
91
91
|
}
|
|
@@ -110,7 +110,7 @@ const _ = Pe.forwardRef(
|
|
|
110
110
|
) }),
|
|
111
111
|
/* @__PURE__ */ r(Ie, { children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
|
|
112
112
|
(t == null ? void 0 : t.tooltip) && /* @__PURE__ */ r("div", { children: t == null ? void 0 : t.tooltip }),
|
|
113
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children:
|
|
113
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: Mt(t == null ? void 0 : t.shortcutKeys) }) })
|
|
114
114
|
] }) })
|
|
115
115
|
] });
|
|
116
116
|
}
|
|
@@ -134,11 +134,11 @@ function at(e, t) {
|
|
|
134
134
|
}
|
|
135
135
|
return a;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function yo(e) {
|
|
138
138
|
return e;
|
|
139
139
|
}
|
|
140
140
|
function ot(e, t, i, n) {
|
|
141
|
-
const a =
|
|
141
|
+
const a = yo, [o, c] = w(a(i)), s = X(o);
|
|
142
142
|
return z(() => {
|
|
143
143
|
const h = () => {
|
|
144
144
|
const l = { ...i, ...e.getAttributes(t) };
|
|
@@ -167,7 +167,7 @@ const ct = j.forwardRef(
|
|
|
167
167
|
)
|
|
168
168
|
);
|
|
169
169
|
ct.displayName = "Textarea";
|
|
170
|
-
const
|
|
170
|
+
const ko = ti(
|
|
171
171
|
"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",
|
|
172
172
|
{
|
|
173
173
|
variants: {
|
|
@@ -195,14 +195,14 @@ const Co = ti(
|
|
|
195
195
|
({ className: e, variant: t, size: i, asChild: n = !1, ...a }, o) => /* @__PURE__ */ r(
|
|
196
196
|
n ? ri : "button",
|
|
197
197
|
{
|
|
198
|
-
className: P(
|
|
198
|
+
className: P(ko({ variant: t, size: i, className: e })),
|
|
199
199
|
ref: o,
|
|
200
200
|
...a
|
|
201
201
|
}
|
|
202
202
|
)
|
|
203
203
|
);
|
|
204
204
|
U.displayName = "Button";
|
|
205
|
-
const
|
|
205
|
+
const _e = K.Root, ve = K.Trigger, Ci = K.Portal, Ni = K.Sub, Ut = j.forwardRef(({ className: e, inset: t, children: i, ...n }, a) => /* @__PURE__ */ u(
|
|
206
206
|
K.SubTrigger,
|
|
207
207
|
{
|
|
208
208
|
ref: a,
|
|
@@ -214,12 +214,12 @@ const Ae = K.Root, Se = K.Trigger, Ti = K.Portal, Li = K.Sub, Vt = j.forwardRef(
|
|
|
214
214
|
...n,
|
|
215
215
|
children: [
|
|
216
216
|
i,
|
|
217
|
-
/* @__PURE__ */ r(
|
|
217
|
+
/* @__PURE__ */ r(Fn, { className: "richtext-ml-auto richtext-h-4 richtext-w-4" })
|
|
218
218
|
]
|
|
219
219
|
}
|
|
220
220
|
));
|
|
221
|
-
|
|
222
|
-
const
|
|
221
|
+
Ut.displayName = K.SubTrigger.displayName;
|
|
222
|
+
const Vt = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
223
223
|
K.SubContent,
|
|
224
224
|
{
|
|
225
225
|
ref: i,
|
|
@@ -230,8 +230,8 @@ const Wt = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
230
230
|
...t
|
|
231
231
|
}
|
|
232
232
|
));
|
|
233
|
-
|
|
234
|
-
const
|
|
233
|
+
Vt.displayName = K.SubContent.displayName;
|
|
234
|
+
const pe = j.forwardRef(({ className: e, sideOffset: t = 4, ...i }, n) => /* @__PURE__ */ r(K.Portal, { children: /* @__PURE__ */ r(
|
|
235
235
|
K.Content,
|
|
236
236
|
{
|
|
237
237
|
ref: n,
|
|
@@ -243,8 +243,8 @@ const we = j.forwardRef(({ className: e, sideOffset: t = 4, ...i }, n) => /* @__
|
|
|
243
243
|
...i
|
|
244
244
|
}
|
|
245
245
|
) }));
|
|
246
|
-
|
|
247
|
-
const
|
|
246
|
+
pe.displayName = K.Content.displayName;
|
|
247
|
+
const le = j.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */ r(
|
|
248
248
|
K.Item,
|
|
249
249
|
{
|
|
250
250
|
ref: n,
|
|
@@ -256,7 +256,7 @@ const fe = j.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */
|
|
|
256
256
|
...i
|
|
257
257
|
}
|
|
258
258
|
));
|
|
259
|
-
|
|
259
|
+
le.displayName = K.Item.displayName;
|
|
260
260
|
const Me = j.forwardRef(({ className: e, children: t, checked: i, ...n }, a) => /* @__PURE__ */ u(
|
|
261
261
|
K.CheckboxItem,
|
|
262
262
|
{
|
|
@@ -268,13 +268,13 @@ const Me = j.forwardRef(({ className: e, children: t, checked: i, ...n }, a) =>
|
|
|
268
268
|
checked: i,
|
|
269
269
|
...n,
|
|
270
270
|
children: [
|
|
271
|
-
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ r(K.ItemIndicator, { children: /* @__PURE__ */ r(
|
|
271
|
+
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ r(K.ItemIndicator, { children: /* @__PURE__ */ r(qi, { className: "richtext-h-4 richtext-w-4" }) }) }),
|
|
272
272
|
t
|
|
273
273
|
]
|
|
274
274
|
}
|
|
275
275
|
));
|
|
276
276
|
Me.displayName = K.CheckboxItem.displayName;
|
|
277
|
-
const
|
|
277
|
+
const Co = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ u(
|
|
278
278
|
K.RadioItem,
|
|
279
279
|
{
|
|
280
280
|
ref: n,
|
|
@@ -284,13 +284,13 @@ const No = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__
|
|
|
284
284
|
),
|
|
285
285
|
...i,
|
|
286
286
|
children: [
|
|
287
|
-
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ r(K.ItemIndicator, { children: /* @__PURE__ */ r(
|
|
287
|
+
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ r(K.ItemIndicator, { children: /* @__PURE__ */ r(Un, { className: "richtext-h-2 richtext-w-2 richtext-fill-current" }) }) }),
|
|
288
288
|
t
|
|
289
289
|
]
|
|
290
290
|
}
|
|
291
291
|
));
|
|
292
|
-
|
|
293
|
-
const
|
|
292
|
+
Co.displayName = K.RadioItem.displayName;
|
|
293
|
+
const No = j.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */ r(
|
|
294
294
|
K.Label,
|
|
295
295
|
{
|
|
296
296
|
ref: n,
|
|
@@ -302,8 +302,8 @@ const To = j.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */
|
|
|
302
302
|
...i
|
|
303
303
|
}
|
|
304
304
|
));
|
|
305
|
-
|
|
306
|
-
const
|
|
305
|
+
No.displayName = K.Label.displayName;
|
|
306
|
+
const It = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
307
307
|
K.Separator,
|
|
308
308
|
{
|
|
309
309
|
ref: i,
|
|
@@ -311,8 +311,8 @@ const zt = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
311
311
|
...t
|
|
312
312
|
}
|
|
313
313
|
));
|
|
314
|
-
|
|
315
|
-
function
|
|
314
|
+
It.displayName = K.Separator.displayName;
|
|
315
|
+
function fn({
|
|
316
316
|
className: e,
|
|
317
317
|
...t
|
|
318
318
|
}) {
|
|
@@ -324,7 +324,7 @@ function xn({
|
|
|
324
324
|
}
|
|
325
325
|
);
|
|
326
326
|
}
|
|
327
|
-
|
|
327
|
+
fn.displayName = "DropdownMenuShortcut";
|
|
328
328
|
const te = j.forwardRef(
|
|
329
329
|
({ className: e, type: t, ...i }, n) => /* @__PURE__ */ r(
|
|
330
330
|
"input",
|
|
@@ -340,17 +340,17 @@ const te = j.forwardRef(
|
|
|
340
340
|
)
|
|
341
341
|
);
|
|
342
342
|
te.displayName = "Input";
|
|
343
|
-
const
|
|
343
|
+
const To = ti(
|
|
344
344
|
"richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"
|
|
345
|
-
),
|
|
346
|
-
|
|
345
|
+
), de = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
346
|
+
dn.Root,
|
|
347
347
|
{
|
|
348
348
|
ref: i,
|
|
349
|
-
className: P(
|
|
349
|
+
className: P(To(), e),
|
|
350
350
|
...t
|
|
351
351
|
}
|
|
352
352
|
));
|
|
353
|
-
|
|
353
|
+
de.displayName = dn.Root.displayName;
|
|
354
354
|
const re = tt.Root, ae = tt.Trigger, ie = j.forwardRef(({ className: e, align: t = "center", sideOffset: i = 4, ...n }, a) => /* @__PURE__ */ r(tt.Portal, { children: /* @__PURE__ */ r(
|
|
355
355
|
tt.Content,
|
|
356
356
|
{
|
|
@@ -365,9 +365,9 @@ const re = tt.Root, ae = tt.Trigger, ie = j.forwardRef(({ className: e, align: t
|
|
|
365
365
|
}
|
|
366
366
|
) }));
|
|
367
367
|
ie.displayName = tt.Content.displayName;
|
|
368
|
-
const
|
|
368
|
+
const he = j.forwardRef(
|
|
369
369
|
({ className: e, orientation: t = "horizontal", decorative: i = !0, ...n }, a) => /* @__PURE__ */ r(
|
|
370
|
-
|
|
370
|
+
un.Root,
|
|
371
371
|
{
|
|
372
372
|
ref: a,
|
|
373
373
|
decorative: i,
|
|
@@ -381,9 +381,9 @@ const de = j.forwardRef(
|
|
|
381
381
|
}
|
|
382
382
|
)
|
|
383
383
|
);
|
|
384
|
-
|
|
384
|
+
he.displayName = un.Root.displayName;
|
|
385
385
|
const li = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
386
|
-
|
|
386
|
+
Ft.Root,
|
|
387
387
|
{
|
|
388
388
|
className: P(
|
|
389
389
|
"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",
|
|
@@ -392,7 +392,7 @@ const li = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
392
392
|
...t,
|
|
393
393
|
ref: i,
|
|
394
394
|
children: /* @__PURE__ */ r(
|
|
395
|
-
|
|
395
|
+
Ft.Thumb,
|
|
396
396
|
{
|
|
397
397
|
className: P(
|
|
398
398
|
"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"
|
|
@@ -401,9 +401,9 @@ const li = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
401
401
|
)
|
|
402
402
|
}
|
|
403
403
|
));
|
|
404
|
-
li.displayName =
|
|
405
|
-
const di =
|
|
406
|
-
|
|
404
|
+
li.displayName = Ft.Root.displayName;
|
|
405
|
+
const di = Se.Root, zt = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
406
|
+
Se.List,
|
|
407
407
|
{
|
|
408
408
|
ref: i,
|
|
409
409
|
className: P(
|
|
@@ -413,9 +413,9 @@ const di = Le.Root, Ht = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE_
|
|
|
413
413
|
...t
|
|
414
414
|
}
|
|
415
415
|
));
|
|
416
|
-
|
|
416
|
+
zt.displayName = Se.List.displayName;
|
|
417
417
|
const Ve = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
418
|
-
|
|
418
|
+
Se.Trigger,
|
|
419
419
|
{
|
|
420
420
|
ref: i,
|
|
421
421
|
className: P(
|
|
@@ -425,9 +425,9 @@ const Ve = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
425
425
|
...t
|
|
426
426
|
}
|
|
427
427
|
));
|
|
428
|
-
Ve.displayName =
|
|
428
|
+
Ve.displayName = Se.Trigger.displayName;
|
|
429
429
|
const We = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
430
|
-
|
|
430
|
+
Se.Content,
|
|
431
431
|
{
|
|
432
432
|
ref: i,
|
|
433
433
|
className: P(
|
|
@@ -437,8 +437,8 @@ const We = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
437
437
|
...t
|
|
438
438
|
}
|
|
439
439
|
));
|
|
440
|
-
We.displayName =
|
|
441
|
-
const
|
|
440
|
+
We.displayName = Se.Content.displayName;
|
|
441
|
+
const Lo = ti(
|
|
442
442
|
"richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",
|
|
443
443
|
{
|
|
444
444
|
variants: {
|
|
@@ -458,15 +458,15 @@ const Ao = ti(
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
), st = j.forwardRef(({ className: e, variant: t, size: i, ...n }, a) => /* @__PURE__ */ r(
|
|
461
|
-
|
|
461
|
+
mn.Root,
|
|
462
462
|
{
|
|
463
463
|
ref: a,
|
|
464
|
-
className: P(
|
|
464
|
+
className: P(Lo({ variant: t, size: i, className: e })),
|
|
465
465
|
...n
|
|
466
466
|
}
|
|
467
467
|
));
|
|
468
|
-
st.displayName =
|
|
469
|
-
const
|
|
468
|
+
st.displayName = mn.Root.displayName;
|
|
469
|
+
const Ao = rt.Provider, Ke = rt.Root, Ge = rt.Trigger, Ie = j.forwardRef(({ className: e, sideOffset: t = 4, ...i }, n) => /* @__PURE__ */ r(
|
|
470
470
|
rt.Content,
|
|
471
471
|
{
|
|
472
472
|
ref: n,
|
|
@@ -479,7 +479,7 @@ const So = rt.Provider, Ke = rt.Root, Ge = rt.Trigger, Ie = j.forwardRef(({ clas
|
|
|
479
479
|
}
|
|
480
480
|
));
|
|
481
481
|
Ie.displayName = rt.Content.displayName;
|
|
482
|
-
const
|
|
482
|
+
const So = G.Root, Mo = G.Value, gn = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ u(
|
|
483
483
|
G.Trigger,
|
|
484
484
|
{
|
|
485
485
|
ref: n,
|
|
@@ -490,12 +490,12 @@ const pn = G.Root, Mo = G.Value, hi = j.forwardRef(({ className: e, children: t,
|
|
|
490
490
|
...i,
|
|
491
491
|
children: [
|
|
492
492
|
t,
|
|
493
|
-
/* @__PURE__ */ r(G.Icon, { asChild: !0, children: /* @__PURE__ */ r(
|
|
493
|
+
/* @__PURE__ */ r(G.Icon, { asChild: !0, children: /* @__PURE__ */ r(Lt, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
|
|
494
494
|
]
|
|
495
495
|
}
|
|
496
496
|
));
|
|
497
|
-
|
|
498
|
-
const
|
|
497
|
+
gn.displayName = G.Trigger.displayName;
|
|
498
|
+
const xn = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
499
499
|
G.ScrollUpButton,
|
|
500
500
|
{
|
|
501
501
|
ref: i,
|
|
@@ -504,11 +504,11 @@ const bn = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
504
504
|
e
|
|
505
505
|
),
|
|
506
506
|
...t,
|
|
507
|
-
children: /* @__PURE__ */ r(
|
|
507
|
+
children: /* @__PURE__ */ r(Ki, { className: "richtext-h-4 richtext-w-4" })
|
|
508
508
|
}
|
|
509
509
|
));
|
|
510
|
-
|
|
511
|
-
const
|
|
510
|
+
xn.displayName = G.ScrollUpButton.displayName;
|
|
511
|
+
const pn = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
512
512
|
G.ScrollDownButton,
|
|
513
513
|
{
|
|
514
514
|
ref: i,
|
|
@@ -517,11 +517,11 @@ const wn = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
517
517
|
e
|
|
518
518
|
),
|
|
519
519
|
...t,
|
|
520
|
-
children: /* @__PURE__ */ r(
|
|
520
|
+
children: /* @__PURE__ */ r(Lt, { className: "richtext-h-4 richtext-w-4" })
|
|
521
521
|
}
|
|
522
522
|
));
|
|
523
|
-
|
|
524
|
-
const
|
|
523
|
+
pn.displayName = G.ScrollDownButton.displayName;
|
|
524
|
+
const bn = j.forwardRef(({ className: e, children: t, position: i = "popper", ...n }, a) => /* @__PURE__ */ r(G.Portal, { children: /* @__PURE__ */ u(
|
|
525
525
|
G.Content,
|
|
526
526
|
{
|
|
527
527
|
ref: a,
|
|
@@ -533,7 +533,7 @@ const ui = j.forwardRef(({ className: e, children: t, position: i = "popper", ..
|
|
|
533
533
|
position: i,
|
|
534
534
|
...n,
|
|
535
535
|
children: [
|
|
536
|
-
/* @__PURE__ */ r(
|
|
536
|
+
/* @__PURE__ */ r(xn, {}),
|
|
537
537
|
/* @__PURE__ */ r(
|
|
538
538
|
G.Viewport,
|
|
539
539
|
{
|
|
@@ -544,11 +544,11 @@ const ui = j.forwardRef(({ className: e, children: t, position: i = "popper", ..
|
|
|
544
544
|
children: t
|
|
545
545
|
}
|
|
546
546
|
),
|
|
547
|
-
/* @__PURE__ */ r(
|
|
547
|
+
/* @__PURE__ */ r(pn, {})
|
|
548
548
|
]
|
|
549
549
|
}
|
|
550
550
|
) }));
|
|
551
|
-
|
|
551
|
+
bn.displayName = G.Content.displayName;
|
|
552
552
|
const Io = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
553
553
|
G.Label,
|
|
554
554
|
{
|
|
@@ -558,7 +558,7 @@ const Io = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
558
558
|
}
|
|
559
559
|
));
|
|
560
560
|
Io.displayName = G.Label.displayName;
|
|
561
|
-
const
|
|
561
|
+
const Wt = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ u(
|
|
562
562
|
G.Item,
|
|
563
563
|
{
|
|
564
564
|
ref: n,
|
|
@@ -568,12 +568,12 @@ const Nt = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__
|
|
|
568
568
|
),
|
|
569
569
|
...i,
|
|
570
570
|
children: [
|
|
571
|
-
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ r(G.ItemIndicator, { children: /* @__PURE__ */ r(
|
|
571
|
+
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ r(G.ItemIndicator, { children: /* @__PURE__ */ r(qi, { className: "richtext-h-4 richtext-w-4" }) }) }),
|
|
572
572
|
/* @__PURE__ */ r(G.ItemText, { children: t })
|
|
573
573
|
]
|
|
574
574
|
}
|
|
575
575
|
));
|
|
576
|
-
|
|
576
|
+
Wt.displayName = G.Item.displayName;
|
|
577
577
|
const zo = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
578
578
|
G.Separator,
|
|
579
579
|
{
|
|
@@ -606,7 +606,7 @@ function Ho({ editor: e, ...t }) {
|
|
|
606
606
|
[o, f]
|
|
607
607
|
);
|
|
608
608
|
return /* @__PURE__ */ r(
|
|
609
|
-
|
|
609
|
+
ue,
|
|
610
610
|
{
|
|
611
611
|
editor: e,
|
|
612
612
|
pluginKey: "Katex-bubble-menu",
|
|
@@ -638,11 +638,11 @@ function Ho({ editor: e, ...t }) {
|
|
|
638
638
|
g && /* @__PURE__ */ r("div", { className: "richtext-my-[10px] richtext-p-[10px] richtext-rounded-[6px] !richtext-border-[1px]", children: g }),
|
|
639
639
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
|
|
640
640
|
/* @__PURE__ */ r(U, { onClick: m, className: "richtext-flex-1", children: "Submit" }),
|
|
641
|
-
/* @__PURE__ */ r("a", { href: "https://katex.org/docs/supported", target: "_blank", rel: "noreferrer noopener", children: /* @__PURE__ */ r(
|
|
641
|
+
/* @__PURE__ */ r("a", { href: "https://katex.org/docs/supported", target: "_blank", rel: "noreferrer noopener", children: /* @__PURE__ */ r(Gi, { size: 16 }) })
|
|
642
642
|
] })
|
|
643
643
|
] }) : /* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]", children: [
|
|
644
|
-
/* @__PURE__ */ r(_, { tooltip: "Edit", action: () => h(!s), children: /* @__PURE__ */ r(
|
|
645
|
-
/* @__PURE__ */ r(_, { tooltip: "Delete", action: d, children: /* @__PURE__ */ r(
|
|
644
|
+
/* @__PURE__ */ r(_, { tooltip: "Edit", action: () => h(!s), children: /* @__PURE__ */ r(Zi, { size: 16 }) }),
|
|
645
|
+
/* @__PURE__ */ r(_, { tooltip: "Delete", action: d, children: /* @__PURE__ */ r(Ji, { size: 16 }) })
|
|
646
646
|
] }) })
|
|
647
647
|
}
|
|
648
648
|
);
|
|
@@ -694,7 +694,7 @@ function Eo(e) {
|
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
|
-
const Ro = { padding: "0 12px 12px" },
|
|
697
|
+
const Ro = { padding: "0 12px 12px" }, wn = ({ width: e, maxWidth: t, height: i, onOk: n, children: a }) => {
|
|
698
698
|
const { t: o } = F(), [c, s] = w({
|
|
699
699
|
width: "",
|
|
700
700
|
height: "",
|
|
@@ -713,7 +713,7 @@ const Ro = { padding: "0 12px 12px" }, _n = ({ width: e, maxWidth: t, height: i,
|
|
|
713
713
|
return /* @__PURE__ */ u(re, { modal: !0, children: [
|
|
714
714
|
/* @__PURE__ */ r(ae, { asChild: !0, children: a }),
|
|
715
715
|
/* @__PURE__ */ r(ie, { children: /* @__PURE__ */ r("div", { style: Ro, children: /* @__PURE__ */ u("form", { className: "richtext-flex richtext-flex-col richtext-gap-2", onSubmit: h, children: [
|
|
716
|
-
/* @__PURE__ */ r(
|
|
716
|
+
/* @__PURE__ */ r(de, { className: "mb-[6px]", children: "Width" }),
|
|
717
717
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
|
|
718
718
|
te,
|
|
719
719
|
{
|
|
@@ -723,7 +723,7 @@ const Ro = { padding: "0 12px 12px" }, _n = ({ width: e, maxWidth: t, height: i,
|
|
|
723
723
|
onChange: (l) => s({ ...c, width: l.target.value })
|
|
724
724
|
}
|
|
725
725
|
) }) }),
|
|
726
|
-
/* @__PURE__ */ r(
|
|
726
|
+
/* @__PURE__ */ r(de, { className: "mb-[6px]", children: "Max Width" }),
|
|
727
727
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
|
|
728
728
|
te,
|
|
729
729
|
{
|
|
@@ -733,7 +733,7 @@ const Ro = { padding: "0 12px 12px" }, _n = ({ width: e, maxWidth: t, height: i,
|
|
|
733
733
|
onChange: (l) => s({ ...c, maxWidth: l.target.value })
|
|
734
734
|
}
|
|
735
735
|
) }) }),
|
|
736
|
-
/* @__PURE__ */ r(
|
|
736
|
+
/* @__PURE__ */ r(de, { className: "mb-[6px]", children: "Height" }),
|
|
737
737
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
|
|
738
738
|
te,
|
|
739
739
|
{
|
|
@@ -753,7 +753,7 @@ const Ro = { padding: "0 12px 12px" }, _n = ({ width: e, maxWidth: t, height: i,
|
|
|
753
753
|
icon: $o,
|
|
754
754
|
handlerWrap: Bo
|
|
755
755
|
};
|
|
756
|
-
function
|
|
756
|
+
function _n(e, t, i) {
|
|
757
757
|
return e < t ? t : e > i ? i : e;
|
|
758
758
|
}
|
|
759
759
|
const jo = (e) => typeof e == "number", Fo = (e) => typeof e == "string", Uo = (e) => typeof e == "function";
|
|
@@ -763,7 +763,7 @@ function Vo(e, t = "px") {
|
|
|
763
763
|
const i = jo(e) ? String(e) : e, n = Number.parseFloat(i), a = i.match(/[a-z%]+$/i), o = a ? a[0] : t;
|
|
764
764
|
return Number.isNaN(n) ? e : n + o;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function vn(e, t) {
|
|
767
767
|
if (!e)
|
|
768
768
|
return !1;
|
|
769
769
|
const { extensions: i = [] } = (e == null ? void 0 : e.extensionManager) ?? {};
|
|
@@ -772,7 +772,7 @@ function yn(e, t) {
|
|
|
772
772
|
function qt(e) {
|
|
773
773
|
return e.map((t) => Fo(t) ? { value: t, name: t } : t);
|
|
774
774
|
}
|
|
775
|
-
const Wo = 10, qo = 200,
|
|
775
|
+
const Wo = 10, qo = 200, Ti = 15, Li = { width: "100%", height: "100%", maxWidth: "100%" };
|
|
776
776
|
function Ko({ editor: e, node: t, updateAttributes: i }) {
|
|
777
777
|
const n = X(null), a = e.isActive(Ee.name), { data: o, width: c, height: s } = t.attrs, [h, l] = w(null), [d, m] = w(!0), [f, g] = w(null), [x, b] = w(!1), [k, L] = w(100), p = M(
|
|
778
778
|
(T) => {
|
|
@@ -781,7 +781,7 @@ function Ko({ editor: e, node: t, updateAttributes: i }) {
|
|
|
781
781
|
[b]
|
|
782
782
|
), v = M((T) => () => {
|
|
783
783
|
L(
|
|
784
|
-
(I) =>
|
|
784
|
+
(I) => _n(T === "minus" ? I - Ti : I + Ti, Wo, qo)
|
|
785
785
|
);
|
|
786
786
|
}, []);
|
|
787
787
|
z(() => {
|
|
@@ -805,8 +805,8 @@ function Ko({ editor: e, node: t, updateAttributes: i }) {
|
|
|
805
805
|
const C = (T) => {
|
|
806
806
|
i({ width: T.width, height: T.height });
|
|
807
807
|
};
|
|
808
|
-
return /* @__PURE__ */ r(ne, { className: ee(Xe.wrap, a && Xe.isActive), children: /* @__PURE__ */ r(
|
|
809
|
-
|
|
808
|
+
return /* @__PURE__ */ r(ne, { className: ee(Xe.wrap, a && Xe.isActive), children: /* @__PURE__ */ r(Ga, { onChange: p, children: /* @__PURE__ */ r(
|
|
809
|
+
hn,
|
|
810
810
|
{
|
|
811
811
|
size: { width: Number.parseInt(c), height: Number.parseInt(s) },
|
|
812
812
|
onResizeStop: (T, I, $, y) => {
|
|
@@ -819,9 +819,9 @@ function Ko({ editor: e, node: t, updateAttributes: i }) {
|
|
|
819
819
|
"div",
|
|
820
820
|
{
|
|
821
821
|
className: ee(Xe.renderWrap, "render-wrapper"),
|
|
822
|
-
style: { ...
|
|
822
|
+
style: { ...Li, overflow: "hidden" },
|
|
823
823
|
children: [
|
|
824
|
-
f && /* @__PURE__ */ r("div", { style:
|
|
824
|
+
f && /* @__PURE__ */ r("div", { style: Li, children: /* @__PURE__ */ r("p", { children: f.message || f }) }),
|
|
825
825
|
d && /* @__PURE__ */ r("p", { children: "Loading..." }),
|
|
826
826
|
!d && !f && x && /* @__PURE__ */ r(
|
|
827
827
|
"div",
|
|
@@ -916,7 +916,7 @@ function Xo(e) {
|
|
|
916
916
|
return typeof a == "object" ? o = Jo(a) : o = a, i[n] = o, i;
|
|
917
917
|
}, /* @__PURE__ */ Object.create(null));
|
|
918
918
|
}
|
|
919
|
-
const lt = oe.Root, dt = oe.Trigger, Yo = oe.Portal,
|
|
919
|
+
const lt = oe.Root, dt = oe.Trigger, Yo = oe.Portal, yn = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
920
920
|
oe.Overlay,
|
|
921
921
|
{
|
|
922
922
|
ref: i,
|
|
@@ -927,9 +927,9 @@ const lt = oe.Root, dt = oe.Trigger, Yo = oe.Portal, kn = j.forwardRef(({ classN
|
|
|
927
927
|
...t
|
|
928
928
|
}
|
|
929
929
|
));
|
|
930
|
-
|
|
930
|
+
yn.displayName = oe.Overlay.displayName;
|
|
931
931
|
const Ze = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ u(Yo, { children: [
|
|
932
|
-
/* @__PURE__ */ r(
|
|
932
|
+
/* @__PURE__ */ r(yn, {}),
|
|
933
933
|
/* @__PURE__ */ u(
|
|
934
934
|
oe.Content,
|
|
935
935
|
{
|
|
@@ -942,7 +942,7 @@ const Ze = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__
|
|
|
942
942
|
children: [
|
|
943
943
|
t,
|
|
944
944
|
/* @__PURE__ */ u(oe.Close, { className: "richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground", children: [
|
|
945
|
-
/* @__PURE__ */ r(
|
|
945
|
+
/* @__PURE__ */ r(Vn, { className: "richtext-h-4 richtext-w-4" }),
|
|
946
946
|
/* @__PURE__ */ r("span", { className: "richtext-sr-only", children: "Close" })
|
|
947
947
|
] })
|
|
948
948
|
]
|
|
@@ -950,7 +950,7 @@ const Ze = j.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__
|
|
|
950
950
|
)
|
|
951
951
|
] }));
|
|
952
952
|
Ze.displayName = oe.Content.displayName;
|
|
953
|
-
function
|
|
953
|
+
function kn({
|
|
954
954
|
className: e,
|
|
955
955
|
...t
|
|
956
956
|
}) {
|
|
@@ -965,7 +965,7 @@ function Cn({
|
|
|
965
965
|
}
|
|
966
966
|
);
|
|
967
967
|
}
|
|
968
|
-
|
|
968
|
+
kn.displayName = "DialogHeader";
|
|
969
969
|
function Je({
|
|
970
970
|
className: e,
|
|
971
971
|
...t
|
|
@@ -1003,23 +1003,23 @@ const Qo = j.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
1003
1003
|
}
|
|
1004
1004
|
));
|
|
1005
1005
|
Qo.displayName = oe.Description.displayName;
|
|
1006
|
-
let
|
|
1007
|
-
function
|
|
1006
|
+
let Rt;
|
|
1007
|
+
function hi() {
|
|
1008
1008
|
try {
|
|
1009
|
-
return
|
|
1009
|
+
return Rt || (Rt = Eo()), Rt;
|
|
1010
1010
|
} catch {
|
|
1011
1011
|
throw new Error("Error EventEmitter");
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
1014
|
const Kt = "OPEN_EXCALIDRAW_SETTING_MODAL";
|
|
1015
1015
|
function ec(e, t) {
|
|
1016
|
-
|
|
1016
|
+
hi().on(e, t);
|
|
1017
1017
|
}
|
|
1018
1018
|
function tc(e, t) {
|
|
1019
|
-
|
|
1019
|
+
hi().off(e, t);
|
|
1020
1020
|
}
|
|
1021
1021
|
function ic(e) {
|
|
1022
|
-
|
|
1022
|
+
hi().emit(Kt, e);
|
|
1023
1023
|
}
|
|
1024
1024
|
const nc = ({ editor: e }) => {
|
|
1025
1025
|
const [t, i] = w(null), [n, a] = w({}), [o, c] = w({ elements: [], appState: { isLoading: !1 }, files: null }), [s, h] = w(!1), [l, d] = w(!0), [m, f] = w(null), g = M(
|
|
@@ -1086,7 +1086,7 @@ const nc = ({ editor: e }) => {
|
|
|
1086
1086
|
]
|
|
1087
1087
|
}
|
|
1088
1088
|
);
|
|
1089
|
-
},
|
|
1089
|
+
}, Ai = { elements: [] }, Ee = ce.create({
|
|
1090
1090
|
name: "excalidraw",
|
|
1091
1091
|
group: "block",
|
|
1092
1092
|
selectable: !0,
|
|
@@ -1110,7 +1110,7 @@ const nc = ({ editor: e }) => {
|
|
|
1110
1110
|
parseHTML: Y("height")
|
|
1111
1111
|
},
|
|
1112
1112
|
data: {
|
|
1113
|
-
default:
|
|
1113
|
+
default: Ai,
|
|
1114
1114
|
parseHTML: Y("data", !0)
|
|
1115
1115
|
}
|
|
1116
1116
|
};
|
|
@@ -1144,7 +1144,7 @@ const nc = ({ editor: e }) => {
|
|
|
1144
1144
|
return {
|
|
1145
1145
|
setExcalidraw: (e) => ({ tr: t, commands: i, chain: n }) => {
|
|
1146
1146
|
var a, o, c;
|
|
1147
|
-
return e = e || {}, e.data = e.data ||
|
|
1147
|
+
return e = e || {}, e.data = e.data || Ai, ((c = (o = (a = t.selection) == null ? void 0 : a.node) == null ? void 0 : o.type) == null ? void 0 : c.name) == this.name ? i.updateAttributes(this.name, e) : n().insertContent({
|
|
1148
1148
|
type: this.name,
|
|
1149
1149
|
attrs: e
|
|
1150
1150
|
}).run();
|
|
@@ -1152,7 +1152,7 @@ const nc = ({ editor: e }) => {
|
|
|
1152
1152
|
};
|
|
1153
1153
|
},
|
|
1154
1154
|
addNodeView() {
|
|
1155
|
-
return
|
|
1155
|
+
return me(Go);
|
|
1156
1156
|
},
|
|
1157
1157
|
addInputRules() {
|
|
1158
1158
|
return [
|
|
@@ -1163,16 +1163,16 @@ const nc = ({ editor: e }) => {
|
|
|
1163
1163
|
})
|
|
1164
1164
|
];
|
|
1165
1165
|
}
|
|
1166
|
-
}),
|
|
1166
|
+
}), ke = /* @__PURE__ */ new Map();
|
|
1167
1167
|
function rc(e) {
|
|
1168
1168
|
const t = e.options.element;
|
|
1169
|
-
|
|
1169
|
+
ke.has("width") || ke.set("width", t.clientWidth), ke.has("width") && ke.get("width") <= 0 && ke.set("width", t.clientWidth);
|
|
1170
1170
|
const i = { attributes: !0, childList: !0, subtree: !0 }, n = function() {
|
|
1171
|
-
|
|
1171
|
+
ke.set("width", t.clientWidth);
|
|
1172
1172
|
}, a = new MutationObserver(n);
|
|
1173
1173
|
return a.observe(t, i), e.on("destroy", () => {
|
|
1174
1174
|
a.disconnect();
|
|
1175
|
-
}), { width:
|
|
1175
|
+
}), { width: ke.get("width") };
|
|
1176
1176
|
}
|
|
1177
1177
|
function ac({ editor: e }) {
|
|
1178
1178
|
const { t } = F(), { width: i } = rc(e), n = ot(e, Ee.name, {
|
|
@@ -1191,7 +1191,7 @@ function ac({ editor: e }) {
|
|
|
1191
1191
|
return z(() => {
|
|
1192
1192
|
a && (l(), e.chain().updateAttributes(Ee.name, { defaultShowPicker: !1 }).focus().run());
|
|
1193
1193
|
}, [o, a, e, l]), /* @__PURE__ */ r(
|
|
1194
|
-
|
|
1194
|
+
ue,
|
|
1195
1195
|
{
|
|
1196
1196
|
className: "bubble-menu",
|
|
1197
1197
|
editor: e,
|
|
@@ -1217,7 +1217,7 @@ function ac({ editor: e }) {
|
|
|
1217
1217
|
tooltip: t("editor.edit")
|
|
1218
1218
|
}
|
|
1219
1219
|
),
|
|
1220
|
-
/* @__PURE__ */ r(
|
|
1220
|
+
/* @__PURE__ */ r(wn, { width: c, maxWidth: i, height: s, onOk: h, children: /* @__PURE__ */ r(
|
|
1221
1221
|
_,
|
|
1222
1222
|
{
|
|
1223
1223
|
icon: "Settings",
|
|
@@ -1236,7 +1236,7 @@ function ac({ editor: e }) {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
);
|
|
1238
1238
|
}
|
|
1239
|
-
const oc = "_wrap_5y04w_1", cc = "_handlerWrap_5y04w_11", sc = "_innerWrap_5y04w_15", lc = "_emptyWrap_5y04w_23",
|
|
1239
|
+
const oc = "_wrap_5y04w_1", cc = "_handlerWrap_5y04w_11", sc = "_innerWrap_5y04w_15", lc = "_emptyWrap_5y04w_23", Si = {
|
|
1240
1240
|
wrap: oc,
|
|
1241
1241
|
handlerWrap: cc,
|
|
1242
1242
|
innerWrap: sc,
|
|
@@ -1271,7 +1271,7 @@ function dc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
1271
1271
|
/* @__PURE__ */ r(U, { className: "richtext-w-[60px]", onClick: l, children: "OK" })
|
|
1272
1272
|
] }),
|
|
1273
1273
|
a && /* @__PURE__ */ r(
|
|
1274
|
-
|
|
1274
|
+
hn,
|
|
1275
1275
|
{
|
|
1276
1276
|
size: { width: Number.parseInt(o), height: Number.parseInt(c) },
|
|
1277
1277
|
onResizeStop: (m, f, g, x) => {
|
|
@@ -1280,7 +1280,7 @@ function dc({ editor: e, node: t, updateAttributes: i }) {
|
|
|
1280
1280
|
height: Number.parseInt(c) + x.height
|
|
1281
1281
|
});
|
|
1282
1282
|
},
|
|
1283
|
-
children: /* @__PURE__ */ r("div", { className: ee(
|
|
1283
|
+
children: /* @__PURE__ */ r("div", { className: ee(Si.wrap, "render-wrapper"), children: /* @__PURE__ */ r("div", { className: Si.innerWrap, style: { pointerEvents: n ? "none" : "auto" }, children: /* @__PURE__ */ r(
|
|
1284
1284
|
"iframe",
|
|
1285
1285
|
{
|
|
1286
1286
|
src: a,
|
|
@@ -1382,7 +1382,7 @@ const Re = ce.create({
|
|
|
1382
1382
|
];
|
|
1383
1383
|
},
|
|
1384
1384
|
addNodeView() {
|
|
1385
|
-
return
|
|
1385
|
+
return me(dc);
|
|
1386
1386
|
}
|
|
1387
1387
|
});
|
|
1388
1388
|
function hc({ editor: e }) {
|
|
@@ -1413,7 +1413,7 @@ function hc({ editor: e }) {
|
|
|
1413
1413
|
), x = M(() => e.isActive(Re.name) && !a, [e, a]), b = M(() => at(Re.name, e), [e]);
|
|
1414
1414
|
return /* @__PURE__ */ u(q, { children: [
|
|
1415
1415
|
/* @__PURE__ */ r(
|
|
1416
|
-
|
|
1416
|
+
ue,
|
|
1417
1417
|
{
|
|
1418
1418
|
className: "bubble-menu",
|
|
1419
1419
|
editor: e,
|
|
@@ -1447,7 +1447,7 @@ function hc({ editor: e }) {
|
|
|
1447
1447
|
tooltip: "Open Edit Link"
|
|
1448
1448
|
}
|
|
1449
1449
|
),
|
|
1450
|
-
/* @__PURE__ */ r(
|
|
1450
|
+
/* @__PURE__ */ r(wn, { width: i, height: n, onOk: g, children: /* @__PURE__ */ r(
|
|
1451
1451
|
_,
|
|
1452
1452
|
{
|
|
1453
1453
|
icon: "Settings",
|
|
@@ -1473,7 +1473,7 @@ function hc({ editor: e }) {
|
|
|
1473
1473
|
children: [
|
|
1474
1474
|
/* @__PURE__ */ r(dt, {}),
|
|
1475
1475
|
/* @__PURE__ */ u(Ze, { children: [
|
|
1476
|
-
/* @__PURE__ */ r(
|
|
1476
|
+
/* @__PURE__ */ r(kn, { children: /* @__PURE__ */ r(ht, { children: "Edit Link Iframe" }) }),
|
|
1477
1477
|
/* @__PURE__ */ r(
|
|
1478
1478
|
te,
|
|
1479
1479
|
{
|
|
@@ -1494,7 +1494,7 @@ function hc({ editor: e }) {
|
|
|
1494
1494
|
)
|
|
1495
1495
|
] });
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function Cn(e = 8) {
|
|
1498
1498
|
return Math.random().toString(36).substring(2, e + 2);
|
|
1499
1499
|
}
|
|
1500
1500
|
function uc(e) {
|
|
@@ -1524,7 +1524,7 @@ function xc(e) {
|
|
|
1524
1524
|
), i.readAsDataURL(e);
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
1527
|
-
function
|
|
1527
|
+
function ui(e, t) {
|
|
1528
1528
|
const i = e.split(","), n = i[0].match(/:(.*?);/)[1], a = atob(i[i.length - 1]);
|
|
1529
1529
|
let o = a.length;
|
|
1530
1530
|
const c = new Uint8Array(o);
|
|
@@ -1532,9 +1532,9 @@ function fi(e, t) {
|
|
|
1532
1532
|
c[o] = a.charCodeAt(o);
|
|
1533
1533
|
return new File([c], t, { type: n });
|
|
1534
1534
|
}
|
|
1535
|
-
const
|
|
1535
|
+
const Mi = `graph TB
|
|
1536
1536
|
a-->b`, pc = ({ editor: e, attrs: t, extension: i }) => {
|
|
1537
|
-
const { alt: n, align: a } = t, [o, c] = w(decodeURIComponent(n ??
|
|
1537
|
+
const { alt: n, align: a } = t, [o, c] = w(decodeURIComponent(n ?? Mi)), [s, h] = w(""), [l, d] = w(!1), m = X(null), f = i == null ? void 0 : i.options.upload, g = async (k) => {
|
|
1538
1538
|
try {
|
|
1539
1539
|
const { svg: L } = await Ct.render("mermaid-svg", k);
|
|
1540
1540
|
h(L);
|
|
@@ -1580,15 +1580,18 @@ a-->b`, pc = ({ editor: e, attrs: t, extension: i }) => {
|
|
|
1580
1580
|
autoFocus: !0,
|
|
1581
1581
|
required: !0,
|
|
1582
1582
|
rows: 10,
|
|
1583
|
-
defaultValue:
|
|
1584
|
-
placeholder: "Text"
|
|
1583
|
+
defaultValue: Mi,
|
|
1584
|
+
placeholder: "Text",
|
|
1585
|
+
style: {
|
|
1586
|
+
color: "hsl(var(--richtext-foreground))"
|
|
1587
|
+
}
|
|
1585
1588
|
}
|
|
1586
1589
|
),
|
|
1587
1590
|
/* @__PURE__ */ r(
|
|
1588
1591
|
"div",
|
|
1589
1592
|
{
|
|
1590
1593
|
className: "richtext-flex-1 richtext-flex richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",
|
|
1591
|
-
style: { height: "100%", border: "1px solid hsl(var(--border))", minHeight: 500 },
|
|
1594
|
+
style: { height: "100%", border: "1px solid hsl(var(--border))", minHeight: 500, background: "#fff" },
|
|
1592
1595
|
ref: m,
|
|
1593
1596
|
dangerouslySetInnerHTML: { __html: s }
|
|
1594
1597
|
}
|
|
@@ -1601,10 +1604,10 @@ a-->b`, pc = ({ editor: e, attrs: t, extension: i }) => {
|
|
|
1601
1604
|
onClick: async () => {
|
|
1602
1605
|
if (o !== "") {
|
|
1603
1606
|
if (o) {
|
|
1604
|
-
const k = m.current.querySelector("svg"), { width: L, height: p } = k.getBoundingClientRect(), v = `mermaid-${
|
|
1605
|
-
let C =
|
|
1607
|
+
const k = m.current.querySelector("svg"), { width: L, height: p } = k.getBoundingClientRect(), v = `mermaid-${Cn()}.svg`;
|
|
1608
|
+
let C = nn(k.outerHTML);
|
|
1606
1609
|
if (f) {
|
|
1607
|
-
const T =
|
|
1610
|
+
const T = ui(C, v);
|
|
1608
1611
|
C = await f(T);
|
|
1609
1612
|
}
|
|
1610
1613
|
e == null || e.chain().focus().setMermaid(
|
|
@@ -1650,7 +1653,7 @@ const wc = {
|
|
|
1650
1653
|
function _c({ item: e, disabled: t, editor: i }) {
|
|
1651
1654
|
var a;
|
|
1652
1655
|
const n = e.component;
|
|
1653
|
-
return n ? /* @__PURE__ */ r(nt, { children: e.type === "divider" ? /* @__PURE__ */ r(
|
|
1656
|
+
return n ? /* @__PURE__ */ r(nt, { children: e.type === "divider" ? /* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]" }) : /* @__PURE__ */ r(
|
|
1654
1657
|
n,
|
|
1655
1658
|
{
|
|
1656
1659
|
...e.componentProps,
|
|
@@ -1663,7 +1666,7 @@ function vc(e) {
|
|
|
1663
1666
|
return e.type.name === "mermaid";
|
|
1664
1667
|
}
|
|
1665
1668
|
function yc(e) {
|
|
1666
|
-
const { lang: t } = F(), i = ot(e.editor,
|
|
1669
|
+
const { lang: t } = F(), i = ot(e.editor, Wi.name), n = bc(e.editor, Wi.name), a = ({ editor: c }) => {
|
|
1667
1670
|
const { selection: s } = c.view.state, { $from: h, to: l } = s;
|
|
1668
1671
|
let d = !1;
|
|
1669
1672
|
return c.view.state.doc.nodesBetween(h.pos, l, (m) => {
|
|
@@ -1672,7 +1675,7 @@ function yc(e) {
|
|
|
1672
1675
|
}), d;
|
|
1673
1676
|
}, o = O(() => e.disabled ? [] : ls(e.editor), [e.disabled, e.editor, t]);
|
|
1674
1677
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
1675
|
-
|
|
1678
|
+
ue,
|
|
1676
1679
|
{
|
|
1677
1680
|
shouldShow: a,
|
|
1678
1681
|
editor: e == null ? void 0 : e.editor,
|
|
@@ -1705,7 +1708,7 @@ function kc({ editor: e, disabled: t, bubbleMenu: i }) {
|
|
|
1705
1708
|
n.includes("table") && !((c = i == null ? void 0 : i.tableConfig) != null && c.hidden) ? /* @__PURE__ */ r(ws, { editor: e }, "table") : null,
|
|
1706
1709
|
n.includes("link") && !((s = i == null ? void 0 : i.linkConfig) != null && s.hidden) ? /* @__PURE__ */ r(vs, { editor: e, disabled: t }, "link") : null,
|
|
1707
1710
|
n.includes("image") && !((h = i == null ? void 0 : i.imageConfig) != null && h.hidden) ? /* @__PURE__ */ r(Ns, { editor: e, disabled: t }, "image") : null,
|
|
1708
|
-
n.includes(
|
|
1711
|
+
n.includes($n.name) && !((l = i == null ? void 0 : i.imageGifConfig) != null && l.hidden) ? /* @__PURE__ */ r(Ts, { editor: e, disabled: t }, "imageGif") : null,
|
|
1709
1712
|
n.includes("video") && !((d = i == null ? void 0 : i.videoConfig) != null && d.hidden) ? /* @__PURE__ */ r(Ls, { editor: e, disabled: t }, "video") : null,
|
|
1710
1713
|
n.includes("katex") && !((m = i == null ? void 0 : i.katexConfig) != null && m.hidden) ? /* @__PURE__ */ r(Ho, { editor: e, disabled: t }, "katex") : null,
|
|
1711
1714
|
n.includes("excalidraw") && !((f = i == null ? void 0 : i.excalidrawConfig) != null && f.hidden) ? /* @__PURE__ */ r(ac, { editor: e, disabled: t }, "excalidraw") : null,
|
|
@@ -1717,17 +1720,17 @@ function kc({ editor: e, disabled: t, bubbleMenu: i }) {
|
|
|
1717
1720
|
};
|
|
1718
1721
|
return i != null && i.render ? i.render({ editor: e, disabled: t || !1, bubbleMenu: i }, a()) : a().filter(Boolean);
|
|
1719
1722
|
}
|
|
1720
|
-
function
|
|
1723
|
+
function Ii() {
|
|
1721
1724
|
return /* @__PURE__ */ r("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { fill: "currentColor", d: "M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z" }) });
|
|
1722
1725
|
}
|
|
1723
|
-
function
|
|
1726
|
+
function Nn(e) {
|
|
1724
1727
|
const { t } = F(), {
|
|
1725
1728
|
highlight: i = !1,
|
|
1726
1729
|
disabled: n = !1,
|
|
1727
1730
|
selectedColor: a,
|
|
1728
1731
|
setSelectedColor: o,
|
|
1729
1732
|
onChange: c,
|
|
1730
|
-
colors: s =
|
|
1733
|
+
colors: s = eo
|
|
1731
1734
|
} = e, h = O(() => {
|
|
1732
1735
|
const g = s, x = [];
|
|
1733
1736
|
for (let b = 0; b < g.length; b += 10)
|
|
@@ -1753,7 +1756,7 @@ function Tn(e) {
|
|
|
1753
1756
|
className: "richtext-flex richtext-items-center richtext-p-1 richtext-cursor-pointer rd-1 richtext-gap-[4px] hover:richtext-bg-accent",
|
|
1754
1757
|
onClick: () => f(void 0),
|
|
1755
1758
|
children: [
|
|
1756
|
-
/* @__PURE__ */ r(
|
|
1759
|
+
/* @__PURE__ */ r(Ii, {}),
|
|
1757
1760
|
/* @__PURE__ */ r("span", { className: "richtext-ml-1 richtext-text-sm", children: t("editor.nofill") })
|
|
1758
1761
|
]
|
|
1759
1762
|
}
|
|
@@ -1765,7 +1768,7 @@ function Tn(e) {
|
|
|
1765
1768
|
f(void 0);
|
|
1766
1769
|
},
|
|
1767
1770
|
children: [
|
|
1768
|
-
/* @__PURE__ */ r(
|
|
1771
|
+
/* @__PURE__ */ r(Ii, {}),
|
|
1769
1772
|
/* @__PURE__ */ r("span", { className: "richtext-ml-1 richtext-text-sm", children: t("editor.default") })
|
|
1770
1773
|
]
|
|
1771
1774
|
}
|
|
@@ -1863,7 +1866,7 @@ function Cc({ setColor: e }) {
|
|
|
1863
1866
|
) }),
|
|
1864
1867
|
/* @__PURE__ */ u(ie, { children: [
|
|
1865
1868
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-justify-center", children: [
|
|
1866
|
-
/* @__PURE__ */ r(
|
|
1869
|
+
/* @__PURE__ */ r(go, { color: t, onChange: i }),
|
|
1867
1870
|
/* @__PURE__ */ r(
|
|
1868
1871
|
te,
|
|
1869
1872
|
{
|
|
@@ -1876,7 +1879,7 @@ function Cc({ setColor: e }) {
|
|
|
1876
1879
|
}
|
|
1877
1880
|
)
|
|
1878
1881
|
] }),
|
|
1879
|
-
/* @__PURE__ */ r(
|
|
1882
|
+
/* @__PURE__ */ r(he, { className: "richtext-my-[10px]" }),
|
|
1880
1883
|
/* @__PURE__ */ r(
|
|
1881
1884
|
U,
|
|
1882
1885
|
{
|
|
@@ -1884,7 +1887,7 @@ function Cc({ setColor: e }) {
|
|
|
1884
1887
|
c.preventDefault(), e(t), a(!1);
|
|
1885
1888
|
},
|
|
1886
1889
|
className: "richtext-w-full",
|
|
1887
|
-
children: /* @__PURE__ */ r(
|
|
1890
|
+
children: /* @__PURE__ */ r(Xi, { size: 16 })
|
|
1888
1891
|
}
|
|
1889
1892
|
)
|
|
1890
1893
|
] })
|
|
@@ -2024,17 +2027,17 @@ video {
|
|
|
2024
2027
|
height: auto
|
|
2025
2028
|
}
|
|
2026
2029
|
}
|
|
2027
|
-
`,
|
|
2030
|
+
`, Tn = mo({
|
|
2028
2031
|
theme: "light"
|
|
2029
2032
|
});
|
|
2030
2033
|
function Tc() {
|
|
2031
|
-
return
|
|
2034
|
+
return fo(Tn).theme;
|
|
2032
2035
|
}
|
|
2033
2036
|
const Lc = {
|
|
2034
2037
|
setTheme: (e) => {
|
|
2035
|
-
|
|
2038
|
+
Tn.theme = e;
|
|
2036
2039
|
}
|
|
2037
|
-
},
|
|
2040
|
+
}, zi = "data-rc-order", Hi = "data-rc-priority", Ac = "rc-util-key", Gt = /* @__PURE__ */ new Map();
|
|
2038
2041
|
function Sc(e, t) {
|
|
2039
2042
|
if (!e)
|
|
2040
2043
|
return !1;
|
|
@@ -2048,30 +2051,30 @@ function Sc(e, t) {
|
|
|
2048
2051
|
}
|
|
2049
2052
|
return !1;
|
|
2050
2053
|
}
|
|
2051
|
-
function
|
|
2054
|
+
function Ln({ mark: e } = {}) {
|
|
2052
2055
|
return e ? e.startsWith("data-") ? e : `data-${e}` : Ac;
|
|
2053
2056
|
}
|
|
2054
|
-
function
|
|
2057
|
+
function mi(e) {
|
|
2055
2058
|
return e.attachTo ? e.attachTo : document.querySelector("head") || document.body;
|
|
2056
2059
|
}
|
|
2057
2060
|
function Mc(e) {
|
|
2058
2061
|
return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
|
|
2059
2062
|
}
|
|
2060
|
-
function
|
|
2063
|
+
function An(e) {
|
|
2061
2064
|
return [...(Gt.get(e) || e).children].filter(
|
|
2062
2065
|
(t) => t.tagName === "STYLE"
|
|
2063
2066
|
);
|
|
2064
2067
|
}
|
|
2065
|
-
function
|
|
2068
|
+
function Sn(e, t = {}) {
|
|
2066
2069
|
const { csp: i, prepend: n, priority: a = 0 } = t, o = Mc(n), c = o === "prependQueue", s = document.createElement("style");
|
|
2067
|
-
s.setAttribute(
|
|
2068
|
-
const h =
|
|
2070
|
+
s.setAttribute(zi, o), c && a && s.setAttribute(Hi, `${a}`), i != null && i.nonce && (s.nonce = i == null ? void 0 : i.nonce), s.innerHTML = e;
|
|
2071
|
+
const h = mi(t), { firstChild: l } = h;
|
|
2069
2072
|
if (n) {
|
|
2070
2073
|
if (c) {
|
|
2071
|
-
const d =
|
|
2072
|
-
if (!["prepend", "prependQueue"].includes(m.getAttribute(
|
|
2074
|
+
const d = An(h).filter((m) => {
|
|
2075
|
+
if (!["prepend", "prependQueue"].includes(m.getAttribute(zi)))
|
|
2073
2076
|
return !1;
|
|
2074
|
-
const f = Number(m.getAttribute(
|
|
2077
|
+
const f = Number(m.getAttribute(Hi) || 0);
|
|
2075
2078
|
return a >= f;
|
|
2076
2079
|
});
|
|
2077
2080
|
if (d.length > 0)
|
|
@@ -2082,30 +2085,30 @@ function Mn(e, t = {}) {
|
|
|
2082
2085
|
h.append(s);
|
|
2083
2086
|
return s;
|
|
2084
2087
|
}
|
|
2085
|
-
function
|
|
2086
|
-
const i =
|
|
2087
|
-
return
|
|
2088
|
+
function Mn(e, t = {}) {
|
|
2089
|
+
const i = mi(t);
|
|
2090
|
+
return An(i).find((n) => n.getAttribute(Ln(t)) === e);
|
|
2088
2091
|
}
|
|
2089
2092
|
function Ic(e, t = {}) {
|
|
2090
|
-
const i =
|
|
2093
|
+
const i = Mn(e, t);
|
|
2091
2094
|
i && i.remove();
|
|
2092
2095
|
}
|
|
2093
2096
|
function zc(e, t) {
|
|
2094
2097
|
const i = Gt.get(e);
|
|
2095
2098
|
if (!i || !Sc(document, i)) {
|
|
2096
|
-
const n =
|
|
2099
|
+
const n = Sn("", t), { parentNode: a } = n;
|
|
2097
2100
|
Gt.set(e, a), n.remove();
|
|
2098
2101
|
}
|
|
2099
2102
|
}
|
|
2100
2103
|
function Hc(e, t, i = {}) {
|
|
2101
2104
|
var c, s, h;
|
|
2102
|
-
const n =
|
|
2105
|
+
const n = mi(i);
|
|
2103
2106
|
zc(n, i);
|
|
2104
|
-
const a =
|
|
2107
|
+
const a = Mn(t, i);
|
|
2105
2108
|
if (a)
|
|
2106
2109
|
return (c = i.csp) != null && c.nonce && a.nonce !== ((s = i.csp) == null ? void 0 : s.nonce) && (a.nonce = (h = i.csp) == null ? void 0 : h.nonce), a.innerHTML !== e && (a.innerHTML = e), a;
|
|
2107
|
-
const o =
|
|
2108
|
-
return o.setAttribute(
|
|
2110
|
+
const o = Sn(e, i);
|
|
2111
|
+
return o.setAttribute(Ln(i), t), o;
|
|
2109
2112
|
}
|
|
2110
2113
|
function Ec({ editor: e, extensions: t }) {
|
|
2111
2114
|
const { t: i } = F(), n = O(() => {
|
|
@@ -2126,16 +2129,16 @@ function Ec({ editor: e, extensions: t }) {
|
|
|
2126
2129
|
}
|
|
2127
2130
|
function Rc(e, t) {
|
|
2128
2131
|
const { content: i, extensions: n, useEditorOptions: a = {} } = e, o = O(() => {
|
|
2129
|
-
const d =
|
|
2132
|
+
const d = Za(n, n, "name");
|
|
2130
2133
|
return [...n.map((f) => {
|
|
2131
2134
|
const g = n.find((x) => x.name === f.name);
|
|
2132
2135
|
return g ? f.configure(g.options) : f;
|
|
2133
2136
|
}), ...d].map((f, g) => f.configure({ sort: g }));
|
|
2134
|
-
}, [n]), c =
|
|
2137
|
+
}, [n]), c = Le((d) => {
|
|
2135
2138
|
var f;
|
|
2136
2139
|
const m = h(d, e.output);
|
|
2137
2140
|
(f = e == null ? void 0 : e.onChangeContent) == null || f.call(e, m);
|
|
2138
|
-
},
|
|
2141
|
+
}, to), s = oa({
|
|
2139
2142
|
extensions: o,
|
|
2140
2143
|
content: i,
|
|
2141
2144
|
onUpdate: ({ editor: d }) => {
|
|
@@ -2143,7 +2146,7 @@ function Rc(e, t) {
|
|
|
2143
2146
|
},
|
|
2144
2147
|
...a
|
|
2145
2148
|
});
|
|
2146
|
-
|
|
2149
|
+
Tt(t, () => ({
|
|
2147
2150
|
editor: s
|
|
2148
2151
|
})), z(() => {
|
|
2149
2152
|
document.documentElement.classList.toggle("dark", e.dark), Lc.setTheme(e.dark ? "dark" : "light");
|
|
@@ -2159,15 +2162,15 @@ function Rc(e, t) {
|
|
|
2159
2162
|
var d;
|
|
2160
2163
|
(d = s == null ? void 0 : s.destroy) == null || d.call(s);
|
|
2161
2164
|
}, []);
|
|
2162
|
-
const l =
|
|
2163
|
-
return s ? /* @__PURE__ */ r("div", { className: "reactjs-tiptap-editor", children: /* @__PURE__ */ r(
|
|
2165
|
+
const l = vn(s, "characterCount");
|
|
2166
|
+
return s ? /* @__PURE__ */ r("div", { className: "reactjs-tiptap-editor", children: /* @__PURE__ */ r(Ao, { delayDuration: 0, children: /* @__PURE__ */ r("div", { className: "richtext-rounded-[0.5rem] richtext-bg-background richtext-shadow richtext-overflow-hidden richtext-outline richtext-outline-1", children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col richtext-w-full richtext-max-h-full", children: [
|
|
2164
2167
|
!(e != null && e.hideToolbar) && /* @__PURE__ */ r(Oc, { editor: s, disabled: !!(e != null && e.disabled) }),
|
|
2165
|
-
/* @__PURE__ */ r(
|
|
2168
|
+
/* @__PURE__ */ r(ca, { className: `richtext-relative ${(e == null ? void 0 : e.contentClass) || ""}`, editor: s }),
|
|
2166
2169
|
l && /* @__PURE__ */ r(Ec, { editor: s, extensions: n }),
|
|
2167
2170
|
!(e != null && e.hideBubble) && /* @__PURE__ */ r(kc, { bubbleMenu: e == null ? void 0 : e.bubbleMenu, editor: s, disabled: e == null ? void 0 : e.disabled })
|
|
2168
2171
|
] }) }) }) }) : /* @__PURE__ */ r(q, {});
|
|
2169
2172
|
}
|
|
2170
|
-
const kh =
|
|
2173
|
+
const kh = Nt(Rc);
|
|
2171
2174
|
function Oc({ editor: e, disabled: t }) {
|
|
2172
2175
|
const { t: i, lang: n } = F(), a = O(() => {
|
|
2173
2176
|
const c = [...e.extensionManager.extensions].sort((h, l) => {
|
|
@@ -2209,7 +2212,7 @@ function Oc({ editor: e, disabled: t }) {
|
|
|
2209
2212
|
var h, l;
|
|
2210
2213
|
const s = o.button.component;
|
|
2211
2214
|
return /* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center", children: [
|
|
2212
|
-
(o == null ? void 0 : o.spacer) && /* @__PURE__ */ r(
|
|
2215
|
+
(o == null ? void 0 : o.spacer) && /* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-h-[16px] !richtext-mx-[10px]" }),
|
|
2213
2216
|
/* @__PURE__ */ r(
|
|
2214
2217
|
s,
|
|
2215
2218
|
{
|
|
@@ -2217,7 +2220,7 @@ function Oc({ editor: e, disabled: t }) {
|
|
|
2217
2220
|
disabled: t || ((l = (h = o == null ? void 0 : o.button) == null ? void 0 : h.componentProps) == null ? void 0 : l.disabled)
|
|
2218
2221
|
}
|
|
2219
2222
|
),
|
|
2220
|
-
(o == null ? void 0 : o.divider) && /* @__PURE__ */ r(
|
|
2223
|
+
(o == null ? void 0 : o.divider) && /* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-h-auto !richtext-mx-2" })
|
|
2221
2224
|
] }, `toolbar-item-${c}`);
|
|
2222
2225
|
}) })
|
|
2223
2226
|
}
|
|
@@ -2321,7 +2324,7 @@ function Fc(e) {
|
|
|
2321
2324
|
}
|
|
2322
2325
|
) });
|
|
2323
2326
|
}
|
|
2324
|
-
function
|
|
2327
|
+
function In(e) {
|
|
2325
2328
|
return /* @__PURE__ */ r(
|
|
2326
2329
|
"svg",
|
|
2327
2330
|
{
|
|
@@ -2388,13 +2391,13 @@ function qc() {
|
|
|
2388
2391
|
}
|
|
2389
2392
|
);
|
|
2390
2393
|
}
|
|
2391
|
-
function
|
|
2394
|
+
function zn() {
|
|
2392
2395
|
return /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 32 32", children: [
|
|
2393
2396
|
/* @__PURE__ */ r("path", { fill: "currentColor", d: "M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z" }),
|
|
2394
2397
|
/* @__PURE__ */ r("path", { fill: "currentColor", d: "M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z" })
|
|
2395
2398
|
] });
|
|
2396
2399
|
}
|
|
2397
|
-
function
|
|
2400
|
+
function Hn() {
|
|
2398
2401
|
return /* @__PURE__ */ u(
|
|
2399
2402
|
"svg",
|
|
2400
2403
|
{
|
|
@@ -2456,100 +2459,100 @@ function es() {
|
|
|
2456
2459
|
] }) });
|
|
2457
2460
|
}
|
|
2458
2461
|
const ut = {
|
|
2459
|
-
Bold:
|
|
2460
|
-
LoaderCircle:
|
|
2461
|
-
Italic:
|
|
2462
|
-
Underline:
|
|
2463
|
-
Quote:
|
|
2462
|
+
Bold: Wn,
|
|
2463
|
+
LoaderCircle: qn,
|
|
2464
|
+
Italic: Kn,
|
|
2465
|
+
Underline: Gn,
|
|
2466
|
+
Quote: Zn,
|
|
2464
2467
|
TextQuote: Dc,
|
|
2465
|
-
Strikethrough:
|
|
2466
|
-
Minus:
|
|
2467
|
-
Eraser:
|
|
2468
|
-
PaintRoller:
|
|
2469
|
-
Redo2:
|
|
2470
|
-
Undo2:
|
|
2471
|
-
AlignCenter:
|
|
2472
|
-
AlignJustify:
|
|
2473
|
-
AlignLeft:
|
|
2474
|
-
AlignRight:
|
|
2475
|
-
ChevronDown:
|
|
2476
|
-
Subscript:
|
|
2477
|
-
Superscript:
|
|
2478
|
-
Code:
|
|
2479
|
-
Code2:
|
|
2480
|
-
Type:
|
|
2481
|
-
IndentIncrease:
|
|
2482
|
-
IndentDecrease:
|
|
2483
|
-
List:
|
|
2484
|
-
ListOrdered:
|
|
2485
|
-
ListTodo:
|
|
2486
|
-
Link:
|
|
2487
|
-
ImageUp:
|
|
2488
|
-
Video:
|
|
2489
|
-
Maximize:
|
|
2490
|
-
Minimize:
|
|
2491
|
-
Table:
|
|
2492
|
-
Sparkles:
|
|
2493
|
-
Pencil:
|
|
2494
|
-
Unlink:
|
|
2495
|
-
BetweenHorizonalEnd:
|
|
2496
|
-
BetweenHorizonalStart:
|
|
2497
|
-
BetweenVerticalStart:
|
|
2498
|
-
BetweenVerticalEnd:
|
|
2499
|
-
TableCellsMerge:
|
|
2500
|
-
TableCellsSplit:
|
|
2501
|
-
Trash2:
|
|
2502
|
-
Trash:
|
|
2503
|
-
Replace:
|
|
2504
|
-
ChevronsUpDown:
|
|
2468
|
+
Strikethrough: Jn,
|
|
2469
|
+
Minus: Xn,
|
|
2470
|
+
Eraser: Yn,
|
|
2471
|
+
PaintRoller: Qn,
|
|
2472
|
+
Redo2: er,
|
|
2473
|
+
Undo2: tr,
|
|
2474
|
+
AlignCenter: xo,
|
|
2475
|
+
AlignJustify: po,
|
|
2476
|
+
AlignLeft: bo,
|
|
2477
|
+
AlignRight: wo,
|
|
2478
|
+
ChevronDown: Lt,
|
|
2479
|
+
Subscript: ir,
|
|
2480
|
+
Superscript: nr,
|
|
2481
|
+
Code: rr,
|
|
2482
|
+
Code2: ar,
|
|
2483
|
+
Type: or,
|
|
2484
|
+
IndentIncrease: cr,
|
|
2485
|
+
IndentDecrease: sr,
|
|
2486
|
+
List: lr,
|
|
2487
|
+
ListOrdered: dr,
|
|
2488
|
+
ListTodo: hr,
|
|
2489
|
+
Link: ur,
|
|
2490
|
+
ImageUp: mr,
|
|
2491
|
+
Video: fr,
|
|
2492
|
+
Maximize: gr,
|
|
2493
|
+
Minimize: xr,
|
|
2494
|
+
Table: pr,
|
|
2495
|
+
Sparkles: br,
|
|
2496
|
+
Pencil: Zi,
|
|
2497
|
+
Unlink: wr,
|
|
2498
|
+
BetweenHorizonalEnd: _r,
|
|
2499
|
+
BetweenHorizonalStart: vr,
|
|
2500
|
+
BetweenVerticalStart: yr,
|
|
2501
|
+
BetweenVerticalEnd: kr,
|
|
2502
|
+
TableCellsMerge: Cr,
|
|
2503
|
+
TableCellsSplit: Nr,
|
|
2504
|
+
Trash2: Ji,
|
|
2505
|
+
Trash: Tr,
|
|
2506
|
+
Replace: _i,
|
|
2507
|
+
ChevronsUpDown: Lr,
|
|
2505
2508
|
LineHeight: Fc,
|
|
2506
2509
|
Word: jc,
|
|
2507
|
-
Heading1:
|
|
2508
|
-
Heading2:
|
|
2509
|
-
Heading3:
|
|
2510
|
-
Heading4:
|
|
2511
|
-
Heading5:
|
|
2512
|
-
Heading6:
|
|
2513
|
-
Columns2:
|
|
2514
|
-
Columns3:
|
|
2515
|
-
Columns4:
|
|
2516
|
-
Plus:
|
|
2517
|
-
Grip:
|
|
2518
|
-
Copy:
|
|
2519
|
-
Clipboard:
|
|
2520
|
-
PanelLeft:
|
|
2521
|
-
PanelRight:
|
|
2522
|
-
Columns:
|
|
2523
|
-
Iframe:
|
|
2524
|
-
MenuDown:
|
|
2510
|
+
Heading1: Ar,
|
|
2511
|
+
Heading2: Sr,
|
|
2512
|
+
Heading3: Mr,
|
|
2513
|
+
Heading4: Ir,
|
|
2514
|
+
Heading5: zr,
|
|
2515
|
+
Heading6: Hr,
|
|
2516
|
+
Columns2: vi,
|
|
2517
|
+
Columns3: Er,
|
|
2518
|
+
Columns4: Rr,
|
|
2519
|
+
Plus: Xi,
|
|
2520
|
+
Grip: Or,
|
|
2521
|
+
Copy: Yi,
|
|
2522
|
+
Clipboard: Pr,
|
|
2523
|
+
PanelLeft: Dr,
|
|
2524
|
+
PanelRight: $r,
|
|
2525
|
+
Columns: vi,
|
|
2526
|
+
Iframe: Br,
|
|
2527
|
+
MenuDown: In,
|
|
2525
2528
|
SizeS: Wc,
|
|
2526
2529
|
SizeM: Vc,
|
|
2527
2530
|
SizeL: Uc,
|
|
2528
2531
|
AspectRatio: Pc,
|
|
2529
|
-
Emoji:
|
|
2532
|
+
Emoji: jr,
|
|
2530
2533
|
DeleteColumn: $c,
|
|
2531
2534
|
DeleteRow: Bc,
|
|
2532
|
-
SearchAndReplace:
|
|
2533
|
-
EmojiIcon:
|
|
2534
|
-
KatexIcon:
|
|
2535
|
-
ExportPdf:
|
|
2536
|
-
ExportWord:
|
|
2535
|
+
SearchAndReplace: _i,
|
|
2536
|
+
EmojiIcon: Fr,
|
|
2537
|
+
KatexIcon: Ur,
|
|
2538
|
+
ExportPdf: zn,
|
|
2539
|
+
ExportWord: Hn,
|
|
2537
2540
|
ImportWord: qc,
|
|
2538
2541
|
ColumnAddLeft: Kc,
|
|
2539
2542
|
ColumnAddRight: Gc,
|
|
2540
|
-
BookMarked:
|
|
2543
|
+
BookMarked: Vr,
|
|
2541
2544
|
Excalidraw: Zc,
|
|
2542
|
-
ZoomIn:
|
|
2543
|
-
ZoomOut:
|
|
2544
|
-
Settings:
|
|
2545
|
-
Eye:
|
|
2545
|
+
ZoomIn: Wr,
|
|
2546
|
+
ZoomOut: qr,
|
|
2547
|
+
Settings: Kr,
|
|
2548
|
+
Eye: Gr,
|
|
2546
2549
|
TextDirection: Jc,
|
|
2547
2550
|
LeftToRight: Xc,
|
|
2548
2551
|
RightToLeft: Yc,
|
|
2549
|
-
Attachment:
|
|
2552
|
+
Attachment: Zr,
|
|
2550
2553
|
GifIcon: Qc,
|
|
2551
|
-
ChevronUp:
|
|
2552
|
-
Crop:
|
|
2554
|
+
ChevronUp: Ki,
|
|
2555
|
+
Crop: Jr,
|
|
2553
2556
|
Mermaid: es
|
|
2554
2557
|
};
|
|
2555
2558
|
function ts(e) {
|
|
@@ -2663,8 +2666,8 @@ function os(e) {
|
|
|
2663
2666
|
componentProps: {
|
|
2664
2667
|
tooltip: W.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
2665
2668
|
icon: i[a],
|
|
2666
|
-
action: () => e.commands.updateVideo({ width:
|
|
2667
|
-
isActive: () => e.isActive("video", { width:
|
|
2669
|
+
action: () => e.commands.updateVideo({ width: jt[n] }),
|
|
2670
|
+
isActive: () => e.isActive("video", { width: jt[n] })
|
|
2668
2671
|
}
|
|
2669
2672
|
}));
|
|
2670
2673
|
}
|
|
@@ -2681,7 +2684,7 @@ function cs(e) {
|
|
|
2681
2684
|
icon: "Trash2",
|
|
2682
2685
|
action: () => {
|
|
2683
2686
|
const { state: t, dispatch: i } = e.view;
|
|
2684
|
-
|
|
2687
|
+
At(t, i);
|
|
2685
2688
|
}
|
|
2686
2689
|
}
|
|
2687
2690
|
}
|
|
@@ -2700,7 +2703,7 @@ function ss(e) {
|
|
|
2700
2703
|
icon: "Trash2",
|
|
2701
2704
|
action: () => {
|
|
2702
2705
|
const { state: t, dispatch: i } = e.view;
|
|
2703
|
-
|
|
2706
|
+
At(t, i);
|
|
2704
2707
|
}
|
|
2705
2708
|
}
|
|
2706
2709
|
}
|
|
@@ -2729,7 +2732,7 @@ function ls(e) {
|
|
|
2729
2732
|
icon: "Trash2",
|
|
2730
2733
|
action: () => {
|
|
2731
2734
|
const { state: t, dispatch: i } = e.view;
|
|
2732
|
-
|
|
2735
|
+
At(t, i);
|
|
2733
2736
|
}
|
|
2734
2737
|
}
|
|
2735
2738
|
}
|
|
@@ -2747,14 +2750,14 @@ function ds(e) {
|
|
|
2747
2750
|
icon: "Trash2",
|
|
2748
2751
|
action: () => {
|
|
2749
2752
|
const { state: t, dispatch: i } = e.view;
|
|
2750
|
-
|
|
2753
|
+
At(t, i);
|
|
2751
2754
|
}
|
|
2752
2755
|
}
|
|
2753
2756
|
}
|
|
2754
2757
|
];
|
|
2755
2758
|
}
|
|
2756
2759
|
function hs(e, t) {
|
|
2757
|
-
return
|
|
2760
|
+
return io.reduce((i, n) => {
|
|
2758
2761
|
if (n === "divider" && i.length > 0)
|
|
2759
2762
|
return [...i, {
|
|
2760
2763
|
type: "divider",
|
|
@@ -2765,18 +2768,18 @@ function hs(e, t) {
|
|
|
2765
2768
|
return a ? [...i, a.configure().options.button({ editor: e, t, extension: a })] : i;
|
|
2766
2769
|
}, []);
|
|
2767
2770
|
}
|
|
2768
|
-
var
|
|
2771
|
+
var Te = /* @__PURE__ */ ((e) => (e[e.max = 7] = "max", e[e.min = 0] = "min", e[e.more = 1] = "more", e[e.less = -1] = "less", e))(Te || {});
|
|
2769
2772
|
function us(e, t, i) {
|
|
2770
2773
|
return e < t ? t : e > i ? i : e;
|
|
2771
2774
|
}
|
|
2772
2775
|
function ms(e, t, i, n) {
|
|
2773
2776
|
const { doc: a, selection: o } = e;
|
|
2774
|
-
if (!a || !o || !(o instanceof
|
|
2777
|
+
if (!a || !o || !(o instanceof Ae || o instanceof rn))
|
|
2775
2778
|
return e;
|
|
2776
2779
|
const { from: c, to: s } = o;
|
|
2777
2780
|
return a.nodesBetween(c, s, (h, l) => {
|
|
2778
2781
|
const d = h.type;
|
|
2779
|
-
return i.includes(d.name) ? (e = Zt(e, l, t), !1) : !
|
|
2782
|
+
return i.includes(d.name) ? (e = Zt(e, l, t), !1) : !sa(h.type.name, n.extensionManager.extensions);
|
|
2780
2783
|
}), e;
|
|
2781
2784
|
}
|
|
2782
2785
|
function Zt(e, t, i) {
|
|
@@ -2794,7 +2797,7 @@ function Zt(e, t, i) {
|
|
|
2794
2797
|
};
|
|
2795
2798
|
return e.setNodeMarkup(t, n.type, s, n.marks);
|
|
2796
2799
|
}
|
|
2797
|
-
function
|
|
2800
|
+
function Ei({ delta: e, types: t }) {
|
|
2798
2801
|
return ({ state: i, dispatch: n, editor: a }) => {
|
|
2799
2802
|
const { selection: o } = i;
|
|
2800
2803
|
let { tr: c } = i;
|
|
@@ -2803,9 +2806,9 @@ function Oi({ delta: e, types: t }) {
|
|
|
2803
2806
|
}
|
|
2804
2807
|
function fs(e) {
|
|
2805
2808
|
var y, R, A;
|
|
2806
|
-
const { pluginKey: t =
|
|
2809
|
+
const { pluginKey: t = vo } = e, { t: i } = F(), [n, a] = w(null), [o, c] = w(-1), s = X(null), h = X(null), [l, d] = w(!1), m = e.editor.extensionManager.extensions.some((N) => N.name === "textAlign"), f = e.editor.extensionManager.extensions.some((N) => N.name === "indent"), g = e.editor.extensionManager.extensions.some((N) => N.name === "clear");
|
|
2807
2810
|
z(() => {
|
|
2808
|
-
s.current && !e.editor.isDestroyed && (h.current =
|
|
2811
|
+
s.current && !e.editor.isDestroyed && (h.current = _o({
|
|
2809
2812
|
editor: e.editor,
|
|
2810
2813
|
element: s.current,
|
|
2811
2814
|
pluginKey: "ContentItemMenu",
|
|
@@ -2888,7 +2891,7 @@ function fs(e) {
|
|
|
2888
2891
|
children: /* @__PURE__ */ r(D, { name: "Plus", className: "richtext-text-lg richtext-text-neutral-600 dark:richtext-text-neutral-200" })
|
|
2889
2892
|
}
|
|
2890
2893
|
),
|
|
2891
|
-
/* @__PURE__ */ u(
|
|
2894
|
+
/* @__PURE__ */ u(_e, { open: l, onOpenChange: $, children: [
|
|
2892
2895
|
/* @__PURE__ */ u("div", { className: "richtext-relative richtext-flex richtext-flex-col", children: [
|
|
2893
2896
|
/* @__PURE__ */ u(Ke, { children: [
|
|
2894
2897
|
/* @__PURE__ */ r(Ge, { asChild: !0, disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(
|
|
@@ -2907,11 +2910,11 @@ function fs(e) {
|
|
|
2907
2910
|
) }),
|
|
2908
2911
|
/* @__PURE__ */ r(Ie, { children: i("editor.draghandle.tooltip") })
|
|
2909
2912
|
] }),
|
|
2910
|
-
/* @__PURE__ */ r(
|
|
2913
|
+
/* @__PURE__ */ r(ve, { className: "richtext-absolute richtext-top-0 richtext-left-0 richtext-w-[28px] richtext-h-[28px] richtext-z-0" })
|
|
2911
2914
|
] }),
|
|
2912
|
-
/* @__PURE__ */ u(
|
|
2915
|
+
/* @__PURE__ */ u(pe, { className: "richtext-w-48", align: "start", side: "bottom", sideOffset: 0, children: [
|
|
2913
2916
|
/* @__PURE__ */ u(
|
|
2914
|
-
|
|
2917
|
+
le,
|
|
2915
2918
|
{
|
|
2916
2919
|
onClick: C,
|
|
2917
2920
|
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",
|
|
@@ -2921,51 +2924,51 @@ function fs(e) {
|
|
|
2921
2924
|
]
|
|
2922
2925
|
}
|
|
2923
2926
|
),
|
|
2924
|
-
g ? /* @__PURE__ */ u(
|
|
2927
|
+
g ? /* @__PURE__ */ u(le, { className: "richtext-flex richtext-gap-3", onClick: x, children: [
|
|
2925
2928
|
/* @__PURE__ */ r(D, { name: "PaintRoller" }),
|
|
2926
2929
|
/* @__PURE__ */ r("span", { children: i("editor.clear.tooltip") })
|
|
2927
2930
|
] }) : null,
|
|
2928
|
-
/* @__PURE__ */ u(
|
|
2931
|
+
/* @__PURE__ */ u(le, { className: "richtext-flex richtext-gap-3", onClick: b, children: [
|
|
2929
2932
|
/* @__PURE__ */ r(D, { name: "Clipboard" }),
|
|
2930
2933
|
/* @__PURE__ */ r("span", { children: i("editor.copyToClipboard") })
|
|
2931
2934
|
] }),
|
|
2932
|
-
/* @__PURE__ */ u(
|
|
2935
|
+
/* @__PURE__ */ u(le, { className: "richtext-flex richtext-gap-3", onClick: k, children: [
|
|
2933
2936
|
/* @__PURE__ */ r(D, { name: "Copy" }),
|
|
2934
2937
|
/* @__PURE__ */ r("span", { children: i("editor.copy") })
|
|
2935
2938
|
] }),
|
|
2936
|
-
m || f ? /* @__PURE__ */ r(
|
|
2937
|
-
m ? /* @__PURE__ */ u(
|
|
2938
|
-
/* @__PURE__ */ u(
|
|
2939
|
+
m || f ? /* @__PURE__ */ r(It, {}) : null,
|
|
2940
|
+
m ? /* @__PURE__ */ u(Ni, { children: [
|
|
2941
|
+
/* @__PURE__ */ u(Ut, { className: "richtext-flex richtext-gap-3", children: [
|
|
2939
2942
|
/* @__PURE__ */ r(D, { name: "AlignCenter" }),
|
|
2940
2943
|
/* @__PURE__ */ r("span", { children: i("editor.textalign.tooltip") })
|
|
2941
2944
|
] }),
|
|
2942
|
-
/* @__PURE__ */ r(
|
|
2943
|
-
/* @__PURE__ */ u(
|
|
2945
|
+
/* @__PURE__ */ r(Ci, { children: /* @__PURE__ */ u(Vt, { children: [
|
|
2946
|
+
/* @__PURE__ */ u(le, { className: "richtext-flex richtext-gap-3", onClick: () => L("left"), children: [
|
|
2944
2947
|
/* @__PURE__ */ r(D, { name: "AlignLeft" }),
|
|
2945
2948
|
/* @__PURE__ */ r("span", { children: i("editor.textalign.left.tooltip") })
|
|
2946
2949
|
] }),
|
|
2947
|
-
/* @__PURE__ */ u(
|
|
2950
|
+
/* @__PURE__ */ u(le, { className: "richtext-flex richtext-gap-3", onClick: () => L("center"), children: [
|
|
2948
2951
|
/* @__PURE__ */ r(D, { name: "AlignCenter" }),
|
|
2949
2952
|
/* @__PURE__ */ r("span", { children: i("editor.textalign.center.tooltip") })
|
|
2950
2953
|
] }),
|
|
2951
|
-
/* @__PURE__ */ u(
|
|
2954
|
+
/* @__PURE__ */ u(le, { className: "richtext-flex richtext-gap-3", onClick: () => L("right"), children: [
|
|
2952
2955
|
/* @__PURE__ */ r(D, { name: "AlignRight" }),
|
|
2953
2956
|
/* @__PURE__ */ r("span", { children: i("editor.textalign.right.tooltip") })
|
|
2954
2957
|
] })
|
|
2955
2958
|
] }) })
|
|
2956
2959
|
] }) : null,
|
|
2957
|
-
f ? /* @__PURE__ */ u(
|
|
2958
|
-
/* @__PURE__ */ u(
|
|
2960
|
+
f ? /* @__PURE__ */ u(Ni, { children: [
|
|
2961
|
+
/* @__PURE__ */ u(Ut, { className: "richtext-flex richtext-gap-3", children: [
|
|
2959
2962
|
/* @__PURE__ */ r(D, { name: "IndentIncrease" }),
|
|
2960
2963
|
/* @__PURE__ */ r("span", { children: i("editor.indent") })
|
|
2961
2964
|
] }),
|
|
2962
|
-
/* @__PURE__ */ r(
|
|
2965
|
+
/* @__PURE__ */ r(Ci, { children: /* @__PURE__ */ u(Vt, { children: [
|
|
2963
2966
|
/* @__PURE__ */ u(
|
|
2964
|
-
|
|
2967
|
+
le,
|
|
2965
2968
|
{
|
|
2966
2969
|
className: "richtext-flex richtext-gap-3",
|
|
2967
2970
|
onClick: p,
|
|
2968
|
-
disabled: ((R = n == null ? void 0 : n.attrs) == null ? void 0 : R.indent) >=
|
|
2971
|
+
disabled: ((R = n == null ? void 0 : n.attrs) == null ? void 0 : R.indent) >= Te.max,
|
|
2969
2972
|
children: [
|
|
2970
2973
|
/* @__PURE__ */ r(D, { name: "IndentIncrease" }),
|
|
2971
2974
|
/* @__PURE__ */ r("span", { children: i("editor.indent.tooltip") })
|
|
@@ -2973,11 +2976,11 @@ function fs(e) {
|
|
|
2973
2976
|
}
|
|
2974
2977
|
),
|
|
2975
2978
|
/* @__PURE__ */ u(
|
|
2976
|
-
|
|
2979
|
+
le,
|
|
2977
2980
|
{
|
|
2978
2981
|
className: "richtext-flex richtext-gap-3",
|
|
2979
2982
|
onClick: v,
|
|
2980
|
-
disabled: ((A = n == null ? void 0 : n.attrs) == null ? void 0 : A.indent) <=
|
|
2983
|
+
disabled: ((A = n == null ? void 0 : n.attrs) == null ? void 0 : A.indent) <= Te.min,
|
|
2981
2984
|
children: [
|
|
2982
2985
|
/* @__PURE__ */ r(D, { name: "IndentDecrease" }),
|
|
2983
2986
|
/* @__PURE__ */ r("span", { children: i("editor.outdent.tooltip") })
|
|
@@ -3013,10 +3016,10 @@ function xs({ item: e, disabled: t, editor: i }) {
|
|
|
3013
3016
|
function ps(e) {
|
|
3014
3017
|
const { t, lang: i } = F(), n = ({ editor: o }) => {
|
|
3015
3018
|
const { selection: c } = o.view.state, { $from: s, to: h } = c;
|
|
3016
|
-
return s.pos === h ? !1 : c instanceof
|
|
3019
|
+
return s.pos === h ? !1 : c instanceof Ae;
|
|
3017
3020
|
}, a = O(() => e.disabled || !(e != null && e.editor) ? [] : hs(e.editor, t), [e.disabled, e.editor, i, t]);
|
|
3018
|
-
return /* @__PURE__ */ r(
|
|
3019
|
-
|
|
3021
|
+
return /* @__PURE__ */ r(ue, { shouldShow: n, editor: e == null ? void 0 : e.editor, tippyOptions: gs, 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(
|
|
3022
|
+
he,
|
|
3020
3023
|
{
|
|
3021
3024
|
orientation: "vertical",
|
|
3022
3025
|
className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"
|
|
@@ -3084,7 +3087,7 @@ function bs({ fill: e }) {
|
|
|
3084
3087
|
}
|
|
3085
3088
|
);
|
|
3086
3089
|
}
|
|
3087
|
-
function
|
|
3090
|
+
function En(e) {
|
|
3088
3091
|
const [t, i] = w(void 0);
|
|
3089
3092
|
function n(c) {
|
|
3090
3093
|
var s;
|
|
@@ -3113,7 +3116,7 @@ function Rn(e) {
|
|
|
3113
3116
|
}
|
|
3114
3117
|
),
|
|
3115
3118
|
/* @__PURE__ */ r(
|
|
3116
|
-
|
|
3119
|
+
Nn,
|
|
3117
3120
|
{
|
|
3118
3121
|
selectedColor: t,
|
|
3119
3122
|
setSelectedColor: o,
|
|
@@ -3127,7 +3130,7 @@ function Rn(e) {
|
|
|
3127
3130
|
}
|
|
3128
3131
|
function ws({ editor: e }) {
|
|
3129
3132
|
var x, b, k, L, p, v, C, T, I, $, y, R, A, N, B, S, E, H;
|
|
3130
|
-
const t = ({ editor: J }) =>
|
|
3133
|
+
const t = ({ editor: J }) => la(J.view.state, "table"), { t: i } = F();
|
|
3131
3134
|
function n() {
|
|
3132
3135
|
e.chain().focus().addColumnBefore().run();
|
|
3133
3136
|
}
|
|
@@ -3159,7 +3162,7 @@ function ws({ editor: e }) {
|
|
|
3159
3162
|
e.chain().focus().setTableCellBackground(J).run();
|
|
3160
3163
|
}
|
|
3161
3164
|
return /* @__PURE__ */ r(
|
|
3162
|
-
|
|
3165
|
+
ue,
|
|
3163
3166
|
{
|
|
3164
3167
|
editor: e,
|
|
3165
3168
|
pluginKey: "table",
|
|
@@ -3172,7 +3175,7 @@ function ws({ editor: e }) {
|
|
|
3172
3175
|
},
|
|
3173
3176
|
maxWidth: "auto",
|
|
3174
3177
|
getReferenceClientRect: () => {
|
|
3175
|
-
var
|
|
3178
|
+
var wi;
|
|
3176
3179
|
const {
|
|
3177
3180
|
view: J,
|
|
3178
3181
|
state: {
|
|
@@ -3181,10 +3184,10 @@ function ws({ editor: e }) {
|
|
|
3181
3184
|
} = e, xe = J.domAtPos(Q).node;
|
|
3182
3185
|
if (!xe)
|
|
3183
3186
|
return new DOMRect(-1e3, -1e3, 0, 0);
|
|
3184
|
-
const
|
|
3185
|
-
return
|
|
3187
|
+
const bi = (wi = xe == null ? void 0 : xe.closest) == null ? void 0 : wi.call(xe, ".tableWrapper");
|
|
3188
|
+
return bi ? bi.getBoundingClientRect() : new DOMRect(-1e3, -1e3, 0, 0);
|
|
3186
3189
|
},
|
|
3187
|
-
plugins: [
|
|
3190
|
+
plugins: [co],
|
|
3188
3191
|
sticky: "popper"
|
|
3189
3192
|
},
|
|
3190
3193
|
children: /* @__PURE__ */ u("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: [
|
|
@@ -3224,7 +3227,7 @@ function ws({ editor: e }) {
|
|
|
3224
3227
|
disabled: !((v = e == null ? void 0 : (p = e.can()).deleteColumn) != null && v.call(p))
|
|
3225
3228
|
}
|
|
3226
3229
|
),
|
|
3227
|
-
/* @__PURE__ */ r(
|
|
3230
|
+
/* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]" }),
|
|
3228
3231
|
/* @__PURE__ */ r(
|
|
3229
3232
|
_,
|
|
3230
3233
|
{
|
|
@@ -3261,7 +3264,7 @@ function ws({ editor: e }) {
|
|
|
3261
3264
|
disabled: !((R = (y = e == null ? void 0 : e.can()) == null ? void 0 : y.deleteRow) != null && R.call(y))
|
|
3262
3265
|
}
|
|
3263
3266
|
),
|
|
3264
|
-
/* @__PURE__ */ r(
|
|
3267
|
+
/* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]" }),
|
|
3265
3268
|
/* @__PURE__ */ r(
|
|
3266
3269
|
_,
|
|
3267
3270
|
{
|
|
@@ -3286,9 +3289,9 @@ function ws({ editor: e }) {
|
|
|
3286
3289
|
disabled: !((S = (B = e == null ? void 0 : e.can()) == null ? void 0 : B.splitCell) != null && S.call(B))
|
|
3287
3290
|
}
|
|
3288
3291
|
),
|
|
3289
|
-
/* @__PURE__ */ r(
|
|
3292
|
+
/* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]" }),
|
|
3290
3293
|
/* @__PURE__ */ r(
|
|
3291
|
-
|
|
3294
|
+
En,
|
|
3292
3295
|
{
|
|
3293
3296
|
editor: e,
|
|
3294
3297
|
tooltip: i("editor.table.menu.setCellsBgColor"),
|
|
@@ -3314,7 +3317,7 @@ function ws({ editor: e }) {
|
|
|
3314
3317
|
}
|
|
3315
3318
|
);
|
|
3316
3319
|
}
|
|
3317
|
-
function
|
|
3320
|
+
function Rn(e) {
|
|
3318
3321
|
const { t } = F(), [i, n] = w({
|
|
3319
3322
|
text: "",
|
|
3320
3323
|
link: ""
|
|
@@ -3333,7 +3336,7 @@ function On(e) {
|
|
|
3333
3336
|
s.preventDefault(), e == null || e.onSetLink(i.link, i.text, a);
|
|
3334
3337
|
}
|
|
3335
3338
|
return /* @__PURE__ */ r("div", { className: "richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black border-neutral-200 dark:richtext-border-neutral-800", children: /* @__PURE__ */ u("form", { className: "richtext-flex richtext-flex-col richtext-gap-2", onSubmit: c, children: [
|
|
3336
|
-
/* @__PURE__ */ r(
|
|
3339
|
+
/* @__PURE__ */ r(de, { className: "mb-[6px]", children: t("editor.link.dialog.text") }),
|
|
3337
3340
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
|
|
3338
3341
|
te,
|
|
3339
3342
|
{
|
|
@@ -3345,7 +3348,7 @@ function On(e) {
|
|
|
3345
3348
|
onChange: (s) => n({ ...i, text: s.target.value })
|
|
3346
3349
|
}
|
|
3347
3350
|
) }) }),
|
|
3348
|
-
/* @__PURE__ */ r(
|
|
3351
|
+
/* @__PURE__ */ r(de, { className: "mb-[6px]", children: t("editor.link.dialog.link") }),
|
|
3349
3352
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ u("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: [
|
|
3350
3353
|
/* @__PURE__ */ r(
|
|
3351
3354
|
te,
|
|
@@ -3360,7 +3363,7 @@ function On(e) {
|
|
|
3360
3363
|
/* @__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(D, { className: "richtext-size-5 richtext-text-muted-foreground", name: "Link" }) })
|
|
3361
3364
|
] }) }),
|
|
3362
3365
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-space-x-2", children: [
|
|
3363
|
-
/* @__PURE__ */ r(
|
|
3366
|
+
/* @__PURE__ */ r(de, { children: t("editor.link.dialog.openInNewTab") }),
|
|
3364
3367
|
/* @__PURE__ */ r(
|
|
3365
3368
|
li,
|
|
3366
3369
|
{
|
|
@@ -3384,13 +3387,13 @@ function _s(e) {
|
|
|
3384
3387
|
target: "_blank",
|
|
3385
3388
|
rel: "noopener noreferrer",
|
|
3386
3389
|
className: "richtext-text-sm richtext-underline richtext-break-all",
|
|
3387
|
-
children:
|
|
3390
|
+
children: Ja(e == null ? void 0 : e.link, {
|
|
3388
3391
|
length: 50,
|
|
3389
3392
|
omission: "…"
|
|
3390
3393
|
})
|
|
3391
3394
|
}
|
|
3392
3395
|
),
|
|
3393
|
-
(e == null ? void 0 : e.link) && /* @__PURE__ */ r(
|
|
3396
|
+
(e == null ? void 0 : e.link) && /* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-h-4" }),
|
|
3394
3397
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-nowrap", children: [
|
|
3395
3398
|
/* @__PURE__ */ r(
|
|
3396
3399
|
_,
|
|
@@ -3439,7 +3442,7 @@ function vs({ editor: e, disabled: t }) {
|
|
|
3439
3442
|
e.chain().extendMarkRange("link").unsetLink().focus().run(), n(!1);
|
|
3440
3443
|
}, [e]);
|
|
3441
3444
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
3442
|
-
|
|
3445
|
+
ue,
|
|
3443
3446
|
{
|
|
3444
3447
|
editor: e,
|
|
3445
3448
|
shouldShow: o,
|
|
@@ -3454,7 +3457,7 @@ function vs({ editor: e, disabled: t }) {
|
|
|
3454
3457
|
n(!1);
|
|
3455
3458
|
}
|
|
3456
3459
|
},
|
|
3457
|
-
children: t ? /* @__PURE__ */ r(q, {}) : /* @__PURE__ */ r(q, { children: i ? /* @__PURE__ */ r(
|
|
3460
|
+
children: t ? /* @__PURE__ */ r(q, {}) : /* @__PURE__ */ r(q, { children: i ? /* @__PURE__ */ r(Rn, { onSetLink: c, editor: e }) : /* @__PURE__ */ r(
|
|
3458
3461
|
_s,
|
|
3459
3462
|
{
|
|
3460
3463
|
editor: e,
|
|
@@ -3468,16 +3471,16 @@ function vs({ editor: e, disabled: t }) {
|
|
|
3468
3471
|
}
|
|
3469
3472
|
) });
|
|
3470
3473
|
}
|
|
3471
|
-
const
|
|
3474
|
+
const fi = {
|
|
3472
3475
|
maxWidth: "auto",
|
|
3473
3476
|
zIndex: 20,
|
|
3474
3477
|
appendTo: "parent",
|
|
3475
3478
|
moveTransition: "transform 0.1s ease-out"
|
|
3476
3479
|
};
|
|
3477
|
-
function
|
|
3480
|
+
function gi({ item: e, disabled: t, editor: i }) {
|
|
3478
3481
|
var a;
|
|
3479
3482
|
const n = e.component;
|
|
3480
|
-
return n ? /* @__PURE__ */ r(nt, { children: e.type === "divider" ? /* @__PURE__ */ r(
|
|
3483
|
+
return n ? /* @__PURE__ */ r(nt, { children: e.type === "divider" ? /* @__PURE__ */ r(he, { orientation: "vertical", className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]" }) : /* @__PURE__ */ r(
|
|
3481
3484
|
n,
|
|
3482
3485
|
{
|
|
3483
3486
|
...e.componentProps,
|
|
@@ -3490,7 +3493,7 @@ function ys(e) {
|
|
|
3490
3493
|
return e.type.name === "image";
|
|
3491
3494
|
}
|
|
3492
3495
|
function ks(e) {
|
|
3493
|
-
return e.type.name ===
|
|
3496
|
+
return e.type.name === $n.name;
|
|
3494
3497
|
}
|
|
3495
3498
|
function Cs(e) {
|
|
3496
3499
|
return e.type.name === "video";
|
|
@@ -3505,13 +3508,13 @@ function Ns(e) {
|
|
|
3505
3508
|
}), h;
|
|
3506
3509
|
}, n = O(() => e.disabled ? [] : cs(e.editor), [e.disabled, e.editor, t]);
|
|
3507
3510
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
3508
|
-
|
|
3511
|
+
ue,
|
|
3509
3512
|
{
|
|
3510
3513
|
shouldShow: i,
|
|
3511
3514
|
editor: e == null ? void 0 : e.editor,
|
|
3512
|
-
tippyOptions:
|
|
3515
|
+
tippyOptions: fi,
|
|
3513
3516
|
children: n != null && n.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-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative", children: n == null ? void 0 : n.map((a, o) => /* @__PURE__ */ r(
|
|
3514
|
-
|
|
3517
|
+
gi,
|
|
3515
3518
|
{
|
|
3516
3519
|
item: a,
|
|
3517
3520
|
disabled: e.disabled,
|
|
@@ -3532,13 +3535,13 @@ function Ts(e) {
|
|
|
3532
3535
|
}), h;
|
|
3533
3536
|
}, n = O(() => e.disabled ? [] : ss(e.editor), [e.disabled, e.editor, t]);
|
|
3534
3537
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
3535
|
-
|
|
3538
|
+
ue,
|
|
3536
3539
|
{
|
|
3537
3540
|
shouldShow: i,
|
|
3538
3541
|
editor: e == null ? void 0 : e.editor,
|
|
3539
|
-
tippyOptions:
|
|
3542
|
+
tippyOptions: fi,
|
|
3540
3543
|
children: n != null && n.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-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative", children: n == null ? void 0 : n.map((a, o) => /* @__PURE__ */ r(
|
|
3541
|
-
|
|
3544
|
+
gi,
|
|
3542
3545
|
{
|
|
3543
3546
|
item: a,
|
|
3544
3547
|
disabled: e.disabled,
|
|
@@ -3559,13 +3562,13 @@ function Ls(e) {
|
|
|
3559
3562
|
}), h;
|
|
3560
3563
|
}, n = O(() => e.disabled ? [] : ds(e.editor), [e.editor, e.disabled, t]);
|
|
3561
3564
|
return /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(
|
|
3562
|
-
|
|
3565
|
+
ue,
|
|
3563
3566
|
{
|
|
3564
3567
|
shouldShow: i,
|
|
3565
3568
|
editor: e == null ? void 0 : e.editor,
|
|
3566
|
-
tippyOptions:
|
|
3569
|
+
tippyOptions: fi,
|
|
3567
3570
|
children: n != null && n.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-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative", children: n == null ? void 0 : n.map((a, o) => /* @__PURE__ */ r(
|
|
3568
|
-
|
|
3571
|
+
gi,
|
|
3569
3572
|
{
|
|
3570
3573
|
item: a,
|
|
3571
3574
|
disabled: e.disabled,
|
|
@@ -3579,7 +3582,7 @@ function Ls(e) {
|
|
|
3579
3582
|
function As({ editor: e }) {
|
|
3580
3583
|
const { t } = F(), i = M(() => e.isActive(it.name), [e]), n = M(() => at(it.name, e), [e]), a = M(() => e.chain().focus().addColBefore().run(), [e]), o = M(() => e.chain().focus().addColAfter().run(), [e]), c = M(() => e.chain().focus().deleteCol().run(), [e]);
|
|
3581
3584
|
return /* @__PURE__ */ r(
|
|
3582
|
-
|
|
3585
|
+
ue,
|
|
3583
3586
|
{
|
|
3584
3587
|
pluginKey: "columns-bubble-menu",
|
|
3585
3588
|
editor: e,
|
|
@@ -3632,7 +3635,7 @@ function As({ editor: e }) {
|
|
|
3632
3635
|
}
|
|
3633
3636
|
);
|
|
3634
3637
|
}
|
|
3635
|
-
const Ch =
|
|
3638
|
+
const Ch = da.extend({
|
|
3636
3639
|
addOptions() {
|
|
3637
3640
|
var e;
|
|
3638
3641
|
return {
|
|
@@ -3650,7 +3653,7 @@ const Ch = ha.extend({
|
|
|
3650
3653
|
})
|
|
3651
3654
|
};
|
|
3652
3655
|
}
|
|
3653
|
-
}), Nh =
|
|
3656
|
+
}), Nh = ha.extend({
|
|
3654
3657
|
addOptions() {
|
|
3655
3658
|
var e;
|
|
3656
3659
|
return {
|
|
@@ -3670,7 +3673,7 @@ const Ch = ha.extend({
|
|
|
3670
3673
|
}
|
|
3671
3674
|
};
|
|
3672
3675
|
}
|
|
3673
|
-
}), Th =
|
|
3676
|
+
}), Th = ua.extend({
|
|
3674
3677
|
addOptions() {
|
|
3675
3678
|
var e;
|
|
3676
3679
|
return {
|
|
@@ -3690,7 +3693,7 @@ const Ch = ha.extend({
|
|
|
3690
3693
|
}
|
|
3691
3694
|
};
|
|
3692
3695
|
}
|
|
3693
|
-
}), Lh =
|
|
3696
|
+
}), Lh = ma.extend({
|
|
3694
3697
|
addOptions() {
|
|
3695
3698
|
var e;
|
|
3696
3699
|
return {
|
|
@@ -3708,7 +3711,7 @@ const Ch = ha.extend({
|
|
|
3708
3711
|
})
|
|
3709
3712
|
};
|
|
3710
3713
|
}
|
|
3711
|
-
}), Ah =
|
|
3714
|
+
}), Ah = fa.extend({
|
|
3712
3715
|
addOptions() {
|
|
3713
3716
|
var e;
|
|
3714
3717
|
return {
|
|
@@ -3728,29 +3731,29 @@ const Ch = ha.extend({
|
|
|
3728
3731
|
}
|
|
3729
3732
|
});
|
|
3730
3733
|
let ge, Ye;
|
|
3731
|
-
const
|
|
3734
|
+
const Ot = /* @__PURE__ */ new Set(), Pt = /* @__PURE__ */ new Set();
|
|
3732
3735
|
function Ss() {
|
|
3733
3736
|
return ge;
|
|
3734
3737
|
}
|
|
3735
3738
|
function Ms(e) {
|
|
3736
3739
|
if (!ge && !Ye) {
|
|
3737
3740
|
const t = e.themes.filter(
|
|
3738
|
-
(n) => !!n && n in
|
|
3741
|
+
(n) => !!n && n in on
|
|
3739
3742
|
), i = e.languages.filter(
|
|
3740
|
-
(n) => !!n && n in
|
|
3743
|
+
(n) => !!n && n in cn
|
|
3741
3744
|
);
|
|
3742
|
-
return Ye =
|
|
3745
|
+
return Ye = Qa({ themes: t, langs: i }).then((n) => {
|
|
3743
3746
|
ge = n;
|
|
3744
3747
|
}), Ye;
|
|
3745
3748
|
}
|
|
3746
3749
|
if (Ye)
|
|
3747
3750
|
return Ye;
|
|
3748
3751
|
}
|
|
3749
|
-
async function
|
|
3750
|
-
return ge && !ge.getLoadedThemes().includes(e) && !
|
|
3752
|
+
async function On(e) {
|
|
3753
|
+
return ge && !ge.getLoadedThemes().includes(e) && !Pt.has(e) && e in on ? (Pt.add(e), await ge.loadTheme(e), Pt.delete(e), !0) : !1;
|
|
3751
3754
|
}
|
|
3752
|
-
async function
|
|
3753
|
-
return ge && !ge.getLoadedLanguages().includes(e) && !
|
|
3755
|
+
async function Pn(e) {
|
|
3756
|
+
return ge && !ge.getLoadedLanguages().includes(e) && !Ot.has(e) && e in cn ? (Ot.add(e), await ge.loadLanguage(e), Ot.delete(e), !0) : !1;
|
|
3754
3757
|
}
|
|
3755
3758
|
async function Is({
|
|
3756
3759
|
doc: e,
|
|
@@ -3766,11 +3769,11 @@ async function Is({
|
|
|
3766
3769
|
n
|
|
3767
3770
|
];
|
|
3768
3771
|
ge ? await Promise.all([
|
|
3769
|
-
...o.flatMap((s) =>
|
|
3770
|
-
...c.flatMap((s) => !!s &&
|
|
3772
|
+
...o.flatMap((s) => On(s)),
|
|
3773
|
+
...c.flatMap((s) => !!s && Pn(s))
|
|
3771
3774
|
]) : await Ms({ languages: c, themes: o });
|
|
3772
3775
|
}
|
|
3773
|
-
function
|
|
3776
|
+
function Ri({
|
|
3774
3777
|
doc: e,
|
|
3775
3778
|
name: t,
|
|
3776
3779
|
defaultTheme: i,
|
|
@@ -3803,8 +3806,8 @@ function zs({
|
|
|
3803
3806
|
defaultLanguage: t,
|
|
3804
3807
|
defaultTheme: i
|
|
3805
3808
|
}) {
|
|
3806
|
-
const n = new
|
|
3807
|
-
key: new
|
|
3809
|
+
const n = new be({
|
|
3810
|
+
key: new we("shiki"),
|
|
3808
3811
|
view(a) {
|
|
3809
3812
|
class o {
|
|
3810
3813
|
constructor() {
|
|
@@ -3831,8 +3834,8 @@ function zs({
|
|
|
3831
3834
|
);
|
|
3832
3835
|
if ((await Promise.all(
|
|
3833
3836
|
s.flatMap((d) => [
|
|
3834
|
-
|
|
3835
|
-
|
|
3837
|
+
On(d.node.attrs.theme),
|
|
3838
|
+
Pn(d.node.attrs.language)
|
|
3836
3839
|
])
|
|
3837
3840
|
)).includes(!0)) {
|
|
3838
3841
|
const d = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
|
|
@@ -3843,7 +3846,7 @@ function zs({
|
|
|
3843
3846
|
return new o();
|
|
3844
3847
|
},
|
|
3845
3848
|
state: {
|
|
3846
|
-
init: (a, { doc: o }) =>
|
|
3849
|
+
init: (a, { doc: o }) => Ri({
|
|
3847
3850
|
doc: o,
|
|
3848
3851
|
name: e,
|
|
3849
3852
|
defaultLanguage: t,
|
|
@@ -3857,7 +3860,7 @@ function zs({
|
|
|
3857
3860
|
s.doc,
|
|
3858
3861
|
(g) => g.type.name === e
|
|
3859
3862
|
), f = a.docChanged && ([h, l].includes(e) || m.length !== d.length || a.steps.some((g) => g.from !== void 0 && g.to !== void 0 && d.some((x) => x.pos >= g.from && x.pos + x.node.nodeSize <= g.to)));
|
|
3860
|
-
return a.getMeta("shikiPluginForceDecoration") || f ?
|
|
3863
|
+
return a.getMeta("shikiPluginForceDecoration") || f ? Ri({
|
|
3861
3864
|
doc: a.doc,
|
|
3862
3865
|
name: e,
|
|
3863
3866
|
defaultLanguage: t,
|
|
@@ -3877,12 +3880,12 @@ function Hs({ action: e, languages: t, ...i }) {
|
|
|
3877
3880
|
const n = (o) => {
|
|
3878
3881
|
e(o);
|
|
3879
3882
|
}, a = O(() => t == null ? void 0 : t.map((o) => ({
|
|
3880
|
-
title:
|
|
3883
|
+
title: no[o] || o,
|
|
3881
3884
|
// icon: language.icon,
|
|
3882
3885
|
language: o
|
|
3883
3886
|
})), [t]);
|
|
3884
|
-
return /* @__PURE__ */ u(
|
|
3885
|
-
/* @__PURE__ */ r(
|
|
3887
|
+
return /* @__PURE__ */ u(_e, { children: [
|
|
3888
|
+
/* @__PURE__ */ r(ve, { disabled: i == null ? void 0 : i.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
3886
3889
|
_,
|
|
3887
3890
|
{
|
|
3888
3891
|
tooltip: i == null ? void 0 : i.tooltip,
|
|
@@ -3890,18 +3893,10 @@ function Hs({ action: e, languages: t, ...i }) {
|
|
|
3890
3893
|
icon: i == null ? void 0 : i.icon
|
|
3891
3894
|
}
|
|
3892
3895
|
) }),
|
|
3893
|
-
/* @__PURE__ */ r(
|
|
3894
|
-
Nt,
|
|
3895
|
-
{
|
|
3896
|
-
value: o.language,
|
|
3897
|
-
onClick: () => n(o.language),
|
|
3898
|
-
children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", children: o.title })
|
|
3899
|
-
},
|
|
3900
|
-
`codeblock-${o.title}`
|
|
3901
|
-
)) })
|
|
3896
|
+
/* @__PURE__ */ r(pe, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ r(le, { onClick: () => n(o.language), children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", children: o.title }) }, `codeblock-${o.title}`)) })
|
|
3902
3897
|
] });
|
|
3903
3898
|
}
|
|
3904
|
-
const Es = "_wrap_17npv_1", Rs = "_maxHeight_17npv_10", Os = "_btnCopy_17npv_13", Ps = "_btnDelete_17npv_14", Ds = "_blockInfo_17npv_18", $s = "_selectLang_17npv_28", Bs = "_copied_17npv_54",
|
|
3899
|
+
const Es = "_wrap_17npv_1", Rs = "_maxHeight_17npv_10", Os = "_btnCopy_17npv_13", Ps = "_btnDelete_17npv_14", Ds = "_blockInfo_17npv_18", $s = "_selectLang_17npv_28", Bs = "_copied_17npv_54", Ce = {
|
|
3905
3900
|
wrap: Es,
|
|
3906
3901
|
maxHeight: Rs,
|
|
3907
3902
|
btnCopy: Os,
|
|
@@ -3925,23 +3920,23 @@ function Fs({ editor: e, node: { attrs: t }, updateAttributes: i, extension: n }
|
|
|
3925
3920
|
var f, g;
|
|
3926
3921
|
const { isCopied: a, copyToClipboard: o } = js(), c = O(() => {
|
|
3927
3922
|
var x;
|
|
3928
|
-
return (x = n.options.languages) != null && x.length ? n.options.languages :
|
|
3923
|
+
return (x = n.options.languages) != null && x.length ? n.options.languages : sn;
|
|
3929
3924
|
}, [n.options.languages]), s = e.isEditable, h = (g = (f = e == null ? void 0 : e.options) == null ? void 0 : f.editorProps) == null ? void 0 : g.print, { language: l } = t, d = X(), m = M(() => at(Us.name, e), [e]);
|
|
3930
|
-
return /* @__PURE__ */ u(ne, { className: ee(
|
|
3931
|
-
/* @__PURE__ */ u("div", { className:
|
|
3925
|
+
return /* @__PURE__ */ u(ne, { className: ee(Ce.wrap, !h && Ce.maxHeight, "render-wrapper"), children: [
|
|
3926
|
+
/* @__PURE__ */ u("div", { className: Ce.blockInfo, children: [
|
|
3932
3927
|
/* @__PURE__ */ r(
|
|
3933
3928
|
"span",
|
|
3934
3929
|
{
|
|
3935
3930
|
onClick: () => o(d.current.innerText),
|
|
3936
|
-
className: ee(
|
|
3937
|
-
children: a ? /* @__PURE__ */ r(
|
|
3931
|
+
className: ee(Ce.btnCopy, a && Ce.copied),
|
|
3932
|
+
children: a ? /* @__PURE__ */ r(Xr, { size: 16 }) : /* @__PURE__ */ r(Yi, { size: 16 })
|
|
3938
3933
|
}
|
|
3939
3934
|
),
|
|
3940
3935
|
/* @__PURE__ */ r(
|
|
3941
3936
|
"span",
|
|
3942
3937
|
{
|
|
3943
3938
|
onClick: m,
|
|
3944
|
-
className:
|
|
3939
|
+
className: Ce.btnDelete,
|
|
3945
3940
|
children: /* @__PURE__ */ r(
|
|
3946
3941
|
D,
|
|
3947
3942
|
{
|
|
@@ -3950,26 +3945,26 @@ function Fs({ editor: e, node: { attrs: t }, updateAttributes: i, extension: n }
|
|
|
3950
3945
|
)
|
|
3951
3946
|
}
|
|
3952
3947
|
),
|
|
3953
|
-
/* @__PURE__ */ r("div", { className:
|
|
3954
|
-
|
|
3948
|
+
/* @__PURE__ */ r("div", { className: Ce.selectLang, children: /* @__PURE__ */ u(
|
|
3949
|
+
So,
|
|
3955
3950
|
{
|
|
3956
3951
|
defaultValue: l || "auto",
|
|
3957
3952
|
disabled: !s,
|
|
3958
3953
|
onValueChange: (x) => i({ language: x }),
|
|
3959
3954
|
children: [
|
|
3960
|
-
/* @__PURE__ */ r(
|
|
3961
|
-
/* @__PURE__ */ u(
|
|
3962
|
-
/* @__PURE__ */ r(
|
|
3963
|
-
c.map((x, b) => /* @__PURE__ */ r(
|
|
3955
|
+
/* @__PURE__ */ r(gn, { children: /* @__PURE__ */ r(Mo, { placeholder: "Language" }) }),
|
|
3956
|
+
/* @__PURE__ */ u(bn, { className: "richtext-max-h-60 richtext-overflow-y-auto", children: [
|
|
3957
|
+
/* @__PURE__ */ r(Wt, { value: "auto", children: "Auto" }),
|
|
3958
|
+
c.map((x, b) => /* @__PURE__ */ r(Wt, { value: x, children: x.charAt(0).toUpperCase() + x.slice(1) }, `code-lang-${b}`))
|
|
3964
3959
|
] })
|
|
3965
3960
|
]
|
|
3966
3961
|
}
|
|
3967
3962
|
) })
|
|
3968
3963
|
] }),
|
|
3969
|
-
/* @__PURE__ */ r("pre", { ref: d, children: /* @__PURE__ */ r(
|
|
3964
|
+
/* @__PURE__ */ r("pre", { ref: d, children: /* @__PURE__ */ r(ga, { as: "code" }) })
|
|
3970
3965
|
] });
|
|
3971
3966
|
}
|
|
3972
|
-
const Us =
|
|
3967
|
+
const Us = xa.extend({
|
|
3973
3968
|
addOptions() {
|
|
3974
3969
|
var e;
|
|
3975
3970
|
return {
|
|
@@ -3977,7 +3972,7 @@ const Us = pa.extend({
|
|
|
3977
3972
|
languages: [],
|
|
3978
3973
|
button: ({ editor: t, t: i, extension: n }) => {
|
|
3979
3974
|
var o, c, s;
|
|
3980
|
-
const a = (c = (o = n == null ? void 0 : n.options) == null ? void 0 : o.languages) != null && c.length ? (s = n == null ? void 0 : n.options) == null ? void 0 : s.languages :
|
|
3975
|
+
const a = (c = (o = n == null ? void 0 : n.options) == null ? void 0 : o.languages) != null && c.length ? (s = n == null ? void 0 : n.options) == null ? void 0 : s.languages : sn;
|
|
3981
3976
|
return {
|
|
3982
3977
|
component: Hs,
|
|
3983
3978
|
componentProps: {
|
|
@@ -3995,7 +3990,7 @@ const Us = pa.extend({
|
|
|
3995
3990
|
};
|
|
3996
3991
|
},
|
|
3997
3992
|
addNodeView() {
|
|
3998
|
-
return
|
|
3993
|
+
return me(Fs);
|
|
3999
3994
|
},
|
|
4000
3995
|
addProseMirrorPlugins() {
|
|
4001
3996
|
var e;
|
|
@@ -4024,8 +4019,8 @@ function Vs(e) {
|
|
|
4024
4019
|
action: () => e.editor.chain().focus().unsetFontFamily().run()
|
|
4025
4020
|
};
|
|
4026
4021
|
}, [t, i, e]);
|
|
4027
|
-
return /* @__PURE__ */ u(
|
|
4028
|
-
/* @__PURE__ */ r(
|
|
4022
|
+
return /* @__PURE__ */ u(_e, { children: [
|
|
4023
|
+
/* @__PURE__ */ r(ve, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
4029
4024
|
si,
|
|
4030
4025
|
{
|
|
4031
4026
|
title: ((a = n == null ? void 0 : n.font) == null ? void 0 : a.length) > 7 ? `${(o = n == null ? void 0 : n.font) == null ? void 0 : o.slice(0, 6)}...` : n == null ? void 0 : n.font,
|
|
@@ -4034,21 +4029,21 @@ function Vs(e) {
|
|
|
4034
4029
|
icon: "MenuDown"
|
|
4035
4030
|
}
|
|
4036
4031
|
) }),
|
|
4037
|
-
/* @__PURE__ */ r(
|
|
4032
|
+
/* @__PURE__ */ r(pe, { className: "richtext-w-full", children: (c = e == null ? void 0 : e.items) == null ? void 0 : c.map((s, h) => {
|
|
4038
4033
|
const l = s.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: s.font };
|
|
4039
4034
|
return /* @__PURE__ */ u(nt, { children: [
|
|
4040
4035
|
/* @__PURE__ */ r(Me, { checked: (n == null ? void 0 : n.font) === s.font, onClick: s.action, children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", style: l, children: s.font }) }),
|
|
4041
|
-
s.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(
|
|
4036
|
+
s.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(It, {})
|
|
4042
4037
|
] }, `font-family-${h}`);
|
|
4043
4038
|
}) })
|
|
4044
4039
|
] });
|
|
4045
4040
|
}
|
|
4046
|
-
const Sh =
|
|
4041
|
+
const Sh = pa.extend({
|
|
4047
4042
|
addOptions() {
|
|
4048
4043
|
var e;
|
|
4049
4044
|
return {
|
|
4050
4045
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
4051
|
-
fontFamilyList:
|
|
4046
|
+
fontFamilyList: ro,
|
|
4052
4047
|
button({ editor: t, extension: i, t: n }) {
|
|
4053
4048
|
var l;
|
|
4054
4049
|
const { extensions: a = [] } = t.extensionManager ?? [], o = qt(((l = i == null ? void 0 : i.options) == null ? void 0 : l.fontFamilyList) || []), c = a.find(
|
|
@@ -4096,8 +4091,8 @@ function Ws(e) {
|
|
|
4096
4091
|
isActive: () => !1
|
|
4097
4092
|
};
|
|
4098
4093
|
}, [e]);
|
|
4099
|
-
return /* @__PURE__ */ u(
|
|
4100
|
-
/* @__PURE__ */ r(
|
|
4094
|
+
return /* @__PURE__ */ u(_e, { children: [
|
|
4095
|
+
/* @__PURE__ */ r(ve, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
4101
4096
|
si,
|
|
4102
4097
|
{
|
|
4103
4098
|
title: t == null ? void 0 : t.title,
|
|
@@ -4106,7 +4101,7 @@ function Ws(e) {
|
|
|
4106
4101
|
icon: "MenuDown"
|
|
4107
4102
|
}
|
|
4108
4103
|
) }),
|
|
4109
|
-
/* @__PURE__ */ r(
|
|
4104
|
+
/* @__PURE__ */ r(pe, { className: "richtext-w-full", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((n, a) => {
|
|
4110
4105
|
var o, c;
|
|
4111
4106
|
return /* @__PURE__ */ u(nt, { children: [
|
|
4112
4107
|
/* @__PURE__ */ u(
|
|
@@ -4116,16 +4111,16 @@ function Ws(e) {
|
|
|
4116
4111
|
onClick: n.action,
|
|
4117
4112
|
children: [
|
|
4118
4113
|
/* @__PURE__ */ r("div", { className: `richtext-ml-1 richtext-h-full heading-${n.level}`, children: n.title }),
|
|
4119
|
-
!!((o = n == null ? void 0 : n.shortcutKeys) != null && o.length) && /* @__PURE__ */ r(
|
|
4114
|
+
!!((o = n == null ? void 0 : n.shortcutKeys) != null && o.length) && /* @__PURE__ */ r(fn, { className: "richtext-pl-4", children: (c = n == null ? void 0 : n.shortcutKeys) == null ? void 0 : c.map((s) => St(s)).join(" ") })
|
|
4120
4115
|
]
|
|
4121
4116
|
}
|
|
4122
4117
|
),
|
|
4123
|
-
n.level === 0 && /* @__PURE__ */ r(
|
|
4118
|
+
n.level === 0 && /* @__PURE__ */ r(It, {})
|
|
4124
4119
|
] }, `heading-k-${a}`);
|
|
4125
4120
|
}) })
|
|
4126
4121
|
] });
|
|
4127
4122
|
}
|
|
4128
|
-
const Mh =
|
|
4123
|
+
const Mh = ba.extend({
|
|
4129
4124
|
addOptions() {
|
|
4130
4125
|
var e;
|
|
4131
4126
|
return {
|
|
@@ -4212,7 +4207,7 @@ function qs(e) {
|
|
|
4212
4207
|
) }),
|
|
4213
4208
|
/* @__PURE__ */ u(Ie, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
4214
4209
|
/* @__PURE__ */ r("span", { children: n.title }),
|
|
4215
|
-
!!((o = n.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (c = n.shortcutKeys) == null ? void 0 : c.map((s) =>
|
|
4210
|
+
!!((o = n.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (c = n.shortcutKeys) == null ? void 0 : c.map((s) => St(s)).join(" ") })
|
|
4216
4211
|
] })
|
|
4217
4212
|
] }, `text-align-${a}`);
|
|
4218
4213
|
})
|
|
@@ -4220,7 +4215,7 @@ function qs(e) {
|
|
|
4220
4215
|
)
|
|
4221
4216
|
] });
|
|
4222
4217
|
}
|
|
4223
|
-
const Ih =
|
|
4218
|
+
const Ih = wa.extend({
|
|
4224
4219
|
addOptions() {
|
|
4225
4220
|
var e;
|
|
4226
4221
|
return {
|
|
@@ -4278,8 +4273,8 @@ function Ks(e) {
|
|
|
4278
4273
|
isActive: () => !1
|
|
4279
4274
|
};
|
|
4280
4275
|
}, [e]);
|
|
4281
|
-
return /* @__PURE__ */ u(
|
|
4282
|
-
/* @__PURE__ */ r(
|
|
4276
|
+
return /* @__PURE__ */ u(_e, { children: [
|
|
4277
|
+
/* @__PURE__ */ r(ve, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
4283
4278
|
si,
|
|
4284
4279
|
{
|
|
4285
4280
|
title: i == null ? void 0 : i.title,
|
|
@@ -4288,7 +4283,7 @@ function Ks(e) {
|
|
|
4288
4283
|
icon: "MenuDown"
|
|
4289
4284
|
}
|
|
4290
4285
|
) }),
|
|
4291
|
-
/* @__PURE__ */ r(
|
|
4286
|
+
/* @__PURE__ */ r(pe, { className: "richtext-w-32 richtext-overflow-y-auto richtext-max-h-96", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, o) => /* @__PURE__ */ r(
|
|
4292
4287
|
Me,
|
|
4293
4288
|
{
|
|
4294
4289
|
checked: i.title === a.title,
|
|
@@ -4306,10 +4301,10 @@ const zh = Z.create({
|
|
|
4306
4301
|
return {
|
|
4307
4302
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
4308
4303
|
types: ["textStyle"],
|
|
4309
|
-
fontSizes: [...
|
|
4304
|
+
fontSizes: [...ao],
|
|
4310
4305
|
button({ editor: t, extension: i, t: n }) {
|
|
4311
4306
|
var h;
|
|
4312
|
-
const a = qt(((h = i.options) == null ? void 0 : h.fontSizes) ||
|
|
4307
|
+
const a = qt(((h = i.options) == null ? void 0 : h.fontSizes) || ki), o = qt([ki])[0], c = a.map((l) => ({
|
|
4313
4308
|
title: l.value === o.value ? n("editor.fontSize.default.tooltip") : String(l.name),
|
|
4314
4309
|
isActive: () => {
|
|
4315
4310
|
const { fontSize: d } = t.getAttributes("textStyle");
|
|
@@ -4422,7 +4417,7 @@ function Zs(e) {
|
|
|
4422
4417
|
return /* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-h-[32px]", children: [
|
|
4423
4418
|
/* @__PURE__ */ r(_, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ r("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ r(Gs, { fill: t }) }) }),
|
|
4424
4419
|
/* @__PURE__ */ r(
|
|
4425
|
-
|
|
4420
|
+
Nn,
|
|
4426
4421
|
{
|
|
4427
4422
|
selectedColor: t,
|
|
4428
4423
|
setSelectedColor: o,
|
|
@@ -4435,7 +4430,7 @@ function Zs(e) {
|
|
|
4435
4430
|
)
|
|
4436
4431
|
] });
|
|
4437
4432
|
}
|
|
4438
|
-
const Hh =
|
|
4433
|
+
const Hh = _a.extend({
|
|
4439
4434
|
addOptions() {
|
|
4440
4435
|
var e;
|
|
4441
4436
|
return {
|
|
@@ -4461,14 +4456,14 @@ const Hh = va.extend({
|
|
|
4461
4456
|
}
|
|
4462
4457
|
};
|
|
4463
4458
|
}
|
|
4464
|
-
}), Eh =
|
|
4459
|
+
}), Eh = va.extend({
|
|
4465
4460
|
addOptions() {
|
|
4466
4461
|
var e;
|
|
4467
4462
|
return {
|
|
4468
4463
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
4469
4464
|
multicolor: !0,
|
|
4470
4465
|
button: ({ editor: t, t: i }) => ({
|
|
4471
|
-
component:
|
|
4466
|
+
component: En,
|
|
4472
4467
|
componentProps: {
|
|
4473
4468
|
action: (n) => {
|
|
4474
4469
|
typeof n == "string" && t.chain().focus().setHighlight({ color: n }).run(), n === void 0 && t.chain().focus().unsetHighlight().run();
|
|
@@ -4482,7 +4477,7 @@ const Hh = va.extend({
|
|
|
4482
4477
|
})
|
|
4483
4478
|
};
|
|
4484
4479
|
}
|
|
4485
|
-
}), Rh =
|
|
4480
|
+
}), Rh = ya.extend({
|
|
4486
4481
|
addOptions() {
|
|
4487
4482
|
var e;
|
|
4488
4483
|
return {
|
|
@@ -4517,7 +4512,7 @@ const Hh = va.extend({
|
|
|
4517
4512
|
})
|
|
4518
4513
|
};
|
|
4519
4514
|
}
|
|
4520
|
-
}), Ph =
|
|
4515
|
+
}), Ph = ka.extend({
|
|
4521
4516
|
addOptions() {
|
|
4522
4517
|
var e;
|
|
4523
4518
|
return {
|
|
@@ -4535,7 +4530,7 @@ const Hh = va.extend({
|
|
|
4535
4530
|
})
|
|
4536
4531
|
};
|
|
4537
4532
|
}
|
|
4538
|
-
}), Dh =
|
|
4533
|
+
}), Dh = Ca.extend({
|
|
4539
4534
|
addOptions() {
|
|
4540
4535
|
var e;
|
|
4541
4536
|
return {
|
|
@@ -4562,9 +4557,9 @@ const Hh = va.extend({
|
|
|
4562
4557
|
};
|
|
4563
4558
|
},
|
|
4564
4559
|
addExtensions() {
|
|
4565
|
-
return [
|
|
4560
|
+
return [Na.configure(this.options.taskItem)];
|
|
4566
4561
|
}
|
|
4567
|
-
}), $h =
|
|
4562
|
+
}), $h = Ta.extend({
|
|
4568
4563
|
addOptions() {
|
|
4569
4564
|
var e;
|
|
4570
4565
|
return {
|
|
@@ -4600,10 +4595,10 @@ function Js(e) {
|
|
|
4600
4595
|
children: /* @__PURE__ */ r(D, { name: e == null ? void 0 : e.icon })
|
|
4601
4596
|
}
|
|
4602
4597
|
) }),
|
|
4603
|
-
/* @__PURE__ */ r(ie, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(
|
|
4598
|
+
/* @__PURE__ */ r(ie, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(Rn, { editor: e.editor, onSetLink: t }) })
|
|
4604
4599
|
] });
|
|
4605
4600
|
}
|
|
4606
|
-
const Bh =
|
|
4601
|
+
const Bh = La.extend({
|
|
4607
4602
|
inclusive: !1,
|
|
4608
4603
|
parseHTML() {
|
|
4609
4604
|
return [
|
|
@@ -4657,20 +4652,20 @@ const Bh = Aa.extend({
|
|
|
4657
4652
|
},
|
|
4658
4653
|
addProseMirrorPlugins() {
|
|
4659
4654
|
return [
|
|
4660
|
-
new
|
|
4655
|
+
new be({
|
|
4661
4656
|
props: {
|
|
4662
4657
|
handleClick: (e, t) => {
|
|
4663
|
-
const { schema: i, doc: n, tr: a } = e.state, o =
|
|
4658
|
+
const { schema: i, doc: n, tr: a } = e.state, o = Aa(n.resolve(t), i.marks.link);
|
|
4664
4659
|
if (!o)
|
|
4665
4660
|
return !1;
|
|
4666
|
-
const c = n.resolve(o.from), s = n.resolve(o.to), h = a.setSelection(new
|
|
4661
|
+
const c = n.resolve(o.from), s = n.resolve(o.to), h = a.setSelection(new Ae(c, s));
|
|
4667
4662
|
e.dispatch(h);
|
|
4668
4663
|
}
|
|
4669
4664
|
}
|
|
4670
4665
|
})
|
|
4671
4666
|
];
|
|
4672
4667
|
}
|
|
4673
|
-
}), jh =
|
|
4668
|
+
}), jh = Sa.extend({
|
|
4674
4669
|
renderHTML() {
|
|
4675
4670
|
return [
|
|
4676
4671
|
"div",
|
|
@@ -4734,11 +4729,11 @@ function Xs(e) {
|
|
|
4734
4729
|
) }),
|
|
4735
4730
|
i && /* @__PURE__ */ r(Ie, { ...a, children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
|
|
4736
4731
|
/* @__PURE__ */ r("div", { children: i }),
|
|
4737
|
-
!!((l = e == null ? void 0 : e.shortcutKeys) != null && l.length) && /* @__PURE__ */ r("span", { children:
|
|
4732
|
+
!!((l = e == null ? void 0 : e.shortcutKeys) != null && l.length) && /* @__PURE__ */ r("span", { children: Mt(e == null ? void 0 : e.shortcutKeys) })
|
|
4738
4733
|
] }) })
|
|
4739
4734
|
] });
|
|
4740
4735
|
}
|
|
4741
|
-
const Ys = ["undo", "redo"], Fh =
|
|
4736
|
+
const Ys = ["undo", "redo"], Fh = Ma.extend({
|
|
4742
4737
|
addOptions() {
|
|
4743
4738
|
var e;
|
|
4744
4739
|
return {
|
|
@@ -4760,7 +4755,7 @@ const Ys = ["undo", "redo"], Fh = Ia.extend({
|
|
|
4760
4755
|
}))
|
|
4761
4756
|
};
|
|
4762
4757
|
}
|
|
4763
|
-
}), Qs =
|
|
4758
|
+
}), Qs = Ia.extend({
|
|
4764
4759
|
content: "(block|columns)+"
|
|
4765
4760
|
// echo editor is a block editor
|
|
4766
4761
|
});
|
|
@@ -4784,12 +4779,12 @@ function il(e, t, i = null) {
|
|
|
4784
4779
|
}
|
|
4785
4780
|
return n.columns.createChecked({ cols: t }, a);
|
|
4786
4781
|
}
|
|
4787
|
-
function
|
|
4782
|
+
function Dt({
|
|
4788
4783
|
state: e,
|
|
4789
4784
|
dispatch: t,
|
|
4790
4785
|
type: i
|
|
4791
4786
|
}) {
|
|
4792
|
-
const n = vt((o) => o.type.name === it.name)(e.selection), a = vt((o) => o.type.name ===
|
|
4787
|
+
const n = vt((o) => o.type.name === it.name)(e.selection), a = vt((o) => o.type.name === xi.name)(e.selection);
|
|
4793
4788
|
if (t && n && a) {
|
|
4794
4789
|
const o = n.node, c = a.node.attrs.index, s = o.toJSON();
|
|
4795
4790
|
let h = c;
|
|
@@ -4806,20 +4801,20 @@ function $t({
|
|
|
4806
4801
|
})), s.attrs.cols = s.content.length, s.content.forEach((f, g) => {
|
|
4807
4802
|
f.attrs.index = g;
|
|
4808
4803
|
});
|
|
4809
|
-
const l =
|
|
4804
|
+
const l = Xa.fromJSON(e.schema, s);
|
|
4810
4805
|
let d = n.pos;
|
|
4811
4806
|
l.content.forEach((f, g, x) => {
|
|
4812
4807
|
x < h && (d += f.nodeSize);
|
|
4813
4808
|
});
|
|
4814
4809
|
const m = e.tr.setTime(Date.now());
|
|
4815
4810
|
m.replaceWith(n.pos, n.pos + n.node.nodeSize, l).setSelection(
|
|
4816
|
-
|
|
4811
|
+
Ae.near(m.doc.resolve(d))
|
|
4817
4812
|
), t(m);
|
|
4818
4813
|
}
|
|
4819
4814
|
return !0;
|
|
4820
4815
|
}
|
|
4821
|
-
function
|
|
4822
|
-
const n = vt((o) => o.type.name === it.name)(e.selection), a = vt((o) => o.type.name ===
|
|
4816
|
+
function Oi({ state: e, dispatch: t, type: i }) {
|
|
4817
|
+
const n = vt((o) => o.type.name === it.name)(e.selection), a = vt((o) => o.type.name === xi.name)(e.selection);
|
|
4823
4818
|
if (t && n && a) {
|
|
4824
4819
|
const o = n.node, c = a.node.attrs.index;
|
|
4825
4820
|
let s = 0;
|
|
@@ -4829,7 +4824,7 @@ function Di({ state: e, dispatch: t, type: i }) {
|
|
|
4829
4824
|
f < s && (h += d.nodeSize);
|
|
4830
4825
|
});
|
|
4831
4826
|
const l = e.tr.setTime(Date.now());
|
|
4832
|
-
return l.setSelection(
|
|
4827
|
+
return l.setSelection(Ae.near(l.doc.resolve(h))), t(l), !0;
|
|
4833
4828
|
}
|
|
4834
4829
|
return !1;
|
|
4835
4830
|
}
|
|
@@ -4872,31 +4867,31 @@ const nl = 200, it = ce.create({
|
|
|
4872
4867
|
const a = il(n.schema, e && e.cols || 3);
|
|
4873
4868
|
if (i) {
|
|
4874
4869
|
const o = t.selection.anchor + 1;
|
|
4875
|
-
t.replaceSelectionWith(a).scrollIntoView().setSelection(
|
|
4870
|
+
t.replaceSelectionWith(a).scrollIntoView().setSelection(Ae.near(t.doc.resolve(o)));
|
|
4876
4871
|
}
|
|
4877
4872
|
return !0;
|
|
4878
4873
|
},
|
|
4879
|
-
addColBefore: () => ({ dispatch: e, state: t }) =>
|
|
4880
|
-
addColAfter: () => ({ dispatch: e, state: t }) =>
|
|
4881
|
-
deleteCol: () => ({ dispatch: e, state: t }) =>
|
|
4874
|
+
addColBefore: () => ({ dispatch: e, state: t }) => Dt({ dispatch: e, state: t, type: "addBefore" }),
|
|
4875
|
+
addColAfter: () => ({ dispatch: e, state: t }) => Dt({ dispatch: e, state: t, type: "addAfter" }),
|
|
4876
|
+
deleteCol: () => ({ dispatch: e, state: t }) => Dt({ dispatch: e, state: t, type: "delete" })
|
|
4882
4877
|
};
|
|
4883
4878
|
},
|
|
4884
4879
|
addKeyboardShortcuts() {
|
|
4885
4880
|
return {
|
|
4886
4881
|
"Mod-Alt-G": () => this.editor.commands.insertColumns(),
|
|
4887
|
-
Tab: () =>
|
|
4882
|
+
Tab: () => Oi({
|
|
4888
4883
|
state: this.editor.state,
|
|
4889
4884
|
dispatch: this.editor.view.dispatch,
|
|
4890
4885
|
type: "after"
|
|
4891
4886
|
}),
|
|
4892
|
-
"Shift-Tab": () =>
|
|
4887
|
+
"Shift-Tab": () => Oi({
|
|
4893
4888
|
state: this.editor.state,
|
|
4894
4889
|
dispatch: this.editor.view.dispatch,
|
|
4895
4890
|
type: "before"
|
|
4896
4891
|
})
|
|
4897
4892
|
};
|
|
4898
4893
|
}
|
|
4899
|
-
}),
|
|
4894
|
+
}), xi = ce.create({
|
|
4900
4895
|
name: "column",
|
|
4901
4896
|
content: "block+",
|
|
4902
4897
|
isolating: !0,
|
|
@@ -4948,8 +4943,8 @@ const nl = 200, it = ce.create({
|
|
|
4948
4943
|
addProseMirrorPlugins() {
|
|
4949
4944
|
const { editor: e } = this;
|
|
4950
4945
|
return [
|
|
4951
|
-
new
|
|
4952
|
-
key: new
|
|
4946
|
+
new be({
|
|
4947
|
+
key: new we("selection"),
|
|
4953
4948
|
props: {
|
|
4954
4949
|
decorations(t) {
|
|
4955
4950
|
return t.selection.empty || e.isFocused === !0 ? null : De.create(t.doc, [
|
|
@@ -5031,15 +5026,15 @@ function al(e) {
|
|
|
5031
5026
|
], [e.editor, t]), n = O(() => i.filter((a) => a.isActive()).pop() ?? {
|
|
5032
5027
|
label: "Empty"
|
|
5033
5028
|
}, [i]);
|
|
5034
|
-
return /* @__PURE__ */ u(
|
|
5035
|
-
/* @__PURE__ */ r(
|
|
5029
|
+
return /* @__PURE__ */ u(_e, { children: [
|
|
5030
|
+
/* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ u(U, { variant: "ghost", className: "richtext-h-[32px] richtext-flex richtext-gap-1 richtext-px-1.5", children: [
|
|
5036
5031
|
/* @__PURE__ */ u("span", { className: "richtext-text-sm richtext-font-normal richtext-whitespace-nowrap", children: [
|
|
5037
5032
|
" ",
|
|
5038
5033
|
n == null ? void 0 : n.label
|
|
5039
5034
|
] }),
|
|
5040
|
-
/* @__PURE__ */ r(
|
|
5035
|
+
/* @__PURE__ */ r(Lt, { className: "richtext-w-4 richtext-h-4" })
|
|
5041
5036
|
] }) }),
|
|
5042
|
-
/* @__PURE__ */ r(
|
|
5037
|
+
/* @__PURE__ */ r(pe, { hideWhenDetached: !0, className: "richtext-w-full richtext-p-1", align: "start", sideOffset: 5, children: i.map((a, o) => {
|
|
5043
5038
|
var s;
|
|
5044
5039
|
const c = ut[a.iconName];
|
|
5045
5040
|
return /* @__PURE__ */ r(
|
|
@@ -5075,7 +5070,7 @@ const ol = Z.create({
|
|
|
5075
5070
|
};
|
|
5076
5071
|
}
|
|
5077
5072
|
});
|
|
5078
|
-
function
|
|
5073
|
+
function Pi({ types: e, node: t }) {
|
|
5079
5074
|
return Array.isArray(e) && e.includes(t.type) || t.type === e;
|
|
5080
5075
|
}
|
|
5081
5076
|
const cl = Z.create({
|
|
@@ -5087,9 +5082,9 @@ const cl = Z.create({
|
|
|
5087
5082
|
};
|
|
5088
5083
|
},
|
|
5089
5084
|
addProseMirrorPlugins() {
|
|
5090
|
-
const e = new
|
|
5085
|
+
const e = new we(this.name), t = Object.entries(this.editor.schema.nodes).map(([, i]) => i).filter((i) => this.options.notAfter.includes(i.name));
|
|
5091
5086
|
return [
|
|
5092
|
-
new
|
|
5087
|
+
new be({
|
|
5093
5088
|
key: e,
|
|
5094
5089
|
appendTransaction: (i, n, a) => {
|
|
5095
5090
|
const { doc: o, tr: c, schema: s } = a, h = e.getState(a), l = o.content.size, d = s.nodes[this.options.node];
|
|
@@ -5099,13 +5094,13 @@ const cl = Z.create({
|
|
|
5099
5094
|
state: {
|
|
5100
5095
|
init: (i, n) => {
|
|
5101
5096
|
const a = n.tr.doc.lastChild;
|
|
5102
|
-
return
|
|
5097
|
+
return !Pi({ node: a, types: t });
|
|
5103
5098
|
},
|
|
5104
5099
|
apply: (i, n) => {
|
|
5105
5100
|
if (!i.docChanged)
|
|
5106
5101
|
return n;
|
|
5107
5102
|
const a = i.doc.lastChild;
|
|
5108
|
-
return
|
|
5103
|
+
return !Pi({ node: a, types: t });
|
|
5109
5104
|
}
|
|
5110
5105
|
}
|
|
5111
5106
|
})
|
|
@@ -5116,7 +5111,7 @@ const cl = Z.create({
|
|
|
5116
5111
|
addExtensions() {
|
|
5117
5112
|
const e = [];
|
|
5118
5113
|
return this.options.document !== !1 && e.push(Qs.configure()), this.options.placeholder !== !1 && e.push(
|
|
5119
|
-
|
|
5114
|
+
za.configure({
|
|
5120
5115
|
placeholder: ({ node: t, pos: i, editor: n }) => {
|
|
5121
5116
|
var a, o, c, s;
|
|
5122
5117
|
return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" ? "" : ((o = t == null ? void 0 : t.type) == null ? void 0 : o.name) === "heading" ? `${W.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "table" ? "" : n.extensionManager.extensions.some((h) => h.name === "slashCommand") ? W.t("editor.slash") : i === 0 ? W.t("editor.content") : W.t("editor.content");
|
|
@@ -5124,17 +5119,17 @@ const cl = Z.create({
|
|
|
5124
5119
|
...this.options.placeholder
|
|
5125
5120
|
})
|
|
5126
5121
|
), this.options.focus !== !1 && e.push(
|
|
5127
|
-
|
|
5122
|
+
Ha.configure({
|
|
5128
5123
|
className: "focus",
|
|
5129
5124
|
...this.options.focus
|
|
5130
5125
|
})
|
|
5131
|
-
), this.options.text !== !1 && e.push(
|
|
5132
|
-
|
|
5126
|
+
), this.options.text !== !1 && e.push(Ea.configure()), this.options.textBubble !== !1 && e.push(ol.configure()), this.options.gapcursor !== !1 && e.push(Ra.configure()), this.options.dropcursor !== !1 && e.push(
|
|
5127
|
+
Oa.configure({
|
|
5133
5128
|
...this.options.dropcursor,
|
|
5134
5129
|
width: 2,
|
|
5135
5130
|
class: "ProseMirror-dropcursor border-black"
|
|
5136
5131
|
})
|
|
5137
|
-
), this.options.characterCount !== !1 && e.push(
|
|
5132
|
+
), this.options.characterCount !== !1 && e.push(Pa.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Da.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push($a.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Ba.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(ja.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(cl.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(rl), this.options.multiColumn !== !1 && (e.push(xi), e.push(it)), e;
|
|
5138
5133
|
}
|
|
5139
5134
|
}), Wh = Z.create({
|
|
5140
5135
|
name: "subAndSuperScript",
|
|
@@ -5168,7 +5163,7 @@ const cl = Z.create({
|
|
|
5168
5163
|
},
|
|
5169
5164
|
addExtensions() {
|
|
5170
5165
|
const e = [];
|
|
5171
|
-
return this.options.subscript !== !1 && e.push(
|
|
5166
|
+
return this.options.subscript !== !1 && e.push(Qi.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(en.configure(this.options.superscript)), e;
|
|
5172
5167
|
}
|
|
5173
5168
|
});
|
|
5174
5169
|
function sl(e) {
|
|
@@ -5185,18 +5180,18 @@ function sl(e) {
|
|
|
5185
5180
|
isActive: () => !1
|
|
5186
5181
|
};
|
|
5187
5182
|
}, [e]);
|
|
5188
|
-
return /* @__PURE__ */ u(
|
|
5189
|
-
/* @__PURE__ */ r(
|
|
5183
|
+
return /* @__PURE__ */ u(_e, { children: [
|
|
5184
|
+
/* @__PURE__ */ r(ve, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
5190
5185
|
_,
|
|
5191
5186
|
{
|
|
5192
5187
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
5193
5188
|
icon: e == null ? void 0 : e.icon,
|
|
5194
5189
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
5195
5190
|
disabled: e == null ? void 0 : e.disabled,
|
|
5196
|
-
children: /* @__PURE__ */ r(
|
|
5191
|
+
children: /* @__PURE__ */ r(In, { className: "richtext-w-3 richtext-h-3 richtext-text-gray-500" })
|
|
5197
5192
|
}
|
|
5198
5193
|
) }),
|
|
5199
|
-
/* @__PURE__ */ r(
|
|
5194
|
+
/* @__PURE__ */ r(pe, { className: "w-full", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((n, a) => /* @__PURE__ */ u(
|
|
5200
5195
|
Me,
|
|
5201
5196
|
{
|
|
5202
5197
|
checked: t.title === n.title,
|
|
@@ -5205,7 +5200,7 @@ function sl(e) {
|
|
|
5205
5200
|
children: [
|
|
5206
5201
|
/* @__PURE__ */ r(D, { name: n == null ? void 0 : n.icon }),
|
|
5207
5202
|
/* @__PURE__ */ r("span", { className: "richtext-ml-1", children: n.title }),
|
|
5208
|
-
!!(n != null && n.shortcutKeys) && /* @__PURE__ */ r("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children:
|
|
5203
|
+
!!(n != null && n.shortcutKeys) && /* @__PURE__ */ r("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: Mt(n.shortcutKeys) })
|
|
5209
5204
|
]
|
|
5210
5205
|
},
|
|
5211
5206
|
`more-mark-${a}`
|
|
@@ -5248,7 +5243,7 @@ const qh = Z.create({
|
|
|
5248
5243
|
},
|
|
5249
5244
|
addExtensions() {
|
|
5250
5245
|
const e = [];
|
|
5251
|
-
return this.options.subscript !== !1 && e.push(
|
|
5246
|
+
return this.options.subscript !== !1 && e.push(Qi.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(en.configure(this.options.superscript)), e;
|
|
5252
5247
|
}
|
|
5253
5248
|
}), Kh = Z.create({
|
|
5254
5249
|
name: "indent",
|
|
@@ -5257,8 +5252,8 @@ const qh = Z.create({
|
|
|
5257
5252
|
return {
|
|
5258
5253
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
5259
5254
|
types: ["paragraph", "heading", "blockquote"],
|
|
5260
|
-
minIndent:
|
|
5261
|
-
maxIndent:
|
|
5255
|
+
minIndent: Te.min,
|
|
5256
|
+
maxIndent: Te.max,
|
|
5262
5257
|
button({ editor: t, t: i }) {
|
|
5263
5258
|
return [
|
|
5264
5259
|
{
|
|
@@ -5306,12 +5301,12 @@ const qh = Z.create({
|
|
|
5306
5301
|
},
|
|
5307
5302
|
addCommands() {
|
|
5308
5303
|
return {
|
|
5309
|
-
indent: () =>
|
|
5310
|
-
delta:
|
|
5304
|
+
indent: () => Ei({
|
|
5305
|
+
delta: Te.more,
|
|
5311
5306
|
types: this.options.types
|
|
5312
5307
|
}),
|
|
5313
|
-
outdent: () =>
|
|
5314
|
-
delta:
|
|
5308
|
+
outdent: () => Ei({
|
|
5309
|
+
delta: Te.less,
|
|
5315
5310
|
types: this.options.types
|
|
5316
5311
|
})
|
|
5317
5312
|
};
|
|
@@ -5343,8 +5338,8 @@ function dl(e) {
|
|
|
5343
5338
|
value: "default"
|
|
5344
5339
|
}), h;
|
|
5345
5340
|
}, [e]);
|
|
5346
|
-
return /* @__PURE__ */ u(
|
|
5347
|
-
/* @__PURE__ */ r(
|
|
5341
|
+
return /* @__PURE__ */ u(_e, { children: [
|
|
5342
|
+
/* @__PURE__ */ r(ve, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
5348
5343
|
_,
|
|
5349
5344
|
{
|
|
5350
5345
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
@@ -5354,7 +5349,7 @@ function dl(e) {
|
|
|
5354
5349
|
children: /* @__PURE__ */ r(D, { className: "richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500", name: "MenuDown" })
|
|
5355
5350
|
}
|
|
5356
5351
|
) }),
|
|
5357
|
-
/* @__PURE__ */ r(
|
|
5352
|
+
/* @__PURE__ */ r(pe, { className: "richtext-min-w-24", children: o == null ? void 0 : o.map((c, s) => /* @__PURE__ */ r(
|
|
5358
5353
|
Me,
|
|
5359
5354
|
{
|
|
5360
5355
|
checked: c.value === i,
|
|
@@ -5368,9 +5363,9 @@ function dl(e) {
|
|
|
5368
5363
|
const hl = ["paragraph", "heading", "list_item", "todo_item"];
|
|
5369
5364
|
function ul(e, t) {
|
|
5370
5365
|
const { selection: i, doc: n } = e;
|
|
5371
|
-
if (!i || !n || !(i instanceof
|
|
5366
|
+
if (!i || !n || !(i instanceof Ae || i instanceof rn))
|
|
5372
5367
|
return e;
|
|
5373
|
-
const { from: a, to: o } = i, c = [], s = t && t !==
|
|
5368
|
+
const { from: a, to: o } = i, c = [], s = t && t !== ln ? t : null;
|
|
5374
5369
|
if (n.nodesBetween(a, o, (h, l) => {
|
|
5375
5370
|
const d = h.type;
|
|
5376
5371
|
return hl.includes(d.name) ? ((h.attrs.lineHeight || null) !== s && c.push({
|
|
@@ -5404,8 +5399,8 @@ const Gh = Z.create({
|
|
|
5404
5399
|
return {
|
|
5405
5400
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
5406
5401
|
types: ["paragraph", "heading", "list_item", "todo_item"],
|
|
5407
|
-
lineHeights:
|
|
5408
|
-
defaultHeight:
|
|
5402
|
+
lineHeights: oo,
|
|
5403
|
+
defaultHeight: ln,
|
|
5409
5404
|
button({ editor: t, t: i }) {
|
|
5410
5405
|
return {
|
|
5411
5406
|
component: dl,
|
|
@@ -5558,7 +5553,7 @@ function fl(e) {
|
|
|
5558
5553
|
function gl(e, t) {
|
|
5559
5554
|
var k, L;
|
|
5560
5555
|
const [i, n] = w(0), [a, o] = w(0), c = X(null), { t: s } = F(), h = X([]);
|
|
5561
|
-
|
|
5556
|
+
Tt(t, () => ({
|
|
5562
5557
|
onKeyDown: l
|
|
5563
5558
|
})), z(() => {
|
|
5564
5559
|
if (!c.current)
|
|
@@ -5628,10 +5623,10 @@ function gl(e, t) {
|
|
|
5628
5623
|
}
|
|
5629
5624
|
);
|
|
5630
5625
|
}
|
|
5631
|
-
const xl =
|
|
5626
|
+
const xl = Nt(gl), Ne = "slashCommand";
|
|
5632
5627
|
let V;
|
|
5633
5628
|
const Zh = Z.create({
|
|
5634
|
-
name:
|
|
5629
|
+
name: Ne,
|
|
5635
5630
|
priority: 200,
|
|
5636
5631
|
onCreate() {
|
|
5637
5632
|
V = ai("body", {
|
|
@@ -5654,12 +5649,12 @@ const Zh = Z.create({
|
|
|
5654
5649
|
},
|
|
5655
5650
|
addProseMirrorPlugins() {
|
|
5656
5651
|
return [
|
|
5657
|
-
|
|
5652
|
+
tn({
|
|
5658
5653
|
editor: this.editor,
|
|
5659
5654
|
char: "/",
|
|
5660
5655
|
allowSpaces: !0,
|
|
5661
5656
|
startOfLine: !0,
|
|
5662
|
-
pluginKey: new
|
|
5657
|
+
pluginKey: new we(Ne),
|
|
5663
5658
|
allow: ({ state: e, range: t }) => {
|
|
5664
5659
|
var l, d, m;
|
|
5665
5660
|
const i = e.doc.resolve(t.from), n = i.depth === 1, a = i.parent.type.name === "paragraph", o = ((l = i.parent.textContent) == null ? void 0 : l.charAt(0)) === "/", c = this.editor.isActive("column"), s = (m = i.parent.textContent) == null ? void 0 : m.slice(
|
|
@@ -5701,10 +5696,10 @@ const Zh = Z.create({
|
|
|
5701
5696
|
});
|
|
5702
5697
|
const { view: n } = i.editor, a = () => {
|
|
5703
5698
|
if (!i.clientRect)
|
|
5704
|
-
return i.editor.storage[
|
|
5699
|
+
return i.editor.storage[Ne].rect;
|
|
5705
5700
|
const c = i.clientRect();
|
|
5706
5701
|
if (!c)
|
|
5707
|
-
return i.editor.storage[
|
|
5702
|
+
return i.editor.storage[Ne].rect;
|
|
5708
5703
|
let s = c.y;
|
|
5709
5704
|
if (c.top + e.element.offsetHeight + 40 > window.innerHeight) {
|
|
5710
5705
|
const h = c.top + e.element.offsetHeight - window.innerHeight + 40;
|
|
@@ -5727,15 +5722,15 @@ const Zh = Z.create({
|
|
|
5727
5722
|
e.updateProps(i);
|
|
5728
5723
|
const { view: n } = i.editor, a = () => {
|
|
5729
5724
|
if (!i.clientRect)
|
|
5730
|
-
return i.editor.storage[
|
|
5725
|
+
return i.editor.storage[Ne].rect;
|
|
5731
5726
|
const s = i.clientRect();
|
|
5732
|
-
return s ? new DOMRect(s.x, s.y, s.width, s.height) : i.editor.storage[
|
|
5727
|
+
return s ? new DOMRect(s.x, s.y, s.width, s.height) : i.editor.storage[Ne].rect;
|
|
5733
5728
|
}, o = () => {
|
|
5734
5729
|
V == null || V[0].setProps({
|
|
5735
5730
|
getReferenceClientRect: a
|
|
5736
5731
|
});
|
|
5737
5732
|
};
|
|
5738
|
-
(c = n.dom.parentElement) == null || c.addEventListener("scroll", o), i.editor.storage[
|
|
5733
|
+
(c = n.dom.parentElement) == null || c.addEventListener("scroll", o), i.editor.storage[Ne].rect = i.clientRect ? a() : {
|
|
5739
5734
|
width: 0,
|
|
5740
5735
|
height: 0,
|
|
5741
5736
|
left: 0,
|
|
@@ -5828,7 +5823,7 @@ function pl(e) {
|
|
|
5828
5823
|
y.commands.setNodeSelection(R());
|
|
5829
5824
|
}
|
|
5830
5825
|
const b = M(
|
|
5831
|
-
|
|
5826
|
+
Le(() => {
|
|
5832
5827
|
const { editor: y } = e, { width: R } = getComputedStyle(y.view.dom);
|
|
5833
5828
|
i((A) => ({
|
|
5834
5829
|
...A,
|
|
@@ -5853,10 +5848,10 @@ function pl(e) {
|
|
|
5853
5848
|
});
|
|
5854
5849
|
}
|
|
5855
5850
|
const L = M(
|
|
5856
|
-
|
|
5851
|
+
Le((y) => {
|
|
5857
5852
|
if (y.preventDefault(), y.stopPropagation(), !c)
|
|
5858
5853
|
return;
|
|
5859
|
-
const { x: R, w: A, dir: N } = h, B = (y.clientX - R) * (/l/.test(N) ? -1 : 1), S =
|
|
5854
|
+
const { x: R, w: A, dir: N } = h, B = (y.clientX - R) * (/l/.test(N) ? -1 : 1), S = an(A + B, ni, t.width);
|
|
5860
5855
|
e.updateAttributes({
|
|
5861
5856
|
width: S,
|
|
5862
5857
|
height: null
|
|
@@ -5957,7 +5952,7 @@ const Jh = Qt.extend({
|
|
|
5957
5952
|
};
|
|
5958
5953
|
},
|
|
5959
5954
|
addNodeView() {
|
|
5960
|
-
return
|
|
5955
|
+
return me(pl);
|
|
5961
5956
|
},
|
|
5962
5957
|
addCommands() {
|
|
5963
5958
|
var e;
|
|
@@ -6006,9 +6001,9 @@ const Jh = Qt.extend({
|
|
|
6006
6001
|
}
|
|
6007
6002
|
];
|
|
6008
6003
|
}
|
|
6009
|
-
}), $e = new
|
|
6004
|
+
}), $e = new we("upload-image");
|
|
6010
6005
|
function bl() {
|
|
6011
|
-
return new
|
|
6006
|
+
return new be({
|
|
6012
6007
|
key: $e,
|
|
6013
6008
|
state: {
|
|
6014
6009
|
init() {
|
|
@@ -6046,7 +6041,7 @@ function _l(e, t) {
|
|
|
6046
6041
|
const n = $e.getState(e).find(void 0, void 0, (o) => o.id === t);
|
|
6047
6042
|
return n.length > 0 ? (a = n[0]) == null ? void 0 : a.from : null;
|
|
6048
6043
|
}
|
|
6049
|
-
function
|
|
6044
|
+
function pi({ validateFn: e, onUpload: t, postUpload: i }) {
|
|
6050
6045
|
return (n, a, o) => {
|
|
6051
6046
|
for (const c of n) {
|
|
6052
6047
|
if (e && !e(c))
|
|
@@ -6134,10 +6129,10 @@ function kl({ editor: e, getPos: t }) {
|
|
|
6134
6129
|
async function b() {
|
|
6135
6130
|
var p, v;
|
|
6136
6131
|
try {
|
|
6137
|
-
const C = await
|
|
6132
|
+
const C = await ui(h, ((p = m == null ? void 0 : m.file) == null ? void 0 : p.name) || "image.png"), T = (v = e.extensionManager.extensions.find(
|
|
6138
6133
|
($) => $.name === "imageUpload"
|
|
6139
6134
|
)) == null ? void 0 : v.options;
|
|
6140
|
-
|
|
6135
|
+
pi({
|
|
6141
6136
|
validateFn: () => !0,
|
|
6142
6137
|
onUpload: T.upload,
|
|
6143
6138
|
postUpload: T.postUpload
|
|
@@ -6170,7 +6165,7 @@ function kl({ editor: e, getPos: t }) {
|
|
|
6170
6165
|
/* @__PURE__ */ r(dt, {}),
|
|
6171
6166
|
/* @__PURE__ */ u(Ze, { className: "[&>button]:richtext-hidden", children: [
|
|
6172
6167
|
/* @__PURE__ */ r("div", { children: m.src && /* @__PURE__ */ r(
|
|
6173
|
-
|
|
6168
|
+
so,
|
|
6174
6169
|
{
|
|
6175
6170
|
crop: c,
|
|
6176
6171
|
onChange: (p) => s(p),
|
|
@@ -6234,7 +6229,7 @@ function Cl(e) {
|
|
|
6234
6229
|
const m = d[0], f = (b = e.editor.extensionManager.extensions.find(
|
|
6235
6230
|
(k) => k.name === "imageUpload"
|
|
6236
6231
|
)) == null ? void 0 : b.options;
|
|
6237
|
-
|
|
6232
|
+
pi({
|
|
6238
6233
|
validateFn: () => !0,
|
|
6239
6234
|
onUpload: f.upload,
|
|
6240
6235
|
postUpload: f.postUpload
|
|
@@ -6259,7 +6254,7 @@ function Cl(e) {
|
|
|
6259
6254
|
/* @__PURE__ */ r(D, { name: "Trash2", className: "hover:richtext-text-foreground", onClick: s })
|
|
6260
6255
|
] }) }) }),
|
|
6261
6256
|
/* @__PURE__ */ r(ie, { className: "richtext-w-full", onOpenAutoFocus: (l) => l.preventDefault(), children: /* @__PURE__ */ u(di, { defaultValue: "upload", className: "richtext-w-[400px]", activationMode: "manual", children: [
|
|
6262
|
-
/* @__PURE__ */ u(
|
|
6257
|
+
/* @__PURE__ */ u(zt, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
|
|
6263
6258
|
/* @__PURE__ */ u(Ve, { value: "upload", children: [
|
|
6264
6259
|
t("editor.image.dialog.tab.upload"),
|
|
6265
6260
|
" "
|
|
@@ -6334,7 +6329,7 @@ const Nl = {
|
|
|
6334
6329
|
};
|
|
6335
6330
|
},
|
|
6336
6331
|
addNodeView() {
|
|
6337
|
-
return
|
|
6332
|
+
return me(Cl);
|
|
6338
6333
|
},
|
|
6339
6334
|
addOptions() {
|
|
6340
6335
|
var e;
|
|
@@ -6363,13 +6358,13 @@ const Nl = {
|
|
|
6363
6358
|
};
|
|
6364
6359
|
},
|
|
6365
6360
|
addProseMirrorPlugins() {
|
|
6366
|
-
const t =
|
|
6361
|
+
const t = pi({
|
|
6367
6362
|
validateFn: (i) => !(!this.options.acceptMimes.includes(i.type) || i.size > this.options.maxSize),
|
|
6368
6363
|
onUpload: this.options.upload,
|
|
6369
6364
|
postUpload: this.options.postUpload
|
|
6370
6365
|
});
|
|
6371
6366
|
return [
|
|
6372
|
-
new
|
|
6367
|
+
new be({
|
|
6373
6368
|
props: {
|
|
6374
6369
|
handlePaste: (i, n) => !n.clipboardData || [...n.clipboardData.files || []].some((o) => o.type === "text/html") ? !1 : vl(i, n, t),
|
|
6375
6370
|
handleDrop: (i, n, a, o) => (!(n instanceof DragEvent) || !n.dataTransfer || yl(i, n, o, t), !1)
|
|
@@ -6445,7 +6440,7 @@ const Yh = ce.create({
|
|
|
6445
6440
|
allowFullscreen: !0,
|
|
6446
6441
|
upload: void 0,
|
|
6447
6442
|
frameborder: !1,
|
|
6448
|
-
width:
|
|
6443
|
+
width: jt["size-medium"],
|
|
6449
6444
|
HTMLAttributes: {
|
|
6450
6445
|
class: "iframe-wrapper",
|
|
6451
6446
|
style: "display: flex;justify-content: center;"
|
|
@@ -6496,7 +6491,7 @@ function Ll(e) {
|
|
|
6496
6491
|
/* @__PURE__ */ r(D, { name: "Trash2", className: "hover:richtext-text-foreground", onClick: f })
|
|
6497
6492
|
] }) }) }),
|
|
6498
6493
|
/* @__PURE__ */ r(ie, { className: "richtext-w-full", onOpenAutoFocus: (x) => x.preventDefault(), children: /* @__PURE__ */ u(di, { defaultValue: "upload", className: "richtext-w-[400px]", activationMode: "manual", children: [
|
|
6499
|
-
/* @__PURE__ */ u(
|
|
6494
|
+
/* @__PURE__ */ u(zt, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
|
|
6500
6495
|
/* @__PURE__ */ u(Ve, { value: "upload", children: [
|
|
6501
6496
|
t("editor.video.dialog.tab.upload"),
|
|
6502
6497
|
" "
|
|
@@ -6564,7 +6559,7 @@ const Qh = ce.create({
|
|
|
6564
6559
|
};
|
|
6565
6560
|
},
|
|
6566
6561
|
addNodeView() {
|
|
6567
|
-
return
|
|
6562
|
+
return me(Ll);
|
|
6568
6563
|
},
|
|
6569
6564
|
addOptions() {
|
|
6570
6565
|
var e;
|
|
@@ -6602,11 +6597,11 @@ function Al(e, t, i) {
|
|
|
6602
6597
|
}
|
|
6603
6598
|
function Sl(e, t, i) {
|
|
6604
6599
|
const { doc: n, selection: a } = e;
|
|
6605
|
-
return !n || !a || !(a instanceof
|
|
6600
|
+
return !n || !a || !(a instanceof Ya) || a.forEachCell((o, c) => {
|
|
6606
6601
|
e = Al(e, c, i);
|
|
6607
6602
|
}), e;
|
|
6608
6603
|
}
|
|
6609
|
-
function
|
|
6604
|
+
function Di(e, t) {
|
|
6610
6605
|
return ({ tr: i, state: n, dispatch: a }) => {
|
|
6611
6606
|
const { selection: o } = n;
|
|
6612
6607
|
return i = i.setSelection(o), i = Sl(i, t, e), i.docChanged ? (a == null || a(i), !0) : !1;
|
|
@@ -6637,21 +6632,21 @@ const Ml = Z.create({
|
|
|
6637
6632
|
},
|
|
6638
6633
|
addCommands() {
|
|
6639
6634
|
return {
|
|
6640
|
-
setTableCellBackground: (e) =>
|
|
6641
|
-
unsetTableCellBackground: () =>
|
|
6635
|
+
setTableCellBackground: (e) => Di(e, this.options),
|
|
6636
|
+
unsetTableCellBackground: () => Di("", this.options)
|
|
6642
6637
|
};
|
|
6643
6638
|
}
|
|
6644
6639
|
}), Il = /(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, zl = /CrOS/, Hl = /android|ipad|playbook|silk/i;
|
|
6645
|
-
function
|
|
6640
|
+
function $i(e = {}) {
|
|
6646
6641
|
let t = e.ua || typeof navigator < "u" && navigator.userAgent;
|
|
6647
6642
|
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(Il.test(t) && !zl.test(t) || e.tablet && Hl.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
|
|
6648
6643
|
}
|
|
6649
|
-
const
|
|
6644
|
+
const Bi = (e) => Array.from({ length: e }).map((t, i) => i + 1);
|
|
6650
6645
|
function El(e) {
|
|
6651
6646
|
var d;
|
|
6652
6647
|
const [t, i] = w(!0), [n, a] = w({
|
|
6653
|
-
rows:
|
|
6654
|
-
cols:
|
|
6648
|
+
rows: $i() ? mt : ft,
|
|
6649
|
+
cols: $i() ? mt : ft
|
|
6655
6650
|
}), [o, c] = w({
|
|
6656
6651
|
rows: gt,
|
|
6657
6652
|
cols: gt
|
|
@@ -6683,9 +6678,9 @@ function El(e) {
|
|
|
6683
6678
|
return /* @__PURE__ */ u(re, { modal: !0, children: [
|
|
6684
6679
|
/* @__PURE__ */ r(ae, { asChild: !0, children: e == null ? void 0 : e.children }),
|
|
6685
6680
|
/* @__PURE__ */ r(ie, { className: "richtext-w-full !richtext-p-2", align: "start", side: "bottom", children: /* @__PURE__ */ u("div", { className: "richtext-p-0 table-grid-size-editor", children: [
|
|
6686
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (d =
|
|
6681
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (d = Bi(n == null ? void 0 : n.rows)) == null ? void 0 : d.map((m) => {
|
|
6687
6682
|
var f;
|
|
6688
|
-
return /* @__PURE__ */ r("div", { className: "richtext-flex richtext-gap-1", children: (f =
|
|
6683
|
+
return /* @__PURE__ */ r("div", { className: "richtext-flex richtext-gap-1", children: (f = Bi(n == null ? void 0 : n.cols)) == null ? void 0 : f.map((g) => /* @__PURE__ */ r(
|
|
6689
6684
|
"div",
|
|
6690
6685
|
{
|
|
6691
6686
|
className: `richtext-cursor-pointer richtext-border-border ${g <= o.cols && m <= o.rows && "!richtext-bg-foreground tableCellActive"}`,
|
|
@@ -6721,7 +6716,7 @@ function Rl(e) {
|
|
|
6721
6716
|
}
|
|
6722
6717
|
) });
|
|
6723
6718
|
}
|
|
6724
|
-
const eu =
|
|
6719
|
+
const eu = Fa.extend({
|
|
6725
6720
|
addOptions() {
|
|
6726
6721
|
var e;
|
|
6727
6722
|
return {
|
|
@@ -6742,9 +6737,9 @@ const eu = Ua.extend({
|
|
|
6742
6737
|
},
|
|
6743
6738
|
addExtensions() {
|
|
6744
6739
|
return [
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6740
|
+
Ua.configure(this.options.tableRow),
|
|
6741
|
+
Va.configure(this.options.tableHeader),
|
|
6742
|
+
Wa.configure(this.options.tableCell),
|
|
6748
6743
|
Ml.configure(this.options.tableCellBackground)
|
|
6749
6744
|
];
|
|
6750
6745
|
}
|
|
@@ -6782,8 +6777,8 @@ const eu = Ua.extend({
|
|
|
6782
6777
|
},
|
|
6783
6778
|
addProseMirrorPlugins() {
|
|
6784
6779
|
return [
|
|
6785
|
-
new
|
|
6786
|
-
key: new
|
|
6780
|
+
new be({
|
|
6781
|
+
key: new we("format-painter"),
|
|
6787
6782
|
state: {
|
|
6788
6783
|
init: () => [],
|
|
6789
6784
|
apply: (e, t) => {
|
|
@@ -6871,7 +6866,7 @@ function Ol({ editor: e, ...t }) {
|
|
|
6871
6866
|
side: "bottom",
|
|
6872
6867
|
children: [
|
|
6873
6868
|
/* @__PURE__ */ u("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
|
|
6874
|
-
/* @__PURE__ */ r(
|
|
6869
|
+
/* @__PURE__ */ r(de, { children: i("editor.search.dialog.text") }),
|
|
6875
6870
|
/* @__PURE__ */ r("span", { className: "richtext-font-semibold", children: o.length ? `${n + 1}/${o.length}` : "0/0" })
|
|
6876
6871
|
] }),
|
|
6877
6872
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]", children: [
|
|
@@ -6890,7 +6885,7 @@ function Ol({ editor: e, ...t }) {
|
|
|
6890
6885
|
/* @__PURE__ */ r(U, { disabled: !o.length, className: "richtext-flex-1", onClick: e.commands.goToPrevSearchResult, children: /* @__PURE__ */ r(D, { name: "ChevronUp" }) }),
|
|
6891
6886
|
/* @__PURE__ */ r(U, { disabled: !o.length, className: "richtext-flex-1", onClick: e.commands.goToNextSearchResult, children: /* @__PURE__ */ r(D, { name: "ChevronDown" }) })
|
|
6892
6887
|
] }),
|
|
6893
|
-
/* @__PURE__ */ r(
|
|
6888
|
+
/* @__PURE__ */ r(de, { className: "richtext-mb-[6px]", children: i("editor.replace.dialog.text") }),
|
|
6894
6889
|
/* @__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(
|
|
6895
6890
|
te,
|
|
6896
6891
|
{
|
|
@@ -6912,7 +6907,7 @@ function Ol({ editor: e, ...t }) {
|
|
|
6912
6907
|
}
|
|
6913
6908
|
}
|
|
6914
6909
|
),
|
|
6915
|
-
/* @__PURE__ */ r(
|
|
6910
|
+
/* @__PURE__ */ r(de, { children: i("editor.replace.caseSensitive") })
|
|
6916
6911
|
] }),
|
|
6917
6912
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
6918
6913
|
/* @__PURE__ */ r(U, { disabled: !o.length, className: "richtext-flex-1", onClick: e.commands.replace, children: i("editor.replace.dialog.text") }),
|
|
@@ -6966,7 +6961,7 @@ function Dl(e, t, i) {
|
|
|
6966
6961
|
results: o
|
|
6967
6962
|
};
|
|
6968
6963
|
}
|
|
6969
|
-
function
|
|
6964
|
+
function ji(e, t, { state: i, dispatch: n }) {
|
|
6970
6965
|
if (!t[0])
|
|
6971
6966
|
return;
|
|
6972
6967
|
const { from: o, to: c } = t[0];
|
|
@@ -6994,7 +6989,7 @@ function Bl(e, t, { tr: i, dispatch: n }) {
|
|
|
6994
6989
|
}
|
|
6995
6990
|
return n(i), !0;
|
|
6996
6991
|
}
|
|
6997
|
-
function
|
|
6992
|
+
function Fi({ view: e, tr: t, searchResults: i, searchResultCurrentClass: n, gotoIndex: a }) {
|
|
6998
6993
|
const o = i[a];
|
|
6999
6994
|
if (o) {
|
|
7000
6995
|
const c = t.setMeta("directDecoration", {
|
|
@@ -7052,7 +7047,7 @@ const Jt = "ON_SEARCH_RESULTS", ze = new CustomEvent(Jt), jl = Z.create({
|
|
|
7052
7047
|
setCaseSensitive: (e) => ({ state: t, dispatch: i }) => (this.options.caseSensitive = e, Qe(t, i), !1),
|
|
7053
7048
|
replace: () => ({ state: e, dispatch: t }) => {
|
|
7054
7049
|
const { replaceTerm: i } = this.options, { currentIndex: n, results: a } = this.storage, o = a[n];
|
|
7055
|
-
return o ? (
|
|
7050
|
+
return o ? (ji(i, [o], { state: e, dispatch: t }), this.storage.results.splice(n, 1)) : (ji(i, a, { state: e, dispatch: t }), this.storage.results.shift()), window.dispatchEvent(ze), Qe(e, t), !1;
|
|
7056
7051
|
},
|
|
7057
7052
|
replaceAll: () => ({ state: e, tr: t, dispatch: i }) => {
|
|
7058
7053
|
const { replaceTerm: n } = this.options, { results: a } = this.storage;
|
|
@@ -7060,7 +7055,7 @@ const Jt = "ON_SEARCH_RESULTS", ze = new CustomEvent(Jt), jl = Z.create({
|
|
|
7060
7055
|
},
|
|
7061
7056
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
7062
7057
|
const { searchResultCurrentClass: i } = this.options, { currentIndex: n, results: a } = this.storage, o = (n + a.length - 1) % a.length;
|
|
7063
|
-
return this.storage.currentIndex = o, window.dispatchEvent(ze),
|
|
7058
|
+
return this.storage.currentIndex = o, window.dispatchEvent(ze), Fi({
|
|
7064
7059
|
view: e,
|
|
7065
7060
|
tr: t,
|
|
7066
7061
|
searchResults: a,
|
|
@@ -7070,7 +7065,7 @@ const Jt = "ON_SEARCH_RESULTS", ze = new CustomEvent(Jt), jl = Z.create({
|
|
|
7070
7065
|
},
|
|
7071
7066
|
goToNextSearchResult: () => ({ view: e, tr: t }) => {
|
|
7072
7067
|
const { searchResultCurrentClass: i } = this.options, { currentIndex: n, results: a } = this.storage, o = (n + 1) % a.length;
|
|
7073
|
-
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), window.dispatchEvent(ze),
|
|
7068
|
+
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), window.dispatchEvent(ze), Fi({
|
|
7074
7069
|
view: e,
|
|
7075
7070
|
tr: t,
|
|
7076
7071
|
searchResults: a,
|
|
@@ -7083,8 +7078,8 @@ const Jt = "ON_SEARCH_RESULTS", ze = new CustomEvent(Jt), jl = Z.create({
|
|
|
7083
7078
|
addProseMirrorPlugins() {
|
|
7084
7079
|
const e = this;
|
|
7085
7080
|
return [
|
|
7086
|
-
new
|
|
7087
|
-
key: new
|
|
7081
|
+
new be({
|
|
7082
|
+
key: new we("search"),
|
|
7088
7083
|
state: {
|
|
7089
7084
|
init() {
|
|
7090
7085
|
return De.empty;
|
|
@@ -8969,7 +8964,7 @@ function Ul(e) {
|
|
|
8969
8964
|
emoji: qe[t]
|
|
8970
8965
|
}));
|
|
8971
8966
|
}
|
|
8972
|
-
const
|
|
8967
|
+
const Dn = Nt((e, t) => {
|
|
8973
8968
|
const i = X(), [n, a] = w(0), { t: o } = F(), c = (d) => {
|
|
8974
8969
|
const m = e.items[d];
|
|
8975
8970
|
m && e.command(m);
|
|
@@ -8985,7 +8980,7 @@ const $n = Tt((e, t) => {
|
|
|
8985
8980
|
return;
|
|
8986
8981
|
const d = i.current.querySelector(`span:nth-of-type(${n + 1})`);
|
|
8987
8982
|
d && oi(d, { behavior: "smooth", scrollMode: "if-needed" });
|
|
8988
|
-
}, [n]),
|
|
8983
|
+
}, [n]), Tt(t, () => ({
|
|
8989
8984
|
onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (s(), !0) : d.key === "ArrowDown" ? (h(), !0) : d.key === "Enter" ? (l(), !0) : !1
|
|
8990
8985
|
})), /* @__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((d, m) => /* @__PURE__ */ u(
|
|
8991
8986
|
"span",
|
|
@@ -9002,7 +8997,7 @@ const $n = Tt((e, t) => {
|
|
|
9002
8997
|
`emoji-list-code-${m}`
|
|
9003
8998
|
)) : /* @__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") }) }) }) });
|
|
9004
8999
|
});
|
|
9005
|
-
|
|
9000
|
+
Dn.displayName = "EmojiList";
|
|
9006
9001
|
const Vl = [
|
|
9007
9002
|
"😀",
|
|
9008
9003
|
"😃",
|
|
@@ -10905,23 +10900,23 @@ function ad(e, t = null) {
|
|
|
10905
10900
|
function od(e, t) {
|
|
10906
10901
|
window.localStorage.setItem(e, `${t}`);
|
|
10907
10902
|
}
|
|
10908
|
-
class
|
|
10903
|
+
class $t {
|
|
10909
10904
|
constructor(t, i) {
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10905
|
+
fe(this, "key");
|
|
10906
|
+
fe(this, "value");
|
|
10907
|
+
fe(this, "prev");
|
|
10908
|
+
fe(this, "next");
|
|
10914
10909
|
this.key = t, this.value = i, this.prev = null, this.next = null;
|
|
10915
10910
|
}
|
|
10916
10911
|
}
|
|
10917
10912
|
class cd {
|
|
10918
10913
|
constructor(t) {
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
this.capacity = t || 20, this.usedCapacity = 0, this.store = {}, this.head = new
|
|
10914
|
+
fe(this, "capacity");
|
|
10915
|
+
fe(this, "usedCapacity");
|
|
10916
|
+
fe(this, "head");
|
|
10917
|
+
fe(this, "tail");
|
|
10918
|
+
fe(this, "store");
|
|
10919
|
+
this.capacity = t || 20, this.usedCapacity = 0, this.store = {}, this.head = new $t("fakeHeadNode", "fakeHeadNode"), this.tail = new $t("fakeTailNode", "fakeTailNode"), this.head.next = this.tail, this.tail.prev = this.head;
|
|
10925
10920
|
}
|
|
10926
10921
|
removeNode(t) {
|
|
10927
10922
|
t.prev.next = t.next, t.next.prev = t.prev;
|
|
@@ -10948,7 +10943,7 @@ class cd {
|
|
|
10948
10943
|
const n = this.store[t];
|
|
10949
10944
|
n.value = i, this.moveToHead(n);
|
|
10950
10945
|
} else {
|
|
10951
|
-
const n = new
|
|
10946
|
+
const n = new $t(t, i);
|
|
10952
10947
|
if (this.addToHead(n), this.store[t] = n, this.usedCapacity += 1, this.usedCapacity > this.capacity) {
|
|
10953
10948
|
const a = this.removeTail();
|
|
10954
10949
|
delete this.store[a.key], this.usedCapacity -= 1;
|
|
@@ -10992,11 +10987,11 @@ function sd(e, t) {
|
|
|
10992
10987
|
}
|
|
10993
10988
|
};
|
|
10994
10989
|
}
|
|
10995
|
-
const He = sd("EMOJI_PICKER", 20),
|
|
10990
|
+
const He = sd("EMOJI_PICKER", 20), Ui = [
|
|
10996
10991
|
{
|
|
10997
10992
|
title: "Smileys & People",
|
|
10998
10993
|
data: Vl,
|
|
10999
|
-
icon:
|
|
10994
|
+
icon: Qr
|
|
11000
10995
|
},
|
|
11001
10996
|
{
|
|
11002
10997
|
title: "Animals & Nature",
|
|
@@ -11036,7 +11031,7 @@ const He = sd("EMOJI_PICKER", 20), Wi = [
|
|
|
11036
11031
|
], ld = ["😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣"];
|
|
11037
11032
|
function dd({ onSelectEmoji: e, children: t }) {
|
|
11038
11033
|
const [i, n] = w([]), { t: a } = F(), o = O(
|
|
11039
|
-
() => i.length ? [{ title: "Frequently used", icon:
|
|
11034
|
+
() => i.length ? [{ title: "Frequently used", icon: Yr, data: i }, ...Ui] : Ui,
|
|
11040
11035
|
[i]
|
|
11041
11036
|
), c = M(
|
|
11042
11037
|
(s) => {
|
|
@@ -11055,7 +11050,7 @@ function dd({ onSelectEmoji: e, children: t }) {
|
|
|
11055
11050
|
}, []), /* @__PURE__ */ u(re, { modal: !0, children: [
|
|
11056
11051
|
/* @__PURE__ */ r(ae, { asChild: !0, children: t }),
|
|
11057
11052
|
/* @__PURE__ */ r(ie, { hideWhenDetached: !0, className: "richtext-w-full richtext-h-full richtext-p-2", align: "start", side: "bottom", children: /* @__PURE__ */ u(di, { defaultValue: "Frequently used", children: [
|
|
11058
|
-
/* @__PURE__ */ r(
|
|
11053
|
+
/* @__PURE__ */ r(zt, { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: o.map((s) => /* @__PURE__ */ r(
|
|
11059
11054
|
Ve,
|
|
11060
11055
|
{
|
|
11061
11056
|
value: s.title,
|
|
@@ -11102,7 +11097,7 @@ function hd({ editor: e, icon: t, ...i }) {
|
|
|
11102
11097
|
}
|
|
11103
11098
|
) });
|
|
11104
11099
|
}
|
|
11105
|
-
const ud = 200, md = new
|
|
11100
|
+
const ud = 200, md = new we("emoji"), iu = ce.create({
|
|
11106
11101
|
name: "emoji",
|
|
11107
11102
|
content: "text*",
|
|
11108
11103
|
priority: ud,
|
|
@@ -11139,7 +11134,7 @@ const ud = 200, md = new be("emoji"), iu = ce.create({
|
|
|
11139
11134
|
},
|
|
11140
11135
|
addProseMirrorPlugins() {
|
|
11141
11136
|
return [
|
|
11142
|
-
|
|
11137
|
+
tn({
|
|
11143
11138
|
editor: this.editor,
|
|
11144
11139
|
...this.options.suggestion
|
|
11145
11140
|
})
|
|
@@ -11152,7 +11147,7 @@ const ud = 200, md = new be("emoji"), iu = ce.create({
|
|
|
11152
11147
|
let e, t, i;
|
|
11153
11148
|
return {
|
|
11154
11149
|
onStart: (n) => {
|
|
11155
|
-
i = n.editor.isEditable, i && (e = new Yt(
|
|
11150
|
+
i = n.editor.isEditable, i && (e = new Yt(Dn, {
|
|
11156
11151
|
props: n,
|
|
11157
11152
|
editor: n.editor
|
|
11158
11153
|
}), t = ai("body", {
|
|
@@ -11248,7 +11243,7 @@ function xd({ editor: e, ...t }) {
|
|
|
11248
11243
|
}
|
|
11249
11244
|
) }),
|
|
11250
11245
|
/* @__PURE__ */ u(ie, { hideWhenDetached: !0, className: "richtext-w-full richtext-h-full richtext-p-2", align: "start", side: "bottom", children: [
|
|
11251
|
-
/* @__PURE__ */ r(
|
|
11246
|
+
/* @__PURE__ */ r(de, { className: "richtext-mb-[6px]", children: i("editor.formula.dialog.text") }),
|
|
11252
11247
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[16px]", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
|
|
11253
11248
|
ct,
|
|
11254
11249
|
{
|
|
@@ -11265,7 +11260,7 @@ function xd({ editor: e, ...t }) {
|
|
|
11265
11260
|
d && /* @__PURE__ */ r("div", { className: "richtext-my-[10px] richtext-p-[10px] richtext-rounded-[6px] !richtext-border-[1px]", children: d }),
|
|
11266
11261
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
|
|
11267
11262
|
/* @__PURE__ */ r(U, { onClick: h, className: "richtext-flex-1", children: "Submit" }),
|
|
11268
|
-
/* @__PURE__ */ r("a", { href: "https://katex.org/docs/supported", target: "_blank", rel: "noreferrer noopener", children: /* @__PURE__ */ r(
|
|
11263
|
+
/* @__PURE__ */ r("a", { href: "https://katex.org/docs/supported", target: "_blank", rel: "noreferrer noopener", children: /* @__PURE__ */ r(Gi, { size: 16 }) })
|
|
11269
11264
|
] })
|
|
11270
11265
|
] })
|
|
11271
11266
|
] });
|
|
@@ -11333,7 +11328,7 @@ const Oe = ce.create({
|
|
|
11333
11328
|
];
|
|
11334
11329
|
},
|
|
11335
11330
|
addNodeView() {
|
|
11336
|
-
return
|
|
11331
|
+
return me(gd);
|
|
11337
11332
|
}
|
|
11338
11333
|
});
|
|
11339
11334
|
function bd(e) {
|
|
@@ -11422,7 +11417,7 @@ function yd(e) {
|
|
|
11422
11417
|
const g = new DOMParser().parseFromString(m, "text/html"), x = g.querySelectorAll("img");
|
|
11423
11418
|
if (!x.length)
|
|
11424
11419
|
return g.body.innerHTML;
|
|
11425
|
-
if (
|
|
11420
|
+
if (vn(e.editor, "image")) {
|
|
11426
11421
|
const L = (k = e.editor.extensionManager.extensions.find(
|
|
11427
11422
|
(p) => p.name === "importWord"
|
|
11428
11423
|
)) == null ? void 0 : k.options;
|
|
@@ -11526,18 +11521,18 @@ function Cd(e, t) {
|
|
|
11526
11521
|
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
11527
11522
|
}
|
|
11528
11523
|
const Nd = {
|
|
11529
|
-
...
|
|
11530
|
-
hardBreak:
|
|
11531
|
-
codeBlock:
|
|
11532
|
-
orderedList:
|
|
11533
|
-
listItem:
|
|
11534
|
-
bulletList:
|
|
11535
|
-
horizontalRule:
|
|
11524
|
+
...ye,
|
|
11525
|
+
hardBreak: ye.hard_break,
|
|
11526
|
+
codeBlock: ye.code_block,
|
|
11527
|
+
orderedList: ye.ordered_list,
|
|
11528
|
+
listItem: ye.list_item,
|
|
11529
|
+
bulletList: ye.bullet_list,
|
|
11530
|
+
horizontalRule: ye.horizontal_rule,
|
|
11536
11531
|
// Requirement Buffer on browser
|
|
11537
11532
|
image(e, t) {
|
|
11538
11533
|
e.renderInline(t), e.closeBlock(t);
|
|
11539
11534
|
}
|
|
11540
|
-
}, Td = new
|
|
11535
|
+
}, Td = new lo(Nd, ho), au = Z.create({
|
|
11541
11536
|
name: "exportWord",
|
|
11542
11537
|
addOptions() {
|
|
11543
11538
|
var e;
|
|
@@ -11567,7 +11562,7 @@ const Nd = {
|
|
|
11567
11562
|
return new Uint8Array(o);
|
|
11568
11563
|
}
|
|
11569
11564
|
}, i = Td.serialize(e.state.doc, t);
|
|
11570
|
-
return
|
|
11565
|
+
return uo.toBlob(i).then((n) => Cd(new Blob([n]), "export-document.docx")), !0;
|
|
11571
11566
|
}
|
|
11572
11567
|
};
|
|
11573
11568
|
}
|
|
@@ -11699,7 +11694,7 @@ const Pd = ce.create({
|
|
|
11699
11694
|
return ["toc", se(e)];
|
|
11700
11695
|
},
|
|
11701
11696
|
addNodeView() {
|
|
11702
|
-
return
|
|
11697
|
+
return me(zd);
|
|
11703
11698
|
},
|
|
11704
11699
|
// @ts-expect-error
|
|
11705
11700
|
addCommands() {
|
|
@@ -11789,7 +11784,7 @@ function Dd(e) {
|
|
|
11789
11784
|
) }),
|
|
11790
11785
|
/* @__PURE__ */ u(Ie, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
11791
11786
|
/* @__PURE__ */ r("span", { children: n.title }),
|
|
11792
|
-
!!((o = n.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (c = n.shortcutKeys) == null ? void 0 : c.map((s) =>
|
|
11787
|
+
!!((o = n.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (c = n.shortcutKeys) == null ? void 0 : c.map((s) => St(s)).join(" ") })
|
|
11793
11788
|
] })
|
|
11794
11789
|
] }, `text-align-${a}`);
|
|
11795
11790
|
})
|
|
@@ -11867,7 +11862,7 @@ const ou = Z.create({
|
|
|
11867
11862
|
listUsers: $d,
|
|
11868
11863
|
itemUser: Bd,
|
|
11869
11864
|
selectedUser: jd
|
|
11870
|
-
}, Fd =
|
|
11865
|
+
}, Fd = Nt((e, t) => {
|
|
11871
11866
|
const i = X(), [n, a] = w(0), o = (l) => {
|
|
11872
11867
|
const d = e.items[l];
|
|
11873
11868
|
d && e.command({ id: d, label: d });
|
|
@@ -11883,7 +11878,7 @@ const ou = Z.create({
|
|
|
11883
11878
|
return;
|
|
11884
11879
|
const l = i.current.querySelector(`span:nth-of-type(${n + 1})`);
|
|
11885
11880
|
l && oi(l, { behavior: "smooth", scrollMode: "if-needed" });
|
|
11886
|
-
}, [n]),
|
|
11881
|
+
}, [n]), Tt(t, () => ({
|
|
11887
11882
|
onKeyDown: ({ event: l }) => l.key === "ArrowUp" ? (c(), !0) : l.key === "ArrowDown" ? (s(), !0) : l.key === "Enter" ? (h(), !0) : !1
|
|
11888
11883
|
})), /* @__PURE__ */ r("div", { className: ee("listUsers", bt.listUsers), children: /* @__PURE__ */ r("div", { ref: i, children: e.items.length ? e.items.map((l, d) => /* @__PURE__ */ r(
|
|
11889
11884
|
"span",
|
|
@@ -11944,7 +11939,7 @@ const ou = Z.create({
|
|
|
11944
11939
|
}
|
|
11945
11940
|
};
|
|
11946
11941
|
}
|
|
11947
|
-
}, cu =
|
|
11942
|
+
}, cu = qa.extend({
|
|
11948
11943
|
addAttributes() {
|
|
11949
11944
|
return {
|
|
11950
11945
|
id: {
|
|
@@ -11966,26 +11961,26 @@ const ou = Z.create({
|
|
|
11966
11961
|
function Wd(e) {
|
|
11967
11962
|
switch (gc(e)) {
|
|
11968
11963
|
case "audio":
|
|
11969
|
-
return /* @__PURE__ */ r(oa, {});
|
|
11970
|
-
case "video":
|
|
11971
11964
|
return /* @__PURE__ */ r(aa, {});
|
|
11972
|
-
case "
|
|
11965
|
+
case "video":
|
|
11973
11966
|
return /* @__PURE__ */ r(ra, {});
|
|
11974
|
-
case "
|
|
11967
|
+
case "file":
|
|
11975
11968
|
return /* @__PURE__ */ r(na, {});
|
|
11969
|
+
case "image":
|
|
11970
|
+
return /* @__PURE__ */ r(ia, {});
|
|
11976
11971
|
case "pdf":
|
|
11977
|
-
return /* @__PURE__ */ r(
|
|
11972
|
+
return /* @__PURE__ */ r(zn, {});
|
|
11978
11973
|
case "word":
|
|
11979
|
-
return /* @__PURE__ */ r(
|
|
11974
|
+
return /* @__PURE__ */ r(Hn, {});
|
|
11980
11975
|
case "excel":
|
|
11981
|
-
return /* @__PURE__ */ r(ia, {});
|
|
11982
|
-
case "ppt":
|
|
11983
11976
|
return /* @__PURE__ */ r(ta, {});
|
|
11977
|
+
case "ppt":
|
|
11978
|
+
return /* @__PURE__ */ r(ea, {});
|
|
11984
11979
|
default:
|
|
11985
11980
|
return /* @__PURE__ */ r(q, {});
|
|
11986
11981
|
}
|
|
11987
11982
|
}
|
|
11988
|
-
const qd = "_wrap_gpqtf_1",
|
|
11983
|
+
const qd = "_wrap_gpqtf_1", Bt = {
|
|
11989
11984
|
wrap: qd
|
|
11990
11985
|
};
|
|
11991
11986
|
function Kd({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension: a }) {
|
|
@@ -12017,10 +12012,10 @@ function Kd({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
12017
12012
|
!f && !s && (p(), i({ hasTrigger: !0 }));
|
|
12018
12013
|
}, [f, s, p, i]);
|
|
12019
12014
|
const C = M(() => n(), [e]);
|
|
12020
|
-
return c && !f ? /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ u("div", { className: ee(
|
|
12015
|
+
return c && !f ? /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ u("div", { className: ee(Bt.wrap, "render-wrapper"), children: [
|
|
12021
12016
|
/* @__PURE__ */ r("p", { style: { cursor: "pointer" }, onClick: p, children: x ? /* @__PURE__ */ r("span", { children: k("editor.attachment.uploading") }) : /* @__PURE__ */ r("span", { children: k("editor.attachment.please_upload") }) }),
|
|
12022
12017
|
/* @__PURE__ */ r("input", { ref: o, type: "file", hidden: !0, onChange: v })
|
|
12023
|
-
] }) }) : f ? /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ u("div", { className: ee(
|
|
12018
|
+
] }) }) : f ? /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ u("div", { className: ee(Bt.wrap, "render-wrapper"), onClick: p, children: [
|
|
12024
12019
|
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
12025
12020
|
/* @__PURE__ */ r("span", { children: Wd(m) }),
|
|
12026
12021
|
/* @__PURE__ */ u("span", { children: [
|
|
@@ -12042,7 +12037,7 @@ function Kd({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
12042
12037
|
tooltip: k("editor.delete")
|
|
12043
12038
|
}
|
|
12044
12039
|
)
|
|
12045
|
-
] }) }) : g !== "null" ? /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { className: ee(
|
|
12040
|
+
] }) }) : g !== "null" ? /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { className: ee(Bt.wrap, "render-wrapper"), onClick: p, children: /* @__PURE__ */ r("p", { children: g }) }) }) : /* @__PURE__ */ r(q, {});
|
|
12046
12041
|
}
|
|
12047
12042
|
const su = ce.create({
|
|
12048
12043
|
name: "attachment",
|
|
@@ -12115,7 +12110,7 @@ const su = ce.create({
|
|
|
12115
12110
|
};
|
|
12116
12111
|
},
|
|
12117
12112
|
addNodeView() {
|
|
12118
|
-
return
|
|
12113
|
+
return me(Kd);
|
|
12119
12114
|
}
|
|
12120
12115
|
}), wt = {
|
|
12121
12116
|
TOP_LEFT: "tl",
|
|
@@ -12170,7 +12165,7 @@ function Gd(e) {
|
|
|
12170
12165
|
y.commands.setNodeSelection(R());
|
|
12171
12166
|
}
|
|
12172
12167
|
const b = M(
|
|
12173
|
-
|
|
12168
|
+
Le(() => {
|
|
12174
12169
|
const { editor: y } = e, { width: R } = getComputedStyle(y.view.dom);
|
|
12175
12170
|
i((A) => ({
|
|
12176
12171
|
...A,
|
|
@@ -12195,10 +12190,10 @@ function Gd(e) {
|
|
|
12195
12190
|
});
|
|
12196
12191
|
}
|
|
12197
12192
|
const L = M(
|
|
12198
|
-
|
|
12193
|
+
Le((y) => {
|
|
12199
12194
|
if (y.preventDefault(), y.stopPropagation(), !c)
|
|
12200
12195
|
return;
|
|
12201
|
-
const { x: R, w: A, dir: N } = h, B = (y.clientX - R) * (/l/.test(N) ? -1 : 1), S =
|
|
12196
|
+
const { x: R, w: A, dir: N } = h, B = (y.clientX - R) * (/l/.test(N) ? -1 : 1), S = an(A + B, ni, t.width);
|
|
12202
12197
|
e.updateAttributes({
|
|
12203
12198
|
width: S,
|
|
12204
12199
|
height: null
|
|
@@ -12332,7 +12327,7 @@ function Jd({ editor: e, icon: t, giphyApiKey: i, ...n }) {
|
|
|
12332
12327
|
}
|
|
12333
12328
|
);
|
|
12334
12329
|
}
|
|
12335
|
-
const
|
|
12330
|
+
const $n = Qt.extend({
|
|
12336
12331
|
name: "imageGif",
|
|
12337
12332
|
addOptions() {
|
|
12338
12333
|
var e;
|
|
@@ -12389,7 +12384,7 @@ const Bn = Qt.extend({
|
|
|
12389
12384
|
};
|
|
12390
12385
|
},
|
|
12391
12386
|
addNodeView() {
|
|
12392
|
-
return
|
|
12387
|
+
return me(Gd);
|
|
12393
12388
|
},
|
|
12394
12389
|
addCommands() {
|
|
12395
12390
|
var e;
|
|
@@ -12438,9 +12433,9 @@ const Bn = Qt.extend({
|
|
|
12438
12433
|
}
|
|
12439
12434
|
];
|
|
12440
12435
|
}
|
|
12441
|
-
}),
|
|
12436
|
+
}), Vi = `graph TB
|
|
12442
12437
|
a-->b`, Xd = ({ editor: e, upload: t }) => {
|
|
12443
|
-
const [i, n] = w(
|
|
12438
|
+
const [i, n] = w(Vi), [a, o] = w(""), [c, s] = w(!1), h = X(null), l = async (f) => {
|
|
12444
12439
|
try {
|
|
12445
12440
|
const { svg: g } = await Ct.render("mermaid-svg", f);
|
|
12446
12441
|
o(g);
|
|
@@ -12486,15 +12481,18 @@ a-->b`, Xd = ({ editor: e, upload: t }) => {
|
|
|
12486
12481
|
autoFocus: !0,
|
|
12487
12482
|
required: !0,
|
|
12488
12483
|
rows: 10,
|
|
12489
|
-
defaultValue:
|
|
12490
|
-
placeholder: "Text"
|
|
12484
|
+
defaultValue: Vi,
|
|
12485
|
+
placeholder: "Text",
|
|
12486
|
+
style: {
|
|
12487
|
+
color: "hsl(var(--richtext-foreground))"
|
|
12488
|
+
}
|
|
12491
12489
|
}
|
|
12492
12490
|
),
|
|
12493
12491
|
/* @__PURE__ */ r(
|
|
12494
12492
|
"div",
|
|
12495
12493
|
{
|
|
12496
12494
|
className: "richtext-flex-1 richtext-flex richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",
|
|
12497
|
-
style: { height: "100%", border: "1px solid hsl(var(--border))", minHeight: 500 },
|
|
12495
|
+
style: { height: "100%", border: "1px solid hsl(var(--border))", minHeight: 500, background: "#fff" },
|
|
12498
12496
|
ref: h,
|
|
12499
12497
|
dangerouslySetInnerHTML: { __html: a }
|
|
12500
12498
|
}
|
|
@@ -12507,10 +12505,10 @@ a-->b`, Xd = ({ editor: e, upload: t }) => {
|
|
|
12507
12505
|
onClick: async () => {
|
|
12508
12506
|
if (i !== "") {
|
|
12509
12507
|
if (i) {
|
|
12510
|
-
const f = h.current.querySelector("svg"), { width: g, height: x } = f.getBoundingClientRect(), b = `mermaid-${
|
|
12511
|
-
let k =
|
|
12508
|
+
const f = h.current.querySelector("svg"), { width: g, height: x } = f.getBoundingClientRect(), b = `mermaid-${Cn()}.svg`;
|
|
12509
|
+
let k = nn(f.outerHTML);
|
|
12512
12510
|
if (t) {
|
|
12513
|
-
const L =
|
|
12511
|
+
const L = ui(k, b);
|
|
12514
12512
|
k = await t(L);
|
|
12515
12513
|
}
|
|
12516
12514
|
e == null || e.chain().focus().setMermaid(
|
|
@@ -12559,7 +12557,7 @@ function Yd({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12559
12557
|
h: 0,
|
|
12560
12558
|
dir: ""
|
|
12561
12559
|
}), { align: x } = t == null ? void 0 : t.attrs, b = O(() => {
|
|
12562
|
-
const { src: A, alt: N, width: B, height: S } = t == null ? void 0 : t.attrs, E =
|
|
12560
|
+
const { src: A, alt: N, width: B, height: S } = t == null ? void 0 : t.attrs, E = yi(B) ? `${B}px` : B, H = yi(S) ? `${S}px` : S;
|
|
12563
12561
|
return {
|
|
12564
12562
|
src: A || void 0,
|
|
12565
12563
|
alt: N || void 0,
|
|
@@ -12584,7 +12582,7 @@ function Yd({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12584
12582
|
e.commands.setNodeSelection(n());
|
|
12585
12583
|
}
|
|
12586
12584
|
const v = M(
|
|
12587
|
-
|
|
12585
|
+
Le(() => {
|
|
12588
12586
|
const { width: A } = getComputedStyle(e.view.dom);
|
|
12589
12587
|
c((N) => ({
|
|
12590
12588
|
...N,
|
|
@@ -12609,10 +12607,10 @@ function Yd({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12609
12607
|
});
|
|
12610
12608
|
}
|
|
12611
12609
|
const T = M(
|
|
12612
|
-
|
|
12610
|
+
Le((A) => {
|
|
12613
12611
|
if (A.preventDefault(), A.stopPropagation(), !d)
|
|
12614
12612
|
return;
|
|
12615
|
-
const { x: N, w: B, dir: S } = f, E = (A.clientX - N) * (/l/.test(S) ? -1 : 1), H =
|
|
12613
|
+
const { x: N, w: B, dir: S } = f, E = (A.clientX - N) * (/l/.test(S) ? -1 : 1), H = _n(B + E, ni, o.width);
|
|
12616
12614
|
i({
|
|
12617
12615
|
width: H,
|
|
12618
12616
|
height: null
|
|
@@ -12649,7 +12647,7 @@ function Yd({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12649
12647
|
draggable: "true",
|
|
12650
12648
|
"data-drag-handle": !0,
|
|
12651
12649
|
className: `image-view__body ${a ? "image-view__body--focused" : ""} ${d ? "image-view__body--resizing" : ""}`,
|
|
12652
|
-
style: k,
|
|
12650
|
+
style: { ...k, background: "#fff" },
|
|
12653
12651
|
children: [
|
|
12654
12652
|
/* @__PURE__ */ r(
|
|
12655
12653
|
"img",
|
|
@@ -12675,7 +12673,7 @@ function Yd({ editor: e, node: t, updateAttributes: i, getPos: n, selected: a })
|
|
|
12675
12673
|
}
|
|
12676
12674
|
) });
|
|
12677
12675
|
}
|
|
12678
|
-
const
|
|
12676
|
+
const Wi = Qt.extend({
|
|
12679
12677
|
name: "mermaid",
|
|
12680
12678
|
addOptions() {
|
|
12681
12679
|
var e;
|
|
@@ -12743,7 +12741,7 @@ const Ki = Qt.extend({
|
|
|
12743
12741
|
};
|
|
12744
12742
|
},
|
|
12745
12743
|
addNodeView() {
|
|
12746
|
-
return
|
|
12744
|
+
return me(Yd);
|
|
12747
12745
|
},
|
|
12748
12746
|
// @ts-ignore
|
|
12749
12747
|
addCommands() {
|
|
@@ -12819,8 +12817,8 @@ export {
|
|
|
12819
12817
|
Th as U,
|
|
12820
12818
|
Yh as V,
|
|
12821
12819
|
su as W,
|
|
12822
|
-
|
|
12823
|
-
|
|
12820
|
+
$n as X,
|
|
12821
|
+
Wi as Y,
|
|
12824
12822
|
Us as a,
|
|
12825
12823
|
zh as b,
|
|
12826
12824
|
Hh as c,
|
|
@@ -12842,7 +12840,7 @@ export {
|
|
|
12842
12840
|
Qh as s,
|
|
12843
12841
|
eu as t,
|
|
12844
12842
|
tu as u,
|
|
12845
|
-
|
|
12843
|
+
xi as v,
|
|
12846
12844
|
it as w,
|
|
12847
12845
|
Uh as x,
|
|
12848
12846
|
Re as y,
|