reactjs-tiptap-editor-pro 0.2.26 → 0.2.27
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-B1Y3PPzy.js +8826 -0
- package/lib/RichTextEditor-CVJUZJ-8.cjs +141 -0
- package/lib/extension-bundle.cjs +3 -3
- package/lib/extension-bundle.d.cts +75 -75
- package/lib/extension-bundle.d.ts +75 -75
- package/lib/extension-bundle.js +1225 -1225
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +75 -75
- package/lib/index.d.ts +75 -75
- package/lib/index.js +1 -1
- package/lib/locale-bundle.d.cts +75 -75
- package/lib/locale-bundle.d.ts +75 -75
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/RichTextEditor-DlFgd8H2.cjs +0 -141
- package/lib/RichTextEditor-iBDjgtlT.js +0 -8780
package/lib/extension-bundle.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as ft, I as gt, U as bt, S as
|
|
2
|
-
import { P as te, b as Z, $ as
|
|
3
|
-
import { jsxs as
|
|
1
|
+
import { a as ft, I as gt, U as bt, S as pt, C as wt, f as oe, N as se, b as yt, c as kt, R as Se, F as vt, H as xt, T as Ct, E as A, d as Nt, e as At, g as Lt, h as ge, O as St, i as Tt, j as Et, k as Ht, L as zt, l as Mt, m as be, n as Pt, o as Rt, D as It, P as jt, p as Bt, q as Dt, G as Ot, r as $t, s as Ft, t as Ut, u as qt, v as Kt, w as Vt, x as Je, y as Ye, z as Qe, A as Te, M as Wt } from "./tiptap-DkWHMWDt.js";
|
|
2
|
+
import { P as te, b as Z, $ as re, a0 as le, al as P, am as Gt, T as Xe, A as Zt, an as Jt, ao as Yt } from "./vendor-Cpa6z-M0.js";
|
|
3
|
+
import { jsxs as m, jsx as s, Fragment as pe } from "react/jsx-runtime";
|
|
4
4
|
import * as J from "react";
|
|
5
5
|
import Qt, { useMemo as R, useState as C, useRef as G, useCallback as F, Fragment as Ee, forwardRef as He, useImperativeHandle as ze, useEffect as z } from "react";
|
|
6
|
-
import { ChevronDown as Me, Check as Xt, ChevronUp as en, Copy as tn, CopyCheck as nn, SearchIcon as an, LoaderIcon as on, LucideTableProperties as
|
|
7
|
-
import { i as Pe, T as
|
|
8
|
-
import { a4 as Ao, a0 as Lo, _ as So, a1 as To, $ as Eo, a2 as Ho, Z as zo, a3 as Mo } from "./RichTextEditor-
|
|
9
|
-
import { M as zn, D as nt, u as j, f as Mn, g as Pn, h as Ke, i as N, j as
|
|
10
|
-
import { bundledThemes as
|
|
11
|
-
import * as
|
|
6
|
+
import { ChevronDown as Me, Check as Xt, ChevronUp as en, Copy as tn, CopyCheck as nn, SearchIcon as an, LoaderIcon as on, LucideTableProperties as sn, LucideSheet as rn, LucideImage as ln, LucideFile as cn, LucideVideo as dn, LucideAudioLines as un } from "lucide-react";
|
|
7
|
+
import { i as Pe, T as we, a as ye, B as V, b as ke, g as Re, A as p, D as Y, c as Q, d as X, e as mn, f as T, u as Ie, h as hn, I as M, j as ne, k as et, l as Ae, m as _n, n as je, P as ce, o as de, p as ue, q as Be, C as fn, H as gn, L as bn, r as pn, M as wn, s as yn, t as Fe, v as he, w as K, E as D, x as kn, y as vn, V as xn, z as Ue, F as ve, G as qe, S as Cn, J as Nn, K as An, N as B, O as Ln, Q as Sn, U as Tn, W as En, X as Hn, Y as tt } from "./RichTextEditor-B1Y3PPzy.js";
|
|
8
|
+
import { a4 as Ao, a0 as Lo, _ as So, a1 as To, $ as Eo, a2 as Ho, Z as zo, a3 as Mo } from "./RichTextEditor-B1Y3PPzy.js";
|
|
9
|
+
import { M as zn, D as nt, u as j, f as Mn, g as Pn, h as Ke, i as N, j as at, k as Rn } from "./index-M6H3FoBi.js";
|
|
10
|
+
import { bundledThemes as it, bundledLanguages as ot, createHighlighter as In } from "shiki";
|
|
11
|
+
import * as x from "@radix-ui/react-select";
|
|
12
12
|
import { Slot as jn } from "@radix-ui/react-slot";
|
|
13
13
|
import De from "tippy.js";
|
|
14
14
|
import Oe from "scroll-into-view-if-needed";
|
|
@@ -18,35 +18,35 @@ import { DocxSerializer as On, defaultNodes as U, defaultMarks as $n } from "pro
|
|
|
18
18
|
const $e = Qt.forwardRef(
|
|
19
19
|
({ asChild: e, ...t }, n) => {
|
|
20
20
|
var o;
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
21
|
+
const a = Pe[t.icon];
|
|
22
|
+
return /* @__PURE__ */ m(we, { children: [
|
|
23
|
+
/* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ s(
|
|
24
24
|
e ? jn : V,
|
|
25
25
|
{
|
|
26
|
-
className: "
|
|
26
|
+
className: "h-[32px] min-w-24 overflow-hidden px-[5px] py-0",
|
|
27
27
|
disabled: t == null ? void 0 : t.disabled,
|
|
28
28
|
ref: n,
|
|
29
29
|
variant: "ghost",
|
|
30
30
|
...t,
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
(t == null ? void 0 : t.title) && /* @__PURE__ */
|
|
33
|
-
|
|
31
|
+
children: /* @__PURE__ */ m("div", { className: "flex h-full items-center font-normal", children: [
|
|
32
|
+
(t == null ? void 0 : t.title) && /* @__PURE__ */ s("div", { className: "grow truncate text-left text-sm", children: t == null ? void 0 : t.title }),
|
|
33
|
+
a && /* @__PURE__ */ s(a, { className: "ml-1 size-3 shrink-0 text-zinc-500" })
|
|
34
34
|
] })
|
|
35
35
|
}
|
|
36
36
|
) }),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
(t == null ? void 0 : t.tooltip) && /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ s(ke, { children: /* @__PURE__ */ m("div", { className: "flex max-w-24 flex-col items-center text-center", children: [
|
|
38
|
+
(t == null ? void 0 : t.tooltip) && /* @__PURE__ */ s("div", { children: t == null ? void 0 : t.tooltip }),
|
|
39
|
+
/* @__PURE__ */ s("div", { className: "flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ s("span", { children: Re(t == null ? void 0 : t.shortcutKeys) }) })
|
|
40
40
|
] }) })
|
|
41
41
|
] });
|
|
42
42
|
}
|
|
43
|
-
),
|
|
43
|
+
), Ui = ft.extend({
|
|
44
44
|
addOptions() {
|
|
45
45
|
var e;
|
|
46
46
|
return {
|
|
47
47
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
48
48
|
button: ({ editor: t, t: n }) => ({
|
|
49
|
-
component:
|
|
49
|
+
component: p,
|
|
50
50
|
componentProps: {
|
|
51
51
|
action: () => t.commands.toggleBold(),
|
|
52
52
|
isActive: () => t.isActive("bold") || !1,
|
|
@@ -58,14 +58,14 @@ const $e = Qt.forwardRef(
|
|
|
58
58
|
})
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
}),
|
|
61
|
+
}), qi = gt.extend({
|
|
62
62
|
addOptions() {
|
|
63
63
|
var e;
|
|
64
64
|
return {
|
|
65
65
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
66
66
|
button({ editor: t, t: n }) {
|
|
67
67
|
return {
|
|
68
|
-
component:
|
|
68
|
+
component: p,
|
|
69
69
|
componentProps: {
|
|
70
70
|
action: () => t.commands.toggleItalic(),
|
|
71
71
|
isActive: () => t.isActive("italic") || !1,
|
|
@@ -78,14 +78,14 @@ const $e = Qt.forwardRef(
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
}),
|
|
81
|
+
}), Ki = bt.extend({
|
|
82
82
|
addOptions() {
|
|
83
83
|
var e;
|
|
84
84
|
return {
|
|
85
85
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
86
86
|
button({ editor: t, t: n }) {
|
|
87
87
|
return {
|
|
88
|
-
component:
|
|
88
|
+
component: p,
|
|
89
89
|
componentProps: {
|
|
90
90
|
action: () => t.commands.toggleUnderline(),
|
|
91
91
|
isActive: () => t.isActive("underline") || !1,
|
|
@@ -98,13 +98,13 @@ const $e = Qt.forwardRef(
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
}),
|
|
101
|
+
}), Vi = pt.extend({
|
|
102
102
|
addOptions() {
|
|
103
103
|
var e;
|
|
104
104
|
return {
|
|
105
105
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
106
106
|
button: ({ editor: t, t: n }) => ({
|
|
107
|
-
component:
|
|
107
|
+
component: p,
|
|
108
108
|
componentProps: {
|
|
109
109
|
action: () => t.commands.toggleStrike(),
|
|
110
110
|
isActive: () => t.isActive("strike") || !1,
|
|
@@ -116,13 +116,13 @@ const $e = Qt.forwardRef(
|
|
|
116
116
|
})
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
}),
|
|
119
|
+
}), Wi = wt.extend({
|
|
120
120
|
addOptions() {
|
|
121
121
|
var e;
|
|
122
122
|
return {
|
|
123
123
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
124
124
|
button: ({ editor: t, t: n }) => ({
|
|
125
|
-
component:
|
|
125
|
+
component: p,
|
|
126
126
|
componentProps: {
|
|
127
127
|
action: () => t.commands.toggleCode(),
|
|
128
128
|
isActive: () => t.isActive("code") || !1,
|
|
@@ -135,85 +135,85 @@ const $e = Qt.forwardRef(
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
-
let I,
|
|
139
|
-
const
|
|
138
|
+
let I, ae;
|
|
139
|
+
const xe = /* @__PURE__ */ new Set(), Ce = /* @__PURE__ */ new Set();
|
|
140
140
|
function Fn() {
|
|
141
141
|
return I;
|
|
142
142
|
}
|
|
143
143
|
function Un(e) {
|
|
144
|
-
if (!I && !
|
|
144
|
+
if (!I && !ae) {
|
|
145
145
|
const t = e.themes.filter(
|
|
146
|
-
(
|
|
146
|
+
(a) => !!a && a in it
|
|
147
147
|
), n = e.languages.filter(
|
|
148
|
-
(
|
|
148
|
+
(a) => !!a && a in ot
|
|
149
149
|
);
|
|
150
|
-
return
|
|
151
|
-
I =
|
|
152
|
-
}),
|
|
150
|
+
return ae = In({ themes: t, langs: n }).then((a) => {
|
|
151
|
+
I = a;
|
|
152
|
+
}), ae;
|
|
153
153
|
}
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
156
|
-
}
|
|
157
|
-
async function rt(e) {
|
|
158
|
-
return I && !I.getLoadedThemes().includes(e) && !Ce.has(e) && e in at ? (Ce.add(e), await I.loadTheme(e), Ce.delete(e), !0) : !1;
|
|
154
|
+
if (ae)
|
|
155
|
+
return ae;
|
|
159
156
|
}
|
|
160
157
|
async function st(e) {
|
|
161
|
-
return I && !I.
|
|
158
|
+
return I && !I.getLoadedThemes().includes(e) && !Ce.has(e) && e in it ? (Ce.add(e), await I.loadTheme(e), Ce.delete(e), !0) : !1;
|
|
159
|
+
}
|
|
160
|
+
async function rt(e) {
|
|
161
|
+
return I && !I.getLoadedLanguages().includes(e) && !xe.has(e) && e in ot ? (xe.add(e), await I.loadLanguage(e), xe.delete(e), !0) : !1;
|
|
162
162
|
}
|
|
163
163
|
async function qn({
|
|
164
164
|
doc: e,
|
|
165
165
|
name: t,
|
|
166
166
|
defaultTheme: n,
|
|
167
|
-
defaultLanguage:
|
|
167
|
+
defaultLanguage: a
|
|
168
168
|
}) {
|
|
169
|
-
const
|
|
170
|
-
...
|
|
169
|
+
const i = oe(e, (l) => l.type.name === t), o = [
|
|
170
|
+
...i.map((l) => l.node.attrs.theme),
|
|
171
171
|
n
|
|
172
|
-
],
|
|
173
|
-
...
|
|
174
|
-
|
|
172
|
+
], r = [
|
|
173
|
+
...i.map((l) => l.node.attrs.language),
|
|
174
|
+
a
|
|
175
175
|
];
|
|
176
176
|
I ? await Promise.all([
|
|
177
|
-
...o.flatMap((
|
|
178
|
-
...
|
|
179
|
-
]) : await Un({ languages:
|
|
177
|
+
...o.flatMap((l) => st(l)),
|
|
178
|
+
...r.flatMap((l) => !!l && rt(l))
|
|
179
|
+
]) : await Un({ languages: r, themes: o });
|
|
180
180
|
}
|
|
181
181
|
function Ve({
|
|
182
182
|
doc: e,
|
|
183
183
|
name: t,
|
|
184
184
|
defaultTheme: n,
|
|
185
|
-
defaultLanguage:
|
|
185
|
+
defaultLanguage: a
|
|
186
186
|
}) {
|
|
187
|
-
const
|
|
188
|
-
return oe(e, (
|
|
189
|
-
let
|
|
190
|
-
const d =
|
|
191
|
-
if (!
|
|
187
|
+
const i = [];
|
|
188
|
+
return oe(e, (r) => r.type.name === t).forEach((r) => {
|
|
189
|
+
let l = r.pos + 1, u = r.node.attrs.language || a;
|
|
190
|
+
const d = r.node.attrs.theme || n, c = Fn();
|
|
191
|
+
if (!c)
|
|
192
192
|
return;
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
lang:
|
|
196
|
-
theme:
|
|
193
|
+
c.getLoadedLanguages().includes(u) || (u = "plaintext");
|
|
194
|
+
const h = c.getLoadedThemes().includes(d) ? d : c.getLoadedThemes()[0], _ = c.codeToTokensBase(r.node.textContent, {
|
|
195
|
+
lang: u,
|
|
196
|
+
theme: h
|
|
197
197
|
});
|
|
198
198
|
for (const f of _) {
|
|
199
|
-
for (const
|
|
200
|
-
const
|
|
201
|
-
style: `color: ${
|
|
199
|
+
for (const w of f) {
|
|
200
|
+
const y = l + w.content.length, L = le.inline(l, y, {
|
|
201
|
+
style: `color: ${w.color}`
|
|
202
202
|
});
|
|
203
|
-
|
|
203
|
+
i.push(L), l = y;
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
l += 1;
|
|
206
206
|
}
|
|
207
|
-
}),
|
|
207
|
+
}), re.create(e, i);
|
|
208
208
|
}
|
|
209
209
|
function Kn({
|
|
210
210
|
name: e,
|
|
211
211
|
defaultLanguage: t,
|
|
212
212
|
defaultTheme: n
|
|
213
213
|
}) {
|
|
214
|
-
const
|
|
214
|
+
const a = new te({
|
|
215
215
|
key: new Z("shiki"),
|
|
216
|
-
view(
|
|
216
|
+
view(i) {
|
|
217
217
|
class o {
|
|
218
218
|
constructor() {
|
|
219
219
|
this.initDecorations();
|
|
@@ -225,235 +225,235 @@ function Kn({
|
|
|
225
225
|
}
|
|
226
226
|
// Initialize shiki async, and then highlight initial document
|
|
227
227
|
async initDecorations() {
|
|
228
|
-
const
|
|
229
|
-
await qn({ doc:
|
|
230
|
-
const
|
|
231
|
-
|
|
228
|
+
const l = i.state.doc;
|
|
229
|
+
await qn({ doc: l, name: e, defaultLanguage: t, defaultTheme: n });
|
|
230
|
+
const u = i.state.tr.setMeta("shikiPluginForceDecoration", !0);
|
|
231
|
+
i.dispatch(u);
|
|
232
232
|
}
|
|
233
233
|
// When new codeblocks were added and they have missing themes or
|
|
234
234
|
// languages, load those and then add code decorations once again.
|
|
235
235
|
async checkUndecoratedBlocks() {
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
(
|
|
236
|
+
const l = oe(
|
|
237
|
+
i.state.doc,
|
|
238
|
+
(c) => c.type.name === e
|
|
239
239
|
);
|
|
240
240
|
if ((await Promise.all(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
l.flatMap((c) => [
|
|
242
|
+
st(c.node.attrs.theme),
|
|
243
|
+
rt(c.node.attrs.language)
|
|
244
244
|
])
|
|
245
245
|
)).includes(!0)) {
|
|
246
|
-
const
|
|
247
|
-
|
|
246
|
+
const c = i.state.tr.setMeta("shikiPluginForceDecoration", !0);
|
|
247
|
+
i.dispatch(c);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
return new o();
|
|
252
252
|
},
|
|
253
253
|
state: {
|
|
254
|
-
init: (
|
|
254
|
+
init: (i, { doc: o }) => Ve({
|
|
255
255
|
doc: o,
|
|
256
256
|
name: e,
|
|
257
257
|
defaultLanguage: t,
|
|
258
258
|
defaultTheme: n
|
|
259
259
|
}),
|
|
260
|
-
apply: (
|
|
261
|
-
const
|
|
262
|
-
|
|
260
|
+
apply: (i, o, r, l) => {
|
|
261
|
+
const u = r.selection.$head.parent.type.name, d = l.selection.$head.parent.type.name, c = oe(
|
|
262
|
+
r.doc,
|
|
263
263
|
(f) => f.type.name === e
|
|
264
|
-
),
|
|
265
|
-
|
|
264
|
+
), h = oe(
|
|
265
|
+
l.doc,
|
|
266
266
|
(f) => f.type.name === e
|
|
267
|
-
), _ =
|
|
268
|
-
return
|
|
269
|
-
doc:
|
|
267
|
+
), _ = i.docChanged && ([u, d].includes(e) || h.length !== c.length || i.steps.some((f) => f.from !== void 0 && f.to !== void 0 && c.some((w) => w.pos >= f.from && w.pos + w.node.nodeSize <= f.to)));
|
|
268
|
+
return i.getMeta("shikiPluginForceDecoration") || _ ? Ve({
|
|
269
|
+
doc: i.doc,
|
|
270
270
|
name: e,
|
|
271
271
|
defaultLanguage: t,
|
|
272
272
|
defaultTheme: n
|
|
273
|
-
}) : o.map(
|
|
273
|
+
}) : o.map(i.mapping, i.doc);
|
|
274
274
|
}
|
|
275
275
|
},
|
|
276
276
|
props: {
|
|
277
277
|
//@ts-expect-error
|
|
278
|
-
decorations(
|
|
279
|
-
return
|
|
278
|
+
decorations(i) {
|
|
279
|
+
return a.getState(i);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
|
-
return
|
|
283
|
+
return a;
|
|
284
284
|
}
|
|
285
285
|
function Vn({ action: e, languages: t, ...n }) {
|
|
286
|
-
const
|
|
286
|
+
const a = (o) => {
|
|
287
287
|
e(o);
|
|
288
|
-
},
|
|
288
|
+
}, i = R(() => t == null ? void 0 : t.map((o) => ({
|
|
289
289
|
title: zn[o] || o,
|
|
290
290
|
// icon: language.icon,
|
|
291
291
|
language: o
|
|
292
292
|
})), [t]);
|
|
293
|
-
return /* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
|
|
293
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
294
|
+
/* @__PURE__ */ s(Q, { disabled: n == null ? void 0 : n.disabled, asChild: !0, children: /* @__PURE__ */ s(
|
|
295
|
+
p,
|
|
296
296
|
{
|
|
297
297
|
tooltip: n == null ? void 0 : n.tooltip,
|
|
298
298
|
disabled: n == null ? void 0 : n.disabled,
|
|
299
299
|
icon: n == null ? void 0 : n.icon
|
|
300
300
|
}
|
|
301
301
|
) }),
|
|
302
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ s(X, { className: "w-full !max-h-[180px] !overflow-y-scroll", children: i == null ? void 0 : i.map((o) => /* @__PURE__ */ s(mn, { onClick: () => a(o.language), children: /* @__PURE__ */ s("div", { className: "h-full ml-1", children: o.title }) }, `codeblock-${o.title}`)) })
|
|
303
303
|
] });
|
|
304
304
|
}
|
|
305
|
-
const Wn =
|
|
306
|
-
|
|
305
|
+
const Wn = x.Root, Gn = x.Value, lt = J.forwardRef(({ className: e, children: t, ...n }, a) => /* @__PURE__ */ m(
|
|
306
|
+
x.Trigger,
|
|
307
307
|
{
|
|
308
|
-
ref:
|
|
308
|
+
ref: a,
|
|
309
309
|
className: T(
|
|
310
|
-
"
|
|
310
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
311
311
|
e
|
|
312
312
|
),
|
|
313
313
|
...n,
|
|
314
314
|
children: [
|
|
315
315
|
t,
|
|
316
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ s(x.Icon, { asChild: !0, children: /* @__PURE__ */ s(Me, { className: "h-4 w-4 opacity-50" }) })
|
|
317
317
|
]
|
|
318
318
|
}
|
|
319
319
|
));
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
|
|
320
|
+
lt.displayName = x.Trigger.displayName;
|
|
321
|
+
const ct = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(
|
|
322
|
+
x.ScrollUpButton,
|
|
323
323
|
{
|
|
324
324
|
ref: n,
|
|
325
325
|
className: T(
|
|
326
|
-
"
|
|
326
|
+
"flex cursor-default items-center justify-center py-1",
|
|
327
327
|
e
|
|
328
328
|
),
|
|
329
329
|
...t,
|
|
330
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ s(en, { className: "h-4 w-4" })
|
|
331
331
|
}
|
|
332
332
|
));
|
|
333
|
-
|
|
334
|
-
const dt = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
335
|
-
|
|
333
|
+
ct.displayName = x.ScrollUpButton.displayName;
|
|
334
|
+
const dt = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(
|
|
335
|
+
x.ScrollDownButton,
|
|
336
336
|
{
|
|
337
337
|
ref: n,
|
|
338
338
|
className: T(
|
|
339
|
-
"
|
|
339
|
+
"flex cursor-default items-center justify-center py-1",
|
|
340
340
|
e
|
|
341
341
|
),
|
|
342
342
|
...t,
|
|
343
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ s(Me, { className: "h-4 w-4" })
|
|
344
344
|
}
|
|
345
345
|
));
|
|
346
|
-
dt.displayName =
|
|
347
|
-
const
|
|
348
|
-
|
|
346
|
+
dt.displayName = x.ScrollDownButton.displayName;
|
|
347
|
+
const ut = J.forwardRef(({ className: e, children: t, position: n = "popper", ...a }, i) => /* @__PURE__ */ s(x.Portal, { children: /* @__PURE__ */ m(
|
|
348
|
+
x.Content,
|
|
349
349
|
{
|
|
350
|
-
ref:
|
|
350
|
+
ref: i,
|
|
351
351
|
className: T(
|
|
352
|
-
"
|
|
353
|
-
n === "popper" && "data-[side=bottom]:
|
|
352
|
+
"relative z-50 max-h-60 overflow-y-auto min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
353
|
+
n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
354
354
|
e
|
|
355
355
|
),
|
|
356
356
|
position: n,
|
|
357
|
-
...
|
|
357
|
+
...a,
|
|
358
358
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
|
|
359
|
+
/* @__PURE__ */ s(ct, {}),
|
|
360
|
+
/* @__PURE__ */ s(
|
|
361
|
+
x.Viewport,
|
|
362
362
|
{
|
|
363
363
|
className: T(
|
|
364
|
-
"
|
|
365
|
-
n === "popper" && "
|
|
364
|
+
"p-1",
|
|
365
|
+
n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
366
366
|
),
|
|
367
367
|
children: t
|
|
368
368
|
}
|
|
369
369
|
),
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ s(dt, {})
|
|
371
371
|
]
|
|
372
372
|
}
|
|
373
373
|
) }));
|
|
374
|
-
|
|
375
|
-
const Zn = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
376
|
-
|
|
374
|
+
ut.displayName = x.Content.displayName;
|
|
375
|
+
const Zn = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(
|
|
376
|
+
x.Label,
|
|
377
377
|
{
|
|
378
378
|
ref: n,
|
|
379
|
-
className: T("
|
|
379
|
+
className: T("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
380
380
|
...t
|
|
381
381
|
}
|
|
382
382
|
));
|
|
383
|
-
Zn.displayName =
|
|
384
|
-
const Le = J.forwardRef(({ className: e, children: t, ...n },
|
|
385
|
-
|
|
383
|
+
Zn.displayName = x.Label.displayName;
|
|
384
|
+
const Le = J.forwardRef(({ className: e, children: t, ...n }, a) => /* @__PURE__ */ m(
|
|
385
|
+
x.Item,
|
|
386
386
|
{
|
|
387
|
-
ref:
|
|
387
|
+
ref: a,
|
|
388
388
|
className: T(
|
|
389
|
-
"
|
|
389
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
390
390
|
e
|
|
391
391
|
),
|
|
392
392
|
...n,
|
|
393
393
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ s("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ s(x.ItemIndicator, { children: /* @__PURE__ */ s(Xt, { className: "h-4 w-4" }) }) }),
|
|
395
|
+
/* @__PURE__ */ s(x.ItemText, { children: t })
|
|
396
396
|
]
|
|
397
397
|
}
|
|
398
398
|
));
|
|
399
|
-
Le.displayName =
|
|
400
|
-
const Jn = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */
|
|
401
|
-
|
|
399
|
+
Le.displayName = x.Item.displayName;
|
|
400
|
+
const Jn = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(
|
|
401
|
+
x.Separator,
|
|
402
402
|
{
|
|
403
403
|
ref: n,
|
|
404
|
-
className: T("
|
|
404
|
+
className: T("-mx-1 my-1 h-px bg-muted", e),
|
|
405
405
|
...t
|
|
406
406
|
}
|
|
407
407
|
));
|
|
408
|
-
Jn.displayName =
|
|
408
|
+
Jn.displayName = x.Separator.displayName;
|
|
409
409
|
function Yn() {
|
|
410
410
|
const [e, t] = C(!1);
|
|
411
|
-
return { isCopied: e, copyToClipboard: async (
|
|
411
|
+
return { isCopied: e, copyToClipboard: async (a) => {
|
|
412
412
|
try {
|
|
413
|
-
await navigator.clipboard.writeText(
|
|
414
|
-
} catch (
|
|
415
|
-
console.error("Failed to copy text: ",
|
|
413
|
+
await navigator.clipboard.writeText(a), t(!0), setTimeout(() => t(!1), 2e3);
|
|
414
|
+
} catch (i) {
|
|
415
|
+
console.error("Failed to copy text: ", i), t(!1);
|
|
416
416
|
}
|
|
417
417
|
} };
|
|
418
418
|
}
|
|
419
|
-
const Qn = "
|
|
419
|
+
const Qn = "_wrap_fsdar_1", Xn = "_maxHeight_fsdar_10", ea = "_btnCopy_fsdar_13", ta = "_btnDelete_fsdar_14", na = "_blockInfo_fsdar_18", aa = "_blockInfoEditable_fsdar_28", ia = "_selectLang_fsdar_32", oa = "_copied_fsdar_58", $ = {
|
|
420
420
|
wrap: Qn,
|
|
421
421
|
maxHeight: Xn,
|
|
422
|
-
btnCopy:
|
|
423
|
-
btnDelete:
|
|
424
|
-
blockInfo:
|
|
425
|
-
blockInfoEditable:
|
|
426
|
-
selectLang:
|
|
427
|
-
copied:
|
|
422
|
+
btnCopy: ea,
|
|
423
|
+
btnDelete: ta,
|
|
424
|
+
blockInfo: na,
|
|
425
|
+
blockInfoEditable: aa,
|
|
426
|
+
selectLang: ia,
|
|
427
|
+
copied: oa
|
|
428
428
|
};
|
|
429
|
-
function
|
|
429
|
+
function sa({ editor: e, node: { attrs: t }, updateAttributes: n, extension: a }) {
|
|
430
430
|
var _, f;
|
|
431
|
-
const { isCopied:
|
|
432
|
-
var
|
|
433
|
-
return (
|
|
434
|
-
}, [
|
|
435
|
-
return /* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
431
|
+
const { isCopied: i, copyToClipboard: o } = Yn(), r = R(() => {
|
|
432
|
+
var w;
|
|
433
|
+
return (w = a.options.languages) != null && w.length ? a.options.languages : nt;
|
|
434
|
+
}, [a.options.languages]), l = Ie(), u = (f = (_ = e == null ? void 0 : e.options) == null ? void 0 : _.editorProps) == null ? void 0 : f.print, { language: d } = t, c = G(null), h = F(() => hn(ra.name, e), [e]);
|
|
435
|
+
return /* @__PURE__ */ m(se, { className: P($.wrap, !u && $.maxHeight, "render-wrapper"), children: [
|
|
436
|
+
/* @__PURE__ */ m(
|
|
437
437
|
"div",
|
|
438
438
|
{
|
|
439
439
|
className: P($.blockInfo, {
|
|
440
|
-
[$.blockInfoEditable]: !
|
|
440
|
+
[$.blockInfoEditable]: !l
|
|
441
441
|
}),
|
|
442
442
|
children: [
|
|
443
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ s(
|
|
444
444
|
"span",
|
|
445
445
|
{
|
|
446
|
-
className: P($.btnCopy,
|
|
447
|
-
onClick: () => o(
|
|
448
|
-
children:
|
|
446
|
+
className: P($.btnCopy, i && $.copied),
|
|
447
|
+
onClick: () => o(c.current.innerText),
|
|
448
|
+
children: i ? /* @__PURE__ */ s(nn, { size: 16 }) : /* @__PURE__ */ s(tn, { size: 16 })
|
|
449
449
|
}
|
|
450
450
|
),
|
|
451
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ s(
|
|
452
452
|
"span",
|
|
453
453
|
{
|
|
454
454
|
className: $.btnDelete,
|
|
455
|
-
onClick:
|
|
456
|
-
children: /* @__PURE__ */
|
|
455
|
+
onClick: h,
|
|
456
|
+
children: /* @__PURE__ */ s(
|
|
457
457
|
M,
|
|
458
458
|
{
|
|
459
459
|
name: "Trash2"
|
|
@@ -461,23 +461,23 @@ function ri({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
|
|
|
461
461
|
)
|
|
462
462
|
}
|
|
463
463
|
),
|
|
464
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ s("div", { className: $.selectLang, children: /* @__PURE__ */ m(
|
|
465
465
|
Wn,
|
|
466
466
|
{
|
|
467
467
|
defaultValue: d || "auto",
|
|
468
|
-
disabled: !
|
|
469
|
-
onValueChange: (
|
|
468
|
+
disabled: !l,
|
|
469
|
+
onValueChange: (w) => n({ language: w }),
|
|
470
470
|
children: [
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
|
|
471
|
+
/* @__PURE__ */ s(lt, { children: /* @__PURE__ */ s(Gn, { placeholder: "Language" }) }),
|
|
472
|
+
/* @__PURE__ */ m(ut, { className: "max-h-60 overflow-y-auto", children: [
|
|
473
|
+
/* @__PURE__ */ s(Le, { value: "auto", children: "Auto" }),
|
|
474
|
+
r.map((w, y) => /* @__PURE__ */ s(
|
|
475
475
|
Le,
|
|
476
476
|
{
|
|
477
|
-
value:
|
|
478
|
-
children:
|
|
477
|
+
value: w,
|
|
478
|
+
children: w.charAt(0).toUpperCase() + w.slice(1)
|
|
479
479
|
},
|
|
480
|
-
`code-lang-${
|
|
480
|
+
`code-lang-${y}`
|
|
481
481
|
))
|
|
482
482
|
] })
|
|
483
483
|
]
|
|
@@ -486,36 +486,36 @@ function ri({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
|
|
|
486
486
|
]
|
|
487
487
|
}
|
|
488
488
|
),
|
|
489
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ s("pre", { ref: c, children: /* @__PURE__ */ s(yt, { as: "code" }) })
|
|
490
490
|
] });
|
|
491
491
|
}
|
|
492
|
-
const
|
|
492
|
+
const ra = kt.extend({
|
|
493
493
|
addOptions() {
|
|
494
494
|
var e;
|
|
495
495
|
return {
|
|
496
496
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
497
497
|
languages: [],
|
|
498
|
-
button: ({ editor: t, t: n, extension:
|
|
499
|
-
var o,
|
|
500
|
-
const
|
|
498
|
+
button: ({ editor: t, t: n, extension: a }) => {
|
|
499
|
+
var o, r, l;
|
|
500
|
+
const i = (r = (o = a == null ? void 0 : a.options) == null ? void 0 : o.languages) != null && r.length ? (l = a == null ? void 0 : a.options) == null ? void 0 : l.languages : nt;
|
|
501
501
|
return {
|
|
502
502
|
component: Vn,
|
|
503
503
|
componentProps: {
|
|
504
|
-
action: (
|
|
505
|
-
language:
|
|
504
|
+
action: (u = "js") => t.commands.setCodeBlock({
|
|
505
|
+
language: u
|
|
506
506
|
}),
|
|
507
507
|
isActive: () => t.isActive("codeBlock") || !1,
|
|
508
508
|
disabled: !t.can().toggleCodeBlock(),
|
|
509
509
|
icon: "Code2",
|
|
510
510
|
tooltip: n("editor.codeblock.tooltip"),
|
|
511
|
-
languages:
|
|
511
|
+
languages: i
|
|
512
512
|
}
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
516
|
},
|
|
517
517
|
addNodeView() {
|
|
518
|
-
return Se(
|
|
518
|
+
return Se(sa);
|
|
519
519
|
},
|
|
520
520
|
addProseMirrorPlugins() {
|
|
521
521
|
var e;
|
|
@@ -529,13 +529,13 @@ const si = yt.extend({
|
|
|
529
529
|
];
|
|
530
530
|
}
|
|
531
531
|
});
|
|
532
|
-
function
|
|
533
|
-
var
|
|
534
|
-
const { t, lang: n } = j(),
|
|
532
|
+
function la(e) {
|
|
533
|
+
var i, o, r;
|
|
534
|
+
const { t, lang: n } = j(), a = R(() => {
|
|
535
535
|
var d;
|
|
536
|
-
const
|
|
537
|
-
return
|
|
538
|
-
...
|
|
536
|
+
const l = (d = e == null ? void 0 : e.items) == null ? void 0 : d.find((c) => c.isActive());
|
|
537
|
+
return l && !l.default ? {
|
|
538
|
+
...l
|
|
539
539
|
} : {
|
|
540
540
|
title: e.tooltip,
|
|
541
541
|
font: t("editor.fontFamily.default.tooltip"),
|
|
@@ -544,79 +544,79 @@ function ci(e) {
|
|
|
544
544
|
action: () => e.editor.chain().focus().unsetFontFamily().run()
|
|
545
545
|
};
|
|
546
546
|
}, [t, n, e]);
|
|
547
|
-
return /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
548
|
+
/* @__PURE__ */ s(
|
|
549
549
|
Q,
|
|
550
550
|
{
|
|
551
551
|
asChild: !0,
|
|
552
552
|
disabled: e == null ? void 0 : e.disabled,
|
|
553
|
-
children: /* @__PURE__ */
|
|
553
|
+
children: /* @__PURE__ */ s(
|
|
554
554
|
$e,
|
|
555
555
|
{
|
|
556
556
|
disabled: e == null ? void 0 : e.disabled,
|
|
557
557
|
icon: "MenuDown",
|
|
558
|
-
title: ((
|
|
558
|
+
title: ((i = a == null ? void 0 : a.font) == null ? void 0 : i.length) > 7 ? `${(o = a == null ? void 0 : a.font) == null ? void 0 : o.slice(0, 6)}...` : a == null ? void 0 : a.font,
|
|
559
559
|
tooltip: e == null ? void 0 : e.tooltip
|
|
560
560
|
}
|
|
561
561
|
)
|
|
562
562
|
}
|
|
563
563
|
),
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
const d =
|
|
566
|
-
return /* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ s(X, { className: "w-full", children: (r = e == null ? void 0 : e.items) == null ? void 0 : r.map((l, u) => {
|
|
565
|
+
const d = l.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: l.font };
|
|
566
|
+
return /* @__PURE__ */ m(Ee, { children: [
|
|
567
|
+
/* @__PURE__ */ s(
|
|
568
568
|
ne,
|
|
569
569
|
{
|
|
570
|
-
checked: (
|
|
571
|
-
onClick:
|
|
572
|
-
children: /* @__PURE__ */
|
|
570
|
+
checked: (a == null ? void 0 : a.font) === l.font,
|
|
571
|
+
onClick: l.action,
|
|
572
|
+
children: /* @__PURE__ */ s(
|
|
573
573
|
"div",
|
|
574
574
|
{
|
|
575
|
-
className: "
|
|
575
|
+
className: "ml-1 h-full",
|
|
576
576
|
style: d,
|
|
577
|
-
children:
|
|
577
|
+
children: l.font
|
|
578
578
|
}
|
|
579
579
|
)
|
|
580
580
|
}
|
|
581
581
|
),
|
|
582
|
-
|
|
583
|
-
] }, `font-family-${
|
|
582
|
+
l.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ s(et, {})
|
|
583
|
+
] }, `font-family-${u}`);
|
|
584
584
|
}) })
|
|
585
585
|
] });
|
|
586
586
|
}
|
|
587
|
-
const
|
|
587
|
+
const Gi = vt.extend({
|
|
588
588
|
addOptions() {
|
|
589
589
|
var e;
|
|
590
590
|
return {
|
|
591
591
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
592
592
|
fontFamilyList: Mn,
|
|
593
|
-
button({ editor: t, extension: n, t:
|
|
593
|
+
button({ editor: t, extension: n, t: a }) {
|
|
594
594
|
var d;
|
|
595
|
-
const { extensions:
|
|
596
|
-
(
|
|
597
|
-
),
|
|
595
|
+
const { extensions: i = [] } = t.extensionManager ?? [], o = Ae(((d = n == null ? void 0 : n.options) == null ? void 0 : d.fontFamilyList) || []), r = i.find(
|
|
596
|
+
(c) => c.name === "base-kit"
|
|
597
|
+
), l = o.map((c) => ({
|
|
598
598
|
action: () => {
|
|
599
|
-
t.chain().focus().setFontFamily(
|
|
599
|
+
t.chain().focus().setFontFamily(c.value).run();
|
|
600
600
|
},
|
|
601
|
-
isActive: () => t.isActive("textStyle", { fontFamily:
|
|
602
|
-
disabled: !t.can().setFontFamily(
|
|
603
|
-
title:
|
|
604
|
-
font:
|
|
601
|
+
isActive: () => t.isActive("textStyle", { fontFamily: c.value }) || !1,
|
|
602
|
+
disabled: !t.can().setFontFamily(c.value),
|
|
603
|
+
title: c.name,
|
|
604
|
+
font: c.value
|
|
605
605
|
}));
|
|
606
|
-
|
|
606
|
+
r && r.options.textStyle !== !1 && l.unshift({
|
|
607
607
|
action: () => t.chain().focus().unsetFontFamily().run(),
|
|
608
608
|
isActive: () => !1,
|
|
609
609
|
disabled: !1,
|
|
610
|
-
font:
|
|
611
|
-
title:
|
|
610
|
+
font: a("editor.fontFamily.default.tooltip"),
|
|
611
|
+
title: a("editor.fontFamily.tooltip")
|
|
612
612
|
});
|
|
613
|
-
const
|
|
613
|
+
const u = l.filter((c) => c.disabled).length === l.length;
|
|
614
614
|
return {
|
|
615
|
-
component:
|
|
615
|
+
component: la,
|
|
616
616
|
componentProps: {
|
|
617
|
-
tooltip:
|
|
618
|
-
disabled:
|
|
619
|
-
items:
|
|
617
|
+
tooltip: a("editor.fontFamily.tooltip"),
|
|
618
|
+
disabled: u,
|
|
619
|
+
items: l,
|
|
620
620
|
editor: t
|
|
621
621
|
}
|
|
622
622
|
};
|
|
@@ -624,26 +624,26 @@ const Ga = kt.extend({
|
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
626
|
});
|
|
627
|
-
function
|
|
627
|
+
function ca(e) {
|
|
628
628
|
var n;
|
|
629
629
|
const t = R(() => {
|
|
630
630
|
var o;
|
|
631
|
-
const
|
|
632
|
-
return
|
|
633
|
-
...
|
|
631
|
+
const a = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((r) => r.isActive());
|
|
632
|
+
return a && !a.default ? {
|
|
633
|
+
...a
|
|
634
634
|
} : {
|
|
635
635
|
title: e.tooltip,
|
|
636
636
|
level: 0,
|
|
637
637
|
isActive: () => !1
|
|
638
638
|
};
|
|
639
639
|
}, [e]);
|
|
640
|
-
return /* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
641
|
+
/* @__PURE__ */ s(
|
|
642
642
|
Q,
|
|
643
643
|
{
|
|
644
644
|
asChild: !0,
|
|
645
645
|
disabled: e == null ? void 0 : e.disabled,
|
|
646
|
-
children: /* @__PURE__ */
|
|
646
|
+
children: /* @__PURE__ */ s(
|
|
647
647
|
$e,
|
|
648
648
|
{
|
|
649
649
|
disabled: e == null ? void 0 : e.disabled,
|
|
@@ -654,58 +654,58 @@ function li(e) {
|
|
|
654
654
|
)
|
|
655
655
|
}
|
|
656
656
|
),
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
var o,
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ s(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, i) => {
|
|
658
|
+
var o, r;
|
|
659
|
+
return /* @__PURE__ */ m(Ee, { children: [
|
|
660
|
+
/* @__PURE__ */ m(
|
|
661
661
|
ne,
|
|
662
662
|
{
|
|
663
|
-
checked: (t == null ? void 0 : t.title) ===
|
|
664
|
-
onClick:
|
|
663
|
+
checked: (t == null ? void 0 : t.title) === a.title,
|
|
664
|
+
onClick: a.action,
|
|
665
665
|
children: [
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
!!((o =
|
|
666
|
+
/* @__PURE__ */ s("div", { className: `heading- ml-1 h-full${a.level}`, children: a.title }),
|
|
667
|
+
!!((o = a == null ? void 0 : a.shortcutKeys) != null && o.length) && /* @__PURE__ */ s(_n, { className: "pl-4", children: (r = a == null ? void 0 : a.shortcutKeys) == null ? void 0 : r.map((l) => je(l)).join(" ") })
|
|
668
668
|
]
|
|
669
669
|
}
|
|
670
670
|
),
|
|
671
|
-
|
|
672
|
-
] }, `heading-k-${
|
|
671
|
+
a.level === 0 && /* @__PURE__ */ s(et, {})
|
|
672
|
+
] }, `heading-k-${i}`);
|
|
673
673
|
}) })
|
|
674
674
|
] });
|
|
675
675
|
}
|
|
676
|
-
const
|
|
676
|
+
const Zi = xt.extend({
|
|
677
677
|
addOptions() {
|
|
678
678
|
var e;
|
|
679
679
|
return {
|
|
680
680
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
681
681
|
levels: [1, 2, 3, 4, 5, 6],
|
|
682
|
-
button({ editor: t, extension: n, t:
|
|
682
|
+
button({ editor: t, extension: n, t: a }) {
|
|
683
683
|
var d;
|
|
684
|
-
const { extensions:
|
|
685
|
-
(
|
|
686
|
-
),
|
|
687
|
-
action: () => t.commands.toggleHeading({ level:
|
|
688
|
-
isActive: () => t.isActive("heading", { level:
|
|
689
|
-
disabled: !t.can().toggleHeading({ level:
|
|
690
|
-
title:
|
|
691
|
-
level:
|
|
692
|
-
shortcutKeys: ["alt", "mod", `${
|
|
684
|
+
const { extensions: i = [] } = t.extensionManager ?? [], o = ((d = n.options) == null ? void 0 : d.levels) || [], r = i.find(
|
|
685
|
+
(c) => c.name === "base-kit"
|
|
686
|
+
), l = o.map((c) => ({
|
|
687
|
+
action: () => t.commands.toggleHeading({ level: c }),
|
|
688
|
+
isActive: () => t.isActive("heading", { level: c }) || !1,
|
|
689
|
+
disabled: !t.can().toggleHeading({ level: c }),
|
|
690
|
+
title: a(`editor.heading.h${c}.tooltip`),
|
|
691
|
+
level: c,
|
|
692
|
+
shortcutKeys: ["alt", "mod", `${c}`]
|
|
693
693
|
}));
|
|
694
|
-
|
|
694
|
+
r && r.options.paragraph !== !1 && l.unshift({
|
|
695
695
|
action: () => t.commands.setParagraph(),
|
|
696
696
|
isActive: () => t.isActive("paragraph") || !1,
|
|
697
697
|
disabled: !t.can().setParagraph(),
|
|
698
698
|
level: 0,
|
|
699
|
-
title:
|
|
699
|
+
title: a("editor.paragraph.tooltip"),
|
|
700
700
|
shortcutKeys: ["alt", "mod", "0"]
|
|
701
701
|
});
|
|
702
|
-
const
|
|
702
|
+
const u = l.filter((c) => c.disabled).length === l.length;
|
|
703
703
|
return {
|
|
704
|
-
component:
|
|
704
|
+
component: ca,
|
|
705
705
|
componentProps: {
|
|
706
|
-
tooltip:
|
|
707
|
-
disabled:
|
|
708
|
-
items:
|
|
706
|
+
tooltip: a("editor.heading.tooltip"),
|
|
707
|
+
disabled: u,
|
|
708
|
+
items: l,
|
|
709
709
|
editor: t
|
|
710
710
|
}
|
|
711
711
|
};
|
|
@@ -713,37 +713,37 @@ const Za = vt.extend({
|
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
|
-
function
|
|
716
|
+
function da(e) {
|
|
717
717
|
var n;
|
|
718
718
|
const t = R(() => {
|
|
719
719
|
var o;
|
|
720
|
-
const
|
|
721
|
-
return
|
|
722
|
-
...
|
|
723
|
-
icon:
|
|
720
|
+
const a = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((r) => r.isActive());
|
|
721
|
+
return a && !a.default ? {
|
|
722
|
+
...a,
|
|
723
|
+
icon: a.icon ? a.icon : e.icon
|
|
724
724
|
} : {
|
|
725
725
|
title: e == null ? void 0 : e.tooltip,
|
|
726
726
|
icon: e.icon,
|
|
727
727
|
isActive: () => !1
|
|
728
728
|
};
|
|
729
729
|
}, [e]);
|
|
730
|
-
return /* @__PURE__ */
|
|
731
|
-
/* @__PURE__ */
|
|
730
|
+
return /* @__PURE__ */ m(ce, { modal: !0, children: [
|
|
731
|
+
/* @__PURE__ */ s(
|
|
732
732
|
de,
|
|
733
733
|
{
|
|
734
734
|
asChild: !0,
|
|
735
735
|
disabled: e == null ? void 0 : e.disabled,
|
|
736
|
-
children: /* @__PURE__ */
|
|
737
|
-
|
|
736
|
+
children: /* @__PURE__ */ s(
|
|
737
|
+
p,
|
|
738
738
|
{
|
|
739
|
-
customClass: "!
|
|
739
|
+
customClass: "!w-12 h-12",
|
|
740
740
|
disabled: e == null ? void 0 : e.disabled,
|
|
741
741
|
icon: e == null ? void 0 : e.icon,
|
|
742
742
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
743
|
-
children: /* @__PURE__ */
|
|
743
|
+
children: /* @__PURE__ */ s(
|
|
744
744
|
M,
|
|
745
745
|
{
|
|
746
|
-
className: "
|
|
746
|
+
className: "ml-1 size-3 text-zinc-500",
|
|
747
747
|
name: "MenuDown"
|
|
748
748
|
}
|
|
749
749
|
)
|
|
@@ -751,37 +751,37 @@ function di(e) {
|
|
|
751
751
|
)
|
|
752
752
|
}
|
|
753
753
|
),
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
-
|
|
754
|
+
/* @__PURE__ */ s(
|
|
755
|
+
ue,
|
|
756
756
|
{
|
|
757
757
|
align: "start",
|
|
758
|
-
className: "
|
|
758
|
+
className: "flex w-full min-w-4 flex-row gap-1 !p-[4px]",
|
|
759
759
|
side: "bottom",
|
|
760
|
-
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((
|
|
761
|
-
var o,
|
|
762
|
-
return /* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
760
|
+
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, i) => {
|
|
761
|
+
var o, r;
|
|
762
|
+
return /* @__PURE__ */ m(we, { children: [
|
|
763
|
+
/* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ s(
|
|
764
764
|
Be,
|
|
765
765
|
{
|
|
766
|
-
className: "
|
|
767
|
-
"data-state": t.title ===
|
|
768
|
-
onClick:
|
|
769
|
-
pressed: t.title ===
|
|
766
|
+
className: "size-7 p-1",
|
|
767
|
+
"data-state": t.title === a.title ? "on" : "off",
|
|
768
|
+
onClick: a == null ? void 0 : a.action,
|
|
769
|
+
pressed: t.title === a.title,
|
|
770
770
|
size: "sm",
|
|
771
|
-
children: (
|
|
771
|
+
children: (a == null ? void 0 : a.icon) && /* @__PURE__ */ s(M, { name: a.icon })
|
|
772
772
|
}
|
|
773
773
|
) }),
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
776
|
-
!!((o =
|
|
774
|
+
/* @__PURE__ */ m(ke, { className: "flex flex-col items-center", children: [
|
|
775
|
+
/* @__PURE__ */ s("span", { children: a.title }),
|
|
776
|
+
!!((o = a.shortcutKeys) != null && o.length) && /* @__PURE__ */ s("span", { children: (r = a.shortcutKeys) == null ? void 0 : r.map((l) => je(l)).join(" ") })
|
|
777
777
|
] })
|
|
778
|
-
] }, `text-align-${
|
|
778
|
+
] }, `text-align-${i}`);
|
|
779
779
|
})
|
|
780
780
|
}
|
|
781
781
|
)
|
|
782
782
|
] });
|
|
783
783
|
}
|
|
784
|
-
const
|
|
784
|
+
const Ji = Ct.extend({
|
|
785
785
|
addOptions() {
|
|
786
786
|
var e;
|
|
787
787
|
return {
|
|
@@ -790,62 +790,62 @@ const Ja = Ct.extend({
|
|
|
790
790
|
button({
|
|
791
791
|
editor: t,
|
|
792
792
|
extension: n,
|
|
793
|
-
t:
|
|
793
|
+
t: a
|
|
794
794
|
}) {
|
|
795
795
|
var d;
|
|
796
|
-
const
|
|
796
|
+
const i = ((d = n.options) == null ? void 0 : d.alignments) || [], o = {
|
|
797
797
|
left: ["mod", "Shift", "L"],
|
|
798
798
|
center: ["mod", "Shift", "E"],
|
|
799
799
|
right: ["mod", "Shift", "R"],
|
|
800
800
|
justify: ["mod", "Shift", "J"]
|
|
801
|
-
},
|
|
801
|
+
}, r = {
|
|
802
802
|
left: "AlignLeft",
|
|
803
803
|
center: "AlignCenter",
|
|
804
804
|
right: "AlignRight",
|
|
805
805
|
justify: "AlignJustify"
|
|
806
|
-
},
|
|
807
|
-
var
|
|
806
|
+
}, l = i.map((c) => {
|
|
807
|
+
var h, _, f;
|
|
808
808
|
return {
|
|
809
|
-
title:
|
|
810
|
-
icon:
|
|
811
|
-
shortcutKeys: o[
|
|
812
|
-
isActive: () => t.isActive({ textAlign:
|
|
809
|
+
title: a(`editor.textalign.${c}.tooltip`),
|
|
810
|
+
icon: r[c],
|
|
811
|
+
shortcutKeys: o[c],
|
|
812
|
+
isActive: () => t.isActive({ textAlign: c }) || !1,
|
|
813
813
|
action: () => {
|
|
814
|
-
var
|
|
815
|
-
return (
|
|
814
|
+
var w, y;
|
|
815
|
+
return (y = (w = t.commands) == null ? void 0 : w.setTextAlign) == null ? void 0 : y.call(w, c);
|
|
816
816
|
},
|
|
817
|
-
disabled: !((f = (_ = (
|
|
817
|
+
disabled: !((f = (_ = (h = t == null ? void 0 : t.can) == null ? void 0 : h.call(t)) == null ? void 0 : _.setTextAlign) != null && f.call(_, c))
|
|
818
818
|
};
|
|
819
|
-
}),
|
|
819
|
+
}), u = l.filter((c) => c.disabled).length === l.length;
|
|
820
820
|
return {
|
|
821
|
-
component:
|
|
821
|
+
component: da,
|
|
822
822
|
componentProps: {
|
|
823
823
|
icon: "AlignJustify",
|
|
824
|
-
tooltip:
|
|
825
|
-
disabled:
|
|
826
|
-
items:
|
|
824
|
+
tooltip: a("editor.textalign.tooltip"),
|
|
825
|
+
disabled: u,
|
|
826
|
+
items: l
|
|
827
827
|
}
|
|
828
828
|
};
|
|
829
829
|
}
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
832
|
});
|
|
833
|
-
function
|
|
834
|
-
var
|
|
833
|
+
function ua(e) {
|
|
834
|
+
var a;
|
|
835
835
|
const { t } = j(), n = R(() => {
|
|
836
|
-
const
|
|
837
|
-
return
|
|
836
|
+
const i = (e.items || []).find((r) => r.isActive());
|
|
837
|
+
return i || {
|
|
838
838
|
title: t("editor.fontSize.default.tooltip"),
|
|
839
839
|
isActive: () => !1
|
|
840
840
|
};
|
|
841
841
|
}, [e]);
|
|
842
|
-
return /* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
843
|
+
/* @__PURE__ */ s(
|
|
844
844
|
Q,
|
|
845
845
|
{
|
|
846
846
|
asChild: !0,
|
|
847
847
|
disabled: e == null ? void 0 : e.disabled,
|
|
848
|
-
children: /* @__PURE__ */
|
|
848
|
+
children: /* @__PURE__ */ s(
|
|
849
849
|
$e,
|
|
850
850
|
{
|
|
851
851
|
disabled: e == null ? void 0 : e.disabled,
|
|
@@ -856,18 +856,18 @@ function hi(e) {
|
|
|
856
856
|
)
|
|
857
857
|
}
|
|
858
858
|
),
|
|
859
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ s(X, { className: "max-h-96 w-32 overflow-y-auto", children: (a = e == null ? void 0 : e.items) == null ? void 0 : a.map((i, o) => /* @__PURE__ */ s(
|
|
860
860
|
ne,
|
|
861
861
|
{
|
|
862
|
-
checked: n.title ===
|
|
863
|
-
onClick:
|
|
864
|
-
children: /* @__PURE__ */
|
|
862
|
+
checked: n.title === i.title,
|
|
863
|
+
onClick: i.action,
|
|
864
|
+
children: /* @__PURE__ */ s("div", { className: "ml-1 h-full", children: i.title })
|
|
865
865
|
},
|
|
866
866
|
`font-size-${o}`
|
|
867
867
|
)) })
|
|
868
868
|
] });
|
|
869
869
|
}
|
|
870
|
-
const
|
|
870
|
+
const Yi = A.create({
|
|
871
871
|
name: "fontSize",
|
|
872
872
|
addOptions() {
|
|
873
873
|
var e;
|
|
@@ -875,13 +875,13 @@ const Ya = A.create({
|
|
|
875
875
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
876
876
|
types: ["textStyle"],
|
|
877
877
|
fontSizes: [...Pn],
|
|
878
|
-
button({ editor: t, extension: n, t:
|
|
879
|
-
var
|
|
880
|
-
const
|
|
881
|
-
title: d.value === o.value ?
|
|
878
|
+
button({ editor: t, extension: n, t: a }) {
|
|
879
|
+
var u;
|
|
880
|
+
const i = Ae(((u = n.options) == null ? void 0 : u.fontSizes) || Ke), o = Ae([Ke])[0], r = i.map((d) => ({
|
|
881
|
+
title: d.value === o.value ? a("editor.fontSize.default.tooltip") : String(d.name),
|
|
882
882
|
isActive: () => {
|
|
883
|
-
const { fontSize:
|
|
884
|
-
return d.value === o.value &&
|
|
883
|
+
const { fontSize: c } = t.getAttributes("textStyle");
|
|
884
|
+
return d.value === o.value && c === void 0 ? !0 : t.isActive({ fontSize: String(d.value) }) || !1;
|
|
885
885
|
},
|
|
886
886
|
action: () => {
|
|
887
887
|
if (d.value === o.value) {
|
|
@@ -893,14 +893,14 @@ const Ya = A.create({
|
|
|
893
893
|
disabled: !t.can().setFontSize(String(d.value)),
|
|
894
894
|
divider: d.value === o.value || !1,
|
|
895
895
|
default: d.value === o.value || !1
|
|
896
|
-
})),
|
|
896
|
+
})), l = r.filter((d) => d.disabled).length === r.length;
|
|
897
897
|
return {
|
|
898
|
-
component:
|
|
898
|
+
component: ua,
|
|
899
899
|
componentProps: {
|
|
900
900
|
editor: t,
|
|
901
|
-
tooltip:
|
|
902
|
-
disabled:
|
|
903
|
-
items:
|
|
901
|
+
tooltip: a("editor.fontSize.tooltip"),
|
|
902
|
+
disabled: l,
|
|
903
|
+
items: r,
|
|
904
904
|
maxHeight: 280
|
|
905
905
|
}
|
|
906
906
|
};
|
|
@@ -930,8 +930,8 @@ const Ya = A.create({
|
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
932
|
});
|
|
933
|
-
function
|
|
934
|
-
return /* @__PURE__ */
|
|
933
|
+
function ma({ fill: e }) {
|
|
934
|
+
return /* @__PURE__ */ s(
|
|
935
935
|
"svg",
|
|
936
936
|
{
|
|
937
937
|
width: "18px",
|
|
@@ -939,8 +939,8 @@ function ui({ fill: e }) {
|
|
|
939
939
|
viewBox: "0 0 240 240",
|
|
940
940
|
version: "1.1",
|
|
941
941
|
xmlns: "http://www.w3.org/2000/svg",
|
|
942
|
-
children: /* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
942
|
+
children: /* @__PURE__ */ s("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ s("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */ m("g", { transform: "translate(39.000000, 17.353553)", children: [
|
|
943
|
+
/* @__PURE__ */ s(
|
|
944
944
|
"path",
|
|
945
945
|
{
|
|
946
946
|
d: "M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",
|
|
@@ -949,7 +949,7 @@ function ui({ fill: e }) {
|
|
|
949
949
|
fillRule: "evenodd"
|
|
950
950
|
}
|
|
951
951
|
),
|
|
952
|
-
/* @__PURE__ */
|
|
952
|
+
/* @__PURE__ */ s(
|
|
953
953
|
"path",
|
|
954
954
|
{
|
|
955
955
|
d: "M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",
|
|
@@ -958,7 +958,7 @@ function ui({ fill: e }) {
|
|
|
958
958
|
fillRule: "nonzero"
|
|
959
959
|
}
|
|
960
960
|
),
|
|
961
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ s(
|
|
962
962
|
"path",
|
|
963
963
|
{
|
|
964
964
|
d: "M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",
|
|
@@ -971,55 +971,55 @@ function ui({ fill: e }) {
|
|
|
971
971
|
}
|
|
972
972
|
);
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function ha(e) {
|
|
975
975
|
const [t, n] = C(void 0);
|
|
976
|
-
function
|
|
977
|
-
var
|
|
978
|
-
(
|
|
976
|
+
function a(r) {
|
|
977
|
+
var l;
|
|
978
|
+
(l = e.action) == null || l.call(e, r);
|
|
979
979
|
}
|
|
980
|
-
function
|
|
981
|
-
var
|
|
982
|
-
(
|
|
980
|
+
function i() {
|
|
981
|
+
var r;
|
|
982
|
+
(r = e.action) == null || r.call(e, t);
|
|
983
983
|
}
|
|
984
984
|
const o = F(
|
|
985
|
-
Gt((
|
|
986
|
-
n(
|
|
985
|
+
Gt((r) => {
|
|
986
|
+
n(r);
|
|
987
987
|
}, 350),
|
|
988
988
|
[]
|
|
989
989
|
);
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ m("div", { className: "flex items-center h-[32px]", children: [
|
|
991
|
+
/* @__PURE__ */ s(p, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: i, children: /* @__PURE__ */ s("span", { className: "flex items-center justify-center text-sm", children: /* @__PURE__ */ s(ma, { fill: t }) }) }),
|
|
992
|
+
/* @__PURE__ */ s(
|
|
993
993
|
fn,
|
|
994
994
|
{
|
|
995
995
|
selectedColor: t,
|
|
996
996
|
setSelectedColor: o,
|
|
997
|
-
onChange:
|
|
997
|
+
onChange: a,
|
|
998
998
|
disabled: e == null ? void 0 : e.disabled,
|
|
999
999
|
colors: e == null ? void 0 : e.colors,
|
|
1000
1000
|
defaultColor: e == null ? void 0 : e.defaultColor,
|
|
1001
|
-
children: /* @__PURE__ */
|
|
1001
|
+
children: /* @__PURE__ */ s(V, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ s(M, { className: "!w-3 !h-3 text-zinc-500", name: "MenuDown" }) })
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
] });
|
|
1005
1005
|
}
|
|
1006
|
-
const
|
|
1006
|
+
const Qi = Nt.extend({
|
|
1007
1007
|
addOptions() {
|
|
1008
1008
|
var e;
|
|
1009
1009
|
return {
|
|
1010
1010
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1011
|
-
button({ editor: t, t: n, extension:
|
|
1011
|
+
button({ editor: t, t: n, extension: a }) {
|
|
1012
1012
|
return {
|
|
1013
|
-
component:
|
|
1013
|
+
component: ha,
|
|
1014
1014
|
componentProps: {
|
|
1015
|
-
colors:
|
|
1016
|
-
defaultColor:
|
|
1017
|
-
action: (
|
|
1018
|
-
|
|
1015
|
+
colors: a.options.colors,
|
|
1016
|
+
defaultColor: a.options.defaultColor,
|
|
1017
|
+
action: (i) => {
|
|
1018
|
+
i === void 0 && t.chain().focus().unsetColor().run(), typeof i == "string" && t.chain().focus().setColor(i).run();
|
|
1019
1019
|
},
|
|
1020
1020
|
isActive: () => {
|
|
1021
|
-
const { color:
|
|
1022
|
-
return
|
|
1021
|
+
const { color: i } = t.getAttributes("textStyle");
|
|
1022
|
+
return i && t.isActive({ color: i }) || !1;
|
|
1023
1023
|
},
|
|
1024
1024
|
editor: t,
|
|
1025
1025
|
disabled: !t.can().setColor(""),
|
|
@@ -1029,7 +1029,7 @@ const Qa = Nt.extend({
|
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
|
-
}),
|
|
1032
|
+
}), Xi = At.extend({
|
|
1033
1033
|
addOptions() {
|
|
1034
1034
|
var e;
|
|
1035
1035
|
return {
|
|
@@ -1038,8 +1038,8 @@ const Qa = Nt.extend({
|
|
|
1038
1038
|
button: ({ editor: t, t: n }) => ({
|
|
1039
1039
|
component: gn,
|
|
1040
1040
|
componentProps: {
|
|
1041
|
-
action: (
|
|
1042
|
-
typeof
|
|
1041
|
+
action: (a) => {
|
|
1042
|
+
typeof a == "string" && t.chain().focus().setHighlight({ color: a }).run(), a === void 0 && t.chain().focus().unsetHighlight().run();
|
|
1043
1043
|
},
|
|
1044
1044
|
editor: t,
|
|
1045
1045
|
isActive: () => t.isActive("highlight") || !1,
|
|
@@ -1056,7 +1056,7 @@ const Qa = Nt.extend({
|
|
|
1056
1056
|
return {
|
|
1057
1057
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1058
1058
|
button: ({ editor: t, t: n }) => ({
|
|
1059
|
-
component:
|
|
1059
|
+
component: p,
|
|
1060
1060
|
componentProps: {
|
|
1061
1061
|
action: () => t.commands.toggleBulletList(),
|
|
1062
1062
|
isActive: () => t.isActive("bulletList") || !1,
|
|
@@ -1075,7 +1075,7 @@ const Qa = Nt.extend({
|
|
|
1075
1075
|
return {
|
|
1076
1076
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1077
1077
|
button: ({ editor: t, t: n }) => ({
|
|
1078
|
-
component:
|
|
1078
|
+
component: p,
|
|
1079
1079
|
componentProps: {
|
|
1080
1080
|
action: () => t.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
1081
1081
|
disabled: !t.can().chain().focus().clearNodes().unsetAllMarks().run(),
|
|
@@ -1091,7 +1091,7 @@ const Qa = Nt.extend({
|
|
|
1091
1091
|
return {
|
|
1092
1092
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1093
1093
|
button: ({ editor: t, t: n }) => ({
|
|
1094
|
-
component:
|
|
1094
|
+
component: p,
|
|
1095
1095
|
componentProps: {
|
|
1096
1096
|
action: () => t.commands.toggleOrderedList(),
|
|
1097
1097
|
isActive: () => t.isActive("orderedList") || !1,
|
|
@@ -1103,7 +1103,7 @@ const Qa = Nt.extend({
|
|
|
1103
1103
|
})
|
|
1104
1104
|
};
|
|
1105
1105
|
}
|
|
1106
|
-
}),
|
|
1106
|
+
}), ao = Tt.extend({
|
|
1107
1107
|
addOptions() {
|
|
1108
1108
|
var e;
|
|
1109
1109
|
return {
|
|
@@ -1117,7 +1117,7 @@ const Qa = Nt.extend({
|
|
|
1117
1117
|
}
|
|
1118
1118
|
},
|
|
1119
1119
|
button: ({ editor: t, t: n }) => ({
|
|
1120
|
-
component:
|
|
1120
|
+
component: p,
|
|
1121
1121
|
componentProps: {
|
|
1122
1122
|
action: () => t.commands.toggleTaskList(),
|
|
1123
1123
|
isActive: () => t.isActive("taskList") || !1,
|
|
@@ -1132,7 +1132,7 @@ const Qa = Nt.extend({
|
|
|
1132
1132
|
addExtensions() {
|
|
1133
1133
|
return [Et.configure(this.options.taskItem)];
|
|
1134
1134
|
}
|
|
1135
|
-
}),
|
|
1135
|
+
}), io = Ht.extend({
|
|
1136
1136
|
addOptions() {
|
|
1137
1137
|
var e;
|
|
1138
1138
|
return {
|
|
@@ -1141,7 +1141,7 @@ const Qa = Nt.extend({
|
|
|
1141
1141
|
class: "blockquote"
|
|
1142
1142
|
},
|
|
1143
1143
|
button: ({ editor: t, t: n }) => ({
|
|
1144
|
-
component:
|
|
1144
|
+
component: p,
|
|
1145
1145
|
componentProps: {
|
|
1146
1146
|
action: () => t.commands.toggleBlockquote(),
|
|
1147
1147
|
isActive: () => t.isActive("blockquote") || !1,
|
|
@@ -1154,22 +1154,22 @@ const Qa = Nt.extend({
|
|
|
1154
1154
|
};
|
|
1155
1155
|
}
|
|
1156
1156
|
});
|
|
1157
|
-
function
|
|
1157
|
+
function _a(e) {
|
|
1158
1158
|
const [t, n] = C(!1);
|
|
1159
|
-
function i
|
|
1160
|
-
e.action && (e.action({ link:
|
|
1159
|
+
function a(i, o, r) {
|
|
1160
|
+
e.action && (e.action({ link: i, text: o, openInNewTab: r }), n(!1));
|
|
1161
1161
|
}
|
|
1162
|
-
return /* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
|
|
1162
|
+
return /* @__PURE__ */ m(ce, { modal: !0, open: t, onOpenChange: n, children: [
|
|
1163
|
+
/* @__PURE__ */ s(de, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ s(
|
|
1164
|
+
p,
|
|
1165
1165
|
{
|
|
1166
1166
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1167
1167
|
isActive: e == null ? void 0 : e.isActive,
|
|
1168
1168
|
disabled: e == null ? void 0 : e.disabled,
|
|
1169
|
-
children: /* @__PURE__ */
|
|
1169
|
+
children: /* @__PURE__ */ s(M, { name: e == null ? void 0 : e.icon })
|
|
1170
1170
|
}
|
|
1171
1171
|
) }),
|
|
1172
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ s(ue, { hideWhenDetached: !0, className: "w-full", align: "start", side: "bottom", children: /* @__PURE__ */ s(bn, { editor: e.editor, onSetLink: a }) })
|
|
1173
1173
|
] });
|
|
1174
1174
|
}
|
|
1175
1175
|
const oo = zt.extend({
|
|
@@ -1196,11 +1196,11 @@ const oo = zt.extend({
|
|
|
1196
1196
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1197
1197
|
openOnClick: !0,
|
|
1198
1198
|
button: ({ editor: t, t: n }) => ({
|
|
1199
|
-
component:
|
|
1199
|
+
component: _a,
|
|
1200
1200
|
componentProps: {
|
|
1201
1201
|
editor: t,
|
|
1202
|
-
action: (
|
|
1203
|
-
const { link:
|
|
1202
|
+
action: (a) => {
|
|
1203
|
+
const { link: i, text: o, openInNewTab: r } = a;
|
|
1204
1204
|
t.chain().extendMarkRange("link").insertContent({
|
|
1205
1205
|
type: "text",
|
|
1206
1206
|
text: o,
|
|
@@ -1208,12 +1208,12 @@ const oo = zt.extend({
|
|
|
1208
1208
|
{
|
|
1209
1209
|
type: "link",
|
|
1210
1210
|
attrs: {
|
|
1211
|
-
href:
|
|
1212
|
-
target:
|
|
1211
|
+
href: i,
|
|
1212
|
+
target: r ? "_blank" : ""
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
]
|
|
1216
|
-
}).setLink({ href:
|
|
1216
|
+
}).setLink({ href: i }).focus().run();
|
|
1217
1217
|
},
|
|
1218
1218
|
id: "linkk",
|
|
1219
1219
|
isActive: () => t.isActive("link") || !1,
|
|
@@ -1229,17 +1229,17 @@ const oo = zt.extend({
|
|
|
1229
1229
|
new te({
|
|
1230
1230
|
props: {
|
|
1231
1231
|
handleClick: (e, t) => {
|
|
1232
|
-
const { schema: n, doc:
|
|
1232
|
+
const { schema: n, doc: a, tr: i } = e.state, o = Mt(a.resolve(t), n.marks.link);
|
|
1233
1233
|
if (!o)
|
|
1234
1234
|
return !1;
|
|
1235
|
-
const
|
|
1236
|
-
e.dispatch(
|
|
1235
|
+
const r = a.resolve(o.from), l = a.resolve(o.to), u = i.setSelection(new Xe(r, l));
|
|
1236
|
+
e.dispatch(u);
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
})
|
|
1240
1240
|
];
|
|
1241
1241
|
}
|
|
1242
|
-
}),
|
|
1242
|
+
}), so = Pt.extend({
|
|
1243
1243
|
renderHTML() {
|
|
1244
1244
|
return [
|
|
1245
1245
|
"div",
|
|
@@ -1254,7 +1254,7 @@ const oo = zt.extend({
|
|
|
1254
1254
|
return {
|
|
1255
1255
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1256
1256
|
button: ({ editor: t, t: n }) => ({
|
|
1257
|
-
component:
|
|
1257
|
+
component: p,
|
|
1258
1258
|
componentProps: {
|
|
1259
1259
|
action: () => t.commands.setHorizontalRule(),
|
|
1260
1260
|
disabled: !t.can().setHorizontalRule(),
|
|
@@ -1271,75 +1271,75 @@ const oo = zt.extend({
|
|
|
1271
1271
|
};
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
|
-
function
|
|
1274
|
+
function fa(e) {
|
|
1275
1275
|
var d;
|
|
1276
1276
|
const {
|
|
1277
1277
|
icon: t = void 0,
|
|
1278
1278
|
// title = undefined,
|
|
1279
1279
|
tooltip: n = void 0,
|
|
1280
1280
|
// disabled = false,
|
|
1281
|
-
customClass:
|
|
1281
|
+
customClass: a = "",
|
|
1282
1282
|
// color = undefined,
|
|
1283
1283
|
// loading = false,
|
|
1284
1284
|
// shortcutKeys = undefined,
|
|
1285
|
-
tooltipOptions:
|
|
1285
|
+
tooltipOptions: i = {},
|
|
1286
1286
|
action: o = void 0,
|
|
1287
|
-
isActive:
|
|
1288
|
-
children:
|
|
1289
|
-
} = e,
|
|
1290
|
-
return /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1287
|
+
isActive: r = void 0,
|
|
1288
|
+
children: l
|
|
1289
|
+
} = e, u = Pe[t];
|
|
1290
|
+
return /* @__PURE__ */ m(we, { children: [
|
|
1291
|
+
/* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ m(
|
|
1292
1292
|
Be,
|
|
1293
1293
|
{
|
|
1294
1294
|
size: "sm",
|
|
1295
|
-
className: `
|
|
1296
|
-
disabled:
|
|
1295
|
+
className: `w-[32px] h-[32px] ${a}`,
|
|
1296
|
+
disabled: r == null ? void 0 : r(),
|
|
1297
1297
|
onClick: o,
|
|
1298
1298
|
children: [
|
|
1299
|
-
|
|
1300
|
-
|
|
1299
|
+
u && /* @__PURE__ */ s(u, { className: "w-4 h-4" }),
|
|
1300
|
+
l && /* @__PURE__ */ s(pe, { children: l })
|
|
1301
1301
|
]
|
|
1302
1302
|
}
|
|
1303
1303
|
) }),
|
|
1304
|
-
n && /* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
!!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */
|
|
1304
|
+
n && /* @__PURE__ */ s(ke, { ...i, children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center text-center max-w-24", children: [
|
|
1305
|
+
/* @__PURE__ */ s("div", { children: n }),
|
|
1306
|
+
!!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */ s("span", { children: Re(e == null ? void 0 : e.shortcutKeys) })
|
|
1307
1307
|
] }) })
|
|
1308
1308
|
] });
|
|
1309
1309
|
}
|
|
1310
|
-
const
|
|
1310
|
+
const ga = ["undo", "redo"], ro = Rt.extend({
|
|
1311
1311
|
addOptions() {
|
|
1312
1312
|
var e;
|
|
1313
1313
|
return {
|
|
1314
1314
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1315
1315
|
depth: 100,
|
|
1316
1316
|
newGroupDelay: 500,
|
|
1317
|
-
button: ({ editor: t, t: n }) =>
|
|
1318
|
-
component:
|
|
1317
|
+
button: ({ editor: t, t: n }) => ga.map((a) => ({
|
|
1318
|
+
component: fa,
|
|
1319
1319
|
componentProps: {
|
|
1320
1320
|
action: () => {
|
|
1321
|
-
|
|
1321
|
+
a === "undo" && t.chain().focus().undo().run(), a === "redo" && t.chain().focus().redo().run();
|
|
1322
1322
|
},
|
|
1323
|
-
shortcutKeys:
|
|
1324
|
-
disabled:
|
|
1325
|
-
isActive: () =>
|
|
1326
|
-
icon:
|
|
1327
|
-
tooltip: n(`editor.${
|
|
1323
|
+
shortcutKeys: a === "undo" ? ["mod", "Z"] : ["shift", "mod", "Z"],
|
|
1324
|
+
disabled: a === "undo" ? !t.can().undo() : !t.can().redo(),
|
|
1325
|
+
isActive: () => a === "undo" ? !t.can().undo() : !t.can().redo(),
|
|
1326
|
+
icon: a === "undo" ? "Undo2" : "Redo2",
|
|
1327
|
+
tooltip: n(`editor.${a}.tooltip`)
|
|
1328
1328
|
}
|
|
1329
1329
|
}))
|
|
1330
1330
|
};
|
|
1331
1331
|
}
|
|
1332
|
-
}),
|
|
1332
|
+
}), ba = It.extend({
|
|
1333
1333
|
content: "(block|columns)+"
|
|
1334
1334
|
// echo editor is a block editor
|
|
1335
|
-
}),
|
|
1335
|
+
}), lo = A.create({
|
|
1336
1336
|
name: "columnActionButton",
|
|
1337
1337
|
addOptions() {
|
|
1338
1338
|
var e;
|
|
1339
1339
|
return {
|
|
1340
1340
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1341
1341
|
button: ({ editor: t, t: n }) => ({
|
|
1342
|
-
component:
|
|
1342
|
+
component: p,
|
|
1343
1343
|
componentProps: {
|
|
1344
1344
|
action: () => {
|
|
1345
1345
|
t.chain().focus().insertColumns({ cols: 2 }).run();
|
|
@@ -1350,7 +1350,7 @@ const gi = ["undo", "redo"], so = Rt.extend({
|
|
|
1350
1350
|
})
|
|
1351
1351
|
};
|
|
1352
1352
|
}
|
|
1353
|
-
}),
|
|
1353
|
+
}), pa = A.create({
|
|
1354
1354
|
name: "selection",
|
|
1355
1355
|
addProseMirrorPlugins() {
|
|
1356
1356
|
const { editor: e } = this;
|
|
@@ -1359,8 +1359,8 @@ const gi = ["undo", "redo"], so = Rt.extend({
|
|
|
1359
1359
|
key: new Z("selection"),
|
|
1360
1360
|
props: {
|
|
1361
1361
|
decorations(t) {
|
|
1362
|
-
return t.selection.empty || e.isFocused === !0 ? null :
|
|
1363
|
-
|
|
1362
|
+
return t.selection.empty || e.isFocused === !0 ? null : re.create(t.doc, [
|
|
1363
|
+
le.inline(t.selection.from, t.selection.to, {
|
|
1364
1364
|
class: "selection"
|
|
1365
1365
|
})
|
|
1366
1366
|
]);
|
|
@@ -1370,7 +1370,7 @@ const gi = ["undo", "redo"], so = Rt.extend({
|
|
|
1370
1370
|
];
|
|
1371
1371
|
}
|
|
1372
1372
|
});
|
|
1373
|
-
function
|
|
1373
|
+
function wa(e) {
|
|
1374
1374
|
const { t } = j(), n = R(() => [
|
|
1375
1375
|
{
|
|
1376
1376
|
name: "paragraph",
|
|
@@ -1435,45 +1435,45 @@ function pi(e) {
|
|
|
1435
1435
|
iconName: "Code2",
|
|
1436
1436
|
action: () => e.editor.chain().focus().clearNodes().toggleCodeBlock().run()
|
|
1437
1437
|
}
|
|
1438
|
-
], [e.editor, t]),
|
|
1438
|
+
], [e.editor, t]), a = R(() => n.findLast((i) => i.isActive()) ?? {
|
|
1439
1439
|
label: "Empty"
|
|
1440
1440
|
}, [n]);
|
|
1441
|
-
return /* @__PURE__ */
|
|
1442
|
-
/* @__PURE__ */
|
|
1441
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
1442
|
+
/* @__PURE__ */ s(Q, { asChild: !0, children: /* @__PURE__ */ m(
|
|
1443
1443
|
V,
|
|
1444
1444
|
{
|
|
1445
|
-
className: "
|
|
1445
|
+
className: "flex h-[32px] gap-1 px-1.5",
|
|
1446
1446
|
variant: "ghost",
|
|
1447
1447
|
children: [
|
|
1448
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ m("span", { className: "whitespace-nowrap text-sm font-normal", children: [
|
|
1449
1449
|
" ",
|
|
1450
|
-
|
|
1450
|
+
a == null ? void 0 : a.label
|
|
1451
1451
|
] }),
|
|
1452
|
-
/* @__PURE__ */
|
|
1452
|
+
/* @__PURE__ */ s(Me, { className: "size-4" })
|
|
1453
1453
|
]
|
|
1454
1454
|
}
|
|
1455
1455
|
) }),
|
|
1456
|
-
/* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ s(
|
|
1457
1457
|
X,
|
|
1458
1458
|
{
|
|
1459
1459
|
align: "start",
|
|
1460
|
-
className: "
|
|
1460
|
+
className: "w-full p-1",
|
|
1461
1461
|
hideWhenDetached: !0,
|
|
1462
1462
|
sideOffset: 5,
|
|
1463
|
-
children: n.map((
|
|
1464
|
-
var
|
|
1465
|
-
const
|
|
1466
|
-
return /* @__PURE__ */
|
|
1463
|
+
children: n.map((i, o) => {
|
|
1464
|
+
var l;
|
|
1465
|
+
const r = Pe[i.iconName];
|
|
1466
|
+
return /* @__PURE__ */ s(
|
|
1467
1467
|
ne,
|
|
1468
1468
|
{
|
|
1469
|
-
checked: ((
|
|
1470
|
-
className: "
|
|
1471
|
-
onClick: () =>
|
|
1472
|
-
children: /* @__PURE__ */
|
|
1473
|
-
/* @__PURE__ */ r
|
|
1474
|
-
/* @__PURE__ */
|
|
1469
|
+
checked: ((l = i.isActive) == null ? void 0 : l.call(i)) || !1,
|
|
1470
|
+
className: "cursor-pointer",
|
|
1471
|
+
onClick: () => i.action(),
|
|
1472
|
+
children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2 px-2", children: [
|
|
1473
|
+
/* @__PURE__ */ s(r, { className: "h3 w-3" }),
|
|
1474
|
+
/* @__PURE__ */ m("span", { children: [
|
|
1475
1475
|
" ",
|
|
1476
|
-
|
|
1476
|
+
i.label
|
|
1477
1477
|
] })
|
|
1478
1478
|
] })
|
|
1479
1479
|
},
|
|
@@ -1484,7 +1484,7 @@ function pi(e) {
|
|
|
1484
1484
|
)
|
|
1485
1485
|
] });
|
|
1486
1486
|
}
|
|
1487
|
-
const
|
|
1487
|
+
const ya = A.create({
|
|
1488
1488
|
name: "text-bubble",
|
|
1489
1489
|
addOptions() {
|
|
1490
1490
|
var e;
|
|
@@ -1492,7 +1492,7 @@ const wi = A.create({
|
|
|
1492
1492
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1493
1493
|
toolbar: !1,
|
|
1494
1494
|
button: () => ({
|
|
1495
|
-
component:
|
|
1495
|
+
component: wa,
|
|
1496
1496
|
componentProps: {}
|
|
1497
1497
|
})
|
|
1498
1498
|
};
|
|
@@ -1501,7 +1501,7 @@ const wi = A.create({
|
|
|
1501
1501
|
function We({ types: e, node: t }) {
|
|
1502
1502
|
return Array.isArray(e) && e.includes(t.type) || t.type === e;
|
|
1503
1503
|
}
|
|
1504
|
-
const
|
|
1504
|
+
const ka = A.create({
|
|
1505
1505
|
name: "trailingNode",
|
|
1506
1506
|
addOptions() {
|
|
1507
1507
|
return {
|
|
@@ -1514,35 +1514,35 @@ const yi = A.create({
|
|
|
1514
1514
|
return [
|
|
1515
1515
|
new te({
|
|
1516
1516
|
key: e,
|
|
1517
|
-
appendTransaction: (n,
|
|
1518
|
-
const { doc: o, tr:
|
|
1519
|
-
if (
|
|
1520
|
-
return
|
|
1517
|
+
appendTransaction: (n, a, i) => {
|
|
1518
|
+
const { doc: o, tr: r, schema: l } = i, u = e.getState(i), d = o.content.size, c = l.nodes[this.options.node];
|
|
1519
|
+
if (u)
|
|
1520
|
+
return r.insert(d, c.create());
|
|
1521
1521
|
},
|
|
1522
1522
|
state: {
|
|
1523
|
-
init: (n,
|
|
1524
|
-
const
|
|
1525
|
-
return !We({ node:
|
|
1523
|
+
init: (n, a) => {
|
|
1524
|
+
const i = a.tr.doc.lastChild;
|
|
1525
|
+
return !We({ node: i, types: t });
|
|
1526
1526
|
},
|
|
1527
|
-
apply: (n,
|
|
1527
|
+
apply: (n, a) => {
|
|
1528
1528
|
if (!n.docChanged)
|
|
1529
|
-
return
|
|
1530
|
-
const
|
|
1531
|
-
return !We({ node:
|
|
1529
|
+
return a;
|
|
1530
|
+
const i = n.doc.lastChild;
|
|
1531
|
+
return !We({ node: i, types: t });
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
1534
1534
|
})
|
|
1535
1535
|
];
|
|
1536
1536
|
}
|
|
1537
|
-
}),
|
|
1537
|
+
}), co = A.create({
|
|
1538
1538
|
name: "base-kit",
|
|
1539
1539
|
addExtensions() {
|
|
1540
1540
|
const e = [];
|
|
1541
|
-
return this.options.document !== !1 && e.push(
|
|
1541
|
+
return this.options.document !== !1 && e.push(ba.configure()), this.options.placeholder !== !1 && e.push(
|
|
1542
1542
|
jt.configure({
|
|
1543
|
-
placeholder: ({ node: t, pos: n, editor:
|
|
1544
|
-
var
|
|
1545
|
-
return ((
|
|
1543
|
+
placeholder: ({ node: t, pos: n, editor: a }) => {
|
|
1544
|
+
var i, o, r, l, u;
|
|
1545
|
+
return ((i = t == null ? void 0 : t.type) == null ? void 0 : i.name) === "columns" || ((o = t == null ? void 0 : t.content) == null ? void 0 : o.size) !== 0 ? "" : ((r = t == null ? void 0 : t.type) == null ? void 0 : r.name) === "heading" ? `${N.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "codeBlock" || ((u = t == null ? void 0 : t.type) == null ? void 0 : u.name) === "table" ? "" : a.extensionManager.extensions.some((d) => d.name === "slashCommand") ? N.t("editor.slash") : n === 0 ? N.t("editor.content") : N.t("editor.content");
|
|
1546
1546
|
},
|
|
1547
1547
|
...this.options.placeholder
|
|
1548
1548
|
})
|
|
@@ -1551,41 +1551,41 @@ const yi = A.create({
|
|
|
1551
1551
|
className: "focus",
|
|
1552
1552
|
...this.options.focus
|
|
1553
1553
|
})
|
|
1554
|
-
), this.options.text !== !1 && e.push(Dt.configure()), this.options.textBubble !== !1 && e.push(
|
|
1554
|
+
), this.options.text !== !1 && e.push(Dt.configure()), this.options.textBubble !== !1 && e.push(ya.configure()), this.options.gapcursor !== !1 && e.push(Ot.configure()), this.options.dropcursor !== !1 && e.push(
|
|
1555
1555
|
$t.configure({
|
|
1556
1556
|
...this.options.dropcursor,
|
|
1557
1557
|
width: 2,
|
|
1558
1558
|
class: "ProseMirror-dropcursor border-black"
|
|
1559
1559
|
})
|
|
1560
|
-
), this.options.characterCount !== !1 && e.push(Ft.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Ut.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(qt.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Kt.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(Vt.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(
|
|
1560
|
+
), this.options.characterCount !== !1 && e.push(Ft.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Ut.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(qt.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Kt.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(Vt.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(ka.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(pa), this.options.multiColumn !== !1 && e.push(pn, wn), e;
|
|
1561
1561
|
}
|
|
1562
|
-
}),
|
|
1562
|
+
}), uo = A.create({
|
|
1563
1563
|
name: "subAndSuperScript",
|
|
1564
1564
|
addOptions() {
|
|
1565
1565
|
var e;
|
|
1566
1566
|
return {
|
|
1567
1567
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1568
|
-
button: ({ editor: t, extension: n, t:
|
|
1569
|
-
const
|
|
1570
|
-
component:
|
|
1568
|
+
button: ({ editor: t, extension: n, t: a }) => {
|
|
1569
|
+
const i = n.options.subscript, o = n.options.superscript, r = {
|
|
1570
|
+
component: p,
|
|
1571
1571
|
componentProps: {
|
|
1572
1572
|
action: () => t.commands.toggleSubscript(),
|
|
1573
1573
|
isActive: () => t.isActive("subscript") || !1,
|
|
1574
1574
|
disabled: !t.can().toggleSubscript(),
|
|
1575
1575
|
icon: "Subscript",
|
|
1576
|
-
tooltip:
|
|
1576
|
+
tooltip: a("editor.subscript.tooltip")
|
|
1577
1577
|
}
|
|
1578
|
-
},
|
|
1579
|
-
component:
|
|
1578
|
+
}, l = {
|
|
1579
|
+
component: p,
|
|
1580
1580
|
componentProps: {
|
|
1581
1581
|
action: () => t.commands.toggleSuperscript(),
|
|
1582
1582
|
isActive: () => t.isActive("superscript") || !1,
|
|
1583
1583
|
disabled: !t.can().toggleSuperscript(),
|
|
1584
1584
|
icon: "Superscript",
|
|
1585
|
-
tooltip:
|
|
1585
|
+
tooltip: a("editor.superscript.tooltip")
|
|
1586
1586
|
}
|
|
1587
|
-
},
|
|
1588
|
-
return
|
|
1587
|
+
}, u = [];
|
|
1588
|
+
return i !== !1 && u.push(r), o !== !1 && u.push(l), u;
|
|
1589
1589
|
}
|
|
1590
1590
|
};
|
|
1591
1591
|
},
|
|
@@ -1594,83 +1594,83 @@ const yi = A.create({
|
|
|
1594
1594
|
return this.options.subscript !== !1 && e.push(Je.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Ye.configure(this.options.superscript)), e;
|
|
1595
1595
|
}
|
|
1596
1596
|
});
|
|
1597
|
-
function
|
|
1597
|
+
function va(e) {
|
|
1598
1598
|
var n;
|
|
1599
1599
|
const t = R(() => {
|
|
1600
1600
|
var o;
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
1603
|
-
...
|
|
1604
|
-
icon:
|
|
1601
|
+
const a = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((r) => r.isActive());
|
|
1602
|
+
return a && !a.default ? {
|
|
1603
|
+
...a,
|
|
1604
|
+
icon: a != null && a.icon ? a == null ? void 0 : a.icon : e == null ? void 0 : e.icon
|
|
1605
1605
|
} : {
|
|
1606
1606
|
title: e.tooltip,
|
|
1607
1607
|
icon: e.icon,
|
|
1608
1608
|
isActive: () => !1
|
|
1609
1609
|
};
|
|
1610
1610
|
}, [e]);
|
|
1611
|
-
return /* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
1611
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
1612
|
+
/* @__PURE__ */ s(
|
|
1613
1613
|
Q,
|
|
1614
1614
|
{
|
|
1615
1615
|
asChild: !0,
|
|
1616
1616
|
disabled: e == null ? void 0 : e.disabled,
|
|
1617
|
-
children: /* @__PURE__ */
|
|
1618
|
-
|
|
1617
|
+
children: /* @__PURE__ */ s(
|
|
1618
|
+
p,
|
|
1619
1619
|
{
|
|
1620
|
-
customClass: "!
|
|
1620
|
+
customClass: "!w-12 h-12",
|
|
1621
1621
|
disabled: e == null ? void 0 : e.disabled,
|
|
1622
1622
|
icon: e == null ? void 0 : e.icon,
|
|
1623
1623
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1624
|
-
children: /* @__PURE__ */
|
|
1624
|
+
children: /* @__PURE__ */ s(yn, { className: "size-3 text-gray-500" })
|
|
1625
1625
|
}
|
|
1626
1626
|
)
|
|
1627
1627
|
}
|
|
1628
1628
|
),
|
|
1629
|
-
/* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ s(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, i) => /* @__PURE__ */ m(
|
|
1630
1630
|
ne,
|
|
1631
1631
|
{
|
|
1632
|
-
checked: t.title ===
|
|
1633
|
-
className: "
|
|
1634
|
-
onClick:
|
|
1632
|
+
checked: t.title === a.title,
|
|
1633
|
+
className: "flex items-center gap-3",
|
|
1634
|
+
onClick: a.action,
|
|
1635
1635
|
children: [
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1638
|
-
!!(
|
|
1636
|
+
/* @__PURE__ */ s(M, { name: a == null ? void 0 : a.icon }),
|
|
1637
|
+
/* @__PURE__ */ s("span", { className: "ml-1", children: a.title }),
|
|
1638
|
+
!!(a != null && a.shortcutKeys) && /* @__PURE__ */ s("span", { className: "ml-auto text-xs tracking-widest opacity-60", children: Re(a.shortcutKeys) })
|
|
1639
1639
|
]
|
|
1640
1640
|
},
|
|
1641
|
-
`more-mark-${
|
|
1641
|
+
`more-mark-${i}`
|
|
1642
1642
|
)) })
|
|
1643
1643
|
] });
|
|
1644
1644
|
}
|
|
1645
|
-
const
|
|
1645
|
+
const mo = A.create({
|
|
1646
1646
|
name: "moreMark",
|
|
1647
1647
|
addOptions() {
|
|
1648
1648
|
var e;
|
|
1649
1649
|
return {
|
|
1650
1650
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1651
|
-
button({ editor: t, extension: n, t:
|
|
1652
|
-
const
|
|
1651
|
+
button({ editor: t, extension: n, t: a }) {
|
|
1652
|
+
const i = n.options.subscript, o = n.options.superscript, r = {
|
|
1653
1653
|
action: () => t.commands.toggleSubscript(),
|
|
1654
1654
|
isActive: () => t.isActive("subscript") || !1,
|
|
1655
1655
|
disabled: !t.can().toggleSubscript(),
|
|
1656
1656
|
icon: "Subscript",
|
|
1657
|
-
title:
|
|
1657
|
+
title: a("editor.subscript.tooltip"),
|
|
1658
1658
|
shortcutKeys: ["mod", "."]
|
|
1659
|
-
},
|
|
1659
|
+
}, l = {
|
|
1660
1660
|
action: () => t.commands.toggleSuperscript(),
|
|
1661
1661
|
isActive: () => t.isActive("superscript") || !1,
|
|
1662
1662
|
disabled: !t.can().toggleSuperscript(),
|
|
1663
1663
|
icon: "Superscript",
|
|
1664
|
-
title:
|
|
1664
|
+
title: a("editor.superscript.tooltip"),
|
|
1665
1665
|
shortcutKeys: ["mod", ","]
|
|
1666
|
-
},
|
|
1667
|
-
return
|
|
1668
|
-
component:
|
|
1666
|
+
}, u = [];
|
|
1667
|
+
return i !== !1 && u.push(r), o !== !1 && u.push(l), {
|
|
1668
|
+
component: va,
|
|
1669
1669
|
componentProps: {
|
|
1670
1670
|
icon: "Type",
|
|
1671
|
-
tooltip:
|
|
1671
|
+
tooltip: a("editor.moremark"),
|
|
1672
1672
|
disabled: !t.isEditable,
|
|
1673
|
-
items:
|
|
1673
|
+
items: u
|
|
1674
1674
|
}
|
|
1675
1675
|
};
|
|
1676
1676
|
}
|
|
@@ -1680,19 +1680,19 @@ const uo = A.create({
|
|
|
1680
1680
|
const e = [];
|
|
1681
1681
|
return this.options.subscript !== !1 && e.push(Je.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Ye.configure(this.options.superscript)), e;
|
|
1682
1682
|
}
|
|
1683
|
-
}),
|
|
1683
|
+
}), ho = A.create({
|
|
1684
1684
|
name: "indent",
|
|
1685
1685
|
addOptions() {
|
|
1686
1686
|
var e;
|
|
1687
1687
|
return {
|
|
1688
1688
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1689
1689
|
types: ["paragraph", "heading", "blockquote"],
|
|
1690
|
-
minIndent:
|
|
1691
|
-
maxIndent:
|
|
1690
|
+
minIndent: he.min,
|
|
1691
|
+
maxIndent: he.max,
|
|
1692
1692
|
button({ editor: t, t: n }) {
|
|
1693
1693
|
return [
|
|
1694
1694
|
{
|
|
1695
|
-
component:
|
|
1695
|
+
component: p,
|
|
1696
1696
|
componentProps: {
|
|
1697
1697
|
action: () => {
|
|
1698
1698
|
t.commands.indent();
|
|
@@ -1703,7 +1703,7 @@ const uo = A.create({
|
|
|
1703
1703
|
}
|
|
1704
1704
|
},
|
|
1705
1705
|
{
|
|
1706
|
-
component:
|
|
1706
|
+
component: p,
|
|
1707
1707
|
componentProps: {
|
|
1708
1708
|
action: () => {
|
|
1709
1709
|
t.commands.outdent();
|
|
@@ -1737,11 +1737,11 @@ const uo = A.create({
|
|
|
1737
1737
|
addCommands() {
|
|
1738
1738
|
return {
|
|
1739
1739
|
indent: () => Fe({
|
|
1740
|
-
delta:
|
|
1740
|
+
delta: he.more,
|
|
1741
1741
|
types: this.options.types
|
|
1742
1742
|
}),
|
|
1743
1743
|
outdent: () => Fe({
|
|
1744
|
-
delta:
|
|
1744
|
+
delta: he.less,
|
|
1745
1745
|
types: this.options.types
|
|
1746
1746
|
})
|
|
1747
1747
|
};
|
|
@@ -1753,43 +1753,43 @@ const uo = A.create({
|
|
|
1753
1753
|
};
|
|
1754
1754
|
}
|
|
1755
1755
|
});
|
|
1756
|
-
function
|
|
1756
|
+
function xa(e) {
|
|
1757
1757
|
return Number.parseFloat(e.replace("%", "")) / 100;
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1760
|
-
const { t } = j(), [n,
|
|
1761
|
-
function
|
|
1762
|
-
|
|
1759
|
+
function Ca(e) {
|
|
1760
|
+
const { t } = j(), [n, a] = C("default");
|
|
1761
|
+
function i(r) {
|
|
1762
|
+
r === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(r), a(r);
|
|
1763
1763
|
}
|
|
1764
1764
|
const o = R(() => {
|
|
1765
|
-
const
|
|
1765
|
+
const u = e.editor.extensionManager.extensions.find(
|
|
1766
1766
|
(d) => d.name === "lineHeight"
|
|
1767
1767
|
).options.lineHeights.map((d) => ({
|
|
1768
|
-
label:
|
|
1768
|
+
label: xa(d),
|
|
1769
1769
|
value: d
|
|
1770
1770
|
}));
|
|
1771
|
-
return
|
|
1771
|
+
return u.unshift({
|
|
1772
1772
|
label: t("editor.default"),
|
|
1773
1773
|
value: "default"
|
|
1774
|
-
}),
|
|
1774
|
+
}), u;
|
|
1775
1775
|
}, [e]);
|
|
1776
|
-
return /* @__PURE__ */
|
|
1777
|
-
/* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
1777
|
+
/* @__PURE__ */ s(
|
|
1778
1778
|
Q,
|
|
1779
1779
|
{
|
|
1780
1780
|
asChild: !0,
|
|
1781
1781
|
disabled: e == null ? void 0 : e.disabled,
|
|
1782
|
-
children: /* @__PURE__ */
|
|
1783
|
-
|
|
1782
|
+
children: /* @__PURE__ */ s(
|
|
1783
|
+
p,
|
|
1784
1784
|
{
|
|
1785
|
-
customClass: "!
|
|
1785
|
+
customClass: "!w-12 h-12",
|
|
1786
1786
|
disabled: e == null ? void 0 : e.disabled,
|
|
1787
1787
|
icon: "LineHeight",
|
|
1788
1788
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1789
|
-
children: /* @__PURE__ */
|
|
1789
|
+
children: /* @__PURE__ */ s(
|
|
1790
1790
|
M,
|
|
1791
1791
|
{
|
|
1792
|
-
className: "
|
|
1792
|
+
className: "ml-1 size-3 text-zinc-500",
|
|
1793
1793
|
name: "MenuDown"
|
|
1794
1794
|
}
|
|
1795
1795
|
)
|
|
@@ -1797,47 +1797,47 @@ function Ci(e) {
|
|
|
1797
1797
|
)
|
|
1798
1798
|
}
|
|
1799
1799
|
),
|
|
1800
|
-
/* @__PURE__ */
|
|
1800
|
+
/* @__PURE__ */ s(X, { className: "min-w-24", children: o == null ? void 0 : o.map((r, l) => /* @__PURE__ */ s(
|
|
1801
1801
|
ne,
|
|
1802
1802
|
{
|
|
1803
|
-
checked:
|
|
1804
|
-
onClick: () =>
|
|
1805
|
-
children:
|
|
1803
|
+
checked: r.value === n,
|
|
1804
|
+
onClick: () => i(r.value),
|
|
1805
|
+
children: r.label
|
|
1806
1806
|
},
|
|
1807
|
-
`lineHeight-${
|
|
1807
|
+
`lineHeight-${l}`
|
|
1808
1808
|
)) })
|
|
1809
1809
|
] });
|
|
1810
1810
|
}
|
|
1811
|
-
const
|
|
1812
|
-
function
|
|
1813
|
-
const { selection: n, doc:
|
|
1814
|
-
if (!n || !
|
|
1811
|
+
const Na = ["paragraph", "heading", "list_item", "todo_item"];
|
|
1812
|
+
function Aa(e, t) {
|
|
1813
|
+
const { selection: n, doc: a } = e;
|
|
1814
|
+
if (!n || !a || !(n instanceof Xe || n instanceof Zt))
|
|
1815
1815
|
return e;
|
|
1816
|
-
const { from:
|
|
1817
|
-
if (
|
|
1818
|
-
const
|
|
1819
|
-
return
|
|
1820
|
-
node:
|
|
1816
|
+
const { from: i, to: o } = n, r = [], l = t && t !== at ? t : null;
|
|
1817
|
+
if (a.nodesBetween(i, o, (u, d) => {
|
|
1818
|
+
const c = u.type;
|
|
1819
|
+
return Na.includes(c.name) ? ((u.attrs.lineHeight || null) !== l && r.push({
|
|
1820
|
+
node: u,
|
|
1821
1821
|
pos: d,
|
|
1822
|
-
nodeType:
|
|
1823
|
-
}),
|
|
1824
|
-
}),
|
|
1822
|
+
nodeType: c
|
|
1823
|
+
}), c.name !== "list_item" && c.name !== "todo_item") : !0;
|
|
1824
|
+
}), r.length === 0)
|
|
1825
1825
|
return e;
|
|
1826
|
-
for (const
|
|
1827
|
-
const { node: d, pos:
|
|
1826
|
+
for (const u of r) {
|
|
1827
|
+
const { node: d, pos: c, nodeType: h } = u;
|
|
1828
1828
|
let { attrs: _ } = d;
|
|
1829
1829
|
_ = {
|
|
1830
1830
|
..._,
|
|
1831
|
-
lineHeight:
|
|
1832
|
-
}, e = e.setNodeMarkup(
|
|
1831
|
+
lineHeight: l
|
|
1832
|
+
}, e = e.setNodeMarkup(c, h, _, d.marks);
|
|
1833
1833
|
}
|
|
1834
1834
|
return e;
|
|
1835
1835
|
}
|
|
1836
|
-
function
|
|
1836
|
+
function La(e) {
|
|
1837
1837
|
return ({ state: t, dispatch: n }) => {
|
|
1838
|
-
const { selection:
|
|
1839
|
-
let { tr:
|
|
1840
|
-
return
|
|
1838
|
+
const { selection: a } = t;
|
|
1839
|
+
let { tr: i } = t;
|
|
1840
|
+
return i = i.setSelection(a), i = Aa(i, e), i.docChanged ? (n && n(i), !0) : !1;
|
|
1841
1841
|
};
|
|
1842
1842
|
}
|
|
1843
1843
|
const _o = A.create({
|
|
@@ -1848,10 +1848,10 @@ const _o = A.create({
|
|
|
1848
1848
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1849
1849
|
types: ["paragraph", "heading", "list_item", "todo_item"],
|
|
1850
1850
|
lineHeights: Rn,
|
|
1851
|
-
defaultHeight:
|
|
1851
|
+
defaultHeight: at,
|
|
1852
1852
|
button({ editor: t, t: n }) {
|
|
1853
1853
|
return {
|
|
1854
|
-
component:
|
|
1854
|
+
component: Ca,
|
|
1855
1855
|
componentProps: {
|
|
1856
1856
|
editor: t,
|
|
1857
1857
|
tooltip: n("editor.lineheight.tooltip")
|
|
@@ -1876,103 +1876,103 @@ const _o = A.create({
|
|
|
1876
1876
|
},
|
|
1877
1877
|
addCommands() {
|
|
1878
1878
|
return {
|
|
1879
|
-
setLineHeight: (e) =>
|
|
1879
|
+
setLineHeight: (e) => La(e),
|
|
1880
1880
|
unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
|
|
1881
1881
|
};
|
|
1882
1882
|
}
|
|
1883
1883
|
});
|
|
1884
|
-
function
|
|
1884
|
+
function Sa(e, t) {
|
|
1885
1885
|
var L, E;
|
|
1886
|
-
const [n,
|
|
1886
|
+
const [n, a] = C(0), [i, o] = C(0), r = G(null), { t: l } = j(), u = G([]);
|
|
1887
1887
|
ze(t, () => ({
|
|
1888
1888
|
onKeyDown: d
|
|
1889
1889
|
})), z(() => {
|
|
1890
|
-
if (!
|
|
1890
|
+
if (!r.current)
|
|
1891
1891
|
return;
|
|
1892
|
-
const g =
|
|
1892
|
+
const g = i * 1e3 + n, b = u.current[g];
|
|
1893
1893
|
b && b.scrollIntoView({
|
|
1894
1894
|
behavior: "smooth",
|
|
1895
1895
|
block: "nearest"
|
|
1896
1896
|
});
|
|
1897
|
-
}, [n,
|
|
1897
|
+
}, [n, i]);
|
|
1898
1898
|
function d({ event: g }) {
|
|
1899
|
-
return g.key === "ArrowUp" ? (
|
|
1899
|
+
return g.key === "ArrowUp" ? (c(), !0) : g.key === "ArrowDown" ? (h(), !0) : g.key === "Enter" ? (_(), !0) : !1;
|
|
1900
1900
|
}
|
|
1901
|
-
function
|
|
1902
|
-
var
|
|
1901
|
+
function c() {
|
|
1902
|
+
var v;
|
|
1903
1903
|
if (e.items.length === 0)
|
|
1904
1904
|
return !1;
|
|
1905
|
-
let g = n - 1, b =
|
|
1906
|
-
g < 0 && (b =
|
|
1905
|
+
let g = n - 1, b = i;
|
|
1906
|
+
g < 0 && (b = i - 1, g = ((v = e.items[b]) == null ? void 0 : v.commands.length) - 1 || 0), b < 0 && (b = e.items.length - 1, g = e.items[b].commands.length - 1), a(g), o(b);
|
|
1907
1907
|
}
|
|
1908
|
-
function
|
|
1908
|
+
function h() {
|
|
1909
1909
|
if (e.items.length === 0)
|
|
1910
1910
|
return !1;
|
|
1911
|
-
const g = e.items[
|
|
1912
|
-
let b = n + 1,
|
|
1913
|
-
g.length - 1 < b && (b = 0,
|
|
1911
|
+
const g = e.items[i].commands;
|
|
1912
|
+
let b = n + 1, v = i;
|
|
1913
|
+
g.length - 1 < b && (b = 0, v = i + 1), e.items.length - 1 < v && (v = 0), a(b), o(v);
|
|
1914
1914
|
}
|
|
1915
1915
|
function _() {
|
|
1916
|
-
if (e.items.length === 0 ||
|
|
1916
|
+
if (e.items.length === 0 || i === -1 || n === -1)
|
|
1917
1917
|
return !1;
|
|
1918
|
-
f(
|
|
1918
|
+
f(i, n);
|
|
1919
1919
|
}
|
|
1920
1920
|
function f(g, b) {
|
|
1921
|
-
const
|
|
1922
|
-
e.command(
|
|
1921
|
+
const v = e.items[g].commands[b];
|
|
1922
|
+
e.command(v);
|
|
1923
1923
|
}
|
|
1924
|
-
function
|
|
1924
|
+
function w(g, b) {
|
|
1925
1925
|
f(g, b);
|
|
1926
1926
|
}
|
|
1927
|
-
function
|
|
1928
|
-
|
|
1927
|
+
function y(g, b, v) {
|
|
1928
|
+
u.current[g * 1e3 + b] = v;
|
|
1929
1929
|
}
|
|
1930
|
-
return /* @__PURE__ */
|
|
1930
|
+
return /* @__PURE__ */ s(
|
|
1931
1931
|
"div",
|
|
1932
1932
|
{
|
|
1933
|
-
className: "
|
|
1934
|
-
ref:
|
|
1935
|
-
children: (L = e == null ? void 0 : e.items) != null && L.length ? /* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
g.commands.map((
|
|
1933
|
+
className: "mb-8 max-h-[min(80vh,24rem)] flex-wrap overflow-auto rounded-lg !border !border-neutral-200 !bg-white p-1 !text-black shadow-sm dark:!border-neutral-800 dark:!bg-black",
|
|
1934
|
+
ref: r,
|
|
1935
|
+
children: (L = e == null ? void 0 : e.items) != null && L.length ? /* @__PURE__ */ s("div", { className: "grid min-w-48 grid-cols-1 gap-0.5", children: (E = e == null ? void 0 : e.items) == null ? void 0 : E.map((g, b) => /* @__PURE__ */ m(Ee, { children: [
|
|
1936
|
+
/* @__PURE__ */ s("div", { className: "col-[1/-1] mx-2 mt-2 select-none text-[0.65rem] font-semibold uppercase tracking-wider !text-neutral-500 first:mt-0.5", children: g.title }),
|
|
1937
|
+
g.commands.map((v, H) => /* @__PURE__ */ m(
|
|
1938
1938
|
"button",
|
|
1939
1939
|
{
|
|
1940
|
-
onClick: () =>
|
|
1941
|
-
ref: (S) =>
|
|
1942
|
-
className: T("
|
|
1943
|
-
"slash-command-active":
|
|
1940
|
+
onClick: () => w(b, H),
|
|
1941
|
+
ref: (S) => y(b, H, S),
|
|
1942
|
+
className: T("flex items-center gap-3 px-2 py-1.5 text-sm !text-neutral-800 dark:!text-neutral-200 text-left w-full rounded-sm outline-none transition-colors !bg-transparent hover:!bg-accent ", {
|
|
1943
|
+
"slash-command-active": i === b && n === H
|
|
1944
1944
|
}),
|
|
1945
1945
|
children: [
|
|
1946
|
-
|
|
1946
|
+
v.iconUrl && /* @__PURE__ */ s(
|
|
1947
1947
|
"img",
|
|
1948
1948
|
{
|
|
1949
1949
|
alt: "",
|
|
1950
|
-
className: "
|
|
1951
|
-
src:
|
|
1950
|
+
className: "size-6",
|
|
1951
|
+
src: v.iconUrl
|
|
1952
1952
|
}
|
|
1953
1953
|
),
|
|
1954
|
-
|
|
1954
|
+
v.iconName && /* @__PURE__ */ s(
|
|
1955
1955
|
M,
|
|
1956
1956
|
{
|
|
1957
|
-
className: "!
|
|
1958
|
-
name:
|
|
1957
|
+
className: "!mr-1 !text-lg",
|
|
1958
|
+
name: v.iconName
|
|
1959
1959
|
}
|
|
1960
1960
|
),
|
|
1961
|
-
|
|
1961
|
+
v.label
|
|
1962
1962
|
]
|
|
1963
1963
|
},
|
|
1964
1964
|
`command-${H}`
|
|
1965
1965
|
))
|
|
1966
|
-
] }, `slash-${g.title}`)) }) : /* @__PURE__ */
|
|
1966
|
+
] }, `slash-${g.title}`)) }) : /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s("span", { className: "text-xs text-gray-800 dark:text-gray-100", children: l("editor.slash.empty") }) })
|
|
1967
1967
|
}
|
|
1968
1968
|
);
|
|
1969
1969
|
}
|
|
1970
|
-
const
|
|
1970
|
+
const Ta = He(Sa), Ea = {
|
|
1971
1971
|
setOpen: (e, t) => {
|
|
1972
1972
|
K(D.UPLOAD_VIDEO(e), t);
|
|
1973
1973
|
}
|
|
1974
1974
|
};
|
|
1975
|
-
function
|
|
1975
|
+
function Ha(e, t) {
|
|
1976
1976
|
const n = [
|
|
1977
1977
|
{
|
|
1978
1978
|
name: "format",
|
|
@@ -1985,117 +1985,117 @@ function Hi(e, t) {
|
|
|
1985
1985
|
commands: []
|
|
1986
1986
|
}
|
|
1987
1987
|
];
|
|
1988
|
-
return e.forEach((
|
|
1989
|
-
|
|
1988
|
+
return e.forEach((a) => {
|
|
1989
|
+
a.name.toLowerCase() === "heading" && a.options.levels.forEach((i) => {
|
|
1990
1990
|
n[0].commands.push({
|
|
1991
|
-
name: `heading${
|
|
1992
|
-
label: N.t(`editor.heading.h${
|
|
1993
|
-
aliases: [`h${
|
|
1994
|
-
iconName: `Heading${
|
|
1995
|
-
action: ({ editor: o, range:
|
|
1996
|
-
o.chain().focus().deleteRange(
|
|
1991
|
+
name: `heading${i}`,
|
|
1992
|
+
label: N.t(`editor.heading.h${i}.tooltip`),
|
|
1993
|
+
aliases: [`h${i}`, "bt", `bt${i}`],
|
|
1994
|
+
iconName: `Heading${i}`,
|
|
1995
|
+
action: ({ editor: o, range: r }) => {
|
|
1996
|
+
o.chain().focus().deleteRange(r).setHeading({ level: i }).run();
|
|
1997
1997
|
}
|
|
1998
1998
|
});
|
|
1999
|
-
}),
|
|
1999
|
+
}), a.name.toLowerCase() === "bulletlist" && n[0].commands.push({
|
|
2000
2000
|
name: "bulletList",
|
|
2001
2001
|
label: N.t("editor.bulletlist.tooltip"),
|
|
2002
2002
|
aliases: ["ul", "yxlb"],
|
|
2003
2003
|
iconName: "List",
|
|
2004
|
-
action: ({ editor:
|
|
2005
|
-
|
|
2004
|
+
action: ({ editor: i, range: o }) => {
|
|
2005
|
+
i.chain().focus().deleteRange(o).toggleBulletList().run();
|
|
2006
2006
|
}
|
|
2007
|
-
}),
|
|
2007
|
+
}), a.name.toLowerCase() === "orderedlist" && n[0].commands.push({
|
|
2008
2008
|
name: "numberedList",
|
|
2009
2009
|
label: N.t("editor.orderedlist.tooltip"),
|
|
2010
2010
|
aliases: ["ol", "yxlb"],
|
|
2011
2011
|
iconName: "ListOrdered",
|
|
2012
|
-
action: ({ editor:
|
|
2013
|
-
|
|
2012
|
+
action: ({ editor: i, range: o }) => {
|
|
2013
|
+
i.chain().focus().deleteRange(o).toggleOrderedList().run();
|
|
2014
2014
|
}
|
|
2015
|
-
}),
|
|
2015
|
+
}), a.name.toLowerCase() === "tasklist" && n[0].commands.push({
|
|
2016
2016
|
name: "taskList",
|
|
2017
2017
|
label: N.t("editor.tasklist.tooltip"),
|
|
2018
2018
|
iconName: "ListTodo",
|
|
2019
2019
|
description: "Task list with todo items",
|
|
2020
2020
|
aliases: ["todo"],
|
|
2021
|
-
action: ({ editor:
|
|
2022
|
-
|
|
2021
|
+
action: ({ editor: i, range: o }) => {
|
|
2022
|
+
i.chain().focus().deleteRange(o).toggleTaskList().run();
|
|
2023
2023
|
}
|
|
2024
|
-
}),
|
|
2024
|
+
}), a.name.toLowerCase() === "blockquote" && n[0].commands.push({
|
|
2025
2025
|
name: "blockquote",
|
|
2026
2026
|
label: N.t("editor.blockquote.tooltip"),
|
|
2027
2027
|
description: "插入引入格式",
|
|
2028
2028
|
aliases: ["yr"],
|
|
2029
2029
|
iconName: "TextQuote",
|
|
2030
|
-
action: ({ editor:
|
|
2031
|
-
|
|
2030
|
+
action: ({ editor: i, range: o }) => {
|
|
2031
|
+
i.chain().focus().deleteRange(o).setBlockquote().run();
|
|
2032
2032
|
}
|
|
2033
|
-
}),
|
|
2033
|
+
}), a.name.toLowerCase() === "codeblock" && n[0].commands.push({
|
|
2034
2034
|
name: "codeBlock",
|
|
2035
2035
|
label: N.t("editor.codeblock.tooltip"),
|
|
2036
2036
|
iconName: "Code2",
|
|
2037
2037
|
description: "Code block with syntax highlighting",
|
|
2038
|
-
shouldBeHidden: (
|
|
2039
|
-
action: ({ editor:
|
|
2040
|
-
|
|
2038
|
+
shouldBeHidden: (i) => i.isActive("columns"),
|
|
2039
|
+
action: ({ editor: i, range: o }) => {
|
|
2040
|
+
i.chain().focus().deleteRange(o).setCodeBlock().run();
|
|
2041
2041
|
}
|
|
2042
|
-
}),
|
|
2042
|
+
}), a.name.toLowerCase() === kn.name && n[1].commands.push({
|
|
2043
2043
|
name: "image",
|
|
2044
2044
|
label: N.t("editor.image.tooltip"),
|
|
2045
2045
|
iconName: "ImageUp",
|
|
2046
2046
|
description: "Insert a image",
|
|
2047
2047
|
aliases: ["image", "tp", "tupian"],
|
|
2048
|
-
shouldBeHidden: (
|
|
2049
|
-
action: ({ editor:
|
|
2050
|
-
|
|
2048
|
+
shouldBeHidden: (i) => i.isActive("columns"),
|
|
2049
|
+
action: ({ editor: i, range: o }) => {
|
|
2050
|
+
i.chain().focus().deleteRange(o).run(), vn.setOpen(i.id, !0);
|
|
2051
2051
|
}
|
|
2052
|
-
}),
|
|
2052
|
+
}), a.name.toLowerCase() === xn.name && n[1].commands.push({
|
|
2053
2053
|
name: "video",
|
|
2054
2054
|
label: N.t("editor.video.tooltip"),
|
|
2055
2055
|
iconName: "Video",
|
|
2056
2056
|
description: "Insert a video",
|
|
2057
2057
|
aliases: ["video", "sp", "shipin"],
|
|
2058
|
-
shouldBeHidden: (
|
|
2059
|
-
action: ({ editor:
|
|
2060
|
-
|
|
2058
|
+
shouldBeHidden: (i) => i.isActive("columns"),
|
|
2059
|
+
action: ({ editor: i, range: o }) => {
|
|
2060
|
+
i.chain().focus().deleteRange(o).run(), Ea.setOpen(i.id, !0);
|
|
2061
2061
|
}
|
|
2062
|
-
}),
|
|
2062
|
+
}), a.name.toLowerCase() === "table" && n[1].commands.push({
|
|
2063
2063
|
name: "table",
|
|
2064
2064
|
label: N.t("editor.table.tooltip"),
|
|
2065
2065
|
iconName: "Table",
|
|
2066
2066
|
description: "Insert a table",
|
|
2067
2067
|
aliases: ["table", "bg", "biaoge", "biao"],
|
|
2068
|
-
shouldBeHidden: (
|
|
2069
|
-
action: ({ editor:
|
|
2070
|
-
|
|
2068
|
+
shouldBeHidden: (i) => i.isActive("columns"),
|
|
2069
|
+
action: ({ editor: i, range: o }) => {
|
|
2070
|
+
i.chain().focus().deleteRange(o).insertTable({ rows: 3, cols: 3, withHeaderRow: !1 }).run();
|
|
2071
2071
|
}
|
|
2072
|
-
}),
|
|
2072
|
+
}), a.name.toLowerCase() === "horizontalrule" && n[1].commands.push({
|
|
2073
2073
|
name: "horizontalRule",
|
|
2074
2074
|
label: N.t("editor.horizontalrule.tooltip"),
|
|
2075
2075
|
iconName: "Minus",
|
|
2076
2076
|
description: "Insert a horizontal divider",
|
|
2077
2077
|
aliases: ["hr", "fgx", "fg"],
|
|
2078
|
-
action: ({ editor:
|
|
2079
|
-
|
|
2078
|
+
action: ({ editor: i, range: o }) => {
|
|
2079
|
+
i.chain().focus().deleteRange(o).setHorizontalRule().run();
|
|
2080
2080
|
}
|
|
2081
|
-
}),
|
|
2081
|
+
}), a.name.toLowerCase() === "columns" && n[1].commands.push({
|
|
2082
2082
|
name: "columns",
|
|
2083
2083
|
label: N.t("editor.columns.tooltip"),
|
|
2084
2084
|
iconName: "Columns2",
|
|
2085
2085
|
description: "Add two column content",
|
|
2086
|
-
action: ({ editor:
|
|
2087
|
-
|
|
2086
|
+
action: ({ editor: i }) => {
|
|
2087
|
+
i.chain().focus().insertColumns({ cols: 2 }).run();
|
|
2088
2088
|
}
|
|
2089
|
-
}), t == null || t(
|
|
2089
|
+
}), t == null || t(a, n);
|
|
2090
2090
|
}), n;
|
|
2091
2091
|
}
|
|
2092
2092
|
const q = "slashCommand";
|
|
2093
|
-
let
|
|
2093
|
+
let k;
|
|
2094
2094
|
const fo = A.create({
|
|
2095
2095
|
name: q,
|
|
2096
2096
|
priority: 200,
|
|
2097
2097
|
onCreate() {
|
|
2098
|
-
|
|
2098
|
+
k = De("body", {
|
|
2099
2099
|
interactive: !0,
|
|
2100
2100
|
trigger: "manual",
|
|
2101
2101
|
placement: "bottom-start",
|
|
@@ -2122,32 +2122,32 @@ const fo = A.create({
|
|
|
2122
2122
|
startOfLine: !0,
|
|
2123
2123
|
pluginKey: new Z(q),
|
|
2124
2124
|
allow: ({ state: e, range: t }) => {
|
|
2125
|
-
var d,
|
|
2126
|
-
const n = e.doc.resolve(t.from),
|
|
2127
|
-
Math.max(0, (
|
|
2128
|
-
),
|
|
2129
|
-
return (
|
|
2125
|
+
var d, c, h;
|
|
2126
|
+
const n = e.doc.resolve(t.from), a = n.depth === 1, i = n.parent.type.name === "paragraph", o = ((d = n.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", r = this.editor.isActive("column"), l = (h = n.parent.textContent) == null ? void 0 : h.slice(
|
|
2127
|
+
Math.max(0, (c = n.parent.textContent) == null ? void 0 : c.indexOf("/"))
|
|
2128
|
+
), u = !(l != null && l.endsWith(" "));
|
|
2129
|
+
return (a && i && o || r && i && o) && u;
|
|
2130
2130
|
},
|
|
2131
2131
|
command: ({ editor: e, range: t, props: n }) => {
|
|
2132
|
-
const { view:
|
|
2133
|
-
n.action({ editor: e, range: t }),
|
|
2132
|
+
const { view: a } = e;
|
|
2133
|
+
n.action({ editor: e, range: t }), a.focus();
|
|
2134
2134
|
},
|
|
2135
|
-
items: ({ query: e, editor: t }) =>
|
|
2136
|
-
...
|
|
2137
|
-
commands:
|
|
2138
|
-
const
|
|
2139
|
-
if (
|
|
2140
|
-
const
|
|
2141
|
-
return
|
|
2135
|
+
items: ({ query: e, editor: t }) => Ha(t.extensionManager.extensions, this.options.renderGroupItem).map((r) => ({
|
|
2136
|
+
...r,
|
|
2137
|
+
commands: r.commands.filter((l) => {
|
|
2138
|
+
const u = l.label.toLowerCase().trim(), d = e.toLowerCase().trim();
|
|
2139
|
+
if (l.aliases) {
|
|
2140
|
+
const c = l.aliases.map((f) => f.toLowerCase().trim()), h = u.match(d), _ = c.some((f) => f.match(d));
|
|
2141
|
+
return h || _;
|
|
2142
2142
|
}
|
|
2143
|
-
return
|
|
2143
|
+
return u.match(d);
|
|
2144
2144
|
}).filter(
|
|
2145
|
-
(
|
|
2145
|
+
(l) => l.shouldBeHidden ? !l.shouldBeHidden(this.editor) : !0
|
|
2146
2146
|
)
|
|
2147
|
-
})).filter((
|
|
2148
|
-
...
|
|
2149
|
-
commands:
|
|
2150
|
-
...
|
|
2147
|
+
})).filter((r) => r.commands.length > 0).map((r) => ({
|
|
2148
|
+
...r,
|
|
2149
|
+
commands: r.commands.map((l) => ({
|
|
2150
|
+
...l,
|
|
2151
2151
|
isEnabled: !0
|
|
2152
2152
|
}))
|
|
2153
2153
|
})),
|
|
@@ -2156,66 +2156,66 @@ const fo = A.create({
|
|
|
2156
2156
|
return {
|
|
2157
2157
|
onStart: (n) => {
|
|
2158
2158
|
var o;
|
|
2159
|
-
e = new Te(
|
|
2159
|
+
e = new Te(Ta, {
|
|
2160
2160
|
props: n,
|
|
2161
2161
|
editor: n.editor
|
|
2162
2162
|
});
|
|
2163
|
-
const { view:
|
|
2163
|
+
const { view: a } = n.editor, i = () => {
|
|
2164
2164
|
if (!n.clientRect)
|
|
2165
2165
|
return n.editor.storage[q].rect;
|
|
2166
|
-
const
|
|
2167
|
-
if (!
|
|
2166
|
+
const r = n.clientRect();
|
|
2167
|
+
if (!r)
|
|
2168
2168
|
return n.editor.storage[q].rect;
|
|
2169
|
-
let
|
|
2170
|
-
if (
|
|
2171
|
-
const
|
|
2172
|
-
|
|
2169
|
+
let l = r.y;
|
|
2170
|
+
if (r.top + e.element.offsetHeight + 40 > window.innerHeight) {
|
|
2171
|
+
const u = r.top + e.element.offsetHeight - window.innerHeight + 40;
|
|
2172
|
+
l = r.y - u;
|
|
2173
2173
|
}
|
|
2174
|
-
return new DOMRect(
|
|
2174
|
+
return new DOMRect(r.x, l, r.width, r.height);
|
|
2175
2175
|
};
|
|
2176
2176
|
t = () => {
|
|
2177
|
-
|
|
2178
|
-
getReferenceClientRect:
|
|
2177
|
+
k == null || k[0].setProps({
|
|
2178
|
+
getReferenceClientRect: i
|
|
2179
2179
|
});
|
|
2180
|
-
}, (o =
|
|
2181
|
-
getReferenceClientRect:
|
|
2180
|
+
}, (o = a.dom.parentElement) == null || o.addEventListener("scroll", t), k == null || k[0].setProps({
|
|
2181
|
+
getReferenceClientRect: i,
|
|
2182
2182
|
appendTo: () => document.body,
|
|
2183
2183
|
content: e.element
|
|
2184
|
-
}),
|
|
2184
|
+
}), k == null || k[0].show();
|
|
2185
2185
|
},
|
|
2186
2186
|
onUpdate(n) {
|
|
2187
|
-
var
|
|
2187
|
+
var r;
|
|
2188
2188
|
e.updateProps(n);
|
|
2189
|
-
const { view:
|
|
2189
|
+
const { view: a } = n.editor, i = () => {
|
|
2190
2190
|
if (!n.clientRect)
|
|
2191
2191
|
return n.editor.storage[q].rect;
|
|
2192
|
-
const
|
|
2193
|
-
return
|
|
2192
|
+
const l = n.clientRect();
|
|
2193
|
+
return l ? new DOMRect(l.x, l.y, l.width, l.height) : n.editor.storage[q].rect;
|
|
2194
2194
|
}, o = () => {
|
|
2195
|
-
|
|
2196
|
-
getReferenceClientRect:
|
|
2195
|
+
k == null || k[0].setProps({
|
|
2196
|
+
getReferenceClientRect: i
|
|
2197
2197
|
});
|
|
2198
2198
|
};
|
|
2199
|
-
(
|
|
2199
|
+
(r = a.dom.parentElement) == null || r.addEventListener("scroll", o), n.editor.storage[q].rect = n.clientRect ? i() : {
|
|
2200
2200
|
width: 0,
|
|
2201
2201
|
height: 0,
|
|
2202
2202
|
left: 0,
|
|
2203
2203
|
top: 0,
|
|
2204
2204
|
right: 0,
|
|
2205
2205
|
bottom: 0
|
|
2206
|
-
},
|
|
2207
|
-
getReferenceClientRect:
|
|
2206
|
+
}, k == null || k[0].setProps({
|
|
2207
|
+
getReferenceClientRect: i
|
|
2208
2208
|
});
|
|
2209
2209
|
},
|
|
2210
2210
|
onKeyDown(n) {
|
|
2211
|
-
var
|
|
2212
|
-
return n.event.key === "Escape" ? (
|
|
2211
|
+
var a;
|
|
2212
|
+
return n.event.key === "Escape" ? (k == null || k[0].hide(), !0) : (k != null && k[0].state.isShown || k == null || k[0].show(), (a = e.ref) == null ? void 0 : a.onKeyDown(n));
|
|
2213
2213
|
},
|
|
2214
2214
|
onExit(n) {
|
|
2215
|
-
var
|
|
2216
|
-
if (
|
|
2217
|
-
const { view:
|
|
2218
|
-
(
|
|
2215
|
+
var a;
|
|
2216
|
+
if (k == null || k[0].hide(), t) {
|
|
2217
|
+
const { view: i } = n.editor;
|
|
2218
|
+
(a = i.dom.parentElement) == null || a.removeEventListener("scroll", t);
|
|
2219
2219
|
}
|
|
2220
2220
|
e.destroy();
|
|
2221
2221
|
}
|
|
@@ -2243,7 +2243,7 @@ const fo = A.create({
|
|
|
2243
2243
|
return {
|
|
2244
2244
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2245
2245
|
button: ({ editor: t, t: n }) => ({
|
|
2246
|
-
component:
|
|
2246
|
+
component: p,
|
|
2247
2247
|
componentProps: {
|
|
2248
2248
|
action: () => {
|
|
2249
2249
|
t.commands.setPainter(t == null ? void 0 : t.state.selection.$head.marks());
|
|
@@ -2260,11 +2260,11 @@ const fo = A.create({
|
|
|
2260
2260
|
view: {
|
|
2261
2261
|
dispatch: t,
|
|
2262
2262
|
state: { tr: n },
|
|
2263
|
-
dom:
|
|
2263
|
+
dom: a
|
|
2264
2264
|
}
|
|
2265
2265
|
}) => {
|
|
2266
|
-
const
|
|
2267
|
-
return
|
|
2266
|
+
const r = `url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;
|
|
2267
|
+
return a.style.cursor = r, t(n.setMeta("painterAction", { type: "start", marks: e })), !0;
|
|
2268
2268
|
}
|
|
2269
2269
|
};
|
|
2270
2270
|
},
|
|
@@ -2288,14 +2288,14 @@ const fo = A.create({
|
|
|
2288
2288
|
const n = () => {
|
|
2289
2289
|
document.removeEventListener("mouseup", n);
|
|
2290
2290
|
let {
|
|
2291
|
-
dispatch:
|
|
2292
|
-
state: { tr:
|
|
2293
|
-
dom:
|
|
2291
|
+
dispatch: a,
|
|
2292
|
+
state: { tr: i, selection: o },
|
|
2293
|
+
dom: r
|
|
2294
2294
|
} = e;
|
|
2295
|
-
|
|
2296
|
-
for (const
|
|
2297
|
-
|
|
2298
|
-
i
|
|
2295
|
+
r.style.cursor = "", i = i.removeMark(o.from, o.to);
|
|
2296
|
+
for (const l of t)
|
|
2297
|
+
l.type.name !== "link" && (i = i.addMark(o.from, o.to, l));
|
|
2298
|
+
a(i.setMeta("painterAction", { type: "end" }));
|
|
2299
2299
|
};
|
|
2300
2300
|
return document.addEventListener("mouseup", n), !0;
|
|
2301
2301
|
}
|
|
@@ -2305,133 +2305,133 @@ const fo = A.create({
|
|
|
2305
2305
|
];
|
|
2306
2306
|
}
|
|
2307
2307
|
});
|
|
2308
|
-
function
|
|
2309
|
-
const { t: n } = j(), [
|
|
2308
|
+
function za({ editor: e, ...t }) {
|
|
2309
|
+
const { t: n } = j(), [a, i] = C(-1), [o, r] = C([]), [l, u] = C(""), [d, c] = C(""), [h, _] = C(!1), [f, w] = C(!1);
|
|
2310
2310
|
return z(() => {
|
|
2311
|
-
|
|
2312
|
-
}, [e,
|
|
2313
|
-
|
|
2314
|
-
}, [
|
|
2315
|
-
|
|
2316
|
-
}, [
|
|
2311
|
+
h || (u(""), c(""), i(-1), r([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
|
|
2312
|
+
}, [e, h]), z(() => {
|
|
2313
|
+
h && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(l);
|
|
2314
|
+
}, [h, l, e]), z(() => {
|
|
2315
|
+
h && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(d);
|
|
2316
|
+
}, [h, d, e]), z(() => {
|
|
2317
2317
|
if (!e)
|
|
2318
2318
|
return;
|
|
2319
|
-
const
|
|
2320
|
-
if (!
|
|
2319
|
+
const y = e.extensionManager.extensions.find((E) => E.name === ja.name);
|
|
2320
|
+
if (!y)
|
|
2321
2321
|
return;
|
|
2322
2322
|
const L = () => {
|
|
2323
|
-
if (!
|
|
2323
|
+
if (!h)
|
|
2324
2324
|
return;
|
|
2325
|
-
const E =
|
|
2326
|
-
|
|
2325
|
+
const E = y ? y.storage.currentIndex : -1, g = y ? y.storage.results : [];
|
|
2326
|
+
i((b) => b !== E ? E : b), r((b) => Jt(b, g) ? b : g);
|
|
2327
2327
|
};
|
|
2328
2328
|
return Ue(D.SEARCH_REPLCE, L), () => {
|
|
2329
|
-
|
|
2329
|
+
y && Ue(D.SEARCH_REPLCE, L);
|
|
2330
2330
|
};
|
|
2331
|
-
}, [
|
|
2332
|
-
|
|
2331
|
+
}, [h, e]), /* @__PURE__ */ m(
|
|
2332
|
+
ce,
|
|
2333
2333
|
{
|
|
2334
2334
|
onOpenChange: _,
|
|
2335
|
-
open:
|
|
2335
|
+
open: h,
|
|
2336
2336
|
children: [
|
|
2337
|
-
/* @__PURE__ */
|
|
2337
|
+
/* @__PURE__ */ s(
|
|
2338
2338
|
de,
|
|
2339
2339
|
{
|
|
2340
2340
|
asChild: !0,
|
|
2341
2341
|
disabled: t == null ? void 0 : t.disabled,
|
|
2342
|
-
children: /* @__PURE__ */
|
|
2343
|
-
|
|
2342
|
+
children: /* @__PURE__ */ s(
|
|
2343
|
+
p,
|
|
2344
2344
|
{
|
|
2345
2345
|
disabled: t == null ? void 0 : t.disabled,
|
|
2346
2346
|
isActive: t == null ? void 0 : t.isActive,
|
|
2347
2347
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
2348
|
-
children: /* @__PURE__ */
|
|
2348
|
+
children: /* @__PURE__ */ s(M, { name: t == null ? void 0 : t.icon })
|
|
2349
2349
|
}
|
|
2350
2350
|
)
|
|
2351
2351
|
}
|
|
2352
2352
|
),
|
|
2353
|
-
/* @__PURE__ */
|
|
2354
|
-
|
|
2353
|
+
/* @__PURE__ */ m(
|
|
2354
|
+
ue,
|
|
2355
2355
|
{
|
|
2356
2356
|
align: "start",
|
|
2357
|
-
className: "
|
|
2357
|
+
className: "w-full",
|
|
2358
2358
|
hideWhenDetached: !0,
|
|
2359
2359
|
side: "bottom",
|
|
2360
2360
|
children: [
|
|
2361
|
-
/* @__PURE__ */
|
|
2362
|
-
/* @__PURE__ */
|
|
2363
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ m("div", { className: "mb-[6px] flex items-center justify-between", children: [
|
|
2362
|
+
/* @__PURE__ */ s(ve, { children: n("editor.search.dialog.text") }),
|
|
2363
|
+
/* @__PURE__ */ s("span", { className: "font-semibold", children: o.length > 0 ? `${a + 1}/${o.length}` : "0/0" })
|
|
2364
2364
|
] }),
|
|
2365
|
-
/* @__PURE__ */
|
|
2366
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ m("div", { className: "mb-[10px] flex w-full max-w-sm items-center gap-1.5", children: [
|
|
2366
|
+
/* @__PURE__ */ s(
|
|
2367
2367
|
qe,
|
|
2368
2368
|
{
|
|
2369
2369
|
autoFocus: !0,
|
|
2370
|
-
className: "
|
|
2371
|
-
onChange: (
|
|
2370
|
+
className: "w-full",
|
|
2371
|
+
onChange: (y) => u(y.target.value),
|
|
2372
2372
|
placeholder: "Text",
|
|
2373
2373
|
required: !0,
|
|
2374
2374
|
type: "text",
|
|
2375
|
-
value:
|
|
2375
|
+
value: l
|
|
2376
2376
|
}
|
|
2377
2377
|
),
|
|
2378
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ s(
|
|
2379
2379
|
V,
|
|
2380
2380
|
{
|
|
2381
|
-
className: "
|
|
2381
|
+
className: "flex-1",
|
|
2382
2382
|
disabled: o.length === 0,
|
|
2383
2383
|
onClick: e.commands.goToPrevSearchResult,
|
|
2384
|
-
children: /* @__PURE__ */
|
|
2384
|
+
children: /* @__PURE__ */ s(M, { name: "ChevronUp" })
|
|
2385
2385
|
}
|
|
2386
2386
|
),
|
|
2387
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ s(
|
|
2388
2388
|
V,
|
|
2389
2389
|
{
|
|
2390
|
-
className: "
|
|
2390
|
+
className: "flex-1",
|
|
2391
2391
|
disabled: o.length === 0,
|
|
2392
2392
|
onClick: e.commands.goToNextSearchResult,
|
|
2393
|
-
children: /* @__PURE__ */
|
|
2393
|
+
children: /* @__PURE__ */ s(M, { name: "ChevronDown" })
|
|
2394
2394
|
}
|
|
2395
2395
|
)
|
|
2396
2396
|
] }),
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ s(ve, { className: "mb-[6px]", children: n("editor.replace.dialog.text") }),
|
|
2398
|
+
/* @__PURE__ */ s("div", { className: "mb-[5px] flex w-full max-w-sm items-center gap-1.5", children: /* @__PURE__ */ s("div", { className: "relative w-full max-w-sm items-center", children: /* @__PURE__ */ s(
|
|
2399
2399
|
qe,
|
|
2400
2400
|
{
|
|
2401
|
-
className: "
|
|
2402
|
-
onChange: (
|
|
2401
|
+
className: "w-80",
|
|
2402
|
+
onChange: (y) => c(y.target.value),
|
|
2403
2403
|
placeholder: "Text",
|
|
2404
2404
|
required: !0,
|
|
2405
2405
|
type: "text",
|
|
2406
2406
|
value: d
|
|
2407
2407
|
}
|
|
2408
2408
|
) }) }),
|
|
2409
|
-
/* @__PURE__ */
|
|
2410
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ m("div", { className: "mb-[10px] flex items-center space-x-2", children: [
|
|
2410
|
+
/* @__PURE__ */ s(
|
|
2411
2411
|
Cn,
|
|
2412
2412
|
{
|
|
2413
2413
|
checked: f,
|
|
2414
|
-
onCheckedChange: (
|
|
2415
|
-
|
|
2414
|
+
onCheckedChange: (y) => {
|
|
2415
|
+
w(y), e.commands.setCaseSensitive(y);
|
|
2416
2416
|
}
|
|
2417
2417
|
}
|
|
2418
2418
|
),
|
|
2419
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ s(ve, { children: n("editor.replace.caseSensitive") })
|
|
2420
2420
|
] }),
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-[10px]", children: [
|
|
2422
|
+
/* @__PURE__ */ s(
|
|
2423
2423
|
V,
|
|
2424
2424
|
{
|
|
2425
|
-
className: "
|
|
2425
|
+
className: "flex-1",
|
|
2426
2426
|
disabled: o.length === 0,
|
|
2427
2427
|
onClick: e.commands.replace,
|
|
2428
2428
|
children: n("editor.replace.dialog.text")
|
|
2429
2429
|
}
|
|
2430
2430
|
),
|
|
2431
|
-
/* @__PURE__ */
|
|
2431
|
+
/* @__PURE__ */ s(
|
|
2432
2432
|
V,
|
|
2433
2433
|
{
|
|
2434
|
-
className: "
|
|
2434
|
+
className: "flex-1",
|
|
2435
2435
|
disabled: o.length === 0,
|
|
2436
2436
|
onClick: e.commands.replaceAll,
|
|
2437
2437
|
children: n("editor.replaceAll.dialog.text")
|
|
@@ -2445,88 +2445,88 @@ function zi({ editor: e, ...t }) {
|
|
|
2445
2445
|
}
|
|
2446
2446
|
);
|
|
2447
2447
|
}
|
|
2448
|
-
const
|
|
2449
|
-
function
|
|
2448
|
+
const ie = (e, t) => t(e.tr);
|
|
2449
|
+
function Ma(e, t, n) {
|
|
2450
2450
|
return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e, n ? "gu" : "gui");
|
|
2451
2451
|
}
|
|
2452
|
-
function
|
|
2453
|
-
const
|
|
2454
|
-
let
|
|
2452
|
+
function Pa(e, t, n) {
|
|
2453
|
+
const a = [];
|
|
2454
|
+
let i = [];
|
|
2455
2455
|
const o = [];
|
|
2456
|
-
let
|
|
2456
|
+
let r = 0;
|
|
2457
2457
|
if (!t)
|
|
2458
2458
|
return { decorationsToReturn: [], results: [] };
|
|
2459
|
-
e == null || e.descendants((
|
|
2460
|
-
|
|
2461
|
-
text:
|
|
2462
|
-
pos:
|
|
2463
|
-
} :
|
|
2464
|
-
text: `${
|
|
2465
|
-
pos:
|
|
2466
|
-
} :
|
|
2467
|
-
}),
|
|
2468
|
-
for (const { text:
|
|
2469
|
-
const d = [...
|
|
2470
|
-
for (const
|
|
2471
|
-
if (
|
|
2459
|
+
e == null || e.descendants((l, u) => {
|
|
2460
|
+
l.isText ? i[r] ? i[r] = {
|
|
2461
|
+
text: i[r].text + l.text,
|
|
2462
|
+
pos: i[r].pos
|
|
2463
|
+
} : i[r] = {
|
|
2464
|
+
text: `${l.text}`,
|
|
2465
|
+
pos: u
|
|
2466
|
+
} : r += 1;
|
|
2467
|
+
}), i = i.filter(Boolean);
|
|
2468
|
+
for (const { text: l, pos: u } of i) {
|
|
2469
|
+
const d = [...l.matchAll(t)];
|
|
2470
|
+
for (const c of d) {
|
|
2471
|
+
if (c[0] === "")
|
|
2472
2472
|
break;
|
|
2473
|
-
|
|
2474
|
-
from:
|
|
2475
|
-
to:
|
|
2473
|
+
c.index !== void 0 && o.push({
|
|
2474
|
+
from: u + c.index,
|
|
2475
|
+
to: u + c.index + c[0].length
|
|
2476
2476
|
});
|
|
2477
2477
|
}
|
|
2478
2478
|
}
|
|
2479
|
-
for (const
|
|
2480
|
-
|
|
2479
|
+
for (const l of o)
|
|
2480
|
+
a.push(le.inline(l.from, l.to, { class: n }));
|
|
2481
2481
|
return {
|
|
2482
|
-
decorationsToReturn:
|
|
2482
|
+
decorationsToReturn: a,
|
|
2483
2483
|
results: o
|
|
2484
2484
|
};
|
|
2485
2485
|
}
|
|
2486
|
-
function Ge(e, t, { state: n, dispatch:
|
|
2486
|
+
function Ge(e, t, { state: n, dispatch: a }) {
|
|
2487
2487
|
if (!t[0])
|
|
2488
2488
|
return;
|
|
2489
|
-
const { from: o, to:
|
|
2490
|
-
|
|
2489
|
+
const { from: o, to: r } = t[0];
|
|
2490
|
+
a && a(n.tr.insertText(e, o, r));
|
|
2491
2491
|
}
|
|
2492
|
-
function
|
|
2493
|
-
const
|
|
2494
|
-
if (!i
|
|
2492
|
+
function Ra(e, t, n, a) {
|
|
2493
|
+
const i = t + 1;
|
|
2494
|
+
if (!a[i])
|
|
2495
2495
|
return null;
|
|
2496
|
-
const { from: o, to:
|
|
2497
|
-
return i
|
|
2498
|
-
to: d -
|
|
2499
|
-
from:
|
|
2500
|
-
}, [
|
|
2496
|
+
const { from: o, to: r } = a[t], l = r - o - e.length + n, { from: u, to: d } = a[i];
|
|
2497
|
+
return a[i] = {
|
|
2498
|
+
to: d - l,
|
|
2499
|
+
from: u - l
|
|
2500
|
+
}, [l, a];
|
|
2501
2501
|
}
|
|
2502
|
-
function
|
|
2503
|
-
let
|
|
2502
|
+
function Ia(e, t, { tr: n, dispatch: a }) {
|
|
2503
|
+
let i = 0, o = t.slice();
|
|
2504
2504
|
if (o.length === 0)
|
|
2505
2505
|
return !1;
|
|
2506
|
-
for (let
|
|
2507
|
-
const { from:
|
|
2508
|
-
n.insertText(e,
|
|
2509
|
-
const d =
|
|
2510
|
-
d && (
|
|
2506
|
+
for (let r = 0; r < o.length; r += 1) {
|
|
2507
|
+
const { from: l, to: u } = o[r];
|
|
2508
|
+
n.insertText(e, l, u);
|
|
2509
|
+
const d = Ra(e, r, i, o);
|
|
2510
|
+
d && (i = d[0], o = d[1]);
|
|
2511
2511
|
}
|
|
2512
|
-
return
|
|
2512
|
+
return a(n), !0;
|
|
2513
2513
|
}
|
|
2514
|
-
function Ze({ view: e, tr: t, searchResults: n, searchResultCurrentClass:
|
|
2515
|
-
const o = n[
|
|
2514
|
+
function Ze({ view: e, tr: t, searchResults: n, searchResultCurrentClass: a, gotoIndex: i }) {
|
|
2515
|
+
const o = n[i];
|
|
2516
2516
|
if (o) {
|
|
2517
|
-
const
|
|
2517
|
+
const r = t.setMeta("directDecoration", {
|
|
2518
2518
|
fromPos: o.from,
|
|
2519
2519
|
toPos: o.to,
|
|
2520
|
-
attrs: { class:
|
|
2520
|
+
attrs: { class: a }
|
|
2521
2521
|
});
|
|
2522
|
-
return e == null || e.dispatch(
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2522
|
+
return e == null || e.dispatch(r), setTimeout(() => {
|
|
2523
|
+
const l = window.document.querySelector(`.${a}`);
|
|
2524
|
+
l && Oe(l, { behavior: "smooth", scrollMode: "if-needed" });
|
|
2525
2525
|
}, 0), !0;
|
|
2526
2526
|
}
|
|
2527
2527
|
return !1;
|
|
2528
2528
|
}
|
|
2529
|
-
const
|
|
2529
|
+
const ja = A.create({
|
|
2530
2530
|
name: "search",
|
|
2531
2531
|
addOptions() {
|
|
2532
2532
|
var e;
|
|
@@ -2543,7 +2543,7 @@ const ji = A.create({
|
|
|
2543
2543
|
onChange: () => {
|
|
2544
2544
|
},
|
|
2545
2545
|
button: ({ editor: t, t: n }) => ({
|
|
2546
|
-
component:
|
|
2546
|
+
component: za,
|
|
2547
2547
|
componentProps: {
|
|
2548
2548
|
action: () => {
|
|
2549
2549
|
},
|
|
@@ -2564,33 +2564,33 @@ const ji = A.create({
|
|
|
2564
2564
|
},
|
|
2565
2565
|
addCommands() {
|
|
2566
2566
|
return {
|
|
2567
|
-
setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE),
|
|
2568
|
-
setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e,
|
|
2569
|
-
setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e,
|
|
2567
|
+
setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE), ie(t, n), !1),
|
|
2568
|
+
setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, ie(t, n), !1),
|
|
2569
|
+
setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, ie(t, n), !1),
|
|
2570
2570
|
replace: () => ({ state: e, dispatch: t }) => {
|
|
2571
|
-
const { replaceTerm: n } = this.options, { currentIndex:
|
|
2572
|
-
return o ? (Ge(n, [o], { state: e, dispatch: t }), this.storage.results.splice(
|
|
2571
|
+
const { replaceTerm: n } = this.options, { currentIndex: a, results: i } = this.storage, o = i[a];
|
|
2572
|
+
return o ? (Ge(n, [o], { state: e, dispatch: t }), this.storage.results.splice(a, 1)) : (Ge(n, i, { state: e, dispatch: t }), this.storage.results.shift()), K(D.SEARCH_REPLCE), ie(e, t), !1;
|
|
2573
2573
|
},
|
|
2574
2574
|
replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
|
|
2575
|
-
const { replaceTerm:
|
|
2576
|
-
return
|
|
2575
|
+
const { replaceTerm: a } = this.options, { results: i } = this.storage;
|
|
2576
|
+
return Ia(a, i, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], K(D.SEARCH_REPLCE), ie(e, n), !1;
|
|
2577
2577
|
},
|
|
2578
2578
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
2579
|
-
const { searchResultCurrentClass: n } = this.options, { currentIndex:
|
|
2579
|
+
const { searchResultCurrentClass: n } = this.options, { currentIndex: a, results: i } = this.storage, o = (a + i.length - 1) % i.length;
|
|
2580
2580
|
return this.storage.currentIndex = o, K(D.SEARCH_REPLCE), Ze({
|
|
2581
2581
|
view: e,
|
|
2582
2582
|
tr: t,
|
|
2583
|
-
searchResults:
|
|
2583
|
+
searchResults: i,
|
|
2584
2584
|
searchResultCurrentClass: n,
|
|
2585
2585
|
gotoIndex: o
|
|
2586
2586
|
});
|
|
2587
2587
|
},
|
|
2588
2588
|
goToNextSearchResult: () => ({ view: e, tr: t }) => {
|
|
2589
|
-
const { searchResultCurrentClass: n } = this.options, { currentIndex:
|
|
2589
|
+
const { searchResultCurrentClass: n } = this.options, { currentIndex: a, results: i } = this.storage, o = (a + 1) % i.length;
|
|
2590
2590
|
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE), Ze({
|
|
2591
2591
|
view: e,
|
|
2592
2592
|
tr: t,
|
|
2593
|
-
searchResults:
|
|
2593
|
+
searchResults: i,
|
|
2594
2594
|
searchResultCurrentClass: n,
|
|
2595
2595
|
gotoIndex: o
|
|
2596
2596
|
});
|
|
@@ -2604,26 +2604,26 @@ const ji = A.create({
|
|
|
2604
2604
|
key: new Z("search"),
|
|
2605
2605
|
state: {
|
|
2606
2606
|
init() {
|
|
2607
|
-
return
|
|
2607
|
+
return re.empty;
|
|
2608
2608
|
},
|
|
2609
2609
|
apply(t) {
|
|
2610
|
-
const { doc: n, docChanged:
|
|
2611
|
-
if (
|
|
2612
|
-
const { decorationsToReturn: d, results:
|
|
2610
|
+
const { doc: n, docChanged: a } = t, { searchTerm: i, searchResultClass: o, searchResultCurrentClass: r, disableRegex: l, caseSensitive: u } = e.options;
|
|
2611
|
+
if (a || i) {
|
|
2612
|
+
const { decorationsToReturn: d, results: c } = Pa(
|
|
2613
2613
|
n,
|
|
2614
|
-
|
|
2614
|
+
Ma(i, l, u),
|
|
2615
2615
|
o
|
|
2616
2616
|
);
|
|
2617
|
-
if (e.storage.results =
|
|
2618
|
-
const { fromPos:
|
|
2619
|
-
d.push(
|
|
2617
|
+
if (e.storage.results = c, e.storage.currentIndex > c.length - 1 && (e.storage.currentIndex = 0), K(D.SEARCH_REPLCE), t.getMeta("directDecoration")) {
|
|
2618
|
+
const { fromPos: h, toPos: _, attrs: f } = t.getMeta("directDecoration");
|
|
2619
|
+
d.push(le.inline(h, _, f));
|
|
2620
2620
|
} else
|
|
2621
|
-
|
|
2622
|
-
class:
|
|
2621
|
+
c.length > 0 && (d[0] = le.inline(c[0].from, c[0].to, {
|
|
2622
|
+
class: r
|
|
2623
2623
|
}));
|
|
2624
|
-
return
|
|
2624
|
+
return re.create(n, d);
|
|
2625
2625
|
}
|
|
2626
|
-
return
|
|
2626
|
+
return re.empty;
|
|
2627
2627
|
}
|
|
2628
2628
|
},
|
|
2629
2629
|
props: {
|
|
@@ -2635,15 +2635,15 @@ const ji = A.create({
|
|
|
2635
2635
|
];
|
|
2636
2636
|
}
|
|
2637
2637
|
});
|
|
2638
|
-
function
|
|
2638
|
+
function Ba({
|
|
2639
2639
|
className: e,
|
|
2640
2640
|
...t
|
|
2641
2641
|
}) {
|
|
2642
|
-
return /* @__PURE__ */
|
|
2642
|
+
return /* @__PURE__ */ s(
|
|
2643
2643
|
W.Root,
|
|
2644
2644
|
{
|
|
2645
2645
|
className: T(
|
|
2646
|
-
"
|
|
2646
|
+
"bg-popover text-popover-foreground isolate flex h-full w-fit flex-col overflow-hidden rounded-md",
|
|
2647
2647
|
e
|
|
2648
2648
|
),
|
|
2649
2649
|
"data-slot": "emoji-picker",
|
|
@@ -2651,21 +2651,21 @@ function Bi({
|
|
|
2651
2651
|
}
|
|
2652
2652
|
);
|
|
2653
2653
|
}
|
|
2654
|
-
function
|
|
2654
|
+
function Da({
|
|
2655
2655
|
className: e,
|
|
2656
2656
|
...t
|
|
2657
2657
|
}) {
|
|
2658
|
-
return /* @__PURE__ */
|
|
2658
|
+
return /* @__PURE__ */ m(
|
|
2659
2659
|
"div",
|
|
2660
2660
|
{
|
|
2661
|
-
className: T("
|
|
2661
|
+
className: T("flex h-9 items-center gap-2 border-b px-3", e),
|
|
2662
2662
|
"data-slot": "emoji-picker-search-wrapper",
|
|
2663
2663
|
children: [
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ s(an, { className: "size-4 shrink-0 opacity-50" }),
|
|
2665
|
+
/* @__PURE__ */ s(
|
|
2666
2666
|
W.Search,
|
|
2667
2667
|
{
|
|
2668
|
-
className: "
|
|
2668
|
+
className: "outline-hidden placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm disabled:cursor-not-allowed disabled:opacity-50",
|
|
2669
2669
|
"data-slot": "emoji-picker-search",
|
|
2670
2670
|
...t
|
|
2671
2671
|
}
|
|
@@ -2674,20 +2674,20 @@ function Di({
|
|
|
2674
2674
|
}
|
|
2675
2675
|
);
|
|
2676
2676
|
}
|
|
2677
|
-
function
|
|
2678
|
-
return /* @__PURE__ */
|
|
2677
|
+
function Oa({ children: e, ...t }) {
|
|
2678
|
+
return /* @__PURE__ */ s("div", { ...t, className: "scroll-my-1 px-1", "data-slot": "emoji-picker-row", children: e });
|
|
2679
2679
|
}
|
|
2680
|
-
function $
|
|
2680
|
+
function $a({
|
|
2681
2681
|
emoji: e,
|
|
2682
2682
|
className: t,
|
|
2683
2683
|
...n
|
|
2684
2684
|
}) {
|
|
2685
|
-
return /* @__PURE__ */
|
|
2685
|
+
return /* @__PURE__ */ s(
|
|
2686
2686
|
"button",
|
|
2687
2687
|
{
|
|
2688
2688
|
...n,
|
|
2689
2689
|
className: T(
|
|
2690
|
-
"data-[active]:
|
|
2690
|
+
"data-[active]:bg-accent flex size-7 items-center justify-center rounded-sm text-base",
|
|
2691
2691
|
t
|
|
2692
2692
|
),
|
|
2693
2693
|
"data-slot": "emoji-picker-emoji",
|
|
@@ -2695,55 +2695,55 @@ function $i({
|
|
|
2695
2695
|
}
|
|
2696
2696
|
);
|
|
2697
2697
|
}
|
|
2698
|
-
function
|
|
2698
|
+
function Fa({
|
|
2699
2699
|
category: e,
|
|
2700
2700
|
...t
|
|
2701
2701
|
}) {
|
|
2702
|
-
return /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ s(
|
|
2703
2703
|
"div",
|
|
2704
2704
|
{
|
|
2705
2705
|
...t,
|
|
2706
|
-
className: "
|
|
2706
|
+
className: "bg-popover text-muted-foreground px-3 pb-2 pt-3.5 text-xs leading-none",
|
|
2707
2707
|
"data-slot": "emoji-picker-category-header",
|
|
2708
2708
|
children: e.label
|
|
2709
2709
|
}
|
|
2710
2710
|
);
|
|
2711
2711
|
}
|
|
2712
|
-
function
|
|
2712
|
+
function Ua({
|
|
2713
2713
|
className: e,
|
|
2714
2714
|
...t
|
|
2715
2715
|
}) {
|
|
2716
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ m(
|
|
2717
2717
|
W.Viewport,
|
|
2718
2718
|
{
|
|
2719
|
-
className: T("
|
|
2719
|
+
className: T("outline-hidden relative flex-1", e),
|
|
2720
2720
|
"data-slot": "emoji-picker-viewport",
|
|
2721
2721
|
...t,
|
|
2722
2722
|
children: [
|
|
2723
|
-
/* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ s(
|
|
2724
2724
|
W.Loading,
|
|
2725
2725
|
{
|
|
2726
|
-
className: "
|
|
2726
|
+
className: "absolute inset-0 flex items-center justify-center text-muted-foreground",
|
|
2727
2727
|
"data-slot": "emoji-picker-loading",
|
|
2728
|
-
children: /* @__PURE__ */
|
|
2728
|
+
children: /* @__PURE__ */ s(on, { className: "size-4 animate-spin" })
|
|
2729
2729
|
}
|
|
2730
2730
|
),
|
|
2731
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ s(
|
|
2732
2732
|
W.Empty,
|
|
2733
2733
|
{
|
|
2734
|
-
className: "
|
|
2734
|
+
className: "absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",
|
|
2735
2735
|
"data-slot": "emoji-picker-empty",
|
|
2736
2736
|
children: "No emoji found."
|
|
2737
2737
|
}
|
|
2738
2738
|
),
|
|
2739
|
-
/* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ s(
|
|
2740
2740
|
W.List,
|
|
2741
2741
|
{
|
|
2742
|
-
className: "
|
|
2742
|
+
className: "select-none pb-1",
|
|
2743
2743
|
components: {
|
|
2744
|
-
Row:
|
|
2745
|
-
Emoji: $
|
|
2746
|
-
CategoryHeader:
|
|
2744
|
+
Row: Oa,
|
|
2745
|
+
Emoji: $a,
|
|
2746
|
+
CategoryHeader: Fa
|
|
2747
2747
|
},
|
|
2748
2748
|
"data-slot": "emoji-picker-list"
|
|
2749
2749
|
}
|
|
@@ -2752,47 +2752,47 @@ function Ui({
|
|
|
2752
2752
|
}
|
|
2753
2753
|
);
|
|
2754
2754
|
}
|
|
2755
|
-
function
|
|
2755
|
+
function qa({
|
|
2756
2756
|
className: e,
|
|
2757
2757
|
...t
|
|
2758
2758
|
}) {
|
|
2759
|
-
return /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ s(
|
|
2760
2760
|
"div",
|
|
2761
2761
|
{
|
|
2762
2762
|
className: T(
|
|
2763
|
-
"
|
|
2763
|
+
"max-w-(--frimousse-viewport-width) flex w-full min-w-0 items-center gap-1 border-t p-2",
|
|
2764
2764
|
e
|
|
2765
2765
|
),
|
|
2766
2766
|
"data-slot": "emoji-picker-footer",
|
|
2767
2767
|
...t,
|
|
2768
|
-
children: /* @__PURE__ */
|
|
2769
|
-
/* @__PURE__ */
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
] }) : /* @__PURE__ */
|
|
2768
|
+
children: /* @__PURE__ */ s(W.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ m(pe, { children: [
|
|
2769
|
+
/* @__PURE__ */ s("div", { className: "flex size-7 flex-none items-center justify-center text-lg", children: n.emoji }),
|
|
2770
|
+
/* @__PURE__ */ s("span", { className: "text-secondary-foreground truncate text-xs", children: n.label })
|
|
2771
|
+
] }) : /* @__PURE__ */ s("span", { className: "text-muted-foreground ml-1.5 flex h-7 items-center truncate text-xs", children: "Select an emoji…" }) })
|
|
2772
2772
|
}
|
|
2773
2773
|
);
|
|
2774
2774
|
}
|
|
2775
|
-
function
|
|
2776
|
-
return /* @__PURE__ */
|
|
2777
|
-
/* @__PURE__ */
|
|
2778
|
-
/* @__PURE__ */
|
|
2779
|
-
|
|
2775
|
+
function Ka({ onSelectEmoji: e, children: t }) {
|
|
2776
|
+
return /* @__PURE__ */ m(ce, { modal: !0, children: [
|
|
2777
|
+
/* @__PURE__ */ s(de, { asChild: !0, children: t }),
|
|
2778
|
+
/* @__PURE__ */ s(
|
|
2779
|
+
ue,
|
|
2780
2780
|
{
|
|
2781
2781
|
align: "start",
|
|
2782
|
-
className: "
|
|
2782
|
+
className: "size-full p-2",
|
|
2783
2783
|
hideWhenDetached: !0,
|
|
2784
2784
|
side: "bottom",
|
|
2785
|
-
children: /* @__PURE__ */
|
|
2786
|
-
|
|
2785
|
+
children: /* @__PURE__ */ m(
|
|
2786
|
+
Ba,
|
|
2787
2787
|
{
|
|
2788
|
-
className: "!
|
|
2788
|
+
className: "!h-[342px]",
|
|
2789
2789
|
onEmojiSelect: ({ emoji: n }) => {
|
|
2790
2790
|
e(n);
|
|
2791
2791
|
},
|
|
2792
2792
|
children: [
|
|
2793
|
-
/* @__PURE__ */
|
|
2794
|
-
/* @__PURE__ */
|
|
2795
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ s(Da, {}),
|
|
2794
|
+
/* @__PURE__ */ s(Ua, {}),
|
|
2795
|
+
/* @__PURE__ */ s(qa, {})
|
|
2796
2796
|
]
|
|
2797
2797
|
}
|
|
2798
2798
|
)
|
|
@@ -2800,62 +2800,62 @@ function Ki({ onSelectEmoji: e, children: t }) {
|
|
|
2800
2800
|
)
|
|
2801
2801
|
] });
|
|
2802
2802
|
}
|
|
2803
|
-
function
|
|
2804
|
-
const
|
|
2805
|
-
(
|
|
2806
|
-
const { selection: o } = e.state, { $anchor:
|
|
2807
|
-
return e.chain().insertContentAt(
|
|
2803
|
+
function Va({ editor: e, icon: t, ...n }) {
|
|
2804
|
+
const a = F(
|
|
2805
|
+
(i) => {
|
|
2806
|
+
const { selection: o } = e.state, { $anchor: r } = o;
|
|
2807
|
+
return e.chain().insertContentAt(r.pos, i).run();
|
|
2808
2808
|
},
|
|
2809
2809
|
[e]
|
|
2810
2810
|
);
|
|
2811
|
-
return /* @__PURE__ */
|
|
2812
|
-
|
|
2811
|
+
return /* @__PURE__ */ s(Ka, { onSelectEmoji: a, children: /* @__PURE__ */ s(
|
|
2812
|
+
p,
|
|
2813
2813
|
{
|
|
2814
2814
|
icon: t,
|
|
2815
2815
|
tooltip: n == null ? void 0 : n.tooltip
|
|
2816
2816
|
}
|
|
2817
2817
|
) });
|
|
2818
2818
|
}
|
|
2819
|
-
const
|
|
2820
|
-
const n = G(null), [
|
|
2821
|
-
const
|
|
2822
|
-
|
|
2823
|
-
},
|
|
2824
|
-
|
|
2825
|
-
},
|
|
2826
|
-
|
|
2819
|
+
const mt = He((e, t) => {
|
|
2820
|
+
const n = G(null), [a, i] = C(0), { t: o } = j(), r = (c) => {
|
|
2821
|
+
const h = e.items[c];
|
|
2822
|
+
h && e.command(h);
|
|
2823
|
+
}, l = () => {
|
|
2824
|
+
i((a + e.items.length - 1) % e.items.length);
|
|
2825
|
+
}, u = () => {
|
|
2826
|
+
i((a + 1) % e.items.length);
|
|
2827
2827
|
}, d = () => {
|
|
2828
|
-
|
|
2828
|
+
r(a);
|
|
2829
2829
|
};
|
|
2830
|
-
return z(() =>
|
|
2831
|
-
if (Number.isNaN(
|
|
2830
|
+
return z(() => i(0), [e.items]), z(() => {
|
|
2831
|
+
if (Number.isNaN(a + 1))
|
|
2832
2832
|
return;
|
|
2833
|
-
const
|
|
2834
|
-
|
|
2835
|
-
}, [
|
|
2836
|
-
onKeyDown: ({ event:
|
|
2837
|
-
})), /* @__PURE__ */
|
|
2833
|
+
const c = n.current.querySelector(`span:nth-of-type(${a + 1})`);
|
|
2834
|
+
c && Oe(c, { behavior: "smooth", scrollMode: "if-needed" });
|
|
2835
|
+
}, [a]), ze(t, () => ({
|
|
2836
|
+
onKeyDown: ({ event: c }) => c.key === "ArrowUp" ? (l(), !0) : c.key === "ArrowDown" ? (u(), !0) : c.key === "Enter" ? (d(), !0) : !1
|
|
2837
|
+
})), /* @__PURE__ */ s("div", { className: "max-h-[320px] w-[200px] overflow-y-auto overflow-x-hidden rounded-sm !border bg-popover p-1 text-popover-foreground shadow-md outline-none", children: /* @__PURE__ */ s("div", { ref: n, children: e.items.length > 0 ? e.items.map((c, h) => /* @__PURE__ */ m(
|
|
2838
2838
|
"span",
|
|
2839
2839
|
{
|
|
2840
|
-
className: P("
|
|
2841
|
-
onClick: () =>
|
|
2840
|
+
className: P(" relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent focus:text-accent-foreground", h === a ? "bg-accent" : ""),
|
|
2841
|
+
onClick: () => r(h),
|
|
2842
2842
|
children: [
|
|
2843
|
-
|
|
2843
|
+
c.fallbackImage ? /* @__PURE__ */ s(
|
|
2844
2844
|
"img",
|
|
2845
2845
|
{
|
|
2846
|
-
className: "
|
|
2847
|
-
src:
|
|
2846
|
+
className: "size-[1em]",
|
|
2847
|
+
src: c.fallbackImage
|
|
2848
2848
|
}
|
|
2849
|
-
) :
|
|
2849
|
+
) : c.emoji,
|
|
2850
2850
|
":",
|
|
2851
|
-
|
|
2851
|
+
c.name,
|
|
2852
2852
|
":"
|
|
2853
2853
|
]
|
|
2854
2854
|
},
|
|
2855
|
-
`emoji-list-code-${
|
|
2856
|
-
)) : /* @__PURE__ */
|
|
2855
|
+
`emoji-list-code-${h}`
|
|
2856
|
+
)) : /* @__PURE__ */ s("div", { className: "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", children: /* @__PURE__ */ s("span", { children: o("no_result_found") }) }) }) });
|
|
2857
2857
|
});
|
|
2858
|
-
|
|
2858
|
+
mt.displayName = "EmojiList";
|
|
2859
2859
|
const ee = {
|
|
2860
2860
|
100: "💯",
|
|
2861
2861
|
1234: "🔢",
|
|
@@ -4700,18 +4700,18 @@ Object.keys(ee).reduce((e, t) => {
|
|
|
4700
4700
|
const n = ee[t];
|
|
4701
4701
|
return e[n] = t, e;
|
|
4702
4702
|
}, {});
|
|
4703
|
-
const
|
|
4703
|
+
const Wa = Object.keys(ee).map((e) => e);
|
|
4704
4704
|
Object.keys(ee).map((e) => ee[e]);
|
|
4705
|
-
function
|
|
4706
|
-
return
|
|
4705
|
+
function Ga(e) {
|
|
4706
|
+
return Wa.filter((t) => t.startsWith(e)).map((t) => ({
|
|
4707
4707
|
name: t,
|
|
4708
4708
|
emoji: ee[t]
|
|
4709
4709
|
}));
|
|
4710
4710
|
}
|
|
4711
|
-
const
|
|
4711
|
+
const Za = 200, Ja = new Z("emoji"), bo = ge.create({
|
|
4712
4712
|
name: "emoji",
|
|
4713
4713
|
content: "text*",
|
|
4714
|
-
priority:
|
|
4714
|
+
priority: Za,
|
|
4715
4715
|
addOptions() {
|
|
4716
4716
|
var e;
|
|
4717
4717
|
return {
|
|
@@ -4719,13 +4719,13 @@ const Zi = 200, Ji = new Z("emoji"), bo = ge.create({
|
|
|
4719
4719
|
HTMLAttributes: {},
|
|
4720
4720
|
suggestion: {
|
|
4721
4721
|
char: ":",
|
|
4722
|
-
pluginKey:
|
|
4723
|
-
command: ({ editor: t, range: n, props:
|
|
4724
|
-
t.chain().focus().insertContentAt(n, `${
|
|
4722
|
+
pluginKey: Ja,
|
|
4723
|
+
command: ({ editor: t, range: n, props: a }) => {
|
|
4724
|
+
t.chain().focus().insertContentAt(n, `${a.emoji} `).run();
|
|
4725
4725
|
}
|
|
4726
4726
|
},
|
|
4727
4727
|
button: ({ editor: t, t: n }) => ({
|
|
4728
|
-
component:
|
|
4728
|
+
component: Va,
|
|
4729
4729
|
componentProps: {
|
|
4730
4730
|
editor: t,
|
|
4731
4731
|
action: () => {
|
|
@@ -4753,16 +4753,16 @@ const Zi = 200, Ji = new Z("emoji"), bo = ge.create({
|
|
|
4753
4753
|
}
|
|
4754
4754
|
}).configure({
|
|
4755
4755
|
suggestion: {
|
|
4756
|
-
items: ({ query: e }) =>
|
|
4756
|
+
items: ({ query: e }) => Ga(e),
|
|
4757
4757
|
render: () => {
|
|
4758
4758
|
let e, t, n;
|
|
4759
4759
|
return {
|
|
4760
|
-
onStart: (
|
|
4761
|
-
n =
|
|
4762
|
-
props:
|
|
4763
|
-
editor:
|
|
4760
|
+
onStart: (a) => {
|
|
4761
|
+
n = a.editor.isEditable, n && (e = new Te(mt, {
|
|
4762
|
+
props: a,
|
|
4763
|
+
editor: a.editor
|
|
4764
4764
|
}), t = De("body", {
|
|
4765
|
-
getReferenceClientRect:
|
|
4765
|
+
getReferenceClientRect: a.clientRect,
|
|
4766
4766
|
appendTo: () => document.body,
|
|
4767
4767
|
content: e.element,
|
|
4768
4768
|
showOnCreate: !0,
|
|
@@ -4771,15 +4771,15 @@ const Zi = 200, Ji = new Z("emoji"), bo = ge.create({
|
|
|
4771
4771
|
placement: "bottom-start"
|
|
4772
4772
|
}));
|
|
4773
4773
|
},
|
|
4774
|
-
onUpdate(
|
|
4775
|
-
n && (e.updateProps(
|
|
4776
|
-
getReferenceClientRect:
|
|
4774
|
+
onUpdate(a) {
|
|
4775
|
+
n && (e.updateProps(a), t[0].setProps({
|
|
4776
|
+
getReferenceClientRect: a.clientRect
|
|
4777
4777
|
}));
|
|
4778
4778
|
},
|
|
4779
|
-
onKeyDown(
|
|
4780
|
-
var
|
|
4779
|
+
onKeyDown(a) {
|
|
4780
|
+
var i;
|
|
4781
4781
|
if (n)
|
|
4782
|
-
return
|
|
4782
|
+
return a.event.key === "Escape" ? (t[0].hide(), !0) : (i = e.ref) == null ? void 0 : i.onKeyDown(a);
|
|
4783
4783
|
},
|
|
4784
4784
|
onExit() {
|
|
4785
4785
|
n && (t[0].destroy(), e.destroy());
|
|
@@ -4788,7 +4788,7 @@ const Zi = 200, Ji = new Z("emoji"), bo = ge.create({
|
|
|
4788
4788
|
}
|
|
4789
4789
|
}
|
|
4790
4790
|
});
|
|
4791
|
-
function
|
|
4791
|
+
function Ya(e) {
|
|
4792
4792
|
const t = document.createElement("iframe");
|
|
4793
4793
|
t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
|
|
4794
4794
|
<!DOCTYPE html>
|
|
@@ -4805,8 +4805,8 @@ function Yi(e) {
|
|
|
4805
4805
|
</body>
|
|
4806
4806
|
</html>
|
|
4807
4807
|
`;
|
|
4808
|
-
const n = t.contentWindow,
|
|
4809
|
-
|
|
4808
|
+
const n = t.contentWindow, a = t.contentDocument || t.contentWindow && t.contentWindow.document, i = document.createElement("link");
|
|
4809
|
+
i.rel = "stylesheet", i.href = "https://cdn.jsdelivr.net/npm/reactjs-tiptap-editor@latest/lib/style.css", a.head.appendChild(i), a && (a.open(), a.write(e), a.close()), n && t.addEventListener("load", function() {
|
|
4810
4810
|
try {
|
|
4811
4811
|
setTimeout(() => {
|
|
4812
4812
|
n.focus();
|
|
@@ -4825,21 +4825,21 @@ function Yi(e) {
|
|
|
4825
4825
|
}, 100);
|
|
4826
4826
|
});
|
|
4827
4827
|
}
|
|
4828
|
-
function
|
|
4828
|
+
function Qa(e) {
|
|
4829
4829
|
const t = e.getHTML();
|
|
4830
|
-
return t ? (
|
|
4830
|
+
return t ? (Ya(t), !0) : !1;
|
|
4831
4831
|
}
|
|
4832
|
-
const
|
|
4832
|
+
const po = A.create({
|
|
4833
4833
|
name: "exportPdf",
|
|
4834
4834
|
addOptions() {
|
|
4835
4835
|
var e;
|
|
4836
4836
|
return {
|
|
4837
4837
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
4838
4838
|
button: ({ editor: t, t: n }) => ({
|
|
4839
|
-
component:
|
|
4839
|
+
component: p,
|
|
4840
4840
|
componentProps: {
|
|
4841
4841
|
action: () => {
|
|
4842
|
-
|
|
4842
|
+
Qa(t);
|
|
4843
4843
|
},
|
|
4844
4844
|
icon: "ExportPdf",
|
|
4845
4845
|
tooltip: n("editor.exportPdf.tooltip"),
|
|
@@ -4850,24 +4850,24 @@ const xo = A.create({
|
|
|
4850
4850
|
};
|
|
4851
4851
|
}
|
|
4852
4852
|
});
|
|
4853
|
-
function
|
|
4854
|
-
const n = atob(e.split(",")[1]),
|
|
4853
|
+
function Xa(e, t) {
|
|
4854
|
+
const n = atob(e.split(",")[1]), a = Array.from({ length: n.length });
|
|
4855
4855
|
for (let o = 0; o < n.length; o++)
|
|
4856
|
-
|
|
4857
|
-
const
|
|
4858
|
-
return new Blob([
|
|
4856
|
+
a[o] = n.charCodeAt(o);
|
|
4857
|
+
const i = new Uint8Array(a);
|
|
4858
|
+
return new Blob([i], { type: t });
|
|
4859
4859
|
}
|
|
4860
|
-
function
|
|
4860
|
+
function ei(e, t) {
|
|
4861
4861
|
return new File([e], t, { type: e.type });
|
|
4862
4862
|
}
|
|
4863
|
-
function
|
|
4864
|
-
const { toast: t } = Nn(), { t: n } = j(), [
|
|
4865
|
-
function
|
|
4866
|
-
var
|
|
4867
|
-
(
|
|
4863
|
+
function ti(e) {
|
|
4864
|
+
const { toast: t } = Nn(), { t: n } = j(), [a, i] = C(!1), o = G(null);
|
|
4865
|
+
function r() {
|
|
4866
|
+
var h;
|
|
4867
|
+
(h = o.current) == null || h.click();
|
|
4868
4868
|
}
|
|
4869
|
-
function
|
|
4870
|
-
const _ =
|
|
4869
|
+
function l(h) {
|
|
4870
|
+
const _ = h.target.files[0];
|
|
4871
4871
|
if (_) {
|
|
4872
4872
|
if (_.size > e.limit) {
|
|
4873
4873
|
t({
|
|
@@ -4879,10 +4879,10 @@ function ta(e) {
|
|
|
4879
4879
|
d(_);
|
|
4880
4880
|
}
|
|
4881
4881
|
}
|
|
4882
|
-
async function h
|
|
4882
|
+
async function u(h) {
|
|
4883
4883
|
var L;
|
|
4884
|
-
const f = new DOMParser().parseFromString(
|
|
4885
|
-
if (
|
|
4884
|
+
const f = new DOMParser().parseFromString(h, "text/html"), w = f.querySelectorAll("img");
|
|
4885
|
+
if (w.length === 0)
|
|
4886
4886
|
return f.body.innerHTML;
|
|
4887
4887
|
if (An(e.editor, "image")) {
|
|
4888
4888
|
const E = (L = e.editor.extensionManager.extensions.find(
|
|
@@ -4890,13 +4890,13 @@ function ta(e) {
|
|
|
4890
4890
|
)) == null ? void 0 : L.options;
|
|
4891
4891
|
if (E && typeof E.upload == "function") {
|
|
4892
4892
|
const g = [];
|
|
4893
|
-
for (const
|
|
4894
|
-
const H =
|
|
4893
|
+
for (const v of w) {
|
|
4894
|
+
const H = v.getAttribute("src"), S = Xa(H, "image/jpeg"), O = ei(S, "image.jpeg");
|
|
4895
4895
|
g.push(O);
|
|
4896
4896
|
}
|
|
4897
4897
|
const b = await E.upload(g);
|
|
4898
|
-
for (const [
|
|
4899
|
-
H.setAttribute("src", b[
|
|
4898
|
+
for (const [v, H] of w.entries()) {
|
|
4899
|
+
H.setAttribute("src", b[v].src);
|
|
4900
4900
|
const S = H.parentElement;
|
|
4901
4901
|
(S == null ? void 0 : S.tagName) === "P" && (S.insertAdjacentElement("beforebegin", H), !S.hasChildNodes() && S.textContent === "" && S.remove());
|
|
4902
4902
|
}
|
|
@@ -4906,43 +4906,43 @@ function ta(e) {
|
|
|
4906
4906
|
} else
|
|
4907
4907
|
return console.error("Image extension not found, unable to convert image"), f.body.innerHTML;
|
|
4908
4908
|
}
|
|
4909
|
-
async function d(
|
|
4910
|
-
|
|
4909
|
+
async function d(h) {
|
|
4910
|
+
i(!0);
|
|
4911
4911
|
try {
|
|
4912
4912
|
if (e.convert) {
|
|
4913
|
-
const _ = await e.convert(
|
|
4914
|
-
|
|
4913
|
+
const _ = await e.convert(h);
|
|
4914
|
+
c(_);
|
|
4915
4915
|
} else {
|
|
4916
|
-
const _ = await
|
|
4916
|
+
const _ = await h.arrayBuffer(), { value: f } = await Yt.convertToHtml(
|
|
4917
4917
|
{ arrayBuffer: _ },
|
|
4918
4918
|
e == null ? void 0 : e.mammothOptions
|
|
4919
4919
|
);
|
|
4920
|
-
|
|
4920
|
+
c(f);
|
|
4921
4921
|
}
|
|
4922
4922
|
} finally {
|
|
4923
|
-
|
|
4923
|
+
i(!1);
|
|
4924
4924
|
}
|
|
4925
4925
|
}
|
|
4926
|
-
async function
|
|
4927
|
-
const _ = await h
|
|
4926
|
+
async function c(h) {
|
|
4927
|
+
const _ = await u(h);
|
|
4928
4928
|
e.editor.chain().setContent(_, !0).run();
|
|
4929
4929
|
}
|
|
4930
|
-
return /* @__PURE__ */
|
|
4931
|
-
/* @__PURE__ */
|
|
4932
|
-
|
|
4930
|
+
return /* @__PURE__ */ m("div", { children: [
|
|
4931
|
+
/* @__PURE__ */ s(
|
|
4932
|
+
p,
|
|
4933
4933
|
{
|
|
4934
|
-
action:
|
|
4934
|
+
action: r,
|
|
4935
4935
|
disabled: e == null ? void 0 : e.disabled,
|
|
4936
4936
|
icon: e == null ? void 0 : e.icon,
|
|
4937
|
-
loading:
|
|
4937
|
+
loading: a,
|
|
4938
4938
|
tooltip: e == null ? void 0 : e.tooltip
|
|
4939
4939
|
}
|
|
4940
4940
|
),
|
|
4941
|
-
/* @__PURE__ */
|
|
4941
|
+
/* @__PURE__ */ s(
|
|
4942
4942
|
"input",
|
|
4943
4943
|
{
|
|
4944
4944
|
accept: ".docx",
|
|
4945
|
-
onChange:
|
|
4945
|
+
onChange: l,
|
|
4946
4946
|
ref: o,
|
|
4947
4947
|
type: "file",
|
|
4948
4948
|
style: {
|
|
@@ -4952,7 +4952,7 @@ function ta(e) {
|
|
|
4952
4952
|
)
|
|
4953
4953
|
] });
|
|
4954
4954
|
}
|
|
4955
|
-
const
|
|
4955
|
+
const wo = A.create({
|
|
4956
4956
|
name: "importWord",
|
|
4957
4957
|
addOptions() {
|
|
4958
4958
|
var e;
|
|
@@ -4962,34 +4962,34 @@ const po = A.create({
|
|
|
4962
4962
|
convert: void 0,
|
|
4963
4963
|
limit: 1024 * 1024 * 10,
|
|
4964
4964
|
// 10 MB
|
|
4965
|
-
button: ({ editor: t, extension: n, t:
|
|
4966
|
-
const { convert:
|
|
4965
|
+
button: ({ editor: t, extension: n, t: a }) => {
|
|
4966
|
+
const { convert: i, limit: o, mammothOptions: r } = n.options;
|
|
4967
4967
|
return {
|
|
4968
|
-
component:
|
|
4968
|
+
component: ti,
|
|
4969
4969
|
componentProps: {
|
|
4970
4970
|
editor: t,
|
|
4971
|
-
convert:
|
|
4971
|
+
convert: i,
|
|
4972
4972
|
limit: o,
|
|
4973
|
-
mammothOptions:
|
|
4973
|
+
mammothOptions: r,
|
|
4974
4974
|
action: () => t.commands.setHorizontalRule(),
|
|
4975
4975
|
disabled: !t.can().setHorizontalRule(),
|
|
4976
4976
|
icon: "Word",
|
|
4977
4977
|
shortcutKeys: ["alt", "mod", "S"],
|
|
4978
|
-
tooltip:
|
|
4978
|
+
tooltip: a("editor.importWord.tooltip")
|
|
4979
4979
|
}
|
|
4980
4980
|
};
|
|
4981
4981
|
}
|
|
4982
4982
|
};
|
|
4983
4983
|
}
|
|
4984
|
-
}),
|
|
4985
|
-
function
|
|
4986
|
-
if (
|
|
4987
|
-
const n = window.URL.createObjectURL(e),
|
|
4988
|
-
return
|
|
4984
|
+
}), ni = typeof window < "u";
|
|
4985
|
+
function ai(e, t) {
|
|
4986
|
+
if (ni) {
|
|
4987
|
+
const n = window.URL.createObjectURL(e), a = document.createElement("a");
|
|
4988
|
+
return a.href = n, a.download = t, a.click(), window.URL.revokeObjectURL(n), Promise.resolve();
|
|
4989
4989
|
}
|
|
4990
4990
|
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
4991
4991
|
}
|
|
4992
|
-
const
|
|
4992
|
+
const ii = {
|
|
4993
4993
|
...U,
|
|
4994
4994
|
hardBreak: U.hard_break,
|
|
4995
4995
|
codeBlock: U.code_block,
|
|
@@ -5011,14 +5011,14 @@ const aa = {
|
|
|
5011
5011
|
}
|
|
5012
5012
|
});
|
|
5013
5013
|
}
|
|
5014
|
-
},
|
|
5014
|
+
}, oi = new On(ii, $n), yo = A.create({
|
|
5015
5015
|
name: "exportWord",
|
|
5016
5016
|
addOptions() {
|
|
5017
5017
|
var e;
|
|
5018
5018
|
return {
|
|
5019
5019
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
5020
5020
|
button: ({ editor: t, t: n }) => ({
|
|
5021
|
-
component:
|
|
5021
|
+
component: p,
|
|
5022
5022
|
componentProps: {
|
|
5023
5023
|
icon: "ExportWord",
|
|
5024
5024
|
action: () => {
|
|
@@ -5036,46 +5036,46 @@ const aa = {
|
|
|
5036
5036
|
return {
|
|
5037
5037
|
exportToWord: () => async ({ editor: e }) => {
|
|
5038
5038
|
const t = {
|
|
5039
|
-
getImageBuffer: async (
|
|
5040
|
-
const o = await (await fetch(
|
|
5039
|
+
getImageBuffer: async (a) => {
|
|
5040
|
+
const o = await (await fetch(a)).arrayBuffer();
|
|
5041
5041
|
return new Uint8Array(o);
|
|
5042
5042
|
}
|
|
5043
|
-
}, n =
|
|
5044
|
-
return Bn.toBlob(n).then((
|
|
5043
|
+
}, n = oi.serialize(e.state.doc, t);
|
|
5044
|
+
return Bn.toBlob(n).then((a) => ai(new Blob([a]), "export-document.docx")), !0;
|
|
5045
5045
|
}
|
|
5046
5046
|
};
|
|
5047
5047
|
}
|
|
5048
|
-
}),
|
|
5049
|
-
toc:
|
|
5050
|
-
visible:
|
|
5051
|
-
list:
|
|
5052
|
-
item:
|
|
5048
|
+
}), si = "_toc_aag8a_1", ri = "_visible_aag8a_7", li = "_list_aag8a_11", ci = "_item_aag8a_16", _e = {
|
|
5049
|
+
toc: si,
|
|
5050
|
+
visible: ri,
|
|
5051
|
+
list: li,
|
|
5052
|
+
item: ci
|
|
5053
5053
|
};
|
|
5054
|
-
function
|
|
5054
|
+
function di(e) {
|
|
5055
5055
|
const t = [], n = [t];
|
|
5056
|
-
return e.forEach((
|
|
5057
|
-
let
|
|
5056
|
+
return e.forEach((a) => {
|
|
5057
|
+
let i = -1, o = n[a.level + i];
|
|
5058
5058
|
for (; !o; )
|
|
5059
|
-
|
|
5060
|
-
o.push({ ...
|
|
5059
|
+
i -= 1, o = n[a.level + i];
|
|
5060
|
+
o.push({ ...a, children: n[a.level] = [] });
|
|
5061
5061
|
}), t;
|
|
5062
5062
|
}
|
|
5063
|
-
function
|
|
5064
|
-
const t = Ie(), [n,
|
|
5065
|
-
const
|
|
5066
|
-
e.state.doc.descendants((
|
|
5067
|
-
if (
|
|
5068
|
-
const
|
|
5069
|
-
|
|
5070
|
-
...
|
|
5071
|
-
id:
|
|
5072
|
-
}),
|
|
5073
|
-
level:
|
|
5074
|
-
text:
|
|
5075
|
-
id:
|
|
5063
|
+
function ui({ editor: e }) {
|
|
5064
|
+
const t = Ie(), [n, a] = C([]), { t: i } = j(), o = F(() => {
|
|
5065
|
+
const r = [], l = e.state.tr;
|
|
5066
|
+
e.state.doc.descendants((u, d) => {
|
|
5067
|
+
if (u.type.name === "heading") {
|
|
5068
|
+
const c = `heading-${r.length + 1}`;
|
|
5069
|
+
u.attrs.id !== c && l.setNodeMarkup(d, void 0, {
|
|
5070
|
+
...u.attrs,
|
|
5071
|
+
id: c
|
|
5072
|
+
}), r.push({
|
|
5073
|
+
level: u.attrs.level,
|
|
5074
|
+
text: u.textContent,
|
|
5075
|
+
id: c
|
|
5076
5076
|
});
|
|
5077
5077
|
}
|
|
5078
|
-
}),
|
|
5078
|
+
}), l.setMeta("addToHistory", !1), l.setMeta("preventUpdate", !0), e.view.dispatch(l), a(r), e.eventEmitter && e.eventEmitter.emit("TableOfContents", di(r));
|
|
5079
5079
|
}, [e]);
|
|
5080
5080
|
return z(() => {
|
|
5081
5081
|
if (e) {
|
|
@@ -5089,60 +5089,60 @@ function ha({ editor: e }) {
|
|
|
5089
5089
|
}
|
|
5090
5090
|
}, [e, o]), z(() => {
|
|
5091
5091
|
o();
|
|
5092
|
-
}, []), /* @__PURE__ */
|
|
5093
|
-
/* @__PURE__ */
|
|
5094
|
-
/* @__PURE__ */
|
|
5092
|
+
}, []), /* @__PURE__ */ s(se, { className: P("tableOfContent", _e.toc, t && _e.visible), children: t ? /* @__PURE__ */ m("div", { style: { position: "relative" }, children: [
|
|
5093
|
+
/* @__PURE__ */ s("p", { className: "text-[20px] mb-[8px] font-semibold", children: i("editor.table_of_content") }),
|
|
5094
|
+
/* @__PURE__ */ s("ul", { className: _e.list, children: n.map((r, l) => /* @__PURE__ */ s(
|
|
5095
5095
|
"li",
|
|
5096
5096
|
{
|
|
5097
5097
|
className: _e.item,
|
|
5098
|
-
style: { paddingLeft: `${
|
|
5099
|
-
children: /* @__PURE__ */
|
|
5098
|
+
style: { paddingLeft: `${r.level - 1}rem` },
|
|
5099
|
+
children: /* @__PURE__ */ s("a", { href: `#${r.id}`, children: r.text })
|
|
5100
5100
|
},
|
|
5101
|
-
`table-of-content-${
|
|
5101
|
+
`table-of-content-${l}`
|
|
5102
5102
|
)) })
|
|
5103
5103
|
] }) : null });
|
|
5104
5104
|
}
|
|
5105
|
-
function
|
|
5106
|
-
const [n,
|
|
5105
|
+
function mi(e, ...t) {
|
|
5106
|
+
const [n, a] = C(!1);
|
|
5107
5107
|
return z(() => {
|
|
5108
|
-
const
|
|
5109
|
-
|
|
5108
|
+
const i = () => {
|
|
5109
|
+
a(e.isActive.apply(e, t));
|
|
5110
5110
|
};
|
|
5111
|
-
return e.on("selectionUpdate",
|
|
5112
|
-
e.off("selectionUpdate",
|
|
5111
|
+
return e.on("selectionUpdate", i), e.on("transaction", i), () => {
|
|
5112
|
+
e.off("selectionUpdate", i), e.off("transaction", i);
|
|
5113
5113
|
};
|
|
5114
|
-
}, [e, t,
|
|
5114
|
+
}, [e, t, a]), n;
|
|
5115
5115
|
}
|
|
5116
|
-
function
|
|
5117
|
-
const
|
|
5118
|
-
if (
|
|
5116
|
+
function hi({ editor: e, icon: t, tooltip: n }) {
|
|
5117
|
+
const a = mi(e, gi.name), i = F(() => {
|
|
5118
|
+
if (a) {
|
|
5119
5119
|
e.chain().focus().removeTableOfContents().run();
|
|
5120
5120
|
return;
|
|
5121
5121
|
}
|
|
5122
5122
|
e.chain().focus().setTableOfContents().run();
|
|
5123
|
-
}, [e,
|
|
5124
|
-
return /* @__PURE__ */
|
|
5125
|
-
|
|
5123
|
+
}, [e, a]);
|
|
5124
|
+
return /* @__PURE__ */ s(
|
|
5125
|
+
p,
|
|
5126
5126
|
{
|
|
5127
|
-
action:
|
|
5128
|
-
isActive: () =>
|
|
5127
|
+
action: i,
|
|
5128
|
+
isActive: () => a || !1,
|
|
5129
5129
|
icon: t,
|
|
5130
5130
|
tooltip: n
|
|
5131
5131
|
}
|
|
5132
5132
|
);
|
|
5133
5133
|
}
|
|
5134
|
-
function
|
|
5134
|
+
function _i(e) {
|
|
5135
5135
|
return e && e.type.name === "title";
|
|
5136
5136
|
}
|
|
5137
|
-
function
|
|
5138
|
-
const
|
|
5139
|
-
for (;
|
|
5140
|
-
const o =
|
|
5141
|
-
o.type === t &&
|
|
5137
|
+
function fi(e, t) {
|
|
5138
|
+
const a = [e.getJSON()], i = [];
|
|
5139
|
+
for (; a.length > 0; ) {
|
|
5140
|
+
const o = a.shift();
|
|
5141
|
+
o.type === t && i.push(o), o.content && o.content.length > 0 && a.push(...o.content);
|
|
5142
5142
|
}
|
|
5143
|
-
return
|
|
5143
|
+
return i;
|
|
5144
5144
|
}
|
|
5145
|
-
const
|
|
5145
|
+
const gi = ge.create({
|
|
5146
5146
|
name: "tableOfContents",
|
|
5147
5147
|
group: "block",
|
|
5148
5148
|
atom: !0,
|
|
@@ -5156,7 +5156,7 @@ const ga = ge.create({
|
|
|
5156
5156
|
lastColumnResizable: !0,
|
|
5157
5157
|
allowTableNodeSelection: !1,
|
|
5158
5158
|
button: ({ editor: t, t: n }) => ({
|
|
5159
|
-
component:
|
|
5159
|
+
component: hi,
|
|
5160
5160
|
componentProps: {
|
|
5161
5161
|
disabled: !1,
|
|
5162
5162
|
icon: "BookMarked",
|
|
@@ -5177,19 +5177,19 @@ const ga = ge.create({
|
|
|
5177
5177
|
return ["toc", be(e)];
|
|
5178
5178
|
},
|
|
5179
5179
|
addNodeView() {
|
|
5180
|
-
return Se(
|
|
5180
|
+
return Se(ui);
|
|
5181
5181
|
},
|
|
5182
5182
|
// @ts-expect-error
|
|
5183
5183
|
addCommands() {
|
|
5184
5184
|
return {
|
|
5185
5185
|
setTableOfContents: () => ({ commands: e, editor: t, view: n }) => {
|
|
5186
|
-
if (
|
|
5186
|
+
if (fi(t, this.name).length > 0) {
|
|
5187
5187
|
this.options.onHasOneBeforeInsert();
|
|
5188
5188
|
return;
|
|
5189
5189
|
}
|
|
5190
|
-
const
|
|
5191
|
-
if (
|
|
5192
|
-
const o = (
|
|
5190
|
+
const i = n.props.state.doc.content.firstChild;
|
|
5191
|
+
if (_i(i)) {
|
|
5192
|
+
const o = (i.firstChild && i.firstChild.nodeSize || 0) + 1;
|
|
5193
5193
|
return e.insertContentAt(o, { type: this.name });
|
|
5194
5194
|
}
|
|
5195
5195
|
return e.insertContent({
|
|
@@ -5197,11 +5197,11 @@ const ga = ge.create({
|
|
|
5197
5197
|
});
|
|
5198
5198
|
},
|
|
5199
5199
|
removeTableOfContents: () => ({ state: e, dispatch: t }) => {
|
|
5200
|
-
const { tr: n } = e,
|
|
5201
|
-
return e.doc.descendants((
|
|
5202
|
-
if (
|
|
5203
|
-
const
|
|
5204
|
-
n.delete(
|
|
5200
|
+
const { tr: n } = e, a = e.schema.nodes.tableOfContents;
|
|
5201
|
+
return e.doc.descendants((i, o) => {
|
|
5202
|
+
if (i.type === a) {
|
|
5203
|
+
const r = o, l = o + i.nodeSize;
|
|
5204
|
+
n.delete(r, l);
|
|
5205
5205
|
}
|
|
5206
5206
|
}), n.docChanged ? (t(n), !0) : !1;
|
|
5207
5207
|
}
|
|
@@ -5220,37 +5220,37 @@ const ga = ge.create({
|
|
|
5220
5220
|
];
|
|
5221
5221
|
}
|
|
5222
5222
|
});
|
|
5223
|
-
function
|
|
5223
|
+
function bi(e) {
|
|
5224
5224
|
var n;
|
|
5225
5225
|
const t = R(() => {
|
|
5226
5226
|
var o;
|
|
5227
|
-
const
|
|
5228
|
-
return
|
|
5229
|
-
...
|
|
5230
|
-
icon:
|
|
5227
|
+
const a = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((r) => r.isActive());
|
|
5228
|
+
return a && !a.default ? {
|
|
5229
|
+
...a,
|
|
5230
|
+
icon: a.icon ? a.icon : e.icon
|
|
5231
5231
|
} : {
|
|
5232
5232
|
title: e == null ? void 0 : e.tooltip,
|
|
5233
5233
|
icon: e.icon,
|
|
5234
5234
|
isActive: () => !1
|
|
5235
5235
|
};
|
|
5236
5236
|
}, [e]);
|
|
5237
|
-
return /* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5237
|
+
return /* @__PURE__ */ m(ce, { modal: !0, children: [
|
|
5238
|
+
/* @__PURE__ */ s(
|
|
5239
5239
|
de,
|
|
5240
5240
|
{
|
|
5241
5241
|
asChild: !0,
|
|
5242
5242
|
disabled: e == null ? void 0 : e.disabled,
|
|
5243
|
-
children: /* @__PURE__ */
|
|
5244
|
-
|
|
5243
|
+
children: /* @__PURE__ */ s(
|
|
5244
|
+
p,
|
|
5245
5245
|
{
|
|
5246
|
-
customClass: "!
|
|
5246
|
+
customClass: "!w-12 h-12",
|
|
5247
5247
|
disabled: e == null ? void 0 : e.disabled,
|
|
5248
5248
|
icon: e == null ? void 0 : e.icon,
|
|
5249
5249
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
5250
|
-
children: /* @__PURE__ */
|
|
5250
|
+
children: /* @__PURE__ */ s(
|
|
5251
5251
|
M,
|
|
5252
5252
|
{
|
|
5253
|
-
className: "
|
|
5253
|
+
className: "ml-1 size-3 text-zinc-500",
|
|
5254
5254
|
name: "MenuDown"
|
|
5255
5255
|
}
|
|
5256
5256
|
)
|
|
@@ -5258,37 +5258,37 @@ function ba(e) {
|
|
|
5258
5258
|
)
|
|
5259
5259
|
}
|
|
5260
5260
|
),
|
|
5261
|
-
/* @__PURE__ */
|
|
5262
|
-
|
|
5261
|
+
/* @__PURE__ */ s(
|
|
5262
|
+
ue,
|
|
5263
5263
|
{
|
|
5264
5264
|
align: "start",
|
|
5265
|
-
className: "
|
|
5265
|
+
className: "flex w-full min-w-4 flex-row gap-1 !p-[4px]",
|
|
5266
5266
|
side: "bottom",
|
|
5267
|
-
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((
|
|
5268
|
-
var o,
|
|
5269
|
-
return /* @__PURE__ */
|
|
5270
|
-
/* @__PURE__ */
|
|
5267
|
+
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, i) => {
|
|
5268
|
+
var o, r;
|
|
5269
|
+
return /* @__PURE__ */ m(we, { children: [
|
|
5270
|
+
/* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ s(
|
|
5271
5271
|
Be,
|
|
5272
5272
|
{
|
|
5273
|
-
className: "
|
|
5274
|
-
"data-state": t.title ===
|
|
5275
|
-
onClick:
|
|
5276
|
-
pressed: t.title ===
|
|
5273
|
+
className: "size-7 p-1",
|
|
5274
|
+
"data-state": t.title === a.title ? "on" : "off",
|
|
5275
|
+
onClick: a == null ? void 0 : a.action,
|
|
5276
|
+
pressed: t.title === a.title,
|
|
5277
5277
|
size: "sm",
|
|
5278
|
-
children: (
|
|
5278
|
+
children: (a == null ? void 0 : a.icon) && /* @__PURE__ */ s(M, { name: a.icon })
|
|
5279
5279
|
}
|
|
5280
5280
|
) }),
|
|
5281
|
-
/* @__PURE__ */
|
|
5282
|
-
/* @__PURE__ */
|
|
5283
|
-
!!((o =
|
|
5281
|
+
/* @__PURE__ */ m(ke, { className: "flex flex-col items-center", children: [
|
|
5282
|
+
/* @__PURE__ */ s("span", { children: a.title }),
|
|
5283
|
+
!!((o = a.shortcutKeys) != null && o.length) && /* @__PURE__ */ s("span", { children: (r = a.shortcutKeys) == null ? void 0 : r.map((l) => je(l)).join(" ") })
|
|
5284
5284
|
] })
|
|
5285
|
-
] }, `text-align-${
|
|
5285
|
+
] }, `text-align-${i}`);
|
|
5286
5286
|
})
|
|
5287
5287
|
}
|
|
5288
5288
|
)
|
|
5289
5289
|
] });
|
|
5290
5290
|
}
|
|
5291
|
-
const
|
|
5291
|
+
const ko = A.create({
|
|
5292
5292
|
name: "text-direction",
|
|
5293
5293
|
addOptions() {
|
|
5294
5294
|
var e;
|
|
@@ -5300,34 +5300,34 @@ const yo = A.create({
|
|
|
5300
5300
|
button({
|
|
5301
5301
|
editor: t,
|
|
5302
5302
|
extension: n,
|
|
5303
|
-
t:
|
|
5303
|
+
t: a
|
|
5304
5304
|
}) {
|
|
5305
|
-
var
|
|
5306
|
-
const
|
|
5305
|
+
var u;
|
|
5306
|
+
const i = ((u = n.options) == null ? void 0 : u.directions) || [], o = {
|
|
5307
5307
|
auto: "TextDirection",
|
|
5308
5308
|
ltr: "LeftToRight",
|
|
5309
5309
|
rtl: "RightToLeft"
|
|
5310
|
-
},
|
|
5311
|
-
title:
|
|
5310
|
+
}, r = i.map((d) => ({
|
|
5311
|
+
title: a(`editor.textDirection.${d}.tooltip`),
|
|
5312
5312
|
icon: o[d],
|
|
5313
5313
|
isActive: () => !1,
|
|
5314
5314
|
action: () => {
|
|
5315
|
-
var
|
|
5315
|
+
var c, h, _, f;
|
|
5316
5316
|
if (d === "auto") {
|
|
5317
|
-
(
|
|
5317
|
+
(h = (c = t.commands) == null ? void 0 : c.unsetTextDirection) == null || h.call(c);
|
|
5318
5318
|
return;
|
|
5319
5319
|
}
|
|
5320
5320
|
(f = (_ = t.commands) == null ? void 0 : _.setTextDirection) == null || f.call(_, d);
|
|
5321
5321
|
},
|
|
5322
5322
|
disabled: !1
|
|
5323
|
-
})),
|
|
5323
|
+
})), l = r.filter((d) => d.disabled).length === r.length;
|
|
5324
5324
|
return {
|
|
5325
|
-
component:
|
|
5325
|
+
component: bi,
|
|
5326
5326
|
componentProps: {
|
|
5327
5327
|
icon: "TextDirection",
|
|
5328
|
-
tooltip:
|
|
5329
|
-
disabled:
|
|
5330
|
-
items:
|
|
5328
|
+
tooltip: a("editor.textDirection.tooltip"),
|
|
5329
|
+
disabled: l,
|
|
5330
|
+
items: r
|
|
5331
5331
|
}
|
|
5332
5332
|
};
|
|
5333
5333
|
}
|
|
@@ -5354,38 +5354,38 @@ const yo = A.create({
|
|
|
5354
5354
|
unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
|
|
5355
5355
|
};
|
|
5356
5356
|
}
|
|
5357
|
-
}),
|
|
5358
|
-
listUsers:
|
|
5359
|
-
itemUser:
|
|
5360
|
-
selectedUser:
|
|
5361
|
-
},
|
|
5362
|
-
const n = G(null), [
|
|
5363
|
-
const
|
|
5364
|
-
|
|
5365
|
-
},
|
|
5366
|
-
|
|
5367
|
-
},
|
|
5368
|
-
|
|
5369
|
-
},
|
|
5370
|
-
o(
|
|
5357
|
+
}), pi = "_listUsers_en3pm_1", wi = "_itemUser_en3pm_10", yi = "_selectedUser_en3pm_31", fe = {
|
|
5358
|
+
listUsers: pi,
|
|
5359
|
+
itemUser: wi,
|
|
5360
|
+
selectedUser: yi
|
|
5361
|
+
}, ki = He((e, t) => {
|
|
5362
|
+
const n = G(null), [a, i] = C(0), o = (d) => {
|
|
5363
|
+
const c = e.items[d];
|
|
5364
|
+
c && e.command({ id: c, label: c });
|
|
5365
|
+
}, r = () => {
|
|
5366
|
+
i((a + e.items.length - 1) % e.items.length);
|
|
5367
|
+
}, l = () => {
|
|
5368
|
+
i((a + 1) % e.items.length);
|
|
5369
|
+
}, u = () => {
|
|
5370
|
+
o(a);
|
|
5371
5371
|
};
|
|
5372
|
-
return z(() =>
|
|
5373
|
-
if (Number.isNaN(
|
|
5372
|
+
return z(() => i(0), [e.items]), z(() => {
|
|
5373
|
+
if (Number.isNaN(a + 1))
|
|
5374
5374
|
return;
|
|
5375
|
-
const d = n.current.querySelector(`span:nth-of-type(${
|
|
5375
|
+
const d = n.current.querySelector(`span:nth-of-type(${a + 1})`);
|
|
5376
5376
|
d && Oe(d, { behavior: "smooth", scrollMode: "if-needed" });
|
|
5377
|
-
}, [
|
|
5378
|
-
onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (
|
|
5379
|
-
})), /* @__PURE__ */
|
|
5377
|
+
}, [a]), ze(t, () => ({
|
|
5378
|
+
onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (r(), !0) : d.key === "ArrowDown" ? (l(), !0) : d.key === "Enter" ? (u(), !0) : !1
|
|
5379
|
+
})), /* @__PURE__ */ s("div", { className: P("listUsers", fe.listUsers), children: /* @__PURE__ */ s("div", { ref: n, children: e.items.length > 0 ? e.items.map((d, c) => /* @__PURE__ */ s(
|
|
5380
5380
|
"span",
|
|
5381
5381
|
{
|
|
5382
|
-
className: P("itemUser", fe.itemUser,
|
|
5383
|
-
onClick: () => o(
|
|
5382
|
+
className: P("itemUser", fe.itemUser, c === a ? fe.selectedUser : ""),
|
|
5383
|
+
onClick: () => o(c),
|
|
5384
5384
|
children: d
|
|
5385
5385
|
},
|
|
5386
|
-
|
|
5387
|
-
)) : /* @__PURE__ */
|
|
5388
|
-
}),
|
|
5386
|
+
c
|
|
5387
|
+
)) : /* @__PURE__ */ s("div", { className: P("itemUserEmpty", fe.itemUser), children: "Empty" }) }) });
|
|
5388
|
+
}), vi = [
|
|
5389
5389
|
{
|
|
5390
5390
|
id: "1",
|
|
5391
5391
|
name: "John Doe"
|
|
@@ -5402,13 +5402,13 @@ const yo = A.create({
|
|
|
5402
5402
|
id: "4",
|
|
5403
5403
|
name: "Bob"
|
|
5404
5404
|
}
|
|
5405
|
-
],
|
|
5406
|
-
items: async ({ query: e }) =>
|
|
5405
|
+
], xi = {
|
|
5406
|
+
items: async ({ query: e }) => vi.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
|
|
5407
5407
|
render: () => {
|
|
5408
5408
|
let e, t;
|
|
5409
5409
|
return {
|
|
5410
5410
|
onStart: (n) => {
|
|
5411
|
-
e = new Te(
|
|
5411
|
+
e = new Te(ki, {
|
|
5412
5412
|
props: n,
|
|
5413
5413
|
editor: n.editor
|
|
5414
5414
|
}), t = De("body", {
|
|
@@ -5427,15 +5427,15 @@ const yo = A.create({
|
|
|
5427
5427
|
});
|
|
5428
5428
|
},
|
|
5429
5429
|
onKeyDown(n) {
|
|
5430
|
-
var
|
|
5431
|
-
return n.event.key === "Escape" ? (t[0].hide(), !0) : (
|
|
5430
|
+
var a;
|
|
5431
|
+
return n.event.key === "Escape" ? (t[0].hide(), !0) : (a = e.ref) == null ? void 0 : a.onKeyDown(n);
|
|
5432
5432
|
},
|
|
5433
5433
|
onExit() {
|
|
5434
5434
|
t[0].destroy(), e.destroy();
|
|
5435
5435
|
}
|
|
5436
5436
|
};
|
|
5437
5437
|
}
|
|
5438
|
-
},
|
|
5438
|
+
}, vo = Wt.extend({
|
|
5439
5439
|
addAttributes() {
|
|
5440
5440
|
return {
|
|
5441
5441
|
id: {
|
|
@@ -5452,8 +5452,8 @@ const yo = A.create({
|
|
|
5452
5452
|
HTMLAttributes: {
|
|
5453
5453
|
class: "mention"
|
|
5454
5454
|
},
|
|
5455
|
-
suggestion:
|
|
5456
|
-
}),
|
|
5455
|
+
suggestion: xi
|
|
5456
|
+
}), Ci = {
|
|
5457
5457
|
audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
|
|
5458
5458
|
video: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',
|
|
5459
5459
|
file: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',
|
|
@@ -5481,45 +5481,45 @@ const yo = A.create({
|
|
|
5481
5481
|
excel: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',
|
|
5482
5482
|
ppt: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'
|
|
5483
5483
|
};
|
|
5484
|
-
function
|
|
5485
|
-
const t =
|
|
5484
|
+
function Ni(e) {
|
|
5485
|
+
const t = Ci[e], i = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
|
|
5486
5486
|
"svg",
|
|
5487
5487
|
{
|
|
5488
|
-
...Array.from(
|
|
5488
|
+
...Array.from(i.attributes).reduce((r, l) => (r[l.name] = l.value, r), {})
|
|
5489
5489
|
}
|
|
5490
5490
|
];
|
|
5491
|
-
return Array.from(
|
|
5492
|
-
if (
|
|
5493
|
-
const
|
|
5494
|
-
|
|
5495
|
-
Array.from(
|
|
5491
|
+
return Array.from(i.childNodes).forEach((r) => {
|
|
5492
|
+
if (r.nodeType === 1) {
|
|
5493
|
+
const l = [
|
|
5494
|
+
r.tagName.toLowerCase(),
|
|
5495
|
+
Array.from(r.attributes).reduce((u, d) => (u[d.name] = d.value, u), {})
|
|
5496
5496
|
];
|
|
5497
|
-
|
|
5497
|
+
r.textContent && l.push(r.textContent), o.push(l);
|
|
5498
5498
|
}
|
|
5499
5499
|
}), o;
|
|
5500
5500
|
}
|
|
5501
|
-
const
|
|
5502
|
-
audio: /* @__PURE__ */
|
|
5503
|
-
video: /* @__PURE__ */
|
|
5504
|
-
file: /* @__PURE__ */
|
|
5505
|
-
image: /* @__PURE__ */
|
|
5506
|
-
pdf: /* @__PURE__ */
|
|
5507
|
-
word: /* @__PURE__ */
|
|
5508
|
-
excel: /* @__PURE__ */
|
|
5509
|
-
ppt: /* @__PURE__ */
|
|
5501
|
+
const Ai = {
|
|
5502
|
+
audio: /* @__PURE__ */ s(un, {}),
|
|
5503
|
+
video: /* @__PURE__ */ s(dn, {}),
|
|
5504
|
+
file: /* @__PURE__ */ s(cn, {}),
|
|
5505
|
+
image: /* @__PURE__ */ s(ln, {}),
|
|
5506
|
+
pdf: /* @__PURE__ */ s(Tn, {}),
|
|
5507
|
+
word: /* @__PURE__ */ s(Sn, {}),
|
|
5508
|
+
excel: /* @__PURE__ */ s(rn, {}),
|
|
5509
|
+
ppt: /* @__PURE__ */ s(sn, {})
|
|
5510
5510
|
};
|
|
5511
|
-
function
|
|
5512
|
-
const n = Ln(e),
|
|
5513
|
-
return t ?
|
|
5511
|
+
function ht(e, t = !1) {
|
|
5512
|
+
const n = Ln(e), a = Ai[n] || /* @__PURE__ */ s(pe, {});
|
|
5513
|
+
return t ? Ni(n) : a;
|
|
5514
5514
|
}
|
|
5515
|
-
const
|
|
5516
|
-
wrap:
|
|
5515
|
+
const Li = "_wrap_1x1ms_2", Ne = {
|
|
5516
|
+
wrap: Li
|
|
5517
5517
|
};
|
|
5518
|
-
function
|
|
5518
|
+
function Si({ editor: e, node: t, updateAttributes: n, deleteNode: a, extension: i }) {
|
|
5519
5519
|
var H;
|
|
5520
|
-
const o = G(null),
|
|
5521
|
-
!
|
|
5522
|
-
}, [
|
|
5520
|
+
const o = G(null), r = Ie(), { hasTrigger: l, fileName: u, fileSize: d, fileExt: c, fileType: h, url: _, error: f } = t.attrs, [w, y] = C(!1), { t: L } = j(), E = (H = i == null ? void 0 : i.options) == null ? void 0 : H.upload, g = F(() => {
|
|
5521
|
+
!r || _ || r && o.current.click();
|
|
5522
|
+
}, [r, _]), b = F(
|
|
5523
5523
|
async (S) => {
|
|
5524
5524
|
const O = S.target.files && S.target.files[0];
|
|
5525
5525
|
if (!O)
|
|
@@ -5530,30 +5530,30 @@ function Sa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
|
|
|
5530
5530
|
fileType: O.type,
|
|
5531
5531
|
fileExt: En(O.name)
|
|
5532
5532
|
};
|
|
5533
|
-
|
|
5533
|
+
y(!0);
|
|
5534
5534
|
try {
|
|
5535
|
-
const
|
|
5536
|
-
n({ ..._t, url:
|
|
5537
|
-
} catch (
|
|
5538
|
-
n({ error: `File upload fail: ${
|
|
5535
|
+
const me = await E(O);
|
|
5536
|
+
n({ ..._t, url: me }), y(!1);
|
|
5537
|
+
} catch (me) {
|
|
5538
|
+
n({ error: `File upload fail: ${me && me.message}` || "Unknown error" }), y(!1), o.current.value = "";
|
|
5539
5539
|
}
|
|
5540
5540
|
},
|
|
5541
|
-
[
|
|
5541
|
+
[y, n]
|
|
5542
5542
|
);
|
|
5543
5543
|
z(() => {
|
|
5544
|
-
!_ && !
|
|
5545
|
-
}, [_,
|
|
5546
|
-
const
|
|
5547
|
-
return
|
|
5548
|
-
/* @__PURE__ */
|
|
5544
|
+
!_ && !l && (g(), n({ hasTrigger: !0 }));
|
|
5545
|
+
}, [_, l, g, n]);
|
|
5546
|
+
const v = F(() => a(), [e]);
|
|
5547
|
+
return r && !_ ? /* @__PURE__ */ s(se, { children: /* @__PURE__ */ m("div", { className: P(Ne.wrap, "render-wrapper"), children: [
|
|
5548
|
+
/* @__PURE__ */ s(
|
|
5549
5549
|
"p",
|
|
5550
5550
|
{
|
|
5551
5551
|
onClick: g,
|
|
5552
5552
|
style: { cursor: "pointer" },
|
|
5553
|
-
children:
|
|
5553
|
+
children: w ? /* @__PURE__ */ s("span", { children: L("editor.attachment.uploading") }) : /* @__PURE__ */ s("span", { children: L("editor.attachment.please_upload") })
|
|
5554
5554
|
}
|
|
5555
5555
|
),
|
|
5556
|
-
/* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ s(
|
|
5557
5557
|
"input",
|
|
5558
5558
|
{
|
|
5559
5559
|
hidden: !0,
|
|
@@ -5562,45 +5562,45 @@ function Sa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
|
|
|
5562
5562
|
type: "file"
|
|
5563
5563
|
}
|
|
5564
5564
|
)
|
|
5565
|
-
] }) }) : _ ? /* @__PURE__ */
|
|
5565
|
+
] }) }) : _ ? /* @__PURE__ */ s(se, { children: /* @__PURE__ */ m(
|
|
5566
5566
|
"div",
|
|
5567
5567
|
{
|
|
5568
5568
|
className: P(Ne.wrap, "render-wrapper"),
|
|
5569
5569
|
onClick: g,
|
|
5570
5570
|
children: [
|
|
5571
|
-
/* @__PURE__ */
|
|
5572
|
-
/* @__PURE__ */
|
|
5573
|
-
/* @__PURE__ */
|
|
5574
|
-
|
|
5571
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-[4px]", children: [
|
|
5572
|
+
/* @__PURE__ */ s("span", { children: ht(h) }),
|
|
5573
|
+
/* @__PURE__ */ m("span", { children: [
|
|
5574
|
+
u,
|
|
5575
5575
|
".",
|
|
5576
|
-
|
|
5576
|
+
c
|
|
5577
5577
|
] }),
|
|
5578
|
-
/* @__PURE__ */
|
|
5578
|
+
/* @__PURE__ */ m("span", { children: [
|
|
5579
5579
|
"(",
|
|
5580
5580
|
tt(d),
|
|
5581
5581
|
")"
|
|
5582
5582
|
] })
|
|
5583
5583
|
] }),
|
|
5584
|
-
/* @__PURE__ */
|
|
5585
|
-
|
|
5584
|
+
/* @__PURE__ */ s(
|
|
5585
|
+
p,
|
|
5586
5586
|
{
|
|
5587
|
-
action:
|
|
5587
|
+
action: v,
|
|
5588
5588
|
icon: "Trash2",
|
|
5589
5589
|
tooltip: L("editor.delete")
|
|
5590
5590
|
}
|
|
5591
5591
|
)
|
|
5592
5592
|
]
|
|
5593
5593
|
}
|
|
5594
|
-
) }) : f !== "null" ? /* @__PURE__ */
|
|
5594
|
+
) }) : f !== "null" ? /* @__PURE__ */ s(se, { children: /* @__PURE__ */ s(
|
|
5595
5595
|
"div",
|
|
5596
5596
|
{
|
|
5597
5597
|
className: P(Ne.wrap, "render-wrapper"),
|
|
5598
5598
|
onClick: g,
|
|
5599
|
-
children: /* @__PURE__ */
|
|
5599
|
+
children: /* @__PURE__ */ s("p", { children: f })
|
|
5600
5600
|
}
|
|
5601
|
-
) }) : /* @__PURE__ */
|
|
5601
|
+
) }) : /* @__PURE__ */ s(pe, {});
|
|
5602
5602
|
}
|
|
5603
|
-
const
|
|
5603
|
+
const xo = ge.create({
|
|
5604
5604
|
name: "attachment",
|
|
5605
5605
|
content: "",
|
|
5606
5606
|
marks: "",
|
|
@@ -5616,7 +5616,7 @@ const vo = ge.create({
|
|
|
5616
5616
|
class: "attachment"
|
|
5617
5617
|
},
|
|
5618
5618
|
button: ({ editor: t, t: n }) => ({
|
|
5619
|
-
component:
|
|
5619
|
+
component: p,
|
|
5620
5620
|
componentProps: {
|
|
5621
5621
|
action: () => t.chain().focus().setAttachment().run(),
|
|
5622
5622
|
isActive: () => !1,
|
|
@@ -5634,8 +5634,8 @@ const vo = ge.create({
|
|
|
5634
5634
|
const {
|
|
5635
5635
|
url: t = "",
|
|
5636
5636
|
fileName: n = "",
|
|
5637
|
-
fileSize:
|
|
5638
|
-
fileType:
|
|
5637
|
+
fileSize: a = "",
|
|
5638
|
+
fileType: i = "",
|
|
5639
5639
|
fileExt: o = ""
|
|
5640
5640
|
} = e || {};
|
|
5641
5641
|
return [
|
|
@@ -5651,12 +5651,12 @@ const vo = ge.create({
|
|
|
5651
5651
|
[
|
|
5652
5652
|
"span",
|
|
5653
5653
|
{ class: "attachment__icon" },
|
|
5654
|
-
|
|
5654
|
+
ht(i, !0)
|
|
5655
5655
|
],
|
|
5656
5656
|
[
|
|
5657
5657
|
"span",
|
|
5658
5658
|
{ class: "attachment__text" },
|
|
5659
|
-
`${n}.${o} (${tt(
|
|
5659
|
+
`${n}.${o} (${tt(a)})`
|
|
5660
5660
|
]
|
|
5661
5661
|
] : ["div", { class: "attachment__placeholder" }]
|
|
5662
5662
|
];
|
|
@@ -5699,57 +5699,57 @@ const vo = ge.create({
|
|
|
5699
5699
|
};
|
|
5700
5700
|
},
|
|
5701
5701
|
addNodeView() {
|
|
5702
|
-
return Se(
|
|
5702
|
+
return Se(Si);
|
|
5703
5703
|
}
|
|
5704
5704
|
});
|
|
5705
5705
|
export {
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5706
|
+
xo as Attachment,
|
|
5707
|
+
co as BaseKit,
|
|
5708
|
+
io as Blockquote,
|
|
5709
|
+
Ui as Bold,
|
|
5710
5710
|
eo as BulletList,
|
|
5711
5711
|
to as Clear,
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5712
|
+
Wi as Code,
|
|
5713
|
+
ra as CodeBlock,
|
|
5714
|
+
Qi as Color,
|
|
5715
|
+
pn as Column,
|
|
5716
|
+
lo as ColumnActionButton,
|
|
5717
5717
|
Ao as Drawer,
|
|
5718
5718
|
bo as Emoji,
|
|
5719
5719
|
Lo as Excalidraw,
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5720
|
+
po as ExportPdf,
|
|
5721
|
+
yo as ExportWord,
|
|
5722
|
+
Gi as FontFamily,
|
|
5723
|
+
Yi as FontSize,
|
|
5724
5724
|
go as FormatPainter,
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5725
|
+
Zi as Heading,
|
|
5726
|
+
Xi as Highlight,
|
|
5727
|
+
ro as History,
|
|
5728
|
+
so as HorizontalRule,
|
|
5729
5729
|
So as Iframe,
|
|
5730
|
-
|
|
5730
|
+
kn as Image,
|
|
5731
5731
|
To as ImageGif,
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5732
|
+
wo as ImportWord,
|
|
5733
|
+
ho as Indent,
|
|
5734
|
+
qi as Italic,
|
|
5735
5735
|
Eo as Katex,
|
|
5736
5736
|
_o as LineHeight,
|
|
5737
5737
|
oo as Link,
|
|
5738
|
-
|
|
5738
|
+
vo as Mention,
|
|
5739
5739
|
Ho as Mermaid,
|
|
5740
|
-
|
|
5741
|
-
|
|
5740
|
+
mo as MoreMark,
|
|
5741
|
+
wn as MultiColumn,
|
|
5742
5742
|
no as OrderedList,
|
|
5743
|
-
|
|
5743
|
+
ja as SearchAndReplace,
|
|
5744
5744
|
fo as SlashCommand,
|
|
5745
|
-
|
|
5746
|
-
|
|
5745
|
+
Vi as Strike,
|
|
5746
|
+
uo as SubAndSuperScript,
|
|
5747
5747
|
zo as Table,
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5748
|
+
gi as TableOfContents,
|
|
5749
|
+
ao as TaskList,
|
|
5750
|
+
Ji as TextAlign,
|
|
5751
|
+
ko as TextDirection,
|
|
5752
5752
|
Mo as Twitter,
|
|
5753
|
-
|
|
5754
|
-
|
|
5753
|
+
Ki as Underline,
|
|
5754
|
+
xn as Video
|
|
5755
5755
|
};
|