reactjs-tiptap-editor 0.0.4 → 0.0.5
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/constants/index.d.ts +1 -1
- package/lib/locales/index.d.ts +14 -12
- package/lib/locales/zh-cn.d.ts +127 -0
- package/lib/reactjs-tiptap-editor.js +1 -1
- package/lib/reactjs-tiptap-editor.mjs +1252 -1126
- package/package.json +3 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Xe = (e, t,
|
|
4
|
-
import { B as
|
|
1
|
+
var ei = Object.defineProperty;
|
|
2
|
+
var ti = (e, t, i) => t in e ? ei(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var Xe = (e, t, i) => ti(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
import { B as ii, L as ni, I as oi, U as ai, Q as li, S as ri, M as di, E as si, P as ci, R as ui, a as mi, T as hi, b as fi, c as gi, d as bi, C as dt, e as vi, f as wi, g as xi, h as yi, i as pi, j as ki, k as Ci, l as Ni, m as Li, n as Ai, o as Ti, p as Mi, V as Si, q as Ri, r as Hi, s as zi, t as Di, u as Bi, v as Ii, w as Fi, x as Pi, y as Oi, z as Ei, A as _i, D as $i, F as Ui, G as Vi, H as ji, J as Ki, K as qi, N as Wi, O as Gi, W as Ze, X as Xi, Y as Zi, Z as st, _ as Ji, $ as Yi, a0 as Qi, a1 as en, a2 as tn, a3 as nn, a4 as on, a5 as an, a6 as ln, a7 as ct, a8 as Ke, a9 as ut, aa as rn, ab as dn, ac as sn, ad as cn, ae as un, af as mn, ag as hn, ah as fn, ai as gn, aj as bn, ak as mt, al as vn, am as ht, an as ft, ao as gt, ap as bt, aq as vt, ar as wt, as as wn, at as xt, au as xn, av as yt, aw as pt, ax as yn, ay as pn, az as kn, aA as kt, aB as Cn, aC as Nn, aD as Ln, aE as An, aF as Ct, aG as Tn, aH as Mn, aI as Sn, aJ as V, aK as Nt, aL as Rn, aM as Lt, aN as Hn, aO as zn, aP as Dn, aQ as te, aR as Bn, aS as In, aT as Fn, aU as Pn, aV as At, aW as Tt, aX as On, aY as En, aZ as Se, a_ as ue, a$ as _n, b0 as Re, b1 as $n, b2 as Un, b3 as Mt, b4 as we, b5 as St, b6 as Rt, b7 as Vn, b8 as jn, b9 as Kn, ba as qn, bb as Wn, bc as Gn, bd as Xn, be as Zn, bf as Jn, bg as Yn, bh as Ht, bi as zt, bj as Dt, bk as Qn, bl as eo, bm as to, bn as io, bo as Oe, bp as He, bq as no, br as ze, bs as Bt, bt as It, bu as Ft, bv as oo, bw as ao, bx as lo, by as ro, bz as so, bA as co, bB as uo, bC as me, bD as Pt, bE as mo, bF as ho, bG as Ot, bH as Et, bI as fo, bJ as go, bK as bo } from "./vendor-B_w0TZys.mjs";
|
|
5
5
|
import { jsx as o, jsxs as u, Fragment as M } from "react/jsx-runtime";
|
|
6
6
|
import * as H from "react";
|
|
7
|
-
import { useMemo as
|
|
7
|
+
import { useMemo as z, useEffect as U, Fragment as he, useState as N, useCallback as G, forwardRef as _t, useRef as ce, useImperativeHandle as $t } from "react";
|
|
8
8
|
import { flushSync as Je } from "react-dom";
|
|
9
9
|
function vo(e) {
|
|
10
10
|
return /* @__PURE__ */ o("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ o(
|
|
@@ -36,7 +36,7 @@ function yo(e) {
|
|
|
36
36
|
}
|
|
37
37
|
) });
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function po(e) {
|
|
40
40
|
return /* @__PURE__ */ o("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ o(
|
|
41
41
|
"path",
|
|
42
42
|
{
|
|
@@ -45,7 +45,7 @@ function ko(e) {
|
|
|
45
45
|
}
|
|
46
46
|
) });
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function ko(e) {
|
|
49
49
|
return /* @__PURE__ */ o("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ o(
|
|
50
50
|
"path",
|
|
51
51
|
{
|
|
@@ -79,7 +79,7 @@ function Ut(e) {
|
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Co(e) {
|
|
83
83
|
return /* @__PURE__ */ o("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ o(
|
|
84
84
|
"path",
|
|
85
85
|
{
|
|
@@ -141,79 +141,79 @@ const No = (e) => /* @__PURE__ */ o(
|
|
|
141
141
|
)
|
|
142
142
|
}
|
|
143
143
|
), xe = {
|
|
144
|
-
Bold:
|
|
145
|
-
LoaderCircle:
|
|
146
|
-
Italic:
|
|
147
|
-
Underline:
|
|
148
|
-
Quote:
|
|
149
|
-
TextQuote:
|
|
150
|
-
Strikethrough:
|
|
151
|
-
Minus:
|
|
152
|
-
Eraser:
|
|
153
|
-
PaintRoller:
|
|
154
|
-
Redo2:
|
|
155
|
-
Undo2:
|
|
156
|
-
AlignCenter:
|
|
157
|
-
AlignJustify:
|
|
158
|
-
AlignLeft:
|
|
159
|
-
AlignRight:
|
|
160
|
-
ChevronDown:
|
|
161
|
-
Subscript:
|
|
162
|
-
Superscript:
|
|
163
|
-
Code:
|
|
164
|
-
Code2:
|
|
165
|
-
Type:
|
|
166
|
-
IndentIncrease:
|
|
167
|
-
IndentDecrease:
|
|
168
|
-
List:
|
|
169
|
-
ListOrdered:
|
|
170
|
-
ListTodo:
|
|
171
|
-
Link:
|
|
172
|
-
ImageUp:
|
|
173
|
-
Video:
|
|
174
|
-
Maximize:
|
|
175
|
-
Minimize:
|
|
176
|
-
Table:
|
|
177
|
-
Sparkles:
|
|
178
|
-
Pencil:
|
|
179
|
-
Unlink:
|
|
180
|
-
BetweenHorizonalEnd:
|
|
181
|
-
BetweenHorizonalStart:
|
|
182
|
-
BetweenVerticalStart:
|
|
183
|
-
BetweenVerticalEnd:
|
|
184
|
-
TableCellsMerge:
|
|
185
|
-
TableCellsSplit:
|
|
186
|
-
Trash2:
|
|
187
|
-
Trash:
|
|
188
|
-
Replace:
|
|
189
|
-
ChevronsUpDown:
|
|
190
|
-
LineHeight:
|
|
191
|
-
Word:
|
|
192
|
-
Heading1:
|
|
193
|
-
Heading2:
|
|
194
|
-
Heading3:
|
|
144
|
+
Bold: ii,
|
|
145
|
+
LoaderCircle: ni,
|
|
146
|
+
Italic: oi,
|
|
147
|
+
Underline: ai,
|
|
148
|
+
Quote: li,
|
|
149
|
+
TextQuote: Co,
|
|
150
|
+
Strikethrough: ri,
|
|
151
|
+
Minus: di,
|
|
152
|
+
Eraser: si,
|
|
153
|
+
PaintRoller: ci,
|
|
154
|
+
Redo2: ui,
|
|
155
|
+
Undo2: mi,
|
|
156
|
+
AlignCenter: hi,
|
|
157
|
+
AlignJustify: fi,
|
|
158
|
+
AlignLeft: gi,
|
|
159
|
+
AlignRight: bi,
|
|
160
|
+
ChevronDown: dt,
|
|
161
|
+
Subscript: vi,
|
|
162
|
+
Superscript: wi,
|
|
163
|
+
Code: xi,
|
|
164
|
+
Code2: yi,
|
|
165
|
+
Type: pi,
|
|
166
|
+
IndentIncrease: ki,
|
|
167
|
+
IndentDecrease: Ci,
|
|
168
|
+
List: Ni,
|
|
169
|
+
ListOrdered: Li,
|
|
170
|
+
ListTodo: Ai,
|
|
171
|
+
Link: Ti,
|
|
172
|
+
ImageUp: Mi,
|
|
173
|
+
Video: Si,
|
|
174
|
+
Maximize: Ri,
|
|
175
|
+
Minimize: Hi,
|
|
176
|
+
Table: zi,
|
|
177
|
+
Sparkles: Di,
|
|
178
|
+
Pencil: Bi,
|
|
179
|
+
Unlink: Ii,
|
|
180
|
+
BetweenHorizonalEnd: Fi,
|
|
181
|
+
BetweenHorizonalStart: Pi,
|
|
182
|
+
BetweenVerticalStart: Oi,
|
|
183
|
+
BetweenVerticalEnd: Ei,
|
|
184
|
+
TableCellsMerge: _i,
|
|
185
|
+
TableCellsSplit: $i,
|
|
186
|
+
Trash2: Ui,
|
|
187
|
+
Trash: Vi,
|
|
188
|
+
Replace: ji,
|
|
189
|
+
ChevronsUpDown: Ki,
|
|
190
|
+
LineHeight: po,
|
|
191
|
+
Word: ko,
|
|
192
|
+
Heading1: qi,
|
|
193
|
+
Heading2: Wi,
|
|
194
|
+
Heading3: Gi,
|
|
195
195
|
Columns2: Ze,
|
|
196
|
-
Columns3:
|
|
197
|
-
Columns4:
|
|
198
|
-
Plus:
|
|
199
|
-
Grip:
|
|
200
|
-
Copy:
|
|
201
|
-
Clipboard:
|
|
202
|
-
PanelLeft:
|
|
203
|
-
PanelRight:
|
|
196
|
+
Columns3: Xi,
|
|
197
|
+
Columns4: Zi,
|
|
198
|
+
Plus: st,
|
|
199
|
+
Grip: Ji,
|
|
200
|
+
Copy: Yi,
|
|
201
|
+
Clipboard: Qi,
|
|
202
|
+
PanelLeft: en,
|
|
203
|
+
PanelRight: tn,
|
|
204
204
|
Columns: Ze,
|
|
205
|
-
Iframe:
|
|
205
|
+
Iframe: nn,
|
|
206
206
|
MenuDown: Ut,
|
|
207
207
|
SizeS: vo,
|
|
208
208
|
SizeM: wo,
|
|
209
209
|
SizeL: xo,
|
|
210
210
|
AspectRatio: yo,
|
|
211
|
-
Emoji:
|
|
211
|
+
Emoji: on,
|
|
212
212
|
DeleteColumn: No,
|
|
213
213
|
DeleteRow: Lo
|
|
214
214
|
};
|
|
215
215
|
function S(...e) {
|
|
216
|
-
return
|
|
216
|
+
return an(ln(e));
|
|
217
217
|
}
|
|
218
218
|
const Ao = Ke(
|
|
219
219
|
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
@@ -234,25 +234,25 @@ const Ao = Ke(
|
|
|
234
234
|
size: "default"
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
),
|
|
237
|
+
), De = H.forwardRef(({ className: e, variant: t, size: i, ...n }, a) => /* @__PURE__ */ o(
|
|
238
238
|
ct,
|
|
239
239
|
{
|
|
240
240
|
ref: a,
|
|
241
|
-
className: S(Ao({ variant: t, size:
|
|
242
|
-
...
|
|
241
|
+
className: S(Ao({ variant: t, size: i, className: e })),
|
|
242
|
+
...n
|
|
243
243
|
}
|
|
244
244
|
));
|
|
245
|
-
|
|
246
|
-
const To =
|
|
245
|
+
De.displayName = ct.displayName;
|
|
246
|
+
const To = rn, ye = dn, pe = sn, fe = H.forwardRef(({ className: e, sideOffset: t = 4, ...i }, n) => /* @__PURE__ */ o(
|
|
247
247
|
ut,
|
|
248
248
|
{
|
|
249
|
-
ref:
|
|
249
|
+
ref: n,
|
|
250
250
|
sideOffset: t,
|
|
251
251
|
className: S(
|
|
252
252
|
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
|
|
253
253
|
e
|
|
254
254
|
),
|
|
255
|
-
...
|
|
255
|
+
...i
|
|
256
256
|
}
|
|
257
257
|
));
|
|
258
258
|
fe.displayName = ut.displayName;
|
|
@@ -270,21 +270,21 @@ const v = (e) => {
|
|
|
270
270
|
var w;
|
|
271
271
|
const {
|
|
272
272
|
icon: t = void 0,
|
|
273
|
-
title:
|
|
274
|
-
tooltip:
|
|
273
|
+
title: i = void 0,
|
|
274
|
+
tooltip: n = void 0,
|
|
275
275
|
disabled: a = !1,
|
|
276
276
|
customClass: l = "",
|
|
277
277
|
color: r = void 0,
|
|
278
|
-
loading:
|
|
279
|
-
shortcutKeys:
|
|
278
|
+
loading: d = !1,
|
|
279
|
+
shortcutKeys: s = void 0,
|
|
280
280
|
tooltipOptions: c = {},
|
|
281
281
|
action: h = void 0,
|
|
282
282
|
isActive: m = void 0,
|
|
283
283
|
children: f
|
|
284
284
|
} = e, b = xe[t];
|
|
285
285
|
return /* @__PURE__ */ u(ye, { children: [
|
|
286
|
-
/* @__PURE__ */ o(
|
|
287
|
-
|
|
286
|
+
/* @__PURE__ */ o(pe, { children: /* @__PURE__ */ u(
|
|
287
|
+
De,
|
|
288
288
|
{
|
|
289
289
|
size: "sm",
|
|
290
290
|
className: "w-[32px] h-[32px] " + l,
|
|
@@ -296,17 +296,17 @@ const v = (e) => {
|
|
|
296
296
|
]
|
|
297
297
|
}
|
|
298
298
|
) }),
|
|
299
|
-
|
|
300
|
-
/* @__PURE__ */ o("div", { children:
|
|
299
|
+
n && /* @__PURE__ */ o(fe, { ...c, children: /* @__PURE__ */ u("div", { className: "max-w-24 text-center flex flex-col items-center", children: [
|
|
300
|
+
/* @__PURE__ */ o("div", { children: n }),
|
|
301
301
|
!!((w = e == null ? void 0 : e.shortcutKeys) != null && w.length) && /* @__PURE__ */ o("span", { children: Be(e == null ? void 0 : e.shortcutKeys) })
|
|
302
302
|
] }) })
|
|
303
303
|
] });
|
|
304
|
-
}, Mo =
|
|
304
|
+
}, Mo = cn.extend({
|
|
305
305
|
addOptions() {
|
|
306
306
|
var e;
|
|
307
307
|
return {
|
|
308
308
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
309
|
-
button: ({ editor: t, t:
|
|
309
|
+
button: ({ editor: t, t: i }) => ({
|
|
310
310
|
component: v,
|
|
311
311
|
componentProps: {
|
|
312
312
|
action: () => t.commands.toggleBold(),
|
|
@@ -314,17 +314,17 @@ const v = (e) => {
|
|
|
314
314
|
disabled: !t.can().toggleBold(),
|
|
315
315
|
icon: "Bold",
|
|
316
316
|
shortcutKeys: ["mod", "B"],
|
|
317
|
-
tooltip:
|
|
317
|
+
tooltip: i("editor.bold.tooltip")
|
|
318
318
|
}
|
|
319
319
|
})
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
}), So =
|
|
322
|
+
}), So = un.extend({
|
|
323
323
|
addOptions() {
|
|
324
324
|
var e;
|
|
325
325
|
return {
|
|
326
326
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
327
|
-
button({ editor: t, t:
|
|
327
|
+
button({ editor: t, t: i }) {
|
|
328
328
|
return {
|
|
329
329
|
component: v,
|
|
330
330
|
componentProps: {
|
|
@@ -333,18 +333,18 @@ const v = (e) => {
|
|
|
333
333
|
disabled: !t.can().toggleItalic(),
|
|
334
334
|
shortcutKeys: ["mod", "I"],
|
|
335
335
|
icon: "Italic",
|
|
336
|
-
tooltip:
|
|
336
|
+
tooltip: i("editor.italic.tooltip")
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
|
-
}), Ro =
|
|
342
|
+
}), Ro = mn.extend({
|
|
343
343
|
addOptions() {
|
|
344
344
|
var e;
|
|
345
345
|
return {
|
|
346
346
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
347
|
-
button({ editor: t, t:
|
|
347
|
+
button({ editor: t, t: i }) {
|
|
348
348
|
return {
|
|
349
349
|
component: v,
|
|
350
350
|
componentProps: {
|
|
@@ -353,18 +353,18 @@ const v = (e) => {
|
|
|
353
353
|
disabled: !t.can().toggleUnderline(),
|
|
354
354
|
icon: "Underline",
|
|
355
355
|
shortcutKeys: ["mod", "U"],
|
|
356
|
-
tooltip:
|
|
356
|
+
tooltip: i("editor.underline.tooltip")
|
|
357
357
|
}
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
}), Ho =
|
|
362
|
+
}), Ho = hn.extend({
|
|
363
363
|
addOptions() {
|
|
364
364
|
var e;
|
|
365
365
|
return {
|
|
366
366
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
367
|
-
button: ({ editor: t, t:
|
|
367
|
+
button: ({ editor: t, t: i }) => ({
|
|
368
368
|
component: v,
|
|
369
369
|
componentProps: {
|
|
370
370
|
action: () => t.commands.toggleStrike(),
|
|
@@ -372,17 +372,17 @@ const v = (e) => {
|
|
|
372
372
|
disabled: !t.can().toggleStrike(),
|
|
373
373
|
icon: "Strikethrough",
|
|
374
374
|
shortcutKeys: ["shift", "mod", "X"],
|
|
375
|
-
tooltip:
|
|
375
|
+
tooltip: i("editor.strike.tooltip")
|
|
376
376
|
}
|
|
377
377
|
})
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
|
-
}),
|
|
380
|
+
}), zo = fn.extend({
|
|
381
381
|
addOptions() {
|
|
382
382
|
var e;
|
|
383
383
|
return {
|
|
384
384
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
385
|
-
button: ({ editor: t, t:
|
|
385
|
+
button: ({ editor: t, t: i }) => ({
|
|
386
386
|
component: v,
|
|
387
387
|
componentProps: {
|
|
388
388
|
action: () => t.commands.toggleCode(),
|
|
@@ -390,30 +390,30 @@ const v = (e) => {
|
|
|
390
390
|
disabled: !t.can().toggleCode(),
|
|
391
391
|
icon: "Code",
|
|
392
392
|
shortcutKeys: ["mod", "E"],
|
|
393
|
-
tooltip:
|
|
393
|
+
tooltip: i("editor.code.tooltip")
|
|
394
394
|
}
|
|
395
395
|
})
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
|
-
}),
|
|
398
|
+
}), jl = gn.extend({
|
|
399
399
|
addOptions() {
|
|
400
400
|
var e;
|
|
401
401
|
return {
|
|
402
402
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
403
403
|
defaultLanguage: null,
|
|
404
|
-
button: ({ editor: t, t:
|
|
404
|
+
button: ({ editor: t, t: i }) => ({
|
|
405
405
|
component: v,
|
|
406
406
|
componentProps: {
|
|
407
407
|
action: () => t.commands.toggleCodeBlock(),
|
|
408
408
|
isActive: () => t.isActive("codeBlock") || !1,
|
|
409
409
|
disabled: !t.can().toggleCodeBlock(),
|
|
410
410
|
icon: "Code2",
|
|
411
|
-
tooltip:
|
|
411
|
+
tooltip: i("editor.codeblock.tooltip")
|
|
412
412
|
}
|
|
413
413
|
})
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
|
-
}),
|
|
416
|
+
}), Do = Ke(
|
|
417
417
|
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
418
418
|
{
|
|
419
419
|
variants: {
|
|
@@ -438,10 +438,10 @@ const v = (e) => {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
), E = H.forwardRef(
|
|
441
|
-
({ className: e, variant: t, size:
|
|
442
|
-
|
|
441
|
+
({ className: e, variant: t, size: i, asChild: n = !1, ...a }, l) => /* @__PURE__ */ o(
|
|
442
|
+
n ? bn : "button",
|
|
443
443
|
{
|
|
444
|
-
className: S(
|
|
444
|
+
className: S(Do({ variant: t, size: i, className: e })),
|
|
445
445
|
ref: l,
|
|
446
446
|
...a
|
|
447
447
|
}
|
|
@@ -449,10 +449,10 @@ const v = (e) => {
|
|
|
449
449
|
);
|
|
450
450
|
E.displayName = "Button";
|
|
451
451
|
const We = (e) => {
|
|
452
|
-
var
|
|
452
|
+
var i;
|
|
453
453
|
const t = xe[e.icon];
|
|
454
454
|
return /* @__PURE__ */ u(ye, { children: [
|
|
455
|
-
/* @__PURE__ */ o(
|
|
455
|
+
/* @__PURE__ */ o(pe, { children: /* @__PURE__ */ o(
|
|
456
456
|
E,
|
|
457
457
|
{
|
|
458
458
|
className: "h-[32px] px-[5px] py-0 min-w-24 max-w-32 overflow-hidden",
|
|
@@ -466,10 +466,10 @@ const We = (e) => {
|
|
|
466
466
|
) }),
|
|
467
467
|
/* @__PURE__ */ o(fe, { children: /* @__PURE__ */ u("div", { className: "max-w-24 text-center flex flex-col items-center", children: [
|
|
468
468
|
(e == null ? void 0 : e.tooltip) && /* @__PURE__ */ o("div", { children: e == null ? void 0 : e.tooltip }),
|
|
469
|
-
/* @__PURE__ */ o("div", { className: "flex", children: !!((
|
|
469
|
+
/* @__PURE__ */ o("div", { className: "flex", children: !!((i = e == null ? void 0 : e.shortcutKeys) != null && i.length) && /* @__PURE__ */ o("span", { children: Be(e == null ? void 0 : e.shortcutKeys) }) })
|
|
470
470
|
] }) })
|
|
471
471
|
] });
|
|
472
|
-
},
|
|
472
|
+
}, ie = yn, ne = pn, Ye = ft, Qe = kn, Ee = H.forwardRef(({ className: e, inset: t, children: i, ...n }, a) => /* @__PURE__ */ u(
|
|
473
473
|
mt,
|
|
474
474
|
{
|
|
475
475
|
ref: a,
|
|
@@ -478,18 +478,18 @@ const We = (e) => {
|
|
|
478
478
|
t && "pl-8",
|
|
479
479
|
e
|
|
480
480
|
),
|
|
481
|
-
...
|
|
481
|
+
...n,
|
|
482
482
|
children: [
|
|
483
|
-
|
|
484
|
-
/* @__PURE__ */ o(
|
|
483
|
+
i,
|
|
484
|
+
/* @__PURE__ */ o(vn, { className: "ml-auto h-4 w-4" })
|
|
485
485
|
]
|
|
486
486
|
}
|
|
487
487
|
));
|
|
488
488
|
Ee.displayName = mt.displayName;
|
|
489
|
-
const _e = H.forwardRef(({ className: e, ...t },
|
|
489
|
+
const _e = H.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ o(
|
|
490
490
|
ht,
|
|
491
491
|
{
|
|
492
|
-
ref:
|
|
492
|
+
ref: i,
|
|
493
493
|
className: S(
|
|
494
494
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
495
495
|
e
|
|
@@ -498,33 +498,33 @@ const _e = H.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
498
498
|
}
|
|
499
499
|
));
|
|
500
500
|
_e.displayName = ht.displayName;
|
|
501
|
-
const X = H.forwardRef(({ className: e, sideOffset: t = 4, ...
|
|
501
|
+
const X = H.forwardRef(({ className: e, sideOffset: t = 4, ...i }, n) => /* @__PURE__ */ o(ft, { children: /* @__PURE__ */ o(
|
|
502
502
|
gt,
|
|
503
503
|
{
|
|
504
|
-
ref:
|
|
504
|
+
ref: n,
|
|
505
505
|
sideOffset: t,
|
|
506
506
|
className: S(
|
|
507
507
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",
|
|
508
508
|
e
|
|
509
509
|
),
|
|
510
|
-
...
|
|
510
|
+
...i
|
|
511
511
|
}
|
|
512
512
|
) }));
|
|
513
513
|
X.displayName = gt.displayName;
|
|
514
|
-
const K = H.forwardRef(({ className: e, inset: t, ...
|
|
514
|
+
const K = H.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */ o(
|
|
515
515
|
bt,
|
|
516
516
|
{
|
|
517
|
-
ref:
|
|
517
|
+
ref: n,
|
|
518
518
|
className: S(
|
|
519
519
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
520
520
|
t && "pl-8",
|
|
521
521
|
e
|
|
522
522
|
),
|
|
523
|
-
...
|
|
523
|
+
...i
|
|
524
524
|
}
|
|
525
525
|
));
|
|
526
526
|
K.displayName = bt.displayName;
|
|
527
|
-
const oe = H.forwardRef(({ className: e, children: t, checked:
|
|
527
|
+
const oe = H.forwardRef(({ className: e, children: t, checked: i, ...n }, a) => /* @__PURE__ */ u(
|
|
528
528
|
vt,
|
|
529
529
|
{
|
|
530
530
|
ref: a,
|
|
@@ -532,52 +532,52 @@ const oe = H.forwardRef(({ className: e, children: t, checked: n, ...i }, a) =>
|
|
|
532
532
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
533
533
|
e
|
|
534
534
|
),
|
|
535
|
-
checked:
|
|
536
|
-
...
|
|
535
|
+
checked: i,
|
|
536
|
+
...n,
|
|
537
537
|
children: [
|
|
538
|
-
/* @__PURE__ */ o("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(wt, { children: /* @__PURE__ */ o(
|
|
538
|
+
/* @__PURE__ */ o("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(wt, { children: /* @__PURE__ */ o(wn, { className: "h-4 w-4" }) }) }),
|
|
539
539
|
t
|
|
540
540
|
]
|
|
541
541
|
}
|
|
542
542
|
));
|
|
543
543
|
oe.displayName = vt.displayName;
|
|
544
|
-
const Bo = H.forwardRef(({ className: e, children: t, ...
|
|
544
|
+
const Bo = H.forwardRef(({ className: e, children: t, ...i }, n) => /* @__PURE__ */ u(
|
|
545
545
|
xt,
|
|
546
546
|
{
|
|
547
|
-
ref:
|
|
547
|
+
ref: n,
|
|
548
548
|
className: S(
|
|
549
549
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
550
550
|
e
|
|
551
551
|
),
|
|
552
|
-
...
|
|
552
|
+
...i,
|
|
553
553
|
children: [
|
|
554
|
-
/* @__PURE__ */ o("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(wt, { children: /* @__PURE__ */ o(
|
|
554
|
+
/* @__PURE__ */ o("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(wt, { children: /* @__PURE__ */ o(xn, { className: "h-2 w-2 fill-current" }) }) }),
|
|
555
555
|
t
|
|
556
556
|
]
|
|
557
557
|
}
|
|
558
558
|
));
|
|
559
559
|
Bo.displayName = xt.displayName;
|
|
560
|
-
const Io = H.forwardRef(({ className: e, inset: t, ...
|
|
560
|
+
const Io = H.forwardRef(({ className: e, inset: t, ...i }, n) => /* @__PURE__ */ o(
|
|
561
561
|
yt,
|
|
562
562
|
{
|
|
563
|
-
ref:
|
|
563
|
+
ref: n,
|
|
564
564
|
className: S("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
|
|
565
|
-
...
|
|
565
|
+
...i
|
|
566
566
|
}
|
|
567
567
|
));
|
|
568
568
|
Io.displayName = yt.displayName;
|
|
569
|
-
const Ie = H.forwardRef(({ className: e, ...t },
|
|
570
|
-
|
|
569
|
+
const Ie = H.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ o(
|
|
570
|
+
pt,
|
|
571
571
|
{
|
|
572
|
-
ref:
|
|
572
|
+
ref: i,
|
|
573
573
|
className: S("-mx-1 my-1 h-px bg-muted", e),
|
|
574
574
|
...t
|
|
575
575
|
}
|
|
576
576
|
));
|
|
577
|
-
Ie.displayName =
|
|
577
|
+
Ie.displayName = pt.displayName;
|
|
578
578
|
const Vt = ({ className: e, ...t }) => /* @__PURE__ */ o("span", { className: S("ml-auto text-xs tracking-widest opacity-60", e), ...t });
|
|
579
579
|
Vt.displayName = "DropdownMenuShortcut";
|
|
580
|
-
const Fo = "en", Po = 200, Oo = Po - 80, Eo = 20, et = 1e5, tt = 16,
|
|
580
|
+
const Fo = "en", Po = 200, Oo = Po - 80, Eo = 20, et = 1e5, tt = 16, ke = 10, Ce = 10, Ne = 2, _o = "#262626", $o = [
|
|
581
581
|
"#000000",
|
|
582
582
|
"#262626",
|
|
583
583
|
"#595959",
|
|
@@ -663,7 +663,7 @@ const Fo = "en", Po = 200, Oo = Po - 80, Eo = 20, et = 1e5, tt = 16, Ce = 10, pe
|
|
|
663
663
|
"36px",
|
|
664
664
|
"48px",
|
|
665
665
|
"72px"
|
|
666
|
-
], re = "
|
|
666
|
+
], re = "default";
|
|
667
667
|
var $e = /* @__PURE__ */ ((e) => (e[e["size-small"] = 200] = "size-small", e[e["size-medium"] = 500] = "size-medium", e["size-large"] = "100%", e))($e || {}), Te = /* @__PURE__ */ ((e) => (e[e["size-small"] = 480] = "size-small", e[e["size-medium"] = 640] = "size-medium", e["size-large"] = "100%", e))(Te || {});
|
|
668
668
|
const jt = "1";
|
|
669
669
|
function Vo(e) {
|
|
@@ -678,9 +678,9 @@ function Vo(e) {
|
|
|
678
678
|
* @param {Function} handler Function to call in response to given event
|
|
679
679
|
* @memberOf mitt
|
|
680
680
|
*/
|
|
681
|
-
on(t,
|
|
682
|
-
const
|
|
683
|
-
|
|
681
|
+
on(t, i) {
|
|
682
|
+
const n = e.get(t);
|
|
683
|
+
n ? n.push(i) : e.set(t, [i]);
|
|
684
684
|
},
|
|
685
685
|
/**
|
|
686
686
|
* Remove an event handler for the given type.
|
|
@@ -689,9 +689,9 @@ function Vo(e) {
|
|
|
689
689
|
* @param {Function} [handler] Handler function to remove
|
|
690
690
|
* @memberOf mitt
|
|
691
691
|
*/
|
|
692
|
-
off(t,
|
|
693
|
-
const
|
|
694
|
-
|
|
692
|
+
off(t, i) {
|
|
693
|
+
const n = e.get(t);
|
|
694
|
+
n && (i ? n.splice(n.indexOf(i) >>> 0, 1) : e.set(t, []));
|
|
695
695
|
},
|
|
696
696
|
/**
|
|
697
697
|
* Invoke all handlers for the given type.
|
|
@@ -703,12 +703,12 @@ function Vo(e) {
|
|
|
703
703
|
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
|
|
704
704
|
* @memberOf mitt
|
|
705
705
|
*/
|
|
706
|
-
emit(t,
|
|
707
|
-
let
|
|
708
|
-
|
|
709
|
-
a(
|
|
710
|
-
}),
|
|
711
|
-
a(t,
|
|
706
|
+
emit(t, i) {
|
|
707
|
+
let n = e.get(t);
|
|
708
|
+
n && [...n].map((a) => {
|
|
709
|
+
a(i);
|
|
710
|
+
}), n = e.get("*"), n && [...n].map((a) => {
|
|
711
|
+
a(t, i);
|
|
712
712
|
});
|
|
713
713
|
}
|
|
714
714
|
};
|
|
@@ -724,7 +724,7 @@ const jo = {
|
|
|
724
724
|
"editor.format": "Format Painter",
|
|
725
725
|
"editor.draghandle.tooltip": "Modify",
|
|
726
726
|
"editor.copyToClipboard": "CopyToClipboard",
|
|
727
|
-
"editor.
|
|
727
|
+
"editor.importWord.tooltip": "Import Word",
|
|
728
728
|
"editor.slash": "Press '/' for commands",
|
|
729
729
|
"editor.slash.empty": "No Result",
|
|
730
730
|
"editor.slash.format": "Format",
|
|
@@ -849,7 +849,7 @@ const jo = {
|
|
|
849
849
|
"editor.format": "Format Painter",
|
|
850
850
|
"editor.draghandle.tooltip": "Sửa đổi",
|
|
851
851
|
"editor.copyToClipboard": "CopyToClipboard",
|
|
852
|
-
"editor.
|
|
852
|
+
"editor.importWord.tooltip": "Nhập Word",
|
|
853
853
|
"editor.slash": "Nhấn '/' để biết lệnh",
|
|
854
854
|
"editor.slash.empty": "Không có kết quả",
|
|
855
855
|
"editor.slash.format": "Định dạng",
|
|
@@ -963,35 +963,161 @@ const jo = {
|
|
|
963
963
|
"editor.table.menu.setCellsBgColor": "Màu nền ô",
|
|
964
964
|
"editor.emoji.tooltip": "Biểu tượng",
|
|
965
965
|
"editor.iframe.tooltip": "Iframe"
|
|
966
|
-
},
|
|
966
|
+
}, qo = {
|
|
967
|
+
"editor.remove": "移除",
|
|
968
|
+
"editor.copy": "复制",
|
|
969
|
+
"editor.words": "字数",
|
|
970
|
+
"editor.characters": "字符数",
|
|
971
|
+
"editor.default": "默认",
|
|
972
|
+
"editor.recent": "最近使用",
|
|
973
|
+
"editor.nofill": "无填充",
|
|
974
|
+
"editor.format": "格式刷",
|
|
975
|
+
"editor.draghandle.tooltip": "修改",
|
|
976
|
+
"editor.copyToClipboard": "复制到剪贴板",
|
|
977
|
+
"editor.importWord.tooltip": "导入 Word",
|
|
978
|
+
"editor.slash": "按 '/' 使用命令",
|
|
979
|
+
"editor.slash.empty": "无结果",
|
|
980
|
+
"editor.slash.format": "格式",
|
|
981
|
+
"editor.slash.insert": "插入",
|
|
982
|
+
"editor.slash.embed": "嵌入服务",
|
|
983
|
+
"editor.content": "请输入内容",
|
|
984
|
+
"editor.fontFamily.tooltip": "字体",
|
|
985
|
+
"editor.fontFamily.default.tooltip": "默认",
|
|
986
|
+
"editor.moremark": "更多文本样式",
|
|
987
|
+
"editor.size.small.tooltip": "小",
|
|
988
|
+
"editor.size.medium.tooltip": "中",
|
|
989
|
+
"editor.size.large.tooltip": "封面",
|
|
990
|
+
"editor.bold.tooltip": "粗体",
|
|
991
|
+
"editor.italic.tooltip": "斜体",
|
|
992
|
+
"editor.underline.tooltip": "下划线",
|
|
993
|
+
"editor.strike.tooltip": "删除线",
|
|
994
|
+
"editor.color.tooltip": "颜色",
|
|
995
|
+
"editor.color.more": "更多颜色",
|
|
996
|
+
"editor.highlight.tooltip": "高亮",
|
|
997
|
+
"editor.lineheight.tooltip": "行高",
|
|
998
|
+
"editor.heading.tooltip": "标题",
|
|
999
|
+
"editor.heading.h1.tooltip": "标题1",
|
|
1000
|
+
"editor.heading.h2.tooltip": "标题2",
|
|
1001
|
+
"editor.heading.h3.tooltip": "标题3",
|
|
1002
|
+
"editor.heading.h4.tooltip": "标题4",
|
|
1003
|
+
"editor.heading.h5.tooltip": "标题5",
|
|
1004
|
+
"editor.heading.h6.tooltip": "标题6",
|
|
1005
|
+
"editor.paragraph.tooltip": "段落",
|
|
1006
|
+
"editor.textalign.tooltip": "对齐",
|
|
1007
|
+
"editor.textalign.left.tooltip": "左对齐",
|
|
1008
|
+
"editor.textalign.center.tooltip": "居中",
|
|
1009
|
+
"editor.textalign.right.tooltip": "右对齐",
|
|
1010
|
+
"editor.textalign.justify.tooltip": "两端对齐",
|
|
1011
|
+
"editor.indent": "缩进",
|
|
1012
|
+
"editor.indent.indent": "增加缩进",
|
|
1013
|
+
"editor.indent.outdent": "减少缩进",
|
|
1014
|
+
"editor.fontSize.tooltip": "字号",
|
|
1015
|
+
"editor.fontSize.default.tooltip": "默认",
|
|
1016
|
+
"editor.superscript.tooltip": "上标",
|
|
1017
|
+
"editor.subscript.tooltip": "下标",
|
|
1018
|
+
"editor.bulletlist.tooltip": "无序列表",
|
|
1019
|
+
"editor.orderedlist.tooltip": "有序列表",
|
|
1020
|
+
"editor.tasklist.tooltip": "任务列表",
|
|
1021
|
+
"editor.indent.tooltip": "缩进",
|
|
1022
|
+
"editor.outdent.tooltip": "减少缩进",
|
|
1023
|
+
"editor.columns.tooltip": "列",
|
|
1024
|
+
"editor.link.tooltip": "链接",
|
|
1025
|
+
"editor.link.unlink.tooltip": "取消链接",
|
|
1026
|
+
"editor.link.open.tooltip": "打开链接",
|
|
1027
|
+
"editor.link.edit.tooltip": "编辑链接",
|
|
1028
|
+
"editor.link.dialog.title": "插入链接",
|
|
1029
|
+
"editor.link.dialog.link": "链接",
|
|
1030
|
+
"editor.link.dialog.text": "文本",
|
|
1031
|
+
"editor.link.dialog.openInNewTab": "在新标签页中打开",
|
|
1032
|
+
"editor.link.dialog.link.placeholder": "链接地址",
|
|
1033
|
+
"editor.link.dialog.text.placeholder": "添加描述",
|
|
1034
|
+
"editor.link.dialog.button.apply": "应用",
|
|
1035
|
+
"editor.image.tooltip": "图片",
|
|
1036
|
+
"editor.image.dragger.tooltip": "点击或拖拽图片到此区域上传",
|
|
1037
|
+
"editor.image.float.left.tooltip": "左浮动",
|
|
1038
|
+
"editor.image.float.none.tooltip": "无浮动",
|
|
1039
|
+
"editor.image.float.right.tooltip": "右浮动",
|
|
1040
|
+
"editor.image.dialog.title": "添加图片",
|
|
1041
|
+
"editor.image.dialog.tab.url": "链接",
|
|
1042
|
+
"editor.image.dialog.tab.upload": "上传",
|
|
1043
|
+
"editor.image.dialog.uploading": "上传中",
|
|
1044
|
+
"editor.image.dialog.form.link": "链接",
|
|
1045
|
+
"editor.image.dialog.placeholder": "链接",
|
|
1046
|
+
"editor.image.dialog.form.alt": "替代文本",
|
|
1047
|
+
"editor.image.dialog.form.aspectRatio": "锁定原始宽高比",
|
|
1048
|
+
"editor.image.dialog.form.file": "文件",
|
|
1049
|
+
"editor.image.dialog.button.apply": "应用",
|
|
1050
|
+
"editor.video.tooltip": "视频",
|
|
1051
|
+
"editor.video.dialog.tab.upload": "上传",
|
|
1052
|
+
"editor.video.dialog.uploading": "上传中",
|
|
1053
|
+
"editor.video.dialog.title": "嵌入或上传视频",
|
|
1054
|
+
"editor.video.dialog.link": "链接",
|
|
1055
|
+
"editor.video.dialog.placeholder": "链接",
|
|
1056
|
+
"editor.video.dialog.button.apply": "应用",
|
|
1057
|
+
"editor.table.tooltip": "表格",
|
|
1058
|
+
"editor.table.menu.insert_table": "插入表格",
|
|
1059
|
+
"editor.table.menu.insert_table.with_header_row": "带标题行",
|
|
1060
|
+
"editor.table.menu.add_column_before": "在前面插入列",
|
|
1061
|
+
"editor.table.menu.add_column_after": "在后面插入列",
|
|
1062
|
+
"editor.table.menu.delete_column": "删除列",
|
|
1063
|
+
"editor.table.menu.add_row_before": "在上方插入行",
|
|
1064
|
+
"editor.table.menu.add_row_after": "在下方插入行",
|
|
1065
|
+
"editor.table.menu.delete_row": "删除行",
|
|
1066
|
+
"editor.table.menu.merge_or_split_cells": "合并或拆分单元格",
|
|
1067
|
+
"editor.table.menu.delete_table": "删除表格",
|
|
1068
|
+
"editor.blockquote.tooltip": "引用",
|
|
1069
|
+
"editor.horizontalrule.tooltip": "水平线",
|
|
1070
|
+
"editor.code.tooltip": "代码",
|
|
1071
|
+
"editor.codeblock.tooltip": "代码块",
|
|
1072
|
+
"editor.clear.tooltip": "清除格式",
|
|
1073
|
+
"editor.undo.tooltip": "撤销",
|
|
1074
|
+
"editor.redo.tooltip": "重做",
|
|
1075
|
+
"editor.fullscreen.tooltip.fullscreen": "全屏",
|
|
1076
|
+
"editor.fullscreen.tooltip.exit": "退出全屏",
|
|
1077
|
+
"editor.imageUpload.fileTypeNotSupported": "不支持的文件类型",
|
|
1078
|
+
"editor.imageUpload.fileSizeTooBig": "文件大小超出限制,最大大小为",
|
|
1079
|
+
"editor.table.menu.insertColumnBefore": "在前面插入列",
|
|
1080
|
+
"editor.table.menu.insertColumnAfter": "在后面插入列",
|
|
1081
|
+
"editor.table.menu.deleteColumn": "删除列",
|
|
1082
|
+
"editor.table.menu.insertRowAbove": "在上方插入行",
|
|
1083
|
+
"editor.table.menu.insertRowBelow": "在下方插入行",
|
|
1084
|
+
"editor.table.menu.deleteRow": "删除行",
|
|
1085
|
+
"editor.table.menu.mergeCells": "合并单元格",
|
|
1086
|
+
"editor.table.menu.splitCells": "拆分单元格",
|
|
1087
|
+
"editor.table.menu.deleteTable": "删除表格",
|
|
1088
|
+
"editor.table.menu.setCellsBgColor": "设置单元格背景色",
|
|
1089
|
+
"editor.emoji.tooltip": "表情",
|
|
1090
|
+
"editor.iframe.tooltip": "内嵌框架"
|
|
1091
|
+
}, de = {
|
|
967
1092
|
lang: Fo,
|
|
968
1093
|
message: {
|
|
969
1094
|
en: jo,
|
|
970
|
-
vi: Ko
|
|
1095
|
+
vi: Ko,
|
|
1096
|
+
zh_CN: qo
|
|
971
1097
|
}
|
|
972
1098
|
};
|
|
973
|
-
class
|
|
1099
|
+
class Wo {
|
|
974
1100
|
constructor() {
|
|
975
1101
|
Xe(this, "emitter");
|
|
976
1102
|
this.emitter = Vo();
|
|
977
1103
|
}
|
|
978
1104
|
get lang() {
|
|
979
|
-
return
|
|
1105
|
+
return de.lang;
|
|
980
1106
|
}
|
|
981
1107
|
set lang(t) {
|
|
982
1108
|
if (!this.isLangSupported(t)) {
|
|
983
1109
|
console.warn(
|
|
984
|
-
`Can't find the current language "${t}", Using language "${
|
|
1110
|
+
`Can't find the current language "${t}", Using language "${de.lang}" by default`
|
|
985
1111
|
);
|
|
986
1112
|
return;
|
|
987
1113
|
}
|
|
988
|
-
|
|
1114
|
+
de.lang = t, this.emitter.emit("lang", t);
|
|
989
1115
|
}
|
|
990
1116
|
get message() {
|
|
991
|
-
return
|
|
1117
|
+
return de.message;
|
|
992
1118
|
}
|
|
993
1119
|
set message(t) {
|
|
994
|
-
|
|
1120
|
+
de.message = t;
|
|
995
1121
|
}
|
|
996
1122
|
loadLangMessage(t) {
|
|
997
1123
|
return this.message[t];
|
|
@@ -1009,27 +1135,27 @@ class qo {
|
|
|
1009
1135
|
}
|
|
1010
1136
|
};
|
|
1011
1137
|
}
|
|
1012
|
-
setMessage(t,
|
|
1013
|
-
this.message[t] =
|
|
1138
|
+
setMessage(t, i) {
|
|
1139
|
+
this.message[t] = i;
|
|
1014
1140
|
}
|
|
1015
1141
|
buildLocalesHandler(t) {
|
|
1016
1142
|
t || (t = this.lang);
|
|
1017
|
-
const
|
|
1143
|
+
const i = this.loadLangMessage(t);
|
|
1018
1144
|
return function(a) {
|
|
1019
|
-
return
|
|
1145
|
+
return i[a] || a;
|
|
1020
1146
|
};
|
|
1021
1147
|
}
|
|
1022
1148
|
}
|
|
1023
|
-
const Me = new
|
|
1024
|
-
lang:
|
|
1025
|
-
}),
|
|
1026
|
-
const e =
|
|
1149
|
+
const Me = new Wo(), Ue = kt({
|
|
1150
|
+
lang: de.lang
|
|
1151
|
+
}), D = () => {
|
|
1152
|
+
const e = Cn(Ue), t = z(() => Me.buildLocalesHandler(e.lang), [e.lang]);
|
|
1027
1153
|
return U(() => {
|
|
1028
|
-
const
|
|
1029
|
-
Ue.lang =
|
|
1154
|
+
const i = Me.registerWatchLang((n) => {
|
|
1155
|
+
Ue.lang = n;
|
|
1030
1156
|
});
|
|
1031
1157
|
return () => {
|
|
1032
|
-
|
|
1158
|
+
i.unsubscribe();
|
|
1033
1159
|
};
|
|
1034
1160
|
}, []), {
|
|
1035
1161
|
lang: e.lang,
|
|
@@ -1037,13 +1163,13 @@ const Me = new qo(), Ue = Ct({
|
|
|
1037
1163
|
};
|
|
1038
1164
|
}, T = {
|
|
1039
1165
|
t: (e) => Me.buildLocalesHandler(Ue.lang)(e)
|
|
1040
|
-
},
|
|
1166
|
+
}, Kl = Me, Go = (e) => {
|
|
1041
1167
|
var a, l, r;
|
|
1042
|
-
const { t, lang:
|
|
1168
|
+
const { t, lang: i } = D(), n = z(() => {
|
|
1043
1169
|
var c;
|
|
1044
|
-
const
|
|
1045
|
-
return
|
|
1046
|
-
...
|
|
1170
|
+
const d = (c = e == null ? void 0 : e.items) == null ? void 0 : c.find((h) => h.isActive());
|
|
1171
|
+
return d && !d.default ? {
|
|
1172
|
+
...d
|
|
1047
1173
|
} : {
|
|
1048
1174
|
title: e.tooltip,
|
|
1049
1175
|
font: t("editor.fontFamily.default.tooltip"),
|
|
@@ -1051,36 +1177,36 @@ const Me = new qo(), Ue = Ct({
|
|
|
1051
1177
|
disabled: !1,
|
|
1052
1178
|
action: () => e.editor.chain().focus().unsetFontFamily().run()
|
|
1053
1179
|
};
|
|
1054
|
-
}, [t,
|
|
1055
|
-
return /* @__PURE__ */ u(
|
|
1056
|
-
/* @__PURE__ */ o(
|
|
1180
|
+
}, [t, i, e]);
|
|
1181
|
+
return /* @__PURE__ */ u(ie, { children: [
|
|
1182
|
+
/* @__PURE__ */ o(ne, { disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(
|
|
1057
1183
|
We,
|
|
1058
1184
|
{
|
|
1059
|
-
title: ((a =
|
|
1185
|
+
title: ((a = n == null ? void 0 : n.font) == null ? void 0 : a.length) > 7 ? `${(l = n == null ? void 0 : n.font) == null ? void 0 : l.slice(0, 6)}...` : n == null ? void 0 : n.font,
|
|
1060
1186
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1061
1187
|
disabled: e == null ? void 0 : e.disabled,
|
|
1062
1188
|
icon: "MenuDown"
|
|
1063
1189
|
}
|
|
1064
1190
|
) }),
|
|
1065
|
-
/* @__PURE__ */ o(X, { className: "w-full", children: (r = e == null ? void 0 : e.items) == null ? void 0 : r.map((
|
|
1066
|
-
const c =
|
|
1191
|
+
/* @__PURE__ */ o(X, { className: "w-full", children: (r = e == null ? void 0 : e.items) == null ? void 0 : r.map((d, s) => {
|
|
1192
|
+
const c = d.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: d.font };
|
|
1067
1193
|
return /* @__PURE__ */ u(he, { children: [
|
|
1068
|
-
/* @__PURE__ */ o(oe, { checked: (
|
|
1069
|
-
|
|
1070
|
-
] },
|
|
1194
|
+
/* @__PURE__ */ o(oe, { checked: (n == null ? void 0 : n.font) === d.font, onClick: d.action, children: /* @__PURE__ */ o("div", { className: "ml-1 h-full", style: c, children: d.font }) }),
|
|
1195
|
+
d.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ o(Ie, {})
|
|
1196
|
+
] }, s);
|
|
1071
1197
|
}) })
|
|
1072
1198
|
] });
|
|
1073
|
-
},
|
|
1199
|
+
}, ql = Nn.extend({
|
|
1074
1200
|
addOptions() {
|
|
1075
1201
|
var e;
|
|
1076
1202
|
return {
|
|
1077
1203
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1078
1204
|
fonts: ["Inter", "Comic Sans MS, Comic Sans", "serif", "monospace", "cursive"],
|
|
1079
|
-
button({ editor: t, extension:
|
|
1205
|
+
button({ editor: t, extension: i, t: n }) {
|
|
1080
1206
|
var c;
|
|
1081
|
-
const { extensions: a = [] } = t.extensionManager ?? [], l = ((c =
|
|
1207
|
+
const { extensions: a = [] } = t.extensionManager ?? [], l = ((c = i.options) == null ? void 0 : c.fonts) || [], r = a.find(
|
|
1082
1208
|
(h) => h.name === "base-kit"
|
|
1083
|
-
),
|
|
1209
|
+
), d = l.map((h) => ({
|
|
1084
1210
|
action: () => {
|
|
1085
1211
|
t.chain().focus().setFontFamily(h).run();
|
|
1086
1212
|
},
|
|
@@ -1089,41 +1215,41 @@ const Me = new qo(), Ue = Ct({
|
|
|
1089
1215
|
title: h,
|
|
1090
1216
|
font: h
|
|
1091
1217
|
}));
|
|
1092
|
-
r && r.options.textStyle !== !1 &&
|
|
1218
|
+
r && r.options.textStyle !== !1 && d.unshift({
|
|
1093
1219
|
action: () => t.chain().focus().unsetFontFamily().run(),
|
|
1094
1220
|
isActive: () => !1,
|
|
1095
1221
|
disabled: !1,
|
|
1096
|
-
font:
|
|
1097
|
-
title:
|
|
1222
|
+
font: n("editor.fontFamily.default.tooltip"),
|
|
1223
|
+
title: n("editor.fontFamily.tooltip")
|
|
1098
1224
|
});
|
|
1099
|
-
const
|
|
1225
|
+
const s = d.filter((h) => h.disabled).length === d.length;
|
|
1100
1226
|
return {
|
|
1101
|
-
component:
|
|
1227
|
+
component: Go,
|
|
1102
1228
|
componentProps: {
|
|
1103
|
-
tooltip:
|
|
1104
|
-
disabled:
|
|
1105
|
-
items:
|
|
1229
|
+
tooltip: n("editor.fontFamily.tooltip"),
|
|
1230
|
+
disabled: s,
|
|
1231
|
+
items: d,
|
|
1106
1232
|
editor: t
|
|
1107
1233
|
}
|
|
1108
1234
|
};
|
|
1109
1235
|
}
|
|
1110
1236
|
};
|
|
1111
1237
|
}
|
|
1112
|
-
}),
|
|
1113
|
-
var
|
|
1114
|
-
const t =
|
|
1238
|
+
}), Xo = (e) => {
|
|
1239
|
+
var i;
|
|
1240
|
+
const t = z(() => {
|
|
1115
1241
|
var l;
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1118
|
-
...
|
|
1242
|
+
const n = (l = e == null ? void 0 : e.items) == null ? void 0 : l.find((r) => r.isActive());
|
|
1243
|
+
return n && !n.default ? {
|
|
1244
|
+
...n
|
|
1119
1245
|
} : {
|
|
1120
1246
|
title: e.tooltip,
|
|
1121
1247
|
level: 0,
|
|
1122
1248
|
isActive: () => !1
|
|
1123
1249
|
};
|
|
1124
1250
|
}, [e]);
|
|
1125
|
-
return /* @__PURE__ */ u(
|
|
1126
|
-
/* @__PURE__ */ o(
|
|
1251
|
+
return /* @__PURE__ */ u(ie, { children: [
|
|
1252
|
+
/* @__PURE__ */ o(ne, { disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(
|
|
1127
1253
|
We,
|
|
1128
1254
|
{
|
|
1129
1255
|
title: t == null ? void 0 : t.title,
|
|
@@ -1132,88 +1258,88 @@ const Me = new qo(), Ue = Ct({
|
|
|
1132
1258
|
icon: "MenuDown"
|
|
1133
1259
|
}
|
|
1134
1260
|
) }),
|
|
1135
|
-
/* @__PURE__ */ o(X, { className: "w-full", children: (
|
|
1261
|
+
/* @__PURE__ */ o(X, { className: "w-full", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((n, a) => {
|
|
1136
1262
|
var l, r;
|
|
1137
1263
|
return /* @__PURE__ */ u(he, { children: [
|
|
1138
1264
|
/* @__PURE__ */ u(
|
|
1139
1265
|
oe,
|
|
1140
1266
|
{
|
|
1141
|
-
checked: (t == null ? void 0 : t.title) ===
|
|
1142
|
-
onClick:
|
|
1267
|
+
checked: (t == null ? void 0 : t.title) === n.title,
|
|
1268
|
+
onClick: n.action,
|
|
1143
1269
|
children: [
|
|
1144
|
-
/* @__PURE__ */ o("div", { className: `ml-1 h-full heading-${
|
|
1145
|
-
!!((l =
|
|
1270
|
+
/* @__PURE__ */ o("div", { className: `ml-1 h-full heading-${n.level}`, children: n.title }),
|
|
1271
|
+
!!((l = n == null ? void 0 : n.shortcutKeys) != null && l.length) && /* @__PURE__ */ o(Vt, { className: "pl-4", children: (r = n == null ? void 0 : n.shortcutKeys) == null ? void 0 : r.map((d) => qe(d)).join(" ") })
|
|
1146
1272
|
]
|
|
1147
1273
|
}
|
|
1148
1274
|
),
|
|
1149
|
-
|
|
1275
|
+
n.level === 0 && /* @__PURE__ */ o(Ie, {})
|
|
1150
1276
|
] }, a);
|
|
1151
1277
|
}) })
|
|
1152
1278
|
] });
|
|
1153
|
-
},
|
|
1279
|
+
}, Wl = Ln.extend({
|
|
1154
1280
|
addOptions() {
|
|
1155
1281
|
var e;
|
|
1156
1282
|
return {
|
|
1157
1283
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1158
1284
|
levels: [1, 2, 3, 4, 5, 6],
|
|
1159
|
-
button({ editor: t, extension:
|
|
1285
|
+
button({ editor: t, extension: i, t: n }) {
|
|
1160
1286
|
var c;
|
|
1161
|
-
const { extensions: a = [] } = t.extensionManager ?? [], l = ((c =
|
|
1287
|
+
const { extensions: a = [] } = t.extensionManager ?? [], l = ((c = i.options) == null ? void 0 : c.levels) || [], r = a.find(
|
|
1162
1288
|
(h) => h.name === "base-kit"
|
|
1163
|
-
),
|
|
1289
|
+
), d = l.map((h) => ({
|
|
1164
1290
|
action: () => t.commands.toggleHeading({ level: h }),
|
|
1165
1291
|
isActive: () => t.isActive("heading", { level: h }) || !1,
|
|
1166
1292
|
disabled: !t.can().toggleHeading({ level: h }),
|
|
1167
|
-
title:
|
|
1293
|
+
title: n(`editor.heading.h${h}.tooltip`),
|
|
1168
1294
|
level: h,
|
|
1169
1295
|
shortcutKeys: ["alt", "mod", `${h}`]
|
|
1170
1296
|
}));
|
|
1171
|
-
r && r.options.paragraph !== !1 &&
|
|
1297
|
+
r && r.options.paragraph !== !1 && d.unshift({
|
|
1172
1298
|
action: () => t.commands.setParagraph(),
|
|
1173
1299
|
isActive: () => t.isActive("paragraph") || !1,
|
|
1174
1300
|
disabled: !t.can().setParagraph(),
|
|
1175
1301
|
level: 0,
|
|
1176
|
-
title:
|
|
1302
|
+
title: n("editor.paragraph.tooltip"),
|
|
1177
1303
|
shortcutKeys: ["alt", "mod", "0"]
|
|
1178
1304
|
});
|
|
1179
|
-
const
|
|
1305
|
+
const s = d.filter((h) => h.disabled).length === d.length;
|
|
1180
1306
|
return {
|
|
1181
|
-
component:
|
|
1307
|
+
component: Xo,
|
|
1182
1308
|
componentProps: {
|
|
1183
|
-
tooltip:
|
|
1184
|
-
disabled:
|
|
1185
|
-
items:
|
|
1309
|
+
tooltip: n("editor.heading.tooltip"),
|
|
1310
|
+
disabled: s,
|
|
1311
|
+
items: d,
|
|
1186
1312
|
editor: t
|
|
1187
1313
|
}
|
|
1188
1314
|
};
|
|
1189
1315
|
}
|
|
1190
1316
|
};
|
|
1191
1317
|
}
|
|
1192
|
-
}),
|
|
1318
|
+
}), C = (e) => {
|
|
1193
1319
|
const t = xe[e.name];
|
|
1194
1320
|
return /* @__PURE__ */ o(M, { children: t && /* @__PURE__ */ o(t, { onClick: e == null ? void 0 : e.onClick, className: `w-4 h-4 ${(e == null ? void 0 : e.className) || ""}` }) });
|
|
1195
|
-
}, ae =
|
|
1196
|
-
|
|
1321
|
+
}, ae = Tn, le = Mn, Z = H.forwardRef(({ className: e, align: t = "center", sideOffset: i = 4, ...n }, a) => /* @__PURE__ */ o(An, { children: /* @__PURE__ */ o(
|
|
1322
|
+
Ct,
|
|
1197
1323
|
{
|
|
1198
1324
|
ref: a,
|
|
1199
1325
|
align: t,
|
|
1200
|
-
sideOffset:
|
|
1326
|
+
sideOffset: i,
|
|
1201
1327
|
className: S(
|
|
1202
1328
|
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
|
|
1203
1329
|
e
|
|
1204
1330
|
),
|
|
1205
|
-
...
|
|
1331
|
+
...n
|
|
1206
1332
|
}
|
|
1207
1333
|
) }));
|
|
1208
|
-
Z.displayName =
|
|
1209
|
-
const
|
|
1210
|
-
var
|
|
1211
|
-
const t =
|
|
1334
|
+
Z.displayName = Ct.displayName;
|
|
1335
|
+
const Zo = (e) => {
|
|
1336
|
+
var i;
|
|
1337
|
+
const t = z(() => {
|
|
1212
1338
|
var l;
|
|
1213
|
-
const
|
|
1214
|
-
return
|
|
1215
|
-
...
|
|
1216
|
-
icon:
|
|
1339
|
+
const n = (l = e == null ? void 0 : e.items) == null ? void 0 : l.find((r) => r.isActive());
|
|
1340
|
+
return n && !n.default ? {
|
|
1341
|
+
...n,
|
|
1342
|
+
icon: n.icon ? n.icon : e.icon
|
|
1217
1343
|
} : {
|
|
1218
1344
|
title: e == null ? void 0 : e.tooltip,
|
|
1219
1345
|
icon: e.icon,
|
|
@@ -1229,7 +1355,7 @@ const Xo = (e) => {
|
|
|
1229
1355
|
icon: e == null ? void 0 : e.icon,
|
|
1230
1356
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1231
1357
|
disabled: e == null ? void 0 : e.disabled,
|
|
1232
|
-
children: /* @__PURE__ */ o(
|
|
1358
|
+
children: /* @__PURE__ */ o(C, { className: "w-3 h-3 ml-1 text-zinc-500", name: "MenuDown" })
|
|
1233
1359
|
}
|
|
1234
1360
|
) }) }),
|
|
1235
1361
|
/* @__PURE__ */ o(
|
|
@@ -1238,30 +1364,30 @@ const Xo = (e) => {
|
|
|
1238
1364
|
className: "min-w-4 w-full !p-[4px] flex flex-row gap-1",
|
|
1239
1365
|
align: "start",
|
|
1240
1366
|
side: "bottom",
|
|
1241
|
-
children: (
|
|
1367
|
+
children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((n, a) => {
|
|
1242
1368
|
var l, r;
|
|
1243
1369
|
return /* @__PURE__ */ u(ye, { children: [
|
|
1244
|
-
/* @__PURE__ */ o(
|
|
1245
|
-
|
|
1370
|
+
/* @__PURE__ */ o(pe, { children: /* @__PURE__ */ o(
|
|
1371
|
+
De,
|
|
1246
1372
|
{
|
|
1247
1373
|
size: "sm",
|
|
1248
|
-
onClick:
|
|
1374
|
+
onClick: n == null ? void 0 : n.action,
|
|
1249
1375
|
className: "w-7 h-7 p-1",
|
|
1250
|
-
pressed: t.title ===
|
|
1251
|
-
"data-state": t.title ===
|
|
1252
|
-
children: (
|
|
1376
|
+
pressed: t.title === n.title,
|
|
1377
|
+
"data-state": t.title === n.title ? "on" : "off",
|
|
1378
|
+
children: (n == null ? void 0 : n.icon) && /* @__PURE__ */ o(C, { name: n.icon })
|
|
1253
1379
|
}
|
|
1254
1380
|
) }),
|
|
1255
1381
|
/* @__PURE__ */ u(fe, { className: "flex flex-col items-center", children: [
|
|
1256
|
-
/* @__PURE__ */ o("span", { children:
|
|
1257
|
-
!!((l =
|
|
1382
|
+
/* @__PURE__ */ o("span", { children: n.title }),
|
|
1383
|
+
!!((l = n.shortcutKeys) != null && l.length) && /* @__PURE__ */ o("span", { children: (r = n.shortcutKeys) == null ? void 0 : r.map((d) => qe(d)).join(" ") })
|
|
1258
1384
|
] })
|
|
1259
1385
|
] }, `text-align-${a}`);
|
|
1260
1386
|
})
|
|
1261
1387
|
}
|
|
1262
1388
|
)
|
|
1263
1389
|
] });
|
|
1264
|
-
},
|
|
1390
|
+
}, Gl = Sn.extend({
|
|
1265
1391
|
addOptions() {
|
|
1266
1392
|
var e;
|
|
1267
1393
|
return {
|
|
@@ -1269,11 +1395,11 @@ const Xo = (e) => {
|
|
|
1269
1395
|
types: ["heading", "paragraph", "list_item", "title"],
|
|
1270
1396
|
button({
|
|
1271
1397
|
editor: t,
|
|
1272
|
-
extension:
|
|
1273
|
-
t:
|
|
1398
|
+
extension: i,
|
|
1399
|
+
t: n
|
|
1274
1400
|
}) {
|
|
1275
1401
|
var c;
|
|
1276
|
-
const a = ((c =
|
|
1402
|
+
const a = ((c = i.options) == null ? void 0 : c.alignments) || [], l = {
|
|
1277
1403
|
left: ["mod", "Shift", "L"],
|
|
1278
1404
|
center: ["mod", "Shift", "E"],
|
|
1279
1405
|
right: ["mod", "Shift", "R"],
|
|
@@ -1283,56 +1409,56 @@ const Xo = (e) => {
|
|
|
1283
1409
|
center: "AlignCenter",
|
|
1284
1410
|
right: "AlignRight",
|
|
1285
1411
|
justify: "AlignJustify"
|
|
1286
|
-
},
|
|
1287
|
-
title:
|
|
1412
|
+
}, d = a.map((h) => ({
|
|
1413
|
+
title: n(`editor.textalign.${h}.tooltip`),
|
|
1288
1414
|
icon: r[h],
|
|
1289
1415
|
shortcutKeys: l[h],
|
|
1290
1416
|
isActive: () => t.isActive({ textAlign: h }) || !1,
|
|
1291
1417
|
action: () => t.commands.setTextAlign(h),
|
|
1292
1418
|
disabled: !t.can().setTextAlign(h)
|
|
1293
|
-
})),
|
|
1419
|
+
})), s = d.filter((h) => h.disabled).length === d.length;
|
|
1294
1420
|
return {
|
|
1295
|
-
component:
|
|
1421
|
+
component: Zo,
|
|
1296
1422
|
componentProps: {
|
|
1297
1423
|
icon: "AlignJustify",
|
|
1298
|
-
tooltip:
|
|
1299
|
-
disabled:
|
|
1300
|
-
items:
|
|
1424
|
+
tooltip: n("editor.textalign.tooltip"),
|
|
1425
|
+
disabled: s,
|
|
1426
|
+
items: d
|
|
1301
1427
|
}
|
|
1302
1428
|
};
|
|
1303
1429
|
}
|
|
1304
1430
|
};
|
|
1305
1431
|
}
|
|
1306
|
-
}),
|
|
1307
|
-
var
|
|
1308
|
-
const { t } =
|
|
1432
|
+
}), Jo = (e) => {
|
|
1433
|
+
var n;
|
|
1434
|
+
const { t } = D(), i = z(() => {
|
|
1309
1435
|
const a = (e.items || []).find((r) => r.isActive());
|
|
1310
1436
|
return a || {
|
|
1311
1437
|
title: t("editor.fontSize.default.tooltip"),
|
|
1312
1438
|
isActive: () => !1
|
|
1313
1439
|
};
|
|
1314
1440
|
}, [e]);
|
|
1315
|
-
return /* @__PURE__ */ u(
|
|
1316
|
-
/* @__PURE__ */ o(
|
|
1441
|
+
return /* @__PURE__ */ u(ie, { children: [
|
|
1442
|
+
/* @__PURE__ */ o(ne, { disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(
|
|
1317
1443
|
We,
|
|
1318
1444
|
{
|
|
1319
|
-
title:
|
|
1445
|
+
title: i == null ? void 0 : i.title,
|
|
1320
1446
|
tooltip: `${e == null ? void 0 : e.tooltip}`,
|
|
1321
1447
|
disabled: e == null ? void 0 : e.disabled,
|
|
1322
1448
|
icon: "MenuDown"
|
|
1323
1449
|
}
|
|
1324
1450
|
) }),
|
|
1325
|
-
/* @__PURE__ */ o(X, { className: "w-32 overflow-y-auto max-h-96", children: (
|
|
1451
|
+
/* @__PURE__ */ o(X, { className: "w-32 overflow-y-auto max-h-96", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, l) => /* @__PURE__ */ o(
|
|
1326
1452
|
oe,
|
|
1327
1453
|
{
|
|
1328
|
-
checked:
|
|
1454
|
+
checked: i.title === a.title,
|
|
1329
1455
|
onClick: a.action,
|
|
1330
1456
|
children: /* @__PURE__ */ o("div", { className: "ml-1 h-full", children: a.title })
|
|
1331
1457
|
},
|
|
1332
1458
|
l
|
|
1333
1459
|
)) })
|
|
1334
1460
|
] });
|
|
1335
|
-
},
|
|
1461
|
+
}, Xl = V.create({
|
|
1336
1462
|
name: "fontSize",
|
|
1337
1463
|
addOptions() {
|
|
1338
1464
|
var e;
|
|
@@ -1340,30 +1466,30 @@ const Xo = (e) => {
|
|
|
1340
1466
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1341
1467
|
types: ["textStyle"],
|
|
1342
1468
|
fontSizes: [...Uo],
|
|
1343
|
-
button({ editor: t, extension:
|
|
1344
|
-
var
|
|
1345
|
-
const a = ((
|
|
1346
|
-
title:
|
|
1469
|
+
button({ editor: t, extension: i, t: n }) {
|
|
1470
|
+
var d;
|
|
1471
|
+
const a = ((d = i.options) == null ? void 0 : d.fontSizes) || [], l = [re, ...a].map((s) => ({
|
|
1472
|
+
title: s === re ? n("editor.fontSize.default.tooltip") : String(s),
|
|
1347
1473
|
isActive: () => {
|
|
1348
1474
|
const { fontSize: c } = t.getAttributes("textStyle");
|
|
1349
|
-
return
|
|
1475
|
+
return s === re && c === void 0 ? !0 : t.isActive({ fontSize: String(s) }) || !1;
|
|
1350
1476
|
},
|
|
1351
1477
|
action: () => {
|
|
1352
|
-
if (
|
|
1478
|
+
if (s === re) {
|
|
1353
1479
|
t.commands.unsetFontSize();
|
|
1354
1480
|
return;
|
|
1355
1481
|
}
|
|
1356
|
-
t.commands.setFontSize(String(
|
|
1482
|
+
t.commands.setFontSize(String(s));
|
|
1357
1483
|
},
|
|
1358
|
-
disabled: !t.can().setFontSize(String(
|
|
1359
|
-
divider:
|
|
1360
|
-
default:
|
|
1361
|
-
})), r = l.filter((
|
|
1484
|
+
disabled: !t.can().setFontSize(String(s)),
|
|
1485
|
+
divider: s === re || !1,
|
|
1486
|
+
default: s === re || !1
|
|
1487
|
+
})), r = l.filter((s) => s.disabled).length === l.length;
|
|
1362
1488
|
return {
|
|
1363
|
-
component:
|
|
1489
|
+
component: Jo,
|
|
1364
1490
|
componentProps: {
|
|
1365
1491
|
editor: t,
|
|
1366
|
-
tooltip:
|
|
1492
|
+
tooltip: n("editor.fontSize.tooltip"),
|
|
1367
1493
|
disabled: r,
|
|
1368
1494
|
items: l,
|
|
1369
1495
|
maxHeight: 280
|
|
@@ -1395,7 +1521,7 @@ const Xo = (e) => {
|
|
|
1395
1521
|
};
|
|
1396
1522
|
}
|
|
1397
1523
|
}), ee = H.forwardRef(
|
|
1398
|
-
({ className: e, type: t, ...
|
|
1524
|
+
({ className: e, type: t, ...i }, n) => /* @__PURE__ */ o(
|
|
1399
1525
|
"input",
|
|
1400
1526
|
{
|
|
1401
1527
|
type: t,
|
|
@@ -1403,37 +1529,37 @@ const Xo = (e) => {
|
|
|
1403
1529
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1404
1530
|
e
|
|
1405
1531
|
),
|
|
1406
|
-
ref:
|
|
1407
|
-
...
|
|
1532
|
+
ref: n,
|
|
1533
|
+
...i
|
|
1408
1534
|
}
|
|
1409
1535
|
)
|
|
1410
1536
|
);
|
|
1411
1537
|
ee.displayName = "Input";
|
|
1412
1538
|
const q = H.forwardRef(
|
|
1413
|
-
({ className: e, orientation: t = "horizontal", decorative:
|
|
1539
|
+
({ className: e, orientation: t = "horizontal", decorative: i = !0, ...n }, a) => /* @__PURE__ */ o(
|
|
1414
1540
|
Nt,
|
|
1415
1541
|
{
|
|
1416
1542
|
ref: a,
|
|
1417
|
-
decorative:
|
|
1543
|
+
decorative: i,
|
|
1418
1544
|
orientation: t,
|
|
1419
1545
|
className: S(
|
|
1420
1546
|
"shrink-0 bg-border",
|
|
1421
1547
|
t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
1422
1548
|
e
|
|
1423
1549
|
),
|
|
1424
|
-
...
|
|
1550
|
+
...n
|
|
1425
1551
|
}
|
|
1426
1552
|
)
|
|
1427
1553
|
);
|
|
1428
1554
|
q.displayName = Nt.displayName;
|
|
1429
|
-
const
|
|
1430
|
-
for (let e = 0; e <
|
|
1431
|
-
Kt.push(
|
|
1432
|
-
const
|
|
1433
|
-
const [t,
|
|
1555
|
+
const it = $o, Kt = [];
|
|
1556
|
+
for (let e = 0; e < it.length; e += 10)
|
|
1557
|
+
Kt.push(it.slice(e, e + 10));
|
|
1558
|
+
const Yo = ({ setColor: e }) => {
|
|
1559
|
+
const [t, i] = N("#000000"), [n, a] = N(!1), { t: l } = D();
|
|
1434
1560
|
return U(() => () => {
|
|
1435
1561
|
a(!1);
|
|
1436
|
-
}, []), /* @__PURE__ */ u(ae, { open:
|
|
1562
|
+
}, []), /* @__PURE__ */ u(ae, { open: n, children: [
|
|
1437
1563
|
/* @__PURE__ */ o(le, { asChild: !0, children: /* @__PURE__ */ u(
|
|
1438
1564
|
"div",
|
|
1439
1565
|
{
|
|
@@ -1449,14 +1575,14 @@ const Jo = ({ setColor: e }) => {
|
|
|
1449
1575
|
) }),
|
|
1450
1576
|
/* @__PURE__ */ u(Z, { children: [
|
|
1451
1577
|
/* @__PURE__ */ u("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1452
|
-
/* @__PURE__ */ o(
|
|
1578
|
+
/* @__PURE__ */ o(Rn, { color: t, onChange: i }),
|
|
1453
1579
|
/* @__PURE__ */ o(
|
|
1454
1580
|
ee,
|
|
1455
1581
|
{
|
|
1456
1582
|
className: "mt-[8px] w-full",
|
|
1457
1583
|
type: "text",
|
|
1458
1584
|
onChange: (r) => {
|
|
1459
|
-
r.preventDefault(),
|
|
1585
|
+
r.preventDefault(), i(`#${r.target.value}`);
|
|
1460
1586
|
},
|
|
1461
1587
|
value: t.slice(1)
|
|
1462
1588
|
}
|
|
@@ -1470,15 +1596,15 @@ const Jo = ({ setColor: e }) => {
|
|
|
1470
1596
|
r.preventDefault(), e(t), a(!1);
|
|
1471
1597
|
},
|
|
1472
1598
|
className: "w-full",
|
|
1473
|
-
children: /* @__PURE__ */ o(
|
|
1599
|
+
children: /* @__PURE__ */ o(st, { size: 16 })
|
|
1474
1600
|
}
|
|
1475
1601
|
)
|
|
1476
1602
|
] })
|
|
1477
1603
|
] });
|
|
1478
1604
|
}, qt = (e) => {
|
|
1479
|
-
const { t } =
|
|
1480
|
-
const f = [...
|
|
1481
|
-
b !== -1 && f.splice(b, 1), f.unshift(m), f.length > 10 && f.pop(),
|
|
1605
|
+
const { t } = D(), { highlight: i = !1, disabled: n = !1, selectedColor: a, setSelectedColor: l, onChange: r } = e, [d, s] = N([]), c = (m) => {
|
|
1606
|
+
const f = [...d], b = f.indexOf(m);
|
|
1607
|
+
b !== -1 && f.splice(b, 1), f.unshift(m), f.length > 10 && f.pop(), s(f);
|
|
1482
1608
|
};
|
|
1483
1609
|
function h(m) {
|
|
1484
1610
|
if (m === void 0) {
|
|
@@ -1488,9 +1614,9 @@ const Jo = ({ setColor: e }) => {
|
|
|
1488
1614
|
/^#([\da-f]{3}){1,2}$/i.test(m) && (l == null || l(m), r == null || r(m), c(m));
|
|
1489
1615
|
}
|
|
1490
1616
|
return /* @__PURE__ */ u(ae, { children: [
|
|
1491
|
-
/* @__PURE__ */ o(le, { disabled:
|
|
1617
|
+
/* @__PURE__ */ o(le, { disabled: n, children: e == null ? void 0 : e.children }),
|
|
1492
1618
|
/* @__PURE__ */ o(Z, { hideWhenDetached: !0, className: "p-2 w-full h-full", align: "start", side: "bottom", children: /* @__PURE__ */ u("div", { className: "flex flex-col", children: [
|
|
1493
|
-
|
|
1619
|
+
i ? /* @__PURE__ */ u(
|
|
1494
1620
|
"div",
|
|
1495
1621
|
{
|
|
1496
1622
|
className: "flex items-center p-1 rd-1 cursor-pointer hover:bg-accent",
|
|
@@ -1591,7 +1717,7 @@ const Jo = ({ setColor: e }) => {
|
|
|
1591
1717
|
)) }, f)),
|
|
1592
1718
|
/* @__PURE__ */ u("div", { children: [
|
|
1593
1719
|
/* @__PURE__ */ o("div", { className: "text-sm my-1", children: t("editor.recent") }),
|
|
1594
|
-
/* @__PURE__ */ o("span", { className: "flex p-0 w-full h-auto relative last:pb-2", children:
|
|
1720
|
+
/* @__PURE__ */ o("span", { className: "flex p-0 w-full h-auto relative last:pb-2", children: d == null ? void 0 : d.map((m, f) => /* @__PURE__ */ o(
|
|
1595
1721
|
"span",
|
|
1596
1722
|
{
|
|
1597
1723
|
className: "w-6 h-6 p-0.5 inline-block rounded-sm border border-transparent flex-[0 0 auto] cursor-pointer hover:border-border hover:shadow-sm",
|
|
@@ -1620,10 +1746,10 @@ const Jo = ({ setColor: e }) => {
|
|
|
1620
1746
|
f
|
|
1621
1747
|
)) })
|
|
1622
1748
|
] }),
|
|
1623
|
-
/* @__PURE__ */ o(
|
|
1749
|
+
/* @__PURE__ */ o(Yo, { setColor: h })
|
|
1624
1750
|
] }) })
|
|
1625
1751
|
] });
|
|
1626
|
-
},
|
|
1752
|
+
}, Qo = ({ fill: e }) => /* @__PURE__ */ o(
|
|
1627
1753
|
"svg",
|
|
1628
1754
|
{
|
|
1629
1755
|
width: "18px",
|
|
@@ -1661,11 +1787,11 @@ const Jo = ({ setColor: e }) => {
|
|
|
1661
1787
|
)
|
|
1662
1788
|
] }) }) })
|
|
1663
1789
|
}
|
|
1664
|
-
),
|
|
1665
|
-
const [t,
|
|
1666
|
-
function
|
|
1667
|
-
var
|
|
1668
|
-
(
|
|
1790
|
+
), ea = (e) => {
|
|
1791
|
+
const [t, i] = N(void 0);
|
|
1792
|
+
function n(r) {
|
|
1793
|
+
var d;
|
|
1794
|
+
(d = e.action) == null || d.call(e, r);
|
|
1669
1795
|
}
|
|
1670
1796
|
function a() {
|
|
1671
1797
|
var r;
|
|
@@ -1673,48 +1799,48 @@ const Jo = ({ setColor: e }) => {
|
|
|
1673
1799
|
}
|
|
1674
1800
|
const l = G(
|
|
1675
1801
|
Lt((r) => {
|
|
1676
|
-
|
|
1802
|
+
i(r);
|
|
1677
1803
|
}, 350),
|
|
1678
1804
|
[]
|
|
1679
1805
|
);
|
|
1680
1806
|
return /* @__PURE__ */ u("div", { className: "flex items-center h-[32px]", children: [
|
|
1681
|
-
/* @__PURE__ */ o(v, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ o("span", { className: "text-sm flex justify-center items-center", children: /* @__PURE__ */ o(
|
|
1807
|
+
/* @__PURE__ */ o(v, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ o("span", { className: "text-sm flex justify-center items-center", children: /* @__PURE__ */ o(Qo, { fill: t }) }) }),
|
|
1682
1808
|
/* @__PURE__ */ o(
|
|
1683
1809
|
qt,
|
|
1684
1810
|
{
|
|
1685
1811
|
selectedColor: t,
|
|
1686
1812
|
setSelectedColor: l,
|
|
1687
|
-
onChange:
|
|
1813
|
+
onChange: n,
|
|
1688
1814
|
disabled: e == null ? void 0 : e.disabled,
|
|
1689
|
-
children: /* @__PURE__ */ o(E, { variant: "ghost", size: "icon", className: "h-[32px] w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(
|
|
1815
|
+
children: /* @__PURE__ */ o(E, { variant: "ghost", size: "icon", className: "h-[32px] w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(C, { className: "w-3 h-3 text-zinc-500", name: "MenuDown" }) })
|
|
1690
1816
|
}
|
|
1691
1817
|
)
|
|
1692
1818
|
] });
|
|
1693
|
-
},
|
|
1819
|
+
}, ta = Hn.extend({
|
|
1694
1820
|
addOptions() {
|
|
1695
1821
|
var e;
|
|
1696
1822
|
return {
|
|
1697
1823
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1698
|
-
button({ editor: t, t:
|
|
1824
|
+
button({ editor: t, t: i }) {
|
|
1699
1825
|
return {
|
|
1700
|
-
component:
|
|
1826
|
+
component: ea,
|
|
1701
1827
|
componentProps: {
|
|
1702
|
-
action: (
|
|
1703
|
-
|
|
1828
|
+
action: (n) => {
|
|
1829
|
+
n === void 0 && t.chain().focus().unsetColor().run(), typeof n == "string" && t.chain().focus().setColor(n).run();
|
|
1704
1830
|
},
|
|
1705
1831
|
isActive: () => {
|
|
1706
|
-
const { color:
|
|
1707
|
-
return
|
|
1832
|
+
const { color: n } = t.getAttributes("textStyle");
|
|
1833
|
+
return n && t.isActive({ color: n }) || !1;
|
|
1708
1834
|
},
|
|
1709
1835
|
editor: t,
|
|
1710
1836
|
disabled: !t.can().setColor(""),
|
|
1711
|
-
tooltip:
|
|
1837
|
+
tooltip: i("editor.color.tooltip")
|
|
1712
1838
|
}
|
|
1713
1839
|
};
|
|
1714
1840
|
}
|
|
1715
1841
|
};
|
|
1716
1842
|
}
|
|
1717
|
-
}),
|
|
1843
|
+
}), ia = ({ fill: e }) => /* @__PURE__ */ o(
|
|
1718
1844
|
"svg",
|
|
1719
1845
|
{
|
|
1720
1846
|
width: "18px",
|
|
@@ -1764,10 +1890,10 @@ const Jo = ({ setColor: e }) => {
|
|
|
1764
1890
|
] }) })
|
|
1765
1891
|
}
|
|
1766
1892
|
), Wt = (e) => {
|
|
1767
|
-
const [t,
|
|
1768
|
-
function
|
|
1769
|
-
var
|
|
1770
|
-
(
|
|
1893
|
+
const [t, i] = N(void 0);
|
|
1894
|
+
function n(r) {
|
|
1895
|
+
var d;
|
|
1896
|
+
(d = e.action) == null || d.call(e, r);
|
|
1771
1897
|
}
|
|
1772
1898
|
function a() {
|
|
1773
1899
|
var r;
|
|
@@ -1775,7 +1901,7 @@ const Jo = ({ setColor: e }) => {
|
|
|
1775
1901
|
}
|
|
1776
1902
|
const l = G(
|
|
1777
1903
|
Lt((r) => {
|
|
1778
|
-
|
|
1904
|
+
i(r);
|
|
1779
1905
|
}, 350),
|
|
1780
1906
|
[]
|
|
1781
1907
|
);
|
|
@@ -1788,7 +1914,7 @@ const Jo = ({ setColor: e }) => {
|
|
|
1788
1914
|
action: a,
|
|
1789
1915
|
tooltipOptions: e == null ? void 0 : e.tooltipOptions,
|
|
1790
1916
|
shortcutKeys: e == null ? void 0 : e.shortcutKeys,
|
|
1791
|
-
children: /* @__PURE__ */ o("span", { className: "text-sm flex items-center justify-center", children: /* @__PURE__ */ o(
|
|
1917
|
+
children: /* @__PURE__ */ o("span", { className: "text-sm flex items-center justify-center", children: /* @__PURE__ */ o(ia, { fill: t }) })
|
|
1792
1918
|
}
|
|
1793
1919
|
),
|
|
1794
1920
|
/* @__PURE__ */ o(
|
|
@@ -1796,40 +1922,40 @@ const Jo = ({ setColor: e }) => {
|
|
|
1796
1922
|
{
|
|
1797
1923
|
selectedColor: t,
|
|
1798
1924
|
setSelectedColor: l,
|
|
1799
|
-
onChange:
|
|
1925
|
+
onChange: n,
|
|
1800
1926
|
highlight: !0,
|
|
1801
1927
|
disabled: e == null ? void 0 : e.disabled,
|
|
1802
|
-
children: /* @__PURE__ */ o(E, { variant: "ghost", size: "icon", className: "w-3 h-[32px]", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(
|
|
1928
|
+
children: /* @__PURE__ */ o(E, { variant: "ghost", size: "icon", className: "w-3 h-[32px]", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(C, { className: "w-3 h-3 text-zinc-500", name: "MenuDown" }) })
|
|
1803
1929
|
}
|
|
1804
1930
|
)
|
|
1805
1931
|
] });
|
|
1806
|
-
}, na =
|
|
1932
|
+
}, na = zn.extend({
|
|
1807
1933
|
addOptions() {
|
|
1808
1934
|
var e;
|
|
1809
1935
|
return {
|
|
1810
1936
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1811
1937
|
multicolor: !0,
|
|
1812
|
-
button: ({ editor: t, t:
|
|
1938
|
+
button: ({ editor: t, t: i }) => ({
|
|
1813
1939
|
component: Wt,
|
|
1814
1940
|
componentProps: {
|
|
1815
|
-
action: (
|
|
1816
|
-
typeof
|
|
1941
|
+
action: (n) => {
|
|
1942
|
+
typeof n == "string" && t.chain().focus().setHighlight({ color: n }).run(), n === void 0 && t.chain().focus().unsetHighlight().run();
|
|
1817
1943
|
},
|
|
1818
1944
|
editor: t,
|
|
1819
1945
|
isActive: () => t.isActive("highlight") || !1,
|
|
1820
1946
|
disabled: !t.can().setHighlight(),
|
|
1821
1947
|
shortcutKeys: ["⇧", "mod", "H"],
|
|
1822
|
-
tooltip:
|
|
1948
|
+
tooltip: i("editor.highlight.tooltip")
|
|
1823
1949
|
}
|
|
1824
1950
|
})
|
|
1825
1951
|
};
|
|
1826
1952
|
}
|
|
1827
|
-
}),
|
|
1953
|
+
}), Zl = Dn.extend({
|
|
1828
1954
|
addOptions() {
|
|
1829
1955
|
var e;
|
|
1830
1956
|
return {
|
|
1831
1957
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1832
|
-
button: ({ editor: t, t:
|
|
1958
|
+
button: ({ editor: t, t: i }) => ({
|
|
1833
1959
|
component: v,
|
|
1834
1960
|
componentProps: {
|
|
1835
1961
|
action: () => t.commands.toggleBulletList(),
|
|
@@ -1837,34 +1963,34 @@ const Jo = ({ setColor: e }) => {
|
|
|
1837
1963
|
disabled: !t.can().toggleBulletList(),
|
|
1838
1964
|
shortcutKeys: ["shift", "mod", "8"],
|
|
1839
1965
|
icon: "List",
|
|
1840
|
-
tooltip:
|
|
1966
|
+
tooltip: i("editor.bulletlist.tooltip")
|
|
1841
1967
|
}
|
|
1842
1968
|
})
|
|
1843
1969
|
};
|
|
1844
1970
|
}
|
|
1845
|
-
}),
|
|
1971
|
+
}), Jl = te.create({
|
|
1846
1972
|
name: "clear",
|
|
1847
1973
|
addOptions() {
|
|
1848
1974
|
var e;
|
|
1849
1975
|
return {
|
|
1850
1976
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1851
|
-
button: ({ editor: t, t:
|
|
1977
|
+
button: ({ editor: t, t: i }) => ({
|
|
1852
1978
|
component: v,
|
|
1853
1979
|
componentProps: {
|
|
1854
1980
|
action: () => t.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
1855
1981
|
disabled: !t.can().chain().focus().clearNodes().unsetAllMarks().run(),
|
|
1856
1982
|
icon: "Eraser",
|
|
1857
|
-
tooltip:
|
|
1983
|
+
tooltip: i("editor.clear.tooltip")
|
|
1858
1984
|
}
|
|
1859
1985
|
})
|
|
1860
1986
|
};
|
|
1861
1987
|
}
|
|
1862
|
-
}),
|
|
1988
|
+
}), Yl = Bn.extend({
|
|
1863
1989
|
addOptions() {
|
|
1864
1990
|
var e;
|
|
1865
1991
|
return {
|
|
1866
1992
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
1867
|
-
button: ({ editor: t, t:
|
|
1993
|
+
button: ({ editor: t, t: i }) => ({
|
|
1868
1994
|
component: v,
|
|
1869
1995
|
componentProps: {
|
|
1870
1996
|
action: () => t.commands.toggleOrderedList(),
|
|
@@ -1872,12 +1998,12 @@ const Jo = ({ setColor: e }) => {
|
|
|
1872
1998
|
disabled: !t.can().toggleOrderedList(),
|
|
1873
1999
|
icon: "ListOrdered",
|
|
1874
2000
|
shortcutKeys: ["mod", "shift", "7"],
|
|
1875
|
-
tooltip:
|
|
2001
|
+
tooltip: i("editor.orderedlist.tooltip")
|
|
1876
2002
|
}
|
|
1877
2003
|
})
|
|
1878
2004
|
};
|
|
1879
2005
|
}
|
|
1880
|
-
}),
|
|
2006
|
+
}), Ql = In.extend({
|
|
1881
2007
|
addOptions() {
|
|
1882
2008
|
var e;
|
|
1883
2009
|
return {
|
|
@@ -1890,7 +2016,7 @@ const Jo = ({ setColor: e }) => {
|
|
|
1890
2016
|
class: "task-list-item"
|
|
1891
2017
|
}
|
|
1892
2018
|
},
|
|
1893
|
-
button: ({ editor: t, t:
|
|
2019
|
+
button: ({ editor: t, t: i }) => ({
|
|
1894
2020
|
component: v,
|
|
1895
2021
|
componentProps: {
|
|
1896
2022
|
action: () => t.commands.toggleTaskList(),
|
|
@@ -1898,15 +2024,15 @@ const Jo = ({ setColor: e }) => {
|
|
|
1898
2024
|
disabled: !t.can().toggleTaskList(),
|
|
1899
2025
|
icon: "ListTodo",
|
|
1900
2026
|
shortcutKeys: ["shift", "mod", "9"],
|
|
1901
|
-
tooltip:
|
|
2027
|
+
tooltip: i("editor.tasklist.tooltip")
|
|
1902
2028
|
}
|
|
1903
2029
|
})
|
|
1904
2030
|
};
|
|
1905
2031
|
},
|
|
1906
2032
|
addExtensions() {
|
|
1907
|
-
return [
|
|
2033
|
+
return [Fn.configure(this.options.taskItem)];
|
|
1908
2034
|
}
|
|
1909
|
-
}),
|
|
2035
|
+
}), er = Pn.extend({
|
|
1910
2036
|
addOptions() {
|
|
1911
2037
|
var e;
|
|
1912
2038
|
return {
|
|
@@ -1914,7 +2040,7 @@ const Jo = ({ setColor: e }) => {
|
|
|
1914
2040
|
HTMLAttributes: {
|
|
1915
2041
|
class: "blockquote"
|
|
1916
2042
|
},
|
|
1917
|
-
button: ({ editor: t, t:
|
|
2043
|
+
button: ({ editor: t, t: i }) => ({
|
|
1918
2044
|
component: v,
|
|
1919
2045
|
componentProps: {
|
|
1920
2046
|
action: () => t.commands.toggleBlockquote(),
|
|
@@ -1922,23 +2048,23 @@ const Jo = ({ setColor: e }) => {
|
|
|
1922
2048
|
disabled: !t.can().toggleBlockquote(),
|
|
1923
2049
|
icon: "TextQuote",
|
|
1924
2050
|
shortcutKeys: ["shift", "mod", "B"],
|
|
1925
|
-
tooltip:
|
|
2051
|
+
tooltip: i("editor.blockquote.tooltip")
|
|
1926
2052
|
}
|
|
1927
2053
|
})
|
|
1928
2054
|
};
|
|
1929
2055
|
}
|
|
1930
|
-
}),
|
|
2056
|
+
}), oa = Ke(
|
|
1931
2057
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1932
|
-
), Ae = H.forwardRef(({ className: e, ...t },
|
|
2058
|
+
), Ae = H.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ o(
|
|
1933
2059
|
At,
|
|
1934
2060
|
{
|
|
1935
|
-
ref:
|
|
1936
|
-
className: S(
|
|
2061
|
+
ref: i,
|
|
2062
|
+
className: S(oa(), e),
|
|
1937
2063
|
...t
|
|
1938
2064
|
}
|
|
1939
2065
|
));
|
|
1940
2066
|
Ae.displayName = At.displayName;
|
|
1941
|
-
const Gt = H.forwardRef(({ className: e, ...t },
|
|
2067
|
+
const Gt = H.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ o(
|
|
1942
2068
|
Tt,
|
|
1943
2069
|
{
|
|
1944
2070
|
className: S(
|
|
@@ -1946,9 +2072,9 @@ const Gt = H.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
1946
2072
|
e
|
|
1947
2073
|
),
|
|
1948
2074
|
...t,
|
|
1949
|
-
ref:
|
|
2075
|
+
ref: i,
|
|
1950
2076
|
children: /* @__PURE__ */ o(
|
|
1951
|
-
|
|
2077
|
+
On,
|
|
1952
2078
|
{
|
|
1953
2079
|
className: S(
|
|
1954
2080
|
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
@@ -1959,22 +2085,22 @@ const Gt = H.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
1959
2085
|
));
|
|
1960
2086
|
Gt.displayName = Tt.displayName;
|
|
1961
2087
|
const Xt = (e) => {
|
|
1962
|
-
const { t } =
|
|
2088
|
+
const { t } = D(), [i, n] = N({
|
|
1963
2089
|
text: "",
|
|
1964
2090
|
link: ""
|
|
1965
2091
|
}), [a, l] = N(!1);
|
|
1966
2092
|
U(() => {
|
|
1967
|
-
var
|
|
2093
|
+
var d;
|
|
1968
2094
|
if (e != null && e.editor) {
|
|
1969
|
-
const { href:
|
|
1970
|
-
|
|
1971
|
-
link:
|
|
2095
|
+
const { href: s, target: c } = (d = e.editor) == null ? void 0 : d.getAttributes("link"), { from: h, to: m } = e.editor.state.selection, f = e.editor.state.doc.textBetween(h, m, " ");
|
|
2096
|
+
n({
|
|
2097
|
+
link: s,
|
|
1972
2098
|
text: f
|
|
1973
2099
|
}), l(c === "_blank");
|
|
1974
2100
|
}
|
|
1975
2101
|
}, [e == null ? void 0 : e.editor]);
|
|
1976
|
-
function r(
|
|
1977
|
-
|
|
2102
|
+
function r(d) {
|
|
2103
|
+
d.preventDefault(), e == null || e.onSetLink(i.link, i.text, a);
|
|
1978
2104
|
}
|
|
1979
2105
|
return /* @__PURE__ */ o("div", { className: "p-2 bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800", children: /* @__PURE__ */ u("form", { className: "flex flex-col gap-2", onSubmit: r, children: [
|
|
1980
2106
|
/* @__PURE__ */ u(Ae, { children: [
|
|
@@ -1986,11 +2112,11 @@ const Xt = (e) => {
|
|
|
1986
2112
|
ee,
|
|
1987
2113
|
{
|
|
1988
2114
|
type: "text",
|
|
1989
|
-
value:
|
|
2115
|
+
value: i.text,
|
|
1990
2116
|
required: !0,
|
|
1991
2117
|
className: "w-80",
|
|
1992
2118
|
placeholder: "Text",
|
|
1993
|
-
onChange: (
|
|
2119
|
+
onChange: (d) => n({ ...i, text: d.target.value })
|
|
1994
2120
|
}
|
|
1995
2121
|
) }) }),
|
|
1996
2122
|
/* @__PURE__ */ o(Ae, { children: t("editor.link.dialog.link") }),
|
|
@@ -1999,13 +2125,13 @@ const Xt = (e) => {
|
|
|
1999
2125
|
ee,
|
|
2000
2126
|
{
|
|
2001
2127
|
type: "url",
|
|
2002
|
-
value:
|
|
2128
|
+
value: i.link,
|
|
2003
2129
|
required: !0,
|
|
2004
2130
|
className: "pl-10",
|
|
2005
|
-
onChange: (
|
|
2131
|
+
onChange: (d) => n({ ...i, link: d.target.value })
|
|
2006
2132
|
}
|
|
2007
2133
|
),
|
|
2008
|
-
/* @__PURE__ */ o("span", { className: "absolute start-0 inset-y-0 flex items-center justify-center px-2", children: /* @__PURE__ */ o(
|
|
2134
|
+
/* @__PURE__ */ o("span", { className: "absolute start-0 inset-y-0 flex items-center justify-center px-2", children: /* @__PURE__ */ o(C, { className: "size-5 text-muted-foreground", name: "Link" }) })
|
|
2009
2135
|
] }) }),
|
|
2010
2136
|
/* @__PURE__ */ u("div", { className: "flex items-center space-x-2", children: [
|
|
2011
2137
|
/* @__PURE__ */ o(Ae, { children: t("editor.link.dialog.openInNewTab") }),
|
|
@@ -2013,17 +2139,17 @@ const Xt = (e) => {
|
|
|
2013
2139
|
Gt,
|
|
2014
2140
|
{
|
|
2015
2141
|
checked: a,
|
|
2016
|
-
onCheckedChange: (
|
|
2017
|
-
l(
|
|
2142
|
+
onCheckedChange: (d) => {
|
|
2143
|
+
l(d);
|
|
2018
2144
|
}
|
|
2019
2145
|
}
|
|
2020
2146
|
)
|
|
2021
2147
|
] }),
|
|
2022
2148
|
/* @__PURE__ */ o(E, { type: "submit", className: "mt-2 self-end", children: t("editor.link.dialog.button.apply") })
|
|
2023
2149
|
] }) });
|
|
2024
|
-
},
|
|
2025
|
-
function t(
|
|
2026
|
-
e.action && e.action({ link:
|
|
2150
|
+
}, aa = (e) => {
|
|
2151
|
+
function t(i, n, a) {
|
|
2152
|
+
e.action && e.action({ link: i, text: n, openInNewTab: a });
|
|
2027
2153
|
}
|
|
2028
2154
|
return /* @__PURE__ */ u(ae, { children: [
|
|
2029
2155
|
/* @__PURE__ */ o(le, { disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(he, { children: /* @__PURE__ */ o(
|
|
@@ -2032,12 +2158,12 @@ const Xt = (e) => {
|
|
|
2032
2158
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
2033
2159
|
isActive: e == null ? void 0 : e.isActive,
|
|
2034
2160
|
disabled: e == null ? void 0 : e.disabled,
|
|
2035
|
-
children: /* @__PURE__ */ o(
|
|
2161
|
+
children: /* @__PURE__ */ o(C, { name: e == null ? void 0 : e.icon })
|
|
2036
2162
|
}
|
|
2037
2163
|
) }) }),
|
|
2038
2164
|
/* @__PURE__ */ o(Z, { hideWhenDetached: !0, className: "w-full", align: "start", side: "bottom", children: /* @__PURE__ */ o(Xt, { editor: e.editor, onSetLink: t }) })
|
|
2039
2165
|
] });
|
|
2040
|
-
},
|
|
2166
|
+
}, la = En.extend({
|
|
2041
2167
|
inclusive: !1,
|
|
2042
2168
|
parseHTML() {
|
|
2043
2169
|
return [
|
|
@@ -2060,12 +2186,12 @@ const Xt = (e) => {
|
|
|
2060
2186
|
return {
|
|
2061
2187
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2062
2188
|
openOnClick: !0,
|
|
2063
|
-
button: ({ editor: t, t:
|
|
2064
|
-
component:
|
|
2189
|
+
button: ({ editor: t, t: i }) => ({
|
|
2190
|
+
component: aa,
|
|
2065
2191
|
componentProps: {
|
|
2066
2192
|
editor: t,
|
|
2067
|
-
action: (
|
|
2068
|
-
const { link: a, text: l, openInNewTab: r } =
|
|
2193
|
+
action: (n) => {
|
|
2194
|
+
const { link: a, text: l, openInNewTab: r } = n;
|
|
2069
2195
|
t.chain().extendMarkRange("link").insertContent({
|
|
2070
2196
|
type: "text",
|
|
2071
2197
|
text: l,
|
|
@@ -2084,7 +2210,7 @@ const Xt = (e) => {
|
|
|
2084
2210
|
isActive: () => t.isActive("link") || !1,
|
|
2085
2211
|
disabled: !t.can().setLink({ href: "" }),
|
|
2086
2212
|
icon: "Link",
|
|
2087
|
-
tooltip:
|
|
2213
|
+
tooltip: i("editor.link.tooltip")
|
|
2088
2214
|
}
|
|
2089
2215
|
})
|
|
2090
2216
|
};
|
|
@@ -2094,17 +2220,17 @@ const Xt = (e) => {
|
|
|
2094
2220
|
new ue({
|
|
2095
2221
|
props: {
|
|
2096
2222
|
handleClick: (e, t) => {
|
|
2097
|
-
const { schema:
|
|
2223
|
+
const { schema: i, doc: n, tr: a } = e.state, l = _n(n.resolve(t), i.marks.link);
|
|
2098
2224
|
if (!l)
|
|
2099
2225
|
return !1;
|
|
2100
|
-
const r =
|
|
2101
|
-
e.dispatch(
|
|
2226
|
+
const r = n.resolve(l.from), d = n.resolve(l.to), s = a.setSelection(new Re(r, d));
|
|
2227
|
+
e.dispatch(s);
|
|
2102
2228
|
}
|
|
2103
2229
|
}
|
|
2104
2230
|
})
|
|
2105
2231
|
];
|
|
2106
2232
|
}
|
|
2107
|
-
}),
|
|
2233
|
+
}), tr = $n.extend({
|
|
2108
2234
|
renderHTML() {
|
|
2109
2235
|
return [
|
|
2110
2236
|
"div",
|
|
@@ -2118,14 +2244,14 @@ const Xt = (e) => {
|
|
|
2118
2244
|
var e;
|
|
2119
2245
|
return {
|
|
2120
2246
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2121
|
-
button: ({ editor: t, t:
|
|
2247
|
+
button: ({ editor: t, t: i }) => ({
|
|
2122
2248
|
component: v,
|
|
2123
2249
|
componentProps: {
|
|
2124
2250
|
action: () => t.commands.setHorizontalRule(),
|
|
2125
2251
|
disabled: !t.can().setHorizontalRule(),
|
|
2126
2252
|
icon: "Minus",
|
|
2127
2253
|
shortcutKeys: ["mod", "alt", "S"],
|
|
2128
|
-
tooltip:
|
|
2254
|
+
tooltip: i("editor.horizontalrule.tooltip")
|
|
2129
2255
|
}
|
|
2130
2256
|
})
|
|
2131
2257
|
};
|
|
@@ -2135,25 +2261,25 @@ const Xt = (e) => {
|
|
|
2135
2261
|
"Mod-Alt-s": () => this.editor.commands.setHorizontalRule()
|
|
2136
2262
|
};
|
|
2137
2263
|
}
|
|
2138
|
-
}),
|
|
2264
|
+
}), ra = (e) => {
|
|
2139
2265
|
var w;
|
|
2140
2266
|
const {
|
|
2141
2267
|
icon: t = void 0,
|
|
2142
|
-
title:
|
|
2143
|
-
tooltip:
|
|
2268
|
+
title: i = void 0,
|
|
2269
|
+
tooltip: n = void 0,
|
|
2144
2270
|
disabled: a = !1,
|
|
2145
2271
|
customClass: l = "",
|
|
2146
2272
|
color: r = void 0,
|
|
2147
|
-
loading:
|
|
2148
|
-
shortcutKeys:
|
|
2273
|
+
loading: d = !1,
|
|
2274
|
+
shortcutKeys: s = void 0,
|
|
2149
2275
|
tooltipOptions: c = {},
|
|
2150
2276
|
action: h = void 0,
|
|
2151
2277
|
isActive: m = void 0,
|
|
2152
2278
|
children: f
|
|
2153
2279
|
} = e, b = xe[t];
|
|
2154
2280
|
return /* @__PURE__ */ u(ye, { children: [
|
|
2155
|
-
/* @__PURE__ */ o(
|
|
2156
|
-
|
|
2281
|
+
/* @__PURE__ */ o(pe, { children: /* @__PURE__ */ u(
|
|
2282
|
+
De,
|
|
2157
2283
|
{
|
|
2158
2284
|
size: "sm",
|
|
2159
2285
|
className: "w-[32px] h-[32px] " + l,
|
|
@@ -2165,29 +2291,29 @@ const Xt = (e) => {
|
|
|
2165
2291
|
]
|
|
2166
2292
|
}
|
|
2167
2293
|
) }),
|
|
2168
|
-
|
|
2169
|
-
/* @__PURE__ */ o("div", { children:
|
|
2294
|
+
n && /* @__PURE__ */ o(fe, { ...c, children: /* @__PURE__ */ u("div", { className: "max-w-24 text-center flex flex-col items-center", children: [
|
|
2295
|
+
/* @__PURE__ */ o("div", { children: n }),
|
|
2170
2296
|
!!((w = e == null ? void 0 : e.shortcutKeys) != null && w.length) && /* @__PURE__ */ o("span", { children: Be(e == null ? void 0 : e.shortcutKeys) })
|
|
2171
2297
|
] }) })
|
|
2172
2298
|
] });
|
|
2173
|
-
},
|
|
2299
|
+
}, da = ["undo", "redo"], ir = Un.extend({
|
|
2174
2300
|
addOptions() {
|
|
2175
2301
|
var e;
|
|
2176
2302
|
return {
|
|
2177
2303
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2178
2304
|
depth: 100,
|
|
2179
2305
|
newGroupDelay: 500,
|
|
2180
|
-
button: ({ editor: t, t:
|
|
2181
|
-
component:
|
|
2306
|
+
button: ({ editor: t, t: i }) => da.map((n) => ({
|
|
2307
|
+
component: ra,
|
|
2182
2308
|
componentProps: {
|
|
2183
2309
|
action: () => {
|
|
2184
|
-
|
|
2310
|
+
n === "undo" && t.chain().focus().undo().run(), n === "redo" && t.chain().focus().redo().run();
|
|
2185
2311
|
},
|
|
2186
|
-
shortcutKeys:
|
|
2187
|
-
disabled:
|
|
2188
|
-
isActive: () =>
|
|
2189
|
-
icon:
|
|
2190
|
-
tooltip:
|
|
2312
|
+
shortcutKeys: n === "undo" ? ["mod", "Z"] : ["shift", "mod", "Z"],
|
|
2313
|
+
disabled: n === "undo" ? !t.can().undo() : !t.can().redo(),
|
|
2314
|
+
isActive: () => n === "undo" ? !t.can().undo() : !t.can().redo(),
|
|
2315
|
+
icon: n === "undo" ? "Undo2" : "Redo2",
|
|
2316
|
+
tooltip: i(`editor.${n}.tooltip`)
|
|
2191
2317
|
}
|
|
2192
2318
|
}))
|
|
2193
2319
|
};
|
|
@@ -2195,7 +2321,7 @@ const Xt = (e) => {
|
|
|
2195
2321
|
}), sa = Mt.extend({
|
|
2196
2322
|
content: "(block|columns)+"
|
|
2197
2323
|
// echo editor is a block editor
|
|
2198
|
-
}),
|
|
2324
|
+
}), ca = te.create({
|
|
2199
2325
|
name: "column",
|
|
2200
2326
|
content: "block+",
|
|
2201
2327
|
isolating: !0,
|
|
@@ -2220,7 +2346,7 @@ const Xt = (e) => {
|
|
|
2220
2346
|
}
|
|
2221
2347
|
});
|
|
2222
2348
|
var Y = /* @__PURE__ */ ((e) => (e.SidebarLeft = "sidebar-left", e.SidebarRight = "sidebar-right", e.TwoColumn = "two-column", e))(Y || {});
|
|
2223
|
-
const
|
|
2349
|
+
const ua = te.create({
|
|
2224
2350
|
name: "columns",
|
|
2225
2351
|
group: "columns",
|
|
2226
2352
|
content: "column+",
|
|
@@ -2261,7 +2387,7 @@ const ca = te.create({
|
|
|
2261
2387
|
];
|
|
2262
2388
|
},
|
|
2263
2389
|
addExtensions() {
|
|
2264
|
-
return [
|
|
2390
|
+
return [ca.configure(this.options.columnOptions)];
|
|
2265
2391
|
}
|
|
2266
2392
|
}), nr = V.create({
|
|
2267
2393
|
name: "columnToolbar",
|
|
@@ -2269,19 +2395,19 @@ const ca = te.create({
|
|
|
2269
2395
|
var e;
|
|
2270
2396
|
return {
|
|
2271
2397
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2272
|
-
button: ({ editor: t, t:
|
|
2398
|
+
button: ({ editor: t, t: i }) => ({
|
|
2273
2399
|
component: v,
|
|
2274
2400
|
componentProps: {
|
|
2275
2401
|
action: () => {
|
|
2276
2402
|
t.chain().setColumns().focus(t.state.selection.head - 1).run();
|
|
2277
2403
|
},
|
|
2278
2404
|
icon: "Columns",
|
|
2279
|
-
tooltip:
|
|
2405
|
+
tooltip: i("editor.columns.tooltip")
|
|
2280
2406
|
}
|
|
2281
2407
|
})
|
|
2282
2408
|
};
|
|
2283
2409
|
}
|
|
2284
|
-
}),
|
|
2410
|
+
}), ma = V.create({
|
|
2285
2411
|
name: "selection",
|
|
2286
2412
|
addProseMirrorPlugins() {
|
|
2287
2413
|
const { editor: e } = this;
|
|
@@ -2300,8 +2426,8 @@ const ca = te.create({
|
|
|
2300
2426
|
})
|
|
2301
2427
|
];
|
|
2302
2428
|
}
|
|
2303
|
-
}),
|
|
2304
|
-
const { t } =
|
|
2429
|
+
}), ha = (e) => {
|
|
2430
|
+
const { t } = D(), i = z(() => [
|
|
2305
2431
|
{
|
|
2306
2432
|
name: "paragraph",
|
|
2307
2433
|
label: t("editor.paragraph.tooltip"),
|
|
@@ -2365,24 +2491,24 @@ const ca = te.create({
|
|
|
2365
2491
|
iconName: "Code2",
|
|
2366
2492
|
action: () => e.editor.chain().focus().clearNodes().toggleCodeBlock().run()
|
|
2367
2493
|
}
|
|
2368
|
-
], [e.editor, t]),
|
|
2494
|
+
], [e.editor, t]), n = z(() => i.filter((a) => a.isActive()).pop() ?? {
|
|
2369
2495
|
label: "Empty"
|
|
2370
|
-
}, [
|
|
2371
|
-
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ u(
|
|
2372
|
-
/* @__PURE__ */ o(
|
|
2496
|
+
}, [i]);
|
|
2497
|
+
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ u(ie, { children: [
|
|
2498
|
+
/* @__PURE__ */ o(ne, { children: /* @__PURE__ */ u(E, { variant: "ghost", className: "h-[32px] flex gap-1 px-1.5", children: [
|
|
2373
2499
|
/* @__PURE__ */ u("span", { className: "whitespace-nowrap text-sm font-normal", children: [
|
|
2374
2500
|
" ",
|
|
2375
|
-
|
|
2501
|
+
n == null ? void 0 : n.label
|
|
2376
2502
|
] }),
|
|
2377
|
-
/* @__PURE__ */ o(
|
|
2503
|
+
/* @__PURE__ */ o(dt, { className: "w-4 h-4" })
|
|
2378
2504
|
] }) }),
|
|
2379
|
-
/* @__PURE__ */ o(X, { hideWhenDetached: !0, className: "w-full p-1", align: "start", sideOffset: 5, children:
|
|
2380
|
-
var
|
|
2505
|
+
/* @__PURE__ */ o(X, { hideWhenDetached: !0, className: "w-full p-1", align: "start", sideOffset: 5, children: i.map((a, l) => {
|
|
2506
|
+
var d;
|
|
2381
2507
|
const r = xe[a.iconName];
|
|
2382
2508
|
return /* @__PURE__ */ o(
|
|
2383
2509
|
oe,
|
|
2384
2510
|
{
|
|
2385
|
-
checked: ((
|
|
2511
|
+
checked: ((d = a.isActive) == null ? void 0 : d.call(a)) || !1,
|
|
2386
2512
|
onClick: () => a.action(),
|
|
2387
2513
|
className: "cursor-pointer",
|
|
2388
2514
|
children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 px-2", children: [
|
|
@@ -2397,7 +2523,7 @@ const ca = te.create({
|
|
|
2397
2523
|
);
|
|
2398
2524
|
}) })
|
|
2399
2525
|
] }) });
|
|
2400
|
-
},
|
|
2526
|
+
}, fa = V.create({
|
|
2401
2527
|
name: "text-bubble",
|
|
2402
2528
|
addOptions() {
|
|
2403
2529
|
var e;
|
|
@@ -2405,16 +2531,16 @@ const ca = te.create({
|
|
|
2405
2531
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2406
2532
|
toolbar: !1,
|
|
2407
2533
|
button: () => ({
|
|
2408
|
-
component:
|
|
2534
|
+
component: ha,
|
|
2409
2535
|
componentProps: {}
|
|
2410
2536
|
})
|
|
2411
2537
|
};
|
|
2412
2538
|
}
|
|
2413
2539
|
});
|
|
2414
|
-
function
|
|
2540
|
+
function nt({ types: e, node: t }) {
|
|
2415
2541
|
return Array.isArray(e) && e.includes(t.type) || t.type === e;
|
|
2416
2542
|
}
|
|
2417
|
-
const
|
|
2543
|
+
const ga = V.create({
|
|
2418
2544
|
name: "trailingNode",
|
|
2419
2545
|
addOptions() {
|
|
2420
2546
|
return {
|
|
@@ -2423,105 +2549,105 @@ const fa = V.create({
|
|
|
2423
2549
|
};
|
|
2424
2550
|
},
|
|
2425
2551
|
addProseMirrorPlugins() {
|
|
2426
|
-
const e = new we(this.name), t = Object.entries(this.editor.schema.nodes).map(([,
|
|
2552
|
+
const e = new we(this.name), t = Object.entries(this.editor.schema.nodes).map(([, i]) => i).filter((i) => this.options.notAfter.includes(i.name));
|
|
2427
2553
|
return [
|
|
2428
2554
|
new ue({
|
|
2429
2555
|
key: e,
|
|
2430
|
-
appendTransaction: (
|
|
2431
|
-
const { doc: l, tr: r, schema:
|
|
2432
|
-
if (
|
|
2556
|
+
appendTransaction: (i, n, a) => {
|
|
2557
|
+
const { doc: l, tr: r, schema: d } = a, s = e.getState(a), c = l.content.size, h = d.nodes[this.options.node];
|
|
2558
|
+
if (s)
|
|
2433
2559
|
return r.insert(c, h.create());
|
|
2434
2560
|
},
|
|
2435
2561
|
state: {
|
|
2436
|
-
init: (
|
|
2437
|
-
const a =
|
|
2438
|
-
return !
|
|
2562
|
+
init: (i, n) => {
|
|
2563
|
+
const a = n.tr.doc.lastChild;
|
|
2564
|
+
return !nt({ node: a, types: t });
|
|
2439
2565
|
},
|
|
2440
|
-
apply: (
|
|
2441
|
-
if (!
|
|
2442
|
-
return
|
|
2443
|
-
const a =
|
|
2444
|
-
return !
|
|
2566
|
+
apply: (i, n) => {
|
|
2567
|
+
if (!i.docChanged)
|
|
2568
|
+
return n;
|
|
2569
|
+
const a = i.doc.lastChild;
|
|
2570
|
+
return !nt({ node: a, types: t });
|
|
2445
2571
|
}
|
|
2446
2572
|
}
|
|
2447
2573
|
})
|
|
2448
2574
|
];
|
|
2449
2575
|
}
|
|
2450
|
-
}),
|
|
2576
|
+
}), or = V.create({
|
|
2451
2577
|
name: "base-kit",
|
|
2452
2578
|
addExtensions() {
|
|
2453
2579
|
const e = [];
|
|
2454
|
-
return this.options.multiColumn ? (e.push(sa.configure()), e.push(
|
|
2455
|
-
|
|
2456
|
-
placeholder: ({ node: t, pos:
|
|
2457
|
-
var
|
|
2458
|
-
return ((
|
|
2580
|
+
return this.options.multiColumn ? (e.push(sa.configure()), e.push(ua)) : e.push(Mt), this.options.placeholder !== !1 && e.push(
|
|
2581
|
+
Vn.configure({
|
|
2582
|
+
placeholder: ({ node: t, pos: i }) => {
|
|
2583
|
+
var n, a, l;
|
|
2584
|
+
return ((n = t == null ? void 0 : t.type) == null ? void 0 : n.name) === "heading" ? `${T.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "codeBlock" || ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "table" ? "" : i === 0 ? T.t("editor.content") : T.t("editor.slash");
|
|
2459
2585
|
},
|
|
2460
2586
|
...this.options.placeholder
|
|
2461
2587
|
})
|
|
2462
2588
|
), this.options.focus !== !1 && e.push(
|
|
2463
|
-
|
|
2589
|
+
jn.configure({
|
|
2464
2590
|
className: "focus",
|
|
2465
2591
|
...this.options.focus
|
|
2466
2592
|
})
|
|
2467
|
-
), this.options.text !== !1 && e.push(
|
|
2468
|
-
|
|
2593
|
+
), this.options.text !== !1 && e.push(Kn.configure()), this.options.textBubble !== !1 && e.push(fa.configure()), this.options.gapcursor !== !1 && e.push(qn.configure()), this.options.dropcursor !== !1 && e.push(
|
|
2594
|
+
Wn.configure({
|
|
2469
2595
|
...this.options.dropcursor,
|
|
2470
2596
|
width: 2,
|
|
2471
2597
|
class: "ProseMirror-dropcursor border-black"
|
|
2472
2598
|
})
|
|
2473
|
-
), this.options.characterCount !== !1 && e.push(
|
|
2599
|
+
), this.options.characterCount !== !1 && e.push(Gn.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Xn.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(Zn.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Jn.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(Yn.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(ga.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(ma), e;
|
|
2474
2600
|
}
|
|
2475
|
-
}),
|
|
2601
|
+
}), ar = V.create({
|
|
2476
2602
|
name: "subAndSuperScript",
|
|
2477
2603
|
addOptions() {
|
|
2478
2604
|
var e;
|
|
2479
2605
|
return {
|
|
2480
2606
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2481
|
-
button: ({ editor: t, extension:
|
|
2482
|
-
const a =
|
|
2607
|
+
button: ({ editor: t, extension: i, t: n }) => {
|
|
2608
|
+
const a = i.options.subscript, l = i.options.superscript, r = {
|
|
2483
2609
|
component: v,
|
|
2484
2610
|
componentProps: {
|
|
2485
2611
|
action: () => t.commands.toggleSubscript(),
|
|
2486
2612
|
isActive: () => t.isActive("subscript") || !1,
|
|
2487
2613
|
disabled: !t.can().toggleSubscript(),
|
|
2488
2614
|
icon: "Subscript",
|
|
2489
|
-
tooltip:
|
|
2615
|
+
tooltip: n("editor.subscript.tooltip")
|
|
2490
2616
|
}
|
|
2491
|
-
},
|
|
2617
|
+
}, d = {
|
|
2492
2618
|
component: v,
|
|
2493
2619
|
componentProps: {
|
|
2494
2620
|
action: () => t.commands.toggleSuperscript(),
|
|
2495
2621
|
isActive: () => t.isActive("superscript") || !1,
|
|
2496
2622
|
disabled: !t.can().toggleSuperscript(),
|
|
2497
2623
|
icon: "Superscript",
|
|
2498
|
-
tooltip:
|
|
2624
|
+
tooltip: n("editor.superscript.tooltip")
|
|
2499
2625
|
}
|
|
2500
|
-
},
|
|
2501
|
-
return a !== !1 &&
|
|
2626
|
+
}, s = [];
|
|
2627
|
+
return a !== !1 && s.push(r), l !== !1 && s.push(d), s;
|
|
2502
2628
|
}
|
|
2503
2629
|
};
|
|
2504
2630
|
},
|
|
2505
2631
|
addExtensions() {
|
|
2506
2632
|
const e = [];
|
|
2507
|
-
return this.options.subscript !== !1 && e.push(Ht.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(
|
|
2633
|
+
return this.options.subscript !== !1 && e.push(Ht.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(zt.configure(this.options.superscript)), e;
|
|
2508
2634
|
}
|
|
2509
|
-
}),
|
|
2510
|
-
var
|
|
2511
|
-
const t =
|
|
2635
|
+
}), ba = (e) => {
|
|
2636
|
+
var i;
|
|
2637
|
+
const t = z(() => {
|
|
2512
2638
|
var l;
|
|
2513
|
-
const
|
|
2514
|
-
return
|
|
2515
|
-
...
|
|
2516
|
-
icon:
|
|
2639
|
+
const n = (l = e == null ? void 0 : e.items) == null ? void 0 : l.find((r) => r.isActive());
|
|
2640
|
+
return n && !n.default ? {
|
|
2641
|
+
...n,
|
|
2642
|
+
icon: n != null && n.icon ? n == null ? void 0 : n.icon : e == null ? void 0 : e.icon
|
|
2517
2643
|
} : {
|
|
2518
2644
|
title: e.tooltip,
|
|
2519
2645
|
icon: e.icon,
|
|
2520
2646
|
isActive: () => !1
|
|
2521
2647
|
};
|
|
2522
2648
|
}, [e]);
|
|
2523
|
-
return /* @__PURE__ */ u(
|
|
2524
|
-
/* @__PURE__ */ o(
|
|
2649
|
+
return /* @__PURE__ */ u(ie, { children: [
|
|
2650
|
+
/* @__PURE__ */ o(ne, { disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(
|
|
2525
2651
|
v,
|
|
2526
2652
|
{
|
|
2527
2653
|
customClass: "w-12",
|
|
@@ -2531,50 +2657,50 @@ const fa = V.create({
|
|
|
2531
2657
|
children: /* @__PURE__ */ o(Ut, { className: "w-3 h-3 text-gray-500" })
|
|
2532
2658
|
}
|
|
2533
2659
|
) }),
|
|
2534
|
-
/* @__PURE__ */ o(X, { className: "w-full", children: (
|
|
2660
|
+
/* @__PURE__ */ o(X, { className: "w-full", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((n, a) => /* @__PURE__ */ u(
|
|
2535
2661
|
oe,
|
|
2536
2662
|
{
|
|
2537
|
-
checked: t.title ===
|
|
2538
|
-
onClick:
|
|
2663
|
+
checked: t.title === n.title,
|
|
2664
|
+
onClick: n.action,
|
|
2539
2665
|
className: "flex gap-3 items-center",
|
|
2540
2666
|
children: [
|
|
2541
|
-
/* @__PURE__ */ o(
|
|
2542
|
-
/* @__PURE__ */ o("span", { className: "ml-1", children:
|
|
2543
|
-
!!(
|
|
2667
|
+
/* @__PURE__ */ o(C, { name: n == null ? void 0 : n.icon }),
|
|
2668
|
+
/* @__PURE__ */ o("span", { className: "ml-1", children: n.title }),
|
|
2669
|
+
!!(n != null && n.shortcutKeys) && /* @__PURE__ */ o("span", { className: "text-xs tracking-widest opacity-60 ml-auto", children: Be(n.shortcutKeys) })
|
|
2544
2670
|
]
|
|
2545
2671
|
},
|
|
2546
2672
|
a
|
|
2547
2673
|
)) })
|
|
2548
2674
|
] });
|
|
2549
|
-
},
|
|
2675
|
+
}, lr = V.create({
|
|
2550
2676
|
name: "moreMark",
|
|
2551
2677
|
addOptions() {
|
|
2552
2678
|
var e;
|
|
2553
2679
|
return {
|
|
2554
2680
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
2555
|
-
button({ editor: t, extension:
|
|
2556
|
-
const a =
|
|
2681
|
+
button({ editor: t, extension: i, t: n }) {
|
|
2682
|
+
const a = i.options.subscript, l = i.options.superscript, r = {
|
|
2557
2683
|
action: () => t.commands.toggleSubscript(),
|
|
2558
2684
|
isActive: () => t.isActive("subscript") || !1,
|
|
2559
2685
|
disabled: !t.can().toggleSubscript(),
|
|
2560
2686
|
icon: "Subscript",
|
|
2561
|
-
title:
|
|
2687
|
+
title: n("editor.subscript.tooltip"),
|
|
2562
2688
|
shortcutKeys: ["mod", "."]
|
|
2563
|
-
},
|
|
2689
|
+
}, d = {
|
|
2564
2690
|
action: () => t.commands.toggleSuperscript(),
|
|
2565
2691
|
isActive: () => t.isActive("superscript") || !1,
|
|
2566
2692
|
disabled: !t.can().toggleSuperscript(),
|
|
2567
2693
|
icon: "Superscript",
|
|
2568
|
-
title:
|
|
2694
|
+
title: n("editor.superscript.tooltip"),
|
|
2569
2695
|
shortcutKeys: ["mod", ","]
|
|
2570
|
-
},
|
|
2571
|
-
return a !== !1 &&
|
|
2572
|
-
component:
|
|
2696
|
+
}, s = [];
|
|
2697
|
+
return a !== !1 && s.push(r), l !== !1 && s.push(d), {
|
|
2698
|
+
component: ba,
|
|
2573
2699
|
componentProps: {
|
|
2574
2700
|
icon: "Type",
|
|
2575
|
-
tooltip:
|
|
2701
|
+
tooltip: n("editor.moremark"),
|
|
2576
2702
|
disabled: !t.isEditable,
|
|
2577
|
-
items:
|
|
2703
|
+
items: s
|
|
2578
2704
|
}
|
|
2579
2705
|
};
|
|
2580
2706
|
}
|
|
@@ -2582,46 +2708,46 @@ const fa = V.create({
|
|
|
2582
2708
|
},
|
|
2583
2709
|
addExtensions() {
|
|
2584
2710
|
const e = [];
|
|
2585
|
-
return this.options.subscript !== !1 && e.push(Ht.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(
|
|
2711
|
+
return this.options.subscript !== !1 && e.push(Ht.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(zt.configure(this.options.superscript)), e;
|
|
2586
2712
|
}
|
|
2587
2713
|
});
|
|
2588
2714
|
var Q = /* @__PURE__ */ ((e) => (e[e.max = 7] = "max", e[e.min = 0] = "min", e[e.more = 1] = "more", e[e.less = -1] = "less", e))(Q || {});
|
|
2589
|
-
function
|
|
2590
|
-
return e < t ? t : e >
|
|
2715
|
+
function va(e, t, i) {
|
|
2716
|
+
return e < t ? t : e > i ? i : e;
|
|
2591
2717
|
}
|
|
2592
|
-
function
|
|
2718
|
+
function wa(e, t, i, n) {
|
|
2593
2719
|
const { doc: a, selection: l } = e;
|
|
2594
|
-
if (!a || !l || !(l instanceof Re || l instanceof
|
|
2720
|
+
if (!a || !l || !(l instanceof Re || l instanceof Dt))
|
|
2595
2721
|
return e;
|
|
2596
|
-
const { from: r, to:
|
|
2597
|
-
return a.nodesBetween(r,
|
|
2598
|
-
const h =
|
|
2599
|
-
return
|
|
2722
|
+
const { from: r, to: d } = l;
|
|
2723
|
+
return a.nodesBetween(r, d, (s, c) => {
|
|
2724
|
+
const h = s.type;
|
|
2725
|
+
return i.includes(h.name) ? (e = Ve(e, c, t), !1) : !Qn(s.type.name, n.extensionManager.extensions);
|
|
2600
2726
|
}), e;
|
|
2601
2727
|
}
|
|
2602
|
-
function Ve(e, t,
|
|
2728
|
+
function Ve(e, t, i) {
|
|
2603
2729
|
if (!e.doc)
|
|
2604
2730
|
return e;
|
|
2605
|
-
const
|
|
2606
|
-
if (!
|
|
2731
|
+
const n = e.doc.nodeAt(t);
|
|
2732
|
+
if (!n)
|
|
2607
2733
|
return e;
|
|
2608
|
-
const r =
|
|
2609
|
-
if (r ===
|
|
2734
|
+
const r = va((n.attrs.indent || 0) + i, 0, 7);
|
|
2735
|
+
if (r === n.attrs.indent)
|
|
2610
2736
|
return e;
|
|
2611
|
-
const
|
|
2612
|
-
...
|
|
2737
|
+
const d = {
|
|
2738
|
+
...n.attrs,
|
|
2613
2739
|
indent: r
|
|
2614
2740
|
};
|
|
2615
|
-
return e.setNodeMarkup(t,
|
|
2741
|
+
return e.setNodeMarkup(t, n.type, d, n.marks);
|
|
2616
2742
|
}
|
|
2617
2743
|
function ot({ delta: e, types: t }) {
|
|
2618
|
-
return ({ state:
|
|
2619
|
-
const { selection: l } =
|
|
2620
|
-
let { tr: r } =
|
|
2621
|
-
return r = r.setSelection(l), r =
|
|
2744
|
+
return ({ state: i, dispatch: n, editor: a }) => {
|
|
2745
|
+
const { selection: l } = i;
|
|
2746
|
+
let { tr: r } = i;
|
|
2747
|
+
return r = r.setSelection(l), r = wa(r, e, t, a), r.docChanged ? (n && n(r), !0) : !1;
|
|
2622
2748
|
};
|
|
2623
2749
|
}
|
|
2624
|
-
const
|
|
2750
|
+
const rr = V.create({
|
|
2625
2751
|
name: "indent",
|
|
2626
2752
|
addOptions() {
|
|
2627
2753
|
var e;
|
|
@@ -2630,7 +2756,7 @@ const lr = V.create({
|
|
|
2630
2756
|
types: ["paragraph", "heading", "blockquote"],
|
|
2631
2757
|
minIndent: Q.min,
|
|
2632
2758
|
maxIndent: Q.max,
|
|
2633
|
-
button({ editor: t, t:
|
|
2759
|
+
button({ editor: t, t: i }) {
|
|
2634
2760
|
return [
|
|
2635
2761
|
{
|
|
2636
2762
|
component: v,
|
|
@@ -2640,7 +2766,7 @@ const lr = V.create({
|
|
|
2640
2766
|
},
|
|
2641
2767
|
shortcutKeys: ["Tab"],
|
|
2642
2768
|
icon: "IndentIncrease",
|
|
2643
|
-
tooltip:
|
|
2769
|
+
tooltip: i("editor.indent.tooltip")
|
|
2644
2770
|
}
|
|
2645
2771
|
},
|
|
2646
2772
|
{
|
|
@@ -2651,7 +2777,7 @@ const lr = V.create({
|
|
|
2651
2777
|
},
|
|
2652
2778
|
shortcutKeys: ["Shift", "Tab"],
|
|
2653
2779
|
icon: "IndentDecrease",
|
|
2654
|
-
tooltip:
|
|
2780
|
+
tooltip: i("editor.outdent.tooltip")
|
|
2655
2781
|
}
|
|
2656
2782
|
}
|
|
2657
2783
|
];
|
|
@@ -2694,80 +2820,80 @@ const lr = V.create({
|
|
|
2694
2820
|
};
|
|
2695
2821
|
}
|
|
2696
2822
|
});
|
|
2697
|
-
function
|
|
2823
|
+
function xa(e) {
|
|
2698
2824
|
return Number.parseFloat(e.replace("%", "")) / 100;
|
|
2699
2825
|
}
|
|
2700
|
-
const
|
|
2701
|
-
const { t } =
|
|
2826
|
+
const ya = (e) => {
|
|
2827
|
+
const { t } = D(), [i, n] = N("default");
|
|
2702
2828
|
function a(r) {
|
|
2703
|
-
r === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(r),
|
|
2829
|
+
r === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(r), n(r);
|
|
2704
2830
|
}
|
|
2705
|
-
const l =
|
|
2706
|
-
const
|
|
2831
|
+
const l = z(() => {
|
|
2832
|
+
const s = e.editor.extensionManager.extensions.find(
|
|
2707
2833
|
(c) => c.name === "lineHeight"
|
|
2708
2834
|
).options.lineHeights.map((c) => ({
|
|
2709
|
-
label:
|
|
2835
|
+
label: xa(c),
|
|
2710
2836
|
value: c
|
|
2711
2837
|
}));
|
|
2712
|
-
return
|
|
2838
|
+
return s.unshift({
|
|
2713
2839
|
label: t("editor.default"),
|
|
2714
2840
|
value: "default"
|
|
2715
|
-
}),
|
|
2841
|
+
}), s;
|
|
2716
2842
|
}, [e]);
|
|
2717
|
-
return /* @__PURE__ */ u(
|
|
2718
|
-
/* @__PURE__ */ o(
|
|
2843
|
+
return /* @__PURE__ */ u(ie, { children: [
|
|
2844
|
+
/* @__PURE__ */ o(ne, { disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(
|
|
2719
2845
|
v,
|
|
2720
2846
|
{
|
|
2721
2847
|
customClass: "w-12",
|
|
2722
2848
|
icon: "LineHeight",
|
|
2723
2849
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
2724
2850
|
disabled: e == null ? void 0 : e.disabled,
|
|
2725
|
-
children: /* @__PURE__ */ o(
|
|
2851
|
+
children: /* @__PURE__ */ o(C, { className: "w-3 h-3 text-zinc-500 ml-1", name: "MenuDown" })
|
|
2726
2852
|
}
|
|
2727
2853
|
) }),
|
|
2728
|
-
/* @__PURE__ */ o(X, { className: "min-w-24", children: l == null ? void 0 : l.map((r,
|
|
2854
|
+
/* @__PURE__ */ o(X, { className: "min-w-24", children: l == null ? void 0 : l.map((r, d) => /* @__PURE__ */ o(
|
|
2729
2855
|
oe,
|
|
2730
2856
|
{
|
|
2731
|
-
checked: r.value ===
|
|
2857
|
+
checked: r.value === i,
|
|
2732
2858
|
onClick: () => a(r.value),
|
|
2733
2859
|
children: r.label
|
|
2734
2860
|
},
|
|
2735
|
-
`lineHeight-${
|
|
2861
|
+
`lineHeight-${d}`
|
|
2736
2862
|
)) })
|
|
2737
2863
|
] });
|
|
2738
|
-
},
|
|
2864
|
+
}, pa = ["paragraph", "heading", "list_item", "todo_item"];
|
|
2739
2865
|
function ka(e, t) {
|
|
2740
|
-
const { selection:
|
|
2741
|
-
if (!
|
|
2866
|
+
const { selection: i, doc: n } = e;
|
|
2867
|
+
if (!i || !n || !(i instanceof Re || i instanceof Dt))
|
|
2742
2868
|
return e;
|
|
2743
|
-
const { from: a, to: l } =
|
|
2744
|
-
if (
|
|
2745
|
-
const h =
|
|
2746
|
-
return
|
|
2747
|
-
node:
|
|
2869
|
+
const { from: a, to: l } = i, r = [], d = t && t !== jt ? t : null;
|
|
2870
|
+
if (n.nodesBetween(a, l, (s, c) => {
|
|
2871
|
+
const h = s.type;
|
|
2872
|
+
return pa.includes(h.name) ? ((s.attrs.lineHeight || null) !== d && r.push({
|
|
2873
|
+
node: s,
|
|
2748
2874
|
pos: c,
|
|
2749
2875
|
nodeType: h
|
|
2750
2876
|
}), h.name !== "list_item" && h.name !== "todo_item") : !0;
|
|
2751
2877
|
}), r.length === 0)
|
|
2752
2878
|
return e;
|
|
2753
|
-
for (const
|
|
2754
|
-
const { node: c, pos: h, nodeType: m } =
|
|
2879
|
+
for (const s of r) {
|
|
2880
|
+
const { node: c, pos: h, nodeType: m } = s;
|
|
2755
2881
|
let { attrs: f } = c;
|
|
2756
2882
|
f = {
|
|
2757
2883
|
...f,
|
|
2758
|
-
lineHeight:
|
|
2884
|
+
lineHeight: d
|
|
2759
2885
|
}, e = e.setNodeMarkup(h, m, f, c.marks);
|
|
2760
2886
|
}
|
|
2761
2887
|
return e;
|
|
2762
2888
|
}
|
|
2763
2889
|
function Ca(e) {
|
|
2764
|
-
return ({ state: t, dispatch:
|
|
2765
|
-
const { selection:
|
|
2890
|
+
return ({ state: t, dispatch: i }) => {
|
|
2891
|
+
const { selection: n } = t;
|
|
2766
2892
|
let { tr: a } = t;
|
|
2767
|
-
return a = a.setSelection(
|
|
2893
|
+
return a = a.setSelection(n), a = ka(a, e), a.docChanged ? (i && i(a), !0) : !1;
|
|
2768
2894
|
};
|
|
2769
2895
|
}
|
|
2770
|
-
const
|
|
2896
|
+
const dr = V.create({
|
|
2771
2897
|
name: "lineHeight",
|
|
2772
2898
|
addOptions() {
|
|
2773
2899
|
var e;
|
|
@@ -2776,12 +2902,12 @@ const rr = V.create({
|
|
|
2776
2902
|
types: ["paragraph", "heading", "list_item", "todo_item"],
|
|
2777
2903
|
lineHeights: ["100%", "115%", "150%", "200%", "250%", "300%"],
|
|
2778
2904
|
defaultHeight: jt,
|
|
2779
|
-
button({ editor: t, t:
|
|
2905
|
+
button({ editor: t, t: i }) {
|
|
2780
2906
|
return {
|
|
2781
|
-
component:
|
|
2907
|
+
component: ya,
|
|
2782
2908
|
componentProps: {
|
|
2783
2909
|
editor: t,
|
|
2784
|
-
tooltip:
|
|
2910
|
+
tooltip: i("editor.lineheight.tooltip")
|
|
2785
2911
|
}
|
|
2786
2912
|
};
|
|
2787
2913
|
}
|
|
@@ -2807,51 +2933,51 @@ const rr = V.create({
|
|
|
2807
2933
|
unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
|
|
2808
2934
|
};
|
|
2809
2935
|
}
|
|
2810
|
-
}),
|
|
2936
|
+
}), Na = (e, t) => {
|
|
2811
2937
|
var B, F;
|
|
2812
|
-
const [
|
|
2938
|
+
const [i, n] = N(0), [a, l] = N(0), r = ce(null), { t: d } = D(), s = ce([]);
|
|
2813
2939
|
$t(t, () => ({
|
|
2814
2940
|
onKeyDown: c
|
|
2815
2941
|
})), U(() => {
|
|
2816
2942
|
if (!r.current)
|
|
2817
2943
|
return;
|
|
2818
|
-
const x = a * 1e3 +
|
|
2944
|
+
const x = a * 1e3 + i, y = s.current[x];
|
|
2819
2945
|
y && y.scrollIntoView({
|
|
2820
2946
|
behavior: "smooth",
|
|
2821
2947
|
block: "nearest"
|
|
2822
2948
|
});
|
|
2823
|
-
}, [
|
|
2949
|
+
}, [i, a]);
|
|
2824
2950
|
function c({ event: x }) {
|
|
2825
2951
|
return x.key === "ArrowUp" ? (h(), !0) : x.key === "ArrowDown" ? (m(), !0) : x.key === "Enter" ? (f(), !0) : !1;
|
|
2826
2952
|
}
|
|
2827
2953
|
function h() {
|
|
2828
|
-
var
|
|
2954
|
+
var k;
|
|
2829
2955
|
if (e.items.length === 0)
|
|
2830
2956
|
return !1;
|
|
2831
|
-
let x =
|
|
2832
|
-
x < 0 && (y = a - 1, x = ((
|
|
2957
|
+
let x = i - 1, y = a;
|
|
2958
|
+
x < 0 && (y = a - 1, x = ((k = e.items[y]) == null ? void 0 : k.commands.length) - 1 || 0), y < 0 && (y = e.items.length - 1, x = e.items[y].commands.length - 1), n(x), l(y);
|
|
2833
2959
|
}
|
|
2834
2960
|
function m() {
|
|
2835
2961
|
if (e.items.length === 0)
|
|
2836
2962
|
return !1;
|
|
2837
2963
|
const x = e.items[a].commands;
|
|
2838
|
-
let y =
|
|
2839
|
-
x.length - 1 < y && (y = 0,
|
|
2964
|
+
let y = i + 1, k = a;
|
|
2965
|
+
x.length - 1 < y && (y = 0, k = a + 1), e.items.length - 1 < k && (k = 0), n(y), l(k);
|
|
2840
2966
|
}
|
|
2841
2967
|
function f() {
|
|
2842
|
-
if (e.items.length === 0 || a === -1 ||
|
|
2968
|
+
if (e.items.length === 0 || a === -1 || i === -1)
|
|
2843
2969
|
return !1;
|
|
2844
|
-
b(a,
|
|
2970
|
+
b(a, i);
|
|
2845
2971
|
}
|
|
2846
2972
|
function b(x, y) {
|
|
2847
|
-
const
|
|
2848
|
-
e.command(
|
|
2973
|
+
const k = e.items[x].commands[y];
|
|
2974
|
+
e.command(k);
|
|
2849
2975
|
}
|
|
2850
2976
|
function w(x, y) {
|
|
2851
2977
|
b(x, y);
|
|
2852
2978
|
}
|
|
2853
|
-
function A(x, y,
|
|
2854
|
-
|
|
2979
|
+
function A(x, y, k) {
|
|
2980
|
+
s.current[x * 1e3 + y] = k;
|
|
2855
2981
|
}
|
|
2856
2982
|
return /* @__PURE__ */ o(
|
|
2857
2983
|
"div",
|
|
@@ -2860,25 +2986,25 @@ const rr = V.create({
|
|
|
2860
2986
|
ref: r,
|
|
2861
2987
|
children: (B = e == null ? void 0 : e.items) != null && B.length ? /* @__PURE__ */ o("div", { className: "grid grid-cols-1 gap-0.5 min-w-48", children: (F = e == null ? void 0 : e.items) == null ? void 0 : F.map((x, y) => /* @__PURE__ */ u(he, { children: [
|
|
2862
2988
|
/* @__PURE__ */ o("div", { className: "text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-2 font-semibold tracking-wider select-none uppercase first:mt-0.5", children: x.title }),
|
|
2863
|
-
x.commands.map((
|
|
2989
|
+
x.commands.map((k, O) => /* @__PURE__ */ u(
|
|
2864
2990
|
"button",
|
|
2865
2991
|
{
|
|
2866
|
-
className: `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 ${a === y &&
|
|
2992
|
+
className: `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 ${a === y && i === O ? "bg-accent text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200" : "hover:bg-accent hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200"}`,
|
|
2867
2993
|
ref: (j) => A(y, O, j),
|
|
2868
2994
|
onClick: () => w(y, O),
|
|
2869
2995
|
children: [
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2996
|
+
k.iconUrl && /* @__PURE__ */ o("img", { className: "w-6 h-6", src: k.iconUrl, alt: "" }),
|
|
2997
|
+
k.iconName && /* @__PURE__ */ o(C, { name: k.iconName, className: "mr-1 text-lg" }),
|
|
2998
|
+
k.label
|
|
2873
2999
|
]
|
|
2874
3000
|
},
|
|
2875
3001
|
`command-${O}`
|
|
2876
3002
|
))
|
|
2877
|
-
] }, x.title)) }) : /* @__PURE__ */ o("div", { className: "p-3", children: /* @__PURE__ */ o("span", { className: "text-xs text-gray-800 dark:text-gray-100", children:
|
|
3003
|
+
] }, x.title)) }) : /* @__PURE__ */ o("div", { className: "p-3", children: /* @__PURE__ */ o("span", { className: "text-xs text-gray-800 dark:text-gray-100", children: d("editor.slash.empty") }) })
|
|
2878
3004
|
}
|
|
2879
3005
|
);
|
|
2880
|
-
},
|
|
2881
|
-
function
|
|
3006
|
+
}, La = _t(Na);
|
|
3007
|
+
function Aa(e) {
|
|
2882
3008
|
return [
|
|
2883
3009
|
{
|
|
2884
3010
|
name: "format",
|
|
@@ -2889,8 +3015,8 @@ function La(e) {
|
|
|
2889
3015
|
label: T.t("editor.heading.h1.tooltip"),
|
|
2890
3016
|
aliases: ["h1", "bt", "bt1"],
|
|
2891
3017
|
iconName: "Heading1",
|
|
2892
|
-
action: ({ editor:
|
|
2893
|
-
|
|
3018
|
+
action: ({ editor: i, range: n }) => {
|
|
3019
|
+
i.chain().focus().deleteRange(n).setHeading({ level: 1 }).run();
|
|
2894
3020
|
}
|
|
2895
3021
|
},
|
|
2896
3022
|
{
|
|
@@ -2898,8 +3024,8 @@ function La(e) {
|
|
|
2898
3024
|
label: T.t("editor.heading.h2.tooltip"),
|
|
2899
3025
|
aliases: ["h2", "bt", "bt2"],
|
|
2900
3026
|
iconName: "Heading2",
|
|
2901
|
-
action: ({ editor:
|
|
2902
|
-
|
|
3027
|
+
action: ({ editor: i, range: n }) => {
|
|
3028
|
+
i.chain().focus().deleteRange(n).setNode("heading", { level: 2 }).run();
|
|
2903
3029
|
}
|
|
2904
3030
|
},
|
|
2905
3031
|
{
|
|
@@ -2907,8 +3033,8 @@ function La(e) {
|
|
|
2907
3033
|
label: T.t("editor.heading.h3.tooltip"),
|
|
2908
3034
|
aliases: ["h3", "bt", "bt3"],
|
|
2909
3035
|
iconName: "Heading3",
|
|
2910
|
-
action: ({ editor:
|
|
2911
|
-
|
|
3036
|
+
action: ({ editor: i, range: n }) => {
|
|
3037
|
+
i.chain().focus().deleteRange(n).setNode("heading", { level: 3 }).run();
|
|
2912
3038
|
}
|
|
2913
3039
|
},
|
|
2914
3040
|
{
|
|
@@ -2916,8 +3042,8 @@ function La(e) {
|
|
|
2916
3042
|
label: T.t("editor.bulletlist.tooltip"),
|
|
2917
3043
|
aliases: ["ul", "yxlb"],
|
|
2918
3044
|
iconName: "List",
|
|
2919
|
-
action: ({ editor:
|
|
2920
|
-
|
|
3045
|
+
action: ({ editor: i, range: n }) => {
|
|
3046
|
+
i.chain().focus().deleteRange(n).toggleBulletList().run();
|
|
2921
3047
|
}
|
|
2922
3048
|
},
|
|
2923
3049
|
{
|
|
@@ -2925,8 +3051,8 @@ function La(e) {
|
|
|
2925
3051
|
label: T.t("editor.orderedlist.tooltip"),
|
|
2926
3052
|
aliases: ["ol", "yxlb"],
|
|
2927
3053
|
iconName: "ListOrdered",
|
|
2928
|
-
action: ({ editor:
|
|
2929
|
-
|
|
3054
|
+
action: ({ editor: i, range: n }) => {
|
|
3055
|
+
i.chain().focus().deleteRange(n).toggleOrderedList().run();
|
|
2930
3056
|
}
|
|
2931
3057
|
},
|
|
2932
3058
|
{
|
|
@@ -2935,8 +3061,8 @@ function La(e) {
|
|
|
2935
3061
|
iconName: "ListTodo",
|
|
2936
3062
|
description: "Task list with todo items",
|
|
2937
3063
|
aliases: ["todo"],
|
|
2938
|
-
action: ({ editor:
|
|
2939
|
-
|
|
3064
|
+
action: ({ editor: i, range: n }) => {
|
|
3065
|
+
i.chain().focus().deleteRange(n).toggleTaskList().run();
|
|
2940
3066
|
}
|
|
2941
3067
|
},
|
|
2942
3068
|
{
|
|
@@ -2945,8 +3071,8 @@ function La(e) {
|
|
|
2945
3071
|
description: "插入引入格式",
|
|
2946
3072
|
aliases: ["yr"],
|
|
2947
3073
|
iconName: "TextQuote",
|
|
2948
|
-
action: ({ editor:
|
|
2949
|
-
|
|
3074
|
+
action: ({ editor: i, range: n }) => {
|
|
3075
|
+
i.chain().focus().deleteRange(n).setBlockquote().run();
|
|
2950
3076
|
}
|
|
2951
3077
|
},
|
|
2952
3078
|
{
|
|
@@ -2954,9 +3080,9 @@ function La(e) {
|
|
|
2954
3080
|
label: T.t("editor.codeblock.tooltip"),
|
|
2955
3081
|
iconName: "Code2",
|
|
2956
3082
|
description: "Code block with syntax highlighting",
|
|
2957
|
-
shouldBeHidden: (
|
|
2958
|
-
action: ({ editor:
|
|
2959
|
-
|
|
3083
|
+
shouldBeHidden: (i) => i.isActive("columns"),
|
|
3084
|
+
action: ({ editor: i, range: n }) => {
|
|
3085
|
+
i.chain().focus().deleteRange(n).setCodeBlock().run();
|
|
2960
3086
|
}
|
|
2961
3087
|
}
|
|
2962
3088
|
]
|
|
@@ -2971,9 +3097,9 @@ function La(e) {
|
|
|
2971
3097
|
iconName: "ImageUp",
|
|
2972
3098
|
description: "Insert a image",
|
|
2973
3099
|
aliases: ["image", "tp", "tupian"],
|
|
2974
|
-
shouldBeHidden: (
|
|
2975
|
-
action: ({ editor:
|
|
2976
|
-
|
|
3100
|
+
shouldBeHidden: (i) => i.isActive("columns"),
|
|
3101
|
+
action: ({ editor: i, range: n }) => {
|
|
3102
|
+
i.chain().focus().deleteRange(n).setImageUpload().run();
|
|
2977
3103
|
}
|
|
2978
3104
|
},
|
|
2979
3105
|
{
|
|
@@ -2982,9 +3108,9 @@ function La(e) {
|
|
|
2982
3108
|
iconName: "Video",
|
|
2983
3109
|
description: "Insert a video",
|
|
2984
3110
|
aliases: ["video", "sp", "shipin"],
|
|
2985
|
-
shouldBeHidden: (
|
|
2986
|
-
action: ({ editor:
|
|
2987
|
-
|
|
3111
|
+
shouldBeHidden: (i) => i.isActive("columns"),
|
|
3112
|
+
action: ({ editor: i, range: n }) => {
|
|
3113
|
+
i.chain().focus().deleteRange(n).setVideoUpload().run();
|
|
2988
3114
|
}
|
|
2989
3115
|
},
|
|
2990
3116
|
{
|
|
@@ -2993,9 +3119,9 @@ function La(e) {
|
|
|
2993
3119
|
iconName: "Table",
|
|
2994
3120
|
description: "Insert a table",
|
|
2995
3121
|
aliases: ["table", "bg", "biaoge", "biao"],
|
|
2996
|
-
shouldBeHidden: (
|
|
2997
|
-
action: ({ editor:
|
|
2998
|
-
|
|
3122
|
+
shouldBeHidden: (i) => i.isActive("columns"),
|
|
3123
|
+
action: ({ editor: i, range: n }) => {
|
|
3124
|
+
i.chain().focus().deleteRange(n).insertTable({ rows: 3, cols: 3, withHeaderRow: !1 }).run();
|
|
2999
3125
|
}
|
|
3000
3126
|
},
|
|
3001
3127
|
{
|
|
@@ -3004,8 +3130,8 @@ function La(e) {
|
|
|
3004
3130
|
iconName: "Minus",
|
|
3005
3131
|
description: "Insert a horizontal divider",
|
|
3006
3132
|
aliases: ["hr", "fgx", "fg"],
|
|
3007
|
-
action: ({ editor:
|
|
3008
|
-
|
|
3133
|
+
action: ({ editor: i, range: n }) => {
|
|
3134
|
+
i.chain().focus().deleteRange(n).setHorizontalRule().run();
|
|
3009
3135
|
}
|
|
3010
3136
|
}
|
|
3011
3137
|
// {
|
|
@@ -3029,12 +3155,12 @@ function La(e) {
|
|
|
3029
3155
|
];
|
|
3030
3156
|
}
|
|
3031
3157
|
const J = "slashCommand";
|
|
3032
|
-
let
|
|
3158
|
+
let p;
|
|
3033
3159
|
const sr = V.create({
|
|
3034
3160
|
name: J,
|
|
3035
3161
|
priority: 200,
|
|
3036
3162
|
onCreate() {
|
|
3037
|
-
|
|
3163
|
+
p = eo("body", {
|
|
3038
3164
|
interactive: !0,
|
|
3039
3165
|
trigger: "manual",
|
|
3040
3166
|
placement: "bottom-start",
|
|
@@ -3062,24 +3188,24 @@ const sr = V.create({
|
|
|
3062
3188
|
pluginKey: new we(J),
|
|
3063
3189
|
allow: ({ state: e, range: t }) => {
|
|
3064
3190
|
var c, h, m;
|
|
3065
|
-
const
|
|
3066
|
-
Math.max(0, (h =
|
|
3067
|
-
),
|
|
3068
|
-
return (
|
|
3191
|
+
const i = e.doc.resolve(t.from), n = i.depth === 1, a = i.parent.type.name === "paragraph", l = ((c = i.parent.textContent) == null ? void 0 : c.charAt(0)) === "/", r = this.editor.isActive("column"), d = (m = i.parent.textContent) == null ? void 0 : m.slice(
|
|
3192
|
+
Math.max(0, (h = i.parent.textContent) == null ? void 0 : h.indexOf("/"))
|
|
3193
|
+
), s = !(d != null && d.endsWith(" "));
|
|
3194
|
+
return (n && a && l || r && a && l) && s;
|
|
3069
3195
|
},
|
|
3070
|
-
command: ({ editor: e, range: t, props:
|
|
3071
|
-
const { view:
|
|
3072
|
-
|
|
3196
|
+
command: ({ editor: e, range: t, props: i }) => {
|
|
3197
|
+
const { view: n } = e;
|
|
3198
|
+
i.action({ editor: e, range: t }), n.focus();
|
|
3073
3199
|
},
|
|
3074
|
-
items: ({ query: e }) => (console.log(this),
|
|
3200
|
+
items: ({ query: e }) => (console.log(this), Aa(this.editor).map((l) => ({
|
|
3075
3201
|
...l,
|
|
3076
3202
|
commands: l.commands.filter((r) => {
|
|
3077
|
-
const
|
|
3203
|
+
const d = r.label.toLowerCase().trim(), s = e.toLowerCase().trim();
|
|
3078
3204
|
if (r.aliases) {
|
|
3079
|
-
const c = r.aliases.map((f) => f.toLowerCase().trim()), h =
|
|
3205
|
+
const c = r.aliases.map((f) => f.toLowerCase().trim()), h = d.match(s), m = c.some((f) => f.match(s));
|
|
3080
3206
|
return h || m;
|
|
3081
3207
|
}
|
|
3082
|
-
return
|
|
3208
|
+
return d.match(s);
|
|
3083
3209
|
}).filter(
|
|
3084
3210
|
(r) => r.shouldBeHidden ? !r.shouldBeHidden(this.editor) : !0
|
|
3085
3211
|
)
|
|
@@ -3093,68 +3219,68 @@ const sr = V.create({
|
|
|
3093
3219
|
render: () => {
|
|
3094
3220
|
let e, t = null;
|
|
3095
3221
|
return {
|
|
3096
|
-
onStart: (
|
|
3222
|
+
onStart: (i) => {
|
|
3097
3223
|
var l;
|
|
3098
|
-
e = new
|
|
3099
|
-
props:
|
|
3100
|
-
editor:
|
|
3224
|
+
e = new io(La, {
|
|
3225
|
+
props: i,
|
|
3226
|
+
editor: i.editor
|
|
3101
3227
|
});
|
|
3102
|
-
const { view:
|
|
3103
|
-
if (!
|
|
3104
|
-
return
|
|
3105
|
-
const r =
|
|
3228
|
+
const { view: n } = i.editor, a = () => {
|
|
3229
|
+
if (!i.clientRect)
|
|
3230
|
+
return i.editor.storage[J].rect;
|
|
3231
|
+
const r = i.clientRect();
|
|
3106
3232
|
if (!r)
|
|
3107
|
-
return
|
|
3108
|
-
let
|
|
3233
|
+
return i.editor.storage[J].rect;
|
|
3234
|
+
let d = r.y;
|
|
3109
3235
|
if (r.top + e.element.offsetHeight + 40 > window.innerHeight) {
|
|
3110
|
-
const
|
|
3111
|
-
|
|
3236
|
+
const s = r.top + e.element.offsetHeight - window.innerHeight + 40;
|
|
3237
|
+
d = r.y - s;
|
|
3112
3238
|
}
|
|
3113
|
-
return new DOMRect(r.x,
|
|
3239
|
+
return new DOMRect(r.x, d, r.width, r.height);
|
|
3114
3240
|
};
|
|
3115
3241
|
t = () => {
|
|
3116
|
-
|
|
3242
|
+
p == null || p[0].setProps({
|
|
3117
3243
|
getReferenceClientRect: a
|
|
3118
3244
|
});
|
|
3119
|
-
}, (l =
|
|
3245
|
+
}, (l = n.dom.parentElement) == null || l.addEventListener("scroll", t), p == null || p[0].setProps({
|
|
3120
3246
|
getReferenceClientRect: a,
|
|
3121
3247
|
appendTo: () => document.body,
|
|
3122
3248
|
content: e.element
|
|
3123
|
-
}),
|
|
3249
|
+
}), p == null || p[0].show();
|
|
3124
3250
|
},
|
|
3125
|
-
onUpdate(
|
|
3251
|
+
onUpdate(i) {
|
|
3126
3252
|
var r;
|
|
3127
|
-
e.updateProps(
|
|
3128
|
-
const { view:
|
|
3129
|
-
if (!
|
|
3130
|
-
return
|
|
3131
|
-
const
|
|
3132
|
-
return
|
|
3253
|
+
e.updateProps(i);
|
|
3254
|
+
const { view: n } = i.editor, a = () => {
|
|
3255
|
+
if (!i.clientRect)
|
|
3256
|
+
return i.editor.storage[J].rect;
|
|
3257
|
+
const d = i.clientRect();
|
|
3258
|
+
return d ? new DOMRect(d.x, d.y, d.width, d.height) : i.editor.storage[J].rect;
|
|
3133
3259
|
}, l = () => {
|
|
3134
|
-
|
|
3260
|
+
p == null || p[0].setProps({
|
|
3135
3261
|
getReferenceClientRect: a
|
|
3136
3262
|
});
|
|
3137
3263
|
};
|
|
3138
|
-
(r =
|
|
3264
|
+
(r = n.dom.parentElement) == null || r.addEventListener("scroll", l), i.editor.storage[J].rect = i.clientRect ? a() : {
|
|
3139
3265
|
width: 0,
|
|
3140
3266
|
height: 0,
|
|
3141
3267
|
left: 0,
|
|
3142
3268
|
top: 0,
|
|
3143
3269
|
right: 0,
|
|
3144
3270
|
bottom: 0
|
|
3145
|
-
},
|
|
3271
|
+
}, p == null || p[0].setProps({
|
|
3146
3272
|
getReferenceClientRect: a
|
|
3147
3273
|
});
|
|
3148
3274
|
},
|
|
3149
|
-
onKeyDown(
|
|
3150
|
-
var
|
|
3151
|
-
return
|
|
3275
|
+
onKeyDown(i) {
|
|
3276
|
+
var n;
|
|
3277
|
+
return i.event.key === "Escape" ? (p == null || p[0].hide(), !0) : (p != null && p[0].state.isShown || p == null || p[0].show(), (n = e.ref) == null ? void 0 : n.onKeyDown(i));
|
|
3152
3278
|
},
|
|
3153
|
-
onExit(
|
|
3154
|
-
var
|
|
3155
|
-
if (
|
|
3156
|
-
const { view: a } =
|
|
3157
|
-
(
|
|
3279
|
+
onExit(i) {
|
|
3280
|
+
var n;
|
|
3281
|
+
if (p == null || p[0].hide(), t) {
|
|
3282
|
+
const { view: a } = i.editor;
|
|
3283
|
+
(n = a.dom.parentElement) == null || n.removeEventListener("scroll", t);
|
|
3158
3284
|
}
|
|
3159
3285
|
e.destroy();
|
|
3160
3286
|
}
|
|
@@ -3175,33 +3301,33 @@ const sr = V.create({
|
|
|
3175
3301
|
}
|
|
3176
3302
|
};
|
|
3177
3303
|
}
|
|
3178
|
-
}),
|
|
3304
|
+
}), Ta = (e, t = "px") => {
|
|
3179
3305
|
if (!e)
|
|
3180
3306
|
return e;
|
|
3181
|
-
const
|
|
3182
|
-
return Number.isNaN(
|
|
3307
|
+
const i = je(e) ? String(e) : e, n = Number.parseFloat(i), a = i.match(/[%A-Za-z]+$/), l = a ? a[0] : t;
|
|
3308
|
+
return Number.isNaN(n) ? e : n + l;
|
|
3183
3309
|
};
|
|
3184
|
-
function
|
|
3185
|
-
return e < t ? t : e >
|
|
3310
|
+
function Ma(e, t, i) {
|
|
3311
|
+
return e < t ? t : e > i ? i : e;
|
|
3186
3312
|
}
|
|
3187
|
-
const je = (e) => typeof e == "number",
|
|
3188
|
-
function
|
|
3313
|
+
const je = (e) => typeof e == "number", Sa = (e) => typeof e == "function";
|
|
3314
|
+
function Ra(e, t) {
|
|
3189
3315
|
if (!e)
|
|
3190
3316
|
return !1;
|
|
3191
|
-
const { extensions:
|
|
3192
|
-
return !!
|
|
3317
|
+
const { extensions: i = [] } = (e == null ? void 0 : e.extensionManager) ?? {};
|
|
3318
|
+
return !!i.find((a) => a.name === t);
|
|
3193
3319
|
}
|
|
3194
3320
|
const Le = {
|
|
3195
3321
|
TOP_LEFT: "tl",
|
|
3196
3322
|
TOP_RIGHT: "tr",
|
|
3197
3323
|
BOTTOM_LEFT: "bl",
|
|
3198
3324
|
BOTTOM_RIGHT: "br"
|
|
3199
|
-
},
|
|
3325
|
+
}, Ha = (e) => {
|
|
3200
3326
|
var j;
|
|
3201
|
-
const [t,
|
|
3327
|
+
const [t, i] = N({
|
|
3202
3328
|
width: et,
|
|
3203
3329
|
height: et
|
|
3204
|
-
}), [
|
|
3330
|
+
}), [n, a] = N({
|
|
3205
3331
|
width: 0,
|
|
3206
3332
|
height: 0
|
|
3207
3333
|
}), [l, r] = N([
|
|
@@ -3209,13 +3335,13 @@ const Le = {
|
|
|
3209
3335
|
Le.TOP_RIGHT,
|
|
3210
3336
|
Le.BOTTOM_LEFT,
|
|
3211
3337
|
Le.BOTTOM_RIGHT
|
|
3212
|
-
]), [
|
|
3338
|
+
]), [d, s] = N(!1), [c, h] = N({
|
|
3213
3339
|
x: 0,
|
|
3214
3340
|
y: 0,
|
|
3215
3341
|
w: 0,
|
|
3216
3342
|
h: 0,
|
|
3217
3343
|
dir: ""
|
|
3218
|
-
}), m =
|
|
3344
|
+
}), m = z(() => {
|
|
3219
3345
|
var P;
|
|
3220
3346
|
const { src: g, alt: I, width: R, height: _ } = (P = e == null ? void 0 : e.node) == null ? void 0 : P.attrs, W = je(R) ? R + "px" : R, L = je(_) ? _ + "px" : _;
|
|
3221
3347
|
return {
|
|
@@ -3226,7 +3352,7 @@ const Le = {
|
|
|
3226
3352
|
height: L || void 0
|
|
3227
3353
|
}
|
|
3228
3354
|
};
|
|
3229
|
-
}, [(j = e == null ? void 0 : e.node) == null ? void 0 : j.attrs]), f =
|
|
3355
|
+
}, [(j = e == null ? void 0 : e.node) == null ? void 0 : j.attrs]), f = z(() => {
|
|
3230
3356
|
const {
|
|
3231
3357
|
style: { width: g }
|
|
3232
3358
|
} = m;
|
|
@@ -3245,7 +3371,7 @@ const Le = {
|
|
|
3245
3371
|
const A = G(
|
|
3246
3372
|
Oe(function() {
|
|
3247
3373
|
const { editor: g } = e, { width: I } = getComputedStyle(g.view.dom);
|
|
3248
|
-
|
|
3374
|
+
i((R) => ({
|
|
3249
3375
|
...R,
|
|
3250
3376
|
width: Number.parseInt(I, 10)
|
|
3251
3377
|
}));
|
|
@@ -3254,11 +3380,11 @@ const Le = {
|
|
|
3254
3380
|
);
|
|
3255
3381
|
function B(g, I) {
|
|
3256
3382
|
g.preventDefault(), g.stopPropagation();
|
|
3257
|
-
const R =
|
|
3383
|
+
const R = n.width, _ = n.height, W = R / _;
|
|
3258
3384
|
let L = Number(e.node.attrs.width), P = Number(e.node.attrs.height);
|
|
3259
3385
|
const $ = t.width;
|
|
3260
3386
|
L && !P ? (L = L > $ ? $ : L, P = Math.round(L / W)) : P && !L ? (L = Math.round(P * W), L = L > $ ? $ : L) : !L && !P ? (L = R > $ ? $ : R, P = Math.round(L / W)) : L = L > $ ? $ : L, Je(() => {
|
|
3261
|
-
|
|
3387
|
+
s(!0), h({
|
|
3262
3388
|
x: g.clientX,
|
|
3263
3389
|
y: g.clientY,
|
|
3264
3390
|
w: L,
|
|
@@ -3269,39 +3395,39 @@ const Le = {
|
|
|
3269
3395
|
}
|
|
3270
3396
|
const F = G(
|
|
3271
3397
|
Oe(function(g) {
|
|
3272
|
-
if (g.preventDefault(), g.stopPropagation(), !
|
|
3398
|
+
if (g.preventDefault(), g.stopPropagation(), !d)
|
|
3273
3399
|
return;
|
|
3274
3400
|
const { x: I, y: R, w: _, h: W, dir: L } = c, P = (g.clientX - I) * (/l/.test(L) ? -1 : 1);
|
|
3275
3401
|
(g.clientY - R) * (/t/.test(L) ? -1 : 1);
|
|
3276
|
-
const $ =
|
|
3402
|
+
const $ = Ma(_ + P, Eo, t.width);
|
|
3277
3403
|
e.updateAttributes({
|
|
3278
3404
|
width: $,
|
|
3279
3405
|
height: null
|
|
3280
3406
|
});
|
|
3281
3407
|
}, tt),
|
|
3282
|
-
[
|
|
3408
|
+
[d, c, t, e.updateAttributes]
|
|
3283
3409
|
), x = G(
|
|
3284
3410
|
(g) => {
|
|
3285
|
-
g.preventDefault(), g.stopPropagation(),
|
|
3411
|
+
g.preventDefault(), g.stopPropagation(), d && (Je(() => {
|
|
3286
3412
|
h({
|
|
3287
3413
|
x: 0,
|
|
3288
3414
|
y: 0,
|
|
3289
3415
|
w: 0,
|
|
3290
3416
|
h: 0,
|
|
3291
3417
|
dir: ""
|
|
3292
|
-
}),
|
|
3418
|
+
}), s(!1);
|
|
3293
3419
|
}), w());
|
|
3294
3420
|
},
|
|
3295
|
-
[
|
|
3421
|
+
[d, w]
|
|
3296
3422
|
), y = G(() => {
|
|
3297
3423
|
document == null || document.addEventListener("mousemove", F, !0), document == null || document.addEventListener("mouseup", x, !0);
|
|
3298
|
-
}, [F, x]),
|
|
3424
|
+
}, [F, x]), k = G(() => {
|
|
3299
3425
|
document == null || document.removeEventListener("mousemove", F, !0), document == null || document.removeEventListener("mouseup", x, !0);
|
|
3300
3426
|
}, [F, x]);
|
|
3301
|
-
U(() => (
|
|
3302
|
-
|
|
3303
|
-
}), [
|
|
3304
|
-
const O =
|
|
3427
|
+
U(() => (d ? y() : k(), () => {
|
|
3428
|
+
k();
|
|
3429
|
+
}), [d, y, k]);
|
|
3430
|
+
const O = z(() => new ResizeObserver(() => A()), [A]);
|
|
3305
3431
|
return U(() => (O.observe(e.editor.view.dom), () => {
|
|
3306
3432
|
O.disconnect();
|
|
3307
3433
|
}), [e.editor.view.dom, O]), /* @__PURE__ */ o(He, { className: "image-view", style: { ...f, width: "100%" }, children: /* @__PURE__ */ u(
|
|
@@ -3309,7 +3435,7 @@ const Le = {
|
|
|
3309
3435
|
{
|
|
3310
3436
|
draggable: "true",
|
|
3311
3437
|
"data-drag-handle": !0,
|
|
3312
|
-
className: `image-view__body ${e != null && e.selected ? "image-view__body--focused" : ""} ${
|
|
3438
|
+
className: `image-view__body ${e != null && e.selected ? "image-view__body--focused" : ""} ${d ? "image-view__body--resizing" : ""}`,
|
|
3313
3439
|
style: f,
|
|
3314
3440
|
children: [
|
|
3315
3441
|
/* @__PURE__ */ o(
|
|
@@ -3324,7 +3450,7 @@ const Le = {
|
|
|
3324
3450
|
onClick: w
|
|
3325
3451
|
}
|
|
3326
3452
|
),
|
|
3327
|
-
(e == null ? void 0 : e.editor.view.editable) && ((e == null ? void 0 : e.selected) ||
|
|
3453
|
+
(e == null ? void 0 : e.editor.view.editable) && ((e == null ? void 0 : e.selected) || d) && /* @__PURE__ */ o("div", { className: "image-resizer", children: l == null ? void 0 : l.map((g) => /* @__PURE__ */ o(
|
|
3328
3454
|
"span",
|
|
3329
3455
|
{
|
|
3330
3456
|
className: `image-resizer__handler image-resizer__handler--${g}`,
|
|
@@ -3335,7 +3461,7 @@ const Le = {
|
|
|
3335
3461
|
]
|
|
3336
3462
|
}
|
|
3337
3463
|
) });
|
|
3338
|
-
},
|
|
3464
|
+
}, cr = no.extend({
|
|
3339
3465
|
inline() {
|
|
3340
3466
|
return !0;
|
|
3341
3467
|
},
|
|
@@ -3349,8 +3475,8 @@ const Le = {
|
|
|
3349
3475
|
width: {
|
|
3350
3476
|
default: null,
|
|
3351
3477
|
parseHTML: (t) => {
|
|
3352
|
-
const
|
|
3353
|
-
return
|
|
3478
|
+
const i = t.style.width || t.getAttribute("width") || null;
|
|
3479
|
+
return i == null ? null : Number.parseInt(i, 10);
|
|
3354
3480
|
},
|
|
3355
3481
|
renderHTML: (t) => ({
|
|
3356
3482
|
width: t.width
|
|
@@ -3367,13 +3493,13 @@ const Le = {
|
|
|
3367
3493
|
};
|
|
3368
3494
|
},
|
|
3369
3495
|
addNodeView() {
|
|
3370
|
-
return
|
|
3496
|
+
return ze(Ha);
|
|
3371
3497
|
},
|
|
3372
3498
|
addCommands() {
|
|
3373
3499
|
var e;
|
|
3374
3500
|
return {
|
|
3375
3501
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
3376
|
-
updateImage: (t) => ({ commands:
|
|
3502
|
+
updateImage: (t) => ({ commands: i }) => i.updateAttributes(this.name, t)
|
|
3377
3503
|
};
|
|
3378
3504
|
},
|
|
3379
3505
|
renderHTML({ HTMLAttributes: e }) {
|
|
@@ -3396,10 +3522,10 @@ const Le = {
|
|
|
3396
3522
|
}
|
|
3397
3523
|
];
|
|
3398
3524
|
}
|
|
3399
|
-
}), Zt = oo, Ge = H.forwardRef(({ className: e, ...t },
|
|
3525
|
+
}), Zt = oo, Ge = H.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ o(
|
|
3400
3526
|
Bt,
|
|
3401
3527
|
{
|
|
3402
|
-
ref:
|
|
3528
|
+
ref: i,
|
|
3403
3529
|
className: S(
|
|
3404
3530
|
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
3405
3531
|
e
|
|
@@ -3408,10 +3534,10 @@ const Le = {
|
|
|
3408
3534
|
}
|
|
3409
3535
|
));
|
|
3410
3536
|
Ge.displayName = Bt.displayName;
|
|
3411
|
-
const be = H.forwardRef(({ className: e, ...t },
|
|
3537
|
+
const be = H.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ o(
|
|
3412
3538
|
It,
|
|
3413
3539
|
{
|
|
3414
|
-
ref:
|
|
3540
|
+
ref: i,
|
|
3415
3541
|
className: S(
|
|
3416
3542
|
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
3417
3543
|
e
|
|
@@ -3420,10 +3546,10 @@ const be = H.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
3420
3546
|
}
|
|
3421
3547
|
));
|
|
3422
3548
|
be.displayName = It.displayName;
|
|
3423
|
-
const ve = H.forwardRef(({ className: e, ...t },
|
|
3549
|
+
const ve = H.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ o(
|
|
3424
3550
|
Ft,
|
|
3425
3551
|
{
|
|
3426
|
-
ref:
|
|
3552
|
+
ref: i,
|
|
3427
3553
|
className: S(
|
|
3428
3554
|
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
3429
3555
|
e
|
|
@@ -3432,23 +3558,23 @@ const ve = H.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
|
|
|
3432
3558
|
}
|
|
3433
3559
|
));
|
|
3434
3560
|
ve.displayName = Ft.displayName;
|
|
3435
|
-
const
|
|
3436
|
-
key:
|
|
3561
|
+
const se = new we("upload-image"), za = () => new ue({
|
|
3562
|
+
key: se,
|
|
3437
3563
|
state: {
|
|
3438
3564
|
init() {
|
|
3439
3565
|
return St.empty;
|
|
3440
3566
|
},
|
|
3441
3567
|
apply(e, t) {
|
|
3442
3568
|
t = t.map(e.mapping, e.doc);
|
|
3443
|
-
const
|
|
3444
|
-
if (
|
|
3445
|
-
for (const { id:
|
|
3446
|
-
const r = Da(l),
|
|
3447
|
-
t = t.add(e.doc, [
|
|
3569
|
+
const i = e.getMeta(se);
|
|
3570
|
+
if (i != null && i.add)
|
|
3571
|
+
for (const { id: n, pos: a, src: l } of i.add) {
|
|
3572
|
+
const r = Da(l), d = Rt.widget(a, r, { id: n });
|
|
3573
|
+
t = t.add(e.doc, [d]);
|
|
3448
3574
|
}
|
|
3449
|
-
else if (
|
|
3450
|
-
for (const
|
|
3451
|
-
t = t.remove(t.find(void 0, void 0, (a) => a.id ===
|
|
3575
|
+
else if (i != null && i.remove)
|
|
3576
|
+
for (const n of i.remove)
|
|
3577
|
+
t = t.remove(t.find(void 0, void 0, (a) => a.id === n));
|
|
3452
3578
|
return t;
|
|
3453
3579
|
}
|
|
3454
3580
|
},
|
|
@@ -3459,67 +3585,67 @@ const de = new we("upload-image"), Ha = () => new ue({
|
|
|
3459
3585
|
}
|
|
3460
3586
|
});
|
|
3461
3587
|
function Da(e) {
|
|
3462
|
-
const t = document.createElement("div"),
|
|
3463
|
-
return
|
|
3588
|
+
const t = document.createElement("div"), i = document.createElement("img");
|
|
3589
|
+
return i.setAttribute("class", "opacity-50"), i.src = e, i.addEventListener("load", () => {
|
|
3464
3590
|
t.setAttribute("class", "img-placeholder");
|
|
3465
|
-
}), t.append(
|
|
3591
|
+
}), t.append(i), t;
|
|
3466
3592
|
}
|
|
3467
|
-
function
|
|
3593
|
+
function Ba(e, t) {
|
|
3468
3594
|
var a;
|
|
3469
|
-
const
|
|
3470
|
-
return
|
|
3595
|
+
const n = se.getState(e).find(void 0, void 0, (l) => l.id === t);
|
|
3596
|
+
return n.length > 0 ? (a = n[0]) == null ? void 0 : a.from : null;
|
|
3471
3597
|
}
|
|
3472
|
-
const Jt = ({ validateFn: e, onUpload: t }) => (
|
|
3473
|
-
for (const l of
|
|
3598
|
+
const Jt = ({ validateFn: e, onUpload: t }) => (i, n, a) => {
|
|
3599
|
+
for (const l of i) {
|
|
3474
3600
|
if (e && !e(l))
|
|
3475
3601
|
continue;
|
|
3476
|
-
const r = Date.now().toString(),
|
|
3477
|
-
|
|
3478
|
-
const
|
|
3479
|
-
|
|
3480
|
-
add: [{ id: r, pos: a, src:
|
|
3481
|
-
}),
|
|
3602
|
+
const r = Date.now().toString(), d = n.state.tr;
|
|
3603
|
+
d.selection.empty || d.deleteSelection();
|
|
3604
|
+
const s = URL.createObjectURL(l);
|
|
3605
|
+
d.setMeta(se, {
|
|
3606
|
+
add: [{ id: r, pos: a, src: s }]
|
|
3607
|
+
}), n.dispatch(d), t(l).then(
|
|
3482
3608
|
(c) => {
|
|
3483
3609
|
var A;
|
|
3484
|
-
const { schema: h } =
|
|
3610
|
+
const { schema: h } = n.state, m = Ba(n.state, r);
|
|
3485
3611
|
if (m === null)
|
|
3486
3612
|
return;
|
|
3487
|
-
const f = typeof c == "object" ?
|
|
3613
|
+
const f = typeof c == "object" ? s : c, b = (A = h.nodes.image) == null ? void 0 : A.create({ src: f });
|
|
3488
3614
|
if (!b)
|
|
3489
3615
|
return;
|
|
3490
|
-
const w =
|
|
3491
|
-
|
|
3616
|
+
const w = n.state.tr.replaceWith(m, m, b).setMeta(se, { remove: [r] });
|
|
3617
|
+
n.dispatch(w);
|
|
3492
3618
|
},
|
|
3493
3619
|
() => {
|
|
3494
|
-
const c =
|
|
3495
|
-
|
|
3620
|
+
const c = n.state.tr.delete(a, a).setMeta(se, { remove: [r] });
|
|
3621
|
+
n.dispatch(c);
|
|
3496
3622
|
}
|
|
3497
3623
|
);
|
|
3498
3624
|
}
|
|
3499
|
-
},
|
|
3625
|
+
}, Ia = (e, t, i) => {
|
|
3500
3626
|
var a;
|
|
3501
|
-
const
|
|
3502
|
-
if (
|
|
3627
|
+
const n = [...((a = t.clipboardData) == null ? void 0 : a.files) || []];
|
|
3628
|
+
if (n.length > 0) {
|
|
3503
3629
|
t.preventDefault();
|
|
3504
3630
|
const l = e.state.selection.from;
|
|
3505
|
-
return n
|
|
3631
|
+
return i(n, e, l + 1), !0;
|
|
3506
3632
|
}
|
|
3507
3633
|
return !1;
|
|
3508
|
-
},
|
|
3634
|
+
}, Fa = (e, t, i, n) => {
|
|
3509
3635
|
var l;
|
|
3510
3636
|
const a = [...((l = t.dataTransfer) == null ? void 0 : l.files) || []];
|
|
3511
|
-
if (!
|
|
3637
|
+
if (!i && a.length > 0) {
|
|
3512
3638
|
t.preventDefault();
|
|
3513
3639
|
const r = e.posAtCoords({
|
|
3514
3640
|
left: t.clientX,
|
|
3515
3641
|
top: t.clientY
|
|
3516
3642
|
});
|
|
3517
3643
|
if (r)
|
|
3518
|
-
return
|
|
3644
|
+
return n(a, e, r.pos + 1), !0;
|
|
3519
3645
|
}
|
|
3520
3646
|
return !1;
|
|
3521
|
-
},
|
|
3522
|
-
const { t } =
|
|
3647
|
+
}, Pa = (e) => {
|
|
3648
|
+
const { t } = D(), [i, n] = N(""), a = ce(null);
|
|
3523
3649
|
function l(c) {
|
|
3524
3650
|
var w, A;
|
|
3525
3651
|
const h = (w = c == null ? void 0 : c.target) == null ? void 0 : w.files;
|
|
@@ -3534,22 +3660,22 @@ const Jt = ({ validateFn: e, onUpload: t }) => (n, i, a) => {
|
|
|
3534
3660
|
})([m], e.editor.view, e.getPos());
|
|
3535
3661
|
}
|
|
3536
3662
|
function r(c) {
|
|
3537
|
-
c.preventDefault(), e.editor.chain().setImage({ src:
|
|
3663
|
+
c.preventDefault(), e.editor.chain().setImage({ src: i }).deleteRange({ from: e.getPos(), to: e.getPos() }).focus().run();
|
|
3538
3664
|
}
|
|
3539
|
-
function
|
|
3665
|
+
function d(c) {
|
|
3540
3666
|
c == null || c.preventDefault(), e.deleteNode();
|
|
3541
3667
|
}
|
|
3542
|
-
function
|
|
3668
|
+
function s(c) {
|
|
3543
3669
|
var h;
|
|
3544
3670
|
c.preventDefault(), (h = a.current) == null || h.click();
|
|
3545
3671
|
}
|
|
3546
3672
|
return /* @__PURE__ */ o(He, { className: "p-0 m-0", "data-drag-handle": !0, children: /* @__PURE__ */ u(ae, { defaultOpen: !0, modal: !0, children: [
|
|
3547
3673
|
/* @__PURE__ */ o(le, { asChild: !0, children: /* @__PURE__ */ o("div", { className: "flex items-center w-full p-3 my-3 hover:bg-accent border border-border text-muted-foreground cursor-pointer rounded-sm transition-all", children: /* @__PURE__ */ u("div", { className: "flex justify-between items-center w-full", children: [
|
|
3548
3674
|
/* @__PURE__ */ u("div", { className: "flex justify-center items-center gap-3", children: [
|
|
3549
|
-
/* @__PURE__ */ o(
|
|
3675
|
+
/* @__PURE__ */ o(C, { name: "ImageUp", className: "w-6 h-6" }),
|
|
3550
3676
|
/* @__PURE__ */ o("span", { className: "text-sm", children: t("editor.image.dialog.title") })
|
|
3551
3677
|
] }),
|
|
3552
|
-
/* @__PURE__ */ o(
|
|
3678
|
+
/* @__PURE__ */ o(C, { name: "Trash2", className: "hover:text-foreground", onClick: d })
|
|
3553
3679
|
] }) }) }),
|
|
3554
3680
|
/* @__PURE__ */ o(Z, { className: "w-full", onOpenAutoFocus: (c) => c.preventDefault(), children: /* @__PURE__ */ u(Zt, { defaultValue: "upload", className: "w-[400px]", activationMode: "manual", children: [
|
|
3555
3681
|
/* @__PURE__ */ u(Ge, { className: "grid w-full grid-cols-2", children: [
|
|
@@ -3564,7 +3690,7 @@ const Jt = ({ validateFn: e, onUpload: t }) => (n, i, a) => {
|
|
|
3564
3690
|
] })
|
|
3565
3691
|
] }),
|
|
3566
3692
|
/* @__PURE__ */ u(ve, { value: "upload", children: [
|
|
3567
|
-
/* @__PURE__ */ o(E, { className: "w-full mt-1", size: "sm", onClick:
|
|
3693
|
+
/* @__PURE__ */ o(E, { className: "w-full mt-1", size: "sm", onClick: s, children: t("editor.image.dialog.tab.upload") }),
|
|
3568
3694
|
/* @__PURE__ */ o(
|
|
3569
3695
|
"input",
|
|
3570
3696
|
{
|
|
@@ -3585,8 +3711,8 @@ const Jt = ({ validateFn: e, onUpload: t }) => (n, i, a) => {
|
|
|
3585
3711
|
{
|
|
3586
3712
|
type: "url",
|
|
3587
3713
|
autoFocus: !0,
|
|
3588
|
-
value:
|
|
3589
|
-
onChange: (c) =>
|
|
3714
|
+
value: i,
|
|
3715
|
+
onChange: (c) => n(c.target.value),
|
|
3590
3716
|
required: !0,
|
|
3591
3717
|
placeholder: t("editor.image.dialog.placeholder")
|
|
3592
3718
|
}
|
|
@@ -3595,11 +3721,11 @@ const Jt = ({ validateFn: e, onUpload: t }) => (n, i, a) => {
|
|
|
3595
3721
|
] }) }) })
|
|
3596
3722
|
] }) })
|
|
3597
3723
|
] }) });
|
|
3598
|
-
},
|
|
3724
|
+
}, Oa = {
|
|
3599
3725
|
acceptMimes: ["image/jpeg", "image/gif", "image/png", "image/jpg"],
|
|
3600
3726
|
maxSize: 1024 * 1024 * 5
|
|
3601
3727
|
// 5MB
|
|
3602
|
-
},
|
|
3728
|
+
}, ur = te.create({
|
|
3603
3729
|
name: "imageUpload",
|
|
3604
3730
|
isolating: !0,
|
|
3605
3731
|
defining: !0,
|
|
@@ -3623,50 +3749,50 @@ const Jt = ({ validateFn: e, onUpload: t }) => (n, i, a) => {
|
|
|
3623
3749
|
};
|
|
3624
3750
|
},
|
|
3625
3751
|
addNodeView() {
|
|
3626
|
-
return
|
|
3752
|
+
return ze(Pa);
|
|
3627
3753
|
},
|
|
3628
3754
|
addOptions() {
|
|
3629
3755
|
var e;
|
|
3630
3756
|
return {
|
|
3631
|
-
...
|
|
3757
|
+
...Oa,
|
|
3632
3758
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
3633
3759
|
upload: () => Promise.reject("Image Upload Function"),
|
|
3634
3760
|
button: ({
|
|
3635
3761
|
editor: t,
|
|
3636
|
-
extension:
|
|
3637
|
-
t:
|
|
3762
|
+
extension: i,
|
|
3763
|
+
t: n
|
|
3638
3764
|
}) => ({
|
|
3639
3765
|
component: v,
|
|
3640
3766
|
componentProps: {
|
|
3641
3767
|
action: () => t.commands.setImageUpload(),
|
|
3642
|
-
upload:
|
|
3768
|
+
upload: i.options.upload,
|
|
3643
3769
|
disabled: !t.can().setImage({}),
|
|
3644
3770
|
icon: "ImageUp",
|
|
3645
|
-
tooltip:
|
|
3771
|
+
tooltip: n("editor.image.tooltip")
|
|
3646
3772
|
}
|
|
3647
3773
|
})
|
|
3648
3774
|
};
|
|
3649
3775
|
},
|
|
3650
3776
|
addProseMirrorPlugins() {
|
|
3651
3777
|
const t = Jt({
|
|
3652
|
-
validateFn: (
|
|
3778
|
+
validateFn: (i) => !(!this.options.acceptMimes.includes(i.type) || i.size > this.options.maxSize),
|
|
3653
3779
|
onUpload: this.options.upload
|
|
3654
3780
|
});
|
|
3655
3781
|
return [
|
|
3656
3782
|
new ue({
|
|
3657
3783
|
props: {
|
|
3658
|
-
handlePaste: (
|
|
3659
|
-
handleDrop: (
|
|
3784
|
+
handlePaste: (i, n) => !n.clipboardData || [...n.clipboardData.items || []].some((l) => l.type === "text/html") ? !1 : Ia(i, n, t),
|
|
3785
|
+
handleDrop: (i, n, a, l) => (!(n instanceof DragEvent) || !n.dataTransfer || Fa(i, n, l, t), !1)
|
|
3660
3786
|
}
|
|
3661
3787
|
}),
|
|
3662
|
-
|
|
3788
|
+
za()
|
|
3663
3789
|
];
|
|
3664
3790
|
}
|
|
3665
3791
|
});
|
|
3666
|
-
function
|
|
3792
|
+
function Ea(e) {
|
|
3667
3793
|
return e = e.replace("https://youtu.be/", "https://www.youtube.com/watch?v=").replace("watch?v=", "embed/"), e = e.replace("https://vimeo.com/", "https://player.vimeo.com/video/"), /^https?:\/\/www.bilibili.com\/video\/.*/i.test(e) && (e = e.replace(/\?.*$/i, "").replace("https://www.bilibili.com/video/", "https://player.bilibili.com/player.html?bvid=")), e.includes("drive.google.com") && (e = e.replace("/view", "/preview")), e;
|
|
3668
3794
|
}
|
|
3669
|
-
const
|
|
3795
|
+
const mr = te.create({
|
|
3670
3796
|
name: "video",
|
|
3671
3797
|
group: "block",
|
|
3672
3798
|
atom: !0,
|
|
@@ -3676,13 +3802,13 @@ const ur = te.create({
|
|
|
3676
3802
|
src: {
|
|
3677
3803
|
default: null,
|
|
3678
3804
|
renderHTML: ({ src: e }) => ({
|
|
3679
|
-
src: e ?
|
|
3805
|
+
src: e ? Ea(e) : null
|
|
3680
3806
|
})
|
|
3681
3807
|
},
|
|
3682
3808
|
width: {
|
|
3683
3809
|
default: this.options.width,
|
|
3684
3810
|
renderHTML: ({ width: e }) => ({
|
|
3685
|
-
width:
|
|
3811
|
+
width: Ta(e)
|
|
3686
3812
|
})
|
|
3687
3813
|
},
|
|
3688
3814
|
frameborder: {
|
|
@@ -3703,15 +3829,15 @@ const ur = te.create({
|
|
|
3703
3829
|
];
|
|
3704
3830
|
},
|
|
3705
3831
|
renderHTML({ HTMLAttributes: e }) {
|
|
3706
|
-
const { width: t = "100%" } = e ?? {},
|
|
3832
|
+
const { width: t = "100%" } = e ?? {}, i = {
|
|
3707
3833
|
...e,
|
|
3708
3834
|
width: "100%",
|
|
3709
3835
|
height: "100%"
|
|
3710
|
-
},
|
|
3836
|
+
}, n = `position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`, a = `flex: 1;padding-bottom: ${9 / 16 * 100}%;`, d = ["div", { style: n }, ["div", { style: a }], ["iframe", i]];
|
|
3711
3837
|
return ["div", {
|
|
3712
3838
|
...this.options.HTMLAttributes,
|
|
3713
3839
|
"data-video": ""
|
|
3714
|
-
},
|
|
3840
|
+
}, d];
|
|
3715
3841
|
},
|
|
3716
3842
|
addCommands() {
|
|
3717
3843
|
return {
|
|
@@ -3736,9 +3862,9 @@ const ur = te.create({
|
|
|
3736
3862
|
}
|
|
3737
3863
|
};
|
|
3738
3864
|
}
|
|
3739
|
-
}),
|
|
3740
|
-
const { t } =
|
|
3741
|
-
function
|
|
3865
|
+
}), _a = (e) => {
|
|
3866
|
+
const { t } = D(), [i, n] = N(""), [a, l] = N(!1), r = ce(null);
|
|
3867
|
+
function d(m) {
|
|
3742
3868
|
var A, B;
|
|
3743
3869
|
l(!0);
|
|
3744
3870
|
const f = (A = m == null ? void 0 : m.target) == null ? void 0 : A.files;
|
|
@@ -3751,9 +3877,9 @@ const ur = te.create({
|
|
|
3751
3877
|
e.editor.chain().setVideo({ src: F[0].src, width: "100%" }).deleteRange({ from: e.getPos(), to: e.getPos() }).focus().run(), l(!1);
|
|
3752
3878
|
});
|
|
3753
3879
|
}
|
|
3754
|
-
function
|
|
3880
|
+
function s(m) {
|
|
3755
3881
|
m.preventDefault(), e.editor.chain().setVideo({
|
|
3756
|
-
src:
|
|
3882
|
+
src: i,
|
|
3757
3883
|
width: "100%"
|
|
3758
3884
|
}).deleteRange({ from: e.getPos(), to: e.getPos() }).focus().run();
|
|
3759
3885
|
}
|
|
@@ -3766,17 +3892,17 @@ const ur = te.create({
|
|
|
3766
3892
|
}
|
|
3767
3893
|
return /* @__PURE__ */ o(He, { as: "div", "data-drag-handle": !0, children: /* @__PURE__ */ u(ae, { defaultOpen: !0, modal: !0, children: [
|
|
3768
3894
|
/* @__PURE__ */ o(le, { asChild: !0, children: /* @__PURE__ */ o("div", { className: "flex items-center w-full p-3 my-3 hover:bg-accent border border-border text-muted-foreground cursor-pointer rounded-sm transition-all", children: a ? /* @__PURE__ */ u("div", { className: "flex justify-center items-center gap-3 text-s", children: [
|
|
3769
|
-
/* @__PURE__ */ o(
|
|
3895
|
+
/* @__PURE__ */ o(C, { className: "animate-spin w-6 h-6", name: "LoaderCircle" }),
|
|
3770
3896
|
/* @__PURE__ */ u("span", { children: [
|
|
3771
3897
|
t("editor.video.dialog.uploading"),
|
|
3772
3898
|
"..."
|
|
3773
3899
|
] })
|
|
3774
3900
|
] }) : /* @__PURE__ */ u("div", { className: "flex justify-between items-center w-full", children: [
|
|
3775
3901
|
/* @__PURE__ */ u("div", { className: "flex justify-center items-center gap-3", children: [
|
|
3776
|
-
/* @__PURE__ */ o(
|
|
3902
|
+
/* @__PURE__ */ o(C, { name: "Video", className: "w-6 h-6" }),
|
|
3777
3903
|
/* @__PURE__ */ o("span", { className: "text-sm", children: t("editor.video.dialog.title") })
|
|
3778
3904
|
] }),
|
|
3779
|
-
/* @__PURE__ */ o(
|
|
3905
|
+
/* @__PURE__ */ o(C, { name: "Trash2", className: "hover:text-foreground", onClick: c })
|
|
3780
3906
|
] }) }) }),
|
|
3781
3907
|
/* @__PURE__ */ o(Z, { className: "w-full", onOpenAutoFocus: (m) => m.preventDefault(), children: /* @__PURE__ */ u(Zt, { defaultValue: "upload", className: "w-[400px]", activationMode: "manual", children: [
|
|
3782
3908
|
/* @__PURE__ */ u(Ge, { className: "grid w-full grid-cols-2", children: [
|
|
@@ -3802,11 +3928,11 @@ const ur = te.create({
|
|
|
3802
3928
|
style: {
|
|
3803
3929
|
display: "none"
|
|
3804
3930
|
},
|
|
3805
|
-
onChange:
|
|
3931
|
+
onChange: d
|
|
3806
3932
|
}
|
|
3807
3933
|
)
|
|
3808
3934
|
] }),
|
|
3809
|
-
/* @__PURE__ */ o(ve, { value: "link", children: /* @__PURE__ */ o("form", { onSubmit:
|
|
3935
|
+
/* @__PURE__ */ o(ve, { value: "link", children: /* @__PURE__ */ o("form", { onSubmit: s, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3810
3936
|
/* @__PURE__ */ o(
|
|
3811
3937
|
ee,
|
|
3812
3938
|
{
|
|
@@ -3814,15 +3940,15 @@ const ur = te.create({
|
|
|
3814
3940
|
autoFocus: !0,
|
|
3815
3941
|
required: !0,
|
|
3816
3942
|
placeholder: t("editor.video.dialog.placeholder"),
|
|
3817
|
-
value:
|
|
3818
|
-
onChange: (m) =>
|
|
3943
|
+
value: i,
|
|
3944
|
+
onChange: (m) => n(m.target.value)
|
|
3819
3945
|
}
|
|
3820
3946
|
),
|
|
3821
3947
|
/* @__PURE__ */ o(E, { type: "submit", children: t("editor.video.dialog.button.apply") })
|
|
3822
3948
|
] }) }) })
|
|
3823
3949
|
] }) })
|
|
3824
3950
|
] }) });
|
|
3825
|
-
},
|
|
3951
|
+
}, hr = te.create({
|
|
3826
3952
|
name: "videoUpload",
|
|
3827
3953
|
isolating: !0,
|
|
3828
3954
|
defining: !0,
|
|
@@ -3846,58 +3972,58 @@ const ur = te.create({
|
|
|
3846
3972
|
};
|
|
3847
3973
|
},
|
|
3848
3974
|
addNodeView() {
|
|
3849
|
-
return
|
|
3975
|
+
return ze(_a);
|
|
3850
3976
|
},
|
|
3851
3977
|
addOptions() {
|
|
3852
3978
|
var e;
|
|
3853
3979
|
return {
|
|
3854
3980
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
3855
3981
|
upload: void 0,
|
|
3856
|
-
button: ({ editor: t, t:
|
|
3982
|
+
button: ({ editor: t, t: i }) => ({
|
|
3857
3983
|
component: v,
|
|
3858
3984
|
componentProps: {
|
|
3859
3985
|
action: () => t.commands.setVideoUpload(),
|
|
3860
3986
|
isActive: () => t.isActive("video") || !1,
|
|
3861
3987
|
disabled: !t.can().setVideo({}),
|
|
3862
3988
|
icon: "Video",
|
|
3863
|
-
tooltip:
|
|
3989
|
+
tooltip: i("editor.video.tooltip")
|
|
3864
3990
|
}
|
|
3865
3991
|
})
|
|
3866
3992
|
};
|
|
3867
3993
|
}
|
|
3868
|
-
}),
|
|
3994
|
+
}), $a = /(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, Ua = /CrOS/, Va = /android|ipad|playbook|silk/i;
|
|
3869
3995
|
function at(e = {}) {
|
|
3870
3996
|
let t = e.ua || typeof navigator < "u" && navigator.userAgent;
|
|
3871
|
-
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(
|
|
3997
|
+
return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!($a.test(t) && !Ua.test(t) || e.tablet && Va.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
|
|
3872
3998
|
}
|
|
3873
|
-
const lt = (e) => Array.from({ length: e }).map((t,
|
|
3999
|
+
const lt = (e) => Array.from({ length: e }).map((t, i) => i + 1), ja = (e) => {
|
|
3874
4000
|
var h;
|
|
3875
|
-
const [t,
|
|
3876
|
-
rows: at() ?
|
|
3877
|
-
cols: at() ?
|
|
4001
|
+
const [t, i] = N(!0), [n, a] = N({
|
|
4002
|
+
rows: at() ? Ce : ke,
|
|
4003
|
+
cols: at() ? Ce : ke
|
|
3878
4004
|
}), [l, r] = N({
|
|
3879
4005
|
rows: Ne,
|
|
3880
4006
|
cols: Ne
|
|
3881
4007
|
});
|
|
3882
|
-
function
|
|
3883
|
-
m ===
|
|
4008
|
+
function d(m, f) {
|
|
4009
|
+
m === n.rows && a((b) => ({
|
|
3884
4010
|
...b,
|
|
3885
|
-
rows: Math.min(m + 1,
|
|
3886
|
-
})), f ===
|
|
4011
|
+
rows: Math.min(m + 1, Ce)
|
|
4012
|
+
})), f === n.cols && a((b) => ({
|
|
3887
4013
|
...b,
|
|
3888
|
-
cols: Math.min(f + 1,
|
|
4014
|
+
cols: Math.min(f + 1, Ce)
|
|
3889
4015
|
})), r({
|
|
3890
4016
|
rows: m,
|
|
3891
4017
|
cols: f
|
|
3892
4018
|
});
|
|
3893
4019
|
}
|
|
3894
|
-
function
|
|
4020
|
+
function s(m, f) {
|
|
3895
4021
|
e == null || e.createTable({ rows: m, cols: f, withHeaderRow: t }), c();
|
|
3896
4022
|
}
|
|
3897
4023
|
function c() {
|
|
3898
|
-
|
|
3899
|
-
rows:
|
|
3900
|
-
cols:
|
|
4024
|
+
i(!1), a({
|
|
4025
|
+
rows: ke,
|
|
4026
|
+
cols: ke
|
|
3901
4027
|
}), r({
|
|
3902
4028
|
rows: Ne,
|
|
3903
4029
|
cols: Ne
|
|
@@ -3906,14 +4032,14 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
3906
4032
|
return /* @__PURE__ */ u(ae, { children: [
|
|
3907
4033
|
/* @__PURE__ */ o(le, { asChild: !0, children: /* @__PURE__ */ o("button", { disabled: e == null ? void 0 : e.disabled, className: "m-0 p-0", children: e == null ? void 0 : e.children }) }),
|
|
3908
4034
|
/* @__PURE__ */ o(Z, { className: "w-full !p-2", align: "start", side: "bottom", children: /* @__PURE__ */ u("div", { className: "table-grid-size-editor p-0", children: [
|
|
3909
|
-
/* @__PURE__ */ o("div", { className: "flex flex-col flex-wrap gap-1 justify-between", children: (h = lt(
|
|
4035
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col flex-wrap gap-1 justify-between", children: (h = lt(n == null ? void 0 : n.rows)) == null ? void 0 : h.map((m) => {
|
|
3910
4036
|
var f;
|
|
3911
|
-
return /* @__PURE__ */ o("div", { className: "flex gap-1", children: (f = lt(
|
|
4037
|
+
return /* @__PURE__ */ o("div", { className: "flex gap-1", children: (f = lt(n == null ? void 0 : n.cols)) == null ? void 0 : f.map((b) => /* @__PURE__ */ o(
|
|
3912
4038
|
"div",
|
|
3913
4039
|
{
|
|
3914
4040
|
className: `pa-1 cursor-pointer border-border ${b <= l.cols && m <= l.rows && "bg-foreground"}`,
|
|
3915
|
-
onMouseOver: () =>
|
|
3916
|
-
onMouseDown: () =>
|
|
4041
|
+
onMouseOver: () => d(m, b),
|
|
4042
|
+
onMouseDown: () => s(m, b),
|
|
3917
4043
|
children: /* @__PURE__ */ o("div", { className: "w-4 h-4 p-1 border rounded-[2px] box-border border-solid" })
|
|
3918
4044
|
},
|
|
3919
4045
|
`c-${b}`
|
|
@@ -3926,11 +4052,11 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
3926
4052
|
] })
|
|
3927
4053
|
] }) })
|
|
3928
4054
|
] });
|
|
3929
|
-
},
|
|
3930
|
-
function t(
|
|
3931
|
-
e.disabled || e.editor.chain().focus().insertTable({ ...
|
|
4055
|
+
}, Ka = (e) => {
|
|
4056
|
+
function t(i) {
|
|
4057
|
+
e.disabled || e.editor.chain().focus().insertTable({ ...i, withHeaderRow: !1 }).run();
|
|
3932
4058
|
}
|
|
3933
|
-
return /* @__PURE__ */ o(
|
|
4059
|
+
return /* @__PURE__ */ o(ja, { createTable: t, disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o("div", { className: "flex", children: /* @__PURE__ */ o(
|
|
3934
4060
|
v,
|
|
3935
4061
|
{
|
|
3936
4062
|
icon: e == null ? void 0 : e.icon,
|
|
@@ -3941,26 +4067,26 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
3941
4067
|
isActive: e == null ? void 0 : e.isActive
|
|
3942
4068
|
}
|
|
3943
4069
|
) }) });
|
|
3944
|
-
},
|
|
4070
|
+
}, qa = (e, t, i) => {
|
|
3945
4071
|
if (!e.doc)
|
|
3946
4072
|
return e;
|
|
3947
|
-
const
|
|
3948
|
-
if (!
|
|
4073
|
+
const n = e.doc.nodeAt(t);
|
|
4074
|
+
if (!n || i === n.attrs.backgroundColor)
|
|
3949
4075
|
return e;
|
|
3950
4076
|
const a = {
|
|
3951
|
-
...
|
|
3952
|
-
backgroundColor:
|
|
4077
|
+
...n.attrs,
|
|
4078
|
+
backgroundColor: i
|
|
3953
4079
|
};
|
|
3954
|
-
return e.setNodeMarkup(t,
|
|
3955
|
-
},
|
|
3956
|
-
const { doc:
|
|
3957
|
-
return !
|
|
3958
|
-
e =
|
|
4080
|
+
return e.setNodeMarkup(t, n.type, a, n.marks);
|
|
4081
|
+
}, Wa = (e, t, i) => {
|
|
4082
|
+
const { doc: n, selection: a } = e;
|
|
4083
|
+
return !n || !a || !(a instanceof ao) || a.forEachCell((l, r) => {
|
|
4084
|
+
e = qa(e, r, i);
|
|
3959
4085
|
}), e;
|
|
3960
|
-
}, rt = (e, t) => ({ tr:
|
|
3961
|
-
const { selection: l } =
|
|
3962
|
-
return
|
|
3963
|
-
},
|
|
4086
|
+
}, rt = (e, t) => ({ tr: i, state: n, dispatch: a }) => {
|
|
4087
|
+
const { selection: l } = n;
|
|
4088
|
+
return i = i.setSelection(l), i = Wa(i, t, e), i.docChanged ? (a == null || a(i), !0) : !1;
|
|
4089
|
+
}, Ga = V.create({
|
|
3964
4090
|
name: "tableCellBackground",
|
|
3965
4091
|
addOptions() {
|
|
3966
4092
|
return {
|
|
@@ -3989,7 +4115,7 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
3989
4115
|
unsetTableCellBackground: () => rt("", this.options)
|
|
3990
4116
|
};
|
|
3991
4117
|
}
|
|
3992
|
-
}),
|
|
4118
|
+
}), fr = lo.extend({
|
|
3993
4119
|
addOptions() {
|
|
3994
4120
|
var e;
|
|
3995
4121
|
return {
|
|
@@ -3997,12 +4123,12 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
3997
4123
|
resizable: !0,
|
|
3998
4124
|
lastColumnResizable: !0,
|
|
3999
4125
|
allowTableNodeSelection: !1,
|
|
4000
|
-
button: ({ editor: t, t:
|
|
4001
|
-
component:
|
|
4126
|
+
button: ({ editor: t, t: i }) => ({
|
|
4127
|
+
component: Ka,
|
|
4002
4128
|
componentProps: {
|
|
4003
4129
|
disabled: t.isActive("table") || !1,
|
|
4004
4130
|
icon: "Table",
|
|
4005
|
-
tooltip:
|
|
4131
|
+
tooltip: i("editor.table.tooltip"),
|
|
4006
4132
|
editor: t
|
|
4007
4133
|
}
|
|
4008
4134
|
})
|
|
@@ -4013,23 +4139,23 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
4013
4139
|
ro.configure(this.options.tableRow),
|
|
4014
4140
|
so.configure(this.options.tableHeader),
|
|
4015
4141
|
co.configure(this.options.tableCell),
|
|
4016
|
-
|
|
4142
|
+
Ga.configure(this.options.tableCellBackground)
|
|
4017
4143
|
];
|
|
4018
4144
|
}
|
|
4019
|
-
}),
|
|
4145
|
+
}), gr = V.create({
|
|
4020
4146
|
name: "painter",
|
|
4021
4147
|
addOptions() {
|
|
4022
4148
|
var e;
|
|
4023
4149
|
return {
|
|
4024
4150
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
4025
|
-
button: ({ editor: t, t:
|
|
4151
|
+
button: ({ editor: t, t: i }) => ({
|
|
4026
4152
|
component: v,
|
|
4027
4153
|
componentProps: {
|
|
4028
4154
|
action: () => {
|
|
4029
4155
|
t.commands.setPainter(t == null ? void 0 : t.state.selection.$head.marks());
|
|
4030
4156
|
},
|
|
4031
4157
|
icon: "PaintRoller",
|
|
4032
|
-
tooltip:
|
|
4158
|
+
tooltip: i("editor.format")
|
|
4033
4159
|
}
|
|
4034
4160
|
})
|
|
4035
4161
|
};
|
|
@@ -4039,12 +4165,12 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
4039
4165
|
setPainter: (e) => ({
|
|
4040
4166
|
view: {
|
|
4041
4167
|
dispatch: t,
|
|
4042
|
-
state: { tr:
|
|
4043
|
-
dom:
|
|
4168
|
+
state: { tr: i },
|
|
4169
|
+
dom: n
|
|
4044
4170
|
}
|
|
4045
4171
|
}) => {
|
|
4046
4172
|
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`;
|
|
4047
|
-
return
|
|
4173
|
+
return n.style.cursor = r, t(i.setMeta("painterAction", { type: "start", marks: e })), !0;
|
|
4048
4174
|
}
|
|
4049
4175
|
};
|
|
4050
4176
|
},
|
|
@@ -4055,29 +4181,29 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
4055
4181
|
state: {
|
|
4056
4182
|
init: () => [],
|
|
4057
4183
|
apply: (e, t) => {
|
|
4058
|
-
const
|
|
4059
|
-
return
|
|
4184
|
+
const i = e.getMeta("painterAction");
|
|
4185
|
+
return i && i.type === "start" ? t = i.marks : i && i.type === "end" && (t = []), t;
|
|
4060
4186
|
}
|
|
4061
4187
|
},
|
|
4062
4188
|
props: {
|
|
4063
4189
|
handleDOMEvents: {
|
|
4064
4190
|
mousedown(e, t) {
|
|
4065
|
-
const
|
|
4066
|
-
if (!
|
|
4191
|
+
const i = this.getState(e.state);
|
|
4192
|
+
if (!i || i.length === 0)
|
|
4067
4193
|
return e.dom.style.cursor = "", !1;
|
|
4068
|
-
const
|
|
4069
|
-
document.removeEventListener("mouseup",
|
|
4194
|
+
const n = () => {
|
|
4195
|
+
document.removeEventListener("mouseup", n);
|
|
4070
4196
|
let {
|
|
4071
4197
|
dispatch: a,
|
|
4072
4198
|
state: { tr: l, selection: r },
|
|
4073
|
-
dom:
|
|
4199
|
+
dom: d
|
|
4074
4200
|
} = e;
|
|
4075
|
-
|
|
4076
|
-
for (const
|
|
4077
|
-
|
|
4201
|
+
d.style.cursor = "", l = l.removeMark(r.from, r.to);
|
|
4202
|
+
for (const s of i)
|
|
4203
|
+
s.type.name != "link" && (l = l.addMark(r.from, r.to, s));
|
|
4078
4204
|
a(l.setMeta("painterAction", { type: "end" }));
|
|
4079
4205
|
};
|
|
4080
|
-
return document.addEventListener("mouseup",
|
|
4206
|
+
return document.addEventListener("mouseup", n), !0;
|
|
4081
4207
|
}
|
|
4082
4208
|
}
|
|
4083
4209
|
}
|
|
@@ -4181,91 +4307,91 @@ const lt = (e) => Array.from({ length: e }).map((t, n) => n + 1), Va = (e) => {
|
|
|
4181
4307
|
linkRule: ["https:\\/\\/goo.gl\\/maps\\/\\w+"]
|
|
4182
4308
|
}
|
|
4183
4309
|
};
|
|
4184
|
-
function
|
|
4185
|
-
const
|
|
4310
|
+
function Xa(e, t) {
|
|
4311
|
+
const i = ge.youtube, n = t.matchedUrl;
|
|
4186
4312
|
t.validLink = !0;
|
|
4187
|
-
const a =
|
|
4313
|
+
const a = n.split("="), l = a.length;
|
|
4188
4314
|
if (l > 0) {
|
|
4189
4315
|
const r = a[l - 1];
|
|
4190
|
-
t.src = `${
|
|
4316
|
+
t.src = `${i.srcPrefix}/${r}`, t.validId = !0;
|
|
4191
4317
|
}
|
|
4192
4318
|
return t;
|
|
4193
4319
|
}
|
|
4194
|
-
function
|
|
4195
|
-
const
|
|
4320
|
+
function Za(e, t) {
|
|
4321
|
+
const i = ge.youku, n = t.matchedUrl, a = i.idRule, l = new RegExp(a), r = n.match(l);
|
|
4196
4322
|
if (r && r.length > 0) {
|
|
4197
|
-
const
|
|
4198
|
-
t.validId = !0, t.src = `${
|
|
4323
|
+
const d = r[0].slice(3);
|
|
4324
|
+
t.validId = !0, t.src = `${i.srcPrefix}/${d}`;
|
|
4199
4325
|
} else
|
|
4200
4326
|
t.validId = !1;
|
|
4201
4327
|
return t;
|
|
4202
4328
|
}
|
|
4203
|
-
function
|
|
4204
|
-
const
|
|
4329
|
+
function Ja(e, t) {
|
|
4330
|
+
const i = ge.bilibili, a = t.matchedUrl.split("/"), l = a.length;
|
|
4205
4331
|
if (l > 0) {
|
|
4206
4332
|
const r = a[l - 1];
|
|
4207
|
-
t.src = `${
|
|
4333
|
+
t.src = `${i.srcPrefix}=${r}`, t.validId = !0;
|
|
4208
4334
|
}
|
|
4209
4335
|
return t;
|
|
4210
4336
|
}
|
|
4211
|
-
function
|
|
4212
|
-
const
|
|
4337
|
+
function Ya(e, t) {
|
|
4338
|
+
const i = ge.qqvideo, a = t.matchedUrl.split("/"), l = a.length;
|
|
4213
4339
|
if (l > 0) {
|
|
4214
4340
|
const r = a[l - 1];
|
|
4215
|
-
t.src = `${
|
|
4341
|
+
t.src = `${i.srcPrefix}=${r}`, t.validId = !0;
|
|
4216
4342
|
}
|
|
4217
4343
|
return t;
|
|
4218
4344
|
}
|
|
4219
|
-
function Ya(e, t) {
|
|
4220
|
-
return t.src = e, t.validId = !0, t;
|
|
4221
|
-
}
|
|
4222
4345
|
function Qa(e, t) {
|
|
4223
4346
|
return t.src = e, t.validId = !0, t;
|
|
4224
4347
|
}
|
|
4225
4348
|
function el(e, t) {
|
|
4226
|
-
return t.src = e, t.validId = !0, t
|
|
4349
|
+
return t.src = e, t.validId = !0, t;
|
|
4227
4350
|
}
|
|
4228
4351
|
function tl(e, t) {
|
|
4352
|
+
return t.src = e, t.validId = !0, t.originalLink = e, t;
|
|
4353
|
+
}
|
|
4354
|
+
function il(e, t) {
|
|
4229
4355
|
return t.src = t.matchedUrl, t.validId = !0, t.originalLink = t.src, t;
|
|
4230
4356
|
}
|
|
4231
4357
|
function nl(e, t) {
|
|
4232
4358
|
return t.src = t.matchedUrl, t.validId = !0, t.originalLink = t.src, t;
|
|
4233
4359
|
}
|
|
4234
|
-
function il(e, t) {
|
|
4235
|
-
const n = ge.figma;
|
|
4236
|
-
return t.src = `${n.srcPrefix}=${encodeURIComponent(t.matchedUrl)}`, t.validId = !0, t.originalLink = t.matchedUrl, t;
|
|
4237
|
-
}
|
|
4238
4360
|
function ol(e, t) {
|
|
4239
|
-
|
|
4361
|
+
const i = ge.figma;
|
|
4362
|
+
return t.src = `${i.srcPrefix}=${encodeURIComponent(t.matchedUrl)}`, t.validId = !0, t.originalLink = t.matchedUrl, t;
|
|
4240
4363
|
}
|
|
4241
4364
|
function al(e, t) {
|
|
4242
|
-
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink = e, t;
|
|
4365
|
+
return t.src = `${t.matchedUrl}?embed`, t.validId = !0, t.originalLink = e, t;
|
|
4243
4366
|
}
|
|
4244
4367
|
function ll(e, t) {
|
|
4245
|
-
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink =
|
|
4368
|
+
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink = e, t;
|
|
4246
4369
|
}
|
|
4247
4370
|
function rl(e, t) {
|
|
4371
|
+
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink = t.src, t;
|
|
4372
|
+
}
|
|
4373
|
+
function dl(e, t) {
|
|
4248
4374
|
return t.src = `${t.matchedUrl}?background=white&banner=show&embedded=true`, t.validId = !0, t.originalLink = e, t;
|
|
4249
4375
|
}
|
|
4250
4376
|
function sl(e, t) {
|
|
4251
4377
|
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink = e, t;
|
|
4252
4378
|
}
|
|
4253
|
-
function
|
|
4379
|
+
function cl(e, t, i) {
|
|
4254
4380
|
if (e === "googlemaps")
|
|
4255
|
-
return
|
|
4381
|
+
return i.validLink = !0, i.matchedUrl = t, i;
|
|
4256
4382
|
const a = ge[e].linkRule;
|
|
4257
4383
|
for (const l of a) {
|
|
4258
|
-
const r = new RegExp(l),
|
|
4259
|
-
if (
|
|
4260
|
-
return
|
|
4384
|
+
const r = new RegExp(l), d = t.match(r);
|
|
4385
|
+
if (d && d.length > 0)
|
|
4386
|
+
return i.validLink = !0, i.matchedUrl = e === "youtube" ? d[1] : d[0], i;
|
|
4261
4387
|
}
|
|
4262
|
-
return
|
|
4388
|
+
return i;
|
|
4263
4389
|
}
|
|
4264
|
-
const
|
|
4265
|
-
var
|
|
4390
|
+
const ul = (e) => {
|
|
4391
|
+
var i, n;
|
|
4266
4392
|
let t = "iframe";
|
|
4267
|
-
return ((
|
|
4268
|
-
},
|
|
4393
|
+
return ((i = e.includes) != null && i.call(e, "youtube") || (n = e.includes) != null && n.call(e, "youtu.be")) && (t = "youtube"), e.includes("youku") && (t = "youku"), e.includes("bilibili") && (t = "bilibili"), e.includes("qq") && (t = "qqvideo"), e.includes("amap") && (t = "amap"), e.includes("map.baidu") && (t = "baidu_map"), (e.includes("google.com/maps") || e.includes("maps.app.goo.gl")) && (t = "googlemaps"), e.includes("modao") && (t = "modao"), e.includes("lanhuapp") && (t = "lanhu"), e.includes("figma") && (t = "figma"), e.includes("canva") && (t = "canva"), e.includes("processon") && (t = "processon"), e.includes("codepen") && (t = "codepen"), e.includes("jinshuju") && (t = "jinshuju"), e.includes("iframe") && (t = "iframe"), t;
|
|
4394
|
+
}, ml = (e) => {
|
|
4269
4395
|
let t = {
|
|
4270
4396
|
validLink: !1,
|
|
4271
4397
|
validId: !1,
|
|
@@ -4273,49 +4399,49 @@ const cl = (e) => {
|
|
|
4273
4399
|
originalLink: e,
|
|
4274
4400
|
src: ""
|
|
4275
4401
|
};
|
|
4276
|
-
const
|
|
4277
|
-
if (t =
|
|
4402
|
+
const i = ul(e);
|
|
4403
|
+
if (t = cl(i, e, t), !t.validLink)
|
|
4278
4404
|
return t;
|
|
4279
|
-
switch (
|
|
4405
|
+
switch (i) {
|
|
4280
4406
|
case "youtube":
|
|
4281
|
-
return Ga(e, t);
|
|
4282
|
-
case "youku":
|
|
4283
4407
|
return Xa(e, t);
|
|
4284
|
-
case "
|
|
4408
|
+
case "youku":
|
|
4285
4409
|
return Za(e, t);
|
|
4286
|
-
case "
|
|
4410
|
+
case "bilibili":
|
|
4287
4411
|
return Ja(e, t);
|
|
4288
|
-
case "
|
|
4412
|
+
case "qqvideo":
|
|
4289
4413
|
return Ya(e, t);
|
|
4290
|
-
case "
|
|
4414
|
+
case "amap":
|
|
4291
4415
|
return Qa(e, t);
|
|
4292
|
-
case "
|
|
4416
|
+
case "baidu_map":
|
|
4293
4417
|
return el(e, t);
|
|
4294
|
-
case "
|
|
4418
|
+
case "googlemaps":
|
|
4295
4419
|
return tl(e, t);
|
|
4420
|
+
case "modao":
|
|
4421
|
+
return il(e, t);
|
|
4296
4422
|
case "lanhu":
|
|
4297
4423
|
return nl(e, t);
|
|
4298
4424
|
case "figma":
|
|
4299
|
-
return il(e, t);
|
|
4300
|
-
case "canva":
|
|
4301
4425
|
return ol(e, t);
|
|
4302
|
-
case "
|
|
4426
|
+
case "canva":
|
|
4303
4427
|
return al(e, t);
|
|
4304
|
-
case "
|
|
4428
|
+
case "processon":
|
|
4305
4429
|
return ll(e, t);
|
|
4306
|
-
case "
|
|
4430
|
+
case "codepen":
|
|
4307
4431
|
return rl(e, t);
|
|
4432
|
+
case "jinshuju":
|
|
4433
|
+
return dl(e, t);
|
|
4308
4434
|
case "iframe":
|
|
4309
4435
|
return sl(e, t);
|
|
4310
4436
|
}
|
|
4311
4437
|
return t;
|
|
4312
|
-
},
|
|
4313
|
-
var a, l, r,
|
|
4314
|
-
const [t,
|
|
4315
|
-
function
|
|
4438
|
+
}, hl = (e) => {
|
|
4439
|
+
var a, l, r, d, s, c, h, m;
|
|
4440
|
+
const [t, i] = N("");
|
|
4441
|
+
function n() {
|
|
4316
4442
|
if (!t)
|
|
4317
4443
|
return;
|
|
4318
|
-
const f =
|
|
4444
|
+
const f = ml(t);
|
|
4319
4445
|
f.validLink && f.validId && e.updateAttributes({ src: f.src });
|
|
4320
4446
|
}
|
|
4321
4447
|
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ u(He, { as: "section", children: [
|
|
@@ -4324,19 +4450,19 @@ const cl = (e) => {
|
|
|
4324
4450
|
ee,
|
|
4325
4451
|
{
|
|
4326
4452
|
value: t,
|
|
4327
|
-
onInput: (f) =>
|
|
4453
|
+
onInput: (f) => i(f.target.value),
|
|
4328
4454
|
type: "url",
|
|
4329
4455
|
className: "flex-1",
|
|
4330
4456
|
autoFocus: !0,
|
|
4331
4457
|
placeholder: "Enter link"
|
|
4332
4458
|
}
|
|
4333
4459
|
),
|
|
4334
|
-
/* @__PURE__ */ o(E, { className: "w-[60px]", onClick:
|
|
4460
|
+
/* @__PURE__ */ o(E, { className: "w-[60px]", onClick: n, children: "OK" })
|
|
4335
4461
|
] }),
|
|
4336
|
-
((
|
|
4462
|
+
((d = (r = e == null ? void 0 : e.node) == null ? void 0 : r.attrs) == null ? void 0 : d.src) && /* @__PURE__ */ o(
|
|
4337
4463
|
"iframe",
|
|
4338
4464
|
{
|
|
4339
|
-
src: (c = (
|
|
4465
|
+
src: (c = (s = e == null ? void 0 : e.node) == null ? void 0 : s.attrs) == null ? void 0 : c.src,
|
|
4340
4466
|
frameBorder: "0",
|
|
4341
4467
|
allowFullScreen: !0,
|
|
4342
4468
|
title: (m = (h = e == null ? void 0 : e.node) == null ? void 0 : h.attrs) == null ? void 0 : m.src,
|
|
@@ -4344,7 +4470,7 @@ const cl = (e) => {
|
|
|
4344
4470
|
}
|
|
4345
4471
|
)
|
|
4346
4472
|
] }) });
|
|
4347
|
-
},
|
|
4473
|
+
}, br = te.create({
|
|
4348
4474
|
name: "iframes",
|
|
4349
4475
|
group: "block",
|
|
4350
4476
|
atom: !0,
|
|
@@ -4358,16 +4484,16 @@ const cl = (e) => {
|
|
|
4358
4484
|
},
|
|
4359
4485
|
button: ({
|
|
4360
4486
|
editor: t,
|
|
4361
|
-
extension:
|
|
4362
|
-
t:
|
|
4487
|
+
extension: i,
|
|
4488
|
+
t: n
|
|
4363
4489
|
}) => ({
|
|
4364
4490
|
component: v,
|
|
4365
4491
|
componentProps: {
|
|
4366
4492
|
action: (a) => t.commands.setIframe(a),
|
|
4367
|
-
upload:
|
|
4493
|
+
upload: i.options.upload,
|
|
4368
4494
|
disabled: !t.can().setIframe({}),
|
|
4369
4495
|
icon: "Iframe",
|
|
4370
|
-
tooltip:
|
|
4496
|
+
tooltip: n("editor.iframe.tooltip")
|
|
4371
4497
|
}
|
|
4372
4498
|
})
|
|
4373
4499
|
};
|
|
@@ -4400,18 +4526,18 @@ const cl = (e) => {
|
|
|
4400
4526
|
return ["div", this.options.HTMLAttributes, ["iframe", e]];
|
|
4401
4527
|
},
|
|
4402
4528
|
addNodeView() {
|
|
4403
|
-
return
|
|
4529
|
+
return ze(hl);
|
|
4404
4530
|
},
|
|
4405
4531
|
addCommands() {
|
|
4406
4532
|
return {
|
|
4407
|
-
setIframe: (e) => ({ tr: t, dispatch:
|
|
4408
|
-
const { selection:
|
|
4409
|
-
return
|
|
4533
|
+
setIframe: (e) => ({ tr: t, dispatch: i }) => {
|
|
4534
|
+
const { selection: n } = t, a = this.type.create(e);
|
|
4535
|
+
return i && t.replaceRangeWith(n.from, n.to, a), !0;
|
|
4410
4536
|
}
|
|
4411
4537
|
};
|
|
4412
4538
|
}
|
|
4413
|
-
}),
|
|
4414
|
-
const { t } =
|
|
4539
|
+
}), fl = (e) => {
|
|
4540
|
+
const { t } = D();
|
|
4415
4541
|
return /* @__PURE__ */ u("div", { className: "flex items-center gap-2 p-2 bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800", children: [
|
|
4416
4542
|
/* @__PURE__ */ o(
|
|
4417
4543
|
"a",
|
|
@@ -4452,26 +4578,26 @@ const cl = (e) => {
|
|
|
4452
4578
|
)
|
|
4453
4579
|
] })
|
|
4454
4580
|
] });
|
|
4455
|
-
},
|
|
4456
|
-
const [t,
|
|
4457
|
-
const { href:
|
|
4458
|
-
return
|
|
4459
|
-
}, [e]), a = G(({ editor:
|
|
4581
|
+
}, gl = (e) => {
|
|
4582
|
+
const [t, i] = N(!1), n = z(() => {
|
|
4583
|
+
const { href: d } = e.editor.getAttributes("link");
|
|
4584
|
+
return d;
|
|
4585
|
+
}, [e]), a = G(({ editor: d }) => d.isActive("link"), []), l = (d, s, c) => {
|
|
4460
4586
|
e.editor.chain().extendMarkRange("link").insertContent({
|
|
4461
4587
|
type: "text",
|
|
4462
|
-
text:
|
|
4588
|
+
text: s,
|
|
4463
4589
|
marks: [
|
|
4464
4590
|
{
|
|
4465
4591
|
type: "link",
|
|
4466
4592
|
attrs: {
|
|
4467
|
-
href:
|
|
4593
|
+
href: d,
|
|
4468
4594
|
target: c ? "_blank" : ""
|
|
4469
4595
|
}
|
|
4470
4596
|
}
|
|
4471
4597
|
]
|
|
4472
|
-
}).setLink({ href:
|
|
4598
|
+
}).setLink({ href: d }).focus().run(), i(!1);
|
|
4473
4599
|
}, r = G(() => {
|
|
4474
|
-
e.editor.chain().extendMarkRange("link").unsetLink().focus().run(),
|
|
4600
|
+
e.editor.chain().extendMarkRange("link").unsetLink().focus().run(), i(!1);
|
|
4475
4601
|
}, [e.editor]);
|
|
4476
4602
|
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
|
|
4477
4603
|
me,
|
|
@@ -4486,74 +4612,74 @@ const cl = (e) => {
|
|
|
4486
4612
|
offset: [-2, 16],
|
|
4487
4613
|
zIndex: 9999,
|
|
4488
4614
|
onHidden: () => {
|
|
4489
|
-
|
|
4615
|
+
i(!1);
|
|
4490
4616
|
}
|
|
4491
4617
|
},
|
|
4492
4618
|
children: e != null && e.disabled ? /* @__PURE__ */ o(M, {}) : /* @__PURE__ */ o(M, { children: t ? /* @__PURE__ */ o(Xt, { onSetLink: l, editor: e == null ? void 0 : e.editor }) : /* @__PURE__ */ o(
|
|
4493
|
-
|
|
4619
|
+
fl,
|
|
4494
4620
|
{
|
|
4495
4621
|
editor: e == null ? void 0 : e.editor,
|
|
4496
4622
|
onClear: r,
|
|
4497
4623
|
onEdit: () => {
|
|
4498
|
-
|
|
4624
|
+
i(!0);
|
|
4499
4625
|
},
|
|
4500
|
-
link:
|
|
4626
|
+
link: n
|
|
4501
4627
|
}
|
|
4502
4628
|
) })
|
|
4503
4629
|
}
|
|
4504
4630
|
) });
|
|
4505
|
-
},
|
|
4506
|
-
const t = ["size-small", "size-medium", "size-large"],
|
|
4631
|
+
}, bl = (e) => {
|
|
4632
|
+
const t = ["size-small", "size-medium", "size-large"], i = [
|
|
4507
4633
|
"SizeS",
|
|
4508
4634
|
"SizeM",
|
|
4509
4635
|
"SizeL"
|
|
4510
4636
|
];
|
|
4511
|
-
return t.map((
|
|
4512
|
-
type: `image-${
|
|
4637
|
+
return t.map((n, a) => ({
|
|
4638
|
+
type: `image-${n}`,
|
|
4513
4639
|
component: v,
|
|
4514
4640
|
componentProps: {
|
|
4515
|
-
tooltip: T.t(`editor.${
|
|
4516
|
-
icon:
|
|
4517
|
-
action: () => e.commands.updateImage({ width: $e[
|
|
4518
|
-
isActive: () => e.isActive("image", { width: $e[
|
|
4641
|
+
tooltip: T.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
4642
|
+
icon: i[a],
|
|
4643
|
+
action: () => e.commands.updateImage({ width: $e[n] }),
|
|
4644
|
+
isActive: () => e.isActive("image", { width: $e[n] })
|
|
4519
4645
|
}
|
|
4520
4646
|
}));
|
|
4521
|
-
},
|
|
4522
|
-
const t = ["left", "center", "right"],
|
|
4647
|
+
}, vl = (e) => {
|
|
4648
|
+
const t = ["left", "center", "right"], i = {
|
|
4523
4649
|
left: "AlignLeft",
|
|
4524
4650
|
center: "AlignCenter",
|
|
4525
4651
|
right: "AlignRight"
|
|
4526
4652
|
};
|
|
4527
|
-
return t.map((
|
|
4528
|
-
type: `image-${
|
|
4653
|
+
return t.map((n, a) => ({
|
|
4654
|
+
type: `image-${n}`,
|
|
4529
4655
|
component: v,
|
|
4530
4656
|
componentProps: {
|
|
4531
|
-
tooltip: T.t(`editor.textalign.${
|
|
4532
|
-
icon: n
|
|
4533
|
-
action: () => e.commands.setTextAlign(
|
|
4534
|
-
isActive: () => e.isActive({ textAlign:
|
|
4535
|
-
disabled: !e.can().setTextAlign(
|
|
4657
|
+
tooltip: T.t(`editor.textalign.${n}.tooltip`),
|
|
4658
|
+
icon: i[n],
|
|
4659
|
+
action: () => e.commands.setTextAlign(n),
|
|
4660
|
+
isActive: () => e.isActive({ textAlign: n }) || !1,
|
|
4661
|
+
disabled: !e.can().setTextAlign(n)
|
|
4536
4662
|
}
|
|
4537
4663
|
}));
|
|
4538
|
-
},
|
|
4539
|
-
const t = ["size-small", "size-medium", "size-large"],
|
|
4664
|
+
}, wl = (e) => {
|
|
4665
|
+
const t = ["size-small", "size-medium", "size-large"], i = [
|
|
4540
4666
|
"SizeS",
|
|
4541
4667
|
"SizeM",
|
|
4542
4668
|
"SizeL"
|
|
4543
4669
|
];
|
|
4544
|
-
return t.map((
|
|
4545
|
-
type: `video-${
|
|
4670
|
+
return t.map((n, a) => ({
|
|
4671
|
+
type: `video-${n}`,
|
|
4546
4672
|
component: v,
|
|
4547
4673
|
componentProps: {
|
|
4548
|
-
tooltip: T.t(`editor.${
|
|
4549
|
-
icon:
|
|
4550
|
-
action: () => e.commands.updateVideo({ width: Te[
|
|
4551
|
-
isActive: () => e.isActive("video", { width: Te[
|
|
4674
|
+
tooltip: T.t(`editor.${n.replace("-", ".")}.tooltip`),
|
|
4675
|
+
icon: i[a],
|
|
4676
|
+
action: () => e.commands.updateVideo({ width: Te[n] }),
|
|
4677
|
+
isActive: () => e.isActive("video", { width: Te[n] })
|
|
4552
4678
|
}
|
|
4553
4679
|
}));
|
|
4554
|
-
},
|
|
4555
|
-
...gl(e),
|
|
4680
|
+
}, xl = (e) => [
|
|
4556
4681
|
...bl(e),
|
|
4682
|
+
...vl(e),
|
|
4557
4683
|
{
|
|
4558
4684
|
type: "remove",
|
|
4559
4685
|
component: v,
|
|
@@ -4562,13 +4688,13 @@ const cl = (e) => {
|
|
|
4562
4688
|
tooltip: T.t("editor.remove"),
|
|
4563
4689
|
icon: "Trash2",
|
|
4564
4690
|
action: () => {
|
|
4565
|
-
const { state: t, dispatch:
|
|
4566
|
-
Pt(t,
|
|
4691
|
+
const { state: t, dispatch: i } = e.view;
|
|
4692
|
+
Pt(t, i);
|
|
4567
4693
|
}
|
|
4568
4694
|
}
|
|
4569
4695
|
}
|
|
4570
|
-
],
|
|
4571
|
-
...
|
|
4696
|
+
], yl = (e) => [
|
|
4697
|
+
...wl(e),
|
|
4572
4698
|
{
|
|
4573
4699
|
type: "remove",
|
|
4574
4700
|
component: v,
|
|
@@ -4577,57 +4703,57 @@ const cl = (e) => {
|
|
|
4577
4703
|
tooltip: T.t("editor.remove"),
|
|
4578
4704
|
icon: "Trash2",
|
|
4579
4705
|
action: () => {
|
|
4580
|
-
const { state: t, dispatch:
|
|
4581
|
-
Pt(t,
|
|
4706
|
+
const { state: t, dispatch: i } = e.view;
|
|
4707
|
+
Pt(t, i);
|
|
4582
4708
|
}
|
|
4583
4709
|
}
|
|
4584
4710
|
}
|
|
4585
|
-
],
|
|
4711
|
+
], pl = (e, t) => [
|
|
4586
4712
|
Mo.configure().options.button({ editor: e, t }),
|
|
4587
4713
|
So.configure().options.button({ editor: e, t }),
|
|
4588
4714
|
Ro.configure().options.button({ editor: e, t }),
|
|
4589
4715
|
Ho.configure().options.button({ editor: e, t }),
|
|
4590
|
-
|
|
4591
|
-
|
|
4716
|
+
zo.configure().options.button({ editor: e, t }),
|
|
4717
|
+
la.configure().options.button({ editor: e, t }),
|
|
4592
4718
|
{
|
|
4593
4719
|
type: "divider",
|
|
4594
4720
|
component: void 0,
|
|
4595
4721
|
componentProps: {}
|
|
4596
4722
|
},
|
|
4597
|
-
|
|
4723
|
+
ta.configure().options.button({ editor: e, t }),
|
|
4598
4724
|
na.configure().options.button({ editor: e, t })
|
|
4599
4725
|
], Yt = {
|
|
4600
4726
|
maxWidth: "auto",
|
|
4601
4727
|
zIndex: 20,
|
|
4602
4728
|
appendTo: "parent",
|
|
4603
4729
|
moveTransition: "transform 0.1s ease-out"
|
|
4604
|
-
}, Qt = ({ item: e, disabled: t, editor:
|
|
4730
|
+
}, Qt = ({ item: e, disabled: t, editor: i }) => {
|
|
4605
4731
|
var a;
|
|
4606
|
-
const
|
|
4607
|
-
return
|
|
4608
|
-
|
|
4732
|
+
const n = e.component;
|
|
4733
|
+
return n ? /* @__PURE__ */ o(he, { children: e.type === "divider" ? /* @__PURE__ */ o(q, { orientation: "vertical", className: "mx-1 me-2 h-[16px]" }) : /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
|
|
4734
|
+
n,
|
|
4609
4735
|
{
|
|
4610
4736
|
...e.componentProps,
|
|
4611
|
-
editor:
|
|
4737
|
+
editor: i,
|
|
4612
4738
|
disabled: t || ((a = e == null ? void 0 : e.componentProps) == null ? void 0 : a.disabled)
|
|
4613
4739
|
}
|
|
4614
4740
|
) }) }) : /* @__PURE__ */ o(M, {});
|
|
4615
|
-
}, kl = (e) => e.type.name === "image", Cl = (e) => e.type.name === "video",
|
|
4616
|
-
const { lang: t } =
|
|
4617
|
-
const { selection: l } = a.view.state, { $from: r, to:
|
|
4618
|
-
let
|
|
4619
|
-
return a.view.state.doc.nodesBetween(r.pos,
|
|
4741
|
+
}, kl = (e) => e.type.name === "image", Cl = (e) => e.type.name === "video", Nl = (e) => {
|
|
4742
|
+
const { lang: t } = D(), i = ({ editor: a }) => {
|
|
4743
|
+
const { selection: l } = a.view.state, { $from: r, to: d } = l;
|
|
4744
|
+
let s = !1;
|
|
4745
|
+
return a.view.state.doc.nodesBetween(r.pos, d, (c) => {
|
|
4620
4746
|
if (kl(c))
|
|
4621
|
-
return
|
|
4622
|
-
}),
|
|
4623
|
-
},
|
|
4747
|
+
return s = !0, !1;
|
|
4748
|
+
}), s;
|
|
4749
|
+
}, n = z(() => e.disabled ? [] : xl(e.editor), [e.disabled, e.editor, t]);
|
|
4624
4750
|
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
|
|
4625
4751
|
me,
|
|
4626
4752
|
{
|
|
4627
|
-
shouldShow:
|
|
4753
|
+
shouldShow: i,
|
|
4628
4754
|
editor: e == null ? void 0 : e.editor,
|
|
4629
4755
|
tippyOptions: Yt,
|
|
4630
|
-
children:
|
|
4756
|
+
children: n != null && n.length ? /* @__PURE__ */ o("div", { className: "border border-neutral-200 dark:border-neutral-800 px-3 py-2 transition-all select-none pointer-events-auto shadow-sm rounded-sm w-auto bg-background", children: /* @__PURE__ */ o("div", { className: "flex items-center flex-nowrap whitespace-nowrap h-[26px] justify-start relative", children: n == null ? void 0 : n.map((a, l) => /* @__PURE__ */ o(
|
|
4631
4757
|
Qt,
|
|
4632
4758
|
{
|
|
4633
4759
|
item: a,
|
|
@@ -4638,22 +4764,22 @@ const cl = (e) => {
|
|
|
4638
4764
|
)) }) }) : /* @__PURE__ */ o(M, {})
|
|
4639
4765
|
}
|
|
4640
4766
|
) });
|
|
4641
|
-
},
|
|
4642
|
-
const { lang: t } =
|
|
4643
|
-
const { selection: l } = a.view.state, { $from: r, to:
|
|
4644
|
-
let
|
|
4645
|
-
return a.view.state.doc.nodesBetween(r.pos,
|
|
4767
|
+
}, Ll = (e) => {
|
|
4768
|
+
const { lang: t } = D(), i = ({ editor: a }) => {
|
|
4769
|
+
const { selection: l } = a.view.state, { $from: r, to: d } = l;
|
|
4770
|
+
let s = !1;
|
|
4771
|
+
return a.view.state.doc.nodesBetween(r.pos, d, (c) => {
|
|
4646
4772
|
if (Cl(c))
|
|
4647
|
-
return
|
|
4648
|
-
}),
|
|
4649
|
-
},
|
|
4773
|
+
return s = !0, !1;
|
|
4774
|
+
}), s;
|
|
4775
|
+
}, n = z(() => e.disabled ? [] : yl(e.editor), [e.editor, e.disabled, t]);
|
|
4650
4776
|
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
|
|
4651
4777
|
me,
|
|
4652
4778
|
{
|
|
4653
|
-
shouldShow:
|
|
4779
|
+
shouldShow: i,
|
|
4654
4780
|
editor: e == null ? void 0 : e.editor,
|
|
4655
4781
|
tippyOptions: Yt,
|
|
4656
|
-
children:
|
|
4782
|
+
children: n != null && n.length ? /* @__PURE__ */ o("div", { className: "border border-neutral-200 dark:border-neutral-800 px-3 py-2 transition-all select-none pointer-events-auto shadow-sm rounded-sm w-auto bg-background", children: /* @__PURE__ */ o("div", { className: "flex items-center flex-nowrap whitespace-nowrap h-[26px] justify-start relative", children: n == null ? void 0 : n.map((a, l) => /* @__PURE__ */ o(
|
|
4657
4783
|
Qt,
|
|
4658
4784
|
{
|
|
4659
4785
|
item: a,
|
|
@@ -4664,28 +4790,28 @@ const cl = (e) => {
|
|
|
4664
4790
|
)) }) }) : /* @__PURE__ */ o(M, {})
|
|
4665
4791
|
}
|
|
4666
4792
|
) });
|
|
4667
|
-
},
|
|
4793
|
+
}, Al = {
|
|
4668
4794
|
maxWidth: "auto",
|
|
4669
4795
|
zIndex: 20,
|
|
4670
4796
|
appendTo: "parent",
|
|
4671
4797
|
moveTransition: "transform 0.1s ease-out"
|
|
4672
|
-
},
|
|
4798
|
+
}, Tl = ({ item: e, disabled: t, editor: i }) => {
|
|
4673
4799
|
var a;
|
|
4674
|
-
const
|
|
4675
|
-
return
|
|
4676
|
-
|
|
4800
|
+
const n = e.component;
|
|
4801
|
+
return n ? /* @__PURE__ */ o(he, { children: /* @__PURE__ */ o(
|
|
4802
|
+
n,
|
|
4677
4803
|
{
|
|
4678
4804
|
...e.componentProps,
|
|
4679
|
-
editor:
|
|
4805
|
+
editor: i,
|
|
4680
4806
|
disabled: t || ((a = e == null ? void 0 : e.componentProps) == null ? void 0 : a.disabled)
|
|
4681
4807
|
}
|
|
4682
4808
|
) }) : /* @__PURE__ */ o(M, {});
|
|
4683
|
-
},
|
|
4684
|
-
const { t, lang:
|
|
4685
|
-
const { selection: r } = l.view.state, { $from:
|
|
4686
|
-
return
|
|
4687
|
-
}, a =
|
|
4688
|
-
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(me, { shouldShow:
|
|
4809
|
+
}, Ml = (e) => {
|
|
4810
|
+
const { t, lang: i } = D(), n = ({ editor: l }) => {
|
|
4811
|
+
const { selection: r } = l.view.state, { $from: d, to: s } = r;
|
|
4812
|
+
return d.pos === s ? !1 : r instanceof Re;
|
|
4813
|
+
}, a = z(() => e.disabled || !(e != null && e.editor) ? [] : pl(e.editor, t), [e.disabled, e.editor, i, t]);
|
|
4814
|
+
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(me, { shouldShow: n, editor: e == null ? void 0 : e.editor, tippyOptions: Al, children: a != null && a.length ? /* @__PURE__ */ o("div", { className: "border border-neutral-200 dark:border-neutral-800 px-3 py-2 transition-all select-none pointer-events-auto shadow-sm rounded-sm w-auto bg-background", children: /* @__PURE__ */ o("div", { className: "flex items-center gap-[4px] flex-nowrap whitespace-nowrap h-[26px] justify-start relative", children: a == null ? void 0 : a.map((l, r) => (l == null ? void 0 : l.type) === "divider" ? /* @__PURE__ */ o(
|
|
4689
4815
|
q,
|
|
4690
4816
|
{
|
|
4691
4817
|
orientation: "vertical",
|
|
@@ -4693,7 +4819,7 @@ const cl = (e) => {
|
|
|
4693
4819
|
},
|
|
4694
4820
|
`bubbleMenu-divider-${r}`
|
|
4695
4821
|
) : /* @__PURE__ */ o(
|
|
4696
|
-
|
|
4822
|
+
Tl,
|
|
4697
4823
|
{
|
|
4698
4824
|
item: l,
|
|
4699
4825
|
disabled: e.disabled,
|
|
@@ -4701,11 +4827,11 @@ const cl = (e) => {
|
|
|
4701
4827
|
},
|
|
4702
4828
|
`bubbleMenu-text-${r}`
|
|
4703
4829
|
)) }) }) : /* @__PURE__ */ o(M, {}) }) });
|
|
4704
|
-
},
|
|
4705
|
-
var
|
|
4706
|
-
const { t } =
|
|
4830
|
+
}, Sl = (e) => {
|
|
4831
|
+
var k, O, j;
|
|
4832
|
+
const { t } = D(), [i, n] = N(null), [a, l] = N(-1), r = ce(null), d = ce(null), [s, c] = N(!1);
|
|
4707
4833
|
U(() => {
|
|
4708
|
-
r.current && !e.editor.isDestroyed && (
|
|
4834
|
+
r.current && !e.editor.isDestroyed && (d.current = mo({
|
|
4709
4835
|
editor: e.editor,
|
|
4710
4836
|
element: r.current,
|
|
4711
4837
|
pluginKey: "ContentItemMenu",
|
|
@@ -4715,11 +4841,11 @@ const cl = (e) => {
|
|
|
4715
4841
|
moveTransition: "transform 0.15s ease-out"
|
|
4716
4842
|
},
|
|
4717
4843
|
onNodeChange: F
|
|
4718
|
-
}), e.editor.registerPlugin(
|
|
4844
|
+
}), e.editor.registerPlugin(d.current));
|
|
4719
4845
|
}, [e.editor, r]);
|
|
4720
4846
|
function h() {
|
|
4721
4847
|
const g = e.editor.chain();
|
|
4722
|
-
g.setNodeSelection(a).unsetAllMarks(), (
|
|
4848
|
+
g.setNodeSelection(a).unsetAllMarks(), (i == null ? void 0 : i.type.name) !== "paragraph" && g.setParagraph(), g.run();
|
|
4723
4849
|
}
|
|
4724
4850
|
function m() {
|
|
4725
4851
|
e.editor.chain().focus().setNodeSelection(a).run(), document.execCommand("copy");
|
|
@@ -4727,7 +4853,7 @@ const cl = (e) => {
|
|
|
4727
4853
|
function f() {
|
|
4728
4854
|
e.editor.commands.setNodeSelection(a);
|
|
4729
4855
|
const { $anchor: g } = e.editor.state.selection, I = g.node(1) || e.editor.state.selection.node;
|
|
4730
|
-
e.editor.chain().setMeta("hideDragHandle", !0).insertContentAt(a + ((
|
|
4856
|
+
e.editor.chain().setMeta("hideDragHandle", !0).insertContentAt(a + ((i == null ? void 0 : i.nodeSize) || 0), I.toJSON()).run();
|
|
4731
4857
|
}
|
|
4732
4858
|
function b(g) {
|
|
4733
4859
|
e.editor.commands.setTextAlign(g);
|
|
@@ -4744,26 +4870,26 @@ const cl = (e) => {
|
|
|
4744
4870
|
e.editor.chain().setMeta("hideDragHandle", !0).setNodeSelection(a).deleteSelection().run();
|
|
4745
4871
|
}
|
|
4746
4872
|
function F(g) {
|
|
4747
|
-
g.node &&
|
|
4873
|
+
g.node && n(g.node), l(g.pos);
|
|
4748
4874
|
}
|
|
4749
4875
|
function x() {
|
|
4750
4876
|
var g;
|
|
4751
4877
|
if (a !== -1) {
|
|
4752
|
-
const I = (
|
|
4878
|
+
const I = (i == null ? void 0 : i.nodeSize) || 0, R = a + I, _ = (i == null ? void 0 : i.type.name) === "paragraph" && ((g = i == null ? void 0 : i.content) == null ? void 0 : g.size) === 0, W = _ ? a + 2 : R + 2;
|
|
4753
4879
|
e.editor.chain().command(({ dispatch: L, tr: P, state: $ }) => L ? (_ ? P.insertText("/", a, a + 1) : P.insert(
|
|
4754
4880
|
R,
|
|
4755
4881
|
$.schema.nodes.paragraph.create(null, [$.schema.text("/")])
|
|
4756
4882
|
), L(P)) : !0).focus(W).run();
|
|
4757
4883
|
}
|
|
4758
4884
|
}
|
|
4759
|
-
U(() => (
|
|
4885
|
+
U(() => (s ? e.editor.commands.setMeta("lockDragHandle", !0) : e.editor.commands.setMeta("lockDragHandle", !1), () => {
|
|
4760
4886
|
e.editor.commands.setMeta("lockDragHandle", !1);
|
|
4761
|
-
}), [
|
|
4762
|
-
|
|
4887
|
+
}), [s]), U(() => () => {
|
|
4888
|
+
d.current && (e.editor.unregisterPlugin(ho), d.current = null);
|
|
4763
4889
|
}, []), U(() => {
|
|
4764
4890
|
var g;
|
|
4765
|
-
(g = e.editor) != null && g.isDestroyed &&
|
|
4766
|
-
}, [(
|
|
4891
|
+
(g = e.editor) != null && g.isDestroyed && d.current && (e.editor.unregisterPlugin(e.pluginKey), d.current = null);
|
|
4892
|
+
}, [(k = e.editor) == null ? void 0 : k.isDestroyed]);
|
|
4767
4893
|
const y = (g) => {
|
|
4768
4894
|
e != null && e.disabled || c(g);
|
|
4769
4895
|
};
|
|
@@ -4784,13 +4910,13 @@ const cl = (e) => {
|
|
|
4784
4910
|
className: "w-7 h-7 cursor-grab",
|
|
4785
4911
|
disabled: e == null ? void 0 : e.disabled,
|
|
4786
4912
|
onClick: x,
|
|
4787
|
-
children: /* @__PURE__ */ o(
|
|
4913
|
+
children: /* @__PURE__ */ o(C, { name: "Plus", className: "text-lg text-neutral-600 dark:text-neutral-200" })
|
|
4788
4914
|
}
|
|
4789
4915
|
),
|
|
4790
|
-
/* @__PURE__ */ u(
|
|
4916
|
+
/* @__PURE__ */ u(ie, { open: s, onOpenChange: y, children: [
|
|
4791
4917
|
/* @__PURE__ */ u("div", { className: "flex flex-col relative", children: [
|
|
4792
4918
|
/* @__PURE__ */ u(ye, { children: [
|
|
4793
|
-
/* @__PURE__ */ o(
|
|
4919
|
+
/* @__PURE__ */ o(pe, { asChild: !0, disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(
|
|
4794
4920
|
E,
|
|
4795
4921
|
{
|
|
4796
4922
|
variant: "ghost",
|
|
@@ -4800,12 +4926,12 @@ const cl = (e) => {
|
|
|
4800
4926
|
onMouseUp: () => {
|
|
4801
4927
|
e != null && e.disabled || c(!0);
|
|
4802
4928
|
},
|
|
4803
|
-
children: /* @__PURE__ */ o(
|
|
4929
|
+
children: /* @__PURE__ */ o(C, { name: "Grip", className: "text-sm dark:text-neutral-200 text-neutral-600" })
|
|
4804
4930
|
}
|
|
4805
4931
|
) }),
|
|
4806
4932
|
/* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o("p", { children: t("editor.draghandle.tooltip") }) })
|
|
4807
4933
|
] }),
|
|
4808
|
-
/* @__PURE__ */ o(
|
|
4934
|
+
/* @__PURE__ */ o(ne, { className: "absolute top-0 left-0 w-[28px] h-[28px] z-0" })
|
|
4809
4935
|
] }),
|
|
4810
4936
|
/* @__PURE__ */ u(X, { className: "w-48", align: "start", side: "bottom", sideOffset: 0, children: [
|
|
4811
4937
|
/* @__PURE__ */ u(
|
|
@@ -4814,47 +4940,47 @@ const cl = (e) => {
|
|
|
4814
4940
|
onClick: B,
|
|
4815
4941
|
className: "flex gap-3 focus:text-red-500 focus:bg-red-400 hover:bg-red-400 dark:hover:text-red-500 bg-opacity-10 hover:bg-opacity-20 focus:bg-opacity-30 dark:hover:bg-opacity-20",
|
|
4816
4942
|
children: [
|
|
4817
|
-
/* @__PURE__ */ o(
|
|
4943
|
+
/* @__PURE__ */ o(C, { name: "Trash2" }),
|
|
4818
4944
|
/* @__PURE__ */ o("span", { children: t("editor.remove") })
|
|
4819
4945
|
]
|
|
4820
4946
|
}
|
|
4821
4947
|
),
|
|
4822
4948
|
/* @__PURE__ */ u(K, { className: "flex gap-3", onClick: h, children: [
|
|
4823
|
-
/* @__PURE__ */ o(
|
|
4949
|
+
/* @__PURE__ */ o(C, { name: "PaintRoller" }),
|
|
4824
4950
|
/* @__PURE__ */ o("span", { children: t("editor.clear.tooltip") })
|
|
4825
4951
|
] }),
|
|
4826
4952
|
/* @__PURE__ */ u(K, { className: "flex gap-3", onClick: m, children: [
|
|
4827
|
-
/* @__PURE__ */ o(
|
|
4953
|
+
/* @__PURE__ */ o(C, { name: "Clipboard" }),
|
|
4828
4954
|
/* @__PURE__ */ o("span", { children: t("editor.copyToClipboard") })
|
|
4829
4955
|
] }),
|
|
4830
4956
|
/* @__PURE__ */ u(K, { className: "flex gap-3", onClick: f, children: [
|
|
4831
|
-
/* @__PURE__ */ o(
|
|
4957
|
+
/* @__PURE__ */ o(C, { name: "Copy" }),
|
|
4832
4958
|
/* @__PURE__ */ o("span", { children: t("editor.copy") })
|
|
4833
4959
|
] }),
|
|
4834
4960
|
/* @__PURE__ */ o(Ie, {}),
|
|
4835
4961
|
/* @__PURE__ */ u(Qe, { children: [
|
|
4836
4962
|
/* @__PURE__ */ u(Ee, { className: "flex gap-3", children: [
|
|
4837
|
-
/* @__PURE__ */ o(
|
|
4963
|
+
/* @__PURE__ */ o(C, { name: "AlignCenter" }),
|
|
4838
4964
|
/* @__PURE__ */ o("span", { children: t("editor.textalign.tooltip") })
|
|
4839
4965
|
] }),
|
|
4840
4966
|
/* @__PURE__ */ o(Ye, { children: /* @__PURE__ */ u(_e, { children: [
|
|
4841
4967
|
/* @__PURE__ */ u(K, { className: "flex gap-3", onClick: () => b("left"), children: [
|
|
4842
|
-
/* @__PURE__ */ o(
|
|
4968
|
+
/* @__PURE__ */ o(C, { name: "AlignLeft" }),
|
|
4843
4969
|
/* @__PURE__ */ o("span", { children: t("editor.textalign.left.tooltip") })
|
|
4844
4970
|
] }),
|
|
4845
4971
|
/* @__PURE__ */ u(K, { className: "flex gap-3", onClick: () => b("center"), children: [
|
|
4846
|
-
/* @__PURE__ */ o(
|
|
4972
|
+
/* @__PURE__ */ o(C, { name: "AlignCenter" }),
|
|
4847
4973
|
/* @__PURE__ */ o("span", { children: t("editor.textalign.center.tooltip") })
|
|
4848
4974
|
] }),
|
|
4849
4975
|
/* @__PURE__ */ u(K, { className: "flex gap-3", onClick: () => b("right"), children: [
|
|
4850
|
-
/* @__PURE__ */ o(
|
|
4976
|
+
/* @__PURE__ */ o(C, { name: "AlignRight" }),
|
|
4851
4977
|
/* @__PURE__ */ o("span", { children: t("editor.textalign.right.tooltip") })
|
|
4852
4978
|
] })
|
|
4853
4979
|
] }) })
|
|
4854
4980
|
] }),
|
|
4855
4981
|
/* @__PURE__ */ u(Qe, { children: [
|
|
4856
4982
|
/* @__PURE__ */ u(Ee, { className: "flex gap-3", children: [
|
|
4857
|
-
/* @__PURE__ */ o(
|
|
4983
|
+
/* @__PURE__ */ o(C, { name: "IndentIncrease" }),
|
|
4858
4984
|
/* @__PURE__ */ o("span", { children: t("editor.indent") })
|
|
4859
4985
|
] }),
|
|
4860
4986
|
/* @__PURE__ */ o(Ye, { children: /* @__PURE__ */ u(_e, { children: [
|
|
@@ -4863,9 +4989,9 @@ const cl = (e) => {
|
|
|
4863
4989
|
{
|
|
4864
4990
|
className: "flex gap-3",
|
|
4865
4991
|
onClick: w,
|
|
4866
|
-
disabled: ((O =
|
|
4992
|
+
disabled: ((O = i == null ? void 0 : i.attrs) == null ? void 0 : O.indent) >= Q.max,
|
|
4867
4993
|
children: [
|
|
4868
|
-
/* @__PURE__ */ o(
|
|
4994
|
+
/* @__PURE__ */ o(C, { name: "IndentIncrease" }),
|
|
4869
4995
|
/* @__PURE__ */ o("span", { children: t("editor.indent.tooltip") })
|
|
4870
4996
|
]
|
|
4871
4997
|
}
|
|
@@ -4875,9 +5001,9 @@ const cl = (e) => {
|
|
|
4875
5001
|
{
|
|
4876
5002
|
className: "flex gap-3",
|
|
4877
5003
|
onClick: A,
|
|
4878
|
-
disabled: ((j =
|
|
5004
|
+
disabled: ((j = i == null ? void 0 : i.attrs) == null ? void 0 : j.indent) <= Q.min,
|
|
4879
5005
|
children: [
|
|
4880
|
-
/* @__PURE__ */ o(
|
|
5006
|
+
/* @__PURE__ */ o(C, { name: "IndentDecrease" }),
|
|
4881
5007
|
/* @__PURE__ */ o("span", { children: t("editor.outdent.tooltip") })
|
|
4882
5008
|
]
|
|
4883
5009
|
}
|
|
@@ -4889,10 +5015,10 @@ const cl = (e) => {
|
|
|
4889
5015
|
] })
|
|
4890
5016
|
}
|
|
4891
5017
|
) });
|
|
4892
|
-
},
|
|
4893
|
-
var w, A, B, F, x, y,
|
|
4894
|
-
const t = ({ editor: g }) => Et(g.view.state, "table"), { t:
|
|
4895
|
-
function
|
|
5018
|
+
}, Rl = (e) => {
|
|
5019
|
+
var w, A, B, F, x, y, k, O, j;
|
|
5020
|
+
const t = ({ editor: g }) => Et(g.view.state, "table"), { t: i } = D();
|
|
5021
|
+
function n() {
|
|
4896
5022
|
e.editor.chain().focus().addColumnBefore().run();
|
|
4897
5023
|
}
|
|
4898
5024
|
function a() {
|
|
@@ -4904,10 +5030,10 @@ const cl = (e) => {
|
|
|
4904
5030
|
function r() {
|
|
4905
5031
|
e.editor.chain().focus().addRowBefore().run();
|
|
4906
5032
|
}
|
|
4907
|
-
function
|
|
5033
|
+
function d() {
|
|
4908
5034
|
e.editor.chain().focus().addRowAfter().run();
|
|
4909
5035
|
}
|
|
4910
|
-
function
|
|
5036
|
+
function s() {
|
|
4911
5037
|
e.editor.chain().focus().deleteRow().run();
|
|
4912
5038
|
}
|
|
4913
5039
|
function c() {
|
|
@@ -4957,8 +5083,8 @@ const cl = (e) => {
|
|
|
4957
5083
|
v,
|
|
4958
5084
|
{
|
|
4959
5085
|
icon: "BetweenHorizonalEnd",
|
|
4960
|
-
tooltip:
|
|
4961
|
-
action:
|
|
5086
|
+
tooltip: i("editor.table.menu.insertColumnBefore"),
|
|
5087
|
+
action: n,
|
|
4962
5088
|
"tooltip-options": {
|
|
4963
5089
|
sideOffset: 15
|
|
4964
5090
|
},
|
|
@@ -4969,7 +5095,7 @@ const cl = (e) => {
|
|
|
4969
5095
|
v,
|
|
4970
5096
|
{
|
|
4971
5097
|
icon: "BetweenHorizonalStart",
|
|
4972
|
-
tooltip:
|
|
5098
|
+
tooltip: i("editor.table.menu.insertColumnAfter"),
|
|
4973
5099
|
action: a,
|
|
4974
5100
|
"tooltip-options": {
|
|
4975
5101
|
sideOffset: 15
|
|
@@ -4982,7 +5108,7 @@ const cl = (e) => {
|
|
|
4982
5108
|
{
|
|
4983
5109
|
icon: "DeleteColumn",
|
|
4984
5110
|
action: l,
|
|
4985
|
-
tooltip:
|
|
5111
|
+
tooltip: i("editor.table.menu.deleteColumn"),
|
|
4986
5112
|
"tooltip-options": {
|
|
4987
5113
|
sideOffset: 15
|
|
4988
5114
|
},
|
|
@@ -4995,7 +5121,7 @@ const cl = (e) => {
|
|
|
4995
5121
|
{
|
|
4996
5122
|
icon: "BetweenVerticalEnd",
|
|
4997
5123
|
action: r,
|
|
4998
|
-
tooltip:
|
|
5124
|
+
tooltip: i("editor.table.menu.insertRowAbove"),
|
|
4999
5125
|
"tooltip-options": {
|
|
5000
5126
|
sideOffset: 15
|
|
5001
5127
|
},
|
|
@@ -5006,8 +5132,8 @@ const cl = (e) => {
|
|
|
5006
5132
|
v,
|
|
5007
5133
|
{
|
|
5008
5134
|
icon: "BetweenVerticalStart",
|
|
5009
|
-
action:
|
|
5010
|
-
tooltip:
|
|
5135
|
+
action: d,
|
|
5136
|
+
tooltip: i("editor.table.menu.insertRowBelow"),
|
|
5011
5137
|
"tooltip-options": {
|
|
5012
5138
|
sideOffset: 15
|
|
5013
5139
|
},
|
|
@@ -5018,8 +5144,8 @@ const cl = (e) => {
|
|
|
5018
5144
|
v,
|
|
5019
5145
|
{
|
|
5020
5146
|
icon: "DeleteRow",
|
|
5021
|
-
action:
|
|
5022
|
-
tooltip:
|
|
5147
|
+
action: s,
|
|
5148
|
+
tooltip: i("editor.table.menu.deleteRow"),
|
|
5023
5149
|
"tooltip-options": {
|
|
5024
5150
|
sideOffset: 15
|
|
5025
5151
|
},
|
|
@@ -5032,11 +5158,11 @@ const cl = (e) => {
|
|
|
5032
5158
|
{
|
|
5033
5159
|
icon: "TableCellsMerge",
|
|
5034
5160
|
action: c,
|
|
5035
|
-
tooltip:
|
|
5161
|
+
tooltip: i("editor.table.menu.mergeCells"),
|
|
5036
5162
|
"tooltip-options": {
|
|
5037
5163
|
sideOffset: 15
|
|
5038
5164
|
},
|
|
5039
|
-
disabled: !((
|
|
5165
|
+
disabled: !((k = e == null ? void 0 : e.editor) != null && k.can().mergeCells())
|
|
5040
5166
|
}
|
|
5041
5167
|
),
|
|
5042
5168
|
/* @__PURE__ */ o(
|
|
@@ -5044,7 +5170,7 @@ const cl = (e) => {
|
|
|
5044
5170
|
{
|
|
5045
5171
|
icon: "TableCellsSplit",
|
|
5046
5172
|
action: h,
|
|
5047
|
-
tooltip:
|
|
5173
|
+
tooltip: i("editor.table.menu.splitCells"),
|
|
5048
5174
|
"tooltip-options": {
|
|
5049
5175
|
sideOffset: 15
|
|
5050
5176
|
},
|
|
@@ -5056,7 +5182,7 @@ const cl = (e) => {
|
|
|
5056
5182
|
Wt,
|
|
5057
5183
|
{
|
|
5058
5184
|
editor: e == null ? void 0 : e.editor,
|
|
5059
|
-
tooltip:
|
|
5185
|
+
tooltip: i("editor.table.menu.setCellsBgColor"),
|
|
5060
5186
|
action: f,
|
|
5061
5187
|
tooltipOptions: {
|
|
5062
5188
|
sideOffset: 15
|
|
@@ -5067,7 +5193,7 @@ const cl = (e) => {
|
|
|
5067
5193
|
v,
|
|
5068
5194
|
{
|
|
5069
5195
|
icon: "Trash2",
|
|
5070
|
-
tooltip:
|
|
5196
|
+
tooltip: i("editor.table.menu.deleteTable"),
|
|
5071
5197
|
action: m,
|
|
5072
5198
|
"tooltip-options": {
|
|
5073
5199
|
sideOffset: 15
|
|
@@ -5078,21 +5204,21 @@ const cl = (e) => {
|
|
|
5078
5204
|
] })
|
|
5079
5205
|
}
|
|
5080
5206
|
);
|
|
5081
|
-
},
|
|
5082
|
-
const { t:
|
|
5083
|
-
const r = [...e.extensionManager.extensions].sort((
|
|
5084
|
-
const h =
|
|
5207
|
+
}, Hl = ({ editor: e, disabled: t }) => {
|
|
5208
|
+
const { t: i, lang: n } = D(), a = z(() => {
|
|
5209
|
+
const r = [...e.extensionManager.extensions].sort((s, c) => {
|
|
5210
|
+
const h = s.options.sort ?? -1, m = c.options.sort ?? -1;
|
|
5085
5211
|
return h - m;
|
|
5086
5212
|
});
|
|
5087
|
-
let
|
|
5088
|
-
for (const
|
|
5089
|
-
const { button: c, divider: h = !1, spacer: m = !1, toolbar: f = !0 } =
|
|
5090
|
-
if (!c || !
|
|
5213
|
+
let d = [];
|
|
5214
|
+
for (const s of r) {
|
|
5215
|
+
const { button: c, divider: h = !1, spacer: m = !1, toolbar: f = !0 } = s.options;
|
|
5216
|
+
if (!c || !Sa(c) || !f)
|
|
5091
5217
|
continue;
|
|
5092
5218
|
const b = c({
|
|
5093
5219
|
editor: e,
|
|
5094
|
-
extension:
|
|
5095
|
-
t:
|
|
5220
|
+
extension: s,
|
|
5221
|
+
t: i
|
|
5096
5222
|
});
|
|
5097
5223
|
if (Array.isArray(b)) {
|
|
5098
5224
|
const w = b.map((A, B) => ({
|
|
@@ -5100,13 +5226,13 @@ const cl = (e) => {
|
|
|
5100
5226
|
divider: B === b.length - 1 ? h : !1,
|
|
5101
5227
|
spacer: B === 0 ? m : !1
|
|
5102
5228
|
}));
|
|
5103
|
-
|
|
5229
|
+
d = [...d, ...w];
|
|
5104
5230
|
continue;
|
|
5105
5231
|
}
|
|
5106
|
-
|
|
5232
|
+
d.push({ button: b, divider: h, spacer: m });
|
|
5107
5233
|
}
|
|
5108
|
-
return
|
|
5109
|
-
}, [e,
|
|
5234
|
+
return d;
|
|
5235
|
+
}, [e, i, n]);
|
|
5110
5236
|
return /* @__PURE__ */ o(
|
|
5111
5237
|
"div",
|
|
5112
5238
|
{
|
|
@@ -5116,15 +5242,15 @@ const cl = (e) => {
|
|
|
5116
5242
|
opacity: t ? 0.5 : 1
|
|
5117
5243
|
},
|
|
5118
5244
|
children: /* @__PURE__ */ o("div", { className: "flex flex-wrap h-auto relative gap-y-1 gap-x-1", children: a.map((l, r) => {
|
|
5119
|
-
var
|
|
5120
|
-
const
|
|
5245
|
+
var s, c;
|
|
5246
|
+
const d = l.button.component;
|
|
5121
5247
|
return /* @__PURE__ */ u("div", { className: "flex items-center", children: [
|
|
5122
5248
|
(l == null ? void 0 : l.spacer) && /* @__PURE__ */ o(q, { orientation: "vertical", className: "h-[16px] mx-[10px]" }),
|
|
5123
5249
|
/* @__PURE__ */ o(
|
|
5124
|
-
|
|
5250
|
+
d,
|
|
5125
5251
|
{
|
|
5126
5252
|
...l.button.componentProps,
|
|
5127
|
-
disabled: t || ((c = (
|
|
5253
|
+
disabled: t || ((c = (s = l == null ? void 0 : l.button) == null ? void 0 : s.componentProps) == null ? void 0 : c.disabled)
|
|
5128
5254
|
}
|
|
5129
5255
|
),
|
|
5130
5256
|
(l == null ? void 0 : l.divider) && /* @__PURE__ */ o(q, { orientation: "vertical", className: "h-auto mx-2" })
|
|
@@ -5132,27 +5258,27 @@ const cl = (e) => {
|
|
|
5132
5258
|
}) })
|
|
5133
5259
|
}
|
|
5134
5260
|
);
|
|
5135
|
-
},
|
|
5261
|
+
}, zl = (e, t) => {
|
|
5136
5262
|
const {
|
|
5137
|
-
view:
|
|
5263
|
+
view: i,
|
|
5138
5264
|
state: {
|
|
5139
|
-
selection: { from:
|
|
5265
|
+
selection: { from: n }
|
|
5140
5266
|
}
|
|
5141
|
-
} = e, a = document.querySelectorAll(".has-focus"), l = a.length,
|
|
5142
|
-
if (
|
|
5143
|
-
return
|
|
5144
|
-
const
|
|
5145
|
-
let c =
|
|
5146
|
-
for (c.tagName || (c =
|
|
5267
|
+
} = e, a = document.querySelectorAll(".has-focus"), l = a.length, d = a[l - 1];
|
|
5268
|
+
if (d && d.dataset.type && d.dataset.type === t || d && d.classList && d.classList.contains(t))
|
|
5269
|
+
return d;
|
|
5270
|
+
const s = i.domAtPos(n).node;
|
|
5271
|
+
let c = s;
|
|
5272
|
+
for (c.tagName || (c = s.parentElement); c && !(c.dataset.type && c.dataset.type === t) && !c.classList.contains(t); )
|
|
5147
5273
|
c = c.parentElement;
|
|
5148
5274
|
return c;
|
|
5149
|
-
}, Dl = ({ editor: e }) => Et(e.view.state, "columns"),
|
|
5275
|
+
}, Dl = ({ editor: e }) => Et(e.view.state, "columns"), Bl = (e) => {
|
|
5150
5276
|
const t = () => {
|
|
5151
|
-
const l =
|
|
5277
|
+
const l = zl(e.editor, "columns");
|
|
5152
5278
|
return (l == null ? void 0 : l.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
5153
|
-
}, n = () => {
|
|
5154
|
-
e.editor.chain().focus().setLayout(Y.SidebarLeft).run();
|
|
5155
5279
|
}, i = () => {
|
|
5280
|
+
e.editor.chain().focus().setLayout(Y.SidebarLeft).run();
|
|
5281
|
+
}, n = () => {
|
|
5156
5282
|
e.editor.chain().focus().setLayout(Y.SidebarRight).run();
|
|
5157
5283
|
}, a = () => {
|
|
5158
5284
|
e.editor.chain().focus().setLayout(Y.TwoColumn).run();
|
|
@@ -5180,7 +5306,7 @@ const cl = (e) => {
|
|
|
5180
5306
|
title: "ok",
|
|
5181
5307
|
icon: "PanelLeft",
|
|
5182
5308
|
tooltip: "Left Sidebar",
|
|
5183
|
-
action:
|
|
5309
|
+
action: i,
|
|
5184
5310
|
isActive: () => e == null ? void 0 : e.editor.isActive("columns", { layout: Y.SidebarLeft }),
|
|
5185
5311
|
tooltipOptions: { sideOffset: 15 }
|
|
5186
5312
|
}
|
|
@@ -5202,7 +5328,7 @@ const cl = (e) => {
|
|
|
5202
5328
|
title: "ok",
|
|
5203
5329
|
icon: "PanelRight",
|
|
5204
5330
|
tooltip: "Right Sidebar",
|
|
5205
|
-
action:
|
|
5331
|
+
action: n,
|
|
5206
5332
|
isActive: () => e == null ? void 0 : e.editor.isActive("columns", { layout: Y.SidebarRight }),
|
|
5207
5333
|
tooltipOptions: { sideOffset: 15 }
|
|
5208
5334
|
}
|
|
@@ -5210,106 +5336,106 @@ const cl = (e) => {
|
|
|
5210
5336
|
] }) })
|
|
5211
5337
|
}
|
|
5212
5338
|
);
|
|
5213
|
-
},
|
|
5339
|
+
}, Il = kt({
|
|
5214
5340
|
theme: "light"
|
|
5215
|
-
}),
|
|
5341
|
+
}), Fl = {
|
|
5216
5342
|
setTheme: (e) => {
|
|
5217
|
-
|
|
5343
|
+
Il.theme = e;
|
|
5218
5344
|
}
|
|
5219
5345
|
};
|
|
5220
|
-
function
|
|
5221
|
-
const { content:
|
|
5222
|
-
const m = fo(
|
|
5223
|
-
return [...
|
|
5224
|
-
const w =
|
|
5346
|
+
function Pl(e, t) {
|
|
5347
|
+
const { content: i, extensions: n, useEditorOptions: a = {} } = e, { t: l } = D(), r = z(() => {
|
|
5348
|
+
const m = fo(n, n, "name");
|
|
5349
|
+
return [...n.map((b) => {
|
|
5350
|
+
const w = n.find((A) => A.name === b.name);
|
|
5225
5351
|
return w ? b.configure(w.options) : b;
|
|
5226
5352
|
}), ...m].map((b, w) => b.configure({ sort: w }));
|
|
5227
|
-
}, [
|
|
5353
|
+
}, [n]), d = go({
|
|
5228
5354
|
extensions: r,
|
|
5229
|
-
content:
|
|
5355
|
+
content: i,
|
|
5230
5356
|
onUpdate: ({ editor: m }) => {
|
|
5231
5357
|
c(m);
|
|
5232
5358
|
},
|
|
5233
5359
|
...a
|
|
5234
5360
|
});
|
|
5235
5361
|
U(() => {
|
|
5236
|
-
document.body.classList.toggle("dark", e.dark),
|
|
5362
|
+
document.body.classList.toggle("dark", e.dark), Fl.setTheme(e.dark ? "dark" : "light");
|
|
5237
5363
|
}, [e.dark]), U(() => {
|
|
5238
|
-
|
|
5239
|
-
}, [
|
|
5240
|
-
function
|
|
5364
|
+
d == null || d.setEditable(!(e != null && e.disabled));
|
|
5365
|
+
}, [d, e == null ? void 0 : e.disabled]);
|
|
5366
|
+
function s(m, f) {
|
|
5241
5367
|
return e != null && e.removeDefaultWrapper ? f === "html" ? m.isEmpty ? "" : m.getHTML() : f === "json" ? m.isEmpty ? {} : m.getJSON() : f === "text" ? m.isEmpty ? "" : m.getText() : "" : f === "html" ? m.getHTML() : f === "json" ? m.getJSON() : f === "text" ? m.getText() : "";
|
|
5242
5368
|
}
|
|
5243
5369
|
const c = Oe((m) => {
|
|
5244
5370
|
var b;
|
|
5245
|
-
const f =
|
|
5371
|
+
const f = s(m, e.output);
|
|
5246
5372
|
(b = e == null ? void 0 : e.onChangeContent) == null || b.call(e, f);
|
|
5247
5373
|
}, Oo);
|
|
5248
5374
|
$t(t, () => ({
|
|
5249
|
-
editor:
|
|
5375
|
+
editor: d
|
|
5250
5376
|
})), U(() => () => {
|
|
5251
5377
|
var m;
|
|
5252
|
-
(m =
|
|
5378
|
+
(m = d == null ? void 0 : d.destroy) == null || m.call(d);
|
|
5253
5379
|
}, []);
|
|
5254
|
-
const h =
|
|
5255
|
-
return
|
|
5380
|
+
const h = Ra(d, "characterCount");
|
|
5381
|
+
return d ? /* @__PURE__ */ o(To, { delayDuration: 0, children: /* @__PURE__ */ u("div", { className: "reactjs-tiptap-editor rounded-[0.5rem] bg-background shadow overflow-hidden outline outline-1", children: [
|
|
5256
5382
|
!(e != null && e.hideBubble) && /* @__PURE__ */ u(M, { children: [
|
|
5257
|
-
/* @__PURE__ */ o(
|
|
5258
|
-
/* @__PURE__ */ o(
|
|
5259
|
-
/* @__PURE__ */ o(
|
|
5260
|
-
/* @__PURE__ */ o(
|
|
5261
|
-
/* @__PURE__ */ o(
|
|
5262
|
-
/* @__PURE__ */ o(
|
|
5263
|
-
/* @__PURE__ */ o(
|
|
5383
|
+
/* @__PURE__ */ o(Bl, { editor: d }),
|
|
5384
|
+
/* @__PURE__ */ o(Rl, { editor: d }),
|
|
5385
|
+
/* @__PURE__ */ o(Sl, { editor: d, disabled: e == null ? void 0 : e.disabled }),
|
|
5386
|
+
/* @__PURE__ */ o(gl, { editor: d, disabled: e == null ? void 0 : e.disabled }),
|
|
5387
|
+
/* @__PURE__ */ o(Ml, { editor: d, disabled: e == null ? void 0 : e.disabled }),
|
|
5388
|
+
/* @__PURE__ */ o(Nl, { editor: d, disabled: e == null ? void 0 : e.disabled }),
|
|
5389
|
+
/* @__PURE__ */ o(Ll, { editor: d, disabled: e == null ? void 0 : e.disabled })
|
|
5264
5390
|
] }),
|
|
5265
5391
|
/* @__PURE__ */ u("div", { className: "flex flex-col w-full max-h-full", children: [
|
|
5266
|
-
!(e != null && e.hideToolbar) && /* @__PURE__ */ o(
|
|
5267
|
-
/* @__PURE__ */ o(bo, { className: `relative ${(e == null ? void 0 : e.contentClass) || ""}`, editor:
|
|
5392
|
+
!(e != null && e.hideToolbar) && /* @__PURE__ */ o(Hl, { editor: d, disabled: e == null ? void 0 : e.disabled }),
|
|
5393
|
+
/* @__PURE__ */ o(bo, { className: `relative ${(e == null ? void 0 : e.contentClass) || ""}`, editor: d }),
|
|
5268
5394
|
/* @__PURE__ */ o("div", { className: "flex justify-between border-t p-3 items-center", children: h && /* @__PURE__ */ o("div", { className: "flex flex-col", children: /* @__PURE__ */ o("div", { className: "flex justify-end gap-3 text-sm", children: /* @__PURE__ */ u("span", { children: [
|
|
5269
|
-
|
|
5395
|
+
d.storage.characterCount.characters(),
|
|
5270
5396
|
" ",
|
|
5271
5397
|
l("editor.characters")
|
|
5272
5398
|
] }) }) }) })
|
|
5273
5399
|
] })
|
|
5274
5400
|
] }) }) : /* @__PURE__ */ o(M, {});
|
|
5275
5401
|
}
|
|
5276
|
-
const
|
|
5402
|
+
const vr = _t(Pl);
|
|
5277
5403
|
export {
|
|
5278
|
-
|
|
5279
|
-
|
|
5404
|
+
or as BaseKit,
|
|
5405
|
+
er as Blockquote,
|
|
5280
5406
|
Mo as Bold,
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5407
|
+
Zl as BulletList,
|
|
5408
|
+
Jl as Clear,
|
|
5409
|
+
zo as Code,
|
|
5410
|
+
jl as CodeBlock,
|
|
5411
|
+
ta as Color,
|
|
5286
5412
|
nr as ColumnToolbar,
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5413
|
+
ua as Columns,
|
|
5414
|
+
ql as FontFamily,
|
|
5415
|
+
Xl as FontSize,
|
|
5416
|
+
gr as FormatPainter,
|
|
5417
|
+
Wl as Heading,
|
|
5292
5418
|
na as Highlight,
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5419
|
+
ir as History,
|
|
5420
|
+
tr as HorizontalRule,
|
|
5421
|
+
br as Iframe,
|
|
5422
|
+
cr as Image,
|
|
5423
|
+
ur as ImageUpload,
|
|
5424
|
+
rr as Indent,
|
|
5299
5425
|
So as Italic,
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5426
|
+
dr as LineHeight,
|
|
5427
|
+
la as Link,
|
|
5428
|
+
lr as MoreMark,
|
|
5429
|
+
Yl as OrderedList,
|
|
5304
5430
|
sr as SlashCommand,
|
|
5305
5431
|
Ho as Strike,
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5432
|
+
ar as SubAndSuperScript,
|
|
5433
|
+
fr as Table,
|
|
5434
|
+
Ql as TaskList,
|
|
5435
|
+
Gl as TextAlign,
|
|
5310
5436
|
Ro as Underline,
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5437
|
+
mr as Video,
|
|
5438
|
+
hr as VideoUpload,
|
|
5439
|
+
vr as default,
|
|
5440
|
+
Kl as locale
|
|
5315
5441
|
};
|