reactjs-tiptap-editor 0.2.19 → 0.2.21
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/extension-bundle.cjs +3 -3
- package/lib/extension-bundle.d.cts +83 -56
- package/lib/extension-bundle.d.ts +83 -56
- package/lib/extension-bundle.js +667 -666
- package/lib/index.d.cts +55 -55
- package/lib/index.d.ts +55 -55
- package/lib/locale-bundle.d.cts +55 -55
- package/lib/locale-bundle.d.ts +55 -55
- package/lib/style.css +1 -1
- package/package.json +1 -2
package/lib/extension-bundle.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as yt, I as kt, U as vt, S as Ct, C as Nt, f as ce, N as le, b as At, c as Tt, R as He, F as Lt, H as St, T as Et, E as N, d as Ht, e as Mt, g as zt, h as
|
|
1
|
+
import { a as yt, I as kt, U as vt, S as Ct, C as Nt, f as ce, N as le, b as At, c as Tt, R as He, F as Lt, H as St, T as Et, E as N, d as Ht, e as Mt, g as zt, h as we, O as Rt, i as Pt, j as It, k as Bt, L as jt, l as Dt, m as pe, n as Ot, o as $t, D as Ft, P as Ut, p as qt, q as Kt, G as Vt, r as Wt, s as Gt, t as Zt, u as Jt, v as Qt, w as Yt, x as nt, y as it, z as at, A as Me, J as Xt, K as en, M as tn, Q as nn, V as an } from "./tiptap-BV9BUpUC.js";
|
|
2
2
|
import { P as te, b as Z, $ as de, a0 as he, al as R, am as on, T as ot, A as rn, a4 as sn, an as cn, ao as ln } from "./vendor-DyAqAGVt.js";
|
|
3
3
|
import { jsxs as m, jsx as r, Fragment as ye } from "react/jsx-runtime";
|
|
4
4
|
import * as J from "react";
|
|
5
5
|
import dn, { useMemo as P, useState as v, useRef as G, useCallback as F, Fragment as ze, forwardRef as Re, useImperativeHandle as Pe, useEffect as M } from "react";
|
|
6
|
-
import { ChevronDown as Ie, Check as hn, ChevronUp as un, Copy as mn, CopyCheck as fn, SearchIcon as _n, LoaderIcon as gn, LucideTableProperties as bn, LucideSheet as xn, LucideImage as
|
|
6
|
+
import { ChevronDown as Ie, Check as hn, ChevronUp as un, Copy as mn, CopyCheck as fn, SearchIcon as _n, LoaderIcon as gn, LucideTableProperties as bn, LucideSheet as xn, LucideImage as wn, LucideFile as pn, LucideVideo as yn, LucideAudioLines as kn } from "lucide-react";
|
|
7
7
|
import { i as Be, T as ke, a as ve, B as V, b as Ce, g as je, A as x, D as Q, c as Y, d as X, e as vn, f as S, u as De, h as Cn, I as z, j as ne, k as rt, l as Se, m as Nn, n as Oe, P as ie, o as ae, p as oe, q as $e, C as An, H as Tn, L as Ln, r as Sn, M as En, s as Hn, t as Ke, v as me, w as K, E as D, x as Mn, y as zn, V as Rn, z as Ve, F as Ne, G as We, S as Pn, J as In, K as Bn, N as j, O as jn, Q as Dn, U as On, W as $n, X as Fn, Y as st } from "./RichTextEditor-aaUynZc2.js";
|
|
8
8
|
import { a3 as Vo, $ as Wo, Z as Go, a0 as Zo, _ as Jo, a1 as Qo, a2 as Yo } from "./RichTextEditor-aaUynZc2.js";
|
|
9
9
|
import { M as Un, D as ct, u as B, f as qn, g as Kn, h as Ge, i as A, j as lt, k as Vn, T as fe, m as _e, n as ge } from "./index-8id9bPv5.js";
|
|
@@ -16,21 +16,21 @@ import { EmojiPicker as W } from "frimousse";
|
|
|
16
16
|
import { Packer as Zn, WidthType as Jn } from "docx";
|
|
17
17
|
import { DocxSerializer as Qn, defaultNodes as U, defaultMarks as Yn } from "prosemirror-docx";
|
|
18
18
|
const qe = dn.forwardRef(
|
|
19
|
-
({ asChild: e, ...t },
|
|
19
|
+
({ asChild: e, ...t }, n) => {
|
|
20
20
|
var o;
|
|
21
|
-
const
|
|
21
|
+
const i = Be[t.icon];
|
|
22
22
|
return /* @__PURE__ */ m(ke, { children: [
|
|
23
23
|
/* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ r(
|
|
24
24
|
e ? Gn : V,
|
|
25
25
|
{
|
|
26
26
|
className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
|
|
27
27
|
disabled: t == null ? void 0 : t.disabled,
|
|
28
|
-
ref:
|
|
28
|
+
ref: n,
|
|
29
29
|
variant: "ghost",
|
|
30
30
|
...t,
|
|
31
31
|
children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-h-full richtext-items-center richtext-font-normal", children: [
|
|
32
32
|
(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 }),
|
|
33
|
-
|
|
33
|
+
i && /* @__PURE__ */ r(i, { className: "richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500" })
|
|
34
34
|
] })
|
|
35
35
|
}
|
|
36
36
|
) }),
|
|
@@ -45,7 +45,7 @@ const qe = dn.forwardRef(
|
|
|
45
45
|
var e;
|
|
46
46
|
return {
|
|
47
47
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
48
|
-
button: ({ editor: t, t:
|
|
48
|
+
button: ({ editor: t, t: n }) => ({
|
|
49
49
|
component: x,
|
|
50
50
|
componentProps: {
|
|
51
51
|
action: () => t.commands.toggleBold(),
|
|
@@ -53,7 +53,7 @@ const qe = dn.forwardRef(
|
|
|
53
53
|
disabled: !t.can().toggleBold(),
|
|
54
54
|
icon: "Bold",
|
|
55
55
|
shortcutKeys: ["mod", "B"],
|
|
56
|
-
tooltip:
|
|
56
|
+
tooltip: n("editor.bold.tooltip")
|
|
57
57
|
}
|
|
58
58
|
})
|
|
59
59
|
};
|
|
@@ -63,7 +63,7 @@ const qe = dn.forwardRef(
|
|
|
63
63
|
var e;
|
|
64
64
|
return {
|
|
65
65
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
66
|
-
button({ editor: t, t:
|
|
66
|
+
button({ editor: t, t: n }) {
|
|
67
67
|
return {
|
|
68
68
|
component: x,
|
|
69
69
|
componentProps: {
|
|
@@ -72,7 +72,7 @@ const qe = dn.forwardRef(
|
|
|
72
72
|
disabled: !t.can().toggleItalic(),
|
|
73
73
|
shortcutKeys: ["mod", "I"],
|
|
74
74
|
icon: "Italic",
|
|
75
|
-
tooltip:
|
|
75
|
+
tooltip: n("editor.italic.tooltip")
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
@@ -83,7 +83,7 @@ const qe = dn.forwardRef(
|
|
|
83
83
|
var e;
|
|
84
84
|
return {
|
|
85
85
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
86
|
-
button({ editor: t, t:
|
|
86
|
+
button({ editor: t, t: n }) {
|
|
87
87
|
return {
|
|
88
88
|
component: x,
|
|
89
89
|
componentProps: {
|
|
@@ -92,7 +92,7 @@ const qe = dn.forwardRef(
|
|
|
92
92
|
disabled: !t.can().toggleUnderline(),
|
|
93
93
|
icon: "Underline",
|
|
94
94
|
shortcutKeys: ["mod", "U"],
|
|
95
|
-
tooltip:
|
|
95
|
+
tooltip: n("editor.underline.tooltip")
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
}
|
|
@@ -103,7 +103,7 @@ const qe = dn.forwardRef(
|
|
|
103
103
|
var e;
|
|
104
104
|
return {
|
|
105
105
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
106
|
-
button: ({ editor: t, t:
|
|
106
|
+
button: ({ editor: t, t: n }) => ({
|
|
107
107
|
component: x,
|
|
108
108
|
componentProps: {
|
|
109
109
|
action: () => t.commands.toggleStrike(),
|
|
@@ -111,7 +111,7 @@ const qe = dn.forwardRef(
|
|
|
111
111
|
disabled: !t.can().toggleStrike(),
|
|
112
112
|
icon: "Strikethrough",
|
|
113
113
|
shortcutKeys: ["shift", "mod", "S"],
|
|
114
|
-
tooltip:
|
|
114
|
+
tooltip: n("editor.strike.tooltip")
|
|
115
115
|
}
|
|
116
116
|
})
|
|
117
117
|
};
|
|
@@ -121,7 +121,7 @@ const qe = dn.forwardRef(
|
|
|
121
121
|
var e;
|
|
122
122
|
return {
|
|
123
123
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
124
|
-
button: ({ editor: t, t:
|
|
124
|
+
button: ({ editor: t, t: n }) => ({
|
|
125
125
|
component: x,
|
|
126
126
|
componentProps: {
|
|
127
127
|
action: () => t.commands.toggleCode(),
|
|
@@ -129,7 +129,7 @@ const qe = dn.forwardRef(
|
|
|
129
129
|
disabled: !t.can().toggleCode(),
|
|
130
130
|
icon: "Code",
|
|
131
131
|
shortcutKeys: ["mod", "E"],
|
|
132
|
-
tooltip:
|
|
132
|
+
tooltip: n("editor.code.tooltip")
|
|
133
133
|
}
|
|
134
134
|
})
|
|
135
135
|
};
|
|
@@ -143,12 +143,12 @@ function Xn() {
|
|
|
143
143
|
function ei(e) {
|
|
144
144
|
if (!I && !re) {
|
|
145
145
|
const t = e.themes.filter(
|
|
146
|
-
(
|
|
147
|
-
),
|
|
148
|
-
(
|
|
146
|
+
(i) => !!i && i in dt
|
|
147
|
+
), n = e.languages.filter(
|
|
148
|
+
(i) => !!i && i in ht
|
|
149
149
|
);
|
|
150
|
-
return re = Wn({ themes: t, langs:
|
|
151
|
-
I =
|
|
150
|
+
return re = Wn({ themes: t, langs: n }).then((i) => {
|
|
151
|
+
I = i;
|
|
152
152
|
}), re;
|
|
153
153
|
}
|
|
154
154
|
if (re)
|
|
@@ -163,15 +163,15 @@ async function mt(e) {
|
|
|
163
163
|
async function ti({
|
|
164
164
|
doc: e,
|
|
165
165
|
name: t,
|
|
166
|
-
defaultTheme:
|
|
167
|
-
defaultLanguage:
|
|
166
|
+
defaultTheme: n,
|
|
167
|
+
defaultLanguage: i
|
|
168
168
|
}) {
|
|
169
169
|
const a = ce(e, (c) => c.type.name === t), o = [
|
|
170
170
|
...a.map((c) => c.node.attrs.theme),
|
|
171
|
-
|
|
171
|
+
n
|
|
172
172
|
], s = [
|
|
173
173
|
...a.map((c) => c.node.attrs.language),
|
|
174
|
-
|
|
174
|
+
i
|
|
175
175
|
];
|
|
176
176
|
I ? await Promise.all([
|
|
177
177
|
...o.flatMap((c) => ut(c)),
|
|
@@ -181,13 +181,13 @@ async function ti({
|
|
|
181
181
|
function Ze({
|
|
182
182
|
doc: e,
|
|
183
183
|
name: t,
|
|
184
|
-
defaultTheme:
|
|
185
|
-
defaultLanguage:
|
|
184
|
+
defaultTheme: n,
|
|
185
|
+
defaultLanguage: i
|
|
186
186
|
}) {
|
|
187
187
|
const a = [];
|
|
188
188
|
return ce(e, (s) => s.type.name === t).forEach((s) => {
|
|
189
|
-
let c = s.pos + 1, h = s.node.attrs.language ||
|
|
190
|
-
const d = s.node.attrs.theme ||
|
|
189
|
+
let c = s.pos + 1, h = s.node.attrs.language || i;
|
|
190
|
+
const d = s.node.attrs.theme || n, l = Xn();
|
|
191
191
|
if (!l)
|
|
192
192
|
return;
|
|
193
193
|
l.getLoadedLanguages().includes(h) || (h = "plaintext");
|
|
@@ -196,11 +196,11 @@ function Ze({
|
|
|
196
196
|
theme: u
|
|
197
197
|
});
|
|
198
198
|
for (const _ of f) {
|
|
199
|
-
for (const
|
|
200
|
-
const
|
|
201
|
-
style: `color: ${
|
|
199
|
+
for (const w of _) {
|
|
200
|
+
const p = c + w.content.length, T = he.inline(c, p, {
|
|
201
|
+
style: `color: ${w.color}`
|
|
202
202
|
});
|
|
203
|
-
a.push(T), c =
|
|
203
|
+
a.push(T), c = p;
|
|
204
204
|
}
|
|
205
205
|
c += 1;
|
|
206
206
|
}
|
|
@@ -209,9 +209,9 @@ function Ze({
|
|
|
209
209
|
function ni({
|
|
210
210
|
name: e,
|
|
211
211
|
defaultLanguage: t,
|
|
212
|
-
defaultTheme:
|
|
212
|
+
defaultTheme: n
|
|
213
213
|
}) {
|
|
214
|
-
const
|
|
214
|
+
const i = new te({
|
|
215
215
|
key: new Z("shiki"),
|
|
216
216
|
view(a) {
|
|
217
217
|
class o {
|
|
@@ -226,7 +226,7 @@ function ni({
|
|
|
226
226
|
// Initialize shiki async, and then highlight initial document
|
|
227
227
|
async initDecorations() {
|
|
228
228
|
const c = a.state.doc;
|
|
229
|
-
await ti({ doc: c, name: e, defaultLanguage: t, defaultTheme:
|
|
229
|
+
await ti({ doc: c, name: e, defaultLanguage: t, defaultTheme: n });
|
|
230
230
|
const h = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
|
|
231
231
|
a.dispatch(h);
|
|
232
232
|
}
|
|
@@ -255,7 +255,7 @@ function ni({
|
|
|
255
255
|
doc: o,
|
|
256
256
|
name: e,
|
|
257
257
|
defaultLanguage: t,
|
|
258
|
-
defaultTheme:
|
|
258
|
+
defaultTheme: n
|
|
259
259
|
}),
|
|
260
260
|
apply: (a, o, s, c) => {
|
|
261
261
|
const h = s.selection.$head.parent.type.name, d = c.selection.$head.parent.type.name, l = ce(
|
|
@@ -264,26 +264,26 @@ function ni({
|
|
|
264
264
|
), u = ce(
|
|
265
265
|
c.doc,
|
|
266
266
|
(_) => _.type.name === e
|
|
267
|
-
), f = a.docChanged && ([h, d].includes(e) || u.length !== l.length || a.steps.some((_) => _.from !== void 0 && _.to !== void 0 && l.some((
|
|
267
|
+
), f = a.docChanged && ([h, d].includes(e) || u.length !== l.length || a.steps.some((_) => _.from !== void 0 && _.to !== void 0 && l.some((w) => w.pos >= _.from && w.pos + w.node.nodeSize <= _.to)));
|
|
268
268
|
return a.getMeta("shikiPluginForceDecoration") || f ? Ze({
|
|
269
269
|
doc: a.doc,
|
|
270
270
|
name: e,
|
|
271
271
|
defaultLanguage: t,
|
|
272
|
-
defaultTheme:
|
|
272
|
+
defaultTheme: n
|
|
273
273
|
}) : o.map(a.mapping, a.doc);
|
|
274
274
|
}
|
|
275
275
|
},
|
|
276
276
|
props: {
|
|
277
277
|
//@ts-expect-error
|
|
278
278
|
decorations(a) {
|
|
279
|
-
return
|
|
279
|
+
return i.getState(a);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
|
-
return
|
|
283
|
+
return i;
|
|
284
284
|
}
|
|
285
|
-
function ii({ action: e, languages: t, ...
|
|
286
|
-
const
|
|
285
|
+
function ii({ action: e, languages: t, ...n }) {
|
|
286
|
+
const i = (o) => {
|
|
287
287
|
e(o);
|
|
288
288
|
}, a = P(() => t == null ? void 0 : t.map((o) => ({
|
|
289
289
|
title: Un[o] || o,
|
|
@@ -291,26 +291,26 @@ function ii({ action: e, languages: t, ...i }) {
|
|
|
291
291
|
language: o
|
|
292
292
|
})), [t]);
|
|
293
293
|
return /* @__PURE__ */ m(Q, { children: [
|
|
294
|
-
/* @__PURE__ */ r(Y, { disabled:
|
|
294
|
+
/* @__PURE__ */ r(Y, { disabled: n == null ? void 0 : n.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
295
295
|
x,
|
|
296
296
|
{
|
|
297
|
-
tooltip:
|
|
298
|
-
disabled:
|
|
299
|
-
icon:
|
|
297
|
+
tooltip: n == null ? void 0 : n.tooltip,
|
|
298
|
+
disabled: n == null ? void 0 : n.disabled,
|
|
299
|
+
icon: n == null ? void 0 : n.icon
|
|
300
300
|
}
|
|
301
301
|
) }),
|
|
302
|
-
/* @__PURE__ */ r(X, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ r(vn, { onClick: () =>
|
|
302
|
+
/* @__PURE__ */ r(X, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ r(vn, { onClick: () => i(o.language), children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", children: o.title }) }, `codeblock-${o.title}`)) })
|
|
303
303
|
] });
|
|
304
304
|
}
|
|
305
|
-
const ai = C.Root, oi = C.Value, ft = J.forwardRef(({ className: e, children: t, ...
|
|
305
|
+
const ai = C.Root, oi = C.Value, ft = J.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
|
|
306
306
|
C.Trigger,
|
|
307
307
|
{
|
|
308
|
-
ref:
|
|
308
|
+
ref: i,
|
|
309
309
|
className: S(
|
|
310
310
|
"richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",
|
|
311
311
|
e
|
|
312
312
|
),
|
|
313
|
-
...
|
|
313
|
+
...n,
|
|
314
314
|
children: [
|
|
315
315
|
t,
|
|
316
316
|
/* @__PURE__ */ r(C.Icon, { asChild: !0, children: /* @__PURE__ */ r(Ie, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
|
|
@@ -318,10 +318,10 @@ const ai = C.Root, oi = C.Value, ft = J.forwardRef(({ className: e, children: t,
|
|
|
318
318
|
}
|
|
319
319
|
));
|
|
320
320
|
ft.displayName = C.Trigger.displayName;
|
|
321
|
-
const _t = J.forwardRef(({ className: e, ...t },
|
|
321
|
+
const _t = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
322
322
|
C.ScrollUpButton,
|
|
323
323
|
{
|
|
324
|
-
ref:
|
|
324
|
+
ref: n,
|
|
325
325
|
className: S(
|
|
326
326
|
"richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
|
|
327
327
|
e
|
|
@@ -331,10 +331,10 @@ const _t = J.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
331
331
|
}
|
|
332
332
|
));
|
|
333
333
|
_t.displayName = C.ScrollUpButton.displayName;
|
|
334
|
-
const gt = J.forwardRef(({ className: e, ...t },
|
|
334
|
+
const gt = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
335
335
|
C.ScrollDownButton,
|
|
336
336
|
{
|
|
337
|
-
ref:
|
|
337
|
+
ref: n,
|
|
338
338
|
className: S(
|
|
339
339
|
"richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
|
|
340
340
|
e
|
|
@@ -344,17 +344,17 @@ const gt = J.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
344
344
|
}
|
|
345
345
|
));
|
|
346
346
|
gt.displayName = C.ScrollDownButton.displayName;
|
|
347
|
-
const bt = J.forwardRef(({ className: e, children: t, position:
|
|
347
|
+
const bt = J.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */ r(C.Portal, { children: /* @__PURE__ */ m(
|
|
348
348
|
C.Content,
|
|
349
349
|
{
|
|
350
350
|
ref: a,
|
|
351
351
|
className: S(
|
|
352
352
|
"richtext-relative richtext-z-50 richtext-max-h-60 richtext-overflow-y-auto richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md richtext-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
|
|
353
|
-
|
|
353
|
+
n === "popper" && "data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",
|
|
354
354
|
e
|
|
355
355
|
),
|
|
356
|
-
position:
|
|
357
|
-
...
|
|
356
|
+
position: n,
|
|
357
|
+
...i,
|
|
358
358
|
children: [
|
|
359
359
|
/* @__PURE__ */ r(_t, {}),
|
|
360
360
|
/* @__PURE__ */ r(
|
|
@@ -362,7 +362,7 @@ const bt = J.forwardRef(({ className: e, children: t, position: i = "popper", ..
|
|
|
362
362
|
{
|
|
363
363
|
className: S(
|
|
364
364
|
"richtext-p-1",
|
|
365
|
-
|
|
365
|
+
n === "popper" && "richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"
|
|
366
366
|
),
|
|
367
367
|
children: t
|
|
368
368
|
}
|
|
@@ -372,24 +372,24 @@ const bt = J.forwardRef(({ className: e, children: t, position: i = "popper", ..
|
|
|
372
372
|
}
|
|
373
373
|
) }));
|
|
374
374
|
bt.displayName = C.Content.displayName;
|
|
375
|
-
const ri = J.forwardRef(({ className: e, ...t },
|
|
375
|
+
const ri = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
376
376
|
C.Label,
|
|
377
377
|
{
|
|
378
|
-
ref:
|
|
378
|
+
ref: n,
|
|
379
379
|
className: S("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold", e),
|
|
380
380
|
...t
|
|
381
381
|
}
|
|
382
382
|
));
|
|
383
383
|
ri.displayName = C.Label.displayName;
|
|
384
|
-
const Ee = J.forwardRef(({ className: e, children: t, ...
|
|
384
|
+
const Ee = J.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
|
|
385
385
|
C.Item,
|
|
386
386
|
{
|
|
387
|
-
ref:
|
|
387
|
+
ref: i,
|
|
388
388
|
className: S(
|
|
389
389
|
"richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
|
|
390
390
|
e
|
|
391
391
|
),
|
|
392
|
-
...
|
|
392
|
+
...n,
|
|
393
393
|
children: [
|
|
394
394
|
/* @__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(C.ItemIndicator, { children: /* @__PURE__ */ r(hn, { className: "richtext-h-4 richtext-w-4" }) }) }),
|
|
395
395
|
/* @__PURE__ */ r(C.ItemText, { children: t })
|
|
@@ -397,10 +397,10 @@ const Ee = J.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__
|
|
|
397
397
|
}
|
|
398
398
|
));
|
|
399
399
|
Ee.displayName = C.Item.displayName;
|
|
400
|
-
const si = J.forwardRef(({ className: e, ...t },
|
|
400
|
+
const si = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
401
401
|
C.Separator,
|
|
402
402
|
{
|
|
403
|
-
ref:
|
|
403
|
+
ref: n,
|
|
404
404
|
className: S("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", e),
|
|
405
405
|
...t
|
|
406
406
|
}
|
|
@@ -408,9 +408,9 @@ const si = J.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ r(
|
|
|
408
408
|
si.displayName = C.Separator.displayName;
|
|
409
409
|
function ci() {
|
|
410
410
|
const [e, t] = v(!1);
|
|
411
|
-
return { isCopied: e, copyToClipboard: async (
|
|
411
|
+
return { isCopied: e, copyToClipboard: async (i) => {
|
|
412
412
|
try {
|
|
413
|
-
await navigator.clipboard.writeText(
|
|
413
|
+
await navigator.clipboard.writeText(i), t(!0), setTimeout(() => t(!1), 2e3);
|
|
414
414
|
} catch (a) {
|
|
415
415
|
console.error("Failed to copy text: ", a), t(!1);
|
|
416
416
|
}
|
|
@@ -426,12 +426,12 @@ const li = "_wrap_134f4_1", di = "_maxHeight_134f4_10", hi = "_btnCopy_134f4_13"
|
|
|
426
426
|
selectLang: _i,
|
|
427
427
|
copied: gi
|
|
428
428
|
};
|
|
429
|
-
function bi({ editor: e, node: { attrs: t }, updateAttributes:
|
|
429
|
+
function bi({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }) {
|
|
430
430
|
var f, _;
|
|
431
431
|
const { isCopied: a, copyToClipboard: o } = ci(), s = P(() => {
|
|
432
|
-
var
|
|
433
|
-
return (
|
|
434
|
-
}, [
|
|
432
|
+
var w;
|
|
433
|
+
return (w = i.options.languages) != null && w.length ? i.options.languages : ct;
|
|
434
|
+
}, [i.options.languages]), c = De(), h = (_ = (f = e == null ? void 0 : e.options) == null ? void 0 : f.editorProps) == null ? void 0 : _.print, { language: d } = t, l = G(null), u = F(() => Cn(xi.name, e), [e]);
|
|
435
435
|
return /* @__PURE__ */ m(le, { className: R($.wrap, !h && $.maxHeight, "render-wrapper"), children: [
|
|
436
436
|
/* @__PURE__ */ m(
|
|
437
437
|
"div",
|
|
@@ -466,18 +466,18 @@ function bi({ editor: e, node: { attrs: t }, updateAttributes: i, extension: n }
|
|
|
466
466
|
{
|
|
467
467
|
defaultValue: d || "auto",
|
|
468
468
|
disabled: !c,
|
|
469
|
-
onValueChange: (
|
|
469
|
+
onValueChange: (w) => n({ language: w }),
|
|
470
470
|
children: [
|
|
471
471
|
/* @__PURE__ */ r(ft, { children: /* @__PURE__ */ r(oi, { placeholder: "Language" }) }),
|
|
472
472
|
/* @__PURE__ */ m(bt, { className: "richtext-max-h-60 richtext-overflow-y-auto", children: [
|
|
473
473
|
/* @__PURE__ */ r(Ee, { value: "auto", children: "Auto" }),
|
|
474
|
-
s.map((
|
|
474
|
+
s.map((w, p) => /* @__PURE__ */ r(
|
|
475
475
|
Ee,
|
|
476
476
|
{
|
|
477
|
-
value:
|
|
478
|
-
children:
|
|
477
|
+
value: w,
|
|
478
|
+
children: w.charAt(0).toUpperCase() + w.slice(1)
|
|
479
479
|
},
|
|
480
|
-
`code-lang-${
|
|
480
|
+
`code-lang-${p}`
|
|
481
481
|
))
|
|
482
482
|
] })
|
|
483
483
|
]
|
|
@@ -495,9 +495,9 @@ const xi = Tt.extend({
|
|
|
495
495
|
return {
|
|
496
496
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
497
497
|
languages: [],
|
|
498
|
-
button: ({ editor: t, t:
|
|
498
|
+
button: ({ editor: t, t: n, extension: i }) => {
|
|
499
499
|
var o, s, c;
|
|
500
|
-
const a = (s = (o =
|
|
500
|
+
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 : ct;
|
|
501
501
|
return {
|
|
502
502
|
component: ii,
|
|
503
503
|
componentProps: {
|
|
@@ -507,7 +507,7 @@ const xi = Tt.extend({
|
|
|
507
507
|
isActive: () => t.isActive("codeBlock") || !1,
|
|
508
508
|
disabled: !t.can().toggleCodeBlock(),
|
|
509
509
|
icon: "Code2",
|
|
510
|
-
tooltip:
|
|
510
|
+
tooltip: n("editor.codeblock.tooltip"),
|
|
511
511
|
languages: a
|
|
512
512
|
}
|
|
513
513
|
};
|
|
@@ -529,9 +529,9 @@ const xi = Tt.extend({
|
|
|
529
529
|
];
|
|
530
530
|
}
|
|
531
531
|
});
|
|
532
|
-
function
|
|
532
|
+
function wi(e) {
|
|
533
533
|
var a, o, s;
|
|
534
|
-
const { t, lang:
|
|
534
|
+
const { t, lang: n } = B(), i = P(() => {
|
|
535
535
|
var d;
|
|
536
536
|
const c = (d = e == null ? void 0 : e.items) == null ? void 0 : d.find((l) => l.isActive());
|
|
537
537
|
return c && !c.default ? {
|
|
@@ -543,7 +543,7 @@ function pi(e) {
|
|
|
543
543
|
disabled: !1,
|
|
544
544
|
action: () => e.editor.chain().focus().unsetFontFamily().run()
|
|
545
545
|
};
|
|
546
|
-
}, [t,
|
|
546
|
+
}, [t, n, e]);
|
|
547
547
|
return /* @__PURE__ */ m(Q, { children: [
|
|
548
548
|
/* @__PURE__ */ r(
|
|
549
549
|
Y,
|
|
@@ -555,7 +555,7 @@ function pi(e) {
|
|
|
555
555
|
{
|
|
556
556
|
disabled: e == null ? void 0 : e.disabled,
|
|
557
557
|
icon: "MenuDown",
|
|
558
|
-
title: ((a =
|
|
558
|
+
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,
|
|
559
559
|
tooltip: e == null ? void 0 : e.tooltip
|
|
560
560
|
}
|
|
561
561
|
)
|
|
@@ -567,7 +567,7 @@ function pi(e) {
|
|
|
567
567
|
/* @__PURE__ */ r(
|
|
568
568
|
ne,
|
|
569
569
|
{
|
|
570
|
-
checked: (
|
|
570
|
+
checked: (i == null ? void 0 : i.font) === c.font,
|
|
571
571
|
onClick: c.action,
|
|
572
572
|
children: /* @__PURE__ */ r(
|
|
573
573
|
"div",
|
|
@@ -590,9 +590,9 @@ const fo = Lt.extend({
|
|
|
590
590
|
return {
|
|
591
591
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
592
592
|
fontFamilyList: qn,
|
|
593
|
-
button({ editor: t, extension:
|
|
593
|
+
button({ editor: t, extension: n, t: i }) {
|
|
594
594
|
var d;
|
|
595
|
-
const { extensions: a = [] } = t.extensionManager ?? [], o = Se(((d =
|
|
595
|
+
const { extensions: a = [] } = t.extensionManager ?? [], o = Se(((d = n == null ? void 0 : n.options) == null ? void 0 : d.fontFamilyList) || []), s = a.find(
|
|
596
596
|
(l) => l.name === "base-kit"
|
|
597
597
|
), c = o.map((l) => ({
|
|
598
598
|
action: () => {
|
|
@@ -607,14 +607,14 @@ const fo = Lt.extend({
|
|
|
607
607
|
action: () => t.chain().focus().unsetFontFamily().run(),
|
|
608
608
|
isActive: () => !1,
|
|
609
609
|
disabled: !1,
|
|
610
|
-
font:
|
|
611
|
-
title:
|
|
610
|
+
font: i("editor.fontFamily.default.tooltip"),
|
|
611
|
+
title: i("editor.fontFamily.tooltip")
|
|
612
612
|
});
|
|
613
613
|
const h = c.filter((l) => l.disabled).length === c.length;
|
|
614
614
|
return {
|
|
615
|
-
component:
|
|
615
|
+
component: wi,
|
|
616
616
|
componentProps: {
|
|
617
|
-
tooltip:
|
|
617
|
+
tooltip: i("editor.fontFamily.tooltip"),
|
|
618
618
|
disabled: h,
|
|
619
619
|
items: c,
|
|
620
620
|
editor: t
|
|
@@ -624,13 +624,13 @@ const fo = Lt.extend({
|
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
626
|
});
|
|
627
|
-
function
|
|
628
|
-
var
|
|
627
|
+
function pi(e) {
|
|
628
|
+
var n;
|
|
629
629
|
const t = P(() => {
|
|
630
630
|
var o;
|
|
631
|
-
const
|
|
632
|
-
return
|
|
633
|
-
...
|
|
631
|
+
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
632
|
+
return i && !i.default ? {
|
|
633
|
+
...i
|
|
634
634
|
} : {
|
|
635
635
|
title: e.tooltip,
|
|
636
636
|
level: 0,
|
|
@@ -654,21 +654,21 @@ function wi(e) {
|
|
|
654
654
|
)
|
|
655
655
|
}
|
|
656
656
|
),
|
|
657
|
-
/* @__PURE__ */ r(X, { className: "richtext-w-full", children: (
|
|
657
|
+
/* @__PURE__ */ r(X, { className: "richtext-w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
|
|
658
658
|
var o, s;
|
|
659
659
|
return /* @__PURE__ */ m(ze, { children: [
|
|
660
660
|
/* @__PURE__ */ m(
|
|
661
661
|
ne,
|
|
662
662
|
{
|
|
663
|
-
checked: (t == null ? void 0 : t.title) ===
|
|
664
|
-
onClick:
|
|
663
|
+
checked: (t == null ? void 0 : t.title) === i.title,
|
|
664
|
+
onClick: i.action,
|
|
665
665
|
children: [
|
|
666
|
-
/* @__PURE__ */ r("div", { className: `heading- richtext-ml-1 richtext-h-full${
|
|
667
|
-
!!((o =
|
|
666
|
+
/* @__PURE__ */ r("div", { className: `heading- richtext-ml-1 richtext-h-full${i.level}`, children: i.title }),
|
|
667
|
+
!!((o = i == null ? void 0 : i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r(Nn, { className: "richtext-pl-4", children: (s = i == null ? void 0 : i.shortcutKeys) == null ? void 0 : s.map((c) => Oe(c)).join(" ") })
|
|
668
668
|
]
|
|
669
669
|
}
|
|
670
670
|
),
|
|
671
|
-
|
|
671
|
+
i.level === 0 && /* @__PURE__ */ r(rt, {})
|
|
672
672
|
] }, `heading-k-${a}`);
|
|
673
673
|
}) })
|
|
674
674
|
] });
|
|
@@ -679,15 +679,15 @@ const _o = St.extend({
|
|
|
679
679
|
return {
|
|
680
680
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
681
681
|
levels: [1, 2, 3, 4, 5, 6],
|
|
682
|
-
button({ editor: t, extension:
|
|
682
|
+
button({ editor: t, extension: n, t: i }) {
|
|
683
683
|
var d;
|
|
684
|
-
const { extensions: a = [] } = t.extensionManager ?? [], o = ((d =
|
|
684
|
+
const { extensions: a = [] } = t.extensionManager ?? [], o = ((d = n.options) == null ? void 0 : d.levels) || [], s = a.find(
|
|
685
685
|
(l) => l.name === "base-kit"
|
|
686
686
|
), c = o.map((l) => ({
|
|
687
687
|
action: () => t.commands.toggleHeading({ level: l }),
|
|
688
688
|
isActive: () => t.isActive("heading", { level: l }) || !1,
|
|
689
689
|
disabled: !t.can().toggleHeading({ level: l }),
|
|
690
|
-
title:
|
|
690
|
+
title: i(`editor.heading.h${l}.tooltip`),
|
|
691
691
|
level: l,
|
|
692
692
|
shortcutKeys: ["alt", "mod", `${l}`]
|
|
693
693
|
}));
|
|
@@ -696,14 +696,14 @@ const _o = St.extend({
|
|
|
696
696
|
isActive: () => t.isActive("paragraph") || !1,
|
|
697
697
|
disabled: !t.can().setParagraph(),
|
|
698
698
|
level: 0,
|
|
699
|
-
title:
|
|
699
|
+
title: i("editor.paragraph.tooltip"),
|
|
700
700
|
shortcutKeys: ["alt", "mod", "0"]
|
|
701
701
|
});
|
|
702
702
|
const h = c.filter((l) => l.disabled).length === c.length;
|
|
703
703
|
return {
|
|
704
|
-
component:
|
|
704
|
+
component: pi,
|
|
705
705
|
componentProps: {
|
|
706
|
-
tooltip:
|
|
706
|
+
tooltip: i("editor.heading.tooltip"),
|
|
707
707
|
disabled: h,
|
|
708
708
|
items: c,
|
|
709
709
|
editor: t
|
|
@@ -714,13 +714,13 @@ const _o = St.extend({
|
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
716
|
function yi(e) {
|
|
717
|
-
var
|
|
717
|
+
var n;
|
|
718
718
|
const t = P(() => {
|
|
719
719
|
var o;
|
|
720
|
-
const
|
|
721
|
-
return
|
|
722
|
-
...
|
|
723
|
-
icon:
|
|
720
|
+
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
721
|
+
return i && !i.default ? {
|
|
722
|
+
...i,
|
|
723
|
+
icon: i.icon ? i.icon : e.icon
|
|
724
724
|
} : {
|
|
725
725
|
title: e == null ? void 0 : e.tooltip,
|
|
726
726
|
icon: e.icon,
|
|
@@ -757,23 +757,23 @@ function yi(e) {
|
|
|
757
757
|
align: "start",
|
|
758
758
|
className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
|
|
759
759
|
side: "bottom",
|
|
760
|
-
children: (
|
|
760
|
+
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
|
|
761
761
|
var o, s;
|
|
762
762
|
return /* @__PURE__ */ m(ke, { children: [
|
|
763
763
|
/* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ r(
|
|
764
764
|
$e,
|
|
765
765
|
{
|
|
766
766
|
className: "richtext-size-7 richtext-p-1",
|
|
767
|
-
"data-state": t.title ===
|
|
768
|
-
onClick:
|
|
769
|
-
pressed: t.title ===
|
|
767
|
+
"data-state": t.title === i.title ? "on" : "off",
|
|
768
|
+
onClick: i == null ? void 0 : i.action,
|
|
769
|
+
pressed: t.title === i.title,
|
|
770
770
|
size: "sm",
|
|
771
|
-
children: (
|
|
771
|
+
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(z, { name: i.icon })
|
|
772
772
|
}
|
|
773
773
|
) }),
|
|
774
774
|
/* @__PURE__ */ m(Ce, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
775
|
-
/* @__PURE__ */ r("span", { children:
|
|
776
|
-
!!((o =
|
|
775
|
+
/* @__PURE__ */ r("span", { children: i.title }),
|
|
776
|
+
!!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => Oe(c)).join(" ") })
|
|
777
777
|
] })
|
|
778
778
|
] }, `text-align-${a}`);
|
|
779
779
|
})
|
|
@@ -789,11 +789,11 @@ const go = Et.extend({
|
|
|
789
789
|
types: ["heading", "paragraph", "list_item", "title"],
|
|
790
790
|
button({
|
|
791
791
|
editor: t,
|
|
792
|
-
extension:
|
|
793
|
-
t:
|
|
792
|
+
extension: n,
|
|
793
|
+
t: i
|
|
794
794
|
}) {
|
|
795
795
|
var d;
|
|
796
|
-
const a = ((d =
|
|
796
|
+
const a = ((d = n.options) == null ? void 0 : d.alignments) || [], o = {
|
|
797
797
|
left: ["mod", "Shift", "L"],
|
|
798
798
|
center: ["mod", "Shift", "E"],
|
|
799
799
|
right: ["mod", "Shift", "R"],
|
|
@@ -806,13 +806,13 @@ const go = Et.extend({
|
|
|
806
806
|
}, c = a.map((l) => {
|
|
807
807
|
var u, f, _;
|
|
808
808
|
return {
|
|
809
|
-
title:
|
|
809
|
+
title: i(`editor.textalign.${l}.tooltip`),
|
|
810
810
|
icon: s[l],
|
|
811
811
|
shortcutKeys: o[l],
|
|
812
812
|
isActive: () => t.isActive({ textAlign: l }) || !1,
|
|
813
813
|
action: () => {
|
|
814
|
-
var
|
|
815
|
-
return (
|
|
814
|
+
var w, p;
|
|
815
|
+
return (p = (w = t.commands) == null ? void 0 : w.setTextAlign) == null ? void 0 : p.call(w, l);
|
|
816
816
|
},
|
|
817
817
|
disabled: !((_ = (f = (u = t == null ? void 0 : t.can) == null ? void 0 : u.call(t)) == null ? void 0 : f.setTextAlign) != null && _.call(f, l))
|
|
818
818
|
};
|
|
@@ -821,7 +821,7 @@ const go = Et.extend({
|
|
|
821
821
|
component: yi,
|
|
822
822
|
componentProps: {
|
|
823
823
|
icon: "AlignJustify",
|
|
824
|
-
tooltip:
|
|
824
|
+
tooltip: i("editor.textalign.tooltip"),
|
|
825
825
|
disabled: h,
|
|
826
826
|
items: c
|
|
827
827
|
}
|
|
@@ -831,8 +831,8 @@ const go = Et.extend({
|
|
|
831
831
|
}
|
|
832
832
|
});
|
|
833
833
|
function ki(e) {
|
|
834
|
-
var
|
|
835
|
-
const { t } = B(),
|
|
834
|
+
var i;
|
|
835
|
+
const { t } = B(), n = P(() => {
|
|
836
836
|
const a = (e.items || []).find((s) => s.isActive());
|
|
837
837
|
return a || {
|
|
838
838
|
title: t("editor.fontSize.default.tooltip"),
|
|
@@ -850,16 +850,16 @@ function ki(e) {
|
|
|
850
850
|
{
|
|
851
851
|
disabled: e == null ? void 0 : e.disabled,
|
|
852
852
|
icon: "MenuDown",
|
|
853
|
-
title:
|
|
853
|
+
title: n == null ? void 0 : n.title,
|
|
854
854
|
tooltip: `${e == null ? void 0 : e.tooltip}`
|
|
855
855
|
}
|
|
856
856
|
)
|
|
857
857
|
}
|
|
858
858
|
),
|
|
859
|
-
/* @__PURE__ */ r(X, { className: "richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto", children: (
|
|
859
|
+
/* @__PURE__ */ r(X, { 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(
|
|
860
860
|
ne,
|
|
861
861
|
{
|
|
862
|
-
checked:
|
|
862
|
+
checked: n.title === a.title,
|
|
863
863
|
onClick: a.action,
|
|
864
864
|
children: /* @__PURE__ */ r("div", { className: "richtext-ml-1 richtext-h-full", children: a.title })
|
|
865
865
|
},
|
|
@@ -875,10 +875,10 @@ const bo = N.create({
|
|
|
875
875
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
876
876
|
types: ["textStyle"],
|
|
877
877
|
fontSizes: [...Kn],
|
|
878
|
-
button({ editor: t, extension:
|
|
878
|
+
button({ editor: t, extension: n, t: i }) {
|
|
879
879
|
var h;
|
|
880
|
-
const a = Se(((h =
|
|
881
|
-
title: d.value === o.value ?
|
|
880
|
+
const a = Se(((h = n.options) == null ? void 0 : h.fontSizes) || Ge), o = Se([Ge])[0], s = a.map((d) => ({
|
|
881
|
+
title: d.value === o.value ? i("editor.fontSize.default.tooltip") : String(d.name),
|
|
882
882
|
isActive: () => {
|
|
883
883
|
const { fontSize: l } = t.getAttributes("textStyle");
|
|
884
884
|
return d.value === o.value && l === void 0 ? !0 : t.isActive({ fontSize: String(d.value) }) || !1;
|
|
@@ -898,7 +898,7 @@ const bo = N.create({
|
|
|
898
898
|
component: ki,
|
|
899
899
|
componentProps: {
|
|
900
900
|
editor: t,
|
|
901
|
-
tooltip:
|
|
901
|
+
tooltip: i("editor.fontSize.tooltip"),
|
|
902
902
|
disabled: c,
|
|
903
903
|
items: s,
|
|
904
904
|
maxHeight: 280
|
|
@@ -972,8 +972,8 @@ function vi({ fill: e }) {
|
|
|
972
972
|
);
|
|
973
973
|
}
|
|
974
974
|
function Ci(e) {
|
|
975
|
-
const [t,
|
|
976
|
-
function
|
|
975
|
+
const [t, n] = v(void 0);
|
|
976
|
+
function i(s) {
|
|
977
977
|
var c;
|
|
978
978
|
(c = e.action) == null || c.call(e, s);
|
|
979
979
|
}
|
|
@@ -983,7 +983,7 @@ function Ci(e) {
|
|
|
983
983
|
}
|
|
984
984
|
const o = F(
|
|
985
985
|
on((s) => {
|
|
986
|
-
|
|
986
|
+
n(s);
|
|
987
987
|
}, 350),
|
|
988
988
|
[]
|
|
989
989
|
);
|
|
@@ -994,7 +994,7 @@ function Ci(e) {
|
|
|
994
994
|
{
|
|
995
995
|
selectedColor: t,
|
|
996
996
|
setSelectedColor: o,
|
|
997
|
-
onChange:
|
|
997
|
+
onChange: i,
|
|
998
998
|
disabled: e == null ? void 0 : e.disabled,
|
|
999
999
|
colors: e == null ? void 0 : e.colors,
|
|
1000
1000
|
defaultColor: e == null ? void 0 : e.defaultColor,
|
|
@@ -1008,12 +1008,12 @@ const xo = Ht.extend({
|
|
|
1008
1008
|
var e;
|
|
1009
1009
|
return {
|
|
1010
1010
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1011
|
-
button({ editor: t, t:
|
|
1011
|
+
button({ editor: t, t: n, extension: i }) {
|
|
1012
1012
|
return {
|
|
1013
1013
|
component: Ci,
|
|
1014
1014
|
componentProps: {
|
|
1015
|
-
colors:
|
|
1016
|
-
defaultColor:
|
|
1015
|
+
colors: i.options.colors,
|
|
1016
|
+
defaultColor: i.options.defaultColor,
|
|
1017
1017
|
action: (a) => {
|
|
1018
1018
|
a === void 0 && t.chain().focus().unsetColor().run(), typeof a == "string" && t.chain().focus().setColor(a).run();
|
|
1019
1019
|
},
|
|
@@ -1023,39 +1023,39 @@ const xo = Ht.extend({
|
|
|
1023
1023
|
},
|
|
1024
1024
|
editor: t,
|
|
1025
1025
|
disabled: !t.can().setColor(""),
|
|
1026
|
-
tooltip:
|
|
1026
|
+
tooltip: n("editor.color.tooltip")
|
|
1027
1027
|
}
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
|
-
}),
|
|
1032
|
+
}), wo = Mt.extend({
|
|
1033
1033
|
addOptions() {
|
|
1034
1034
|
var e;
|
|
1035
1035
|
return {
|
|
1036
1036
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1037
1037
|
multicolor: !0,
|
|
1038
|
-
button: ({ editor: t, t:
|
|
1038
|
+
button: ({ editor: t, t: n }) => ({
|
|
1039
1039
|
component: Tn,
|
|
1040
1040
|
componentProps: {
|
|
1041
|
-
action: (
|
|
1042
|
-
typeof
|
|
1041
|
+
action: (i) => {
|
|
1042
|
+
typeof i == "string" && t.chain().focus().setHighlight({ color: i }).run(), i === void 0 && t.chain().focus().unsetHighlight().run();
|
|
1043
1043
|
},
|
|
1044
1044
|
editor: t,
|
|
1045
1045
|
isActive: () => t.isActive("highlight") || !1,
|
|
1046
1046
|
disabled: !t.can().setHighlight(),
|
|
1047
1047
|
shortcutKeys: ["⇧", "mod", "H"],
|
|
1048
|
-
tooltip:
|
|
1048
|
+
tooltip: n("editor.highlight.tooltip")
|
|
1049
1049
|
}
|
|
1050
1050
|
})
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
|
-
}),
|
|
1053
|
+
}), po = zt.extend({
|
|
1054
1054
|
addOptions() {
|
|
1055
1055
|
var e;
|
|
1056
1056
|
return {
|
|
1057
1057
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1058
|
-
button: ({ editor: t, t:
|
|
1058
|
+
button: ({ editor: t, t: n }) => ({
|
|
1059
1059
|
component: x,
|
|
1060
1060
|
componentProps: {
|
|
1061
1061
|
action: () => t.commands.toggleBulletList(),
|
|
@@ -1063,24 +1063,24 @@ const xo = Ht.extend({
|
|
|
1063
1063
|
disabled: !1,
|
|
1064
1064
|
shortcutKeys: ["shift", "mod", "8"],
|
|
1065
1065
|
icon: "List",
|
|
1066
|
-
tooltip:
|
|
1066
|
+
tooltip: n("editor.bulletlist.tooltip")
|
|
1067
1067
|
}
|
|
1068
1068
|
})
|
|
1069
1069
|
};
|
|
1070
1070
|
}
|
|
1071
|
-
}), yo =
|
|
1071
|
+
}), yo = we.create({
|
|
1072
1072
|
name: "clear",
|
|
1073
1073
|
addOptions() {
|
|
1074
1074
|
var e;
|
|
1075
1075
|
return {
|
|
1076
1076
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1077
|
-
button: ({ editor: t, t:
|
|
1077
|
+
button: ({ editor: t, t: n }) => ({
|
|
1078
1078
|
component: x,
|
|
1079
1079
|
componentProps: {
|
|
1080
1080
|
action: () => t.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
1081
1081
|
disabled: !t.can().chain().focus().clearNodes().unsetAllMarks().run(),
|
|
1082
1082
|
icon: "Eraser",
|
|
1083
|
-
tooltip:
|
|
1083
|
+
tooltip: n("editor.clear.tooltip")
|
|
1084
1084
|
}
|
|
1085
1085
|
})
|
|
1086
1086
|
};
|
|
@@ -1090,7 +1090,7 @@ const xo = Ht.extend({
|
|
|
1090
1090
|
var e;
|
|
1091
1091
|
return {
|
|
1092
1092
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1093
|
-
button: ({ editor: t, t:
|
|
1093
|
+
button: ({ editor: t, t: n }) => ({
|
|
1094
1094
|
component: x,
|
|
1095
1095
|
componentProps: {
|
|
1096
1096
|
action: () => t.commands.toggleOrderedList(),
|
|
@@ -1098,7 +1098,7 @@ const xo = Ht.extend({
|
|
|
1098
1098
|
disabled: !1,
|
|
1099
1099
|
icon: "ListOrdered",
|
|
1100
1100
|
shortcutKeys: ["mod", "shift", "7"],
|
|
1101
|
-
tooltip:
|
|
1101
|
+
tooltip: n("editor.orderedlist.tooltip")
|
|
1102
1102
|
}
|
|
1103
1103
|
})
|
|
1104
1104
|
};
|
|
@@ -1116,7 +1116,7 @@ const xo = Ht.extend({
|
|
|
1116
1116
|
class: "task-list-item"
|
|
1117
1117
|
}
|
|
1118
1118
|
},
|
|
1119
|
-
button: ({ editor: t, t:
|
|
1119
|
+
button: ({ editor: t, t: n }) => ({
|
|
1120
1120
|
component: x,
|
|
1121
1121
|
componentProps: {
|
|
1122
1122
|
action: () => t.commands.toggleTaskList(),
|
|
@@ -1124,7 +1124,7 @@ const xo = Ht.extend({
|
|
|
1124
1124
|
disabled: !1,
|
|
1125
1125
|
icon: "ListTodo",
|
|
1126
1126
|
shortcutKeys: ["shift", "mod", "9"],
|
|
1127
|
-
tooltip:
|
|
1127
|
+
tooltip: n("editor.tasklist.tooltip")
|
|
1128
1128
|
}
|
|
1129
1129
|
})
|
|
1130
1130
|
};
|
|
@@ -1140,7 +1140,7 @@ const xo = Ht.extend({
|
|
|
1140
1140
|
HTMLAttributes: {
|
|
1141
1141
|
class: "blockquote"
|
|
1142
1142
|
},
|
|
1143
|
-
button: ({ editor: t, t:
|
|
1143
|
+
button: ({ editor: t, t: n }) => ({
|
|
1144
1144
|
component: x,
|
|
1145
1145
|
componentProps: {
|
|
1146
1146
|
action: () => t.commands.toggleBlockquote(),
|
|
@@ -1148,18 +1148,18 @@ const xo = Ht.extend({
|
|
|
1148
1148
|
disabled: !t.can().toggleBlockquote(),
|
|
1149
1149
|
icon: "TextQuote",
|
|
1150
1150
|
shortcutKeys: ["shift", "mod", "B"],
|
|
1151
|
-
tooltip:
|
|
1151
|
+
tooltip: n("editor.blockquote.tooltip")
|
|
1152
1152
|
}
|
|
1153
1153
|
})
|
|
1154
1154
|
};
|
|
1155
1155
|
}
|
|
1156
1156
|
});
|
|
1157
1157
|
function Ni(e) {
|
|
1158
|
-
const [t,
|
|
1159
|
-
function
|
|
1160
|
-
e.action && (e.action({ link: a, text: o, openInNewTab: s }),
|
|
1158
|
+
const [t, n] = v(!1);
|
|
1159
|
+
function i(a, o, s) {
|
|
1160
|
+
e.action && (e.action({ link: a, text: o, openInNewTab: s }), n(!1));
|
|
1161
1161
|
}
|
|
1162
|
-
return /* @__PURE__ */ m(ie, { modal: !0, open: t, onOpenChange:
|
|
1162
|
+
return /* @__PURE__ */ m(ie, { modal: !0, open: t, onOpenChange: n, children: [
|
|
1163
1163
|
/* @__PURE__ */ r(ae, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
1164
1164
|
x,
|
|
1165
1165
|
{
|
|
@@ -1169,7 +1169,7 @@ function Ni(e) {
|
|
|
1169
1169
|
children: /* @__PURE__ */ r(z, { name: e == null ? void 0 : e.icon })
|
|
1170
1170
|
}
|
|
1171
1171
|
) }),
|
|
1172
|
-
/* @__PURE__ */ r(oe, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(Ln, { editor: e.editor, onSetLink:
|
|
1172
|
+
/* @__PURE__ */ r(oe, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(Ln, { editor: e.editor, onSetLink: i }) })
|
|
1173
1173
|
] });
|
|
1174
1174
|
}
|
|
1175
1175
|
const No = jt.extend({
|
|
@@ -1184,7 +1184,7 @@ const No = jt.extend({
|
|
|
1184
1184
|
renderHTML({ HTMLAttributes: e }) {
|
|
1185
1185
|
return [
|
|
1186
1186
|
"a",
|
|
1187
|
-
|
|
1187
|
+
pe(this.options.HTMLAttributes, e, {
|
|
1188
1188
|
class: "link"
|
|
1189
1189
|
}),
|
|
1190
1190
|
0
|
|
@@ -1195,12 +1195,12 @@ const No = jt.extend({
|
|
|
1195
1195
|
return {
|
|
1196
1196
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1197
1197
|
openOnClick: !0,
|
|
1198
|
-
button: ({ editor: t, t:
|
|
1198
|
+
button: ({ editor: t, t: n }) => ({
|
|
1199
1199
|
component: Ni,
|
|
1200
1200
|
componentProps: {
|
|
1201
1201
|
editor: t,
|
|
1202
|
-
action: (
|
|
1203
|
-
const { link: a, text: o, openInNewTab: s } =
|
|
1202
|
+
action: (i) => {
|
|
1203
|
+
const { link: a, text: o, openInNewTab: s } = i;
|
|
1204
1204
|
t.chain().extendMarkRange("link").insertContent({
|
|
1205
1205
|
type: "text",
|
|
1206
1206
|
text: o,
|
|
@@ -1219,7 +1219,7 @@ const No = jt.extend({
|
|
|
1219
1219
|
isActive: () => t.isActive("link") || !1,
|
|
1220
1220
|
disabled: !t.can().setLink({ href: "" }),
|
|
1221
1221
|
icon: "Link",
|
|
1222
|
-
tooltip:
|
|
1222
|
+
tooltip: n("editor.link.tooltip")
|
|
1223
1223
|
}
|
|
1224
1224
|
})
|
|
1225
1225
|
};
|
|
@@ -1229,10 +1229,10 @@ const No = jt.extend({
|
|
|
1229
1229
|
new te({
|
|
1230
1230
|
props: {
|
|
1231
1231
|
handleClick: (e, t) => {
|
|
1232
|
-
const { schema:
|
|
1232
|
+
const { schema: n, doc: i, tr: a } = e.state, o = Dt(i.resolve(t), n.marks.link);
|
|
1233
1233
|
if (!o)
|
|
1234
1234
|
return !1;
|
|
1235
|
-
const s =
|
|
1235
|
+
const s = i.resolve(o.from), c = i.resolve(o.to), h = a.setSelection(new ot(s, c));
|
|
1236
1236
|
e.dispatch(h);
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
@@ -1243,7 +1243,7 @@ const No = jt.extend({
|
|
|
1243
1243
|
renderHTML() {
|
|
1244
1244
|
return [
|
|
1245
1245
|
"div",
|
|
1246
|
-
|
|
1246
|
+
pe(this.options.HTMLAttributes, {
|
|
1247
1247
|
"data-type": this.name
|
|
1248
1248
|
}),
|
|
1249
1249
|
["hr"]
|
|
@@ -1253,14 +1253,14 @@ const No = jt.extend({
|
|
|
1253
1253
|
var e;
|
|
1254
1254
|
return {
|
|
1255
1255
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1256
|
-
button: ({ editor: t, t:
|
|
1256
|
+
button: ({ editor: t, t: n }) => ({
|
|
1257
1257
|
component: x,
|
|
1258
1258
|
componentProps: {
|
|
1259
1259
|
action: () => t.commands.setHorizontalRule(),
|
|
1260
1260
|
disabled: !t.can().setHorizontalRule(),
|
|
1261
1261
|
icon: "Minus",
|
|
1262
1262
|
shortcutKeys: ["mod", "alt", "S"],
|
|
1263
|
-
tooltip:
|
|
1263
|
+
tooltip: n("editor.horizontalrule.tooltip")
|
|
1264
1264
|
}
|
|
1265
1265
|
})
|
|
1266
1266
|
};
|
|
@@ -1276,9 +1276,9 @@ function Ai(e) {
|
|
|
1276
1276
|
const {
|
|
1277
1277
|
icon: t = void 0,
|
|
1278
1278
|
// title = undefined,
|
|
1279
|
-
tooltip:
|
|
1279
|
+
tooltip: n = void 0,
|
|
1280
1280
|
// disabled = false,
|
|
1281
|
-
customClass:
|
|
1281
|
+
customClass: i = "",
|
|
1282
1282
|
// color = undefined,
|
|
1283
1283
|
// loading = false,
|
|
1284
1284
|
// shortcutKeys = undefined,
|
|
@@ -1292,7 +1292,7 @@ function Ai(e) {
|
|
|
1292
1292
|
$e,
|
|
1293
1293
|
{
|
|
1294
1294
|
size: "sm",
|
|
1295
|
-
className: `richtext-w-[32px] richtext-h-[32px] ${
|
|
1295
|
+
className: `richtext-w-[32px] richtext-h-[32px] ${i}`,
|
|
1296
1296
|
disabled: s == null ? void 0 : s(),
|
|
1297
1297
|
onClick: o,
|
|
1298
1298
|
children: [
|
|
@@ -1301,8 +1301,8 @@ function Ai(e) {
|
|
|
1301
1301
|
]
|
|
1302
1302
|
}
|
|
1303
1303
|
) }),
|
|
1304
|
-
|
|
1305
|
-
/* @__PURE__ */ r("div", { children:
|
|
1304
|
+
n && /* @__PURE__ */ r(Ce, { ...a, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
|
|
1305
|
+
/* @__PURE__ */ r("div", { children: n }),
|
|
1306
1306
|
!!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */ r("span", { children: je(e == null ? void 0 : e.shortcutKeys) })
|
|
1307
1307
|
] }) })
|
|
1308
1308
|
] });
|
|
@@ -1314,17 +1314,17 @@ const Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1314
1314
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1315
1315
|
depth: 100,
|
|
1316
1316
|
newGroupDelay: 500,
|
|
1317
|
-
button: ({ editor: t, t:
|
|
1317
|
+
button: ({ editor: t, t: n }) => Ti.map((i) => ({
|
|
1318
1318
|
component: Ai,
|
|
1319
1319
|
componentProps: {
|
|
1320
1320
|
action: () => {
|
|
1321
|
-
|
|
1321
|
+
i === "undo" && t.chain().focus().undo().run(), i === "redo" && t.chain().focus().redo().run();
|
|
1322
1322
|
},
|
|
1323
|
-
shortcutKeys:
|
|
1324
|
-
disabled:
|
|
1325
|
-
isActive: () =>
|
|
1326
|
-
icon:
|
|
1327
|
-
tooltip:
|
|
1323
|
+
shortcutKeys: i === "undo" ? ["mod", "Z"] : ["shift", "mod", "Z"],
|
|
1324
|
+
disabled: i === "undo" ? !t.can().undo() : !t.can().redo(),
|
|
1325
|
+
isActive: () => i === "undo" ? !t.can().undo() : !t.can().redo(),
|
|
1326
|
+
icon: i === "undo" ? "Undo2" : "Redo2",
|
|
1327
|
+
tooltip: n(`editor.${i}.tooltip`)
|
|
1328
1328
|
}
|
|
1329
1329
|
}))
|
|
1330
1330
|
};
|
|
@@ -1338,14 +1338,14 @@ const Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1338
1338
|
var e;
|
|
1339
1339
|
return {
|
|
1340
1340
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1341
|
-
button: ({ editor: t, t:
|
|
1341
|
+
button: ({ editor: t, t: n }) => ({
|
|
1342
1342
|
component: x,
|
|
1343
1343
|
componentProps: {
|
|
1344
1344
|
action: () => {
|
|
1345
1345
|
t.chain().focus().insertColumns({ cols: 2 }).run();
|
|
1346
1346
|
},
|
|
1347
1347
|
icon: "Columns",
|
|
1348
|
-
tooltip:
|
|
1348
|
+
tooltip: n("editor.columns.tooltip")
|
|
1349
1349
|
}
|
|
1350
1350
|
})
|
|
1351
1351
|
};
|
|
@@ -1371,7 +1371,7 @@ const Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1371
1371
|
}
|
|
1372
1372
|
});
|
|
1373
1373
|
function Ei(e) {
|
|
1374
|
-
const { t } = B(),
|
|
1374
|
+
const { t } = B(), n = P(() => [
|
|
1375
1375
|
{
|
|
1376
1376
|
name: "paragraph",
|
|
1377
1377
|
label: t("editor.paragraph.tooltip"),
|
|
@@ -1435,9 +1435,9 @@ function Ei(e) {
|
|
|
1435
1435
|
iconName: "Code2",
|
|
1436
1436
|
action: () => e.editor.chain().focus().clearNodes().toggleCodeBlock().run()
|
|
1437
1437
|
}
|
|
1438
|
-
], [e.editor, t]),
|
|
1438
|
+
], [e.editor, t]), i = P(() => n.findLast((a) => a.isActive()) ?? {
|
|
1439
1439
|
label: "Empty"
|
|
1440
|
-
}, [
|
|
1440
|
+
}, [n]);
|
|
1441
1441
|
return /* @__PURE__ */ m(Q, { children: [
|
|
1442
1442
|
/* @__PURE__ */ r(Y, { asChild: !0, children: /* @__PURE__ */ m(
|
|
1443
1443
|
V,
|
|
@@ -1447,7 +1447,7 @@ function Ei(e) {
|
|
|
1447
1447
|
children: [
|
|
1448
1448
|
/* @__PURE__ */ m("span", { className: "richtext-whitespace-nowrap richtext-text-sm richtext-font-normal", children: [
|
|
1449
1449
|
" ",
|
|
1450
|
-
|
|
1450
|
+
i == null ? void 0 : i.label
|
|
1451
1451
|
] }),
|
|
1452
1452
|
/* @__PURE__ */ r(Ie, { className: "richtext-size-4" })
|
|
1453
1453
|
]
|
|
@@ -1460,7 +1460,7 @@ function Ei(e) {
|
|
|
1460
1460
|
className: "richtext-w-full richtext-p-1",
|
|
1461
1461
|
hideWhenDetached: !0,
|
|
1462
1462
|
sideOffset: 5,
|
|
1463
|
-
children:
|
|
1463
|
+
children: n.map((a, o) => {
|
|
1464
1464
|
var c;
|
|
1465
1465
|
const s = Be[a.iconName];
|
|
1466
1466
|
return /* @__PURE__ */ r(
|
|
@@ -1510,24 +1510,24 @@ const Mi = N.create({
|
|
|
1510
1510
|
};
|
|
1511
1511
|
},
|
|
1512
1512
|
addProseMirrorPlugins() {
|
|
1513
|
-
const e = new Z(this.name), t = Object.entries(this.editor.schema.nodes).map(([,
|
|
1513
|
+
const e = new Z(this.name), t = Object.entries(this.editor.schema.nodes).map(([, n]) => n).filter((n) => this.options.notAfter.includes(n.name));
|
|
1514
1514
|
return [
|
|
1515
1515
|
new te({
|
|
1516
1516
|
key: e,
|
|
1517
|
-
appendTransaction: (
|
|
1517
|
+
appendTransaction: (n, i, a) => {
|
|
1518
1518
|
const { doc: o, tr: s, schema: c } = a, h = e.getState(a), d = o.content.size, l = c.nodes[this.options.node];
|
|
1519
1519
|
if (h)
|
|
1520
1520
|
return s.insert(d, l.create());
|
|
1521
1521
|
},
|
|
1522
1522
|
state: {
|
|
1523
|
-
init: (
|
|
1524
|
-
const a =
|
|
1523
|
+
init: (n, i) => {
|
|
1524
|
+
const a = i.tr.doc.lastChild;
|
|
1525
1525
|
return !Je({ node: a, types: t });
|
|
1526
1526
|
},
|
|
1527
|
-
apply: (
|
|
1528
|
-
if (!
|
|
1529
|
-
return
|
|
1530
|
-
const a =
|
|
1527
|
+
apply: (n, i) => {
|
|
1528
|
+
if (!n.docChanged)
|
|
1529
|
+
return i;
|
|
1530
|
+
const a = n.doc.lastChild;
|
|
1531
1531
|
return !Je({ node: a, types: t });
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
@@ -1540,9 +1540,9 @@ const Mi = N.create({
|
|
|
1540
1540
|
const e = [];
|
|
1541
1541
|
return this.options.document !== !1 && e.push(Li.configure()), this.options.placeholder !== !1 && e.push(
|
|
1542
1542
|
Ut.configure({
|
|
1543
|
-
placeholder: ({ node: t, pos:
|
|
1543
|
+
placeholder: ({ node: t, pos: n, editor: i }) => {
|
|
1544
1544
|
var a, o, s, c, h;
|
|
1545
|
-
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" ? `${A.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((h = t == null ? void 0 : t.type) == null ? void 0 : h.name) === "table" ? "" :
|
|
1545
|
+
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" ? `${A.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((h = t == null ? void 0 : t.type) == null ? void 0 : h.name) === "table" ? "" : i.extensionManager.extensions.some((d) => d.name === "slashCommand") ? A.t("editor.slash") : n === 0 ? A.t("editor.content") : A.t("editor.content");
|
|
1546
1546
|
},
|
|
1547
1547
|
...this.options.placeholder
|
|
1548
1548
|
})
|
|
@@ -1565,15 +1565,15 @@ const Mi = N.create({
|
|
|
1565
1565
|
var e;
|
|
1566
1566
|
return {
|
|
1567
1567
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1568
|
-
button: ({ editor: t, extension:
|
|
1569
|
-
const a =
|
|
1568
|
+
button: ({ editor: t, extension: n, t: i }) => {
|
|
1569
|
+
const a = n.options.subscript, o = n.options.superscript, s = {
|
|
1570
1570
|
component: x,
|
|
1571
1571
|
componentProps: {
|
|
1572
1572
|
action: () => t.commands.toggleSubscript(),
|
|
1573
1573
|
isActive: () => t.isActive("subscript") || !1,
|
|
1574
1574
|
disabled: !t.can().toggleSubscript(),
|
|
1575
1575
|
icon: "Subscript",
|
|
1576
|
-
tooltip:
|
|
1576
|
+
tooltip: i("editor.subscript.tooltip")
|
|
1577
1577
|
}
|
|
1578
1578
|
}, c = {
|
|
1579
1579
|
component: x,
|
|
@@ -1582,7 +1582,7 @@ const Mi = N.create({
|
|
|
1582
1582
|
isActive: () => t.isActive("superscript") || !1,
|
|
1583
1583
|
disabled: !t.can().toggleSuperscript(),
|
|
1584
1584
|
icon: "Superscript",
|
|
1585
|
-
tooltip:
|
|
1585
|
+
tooltip: i("editor.superscript.tooltip")
|
|
1586
1586
|
}
|
|
1587
1587
|
}, h = [];
|
|
1588
1588
|
return a !== !1 && h.push(s), o !== !1 && h.push(c), h;
|
|
@@ -1595,13 +1595,13 @@ const Mi = N.create({
|
|
|
1595
1595
|
}
|
|
1596
1596
|
});
|
|
1597
1597
|
function zi(e) {
|
|
1598
|
-
var
|
|
1598
|
+
var n;
|
|
1599
1599
|
const t = P(() => {
|
|
1600
1600
|
var o;
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
1603
|
-
...
|
|
1604
|
-
icon:
|
|
1601
|
+
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
1602
|
+
return i && !i.default ? {
|
|
1603
|
+
...i,
|
|
1604
|
+
icon: i != null && i.icon ? i == null ? void 0 : i.icon : e == null ? void 0 : e.icon
|
|
1605
1605
|
} : {
|
|
1606
1606
|
title: e.tooltip,
|
|
1607
1607
|
icon: e.icon,
|
|
@@ -1626,16 +1626,16 @@ function zi(e) {
|
|
|
1626
1626
|
)
|
|
1627
1627
|
}
|
|
1628
1628
|
),
|
|
1629
|
-
/* @__PURE__ */ r(X, { className: "w-full", children: (
|
|
1629
|
+
/* @__PURE__ */ r(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */ m(
|
|
1630
1630
|
ne,
|
|
1631
1631
|
{
|
|
1632
|
-
checked: t.title ===
|
|
1632
|
+
checked: t.title === i.title,
|
|
1633
1633
|
className: "richtext-flex richtext-items-center richtext-gap-3",
|
|
1634
|
-
onClick:
|
|
1634
|
+
onClick: i.action,
|
|
1635
1635
|
children: [
|
|
1636
|
-
/* @__PURE__ */ r(z, { name:
|
|
1637
|
-
/* @__PURE__ */ r("span", { className: "richtext-ml-1", children:
|
|
1638
|
-
!!(
|
|
1636
|
+
/* @__PURE__ */ r(z, { name: i == null ? void 0 : i.icon }),
|
|
1637
|
+
/* @__PURE__ */ r("span", { className: "richtext-ml-1", children: i.title }),
|
|
1638
|
+
!!(i != null && i.shortcutKeys) && /* @__PURE__ */ r("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: je(i.shortcutKeys) })
|
|
1639
1639
|
]
|
|
1640
1640
|
},
|
|
1641
1641
|
`more-mark-${a}`
|
|
@@ -1648,27 +1648,27 @@ const Ho = N.create({
|
|
|
1648
1648
|
var e;
|
|
1649
1649
|
return {
|
|
1650
1650
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1651
|
-
button({ editor: t, extension:
|
|
1652
|
-
const a =
|
|
1651
|
+
button({ editor: t, extension: n, t: i }) {
|
|
1652
|
+
const a = n.options.subscript, o = n.options.superscript, s = {
|
|
1653
1653
|
action: () => t.commands.toggleSubscript(),
|
|
1654
1654
|
isActive: () => t.isActive("subscript") || !1,
|
|
1655
1655
|
disabled: !t.can().toggleSubscript(),
|
|
1656
1656
|
icon: "Subscript",
|
|
1657
|
-
title:
|
|
1657
|
+
title: i("editor.subscript.tooltip"),
|
|
1658
1658
|
shortcutKeys: ["mod", "."]
|
|
1659
1659
|
}, c = {
|
|
1660
1660
|
action: () => t.commands.toggleSuperscript(),
|
|
1661
1661
|
isActive: () => t.isActive("superscript") || !1,
|
|
1662
1662
|
disabled: !t.can().toggleSuperscript(),
|
|
1663
1663
|
icon: "Superscript",
|
|
1664
|
-
title:
|
|
1664
|
+
title: i("editor.superscript.tooltip"),
|
|
1665
1665
|
shortcutKeys: ["mod", ","]
|
|
1666
1666
|
}, h = [];
|
|
1667
1667
|
return a !== !1 && h.push(s), o !== !1 && h.push(c), {
|
|
1668
1668
|
component: zi,
|
|
1669
1669
|
componentProps: {
|
|
1670
1670
|
icon: "Type",
|
|
1671
|
-
tooltip:
|
|
1671
|
+
tooltip: i("editor.moremark"),
|
|
1672
1672
|
disabled: !t.isEditable,
|
|
1673
1673
|
items: h
|
|
1674
1674
|
}
|
|
@@ -1689,7 +1689,7 @@ const Ho = N.create({
|
|
|
1689
1689
|
types: ["paragraph", "heading", "blockquote"],
|
|
1690
1690
|
minIndent: me.min,
|
|
1691
1691
|
maxIndent: me.max,
|
|
1692
|
-
button({ editor: t, t:
|
|
1692
|
+
button({ editor: t, t: n }) {
|
|
1693
1693
|
return [
|
|
1694
1694
|
{
|
|
1695
1695
|
component: x,
|
|
@@ -1699,7 +1699,7 @@ const Ho = N.create({
|
|
|
1699
1699
|
},
|
|
1700
1700
|
shortcutKeys: ["Tab"],
|
|
1701
1701
|
icon: "IndentIncrease",
|
|
1702
|
-
tooltip:
|
|
1702
|
+
tooltip: n("editor.indent.tooltip")
|
|
1703
1703
|
}
|
|
1704
1704
|
},
|
|
1705
1705
|
{
|
|
@@ -1710,7 +1710,7 @@ const Ho = N.create({
|
|
|
1710
1710
|
},
|
|
1711
1711
|
shortcutKeys: ["Shift", "Tab"],
|
|
1712
1712
|
icon: "IndentDecrease",
|
|
1713
|
-
tooltip:
|
|
1713
|
+
tooltip: n("editor.outdent.tooltip")
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
];
|
|
@@ -1757,9 +1757,9 @@ function Ri(e) {
|
|
|
1757
1757
|
return Number.parseFloat(e.replace("%", "")) / 100;
|
|
1758
1758
|
}
|
|
1759
1759
|
function Pi(e) {
|
|
1760
|
-
const { t } = B(), [
|
|
1760
|
+
const { t } = B(), [n, i] = v("default");
|
|
1761
1761
|
function a(s) {
|
|
1762
|
-
s === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(s),
|
|
1762
|
+
s === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(s), i(s);
|
|
1763
1763
|
}
|
|
1764
1764
|
const o = P(() => {
|
|
1765
1765
|
const h = e.editor.extensionManager.extensions.find(
|
|
@@ -1800,7 +1800,7 @@ function Pi(e) {
|
|
|
1800
1800
|
/* @__PURE__ */ r(X, { className: "richtext-min-w-24", children: o == null ? void 0 : o.map((s, c) => /* @__PURE__ */ r(
|
|
1801
1801
|
ne,
|
|
1802
1802
|
{
|
|
1803
|
-
checked: s.value ===
|
|
1803
|
+
checked: s.value === n,
|
|
1804
1804
|
onClick: () => a(s.value),
|
|
1805
1805
|
children: s.label
|
|
1806
1806
|
},
|
|
@@ -1810,11 +1810,11 @@ function Pi(e) {
|
|
|
1810
1810
|
}
|
|
1811
1811
|
const Ii = ["paragraph", "heading", "list_item", "todo_item"];
|
|
1812
1812
|
function Bi(e, t) {
|
|
1813
|
-
const { selection:
|
|
1814
|
-
if (!
|
|
1813
|
+
const { selection: n, doc: i } = e;
|
|
1814
|
+
if (!n || !i || !(n instanceof ot || n instanceof rn))
|
|
1815
1815
|
return e;
|
|
1816
|
-
const { from: a, to: o } =
|
|
1817
|
-
if (
|
|
1816
|
+
const { from: a, to: o } = n, s = [], c = t && t !== lt ? t : null;
|
|
1817
|
+
if (i.nodesBetween(a, o, (h, d) => {
|
|
1818
1818
|
const l = h.type;
|
|
1819
1819
|
return Ii.includes(l.name) ? ((h.attrs.lineHeight || null) !== c && s.push({
|
|
1820
1820
|
node: h,
|
|
@@ -1834,10 +1834,10 @@ function Bi(e, t) {
|
|
|
1834
1834
|
return e;
|
|
1835
1835
|
}
|
|
1836
1836
|
function ji(e) {
|
|
1837
|
-
return ({ state: t, dispatch:
|
|
1838
|
-
const { selection:
|
|
1837
|
+
return ({ state: t, dispatch: n }) => {
|
|
1838
|
+
const { selection: i } = t;
|
|
1839
1839
|
let { tr: a } = t;
|
|
1840
|
-
return a = a.setSelection(
|
|
1840
|
+
return a = a.setSelection(i), a = Bi(a, e), a.docChanged ? (n && n(a), !0) : !1;
|
|
1841
1841
|
};
|
|
1842
1842
|
}
|
|
1843
1843
|
const zo = N.create({
|
|
@@ -1849,12 +1849,12 @@ const zo = N.create({
|
|
|
1849
1849
|
types: ["paragraph", "heading", "list_item", "todo_item"],
|
|
1850
1850
|
lineHeights: Vn,
|
|
1851
1851
|
defaultHeight: lt,
|
|
1852
|
-
button({ editor: t, t:
|
|
1852
|
+
button({ editor: t, t: n }) {
|
|
1853
1853
|
return {
|
|
1854
1854
|
component: Pi,
|
|
1855
1855
|
componentProps: {
|
|
1856
1856
|
editor: t,
|
|
1857
|
-
tooltip:
|
|
1857
|
+
tooltip: n("editor.lineheight.tooltip")
|
|
1858
1858
|
}
|
|
1859
1859
|
};
|
|
1860
1860
|
}
|
|
@@ -1880,13 +1880,100 @@ const zo = N.create({
|
|
|
1880
1880
|
unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
|
|
1881
1881
|
};
|
|
1882
1882
|
}
|
|
1883
|
-
})
|
|
1883
|
+
});
|
|
1884
|
+
function Di(e, t) {
|
|
1885
|
+
var T, E;
|
|
1886
|
+
const [n, i] = v(0), [a, o] = v(0), s = G(null), { t: c } = B(), h = G([]);
|
|
1887
|
+
Pe(t, () => ({
|
|
1888
|
+
onKeyDown: d
|
|
1889
|
+
})), M(() => {
|
|
1890
|
+
if (!s.current)
|
|
1891
|
+
return;
|
|
1892
|
+
const g = a * 1e3 + n, b = h.current[g];
|
|
1893
|
+
b && b.scrollIntoView({
|
|
1894
|
+
behavior: "smooth",
|
|
1895
|
+
block: "nearest"
|
|
1896
|
+
});
|
|
1897
|
+
}, [n, a]);
|
|
1898
|
+
function d({ event: g }) {
|
|
1899
|
+
return g.key === "ArrowUp" ? (l(), !0) : g.key === "ArrowDown" ? (u(), !0) : g.key === "Enter" ? (f(), !0) : !1;
|
|
1900
|
+
}
|
|
1901
|
+
function l() {
|
|
1902
|
+
var k;
|
|
1903
|
+
if (e.items.length === 0)
|
|
1904
|
+
return !1;
|
|
1905
|
+
let g = n - 1, b = a;
|
|
1906
|
+
g < 0 && (b = a - 1, g = ((k = e.items[b]) == null ? void 0 : k.commands.length) - 1 || 0), b < 0 && (b = e.items.length - 1, g = e.items[b].commands.length - 1), i(g), o(b);
|
|
1907
|
+
}
|
|
1908
|
+
function u() {
|
|
1909
|
+
if (e.items.length === 0)
|
|
1910
|
+
return !1;
|
|
1911
|
+
const g = e.items[a].commands;
|
|
1912
|
+
let b = n + 1, k = a;
|
|
1913
|
+
g.length - 1 < b && (b = 0, k = a + 1), e.items.length - 1 < k && (k = 0), i(b), o(k);
|
|
1914
|
+
}
|
|
1915
|
+
function f() {
|
|
1916
|
+
if (e.items.length === 0 || a === -1 || n === -1)
|
|
1917
|
+
return !1;
|
|
1918
|
+
_(a, n);
|
|
1919
|
+
}
|
|
1920
|
+
function _(g, b) {
|
|
1921
|
+
const k = e.items[g].commands[b];
|
|
1922
|
+
e.command(k);
|
|
1923
|
+
}
|
|
1924
|
+
function w(g, b) {
|
|
1925
|
+
_(g, b);
|
|
1926
|
+
}
|
|
1927
|
+
function p(g, b, k) {
|
|
1928
|
+
h.current[g * 1e3 + b] = k;
|
|
1929
|
+
}
|
|
1930
|
+
return /* @__PURE__ */ r(
|
|
1931
|
+
"div",
|
|
1932
|
+
{
|
|
1933
|
+
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",
|
|
1934
|
+
ref: s,
|
|
1935
|
+
children: (T = e == null ? void 0 : e.items) != null && T.length ? /* @__PURE__ */ r("div", { className: "richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5", children: (E = e == null ? void 0 : e.items) == null ? void 0 : E.map((g, b) => /* @__PURE__ */ m(ze, { children: [
|
|
1936
|
+
/* @__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: g.title }),
|
|
1937
|
+
g.commands.map((k, H) => /* @__PURE__ */ m(
|
|
1938
|
+
"button",
|
|
1939
|
+
{
|
|
1940
|
+
onClick: () => w(b, H),
|
|
1941
|
+
ref: (L) => p(b, H, L),
|
|
1942
|
+
className: S("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm !richtext-text-neutral-800 dark:!richtext-text-neutral-200 richtext-text-left richtext-w-full richtext-rounded-sm richtext-outline-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ", {
|
|
1943
|
+
"slash-command-active": a === b && n === H
|
|
1944
|
+
}),
|
|
1945
|
+
children: [
|
|
1946
|
+
k.iconUrl && /* @__PURE__ */ r(
|
|
1947
|
+
"img",
|
|
1948
|
+
{
|
|
1949
|
+
alt: "",
|
|
1950
|
+
className: "richtext-size-6",
|
|
1951
|
+
src: k.iconUrl
|
|
1952
|
+
}
|
|
1953
|
+
),
|
|
1954
|
+
k.iconName && /* @__PURE__ */ r(
|
|
1955
|
+
z,
|
|
1956
|
+
{
|
|
1957
|
+
className: "!richtext-mr-1 !richtext-text-lg",
|
|
1958
|
+
name: k.iconName
|
|
1959
|
+
}
|
|
1960
|
+
),
|
|
1961
|
+
k.label
|
|
1962
|
+
]
|
|
1963
|
+
},
|
|
1964
|
+
`command-${H}`
|
|
1965
|
+
))
|
|
1966
|
+
] }, `slash-${g.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") }) })
|
|
1967
|
+
}
|
|
1968
|
+
);
|
|
1969
|
+
}
|
|
1970
|
+
const Oi = Re(Di), $i = {
|
|
1884
1971
|
setOpen: (e, t) => {
|
|
1885
1972
|
K(D.UPLOAD_VIDEO(e), t);
|
|
1886
1973
|
}
|
|
1887
1974
|
};
|
|
1888
|
-
function
|
|
1889
|
-
const
|
|
1975
|
+
function Fi(e, t) {
|
|
1976
|
+
const n = [
|
|
1890
1977
|
{
|
|
1891
1978
|
name: "format",
|
|
1892
1979
|
title: A.t("editor.slash.format"),
|
|
@@ -1899,196 +1986,110 @@ function Oi(e) {
|
|
|
1899
1986
|
}
|
|
1900
1987
|
];
|
|
1901
1988
|
return e.forEach((i) => {
|
|
1902
|
-
i.name.toLowerCase() === "heading" && i.options.levels.forEach((
|
|
1903
|
-
|
|
1904
|
-
name: `heading${
|
|
1905
|
-
label: A.t(`editor.heading.h${
|
|
1906
|
-
aliases: [`h${
|
|
1907
|
-
iconName: `Heading${
|
|
1908
|
-
action: ({ editor:
|
|
1909
|
-
|
|
1989
|
+
i.name.toLowerCase() === "heading" && i.options.levels.forEach((a) => {
|
|
1990
|
+
n[0].commands.push({
|
|
1991
|
+
name: `heading${a}`,
|
|
1992
|
+
label: A.t(`editor.heading.h${a}.tooltip`),
|
|
1993
|
+
aliases: [`h${a}`, "bt", `bt${a}`],
|
|
1994
|
+
iconName: `Heading${a}`,
|
|
1995
|
+
action: ({ editor: o, range: s }) => {
|
|
1996
|
+
o.chain().focus().deleteRange(s).setHeading({ level: a }).run();
|
|
1910
1997
|
}
|
|
1911
1998
|
});
|
|
1912
|
-
}), i.name.toLowerCase() === "bulletlist" &&
|
|
1999
|
+
}), i.name.toLowerCase() === "bulletlist" && n[0].commands.push({
|
|
1913
2000
|
name: "bulletList",
|
|
1914
2001
|
label: A.t("editor.bulletlist.tooltip"),
|
|
1915
2002
|
aliases: ["ul", "yxlb"],
|
|
1916
2003
|
iconName: "List",
|
|
1917
|
-
action: ({ editor:
|
|
1918
|
-
|
|
2004
|
+
action: ({ editor: a, range: o }) => {
|
|
2005
|
+
a.chain().focus().deleteRange(o).toggleBulletList().run();
|
|
1919
2006
|
}
|
|
1920
|
-
}), i.name.toLowerCase() === "orderedlist" &&
|
|
2007
|
+
}), i.name.toLowerCase() === "orderedlist" && n[0].commands.push({
|
|
1921
2008
|
name: "numberedList",
|
|
1922
2009
|
label: A.t("editor.orderedlist.tooltip"),
|
|
1923
2010
|
aliases: ["ol", "yxlb"],
|
|
1924
2011
|
iconName: "ListOrdered",
|
|
1925
|
-
action: ({ editor:
|
|
1926
|
-
|
|
2012
|
+
action: ({ editor: a, range: o }) => {
|
|
2013
|
+
a.chain().focus().deleteRange(o).toggleOrderedList().run();
|
|
1927
2014
|
}
|
|
1928
|
-
}), i.name.toLowerCase() === "tasklist" &&
|
|
2015
|
+
}), i.name.toLowerCase() === "tasklist" && n[0].commands.push({
|
|
1929
2016
|
name: "taskList",
|
|
1930
2017
|
label: A.t("editor.tasklist.tooltip"),
|
|
1931
2018
|
iconName: "ListTodo",
|
|
1932
2019
|
description: "Task list with todo items",
|
|
1933
2020
|
aliases: ["todo"],
|
|
1934
|
-
action: ({ editor:
|
|
1935
|
-
|
|
2021
|
+
action: ({ editor: a, range: o }) => {
|
|
2022
|
+
a.chain().focus().deleteRange(o).toggleTaskList().run();
|
|
1936
2023
|
}
|
|
1937
|
-
}), i.name.toLowerCase() === "blockquote" &&
|
|
2024
|
+
}), i.name.toLowerCase() === "blockquote" && n[0].commands.push({
|
|
1938
2025
|
name: "blockquote",
|
|
1939
2026
|
label: A.t("editor.blockquote.tooltip"),
|
|
1940
2027
|
description: "插入引入格式",
|
|
1941
2028
|
aliases: ["yr"],
|
|
1942
2029
|
iconName: "TextQuote",
|
|
1943
|
-
action: ({ editor:
|
|
1944
|
-
|
|
2030
|
+
action: ({ editor: a, range: o }) => {
|
|
2031
|
+
a.chain().focus().deleteRange(o).setBlockquote().run();
|
|
1945
2032
|
}
|
|
1946
|
-
}), i.name.toLowerCase() === "codeblock" &&
|
|
2033
|
+
}), i.name.toLowerCase() === "codeblock" && n[0].commands.push({
|
|
1947
2034
|
name: "codeBlock",
|
|
1948
2035
|
label: A.t("editor.codeblock.tooltip"),
|
|
1949
2036
|
iconName: "Code2",
|
|
1950
2037
|
description: "Code block with syntax highlighting",
|
|
1951
|
-
shouldBeHidden: (
|
|
1952
|
-
action: ({ editor:
|
|
1953
|
-
|
|
2038
|
+
shouldBeHidden: (a) => a.isActive("columns"),
|
|
2039
|
+
action: ({ editor: a, range: o }) => {
|
|
2040
|
+
a.chain().focus().deleteRange(o).setCodeBlock().run();
|
|
1954
2041
|
}
|
|
1955
|
-
}), i.name.toLowerCase() === Mn.name &&
|
|
2042
|
+
}), i.name.toLowerCase() === Mn.name && n[1].commands.push({
|
|
1956
2043
|
name: "image",
|
|
1957
2044
|
label: A.t("editor.image.tooltip"),
|
|
1958
2045
|
iconName: "ImageUp",
|
|
1959
2046
|
description: "Insert a image",
|
|
1960
2047
|
aliases: ["image", "tp", "tupian"],
|
|
1961
|
-
shouldBeHidden: (
|
|
1962
|
-
action: ({ editor:
|
|
1963
|
-
|
|
2048
|
+
shouldBeHidden: (a) => a.isActive("columns"),
|
|
2049
|
+
action: ({ editor: a, range: o }) => {
|
|
2050
|
+
a.chain().focus().deleteRange(o).run(), zn.setOpen(a.id, !0);
|
|
1964
2051
|
}
|
|
1965
|
-
}), i.name.toLowerCase() === Rn.name &&
|
|
2052
|
+
}), i.name.toLowerCase() === Rn.name && n[1].commands.push({
|
|
1966
2053
|
name: "video",
|
|
1967
2054
|
label: A.t("editor.video.tooltip"),
|
|
1968
2055
|
iconName: "Video",
|
|
1969
2056
|
description: "Insert a video",
|
|
1970
2057
|
aliases: ["video", "sp", "shipin"],
|
|
1971
|
-
shouldBeHidden: (
|
|
1972
|
-
action: ({ editor:
|
|
1973
|
-
|
|
2058
|
+
shouldBeHidden: (a) => a.isActive("columns"),
|
|
2059
|
+
action: ({ editor: a, range: o }) => {
|
|
2060
|
+
a.chain().focus().deleteRange(o).run(), $i.setOpen(a.id, !0);
|
|
1974
2061
|
}
|
|
1975
|
-
}), i.name.toLowerCase() === "table" &&
|
|
2062
|
+
}), i.name.toLowerCase() === "table" && n[1].commands.push({
|
|
1976
2063
|
name: "table",
|
|
1977
2064
|
label: A.t("editor.table.tooltip"),
|
|
1978
2065
|
iconName: "Table",
|
|
1979
2066
|
description: "Insert a table",
|
|
1980
2067
|
aliases: ["table", "bg", "biaoge", "biao"],
|
|
1981
|
-
shouldBeHidden: (
|
|
1982
|
-
action: ({ editor:
|
|
1983
|
-
|
|
2068
|
+
shouldBeHidden: (a) => a.isActive("columns"),
|
|
2069
|
+
action: ({ editor: a, range: o }) => {
|
|
2070
|
+
a.chain().focus().deleteRange(o).insertTable({ rows: 3, cols: 3, withHeaderRow: !1 }).run();
|
|
1984
2071
|
}
|
|
1985
|
-
}), i.name.toLowerCase() === "horizontalrule" &&
|
|
2072
|
+
}), i.name.toLowerCase() === "horizontalrule" && n[1].commands.push({
|
|
1986
2073
|
name: "horizontalRule",
|
|
1987
2074
|
label: A.t("editor.horizontalrule.tooltip"),
|
|
1988
2075
|
iconName: "Minus",
|
|
1989
2076
|
description: "Insert a horizontal divider",
|
|
1990
2077
|
aliases: ["hr", "fgx", "fg"],
|
|
1991
|
-
action: ({ editor:
|
|
1992
|
-
|
|
2078
|
+
action: ({ editor: a, range: o }) => {
|
|
2079
|
+
a.chain().focus().deleteRange(o).setHorizontalRule().run();
|
|
1993
2080
|
}
|
|
1994
|
-
}), i.name.toLowerCase() === "columns" &&
|
|
2081
|
+
}), i.name.toLowerCase() === "columns" && n[1].commands.push({
|
|
1995
2082
|
name: "columns",
|
|
1996
2083
|
label: A.t("editor.columns.tooltip"),
|
|
1997
2084
|
iconName: "Columns2",
|
|
1998
2085
|
description: "Add two column content",
|
|
1999
|
-
action: ({ editor:
|
|
2000
|
-
|
|
2086
|
+
action: ({ editor: a }) => {
|
|
2087
|
+
a.chain().focus().insertColumns({ cols: 2 }).run();
|
|
2001
2088
|
}
|
|
2002
|
-
});
|
|
2003
|
-
}),
|
|
2089
|
+
}), t == null || t(i, n);
|
|
2090
|
+
}), n;
|
|
2004
2091
|
}
|
|
2005
|
-
|
|
2006
|
-
var T, E;
|
|
2007
|
-
const [i, n] = v(0), [a, o] = v(0), s = G(null), { t: c } = B(), h = G([]);
|
|
2008
|
-
Pe(t, () => ({
|
|
2009
|
-
onKeyDown: d
|
|
2010
|
-
})), M(() => {
|
|
2011
|
-
if (!s.current)
|
|
2012
|
-
return;
|
|
2013
|
-
const g = a * 1e3 + i, b = h.current[g];
|
|
2014
|
-
b && b.scrollIntoView({
|
|
2015
|
-
behavior: "smooth",
|
|
2016
|
-
block: "nearest"
|
|
2017
|
-
});
|
|
2018
|
-
}, [i, a]);
|
|
2019
|
-
function d({ event: g }) {
|
|
2020
|
-
return g.key === "ArrowUp" ? (l(), !0) : g.key === "ArrowDown" ? (u(), !0) : g.key === "Enter" ? (f(), !0) : !1;
|
|
2021
|
-
}
|
|
2022
|
-
function l() {
|
|
2023
|
-
var k;
|
|
2024
|
-
if (e.items.length === 0)
|
|
2025
|
-
return !1;
|
|
2026
|
-
let g = i - 1, b = a;
|
|
2027
|
-
g < 0 && (b = a - 1, g = ((k = e.items[b]) == null ? void 0 : k.commands.length) - 1 || 0), b < 0 && (b = e.items.length - 1, g = e.items[b].commands.length - 1), n(g), o(b);
|
|
2028
|
-
}
|
|
2029
|
-
function u() {
|
|
2030
|
-
if (e.items.length === 0)
|
|
2031
|
-
return !1;
|
|
2032
|
-
const g = e.items[a].commands;
|
|
2033
|
-
let b = i + 1, k = a;
|
|
2034
|
-
g.length - 1 < b && (b = 0, k = a + 1), e.items.length - 1 < k && (k = 0), n(b), o(k);
|
|
2035
|
-
}
|
|
2036
|
-
function f() {
|
|
2037
|
-
if (e.items.length === 0 || a === -1 || i === -1)
|
|
2038
|
-
return !1;
|
|
2039
|
-
_(a, i);
|
|
2040
|
-
}
|
|
2041
|
-
function _(g, b) {
|
|
2042
|
-
const k = e.items[g].commands[b];
|
|
2043
|
-
e.command(k);
|
|
2044
|
-
}
|
|
2045
|
-
function p(g, b) {
|
|
2046
|
-
_(g, b);
|
|
2047
|
-
}
|
|
2048
|
-
function w(g, b, k) {
|
|
2049
|
-
h.current[g * 1e3 + b] = k;
|
|
2050
|
-
}
|
|
2051
|
-
return /* @__PURE__ */ r(
|
|
2052
|
-
"div",
|
|
2053
|
-
{
|
|
2054
|
-
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",
|
|
2055
|
-
ref: s,
|
|
2056
|
-
children: (T = e == null ? void 0 : e.items) != null && T.length ? /* @__PURE__ */ r("div", { className: "richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5", children: (E = e == null ? void 0 : e.items) == null ? void 0 : E.map((g, b) => /* @__PURE__ */ m(ze, { children: [
|
|
2057
|
-
/* @__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: g.title }),
|
|
2058
|
-
g.commands.map((k, H) => /* @__PURE__ */ m(
|
|
2059
|
-
"button",
|
|
2060
|
-
{
|
|
2061
|
-
onClick: () => p(b, H),
|
|
2062
|
-
ref: (L) => w(b, H, L),
|
|
2063
|
-
className: S("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm !richtext-text-neutral-800 dark:!richtext-text-neutral-200 richtext-text-left richtext-w-full richtext-rounded-sm richtext-outline-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ", {
|
|
2064
|
-
"slash-command-active": a === b && i === H
|
|
2065
|
-
}),
|
|
2066
|
-
children: [
|
|
2067
|
-
k.iconUrl && /* @__PURE__ */ r(
|
|
2068
|
-
"img",
|
|
2069
|
-
{
|
|
2070
|
-
alt: "",
|
|
2071
|
-
className: "richtext-size-6",
|
|
2072
|
-
src: k.iconUrl
|
|
2073
|
-
}
|
|
2074
|
-
),
|
|
2075
|
-
k.iconName && /* @__PURE__ */ r(
|
|
2076
|
-
z,
|
|
2077
|
-
{
|
|
2078
|
-
className: "!richtext-mr-1 !richtext-text-lg",
|
|
2079
|
-
name: k.iconName
|
|
2080
|
-
}
|
|
2081
|
-
),
|
|
2082
|
-
k.label
|
|
2083
|
-
]
|
|
2084
|
-
},
|
|
2085
|
-
`command-${H}`
|
|
2086
|
-
))
|
|
2087
|
-
] }, `slash-${g.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") }) })
|
|
2088
|
-
}
|
|
2089
|
-
);
|
|
2090
|
-
}
|
|
2091
|
-
const Fi = Re($i), q = "slashCommand";
|
|
2092
|
+
const q = "slashCommand";
|
|
2092
2093
|
let y;
|
|
2093
2094
|
const Ro = N.create({
|
|
2094
2095
|
name: q,
|
|
@@ -2122,16 +2123,16 @@ const Ro = N.create({
|
|
|
2122
2123
|
pluginKey: new Z(q),
|
|
2123
2124
|
allow: ({ state: e, range: t }) => {
|
|
2124
2125
|
var d, l, u;
|
|
2125
|
-
const
|
|
2126
|
-
Math.max(0, (l =
|
|
2126
|
+
const n = e.doc.resolve(t.from), i = n.depth === 1, a = n.parent.type.name === "paragraph", o = ((d = n.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", s = this.editor.isActive("column"), c = (u = n.parent.textContent) == null ? void 0 : u.slice(
|
|
2127
|
+
Math.max(0, (l = n.parent.textContent) == null ? void 0 : l.indexOf("/"))
|
|
2127
2128
|
), h = !(c != null && c.endsWith(" "));
|
|
2128
|
-
return (
|
|
2129
|
+
return (i && a && o || s && a && o) && h;
|
|
2129
2130
|
},
|
|
2130
|
-
command: ({ editor: e, range: t, props:
|
|
2131
|
-
const { view:
|
|
2132
|
-
|
|
2131
|
+
command: ({ editor: e, range: t, props: n }) => {
|
|
2132
|
+
const { view: i } = e;
|
|
2133
|
+
n.action({ editor: e, range: t }), i.focus();
|
|
2133
2134
|
},
|
|
2134
|
-
items: ({ query: e, editor: t }) =>
|
|
2135
|
+
items: ({ query: e, editor: t }) => Fi(t.extensionManager.extensions, this.options.renderGroupItem).map((s) => ({
|
|
2135
2136
|
...s,
|
|
2136
2137
|
commands: s.commands.filter((c) => {
|
|
2137
2138
|
const h = c.label.toLowerCase().trim(), d = e.toLowerCase().trim();
|
|
@@ -2153,18 +2154,18 @@ const Ro = N.create({
|
|
|
2153
2154
|
render: () => {
|
|
2154
2155
|
let e, t = null;
|
|
2155
2156
|
return {
|
|
2156
|
-
onStart: (
|
|
2157
|
+
onStart: (n) => {
|
|
2157
2158
|
var o;
|
|
2158
|
-
e = new Me(
|
|
2159
|
-
props:
|
|
2160
|
-
editor:
|
|
2159
|
+
e = new Me(Oi, {
|
|
2160
|
+
props: n,
|
|
2161
|
+
editor: n.editor
|
|
2161
2162
|
});
|
|
2162
|
-
const { view:
|
|
2163
|
-
if (!
|
|
2164
|
-
return
|
|
2165
|
-
const s =
|
|
2163
|
+
const { view: i } = n.editor, a = () => {
|
|
2164
|
+
if (!n.clientRect)
|
|
2165
|
+
return n.editor.storage[q].rect;
|
|
2166
|
+
const s = n.clientRect();
|
|
2166
2167
|
if (!s)
|
|
2167
|
-
return
|
|
2168
|
+
return n.editor.storage[q].rect;
|
|
2168
2169
|
let c = s.y;
|
|
2169
2170
|
if (s.top + e.element.offsetHeight + 40 > window.innerHeight) {
|
|
2170
2171
|
const h = s.top + e.element.offsetHeight - window.innerHeight + 40;
|
|
@@ -2176,26 +2177,26 @@ const Ro = N.create({
|
|
|
2176
2177
|
y == null || y[0].setProps({
|
|
2177
2178
|
getReferenceClientRect: a
|
|
2178
2179
|
});
|
|
2179
|
-
}, (o =
|
|
2180
|
+
}, (o = i.dom.parentElement) == null || o.addEventListener("scroll", t), y == null || y[0].setProps({
|
|
2180
2181
|
getReferenceClientRect: a,
|
|
2181
2182
|
appendTo: () => document.body,
|
|
2182
2183
|
content: e.element
|
|
2183
2184
|
}), y == null || y[0].show();
|
|
2184
2185
|
},
|
|
2185
|
-
onUpdate(
|
|
2186
|
+
onUpdate(n) {
|
|
2186
2187
|
var s;
|
|
2187
|
-
e.updateProps(
|
|
2188
|
-
const { view:
|
|
2189
|
-
if (!
|
|
2190
|
-
return
|
|
2191
|
-
const c =
|
|
2192
|
-
return c ? new DOMRect(c.x, c.y, c.width, c.height) :
|
|
2188
|
+
e.updateProps(n);
|
|
2189
|
+
const { view: i } = n.editor, a = () => {
|
|
2190
|
+
if (!n.clientRect)
|
|
2191
|
+
return n.editor.storage[q].rect;
|
|
2192
|
+
const c = n.clientRect();
|
|
2193
|
+
return c ? new DOMRect(c.x, c.y, c.width, c.height) : n.editor.storage[q].rect;
|
|
2193
2194
|
}, o = () => {
|
|
2194
2195
|
y == null || y[0].setProps({
|
|
2195
2196
|
getReferenceClientRect: a
|
|
2196
2197
|
});
|
|
2197
2198
|
};
|
|
2198
|
-
(s =
|
|
2199
|
+
(s = i.dom.parentElement) == null || s.addEventListener("scroll", o), n.editor.storage[q].rect = n.clientRect ? a() : {
|
|
2199
2200
|
width: 0,
|
|
2200
2201
|
height: 0,
|
|
2201
2202
|
left: 0,
|
|
@@ -2206,15 +2207,15 @@ const Ro = N.create({
|
|
|
2206
2207
|
getReferenceClientRect: a
|
|
2207
2208
|
});
|
|
2208
2209
|
},
|
|
2209
|
-
onKeyDown(
|
|
2210
|
-
var
|
|
2211
|
-
return
|
|
2210
|
+
onKeyDown(n) {
|
|
2211
|
+
var i;
|
|
2212
|
+
return n.event.key === "Escape" ? (y == null || y[0].hide(), !0) : (y != null && y[0].state.isShown || y == null || y[0].show(), (i = e.ref) == null ? void 0 : i.onKeyDown(n));
|
|
2212
2213
|
},
|
|
2213
|
-
onExit(
|
|
2214
|
-
var
|
|
2214
|
+
onExit(n) {
|
|
2215
|
+
var i;
|
|
2215
2216
|
if (y == null || y[0].hide(), t) {
|
|
2216
|
-
const { view: a } =
|
|
2217
|
-
(
|
|
2217
|
+
const { view: a } = n.editor;
|
|
2218
|
+
(i = a.dom.parentElement) == null || i.removeEventListener("scroll", t);
|
|
2218
2219
|
}
|
|
2219
2220
|
e.destroy();
|
|
2220
2221
|
}
|
|
@@ -2236,28 +2237,28 @@ const Ro = N.create({
|
|
|
2236
2237
|
};
|
|
2237
2238
|
}
|
|
2238
2239
|
});
|
|
2239
|
-
function Ui(e, t,
|
|
2240
|
+
function Ui(e, t, n) {
|
|
2240
2241
|
if (!e.doc)
|
|
2241
2242
|
return e;
|
|
2242
|
-
const
|
|
2243
|
-
if (!
|
|
2243
|
+
const i = e.doc.nodeAt(t);
|
|
2244
|
+
if (!i || n === i.attrs.backgroundColor)
|
|
2244
2245
|
return e;
|
|
2245
2246
|
const a = {
|
|
2246
|
-
...
|
|
2247
|
-
backgroundColor:
|
|
2247
|
+
...i.attrs,
|
|
2248
|
+
backgroundColor: n
|
|
2248
2249
|
};
|
|
2249
|
-
return e.setNodeMarkup(t,
|
|
2250
|
+
return e.setNodeMarkup(t, i.type, a, i.marks);
|
|
2250
2251
|
}
|
|
2251
|
-
function qi(e, t,
|
|
2252
|
-
const { doc:
|
|
2253
|
-
return !
|
|
2254
|
-
e = Ui(e, s,
|
|
2252
|
+
function qi(e, t, n) {
|
|
2253
|
+
const { doc: i, selection: a } = e;
|
|
2254
|
+
return !i || !a || !(a instanceof sn) || a.forEachCell((o, s) => {
|
|
2255
|
+
e = Ui(e, s, n);
|
|
2255
2256
|
}), e;
|
|
2256
2257
|
}
|
|
2257
2258
|
function Qe(e, t) {
|
|
2258
|
-
return ({ tr:
|
|
2259
|
-
const { selection: o } =
|
|
2260
|
-
return
|
|
2259
|
+
return ({ tr: n, state: i, dispatch: a }) => {
|
|
2260
|
+
const { selection: o } = i;
|
|
2261
|
+
return n = n.setSelection(o), n = qi(n, t, e), n.docChanged ? (a == null || a(n), !0) : !1;
|
|
2261
2262
|
};
|
|
2262
2263
|
}
|
|
2263
2264
|
const Ki = N.create({
|
|
@@ -2294,10 +2295,10 @@ function Ye(e = {}) {
|
|
|
2294
2295
|
let t = e.ua || typeof navigator < "u" && navigator.userAgent;
|
|
2295
2296
|
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(Vi.test(t) && !Wi.test(t) || e.tablet && Gi.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
|
|
2296
2297
|
}
|
|
2297
|
-
const Xe = (e) => Array.from({ length: e }).map((t,
|
|
2298
|
+
const Xe = (e) => Array.from({ length: e }).map((t, n) => n + 1);
|
|
2298
2299
|
function Zi(e) {
|
|
2299
2300
|
var l;
|
|
2300
|
-
const [t,
|
|
2301
|
+
const [t, n] = v(!0), [i, a] = v({
|
|
2301
2302
|
rows: Ye() ? fe : _e,
|
|
2302
2303
|
cols: Ye() ? fe : _e
|
|
2303
2304
|
}), [o, s] = v({
|
|
@@ -2305,10 +2306,10 @@ function Zi(e) {
|
|
|
2305
2306
|
cols: ge
|
|
2306
2307
|
});
|
|
2307
2308
|
function c(u, f) {
|
|
2308
|
-
u ===
|
|
2309
|
+
u === i.rows && a((_) => ({
|
|
2309
2310
|
..._,
|
|
2310
2311
|
rows: Math.min(u + 1, fe)
|
|
2311
|
-
})), f ===
|
|
2312
|
+
})), f === i.cols && a((_) => ({
|
|
2312
2313
|
..._,
|
|
2313
2314
|
cols: Math.min(f + 1, fe)
|
|
2314
2315
|
})), s({
|
|
@@ -2320,7 +2321,7 @@ function Zi(e) {
|
|
|
2320
2321
|
e == null || e.createTable({ rows: u, cols: f, withHeaderRow: t }), d();
|
|
2321
2322
|
}
|
|
2322
2323
|
function d() {
|
|
2323
|
-
|
|
2324
|
+
n(!1), a({
|
|
2324
2325
|
rows: _e,
|
|
2325
2326
|
cols: _e
|
|
2326
2327
|
}), s({
|
|
@@ -2337,13 +2338,13 @@ function Zi(e) {
|
|
|
2337
2338
|
className: "richtext-w-full !richtext-p-2",
|
|
2338
2339
|
side: "bottom",
|
|
2339
2340
|
children: /* @__PURE__ */ m("div", { className: "table-grid-size-editor richtext-p-0", children: [
|
|
2340
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (l = Xe(
|
|
2341
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (l = Xe(i == null ? void 0 : i.rows)) == null ? void 0 : l.map((u) => {
|
|
2341
2342
|
var f;
|
|
2342
2343
|
return /* @__PURE__ */ r(
|
|
2343
2344
|
"div",
|
|
2344
2345
|
{
|
|
2345
2346
|
className: "richtext-flex richtext-gap-1",
|
|
2346
|
-
children: (f = Xe(
|
|
2347
|
+
children: (f = Xe(i == null ? void 0 : i.cols)) == null ? void 0 : f.map((_) => /* @__PURE__ */ r(
|
|
2347
2348
|
"div",
|
|
2348
2349
|
{
|
|
2349
2350
|
onMouseDown: () => h(u, _),
|
|
@@ -2369,8 +2370,8 @@ function Zi(e) {
|
|
|
2369
2370
|
] });
|
|
2370
2371
|
}
|
|
2371
2372
|
function Ji(e) {
|
|
2372
|
-
function t(
|
|
2373
|
-
e.disabled || e.editor.chain().focus().insertTable({ ...
|
|
2373
|
+
function t(n) {
|
|
2374
|
+
e.disabled || e.editor.chain().focus().insertTable({ ...n, withHeaderRow: !1 }).run();
|
|
2374
2375
|
}
|
|
2375
2376
|
return /* @__PURE__ */ r(Zi, { createTable: t, children: /* @__PURE__ */ r(
|
|
2376
2377
|
x,
|
|
@@ -2392,12 +2393,12 @@ const Po = Xt.extend({
|
|
|
2392
2393
|
resizable: !0,
|
|
2393
2394
|
lastColumnResizable: !0,
|
|
2394
2395
|
allowTableNodeSelection: !1,
|
|
2395
|
-
button: ({ editor: t, t:
|
|
2396
|
+
button: ({ editor: t, t: n }) => ({
|
|
2396
2397
|
component: Ji,
|
|
2397
2398
|
componentProps: {
|
|
2398
2399
|
disabled: t.isActive("table") || !1,
|
|
2399
2400
|
icon: "Table",
|
|
2400
|
-
tooltip:
|
|
2401
|
+
tooltip: n("editor.table.tooltip"),
|
|
2401
2402
|
editor: t
|
|
2402
2403
|
}
|
|
2403
2404
|
})
|
|
@@ -2417,14 +2418,14 @@ const Po = Xt.extend({
|
|
|
2417
2418
|
var e;
|
|
2418
2419
|
return {
|
|
2419
2420
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2420
|
-
button: ({ editor: t, t:
|
|
2421
|
+
button: ({ editor: t, t: n }) => ({
|
|
2421
2422
|
component: x,
|
|
2422
2423
|
componentProps: {
|
|
2423
2424
|
action: () => {
|
|
2424
2425
|
t.commands.setPainter(t == null ? void 0 : t.state.selection.$head.marks());
|
|
2425
2426
|
},
|
|
2426
2427
|
icon: "PaintRoller",
|
|
2427
|
-
tooltip:
|
|
2428
|
+
tooltip: n("editor.format")
|
|
2428
2429
|
}
|
|
2429
2430
|
})
|
|
2430
2431
|
};
|
|
@@ -2434,12 +2435,12 @@ const Po = Xt.extend({
|
|
|
2434
2435
|
setPainter: (e) => ({
|
|
2435
2436
|
view: {
|
|
2436
2437
|
dispatch: t,
|
|
2437
|
-
state: { tr:
|
|
2438
|
-
dom:
|
|
2438
|
+
state: { tr: n },
|
|
2439
|
+
dom: i
|
|
2439
2440
|
}
|
|
2440
2441
|
}) => {
|
|
2441
2442
|
const s = `url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;
|
|
2442
|
-
return
|
|
2443
|
+
return i.style.cursor = s, t(n.setMeta("painterAction", { type: "start", marks: e })), !0;
|
|
2443
2444
|
}
|
|
2444
2445
|
};
|
|
2445
2446
|
},
|
|
@@ -2450,8 +2451,8 @@ const Po = Xt.extend({
|
|
|
2450
2451
|
state: {
|
|
2451
2452
|
init: () => [],
|
|
2452
2453
|
apply: (e, t) => {
|
|
2453
|
-
const
|
|
2454
|
-
return
|
|
2454
|
+
const n = e.getMeta("painterAction");
|
|
2455
|
+
return n && n.type === "start" ? t = n.marks : n && n.type === "end" && (t = []), t;
|
|
2455
2456
|
}
|
|
2456
2457
|
},
|
|
2457
2458
|
props: {
|
|
@@ -2460,19 +2461,19 @@ const Po = Xt.extend({
|
|
|
2460
2461
|
const t = this.getState(e.state);
|
|
2461
2462
|
if (!t || t.length === 0)
|
|
2462
2463
|
return e.dom.style.cursor = "", !1;
|
|
2463
|
-
const
|
|
2464
|
-
document.removeEventListener("mouseup",
|
|
2464
|
+
const n = () => {
|
|
2465
|
+
document.removeEventListener("mouseup", n);
|
|
2465
2466
|
let {
|
|
2466
|
-
dispatch:
|
|
2467
|
+
dispatch: i,
|
|
2467
2468
|
state: { tr: a, selection: o },
|
|
2468
2469
|
dom: s
|
|
2469
2470
|
} = e;
|
|
2470
2471
|
s.style.cursor = "", a = a.removeMark(o.from, o.to);
|
|
2471
2472
|
for (const c of t)
|
|
2472
2473
|
c.type.name !== "link" && (a = a.addMark(o.from, o.to, c));
|
|
2473
|
-
|
|
2474
|
+
i(a.setMeta("painterAction", { type: "end" }));
|
|
2474
2475
|
};
|
|
2475
|
-
return document.addEventListener("mouseup",
|
|
2476
|
+
return document.addEventListener("mouseup", n), !0;
|
|
2476
2477
|
}
|
|
2477
2478
|
}
|
|
2478
2479
|
}
|
|
@@ -2481,7 +2482,7 @@ const Po = Xt.extend({
|
|
|
2481
2482
|
}
|
|
2482
2483
|
});
|
|
2483
2484
|
function Qi({ editor: e, ...t }) {
|
|
2484
|
-
const { t:
|
|
2485
|
+
const { t: n } = B(), [i, a] = v(-1), [o, s] = v([]), [c, h] = v(""), [d, l] = v(""), [u, f] = v(!1), [_, w] = v(!1);
|
|
2485
2486
|
return M(() => {
|
|
2486
2487
|
u || (h(""), l(""), a(-1), s([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
|
|
2487
2488
|
}, [e, u]), M(() => {
|
|
@@ -2491,17 +2492,17 @@ function Qi({ editor: e, ...t }) {
|
|
|
2491
2492
|
}, [u, d, e]), M(() => {
|
|
2492
2493
|
if (!e)
|
|
2493
2494
|
return;
|
|
2494
|
-
const
|
|
2495
|
-
if (!
|
|
2495
|
+
const p = e.extensionManager.extensions.find((E) => E.name === na.name);
|
|
2496
|
+
if (!p)
|
|
2496
2497
|
return;
|
|
2497
2498
|
const T = () => {
|
|
2498
2499
|
if (!u)
|
|
2499
2500
|
return;
|
|
2500
|
-
const E =
|
|
2501
|
+
const E = p ? p.storage.currentIndex : -1, g = p ? p.storage.results : [];
|
|
2501
2502
|
a((b) => b !== E ? E : b), s((b) => cn(b, g) ? b : g);
|
|
2502
2503
|
};
|
|
2503
2504
|
return Ve(D.SEARCH_REPLCE, T), () => {
|
|
2504
|
-
|
|
2505
|
+
p && Ve(D.SEARCH_REPLCE, T);
|
|
2505
2506
|
};
|
|
2506
2507
|
}, [u, e]), /* @__PURE__ */ m(
|
|
2507
2508
|
ie,
|
|
@@ -2534,8 +2535,8 @@ function Qi({ editor: e, ...t }) {
|
|
|
2534
2535
|
side: "bottom",
|
|
2535
2536
|
children: [
|
|
2536
2537
|
/* @__PURE__ */ m("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
|
|
2537
|
-
/* @__PURE__ */ r(Ne, { children:
|
|
2538
|
-
/* @__PURE__ */ r("span", { className: "richtext-font-semibold", children: o.length > 0 ? `${
|
|
2538
|
+
/* @__PURE__ */ r(Ne, { children: n("editor.search.dialog.text") }),
|
|
2539
|
+
/* @__PURE__ */ r("span", { className: "richtext-font-semibold", children: o.length > 0 ? `${i + 1}/${o.length}` : "0/0" })
|
|
2539
2540
|
] }),
|
|
2540
2541
|
/* @__PURE__ */ m("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: [
|
|
2541
2542
|
/* @__PURE__ */ r(
|
|
@@ -2543,7 +2544,7 @@ function Qi({ editor: e, ...t }) {
|
|
|
2543
2544
|
{
|
|
2544
2545
|
autoFocus: !0,
|
|
2545
2546
|
className: "richtext-w-full",
|
|
2546
|
-
onChange: (
|
|
2547
|
+
onChange: (p) => h(p.target.value),
|
|
2547
2548
|
placeholder: "Text",
|
|
2548
2549
|
required: !0,
|
|
2549
2550
|
type: "text",
|
|
@@ -2569,12 +2570,12 @@ function Qi({ editor: e, ...t }) {
|
|
|
2569
2570
|
}
|
|
2570
2571
|
)
|
|
2571
2572
|
] }),
|
|
2572
|
-
/* @__PURE__ */ r(Ne, { className: "richtext-mb-[6px]", children:
|
|
2573
|
+
/* @__PURE__ */ r(Ne, { className: "richtext-mb-[6px]", children: n("editor.replace.dialog.text") }),
|
|
2573
2574
|
/* @__PURE__ */ r("div", { className: "richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ r(
|
|
2574
2575
|
We,
|
|
2575
2576
|
{
|
|
2576
2577
|
className: "richtext-w-80",
|
|
2577
|
-
onChange: (
|
|
2578
|
+
onChange: (p) => l(p.target.value),
|
|
2578
2579
|
placeholder: "Text",
|
|
2579
2580
|
required: !0,
|
|
2580
2581
|
type: "text",
|
|
@@ -2586,12 +2587,12 @@ function Qi({ editor: e, ...t }) {
|
|
|
2586
2587
|
Pn,
|
|
2587
2588
|
{
|
|
2588
2589
|
checked: _,
|
|
2589
|
-
onCheckedChange: (
|
|
2590
|
-
p
|
|
2590
|
+
onCheckedChange: (p) => {
|
|
2591
|
+
w(p), e.commands.setCaseSensitive(p);
|
|
2591
2592
|
}
|
|
2592
2593
|
}
|
|
2593
2594
|
),
|
|
2594
|
-
/* @__PURE__ */ r(Ne, { children:
|
|
2595
|
+
/* @__PURE__ */ r(Ne, { children: n("editor.replace.caseSensitive") })
|
|
2595
2596
|
] }),
|
|
2596
2597
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
2597
2598
|
/* @__PURE__ */ r(
|
|
@@ -2600,7 +2601,7 @@ function Qi({ editor: e, ...t }) {
|
|
|
2600
2601
|
className: "richtext-flex-1",
|
|
2601
2602
|
disabled: o.length === 0,
|
|
2602
2603
|
onClick: e.commands.replace,
|
|
2603
|
-
children:
|
|
2604
|
+
children: n("editor.replace.dialog.text")
|
|
2604
2605
|
}
|
|
2605
2606
|
),
|
|
2606
2607
|
/* @__PURE__ */ r(
|
|
@@ -2609,7 +2610,7 @@ function Qi({ editor: e, ...t }) {
|
|
|
2609
2610
|
className: "richtext-flex-1",
|
|
2610
2611
|
disabled: o.length === 0,
|
|
2611
2612
|
onClick: e.commands.replaceAll,
|
|
2612
|
-
children:
|
|
2613
|
+
children: n("editor.replaceAll.dialog.text")
|
|
2613
2614
|
}
|
|
2614
2615
|
)
|
|
2615
2616
|
] })
|
|
@@ -2621,11 +2622,11 @@ function Qi({ editor: e, ...t }) {
|
|
|
2621
2622
|
);
|
|
2622
2623
|
}
|
|
2623
2624
|
const se = (e, t) => t(e.tr);
|
|
2624
|
-
function Yi(e, t,
|
|
2625
|
-
return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e,
|
|
2625
|
+
function Yi(e, t, n) {
|
|
2626
|
+
return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e, n ? "gu" : "gui");
|
|
2626
2627
|
}
|
|
2627
|
-
function Xi(e, t,
|
|
2628
|
-
const
|
|
2628
|
+
function Xi(e, t, n) {
|
|
2629
|
+
const i = [];
|
|
2629
2630
|
let a = [];
|
|
2630
2631
|
const o = [];
|
|
2631
2632
|
let s = 0;
|
|
@@ -2652,50 +2653,50 @@ function Xi(e, t, i) {
|
|
|
2652
2653
|
}
|
|
2653
2654
|
}
|
|
2654
2655
|
for (const c of o)
|
|
2655
|
-
|
|
2656
|
+
i.push(he.inline(c.from, c.to, { class: n }));
|
|
2656
2657
|
return {
|
|
2657
|
-
decorationsToReturn:
|
|
2658
|
+
decorationsToReturn: i,
|
|
2658
2659
|
results: o
|
|
2659
2660
|
};
|
|
2660
2661
|
}
|
|
2661
|
-
function et(e, t, { state:
|
|
2662
|
+
function et(e, t, { state: n, dispatch: i }) {
|
|
2662
2663
|
if (!t[0])
|
|
2663
2664
|
return;
|
|
2664
2665
|
const { from: o, to: s } = t[0];
|
|
2665
|
-
|
|
2666
|
+
i && i(n.tr.insertText(e, o, s));
|
|
2666
2667
|
}
|
|
2667
|
-
function ea(e, t,
|
|
2668
|
+
function ea(e, t, n, i) {
|
|
2668
2669
|
const a = t + 1;
|
|
2669
|
-
if (!
|
|
2670
|
+
if (!i[a])
|
|
2670
2671
|
return null;
|
|
2671
|
-
const { from: o, to: s } =
|
|
2672
|
-
return
|
|
2672
|
+
const { from: o, to: s } = i[t], c = s - o - e.length + n, { from: h, to: d } = i[a];
|
|
2673
|
+
return i[a] = {
|
|
2673
2674
|
to: d - c,
|
|
2674
2675
|
from: h - c
|
|
2675
|
-
}, [c,
|
|
2676
|
+
}, [c, i];
|
|
2676
2677
|
}
|
|
2677
|
-
function ta(e, t, { tr:
|
|
2678
|
+
function ta(e, t, { tr: n, dispatch: i }) {
|
|
2678
2679
|
let a = 0, o = t.slice();
|
|
2679
2680
|
if (o.length === 0)
|
|
2680
2681
|
return !1;
|
|
2681
2682
|
for (let s = 0; s < o.length; s += 1) {
|
|
2682
2683
|
const { from: c, to: h } = o[s];
|
|
2683
|
-
|
|
2684
|
+
n.insertText(e, c, h);
|
|
2684
2685
|
const d = ea(e, s, a, o);
|
|
2685
2686
|
d && (a = d[0], o = d[1]);
|
|
2686
2687
|
}
|
|
2687
|
-
return n
|
|
2688
|
+
return i(n), !0;
|
|
2688
2689
|
}
|
|
2689
|
-
function tt({ view: e, tr: t, searchResults:
|
|
2690
|
-
const o =
|
|
2690
|
+
function tt({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, gotoIndex: a }) {
|
|
2691
|
+
const o = n[a];
|
|
2691
2692
|
if (o) {
|
|
2692
2693
|
const s = t.setMeta("directDecoration", {
|
|
2693
2694
|
fromPos: o.from,
|
|
2694
2695
|
toPos: o.to,
|
|
2695
|
-
attrs: { class:
|
|
2696
|
+
attrs: { class: i }
|
|
2696
2697
|
});
|
|
2697
2698
|
return e == null || e.dispatch(s), setTimeout(() => {
|
|
2698
|
-
const c = window.document.querySelector(`.${
|
|
2699
|
+
const c = window.document.querySelector(`.${i}`);
|
|
2699
2700
|
c && Ue(c, { behavior: "smooth", scrollMode: "if-needed" });
|
|
2700
2701
|
}, 0), !0;
|
|
2701
2702
|
}
|
|
@@ -2717,13 +2718,13 @@ const na = N.create({
|
|
|
2717
2718
|
disableRegex: !1,
|
|
2718
2719
|
onChange: () => {
|
|
2719
2720
|
},
|
|
2720
|
-
button: ({ editor: t, t:
|
|
2721
|
+
button: ({ editor: t, t: n }) => ({
|
|
2721
2722
|
component: Qi,
|
|
2722
2723
|
componentProps: {
|
|
2723
2724
|
action: () => {
|
|
2724
2725
|
},
|
|
2725
2726
|
icon: "SearchAndReplace",
|
|
2726
|
-
tooltip:
|
|
2727
|
+
tooltip: n("editor.searchAndReplace.tooltip"),
|
|
2727
2728
|
isActive: () => !1,
|
|
2728
2729
|
disabled: !1,
|
|
2729
2730
|
editor: t
|
|
@@ -2739,34 +2740,34 @@ const na = N.create({
|
|
|
2739
2740
|
},
|
|
2740
2741
|
addCommands() {
|
|
2741
2742
|
return {
|
|
2742
|
-
setSearchTerm: (e) => ({ state: t, dispatch:
|
|
2743
|
-
setReplaceTerm: (e) => ({ state: t, dispatch:
|
|
2744
|
-
setCaseSensitive: (e) => ({ state: t, dispatch:
|
|
2743
|
+
setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE), se(t, n), !1),
|
|
2744
|
+
setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, se(t, n), !1),
|
|
2745
|
+
setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, se(t, n), !1),
|
|
2745
2746
|
replace: () => ({ state: e, dispatch: t }) => {
|
|
2746
|
-
const { replaceTerm:
|
|
2747
|
-
return o ? (et(
|
|
2747
|
+
const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage, o = a[i];
|
|
2748
|
+
return o ? (et(n, [o], { state: e, dispatch: t }), this.storage.results.splice(i, 1)) : (et(n, a, { state: e, dispatch: t }), this.storage.results.shift()), K(D.SEARCH_REPLCE), se(e, t), !1;
|
|
2748
2749
|
},
|
|
2749
|
-
replaceAll: () => ({ state: e, tr: t, dispatch:
|
|
2750
|
-
const { replaceTerm:
|
|
2751
|
-
return ta(
|
|
2750
|
+
replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
|
|
2751
|
+
const { replaceTerm: i } = this.options, { results: a } = this.storage;
|
|
2752
|
+
return ta(i, a, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], K(D.SEARCH_REPLCE), se(e, n), !1;
|
|
2752
2753
|
},
|
|
2753
2754
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
2754
|
-
const { searchResultCurrentClass:
|
|
2755
|
+
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + a.length - 1) % a.length;
|
|
2755
2756
|
return this.storage.currentIndex = o, K(D.SEARCH_REPLCE), tt({
|
|
2756
2757
|
view: e,
|
|
2757
2758
|
tr: t,
|
|
2758
2759
|
searchResults: a,
|
|
2759
|
-
searchResultCurrentClass:
|
|
2760
|
+
searchResultCurrentClass: n,
|
|
2760
2761
|
gotoIndex: o
|
|
2761
2762
|
});
|
|
2762
2763
|
},
|
|
2763
2764
|
goToNextSearchResult: () => ({ view: e, tr: t }) => {
|
|
2764
|
-
const { searchResultCurrentClass:
|
|
2765
|
+
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + 1) % a.length;
|
|
2765
2766
|
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE), tt({
|
|
2766
2767
|
view: e,
|
|
2767
2768
|
tr: t,
|
|
2768
2769
|
searchResults: a,
|
|
2769
|
-
searchResultCurrentClass:
|
|
2770
|
+
searchResultCurrentClass: n,
|
|
2770
2771
|
gotoIndex: o
|
|
2771
2772
|
});
|
|
2772
2773
|
}
|
|
@@ -2782,10 +2783,10 @@ const na = N.create({
|
|
|
2782
2783
|
return de.empty;
|
|
2783
2784
|
},
|
|
2784
2785
|
apply(t) {
|
|
2785
|
-
const { doc:
|
|
2786
|
-
if (
|
|
2786
|
+
const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: s, disableRegex: c, caseSensitive: h } = e.options;
|
|
2787
|
+
if (i || a) {
|
|
2787
2788
|
const { decorationsToReturn: d, results: l } = Xi(
|
|
2788
|
-
|
|
2789
|
+
n,
|
|
2789
2790
|
Yi(a, c, h),
|
|
2790
2791
|
o
|
|
2791
2792
|
);
|
|
@@ -2796,7 +2797,7 @@ const na = N.create({
|
|
|
2796
2797
|
l.length > 0 && (d[0] = he.inline(l[0].from, l[0].to, {
|
|
2797
2798
|
class: s
|
|
2798
2799
|
}));
|
|
2799
|
-
return de.create(
|
|
2800
|
+
return de.create(n, d);
|
|
2800
2801
|
}
|
|
2801
2802
|
return de.empty;
|
|
2802
2803
|
}
|
|
@@ -2855,12 +2856,12 @@ function oa({ children: e, ...t }) {
|
|
|
2855
2856
|
function ra({
|
|
2856
2857
|
emoji: e,
|
|
2857
2858
|
className: t,
|
|
2858
|
-
...
|
|
2859
|
+
...n
|
|
2859
2860
|
}) {
|
|
2860
2861
|
return /* @__PURE__ */ r(
|
|
2861
2862
|
"button",
|
|
2862
2863
|
{
|
|
2863
|
-
...
|
|
2864
|
+
...n,
|
|
2864
2865
|
className: S(
|
|
2865
2866
|
"data-[active]:richtext-bg-accent richtext-flex richtext-size-7 richtext-items-center richtext-justify-center richtext-rounded-sm richtext-text-base",
|
|
2866
2867
|
t
|
|
@@ -2940,9 +2941,9 @@ function la({
|
|
|
2940
2941
|
),
|
|
2941
2942
|
"data-slot": "emoji-picker-footer",
|
|
2942
2943
|
...t,
|
|
2943
|
-
children: /* @__PURE__ */ r(W.ActiveEmoji, { children: ({ emoji:
|
|
2944
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-size-7 richtext-flex-none richtext-items-center richtext-justify-center richtext-text-lg", children:
|
|
2945
|
-
/* @__PURE__ */ r("span", { className: "richtext-text-secondary-foreground richtext-truncate richtext-text-xs", children:
|
|
2944
|
+
children: /* @__PURE__ */ r(W.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ m(ye, { children: [
|
|
2945
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-size-7 richtext-flex-none richtext-items-center richtext-justify-center richtext-text-lg", children: n.emoji }),
|
|
2946
|
+
/* @__PURE__ */ r("span", { className: "richtext-text-secondary-foreground richtext-truncate richtext-text-xs", children: n.label })
|
|
2946
2947
|
] }) : /* @__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…" }) })
|
|
2947
2948
|
}
|
|
2948
2949
|
);
|
|
@@ -2961,8 +2962,8 @@ function da({ onSelectEmoji: e, children: t }) {
|
|
|
2961
2962
|
ia,
|
|
2962
2963
|
{
|
|
2963
2964
|
className: "!richtext-h-[342px]",
|
|
2964
|
-
onEmojiSelect: ({ emoji:
|
|
2965
|
-
e(
|
|
2965
|
+
onEmojiSelect: ({ emoji: n }) => {
|
|
2966
|
+
e(n);
|
|
2966
2967
|
},
|
|
2967
2968
|
children: [
|
|
2968
2969
|
/* @__PURE__ */ r(aa, {}),
|
|
@@ -2975,44 +2976,44 @@ function da({ onSelectEmoji: e, children: t }) {
|
|
|
2975
2976
|
)
|
|
2976
2977
|
] });
|
|
2977
2978
|
}
|
|
2978
|
-
function ha({ editor: e, icon: t, ...
|
|
2979
|
-
const
|
|
2979
|
+
function ha({ editor: e, icon: t, ...n }) {
|
|
2980
|
+
const i = F(
|
|
2980
2981
|
(a) => {
|
|
2981
2982
|
const { selection: o } = e.state, { $anchor: s } = o;
|
|
2982
2983
|
return e.chain().insertContentAt(s.pos, a).run();
|
|
2983
2984
|
},
|
|
2984
2985
|
[e]
|
|
2985
2986
|
);
|
|
2986
|
-
return /* @__PURE__ */ r(da, { onSelectEmoji:
|
|
2987
|
+
return /* @__PURE__ */ r(da, { onSelectEmoji: i, children: /* @__PURE__ */ r(
|
|
2987
2988
|
x,
|
|
2988
2989
|
{
|
|
2989
2990
|
icon: t,
|
|
2990
|
-
tooltip:
|
|
2991
|
+
tooltip: n == null ? void 0 : n.tooltip
|
|
2991
2992
|
}
|
|
2992
2993
|
) });
|
|
2993
2994
|
}
|
|
2994
2995
|
const xt = Re((e, t) => {
|
|
2995
|
-
const
|
|
2996
|
+
const n = G(null), [i, a] = v(0), { t: o } = B(), s = (l) => {
|
|
2996
2997
|
const u = e.items[l];
|
|
2997
2998
|
u && e.command(u);
|
|
2998
2999
|
}, c = () => {
|
|
2999
|
-
a((
|
|
3000
|
+
a((i + e.items.length - 1) % e.items.length);
|
|
3000
3001
|
}, h = () => {
|
|
3001
|
-
a((
|
|
3002
|
+
a((i + 1) % e.items.length);
|
|
3002
3003
|
}, d = () => {
|
|
3003
|
-
s(
|
|
3004
|
+
s(i);
|
|
3004
3005
|
};
|
|
3005
3006
|
return M(() => a(0), [e.items]), M(() => {
|
|
3006
|
-
if (Number.isNaN(
|
|
3007
|
+
if (Number.isNaN(i + 1))
|
|
3007
3008
|
return;
|
|
3008
|
-
const l =
|
|
3009
|
+
const l = n.current.querySelector(`span:nth-of-type(${i + 1})`);
|
|
3009
3010
|
l && Ue(l, { behavior: "smooth", scrollMode: "if-needed" });
|
|
3010
|
-
}, [
|
|
3011
|
+
}, [i]), Pe(t, () => ({
|
|
3011
3012
|
onKeyDown: ({ event: l }) => l.key === "ArrowUp" ? (c(), !0) : l.key === "ArrowDown" ? (h(), !0) : l.key === "Enter" ? (d(), !0) : !1
|
|
3012
|
-
})), /* @__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:
|
|
3013
|
+
})), /* @__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((l, u) => /* @__PURE__ */ m(
|
|
3013
3014
|
"span",
|
|
3014
3015
|
{
|
|
3015
|
-
className: R(" 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", u ===
|
|
3016
|
+
className: R(" 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", u === i ? "bg-accent" : ""),
|
|
3016
3017
|
onClick: () => s(u),
|
|
3017
3018
|
children: [
|
|
3018
3019
|
l.fallbackImage ? /* @__PURE__ */ r(
|
|
@@ -4872,8 +4873,8 @@ const ee = {
|
|
|
4872
4873
|
wales: "🏴"
|
|
4873
4874
|
};
|
|
4874
4875
|
Object.keys(ee).reduce((e, t) => {
|
|
4875
|
-
const
|
|
4876
|
-
return e[
|
|
4876
|
+
const n = ee[t];
|
|
4877
|
+
return e[n] = t, e;
|
|
4877
4878
|
}, {});
|
|
4878
4879
|
const ua = Object.keys(ee).map((e) => e);
|
|
4879
4880
|
Object.keys(ee).map((e) => ee[e]);
|
|
@@ -4883,7 +4884,7 @@ function ma(e) {
|
|
|
4883
4884
|
emoji: ee[t]
|
|
4884
4885
|
}));
|
|
4885
4886
|
}
|
|
4886
|
-
const fa = 200, _a = new Z("emoji"), Bo =
|
|
4887
|
+
const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
4887
4888
|
name: "emoji",
|
|
4888
4889
|
content: "text*",
|
|
4889
4890
|
priority: fa,
|
|
@@ -4895,11 +4896,11 @@ const fa = 200, _a = new Z("emoji"), Bo = pe.create({
|
|
|
4895
4896
|
suggestion: {
|
|
4896
4897
|
char: ":",
|
|
4897
4898
|
pluginKey: _a,
|
|
4898
|
-
command: ({ editor: t, range:
|
|
4899
|
-
t.chain().focus().insertContentAt(
|
|
4899
|
+
command: ({ editor: t, range: n, props: i }) => {
|
|
4900
|
+
t.chain().focus().insertContentAt(n, `${i.emoji} `).run();
|
|
4900
4901
|
}
|
|
4901
4902
|
},
|
|
4902
|
-
button: ({ editor: t, t:
|
|
4903
|
+
button: ({ editor: t, t: n }) => ({
|
|
4903
4904
|
component: ha,
|
|
4904
4905
|
componentProps: {
|
|
4905
4906
|
editor: t,
|
|
@@ -4908,7 +4909,7 @@ const fa = 200, _a = new Z("emoji"), Bo = pe.create({
|
|
|
4908
4909
|
isActive: () => !1,
|
|
4909
4910
|
disabled: !1,
|
|
4910
4911
|
icon: "EmojiIcon",
|
|
4911
|
-
tooltip:
|
|
4912
|
+
tooltip: n("editor.emoji.tooltip")
|
|
4912
4913
|
}
|
|
4913
4914
|
})
|
|
4914
4915
|
};
|
|
@@ -4930,14 +4931,14 @@ const fa = 200, _a = new Z("emoji"), Bo = pe.create({
|
|
|
4930
4931
|
suggestion: {
|
|
4931
4932
|
items: ({ query: e }) => ma(e),
|
|
4932
4933
|
render: () => {
|
|
4933
|
-
let e, t,
|
|
4934
|
+
let e, t, n;
|
|
4934
4935
|
return {
|
|
4935
|
-
onStart: (
|
|
4936
|
-
|
|
4937
|
-
props:
|
|
4938
|
-
editor:
|
|
4936
|
+
onStart: (i) => {
|
|
4937
|
+
n = i.editor.isEditable, n && (e = new Me(xt, {
|
|
4938
|
+
props: i,
|
|
4939
|
+
editor: i.editor
|
|
4939
4940
|
}), t = Fe("body", {
|
|
4940
|
-
getReferenceClientRect:
|
|
4941
|
+
getReferenceClientRect: i.clientRect,
|
|
4941
4942
|
appendTo: () => document.body,
|
|
4942
4943
|
content: e.element,
|
|
4943
4944
|
showOnCreate: !0,
|
|
@@ -4946,18 +4947,18 @@ const fa = 200, _a = new Z("emoji"), Bo = pe.create({
|
|
|
4946
4947
|
placement: "bottom-start"
|
|
4947
4948
|
}));
|
|
4948
4949
|
},
|
|
4949
|
-
onUpdate(
|
|
4950
|
-
|
|
4951
|
-
getReferenceClientRect:
|
|
4950
|
+
onUpdate(i) {
|
|
4951
|
+
n && (e.updateProps(i), t[0].setProps({
|
|
4952
|
+
getReferenceClientRect: i.clientRect
|
|
4952
4953
|
}));
|
|
4953
4954
|
},
|
|
4954
|
-
onKeyDown(
|
|
4955
|
+
onKeyDown(i) {
|
|
4955
4956
|
var a;
|
|
4956
|
-
if (
|
|
4957
|
-
return
|
|
4957
|
+
if (n)
|
|
4958
|
+
return i.event.key === "Escape" ? (t[0].hide(), !0) : (a = e.ref) == null ? void 0 : a.onKeyDown(i);
|
|
4958
4959
|
},
|
|
4959
4960
|
onExit() {
|
|
4960
|
-
|
|
4961
|
+
n && (t[0].destroy(), e.destroy());
|
|
4961
4962
|
}
|
|
4962
4963
|
};
|
|
4963
4964
|
}
|
|
@@ -4980,17 +4981,17 @@ function ga(e) {
|
|
|
4980
4981
|
</body>
|
|
4981
4982
|
</html>
|
|
4982
4983
|
`;
|
|
4983
|
-
const
|
|
4984
|
-
a.rel = "stylesheet", a.href = "https://cdn.jsdelivr.net/npm/reactjs-tiptap-editor@latest/lib/style.css",
|
|
4984
|
+
const n = t.contentWindow, i = t.contentDocument || t.contentWindow && t.contentWindow.document, a = document.createElement("link");
|
|
4985
|
+
a.rel = "stylesheet", a.href = "https://cdn.jsdelivr.net/npm/reactjs-tiptap-editor@latest/lib/style.css", i.head.appendChild(a), i && (i.open(), i.write(e), i.close()), n && t.addEventListener("load", function() {
|
|
4985
4986
|
try {
|
|
4986
4987
|
setTimeout(() => {
|
|
4987
|
-
|
|
4988
|
+
n.focus();
|
|
4988
4989
|
try {
|
|
4989
|
-
|
|
4990
|
+
n.document.execCommand("print", !1) || n.print();
|
|
4990
4991
|
} catch {
|
|
4991
|
-
|
|
4992
|
+
n.print();
|
|
4992
4993
|
}
|
|
4993
|
-
|
|
4994
|
+
n.close();
|
|
4994
4995
|
}, 10);
|
|
4995
4996
|
} catch (o) {
|
|
4996
4997
|
console.error(o);
|
|
@@ -5010,14 +5011,14 @@ const jo = N.create({
|
|
|
5010
5011
|
var e;
|
|
5011
5012
|
return {
|
|
5012
5013
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
5013
|
-
button: ({ editor: t, t:
|
|
5014
|
+
button: ({ editor: t, t: n }) => ({
|
|
5014
5015
|
component: x,
|
|
5015
5016
|
componentProps: {
|
|
5016
5017
|
action: () => {
|
|
5017
5018
|
ba(t);
|
|
5018
5019
|
},
|
|
5019
5020
|
icon: "ExportPdf",
|
|
5020
|
-
tooltip:
|
|
5021
|
+
tooltip: n("editor.exportPdf.tooltip"),
|
|
5021
5022
|
isActive: () => !1,
|
|
5022
5023
|
disabled: !1
|
|
5023
5024
|
}
|
|
@@ -5026,17 +5027,17 @@ const jo = N.create({
|
|
|
5026
5027
|
}
|
|
5027
5028
|
});
|
|
5028
5029
|
function xa(e, t) {
|
|
5029
|
-
const
|
|
5030
|
-
for (let o = 0; o <
|
|
5031
|
-
|
|
5032
|
-
const a = new Uint8Array(
|
|
5030
|
+
const n = atob(e.split(",")[1]), i = Array.from({ length: n.length });
|
|
5031
|
+
for (let o = 0; o < n.length; o++)
|
|
5032
|
+
i[o] = n.charCodeAt(o);
|
|
5033
|
+
const a = new Uint8Array(i);
|
|
5033
5034
|
return new Blob([a], { type: t });
|
|
5034
5035
|
}
|
|
5035
|
-
function
|
|
5036
|
+
function wa(e, t) {
|
|
5036
5037
|
return new File([e], t, { type: e.type });
|
|
5037
5038
|
}
|
|
5038
|
-
function
|
|
5039
|
-
const { toast: t } = In(), { t:
|
|
5039
|
+
function pa(e) {
|
|
5040
|
+
const { toast: t } = In(), { t: n } = B(), [i, a] = v(!1), o = G(null);
|
|
5040
5041
|
function s() {
|
|
5041
5042
|
var u;
|
|
5042
5043
|
(u = o.current) == null || u.click();
|
|
@@ -5047,7 +5048,7 @@ function wa(e) {
|
|
|
5047
5048
|
if (f.size > e.limit) {
|
|
5048
5049
|
t({
|
|
5049
5050
|
variant: "destructive",
|
|
5050
|
-
title:
|
|
5051
|
+
title: n("editor.importWord.limitSize")
|
|
5051
5052
|
});
|
|
5052
5053
|
return;
|
|
5053
5054
|
}
|
|
@@ -5056,8 +5057,8 @@ function wa(e) {
|
|
|
5056
5057
|
}
|
|
5057
5058
|
async function h(u) {
|
|
5058
5059
|
var T;
|
|
5059
|
-
const _ = new DOMParser().parseFromString(u, "text/html"),
|
|
5060
|
-
if (
|
|
5060
|
+
const _ = new DOMParser().parseFromString(u, "text/html"), w = _.querySelectorAll("img");
|
|
5061
|
+
if (w.length === 0)
|
|
5061
5062
|
return _.body.innerHTML;
|
|
5062
5063
|
if (Bn(e.editor, "image")) {
|
|
5063
5064
|
const E = (T = e.editor.extensionManager.extensions.find(
|
|
@@ -5065,12 +5066,12 @@ function wa(e) {
|
|
|
5065
5066
|
)) == null ? void 0 : T.options;
|
|
5066
5067
|
if (E && typeof E.upload == "function") {
|
|
5067
5068
|
const g = [];
|
|
5068
|
-
for (const k of
|
|
5069
|
-
const H = k.getAttribute("src"), L = xa(H, "image/jpeg"), O =
|
|
5069
|
+
for (const k of w) {
|
|
5070
|
+
const H = k.getAttribute("src"), L = xa(H, "image/jpeg"), O = wa(L, "image.jpeg");
|
|
5070
5071
|
g.push(O);
|
|
5071
5072
|
}
|
|
5072
5073
|
const b = await E.upload(g);
|
|
5073
|
-
for (const [k, H] of
|
|
5074
|
+
for (const [k, H] of w.entries()) {
|
|
5074
5075
|
H.setAttribute("src", b[k].src);
|
|
5075
5076
|
const L = H.parentElement;
|
|
5076
5077
|
(L == null ? void 0 : L.tagName) === "P" && (L.insertAdjacentElement("beforebegin", H), !L.hasChildNodes() && L.textContent === "" && L.remove());
|
|
@@ -5109,7 +5110,7 @@ function wa(e) {
|
|
|
5109
5110
|
action: s,
|
|
5110
5111
|
disabled: e == null ? void 0 : e.disabled,
|
|
5111
5112
|
icon: e == null ? void 0 : e.icon,
|
|
5112
|
-
loading:
|
|
5113
|
+
loading: i,
|
|
5113
5114
|
tooltip: e == null ? void 0 : e.tooltip
|
|
5114
5115
|
}
|
|
5115
5116
|
),
|
|
@@ -5137,10 +5138,10 @@ const Do = N.create({
|
|
|
5137
5138
|
convert: void 0,
|
|
5138
5139
|
limit: 1024 * 1024 * 10,
|
|
5139
5140
|
// 10 MB
|
|
5140
|
-
button: ({ editor: t, extension:
|
|
5141
|
-
const { convert: a, limit: o, mammothOptions: s } =
|
|
5141
|
+
button: ({ editor: t, extension: n, t: i }) => {
|
|
5142
|
+
const { convert: a, limit: o, mammothOptions: s } = n.options;
|
|
5142
5143
|
return {
|
|
5143
|
-
component:
|
|
5144
|
+
component: pa,
|
|
5144
5145
|
componentProps: {
|
|
5145
5146
|
editor: t,
|
|
5146
5147
|
convert: a,
|
|
@@ -5150,7 +5151,7 @@ const Do = N.create({
|
|
|
5150
5151
|
disabled: !t.can().setHorizontalRule(),
|
|
5151
5152
|
icon: "Word",
|
|
5152
5153
|
shortcutKeys: ["alt", "mod", "S"],
|
|
5153
|
-
tooltip:
|
|
5154
|
+
tooltip: i("editor.importWord.tooltip")
|
|
5154
5155
|
}
|
|
5155
5156
|
};
|
|
5156
5157
|
}
|
|
@@ -5159,8 +5160,8 @@ const Do = N.create({
|
|
|
5159
5160
|
}), ya = typeof window < "u";
|
|
5160
5161
|
function ka(e, t) {
|
|
5161
5162
|
if (ya) {
|
|
5162
|
-
const
|
|
5163
|
-
return
|
|
5163
|
+
const n = window.URL.createObjectURL(e), i = document.createElement("a");
|
|
5164
|
+
return i.href = n, i.download = t, i.click(), window.URL.revokeObjectURL(n), Promise.resolve();
|
|
5164
5165
|
}
|
|
5165
5166
|
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
5166
5167
|
}
|
|
@@ -5192,14 +5193,14 @@ const va = {
|
|
|
5192
5193
|
var e;
|
|
5193
5194
|
return {
|
|
5194
5195
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
5195
|
-
button: ({ editor: t, t:
|
|
5196
|
+
button: ({ editor: t, t: n }) => ({
|
|
5196
5197
|
component: x,
|
|
5197
5198
|
componentProps: {
|
|
5198
5199
|
icon: "ExportWord",
|
|
5199
5200
|
action: () => {
|
|
5200
5201
|
t == null || t.commands.exportToWord();
|
|
5201
5202
|
},
|
|
5202
|
-
tooltip:
|
|
5203
|
+
tooltip: n("editor.exportWord.tooltip"),
|
|
5203
5204
|
isActive: () => !1,
|
|
5204
5205
|
disabled: !1
|
|
5205
5206
|
}
|
|
@@ -5211,12 +5212,12 @@ const va = {
|
|
|
5211
5212
|
return {
|
|
5212
5213
|
exportToWord: () => async ({ editor: e }) => {
|
|
5213
5214
|
const t = {
|
|
5214
|
-
getImageBuffer: async (
|
|
5215
|
-
const o = await (await fetch(
|
|
5215
|
+
getImageBuffer: async (i) => {
|
|
5216
|
+
const o = await (await fetch(i)).arrayBuffer();
|
|
5216
5217
|
return new Uint8Array(o);
|
|
5217
5218
|
}
|
|
5218
|
-
},
|
|
5219
|
-
return Zn.toBlob(
|
|
5219
|
+
}, n = Ca.serialize(e.state.doc, t);
|
|
5220
|
+
return Zn.toBlob(n).then((i) => ka(new Blob([i]), "export-document.docx")), !0;
|
|
5220
5221
|
}
|
|
5221
5222
|
};
|
|
5222
5223
|
}
|
|
@@ -5227,16 +5228,16 @@ const va = {
|
|
|
5227
5228
|
item: La
|
|
5228
5229
|
};
|
|
5229
5230
|
function Sa(e) {
|
|
5230
|
-
const t = [],
|
|
5231
|
-
return e.forEach((
|
|
5232
|
-
let a = -1, o = i
|
|
5231
|
+
const t = [], n = [t];
|
|
5232
|
+
return e.forEach((i) => {
|
|
5233
|
+
let a = -1, o = n[i.level + a];
|
|
5233
5234
|
for (; !o; )
|
|
5234
|
-
a -= 1, o = i
|
|
5235
|
-
o.push({ ...
|
|
5235
|
+
a -= 1, o = n[i.level + a];
|
|
5236
|
+
o.push({ ...i, children: n[i.level] = [] });
|
|
5236
5237
|
}), t;
|
|
5237
5238
|
}
|
|
5238
5239
|
function Ea({ editor: e }) {
|
|
5239
|
-
const t = De(), [
|
|
5240
|
+
const t = De(), [n, i] = v([]), { t: a } = B(), o = F(() => {
|
|
5240
5241
|
const s = [], c = e.state.tr;
|
|
5241
5242
|
e.state.doc.descendants((h, d) => {
|
|
5242
5243
|
if (h.type.name === "heading") {
|
|
@@ -5250,7 +5251,7 @@ function Ea({ editor: e }) {
|
|
|
5250
5251
|
id: l
|
|
5251
5252
|
});
|
|
5252
5253
|
}
|
|
5253
|
-
}), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c),
|
|
5254
|
+
}), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c), i(s), e.eventEmitter && e.eventEmitter.emit("TableOfContents", Sa(s));
|
|
5254
5255
|
}, [e]);
|
|
5255
5256
|
return M(() => {
|
|
5256
5257
|
if (e) {
|
|
@@ -5266,7 +5267,7 @@ function Ea({ editor: e }) {
|
|
|
5266
5267
|
o();
|
|
5267
5268
|
}, []), /* @__PURE__ */ r(le, { className: R("tableOfContent", be.toc, t && be.visible), children: t ? /* @__PURE__ */ m("div", { style: { position: "relative" }, children: [
|
|
5268
5269
|
/* @__PURE__ */ r("p", { className: "text-[20px] richtext-mb-[8px] richtext-font-semibold", children: a("editor.table_of_content") }),
|
|
5269
|
-
/* @__PURE__ */ r("ul", { className: be.list, children:
|
|
5270
|
+
/* @__PURE__ */ r("ul", { className: be.list, children: n.map((s, c) => /* @__PURE__ */ r(
|
|
5270
5271
|
"li",
|
|
5271
5272
|
{
|
|
5272
5273
|
className: be.item,
|
|
@@ -5278,31 +5279,31 @@ function Ea({ editor: e }) {
|
|
|
5278
5279
|
] }) : null });
|
|
5279
5280
|
}
|
|
5280
5281
|
function Ha(e, ...t) {
|
|
5281
|
-
const [
|
|
5282
|
+
const [n, i] = v(!1);
|
|
5282
5283
|
return M(() => {
|
|
5283
5284
|
const a = () => {
|
|
5284
|
-
|
|
5285
|
+
i(e.isActive.apply(e, t));
|
|
5285
5286
|
};
|
|
5286
5287
|
return e.on("selectionUpdate", a), e.on("transaction", a), () => {
|
|
5287
5288
|
e.off("selectionUpdate", a), e.off("transaction", a);
|
|
5288
5289
|
};
|
|
5289
|
-
}, [e, t,
|
|
5290
|
+
}, [e, t, i]), n;
|
|
5290
5291
|
}
|
|
5291
|
-
function Ma({ editor: e, icon: t, tooltip:
|
|
5292
|
-
const
|
|
5293
|
-
if (
|
|
5292
|
+
function Ma({ editor: e, icon: t, tooltip: n }) {
|
|
5293
|
+
const i = Ha(e, Pa.name), a = F(() => {
|
|
5294
|
+
if (i) {
|
|
5294
5295
|
e.chain().focus().removeTableOfContents().run();
|
|
5295
5296
|
return;
|
|
5296
5297
|
}
|
|
5297
5298
|
e.chain().focus().setTableOfContents().run();
|
|
5298
|
-
}, [e,
|
|
5299
|
+
}, [e, i]);
|
|
5299
5300
|
return /* @__PURE__ */ r(
|
|
5300
5301
|
x,
|
|
5301
5302
|
{
|
|
5302
5303
|
action: a,
|
|
5303
|
-
isActive: () =>
|
|
5304
|
+
isActive: () => i || !1,
|
|
5304
5305
|
icon: t,
|
|
5305
|
-
tooltip:
|
|
5306
|
+
tooltip: n
|
|
5306
5307
|
}
|
|
5307
5308
|
);
|
|
5308
5309
|
}
|
|
@@ -5310,14 +5311,14 @@ function za(e) {
|
|
|
5310
5311
|
return e && e.type.name === "title";
|
|
5311
5312
|
}
|
|
5312
5313
|
function Ra(e, t) {
|
|
5313
|
-
const
|
|
5314
|
-
for (;
|
|
5315
|
-
const o =
|
|
5316
|
-
o.type === t && a.push(o), o.content && o.content.length > 0 &&
|
|
5314
|
+
const i = [e.getJSON()], a = [];
|
|
5315
|
+
for (; i.length > 0; ) {
|
|
5316
|
+
const o = i.shift();
|
|
5317
|
+
o.type === t && a.push(o), o.content && o.content.length > 0 && i.push(...o.content);
|
|
5317
5318
|
}
|
|
5318
5319
|
return a;
|
|
5319
5320
|
}
|
|
5320
|
-
const Pa =
|
|
5321
|
+
const Pa = we.create({
|
|
5321
5322
|
name: "tableOfContents",
|
|
5322
5323
|
group: "block",
|
|
5323
5324
|
atom: !0,
|
|
@@ -5330,12 +5331,12 @@ const Pa = pe.create({
|
|
|
5330
5331
|
resizable: !0,
|
|
5331
5332
|
lastColumnResizable: !0,
|
|
5332
5333
|
allowTableNodeSelection: !1,
|
|
5333
|
-
button: ({ editor: t, t:
|
|
5334
|
+
button: ({ editor: t, t: n }) => ({
|
|
5334
5335
|
component: Ma,
|
|
5335
5336
|
componentProps: {
|
|
5336
5337
|
disabled: !1,
|
|
5337
5338
|
icon: "BookMarked",
|
|
5338
|
-
tooltip:
|
|
5339
|
+
tooltip: n("editor.table.tooltip"),
|
|
5339
5340
|
editor: t
|
|
5340
5341
|
}
|
|
5341
5342
|
})
|
|
@@ -5349,7 +5350,7 @@ const Pa = pe.create({
|
|
|
5349
5350
|
];
|
|
5350
5351
|
},
|
|
5351
5352
|
renderHTML({ HTMLAttributes: e }) {
|
|
5352
|
-
return ["toc",
|
|
5353
|
+
return ["toc", pe(e)];
|
|
5353
5354
|
},
|
|
5354
5355
|
addNodeView() {
|
|
5355
5356
|
return He(Ea);
|
|
@@ -5357,12 +5358,12 @@ const Pa = pe.create({
|
|
|
5357
5358
|
// @ts-expect-error
|
|
5358
5359
|
addCommands() {
|
|
5359
5360
|
return {
|
|
5360
|
-
setTableOfContents: () => ({ commands: e, editor: t, view:
|
|
5361
|
+
setTableOfContents: () => ({ commands: e, editor: t, view: n }) => {
|
|
5361
5362
|
if (Ra(t, this.name).length > 0) {
|
|
5362
5363
|
this.options.onHasOneBeforeInsert();
|
|
5363
5364
|
return;
|
|
5364
5365
|
}
|
|
5365
|
-
const a =
|
|
5366
|
+
const a = n.props.state.doc.content.firstChild;
|
|
5366
5367
|
if (za(a)) {
|
|
5367
5368
|
const o = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
|
|
5368
5369
|
return e.insertContentAt(o, { type: this.name });
|
|
@@ -5372,13 +5373,13 @@ const Pa = pe.create({
|
|
|
5372
5373
|
});
|
|
5373
5374
|
},
|
|
5374
5375
|
removeTableOfContents: () => ({ state: e, dispatch: t }) => {
|
|
5375
|
-
const { tr:
|
|
5376
|
+
const { tr: n } = e, i = e.schema.nodes.tableOfContents;
|
|
5376
5377
|
return e.doc.descendants((a, o) => {
|
|
5377
|
-
if (a.type ===
|
|
5378
|
+
if (a.type === i) {
|
|
5378
5379
|
const s = o, c = o + a.nodeSize;
|
|
5379
|
-
|
|
5380
|
+
n.delete(s, c);
|
|
5380
5381
|
}
|
|
5381
|
-
}),
|
|
5382
|
+
}), n.docChanged ? (t(n), !0) : !1;
|
|
5382
5383
|
}
|
|
5383
5384
|
};
|
|
5384
5385
|
},
|
|
@@ -5396,13 +5397,13 @@ const Pa = pe.create({
|
|
|
5396
5397
|
}
|
|
5397
5398
|
});
|
|
5398
5399
|
function Ia(e) {
|
|
5399
|
-
var
|
|
5400
|
+
var n;
|
|
5400
5401
|
const t = P(() => {
|
|
5401
5402
|
var o;
|
|
5402
|
-
const
|
|
5403
|
-
return
|
|
5404
|
-
...
|
|
5405
|
-
icon:
|
|
5403
|
+
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
5404
|
+
return i && !i.default ? {
|
|
5405
|
+
...i,
|
|
5406
|
+
icon: i.icon ? i.icon : e.icon
|
|
5406
5407
|
} : {
|
|
5407
5408
|
title: e == null ? void 0 : e.tooltip,
|
|
5408
5409
|
icon: e.icon,
|
|
@@ -5439,23 +5440,23 @@ function Ia(e) {
|
|
|
5439
5440
|
align: "start",
|
|
5440
5441
|
className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
|
|
5441
5442
|
side: "bottom",
|
|
5442
|
-
children: (
|
|
5443
|
+
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
|
|
5443
5444
|
var o, s;
|
|
5444
5445
|
return /* @__PURE__ */ m(ke, { children: [
|
|
5445
5446
|
/* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ r(
|
|
5446
5447
|
$e,
|
|
5447
5448
|
{
|
|
5448
5449
|
className: "richtext-size-7 richtext-p-1",
|
|
5449
|
-
"data-state": t.title ===
|
|
5450
|
-
onClick:
|
|
5451
|
-
pressed: t.title ===
|
|
5450
|
+
"data-state": t.title === i.title ? "on" : "off",
|
|
5451
|
+
onClick: i == null ? void 0 : i.action,
|
|
5452
|
+
pressed: t.title === i.title,
|
|
5452
5453
|
size: "sm",
|
|
5453
|
-
children: (
|
|
5454
|
+
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(z, { name: i.icon })
|
|
5454
5455
|
}
|
|
5455
5456
|
) }),
|
|
5456
5457
|
/* @__PURE__ */ m(Ce, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
5457
|
-
/* @__PURE__ */ r("span", { children:
|
|
5458
|
-
!!((o =
|
|
5458
|
+
/* @__PURE__ */ r("span", { children: i.title }),
|
|
5459
|
+
!!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => Oe(c)).join(" ") })
|
|
5459
5460
|
] })
|
|
5460
5461
|
] }, `text-align-${a}`);
|
|
5461
5462
|
})
|
|
@@ -5474,16 +5475,16 @@ const $o = N.create({
|
|
|
5474
5475
|
defaultDirection: "auto",
|
|
5475
5476
|
button({
|
|
5476
5477
|
editor: t,
|
|
5477
|
-
extension:
|
|
5478
|
-
t:
|
|
5478
|
+
extension: n,
|
|
5479
|
+
t: i
|
|
5479
5480
|
}) {
|
|
5480
5481
|
var h;
|
|
5481
|
-
const a = ((h =
|
|
5482
|
+
const a = ((h = n.options) == null ? void 0 : h.directions) || [], o = {
|
|
5482
5483
|
auto: "TextDirection",
|
|
5483
5484
|
ltr: "LeftToRight",
|
|
5484
5485
|
rtl: "RightToLeft"
|
|
5485
5486
|
}, s = a.map((d) => ({
|
|
5486
|
-
title:
|
|
5487
|
+
title: i(`editor.textDirection.${d}.tooltip`),
|
|
5487
5488
|
icon: o[d],
|
|
5488
5489
|
isActive: () => !1,
|
|
5489
5490
|
action: () => {
|
|
@@ -5500,7 +5501,7 @@ const $o = N.create({
|
|
|
5500
5501
|
component: Ia,
|
|
5501
5502
|
componentProps: {
|
|
5502
5503
|
icon: "TextDirection",
|
|
5503
|
-
tooltip:
|
|
5504
|
+
tooltip: i("editor.textDirection.tooltip"),
|
|
5504
5505
|
disabled: c,
|
|
5505
5506
|
items: s
|
|
5506
5507
|
}
|
|
@@ -5525,7 +5526,7 @@ const $o = N.create({
|
|
|
5525
5526
|
// @ts-expect-error
|
|
5526
5527
|
addCommands() {
|
|
5527
5528
|
return {
|
|
5528
|
-
setTextDirection: (e) => ({ commands: t }) => this.options.directions.includes(e) ? this.options.types.every((
|
|
5529
|
+
setTextDirection: (e) => ({ commands: t }) => this.options.directions.includes(e) ? this.options.types.every((n) => t.updateAttributes(n, { dir: e })) : !1,
|
|
5529
5530
|
unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
|
|
5530
5531
|
};
|
|
5531
5532
|
}
|
|
@@ -5534,27 +5535,27 @@ const $o = N.create({
|
|
|
5534
5535
|
itemUser: ja,
|
|
5535
5536
|
selectedUser: Da
|
|
5536
5537
|
}, Oa = Re((e, t) => {
|
|
5537
|
-
const
|
|
5538
|
+
const n = G(null), [i, a] = v(0), o = (d) => {
|
|
5538
5539
|
const l = e.items[d];
|
|
5539
5540
|
l && e.command({ id: l, label: l });
|
|
5540
5541
|
}, s = () => {
|
|
5541
|
-
a((
|
|
5542
|
+
a((i + e.items.length - 1) % e.items.length);
|
|
5542
5543
|
}, c = () => {
|
|
5543
|
-
a((
|
|
5544
|
+
a((i + 1) % e.items.length);
|
|
5544
5545
|
}, h = () => {
|
|
5545
|
-
o(
|
|
5546
|
+
o(i);
|
|
5546
5547
|
};
|
|
5547
5548
|
return M(() => a(0), [e.items]), M(() => {
|
|
5548
|
-
if (Number.isNaN(
|
|
5549
|
+
if (Number.isNaN(i + 1))
|
|
5549
5550
|
return;
|
|
5550
|
-
const d =
|
|
5551
|
+
const d = n.current.querySelector(`span:nth-of-type(${i + 1})`);
|
|
5551
5552
|
d && Ue(d, { behavior: "smooth", scrollMode: "if-needed" });
|
|
5552
|
-
}, [
|
|
5553
|
+
}, [i]), Pe(t, () => ({
|
|
5553
5554
|
onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (s(), !0) : d.key === "ArrowDown" ? (c(), !0) : d.key === "Enter" ? (h(), !0) : !1
|
|
5554
|
-
})), /* @__PURE__ */ r("div", { className: R("listUsers", xe.listUsers), children: /* @__PURE__ */ r("div", { ref:
|
|
5555
|
+
})), /* @__PURE__ */ r("div", { className: R("listUsers", xe.listUsers), children: /* @__PURE__ */ r("div", { ref: n, children: e.items.length > 0 ? e.items.map((d, l) => /* @__PURE__ */ r(
|
|
5555
5556
|
"span",
|
|
5556
5557
|
{
|
|
5557
|
-
className: R("itemUser", xe.itemUser, l ===
|
|
5558
|
+
className: R("itemUser", xe.itemUser, l === i ? xe.selectedUser : ""),
|
|
5558
5559
|
onClick: () => o(l),
|
|
5559
5560
|
children: d
|
|
5560
5561
|
},
|
|
@@ -5578,16 +5579,16 @@ const $o = N.create({
|
|
|
5578
5579
|
name: "Bob"
|
|
5579
5580
|
}
|
|
5580
5581
|
], Fa = {
|
|
5581
|
-
items: async ({ query: e }) => $a.map((
|
|
5582
|
+
items: async ({ query: e }) => $a.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
|
|
5582
5583
|
render: () => {
|
|
5583
5584
|
let e, t;
|
|
5584
5585
|
return {
|
|
5585
|
-
onStart: (
|
|
5586
|
+
onStart: (n) => {
|
|
5586
5587
|
e = new Me(Oa, {
|
|
5587
|
-
props:
|
|
5588
|
-
editor:
|
|
5588
|
+
props: n,
|
|
5589
|
+
editor: n.editor
|
|
5589
5590
|
}), t = Fe("body", {
|
|
5590
|
-
getReferenceClientRect:
|
|
5591
|
+
getReferenceClientRect: n.clientRect,
|
|
5591
5592
|
appendTo: () => document.body,
|
|
5592
5593
|
content: e.element,
|
|
5593
5594
|
showOnCreate: !0,
|
|
@@ -5596,14 +5597,14 @@ const $o = N.create({
|
|
|
5596
5597
|
placement: "bottom-start"
|
|
5597
5598
|
});
|
|
5598
5599
|
},
|
|
5599
|
-
onUpdate(
|
|
5600
|
-
e.updateProps(
|
|
5601
|
-
getReferenceClientRect:
|
|
5600
|
+
onUpdate(n) {
|
|
5601
|
+
e.updateProps(n), t[0].setProps({
|
|
5602
|
+
getReferenceClientRect: n.clientRect
|
|
5602
5603
|
});
|
|
5603
5604
|
},
|
|
5604
|
-
onKeyDown(
|
|
5605
|
-
var
|
|
5606
|
-
return
|
|
5605
|
+
onKeyDown(n) {
|
|
5606
|
+
var i;
|
|
5607
|
+
return n.event.key === "Escape" ? (t[0].hide(), !0) : (i = e.ref) == null ? void 0 : i.onKeyDown(n);
|
|
5607
5608
|
},
|
|
5608
5609
|
onExit() {
|
|
5609
5610
|
t[0].destroy(), e.destroy();
|
|
@@ -5676,56 +5677,56 @@ function qa(e) {
|
|
|
5676
5677
|
const Ka = {
|
|
5677
5678
|
audio: /* @__PURE__ */ r(kn, {}),
|
|
5678
5679
|
video: /* @__PURE__ */ r(yn, {}),
|
|
5679
|
-
file: /* @__PURE__ */ r(
|
|
5680
|
-
image: /* @__PURE__ */ r(
|
|
5680
|
+
file: /* @__PURE__ */ r(pn, {}),
|
|
5681
|
+
image: /* @__PURE__ */ r(wn, {}),
|
|
5681
5682
|
pdf: /* @__PURE__ */ r(On, {}),
|
|
5682
5683
|
word: /* @__PURE__ */ r(Dn, {}),
|
|
5683
5684
|
excel: /* @__PURE__ */ r(xn, {}),
|
|
5684
5685
|
ppt: /* @__PURE__ */ r(bn, {})
|
|
5685
5686
|
};
|
|
5686
|
-
function
|
|
5687
|
-
const
|
|
5688
|
-
return t ? qa(
|
|
5687
|
+
function wt(e, t = !1) {
|
|
5688
|
+
const n = jn(e), i = Ka[n] || /* @__PURE__ */ r(ye, {});
|
|
5689
|
+
return t ? qa(n) : i;
|
|
5689
5690
|
}
|
|
5690
5691
|
const Va = "_wrap_1x1ms_2", Le = {
|
|
5691
5692
|
wrap: Va
|
|
5692
5693
|
};
|
|
5693
|
-
function Wa({ editor: e, node: t, updateAttributes:
|
|
5694
|
+
function Wa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension: a }) {
|
|
5694
5695
|
var H;
|
|
5695
|
-
const o = G(null), s = De(), { hasTrigger: c, fileName: h, fileSize: d, fileExt: l, fileType: u, url: f, error: _ } = t.attrs, [
|
|
5696
|
+
const o = G(null), s = De(), { hasTrigger: c, fileName: h, fileSize: d, fileExt: l, fileType: u, url: f, error: _ } = t.attrs, [w, p] = v(!1), { t: T } = B(), E = (H = a == null ? void 0 : a.options) == null ? void 0 : H.upload, g = F(() => {
|
|
5696
5697
|
!s || f || s && o.current.click();
|
|
5697
5698
|
}, [s, f]), b = F(
|
|
5698
5699
|
async (L) => {
|
|
5699
5700
|
const O = L.target.files && L.target.files[0];
|
|
5700
5701
|
if (!O)
|
|
5701
5702
|
return;
|
|
5702
|
-
const
|
|
5703
|
+
const pt = {
|
|
5703
5704
|
fileName: Fn(O.name),
|
|
5704
5705
|
fileSize: O.size,
|
|
5705
5706
|
fileType: O.type,
|
|
5706
5707
|
fileExt: $n(O.name)
|
|
5707
5708
|
};
|
|
5708
|
-
|
|
5709
|
+
p(!0);
|
|
5709
5710
|
try {
|
|
5710
5711
|
const ue = await E(O);
|
|
5711
|
-
|
|
5712
|
+
n({ ...pt, url: ue }), p(!1);
|
|
5712
5713
|
} catch (ue) {
|
|
5713
|
-
|
|
5714
|
+
n({ error: `File upload fail: ${ue && ue.message}` || "Unknown error" }), p(!1), o.current.value = "";
|
|
5714
5715
|
}
|
|
5715
5716
|
},
|
|
5716
|
-
[
|
|
5717
|
+
[p, n]
|
|
5717
5718
|
);
|
|
5718
5719
|
M(() => {
|
|
5719
|
-
!f && !c && (g(),
|
|
5720
|
-
}, [f, c, g,
|
|
5721
|
-
const k = F(() =>
|
|
5720
|
+
!f && !c && (g(), n({ hasTrigger: !0 }));
|
|
5721
|
+
}, [f, c, g, n]);
|
|
5722
|
+
const k = F(() => i(), [e]);
|
|
5722
5723
|
return s && !f ? /* @__PURE__ */ r(le, { children: /* @__PURE__ */ m("div", { className: R(Le.wrap, "render-wrapper"), children: [
|
|
5723
5724
|
/* @__PURE__ */ r(
|
|
5724
5725
|
"p",
|
|
5725
5726
|
{
|
|
5726
5727
|
onClick: g,
|
|
5727
5728
|
style: { cursor: "pointer" },
|
|
5728
|
-
children:
|
|
5729
|
+
children: w ? /* @__PURE__ */ r("span", { children: T("editor.attachment.uploading") }) : /* @__PURE__ */ r("span", { children: T("editor.attachment.please_upload") })
|
|
5729
5730
|
}
|
|
5730
5731
|
),
|
|
5731
5732
|
/* @__PURE__ */ r(
|
|
@@ -5744,7 +5745,7 @@ function Wa({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
5744
5745
|
onClick: g,
|
|
5745
5746
|
children: [
|
|
5746
5747
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
5747
|
-
/* @__PURE__ */ r("span", { children:
|
|
5748
|
+
/* @__PURE__ */ r("span", { children: wt(u) }),
|
|
5748
5749
|
/* @__PURE__ */ m("span", { children: [
|
|
5749
5750
|
h,
|
|
5750
5751
|
".",
|
|
@@ -5775,7 +5776,7 @@ function Wa({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
|
|
|
5775
5776
|
}
|
|
5776
5777
|
) }) : /* @__PURE__ */ r(ye, {});
|
|
5777
5778
|
}
|
|
5778
|
-
const Uo =
|
|
5779
|
+
const Uo = we.create({
|
|
5779
5780
|
name: "attachment",
|
|
5780
5781
|
content: "",
|
|
5781
5782
|
marks: "",
|
|
@@ -5790,14 +5791,14 @@ const Uo = pe.create({
|
|
|
5790
5791
|
HTMLAttributes: {
|
|
5791
5792
|
class: "attachment"
|
|
5792
5793
|
},
|
|
5793
|
-
button: ({ editor: t, t:
|
|
5794
|
+
button: ({ editor: t, t: n }) => ({
|
|
5794
5795
|
component: x,
|
|
5795
5796
|
componentProps: {
|
|
5796
5797
|
action: () => t.chain().focus().setAttachment().run(),
|
|
5797
5798
|
isActive: () => !1,
|
|
5798
5799
|
disabled: !1,
|
|
5799
5800
|
icon: "Attachment",
|
|
5800
|
-
tooltip:
|
|
5801
|
+
tooltip: n("editor.attachment.tooltip")
|
|
5801
5802
|
}
|
|
5802
5803
|
})
|
|
5803
5804
|
};
|
|
@@ -5808,14 +5809,14 @@ const Uo = pe.create({
|
|
|
5808
5809
|
renderHTML({ HTMLAttributes: e }) {
|
|
5809
5810
|
const {
|
|
5810
5811
|
url: t = "",
|
|
5811
|
-
fileName:
|
|
5812
|
-
fileSize:
|
|
5812
|
+
fileName: n = "",
|
|
5813
|
+
fileSize: i = "",
|
|
5813
5814
|
fileType: a = "",
|
|
5814
5815
|
fileExt: o = ""
|
|
5815
5816
|
} = e || {};
|
|
5816
5817
|
return [
|
|
5817
5818
|
"div",
|
|
5818
|
-
|
|
5819
|
+
pe(
|
|
5819
5820
|
// @ts-expect-error
|
|
5820
5821
|
this.options.HTMLAttributes || {},
|
|
5821
5822
|
e || {}
|
|
@@ -5826,12 +5827,12 @@ const Uo = pe.create({
|
|
|
5826
5827
|
[
|
|
5827
5828
|
"span",
|
|
5828
5829
|
{ class: "attachment__icon" },
|
|
5829
|
-
|
|
5830
|
+
wt(a, !0)
|
|
5830
5831
|
],
|
|
5831
5832
|
[
|
|
5832
5833
|
"span",
|
|
5833
5834
|
{ class: "attachment__text" },
|
|
5834
|
-
`${
|
|
5835
|
+
`${n}.${o} (${st(i)})`
|
|
5835
5836
|
]
|
|
5836
5837
|
] : ["div", { class: "attachment__placeholder" }]
|
|
5837
5838
|
];
|
|
@@ -5882,7 +5883,7 @@ export {
|
|
|
5882
5883
|
So as BaseKit,
|
|
5883
5884
|
Co as Blockquote,
|
|
5884
5885
|
co as Bold,
|
|
5885
|
-
|
|
5886
|
+
po as BulletList,
|
|
5886
5887
|
yo as Clear,
|
|
5887
5888
|
mo as Code,
|
|
5888
5889
|
xi as CodeBlock,
|
|
@@ -5898,7 +5899,7 @@ export {
|
|
|
5898
5899
|
bo as FontSize,
|
|
5899
5900
|
Io as FormatPainter,
|
|
5900
5901
|
_o as Heading,
|
|
5901
|
-
|
|
5902
|
+
wo as Highlight,
|
|
5902
5903
|
To as History,
|
|
5903
5904
|
Ao as HorizontalRule,
|
|
5904
5905
|
Go as Iframe,
|