reactjs-tiptap-editor 0.2.2 → 0.2.4
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-B4ASZID5.cjs +138 -0
- package/lib/{RichTextEditor-S3oDQ7DG.js → RichTextEditor-yL5SRS_H.js} +675 -684
- package/lib/extension-bundle.cjs +2 -2
- package/lib/extension-bundle.d.cts +42 -42
- package/lib/extension-bundle.d.ts +42 -42
- package/lib/extension-bundle.js +578 -601
- package/lib/{index-BEUeIQfa.js → index-BUxFK1y_.js} +1 -1
- package/lib/{index-CvbViqY1.cjs → index-DGpT32KX.cjs} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +42 -42
- package/lib/index.d.ts +42 -42
- package/lib/index.js +2 -2
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +42 -42
- package/lib/locale-bundle.d.ts +42 -42
- package/lib/locale-bundle.js +1 -1
- package/lib/{tiptap-CYz8BQhm.cjs → tiptap-BhYF9Ndj.cjs} +1 -1
- package/lib/{tiptap-B9VypLMv.js → tiptap-DXj1s_xP.js} +1 -1
- package/lib/vendor-DIvoV5tx.js +41663 -0
- package/lib/vendor-Dp07eU0H.cjs +266 -0
- package/package.json +1 -5
- package/lib/RichTextEditor-BNLeCZNj.cjs +0 -138
- package/lib/vendor-BeclCw8p.js +0 -60431
- package/lib/vendor-CwNzD6m_.cjs +0 -457
package/lib/extension-bundle.js
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var G = (e, t, n) =>
|
|
4
|
-
import { g as
|
|
5
|
-
import { P as Q, b as ee, $ as me, a0 as ge, aq as U, at as
|
|
1
|
+
var on = Object.defineProperty;
|
|
2
|
+
var rn = (e, t, n) => t in e ? on(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var G = (e, t, n) => rn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { g as sn, h as cn, U as ln, S as dn, C as un, j as Ne, a as he, k as hn, l as mn, R as $e, F as fn, H as gn, T as _n, o as z, p as bn, q as xn, r as pn, N as Le, O as wn, s as yn, t as vn, v as kn, L as Cn, w as Tn, m as Se, x as An, y as Nn, z as Ln, P as Sn, A as Mn, G as In, J as zn, K as Hn, M as En, Q as Rn, V as On, W as Pn, X as Dn, Y as Ht, Z as Et, _ as Rt, $ as et, I as Bn, a0 as $n, a1 as Fn, a2 as jn, a3 as Un, a4 as Vn } from "./tiptap-DXj1s_xP.js";
|
|
5
|
+
import { P as Q, b as ee, $ as me, a0 as ge, aq as U, at as qn, T as Ot, A as Kn, ar as Pt, ao as Dt, aw as pt, ax as wt, ay as Wn, a4 as Gn, au as Xn, aD as Yn } from "./vendor-DIvoV5tx.js";
|
|
6
6
|
import { jsxs as m, jsx as o, Fragment as _e } from "react/jsx-runtime";
|
|
7
7
|
import * as V from "react";
|
|
8
|
-
import
|
|
9
|
-
import { ChevronDown as at, Check as
|
|
10
|
-
import { i as ot, T as Fe, a as je, B as
|
|
11
|
-
import { a1 as
|
|
12
|
-
import { M as
|
|
8
|
+
import Pe, { useMemo as E, useState as v, useRef as Y, useCallback as P, Fragment as tt, forwardRef as nt, useImperativeHandle as it, useEffect as R } from "react";
|
|
9
|
+
import { ChevronDown as at, Check as Bt, ChevronUp as Zn, Copy as Jn, CopyCheck as Qn, Clock3 as ei, Laugh as ti, LucideTableProperties as ni, LucideSheet as ii, LucideImage as ai, LucideFile as oi, LucideVideo as ri, LucideAudioLines as si } from "lucide-react";
|
|
10
|
+
import { i as ot, T as Fe, a as je, B as D, b as Ue, g as rt, A as y, D as oe, c as re, d as se, e as ci, f as B, u as st, h as li, I as O, j as we, k as $t, l as Ye, m as di, n as ct, P as ye, o as ve, p as ke, q as lt, C as ui, H as hi, L as mi, r as fi, M as gi, s as _i, t as yt, v as Me, w as dt, x as ut, y as ht, z as mt, E as bi, F as xi, G as pi, J as De, K as Be, N as wi, S as yi, O as vi, Q as ki, U as Z, V as Ci, W as Ti, X as Ai, Y as Ni, Z as Li, _ as Ft } from "./RichTextEditor-yL5SRS_H.js";
|
|
11
|
+
import { a1 as ls, $ as ds, a2 as us, a0 as hs, a3 as ms, a4 as fs } from "./RichTextEditor-yL5SRS_H.js";
|
|
12
|
+
import { M as Si, D as jt, u as $, j as Mi, k as Ii, n as vt, h as H, o as Ut, p as zi, I as kt, g as Hi, f as Ct, V as Ei, T as Ie, q as ze, r as He } from "./index-BUxFK1y_.js";
|
|
13
13
|
import * as ce from "@radix-ui/react-tabs";
|
|
14
|
-
import { bundledThemes as
|
|
14
|
+
import { bundledThemes as Vt, bundledLanguages as qt, createHighlighter as Ri } from "shiki";
|
|
15
15
|
import * as M from "@radix-ui/react-select";
|
|
16
|
-
import { Slot as
|
|
16
|
+
import { Slot as Oi } from "@radix-ui/react-slot";
|
|
17
17
|
import ft from "tippy.js";
|
|
18
|
-
import
|
|
18
|
+
import Pi from "react-image-crop";
|
|
19
19
|
import * as Ze from "@radix-ui/react-checkbox";
|
|
20
|
-
import { flushSync as Tt } from "react-dom";
|
|
21
20
|
import gt from "scroll-into-view-if-needed";
|
|
22
|
-
import { Packer as
|
|
23
|
-
import { DocxSerializer as
|
|
24
|
-
const _t =
|
|
21
|
+
import { Packer as Di } from "docx";
|
|
22
|
+
import { DocxSerializer as Bi, defaultNodes as ie, defaultMarks as $i } from "prosemirror-docx";
|
|
23
|
+
const _t = Pe.forwardRef(
|
|
25
24
|
({ asChild: e, ...t }, n) => {
|
|
26
25
|
var r;
|
|
27
26
|
const i = ot[t.icon];
|
|
28
27
|
return /* @__PURE__ */ m(Fe, { children: [
|
|
29
28
|
/* @__PURE__ */ o(je, { asChild: !0, children: /* @__PURE__ */ o(
|
|
30
|
-
e ?
|
|
29
|
+
e ? Oi : D,
|
|
31
30
|
{
|
|
32
31
|
className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
|
|
33
32
|
disabled: t == null ? void 0 : t.disabled,
|
|
@@ -46,7 +45,7 @@ const _t = De.forwardRef(
|
|
|
46
45
|
] }) })
|
|
47
46
|
] });
|
|
48
47
|
}
|
|
49
|
-
),
|
|
48
|
+
), Ar = sn.extend({
|
|
50
49
|
addOptions() {
|
|
51
50
|
var e;
|
|
52
51
|
return {
|
|
@@ -64,7 +63,7 @@ const _t = De.forwardRef(
|
|
|
64
63
|
})
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
|
-
}),
|
|
66
|
+
}), Nr = cn.extend({
|
|
68
67
|
addOptions() {
|
|
69
68
|
var e;
|
|
70
69
|
return {
|
|
@@ -84,7 +83,7 @@ const _t = De.forwardRef(
|
|
|
84
83
|
}
|
|
85
84
|
};
|
|
86
85
|
}
|
|
87
|
-
}),
|
|
86
|
+
}), Lr = ln.extend({
|
|
88
87
|
addOptions() {
|
|
89
88
|
var e;
|
|
90
89
|
return {
|
|
@@ -104,7 +103,7 @@ const _t = De.forwardRef(
|
|
|
104
103
|
}
|
|
105
104
|
};
|
|
106
105
|
}
|
|
107
|
-
}),
|
|
106
|
+
}), Sr = dn.extend({
|
|
108
107
|
addOptions() {
|
|
109
108
|
var e;
|
|
110
109
|
return {
|
|
@@ -122,7 +121,7 @@ const _t = De.forwardRef(
|
|
|
122
121
|
})
|
|
123
122
|
};
|
|
124
123
|
}
|
|
125
|
-
}),
|
|
124
|
+
}), Mr = un.extend({
|
|
126
125
|
addOptions() {
|
|
127
126
|
var e;
|
|
128
127
|
return {
|
|
@@ -143,30 +142,30 @@ const _t = De.forwardRef(
|
|
|
143
142
|
});
|
|
144
143
|
let X, Ce;
|
|
145
144
|
const Ke = /* @__PURE__ */ new Set(), We = /* @__PURE__ */ new Set();
|
|
146
|
-
function
|
|
145
|
+
function Fi() {
|
|
147
146
|
return X;
|
|
148
147
|
}
|
|
149
|
-
function
|
|
148
|
+
function ji(e) {
|
|
150
149
|
if (!X && !Ce) {
|
|
151
150
|
const t = e.themes.filter(
|
|
152
|
-
(i) => !!i && i in
|
|
151
|
+
(i) => !!i && i in Vt
|
|
153
152
|
), n = e.languages.filter(
|
|
154
|
-
(i) => !!i && i in
|
|
153
|
+
(i) => !!i && i in qt
|
|
155
154
|
);
|
|
156
|
-
return Ce =
|
|
155
|
+
return Ce = Ri({ themes: t, langs: n }).then((i) => {
|
|
157
156
|
X = i;
|
|
158
157
|
}), Ce;
|
|
159
158
|
}
|
|
160
159
|
if (Ce)
|
|
161
160
|
return Ce;
|
|
162
161
|
}
|
|
163
|
-
async function
|
|
164
|
-
return X && !X.getLoadedThemes().includes(e) && !We.has(e) && e in
|
|
162
|
+
async function Kt(e) {
|
|
163
|
+
return X && !X.getLoadedThemes().includes(e) && !We.has(e) && e in Vt ? (We.add(e), await X.loadTheme(e), We.delete(e), !0) : !1;
|
|
165
164
|
}
|
|
166
|
-
async function
|
|
167
|
-
return X && !X.getLoadedLanguages().includes(e) && !Ke.has(e) && e in
|
|
165
|
+
async function Wt(e) {
|
|
166
|
+
return X && !X.getLoadedLanguages().includes(e) && !Ke.has(e) && e in qt ? (Ke.add(e), await X.loadLanguage(e), Ke.delete(e), !0) : !1;
|
|
168
167
|
}
|
|
169
|
-
async function
|
|
168
|
+
async function Ui({
|
|
170
169
|
doc: e,
|
|
171
170
|
name: t,
|
|
172
171
|
defaultTheme: n,
|
|
@@ -180,11 +179,11 @@ async function qi({
|
|
|
180
179
|
i
|
|
181
180
|
];
|
|
182
181
|
X ? await Promise.all([
|
|
183
|
-
...r.flatMap((c) =>
|
|
184
|
-
...s.flatMap((c) => !!c &&
|
|
185
|
-
]) : await
|
|
182
|
+
...r.flatMap((c) => Kt(c)),
|
|
183
|
+
...s.flatMap((c) => !!c && Wt(c))
|
|
184
|
+
]) : await ji({ languages: s, themes: r });
|
|
186
185
|
}
|
|
187
|
-
function
|
|
186
|
+
function Tt({
|
|
188
187
|
doc: e,
|
|
189
188
|
name: t,
|
|
190
189
|
defaultTheme: n,
|
|
@@ -193,7 +192,7 @@ function At({
|
|
|
193
192
|
const a = [];
|
|
194
193
|
return Ne(e, (s) => s.type.name === t).forEach((s) => {
|
|
195
194
|
let c = s.pos + 1, l = s.node.attrs.language || i;
|
|
196
|
-
const u = s.node.attrs.theme || n, d =
|
|
195
|
+
const u = s.node.attrs.theme || n, d = Fi();
|
|
197
196
|
if (!d)
|
|
198
197
|
return;
|
|
199
198
|
d.getLoadedLanguages().includes(l) || (l = "plaintext");
|
|
@@ -203,16 +202,16 @@ function At({
|
|
|
203
202
|
});
|
|
204
203
|
for (const f of h) {
|
|
205
204
|
for (const b of f) {
|
|
206
|
-
const
|
|
205
|
+
const x = c + b.content.length, N = ge.inline(c, x, {
|
|
207
206
|
style: `color: ${b.color}`
|
|
208
207
|
});
|
|
209
|
-
a.push(N), c =
|
|
208
|
+
a.push(N), c = x;
|
|
210
209
|
}
|
|
211
210
|
c += 1;
|
|
212
211
|
}
|
|
213
212
|
}), me.create(e, a);
|
|
214
213
|
}
|
|
215
|
-
function
|
|
214
|
+
function Vi({
|
|
216
215
|
name: e,
|
|
217
216
|
defaultLanguage: t,
|
|
218
217
|
defaultTheme: n
|
|
@@ -232,7 +231,7 @@ function Ki({
|
|
|
232
231
|
// Initialize shiki async, and then highlight initial document
|
|
233
232
|
async initDecorations() {
|
|
234
233
|
const c = a.state.doc;
|
|
235
|
-
await
|
|
234
|
+
await Ui({ doc: c, name: e, defaultLanguage: t, defaultTheme: n });
|
|
236
235
|
const l = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
|
|
237
236
|
a.dispatch(l);
|
|
238
237
|
}
|
|
@@ -245,8 +244,8 @@ function Ki({
|
|
|
245
244
|
);
|
|
246
245
|
if ((await Promise.all(
|
|
247
246
|
c.flatMap((d) => [
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
Kt(d.node.attrs.theme),
|
|
248
|
+
Wt(d.node.attrs.language)
|
|
250
249
|
])
|
|
251
250
|
)).includes(!0)) {
|
|
252
251
|
const d = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
|
|
@@ -257,7 +256,7 @@ function Ki({
|
|
|
257
256
|
return new r();
|
|
258
257
|
},
|
|
259
258
|
state: {
|
|
260
|
-
init: (a, { doc: r }) =>
|
|
259
|
+
init: (a, { doc: r }) => Tt({
|
|
261
260
|
doc: r,
|
|
262
261
|
name: e,
|
|
263
262
|
defaultLanguage: t,
|
|
@@ -271,7 +270,7 @@ function Ki({
|
|
|
271
270
|
c.doc,
|
|
272
271
|
(f) => f.type.name === e
|
|
273
272
|
), h = a.docChanged && ([l, u].includes(e) || g.length !== d.length || a.steps.some((f) => f.from !== void 0 && f.to !== void 0 && d.some((b) => b.pos >= f.from && b.pos + b.node.nodeSize <= f.to)));
|
|
274
|
-
return a.getMeta("shikiPluginForceDecoration") || h ?
|
|
273
|
+
return a.getMeta("shikiPluginForceDecoration") || h ? Tt({
|
|
275
274
|
doc: a.doc,
|
|
276
275
|
name: e,
|
|
277
276
|
defaultLanguage: t,
|
|
@@ -288,11 +287,11 @@ function Ki({
|
|
|
288
287
|
});
|
|
289
288
|
return i;
|
|
290
289
|
}
|
|
291
|
-
function
|
|
290
|
+
function qi({ action: e, languages: t, ...n }) {
|
|
292
291
|
const i = (r) => {
|
|
293
292
|
e(r);
|
|
294
293
|
}, a = E(() => t == null ? void 0 : t.map((r) => ({
|
|
295
|
-
title:
|
|
294
|
+
title: Si[r] || r,
|
|
296
295
|
// icon: language.icon,
|
|
297
296
|
language: r
|
|
298
297
|
})), [t]);
|
|
@@ -305,10 +304,10 @@ function Wi({ action: e, languages: t, ...n }) {
|
|
|
305
304
|
icon: n == null ? void 0 : n.icon
|
|
306
305
|
}
|
|
307
306
|
) }),
|
|
308
|
-
/* @__PURE__ */ o(se, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((r) => /* @__PURE__ */ o(
|
|
307
|
+
/* @__PURE__ */ o(se, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((r) => /* @__PURE__ */ o(ci, { onClick: () => i(r.language), children: /* @__PURE__ */ o("div", { className: "richtext-h-full richtext-ml-1", children: r.title }) }, `codeblock-${r.title}`)) })
|
|
309
308
|
] });
|
|
310
309
|
}
|
|
311
|
-
const
|
|
310
|
+
const Ki = M.Root, Wi = M.Value, Gt = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
|
|
312
311
|
M.Trigger,
|
|
313
312
|
{
|
|
314
313
|
ref: i,
|
|
@@ -323,8 +322,8 @@ const Gi = M.Root, Xi = M.Value, Xt = V.forwardRef(({ className: e, children: t,
|
|
|
323
322
|
]
|
|
324
323
|
}
|
|
325
324
|
));
|
|
326
|
-
|
|
327
|
-
const
|
|
325
|
+
Gt.displayName = M.Trigger.displayName;
|
|
326
|
+
const Xt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
328
327
|
M.ScrollUpButton,
|
|
329
328
|
{
|
|
330
329
|
ref: n,
|
|
@@ -333,11 +332,11 @@ const Yt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
333
332
|
e
|
|
334
333
|
),
|
|
335
334
|
...t,
|
|
336
|
-
children: /* @__PURE__ */ o(
|
|
335
|
+
children: /* @__PURE__ */ o(Zn, { className: "richtext-h-4 richtext-w-4" })
|
|
337
336
|
}
|
|
338
337
|
));
|
|
339
|
-
|
|
340
|
-
const
|
|
338
|
+
Xt.displayName = M.ScrollUpButton.displayName;
|
|
339
|
+
const Yt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
341
340
|
M.ScrollDownButton,
|
|
342
341
|
{
|
|
343
342
|
ref: n,
|
|
@@ -349,8 +348,8 @@ const Zt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
349
348
|
children: /* @__PURE__ */ o(at, { className: "richtext-h-4 richtext-w-4" })
|
|
350
349
|
}
|
|
351
350
|
));
|
|
352
|
-
|
|
353
|
-
const
|
|
351
|
+
Yt.displayName = M.ScrollDownButton.displayName;
|
|
352
|
+
const Zt = V.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */ o(M.Portal, { children: /* @__PURE__ */ m(
|
|
354
353
|
M.Content,
|
|
355
354
|
{
|
|
356
355
|
ref: a,
|
|
@@ -362,7 +361,7 @@ const Jt = V.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
362
361
|
position: n,
|
|
363
362
|
...i,
|
|
364
363
|
children: [
|
|
365
|
-
/* @__PURE__ */ o(
|
|
364
|
+
/* @__PURE__ */ o(Xt, {}),
|
|
366
365
|
/* @__PURE__ */ o(
|
|
367
366
|
M.Viewport,
|
|
368
367
|
{
|
|
@@ -373,12 +372,12 @@ const Jt = V.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
373
372
|
children: t
|
|
374
373
|
}
|
|
375
374
|
),
|
|
376
|
-
/* @__PURE__ */ o(
|
|
375
|
+
/* @__PURE__ */ o(Yt, {})
|
|
377
376
|
]
|
|
378
377
|
}
|
|
379
378
|
) }));
|
|
380
|
-
|
|
381
|
-
const
|
|
379
|
+
Zt.displayName = M.Content.displayName;
|
|
380
|
+
const Gi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
382
381
|
M.Label,
|
|
383
382
|
{
|
|
384
383
|
ref: n,
|
|
@@ -386,7 +385,7 @@ const Yi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
386
385
|
...t
|
|
387
386
|
}
|
|
388
387
|
));
|
|
389
|
-
|
|
388
|
+
Gi.displayName = M.Label.displayName;
|
|
390
389
|
const Je = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
|
|
391
390
|
M.Item,
|
|
392
391
|
{
|
|
@@ -397,13 +396,13 @@ const Je = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__
|
|
|
397
396
|
),
|
|
398
397
|
...n,
|
|
399
398
|
children: [
|
|
400
|
-
/* @__PURE__ */ o("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__ */ o(M.ItemIndicator, { children: /* @__PURE__ */ o(
|
|
399
|
+
/* @__PURE__ */ o("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__ */ o(M.ItemIndicator, { children: /* @__PURE__ */ o(Bt, { className: "richtext-h-4 richtext-w-4" }) }) }),
|
|
401
400
|
/* @__PURE__ */ o(M.ItemText, { children: t })
|
|
402
401
|
]
|
|
403
402
|
}
|
|
404
403
|
));
|
|
405
404
|
Je.displayName = M.Item.displayName;
|
|
406
|
-
const
|
|
405
|
+
const Xi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
407
406
|
M.Separator,
|
|
408
407
|
{
|
|
409
408
|
ref: n,
|
|
@@ -411,8 +410,8 @@ const Zi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
411
410
|
...t
|
|
412
411
|
}
|
|
413
412
|
));
|
|
414
|
-
|
|
415
|
-
function
|
|
413
|
+
Xi.displayName = M.Separator.displayName;
|
|
414
|
+
function Yi() {
|
|
416
415
|
const [e, t] = v(!1);
|
|
417
416
|
return { isCopied: e, copyToClipboard: async (i) => {
|
|
418
417
|
try {
|
|
@@ -422,22 +421,22 @@ function Ji() {
|
|
|
422
421
|
}
|
|
423
422
|
} };
|
|
424
423
|
}
|
|
425
|
-
const
|
|
426
|
-
wrap:
|
|
427
|
-
maxHeight:
|
|
428
|
-
btnCopy:
|
|
429
|
-
btnDelete:
|
|
430
|
-
blockInfo:
|
|
431
|
-
blockInfoEditable:
|
|
432
|
-
selectLang:
|
|
433
|
-
copied:
|
|
424
|
+
const Zi = "_wrap_134f4_1", Ji = "_maxHeight_134f4_10", Qi = "_btnCopy_134f4_13", ea = "_btnDelete_134f4_14", ta = "_blockInfo_134f4_18", na = "_blockInfoEditable_134f4_28", ia = "_selectLang_134f4_32", aa = "_copied_134f4_58", J = {
|
|
425
|
+
wrap: Zi,
|
|
426
|
+
maxHeight: Ji,
|
|
427
|
+
btnCopy: Qi,
|
|
428
|
+
btnDelete: ea,
|
|
429
|
+
blockInfo: ta,
|
|
430
|
+
blockInfoEditable: na,
|
|
431
|
+
selectLang: ia,
|
|
432
|
+
copied: aa
|
|
434
433
|
};
|
|
435
|
-
function
|
|
434
|
+
function oa({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }) {
|
|
436
435
|
var h, f;
|
|
437
|
-
const { isCopied: a, copyToClipboard: r } =
|
|
436
|
+
const { isCopied: a, copyToClipboard: r } = Yi(), s = E(() => {
|
|
438
437
|
var b;
|
|
439
|
-
return (b = i.options.languages) != null && b.length ? i.options.languages :
|
|
440
|
-
}, [i.options.languages]), c = st(), l = (f = (h = e == null ? void 0 : e.options) == null ? void 0 : h.editorProps) == null ? void 0 : f.print, { language: u } = t, d = Y(null), g =
|
|
438
|
+
return (b = i.options.languages) != null && b.length ? i.options.languages : jt;
|
|
439
|
+
}, [i.options.languages]), c = st(), l = (f = (h = e == null ? void 0 : e.options) == null ? void 0 : h.editorProps) == null ? void 0 : f.print, { language: u } = t, d = Y(null), g = P(() => li(ra.name, e), [e]);
|
|
441
440
|
return /* @__PURE__ */ m(he, { className: U(J.wrap, !l && J.maxHeight, "render-wrapper"), children: [
|
|
442
441
|
/* @__PURE__ */ m(
|
|
443
442
|
"div",
|
|
@@ -451,7 +450,7 @@ function sa({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
|
|
|
451
450
|
{
|
|
452
451
|
className: U(J.btnCopy, a && J.copied),
|
|
453
452
|
onClick: () => r(d.current.innerText),
|
|
454
|
-
children: a ? /* @__PURE__ */ o(
|
|
453
|
+
children: a ? /* @__PURE__ */ o(Qn, { size: 16 }) : /* @__PURE__ */ o(Jn, { size: 16 })
|
|
455
454
|
}
|
|
456
455
|
),
|
|
457
456
|
/* @__PURE__ */ o(
|
|
@@ -468,22 +467,22 @@ function sa({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
|
|
|
468
467
|
}
|
|
469
468
|
),
|
|
470
469
|
/* @__PURE__ */ o("div", { className: J.selectLang, children: /* @__PURE__ */ m(
|
|
471
|
-
|
|
470
|
+
Ki,
|
|
472
471
|
{
|
|
473
472
|
defaultValue: u || "auto",
|
|
474
473
|
disabled: !c,
|
|
475
474
|
onValueChange: (b) => n({ language: b }),
|
|
476
475
|
children: [
|
|
477
|
-
/* @__PURE__ */ o(
|
|
478
|
-
/* @__PURE__ */ m(
|
|
476
|
+
/* @__PURE__ */ o(Gt, { children: /* @__PURE__ */ o(Wi, { placeholder: "Language" }) }),
|
|
477
|
+
/* @__PURE__ */ m(Zt, { className: "richtext-max-h-60 richtext-overflow-y-auto", children: [
|
|
479
478
|
/* @__PURE__ */ o(Je, { value: "auto", children: "Auto" }),
|
|
480
|
-
s.map((b,
|
|
479
|
+
s.map((b, x) => /* @__PURE__ */ o(
|
|
481
480
|
Je,
|
|
482
481
|
{
|
|
483
482
|
value: b,
|
|
484
483
|
children: b.charAt(0).toUpperCase() + b.slice(1)
|
|
485
484
|
},
|
|
486
|
-
`code-lang-${
|
|
485
|
+
`code-lang-${x}`
|
|
487
486
|
))
|
|
488
487
|
] })
|
|
489
488
|
]
|
|
@@ -492,10 +491,10 @@ function sa({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
|
|
|
492
491
|
]
|
|
493
492
|
}
|
|
494
493
|
),
|
|
495
|
-
/* @__PURE__ */ o("pre", { ref: d, children: /* @__PURE__ */ o(
|
|
494
|
+
/* @__PURE__ */ o("pre", { ref: d, children: /* @__PURE__ */ o(hn, { as: "code" }) })
|
|
496
495
|
] });
|
|
497
496
|
}
|
|
498
|
-
const
|
|
497
|
+
const ra = mn.extend({
|
|
499
498
|
addOptions() {
|
|
500
499
|
var e;
|
|
501
500
|
return {
|
|
@@ -503,9 +502,9 @@ const ca = fn.extend({
|
|
|
503
502
|
languages: [],
|
|
504
503
|
button: ({ editor: t, t: n, extension: i }) => {
|
|
505
504
|
var r, s, c;
|
|
506
|
-
const a = (s = (r = i == null ? void 0 : i.options) == null ? void 0 : r.languages) != null && s.length ? (c = i == null ? void 0 : i.options) == null ? void 0 : c.languages :
|
|
505
|
+
const a = (s = (r = i == null ? void 0 : i.options) == null ? void 0 : r.languages) != null && s.length ? (c = i == null ? void 0 : i.options) == null ? void 0 : c.languages : jt;
|
|
507
506
|
return {
|
|
508
|
-
component:
|
|
507
|
+
component: qi,
|
|
509
508
|
componentProps: {
|
|
510
509
|
action: (l = "js") => t.commands.setCodeBlock({
|
|
511
510
|
language: l
|
|
@@ -521,13 +520,13 @@ const ca = fn.extend({
|
|
|
521
520
|
};
|
|
522
521
|
},
|
|
523
522
|
addNodeView() {
|
|
524
|
-
return $e(
|
|
523
|
+
return $e(oa);
|
|
525
524
|
},
|
|
526
525
|
addProseMirrorPlugins() {
|
|
527
526
|
var e;
|
|
528
527
|
return [
|
|
529
528
|
...((e = this.parent) == null ? void 0 : e.call(this)) || [],
|
|
530
|
-
|
|
529
|
+
Vi({
|
|
531
530
|
name: this.name,
|
|
532
531
|
defaultLanguage: null,
|
|
533
532
|
defaultTheme: this.options.defaultTheme
|
|
@@ -535,7 +534,7 @@ const ca = fn.extend({
|
|
|
535
534
|
];
|
|
536
535
|
}
|
|
537
536
|
});
|
|
538
|
-
function
|
|
537
|
+
function sa(e) {
|
|
539
538
|
var a, r, s;
|
|
540
539
|
const { t, lang: n } = $(), i = E(() => {
|
|
541
540
|
var u;
|
|
@@ -585,17 +584,17 @@ function la(e) {
|
|
|
585
584
|
)
|
|
586
585
|
}
|
|
587
586
|
),
|
|
588
|
-
c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ o(
|
|
587
|
+
c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ o($t, {})
|
|
589
588
|
] }, `font-family-${l}`);
|
|
590
589
|
}) })
|
|
591
590
|
] });
|
|
592
591
|
}
|
|
593
|
-
const
|
|
592
|
+
const Ir = fn.extend({
|
|
594
593
|
addOptions() {
|
|
595
594
|
var e;
|
|
596
595
|
return {
|
|
597
596
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
598
|
-
fontFamilyList:
|
|
597
|
+
fontFamilyList: Mi,
|
|
599
598
|
button({ editor: t, extension: n, t: i }) {
|
|
600
599
|
var u;
|
|
601
600
|
const { extensions: a = [] } = t.extensionManager ?? [], r = Ye(((u = n == null ? void 0 : n.options) == null ? void 0 : u.fontFamilyList) || []), s = a.find(
|
|
@@ -618,7 +617,7 @@ const Rr = gn.extend({
|
|
|
618
617
|
});
|
|
619
618
|
const l = c.filter((d) => d.disabled).length === c.length;
|
|
620
619
|
return {
|
|
621
|
-
component:
|
|
620
|
+
component: sa,
|
|
622
621
|
componentProps: {
|
|
623
622
|
tooltip: i("editor.fontFamily.tooltip"),
|
|
624
623
|
disabled: l,
|
|
@@ -630,7 +629,7 @@ const Rr = gn.extend({
|
|
|
630
629
|
};
|
|
631
630
|
}
|
|
632
631
|
});
|
|
633
|
-
function
|
|
632
|
+
function ca(e) {
|
|
634
633
|
var n;
|
|
635
634
|
const t = E(() => {
|
|
636
635
|
var r;
|
|
@@ -670,16 +669,16 @@ function da(e) {
|
|
|
670
669
|
onClick: i.action,
|
|
671
670
|
children: [
|
|
672
671
|
/* @__PURE__ */ o("div", { className: `heading- richtext-ml-1 richtext-h-full${i.level}`, children: i.title }),
|
|
673
|
-
!!((r = i == null ? void 0 : i.shortcutKeys) != null && r.length) && /* @__PURE__ */ o(
|
|
672
|
+
!!((r = i == null ? void 0 : i.shortcutKeys) != null && r.length) && /* @__PURE__ */ o(di, { className: "richtext-pl-4", children: (s = i == null ? void 0 : i.shortcutKeys) == null ? void 0 : s.map((c) => ct(c)).join(" ") })
|
|
674
673
|
]
|
|
675
674
|
}
|
|
676
675
|
),
|
|
677
|
-
i.level === 0 && /* @__PURE__ */ o(
|
|
676
|
+
i.level === 0 && /* @__PURE__ */ o($t, {})
|
|
678
677
|
] }, `heading-k-${a}`);
|
|
679
678
|
}) })
|
|
680
679
|
] });
|
|
681
680
|
}
|
|
682
|
-
const
|
|
681
|
+
const zr = gn.extend({
|
|
683
682
|
addOptions() {
|
|
684
683
|
var e;
|
|
685
684
|
return {
|
|
@@ -707,7 +706,7 @@ const Or = _n.extend({
|
|
|
707
706
|
});
|
|
708
707
|
const l = c.filter((d) => d.disabled).length === c.length;
|
|
709
708
|
return {
|
|
710
|
-
component:
|
|
709
|
+
component: ca,
|
|
711
710
|
componentProps: {
|
|
712
711
|
tooltip: i("editor.heading.tooltip"),
|
|
713
712
|
disabled: l,
|
|
@@ -742,7 +741,7 @@ const be = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
742
741
|
}
|
|
743
742
|
));
|
|
744
743
|
be.displayName = ce.Trigger.displayName;
|
|
745
|
-
const
|
|
744
|
+
const xe = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
746
745
|
ce.Content,
|
|
747
746
|
{
|
|
748
747
|
ref: n,
|
|
@@ -753,8 +752,8 @@ const pe = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
753
752
|
...t
|
|
754
753
|
}
|
|
755
754
|
));
|
|
756
|
-
|
|
757
|
-
const
|
|
755
|
+
xe.displayName = ce.Content.displayName;
|
|
756
|
+
const Jt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
758
757
|
Ze.Root,
|
|
759
758
|
{
|
|
760
759
|
ref: n,
|
|
@@ -767,13 +766,13 @@ const Qt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
767
766
|
Ze.Indicator,
|
|
768
767
|
{
|
|
769
768
|
className: B("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),
|
|
770
|
-
children: /* @__PURE__ */ o(
|
|
769
|
+
children: /* @__PURE__ */ o(Bt, { className: "!richtext-h-4 !richtext-w-4" })
|
|
771
770
|
}
|
|
772
771
|
)
|
|
773
772
|
}
|
|
774
773
|
));
|
|
775
|
-
|
|
776
|
-
function
|
|
774
|
+
Jt.displayName = Ze.Root.displayName;
|
|
775
|
+
function la(e) {
|
|
777
776
|
var n;
|
|
778
777
|
const t = E(() => {
|
|
779
778
|
var r;
|
|
@@ -841,7 +840,7 @@ function ua(e) {
|
|
|
841
840
|
)
|
|
842
841
|
] });
|
|
843
842
|
}
|
|
844
|
-
const
|
|
843
|
+
const Hr = _n.extend({
|
|
845
844
|
addOptions() {
|
|
846
845
|
var e;
|
|
847
846
|
return {
|
|
@@ -871,14 +870,14 @@ const Dr = bn.extend({
|
|
|
871
870
|
shortcutKeys: r[d],
|
|
872
871
|
isActive: () => t.isActive({ textAlign: d }) || !1,
|
|
873
872
|
action: () => {
|
|
874
|
-
var b,
|
|
875
|
-
return (
|
|
873
|
+
var b, x;
|
|
874
|
+
return (x = (b = t.commands) == null ? void 0 : b.setTextAlign) == null ? void 0 : x.call(b, d);
|
|
876
875
|
},
|
|
877
876
|
disabled: !((f = (h = (g = t == null ? void 0 : t.can) == null ? void 0 : g.call(t)) == null ? void 0 : h.setTextAlign) != null && f.call(h, d))
|
|
878
877
|
};
|
|
879
878
|
}), l = c.filter((d) => d.disabled).length === c.length;
|
|
880
879
|
return {
|
|
881
|
-
component:
|
|
880
|
+
component: la,
|
|
882
881
|
componentProps: {
|
|
883
882
|
icon: "AlignJustify",
|
|
884
883
|
tooltip: i("editor.textalign.tooltip"),
|
|
@@ -890,7 +889,7 @@ const Dr = bn.extend({
|
|
|
890
889
|
};
|
|
891
890
|
}
|
|
892
891
|
});
|
|
893
|
-
function
|
|
892
|
+
function da(e) {
|
|
894
893
|
var i;
|
|
895
894
|
const { t } = $(), n = E(() => {
|
|
896
895
|
const a = (e.items || []).find((s) => s.isActive());
|
|
@@ -927,14 +926,14 @@ function ha(e) {
|
|
|
927
926
|
)) })
|
|
928
927
|
] });
|
|
929
928
|
}
|
|
930
|
-
const
|
|
929
|
+
const Er = z.create({
|
|
931
930
|
name: "fontSize",
|
|
932
931
|
addOptions() {
|
|
933
932
|
var e;
|
|
934
933
|
return {
|
|
935
934
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
936
935
|
types: ["textStyle"],
|
|
937
|
-
fontSizes: [...
|
|
936
|
+
fontSizes: [...Ii],
|
|
938
937
|
button({ editor: t, extension: n, t: i }) {
|
|
939
938
|
var l;
|
|
940
939
|
const a = Ye(((l = n.options) == null ? void 0 : l.fontSizes) || vt), r = Ye([vt])[0], s = a.map((u) => ({
|
|
@@ -955,7 +954,7 @@ const Pr = z.create({
|
|
|
955
954
|
default: u.value === r.value || !1
|
|
956
955
|
})), c = s.filter((u) => u.disabled).length === s.length;
|
|
957
956
|
return {
|
|
958
|
-
component:
|
|
957
|
+
component: da,
|
|
959
958
|
componentProps: {
|
|
960
959
|
editor: t,
|
|
961
960
|
tooltip: i("editor.fontSize.tooltip"),
|
|
@@ -990,7 +989,7 @@ const Pr = z.create({
|
|
|
990
989
|
};
|
|
991
990
|
}
|
|
992
991
|
});
|
|
993
|
-
function
|
|
992
|
+
function ua({ fill: e }) {
|
|
994
993
|
return /* @__PURE__ */ o(
|
|
995
994
|
"svg",
|
|
996
995
|
{
|
|
@@ -1031,7 +1030,7 @@ function ma({ fill: e }) {
|
|
|
1031
1030
|
}
|
|
1032
1031
|
);
|
|
1033
1032
|
}
|
|
1034
|
-
function
|
|
1033
|
+
function ha(e) {
|
|
1035
1034
|
const [t, n] = v(void 0);
|
|
1036
1035
|
function i(s) {
|
|
1037
1036
|
var c;
|
|
@@ -1041,16 +1040,16 @@ function fa(e) {
|
|
|
1041
1040
|
var s;
|
|
1042
1041
|
(s = e.action) == null || s.call(e, t);
|
|
1043
1042
|
}
|
|
1044
|
-
const r =
|
|
1045
|
-
|
|
1043
|
+
const r = P(
|
|
1044
|
+
qn((s) => {
|
|
1046
1045
|
n(s);
|
|
1047
1046
|
}, 350),
|
|
1048
1047
|
[]
|
|
1049
1048
|
);
|
|
1050
1049
|
return /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-h-[32px]", children: [
|
|
1051
|
-
/* @__PURE__ */ o(y, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ o("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ o(
|
|
1050
|
+
/* @__PURE__ */ o(y, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ o("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ o(ua, { fill: t }) }) }),
|
|
1052
1051
|
/* @__PURE__ */ o(
|
|
1053
|
-
|
|
1052
|
+
ui,
|
|
1054
1053
|
{
|
|
1055
1054
|
selectedColor: t,
|
|
1056
1055
|
setSelectedColor: r,
|
|
@@ -1058,19 +1057,19 @@ function fa(e) {
|
|
|
1058
1057
|
disabled: e == null ? void 0 : e.disabled,
|
|
1059
1058
|
colors: e == null ? void 0 : e.colors,
|
|
1060
1059
|
defaultColor: e == null ? void 0 : e.defaultColor,
|
|
1061
|
-
children: /* @__PURE__ */ o(
|
|
1060
|
+
children: /* @__PURE__ */ o(D, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(O, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
|
|
1062
1061
|
}
|
|
1063
1062
|
)
|
|
1064
1063
|
] });
|
|
1065
1064
|
}
|
|
1066
|
-
const
|
|
1065
|
+
const Rr = bn.extend({
|
|
1067
1066
|
addOptions() {
|
|
1068
1067
|
var e;
|
|
1069
1068
|
return {
|
|
1070
1069
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1071
1070
|
button({ editor: t, t: n, extension: i }) {
|
|
1072
1071
|
return {
|
|
1073
|
-
component:
|
|
1072
|
+
component: ha,
|
|
1074
1073
|
componentProps: {
|
|
1075
1074
|
colors: i.options.colors,
|
|
1076
1075
|
defaultColor: i.options.defaultColor,
|
|
@@ -1089,14 +1088,14 @@ const Br = pn.extend({
|
|
|
1089
1088
|
}
|
|
1090
1089
|
};
|
|
1091
1090
|
}
|
|
1092
|
-
}),
|
|
1091
|
+
}), Or = xn.extend({
|
|
1093
1092
|
addOptions() {
|
|
1094
1093
|
var e;
|
|
1095
1094
|
return {
|
|
1096
1095
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1097
1096
|
multicolor: !0,
|
|
1098
1097
|
button: ({ editor: t, t: n }) => ({
|
|
1099
|
-
component:
|
|
1098
|
+
component: hi,
|
|
1100
1099
|
componentProps: {
|
|
1101
1100
|
action: (i) => {
|
|
1102
1101
|
typeof i == "string" && t.chain().focus().setHighlight({ color: i }).run(), i === void 0 && t.chain().focus().unsetHighlight().run();
|
|
@@ -1110,7 +1109,7 @@ const Br = pn.extend({
|
|
|
1110
1109
|
})
|
|
1111
1110
|
};
|
|
1112
1111
|
}
|
|
1113
|
-
}),
|
|
1112
|
+
}), Pr = pn.extend({
|
|
1114
1113
|
addOptions() {
|
|
1115
1114
|
var e;
|
|
1116
1115
|
return {
|
|
@@ -1128,7 +1127,7 @@ const Br = pn.extend({
|
|
|
1128
1127
|
})
|
|
1129
1128
|
};
|
|
1130
1129
|
}
|
|
1131
|
-
}),
|
|
1130
|
+
}), Dr = Le.create({
|
|
1132
1131
|
name: "clear",
|
|
1133
1132
|
addOptions() {
|
|
1134
1133
|
var e;
|
|
@@ -1145,7 +1144,7 @@ const Br = pn.extend({
|
|
|
1145
1144
|
})
|
|
1146
1145
|
};
|
|
1147
1146
|
}
|
|
1148
|
-
}),
|
|
1147
|
+
}), Br = wn.extend({
|
|
1149
1148
|
addOptions() {
|
|
1150
1149
|
var e;
|
|
1151
1150
|
return {
|
|
@@ -1163,7 +1162,7 @@ const Br = pn.extend({
|
|
|
1163
1162
|
})
|
|
1164
1163
|
};
|
|
1165
1164
|
}
|
|
1166
|
-
}),
|
|
1165
|
+
}), $r = yn.extend({
|
|
1167
1166
|
addOptions() {
|
|
1168
1167
|
var e;
|
|
1169
1168
|
return {
|
|
@@ -1190,9 +1189,9 @@ const Br = pn.extend({
|
|
|
1190
1189
|
};
|
|
1191
1190
|
},
|
|
1192
1191
|
addExtensions() {
|
|
1193
|
-
return [
|
|
1192
|
+
return [vn.configure(this.options.taskItem)];
|
|
1194
1193
|
}
|
|
1195
|
-
}),
|
|
1194
|
+
}), Fr = kn.extend({
|
|
1196
1195
|
addOptions() {
|
|
1197
1196
|
var e;
|
|
1198
1197
|
return {
|
|
@@ -1214,7 +1213,7 @@ const Br = pn.extend({
|
|
|
1214
1213
|
};
|
|
1215
1214
|
}
|
|
1216
1215
|
});
|
|
1217
|
-
function
|
|
1216
|
+
function ma(e) {
|
|
1218
1217
|
const [t, n] = v(!1);
|
|
1219
1218
|
function i(a, r, s) {
|
|
1220
1219
|
e.action && (e.action({ link: a, text: r, openInNewTab: s }), n(!1));
|
|
@@ -1229,10 +1228,10 @@ function ga(e) {
|
|
|
1229
1228
|
children: /* @__PURE__ */ o(O, { name: e == null ? void 0 : e.icon })
|
|
1230
1229
|
}
|
|
1231
1230
|
) }),
|
|
1232
|
-
/* @__PURE__ */ o(ke, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ o(
|
|
1231
|
+
/* @__PURE__ */ o(ke, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ o(mi, { editor: e.editor, onSetLink: i }) })
|
|
1233
1232
|
] });
|
|
1234
1233
|
}
|
|
1235
|
-
const
|
|
1234
|
+
const jr = Cn.extend({
|
|
1236
1235
|
inclusive: !1,
|
|
1237
1236
|
parseHTML() {
|
|
1238
1237
|
return [
|
|
@@ -1256,7 +1255,7 @@ const Kr = Tn.extend({
|
|
|
1256
1255
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1257
1256
|
openOnClick: !0,
|
|
1258
1257
|
button: ({ editor: t, t: n }) => ({
|
|
1259
|
-
component:
|
|
1258
|
+
component: ma,
|
|
1260
1259
|
componentProps: {
|
|
1261
1260
|
editor: t,
|
|
1262
1261
|
action: (i) => {
|
|
@@ -1289,17 +1288,17 @@ const Kr = Tn.extend({
|
|
|
1289
1288
|
new Q({
|
|
1290
1289
|
props: {
|
|
1291
1290
|
handleClick: (e, t) => {
|
|
1292
|
-
const { schema: n, doc: i, tr: a } = e.state, r =
|
|
1291
|
+
const { schema: n, doc: i, tr: a } = e.state, r = Tn(i.resolve(t), n.marks.link);
|
|
1293
1292
|
if (!r)
|
|
1294
1293
|
return !1;
|
|
1295
|
-
const s = i.resolve(r.from), c = i.resolve(r.to), l = a.setSelection(new
|
|
1294
|
+
const s = i.resolve(r.from), c = i.resolve(r.to), l = a.setSelection(new Ot(s, c));
|
|
1296
1295
|
e.dispatch(l);
|
|
1297
1296
|
}
|
|
1298
1297
|
}
|
|
1299
1298
|
})
|
|
1300
1299
|
];
|
|
1301
1300
|
}
|
|
1302
|
-
}),
|
|
1301
|
+
}), Ur = An.extend({
|
|
1303
1302
|
renderHTML() {
|
|
1304
1303
|
return [
|
|
1305
1304
|
"div",
|
|
@@ -1331,7 +1330,7 @@ const Kr = Tn.extend({
|
|
|
1331
1330
|
};
|
|
1332
1331
|
}
|
|
1333
1332
|
});
|
|
1334
|
-
function
|
|
1333
|
+
function fa(e) {
|
|
1335
1334
|
var u;
|
|
1336
1335
|
const {
|
|
1337
1336
|
icon: t = void 0,
|
|
@@ -1367,15 +1366,15 @@ function _a(e) {
|
|
|
1367
1366
|
] }) })
|
|
1368
1367
|
] });
|
|
1369
1368
|
}
|
|
1370
|
-
const
|
|
1369
|
+
const ga = ["undo", "redo"], Vr = Nn.extend({
|
|
1371
1370
|
addOptions() {
|
|
1372
1371
|
var e;
|
|
1373
1372
|
return {
|
|
1374
1373
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1375
1374
|
depth: 100,
|
|
1376
1375
|
newGroupDelay: 500,
|
|
1377
|
-
button: ({ editor: t, t: n }) =>
|
|
1378
|
-
component:
|
|
1376
|
+
button: ({ editor: t, t: n }) => ga.map((i) => ({
|
|
1377
|
+
component: fa,
|
|
1379
1378
|
componentProps: {
|
|
1380
1379
|
action: () => {
|
|
1381
1380
|
i === "undo" && t.chain().focus().undo().run(), i === "redo" && t.chain().focus().redo().run();
|
|
@@ -1389,10 +1388,10 @@ const ba = ["undo", "redo"], Gr = Ln.extend({
|
|
|
1389
1388
|
}))
|
|
1390
1389
|
};
|
|
1391
1390
|
}
|
|
1392
|
-
}),
|
|
1391
|
+
}), _a = Ln.extend({
|
|
1393
1392
|
content: "(block|columns)+"
|
|
1394
1393
|
// echo editor is a block editor
|
|
1395
|
-
}),
|
|
1394
|
+
}), qr = z.create({
|
|
1396
1395
|
name: "columnActionButton",
|
|
1397
1396
|
addOptions() {
|
|
1398
1397
|
var e;
|
|
@@ -1410,7 +1409,7 @@ const ba = ["undo", "redo"], Gr = Ln.extend({
|
|
|
1410
1409
|
})
|
|
1411
1410
|
};
|
|
1412
1411
|
}
|
|
1413
|
-
}),
|
|
1412
|
+
}), ba = z.create({
|
|
1414
1413
|
name: "selection",
|
|
1415
1414
|
addProseMirrorPlugins() {
|
|
1416
1415
|
const { editor: e } = this;
|
|
@@ -1430,7 +1429,7 @@ const ba = ["undo", "redo"], Gr = Ln.extend({
|
|
|
1430
1429
|
];
|
|
1431
1430
|
}
|
|
1432
1431
|
});
|
|
1433
|
-
function
|
|
1432
|
+
function xa(e) {
|
|
1434
1433
|
const { t } = $(), n = E(() => [
|
|
1435
1434
|
{
|
|
1436
1435
|
name: "paragraph",
|
|
@@ -1500,7 +1499,7 @@ function wa(e) {
|
|
|
1500
1499
|
}, [n]);
|
|
1501
1500
|
return /* @__PURE__ */ m(oe, { children: [
|
|
1502
1501
|
/* @__PURE__ */ o(re, { asChild: !0, children: /* @__PURE__ */ m(
|
|
1503
|
-
|
|
1502
|
+
D,
|
|
1504
1503
|
{
|
|
1505
1504
|
className: "richtext-flex richtext-h-[32px] richtext-gap-1 richtext-px-1.5",
|
|
1506
1505
|
variant: "ghost",
|
|
@@ -1544,7 +1543,7 @@ function wa(e) {
|
|
|
1544
1543
|
)
|
|
1545
1544
|
] });
|
|
1546
1545
|
}
|
|
1547
|
-
const
|
|
1546
|
+
const pa = z.create({
|
|
1548
1547
|
name: "text-bubble",
|
|
1549
1548
|
addOptions() {
|
|
1550
1549
|
var e;
|
|
@@ -1552,16 +1551,16 @@ const ya = z.create({
|
|
|
1552
1551
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1553
1552
|
toolbar: !1,
|
|
1554
1553
|
button: () => ({
|
|
1555
|
-
component:
|
|
1554
|
+
component: xa,
|
|
1556
1555
|
componentProps: {}
|
|
1557
1556
|
})
|
|
1558
1557
|
};
|
|
1559
1558
|
}
|
|
1560
1559
|
});
|
|
1561
|
-
function
|
|
1560
|
+
function At({ types: e, node: t }) {
|
|
1562
1561
|
return Array.isArray(e) && e.includes(t.type) || t.type === e;
|
|
1563
1562
|
}
|
|
1564
|
-
const
|
|
1563
|
+
const wa = z.create({
|
|
1565
1564
|
name: "trailingNode",
|
|
1566
1565
|
addOptions() {
|
|
1567
1566
|
return {
|
|
@@ -1582,24 +1581,24 @@ const va = z.create({
|
|
|
1582
1581
|
state: {
|
|
1583
1582
|
init: (n, i) => {
|
|
1584
1583
|
const a = i.tr.doc.lastChild;
|
|
1585
|
-
return !
|
|
1584
|
+
return !At({ node: a, types: t });
|
|
1586
1585
|
},
|
|
1587
1586
|
apply: (n, i) => {
|
|
1588
1587
|
if (!n.docChanged)
|
|
1589
1588
|
return i;
|
|
1590
1589
|
const a = n.doc.lastChild;
|
|
1591
|
-
return !
|
|
1590
|
+
return !At({ node: a, types: t });
|
|
1592
1591
|
}
|
|
1593
1592
|
}
|
|
1594
1593
|
})
|
|
1595
1594
|
];
|
|
1596
1595
|
}
|
|
1597
|
-
}),
|
|
1596
|
+
}), Kr = z.create({
|
|
1598
1597
|
name: "base-kit",
|
|
1599
1598
|
addExtensions() {
|
|
1600
1599
|
const e = [];
|
|
1601
|
-
return this.options.document !== !1 && e.push(
|
|
1602
|
-
|
|
1600
|
+
return this.options.document !== !1 && e.push(_a.configure()), this.options.placeholder !== !1 && e.push(
|
|
1601
|
+
Sn.configure({
|
|
1603
1602
|
placeholder: ({ node: t, pos: n, editor: i }) => {
|
|
1604
1603
|
var a, r, s, c, l;
|
|
1605
1604
|
return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((r = t == null ? void 0 : t.content) == null ? void 0 : r.size) !== 0 ? "" : ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "heading" ? `${H.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "table" ? "" : i.extensionManager.extensions.some((u) => u.name === "slashCommand") ? H.t("editor.slash") : n === 0 ? H.t("editor.content") : H.t("editor.content");
|
|
@@ -1607,19 +1606,19 @@ const va = z.create({
|
|
|
1607
1606
|
...this.options.placeholder
|
|
1608
1607
|
})
|
|
1609
1608
|
), this.options.focus !== !1 && e.push(
|
|
1610
|
-
|
|
1609
|
+
Mn.configure({
|
|
1611
1610
|
className: "focus",
|
|
1612
1611
|
...this.options.focus
|
|
1613
1612
|
})
|
|
1614
|
-
), this.options.text !== !1 && e.push(
|
|
1615
|
-
|
|
1613
|
+
), this.options.text !== !1 && e.push(In.configure()), this.options.textBubble !== !1 && e.push(pa.configure()), this.options.gapcursor !== !1 && e.push(zn.configure()), this.options.dropcursor !== !1 && e.push(
|
|
1614
|
+
Hn.configure({
|
|
1616
1615
|
...this.options.dropcursor,
|
|
1617
1616
|
width: 2,
|
|
1618
1617
|
class: "ProseMirror-dropcursor border-black"
|
|
1619
1618
|
})
|
|
1620
|
-
), this.options.characterCount !== !1 && e.push(
|
|
1619
|
+
), this.options.characterCount !== !1 && e.push(En.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Rn.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(On.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Pn.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(Dn.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(wa.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(ba), this.options.multiColumn !== !1 && e.push(fi, gi), e;
|
|
1621
1620
|
}
|
|
1622
|
-
}),
|
|
1621
|
+
}), Wr = z.create({
|
|
1623
1622
|
name: "subAndSuperScript",
|
|
1624
1623
|
addOptions() {
|
|
1625
1624
|
var e;
|
|
@@ -1651,10 +1650,10 @@ const va = z.create({
|
|
|
1651
1650
|
},
|
|
1652
1651
|
addExtensions() {
|
|
1653
1652
|
const e = [];
|
|
1654
|
-
return this.options.subscript !== !1 && e.push(
|
|
1653
|
+
return this.options.subscript !== !1 && e.push(Ht.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Et.configure(this.options.superscript)), e;
|
|
1655
1654
|
}
|
|
1656
1655
|
});
|
|
1657
|
-
function
|
|
1656
|
+
function ya(e) {
|
|
1658
1657
|
var n;
|
|
1659
1658
|
const t = E(() => {
|
|
1660
1659
|
var r;
|
|
@@ -1681,7 +1680,7 @@ function ka(e) {
|
|
|
1681
1680
|
disabled: e == null ? void 0 : e.disabled,
|
|
1682
1681
|
icon: e == null ? void 0 : e.icon,
|
|
1683
1682
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1684
|
-
children: /* @__PURE__ */ o(
|
|
1683
|
+
children: /* @__PURE__ */ o(_i, { className: "richtext-size-3 richtext-text-gray-500" })
|
|
1685
1684
|
}
|
|
1686
1685
|
)
|
|
1687
1686
|
}
|
|
@@ -1702,7 +1701,7 @@ function ka(e) {
|
|
|
1702
1701
|
)) })
|
|
1703
1702
|
] });
|
|
1704
1703
|
}
|
|
1705
|
-
const
|
|
1704
|
+
const Gr = z.create({
|
|
1706
1705
|
name: "moreMark",
|
|
1707
1706
|
addOptions() {
|
|
1708
1707
|
var e;
|
|
@@ -1725,7 +1724,7 @@ const Jr = z.create({
|
|
|
1725
1724
|
shortcutKeys: ["mod", ","]
|
|
1726
1725
|
}, l = [];
|
|
1727
1726
|
return a !== !1 && l.push(s), r !== !1 && l.push(c), {
|
|
1728
|
-
component:
|
|
1727
|
+
component: ya,
|
|
1729
1728
|
componentProps: {
|
|
1730
1729
|
icon: "Type",
|
|
1731
1730
|
tooltip: i("editor.moremark"),
|
|
@@ -1738,9 +1737,9 @@ const Jr = z.create({
|
|
|
1738
1737
|
},
|
|
1739
1738
|
addExtensions() {
|
|
1740
1739
|
const e = [];
|
|
1741
|
-
return this.options.subscript !== !1 && e.push(
|
|
1740
|
+
return this.options.subscript !== !1 && e.push(Ht.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Et.configure(this.options.superscript)), e;
|
|
1742
1741
|
}
|
|
1743
|
-
}),
|
|
1742
|
+
}), Xr = z.create({
|
|
1744
1743
|
name: "indent",
|
|
1745
1744
|
addOptions() {
|
|
1746
1745
|
var e;
|
|
@@ -1813,10 +1812,10 @@ const Jr = z.create({
|
|
|
1813
1812
|
};
|
|
1814
1813
|
}
|
|
1815
1814
|
});
|
|
1816
|
-
function
|
|
1815
|
+
function va(e) {
|
|
1817
1816
|
return Number.parseFloat(e.replace("%", "")) / 100;
|
|
1818
1817
|
}
|
|
1819
|
-
function
|
|
1818
|
+
function ka(e) {
|
|
1820
1819
|
const { t } = $(), [n, i] = v("default");
|
|
1821
1820
|
function a(s) {
|
|
1822
1821
|
s === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(s), i(s);
|
|
@@ -1825,7 +1824,7 @@ function Ta(e) {
|
|
|
1825
1824
|
const l = e.editor.extensionManager.extensions.find(
|
|
1826
1825
|
(u) => u.name === "lineHeight"
|
|
1827
1826
|
).options.lineHeights.map((u) => ({
|
|
1828
|
-
label:
|
|
1827
|
+
label: va(u),
|
|
1829
1828
|
value: u
|
|
1830
1829
|
}));
|
|
1831
1830
|
return l.unshift({
|
|
@@ -1868,15 +1867,15 @@ function Ta(e) {
|
|
|
1868
1867
|
)) })
|
|
1869
1868
|
] });
|
|
1870
1869
|
}
|
|
1871
|
-
const
|
|
1872
|
-
function
|
|
1870
|
+
const Ca = ["paragraph", "heading", "list_item", "todo_item"];
|
|
1871
|
+
function Ta(e, t) {
|
|
1873
1872
|
const { selection: n, doc: i } = e;
|
|
1874
|
-
if (!n || !i || !(n instanceof
|
|
1873
|
+
if (!n || !i || !(n instanceof Ot || n instanceof Kn))
|
|
1875
1874
|
return e;
|
|
1876
|
-
const { from: a, to: r } = n, s = [], c = t && t !==
|
|
1875
|
+
const { from: a, to: r } = n, s = [], c = t && t !== Ut ? t : null;
|
|
1877
1876
|
if (i.nodesBetween(a, r, (l, u) => {
|
|
1878
1877
|
const d = l.type;
|
|
1879
|
-
return
|
|
1878
|
+
return Ca.includes(d.name) ? ((l.attrs.lineHeight || null) !== c && s.push({
|
|
1880
1879
|
node: l,
|
|
1881
1880
|
pos: u,
|
|
1882
1881
|
nodeType: d
|
|
@@ -1893,25 +1892,25 @@ function Na(e, t) {
|
|
|
1893
1892
|
}
|
|
1894
1893
|
return e;
|
|
1895
1894
|
}
|
|
1896
|
-
function
|
|
1895
|
+
function Aa(e) {
|
|
1897
1896
|
return ({ state: t, dispatch: n }) => {
|
|
1898
1897
|
const { selection: i } = t;
|
|
1899
1898
|
let { tr: a } = t;
|
|
1900
|
-
return a = a.setSelection(i), a =
|
|
1899
|
+
return a = a.setSelection(i), a = Ta(a, e), a.docChanged ? (n && n(a), !0) : !1;
|
|
1901
1900
|
};
|
|
1902
1901
|
}
|
|
1903
|
-
const
|
|
1902
|
+
const Yr = z.create({
|
|
1904
1903
|
name: "lineHeight",
|
|
1905
1904
|
addOptions() {
|
|
1906
1905
|
var e;
|
|
1907
1906
|
return {
|
|
1908
1907
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1909
1908
|
types: ["paragraph", "heading", "list_item", "todo_item"],
|
|
1910
|
-
lineHeights:
|
|
1911
|
-
defaultHeight:
|
|
1909
|
+
lineHeights: zi,
|
|
1910
|
+
defaultHeight: Ut,
|
|
1912
1911
|
button({ editor: t, t: n }) {
|
|
1913
1912
|
return {
|
|
1914
|
-
component:
|
|
1913
|
+
component: ka,
|
|
1915
1914
|
componentProps: {
|
|
1916
1915
|
editor: t,
|
|
1917
1916
|
tooltip: n("editor.lineheight.tooltip")
|
|
@@ -1936,28 +1935,28 @@ const es = z.create({
|
|
|
1936
1935
|
},
|
|
1937
1936
|
addCommands() {
|
|
1938
1937
|
return {
|
|
1939
|
-
setLineHeight: (e) =>
|
|
1938
|
+
setLineHeight: (e) => Aa(e),
|
|
1940
1939
|
unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
|
|
1941
1940
|
};
|
|
1942
1941
|
}
|
|
1943
|
-
}),
|
|
1944
|
-
function
|
|
1945
|
-
return Pt(
|
|
1942
|
+
}), Qt = Dt(!1);
|
|
1943
|
+
function Na() {
|
|
1944
|
+
return Pt(Qt);
|
|
1946
1945
|
}
|
|
1947
1946
|
const ue = {
|
|
1948
1947
|
setOpen: (e) => {
|
|
1949
|
-
|
|
1948
|
+
Qt(e);
|
|
1950
1949
|
}
|
|
1951
|
-
},
|
|
1952
|
-
function
|
|
1953
|
-
return Pt(
|
|
1950
|
+
}, en = Dt(!1);
|
|
1951
|
+
function La() {
|
|
1952
|
+
return Pt(en);
|
|
1954
1953
|
}
|
|
1955
1954
|
const Ae = {
|
|
1956
1955
|
setOpen: (e) => {
|
|
1957
|
-
|
|
1956
|
+
en(e);
|
|
1958
1957
|
}
|
|
1959
1958
|
};
|
|
1960
|
-
function
|
|
1959
|
+
function Sa(e) {
|
|
1961
1960
|
const t = [
|
|
1962
1961
|
{
|
|
1963
1962
|
name: "format",
|
|
@@ -2074,7 +2073,7 @@ function Ia(e) {
|
|
|
2074
2073
|
});
|
|
2075
2074
|
}), t;
|
|
2076
2075
|
}
|
|
2077
|
-
function
|
|
2076
|
+
function Ma(e, t) {
|
|
2078
2077
|
var N, I;
|
|
2079
2078
|
const [n, i] = v(0), [a, r] = v(0), s = Y(null), { t: c } = $(), l = Y([]);
|
|
2080
2079
|
it(t, () => ({
|
|
@@ -2092,18 +2091,18 @@ function za(e, t) {
|
|
|
2092
2091
|
return w.key === "ArrowUp" ? (d(), !0) : w.key === "ArrowDown" ? (g(), !0) : w.key === "Enter" ? (h(), !0) : !1;
|
|
2093
2092
|
}
|
|
2094
2093
|
function d() {
|
|
2095
|
-
var
|
|
2094
|
+
var p;
|
|
2096
2095
|
if (e.items.length === 0)
|
|
2097
2096
|
return !1;
|
|
2098
2097
|
let w = n - 1, _ = a;
|
|
2099
|
-
w < 0 && (_ = a - 1, w = ((
|
|
2098
|
+
w < 0 && (_ = a - 1, w = ((p = e.items[_]) == null ? void 0 : p.commands.length) - 1 || 0), _ < 0 && (_ = e.items.length - 1, w = e.items[_].commands.length - 1), i(w), r(_);
|
|
2100
2099
|
}
|
|
2101
2100
|
function g() {
|
|
2102
2101
|
if (e.items.length === 0)
|
|
2103
2102
|
return !1;
|
|
2104
2103
|
const w = e.items[a].commands;
|
|
2105
|
-
let _ = n + 1,
|
|
2106
|
-
w.length - 1 < _ && (_ = 0,
|
|
2104
|
+
let _ = n + 1, p = a;
|
|
2105
|
+
w.length - 1 < _ && (_ = 0, p = a + 1), e.items.length - 1 < p && (p = 0), i(_), r(p);
|
|
2107
2106
|
}
|
|
2108
2107
|
function h() {
|
|
2109
2108
|
if (e.items.length === 0 || a === -1 || n === -1)
|
|
@@ -2111,14 +2110,14 @@ function za(e, t) {
|
|
|
2111
2110
|
f(a, n);
|
|
2112
2111
|
}
|
|
2113
2112
|
function f(w, _) {
|
|
2114
|
-
const
|
|
2115
|
-
e.command(
|
|
2113
|
+
const p = e.items[w].commands[_];
|
|
2114
|
+
e.command(p);
|
|
2116
2115
|
}
|
|
2117
2116
|
function b(w, _) {
|
|
2118
2117
|
f(w, _);
|
|
2119
2118
|
}
|
|
2120
|
-
function
|
|
2121
|
-
l.current[w * 1e3 + _] =
|
|
2119
|
+
function x(w, _, p) {
|
|
2120
|
+
l.current[w * 1e3 + _] = p;
|
|
2122
2121
|
}
|
|
2123
2122
|
return /* @__PURE__ */ o(
|
|
2124
2123
|
"div",
|
|
@@ -2127,31 +2126,31 @@ function za(e, t) {
|
|
|
2127
2126
|
ref: s,
|
|
2128
2127
|
children: (N = e == null ? void 0 : e.items) != null && N.length ? /* @__PURE__ */ o("div", { className: "richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5", children: (I = e == null ? void 0 : e.items) == null ? void 0 : I.map((w, _) => /* @__PURE__ */ m(tt, { children: [
|
|
2129
2128
|
/* @__PURE__ */ o("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: w.title }),
|
|
2130
|
-
w.commands.map((
|
|
2129
|
+
w.commands.map((p, C) => /* @__PURE__ */ m(
|
|
2131
2130
|
"button",
|
|
2132
2131
|
{
|
|
2133
2132
|
onClick: () => b(_, C),
|
|
2134
|
-
ref: (T) =>
|
|
2133
|
+
ref: (T) => x(_, C, T),
|
|
2135
2134
|
className: B("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 ", {
|
|
2136
2135
|
"slash-command-active": a === _ && n === C
|
|
2137
2136
|
}),
|
|
2138
2137
|
children: [
|
|
2139
|
-
|
|
2138
|
+
p.iconUrl && /* @__PURE__ */ o(
|
|
2140
2139
|
"img",
|
|
2141
2140
|
{
|
|
2142
2141
|
alt: "",
|
|
2143
2142
|
className: "richtext-size-6",
|
|
2144
|
-
src:
|
|
2143
|
+
src: p.iconUrl
|
|
2145
2144
|
}
|
|
2146
2145
|
),
|
|
2147
|
-
|
|
2146
|
+
p.iconName && /* @__PURE__ */ o(
|
|
2148
2147
|
O,
|
|
2149
2148
|
{
|
|
2150
2149
|
className: "!richtext-mr-1 !richtext-text-lg",
|
|
2151
|
-
name:
|
|
2150
|
+
name: p.iconName
|
|
2152
2151
|
}
|
|
2153
2152
|
),
|
|
2154
|
-
|
|
2153
|
+
p.label
|
|
2155
2154
|
]
|
|
2156
2155
|
},
|
|
2157
2156
|
`command-${C}`
|
|
@@ -2160,9 +2159,9 @@ function za(e, t) {
|
|
|
2160
2159
|
}
|
|
2161
2160
|
);
|
|
2162
2161
|
}
|
|
2163
|
-
const
|
|
2162
|
+
const Ia = nt(Ma), ae = "slashCommand";
|
|
2164
2163
|
let A;
|
|
2165
|
-
const
|
|
2164
|
+
const Zr = z.create({
|
|
2166
2165
|
name: ae,
|
|
2167
2166
|
priority: 200,
|
|
2168
2167
|
onCreate() {
|
|
@@ -2186,7 +2185,7 @@ const ts = z.create({
|
|
|
2186
2185
|
},
|
|
2187
2186
|
addProseMirrorPlugins() {
|
|
2188
2187
|
return [
|
|
2189
|
-
|
|
2188
|
+
Rt({
|
|
2190
2189
|
editor: this.editor,
|
|
2191
2190
|
char: "/",
|
|
2192
2191
|
allowSpaces: !0,
|
|
@@ -2203,7 +2202,7 @@ const ts = z.create({
|
|
|
2203
2202
|
const { view: i } = e;
|
|
2204
2203
|
n.action({ editor: e, range: t }), i.focus();
|
|
2205
2204
|
},
|
|
2206
|
-
items: ({ query: e, editor: t }) =>
|
|
2205
|
+
items: ({ query: e, editor: t }) => Sa(t.extensionManager.extensions).map((s) => ({
|
|
2207
2206
|
...s,
|
|
2208
2207
|
commands: s.commands.filter((c) => {
|
|
2209
2208
|
const l = c.label.toLowerCase().trim(), u = e.toLowerCase().trim();
|
|
@@ -2227,7 +2226,7 @@ const ts = z.create({
|
|
|
2227
2226
|
return {
|
|
2228
2227
|
onStart: (n) => {
|
|
2229
2228
|
var r;
|
|
2230
|
-
e = new et(
|
|
2229
|
+
e = new et(Ia, {
|
|
2231
2230
|
props: n,
|
|
2232
2231
|
editor: n.editor
|
|
2233
2232
|
});
|
|
@@ -2308,39 +2307,39 @@ const ts = z.create({
|
|
|
2308
2307
|
};
|
|
2309
2308
|
}
|
|
2310
2309
|
});
|
|
2311
|
-
function
|
|
2312
|
-
const { t: i } = $(), [a, r] = v(!1), s =
|
|
2310
|
+
function za({ editor: e, imageInline: t, onClose: n }) {
|
|
2311
|
+
const { t: i } = $(), [a, r] = v(!1), s = Pe.useRef(null), [c, l] = Pe.useState(), [u, d] = Pe.useState(""), g = Y(null), [h, f] = v({
|
|
2313
2312
|
src: "",
|
|
2314
2313
|
file: null
|
|
2315
2314
|
});
|
|
2316
2315
|
function b(_) {
|
|
2317
2316
|
if (s.current && _.width && _.height) {
|
|
2318
|
-
const
|
|
2319
|
-
d(
|
|
2317
|
+
const p = x(s.current, _);
|
|
2318
|
+
d(p);
|
|
2320
2319
|
}
|
|
2321
2320
|
}
|
|
2322
|
-
function
|
|
2321
|
+
function x(_, p) {
|
|
2323
2322
|
const C = document.createElement("canvas"), T = _.naturalWidth / _.width, L = _.naturalHeight / _.height;
|
|
2324
|
-
C.width =
|
|
2323
|
+
C.width = p.width * T, C.height = p.height * L;
|
|
2325
2324
|
const q = C.getContext("2d");
|
|
2326
2325
|
return q && (q.imageSmoothingEnabled = !1, q.drawImage(
|
|
2327
2326
|
_,
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2327
|
+
p.x * T,
|
|
2328
|
+
p.y * L,
|
|
2329
|
+
p.width * T,
|
|
2330
|
+
p.height * L,
|
|
2332
2331
|
0,
|
|
2333
2332
|
0,
|
|
2334
|
-
|
|
2335
|
-
|
|
2333
|
+
p.width * T,
|
|
2334
|
+
p.height * L
|
|
2336
2335
|
)), C.toDataURL("image/png", 1);
|
|
2337
2336
|
}
|
|
2338
2337
|
async function N() {
|
|
2339
|
-
var _,
|
|
2338
|
+
var _, p;
|
|
2340
2339
|
try {
|
|
2341
|
-
const C =
|
|
2340
|
+
const C = xi(u, ((_ = h == null ? void 0 : h.file) == null ? void 0 : _.name) || "image.png"), T = (p = e.extensionManager.extensions.find(
|
|
2342
2341
|
(q) => q.name === "image"
|
|
2343
|
-
)) == null ? void 0 :
|
|
2342
|
+
)) == null ? void 0 : p.options;
|
|
2344
2343
|
let L = "";
|
|
2345
2344
|
T.upload ? L = await T.upload(C) : L = URL.createObjectURL(C), e.chain().focus().setImageInline({ src: L, inline: t }).run(), r(!1), f({
|
|
2346
2345
|
src: "",
|
|
@@ -2351,15 +2350,15 @@ function Ea({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2351
2350
|
}
|
|
2352
2351
|
}
|
|
2353
2352
|
function I(_) {
|
|
2354
|
-
var
|
|
2355
|
-
_.preventDefault(), (
|
|
2353
|
+
var p;
|
|
2354
|
+
_.preventDefault(), (p = g.current) == null || p.click();
|
|
2356
2355
|
}
|
|
2357
2356
|
const w = async (_) => {
|
|
2358
2357
|
var L;
|
|
2359
|
-
const
|
|
2360
|
-
if (!e || e.isDestroyed ||
|
|
2358
|
+
const p = (L = _ == null ? void 0 : _.target) == null ? void 0 : L.files;
|
|
2359
|
+
if (!e || e.isDestroyed || p.length === 0)
|
|
2361
2360
|
return;
|
|
2362
|
-
const C =
|
|
2361
|
+
const C = p[0], T = await pi(C);
|
|
2363
2362
|
r(!0), f({
|
|
2364
2363
|
src: T.src,
|
|
2365
2364
|
file: C
|
|
@@ -2367,7 +2366,7 @@ function Ea({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2367
2366
|
};
|
|
2368
2367
|
return /* @__PURE__ */ m(_e, { children: [
|
|
2369
2368
|
/* @__PURE__ */ o(
|
|
2370
|
-
|
|
2369
|
+
D,
|
|
2371
2370
|
{
|
|
2372
2371
|
className: "richtext-mt-1 richtext-w-full",
|
|
2373
2372
|
onClick: I,
|
|
@@ -2380,7 +2379,7 @@ function Ea({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2380
2379
|
/* @__PURE__ */ m(ht, { children: [
|
|
2381
2380
|
/* @__PURE__ */ o(mt, { children: i("editor.image.dialog.tab.uploadCrop") }),
|
|
2382
2381
|
/* @__PURE__ */ o("div", { children: h.src && /* @__PURE__ */ o(
|
|
2383
|
-
|
|
2382
|
+
Pi,
|
|
2384
2383
|
{
|
|
2385
2384
|
className: "richtext-w-full",
|
|
2386
2385
|
crop: c,
|
|
@@ -2396,9 +2395,9 @@ function Ea({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2396
2395
|
)
|
|
2397
2396
|
}
|
|
2398
2397
|
) }),
|
|
2399
|
-
/* @__PURE__ */ m(
|
|
2398
|
+
/* @__PURE__ */ m(bi, { children: [
|
|
2400
2399
|
/* @__PURE__ */ m(
|
|
2401
|
-
|
|
2400
|
+
D,
|
|
2402
2401
|
{
|
|
2403
2402
|
onClick: () => {
|
|
2404
2403
|
r(!1), f({
|
|
@@ -2419,7 +2418,7 @@ function Ea({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2419
2418
|
}
|
|
2420
2419
|
),
|
|
2421
2420
|
/* @__PURE__ */ m(
|
|
2422
|
-
|
|
2421
|
+
D,
|
|
2423
2422
|
{
|
|
2424
2423
|
className: "richtext-w-fit",
|
|
2425
2424
|
onClick: N,
|
|
@@ -2453,11 +2452,11 @@ function Ea({ editor: e, imageInline: t, onClose: n }) {
|
|
|
2453
2452
|
)
|
|
2454
2453
|
] });
|
|
2455
2454
|
}
|
|
2456
|
-
function
|
|
2457
|
-
const { t } = $(), n =
|
|
2455
|
+
function Ha(e) {
|
|
2456
|
+
const { t } = $(), n = Na(), [i, a] = v(""), r = Y(null), [s, c] = v(!1), l = E(() => {
|
|
2458
2457
|
var f;
|
|
2459
2458
|
return (f = e.editor.extensionManager.extensions.find(
|
|
2460
|
-
(b) => b.name ===
|
|
2459
|
+
(b) => b.name === ja.name
|
|
2461
2460
|
)) == null ? void 0 : f.options;
|
|
2462
2461
|
}, [e.editor]);
|
|
2463
2462
|
async function u(h) {
|
|
@@ -2466,8 +2465,8 @@ function Ra(e) {
|
|
|
2466
2465
|
if (!e.editor || e.editor.isDestroyed || f.length === 0)
|
|
2467
2466
|
return;
|
|
2468
2467
|
const b = f[0];
|
|
2469
|
-
let
|
|
2470
|
-
l.upload ?
|
|
2468
|
+
let x = "";
|
|
2469
|
+
l.upload ? x = await l.upload(b) : x = URL.createObjectURL(b), e.editor.chain().focus().setImageInline({ src: x, inline: s }).run(), ue.setOpen(!1), c(!1);
|
|
2471
2470
|
}
|
|
2472
2471
|
function d(h) {
|
|
2473
2472
|
h.preventDefault(), h.stopPropagation(), e.editor.chain().focus().setImageInline({ src: i, inline: s }).run(), ue.setOpen(!1), c(!1), a("");
|
|
@@ -2499,7 +2498,7 @@ function Ra(e) {
|
|
|
2499
2498
|
] }),
|
|
2500
2499
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px] richtext-my-[10px]", children: [
|
|
2501
2500
|
/* @__PURE__ */ o(
|
|
2502
|
-
|
|
2501
|
+
Jt,
|
|
2503
2502
|
{
|
|
2504
2503
|
checked: s,
|
|
2505
2504
|
onCheckedChange: (h) => {
|
|
@@ -2507,13 +2506,13 @@ function Ra(e) {
|
|
|
2507
2506
|
}
|
|
2508
2507
|
}
|
|
2509
2508
|
),
|
|
2510
|
-
/* @__PURE__ */ o(
|
|
2509
|
+
/* @__PURE__ */ o(De, { children: t("editor.link.dialog.inline") })
|
|
2511
2510
|
] }),
|
|
2512
|
-
/* @__PURE__ */ m(
|
|
2511
|
+
/* @__PURE__ */ m(xe, { value: "upload", children: [
|
|
2513
2512
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
2514
|
-
/* @__PURE__ */ o(
|
|
2513
|
+
/* @__PURE__ */ o(D, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: g, children: t("editor.image.dialog.tab.upload") }),
|
|
2515
2514
|
/* @__PURE__ */ o(
|
|
2516
|
-
|
|
2515
|
+
za,
|
|
2517
2516
|
{
|
|
2518
2517
|
editor: e.editor,
|
|
2519
2518
|
imageInline: s,
|
|
@@ -2535,7 +2534,7 @@ function Ra(e) {
|
|
|
2535
2534
|
}
|
|
2536
2535
|
)
|
|
2537
2536
|
] }),
|
|
2538
|
-
/* @__PURE__ */ o(
|
|
2537
|
+
/* @__PURE__ */ o(xe, { value: "link", children: /* @__PURE__ */ o("form", { onSubmit: d, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
2539
2538
|
/* @__PURE__ */ o(
|
|
2540
2539
|
Be,
|
|
2541
2540
|
{
|
|
@@ -2547,7 +2546,7 @@ function Ra(e) {
|
|
|
2547
2546
|
placeholder: t("editor.image.dialog.placeholder")
|
|
2548
2547
|
}
|
|
2549
2548
|
),
|
|
2550
|
-
/* @__PURE__ */ o(
|
|
2549
|
+
/* @__PURE__ */ o(D, { type: "submit", children: t("editor.image.dialog.button.apply") })
|
|
2551
2550
|
] }) }) })
|
|
2552
2551
|
]
|
|
2553
2552
|
}
|
|
@@ -2561,7 +2560,7 @@ const Ee = {
|
|
|
2561
2560
|
BOTTOM_LEFT: "bl",
|
|
2562
2561
|
BOTTOM_RIGHT: "br"
|
|
2563
2562
|
};
|
|
2564
|
-
function
|
|
2563
|
+
function Ea(e) {
|
|
2565
2564
|
var L, q;
|
|
2566
2565
|
const [t, n] = v({
|
|
2567
2566
|
width: kt,
|
|
@@ -2581,17 +2580,17 @@ function Oa(e) {
|
|
|
2581
2580
|
h: 0,
|
|
2582
2581
|
dir: ""
|
|
2583
2582
|
}), { align: d, inline: g } = (L = e == null ? void 0 : e.node) == null ? void 0 : L.attrs, h = E(() => {
|
|
2584
|
-
var
|
|
2585
|
-
const { src: k, alt: F, width: j, height: te, flipX: ne, flipY: S } = (
|
|
2583
|
+
var xt;
|
|
2584
|
+
const { src: k, alt: F, width: j, height: te, flipX: ne, flipY: S } = (xt = e == null ? void 0 : e.node) == null ? void 0 : xt.attrs, K = pt(j) ? `${j}px` : j, W = pt(te) ? `${te}px` : te, qe = [];
|
|
2586
2585
|
ne && qe.push("rotateX(180deg)"), S && qe.push("rotateY(180deg)");
|
|
2587
|
-
const
|
|
2586
|
+
const an = qe.join(" ");
|
|
2588
2587
|
return {
|
|
2589
2588
|
src: k || void 0,
|
|
2590
2589
|
alt: F || void 0,
|
|
2591
2590
|
style: {
|
|
2592
2591
|
width: K || void 0,
|
|
2593
2592
|
height: W || void 0,
|
|
2594
|
-
transform:
|
|
2593
|
+
transform: an || "none"
|
|
2595
2594
|
}
|
|
2596
2595
|
};
|
|
2597
2596
|
}, [(q = e == null ? void 0 : e.node) == null ? void 0 : q.attrs]), f = E(() => {
|
|
@@ -2606,11 +2605,11 @@ function Oa(e) {
|
|
|
2606
2605
|
height: k.target.height
|
|
2607
2606
|
});
|
|
2608
2607
|
}
|
|
2609
|
-
function
|
|
2608
|
+
function x() {
|
|
2610
2609
|
const { editor: k, getPos: F } = e;
|
|
2611
2610
|
k.commands.setNodeSelection(F());
|
|
2612
2611
|
}
|
|
2613
|
-
const N =
|
|
2612
|
+
const N = P(
|
|
2614
2613
|
wt(() => {
|
|
2615
2614
|
const { editor: k } = e, { width: F } = getComputedStyle(k.view.dom);
|
|
2616
2615
|
n((j) => ({
|
|
@@ -2625,48 +2624,44 @@ function Oa(e) {
|
|
|
2625
2624
|
const j = i.width, te = i.height, ne = j / te;
|
|
2626
2625
|
let S = Number(e.node.attrs.width), K = Number(e.node.attrs.height);
|
|
2627
2626
|
const W = t.width;
|
|
2628
|
-
S && !K ? (S = S > W ? W : S, K = Math.round(S / ne)) : K && !S ? (S = Math.round(K * ne), S = S > W ? W : S) : !S && !K ? (S = j > W ? W : j, K = Math.round(S / ne)) : S = S > W ? W : S,
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
dir: F
|
|
2635
|
-
});
|
|
2627
|
+
S && !K ? (S = S > W ? W : S, K = Math.round(S / ne)) : K && !S ? (S = Math.round(K * ne), S = S > W ? W : S) : !S && !K ? (S = j > W ? W : j, K = Math.round(S / ne)) : S = S > W ? W : S, c(!0), u({
|
|
2628
|
+
x: k.clientX,
|
|
2629
|
+
y: k.clientY,
|
|
2630
|
+
w: S,
|
|
2631
|
+
h: K,
|
|
2632
|
+
dir: F
|
|
2636
2633
|
});
|
|
2637
2634
|
}
|
|
2638
|
-
const w =
|
|
2635
|
+
const w = P(
|
|
2639
2636
|
wt((k) => {
|
|
2640
2637
|
if (k.preventDefault(), k.stopPropagation(), !s)
|
|
2641
2638
|
return;
|
|
2642
|
-
const { x: F, w: j, dir: te } = l, ne = (k.clientX - F) * (/l/.test(te) ? -1 : 1), S =
|
|
2639
|
+
const { x: F, w: j, dir: te } = l, ne = (k.clientX - F) * (/l/.test(te) ? -1 : 1), S = Wn(j + ne, Hi, t.width);
|
|
2643
2640
|
e.updateAttributes({
|
|
2644
2641
|
width: S,
|
|
2645
2642
|
height: null
|
|
2646
2643
|
});
|
|
2647
2644
|
}, Ct),
|
|
2648
2645
|
[s, l, t, e.updateAttributes]
|
|
2649
|
-
), _ =
|
|
2646
|
+
), _ = P(
|
|
2650
2647
|
(k) => {
|
|
2651
|
-
k.preventDefault(), k.stopPropagation(), s && (
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
}), c(!1);
|
|
2659
|
-
}), p());
|
|
2648
|
+
k.preventDefault(), k.stopPropagation(), s && (u({
|
|
2649
|
+
x: 0,
|
|
2650
|
+
y: 0,
|
|
2651
|
+
w: 0,
|
|
2652
|
+
h: 0,
|
|
2653
|
+
dir: ""
|
|
2654
|
+
}), c(!1), x());
|
|
2660
2655
|
},
|
|
2661
|
-
[s,
|
|
2662
|
-
),
|
|
2656
|
+
[s, x]
|
|
2657
|
+
), p = P(() => {
|
|
2663
2658
|
document == null || document.addEventListener("mousemove", w, !0), document == null || document.addEventListener("mouseup", _, !0);
|
|
2664
|
-
}, [w, _]), C =
|
|
2659
|
+
}, [w, _]), C = P(() => {
|
|
2665
2660
|
document == null || document.removeEventListener("mousemove", w, !0), document == null || document.removeEventListener("mouseup", _, !0);
|
|
2666
2661
|
}, [w, _]);
|
|
2667
|
-
R(() => (s ?
|
|
2662
|
+
R(() => (s ? p() : C(), () => {
|
|
2668
2663
|
C();
|
|
2669
|
-
}), [s,
|
|
2664
|
+
}), [s, p, C]);
|
|
2670
2665
|
const T = E(() => new ResizeObserver(() => N()), [N]);
|
|
2671
2666
|
return R(() => (T.observe(e.editor.view.dom), () => {
|
|
2672
2667
|
T.disconnect();
|
|
@@ -2690,7 +2685,7 @@ function Oa(e) {
|
|
|
2690
2685
|
alt: h.alt,
|
|
2691
2686
|
className: "image-view__body__image block",
|
|
2692
2687
|
height: "auto",
|
|
2693
|
-
onClick:
|
|
2688
|
+
onClick: x,
|
|
2694
2689
|
onLoad: b,
|
|
2695
2690
|
src: h.src,
|
|
2696
2691
|
style: h.style
|
|
@@ -2711,7 +2706,7 @@ function Oa(e) {
|
|
|
2711
2706
|
);
|
|
2712
2707
|
}
|
|
2713
2708
|
const fe = new ee("upload-image");
|
|
2714
|
-
function
|
|
2709
|
+
function Ra() {
|
|
2715
2710
|
return new Q({
|
|
2716
2711
|
key: fe,
|
|
2717
2712
|
state: {
|
|
@@ -2723,7 +2718,7 @@ function Da() {
|
|
|
2723
2718
|
const n = e.getMeta(fe);
|
|
2724
2719
|
if (n != null && n.add)
|
|
2725
2720
|
for (const { id: i, pos: a, src: r } of n.add) {
|
|
2726
|
-
const s =
|
|
2721
|
+
const s = Oa(r), c = ge.widget(a, s, { id: i });
|
|
2727
2722
|
t = t.add(e.doc, [c]);
|
|
2728
2723
|
}
|
|
2729
2724
|
else if (n != null && n.remove)
|
|
@@ -2739,18 +2734,18 @@ function Da() {
|
|
|
2739
2734
|
}
|
|
2740
2735
|
});
|
|
2741
2736
|
}
|
|
2742
|
-
function
|
|
2737
|
+
function Oa(e) {
|
|
2743
2738
|
const t = document.createElement("div"), n = document.createElement("img");
|
|
2744
2739
|
return n.setAttribute("class", "opacity-50"), n.src = e, n.addEventListener("load", () => {
|
|
2745
2740
|
t.setAttribute("class", "img-placeholder");
|
|
2746
2741
|
}), t.append(n), t;
|
|
2747
2742
|
}
|
|
2748
|
-
function
|
|
2743
|
+
function Pa(e, t) {
|
|
2749
2744
|
var a;
|
|
2750
2745
|
const i = fe.getState(e).find(void 0, void 0, (r) => r.id === t);
|
|
2751
2746
|
return i.length > 0 ? (a = i[0]) == null ? void 0 : a.from : null;
|
|
2752
2747
|
}
|
|
2753
|
-
function
|
|
2748
|
+
function Da({ validateFn: e, onUpload: t, postUpload: n }) {
|
|
2754
2749
|
return (i, a, r) => {
|
|
2755
2750
|
for (const s of i) {
|
|
2756
2751
|
if (e && !e(s))
|
|
@@ -2765,14 +2760,14 @@ function $a({ validateFn: e, onUpload: t, postUpload: n }) {
|
|
|
2765
2760
|
var I;
|
|
2766
2761
|
n && typeof d == "string" && (d = await n(d));
|
|
2767
2762
|
const { schema: g } = a.state;
|
|
2768
|
-
let h =
|
|
2763
|
+
let h = Pa(a.state, c);
|
|
2769
2764
|
if (h === null)
|
|
2770
2765
|
return;
|
|
2771
2766
|
const f = typeof d == "object" ? u : d, b = (I = g.nodes.image) == null ? void 0 : I.create({ src: f });
|
|
2772
2767
|
if (!b)
|
|
2773
2768
|
return;
|
|
2774
|
-
const { doc:
|
|
2775
|
-
h >
|
|
2769
|
+
const { doc: x } = a.state;
|
|
2770
|
+
h > x.content.size && (h = x.content.size - 1);
|
|
2776
2771
|
const N = a.state.tr.replaceWith(h, h, b).setMeta(fe, { remove: [c] });
|
|
2777
2772
|
a.dispatch(N);
|
|
2778
2773
|
},
|
|
@@ -2784,7 +2779,7 @@ function $a({ validateFn: e, onUpload: t, postUpload: n }) {
|
|
|
2784
2779
|
}
|
|
2785
2780
|
};
|
|
2786
2781
|
}
|
|
2787
|
-
function
|
|
2782
|
+
function Ba(e, t, n) {
|
|
2788
2783
|
var a;
|
|
2789
2784
|
const i = [...((a = t.clipboardData) == null ? void 0 : a.files) || []];
|
|
2790
2785
|
if (i.length > 0) {
|
|
@@ -2794,7 +2789,7 @@ function Fa(e, t, n) {
|
|
|
2794
2789
|
}
|
|
2795
2790
|
return !1;
|
|
2796
2791
|
}
|
|
2797
|
-
function
|
|
2792
|
+
function $a(e, t, n, i) {
|
|
2798
2793
|
var r;
|
|
2799
2794
|
const a = [...((r = t.dataTransfer) == null ? void 0 : r.files) || []];
|
|
2800
2795
|
if (!n && a.length > 0) {
|
|
@@ -2808,12 +2803,12 @@ function ja(e, t, n, i) {
|
|
|
2808
2803
|
}
|
|
2809
2804
|
return !1;
|
|
2810
2805
|
}
|
|
2811
|
-
const
|
|
2806
|
+
const Fa = {
|
|
2812
2807
|
acceptMimes: ["image/jpeg", "image/gif", "image/png", "image/jpg"],
|
|
2813
2808
|
maxSize: 1024 * 1024 * 5,
|
|
2814
2809
|
// 5MB
|
|
2815
2810
|
resourceImage: "both"
|
|
2816
|
-
},
|
|
2811
|
+
}, ja = Bn.extend({
|
|
2817
2812
|
group: "inline",
|
|
2818
2813
|
inline: !0,
|
|
2819
2814
|
defining: !0,
|
|
@@ -2822,7 +2817,7 @@ const Ua = {
|
|
|
2822
2817
|
addOptions() {
|
|
2823
2818
|
var e;
|
|
2824
2819
|
return {
|
|
2825
|
-
...
|
|
2820
|
+
...Fa,
|
|
2826
2821
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2827
2822
|
upload: () => Promise.reject("Image Upload Function"),
|
|
2828
2823
|
button: ({
|
|
@@ -2832,7 +2827,7 @@ const Ua = {
|
|
|
2832
2827
|
}) => {
|
|
2833
2828
|
var a, r;
|
|
2834
2829
|
return {
|
|
2835
|
-
component:
|
|
2830
|
+
component: Ha,
|
|
2836
2831
|
componentProps: {
|
|
2837
2832
|
action: () => !0,
|
|
2838
2833
|
upload: n.options.upload,
|
|
@@ -2883,7 +2878,7 @@ const Ua = {
|
|
|
2883
2878
|
};
|
|
2884
2879
|
},
|
|
2885
2880
|
addNodeView() {
|
|
2886
|
-
return $e(
|
|
2881
|
+
return $e(Ea);
|
|
2887
2882
|
},
|
|
2888
2883
|
addCommands() {
|
|
2889
2884
|
var e;
|
|
@@ -2956,7 +2951,7 @@ const Ua = {
|
|
|
2956
2951
|
];
|
|
2957
2952
|
},
|
|
2958
2953
|
addProseMirrorPlugins() {
|
|
2959
|
-
const t =
|
|
2954
|
+
const t = Da({
|
|
2960
2955
|
validateFn: (n) => !(!this.options.acceptMimes.includes(n.type) || n.size > this.options.maxSize),
|
|
2961
2956
|
onUpload: this.options.upload
|
|
2962
2957
|
// postUpload: this.options.postUpload,
|
|
@@ -2964,22 +2959,22 @@ const Ua = {
|
|
|
2964
2959
|
return [
|
|
2965
2960
|
new Q({
|
|
2966
2961
|
props: {
|
|
2967
|
-
handlePaste: (n, i) => !i.clipboardData || [...i.clipboardData.files || []].some((r) => r.type === "text/html") ? !1 :
|
|
2968
|
-
handleDrop: (n, i, a, r) => (!(i instanceof DragEvent) || !i.dataTransfer ||
|
|
2962
|
+
handlePaste: (n, i) => !i.clipboardData || [...i.clipboardData.files || []].some((r) => r.type === "text/html") ? !1 : Ba(n, i, t),
|
|
2963
|
+
handleDrop: (n, i, a, r) => (!(i instanceof DragEvent) || !i.dataTransfer || $a(n, i, r, t), !1)
|
|
2969
2964
|
}
|
|
2970
2965
|
}),
|
|
2971
|
-
|
|
2966
|
+
Ra()
|
|
2972
2967
|
];
|
|
2973
2968
|
}
|
|
2974
2969
|
});
|
|
2975
|
-
function
|
|
2970
|
+
function Ua(e) {
|
|
2976
2971
|
return /\.(?:mp4|webm|ogg|mov)$/i.test(e);
|
|
2977
2972
|
}
|
|
2978
|
-
function
|
|
2979
|
-
const { t } = $(), [n, i] = v(""), a = Y(null), r =
|
|
2973
|
+
function Va(e) {
|
|
2974
|
+
const { t } = $(), [n, i] = v(""), a = Y(null), r = La(), [s, c] = v(""), l = E(() => {
|
|
2980
2975
|
var f;
|
|
2981
2976
|
return (f = e.editor.extensionManager.extensions.find(
|
|
2982
|
-
(b) => b.name ===
|
|
2977
|
+
(b) => b.name === Ka.name
|
|
2983
2978
|
)) == null ? void 0 : f.options;
|
|
2984
2979
|
}, [e.editor]);
|
|
2985
2980
|
async function u(h) {
|
|
@@ -2988,9 +2983,9 @@ function Ka(e) {
|
|
|
2988
2983
|
if (!e.editor || e.editor.isDestroyed || f.length === 0)
|
|
2989
2984
|
return;
|
|
2990
2985
|
const b = f[0];
|
|
2991
|
-
let
|
|
2992
|
-
l.upload ?
|
|
2993
|
-
src:
|
|
2986
|
+
let x = "";
|
|
2987
|
+
l.upload ? x = await l.upload(b) : x = URL.createObjectURL(b), e.editor.chain().setVideo({
|
|
2988
|
+
src: x,
|
|
2994
2989
|
width: "100%"
|
|
2995
2990
|
}).focus().run(), Ae.setOpen(!1);
|
|
2996
2991
|
}
|
|
@@ -3025,8 +3020,8 @@ function Ka(e) {
|
|
|
3025
3020
|
((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload") && /* @__PURE__ */ o(be, { value: "upload", children: t("editor.video.dialog.tab.upload") }),
|
|
3026
3021
|
((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "link") && /* @__PURE__ */ o(be, { value: "link", children: t("editor.video.dialog.link") })
|
|
3027
3022
|
] }),
|
|
3028
|
-
/* @__PURE__ */ m(
|
|
3029
|
-
/* @__PURE__ */ o("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ o(
|
|
3023
|
+
/* @__PURE__ */ m(xe, { value: "upload", children: [
|
|
3024
|
+
/* @__PURE__ */ o("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ o(D, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: g, children: t("editor.video.dialog.tab.upload") }) }),
|
|
3030
3025
|
/* @__PURE__ */ o(
|
|
3031
3026
|
"input",
|
|
3032
3027
|
{
|
|
@@ -3041,7 +3036,7 @@ function Ka(e) {
|
|
|
3041
3036
|
}
|
|
3042
3037
|
)
|
|
3043
3038
|
] }),
|
|
3044
|
-
/* @__PURE__ */ m(
|
|
3039
|
+
/* @__PURE__ */ m(xe, { value: "link", children: [
|
|
3045
3040
|
/* @__PURE__ */ o("form", { onSubmit: d, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
3046
3041
|
/* @__PURE__ */ o(
|
|
3047
3042
|
Be,
|
|
@@ -3051,7 +3046,7 @@ function Ka(e) {
|
|
|
3051
3046
|
value: n,
|
|
3052
3047
|
onChange: (h) => {
|
|
3053
3048
|
const f = h.target.value;
|
|
3054
|
-
if (!
|
|
3049
|
+
if (!Ua(f)) {
|
|
3055
3050
|
c("Invalid video URL"), i("");
|
|
3056
3051
|
return;
|
|
3057
3052
|
}
|
|
@@ -3061,7 +3056,7 @@ function Ka(e) {
|
|
|
3061
3056
|
placeholder: t("editor.video.dialog.placeholder")
|
|
3062
3057
|
}
|
|
3063
3058
|
),
|
|
3064
|
-
/* @__PURE__ */ o(
|
|
3059
|
+
/* @__PURE__ */ o(D, { type: "submit", children: t("editor.video.dialog.button.apply") })
|
|
3065
3060
|
] }) }),
|
|
3066
3061
|
s && /* @__PURE__ */ o("div", { className: "richtext-text-red-500 richtext-my-[5px]", children: s })
|
|
3067
3062
|
] })
|
|
@@ -3071,10 +3066,10 @@ function Ka(e) {
|
|
|
3071
3066
|
] })
|
|
3072
3067
|
] });
|
|
3073
3068
|
}
|
|
3074
|
-
function
|
|
3069
|
+
function qa(e) {
|
|
3075
3070
|
return e = e.replace("https://youtu.be/", "https://www.youtube.com/watch?v=").replace("watch?v=", "embed/"), e = e.replace("https://vimeo.com/", "https://player.vimeo.com/video/"), /^https?:\/\/www.bilibili.com\/video\/.*/i.test(e) && (e = e.replace(/\?.*$/, "").replace("https://www.bilibili.com/video/", "https://player.bilibili.com/player.html?bvid=")), e.includes("drive.google.com") && (e = e.replace("/view", "/preview")), e;
|
|
3076
3071
|
}
|
|
3077
|
-
const
|
|
3072
|
+
const Ka = Le.create({
|
|
3078
3073
|
name: "video",
|
|
3079
3074
|
group: "block",
|
|
3080
3075
|
atom: !0,
|
|
@@ -3087,7 +3082,7 @@ const Ga = Le.create({
|
|
|
3087
3082
|
upload: void 0,
|
|
3088
3083
|
frameborder: !1,
|
|
3089
3084
|
resourceVideo: "both",
|
|
3090
|
-
width:
|
|
3085
|
+
width: Ei["size-medium"],
|
|
3091
3086
|
HTMLAttributes: {
|
|
3092
3087
|
class: "iframe-wrapper",
|
|
3093
3088
|
style: "display: flex;justify-content: center;"
|
|
@@ -3095,7 +3090,7 @@ const Ga = Le.create({
|
|
|
3095
3090
|
button: ({ editor: e, t }) => {
|
|
3096
3091
|
var n, i;
|
|
3097
3092
|
return {
|
|
3098
|
-
component:
|
|
3093
|
+
component: Va,
|
|
3099
3094
|
componentProps: {
|
|
3100
3095
|
action: () => {
|
|
3101
3096
|
},
|
|
@@ -3115,13 +3110,13 @@ const Ga = Le.create({
|
|
|
3115
3110
|
src: {
|
|
3116
3111
|
default: null,
|
|
3117
3112
|
renderHTML: ({ src: e }) => ({
|
|
3118
|
-
src: e ?
|
|
3113
|
+
src: e ? qa(e) : null
|
|
3119
3114
|
})
|
|
3120
3115
|
},
|
|
3121
3116
|
width: {
|
|
3122
3117
|
default: this.options.width,
|
|
3123
3118
|
renderHTML: ({ width: e }) => ({
|
|
3124
|
-
width:
|
|
3119
|
+
width: wi(e)
|
|
3125
3120
|
})
|
|
3126
3121
|
},
|
|
3127
3122
|
frameborder: {
|
|
@@ -3162,7 +3157,7 @@ const Ga = Le.create({
|
|
|
3162
3157
|
};
|
|
3163
3158
|
}
|
|
3164
3159
|
});
|
|
3165
|
-
function
|
|
3160
|
+
function Wa(e, t, n) {
|
|
3166
3161
|
if (!e.doc)
|
|
3167
3162
|
return e;
|
|
3168
3163
|
const i = e.doc.nodeAt(t);
|
|
@@ -3174,19 +3169,19 @@ function Xa(e, t, n) {
|
|
|
3174
3169
|
};
|
|
3175
3170
|
return e.setNodeMarkup(t, i.type, a, i.marks);
|
|
3176
3171
|
}
|
|
3177
|
-
function
|
|
3172
|
+
function Ga(e, t, n) {
|
|
3178
3173
|
const { doc: i, selection: a } = e;
|
|
3179
|
-
return !i || !a || !(a instanceof
|
|
3180
|
-
e =
|
|
3174
|
+
return !i || !a || !(a instanceof Gn) || a.forEachCell((r, s) => {
|
|
3175
|
+
e = Wa(e, s, n);
|
|
3181
3176
|
}), e;
|
|
3182
3177
|
}
|
|
3183
|
-
function
|
|
3178
|
+
function Nt(e, t) {
|
|
3184
3179
|
return ({ tr: n, state: i, dispatch: a }) => {
|
|
3185
3180
|
const { selection: r } = i;
|
|
3186
|
-
return n = n.setSelection(r), n =
|
|
3181
|
+
return n = n.setSelection(r), n = Ga(n, t, e), n.docChanged ? (a == null || a(n), !0) : !1;
|
|
3187
3182
|
};
|
|
3188
3183
|
}
|
|
3189
|
-
const
|
|
3184
|
+
const Xa = z.create({
|
|
3190
3185
|
name: "tableCellBackground",
|
|
3191
3186
|
addOptions() {
|
|
3192
3187
|
return {
|
|
@@ -3211,21 +3206,21 @@ const Za = z.create({
|
|
|
3211
3206
|
},
|
|
3212
3207
|
addCommands() {
|
|
3213
3208
|
return {
|
|
3214
|
-
setTableCellBackground: (e) =>
|
|
3215
|
-
unsetTableCellBackground: () =>
|
|
3209
|
+
setTableCellBackground: (e) => Nt(e, this.options),
|
|
3210
|
+
unsetTableCellBackground: () => Nt("", this.options)
|
|
3216
3211
|
};
|
|
3217
3212
|
}
|
|
3218
|
-
}),
|
|
3219
|
-
function
|
|
3213
|
+
}), Ya = /(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, Za = /CrOS/, Ja = /android|ipad|playbook|silk/i;
|
|
3214
|
+
function Lt(e = {}) {
|
|
3220
3215
|
let t = e.ua || typeof navigator < "u" && navigator.userAgent;
|
|
3221
|
-
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(
|
|
3216
|
+
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(Ya.test(t) && !Za.test(t) || e.tablet && Ja.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
|
|
3222
3217
|
}
|
|
3223
|
-
const
|
|
3224
|
-
function
|
|
3218
|
+
const St = (e) => Array.from({ length: e }).map((t, n) => n + 1);
|
|
3219
|
+
function Qa(e) {
|
|
3225
3220
|
var d;
|
|
3226
3221
|
const [t, n] = v(!0), [i, a] = v({
|
|
3227
|
-
rows:
|
|
3228
|
-
cols:
|
|
3222
|
+
rows: Lt() ? Ie : ze,
|
|
3223
|
+
cols: Lt() ? Ie : ze
|
|
3229
3224
|
}), [r, s] = v({
|
|
3230
3225
|
rows: He,
|
|
3231
3226
|
cols: He
|
|
@@ -3263,13 +3258,13 @@ function to(e) {
|
|
|
3263
3258
|
className: "richtext-w-full !richtext-p-2",
|
|
3264
3259
|
side: "bottom",
|
|
3265
3260
|
children: /* @__PURE__ */ m("div", { className: "table-grid-size-editor richtext-p-0", children: [
|
|
3266
|
-
/* @__PURE__ */ o("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (d =
|
|
3261
|
+
/* @__PURE__ */ o("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (d = St(i == null ? void 0 : i.rows)) == null ? void 0 : d.map((g) => {
|
|
3267
3262
|
var h;
|
|
3268
3263
|
return /* @__PURE__ */ o(
|
|
3269
3264
|
"div",
|
|
3270
3265
|
{
|
|
3271
3266
|
className: "richtext-flex richtext-gap-1",
|
|
3272
|
-
children: (h =
|
|
3267
|
+
children: (h = St(i == null ? void 0 : i.cols)) == null ? void 0 : h.map((f) => /* @__PURE__ */ o(
|
|
3273
3268
|
"div",
|
|
3274
3269
|
{
|
|
3275
3270
|
onMouseDown: () => l(g, f),
|
|
@@ -3294,11 +3289,11 @@ function to(e) {
|
|
|
3294
3289
|
)
|
|
3295
3290
|
] });
|
|
3296
3291
|
}
|
|
3297
|
-
function
|
|
3292
|
+
function eo(e) {
|
|
3298
3293
|
function t(n) {
|
|
3299
3294
|
e.disabled || e.editor.chain().focus().insertTable({ ...n, withHeaderRow: !1 }).run();
|
|
3300
3295
|
}
|
|
3301
|
-
return /* @__PURE__ */ o(
|
|
3296
|
+
return /* @__PURE__ */ o(Qa, { createTable: t, children: /* @__PURE__ */ o(
|
|
3302
3297
|
y,
|
|
3303
3298
|
{
|
|
3304
3299
|
icon: e == null ? void 0 : e.icon,
|
|
@@ -3310,7 +3305,7 @@ function no(e) {
|
|
|
3310
3305
|
}
|
|
3311
3306
|
) });
|
|
3312
3307
|
}
|
|
3313
|
-
const
|
|
3308
|
+
const Jr = $n.extend({
|
|
3314
3309
|
addOptions() {
|
|
3315
3310
|
var e;
|
|
3316
3311
|
return {
|
|
@@ -3319,7 +3314,7 @@ const ns = Fn.extend({
|
|
|
3319
3314
|
lastColumnResizable: !0,
|
|
3320
3315
|
allowTableNodeSelection: !1,
|
|
3321
3316
|
button: ({ editor: t, t: n }) => ({
|
|
3322
|
-
component:
|
|
3317
|
+
component: eo,
|
|
3323
3318
|
componentProps: {
|
|
3324
3319
|
disabled: t.isActive("table") || !1,
|
|
3325
3320
|
icon: "Table",
|
|
@@ -3331,13 +3326,13 @@ const ns = Fn.extend({
|
|
|
3331
3326
|
},
|
|
3332
3327
|
addExtensions() {
|
|
3333
3328
|
return [
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3329
|
+
Fn.configure(this.options.tableRow),
|
|
3330
|
+
jn.configure(this.options.tableHeader),
|
|
3331
|
+
Un.configure(this.options.tableCell),
|
|
3332
|
+
Xa.configure(this.options.tableCellBackground)
|
|
3338
3333
|
];
|
|
3339
3334
|
}
|
|
3340
|
-
}),
|
|
3335
|
+
}), Qr = z.create({
|
|
3341
3336
|
name: "painter",
|
|
3342
3337
|
addOptions() {
|
|
3343
3338
|
var e;
|
|
@@ -3406,14 +3401,14 @@ const ns = Fn.extend({
|
|
|
3406
3401
|
];
|
|
3407
3402
|
}
|
|
3408
3403
|
});
|
|
3409
|
-
function
|
|
3404
|
+
function to(e, t = "{}") {
|
|
3410
3405
|
try {
|
|
3411
3406
|
return JSON.stringify(e);
|
|
3412
3407
|
} catch {
|
|
3413
3408
|
return t;
|
|
3414
3409
|
}
|
|
3415
3410
|
}
|
|
3416
|
-
function
|
|
3411
|
+
function no({ editor: e, ...t }) {
|
|
3417
3412
|
const { t: n } = $(), [i, a] = v(-1), [r, s] = v([]), [c, l] = v(""), [u, d] = v(""), [g, h] = v(!1), [f, b] = v(!1);
|
|
3418
3413
|
return R(() => {
|
|
3419
3414
|
g || (l(""), d(""), a(-1), s([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
|
|
@@ -3424,17 +3419,17 @@ function ao({ editor: e, ...t }) {
|
|
|
3424
3419
|
}, [g, u, e]), R(() => {
|
|
3425
3420
|
if (!e)
|
|
3426
3421
|
return;
|
|
3427
|
-
const
|
|
3428
|
-
if (!
|
|
3422
|
+
const x = e.extensionManager.extensions.find((I) => I.name === so.name);
|
|
3423
|
+
if (!x)
|
|
3429
3424
|
return;
|
|
3430
3425
|
const N = () => {
|
|
3431
3426
|
if (!g)
|
|
3432
3427
|
return;
|
|
3433
|
-
const I =
|
|
3434
|
-
a((_) => _ !== I ? I : _), s((_) =>
|
|
3428
|
+
const I = x ? x.storage.currentIndex : -1, w = x ? x.storage.results : [];
|
|
3429
|
+
a((_) => _ !== I ? I : _), s((_) => Xn(_, w) ? _ : w);
|
|
3435
3430
|
};
|
|
3436
3431
|
return window.addEventListener(Qe, N), () => {
|
|
3437
|
-
|
|
3432
|
+
x && window.removeEventListener(Qe, N);
|
|
3438
3433
|
};
|
|
3439
3434
|
}, [g, e]), /* @__PURE__ */ m(
|
|
3440
3435
|
ye,
|
|
@@ -3467,7 +3462,7 @@ function ao({ editor: e, ...t }) {
|
|
|
3467
3462
|
side: "bottom",
|
|
3468
3463
|
children: [
|
|
3469
3464
|
/* @__PURE__ */ m("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
|
|
3470
|
-
/* @__PURE__ */ o(
|
|
3465
|
+
/* @__PURE__ */ o(De, { children: n("editor.search.dialog.text") }),
|
|
3471
3466
|
/* @__PURE__ */ o("span", { className: "richtext-font-semibold", children: r.length > 0 ? `${i + 1}/${r.length}` : "0/0" })
|
|
3472
3467
|
] }),
|
|
3473
3468
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]", children: [
|
|
@@ -3480,13 +3475,13 @@ function ao({ editor: e, ...t }) {
|
|
|
3480
3475
|
placeholder: "Text",
|
|
3481
3476
|
autoFocus: !0,
|
|
3482
3477
|
value: c,
|
|
3483
|
-
onChange: (
|
|
3478
|
+
onChange: (x) => l(x.target.value)
|
|
3484
3479
|
}
|
|
3485
3480
|
),
|
|
3486
|
-
/* @__PURE__ */ o(
|
|
3487
|
-
/* @__PURE__ */ o(
|
|
3481
|
+
/* @__PURE__ */ o(D, { disabled: r.length === 0, className: "richtext-flex-1", onClick: e.commands.goToPrevSearchResult, children: /* @__PURE__ */ o(O, { name: "ChevronUp" }) }),
|
|
3482
|
+
/* @__PURE__ */ o(D, { disabled: r.length === 0, className: "richtext-flex-1", onClick: e.commands.goToNextSearchResult, children: /* @__PURE__ */ o(O, { name: "ChevronDown" }) })
|
|
3488
3483
|
] }),
|
|
3489
|
-
/* @__PURE__ */ o(
|
|
3484
|
+
/* @__PURE__ */ o(De, { className: "richtext-mb-[6px]", children: n("editor.replace.dialog.text") }),
|
|
3490
3485
|
/* @__PURE__ */ o("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[5px]", children: /* @__PURE__ */ o("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ o(
|
|
3491
3486
|
Be,
|
|
3492
3487
|
{
|
|
@@ -3495,24 +3490,24 @@ function ao({ editor: e, ...t }) {
|
|
|
3495
3490
|
className: "richtext-w-80",
|
|
3496
3491
|
placeholder: "Text",
|
|
3497
3492
|
value: u,
|
|
3498
|
-
onChange: (
|
|
3493
|
+
onChange: (x) => d(x.target.value)
|
|
3499
3494
|
}
|
|
3500
3495
|
) }) }),
|
|
3501
3496
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-space-x-2 richtext-mb-[10px]", children: [
|
|
3502
3497
|
/* @__PURE__ */ o(
|
|
3503
|
-
|
|
3498
|
+
yi,
|
|
3504
3499
|
{
|
|
3505
3500
|
checked: f,
|
|
3506
|
-
onCheckedChange: (
|
|
3507
|
-
b(
|
|
3501
|
+
onCheckedChange: (x) => {
|
|
3502
|
+
b(x), e.commands.setCaseSensitive(x);
|
|
3508
3503
|
}
|
|
3509
3504
|
}
|
|
3510
3505
|
),
|
|
3511
|
-
/* @__PURE__ */ o(
|
|
3506
|
+
/* @__PURE__ */ o(De, { children: n("editor.replace.caseSensitive") })
|
|
3512
3507
|
] }),
|
|
3513
3508
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
3514
|
-
/* @__PURE__ */ o(
|
|
3515
|
-
/* @__PURE__ */ o(
|
|
3509
|
+
/* @__PURE__ */ o(D, { disabled: r.length === 0, className: "richtext-flex-1", onClick: e.commands.replace, children: n("editor.replace.dialog.text") }),
|
|
3510
|
+
/* @__PURE__ */ o(D, { disabled: r.length === 0, className: "richtext-flex-1", onClick: e.commands.replaceAll, children: n("editor.replaceAll.dialog.text") })
|
|
3516
3511
|
] })
|
|
3517
3512
|
]
|
|
3518
3513
|
}
|
|
@@ -3522,10 +3517,10 @@ function ao({ editor: e, ...t }) {
|
|
|
3522
3517
|
);
|
|
3523
3518
|
}
|
|
3524
3519
|
const Te = (e, t) => t(e.tr);
|
|
3525
|
-
function
|
|
3520
|
+
function io(e, t, n) {
|
|
3526
3521
|
return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e, n ? "gu" : "gui");
|
|
3527
3522
|
}
|
|
3528
|
-
function
|
|
3523
|
+
function ao(e, t, n) {
|
|
3529
3524
|
const i = [];
|
|
3530
3525
|
let a = [];
|
|
3531
3526
|
const r = [];
|
|
@@ -3559,13 +3554,13 @@ function ro(e, t, n) {
|
|
|
3559
3554
|
results: r
|
|
3560
3555
|
};
|
|
3561
3556
|
}
|
|
3562
|
-
function
|
|
3557
|
+
function Mt(e, t, { state: n, dispatch: i }) {
|
|
3563
3558
|
if (!t[0])
|
|
3564
3559
|
return;
|
|
3565
3560
|
const { from: r, to: s } = t[0];
|
|
3566
3561
|
i && i(n.tr.insertText(e, r, s));
|
|
3567
3562
|
}
|
|
3568
|
-
function
|
|
3563
|
+
function oo(e, t, n, i) {
|
|
3569
3564
|
const a = t + 1;
|
|
3570
3565
|
if (!i[a])
|
|
3571
3566
|
return null;
|
|
@@ -3575,19 +3570,19 @@ function so(e, t, n, i) {
|
|
|
3575
3570
|
from: l - c
|
|
3576
3571
|
}, [c, i];
|
|
3577
3572
|
}
|
|
3578
|
-
function
|
|
3573
|
+
function ro(e, t, { tr: n, dispatch: i }) {
|
|
3579
3574
|
let a = 0, r = t.slice();
|
|
3580
3575
|
if (r.length === 0)
|
|
3581
3576
|
return !1;
|
|
3582
3577
|
for (let s = 0; s < r.length; s += 1) {
|
|
3583
3578
|
const { from: c, to: l } = r[s];
|
|
3584
3579
|
n.insertText(e, c, l);
|
|
3585
|
-
const u =
|
|
3580
|
+
const u = oo(e, s, a, r);
|
|
3586
3581
|
u && (a = u[0], r = u[1]);
|
|
3587
3582
|
}
|
|
3588
3583
|
return i(n), !0;
|
|
3589
3584
|
}
|
|
3590
|
-
function
|
|
3585
|
+
function It({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, gotoIndex: a }) {
|
|
3591
3586
|
const r = n[a];
|
|
3592
3587
|
if (r) {
|
|
3593
3588
|
const s = t.setMeta("directDecoration", {
|
|
@@ -3602,7 +3597,7 @@ function zt({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, got
|
|
|
3602
3597
|
}
|
|
3603
3598
|
return !1;
|
|
3604
3599
|
}
|
|
3605
|
-
const Qe = "ON_SEARCH_RESULTS", le = new CustomEvent(Qe),
|
|
3600
|
+
const Qe = "ON_SEARCH_RESULTS", le = new CustomEvent(Qe), so = z.create({
|
|
3606
3601
|
name: "search",
|
|
3607
3602
|
addOptions() {
|
|
3608
3603
|
var e;
|
|
@@ -3619,7 +3614,7 @@ const Qe = "ON_SEARCH_RESULTS", le = new CustomEvent(Qe), lo = z.create({
|
|
|
3619
3614
|
onChange: () => {
|
|
3620
3615
|
},
|
|
3621
3616
|
button: ({ editor: t, t: n }) => ({
|
|
3622
|
-
component:
|
|
3617
|
+
component: no,
|
|
3623
3618
|
componentProps: {
|
|
3624
3619
|
action: () => {
|
|
3625
3620
|
},
|
|
@@ -3645,15 +3640,15 @@ const Qe = "ON_SEARCH_RESULTS", le = new CustomEvent(Qe), lo = z.create({
|
|
|
3645
3640
|
setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, Te(t, n), !1),
|
|
3646
3641
|
replace: () => ({ state: e, dispatch: t }) => {
|
|
3647
3642
|
const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage, r = a[i];
|
|
3648
|
-
return r ? (
|
|
3643
|
+
return r ? (Mt(n, [r], { state: e, dispatch: t }), this.storage.results.splice(i, 1)) : (Mt(n, a, { state: e, dispatch: t }), this.storage.results.shift()), window.dispatchEvent(le), Te(e, t), !1;
|
|
3649
3644
|
},
|
|
3650
3645
|
replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
|
|
3651
3646
|
const { replaceTerm: i } = this.options, { results: a } = this.storage;
|
|
3652
|
-
return
|
|
3647
|
+
return ro(i, a, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], window.dispatchEvent(le), Te(e, n), !1;
|
|
3653
3648
|
},
|
|
3654
3649
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
3655
3650
|
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, r = (i + a.length - 1) % a.length;
|
|
3656
|
-
return this.storage.currentIndex = r, window.dispatchEvent(le),
|
|
3651
|
+
return this.storage.currentIndex = r, window.dispatchEvent(le), It({
|
|
3657
3652
|
view: e,
|
|
3658
3653
|
tr: t,
|
|
3659
3654
|
searchResults: a,
|
|
@@ -3663,7 +3658,7 @@ const Qe = "ON_SEARCH_RESULTS", le = new CustomEvent(Qe), lo = z.create({
|
|
|
3663
3658
|
},
|
|
3664
3659
|
goToNextSearchResult: () => ({ view: e, tr: t }) => {
|
|
3665
3660
|
const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, r = (i + 1) % a.length;
|
|
3666
|
-
return this.storage.currentIndex = r, this.options.onChange && this.options.onChange(), window.dispatchEvent(le),
|
|
3661
|
+
return this.storage.currentIndex = r, this.options.onChange && this.options.onChange(), window.dispatchEvent(le), It({
|
|
3667
3662
|
view: e,
|
|
3668
3663
|
tr: t,
|
|
3669
3664
|
searchResults: a,
|
|
@@ -3685,9 +3680,9 @@ const Qe = "ON_SEARCH_RESULTS", le = new CustomEvent(Qe), lo = z.create({
|
|
|
3685
3680
|
apply(t) {
|
|
3686
3681
|
const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: r, searchResultCurrentClass: s, disableRegex: c, caseSensitive: l } = e.options;
|
|
3687
3682
|
if (i || a) {
|
|
3688
|
-
const { decorationsToReturn: u, results: d } =
|
|
3683
|
+
const { decorationsToReturn: u, results: d } = ao(
|
|
3689
3684
|
n,
|
|
3690
|
-
|
|
3685
|
+
io(a, c, l),
|
|
3691
3686
|
r
|
|
3692
3687
|
);
|
|
3693
3688
|
if (e.storage.results = d, e.storage.currentIndex > d.length - 1 && (e.storage.currentIndex = 0), window.dispatchEvent(le), t.getMeta("directDecoration")) {
|
|
@@ -3711,7 +3706,7 @@ const Qe = "ON_SEARCH_RESULTS", le = new CustomEvent(Qe), lo = z.create({
|
|
|
3711
3706
|
];
|
|
3712
3707
|
}
|
|
3713
3708
|
});
|
|
3714
|
-
function
|
|
3709
|
+
function co() {
|
|
3715
3710
|
return /* @__PURE__ */ o(
|
|
3716
3711
|
"svg",
|
|
3717
3712
|
{
|
|
@@ -3729,7 +3724,7 @@ function uo() {
|
|
|
3729
3724
|
}
|
|
3730
3725
|
);
|
|
3731
3726
|
}
|
|
3732
|
-
function
|
|
3727
|
+
function lo() {
|
|
3733
3728
|
return /* @__PURE__ */ m(
|
|
3734
3729
|
"svg",
|
|
3735
3730
|
{
|
|
@@ -3756,7 +3751,7 @@ function ho() {
|
|
|
3756
3751
|
}
|
|
3757
3752
|
);
|
|
3758
3753
|
}
|
|
3759
|
-
function
|
|
3754
|
+
function uo() {
|
|
3760
3755
|
return /* @__PURE__ */ o(
|
|
3761
3756
|
"svg",
|
|
3762
3757
|
{
|
|
@@ -3774,7 +3769,7 @@ function mo() {
|
|
|
3774
3769
|
}
|
|
3775
3770
|
);
|
|
3776
3771
|
}
|
|
3777
|
-
function
|
|
3772
|
+
function ho() {
|
|
3778
3773
|
return /* @__PURE__ */ o(
|
|
3779
3774
|
"svg",
|
|
3780
3775
|
{
|
|
@@ -3792,7 +3787,7 @@ function fo() {
|
|
|
3792
3787
|
}
|
|
3793
3788
|
);
|
|
3794
3789
|
}
|
|
3795
|
-
function
|
|
3790
|
+
function mo() {
|
|
3796
3791
|
return /* @__PURE__ */ m(
|
|
3797
3792
|
"svg",
|
|
3798
3793
|
{
|
|
@@ -3819,7 +3814,7 @@ function go() {
|
|
|
3819
3814
|
}
|
|
3820
3815
|
);
|
|
3821
3816
|
}
|
|
3822
|
-
function
|
|
3817
|
+
function fo() {
|
|
3823
3818
|
return /* @__PURE__ */ o(
|
|
3824
3819
|
"svg",
|
|
3825
3820
|
{
|
|
@@ -3837,7 +3832,7 @@ function _o() {
|
|
|
3837
3832
|
}
|
|
3838
3833
|
);
|
|
3839
3834
|
}
|
|
3840
|
-
function
|
|
3835
|
+
function go() {
|
|
3841
3836
|
return /* @__PURE__ */ m(
|
|
3842
3837
|
"svg",
|
|
3843
3838
|
{
|
|
@@ -3864,7 +3859,7 @@ function bo() {
|
|
|
3864
3859
|
}
|
|
3865
3860
|
);
|
|
3866
3861
|
}
|
|
3867
|
-
function
|
|
3862
|
+
function _o(e, t = null) {
|
|
3868
3863
|
if (typeof window > "u")
|
|
3869
3864
|
throw new Error();
|
|
3870
3865
|
const n = localStorage.getItem(e);
|
|
@@ -3876,7 +3871,7 @@ function po(e, t = null) {
|
|
|
3876
3871
|
return n;
|
|
3877
3872
|
}
|
|
3878
3873
|
}
|
|
3879
|
-
function
|
|
3874
|
+
function bo(e, t) {
|
|
3880
3875
|
window.localStorage.setItem(e, `${t}`);
|
|
3881
3876
|
}
|
|
3882
3877
|
class Ge {
|
|
@@ -3888,7 +3883,7 @@ class Ge {
|
|
|
3888
3883
|
this.key = t, this.value = n, this.prev = null, this.next = null;
|
|
3889
3884
|
}
|
|
3890
3885
|
}
|
|
3891
|
-
class
|
|
3886
|
+
class xo {
|
|
3892
3887
|
constructor(t) {
|
|
3893
3888
|
G(this, "capacity");
|
|
3894
3889
|
G(this, "usedCapacity");
|
|
@@ -3947,16 +3942,16 @@ class wo {
|
|
|
3947
3942
|
return this.store;
|
|
3948
3943
|
}
|
|
3949
3944
|
}
|
|
3950
|
-
function
|
|
3951
|
-
const n = new
|
|
3945
|
+
function po(e, t) {
|
|
3946
|
+
const n = new xo(t);
|
|
3952
3947
|
return {
|
|
3953
3948
|
syncFromStorage() {
|
|
3954
|
-
(
|
|
3949
|
+
(_o(e) || []).slice().reverse().forEach((r) => {
|
|
3955
3950
|
n.put(r, r);
|
|
3956
3951
|
});
|
|
3957
3952
|
},
|
|
3958
3953
|
syncToStorage() {
|
|
3959
|
-
|
|
3954
|
+
bo(e, to(n.keys()));
|
|
3960
3955
|
},
|
|
3961
3956
|
put(a) {
|
|
3962
3957
|
n.put(a, a), this.syncToStorage();
|
|
@@ -3966,7 +3961,7 @@ function yo(e, t) {
|
|
|
3966
3961
|
}
|
|
3967
3962
|
};
|
|
3968
3963
|
}
|
|
3969
|
-
const
|
|
3964
|
+
const wo = [
|
|
3970
3965
|
"😀",
|
|
3971
3966
|
"😃",
|
|
3972
3967
|
"😄",
|
|
@@ -4180,7 +4175,7 @@ const vo = [
|
|
|
4180
4175
|
"🗯",
|
|
4181
4176
|
"💭",
|
|
4182
4177
|
"💤"
|
|
4183
|
-
],
|
|
4178
|
+
], yo = [
|
|
4184
4179
|
"🏧",
|
|
4185
4180
|
"🚮",
|
|
4186
4181
|
"🚰",
|
|
@@ -4482,7 +4477,7 @@ const vo = [
|
|
|
4482
4477
|
"🔘",
|
|
4483
4478
|
"🔳",
|
|
4484
4479
|
"🔲"
|
|
4485
|
-
],
|
|
4480
|
+
], vo = [
|
|
4486
4481
|
"👓",
|
|
4487
4482
|
"🕶️",
|
|
4488
4483
|
"🕶",
|
|
@@ -4782,7 +4777,7 @@ const vo = [
|
|
|
4782
4777
|
"⚱",
|
|
4783
4778
|
"🗿",
|
|
4784
4779
|
"🪧"
|
|
4785
|
-
],
|
|
4780
|
+
], ko = [
|
|
4786
4781
|
"🎃",
|
|
4787
4782
|
"🎄",
|
|
4788
4783
|
"🎆",
|
|
@@ -4878,7 +4873,7 @@ const vo = [
|
|
|
4878
4873
|
"🪡",
|
|
4879
4874
|
"🧶",
|
|
4880
4875
|
"🪢"
|
|
4881
|
-
],
|
|
4876
|
+
], Co = [
|
|
4882
4877
|
"🌍",
|
|
4883
4878
|
"🌎",
|
|
4884
4879
|
"🌏",
|
|
@@ -5143,7 +5138,7 @@ const vo = [
|
|
|
5143
5138
|
"🔥",
|
|
5144
5139
|
"💧",
|
|
5145
5140
|
"🌊"
|
|
5146
|
-
],
|
|
5141
|
+
], To = [
|
|
5147
5142
|
"🏁",
|
|
5148
5143
|
"🚩",
|
|
5149
5144
|
"🎌",
|
|
@@ -5419,7 +5414,7 @@ const vo = [
|
|
|
5419
5414
|
"🏴",
|
|
5420
5415
|
"🏴",
|
|
5421
5416
|
"🏴"
|
|
5422
|
-
],
|
|
5417
|
+
], Ao = [
|
|
5423
5418
|
"🐵",
|
|
5424
5419
|
"🐒",
|
|
5425
5420
|
"🦍",
|
|
@@ -5567,7 +5562,7 @@ const vo = [
|
|
|
5567
5562
|
"🍁",
|
|
5568
5563
|
"🍂",
|
|
5569
5564
|
"🍃"
|
|
5570
|
-
],
|
|
5565
|
+
], No = [
|
|
5571
5566
|
"🍇",
|
|
5572
5567
|
"🍈",
|
|
5573
5568
|
"🍉",
|
|
@@ -5699,53 +5694,53 @@ const vo = [
|
|
|
5699
5694
|
"🥄",
|
|
5700
5695
|
"🔪",
|
|
5701
5696
|
"🏺"
|
|
5702
|
-
], de =
|
|
5697
|
+
], de = po("EMOJI_PICKER", 20), zt = [
|
|
5703
5698
|
{
|
|
5704
5699
|
title: "Smileys & People",
|
|
5705
|
-
data:
|
|
5706
|
-
icon:
|
|
5700
|
+
data: wo,
|
|
5701
|
+
icon: ti
|
|
5707
5702
|
},
|
|
5708
5703
|
{
|
|
5709
5704
|
title: "Animals & Nature",
|
|
5710
|
-
data:
|
|
5711
|
-
icon:
|
|
5705
|
+
data: Ao,
|
|
5706
|
+
icon: lo
|
|
5712
5707
|
},
|
|
5713
5708
|
{
|
|
5714
5709
|
title: "Food & Drink",
|
|
5715
|
-
data:
|
|
5716
|
-
icon:
|
|
5710
|
+
data: No,
|
|
5711
|
+
icon: ho
|
|
5717
5712
|
},
|
|
5718
5713
|
{
|
|
5719
5714
|
title: "Activity",
|
|
5720
|
-
data:
|
|
5721
|
-
icon:
|
|
5715
|
+
data: ko,
|
|
5716
|
+
icon: co
|
|
5722
5717
|
},
|
|
5723
5718
|
{
|
|
5724
5719
|
title: "Travel & Places",
|
|
5725
|
-
data:
|
|
5726
|
-
icon:
|
|
5720
|
+
data: Co,
|
|
5721
|
+
icon: go
|
|
5727
5722
|
},
|
|
5728
5723
|
{
|
|
5729
5724
|
title: "Object",
|
|
5730
|
-
data:
|
|
5731
|
-
icon:
|
|
5725
|
+
data: vo,
|
|
5726
|
+
icon: mo
|
|
5732
5727
|
},
|
|
5733
5728
|
{
|
|
5734
5729
|
title: "Symbol",
|
|
5735
|
-
data:
|
|
5736
|
-
icon:
|
|
5730
|
+
data: yo,
|
|
5731
|
+
icon: fo
|
|
5737
5732
|
},
|
|
5738
5733
|
{
|
|
5739
5734
|
title: "Flags",
|
|
5740
|
-
data:
|
|
5741
|
-
icon:
|
|
5735
|
+
data: To,
|
|
5736
|
+
icon: uo
|
|
5742
5737
|
}
|
|
5743
|
-
],
|
|
5744
|
-
function
|
|
5738
|
+
], Lo = ["😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣"];
|
|
5739
|
+
function So({ onSelectEmoji: e, children: t }) {
|
|
5745
5740
|
const [n, i] = v([]), { t: a } = $(), r = E(
|
|
5746
|
-
() => n.length > 0 ? [{ title: "Frequently used", icon:
|
|
5741
|
+
() => n.length > 0 ? [{ title: "Frequently used", icon: ei, data: n }, ...zt] : zt,
|
|
5747
5742
|
[n]
|
|
5748
|
-
), s =
|
|
5743
|
+
), s = P(
|
|
5749
5744
|
(c) => {
|
|
5750
5745
|
de.put(c), i(de.get()), e && e(c);
|
|
5751
5746
|
},
|
|
@@ -5754,7 +5749,7 @@ function Io({ onSelectEmoji: e, children: t }) {
|
|
|
5754
5749
|
return R(() => {
|
|
5755
5750
|
de.syncFromStorage();
|
|
5756
5751
|
const c = de.get();
|
|
5757
|
-
c != null && c.length ||
|
|
5752
|
+
c != null && c.length || Lo.forEach((u) => {
|
|
5758
5753
|
de.put(u);
|
|
5759
5754
|
});
|
|
5760
5755
|
const l = de.get();
|
|
@@ -5779,7 +5774,7 @@ function Io({ onSelectEmoji: e, children: t }) {
|
|
|
5779
5774
|
`emoji-picker-title-${c.title}`
|
|
5780
5775
|
)) }),
|
|
5781
5776
|
r.map((c) => /* @__PURE__ */ m(
|
|
5782
|
-
|
|
5777
|
+
xe,
|
|
5783
5778
|
{
|
|
5784
5779
|
value: c.title,
|
|
5785
5780
|
children: [
|
|
@@ -5802,15 +5797,15 @@ function Io({ onSelectEmoji: e, children: t }) {
|
|
|
5802
5797
|
)
|
|
5803
5798
|
] });
|
|
5804
5799
|
}
|
|
5805
|
-
function
|
|
5806
|
-
const i =
|
|
5800
|
+
function Mo({ editor: e, icon: t, ...n }) {
|
|
5801
|
+
const i = P(
|
|
5807
5802
|
(a) => {
|
|
5808
5803
|
const { selection: r } = e.state, { $anchor: s } = r;
|
|
5809
5804
|
return e.chain().insertContentAt(s.pos, a).run();
|
|
5810
5805
|
},
|
|
5811
5806
|
[e]
|
|
5812
5807
|
);
|
|
5813
|
-
return /* @__PURE__ */ o(
|
|
5808
|
+
return /* @__PURE__ */ o(So, { onSelectEmoji: i, children: /* @__PURE__ */ o(
|
|
5814
5809
|
y,
|
|
5815
5810
|
{
|
|
5816
5811
|
icon: t,
|
|
@@ -5818,7 +5813,7 @@ function zo({ editor: e, icon: t, ...n }) {
|
|
|
5818
5813
|
}
|
|
5819
5814
|
) });
|
|
5820
5815
|
}
|
|
5821
|
-
const
|
|
5816
|
+
const tn = nt((e, t) => {
|
|
5822
5817
|
const n = Y(null), [i, a] = v(0), { t: r } = $(), s = (d) => {
|
|
5823
5818
|
const g = e.items[d];
|
|
5824
5819
|
g && e.command(g);
|
|
@@ -5857,8 +5852,8 @@ const nn = nt((e, t) => {
|
|
|
5857
5852
|
`emoji-list-code-${g}`
|
|
5858
5853
|
)) : /* @__PURE__ */ o("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__ */ o("span", { children: r("no_result_found") }) }) }) });
|
|
5859
5854
|
});
|
|
5860
|
-
|
|
5861
|
-
const
|
|
5855
|
+
tn.displayName = "EmojiList";
|
|
5856
|
+
const pe = {
|
|
5862
5857
|
100: "💯",
|
|
5863
5858
|
1234: "🔢",
|
|
5864
5859
|
grinning: "😀",
|
|
@@ -7698,22 +7693,22 @@ const xe = {
|
|
|
7698
7693
|
scotland: "🏴",
|
|
7699
7694
|
wales: "🏴"
|
|
7700
7695
|
};
|
|
7701
|
-
Object.keys(
|
|
7702
|
-
const n =
|
|
7696
|
+
Object.keys(pe).reduce((e, t) => {
|
|
7697
|
+
const n = pe[t];
|
|
7703
7698
|
return e[n] = t, e;
|
|
7704
7699
|
}, {});
|
|
7705
|
-
const
|
|
7706
|
-
Object.keys(
|
|
7707
|
-
function
|
|
7708
|
-
return
|
|
7700
|
+
const Io = Object.keys(pe).map((e) => e);
|
|
7701
|
+
Object.keys(pe).map((e) => pe[e]);
|
|
7702
|
+
function zo(e) {
|
|
7703
|
+
return Io.filter((t) => t.startsWith(e)).map((t) => ({
|
|
7709
7704
|
name: t,
|
|
7710
|
-
emoji:
|
|
7705
|
+
emoji: pe[t]
|
|
7711
7706
|
}));
|
|
7712
7707
|
}
|
|
7713
|
-
const
|
|
7708
|
+
const Ho = 200, Eo = new ee("emoji"), es = Le.create({
|
|
7714
7709
|
name: "emoji",
|
|
7715
7710
|
content: "text*",
|
|
7716
|
-
priority:
|
|
7711
|
+
priority: Ho,
|
|
7717
7712
|
addOptions() {
|
|
7718
7713
|
var e;
|
|
7719
7714
|
return {
|
|
@@ -7721,13 +7716,13 @@ const Ro = 200, Oo = new ee("emoji"), as = Le.create({
|
|
|
7721
7716
|
HTMLAttributes: {},
|
|
7722
7717
|
suggestion: {
|
|
7723
7718
|
char: ":",
|
|
7724
|
-
pluginKey:
|
|
7719
|
+
pluginKey: Eo,
|
|
7725
7720
|
command: ({ editor: t, range: n, props: i }) => {
|
|
7726
7721
|
t.chain().focus().insertContentAt(n, `${i.emoji} `).run();
|
|
7727
7722
|
}
|
|
7728
7723
|
},
|
|
7729
7724
|
button: ({ editor: t, t: n }) => ({
|
|
7730
|
-
component:
|
|
7725
|
+
component: Mo,
|
|
7731
7726
|
componentProps: {
|
|
7732
7727
|
editor: t,
|
|
7733
7728
|
action: () => {
|
|
@@ -7747,7 +7742,7 @@ const Ro = 200, Oo = new ee("emoji"), as = Le.create({
|
|
|
7747
7742
|
},
|
|
7748
7743
|
addProseMirrorPlugins() {
|
|
7749
7744
|
return [
|
|
7750
|
-
|
|
7745
|
+
Rt({
|
|
7751
7746
|
editor: this.editor,
|
|
7752
7747
|
...this.options.suggestion
|
|
7753
7748
|
})
|
|
@@ -7755,12 +7750,12 @@ const Ro = 200, Oo = new ee("emoji"), as = Le.create({
|
|
|
7755
7750
|
}
|
|
7756
7751
|
}).configure({
|
|
7757
7752
|
suggestion: {
|
|
7758
|
-
items: ({ query: e }) =>
|
|
7753
|
+
items: ({ query: e }) => zo(e),
|
|
7759
7754
|
render: () => {
|
|
7760
7755
|
let e, t, n;
|
|
7761
7756
|
return {
|
|
7762
7757
|
onStart: (i) => {
|
|
7763
|
-
n = i.editor.isEditable, n && (e = new et(
|
|
7758
|
+
n = i.editor.isEditable, n && (e = new et(tn, {
|
|
7764
7759
|
props: i,
|
|
7765
7760
|
editor: i.editor
|
|
7766
7761
|
}), t = ft("body", {
|
|
@@ -7790,7 +7785,7 @@ const Ro = 200, Oo = new ee("emoji"), as = Le.create({
|
|
|
7790
7785
|
}
|
|
7791
7786
|
}
|
|
7792
7787
|
});
|
|
7793
|
-
function
|
|
7788
|
+
function Ro(e) {
|
|
7794
7789
|
const t = document.createElement("iframe");
|
|
7795
7790
|
t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
|
|
7796
7791
|
<!DOCTYPE html>
|
|
@@ -7827,11 +7822,11 @@ function Do(e) {
|
|
|
7827
7822
|
}, 100);
|
|
7828
7823
|
});
|
|
7829
7824
|
}
|
|
7830
|
-
function
|
|
7825
|
+
function Oo(e) {
|
|
7831
7826
|
const t = e.getHTML();
|
|
7832
|
-
return t ? (
|
|
7827
|
+
return t ? (Ro(t), !0) : !1;
|
|
7833
7828
|
}
|
|
7834
|
-
const
|
|
7829
|
+
const ts = z.create({
|
|
7835
7830
|
name: "exportPdf",
|
|
7836
7831
|
addOptions() {
|
|
7837
7832
|
var e;
|
|
@@ -7841,7 +7836,7 @@ const os = z.create({
|
|
|
7841
7836
|
component: y,
|
|
7842
7837
|
componentProps: {
|
|
7843
7838
|
action: () => {
|
|
7844
|
-
|
|
7839
|
+
Oo(t);
|
|
7845
7840
|
},
|
|
7846
7841
|
icon: "ExportPdf",
|
|
7847
7842
|
tooltip: n("editor.exportPdf.tooltip"),
|
|
@@ -7852,18 +7847,18 @@ const os = z.create({
|
|
|
7852
7847
|
};
|
|
7853
7848
|
}
|
|
7854
7849
|
});
|
|
7855
|
-
function
|
|
7850
|
+
function Po(e, t) {
|
|
7856
7851
|
const n = atob(e.split(",")[1]), i = Array.from({ length: n.length });
|
|
7857
7852
|
for (let r = 0; r < n.length; r++)
|
|
7858
7853
|
i[r] = n.charCodeAt(r);
|
|
7859
7854
|
const a = new Uint8Array(i);
|
|
7860
7855
|
return new Blob([a], { type: t });
|
|
7861
7856
|
}
|
|
7862
|
-
function
|
|
7857
|
+
function Do(e, t) {
|
|
7863
7858
|
return new File([e], t, { type: e.type });
|
|
7864
7859
|
}
|
|
7865
|
-
function
|
|
7866
|
-
const { toast: t } =
|
|
7860
|
+
function Bo(e) {
|
|
7861
|
+
const { toast: t } = vi(), { t: n } = $(), [i, a] = v(!1), r = Y(null);
|
|
7867
7862
|
function s() {
|
|
7868
7863
|
var g;
|
|
7869
7864
|
(g = r.current) == null || g.click();
|
|
@@ -7886,19 +7881,19 @@ function Fo(e) {
|
|
|
7886
7881
|
const f = new DOMParser().parseFromString(g, "text/html"), b = f.querySelectorAll("img");
|
|
7887
7882
|
if (b.length === 0)
|
|
7888
7883
|
return f.body.innerHTML;
|
|
7889
|
-
if (
|
|
7884
|
+
if (ki(e.editor, "image")) {
|
|
7890
7885
|
const I = (N = e.editor.extensionManager.extensions.find(
|
|
7891
7886
|
(w) => w.name === "importWord"
|
|
7892
7887
|
)) == null ? void 0 : N.options;
|
|
7893
7888
|
if (I && typeof I.upload == "function") {
|
|
7894
7889
|
const w = [];
|
|
7895
|
-
for (const
|
|
7896
|
-
const C =
|
|
7890
|
+
for (const p of b) {
|
|
7891
|
+
const C = p.getAttribute("src"), T = Po(C, "image/jpeg"), L = Do(T, "image.jpeg");
|
|
7897
7892
|
w.push(L);
|
|
7898
7893
|
}
|
|
7899
7894
|
const _ = await I.upload(w);
|
|
7900
|
-
for (const [
|
|
7901
|
-
C.setAttribute("src", _[
|
|
7895
|
+
for (const [p, C] of b.entries()) {
|
|
7896
|
+
C.setAttribute("src", _[p].src);
|
|
7902
7897
|
const T = C.parentElement;
|
|
7903
7898
|
(T == null ? void 0 : T.tagName) === "P" && (T.insertAdjacentElement("beforebegin", C), !T.hasChildNodes() && T.textContent === "" && T.remove());
|
|
7904
7899
|
}
|
|
@@ -7915,7 +7910,7 @@ function Fo(e) {
|
|
|
7915
7910
|
const h = await e.convert(g);
|
|
7916
7911
|
d(h);
|
|
7917
7912
|
} else {
|
|
7918
|
-
const h = await g.arrayBuffer(), { value: f } = await
|
|
7913
|
+
const h = await g.arrayBuffer(), { value: f } = await Yn.convertToHtml(
|
|
7919
7914
|
{ arrayBuffer: h },
|
|
7920
7915
|
e == null ? void 0 : e.mammothOptions
|
|
7921
7916
|
);
|
|
@@ -7954,7 +7949,7 @@ function Fo(e) {
|
|
|
7954
7949
|
)
|
|
7955
7950
|
] });
|
|
7956
7951
|
}
|
|
7957
|
-
const
|
|
7952
|
+
const ns = z.create({
|
|
7958
7953
|
name: "importWord",
|
|
7959
7954
|
addOptions() {
|
|
7960
7955
|
var e;
|
|
@@ -7967,7 +7962,7 @@ const rs = z.create({
|
|
|
7967
7962
|
button: ({ editor: t, extension: n, t: i }) => {
|
|
7968
7963
|
const { convert: a, limit: r, mammothOptions: s } = n.options;
|
|
7969
7964
|
return {
|
|
7970
|
-
component:
|
|
7965
|
+
component: Bo,
|
|
7971
7966
|
componentProps: {
|
|
7972
7967
|
editor: t,
|
|
7973
7968
|
convert: a,
|
|
@@ -7983,15 +7978,15 @@ const rs = z.create({
|
|
|
7983
7978
|
}
|
|
7984
7979
|
};
|
|
7985
7980
|
}
|
|
7986
|
-
}),
|
|
7987
|
-
function
|
|
7988
|
-
if (
|
|
7981
|
+
}), $o = typeof window < "u";
|
|
7982
|
+
function Fo(e, t) {
|
|
7983
|
+
if ($o) {
|
|
7989
7984
|
const n = window.URL.createObjectURL(e), i = document.createElement("a");
|
|
7990
7985
|
return i.href = n, i.download = t, i.click(), window.URL.revokeObjectURL(n), Promise.resolve();
|
|
7991
7986
|
}
|
|
7992
7987
|
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
7993
7988
|
}
|
|
7994
|
-
const
|
|
7989
|
+
const jo = {
|
|
7995
7990
|
...ie,
|
|
7996
7991
|
hardBreak: ie.hard_break,
|
|
7997
7992
|
codeBlock: ie.code_block,
|
|
@@ -8003,7 +7998,7 @@ const Vo = {
|
|
|
8003
7998
|
image(e, t) {
|
|
8004
7999
|
e.renderInline(t), e.closeBlock(t);
|
|
8005
8000
|
}
|
|
8006
|
-
},
|
|
8001
|
+
}, Uo = new Bi(jo, $i), is = z.create({
|
|
8007
8002
|
name: "exportWord",
|
|
8008
8003
|
addOptions() {
|
|
8009
8004
|
var e;
|
|
@@ -8032,18 +8027,18 @@ const Vo = {
|
|
|
8032
8027
|
const r = await (await fetch(i)).arrayBuffer();
|
|
8033
8028
|
return new Uint8Array(r);
|
|
8034
8029
|
}
|
|
8035
|
-
}, n =
|
|
8036
|
-
return
|
|
8030
|
+
}, n = Uo.serialize(e.state.doc, t);
|
|
8031
|
+
return Di.toBlob(n).then((i) => Fo(new Blob([i]), "export-document.docx")), !0;
|
|
8037
8032
|
}
|
|
8038
8033
|
};
|
|
8039
8034
|
}
|
|
8040
|
-
}),
|
|
8041
|
-
toc:
|
|
8042
|
-
visible:
|
|
8043
|
-
list:
|
|
8044
|
-
item:
|
|
8035
|
+
}), Vo = "_toc_aag8a_1", qo = "_visible_aag8a_7", Ko = "_list_aag8a_11", Wo = "_item_aag8a_16", Re = {
|
|
8036
|
+
toc: Vo,
|
|
8037
|
+
visible: qo,
|
|
8038
|
+
list: Ko,
|
|
8039
|
+
item: Wo
|
|
8045
8040
|
};
|
|
8046
|
-
function
|
|
8041
|
+
function Go(e) {
|
|
8047
8042
|
const t = [], n = [t];
|
|
8048
8043
|
return e.forEach((i) => {
|
|
8049
8044
|
let a = -1, r = n[i.level + a];
|
|
@@ -8052,8 +8047,8 @@ function Yo(e) {
|
|
|
8052
8047
|
r.push({ ...i, children: n[i.level] = [] });
|
|
8053
8048
|
}), t;
|
|
8054
8049
|
}
|
|
8055
|
-
function
|
|
8056
|
-
const t = st(), [n, i] = v([]), { t: a } = $(), r =
|
|
8050
|
+
function Xo({ editor: e }) {
|
|
8051
|
+
const t = st(), [n, i] = v([]), { t: a } = $(), r = P(() => {
|
|
8057
8052
|
const s = [], c = e.state.tr;
|
|
8058
8053
|
e.state.doc.descendants((l, u) => {
|
|
8059
8054
|
if (l.type.name === "heading") {
|
|
@@ -8067,7 +8062,7 @@ function Zo({ editor: e }) {
|
|
|
8067
8062
|
id: d
|
|
8068
8063
|
});
|
|
8069
8064
|
}
|
|
8070
|
-
}), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c), i(s), e.eventEmitter && e.eventEmitter.emit("TableOfContents",
|
|
8065
|
+
}), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c), i(s), e.eventEmitter && e.eventEmitter.emit("TableOfContents", Go(s));
|
|
8071
8066
|
}, [e]);
|
|
8072
8067
|
return R(() => {
|
|
8073
8068
|
if (e) {
|
|
@@ -8094,7 +8089,7 @@ function Zo({ editor: e }) {
|
|
|
8094
8089
|
)) })
|
|
8095
8090
|
] }) : null });
|
|
8096
8091
|
}
|
|
8097
|
-
function
|
|
8092
|
+
function Yo(e, ...t) {
|
|
8098
8093
|
const [n, i] = v(!1);
|
|
8099
8094
|
return R(() => {
|
|
8100
8095
|
const a = () => {
|
|
@@ -8105,8 +8100,8 @@ function Jo(e, ...t) {
|
|
|
8105
8100
|
};
|
|
8106
8101
|
}, [e, t, i]), n;
|
|
8107
8102
|
}
|
|
8108
|
-
function
|
|
8109
|
-
const i =
|
|
8103
|
+
function Zo({ editor: e, icon: t, tooltip: n }) {
|
|
8104
|
+
const i = Yo(e, er.name), a = P(() => {
|
|
8110
8105
|
if (i) {
|
|
8111
8106
|
e.chain().focus().removeTableOfContents().run();
|
|
8112
8107
|
return;
|
|
@@ -8123,10 +8118,10 @@ function Qo({ editor: e, icon: t, tooltip: n }) {
|
|
|
8123
8118
|
}
|
|
8124
8119
|
);
|
|
8125
8120
|
}
|
|
8126
|
-
function
|
|
8121
|
+
function Jo(e) {
|
|
8127
8122
|
return e && e.type.name === "title";
|
|
8128
8123
|
}
|
|
8129
|
-
function
|
|
8124
|
+
function Qo(e, t) {
|
|
8130
8125
|
const i = [e.getJSON()], a = [];
|
|
8131
8126
|
for (; i.length > 0; ) {
|
|
8132
8127
|
const r = i.shift();
|
|
@@ -8134,7 +8129,7 @@ function tr(e, t) {
|
|
|
8134
8129
|
}
|
|
8135
8130
|
return a;
|
|
8136
8131
|
}
|
|
8137
|
-
const
|
|
8132
|
+
const er = Le.create({
|
|
8138
8133
|
name: "tableOfContents",
|
|
8139
8134
|
group: "block",
|
|
8140
8135
|
atom: !0,
|
|
@@ -8148,7 +8143,7 @@ const nr = Le.create({
|
|
|
8148
8143
|
lastColumnResizable: !0,
|
|
8149
8144
|
allowTableNodeSelection: !1,
|
|
8150
8145
|
button: ({ editor: t, t: n }) => ({
|
|
8151
|
-
component:
|
|
8146
|
+
component: Zo,
|
|
8152
8147
|
componentProps: {
|
|
8153
8148
|
disabled: !1,
|
|
8154
8149
|
icon: "BookMarked",
|
|
@@ -8169,18 +8164,18 @@ const nr = Le.create({
|
|
|
8169
8164
|
return ["toc", Se(e)];
|
|
8170
8165
|
},
|
|
8171
8166
|
addNodeView() {
|
|
8172
|
-
return $e(
|
|
8167
|
+
return $e(Xo);
|
|
8173
8168
|
},
|
|
8174
8169
|
// @ts-expect-error
|
|
8175
8170
|
addCommands() {
|
|
8176
8171
|
return {
|
|
8177
8172
|
setTableOfContents: () => ({ commands: e, editor: t, view: n }) => {
|
|
8178
|
-
if (
|
|
8173
|
+
if (Qo(t, this.name).length > 0) {
|
|
8179
8174
|
this.options.onHasOneBeforeInsert();
|
|
8180
8175
|
return;
|
|
8181
8176
|
}
|
|
8182
8177
|
const a = n.props.state.doc.content.firstChild;
|
|
8183
|
-
if (
|
|
8178
|
+
if (Jo(a)) {
|
|
8184
8179
|
const r = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
|
|
8185
8180
|
return e.insertContentAt(r, { type: this.name });
|
|
8186
8181
|
}
|
|
@@ -8212,7 +8207,7 @@ const nr = Le.create({
|
|
|
8212
8207
|
];
|
|
8213
8208
|
}
|
|
8214
8209
|
});
|
|
8215
|
-
function
|
|
8210
|
+
function tr(e) {
|
|
8216
8211
|
var n;
|
|
8217
8212
|
const t = E(() => {
|
|
8218
8213
|
var r;
|
|
@@ -8280,7 +8275,7 @@ function ir(e) {
|
|
|
8280
8275
|
)
|
|
8281
8276
|
] });
|
|
8282
8277
|
}
|
|
8283
|
-
const
|
|
8278
|
+
const as = z.create({
|
|
8284
8279
|
name: "text-direction",
|
|
8285
8280
|
addOptions() {
|
|
8286
8281
|
var e;
|
|
@@ -8314,7 +8309,7 @@ const cs = z.create({
|
|
|
8314
8309
|
disabled: !1
|
|
8315
8310
|
})), c = s.filter((u) => u.disabled).length === s.length;
|
|
8316
8311
|
return {
|
|
8317
|
-
component:
|
|
8312
|
+
component: tr,
|
|
8318
8313
|
componentProps: {
|
|
8319
8314
|
icon: "TextDirection",
|
|
8320
8315
|
tooltip: i("editor.textDirection.tooltip"),
|
|
@@ -8346,11 +8341,11 @@ const cs = z.create({
|
|
|
8346
8341
|
unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
|
|
8347
8342
|
};
|
|
8348
8343
|
}
|
|
8349
|
-
}),
|
|
8350
|
-
listUsers:
|
|
8351
|
-
itemUser:
|
|
8352
|
-
selectedUser:
|
|
8353
|
-
},
|
|
8344
|
+
}), nr = "_listUsers_en3pm_1", ir = "_itemUser_en3pm_10", ar = "_selectedUser_en3pm_31", Oe = {
|
|
8345
|
+
listUsers: nr,
|
|
8346
|
+
itemUser: ir,
|
|
8347
|
+
selectedUser: ar
|
|
8348
|
+
}, or = nt((e, t) => {
|
|
8354
8349
|
const n = Y(null), [i, a] = v(0), r = (u) => {
|
|
8355
8350
|
const d = e.items[u];
|
|
8356
8351
|
d && e.command({ id: d, label: d });
|
|
@@ -8377,7 +8372,7 @@ const cs = z.create({
|
|
|
8377
8372
|
},
|
|
8378
8373
|
d
|
|
8379
8374
|
)) : /* @__PURE__ */ o("div", { className: U("itemUserEmpty", Oe.itemUser), children: "Empty" }) }) });
|
|
8380
|
-
}),
|
|
8375
|
+
}), rr = [
|
|
8381
8376
|
{
|
|
8382
8377
|
id: "1",
|
|
8383
8378
|
name: "John Doe"
|
|
@@ -8394,13 +8389,13 @@ const cs = z.create({
|
|
|
8394
8389
|
id: "4",
|
|
8395
8390
|
name: "Bob"
|
|
8396
8391
|
}
|
|
8397
|
-
],
|
|
8398
|
-
items: async ({ query: e }) =>
|
|
8392
|
+
], sr = {
|
|
8393
|
+
items: async ({ query: e }) => rr.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
|
|
8399
8394
|
render: () => {
|
|
8400
8395
|
let e, t;
|
|
8401
8396
|
return {
|
|
8402
8397
|
onStart: (n) => {
|
|
8403
|
-
e = new et(
|
|
8398
|
+
e = new et(or, {
|
|
8404
8399
|
props: n,
|
|
8405
8400
|
editor: n.editor
|
|
8406
8401
|
}), t = ft("body", {
|
|
@@ -8427,7 +8422,7 @@ const cs = z.create({
|
|
|
8427
8422
|
}
|
|
8428
8423
|
};
|
|
8429
8424
|
}
|
|
8430
|
-
},
|
|
8425
|
+
}, os = Vn.extend({
|
|
8431
8426
|
addAttributes() {
|
|
8432
8427
|
return {
|
|
8433
8428
|
id: {
|
|
@@ -8444,71 +8439,53 @@ const cs = z.create({
|
|
|
8444
8439
|
HTMLAttributes: {
|
|
8445
8440
|
class: "mention"
|
|
8446
8441
|
},
|
|
8447
|
-
suggestion:
|
|
8448
|
-
})
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
if (s.nodeType === 1) {
|
|
8458
|
-
const c = [
|
|
8459
|
-
s.tagName.toLowerCase(),
|
|
8460
|
-
Array.from(s.attributes).reduce((l, u) => (l[u.name] = u.value, l), {})
|
|
8461
|
-
];
|
|
8462
|
-
s.textContent && c.push(s.textContent), r.push(c);
|
|
8463
|
-
}
|
|
8464
|
-
}), r;
|
|
8465
|
-
}
|
|
8466
|
-
const ur = {
|
|
8467
|
-
audio: /* @__PURE__ */ o(li, {}),
|
|
8468
|
-
video: /* @__PURE__ */ o(ci, {}),
|
|
8469
|
-
file: /* @__PURE__ */ o(si, {}),
|
|
8470
|
-
image: /* @__PURE__ */ o(ri, {}),
|
|
8471
|
-
pdf: /* @__PURE__ */ o(Li, {}),
|
|
8472
|
-
word: /* @__PURE__ */ o(Ni, {}),
|
|
8473
|
-
excel: /* @__PURE__ */ o(oi, {}),
|
|
8474
|
-
ppt: /* @__PURE__ */ o(ai, {})
|
|
8442
|
+
suggestion: sr
|
|
8443
|
+
}), cr = {
|
|
8444
|
+
audio: /* @__PURE__ */ o(si, {}),
|
|
8445
|
+
video: /* @__PURE__ */ o(ri, {}),
|
|
8446
|
+
file: /* @__PURE__ */ o(oi, {}),
|
|
8447
|
+
image: /* @__PURE__ */ o(ai, {}),
|
|
8448
|
+
pdf: /* @__PURE__ */ o(Ai, {}),
|
|
8449
|
+
word: /* @__PURE__ */ o(Ti, {}),
|
|
8450
|
+
excel: /* @__PURE__ */ o(ii, {}),
|
|
8451
|
+
ppt: /* @__PURE__ */ o(ni, {})
|
|
8475
8452
|
};
|
|
8476
|
-
function
|
|
8477
|
-
const n =
|
|
8478
|
-
return
|
|
8453
|
+
function nn(e, t = !1) {
|
|
8454
|
+
const n = Ci(e);
|
|
8455
|
+
return cr[n] || /* @__PURE__ */ o(_e, {});
|
|
8479
8456
|
}
|
|
8480
|
-
const
|
|
8481
|
-
wrap:
|
|
8457
|
+
const lr = "_wrap_1x1ms_2", Xe = {
|
|
8458
|
+
wrap: lr
|
|
8482
8459
|
};
|
|
8483
|
-
function
|
|
8460
|
+
function dr({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension: a }) {
|
|
8484
8461
|
var C;
|
|
8485
|
-
const r = Y(null), s = st(), { hasTrigger: c, fileName: l, fileSize: u, fileExt: d, fileType: g, url: h, error: f } = t.attrs, [b,
|
|
8462
|
+
const r = Y(null), s = st(), { hasTrigger: c, fileName: l, fileSize: u, fileExt: d, fileType: g, url: h, error: f } = t.attrs, [b, x] = v(!1), { t: N } = $(), I = (C = a == null ? void 0 : a.options) == null ? void 0 : C.upload, w = P(() => {
|
|
8486
8463
|
!s || h || s && r.current.click();
|
|
8487
|
-
}, [s, h]), _ =
|
|
8464
|
+
}, [s, h]), _ = P(
|
|
8488
8465
|
async (T) => {
|
|
8489
8466
|
const L = T.target.files && T.target.files[0];
|
|
8490
8467
|
if (!L)
|
|
8491
8468
|
return;
|
|
8492
8469
|
const q = {
|
|
8493
|
-
fileName:
|
|
8470
|
+
fileName: Li(L.name),
|
|
8494
8471
|
fileSize: L.size,
|
|
8495
8472
|
fileType: L.type,
|
|
8496
|
-
fileExt:
|
|
8473
|
+
fileExt: Ni(L.name)
|
|
8497
8474
|
};
|
|
8498
|
-
|
|
8475
|
+
x(!0);
|
|
8499
8476
|
try {
|
|
8500
8477
|
const k = await I(L);
|
|
8501
|
-
n({ ...q, url: k }),
|
|
8478
|
+
n({ ...q, url: k }), x(!1);
|
|
8502
8479
|
} catch (k) {
|
|
8503
|
-
n({ error: `File upload fail: ${k && k.message}` || "Unknown error" }),
|
|
8480
|
+
n({ error: `File upload fail: ${k && k.message}` || "Unknown error" }), x(!1), r.current.value = "";
|
|
8504
8481
|
}
|
|
8505
8482
|
},
|
|
8506
|
-
[
|
|
8483
|
+
[x, n]
|
|
8507
8484
|
);
|
|
8508
8485
|
R(() => {
|
|
8509
8486
|
!h && !c && (w(), n({ hasTrigger: !0 }));
|
|
8510
8487
|
}, [h, c, w, n]);
|
|
8511
|
-
const
|
|
8488
|
+
const p = P(() => i(), [e]);
|
|
8512
8489
|
return s && !h ? /* @__PURE__ */ o(he, { children: /* @__PURE__ */ m("div", { className: U(Xe.wrap, "render-wrapper"), children: [
|
|
8513
8490
|
/* @__PURE__ */ o(
|
|
8514
8491
|
"p",
|
|
@@ -8534,7 +8511,7 @@ function mr({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
|
|
|
8534
8511
|
onClick: w,
|
|
8535
8512
|
children: [
|
|
8536
8513
|
/* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
8537
|
-
/* @__PURE__ */ o("span", { children:
|
|
8514
|
+
/* @__PURE__ */ o("span", { children: nn(g) }),
|
|
8538
8515
|
/* @__PURE__ */ m("span", { children: [
|
|
8539
8516
|
l,
|
|
8540
8517
|
".",
|
|
@@ -8542,14 +8519,14 @@ function mr({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
|
|
|
8542
8519
|
] }),
|
|
8543
8520
|
/* @__PURE__ */ m("span", { children: [
|
|
8544
8521
|
"(",
|
|
8545
|
-
|
|
8522
|
+
Ft(u),
|
|
8546
8523
|
")"
|
|
8547
8524
|
] })
|
|
8548
8525
|
] }),
|
|
8549
8526
|
/* @__PURE__ */ o(
|
|
8550
8527
|
y,
|
|
8551
8528
|
{
|
|
8552
|
-
action:
|
|
8529
|
+
action: p,
|
|
8553
8530
|
icon: "Trash2",
|
|
8554
8531
|
tooltip: N("editor.delete")
|
|
8555
8532
|
}
|
|
@@ -8565,7 +8542,7 @@ function mr({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
|
|
|
8565
8542
|
}
|
|
8566
8543
|
) }) : /* @__PURE__ */ o(_e, {});
|
|
8567
8544
|
}
|
|
8568
|
-
const
|
|
8545
|
+
const rs = Le.create({
|
|
8569
8546
|
name: "attachment",
|
|
8570
8547
|
content: "",
|
|
8571
8548
|
marks: "",
|
|
@@ -8616,12 +8593,12 @@ const ds = Le.create({
|
|
|
8616
8593
|
[
|
|
8617
8594
|
"span",
|
|
8618
8595
|
{ class: "attachment__icon" },
|
|
8619
|
-
|
|
8596
|
+
nn(a, !0)
|
|
8620
8597
|
],
|
|
8621
8598
|
[
|
|
8622
8599
|
"span",
|
|
8623
8600
|
{ class: "attachment__text" },
|
|
8624
|
-
`${n}.${r} (${
|
|
8601
|
+
`${n}.${r} (${Ft(i)})`
|
|
8625
8602
|
]
|
|
8626
8603
|
] : ["div", { class: "attachment__placeholder" }]
|
|
8627
8604
|
];
|
|
@@ -8664,56 +8641,56 @@ const ds = Le.create({
|
|
|
8664
8641
|
};
|
|
8665
8642
|
},
|
|
8666
8643
|
addNodeView() {
|
|
8667
|
-
return $e(
|
|
8644
|
+
return $e(dr);
|
|
8668
8645
|
}
|
|
8669
8646
|
});
|
|
8670
8647
|
export {
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8648
|
+
rs as Attachment,
|
|
8649
|
+
Kr as BaseKit,
|
|
8650
|
+
Fr as Blockquote,
|
|
8651
|
+
Ar as Bold,
|
|
8652
|
+
Pr as BulletList,
|
|
8653
|
+
Dr as Clear,
|
|
8654
|
+
Mr as Code,
|
|
8655
|
+
ra as CodeBlock,
|
|
8656
|
+
Rr as Color,
|
|
8657
|
+
fi as Column,
|
|
8658
|
+
qr as ColumnActionButton,
|
|
8659
|
+
es as Emoji,
|
|
8660
|
+
ls as Excalidraw,
|
|
8661
|
+
ts as ExportPdf,
|
|
8662
|
+
is as ExportWord,
|
|
8663
|
+
Ir as FontFamily,
|
|
8664
|
+
Er as FontSize,
|
|
8665
|
+
Qr as FormatPainter,
|
|
8666
|
+
zr as Heading,
|
|
8667
|
+
Or as Highlight,
|
|
8668
|
+
Vr as History,
|
|
8669
|
+
Ur as HorizontalRule,
|
|
8670
|
+
ds as Iframe,
|
|
8671
|
+
ja as Image,
|
|
8672
|
+
us as ImageGif,
|
|
8673
|
+
ns as ImportWord,
|
|
8674
|
+
Xr as Indent,
|
|
8675
|
+
Nr as Italic,
|
|
8676
|
+
hs as Katex,
|
|
8677
|
+
Yr as LineHeight,
|
|
8678
|
+
jr as Link,
|
|
8679
|
+
os as Mention,
|
|
8680
|
+
ms as Mermaid,
|
|
8681
|
+
Gr as MoreMark,
|
|
8682
|
+
gi as MultiColumn,
|
|
8683
|
+
Br as OrderedList,
|
|
8684
|
+
so as SearchAndReplace,
|
|
8685
|
+
Zr as SlashCommand,
|
|
8686
|
+
Sr as Strike,
|
|
8687
|
+
Wr as SubAndSuperScript,
|
|
8688
|
+
Jr as Table,
|
|
8689
|
+
er as TableOfContents,
|
|
8690
|
+
$r as TaskList,
|
|
8691
|
+
Hr as TextAlign,
|
|
8692
|
+
as as TextDirection,
|
|
8693
|
+
fs as Twitter,
|
|
8694
|
+
Lr as Underline,
|
|
8695
|
+
Ka as Video
|
|
8719
8696
|
};
|