reactjs-tiptap-editor 0.2.11 → 0.2.13
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-DJJ5SBya.cjs → RichTextEditor-DBjHuER_.cjs} +92 -89
- package/lib/{RichTextEditor-CIenLXbH.js → RichTextEditor-DqXFuGeI.js} +91 -88
- package/lib/extension-bundle.cjs +3 -3
- package/lib/extension-bundle.d.cts +56 -56
- package/lib/extension-bundle.d.ts +56 -56
- package/lib/extension-bundle.js +701 -697
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +56 -56
- package/lib/index.d.ts +56 -56
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +56 -56
- package/lib/locale-bundle.d.ts +56 -56
- package/lib/style.css +1 -1
- package/lib/{tiptap-DKUVyykT.js → tiptap-24JNJPT1.js} +204 -203
- package/lib/{tiptap-BjxGiEhB.cjs → tiptap-DaE4Kxno.cjs} +12 -12
- package/package.json +54 -54
package/lib/extension-bundle.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as nn, I as an, U as on, S as rn, C as sn, f as Ce, N as he, b as cn, c as ln, R as je, F as dn, H as un, T as hn, E as H, d as mn, e as fn, g as gn, h as Ae, O as _n, i as bn, j as xn, k as pn, L as wn, l as yn, m as Le, n as vn, o as kn, D as Cn, P as Nn, p as Tn, q as An, G as Ln, r as Sn, s as Mn, t as In, u as En, v as Hn, w as zn, x as Mt, y as It, z as Et, A as Ze, J as Rn, K as Pn, M as Dn, Q as On, V as jn, W as Bn } from "./tiptap-
|
|
1
|
+
import { a as nn, I as an, U as on, S as rn, C as sn, f as Ce, N as he, b as cn, c as ln, R as je, F as dn, H as un, T as hn, E as H, d as mn, e as fn, g as gn, h as Ae, O as _n, i as bn, j as xn, k as pn, L as wn, l as yn, m as Le, n as vn, o as kn, D as Cn, P as Nn, p as Tn, q as An, G as Ln, r as Sn, s as Mn, t as In, u as En, v as Hn, w as zn, x as Mt, y as It, z as Et, A as Ze, J as Rn, K as Pn, M as Dn, Q as On, V as jn, W as Bn } from "./tiptap-24JNJPT1.js";
|
|
2
2
|
import { P as J, b as Q, $ as me, a0 as ge, al as U, am as $n, T as Ht, A as Fn, an as zt, ak as Rt, ao as _t, ap as bt, aq as Un, a4 as Vn, ar as qn, as as Kn } from "./vendor-K5cb6hwc.js";
|
|
3
|
-
import { jsxs as
|
|
3
|
+
import { jsxs as g, jsx as r, Fragment as oe } from "react/jsx-runtime";
|
|
4
4
|
import * as V from "react";
|
|
5
5
|
import Pe, { useMemo as R, useState as k, useRef as X, useCallback as j, Fragment as Je, forwardRef as Qe, useImperativeHandle as et, useEffect as P } from "react";
|
|
6
6
|
import { ChevronDown as tt, Check as Pt, ChevronUp as Wn, Copy as Gn, CopyCheck as Xn, SearchIcon as Yn, LoaderIcon as Zn, LucideTableProperties as Jn, LucideSheet as Qn, LucideImage as ei, LucideFile as ti, LucideVideo as ni, LucideAudioLines as ii } from "lucide-react";
|
|
7
|
-
import { i as nt, T as Be, a as $e, B as O, b as Fe, g as it, A as y, D as re, c as se, d as ce, e as ai, f as E, u as at, h as oi, I as D, j as be, k as Dt, l as We, m as ri, n as ot, P as xe, o as pe, p as we, q as rt, C as si, H as ci, L as li, r as di, M as ui, s as hi, t as xt, v as Se, w as st, x as ct, y as lt, z as dt, E as mi, F as fi, G as gi, J as De, K as Oe, N as _i, S as bi, O as xi, Q as pi, U as Y, V as wi, W as yi, X as vi, Y as ki, Z as Ci, _ as Ot } from "./RichTextEditor-
|
|
8
|
-
import { a5 as Wr, a1 as Gr, $ as Xr, a2 as Yr, a0 as Zr, a3 as Jr, a4 as Qr } from "./RichTextEditor-
|
|
7
|
+
import { i as nt, T as Be, a as $e, B as O, b as Fe, g as it, A as y, D as re, c as se, d as ce, e as ai, f as E, u as at, h as oi, I as D, j as be, k as Dt, l as We, m as ri, n as ot, P as xe, o as pe, p as we, q as rt, C as si, H as ci, L as li, r as di, M as ui, s as hi, t as xt, v as Se, w as st, x as ct, y as lt, z as dt, E as mi, F as fi, G as gi, J as De, K as Oe, N as _i, S as bi, O as xi, Q as pi, U as Y, V as wi, W as yi, X as vi, Y as ki, Z as Ci, _ as Ot } from "./RichTextEditor-DqXFuGeI.js";
|
|
8
|
+
import { a5 as Wr, a1 as Gr, $ as Xr, a2 as Yr, a0 as Zr, a3 as Jr, a4 as Qr } from "./RichTextEditor-DqXFuGeI.js";
|
|
9
9
|
import { M as Ni, D as jt, u as B, f as Ti, g as Ai, h as pt, i as z, j as Bt, k as Li, I as wt, m as Si, n as yt, V as Mi, T as Me, o as Ie, p as Ee } from "./index-CGVy85-a.js";
|
|
10
10
|
import * as le from "@radix-ui/react-tabs";
|
|
11
11
|
import { bundledThemes as $t, bundledLanguages as Ft, createHighlighter as Ii } from "shiki";
|
|
@@ -20,10 +20,10 @@ import { Packer as zi, WidthType as Ri } from "docx";
|
|
|
20
20
|
import { DocxSerializer as Pi, defaultNodes as ne, defaultMarks as Di } from "prosemirror-docx";
|
|
21
21
|
const mt = Pe.forwardRef(
|
|
22
22
|
({ asChild: e, ...t }, n) => {
|
|
23
|
-
var
|
|
23
|
+
var o;
|
|
24
24
|
const i = nt[t.icon];
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ g(Be, { children: [
|
|
26
|
+
/* @__PURE__ */ r($e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
27
27
|
e ? Ei : O,
|
|
28
28
|
{
|
|
29
29
|
className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
|
|
@@ -31,15 +31,15 @@ const mt = Pe.forwardRef(
|
|
|
31
31
|
ref: n,
|
|
32
32
|
variant: "ghost",
|
|
33
33
|
...t,
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
-
(t == null ? void 0 : t.title) && /* @__PURE__ */
|
|
36
|
-
i && /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-h-full richtext-items-center richtext-font-normal", children: [
|
|
35
|
+
(t == null ? void 0 : t.title) && /* @__PURE__ */ r("div", { className: "richtext-grow richtext-truncate richtext-text-left richtext-text-sm", children: t == null ? void 0 : t.title }),
|
|
36
|
+
i && /* @__PURE__ */ r(i, { className: "richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500" })
|
|
37
37
|
] })
|
|
38
38
|
}
|
|
39
39
|
) }),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
(t == null ? void 0 : t.tooltip) && /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ r(Fe, { children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
|
|
41
|
+
(t == null ? void 0 : t.tooltip) && /* @__PURE__ */ r("div", { children: t == null ? void 0 : t.tooltip }),
|
|
42
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: it(t == null ? void 0 : t.shortcutKeys) }) })
|
|
43
43
|
] }) })
|
|
44
44
|
] });
|
|
45
45
|
}
|
|
@@ -169,7 +169,7 @@ async function Bi({
|
|
|
169
169
|
defaultTheme: n,
|
|
170
170
|
defaultLanguage: i
|
|
171
171
|
}) {
|
|
172
|
-
const a = Ce(e, (c) => c.type.name === t),
|
|
172
|
+
const a = Ce(e, (c) => c.type.name === t), o = [
|
|
173
173
|
...a.map((c) => c.node.attrs.theme),
|
|
174
174
|
n
|
|
175
175
|
], s = [
|
|
@@ -177,9 +177,9 @@ async function Bi({
|
|
|
177
177
|
i
|
|
178
178
|
];
|
|
179
179
|
G ? await Promise.all([
|
|
180
|
-
...
|
|
180
|
+
...o.flatMap((c) => Ut(c)),
|
|
181
181
|
...s.flatMap((c) => !!c && Vt(c))
|
|
182
|
-
]) : await ji({ languages: s, themes:
|
|
182
|
+
]) : await ji({ languages: s, themes: o });
|
|
183
183
|
}
|
|
184
184
|
function vt({
|
|
185
185
|
doc: e,
|
|
@@ -194,12 +194,12 @@ function vt({
|
|
|
194
194
|
if (!d)
|
|
195
195
|
return;
|
|
196
196
|
d.getLoadedLanguages().includes(l) || (l = "plaintext");
|
|
197
|
-
const
|
|
197
|
+
const f = d.getLoadedThemes().includes(u) ? u : d.getLoadedThemes()[0], m = d.codeToTokensBase(s.node.textContent, {
|
|
198
198
|
lang: l,
|
|
199
|
-
theme:
|
|
199
|
+
theme: f
|
|
200
200
|
});
|
|
201
|
-
for (const
|
|
202
|
-
for (const b of
|
|
201
|
+
for (const h of m) {
|
|
202
|
+
for (const b of h) {
|
|
203
203
|
const x = c + b.content.length, N = ge.inline(c, x, {
|
|
204
204
|
style: `color: ${b.color}`
|
|
205
205
|
});
|
|
@@ -217,7 +217,7 @@ function $i({
|
|
|
217
217
|
const i = new J({
|
|
218
218
|
key: new Q("shiki"),
|
|
219
219
|
view(a) {
|
|
220
|
-
class
|
|
220
|
+
class o {
|
|
221
221
|
constructor() {
|
|
222
222
|
this.initDecorations();
|
|
223
223
|
}
|
|
@@ -251,29 +251,29 @@ function $i({
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
return new
|
|
254
|
+
return new o();
|
|
255
255
|
},
|
|
256
256
|
state: {
|
|
257
|
-
init: (a, { doc:
|
|
258
|
-
doc:
|
|
257
|
+
init: (a, { doc: o }) => vt({
|
|
258
|
+
doc: o,
|
|
259
259
|
name: e,
|
|
260
260
|
defaultLanguage: t,
|
|
261
261
|
defaultTheme: n
|
|
262
262
|
}),
|
|
263
|
-
apply: (a,
|
|
263
|
+
apply: (a, o, s, c) => {
|
|
264
264
|
const l = s.selection.$head.parent.type.name, u = c.selection.$head.parent.type.name, d = Ce(
|
|
265
265
|
s.doc,
|
|
266
|
-
(
|
|
267
|
-
),
|
|
266
|
+
(h) => h.type.name === e
|
|
267
|
+
), f = Ce(
|
|
268
268
|
c.doc,
|
|
269
|
-
(
|
|
270
|
-
),
|
|
271
|
-
return a.getMeta("shikiPluginForceDecoration") ||
|
|
269
|
+
(h) => h.type.name === e
|
|
270
|
+
), m = a.docChanged && ([l, u].includes(e) || f.length !== d.length || a.steps.some((h) => h.from !== void 0 && h.to !== void 0 && d.some((b) => b.pos >= h.from && b.pos + b.node.nodeSize <= h.to)));
|
|
271
|
+
return a.getMeta("shikiPluginForceDecoration") || m ? vt({
|
|
272
272
|
doc: a.doc,
|
|
273
273
|
name: e,
|
|
274
274
|
defaultLanguage: t,
|
|
275
275
|
defaultTheme: n
|
|
276
|
-
}) :
|
|
276
|
+
}) : o.map(a.mapping, a.doc);
|
|
277
277
|
}
|
|
278
278
|
},
|
|
279
279
|
props: {
|
|
@@ -286,15 +286,15 @@ function $i({
|
|
|
286
286
|
return i;
|
|
287
287
|
}
|
|
288
288
|
function Fi({ action: e, languages: t, ...n }) {
|
|
289
|
-
const i = (
|
|
290
|
-
e(
|
|
291
|
-
}, a = R(() => t == null ? void 0 : t.map((
|
|
292
|
-
title: Ni[
|
|
289
|
+
const i = (o) => {
|
|
290
|
+
e(o);
|
|
291
|
+
}, a = R(() => t == null ? void 0 : t.map((o) => ({
|
|
292
|
+
title: Ni[o] || o,
|
|
293
293
|
// icon: language.icon,
|
|
294
|
-
language:
|
|
294
|
+
language: o
|
|
295
295
|
})), [t]);
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
296
|
+
return /* @__PURE__ */ g(re, { children: [
|
|
297
|
+
/* @__PURE__ */ r(se, { disabled: n == null ? void 0 : n.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
298
298
|
y,
|
|
299
299
|
{
|
|
300
300
|
tooltip: n == null ? void 0 : n.tooltip,
|
|
@@ -302,10 +302,10 @@ function Fi({ action: e, languages: t, ...n }) {
|
|
|
302
302
|
icon: n == null ? void 0 : n.icon
|
|
303
303
|
}
|
|
304
304
|
) }),
|
|
305
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ r(ce, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ r(ai, { onClick: () => i(o.language), children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", children: o.title }) }, `codeblock-${o.title}`)) })
|
|
306
306
|
] });
|
|
307
307
|
}
|
|
308
|
-
const Ui = I.Root, Vi = I.Value, qt = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */
|
|
308
|
+
const Ui = I.Root, Vi = I.Value, qt = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ g(
|
|
309
309
|
I.Trigger,
|
|
310
310
|
{
|
|
311
311
|
ref: i,
|
|
@@ -316,12 +316,12 @@ const Ui = I.Root, Vi = I.Value, qt = V.forwardRef(({ className: e, children: t,
|
|
|
316
316
|
...n,
|
|
317
317
|
children: [
|
|
318
318
|
t,
|
|
319
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ r(I.Icon, { asChild: !0, children: /* @__PURE__ */ r(tt, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
|
|
320
320
|
]
|
|
321
321
|
}
|
|
322
322
|
));
|
|
323
323
|
qt.displayName = I.Trigger.displayName;
|
|
324
|
-
const Kt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
324
|
+
const Kt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
325
325
|
I.ScrollUpButton,
|
|
326
326
|
{
|
|
327
327
|
ref: n,
|
|
@@ -330,11 +330,11 @@ const Kt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
330
330
|
e
|
|
331
331
|
),
|
|
332
332
|
...t,
|
|
333
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ r(Wn, { className: "richtext-h-4 richtext-w-4" })
|
|
334
334
|
}
|
|
335
335
|
));
|
|
336
336
|
Kt.displayName = I.ScrollUpButton.displayName;
|
|
337
|
-
const Wt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
337
|
+
const Wt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
338
338
|
I.ScrollDownButton,
|
|
339
339
|
{
|
|
340
340
|
ref: n,
|
|
@@ -343,11 +343,11 @@ const Wt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
343
343
|
e
|
|
344
344
|
),
|
|
345
345
|
...t,
|
|
346
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ r(tt, { className: "richtext-h-4 richtext-w-4" })
|
|
347
347
|
}
|
|
348
348
|
));
|
|
349
349
|
Wt.displayName = I.ScrollDownButton.displayName;
|
|
350
|
-
const Gt = V.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */
|
|
350
|
+
const Gt = V.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */ r(I.Portal, { children: /* @__PURE__ */ g(
|
|
351
351
|
I.Content,
|
|
352
352
|
{
|
|
353
353
|
ref: a,
|
|
@@ -359,8 +359,8 @@ const Gt = V.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
359
359
|
position: n,
|
|
360
360
|
...i,
|
|
361
361
|
children: [
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ r(Kt, {}),
|
|
363
|
+
/* @__PURE__ */ r(
|
|
364
364
|
I.Viewport,
|
|
365
365
|
{
|
|
366
366
|
className: E(
|
|
@@ -370,12 +370,12 @@ const Gt = V.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
370
370
|
children: t
|
|
371
371
|
}
|
|
372
372
|
),
|
|
373
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ r(Wt, {})
|
|
374
374
|
]
|
|
375
375
|
}
|
|
376
376
|
) }));
|
|
377
377
|
Gt.displayName = I.Content.displayName;
|
|
378
|
-
const qi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
378
|
+
const qi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
379
379
|
I.Label,
|
|
380
380
|
{
|
|
381
381
|
ref: n,
|
|
@@ -384,7 +384,7 @@ const qi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
384
384
|
}
|
|
385
385
|
));
|
|
386
386
|
qi.displayName = I.Label.displayName;
|
|
387
|
-
const Xe = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */
|
|
387
|
+
const Xe = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ g(
|
|
388
388
|
I.Item,
|
|
389
389
|
{
|
|
390
390
|
ref: i,
|
|
@@ -394,13 +394,13 @@ const Xe = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__
|
|
|
394
394
|
),
|
|
395
395
|
...n,
|
|
396
396
|
children: [
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ r("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ r(I.ItemIndicator, { children: /* @__PURE__ */ r(Pt, { className: "richtext-h-4 richtext-w-4" }) }) }),
|
|
398
|
+
/* @__PURE__ */ r(I.ItemText, { children: t })
|
|
399
399
|
]
|
|
400
400
|
}
|
|
401
401
|
));
|
|
402
402
|
Xe.displayName = I.Item.displayName;
|
|
403
|
-
const Ki = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
403
|
+
const Ki = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
404
404
|
I.Separator,
|
|
405
405
|
{
|
|
406
406
|
ref: n,
|
|
@@ -430,33 +430,33 @@ const Gi = "_wrap_134f4_1", Xi = "_maxHeight_134f4_10", Yi = "_btnCopy_134f4_13"
|
|
|
430
430
|
copied: ta
|
|
431
431
|
};
|
|
432
432
|
function na({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }) {
|
|
433
|
-
var
|
|
434
|
-
const { isCopied: a, copyToClipboard:
|
|
433
|
+
var m, h;
|
|
434
|
+
const { isCopied: a, copyToClipboard: o } = Wi(), s = R(() => {
|
|
435
435
|
var b;
|
|
436
436
|
return (b = i.options.languages) != null && b.length ? i.options.languages : jt;
|
|
437
|
-
}, [i.options.languages]), c = at(), l = (
|
|
438
|
-
return /* @__PURE__ */
|
|
439
|
-
/* @__PURE__ */
|
|
437
|
+
}, [i.options.languages]), c = at(), l = (h = (m = e == null ? void 0 : e.options) == null ? void 0 : m.editorProps) == null ? void 0 : h.print, { language: u } = t, d = X(null), f = j(() => oi(ia.name, e), [e]);
|
|
438
|
+
return /* @__PURE__ */ g(he, { className: U(Z.wrap, !l && Z.maxHeight, "render-wrapper"), children: [
|
|
439
|
+
/* @__PURE__ */ g(
|
|
440
440
|
"div",
|
|
441
441
|
{
|
|
442
442
|
className: U(Z.blockInfo, {
|
|
443
443
|
[Z.blockInfoEditable]: !c
|
|
444
444
|
}),
|
|
445
445
|
children: [
|
|
446
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ r(
|
|
447
447
|
"span",
|
|
448
448
|
{
|
|
449
449
|
className: U(Z.btnCopy, a && Z.copied),
|
|
450
|
-
onClick: () =>
|
|
451
|
-
children: a ? /* @__PURE__ */
|
|
450
|
+
onClick: () => o(d.current.innerText),
|
|
451
|
+
children: a ? /* @__PURE__ */ r(Xn, { size: 16 }) : /* @__PURE__ */ r(Gn, { size: 16 })
|
|
452
452
|
}
|
|
453
453
|
),
|
|
454
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ r(
|
|
455
455
|
"span",
|
|
456
456
|
{
|
|
457
457
|
className: Z.btnDelete,
|
|
458
|
-
onClick:
|
|
459
|
-
children: /* @__PURE__ */
|
|
458
|
+
onClick: f,
|
|
459
|
+
children: /* @__PURE__ */ r(
|
|
460
460
|
D,
|
|
461
461
|
{
|
|
462
462
|
name: "Trash2"
|
|
@@ -464,17 +464,17 @@ function na({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
|
|
|
464
464
|
)
|
|
465
465
|
}
|
|
466
466
|
),
|
|
467
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ r("div", { className: Z.selectLang, children: /* @__PURE__ */ g(
|
|
468
468
|
Ui,
|
|
469
469
|
{
|
|
470
470
|
defaultValue: u || "auto",
|
|
471
471
|
disabled: !c,
|
|
472
472
|
onValueChange: (b) => n({ language: b }),
|
|
473
473
|
children: [
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
s.map((b, x) => /* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ r(qt, { children: /* @__PURE__ */ r(Vi, { placeholder: "Language" }) }),
|
|
475
|
+
/* @__PURE__ */ g(Gt, { className: "richtext-max-h-60 richtext-overflow-y-auto", children: [
|
|
476
|
+
/* @__PURE__ */ r(Xe, { value: "auto", children: "Auto" }),
|
|
477
|
+
s.map((b, x) => /* @__PURE__ */ r(
|
|
478
478
|
Xe,
|
|
479
479
|
{
|
|
480
480
|
value: b,
|
|
@@ -489,7 +489,7 @@ function na({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
|
|
|
489
489
|
]
|
|
490
490
|
}
|
|
491
491
|
),
|
|
492
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ r("pre", { ref: d, children: /* @__PURE__ */ r(cn, { as: "code" }) })
|
|
493
493
|
] });
|
|
494
494
|
}
|
|
495
495
|
const ia = ln.extend({
|
|
@@ -499,8 +499,8 @@ const ia = ln.extend({
|
|
|
499
499
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
500
500
|
languages: [],
|
|
501
501
|
button: ({ editor: t, t: n, extension: i }) => {
|
|
502
|
-
var
|
|
503
|
-
const a = (s = (
|
|
502
|
+
var o, s, c;
|
|
503
|
+
const a = (s = (o = i == null ? void 0 : i.options) == null ? void 0 : o.languages) != null && s.length ? (c = i == null ? void 0 : i.options) == null ? void 0 : c.languages : jt;
|
|
504
504
|
return {
|
|
505
505
|
component: Fi,
|
|
506
506
|
componentProps: {
|
|
@@ -533,7 +533,7 @@ const ia = ln.extend({
|
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
function aa(e) {
|
|
536
|
-
var a,
|
|
536
|
+
var a, o, s;
|
|
537
537
|
const { t, lang: n } = B(), i = R(() => {
|
|
538
538
|
var u;
|
|
539
539
|
const c = (u = e == null ? void 0 : e.items) == null ? void 0 : u.find((d) => d.isActive());
|
|
@@ -547,32 +547,32 @@ function aa(e) {
|
|
|
547
547
|
action: () => e.editor.chain().focus().unsetFontFamily().run()
|
|
548
548
|
};
|
|
549
549
|
}, [t, n, e]);
|
|
550
|
-
return /* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
550
|
+
return /* @__PURE__ */ g(re, { children: [
|
|
551
|
+
/* @__PURE__ */ r(
|
|
552
552
|
se,
|
|
553
553
|
{
|
|
554
554
|
asChild: !0,
|
|
555
555
|
disabled: e == null ? void 0 : e.disabled,
|
|
556
|
-
children: /* @__PURE__ */
|
|
556
|
+
children: /* @__PURE__ */ r(
|
|
557
557
|
mt,
|
|
558
558
|
{
|
|
559
559
|
disabled: e == null ? void 0 : e.disabled,
|
|
560
560
|
icon: "MenuDown",
|
|
561
|
-
title: ((a = i == null ? void 0 : i.font) == null ? void 0 : a.length) > 7 ? `${(
|
|
561
|
+
title: ((a = i == null ? void 0 : i.font) == null ? void 0 : a.length) > 7 ? `${(o = i == null ? void 0 : i.font) == null ? void 0 : o.slice(0, 6)}...` : i == null ? void 0 : i.font,
|
|
562
562
|
tooltip: e == null ? void 0 : e.tooltip
|
|
563
563
|
}
|
|
564
564
|
)
|
|
565
565
|
}
|
|
566
566
|
),
|
|
567
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ r(ce, { className: "richtext-w-full", children: (s = e == null ? void 0 : e.items) == null ? void 0 : s.map((c, l) => {
|
|
568
568
|
const u = c.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: c.font };
|
|
569
|
-
return /* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
569
|
+
return /* @__PURE__ */ g(Je, { children: [
|
|
570
|
+
/* @__PURE__ */ r(
|
|
571
571
|
be,
|
|
572
572
|
{
|
|
573
573
|
checked: (i == null ? void 0 : i.font) === c.font,
|
|
574
574
|
onClick: c.action,
|
|
575
|
-
children: /* @__PURE__ */
|
|
575
|
+
children: /* @__PURE__ */ r(
|
|
576
576
|
"div",
|
|
577
577
|
{
|
|
578
578
|
className: "richtext-ml-1 richtext-h-full",
|
|
@@ -582,7 +582,7 @@ function aa(e) {
|
|
|
582
582
|
)
|
|
583
583
|
}
|
|
584
584
|
),
|
|
585
|
-
c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */
|
|
585
|
+
c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(Dt, {})
|
|
586
586
|
] }, `font-family-${l}`);
|
|
587
587
|
}) })
|
|
588
588
|
] });
|
|
@@ -595,9 +595,9 @@ const gr = dn.extend({
|
|
|
595
595
|
fontFamilyList: Ti,
|
|
596
596
|
button({ editor: t, extension: n, t: i }) {
|
|
597
597
|
var u;
|
|
598
|
-
const { extensions: a = [] } = t.extensionManager ?? [],
|
|
598
|
+
const { extensions: a = [] } = t.extensionManager ?? [], o = We(((u = n == null ? void 0 : n.options) == null ? void 0 : u.fontFamilyList) || []), s = a.find(
|
|
599
599
|
(d) => d.name === "base-kit"
|
|
600
|
-
), c =
|
|
600
|
+
), c = o.map((d) => ({
|
|
601
601
|
action: () => {
|
|
602
602
|
t.chain().focus().setFontFamily(d.value).run();
|
|
603
603
|
},
|
|
@@ -630,8 +630,8 @@ const gr = dn.extend({
|
|
|
630
630
|
function oa(e) {
|
|
631
631
|
var n;
|
|
632
632
|
const t = R(() => {
|
|
633
|
-
var
|
|
634
|
-
const i = (
|
|
633
|
+
var o;
|
|
634
|
+
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
635
635
|
return i && !i.default ? {
|
|
636
636
|
...i
|
|
637
637
|
} : {
|
|
@@ -640,13 +640,13 @@ function oa(e) {
|
|
|
640
640
|
isActive: () => !1
|
|
641
641
|
};
|
|
642
642
|
}, [e]);
|
|
643
|
-
return /* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
643
|
+
return /* @__PURE__ */ g(re, { children: [
|
|
644
|
+
/* @__PURE__ */ r(
|
|
645
645
|
se,
|
|
646
646
|
{
|
|
647
647
|
asChild: !0,
|
|
648
648
|
disabled: e == null ? void 0 : e.disabled,
|
|
649
|
-
children: /* @__PURE__ */
|
|
649
|
+
children: /* @__PURE__ */ r(
|
|
650
650
|
mt,
|
|
651
651
|
{
|
|
652
652
|
disabled: e == null ? void 0 : e.disabled,
|
|
@@ -657,21 +657,21 @@ function oa(e) {
|
|
|
657
657
|
)
|
|
658
658
|
}
|
|
659
659
|
),
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
var
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ r(ce, { className: "richtext-w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
|
|
661
|
+
var o, s;
|
|
662
|
+
return /* @__PURE__ */ g(Je, { children: [
|
|
663
|
+
/* @__PURE__ */ g(
|
|
664
664
|
be,
|
|
665
665
|
{
|
|
666
666
|
checked: (t == null ? void 0 : t.title) === i.title,
|
|
667
667
|
onClick: i.action,
|
|
668
668
|
children: [
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
!!((
|
|
669
|
+
/* @__PURE__ */ r("div", { className: `heading- richtext-ml-1 richtext-h-full${i.level}`, children: i.title }),
|
|
670
|
+
!!((o = i == null ? void 0 : i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r(ri, { className: "richtext-pl-4", children: (s = i == null ? void 0 : i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
|
|
671
671
|
]
|
|
672
672
|
}
|
|
673
673
|
),
|
|
674
|
-
i.level === 0 && /* @__PURE__ */
|
|
674
|
+
i.level === 0 && /* @__PURE__ */ r(Dt, {})
|
|
675
675
|
] }, `heading-k-${a}`);
|
|
676
676
|
}) })
|
|
677
677
|
] });
|
|
@@ -684,9 +684,9 @@ const _r = un.extend({
|
|
|
684
684
|
levels: [1, 2, 3, 4, 5, 6],
|
|
685
685
|
button({ editor: t, extension: n, t: i }) {
|
|
686
686
|
var u;
|
|
687
|
-
const { extensions: a = [] } = t.extensionManager ?? [],
|
|
687
|
+
const { extensions: a = [] } = t.extensionManager ?? [], o = ((u = n.options) == null ? void 0 : u.levels) || [], s = a.find(
|
|
688
688
|
(d) => d.name === "base-kit"
|
|
689
|
-
), c =
|
|
689
|
+
), c = o.map((d) => ({
|
|
690
690
|
action: () => t.commands.toggleHeading({ level: d }),
|
|
691
691
|
isActive: () => t.isActive("heading", { level: d }) || !1,
|
|
692
692
|
disabled: !t.can().toggleHeading({ level: d }),
|
|
@@ -715,7 +715,7 @@ const _r = un.extend({
|
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
|
-
}), Xt = le.Root, ft = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
718
|
+
}), Xt = le.Root, ft = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
719
719
|
le.List,
|
|
720
720
|
{
|
|
721
721
|
ref: n,
|
|
@@ -727,7 +727,7 @@ const _r = un.extend({
|
|
|
727
727
|
}
|
|
728
728
|
));
|
|
729
729
|
ft.displayName = le.List.displayName;
|
|
730
|
-
const Ne = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
730
|
+
const Ne = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
731
731
|
le.Trigger,
|
|
732
732
|
{
|
|
733
733
|
ref: n,
|
|
@@ -739,7 +739,7 @@ const Ne = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
739
739
|
}
|
|
740
740
|
));
|
|
741
741
|
Ne.displayName = le.Trigger.displayName;
|
|
742
|
-
const Te = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
742
|
+
const Te = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
743
743
|
le.Content,
|
|
744
744
|
{
|
|
745
745
|
ref: n,
|
|
@@ -751,7 +751,7 @@ const Te = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
751
751
|
}
|
|
752
752
|
));
|
|
753
753
|
Te.displayName = le.Content.displayName;
|
|
754
|
-
const Yt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
754
|
+
const Yt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
755
755
|
Ge.Root,
|
|
756
756
|
{
|
|
757
757
|
ref: n,
|
|
@@ -760,11 +760,11 @@ const Yt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
760
760
|
e
|
|
761
761
|
),
|
|
762
762
|
...t,
|
|
763
|
-
children: /* @__PURE__ */
|
|
763
|
+
children: /* @__PURE__ */ r(
|
|
764
764
|
Ge.Indicator,
|
|
765
765
|
{
|
|
766
766
|
className: E("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),
|
|
767
|
-
children: /* @__PURE__ */
|
|
767
|
+
children: /* @__PURE__ */ r(Pt, { className: "!richtext-h-4 !richtext-w-4" })
|
|
768
768
|
}
|
|
769
769
|
)
|
|
770
770
|
}
|
|
@@ -773,8 +773,8 @@ Yt.displayName = Ge.Root.displayName;
|
|
|
773
773
|
function ra(e) {
|
|
774
774
|
var n;
|
|
775
775
|
const t = R(() => {
|
|
776
|
-
var
|
|
777
|
-
const i = (
|
|
776
|
+
var o;
|
|
777
|
+
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
778
778
|
return i && !i.default ? {
|
|
779
779
|
...i,
|
|
780
780
|
icon: i.icon ? i.icon : e.icon
|
|
@@ -784,20 +784,20 @@ function ra(e) {
|
|
|
784
784
|
isActive: () => !1
|
|
785
785
|
};
|
|
786
786
|
}, [e]);
|
|
787
|
-
return /* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ g(xe, { modal: !0, children: [
|
|
788
|
+
/* @__PURE__ */ r(
|
|
789
789
|
pe,
|
|
790
790
|
{
|
|
791
791
|
asChild: !0,
|
|
792
792
|
disabled: e == null ? void 0 : e.disabled,
|
|
793
|
-
children: /* @__PURE__ */
|
|
793
|
+
children: /* @__PURE__ */ r(
|
|
794
794
|
y,
|
|
795
795
|
{
|
|
796
796
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
797
797
|
disabled: e == null ? void 0 : e.disabled,
|
|
798
798
|
icon: e == null ? void 0 : e.icon,
|
|
799
799
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
800
|
-
children: /* @__PURE__ */
|
|
800
|
+
children: /* @__PURE__ */ r(
|
|
801
801
|
D,
|
|
802
802
|
{
|
|
803
803
|
className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
|
|
@@ -808,16 +808,16 @@ function ra(e) {
|
|
|
808
808
|
)
|
|
809
809
|
}
|
|
810
810
|
),
|
|
811
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ r(
|
|
812
812
|
we,
|
|
813
813
|
{
|
|
814
814
|
align: "start",
|
|
815
815
|
className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
|
|
816
816
|
side: "bottom",
|
|
817
817
|
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
|
|
818
|
-
var
|
|
819
|
-
return /* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
818
|
+
var o, s;
|
|
819
|
+
return /* @__PURE__ */ g(Be, { children: [
|
|
820
|
+
/* @__PURE__ */ r($e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
821
821
|
rt,
|
|
822
822
|
{
|
|
823
823
|
className: "richtext-size-7 richtext-p-1",
|
|
@@ -825,12 +825,12 @@ function ra(e) {
|
|
|
825
825
|
onClick: i == null ? void 0 : i.action,
|
|
826
826
|
pressed: t.title === i.title,
|
|
827
827
|
size: "sm",
|
|
828
|
-
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */
|
|
828
|
+
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(D, { name: i.icon })
|
|
829
829
|
}
|
|
830
830
|
) }),
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
!!((
|
|
831
|
+
/* @__PURE__ */ g(Fe, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
832
|
+
/* @__PURE__ */ r("span", { children: i.title }),
|
|
833
|
+
!!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
|
|
834
834
|
] })
|
|
835
835
|
] }, `text-align-${a}`);
|
|
836
836
|
})
|
|
@@ -850,7 +850,7 @@ const br = hn.extend({
|
|
|
850
850
|
t: i
|
|
851
851
|
}) {
|
|
852
852
|
var u;
|
|
853
|
-
const a = ((u = n.options) == null ? void 0 : u.alignments) || [],
|
|
853
|
+
const a = ((u = n.options) == null ? void 0 : u.alignments) || [], o = {
|
|
854
854
|
left: ["mod", "Shift", "L"],
|
|
855
855
|
center: ["mod", "Shift", "E"],
|
|
856
856
|
right: ["mod", "Shift", "R"],
|
|
@@ -861,17 +861,17 @@ const br = hn.extend({
|
|
|
861
861
|
right: "AlignRight",
|
|
862
862
|
justify: "AlignJustify"
|
|
863
863
|
}, c = a.map((d) => {
|
|
864
|
-
var
|
|
864
|
+
var f, m, h;
|
|
865
865
|
return {
|
|
866
866
|
title: i(`editor.textalign.${d}.tooltip`),
|
|
867
867
|
icon: s[d],
|
|
868
|
-
shortcutKeys:
|
|
868
|
+
shortcutKeys: o[d],
|
|
869
869
|
isActive: () => t.isActive({ textAlign: d }) || !1,
|
|
870
870
|
action: () => {
|
|
871
871
|
var b, x;
|
|
872
872
|
return (x = (b = t.commands) == null ? void 0 : b.setTextAlign) == null ? void 0 : x.call(b, d);
|
|
873
873
|
},
|
|
874
|
-
disabled: !((
|
|
874
|
+
disabled: !((h = (m = (f = t == null ? void 0 : t.can) == null ? void 0 : f.call(t)) == null ? void 0 : m.setTextAlign) != null && h.call(m, d))
|
|
875
875
|
};
|
|
876
876
|
}), l = c.filter((d) => d.disabled).length === c.length;
|
|
877
877
|
return {
|
|
@@ -896,13 +896,13 @@ function sa(e) {
|
|
|
896
896
|
isActive: () => !1
|
|
897
897
|
};
|
|
898
898
|
}, [e]);
|
|
899
|
-
return /* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ g(re, { children: [
|
|
900
|
+
/* @__PURE__ */ r(
|
|
901
901
|
se,
|
|
902
902
|
{
|
|
903
903
|
asChild: !0,
|
|
904
904
|
disabled: e == null ? void 0 : e.disabled,
|
|
905
|
-
children: /* @__PURE__ */
|
|
905
|
+
children: /* @__PURE__ */ r(
|
|
906
906
|
mt,
|
|
907
907
|
{
|
|
908
908
|
disabled: e == null ? void 0 : e.disabled,
|
|
@@ -913,14 +913,14 @@ function sa(e) {
|
|
|
913
913
|
)
|
|
914
914
|
}
|
|
915
915
|
),
|
|
916
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ r(ce, { className: "richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((a, o) => /* @__PURE__ */ r(
|
|
917
917
|
be,
|
|
918
918
|
{
|
|
919
919
|
checked: n.title === a.title,
|
|
920
920
|
onClick: a.action,
|
|
921
|
-
children: /* @__PURE__ */
|
|
921
|
+
children: /* @__PURE__ */ r("div", { className: "richtext-ml-1 richtext-h-full", children: a.title })
|
|
922
922
|
},
|
|
923
|
-
`font-size-${
|
|
923
|
+
`font-size-${o}`
|
|
924
924
|
)) })
|
|
925
925
|
] });
|
|
926
926
|
}
|
|
@@ -934,22 +934,22 @@ const xr = H.create({
|
|
|
934
934
|
fontSizes: [...Ai],
|
|
935
935
|
button({ editor: t, extension: n, t: i }) {
|
|
936
936
|
var l;
|
|
937
|
-
const a = We(((l = n.options) == null ? void 0 : l.fontSizes) || pt),
|
|
938
|
-
title: u.value ===
|
|
937
|
+
const a = We(((l = n.options) == null ? void 0 : l.fontSizes) || pt), o = We([pt])[0], s = a.map((u) => ({
|
|
938
|
+
title: u.value === o.value ? i("editor.fontSize.default.tooltip") : String(u.name),
|
|
939
939
|
isActive: () => {
|
|
940
940
|
const { fontSize: d } = t.getAttributes("textStyle");
|
|
941
|
-
return u.value ===
|
|
941
|
+
return u.value === o.value && d === void 0 ? !0 : t.isActive({ fontSize: String(u.value) }) || !1;
|
|
942
942
|
},
|
|
943
943
|
action: () => {
|
|
944
|
-
if (u.value ===
|
|
944
|
+
if (u.value === o.value) {
|
|
945
945
|
t.commands.unsetFontSize();
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
948
|
t.commands.setFontSize(String(u.value));
|
|
949
949
|
},
|
|
950
950
|
disabled: !t.can().setFontSize(String(u.value)),
|
|
951
|
-
divider: u.value ===
|
|
952
|
-
default: u.value ===
|
|
951
|
+
divider: u.value === o.value || !1,
|
|
952
|
+
default: u.value === o.value || !1
|
|
953
953
|
})), c = s.filter((u) => u.disabled).length === s.length;
|
|
954
954
|
return {
|
|
955
955
|
component: sa,
|
|
@@ -988,7 +988,7 @@ const xr = H.create({
|
|
|
988
988
|
}
|
|
989
989
|
});
|
|
990
990
|
function ca({ fill: e }) {
|
|
991
|
-
return /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ r(
|
|
992
992
|
"svg",
|
|
993
993
|
{
|
|
994
994
|
width: "18px",
|
|
@@ -996,8 +996,8 @@ function ca({ fill: e }) {
|
|
|
996
996
|
viewBox: "0 0 240 240",
|
|
997
997
|
version: "1.1",
|
|
998
998
|
xmlns: "http://www.w3.org/2000/svg",
|
|
999
|
-
children: /* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
999
|
+
children: /* @__PURE__ */ r("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ r("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */ g("g", { transform: "translate(39.000000, 17.353553)", children: [
|
|
1000
|
+
/* @__PURE__ */ r(
|
|
1001
1001
|
"path",
|
|
1002
1002
|
{
|
|
1003
1003
|
d: "M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",
|
|
@@ -1006,7 +1006,7 @@ function ca({ fill: e }) {
|
|
|
1006
1006
|
fillRule: "evenodd"
|
|
1007
1007
|
}
|
|
1008
1008
|
),
|
|
1009
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ r(
|
|
1010
1010
|
"path",
|
|
1011
1011
|
{
|
|
1012
1012
|
d: "M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",
|
|
@@ -1015,7 +1015,7 @@ function ca({ fill: e }) {
|
|
|
1015
1015
|
fillRule: "nonzero"
|
|
1016
1016
|
}
|
|
1017
1017
|
),
|
|
1018
|
-
/* @__PURE__ */
|
|
1018
|
+
/* @__PURE__ */ r(
|
|
1019
1019
|
"path",
|
|
1020
1020
|
{
|
|
1021
1021
|
d: "M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",
|
|
@@ -1038,24 +1038,24 @@ function la(e) {
|
|
|
1038
1038
|
var s;
|
|
1039
1039
|
(s = e.action) == null || s.call(e, t);
|
|
1040
1040
|
}
|
|
1041
|
-
const
|
|
1041
|
+
const o = j(
|
|
1042
1042
|
$n((s) => {
|
|
1043
1043
|
n(s);
|
|
1044
1044
|
}, 350),
|
|
1045
1045
|
[]
|
|
1046
1046
|
);
|
|
1047
|
-
return /* @__PURE__ */
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-h-[32px]", children: [
|
|
1048
|
+
/* @__PURE__ */ r(y, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ r("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ r(ca, { fill: t }) }) }),
|
|
1049
|
+
/* @__PURE__ */ r(
|
|
1050
1050
|
si,
|
|
1051
1051
|
{
|
|
1052
1052
|
selectedColor: t,
|
|
1053
|
-
setSelectedColor:
|
|
1053
|
+
setSelectedColor: o,
|
|
1054
1054
|
onChange: i,
|
|
1055
1055
|
disabled: e == null ? void 0 : e.disabled,
|
|
1056
1056
|
colors: e == null ? void 0 : e.colors,
|
|
1057
1057
|
defaultColor: e == null ? void 0 : e.defaultColor,
|
|
1058
|
-
children: /* @__PURE__ */
|
|
1058
|
+
children: /* @__PURE__ */ r(O, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(D, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
|
|
1059
1059
|
}
|
|
1060
1060
|
)
|
|
1061
1061
|
] });
|
|
@@ -1213,20 +1213,20 @@ const pr = mn.extend({
|
|
|
1213
1213
|
});
|
|
1214
1214
|
function da(e) {
|
|
1215
1215
|
const [t, n] = k(!1);
|
|
1216
|
-
function i(a,
|
|
1217
|
-
e.action && (e.action({ link: a, text:
|
|
1216
|
+
function i(a, o, s) {
|
|
1217
|
+
e.action && (e.action({ link: a, text: o, openInNewTab: s }), n(!1));
|
|
1218
1218
|
}
|
|
1219
|
-
return /* @__PURE__ */
|
|
1220
|
-
/* @__PURE__ */
|
|
1219
|
+
return /* @__PURE__ */ g(xe, { modal: !0, open: t, onOpenChange: n, children: [
|
|
1220
|
+
/* @__PURE__ */ r(pe, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
1221
1221
|
y,
|
|
1222
1222
|
{
|
|
1223
1223
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1224
1224
|
isActive: e == null ? void 0 : e.isActive,
|
|
1225
1225
|
disabled: e == null ? void 0 : e.disabled,
|
|
1226
|
-
children: /* @__PURE__ */
|
|
1226
|
+
children: /* @__PURE__ */ r(D, { name: e == null ? void 0 : e.icon })
|
|
1227
1227
|
}
|
|
1228
1228
|
) }),
|
|
1229
|
-
/* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ r(we, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(li, { editor: e.editor, onSetLink: i }) })
|
|
1230
1230
|
] });
|
|
1231
1231
|
}
|
|
1232
1232
|
const Tr = wn.extend({
|
|
@@ -1257,10 +1257,10 @@ const Tr = wn.extend({
|
|
|
1257
1257
|
componentProps: {
|
|
1258
1258
|
editor: t,
|
|
1259
1259
|
action: (i) => {
|
|
1260
|
-
const { link: a, text:
|
|
1260
|
+
const { link: a, text: o, openInNewTab: s } = i;
|
|
1261
1261
|
t.chain().extendMarkRange("link").insertContent({
|
|
1262
1262
|
type: "text",
|
|
1263
|
-
text:
|
|
1263
|
+
text: o,
|
|
1264
1264
|
marks: [
|
|
1265
1265
|
{
|
|
1266
1266
|
type: "link",
|
|
@@ -1286,10 +1286,10 @@ const Tr = wn.extend({
|
|
|
1286
1286
|
new J({
|
|
1287
1287
|
props: {
|
|
1288
1288
|
handleClick: (e, t) => {
|
|
1289
|
-
const { schema: n, doc: i, tr: a } = e.state,
|
|
1290
|
-
if (!
|
|
1289
|
+
const { schema: n, doc: i, tr: a } = e.state, o = yn(i.resolve(t), n.marks.link);
|
|
1290
|
+
if (!o)
|
|
1291
1291
|
return !1;
|
|
1292
|
-
const s = i.resolve(
|
|
1292
|
+
const s = i.resolve(o.from), c = i.resolve(o.to), l = a.setSelection(new Ht(s, c));
|
|
1293
1293
|
e.dispatch(l);
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
@@ -1340,27 +1340,27 @@ function ua(e) {
|
|
|
1340
1340
|
// loading = false,
|
|
1341
1341
|
// shortcutKeys = undefined,
|
|
1342
1342
|
tooltipOptions: a = {},
|
|
1343
|
-
action:
|
|
1343
|
+
action: o = void 0,
|
|
1344
1344
|
isActive: s = void 0,
|
|
1345
1345
|
children: c
|
|
1346
1346
|
} = e, l = nt[t];
|
|
1347
|
-
return /* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1347
|
+
return /* @__PURE__ */ g(Be, { children: [
|
|
1348
|
+
/* @__PURE__ */ r($e, { asChild: !0, children: /* @__PURE__ */ g(
|
|
1349
1349
|
rt,
|
|
1350
1350
|
{
|
|
1351
1351
|
size: "sm",
|
|
1352
1352
|
className: `richtext-w-[32px] richtext-h-[32px] ${i}`,
|
|
1353
1353
|
disabled: s == null ? void 0 : s(),
|
|
1354
|
-
onClick:
|
|
1354
|
+
onClick: o,
|
|
1355
1355
|
children: [
|
|
1356
|
-
l && /* @__PURE__ */
|
|
1357
|
-
c && /* @__PURE__ */
|
|
1356
|
+
l && /* @__PURE__ */ r(l, { className: "richtext-w-4 richtext-h-4" }),
|
|
1357
|
+
c && /* @__PURE__ */ r(oe, { children: c })
|
|
1358
1358
|
]
|
|
1359
1359
|
}
|
|
1360
1360
|
) }),
|
|
1361
|
-
n && /* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
!!((u = e == null ? void 0 : e.shortcutKeys) != null && u.length) && /* @__PURE__ */
|
|
1361
|
+
n && /* @__PURE__ */ r(Fe, { ...a, children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
|
|
1362
|
+
/* @__PURE__ */ r("div", { children: n }),
|
|
1363
|
+
!!((u = e == null ? void 0 : e.shortcutKeys) != null && u.length) && /* @__PURE__ */ r("span", { children: it(e == null ? void 0 : e.shortcutKeys) })
|
|
1364
1364
|
] }) })
|
|
1365
1365
|
] });
|
|
1366
1366
|
}
|
|
@@ -1495,46 +1495,46 @@ function ga(e) {
|
|
|
1495
1495
|
], [e.editor, t]), i = R(() => n.findLast((a) => a.isActive()) ?? {
|
|
1496
1496
|
label: "Empty"
|
|
1497
1497
|
}, [n]);
|
|
1498
|
-
return /* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1498
|
+
return /* @__PURE__ */ g(re, { children: [
|
|
1499
|
+
/* @__PURE__ */ r(se, { asChild: !0, children: /* @__PURE__ */ g(
|
|
1500
1500
|
O,
|
|
1501
1501
|
{
|
|
1502
1502
|
className: "richtext-flex richtext-h-[32px] richtext-gap-1 richtext-px-1.5",
|
|
1503
1503
|
variant: "ghost",
|
|
1504
1504
|
children: [
|
|
1505
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ g("span", { className: "richtext-whitespace-nowrap richtext-text-sm richtext-font-normal", children: [
|
|
1506
1506
|
" ",
|
|
1507
1507
|
i == null ? void 0 : i.label
|
|
1508
1508
|
] }),
|
|
1509
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ r(tt, { className: "richtext-size-4" })
|
|
1510
1510
|
]
|
|
1511
1511
|
}
|
|
1512
1512
|
) }),
|
|
1513
|
-
/* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ r(
|
|
1514
1514
|
ce,
|
|
1515
1515
|
{
|
|
1516
1516
|
align: "start",
|
|
1517
1517
|
className: "richtext-w-full richtext-p-1",
|
|
1518
1518
|
hideWhenDetached: !0,
|
|
1519
1519
|
sideOffset: 5,
|
|
1520
|
-
children: n.map((a,
|
|
1520
|
+
children: n.map((a, o) => {
|
|
1521
1521
|
var c;
|
|
1522
1522
|
const s = nt[a.iconName];
|
|
1523
|
-
return /* @__PURE__ */
|
|
1523
|
+
return /* @__PURE__ */ r(
|
|
1524
1524
|
be,
|
|
1525
1525
|
{
|
|
1526
1526
|
checked: ((c = a.isActive) == null ? void 0 : c.call(a)) || !1,
|
|
1527
1527
|
className: "richtext-cursor-pointer",
|
|
1528
1528
|
onClick: () => a.action(),
|
|
1529
|
-
children: /* @__PURE__ */
|
|
1530
|
-
/* @__PURE__ */
|
|
1531
|
-
/* @__PURE__ */
|
|
1529
|
+
children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-px-2", children: [
|
|
1530
|
+
/* @__PURE__ */ r(s, { className: "richtext-h3 richtext-w-3" }),
|
|
1531
|
+
/* @__PURE__ */ g("span", { children: [
|
|
1532
1532
|
" ",
|
|
1533
1533
|
a.label
|
|
1534
1534
|
] })
|
|
1535
1535
|
] })
|
|
1536
1536
|
},
|
|
1537
|
-
`text-bubble-${
|
|
1537
|
+
`text-bubble-${o}`
|
|
1538
1538
|
);
|
|
1539
1539
|
})
|
|
1540
1540
|
}
|
|
@@ -1572,7 +1572,7 @@ const ba = H.create({
|
|
|
1572
1572
|
new J({
|
|
1573
1573
|
key: e,
|
|
1574
1574
|
appendTransaction: (n, i, a) => {
|
|
1575
|
-
const { doc:
|
|
1575
|
+
const { doc: o, tr: s, schema: c } = a, l = e.getState(a), u = o.content.size, d = c.nodes[this.options.node];
|
|
1576
1576
|
if (l)
|
|
1577
1577
|
return s.insert(u, d.create());
|
|
1578
1578
|
},
|
|
@@ -1598,8 +1598,8 @@ const ba = H.create({
|
|
|
1598
1598
|
return this.options.document !== !1 && e.push(ma.configure()), this.options.placeholder !== !1 && e.push(
|
|
1599
1599
|
Nn.configure({
|
|
1600
1600
|
placeholder: ({ node: t, pos: n, editor: i }) => {
|
|
1601
|
-
var a,
|
|
1602
|
-
return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((
|
|
1601
|
+
var a, o, s, c, l;
|
|
1602
|
+
return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((o = t == null ? void 0 : t.content) == null ? void 0 : o.size) !== 0 ? "" : ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "heading" ? `${z.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "table" ? "" : i.extensionManager.extensions.some((u) => u.name === "slashCommand") ? z.t("editor.slash") : n === 0 ? z.t("editor.content") : z.t("editor.content");
|
|
1603
1603
|
},
|
|
1604
1604
|
...this.options.placeholder
|
|
1605
1605
|
})
|
|
@@ -1623,7 +1623,7 @@ const ba = H.create({
|
|
|
1623
1623
|
return {
|
|
1624
1624
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1625
1625
|
button: ({ editor: t, extension: n, t: i }) => {
|
|
1626
|
-
const a = n.options.subscript,
|
|
1626
|
+
const a = n.options.subscript, o = n.options.superscript, s = {
|
|
1627
1627
|
component: y,
|
|
1628
1628
|
componentProps: {
|
|
1629
1629
|
action: () => t.commands.toggleSubscript(),
|
|
@@ -1642,7 +1642,7 @@ const ba = H.create({
|
|
|
1642
1642
|
tooltip: i("editor.superscript.tooltip")
|
|
1643
1643
|
}
|
|
1644
1644
|
}, l = [];
|
|
1645
|
-
return a !== !1 && l.push(s),
|
|
1645
|
+
return a !== !1 && l.push(s), o !== !1 && l.push(c), l;
|
|
1646
1646
|
}
|
|
1647
1647
|
};
|
|
1648
1648
|
},
|
|
@@ -1654,8 +1654,8 @@ const ba = H.create({
|
|
|
1654
1654
|
function xa(e) {
|
|
1655
1655
|
var n;
|
|
1656
1656
|
const t = R(() => {
|
|
1657
|
-
var
|
|
1658
|
-
const i = (
|
|
1657
|
+
var o;
|
|
1658
|
+
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
1659
1659
|
return i && !i.default ? {
|
|
1660
1660
|
...i,
|
|
1661
1661
|
icon: i != null && i.icon ? i == null ? void 0 : i.icon : e == null ? void 0 : e.icon
|
|
@@ -1665,34 +1665,34 @@ function xa(e) {
|
|
|
1665
1665
|
isActive: () => !1
|
|
1666
1666
|
};
|
|
1667
1667
|
}, [e]);
|
|
1668
|
-
return /* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1668
|
+
return /* @__PURE__ */ g(re, { children: [
|
|
1669
|
+
/* @__PURE__ */ r(
|
|
1670
1670
|
se,
|
|
1671
1671
|
{
|
|
1672
1672
|
asChild: !0,
|
|
1673
1673
|
disabled: e == null ? void 0 : e.disabled,
|
|
1674
|
-
children: /* @__PURE__ */
|
|
1674
|
+
children: /* @__PURE__ */ r(
|
|
1675
1675
|
y,
|
|
1676
1676
|
{
|
|
1677
1677
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
1678
1678
|
disabled: e == null ? void 0 : e.disabled,
|
|
1679
1679
|
icon: e == null ? void 0 : e.icon,
|
|
1680
1680
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1681
|
-
children: /* @__PURE__ */
|
|
1681
|
+
children: /* @__PURE__ */ r(hi, { className: "richtext-size-3 richtext-text-gray-500" })
|
|
1682
1682
|
}
|
|
1683
1683
|
)
|
|
1684
1684
|
}
|
|
1685
1685
|
),
|
|
1686
|
-
/* @__PURE__ */
|
|
1686
|
+
/* @__PURE__ */ r(ce, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */ g(
|
|
1687
1687
|
be,
|
|
1688
1688
|
{
|
|
1689
1689
|
checked: t.title === i.title,
|
|
1690
1690
|
className: "richtext-flex richtext-items-center richtext-gap-3",
|
|
1691
1691
|
onClick: i.action,
|
|
1692
1692
|
children: [
|
|
1693
|
-
/* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
!!(i != null && i.shortcutKeys) && /* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ r(D, { name: i == null ? void 0 : i.icon }),
|
|
1694
|
+
/* @__PURE__ */ r("span", { className: "richtext-ml-1", children: i.title }),
|
|
1695
|
+
!!(i != null && i.shortcutKeys) && /* @__PURE__ */ r("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: it(i.shortcutKeys) })
|
|
1696
1696
|
]
|
|
1697
1697
|
},
|
|
1698
1698
|
`more-mark-${a}`
|
|
@@ -1706,7 +1706,7 @@ const Er = H.create({
|
|
|
1706
1706
|
return {
|
|
1707
1707
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1708
1708
|
button({ editor: t, extension: n, t: i }) {
|
|
1709
|
-
const a = n.options.subscript,
|
|
1709
|
+
const a = n.options.subscript, o = n.options.superscript, s = {
|
|
1710
1710
|
action: () => t.commands.toggleSubscript(),
|
|
1711
1711
|
isActive: () => t.isActive("subscript") || !1,
|
|
1712
1712
|
disabled: !t.can().toggleSubscript(),
|
|
@@ -1721,7 +1721,7 @@ const Er = H.create({
|
|
|
1721
1721
|
title: i("editor.superscript.tooltip"),
|
|
1722
1722
|
shortcutKeys: ["mod", ","]
|
|
1723
1723
|
}, l = [];
|
|
1724
|
-
return a !== !1 && l.push(s),
|
|
1724
|
+
return a !== !1 && l.push(s), o !== !1 && l.push(c), {
|
|
1725
1725
|
component: xa,
|
|
1726
1726
|
componentProps: {
|
|
1727
1727
|
icon: "Type",
|
|
@@ -1818,7 +1818,7 @@ function wa(e) {
|
|
|
1818
1818
|
function a(s) {
|
|
1819
1819
|
s === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(s), i(s);
|
|
1820
1820
|
}
|
|
1821
|
-
const
|
|
1821
|
+
const o = R(() => {
|
|
1822
1822
|
const l = e.editor.extensionManager.extensions.find(
|
|
1823
1823
|
(u) => u.name === "lineHeight"
|
|
1824
1824
|
).options.lineHeights.map((u) => ({
|
|
@@ -1830,20 +1830,20 @@ function wa(e) {
|
|
|
1830
1830
|
value: "default"
|
|
1831
1831
|
}), l;
|
|
1832
1832
|
}, [e]);
|
|
1833
|
-
return /* @__PURE__ */
|
|
1834
|
-
/* @__PURE__ */
|
|
1833
|
+
return /* @__PURE__ */ g(re, { children: [
|
|
1834
|
+
/* @__PURE__ */ r(
|
|
1835
1835
|
se,
|
|
1836
1836
|
{
|
|
1837
1837
|
asChild: !0,
|
|
1838
1838
|
disabled: e == null ? void 0 : e.disabled,
|
|
1839
|
-
children: /* @__PURE__ */
|
|
1839
|
+
children: /* @__PURE__ */ r(
|
|
1840
1840
|
y,
|
|
1841
1841
|
{
|
|
1842
1842
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
1843
1843
|
disabled: e == null ? void 0 : e.disabled,
|
|
1844
1844
|
icon: "LineHeight",
|
|
1845
1845
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1846
|
-
children: /* @__PURE__ */
|
|
1846
|
+
children: /* @__PURE__ */ r(
|
|
1847
1847
|
D,
|
|
1848
1848
|
{
|
|
1849
1849
|
className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
|
|
@@ -1854,7 +1854,7 @@ function wa(e) {
|
|
|
1854
1854
|
)
|
|
1855
1855
|
}
|
|
1856
1856
|
),
|
|
1857
|
-
/* @__PURE__ */
|
|
1857
|
+
/* @__PURE__ */ r(ce, { className: "richtext-min-w-24", children: o == null ? void 0 : o.map((s, c) => /* @__PURE__ */ r(
|
|
1858
1858
|
be,
|
|
1859
1859
|
{
|
|
1860
1860
|
checked: s.value === n,
|
|
@@ -1870,8 +1870,8 @@ function va(e, t) {
|
|
|
1870
1870
|
const { selection: n, doc: i } = e;
|
|
1871
1871
|
if (!n || !i || !(n instanceof Ht || n instanceof Fn))
|
|
1872
1872
|
return e;
|
|
1873
|
-
const { from: a, to:
|
|
1874
|
-
if (i.nodesBetween(a,
|
|
1873
|
+
const { from: a, to: o } = n, s = [], c = t && t !== Bt ? t : null;
|
|
1874
|
+
if (i.nodesBetween(a, o, (l, u) => {
|
|
1875
1875
|
const d = l.type;
|
|
1876
1876
|
return ya.includes(d.name) ? ((l.attrs.lineHeight || null) !== c && s.push({
|
|
1877
1877
|
node: l,
|
|
@@ -1881,12 +1881,12 @@ function va(e, t) {
|
|
|
1881
1881
|
}), s.length === 0)
|
|
1882
1882
|
return e;
|
|
1883
1883
|
for (const l of s) {
|
|
1884
|
-
const { node: u, pos: d, nodeType:
|
|
1885
|
-
let { attrs:
|
|
1886
|
-
|
|
1887
|
-
...
|
|
1884
|
+
const { node: u, pos: d, nodeType: f } = l;
|
|
1885
|
+
let { attrs: m } = u;
|
|
1886
|
+
m = {
|
|
1887
|
+
...m,
|
|
1888
1888
|
lineHeight: c
|
|
1889
|
-
}, e = e.setNodeMarkup(d,
|
|
1889
|
+
}, e = e.setNodeMarkup(d, f, m, u.marks);
|
|
1890
1890
|
}
|
|
1891
1891
|
return e;
|
|
1892
1892
|
}
|
|
@@ -1974,8 +1974,8 @@ function Ta(e) {
|
|
|
1974
1974
|
label: z.t(`editor.heading.h${i}.tooltip`),
|
|
1975
1975
|
aliases: [`h${i}`, "bt", `bt${i}`],
|
|
1976
1976
|
iconName: `Heading${i}`,
|
|
1977
|
-
action: ({ editor: a, range:
|
|
1978
|
-
a.chain().focus().deleteRange(
|
|
1977
|
+
action: ({ editor: a, range: o }) => {
|
|
1978
|
+
a.chain().focus().deleteRange(o).setHeading({ level: i }).run();
|
|
1979
1979
|
}
|
|
1980
1980
|
});
|
|
1981
1981
|
}), n.name.toLowerCase() === "bulletlist" && t[0].commands.push({
|
|
@@ -2072,59 +2072,59 @@ function Ta(e) {
|
|
|
2072
2072
|
}), t;
|
|
2073
2073
|
}
|
|
2074
2074
|
function Aa(e, t) {
|
|
2075
|
-
var N,
|
|
2076
|
-
const [n, i] = k(0), [a,
|
|
2075
|
+
var N, S;
|
|
2076
|
+
const [n, i] = k(0), [a, o] = k(0), s = X(null), { t: c } = B(), l = X([]);
|
|
2077
2077
|
et(t, () => ({
|
|
2078
2078
|
onKeyDown: u
|
|
2079
2079
|
})), P(() => {
|
|
2080
2080
|
if (!s.current)
|
|
2081
2081
|
return;
|
|
2082
|
-
const
|
|
2082
|
+
const p = a * 1e3 + n, _ = l.current[p];
|
|
2083
2083
|
_ && _.scrollIntoView({
|
|
2084
2084
|
behavior: "smooth",
|
|
2085
2085
|
block: "nearest"
|
|
2086
2086
|
});
|
|
2087
2087
|
}, [n, a]);
|
|
2088
|
-
function u({ event:
|
|
2089
|
-
return
|
|
2088
|
+
function u({ event: p }) {
|
|
2089
|
+
return p.key === "ArrowUp" ? (d(), !0) : p.key === "ArrowDown" ? (f(), !0) : p.key === "Enter" ? (m(), !0) : !1;
|
|
2090
2090
|
}
|
|
2091
2091
|
function d() {
|
|
2092
|
-
var
|
|
2092
|
+
var w;
|
|
2093
2093
|
if (e.items.length === 0)
|
|
2094
2094
|
return !1;
|
|
2095
|
-
let
|
|
2096
|
-
|
|
2095
|
+
let p = n - 1, _ = a;
|
|
2096
|
+
p < 0 && (_ = a - 1, p = ((w = e.items[_]) == null ? void 0 : w.commands.length) - 1 || 0), _ < 0 && (_ = e.items.length - 1, p = e.items[_].commands.length - 1), i(p), o(_);
|
|
2097
2097
|
}
|
|
2098
|
-
function
|
|
2098
|
+
function f() {
|
|
2099
2099
|
if (e.items.length === 0)
|
|
2100
2100
|
return !1;
|
|
2101
|
-
const
|
|
2102
|
-
let _ = n + 1,
|
|
2103
|
-
|
|
2101
|
+
const p = e.items[a].commands;
|
|
2102
|
+
let _ = n + 1, w = a;
|
|
2103
|
+
p.length - 1 < _ && (_ = 0, w = a + 1), e.items.length - 1 < w && (w = 0), i(_), o(w);
|
|
2104
2104
|
}
|
|
2105
|
-
function
|
|
2105
|
+
function m() {
|
|
2106
2106
|
if (e.items.length === 0 || a === -1 || n === -1)
|
|
2107
2107
|
return !1;
|
|
2108
|
-
|
|
2108
|
+
h(a, n);
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2111
|
-
const
|
|
2112
|
-
e.command(
|
|
2110
|
+
function h(p, _) {
|
|
2111
|
+
const w = e.items[p].commands[_];
|
|
2112
|
+
e.command(w);
|
|
2113
2113
|
}
|
|
2114
|
-
function b(
|
|
2115
|
-
|
|
2114
|
+
function b(p, _) {
|
|
2115
|
+
h(p, _);
|
|
2116
2116
|
}
|
|
2117
|
-
function x(
|
|
2118
|
-
l.current[
|
|
2117
|
+
function x(p, _, w) {
|
|
2118
|
+
l.current[p * 1e3 + _] = w;
|
|
2119
2119
|
}
|
|
2120
|
-
return /* @__PURE__ */
|
|
2120
|
+
return /* @__PURE__ */ r(
|
|
2121
2121
|
"div",
|
|
2122
2122
|
{
|
|
2123
2123
|
className: "richtext-mb-8 richtext-max-h-[min(80vh,24rem)] richtext-flex-wrap richtext-overflow-auto richtext-rounded-lg !richtext-border !richtext-border-neutral-200 !richtext-bg-white richtext-p-1 !richtext-text-black richtext-shadow-sm dark:!richtext-border-neutral-800 dark:!richtext-bg-black",
|
|
2124
2124
|
ref: s,
|
|
2125
|
-
children: (N = e == null ? void 0 : e.items) != null && N.length ? /* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2127
|
-
|
|
2125
|
+
children: (N = e == null ? void 0 : e.items) != null && N.length ? /* @__PURE__ */ r("div", { className: "richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5", children: (S = e == null ? void 0 : e.items) == null ? void 0 : S.map((p, _) => /* @__PURE__ */ g(Je, { children: [
|
|
2126
|
+
/* @__PURE__ */ r("div", { className: "richtext-col-[1/-1] richtext-mx-2 richtext-mt-2 richtext-select-none richtext-text-[0.65rem] richtext-font-semibold richtext-uppercase richtext-tracking-wider !richtext-text-neutral-500 first:richtext-mt-0.5", children: p.title }),
|
|
2127
|
+
p.commands.map((w, C) => /* @__PURE__ */ g(
|
|
2128
2128
|
"button",
|
|
2129
2129
|
{
|
|
2130
2130
|
onClick: () => b(_, C),
|
|
@@ -2133,27 +2133,27 @@ function Aa(e, t) {
|
|
|
2133
2133
|
"slash-command-active": a === _ && n === C
|
|
2134
2134
|
}),
|
|
2135
2135
|
children: [
|
|
2136
|
-
|
|
2136
|
+
w.iconUrl && /* @__PURE__ */ r(
|
|
2137
2137
|
"img",
|
|
2138
2138
|
{
|
|
2139
2139
|
alt: "",
|
|
2140
2140
|
className: "richtext-size-6",
|
|
2141
|
-
src:
|
|
2141
|
+
src: w.iconUrl
|
|
2142
2142
|
}
|
|
2143
2143
|
),
|
|
2144
|
-
|
|
2144
|
+
w.iconName && /* @__PURE__ */ r(
|
|
2145
2145
|
D,
|
|
2146
2146
|
{
|
|
2147
2147
|
className: "!richtext-mr-1 !richtext-text-lg",
|
|
2148
|
-
name:
|
|
2148
|
+
name: w.iconName
|
|
2149
2149
|
}
|
|
2150
2150
|
),
|
|
2151
|
-
|
|
2151
|
+
w.label
|
|
2152
2152
|
]
|
|
2153
2153
|
},
|
|
2154
2154
|
`command-${C}`
|
|
2155
2155
|
))
|
|
2156
|
-
] }, `slash-${
|
|
2156
|
+
] }, `slash-${p.title}`)) }) : /* @__PURE__ */ r("div", { className: "richtext-p-3", children: /* @__PURE__ */ r("span", { className: "richtext-text-xs richtext-text-gray-800 dark:richtext-text-gray-100", children: c("editor.slash.empty") }) })
|
|
2157
2157
|
}
|
|
2158
2158
|
);
|
|
2159
2159
|
}
|
|
@@ -2190,11 +2190,11 @@ const Rr = H.create({
|
|
|
2190
2190
|
startOfLine: !0,
|
|
2191
2191
|
pluginKey: new Q(ie),
|
|
2192
2192
|
allow: ({ state: e, range: t }) => {
|
|
2193
|
-
var u, d,
|
|
2194
|
-
const n = e.doc.resolve(t.from), i = n.depth === 1, a = n.parent.type.name === "paragraph",
|
|
2193
|
+
var u, d, f;
|
|
2194
|
+
const n = e.doc.resolve(t.from), i = n.depth === 1, a = n.parent.type.name === "paragraph", o = ((u = n.parent.textContent) == null ? void 0 : u.charAt(0)) === "/", s = this.editor.isActive("column"), c = (f = n.parent.textContent) == null ? void 0 : f.slice(
|
|
2195
2195
|
Math.max(0, (d = n.parent.textContent) == null ? void 0 : d.indexOf("/"))
|
|
2196
2196
|
), l = !(c != null && c.endsWith(" "));
|
|
2197
|
-
return (i && a &&
|
|
2197
|
+
return (i && a && o || s && a && o) && l;
|
|
2198
2198
|
},
|
|
2199
2199
|
command: ({ editor: e, range: t, props: n }) => {
|
|
2200
2200
|
const { view: i } = e;
|
|
@@ -2205,8 +2205,8 @@ const Rr = H.create({
|
|
|
2205
2205
|
commands: s.commands.filter((c) => {
|
|
2206
2206
|
const l = c.label.toLowerCase().trim(), u = e.toLowerCase().trim();
|
|
2207
2207
|
if (c.aliases) {
|
|
2208
|
-
const d = c.aliases.map((
|
|
2209
|
-
return
|
|
2208
|
+
const d = c.aliases.map((h) => h.toLowerCase().trim()), f = l.match(u), m = d.some((h) => h.match(u));
|
|
2209
|
+
return f || m;
|
|
2210
2210
|
}
|
|
2211
2211
|
return l.match(u);
|
|
2212
2212
|
}).filter(
|
|
@@ -2223,7 +2223,7 @@ const Rr = H.create({
|
|
|
2223
2223
|
let e, t = null;
|
|
2224
2224
|
return {
|
|
2225
2225
|
onStart: (n) => {
|
|
2226
|
-
var
|
|
2226
|
+
var o;
|
|
2227
2227
|
e = new Ze(La, {
|
|
2228
2228
|
props: n,
|
|
2229
2229
|
editor: n.editor
|
|
@@ -2245,7 +2245,7 @@ const Rr = H.create({
|
|
|
2245
2245
|
A == null || A[0].setProps({
|
|
2246
2246
|
getReferenceClientRect: a
|
|
2247
2247
|
});
|
|
2248
|
-
}, (
|
|
2248
|
+
}, (o = i.dom.parentElement) == null || o.addEventListener("scroll", t), A == null || A[0].setProps({
|
|
2249
2249
|
getReferenceClientRect: a,
|
|
2250
2250
|
appendTo: () => document.body,
|
|
2251
2251
|
content: e.element
|
|
@@ -2259,12 +2259,12 @@ const Rr = H.create({
|
|
|
2259
2259
|
return n.editor.storage[ie].rect;
|
|
2260
2260
|
const c = n.clientRect();
|
|
2261
2261
|
return c ? new DOMRect(c.x, c.y, c.width, c.height) : n.editor.storage[ie].rect;
|
|
2262
|
-
},
|
|
2262
|
+
}, o = () => {
|
|
2263
2263
|
A == null || A[0].setProps({
|
|
2264
2264
|
getReferenceClientRect: a
|
|
2265
2265
|
});
|
|
2266
2266
|
};
|
|
2267
|
-
(s = i.dom.parentElement) == null || s.addEventListener("scroll",
|
|
2267
|
+
(s = i.dom.parentElement) == null || s.addEventListener("scroll", o), n.editor.storage[ie].rect = n.clientRect ? a() : {
|
|
2268
2268
|
width: 0,
|
|
2269
2269
|
height: 0,
|
|
2270
2270
|
left: 0,
|
|
@@ -2306,40 +2306,40 @@ const Rr = H.create({
|
|
|
2306
2306
|
}
|
|
2307
2307
|
});
|
|
2308
2308
|
function Sa({ editor: e, imageInline: t, onClose: n }) {
|
|
2309
|
-
const { t: i } = B(), [a,
|
|
2309
|
+
const { t: i } = B(), [a, o] = k(!1), s = Pe.useRef(null), [c, l] = Pe.useState(), [u, d] = Pe.useState(""), f = X(null), [m, h] = k({
|
|
2310
2310
|
src: "",
|
|
2311
2311
|
file: null
|
|
2312
2312
|
});
|
|
2313
2313
|
function b(_) {
|
|
2314
2314
|
if (s.current && _.width && _.height) {
|
|
2315
|
-
const
|
|
2316
|
-
d(
|
|
2315
|
+
const w = x(s.current, _);
|
|
2316
|
+
d(w);
|
|
2317
2317
|
}
|
|
2318
2318
|
}
|
|
2319
|
-
function x(_,
|
|
2320
|
-
const C = document.createElement("canvas"), T = _.naturalWidth / _.width,
|
|
2321
|
-
C.width =
|
|
2319
|
+
function x(_, w) {
|
|
2320
|
+
const C = document.createElement("canvas"), T = _.naturalWidth / _.width, L = _.naturalHeight / _.height;
|
|
2321
|
+
C.width = w.width * T, C.height = w.height * L;
|
|
2322
2322
|
const q = C.getContext("2d");
|
|
2323
2323
|
return q && (q.imageSmoothingEnabled = !1, q.drawImage(
|
|
2324
2324
|
_,
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2325
|
+
w.x * T,
|
|
2326
|
+
w.y * L,
|
|
2327
|
+
w.width * T,
|
|
2328
|
+
w.height * L,
|
|
2329
2329
|
0,
|
|
2330
2330
|
0,
|
|
2331
|
-
|
|
2332
|
-
|
|
2331
|
+
w.width * T,
|
|
2332
|
+
w.height * L
|
|
2333
2333
|
)), C.toDataURL("image/png", 1);
|
|
2334
2334
|
}
|
|
2335
2335
|
async function N() {
|
|
2336
|
-
var _,
|
|
2336
|
+
var _, w;
|
|
2337
2337
|
try {
|
|
2338
|
-
const C = fi(u, ((_ =
|
|
2338
|
+
const C = fi(u, ((_ = m == null ? void 0 : m.file) == null ? void 0 : _.name) || "image.png"), T = (w = e.extensionManager.extensions.find(
|
|
2339
2339
|
(q) => q.name === "image"
|
|
2340
|
-
)) == null ? void 0 :
|
|
2341
|
-
let
|
|
2342
|
-
T.upload ?
|
|
2340
|
+
)) == null ? void 0 : w.options;
|
|
2341
|
+
let L = "";
|
|
2342
|
+
T.upload ? L = await T.upload(C) : L = URL.createObjectURL(C), e.chain().focus().setImageInline({ src: L, inline: t }).run(), o(!1), h({
|
|
2343
2343
|
src: "",
|
|
2344
2344
|
file: null
|
|
2345
2345
|
}), n();
|
|
@@ -2347,65 +2347,65 @@ function Sa({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2347
2347
|
console.log("Error cropping image", C);
|
|
2348
2348
|
}
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2351
|
-
var
|
|
2352
|
-
_.preventDefault(), (
|
|
2350
|
+
function S(_) {
|
|
2351
|
+
var w;
|
|
2352
|
+
_.preventDefault(), (w = f.current) == null || w.click();
|
|
2353
2353
|
}
|
|
2354
|
-
const
|
|
2355
|
-
var
|
|
2356
|
-
const
|
|
2357
|
-
if (!e || e.isDestroyed ||
|
|
2354
|
+
const p = async (_) => {
|
|
2355
|
+
var L;
|
|
2356
|
+
const w = (L = _ == null ? void 0 : _.target) == null ? void 0 : L.files;
|
|
2357
|
+
if (!e || e.isDestroyed || w.length === 0)
|
|
2358
2358
|
return;
|
|
2359
|
-
const C =
|
|
2360
|
-
|
|
2359
|
+
const C = w[0], T = await gi(C);
|
|
2360
|
+
o(!0), h({
|
|
2361
2361
|
src: T.src,
|
|
2362
2362
|
file: C
|
|
2363
2363
|
});
|
|
2364
2364
|
};
|
|
2365
|
-
return /* @__PURE__ */
|
|
2366
|
-
/* @__PURE__ */
|
|
2365
|
+
return /* @__PURE__ */ g(oe, { children: [
|
|
2366
|
+
/* @__PURE__ */ r(
|
|
2367
2367
|
O,
|
|
2368
2368
|
{
|
|
2369
2369
|
className: "richtext-mt-1 richtext-w-full",
|
|
2370
|
-
onClick:
|
|
2370
|
+
onClick: S,
|
|
2371
2371
|
size: "sm",
|
|
2372
2372
|
children: i("editor.image.dialog.tab.uploadCrop")
|
|
2373
2373
|
}
|
|
2374
2374
|
),
|
|
2375
|
-
/* @__PURE__ */
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2378
|
-
/* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2375
|
+
/* @__PURE__ */ g(st, { open: a, children: [
|
|
2376
|
+
/* @__PURE__ */ r(ct, {}),
|
|
2377
|
+
/* @__PURE__ */ g(lt, { children: [
|
|
2378
|
+
/* @__PURE__ */ r(dt, { children: i("editor.image.dialog.tab.uploadCrop") }),
|
|
2379
|
+
/* @__PURE__ */ r("div", { children: m.src && /* @__PURE__ */ r(
|
|
2380
2380
|
Hi,
|
|
2381
2381
|
{
|
|
2382
2382
|
className: "richtext-w-full",
|
|
2383
2383
|
crop: c,
|
|
2384
2384
|
onChange: (_) => l(_),
|
|
2385
2385
|
onComplete: (_) => b(_),
|
|
2386
|
-
children: /* @__PURE__ */
|
|
2386
|
+
children: /* @__PURE__ */ r(
|
|
2387
2387
|
"img",
|
|
2388
2388
|
{
|
|
2389
2389
|
alt: "Crop me",
|
|
2390
2390
|
ref: s,
|
|
2391
|
-
src:
|
|
2391
|
+
src: m.src
|
|
2392
2392
|
}
|
|
2393
2393
|
)
|
|
2394
2394
|
}
|
|
2395
2395
|
) }),
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2396
|
+
/* @__PURE__ */ g(mi, { children: [
|
|
2397
|
+
/* @__PURE__ */ g(
|
|
2398
2398
|
O,
|
|
2399
2399
|
{
|
|
2400
2400
|
onClick: () => {
|
|
2401
|
-
|
|
2401
|
+
o(!1), h({
|
|
2402
2402
|
src: "",
|
|
2403
2403
|
file: null
|
|
2404
2404
|
});
|
|
2405
2405
|
},
|
|
2406
2406
|
children: [
|
|
2407
2407
|
i("editor.imageUpload.cancel"),
|
|
2408
|
-
/* @__PURE__ */
|
|
2408
|
+
/* @__PURE__ */ r(
|
|
2409
2409
|
D,
|
|
2410
2410
|
{
|
|
2411
2411
|
className: "richtext-ml-[4px]",
|
|
@@ -2415,14 +2415,14 @@ function Sa({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2415
2415
|
]
|
|
2416
2416
|
}
|
|
2417
2417
|
),
|
|
2418
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ g(
|
|
2419
2419
|
O,
|
|
2420
2420
|
{
|
|
2421
2421
|
className: "richtext-w-fit",
|
|
2422
2422
|
onClick: N,
|
|
2423
2423
|
children: [
|
|
2424
2424
|
i("editor.imageUpload.crop"),
|
|
2425
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ r(
|
|
2426
2426
|
D,
|
|
2427
2427
|
{
|
|
2428
2428
|
className: "richtext-ml-[4px]",
|
|
@@ -2435,13 +2435,13 @@ function Sa({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2435
2435
|
] })
|
|
2436
2436
|
] })
|
|
2437
2437
|
] }),
|
|
2438
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ r(
|
|
2439
2439
|
"input",
|
|
2440
2440
|
{
|
|
2441
2441
|
accept: "image/*",
|
|
2442
2442
|
multiple: !0,
|
|
2443
|
-
onChange:
|
|
2444
|
-
ref:
|
|
2443
|
+
onChange: p,
|
|
2444
|
+
ref: f,
|
|
2445
2445
|
type: "file",
|
|
2446
2446
|
style: {
|
|
2447
2447
|
display: "none"
|
|
@@ -2451,38 +2451,38 @@ function Sa({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2451
2451
|
] });
|
|
2452
2452
|
}
|
|
2453
2453
|
function Ma(e) {
|
|
2454
|
-
var
|
|
2455
|
-
const { t } = B(), n = Ca(), [i, a] = k(""),
|
|
2456
|
-
(
|
|
2457
|
-
)) == null ? void 0 :
|
|
2454
|
+
var m;
|
|
2455
|
+
const { t } = B(), n = Ca(), [i, a] = k(""), o = X(null), [s, c] = k(((m = e.editor.extensionManager.extensions.find(
|
|
2456
|
+
(h) => h.name === Ct.name
|
|
2457
|
+
)) == null ? void 0 : m.options.defaultInline) || !1), l = R(() => {
|
|
2458
2458
|
var b;
|
|
2459
2459
|
return (b = e.editor.extensionManager.extensions.find(
|
|
2460
2460
|
(x) => x.name === Ct.name
|
|
2461
2461
|
)) == null ? void 0 : b.options;
|
|
2462
2462
|
}, [e.editor]);
|
|
2463
|
-
async function u(
|
|
2464
|
-
var
|
|
2465
|
-
const b = (
|
|
2463
|
+
async function u(h) {
|
|
2464
|
+
var S;
|
|
2465
|
+
const b = (S = h == null ? void 0 : h.target) == null ? void 0 : S.files;
|
|
2466
2466
|
if (!e.editor || e.editor.isDestroyed || b.length === 0)
|
|
2467
2467
|
return;
|
|
2468
2468
|
const x = b[0];
|
|
2469
2469
|
let N = "";
|
|
2470
2470
|
l.upload ? N = await l.upload(x) : N = URL.createObjectURL(x), e.editor.chain().focus().setImageInline({ src: N, inline: s }).run(), ue.setOpen(!1), c(!1);
|
|
2471
2471
|
}
|
|
2472
|
-
function d(
|
|
2473
|
-
|
|
2472
|
+
function d(h) {
|
|
2473
|
+
h.preventDefault(), h.stopPropagation(), e.editor.chain().focus().setImageInline({ src: i, inline: s }).run(), ue.setOpen(!1), c(!1), a("");
|
|
2474
2474
|
}
|
|
2475
|
-
function
|
|
2475
|
+
function f(h) {
|
|
2476
2476
|
var b;
|
|
2477
|
-
|
|
2477
|
+
h.preventDefault(), (b = o.current) == null || b.click();
|
|
2478
2478
|
}
|
|
2479
|
-
return /* @__PURE__ */
|
|
2479
|
+
return /* @__PURE__ */ g(
|
|
2480
2480
|
st,
|
|
2481
2481
|
{
|
|
2482
2482
|
onOpenChange: ue.setOpen,
|
|
2483
2483
|
open: n,
|
|
2484
2484
|
children: [
|
|
2485
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ r(ct, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2486
2486
|
y,
|
|
2487
2487
|
{
|
|
2488
2488
|
action: () => ue.setOpen(!0),
|
|
@@ -2490,42 +2490,42 @@ function Ma(e) {
|
|
|
2490
2490
|
tooltip: e.tooltip
|
|
2491
2491
|
}
|
|
2492
2492
|
) }),
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
/* @__PURE__ */
|
|
2495
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ g(lt, { children: [
|
|
2494
|
+
/* @__PURE__ */ r(dt, { children: t("editor.image.dialog.title") }),
|
|
2495
|
+
/* @__PURE__ */ g(
|
|
2496
2496
|
Xt,
|
|
2497
2497
|
{
|
|
2498
2498
|
activationMode: "manual",
|
|
2499
2499
|
defaultValue: l.resourceImage === "both" || l.resourceImage === "upload" ? "upload" : "link",
|
|
2500
2500
|
children: [
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
l.resourceImage === "both" || l.resourceImage === "upload" ? /* @__PURE__ */
|
|
2503
|
-
l.resourceImage === "both" || l.resourceImage === "link" ? /* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ g(ft, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
|
|
2502
|
+
l.resourceImage === "both" || l.resourceImage === "upload" ? /* @__PURE__ */ r(Ne, { value: "upload", children: t("editor.image.dialog.tab.upload") }) : /* @__PURE__ */ r(oe, {}),
|
|
2503
|
+
l.resourceImage === "both" || l.resourceImage === "link" ? /* @__PURE__ */ r(Ne, { value: "link", children: t("editor.image.dialog.tab.url") }) : /* @__PURE__ */ r(oe, {})
|
|
2504
2504
|
] }),
|
|
2505
|
-
/* @__PURE__ */
|
|
2506
|
-
/* @__PURE__ */
|
|
2505
|
+
/* @__PURE__ */ g("div", { className: "richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
2506
|
+
/* @__PURE__ */ r(
|
|
2507
2507
|
Yt,
|
|
2508
2508
|
{
|
|
2509
2509
|
checked: s,
|
|
2510
|
-
onCheckedChange: (
|
|
2511
|
-
c(
|
|
2510
|
+
onCheckedChange: (h) => {
|
|
2511
|
+
c(h);
|
|
2512
2512
|
}
|
|
2513
2513
|
}
|
|
2514
2514
|
),
|
|
2515
|
-
/* @__PURE__ */
|
|
2515
|
+
/* @__PURE__ */ r(De, { children: t("editor.link.dialog.inline") })
|
|
2516
2516
|
] }),
|
|
2517
|
-
/* @__PURE__ */
|
|
2518
|
-
/* @__PURE__ */
|
|
2519
|
-
/* @__PURE__ */
|
|
2517
|
+
/* @__PURE__ */ g(Te, { value: "upload", children: [
|
|
2518
|
+
/* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
2519
|
+
/* @__PURE__ */ r(
|
|
2520
2520
|
O,
|
|
2521
2521
|
{
|
|
2522
2522
|
className: "richtext-mt-1 richtext-w-full",
|
|
2523
|
-
onClick:
|
|
2523
|
+
onClick: f,
|
|
2524
2524
|
size: "sm",
|
|
2525
2525
|
children: t("editor.image.dialog.tab.upload")
|
|
2526
2526
|
}
|
|
2527
2527
|
),
|
|
2528
|
-
/* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ r(
|
|
2529
2529
|
Sa,
|
|
2530
2530
|
{
|
|
2531
2531
|
editor: e.editor,
|
|
@@ -2534,13 +2534,13 @@ function Ma(e) {
|
|
|
2534
2534
|
}
|
|
2535
2535
|
)
|
|
2536
2536
|
] }),
|
|
2537
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ r(
|
|
2538
2538
|
"input",
|
|
2539
2539
|
{
|
|
2540
2540
|
accept: "image/*",
|
|
2541
2541
|
multiple: !0,
|
|
2542
2542
|
onChange: u,
|
|
2543
|
-
ref:
|
|
2543
|
+
ref: o,
|
|
2544
2544
|
type: "file",
|
|
2545
2545
|
style: {
|
|
2546
2546
|
display: "none"
|
|
@@ -2548,19 +2548,19 @@ function Ma(e) {
|
|
|
2548
2548
|
}
|
|
2549
2549
|
)
|
|
2550
2550
|
] }),
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
/* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ r(Te, { value: "link", children: /* @__PURE__ */ r("form", { onSubmit: d, children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
2552
|
+
/* @__PURE__ */ r(
|
|
2553
2553
|
Oe,
|
|
2554
2554
|
{
|
|
2555
2555
|
autoFocus: !0,
|
|
2556
|
-
onChange: (
|
|
2556
|
+
onChange: (h) => a(h.target.value),
|
|
2557
2557
|
placeholder: t("editor.image.dialog.placeholder"),
|
|
2558
2558
|
required: !0,
|
|
2559
2559
|
type: "url",
|
|
2560
2560
|
value: i
|
|
2561
2561
|
}
|
|
2562
2562
|
),
|
|
2563
|
-
/* @__PURE__ */
|
|
2563
|
+
/* @__PURE__ */ r(O, { type: "submit", children: t("editor.image.dialog.button.apply") })
|
|
2564
2564
|
] }) }) })
|
|
2565
2565
|
]
|
|
2566
2566
|
}
|
|
@@ -2577,14 +2577,14 @@ const He = {
|
|
|
2577
2577
|
BOTTOM_RIGHT: "br"
|
|
2578
2578
|
};
|
|
2579
2579
|
function Ia(e) {
|
|
2580
|
-
var
|
|
2580
|
+
var L, q;
|
|
2581
2581
|
const [t, n] = k({
|
|
2582
2582
|
width: wt,
|
|
2583
2583
|
height: wt
|
|
2584
2584
|
}), [i, a] = k({
|
|
2585
2585
|
width: 0,
|
|
2586
2586
|
height: 0
|
|
2587
|
-
}), [
|
|
2587
|
+
}), [o] = k([
|
|
2588
2588
|
He.TOP_LEFT,
|
|
2589
2589
|
He.TOP_RIGHT,
|
|
2590
2590
|
He.BOTTOM_LEFT,
|
|
@@ -2595,7 +2595,7 @@ function Ia(e) {
|
|
|
2595
2595
|
w: 0,
|
|
2596
2596
|
h: 0,
|
|
2597
2597
|
dir: ""
|
|
2598
|
-
}), { align: d, inline:
|
|
2598
|
+
}), { align: d, inline: f } = (L = e == null ? void 0 : e.node) == null ? void 0 : L.attrs, m = R(() => {
|
|
2599
2599
|
var gt;
|
|
2600
2600
|
const { src: v, alt: $, width: F, height: ee, flipX: te, flipY: M } = (gt = e == null ? void 0 : e.node) == null ? void 0 : gt.attrs, K = _t(F) ? `${F}px` : F, W = _t(ee) ? `${ee}px` : ee, Ue = [];
|
|
2601
2601
|
te && Ue.push("rotateX(180deg)"), M && Ue.push("rotateY(180deg)");
|
|
@@ -2609,12 +2609,12 @@ function Ia(e) {
|
|
|
2609
2609
|
transform: tn || "none"
|
|
2610
2610
|
}
|
|
2611
2611
|
};
|
|
2612
|
-
}, [(q = e == null ? void 0 : e.node) == null ? void 0 : q.attrs]),
|
|
2612
|
+
}, [(q = e == null ? void 0 : e.node) == null ? void 0 : q.attrs]), h = R(() => {
|
|
2613
2613
|
const {
|
|
2614
2614
|
style: { width: v }
|
|
2615
|
-
} =
|
|
2615
|
+
} = m;
|
|
2616
2616
|
return { width: v === "100%" ? v : void 0 };
|
|
2617
|
-
}, [
|
|
2617
|
+
}, [m]);
|
|
2618
2618
|
function b(v) {
|
|
2619
2619
|
a({
|
|
2620
2620
|
width: v.target.width,
|
|
@@ -2635,7 +2635,7 @@ function Ia(e) {
|
|
|
2635
2635
|
}, yt),
|
|
2636
2636
|
[e == null ? void 0 : e.editor]
|
|
2637
2637
|
);
|
|
2638
|
-
function
|
|
2638
|
+
function S(v, $) {
|
|
2639
2639
|
v.preventDefault(), v.stopPropagation();
|
|
2640
2640
|
const F = i.width, ee = i.height, te = F / ee;
|
|
2641
2641
|
let M = Number(e.node.attrs.width), K = Number(e.node.attrs.height);
|
|
@@ -2648,7 +2648,7 @@ function Ia(e) {
|
|
|
2648
2648
|
dir: $
|
|
2649
2649
|
});
|
|
2650
2650
|
}
|
|
2651
|
-
const
|
|
2651
|
+
const p = j(
|
|
2652
2652
|
bt((v) => {
|
|
2653
2653
|
if (v.preventDefault(), v.stopPropagation(), !s)
|
|
2654
2654
|
return;
|
|
@@ -2670,48 +2670,48 @@ function Ia(e) {
|
|
|
2670
2670
|
}), c(!1), x());
|
|
2671
2671
|
},
|
|
2672
2672
|
[s, x]
|
|
2673
|
-
),
|
|
2674
|
-
document == null || document.addEventListener("mousemove",
|
|
2675
|
-
}, [
|
|
2676
|
-
document == null || document.removeEventListener("mousemove",
|
|
2677
|
-
}, [
|
|
2678
|
-
P(() => (s ?
|
|
2673
|
+
), w = j(() => {
|
|
2674
|
+
document == null || document.addEventListener("mousemove", p, !0), document == null || document.addEventListener("mouseup", _, !0);
|
|
2675
|
+
}, [p, _]), C = j(() => {
|
|
2676
|
+
document == null || document.removeEventListener("mousemove", p, !0), document == null || document.removeEventListener("mouseup", _, !0);
|
|
2677
|
+
}, [p, _]);
|
|
2678
|
+
P(() => (s ? w() : C(), () => {
|
|
2679
2679
|
C();
|
|
2680
|
-
}), [s,
|
|
2680
|
+
}), [s, w, C]);
|
|
2681
2681
|
const T = R(() => new ResizeObserver(() => N()), [N]);
|
|
2682
2682
|
return P(() => (T.observe(e.editor.view.dom), () => {
|
|
2683
2683
|
T.disconnect();
|
|
2684
|
-
}), [e.editor.view.dom, T]), /* @__PURE__ */
|
|
2684
|
+
}), [e.editor.view.dom, T]), /* @__PURE__ */ r(
|
|
2685
2685
|
he,
|
|
2686
2686
|
{
|
|
2687
|
-
as:
|
|
2687
|
+
as: f ? "span" : "div",
|
|
2688
2688
|
className: "image-view",
|
|
2689
|
-
style: { ...
|
|
2690
|
-
children: /* @__PURE__ */
|
|
2689
|
+
style: { ...h, textAlign: d, display: f ? "inline" : "block" },
|
|
2690
|
+
children: /* @__PURE__ */ g(
|
|
2691
2691
|
"div",
|
|
2692
2692
|
{
|
|
2693
2693
|
"data-drag-handle": !0,
|
|
2694
2694
|
draggable: "true",
|
|
2695
|
-
style:
|
|
2695
|
+
style: h,
|
|
2696
2696
|
className: `image-view__body ${e != null && e.selected ? "image-view__body--focused" : ""} ${s ? "image-view__body--resizing" : ""}`,
|
|
2697
2697
|
children: [
|
|
2698
|
-
/* @__PURE__ */
|
|
2698
|
+
/* @__PURE__ */ r(
|
|
2699
2699
|
"img",
|
|
2700
2700
|
{
|
|
2701
|
-
alt:
|
|
2701
|
+
alt: m.alt,
|
|
2702
2702
|
className: "image-view__body__image block",
|
|
2703
2703
|
height: "auto",
|
|
2704
2704
|
onClick: x,
|
|
2705
2705
|
onLoad: b,
|
|
2706
|
-
src:
|
|
2707
|
-
style:
|
|
2706
|
+
src: m.src,
|
|
2707
|
+
style: m.style
|
|
2708
2708
|
}
|
|
2709
2709
|
),
|
|
2710
|
-
(e == null ? void 0 : e.editor.view.editable) && ((e == null ? void 0 : e.selected) || s) && /* @__PURE__ */
|
|
2710
|
+
(e == null ? void 0 : e.editor.view.editable) && ((e == null ? void 0 : e.selected) || s) && /* @__PURE__ */ r("div", { className: "image-resizer", children: o == null ? void 0 : o.map((v) => /* @__PURE__ */ r(
|
|
2711
2711
|
"span",
|
|
2712
2712
|
{
|
|
2713
2713
|
className: `image-resizer__handler image-resizer__handler--${v}`,
|
|
2714
|
-
onMouseDown: ($) =>
|
|
2714
|
+
onMouseDown: ($) => S($, v)
|
|
2715
2715
|
},
|
|
2716
2716
|
`image-dir-${v}`
|
|
2717
2717
|
)) })
|
|
@@ -2733,8 +2733,8 @@ function Ea() {
|
|
|
2733
2733
|
t = t.map(e.mapping, e.doc);
|
|
2734
2734
|
const n = e.getMeta(fe);
|
|
2735
2735
|
if (n != null && n.add)
|
|
2736
|
-
for (const { id: i, pos: a, src:
|
|
2737
|
-
const s = Ha(
|
|
2736
|
+
for (const { id: i, pos: a, src: o } of n.add) {
|
|
2737
|
+
const s = Ha(o), c = ge.widget(a, s, { id: i });
|
|
2738
2738
|
t = t.add(e.doc, [c]);
|
|
2739
2739
|
}
|
|
2740
2740
|
else if (n != null && n.remove)
|
|
@@ -2758,38 +2758,41 @@ function Ha(e) {
|
|
|
2758
2758
|
}
|
|
2759
2759
|
function za(e, t) {
|
|
2760
2760
|
var a;
|
|
2761
|
-
const i = fe.getState(e).find(void 0, void 0, (
|
|
2761
|
+
const i = fe.getState(e).find(void 0, void 0, (o) => o.id === t);
|
|
2762
2762
|
return i.length > 0 ? (a = i[0]) == null ? void 0 : a.from : null;
|
|
2763
2763
|
}
|
|
2764
|
-
function Ra({ validateFn: e, onUpload: t, postUpload: n }) {
|
|
2765
|
-
return (
|
|
2766
|
-
for (const
|
|
2767
|
-
if (e && !e(
|
|
2764
|
+
function Ra({ validateFn: e, onUpload: t, postUpload: n, defaultInline: i = !1 }) {
|
|
2765
|
+
return (a, o, s) => {
|
|
2766
|
+
for (const c of a) {
|
|
2767
|
+
if (e && !e(c))
|
|
2768
2768
|
continue;
|
|
2769
|
-
const
|
|
2770
|
-
|
|
2771
|
-
const
|
|
2772
|
-
|
|
2773
|
-
add: [{ id:
|
|
2774
|
-
}),
|
|
2775
|
-
async (
|
|
2776
|
-
var
|
|
2777
|
-
n && typeof
|
|
2778
|
-
const { schema:
|
|
2779
|
-
let h = za(
|
|
2769
|
+
const l = Date.now().toString(), u = o.state.tr;
|
|
2770
|
+
u.selection.empty || u.deleteSelection();
|
|
2771
|
+
const d = URL.createObjectURL(c);
|
|
2772
|
+
u.setMeta(fe, {
|
|
2773
|
+
add: [{ id: l, pos: s, src: d }]
|
|
2774
|
+
}), o.dispatch(u), t(c).then(
|
|
2775
|
+
async (f) => {
|
|
2776
|
+
var p;
|
|
2777
|
+
n && typeof f == "string" && (f = await n(f));
|
|
2778
|
+
const { schema: m } = o.state;
|
|
2779
|
+
let h = za(o.state, l);
|
|
2780
2780
|
if (h === null)
|
|
2781
2781
|
return;
|
|
2782
|
-
const
|
|
2783
|
-
|
|
2782
|
+
const b = typeof f == "object" ? d : f, x = (p = m.nodes.image) == null ? void 0 : p.create({
|
|
2783
|
+
src: b,
|
|
2784
|
+
inline: i
|
|
2785
|
+
});
|
|
2786
|
+
if (!x)
|
|
2784
2787
|
return;
|
|
2785
|
-
const { doc:
|
|
2786
|
-
h >
|
|
2787
|
-
const
|
|
2788
|
-
|
|
2788
|
+
const { doc: N } = o.state;
|
|
2789
|
+
h > N.content.size && (h = N.content.size - 1);
|
|
2790
|
+
const S = o.state.tr.replaceWith(h, h, x).setMeta(fe, { remove: [l] });
|
|
2791
|
+
o.dispatch(S);
|
|
2789
2792
|
},
|
|
2790
2793
|
() => {
|
|
2791
|
-
const
|
|
2792
|
-
|
|
2794
|
+
const f = o.state.tr.delete(s, s).setMeta(fe, { remove: [l] });
|
|
2795
|
+
o.dispatch(f);
|
|
2793
2796
|
}
|
|
2794
2797
|
);
|
|
2795
2798
|
}
|
|
@@ -2800,14 +2803,14 @@ function Pa(e, t, n) {
|
|
|
2800
2803
|
const i = [...((a = t.clipboardData) == null ? void 0 : a.files) || []];
|
|
2801
2804
|
if (i.length > 0) {
|
|
2802
2805
|
t.preventDefault();
|
|
2803
|
-
const
|
|
2804
|
-
return n(i, e,
|
|
2806
|
+
const o = e.state.selection.from;
|
|
2807
|
+
return n(i, e, o + 1), !0;
|
|
2805
2808
|
}
|
|
2806
2809
|
return !1;
|
|
2807
2810
|
}
|
|
2808
2811
|
function Da(e, t, n, i) {
|
|
2809
|
-
var
|
|
2810
|
-
const a = [...((
|
|
2812
|
+
var o;
|
|
2813
|
+
const a = [...((o = t.dataTransfer) == null ? void 0 : o.files) || []];
|
|
2811
2814
|
if (!n && a.length > 0) {
|
|
2812
2815
|
t.preventDefault();
|
|
2813
2816
|
const s = e.posAtCoords({
|
|
@@ -2842,14 +2845,14 @@ const Oa = {
|
|
|
2842
2845
|
extension: n,
|
|
2843
2846
|
t: i
|
|
2844
2847
|
}) => {
|
|
2845
|
-
var a,
|
|
2848
|
+
var a, o;
|
|
2846
2849
|
return {
|
|
2847
2850
|
component: Ma,
|
|
2848
2851
|
componentProps: {
|
|
2849
2852
|
action: () => !0,
|
|
2850
2853
|
upload: n.options.upload,
|
|
2851
2854
|
/* If setImage is not available(when Image Component is not imported), the button is disabled */
|
|
2852
|
-
disabled: !((
|
|
2855
|
+
disabled: !((o = (a = t.can()).setImage) != null && o.call(a, {})),
|
|
2853
2856
|
icon: "ImageUp",
|
|
2854
2857
|
tooltip: i("editor.image.tooltip"),
|
|
2855
2858
|
editor: t
|
|
@@ -2913,7 +2916,7 @@ const Oa = {
|
|
|
2913
2916
|
};
|
|
2914
2917
|
},
|
|
2915
2918
|
renderHTML({ HTMLAttributes: e }) {
|
|
2916
|
-
const { flipX: t, flipY: n, align: i, inline: a } = e,
|
|
2919
|
+
const { flipX: t, flipY: n, align: i, inline: a } = e, o = t || n ? `transform: rotateX(${t ? "180" : "0"}deg) rotateY(${n ? "180" : "0"}deg);` : "", s = i ? `text-align: ${i};` : "";
|
|
2917
2920
|
return [
|
|
2918
2921
|
a ? "span" : "div",
|
|
2919
2922
|
{
|
|
@@ -2925,7 +2928,7 @@ const Oa = {
|
|
|
2925
2928
|
Le(
|
|
2926
2929
|
{
|
|
2927
2930
|
height: "auto",
|
|
2928
|
-
style:
|
|
2931
|
+
style: o
|
|
2929
2932
|
},
|
|
2930
2933
|
this.options.HTMLAttributes,
|
|
2931
2934
|
e
|
|
@@ -2938,14 +2941,14 @@ const Oa = {
|
|
|
2938
2941
|
{
|
|
2939
2942
|
tag: "span.image img",
|
|
2940
2943
|
getAttrs: (e) => {
|
|
2941
|
-
var
|
|
2944
|
+
var o;
|
|
2942
2945
|
const t = e == null ? void 0 : e.parentElement, n = e == null ? void 0 : e.getAttribute("width"), i = (e == null ? void 0 : e.getAttribute("flipx")) || !1, a = (e == null ? void 0 : e.getAttribute("flipy")) || !1;
|
|
2943
2946
|
return {
|
|
2944
2947
|
src: e == null ? void 0 : e.getAttribute("src"),
|
|
2945
2948
|
alt: e == null ? void 0 : e.getAttribute("alt"),
|
|
2946
2949
|
caption: e == null ? void 0 : e.getAttribute("caption"),
|
|
2947
2950
|
width: n ? Number.parseInt(n, 10) : null,
|
|
2948
|
-
align: (e == null ? void 0 : e.getAttribute("align")) || ((
|
|
2951
|
+
align: (e == null ? void 0 : e.getAttribute("align")) || ((o = t == null ? void 0 : t.style) == null ? void 0 : o.textAlign) || null,
|
|
2949
2952
|
inline: (e == null ? void 0 : e.getAttribute("inline")) || !1,
|
|
2950
2953
|
flipX: i === "true",
|
|
2951
2954
|
flipY: a === "true"
|
|
@@ -2973,14 +2976,15 @@ const Oa = {
|
|
|
2973
2976
|
addProseMirrorPlugins() {
|
|
2974
2977
|
const t = Ra({
|
|
2975
2978
|
validateFn: (n) => !(!this.options.acceptMimes.includes(n.type) || n.size > this.options.maxSize),
|
|
2976
|
-
onUpload: this.options.upload
|
|
2979
|
+
onUpload: this.options.upload,
|
|
2977
2980
|
// postUpload: this.options.postUpload,
|
|
2981
|
+
defaultInline: this.options.defaultInline
|
|
2978
2982
|
});
|
|
2979
2983
|
return [
|
|
2980
2984
|
new J({
|
|
2981
2985
|
props: {
|
|
2982
|
-
handlePaste: (n, i) => !i.clipboardData || [...i.clipboardData.files || []].some((
|
|
2983
|
-
handleDrop: (n, i, a,
|
|
2986
|
+
handlePaste: (n, i) => !i.clipboardData || [...i.clipboardData.files || []].some((o) => o.type === "text/html") ? !1 : Pa(n, i, t),
|
|
2987
|
+
handleDrop: (n, i, a, o) => (!(i instanceof DragEvent) || !i.dataTransfer || Da(n, i, o, t), !1)
|
|
2984
2988
|
}
|
|
2985
2989
|
}),
|
|
2986
2990
|
Ea()
|
|
@@ -2991,36 +2995,36 @@ function ja(e) {
|
|
|
2991
2995
|
return /\.(?:mp4|webm|ogg|mov)$/i.test(e);
|
|
2992
2996
|
}
|
|
2993
2997
|
function Ba(e) {
|
|
2994
|
-
const { t } = B(), [n, i] = k(""), a = X(null),
|
|
2995
|
-
var
|
|
2996
|
-
return (
|
|
2998
|
+
const { t } = B(), [n, i] = k(""), a = X(null), o = Na(), [s, c] = k(""), l = R(() => {
|
|
2999
|
+
var h;
|
|
3000
|
+
return (h = e.editor.extensionManager.extensions.find(
|
|
2997
3001
|
(b) => b.name === Fa.name
|
|
2998
|
-
)) == null ? void 0 :
|
|
3002
|
+
)) == null ? void 0 : h.options;
|
|
2999
3003
|
}, [e.editor]);
|
|
3000
|
-
async function u(
|
|
3004
|
+
async function u(m) {
|
|
3001
3005
|
var N;
|
|
3002
|
-
const
|
|
3003
|
-
if (!e.editor || e.editor.isDestroyed ||
|
|
3006
|
+
const h = (N = m == null ? void 0 : m.target) == null ? void 0 : N.files;
|
|
3007
|
+
if (!e.editor || e.editor.isDestroyed || h.length === 0)
|
|
3004
3008
|
return;
|
|
3005
|
-
const b =
|
|
3009
|
+
const b = h[0];
|
|
3006
3010
|
let x = "";
|
|
3007
3011
|
l.upload ? x = await l.upload(b) : x = URL.createObjectURL(b), e.editor.chain().setVideo({
|
|
3008
3012
|
src: x,
|
|
3009
3013
|
width: "100%"
|
|
3010
3014
|
}).focus().run(), ke.setOpen(!1);
|
|
3011
3015
|
}
|
|
3012
|
-
function d(
|
|
3013
|
-
|
|
3016
|
+
function d(m) {
|
|
3017
|
+
m.preventDefault(), m.stopPropagation(), n && (e.editor.chain().setVideo({
|
|
3014
3018
|
src: n,
|
|
3015
3019
|
width: "100%"
|
|
3016
3020
|
}).focus().run(), ke.setOpen(!1));
|
|
3017
3021
|
}
|
|
3018
|
-
function
|
|
3019
|
-
var
|
|
3020
|
-
|
|
3022
|
+
function f(m) {
|
|
3023
|
+
var h;
|
|
3024
|
+
m.preventDefault(), (h = a.current) == null || h.click();
|
|
3021
3025
|
}
|
|
3022
|
-
return /* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3026
|
+
return /* @__PURE__ */ g(st, { open: o, onOpenChange: ke.setOpen, children: [
|
|
3027
|
+
/* @__PURE__ */ r(ct, { asChild: !0, children: /* @__PURE__ */ r(
|
|
3024
3028
|
y,
|
|
3025
3029
|
{
|
|
3026
3030
|
icon: e.icon,
|
|
@@ -3028,21 +3032,21 @@ function Ba(e) {
|
|
|
3028
3032
|
tooltip: e.tooltip
|
|
3029
3033
|
}
|
|
3030
3034
|
) }),
|
|
3031
|
-
/* @__PURE__ */
|
|
3032
|
-
/* @__PURE__ */
|
|
3033
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ g(lt, { children: [
|
|
3036
|
+
/* @__PURE__ */ r(dt, { children: t("editor.video.dialog.title") }),
|
|
3037
|
+
/* @__PURE__ */ g(
|
|
3034
3038
|
Xt,
|
|
3035
3039
|
{
|
|
3036
3040
|
defaultValue: (l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload" ? "upload" : "link",
|
|
3037
3041
|
activationMode: "manual",
|
|
3038
3042
|
children: [
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload") && /* @__PURE__ */
|
|
3041
|
-
((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "link") && /* @__PURE__ */
|
|
3043
|
+
/* @__PURE__ */ g(ft, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
|
|
3044
|
+
((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload") && /* @__PURE__ */ r(Ne, { value: "upload", children: t("editor.video.dialog.tab.upload") }),
|
|
3045
|
+
((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "link") && /* @__PURE__ */ r(Ne, { value: "link", children: t("editor.video.dialog.link") })
|
|
3042
3046
|
] }),
|
|
3043
|
-
/* @__PURE__ */
|
|
3044
|
-
/* @__PURE__ */
|
|
3045
|
-
/* @__PURE__ */
|
|
3047
|
+
/* @__PURE__ */ g(Te, { value: "upload", children: [
|
|
3048
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ r(O, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: f, children: t("editor.video.dialog.tab.upload") }) }),
|
|
3049
|
+
/* @__PURE__ */ r(
|
|
3046
3050
|
"input",
|
|
3047
3051
|
{
|
|
3048
3052
|
type: "file",
|
|
@@ -3056,29 +3060,29 @@ function Ba(e) {
|
|
|
3056
3060
|
}
|
|
3057
3061
|
)
|
|
3058
3062
|
] }),
|
|
3059
|
-
/* @__PURE__ */
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3063
|
+
/* @__PURE__ */ g(Te, { value: "link", children: [
|
|
3064
|
+
/* @__PURE__ */ r("form", { onSubmit: d, children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
3065
|
+
/* @__PURE__ */ r(
|
|
3062
3066
|
Oe,
|
|
3063
3067
|
{
|
|
3064
3068
|
type: "url",
|
|
3065
3069
|
autoFocus: !0,
|
|
3066
3070
|
value: n,
|
|
3067
|
-
onChange: (
|
|
3068
|
-
const
|
|
3069
|
-
if (!ja(
|
|
3071
|
+
onChange: (m) => {
|
|
3072
|
+
const h = m.target.value;
|
|
3073
|
+
if (!ja(h)) {
|
|
3070
3074
|
c("Invalid video URL"), i("");
|
|
3071
3075
|
return;
|
|
3072
3076
|
}
|
|
3073
|
-
c(""), i(
|
|
3077
|
+
c(""), i(h);
|
|
3074
3078
|
},
|
|
3075
3079
|
required: !0,
|
|
3076
3080
|
placeholder: t("editor.video.dialog.placeholder")
|
|
3077
3081
|
}
|
|
3078
3082
|
),
|
|
3079
|
-
/* @__PURE__ */
|
|
3083
|
+
/* @__PURE__ */ r(O, { type: "submit", children: t("editor.video.dialog.button.apply") })
|
|
3080
3084
|
] }) }),
|
|
3081
|
-
s && /* @__PURE__ */
|
|
3085
|
+
s && /* @__PURE__ */ r("div", { className: "richtext-text-red-500 richtext-my-[5px]", children: s })
|
|
3082
3086
|
] })
|
|
3083
3087
|
]
|
|
3084
3088
|
}
|
|
@@ -3191,14 +3195,14 @@ function Ua(e, t, n) {
|
|
|
3191
3195
|
}
|
|
3192
3196
|
function Va(e, t, n) {
|
|
3193
3197
|
const { doc: i, selection: a } = e;
|
|
3194
|
-
return !i || !a || !(a instanceof Vn) || a.forEachCell((
|
|
3198
|
+
return !i || !a || !(a instanceof Vn) || a.forEachCell((o, s) => {
|
|
3195
3199
|
e = Ua(e, s, n);
|
|
3196
3200
|
}), e;
|
|
3197
3201
|
}
|
|
3198
3202
|
function Nt(e, t) {
|
|
3199
3203
|
return ({ tr: n, state: i, dispatch: a }) => {
|
|
3200
|
-
const { selection:
|
|
3201
|
-
return n = n.setSelection(
|
|
3204
|
+
const { selection: o } = i;
|
|
3205
|
+
return n = n.setSelection(o), n = Va(n, t, e), n.docChanged ? (a == null || a(n), !0) : !1;
|
|
3202
3206
|
};
|
|
3203
3207
|
}
|
|
3204
3208
|
const qa = H.create({
|
|
@@ -3241,24 +3245,24 @@ function Xa(e) {
|
|
|
3241
3245
|
const [t, n] = k(!0), [i, a] = k({
|
|
3242
3246
|
rows: Tt() ? Me : Ie,
|
|
3243
3247
|
cols: Tt() ? Me : Ie
|
|
3244
|
-
}), [
|
|
3248
|
+
}), [o, s] = k({
|
|
3245
3249
|
rows: Ee,
|
|
3246
3250
|
cols: Ee
|
|
3247
3251
|
});
|
|
3248
|
-
function c(
|
|
3249
|
-
|
|
3250
|
-
...
|
|
3251
|
-
rows: Math.min(
|
|
3252
|
-
})),
|
|
3253
|
-
...
|
|
3254
|
-
cols: Math.min(
|
|
3252
|
+
function c(f, m) {
|
|
3253
|
+
f === i.rows && a((h) => ({
|
|
3254
|
+
...h,
|
|
3255
|
+
rows: Math.min(f + 1, Me)
|
|
3256
|
+
})), m === i.cols && a((h) => ({
|
|
3257
|
+
...h,
|
|
3258
|
+
cols: Math.min(m + 1, Me)
|
|
3255
3259
|
})), s({
|
|
3256
|
-
rows:
|
|
3257
|
-
cols:
|
|
3260
|
+
rows: f,
|
|
3261
|
+
cols: m
|
|
3258
3262
|
});
|
|
3259
3263
|
}
|
|
3260
|
-
function l(
|
|
3261
|
-
e == null || e.createTable({ rows:
|
|
3264
|
+
function l(f, m) {
|
|
3265
|
+
e == null || e.createTable({ rows: f, cols: m, withHeaderRow: t }), u();
|
|
3262
3266
|
}
|
|
3263
3267
|
function u() {
|
|
3264
3268
|
n(!1), a({
|
|
@@ -3269,40 +3273,40 @@ function Xa(e) {
|
|
|
3269
3273
|
cols: Ee
|
|
3270
3274
|
});
|
|
3271
3275
|
}
|
|
3272
|
-
return /* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3276
|
+
return /* @__PURE__ */ g(xe, { modal: !0, children: [
|
|
3277
|
+
/* @__PURE__ */ r(pe, { asChild: !0, children: e == null ? void 0 : e.children }),
|
|
3278
|
+
/* @__PURE__ */ r(
|
|
3275
3279
|
we,
|
|
3276
3280
|
{
|
|
3277
3281
|
align: "start",
|
|
3278
3282
|
className: "richtext-w-full !richtext-p-2",
|
|
3279
3283
|
side: "bottom",
|
|
3280
|
-
children: /* @__PURE__ */
|
|
3281
|
-
/* @__PURE__ */
|
|
3282
|
-
var
|
|
3283
|
-
return /* @__PURE__ */
|
|
3284
|
+
children: /* @__PURE__ */ g("div", { className: "table-grid-size-editor richtext-p-0", children: [
|
|
3285
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (d = At(i == null ? void 0 : i.rows)) == null ? void 0 : d.map((f) => {
|
|
3286
|
+
var m;
|
|
3287
|
+
return /* @__PURE__ */ r(
|
|
3284
3288
|
"div",
|
|
3285
3289
|
{
|
|
3286
3290
|
className: "richtext-flex richtext-gap-1",
|
|
3287
|
-
children: (
|
|
3291
|
+
children: (m = At(i == null ? void 0 : i.cols)) == null ? void 0 : m.map((h) => /* @__PURE__ */ r(
|
|
3288
3292
|
"div",
|
|
3289
3293
|
{
|
|
3290
|
-
onMouseDown: () => l(
|
|
3291
|
-
onMouseOver: () => c(
|
|
3292
|
-
className: `richtext-cursor-pointer richtext-border-border ${
|
|
3293
|
-
children: /* @__PURE__ */
|
|
3294
|
+
onMouseDown: () => l(f, h),
|
|
3295
|
+
onMouseOver: () => c(f, h),
|
|
3296
|
+
className: `richtext-cursor-pointer richtext-border-border ${h <= o.cols && f <= o.rows && "tableCellActive !richtext-bg-foreground"}`,
|
|
3297
|
+
children: /* @__PURE__ */ r("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
|
|
3294
3298
|
},
|
|
3295
|
-
`c-${
|
|
3299
|
+
`c-${h}`
|
|
3296
3300
|
))
|
|
3297
3301
|
},
|
|
3298
|
-
`r-${
|
|
3302
|
+
`r-${f}`
|
|
3299
3303
|
);
|
|
3300
3304
|
}) }),
|
|
3301
|
-
/* @__PURE__ */
|
|
3302
|
-
|
|
3305
|
+
/* @__PURE__ */ g("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-zinc-600", children: [
|
|
3306
|
+
o.rows,
|
|
3303
3307
|
" ",
|
|
3304
3308
|
"x",
|
|
3305
|
-
|
|
3309
|
+
o.cols
|
|
3306
3310
|
] })
|
|
3307
3311
|
] })
|
|
3308
3312
|
}
|
|
@@ -3313,7 +3317,7 @@ function Ya(e) {
|
|
|
3313
3317
|
function t(n) {
|
|
3314
3318
|
e.disabled || e.editor.chain().focus().insertTable({ ...n, withHeaderRow: !1 }).run();
|
|
3315
3319
|
}
|
|
3316
|
-
return /* @__PURE__ */
|
|
3320
|
+
return /* @__PURE__ */ r(Xa, { createTable: t, children: /* @__PURE__ */ r(
|
|
3317
3321
|
y,
|
|
3318
3322
|
{
|
|
3319
3323
|
icon: e == null ? void 0 : e.icon,
|
|
@@ -3405,12 +3409,12 @@ const Pr = Pn.extend({
|
|
|
3405
3409
|
document.removeEventListener("mouseup", n);
|
|
3406
3410
|
let {
|
|
3407
3411
|
dispatch: i,
|
|
3408
|
-
state: { tr: a, selection:
|
|
3412
|
+
state: { tr: a, selection: o },
|
|
3409
3413
|
dom: s
|
|
3410
3414
|
} = e;
|
|
3411
|
-
s.style.cursor = "", a = a.removeMark(
|
|
3415
|
+
s.style.cursor = "", a = a.removeMark(o.from, o.to);
|
|
3412
3416
|
for (const c of t)
|
|
3413
|
-
c.type.name !== "link" && (a = a.addMark(
|
|
3417
|
+
c.type.name !== "link" && (a = a.addMark(o.from, o.to, c));
|
|
3414
3418
|
i(a.setMeta("painterAction", { type: "end" }));
|
|
3415
3419
|
};
|
|
3416
3420
|
return document.addEventListener("mouseup", n), !0;
|
|
@@ -3422,51 +3426,51 @@ const Pr = Pn.extend({
|
|
|
3422
3426
|
}
|
|
3423
3427
|
});
|
|
3424
3428
|
function Za({ editor: e, ...t }) {
|
|
3425
|
-
const { t: n } = B(), [i, a] = k(-1), [
|
|
3429
|
+
const { t: n } = B(), [i, a] = k(-1), [o, s] = k([]), [c, l] = k(""), [u, d] = k(""), [f, m] = k(!1), [h, b] = k(!1);
|
|
3426
3430
|
return P(() => {
|
|
3427
|
-
|
|
3428
|
-
}, [e,
|
|
3429
|
-
|
|
3430
|
-
}, [
|
|
3431
|
-
|
|
3432
|
-
}, [
|
|
3431
|
+
f || (l(""), d(""), a(-1), s([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
|
|
3432
|
+
}, [e, f]), P(() => {
|
|
3433
|
+
f && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(c);
|
|
3434
|
+
}, [f, c, e]), P(() => {
|
|
3435
|
+
f && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(u);
|
|
3436
|
+
}, [f, u, e]), P(() => {
|
|
3433
3437
|
if (!e)
|
|
3434
3438
|
return;
|
|
3435
|
-
const x = e.extensionManager.extensions.find((
|
|
3439
|
+
const x = e.extensionManager.extensions.find((S) => S.name === no.name);
|
|
3436
3440
|
if (!x)
|
|
3437
3441
|
return;
|
|
3438
3442
|
const N = () => {
|
|
3439
|
-
if (!
|
|
3443
|
+
if (!f)
|
|
3440
3444
|
return;
|
|
3441
|
-
const
|
|
3442
|
-
a((_) => _ !==
|
|
3445
|
+
const S = x ? x.storage.currentIndex : -1, p = x ? x.storage.results : [];
|
|
3446
|
+
a((_) => _ !== S ? S : _), s((_) => qn(_, p) ? _ : p);
|
|
3443
3447
|
};
|
|
3444
3448
|
return window.addEventListener(Ye, N), () => {
|
|
3445
3449
|
x && window.removeEventListener(Ye, N);
|
|
3446
3450
|
};
|
|
3447
|
-
}, [
|
|
3451
|
+
}, [f, e]), /* @__PURE__ */ g(
|
|
3448
3452
|
xe,
|
|
3449
3453
|
{
|
|
3450
|
-
open:
|
|
3451
|
-
onOpenChange:
|
|
3454
|
+
open: f,
|
|
3455
|
+
onOpenChange: m,
|
|
3452
3456
|
children: [
|
|
3453
|
-
/* @__PURE__ */
|
|
3457
|
+
/* @__PURE__ */ r(
|
|
3454
3458
|
pe,
|
|
3455
3459
|
{
|
|
3456
3460
|
disabled: t == null ? void 0 : t.disabled,
|
|
3457
3461
|
asChild: !0,
|
|
3458
|
-
children: /* @__PURE__ */
|
|
3462
|
+
children: /* @__PURE__ */ r(
|
|
3459
3463
|
y,
|
|
3460
3464
|
{
|
|
3461
3465
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
3462
3466
|
isActive: t == null ? void 0 : t.isActive,
|
|
3463
3467
|
disabled: t == null ? void 0 : t.disabled,
|
|
3464
|
-
children: /* @__PURE__ */
|
|
3468
|
+
children: /* @__PURE__ */ r(D, { name: t == null ? void 0 : t.icon })
|
|
3465
3469
|
}
|
|
3466
3470
|
)
|
|
3467
3471
|
}
|
|
3468
3472
|
),
|
|
3469
|
-
/* @__PURE__ */
|
|
3473
|
+
/* @__PURE__ */ g(
|
|
3470
3474
|
we,
|
|
3471
3475
|
{
|
|
3472
3476
|
hideWhenDetached: !0,
|
|
@@ -3474,12 +3478,12 @@ function Za({ editor: e, ...t }) {
|
|
|
3474
3478
|
align: "start",
|
|
3475
3479
|
side: "bottom",
|
|
3476
3480
|
children: [
|
|
3477
|
-
/* @__PURE__ */
|
|
3478
|
-
/* @__PURE__ */
|
|
3479
|
-
/* @__PURE__ */
|
|
3481
|
+
/* @__PURE__ */ g("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
|
|
3482
|
+
/* @__PURE__ */ r(De, { children: n("editor.search.dialog.text") }),
|
|
3483
|
+
/* @__PURE__ */ r("span", { className: "richtext-font-semibold", children: o.length > 0 ? `${i + 1}/${o.length}` : "0/0" })
|
|
3480
3484
|
] }),
|
|
3481
|
-
/* @__PURE__ */
|
|
3482
|
-
/* @__PURE__ */
|
|
3485
|
+
/* @__PURE__ */ g("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]", children: [
|
|
3486
|
+
/* @__PURE__ */ r(
|
|
3483
3487
|
Oe,
|
|
3484
3488
|
{
|
|
3485
3489
|
type: "text",
|
|
@@ -3491,11 +3495,11 @@ function Za({ editor: e, ...t }) {
|
|
|
3491
3495
|
onChange: (x) => l(x.target.value)
|
|
3492
3496
|
}
|
|
3493
3497
|
),
|
|
3494
|
-
/* @__PURE__ */
|
|
3495
|
-
/* @__PURE__ */
|
|
3498
|
+
/* @__PURE__ */ r(O, { disabled: o.length === 0, className: "richtext-flex-1", onClick: e.commands.goToPrevSearchResult, children: /* @__PURE__ */ r(D, { name: "ChevronUp" }) }),
|
|
3499
|
+
/* @__PURE__ */ r(O, { disabled: o.length === 0, className: "richtext-flex-1", onClick: e.commands.goToNextSearchResult, children: /* @__PURE__ */ r(D, { name: "ChevronDown" }) })
|
|
3496
3500
|
] }),
|
|
3497
|
-
/* @__PURE__ */
|
|
3498
|
-
/* @__PURE__ */
|
|
3501
|
+
/* @__PURE__ */ r(De, { className: "richtext-mb-[6px]", children: n("editor.replace.dialog.text") }),
|
|
3502
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[5px]", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
|
|
3499
3503
|
Oe,
|
|
3500
3504
|
{
|
|
3501
3505
|
type: "text",
|
|
@@ -3506,21 +3510,21 @@ function Za({ editor: e, ...t }) {
|
|
|
3506
3510
|
onChange: (x) => d(x.target.value)
|
|
3507
3511
|
}
|
|
3508
3512
|
) }) }),
|
|
3509
|
-
/* @__PURE__ */
|
|
3510
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-space-x-2 richtext-mb-[10px]", children: [
|
|
3514
|
+
/* @__PURE__ */ r(
|
|
3511
3515
|
bi,
|
|
3512
3516
|
{
|
|
3513
|
-
checked:
|
|
3517
|
+
checked: h,
|
|
3514
3518
|
onCheckedChange: (x) => {
|
|
3515
3519
|
b(x), e.commands.setCaseSensitive(x);
|
|
3516
3520
|
}
|
|
3517
3521
|
}
|
|
3518
3522
|
),
|
|
3519
|
-
/* @__PURE__ */
|
|
3523
|
+
/* @__PURE__ */ r(De, { children: n("editor.replace.caseSensitive") })
|
|
3520
3524
|
] }),
|
|
3521
|
-
/* @__PURE__ */
|
|
3522
|
-
/* @__PURE__ */
|
|
3523
|
-
/* @__PURE__ */
|
|
3525
|
+
/* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
3526
|
+
/* @__PURE__ */ r(O, { disabled: o.length === 0, className: "richtext-flex-1", onClick: e.commands.replace, children: n("editor.replace.dialog.text") }),
|
|
3527
|
+
/* @__PURE__ */ r(O, { disabled: o.length === 0, className: "richtext-flex-1", onClick: e.commands.replaceAll, children: n("editor.replaceAll.dialog.text") })
|
|
3524
3528
|
] })
|
|
3525
3529
|
]
|
|
3526
3530
|
}
|
|
@@ -3536,7 +3540,7 @@ function Ja(e, t, n) {
|
|
|
3536
3540
|
function Qa(e, t, n) {
|
|
3537
3541
|
const i = [];
|
|
3538
3542
|
let a = [];
|
|
3539
|
-
const
|
|
3543
|
+
const o = [];
|
|
3540
3544
|
let s = 0;
|
|
3541
3545
|
if (!t)
|
|
3542
3546
|
return { decorationsToReturn: [], results: [] };
|
|
@@ -3554,53 +3558,53 @@ function Qa(e, t, n) {
|
|
|
3554
3558
|
for (const d of u) {
|
|
3555
3559
|
if (d[0] === "")
|
|
3556
3560
|
break;
|
|
3557
|
-
d.index !== void 0 &&
|
|
3561
|
+
d.index !== void 0 && o.push({
|
|
3558
3562
|
from: l + d.index,
|
|
3559
3563
|
to: l + d.index + d[0].length
|
|
3560
3564
|
});
|
|
3561
3565
|
}
|
|
3562
3566
|
}
|
|
3563
|
-
for (const c of
|
|
3567
|
+
for (const c of o)
|
|
3564
3568
|
i.push(ge.inline(c.from, c.to, { class: n }));
|
|
3565
3569
|
return {
|
|
3566
3570
|
decorationsToReturn: i,
|
|
3567
|
-
results:
|
|
3571
|
+
results: o
|
|
3568
3572
|
};
|
|
3569
3573
|
}
|
|
3570
3574
|
function Lt(e, t, { state: n, dispatch: i }) {
|
|
3571
3575
|
if (!t[0])
|
|
3572
3576
|
return;
|
|
3573
|
-
const { from:
|
|
3574
|
-
i && i(n.tr.insertText(e,
|
|
3577
|
+
const { from: o, to: s } = t[0];
|
|
3578
|
+
i && i(n.tr.insertText(e, o, s));
|
|
3575
3579
|
}
|
|
3576
3580
|
function eo(e, t, n, i) {
|
|
3577
3581
|
const a = t + 1;
|
|
3578
3582
|
if (!i[a])
|
|
3579
3583
|
return null;
|
|
3580
|
-
const { from:
|
|
3584
|
+
const { from: o, to: s } = i[t], c = s - o - e.length + n, { from: l, to: u } = i[a];
|
|
3581
3585
|
return i[a] = {
|
|
3582
3586
|
to: u - c,
|
|
3583
3587
|
from: l - c
|
|
3584
3588
|
}, [c, i];
|
|
3585
3589
|
}
|
|
3586
3590
|
function to(e, t, { tr: n, dispatch: i }) {
|
|
3587
|
-
let a = 0,
|
|
3588
|
-
if (
|
|
3591
|
+
let a = 0, o = t.slice();
|
|
3592
|
+
if (o.length === 0)
|
|
3589
3593
|
return !1;
|
|
3590
|
-
for (let s = 0; s <
|
|
3591
|
-
const { from: c, to: l } =
|
|
3594
|
+
for (let s = 0; s < o.length; s += 1) {
|
|
3595
|
+
const { from: c, to: l } = o[s];
|
|
3592
3596
|
n.insertText(e, c, l);
|
|
3593
|
-
const u = eo(e, s, a,
|
|
3594
|
-
u && (a = u[0],
|
|
3597
|
+
const u = eo(e, s, a, o);
|
|
3598
|
+
u && (a = u[0], o = u[1]);
|
|
3595
3599
|
}
|
|
3596
3600
|
return i(n), !0;
|
|
3597
3601
|
}
|
|
3598
3602
|
function St({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, gotoIndex: a }) {
|
|
3599
|
-
const
|
|
3600
|
-
if (
|
|
3603
|
+
const o = n[a];
|
|
3604
|
+
if (o) {
|
|
3601
3605
|
const s = t.setMeta("directDecoration", {
|
|
3602
|
-
fromPos:
|
|
3603
|
-
toPos:
|
|
3606
|
+
fromPos: o.from,
|
|
3607
|
+
toPos: o.to,
|
|
3604
3608
|
attrs: { class: i }
|
|
3605
3609
|
});
|
|
3606
3610
|
return e == null || e.dispatch(s), setTimeout(() => {
|
|
@@ -3652,31 +3656,31 @@ const Ye = "ON_SEARCH_RESULTS", de = new CustomEvent(Ye), no = H.create({
|
|
|
3652
3656
|
setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, ve(t, n), !1),
|
|
3653
3657
|
setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, ve(t, n), !1),
|
|
3654
3658
|
replace: () => ({ state: e, dispatch: t }) => {
|
|
3655
|
-
const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage,
|
|
3656
|
-
return
|
|
3659
|
+
const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage, o = a[i];
|
|
3660
|
+
return o ? (Lt(n, [o], { state: e, dispatch: t }), this.storage.results.splice(i, 1)) : (Lt(n, a, { state: e, dispatch: t }), this.storage.results.shift()), window.dispatchEvent(de), ve(e, t), !1;
|
|
3657
3661
|
},
|
|
3658
3662
|
replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
|
|
3659
3663
|
const { replaceTerm: i } = this.options, { results: a } = this.storage;
|
|
3660
3664
|
return to(i, a, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], window.dispatchEvent(de), ve(e, n), !1;
|
|
3661
3665
|
},
|
|
3662
3666
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
3663
|
-
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage,
|
|
3664
|
-
return this.storage.currentIndex =
|
|
3667
|
+
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + a.length - 1) % a.length;
|
|
3668
|
+
return this.storage.currentIndex = o, window.dispatchEvent(de), St({
|
|
3665
3669
|
view: e,
|
|
3666
3670
|
tr: t,
|
|
3667
3671
|
searchResults: a,
|
|
3668
3672
|
searchResultCurrentClass: n,
|
|
3669
|
-
gotoIndex:
|
|
3673
|
+
gotoIndex: o
|
|
3670
3674
|
});
|
|
3671
3675
|
},
|
|
3672
3676
|
goToNextSearchResult: () => ({ view: e, tr: t }) => {
|
|
3673
|
-
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage,
|
|
3674
|
-
return this.storage.currentIndex =
|
|
3677
|
+
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + 1) % a.length;
|
|
3678
|
+
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), window.dispatchEvent(de), St({
|
|
3675
3679
|
view: e,
|
|
3676
3680
|
tr: t,
|
|
3677
3681
|
searchResults: a,
|
|
3678
3682
|
searchResultCurrentClass: n,
|
|
3679
|
-
gotoIndex:
|
|
3683
|
+
gotoIndex: o
|
|
3680
3684
|
});
|
|
3681
3685
|
}
|
|
3682
3686
|
};
|
|
@@ -3691,16 +3695,16 @@ const Ye = "ON_SEARCH_RESULTS", de = new CustomEvent(Ye), no = H.create({
|
|
|
3691
3695
|
return me.empty;
|
|
3692
3696
|
},
|
|
3693
3697
|
apply(t) {
|
|
3694
|
-
const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass:
|
|
3698
|
+
const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: s, disableRegex: c, caseSensitive: l } = e.options;
|
|
3695
3699
|
if (i || a) {
|
|
3696
3700
|
const { decorationsToReturn: u, results: d } = Qa(
|
|
3697
3701
|
n,
|
|
3698
3702
|
Ja(a, c, l),
|
|
3699
|
-
|
|
3703
|
+
o
|
|
3700
3704
|
);
|
|
3701
3705
|
if (e.storage.results = d, e.storage.currentIndex > d.length - 1 && (e.storage.currentIndex = 0), window.dispatchEvent(de), t.getMeta("directDecoration")) {
|
|
3702
|
-
const { fromPos:
|
|
3703
|
-
u.push(ge.inline(
|
|
3706
|
+
const { fromPos: f, toPos: m, attrs: h } = t.getMeta("directDecoration");
|
|
3707
|
+
u.push(ge.inline(f, m, h));
|
|
3704
3708
|
} else
|
|
3705
3709
|
d.length > 0 && (u[0] = ge.inline(d[0].from, d[0].to, {
|
|
3706
3710
|
class: s
|
|
@@ -3723,7 +3727,7 @@ function io({
|
|
|
3723
3727
|
className: e,
|
|
3724
3728
|
...t
|
|
3725
3729
|
}) {
|
|
3726
|
-
return /* @__PURE__ */
|
|
3730
|
+
return /* @__PURE__ */ r(
|
|
3727
3731
|
ae.Root,
|
|
3728
3732
|
{
|
|
3729
3733
|
className: E(
|
|
@@ -3739,14 +3743,14 @@ function ao({
|
|
|
3739
3743
|
className: e,
|
|
3740
3744
|
...t
|
|
3741
3745
|
}) {
|
|
3742
|
-
return /* @__PURE__ */
|
|
3746
|
+
return /* @__PURE__ */ g(
|
|
3743
3747
|
"div",
|
|
3744
3748
|
{
|
|
3745
3749
|
className: E("richtext-flex richtext-h-9 richtext-items-center richtext-gap-2 richtext-border-b richtext-px-3", e),
|
|
3746
3750
|
"data-slot": "emoji-picker-search-wrapper",
|
|
3747
3751
|
children: [
|
|
3748
|
-
/* @__PURE__ */
|
|
3749
|
-
/* @__PURE__ */
|
|
3752
|
+
/* @__PURE__ */ r(Yn, { className: "richtext-size-4 richtext-shrink-0 richtext-opacity-50" }),
|
|
3753
|
+
/* @__PURE__ */ r(
|
|
3750
3754
|
ae.Search,
|
|
3751
3755
|
{
|
|
3752
3756
|
className: "richtext-outline-hidden placeholder:richtext-text-muted-foreground richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md richtext-bg-transparent richtext-py-3 richtext-text-sm disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",
|
|
@@ -3759,14 +3763,14 @@ function ao({
|
|
|
3759
3763
|
);
|
|
3760
3764
|
}
|
|
3761
3765
|
function oo({ children: e, ...t }) {
|
|
3762
|
-
return /* @__PURE__ */
|
|
3766
|
+
return /* @__PURE__ */ r("div", { ...t, className: "richtext-scroll-my-1 richtext-px-1", "data-slot": "emoji-picker-row", children: e });
|
|
3763
3767
|
}
|
|
3764
3768
|
function ro({
|
|
3765
3769
|
emoji: e,
|
|
3766
3770
|
className: t,
|
|
3767
3771
|
...n
|
|
3768
3772
|
}) {
|
|
3769
|
-
return /* @__PURE__ */
|
|
3773
|
+
return /* @__PURE__ */ r(
|
|
3770
3774
|
"button",
|
|
3771
3775
|
{
|
|
3772
3776
|
...n,
|
|
@@ -3783,7 +3787,7 @@ function so({
|
|
|
3783
3787
|
category: e,
|
|
3784
3788
|
...t
|
|
3785
3789
|
}) {
|
|
3786
|
-
return /* @__PURE__ */
|
|
3790
|
+
return /* @__PURE__ */ r(
|
|
3787
3791
|
"div",
|
|
3788
3792
|
{
|
|
3789
3793
|
...t,
|
|
@@ -3797,22 +3801,22 @@ function co({
|
|
|
3797
3801
|
className: e,
|
|
3798
3802
|
...t
|
|
3799
3803
|
}) {
|
|
3800
|
-
return /* @__PURE__ */
|
|
3804
|
+
return /* @__PURE__ */ g(
|
|
3801
3805
|
ae.Viewport,
|
|
3802
3806
|
{
|
|
3803
3807
|
className: E("richtext-outline-hidden richtext-relative richtext-flex-1", e),
|
|
3804
3808
|
"data-slot": "emoji-picker-viewport",
|
|
3805
3809
|
...t,
|
|
3806
3810
|
children: [
|
|
3807
|
-
/* @__PURE__ */
|
|
3811
|
+
/* @__PURE__ */ r(
|
|
3808
3812
|
ae.Loading,
|
|
3809
3813
|
{
|
|
3810
3814
|
className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground",
|
|
3811
3815
|
"data-slot": "emoji-picker-loading",
|
|
3812
|
-
children: /* @__PURE__ */
|
|
3816
|
+
children: /* @__PURE__ */ r(Zn, { className: "richtext-size-4 richtext-animate-spin" })
|
|
3813
3817
|
}
|
|
3814
3818
|
),
|
|
3815
|
-
/* @__PURE__ */
|
|
3819
|
+
/* @__PURE__ */ r(
|
|
3816
3820
|
ae.Empty,
|
|
3817
3821
|
{
|
|
3818
3822
|
className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground richtext-text-sm",
|
|
@@ -3820,7 +3824,7 @@ function co({
|
|
|
3820
3824
|
children: "No emoji found."
|
|
3821
3825
|
}
|
|
3822
3826
|
),
|
|
3823
|
-
/* @__PURE__ */
|
|
3827
|
+
/* @__PURE__ */ r(
|
|
3824
3828
|
ae.List,
|
|
3825
3829
|
{
|
|
3826
3830
|
className: "richtext-select-none richtext-pb-1",
|
|
@@ -3840,7 +3844,7 @@ function lo({
|
|
|
3840
3844
|
className: e,
|
|
3841
3845
|
...t
|
|
3842
3846
|
}) {
|
|
3843
|
-
return /* @__PURE__ */
|
|
3847
|
+
return /* @__PURE__ */ r(
|
|
3844
3848
|
"div",
|
|
3845
3849
|
{
|
|
3846
3850
|
className: E(
|
|
@@ -3849,24 +3853,24 @@ function lo({
|
|
|
3849
3853
|
),
|
|
3850
3854
|
"data-slot": "emoji-picker-footer",
|
|
3851
3855
|
...t,
|
|
3852
|
-
children: /* @__PURE__ */
|
|
3853
|
-
/* @__PURE__ */
|
|
3854
|
-
/* @__PURE__ */
|
|
3855
|
-
] }) : /* @__PURE__ */
|
|
3856
|
+
children: /* @__PURE__ */ r(ae.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ g(oe, { children: [
|
|
3857
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-size-7 richtext-flex-none richtext-items-center richtext-justify-center richtext-text-lg", children: n.emoji }),
|
|
3858
|
+
/* @__PURE__ */ r("span", { className: "richtext-text-secondary-foreground richtext-truncate richtext-text-xs", children: n.label })
|
|
3859
|
+
] }) : /* @__PURE__ */ r("span", { className: "richtext-text-muted-foreground richtext-ml-1.5 richtext-flex richtext-h-7 richtext-items-center richtext-truncate richtext-text-xs", children: "Select an emoji…" }) })
|
|
3856
3860
|
}
|
|
3857
3861
|
);
|
|
3858
3862
|
}
|
|
3859
3863
|
function uo({ onSelectEmoji: e, children: t }) {
|
|
3860
|
-
return /* @__PURE__ */
|
|
3861
|
-
/* @__PURE__ */
|
|
3862
|
-
/* @__PURE__ */
|
|
3864
|
+
return /* @__PURE__ */ g(xe, { modal: !0, children: [
|
|
3865
|
+
/* @__PURE__ */ r(pe, { asChild: !0, children: t }),
|
|
3866
|
+
/* @__PURE__ */ r(
|
|
3863
3867
|
we,
|
|
3864
3868
|
{
|
|
3865
3869
|
align: "start",
|
|
3866
3870
|
className: "richtext-size-full richtext-p-2",
|
|
3867
3871
|
hideWhenDetached: !0,
|
|
3868
3872
|
side: "bottom",
|
|
3869
|
-
children: /* @__PURE__ */
|
|
3873
|
+
children: /* @__PURE__ */ g(
|
|
3870
3874
|
io,
|
|
3871
3875
|
{
|
|
3872
3876
|
className: "!richtext-h-[342px]",
|
|
@@ -3874,9 +3878,9 @@ function uo({ onSelectEmoji: e, children: t }) {
|
|
|
3874
3878
|
e(n);
|
|
3875
3879
|
},
|
|
3876
3880
|
children: [
|
|
3877
|
-
/* @__PURE__ */
|
|
3878
|
-
/* @__PURE__ */
|
|
3879
|
-
/* @__PURE__ */
|
|
3881
|
+
/* @__PURE__ */ r(ao, {}),
|
|
3882
|
+
/* @__PURE__ */ r(co, {}),
|
|
3883
|
+
/* @__PURE__ */ r(lo, {})
|
|
3880
3884
|
]
|
|
3881
3885
|
}
|
|
3882
3886
|
)
|
|
@@ -3887,12 +3891,12 @@ function uo({ onSelectEmoji: e, children: t }) {
|
|
|
3887
3891
|
function ho({ editor: e, icon: t, ...n }) {
|
|
3888
3892
|
const i = j(
|
|
3889
3893
|
(a) => {
|
|
3890
|
-
const { selection:
|
|
3894
|
+
const { selection: o } = e.state, { $anchor: s } = o;
|
|
3891
3895
|
return e.chain().insertContentAt(s.pos, a).run();
|
|
3892
3896
|
},
|
|
3893
3897
|
[e]
|
|
3894
3898
|
);
|
|
3895
|
-
return /* @__PURE__ */
|
|
3899
|
+
return /* @__PURE__ */ r(uo, { onSelectEmoji: i, children: /* @__PURE__ */ r(
|
|
3896
3900
|
y,
|
|
3897
3901
|
{
|
|
3898
3902
|
icon: t,
|
|
@@ -3901,9 +3905,9 @@ function ho({ editor: e, icon: t, ...n }) {
|
|
|
3901
3905
|
) });
|
|
3902
3906
|
}
|
|
3903
3907
|
const Qt = Qe((e, t) => {
|
|
3904
|
-
const n = X(null), [i, a] = k(0), { t:
|
|
3905
|
-
const
|
|
3906
|
-
|
|
3908
|
+
const n = X(null), [i, a] = k(0), { t: o } = B(), s = (d) => {
|
|
3909
|
+
const f = e.items[d];
|
|
3910
|
+
f && e.command(f);
|
|
3907
3911
|
}, c = () => {
|
|
3908
3912
|
a((i + e.items.length - 1) % e.items.length);
|
|
3909
3913
|
}, l = () => {
|
|
@@ -3918,13 +3922,13 @@ const Qt = Qe((e, t) => {
|
|
|
3918
3922
|
d && ht(d, { behavior: "smooth", scrollMode: "if-needed" });
|
|
3919
3923
|
}, [i]), et(t, () => ({
|
|
3920
3924
|
onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (c(), !0) : d.key === "ArrowDown" ? (l(), !0) : d.key === "Enter" ? (u(), !0) : !1
|
|
3921
|
-
})), /* @__PURE__ */
|
|
3925
|
+
})), /* @__PURE__ */ r("div", { className: "richtext-max-h-[320px] richtext-w-[200px] richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ r("div", { ref: n, children: e.items.length > 0 ? e.items.map((d, f) => /* @__PURE__ */ g(
|
|
3922
3926
|
"span",
|
|
3923
3927
|
{
|
|
3924
|
-
className: U(" richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors hover:richtext-bg-accent focus:richtext-bg-accent focus:richtext-text-accent-foreground",
|
|
3925
|
-
onClick: () => s(
|
|
3928
|
+
className: U(" richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors hover:richtext-bg-accent focus:richtext-bg-accent focus:richtext-text-accent-foreground", f === i ? "bg-accent" : ""),
|
|
3929
|
+
onClick: () => s(f),
|
|
3926
3930
|
children: [
|
|
3927
|
-
d.fallbackImage ? /* @__PURE__ */
|
|
3931
|
+
d.fallbackImage ? /* @__PURE__ */ r(
|
|
3928
3932
|
"img",
|
|
3929
3933
|
{
|
|
3930
3934
|
className: "richtext-size-[1em]",
|
|
@@ -3936,8 +3940,8 @@ const Qt = Qe((e, t) => {
|
|
|
3936
3940
|
":"
|
|
3937
3941
|
]
|
|
3938
3942
|
},
|
|
3939
|
-
`emoji-list-code-${
|
|
3940
|
-
)) : /* @__PURE__ */
|
|
3943
|
+
`emoji-list-code-${f}`
|
|
3944
|
+
)) : /* @__PURE__ */ r("div", { className: "richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors", children: /* @__PURE__ */ r("span", { children: o("no_result_found") }) }) }) });
|
|
3941
3945
|
});
|
|
3942
3946
|
Qt.displayName = "EmojiList";
|
|
3943
3947
|
const _e = {
|
|
@@ -5901,8 +5905,8 @@ function bo(e) {
|
|
|
5901
5905
|
}
|
|
5902
5906
|
n.close();
|
|
5903
5907
|
}, 10);
|
|
5904
|
-
} catch (
|
|
5905
|
-
console.error(
|
|
5908
|
+
} catch (o) {
|
|
5909
|
+
console.error(o);
|
|
5906
5910
|
}
|
|
5907
5911
|
setTimeout(() => {
|
|
5908
5912
|
document.body.removeChild(t);
|
|
@@ -5936,8 +5940,8 @@ const jr = H.create({
|
|
|
5936
5940
|
});
|
|
5937
5941
|
function po(e, t) {
|
|
5938
5942
|
const n = atob(e.split(",")[1]), i = Array.from({ length: n.length });
|
|
5939
|
-
for (let
|
|
5940
|
-
i[
|
|
5943
|
+
for (let o = 0; o < n.length; o++)
|
|
5944
|
+
i[o] = n.charCodeAt(o);
|
|
5941
5945
|
const a = new Uint8Array(i);
|
|
5942
5946
|
return new Blob([a], { type: t });
|
|
5943
5947
|
}
|
|
@@ -5945,74 +5949,74 @@ function wo(e, t) {
|
|
|
5945
5949
|
return new File([e], t, { type: e.type });
|
|
5946
5950
|
}
|
|
5947
5951
|
function yo(e) {
|
|
5948
|
-
const { toast: t } = xi(), { t: n } = B(), [i, a] = k(!1),
|
|
5952
|
+
const { toast: t } = xi(), { t: n } = B(), [i, a] = k(!1), o = X(null);
|
|
5949
5953
|
function s() {
|
|
5950
|
-
var
|
|
5951
|
-
(
|
|
5954
|
+
var f;
|
|
5955
|
+
(f = o.current) == null || f.click();
|
|
5952
5956
|
}
|
|
5953
|
-
function c(
|
|
5954
|
-
const
|
|
5955
|
-
if (
|
|
5956
|
-
if (
|
|
5957
|
+
function c(f) {
|
|
5958
|
+
const m = f.target.files[0];
|
|
5959
|
+
if (m) {
|
|
5960
|
+
if (m.size > e.limit) {
|
|
5957
5961
|
t({
|
|
5958
5962
|
variant: "destructive",
|
|
5959
5963
|
title: n("editor.importWord.limitSize")
|
|
5960
5964
|
});
|
|
5961
5965
|
return;
|
|
5962
5966
|
}
|
|
5963
|
-
u(
|
|
5967
|
+
u(m);
|
|
5964
5968
|
}
|
|
5965
5969
|
}
|
|
5966
|
-
async function l(
|
|
5970
|
+
async function l(f) {
|
|
5967
5971
|
var N;
|
|
5968
|
-
const
|
|
5972
|
+
const h = new DOMParser().parseFromString(f, "text/html"), b = h.querySelectorAll("img");
|
|
5969
5973
|
if (b.length === 0)
|
|
5970
|
-
return
|
|
5974
|
+
return h.body.innerHTML;
|
|
5971
5975
|
if (pi(e.editor, "image")) {
|
|
5972
|
-
const
|
|
5973
|
-
(
|
|
5976
|
+
const S = (N = e.editor.extensionManager.extensions.find(
|
|
5977
|
+
(p) => p.name === "importWord"
|
|
5974
5978
|
)) == null ? void 0 : N.options;
|
|
5975
|
-
if (
|
|
5976
|
-
const
|
|
5977
|
-
for (const
|
|
5978
|
-
const C =
|
|
5979
|
-
|
|
5979
|
+
if (S && typeof S.upload == "function") {
|
|
5980
|
+
const p = [];
|
|
5981
|
+
for (const w of b) {
|
|
5982
|
+
const C = w.getAttribute("src"), T = po(C, "image/jpeg"), L = wo(T, "image.jpeg");
|
|
5983
|
+
p.push(L);
|
|
5980
5984
|
}
|
|
5981
|
-
const _ = await
|
|
5982
|
-
for (const [
|
|
5983
|
-
C.setAttribute("src", _[
|
|
5985
|
+
const _ = await S.upload(p);
|
|
5986
|
+
for (const [w, C] of b.entries()) {
|
|
5987
|
+
C.setAttribute("src", _[w].src);
|
|
5984
5988
|
const T = C.parentElement;
|
|
5985
5989
|
(T == null ? void 0 : T.tagName) === "P" && (T.insertAdjacentElement("beforebegin", C), !T.hasChildNodes() && T.textContent === "" && T.remove());
|
|
5986
5990
|
}
|
|
5987
|
-
return
|
|
5991
|
+
return h.body.innerHTML;
|
|
5988
5992
|
} else
|
|
5989
|
-
return console.warn("Image Upload method found, skip image conversion"),
|
|
5993
|
+
return console.warn("Image Upload method found, skip image conversion"), h.body.innerHTML;
|
|
5990
5994
|
} else
|
|
5991
|
-
return console.error("Image extension not found, unable to convert image"),
|
|
5995
|
+
return console.error("Image extension not found, unable to convert image"), h.body.innerHTML;
|
|
5992
5996
|
}
|
|
5993
|
-
async function u(
|
|
5997
|
+
async function u(f) {
|
|
5994
5998
|
a(!0);
|
|
5995
5999
|
try {
|
|
5996
6000
|
if (e.convert) {
|
|
5997
|
-
const
|
|
5998
|
-
d(
|
|
6001
|
+
const m = await e.convert(f);
|
|
6002
|
+
d(m);
|
|
5999
6003
|
} else {
|
|
6000
|
-
const
|
|
6001
|
-
{ arrayBuffer:
|
|
6004
|
+
const m = await f.arrayBuffer(), { value: h } = await Kn.convertToHtml(
|
|
6005
|
+
{ arrayBuffer: m },
|
|
6002
6006
|
e == null ? void 0 : e.mammothOptions
|
|
6003
6007
|
);
|
|
6004
|
-
d(
|
|
6008
|
+
d(h);
|
|
6005
6009
|
}
|
|
6006
6010
|
} finally {
|
|
6007
6011
|
a(!1);
|
|
6008
6012
|
}
|
|
6009
6013
|
}
|
|
6010
|
-
async function d(
|
|
6011
|
-
const
|
|
6012
|
-
e.editor.chain().setContent(
|
|
6014
|
+
async function d(f) {
|
|
6015
|
+
const m = await l(f);
|
|
6016
|
+
e.editor.chain().setContent(m, !0).run();
|
|
6013
6017
|
}
|
|
6014
|
-
return /* @__PURE__ */
|
|
6015
|
-
/* @__PURE__ */
|
|
6018
|
+
return /* @__PURE__ */ g("div", { children: [
|
|
6019
|
+
/* @__PURE__ */ r(
|
|
6016
6020
|
y,
|
|
6017
6021
|
{
|
|
6018
6022
|
action: s,
|
|
@@ -6022,12 +6026,12 @@ function yo(e) {
|
|
|
6022
6026
|
tooltip: e == null ? void 0 : e.tooltip
|
|
6023
6027
|
}
|
|
6024
6028
|
),
|
|
6025
|
-
/* @__PURE__ */
|
|
6029
|
+
/* @__PURE__ */ r(
|
|
6026
6030
|
"input",
|
|
6027
6031
|
{
|
|
6028
6032
|
accept: ".docx",
|
|
6029
6033
|
onChange: c,
|
|
6030
|
-
ref:
|
|
6034
|
+
ref: o,
|
|
6031
6035
|
type: "file",
|
|
6032
6036
|
style: {
|
|
6033
6037
|
display: "none"
|
|
@@ -6047,13 +6051,13 @@ const Br = H.create({
|
|
|
6047
6051
|
limit: 1024 * 1024 * 10,
|
|
6048
6052
|
// 10 MB
|
|
6049
6053
|
button: ({ editor: t, extension: n, t: i }) => {
|
|
6050
|
-
const { convert: a, limit:
|
|
6054
|
+
const { convert: a, limit: o, mammothOptions: s } = n.options;
|
|
6051
6055
|
return {
|
|
6052
6056
|
component: yo,
|
|
6053
6057
|
componentProps: {
|
|
6054
6058
|
editor: t,
|
|
6055
6059
|
convert: a,
|
|
6056
|
-
limit:
|
|
6060
|
+
limit: o,
|
|
6057
6061
|
mammothOptions: s,
|
|
6058
6062
|
action: () => t.commands.setHorizontalRule(),
|
|
6059
6063
|
disabled: !t.can().setHorizontalRule(),
|
|
@@ -6121,8 +6125,8 @@ const Co = {
|
|
|
6121
6125
|
exportToWord: () => async ({ editor: e }) => {
|
|
6122
6126
|
const t = {
|
|
6123
6127
|
getImageBuffer: async (i) => {
|
|
6124
|
-
const
|
|
6125
|
-
return new Uint8Array(
|
|
6128
|
+
const o = await (await fetch(i)).arrayBuffer();
|
|
6129
|
+
return new Uint8Array(o);
|
|
6126
6130
|
}
|
|
6127
6131
|
}, n = No.serialize(e.state.doc, t);
|
|
6128
6132
|
return zi.toBlob(n).then((i) => ko(new Blob([i]), "export-document.docx")), !0;
|
|
@@ -6138,14 +6142,14 @@ const Co = {
|
|
|
6138
6142
|
function Mo(e) {
|
|
6139
6143
|
const t = [], n = [t];
|
|
6140
6144
|
return e.forEach((i) => {
|
|
6141
|
-
let a = -1,
|
|
6142
|
-
for (; !
|
|
6143
|
-
a -= 1,
|
|
6144
|
-
|
|
6145
|
+
let a = -1, o = n[i.level + a];
|
|
6146
|
+
for (; !o; )
|
|
6147
|
+
a -= 1, o = n[i.level + a];
|
|
6148
|
+
o.push({ ...i, children: n[i.level] = [] });
|
|
6145
6149
|
}), t;
|
|
6146
6150
|
}
|
|
6147
6151
|
function Io({ editor: e }) {
|
|
6148
|
-
const t = at(), [n, i] = k([]), { t: a } = B(),
|
|
6152
|
+
const t = at(), [n, i] = k([]), { t: a } = B(), o = j(() => {
|
|
6149
6153
|
const s = [], c = e.state.tr;
|
|
6150
6154
|
e.state.doc.descendants((l, u) => {
|
|
6151
6155
|
if (l.type.name === "heading") {
|
|
@@ -6164,23 +6168,23 @@ function Io({ editor: e }) {
|
|
|
6164
6168
|
return P(() => {
|
|
6165
6169
|
if (e) {
|
|
6166
6170
|
if (!e.options.editable) {
|
|
6167
|
-
|
|
6171
|
+
o();
|
|
6168
6172
|
return;
|
|
6169
6173
|
}
|
|
6170
|
-
return e.on("update",
|
|
6171
|
-
e.off("update",
|
|
6174
|
+
return e.on("update", o), () => {
|
|
6175
|
+
e.off("update", o);
|
|
6172
6176
|
};
|
|
6173
6177
|
}
|
|
6174
|
-
}, [e,
|
|
6175
|
-
|
|
6176
|
-
}, []), /* @__PURE__ */
|
|
6177
|
-
/* @__PURE__ */
|
|
6178
|
-
/* @__PURE__ */
|
|
6178
|
+
}, [e, o]), P(() => {
|
|
6179
|
+
o();
|
|
6180
|
+
}, []), /* @__PURE__ */ r(he, { className: U("tableOfContent", ze.toc, t && ze.visible), children: t ? /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
|
|
6181
|
+
/* @__PURE__ */ r("p", { className: "text-[20px] richtext-mb-[8px] richtext-font-semibold", children: a("editor.table_of_content") }),
|
|
6182
|
+
/* @__PURE__ */ r("ul", { className: ze.list, children: n.map((s, c) => /* @__PURE__ */ r(
|
|
6179
6183
|
"li",
|
|
6180
6184
|
{
|
|
6181
6185
|
className: ze.item,
|
|
6182
6186
|
style: { paddingLeft: `${s.level - 1}rem` },
|
|
6183
|
-
children: /* @__PURE__ */
|
|
6187
|
+
children: /* @__PURE__ */ r("a", { href: `#${s.id}`, children: s.text })
|
|
6184
6188
|
},
|
|
6185
6189
|
`table-of-content-${c}`
|
|
6186
6190
|
)) })
|
|
@@ -6205,7 +6209,7 @@ function Ho({ editor: e, icon: t, tooltip: n }) {
|
|
|
6205
6209
|
}
|
|
6206
6210
|
e.chain().focus().setTableOfContents().run();
|
|
6207
6211
|
}, [e, i]);
|
|
6208
|
-
return /* @__PURE__ */
|
|
6212
|
+
return /* @__PURE__ */ r(
|
|
6209
6213
|
y,
|
|
6210
6214
|
{
|
|
6211
6215
|
action: a,
|
|
@@ -6221,8 +6225,8 @@ function zo(e) {
|
|
|
6221
6225
|
function Ro(e, t) {
|
|
6222
6226
|
const i = [e.getJSON()], a = [];
|
|
6223
6227
|
for (; i.length > 0; ) {
|
|
6224
|
-
const
|
|
6225
|
-
|
|
6228
|
+
const o = i.shift();
|
|
6229
|
+
o.type === t && a.push(o), o.content && o.content.length > 0 && i.push(...o.content);
|
|
6226
6230
|
}
|
|
6227
6231
|
return a;
|
|
6228
6232
|
}
|
|
@@ -6273,8 +6277,8 @@ const Po = Ae.create({
|
|
|
6273
6277
|
}
|
|
6274
6278
|
const a = n.props.state.doc.content.firstChild;
|
|
6275
6279
|
if (zo(a)) {
|
|
6276
|
-
const
|
|
6277
|
-
return e.insertContentAt(
|
|
6280
|
+
const o = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
|
|
6281
|
+
return e.insertContentAt(o, { type: this.name });
|
|
6278
6282
|
}
|
|
6279
6283
|
return e.insertContent({
|
|
6280
6284
|
type: this.name
|
|
@@ -6282,9 +6286,9 @@ const Po = Ae.create({
|
|
|
6282
6286
|
},
|
|
6283
6287
|
removeTableOfContents: () => ({ state: e, dispatch: t }) => {
|
|
6284
6288
|
const { tr: n } = e, i = e.schema.nodes.tableOfContents;
|
|
6285
|
-
return e.doc.descendants((a,
|
|
6289
|
+
return e.doc.descendants((a, o) => {
|
|
6286
6290
|
if (a.type === i) {
|
|
6287
|
-
const s =
|
|
6291
|
+
const s = o, c = o + a.nodeSize;
|
|
6288
6292
|
n.delete(s, c);
|
|
6289
6293
|
}
|
|
6290
6294
|
}), n.docChanged ? (t(n), !0) : !1;
|
|
@@ -6307,8 +6311,8 @@ const Po = Ae.create({
|
|
|
6307
6311
|
function Do(e) {
|
|
6308
6312
|
var n;
|
|
6309
6313
|
const t = R(() => {
|
|
6310
|
-
var
|
|
6311
|
-
const i = (
|
|
6314
|
+
var o;
|
|
6315
|
+
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
6312
6316
|
return i && !i.default ? {
|
|
6313
6317
|
...i,
|
|
6314
6318
|
icon: i.icon ? i.icon : e.icon
|
|
@@ -6318,20 +6322,20 @@ function Do(e) {
|
|
|
6318
6322
|
isActive: () => !1
|
|
6319
6323
|
};
|
|
6320
6324
|
}, [e]);
|
|
6321
|
-
return /* @__PURE__ */
|
|
6322
|
-
/* @__PURE__ */
|
|
6325
|
+
return /* @__PURE__ */ g(xe, { modal: !0, children: [
|
|
6326
|
+
/* @__PURE__ */ r(
|
|
6323
6327
|
pe,
|
|
6324
6328
|
{
|
|
6325
6329
|
asChild: !0,
|
|
6326
6330
|
disabled: e == null ? void 0 : e.disabled,
|
|
6327
|
-
children: /* @__PURE__ */
|
|
6331
|
+
children: /* @__PURE__ */ r(
|
|
6328
6332
|
y,
|
|
6329
6333
|
{
|
|
6330
6334
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
6331
6335
|
disabled: e == null ? void 0 : e.disabled,
|
|
6332
6336
|
icon: e == null ? void 0 : e.icon,
|
|
6333
6337
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
6334
|
-
children: /* @__PURE__ */
|
|
6338
|
+
children: /* @__PURE__ */ r(
|
|
6335
6339
|
D,
|
|
6336
6340
|
{
|
|
6337
6341
|
className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
|
|
@@ -6342,16 +6346,16 @@ function Do(e) {
|
|
|
6342
6346
|
)
|
|
6343
6347
|
}
|
|
6344
6348
|
),
|
|
6345
|
-
/* @__PURE__ */
|
|
6349
|
+
/* @__PURE__ */ r(
|
|
6346
6350
|
we,
|
|
6347
6351
|
{
|
|
6348
6352
|
align: "start",
|
|
6349
6353
|
className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
|
|
6350
6354
|
side: "bottom",
|
|
6351
6355
|
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
|
|
6352
|
-
var
|
|
6353
|
-
return /* @__PURE__ */
|
|
6354
|
-
/* @__PURE__ */
|
|
6356
|
+
var o, s;
|
|
6357
|
+
return /* @__PURE__ */ g(Be, { children: [
|
|
6358
|
+
/* @__PURE__ */ r($e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
6355
6359
|
rt,
|
|
6356
6360
|
{
|
|
6357
6361
|
className: "richtext-size-7 richtext-p-1",
|
|
@@ -6359,12 +6363,12 @@ function Do(e) {
|
|
|
6359
6363
|
onClick: i == null ? void 0 : i.action,
|
|
6360
6364
|
pressed: t.title === i.title,
|
|
6361
6365
|
size: "sm",
|
|
6362
|
-
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */
|
|
6366
|
+
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(D, { name: i.icon })
|
|
6363
6367
|
}
|
|
6364
6368
|
) }),
|
|
6365
|
-
/* @__PURE__ */
|
|
6366
|
-
/* @__PURE__ */
|
|
6367
|
-
!!((
|
|
6369
|
+
/* @__PURE__ */ g(Fe, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
6370
|
+
/* @__PURE__ */ r("span", { children: i.title }),
|
|
6371
|
+
!!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
|
|
6368
6372
|
] })
|
|
6369
6373
|
] }, `text-align-${a}`);
|
|
6370
6374
|
})
|
|
@@ -6387,21 +6391,21 @@ const Fr = H.create({
|
|
|
6387
6391
|
t: i
|
|
6388
6392
|
}) {
|
|
6389
6393
|
var l;
|
|
6390
|
-
const a = ((l = n.options) == null ? void 0 : l.directions) || [],
|
|
6394
|
+
const a = ((l = n.options) == null ? void 0 : l.directions) || [], o = {
|
|
6391
6395
|
auto: "TextDirection",
|
|
6392
6396
|
ltr: "LeftToRight",
|
|
6393
6397
|
rtl: "RightToLeft"
|
|
6394
6398
|
}, s = a.map((u) => ({
|
|
6395
6399
|
title: i(`editor.textDirection.${u}.tooltip`),
|
|
6396
|
-
icon:
|
|
6400
|
+
icon: o[u],
|
|
6397
6401
|
isActive: () => !1,
|
|
6398
6402
|
action: () => {
|
|
6399
|
-
var d,
|
|
6403
|
+
var d, f, m, h;
|
|
6400
6404
|
if (u === "auto") {
|
|
6401
|
-
(
|
|
6405
|
+
(f = (d = t.commands) == null ? void 0 : d.unsetTextDirection) == null || f.call(d);
|
|
6402
6406
|
return;
|
|
6403
6407
|
}
|
|
6404
|
-
(
|
|
6408
|
+
(h = (m = t.commands) == null ? void 0 : m.setTextDirection) == null || h.call(m, u);
|
|
6405
6409
|
},
|
|
6406
6410
|
disabled: !1
|
|
6407
6411
|
})), c = s.filter((u) => u.disabled).length === s.length;
|
|
@@ -6443,7 +6447,7 @@ const Fr = H.create({
|
|
|
6443
6447
|
itemUser: jo,
|
|
6444
6448
|
selectedUser: Bo
|
|
6445
6449
|
}, $o = Qe((e, t) => {
|
|
6446
|
-
const n = X(null), [i, a] = k(0),
|
|
6450
|
+
const n = X(null), [i, a] = k(0), o = (u) => {
|
|
6447
6451
|
const d = e.items[u];
|
|
6448
6452
|
d && e.command({ id: d, label: d });
|
|
6449
6453
|
}, s = () => {
|
|
@@ -6451,7 +6455,7 @@ const Fr = H.create({
|
|
|
6451
6455
|
}, c = () => {
|
|
6452
6456
|
a((i + 1) % e.items.length);
|
|
6453
6457
|
}, l = () => {
|
|
6454
|
-
|
|
6458
|
+
o(i);
|
|
6455
6459
|
};
|
|
6456
6460
|
return P(() => a(0), [e.items]), P(() => {
|
|
6457
6461
|
if (Number.isNaN(i + 1))
|
|
@@ -6460,15 +6464,15 @@ const Fr = H.create({
|
|
|
6460
6464
|
u && ht(u, { behavior: "smooth", scrollMode: "if-needed" });
|
|
6461
6465
|
}, [i]), et(t, () => ({
|
|
6462
6466
|
onKeyDown: ({ event: u }) => u.key === "ArrowUp" ? (s(), !0) : u.key === "ArrowDown" ? (c(), !0) : u.key === "Enter" ? (l(), !0) : !1
|
|
6463
|
-
})), /* @__PURE__ */
|
|
6467
|
+
})), /* @__PURE__ */ r("div", { className: U("listUsers", Re.listUsers), children: /* @__PURE__ */ r("div", { ref: n, children: e.items.length > 0 ? e.items.map((u, d) => /* @__PURE__ */ r(
|
|
6464
6468
|
"span",
|
|
6465
6469
|
{
|
|
6466
6470
|
className: U("itemUser", Re.itemUser, d === i ? Re.selectedUser : ""),
|
|
6467
|
-
onClick: () =>
|
|
6471
|
+
onClick: () => o(d),
|
|
6468
6472
|
children: u
|
|
6469
6473
|
},
|
|
6470
6474
|
d
|
|
6471
|
-
)) : /* @__PURE__ */
|
|
6475
|
+
)) : /* @__PURE__ */ r("div", { className: U("itemUserEmpty", Re.itemUser), children: "Empty" }) }) });
|
|
6472
6476
|
}), Fo = [
|
|
6473
6477
|
{
|
|
6474
6478
|
id: "1",
|
|
@@ -6566,7 +6570,7 @@ const Fr = H.create({
|
|
|
6566
6570
|
ppt: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'
|
|
6567
6571
|
};
|
|
6568
6572
|
function qo(e) {
|
|
6569
|
-
const t = Vo[e], a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement,
|
|
6573
|
+
const t = Vo[e], a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
|
|
6570
6574
|
"svg",
|
|
6571
6575
|
{
|
|
6572
6576
|
...Array.from(a.attributes).reduce((s, c) => (s[c.name] = c.value, s), {})
|
|
@@ -6578,22 +6582,22 @@ function qo(e) {
|
|
|
6578
6582
|
s.tagName.toLowerCase(),
|
|
6579
6583
|
Array.from(s.attributes).reduce((l, u) => (l[u.name] = u.value, l), {})
|
|
6580
6584
|
];
|
|
6581
|
-
s.textContent && c.push(s.textContent),
|
|
6585
|
+
s.textContent && c.push(s.textContent), o.push(c);
|
|
6582
6586
|
}
|
|
6583
|
-
}),
|
|
6587
|
+
}), o;
|
|
6584
6588
|
}
|
|
6585
6589
|
const Ko = {
|
|
6586
|
-
audio: /* @__PURE__ */
|
|
6587
|
-
video: /* @__PURE__ */
|
|
6588
|
-
file: /* @__PURE__ */
|
|
6589
|
-
image: /* @__PURE__ */
|
|
6590
|
-
pdf: /* @__PURE__ */
|
|
6591
|
-
word: /* @__PURE__ */
|
|
6592
|
-
excel: /* @__PURE__ */
|
|
6593
|
-
ppt: /* @__PURE__ */
|
|
6590
|
+
audio: /* @__PURE__ */ r(ii, {}),
|
|
6591
|
+
video: /* @__PURE__ */ r(ni, {}),
|
|
6592
|
+
file: /* @__PURE__ */ r(ti, {}),
|
|
6593
|
+
image: /* @__PURE__ */ r(ei, {}),
|
|
6594
|
+
pdf: /* @__PURE__ */ r(vi, {}),
|
|
6595
|
+
word: /* @__PURE__ */ r(yi, {}),
|
|
6596
|
+
excel: /* @__PURE__ */ r(Qn, {}),
|
|
6597
|
+
ppt: /* @__PURE__ */ r(Jn, {})
|
|
6594
6598
|
};
|
|
6595
6599
|
function en(e, t = !1) {
|
|
6596
|
-
const n = wi(e), i = Ko[n] || /* @__PURE__ */
|
|
6600
|
+
const n = wi(e), i = Ko[n] || /* @__PURE__ */ r(oe, {});
|
|
6597
6601
|
return t ? qo(n) : i;
|
|
6598
6602
|
}
|
|
6599
6603
|
const Wo = "_wrap_1x1ms_2", Ke = {
|
|
@@ -6601,88 +6605,88 @@ const Wo = "_wrap_1x1ms_2", Ke = {
|
|
|
6601
6605
|
};
|
|
6602
6606
|
function Go({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension: a }) {
|
|
6603
6607
|
var C;
|
|
6604
|
-
const
|
|
6605
|
-
!s ||
|
|
6606
|
-
}, [s,
|
|
6608
|
+
const o = X(null), s = at(), { hasTrigger: c, fileName: l, fileSize: u, fileExt: d, fileType: f, url: m, error: h } = t.attrs, [b, x] = k(!1), { t: N } = B(), S = (C = a == null ? void 0 : a.options) == null ? void 0 : C.upload, p = j(() => {
|
|
6609
|
+
!s || m || s && o.current.click();
|
|
6610
|
+
}, [s, m]), _ = j(
|
|
6607
6611
|
async (T) => {
|
|
6608
|
-
const
|
|
6609
|
-
if (!
|
|
6612
|
+
const L = T.target.files && T.target.files[0];
|
|
6613
|
+
if (!L)
|
|
6610
6614
|
return;
|
|
6611
6615
|
const q = {
|
|
6612
|
-
fileName: Ci(
|
|
6613
|
-
fileSize:
|
|
6614
|
-
fileType:
|
|
6615
|
-
fileExt: ki(
|
|
6616
|
+
fileName: Ci(L.name),
|
|
6617
|
+
fileSize: L.size,
|
|
6618
|
+
fileType: L.type,
|
|
6619
|
+
fileExt: ki(L.name)
|
|
6616
6620
|
};
|
|
6617
6621
|
x(!0);
|
|
6618
6622
|
try {
|
|
6619
|
-
const v = await L
|
|
6623
|
+
const v = await S(L);
|
|
6620
6624
|
n({ ...q, url: v }), x(!1);
|
|
6621
6625
|
} catch (v) {
|
|
6622
|
-
n({ error: `File upload fail: ${v && v.message}` || "Unknown error" }), x(!1),
|
|
6626
|
+
n({ error: `File upload fail: ${v && v.message}` || "Unknown error" }), x(!1), o.current.value = "";
|
|
6623
6627
|
}
|
|
6624
6628
|
},
|
|
6625
6629
|
[x, n]
|
|
6626
6630
|
);
|
|
6627
6631
|
P(() => {
|
|
6628
|
-
!
|
|
6629
|
-
}, [
|
|
6630
|
-
const
|
|
6631
|
-
return s && !
|
|
6632
|
-
/* @__PURE__ */
|
|
6632
|
+
!m && !c && (p(), n({ hasTrigger: !0 }));
|
|
6633
|
+
}, [m, c, p, n]);
|
|
6634
|
+
const w = j(() => i(), [e]);
|
|
6635
|
+
return s && !m ? /* @__PURE__ */ r(he, { children: /* @__PURE__ */ g("div", { className: U(Ke.wrap, "render-wrapper"), children: [
|
|
6636
|
+
/* @__PURE__ */ r(
|
|
6633
6637
|
"p",
|
|
6634
6638
|
{
|
|
6635
|
-
onClick:
|
|
6639
|
+
onClick: p,
|
|
6636
6640
|
style: { cursor: "pointer" },
|
|
6637
|
-
children: b ? /* @__PURE__ */
|
|
6641
|
+
children: b ? /* @__PURE__ */ r("span", { children: N("editor.attachment.uploading") }) : /* @__PURE__ */ r("span", { children: N("editor.attachment.please_upload") })
|
|
6638
6642
|
}
|
|
6639
6643
|
),
|
|
6640
|
-
/* @__PURE__ */
|
|
6644
|
+
/* @__PURE__ */ r(
|
|
6641
6645
|
"input",
|
|
6642
6646
|
{
|
|
6643
6647
|
hidden: !0,
|
|
6644
6648
|
onChange: _,
|
|
6645
|
-
ref:
|
|
6649
|
+
ref: o,
|
|
6646
6650
|
type: "file"
|
|
6647
6651
|
}
|
|
6648
6652
|
)
|
|
6649
|
-
] }) }) :
|
|
6653
|
+
] }) }) : m ? /* @__PURE__ */ r(he, { children: /* @__PURE__ */ g(
|
|
6650
6654
|
"div",
|
|
6651
6655
|
{
|
|
6652
6656
|
className: U(Ke.wrap, "render-wrapper"),
|
|
6653
|
-
onClick:
|
|
6657
|
+
onClick: p,
|
|
6654
6658
|
children: [
|
|
6655
|
-
/* @__PURE__ */
|
|
6656
|
-
/* @__PURE__ */
|
|
6657
|
-
/* @__PURE__ */
|
|
6659
|
+
/* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
6660
|
+
/* @__PURE__ */ r("span", { children: en(f) }),
|
|
6661
|
+
/* @__PURE__ */ g("span", { children: [
|
|
6658
6662
|
l,
|
|
6659
6663
|
".",
|
|
6660
6664
|
d
|
|
6661
6665
|
] }),
|
|
6662
|
-
/* @__PURE__ */
|
|
6666
|
+
/* @__PURE__ */ g("span", { children: [
|
|
6663
6667
|
"(",
|
|
6664
6668
|
Ot(u),
|
|
6665
6669
|
")"
|
|
6666
6670
|
] })
|
|
6667
6671
|
] }),
|
|
6668
|
-
/* @__PURE__ */
|
|
6672
|
+
/* @__PURE__ */ r(
|
|
6669
6673
|
y,
|
|
6670
6674
|
{
|
|
6671
|
-
action:
|
|
6675
|
+
action: w,
|
|
6672
6676
|
icon: "Trash2",
|
|
6673
6677
|
tooltip: N("editor.delete")
|
|
6674
6678
|
}
|
|
6675
6679
|
)
|
|
6676
6680
|
]
|
|
6677
6681
|
}
|
|
6678
|
-
) }) :
|
|
6682
|
+
) }) : h !== "null" ? /* @__PURE__ */ r(he, { children: /* @__PURE__ */ r(
|
|
6679
6683
|
"div",
|
|
6680
6684
|
{
|
|
6681
6685
|
className: U(Ke.wrap, "render-wrapper"),
|
|
6682
|
-
onClick:
|
|
6683
|
-
children: /* @__PURE__ */
|
|
6686
|
+
onClick: p,
|
|
6687
|
+
children: /* @__PURE__ */ r("p", { children: h })
|
|
6684
6688
|
}
|
|
6685
|
-
) }) : /* @__PURE__ */
|
|
6689
|
+
) }) : /* @__PURE__ */ r(oe, {});
|
|
6686
6690
|
}
|
|
6687
6691
|
const Vr = Ae.create({
|
|
6688
6692
|
name: "attachment",
|
|
@@ -6720,7 +6724,7 @@ const Vr = Ae.create({
|
|
|
6720
6724
|
fileName: n = "",
|
|
6721
6725
|
fileSize: i = "",
|
|
6722
6726
|
fileType: a = "",
|
|
6723
|
-
fileExt:
|
|
6727
|
+
fileExt: o = ""
|
|
6724
6728
|
} = e || {};
|
|
6725
6729
|
return [
|
|
6726
6730
|
"div",
|
|
@@ -6740,7 +6744,7 @@ const Vr = Ae.create({
|
|
|
6740
6744
|
[
|
|
6741
6745
|
"span",
|
|
6742
6746
|
{ class: "attachment__text" },
|
|
6743
|
-
`${n}.${
|
|
6747
|
+
`${n}.${o} (${Ot(i)})`
|
|
6744
6748
|
]
|
|
6745
6749
|
] : ["div", { class: "attachment__placeholder" }]
|
|
6746
6750
|
];
|