reactjs-tiptap-editor-pro 0.2.25 → 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 +73 -73
- package/lib/extension-bundle.d.ts +73 -73
- package/lib/extension-bundle.js +1389 -1565
- package/lib/{index-D-rys8BA.cjs → index-DV-nXpU1.cjs} +1 -1
- package/lib/{index-PJxla8pp.js → index-M6H3FoBi.js} +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +73 -73
- package/lib/index.d.ts +73 -73
- package/lib/index.js +2 -2
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +73 -73
- package/lib/locale-bundle.d.ts +73 -73
- package/lib/locale-bundle.js +1 -1
- package/lib/style.css +1 -1
- package/lib/{tiptap-Kst3Ray3.js → tiptap-DkWHMWDt.js} +57 -93
- package/lib/{tiptap-Bzsbnr3f.cjs → tiptap-gBG-1T-V.cjs} +11 -11
- package/lib/{vendor-LvbrNFNL.cjs → vendor-BJ0Yf78E.cjs} +4 -4
- package/lib/{vendor-tDefVoN_.js → vendor-Cpa6z-M0.js} +8 -7
- package/package.json +1 -1
- package/lib/RichTextEditor-Bxdp3pW3.js +0 -8292
- package/lib/RichTextEditor-zOI60NFQ.cjs +0 -141
package/lib/extension-bundle.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { P as te, b as Z, $ as
|
|
3
|
-
import { jsxs as m, jsx 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
|
-
import
|
|
6
|
-
import { ChevronDown as
|
|
7
|
-
import { i as
|
|
8
|
-
import {
|
|
9
|
-
import { M as
|
|
10
|
-
import { bundledThemes as
|
|
11
|
-
import * as
|
|
12
|
-
import { Slot as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
5
|
+
import Qt, { useMemo as R, useState as C, useRef as G, useCallback as F, Fragment as Ee, forwardRef as He, useImperativeHandle as ze, useEffect as z } from "react";
|
|
6
|
+
import { ChevronDown as Me, Check as Xt, ChevronUp as en, Copy as tn, CopyCheck as nn, SearchIcon as an, LoaderIcon as on, LucideTableProperties as 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
|
+
import { Slot as jn } from "@radix-ui/react-slot";
|
|
13
|
+
import De from "tippy.js";
|
|
14
|
+
import Oe from "scroll-into-view-if-needed";
|
|
15
15
|
import { EmojiPicker as W } from "frimousse";
|
|
16
|
-
import { Packer as
|
|
17
|
-
import { DocxSerializer as
|
|
18
|
-
const
|
|
16
|
+
import { Packer as Bn, WidthType as Dn } from "docx";
|
|
17
|
+
import { DocxSerializer as On, defaultNodes as U, defaultMarks as $n } from "prosemirror-docx";
|
|
18
|
+
const $e = Qt.forwardRef(
|
|
19
19
|
({ asChild: e, ...t }, n) => {
|
|
20
20
|
var o;
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */ m(
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
e ?
|
|
21
|
+
const a = Pe[t.icon];
|
|
22
|
+
return /* @__PURE__ */ m(we, { children: [
|
|
23
|
+
/* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ s(
|
|
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__ */ m("div", { className: "
|
|
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 qe = dn.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 qe = dn.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 qe = dn.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 qe = dn.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 qe = dn.forwardRef(
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
-
let I,
|
|
139
|
-
const
|
|
140
|
-
function
|
|
138
|
+
let I, ae;
|
|
139
|
+
const xe = /* @__PURE__ */ new Set(), Ce = /* @__PURE__ */ new Set();
|
|
140
|
+
function Fn() {
|
|
141
141
|
return I;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
if (!I && !
|
|
143
|
+
function Un(e) {
|
|
144
|
+
if (!I && !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
|
|
154
|
+
if (ae)
|
|
155
|
+
return ae;
|
|
156
156
|
}
|
|
157
|
-
async function
|
|
158
|
-
return I && !I.getLoadedThemes().includes(e) && !
|
|
157
|
+
async function st(e) {
|
|
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
159
|
}
|
|
160
|
-
async function
|
|
161
|
-
return I && !I.getLoadedLanguages().includes(e) && !
|
|
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
|
-
async function
|
|
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
|
|
177
|
+
...o.flatMap((l) => st(l)),
|
|
178
|
+
...r.flatMap((l) => !!l && rt(l))
|
|
179
|
+
]) : await Un({ languages: r, themes: o });
|
|
180
180
|
}
|
|
181
|
-
function
|
|
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
|
|
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
|
-
for (const
|
|
199
|
-
for (const w of
|
|
200
|
-
const
|
|
198
|
+
for (const f of _) {
|
|
199
|
+
for (const w of f) {
|
|
200
|
+
const y = l + w.content.length, L = le.inline(l, y, {
|
|
201
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
|
-
function
|
|
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,259 +225,259 @@ function ni({
|
|
|
225
225
|
}
|
|
226
226
|
// Initialize shiki async, and then highlight initial document
|
|
227
227
|
async initDecorations() {
|
|
228
|
-
const
|
|
229
|
-
await
|
|
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
|
-
|
|
263
|
-
(
|
|
264
|
-
),
|
|
265
|
-
|
|
266
|
-
(
|
|
267
|
-
),
|
|
268
|
-
return
|
|
269
|
-
doc:
|
|
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
|
+
(f) => f.type.name === e
|
|
264
|
+
), h = oe(
|
|
265
|
+
l.doc,
|
|
266
|
+
(f) => f.type.name === e
|
|
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
|
-
function
|
|
286
|
-
const
|
|
285
|
+
function Vn({ action: e, languages: t, ...n }) {
|
|
286
|
+
const a = (o) => {
|
|
287
287
|
e(o);
|
|
288
|
-
},
|
|
289
|
-
title:
|
|
288
|
+
}, i = R(() => t == null ? void 0 : t.map((o) => ({
|
|
289
|
+
title: zn[o] || o,
|
|
290
290
|
// icon: language.icon,
|
|
291
291
|
language: o
|
|
292
292
|
})), [t]);
|
|
293
|
-
return /* @__PURE__ */ m(
|
|
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
|
|
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:
|
|
309
|
-
className:
|
|
310
|
-
"
|
|
308
|
+
ref: a,
|
|
309
|
+
className: T(
|
|
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
|
-
className:
|
|
326
|
-
"
|
|
325
|
+
className: T(
|
|
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
|
|
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
|
-
className:
|
|
339
|
-
"
|
|
338
|
+
className: T(
|
|
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
|
-
|
|
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:
|
|
351
|
-
className:
|
|
352
|
-
"
|
|
353
|
-
n === "popper" && "data-[side=bottom]:
|
|
350
|
+
ref: i,
|
|
351
|
+
className: T(
|
|
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
|
-
className:
|
|
364
|
-
"
|
|
365
|
-
n === "popper" && "
|
|
363
|
+
className: T(
|
|
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
|
|
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:
|
|
379
|
+
className: T("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
380
380
|
...t
|
|
381
381
|
}
|
|
382
382
|
));
|
|
383
|
-
|
|
384
|
-
const
|
|
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:
|
|
388
|
-
className:
|
|
389
|
-
"
|
|
387
|
+
ref: a,
|
|
388
|
+
className: T(
|
|
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
|
-
|
|
400
|
-
const
|
|
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:
|
|
404
|
+
className: T("-mx-1 my-1 h-px bg-muted", e),
|
|
405
405
|
...t
|
|
406
406
|
}
|
|
407
407
|
));
|
|
408
|
-
|
|
409
|
-
function
|
|
410
|
-
const [e, t] =
|
|
411
|
-
return { isCopied: e, copyToClipboard: async (
|
|
408
|
+
Jn.displayName = x.Separator.displayName;
|
|
409
|
+
function Yn() {
|
|
410
|
+
const [e, t] = C(!1);
|
|
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
|
|
420
|
-
wrap:
|
|
421
|
-
maxHeight:
|
|
422
|
-
btnCopy:
|
|
423
|
-
btnDelete:
|
|
424
|
-
blockInfo:
|
|
425
|
-
blockInfoEditable:
|
|
426
|
-
selectLang:
|
|
427
|
-
copied:
|
|
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
|
+
wrap: Qn,
|
|
421
|
+
maxHeight: Xn,
|
|
422
|
+
btnCopy: ea,
|
|
423
|
+
btnDelete: ta,
|
|
424
|
+
blockInfo: na,
|
|
425
|
+
blockInfoEditable: aa,
|
|
426
|
+
selectLang: ia,
|
|
427
|
+
copied: oa
|
|
428
428
|
};
|
|
429
|
-
function
|
|
430
|
-
var
|
|
431
|
-
const { isCopied:
|
|
429
|
+
function sa({ editor: e, node: { attrs: t }, updateAttributes: n, extension: a }) {
|
|
430
|
+
var _, f;
|
|
431
|
+
const { isCopied: i, copyToClipboard: o } = Yn(), r = R(() => {
|
|
432
432
|
var w;
|
|
433
|
-
return (w =
|
|
434
|
-
}, [
|
|
435
|
-
return /* @__PURE__ */ m(
|
|
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
436
|
/* @__PURE__ */ m(
|
|
437
437
|
"div",
|
|
438
438
|
{
|
|
439
|
-
className:
|
|
440
|
-
[$.blockInfoEditable]: !
|
|
439
|
+
className: P($.blockInfo, {
|
|
440
|
+
[$.blockInfoEditable]: !l
|
|
441
441
|
}),
|
|
442
442
|
children: [
|
|
443
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ s(
|
|
444
444
|
"span",
|
|
445
445
|
{
|
|
446
|
-
className:
|
|
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__ */
|
|
457
|
-
|
|
455
|
+
onClick: h,
|
|
456
|
+
children: /* @__PURE__ */ s(
|
|
457
|
+
M,
|
|
458
458
|
{
|
|
459
459
|
name: "Trash2"
|
|
460
460
|
}
|
|
461
461
|
)
|
|
462
462
|
}
|
|
463
463
|
),
|
|
464
|
-
/* @__PURE__ */
|
|
465
|
-
|
|
464
|
+
/* @__PURE__ */ s("div", { className: $.selectLang, children: /* @__PURE__ */ m(
|
|
465
|
+
Wn,
|
|
466
466
|
{
|
|
467
467
|
defaultValue: d || "auto",
|
|
468
|
-
disabled: !
|
|
468
|
+
disabled: !l,
|
|
469
469
|
onValueChange: (w) => n({ language: w }),
|
|
470
470
|
children: [
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */ m(
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
|
|
475
|
-
|
|
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
|
+
Le,
|
|
476
476
|
{
|
|
477
477
|
value: w,
|
|
478
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,42 +486,42 @@ function bi({ 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
|
-
component:
|
|
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
|
|
518
|
+
return Se(sa);
|
|
519
519
|
},
|
|
520
520
|
addProseMirrorPlugins() {
|
|
521
521
|
var e;
|
|
522
522
|
return [
|
|
523
523
|
...((e = this.parent) == null ? void 0 : e.call(this)) || [],
|
|
524
|
-
|
|
524
|
+
Kn({
|
|
525
525
|
name: this.name,
|
|
526
526
|
defaultLanguage: null,
|
|
527
527
|
defaultTheme: this.options.defaultTheme
|
|
@@ -529,13 +529,13 @@ const xi = Tt.extend({
|
|
|
529
529
|
];
|
|
530
530
|
}
|
|
531
531
|
});
|
|
532
|
-
function
|
|
533
|
-
var
|
|
534
|
-
const { t, lang: n } =
|
|
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 wi(e) {
|
|
|
544
544
|
action: () => e.editor.chain().focus().unsetFontFamily().run()
|
|
545
545
|
};
|
|
546
546
|
}, [t, n, e]);
|
|
547
|
-
return /* @__PURE__ */ m(
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
|
|
547
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
548
|
+
/* @__PURE__ */ s(
|
|
549
|
+
Q,
|
|
550
550
|
{
|
|
551
551
|
asChild: !0,
|
|
552
552
|
disabled: e == null ? void 0 : e.disabled,
|
|
553
|
-
children: /* @__PURE__ */
|
|
554
|
-
|
|
553
|
+
children: /* @__PURE__ */ s(
|
|
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__ */ m(
|
|
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
|
-
fontFamilyList:
|
|
593
|
-
button({ editor: t, extension: n, t:
|
|
592
|
+
fontFamilyList: Mn,
|
|
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,27 +624,27 @@ const fo = Lt.extend({
|
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
626
|
});
|
|
627
|
-
function
|
|
627
|
+
function ca(e) {
|
|
628
628
|
var n;
|
|
629
|
-
const t =
|
|
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__ */ m(
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
|
|
640
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
641
|
+
/* @__PURE__ */ s(
|
|
642
|
+
Q,
|
|
643
643
|
{
|
|
644
644
|
asChild: !0,
|
|
645
645
|
disabled: e == null ? void 0 : e.disabled,
|
|
646
|
-
children: /* @__PURE__ */
|
|
647
|
-
|
|
646
|
+
children: /* @__PURE__ */ s(
|
|
647
|
+
$e,
|
|
648
648
|
{
|
|
649
649
|
disabled: e == null ? void 0 : e.disabled,
|
|
650
650
|
icon: "MenuDown",
|
|
@@ -654,58 +654,58 @@ function pi(e) {
|
|
|
654
654
|
)
|
|
655
655
|
}
|
|
656
656
|
),
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
var o,
|
|
659
|
-
return /* @__PURE__ */ m(
|
|
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
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 _o = St.extend({
|
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
|
-
function
|
|
716
|
+
function da(e) {
|
|
717
717
|
var n;
|
|
718
|
-
const t =
|
|
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__ */ m(
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
|
|
730
|
+
return /* @__PURE__ */ m(ce, { modal: !0, children: [
|
|
731
|
+
/* @__PURE__ */ s(
|
|
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__ */
|
|
744
|
-
|
|
743
|
+
children: /* @__PURE__ */ s(
|
|
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 yi(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__ */ m(
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
|
|
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
|
+
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__ */ m(
|
|
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,63 +790,63 @@ const go = Et.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 w,
|
|
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: !((
|
|
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
|
|
835
|
-
const { t } =
|
|
836
|
-
const
|
|
837
|
-
return
|
|
833
|
+
function ua(e) {
|
|
834
|
+
var a;
|
|
835
|
+
const { t } = j(), n = R(() => {
|
|
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__ */ m(
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
|
|
842
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
843
|
+
/* @__PURE__ */ s(
|
|
844
|
+
Q,
|
|
845
845
|
{
|
|
846
846
|
asChild: !0,
|
|
847
847
|
disabled: e == null ? void 0 : e.disabled,
|
|
848
|
-
children: /* @__PURE__ */
|
|
849
|
-
|
|
848
|
+
children: /* @__PURE__ */ s(
|
|
849
|
+
$e,
|
|
850
850
|
{
|
|
851
851
|
disabled: e == null ? void 0 : e.disabled,
|
|
852
852
|
icon: "MenuDown",
|
|
@@ -856,32 +856,32 @@ function ki(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;
|
|
874
874
|
return {
|
|
875
875
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
876
876
|
types: ["textStyle"],
|
|
877
|
-
fontSizes: [...
|
|
878
|
-
button({ editor: t, extension: n, t:
|
|
879
|
-
var
|
|
880
|
-
const
|
|
881
|
-
title: d.value === o.value ?
|
|
877
|
+
fontSizes: [...Pn],
|
|
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 bo = N.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 bo = N.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 vi({ fill: e }) {
|
|
|
939
939
|
viewBox: "0 0 240 240",
|
|
940
940
|
version: "1.1",
|
|
941
941
|
xmlns: "http://www.w3.org/2000/svg",
|
|
942
|
-
children: /* @__PURE__ */
|
|
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 vi({ 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 vi({ 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 vi({ fill: e }) {
|
|
|
971
971
|
}
|
|
972
972
|
);
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
const [t, n] =
|
|
976
|
-
function
|
|
977
|
-
var
|
|
978
|
-
(
|
|
974
|
+
function ha(e) {
|
|
975
|
+
const [t, n] = C(void 0);
|
|
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
|
-
|
|
986
|
-
n(
|
|
985
|
+
Gt((r) => {
|
|
986
|
+
n(r);
|
|
987
987
|
}, 350),
|
|
988
988
|
[]
|
|
989
989
|
);
|
|
990
|
-
return /* @__PURE__ */ m("div", { className: "
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
|
|
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
|
+
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,17 +1029,17 @@ const xo = Ht.extend({
|
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
|
-
}),
|
|
1032
|
+
}), Xi = At.extend({
|
|
1033
1033
|
addOptions() {
|
|
1034
1034
|
var e;
|
|
1035
1035
|
return {
|
|
1036
1036
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1037
1037
|
multicolor: !0,
|
|
1038
1038
|
button: ({ editor: t, t: n }) => ({
|
|
1039
|
-
component:
|
|
1039
|
+
component: gn,
|
|
1040
1040
|
componentProps: {
|
|
1041
|
-
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,
|
|
@@ -1050,13 +1050,13 @@ const xo = Ht.extend({
|
|
|
1050
1050
|
})
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
|
-
}),
|
|
1053
|
+
}), eo = Lt.extend({
|
|
1054
1054
|
addOptions() {
|
|
1055
1055
|
var e;
|
|
1056
1056
|
return {
|
|
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,
|
|
@@ -1068,14 +1068,14 @@ const xo = Ht.extend({
|
|
|
1068
1068
|
})
|
|
1069
1069
|
};
|
|
1070
1070
|
}
|
|
1071
|
-
}),
|
|
1071
|
+
}), to = ge.create({
|
|
1072
1072
|
name: "clear",
|
|
1073
1073
|
addOptions() {
|
|
1074
1074
|
var e;
|
|
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(),
|
|
@@ -1085,13 +1085,13 @@ const xo = Ht.extend({
|
|
|
1085
1085
|
})
|
|
1086
1086
|
};
|
|
1087
1087
|
}
|
|
1088
|
-
}),
|
|
1088
|
+
}), no = St.extend({
|
|
1089
1089
|
addOptions() {
|
|
1090
1090
|
var e;
|
|
1091
1091
|
return {
|
|
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 xo = Ht.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 xo = Ht.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,
|
|
@@ -1130,9 +1130,9 @@ const xo = Ht.extend({
|
|
|
1130
1130
|
};
|
|
1131
1131
|
},
|
|
1132
1132
|
addExtensions() {
|
|
1133
|
-
return [
|
|
1133
|
+
return [Et.configure(this.options.taskItem)];
|
|
1134
1134
|
}
|
|
1135
|
-
}),
|
|
1135
|
+
}), io = Ht.extend({
|
|
1136
1136
|
addOptions() {
|
|
1137
1137
|
var e;
|
|
1138
1138
|
return {
|
|
@@ -1141,7 +1141,7 @@ const xo = Ht.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,25 +1154,25 @@ const xo = Ht.extend({
|
|
|
1154
1154
|
};
|
|
1155
1155
|
}
|
|
1156
1156
|
});
|
|
1157
|
-
function
|
|
1158
|
-
const [t, n] =
|
|
1159
|
-
function i
|
|
1160
|
-
e.action && (e.action({ link:
|
|
1157
|
+
function _a(e) {
|
|
1158
|
+
const [t, n] = C(!1);
|
|
1159
|
+
function a(i, o, r) {
|
|
1160
|
+
e.action && (e.action({ link: i, text: o, openInNewTab: r }), n(!1));
|
|
1161
1161
|
}
|
|
1162
|
-
return /* @__PURE__ */ m(
|
|
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
|
-
const
|
|
1175
|
+
const oo = zt.extend({
|
|
1176
1176
|
inclusive: !1,
|
|
1177
1177
|
parseHTML() {
|
|
1178
1178
|
return [
|
|
@@ -1184,7 +1184,7 @@ const No = jt.extend({
|
|
|
1184
1184
|
renderHTML({ HTMLAttributes: e }) {
|
|
1185
1185
|
return [
|
|
1186
1186
|
"a",
|
|
1187
|
-
|
|
1187
|
+
be(this.options.HTMLAttributes, e, {
|
|
1188
1188
|
class: "link"
|
|
1189
1189
|
}),
|
|
1190
1190
|
0
|
|
@@ -1196,11 +1196,11 @@ const No = jt.extend({
|
|
|
1196
1196
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1197
1197
|
openOnClick: !0,
|
|
1198
1198
|
button: ({ editor: t, t: n }) => ({
|
|
1199
|
-
component:
|
|
1199
|
+
component: _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 No = jt.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,21 +1229,21 @@ const No = jt.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",
|
|
1246
|
-
|
|
1246
|
+
be(this.options.HTMLAttributes, {
|
|
1247
1247
|
"data-type": this.name
|
|
1248
1248
|
}),
|
|
1249
1249
|
["hr"]
|
|
@@ -1254,7 +1254,7 @@ const No = jt.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 No = jt.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__ */ m(
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
|
|
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
|
+
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 Ti = ["undo", "redo"], To = $t.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 Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1359
1359
|
key: new Z("selection"),
|
|
1360
1360
|
props: {
|
|
1361
1361
|
decorations(t) {
|
|
1362
|
-
return t.selection.empty || e.isFocused === !0 ? null :
|
|
1363
|
-
|
|
1362
|
+
return t.selection.empty || e.isFocused === !0 ? null : re.create(t.doc, [
|
|
1363
|
+
le.inline(t.selection.from, t.selection.to, {
|
|
1364
1364
|
class: "selection"
|
|
1365
1365
|
})
|
|
1366
1366
|
]);
|
|
@@ -1370,8 +1370,8 @@ const Ti = ["undo", "redo"], To = $t.extend({
|
|
|
1370
1370
|
];
|
|
1371
1371
|
}
|
|
1372
1372
|
});
|
|
1373
|
-
function
|
|
1374
|
-
const { t } =
|
|
1373
|
+
function wa(e) {
|
|
1374
|
+
const { t } = j(), n = R(() => [
|
|
1375
1375
|
{
|
|
1376
1376
|
name: "paragraph",
|
|
1377
1377
|
label: t("editor.paragraph.tooltip"),
|
|
@@ -1435,45 +1435,45 @@ function Ei(e) {
|
|
|
1435
1435
|
iconName: "Code2",
|
|
1436
1436
|
action: () => e.editor.chain().focus().clearNodes().toggleCodeBlock().run()
|
|
1437
1437
|
}
|
|
1438
|
-
], [e.editor, t]),
|
|
1438
|
+
], [e.editor, t]), a = R(() => n.findLast((i) => i.isActive()) ?? {
|
|
1439
1439
|
label: "Empty"
|
|
1440
1440
|
}, [n]);
|
|
1441
|
-
return /* @__PURE__ */ m(
|
|
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__ */ m("span", { className: "
|
|
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__ */ m("div", { className: "
|
|
1473
|
-
/* @__PURE__ */ r
|
|
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
1474
|
/* @__PURE__ */ m("span", { children: [
|
|
1475
1475
|
" ",
|
|
1476
|
-
|
|
1476
|
+
i.label
|
|
1477
1477
|
] })
|
|
1478
1478
|
] })
|
|
1479
1479
|
},
|
|
@@ -1484,7 +1484,7 @@ function Ei(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,16 +1492,16 @@ const Hi = N.create({
|
|
|
1492
1492
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1493
1493
|
toolbar: !1,
|
|
1494
1494
|
button: () => ({
|
|
1495
|
-
component:
|
|
1495
|
+
component: wa,
|
|
1496
1496
|
componentProps: {}
|
|
1497
1497
|
})
|
|
1498
1498
|
};
|
|
1499
1499
|
}
|
|
1500
1500
|
});
|
|
1501
|
-
function
|
|
1501
|
+
function We({ types: e, node: t }) {
|
|
1502
1502
|
return Array.isArray(e) && e.includes(t.type) || t.type === e;
|
|
1503
1503
|
}
|
|
1504
|
-
const
|
|
1504
|
+
const ka = A.create({
|
|
1505
1505
|
name: "trailingNode",
|
|
1506
1506
|
addOptions() {
|
|
1507
1507
|
return {
|
|
@@ -1514,163 +1514,163 @@ const Mi = N.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 !
|
|
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 !
|
|
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(
|
|
1542
|
-
|
|
1543
|
-
placeholder: ({ node: t, pos: n, editor:
|
|
1544
|
-
var
|
|
1545
|
-
return ((
|
|
1541
|
+
return this.options.document !== !1 && e.push(ba.configure()), this.options.placeholder !== !1 && e.push(
|
|
1542
|
+
jt.configure({
|
|
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
|
})
|
|
1549
1549
|
), this.options.focus !== !1 && e.push(
|
|
1550
|
-
|
|
1550
|
+
Bt.configure({
|
|
1551
1551
|
className: "focus",
|
|
1552
1552
|
...this.options.focus
|
|
1553
1553
|
})
|
|
1554
|
-
), this.options.text !== !1 && e.push(
|
|
1555
|
-
|
|
1554
|
+
), this.options.text !== !1 && e.push(Dt.configure()), this.options.textBubble !== !1 && e.push(ya.configure()), this.options.gapcursor !== !1 && e.push(Ot.configure()), this.options.dropcursor !== !1 && e.push(
|
|
1555
|
+
$t.configure({
|
|
1556
1556
|
...this.options.dropcursor,
|
|
1557
1557
|
width: 2,
|
|
1558
1558
|
class: "ProseMirror-dropcursor border-black"
|
|
1559
1559
|
})
|
|
1560
|
-
), this.options.characterCount !== !1 && e.push(
|
|
1560
|
+
), this.options.characterCount !== !1 && e.push(Ft.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Ut.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(qt.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Kt.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(Vt.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(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
|
},
|
|
1592
1592
|
addExtensions() {
|
|
1593
1593
|
const e = [];
|
|
1594
|
-
return this.options.subscript !== !1 && e.push(
|
|
1594
|
+
return this.options.subscript !== !1 && e.push(Je.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Ye.configure(this.options.superscript)), e;
|
|
1595
1595
|
}
|
|
1596
1596
|
});
|
|
1597
|
-
function
|
|
1597
|
+
function va(e) {
|
|
1598
1598
|
var n;
|
|
1599
|
-
const t =
|
|
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__ */ m(
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
|
|
1611
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
1612
|
+
/* @__PURE__ */ s(
|
|
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
|
}
|
|
@@ -1678,21 +1678,21 @@ const Ho = N.create({
|
|
|
1678
1678
|
},
|
|
1679
1679
|
addExtensions() {
|
|
1680
1680
|
const e = [];
|
|
1681
|
-
return this.options.subscript !== !1 && e.push(
|
|
1681
|
+
return this.options.subscript !== !1 && e.push(Je.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Ye.configure(this.options.superscript)), e;
|
|
1682
1682
|
}
|
|
1683
|
-
}),
|
|
1683
|
+
}), 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 Ho = N.create({
|
|
|
1703
1703
|
}
|
|
1704
1704
|
},
|
|
1705
1705
|
{
|
|
1706
|
-
component:
|
|
1706
|
+
component: p,
|
|
1707
1707
|
componentProps: {
|
|
1708
1708
|
action: () => {
|
|
1709
1709
|
t.commands.outdent();
|
|
@@ -1736,12 +1736,12 @@ const Ho = N.create({
|
|
|
1736
1736
|
},
|
|
1737
1737
|
addCommands() {
|
|
1738
1738
|
return {
|
|
1739
|
-
indent: () =>
|
|
1740
|
-
delta:
|
|
1739
|
+
indent: () => Fe({
|
|
1740
|
+
delta: he.more,
|
|
1741
1741
|
types: this.options.types
|
|
1742
1742
|
}),
|
|
1743
|
-
outdent: () =>
|
|
1744
|
-
delta:
|
|
1743
|
+
outdent: () => Fe({
|
|
1744
|
+
delta: he.less,
|
|
1745
1745
|
types: this.options.types
|
|
1746
1746
|
})
|
|
1747
1747
|
};
|
|
@@ -1753,43 +1753,43 @@ const Ho = N.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 } =
|
|
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
|
-
const o =
|
|
1765
|
-
const
|
|
1764
|
+
const o = R(() => {
|
|
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__ */ m(
|
|
1777
|
-
/* @__PURE__ */
|
|
1778
|
-
|
|
1776
|
+
return /* @__PURE__ */ m(Y, { children: [
|
|
1777
|
+
/* @__PURE__ */ s(
|
|
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__ */
|
|
1790
|
-
|
|
1789
|
+
children: /* @__PURE__ */ s(
|
|
1790
|
+
M,
|
|
1791
1791
|
{
|
|
1792
|
-
className: "
|
|
1792
|
+
className: "ml-1 size-3 text-zinc-500",
|
|
1793
1793
|
name: "MenuDown"
|
|
1794
1794
|
}
|
|
1795
1795
|
)
|
|
@@ -1797,61 +1797,61 @@ function Pi(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:
|
|
1828
|
-
let { attrs:
|
|
1829
|
-
|
|
1830
|
-
...
|
|
1831
|
-
lineHeight:
|
|
1832
|
-
}, e = e.setNodeMarkup(
|
|
1826
|
+
for (const u of r) {
|
|
1827
|
+
const { node: d, pos: c, nodeType: h } = u;
|
|
1828
|
+
let { attrs: _ } = d;
|
|
1829
|
+
_ = {
|
|
1830
|
+
..._,
|
|
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
|
-
const
|
|
1843
|
+
const _o = A.create({
|
|
1844
1844
|
name: "lineHeight",
|
|
1845
1845
|
addOptions() {
|
|
1846
1846
|
var e;
|
|
1847
1847
|
return {
|
|
1848
1848
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1849
1849
|
types: ["paragraph", "heading", "list_item", "todo_item"],
|
|
1850
|
-
lineHeights:
|
|
1851
|
-
defaultHeight:
|
|
1850
|
+
lineHeights: Rn,
|
|
1851
|
+
defaultHeight: 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,226 +1876,226 @@ const zo = N.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
|
|
1885
|
-
var
|
|
1886
|
-
const [n,
|
|
1887
|
-
|
|
1884
|
+
function Sa(e, t) {
|
|
1885
|
+
var L, E;
|
|
1886
|
+
const [n, a] = C(0), [i, o] = C(0), r = G(null), { t: l } = j(), u = G([]);
|
|
1887
|
+
ze(t, () => ({
|
|
1888
1888
|
onKeyDown: d
|
|
1889
|
-
})),
|
|
1890
|
-
if (!
|
|
1889
|
+
})), z(() => {
|
|
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
|
-
function
|
|
1916
|
-
if (e.items.length === 0 ||
|
|
1915
|
+
function _() {
|
|
1916
|
+
if (e.items.length === 0 || i === -1 || n === -1)
|
|
1917
1917
|
return !1;
|
|
1918
|
-
|
|
1918
|
+
f(i, n);
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1921
|
-
const
|
|
1922
|
-
e.command(
|
|
1920
|
+
function f(g, b) {
|
|
1921
|
+
const v = e.items[g].commands[b];
|
|
1922
|
+
e.command(v);
|
|
1923
1923
|
}
|
|
1924
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: (
|
|
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
1940
|
onClick: () => w(b, H),
|
|
1941
|
-
ref: (
|
|
1942
|
-
className:
|
|
1943
|
-
"slash-command-active":
|
|
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
|
-
|
|
1955
|
-
|
|
1954
|
+
v.iconName && /* @__PURE__ */ s(
|
|
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",
|
|
1979
|
-
title:
|
|
1979
|
+
title: N.t("editor.slash.format"),
|
|
1980
1980
|
commands: []
|
|
1981
1981
|
},
|
|
1982
1982
|
{
|
|
1983
1983
|
name: "insert",
|
|
1984
|
-
title:
|
|
1984
|
+
title: N.t("editor.slash.insert"),
|
|
1985
1985
|
commands: []
|
|
1986
1986
|
}
|
|
1987
1987
|
];
|
|
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:
|
|
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
|
-
label:
|
|
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
|
-
label:
|
|
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
|
-
label:
|
|
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
|
-
label:
|
|
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
|
-
label:
|
|
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
|
-
label:
|
|
2044
|
+
label: N.t("editor.image.tooltip"),
|
|
2045
2045
|
iconName: "ImageUp",
|
|
2046
2046
|
description: "Insert a image",
|
|
2047
2047
|
aliases: ["image", "tp", "tupian"],
|
|
2048
|
-
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
|
-
label:
|
|
2054
|
+
label: N.t("editor.video.tooltip"),
|
|
2055
2055
|
iconName: "Video",
|
|
2056
2056
|
description: "Insert a video",
|
|
2057
2057
|
aliases: ["video", "sp", "shipin"],
|
|
2058
|
-
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
|
-
label:
|
|
2064
|
+
label: N.t("editor.table.tooltip"),
|
|
2065
2065
|
iconName: "Table",
|
|
2066
2066
|
description: "Insert a table",
|
|
2067
2067
|
aliases: ["table", "bg", "biaoge", "biao"],
|
|
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
|
-
label:
|
|
2074
|
+
label: N.t("editor.horizontalrule.tooltip"),
|
|
2075
2075
|
iconName: "Minus",
|
|
2076
2076
|
description: "Insert a horizontal divider",
|
|
2077
2077
|
aliases: ["hr", "fgx", "fg"],
|
|
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
|
-
label:
|
|
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
|
|
2094
|
-
const
|
|
2093
|
+
let k;
|
|
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",
|
|
@@ -2115,39 +2115,39 @@ const Ro = N.create({
|
|
|
2115
2115
|
},
|
|
2116
2116
|
addProseMirrorPlugins() {
|
|
2117
2117
|
return [
|
|
2118
|
-
|
|
2118
|
+
Qe({
|
|
2119
2119
|
editor: this.editor,
|
|
2120
2120
|
char: "/",
|
|
2121
2121
|
allowSpaces: !0,
|
|
2122
2122
|
startOfLine: !0,
|
|
2123
2123
|
pluginKey: new Z(q),
|
|
2124
2124
|
allow: ({ state: e, range: t }) => {
|
|
2125
|
-
var d,
|
|
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 Ro = N.create({
|
|
|
2156
2156
|
return {
|
|
2157
2157
|
onStart: (n) => {
|
|
2158
2158
|
var o;
|
|
2159
|
-
e = new
|
|
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
|
}
|
|
@@ -2236,190 +2236,14 @@ const Ro = N.create({
|
|
|
2236
2236
|
}
|
|
2237
2237
|
};
|
|
2238
2238
|
}
|
|
2239
|
-
})
|
|
2240
|
-
function Ui(e, t, n) {
|
|
2241
|
-
if (!e.doc)
|
|
2242
|
-
return e;
|
|
2243
|
-
const i = e.doc.nodeAt(t);
|
|
2244
|
-
if (!i || n === i.attrs.backgroundColor)
|
|
2245
|
-
return e;
|
|
2246
|
-
const a = {
|
|
2247
|
-
...i.attrs,
|
|
2248
|
-
backgroundColor: n
|
|
2249
|
-
};
|
|
2250
|
-
return e.setNodeMarkup(t, i.type, a, i.marks);
|
|
2251
|
-
}
|
|
2252
|
-
function qi(e, t, n) {
|
|
2253
|
-
const { doc: i, selection: a } = e;
|
|
2254
|
-
return !i || !a || !(a instanceof sn) || a.forEachCell((o, s) => {
|
|
2255
|
-
e = Ui(e, s, n);
|
|
2256
|
-
}), e;
|
|
2257
|
-
}
|
|
2258
|
-
function Qe(e, t) {
|
|
2259
|
-
return ({ tr: n, state: i, dispatch: a }) => {
|
|
2260
|
-
const { selection: o } = i;
|
|
2261
|
-
return n = n.setSelection(o), n = qi(n, t, e), n.docChanged ? (a == null || a(n), !0) : !1;
|
|
2262
|
-
};
|
|
2263
|
-
}
|
|
2264
|
-
const Ki = N.create({
|
|
2265
|
-
name: "tableCellBackground",
|
|
2266
|
-
addOptions() {
|
|
2267
|
-
return {
|
|
2268
|
-
types: ["tableCell"],
|
|
2269
|
-
HTMLAttributes: {}
|
|
2270
|
-
};
|
|
2271
|
-
},
|
|
2272
|
-
addGlobalAttributes() {
|
|
2273
|
-
return [
|
|
2274
|
-
{
|
|
2275
|
-
types: this.options.types,
|
|
2276
|
-
attributes: {
|
|
2277
|
-
backgroundColor: {
|
|
2278
|
-
parseHTML: (e) => e.style.backgroundColor || "",
|
|
2279
|
-
renderHTML: (e) => !e.backgroundColor || e.backgroundColor === "" ? {} : {
|
|
2280
|
-
style: `background-color: ${e.backgroundColor}`
|
|
2281
|
-
}
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
];
|
|
2286
|
-
},
|
|
2287
|
-
addCommands() {
|
|
2288
|
-
return {
|
|
2289
|
-
setTableCellBackground: (e) => Qe(e, this.options),
|
|
2290
|
-
unsetTableCellBackground: () => Qe("", this.options)
|
|
2291
|
-
};
|
|
2292
|
-
}
|
|
2293
|
-
}), Vi = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, Wi = /CrOS/, Gi = /android|ipad|playbook|silk/i;
|
|
2294
|
-
function Ye(e = {}) {
|
|
2295
|
-
let t = e.ua || typeof navigator < "u" && navigator.userAgent;
|
|
2296
|
-
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(Vi.test(t) && !Wi.test(t) || e.tablet && Gi.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
|
|
2297
|
-
}
|
|
2298
|
-
const Xe = (e) => Array.from({ length: e }).map((t, n) => n + 1);
|
|
2299
|
-
function Zi(e) {
|
|
2300
|
-
var l;
|
|
2301
|
-
const [t, n] = v(!0), [i, a] = v({
|
|
2302
|
-
rows: Ye() ? fe : _e,
|
|
2303
|
-
cols: Ye() ? fe : _e
|
|
2304
|
-
}), [o, s] = v({
|
|
2305
|
-
rows: ge,
|
|
2306
|
-
cols: ge
|
|
2307
|
-
});
|
|
2308
|
-
function c(u, f) {
|
|
2309
|
-
u === i.rows && a((_) => ({
|
|
2310
|
-
..._,
|
|
2311
|
-
rows: Math.min(u + 1, fe)
|
|
2312
|
-
})), f === i.cols && a((_) => ({
|
|
2313
|
-
..._,
|
|
2314
|
-
cols: Math.min(f + 1, fe)
|
|
2315
|
-
})), s({
|
|
2316
|
-
rows: u,
|
|
2317
|
-
cols: f
|
|
2318
|
-
});
|
|
2319
|
-
}
|
|
2320
|
-
function h(u, f) {
|
|
2321
|
-
e == null || e.createTable({ rows: u, cols: f, withHeaderRow: t }), d();
|
|
2322
|
-
}
|
|
2323
|
-
function d() {
|
|
2324
|
-
n(!1), a({
|
|
2325
|
-
rows: _e,
|
|
2326
|
-
cols: _e
|
|
2327
|
-
}), s({
|
|
2328
|
-
rows: ge,
|
|
2329
|
-
cols: ge
|
|
2330
|
-
});
|
|
2331
|
-
}
|
|
2332
|
-
return /* @__PURE__ */ m(ie, { modal: !0, children: [
|
|
2333
|
-
/* @__PURE__ */ r(ae, { asChild: !0, children: e == null ? void 0 : e.children }),
|
|
2334
|
-
/* @__PURE__ */ r(
|
|
2335
|
-
oe,
|
|
2336
|
-
{
|
|
2337
|
-
align: "start",
|
|
2338
|
-
className: "richtext-w-full !richtext-p-2",
|
|
2339
|
-
side: "bottom",
|
|
2340
|
-
children: /* @__PURE__ */ m("div", { className: "table-grid-size-editor richtext-p-0", children: [
|
|
2341
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (l = Xe(i == null ? void 0 : i.rows)) == null ? void 0 : l.map((u) => {
|
|
2342
|
-
var f;
|
|
2343
|
-
return /* @__PURE__ */ r(
|
|
2344
|
-
"div",
|
|
2345
|
-
{
|
|
2346
|
-
className: "richtext-flex richtext-gap-1",
|
|
2347
|
-
children: (f = Xe(i == null ? void 0 : i.cols)) == null ? void 0 : f.map((_) => /* @__PURE__ */ r(
|
|
2348
|
-
"div",
|
|
2349
|
-
{
|
|
2350
|
-
onMouseDown: () => h(u, _),
|
|
2351
|
-
onMouseOver: () => c(u, _),
|
|
2352
|
-
className: `richtext-cursor-pointer richtext-border-border ${_ <= o.cols && u <= o.rows && "tableCellActive !richtext-bg-foreground"}`,
|
|
2353
|
-
children: /* @__PURE__ */ r("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
|
|
2354
|
-
},
|
|
2355
|
-
`c-${_}`
|
|
2356
|
-
))
|
|
2357
|
-
},
|
|
2358
|
-
`r-${u}`
|
|
2359
|
-
);
|
|
2360
|
-
}) }),
|
|
2361
|
-
/* @__PURE__ */ m("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-zinc-600", children: [
|
|
2362
|
-
o.rows,
|
|
2363
|
-
" ",
|
|
2364
|
-
"x",
|
|
2365
|
-
o.cols
|
|
2366
|
-
] })
|
|
2367
|
-
] })
|
|
2368
|
-
}
|
|
2369
|
-
)
|
|
2370
|
-
] });
|
|
2371
|
-
}
|
|
2372
|
-
function Ji(e) {
|
|
2373
|
-
function t(n) {
|
|
2374
|
-
e.disabled || e.editor.chain().focus().insertTable({ ...n, withHeaderRow: !1 }).run();
|
|
2375
|
-
}
|
|
2376
|
-
return /* @__PURE__ */ r(Zi, { createTable: t, children: /* @__PURE__ */ r(
|
|
2377
|
-
x,
|
|
2378
|
-
{
|
|
2379
|
-
icon: e == null ? void 0 : e.icon,
|
|
2380
|
-
tooltip: e == null ? void 0 : e.tooltip,
|
|
2381
|
-
disabled: e == null ? void 0 : e.disabled,
|
|
2382
|
-
color: e == null ? void 0 : e.color,
|
|
2383
|
-
action: e == null ? void 0 : e.action,
|
|
2384
|
-
isActive: e == null ? void 0 : e.isActive
|
|
2385
|
-
}
|
|
2386
|
-
) });
|
|
2387
|
-
}
|
|
2388
|
-
const Po = Xt.extend({
|
|
2389
|
-
addOptions() {
|
|
2390
|
-
var e;
|
|
2391
|
-
return {
|
|
2392
|
-
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2393
|
-
resizable: !0,
|
|
2394
|
-
lastColumnResizable: !0,
|
|
2395
|
-
allowTableNodeSelection: !1,
|
|
2396
|
-
button: ({ editor: t, t: n }) => ({
|
|
2397
|
-
component: Ji,
|
|
2398
|
-
componentProps: {
|
|
2399
|
-
disabled: t.isActive("table") || !1,
|
|
2400
|
-
icon: "Table",
|
|
2401
|
-
tooltip: n("editor.table.tooltip"),
|
|
2402
|
-
editor: t
|
|
2403
|
-
}
|
|
2404
|
-
})
|
|
2405
|
-
};
|
|
2406
|
-
},
|
|
2407
|
-
addExtensions() {
|
|
2408
|
-
return [
|
|
2409
|
-
en.configure(this.options.tableRow),
|
|
2410
|
-
tn.configure(this.options.tableHeader),
|
|
2411
|
-
nn.configure(this.options.tableCell),
|
|
2412
|
-
Ki.configure(this.options.tableCellBackground)
|
|
2413
|
-
];
|
|
2414
|
-
}
|
|
2415
|
-
}), Io = N.create({
|
|
2239
|
+
}), go = A.create({
|
|
2416
2240
|
name: "painter",
|
|
2417
2241
|
addOptions() {
|
|
2418
2242
|
var e;
|
|
2419
2243
|
return {
|
|
2420
2244
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2421
2245
|
button: ({ editor: t, t: n }) => ({
|
|
2422
|
-
component:
|
|
2246
|
+
component: p,
|
|
2423
2247
|
componentProps: {
|
|
2424
2248
|
action: () => {
|
|
2425
2249
|
t.commands.setPainter(t == null ? void 0 : t.state.selection.$head.marks());
|
|
@@ -2436,11 +2260,11 @@ const Po = Xt.extend({
|
|
|
2436
2260
|
view: {
|
|
2437
2261
|
dispatch: t,
|
|
2438
2262
|
state: { tr: n },
|
|
2439
|
-
dom:
|
|
2263
|
+
dom: a
|
|
2440
2264
|
}
|
|
2441
2265
|
}) => {
|
|
2442
|
-
const
|
|
2443
|
-
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;
|
|
2444
2268
|
}
|
|
2445
2269
|
};
|
|
2446
2270
|
},
|
|
@@ -2464,14 +2288,14 @@ const Po = Xt.extend({
|
|
|
2464
2288
|
const n = () => {
|
|
2465
2289
|
document.removeEventListener("mouseup", n);
|
|
2466
2290
|
let {
|
|
2467
|
-
dispatch:
|
|
2468
|
-
state: { tr:
|
|
2469
|
-
dom:
|
|
2291
|
+
dispatch: a,
|
|
2292
|
+
state: { tr: i, selection: o },
|
|
2293
|
+
dom: r
|
|
2470
2294
|
} = e;
|
|
2471
|
-
|
|
2472
|
-
for (const
|
|
2473
|
-
|
|
2474
|
-
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" }));
|
|
2475
2299
|
};
|
|
2476
2300
|
return document.addEventListener("mouseup", n), !0;
|
|
2477
2301
|
}
|
|
@@ -2481,133 +2305,133 @@ const Po = Xt.extend({
|
|
|
2481
2305
|
];
|
|
2482
2306
|
}
|
|
2483
2307
|
});
|
|
2484
|
-
function
|
|
2485
|
-
const { t: n } =
|
|
2486
|
-
return
|
|
2487
|
-
|
|
2488
|
-
}, [e,
|
|
2489
|
-
|
|
2490
|
-
}, [
|
|
2491
|
-
|
|
2492
|
-
}, [
|
|
2308
|
+
function 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
|
+
return z(() => {
|
|
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(() => {
|
|
2493
2317
|
if (!e)
|
|
2494
2318
|
return;
|
|
2495
|
-
const
|
|
2496
|
-
if (!
|
|
2319
|
+
const y = e.extensionManager.extensions.find((E) => E.name === ja.name);
|
|
2320
|
+
if (!y)
|
|
2497
2321
|
return;
|
|
2498
|
-
const
|
|
2499
|
-
if (!
|
|
2322
|
+
const L = () => {
|
|
2323
|
+
if (!h)
|
|
2500
2324
|
return;
|
|
2501
|
-
const E =
|
|
2502
|
-
|
|
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);
|
|
2503
2327
|
};
|
|
2504
|
-
return
|
|
2505
|
-
|
|
2328
|
+
return Ue(D.SEARCH_REPLCE, L), () => {
|
|
2329
|
+
y && Ue(D.SEARCH_REPLCE, L);
|
|
2506
2330
|
};
|
|
2507
|
-
}, [
|
|
2508
|
-
|
|
2331
|
+
}, [h, e]), /* @__PURE__ */ m(
|
|
2332
|
+
ce,
|
|
2509
2333
|
{
|
|
2510
|
-
onOpenChange:
|
|
2511
|
-
open:
|
|
2334
|
+
onOpenChange: _,
|
|
2335
|
+
open: h,
|
|
2512
2336
|
children: [
|
|
2513
|
-
/* @__PURE__ */
|
|
2514
|
-
|
|
2337
|
+
/* @__PURE__ */ s(
|
|
2338
|
+
de,
|
|
2515
2339
|
{
|
|
2516
2340
|
asChild: !0,
|
|
2517
2341
|
disabled: t == null ? void 0 : t.disabled,
|
|
2518
|
-
children: /* @__PURE__ */
|
|
2519
|
-
|
|
2342
|
+
children: /* @__PURE__ */ s(
|
|
2343
|
+
p,
|
|
2520
2344
|
{
|
|
2521
2345
|
disabled: t == null ? void 0 : t.disabled,
|
|
2522
2346
|
isActive: t == null ? void 0 : t.isActive,
|
|
2523
2347
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
2524
|
-
children: /* @__PURE__ */
|
|
2348
|
+
children: /* @__PURE__ */ s(M, { name: t == null ? void 0 : t.icon })
|
|
2525
2349
|
}
|
|
2526
2350
|
)
|
|
2527
2351
|
}
|
|
2528
2352
|
),
|
|
2529
2353
|
/* @__PURE__ */ m(
|
|
2530
|
-
|
|
2354
|
+
ue,
|
|
2531
2355
|
{
|
|
2532
2356
|
align: "start",
|
|
2533
|
-
className: "
|
|
2357
|
+
className: "w-full",
|
|
2534
2358
|
hideWhenDetached: !0,
|
|
2535
2359
|
side: "bottom",
|
|
2536
2360
|
children: [
|
|
2537
|
-
/* @__PURE__ */ m("div", { className: "
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
/* @__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" })
|
|
2540
2364
|
] }),
|
|
2541
|
-
/* @__PURE__ */ m("div", { className: "
|
|
2542
|
-
/* @__PURE__ */
|
|
2543
|
-
|
|
2365
|
+
/* @__PURE__ */ m("div", { className: "mb-[10px] flex w-full max-w-sm items-center gap-1.5", children: [
|
|
2366
|
+
/* @__PURE__ */ s(
|
|
2367
|
+
qe,
|
|
2544
2368
|
{
|
|
2545
2369
|
autoFocus: !0,
|
|
2546
|
-
className: "
|
|
2547
|
-
onChange: (
|
|
2370
|
+
className: "w-full",
|
|
2371
|
+
onChange: (y) => u(y.target.value),
|
|
2548
2372
|
placeholder: "Text",
|
|
2549
2373
|
required: !0,
|
|
2550
2374
|
type: "text",
|
|
2551
|
-
value:
|
|
2375
|
+
value: l
|
|
2552
2376
|
}
|
|
2553
2377
|
),
|
|
2554
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ s(
|
|
2555
2379
|
V,
|
|
2556
2380
|
{
|
|
2557
|
-
className: "
|
|
2381
|
+
className: "flex-1",
|
|
2558
2382
|
disabled: o.length === 0,
|
|
2559
2383
|
onClick: e.commands.goToPrevSearchResult,
|
|
2560
|
-
children: /* @__PURE__ */
|
|
2384
|
+
children: /* @__PURE__ */ s(M, { name: "ChevronUp" })
|
|
2561
2385
|
}
|
|
2562
2386
|
),
|
|
2563
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ s(
|
|
2564
2388
|
V,
|
|
2565
2389
|
{
|
|
2566
|
-
className: "
|
|
2390
|
+
className: "flex-1",
|
|
2567
2391
|
disabled: o.length === 0,
|
|
2568
2392
|
onClick: e.commands.goToNextSearchResult,
|
|
2569
|
-
children: /* @__PURE__ */
|
|
2393
|
+
children: /* @__PURE__ */ s(M, { name: "ChevronDown" })
|
|
2570
2394
|
}
|
|
2571
2395
|
)
|
|
2572
2396
|
] }),
|
|
2573
|
-
/* @__PURE__ */
|
|
2574
|
-
/* @__PURE__ */
|
|
2575
|
-
|
|
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
|
+
qe,
|
|
2576
2400
|
{
|
|
2577
|
-
className: "
|
|
2578
|
-
onChange: (
|
|
2401
|
+
className: "w-80",
|
|
2402
|
+
onChange: (y) => c(y.target.value),
|
|
2579
2403
|
placeholder: "Text",
|
|
2580
2404
|
required: !0,
|
|
2581
2405
|
type: "text",
|
|
2582
2406
|
value: d
|
|
2583
2407
|
}
|
|
2584
2408
|
) }) }),
|
|
2585
|
-
/* @__PURE__ */ m("div", { className: "
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
|
|
2409
|
+
/* @__PURE__ */ m("div", { className: "mb-[10px] flex items-center space-x-2", children: [
|
|
2410
|
+
/* @__PURE__ */ s(
|
|
2411
|
+
Cn,
|
|
2588
2412
|
{
|
|
2589
|
-
checked:
|
|
2590
|
-
onCheckedChange: (
|
|
2591
|
-
w(
|
|
2413
|
+
checked: f,
|
|
2414
|
+
onCheckedChange: (y) => {
|
|
2415
|
+
w(y), e.commands.setCaseSensitive(y);
|
|
2592
2416
|
}
|
|
2593
2417
|
}
|
|
2594
2418
|
),
|
|
2595
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ s(ve, { children: n("editor.replace.caseSensitive") })
|
|
2596
2420
|
] }),
|
|
2597
|
-
/* @__PURE__ */ m("div", { className: "
|
|
2598
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-[10px]", children: [
|
|
2422
|
+
/* @__PURE__ */ s(
|
|
2599
2423
|
V,
|
|
2600
2424
|
{
|
|
2601
|
-
className: "
|
|
2425
|
+
className: "flex-1",
|
|
2602
2426
|
disabled: o.length === 0,
|
|
2603
2427
|
onClick: e.commands.replace,
|
|
2604
2428
|
children: n("editor.replace.dialog.text")
|
|
2605
2429
|
}
|
|
2606
2430
|
),
|
|
2607
|
-
/* @__PURE__ */
|
|
2431
|
+
/* @__PURE__ */ s(
|
|
2608
2432
|
V,
|
|
2609
2433
|
{
|
|
2610
|
-
className: "
|
|
2434
|
+
className: "flex-1",
|
|
2611
2435
|
disabled: o.length === 0,
|
|
2612
2436
|
onClick: e.commands.replaceAll,
|
|
2613
2437
|
children: n("editor.replaceAll.dialog.text")
|
|
@@ -2621,88 +2445,88 @@ function Qi({ editor: e, ...t }) {
|
|
|
2621
2445
|
}
|
|
2622
2446
|
);
|
|
2623
2447
|
}
|
|
2624
|
-
const
|
|
2625
|
-
function
|
|
2448
|
+
const ie = (e, t) => t(e.tr);
|
|
2449
|
+
function Ma(e, t, n) {
|
|
2626
2450
|
return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e, n ? "gu" : "gui");
|
|
2627
2451
|
}
|
|
2628
|
-
function
|
|
2629
|
-
const
|
|
2630
|
-
let
|
|
2452
|
+
function Pa(e, t, n) {
|
|
2453
|
+
const a = [];
|
|
2454
|
+
let i = [];
|
|
2631
2455
|
const o = [];
|
|
2632
|
-
let
|
|
2456
|
+
let r = 0;
|
|
2633
2457
|
if (!t)
|
|
2634
2458
|
return { decorationsToReturn: [], results: [] };
|
|
2635
|
-
e == null || e.descendants((
|
|
2636
|
-
|
|
2637
|
-
text:
|
|
2638
|
-
pos:
|
|
2639
|
-
} :
|
|
2640
|
-
text: `${
|
|
2641
|
-
pos:
|
|
2642
|
-
} :
|
|
2643
|
-
}),
|
|
2644
|
-
for (const { text:
|
|
2645
|
-
const d = [...
|
|
2646
|
-
for (const
|
|
2647
|
-
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] === "")
|
|
2648
2472
|
break;
|
|
2649
|
-
|
|
2650
|
-
from:
|
|
2651
|
-
to:
|
|
2473
|
+
c.index !== void 0 && o.push({
|
|
2474
|
+
from: u + c.index,
|
|
2475
|
+
to: u + c.index + c[0].length
|
|
2652
2476
|
});
|
|
2653
2477
|
}
|
|
2654
2478
|
}
|
|
2655
|
-
for (const
|
|
2656
|
-
|
|
2479
|
+
for (const l of o)
|
|
2480
|
+
a.push(le.inline(l.from, l.to, { class: n }));
|
|
2657
2481
|
return {
|
|
2658
|
-
decorationsToReturn:
|
|
2482
|
+
decorationsToReturn: a,
|
|
2659
2483
|
results: o
|
|
2660
2484
|
};
|
|
2661
2485
|
}
|
|
2662
|
-
function
|
|
2486
|
+
function Ge(e, t, { state: n, dispatch: a }) {
|
|
2663
2487
|
if (!t[0])
|
|
2664
2488
|
return;
|
|
2665
|
-
const { from: o, to:
|
|
2666
|
-
|
|
2489
|
+
const { from: o, to: r } = t[0];
|
|
2490
|
+
a && a(n.tr.insertText(e, o, r));
|
|
2667
2491
|
}
|
|
2668
|
-
function
|
|
2669
|
-
const
|
|
2670
|
-
if (!i
|
|
2492
|
+
function Ra(e, t, n, a) {
|
|
2493
|
+
const i = t + 1;
|
|
2494
|
+
if (!a[i])
|
|
2671
2495
|
return null;
|
|
2672
|
-
const { from: o, to:
|
|
2673
|
-
return i
|
|
2674
|
-
to: d -
|
|
2675
|
-
from:
|
|
2676
|
-
}, [
|
|
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];
|
|
2677
2501
|
}
|
|
2678
|
-
function
|
|
2679
|
-
let
|
|
2502
|
+
function Ia(e, t, { tr: n, dispatch: a }) {
|
|
2503
|
+
let i = 0, o = t.slice();
|
|
2680
2504
|
if (o.length === 0)
|
|
2681
2505
|
return !1;
|
|
2682
|
-
for (let
|
|
2683
|
-
const { from:
|
|
2684
|
-
n.insertText(e,
|
|
2685
|
-
const d =
|
|
2686
|
-
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]);
|
|
2687
2511
|
}
|
|
2688
|
-
return
|
|
2512
|
+
return a(n), !0;
|
|
2689
2513
|
}
|
|
2690
|
-
function
|
|
2691
|
-
const o = n[
|
|
2514
|
+
function Ze({ view: e, tr: t, searchResults: n, searchResultCurrentClass: a, gotoIndex: i }) {
|
|
2515
|
+
const o = n[i];
|
|
2692
2516
|
if (o) {
|
|
2693
|
-
const
|
|
2517
|
+
const r = t.setMeta("directDecoration", {
|
|
2694
2518
|
fromPos: o.from,
|
|
2695
2519
|
toPos: o.to,
|
|
2696
|
-
attrs: { class:
|
|
2520
|
+
attrs: { class: a }
|
|
2697
2521
|
});
|
|
2698
|
-
return e == null || e.dispatch(
|
|
2699
|
-
const
|
|
2700
|
-
|
|
2522
|
+
return e == null || e.dispatch(r), setTimeout(() => {
|
|
2523
|
+
const l = window.document.querySelector(`.${a}`);
|
|
2524
|
+
l && Oe(l, { behavior: "smooth", scrollMode: "if-needed" });
|
|
2701
2525
|
}, 0), !0;
|
|
2702
2526
|
}
|
|
2703
2527
|
return !1;
|
|
2704
2528
|
}
|
|
2705
|
-
const
|
|
2529
|
+
const ja = A.create({
|
|
2706
2530
|
name: "search",
|
|
2707
2531
|
addOptions() {
|
|
2708
2532
|
var e;
|
|
@@ -2719,7 +2543,7 @@ const na = N.create({
|
|
|
2719
2543
|
onChange: () => {
|
|
2720
2544
|
},
|
|
2721
2545
|
button: ({ editor: t, t: n }) => ({
|
|
2722
|
-
component:
|
|
2546
|
+
component: za,
|
|
2723
2547
|
componentProps: {
|
|
2724
2548
|
action: () => {
|
|
2725
2549
|
},
|
|
@@ -2740,33 +2564,33 @@ const na = N.create({
|
|
|
2740
2564
|
},
|
|
2741
2565
|
addCommands() {
|
|
2742
2566
|
return {
|
|
2743
|
-
setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE),
|
|
2744
|
-
setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e,
|
|
2745
|
-
setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e,
|
|
2567
|
+
setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE), 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),
|
|
2746
2570
|
replace: () => ({ state: e, dispatch: t }) => {
|
|
2747
|
-
const { replaceTerm: n } = this.options, { currentIndex:
|
|
2748
|
-
return o ? (
|
|
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;
|
|
2749
2573
|
},
|
|
2750
2574
|
replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
|
|
2751
|
-
const { replaceTerm:
|
|
2752
|
-
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;
|
|
2753
2577
|
},
|
|
2754
2578
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
2755
|
-
const { searchResultCurrentClass: n } = this.options, { currentIndex:
|
|
2756
|
-
return this.storage.currentIndex = o, K(D.SEARCH_REPLCE),
|
|
2579
|
+
const { searchResultCurrentClass: n } = this.options, { currentIndex: a, results: i } = this.storage, o = (a + i.length - 1) % i.length;
|
|
2580
|
+
return this.storage.currentIndex = o, K(D.SEARCH_REPLCE), Ze({
|
|
2757
2581
|
view: e,
|
|
2758
2582
|
tr: t,
|
|
2759
|
-
searchResults:
|
|
2583
|
+
searchResults: i,
|
|
2760
2584
|
searchResultCurrentClass: n,
|
|
2761
2585
|
gotoIndex: o
|
|
2762
2586
|
});
|
|
2763
2587
|
},
|
|
2764
2588
|
goToNextSearchResult: () => ({ view: e, tr: t }) => {
|
|
2765
|
-
const { searchResultCurrentClass: n } = this.options, { currentIndex:
|
|
2766
|
-
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE),
|
|
2589
|
+
const { searchResultCurrentClass: n } = this.options, { currentIndex: a, results: i } = this.storage, o = (a + 1) % i.length;
|
|
2590
|
+
return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE), Ze({
|
|
2767
2591
|
view: e,
|
|
2768
2592
|
tr: t,
|
|
2769
|
-
searchResults:
|
|
2593
|
+
searchResults: i,
|
|
2770
2594
|
searchResultCurrentClass: n,
|
|
2771
2595
|
gotoIndex: o
|
|
2772
2596
|
});
|
|
@@ -2780,26 +2604,26 @@ const na = N.create({
|
|
|
2780
2604
|
key: new Z("search"),
|
|
2781
2605
|
state: {
|
|
2782
2606
|
init() {
|
|
2783
|
-
return
|
|
2607
|
+
return re.empty;
|
|
2784
2608
|
},
|
|
2785
2609
|
apply(t) {
|
|
2786
|
-
const { doc: n, docChanged:
|
|
2787
|
-
if (
|
|
2788
|
-
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(
|
|
2789
2613
|
n,
|
|
2790
|
-
|
|
2614
|
+
Ma(i, l, u),
|
|
2791
2615
|
o
|
|
2792
2616
|
);
|
|
2793
|
-
if (e.storage.results =
|
|
2794
|
-
const { fromPos:
|
|
2795
|
-
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));
|
|
2796
2620
|
} else
|
|
2797
|
-
|
|
2798
|
-
class:
|
|
2621
|
+
c.length > 0 && (d[0] = le.inline(c[0].from, c[0].to, {
|
|
2622
|
+
class: r
|
|
2799
2623
|
}));
|
|
2800
|
-
return
|
|
2624
|
+
return re.create(n, d);
|
|
2801
2625
|
}
|
|
2802
|
-
return
|
|
2626
|
+
return re.empty;
|
|
2803
2627
|
}
|
|
2804
2628
|
},
|
|
2805
2629
|
props: {
|
|
@@ -2811,15 +2635,15 @@ const na = N.create({
|
|
|
2811
2635
|
];
|
|
2812
2636
|
}
|
|
2813
2637
|
});
|
|
2814
|
-
function
|
|
2638
|
+
function Ba({
|
|
2815
2639
|
className: e,
|
|
2816
2640
|
...t
|
|
2817
2641
|
}) {
|
|
2818
|
-
return /* @__PURE__ */
|
|
2642
|
+
return /* @__PURE__ */ s(
|
|
2819
2643
|
W.Root,
|
|
2820
2644
|
{
|
|
2821
|
-
className:
|
|
2822
|
-
"
|
|
2645
|
+
className: T(
|
|
2646
|
+
"bg-popover text-popover-foreground isolate flex h-full w-fit flex-col overflow-hidden rounded-md",
|
|
2823
2647
|
e
|
|
2824
2648
|
),
|
|
2825
2649
|
"data-slot": "emoji-picker",
|
|
@@ -2827,21 +2651,21 @@ function ia({
|
|
|
2827
2651
|
}
|
|
2828
2652
|
);
|
|
2829
2653
|
}
|
|
2830
|
-
function
|
|
2654
|
+
function Da({
|
|
2831
2655
|
className: e,
|
|
2832
2656
|
...t
|
|
2833
2657
|
}) {
|
|
2834
2658
|
return /* @__PURE__ */ m(
|
|
2835
2659
|
"div",
|
|
2836
2660
|
{
|
|
2837
|
-
className:
|
|
2661
|
+
className: T("flex h-9 items-center gap-2 border-b px-3", e),
|
|
2838
2662
|
"data-slot": "emoji-picker-search-wrapper",
|
|
2839
2663
|
children: [
|
|
2840
|
-
/* @__PURE__ */
|
|
2841
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ s(an, { className: "size-4 shrink-0 opacity-50" }),
|
|
2665
|
+
/* @__PURE__ */ s(
|
|
2842
2666
|
W.Search,
|
|
2843
2667
|
{
|
|
2844
|
-
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",
|
|
2845
2669
|
"data-slot": "emoji-picker-search",
|
|
2846
2670
|
...t
|
|
2847
2671
|
}
|
|
@@ -2850,20 +2674,20 @@ function aa({
|
|
|
2850
2674
|
}
|
|
2851
2675
|
);
|
|
2852
2676
|
}
|
|
2853
|
-
function
|
|
2854
|
-
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 });
|
|
2855
2679
|
}
|
|
2856
|
-
function
|
|
2680
|
+
function $a({
|
|
2857
2681
|
emoji: e,
|
|
2858
2682
|
className: t,
|
|
2859
2683
|
...n
|
|
2860
2684
|
}) {
|
|
2861
|
-
return /* @__PURE__ */
|
|
2685
|
+
return /* @__PURE__ */ s(
|
|
2862
2686
|
"button",
|
|
2863
2687
|
{
|
|
2864
2688
|
...n,
|
|
2865
|
-
className:
|
|
2866
|
-
"data-[active]:
|
|
2689
|
+
className: T(
|
|
2690
|
+
"data-[active]:bg-accent flex size-7 items-center justify-center rounded-sm text-base",
|
|
2867
2691
|
t
|
|
2868
2692
|
),
|
|
2869
2693
|
"data-slot": "emoji-picker-emoji",
|
|
@@ -2871,55 +2695,55 @@ function ra({
|
|
|
2871
2695
|
}
|
|
2872
2696
|
);
|
|
2873
2697
|
}
|
|
2874
|
-
function
|
|
2698
|
+
function Fa({
|
|
2875
2699
|
category: e,
|
|
2876
2700
|
...t
|
|
2877
2701
|
}) {
|
|
2878
|
-
return /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ s(
|
|
2879
2703
|
"div",
|
|
2880
2704
|
{
|
|
2881
2705
|
...t,
|
|
2882
|
-
className: "
|
|
2706
|
+
className: "bg-popover text-muted-foreground px-3 pb-2 pt-3.5 text-xs leading-none",
|
|
2883
2707
|
"data-slot": "emoji-picker-category-header",
|
|
2884
2708
|
children: e.label
|
|
2885
2709
|
}
|
|
2886
2710
|
);
|
|
2887
2711
|
}
|
|
2888
|
-
function
|
|
2712
|
+
function Ua({
|
|
2889
2713
|
className: e,
|
|
2890
2714
|
...t
|
|
2891
2715
|
}) {
|
|
2892
2716
|
return /* @__PURE__ */ m(
|
|
2893
2717
|
W.Viewport,
|
|
2894
2718
|
{
|
|
2895
|
-
className:
|
|
2719
|
+
className: T("outline-hidden relative flex-1", e),
|
|
2896
2720
|
"data-slot": "emoji-picker-viewport",
|
|
2897
2721
|
...t,
|
|
2898
2722
|
children: [
|
|
2899
|
-
/* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ s(
|
|
2900
2724
|
W.Loading,
|
|
2901
2725
|
{
|
|
2902
|
-
className: "
|
|
2726
|
+
className: "absolute inset-0 flex items-center justify-center text-muted-foreground",
|
|
2903
2727
|
"data-slot": "emoji-picker-loading",
|
|
2904
|
-
children: /* @__PURE__ */
|
|
2728
|
+
children: /* @__PURE__ */ s(on, { className: "size-4 animate-spin" })
|
|
2905
2729
|
}
|
|
2906
2730
|
),
|
|
2907
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ s(
|
|
2908
2732
|
W.Empty,
|
|
2909
2733
|
{
|
|
2910
|
-
className: "
|
|
2734
|
+
className: "absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",
|
|
2911
2735
|
"data-slot": "emoji-picker-empty",
|
|
2912
2736
|
children: "No emoji found."
|
|
2913
2737
|
}
|
|
2914
2738
|
),
|
|
2915
|
-
/* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ s(
|
|
2916
2740
|
W.List,
|
|
2917
2741
|
{
|
|
2918
|
-
className: "
|
|
2742
|
+
className: "select-none pb-1",
|
|
2919
2743
|
components: {
|
|
2920
|
-
Row:
|
|
2921
|
-
Emoji:
|
|
2922
|
-
CategoryHeader:
|
|
2744
|
+
Row: Oa,
|
|
2745
|
+
Emoji: $a,
|
|
2746
|
+
CategoryHeader: Fa
|
|
2923
2747
|
},
|
|
2924
2748
|
"data-slot": "emoji-picker-list"
|
|
2925
2749
|
}
|
|
@@ -2928,47 +2752,47 @@ function ca({
|
|
|
2928
2752
|
}
|
|
2929
2753
|
);
|
|
2930
2754
|
}
|
|
2931
|
-
function
|
|
2755
|
+
function qa({
|
|
2932
2756
|
className: e,
|
|
2933
2757
|
...t
|
|
2934
2758
|
}) {
|
|
2935
|
-
return /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ s(
|
|
2936
2760
|
"div",
|
|
2937
2761
|
{
|
|
2938
|
-
className:
|
|
2939
|
-
"
|
|
2762
|
+
className: T(
|
|
2763
|
+
"max-w-(--frimousse-viewport-width) flex w-full min-w-0 items-center gap-1 border-t p-2",
|
|
2940
2764
|
e
|
|
2941
2765
|
),
|
|
2942
2766
|
"data-slot": "emoji-picker-footer",
|
|
2943
2767
|
...t,
|
|
2944
|
-
children: /* @__PURE__ */
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
2947
|
-
] }) : /* @__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…" }) })
|
|
2948
2772
|
}
|
|
2949
2773
|
);
|
|
2950
2774
|
}
|
|
2951
|
-
function
|
|
2952
|
-
return /* @__PURE__ */ m(
|
|
2953
|
-
/* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
|
|
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,
|
|
2956
2780
|
{
|
|
2957
2781
|
align: "start",
|
|
2958
|
-
className: "
|
|
2782
|
+
className: "size-full p-2",
|
|
2959
2783
|
hideWhenDetached: !0,
|
|
2960
2784
|
side: "bottom",
|
|
2961
2785
|
children: /* @__PURE__ */ m(
|
|
2962
|
-
|
|
2786
|
+
Ba,
|
|
2963
2787
|
{
|
|
2964
|
-
className: "!
|
|
2788
|
+
className: "!h-[342px]",
|
|
2965
2789
|
onEmojiSelect: ({ emoji: n }) => {
|
|
2966
2790
|
e(n);
|
|
2967
2791
|
},
|
|
2968
2792
|
children: [
|
|
2969
|
-
/* @__PURE__ */
|
|
2970
|
-
/* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ s(Da, {}),
|
|
2794
|
+
/* @__PURE__ */ s(Ua, {}),
|
|
2795
|
+
/* @__PURE__ */ s(qa, {})
|
|
2972
2796
|
]
|
|
2973
2797
|
}
|
|
2974
2798
|
)
|
|
@@ -2976,62 +2800,62 @@ function da({ onSelectEmoji: e, children: t }) {
|
|
|
2976
2800
|
)
|
|
2977
2801
|
] });
|
|
2978
2802
|
}
|
|
2979
|
-
function
|
|
2980
|
-
const
|
|
2981
|
-
(
|
|
2982
|
-
const { selection: o } = e.state, { $anchor:
|
|
2983
|
-
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();
|
|
2984
2808
|
},
|
|
2985
2809
|
[e]
|
|
2986
2810
|
);
|
|
2987
|
-
return /* @__PURE__ */
|
|
2988
|
-
|
|
2811
|
+
return /* @__PURE__ */ s(Ka, { onSelectEmoji: a, children: /* @__PURE__ */ s(
|
|
2812
|
+
p,
|
|
2989
2813
|
{
|
|
2990
2814
|
icon: t,
|
|
2991
2815
|
tooltip: n == null ? void 0 : n.tooltip
|
|
2992
2816
|
}
|
|
2993
2817
|
) });
|
|
2994
2818
|
}
|
|
2995
|
-
const
|
|
2996
|
-
const n = G(null), [
|
|
2997
|
-
const
|
|
2998
|
-
|
|
2999
|
-
},
|
|
3000
|
-
|
|
3001
|
-
},
|
|
3002
|
-
|
|
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);
|
|
3003
2827
|
}, d = () => {
|
|
3004
|
-
|
|
2828
|
+
r(a);
|
|
3005
2829
|
};
|
|
3006
|
-
return
|
|
3007
|
-
if (Number.isNaN(
|
|
2830
|
+
return z(() => i(0), [e.items]), z(() => {
|
|
2831
|
+
if (Number.isNaN(a + 1))
|
|
3008
2832
|
return;
|
|
3009
|
-
const
|
|
3010
|
-
|
|
3011
|
-
}, [
|
|
3012
|
-
onKeyDown: ({ event:
|
|
3013
|
-
})), /* @__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(
|
|
3014
2838
|
"span",
|
|
3015
2839
|
{
|
|
3016
|
-
className:
|
|
3017
|
-
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),
|
|
3018
2842
|
children: [
|
|
3019
|
-
|
|
2843
|
+
c.fallbackImage ? /* @__PURE__ */ s(
|
|
3020
2844
|
"img",
|
|
3021
2845
|
{
|
|
3022
|
-
className: "
|
|
3023
|
-
src:
|
|
2846
|
+
className: "size-[1em]",
|
|
2847
|
+
src: c.fallbackImage
|
|
3024
2848
|
}
|
|
3025
|
-
) :
|
|
2849
|
+
) : c.emoji,
|
|
3026
2850
|
":",
|
|
3027
|
-
|
|
2851
|
+
c.name,
|
|
3028
2852
|
":"
|
|
3029
2853
|
]
|
|
3030
2854
|
},
|
|
3031
|
-
`emoji-list-code-${
|
|
3032
|
-
)) : /* @__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") }) }) }) });
|
|
3033
2857
|
});
|
|
3034
|
-
|
|
2858
|
+
mt.displayName = "EmojiList";
|
|
3035
2859
|
const ee = {
|
|
3036
2860
|
100: "💯",
|
|
3037
2861
|
1234: "🔢",
|
|
@@ -4876,18 +4700,18 @@ Object.keys(ee).reduce((e, t) => {
|
|
|
4876
4700
|
const n = ee[t];
|
|
4877
4701
|
return e[n] = t, e;
|
|
4878
4702
|
}, {});
|
|
4879
|
-
const
|
|
4703
|
+
const Wa = Object.keys(ee).map((e) => e);
|
|
4880
4704
|
Object.keys(ee).map((e) => ee[e]);
|
|
4881
|
-
function
|
|
4882
|
-
return
|
|
4705
|
+
function Ga(e) {
|
|
4706
|
+
return Wa.filter((t) => t.startsWith(e)).map((t) => ({
|
|
4883
4707
|
name: t,
|
|
4884
4708
|
emoji: ee[t]
|
|
4885
4709
|
}));
|
|
4886
4710
|
}
|
|
4887
|
-
const
|
|
4711
|
+
const Za = 200, Ja = new Z("emoji"), bo = ge.create({
|
|
4888
4712
|
name: "emoji",
|
|
4889
4713
|
content: "text*",
|
|
4890
|
-
priority:
|
|
4714
|
+
priority: Za,
|
|
4891
4715
|
addOptions() {
|
|
4892
4716
|
var e;
|
|
4893
4717
|
return {
|
|
@@ -4895,13 +4719,13 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4895
4719
|
HTMLAttributes: {},
|
|
4896
4720
|
suggestion: {
|
|
4897
4721
|
char: ":",
|
|
4898
|
-
pluginKey:
|
|
4899
|
-
command: ({ editor: t, range: n, props:
|
|
4900
|
-
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();
|
|
4901
4725
|
}
|
|
4902
4726
|
},
|
|
4903
4727
|
button: ({ editor: t, t: n }) => ({
|
|
4904
|
-
component:
|
|
4728
|
+
component: Va,
|
|
4905
4729
|
componentProps: {
|
|
4906
4730
|
editor: t,
|
|
4907
4731
|
action: () => {
|
|
@@ -4921,7 +4745,7 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4921
4745
|
},
|
|
4922
4746
|
addProseMirrorPlugins() {
|
|
4923
4747
|
return [
|
|
4924
|
-
|
|
4748
|
+
Qe({
|
|
4925
4749
|
editor: this.editor,
|
|
4926
4750
|
...this.options.suggestion
|
|
4927
4751
|
})
|
|
@@ -4929,16 +4753,16 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4929
4753
|
}
|
|
4930
4754
|
}).configure({
|
|
4931
4755
|
suggestion: {
|
|
4932
|
-
items: ({ query: e }) =>
|
|
4756
|
+
items: ({ query: e }) => Ga(e),
|
|
4933
4757
|
render: () => {
|
|
4934
4758
|
let e, t, n;
|
|
4935
4759
|
return {
|
|
4936
|
-
onStart: (
|
|
4937
|
-
n =
|
|
4938
|
-
props:
|
|
4939
|
-
editor:
|
|
4940
|
-
}), t =
|
|
4941
|
-
getReferenceClientRect:
|
|
4760
|
+
onStart: (a) => {
|
|
4761
|
+
n = a.editor.isEditable, n && (e = new Te(mt, {
|
|
4762
|
+
props: a,
|
|
4763
|
+
editor: a.editor
|
|
4764
|
+
}), t = De("body", {
|
|
4765
|
+
getReferenceClientRect: a.clientRect,
|
|
4942
4766
|
appendTo: () => document.body,
|
|
4943
4767
|
content: e.element,
|
|
4944
4768
|
showOnCreate: !0,
|
|
@@ -4947,15 +4771,15 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4947
4771
|
placement: "bottom-start"
|
|
4948
4772
|
}));
|
|
4949
4773
|
},
|
|
4950
|
-
onUpdate(
|
|
4951
|
-
n && (e.updateProps(
|
|
4952
|
-
getReferenceClientRect:
|
|
4774
|
+
onUpdate(a) {
|
|
4775
|
+
n && (e.updateProps(a), t[0].setProps({
|
|
4776
|
+
getReferenceClientRect: a.clientRect
|
|
4953
4777
|
}));
|
|
4954
4778
|
},
|
|
4955
|
-
onKeyDown(
|
|
4956
|
-
var
|
|
4779
|
+
onKeyDown(a) {
|
|
4780
|
+
var i;
|
|
4957
4781
|
if (n)
|
|
4958
|
-
return
|
|
4782
|
+
return a.event.key === "Escape" ? (t[0].hide(), !0) : (i = e.ref) == null ? void 0 : i.onKeyDown(a);
|
|
4959
4783
|
},
|
|
4960
4784
|
onExit() {
|
|
4961
4785
|
n && (t[0].destroy(), e.destroy());
|
|
@@ -4964,7 +4788,7 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
|
|
|
4964
4788
|
}
|
|
4965
4789
|
}
|
|
4966
4790
|
});
|
|
4967
|
-
function
|
|
4791
|
+
function Ya(e) {
|
|
4968
4792
|
const t = document.createElement("iframe");
|
|
4969
4793
|
t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
|
|
4970
4794
|
<!DOCTYPE html>
|
|
@@ -4981,8 +4805,8 @@ function ga(e) {
|
|
|
4981
4805
|
</body>
|
|
4982
4806
|
</html>
|
|
4983
4807
|
`;
|
|
4984
|
-
const n = t.contentWindow,
|
|
4985
|
-
|
|
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() {
|
|
4986
4810
|
try {
|
|
4987
4811
|
setTimeout(() => {
|
|
4988
4812
|
n.focus();
|
|
@@ -5001,21 +4825,21 @@ function ga(e) {
|
|
|
5001
4825
|
}, 100);
|
|
5002
4826
|
});
|
|
5003
4827
|
}
|
|
5004
|
-
function
|
|
4828
|
+
function Qa(e) {
|
|
5005
4829
|
const t = e.getHTML();
|
|
5006
|
-
return t ? (
|
|
4830
|
+
return t ? (Ya(t), !0) : !1;
|
|
5007
4831
|
}
|
|
5008
|
-
const
|
|
4832
|
+
const po = A.create({
|
|
5009
4833
|
name: "exportPdf",
|
|
5010
4834
|
addOptions() {
|
|
5011
4835
|
var e;
|
|
5012
4836
|
return {
|
|
5013
4837
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
5014
4838
|
button: ({ editor: t, t: n }) => ({
|
|
5015
|
-
component:
|
|
4839
|
+
component: p,
|
|
5016
4840
|
componentProps: {
|
|
5017
4841
|
action: () => {
|
|
5018
|
-
|
|
4842
|
+
Qa(t);
|
|
5019
4843
|
},
|
|
5020
4844
|
icon: "ExportPdf",
|
|
5021
4845
|
tooltip: n("editor.exportPdf.tooltip"),
|
|
@@ -5026,99 +4850,99 @@ const jo = N.create({
|
|
|
5026
4850
|
};
|
|
5027
4851
|
}
|
|
5028
4852
|
});
|
|
5029
|
-
function
|
|
5030
|
-
const n = atob(e.split(",")[1]),
|
|
4853
|
+
function Xa(e, t) {
|
|
4854
|
+
const n = atob(e.split(",")[1]), a = Array.from({ length: n.length });
|
|
5031
4855
|
for (let o = 0; o < n.length; o++)
|
|
5032
|
-
|
|
5033
|
-
const
|
|
5034
|
-
return new Blob([
|
|
4856
|
+
a[o] = n.charCodeAt(o);
|
|
4857
|
+
const i = new Uint8Array(a);
|
|
4858
|
+
return new Blob([i], { type: t });
|
|
5035
4859
|
}
|
|
5036
|
-
function
|
|
4860
|
+
function ei(e, t) {
|
|
5037
4861
|
return new File([e], t, { type: e.type });
|
|
5038
4862
|
}
|
|
5039
|
-
function
|
|
5040
|
-
const { toast: t } =
|
|
5041
|
-
function
|
|
5042
|
-
var
|
|
5043
|
-
(
|
|
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();
|
|
5044
4868
|
}
|
|
5045
|
-
function
|
|
5046
|
-
const
|
|
5047
|
-
if (
|
|
5048
|
-
if (
|
|
4869
|
+
function l(h) {
|
|
4870
|
+
const _ = h.target.files[0];
|
|
4871
|
+
if (_) {
|
|
4872
|
+
if (_.size > e.limit) {
|
|
5049
4873
|
t({
|
|
5050
4874
|
variant: "destructive",
|
|
5051
4875
|
title: n("editor.importWord.limitSize")
|
|
5052
4876
|
});
|
|
5053
4877
|
return;
|
|
5054
4878
|
}
|
|
5055
|
-
d(
|
|
4879
|
+
d(_);
|
|
5056
4880
|
}
|
|
5057
4881
|
}
|
|
5058
|
-
async function h
|
|
5059
|
-
var
|
|
5060
|
-
const
|
|
4882
|
+
async function u(h) {
|
|
4883
|
+
var L;
|
|
4884
|
+
const f = new DOMParser().parseFromString(h, "text/html"), w = f.querySelectorAll("img");
|
|
5061
4885
|
if (w.length === 0)
|
|
5062
|
-
return
|
|
5063
|
-
if (
|
|
5064
|
-
const E = (
|
|
4886
|
+
return f.body.innerHTML;
|
|
4887
|
+
if (An(e.editor, "image")) {
|
|
4888
|
+
const E = (L = e.editor.extensionManager.extensions.find(
|
|
5065
4889
|
(g) => g.name === "importWord"
|
|
5066
|
-
)) == null ? void 0 :
|
|
4890
|
+
)) == null ? void 0 : L.options;
|
|
5067
4891
|
if (E && typeof E.upload == "function") {
|
|
5068
4892
|
const g = [];
|
|
5069
|
-
for (const
|
|
5070
|
-
const H =
|
|
4893
|
+
for (const v of w) {
|
|
4894
|
+
const H = v.getAttribute("src"), S = Xa(H, "image/jpeg"), O = ei(S, "image.jpeg");
|
|
5071
4895
|
g.push(O);
|
|
5072
4896
|
}
|
|
5073
4897
|
const b = await E.upload(g);
|
|
5074
|
-
for (const [
|
|
5075
|
-
H.setAttribute("src", b[
|
|
5076
|
-
const
|
|
5077
|
-
(
|
|
4898
|
+
for (const [v, H] of w.entries()) {
|
|
4899
|
+
H.setAttribute("src", b[v].src);
|
|
4900
|
+
const S = H.parentElement;
|
|
4901
|
+
(S == null ? void 0 : S.tagName) === "P" && (S.insertAdjacentElement("beforebegin", H), !S.hasChildNodes() && S.textContent === "" && S.remove());
|
|
5078
4902
|
}
|
|
5079
|
-
return
|
|
4903
|
+
return f.body.innerHTML;
|
|
5080
4904
|
} else
|
|
5081
|
-
return console.warn("Image Upload method found, skip image conversion"),
|
|
4905
|
+
return console.warn("Image Upload method found, skip image conversion"), f.body.innerHTML;
|
|
5082
4906
|
} else
|
|
5083
|
-
return console.error("Image extension not found, unable to convert image"),
|
|
4907
|
+
return console.error("Image extension not found, unable to convert image"), f.body.innerHTML;
|
|
5084
4908
|
}
|
|
5085
|
-
async function d(
|
|
5086
|
-
|
|
4909
|
+
async function d(h) {
|
|
4910
|
+
i(!0);
|
|
5087
4911
|
try {
|
|
5088
4912
|
if (e.convert) {
|
|
5089
|
-
const
|
|
5090
|
-
|
|
4913
|
+
const _ = await e.convert(h);
|
|
4914
|
+
c(_);
|
|
5091
4915
|
} else {
|
|
5092
|
-
const
|
|
5093
|
-
{ arrayBuffer:
|
|
4916
|
+
const _ = await h.arrayBuffer(), { value: f } = await Yt.convertToHtml(
|
|
4917
|
+
{ arrayBuffer: _ },
|
|
5094
4918
|
e == null ? void 0 : e.mammothOptions
|
|
5095
4919
|
);
|
|
5096
|
-
|
|
4920
|
+
c(f);
|
|
5097
4921
|
}
|
|
5098
4922
|
} finally {
|
|
5099
|
-
|
|
4923
|
+
i(!1);
|
|
5100
4924
|
}
|
|
5101
4925
|
}
|
|
5102
|
-
async function
|
|
5103
|
-
const
|
|
5104
|
-
e.editor.chain().setContent(
|
|
4926
|
+
async function c(h) {
|
|
4927
|
+
const _ = await u(h);
|
|
4928
|
+
e.editor.chain().setContent(_, !0).run();
|
|
5105
4929
|
}
|
|
5106
4930
|
return /* @__PURE__ */ m("div", { children: [
|
|
5107
|
-
/* @__PURE__ */
|
|
5108
|
-
|
|
4931
|
+
/* @__PURE__ */ s(
|
|
4932
|
+
p,
|
|
5109
4933
|
{
|
|
5110
|
-
action:
|
|
4934
|
+
action: r,
|
|
5111
4935
|
disabled: e == null ? void 0 : e.disabled,
|
|
5112
4936
|
icon: e == null ? void 0 : e.icon,
|
|
5113
|
-
loading:
|
|
4937
|
+
loading: a,
|
|
5114
4938
|
tooltip: e == null ? void 0 : e.tooltip
|
|
5115
4939
|
}
|
|
5116
4940
|
),
|
|
5117
|
-
/* @__PURE__ */
|
|
4941
|
+
/* @__PURE__ */ s(
|
|
5118
4942
|
"input",
|
|
5119
4943
|
{
|
|
5120
4944
|
accept: ".docx",
|
|
5121
|
-
onChange:
|
|
4945
|
+
onChange: l,
|
|
5122
4946
|
ref: o,
|
|
5123
4947
|
type: "file",
|
|
5124
4948
|
style: {
|
|
@@ -5128,7 +4952,7 @@ function pa(e) {
|
|
|
5128
4952
|
)
|
|
5129
4953
|
] });
|
|
5130
4954
|
}
|
|
5131
|
-
const
|
|
4955
|
+
const wo = A.create({
|
|
5132
4956
|
name: "importWord",
|
|
5133
4957
|
addOptions() {
|
|
5134
4958
|
var e;
|
|
@@ -5138,34 +4962,34 @@ const Do = N.create({
|
|
|
5138
4962
|
convert: void 0,
|
|
5139
4963
|
limit: 1024 * 1024 * 10,
|
|
5140
4964
|
// 10 MB
|
|
5141
|
-
button: ({ editor: t, extension: n, t:
|
|
5142
|
-
const { convert:
|
|
4965
|
+
button: ({ editor: t, extension: n, t: a }) => {
|
|
4966
|
+
const { convert: i, limit: o, mammothOptions: r } = n.options;
|
|
5143
4967
|
return {
|
|
5144
|
-
component:
|
|
4968
|
+
component: ti,
|
|
5145
4969
|
componentProps: {
|
|
5146
4970
|
editor: t,
|
|
5147
|
-
convert:
|
|
4971
|
+
convert: i,
|
|
5148
4972
|
limit: o,
|
|
5149
|
-
mammothOptions:
|
|
4973
|
+
mammothOptions: r,
|
|
5150
4974
|
action: () => t.commands.setHorizontalRule(),
|
|
5151
4975
|
disabled: !t.can().setHorizontalRule(),
|
|
5152
4976
|
icon: "Word",
|
|
5153
4977
|
shortcutKeys: ["alt", "mod", "S"],
|
|
5154
|
-
tooltip:
|
|
4978
|
+
tooltip: a("editor.importWord.tooltip")
|
|
5155
4979
|
}
|
|
5156
4980
|
};
|
|
5157
4981
|
}
|
|
5158
4982
|
};
|
|
5159
4983
|
}
|
|
5160
|
-
}),
|
|
5161
|
-
function
|
|
5162
|
-
if (
|
|
5163
|
-
const n = window.URL.createObjectURL(e),
|
|
5164
|
-
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();
|
|
5165
4989
|
}
|
|
5166
4990
|
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
5167
4991
|
}
|
|
5168
|
-
const
|
|
4992
|
+
const ii = {
|
|
5169
4993
|
...U,
|
|
5170
4994
|
hardBreak: U.hard_break,
|
|
5171
4995
|
codeBlock: U.code_block,
|
|
@@ -5182,19 +5006,19 @@ const va = {
|
|
|
5182
5006
|
tableOptions: {
|
|
5183
5007
|
width: {
|
|
5184
5008
|
size: 100,
|
|
5185
|
-
type:
|
|
5009
|
+
type: Dn.PERCENTAGE
|
|
5186
5010
|
}
|
|
5187
5011
|
}
|
|
5188
5012
|
});
|
|
5189
5013
|
}
|
|
5190
|
-
},
|
|
5014
|
+
}, oi = new On(ii, $n), yo = A.create({
|
|
5191
5015
|
name: "exportWord",
|
|
5192
5016
|
addOptions() {
|
|
5193
5017
|
var e;
|
|
5194
5018
|
return {
|
|
5195
5019
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
5196
5020
|
button: ({ editor: t, t: n }) => ({
|
|
5197
|
-
component:
|
|
5021
|
+
component: p,
|
|
5198
5022
|
componentProps: {
|
|
5199
5023
|
icon: "ExportWord",
|
|
5200
5024
|
action: () => {
|
|
@@ -5212,48 +5036,48 @@ const va = {
|
|
|
5212
5036
|
return {
|
|
5213
5037
|
exportToWord: () => async ({ editor: e }) => {
|
|
5214
5038
|
const t = {
|
|
5215
|
-
getImageBuffer: async (
|
|
5216
|
-
const o = await (await fetch(
|
|
5039
|
+
getImageBuffer: async (a) => {
|
|
5040
|
+
const o = await (await fetch(a)).arrayBuffer();
|
|
5217
5041
|
return new Uint8Array(o);
|
|
5218
5042
|
}
|
|
5219
|
-
}, n =
|
|
5220
|
-
return
|
|
5043
|
+
}, n = oi.serialize(e.state.doc, t);
|
|
5044
|
+
return Bn.toBlob(n).then((a) => ai(new Blob([a]), "export-document.docx")), !0;
|
|
5221
5045
|
}
|
|
5222
5046
|
};
|
|
5223
5047
|
}
|
|
5224
|
-
}),
|
|
5225
|
-
toc:
|
|
5226
|
-
visible:
|
|
5227
|
-
list:
|
|
5228
|
-
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
|
|
5229
5053
|
};
|
|
5230
|
-
function
|
|
5054
|
+
function di(e) {
|
|
5231
5055
|
const t = [], n = [t];
|
|
5232
|
-
return e.forEach((
|
|
5233
|
-
let
|
|
5056
|
+
return e.forEach((a) => {
|
|
5057
|
+
let i = -1, o = n[a.level + i];
|
|
5234
5058
|
for (; !o; )
|
|
5235
|
-
|
|
5236
|
-
o.push({ ...
|
|
5059
|
+
i -= 1, o = n[a.level + i];
|
|
5060
|
+
o.push({ ...a, children: n[a.level] = [] });
|
|
5237
5061
|
}), t;
|
|
5238
5062
|
}
|
|
5239
|
-
function
|
|
5240
|
-
const t =
|
|
5241
|
-
const
|
|
5242
|
-
e.state.doc.descendants((
|
|
5243
|
-
if (
|
|
5244
|
-
const
|
|
5245
|
-
|
|
5246
|
-
...
|
|
5247
|
-
id:
|
|
5248
|
-
}),
|
|
5249
|
-
level:
|
|
5250
|
-
text:
|
|
5251
|
-
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
|
|
5252
5076
|
});
|
|
5253
5077
|
}
|
|
5254
|
-
}),
|
|
5078
|
+
}), l.setMeta("addToHistory", !1), l.setMeta("preventUpdate", !0), e.view.dispatch(l), a(r), e.eventEmitter && e.eventEmitter.emit("TableOfContents", di(r));
|
|
5255
5079
|
}, [e]);
|
|
5256
|
-
return
|
|
5080
|
+
return z(() => {
|
|
5257
5081
|
if (e) {
|
|
5258
5082
|
if (!e.options.editable) {
|
|
5259
5083
|
o();
|
|
@@ -5263,62 +5087,62 @@ function Ea({ editor: e }) {
|
|
|
5263
5087
|
e.off("update", o);
|
|
5264
5088
|
};
|
|
5265
5089
|
}
|
|
5266
|
-
}, [e, o]),
|
|
5090
|
+
}, [e, o]), z(() => {
|
|
5267
5091
|
o();
|
|
5268
|
-
}, []), /* @__PURE__ */
|
|
5269
|
-
/* @__PURE__ */
|
|
5270
|
-
/* @__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(
|
|
5271
5095
|
"li",
|
|
5272
5096
|
{
|
|
5273
|
-
className:
|
|
5274
|
-
style: { paddingLeft: `${
|
|
5275
|
-
children: /* @__PURE__ */
|
|
5097
|
+
className: _e.item,
|
|
5098
|
+
style: { paddingLeft: `${r.level - 1}rem` },
|
|
5099
|
+
children: /* @__PURE__ */ s("a", { href: `#${r.id}`, children: r.text })
|
|
5276
5100
|
},
|
|
5277
|
-
`table-of-content-${
|
|
5101
|
+
`table-of-content-${l}`
|
|
5278
5102
|
)) })
|
|
5279
5103
|
] }) : null });
|
|
5280
5104
|
}
|
|
5281
|
-
function
|
|
5282
|
-
const [n,
|
|
5283
|
-
return
|
|
5284
|
-
const
|
|
5285
|
-
|
|
5105
|
+
function mi(e, ...t) {
|
|
5106
|
+
const [n, a] = C(!1);
|
|
5107
|
+
return z(() => {
|
|
5108
|
+
const i = () => {
|
|
5109
|
+
a(e.isActive.apply(e, t));
|
|
5286
5110
|
};
|
|
5287
|
-
return e.on("selectionUpdate",
|
|
5288
|
-
e.off("selectionUpdate",
|
|
5111
|
+
return e.on("selectionUpdate", i), e.on("transaction", i), () => {
|
|
5112
|
+
e.off("selectionUpdate", i), e.off("transaction", i);
|
|
5289
5113
|
};
|
|
5290
|
-
}, [e, t,
|
|
5114
|
+
}, [e, t, a]), n;
|
|
5291
5115
|
}
|
|
5292
|
-
function
|
|
5293
|
-
const
|
|
5294
|
-
if (
|
|
5116
|
+
function hi({ editor: e, icon: t, tooltip: n }) {
|
|
5117
|
+
const a = mi(e, gi.name), i = F(() => {
|
|
5118
|
+
if (a) {
|
|
5295
5119
|
e.chain().focus().removeTableOfContents().run();
|
|
5296
5120
|
return;
|
|
5297
5121
|
}
|
|
5298
5122
|
e.chain().focus().setTableOfContents().run();
|
|
5299
|
-
}, [e,
|
|
5300
|
-
return /* @__PURE__ */
|
|
5301
|
-
|
|
5123
|
+
}, [e, a]);
|
|
5124
|
+
return /* @__PURE__ */ s(
|
|
5125
|
+
p,
|
|
5302
5126
|
{
|
|
5303
|
-
action:
|
|
5304
|
-
isActive: () =>
|
|
5127
|
+
action: i,
|
|
5128
|
+
isActive: () => a || !1,
|
|
5305
5129
|
icon: t,
|
|
5306
5130
|
tooltip: n
|
|
5307
5131
|
}
|
|
5308
5132
|
);
|
|
5309
5133
|
}
|
|
5310
|
-
function
|
|
5134
|
+
function _i(e) {
|
|
5311
5135
|
return e && e.type.name === "title";
|
|
5312
5136
|
}
|
|
5313
|
-
function
|
|
5314
|
-
const
|
|
5315
|
-
for (;
|
|
5316
|
-
const o =
|
|
5317
|
-
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);
|
|
5318
5142
|
}
|
|
5319
|
-
return
|
|
5143
|
+
return i;
|
|
5320
5144
|
}
|
|
5321
|
-
const
|
|
5145
|
+
const gi = ge.create({
|
|
5322
5146
|
name: "tableOfContents",
|
|
5323
5147
|
group: "block",
|
|
5324
5148
|
atom: !0,
|
|
@@ -5332,7 +5156,7 @@ const Pa = we.create({
|
|
|
5332
5156
|
lastColumnResizable: !0,
|
|
5333
5157
|
allowTableNodeSelection: !1,
|
|
5334
5158
|
button: ({ editor: t, t: n }) => ({
|
|
5335
|
-
component:
|
|
5159
|
+
component: hi,
|
|
5336
5160
|
componentProps: {
|
|
5337
5161
|
disabled: !1,
|
|
5338
5162
|
icon: "BookMarked",
|
|
@@ -5350,22 +5174,22 @@ const Pa = we.create({
|
|
|
5350
5174
|
];
|
|
5351
5175
|
},
|
|
5352
5176
|
renderHTML({ HTMLAttributes: e }) {
|
|
5353
|
-
return ["toc",
|
|
5177
|
+
return ["toc", be(e)];
|
|
5354
5178
|
},
|
|
5355
5179
|
addNodeView() {
|
|
5356
|
-
return
|
|
5180
|
+
return Se(ui);
|
|
5357
5181
|
},
|
|
5358
5182
|
// @ts-expect-error
|
|
5359
5183
|
addCommands() {
|
|
5360
5184
|
return {
|
|
5361
5185
|
setTableOfContents: () => ({ commands: e, editor: t, view: n }) => {
|
|
5362
|
-
if (
|
|
5186
|
+
if (fi(t, this.name).length > 0) {
|
|
5363
5187
|
this.options.onHasOneBeforeInsert();
|
|
5364
5188
|
return;
|
|
5365
5189
|
}
|
|
5366
|
-
const
|
|
5367
|
-
if (
|
|
5368
|
-
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;
|
|
5369
5193
|
return e.insertContentAt(o, { type: this.name });
|
|
5370
5194
|
}
|
|
5371
5195
|
return e.insertContent({
|
|
@@ -5373,11 +5197,11 @@ const Pa = we.create({
|
|
|
5373
5197
|
});
|
|
5374
5198
|
},
|
|
5375
5199
|
removeTableOfContents: () => ({ state: e, dispatch: t }) => {
|
|
5376
|
-
const { tr: n } = e,
|
|
5377
|
-
return e.doc.descendants((
|
|
5378
|
-
if (
|
|
5379
|
-
const
|
|
5380
|
-
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);
|
|
5381
5205
|
}
|
|
5382
5206
|
}), n.docChanged ? (t(n), !0) : !1;
|
|
5383
5207
|
}
|
|
@@ -5396,37 +5220,37 @@ const Pa = we.create({
|
|
|
5396
5220
|
];
|
|
5397
5221
|
}
|
|
5398
5222
|
});
|
|
5399
|
-
function
|
|
5223
|
+
function bi(e) {
|
|
5400
5224
|
var n;
|
|
5401
|
-
const t =
|
|
5225
|
+
const t = R(() => {
|
|
5402
5226
|
var o;
|
|
5403
|
-
const
|
|
5404
|
-
return
|
|
5405
|
-
...
|
|
5406
|
-
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
|
|
5407
5231
|
} : {
|
|
5408
5232
|
title: e == null ? void 0 : e.tooltip,
|
|
5409
5233
|
icon: e.icon,
|
|
5410
5234
|
isActive: () => !1
|
|
5411
5235
|
};
|
|
5412
5236
|
}, [e]);
|
|
5413
|
-
return /* @__PURE__ */ m(
|
|
5414
|
-
/* @__PURE__ */
|
|
5415
|
-
|
|
5237
|
+
return /* @__PURE__ */ m(ce, { modal: !0, children: [
|
|
5238
|
+
/* @__PURE__ */ s(
|
|
5239
|
+
de,
|
|
5416
5240
|
{
|
|
5417
5241
|
asChild: !0,
|
|
5418
5242
|
disabled: e == null ? void 0 : e.disabled,
|
|
5419
|
-
children: /* @__PURE__ */
|
|
5420
|
-
|
|
5243
|
+
children: /* @__PURE__ */ s(
|
|
5244
|
+
p,
|
|
5421
5245
|
{
|
|
5422
|
-
customClass: "!
|
|
5246
|
+
customClass: "!w-12 h-12",
|
|
5423
5247
|
disabled: e == null ? void 0 : e.disabled,
|
|
5424
5248
|
icon: e == null ? void 0 : e.icon,
|
|
5425
5249
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
5426
|
-
children: /* @__PURE__ */
|
|
5427
|
-
|
|
5250
|
+
children: /* @__PURE__ */ s(
|
|
5251
|
+
M,
|
|
5428
5252
|
{
|
|
5429
|
-
className: "
|
|
5253
|
+
className: "ml-1 size-3 text-zinc-500",
|
|
5430
5254
|
name: "MenuDown"
|
|
5431
5255
|
}
|
|
5432
5256
|
)
|
|
@@ -5434,37 +5258,37 @@ function Ia(e) {
|
|
|
5434
5258
|
)
|
|
5435
5259
|
}
|
|
5436
5260
|
),
|
|
5437
|
-
/* @__PURE__ */
|
|
5438
|
-
|
|
5261
|
+
/* @__PURE__ */ s(
|
|
5262
|
+
ue,
|
|
5439
5263
|
{
|
|
5440
5264
|
align: "start",
|
|
5441
|
-
className: "
|
|
5265
|
+
className: "flex w-full min-w-4 flex-row gap-1 !p-[4px]",
|
|
5442
5266
|
side: "bottom",
|
|
5443
|
-
children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((
|
|
5444
|
-
var o,
|
|
5445
|
-
return /* @__PURE__ */ m(
|
|
5446
|
-
/* @__PURE__ */
|
|
5447
|
-
|
|
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
|
+
Be,
|
|
5448
5272
|
{
|
|
5449
|
-
className: "
|
|
5450
|
-
"data-state": t.title ===
|
|
5451
|
-
onClick:
|
|
5452
|
-
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,
|
|
5453
5277
|
size: "sm",
|
|
5454
|
-
children: (
|
|
5278
|
+
children: (a == null ? void 0 : a.icon) && /* @__PURE__ */ s(M, { name: a.icon })
|
|
5455
5279
|
}
|
|
5456
5280
|
) }),
|
|
5457
|
-
/* @__PURE__ */ m(
|
|
5458
|
-
/* @__PURE__ */
|
|
5459
|
-
!!((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(" ") })
|
|
5460
5284
|
] })
|
|
5461
|
-
] }, `text-align-${
|
|
5285
|
+
] }, `text-align-${i}`);
|
|
5462
5286
|
})
|
|
5463
5287
|
}
|
|
5464
5288
|
)
|
|
5465
5289
|
] });
|
|
5466
5290
|
}
|
|
5467
|
-
const
|
|
5291
|
+
const ko = A.create({
|
|
5468
5292
|
name: "text-direction",
|
|
5469
5293
|
addOptions() {
|
|
5470
5294
|
var e;
|
|
@@ -5476,34 +5300,34 @@ const $o = N.create({
|
|
|
5476
5300
|
button({
|
|
5477
5301
|
editor: t,
|
|
5478
5302
|
extension: n,
|
|
5479
|
-
t:
|
|
5303
|
+
t: a
|
|
5480
5304
|
}) {
|
|
5481
|
-
var
|
|
5482
|
-
const
|
|
5305
|
+
var u;
|
|
5306
|
+
const i = ((u = n.options) == null ? void 0 : u.directions) || [], o = {
|
|
5483
5307
|
auto: "TextDirection",
|
|
5484
5308
|
ltr: "LeftToRight",
|
|
5485
5309
|
rtl: "RightToLeft"
|
|
5486
|
-
},
|
|
5487
|
-
title:
|
|
5310
|
+
}, r = i.map((d) => ({
|
|
5311
|
+
title: a(`editor.textDirection.${d}.tooltip`),
|
|
5488
5312
|
icon: o[d],
|
|
5489
5313
|
isActive: () => !1,
|
|
5490
5314
|
action: () => {
|
|
5491
|
-
var
|
|
5315
|
+
var c, h, _, f;
|
|
5492
5316
|
if (d === "auto") {
|
|
5493
|
-
(
|
|
5317
|
+
(h = (c = t.commands) == null ? void 0 : c.unsetTextDirection) == null || h.call(c);
|
|
5494
5318
|
return;
|
|
5495
5319
|
}
|
|
5496
|
-
(
|
|
5320
|
+
(f = (_ = t.commands) == null ? void 0 : _.setTextDirection) == null || f.call(_, d);
|
|
5497
5321
|
},
|
|
5498
5322
|
disabled: !1
|
|
5499
|
-
})),
|
|
5323
|
+
})), l = r.filter((d) => d.disabled).length === r.length;
|
|
5500
5324
|
return {
|
|
5501
|
-
component:
|
|
5325
|
+
component: bi,
|
|
5502
5326
|
componentProps: {
|
|
5503
5327
|
icon: "TextDirection",
|
|
5504
|
-
tooltip:
|
|
5505
|
-
disabled:
|
|
5506
|
-
items:
|
|
5328
|
+
tooltip: a("editor.textDirection.tooltip"),
|
|
5329
|
+
disabled: l,
|
|
5330
|
+
items: r
|
|
5507
5331
|
}
|
|
5508
5332
|
};
|
|
5509
5333
|
}
|
|
@@ -5530,38 +5354,38 @@ const $o = N.create({
|
|
|
5530
5354
|
unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
|
|
5531
5355
|
};
|
|
5532
5356
|
}
|
|
5533
|
-
}),
|
|
5534
|
-
listUsers:
|
|
5535
|
-
itemUser:
|
|
5536
|
-
selectedUser:
|
|
5537
|
-
},
|
|
5538
|
-
const n = G(null), [
|
|
5539
|
-
const
|
|
5540
|
-
|
|
5541
|
-
},
|
|
5542
|
-
|
|
5543
|
-
},
|
|
5544
|
-
|
|
5545
|
-
},
|
|
5546
|
-
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);
|
|
5547
5371
|
};
|
|
5548
|
-
return
|
|
5549
|
-
if (Number.isNaN(
|
|
5372
|
+
return z(() => i(0), [e.items]), z(() => {
|
|
5373
|
+
if (Number.isNaN(a + 1))
|
|
5550
5374
|
return;
|
|
5551
|
-
const d = n.current.querySelector(`span:nth-of-type(${
|
|
5552
|
-
d &&
|
|
5553
|
-
}, [
|
|
5554
|
-
onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (
|
|
5555
|
-
})), /* @__PURE__ */
|
|
5375
|
+
const d = n.current.querySelector(`span:nth-of-type(${a + 1})`);
|
|
5376
|
+
d && Oe(d, { behavior: "smooth", scrollMode: "if-needed" });
|
|
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(
|
|
5556
5380
|
"span",
|
|
5557
5381
|
{
|
|
5558
|
-
className:
|
|
5559
|
-
onClick: () => o(
|
|
5382
|
+
className: P("itemUser", fe.itemUser, c === a ? fe.selectedUser : ""),
|
|
5383
|
+
onClick: () => o(c),
|
|
5560
5384
|
children: d
|
|
5561
5385
|
},
|
|
5562
|
-
|
|
5563
|
-
)) : /* @__PURE__ */
|
|
5564
|
-
}),
|
|
5386
|
+
c
|
|
5387
|
+
)) : /* @__PURE__ */ s("div", { className: P("itemUserEmpty", fe.itemUser), children: "Empty" }) }) });
|
|
5388
|
+
}), vi = [
|
|
5565
5389
|
{
|
|
5566
5390
|
id: "1",
|
|
5567
5391
|
name: "John Doe"
|
|
@@ -5578,16 +5402,16 @@ const $o = N.create({
|
|
|
5578
5402
|
id: "4",
|
|
5579
5403
|
name: "Bob"
|
|
5580
5404
|
}
|
|
5581
|
-
],
|
|
5582
|
-
items: async ({ query: e }) =>
|
|
5405
|
+
], xi = {
|
|
5406
|
+
items: async ({ query: e }) => vi.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
|
|
5583
5407
|
render: () => {
|
|
5584
5408
|
let e, t;
|
|
5585
5409
|
return {
|
|
5586
5410
|
onStart: (n) => {
|
|
5587
|
-
e = new
|
|
5411
|
+
e = new Te(ki, {
|
|
5588
5412
|
props: n,
|
|
5589
5413
|
editor: n.editor
|
|
5590
|
-
}), t =
|
|
5414
|
+
}), t = De("body", {
|
|
5591
5415
|
getReferenceClientRect: n.clientRect,
|
|
5592
5416
|
appendTo: () => document.body,
|
|
5593
5417
|
content: e.element,
|
|
@@ -5603,24 +5427,24 @@ const $o = N.create({
|
|
|
5603
5427
|
});
|
|
5604
5428
|
},
|
|
5605
5429
|
onKeyDown(n) {
|
|
5606
|
-
var
|
|
5607
|
-
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);
|
|
5608
5432
|
},
|
|
5609
5433
|
onExit() {
|
|
5610
5434
|
t[0].destroy(), e.destroy();
|
|
5611
5435
|
}
|
|
5612
5436
|
};
|
|
5613
5437
|
}
|
|
5614
|
-
},
|
|
5438
|
+
}, vo = Wt.extend({
|
|
5615
5439
|
addAttributes() {
|
|
5616
5440
|
return {
|
|
5617
5441
|
id: {
|
|
5618
5442
|
default: "",
|
|
5619
|
-
parseHTML:
|
|
5443
|
+
parseHTML: B("id")
|
|
5620
5444
|
},
|
|
5621
5445
|
label: {
|
|
5622
5446
|
default: "",
|
|
5623
|
-
parseHTML:
|
|
5447
|
+
parseHTML: B("label")
|
|
5624
5448
|
}
|
|
5625
5449
|
};
|
|
5626
5450
|
}
|
|
@@ -5628,8 +5452,8 @@ const $o = N.create({
|
|
|
5628
5452
|
HTMLAttributes: {
|
|
5629
5453
|
class: "mention"
|
|
5630
5454
|
},
|
|
5631
|
-
suggestion:
|
|
5632
|
-
}),
|
|
5455
|
+
suggestion: xi
|
|
5456
|
+
}), Ci = {
|
|
5633
5457
|
audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
|
|
5634
5458
|
video: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',
|
|
5635
5459
|
file: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',
|
|
@@ -5657,79 +5481,79 @@ const $o = N.create({
|
|
|
5657
5481
|
excel: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',
|
|
5658
5482
|
ppt: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'
|
|
5659
5483
|
};
|
|
5660
|
-
function
|
|
5661
|
-
const t =
|
|
5484
|
+
function Ni(e) {
|
|
5485
|
+
const t = Ci[e], i = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
|
|
5662
5486
|
"svg",
|
|
5663
5487
|
{
|
|
5664
|
-
...Array.from(
|
|
5488
|
+
...Array.from(i.attributes).reduce((r, l) => (r[l.name] = l.value, r), {})
|
|
5665
5489
|
}
|
|
5666
5490
|
];
|
|
5667
|
-
return Array.from(
|
|
5668
|
-
if (
|
|
5669
|
-
const
|
|
5670
|
-
|
|
5671
|
-
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), {})
|
|
5672
5496
|
];
|
|
5673
|
-
|
|
5497
|
+
r.textContent && l.push(r.textContent), o.push(l);
|
|
5674
5498
|
}
|
|
5675
5499
|
}), o;
|
|
5676
5500
|
}
|
|
5677
|
-
const
|
|
5678
|
-
audio: /* @__PURE__ */
|
|
5679
|
-
video: /* @__PURE__ */
|
|
5680
|
-
file: /* @__PURE__ */
|
|
5681
|
-
image: /* @__PURE__ */
|
|
5682
|
-
pdf: /* @__PURE__ */
|
|
5683
|
-
word: /* @__PURE__ */
|
|
5684
|
-
excel: /* @__PURE__ */
|
|
5685
|
-
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, {})
|
|
5686
5510
|
};
|
|
5687
|
-
function
|
|
5688
|
-
const n =
|
|
5689
|
-
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;
|
|
5690
5514
|
}
|
|
5691
|
-
const
|
|
5692
|
-
wrap:
|
|
5515
|
+
const Li = "_wrap_1x1ms_2", Ne = {
|
|
5516
|
+
wrap: Li
|
|
5693
5517
|
};
|
|
5694
|
-
function
|
|
5518
|
+
function Si({ editor: e, node: t, updateAttributes: n, deleteNode: a, extension: i }) {
|
|
5695
5519
|
var H;
|
|
5696
|
-
const o = G(null),
|
|
5697
|
-
!
|
|
5698
|
-
}, [
|
|
5699
|
-
async (
|
|
5700
|
-
const O =
|
|
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
|
+
async (S) => {
|
|
5524
|
+
const O = S.target.files && S.target.files[0];
|
|
5701
5525
|
if (!O)
|
|
5702
5526
|
return;
|
|
5703
|
-
const
|
|
5704
|
-
fileName:
|
|
5527
|
+
const _t = {
|
|
5528
|
+
fileName: Hn(O.name),
|
|
5705
5529
|
fileSize: O.size,
|
|
5706
5530
|
fileType: O.type,
|
|
5707
|
-
fileExt:
|
|
5531
|
+
fileExt: En(O.name)
|
|
5708
5532
|
};
|
|
5709
|
-
|
|
5533
|
+
y(!0);
|
|
5710
5534
|
try {
|
|
5711
|
-
const
|
|
5712
|
-
n({ ...
|
|
5713
|
-
} catch (
|
|
5714
|
-
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 = "";
|
|
5715
5539
|
}
|
|
5716
5540
|
},
|
|
5717
|
-
[
|
|
5541
|
+
[y, n]
|
|
5718
5542
|
);
|
|
5719
|
-
|
|
5720
|
-
!
|
|
5721
|
-
}, [
|
|
5722
|
-
const
|
|
5723
|
-
return
|
|
5724
|
-
/* @__PURE__ */
|
|
5543
|
+
z(() => {
|
|
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(
|
|
5725
5549
|
"p",
|
|
5726
5550
|
{
|
|
5727
5551
|
onClick: g,
|
|
5728
5552
|
style: { cursor: "pointer" },
|
|
5729
|
-
children: w ? /* @__PURE__ */
|
|
5553
|
+
children: w ? /* @__PURE__ */ s("span", { children: L("editor.attachment.uploading") }) : /* @__PURE__ */ s("span", { children: L("editor.attachment.please_upload") })
|
|
5730
5554
|
}
|
|
5731
5555
|
),
|
|
5732
|
-
/* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ s(
|
|
5733
5557
|
"input",
|
|
5734
5558
|
{
|
|
5735
5559
|
hidden: !0,
|
|
@@ -5738,45 +5562,45 @@ function Wa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
|
|
|
5738
5562
|
type: "file"
|
|
5739
5563
|
}
|
|
5740
5564
|
)
|
|
5741
|
-
] }) }) :
|
|
5565
|
+
] }) }) : _ ? /* @__PURE__ */ s(se, { children: /* @__PURE__ */ m(
|
|
5742
5566
|
"div",
|
|
5743
5567
|
{
|
|
5744
|
-
className:
|
|
5568
|
+
className: P(Ne.wrap, "render-wrapper"),
|
|
5745
5569
|
onClick: g,
|
|
5746
5570
|
children: [
|
|
5747
|
-
/* @__PURE__ */ m("div", { className: "
|
|
5748
|
-
/* @__PURE__ */
|
|
5571
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-[4px]", children: [
|
|
5572
|
+
/* @__PURE__ */ s("span", { children: ht(h) }),
|
|
5749
5573
|
/* @__PURE__ */ m("span", { children: [
|
|
5750
|
-
|
|
5574
|
+
u,
|
|
5751
5575
|
".",
|
|
5752
|
-
|
|
5576
|
+
c
|
|
5753
5577
|
] }),
|
|
5754
5578
|
/* @__PURE__ */ m("span", { children: [
|
|
5755
5579
|
"(",
|
|
5756
|
-
|
|
5580
|
+
tt(d),
|
|
5757
5581
|
")"
|
|
5758
5582
|
] })
|
|
5759
5583
|
] }),
|
|
5760
|
-
/* @__PURE__ */
|
|
5761
|
-
|
|
5584
|
+
/* @__PURE__ */ s(
|
|
5585
|
+
p,
|
|
5762
5586
|
{
|
|
5763
|
-
action:
|
|
5587
|
+
action: v,
|
|
5764
5588
|
icon: "Trash2",
|
|
5765
|
-
tooltip:
|
|
5589
|
+
tooltip: L("editor.delete")
|
|
5766
5590
|
}
|
|
5767
5591
|
)
|
|
5768
5592
|
]
|
|
5769
5593
|
}
|
|
5770
|
-
) }) :
|
|
5594
|
+
) }) : f !== "null" ? /* @__PURE__ */ s(se, { children: /* @__PURE__ */ s(
|
|
5771
5595
|
"div",
|
|
5772
5596
|
{
|
|
5773
|
-
className:
|
|
5597
|
+
className: P(Ne.wrap, "render-wrapper"),
|
|
5774
5598
|
onClick: g,
|
|
5775
|
-
children: /* @__PURE__ */
|
|
5599
|
+
children: /* @__PURE__ */ s("p", { children: f })
|
|
5776
5600
|
}
|
|
5777
|
-
) }) : /* @__PURE__ */
|
|
5601
|
+
) }) : /* @__PURE__ */ s(pe, {});
|
|
5778
5602
|
}
|
|
5779
|
-
const
|
|
5603
|
+
const xo = ge.create({
|
|
5780
5604
|
name: "attachment",
|
|
5781
5605
|
content: "",
|
|
5782
5606
|
marks: "",
|
|
@@ -5792,7 +5616,7 @@ const Uo = we.create({
|
|
|
5792
5616
|
class: "attachment"
|
|
5793
5617
|
},
|
|
5794
5618
|
button: ({ editor: t, t: n }) => ({
|
|
5795
|
-
component:
|
|
5619
|
+
component: p,
|
|
5796
5620
|
componentProps: {
|
|
5797
5621
|
action: () => t.chain().focus().setAttachment().run(),
|
|
5798
5622
|
isActive: () => !1,
|
|
@@ -5810,13 +5634,13 @@ const Uo = we.create({
|
|
|
5810
5634
|
const {
|
|
5811
5635
|
url: t = "",
|
|
5812
5636
|
fileName: n = "",
|
|
5813
|
-
fileSize:
|
|
5814
|
-
fileType:
|
|
5637
|
+
fileSize: a = "",
|
|
5638
|
+
fileType: i = "",
|
|
5815
5639
|
fileExt: o = ""
|
|
5816
5640
|
} = e || {};
|
|
5817
5641
|
return [
|
|
5818
5642
|
"div",
|
|
5819
|
-
|
|
5643
|
+
be(
|
|
5820
5644
|
// @ts-expect-error
|
|
5821
5645
|
this.options.HTMLAttributes || {},
|
|
5822
5646
|
e || {}
|
|
@@ -5827,12 +5651,12 @@ const Uo = we.create({
|
|
|
5827
5651
|
[
|
|
5828
5652
|
"span",
|
|
5829
5653
|
{ class: "attachment__icon" },
|
|
5830
|
-
|
|
5654
|
+
ht(i, !0)
|
|
5831
5655
|
],
|
|
5832
5656
|
[
|
|
5833
5657
|
"span",
|
|
5834
5658
|
{ class: "attachment__text" },
|
|
5835
|
-
`${n}.${o} (${
|
|
5659
|
+
`${n}.${o} (${tt(a)})`
|
|
5836
5660
|
]
|
|
5837
5661
|
] : ["div", { class: "attachment__placeholder" }]
|
|
5838
5662
|
];
|
|
@@ -5841,31 +5665,31 @@ const Uo = we.create({
|
|
|
5841
5665
|
return {
|
|
5842
5666
|
fileName: {
|
|
5843
5667
|
default: null,
|
|
5844
|
-
parseHTML:
|
|
5668
|
+
parseHTML: B("filename")
|
|
5845
5669
|
},
|
|
5846
5670
|
fileSize: {
|
|
5847
5671
|
default: null,
|
|
5848
|
-
parseHTML:
|
|
5672
|
+
parseHTML: B("filesize")
|
|
5849
5673
|
},
|
|
5850
5674
|
fileType: {
|
|
5851
5675
|
default: null,
|
|
5852
|
-
parseHTML:
|
|
5676
|
+
parseHTML: B("filetype")
|
|
5853
5677
|
},
|
|
5854
5678
|
fileExt: {
|
|
5855
5679
|
default: null,
|
|
5856
|
-
parseHTML:
|
|
5680
|
+
parseHTML: B("fileext")
|
|
5857
5681
|
},
|
|
5858
5682
|
url: {
|
|
5859
5683
|
default: null,
|
|
5860
|
-
parseHTML:
|
|
5684
|
+
parseHTML: B("url")
|
|
5861
5685
|
},
|
|
5862
5686
|
hasTrigger: {
|
|
5863
5687
|
default: !1,
|
|
5864
|
-
parseHTML: (e) =>
|
|
5688
|
+
parseHTML: (e) => B("hastrigger")(e) === "true"
|
|
5865
5689
|
},
|
|
5866
5690
|
error: {
|
|
5867
5691
|
default: null,
|
|
5868
|
-
parseHTML:
|
|
5692
|
+
parseHTML: B("error")
|
|
5869
5693
|
}
|
|
5870
5694
|
};
|
|
5871
5695
|
},
|
|
@@ -5875,57 +5699,57 @@ const Uo = we.create({
|
|
|
5875
5699
|
};
|
|
5876
5700
|
},
|
|
5877
5701
|
addNodeView() {
|
|
5878
|
-
return
|
|
5702
|
+
return Se(Si);
|
|
5879
5703
|
}
|
|
5880
5704
|
});
|
|
5881
5705
|
export {
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5706
|
+
xo as Attachment,
|
|
5707
|
+
co as BaseKit,
|
|
5708
|
+
io as Blockquote,
|
|
5709
|
+
Ui as Bold,
|
|
5710
|
+
eo as BulletList,
|
|
5711
|
+
to as Clear,
|
|
5712
|
+
Wi as Code,
|
|
5713
|
+
ra as CodeBlock,
|
|
5714
|
+
Qi as Color,
|
|
5715
|
+
pn as Column,
|
|
5716
|
+
lo as ColumnActionButton,
|
|
5717
|
+
Ao as Drawer,
|
|
5718
|
+
bo as Emoji,
|
|
5719
|
+
Lo as Excalidraw,
|
|
5720
|
+
po as ExportPdf,
|
|
5721
|
+
yo as ExportWord,
|
|
5722
|
+
Gi as FontFamily,
|
|
5723
|
+
Yi as FontSize,
|
|
5724
|
+
go as FormatPainter,
|
|
5725
|
+
Zi as Heading,
|
|
5726
|
+
Xi as Highlight,
|
|
5727
|
+
ro as History,
|
|
5728
|
+
so as HorizontalRule,
|
|
5729
|
+
So as Iframe,
|
|
5730
|
+
kn as Image,
|
|
5731
|
+
To as ImageGif,
|
|
5732
|
+
wo as ImportWord,
|
|
5733
|
+
ho as Indent,
|
|
5734
|
+
qi as Italic,
|
|
5735
|
+
Eo as Katex,
|
|
5736
|
+
_o as LineHeight,
|
|
5737
|
+
oo as Link,
|
|
5738
|
+
vo as Mention,
|
|
5739
|
+
Ho as Mermaid,
|
|
5740
|
+
mo as MoreMark,
|
|
5741
|
+
wn as MultiColumn,
|
|
5742
|
+
no as OrderedList,
|
|
5743
|
+
ja as SearchAndReplace,
|
|
5744
|
+
fo as SlashCommand,
|
|
5745
|
+
Vi as Strike,
|
|
5746
|
+
uo as SubAndSuperScript,
|
|
5747
|
+
zo as Table,
|
|
5748
|
+
gi as TableOfContents,
|
|
5749
|
+
ao as TaskList,
|
|
5750
|
+
Ji as TextAlign,
|
|
5751
|
+
ko as TextDirection,
|
|
5752
|
+
Mo as Twitter,
|
|
5753
|
+
Ki as Underline,
|
|
5754
|
+
xn as Video
|
|
5931
5755
|
};
|