reactjs-tiptap-editor-pro 0.2.25 → 0.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/RichTextEditor-DlFgd8H2.cjs +141 -0
- package/lib/{RichTextEditor-Bxdp3pW3.js → RichTextEditor-iBDjgtlT.js} +3328 -2840
- package/lib/extension-bundle.cjs +3 -3
- package/lib/extension-bundle.d.cts +61 -61
- package/lib/extension-bundle.d.ts +61 -61
- package/lib/extension-bundle.js +713 -889
- package/lib/{index-D-rys8BA.cjs → index-DV-nXpU1.cjs} +1 -1
- package/lib/{index-PJxla8pp.js → index-M6H3FoBi.js} +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +61 -61
- package/lib/index.d.ts +61 -61
- package/lib/index.js +2 -2
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +61 -61
- package/lib/locale-bundle.d.ts +61 -61
- package/lib/locale-bundle.js +1 -1
- package/lib/style.css +1 -1
- package/lib/{tiptap-Kst3Ray3.js → tiptap-DkWHMWDt.js} +57 -93
- package/lib/{tiptap-Bzsbnr3f.cjs → tiptap-gBG-1T-V.cjs} +11 -11
- package/lib/{vendor-LvbrNFNL.cjs → vendor-BJ0Yf78E.cjs} +4 -4
- package/lib/{vendor-tDefVoN_.js → vendor-Cpa6z-M0.js} +8 -7
- package/package.json +1 -1
- package/lib/RichTextEditor-zOI60NFQ.cjs +0 -141
package/lib/extension-bundle.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { P as te, b as Z, $ as
|
|
3
|
-
import { jsxs as
|
|
1
|
+
import { a as ft, I as gt, U as bt, S as xt, C as pt, f as oe, N as re, b as wt, c as yt, R as Se, F as kt, H as vt, T as Ct, E as A, d as Nt, e as At, g as Lt, h as ge, O as St, i as Tt, j as Et, k as Ht, L as zt, l as Mt, m as be, n as Pt, o as Rt, D as It, P as jt, p as Bt, q as Dt, G as Ot, r as $t, s as Ft, t as Ut, u as qt, v as Kt, w as Vt, x as Je, y as Ye, z as Qe, A as Te, M as Wt } from "./tiptap-DkWHMWDt.js";
|
|
2
|
+
import { P as te, b as Z, $ as se, a0 as ce, al as P, am as Gt, T as Xe, A as Zt, an as Jt, ao as Yt } from "./vendor-Cpa6z-M0.js";
|
|
3
|
+
import { jsxs as u, jsx as r, Fragment as xe } from "react/jsx-runtime";
|
|
4
4
|
import * as J from "react";
|
|
5
|
-
import
|
|
6
|
-
import { ChevronDown as
|
|
7
|
-
import { i as
|
|
8
|
-
import {
|
|
9
|
-
import { M as
|
|
10
|
-
import { bundledThemes as
|
|
11
|
-
import * as
|
|
12
|
-
import { Slot as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
5
|
+
import Qt, { useMemo as R, useState as C, useRef as G, useCallback as F, Fragment as Ee, forwardRef as He, useImperativeHandle as ze, useEffect as z } from "react";
|
|
6
|
+
import { ChevronDown as Me, Check as Xt, ChevronUp as en, Copy as tn, CopyCheck as nn, SearchIcon as an, LoaderIcon as on, LucideTableProperties as rn, LucideSheet as sn, LucideImage as cn, LucideFile as ln, LucideVideo as dn, LucideAudioLines as hn } from "lucide-react";
|
|
7
|
+
import { i as Pe, T as pe, a as we, B as V, b as ye, g as Re, A as x, D as Y, c as Q, d as X, e as un, f as T, u as Ie, h as mn, I as M, j as ne, k as et, l as Ae, m as _n, n as je, P as le, o as de, p as he, q as Be, C as fn, H as gn, L as bn, r as xn, M as pn, s as wn, t as Fe, v as me, w as K, E as D, x as yn, y as kn, V as vn, z as Ue, F as ke, G as qe, S as Cn, J as Nn, K as An, N as B, O as Ln, Q as Sn, U as Tn, W as En, X as Hn, Y as tt } from "./RichTextEditor-iBDjgtlT.js";
|
|
8
|
+
import { a4 as Ao, a0 as Lo, _ as So, a1 as To, $ as Eo, a2 as Ho, Z as zo, a3 as Mo } from "./RichTextEditor-iBDjgtlT.js";
|
|
9
|
+
import { M as zn, D as nt, u as j, f as Mn, g as Pn, h as Ke, i as N, j as it, k as Rn } from "./index-M6H3FoBi.js";
|
|
10
|
+
import { bundledThemes as at, bundledLanguages as ot, createHighlighter as In } from "shiki";
|
|
11
|
+
import * as v from "@radix-ui/react-select";
|
|
12
|
+
import { Slot as jn } from "@radix-ui/react-slot";
|
|
13
|
+
import De from "tippy.js";
|
|
14
|
+
import Oe from "scroll-into-view-if-needed";
|
|
15
15
|
import { EmojiPicker as W } from "frimousse";
|
|
16
|
-
import { Packer as
|
|
17
|
-
import { DocxSerializer as
|
|
18
|
-
const
|
|
16
|
+
import { Packer as Bn, WidthType as Dn } from "docx";
|
|
17
|
+
import { DocxSerializer as On, defaultNodes as U, defaultMarks as $n } from "prosemirror-docx";
|
|
18
|
+
const $e = Qt.forwardRef(
|
|
19
19
|
({ asChild: e, ...t }, n) => {
|
|
20
20
|
var o;
|
|
21
|
-
const i =
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */ r(
|
|
24
|
-
e ?
|
|
21
|
+
const i = Pe[t.icon];
|
|
22
|
+
return /* @__PURE__ */ u(pe, { children: [
|
|
23
|
+
/* @__PURE__ */ r(we, { asChild: !0, children: /* @__PURE__ */ r(
|
|
24
|
+
e ? jn : 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
28
|
ref: n,
|
|
29
29
|
variant: "ghost",
|
|
30
30
|
...t,
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ u("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
|
) }),
|
|
37
|
-
/* @__PURE__ */ r(
|
|
37
|
+
/* @__PURE__ */ r(ye, { children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
|
|
38
38
|
(t == null ? void 0 : t.tooltip) && /* @__PURE__ */ r("div", { children: t == null ? void 0 : t.tooltip }),
|
|
39
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children:
|
|
39
|
+
/* @__PURE__ */ r("div", { className: "richtext-flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: Re(t == null ? void 0 : t.shortcutKeys) }) })
|
|
40
40
|
] }) })
|
|
41
41
|
] });
|
|
42
42
|
}
|
|
43
|
-
),
|
|
43
|
+
), Ua = ft.extend({
|
|
44
44
|
addOptions() {
|
|
45
45
|
var e;
|
|
46
46
|
return {
|
|
@@ -58,7 +58,7 @@ const qe = dn.forwardRef(
|
|
|
58
58
|
})
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
}),
|
|
61
|
+
}), qa = gt.extend({
|
|
62
62
|
addOptions() {
|
|
63
63
|
var e;
|
|
64
64
|
return {
|
|
@@ -78,7 +78,7 @@ const qe = dn.forwardRef(
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
}),
|
|
81
|
+
}), Ka = bt.extend({
|
|
82
82
|
addOptions() {
|
|
83
83
|
var e;
|
|
84
84
|
return {
|
|
@@ -98,7 +98,7 @@ const qe = dn.forwardRef(
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
}),
|
|
101
|
+
}), Va = xt.extend({
|
|
102
102
|
addOptions() {
|
|
103
103
|
var e;
|
|
104
104
|
return {
|
|
@@ -116,7 +116,7 @@ const qe = dn.forwardRef(
|
|
|
116
116
|
})
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
}),
|
|
119
|
+
}), Wa = pt.extend({
|
|
120
120
|
addOptions() {
|
|
121
121
|
var e;
|
|
122
122
|
return {
|
|
@@ -135,38 +135,38 @@ const qe = dn.forwardRef(
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
-
let I,
|
|
139
|
-
const
|
|
140
|
-
function
|
|
138
|
+
let I, ie;
|
|
139
|
+
const ve = /* @__PURE__ */ new Set(), Ce = /* @__PURE__ */ new Set();
|
|
140
|
+
function Fn() {
|
|
141
141
|
return I;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
if (!I && !
|
|
143
|
+
function Un(e) {
|
|
144
|
+
if (!I && !ie) {
|
|
145
145
|
const t = e.themes.filter(
|
|
146
|
-
(i) => !!i && i in
|
|
146
|
+
(i) => !!i && i in at
|
|
147
147
|
), n = e.languages.filter(
|
|
148
|
-
(i) => !!i && i in
|
|
148
|
+
(i) => !!i && i in ot
|
|
149
149
|
);
|
|
150
|
-
return
|
|
150
|
+
return ie = In({ themes: t, langs: n }).then((i) => {
|
|
151
151
|
I = i;
|
|
152
|
-
}),
|
|
152
|
+
}), ie;
|
|
153
153
|
}
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
154
|
+
if (ie)
|
|
155
|
+
return ie;
|
|
156
156
|
}
|
|
157
|
-
async function
|
|
158
|
-
return I && !I.getLoadedThemes().includes(e) && !
|
|
157
|
+
async function rt(e) {
|
|
158
|
+
return I && !I.getLoadedThemes().includes(e) && !Ce.has(e) && e in at ? (Ce.add(e), await I.loadTheme(e), Ce.delete(e), !0) : !1;
|
|
159
159
|
}
|
|
160
|
-
async function
|
|
161
|
-
return I && !I.getLoadedLanguages().includes(e) && !
|
|
160
|
+
async function st(e) {
|
|
161
|
+
return I && !I.getLoadedLanguages().includes(e) && !ve.has(e) && e in ot ? (ve.add(e), await I.loadLanguage(e), ve.delete(e), !0) : !1;
|
|
162
162
|
}
|
|
163
|
-
async function
|
|
163
|
+
async function qn({
|
|
164
164
|
doc: e,
|
|
165
165
|
name: t,
|
|
166
166
|
defaultTheme: n,
|
|
167
167
|
defaultLanguage: i
|
|
168
168
|
}) {
|
|
169
|
-
const a =
|
|
169
|
+
const a = oe(e, (c) => c.type.name === t), o = [
|
|
170
170
|
...a.map((c) => c.node.attrs.theme),
|
|
171
171
|
n
|
|
172
172
|
], s = [
|
|
@@ -174,39 +174,39 @@ async function ti({
|
|
|
174
174
|
i
|
|
175
175
|
];
|
|
176
176
|
I ? await Promise.all([
|
|
177
|
-
...o.flatMap((c) =>
|
|
178
|
-
...s.flatMap((c) => !!c &&
|
|
179
|
-
]) : await
|
|
177
|
+
...o.flatMap((c) => rt(c)),
|
|
178
|
+
...s.flatMap((c) => !!c && st(c))
|
|
179
|
+
]) : await Un({ languages: s, themes: o });
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Ve({
|
|
182
182
|
doc: e,
|
|
183
183
|
name: t,
|
|
184
184
|
defaultTheme: n,
|
|
185
185
|
defaultLanguage: i
|
|
186
186
|
}) {
|
|
187
187
|
const a = [];
|
|
188
|
-
return
|
|
188
|
+
return oe(e, (s) => s.type.name === t).forEach((s) => {
|
|
189
189
|
let c = s.pos + 1, h = s.node.attrs.language || i;
|
|
190
|
-
const d = s.node.attrs.theme || n, l =
|
|
190
|
+
const d = s.node.attrs.theme || n, l = Fn();
|
|
191
191
|
if (!l)
|
|
192
192
|
return;
|
|
193
193
|
l.getLoadedLanguages().includes(h) || (h = "plaintext");
|
|
194
|
-
const
|
|
194
|
+
const m = l.getLoadedThemes().includes(d) ? d : l.getLoadedThemes()[0], _ = l.codeToTokensBase(s.node.textContent, {
|
|
195
195
|
lang: h,
|
|
196
|
-
theme:
|
|
196
|
+
theme: m
|
|
197
197
|
});
|
|
198
|
-
for (const
|
|
199
|
-
for (const
|
|
200
|
-
const
|
|
201
|
-
style: `color: ${
|
|
198
|
+
for (const f of _) {
|
|
199
|
+
for (const p of f) {
|
|
200
|
+
const w = c + p.content.length, L = ce.inline(c, w, {
|
|
201
|
+
style: `color: ${p.color}`
|
|
202
202
|
});
|
|
203
|
-
a.push(
|
|
203
|
+
a.push(L), c = w;
|
|
204
204
|
}
|
|
205
205
|
c += 1;
|
|
206
206
|
}
|
|
207
|
-
}),
|
|
207
|
+
}), se.create(e, a);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Kn({
|
|
210
210
|
name: e,
|
|
211
211
|
defaultLanguage: t,
|
|
212
212
|
defaultTheme: n
|
|
@@ -226,21 +226,21 @@ 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
|
|
229
|
+
await qn({ 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
|
}
|
|
233
233
|
// When new codeblocks were added and they have missing themes or
|
|
234
234
|
// languages, load those and then add code decorations once again.
|
|
235
235
|
async checkUndecoratedBlocks() {
|
|
236
|
-
const c =
|
|
236
|
+
const c = oe(
|
|
237
237
|
a.state.doc,
|
|
238
238
|
(l) => l.type.name === e
|
|
239
239
|
);
|
|
240
240
|
if ((await Promise.all(
|
|
241
241
|
c.flatMap((l) => [
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
rt(l.node.attrs.theme),
|
|
243
|
+
st(l.node.attrs.language)
|
|
244
244
|
])
|
|
245
245
|
)).includes(!0)) {
|
|
246
246
|
const l = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
|
|
@@ -251,21 +251,21 @@ function ni({
|
|
|
251
251
|
return new o();
|
|
252
252
|
},
|
|
253
253
|
state: {
|
|
254
|
-
init: (a, { doc: o }) =>
|
|
254
|
+
init: (a, { doc: o }) => Ve({
|
|
255
255
|
doc: o,
|
|
256
256
|
name: e,
|
|
257
257
|
defaultLanguage: t,
|
|
258
258
|
defaultTheme: n
|
|
259
259
|
}),
|
|
260
260
|
apply: (a, o, s, c) => {
|
|
261
|
-
const h = s.selection.$head.parent.type.name, d = c.selection.$head.parent.type.name, l =
|
|
261
|
+
const h = s.selection.$head.parent.type.name, d = c.selection.$head.parent.type.name, l = oe(
|
|
262
262
|
s.doc,
|
|
263
|
-
(
|
|
264
|
-
),
|
|
263
|
+
(f) => f.type.name === e
|
|
264
|
+
), m = oe(
|
|
265
265
|
c.doc,
|
|
266
|
-
(
|
|
267
|
-
),
|
|
268
|
-
return a.getMeta("shikiPluginForceDecoration") ||
|
|
266
|
+
(f) => f.type.name === e
|
|
267
|
+
), _ = a.docChanged && ([h, d].includes(e) || m.length !== l.length || a.steps.some((f) => f.from !== void 0 && f.to !== void 0 && l.some((p) => p.pos >= f.from && p.pos + p.node.nodeSize <= f.to)));
|
|
268
|
+
return a.getMeta("shikiPluginForceDecoration") || _ ? Ve({
|
|
269
269
|
doc: a.doc,
|
|
270
270
|
name: e,
|
|
271
271
|
defaultLanguage: t,
|
|
@@ -282,16 +282,16 @@ function ni({
|
|
|
282
282
|
});
|
|
283
283
|
return i;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Vn({ action: e, languages: t, ...n }) {
|
|
286
286
|
const i = (o) => {
|
|
287
287
|
e(o);
|
|
288
|
-
}, a =
|
|
289
|
-
title:
|
|
288
|
+
}, a = R(() => t == null ? void 0 : t.map((o) => ({
|
|
289
|
+
title: zn[o] || o,
|
|
290
290
|
// icon: language.icon,
|
|
291
291
|
language: o
|
|
292
292
|
})), [t]);
|
|
293
|
-
return /* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */ r(
|
|
293
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
294
|
+
/* @__PURE__ */ r(Q, { disabled: n == null ? void 0 : n.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
295
295
|
x,
|
|
296
296
|
{
|
|
297
297
|
tooltip: n == null ? void 0 : n.tooltip,
|
|
@@ -299,56 +299,56 @@ function ii({ action: e, languages: t, ...n }) {
|
|
|
299
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(
|
|
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(un, { 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
|
|
306
|
-
|
|
305
|
+
const Wn = v.Root, Gn = v.Value, ct = J.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ u(
|
|
306
|
+
v.Trigger,
|
|
307
307
|
{
|
|
308
308
|
ref: i,
|
|
309
|
-
className:
|
|
309
|
+
className: T(
|
|
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
|
-
/* @__PURE__ */ r(
|
|
316
|
+
/* @__PURE__ */ r(v.Icon, { asChild: !0, children: /* @__PURE__ */ r(Me, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
|
|
317
317
|
]
|
|
318
318
|
}
|
|
319
319
|
));
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
|
|
320
|
+
ct.displayName = v.Trigger.displayName;
|
|
321
|
+
const lt = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
322
|
+
v.ScrollUpButton,
|
|
323
323
|
{
|
|
324
324
|
ref: n,
|
|
325
|
-
className:
|
|
325
|
+
className: T(
|
|
326
326
|
"richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
|
|
327
327
|
e
|
|
328
328
|
),
|
|
329
329
|
...t,
|
|
330
|
-
children: /* @__PURE__ */ r(
|
|
330
|
+
children: /* @__PURE__ */ r(en, { className: "richtext-h-4 richtext-w-4" })
|
|
331
331
|
}
|
|
332
332
|
));
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
|
|
333
|
+
lt.displayName = v.ScrollUpButton.displayName;
|
|
334
|
+
const dt = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
335
|
+
v.ScrollDownButton,
|
|
336
336
|
{
|
|
337
337
|
ref: n,
|
|
338
|
-
className:
|
|
338
|
+
className: T(
|
|
339
339
|
"richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
|
|
340
340
|
e
|
|
341
341
|
),
|
|
342
342
|
...t,
|
|
343
|
-
children: /* @__PURE__ */ r(
|
|
343
|
+
children: /* @__PURE__ */ r(Me, { className: "richtext-h-4 richtext-w-4" })
|
|
344
344
|
}
|
|
345
345
|
));
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
|
|
346
|
+
dt.displayName = v.ScrollDownButton.displayName;
|
|
347
|
+
const ht = J.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */ r(v.Portal, { children: /* @__PURE__ */ u(
|
|
348
|
+
v.Content,
|
|
349
349
|
{
|
|
350
350
|
ref: a,
|
|
351
|
-
className:
|
|
351
|
+
className: T(
|
|
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
|
|
@@ -356,58 +356,58 @@ const bt = J.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
356
356
|
position: n,
|
|
357
357
|
...i,
|
|
358
358
|
children: [
|
|
359
|
-
/* @__PURE__ */ r(
|
|
359
|
+
/* @__PURE__ */ r(lt, {}),
|
|
360
360
|
/* @__PURE__ */ r(
|
|
361
|
-
|
|
361
|
+
v.Viewport,
|
|
362
362
|
{
|
|
363
|
-
className:
|
|
363
|
+
className: T(
|
|
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
|
}
|
|
369
369
|
),
|
|
370
|
-
/* @__PURE__ */ r(
|
|
370
|
+
/* @__PURE__ */ r(dt, {})
|
|
371
371
|
]
|
|
372
372
|
}
|
|
373
373
|
) }));
|
|
374
|
-
|
|
375
|
-
const
|
|
376
|
-
|
|
374
|
+
ht.displayName = v.Content.displayName;
|
|
375
|
+
const Zn = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
376
|
+
v.Label,
|
|
377
377
|
{
|
|
378
378
|
ref: n,
|
|
379
|
-
className:
|
|
379
|
+
className: T("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
|
-
|
|
384
|
-
const
|
|
385
|
-
|
|
383
|
+
Zn.displayName = v.Label.displayName;
|
|
384
|
+
const Le = J.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ u(
|
|
385
|
+
v.Item,
|
|
386
386
|
{
|
|
387
387
|
ref: i,
|
|
388
|
-
className:
|
|
388
|
+
className: T(
|
|
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
|
-
/* @__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(
|
|
395
|
-
/* @__PURE__ */ r(
|
|
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(v.ItemIndicator, { children: /* @__PURE__ */ r(Xt, { className: "richtext-h-4 richtext-w-4" }) }) }),
|
|
395
|
+
/* @__PURE__ */ r(v.ItemText, { children: t })
|
|
396
396
|
]
|
|
397
397
|
}
|
|
398
398
|
));
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
|
|
399
|
+
Le.displayName = v.Item.displayName;
|
|
400
|
+
const Jn = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
401
|
+
v.Separator,
|
|
402
402
|
{
|
|
403
403
|
ref: n,
|
|
404
|
-
className:
|
|
404
|
+
className: T("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", e),
|
|
405
405
|
...t
|
|
406
406
|
}
|
|
407
407
|
));
|
|
408
|
-
|
|
409
|
-
function
|
|
410
|
-
const [e, t] =
|
|
408
|
+
Jn.displayName = v.Separator.displayName;
|
|
409
|
+
function Yn() {
|
|
410
|
+
const [e, t] = C(!1);
|
|
411
411
|
return { isCopied: e, copyToClipboard: async (i) => {
|
|
412
412
|
try {
|
|
413
413
|
await navigator.clipboard.writeText(i), t(!0), setTimeout(() => t(!1), 2e3);
|
|
@@ -416,68 +416,68 @@ function ci() {
|
|
|
416
416
|
}
|
|
417
417
|
} };
|
|
418
418
|
}
|
|
419
|
-
const
|
|
420
|
-
wrap:
|
|
421
|
-
maxHeight:
|
|
422
|
-
btnCopy:
|
|
423
|
-
btnDelete:
|
|
424
|
-
blockInfo:
|
|
425
|
-
blockInfoEditable:
|
|
426
|
-
selectLang:
|
|
427
|
-
copied:
|
|
419
|
+
const Qn = "_wrap_134f4_1", Xn = "_maxHeight_134f4_10", ei = "_btnCopy_134f4_13", ti = "_btnDelete_134f4_14", ni = "_blockInfo_134f4_18", ii = "_blockInfoEditable_134f4_28", ai = "_selectLang_134f4_32", oi = "_copied_134f4_58", $ = {
|
|
420
|
+
wrap: Qn,
|
|
421
|
+
maxHeight: Xn,
|
|
422
|
+
btnCopy: ei,
|
|
423
|
+
btnDelete: ti,
|
|
424
|
+
blockInfo: ni,
|
|
425
|
+
blockInfoEditable: ii,
|
|
426
|
+
selectLang: ai,
|
|
427
|
+
copied: oi
|
|
428
428
|
};
|
|
429
|
-
function
|
|
430
|
-
var
|
|
431
|
-
const { isCopied: a, copyToClipboard: o } =
|
|
432
|
-
var
|
|
433
|
-
return (
|
|
434
|
-
}, [i.options.languages]), c =
|
|
435
|
-
return /* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
429
|
+
function ri({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }) {
|
|
430
|
+
var _, f;
|
|
431
|
+
const { isCopied: a, copyToClipboard: o } = Yn(), s = R(() => {
|
|
432
|
+
var p;
|
|
433
|
+
return (p = i.options.languages) != null && p.length ? i.options.languages : nt;
|
|
434
|
+
}, [i.options.languages]), c = Ie(), h = (f = (_ = e == null ? void 0 : e.options) == null ? void 0 : _.editorProps) == null ? void 0 : f.print, { language: d } = t, l = G(null), m = F(() => mn(si.name, e), [e]);
|
|
435
|
+
return /* @__PURE__ */ u(re, { className: P($.wrap, !h && $.maxHeight, "render-wrapper"), children: [
|
|
436
|
+
/* @__PURE__ */ u(
|
|
437
437
|
"div",
|
|
438
438
|
{
|
|
439
|
-
className:
|
|
439
|
+
className: P($.blockInfo, {
|
|
440
440
|
[$.blockInfoEditable]: !c
|
|
441
441
|
}),
|
|
442
442
|
children: [
|
|
443
443
|
/* @__PURE__ */ r(
|
|
444
444
|
"span",
|
|
445
445
|
{
|
|
446
|
-
className:
|
|
446
|
+
className: P($.btnCopy, a && $.copied),
|
|
447
447
|
onClick: () => o(l.current.innerText),
|
|
448
|
-
children: a ? /* @__PURE__ */ r(
|
|
448
|
+
children: a ? /* @__PURE__ */ r(nn, { size: 16 }) : /* @__PURE__ */ r(tn, { size: 16 })
|
|
449
449
|
}
|
|
450
450
|
),
|
|
451
451
|
/* @__PURE__ */ r(
|
|
452
452
|
"span",
|
|
453
453
|
{
|
|
454
454
|
className: $.btnDelete,
|
|
455
|
-
onClick:
|
|
455
|
+
onClick: m,
|
|
456
456
|
children: /* @__PURE__ */ r(
|
|
457
|
-
|
|
457
|
+
M,
|
|
458
458
|
{
|
|
459
459
|
name: "Trash2"
|
|
460
460
|
}
|
|
461
461
|
)
|
|
462
462
|
}
|
|
463
463
|
),
|
|
464
|
-
/* @__PURE__ */ r("div", { className: $.selectLang, children: /* @__PURE__ */
|
|
465
|
-
|
|
464
|
+
/* @__PURE__ */ r("div", { className: $.selectLang, children: /* @__PURE__ */ u(
|
|
465
|
+
Wn,
|
|
466
466
|
{
|
|
467
467
|
defaultValue: d || "auto",
|
|
468
468
|
disabled: !c,
|
|
469
|
-
onValueChange: (
|
|
469
|
+
onValueChange: (p) => n({ language: p }),
|
|
470
470
|
children: [
|
|
471
|
-
/* @__PURE__ */ r(
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */ r(
|
|
474
|
-
s.map((
|
|
475
|
-
|
|
471
|
+
/* @__PURE__ */ r(ct, { children: /* @__PURE__ */ r(Gn, { placeholder: "Language" }) }),
|
|
472
|
+
/* @__PURE__ */ u(ht, { className: "richtext-max-h-60 richtext-overflow-y-auto", children: [
|
|
473
|
+
/* @__PURE__ */ r(Le, { value: "auto", children: "Auto" }),
|
|
474
|
+
s.map((p, w) => /* @__PURE__ */ r(
|
|
475
|
+
Le,
|
|
476
476
|
{
|
|
477
|
-
value:
|
|
478
|
-
children:
|
|
477
|
+
value: p,
|
|
478
|
+
children: p.charAt(0).toUpperCase() + p.slice(1)
|
|
479
479
|
},
|
|
480
|
-
`code-lang-${
|
|
480
|
+
`code-lang-${w}`
|
|
481
481
|
))
|
|
482
482
|
] })
|
|
483
483
|
]
|
|
@@ -486,10 +486,10 @@ function bi({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
|
|
|
486
486
|
]
|
|
487
487
|
}
|
|
488
488
|
),
|
|
489
|
-
/* @__PURE__ */ r("pre", { ref: l, children: /* @__PURE__ */ r(
|
|
489
|
+
/* @__PURE__ */ r("pre", { ref: l, children: /* @__PURE__ */ r(wt, { as: "code" }) })
|
|
490
490
|
] });
|
|
491
491
|
}
|
|
492
|
-
const
|
|
492
|
+
const si = yt.extend({
|
|
493
493
|
addOptions() {
|
|
494
494
|
var e;
|
|
495
495
|
return {
|
|
@@ -497,9 +497,9 @@ const xi = Tt.extend({
|
|
|
497
497
|
languages: [],
|
|
498
498
|
button: ({ editor: t, t: n, extension: i }) => {
|
|
499
499
|
var o, s, c;
|
|
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 :
|
|
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 : nt;
|
|
501
501
|
return {
|
|
502
|
-
component:
|
|
502
|
+
component: Vn,
|
|
503
503
|
componentProps: {
|
|
504
504
|
action: (h = "js") => t.commands.setCodeBlock({
|
|
505
505
|
language: h
|
|
@@ -515,13 +515,13 @@ const xi = Tt.extend({
|
|
|
515
515
|
};
|
|
516
516
|
},
|
|
517
517
|
addNodeView() {
|
|
518
|
-
return
|
|
518
|
+
return Se(ri);
|
|
519
519
|
},
|
|
520
520
|
addProseMirrorPlugins() {
|
|
521
521
|
var e;
|
|
522
522
|
return [
|
|
523
523
|
...((e = this.parent) == null ? void 0 : e.call(this)) || [],
|
|
524
|
-
|
|
524
|
+
Kn({
|
|
525
525
|
name: this.name,
|
|
526
526
|
defaultLanguage: null,
|
|
527
527
|
defaultTheme: this.options.defaultTheme
|
|
@@ -529,9 +529,9 @@ const xi = Tt.extend({
|
|
|
529
529
|
];
|
|
530
530
|
}
|
|
531
531
|
});
|
|
532
|
-
function
|
|
532
|
+
function ci(e) {
|
|
533
533
|
var a, o, s;
|
|
534
|
-
const { t, lang: n } =
|
|
534
|
+
const { t, lang: n } = j(), i = R(() => {
|
|
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 ? {
|
|
@@ -544,14 +544,14 @@ function wi(e) {
|
|
|
544
544
|
action: () => e.editor.chain().focus().unsetFontFamily().run()
|
|
545
545
|
};
|
|
546
546
|
}, [t, n, e]);
|
|
547
|
-
return /* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
548
548
|
/* @__PURE__ */ r(
|
|
549
|
-
|
|
549
|
+
Q,
|
|
550
550
|
{
|
|
551
551
|
asChild: !0,
|
|
552
552
|
disabled: e == null ? void 0 : e.disabled,
|
|
553
553
|
children: /* @__PURE__ */ r(
|
|
554
|
-
|
|
554
|
+
$e,
|
|
555
555
|
{
|
|
556
556
|
disabled: e == null ? void 0 : e.disabled,
|
|
557
557
|
icon: "MenuDown",
|
|
@@ -563,7 +563,7 @@ function wi(e) {
|
|
|
563
563
|
),
|
|
564
564
|
/* @__PURE__ */ r(X, { className: "richtext-w-full", children: (s = e == null ? void 0 : e.items) == null ? void 0 : s.map((c, h) => {
|
|
565
565
|
const d = c.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: c.font };
|
|
566
|
-
return /* @__PURE__ */
|
|
566
|
+
return /* @__PURE__ */ u(Ee, { children: [
|
|
567
567
|
/* @__PURE__ */ r(
|
|
568
568
|
ne,
|
|
569
569
|
{
|
|
@@ -579,20 +579,20 @@ function wi(e) {
|
|
|
579
579
|
)
|
|
580
580
|
}
|
|
581
581
|
),
|
|
582
|
-
c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(
|
|
582
|
+
c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(et, {})
|
|
583
583
|
] }, `font-family-${h}`);
|
|
584
584
|
}) })
|
|
585
585
|
] });
|
|
586
586
|
}
|
|
587
|
-
const
|
|
587
|
+
const Ga = kt.extend({
|
|
588
588
|
addOptions() {
|
|
589
589
|
var e;
|
|
590
590
|
return {
|
|
591
591
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
592
|
-
fontFamilyList:
|
|
592
|
+
fontFamilyList: Mn,
|
|
593
593
|
button({ editor: t, extension: n, t: i }) {
|
|
594
594
|
var d;
|
|
595
|
-
const { extensions: a = [] } = t.extensionManager ?? [], o =
|
|
595
|
+
const { extensions: a = [] } = t.extensionManager ?? [], o = Ae(((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: () => {
|
|
@@ -612,7 +612,7 @@ const fo = Lt.extend({
|
|
|
612
612
|
});
|
|
613
613
|
const h = c.filter((l) => l.disabled).length === c.length;
|
|
614
614
|
return {
|
|
615
|
-
component:
|
|
615
|
+
component: ci,
|
|
616
616
|
componentProps: {
|
|
617
617
|
tooltip: i("editor.fontFamily.tooltip"),
|
|
618
618
|
disabled: h,
|
|
@@ -624,9 +624,9 @@ const fo = Lt.extend({
|
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
626
|
});
|
|
627
|
-
function
|
|
627
|
+
function li(e) {
|
|
628
628
|
var n;
|
|
629
|
-
const t =
|
|
629
|
+
const t = R(() => {
|
|
630
630
|
var o;
|
|
631
631
|
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
632
632
|
return i && !i.default ? {
|
|
@@ -637,14 +637,14 @@ function pi(e) {
|
|
|
637
637
|
isActive: () => !1
|
|
638
638
|
};
|
|
639
639
|
}, [e]);
|
|
640
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
641
641
|
/* @__PURE__ */ r(
|
|
642
|
-
|
|
642
|
+
Q,
|
|
643
643
|
{
|
|
644
644
|
asChild: !0,
|
|
645
645
|
disabled: e == null ? void 0 : e.disabled,
|
|
646
646
|
children: /* @__PURE__ */ r(
|
|
647
|
-
|
|
647
|
+
$e,
|
|
648
648
|
{
|
|
649
649
|
disabled: e == null ? void 0 : e.disabled,
|
|
650
650
|
icon: "MenuDown",
|
|
@@ -656,24 +656,24 @@ function pi(e) {
|
|
|
656
656
|
),
|
|
657
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
|
-
return /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
659
|
+
return /* @__PURE__ */ u(Ee, { children: [
|
|
660
|
+
/* @__PURE__ */ u(
|
|
661
661
|
ne,
|
|
662
662
|
{
|
|
663
663
|
checked: (t == null ? void 0 : t.title) === i.title,
|
|
664
664
|
onClick: i.action,
|
|
665
665
|
children: [
|
|
666
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(
|
|
667
|
+
!!((o = i == null ? void 0 : i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r(_n, { className: "richtext-pl-4", children: (s = i == null ? void 0 : i.shortcutKeys) == null ? void 0 : s.map((c) => je(c)).join(" ") })
|
|
668
668
|
]
|
|
669
669
|
}
|
|
670
670
|
),
|
|
671
|
-
i.level === 0 && /* @__PURE__ */ r(
|
|
671
|
+
i.level === 0 && /* @__PURE__ */ r(et, {})
|
|
672
672
|
] }, `heading-k-${a}`);
|
|
673
673
|
}) })
|
|
674
674
|
] });
|
|
675
675
|
}
|
|
676
|
-
const
|
|
676
|
+
const Za = vt.extend({
|
|
677
677
|
addOptions() {
|
|
678
678
|
var e;
|
|
679
679
|
return {
|
|
@@ -701,7 +701,7 @@ const _o = St.extend({
|
|
|
701
701
|
});
|
|
702
702
|
const h = c.filter((l) => l.disabled).length === c.length;
|
|
703
703
|
return {
|
|
704
|
-
component:
|
|
704
|
+
component: li,
|
|
705
705
|
componentProps: {
|
|
706
706
|
tooltip: i("editor.heading.tooltip"),
|
|
707
707
|
disabled: h,
|
|
@@ -713,9 +713,9 @@ const _o = St.extend({
|
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
|
-
function
|
|
716
|
+
function di(e) {
|
|
717
717
|
var n;
|
|
718
|
-
const t =
|
|
718
|
+
const t = R(() => {
|
|
719
719
|
var o;
|
|
720
720
|
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
721
721
|
return i && !i.default ? {
|
|
@@ -727,9 +727,9 @@ function yi(e) {
|
|
|
727
727
|
isActive: () => !1
|
|
728
728
|
};
|
|
729
729
|
}, [e]);
|
|
730
|
-
return /* @__PURE__ */
|
|
730
|
+
return /* @__PURE__ */ u(le, { modal: !0, children: [
|
|
731
731
|
/* @__PURE__ */ r(
|
|
732
|
-
|
|
732
|
+
de,
|
|
733
733
|
{
|
|
734
734
|
asChild: !0,
|
|
735
735
|
disabled: e == null ? void 0 : e.disabled,
|
|
@@ -741,7 +741,7 @@ function yi(e) {
|
|
|
741
741
|
icon: e == null ? void 0 : e.icon,
|
|
742
742
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
743
743
|
children: /* @__PURE__ */ r(
|
|
744
|
-
|
|
744
|
+
M,
|
|
745
745
|
{
|
|
746
746
|
className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
|
|
747
747
|
name: "MenuDown"
|
|
@@ -752,28 +752,28 @@ function yi(e) {
|
|
|
752
752
|
}
|
|
753
753
|
),
|
|
754
754
|
/* @__PURE__ */ r(
|
|
755
|
-
|
|
755
|
+
he,
|
|
756
756
|
{
|
|
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
760
|
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
|
|
761
761
|
var o, s;
|
|
762
|
-
return /* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */ r(
|
|
764
|
-
|
|
762
|
+
return /* @__PURE__ */ u(pe, { children: [
|
|
763
|
+
/* @__PURE__ */ r(we, { asChild: !0, children: /* @__PURE__ */ r(
|
|
764
|
+
Be,
|
|
765
765
|
{
|
|
766
766
|
className: "richtext-size-7 richtext-p-1",
|
|
767
767
|
"data-state": t.title === i.title ? "on" : "off",
|
|
768
768
|
onClick: i == null ? void 0 : i.action,
|
|
769
769
|
pressed: t.title === i.title,
|
|
770
770
|
size: "sm",
|
|
771
|
-
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(
|
|
771
|
+
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(M, { name: i.icon })
|
|
772
772
|
}
|
|
773
773
|
) }),
|
|
774
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ u(ye, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
775
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) =>
|
|
776
|
+
!!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => je(c)).join(" ") })
|
|
777
777
|
] })
|
|
778
778
|
] }, `text-align-${a}`);
|
|
779
779
|
})
|
|
@@ -781,7 +781,7 @@ function yi(e) {
|
|
|
781
781
|
)
|
|
782
782
|
] });
|
|
783
783
|
}
|
|
784
|
-
const
|
|
784
|
+
const Ja = Ct.extend({
|
|
785
785
|
addOptions() {
|
|
786
786
|
var e;
|
|
787
787
|
return {
|
|
@@ -804,21 +804,21 @@ const go = Et.extend({
|
|
|
804
804
|
right: "AlignRight",
|
|
805
805
|
justify: "AlignJustify"
|
|
806
806
|
}, c = a.map((l) => {
|
|
807
|
-
var
|
|
807
|
+
var m, _, f;
|
|
808
808
|
return {
|
|
809
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 p, w;
|
|
815
|
+
return (w = (p = t.commands) == null ? void 0 : p.setTextAlign) == null ? void 0 : w.call(p, l);
|
|
816
816
|
},
|
|
817
|
-
disabled: !((
|
|
817
|
+
disabled: !((f = (_ = (m = t == null ? void 0 : t.can) == null ? void 0 : m.call(t)) == null ? void 0 : _.setTextAlign) != null && f.call(_, l))
|
|
818
818
|
};
|
|
819
819
|
}), h = c.filter((l) => l.disabled).length === c.length;
|
|
820
820
|
return {
|
|
821
|
-
component:
|
|
821
|
+
component: di,
|
|
822
822
|
componentProps: {
|
|
823
823
|
icon: "AlignJustify",
|
|
824
824
|
tooltip: i("editor.textalign.tooltip"),
|
|
@@ -830,23 +830,23 @@ const go = Et.extend({
|
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
832
|
});
|
|
833
|
-
function
|
|
833
|
+
function hi(e) {
|
|
834
834
|
var i;
|
|
835
|
-
const { t } =
|
|
835
|
+
const { t } = j(), n = R(() => {
|
|
836
836
|
const a = (e.items || []).find((s) => s.isActive());
|
|
837
837
|
return a || {
|
|
838
838
|
title: t("editor.fontSize.default.tooltip"),
|
|
839
839
|
isActive: () => !1
|
|
840
840
|
};
|
|
841
841
|
}, [e]);
|
|
842
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
843
843
|
/* @__PURE__ */ r(
|
|
844
|
-
|
|
844
|
+
Q,
|
|
845
845
|
{
|
|
846
846
|
asChild: !0,
|
|
847
847
|
disabled: e == null ? void 0 : e.disabled,
|
|
848
848
|
children: /* @__PURE__ */ r(
|
|
849
|
-
|
|
849
|
+
$e,
|
|
850
850
|
{
|
|
851
851
|
disabled: e == null ? void 0 : e.disabled,
|
|
852
852
|
icon: "MenuDown",
|
|
@@ -867,17 +867,17 @@ function ki(e) {
|
|
|
867
867
|
)) })
|
|
868
868
|
] });
|
|
869
869
|
}
|
|
870
|
-
const
|
|
870
|
+
const Ya = A.create({
|
|
871
871
|
name: "fontSize",
|
|
872
872
|
addOptions() {
|
|
873
873
|
var e;
|
|
874
874
|
return {
|
|
875
875
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
876
876
|
types: ["textStyle"],
|
|
877
|
-
fontSizes: [...
|
|
877
|
+
fontSizes: [...Pn],
|
|
878
878
|
button({ editor: t, extension: n, t: i }) {
|
|
879
879
|
var h;
|
|
880
|
-
const a =
|
|
880
|
+
const a = Ae(((h = n.options) == null ? void 0 : h.fontSizes) || Ke), o = Ae([Ke])[0], s = a.map((d) => ({
|
|
881
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");
|
|
@@ -895,7 +895,7 @@ const bo = N.create({
|
|
|
895
895
|
default: d.value === o.value || !1
|
|
896
896
|
})), c = s.filter((d) => d.disabled).length === s.length;
|
|
897
897
|
return {
|
|
898
|
-
component:
|
|
898
|
+
component: hi,
|
|
899
899
|
componentProps: {
|
|
900
900
|
editor: t,
|
|
901
901
|
tooltip: i("editor.fontSize.tooltip"),
|
|
@@ -930,7 +930,7 @@ const bo = N.create({
|
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
932
|
});
|
|
933
|
-
function
|
|
933
|
+
function ui({ fill: e }) {
|
|
934
934
|
return /* @__PURE__ */ r(
|
|
935
935
|
"svg",
|
|
936
936
|
{
|
|
@@ -939,7 +939,7 @@ function vi({ fill: e }) {
|
|
|
939
939
|
viewBox: "0 0 240 240",
|
|
940
940
|
version: "1.1",
|
|
941
941
|
xmlns: "http://www.w3.org/2000/svg",
|
|
942
|
-
children: /* @__PURE__ */ r("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ r("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */
|
|
942
|
+
children: /* @__PURE__ */ r("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ r("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */ u("g", { transform: "translate(39.000000, 17.353553)", children: [
|
|
943
943
|
/* @__PURE__ */ r(
|
|
944
944
|
"path",
|
|
945
945
|
{
|
|
@@ -971,8 +971,8 @@ function vi({ fill: e }) {
|
|
|
971
971
|
}
|
|
972
972
|
);
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
const [t, n] =
|
|
974
|
+
function mi(e) {
|
|
975
|
+
const [t, n] = C(void 0);
|
|
976
976
|
function i(s) {
|
|
977
977
|
var c;
|
|
978
978
|
(c = e.action) == null || c.call(e, s);
|
|
@@ -982,15 +982,15 @@ function Ci(e) {
|
|
|
982
982
|
(s = e.action) == null || s.call(e, t);
|
|
983
983
|
}
|
|
984
984
|
const o = F(
|
|
985
|
-
|
|
985
|
+
Gt((s) => {
|
|
986
986
|
n(s);
|
|
987
987
|
}, 350),
|
|
988
988
|
[]
|
|
989
989
|
);
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */ r(x, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ r("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ r(
|
|
990
|
+
return /* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-h-[32px]", children: [
|
|
991
|
+
/* @__PURE__ */ r(x, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ r("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ r(ui, { fill: t }) }) }),
|
|
992
992
|
/* @__PURE__ */ r(
|
|
993
|
-
|
|
993
|
+
fn,
|
|
994
994
|
{
|
|
995
995
|
selectedColor: t,
|
|
996
996
|
setSelectedColor: o,
|
|
@@ -998,19 +998,19 @@ function Ci(e) {
|
|
|
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,
|
|
1001
|
-
children: /* @__PURE__ */ r(V, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(
|
|
1001
|
+
children: /* @__PURE__ */ r(V, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(M, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
] });
|
|
1005
1005
|
}
|
|
1006
|
-
const
|
|
1006
|
+
const Qa = Nt.extend({
|
|
1007
1007
|
addOptions() {
|
|
1008
1008
|
var e;
|
|
1009
1009
|
return {
|
|
1010
1010
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1011
1011
|
button({ editor: t, t: n, extension: i }) {
|
|
1012
1012
|
return {
|
|
1013
|
-
component:
|
|
1013
|
+
component: mi,
|
|
1014
1014
|
componentProps: {
|
|
1015
1015
|
colors: i.options.colors,
|
|
1016
1016
|
defaultColor: i.options.defaultColor,
|
|
@@ -1029,14 +1029,14 @@ const xo = Ht.extend({
|
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
|
-
}),
|
|
1032
|
+
}), Xa = At.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
1038
|
button: ({ editor: t, t: n }) => ({
|
|
1039
|
-
component:
|
|
1039
|
+
component: gn,
|
|
1040
1040
|
componentProps: {
|
|
1041
1041
|
action: (i) => {
|
|
1042
1042
|
typeof i == "string" && t.chain().focus().setHighlight({ color: i }).run(), i === void 0 && t.chain().focus().unsetHighlight().run();
|
|
@@ -1050,7 +1050,7 @@ const xo = Ht.extend({
|
|
|
1050
1050
|
})
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
|
-
}),
|
|
1053
|
+
}), eo = Lt.extend({
|
|
1054
1054
|
addOptions() {
|
|
1055
1055
|
var e;
|
|
1056
1056
|
return {
|
|
@@ -1068,7 +1068,7 @@ const xo = Ht.extend({
|
|
|
1068
1068
|
})
|
|
1069
1069
|
};
|
|
1070
1070
|
}
|
|
1071
|
-
}),
|
|
1071
|
+
}), to = ge.create({
|
|
1072
1072
|
name: "clear",
|
|
1073
1073
|
addOptions() {
|
|
1074
1074
|
var e;
|
|
@@ -1085,7 +1085,7 @@ const xo = Ht.extend({
|
|
|
1085
1085
|
})
|
|
1086
1086
|
};
|
|
1087
1087
|
}
|
|
1088
|
-
}),
|
|
1088
|
+
}), no = St.extend({
|
|
1089
1089
|
addOptions() {
|
|
1090
1090
|
var e;
|
|
1091
1091
|
return {
|
|
@@ -1103,7 +1103,7 @@ const xo = Ht.extend({
|
|
|
1103
1103
|
})
|
|
1104
1104
|
};
|
|
1105
1105
|
}
|
|
1106
|
-
}),
|
|
1106
|
+
}), io = Tt.extend({
|
|
1107
1107
|
addOptions() {
|
|
1108
1108
|
var e;
|
|
1109
1109
|
return {
|
|
@@ -1130,9 +1130,9 @@ const xo = Ht.extend({
|
|
|
1130
1130
|
};
|
|
1131
1131
|
},
|
|
1132
1132
|
addExtensions() {
|
|
1133
|
-
return [
|
|
1133
|
+
return [Et.configure(this.options.taskItem)];
|
|
1134
1134
|
}
|
|
1135
|
-
}),
|
|
1135
|
+
}), ao = Ht.extend({
|
|
1136
1136
|
addOptions() {
|
|
1137
1137
|
var e;
|
|
1138
1138
|
return {
|
|
@@ -1154,25 +1154,25 @@ const xo = Ht.extend({
|
|
|
1154
1154
|
};
|
|
1155
1155
|
}
|
|
1156
1156
|
});
|
|
1157
|
-
function
|
|
1158
|
-
const [t, n] =
|
|
1157
|
+
function _i(e) {
|
|
1158
|
+
const [t, n] = C(!1);
|
|
1159
1159
|
function i(a, o, s) {
|
|
1160
1160
|
e.action && (e.action({ link: a, text: o, openInNewTab: s }), n(!1));
|
|
1161
1161
|
}
|
|
1162
|
-
return /* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */ r(
|
|
1162
|
+
return /* @__PURE__ */ u(le, { modal: !0, open: t, onOpenChange: n, children: [
|
|
1163
|
+
/* @__PURE__ */ r(de, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
|
|
1164
1164
|
x,
|
|
1165
1165
|
{
|
|
1166
1166
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1167
1167
|
isActive: e == null ? void 0 : e.isActive,
|
|
1168
1168
|
disabled: e == null ? void 0 : e.disabled,
|
|
1169
|
-
children: /* @__PURE__ */ r(
|
|
1169
|
+
children: /* @__PURE__ */ r(M, { name: e == null ? void 0 : e.icon })
|
|
1170
1170
|
}
|
|
1171
1171
|
) }),
|
|
1172
|
-
/* @__PURE__ */ r(
|
|
1172
|
+
/* @__PURE__ */ r(he, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(bn, { editor: e.editor, onSetLink: i }) })
|
|
1173
1173
|
] });
|
|
1174
1174
|
}
|
|
1175
|
-
const
|
|
1175
|
+
const oo = zt.extend({
|
|
1176
1176
|
inclusive: !1,
|
|
1177
1177
|
parseHTML() {
|
|
1178
1178
|
return [
|
|
@@ -1184,7 +1184,7 @@ const No = jt.extend({
|
|
|
1184
1184
|
renderHTML({ HTMLAttributes: e }) {
|
|
1185
1185
|
return [
|
|
1186
1186
|
"a",
|
|
1187
|
-
|
|
1187
|
+
be(this.options.HTMLAttributes, e, {
|
|
1188
1188
|
class: "link"
|
|
1189
1189
|
}),
|
|
1190
1190
|
0
|
|
@@ -1196,7 +1196,7 @@ const No = jt.extend({
|
|
|
1196
1196
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1197
1197
|
openOnClick: !0,
|
|
1198
1198
|
button: ({ editor: t, t: n }) => ({
|
|
1199
|
-
component:
|
|
1199
|
+
component: _i,
|
|
1200
1200
|
componentProps: {
|
|
1201
1201
|
editor: t,
|
|
1202
1202
|
action: (i) => {
|
|
@@ -1229,21 +1229,21 @@ const No = jt.extend({
|
|
|
1229
1229
|
new te({
|
|
1230
1230
|
props: {
|
|
1231
1231
|
handleClick: (e, t) => {
|
|
1232
|
-
const { schema: n, doc: i, tr: a } = e.state, o =
|
|
1232
|
+
const { schema: n, doc: i, tr: a } = e.state, o = Mt(i.resolve(t), n.marks.link);
|
|
1233
1233
|
if (!o)
|
|
1234
1234
|
return !1;
|
|
1235
|
-
const s = i.resolve(o.from), c = i.resolve(o.to), h = a.setSelection(new
|
|
1235
|
+
const s = i.resolve(o.from), c = i.resolve(o.to), h = a.setSelection(new Xe(s, c));
|
|
1236
1236
|
e.dispatch(h);
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
})
|
|
1240
1240
|
];
|
|
1241
1241
|
}
|
|
1242
|
-
}),
|
|
1242
|
+
}), ro = Pt.extend({
|
|
1243
1243
|
renderHTML() {
|
|
1244
1244
|
return [
|
|
1245
1245
|
"div",
|
|
1246
|
-
|
|
1246
|
+
be(this.options.HTMLAttributes, {
|
|
1247
1247
|
"data-type": this.name
|
|
1248
1248
|
}),
|
|
1249
1249
|
["hr"]
|
|
@@ -1271,7 +1271,7 @@ const No = jt.extend({
|
|
|
1271
1271
|
};
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
|
-
function
|
|
1274
|
+
function fi(e) {
|
|
1275
1275
|
var d;
|
|
1276
1276
|
const {
|
|
1277
1277
|
icon: t = void 0,
|
|
@@ -1286,10 +1286,10 @@ function Ai(e) {
|
|
|
1286
1286
|
action: o = void 0,
|
|
1287
1287
|
isActive: s = void 0,
|
|
1288
1288
|
children: c
|
|
1289
|
-
} = e, h =
|
|
1290
|
-
return /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */ r(
|
|
1292
|
-
|
|
1289
|
+
} = e, h = Pe[t];
|
|
1290
|
+
return /* @__PURE__ */ u(pe, { children: [
|
|
1291
|
+
/* @__PURE__ */ r(we, { asChild: !0, children: /* @__PURE__ */ u(
|
|
1292
|
+
Be,
|
|
1293
1293
|
{
|
|
1294
1294
|
size: "sm",
|
|
1295
1295
|
className: `richtext-w-[32px] richtext-h-[32px] ${i}`,
|
|
@@ -1297,25 +1297,25 @@ function Ai(e) {
|
|
|
1297
1297
|
onClick: o,
|
|
1298
1298
|
children: [
|
|
1299
1299
|
h && /* @__PURE__ */ r(h, { className: "richtext-w-4 richtext-h-4" }),
|
|
1300
|
-
c && /* @__PURE__ */ r(
|
|
1300
|
+
c && /* @__PURE__ */ r(xe, { children: c })
|
|
1301
1301
|
]
|
|
1302
1302
|
}
|
|
1303
1303
|
) }),
|
|
1304
|
-
n && /* @__PURE__ */ r(
|
|
1304
|
+
n && /* @__PURE__ */ r(ye, { ...a, children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
|
|
1305
1305
|
/* @__PURE__ */ r("div", { children: n }),
|
|
1306
|
-
!!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */ r("span", { children:
|
|
1306
|
+
!!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */ r("span", { children: Re(e == null ? void 0 : e.shortcutKeys) })
|
|
1307
1307
|
] }) })
|
|
1308
1308
|
] });
|
|
1309
1309
|
}
|
|
1310
|
-
const
|
|
1310
|
+
const gi = ["undo", "redo"], so = Rt.extend({
|
|
1311
1311
|
addOptions() {
|
|
1312
1312
|
var e;
|
|
1313
1313
|
return {
|
|
1314
1314
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1315
1315
|
depth: 100,
|
|
1316
1316
|
newGroupDelay: 500,
|
|
1317
|
-
button: ({ editor: t, t: n }) =>
|
|
1318
|
-
component:
|
|
1317
|
+
button: ({ editor: t, t: n }) => gi.map((i) => ({
|
|
1318
|
+
component: fi,
|
|
1319
1319
|
componentProps: {
|
|
1320
1320
|
action: () => {
|
|
1321
1321
|
i === "undo" && t.chain().focus().undo().run(), i === "redo" && t.chain().focus().redo().run();
|
|
@@ -1329,10 +1329,10 @@ const Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1329
1329
|
}))
|
|
1330
1330
|
};
|
|
1331
1331
|
}
|
|
1332
|
-
}),
|
|
1332
|
+
}), bi = It.extend({
|
|
1333
1333
|
content: "(block|columns)+"
|
|
1334
1334
|
// echo editor is a block editor
|
|
1335
|
-
}),
|
|
1335
|
+
}), co = A.create({
|
|
1336
1336
|
name: "columnActionButton",
|
|
1337
1337
|
addOptions() {
|
|
1338
1338
|
var e;
|
|
@@ -1350,7 +1350,7 @@ const Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1350
1350
|
})
|
|
1351
1351
|
};
|
|
1352
1352
|
}
|
|
1353
|
-
}),
|
|
1353
|
+
}), xi = A.create({
|
|
1354
1354
|
name: "selection",
|
|
1355
1355
|
addProseMirrorPlugins() {
|
|
1356
1356
|
const { editor: e } = this;
|
|
@@ -1359,8 +1359,8 @@ const Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1359
1359
|
key: new Z("selection"),
|
|
1360
1360
|
props: {
|
|
1361
1361
|
decorations(t) {
|
|
1362
|
-
return t.selection.empty || e.isFocused === !0 ? null :
|
|
1363
|
-
|
|
1362
|
+
return t.selection.empty || e.isFocused === !0 ? null : se.create(t.doc, [
|
|
1363
|
+
ce.inline(t.selection.from, t.selection.to, {
|
|
1364
1364
|
class: "selection"
|
|
1365
1365
|
})
|
|
1366
1366
|
]);
|
|
@@ -1370,8 +1370,8 @@ const Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1370
1370
|
];
|
|
1371
1371
|
}
|
|
1372
1372
|
});
|
|
1373
|
-
function
|
|
1374
|
-
const { t } =
|
|
1373
|
+
function pi(e) {
|
|
1374
|
+
const { t } = j(), n = R(() => [
|
|
1375
1375
|
{
|
|
1376
1376
|
name: "paragraph",
|
|
1377
1377
|
label: t("editor.paragraph.tooltip"),
|
|
@@ -1435,21 +1435,21 @@ function Ei(e) {
|
|
|
1435
1435
|
iconName: "Code2",
|
|
1436
1436
|
action: () => e.editor.chain().focus().clearNodes().toggleCodeBlock().run()
|
|
1437
1437
|
}
|
|
1438
|
-
], [e.editor, t]), i =
|
|
1438
|
+
], [e.editor, t]), i = R(() => n.findLast((a) => a.isActive()) ?? {
|
|
1439
1439
|
label: "Empty"
|
|
1440
1440
|
}, [n]);
|
|
1441
|
-
return /* @__PURE__ */
|
|
1442
|
-
/* @__PURE__ */ r(
|
|
1441
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
1442
|
+
/* @__PURE__ */ r(Q, { asChild: !0, children: /* @__PURE__ */ u(
|
|
1443
1443
|
V,
|
|
1444
1444
|
{
|
|
1445
1445
|
className: "richtext-flex richtext-h-[32px] richtext-gap-1 richtext-px-1.5",
|
|
1446
1446
|
variant: "ghost",
|
|
1447
1447
|
children: [
|
|
1448
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ u("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
|
-
/* @__PURE__ */ r(
|
|
1452
|
+
/* @__PURE__ */ r(Me, { className: "richtext-size-4" })
|
|
1453
1453
|
]
|
|
1454
1454
|
}
|
|
1455
1455
|
) }),
|
|
@@ -1462,16 +1462,16 @@ function Ei(e) {
|
|
|
1462
1462
|
sideOffset: 5,
|
|
1463
1463
|
children: n.map((a, o) => {
|
|
1464
1464
|
var c;
|
|
1465
|
-
const s =
|
|
1465
|
+
const s = Pe[a.iconName];
|
|
1466
1466
|
return /* @__PURE__ */ r(
|
|
1467
1467
|
ne,
|
|
1468
1468
|
{
|
|
1469
1469
|
checked: ((c = a.isActive) == null ? void 0 : c.call(a)) || !1,
|
|
1470
1470
|
className: "richtext-cursor-pointer",
|
|
1471
1471
|
onClick: () => a.action(),
|
|
1472
|
-
children: /* @__PURE__ */
|
|
1472
|
+
children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-px-2", children: [
|
|
1473
1473
|
/* @__PURE__ */ r(s, { className: "richtext-h3 richtext-w-3" }),
|
|
1474
|
-
/* @__PURE__ */
|
|
1474
|
+
/* @__PURE__ */ u("span", { children: [
|
|
1475
1475
|
" ",
|
|
1476
1476
|
a.label
|
|
1477
1477
|
] })
|
|
@@ -1484,7 +1484,7 @@ function Ei(e) {
|
|
|
1484
1484
|
)
|
|
1485
1485
|
] });
|
|
1486
1486
|
}
|
|
1487
|
-
const
|
|
1487
|
+
const wi = A.create({
|
|
1488
1488
|
name: "text-bubble",
|
|
1489
1489
|
addOptions() {
|
|
1490
1490
|
var e;
|
|
@@ -1492,16 +1492,16 @@ const Hi = N.create({
|
|
|
1492
1492
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1493
1493
|
toolbar: !1,
|
|
1494
1494
|
button: () => ({
|
|
1495
|
-
component:
|
|
1495
|
+
component: pi,
|
|
1496
1496
|
componentProps: {}
|
|
1497
1497
|
})
|
|
1498
1498
|
};
|
|
1499
1499
|
}
|
|
1500
1500
|
});
|
|
1501
|
-
function
|
|
1501
|
+
function We({ types: e, node: t }) {
|
|
1502
1502
|
return Array.isArray(e) && e.includes(t.type) || t.type === e;
|
|
1503
1503
|
}
|
|
1504
|
-
const
|
|
1504
|
+
const yi = A.create({
|
|
1505
1505
|
name: "trailingNode",
|
|
1506
1506
|
addOptions() {
|
|
1507
1507
|
return {
|
|
@@ -1522,44 +1522,44 @@ const Mi = N.create({
|
|
|
1522
1522
|
state: {
|
|
1523
1523
|
init: (n, i) => {
|
|
1524
1524
|
const a = i.tr.doc.lastChild;
|
|
1525
|
-
return !
|
|
1525
|
+
return !We({ node: a, types: t });
|
|
1526
1526
|
},
|
|
1527
1527
|
apply: (n, i) => {
|
|
1528
1528
|
if (!n.docChanged)
|
|
1529
1529
|
return i;
|
|
1530
1530
|
const a = n.doc.lastChild;
|
|
1531
|
-
return !
|
|
1531
|
+
return !We({ node: a, types: t });
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
1534
1534
|
})
|
|
1535
1535
|
];
|
|
1536
1536
|
}
|
|
1537
|
-
}),
|
|
1537
|
+
}), lo = A.create({
|
|
1538
1538
|
name: "base-kit",
|
|
1539
1539
|
addExtensions() {
|
|
1540
1540
|
const e = [];
|
|
1541
|
-
return this.options.document !== !1 && e.push(
|
|
1542
|
-
|
|
1541
|
+
return this.options.document !== !1 && e.push(bi.configure()), this.options.placeholder !== !1 && e.push(
|
|
1542
|
+
jt.configure({
|
|
1543
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" ? `${
|
|
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" ? `${N.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") ? N.t("editor.slash") : n === 0 ? N.t("editor.content") : N.t("editor.content");
|
|
1546
1546
|
},
|
|
1547
1547
|
...this.options.placeholder
|
|
1548
1548
|
})
|
|
1549
1549
|
), this.options.focus !== !1 && e.push(
|
|
1550
|
-
|
|
1550
|
+
Bt.configure({
|
|
1551
1551
|
className: "focus",
|
|
1552
1552
|
...this.options.focus
|
|
1553
1553
|
})
|
|
1554
|
-
), this.options.text !== !1 && e.push(
|
|
1555
|
-
|
|
1554
|
+
), this.options.text !== !1 && e.push(Dt.configure()), this.options.textBubble !== !1 && e.push(wi.configure()), this.options.gapcursor !== !1 && e.push(Ot.configure()), this.options.dropcursor !== !1 && e.push(
|
|
1555
|
+
$t.configure({
|
|
1556
1556
|
...this.options.dropcursor,
|
|
1557
1557
|
width: 2,
|
|
1558
1558
|
class: "ProseMirror-dropcursor border-black"
|
|
1559
1559
|
})
|
|
1560
|
-
), this.options.characterCount !== !1 && e.push(
|
|
1560
|
+
), this.options.characterCount !== !1 && e.push(Ft.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Ut.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(qt.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Kt.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(Vt.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(yi.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(xi), this.options.multiColumn !== !1 && e.push(xn, pn), e;
|
|
1561
1561
|
}
|
|
1562
|
-
}),
|
|
1562
|
+
}), ho = A.create({
|
|
1563
1563
|
name: "subAndSuperScript",
|
|
1564
1564
|
addOptions() {
|
|
1565
1565
|
var e;
|
|
@@ -1591,12 +1591,12 @@ const Mi = N.create({
|
|
|
1591
1591
|
},
|
|
1592
1592
|
addExtensions() {
|
|
1593
1593
|
const e = [];
|
|
1594
|
-
return this.options.subscript !== !1 && e.push(
|
|
1594
|
+
return this.options.subscript !== !1 && e.push(Je.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Ye.configure(this.options.superscript)), e;
|
|
1595
1595
|
}
|
|
1596
1596
|
});
|
|
1597
|
-
function
|
|
1597
|
+
function ki(e) {
|
|
1598
1598
|
var n;
|
|
1599
|
-
const t =
|
|
1599
|
+
const t = R(() => {
|
|
1600
1600
|
var o;
|
|
1601
1601
|
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
1602
1602
|
return i && !i.default ? {
|
|
@@ -1608,9 +1608,9 @@ function zi(e) {
|
|
|
1608
1608
|
isActive: () => !1
|
|
1609
1609
|
};
|
|
1610
1610
|
}, [e]);
|
|
1611
|
-
return /* @__PURE__ */
|
|
1611
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
1612
1612
|
/* @__PURE__ */ r(
|
|
1613
|
-
|
|
1613
|
+
Q,
|
|
1614
1614
|
{
|
|
1615
1615
|
asChild: !0,
|
|
1616
1616
|
disabled: e == null ? void 0 : e.disabled,
|
|
@@ -1621,28 +1621,28 @@ function zi(e) {
|
|
|
1621
1621
|
disabled: e == null ? void 0 : e.disabled,
|
|
1622
1622
|
icon: e == null ? void 0 : e.icon,
|
|
1623
1623
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1624
|
-
children: /* @__PURE__ */ r(
|
|
1624
|
+
children: /* @__PURE__ */ r(wn, { className: "richtext-size-3 richtext-text-gray-500" })
|
|
1625
1625
|
}
|
|
1626
1626
|
)
|
|
1627
1627
|
}
|
|
1628
1628
|
),
|
|
1629
|
-
/* @__PURE__ */ r(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ r(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */ u(
|
|
1630
1630
|
ne,
|
|
1631
1631
|
{
|
|
1632
1632
|
checked: t.title === i.title,
|
|
1633
1633
|
className: "richtext-flex richtext-items-center richtext-gap-3",
|
|
1634
1634
|
onClick: i.action,
|
|
1635
1635
|
children: [
|
|
1636
|
-
/* @__PURE__ */ r(
|
|
1636
|
+
/* @__PURE__ */ r(M, { name: i == null ? void 0 : i.icon }),
|
|
1637
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:
|
|
1638
|
+
!!(i != null && i.shortcutKeys) && /* @__PURE__ */ r("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: Re(i.shortcutKeys) })
|
|
1639
1639
|
]
|
|
1640
1640
|
},
|
|
1641
1641
|
`more-mark-${a}`
|
|
1642
1642
|
)) })
|
|
1643
1643
|
] });
|
|
1644
1644
|
}
|
|
1645
|
-
const
|
|
1645
|
+
const uo = A.create({
|
|
1646
1646
|
name: "moreMark",
|
|
1647
1647
|
addOptions() {
|
|
1648
1648
|
var e;
|
|
@@ -1665,7 +1665,7 @@ const Ho = N.create({
|
|
|
1665
1665
|
shortcutKeys: ["mod", ","]
|
|
1666
1666
|
}, h = [];
|
|
1667
1667
|
return a !== !1 && h.push(s), o !== !1 && h.push(c), {
|
|
1668
|
-
component:
|
|
1668
|
+
component: ki,
|
|
1669
1669
|
componentProps: {
|
|
1670
1670
|
icon: "Type",
|
|
1671
1671
|
tooltip: i("editor.moremark"),
|
|
@@ -1678,9 +1678,9 @@ const Ho = N.create({
|
|
|
1678
1678
|
},
|
|
1679
1679
|
addExtensions() {
|
|
1680
1680
|
const e = [];
|
|
1681
|
-
return this.options.subscript !== !1 && e.push(
|
|
1681
|
+
return this.options.subscript !== !1 && e.push(Je.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Ye.configure(this.options.superscript)), e;
|
|
1682
1682
|
}
|
|
1683
|
-
}),
|
|
1683
|
+
}), mo = A.create({
|
|
1684
1684
|
name: "indent",
|
|
1685
1685
|
addOptions() {
|
|
1686
1686
|
var e;
|
|
@@ -1736,11 +1736,11 @@ const Ho = N.create({
|
|
|
1736
1736
|
},
|
|
1737
1737
|
addCommands() {
|
|
1738
1738
|
return {
|
|
1739
|
-
indent: () =>
|
|
1739
|
+
indent: () => Fe({
|
|
1740
1740
|
delta: me.more,
|
|
1741
1741
|
types: this.options.types
|
|
1742
1742
|
}),
|
|
1743
|
-
outdent: () =>
|
|
1743
|
+
outdent: () => Fe({
|
|
1744
1744
|
delta: me.less,
|
|
1745
1745
|
types: this.options.types
|
|
1746
1746
|
})
|
|
@@ -1753,19 +1753,19 @@ const Ho = N.create({
|
|
|
1753
1753
|
};
|
|
1754
1754
|
}
|
|
1755
1755
|
});
|
|
1756
|
-
function
|
|
1756
|
+
function vi(e) {
|
|
1757
1757
|
return Number.parseFloat(e.replace("%", "")) / 100;
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1760
|
-
const { t } =
|
|
1759
|
+
function Ci(e) {
|
|
1760
|
+
const { t } = j(), [n, i] = C("default");
|
|
1761
1761
|
function a(s) {
|
|
1762
1762
|
s === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(s), i(s);
|
|
1763
1763
|
}
|
|
1764
|
-
const o =
|
|
1764
|
+
const o = R(() => {
|
|
1765
1765
|
const h = e.editor.extensionManager.extensions.find(
|
|
1766
1766
|
(d) => d.name === "lineHeight"
|
|
1767
1767
|
).options.lineHeights.map((d) => ({
|
|
1768
|
-
label:
|
|
1768
|
+
label: vi(d),
|
|
1769
1769
|
value: d
|
|
1770
1770
|
}));
|
|
1771
1771
|
return h.unshift({
|
|
@@ -1773,9 +1773,9 @@ function Pi(e) {
|
|
|
1773
1773
|
value: "default"
|
|
1774
1774
|
}), h;
|
|
1775
1775
|
}, [e]);
|
|
1776
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ u(Y, { children: [
|
|
1777
1777
|
/* @__PURE__ */ r(
|
|
1778
|
-
|
|
1778
|
+
Q,
|
|
1779
1779
|
{
|
|
1780
1780
|
asChild: !0,
|
|
1781
1781
|
disabled: e == null ? void 0 : e.disabled,
|
|
@@ -1787,7 +1787,7 @@ function Pi(e) {
|
|
|
1787
1787
|
icon: "LineHeight",
|
|
1788
1788
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1789
1789
|
children: /* @__PURE__ */ r(
|
|
1790
|
-
|
|
1790
|
+
M,
|
|
1791
1791
|
{
|
|
1792
1792
|
className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
|
|
1793
1793
|
name: "MenuDown"
|
|
@@ -1808,15 +1808,15 @@ function Pi(e) {
|
|
|
1808
1808
|
)) })
|
|
1809
1809
|
] });
|
|
1810
1810
|
}
|
|
1811
|
-
const
|
|
1812
|
-
function
|
|
1811
|
+
const Ni = ["paragraph", "heading", "list_item", "todo_item"];
|
|
1812
|
+
function Ai(e, t) {
|
|
1813
1813
|
const { selection: n, doc: i } = e;
|
|
1814
|
-
if (!n || !i || !(n instanceof
|
|
1814
|
+
if (!n || !i || !(n instanceof Xe || n instanceof Zt))
|
|
1815
1815
|
return e;
|
|
1816
|
-
const { from: a, to: o } = n, s = [], c = t && t !==
|
|
1816
|
+
const { from: a, to: o } = n, s = [], c = t && t !== it ? t : null;
|
|
1817
1817
|
if (i.nodesBetween(a, o, (h, d) => {
|
|
1818
1818
|
const l = h.type;
|
|
1819
|
-
return
|
|
1819
|
+
return Ni.includes(l.name) ? ((h.attrs.lineHeight || null) !== c && s.push({
|
|
1820
1820
|
node: h,
|
|
1821
1821
|
pos: d,
|
|
1822
1822
|
nodeType: l
|
|
@@ -1824,34 +1824,34 @@ function Bi(e, t) {
|
|
|
1824
1824
|
}), s.length === 0)
|
|
1825
1825
|
return e;
|
|
1826
1826
|
for (const h of s) {
|
|
1827
|
-
const { node: d, pos: l, nodeType:
|
|
1828
|
-
let { attrs:
|
|
1829
|
-
|
|
1830
|
-
...
|
|
1827
|
+
const { node: d, pos: l, nodeType: m } = h;
|
|
1828
|
+
let { attrs: _ } = d;
|
|
1829
|
+
_ = {
|
|
1830
|
+
..._,
|
|
1831
1831
|
lineHeight: c
|
|
1832
|
-
}, e = e.setNodeMarkup(l,
|
|
1832
|
+
}, e = e.setNodeMarkup(l, m, _, d.marks);
|
|
1833
1833
|
}
|
|
1834
1834
|
return e;
|
|
1835
1835
|
}
|
|
1836
|
-
function
|
|
1836
|
+
function Li(e) {
|
|
1837
1837
|
return ({ state: t, dispatch: n }) => {
|
|
1838
1838
|
const { selection: i } = t;
|
|
1839
1839
|
let { tr: a } = t;
|
|
1840
|
-
return a = a.setSelection(i), a =
|
|
1840
|
+
return a = a.setSelection(i), a = Ai(a, e), a.docChanged ? (n && n(a), !0) : !1;
|
|
1841
1841
|
};
|
|
1842
1842
|
}
|
|
1843
|
-
const
|
|
1843
|
+
const _o = A.create({
|
|
1844
1844
|
name: "lineHeight",
|
|
1845
1845
|
addOptions() {
|
|
1846
1846
|
var e;
|
|
1847
1847
|
return {
|
|
1848
1848
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1849
1849
|
types: ["paragraph", "heading", "list_item", "todo_item"],
|
|
1850
|
-
lineHeights:
|
|
1851
|
-
defaultHeight:
|
|
1850
|
+
lineHeights: Rn,
|
|
1851
|
+
defaultHeight: it,
|
|
1852
1852
|
button({ editor: t, t: n }) {
|
|
1853
1853
|
return {
|
|
1854
|
-
component:
|
|
1854
|
+
component: Ci,
|
|
1855
1855
|
componentProps: {
|
|
1856
1856
|
editor: t,
|
|
1857
1857
|
tooltip: n("editor.lineheight.tooltip")
|
|
@@ -1876,17 +1876,17 @@ const zo = N.create({
|
|
|
1876
1876
|
},
|
|
1877
1877
|
addCommands() {
|
|
1878
1878
|
return {
|
|
1879
|
-
setLineHeight: (e) =>
|
|
1879
|
+
setLineHeight: (e) => Li(e),
|
|
1880
1880
|
unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
|
|
1881
1881
|
};
|
|
1882
1882
|
}
|
|
1883
1883
|
});
|
|
1884
|
-
function
|
|
1885
|
-
var
|
|
1886
|
-
const [n, i] =
|
|
1887
|
-
|
|
1884
|
+
function Si(e, t) {
|
|
1885
|
+
var L, E;
|
|
1886
|
+
const [n, i] = C(0), [a, o] = C(0), s = G(null), { t: c } = j(), h = G([]);
|
|
1887
|
+
ze(t, () => ({
|
|
1888
1888
|
onKeyDown: d
|
|
1889
|
-
})),
|
|
1889
|
+
})), z(() => {
|
|
1890
1890
|
if (!s.current)
|
|
1891
1891
|
return;
|
|
1892
1892
|
const g = a * 1e3 + n, b = h.current[g];
|
|
@@ -1896,7 +1896,7 @@ function Di(e, t) {
|
|
|
1896
1896
|
});
|
|
1897
1897
|
}, [n, a]);
|
|
1898
1898
|
function d({ event: g }) {
|
|
1899
|
-
return g.key === "ArrowUp" ? (l(), !0) : g.key === "ArrowDown" ? (
|
|
1899
|
+
return g.key === "ArrowUp" ? (l(), !0) : g.key === "ArrowDown" ? (m(), !0) : g.key === "Enter" ? (_(), !0) : !1;
|
|
1900
1900
|
}
|
|
1901
1901
|
function l() {
|
|
1902
1902
|
var k;
|
|
@@ -1905,26 +1905,26 @@ function Di(e, t) {
|
|
|
1905
1905
|
let g = n - 1, b = a;
|
|
1906
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
1907
|
}
|
|
1908
|
-
function
|
|
1908
|
+
function m() {
|
|
1909
1909
|
if (e.items.length === 0)
|
|
1910
1910
|
return !1;
|
|
1911
1911
|
const g = e.items[a].commands;
|
|
1912
1912
|
let b = n + 1, k = a;
|
|
1913
1913
|
g.length - 1 < b && (b = 0, k = a + 1), e.items.length - 1 < k && (k = 0), i(b), o(k);
|
|
1914
1914
|
}
|
|
1915
|
-
function
|
|
1915
|
+
function _() {
|
|
1916
1916
|
if (e.items.length === 0 || a === -1 || n === -1)
|
|
1917
1917
|
return !1;
|
|
1918
|
-
|
|
1918
|
+
f(a, n);
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1920
|
+
function f(g, b) {
|
|
1921
1921
|
const k = e.items[g].commands[b];
|
|
1922
1922
|
e.command(k);
|
|
1923
1923
|
}
|
|
1924
|
-
function
|
|
1925
|
-
|
|
1924
|
+
function p(g, b) {
|
|
1925
|
+
f(g, b);
|
|
1926
1926
|
}
|
|
1927
|
-
function
|
|
1927
|
+
function w(g, b, k) {
|
|
1928
1928
|
h.current[g * 1e3 + b] = k;
|
|
1929
1929
|
}
|
|
1930
1930
|
return /* @__PURE__ */ r(
|
|
@@ -1932,14 +1932,14 @@ function Di(e, t) {
|
|
|
1932
1932
|
{
|
|
1933
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
1934
|
ref: s,
|
|
1935
|
-
children: (
|
|
1935
|
+
children: (L = e == null ? void 0 : e.items) != null && L.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__ */ u(Ee, { children: [
|
|
1936
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__ */
|
|
1937
|
+
g.commands.map((k, H) => /* @__PURE__ */ u(
|
|
1938
1938
|
"button",
|
|
1939
1939
|
{
|
|
1940
|
-
onClick: () =>
|
|
1941
|
-
ref: (
|
|
1942
|
-
className:
|
|
1940
|
+
onClick: () => p(b, H),
|
|
1941
|
+
ref: (S) => w(b, H, S),
|
|
1942
|
+
className: T("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
1943
|
"slash-command-active": a === b && n === H
|
|
1944
1944
|
}),
|
|
1945
1945
|
children: [
|
|
@@ -1952,7 +1952,7 @@ function Di(e, t) {
|
|
|
1952
1952
|
}
|
|
1953
1953
|
),
|
|
1954
1954
|
k.iconName && /* @__PURE__ */ r(
|
|
1955
|
-
|
|
1955
|
+
M,
|
|
1956
1956
|
{
|
|
1957
1957
|
className: "!richtext-mr-1 !richtext-text-lg",
|
|
1958
1958
|
name: k.iconName
|
|
@@ -1967,21 +1967,21 @@ function Di(e, t) {
|
|
|
1967
1967
|
}
|
|
1968
1968
|
);
|
|
1969
1969
|
}
|
|
1970
|
-
const
|
|
1970
|
+
const Ti = He(Si), Ei = {
|
|
1971
1971
|
setOpen: (e, t) => {
|
|
1972
1972
|
K(D.UPLOAD_VIDEO(e), t);
|
|
1973
1973
|
}
|
|
1974
1974
|
};
|
|
1975
|
-
function
|
|
1975
|
+
function Hi(e, t) {
|
|
1976
1976
|
const n = [
|
|
1977
1977
|
{
|
|
1978
1978
|
name: "format",
|
|
1979
|
-
title:
|
|
1979
|
+
title: N.t("editor.slash.format"),
|
|
1980
1980
|
commands: []
|
|
1981
1981
|
},
|
|
1982
1982
|
{
|
|
1983
1983
|
name: "insert",
|
|
1984
|
-
title:
|
|
1984
|
+
title: N.t("editor.slash.insert"),
|
|
1985
1985
|
commands: []
|
|
1986
1986
|
}
|
|
1987
1987
|
];
|
|
@@ -1989,7 +1989,7 @@ function Fi(e, t) {
|
|
|
1989
1989
|
i.name.toLowerCase() === "heading" && i.options.levels.forEach((a) => {
|
|
1990
1990
|
n[0].commands.push({
|
|
1991
1991
|
name: `heading${a}`,
|
|
1992
|
-
label:
|
|
1992
|
+
label: N.t(`editor.heading.h${a}.tooltip`),
|
|
1993
1993
|
aliases: [`h${a}`, "bt", `bt${a}`],
|
|
1994
1994
|
iconName: `Heading${a}`,
|
|
1995
1995
|
action: ({ editor: o, range: s }) => {
|
|
@@ -1998,7 +1998,7 @@ function Fi(e, t) {
|
|
|
1998
1998
|
});
|
|
1999
1999
|
}), i.name.toLowerCase() === "bulletlist" && n[0].commands.push({
|
|
2000
2000
|
name: "bulletList",
|
|
2001
|
-
label:
|
|
2001
|
+
label: N.t("editor.bulletlist.tooltip"),
|
|
2002
2002
|
aliases: ["ul", "yxlb"],
|
|
2003
2003
|
iconName: "List",
|
|
2004
2004
|
action: ({ editor: a, range: o }) => {
|
|
@@ -2006,7 +2006,7 @@ function Fi(e, t) {
|
|
|
2006
2006
|
}
|
|
2007
2007
|
}), i.name.toLowerCase() === "orderedlist" && n[0].commands.push({
|
|
2008
2008
|
name: "numberedList",
|
|
2009
|
-
label:
|
|
2009
|
+
label: N.t("editor.orderedlist.tooltip"),
|
|
2010
2010
|
aliases: ["ol", "yxlb"],
|
|
2011
2011
|
iconName: "ListOrdered",
|
|
2012
2012
|
action: ({ editor: a, range: o }) => {
|
|
@@ -2014,7 +2014,7 @@ function Fi(e, t) {
|
|
|
2014
2014
|
}
|
|
2015
2015
|
}), i.name.toLowerCase() === "tasklist" && n[0].commands.push({
|
|
2016
2016
|
name: "taskList",
|
|
2017
|
-
label:
|
|
2017
|
+
label: N.t("editor.tasklist.tooltip"),
|
|
2018
2018
|
iconName: "ListTodo",
|
|
2019
2019
|
description: "Task list with todo items",
|
|
2020
2020
|
aliases: ["todo"],
|
|
@@ -2023,7 +2023,7 @@ function Fi(e, t) {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
}), i.name.toLowerCase() === "blockquote" && n[0].commands.push({
|
|
2025
2025
|
name: "blockquote",
|
|
2026
|
-
label:
|
|
2026
|
+
label: N.t("editor.blockquote.tooltip"),
|
|
2027
2027
|
description: "插入引入格式",
|
|
2028
2028
|
aliases: ["yr"],
|
|
2029
2029
|
iconName: "TextQuote",
|
|
@@ -2032,36 +2032,36 @@ function Fi(e, t) {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
}), i.name.toLowerCase() === "codeblock" && n[0].commands.push({
|
|
2034
2034
|
name: "codeBlock",
|
|
2035
|
-
label:
|
|
2035
|
+
label: N.t("editor.codeblock.tooltip"),
|
|
2036
2036
|
iconName: "Code2",
|
|
2037
2037
|
description: "Code block with syntax highlighting",
|
|
2038
2038
|
shouldBeHidden: (a) => a.isActive("columns"),
|
|
2039
2039
|
action: ({ editor: a, range: o }) => {
|
|
2040
2040
|
a.chain().focus().deleteRange(o).setCodeBlock().run();
|
|
2041
2041
|
}
|
|
2042
|
-
}), i.name.toLowerCase() ===
|
|
2042
|
+
}), i.name.toLowerCase() === yn.name && n[1].commands.push({
|
|
2043
2043
|
name: "image",
|
|
2044
|
-
label:
|
|
2044
|
+
label: N.t("editor.image.tooltip"),
|
|
2045
2045
|
iconName: "ImageUp",
|
|
2046
2046
|
description: "Insert a image",
|
|
2047
2047
|
aliases: ["image", "tp", "tupian"],
|
|
2048
2048
|
shouldBeHidden: (a) => a.isActive("columns"),
|
|
2049
2049
|
action: ({ editor: a, range: o }) => {
|
|
2050
|
-
a.chain().focus().deleteRange(o).run(),
|
|
2050
|
+
a.chain().focus().deleteRange(o).run(), kn.setOpen(a.id, !0);
|
|
2051
2051
|
}
|
|
2052
|
-
}), i.name.toLowerCase() ===
|
|
2052
|
+
}), i.name.toLowerCase() === vn.name && n[1].commands.push({
|
|
2053
2053
|
name: "video",
|
|
2054
|
-
label:
|
|
2054
|
+
label: N.t("editor.video.tooltip"),
|
|
2055
2055
|
iconName: "Video",
|
|
2056
2056
|
description: "Insert a video",
|
|
2057
2057
|
aliases: ["video", "sp", "shipin"],
|
|
2058
2058
|
shouldBeHidden: (a) => a.isActive("columns"),
|
|
2059
2059
|
action: ({ editor: a, range: o }) => {
|
|
2060
|
-
a.chain().focus().deleteRange(o).run(),
|
|
2060
|
+
a.chain().focus().deleteRange(o).run(), Ei.setOpen(a.id, !0);
|
|
2061
2061
|
}
|
|
2062
2062
|
}), i.name.toLowerCase() === "table" && n[1].commands.push({
|
|
2063
2063
|
name: "table",
|
|
2064
|
-
label:
|
|
2064
|
+
label: N.t("editor.table.tooltip"),
|
|
2065
2065
|
iconName: "Table",
|
|
2066
2066
|
description: "Insert a table",
|
|
2067
2067
|
aliases: ["table", "bg", "biaoge", "biao"],
|
|
@@ -2071,7 +2071,7 @@ function Fi(e, t) {
|
|
|
2071
2071
|
}
|
|
2072
2072
|
}), i.name.toLowerCase() === "horizontalrule" && n[1].commands.push({
|
|
2073
2073
|
name: "horizontalRule",
|
|
2074
|
-
label:
|
|
2074
|
+
label: N.t("editor.horizontalrule.tooltip"),
|
|
2075
2075
|
iconName: "Minus",
|
|
2076
2076
|
description: "Insert a horizontal divider",
|
|
2077
2077
|
aliases: ["hr", "fgx", "fg"],
|
|
@@ -2080,7 +2080,7 @@ function Fi(e, t) {
|
|
|
2080
2080
|
}
|
|
2081
2081
|
}), i.name.toLowerCase() === "columns" && n[1].commands.push({
|
|
2082
2082
|
name: "columns",
|
|
2083
|
-
label:
|
|
2083
|
+
label: N.t("editor.columns.tooltip"),
|
|
2084
2084
|
iconName: "Columns2",
|
|
2085
2085
|
description: "Add two column content",
|
|
2086
2086
|
action: ({ editor: a }) => {
|
|
@@ -2091,11 +2091,11 @@ function Fi(e, t) {
|
|
|
2091
2091
|
}
|
|
2092
2092
|
const q = "slashCommand";
|
|
2093
2093
|
let y;
|
|
2094
|
-
const
|
|
2094
|
+
const fo = A.create({
|
|
2095
2095
|
name: q,
|
|
2096
2096
|
priority: 200,
|
|
2097
2097
|
onCreate() {
|
|
2098
|
-
y =
|
|
2098
|
+
y = De("body", {
|
|
2099
2099
|
interactive: !0,
|
|
2100
2100
|
trigger: "manual",
|
|
2101
2101
|
placement: "bottom-start",
|
|
@@ -2115,15 +2115,15 @@ const Ro = N.create({
|
|
|
2115
2115
|
},
|
|
2116
2116
|
addProseMirrorPlugins() {
|
|
2117
2117
|
return [
|
|
2118
|
-
|
|
2118
|
+
Qe({
|
|
2119
2119
|
editor: this.editor,
|
|
2120
2120
|
char: "/",
|
|
2121
2121
|
allowSpaces: !0,
|
|
2122
2122
|
startOfLine: !0,
|
|
2123
2123
|
pluginKey: new Z(q),
|
|
2124
2124
|
allow: ({ state: e, range: t }) => {
|
|
2125
|
-
var d, 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 = (
|
|
2125
|
+
var d, l, m;
|
|
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 = (m = n.parent.textContent) == null ? void 0 : m.slice(
|
|
2127
2127
|
Math.max(0, (l = n.parent.textContent) == null ? void 0 : l.indexOf("/"))
|
|
2128
2128
|
), h = !(c != null && c.endsWith(" "));
|
|
2129
2129
|
return (i && a && o || s && a && o) && h;
|
|
@@ -2132,13 +2132,13 @@ const Ro = N.create({
|
|
|
2132
2132
|
const { view: i } = e;
|
|
2133
2133
|
n.action({ editor: e, range: t }), i.focus();
|
|
2134
2134
|
},
|
|
2135
|
-
items: ({ query: e, editor: t }) =>
|
|
2135
|
+
items: ({ query: e, editor: t }) => Hi(t.extensionManager.extensions, this.options.renderGroupItem).map((s) => ({
|
|
2136
2136
|
...s,
|
|
2137
2137
|
commands: s.commands.filter((c) => {
|
|
2138
2138
|
const h = c.label.toLowerCase().trim(), d = e.toLowerCase().trim();
|
|
2139
2139
|
if (c.aliases) {
|
|
2140
|
-
const l = c.aliases.map((
|
|
2141
|
-
return
|
|
2140
|
+
const l = c.aliases.map((f) => f.toLowerCase().trim()), m = h.match(d), _ = l.some((f) => f.match(d));
|
|
2141
|
+
return m || _;
|
|
2142
2142
|
}
|
|
2143
2143
|
return h.match(d);
|
|
2144
2144
|
}).filter(
|
|
@@ -2156,7 +2156,7 @@ const Ro = N.create({
|
|
|
2156
2156
|
return {
|
|
2157
2157
|
onStart: (n) => {
|
|
2158
2158
|
var o;
|
|
2159
|
-
e = new
|
|
2159
|
+
e = new Te(Ti, {
|
|
2160
2160
|
props: n,
|
|
2161
2161
|
editor: n.editor
|
|
2162
2162
|
});
|
|
@@ -2236,183 +2236,7 @@ const Ro = N.create({
|
|
|
2236
2236
|
}
|
|
2237
2237
|
};
|
|
2238
2238
|
}
|
|
2239
|
-
})
|
|
2240
|
-
function Ui(e, t, n) {
|
|
2241
|
-
if (!e.doc)
|
|
2242
|
-
return e;
|
|
2243
|
-
const i = e.doc.nodeAt(t);
|
|
2244
|
-
if (!i || n === i.attrs.backgroundColor)
|
|
2245
|
-
return e;
|
|
2246
|
-
const a = {
|
|
2247
|
-
...i.attrs,
|
|
2248
|
-
backgroundColor: n
|
|
2249
|
-
};
|
|
2250
|
-
return e.setNodeMarkup(t, i.type, a, i.marks);
|
|
2251
|
-
}
|
|
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);
|
|
2256
|
-
}), e;
|
|
2257
|
-
}
|
|
2258
|
-
function Qe(e, t) {
|
|
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;
|
|
2262
|
-
};
|
|
2263
|
-
}
|
|
2264
|
-
const Ki = N.create({
|
|
2265
|
-
name: "tableCellBackground",
|
|
2266
|
-
addOptions() {
|
|
2267
|
-
return {
|
|
2268
|
-
types: ["tableCell"],
|
|
2269
|
-
HTMLAttributes: {}
|
|
2270
|
-
};
|
|
2271
|
-
},
|
|
2272
|
-
addGlobalAttributes() {
|
|
2273
|
-
return [
|
|
2274
|
-
{
|
|
2275
|
-
types: this.options.types,
|
|
2276
|
-
attributes: {
|
|
2277
|
-
backgroundColor: {
|
|
2278
|
-
parseHTML: (e) => e.style.backgroundColor || "",
|
|
2279
|
-
renderHTML: (e) => !e.backgroundColor || e.backgroundColor === "" ? {} : {
|
|
2280
|
-
style: `background-color: ${e.backgroundColor}`
|
|
2281
|
-
}
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
];
|
|
2286
|
-
},
|
|
2287
|
-
addCommands() {
|
|
2288
|
-
return {
|
|
2289
|
-
setTableCellBackground: (e) => Qe(e, this.options),
|
|
2290
|
-
unsetTableCellBackground: () => Qe("", this.options)
|
|
2291
|
-
};
|
|
2292
|
-
}
|
|
2293
|
-
}), Vi = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, Wi = /CrOS/, Gi = /android|ipad|playbook|silk/i;
|
|
2294
|
-
function Ye(e = {}) {
|
|
2295
|
-
let t = e.ua || typeof navigator < "u" && navigator.userAgent;
|
|
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"));
|
|
2297
|
-
}
|
|
2298
|
-
const Xe = (e) => Array.from({ length: e }).map((t, n) => n + 1);
|
|
2299
|
-
function Zi(e) {
|
|
2300
|
-
var l;
|
|
2301
|
-
const [t, n] = v(!0), [i, a] = v({
|
|
2302
|
-
rows: Ye() ? fe : _e,
|
|
2303
|
-
cols: Ye() ? fe : _e
|
|
2304
|
-
}), [o, s] = v({
|
|
2305
|
-
rows: ge,
|
|
2306
|
-
cols: ge
|
|
2307
|
-
});
|
|
2308
|
-
function c(u, f) {
|
|
2309
|
-
u === i.rows && a((_) => ({
|
|
2310
|
-
..._,
|
|
2311
|
-
rows: Math.min(u + 1, fe)
|
|
2312
|
-
})), f === i.cols && a((_) => ({
|
|
2313
|
-
..._,
|
|
2314
|
-
cols: Math.min(f + 1, fe)
|
|
2315
|
-
})), s({
|
|
2316
|
-
rows: u,
|
|
2317
|
-
cols: f
|
|
2318
|
-
});
|
|
2319
|
-
}
|
|
2320
|
-
function h(u, f) {
|
|
2321
|
-
e == null || e.createTable({ rows: u, cols: f, withHeaderRow: t }), d();
|
|
2322
|
-
}
|
|
2323
|
-
function d() {
|
|
2324
|
-
n(!1), a({
|
|
2325
|
-
rows: _e,
|
|
2326
|
-
cols: _e
|
|
2327
|
-
}), s({
|
|
2328
|
-
rows: ge,
|
|
2329
|
-
cols: ge
|
|
2330
|
-
});
|
|
2331
|
-
}
|
|
2332
|
-
return /* @__PURE__ */ m(ie, { modal: !0, children: [
|
|
2333
|
-
/* @__PURE__ */ r(ae, { asChild: !0, children: e == null ? void 0 : e.children }),
|
|
2334
|
-
/* @__PURE__ */ r(
|
|
2335
|
-
oe,
|
|
2336
|
-
{
|
|
2337
|
-
align: "start",
|
|
2338
|
-
className: "richtext-w-full !richtext-p-2",
|
|
2339
|
-
side: "bottom",
|
|
2340
|
-
children: /* @__PURE__ */ m("div", { className: "table-grid-size-editor richtext-p-0", children: [
|
|
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) => {
|
|
2342
|
-
var f;
|
|
2343
|
-
return /* @__PURE__ */ r(
|
|
2344
|
-
"div",
|
|
2345
|
-
{
|
|
2346
|
-
className: "richtext-flex richtext-gap-1",
|
|
2347
|
-
children: (f = Xe(i == null ? void 0 : i.cols)) == null ? void 0 : f.map((_) => /* @__PURE__ */ r(
|
|
2348
|
-
"div",
|
|
2349
|
-
{
|
|
2350
|
-
onMouseDown: () => h(u, _),
|
|
2351
|
-
onMouseOver: () => c(u, _),
|
|
2352
|
-
className: `richtext-cursor-pointer richtext-border-border ${_ <= o.cols && u <= o.rows && "tableCellActive !richtext-bg-foreground"}`,
|
|
2353
|
-
children: /* @__PURE__ */ r("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
|
|
2354
|
-
},
|
|
2355
|
-
`c-${_}`
|
|
2356
|
-
))
|
|
2357
|
-
},
|
|
2358
|
-
`r-${u}`
|
|
2359
|
-
);
|
|
2360
|
-
}) }),
|
|
2361
|
-
/* @__PURE__ */ m("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-zinc-600", children: [
|
|
2362
|
-
o.rows,
|
|
2363
|
-
" ",
|
|
2364
|
-
"x",
|
|
2365
|
-
o.cols
|
|
2366
|
-
] })
|
|
2367
|
-
] })
|
|
2368
|
-
}
|
|
2369
|
-
)
|
|
2370
|
-
] });
|
|
2371
|
-
}
|
|
2372
|
-
function Ji(e) {
|
|
2373
|
-
function t(n) {
|
|
2374
|
-
e.disabled || e.editor.chain().focus().insertTable({ ...n, withHeaderRow: !1 }).run();
|
|
2375
|
-
}
|
|
2376
|
-
return /* @__PURE__ */ r(Zi, { createTable: t, children: /* @__PURE__ */ r(
|
|
2377
|
-
x,
|
|
2378
|
-
{
|
|
2379
|
-
icon: e == null ? void 0 : e.icon,
|
|
2380
|
-
tooltip: e == null ? void 0 : e.tooltip,
|
|
2381
|
-
disabled: e == null ? void 0 : e.disabled,
|
|
2382
|
-
color: e == null ? void 0 : e.color,
|
|
2383
|
-
action: e == null ? void 0 : e.action,
|
|
2384
|
-
isActive: e == null ? void 0 : e.isActive
|
|
2385
|
-
}
|
|
2386
|
-
) });
|
|
2387
|
-
}
|
|
2388
|
-
const Po = Xt.extend({
|
|
2389
|
-
addOptions() {
|
|
2390
|
-
var e;
|
|
2391
|
-
return {
|
|
2392
|
-
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2393
|
-
resizable: !0,
|
|
2394
|
-
lastColumnResizable: !0,
|
|
2395
|
-
allowTableNodeSelection: !1,
|
|
2396
|
-
button: ({ editor: t, t: n }) => ({
|
|
2397
|
-
component: Ji,
|
|
2398
|
-
componentProps: {
|
|
2399
|
-
disabled: t.isActive("table") || !1,
|
|
2400
|
-
icon: "Table",
|
|
2401
|
-
tooltip: n("editor.table.tooltip"),
|
|
2402
|
-
editor: t
|
|
2403
|
-
}
|
|
2404
|
-
})
|
|
2405
|
-
};
|
|
2406
|
-
},
|
|
2407
|
-
addExtensions() {
|
|
2408
|
-
return [
|
|
2409
|
-
en.configure(this.options.tableRow),
|
|
2410
|
-
tn.configure(this.options.tableHeader),
|
|
2411
|
-
nn.configure(this.options.tableCell),
|
|
2412
|
-
Ki.configure(this.options.tableCellBackground)
|
|
2413
|
-
];
|
|
2414
|
-
}
|
|
2415
|
-
}), Io = N.create({
|
|
2239
|
+
}), go = A.create({
|
|
2416
2240
|
name: "painter",
|
|
2417
2241
|
addOptions() {
|
|
2418
2242
|
var e;
|
|
@@ -2481,37 +2305,37 @@ const Po = Xt.extend({
|
|
|
2481
2305
|
];
|
|
2482
2306
|
}
|
|
2483
2307
|
});
|
|
2484
|
-
function
|
|
2485
|
-
const { t: n } =
|
|
2486
|
-
return
|
|
2487
|
-
|
|
2488
|
-
}, [e,
|
|
2489
|
-
|
|
2490
|
-
}, [
|
|
2491
|
-
|
|
2492
|
-
}, [
|
|
2308
|
+
function zi({ editor: e, ...t }) {
|
|
2309
|
+
const { t: n } = j(), [i, a] = C(-1), [o, s] = C([]), [c, h] = C(""), [d, l] = C(""), [m, _] = C(!1), [f, p] = C(!1);
|
|
2310
|
+
return z(() => {
|
|
2311
|
+
m || (h(""), l(""), a(-1), s([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
|
|
2312
|
+
}, [e, m]), z(() => {
|
|
2313
|
+
m && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(c);
|
|
2314
|
+
}, [m, c, e]), z(() => {
|
|
2315
|
+
m && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(d);
|
|
2316
|
+
}, [m, d, e]), z(() => {
|
|
2493
2317
|
if (!e)
|
|
2494
2318
|
return;
|
|
2495
|
-
const
|
|
2496
|
-
if (!
|
|
2319
|
+
const w = e.extensionManager.extensions.find((E) => E.name === ji.name);
|
|
2320
|
+
if (!w)
|
|
2497
2321
|
return;
|
|
2498
|
-
const
|
|
2499
|
-
if (!
|
|
2322
|
+
const L = () => {
|
|
2323
|
+
if (!m)
|
|
2500
2324
|
return;
|
|
2501
|
-
const E =
|
|
2502
|
-
a((b) => b !== E ? E : b), s((b) =>
|
|
2325
|
+
const E = w ? w.storage.currentIndex : -1, g = w ? w.storage.results : [];
|
|
2326
|
+
a((b) => b !== E ? E : b), s((b) => Jt(b, g) ? b : g);
|
|
2503
2327
|
};
|
|
2504
|
-
return
|
|
2505
|
-
|
|
2328
|
+
return Ue(D.SEARCH_REPLCE, L), () => {
|
|
2329
|
+
w && Ue(D.SEARCH_REPLCE, L);
|
|
2506
2330
|
};
|
|
2507
|
-
}, [
|
|
2508
|
-
|
|
2331
|
+
}, [m, e]), /* @__PURE__ */ u(
|
|
2332
|
+
le,
|
|
2509
2333
|
{
|
|
2510
|
-
onOpenChange:
|
|
2511
|
-
open:
|
|
2334
|
+
onOpenChange: _,
|
|
2335
|
+
open: m,
|
|
2512
2336
|
children: [
|
|
2513
2337
|
/* @__PURE__ */ r(
|
|
2514
|
-
|
|
2338
|
+
de,
|
|
2515
2339
|
{
|
|
2516
2340
|
asChild: !0,
|
|
2517
2341
|
disabled: t == null ? void 0 : t.disabled,
|
|
@@ -2521,30 +2345,30 @@ function Qi({ editor: e, ...t }) {
|
|
|
2521
2345
|
disabled: t == null ? void 0 : t.disabled,
|
|
2522
2346
|
isActive: t == null ? void 0 : t.isActive,
|
|
2523
2347
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
2524
|
-
children: /* @__PURE__ */ r(
|
|
2348
|
+
children: /* @__PURE__ */ r(M, { name: t == null ? void 0 : t.icon })
|
|
2525
2349
|
}
|
|
2526
2350
|
)
|
|
2527
2351
|
}
|
|
2528
2352
|
),
|
|
2529
|
-
/* @__PURE__ */
|
|
2530
|
-
|
|
2353
|
+
/* @__PURE__ */ u(
|
|
2354
|
+
he,
|
|
2531
2355
|
{
|
|
2532
2356
|
align: "start",
|
|
2533
2357
|
className: "richtext-w-full",
|
|
2534
2358
|
hideWhenDetached: !0,
|
|
2535
2359
|
side: "bottom",
|
|
2536
2360
|
children: [
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */ r(
|
|
2361
|
+
/* @__PURE__ */ u("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
|
|
2362
|
+
/* @__PURE__ */ r(ke, { children: n("editor.search.dialog.text") }),
|
|
2539
2363
|
/* @__PURE__ */ r("span", { className: "richtext-font-semibold", children: o.length > 0 ? `${i + 1}/${o.length}` : "0/0" })
|
|
2540
2364
|
] }),
|
|
2541
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ u("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: [
|
|
2542
2366
|
/* @__PURE__ */ r(
|
|
2543
|
-
|
|
2367
|
+
qe,
|
|
2544
2368
|
{
|
|
2545
2369
|
autoFocus: !0,
|
|
2546
2370
|
className: "richtext-w-full",
|
|
2547
|
-
onChange: (
|
|
2371
|
+
onChange: (w) => h(w.target.value),
|
|
2548
2372
|
placeholder: "Text",
|
|
2549
2373
|
required: !0,
|
|
2550
2374
|
type: "text",
|
|
@@ -2557,7 +2381,7 @@ function Qi({ editor: e, ...t }) {
|
|
|
2557
2381
|
className: "richtext-flex-1",
|
|
2558
2382
|
disabled: o.length === 0,
|
|
2559
2383
|
onClick: e.commands.goToPrevSearchResult,
|
|
2560
|
-
children: /* @__PURE__ */ r(
|
|
2384
|
+
children: /* @__PURE__ */ r(M, { name: "ChevronUp" })
|
|
2561
2385
|
}
|
|
2562
2386
|
),
|
|
2563
2387
|
/* @__PURE__ */ r(
|
|
@@ -2566,35 +2390,35 @@ function Qi({ editor: e, ...t }) {
|
|
|
2566
2390
|
className: "richtext-flex-1",
|
|
2567
2391
|
disabled: o.length === 0,
|
|
2568
2392
|
onClick: e.commands.goToNextSearchResult,
|
|
2569
|
-
children: /* @__PURE__ */ r(
|
|
2393
|
+
children: /* @__PURE__ */ r(M, { name: "ChevronDown" })
|
|
2570
2394
|
}
|
|
2571
2395
|
)
|
|
2572
2396
|
] }),
|
|
2573
|
-
/* @__PURE__ */ r(
|
|
2397
|
+
/* @__PURE__ */ r(ke, { className: "richtext-mb-[6px]", children: n("editor.replace.dialog.text") }),
|
|
2574
2398
|
/* @__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(
|
|
2575
|
-
|
|
2399
|
+
qe,
|
|
2576
2400
|
{
|
|
2577
2401
|
className: "richtext-w-80",
|
|
2578
|
-
onChange: (
|
|
2402
|
+
onChange: (w) => l(w.target.value),
|
|
2579
2403
|
placeholder: "Text",
|
|
2580
2404
|
required: !0,
|
|
2581
2405
|
type: "text",
|
|
2582
2406
|
value: d
|
|
2583
2407
|
}
|
|
2584
2408
|
) }) }),
|
|
2585
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ u("div", { className: "richtext-mb-[10px] richtext-flex richtext-items-center richtext-space-x-2", children: [
|
|
2586
2410
|
/* @__PURE__ */ r(
|
|
2587
|
-
|
|
2411
|
+
Cn,
|
|
2588
2412
|
{
|
|
2589
|
-
checked:
|
|
2590
|
-
onCheckedChange: (
|
|
2591
|
-
w
|
|
2413
|
+
checked: f,
|
|
2414
|
+
onCheckedChange: (w) => {
|
|
2415
|
+
p(w), e.commands.setCaseSensitive(w);
|
|
2592
2416
|
}
|
|
2593
2417
|
}
|
|
2594
2418
|
),
|
|
2595
|
-
/* @__PURE__ */ r(
|
|
2419
|
+
/* @__PURE__ */ r(ke, { children: n("editor.replace.caseSensitive") })
|
|
2596
2420
|
] }),
|
|
2597
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
2598
2422
|
/* @__PURE__ */ r(
|
|
2599
2423
|
V,
|
|
2600
2424
|
{
|
|
@@ -2621,11 +2445,11 @@ function Qi({ editor: e, ...t }) {
|
|
|
2621
2445
|
}
|
|
2622
2446
|
);
|
|
2623
2447
|
}
|
|
2624
|
-
const
|
|
2625
|
-
function
|
|
2448
|
+
const ae = (e, t) => t(e.tr);
|
|
2449
|
+
function Mi(e, t, n) {
|
|
2626
2450
|
return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e, n ? "gu" : "gui");
|
|
2627
2451
|
}
|
|
2628
|
-
function
|
|
2452
|
+
function Pi(e, t, n) {
|
|
2629
2453
|
const i = [];
|
|
2630
2454
|
let a = [];
|
|
2631
2455
|
const o = [];
|
|
@@ -2653,19 +2477,19 @@ function Xi(e, t, n) {
|
|
|
2653
2477
|
}
|
|
2654
2478
|
}
|
|
2655
2479
|
for (const c of o)
|
|
2656
|
-
i.push(
|
|
2480
|
+
i.push(ce.inline(c.from, c.to, { class: n }));
|
|
2657
2481
|
return {
|
|
2658
2482
|
decorationsToReturn: i,
|
|
2659
2483
|
results: o
|
|
2660
2484
|
};
|
|
2661
2485
|
}
|
|
2662
|
-
function
|
|
2486
|
+
function Ge(e, t, { state: n, dispatch: i }) {
|
|
2663
2487
|
if (!t[0])
|
|
2664
2488
|
return;
|
|
2665
2489
|
const { from: o, to: s } = t[0];
|
|
2666
2490
|
i && i(n.tr.insertText(e, o, s));
|
|
2667
2491
|
}
|
|
2668
|
-
function
|
|
2492
|
+
function Ri(e, t, n, i) {
|
|
2669
2493
|
const a = t + 1;
|
|
2670
2494
|
if (!i[a])
|
|
2671
2495
|
return null;
|
|
@@ -2675,19 +2499,19 @@ function ea(e, t, n, i) {
|
|
|
2675
2499
|
from: h - c
|
|
2676
2500
|
}, [c, i];
|
|
2677
2501
|
}
|
|
2678
|
-
function
|
|
2502
|
+
function Ii(e, t, { tr: n, dispatch: i }) {
|
|
2679
2503
|
let a = 0, o = t.slice();
|
|
2680
2504
|
if (o.length === 0)
|
|
2681
2505
|
return !1;
|
|
2682
2506
|
for (let s = 0; s < o.length; s += 1) {
|
|
2683
2507
|
const { from: c, to: h } = o[s];
|
|
2684
2508
|
n.insertText(e, c, h);
|
|
2685
|
-
const d =
|
|
2509
|
+
const d = Ri(e, s, a, o);
|
|
2686
2510
|
d && (a = d[0], o = d[1]);
|
|
2687
2511
|
}
|
|
2688
2512
|
return i(n), !0;
|
|
2689
2513
|
}
|
|
2690
|
-
function
|
|
2514
|
+
function Ze({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, gotoIndex: a }) {
|
|
2691
2515
|
const o = n[a];
|
|
2692
2516
|
if (o) {
|
|
2693
2517
|
const s = t.setMeta("directDecoration", {
|
|
@@ -2697,12 +2521,12 @@ function tt({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, got
|
|
|
2697
2521
|
});
|
|
2698
2522
|
return e == null || e.dispatch(s), setTimeout(() => {
|
|
2699
2523
|
const c = window.document.querySelector(`.${i}`);
|
|
2700
|
-
c &&
|
|
2524
|
+
c && Oe(c, { behavior: "smooth", scrollMode: "if-needed" });
|
|
2701
2525
|
}, 0), !0;
|
|
2702
2526
|
}
|
|
2703
2527
|
return !1;
|
|
2704
2528
|
}
|
|
2705
|
-
const
|
|
2529
|
+
const ji = A.create({
|
|
2706
2530
|
name: "search",
|
|
2707
2531
|
addOptions() {
|
|
2708
2532
|
var e;
|
|
@@ -2719,7 +2543,7 @@ const na = N.create({
|
|
|
2719
2543
|
onChange: () => {
|
|
2720
2544
|
},
|
|
2721
2545
|
button: ({ editor: t, t: n }) => ({
|
|
2722
|
-
component:
|
|
2546
|
+
component: zi,
|
|
2723
2547
|
componentProps: {
|
|
2724
2548
|
action: () => {
|
|
2725
2549
|
},
|
|
@@ -2740,20 +2564,20 @@ const na = N.create({
|
|
|
2740
2564
|
},
|
|
2741
2565
|
addCommands() {
|
|
2742
2566
|
return {
|
|
2743
|
-
setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE),
|
|
2744
|
-
setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e,
|
|
2745
|
-
setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e,
|
|
2567
|
+
setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE), ae(t, n), !1),
|
|
2568
|
+
setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, ae(t, n), !1),
|
|
2569
|
+
setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, ae(t, n), !1),
|
|
2746
2570
|
replace: () => ({ state: e, dispatch: t }) => {
|
|
2747
2571
|
const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage, o = a[i];
|
|
2748
|
-
return o ? (
|
|
2572
|
+
return o ? (Ge(n, [o], { state: e, dispatch: t }), this.storage.results.splice(i, 1)) : (Ge(n, a, { state: e, dispatch: t }), this.storage.results.shift()), K(D.SEARCH_REPLCE), ae(e, t), !1;
|
|
2749
2573
|
},
|
|
2750
2574
|
replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
|
|
2751
2575
|
const { replaceTerm: i } = this.options, { results: a } = this.storage;
|
|
2752
|
-
return
|
|
2576
|
+
return Ii(i, a, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], K(D.SEARCH_REPLCE), ae(e, n), !1;
|
|
2753
2577
|
},
|
|
2754
2578
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
2755
2579
|
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + a.length - 1) % a.length;
|
|
2756
|
-
return this.storage.currentIndex = o, K(D.SEARCH_REPLCE),
|
|
2580
|
+
return this.storage.currentIndex = o, K(D.SEARCH_REPLCE), Ze({
|
|
2757
2581
|
view: e,
|
|
2758
2582
|
tr: t,
|
|
2759
2583
|
searchResults: a,
|
|
@@ -2763,7 +2587,7 @@ const na = N.create({
|
|
|
2763
2587
|
},
|
|
2764
2588
|
goToNextSearchResult: () => ({ view: e, tr: t }) => {
|
|
2765
2589
|
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + 1) % a.length;
|
|
2766
|
-
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE),
|
|
2590
|
+
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE), Ze({
|
|
2767
2591
|
view: e,
|
|
2768
2592
|
tr: t,
|
|
2769
2593
|
searchResults: a,
|
|
@@ -2780,26 +2604,26 @@ const na = N.create({
|
|
|
2780
2604
|
key: new Z("search"),
|
|
2781
2605
|
state: {
|
|
2782
2606
|
init() {
|
|
2783
|
-
return
|
|
2607
|
+
return se.empty;
|
|
2784
2608
|
},
|
|
2785
2609
|
apply(t) {
|
|
2786
2610
|
const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: s, disableRegex: c, caseSensitive: h } = e.options;
|
|
2787
2611
|
if (i || a) {
|
|
2788
|
-
const { decorationsToReturn: d, results: l } =
|
|
2612
|
+
const { decorationsToReturn: d, results: l } = Pi(
|
|
2789
2613
|
n,
|
|
2790
|
-
|
|
2614
|
+
Mi(a, c, h),
|
|
2791
2615
|
o
|
|
2792
2616
|
);
|
|
2793
2617
|
if (e.storage.results = l, e.storage.currentIndex > l.length - 1 && (e.storage.currentIndex = 0), K(D.SEARCH_REPLCE), t.getMeta("directDecoration")) {
|
|
2794
|
-
const { fromPos:
|
|
2795
|
-
d.push(
|
|
2618
|
+
const { fromPos: m, toPos: _, attrs: f } = t.getMeta("directDecoration");
|
|
2619
|
+
d.push(ce.inline(m, _, f));
|
|
2796
2620
|
} else
|
|
2797
|
-
l.length > 0 && (d[0] =
|
|
2621
|
+
l.length > 0 && (d[0] = ce.inline(l[0].from, l[0].to, {
|
|
2798
2622
|
class: s
|
|
2799
2623
|
}));
|
|
2800
|
-
return
|
|
2624
|
+
return se.create(n, d);
|
|
2801
2625
|
}
|
|
2802
|
-
return
|
|
2626
|
+
return se.empty;
|
|
2803
2627
|
}
|
|
2804
2628
|
},
|
|
2805
2629
|
props: {
|
|
@@ -2811,14 +2635,14 @@ const na = N.create({
|
|
|
2811
2635
|
];
|
|
2812
2636
|
}
|
|
2813
2637
|
});
|
|
2814
|
-
function
|
|
2638
|
+
function Bi({
|
|
2815
2639
|
className: e,
|
|
2816
2640
|
...t
|
|
2817
2641
|
}) {
|
|
2818
2642
|
return /* @__PURE__ */ r(
|
|
2819
2643
|
W.Root,
|
|
2820
2644
|
{
|
|
2821
|
-
className:
|
|
2645
|
+
className: T(
|
|
2822
2646
|
"richtext-bg-popover richtext-text-popover-foreground richtext-isolate richtext-flex richtext-h-full richtext-w-fit richtext-flex-col richtext-overflow-hidden richtext-rounded-md",
|
|
2823
2647
|
e
|
|
2824
2648
|
),
|
|
@@ -2827,17 +2651,17 @@ function ia({
|
|
|
2827
2651
|
}
|
|
2828
2652
|
);
|
|
2829
2653
|
}
|
|
2830
|
-
function
|
|
2654
|
+
function Di({
|
|
2831
2655
|
className: e,
|
|
2832
2656
|
...t
|
|
2833
2657
|
}) {
|
|
2834
|
-
return /* @__PURE__ */
|
|
2658
|
+
return /* @__PURE__ */ u(
|
|
2835
2659
|
"div",
|
|
2836
2660
|
{
|
|
2837
|
-
className:
|
|
2661
|
+
className: T("richtext-flex richtext-h-9 richtext-items-center richtext-gap-2 richtext-border-b richtext-px-3", e),
|
|
2838
2662
|
"data-slot": "emoji-picker-search-wrapper",
|
|
2839
2663
|
children: [
|
|
2840
|
-
/* @__PURE__ */ r(
|
|
2664
|
+
/* @__PURE__ */ r(an, { className: "richtext-size-4 richtext-shrink-0 richtext-opacity-50" }),
|
|
2841
2665
|
/* @__PURE__ */ r(
|
|
2842
2666
|
W.Search,
|
|
2843
2667
|
{
|
|
@@ -2850,10 +2674,10 @@ function aa({
|
|
|
2850
2674
|
}
|
|
2851
2675
|
);
|
|
2852
2676
|
}
|
|
2853
|
-
function
|
|
2677
|
+
function Oi({ children: e, ...t }) {
|
|
2854
2678
|
return /* @__PURE__ */ r("div", { ...t, className: "richtext-scroll-my-1 richtext-px-1", "data-slot": "emoji-picker-row", children: e });
|
|
2855
2679
|
}
|
|
2856
|
-
function
|
|
2680
|
+
function $i({
|
|
2857
2681
|
emoji: e,
|
|
2858
2682
|
className: t,
|
|
2859
2683
|
...n
|
|
@@ -2862,7 +2686,7 @@ function ra({
|
|
|
2862
2686
|
"button",
|
|
2863
2687
|
{
|
|
2864
2688
|
...n,
|
|
2865
|
-
className:
|
|
2689
|
+
className: T(
|
|
2866
2690
|
"data-[active]:richtext-bg-accent richtext-flex richtext-size-7 richtext-items-center richtext-justify-center richtext-rounded-sm richtext-text-base",
|
|
2867
2691
|
t
|
|
2868
2692
|
),
|
|
@@ -2871,7 +2695,7 @@ function ra({
|
|
|
2871
2695
|
}
|
|
2872
2696
|
);
|
|
2873
2697
|
}
|
|
2874
|
-
function
|
|
2698
|
+
function Fi({
|
|
2875
2699
|
category: e,
|
|
2876
2700
|
...t
|
|
2877
2701
|
}) {
|
|
@@ -2885,14 +2709,14 @@ function sa({
|
|
|
2885
2709
|
}
|
|
2886
2710
|
);
|
|
2887
2711
|
}
|
|
2888
|
-
function
|
|
2712
|
+
function Ui({
|
|
2889
2713
|
className: e,
|
|
2890
2714
|
...t
|
|
2891
2715
|
}) {
|
|
2892
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ u(
|
|
2893
2717
|
W.Viewport,
|
|
2894
2718
|
{
|
|
2895
|
-
className:
|
|
2719
|
+
className: T("richtext-outline-hidden richtext-relative richtext-flex-1", e),
|
|
2896
2720
|
"data-slot": "emoji-picker-viewport",
|
|
2897
2721
|
...t,
|
|
2898
2722
|
children: [
|
|
@@ -2901,7 +2725,7 @@ function ca({
|
|
|
2901
2725
|
{
|
|
2902
2726
|
className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground",
|
|
2903
2727
|
"data-slot": "emoji-picker-loading",
|
|
2904
|
-
children: /* @__PURE__ */ r(
|
|
2728
|
+
children: /* @__PURE__ */ r(on, { className: "richtext-size-4 richtext-animate-spin" })
|
|
2905
2729
|
}
|
|
2906
2730
|
),
|
|
2907
2731
|
/* @__PURE__ */ r(
|
|
@@ -2917,9 +2741,9 @@ function ca({
|
|
|
2917
2741
|
{
|
|
2918
2742
|
className: "richtext-select-none richtext-pb-1",
|
|
2919
2743
|
components: {
|
|
2920
|
-
Row:
|
|
2921
|
-
Emoji:
|
|
2922
|
-
CategoryHeader:
|
|
2744
|
+
Row: Oi,
|
|
2745
|
+
Emoji: $i,
|
|
2746
|
+
CategoryHeader: Fi
|
|
2923
2747
|
},
|
|
2924
2748
|
"data-slot": "emoji-picker-list"
|
|
2925
2749
|
}
|
|
@@ -2928,47 +2752,47 @@ function ca({
|
|
|
2928
2752
|
}
|
|
2929
2753
|
);
|
|
2930
2754
|
}
|
|
2931
|
-
function
|
|
2755
|
+
function qi({
|
|
2932
2756
|
className: e,
|
|
2933
2757
|
...t
|
|
2934
2758
|
}) {
|
|
2935
2759
|
return /* @__PURE__ */ r(
|
|
2936
2760
|
"div",
|
|
2937
2761
|
{
|
|
2938
|
-
className:
|
|
2762
|
+
className: T(
|
|
2939
2763
|
"richtext-max-w-(--frimousse-viewport-width) richtext-flex richtext-w-full richtext-min-w-0 richtext-items-center richtext-gap-1 richtext-border-t richtext-p-2",
|
|
2940
2764
|
e
|
|
2941
2765
|
),
|
|
2942
2766
|
"data-slot": "emoji-picker-footer",
|
|
2943
2767
|
...t,
|
|
2944
|
-
children: /* @__PURE__ */ r(W.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */
|
|
2768
|
+
children: /* @__PURE__ */ r(W.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ u(xe, { children: [
|
|
2945
2769
|
/* @__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
2770
|
/* @__PURE__ */ r("span", { className: "richtext-text-secondary-foreground richtext-truncate richtext-text-xs", children: n.label })
|
|
2947
2771
|
] }) : /* @__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…" }) })
|
|
2948
2772
|
}
|
|
2949
2773
|
);
|
|
2950
2774
|
}
|
|
2951
|
-
function
|
|
2952
|
-
return /* @__PURE__ */
|
|
2953
|
-
/* @__PURE__ */ r(
|
|
2775
|
+
function Ki({ onSelectEmoji: e, children: t }) {
|
|
2776
|
+
return /* @__PURE__ */ u(le, { modal: !0, children: [
|
|
2777
|
+
/* @__PURE__ */ r(de, { asChild: !0, children: t }),
|
|
2954
2778
|
/* @__PURE__ */ r(
|
|
2955
|
-
|
|
2779
|
+
he,
|
|
2956
2780
|
{
|
|
2957
2781
|
align: "start",
|
|
2958
2782
|
className: "richtext-size-full richtext-p-2",
|
|
2959
2783
|
hideWhenDetached: !0,
|
|
2960
2784
|
side: "bottom",
|
|
2961
|
-
children: /* @__PURE__ */
|
|
2962
|
-
|
|
2785
|
+
children: /* @__PURE__ */ u(
|
|
2786
|
+
Bi,
|
|
2963
2787
|
{
|
|
2964
2788
|
className: "!richtext-h-[342px]",
|
|
2965
2789
|
onEmojiSelect: ({ emoji: n }) => {
|
|
2966
2790
|
e(n);
|
|
2967
2791
|
},
|
|
2968
2792
|
children: [
|
|
2969
|
-
/* @__PURE__ */ r(
|
|
2970
|
-
/* @__PURE__ */ r(
|
|
2971
|
-
/* @__PURE__ */ r(
|
|
2793
|
+
/* @__PURE__ */ r(Di, {}),
|
|
2794
|
+
/* @__PURE__ */ r(Ui, {}),
|
|
2795
|
+
/* @__PURE__ */ r(qi, {})
|
|
2972
2796
|
]
|
|
2973
2797
|
}
|
|
2974
2798
|
)
|
|
@@ -2976,7 +2800,7 @@ function da({ onSelectEmoji: e, children: t }) {
|
|
|
2976
2800
|
)
|
|
2977
2801
|
] });
|
|
2978
2802
|
}
|
|
2979
|
-
function
|
|
2803
|
+
function Vi({ editor: e, icon: t, ...n }) {
|
|
2980
2804
|
const i = F(
|
|
2981
2805
|
(a) => {
|
|
2982
2806
|
const { selection: o } = e.state, { $anchor: s } = o;
|
|
@@ -2984,7 +2808,7 @@ function ha({ editor: e, icon: t, ...n }) {
|
|
|
2984
2808
|
},
|
|
2985
2809
|
[e]
|
|
2986
2810
|
);
|
|
2987
|
-
return /* @__PURE__ */ r(
|
|
2811
|
+
return /* @__PURE__ */ r(Ki, { onSelectEmoji: i, children: /* @__PURE__ */ r(
|
|
2988
2812
|
x,
|
|
2989
2813
|
{
|
|
2990
2814
|
icon: t,
|
|
@@ -2992,10 +2816,10 @@ function ha({ editor: e, icon: t, ...n }) {
|
|
|
2992
2816
|
}
|
|
2993
2817
|
) });
|
|
2994
2818
|
}
|
|
2995
|
-
const
|
|
2996
|
-
const n = G(null), [i, a] =
|
|
2997
|
-
const
|
|
2998
|
-
|
|
2819
|
+
const ut = He((e, t) => {
|
|
2820
|
+
const n = G(null), [i, a] = C(0), { t: o } = j(), s = (l) => {
|
|
2821
|
+
const m = e.items[l];
|
|
2822
|
+
m && e.command(m);
|
|
2999
2823
|
}, c = () => {
|
|
3000
2824
|
a((i + e.items.length - 1) % e.items.length);
|
|
3001
2825
|
}, h = () => {
|
|
@@ -3003,18 +2827,18 @@ const xt = Re((e, t) => {
|
|
|
3003
2827
|
}, d = () => {
|
|
3004
2828
|
s(i);
|
|
3005
2829
|
};
|
|
3006
|
-
return
|
|
2830
|
+
return z(() => a(0), [e.items]), z(() => {
|
|
3007
2831
|
if (Number.isNaN(i + 1))
|
|
3008
2832
|
return;
|
|
3009
2833
|
const l = n.current.querySelector(`span:nth-of-type(${i + 1})`);
|
|
3010
|
-
l &&
|
|
3011
|
-
}, [i]),
|
|
2834
|
+
l && Oe(l, { behavior: "smooth", scrollMode: "if-needed" });
|
|
2835
|
+
}, [i]), ze(t, () => ({
|
|
3012
2836
|
onKeyDown: ({ event: l }) => l.key === "ArrowUp" ? (c(), !0) : l.key === "ArrowDown" ? (h(), !0) : l.key === "Enter" ? (d(), !0) : !1
|
|
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,
|
|
2837
|
+
})), /* @__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, m) => /* @__PURE__ */ u(
|
|
3014
2838
|
"span",
|
|
3015
2839
|
{
|
|
3016
|
-
className:
|
|
3017
|
-
onClick: () => s(
|
|
2840
|
+
className: P(" 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", m === i ? "bg-accent" : ""),
|
|
2841
|
+
onClick: () => s(m),
|
|
3018
2842
|
children: [
|
|
3019
2843
|
l.fallbackImage ? /* @__PURE__ */ r(
|
|
3020
2844
|
"img",
|
|
@@ -3028,10 +2852,10 @@ const xt = Re((e, t) => {
|
|
|
3028
2852
|
":"
|
|
3029
2853
|
]
|
|
3030
2854
|
},
|
|
3031
|
-
`emoji-list-code-${
|
|
2855
|
+
`emoji-list-code-${m}`
|
|
3032
2856
|
)) : /* @__PURE__ */ r("div", { className: "richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors", children: /* @__PURE__ */ r("span", { children: o("no_result_found") }) }) }) });
|
|
3033
2857
|
});
|
|
3034
|
-
|
|
2858
|
+
ut.displayName = "EmojiList";
|
|
3035
2859
|
const ee = {
|
|
3036
2860
|
100: "💯",
|
|
3037
2861
|
1234: "🔢",
|
|
@@ -4876,18 +4700,18 @@ Object.keys(ee).reduce((e, t) => {
|
|
|
4876
4700
|
const n = ee[t];
|
|
4877
4701
|
return e[n] = t, e;
|
|
4878
4702
|
}, {});
|
|
4879
|
-
const
|
|
4703
|
+
const Wi = Object.keys(ee).map((e) => e);
|
|
4880
4704
|
Object.keys(ee).map((e) => ee[e]);
|
|
4881
|
-
function
|
|
4882
|
-
return
|
|
4705
|
+
function Gi(e) {
|
|
4706
|
+
return Wi.filter((t) => t.startsWith(e)).map((t) => ({
|
|
4883
4707
|
name: t,
|
|
4884
4708
|
emoji: ee[t]
|
|
4885
4709
|
}));
|
|
4886
4710
|
}
|
|
4887
|
-
const
|
|
4711
|
+
const Zi = 200, Ji = new Z("emoji"), bo = ge.create({
|
|
4888
4712
|
name: "emoji",
|
|
4889
4713
|
content: "text*",
|
|
4890
|
-
priority:
|
|
4714
|
+
priority: Zi,
|
|
4891
4715
|
addOptions() {
|
|
4892
4716
|
var e;
|
|
4893
4717
|
return {
|
|
@@ -4895,13 +4719,13 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4895
4719
|
HTMLAttributes: {},
|
|
4896
4720
|
suggestion: {
|
|
4897
4721
|
char: ":",
|
|
4898
|
-
pluginKey:
|
|
4722
|
+
pluginKey: Ji,
|
|
4899
4723
|
command: ({ editor: t, range: n, props: i }) => {
|
|
4900
4724
|
t.chain().focus().insertContentAt(n, `${i.emoji} `).run();
|
|
4901
4725
|
}
|
|
4902
4726
|
},
|
|
4903
4727
|
button: ({ editor: t, t: n }) => ({
|
|
4904
|
-
component:
|
|
4728
|
+
component: Vi,
|
|
4905
4729
|
componentProps: {
|
|
4906
4730
|
editor: t,
|
|
4907
4731
|
action: () => {
|
|
@@ -4921,7 +4745,7 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4921
4745
|
},
|
|
4922
4746
|
addProseMirrorPlugins() {
|
|
4923
4747
|
return [
|
|
4924
|
-
|
|
4748
|
+
Qe({
|
|
4925
4749
|
editor: this.editor,
|
|
4926
4750
|
...this.options.suggestion
|
|
4927
4751
|
})
|
|
@@ -4929,15 +4753,15 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4929
4753
|
}
|
|
4930
4754
|
}).configure({
|
|
4931
4755
|
suggestion: {
|
|
4932
|
-
items: ({ query: e }) =>
|
|
4756
|
+
items: ({ query: e }) => Gi(e),
|
|
4933
4757
|
render: () => {
|
|
4934
4758
|
let e, t, n;
|
|
4935
4759
|
return {
|
|
4936
4760
|
onStart: (i) => {
|
|
4937
|
-
n = i.editor.isEditable, n && (e = new
|
|
4761
|
+
n = i.editor.isEditable, n && (e = new Te(ut, {
|
|
4938
4762
|
props: i,
|
|
4939
4763
|
editor: i.editor
|
|
4940
|
-
}), t =
|
|
4764
|
+
}), t = De("body", {
|
|
4941
4765
|
getReferenceClientRect: i.clientRect,
|
|
4942
4766
|
appendTo: () => document.body,
|
|
4943
4767
|
content: e.element,
|
|
@@ -4964,7 +4788,7 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4964
4788
|
}
|
|
4965
4789
|
}
|
|
4966
4790
|
});
|
|
4967
|
-
function
|
|
4791
|
+
function Yi(e) {
|
|
4968
4792
|
const t = document.createElement("iframe");
|
|
4969
4793
|
t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
|
|
4970
4794
|
<!DOCTYPE html>
|
|
@@ -5001,11 +4825,11 @@ function ga(e) {
|
|
|
5001
4825
|
}, 100);
|
|
5002
4826
|
});
|
|
5003
4827
|
}
|
|
5004
|
-
function
|
|
4828
|
+
function Qi(e) {
|
|
5005
4829
|
const t = e.getHTML();
|
|
5006
|
-
return t ? (
|
|
4830
|
+
return t ? (Yi(t), !0) : !1;
|
|
5007
4831
|
}
|
|
5008
|
-
const
|
|
4832
|
+
const xo = A.create({
|
|
5009
4833
|
name: "exportPdf",
|
|
5010
4834
|
addOptions() {
|
|
5011
4835
|
var e;
|
|
@@ -5015,7 +4839,7 @@ const jo = N.create({
|
|
|
5015
4839
|
component: x,
|
|
5016
4840
|
componentProps: {
|
|
5017
4841
|
action: () => {
|
|
5018
|
-
|
|
4842
|
+
Qi(t);
|
|
5019
4843
|
},
|
|
5020
4844
|
icon: "ExportPdf",
|
|
5021
4845
|
tooltip: n("editor.exportPdf.tooltip"),
|
|
@@ -5026,84 +4850,84 @@ const jo = N.create({
|
|
|
5026
4850
|
};
|
|
5027
4851
|
}
|
|
5028
4852
|
});
|
|
5029
|
-
function
|
|
4853
|
+
function Xi(e, t) {
|
|
5030
4854
|
const n = atob(e.split(",")[1]), i = Array.from({ length: n.length });
|
|
5031
4855
|
for (let o = 0; o < n.length; o++)
|
|
5032
4856
|
i[o] = n.charCodeAt(o);
|
|
5033
4857
|
const a = new Uint8Array(i);
|
|
5034
4858
|
return new Blob([a], { type: t });
|
|
5035
4859
|
}
|
|
5036
|
-
function
|
|
4860
|
+
function ea(e, t) {
|
|
5037
4861
|
return new File([e], t, { type: e.type });
|
|
5038
4862
|
}
|
|
5039
|
-
function
|
|
5040
|
-
const { toast: t } =
|
|
4863
|
+
function ta(e) {
|
|
4864
|
+
const { toast: t } = Nn(), { t: n } = j(), [i, a] = C(!1), o = G(null);
|
|
5041
4865
|
function s() {
|
|
5042
|
-
var
|
|
5043
|
-
(
|
|
4866
|
+
var m;
|
|
4867
|
+
(m = o.current) == null || m.click();
|
|
5044
4868
|
}
|
|
5045
|
-
function c(
|
|
5046
|
-
const
|
|
5047
|
-
if (
|
|
5048
|
-
if (
|
|
4869
|
+
function c(m) {
|
|
4870
|
+
const _ = m.target.files[0];
|
|
4871
|
+
if (_) {
|
|
4872
|
+
if (_.size > e.limit) {
|
|
5049
4873
|
t({
|
|
5050
4874
|
variant: "destructive",
|
|
5051
4875
|
title: n("editor.importWord.limitSize")
|
|
5052
4876
|
});
|
|
5053
4877
|
return;
|
|
5054
4878
|
}
|
|
5055
|
-
d(
|
|
4879
|
+
d(_);
|
|
5056
4880
|
}
|
|
5057
4881
|
}
|
|
5058
|
-
async function h(
|
|
5059
|
-
var
|
|
5060
|
-
const
|
|
5061
|
-
if (
|
|
5062
|
-
return
|
|
5063
|
-
if (
|
|
5064
|
-
const E = (
|
|
4882
|
+
async function h(m) {
|
|
4883
|
+
var L;
|
|
4884
|
+
const f = new DOMParser().parseFromString(m, "text/html"), p = f.querySelectorAll("img");
|
|
4885
|
+
if (p.length === 0)
|
|
4886
|
+
return f.body.innerHTML;
|
|
4887
|
+
if (An(e.editor, "image")) {
|
|
4888
|
+
const E = (L = e.editor.extensionManager.extensions.find(
|
|
5065
4889
|
(g) => g.name === "importWord"
|
|
5066
|
-
)) == null ? void 0 :
|
|
4890
|
+
)) == null ? void 0 : L.options;
|
|
5067
4891
|
if (E && typeof E.upload == "function") {
|
|
5068
4892
|
const g = [];
|
|
5069
|
-
for (const k of
|
|
5070
|
-
const H = k.getAttribute("src"),
|
|
4893
|
+
for (const k of p) {
|
|
4894
|
+
const H = k.getAttribute("src"), S = Xi(H, "image/jpeg"), O = ea(S, "image.jpeg");
|
|
5071
4895
|
g.push(O);
|
|
5072
4896
|
}
|
|
5073
4897
|
const b = await E.upload(g);
|
|
5074
|
-
for (const [k, H] of
|
|
4898
|
+
for (const [k, H] of p.entries()) {
|
|
5075
4899
|
H.setAttribute("src", b[k].src);
|
|
5076
|
-
const
|
|
5077
|
-
(
|
|
4900
|
+
const S = H.parentElement;
|
|
4901
|
+
(S == null ? void 0 : S.tagName) === "P" && (S.insertAdjacentElement("beforebegin", H), !S.hasChildNodes() && S.textContent === "" && S.remove());
|
|
5078
4902
|
}
|
|
5079
|
-
return
|
|
4903
|
+
return f.body.innerHTML;
|
|
5080
4904
|
} else
|
|
5081
|
-
return console.warn("Image Upload method found, skip image conversion"),
|
|
4905
|
+
return console.warn("Image Upload method found, skip image conversion"), f.body.innerHTML;
|
|
5082
4906
|
} else
|
|
5083
|
-
return console.error("Image extension not found, unable to convert image"),
|
|
4907
|
+
return console.error("Image extension not found, unable to convert image"), f.body.innerHTML;
|
|
5084
4908
|
}
|
|
5085
|
-
async function d(
|
|
4909
|
+
async function d(m) {
|
|
5086
4910
|
a(!0);
|
|
5087
4911
|
try {
|
|
5088
4912
|
if (e.convert) {
|
|
5089
|
-
const
|
|
5090
|
-
l(
|
|
4913
|
+
const _ = await e.convert(m);
|
|
4914
|
+
l(_);
|
|
5091
4915
|
} else {
|
|
5092
|
-
const
|
|
5093
|
-
{ arrayBuffer:
|
|
4916
|
+
const _ = await m.arrayBuffer(), { value: f } = await Yt.convertToHtml(
|
|
4917
|
+
{ arrayBuffer: _ },
|
|
5094
4918
|
e == null ? void 0 : e.mammothOptions
|
|
5095
4919
|
);
|
|
5096
|
-
l(
|
|
4920
|
+
l(f);
|
|
5097
4921
|
}
|
|
5098
4922
|
} finally {
|
|
5099
4923
|
a(!1);
|
|
5100
4924
|
}
|
|
5101
4925
|
}
|
|
5102
|
-
async function l(
|
|
5103
|
-
const
|
|
5104
|
-
e.editor.chain().setContent(
|
|
4926
|
+
async function l(m) {
|
|
4927
|
+
const _ = await h(m);
|
|
4928
|
+
e.editor.chain().setContent(_, !0).run();
|
|
5105
4929
|
}
|
|
5106
|
-
return /* @__PURE__ */
|
|
4930
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
5107
4931
|
/* @__PURE__ */ r(
|
|
5108
4932
|
x,
|
|
5109
4933
|
{
|
|
@@ -5128,7 +4952,7 @@ function pa(e) {
|
|
|
5128
4952
|
)
|
|
5129
4953
|
] });
|
|
5130
4954
|
}
|
|
5131
|
-
const
|
|
4955
|
+
const po = A.create({
|
|
5132
4956
|
name: "importWord",
|
|
5133
4957
|
addOptions() {
|
|
5134
4958
|
var e;
|
|
@@ -5141,7 +4965,7 @@ const Do = N.create({
|
|
|
5141
4965
|
button: ({ editor: t, extension: n, t: i }) => {
|
|
5142
4966
|
const { convert: a, limit: o, mammothOptions: s } = n.options;
|
|
5143
4967
|
return {
|
|
5144
|
-
component:
|
|
4968
|
+
component: ta,
|
|
5145
4969
|
componentProps: {
|
|
5146
4970
|
editor: t,
|
|
5147
4971
|
convert: a,
|
|
@@ -5157,15 +4981,15 @@ const Do = N.create({
|
|
|
5157
4981
|
}
|
|
5158
4982
|
};
|
|
5159
4983
|
}
|
|
5160
|
-
}),
|
|
5161
|
-
function
|
|
5162
|
-
if (
|
|
4984
|
+
}), na = typeof window < "u";
|
|
4985
|
+
function ia(e, t) {
|
|
4986
|
+
if (na) {
|
|
5163
4987
|
const n = window.URL.createObjectURL(e), i = document.createElement("a");
|
|
5164
4988
|
return i.href = n, i.download = t, i.click(), window.URL.revokeObjectURL(n), Promise.resolve();
|
|
5165
4989
|
}
|
|
5166
4990
|
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
5167
4991
|
}
|
|
5168
|
-
const
|
|
4992
|
+
const aa = {
|
|
5169
4993
|
...U,
|
|
5170
4994
|
hardBreak: U.hard_break,
|
|
5171
4995
|
codeBlock: U.code_block,
|
|
@@ -5182,12 +5006,12 @@ const va = {
|
|
|
5182
5006
|
tableOptions: {
|
|
5183
5007
|
width: {
|
|
5184
5008
|
size: 100,
|
|
5185
|
-
type:
|
|
5009
|
+
type: Dn.PERCENTAGE
|
|
5186
5010
|
}
|
|
5187
5011
|
}
|
|
5188
5012
|
});
|
|
5189
5013
|
}
|
|
5190
|
-
},
|
|
5014
|
+
}, oa = new On(aa, $n), wo = A.create({
|
|
5191
5015
|
name: "exportWord",
|
|
5192
5016
|
addOptions() {
|
|
5193
5017
|
var e;
|
|
@@ -5216,18 +5040,18 @@ const va = {
|
|
|
5216
5040
|
const o = await (await fetch(i)).arrayBuffer();
|
|
5217
5041
|
return new Uint8Array(o);
|
|
5218
5042
|
}
|
|
5219
|
-
}, n =
|
|
5220
|
-
return
|
|
5043
|
+
}, n = oa.serialize(e.state.doc, t);
|
|
5044
|
+
return Bn.toBlob(n).then((i) => ia(new Blob([i]), "export-document.docx")), !0;
|
|
5221
5045
|
}
|
|
5222
5046
|
};
|
|
5223
5047
|
}
|
|
5224
|
-
}),
|
|
5225
|
-
toc:
|
|
5226
|
-
visible:
|
|
5227
|
-
list:
|
|
5228
|
-
item:
|
|
5048
|
+
}), ra = "_toc_aag8a_1", sa = "_visible_aag8a_7", ca = "_list_aag8a_11", la = "_item_aag8a_16", _e = {
|
|
5049
|
+
toc: ra,
|
|
5050
|
+
visible: sa,
|
|
5051
|
+
list: ca,
|
|
5052
|
+
item: la
|
|
5229
5053
|
};
|
|
5230
|
-
function
|
|
5054
|
+
function da(e) {
|
|
5231
5055
|
const t = [], n = [t];
|
|
5232
5056
|
return e.forEach((i) => {
|
|
5233
5057
|
let a = -1, o = n[i.level + a];
|
|
@@ -5236,8 +5060,8 @@ function Sa(e) {
|
|
|
5236
5060
|
o.push({ ...i, children: n[i.level] = [] });
|
|
5237
5061
|
}), t;
|
|
5238
5062
|
}
|
|
5239
|
-
function
|
|
5240
|
-
const t =
|
|
5063
|
+
function ha({ editor: e }) {
|
|
5064
|
+
const t = Ie(), [n, i] = C([]), { t: a } = j(), o = F(() => {
|
|
5241
5065
|
const s = [], c = e.state.tr;
|
|
5242
5066
|
e.state.doc.descendants((h, d) => {
|
|
5243
5067
|
if (h.type.name === "heading") {
|
|
@@ -5251,9 +5075,9 @@ function Ea({ editor: e }) {
|
|
|
5251
5075
|
id: l
|
|
5252
5076
|
});
|
|
5253
5077
|
}
|
|
5254
|
-
}), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c), i(s), e.eventEmitter && e.eventEmitter.emit("TableOfContents",
|
|
5078
|
+
}), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c), i(s), e.eventEmitter && e.eventEmitter.emit("TableOfContents", da(s));
|
|
5255
5079
|
}, [e]);
|
|
5256
|
-
return
|
|
5080
|
+
return z(() => {
|
|
5257
5081
|
if (e) {
|
|
5258
5082
|
if (!e.options.editable) {
|
|
5259
5083
|
o();
|
|
@@ -5263,14 +5087,14 @@ function Ea({ editor: e }) {
|
|
|
5263
5087
|
e.off("update", o);
|
|
5264
5088
|
};
|
|
5265
5089
|
}
|
|
5266
|
-
}, [e, o]),
|
|
5090
|
+
}, [e, o]), z(() => {
|
|
5267
5091
|
o();
|
|
5268
|
-
}, []), /* @__PURE__ */ r(
|
|
5092
|
+
}, []), /* @__PURE__ */ r(re, { className: P("tableOfContent", _e.toc, t && _e.visible), children: t ? /* @__PURE__ */ u("div", { style: { position: "relative" }, children: [
|
|
5269
5093
|
/* @__PURE__ */ r("p", { className: "text-[20px] richtext-mb-[8px] richtext-font-semibold", children: a("editor.table_of_content") }),
|
|
5270
|
-
/* @__PURE__ */ r("ul", { className:
|
|
5094
|
+
/* @__PURE__ */ r("ul", { className: _e.list, children: n.map((s, c) => /* @__PURE__ */ r(
|
|
5271
5095
|
"li",
|
|
5272
5096
|
{
|
|
5273
|
-
className:
|
|
5097
|
+
className: _e.item,
|
|
5274
5098
|
style: { paddingLeft: `${s.level - 1}rem` },
|
|
5275
5099
|
children: /* @__PURE__ */ r("a", { href: `#${s.id}`, children: s.text })
|
|
5276
5100
|
},
|
|
@@ -5278,9 +5102,9 @@ function Ea({ editor: e }) {
|
|
|
5278
5102
|
)) })
|
|
5279
5103
|
] }) : null });
|
|
5280
5104
|
}
|
|
5281
|
-
function
|
|
5282
|
-
const [n, i] =
|
|
5283
|
-
return
|
|
5105
|
+
function ua(e, ...t) {
|
|
5106
|
+
const [n, i] = C(!1);
|
|
5107
|
+
return z(() => {
|
|
5284
5108
|
const a = () => {
|
|
5285
5109
|
i(e.isActive.apply(e, t));
|
|
5286
5110
|
};
|
|
@@ -5289,8 +5113,8 @@ function Ha(e, ...t) {
|
|
|
5289
5113
|
};
|
|
5290
5114
|
}, [e, t, i]), n;
|
|
5291
5115
|
}
|
|
5292
|
-
function
|
|
5293
|
-
const i =
|
|
5116
|
+
function ma({ editor: e, icon: t, tooltip: n }) {
|
|
5117
|
+
const i = ua(e, ga.name), a = F(() => {
|
|
5294
5118
|
if (i) {
|
|
5295
5119
|
e.chain().focus().removeTableOfContents().run();
|
|
5296
5120
|
return;
|
|
@@ -5307,10 +5131,10 @@ function Ma({ editor: e, icon: t, tooltip: n }) {
|
|
|
5307
5131
|
}
|
|
5308
5132
|
);
|
|
5309
5133
|
}
|
|
5310
|
-
function
|
|
5134
|
+
function _a(e) {
|
|
5311
5135
|
return e && e.type.name === "title";
|
|
5312
5136
|
}
|
|
5313
|
-
function
|
|
5137
|
+
function fa(e, t) {
|
|
5314
5138
|
const i = [e.getJSON()], a = [];
|
|
5315
5139
|
for (; i.length > 0; ) {
|
|
5316
5140
|
const o = i.shift();
|
|
@@ -5318,7 +5142,7 @@ function Ra(e, t) {
|
|
|
5318
5142
|
}
|
|
5319
5143
|
return a;
|
|
5320
5144
|
}
|
|
5321
|
-
const
|
|
5145
|
+
const ga = ge.create({
|
|
5322
5146
|
name: "tableOfContents",
|
|
5323
5147
|
group: "block",
|
|
5324
5148
|
atom: !0,
|
|
@@ -5332,7 +5156,7 @@ const Pa = we.create({
|
|
|
5332
5156
|
lastColumnResizable: !0,
|
|
5333
5157
|
allowTableNodeSelection: !1,
|
|
5334
5158
|
button: ({ editor: t, t: n }) => ({
|
|
5335
|
-
component:
|
|
5159
|
+
component: ma,
|
|
5336
5160
|
componentProps: {
|
|
5337
5161
|
disabled: !1,
|
|
5338
5162
|
icon: "BookMarked",
|
|
@@ -5350,21 +5174,21 @@ const Pa = we.create({
|
|
|
5350
5174
|
];
|
|
5351
5175
|
},
|
|
5352
5176
|
renderHTML({ HTMLAttributes: e }) {
|
|
5353
|
-
return ["toc",
|
|
5177
|
+
return ["toc", be(e)];
|
|
5354
5178
|
},
|
|
5355
5179
|
addNodeView() {
|
|
5356
|
-
return
|
|
5180
|
+
return Se(ha);
|
|
5357
5181
|
},
|
|
5358
5182
|
// @ts-expect-error
|
|
5359
5183
|
addCommands() {
|
|
5360
5184
|
return {
|
|
5361
5185
|
setTableOfContents: () => ({ commands: e, editor: t, view: n }) => {
|
|
5362
|
-
if (
|
|
5186
|
+
if (fa(t, this.name).length > 0) {
|
|
5363
5187
|
this.options.onHasOneBeforeInsert();
|
|
5364
5188
|
return;
|
|
5365
5189
|
}
|
|
5366
5190
|
const a = n.props.state.doc.content.firstChild;
|
|
5367
|
-
if (
|
|
5191
|
+
if (_a(a)) {
|
|
5368
5192
|
const o = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
|
|
5369
5193
|
return e.insertContentAt(o, { type: this.name });
|
|
5370
5194
|
}
|
|
@@ -5396,9 +5220,9 @@ const Pa = we.create({
|
|
|
5396
5220
|
];
|
|
5397
5221
|
}
|
|
5398
5222
|
});
|
|
5399
|
-
function
|
|
5223
|
+
function ba(e) {
|
|
5400
5224
|
var n;
|
|
5401
|
-
const t =
|
|
5225
|
+
const t = R(() => {
|
|
5402
5226
|
var o;
|
|
5403
5227
|
const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
|
|
5404
5228
|
return i && !i.default ? {
|
|
@@ -5410,9 +5234,9 @@ function Ia(e) {
|
|
|
5410
5234
|
isActive: () => !1
|
|
5411
5235
|
};
|
|
5412
5236
|
}, [e]);
|
|
5413
|
-
return /* @__PURE__ */
|
|
5237
|
+
return /* @__PURE__ */ u(le, { modal: !0, children: [
|
|
5414
5238
|
/* @__PURE__ */ r(
|
|
5415
|
-
|
|
5239
|
+
de,
|
|
5416
5240
|
{
|
|
5417
5241
|
asChild: !0,
|
|
5418
5242
|
disabled: e == null ? void 0 : e.disabled,
|
|
@@ -5424,7 +5248,7 @@ function Ia(e) {
|
|
|
5424
5248
|
icon: e == null ? void 0 : e.icon,
|
|
5425
5249
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
5426
5250
|
children: /* @__PURE__ */ r(
|
|
5427
|
-
|
|
5251
|
+
M,
|
|
5428
5252
|
{
|
|
5429
5253
|
className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
|
|
5430
5254
|
name: "MenuDown"
|
|
@@ -5435,28 +5259,28 @@ function Ia(e) {
|
|
|
5435
5259
|
}
|
|
5436
5260
|
),
|
|
5437
5261
|
/* @__PURE__ */ r(
|
|
5438
|
-
|
|
5262
|
+
he,
|
|
5439
5263
|
{
|
|
5440
5264
|
align: "start",
|
|
5441
5265
|
className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
|
|
5442
5266
|
side: "bottom",
|
|
5443
5267
|
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
|
|
5444
5268
|
var o, s;
|
|
5445
|
-
return /* @__PURE__ */
|
|
5446
|
-
/* @__PURE__ */ r(
|
|
5447
|
-
|
|
5269
|
+
return /* @__PURE__ */ u(pe, { children: [
|
|
5270
|
+
/* @__PURE__ */ r(we, { asChild: !0, children: /* @__PURE__ */ r(
|
|
5271
|
+
Be,
|
|
5448
5272
|
{
|
|
5449
5273
|
className: "richtext-size-7 richtext-p-1",
|
|
5450
5274
|
"data-state": t.title === i.title ? "on" : "off",
|
|
5451
5275
|
onClick: i == null ? void 0 : i.action,
|
|
5452
5276
|
pressed: t.title === i.title,
|
|
5453
5277
|
size: "sm",
|
|
5454
|
-
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(
|
|
5278
|
+
children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(M, { name: i.icon })
|
|
5455
5279
|
}
|
|
5456
5280
|
) }),
|
|
5457
|
-
/* @__PURE__ */
|
|
5281
|
+
/* @__PURE__ */ u(ye, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
|
|
5458
5282
|
/* @__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) =>
|
|
5283
|
+
!!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => je(c)).join(" ") })
|
|
5460
5284
|
] })
|
|
5461
5285
|
] }, `text-align-${a}`);
|
|
5462
5286
|
})
|
|
@@ -5464,7 +5288,7 @@ function Ia(e) {
|
|
|
5464
5288
|
)
|
|
5465
5289
|
] });
|
|
5466
5290
|
}
|
|
5467
|
-
const
|
|
5291
|
+
const yo = A.create({
|
|
5468
5292
|
name: "text-direction",
|
|
5469
5293
|
addOptions() {
|
|
5470
5294
|
var e;
|
|
@@ -5488,17 +5312,17 @@ const $o = N.create({
|
|
|
5488
5312
|
icon: o[d],
|
|
5489
5313
|
isActive: () => !1,
|
|
5490
5314
|
action: () => {
|
|
5491
|
-
var l,
|
|
5315
|
+
var l, m, _, f;
|
|
5492
5316
|
if (d === "auto") {
|
|
5493
|
-
(
|
|
5317
|
+
(m = (l = t.commands) == null ? void 0 : l.unsetTextDirection) == null || m.call(l);
|
|
5494
5318
|
return;
|
|
5495
5319
|
}
|
|
5496
|
-
(
|
|
5320
|
+
(f = (_ = t.commands) == null ? void 0 : _.setTextDirection) == null || f.call(_, d);
|
|
5497
5321
|
},
|
|
5498
5322
|
disabled: !1
|
|
5499
5323
|
})), c = s.filter((d) => d.disabled).length === s.length;
|
|
5500
5324
|
return {
|
|
5501
|
-
component:
|
|
5325
|
+
component: ba,
|
|
5502
5326
|
componentProps: {
|
|
5503
5327
|
icon: "TextDirection",
|
|
5504
5328
|
tooltip: i("editor.textDirection.tooltip"),
|
|
@@ -5530,12 +5354,12 @@ const $o = N.create({
|
|
|
5530
5354
|
unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
|
|
5531
5355
|
};
|
|
5532
5356
|
}
|
|
5533
|
-
}),
|
|
5534
|
-
listUsers:
|
|
5535
|
-
itemUser:
|
|
5536
|
-
selectedUser:
|
|
5537
|
-
},
|
|
5538
|
-
const n = G(null), [i, a] =
|
|
5357
|
+
}), xa = "_listUsers_en3pm_1", pa = "_itemUser_en3pm_10", wa = "_selectedUser_en3pm_31", fe = {
|
|
5358
|
+
listUsers: xa,
|
|
5359
|
+
itemUser: pa,
|
|
5360
|
+
selectedUser: wa
|
|
5361
|
+
}, ya = He((e, t) => {
|
|
5362
|
+
const n = G(null), [i, a] = C(0), o = (d) => {
|
|
5539
5363
|
const l = e.items[d];
|
|
5540
5364
|
l && e.command({ id: l, label: l });
|
|
5541
5365
|
}, s = () => {
|
|
@@ -5545,23 +5369,23 @@ const $o = N.create({
|
|
|
5545
5369
|
}, h = () => {
|
|
5546
5370
|
o(i);
|
|
5547
5371
|
};
|
|
5548
|
-
return
|
|
5372
|
+
return z(() => a(0), [e.items]), z(() => {
|
|
5549
5373
|
if (Number.isNaN(i + 1))
|
|
5550
5374
|
return;
|
|
5551
5375
|
const d = n.current.querySelector(`span:nth-of-type(${i + 1})`);
|
|
5552
|
-
d &&
|
|
5553
|
-
}, [i]),
|
|
5376
|
+
d && Oe(d, { behavior: "smooth", scrollMode: "if-needed" });
|
|
5377
|
+
}, [i]), ze(t, () => ({
|
|
5554
5378
|
onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (s(), !0) : d.key === "ArrowDown" ? (c(), !0) : d.key === "Enter" ? (h(), !0) : !1
|
|
5555
|
-
})), /* @__PURE__ */ r("div", { className:
|
|
5379
|
+
})), /* @__PURE__ */ r("div", { className: P("listUsers", fe.listUsers), children: /* @__PURE__ */ r("div", { ref: n, children: e.items.length > 0 ? e.items.map((d, l) => /* @__PURE__ */ r(
|
|
5556
5380
|
"span",
|
|
5557
5381
|
{
|
|
5558
|
-
className:
|
|
5382
|
+
className: P("itemUser", fe.itemUser, l === i ? fe.selectedUser : ""),
|
|
5559
5383
|
onClick: () => o(l),
|
|
5560
5384
|
children: d
|
|
5561
5385
|
},
|
|
5562
5386
|
l
|
|
5563
|
-
)) : /* @__PURE__ */ r("div", { className:
|
|
5564
|
-
}),
|
|
5387
|
+
)) : /* @__PURE__ */ r("div", { className: P("itemUserEmpty", fe.itemUser), children: "Empty" }) }) });
|
|
5388
|
+
}), ka = [
|
|
5565
5389
|
{
|
|
5566
5390
|
id: "1",
|
|
5567
5391
|
name: "John Doe"
|
|
@@ -5578,16 +5402,16 @@ const $o = N.create({
|
|
|
5578
5402
|
id: "4",
|
|
5579
5403
|
name: "Bob"
|
|
5580
5404
|
}
|
|
5581
|
-
],
|
|
5582
|
-
items: async ({ query: e }) =>
|
|
5405
|
+
], va = {
|
|
5406
|
+
items: async ({ query: e }) => ka.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
|
|
5583
5407
|
render: () => {
|
|
5584
5408
|
let e, t;
|
|
5585
5409
|
return {
|
|
5586
5410
|
onStart: (n) => {
|
|
5587
|
-
e = new
|
|
5411
|
+
e = new Te(ya, {
|
|
5588
5412
|
props: n,
|
|
5589
5413
|
editor: n.editor
|
|
5590
|
-
}), t =
|
|
5414
|
+
}), t = De("body", {
|
|
5591
5415
|
getReferenceClientRect: n.clientRect,
|
|
5592
5416
|
appendTo: () => document.body,
|
|
5593
5417
|
content: e.element,
|
|
@@ -5611,16 +5435,16 @@ const $o = N.create({
|
|
|
5611
5435
|
}
|
|
5612
5436
|
};
|
|
5613
5437
|
}
|
|
5614
|
-
},
|
|
5438
|
+
}, ko = Wt.extend({
|
|
5615
5439
|
addAttributes() {
|
|
5616
5440
|
return {
|
|
5617
5441
|
id: {
|
|
5618
5442
|
default: "",
|
|
5619
|
-
parseHTML:
|
|
5443
|
+
parseHTML: B("id")
|
|
5620
5444
|
},
|
|
5621
5445
|
label: {
|
|
5622
5446
|
default: "",
|
|
5623
|
-
parseHTML:
|
|
5447
|
+
parseHTML: B("label")
|
|
5624
5448
|
}
|
|
5625
5449
|
};
|
|
5626
5450
|
}
|
|
@@ -5628,8 +5452,8 @@ const $o = N.create({
|
|
|
5628
5452
|
HTMLAttributes: {
|
|
5629
5453
|
class: "mention"
|
|
5630
5454
|
},
|
|
5631
|
-
suggestion:
|
|
5632
|
-
}),
|
|
5455
|
+
suggestion: va
|
|
5456
|
+
}), Ca = {
|
|
5633
5457
|
audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
|
|
5634
5458
|
video: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',
|
|
5635
5459
|
file: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',
|
|
@@ -5657,8 +5481,8 @@ const $o = N.create({
|
|
|
5657
5481
|
excel: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',
|
|
5658
5482
|
ppt: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'
|
|
5659
5483
|
};
|
|
5660
|
-
function
|
|
5661
|
-
const t =
|
|
5484
|
+
function Na(e) {
|
|
5485
|
+
const t = Ca[e], a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
|
|
5662
5486
|
"svg",
|
|
5663
5487
|
{
|
|
5664
5488
|
...Array.from(a.attributes).reduce((s, c) => (s[c.name] = c.value, s), {})
|
|
@@ -5674,59 +5498,59 @@ function qa(e) {
|
|
|
5674
5498
|
}
|
|
5675
5499
|
}), o;
|
|
5676
5500
|
}
|
|
5677
|
-
const
|
|
5678
|
-
audio: /* @__PURE__ */ r(
|
|
5679
|
-
video: /* @__PURE__ */ r(
|
|
5680
|
-
file: /* @__PURE__ */ r(
|
|
5681
|
-
image: /* @__PURE__ */ r(
|
|
5682
|
-
pdf: /* @__PURE__ */ r(
|
|
5683
|
-
word: /* @__PURE__ */ r(
|
|
5684
|
-
excel: /* @__PURE__ */ r(
|
|
5685
|
-
ppt: /* @__PURE__ */ r(
|
|
5501
|
+
const Aa = {
|
|
5502
|
+
audio: /* @__PURE__ */ r(hn, {}),
|
|
5503
|
+
video: /* @__PURE__ */ r(dn, {}),
|
|
5504
|
+
file: /* @__PURE__ */ r(ln, {}),
|
|
5505
|
+
image: /* @__PURE__ */ r(cn, {}),
|
|
5506
|
+
pdf: /* @__PURE__ */ r(Tn, {}),
|
|
5507
|
+
word: /* @__PURE__ */ r(Sn, {}),
|
|
5508
|
+
excel: /* @__PURE__ */ r(sn, {}),
|
|
5509
|
+
ppt: /* @__PURE__ */ r(rn, {})
|
|
5686
5510
|
};
|
|
5687
|
-
function
|
|
5688
|
-
const n =
|
|
5689
|
-
return t ?
|
|
5511
|
+
function mt(e, t = !1) {
|
|
5512
|
+
const n = Ln(e), i = Aa[n] || /* @__PURE__ */ r(xe, {});
|
|
5513
|
+
return t ? Na(n) : i;
|
|
5690
5514
|
}
|
|
5691
|
-
const
|
|
5692
|
-
wrap:
|
|
5515
|
+
const La = "_wrap_1x1ms_2", Ne = {
|
|
5516
|
+
wrap: La
|
|
5693
5517
|
};
|
|
5694
|
-
function
|
|
5518
|
+
function Sa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension: a }) {
|
|
5695
5519
|
var H;
|
|
5696
|
-
const o = G(null), s =
|
|
5697
|
-
!s ||
|
|
5698
|
-
}, [s,
|
|
5699
|
-
async (
|
|
5700
|
-
const O =
|
|
5520
|
+
const o = G(null), s = Ie(), { hasTrigger: c, fileName: h, fileSize: d, fileExt: l, fileType: m, url: _, error: f } = t.attrs, [p, w] = C(!1), { t: L } = j(), E = (H = a == null ? void 0 : a.options) == null ? void 0 : H.upload, g = F(() => {
|
|
5521
|
+
!s || _ || s && o.current.click();
|
|
5522
|
+
}, [s, _]), b = F(
|
|
5523
|
+
async (S) => {
|
|
5524
|
+
const O = S.target.files && S.target.files[0];
|
|
5701
5525
|
if (!O)
|
|
5702
5526
|
return;
|
|
5703
|
-
const
|
|
5704
|
-
fileName:
|
|
5527
|
+
const _t = {
|
|
5528
|
+
fileName: Hn(O.name),
|
|
5705
5529
|
fileSize: O.size,
|
|
5706
5530
|
fileType: O.type,
|
|
5707
|
-
fileExt:
|
|
5531
|
+
fileExt: En(O.name)
|
|
5708
5532
|
};
|
|
5709
|
-
|
|
5533
|
+
w(!0);
|
|
5710
5534
|
try {
|
|
5711
5535
|
const ue = await E(O);
|
|
5712
|
-
n({ ...
|
|
5536
|
+
n({ ..._t, url: ue }), w(!1);
|
|
5713
5537
|
} catch (ue) {
|
|
5714
|
-
n({ error: `File upload fail: ${ue && ue.message}` || "Unknown error" }),
|
|
5538
|
+
n({ error: `File upload fail: ${ue && ue.message}` || "Unknown error" }), w(!1), o.current.value = "";
|
|
5715
5539
|
}
|
|
5716
5540
|
},
|
|
5717
|
-
[
|
|
5541
|
+
[w, n]
|
|
5718
5542
|
);
|
|
5719
|
-
|
|
5720
|
-
!
|
|
5721
|
-
}, [
|
|
5543
|
+
z(() => {
|
|
5544
|
+
!_ && !c && (g(), n({ hasTrigger: !0 }));
|
|
5545
|
+
}, [_, c, g, n]);
|
|
5722
5546
|
const k = F(() => i(), [e]);
|
|
5723
|
-
return s && !
|
|
5547
|
+
return s && !_ ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ u("div", { className: P(Ne.wrap, "render-wrapper"), children: [
|
|
5724
5548
|
/* @__PURE__ */ r(
|
|
5725
5549
|
"p",
|
|
5726
5550
|
{
|
|
5727
5551
|
onClick: g,
|
|
5728
5552
|
style: { cursor: "pointer" },
|
|
5729
|
-
children:
|
|
5553
|
+
children: p ? /* @__PURE__ */ r("span", { children: L("editor.attachment.uploading") }) : /* @__PURE__ */ r("span", { children: L("editor.attachment.please_upload") })
|
|
5730
5554
|
}
|
|
5731
5555
|
),
|
|
5732
5556
|
/* @__PURE__ */ r(
|
|
@@ -5738,22 +5562,22 @@ function Wa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
|
|
|
5738
5562
|
type: "file"
|
|
5739
5563
|
}
|
|
5740
5564
|
)
|
|
5741
|
-
] }) }) :
|
|
5565
|
+
] }) }) : _ ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ u(
|
|
5742
5566
|
"div",
|
|
5743
5567
|
{
|
|
5744
|
-
className:
|
|
5568
|
+
className: P(Ne.wrap, "render-wrapper"),
|
|
5745
5569
|
onClick: g,
|
|
5746
5570
|
children: [
|
|
5747
|
-
/* @__PURE__ */
|
|
5748
|
-
/* @__PURE__ */ r("span", { children:
|
|
5749
|
-
/* @__PURE__ */
|
|
5571
|
+
/* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
5572
|
+
/* @__PURE__ */ r("span", { children: mt(m) }),
|
|
5573
|
+
/* @__PURE__ */ u("span", { children: [
|
|
5750
5574
|
h,
|
|
5751
5575
|
".",
|
|
5752
5576
|
l
|
|
5753
5577
|
] }),
|
|
5754
|
-
/* @__PURE__ */
|
|
5578
|
+
/* @__PURE__ */ u("span", { children: [
|
|
5755
5579
|
"(",
|
|
5756
|
-
|
|
5580
|
+
tt(d),
|
|
5757
5581
|
")"
|
|
5758
5582
|
] })
|
|
5759
5583
|
] }),
|
|
@@ -5762,21 +5586,21 @@ function Wa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
|
|
|
5762
5586
|
{
|
|
5763
5587
|
action: k,
|
|
5764
5588
|
icon: "Trash2",
|
|
5765
|
-
tooltip:
|
|
5589
|
+
tooltip: L("editor.delete")
|
|
5766
5590
|
}
|
|
5767
5591
|
)
|
|
5768
5592
|
]
|
|
5769
5593
|
}
|
|
5770
|
-
) }) :
|
|
5594
|
+
) }) : f !== "null" ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(
|
|
5771
5595
|
"div",
|
|
5772
5596
|
{
|
|
5773
|
-
className:
|
|
5597
|
+
className: P(Ne.wrap, "render-wrapper"),
|
|
5774
5598
|
onClick: g,
|
|
5775
|
-
children: /* @__PURE__ */ r("p", { children:
|
|
5599
|
+
children: /* @__PURE__ */ r("p", { children: f })
|
|
5776
5600
|
}
|
|
5777
|
-
) }) : /* @__PURE__ */ r(
|
|
5601
|
+
) }) : /* @__PURE__ */ r(xe, {});
|
|
5778
5602
|
}
|
|
5779
|
-
const
|
|
5603
|
+
const vo = ge.create({
|
|
5780
5604
|
name: "attachment",
|
|
5781
5605
|
content: "",
|
|
5782
5606
|
marks: "",
|
|
@@ -5816,7 +5640,7 @@ const Uo = we.create({
|
|
|
5816
5640
|
} = e || {};
|
|
5817
5641
|
return [
|
|
5818
5642
|
"div",
|
|
5819
|
-
|
|
5643
|
+
be(
|
|
5820
5644
|
// @ts-expect-error
|
|
5821
5645
|
this.options.HTMLAttributes || {},
|
|
5822
5646
|
e || {}
|
|
@@ -5827,12 +5651,12 @@ const Uo = we.create({
|
|
|
5827
5651
|
[
|
|
5828
5652
|
"span",
|
|
5829
5653
|
{ class: "attachment__icon" },
|
|
5830
|
-
|
|
5654
|
+
mt(a, !0)
|
|
5831
5655
|
],
|
|
5832
5656
|
[
|
|
5833
5657
|
"span",
|
|
5834
5658
|
{ class: "attachment__text" },
|
|
5835
|
-
`${n}.${o} (${
|
|
5659
|
+
`${n}.${o} (${tt(i)})`
|
|
5836
5660
|
]
|
|
5837
5661
|
] : ["div", { class: "attachment__placeholder" }]
|
|
5838
5662
|
];
|
|
@@ -5841,31 +5665,31 @@ const Uo = we.create({
|
|
|
5841
5665
|
return {
|
|
5842
5666
|
fileName: {
|
|
5843
5667
|
default: null,
|
|
5844
|
-
parseHTML:
|
|
5668
|
+
parseHTML: B("filename")
|
|
5845
5669
|
},
|
|
5846
5670
|
fileSize: {
|
|
5847
5671
|
default: null,
|
|
5848
|
-
parseHTML:
|
|
5672
|
+
parseHTML: B("filesize")
|
|
5849
5673
|
},
|
|
5850
5674
|
fileType: {
|
|
5851
5675
|
default: null,
|
|
5852
|
-
parseHTML:
|
|
5676
|
+
parseHTML: B("filetype")
|
|
5853
5677
|
},
|
|
5854
5678
|
fileExt: {
|
|
5855
5679
|
default: null,
|
|
5856
|
-
parseHTML:
|
|
5680
|
+
parseHTML: B("fileext")
|
|
5857
5681
|
},
|
|
5858
5682
|
url: {
|
|
5859
5683
|
default: null,
|
|
5860
|
-
parseHTML:
|
|
5684
|
+
parseHTML: B("url")
|
|
5861
5685
|
},
|
|
5862
5686
|
hasTrigger: {
|
|
5863
5687
|
default: !1,
|
|
5864
|
-
parseHTML: (e) =>
|
|
5688
|
+
parseHTML: (e) => B("hastrigger")(e) === "true"
|
|
5865
5689
|
},
|
|
5866
5690
|
error: {
|
|
5867
5691
|
default: null,
|
|
5868
|
-
parseHTML:
|
|
5692
|
+
parseHTML: B("error")
|
|
5869
5693
|
}
|
|
5870
5694
|
};
|
|
5871
5695
|
},
|
|
@@ -5875,57 +5699,57 @@ const Uo = we.create({
|
|
|
5875
5699
|
};
|
|
5876
5700
|
},
|
|
5877
5701
|
addNodeView() {
|
|
5878
|
-
return
|
|
5702
|
+
return Se(Sa);
|
|
5879
5703
|
}
|
|
5880
5704
|
});
|
|
5881
5705
|
export {
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5706
|
+
vo as Attachment,
|
|
5707
|
+
lo as BaseKit,
|
|
5708
|
+
ao as Blockquote,
|
|
5709
|
+
Ua as Bold,
|
|
5710
|
+
eo as BulletList,
|
|
5711
|
+
to as Clear,
|
|
5712
|
+
Wa as Code,
|
|
5713
|
+
si as CodeBlock,
|
|
5714
|
+
Qa as Color,
|
|
5715
|
+
xn as Column,
|
|
5716
|
+
co as ColumnActionButton,
|
|
5717
|
+
Ao as Drawer,
|
|
5718
|
+
bo as Emoji,
|
|
5719
|
+
Lo as Excalidraw,
|
|
5720
|
+
xo as ExportPdf,
|
|
5721
|
+
wo as ExportWord,
|
|
5722
|
+
Ga as FontFamily,
|
|
5723
|
+
Ya as FontSize,
|
|
5724
|
+
go as FormatPainter,
|
|
5725
|
+
Za as Heading,
|
|
5726
|
+
Xa as Highlight,
|
|
5727
|
+
so as History,
|
|
5728
|
+
ro as HorizontalRule,
|
|
5729
|
+
So as Iframe,
|
|
5730
|
+
yn as Image,
|
|
5731
|
+
To as ImageGif,
|
|
5732
|
+
po as ImportWord,
|
|
5733
|
+
mo as Indent,
|
|
5734
|
+
qa as Italic,
|
|
5735
|
+
Eo as Katex,
|
|
5736
|
+
_o as LineHeight,
|
|
5737
|
+
oo as Link,
|
|
5738
|
+
ko as Mention,
|
|
5739
|
+
Ho as Mermaid,
|
|
5740
|
+
uo as MoreMark,
|
|
5741
|
+
pn as MultiColumn,
|
|
5742
|
+
no as OrderedList,
|
|
5743
|
+
ji as SearchAndReplace,
|
|
5744
|
+
fo as SlashCommand,
|
|
5745
|
+
Va as Strike,
|
|
5746
|
+
ho as SubAndSuperScript,
|
|
5747
|
+
zo as Table,
|
|
5748
|
+
ga as TableOfContents,
|
|
5749
|
+
io as TaskList,
|
|
5750
|
+
Ja as TextAlign,
|
|
5751
|
+
yo as TextDirection,
|
|
5752
|
+
Mo as Twitter,
|
|
5753
|
+
Ka as Underline,
|
|
5754
|
+
vn as Video
|
|
5931
5755
|
};
|