reactjs-tiptap-editor 0.2.27 → 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{RichTextEditor-DH6J2is9.js → RichTextEditor-Ce2IeNE6.js} +741 -746
- package/lib/{RichTextEditor-CIhslsGV.cjs → RichTextEditor-hDDApaDD.cjs} +6 -11
- package/lib/extension-bundle.cjs +1 -1
- package/lib/extension-bundle.d.cts +36 -36
- package/lib/extension-bundle.d.ts +36 -36
- package/lib/extension-bundle.js +7 -9
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +36 -36
- package/lib/index.d.ts +36 -36
- package/lib/index.js +1 -1
- package/lib/locale-bundle.d.cts +36 -36
- package/lib/locale-bundle.d.ts +36 -36
- package/lib/style.css +1 -1
- package/package.json +1 -1
|
@@ -7,20 +7,20 @@ import Ht, { createContext as xi, useContext as fi, useSyncExternalStore as gi,
|
|
|
7
7
|
import { Q as re, b as yt, m as st, V as Ci, N as gt, W as de, R as pt, X as Re, Y as ie, Z as Ti, B as tt, _ as Ni, $ as ki, a0 as Si } from "./tiptap-DOP8lVCQ.js";
|
|
8
8
|
import { u as q, I as xt, n as ft, o as he, V as Ce, p as Mi, C as Ai, h as Z, B as Li, q as ne, E as Ii } from "./index-CO-iymkb.js";
|
|
9
9
|
import * as br from "@radix-ui/react-separator";
|
|
10
|
-
import { ax as Ei, at as oe, ak as zi, ay as ue, au as Oe, T as Wt, N as Pi, A as Ri, az as
|
|
10
|
+
import { ax as Ei, at as oe, ak as zi, ay as ue, au as Oe, T as Wt, N as Pi, A as Ri, az as ce, aA as ht, aB as yr, b as He, P as De, a0 as Oi, $ as Hi, av as Cr, aC as Di, aD as me, aE as _i, H as Ft, aF as Bi, aG as $i, S as Vi, aH as Wi, aI as Fi } from "./vendor-BbgkyoD-.js";
|
|
11
11
|
import * as et from "@radix-ui/react-toast";
|
|
12
|
-
import { ChevronRight as Ui, Check as Tr, Circle as Gi, X as Nr, WrapText as qi, PencilRuler as ji, FlipHorizontal as Xi, FlipVertical as Yi, CropIcon as Ki, ChevronUp as Zi, Paperclip as Ji, Eye as Qi, Settings as tn, ZoomOut as en, ZoomIn as rn, BookMarked as nn, Sigma as on, SmilePlusIcon as
|
|
12
|
+
import { ChevronRight as Ui, Check as Tr, Circle as Gi, X as Nr, WrapText as qi, PencilRuler as ji, FlipHorizontal as Xi, FlipVertical as Yi, CropIcon as Ki, ChevronUp as Zi, Paperclip as Ji, Eye as Qi, Settings as tn, ZoomOut as en, ZoomIn as rn, BookMarked as nn, Sigma as on, SmilePlusIcon as cn, Replace as Ze, SmilePlus as an, Frame as sn, Columns2 as Je, PanelRight as ln, PanelLeft as dn, Clipboard as hn, Copy as un, GripVertical as mn, Plus as kr, Columns4 as xn, Columns3 as fn, Heading6 as gn, Heading5 as pn, Heading4 as wn, Heading3 as vn, Heading2 as bn, Heading1 as yn, ChevronsUpDown as Cn, Trash as Tn, Trash2 as Sr, TableCellsSplit as Nn, TableCellsMerge as kn, BetweenVerticalEnd as Sn, BetweenVerticalStart as Mn, BetweenHorizonalStart as An, BetweenHorizonalEnd as Ln, Unlink as In, Pencil as Mr, Sparkles as En, Table as zn, Minimize as Pn, Maximize as Rn, Video as On, ImageUp as Hn, Link as Dn, ListTodo as _n, ListOrdered as Bn, List as $n, IndentDecrease as Vn, IndentIncrease as Wn, Type as Fn, CodeXml as Un, Code as Gn, Superscript as qn, Subscript as jn, ChevronDown as Xn, Undo2 as Yn, Redo2 as Kn, PaintRoller as Zn, Eraser as Jn, Minus as Qn, Strikethrough as to, Quote as eo, Underline as ro, Italic as io, LoaderCircle as no, Bold as oo, HelpCircle as Ar } from "lucide-react";
|
|
13
13
|
import * as Ut from "@radix-ui/react-tooltip";
|
|
14
14
|
import { Color4 as j, Editor as Lr, makeDropdownToolbar as Ir } from "easydrawer";
|
|
15
15
|
import { Slot as Er } from "@radix-ui/react-slot";
|
|
16
16
|
import * as zr from "@radix-ui/react-toggle";
|
|
17
|
-
import { TextAlignRightIcon as
|
|
17
|
+
import { TextAlignRightIcon as co, TextAlignLeftIcon as ao, TextAlignJustifyIcon as so, TextAlignCenterIcon as lo } from "@radix-ui/react-icons";
|
|
18
18
|
import * as it from "@radix-ui/react-dialog";
|
|
19
19
|
import * as _t from "@radix-ui/react-popover";
|
|
20
20
|
import * as Pr from "@radix-ui/react-label";
|
|
21
21
|
import { Resizable as Rr } from "re-resizable";
|
|
22
22
|
import _e from "katex";
|
|
23
|
-
import
|
|
23
|
+
import ae from "mermaid";
|
|
24
24
|
import ho, { sticky as uo } from "tippy.js";
|
|
25
25
|
import { HexColorPicker as mo } from "react-colorful";
|
|
26
26
|
import * as Te from "@radix-ui/react-switch";
|
|
@@ -47,10 +47,10 @@ const O = Ht.forwardRef(
|
|
|
47
47
|
icon: r = void 0,
|
|
48
48
|
// title = undefined,
|
|
49
49
|
tooltip: n = void 0,
|
|
50
|
-
disabled:
|
|
50
|
+
disabled: c = !1,
|
|
51
51
|
customClass: o = "",
|
|
52
52
|
// color = undefined,
|
|
53
|
-
loading:
|
|
53
|
+
loading: a = void 0,
|
|
54
54
|
shortcutKeys: l = void 0,
|
|
55
55
|
tooltipOptions: s = {},
|
|
56
56
|
action: h = void 0,
|
|
@@ -69,7 +69,7 @@ const O = Ht.forwardRef(
|
|
|
69
69
|
ref: e,
|
|
70
70
|
size: "sm",
|
|
71
71
|
className: P("richtext-w-[32px] richtext-h-[32px]", o),
|
|
72
|
-
disabled:
|
|
72
|
+
disabled: c,
|
|
73
73
|
...w,
|
|
74
74
|
children: [
|
|
75
75
|
p && /* @__PURE__ */ i(p, { className: "richtext-size-4" }),
|
|
@@ -86,11 +86,11 @@ const O = Ht.forwardRef(
|
|
|
86
86
|
);
|
|
87
87
|
function xe(t) {
|
|
88
88
|
function e() {
|
|
89
|
-
const o = J(t),
|
|
89
|
+
const o = J(t), a = H(() => o.current, []), l = J(/* @__PURE__ */ new Set()), s = H((d) => {
|
|
90
90
|
o.current = { ...o.current, ...d }, l.current.forEach((u) => u());
|
|
91
91
|
}, []), h = H((d) => (l.current.add(d), () => l.current.delete(d)), []);
|
|
92
92
|
return {
|
|
93
|
-
get:
|
|
93
|
+
get: a,
|
|
94
94
|
set: s,
|
|
95
95
|
subscribe: h
|
|
96
96
|
};
|
|
@@ -99,19 +99,19 @@ function xe(t) {
|
|
|
99
99
|
function n({ children: o }) {
|
|
100
100
|
return /* @__PURE__ */ i(r.Provider, { value: e(), children: o });
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
if (!
|
|
102
|
+
function c(o) {
|
|
103
|
+
const a = fi(r);
|
|
104
|
+
if (!a)
|
|
105
105
|
throw new Error("Store not found");
|
|
106
106
|
return [gi(
|
|
107
|
-
|
|
108
|
-
() => o(
|
|
107
|
+
a.subscribe,
|
|
108
|
+
() => o(a.get()),
|
|
109
109
|
() => o(t)
|
|
110
|
-
),
|
|
110
|
+
), a.set];
|
|
111
111
|
}
|
|
112
112
|
return {
|
|
113
113
|
Provider: n,
|
|
114
|
-
useStore:
|
|
114
|
+
useStore: c
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
xe({
|
|
@@ -156,22 +156,22 @@ const bo = {
|
|
|
156
156
|
};
|
|
157
157
|
function Gt(t, e) {
|
|
158
158
|
const { state: r } = e, n = r.selection.$anchor;
|
|
159
|
-
let
|
|
159
|
+
let c = !1;
|
|
160
160
|
if (n.depth)
|
|
161
161
|
for (let o = n.depth; o > 0; o--)
|
|
162
|
-
n.node(o).type.name === t && (e.dispatchTransaction && e.dispatchTransaction(r.tr.delete(n.before(o), n.after(o)).scrollIntoView()),
|
|
162
|
+
n.node(o).type.name === t && (e.dispatchTransaction && e.dispatchTransaction(r.tr.delete(n.before(o), n.after(o)).scrollIntoView()), c = !0);
|
|
163
163
|
else {
|
|
164
164
|
const o = r.selection.node;
|
|
165
|
-
o && o.type.name === t && (e.chain().deleteSelection().run(),
|
|
165
|
+
o && o.type.name === t && (e.chain().deleteSelection().run(), c = !0);
|
|
166
166
|
}
|
|
167
|
-
if (!
|
|
167
|
+
if (!c) {
|
|
168
168
|
const o = n.pos;
|
|
169
169
|
if (o) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const a = r.tr.doc.nodeAt(o);
|
|
171
|
+
a && a.type.name === t && (e.dispatchTransaction && e.dispatchTransaction(r.tr.delete(o, o + a.nodeSize)), c = !0);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
return
|
|
174
|
+
return c;
|
|
175
175
|
}
|
|
176
176
|
function $e(t, e, r) {
|
|
177
177
|
return t < e ? e : t > r ? r : t;
|
|
@@ -180,14 +180,14 @@ const yo = (t) => typeof t == "number", Co = (t) => typeof t == "string", To = (
|
|
|
180
180
|
function No(t, e = "px") {
|
|
181
181
|
if (!t)
|
|
182
182
|
return t;
|
|
183
|
-
const r = yo(t) ? String(t) : t, n = Number.parseFloat(r),
|
|
183
|
+
const r = yo(t) ? String(t) : t, n = Number.parseFloat(r), c = r.match(/[%a-z]+$/i), o = c ? c[0] : e;
|
|
184
184
|
return Number.isNaN(n) ? t : n + o;
|
|
185
185
|
}
|
|
186
186
|
function ko(t, e) {
|
|
187
187
|
if (!t)
|
|
188
188
|
return !1;
|
|
189
189
|
const { extensions: r = [] } = (t == null ? void 0 : t.extensionManager) ?? {};
|
|
190
|
-
return !!r.find((
|
|
190
|
+
return !!r.find((c) => c.name === e);
|
|
191
191
|
}
|
|
192
192
|
function Sl(t) {
|
|
193
193
|
return t.map((e) => Co(e) ? { value: e, name: e } : e);
|
|
@@ -217,20 +217,20 @@ const So = ue(
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
), G = W.forwardRef(
|
|
220
|
-
({ className: t, variant: e, size: r, asChild: n = !1, ...
|
|
220
|
+
({ className: t, variant: e, size: r, asChild: n = !1, ...c }, o) => /* @__PURE__ */ i(
|
|
221
221
|
n ? Er : "button",
|
|
222
222
|
{
|
|
223
223
|
className: P(So({ variant: e, size: r, className: t })),
|
|
224
224
|
ref: o,
|
|
225
|
-
...
|
|
225
|
+
...c
|
|
226
226
|
}
|
|
227
227
|
)
|
|
228
228
|
);
|
|
229
229
|
G.displayName = "Button";
|
|
230
|
-
const Mo = X.Root, Ao = X.Trigger, Qe = X.Portal, tr = X.Sub, ke = W.forwardRef(({ className: t, inset: e, children: r, ...n },
|
|
230
|
+
const Mo = X.Root, Ao = X.Trigger, Qe = X.Portal, tr = X.Sub, ke = W.forwardRef(({ className: t, inset: e, children: r, ...n }, c) => /* @__PURE__ */ g(
|
|
231
231
|
X.SubTrigger,
|
|
232
232
|
{
|
|
233
|
-
ref:
|
|
233
|
+
ref: c,
|
|
234
234
|
className: P(
|
|
235
235
|
"richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",
|
|
236
236
|
e && "richtext-pl-8",
|
|
@@ -282,10 +282,10 @@ const ot = W.forwardRef(({ className: t, inset: e, ...r }, n) => /* @__PURE__ */
|
|
|
282
282
|
}
|
|
283
283
|
));
|
|
284
284
|
ot.displayName = X.Item.displayName;
|
|
285
|
-
const Lo = W.forwardRef(({ className: t, children: e, checked: r, ...n },
|
|
285
|
+
const Lo = W.forwardRef(({ className: t, children: e, checked: r, ...n }, c) => /* @__PURE__ */ g(
|
|
286
286
|
X.CheckboxItem,
|
|
287
287
|
{
|
|
288
|
-
ref:
|
|
288
|
+
ref: c,
|
|
289
289
|
className: P(
|
|
290
290
|
"richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
|
|
291
291
|
t
|
|
@@ -367,7 +367,7 @@ const Q = W.forwardRef(
|
|
|
367
367
|
Q.displayName = "Input";
|
|
368
368
|
const Po = ue(
|
|
369
369
|
"richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"
|
|
370
|
-
),
|
|
370
|
+
), at = W.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
371
371
|
Pr.Root,
|
|
372
372
|
{
|
|
373
373
|
ref: r,
|
|
@@ -375,11 +375,11 @@ const Po = ue(
|
|
|
375
375
|
...e
|
|
376
376
|
}
|
|
377
377
|
));
|
|
378
|
-
|
|
379
|
-
const It = _t.Root, Et = _t.Trigger, Tt = W.forwardRef(({ className: t, align: e = "center", sideOffset: r = 4, ...n },
|
|
378
|
+
at.displayName = Pr.Root.displayName;
|
|
379
|
+
const It = _t.Root, Et = _t.Trigger, Tt = W.forwardRef(({ className: t, align: e = "center", sideOffset: r = 4, ...n }, c) => /* @__PURE__ */ i(_t.Portal, { children: /* @__PURE__ */ i(
|
|
380
380
|
_t.Content,
|
|
381
381
|
{
|
|
382
|
-
ref:
|
|
382
|
+
ref: c,
|
|
383
383
|
align: e,
|
|
384
384
|
sideOffset: r,
|
|
385
385
|
className: P(
|
|
@@ -391,10 +391,10 @@ const It = _t.Root, Et = _t.Trigger, Tt = W.forwardRef(({ className: t, align: e
|
|
|
391
391
|
) }));
|
|
392
392
|
Tt.displayName = _t.Content.displayName;
|
|
393
393
|
const rt = W.forwardRef(
|
|
394
|
-
({ className: t, orientation: e = "horizontal", decorative: r = !0, ...n },
|
|
394
|
+
({ className: t, orientation: e = "horizontal", decorative: r = !0, ...n }, c) => /* @__PURE__ */ i(
|
|
395
395
|
br.Root,
|
|
396
396
|
{
|
|
397
|
-
ref:
|
|
397
|
+
ref: c,
|
|
398
398
|
decorative: r,
|
|
399
399
|
orientation: e,
|
|
400
400
|
className: P(
|
|
@@ -560,10 +560,10 @@ const Do = ue(
|
|
|
560
560
|
size: "default"
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
), qr = W.forwardRef(({ className: t, variant: e, size: r, ...n },
|
|
563
|
+
), qr = W.forwardRef(({ className: t, variant: e, size: r, ...n }, c) => /* @__PURE__ */ i(
|
|
564
564
|
zr.Root,
|
|
565
565
|
{
|
|
566
|
-
ref:
|
|
566
|
+
ref: c,
|
|
567
567
|
className: P(Do({ variant: e, size: r, className: t })),
|
|
568
568
|
...n
|
|
569
569
|
}
|
|
@@ -645,9 +645,9 @@ function Dt(t) {
|
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
647
|
function Fo({ ...t }) {
|
|
648
|
-
const e = Vo(), r = (
|
|
648
|
+
const e = Vo(), r = (c) => Dt({
|
|
649
649
|
type: "UPDATE_TOAST",
|
|
650
|
-
toast: { ...
|
|
650
|
+
toast: { ...c, id: e }
|
|
651
651
|
}), n = () => Dt({ type: "DISMISS_TOAST", toastId: e });
|
|
652
652
|
return Dt({
|
|
653
653
|
type: "ADD_TOAST",
|
|
@@ -655,8 +655,8 @@ function Fo({ ...t }) {
|
|
|
655
655
|
...t,
|
|
656
656
|
id: e,
|
|
657
657
|
open: !0,
|
|
658
|
-
onOpenChange: (
|
|
659
|
-
|
|
658
|
+
onOpenChange: (c) => {
|
|
659
|
+
c || n();
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
662
|
}), {
|
|
@@ -830,7 +830,7 @@ function Qo(t) {
|
|
|
830
830
|
}
|
|
831
831
|
) });
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function tc(t) {
|
|
834
834
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i(
|
|
835
835
|
"path",
|
|
836
836
|
{
|
|
@@ -839,25 +839,25 @@ function ta(t) {
|
|
|
839
839
|
}
|
|
840
840
|
) });
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function ec() {
|
|
843
843
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4" }) });
|
|
844
844
|
}
|
|
845
|
-
function
|
|
845
|
+
function rc() {
|
|
846
846
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4" }) });
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function ic() {
|
|
849
849
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z" }) });
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function nc() {
|
|
852
852
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { fill: "currentColor", d: "M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905" }) });
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function oc() {
|
|
855
855
|
return /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 32 32", children: [
|
|
856
856
|
/* @__PURE__ */ i("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" }),
|
|
857
857
|
/* @__PURE__ */ i("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" })
|
|
858
858
|
] });
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function cc() {
|
|
861
861
|
return /* @__PURE__ */ g(
|
|
862
862
|
"svg",
|
|
863
863
|
{
|
|
@@ -885,16 +885,16 @@ function aa() {
|
|
|
885
885
|
}
|
|
886
886
|
);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function ac() {
|
|
889
889
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ g("g", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", color: "currentColor", children: [
|
|
890
890
|
/* @__PURE__ */ i("path", { d: "M14.86 22h-4.312c-3.291 0-4.937 0-6.08-.798a4.2 4.2 0 0 1-.863-.805c-.855-1.066-.855-2.6-.855-5.67v-2.545c0-2.963 0-4.445.473-5.628c.761-1.903 2.37-3.403 4.41-4.113C8.9 2 10.49 2 13.667 2c1.816 0 2.723 0 3.448.252c1.166.406 2.085 1.263 2.52 2.35c.27.676.27 1.523.27 3.216V10" }),
|
|
891
891
|
/* @__PURE__ */ i("path", { d: "M2.75 12c0-1.84 1.506-3.333 3.364-3.333c.672 0 1.464.116 2.117-.057a1.67 1.67 0 0 0 1.19-1.179c.174-.647.057-1.432.057-2.098C9.478 3.493 10.984 2 12.84 2m.002 16h2.523m-4.949-4.15c-.126-.8-.281-.801-1.61-.85h-1.01c-.557 0-1.009.448-1.009 1v3c0 .552.452 1 1.01 1h1.816c.39 0 .803-.313.803-.7v-1.1c0-.11-.113-.304-.224-.304H9.068M12.842 13h1.261m0 0h1.262m-1.262 0v4.875M21.251 13h-2.523c-.557 0-1.009.448-1.009 1v1.5m0 0V18m0-2.5h2.523" })
|
|
892
892
|
] }) });
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function sc() {
|
|
895
895
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 20 20", children: /* @__PURE__ */ i("path", { fill: "currentColor", d: "M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z" }) });
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function lc() {
|
|
898
898
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 48 48", children: /* @__PURE__ */ g("g", { fill: "none", stroke: "currentColor", strokeWidth: "4", children: [
|
|
899
899
|
/* @__PURE__ */ i("circle", { cx: "10", cy: "24", r: "4" }),
|
|
900
900
|
/* @__PURE__ */ i("circle", { cx: "38", cy: "10", r: "4" }),
|
|
@@ -903,13 +903,13 @@ function la() {
|
|
|
903
903
|
/* @__PURE__ */ i("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M34 38H22V10h12M14 24h20" })
|
|
904
904
|
] }) });
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function dc() {
|
|
907
907
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 20 20", children: /* @__PURE__ */ i("path", { fill: "currentColor", d: "M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z" }) });
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function hc() {
|
|
910
910
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548", color: "currentColor" }) });
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function uc() {
|
|
913
913
|
return /* @__PURE__ */ i(
|
|
914
914
|
"svg",
|
|
915
915
|
{
|
|
@@ -945,8 +945,8 @@ const Kr = {
|
|
|
945
945
|
Undo2: Yn,
|
|
946
946
|
AlignCenter: lo,
|
|
947
947
|
AlignJustify: so,
|
|
948
|
-
AlignLeft:
|
|
949
|
-
AlignRight:
|
|
948
|
+
AlignLeft: ao,
|
|
949
|
+
AlignRight: co,
|
|
950
950
|
ChevronDown: Xn,
|
|
951
951
|
Subscript: jn,
|
|
952
952
|
Superscript: qn,
|
|
@@ -997,42 +997,42 @@ const Kr = {
|
|
|
997
997
|
Columns: Je,
|
|
998
998
|
Iframe: sn,
|
|
999
999
|
MenuDown: Zo,
|
|
1000
|
-
SizeS:
|
|
1000
|
+
SizeS: tc,
|
|
1001
1001
|
SizeM: Qo,
|
|
1002
1002
|
SizeL: Jo,
|
|
1003
1003
|
AspectRatio: Go,
|
|
1004
|
-
Emoji:
|
|
1004
|
+
Emoji: an,
|
|
1005
1005
|
DeleteColumn: jo,
|
|
1006
1006
|
DeleteRow: Xo,
|
|
1007
1007
|
SearchAndReplace: Ze,
|
|
1008
|
-
EmojiIcon:
|
|
1008
|
+
EmojiIcon: cn,
|
|
1009
1009
|
KatexIcon: on,
|
|
1010
|
-
ExportPdf:
|
|
1011
|
-
ExportWord:
|
|
1012
|
-
ImportWord:
|
|
1013
|
-
ColumnAddLeft:
|
|
1014
|
-
ColumnAddRight:
|
|
1010
|
+
ExportPdf: oc,
|
|
1011
|
+
ExportWord: cc,
|
|
1012
|
+
ImportWord: uc,
|
|
1013
|
+
ColumnAddLeft: ec,
|
|
1014
|
+
ColumnAddRight: rc,
|
|
1015
1015
|
BookMarked: nn,
|
|
1016
|
-
Excalidraw:
|
|
1016
|
+
Excalidraw: nc,
|
|
1017
1017
|
ZoomIn: rn,
|
|
1018
1018
|
ZoomOut: en,
|
|
1019
1019
|
Settings: tn,
|
|
1020
1020
|
Eye: Qi,
|
|
1021
|
-
TextDirection:
|
|
1022
|
-
LeftToRight:
|
|
1023
|
-
RightToLeft:
|
|
1021
|
+
TextDirection: ic,
|
|
1022
|
+
LeftToRight: sc,
|
|
1023
|
+
RightToLeft: dc,
|
|
1024
1024
|
Attachment: Ji,
|
|
1025
|
-
GifIcon:
|
|
1025
|
+
GifIcon: ac,
|
|
1026
1026
|
ChevronUp: Zi,
|
|
1027
1027
|
Crop: Ki,
|
|
1028
|
-
Mermaid:
|
|
1029
|
-
Twitter:
|
|
1028
|
+
Mermaid: lc,
|
|
1029
|
+
Twitter: hc,
|
|
1030
1030
|
FlipX: Yi,
|
|
1031
1031
|
FlipY: Xi,
|
|
1032
1032
|
PencilRuler: ji,
|
|
1033
1033
|
WrapText: qi
|
|
1034
1034
|
};
|
|
1035
|
-
function
|
|
1035
|
+
function mc({ fill: t }) {
|
|
1036
1036
|
return /* @__PURE__ */ i(
|
|
1037
1037
|
"svg",
|
|
1038
1038
|
{
|
|
@@ -1084,19 +1084,19 @@ function ma({ fill: t }) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
);
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function xc(t) {
|
|
1088
1088
|
const [e, r] = S(void 0);
|
|
1089
|
-
function n(
|
|
1089
|
+
function n(a) {
|
|
1090
1090
|
var l;
|
|
1091
|
-
(l = t.action) == null || l.call(t,
|
|
1091
|
+
(l = t.action) == null || l.call(t, a);
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1094
|
-
var
|
|
1095
|
-
(
|
|
1093
|
+
function c() {
|
|
1094
|
+
var a;
|
|
1095
|
+
(a = t.action) == null || a.call(t, e);
|
|
1096
1096
|
}
|
|
1097
1097
|
const o = H(
|
|
1098
|
-
Oe((
|
|
1099
|
-
r(
|
|
1098
|
+
Oe((a) => {
|
|
1099
|
+
r(a);
|
|
1100
1100
|
}, 350),
|
|
1101
1101
|
[]
|
|
1102
1102
|
);
|
|
@@ -1106,10 +1106,10 @@ function xa(t) {
|
|
|
1106
1106
|
{
|
|
1107
1107
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
1108
1108
|
disabled: t == null ? void 0 : t.disabled,
|
|
1109
|
-
action:
|
|
1109
|
+
action: c,
|
|
1110
1110
|
tooltipOptions: t == null ? void 0 : t.tooltipOptions,
|
|
1111
1111
|
shortcutKeys: t == null ? void 0 : t.shortcutKeys,
|
|
1112
|
-
children: /* @__PURE__ */ i("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ i(
|
|
1112
|
+
children: /* @__PURE__ */ i("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ i(mc, { fill: e }) })
|
|
1113
1113
|
}
|
|
1114
1114
|
),
|
|
1115
1115
|
/* @__PURE__ */ i(
|
|
@@ -1125,11 +1125,11 @@ function xa(t) {
|
|
|
1125
1125
|
)
|
|
1126
1126
|
] });
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function fc(t) {
|
|
1129
1129
|
const { t: e } = q(), [r, n] = S({
|
|
1130
1130
|
text: "",
|
|
1131
1131
|
link: ""
|
|
1132
|
-
}), [
|
|
1132
|
+
}), [c, o] = S(!1);
|
|
1133
1133
|
B(() => {
|
|
1134
1134
|
var l;
|
|
1135
1135
|
if (t != null && t.editor) {
|
|
@@ -1140,16 +1140,16 @@ function fa(t) {
|
|
|
1140
1140
|
}), o(h === "_blank");
|
|
1141
1141
|
}
|
|
1142
1142
|
}, [t == null ? void 0 : t.editor]);
|
|
1143
|
-
function
|
|
1144
|
-
l.preventDefault(), l.stopPropagation(), t == null || t.onSetLink(r.link, r.text,
|
|
1143
|
+
function a(l) {
|
|
1144
|
+
l.preventDefault(), l.stopPropagation(), t == null || t.onSetLink(r.link, r.text, c);
|
|
1145
1145
|
}
|
|
1146
1146
|
return /* @__PURE__ */ i("div", { className: "border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ g(
|
|
1147
1147
|
"form",
|
|
1148
1148
|
{
|
|
1149
1149
|
className: "richtext-flex richtext-flex-col richtext-gap-2",
|
|
1150
|
-
onSubmit:
|
|
1150
|
+
onSubmit: a,
|
|
1151
1151
|
children: [
|
|
1152
|
-
/* @__PURE__ */ i(
|
|
1152
|
+
/* @__PURE__ */ i(at, { className: "mb-[6px]", children: e("editor.link.dialog.text") }),
|
|
1153
1153
|
/* @__PURE__ */ i("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ i(
|
|
1154
1154
|
Q,
|
|
1155
1155
|
{
|
|
@@ -1161,7 +1161,7 @@ function fa(t) {
|
|
|
1161
1161
|
value: r.text
|
|
1162
1162
|
}
|
|
1163
1163
|
) }) }),
|
|
1164
|
-
/* @__PURE__ */ i(
|
|
1164
|
+
/* @__PURE__ */ i(at, { className: "mb-[6px]", children: e("editor.link.dialog.link") }),
|
|
1165
1165
|
/* @__PURE__ */ i("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ g("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: [
|
|
1166
1166
|
/* @__PURE__ */ i(
|
|
1167
1167
|
Q,
|
|
@@ -1182,11 +1182,11 @@ function fa(t) {
|
|
|
1182
1182
|
) })
|
|
1183
1183
|
] }) }),
|
|
1184
1184
|
/* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-space-x-2", children: [
|
|
1185
|
-
/* @__PURE__ */ i(
|
|
1185
|
+
/* @__PURE__ */ i(at, { children: e("editor.link.dialog.openInNewTab") }),
|
|
1186
1186
|
/* @__PURE__ */ i(
|
|
1187
1187
|
Br,
|
|
1188
1188
|
{
|
|
1189
|
-
checked:
|
|
1189
|
+
checked: c,
|
|
1190
1190
|
onCheckedChange: (l) => {
|
|
1191
1191
|
o(l);
|
|
1192
1192
|
}
|
|
@@ -1205,10 +1205,10 @@ function fa(t) {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
) });
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function gc(t, e, r = null) {
|
|
1209
1209
|
return r ? t.createChecked({ index: e }, r) : t.createAndFill({ index: e });
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function pc(t) {
|
|
1212
1212
|
if (t.cached.columnsNodeTypes)
|
|
1213
1213
|
return t.cached.columnsNodeTypes;
|
|
1214
1214
|
const e = {
|
|
@@ -1217,27 +1217,27 @@ function pa(t) {
|
|
|
1217
1217
|
};
|
|
1218
1218
|
return t.cached.columnsNodeTypes = e, e;
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1221
|
-
const n =
|
|
1220
|
+
function wc(t, e, r = null) {
|
|
1221
|
+
const n = pc(t), c = [];
|
|
1222
1222
|
for (let o = 0; o < e; o += 1) {
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1223
|
+
const a = gc(n.column, o, r);
|
|
1224
|
+
a && c.push(a);
|
|
1225
1225
|
}
|
|
1226
|
-
return n.columns.createChecked({ cols: e },
|
|
1226
|
+
return n.columns.createChecked({ cols: e }, c);
|
|
1227
1227
|
}
|
|
1228
1228
|
function be({
|
|
1229
1229
|
state: t,
|
|
1230
1230
|
dispatch: e,
|
|
1231
1231
|
type: r
|
|
1232
1232
|
}) {
|
|
1233
|
-
const n = re((o) => o.type.name === le.name)(t.selection),
|
|
1234
|
-
if (e && n &&
|
|
1235
|
-
const o = n.node,
|
|
1236
|
-
let s =
|
|
1237
|
-
r === "delete" ? (s =
|
|
1233
|
+
const n = re((o) => o.type.name === le.name)(t.selection), c = re((o) => o.type.name === Zr.name)(t.selection);
|
|
1234
|
+
if (e && n && c) {
|
|
1235
|
+
const o = n.node, a = c.node.attrs.index, l = o.toJSON();
|
|
1236
|
+
let s = a;
|
|
1237
|
+
r === "delete" ? (s = a - 1, l.content.splice(a, 1)) : (s = r === "addBefore" ? a : a + 1, l.content.splice(s, 0, {
|
|
1238
1238
|
type: "column",
|
|
1239
1239
|
attrs: {
|
|
1240
|
-
index:
|
|
1240
|
+
index: a
|
|
1241
1241
|
},
|
|
1242
1242
|
content: [
|
|
1243
1243
|
{
|
|
@@ -1260,11 +1260,11 @@ function be({
|
|
|
1260
1260
|
return !0;
|
|
1261
1261
|
}
|
|
1262
1262
|
function rr({ state: t, dispatch: e, type: r }) {
|
|
1263
|
-
const n = re((o) => o.type.name === le.name)(t.selection),
|
|
1264
|
-
if (e && n &&
|
|
1265
|
-
const o = n.node,
|
|
1263
|
+
const n = re((o) => o.type.name === le.name)(t.selection), c = re((o) => o.type.name === Zr.name)(t.selection);
|
|
1264
|
+
if (e && n && c) {
|
|
1265
|
+
const o = n.node, a = c.node.attrs.index;
|
|
1266
1266
|
let l = 0;
|
|
1267
|
-
r === "before" ? l = (
|
|
1267
|
+
r === "before" ? l = (a - 1 + o.attrs.cols) % o.attrs.cols : l = (a + 1) % o.attrs.cols;
|
|
1268
1268
|
let s = n.pos;
|
|
1269
1269
|
o.content.forEach((d, u, m) => {
|
|
1270
1270
|
m < l && (s += d.nodeSize);
|
|
@@ -1274,14 +1274,14 @@ function rr({ state: t, dispatch: e, type: r }) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
return !1;
|
|
1276
1276
|
}
|
|
1277
|
-
const
|
|
1277
|
+
const vc = 200, le = yt.create({
|
|
1278
1278
|
name: "columns",
|
|
1279
1279
|
group: "block",
|
|
1280
1280
|
defining: !0,
|
|
1281
1281
|
isolating: !0,
|
|
1282
1282
|
allowGapCursor: !1,
|
|
1283
1283
|
content: "column{1,}",
|
|
1284
|
-
priority:
|
|
1284
|
+
priority: vc,
|
|
1285
1285
|
addOptions() {
|
|
1286
1286
|
return {
|
|
1287
1287
|
HTMLAttributes: {
|
|
@@ -1310,10 +1310,10 @@ const va = 200, le = yt.create({
|
|
|
1310
1310
|
addCommands() {
|
|
1311
1311
|
return {
|
|
1312
1312
|
insertColumns: (t) => ({ tr: e, dispatch: r, editor: n }) => {
|
|
1313
|
-
const
|
|
1313
|
+
const c = wc(n.schema, t && t.cols || 3);
|
|
1314
1314
|
if (r) {
|
|
1315
1315
|
const o = e.selection.anchor + 1;
|
|
1316
|
-
e.replaceSelectionWith(
|
|
1316
|
+
e.replaceSelectionWith(c).scrollIntoView().setSelection(Wt.near(e.doc.resolve(o)));
|
|
1317
1317
|
}
|
|
1318
1318
|
return !0;
|
|
1319
1319
|
},
|
|
@@ -1368,15 +1368,15 @@ const va = 200, le = yt.create({
|
|
|
1368
1368
|
}
|
|
1369
1369
|
});
|
|
1370
1370
|
var Me = /* @__PURE__ */ ((t) => (t[t.max = 7] = "max", t[t.min = 0] = "min", t[t.more = 1] = "more", t[t.less = -1] = "less", t))(Me || {});
|
|
1371
|
-
function
|
|
1371
|
+
function bc(t, e, r) {
|
|
1372
1372
|
return t < e ? e : t > r ? r : t;
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1375
|
-
const { doc:
|
|
1376
|
-
if (!
|
|
1374
|
+
function yc(t, e, r, n) {
|
|
1375
|
+
const { doc: c, selection: o } = t;
|
|
1376
|
+
if (!c || !o || !(o instanceof Wt || o instanceof Ri))
|
|
1377
1377
|
return t;
|
|
1378
|
-
const { from:
|
|
1379
|
-
return
|
|
1378
|
+
const { from: a, to: l } = o;
|
|
1379
|
+
return c.nodesBetween(a, l, (s, h) => {
|
|
1380
1380
|
const d = s.type;
|
|
1381
1381
|
return r.includes(d.name) ? (t = Ae(t, h, e), !1) : !Ci(s.type.name, n.extensionManager.extensions);
|
|
1382
1382
|
}), t;
|
|
@@ -1387,27 +1387,27 @@ function Ae(t, e, r) {
|
|
|
1387
1387
|
const n = t.doc.nodeAt(e);
|
|
1388
1388
|
if (!n)
|
|
1389
1389
|
return t;
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1390
|
+
const a = bc((n.attrs.indent || 0) + r, 0, 7);
|
|
1391
|
+
if (a === n.attrs.indent)
|
|
1392
1392
|
return t;
|
|
1393
1393
|
const l = {
|
|
1394
1394
|
...n.attrs,
|
|
1395
|
-
indent:
|
|
1395
|
+
indent: a
|
|
1396
1396
|
};
|
|
1397
1397
|
return t.setNodeMarkup(e, n.type, l, n.marks);
|
|
1398
1398
|
}
|
|
1399
1399
|
function Ml({ delta: t, types: e }) {
|
|
1400
|
-
return ({ state: r, dispatch: n, editor:
|
|
1400
|
+
return ({ state: r, dispatch: n, editor: c }) => {
|
|
1401
1401
|
const { selection: o } = r;
|
|
1402
|
-
let { tr:
|
|
1403
|
-
return
|
|
1402
|
+
let { tr: a } = r;
|
|
1403
|
+
return a = a.setSelection(o), a = yc(a, t, e, c), a.docChanged ? (n && n(a), !0) : !1;
|
|
1404
1404
|
};
|
|
1405
1405
|
}
|
|
1406
|
-
const
|
|
1406
|
+
const Cc = {
|
|
1407
1407
|
setOpen: (t, e) => {
|
|
1408
1408
|
Be(bt.UPLOAD_IMAGE(t), e);
|
|
1409
1409
|
}
|
|
1410
|
-
}, ut = it.Root, mt = it.Trigger,
|
|
1410
|
+
}, ut = it.Root, mt = it.Trigger, Tc = it.Portal, Jr = W.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
1411
1411
|
it.Overlay,
|
|
1412
1412
|
{
|
|
1413
1413
|
ref: r,
|
|
@@ -1419,7 +1419,7 @@ const Ca = {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
));
|
|
1421
1421
|
Jr.displayName = it.Overlay.displayName;
|
|
1422
|
-
const lt = W.forwardRef(({ className: t, children: e, ...r }, n) => /* @__PURE__ */ g(
|
|
1422
|
+
const lt = W.forwardRef(({ className: t, children: e, ...r }, n) => /* @__PURE__ */ g(Tc, { children: [
|
|
1423
1423
|
/* @__PURE__ */ i(Jr, {}),
|
|
1424
1424
|
/* @__PURE__ */ g(
|
|
1425
1425
|
it.Content,
|
|
@@ -1485,7 +1485,7 @@ const dt = W.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
|
1485
1485
|
}
|
|
1486
1486
|
));
|
|
1487
1487
|
dt.displayName = it.Title.displayName;
|
|
1488
|
-
const
|
|
1488
|
+
const Nc = W.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
1489
1489
|
it.Description,
|
|
1490
1490
|
{
|
|
1491
1491
|
ref: r,
|
|
@@ -1493,7 +1493,7 @@ const Na = W.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
|
1493
1493
|
...e
|
|
1494
1494
|
}
|
|
1495
1495
|
));
|
|
1496
|
-
|
|
1496
|
+
Nc.displayName = it.Description.displayName;
|
|
1497
1497
|
function Al(t) {
|
|
1498
1498
|
return t.replace(/^.*\/|\..+$/g, "");
|
|
1499
1499
|
}
|
|
@@ -1506,7 +1506,7 @@ function Il(t) {
|
|
|
1506
1506
|
function El(t) {
|
|
1507
1507
|
return t ? t === "application/pdf" ? "pdf" : t.startsWith("application/") && [".document", "word"].some((e) => t.includes(e)) ? "word" : t.startsWith("application/") && ["presentation"].some((e) => t.includes(e)) ? "excel" : t.startsWith("application/") && ["sheet"].some((e) => t.includes(e)) ? "ppt" : t.startsWith("image") ? "image" : t.startsWith("audio") ? "audio" : t.startsWith("video") ? "video" : "file" : "file";
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function kc(t) {
|
|
1510
1510
|
return new Promise((e) => {
|
|
1511
1511
|
const r = new FileReader();
|
|
1512
1512
|
r.addEventListener(
|
|
@@ -1522,21 +1522,21 @@ function ka(t) {
|
|
|
1522
1522
|
});
|
|
1523
1523
|
}
|
|
1524
1524
|
function qt(t, e) {
|
|
1525
|
-
const r = t.split(","), n = r[0].match(/:(.*?);/)[1],
|
|
1526
|
-
let o =
|
|
1527
|
-
const
|
|
1525
|
+
const r = t.split(","), n = r[0].match(/:(.*?);/)[1], c = atob(r[r.length - 1]);
|
|
1526
|
+
let o = c.length;
|
|
1527
|
+
const a = new Uint8Array(o);
|
|
1528
1528
|
for (; o--; )
|
|
1529
|
-
|
|
1530
|
-
return new File([
|
|
1529
|
+
a[o] = c.charCodeAt(o);
|
|
1530
|
+
return new File([a], e, { type: n });
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1533
|
-
const { t: n } = q(), [
|
|
1532
|
+
function Sc({ editor: t, imageInline: e, onClose: r }) {
|
|
1533
|
+
const { t: n } = q(), [c, o] = S(!1), a = Ht.useRef(null), [l, s] = Ht.useState(), [h, d] = Ht.useState(""), u = J(null), [m, x] = S({
|
|
1534
1534
|
src: "",
|
|
1535
1535
|
file: null
|
|
1536
1536
|
});
|
|
1537
1537
|
function w(v) {
|
|
1538
|
-
if (
|
|
1539
|
-
const y = p(
|
|
1538
|
+
if (a.current && v.width && v.height) {
|
|
1539
|
+
const y = p(a.current, v);
|
|
1540
1540
|
d(y);
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
@@ -1580,7 +1580,7 @@ function Sa({ editor: t, imageInline: e, onClose: r }) {
|
|
|
1580
1580
|
const y = (L = v == null ? void 0 : v.target) == null ? void 0 : L.files;
|
|
1581
1581
|
if (!t || t.isDestroyed || y.length === 0)
|
|
1582
1582
|
return;
|
|
1583
|
-
const C = y[0], M = await
|
|
1583
|
+
const C = y[0], M = await kc(C);
|
|
1584
1584
|
o(!0), x({
|
|
1585
1585
|
src: M.src,
|
|
1586
1586
|
file: C
|
|
@@ -1596,7 +1596,7 @@ function Sa({ editor: t, imageInline: e, onClose: r }) {
|
|
|
1596
1596
|
children: n("editor.image.dialog.tab.uploadCrop")
|
|
1597
1597
|
}
|
|
1598
1598
|
),
|
|
1599
|
-
/* @__PURE__ */ g(ut, { open:
|
|
1599
|
+
/* @__PURE__ */ g(ut, { open: c, children: [
|
|
1600
1600
|
/* @__PURE__ */ i(mt, {}),
|
|
1601
1601
|
/* @__PURE__ */ g(lt, { children: [
|
|
1602
1602
|
/* @__PURE__ */ i(dt, { children: n("editor.image.dialog.tab.uploadCrop") }),
|
|
@@ -1611,7 +1611,7 @@ function Sa({ editor: t, imageInline: e, onClose: r }) {
|
|
|
1611
1611
|
"img",
|
|
1612
1612
|
{
|
|
1613
1613
|
alt: "Crop me",
|
|
1614
|
-
ref:
|
|
1614
|
+
ref: a,
|
|
1615
1615
|
src: m.src
|
|
1616
1616
|
}
|
|
1617
1617
|
)
|
|
@@ -1674,11 +1674,11 @@ function Sa({ editor: t, imageInline: e, onClose: r }) {
|
|
|
1674
1674
|
)
|
|
1675
1675
|
] });
|
|
1676
1676
|
}
|
|
1677
|
-
function
|
|
1677
|
+
function Mc(t) {
|
|
1678
1678
|
var w;
|
|
1679
|
-
const { t: e } = q(), [r, n] = S(!1),
|
|
1679
|
+
const { t: e } = q(), [r, n] = S(!1), c = (p) => {
|
|
1680
1680
|
n(p.detail);
|
|
1681
|
-
}, [o,
|
|
1681
|
+
}, [o, a] = S(""), l = J(null), [s, h] = S(((w = t.editor.extensionManager.extensions.find(
|
|
1682
1682
|
(p) => p.name === Vt.name
|
|
1683
1683
|
)) == null ? void 0 : w.options.defaultInline) || !1), d = U(() => {
|
|
1684
1684
|
var f;
|
|
@@ -1687,7 +1687,7 @@ function Ma(t) {
|
|
|
1687
1687
|
)) == null ? void 0 : f.options;
|
|
1688
1688
|
}, [t.editor]);
|
|
1689
1689
|
B(() => {
|
|
1690
|
-
const p = se(bt.UPLOAD_IMAGE(t.editor.id),
|
|
1690
|
+
const p = se(bt.UPLOAD_IMAGE(t.editor.id), c);
|
|
1691
1691
|
return () => {
|
|
1692
1692
|
p();
|
|
1693
1693
|
};
|
|
@@ -1702,7 +1702,7 @@ function Ma(t) {
|
|
|
1702
1702
|
d.upload ? T = await d.upload(I) : T = URL.createObjectURL(I), t.editor.chain().focus().setImageInline({ src: T, inline: s }).run(), n(!1), h(!1);
|
|
1703
1703
|
}
|
|
1704
1704
|
function m(p) {
|
|
1705
|
-
p.preventDefault(), p.stopPropagation(), t.editor.chain().focus().setImageInline({ src: o, inline: s }).run(), n(!1), h(!1),
|
|
1705
|
+
p.preventDefault(), p.stopPropagation(), t.editor.chain().focus().setImageInline({ src: o, inline: s }).run(), n(!1), h(!1), a("");
|
|
1706
1706
|
}
|
|
1707
1707
|
function x(p) {
|
|
1708
1708
|
var f;
|
|
@@ -1744,7 +1744,7 @@ function Ma(t) {
|
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
1746
|
),
|
|
1747
|
-
/* @__PURE__ */ i(
|
|
1747
|
+
/* @__PURE__ */ i(at, { children: e("editor.link.dialog.inline") })
|
|
1748
1748
|
] }),
|
|
1749
1749
|
/* @__PURE__ */ g($t, { value: "upload", children: [
|
|
1750
1750
|
/* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
@@ -1758,11 +1758,11 @@ function Ma(t) {
|
|
|
1758
1758
|
}
|
|
1759
1759
|
),
|
|
1760
1760
|
/* @__PURE__ */ i(
|
|
1761
|
-
|
|
1761
|
+
Sc,
|
|
1762
1762
|
{
|
|
1763
1763
|
editor: t.editor,
|
|
1764
1764
|
imageInline: s,
|
|
1765
|
-
onClose: () =>
|
|
1765
|
+
onClose: () => Cc.setOpen(t.editor.id, !1)
|
|
1766
1766
|
}
|
|
1767
1767
|
)
|
|
1768
1768
|
] }),
|
|
@@ -1785,7 +1785,7 @@ function Ma(t) {
|
|
|
1785
1785
|
Q,
|
|
1786
1786
|
{
|
|
1787
1787
|
autoFocus: !0,
|
|
1788
|
-
onChange: (p) =>
|
|
1788
|
+
onChange: (p) => a(p.target.value),
|
|
1789
1789
|
placeholder: e("editor.image.dialog.placeholder"),
|
|
1790
1790
|
required: !0,
|
|
1791
1791
|
type: "url",
|
|
@@ -1808,12 +1808,12 @@ const Yt = {
|
|
|
1808
1808
|
BOTTOM_LEFT: "bl",
|
|
1809
1809
|
BOTTOM_RIGHT: "br"
|
|
1810
1810
|
};
|
|
1811
|
-
function
|
|
1811
|
+
function Ac(t) {
|
|
1812
1812
|
var L, N;
|
|
1813
1813
|
const [e, r] = S({
|
|
1814
1814
|
width: xt,
|
|
1815
1815
|
height: xt
|
|
1816
|
-
}), [n,
|
|
1816
|
+
}), [n, c] = S({
|
|
1817
1817
|
width: 0,
|
|
1818
1818
|
height: 0
|
|
1819
1819
|
}), [o] = S([
|
|
@@ -1821,7 +1821,7 @@ function Aa(t) {
|
|
|
1821
1821
|
Yt.TOP_RIGHT,
|
|
1822
1822
|
Yt.BOTTOM_LEFT,
|
|
1823
1823
|
Yt.BOTTOM_RIGHT
|
|
1824
|
-
]), [
|
|
1824
|
+
]), [a, l] = S(!1), [s, h] = S({
|
|
1825
1825
|
x: 0,
|
|
1826
1826
|
y: 0,
|
|
1827
1827
|
w: 0,
|
|
@@ -1829,7 +1829,7 @@ function Aa(t) {
|
|
|
1829
1829
|
dir: ""
|
|
1830
1830
|
}), { align: d, inline: u } = (L = t == null ? void 0 : t.node) == null ? void 0 : L.attrs, m = U(() => {
|
|
1831
1831
|
var nt;
|
|
1832
|
-
const { src: E, alt: b, width: k, height: _, flipX: D, flipY: R } = (nt = t == null ? void 0 : t.node) == null ? void 0 : nt.attrs, A =
|
|
1832
|
+
const { src: E, alt: b, width: k, height: _, flipX: D, flipY: R } = (nt = t == null ? void 0 : t.node) == null ? void 0 : nt.attrs, A = ce(k) ? `${k}px` : k, $ = ce(_) ? `${_}px` : _, F = [];
|
|
1833
1833
|
D && F.push("rotateX(180deg)"), R && F.push("rotateY(180deg)");
|
|
1834
1834
|
const Y = F.join(" ");
|
|
1835
1835
|
return {
|
|
@@ -1848,7 +1848,7 @@ function Aa(t) {
|
|
|
1848
1848
|
return { width: E === "100%" ? E : void 0 };
|
|
1849
1849
|
}, [m]);
|
|
1850
1850
|
function w(E) {
|
|
1851
|
-
|
|
1851
|
+
c({
|
|
1852
1852
|
width: E.target.width,
|
|
1853
1853
|
height: E.target.height
|
|
1854
1854
|
});
|
|
@@ -1882,7 +1882,7 @@ function Aa(t) {
|
|
|
1882
1882
|
}
|
|
1883
1883
|
const T = H(
|
|
1884
1884
|
ht((E) => {
|
|
1885
|
-
if (E.preventDefault(), E.stopPropagation(), !
|
|
1885
|
+
if (E.preventDefault(), E.stopPropagation(), !a)
|
|
1886
1886
|
return;
|
|
1887
1887
|
const { x: b, w: k, dir: _ } = s, D = (E.clientX - b) * (/l/.test(_) ? -1 : 1), R = yr(k + D, he, e.width);
|
|
1888
1888
|
t.updateAttributes({
|
|
@@ -1890,10 +1890,10 @@ function Aa(t) {
|
|
|
1890
1890
|
height: null
|
|
1891
1891
|
});
|
|
1892
1892
|
}, ft),
|
|
1893
|
-
[
|
|
1893
|
+
[a, s, e, t.updateAttributes]
|
|
1894
1894
|
), v = H(
|
|
1895
1895
|
(E) => {
|
|
1896
|
-
E.preventDefault(), E.stopPropagation(),
|
|
1896
|
+
E.preventDefault(), E.stopPropagation(), a && (h({
|
|
1897
1897
|
x: 0,
|
|
1898
1898
|
y: 0,
|
|
1899
1899
|
w: 0,
|
|
@@ -1901,15 +1901,15 @@ function Aa(t) {
|
|
|
1901
1901
|
dir: ""
|
|
1902
1902
|
}), l(!1), p());
|
|
1903
1903
|
},
|
|
1904
|
-
[
|
|
1904
|
+
[a, p]
|
|
1905
1905
|
), y = H(() => {
|
|
1906
1906
|
document == null || document.addEventListener("mousemove", T, !0), document == null || document.addEventListener("mouseup", v, !0);
|
|
1907
1907
|
}, [T, v]), C = H(() => {
|
|
1908
1908
|
document == null || document.removeEventListener("mousemove", T, !0), document == null || document.removeEventListener("mouseup", v, !0);
|
|
1909
1909
|
}, [T, v]);
|
|
1910
|
-
B(() => (
|
|
1910
|
+
B(() => (a ? y() : C(), () => {
|
|
1911
1911
|
C();
|
|
1912
|
-
}), [
|
|
1912
|
+
}), [a, y, C]);
|
|
1913
1913
|
const M = U(() => new ResizeObserver(() => f()), [f]);
|
|
1914
1914
|
return B(() => (M.observe(t.editor.view.dom), () => {
|
|
1915
1915
|
M.disconnect();
|
|
@@ -1925,7 +1925,7 @@ function Aa(t) {
|
|
|
1925
1925
|
"data-drag-handle": !0,
|
|
1926
1926
|
draggable: "true",
|
|
1927
1927
|
style: x,
|
|
1928
|
-
className: `image-view__body ${t != null && t.selected ? "image-view__body--focused" : ""} ${
|
|
1928
|
+
className: `image-view__body ${t != null && t.selected ? "image-view__body--focused" : ""} ${a ? "image-view__body--resizing" : ""}`,
|
|
1929
1929
|
children: [
|
|
1930
1930
|
/* @__PURE__ */ i(
|
|
1931
1931
|
"img",
|
|
@@ -1939,7 +1939,7 @@ function Aa(t) {
|
|
|
1939
1939
|
style: m.style
|
|
1940
1940
|
}
|
|
1941
1941
|
),
|
|
1942
|
-
(t == null ? void 0 : t.editor.view.editable) && ((t == null ? void 0 : t.selected) ||
|
|
1942
|
+
(t == null ? void 0 : t.editor.view.editable) && ((t == null ? void 0 : t.selected) || a) && /* @__PURE__ */ i("div", { className: "image-resizer", children: o == null ? void 0 : o.map((E) => /* @__PURE__ */ i(
|
|
1943
1943
|
"span",
|
|
1944
1944
|
{
|
|
1945
1945
|
className: `image-resizer__handler image-resizer__handler--${E}`,
|
|
@@ -1954,7 +1954,7 @@ function Aa(t) {
|
|
|
1954
1954
|
);
|
|
1955
1955
|
}
|
|
1956
1956
|
const At = new He("upload-image");
|
|
1957
|
-
function
|
|
1957
|
+
function Lc() {
|
|
1958
1958
|
return new De({
|
|
1959
1959
|
key: At,
|
|
1960
1960
|
state: {
|
|
@@ -1965,13 +1965,13 @@ function La() {
|
|
|
1965
1965
|
e = e.map(t.mapping, t.doc);
|
|
1966
1966
|
const r = t.getMeta(At);
|
|
1967
1967
|
if (r != null && r.add)
|
|
1968
|
-
for (const { id: n, pos:
|
|
1969
|
-
const
|
|
1968
|
+
for (const { id: n, pos: c, src: o } of r.add) {
|
|
1969
|
+
const a = Ic(o), l = Oi.widget(c, a, { id: n });
|
|
1970
1970
|
e = e.add(t.doc, [l]);
|
|
1971
1971
|
}
|
|
1972
1972
|
else if (r != null && r.remove)
|
|
1973
1973
|
for (const n of r.remove)
|
|
1974
|
-
e = e.remove(e.find(void 0, void 0, (
|
|
1974
|
+
e = e.remove(e.find(void 0, void 0, (c) => c.id === n));
|
|
1975
1975
|
return e;
|
|
1976
1976
|
}
|
|
1977
1977
|
},
|
|
@@ -1982,33 +1982,33 @@ function La() {
|
|
|
1982
1982
|
}
|
|
1983
1983
|
});
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1985
|
+
function Ic(t) {
|
|
1986
1986
|
const e = document.createElement("div"), r = document.createElement("img");
|
|
1987
1987
|
return r.setAttribute("class", "opacity-50"), r.src = t, r.addEventListener("load", () => {
|
|
1988
1988
|
e.setAttribute("class", "img-placeholder");
|
|
1989
1989
|
}), e.append(r), e;
|
|
1990
1990
|
}
|
|
1991
|
-
function
|
|
1992
|
-
var
|
|
1991
|
+
function Ec(t, e) {
|
|
1992
|
+
var c;
|
|
1993
1993
|
const n = At.getState(t).find(void 0, void 0, (o) => o.id === e);
|
|
1994
|
-
return n.length > 0 ? (
|
|
1994
|
+
return n.length > 0 ? (c = n[0]) == null ? void 0 : c.from : null;
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1997
|
-
return (
|
|
1998
|
-
for (const l of
|
|
1996
|
+
function zc({ validateFn: t, onUpload: e, postUpload: r, defaultInline: n = !1 }) {
|
|
1997
|
+
return (c, o, a) => {
|
|
1998
|
+
for (const l of c) {
|
|
1999
1999
|
if (t && !t(l))
|
|
2000
2000
|
continue;
|
|
2001
2001
|
const s = Date.now().toString(), h = o.state.tr;
|
|
2002
2002
|
h.selection.empty || h.deleteSelection();
|
|
2003
2003
|
const d = URL.createObjectURL(l);
|
|
2004
2004
|
h.setMeta(At, {
|
|
2005
|
-
add: [{ id: s, pos:
|
|
2005
|
+
add: [{ id: s, pos: a, src: d }]
|
|
2006
2006
|
}), o.dispatch(h), e(l).then(
|
|
2007
2007
|
async (u) => {
|
|
2008
2008
|
var T;
|
|
2009
2009
|
r && typeof u == "string" && (u = await r(u));
|
|
2010
2010
|
const { schema: m } = o.state;
|
|
2011
|
-
let x =
|
|
2011
|
+
let x = Ec(o.state, s);
|
|
2012
2012
|
if (x === null)
|
|
2013
2013
|
return;
|
|
2014
2014
|
const w = typeof u == "object" ? d : u, p = (T = m.nodes.image) == null ? void 0 : T.create({
|
|
@@ -2023,16 +2023,16 @@ function za({ validateFn: t, onUpload: e, postUpload: r, defaultInline: n = !1 }
|
|
|
2023
2023
|
o.dispatch(I);
|
|
2024
2024
|
},
|
|
2025
2025
|
() => {
|
|
2026
|
-
const u = o.state.tr.delete(
|
|
2026
|
+
const u = o.state.tr.delete(a, a).setMeta(At, { remove: [s] });
|
|
2027
2027
|
o.dispatch(u);
|
|
2028
2028
|
}
|
|
2029
2029
|
);
|
|
2030
2030
|
}
|
|
2031
2031
|
};
|
|
2032
2032
|
}
|
|
2033
|
-
function
|
|
2034
|
-
var
|
|
2035
|
-
const n = [...((
|
|
2033
|
+
function Pc(t, e, r) {
|
|
2034
|
+
var c;
|
|
2035
|
+
const n = [...((c = e.clipboardData) == null ? void 0 : c.files) || []];
|
|
2036
2036
|
if (n.length > 0) {
|
|
2037
2037
|
e.preventDefault();
|
|
2038
2038
|
const o = t.state.selection.from;
|
|
@@ -2040,21 +2040,21 @@ function Pa(t, e, r) {
|
|
|
2040
2040
|
}
|
|
2041
2041
|
return !1;
|
|
2042
2042
|
}
|
|
2043
|
-
function
|
|
2043
|
+
function Rc(t, e, r, n) {
|
|
2044
2044
|
var o;
|
|
2045
|
-
const
|
|
2046
|
-
if (!r &&
|
|
2045
|
+
const c = [...((o = e.dataTransfer) == null ? void 0 : o.files) || []];
|
|
2046
|
+
if (!r && c.length > 0) {
|
|
2047
2047
|
e.preventDefault();
|
|
2048
|
-
const
|
|
2048
|
+
const a = t.posAtCoords({
|
|
2049
2049
|
left: e.clientX,
|
|
2050
2050
|
top: e.clientY
|
|
2051
2051
|
});
|
|
2052
|
-
if (
|
|
2053
|
-
return n(
|
|
2052
|
+
if (a)
|
|
2053
|
+
return n(c, t, a.pos + 1), !0;
|
|
2054
2054
|
}
|
|
2055
2055
|
return !1;
|
|
2056
2056
|
}
|
|
2057
|
-
const
|
|
2057
|
+
const Oc = {
|
|
2058
2058
|
acceptMimes: ["image/jpeg", "image/gif", "image/png", "image/jpg"],
|
|
2059
2059
|
maxSize: 1024 * 1024 * 5,
|
|
2060
2060
|
// 5MB
|
|
@@ -2069,7 +2069,7 @@ const Oa = {
|
|
|
2069
2069
|
addOptions() {
|
|
2070
2070
|
var t;
|
|
2071
2071
|
return {
|
|
2072
|
-
...
|
|
2072
|
+
...Oc,
|
|
2073
2073
|
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
2074
2074
|
upload: () => Promise.reject("Image Upload Function"),
|
|
2075
2075
|
button: ({
|
|
@@ -2077,14 +2077,14 @@ const Oa = {
|
|
|
2077
2077
|
extension: r,
|
|
2078
2078
|
t: n
|
|
2079
2079
|
}) => {
|
|
2080
|
-
var
|
|
2080
|
+
var c, o;
|
|
2081
2081
|
return {
|
|
2082
|
-
component:
|
|
2082
|
+
component: Mc,
|
|
2083
2083
|
componentProps: {
|
|
2084
2084
|
action: () => !0,
|
|
2085
2085
|
upload: r.options.upload,
|
|
2086
2086
|
/* If setImage is not available(when Image Component is not imported), the button is disabled */
|
|
2087
|
-
disabled: !((o = (
|
|
2087
|
+
disabled: !((o = (c = e.can()).setImage) != null && o.call(c, {})),
|
|
2088
2088
|
icon: "ImageUp",
|
|
2089
2089
|
tooltip: n("editor.image.tooltip"),
|
|
2090
2090
|
editor: e
|
|
@@ -2130,7 +2130,7 @@ const Oa = {
|
|
|
2130
2130
|
};
|
|
2131
2131
|
},
|
|
2132
2132
|
addNodeView() {
|
|
2133
|
-
return pt(
|
|
2133
|
+
return pt(Ac);
|
|
2134
2134
|
},
|
|
2135
2135
|
addCommands() {
|
|
2136
2136
|
var t;
|
|
@@ -2148,11 +2148,11 @@ const Oa = {
|
|
|
2148
2148
|
};
|
|
2149
2149
|
},
|
|
2150
2150
|
renderHTML({ HTMLAttributes: t }) {
|
|
2151
|
-
const { flipX: e, flipY: r, align: n, inline:
|
|
2151
|
+
const { flipX: e, flipY: r, align: n, inline: c } = t, o = e || r ? `transform: rotateX(${e ? "180" : "0"}deg) rotateY(${r ? "180" : "0"}deg);` : "", a = n ? `text-align: ${n};` : "";
|
|
2152
2152
|
return [
|
|
2153
|
-
|
|
2153
|
+
c ? "span" : "div",
|
|
2154
2154
|
{
|
|
2155
|
-
style:
|
|
2155
|
+
style: a,
|
|
2156
2156
|
class: "image"
|
|
2157
2157
|
},
|
|
2158
2158
|
[
|
|
@@ -2174,7 +2174,7 @@ const Oa = {
|
|
|
2174
2174
|
tag: "span.image img",
|
|
2175
2175
|
getAttrs: (t) => {
|
|
2176
2176
|
var o;
|
|
2177
|
-
const e = t == null ? void 0 : t.parentElement, r = t == null ? void 0 : t.getAttribute("width"), n = (t == null ? void 0 : t.getAttribute("flipx")) || !1,
|
|
2177
|
+
const e = t == null ? void 0 : t.parentElement, r = t == null ? void 0 : t.getAttribute("width"), n = (t == null ? void 0 : t.getAttribute("flipx")) || !1, c = (t == null ? void 0 : t.getAttribute("flipy")) || !1;
|
|
2178
2178
|
return {
|
|
2179
2179
|
src: t == null ? void 0 : t.getAttribute("src"),
|
|
2180
2180
|
alt: t == null ? void 0 : t.getAttribute("alt"),
|
|
@@ -2183,14 +2183,14 @@ const Oa = {
|
|
|
2183
2183
|
align: (t == null ? void 0 : t.getAttribute("align")) || ((o = e == null ? void 0 : e.style) == null ? void 0 : o.textAlign) || null,
|
|
2184
2184
|
inline: (t == null ? void 0 : t.getAttribute("inline")) || !1,
|
|
2185
2185
|
flipX: n === "true",
|
|
2186
|
-
flipY:
|
|
2186
|
+
flipY: c === "true"
|
|
2187
2187
|
};
|
|
2188
2188
|
}
|
|
2189
2189
|
},
|
|
2190
2190
|
{
|
|
2191
2191
|
tag: "div[class=image]",
|
|
2192
2192
|
getAttrs: (t) => {
|
|
2193
|
-
const e = t.querySelector("img"), r = e == null ? void 0 : e.getAttribute("width"), n = (e == null ? void 0 : e.getAttribute("flipx")) || !1,
|
|
2193
|
+
const e = t.querySelector("img"), r = e == null ? void 0 : e.getAttribute("width"), n = (e == null ? void 0 : e.getAttribute("flipx")) || !1, c = (e == null ? void 0 : e.getAttribute("flipy")) || !1;
|
|
2194
2194
|
return {
|
|
2195
2195
|
src: e == null ? void 0 : e.getAttribute("src"),
|
|
2196
2196
|
alt: e == null ? void 0 : e.getAttribute("alt"),
|
|
@@ -2199,14 +2199,14 @@ const Oa = {
|
|
|
2199
2199
|
align: (e == null ? void 0 : e.getAttribute("align")) || t.style.textAlign || null,
|
|
2200
2200
|
inline: (e == null ? void 0 : e.getAttribute("inline")) || !1,
|
|
2201
2201
|
flipX: n === "true",
|
|
2202
|
-
flipY:
|
|
2202
|
+
flipY: c === "true"
|
|
2203
2203
|
};
|
|
2204
2204
|
}
|
|
2205
2205
|
}
|
|
2206
2206
|
];
|
|
2207
2207
|
},
|
|
2208
2208
|
addProseMirrorPlugins() {
|
|
2209
|
-
const e =
|
|
2209
|
+
const e = zc({
|
|
2210
2210
|
validateFn: (r) => !(!this.options.acceptMimes.includes(r.type) || r.size > this.options.maxSize),
|
|
2211
2211
|
onUpload: this.options.upload,
|
|
2212
2212
|
// postUpload: this.options.postUpload,
|
|
@@ -2215,19 +2215,19 @@ const Oa = {
|
|
|
2215
2215
|
return [
|
|
2216
2216
|
new De({
|
|
2217
2217
|
props: {
|
|
2218
|
-
handlePaste: (r, n) => !n.clipboardData || [...n.clipboardData.files || []].some((o) => o.type === "text/html") ? !1 :
|
|
2219
|
-
handleDrop: (r, n,
|
|
2218
|
+
handlePaste: (r, n) => !n.clipboardData || [...n.clipboardData.files || []].some((o) => o.type === "text/html") ? !1 : Pc(r, n, e),
|
|
2219
|
+
handleDrop: (r, n, c, o) => (!(n instanceof DragEvent) || !n.dataTransfer || Rc(r, n, o, e), !1)
|
|
2220
2220
|
}
|
|
2221
2221
|
}),
|
|
2222
|
-
|
|
2222
|
+
Lc()
|
|
2223
2223
|
];
|
|
2224
2224
|
}
|
|
2225
2225
|
});
|
|
2226
|
-
function
|
|
2226
|
+
function Hc(t) {
|
|
2227
2227
|
return /\.(?:mp4|webm|ogg|mov)$/i.test(t);
|
|
2228
2228
|
}
|
|
2229
|
-
function
|
|
2230
|
-
const { t: e } = q(), [r, n] = S(""),
|
|
2229
|
+
function Dc(t) {
|
|
2230
|
+
const { t: e } = q(), [r, n] = S(""), c = J(null), [o, a] = S(""), [l, s] = S(!1), h = (w) => {
|
|
2231
2231
|
s(w.detail);
|
|
2232
2232
|
};
|
|
2233
2233
|
B(() => {
|
|
@@ -2262,7 +2262,7 @@ function Da(t) {
|
|
|
2262
2262
|
}
|
|
2263
2263
|
function x(w) {
|
|
2264
2264
|
var p;
|
|
2265
|
-
w.preventDefault(), (p =
|
|
2265
|
+
w.preventDefault(), (p = c.current) == null || p.click();
|
|
2266
2266
|
}
|
|
2267
2267
|
return /* @__PURE__ */ g(
|
|
2268
2268
|
ut,
|
|
@@ -2306,7 +2306,7 @@ function Da(t) {
|
|
|
2306
2306
|
accept: "video/*",
|
|
2307
2307
|
multiple: !0,
|
|
2308
2308
|
onChange: u,
|
|
2309
|
-
ref:
|
|
2309
|
+
ref: c,
|
|
2310
2310
|
type: "file",
|
|
2311
2311
|
style: {
|
|
2312
2312
|
display: "none"
|
|
@@ -2326,11 +2326,11 @@ function Da(t) {
|
|
|
2326
2326
|
value: r,
|
|
2327
2327
|
onChange: (w) => {
|
|
2328
2328
|
const p = w.target.value;
|
|
2329
|
-
if (!
|
|
2330
|
-
|
|
2329
|
+
if (!Hc(p)) {
|
|
2330
|
+
a("Invalid video URL"), n("");
|
|
2331
2331
|
return;
|
|
2332
2332
|
}
|
|
2333
|
-
|
|
2333
|
+
a(""), n(p);
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
2336
|
),
|
|
@@ -2346,7 +2346,7 @@ function Da(t) {
|
|
|
2346
2346
|
}
|
|
2347
2347
|
);
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function _c(t) {
|
|
2350
2350
|
return t = t.replace("https://youtu.be/", "https://www.youtube.com/watch?v=").replace("watch?v=", "embed/"), t = t.replace("https://vimeo.com/", "https://player.vimeo.com/video/"), /^https?:\/\/www.bilibili.com\/video\/.*/i.test(t) && (t = t.replace(/\?.*$/, "").replace("https://www.bilibili.com/video/", "https://player.bilibili.com/player.html?bvid=")), t.includes("drive.google.com") && (t = t.replace("/view", "/preview")), t;
|
|
2351
2351
|
}
|
|
2352
2352
|
const ti = yt.create({
|
|
@@ -2370,7 +2370,7 @@ const ti = yt.create({
|
|
|
2370
2370
|
button: ({ editor: t, t: e }) => {
|
|
2371
2371
|
var r, n;
|
|
2372
2372
|
return {
|
|
2373
|
-
component:
|
|
2373
|
+
component: Dc,
|
|
2374
2374
|
componentProps: {
|
|
2375
2375
|
action: () => {
|
|
2376
2376
|
},
|
|
@@ -2390,7 +2390,7 @@ const ti = yt.create({
|
|
|
2390
2390
|
src: {
|
|
2391
2391
|
default: null,
|
|
2392
2392
|
renderHTML: ({ src: t }) => ({
|
|
2393
|
-
src: t ?
|
|
2393
|
+
src: t ? _c(t) : null
|
|
2394
2394
|
})
|
|
2395
2395
|
},
|
|
2396
2396
|
width: {
|
|
@@ -2421,7 +2421,7 @@ const ti = yt.create({
|
|
|
2421
2421
|
...t,
|
|
2422
2422
|
width: "100%",
|
|
2423
2423
|
height: "100%"
|
|
2424
|
-
}, n = `position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${e};`,
|
|
2424
|
+
}, n = `position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${e};`, c = `flex: 1;padding-bottom: ${9 / 16 * 100}%;`, l = ["div", { style: n }, ["div", { style: c }], ["iframe", r]];
|
|
2425
2425
|
return ["div", {
|
|
2426
2426
|
...this.options.HTMLAttributes,
|
|
2427
2427
|
"data-video": ""
|
|
@@ -2436,12 +2436,12 @@ const ti = yt.create({
|
|
|
2436
2436
|
updateVideo: (t) => ({ commands: e }) => e.updateAttributes(this.name, t)
|
|
2437
2437
|
};
|
|
2438
2438
|
}
|
|
2439
|
-
}),
|
|
2440
|
-
wrap:
|
|
2441
|
-
innerWrap: $
|
|
2439
|
+
}), Bc = "_wrap_5y04w_1", $c = "_innerWrap_5y04w_15", ir = {
|
|
2440
|
+
wrap: Bc,
|
|
2441
|
+
innerWrap: $c
|
|
2442
2442
|
};
|
|
2443
|
-
function
|
|
2444
|
-
const n = vo(), { url:
|
|
2443
|
+
function Vc({ editor: t, node: e, updateAttributes: r }) {
|
|
2444
|
+
const n = vo(), { url: c, width: o, height: a } = e.attrs, [l, s] = S("");
|
|
2445
2445
|
function h() {
|
|
2446
2446
|
l && t.chain().updateAttributes(kt.name, {
|
|
2447
2447
|
url: l
|
|
@@ -2454,7 +2454,7 @@ function Va({ editor: t, node: e, updateAttributes: r }) {
|
|
|
2454
2454
|
[r]
|
|
2455
2455
|
);
|
|
2456
2456
|
return /* @__PURE__ */ g(gt, { children: [
|
|
2457
|
-
!
|
|
2457
|
+
!c && /* @__PURE__ */ g("div", { className: "richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-[#ccc] richtext-p-[10px]", children: [
|
|
2458
2458
|
/* @__PURE__ */ i(
|
|
2459
2459
|
Q,
|
|
2460
2460
|
{
|
|
@@ -2475,14 +2475,14 @@ function Va({ editor: t, node: e, updateAttributes: r }) {
|
|
|
2475
2475
|
}
|
|
2476
2476
|
)
|
|
2477
2477
|
] }),
|
|
2478
|
-
|
|
2478
|
+
c && /* @__PURE__ */ i(
|
|
2479
2479
|
Rr,
|
|
2480
2480
|
{
|
|
2481
|
-
size: { width: Number.parseInt(o), height: Number.parseInt(
|
|
2481
|
+
size: { width: Number.parseInt(o), height: Number.parseInt(a) },
|
|
2482
2482
|
onResizeStop: (u, m, x, w) => {
|
|
2483
2483
|
d({
|
|
2484
2484
|
width: Number.parseInt(o) + w.width,
|
|
2485
|
-
height: Number.parseInt(
|
|
2485
|
+
height: Number.parseInt(a) + w.height
|
|
2486
2486
|
});
|
|
2487
2487
|
},
|
|
2488
2488
|
children: /* @__PURE__ */ i("div", { className: oe(ir.wrap, "render-wrapper"), children: /* @__PURE__ */ i(
|
|
@@ -2494,7 +2494,7 @@ function Va({ editor: t, node: e, updateAttributes: r }) {
|
|
|
2494
2494
|
"iframe",
|
|
2495
2495
|
{
|
|
2496
2496
|
className: "richtext-my-[12px] ",
|
|
2497
|
-
src:
|
|
2497
|
+
src: c
|
|
2498
2498
|
}
|
|
2499
2499
|
)
|
|
2500
2500
|
}
|
|
@@ -2503,7 +2503,7 @@ function Va({ editor: t, node: e, updateAttributes: r }) {
|
|
|
2503
2503
|
)
|
|
2504
2504
|
] });
|
|
2505
2505
|
}
|
|
2506
|
-
function
|
|
2506
|
+
function Wc(t) {
|
|
2507
2507
|
try {
|
|
2508
2508
|
return JSON.stringify(t);
|
|
2509
2509
|
} catch {
|
|
@@ -2513,37 +2513,37 @@ function Wa(t) {
|
|
|
2513
2513
|
function Lt(t, e = !1) {
|
|
2514
2514
|
return (r) => {
|
|
2515
2515
|
const n = t.startsWith("data-") ? t : `data-${t}`;
|
|
2516
|
-
let
|
|
2517
|
-
if (
|
|
2516
|
+
let c = decodeURIComponent(r.getAttribute(n));
|
|
2517
|
+
if (c == null || typeof c == "string" && c === "null")
|
|
2518
2518
|
try {
|
|
2519
2519
|
const l = r.outerHTML.match(/([\S\s])+?="([\S\s])+?"/g);
|
|
2520
|
-
l && l.length > 0 && (
|
|
2520
|
+
l && l.length > 0 && (c = (l.map((h) => h.trim()).reduce((h, d) => {
|
|
2521
2521
|
const u = d.indexOf("="), m = [d.slice(0, u), d.slice(u + 1).slice(1, -1)];
|
|
2522
2522
|
return h[m[0]] = m[1], h;
|
|
2523
2523
|
}, {})[t.toLowerCase()] || "").replaceAll(""", '"'));
|
|
2524
|
-
} catch (
|
|
2525
|
-
console.error("Error getDatasetAttribute ",
|
|
2524
|
+
} catch (a) {
|
|
2525
|
+
console.error("Error getDatasetAttribute ", a.message, r);
|
|
2526
2526
|
}
|
|
2527
2527
|
if (e)
|
|
2528
2528
|
try {
|
|
2529
|
-
return JSON.parse(
|
|
2529
|
+
return JSON.parse(c);
|
|
2530
2530
|
} catch {
|
|
2531
2531
|
return {};
|
|
2532
2532
|
}
|
|
2533
|
-
if (
|
|
2534
|
-
return
|
|
2535
|
-
const o = Number.parseInt(
|
|
2536
|
-
return o !== o ?
|
|
2533
|
+
if (c.includes("%") || c.includes("auto"))
|
|
2534
|
+
return c;
|
|
2535
|
+
const o = Number.parseInt(c);
|
|
2536
|
+
return o !== o ? c : o;
|
|
2537
2537
|
};
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function Fc(t) {
|
|
2540
2540
|
const { attrs: e } = t;
|
|
2541
2541
|
return Object.keys(e).reduce((r, n) => {
|
|
2542
|
-
const
|
|
2543
|
-
if (
|
|
2542
|
+
const c = e[n];
|
|
2543
|
+
if (c == null)
|
|
2544
2544
|
return r;
|
|
2545
2545
|
let o = "";
|
|
2546
|
-
return typeof
|
|
2546
|
+
return typeof c == "object" ? o = Wc(c) : o = c, r[n] = o, r;
|
|
2547
2547
|
}, /* @__PURE__ */ Object.create(null));
|
|
2548
2548
|
}
|
|
2549
2549
|
const kt = yt.create({
|
|
@@ -2568,7 +2568,7 @@ const kt = yt.create({
|
|
|
2568
2568
|
}) => ({
|
|
2569
2569
|
component: O,
|
|
2570
2570
|
componentProps: {
|
|
2571
|
-
action: (
|
|
2571
|
+
action: (c) => e.commands.setIframe(c),
|
|
2572
2572
|
upload: r.options.upload,
|
|
2573
2573
|
disabled: !e.can().setIframe({}),
|
|
2574
2574
|
icon: "Iframe",
|
|
@@ -2616,13 +2616,13 @@ const kt = yt.create({
|
|
|
2616
2616
|
addCommands() {
|
|
2617
2617
|
return {
|
|
2618
2618
|
setIframe: (t) => ({ tr: e, commands: r, chain: n }) => {
|
|
2619
|
-
var o,
|
|
2620
|
-
if (((l = (
|
|
2619
|
+
var o, a, l;
|
|
2620
|
+
if (((l = (a = (o = e.selection) == null ? void 0 : o.node) == null ? void 0 : a.type) == null ? void 0 : l.name) == this.name)
|
|
2621
2621
|
return r.updateAttributes(this.name, t);
|
|
2622
|
-
const
|
|
2622
|
+
const c = t || { url: "" };
|
|
2623
2623
|
return n().insertContent({
|
|
2624
2624
|
type: this.name,
|
|
2625
|
-
attrs:
|
|
2625
|
+
attrs: c
|
|
2626
2626
|
}).run();
|
|
2627
2627
|
}
|
|
2628
2628
|
};
|
|
@@ -2637,7 +2637,7 @@ const kt = yt.create({
|
|
|
2637
2637
|
];
|
|
2638
2638
|
},
|
|
2639
2639
|
addNodeView() {
|
|
2640
|
-
return pt(
|
|
2640
|
+
return pt(Vc);
|
|
2641
2641
|
}
|
|
2642
2642
|
}), jt = W.forwardRef(
|
|
2643
2643
|
({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
@@ -2653,50 +2653,50 @@ const kt = yt.create({
|
|
|
2653
2653
|
)
|
|
2654
2654
|
);
|
|
2655
2655
|
jt.displayName = "Textarea";
|
|
2656
|
-
function
|
|
2656
|
+
function Uc(t) {
|
|
2657
2657
|
return t;
|
|
2658
2658
|
}
|
|
2659
2659
|
function zt(t, e, r, n) {
|
|
2660
|
-
const
|
|
2660
|
+
const c = Uc, [o, a] = S(c(r)), l = J(o);
|
|
2661
2661
|
return B(() => {
|
|
2662
2662
|
const s = () => {
|
|
2663
2663
|
const h = { ...r, ...t.getAttributes(e) };
|
|
2664
2664
|
Object.keys(h).forEach((u) => {
|
|
2665
2665
|
(h[u] === null || h[u] === void 0) && (h[u] = r ? r[u] : null);
|
|
2666
2666
|
});
|
|
2667
|
-
const d =
|
|
2668
|
-
Cr(l.current, d) || (
|
|
2667
|
+
const d = c(h);
|
|
2668
|
+
Cr(l.current, d) || (a(d), l.current = d);
|
|
2669
2669
|
};
|
|
2670
2670
|
return t.on("selectionUpdate", s), t.on("transaction", s), () => {
|
|
2671
2671
|
t.off("selectionUpdate", s), t.off("transaction", s);
|
|
2672
2672
|
};
|
|
2673
|
-
}, [t, r, e,
|
|
2673
|
+
}, [t, r, e, c]), o;
|
|
2674
2674
|
}
|
|
2675
|
-
function
|
|
2675
|
+
function Gc({ editor: t, ...e }) {
|
|
2676
2676
|
const { t: r } = q(), n = zt(t, Mt.name, {
|
|
2677
2677
|
text: "",
|
|
2678
2678
|
defaultShowPicker: !1
|
|
2679
|
-
}), { text:
|
|
2680
|
-
t.chain().focus().setKatex({ text:
|
|
2681
|
-
}, [t,
|
|
2679
|
+
}), { text: c, defaultShowPicker: o } = n, [a, l] = S(""), s = H(() => {
|
|
2680
|
+
t.chain().focus().setKatex({ text: a }).run(), l("");
|
|
2681
|
+
}, [t, a]);
|
|
2682
2682
|
B(() => {
|
|
2683
2683
|
o && t.chain().updateAttributes(Mt.name, { defaultShowPicker: !1 }).focus().run();
|
|
2684
2684
|
}, [t, o]);
|
|
2685
2685
|
const h = U(() => {
|
|
2686
2686
|
try {
|
|
2687
|
-
return _e.renderToString(`${
|
|
2687
|
+
return _e.renderToString(`${a}`);
|
|
2688
2688
|
} catch {
|
|
2689
|
-
return
|
|
2689
|
+
return a;
|
|
2690
2690
|
}
|
|
2691
|
-
}, [
|
|
2692
|
-
() => `${
|
|
2691
|
+
}, [a]), d = U(
|
|
2692
|
+
() => `${a}`.trim() ? /* @__PURE__ */ i(
|
|
2693
2693
|
"span",
|
|
2694
2694
|
{
|
|
2695
2695
|
contentEditable: !1,
|
|
2696
2696
|
dangerouslySetInnerHTML: { __html: h || "" }
|
|
2697
2697
|
}
|
|
2698
2698
|
) : null,
|
|
2699
|
-
[
|
|
2699
|
+
[a, h]
|
|
2700
2700
|
);
|
|
2701
2701
|
return /* @__PURE__ */ g(It, { modal: !0, children: [
|
|
2702
2702
|
/* @__PURE__ */ i(Et, { asChild: !0, children: /* @__PURE__ */ i(
|
|
@@ -2714,18 +2714,18 @@ function Ga({ editor: t, ...e }) {
|
|
|
2714
2714
|
hideWhenDetached: !0,
|
|
2715
2715
|
side: "bottom",
|
|
2716
2716
|
children: [
|
|
2717
|
-
/* @__PURE__ */ i(
|
|
2717
|
+
/* @__PURE__ */ i(at, { className: "richtext-mb-[6px]", children: r("editor.formula.dialog.text") }),
|
|
2718
2718
|
/* @__PURE__ */ i("div", { className: "richtext-mb-[16px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ i(
|
|
2719
2719
|
jt,
|
|
2720
2720
|
{
|
|
2721
2721
|
autoFocus: !0,
|
|
2722
2722
|
className: "richtext-w-full",
|
|
2723
|
-
defaultValue:
|
|
2723
|
+
defaultValue: c,
|
|
2724
2724
|
onChange: (u) => l(u.target.value),
|
|
2725
2725
|
placeholder: "Text",
|
|
2726
2726
|
required: !0,
|
|
2727
2727
|
rows: 3,
|
|
2728
|
-
value:
|
|
2728
|
+
value: a
|
|
2729
2729
|
}
|
|
2730
2730
|
) }) }),
|
|
2731
2731
|
d && /* @__PURE__ */ i("div", { className: "richtext-my-[10px] richtext-max-w-[286px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]", children: d }),
|
|
@@ -2753,40 +2753,40 @@ function Ga({ editor: t, ...e }) {
|
|
|
2753
2753
|
)
|
|
2754
2754
|
] });
|
|
2755
2755
|
}
|
|
2756
|
-
function
|
|
2756
|
+
function qc() {
|
|
2757
2757
|
const [t] = Hr((e) => e.value);
|
|
2758
2758
|
return t;
|
|
2759
2759
|
}
|
|
2760
|
-
const
|
|
2760
|
+
const jc = {
|
|
2761
2761
|
setTheme: (t, e) => {
|
|
2762
2762
|
Be(bt.UPDATE_THEME(t), e);
|
|
2763
2763
|
}
|
|
2764
2764
|
};
|
|
2765
|
-
function
|
|
2766
|
-
let r = 0, n = 0,
|
|
2765
|
+
function Xc(t, e = 1) {
|
|
2766
|
+
let r = 0, n = 0, c = 0;
|
|
2767
2767
|
if (t.startsWith("rgb")) {
|
|
2768
2768
|
const o = t.replace(/\s/g, "").match(/rgb\((.*)\)$/)[1].split(",");
|
|
2769
|
-
r = +o[0], n = +o[1],
|
|
2769
|
+
r = +o[0], n = +o[1], c = +o[2];
|
|
2770
2770
|
} else if (t.startsWith("#")) {
|
|
2771
2771
|
let o = t.replace("#", "");
|
|
2772
|
-
o.length === 3 && (o = `${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}`), r = Number.parseInt(o.substring(0, 2), 16), n = Number.parseInt(o.substring(2, 4), 16),
|
|
2772
|
+
o.length === 3 && (o = `${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}`), r = Number.parseInt(o.substring(0, 2), 16), n = Number.parseInt(o.substring(2, 4), 16), c = Number.parseInt(o.substring(4, 6), 16);
|
|
2773
2773
|
} else
|
|
2774
2774
|
return t;
|
|
2775
|
-
return e > 1 && e <= 100 && (e = e / 100), `rgba(${r},${n},${
|
|
2775
|
+
return e > 1 && e <= 100 && (e = e / 100), `rgba(${r},${n},${c},${e})`;
|
|
2776
2776
|
}
|
|
2777
|
-
function
|
|
2778
|
-
const e =
|
|
2779
|
-
const
|
|
2780
|
-
return e === "dark" ?
|
|
2781
|
-
}, [e]),
|
|
2777
|
+
function Yc({ node: t }) {
|
|
2778
|
+
const e = qc(), { text: r } = t.attrs, n = U(() => {
|
|
2779
|
+
const a = "rgb(254, 242, 237)";
|
|
2780
|
+
return e === "dark" ? Xc(a, 0.75) : a;
|
|
2781
|
+
}, [e]), c = U(() => {
|
|
2782
2782
|
try {
|
|
2783
2783
|
return _e.renderToString(`${r}`);
|
|
2784
2784
|
} catch {
|
|
2785
2785
|
return r;
|
|
2786
2786
|
}
|
|
2787
2787
|
}, [r]), o = U(
|
|
2788
|
-
() => r.trim() ? /* @__PURE__ */ i("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html:
|
|
2789
|
-
[r,
|
|
2788
|
+
() => r.trim() ? /* @__PURE__ */ i("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html: c } }) : /* @__PURE__ */ i("span", { contentEditable: !1, children: "Not enter a formula" }),
|
|
2789
|
+
[r, c]
|
|
2790
2790
|
);
|
|
2791
2791
|
return /* @__PURE__ */ i(
|
|
2792
2792
|
gt,
|
|
@@ -2800,7 +2800,7 @@ function Ya({ node: t }) {
|
|
|
2800
2800
|
}
|
|
2801
2801
|
);
|
|
2802
2802
|
}
|
|
2803
|
-
function
|
|
2803
|
+
function Kc(t) {
|
|
2804
2804
|
return (e) => e.getAttribute(t);
|
|
2805
2805
|
}
|
|
2806
2806
|
const Mt = yt.create({
|
|
@@ -2816,7 +2816,7 @@ const Mt = yt.create({
|
|
|
2816
2816
|
class: "katex"
|
|
2817
2817
|
},
|
|
2818
2818
|
button: ({ editor: t, t: e }) => ({
|
|
2819
|
-
component:
|
|
2819
|
+
component: Gc,
|
|
2820
2820
|
componentProps: {
|
|
2821
2821
|
editor: t,
|
|
2822
2822
|
action: () => !0,
|
|
@@ -2832,7 +2832,7 @@ const Mt = yt.create({
|
|
|
2832
2832
|
return {
|
|
2833
2833
|
text: {
|
|
2834
2834
|
default: "",
|
|
2835
|
-
parseHTML:
|
|
2835
|
+
parseHTML: Kc("text")
|
|
2836
2836
|
},
|
|
2837
2837
|
defaultShowPicker: {
|
|
2838
2838
|
default: !1
|
|
@@ -2863,7 +2863,7 @@ const Mt = yt.create({
|
|
|
2863
2863
|
];
|
|
2864
2864
|
},
|
|
2865
2865
|
addNodeView() {
|
|
2866
|
-
return pt(
|
|
2866
|
+
return pt(Yc);
|
|
2867
2867
|
}
|
|
2868
2868
|
});
|
|
2869
2869
|
let ye;
|
|
@@ -2875,17 +2875,17 @@ function Fe() {
|
|
|
2875
2875
|
}
|
|
2876
2876
|
}
|
|
2877
2877
|
const Le = "OPEN_EXCALIDRAW_SETTING_MODAL";
|
|
2878
|
-
function
|
|
2878
|
+
function Zc(t, e) {
|
|
2879
2879
|
Fe().on(t, e);
|
|
2880
2880
|
}
|
|
2881
|
-
function
|
|
2881
|
+
function Jc(t, e) {
|
|
2882
2882
|
Fe().off(t, e);
|
|
2883
2883
|
}
|
|
2884
|
-
function
|
|
2884
|
+
function Qc(t) {
|
|
2885
2885
|
Fe().emit(Le, t);
|
|
2886
2886
|
}
|
|
2887
|
-
const
|
|
2888
|
-
const [e, r] = S(null), [n,
|
|
2887
|
+
const ta = ({ editor: t }) => {
|
|
2888
|
+
const [e, r] = S(null), [n, c] = S({}), [o, a] = S({ elements: [], appState: { isLoading: !1 }, files: null }), [l, s] = S(!1), [h, d] = S(!0), [u, m] = S(null), x = H(
|
|
2889
2889
|
(I) => {
|
|
2890
2890
|
I && import("@excalidraw/excalidraw").then((T) => {
|
|
2891
2891
|
r(T.Excalidraw);
|
|
@@ -2897,7 +2897,7 @@ const tc = ({ editor: t }) => {
|
|
|
2897
2897
|
I.refresh();
|
|
2898
2898
|
});
|
|
2899
2899
|
}, []), p = H((I, T, v) => {
|
|
2900
|
-
|
|
2900
|
+
c({
|
|
2901
2901
|
elements: I,
|
|
2902
2902
|
appState: { isLoading: !1 },
|
|
2903
2903
|
files: v
|
|
@@ -2911,10 +2911,10 @@ const tc = ({ editor: t }) => {
|
|
|
2911
2911
|
}, [e, t, n, s]);
|
|
2912
2912
|
return B(() => {
|
|
2913
2913
|
const I = (T) => {
|
|
2914
|
-
s(!0), T &&
|
|
2914
|
+
s(!0), T && a(T.data);
|
|
2915
2915
|
};
|
|
2916
|
-
return
|
|
2917
|
-
|
|
2916
|
+
return Zc(Le, I), () => {
|
|
2917
|
+
Jc(Le, I);
|
|
2918
2918
|
};
|
|
2919
2919
|
}, [t, s]), /* @__PURE__ */ g(
|
|
2920
2920
|
ut,
|
|
@@ -2964,21 +2964,21 @@ const tc = ({ editor: t }) => {
|
|
|
2964
2964
|
]
|
|
2965
2965
|
}
|
|
2966
2966
|
);
|
|
2967
|
-
},
|
|
2968
|
-
wrap:
|
|
2969
|
-
renderWrap:
|
|
2970
|
-
title:
|
|
2971
|
-
handlerWrap:
|
|
2972
|
-
},
|
|
2973
|
-
function
|
|
2974
|
-
const n = J(null),
|
|
2967
|
+
}, ea = "_wrap_15k3c_1", ra = "_renderWrap_15k3c_7", ia = "_title_15k3c_14", na = "_handlerWrap_15k3c_30", Pt = {
|
|
2968
|
+
wrap: ea,
|
|
2969
|
+
renderWrap: ra,
|
|
2970
|
+
title: ia,
|
|
2971
|
+
handlerWrap: na
|
|
2972
|
+
}, oa = 10, ca = 200, nr = 15, or = { width: "100%", height: "100%", maxWidth: "100%" };
|
|
2973
|
+
function aa({ editor: t, node: e, updateAttributes: r }) {
|
|
2974
|
+
const n = J(null), c = t.isActive(St.name), { data: o, width: a, height: l } = e.attrs, [s, h] = S(null), [d, u] = S(!0), [m, x] = S(null), [w, p] = S(!1), [f, I] = S(100), T = H(
|
|
2975
2975
|
(C) => {
|
|
2976
2976
|
C && p(!0);
|
|
2977
2977
|
},
|
|
2978
2978
|
[p]
|
|
2979
2979
|
), v = H((C) => () => {
|
|
2980
2980
|
I(
|
|
2981
|
-
(M) => $e(C === "minus" ? M - nr : M + nr,
|
|
2981
|
+
(M) => $e(C === "minus" ? M - nr : M + nr, oa, ca)
|
|
2982
2982
|
);
|
|
2983
2983
|
}, []);
|
|
2984
2984
|
B(() => {
|
|
@@ -3002,13 +3002,13 @@ function cc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
3002
3002
|
const y = (C) => {
|
|
3003
3003
|
r({ width: C.width, height: C.height });
|
|
3004
3004
|
};
|
|
3005
|
-
return /* @__PURE__ */ i(gt, { className: oe(Pt.wrap,
|
|
3005
|
+
return /* @__PURE__ */ i(gt, { className: oe(Pt.wrap, c && Pt.isActive), children: /* @__PURE__ */ i(Di, { onChange: T, children: /* @__PURE__ */ i(
|
|
3006
3006
|
Rr,
|
|
3007
3007
|
{
|
|
3008
|
-
size: { width: Number.parseInt(
|
|
3008
|
+
size: { width: Number.parseInt(a), height: Number.parseInt(l) },
|
|
3009
3009
|
onResizeStop: (C, M, L, N) => {
|
|
3010
3010
|
y({
|
|
3011
|
-
width: Number.parseInt(
|
|
3011
|
+
width: Number.parseInt(a) + N.width,
|
|
3012
3012
|
height: Number.parseInt(l) + N.height
|
|
3013
3013
|
});
|
|
3014
3014
|
},
|
|
@@ -3062,7 +3062,7 @@ function cc({ editor: t, node: e, updateAttributes: r }) {
|
|
|
3062
3062
|
}
|
|
3063
3063
|
) }) });
|
|
3064
3064
|
}
|
|
3065
|
-
const
|
|
3065
|
+
const sa = Ht.memo(aa, (t, e) => !!Cr(t.node.attrs, e.node.attrs)), cr = { elements: [] }, St = yt.create({
|
|
3066
3066
|
name: "excalidraw",
|
|
3067
3067
|
group: "block",
|
|
3068
3068
|
selectable: !0,
|
|
@@ -3086,7 +3086,7 @@ const sc = Ht.memo(cc, (t, e) => !!Cr(t.node.attrs, e.node.attrs)), ar = { eleme
|
|
|
3086
3086
|
parseHTML: Lt("height")
|
|
3087
3087
|
},
|
|
3088
3088
|
data: {
|
|
3089
|
-
default:
|
|
3089
|
+
default: cr,
|
|
3090
3090
|
parseHTML: Lt("data", !0)
|
|
3091
3091
|
}
|
|
3092
3092
|
};
|
|
@@ -3099,7 +3099,7 @@ const sc = Ht.memo(cc, (t, e) => !!Cr(t.node.attrs, e.node.attrs)), ar = { eleme
|
|
|
3099
3099
|
class: "excalidraw"
|
|
3100
3100
|
},
|
|
3101
3101
|
button: ({ editor: e }) => ({
|
|
3102
|
-
component:
|
|
3102
|
+
component: ta,
|
|
3103
3103
|
componentProps: {
|
|
3104
3104
|
editor: e
|
|
3105
3105
|
}
|
|
@@ -3114,13 +3114,13 @@ const sc = Ht.memo(cc, (t, e) => !!Cr(t.node.attrs, e.node.attrs)), ar = { eleme
|
|
|
3114
3114
|
];
|
|
3115
3115
|
},
|
|
3116
3116
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
3117
|
-
return ["div", st(this.options.HTMLAttributes, t,
|
|
3117
|
+
return ["div", st(this.options.HTMLAttributes, t, Fc(e))];
|
|
3118
3118
|
},
|
|
3119
3119
|
addCommands() {
|
|
3120
3120
|
return {
|
|
3121
3121
|
setExcalidraw: (t) => ({ tr: e, commands: r, chain: n }) => {
|
|
3122
|
-
var
|
|
3123
|
-
return t = t || {}, t.data = t.data ||
|
|
3122
|
+
var c, o, a;
|
|
3123
|
+
return t = t || {}, t.data = t.data || cr, ((a = (o = (c = e.selection) == null ? void 0 : c.node) == null ? void 0 : o.type) == null ? void 0 : a.name) == this.name ? r.updateAttributes(this.name, t) : n().insertContent({
|
|
3124
3124
|
type: this.name,
|
|
3125
3125
|
attrs: t
|
|
3126
3126
|
}).run();
|
|
@@ -3128,7 +3128,7 @@ const sc = Ht.memo(cc, (t, e) => !!Cr(t.node.attrs, e.node.attrs)), ar = { eleme
|
|
|
3128
3128
|
};
|
|
3129
3129
|
},
|
|
3130
3130
|
addNodeView() {
|
|
3131
|
-
return pt(
|
|
3131
|
+
return pt(sa);
|
|
3132
3132
|
},
|
|
3133
3133
|
addInputRules() {
|
|
3134
3134
|
return [
|
|
@@ -3140,13 +3140,13 @@ const sc = Ht.memo(cc, (t, e) => !!Cr(t.node.attrs, e.node.attrs)), ar = { eleme
|
|
|
3140
3140
|
];
|
|
3141
3141
|
}
|
|
3142
3142
|
});
|
|
3143
|
-
function
|
|
3144
|
-
const [n,
|
|
3143
|
+
function la({ selectImage: t, giphyApiKey: e, children: r }) {
|
|
3144
|
+
const [n, c] = S([]), [o] = S(15), a = J(null), l = (h, d = "search") => {
|
|
3145
3145
|
if (!e)
|
|
3146
3146
|
return;
|
|
3147
3147
|
const m = `${d === "search" ? `https://api.giphy.com/v1/gifs/search?q=${h}` : `https://api.giphy.com/v1/gifs/trending?q=${h}`}&limit=${o}&api_key=${e}`;
|
|
3148
3148
|
fetch(m).then((x) => x.json()).then((x) => {
|
|
3149
|
-
|
|
3149
|
+
c(x.data);
|
|
3150
3150
|
}).catch((x) => {
|
|
3151
3151
|
console.log(x);
|
|
3152
3152
|
});
|
|
@@ -3180,7 +3180,7 @@ function lc({ selectImage: t, giphyApiKey: e, children: r }) {
|
|
|
3180
3180
|
{
|
|
3181
3181
|
onChange: s,
|
|
3182
3182
|
placeholder: "Search GIF",
|
|
3183
|
-
ref:
|
|
3183
|
+
ref: a,
|
|
3184
3184
|
type: "text"
|
|
3185
3185
|
}
|
|
3186
3186
|
) }),
|
|
@@ -3201,14 +3201,14 @@ function lc({ selectImage: t, giphyApiKey: e, children: r }) {
|
|
|
3201
3201
|
)
|
|
3202
3202
|
] });
|
|
3203
3203
|
}
|
|
3204
|
-
function
|
|
3204
|
+
function da({ editor: t, icon: e, giphyApiKey: r, ...n }) {
|
|
3205
3205
|
return /* @__PURE__ */ i(
|
|
3206
|
-
|
|
3206
|
+
la,
|
|
3207
3207
|
{
|
|
3208
3208
|
giphyApiKey: r,
|
|
3209
3209
|
selectImage: (o) => {
|
|
3210
|
-
const { url:
|
|
3211
|
-
t.chain().focus().setImageGif({ src:
|
|
3210
|
+
const { url: a } = o.images.original;
|
|
3211
|
+
t.chain().focus().setImageGif({ src: a }).run();
|
|
3212
3212
|
},
|
|
3213
3213
|
children: /* @__PURE__ */ i(
|
|
3214
3214
|
O,
|
|
@@ -3226,12 +3226,12 @@ const Kt = {
|
|
|
3226
3226
|
BOTTOM_LEFT: "bl",
|
|
3227
3227
|
BOTTOM_RIGHT: "br"
|
|
3228
3228
|
};
|
|
3229
|
-
function
|
|
3229
|
+
function ha(t) {
|
|
3230
3230
|
var M, L;
|
|
3231
3231
|
const [e, r] = S({
|
|
3232
3232
|
width: xt,
|
|
3233
3233
|
height: xt
|
|
3234
|
-
}), [n,
|
|
3234
|
+
}), [n, c] = S({
|
|
3235
3235
|
width: 0,
|
|
3236
3236
|
height: 0
|
|
3237
3237
|
}), [o] = S([
|
|
@@ -3239,7 +3239,7 @@ function hc(t) {
|
|
|
3239
3239
|
Kt.TOP_RIGHT,
|
|
3240
3240
|
Kt.BOTTOM_LEFT,
|
|
3241
3241
|
Kt.BOTTOM_RIGHT
|
|
3242
|
-
]), [
|
|
3242
|
+
]), [a, l] = S(!1), [s, h] = S({
|
|
3243
3243
|
x: 0,
|
|
3244
3244
|
y: 0,
|
|
3245
3245
|
w: 0,
|
|
@@ -3247,7 +3247,7 @@ function hc(t) {
|
|
|
3247
3247
|
dir: ""
|
|
3248
3248
|
}), { align: d } = (M = t == null ? void 0 : t.node) == null ? void 0 : M.attrs, u = U(() => {
|
|
3249
3249
|
var R;
|
|
3250
|
-
const { src: N, alt: E, width: b, height: k } = (R = t == null ? void 0 : t.node) == null ? void 0 : R.attrs, _ =
|
|
3250
|
+
const { src: N, alt: E, width: b, height: k } = (R = t == null ? void 0 : t.node) == null ? void 0 : R.attrs, _ = ce(b) ? `${b}px` : b, D = ce(k) ? `${k}px` : k;
|
|
3251
3251
|
return {
|
|
3252
3252
|
src: N || void 0,
|
|
3253
3253
|
alt: E || void 0,
|
|
@@ -3263,7 +3263,7 @@ function hc(t) {
|
|
|
3263
3263
|
return { width: N === "100%" ? N : void 0 };
|
|
3264
3264
|
}, [u]);
|
|
3265
3265
|
function x(N) {
|
|
3266
|
-
|
|
3266
|
+
c({
|
|
3267
3267
|
width: N.target.width,
|
|
3268
3268
|
height: N.target.height
|
|
3269
3269
|
});
|
|
@@ -3297,7 +3297,7 @@ function hc(t) {
|
|
|
3297
3297
|
}
|
|
3298
3298
|
const I = H(
|
|
3299
3299
|
ht((N) => {
|
|
3300
|
-
if (N.preventDefault(), N.stopPropagation(), !
|
|
3300
|
+
if (N.preventDefault(), N.stopPropagation(), !a)
|
|
3301
3301
|
return;
|
|
3302
3302
|
const { x: E, w: b, dir: k } = s, _ = (N.clientX - E) * (/l/.test(k) ? -1 : 1), D = yr(b + _, he, e.width);
|
|
3303
3303
|
t.updateAttributes({
|
|
@@ -3305,10 +3305,10 @@ function hc(t) {
|
|
|
3305
3305
|
height: null
|
|
3306
3306
|
});
|
|
3307
3307
|
}, ft),
|
|
3308
|
-
[
|
|
3308
|
+
[a, s, e, t.updateAttributes]
|
|
3309
3309
|
), T = H(
|
|
3310
3310
|
(N) => {
|
|
3311
|
-
N.preventDefault(), N.stopPropagation(),
|
|
3311
|
+
N.preventDefault(), N.stopPropagation(), a && (h({
|
|
3312
3312
|
x: 0,
|
|
3313
3313
|
y: 0,
|
|
3314
3314
|
w: 0,
|
|
@@ -3316,15 +3316,15 @@ function hc(t) {
|
|
|
3316
3316
|
dir: ""
|
|
3317
3317
|
}), l(!1), w());
|
|
3318
3318
|
},
|
|
3319
|
-
[
|
|
3319
|
+
[a, w]
|
|
3320
3320
|
), v = H(() => {
|
|
3321
3321
|
document == null || document.addEventListener("mousemove", I, !0), document == null || document.addEventListener("mouseup", T, !0);
|
|
3322
3322
|
}, [I, T]), y = H(() => {
|
|
3323
3323
|
document == null || document.removeEventListener("mousemove", I, !0), document == null || document.removeEventListener("mouseup", T, !0);
|
|
3324
3324
|
}, [I, T]);
|
|
3325
|
-
B(() => (
|
|
3325
|
+
B(() => (a ? v() : y(), () => {
|
|
3326
3326
|
y();
|
|
3327
|
-
}), [
|
|
3327
|
+
}), [a, v, y]);
|
|
3328
3328
|
const C = U(() => new ResizeObserver(() => p()), [p]);
|
|
3329
3329
|
return B(() => (C.observe(t.editor.view.dom), () => {
|
|
3330
3330
|
C.disconnect();
|
|
@@ -3339,7 +3339,7 @@ function hc(t) {
|
|
|
3339
3339
|
"data-drag-handle": !0,
|
|
3340
3340
|
draggable: "true",
|
|
3341
3341
|
style: m,
|
|
3342
|
-
className: `image-view__body ${t != null && t.selected ? "image-view__body--focused" : ""} ${
|
|
3342
|
+
className: `image-view__body ${t != null && t.selected ? "image-view__body--focused" : ""} ${a ? "image-view__body--resizing" : ""}`,
|
|
3343
3343
|
children: [
|
|
3344
3344
|
/* @__PURE__ */ i(
|
|
3345
3345
|
"img",
|
|
@@ -3353,7 +3353,7 @@ function hc(t) {
|
|
|
3353
3353
|
style: u.style
|
|
3354
3354
|
}
|
|
3355
3355
|
),
|
|
3356
|
-
(t == null ? void 0 : t.editor.view.editable) && ((t == null ? void 0 : t.selected) ||
|
|
3356
|
+
(t == null ? void 0 : t.editor.view.editable) && ((t == null ? void 0 : t.selected) || a) && /* @__PURE__ */ i("div", { className: "image-resizer", children: o == null ? void 0 : o.map((N) => /* @__PURE__ */ i(
|
|
3357
3357
|
"span",
|
|
3358
3358
|
{
|
|
3359
3359
|
className: `image-resizer__handler image-resizer__handler--${N}`,
|
|
@@ -3383,9 +3383,9 @@ const ei = de.extend({
|
|
|
3383
3383
|
atom: !0,
|
|
3384
3384
|
button: ({ editor: e, extension: r, t: n }) => {
|
|
3385
3385
|
var o;
|
|
3386
|
-
const
|
|
3386
|
+
const c = ((o = r == null ? void 0 : r.options) == null ? void 0 : o.GIPHY_API_KEY) || "";
|
|
3387
3387
|
return {
|
|
3388
|
-
component:
|
|
3388
|
+
component: da,
|
|
3389
3389
|
componentProps: {
|
|
3390
3390
|
editor: e,
|
|
3391
3391
|
action: () => {
|
|
@@ -3394,7 +3394,7 @@ const ei = de.extend({
|
|
|
3394
3394
|
disabled: !1,
|
|
3395
3395
|
icon: "GifIcon",
|
|
3396
3396
|
tooltip: n("editor.imageGif.tooltip"),
|
|
3397
|
-
giphyApiKey:
|
|
3397
|
+
giphyApiKey: c
|
|
3398
3398
|
}
|
|
3399
3399
|
};
|
|
3400
3400
|
}
|
|
@@ -3424,7 +3424,7 @@ const ei = de.extend({
|
|
|
3424
3424
|
};
|
|
3425
3425
|
},
|
|
3426
3426
|
addNodeView() {
|
|
3427
|
-
return pt(
|
|
3427
|
+
return pt(ha);
|
|
3428
3428
|
},
|
|
3429
3429
|
addCommands() {
|
|
3430
3430
|
var t;
|
|
@@ -3481,17 +3481,17 @@ const ei = de.extend({
|
|
|
3481
3481
|
function fe(t = 8) {
|
|
3482
3482
|
return Math.random().toString(36).substring(2, t + 2);
|
|
3483
3483
|
}
|
|
3484
|
-
const
|
|
3485
|
-
a-->b`,
|
|
3486
|
-
const [r, n] = S(
|
|
3484
|
+
const ar = `graph TB
|
|
3485
|
+
a-->b`, ua = ({ editor: t, upload: e }) => {
|
|
3486
|
+
const [r, n] = S(ar), [c, o] = S(""), [a, l] = S(!1), s = J(null), h = async (m) => {
|
|
3487
3487
|
try {
|
|
3488
|
-
const { svg: x } = await
|
|
3488
|
+
const { svg: x } = await ae.render("mermaid-svg", m);
|
|
3489
3489
|
o(x);
|
|
3490
3490
|
} catch {
|
|
3491
3491
|
o("");
|
|
3492
3492
|
}
|
|
3493
3493
|
}, d = () => {
|
|
3494
|
-
|
|
3494
|
+
ae.initialize({
|
|
3495
3495
|
darkMode: !1,
|
|
3496
3496
|
startOnLoad: !1,
|
|
3497
3497
|
// fontFamily:'',
|
|
@@ -3500,14 +3500,14 @@ a-->b`, uc = ({ editor: t, upload: e }) => {
|
|
|
3500
3500
|
}), h(r);
|
|
3501
3501
|
};
|
|
3502
3502
|
return B(() => {
|
|
3503
|
-
|
|
3504
|
-
}, [
|
|
3505
|
-
|
|
3503
|
+
a && d();
|
|
3504
|
+
}, [a]), B(() => {
|
|
3505
|
+
a && h(r);
|
|
3506
3506
|
}, [r]), /* @__PURE__ */ g(
|
|
3507
3507
|
ut,
|
|
3508
3508
|
{
|
|
3509
3509
|
onOpenChange: l,
|
|
3510
|
-
open:
|
|
3510
|
+
open: a,
|
|
3511
3511
|
children: [
|
|
3512
3512
|
/* @__PURE__ */ i(mt, { asChild: !0, children: /* @__PURE__ */ i(
|
|
3513
3513
|
O,
|
|
@@ -3525,7 +3525,7 @@ a-->b`, uc = ({ editor: t, upload: e }) => {
|
|
|
3525
3525
|
{
|
|
3526
3526
|
autoFocus: !0,
|
|
3527
3527
|
className: "richtext-flex-1",
|
|
3528
|
-
defaultValue:
|
|
3528
|
+
defaultValue: ar,
|
|
3529
3529
|
onChange: (m) => n(m.target.value),
|
|
3530
3530
|
placeholder: "Text",
|
|
3531
3531
|
required: !0,
|
|
@@ -3540,7 +3540,7 @@ a-->b`, uc = ({ editor: t, upload: e }) => {
|
|
|
3540
3540
|
"div",
|
|
3541
3541
|
{
|
|
3542
3542
|
className: "richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",
|
|
3543
|
-
dangerouslySetInnerHTML: { __html:
|
|
3543
|
+
dangerouslySetInnerHTML: { __html: c },
|
|
3544
3544
|
ref: s,
|
|
3545
3545
|
style: { height: "100%", borderWidth: 1, minHeight: 500, background: "#fff" }
|
|
3546
3546
|
}
|
|
@@ -3586,8 +3586,8 @@ a-->b`, uc = ({ editor: t, upload: e }) => {
|
|
|
3586
3586
|
BOTTOM_LEFT: "bl",
|
|
3587
3587
|
BOTTOM_RIGHT: "br"
|
|
3588
3588
|
};
|
|
3589
|
-
function
|
|
3590
|
-
const [o,
|
|
3589
|
+
function ma({ editor: t, node: e, updateAttributes: r, getPos: n, selected: c }) {
|
|
3590
|
+
const [o, a] = S({
|
|
3591
3591
|
width: xt,
|
|
3592
3592
|
height: xt
|
|
3593
3593
|
}), [l, s] = S({
|
|
@@ -3632,7 +3632,7 @@ function mc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
3632
3632
|
const v = H(
|
|
3633
3633
|
ht(() => {
|
|
3634
3634
|
const { width: b } = getComputedStyle(t.view.dom);
|
|
3635
|
-
|
|
3635
|
+
a((k) => ({
|
|
3636
3636
|
...k,
|
|
3637
3637
|
width: Number.parseInt(b, 10)
|
|
3638
3638
|
}));
|
|
@@ -3696,7 +3696,7 @@ function mc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
3696
3696
|
"data-drag-handle": !0,
|
|
3697
3697
|
draggable: "true",
|
|
3698
3698
|
style: { ...f, background: "#fff" },
|
|
3699
|
-
className: `image-view__body ${
|
|
3699
|
+
className: `image-view__body ${c ? "image-view__body--focused" : ""} ${d ? "image-view__body--resizing" : ""}`,
|
|
3700
3700
|
children: [
|
|
3701
3701
|
/* @__PURE__ */ i(
|
|
3702
3702
|
"img",
|
|
@@ -3710,7 +3710,7 @@ function mc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
3710
3710
|
style: p.style
|
|
3711
3711
|
}
|
|
3712
3712
|
),
|
|
3713
|
-
t.view.editable && (
|
|
3713
|
+
t.view.editable && (c || d) && /* @__PURE__ */ i("div", { className: "image-resizer", children: h == null ? void 0 : h.map((b) => /* @__PURE__ */ i(
|
|
3714
3714
|
"span",
|
|
3715
3715
|
{
|
|
3716
3716
|
className: `image-resizer__handler image-resizer__handler--${b}`,
|
|
@@ -3741,9 +3741,9 @@ const sr = de.extend({
|
|
|
3741
3741
|
class: "mermaid"
|
|
3742
3742
|
},
|
|
3743
3743
|
button: ({ editor: e, t: r, extension: n }) => {
|
|
3744
|
-
var
|
|
3744
|
+
var c;
|
|
3745
3745
|
return {
|
|
3746
|
-
component:
|
|
3746
|
+
component: ua,
|
|
3747
3747
|
componentProps: {
|
|
3748
3748
|
action: () => !0,
|
|
3749
3749
|
isActive: () => !1,
|
|
@@ -3751,7 +3751,7 @@ const sr = de.extend({
|
|
|
3751
3751
|
editor: e,
|
|
3752
3752
|
icon: "Mermaid",
|
|
3753
3753
|
tooltip: r("editor.mermaid.tooltip"),
|
|
3754
|
-
upload: (
|
|
3754
|
+
upload: (c = n == null ? void 0 : n.options) == null ? void 0 : c.upload
|
|
3755
3755
|
}
|
|
3756
3756
|
};
|
|
3757
3757
|
}
|
|
@@ -3791,7 +3791,7 @@ const sr = de.extend({
|
|
|
3791
3791
|
};
|
|
3792
3792
|
},
|
|
3793
3793
|
addNodeView() {
|
|
3794
|
-
return pt(
|
|
3794
|
+
return pt(ma);
|
|
3795
3795
|
},
|
|
3796
3796
|
// @ts-ignore
|
|
3797
3797
|
addCommands() {
|
|
@@ -3843,7 +3843,7 @@ const sr = de.extend({
|
|
|
3843
3843
|
];
|
|
3844
3844
|
}
|
|
3845
3845
|
});
|
|
3846
|
-
function
|
|
3846
|
+
function xa({ node: t }) {
|
|
3847
3847
|
var n;
|
|
3848
3848
|
const e = ((n = t == null ? void 0 : t.attrs) == null ? void 0 : n.src) || "", r = e == null ? void 0 : e.split("/").pop();
|
|
3849
3849
|
return r ? /* @__PURE__ */ i(gt, { children: /* @__PURE__ */ i("div", { "data-twitter": "", children: /* @__PURE__ */ i(_i, { id: r }) }) }) : null;
|
|
@@ -3853,20 +3853,20 @@ function ri(t) {
|
|
|
3853
3853
|
B(() => {
|
|
3854
3854
|
var o;
|
|
3855
3855
|
if (t != null && t.editor) {
|
|
3856
|
-
const { src:
|
|
3857
|
-
|
|
3856
|
+
const { src: a } = (o = t.editor) == null ? void 0 : o.getAttributes(Ie.name);
|
|
3857
|
+
a && n(a);
|
|
3858
3858
|
}
|
|
3859
3859
|
}, [t == null ? void 0 : t.editor]);
|
|
3860
|
-
function
|
|
3860
|
+
function c(o) {
|
|
3861
3861
|
o.preventDefault(), o.stopPropagation(), t == null || t.onSetLink(r);
|
|
3862
3862
|
}
|
|
3863
3863
|
return /* @__PURE__ */ i("div", { className: "border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ g(
|
|
3864
3864
|
"form",
|
|
3865
3865
|
{
|
|
3866
3866
|
className: "richtext-flex richtext-flex-col richtext-gap-2",
|
|
3867
|
-
onSubmit:
|
|
3867
|
+
onSubmit: c,
|
|
3868
3868
|
children: [
|
|
3869
|
-
/* @__PURE__ */ i(
|
|
3869
|
+
/* @__PURE__ */ i(at, { className: "mb-[6px]", children: e("editor.link.dialog.text") }),
|
|
3870
3870
|
/* @__PURE__ */ i("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ i(
|
|
3871
3871
|
Q,
|
|
3872
3872
|
{
|
|
@@ -3890,7 +3890,7 @@ function ri(t) {
|
|
|
3890
3890
|
}
|
|
3891
3891
|
) });
|
|
3892
3892
|
}
|
|
3893
|
-
function
|
|
3893
|
+
function fa(t) {
|
|
3894
3894
|
function e(r) {
|
|
3895
3895
|
t.action && t.action(r);
|
|
3896
3896
|
}
|
|
@@ -3907,9 +3907,9 @@ function fc(t) {
|
|
|
3907
3907
|
/* @__PURE__ */ i(Tt, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ i(ri, { editor: t.editor, onSetLink: e }) })
|
|
3908
3908
|
] });
|
|
3909
3909
|
}
|
|
3910
|
-
const
|
|
3910
|
+
const ga = /(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g, pa = /^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;
|
|
3911
3911
|
function lr(t) {
|
|
3912
|
-
return t.match(
|
|
3912
|
+
return t.match(pa);
|
|
3913
3913
|
}
|
|
3914
3914
|
const Ie = yt.create({
|
|
3915
3915
|
name: "twitter",
|
|
@@ -3922,7 +3922,7 @@ const Ie = yt.create({
|
|
|
3922
3922
|
inline: !1,
|
|
3923
3923
|
origin: "",
|
|
3924
3924
|
button: ({ editor: t, t: e }) => ({
|
|
3925
|
-
component:
|
|
3925
|
+
component: fa,
|
|
3926
3926
|
componentProps: {
|
|
3927
3927
|
action: (r) => {
|
|
3928
3928
|
t.commands.setTweet({ src: r });
|
|
@@ -3937,7 +3937,7 @@ const Ie = yt.create({
|
|
|
3937
3937
|
};
|
|
3938
3938
|
},
|
|
3939
3939
|
addNodeView() {
|
|
3940
|
-
return pt(
|
|
3940
|
+
return pt(xa, { attrs: this.options.HTMLAttributes });
|
|
3941
3941
|
},
|
|
3942
3942
|
inline() {
|
|
3943
3943
|
return this.options.inline;
|
|
@@ -3971,7 +3971,7 @@ const Ie = yt.create({
|
|
|
3971
3971
|
addPasteRules() {
|
|
3972
3972
|
return this.options.addPasteHandler ? [
|
|
3973
3973
|
Ti({
|
|
3974
|
-
find:
|
|
3974
|
+
find: ga,
|
|
3975
3975
|
type: this.type,
|
|
3976
3976
|
getAttributes: (t) => ({ src: t.input })
|
|
3977
3977
|
})
|
|
@@ -3980,18 +3980,18 @@ const Ie = yt.create({
|
|
|
3980
3980
|
renderHTML({ HTMLAttributes: t }) {
|
|
3981
3981
|
return ["div", st({ "data-twitter": "" }, t)];
|
|
3982
3982
|
}
|
|
3983
|
-
}),
|
|
3984
|
-
wrapper:
|
|
3985
|
-
tool:
|
|
3986
|
-
active:
|
|
3987
|
-
pen:
|
|
3988
|
-
line:
|
|
3989
|
-
options:
|
|
3990
|
-
colorWrap:
|
|
3991
|
-
color:
|
|
3992
|
-
colorActive:
|
|
3983
|
+
}), wa = "_wrapper_rraz2_1", va = "_tool_rraz2_17", ba = "_active_rraz2_37", ya = "_pen_rraz2_41", Ca = "_line_rraz2_48", Ta = "_options_rraz2_56", Na = "_colorWrap_rraz2_66", ka = "_color_rraz2_66", Sa = "_colorActive_rraz2_83", z = {
|
|
3984
|
+
wrapper: wa,
|
|
3985
|
+
tool: va,
|
|
3986
|
+
active: ba,
|
|
3987
|
+
pen: ya,
|
|
3988
|
+
line: Ca,
|
|
3989
|
+
options: Ta,
|
|
3990
|
+
colorWrap: Na,
|
|
3991
|
+
color: ka,
|
|
3992
|
+
colorActive: Sa
|
|
3993
3993
|
};
|
|
3994
|
-
function
|
|
3994
|
+
function Ma(t) {
|
|
3995
3995
|
return /* @__PURE__ */ i(
|
|
3996
3996
|
"svg",
|
|
3997
3997
|
{
|
|
@@ -4015,7 +4015,7 @@ function Mc(t) {
|
|
|
4015
4015
|
}
|
|
4016
4016
|
);
|
|
4017
4017
|
}
|
|
4018
|
-
function
|
|
4018
|
+
function Aa(t) {
|
|
4019
4019
|
return /* @__PURE__ */ i(
|
|
4020
4020
|
"svg",
|
|
4021
4021
|
{
|
|
@@ -4034,7 +4034,7 @@ function Ac(t) {
|
|
|
4034
4034
|
}
|
|
4035
4035
|
);
|
|
4036
4036
|
}
|
|
4037
|
-
function
|
|
4037
|
+
function La(t) {
|
|
4038
4038
|
return /* @__PURE__ */ i(
|
|
4039
4039
|
"svg",
|
|
4040
4040
|
{
|
|
@@ -4053,7 +4053,7 @@ function Lc(t) {
|
|
|
4053
4053
|
}
|
|
4054
4054
|
);
|
|
4055
4055
|
}
|
|
4056
|
-
function
|
|
4056
|
+
function Ia(t) {
|
|
4057
4057
|
return /* @__PURE__ */ i(
|
|
4058
4058
|
"svg",
|
|
4059
4059
|
{
|
|
@@ -4072,7 +4072,7 @@ function Ic(t) {
|
|
|
4072
4072
|
}
|
|
4073
4073
|
);
|
|
4074
4074
|
}
|
|
4075
|
-
function
|
|
4075
|
+
function Ea(t) {
|
|
4076
4076
|
return /* @__PURE__ */ g(
|
|
4077
4077
|
"svg",
|
|
4078
4078
|
{
|
|
@@ -4100,7 +4100,7 @@ function Ec(t) {
|
|
|
4100
4100
|
}
|
|
4101
4101
|
);
|
|
4102
4102
|
}
|
|
4103
|
-
function
|
|
4103
|
+
function za(t) {
|
|
4104
4104
|
return /* @__PURE__ */ i(
|
|
4105
4105
|
"svg",
|
|
4106
4106
|
{
|
|
@@ -4119,7 +4119,7 @@ function zc(t) {
|
|
|
4119
4119
|
}
|
|
4120
4120
|
);
|
|
4121
4121
|
}
|
|
4122
|
-
function
|
|
4122
|
+
function Pa(t) {
|
|
4123
4123
|
return /* @__PURE__ */ i(
|
|
4124
4124
|
"svg",
|
|
4125
4125
|
{
|
|
@@ -4138,7 +4138,7 @@ function Pc(t) {
|
|
|
4138
4138
|
}
|
|
4139
4139
|
);
|
|
4140
4140
|
}
|
|
4141
|
-
function
|
|
4141
|
+
function Ra(t) {
|
|
4142
4142
|
return /* @__PURE__ */ i(
|
|
4143
4143
|
"svg",
|
|
4144
4144
|
{
|
|
@@ -4157,7 +4157,7 @@ function Rc(t) {
|
|
|
4157
4157
|
}
|
|
4158
4158
|
);
|
|
4159
4159
|
}
|
|
4160
|
-
function
|
|
4160
|
+
function Oa(t) {
|
|
4161
4161
|
return /* @__PURE__ */ i(
|
|
4162
4162
|
"svg",
|
|
4163
4163
|
{
|
|
@@ -4180,7 +4180,7 @@ function Oc(t) {
|
|
|
4180
4180
|
}
|
|
4181
4181
|
);
|
|
4182
4182
|
}
|
|
4183
|
-
function
|
|
4183
|
+
function Ha(t) {
|
|
4184
4184
|
return /* @__PURE__ */ i(
|
|
4185
4185
|
"svg",
|
|
4186
4186
|
{
|
|
@@ -4199,7 +4199,7 @@ function Hc(t) {
|
|
|
4199
4199
|
}
|
|
4200
4200
|
);
|
|
4201
4201
|
}
|
|
4202
|
-
function
|
|
4202
|
+
function Da(t) {
|
|
4203
4203
|
return /* @__PURE__ */ i(
|
|
4204
4204
|
"svg",
|
|
4205
4205
|
{
|
|
@@ -4228,7 +4228,7 @@ function Dc(t) {
|
|
|
4228
4228
|
}
|
|
4229
4229
|
);
|
|
4230
4230
|
}
|
|
4231
|
-
function
|
|
4231
|
+
function _a(t) {
|
|
4232
4232
|
return /* @__PURE__ */ i(
|
|
4233
4233
|
"svg",
|
|
4234
4234
|
{
|
|
@@ -4247,7 +4247,7 @@ function _c(t) {
|
|
|
4247
4247
|
}
|
|
4248
4248
|
);
|
|
4249
4249
|
}
|
|
4250
|
-
function
|
|
4250
|
+
function Ba(t) {
|
|
4251
4251
|
return /* @__PURE__ */ i(
|
|
4252
4252
|
"svg",
|
|
4253
4253
|
{
|
|
@@ -4268,7 +4268,7 @@ function Bc(t) {
|
|
|
4268
4268
|
}
|
|
4269
4269
|
);
|
|
4270
4270
|
}
|
|
4271
|
-
function $
|
|
4271
|
+
function $a(t) {
|
|
4272
4272
|
return /* @__PURE__ */ i(
|
|
4273
4273
|
"svg",
|
|
4274
4274
|
{
|
|
@@ -4289,7 +4289,7 @@ function $c(t) {
|
|
|
4289
4289
|
}
|
|
4290
4290
|
);
|
|
4291
4291
|
}
|
|
4292
|
-
function
|
|
4292
|
+
function Va(t) {
|
|
4293
4293
|
return /* @__PURE__ */ i(
|
|
4294
4294
|
"svg",
|
|
4295
4295
|
{
|
|
@@ -4308,7 +4308,7 @@ function Vc(t) {
|
|
|
4308
4308
|
}
|
|
4309
4309
|
);
|
|
4310
4310
|
}
|
|
4311
|
-
function
|
|
4311
|
+
function Wa(t) {
|
|
4312
4312
|
return /* @__PURE__ */ i(
|
|
4313
4313
|
"svg",
|
|
4314
4314
|
{
|
|
@@ -4327,7 +4327,7 @@ function Wc(t) {
|
|
|
4327
4327
|
}
|
|
4328
4328
|
);
|
|
4329
4329
|
}
|
|
4330
|
-
function
|
|
4330
|
+
function Fa(t) {
|
|
4331
4331
|
return /* @__PURE__ */ i(
|
|
4332
4332
|
"svg",
|
|
4333
4333
|
{
|
|
@@ -4346,7 +4346,7 @@ function Fc(t) {
|
|
|
4346
4346
|
}
|
|
4347
4347
|
);
|
|
4348
4348
|
}
|
|
4349
|
-
function
|
|
4349
|
+
function Ua(t) {
|
|
4350
4350
|
return /* @__PURE__ */ i(
|
|
4351
4351
|
"svg",
|
|
4352
4352
|
{
|
|
@@ -4365,7 +4365,7 @@ function Uc(t) {
|
|
|
4365
4365
|
}
|
|
4366
4366
|
);
|
|
4367
4367
|
}
|
|
4368
|
-
function
|
|
4368
|
+
function Ga(t) {
|
|
4369
4369
|
return /* @__PURE__ */ i(
|
|
4370
4370
|
"svg",
|
|
4371
4371
|
{
|
|
@@ -4384,7 +4384,7 @@ function Gc(t) {
|
|
|
4384
4384
|
}
|
|
4385
4385
|
);
|
|
4386
4386
|
}
|
|
4387
|
-
function
|
|
4387
|
+
function qa(t) {
|
|
4388
4388
|
return /* @__PURE__ */ i(
|
|
4389
4389
|
"svg",
|
|
4390
4390
|
{
|
|
@@ -4405,7 +4405,7 @@ function qc(t) {
|
|
|
4405
4405
|
}
|
|
4406
4406
|
);
|
|
4407
4407
|
}
|
|
4408
|
-
const
|
|
4408
|
+
const ja = [
|
|
4409
4409
|
j.blackHighlight,
|
|
4410
4410
|
j.ofRGBA(166 / 255, 81 / 255, 167 / 255, 0.3),
|
|
4411
4411
|
j.ofRGBA(247 / 255, 78 / 255, 158 / 255, 0.3),
|
|
@@ -4429,9 +4429,9 @@ const jc = [
|
|
|
4429
4429
|
j.fromHex("#FFFB85"),
|
|
4430
4430
|
j.fromHex("#AADC99")
|
|
4431
4431
|
];
|
|
4432
|
-
function
|
|
4432
|
+
function Xa({ onChange: t }) {
|
|
4433
4433
|
const [e, r] = S(j.blackHighlight);
|
|
4434
|
-
return /* @__PURE__ */ i("div", { className: z.colorWrap, children:
|
|
4434
|
+
return /* @__PURE__ */ i("div", { className: z.colorWrap, children: ja.map((n, c) => /* @__PURE__ */ i(
|
|
4435
4435
|
"button",
|
|
4436
4436
|
{
|
|
4437
4437
|
style: { backgroundColor: n.toHexString() },
|
|
@@ -4442,13 +4442,13 @@ function Xc({ onChange: t }) {
|
|
|
4442
4442
|
r(n), t(n);
|
|
4443
4443
|
}
|
|
4444
4444
|
},
|
|
4445
|
-
|
|
4445
|
+
c
|
|
4446
4446
|
)) });
|
|
4447
4447
|
}
|
|
4448
4448
|
function Ee({ onChange: t }) {
|
|
4449
4449
|
const [e, r] = S(j.black);
|
|
4450
4450
|
return /* @__PURE__ */ g(V, { children: [
|
|
4451
|
-
/* @__PURE__ */ i("div", { className: z.colorWrap, children: dr.slice(0, 7).map((n,
|
|
4451
|
+
/* @__PURE__ */ i("div", { className: z.colorWrap, children: dr.slice(0, 7).map((n, c) => /* @__PURE__ */ i(
|
|
4452
4452
|
"button",
|
|
4453
4453
|
{
|
|
4454
4454
|
style: { backgroundColor: n.toHexString() },
|
|
@@ -4459,9 +4459,9 @@ function Ee({ onChange: t }) {
|
|
|
4459
4459
|
r(n), t(n);
|
|
4460
4460
|
}
|
|
4461
4461
|
},
|
|
4462
|
-
|
|
4462
|
+
c
|
|
4463
4463
|
)) }),
|
|
4464
|
-
/* @__PURE__ */ i("div", { className: z.colorWrap, children: dr.slice(7).map((n,
|
|
4464
|
+
/* @__PURE__ */ i("div", { className: z.colorWrap, children: dr.slice(7).map((n, c) => /* @__PURE__ */ i(
|
|
4465
4465
|
"button",
|
|
4466
4466
|
{
|
|
4467
4467
|
style: { backgroundColor: n.toHexString() },
|
|
@@ -4472,17 +4472,17 @@ function Ee({ onChange: t }) {
|
|
|
4472
4472
|
r(n), t(n);
|
|
4473
4473
|
}
|
|
4474
4474
|
},
|
|
4475
|
-
|
|
4475
|
+
c
|
|
4476
4476
|
)) })
|
|
4477
4477
|
] });
|
|
4478
4478
|
}
|
|
4479
|
-
function
|
|
4479
|
+
function Ya({ setColorPen: t, setThicknessPen: e }) {
|
|
4480
4480
|
const [r, n] = S(2);
|
|
4481
4481
|
return /* @__PURE__ */ g("div", { className: z.options, children: [
|
|
4482
4482
|
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
4483
4483
|
Ee,
|
|
4484
4484
|
{
|
|
4485
|
-
onChange: (
|
|
4485
|
+
onChange: (c) => t(c)
|
|
4486
4486
|
}
|
|
4487
4487
|
) }),
|
|
4488
4488
|
/* @__PURE__ */ i("div", { className: z.line }),
|
|
@@ -4494,22 +4494,22 @@ function Yc({ setColorPen: t, setThicknessPen: e }) {
|
|
|
4494
4494
|
step: 0.1,
|
|
4495
4495
|
type: "range",
|
|
4496
4496
|
value: r,
|
|
4497
|
-
onChange: (
|
|
4498
|
-
e(Number.parseFloat(
|
|
4497
|
+
onChange: (c) => {
|
|
4498
|
+
e(Number.parseFloat(c.target.value)), n(Number.parseFloat(c.target.value));
|
|
4499
4499
|
}
|
|
4500
4500
|
}
|
|
4501
4501
|
) })
|
|
4502
4502
|
] });
|
|
4503
4503
|
}
|
|
4504
|
-
function
|
|
4504
|
+
function Ka({ setColorHighlight: t }) {
|
|
4505
4505
|
return /* @__PURE__ */ i("div", { className: z.options, children: /* @__PURE__ */ i(
|
|
4506
|
-
|
|
4506
|
+
Xa,
|
|
4507
4507
|
{
|
|
4508
4508
|
onChange: (e) => t(e)
|
|
4509
4509
|
}
|
|
4510
4510
|
) });
|
|
4511
4511
|
}
|
|
4512
|
-
function
|
|
4512
|
+
function Za({
|
|
4513
4513
|
changeColorShape: t,
|
|
4514
4514
|
changeBorderColorShape: e,
|
|
4515
4515
|
onThicknessChange: r
|
|
@@ -4549,9 +4549,9 @@ function ii(t) {
|
|
|
4549
4549
|
setColorPen: e,
|
|
4550
4550
|
refEditor: r,
|
|
4551
4551
|
setThicknessPen: n,
|
|
4552
|
-
setColorHighlight:
|
|
4552
|
+
setColorHighlight: c,
|
|
4553
4553
|
changeBorderColorShape: o,
|
|
4554
|
-
onUndo:
|
|
4554
|
+
onUndo: a,
|
|
4555
4555
|
changeColorShape: l,
|
|
4556
4556
|
changeShape: s,
|
|
4557
4557
|
onThicknessChange: h,
|
|
@@ -4581,7 +4581,7 @@ function ii(t) {
|
|
|
4581
4581
|
}
|
|
4582
4582
|
x("select"), f[0].setEnabled(!0);
|
|
4583
4583
|
},
|
|
4584
|
-
children: /* @__PURE__ */ i(
|
|
4584
|
+
children: /* @__PURE__ */ i(Ma, {})
|
|
4585
4585
|
}
|
|
4586
4586
|
),
|
|
4587
4587
|
/* @__PURE__ */ i("div", { className: z.line }),
|
|
@@ -4599,7 +4599,7 @@ function ii(t) {
|
|
|
4599
4599
|
}
|
|
4600
4600
|
x("text"), f[1].setEnabled(!0);
|
|
4601
4601
|
},
|
|
4602
|
-
children: /* @__PURE__ */ i(
|
|
4602
|
+
children: /* @__PURE__ */ i(Aa, {})
|
|
4603
4603
|
}
|
|
4604
4604
|
),
|
|
4605
4605
|
/* @__PURE__ */ i("div", { className: z.line }),
|
|
@@ -4617,7 +4617,7 @@ function ii(t) {
|
|
|
4617
4617
|
}
|
|
4618
4618
|
x("pencil"), f[2].setEnabled(!0);
|
|
4619
4619
|
},
|
|
4620
|
-
children: /* @__PURE__ */ i(
|
|
4620
|
+
children: /* @__PURE__ */ i(La, {})
|
|
4621
4621
|
}
|
|
4622
4622
|
),
|
|
4623
4623
|
/* @__PURE__ */ i(
|
|
@@ -4634,7 +4634,7 @@ function ii(t) {
|
|
|
4634
4634
|
}
|
|
4635
4635
|
x("highlighter"), f[3].setEnabled(!0);
|
|
4636
4636
|
},
|
|
4637
|
-
children: /* @__PURE__ */ i(
|
|
4637
|
+
children: /* @__PURE__ */ i(Ia, {})
|
|
4638
4638
|
}
|
|
4639
4639
|
),
|
|
4640
4640
|
/* @__PURE__ */ i("div", { className: z.line }),
|
|
@@ -4652,7 +4652,7 @@ function ii(t) {
|
|
|
4652
4652
|
}
|
|
4653
4653
|
x("eraser"), f[4].setEnabled(!0);
|
|
4654
4654
|
},
|
|
4655
|
-
children: /* @__PURE__ */ i(
|
|
4655
|
+
children: /* @__PURE__ */ i(Ea, {})
|
|
4656
4656
|
}
|
|
4657
4657
|
),
|
|
4658
4658
|
/* @__PURE__ */ i("div", { className: z.line }),
|
|
@@ -4673,7 +4673,7 @@ function ii(t) {
|
|
|
4673
4673
|
/* square */
|
|
4674
4674
|
);
|
|
4675
4675
|
},
|
|
4676
|
-
children: /* @__PURE__ */ i(
|
|
4676
|
+
children: /* @__PURE__ */ i(za, {})
|
|
4677
4677
|
}
|
|
4678
4678
|
),
|
|
4679
4679
|
/* @__PURE__ */ i(
|
|
@@ -4693,7 +4693,7 @@ function ii(t) {
|
|
|
4693
4693
|
/* rectangle */
|
|
4694
4694
|
);
|
|
4695
4695
|
},
|
|
4696
|
-
children: /* @__PURE__ */ i(
|
|
4696
|
+
children: /* @__PURE__ */ i(Pa, {})
|
|
4697
4697
|
}
|
|
4698
4698
|
),
|
|
4699
4699
|
/* @__PURE__ */ i(
|
|
@@ -4713,7 +4713,7 @@ function ii(t) {
|
|
|
4713
4713
|
/* circle */
|
|
4714
4714
|
);
|
|
4715
4715
|
},
|
|
4716
|
-
children: /* @__PURE__ */ i(
|
|
4716
|
+
children: /* @__PURE__ */ i(Ra, {})
|
|
4717
4717
|
}
|
|
4718
4718
|
),
|
|
4719
4719
|
/* @__PURE__ */ i(
|
|
@@ -4733,7 +4733,7 @@ function ii(t) {
|
|
|
4733
4733
|
/* triangle */
|
|
4734
4734
|
);
|
|
4735
4735
|
},
|
|
4736
|
-
children: /* @__PURE__ */ i(
|
|
4736
|
+
children: /* @__PURE__ */ i(Oa, {})
|
|
4737
4737
|
}
|
|
4738
4738
|
),
|
|
4739
4739
|
/* @__PURE__ */ i(
|
|
@@ -4753,7 +4753,7 @@ function ii(t) {
|
|
|
4753
4753
|
/* hexagonal */
|
|
4754
4754
|
);
|
|
4755
4755
|
},
|
|
4756
|
-
children: /* @__PURE__ */ i(
|
|
4756
|
+
children: /* @__PURE__ */ i(Ha, {})
|
|
4757
4757
|
}
|
|
4758
4758
|
),
|
|
4759
4759
|
/* @__PURE__ */ i(
|
|
@@ -4773,7 +4773,7 @@ function ii(t) {
|
|
|
4773
4773
|
/* diamond */
|
|
4774
4774
|
);
|
|
4775
4775
|
},
|
|
4776
|
-
children: /* @__PURE__ */ i(
|
|
4776
|
+
children: /* @__PURE__ */ i(Da, {})
|
|
4777
4777
|
}
|
|
4778
4778
|
),
|
|
4779
4779
|
/* @__PURE__ */ i(
|
|
@@ -4793,7 +4793,7 @@ function ii(t) {
|
|
|
4793
4793
|
/* arrow */
|
|
4794
4794
|
);
|
|
4795
4795
|
},
|
|
4796
|
-
children: /* @__PURE__ */ i(
|
|
4796
|
+
children: /* @__PURE__ */ i(_a, {})
|
|
4797
4797
|
}
|
|
4798
4798
|
),
|
|
4799
4799
|
/* @__PURE__ */ i(
|
|
@@ -4813,7 +4813,7 @@ function ii(t) {
|
|
|
4813
4813
|
/* line */
|
|
4814
4814
|
);
|
|
4815
4815
|
},
|
|
4816
|
-
children: /* @__PURE__ */ i(
|
|
4816
|
+
children: /* @__PURE__ */ i(Wa, {})
|
|
4817
4817
|
}
|
|
4818
4818
|
),
|
|
4819
4819
|
/* @__PURE__ */ i(
|
|
@@ -4833,7 +4833,7 @@ function ii(t) {
|
|
|
4833
4833
|
/* heart */
|
|
4834
4834
|
);
|
|
4835
4835
|
},
|
|
4836
|
-
children: /* @__PURE__ */ i(
|
|
4836
|
+
children: /* @__PURE__ */ i(Fa, {})
|
|
4837
4837
|
}
|
|
4838
4838
|
),
|
|
4839
4839
|
/* @__PURE__ */ i(
|
|
@@ -4853,7 +4853,7 @@ function ii(t) {
|
|
|
4853
4853
|
/* star */
|
|
4854
4854
|
);
|
|
4855
4855
|
},
|
|
4856
|
-
children: /* @__PURE__ */ i(
|
|
4856
|
+
children: /* @__PURE__ */ i(Ua, {})
|
|
4857
4857
|
}
|
|
4858
4858
|
),
|
|
4859
4859
|
/* @__PURE__ */ i(
|
|
@@ -4873,7 +4873,7 @@ function ii(t) {
|
|
|
4873
4873
|
/* cloud */
|
|
4874
4874
|
);
|
|
4875
4875
|
},
|
|
4876
|
-
children: /* @__PURE__ */ i(
|
|
4876
|
+
children: /* @__PURE__ */ i(Ga, {})
|
|
4877
4877
|
}
|
|
4878
4878
|
),
|
|
4879
4879
|
/* @__PURE__ */ i(
|
|
@@ -4893,7 +4893,7 @@ function ii(t) {
|
|
|
4893
4893
|
/* parallelogram */
|
|
4894
4894
|
);
|
|
4895
4895
|
},
|
|
4896
|
-
children: /* @__PURE__ */ i(
|
|
4896
|
+
children: /* @__PURE__ */ i(qa, {})
|
|
4897
4897
|
}
|
|
4898
4898
|
),
|
|
4899
4899
|
/* @__PURE__ */ i("div", { className: z.line }),
|
|
@@ -4901,8 +4901,8 @@ function ii(t) {
|
|
|
4901
4901
|
"button",
|
|
4902
4902
|
{
|
|
4903
4903
|
className: P(z.tool),
|
|
4904
|
-
onClick:
|
|
4905
|
-
children: /* @__PURE__ */ i(
|
|
4904
|
+
onClick: a,
|
|
4905
|
+
children: /* @__PURE__ */ i(Ba, {})
|
|
4906
4906
|
}
|
|
4907
4907
|
),
|
|
4908
4908
|
/* @__PURE__ */ i(
|
|
@@ -4910,7 +4910,7 @@ function ii(t) {
|
|
|
4910
4910
|
{
|
|
4911
4911
|
className: P(z.tool),
|
|
4912
4912
|
onClick: d,
|
|
4913
|
-
children: /* @__PURE__ */ i($
|
|
4913
|
+
children: /* @__PURE__ */ i($a, {})
|
|
4914
4914
|
}
|
|
4915
4915
|
),
|
|
4916
4916
|
/* @__PURE__ */ i(
|
|
@@ -4918,21 +4918,21 @@ function ii(t) {
|
|
|
4918
4918
|
{
|
|
4919
4919
|
className: P(z.tool),
|
|
4920
4920
|
onClick: u,
|
|
4921
|
-
children: /* @__PURE__ */ i(
|
|
4921
|
+
children: /* @__PURE__ */ i(Va, {})
|
|
4922
4922
|
}
|
|
4923
4923
|
)
|
|
4924
4924
|
] }),
|
|
4925
4925
|
/* @__PURE__ */ g("div", { className: z.optionsWrap, children: [
|
|
4926
4926
|
m === "pencil" && /* @__PURE__ */ i(
|
|
4927
|
-
|
|
4927
|
+
Ya,
|
|
4928
4928
|
{
|
|
4929
4929
|
setColorPen: e,
|
|
4930
4930
|
setThicknessPen: n
|
|
4931
4931
|
}
|
|
4932
4932
|
),
|
|
4933
|
-
m === "highlighter" && /* @__PURE__ */ i(
|
|
4933
|
+
m === "highlighter" && /* @__PURE__ */ i(Ka, { setColorHighlight: c }),
|
|
4934
4934
|
m === "shapes" && /* @__PURE__ */ i(
|
|
4935
|
-
|
|
4935
|
+
Za,
|
|
4936
4936
|
{
|
|
4937
4937
|
changeBorderColorShape: o,
|
|
4938
4938
|
changeColorShape: l,
|
|
@@ -4946,24 +4946,24 @@ function ii(t) {
|
|
|
4946
4946
|
) });
|
|
4947
4947
|
}
|
|
4948
4948
|
let Rt = !1;
|
|
4949
|
-
const
|
|
4950
|
-
const [r, n] = S(!1),
|
|
4949
|
+
const Ja = ({ editor: t, upload: e }) => {
|
|
4950
|
+
const [r, n] = S(!1), c = J(null), o = J(null), a = () => {
|
|
4951
4951
|
(async () => {
|
|
4952
4952
|
const v = document.querySelector("#easydrawer");
|
|
4953
|
-
v && (
|
|
4953
|
+
v && (c.current = new Lr(v, {
|
|
4954
4954
|
wheelEventsEnabled: !1,
|
|
4955
4955
|
disableZoom: !0
|
|
4956
|
-
}), o.current = Ir(
|
|
4956
|
+
}), o.current = Ir(c.current), o.current.addDefaultToolWidgets());
|
|
4957
4957
|
})();
|
|
4958
4958
|
};
|
|
4959
4959
|
B(() => {
|
|
4960
4960
|
r && setTimeout(() => {
|
|
4961
|
-
|
|
4961
|
+
a();
|
|
4962
4962
|
}, 200);
|
|
4963
4963
|
}, [r]);
|
|
4964
4964
|
const l = async () => {
|
|
4965
|
-
if (
|
|
4966
|
-
const T =
|
|
4965
|
+
if (c.current) {
|
|
4966
|
+
const T = c.current.toSVG(), v = T.outerHTML, y = `drawer-${fe()}.svg`;
|
|
4967
4967
|
let C = me(T.outerHTML);
|
|
4968
4968
|
if (e) {
|
|
4969
4969
|
const M = qt(C, y);
|
|
@@ -4982,34 +4982,34 @@ const Jc = ({ editor: t, upload: e }) => {
|
|
|
4982
4982
|
}
|
|
4983
4983
|
n(!1);
|
|
4984
4984
|
}, s = (T) => {
|
|
4985
|
-
const v =
|
|
4985
|
+
const v = c.current.toolController.getPrimaryTools()[2], y = o.current.getWidgetById("pen-1");
|
|
4986
4986
|
v && y && (v.setColor(T), y.serializeState());
|
|
4987
4987
|
}, h = (T) => {
|
|
4988
|
-
const v =
|
|
4988
|
+
const v = c.current.toolController.getPrimaryTools()[2], y = o.current.getWidgetById("pen-1");
|
|
4989
4989
|
v && y && (v.setThickness(T), y.serializeState());
|
|
4990
4990
|
}, d = (T) => {
|
|
4991
|
-
const v =
|
|
4991
|
+
const v = c.current.toolController.getPrimaryTools()[3], y = o.current.getWidgetById("pen-2");
|
|
4992
4992
|
v && y && (v.setColor(T), y.serializeState());
|
|
4993
4993
|
}, u = (T) => {
|
|
4994
4994
|
const v = o.current.getWidgetById("shape");
|
|
4995
4995
|
v && v.setShapeType(T);
|
|
4996
4996
|
}, m = (T) => {
|
|
4997
|
-
const v =
|
|
4997
|
+
const v = c.current.toolController.getPrimaryTools()[5], y = o.current.getWidgetById("shape");
|
|
4998
4998
|
v && y && (v.setColor(T), y.serializeState());
|
|
4999
4999
|
}, x = (T) => {
|
|
5000
|
-
const v =
|
|
5000
|
+
const v = c.current.toolController.getPrimaryTools()[5], y = o.current.getWidgetById("shape");
|
|
5001
5001
|
v && y && (v.setThickness(T), y.serializeState());
|
|
5002
5002
|
}, w = (T) => {
|
|
5003
|
-
const v =
|
|
5003
|
+
const v = c.current.toolController.getPrimaryTools()[5], y = o.current.getWidgetById("shape");
|
|
5004
5004
|
v && y && (v.setBorderColor(T), y.serializeState());
|
|
5005
5005
|
}, p = () => {
|
|
5006
5006
|
if (Rt) {
|
|
5007
|
-
for (;
|
|
5008
|
-
|
|
5007
|
+
for (; c.current.history.redoStackSize > 0; )
|
|
5008
|
+
c.current.history.redo();
|
|
5009
5009
|
Rt = !1;
|
|
5010
5010
|
return;
|
|
5011
5011
|
}
|
|
5012
|
-
|
|
5012
|
+
c.current.history.undo();
|
|
5013
5013
|
};
|
|
5014
5014
|
return /* @__PURE__ */ g(
|
|
5015
5015
|
ut,
|
|
@@ -5043,17 +5043,17 @@ const Jc = ({ editor: t, upload: e }) => {
|
|
|
5043
5043
|
changeShape: u,
|
|
5044
5044
|
onClear: () => {
|
|
5045
5045
|
if (!Rt) {
|
|
5046
|
-
for (;
|
|
5046
|
+
for (; c.current.history.undoStackSize > 0; )
|
|
5047
5047
|
p();
|
|
5048
5048
|
Rt = !0;
|
|
5049
5049
|
}
|
|
5050
5050
|
},
|
|
5051
5051
|
onRedo: () => {
|
|
5052
|
-
Rt ||
|
|
5052
|
+
Rt || c.current.history.redo();
|
|
5053
5053
|
},
|
|
5054
5054
|
onThicknessChange: x,
|
|
5055
5055
|
onUndo: p,
|
|
5056
|
-
refEditor:
|
|
5056
|
+
refEditor: c,
|
|
5057
5057
|
setColorHighlight: d,
|
|
5058
5058
|
setColorPen: s,
|
|
5059
5059
|
setThicknessPen: h
|
|
@@ -5078,8 +5078,8 @@ const Jc = ({ editor: t, upload: e }) => {
|
|
|
5078
5078
|
BOTTOM_LEFT: "bl",
|
|
5079
5079
|
BOTTOM_RIGHT: "br"
|
|
5080
5080
|
};
|
|
5081
|
-
function
|
|
5082
|
-
const [o,
|
|
5081
|
+
function Qa({ editor: t, node: e, updateAttributes: r, getPos: n, selected: c }) {
|
|
5082
|
+
const [o, a] = S({
|
|
5083
5083
|
width: xt,
|
|
5084
5084
|
height: xt
|
|
5085
5085
|
}), [l, s] = S({
|
|
@@ -5124,7 +5124,7 @@ function Qc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
5124
5124
|
const v = H(
|
|
5125
5125
|
ht(() => {
|
|
5126
5126
|
const { width: b } = getComputedStyle(t.view.dom);
|
|
5127
|
-
|
|
5127
|
+
a((k) => ({
|
|
5128
5128
|
...k,
|
|
5129
5129
|
width: Number.parseInt(b, 10)
|
|
5130
5130
|
}));
|
|
@@ -5188,7 +5188,7 @@ function Qc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
5188
5188
|
"data-drag-handle": !0,
|
|
5189
5189
|
draggable: "true",
|
|
5190
5190
|
style: { ...f, background: "#fff" },
|
|
5191
|
-
className: `image-view__body ${
|
|
5191
|
+
className: `image-view__body ${c ? "image-view__body--focused" : ""} ${d ? "image-view__body--resizing" : ""}`,
|
|
5192
5192
|
children: [
|
|
5193
5193
|
/* @__PURE__ */ i(
|
|
5194
5194
|
"img",
|
|
@@ -5202,7 +5202,7 @@ function Qc({ editor: t, node: e, updateAttributes: r, getPos: n, selected: a })
|
|
|
5202
5202
|
style: p.style
|
|
5203
5203
|
}
|
|
5204
5204
|
),
|
|
5205
|
-
t.view.editable && (
|
|
5205
|
+
t.view.editable && (c || d) && /* @__PURE__ */ i("div", { className: "image-resizer", children: h == null ? void 0 : h.map((b) => /* @__PURE__ */ i(
|
|
5206
5206
|
"span",
|
|
5207
5207
|
{
|
|
5208
5208
|
className: `image-resizer__handler image-resizer__handler--${b}`,
|
|
@@ -5233,9 +5233,9 @@ const hr = de.extend({
|
|
|
5233
5233
|
class: "drawer"
|
|
5234
5234
|
},
|
|
5235
5235
|
button: ({ editor: e, t: r, extension: n }) => {
|
|
5236
|
-
var
|
|
5236
|
+
var c;
|
|
5237
5237
|
return {
|
|
5238
|
-
component:
|
|
5238
|
+
component: Ja,
|
|
5239
5239
|
componentProps: {
|
|
5240
5240
|
action: () => !0,
|
|
5241
5241
|
isActive: () => !1,
|
|
@@ -5243,7 +5243,7 @@ const hr = de.extend({
|
|
|
5243
5243
|
editor: e,
|
|
5244
5244
|
icon: "PencilRuler",
|
|
5245
5245
|
tooltip: r("editor.drawer.tooltip"),
|
|
5246
|
-
upload: (
|
|
5246
|
+
upload: (c = n == null ? void 0 : n.options) == null ? void 0 : c.upload
|
|
5247
5247
|
}
|
|
5248
5248
|
};
|
|
5249
5249
|
}
|
|
@@ -5283,7 +5283,7 @@ const hr = de.extend({
|
|
|
5283
5283
|
};
|
|
5284
5284
|
},
|
|
5285
5285
|
addNodeView() {
|
|
5286
|
-
return pt(
|
|
5286
|
+
return pt(Qa);
|
|
5287
5287
|
},
|
|
5288
5288
|
// @ts-ignore
|
|
5289
5289
|
addCommands() {
|
|
@@ -5337,13 +5337,13 @@ const hr = de.extend({
|
|
|
5337
5337
|
});
|
|
5338
5338
|
let Ot = !1;
|
|
5339
5339
|
function ts({ editor: t, attrs: e, extension: r }) {
|
|
5340
|
-
const [n,
|
|
5340
|
+
const [n, c] = S(!1), o = J(null), a = J(null), { alt: l, align: s } = e, h = r == null ? void 0 : r.options.upload, d = () => {
|
|
5341
5341
|
(async () => {
|
|
5342
5342
|
const L = document.querySelector("#easydrawer");
|
|
5343
5343
|
L && (o.current = new Lr(L, {
|
|
5344
5344
|
wheelEventsEnabled: !1,
|
|
5345
5345
|
disableZoom: !0
|
|
5346
|
-
}),
|
|
5346
|
+
}), a.current = Ir(o.current), a.current.addDefaultToolWidgets(), o.current.loadFromSVG(decodeURIComponent(l)));
|
|
5347
5347
|
})();
|
|
5348
5348
|
};
|
|
5349
5349
|
B(() => {
|
|
@@ -5370,27 +5370,27 @@ function ts({ editor: t, attrs: e, extension: r }) {
|
|
|
5370
5370
|
!!L
|
|
5371
5371
|
).run(), t == null || t.commands.setAlignImageDrawer(s);
|
|
5372
5372
|
}
|
|
5373
|
-
|
|
5373
|
+
c(!1);
|
|
5374
5374
|
}, m = (M) => {
|
|
5375
|
-
const L = o.current.toolController.getPrimaryTools()[2], N =
|
|
5375
|
+
const L = o.current.toolController.getPrimaryTools()[2], N = a.current.getWidgetById("pen-1");
|
|
5376
5376
|
L && N && (L.setColor(M), N.serializeState());
|
|
5377
5377
|
}, x = (M) => {
|
|
5378
|
-
const L = o.current.toolController.getPrimaryTools()[2], N =
|
|
5378
|
+
const L = o.current.toolController.getPrimaryTools()[2], N = a.current.getWidgetById("pen-1");
|
|
5379
5379
|
L && N && (L.setThickness(M), N.serializeState());
|
|
5380
5380
|
}, w = (M) => {
|
|
5381
|
-
const L = o.current.toolController.getPrimaryTools()[3], N =
|
|
5381
|
+
const L = o.current.toolController.getPrimaryTools()[3], N = a.current.getWidgetById("pen-2");
|
|
5382
5382
|
L && N && (L.setColor(M), N.serializeState());
|
|
5383
5383
|
}, p = (M) => {
|
|
5384
|
-
const L =
|
|
5384
|
+
const L = a.current.getWidgetById("shape");
|
|
5385
5385
|
L && L.setShapeType(M);
|
|
5386
5386
|
}, f = (M) => {
|
|
5387
|
-
const L = o.current.toolController.getPrimaryTools()[5], N =
|
|
5387
|
+
const L = o.current.toolController.getPrimaryTools()[5], N = a.current.getWidgetById("shape");
|
|
5388
5388
|
L && N && (L.setColor(M), N.serializeState());
|
|
5389
5389
|
}, I = (M) => {
|
|
5390
|
-
const L = o.current.toolController.getPrimaryTools()[5], N =
|
|
5390
|
+
const L = o.current.toolController.getPrimaryTools()[5], N = a.current.getWidgetById("shape");
|
|
5391
5391
|
L && N && (L.setThickness(M), N.serializeState());
|
|
5392
5392
|
}, T = (M) => {
|
|
5393
|
-
const L = o.current.toolController.getPrimaryTools()[5], N =
|
|
5393
|
+
const L = o.current.toolController.getPrimaryTools()[5], N = a.current.getWidgetById("shape");
|
|
5394
5394
|
L && N && (L.setBorderColor(M), N.serializeState());
|
|
5395
5395
|
}, v = () => {
|
|
5396
5396
|
if (Ot) {
|
|
@@ -5404,13 +5404,13 @@ function ts({ editor: t, attrs: e, extension: r }) {
|
|
|
5404
5404
|
return /* @__PURE__ */ g(
|
|
5405
5405
|
ut,
|
|
5406
5406
|
{
|
|
5407
|
-
onOpenChange:
|
|
5407
|
+
onOpenChange: c,
|
|
5408
5408
|
open: n,
|
|
5409
5409
|
children: [
|
|
5410
5410
|
/* @__PURE__ */ i(mt, { asChild: !0, children: /* @__PURE__ */ i(
|
|
5411
5411
|
O,
|
|
5412
5412
|
{
|
|
5413
|
-
action: () =>
|
|
5413
|
+
action: () => c(!0),
|
|
5414
5414
|
icon: "Pencil",
|
|
5415
5415
|
tooltip: "Edit Drawer"
|
|
5416
5416
|
}
|
|
@@ -5466,12 +5466,12 @@ function ts({ editor: t, attrs: e, extension: r }) {
|
|
|
5466
5466
|
function ni(t, e) {
|
|
5467
5467
|
const [r, n] = S(void 0);
|
|
5468
5468
|
return B(() => {
|
|
5469
|
-
const
|
|
5470
|
-
const o = t.extensionManager.extensions.find((
|
|
5469
|
+
const c = () => {
|
|
5470
|
+
const o = t.extensionManager.extensions.find((a) => a.name === e);
|
|
5471
5471
|
o && n(o);
|
|
5472
5472
|
};
|
|
5473
|
-
return t.on("selectionUpdate",
|
|
5474
|
-
t.off("selectionUpdate",
|
|
5473
|
+
return t.on("selectionUpdate", c), t.on("transaction", c), () => {
|
|
5474
|
+
t.off("selectionUpdate", c), t.off("transaction", c);
|
|
5475
5475
|
};
|
|
5476
5476
|
}, [t, e]), r;
|
|
5477
5477
|
}
|
|
@@ -5482,7 +5482,7 @@ const es = {
|
|
|
5482
5482
|
moveTransition: "transform 0.1s ease-out"
|
|
5483
5483
|
};
|
|
5484
5484
|
function rs({ item: t, disabled: e, editor: r }) {
|
|
5485
|
-
var
|
|
5485
|
+
var c;
|
|
5486
5486
|
const n = t.component;
|
|
5487
5487
|
return n ? /* @__PURE__ */ i(Pe, { children: t.type === "divider" ? /* @__PURE__ */ i(
|
|
5488
5488
|
rt,
|
|
@@ -5494,7 +5494,7 @@ function rs({ item: t, disabled: e, editor: r }) {
|
|
|
5494
5494
|
n,
|
|
5495
5495
|
{
|
|
5496
5496
|
...t.componentProps,
|
|
5497
|
-
disabled: e || ((
|
|
5497
|
+
disabled: e || ((c = t == null ? void 0 : t.componentProps) == null ? void 0 : c.disabled),
|
|
5498
5498
|
editor: r
|
|
5499
5499
|
}
|
|
5500
5500
|
) }) : /* @__PURE__ */ i(V, {});
|
|
@@ -5503,10 +5503,10 @@ function is(t) {
|
|
|
5503
5503
|
return t.type.name === "drawer";
|
|
5504
5504
|
}
|
|
5505
5505
|
function ns(t) {
|
|
5506
|
-
const { lang: e } = q(), r = zt(t.editor, hr.name), n = ni(t.editor, hr.name),
|
|
5507
|
-
const { selection: l } =
|
|
5506
|
+
const { lang: e } = q(), r = zt(t.editor, hr.name), n = ni(t.editor, hr.name), c = ({ editor: a }) => {
|
|
5507
|
+
const { selection: l } = a.view.state, { $from: s, to: h } = l;
|
|
5508
5508
|
let d = !1;
|
|
5509
|
-
return
|
|
5509
|
+
return a.view.state.doc.nodesBetween(s.pos, h, (u) => {
|
|
5510
5510
|
if (is(u))
|
|
5511
5511
|
return d = !0, !1;
|
|
5512
5512
|
}), d;
|
|
@@ -5515,9 +5515,9 @@ function ns(t) {
|
|
|
5515
5515
|
tt,
|
|
5516
5516
|
{
|
|
5517
5517
|
editor: t == null ? void 0 : t.editor,
|
|
5518
|
-
shouldShow:
|
|
5518
|
+
shouldShow: c,
|
|
5519
5519
|
tippyOptions: es,
|
|
5520
|
-
children: o != null && o.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: o == null ? void 0 : o.map((
|
|
5520
|
+
children: o != null && o.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: o == null ? void 0 : o.map((a, l) => a.type === "edit" && (r != null && r.src) ? /* @__PURE__ */ i(
|
|
5521
5521
|
ts,
|
|
5522
5522
|
{
|
|
5523
5523
|
attrs: r,
|
|
@@ -5530,15 +5530,15 @@ function ns(t) {
|
|
|
5530
5530
|
{
|
|
5531
5531
|
disabled: t.disabled,
|
|
5532
5532
|
editor: t.editor,
|
|
5533
|
-
item:
|
|
5533
|
+
item: a
|
|
5534
5534
|
},
|
|
5535
5535
|
`bubbleMenu-drawer-${l}`
|
|
5536
5536
|
)) }) }) : /* @__PURE__ */ i(V, {})
|
|
5537
5537
|
}
|
|
5538
5538
|
) });
|
|
5539
5539
|
}
|
|
5540
|
-
const os = { padding: "0 12px 12px" }, oi = ({ width: t, maxWidth: e, height: r, onOk: n, children:
|
|
5541
|
-
const { t: o } = q(), [
|
|
5540
|
+
const os = { padding: "0 12px 12px" }, oi = ({ width: t, maxWidth: e, height: r, onOk: n, children: c }) => {
|
|
5541
|
+
const { t: o } = q(), [a, l] = S({
|
|
5542
5542
|
width: "",
|
|
5543
5543
|
height: "",
|
|
5544
5544
|
maxWidth: ""
|
|
@@ -5551,72 +5551,72 @@ const os = { padding: "0 12px 12px" }, oi = ({ width: t, maxWidth: e, height: r,
|
|
|
5551
5551
|
});
|
|
5552
5552
|
}, [r, e, t]);
|
|
5553
5553
|
function s(h) {
|
|
5554
|
-
h.preventDefault(), h.stopPropagation(), n(
|
|
5554
|
+
h.preventDefault(), h.stopPropagation(), n(a);
|
|
5555
5555
|
}
|
|
5556
5556
|
return /* @__PURE__ */ g(It, { modal: !0, children: [
|
|
5557
|
-
/* @__PURE__ */ i(Et, { asChild: !0, children:
|
|
5557
|
+
/* @__PURE__ */ i(Et, { asChild: !0, children: c }),
|
|
5558
5558
|
/* @__PURE__ */ i(Tt, { children: /* @__PURE__ */ i("div", { style: os, children: /* @__PURE__ */ g("form", { className: "richtext-flex richtext-flex-col richtext-gap-2", onSubmit: s, children: [
|
|
5559
|
-
/* @__PURE__ */ i(
|
|
5559
|
+
/* @__PURE__ */ i(at, { className: "mb-[6px]", children: "Width" }),
|
|
5560
5560
|
/* @__PURE__ */ i("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ i(
|
|
5561
5561
|
Q,
|
|
5562
5562
|
{
|
|
5563
5563
|
type: "number",
|
|
5564
|
-
value:
|
|
5564
|
+
value: a.width,
|
|
5565
5565
|
required: !0,
|
|
5566
|
-
onChange: (h) => l({ ...
|
|
5566
|
+
onChange: (h) => l({ ...a, width: h.target.value })
|
|
5567
5567
|
}
|
|
5568
5568
|
) }) }),
|
|
5569
|
-
/* @__PURE__ */ i(
|
|
5569
|
+
/* @__PURE__ */ i(at, { className: "mb-[6px]", children: "Max Width" }),
|
|
5570
5570
|
/* @__PURE__ */ i("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ i(
|
|
5571
5571
|
Q,
|
|
5572
5572
|
{
|
|
5573
5573
|
type: "number",
|
|
5574
|
-
value:
|
|
5574
|
+
value: a.maxWidth,
|
|
5575
5575
|
required: !0,
|
|
5576
|
-
onChange: (h) => l({ ...
|
|
5576
|
+
onChange: (h) => l({ ...a, maxWidth: h.target.value })
|
|
5577
5577
|
}
|
|
5578
5578
|
) }) }),
|
|
5579
|
-
/* @__PURE__ */ i(
|
|
5579
|
+
/* @__PURE__ */ i(at, { className: "mb-[6px]", children: "Height" }),
|
|
5580
5580
|
/* @__PURE__ */ i("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ i(
|
|
5581
5581
|
Q,
|
|
5582
5582
|
{
|
|
5583
5583
|
type: "number",
|
|
5584
|
-
value:
|
|
5584
|
+
value: a.height,
|
|
5585
5585
|
required: !0,
|
|
5586
|
-
onChange: (h) => l({ ...
|
|
5586
|
+
onChange: (h) => l({ ...a, height: h.target.value })
|
|
5587
5587
|
}
|
|
5588
5588
|
) }) }),
|
|
5589
5589
|
/* @__PURE__ */ i(G, { type: "submit", className: "richtext-self-end richtext-mt-2", children: o("editor.link.dialog.button.apply") })
|
|
5590
5590
|
] }) }) })
|
|
5591
5591
|
] });
|
|
5592
5592
|
}, vt = /* @__PURE__ */ new Map();
|
|
5593
|
-
function
|
|
5593
|
+
function cs(t) {
|
|
5594
5594
|
const e = t.options.element;
|
|
5595
5595
|
vt.has("width") || vt.set("width", e.clientWidth), vt.has("width") && vt.get("width") <= 0 && vt.set("width", e.clientWidth);
|
|
5596
5596
|
const r = { attributes: !0, childList: !0, subtree: !0 }, n = function() {
|
|
5597
5597
|
vt.set("width", e.clientWidth);
|
|
5598
|
-
},
|
|
5599
|
-
return
|
|
5600
|
-
|
|
5598
|
+
}, c = new MutationObserver(n);
|
|
5599
|
+
return c.observe(e, r), t.on("destroy", () => {
|
|
5600
|
+
c.disconnect();
|
|
5601
5601
|
}), { width: vt.get("width") };
|
|
5602
5602
|
}
|
|
5603
|
-
function
|
|
5604
|
-
const { t: e } = q(), { width: r } =
|
|
5603
|
+
function as({ editor: t }) {
|
|
5604
|
+
const { t: e } = q(), { width: r } = cs(t), n = zt(t, St.name, {
|
|
5605
5605
|
defaultShowPicker: !1,
|
|
5606
5606
|
createUser: "",
|
|
5607
5607
|
width: 0,
|
|
5608
5608
|
height: 0
|
|
5609
|
-
}), { defaultShowPicker:
|
|
5609
|
+
}), { defaultShowPicker: c, createUser: o, width: a, height: l } = n, s = H(
|
|
5610
5610
|
(m) => {
|
|
5611
5611
|
t.chain().updateAttributes(St.name, m).setNodeSelection(t.state.selection.from).focus().run();
|
|
5612
5612
|
},
|
|
5613
5613
|
[t]
|
|
5614
5614
|
), h = H(() => {
|
|
5615
|
-
|
|
5615
|
+
Qc(n);
|
|
5616
5616
|
}, [t, n]), d = H(() => t.isActive(St.name), [t]), u = H(() => Gt(St.name, t), [t]);
|
|
5617
5617
|
return B(() => {
|
|
5618
|
-
|
|
5619
|
-
}, [o,
|
|
5618
|
+
c && (h(), t.chain().updateAttributes(St.name, { defaultShowPicker: !1 }).focus().run());
|
|
5619
|
+
}, [o, c, t, h]), /* @__PURE__ */ i(
|
|
5620
5620
|
tt,
|
|
5621
5621
|
{
|
|
5622
5622
|
className: "bubble-menu",
|
|
@@ -5643,7 +5643,7 @@ function cs({ editor: t }) {
|
|
|
5643
5643
|
tooltip: e("editor.edit")
|
|
5644
5644
|
}
|
|
5645
5645
|
),
|
|
5646
|
-
/* @__PURE__ */ i(oi, { width:
|
|
5646
|
+
/* @__PURE__ */ i(oi, { width: a, maxWidth: r, height: l, onOk: s, children: /* @__PURE__ */ i(
|
|
5647
5647
|
O,
|
|
5648
5648
|
{
|
|
5649
5649
|
icon: "Settings",
|
|
@@ -5663,31 +5663,31 @@ function cs({ editor: t }) {
|
|
|
5663
5663
|
);
|
|
5664
5664
|
}
|
|
5665
5665
|
function ss({ editor: t }) {
|
|
5666
|
-
const { t: e } = q(), { width: r, height: n, url:
|
|
5666
|
+
const { t: e } = q(), { width: r, height: n, url: c } = zt(t, kt.name, {
|
|
5667
5667
|
width: 0,
|
|
5668
5668
|
height: 0,
|
|
5669
5669
|
url: "",
|
|
5670
5670
|
defaultShowPicker: !1
|
|
5671
|
-
}), [o,
|
|
5672
|
-
|
|
5673
|
-
}, [
|
|
5671
|
+
}), [o, a] = S(!1), [l, s] = S(""), h = H(() => {
|
|
5672
|
+
a(!1);
|
|
5673
|
+
}, [a]);
|
|
5674
5674
|
B(() => {
|
|
5675
|
-
o && s(
|
|
5676
|
-
}, [o,
|
|
5675
|
+
o && s(c);
|
|
5676
|
+
}, [o, c]);
|
|
5677
5677
|
const d = H(() => {
|
|
5678
5678
|
t.chain().updateAttributes(kt.name, {
|
|
5679
5679
|
url: l
|
|
5680
|
-
}).setNodeSelection(t.state.selection.from).focus().run(),
|
|
5681
|
-
}, [t, l,
|
|
5682
|
-
window.open(
|
|
5683
|
-
}, [
|
|
5684
|
-
|
|
5685
|
-
}, [
|
|
5680
|
+
}).setNodeSelection(t.state.selection.from).focus().run(), a(!1);
|
|
5681
|
+
}, [t, l, a]), u = H(() => {
|
|
5682
|
+
window.open(c, "_blank");
|
|
5683
|
+
}, [c]), m = H(() => {
|
|
5684
|
+
a(!0);
|
|
5685
|
+
}, [a]), x = H(
|
|
5686
5686
|
(f) => {
|
|
5687
5687
|
t.chain().updateAttributes(kt.name, f).setNodeSelection(t.state.selection.from).focus().run();
|
|
5688
5688
|
},
|
|
5689
5689
|
[t]
|
|
5690
|
-
), w = H(() => t.isActive(kt.name) && !
|
|
5690
|
+
), w = H(() => t.isActive(kt.name) && !c, [t, c]), p = H(() => Gt(kt.name, t), [t]);
|
|
5691
5691
|
return /* @__PURE__ */ g(V, { children: [
|
|
5692
5692
|
/* @__PURE__ */ i(
|
|
5693
5693
|
tt,
|
|
@@ -5746,7 +5746,7 @@ function ss({ editor: t }) {
|
|
|
5746
5746
|
ut,
|
|
5747
5747
|
{
|
|
5748
5748
|
open: o,
|
|
5749
|
-
onOpenChange:
|
|
5749
|
+
onOpenChange: a,
|
|
5750
5750
|
children: [
|
|
5751
5751
|
/* @__PURE__ */ i(mt, {}),
|
|
5752
5752
|
/* @__PURE__ */ g(lt, { children: [
|
|
@@ -5775,13 +5775,13 @@ function ls({ editor: t, ...e }) {
|
|
|
5775
5775
|
const r = zt(t, Mt.name, {
|
|
5776
5776
|
text: "",
|
|
5777
5777
|
defaultShowPicker: !1
|
|
5778
|
-
}), { text: n, defaultShowPicker:
|
|
5778
|
+
}), { text: n, defaultShowPicker: c } = r, [o, a] = S(""), [l, s] = S(!1), h = H(() => t.isActive(Mt.name), [t]), d = H(() => Gt(Mt.name, t), [t]), u = H(() => {
|
|
5779
5779
|
t.chain().focus().setKatex({ text: o }).run(), s(!1);
|
|
5780
5780
|
}, [t, o]);
|
|
5781
5781
|
B(() => {
|
|
5782
|
-
|
|
5783
|
-
}, [t,
|
|
5784
|
-
l &&
|
|
5782
|
+
c && (s(!0), t.chain().updateAttributes(Mt.name, { defaultShowPicker: !1 }).focus().run());
|
|
5783
|
+
}, [t, c, s]), B(() => {
|
|
5784
|
+
l && a(n || "");
|
|
5785
5785
|
}, [l]);
|
|
5786
5786
|
const m = U(() => {
|
|
5787
5787
|
try {
|
|
@@ -5815,7 +5815,7 @@ function ls({ editor: t, ...e }) {
|
|
|
5815
5815
|
jt,
|
|
5816
5816
|
{
|
|
5817
5817
|
value: o,
|
|
5818
|
-
onChange: (w) =>
|
|
5818
|
+
onChange: (w) => a(w.target.value),
|
|
5819
5819
|
autoFocus: !0,
|
|
5820
5820
|
placeholder: "Formula text",
|
|
5821
5821
|
rows: 3,
|
|
@@ -5837,15 +5837,15 @@ function ls({ editor: t, ...e }) {
|
|
|
5837
5837
|
}
|
|
5838
5838
|
const ur = `graph TB
|
|
5839
5839
|
a-->b`, ds = ({ editor: t, attrs: e, extension: r }) => {
|
|
5840
|
-
const { alt: n, align:
|
|
5840
|
+
const { alt: n, align: c } = e, [o, a] = S(decodeURIComponent(n ?? ur)), [l, s] = S(""), [h, d] = S(!1), u = J(null), m = r == null ? void 0 : r.options.upload, x = async (f) => {
|
|
5841
5841
|
try {
|
|
5842
|
-
const { svg: I } = await
|
|
5842
|
+
const { svg: I } = await ae.render("mermaid-svg", f);
|
|
5843
5843
|
s(I);
|
|
5844
5844
|
} catch {
|
|
5845
5845
|
s("");
|
|
5846
5846
|
}
|
|
5847
5847
|
}, w = () => {
|
|
5848
|
-
|
|
5848
|
+
ae.initialize({
|
|
5849
5849
|
darkMode: !1,
|
|
5850
5850
|
startOnLoad: !1,
|
|
5851
5851
|
// fontFamily:'',
|
|
@@ -5880,7 +5880,7 @@ a-->b`, ds = ({ editor: t, attrs: e, extension: r }) => {
|
|
|
5880
5880
|
autoFocus: !0,
|
|
5881
5881
|
className: "richtext-flex-1",
|
|
5882
5882
|
defaultValue: ur,
|
|
5883
|
-
onChange: (f) =>
|
|
5883
|
+
onChange: (f) => a(f.target.value),
|
|
5884
5884
|
placeholder: "Text",
|
|
5885
5885
|
required: !0,
|
|
5886
5886
|
rows: 10,
|
|
@@ -5921,7 +5921,7 @@ a-->b`, ds = ({ editor: t, attrs: e, extension: r }) => {
|
|
|
5921
5921
|
height: T
|
|
5922
5922
|
},
|
|
5923
5923
|
!!o
|
|
5924
|
-
).run(), t == null || t.commands.setAlignImageMermaid(
|
|
5924
|
+
).run(), t == null || t.commands.setAlignImageMermaid(c);
|
|
5925
5925
|
}
|
|
5926
5926
|
d(!1);
|
|
5927
5927
|
}
|
|
@@ -5941,7 +5941,7 @@ a-->b`, ds = ({ editor: t, attrs: e, extension: r }) => {
|
|
|
5941
5941
|
moveTransition: "transform 0.1s ease-out"
|
|
5942
5942
|
};
|
|
5943
5943
|
function us({ item: t, disabled: e, editor: r }) {
|
|
5944
|
-
var
|
|
5944
|
+
var c;
|
|
5945
5945
|
const n = t.component;
|
|
5946
5946
|
return n ? /* @__PURE__ */ i(Pe, { children: t.type === "divider" ? /* @__PURE__ */ i(
|
|
5947
5947
|
rt,
|
|
@@ -5953,7 +5953,7 @@ function us({ item: t, disabled: e, editor: r }) {
|
|
|
5953
5953
|
n,
|
|
5954
5954
|
{
|
|
5955
5955
|
...t.componentProps,
|
|
5956
|
-
disabled: e || ((
|
|
5956
|
+
disabled: e || ((c = t == null ? void 0 : t.componentProps) == null ? void 0 : c.disabled),
|
|
5957
5957
|
editor: r
|
|
5958
5958
|
}
|
|
5959
5959
|
) }) : /* @__PURE__ */ i(V, {});
|
|
@@ -5962,10 +5962,10 @@ function ms(t) {
|
|
|
5962
5962
|
return t.type.name === "mermaid";
|
|
5963
5963
|
}
|
|
5964
5964
|
function xs(t) {
|
|
5965
|
-
const { lang: e } = q(), r = zt(t.editor, sr.name), n = ni(t.editor, sr.name),
|
|
5966
|
-
const { selection: l } =
|
|
5965
|
+
const { lang: e } = q(), r = zt(t.editor, sr.name), n = ni(t.editor, sr.name), c = ({ editor: a }) => {
|
|
5966
|
+
const { selection: l } = a.view.state, { $from: s, to: h } = l;
|
|
5967
5967
|
let d = !1;
|
|
5968
|
-
return
|
|
5968
|
+
return a.view.state.doc.nodesBetween(s.pos, h, (u) => {
|
|
5969
5969
|
if (ms(u))
|
|
5970
5970
|
return d = !0, !1;
|
|
5971
5971
|
}), d;
|
|
@@ -5974,9 +5974,9 @@ function xs(t) {
|
|
|
5974
5974
|
tt,
|
|
5975
5975
|
{
|
|
5976
5976
|
editor: t == null ? void 0 : t.editor,
|
|
5977
|
-
shouldShow:
|
|
5977
|
+
shouldShow: c,
|
|
5978
5978
|
tippyOptions: hs,
|
|
5979
|
-
children: o != null && o.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: o == null ? void 0 : o.map((
|
|
5979
|
+
children: o != null && o.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: o == null ? void 0 : o.map((a, l) => a.type === "edit" && (r != null && r.src) ? /* @__PURE__ */ i(
|
|
5980
5980
|
ds,
|
|
5981
5981
|
{
|
|
5982
5982
|
attrs: r,
|
|
@@ -5989,7 +5989,7 @@ function xs(t) {
|
|
|
5989
5989
|
{
|
|
5990
5990
|
disabled: t.disabled,
|
|
5991
5991
|
editor: t.editor,
|
|
5992
|
-
item:
|
|
5992
|
+
item: a
|
|
5993
5993
|
},
|
|
5994
5994
|
`bubbleMenu-mermaid-${l}`
|
|
5995
5995
|
)) }) }) : /* @__PURE__ */ i(V, {})
|
|
@@ -5997,7 +5997,7 @@ function xs(t) {
|
|
|
5997
5997
|
) });
|
|
5998
5998
|
}
|
|
5999
5999
|
function fs({ editor: t, disabled: e }) {
|
|
6000
|
-
const [r, n] = S(!1), { t:
|
|
6000
|
+
const [r, n] = S(!1), { t: c } = q(), o = H(({ editor: s }) => s.isActive(Ie.name), []), a = (s) => {
|
|
6001
6001
|
t.commands.updateTweet({ src: s }), n(!1);
|
|
6002
6002
|
}, l = H(() => Gt(Ie.name, t), [t]);
|
|
6003
6003
|
return /* @__PURE__ */ i(V, { children: /* @__PURE__ */ i(
|
|
@@ -6020,14 +6020,14 @@ function fs({ editor: t, disabled: e }) {
|
|
|
6020
6020
|
ri,
|
|
6021
6021
|
{
|
|
6022
6022
|
editor: t,
|
|
6023
|
-
onSetLink:
|
|
6023
|
+
onSetLink: a
|
|
6024
6024
|
}
|
|
6025
6025
|
) : /* @__PURE__ */ i("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-flex-nowrap", children: [
|
|
6026
6026
|
/* @__PURE__ */ i(
|
|
6027
6027
|
O,
|
|
6028
6028
|
{
|
|
6029
6029
|
icon: "Pencil",
|
|
6030
|
-
tooltip:
|
|
6030
|
+
tooltip: c("editor.link.edit.tooltip"),
|
|
6031
6031
|
tooltipOptions: { sideOffset: 15 },
|
|
6032
6032
|
action: () => {
|
|
6033
6033
|
n(!0);
|
|
@@ -6039,7 +6039,7 @@ function fs({ editor: t, disabled: e }) {
|
|
|
6039
6039
|
{
|
|
6040
6040
|
action: l,
|
|
6041
6041
|
icon: "Trash",
|
|
6042
|
-
tooltip:
|
|
6042
|
+
tooltip: c("editor.delete"),
|
|
6043
6043
|
tooltipOptions: { sideOffset: 15 }
|
|
6044
6044
|
}
|
|
6045
6045
|
)
|
|
@@ -6048,8 +6048,8 @@ function fs({ editor: t, disabled: e }) {
|
|
|
6048
6048
|
) });
|
|
6049
6049
|
}
|
|
6050
6050
|
function gs({ editor: t, disabled: e, bubbleMenu: r }) {
|
|
6051
|
-
const n = t.extensionManager.extensions.map((o) => o.name),
|
|
6052
|
-
var o,
|
|
6051
|
+
const n = t.extensionManager.extensions.map((o) => o.name), c = () => {
|
|
6052
|
+
var o, a, l, s, h, d, u, m, x, w, p, f, I, T, v;
|
|
6053
6053
|
return [
|
|
6054
6054
|
n.includes("columns") && !((o = r == null ? void 0 : r.columnConfig) != null && o.hidden) ? /* @__PURE__ */ i(
|
|
6055
6055
|
Ks,
|
|
@@ -6058,7 +6058,7 @@ function gs({ editor: t, disabled: e, bubbleMenu: r }) {
|
|
|
6058
6058
|
},
|
|
6059
6059
|
"columns"
|
|
6060
6060
|
) : null,
|
|
6061
|
-
n.includes("table") && !((
|
|
6061
|
+
n.includes("table") && !((a = r == null ? void 0 : r.tableConfig) != null && a.hidden) ? /* @__PURE__ */ i(
|
|
6062
6062
|
Vs,
|
|
6063
6063
|
{
|
|
6064
6064
|
editor: t,
|
|
@@ -6107,7 +6107,7 @@ function gs({ editor: t, disabled: e, bubbleMenu: r }) {
|
|
|
6107
6107
|
"katex"
|
|
6108
6108
|
) : null,
|
|
6109
6109
|
n.includes("excalidraw") && !((x = r == null ? void 0 : r.excalidrawConfig) != null && x.hidden) ? /* @__PURE__ */ i(
|
|
6110
|
-
|
|
6110
|
+
as,
|
|
6111
6111
|
{
|
|
6112
6112
|
disabled: e,
|
|
6113
6113
|
editor: t
|
|
@@ -6164,7 +6164,7 @@ function gs({ editor: t, disabled: e, bubbleMenu: r }) {
|
|
|
6164
6164
|
) : null
|
|
6165
6165
|
];
|
|
6166
6166
|
};
|
|
6167
|
-
return r != null && r.render ? r.render({ editor: t, disabled: e || !1, bubbleMenu: r },
|
|
6167
|
+
return r != null && r.render ? r.render({ editor: t, disabled: e || !1, bubbleMenu: r }, c()) : c().filter(Boolean);
|
|
6168
6168
|
}
|
|
6169
6169
|
function mr() {
|
|
6170
6170
|
return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { fill: "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" }) });
|
|
@@ -6173,9 +6173,9 @@ function ps(t) {
|
|
|
6173
6173
|
const { t: e } = q(), {
|
|
6174
6174
|
highlight: r = !1,
|
|
6175
6175
|
disabled: n = !1,
|
|
6176
|
-
selectedColor:
|
|
6176
|
+
selectedColor: c,
|
|
6177
6177
|
setSelectedColor: o,
|
|
6178
|
-
onChange:
|
|
6178
|
+
onChange: a,
|
|
6179
6179
|
colors: l = Ai
|
|
6180
6180
|
} = t, s = U(() => {
|
|
6181
6181
|
const x = l, w = [];
|
|
@@ -6188,10 +6188,10 @@ function ps(t) {
|
|
|
6188
6188
|
};
|
|
6189
6189
|
function m(x) {
|
|
6190
6190
|
if (x === void 0) {
|
|
6191
|
-
o == null || o(x),
|
|
6191
|
+
o == null || o(x), a == null || a(x);
|
|
6192
6192
|
return;
|
|
6193
6193
|
}
|
|
6194
|
-
/^#([\da-f]{3}){1,2}$/i.test(x) && (o == null || o(x),
|
|
6194
|
+
/^#([\da-f]{3}){1,2}$/i.test(x) && (o == null || o(x), a == null || a(x), u(x));
|
|
6195
6195
|
}
|
|
6196
6196
|
return /* @__PURE__ */ g(It, { modal: !0, children: [
|
|
6197
6197
|
/* @__PURE__ */ i(
|
|
@@ -6250,7 +6250,7 @@ function ps(t) {
|
|
|
6250
6250
|
style: {
|
|
6251
6251
|
backgroundColor: p
|
|
6252
6252
|
},
|
|
6253
|
-
children: p ===
|
|
6253
|
+
children: p === c ? /* @__PURE__ */ i(
|
|
6254
6254
|
"svg",
|
|
6255
6255
|
{
|
|
6256
6256
|
className: "richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",
|
|
@@ -6317,16 +6317,16 @@ function ps(t) {
|
|
|
6317
6317
|
] });
|
|
6318
6318
|
}
|
|
6319
6319
|
function ws({ setColor: t }) {
|
|
6320
|
-
const [e, r] = S("#000000"), [n,
|
|
6320
|
+
const [e, r] = S("#000000"), [n, c] = S(!1), { t: o } = q();
|
|
6321
6321
|
return B(() => () => {
|
|
6322
|
-
|
|
6322
|
+
c(!1);
|
|
6323
6323
|
}, []), /* @__PURE__ */ g(It, { open: n, children: [
|
|
6324
6324
|
/* @__PURE__ */ i(Et, { asChild: !0, children: /* @__PURE__ */ g(
|
|
6325
6325
|
"div",
|
|
6326
6326
|
{
|
|
6327
6327
|
className: "richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",
|
|
6328
|
-
onClick: (
|
|
6329
|
-
|
|
6328
|
+
onClick: (a) => {
|
|
6329
|
+
a.preventDefault(), c(!0);
|
|
6330
6330
|
},
|
|
6331
6331
|
children: [
|
|
6332
6332
|
o("editor.color.more"),
|
|
@@ -6349,8 +6349,8 @@ function ws({ setColor: t }) {
|
|
|
6349
6349
|
className: "richtext-mt-[8px] richtext-w-full",
|
|
6350
6350
|
type: "text",
|
|
6351
6351
|
value: e.slice(1),
|
|
6352
|
-
onChange: (
|
|
6353
|
-
|
|
6352
|
+
onChange: (a) => {
|
|
6353
|
+
a.preventDefault(), r(`#${a.target.value}`);
|
|
6354
6354
|
}
|
|
6355
6355
|
}
|
|
6356
6356
|
)
|
|
@@ -6360,8 +6360,8 @@ function ws({ setColor: t }) {
|
|
|
6360
6360
|
G,
|
|
6361
6361
|
{
|
|
6362
6362
|
className: "richtext-w-full",
|
|
6363
|
-
onClick: (
|
|
6364
|
-
|
|
6363
|
+
onClick: (a) => {
|
|
6364
|
+
a.preventDefault(), t(e), c(!1);
|
|
6365
6365
|
},
|
|
6366
6366
|
children: /* @__PURE__ */ i(kr, { size: 16 })
|
|
6367
6367
|
}
|
|
@@ -6370,7 +6370,7 @@ function ws({ setColor: t }) {
|
|
|
6370
6370
|
] });
|
|
6371
6371
|
}
|
|
6372
6372
|
function vs({ editor: t, disabled: e, toolbar: r }) {
|
|
6373
|
-
const { t: n, lang:
|
|
6373
|
+
const { t: n, lang: c } = q(), o = U(() => {
|
|
6374
6374
|
const h = [...t.extensionManager.extensions].sort((u, m) => {
|
|
6375
6375
|
const x = u.options.sort ?? -1, w = m.options.sort ?? -1;
|
|
6376
6376
|
return x - w;
|
|
@@ -6410,7 +6410,7 @@ function vs({ editor: t, disabled: e, toolbar: r }) {
|
|
|
6410
6410
|
});
|
|
6411
6411
|
}
|
|
6412
6412
|
return d;
|
|
6413
|
-
}, [t, n,
|
|
6413
|
+
}, [t, n, c]), a = (s) => /* @__PURE__ */ i(
|
|
6414
6414
|
"div",
|
|
6415
6415
|
{
|
|
6416
6416
|
className: "richtext-px-1 richtext-py-2 !richtext-border-b",
|
|
@@ -6435,7 +6435,7 @@ function vs({ editor: t, disabled: e, toolbar: r }) {
|
|
|
6435
6435
|
(s == null ? void 0 : s.divider) && /* @__PURE__ */ i(rt, { orientation: "vertical", className: "!richtext-h-auto !richtext-mx-2" })
|
|
6436
6436
|
] }, `toolbar-item-${h}`);
|
|
6437
6437
|
});
|
|
6438
|
-
return r && (r != null && r.render) ? r.render({ editor: t, disabled: e || !1 }, o, l,
|
|
6438
|
+
return r && (r != null && r.render) ? r.render({ editor: t, disabled: e || !1 }, o, l, a) : a(l);
|
|
6439
6439
|
}
|
|
6440
6440
|
function bs(t) {
|
|
6441
6441
|
const e = ["size-small", "size-medium", "size-large"], r = [
|
|
@@ -6443,12 +6443,12 @@ function bs(t) {
|
|
|
6443
6443
|
"SizeM",
|
|
6444
6444
|
"SizeL"
|
|
6445
6445
|
];
|
|
6446
|
-
return e.map((n,
|
|
6446
|
+
return e.map((n, c) => ({
|
|
6447
6447
|
type: `image-${n}`,
|
|
6448
6448
|
component: O,
|
|
6449
6449
|
componentProps: {
|
|
6450
6450
|
tooltip: Z.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
6451
|
-
icon: r[
|
|
6451
|
+
icon: r[c],
|
|
6452
6452
|
action: () => t.commands.updateImage({ width: ne[n] }),
|
|
6453
6453
|
isActive: () => t.isActive("image", { width: ne[n] })
|
|
6454
6454
|
}
|
|
@@ -6460,12 +6460,12 @@ function ys(t) {
|
|
|
6460
6460
|
"SizeM",
|
|
6461
6461
|
"SizeL"
|
|
6462
6462
|
];
|
|
6463
|
-
return e.map((n,
|
|
6463
|
+
return e.map((n, c) => ({
|
|
6464
6464
|
type: `image-${n}`,
|
|
6465
6465
|
component: O,
|
|
6466
6466
|
componentProps: {
|
|
6467
6467
|
tooltip: Z.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
6468
|
-
icon: r[
|
|
6468
|
+
icon: r[c],
|
|
6469
6469
|
action: () => t.commands.updateImageGif({ width: ne[n] }),
|
|
6470
6470
|
isActive: () => t.isActive("image", { width: ne[n] })
|
|
6471
6471
|
}
|
|
@@ -6484,8 +6484,8 @@ function Cs(t) {
|
|
|
6484
6484
|
tooltip: Z.t(`editor.textalign.${n}.tooltip`),
|
|
6485
6485
|
icon: r[n],
|
|
6486
6486
|
action: () => {
|
|
6487
|
-
var
|
|
6488
|
-
return (o = (
|
|
6487
|
+
var c, o;
|
|
6488
|
+
return (o = (c = t.commands) == null ? void 0 : c.setAlignImage) == null ? void 0 : o.call(c, n);
|
|
6489
6489
|
},
|
|
6490
6490
|
isActive: () => t.isActive({ align: n }) || !1,
|
|
6491
6491
|
disabled: !1
|
|
@@ -6505,8 +6505,8 @@ function Ts(t) {
|
|
|
6505
6505
|
tooltip: Z.t(`editor.textalign.${n}.tooltip`),
|
|
6506
6506
|
icon: r[n],
|
|
6507
6507
|
action: () => {
|
|
6508
|
-
var
|
|
6509
|
-
return (o = (
|
|
6508
|
+
var c, o;
|
|
6509
|
+
return (o = (c = t.commands) == null ? void 0 : c.setAlignImageGif) == null ? void 0 : o.call(c, n);
|
|
6510
6510
|
},
|
|
6511
6511
|
isActive: () => t.isActive({ align: n }) || !1,
|
|
6512
6512
|
disabled: !1
|
|
@@ -6526,8 +6526,8 @@ function Ns(t) {
|
|
|
6526
6526
|
tooltip: Z.t(`editor.textalign.${n}.tooltip`),
|
|
6527
6527
|
icon: r[n],
|
|
6528
6528
|
action: () => {
|
|
6529
|
-
var
|
|
6530
|
-
return (o = (
|
|
6529
|
+
var c, o;
|
|
6530
|
+
return (o = (c = t.commands) == null ? void 0 : c.setAlignImageMermaid) == null ? void 0 : o.call(c, n);
|
|
6531
6531
|
},
|
|
6532
6532
|
isActive: () => t.isActive({ align: n }) || !1,
|
|
6533
6533
|
disabled: !1
|
|
@@ -6547,8 +6547,8 @@ function ks(t) {
|
|
|
6547
6547
|
tooltip: Z.t(`editor.textalign.${n}.tooltip`),
|
|
6548
6548
|
icon: r[n],
|
|
6549
6549
|
action: () => {
|
|
6550
|
-
var
|
|
6551
|
-
return (o = (
|
|
6550
|
+
var c, o;
|
|
6551
|
+
return (o = (c = t.commands) == null ? void 0 : c.setAlignImageDrawer) == null ? void 0 : o.call(c, n);
|
|
6552
6552
|
},
|
|
6553
6553
|
isActive: () => t.isActive({ align: n }) || !1,
|
|
6554
6554
|
disabled: !1
|
|
@@ -6561,12 +6561,12 @@ function Ss(t) {
|
|
|
6561
6561
|
"SizeM",
|
|
6562
6562
|
"SizeL"
|
|
6563
6563
|
];
|
|
6564
|
-
return e.map((n,
|
|
6564
|
+
return e.map((n, c) => ({
|
|
6565
6565
|
type: `video-${n}`,
|
|
6566
6566
|
component: O,
|
|
6567
6567
|
componentProps: {
|
|
6568
6568
|
tooltip: Z.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
6569
|
-
icon: r[
|
|
6569
|
+
icon: r[c],
|
|
6570
6570
|
action: () => t.commands.updateVideo({ width: Ce[n] }),
|
|
6571
6571
|
isActive: () => t.isActive("video", { width: Ce[n] })
|
|
6572
6572
|
}
|
|
@@ -6722,18 +6722,18 @@ function zs(t, e) {
|
|
|
6722
6722
|
component: void 0,
|
|
6723
6723
|
componentProps: {}
|
|
6724
6724
|
}];
|
|
6725
|
-
const
|
|
6726
|
-
return
|
|
6725
|
+
const c = t.extensionManager.extensions.find((o) => o.name === n);
|
|
6726
|
+
return c ? [...r, c.configure().options.button({ editor: t, t: e, extension: c })] : r;
|
|
6727
6727
|
}, []);
|
|
6728
6728
|
}
|
|
6729
6729
|
function Ue(t, e, r) {
|
|
6730
|
-
const n = [],
|
|
6730
|
+
const n = [], c = t.node(0);
|
|
6731
6731
|
r = typeof r == "number" && r >= 0 ? r : t.sameParent(e) ? Math.max(0, t.sharedDepth(e.pos) - 1) : t.sharedDepth(e.pos);
|
|
6732
|
-
const o = new Bi(t, e, r),
|
|
6732
|
+
const o = new Bi(t, e, r), a = o.depth === 0 ? 0 : c.resolve(o.start).posAtIndex(0);
|
|
6733
6733
|
return o.parent.forEach((l, s) => {
|
|
6734
|
-
const h =
|
|
6734
|
+
const h = a + s, d = h + l.nodeSize;
|
|
6735
6735
|
if (h < o.start || h >= o.end) return;
|
|
6736
|
-
const u = new $i(
|
|
6736
|
+
const u = new $i(c.resolve(h), c.resolve(d));
|
|
6737
6737
|
n.push(u);
|
|
6738
6738
|
}), n;
|
|
6739
6739
|
}
|
|
@@ -6748,29 +6748,29 @@ class Ge {
|
|
|
6748
6748
|
}
|
|
6749
6749
|
resolve(e) {
|
|
6750
6750
|
const r = e.resolve(this.anchor), n = e.resolve(this.head);
|
|
6751
|
-
return new
|
|
6751
|
+
return new ct(r, n);
|
|
6752
6752
|
}
|
|
6753
6753
|
}
|
|
6754
|
-
class
|
|
6755
|
-
constructor(r, n,
|
|
6756
|
-
const { doc:
|
|
6754
|
+
class ct extends Vi {
|
|
6755
|
+
constructor(r, n, c, o = 1) {
|
|
6756
|
+
const { doc: a } = r, l = r === n, s = r.pos === a.content.size && n.pos === a.content.size, h = l && !s ? a.resolve(n.pos + (o > 0 ? 1 : -1)) : n, d = l && s ? a.resolve(r.pos - (o > 0 ? 1 : -1)) : r, u = Ue(d.min(h), d.max(h), c);
|
|
6757
6757
|
super(
|
|
6758
6758
|
h.pos >= r.pos ? u[0].$from : u[u.length - 1].$to,
|
|
6759
6759
|
h.pos >= r.pos ? u[u.length - 1].$to : u[0].$from,
|
|
6760
6760
|
u
|
|
6761
6761
|
);
|
|
6762
6762
|
Xt(this, "depth");
|
|
6763
|
-
this.depth =
|
|
6763
|
+
this.depth = c;
|
|
6764
6764
|
}
|
|
6765
6765
|
get $to() {
|
|
6766
6766
|
return this.ranges[this.ranges.length - 1].$to;
|
|
6767
6767
|
}
|
|
6768
6768
|
eq(r) {
|
|
6769
|
-
return r instanceof
|
|
6769
|
+
return r instanceof ct && r.$from.pos === this.$from.pos && r.$to.pos === this.$to.pos;
|
|
6770
6770
|
}
|
|
6771
6771
|
map(r, n) {
|
|
6772
|
-
const
|
|
6773
|
-
return new
|
|
6772
|
+
const c = r.resolve(n.map(this.anchor)), o = r.resolve(n.map(this.head));
|
|
6773
|
+
return new ct(c, o);
|
|
6774
6774
|
}
|
|
6775
6775
|
toJSON() {
|
|
6776
6776
|
return { type: "nodeRange", anchor: this.anchor, head: this.head };
|
|
@@ -6784,26 +6784,26 @@ class at extends Vi {
|
|
|
6784
6784
|
extendBackwards() {
|
|
6785
6785
|
const { doc: r } = this.$from;
|
|
6786
6786
|
if (this.isForwards && this.ranges.length > 1) {
|
|
6787
|
-
const o = this.ranges.slice(0, -1),
|
|
6788
|
-
return new
|
|
6787
|
+
const o = this.ranges.slice(0, -1), a = o[0].$from, l = o[o.length - 1].$to;
|
|
6788
|
+
return new ct(a, l, this.depth);
|
|
6789
6789
|
}
|
|
6790
|
-
const n = this.ranges[0],
|
|
6791
|
-
return new
|
|
6790
|
+
const n = this.ranges[0], c = r.resolve(Math.max(0, n.$from.pos - 1));
|
|
6791
|
+
return new ct(this.$anchor, c, this.depth);
|
|
6792
6792
|
}
|
|
6793
6793
|
extendForwards() {
|
|
6794
6794
|
const { doc: r } = this.$from;
|
|
6795
6795
|
if (this.isBackwards && this.ranges.length > 1) {
|
|
6796
|
-
const o = this.ranges.slice(1),
|
|
6797
|
-
return new
|
|
6796
|
+
const o = this.ranges.slice(1), a = o[0].$from, l = o[o.length - 1].$to;
|
|
6797
|
+
return new ct(l, a, this.depth);
|
|
6798
6798
|
}
|
|
6799
|
-
const n = this.ranges[this.ranges.length - 1],
|
|
6800
|
-
return new
|
|
6799
|
+
const n = this.ranges[this.ranges.length - 1], c = r.resolve(Math.min(r.content.size, n.$to.pos + 1));
|
|
6800
|
+
return new ct(this.$anchor, c, this.depth);
|
|
6801
6801
|
}
|
|
6802
6802
|
static fromJSON(r, n) {
|
|
6803
|
-
return new
|
|
6803
|
+
return new ct(r.resolve(n.anchor), r.resolve(n.head));
|
|
6804
6804
|
}
|
|
6805
|
-
static create(r, n,
|
|
6806
|
-
return new this(r.resolve(n), r.resolve(
|
|
6805
|
+
static create(r, n, c, o, a = 1) {
|
|
6806
|
+
return new this(r.resolve(n), r.resolve(c), o, a);
|
|
6807
6807
|
}
|
|
6808
6808
|
getBookmark() {
|
|
6809
6809
|
return new Ge(this.anchor, this.head);
|
|
@@ -6811,14 +6811,14 @@ class at extends Vi {
|
|
|
6811
6811
|
}
|
|
6812
6812
|
function Ps(t) {
|
|
6813
6813
|
const e = t.cloneNode(!0), r = [t, ...Array.from(t.getElementsByTagName("*"))], n = [e, ...Array.from(e.getElementsByTagName("*"))];
|
|
6814
|
-
return r.forEach((
|
|
6815
|
-
n[o].style.cssText = function(
|
|
6814
|
+
return r.forEach((c, o) => {
|
|
6815
|
+
n[o].style.cssText = function(a) {
|
|
6816
6816
|
let l = "";
|
|
6817
|
-
const s = getComputedStyle(
|
|
6817
|
+
const s = getComputedStyle(a);
|
|
6818
6818
|
for (let h = 0; h < s.length; h += 1)
|
|
6819
6819
|
l += `${s[h]}:${s.getPropertyValue(s[h])};`;
|
|
6820
6820
|
return l;
|
|
6821
|
-
}(
|
|
6821
|
+
}(c);
|
|
6822
6822
|
}), e;
|
|
6823
6823
|
}
|
|
6824
6824
|
function Qt(t, e) {
|
|
@@ -6830,15 +6830,15 @@ function Rs(t = 0, e = 0, r = 0) {
|
|
|
6830
6830
|
function xr(t) {
|
|
6831
6831
|
t.parentNode !== null && t.parentNode !== void 0 && t.parentNode.removeChild(t);
|
|
6832
6832
|
}
|
|
6833
|
-
function
|
|
6834
|
-
const { x: e, y: r, direction: n, editor:
|
|
6835
|
-
let o = null,
|
|
6836
|
-
for (;
|
|
6833
|
+
function ci(t) {
|
|
6834
|
+
const { x: e, y: r, direction: n, editor: c } = t;
|
|
6835
|
+
let o = null, a = null, l = null, s = e;
|
|
6836
|
+
for (; a === null && s < window.innerWidth && s > 0; ) {
|
|
6837
6837
|
const h = document.elementsFromPoint(s, r), d = h.findIndex((m) => m.classList.contains("ProseMirror")), u = h.slice(0, d);
|
|
6838
6838
|
if (u.length > 0) {
|
|
6839
6839
|
const m = u[0];
|
|
6840
|
-
if (o = m, l =
|
|
6841
|
-
|
|
6840
|
+
if (o = m, l = c.view.posAtDOM(m, 0), l >= 0) {
|
|
6841
|
+
a = c.state.doc.nodeAt(Math.max(l - 1, 0)), (a === null || a.isText) && (a = c.state.doc.nodeAt(Math.max(l - 1, 0))), a || (a = c.state.doc.nodeAt(Math.max(l, 0)));
|
|
6842
6842
|
break;
|
|
6843
6843
|
}
|
|
6844
6844
|
}
|
|
@@ -6846,14 +6846,14 @@ function ai(t) {
|
|
|
6846
6846
|
}
|
|
6847
6847
|
return {
|
|
6848
6848
|
resultElement: o,
|
|
6849
|
-
resultNode:
|
|
6849
|
+
resultNode: a,
|
|
6850
6850
|
pos: l !== null ? l : null
|
|
6851
6851
|
};
|
|
6852
6852
|
}
|
|
6853
6853
|
function Os(t, e) {
|
|
6854
|
-
const { doc: r } = e.view.state, n =
|
|
6854
|
+
const { doc: r } = e.view.state, n = ci({ editor: e, x: t.clientX, y: t.clientY, direction: "right" });
|
|
6855
6855
|
if (!n.resultNode || n.pos === null) return [];
|
|
6856
|
-
const
|
|
6856
|
+
const c = t.clientX, o = function(d, u, m) {
|
|
6857
6857
|
const x = Number.parseInt(Qt(d.dom, "paddingLeft"), 10), w = Number.parseInt(Qt(d.dom, "paddingRight"), 10), p = Number.parseInt(Qt(d.dom, "borderLeftWidth"), 10), f = Number.parseInt(Qt(d.dom, "borderLeftWidth"), 10), I = d.dom.getBoundingClientRect();
|
|
6858
6858
|
return {
|
|
6859
6859
|
left: Rs(
|
|
@@ -6863,9 +6863,9 @@ function Os(t, e) {
|
|
|
6863
6863
|
),
|
|
6864
6864
|
top: m
|
|
6865
6865
|
};
|
|
6866
|
-
}(e.view,
|
|
6867
|
-
if (!
|
|
6868
|
-
const { pos: l } =
|
|
6866
|
+
}(e.view, c, t.clientY), a = e.view.posAtCoords(o);
|
|
6867
|
+
if (!a) return [];
|
|
6868
|
+
const { pos: l } = a;
|
|
6869
6869
|
if (!r.resolve(l).parent) return [];
|
|
6870
6870
|
const s = r.resolve(n.pos), h = r.resolve(n.pos + 1);
|
|
6871
6871
|
return Ue(s, h, 0);
|
|
@@ -6876,10 +6876,10 @@ function fr(t, e) {
|
|
|
6876
6876
|
}
|
|
6877
6877
|
function gr(t, e) {
|
|
6878
6878
|
const r = t.nodeAt(e), n = t.resolve(e);
|
|
6879
|
-
let { depth:
|
|
6880
|
-
for (;
|
|
6881
|
-
const
|
|
6882
|
-
|
|
6879
|
+
let { depth: c } = n, o = r;
|
|
6880
|
+
for (; c > 0; ) {
|
|
6881
|
+
const a = n.node(c);
|
|
6882
|
+
c -= 1, c === 0 && (o = a);
|
|
6883
6883
|
}
|
|
6884
6884
|
return o;
|
|
6885
6885
|
}
|
|
@@ -6888,22 +6888,22 @@ function pr(t, e) {
|
|
|
6888
6888
|
for (; r && r.parentNode && r.parentNode !== t.dom; ) r = r.parentNode;
|
|
6889
6889
|
return r;
|
|
6890
6890
|
}
|
|
6891
|
-
const
|
|
6891
|
+
const ai = new He("dragHandle");
|
|
6892
6892
|
function Hs({
|
|
6893
|
-
pluginKey: t =
|
|
6893
|
+
pluginKey: t = ai,
|
|
6894
6894
|
element: e,
|
|
6895
6895
|
editor: r,
|
|
6896
6896
|
tippyOptions: n,
|
|
6897
|
-
onNodeChange:
|
|
6897
|
+
onNodeChange: c
|
|
6898
6898
|
}) {
|
|
6899
6899
|
const o = document.createElement("div");
|
|
6900
|
-
let
|
|
6900
|
+
let a = null, l = !1, s = null, h = -1;
|
|
6901
6901
|
return e.addEventListener("dragstart", (d) => {
|
|
6902
6902
|
const { view: u } = r;
|
|
6903
6903
|
if (!d.dataTransfer) return;
|
|
6904
6904
|
const { empty: m, $from: x, $to: w } = u.state.selection, p = Os(d, r), f = Ue(x, w, 0), I = f.some((E) => p.find((b) => b.$from === E.$from && b.$to === E.$to)), T = m || !I ? p : f;
|
|
6905
6905
|
if (T.length === 0) return;
|
|
6906
|
-
const { tr: v } = u.state, y = document.createElement("div"), C = T[0].$from.pos, M = T[T.length - 1].$to.pos, L =
|
|
6906
|
+
const { tr: v } = u.state, y = document.createElement("div"), C = T[0].$from.pos, M = T[T.length - 1].$to.pos, L = ct.create(u.state.doc, C, M), N = L.content();
|
|
6907
6907
|
T.forEach((E) => {
|
|
6908
6908
|
const b = Ps(u.nodeDOM(E.$from.pos));
|
|
6909
6909
|
y.append(b);
|
|
@@ -6918,9 +6918,9 @@ function Hs({
|
|
|
6918
6918
|
init: () => ({ locked: !1 }),
|
|
6919
6919
|
apply(d, u) {
|
|
6920
6920
|
const m = d.getMeta("lockDragHandle"), x = d.getMeta("hideDragHandle");
|
|
6921
|
-
if (m !== void 0 && (l = m), x &&
|
|
6922
|
-
return
|
|
6923
|
-
if (d.docChanged && h !== -1 && e &&
|
|
6921
|
+
if (m !== void 0 && (l = m), x && a)
|
|
6922
|
+
return a.hide(), l = !1, s = null, h = -1, c == null || c({ editor: r, node: null, pos: -1 }), u;
|
|
6923
|
+
if (d.docChanged && h !== -1 && e && a) {
|
|
6924
6924
|
const w = d.mapping.map(h);
|
|
6925
6925
|
w !== h && (h = w);
|
|
6926
6926
|
}
|
|
@@ -6928,12 +6928,12 @@ function Hs({
|
|
|
6928
6928
|
}
|
|
6929
6929
|
},
|
|
6930
6930
|
view: (d) => {
|
|
6931
|
-
return u(), m(r.view.dom),
|
|
6931
|
+
return u(), m(r.view.dom), a = ho(d.dom, {
|
|
6932
6932
|
...x(),
|
|
6933
6933
|
...n
|
|
6934
6934
|
}), {
|
|
6935
6935
|
update(y, C) {
|
|
6936
|
-
if (!w(e,
|
|
6936
|
+
if (!w(e, a) || (e.draggable = !l, !p(y, C)))
|
|
6937
6937
|
return;
|
|
6938
6938
|
const M = f(y);
|
|
6939
6939
|
M && I(y, M);
|
|
@@ -6994,19 +6994,19 @@ function Hs({
|
|
|
6994
6994
|
if (L === s)
|
|
6995
6995
|
return;
|
|
6996
6996
|
const N = fr(r.state.doc, M);
|
|
6997
|
-
s = L, h = N,
|
|
6997
|
+
s = L, h = N, c == null || c({
|
|
6998
6998
|
editor: r,
|
|
6999
6999
|
node: s,
|
|
7000
7000
|
pos: h
|
|
7001
7001
|
}), T(C);
|
|
7002
7002
|
}
|
|
7003
7003
|
function T(y) {
|
|
7004
|
-
|
|
7004
|
+
a.setProps({
|
|
7005
7005
|
getReferenceClientRect: () => y.getBoundingClientRect()
|
|
7006
|
-
}),
|
|
7006
|
+
}), a.show();
|
|
7007
7007
|
}
|
|
7008
7008
|
function v() {
|
|
7009
|
-
|
|
7009
|
+
a == null || a.destroy(), e && xr(o);
|
|
7010
7010
|
}
|
|
7011
7011
|
},
|
|
7012
7012
|
props: {
|
|
@@ -7018,10 +7018,10 @@ function Hs({
|
|
|
7018
7018
|
return p.target && !o.contains(p.relatedTarget);
|
|
7019
7019
|
}
|
|
7020
7020
|
function x() {
|
|
7021
|
-
|
|
7021
|
+
a == null || a.hide();
|
|
7022
7022
|
}
|
|
7023
7023
|
function w() {
|
|
7024
|
-
s = null, h = -1,
|
|
7024
|
+
s = null, h = -1, c == null || c({
|
|
7025
7025
|
editor: r,
|
|
7026
7026
|
node: null,
|
|
7027
7027
|
pos: -1
|
|
@@ -7029,9 +7029,9 @@ function Hs({
|
|
|
7029
7029
|
}
|
|
7030
7030
|
},
|
|
7031
7031
|
mousemove: Oe((d, u) => {
|
|
7032
|
-
if (!e || !
|
|
7032
|
+
if (!e || !a || l)
|
|
7033
7033
|
return !1;
|
|
7034
|
-
const m =
|
|
7034
|
+
const m = ci({
|
|
7035
7035
|
x: u.clientX,
|
|
7036
7036
|
y: u.clientY,
|
|
7037
7037
|
direction: "right",
|
|
@@ -7046,13 +7046,13 @@ function Hs({
|
|
|
7046
7046
|
if (p === s)
|
|
7047
7047
|
return !1;
|
|
7048
7048
|
const f = fr(r.state.doc, w);
|
|
7049
|
-
return s = p, h = f,
|
|
7049
|
+
return s = p, h = f, c == null || c({
|
|
7050
7050
|
editor: r,
|
|
7051
7051
|
node: s,
|
|
7052
7052
|
pos: h
|
|
7053
|
-
}),
|
|
7053
|
+
}), a.setProps({
|
|
7054
7054
|
getReferenceClientRect: () => x.getBoundingClientRect()
|
|
7055
|
-
}),
|
|
7055
|
+
}), a.show(), !1;
|
|
7056
7056
|
}, 100)
|
|
7057
7057
|
}
|
|
7058
7058
|
}
|
|
@@ -7060,7 +7060,7 @@ function Hs({
|
|
|
7060
7060
|
}
|
|
7061
7061
|
function Ds(t) {
|
|
7062
7062
|
var N, E, b;
|
|
7063
|
-
const { pluginKey: e =
|
|
7063
|
+
const { pluginKey: e = ai } = t, { t: r } = q(), [n, c] = S(null), [o, a] = S(-1), l = J(null), s = J(null), [h, d] = S(!1), u = t.editor.extensionManager.extensions.some((k) => k.name === "textAlign"), m = t.editor.extensionManager.extensions.some((k) => k.name === "indent"), x = t.editor.extensionManager.extensions.some((k) => k.name === "clear");
|
|
7064
7064
|
B(() => {
|
|
7065
7065
|
l.current && !t.editor.isDestroyed && (s.current = Hs({
|
|
7066
7066
|
editor: t.editor,
|
|
@@ -7101,7 +7101,7 @@ function Ds(t) {
|
|
|
7101
7101
|
t.editor.chain().setMeta("hideDragHandle", !0).setNodeSelection(o).deleteSelection().run();
|
|
7102
7102
|
}
|
|
7103
7103
|
function C(k) {
|
|
7104
|
-
k.node &&
|
|
7104
|
+
k.node && c(k.node), a(k.pos);
|
|
7105
7105
|
}
|
|
7106
7106
|
function M() {
|
|
7107
7107
|
var k;
|
|
@@ -7333,35 +7333,35 @@ const _s = {
|
|
|
7333
7333
|
moveTransition: "transform 0.1s ease-out"
|
|
7334
7334
|
};
|
|
7335
7335
|
function Bs({ item: t, disabled: e, editor: r }) {
|
|
7336
|
-
var
|
|
7336
|
+
var c;
|
|
7337
7337
|
const n = t.component;
|
|
7338
7338
|
return n ? /* @__PURE__ */ i(
|
|
7339
7339
|
n,
|
|
7340
7340
|
{
|
|
7341
7341
|
...t.componentProps,
|
|
7342
|
-
disabled: e || ((
|
|
7342
|
+
disabled: e || ((c = t == null ? void 0 : t.componentProps) == null ? void 0 : c.disabled),
|
|
7343
7343
|
editor: r
|
|
7344
7344
|
}
|
|
7345
7345
|
) : /* @__PURE__ */ i(V, {});
|
|
7346
7346
|
}
|
|
7347
7347
|
function $s(t) {
|
|
7348
7348
|
const { t: e, lang: r } = q(), n = ({ editor: o }) => {
|
|
7349
|
-
const { selection:
|
|
7350
|
-
return l.pos === s ? !1 :
|
|
7351
|
-
},
|
|
7349
|
+
const { selection: a } = o.view.state, { $from: l, to: s } = a;
|
|
7350
|
+
return l.pos === s ? !1 : a instanceof Wt;
|
|
7351
|
+
}, c = U(() => t.disabled || !(t != null && t.editor) ? [] : zs(t.editor, e), [t.disabled, t.editor, r, e]);
|
|
7352
7352
|
return /* @__PURE__ */ i(
|
|
7353
7353
|
tt,
|
|
7354
7354
|
{
|
|
7355
7355
|
editor: t == null ? void 0 : t.editor,
|
|
7356
7356
|
shouldShow: n,
|
|
7357
7357
|
tippyOptions: _s,
|
|
7358
|
-
children:
|
|
7358
|
+
children: c != null && c.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-gap-[4px] richtext-whitespace-nowrap", children: c == null ? void 0 : c.map((o, a) => (o == null ? void 0 : o.type) === "divider" ? /* @__PURE__ */ i(
|
|
7359
7359
|
rt,
|
|
7360
7360
|
{
|
|
7361
7361
|
className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
|
|
7362
7362
|
orientation: "vertical"
|
|
7363
7363
|
},
|
|
7364
|
-
`bubbleMenu-divider-${
|
|
7364
|
+
`bubbleMenu-divider-${a}`
|
|
7365
7365
|
) : /* @__PURE__ */ i(
|
|
7366
7366
|
Bs,
|
|
7367
7367
|
{
|
|
@@ -7369,18 +7369,18 @@ function $s(t) {
|
|
|
7369
7369
|
editor: t.editor,
|
|
7370
7370
|
item: o
|
|
7371
7371
|
},
|
|
7372
|
-
`bubbleMenu-text-${
|
|
7372
|
+
`bubbleMenu-text-${a}`
|
|
7373
7373
|
)) }) }) : /* @__PURE__ */ i(V, {})
|
|
7374
7374
|
}
|
|
7375
7375
|
);
|
|
7376
7376
|
}
|
|
7377
7377
|
function Vs({ editor: t, disabled: e, actions: r }) {
|
|
7378
7378
|
var f, I, T, v, y, C, M, L, N, E, b, k, _, D, R, A, $, F;
|
|
7379
|
-
const n = ({ editor: Y }) => Ni(Y.view.state, "table"), { t:
|
|
7379
|
+
const n = ({ editor: Y }) => Ni(Y.view.state, "table"), { t: c } = q();
|
|
7380
7380
|
function o() {
|
|
7381
7381
|
t.chain().focus().addColumnBefore().run();
|
|
7382
7382
|
}
|
|
7383
|
-
function
|
|
7383
|
+
function a() {
|
|
7384
7384
|
t.chain().focus().addColumnAfter().run();
|
|
7385
7385
|
}
|
|
7386
7386
|
function l() {
|
|
@@ -7443,7 +7443,7 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7443
7443
|
action: o,
|
|
7444
7444
|
disabled: !((I = (f = t == null ? void 0 : t.can()) == null ? void 0 : f.addColumnBefore) != null && I.call(f)),
|
|
7445
7445
|
icon: "BetweenHorizonalEnd",
|
|
7446
|
-
tooltip:
|
|
7446
|
+
tooltip: c("editor.table.menu.insertColumnBefore"),
|
|
7447
7447
|
"tooltip-options": {
|
|
7448
7448
|
sideOffset: 15
|
|
7449
7449
|
}
|
|
@@ -7452,10 +7452,10 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7452
7452
|
/* @__PURE__ */ i(
|
|
7453
7453
|
O,
|
|
7454
7454
|
{
|
|
7455
|
-
action:
|
|
7455
|
+
action: a,
|
|
7456
7456
|
disabled: !((v = (T = t == null ? void 0 : t.can()) == null ? void 0 : T.addColumnAfter) != null && v.call(T)),
|
|
7457
7457
|
icon: "BetweenHorizonalStart",
|
|
7458
|
-
tooltip:
|
|
7458
|
+
tooltip: c("editor.table.menu.insertColumnAfter"),
|
|
7459
7459
|
"tooltip-options": {
|
|
7460
7460
|
sideOffset: 15
|
|
7461
7461
|
}
|
|
@@ -7467,7 +7467,7 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7467
7467
|
action: l,
|
|
7468
7468
|
disabled: !((C = t == null ? void 0 : (y = t.can()).deleteColumn) != null && C.call(y)),
|
|
7469
7469
|
icon: "DeleteColumn",
|
|
7470
|
-
tooltip:
|
|
7470
|
+
tooltip: c("editor.table.menu.deleteColumn"),
|
|
7471
7471
|
"tooltip-options": {
|
|
7472
7472
|
sideOffset: 15
|
|
7473
7473
|
}
|
|
@@ -7486,7 +7486,7 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7486
7486
|
action: s,
|
|
7487
7487
|
disabled: !((L = t == null ? void 0 : (M = t.can()).addRowBefore) != null && L.call(M)),
|
|
7488
7488
|
icon: "BetweenVerticalEnd",
|
|
7489
|
-
tooltip:
|
|
7489
|
+
tooltip: c("editor.table.menu.insertRowAbove"),
|
|
7490
7490
|
"tooltip-options": {
|
|
7491
7491
|
sideOffset: 15
|
|
7492
7492
|
}
|
|
@@ -7498,7 +7498,7 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7498
7498
|
action: h,
|
|
7499
7499
|
disabled: !((E = (N = t == null ? void 0 : t.can()) == null ? void 0 : N.addRowAfter) != null && E.call(N)),
|
|
7500
7500
|
icon: "BetweenVerticalStart",
|
|
7501
|
-
tooltip:
|
|
7501
|
+
tooltip: c("editor.table.menu.insertRowBelow"),
|
|
7502
7502
|
"tooltip-options": {
|
|
7503
7503
|
sideOffset: 15
|
|
7504
7504
|
}
|
|
@@ -7510,7 +7510,7 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7510
7510
|
action: d,
|
|
7511
7511
|
disabled: !((k = (b = t == null ? void 0 : t.can()) == null ? void 0 : b.deleteRow) != null && k.call(b)),
|
|
7512
7512
|
icon: "DeleteRow",
|
|
7513
|
-
tooltip:
|
|
7513
|
+
tooltip: c("editor.table.menu.deleteRow"),
|
|
7514
7514
|
"tooltip-options": {
|
|
7515
7515
|
sideOffset: 15
|
|
7516
7516
|
}
|
|
@@ -7529,7 +7529,7 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7529
7529
|
action: u,
|
|
7530
7530
|
disabled: !((D = (_ = t == null ? void 0 : t.can()) == null ? void 0 : _.mergeCells) != null && D.call(_)),
|
|
7531
7531
|
icon: "TableCellsMerge",
|
|
7532
|
-
tooltip:
|
|
7532
|
+
tooltip: c("editor.table.menu.mergeCells"),
|
|
7533
7533
|
"tooltip-options": {
|
|
7534
7534
|
sideOffset: 15
|
|
7535
7535
|
}
|
|
@@ -7541,7 +7541,7 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7541
7541
|
action: m,
|
|
7542
7542
|
disabled: !((A = (R = t == null ? void 0 : t.can()) == null ? void 0 : R.splitCell) != null && A.call(R)),
|
|
7543
7543
|
icon: "TableCellsSplit",
|
|
7544
|
-
tooltip:
|
|
7544
|
+
tooltip: c("editor.table.menu.splitCells"),
|
|
7545
7545
|
"tooltip-options": {
|
|
7546
7546
|
sideOffset: 15
|
|
7547
7547
|
}
|
|
@@ -7555,11 +7555,11 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7555
7555
|
}
|
|
7556
7556
|
),
|
|
7557
7557
|
/* @__PURE__ */ i(
|
|
7558
|
-
|
|
7558
|
+
xc,
|
|
7559
7559
|
{
|
|
7560
7560
|
action: w,
|
|
7561
7561
|
editor: t,
|
|
7562
|
-
tooltip:
|
|
7562
|
+
tooltip: c("editor.table.menu.setCellsBgColor"),
|
|
7563
7563
|
tooltipOptions: {
|
|
7564
7564
|
sideOffset: 15
|
|
7565
7565
|
}
|
|
@@ -7571,7 +7571,7 @@ function Vs({ editor: t, disabled: e, actions: r }) {
|
|
|
7571
7571
|
action: x,
|
|
7572
7572
|
disabled: !((F = ($ = t == null ? void 0 : t.can()) == null ? void 0 : $.deleteTable) != null && F.call($)),
|
|
7573
7573
|
icon: "Trash2",
|
|
7574
|
-
tooltip:
|
|
7574
|
+
tooltip: c("editor.table.menu.deleteTable"),
|
|
7575
7575
|
"tooltip-options": {
|
|
7576
7576
|
sideOffset: 15
|
|
7577
7577
|
}
|
|
@@ -7632,10 +7632,10 @@ function Ws(t) {
|
|
|
7632
7632
|
] });
|
|
7633
7633
|
}
|
|
7634
7634
|
function Fs({ editor: t, disabled: e }) {
|
|
7635
|
-
const [r, n] = S(!1),
|
|
7635
|
+
const [r, n] = S(!1), c = U(() => {
|
|
7636
7636
|
const { href: s } = t.getAttributes("link");
|
|
7637
7637
|
return s;
|
|
7638
|
-
}, [t]), o = H(({ editor: s }) => s.isActive("link"), []),
|
|
7638
|
+
}, [t]), o = H(({ editor: s }) => s.isActive("link"), []), a = (s, h, d) => {
|
|
7639
7639
|
t.chain().extendMarkRange("link").insertContent({
|
|
7640
7640
|
type: "text",
|
|
7641
7641
|
text: h,
|
|
@@ -7668,7 +7668,7 @@ function Fs({ editor: t, disabled: e }) {
|
|
|
7668
7668
|
n(!1);
|
|
7669
7669
|
}
|
|
7670
7670
|
},
|
|
7671
|
-
children: e ? /* @__PURE__ */ i(V, {}) : /* @__PURE__ */ i(V, { children: r ? /* @__PURE__ */ i(
|
|
7671
|
+
children: e ? /* @__PURE__ */ i(V, {}) : /* @__PURE__ */ i(V, { children: r ? /* @__PURE__ */ i(fc, { onSetLink: a, editor: t }) : /* @__PURE__ */ i(
|
|
7672
7672
|
Ws,
|
|
7673
7673
|
{
|
|
7674
7674
|
editor: t,
|
|
@@ -7676,7 +7676,7 @@ function Fs({ editor: t, disabled: e }) {
|
|
|
7676
7676
|
onEdit: () => {
|
|
7677
7677
|
n(!0);
|
|
7678
7678
|
},
|
|
7679
|
-
link:
|
|
7679
|
+
link: c
|
|
7680
7680
|
}
|
|
7681
7681
|
) })
|
|
7682
7682
|
}
|
|
@@ -7689,7 +7689,7 @@ const qe = {
|
|
|
7689
7689
|
moveTransition: "transform 0.1s ease-out"
|
|
7690
7690
|
};
|
|
7691
7691
|
function je({ item: t, disabled: e, editor: r }) {
|
|
7692
|
-
var
|
|
7692
|
+
var c;
|
|
7693
7693
|
const n = t.component;
|
|
7694
7694
|
return n ? /* @__PURE__ */ i(Pe, { children: t.type === "divider" ? /* @__PURE__ */ i(
|
|
7695
7695
|
rt,
|
|
@@ -7701,7 +7701,7 @@ function je({ item: t, disabled: e, editor: r }) {
|
|
|
7701
7701
|
n,
|
|
7702
7702
|
{
|
|
7703
7703
|
...t.componentProps,
|
|
7704
|
-
disabled: e || ((
|
|
7704
|
+
disabled: e || ((c = t == null ? void 0 : t.componentProps) == null ? void 0 : c.disabled),
|
|
7705
7705
|
editor: r
|
|
7706
7706
|
}
|
|
7707
7707
|
) }) : /* @__PURE__ */ i(V, {});
|
|
@@ -7716,10 +7716,10 @@ function qs(t) {
|
|
|
7716
7716
|
return t.type.name === ti.name;
|
|
7717
7717
|
}
|
|
7718
7718
|
function js(t) {
|
|
7719
|
-
const { lang: e } = q(), r = ({ editor:
|
|
7720
|
-
const { selection: o } =
|
|
7719
|
+
const { lang: e } = q(), r = ({ editor: c }) => {
|
|
7720
|
+
const { selection: o } = c.view.state, { $from: a, to: l } = o;
|
|
7721
7721
|
let s = !1;
|
|
7722
|
-
return
|
|
7722
|
+
return c.view.state.doc.nodesBetween(a.pos, l, (h) => {
|
|
7723
7723
|
if (Us(h))
|
|
7724
7724
|
return s = !0, !1;
|
|
7725
7725
|
}), s;
|
|
@@ -7730,12 +7730,12 @@ function js(t) {
|
|
|
7730
7730
|
editor: t == null ? void 0 : t.editor,
|
|
7731
7731
|
shouldShow: r,
|
|
7732
7732
|
tippyOptions: qe,
|
|
7733
|
-
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((
|
|
7733
|
+
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((c, o) => /* @__PURE__ */ i(
|
|
7734
7734
|
je,
|
|
7735
7735
|
{
|
|
7736
7736
|
disabled: t.disabled,
|
|
7737
7737
|
editor: t.editor,
|
|
7738
|
-
item:
|
|
7738
|
+
item: c
|
|
7739
7739
|
},
|
|
7740
7740
|
`bubbleMenu-image-${o}`
|
|
7741
7741
|
)) }) }) : /* @__PURE__ */ i(V, {})
|
|
@@ -7743,10 +7743,10 @@ function js(t) {
|
|
|
7743
7743
|
) });
|
|
7744
7744
|
}
|
|
7745
7745
|
function Xs(t) {
|
|
7746
|
-
const { lang: e } = q(), r = ({ editor:
|
|
7747
|
-
const { selection: o } =
|
|
7746
|
+
const { lang: e } = q(), r = ({ editor: c }) => {
|
|
7747
|
+
const { selection: o } = c.view.state, { $from: a, to: l } = o;
|
|
7748
7748
|
let s = !1;
|
|
7749
|
-
return
|
|
7749
|
+
return c.view.state.doc.nodesBetween(a.pos, l, (h) => {
|
|
7750
7750
|
if (Gs(h))
|
|
7751
7751
|
return s = !0, !1;
|
|
7752
7752
|
}), s;
|
|
@@ -7757,12 +7757,12 @@ function Xs(t) {
|
|
|
7757
7757
|
editor: t == null ? void 0 : t.editor,
|
|
7758
7758
|
shouldShow: r,
|
|
7759
7759
|
tippyOptions: qe,
|
|
7760
|
-
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((
|
|
7760
|
+
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((c, o) => /* @__PURE__ */ i(
|
|
7761
7761
|
je,
|
|
7762
7762
|
{
|
|
7763
7763
|
disabled: t.disabled,
|
|
7764
7764
|
editor: t.editor,
|
|
7765
|
-
item:
|
|
7765
|
+
item: c
|
|
7766
7766
|
},
|
|
7767
7767
|
`bubbleMenu-image-gif-${o}`
|
|
7768
7768
|
)) }) }) : /* @__PURE__ */ i(V, {})
|
|
@@ -7770,10 +7770,10 @@ function Xs(t) {
|
|
|
7770
7770
|
) });
|
|
7771
7771
|
}
|
|
7772
7772
|
function Ys(t) {
|
|
7773
|
-
const { lang: e } = q(), r = ({ editor:
|
|
7774
|
-
const { selection: o } =
|
|
7773
|
+
const { lang: e } = q(), r = ({ editor: c }) => {
|
|
7774
|
+
const { selection: o } = c.view.state, { $from: a, to: l } = o;
|
|
7775
7775
|
let s = !1;
|
|
7776
|
-
return
|
|
7776
|
+
return c.view.state.doc.nodesBetween(a.pos, l, (h) => {
|
|
7777
7777
|
if (qs(h))
|
|
7778
7778
|
return s = !0, !1;
|
|
7779
7779
|
}), s;
|
|
@@ -7784,12 +7784,12 @@ function Ys(t) {
|
|
|
7784
7784
|
editor: t == null ? void 0 : t.editor,
|
|
7785
7785
|
shouldShow: r,
|
|
7786
7786
|
tippyOptions: qe,
|
|
7787
|
-
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((
|
|
7787
|
+
children: n != null && n.length ? /* @__PURE__ */ i("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ i("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: n == null ? void 0 : n.map((c, o) => /* @__PURE__ */ i(
|
|
7788
7788
|
je,
|
|
7789
7789
|
{
|
|
7790
7790
|
disabled: t.disabled,
|
|
7791
7791
|
editor: t.editor,
|
|
7792
|
-
item:
|
|
7792
|
+
item: c
|
|
7793
7793
|
},
|
|
7794
7794
|
`bubbleMenu-video-${o}`
|
|
7795
7795
|
)) }) }) : /* @__PURE__ */ i(V, {})
|
|
@@ -7797,7 +7797,7 @@ function Ys(t) {
|
|
|
7797
7797
|
) });
|
|
7798
7798
|
}
|
|
7799
7799
|
function Ks({ editor: t }) {
|
|
7800
|
-
const { t: e } = q(), r = H(() => t.isActive(le.name), [t]), n = H(() => Gt(le.name, t), [t]),
|
|
7800
|
+
const { t: e } = q(), r = H(() => t.isActive(le.name), [t]), n = H(() => Gt(le.name, t), [t]), c = H(() => t.chain().focus().addColBefore().run(), [t]), o = H(() => t.chain().focus().addColAfter().run(), [t]), a = H(() => t.chain().focus().deleteCol().run(), [t]);
|
|
7801
7801
|
return /* @__PURE__ */ i(
|
|
7802
7802
|
tt,
|
|
7803
7803
|
{
|
|
@@ -7819,7 +7819,7 @@ function Ks({ editor: t }) {
|
|
|
7819
7819
|
/* @__PURE__ */ i(
|
|
7820
7820
|
O,
|
|
7821
7821
|
{
|
|
7822
|
-
action:
|
|
7822
|
+
action: c,
|
|
7823
7823
|
icon: "ColumnAddLeft",
|
|
7824
7824
|
tooltip: e("editor.table.menu.insertColumnBefore")
|
|
7825
7825
|
}
|
|
@@ -7835,7 +7835,7 @@ function Ks({ editor: t }) {
|
|
|
7835
7835
|
/* @__PURE__ */ i(
|
|
7836
7836
|
O,
|
|
7837
7837
|
{
|
|
7838
|
-
action:
|
|
7838
|
+
action: a,
|
|
7839
7839
|
icon: "DeleteColumn",
|
|
7840
7840
|
tooltip: e("editor.table.menu.deleteColumn")
|
|
7841
7841
|
}
|
|
@@ -7854,8 +7854,8 @@ function Ks({ editor: t }) {
|
|
|
7854
7854
|
}
|
|
7855
7855
|
function Zs({ editor: t, extensions: e }) {
|
|
7856
7856
|
const { t: r } = q(), n = U(() => {
|
|
7857
|
-
var
|
|
7858
|
-
return (
|
|
7857
|
+
var c, o, a;
|
|
7858
|
+
return (a = (o = (c = e == null ? void 0 : e.find((l) => l.name === "base-kit")) == null ? void 0 : c.options) == null ? void 0 : o.characterCount) == null ? void 0 : a.limit;
|
|
7859
7859
|
}, [e]);
|
|
7860
7860
|
return n ? /* @__PURE__ */ i("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-flex-col", children: /* @__PURE__ */ i("div", { className: "richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm", children: /* @__PURE__ */ g("span", { children: [
|
|
7861
7861
|
t.storage.characterCount.characters(),
|
|
@@ -7872,7 +7872,7 @@ function Zs({ editor: t, extensions: e }) {
|
|
|
7872
7872
|
function Js() {
|
|
7873
7873
|
const { toasts: t } = Uo();
|
|
7874
7874
|
return /* @__PURE__ */ g(Ro, { children: [
|
|
7875
|
-
t.map(({ id: e, title: r, description: n, action:
|
|
7875
|
+
t.map(({ id: e, title: r, description: n, action: c, ...o }) => /* @__PURE__ */ g(
|
|
7876
7876
|
Wr,
|
|
7877
7877
|
{
|
|
7878
7878
|
...o,
|
|
@@ -7881,7 +7881,7 @@ function Js() {
|
|
|
7881
7881
|
r && /* @__PURE__ */ i(Ur, { children: r }),
|
|
7882
7882
|
n && /* @__PURE__ */ i(Gr, { children: n })
|
|
7883
7883
|
] }),
|
|
7884
|
-
|
|
7884
|
+
c,
|
|
7885
7885
|
/* @__PURE__ */ i(Fr, {})
|
|
7886
7886
|
]
|
|
7887
7887
|
},
|
|
@@ -7891,7 +7891,7 @@ function Js() {
|
|
|
7891
7891
|
] });
|
|
7892
7892
|
}
|
|
7893
7893
|
const Qs = `
|
|
7894
|
-
.reactjs-tiptap-editor,
|
|
7894
|
+
.reactjs-tiptap-editor,
|
|
7895
7895
|
.richtext-dialog-content {
|
|
7896
7896
|
button,
|
|
7897
7897
|
input:where([type=button]),
|
|
@@ -7904,8 +7904,7 @@ const Qs = `
|
|
|
7904
7904
|
|
|
7905
7905
|
input,
|
|
7906
7906
|
optgroup,
|
|
7907
|
-
select
|
|
7908
|
-
textarea {
|
|
7907
|
+
select {
|
|
7909
7908
|
font-family: inherit;
|
|
7910
7909
|
font-feature-settings: inherit;
|
|
7911
7910
|
font-variation-settings: inherit;
|
|
@@ -7971,21 +7970,17 @@ const Qs = `
|
|
|
7971
7970
|
border-collapse: collapse;
|
|
7972
7971
|
}
|
|
7973
7972
|
|
|
7974
|
-
input
|
|
7973
|
+
input {
|
|
7975
7974
|
border-width: 1px;
|
|
7976
7975
|
}
|
|
7977
7976
|
|
|
7978
|
-
textarea {
|
|
7979
|
-
resize: vertical;
|
|
7980
|
-
}
|
|
7981
7977
|
|
|
7982
|
-
input::placeholder
|
|
7983
|
-
textarea::placeholder {
|
|
7978
|
+
input::placeholder {
|
|
7984
7979
|
opacity: 1;
|
|
7985
7980
|
color: #9ca3af;
|
|
7986
7981
|
}
|
|
7987
7982
|
|
|
7988
|
-
button, input
|
|
7983
|
+
button, input {
|
|
7989
7984
|
cursor: pointer;
|
|
7990
7985
|
color: inherit;
|
|
7991
7986
|
}
|
|
@@ -8023,25 +8018,25 @@ div[data-tippy-root] {
|
|
|
8023
8018
|
background-color: hsl(var(--richtext-background));
|
|
8024
8019
|
color: hsl(var(--richtext-foreground));
|
|
8025
8020
|
|
|
8026
|
-
button, input
|
|
8021
|
+
button, input {
|
|
8027
8022
|
cursor: pointer;
|
|
8028
8023
|
color: inherit;
|
|
8029
8024
|
}
|
|
8030
8025
|
}
|
|
8031
8026
|
`, tl = pi(({ children: t, id: e }) => {
|
|
8032
|
-
const [, r] = Or((
|
|
8027
|
+
const [, r] = Or((a) => a.value), [, n] = Hr((a) => a.value), c = (a) => {
|
|
8033
8028
|
r({
|
|
8034
|
-
value:
|
|
8029
|
+
value: a.detail
|
|
8035
8030
|
});
|
|
8036
|
-
}, o = (
|
|
8031
|
+
}, o = (a) => {
|
|
8037
8032
|
n({
|
|
8038
|
-
value:
|
|
8033
|
+
value: a.detail
|
|
8039
8034
|
});
|
|
8040
8035
|
};
|
|
8041
8036
|
return B(() => {
|
|
8042
|
-
const
|
|
8037
|
+
const a = se(bt.EDIT(e), c), l = se(bt.UPDATE_THEME(e), o);
|
|
8043
8038
|
return () => {
|
|
8044
|
-
|
|
8039
|
+
a(), l();
|
|
8045
8040
|
};
|
|
8046
8041
|
}, []), /* @__PURE__ */ i(V, { children: t });
|
|
8047
8042
|
});
|
|
@@ -8077,16 +8072,16 @@ function li(t) {
|
|
|
8077
8072
|
);
|
|
8078
8073
|
}
|
|
8079
8074
|
function di(t, e = {}) {
|
|
8080
|
-
const { csp: r, prepend: n, priority:
|
|
8081
|
-
l.setAttribute(wr, o),
|
|
8075
|
+
const { csp: r, prepend: n, priority: c = 0 } = e, o = nl(n), a = o === "prependQueue", l = document.createElement("style");
|
|
8076
|
+
l.setAttribute(wr, o), a && c && l.setAttribute(vr, `${c}`), r != null && r.nonce && (l.nonce = r == null ? void 0 : r.nonce), l.innerHTML = t;
|
|
8082
8077
|
const s = Xe(e), { firstChild: h } = s;
|
|
8083
8078
|
if (n) {
|
|
8084
|
-
if (
|
|
8079
|
+
if (a) {
|
|
8085
8080
|
const d = li(s).filter((u) => {
|
|
8086
8081
|
if (!["prepend", "prependQueue"].includes(u.getAttribute(wr)))
|
|
8087
8082
|
return !1;
|
|
8088
8083
|
const m = Number(u.getAttribute(vr) || 0);
|
|
8089
|
-
return
|
|
8084
|
+
return c >= m;
|
|
8090
8085
|
});
|
|
8091
8086
|
if (d.length > 0)
|
|
8092
8087
|
return s.insertBefore(l, d.at(-1).nextSibling), l;
|
|
@@ -8104,25 +8099,25 @@ function ol(t, e = {}) {
|
|
|
8104
8099
|
const r = hi(t, e);
|
|
8105
8100
|
r && r.remove();
|
|
8106
8101
|
}
|
|
8107
|
-
function
|
|
8102
|
+
function cl(t, e) {
|
|
8108
8103
|
const r = ze.get(t);
|
|
8109
8104
|
if (!r || !il(document, r)) {
|
|
8110
|
-
const n = di("", e), { parentNode:
|
|
8111
|
-
ze.set(t,
|
|
8105
|
+
const n = di("", e), { parentNode: c } = n;
|
|
8106
|
+
ze.set(t, c), n.remove();
|
|
8112
8107
|
}
|
|
8113
8108
|
}
|
|
8114
|
-
function
|
|
8115
|
-
var
|
|
8109
|
+
function al(t, e, r = {}) {
|
|
8110
|
+
var a, l, s;
|
|
8116
8111
|
const n = Xe(r);
|
|
8117
|
-
|
|
8118
|
-
const
|
|
8119
|
-
if (
|
|
8120
|
-
return (
|
|
8112
|
+
cl(n, r);
|
|
8113
|
+
const c = hi(e, r);
|
|
8114
|
+
if (c)
|
|
8115
|
+
return (a = r.csp) != null && a.nonce && c.nonce !== ((l = r.csp) == null ? void 0 : l.nonce) && (c.nonce = (s = r.csp) == null ? void 0 : s.nonce), c.innerHTML !== t && (c.innerHTML = t), c;
|
|
8121
8116
|
const o = di(t, r);
|
|
8122
8117
|
return o.setAttribute(si(r), e), o;
|
|
8123
8118
|
}
|
|
8124
8119
|
function sl(t, e) {
|
|
8125
|
-
const { content: r, extensions: n, useEditorOptions:
|
|
8120
|
+
const { content: r, extensions: n, useEditorOptions: c = {} } = t, o = vi(), a = U(() => {
|
|
8126
8121
|
const u = Fi(n, n, "name");
|
|
8127
8122
|
return [...n.map((x) => {
|
|
8128
8123
|
const w = n.find((p) => p.name === x.name);
|
|
@@ -8133,20 +8128,20 @@ function sl(t, e) {
|
|
|
8133
8128
|
const m = h(u, t.output);
|
|
8134
8129
|
(x = t == null ? void 0 : t.onChangeContent) == null || x.call(t, m);
|
|
8135
8130
|
}, Ii), s = ki({
|
|
8136
|
-
extensions:
|
|
8131
|
+
extensions: a,
|
|
8137
8132
|
content: r,
|
|
8138
8133
|
onUpdate: ({ editor: u }) => {
|
|
8139
8134
|
l && l(u);
|
|
8140
8135
|
},
|
|
8141
|
-
...
|
|
8136
|
+
...c
|
|
8142
8137
|
});
|
|
8143
8138
|
bi(e, () => ({
|
|
8144
8139
|
editor: s
|
|
8145
8140
|
})), B(() => {
|
|
8146
|
-
document.documentElement.classList.toggle("dark", t.dark),
|
|
8141
|
+
document.documentElement.classList.toggle("dark", t.dark), jc.setTheme(o, t.dark ? "dark" : "light");
|
|
8147
8142
|
}, [t.dark]), B(() => {
|
|
8148
8143
|
s == null || s.setEditable(!(t != null && t.disabled)), bo.setDisable(o, !(t != null && t.disabled));
|
|
8149
|
-
}, [s, t == null ? void 0 : t.disabled]), B(() => ((t == null ? void 0 : t.resetCSS) !== !1 &&
|
|
8144
|
+
}, [s, t == null ? void 0 : t.disabled]), B(() => ((t == null ? void 0 : t.resetCSS) !== !1 && al(Qs, "react-tiptap-reset"), () => {
|
|
8150
8145
|
ol("react-tiptap-reset");
|
|
8151
8146
|
}), [t == null ? void 0 : t.resetCSS]);
|
|
8152
8147
|
function h(u, m) {
|
|
@@ -8210,7 +8205,7 @@ function sl(t, e) {
|
|
|
8210
8205
|
}
|
|
8211
8206
|
const zl = wi(sl);
|
|
8212
8207
|
export {
|
|
8213
|
-
|
|
8208
|
+
oc as $,
|
|
8214
8209
|
O as A,
|
|
8215
8210
|
G as B,
|
|
8216
8211
|
Zr as C,
|
|
@@ -8218,16 +8213,16 @@ export {
|
|
|
8218
8213
|
St as E,
|
|
8219
8214
|
Me as F,
|
|
8220
8215
|
Be as G,
|
|
8221
|
-
|
|
8216
|
+
xc as H,
|
|
8222
8217
|
Vt as I,
|
|
8223
8218
|
bt as J,
|
|
8224
8219
|
Mt as K,
|
|
8225
|
-
|
|
8220
|
+
fc as L,
|
|
8226
8221
|
le as M,
|
|
8227
|
-
|
|
8222
|
+
Cc as N,
|
|
8228
8223
|
se as O,
|
|
8229
8224
|
It as P,
|
|
8230
|
-
|
|
8225
|
+
at as Q,
|
|
8231
8226
|
zl as R,
|
|
8232
8227
|
Q as S,
|
|
8233
8228
|
jr as T,
|
|
@@ -8237,7 +8232,7 @@ export {
|
|
|
8237
8232
|
ko as X,
|
|
8238
8233
|
Lt as Y,
|
|
8239
8234
|
El as Z,
|
|
8240
|
-
|
|
8235
|
+
cc as _,
|
|
8241
8236
|
Xr as a,
|
|
8242
8237
|
Ll as a0,
|
|
8243
8238
|
Al as a1,
|