zs_library 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +530 -527
- package/dist/index.umd.js +17 -17
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -7,46 +7,46 @@ import { initReactI18next as Li } from "react-i18next";
|
|
|
7
7
|
import { jsx as h, jsxs as x, Fragment as rt } from "react/jsx-runtime";
|
|
8
8
|
import { cx as D, css as S } from "@emotion/css";
|
|
9
9
|
import * as ne from "react";
|
|
10
|
-
import { createContext as Qo, useMemo as pt, useContext as er, useState as J, useRef as mt, useEffect as $e, Fragment as
|
|
11
|
-
import
|
|
10
|
+
import { createContext as Qo, useMemo as pt, useContext as er, useState as J, useRef as mt, useCallback as Vi, useEffect as $e, Fragment as Fi, forwardRef as $i } from "react";
|
|
11
|
+
import Hi from "react-slick";
|
|
12
12
|
import { ReactSortable as Ln } from "react-sortablejs";
|
|
13
|
-
import { AnimatePresence as Vn, motion as B, useMotionValue as
|
|
14
|
-
import { useLocalStorageState as
|
|
13
|
+
import { AnimatePresence as Vn, motion as B, useMotionValue as qi, useTransform as kt, useSpring as Ht } from "framer-motion";
|
|
14
|
+
import { useLocalStorageState as Wi, useDebounceEffect as Ji } from "ahooks";
|
|
15
15
|
import { v4 as no } from "uuid";
|
|
16
16
|
import tr from "rc-tooltip";
|
|
17
|
-
import { RiPencilRuler2Line as
|
|
17
|
+
import { RiPencilRuler2Line as Ki, RiShareLine as Ui, RiInformationLine as ji, RiCloseCircleLine as Yi, RiArrowUpDownLine as Gi, RiArrowLeftRightLine as Xi, RiArrowRightLine as _i, RiArrowLeftLine as Zi, RiCloseLine as Qi, RiZoomOutLine as es, RiZoomInLine as ts, RiClockwise2Line as ns, RiAnticlockwise2Line as os, RiMoreLine as rs, RiArrowDropDownLine as nr, RiCheckLine as Tt, RiLink as is, RiDeleteBinLine as or, RiText as rr, RiH1 as ir, RiH2 as sr, RiH3 as lr, RiListCheck as ar, RiListUnordered as cr, RiListOrdered as dr, RiQuoteText as ur, RiCodeLine as hr, RiSparklingFill as Fn, RiImageLine as ss, RiArrowRightSLine as ls, RiRepeatLine as as, RiFileCopyLine as cs, RiAddLine as ds, RiDraggable as us } from "@remixicon/react";
|
|
18
18
|
import fr from "rc-dialog";
|
|
19
|
-
import
|
|
20
|
-
import { AdmonitionDirectiveDescriptor as
|
|
19
|
+
import hs from "react-json-view";
|
|
20
|
+
import { AdmonitionDirectiveDescriptor as fs, MDXEditor as ps, toolbarPlugin as ms, diffSourcePlugin as gs, listsPlugin as bs, quotePlugin as ys, headingsPlugin as ks, linkPlugin as xs, linkDialogPlugin as Cs, imagePlugin as Ss, tablePlugin as Ns, thematicBreakPlugin as Ts, frontmatterPlugin as ws, codeBlockPlugin as Ds, codeMirrorPlugin as Ms, markdownShortcutPlugin as Os, directivesPlugin as vs, DiffSourceToggleWrapper as Is, UndoRedo as As, Separator as Ke, BoldItalicUnderlineToggles as Es, CodeToggle as Rs, StrikeThroughSupSubToggles as Ps, ListsToggle as zs, CreateLink as Bs, InsertImage as Ls, InsertTable as Vs, InsertThematicBreak as Fs, InsertCodeBlock as $s, InsertFrontmatter as Hs } from "@mdxeditor/editor";
|
|
21
21
|
import pr from "react-markdown";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import { Prism as
|
|
26
|
-
import
|
|
27
|
-
import { clsx as
|
|
28
|
-
import { twMerge as
|
|
29
|
-
import { Placeholder as
|
|
30
|
-
import { useDebouncedCallback as
|
|
31
|
-
import { Markdown as
|
|
32
|
-
import { cx as le, cva as
|
|
33
|
-
import { createLowlight as
|
|
34
|
-
import { Extension as
|
|
22
|
+
import qs from "remark-gfm";
|
|
23
|
+
import Ws from "remark-emoji";
|
|
24
|
+
import Js from "rehype-raw";
|
|
25
|
+
import { Prism as Ks } from "react-syntax-highlighter";
|
|
26
|
+
import Us from "rc-image";
|
|
27
|
+
import { clsx as js } from "clsx";
|
|
28
|
+
import { twMerge as Ys } from "tailwind-merge";
|
|
29
|
+
import { Placeholder as Gs, TiptapLink as Xs, TiptapImage as _s, UploadImagesPlugin as Zs, UpdatedImage as Qs, TaskList as el, TaskItem as tl, HorizontalRule as nl, StarterKit as ol, CodeBlockLowlight as rl, Mathematics as il, CharacterCount as sl, AIHighlight as ll, TiptapUnderline as al, HighlightExtension as cl, TextStyle as dl, Color as ul, CustomKeymap as hl, useEditor as xe, EditorBubbleItem as Xt, getPrevText as fl, addAIHighlight as pl, removeAIHighlight as ml, EditorBubble as gl, createImageUpload as mr, Command as bl, createSuggestionItems as yl, renderItems as kl, EditorRoot as xl, EditorContent as Cl, handleImageDrop as Sl, handleImagePaste as Nl, handleCommandNavigation as Tl, EditorCommand as wl, EditorCommandEmpty as Dl, EditorCommandList as Ml, EditorCommandItem as Ol, ImageResizer as vl } from "novel";
|
|
30
|
+
import { useDebouncedCallback as Il } from "use-debounce";
|
|
31
|
+
import { Markdown as Al } from "tiptap-markdown";
|
|
32
|
+
import { cx as le, cva as El } from "class-variance-authority";
|
|
33
|
+
import { createLowlight as Rl, common as Pl } from "lowlight";
|
|
34
|
+
import { Extension as zl } from "@tiptap/core";
|
|
35
35
|
import * as wt from "@radix-ui/react-popover";
|
|
36
|
-
import { Popover as gr, PopoverTrigger as
|
|
37
|
-
import { Slot as
|
|
38
|
-
import { SigmaIcon as
|
|
36
|
+
import { Popover as gr, PopoverTrigger as Bl } from "@radix-ui/react-popover";
|
|
37
|
+
import { Slot as Ll } from "@radix-ui/react-slot";
|
|
38
|
+
import { SigmaIcon as Vl, X as Fl, Check as $l, TextQuote as Hl, TrashIcon as ql, RefreshCcwDot as Wl, CheckCheck as Jl, ArrowDownWideNarrow as Kl, WrapText as Ul, StepForward as jl, ArrowUp as Yl, BoldIcon as Gl, ItalicIcon as Xl, UnderlineIcon as _l, StrikethroughIcon as Zl, CodeIcon as Ql } from "lucide-react";
|
|
39
39
|
import * as br from "@radix-ui/react-separator";
|
|
40
|
-
import { useCompletion as
|
|
40
|
+
import { useCompletion as ea } from "@ai-sdk/react";
|
|
41
41
|
import { toast as Dt } from "sonner";
|
|
42
42
|
import * as Ze from "@radix-ui/react-scroll-area";
|
|
43
43
|
import { Command as ce } from "cmdk";
|
|
44
|
-
import * as
|
|
45
|
-
import
|
|
46
|
-
import
|
|
44
|
+
import * as we from "@radix-ui/react-dialog";
|
|
45
|
+
import ta from "highlight.js";
|
|
46
|
+
import na from "rc-dropdown";
|
|
47
47
|
import qt from "rc-menu";
|
|
48
|
-
import { generateHTML as
|
|
49
|
-
const
|
|
48
|
+
import { generateHTML as oa } from "@tiptap/html";
|
|
49
|
+
const ra = {
|
|
50
50
|
common: {
|
|
51
51
|
ok: "确定",
|
|
52
52
|
cancel: "取消",
|
|
@@ -71,7 +71,7 @@ const oa = {
|
|
|
71
71
|
link: "链接",
|
|
72
72
|
image: "图片"
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, ia = {
|
|
75
75
|
common: {
|
|
76
76
|
ok: "OK",
|
|
77
77
|
cancel: "Cancel",
|
|
@@ -96,15 +96,15 @@ const oa = {
|
|
|
96
96
|
link: "Link",
|
|
97
97
|
image: "Image"
|
|
98
98
|
}
|
|
99
|
-
},
|
|
99
|
+
}, sa = "common";
|
|
100
100
|
Bi.use(Li).init({
|
|
101
101
|
resources: {
|
|
102
|
-
"zh-CN":
|
|
103
|
-
"en-US":
|
|
102
|
+
"zh-CN": ra,
|
|
103
|
+
"en-US": ia
|
|
104
104
|
},
|
|
105
105
|
lng: "zh-CN",
|
|
106
106
|
fallbackLng: "zh-CN",
|
|
107
|
-
defaultNS:
|
|
107
|
+
defaultNS: sa,
|
|
108
108
|
interpolation: {
|
|
109
109
|
escapeValue: !1
|
|
110
110
|
}
|
|
@@ -137,17 +137,17 @@ const yr = {
|
|
|
137
137
|
}
|
|
138
138
|
}, xr = Qo(
|
|
139
139
|
{}
|
|
140
|
-
),
|
|
140
|
+
), la = (n) => {
|
|
141
141
|
const { children: e, theme: t, ...o } = n, r = pt(() => t === "light" ? yr : t === "dark" ? kr : t, [t]);
|
|
142
142
|
return /* @__PURE__ */ h(xr.Provider, { value: { theme: r, ...o }, children: e });
|
|
143
143
|
}, it = () => er(xr), Cr = {
|
|
144
144
|
maxRow: 2,
|
|
145
145
|
maxCol: 2
|
|
146
|
-
},
|
|
146
|
+
}, aa = {
|
|
147
147
|
...Cr
|
|
148
148
|
}, Sr = {
|
|
149
149
|
app: Cr,
|
|
150
|
-
group:
|
|
150
|
+
group: aa
|
|
151
151
|
};
|
|
152
152
|
class ye {
|
|
153
153
|
}
|
|
@@ -191,7 +191,7 @@ const Nr = Qo({
|
|
|
191
191
|
moveTargetId: null,
|
|
192
192
|
setMoveTargetId: () => {
|
|
193
193
|
}
|
|
194
|
-
}),
|
|
194
|
+
}), ca = (n) => {
|
|
195
195
|
const {
|
|
196
196
|
children: e,
|
|
197
197
|
list: t = [],
|
|
@@ -204,7 +204,7 @@ const Nr = Qo({
|
|
|
204
204
|
null
|
|
205
205
|
), [I, M] = J(!1), [v, w] = J(null), [N, X] = J(
|
|
206
206
|
null
|
|
207
|
-
), [K, Ce] = J(!1), [
|
|
207
|
+
), [K, Ce] = J(!1), [Oe, R] = Wi(r, {
|
|
208
208
|
defaultValue: [],
|
|
209
209
|
listenStorageChange: !0
|
|
210
210
|
}), U = () => {
|
|
@@ -232,38 +232,41 @@ const Nr = Qo({
|
|
|
232
232
|
Q && (H.preventDefault(), V(H, P));
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
if (
|
|
244
|
-
(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
235
|
+
}, Se = Vi(
|
|
236
|
+
(P, Q) => {
|
|
237
|
+
const Y = [...Q || []];
|
|
238
|
+
if (Y.length > 0)
|
|
239
|
+
g((H) => {
|
|
240
|
+
const L = [...H], F = (z) => {
|
|
241
|
+
var eo, to;
|
|
242
|
+
const W = Y.shift(), _ = z.find((ve) => ve.id === W), Ne = z.findIndex((ve) => ve.id === W);
|
|
243
|
+
if (Y.length && _) {
|
|
244
|
+
if (((eo = _.children) == null ? void 0 : eo.filter(
|
|
245
|
+
(ve) => !P.some((Ri) => Ri.id === ve.id)
|
|
246
|
+
).length) === 1 && P.length === 1) {
|
|
247
|
+
const ve = { ...P[0] };
|
|
248
|
+
return z.splice(Ne, 1, ve), o == null || o(z), z;
|
|
249
|
+
}
|
|
250
|
+
return _.children = F(_.children || []), z.splice(Ne, 1, _), o == null || o(z), z;
|
|
248
251
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
return _.
|
|
252
|
+
if (_) {
|
|
253
|
+
if (!((to = _.children) != null && to.length) && P.length) {
|
|
254
|
+
const ve = { ..._ };
|
|
255
|
+
return _.data = { name: "文件夹" }, _.type = "group", _.children = [ve, ...P], _.id = no(), z.splice(Ne, 1, _), o == null || o(z), z;
|
|
256
|
+
}
|
|
257
|
+
return _.children = ye.uniqueArray(P), z.splice(Ne, 1, _), o == null || o(z), z;
|
|
255
258
|
}
|
|
256
|
-
return
|
|
257
|
-
}
|
|
258
|
-
return ye.uniqueArray(
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
259
|
+
return ye.uniqueArray(P);
|
|
260
|
+
};
|
|
261
|
+
return ye.uniqueArray(F(L));
|
|
262
|
+
});
|
|
263
|
+
else {
|
|
264
|
+
const H = ye.uniqueArray(P);
|
|
265
|
+
o == null || o(H), g(H);
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
[o]
|
|
269
|
+
), an = (P, Q) => {
|
|
267
270
|
g((Y) => {
|
|
268
271
|
const H = [...Y], L = (F) => {
|
|
269
272
|
var z;
|
|
@@ -301,18 +304,18 @@ const Nr = Qo({
|
|
|
301
304
|
});
|
|
302
305
|
}, ze = (P, Q) => {
|
|
303
306
|
const Y = [...b], H = (L, F) => {
|
|
304
|
-
const z = F.shift(), W = L.find((
|
|
307
|
+
const z = F.shift(), W = L.find((Ne) => Ne.id === z), _ = L.findIndex((Ne) => Ne.id === z);
|
|
305
308
|
if (W) {
|
|
306
309
|
if (F.length)
|
|
307
310
|
W.children = H(W.children || [], F);
|
|
308
311
|
else {
|
|
309
|
-
const
|
|
312
|
+
const Ne = (P == null ? void 0 : P.type) ?? "app";
|
|
310
313
|
W.children = [
|
|
311
314
|
...W.children ?? [],
|
|
312
315
|
{
|
|
313
316
|
...P,
|
|
314
317
|
id: no(),
|
|
315
|
-
config: (P == null ? void 0 : P.config) ?? Sr[
|
|
318
|
+
config: (P == null ? void 0 : P.config) ?? Sr[Ne]
|
|
316
319
|
}
|
|
317
320
|
];
|
|
318
321
|
}
|
|
@@ -323,12 +326,12 @@ const Nr = Qo({
|
|
|
323
326
|
g(H(Y, Q));
|
|
324
327
|
};
|
|
325
328
|
return $e(() => {
|
|
326
|
-
(t == null ? void 0 : t.length) > 0 && b.length === 0 &&
|
|
327
|
-
}, [t]), $e(() => {
|
|
329
|
+
(t == null ? void 0 : t.length) > 0 && (b.length === 0 || JSON.stringify(b) !== JSON.stringify(t)) && Se(t);
|
|
330
|
+
}, [Se, b, t]), $e(() => {
|
|
328
331
|
f.current = d, d !== null && U();
|
|
329
332
|
}, [d]), $e(() => {
|
|
330
|
-
i &&
|
|
331
|
-
}, [
|
|
333
|
+
i && Oe != null && Oe.length && !K && (Se(Oe), Ce(!0));
|
|
334
|
+
}, [Oe, K, i]), Ji(
|
|
332
335
|
() => {
|
|
333
336
|
i && R(b);
|
|
334
337
|
},
|
|
@@ -341,7 +344,7 @@ const Nr = Qo({
|
|
|
341
344
|
{
|
|
342
345
|
value: {
|
|
343
346
|
list: b,
|
|
344
|
-
setList:
|
|
347
|
+
setList: Se,
|
|
345
348
|
contextMenu: m,
|
|
346
349
|
setContextMenu: p,
|
|
347
350
|
listStatus: d,
|
|
@@ -365,7 +368,7 @@ const Nr = Qo({
|
|
|
365
368
|
children: e
|
|
366
369
|
}
|
|
367
370
|
);
|
|
368
|
-
}, bt = () => er(Nr),
|
|
371
|
+
}, bt = () => er(Nr), da = {
|
|
369
372
|
menuShow: {
|
|
370
373
|
opacity: 1,
|
|
371
374
|
y: 0,
|
|
@@ -397,7 +400,7 @@ const Nr = Qo({
|
|
|
397
400
|
onClick: (l) => {
|
|
398
401
|
l.stopPropagation(), o == null || o();
|
|
399
402
|
},
|
|
400
|
-
variants:
|
|
403
|
+
variants: da,
|
|
401
404
|
children: /* @__PURE__ */ x(
|
|
402
405
|
B.div,
|
|
403
406
|
{
|
|
@@ -432,7 +435,7 @@ const Nr = Qo({
|
|
|
432
435
|
)
|
|
433
436
|
}
|
|
434
437
|
);
|
|
435
|
-
},
|
|
438
|
+
}, ua = (n) => {
|
|
436
439
|
const {
|
|
437
440
|
showInfoButton: e = !0,
|
|
438
441
|
showRemoveButton: t = !0,
|
|
@@ -493,7 +496,7 @@ const Nr = Qo({
|
|
|
493
496
|
{
|
|
494
497
|
label: "修改大小",
|
|
495
498
|
key: "size",
|
|
496
|
-
icon: /* @__PURE__ */ h(
|
|
499
|
+
icon: /* @__PURE__ */ h(Ki, { size: 14 }),
|
|
497
500
|
items: O().map((k) => ({
|
|
498
501
|
label: k,
|
|
499
502
|
key: k,
|
|
@@ -616,7 +619,7 @@ const Nr = Qo({
|
|
|
616
619
|
o && /* @__PURE__ */ h(
|
|
617
620
|
dn,
|
|
618
621
|
{
|
|
619
|
-
icon: /* @__PURE__ */ h(
|
|
622
|
+
icon: /* @__PURE__ */ h(Ui, { size: 20 }),
|
|
620
623
|
title: "分享",
|
|
621
624
|
onClick: () => {
|
|
622
625
|
if (s) {
|
|
@@ -629,7 +632,7 @@ const Nr = Qo({
|
|
|
629
632
|
e && /* @__PURE__ */ h(
|
|
630
633
|
dn,
|
|
631
634
|
{
|
|
632
|
-
icon: /* @__PURE__ */ h(
|
|
635
|
+
icon: /* @__PURE__ */ h(ji, { size: 20 }),
|
|
633
636
|
title: "信息",
|
|
634
637
|
onClick: () => {
|
|
635
638
|
if (i) {
|
|
@@ -647,7 +650,7 @@ const Nr = Qo({
|
|
|
647
650
|
t && /* @__PURE__ */ h(
|
|
648
651
|
dn,
|
|
649
652
|
{
|
|
650
|
-
icon: /* @__PURE__ */ h(
|
|
653
|
+
icon: /* @__PURE__ */ h(Yi, { size: 20 }),
|
|
651
654
|
title: "移除",
|
|
652
655
|
onClick: () => {
|
|
653
656
|
if (l) {
|
|
@@ -664,7 +667,7 @@ const Nr = Qo({
|
|
|
664
667
|
]
|
|
665
668
|
}
|
|
666
669
|
) });
|
|
667
|
-
},
|
|
670
|
+
}, ha = (n) => {
|
|
668
671
|
const { data: e, noLetters: t = !1 } = n, { contextMenuFuns: o } = bt(), { itemIconBuilder: r, theme: i, contextMenu: s } = it(), { light: l, dark: a } = ye.getTheme(i), { data: c = {} } = e, { name: d } = c;
|
|
669
672
|
return /* @__PURE__ */ x(rt, { children: [
|
|
670
673
|
/* @__PURE__ */ h(
|
|
@@ -749,7 +752,7 @@ const Nr = Qo({
|
|
|
749
752
|
border: none;
|
|
750
753
|
}
|
|
751
754
|
`,
|
|
752
|
-
overlay: /* @__PURE__ */ h(
|
|
755
|
+
overlay: /* @__PURE__ */ h(ua, { ...u }),
|
|
753
756
|
visible: (c == null ? void 0 : c.data.id) === e.id,
|
|
754
757
|
onVisibleChange: (f) => {
|
|
755
758
|
f || d(null);
|
|
@@ -764,12 +767,12 @@ const Nr = Qo({
|
|
|
764
767
|
"data-children-length": a,
|
|
765
768
|
onClick: () => r == null ? void 0 : r(e),
|
|
766
769
|
className: D(i && "drag-disabled", t),
|
|
767
|
-
children: s ?? /* @__PURE__ */ h(
|
|
770
|
+
children: s ?? /* @__PURE__ */ h(ha, { ...n })
|
|
768
771
|
}
|
|
769
772
|
)
|
|
770
773
|
}
|
|
771
774
|
);
|
|
772
|
-
},
|
|
775
|
+
}, fa = (n) => {
|
|
773
776
|
const {
|
|
774
777
|
data: e,
|
|
775
778
|
className: t,
|
|
@@ -789,7 +792,7 @@ const Nr = Qo({
|
|
|
789
792
|
} = bt(), { itemIconBuilder: b, theme: g, contextMenu: y } = it(), { light: C, dark: O } = ye.getTheme(g), { children: k, data: I, config: M } = e, { row: v = 1, col: w = 1 } = M ?? {}, N = {
|
|
790
793
|
visible: { opacity: 1, scale: 1 },
|
|
791
794
|
hidden: { opacity: 0, scale: 0.95 }
|
|
792
|
-
}, X = ((k == null ? void 0 : k.length) ?? 0) === 0, K = X ? [e] : [...k ?? []].slice(0, 9), Ce = pt(() => u === e.id.toString(), [e.id, u]),
|
|
795
|
+
}, X = ((k == null ? void 0 : k.length) ?? 0) === 0, K = X ? [e] : [...k ?? []].slice(0, 9), Ce = pt(() => u === e.id.toString(), [e.id, u]), Oe = pt(() => f === e.id, [e.id, f]), R = S`
|
|
793
796
|
overflow: hidden;
|
|
794
797
|
cursor: pointer;
|
|
795
798
|
background-color: ${C.itemIconBackgroundColor};
|
|
@@ -893,8 +896,8 @@ const Nr = Qo({
|
|
|
893
896
|
grid-row: span 2 / span 2;
|
|
894
897
|
`
|
|
895
898
|
),
|
|
896
|
-
onClick: (
|
|
897
|
-
de > 2 || (
|
|
899
|
+
onClick: (Se) => {
|
|
900
|
+
de > 2 || (Se.stopPropagation(), i == null || i(V));
|
|
898
901
|
},
|
|
899
902
|
children: b == null ? void 0 : b(V)
|
|
900
903
|
},
|
|
@@ -934,8 +937,8 @@ const Nr = Qo({
|
|
|
934
937
|
grid-row: span 2 / span 2;
|
|
935
938
|
`
|
|
936
939
|
),
|
|
937
|
-
onClick: (
|
|
938
|
-
de > 2 || (
|
|
940
|
+
onClick: (Se) => {
|
|
941
|
+
de > 2 || (Se.stopPropagation(), i == null || i(V));
|
|
939
942
|
},
|
|
940
943
|
children: b == null ? void 0 : b(V)
|
|
941
944
|
},
|
|
@@ -964,7 +967,7 @@ const Nr = Qo({
|
|
|
964
967
|
{
|
|
965
968
|
whileTap: { scale: 0.9 },
|
|
966
969
|
className: D(
|
|
967
|
-
|
|
970
|
+
Oe ? "!scale-110" : "",
|
|
968
971
|
S`
|
|
969
972
|
cursor: pointer;
|
|
970
973
|
position: relative;
|
|
@@ -1072,7 +1075,7 @@ const Nr = Qo({
|
|
|
1072
1075
|
transition: all 0.2s;
|
|
1073
1076
|
}
|
|
1074
1077
|
}
|
|
1075
|
-
`,
|
|
1078
|
+
`, pa = (n) => {
|
|
1076
1079
|
const { data: e, onClose: t, onItemClick: o } = n, {
|
|
1077
1080
|
list: r,
|
|
1078
1081
|
setList: i,
|
|
@@ -1215,7 +1218,7 @@ const Nr = Qo({
|
|
|
1215
1218
|
)
|
|
1216
1219
|
}
|
|
1217
1220
|
);
|
|
1218
|
-
},
|
|
1221
|
+
}, ma = (n) => {
|
|
1219
1222
|
var o;
|
|
1220
1223
|
const { data: e, onClose: t } = n;
|
|
1221
1224
|
return /* @__PURE__ */ h(
|
|
@@ -1235,11 +1238,11 @@ const Nr = Qo({
|
|
|
1235
1238
|
title: ((o = e == null ? void 0 : e.data) == null ? void 0 : o.name) ?? "信息",
|
|
1236
1239
|
children: e && /* @__PURE__ */ x("div", { children: [
|
|
1237
1240
|
/* @__PURE__ */ h("div", { className: "mb-2", children: "开发者信息" }),
|
|
1238
|
-
/* @__PURE__ */ h("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ h(
|
|
1241
|
+
/* @__PURE__ */ h("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ h(hs, { src: e, theme: "monokai" }) })
|
|
1239
1242
|
] })
|
|
1240
1243
|
}
|
|
1241
1244
|
);
|
|
1242
|
-
},
|
|
1245
|
+
}, ga = (n) => {
|
|
1243
1246
|
const {
|
|
1244
1247
|
pagination: e = { position: "bottom" },
|
|
1245
1248
|
className: t,
|
|
@@ -1310,7 +1313,7 @@ const Nr = Qo({
|
|
|
1310
1313
|
}[e.position ?? "bottom"], [e]);
|
|
1311
1314
|
return /* @__PURE__ */ x(rt, { children: [
|
|
1312
1315
|
/* @__PURE__ */ h(
|
|
1313
|
-
|
|
1316
|
+
Hi,
|
|
1314
1317
|
{
|
|
1315
1318
|
useCSS: !0,
|
|
1316
1319
|
useTransform: !0,
|
|
@@ -1443,7 +1446,7 @@ const Nr = Qo({
|
|
|
1443
1446
|
case "group":
|
|
1444
1447
|
case "app":
|
|
1445
1448
|
N = /* @__PURE__ */ h(
|
|
1446
|
-
|
|
1449
|
+
fa,
|
|
1447
1450
|
{
|
|
1448
1451
|
data: v,
|
|
1449
1452
|
itemIndex: w,
|
|
@@ -1475,7 +1478,7 @@ const Nr = Qo({
|
|
|
1475
1478
|
}
|
|
1476
1479
|
),
|
|
1477
1480
|
/* @__PURE__ */ h(
|
|
1478
|
-
|
|
1481
|
+
ma,
|
|
1479
1482
|
{
|
|
1480
1483
|
data: u,
|
|
1481
1484
|
onClose: () => {
|
|
@@ -1484,7 +1487,7 @@ const Nr = Qo({
|
|
|
1484
1487
|
}
|
|
1485
1488
|
),
|
|
1486
1489
|
/* @__PURE__ */ h(
|
|
1487
|
-
|
|
1490
|
+
pa,
|
|
1488
1491
|
{
|
|
1489
1492
|
data: m,
|
|
1490
1493
|
onClose: () => {
|
|
@@ -1494,7 +1497,7 @@ const Nr = Qo({
|
|
|
1494
1497
|
}
|
|
1495
1498
|
)
|
|
1496
1499
|
] });
|
|
1497
|
-
},
|
|
1500
|
+
}, lh = (n) => {
|
|
1498
1501
|
const {
|
|
1499
1502
|
list: e,
|
|
1500
1503
|
onChange: t,
|
|
@@ -1510,12 +1513,12 @@ const Nr = Qo({
|
|
|
1510
1513
|
pagingDotsBuilder: f,
|
|
1511
1514
|
...m
|
|
1512
1515
|
} = n;
|
|
1513
|
-
return /* @__PURE__ */ h(
|
|
1516
|
+
return /* @__PURE__ */ h(ca, { ...{
|
|
1514
1517
|
list: e,
|
|
1515
1518
|
onChange: t,
|
|
1516
1519
|
storageKey: o,
|
|
1517
1520
|
enableCaching: r
|
|
1518
|
-
}, children: /* @__PURE__ */ h(
|
|
1521
|
+
}, children: /* @__PURE__ */ h(la, { ...{
|
|
1519
1522
|
theme: i,
|
|
1520
1523
|
noLetters: s,
|
|
1521
1524
|
contextMenu: l,
|
|
@@ -1524,8 +1527,8 @@ const Nr = Qo({
|
|
|
1524
1527
|
itemBuilder: c,
|
|
1525
1528
|
itemIconBuilder: d,
|
|
1526
1529
|
contextMenuBuilder: a
|
|
1527
|
-
}, children: /* @__PURE__ */ h(
|
|
1528
|
-
},
|
|
1530
|
+
}, children: /* @__PURE__ */ h(ga, { ...m }) }) });
|
|
1531
|
+
}, ba = {
|
|
1529
1532
|
frontmatterEditor: {
|
|
1530
1533
|
title: "编辑前置元数据",
|
|
1531
1534
|
key: "键",
|
|
@@ -1642,13 +1645,13 @@ const Nr = Qo({
|
|
|
1642
1645
|
image: {
|
|
1643
1646
|
delete: "删除图片"
|
|
1644
1647
|
}
|
|
1645
|
-
},
|
|
1648
|
+
}, ya = (n, e, t) => {
|
|
1646
1649
|
const r = n.split(".").reduce(
|
|
1647
1650
|
(i, s) => typeof i == "string" ? i : i[s],
|
|
1648
|
-
|
|
1651
|
+
ba
|
|
1649
1652
|
);
|
|
1650
1653
|
return typeof r != "string" ? e : t ? r.replace(/{{(.*?)}}/g, (i, s) => t[s]) : r;
|
|
1651
|
-
},
|
|
1654
|
+
}, ka = S`
|
|
1652
1655
|
--accentBase: var(--tomato-1);
|
|
1653
1656
|
--accentBgSubtle: var(--tomato-2);
|
|
1654
1657
|
--accentBg: var(--tomato-3);
|
|
@@ -1702,7 +1705,7 @@ const Nr = Qo({
|
|
|
1702
1705
|
rgba(255, 255, 255, 0.05),
|
|
1703
1706
|
rgba(255, 255, 255, 0.05)
|
|
1704
1707
|
);
|
|
1705
|
-
`,
|
|
1708
|
+
`, xa = S`
|
|
1706
1709
|
[class*="_toolbarRoot"] {
|
|
1707
1710
|
flex-wrap: wrap;
|
|
1708
1711
|
transition: all 0.3s;
|
|
@@ -1908,7 +1911,7 @@ const Nr = Qo({
|
|
|
1908
1911
|
`, Cn = (n) => {
|
|
1909
1912
|
var e, t;
|
|
1910
1913
|
return n === "dark" ? !0 : n === "light" ? !1 : (e = document.documentElement.getAttribute("style")) != null && e.includes("color-scheme: dark;") ? !0 : (t = document.documentElement.getAttribute("style")) != null && t.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1911
|
-
},
|
|
1914
|
+
}, Ca = (n) => {
|
|
1912
1915
|
const {
|
|
1913
1916
|
value: e,
|
|
1914
1917
|
onChange: t,
|
|
@@ -1935,19 +1938,19 @@ const Nr = Qo({
|
|
|
1935
1938
|
}
|
|
1936
1939
|
},
|
|
1937
1940
|
directives: b = {
|
|
1938
|
-
directiveDescriptors: [
|
|
1941
|
+
directiveDescriptors: [fs]
|
|
1939
1942
|
}
|
|
1940
1943
|
} = r ?? {}, [g, y] = J("");
|
|
1941
1944
|
return $e(() => {
|
|
1942
1945
|
var C;
|
|
1943
1946
|
e !== void 0 && a.current && ((C = a.current) == null || C.setMarkdown(e), y(e));
|
|
1944
1947
|
}, [e, a]), /* @__PURE__ */ h(
|
|
1945
|
-
|
|
1948
|
+
ps,
|
|
1946
1949
|
{
|
|
1947
1950
|
ref: a,
|
|
1948
1951
|
className: D(
|
|
1949
|
-
|
|
1950
|
-
Cn(s) ?
|
|
1952
|
+
xa,
|
|
1953
|
+
Cn(s) ? ka : "",
|
|
1951
1954
|
Cn(s) ? Mr : Dr,
|
|
1952
1955
|
i
|
|
1953
1956
|
),
|
|
@@ -1956,49 +1959,49 @@ const Nr = Qo({
|
|
|
1956
1959
|
onChange: (C) => {
|
|
1957
1960
|
!e && !t && y(C), t && t(C);
|
|
1958
1961
|
},
|
|
1959
|
-
translation: o ??
|
|
1962
|
+
translation: o ?? ya,
|
|
1960
1963
|
plugins: [
|
|
1961
|
-
|
|
1962
|
-
toolbarContents: () => /* @__PURE__ */ x(
|
|
1963
|
-
/* @__PURE__ */ h(Is, {}),
|
|
1964
|
-
/* @__PURE__ */ h(Ke, {}),
|
|
1964
|
+
ms({
|
|
1965
|
+
toolbarContents: () => /* @__PURE__ */ x(Is, { options: ["rich-text", "source"], children: [
|
|
1965
1966
|
/* @__PURE__ */ h(As, {}),
|
|
1966
|
-
/* @__PURE__ */ h(Es, {}),
|
|
1967
1967
|
/* @__PURE__ */ h(Ke, {}),
|
|
1968
|
+
/* @__PURE__ */ h(Es, {}),
|
|
1968
1969
|
/* @__PURE__ */ h(Rs, {}),
|
|
1969
1970
|
/* @__PURE__ */ h(Ke, {}),
|
|
1970
1971
|
/* @__PURE__ */ h(Ps, {}),
|
|
1971
1972
|
/* @__PURE__ */ h(Ke, {}),
|
|
1972
1973
|
/* @__PURE__ */ h(zs, {}),
|
|
1973
|
-
/* @__PURE__ */ h(Bs, {}),
|
|
1974
1974
|
/* @__PURE__ */ h(Ke, {}),
|
|
1975
|
+
/* @__PURE__ */ h(Bs, {}),
|
|
1975
1976
|
/* @__PURE__ */ h(Ls, {}),
|
|
1976
|
-
/* @__PURE__ */ h(Vs, {}),
|
|
1977
1977
|
/* @__PURE__ */ h(Ke, {}),
|
|
1978
|
+
/* @__PURE__ */ h(Vs, {}),
|
|
1978
1979
|
/* @__PURE__ */ h(Fs, {}),
|
|
1979
1980
|
/* @__PURE__ */ h(Ke, {}),
|
|
1980
|
-
/* @__PURE__ */ h($s, {})
|
|
1981
|
+
/* @__PURE__ */ h($s, {}),
|
|
1982
|
+
/* @__PURE__ */ h(Ke, {}),
|
|
1983
|
+
/* @__PURE__ */ h(Hs, {})
|
|
1981
1984
|
] })
|
|
1982
1985
|
}),
|
|
1983
|
-
|
|
1984
|
-
gs(),
|
|
1986
|
+
gs(d),
|
|
1985
1987
|
bs(),
|
|
1986
|
-
ys(
|
|
1987
|
-
ks(
|
|
1988
|
-
xs(),
|
|
1989
|
-
Cs(
|
|
1990
|
-
Ss(),
|
|
1988
|
+
ys(),
|
|
1989
|
+
ks(u),
|
|
1990
|
+
xs(f),
|
|
1991
|
+
Cs(),
|
|
1992
|
+
Ss(c),
|
|
1991
1993
|
Ns(),
|
|
1992
1994
|
Ts(),
|
|
1993
|
-
ws(
|
|
1994
|
-
Ds(
|
|
1995
|
-
Ms(),
|
|
1996
|
-
Os(
|
|
1995
|
+
ws(),
|
|
1996
|
+
Ds(m),
|
|
1997
|
+
Ms(p),
|
|
1998
|
+
Os(),
|
|
1999
|
+
vs(b)
|
|
1997
2000
|
],
|
|
1998
2001
|
...l
|
|
1999
2002
|
}
|
|
2000
2003
|
);
|
|
2001
|
-
},
|
|
2004
|
+
}, Sa = {
|
|
2002
2005
|
'code[class*="language-"]': {
|
|
2003
2006
|
background: "hsl(230, 1%, 98%)",
|
|
2004
2007
|
color: "hsl(230, 8%, 24%)",
|
|
@@ -2486,7 +2489,7 @@ const Nr = Qo({
|
|
|
2486
2489
|
".prism-previewer-easing.prism-previewer-easing line": {
|
|
2487
2490
|
stroke: "hsl(230, 8%, 24%)"
|
|
2488
2491
|
}
|
|
2489
|
-
},
|
|
2492
|
+
}, Na = (n) => {
|
|
2490
2493
|
const { children: e = "", className: t, theme: o = "auto", imageProps: r } = n;
|
|
2491
2494
|
return /* @__PURE__ */ h(
|
|
2492
2495
|
"div",
|
|
@@ -2496,39 +2499,39 @@ const Nr = Qo({
|
|
|
2496
2499
|
pr,
|
|
2497
2500
|
{
|
|
2498
2501
|
className: D(wr, t),
|
|
2499
|
-
remarkPlugins: [
|
|
2500
|
-
rehypePlugins: [
|
|
2502
|
+
remarkPlugins: [qs, Ws],
|
|
2503
|
+
rehypePlugins: [Js],
|
|
2501
2504
|
components: {
|
|
2502
2505
|
code(i) {
|
|
2503
2506
|
const { children: s, className: l, node: a, ref: c, ...d } = i, u = /language-(\w+)/.exec(l || "");
|
|
2504
2507
|
return u ? /* @__PURE__ */ h(
|
|
2505
|
-
|
|
2508
|
+
Ks,
|
|
2506
2509
|
{
|
|
2507
2510
|
...d,
|
|
2508
2511
|
PreTag: "div",
|
|
2509
2512
|
children: String(s).replace(/\n$/, ""),
|
|
2510
2513
|
language: u[1],
|
|
2511
|
-
style:
|
|
2514
|
+
style: Sa
|
|
2512
2515
|
}
|
|
2513
2516
|
) : /* @__PURE__ */ h("code", { ...d, className: l, children: s });
|
|
2514
2517
|
},
|
|
2515
2518
|
img(i) {
|
|
2516
2519
|
const { preview: s, ...l } = r ?? {};
|
|
2517
2520
|
return /* @__PURE__ */ h(
|
|
2518
|
-
|
|
2521
|
+
Us,
|
|
2519
2522
|
{
|
|
2520
2523
|
...i,
|
|
2521
2524
|
preview: s instanceof Boolean ? s : {
|
|
2522
2525
|
icons: {
|
|
2523
|
-
rotateLeft: /* @__PURE__ */ h(
|
|
2524
|
-
rotateRight: /* @__PURE__ */ h(
|
|
2525
|
-
zoomIn: /* @__PURE__ */ h(
|
|
2526
|
-
zoomOut: /* @__PURE__ */ h(
|
|
2527
|
-
close: /* @__PURE__ */ h(
|
|
2528
|
-
left: /* @__PURE__ */ h(
|
|
2529
|
-
right: /* @__PURE__ */ h(
|
|
2530
|
-
flipX: /* @__PURE__ */ h(
|
|
2531
|
-
flipY: /* @__PURE__ */ h(
|
|
2526
|
+
rotateLeft: /* @__PURE__ */ h(os, {}),
|
|
2527
|
+
rotateRight: /* @__PURE__ */ h(ns, {}),
|
|
2528
|
+
zoomIn: /* @__PURE__ */ h(ts, {}),
|
|
2529
|
+
zoomOut: /* @__PURE__ */ h(es, {}),
|
|
2530
|
+
close: /* @__PURE__ */ h(Qi, {}),
|
|
2531
|
+
left: /* @__PURE__ */ h(Zi, {}),
|
|
2532
|
+
right: /* @__PURE__ */ h(_i, {}),
|
|
2533
|
+
flipX: /* @__PURE__ */ h(Xi, {}),
|
|
2534
|
+
flipY: /* @__PURE__ */ h(Gi, {})
|
|
2532
2535
|
},
|
|
2533
2536
|
zIndex: 9999,
|
|
2534
2537
|
mask: " ",
|
|
@@ -2547,12 +2550,12 @@ const Nr = Qo({
|
|
|
2547
2550
|
)
|
|
2548
2551
|
}
|
|
2549
2552
|
);
|
|
2550
|
-
},
|
|
2551
|
-
|
|
2553
|
+
}, Ta = Ca;
|
|
2554
|
+
Ta.Preview = Na;
|
|
2552
2555
|
function Or(...n) {
|
|
2553
|
-
return js(
|
|
2556
|
+
return Ys(js(n));
|
|
2554
2557
|
}
|
|
2555
|
-
const
|
|
2558
|
+
const wa = (n) => {
|
|
2556
2559
|
const { mouseX: e, title: t, icon: o, href: r } = n, i = mt(null), s = kt(e, (y) => {
|
|
2557
2560
|
var O;
|
|
2558
2561
|
const C = ((O = i.current) == null ? void 0 : O.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
@@ -2613,7 +2616,7 @@ const Ta = (n) => {
|
|
|
2613
2616
|
}
|
|
2614
2617
|
) });
|
|
2615
2618
|
}, vr = (n) => {
|
|
2616
|
-
const { items: e, className: t } = n, o =
|
|
2619
|
+
const { items: e, className: t } = n, o = qi(1 / 0);
|
|
2617
2620
|
return /* @__PURE__ */ h(
|
|
2618
2621
|
B.div,
|
|
2619
2622
|
{
|
|
@@ -2623,7 +2626,7 @@ const Ta = (n) => {
|
|
|
2623
2626
|
"mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",
|
|
2624
2627
|
t
|
|
2625
2628
|
),
|
|
2626
|
-
children: e.map((r) => /* @__PURE__ */ h(
|
|
2629
|
+
children: e.map((r) => /* @__PURE__ */ h(wa, { mouseX: o, ...r }, r.title))
|
|
2627
2630
|
}
|
|
2628
2631
|
);
|
|
2629
2632
|
}, Ir = (n) => {
|
|
@@ -2679,13 +2682,13 @@ const Ta = (n) => {
|
|
|
2679
2682
|
{
|
|
2680
2683
|
onClick: l,
|
|
2681
2684
|
className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",
|
|
2682
|
-
children: o || /* @__PURE__ */ h(
|
|
2685
|
+
children: o || /* @__PURE__ */ h(rs, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
|
|
2683
2686
|
}
|
|
2684
2687
|
)
|
|
2685
2688
|
]
|
|
2686
2689
|
}
|
|
2687
2690
|
);
|
|
2688
|
-
},
|
|
2691
|
+
}, Da = (n) => {
|
|
2689
2692
|
const { items: e, desktopClassName: t, mobileClassName: o, ...r } = n;
|
|
2690
2693
|
return /* @__PURE__ */ x(rt, { children: [
|
|
2691
2694
|
/* @__PURE__ */ h(vr, { items: e, className: t, ...r }),
|
|
@@ -2699,7 +2702,7 @@ const Ta = (n) => {
|
|
|
2699
2702
|
}
|
|
2700
2703
|
)
|
|
2701
2704
|
] });
|
|
2702
|
-
}, Ar =
|
|
2705
|
+
}, Ar = Da;
|
|
2703
2706
|
Ar.Desktop = vr;
|
|
2704
2707
|
Ar.Mobile = Ir;
|
|
2705
2708
|
function Er(n, e, t) {
|
|
@@ -3138,7 +3141,7 @@ class ue {
|
|
|
3138
3141
|
}
|
|
3139
3142
|
}
|
|
3140
3143
|
ue.none = [];
|
|
3141
|
-
class
|
|
3144
|
+
class Ma extends Error {
|
|
3142
3145
|
}
|
|
3143
3146
|
class E {
|
|
3144
3147
|
/**
|
|
@@ -3239,10 +3242,10 @@ function zr(n, e, t, o) {
|
|
|
3239
3242
|
let l = zr(s.content, e - i - 1, t);
|
|
3240
3243
|
return l && n.replaceChild(r, s.copy(l));
|
|
3241
3244
|
}
|
|
3242
|
-
function
|
|
3245
|
+
function Oa(n) {
|
|
3243
3246
|
return n.tag != null;
|
|
3244
3247
|
}
|
|
3245
|
-
function
|
|
3248
|
+
function va(n) {
|
|
3246
3249
|
return n.style != null;
|
|
3247
3250
|
}
|
|
3248
3251
|
let Br = class Nn {
|
|
@@ -3254,9 +3257,9 @@ let Br = class Nn {
|
|
|
3254
3257
|
this.schema = e, this.rules = t, this.tags = [], this.styles = [];
|
|
3255
3258
|
let o = this.matchedStyles = [];
|
|
3256
3259
|
t.forEach((r) => {
|
|
3257
|
-
if (
|
|
3260
|
+
if (Oa(r))
|
|
3258
3261
|
this.tags.push(r);
|
|
3259
|
-
else if (
|
|
3262
|
+
else if (va(r)) {
|
|
3260
3263
|
let i = /[^=]*/.exec(r.style)[0];
|
|
3261
3264
|
o.indexOf(i) < 0 && o.push(i), this.styles.push(r);
|
|
3262
3265
|
}
|
|
@@ -3292,7 +3295,7 @@ let Br = class Nn {
|
|
|
3292
3295
|
matchTag(e, t, o) {
|
|
3293
3296
|
for (let r = o ? this.tags.indexOf(o) + 1 : 0; r < this.tags.length; r++) {
|
|
3294
3297
|
let i = this.tags[r];
|
|
3295
|
-
if (
|
|
3298
|
+
if (Ea(e, i.tag) && (i.namespace === void 0 || e.namespaceURI == i.namespace) && (!i.context || t.matchesContext(i.context))) {
|
|
3296
3299
|
if (i.getAttrs) {
|
|
3297
3300
|
let s = i.getAttrs(e);
|
|
3298
3301
|
if (s === !1)
|
|
@@ -3393,7 +3396,7 @@ const Lr = {
|
|
|
3393
3396
|
table: !0,
|
|
3394
3397
|
tfoot: !0,
|
|
3395
3398
|
ul: !0
|
|
3396
|
-
},
|
|
3399
|
+
}, Ia = {
|
|
3397
3400
|
head: !0,
|
|
3398
3401
|
noscript: !0,
|
|
3399
3402
|
object: !0,
|
|
@@ -3472,9 +3475,9 @@ class ro {
|
|
|
3472
3475
|
let r = this.localPreserveWS, i = this.top;
|
|
3473
3476
|
(e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
|
|
3474
3477
|
let s = e.nodeName.toLowerCase(), l;
|
|
3475
|
-
Vr.hasOwnProperty(s) && this.parser.normalizeLists &&
|
|
3478
|
+
Vr.hasOwnProperty(s) && this.parser.normalizeLists && Aa(e);
|
|
3476
3479
|
let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, o));
|
|
3477
|
-
e: if (a ? a.ignore :
|
|
3480
|
+
e: if (a ? a.ignore : Ia.hasOwnProperty(s))
|
|
3478
3481
|
this.findInside(e), this.ignoreFallback(e, t);
|
|
3479
3482
|
else if (!a || a.skip || a.closeParent) {
|
|
3480
3483
|
a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
|
|
@@ -3706,13 +3709,13 @@ class ro {
|
|
|
3706
3709
|
}
|
|
3707
3710
|
}
|
|
3708
3711
|
}
|
|
3709
|
-
function
|
|
3712
|
+
function Aa(n) {
|
|
3710
3713
|
for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
|
|
3711
3714
|
let o = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
|
|
3712
3715
|
o && Vr.hasOwnProperty(o) && t ? (t.appendChild(e), e = t) : o == "li" ? t = e : o && (t = null);
|
|
3713
3716
|
}
|
|
3714
3717
|
}
|
|
3715
|
-
function
|
|
3718
|
+
function Ea(n, e) {
|
|
3716
3719
|
return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
|
|
3717
3720
|
}
|
|
3718
3721
|
function io(n) {
|
|
@@ -3855,11 +3858,11 @@ function hn(n) {
|
|
|
3855
3858
|
return n.document || window.document;
|
|
3856
3859
|
}
|
|
3857
3860
|
const ao = /* @__PURE__ */ new WeakMap();
|
|
3858
|
-
function
|
|
3861
|
+
function Ra(n) {
|
|
3859
3862
|
let e = ao.get(n);
|
|
3860
|
-
return e === void 0 && ao.set(n, e =
|
|
3863
|
+
return e === void 0 && ao.set(n, e = Pa(n)), e;
|
|
3861
3864
|
}
|
|
3862
|
-
function
|
|
3865
|
+
function Pa(n) {
|
|
3863
3866
|
let e = null;
|
|
3864
3867
|
function t(o) {
|
|
3865
3868
|
if (o && typeof o == "object")
|
|
@@ -3885,7 +3888,7 @@ function Yt(n, e, t, o) {
|
|
|
3885
3888
|
let r = e[0], i;
|
|
3886
3889
|
if (typeof r != "string")
|
|
3887
3890
|
throw new RangeError("Invalid array passed to renderSpec");
|
|
3888
|
-
if (o && (i =
|
|
3891
|
+
if (o && (i = Ra(o)) && i.indexOf(e) > -1)
|
|
3889
3892
|
throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
|
|
3890
3893
|
let s = r.indexOf(" ");
|
|
3891
3894
|
s > 0 && (t = r.slice(0, s), r = r.slice(s + 1));
|
|
@@ -3916,13 +3919,13 @@ function Yt(n, e, t, o) {
|
|
|
3916
3919
|
return { dom: a, contentDOM: l };
|
|
3917
3920
|
}
|
|
3918
3921
|
const Fr = 65535, $r = Math.pow(2, 16);
|
|
3919
|
-
function
|
|
3922
|
+
function za(n, e) {
|
|
3920
3923
|
return n + e * $r;
|
|
3921
3924
|
}
|
|
3922
3925
|
function co(n) {
|
|
3923
3926
|
return n & Fr;
|
|
3924
3927
|
}
|
|
3925
|
-
function
|
|
3928
|
+
function Ba(n) {
|
|
3926
3929
|
return (n - (n & Fr)) / $r;
|
|
3927
3930
|
}
|
|
3928
3931
|
const Hr = 1, qr = 2, Gt = 4, Wr = 8;
|
|
@@ -3980,7 +3983,7 @@ class he {
|
|
|
3980
3983
|
if (!this.inverted)
|
|
3981
3984
|
for (let r = 0; r < o; r++)
|
|
3982
3985
|
t += this.ranges[r * 3 + 2] - this.ranges[r * 3 + 1];
|
|
3983
|
-
return this.ranges[o * 3] + t +
|
|
3986
|
+
return this.ranges[o * 3] + t + Ba(e);
|
|
3984
3987
|
}
|
|
3985
3988
|
mapResult(e, t = 1) {
|
|
3986
3989
|
return this._map(e, t, !1);
|
|
@@ -4002,7 +4005,7 @@ class he {
|
|
|
4002
4005
|
let f = c ? e == a ? -1 : e == u ? 1 : t : t, m = a + r + (f < 0 ? 0 : d);
|
|
4003
4006
|
if (o)
|
|
4004
4007
|
return m;
|
|
4005
|
-
let p = e == (t < 0 ? a : u) ? null :
|
|
4008
|
+
let p = e == (t < 0 ? a : u) ? null : za(l / 3, e - a), b = e == a ? qr : e == u ? Hr : Gt;
|
|
4006
4009
|
return (t < 0 ? e != a : e != u) && (b |= Wr), new uo(m, b, p);
|
|
4007
4010
|
}
|
|
4008
4011
|
r += d - c;
|
|
@@ -4129,7 +4132,7 @@ class j {
|
|
|
4129
4132
|
try {
|
|
4130
4133
|
return j.ok(e.replace(t, o, r));
|
|
4131
4134
|
} catch (i) {
|
|
4132
|
-
if (i instanceof
|
|
4135
|
+
if (i instanceof Ma)
|
|
4133
4136
|
return j.fail(i.message);
|
|
4134
4137
|
throw i;
|
|
4135
4138
|
}
|
|
@@ -4424,7 +4427,7 @@ function wn(n, e, t) {
|
|
|
4424
4427
|
}
|
|
4425
4428
|
return !1;
|
|
4426
4429
|
}
|
|
4427
|
-
function
|
|
4430
|
+
function La(n, e, t) {
|
|
4428
4431
|
let o = n.resolve(e);
|
|
4429
4432
|
if (!t.content.size)
|
|
4430
4433
|
return e;
|
|
@@ -4534,7 +4537,7 @@ class q {
|
|
|
4534
4537
|
`$head`.
|
|
4535
4538
|
*/
|
|
4536
4539
|
constructor(e, t, o) {
|
|
4537
|
-
this.$anchor = e, this.$head = t, this.ranges = o || [new
|
|
4540
|
+
this.$anchor = e, this.$head = t, this.ranges = o || [new Va(e.min(t), e.max(t))];
|
|
4538
4541
|
}
|
|
4539
4542
|
/**
|
|
4540
4543
|
The selection's anchor, as an unresolved position.
|
|
@@ -4637,7 +4640,7 @@ class q {
|
|
|
4637
4640
|
negative, it will search backwards first.
|
|
4638
4641
|
*/
|
|
4639
4642
|
static near(e, t = 1) {
|
|
4640
|
-
return this.findFrom(e, t) || this.findFrom(e, -t) || new
|
|
4643
|
+
return this.findFrom(e, t) || this.findFrom(e, -t) || new Te(e.node(0));
|
|
4641
4644
|
}
|
|
4642
4645
|
/**
|
|
4643
4646
|
Find the cursor or leaf node selection closest to the start of
|
|
@@ -4646,14 +4649,14 @@ class q {
|
|
|
4646
4649
|
exists.
|
|
4647
4650
|
*/
|
|
4648
4651
|
static atStart(e) {
|
|
4649
|
-
return at(e, e, 0, 0, 1) || new
|
|
4652
|
+
return at(e, e, 0, 0, 1) || new Te(e);
|
|
4650
4653
|
}
|
|
4651
4654
|
/**
|
|
4652
4655
|
Find the cursor or leaf node selection closest to the end of the
|
|
4653
4656
|
given document.
|
|
4654
4657
|
*/
|
|
4655
4658
|
static atEnd(e) {
|
|
4656
|
-
return at(e, e, e.content.size, e.childCount, -1) || new
|
|
4659
|
+
return at(e, e, e.content.size, e.childCount, -1) || new Te(e);
|
|
4657
4660
|
}
|
|
4658
4661
|
/**
|
|
4659
4662
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -4692,7 +4695,7 @@ class q {
|
|
|
4692
4695
|
}
|
|
4693
4696
|
}
|
|
4694
4697
|
q.prototype.visible = !0;
|
|
4695
|
-
class
|
|
4698
|
+
class Va {
|
|
4696
4699
|
/**
|
|
4697
4700
|
Create a range.
|
|
4698
4701
|
*/
|
|
@@ -4849,7 +4852,7 @@ class qn {
|
|
|
4849
4852
|
return o && T.isSelectable(o) ? new T(t) : q.near(t);
|
|
4850
4853
|
}
|
|
4851
4854
|
}
|
|
4852
|
-
class
|
|
4855
|
+
class Te extends q {
|
|
4853
4856
|
/**
|
|
4854
4857
|
Create an all-selection over the given document.
|
|
4855
4858
|
*/
|
|
@@ -4871,25 +4874,25 @@ class Ne extends q {
|
|
|
4871
4874
|
@internal
|
|
4872
4875
|
*/
|
|
4873
4876
|
static fromJSON(e) {
|
|
4874
|
-
return new
|
|
4877
|
+
return new Te(e);
|
|
4875
4878
|
}
|
|
4876
4879
|
map(e) {
|
|
4877
|
-
return new
|
|
4880
|
+
return new Te(e);
|
|
4878
4881
|
}
|
|
4879
4882
|
eq(e) {
|
|
4880
|
-
return e instanceof
|
|
4883
|
+
return e instanceof Te;
|
|
4881
4884
|
}
|
|
4882
4885
|
getBookmark() {
|
|
4883
|
-
return
|
|
4886
|
+
return Fa;
|
|
4884
4887
|
}
|
|
4885
4888
|
}
|
|
4886
|
-
q.jsonID("all",
|
|
4887
|
-
const
|
|
4889
|
+
q.jsonID("all", Te);
|
|
4890
|
+
const Fa = {
|
|
4888
4891
|
map() {
|
|
4889
4892
|
return this;
|
|
4890
4893
|
},
|
|
4891
4894
|
resolve(n) {
|
|
4892
|
-
return new
|
|
4895
|
+
return new Te(n);
|
|
4893
4896
|
}
|
|
4894
4897
|
};
|
|
4895
4898
|
function at(n, e, t, o, r, i = !1) {
|
|
@@ -4965,7 +4968,7 @@ function Jr(n, e, t) {
|
|
|
4965
4968
|
}
|
|
4966
4969
|
return t;
|
|
4967
4970
|
}
|
|
4968
|
-
class
|
|
4971
|
+
class $a {
|
|
4969
4972
|
/**
|
|
4970
4973
|
Create a plugin.
|
|
4971
4974
|
*/
|
|
@@ -4983,7 +4986,7 @@ const mn = /* @__PURE__ */ Object.create(null);
|
|
|
4983
4986
|
function Kr(n) {
|
|
4984
4987
|
return n in mn ? n + "$" + ++mn[n] : (mn[n] = 0, n + "$");
|
|
4985
4988
|
}
|
|
4986
|
-
class
|
|
4989
|
+
class Ha {
|
|
4987
4990
|
/**
|
|
4988
4991
|
Create a plugin key.
|
|
4989
4992
|
*/
|
|
@@ -5016,18 +5019,18 @@ let Dn = null;
|
|
|
5016
5019
|
const Ae = function(n, e, t) {
|
|
5017
5020
|
let o = Dn || (Dn = document.createRange());
|
|
5018
5021
|
return o.setEnd(n, t ?? n.nodeValue.length), o.setStart(n, e || 0), o;
|
|
5019
|
-
},
|
|
5022
|
+
}, qa = function() {
|
|
5020
5023
|
Dn = null;
|
|
5021
5024
|
}, tt = function(n, e, t, o) {
|
|
5022
5025
|
return t && (go(n, e, t, o, -1) || go(n, e, t, o, 1));
|
|
5023
|
-
},
|
|
5026
|
+
}, Wa = /^(img|br|input|textarea|hr)$/i;
|
|
5024
5027
|
function go(n, e, t, o, r) {
|
|
5025
5028
|
for (; ; ) {
|
|
5026
5029
|
if (n == t && e == o)
|
|
5027
5030
|
return !0;
|
|
5028
5031
|
if (e == (r < 0 ? 0 : pe(n))) {
|
|
5029
5032
|
let i = n.parentNode;
|
|
5030
|
-
if (!i || i.nodeType != 1 || Bt(n) ||
|
|
5033
|
+
if (!i || i.nodeType != 1 || Bt(n) || Wa.test(n.nodeName) || n.contentEditable == "false")
|
|
5031
5034
|
return !1;
|
|
5032
5035
|
e = Z(n) + (r < 0 ? 0 : 1), n = i;
|
|
5033
5036
|
} else if (n.nodeType == 1) {
|
|
@@ -5041,7 +5044,7 @@ function go(n, e, t, o, r) {
|
|
|
5041
5044
|
function pe(n) {
|
|
5042
5045
|
return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
|
|
5043
5046
|
}
|
|
5044
|
-
function
|
|
5047
|
+
function Ja(n, e) {
|
|
5045
5048
|
for (; ; ) {
|
|
5046
5049
|
if (n.nodeType == 3 && e)
|
|
5047
5050
|
return n;
|
|
@@ -5055,7 +5058,7 @@ function Wa(n, e) {
|
|
|
5055
5058
|
return null;
|
|
5056
5059
|
}
|
|
5057
5060
|
}
|
|
5058
|
-
function
|
|
5061
|
+
function Ka(n, e) {
|
|
5059
5062
|
for (; ; ) {
|
|
5060
5063
|
if (n.nodeType == 3 && e < n.nodeValue.length)
|
|
5061
5064
|
return n;
|
|
@@ -5069,7 +5072,7 @@ function Ja(n, e) {
|
|
|
5069
5072
|
return null;
|
|
5070
5073
|
}
|
|
5071
5074
|
}
|
|
5072
|
-
function
|
|
5075
|
+
function Ua(n, e, t) {
|
|
5073
5076
|
for (let o = e == 0, r = e == pe(n); o || r; ) {
|
|
5074
5077
|
if (n == t)
|
|
5075
5078
|
return !0;
|
|
@@ -5092,13 +5095,13 @@ function Ue(n, e) {
|
|
|
5092
5095
|
let t = document.createEvent("Event");
|
|
5093
5096
|
return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
|
|
5094
5097
|
}
|
|
5095
|
-
function
|
|
5098
|
+
function ja(n) {
|
|
5096
5099
|
let e = n.activeElement;
|
|
5097
5100
|
for (; e && e.shadowRoot; )
|
|
5098
5101
|
e = e.shadowRoot.activeElement;
|
|
5099
5102
|
return e;
|
|
5100
5103
|
}
|
|
5101
|
-
function
|
|
5104
|
+
function Ya(n, e, t) {
|
|
5102
5105
|
if (n.caretPositionFromPoint)
|
|
5103
5106
|
try {
|
|
5104
5107
|
let o = n.caretPositionFromPoint(e, t);
|
|
@@ -5112,10 +5115,10 @@ function ja(n, e, t) {
|
|
|
5112
5115
|
return { node: o.startContainer, offset: Math.min(pe(o.startContainer), o.startOffset) };
|
|
5113
5116
|
}
|
|
5114
5117
|
}
|
|
5115
|
-
const
|
|
5118
|
+
const De = typeof navigator < "u" ? navigator : null, bo = typeof document < "u" ? document : null, Je = De && De.userAgent || "", Mn = /Edge\/(\d+)/.exec(Je), Ur = /MSIE \d/.exec(Je), On = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Je), ae = !!(Ur || On || Mn), He = Ur ? document.documentMode : On ? +On[1] : Mn ? +Mn[1] : 0, ke = !ae && /gecko\/(\d+)/i.test(Je);
|
|
5116
5119
|
ke && +(/Firefox\/(\d+)/.exec(Je) || [0, 0])[1];
|
|
5117
|
-
const vn = !ae && /Chrome\/(\d+)/.exec(Je), te = !!vn, jr = vn ? +vn[1] : 0, re = !ae && !!
|
|
5118
|
-
function
|
|
5120
|
+
const vn = !ae && /Chrome\/(\d+)/.exec(Je), te = !!vn, jr = vn ? +vn[1] : 0, re = !ae && !!De && /Apple Computer/.test(De.vendor), gt = re && (/Mobile\/\w+/.test(Je) || !!De && De.maxTouchPoints > 2), fe = gt || (De ? /Mac/.test(De.platform) : !1), Ga = De ? /Win/.test(De.platform) : !1, Re = /Android \d/.test(Je), Lt = !!bo && "webkitFontSmoothing" in bo.documentElement.style, Xa = Lt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5121
|
+
function _a(n) {
|
|
5119
5122
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
5120
5123
|
return e ? {
|
|
5121
5124
|
left: 0,
|
|
@@ -5132,7 +5135,7 @@ function Xa(n) {
|
|
|
5132
5135
|
function Ie(n, e) {
|
|
5133
5136
|
return typeof n == "number" ? n : n[e];
|
|
5134
5137
|
}
|
|
5135
|
-
function
|
|
5138
|
+
function Za(n) {
|
|
5136
5139
|
let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, o = e.height / n.offsetHeight || 1;
|
|
5137
5140
|
return {
|
|
5138
5141
|
left: e.left,
|
|
@@ -5146,7 +5149,7 @@ function yo(n, e, t) {
|
|
|
5146
5149
|
for (let s = t || n.dom; s; s = It(s)) {
|
|
5147
5150
|
if (s.nodeType != 1)
|
|
5148
5151
|
continue;
|
|
5149
|
-
let l = s, a = l == i.body, c = a ?
|
|
5152
|
+
let l = s, a = l == i.body, c = a ? _a(i) : Za(l), d = 0, u = 0;
|
|
5150
5153
|
if (e.top < c.top + Ie(o, "top") ? u = -(c.top - e.top + Ie(r, "top")) : e.bottom > c.bottom - Ie(o, "bottom") && (u = e.bottom - e.top > c.bottom - c.top ? e.top + Ie(r, "top") - c.top : e.bottom - c.bottom + Ie(r, "bottom")), e.left < c.left + Ie(o, "left") ? d = -(c.left - e.left + Ie(r, "left")) : e.right > c.right - Ie(o, "right") && (d = e.right - c.right + Ie(r, "right")), d || u)
|
|
5151
5154
|
if (a)
|
|
5152
5155
|
i.defaultView.scrollBy(d, u);
|
|
@@ -5160,7 +5163,7 @@ function yo(n, e, t) {
|
|
|
5160
5163
|
break;
|
|
5161
5164
|
}
|
|
5162
5165
|
}
|
|
5163
|
-
function
|
|
5166
|
+
function Qa(n) {
|
|
5164
5167
|
let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), o, r;
|
|
5165
5168
|
for (let i = (e.left + e.right) / 2, s = t + 1; s < Math.min(innerHeight, e.bottom); s += 5) {
|
|
5166
5169
|
let l = n.root.elementFromPoint(i, s);
|
|
@@ -5180,7 +5183,7 @@ function Yr(n) {
|
|
|
5180
5183
|
;
|
|
5181
5184
|
return e;
|
|
5182
5185
|
}
|
|
5183
|
-
function
|
|
5186
|
+
function ec({ refDOM: n, refTop: e, stack: t }) {
|
|
5184
5187
|
let o = n ? n.getBoundingClientRect().top : 0;
|
|
5185
5188
|
Gr(t, o == 0 ? 0 : o - e);
|
|
5186
5189
|
}
|
|
@@ -5191,7 +5194,7 @@ function Gr(n, e) {
|
|
|
5191
5194
|
}
|
|
5192
5195
|
}
|
|
5193
5196
|
let st = null;
|
|
5194
|
-
function
|
|
5197
|
+
function tc(n) {
|
|
5195
5198
|
if (n.setActive)
|
|
5196
5199
|
return n.setActive();
|
|
5197
5200
|
if (st)
|
|
@@ -5229,9 +5232,9 @@ function Xr(n, e) {
|
|
|
5229
5232
|
!t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (i = u + 1);
|
|
5230
5233
|
}
|
|
5231
5234
|
}
|
|
5232
|
-
return !t && a && (t = a, r = c, o = 0), t && t.nodeType == 3 ?
|
|
5235
|
+
return !t && a && (t = a, r = c, o = 0), t && t.nodeType == 3 ? nc(t, r) : !t || o && t.nodeType == 1 ? { node: n, offset: i } : Xr(t, r);
|
|
5233
5236
|
}
|
|
5234
|
-
function
|
|
5237
|
+
function nc(n, e) {
|
|
5235
5238
|
let t = n.nodeValue.length, o = document.createRange();
|
|
5236
5239
|
for (let r = 0; r < t; r++) {
|
|
5237
5240
|
o.setEnd(n, r + 1), o.setStart(n, r);
|
|
@@ -5244,11 +5247,11 @@ function tc(n, e) {
|
|
|
5244
5247
|
function Wn(n, e) {
|
|
5245
5248
|
return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
|
|
5246
5249
|
}
|
|
5247
|
-
function
|
|
5250
|
+
function oc(n, e) {
|
|
5248
5251
|
let t = n.parentNode;
|
|
5249
5252
|
return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
|
|
5250
5253
|
}
|
|
5251
|
-
function
|
|
5254
|
+
function rc(n, e, t) {
|
|
5252
5255
|
let { node: o, offset: r } = Xr(e, t), i = -1;
|
|
5253
5256
|
if (o.nodeType == 1 && !o.firstChild) {
|
|
5254
5257
|
let s = o.getBoundingClientRect();
|
|
@@ -5256,7 +5259,7 @@ function oc(n, e, t) {
|
|
|
5256
5259
|
}
|
|
5257
5260
|
return n.docView.posFromDOM(o, r, i);
|
|
5258
5261
|
}
|
|
5259
|
-
function
|
|
5262
|
+
function ic(n, e, t, o) {
|
|
5260
5263
|
let r = -1;
|
|
5261
5264
|
for (let i = e, s = !1; i != n.dom; ) {
|
|
5262
5265
|
let l = n.docView.nearestDesc(i, !0), a;
|
|
@@ -5287,8 +5290,8 @@ function _r(n, e, t) {
|
|
|
5287
5290
|
}
|
|
5288
5291
|
return n;
|
|
5289
5292
|
}
|
|
5290
|
-
function
|
|
5291
|
-
let t = n.dom.ownerDocument, o, r = 0, i =
|
|
5293
|
+
function sc(n, e) {
|
|
5294
|
+
let t = n.dom.ownerDocument, o, r = 0, i = Ya(t, e.left, e.top);
|
|
5292
5295
|
i && ({ node: o, offset: r } = i);
|
|
5293
5296
|
let s = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
|
|
5294
5297
|
if (!s || !n.dom.contains(s.nodeType != 1 ? s.parentNode : s)) {
|
|
@@ -5299,15 +5302,15 @@ function ic(n, e) {
|
|
|
5299
5302
|
if (re)
|
|
5300
5303
|
for (let c = s; o && c; c = It(c))
|
|
5301
5304
|
c.draggable && (o = void 0);
|
|
5302
|
-
if (s =
|
|
5305
|
+
if (s = oc(s, e), o) {
|
|
5303
5306
|
if (ke && o.nodeType == 1 && (r = Math.min(r, o.childNodes.length), r < o.childNodes.length)) {
|
|
5304
5307
|
let d = o.childNodes[r], u;
|
|
5305
5308
|
d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && r++;
|
|
5306
5309
|
}
|
|
5307
5310
|
let c;
|
|
5308
|
-
Lt && r && o.nodeType == 1 && (c = o.childNodes[r - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && r--, o == n.dom && r == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (r == 0 || o.nodeType != 1 || o.childNodes[r - 1].nodeName != "BR") && (l =
|
|
5311
|
+
Lt && r && o.nodeType == 1 && (c = o.childNodes[r - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && r--, o == n.dom && r == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (r == 0 || o.nodeType != 1 || o.childNodes[r - 1].nodeName != "BR") && (l = ic(n, o, r, e));
|
|
5309
5312
|
}
|
|
5310
|
-
l == null && (l =
|
|
5313
|
+
l == null && (l = rc(n, s, e));
|
|
5311
5314
|
let a = n.docView.nearestDesc(s, !0);
|
|
5312
5315
|
return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
|
|
5313
5316
|
}
|
|
@@ -5323,11 +5326,11 @@ function Be(n, e) {
|
|
|
5323
5326
|
}
|
|
5324
5327
|
return Array.prototype.find.call(t, ko) || n.getBoundingClientRect();
|
|
5325
5328
|
}
|
|
5326
|
-
const
|
|
5329
|
+
const lc = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
5327
5330
|
function Zr(n, e, t) {
|
|
5328
5331
|
let { node: o, offset: r, atom: i } = n.docView.domFromPos(e, t < 0 ? -1 : 1), s = Lt || ke;
|
|
5329
5332
|
if (o.nodeType == 3)
|
|
5330
|
-
if (s && (
|
|
5333
|
+
if (s && (lc.test(o.nodeValue) || (t < 0 ? !r : r == o.nodeValue.length))) {
|
|
5331
5334
|
let a = Be(Ae(o, r, r), t);
|
|
5332
5335
|
if (ke && r && /\s/.test(o.nodeValue[r - 1]) && r < o.nodeValue.length) {
|
|
5333
5336
|
let c = Be(Ae(o, r - 1, r - 1), -1);
|
|
@@ -5391,7 +5394,7 @@ function Qr(n, e, t) {
|
|
|
5391
5394
|
o != e && n.updateState(o), r != n.dom && r && r.focus();
|
|
5392
5395
|
}
|
|
5393
5396
|
}
|
|
5394
|
-
function
|
|
5397
|
+
function ac(n, e, t) {
|
|
5395
5398
|
let o = e.selection, r = t == "up" ? o.$from : o.$to;
|
|
5396
5399
|
return Qr(n, e, () => {
|
|
5397
5400
|
let { node: i } = n.docView.domFromPos(r.pos, t == "up" ? -1 : 1);
|
|
@@ -5423,13 +5426,13 @@ function lc(n, e, t) {
|
|
|
5423
5426
|
return !0;
|
|
5424
5427
|
});
|
|
5425
5428
|
}
|
|
5426
|
-
const
|
|
5427
|
-
function
|
|
5429
|
+
const cc = /[\u0590-\u08ac]/;
|
|
5430
|
+
function dc(n, e, t) {
|
|
5428
5431
|
let { $head: o } = e.selection;
|
|
5429
5432
|
if (!o.parent.isTextblock)
|
|
5430
5433
|
return !1;
|
|
5431
5434
|
let r = o.parentOffset, i = !r, s = r == o.parent.content.size, l = n.domSelection();
|
|
5432
|
-
return l ? !
|
|
5435
|
+
return l ? !cc.test(o.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? i : s : Qr(n, e, () => {
|
|
5433
5436
|
let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), f = l.caretBidiLevel;
|
|
5434
5437
|
l.modify("move", t, "character");
|
|
5435
5438
|
let m = o.depth ? n.docView.domAfterPos(o.before()) : n.dom, { focusNode: p, focusOffset: b } = n.domSelectionRange(), g = p && !m.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == b;
|
|
@@ -5441,10 +5444,10 @@ function cc(n, e, t) {
|
|
|
5441
5444
|
}) : o.pos == o.start() || o.pos == o.end();
|
|
5442
5445
|
}
|
|
5443
5446
|
let xo = null, Co = null, So = !1;
|
|
5444
|
-
function
|
|
5445
|
-
return xo == e && Co == t ? So : (xo = e, Co = t, So = t == "up" || t == "down" ?
|
|
5447
|
+
function uc(n, e, t) {
|
|
5448
|
+
return xo == e && Co == t ? So : (xo = e, Co = t, So = t == "up" || t == "down" ? ac(n, e, t) : dc(n, e, t));
|
|
5446
5449
|
}
|
|
5447
|
-
const ge = 0, No = 1, Xe = 2,
|
|
5450
|
+
const ge = 0, No = 1, Xe = 2, Me = 3;
|
|
5448
5451
|
class Vt {
|
|
5449
5452
|
constructor(e, t, o, r) {
|
|
5450
5453
|
this.parent = e, this.children = t, this.dom = o, this.contentDOM = r, this.dirty = ge, o.pmViewDesc = this;
|
|
@@ -5760,10 +5763,10 @@ class Vt {
|
|
|
5760
5763
|
if (o == s ? e <= s && t >= o : e < s && t > o) {
|
|
5761
5764
|
let l = o + i.border, a = s - i.border;
|
|
5762
5765
|
if (e >= l && t <= a) {
|
|
5763
|
-
this.dirty = e == o || t == s ? Xe : No, e == l && t == a && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty =
|
|
5766
|
+
this.dirty = e == o || t == s ? Xe : No, e == l && t == a && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty = Me : i.markDirty(e - l, t - l);
|
|
5764
5767
|
return;
|
|
5765
5768
|
} else
|
|
5766
|
-
i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? Xe :
|
|
5769
|
+
i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? Xe : Me;
|
|
5767
5770
|
}
|
|
5768
5771
|
o = s;
|
|
5769
5772
|
}
|
|
@@ -5826,7 +5829,7 @@ class ei extends Vt {
|
|
|
5826
5829
|
return this.widget.type.side;
|
|
5827
5830
|
}
|
|
5828
5831
|
}
|
|
5829
|
-
class
|
|
5832
|
+
class hc extends Vt {
|
|
5830
5833
|
constructor(e, t, o, r) {
|
|
5831
5834
|
super(e, [], t, null), this.textDOM = o, this.text = r;
|
|
5832
5835
|
}
|
|
@@ -5852,10 +5855,10 @@ class nt extends Vt {
|
|
|
5852
5855
|
return (!s || !s.dom) && (s = yt.renderSpec(document, t.type.spec.toDOM(t, o), null, t.attrs)), new nt(e, t, s.dom, s.contentDOM || s.dom, s);
|
|
5853
5856
|
}
|
|
5854
5857
|
parseRule() {
|
|
5855
|
-
return this.dirty &
|
|
5858
|
+
return this.dirty & Me || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
|
|
5856
5859
|
}
|
|
5857
5860
|
matchesMark(e) {
|
|
5858
|
-
return this.dirty !=
|
|
5861
|
+
return this.dirty != Me && this.mark.eq(e);
|
|
5859
5862
|
}
|
|
5860
5863
|
markDirty(e, t) {
|
|
5861
5864
|
if (super.markDirty(e, t), this.dirty != ge) {
|
|
@@ -5907,7 +5910,7 @@ class qe extends Vt {
|
|
|
5907
5910
|
} else d || ({ dom: d, contentDOM: u } = yt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
5908
5911
|
!u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
|
|
5909
5912
|
let f = d;
|
|
5910
|
-
return d = ri(d, o, t), c ? a = new
|
|
5913
|
+
return d = ri(d, o, t), c ? a = new fc(e, t, o, r, d, u || null, f, c, i, s + 1) : t.isText ? new rn(e, t, o, r, d, f, i) : new qe(e, t, o, r, d, u || null, f, i, s + 1);
|
|
5911
5914
|
}
|
|
5912
5915
|
parseRule() {
|
|
5913
5916
|
if (this.node.type.spec.reparseInView)
|
|
@@ -5943,14 +5946,14 @@ class qe extends Vt {
|
|
|
5943
5946
|
// separate step, syncs the DOM inside `this.contentDOM` to
|
|
5944
5947
|
// `this.children`.
|
|
5945
5948
|
updateChildren(e, t) {
|
|
5946
|
-
let o = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, s = i && i.pos > -1 ? i : null, l = i && i.pos < 0, a = new
|
|
5947
|
-
|
|
5949
|
+
let o = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, s = i && i.pos > -1 ? i : null, l = i && i.pos < 0, a = new mc(this, s && s.node, e);
|
|
5950
|
+
yc(this.node, this.innerDeco, (c, d, u) => {
|
|
5948
5951
|
c.spec.marks ? a.syncToMarks(c.spec.marks, o, e) : c.type.side >= 0 && !u && a.syncToMarks(d == this.node.childCount ? ue.none : this.node.child(d).marks, o, e), a.placeWidget(c, e, r);
|
|
5949
5952
|
}, (c, d, u, f) => {
|
|
5950
5953
|
a.syncToMarks(c.marks, o, e);
|
|
5951
5954
|
let m;
|
|
5952
5955
|
a.findNodeMatch(c, d, u, f) || l && e.state.selection.from > r && e.state.selection.to < r + c.nodeSize && (m = a.findIndexWithChild(i.node)) > -1 && a.updateNodeAt(c, d, u, m, e) || a.updateNextNode(c, d, u, e, f, r) || a.addNode(c, d, u, e, r), r += c.nodeSize;
|
|
5953
|
-
}), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (s && this.protectLocalComposition(e, s), ni(this.contentDOM, this.children, e), gt &&
|
|
5956
|
+
}), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (s && this.protectLocalComposition(e, s), ni(this.contentDOM, this.children, e), gt && kc(this.dom));
|
|
5954
5957
|
}
|
|
5955
5958
|
localCompositionInfo(e, t) {
|
|
5956
5959
|
let { from: o, to: r } = e.state.selection;
|
|
@@ -5960,7 +5963,7 @@ class qe extends Vt {
|
|
|
5960
5963
|
if (!i || !this.dom.contains(i.parentNode))
|
|
5961
5964
|
return null;
|
|
5962
5965
|
if (this.node.inlineContent) {
|
|
5963
|
-
let s = i.nodeValue, l =
|
|
5966
|
+
let s = i.nodeValue, l = xc(this.node.content, s, o - t, r - t);
|
|
5964
5967
|
return l < 0 ? null : { node: i, pos: l, text: s };
|
|
5965
5968
|
} else
|
|
5966
5969
|
return { node: i, pos: -1, text: "" };
|
|
@@ -5976,13 +5979,13 @@ class qe extends Vt {
|
|
|
5976
5979
|
i.parentNode.removeChild(i.nextSibling);
|
|
5977
5980
|
i.pmViewDesc && (i.pmViewDesc = void 0);
|
|
5978
5981
|
}
|
|
5979
|
-
let s = new
|
|
5982
|
+
let s = new hc(this, i, t, r);
|
|
5980
5983
|
e.input.compositionNodes.push(s), this.children = An(this.children, o, o + r.length, e, s);
|
|
5981
5984
|
}
|
|
5982
5985
|
// If this desc must be updated to match the given node decoration,
|
|
5983
5986
|
// do so and return true.
|
|
5984
5987
|
update(e, t, o, r) {
|
|
5985
|
-
return this.dirty ==
|
|
5988
|
+
return this.dirty == Me || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, o, r), !0);
|
|
5986
5989
|
}
|
|
5987
5990
|
updateInner(e, t, o, r) {
|
|
5988
5991
|
this.updateOuterDeco(t), this.node = e, this.innerDeco = o, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty = ge;
|
|
@@ -6021,7 +6024,7 @@ class rn extends qe {
|
|
|
6021
6024
|
return { skip: e || !0 };
|
|
6022
6025
|
}
|
|
6023
6026
|
update(e, t, o, r) {
|
|
6024
|
-
return this.dirty ==
|
|
6027
|
+
return this.dirty == Me || this.dirty != ge && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != ge || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, r.trackWrites == this.nodeDOM && (r.trackWrites = null)), this.node = e, this.dirty = ge, !0);
|
|
6025
6028
|
}
|
|
6026
6029
|
inParent() {
|
|
6027
6030
|
let e = this.parent.contentDOM;
|
|
@@ -6044,7 +6047,7 @@ class rn extends qe {
|
|
|
6044
6047
|
return new rn(this.parent, r, this.outerDeco, this.innerDeco, i, i, o);
|
|
6045
6048
|
}
|
|
6046
6049
|
markDirty(e, t) {
|
|
6047
|
-
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty =
|
|
6050
|
+
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Me);
|
|
6048
6051
|
}
|
|
6049
6052
|
get domAtom() {
|
|
6050
6053
|
return !1;
|
|
@@ -6067,7 +6070,7 @@ class ti extends Vt {
|
|
|
6067
6070
|
return this.dom.nodeName == "IMG";
|
|
6068
6071
|
}
|
|
6069
6072
|
}
|
|
6070
|
-
class
|
|
6073
|
+
class fc extends qe {
|
|
6071
6074
|
constructor(e, t, o, r, i, s, l, a, c, d) {
|
|
6072
6075
|
super(e, t, o, r, i, s, l, c, d), this.spec = a;
|
|
6073
6076
|
}
|
|
@@ -6075,7 +6078,7 @@ class hc extends qe {
|
|
|
6075
6078
|
// through. If it does, and there's a `contentDOM` node, our logic
|
|
6076
6079
|
// updates the children.
|
|
6077
6080
|
update(e, t, o, r) {
|
|
6078
|
-
if (this.dirty ==
|
|
6081
|
+
if (this.dirty == Me)
|
|
6079
6082
|
return !1;
|
|
6080
6083
|
if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
|
|
6081
6084
|
let i = this.spec.update(e, t, o);
|
|
@@ -6151,11 +6154,11 @@ function oi(n, e, t, o) {
|
|
|
6151
6154
|
let a;
|
|
6152
6155
|
l && l.nodeName == s.nodeName && r != n && (a = r.parentNode) && a.nodeName.toLowerCase() == s.nodeName || (a = document.createElement(s.nodeName), a.pmIsDeco = !0, a.appendChild(r), l = _e[0]), r = a;
|
|
6153
6156
|
}
|
|
6154
|
-
|
|
6157
|
+
pc(r, l || _e[0], s);
|
|
6155
6158
|
}
|
|
6156
6159
|
return r;
|
|
6157
6160
|
}
|
|
6158
|
-
function
|
|
6161
|
+
function pc(n, e, t) {
|
|
6159
6162
|
for (let o in e)
|
|
6160
6163
|
o != "class" && o != "style" && o != "nodeName" && !(o in t) && n.removeAttribute(o);
|
|
6161
6164
|
for (let o in t)
|
|
@@ -6192,9 +6195,9 @@ function wo(n) {
|
|
|
6192
6195
|
let e = n.nextSibling;
|
|
6193
6196
|
return n.parentNode.removeChild(n), e;
|
|
6194
6197
|
}
|
|
6195
|
-
class
|
|
6198
|
+
class mc {
|
|
6196
6199
|
constructor(e, t, o) {
|
|
6197
|
-
this.lock = t, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch =
|
|
6200
|
+
this.lock = t, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = gc(e.node.content, e);
|
|
6198
6201
|
}
|
|
6199
6202
|
// Destroy and remove the children between the given indices in
|
|
6200
6203
|
// `this.top`.
|
|
@@ -6254,7 +6257,7 @@ class pc {
|
|
|
6254
6257
|
}
|
|
6255
6258
|
updateNodeAt(e, t, o, r, i) {
|
|
6256
6259
|
let s = this.top.children[r];
|
|
6257
|
-
return s.dirty ==
|
|
6260
|
+
return s.dirty == Me && s.dom == s.contentDOM && (s.dirty = Xe), s.update(e, t, o, i) ? (this.destroyBetween(this.index, r), this.index++, !0) : !1;
|
|
6258
6261
|
}
|
|
6259
6262
|
findIndexWithChild(e) {
|
|
6260
6263
|
for (; ; ) {
|
|
@@ -6282,7 +6285,7 @@ class pc {
|
|
|
6282
6285
|
let c = this.preMatch.matched.get(a);
|
|
6283
6286
|
if (c != null && c != i)
|
|
6284
6287
|
return !1;
|
|
6285
|
-
let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty !=
|
|
6288
|
+
let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Me && Zt(t, a.outerDeco));
|
|
6286
6289
|
if (!f && a.update(e, t, o, r))
|
|
6287
6290
|
return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
|
|
6288
6291
|
if (!f && (u = this.recreateWrapper(a, e, t, o, r, s)))
|
|
@@ -6342,7 +6345,7 @@ class pc {
|
|
|
6342
6345
|
return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
|
|
6343
6346
|
}
|
|
6344
6347
|
}
|
|
6345
|
-
function
|
|
6348
|
+
function gc(n, e) {
|
|
6346
6349
|
let t = e, o = t.children.length, r = n.childCount, i = /* @__PURE__ */ new Map(), s = [];
|
|
6347
6350
|
e: for (; r > 0; ) {
|
|
6348
6351
|
let l;
|
|
@@ -6369,10 +6372,10 @@ function mc(n, e) {
|
|
|
6369
6372
|
}
|
|
6370
6373
|
return { index: r, matched: i, matches: s.reverse() };
|
|
6371
6374
|
}
|
|
6372
|
-
function
|
|
6375
|
+
function bc(n, e) {
|
|
6373
6376
|
return n.type.side - e.type.side;
|
|
6374
6377
|
}
|
|
6375
|
-
function
|
|
6378
|
+
function yc(n, e, t, o) {
|
|
6376
6379
|
let r = e.locals(n), i = 0;
|
|
6377
6380
|
if (r.length == 0) {
|
|
6378
6381
|
for (let c = 0; c < n.childCount; c++) {
|
|
@@ -6390,7 +6393,7 @@ function bc(n, e, t, o) {
|
|
|
6390
6393
|
}
|
|
6391
6394
|
if (d)
|
|
6392
6395
|
if (u) {
|
|
6393
|
-
u.sort(
|
|
6396
|
+
u.sort(bc);
|
|
6394
6397
|
for (let g = 0; g < u.length; g++)
|
|
6395
6398
|
t(u[g], c, !!a);
|
|
6396
6399
|
} else
|
|
@@ -6420,13 +6423,13 @@ function bc(n, e, t, o) {
|
|
|
6420
6423
|
o(f, b, e.forChild(i, f), m), i = p;
|
|
6421
6424
|
}
|
|
6422
6425
|
}
|
|
6423
|
-
function
|
|
6426
|
+
function kc(n) {
|
|
6424
6427
|
if (n.nodeName == "UL" || n.nodeName == "OL") {
|
|
6425
6428
|
let e = n.style.cssText;
|
|
6426
6429
|
n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
|
|
6427
6430
|
}
|
|
6428
6431
|
}
|
|
6429
|
-
function
|
|
6432
|
+
function xc(n, e, t, o) {
|
|
6430
6433
|
for (let r = 0, i = 0; r < n.childCount && i <= o; ) {
|
|
6431
6434
|
let s = n.child(r++), l = i;
|
|
6432
6435
|
if (i += s.nodeSize, !s.isText)
|
|
@@ -6470,7 +6473,7 @@ function Jn(n, e = null) {
|
|
|
6470
6473
|
for (a = s; r && !r.node; )
|
|
6471
6474
|
r = r.parent;
|
|
6472
6475
|
let u = r.node;
|
|
6473
|
-
if (r && u.isAtom && T.isSelectable(u) && r.parent && !(u.isInline &&
|
|
6476
|
+
if (r && u.isAtom && T.isSelectable(u) && r.parent && !(u.isInline && Ua(t.focusNode, t.focusOffset, r.dom))) {
|
|
6474
6477
|
let f = r.posBefore;
|
|
6475
6478
|
c = new T(s == f ? l : o.resolve(f));
|
|
6476
6479
|
}
|
|
@@ -6510,10 +6513,10 @@ function Pe(n, e = !1) {
|
|
|
6510
6513
|
}
|
|
6511
6514
|
}
|
|
6512
6515
|
if (n.domObserver.disconnectSelection(), n.cursorWrapper)
|
|
6513
|
-
|
|
6516
|
+
Sc(n);
|
|
6514
6517
|
else {
|
|
6515
6518
|
let { anchor: o, head: r } = t, i, s;
|
|
6516
|
-
Do && !(t instanceof $) && (t.$from.parent.inlineContent || (i = Mo(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Mo(n, t.to))), n.docView.setSelection(o, r, n, e), Do && (i && Oo(i), s && Oo(s)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document &&
|
|
6519
|
+
Do && !(t instanceof $) && (t.$from.parent.inlineContent || (i = Mo(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Mo(n, t.to))), n.docView.setSelection(o, r, n, e), Do && (i && Oo(i), s && Oo(s)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Cc(n));
|
|
6517
6520
|
}
|
|
6518
6521
|
n.domObserver.setCurSelection(), n.domObserver.connectSelection();
|
|
6519
6522
|
}
|
|
@@ -6536,7 +6539,7 @@ function bn(n) {
|
|
|
6536
6539
|
function Oo(n) {
|
|
6537
6540
|
n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
|
|
6538
6541
|
}
|
|
6539
|
-
function
|
|
6542
|
+
function Cc(n) {
|
|
6540
6543
|
let e = n.dom.ownerDocument;
|
|
6541
6544
|
e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
|
|
6542
6545
|
let t = n.domSelectionRange(), o = t.anchorNode, r = t.anchorOffset;
|
|
@@ -6546,7 +6549,7 @@ function xc(n) {
|
|
|
6546
6549
|
}, 20));
|
|
6547
6550
|
});
|
|
6548
6551
|
}
|
|
6549
|
-
function
|
|
6552
|
+
function Sc(n) {
|
|
6550
6553
|
let e = n.domSelection(), t = document.createRange();
|
|
6551
6554
|
if (!e)
|
|
6552
6555
|
return;
|
|
@@ -6579,7 +6582,7 @@ function li(n) {
|
|
|
6579
6582
|
return !1;
|
|
6580
6583
|
}
|
|
6581
6584
|
}
|
|
6582
|
-
function
|
|
6585
|
+
function Nc(n) {
|
|
6583
6586
|
let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
|
|
6584
6587
|
return tt(e.node, e.offset, t.anchorNode, t.anchorOffset);
|
|
6585
6588
|
}
|
|
@@ -6628,9 +6631,9 @@ function Nt(n, e) {
|
|
|
6628
6631
|
return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
|
|
6629
6632
|
}
|
|
6630
6633
|
function lt(n, e) {
|
|
6631
|
-
return e < 0 ?
|
|
6634
|
+
return e < 0 ? Tc(n) : wc(n);
|
|
6632
6635
|
}
|
|
6633
|
-
function
|
|
6636
|
+
function Tc(n) {
|
|
6634
6637
|
let e = n.domSelectionRange(), t = e.focusNode, o = e.focusOffset;
|
|
6635
6638
|
if (!t)
|
|
6636
6639
|
return;
|
|
@@ -6666,7 +6669,7 @@ function Nc(n) {
|
|
|
6666
6669
|
}
|
|
6667
6670
|
s ? Rn(n, t, o) : r && Rn(n, r, i);
|
|
6668
6671
|
}
|
|
6669
|
-
function
|
|
6672
|
+
function wc(n) {
|
|
6670
6673
|
let e = n.domSelectionRange(), t = e.focusNode, o = e.focusOffset;
|
|
6671
6674
|
if (!t)
|
|
6672
6675
|
return;
|
|
@@ -6702,7 +6705,7 @@ function ai(n) {
|
|
|
6702
6705
|
let e = n.pmViewDesc;
|
|
6703
6706
|
return e && e.node && e.node.isBlock;
|
|
6704
6707
|
}
|
|
6705
|
-
function
|
|
6708
|
+
function Dc(n, e) {
|
|
6706
6709
|
for (; n && e == n.childNodes.length && !Bt(n); )
|
|
6707
6710
|
e = Z(n) + 1, n = n.parentNode;
|
|
6708
6711
|
for (; n && e < n.childNodes.length; ) {
|
|
@@ -6714,7 +6717,7 @@ function wc(n, e) {
|
|
|
6714
6717
|
n = t, e = 0;
|
|
6715
6718
|
}
|
|
6716
6719
|
}
|
|
6717
|
-
function
|
|
6720
|
+
function Mc(n, e) {
|
|
6718
6721
|
for (; n && !e && !Bt(n); )
|
|
6719
6722
|
e = Z(n), n = n.parentNode;
|
|
6720
6723
|
for (; n && e; ) {
|
|
@@ -6729,7 +6732,7 @@ function Dc(n, e) {
|
|
|
6729
6732
|
function Rn(n, e, t) {
|
|
6730
6733
|
if (e.nodeType != 3) {
|
|
6731
6734
|
let i, s;
|
|
6732
|
-
(s =
|
|
6735
|
+
(s = Dc(e, t)) ? (e = s, t = 0) : (i = Mc(e, t)) && (e = i, t = i.nodeValue.length);
|
|
6733
6736
|
}
|
|
6734
6737
|
let o = n.domSelection();
|
|
6735
6738
|
if (!o)
|
|
@@ -6746,7 +6749,7 @@ function Rn(n, e, t) {
|
|
|
6746
6749
|
}
|
|
6747
6750
|
function Eo(n, e) {
|
|
6748
6751
|
let t = n.state.doc.resolve(e);
|
|
6749
|
-
if (!(te ||
|
|
6752
|
+
if (!(te || Ga) && t.parent.inlineContent) {
|
|
6750
6753
|
let r = n.coordsAtPos(e);
|
|
6751
6754
|
if (e > t.start()) {
|
|
6752
6755
|
let i = n.coordsAtPos(e - 1), s = (i.top + i.bottom) / 2;
|
|
@@ -6772,7 +6775,7 @@ function Ro(n, e, t) {
|
|
|
6772
6775
|
return Le(n, s);
|
|
6773
6776
|
}
|
|
6774
6777
|
if (!r.parent.inlineContent) {
|
|
6775
|
-
let s = e < 0 ? r : i, l = o instanceof
|
|
6778
|
+
let s = e < 0 ? r : i, l = o instanceof Te ? q.near(s, e) : q.findFrom(s, e);
|
|
6776
6779
|
return l ? Le(n, l) : !1;
|
|
6777
6780
|
}
|
|
6778
6781
|
return !1;
|
|
@@ -6797,7 +6800,7 @@ function Po(n, e) {
|
|
|
6797
6800
|
function zo(n, e, t) {
|
|
6798
6801
|
n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
|
|
6799
6802
|
}
|
|
6800
|
-
function
|
|
6803
|
+
function Oc(n) {
|
|
6801
6804
|
if (!re || n.state.selection.$head.parentOffset > 0)
|
|
6802
6805
|
return !1;
|
|
6803
6806
|
let { focusNode: e, focusOffset: t } = n.domSelectionRange();
|
|
@@ -6807,12 +6810,12 @@ function Mc(n) {
|
|
|
6807
6810
|
}
|
|
6808
6811
|
return !1;
|
|
6809
6812
|
}
|
|
6810
|
-
function
|
|
6813
|
+
function vc(n) {
|
|
6811
6814
|
let e = "";
|
|
6812
6815
|
return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
|
|
6813
6816
|
}
|
|
6814
|
-
function
|
|
6815
|
-
let t = e.keyCode, o =
|
|
6817
|
+
function Ic(n, e) {
|
|
6818
|
+
let t = e.keyCode, o = vc(e);
|
|
6816
6819
|
if (t == 8 || fe && t == 72 && o == "c")
|
|
6817
6820
|
return Po(n, -1) || lt(n, -1);
|
|
6818
6821
|
if (t == 46 && !e.shiftKey || fe && t == 68 && o == "c")
|
|
@@ -6829,7 +6832,7 @@ function vc(n, e) {
|
|
|
6829
6832
|
if (t == 38 || fe && t == 80 && o == "c")
|
|
6830
6833
|
return Ro(n, -1, o) || lt(n, -1);
|
|
6831
6834
|
if (t == 40 || fe && t == 78 && o == "c")
|
|
6832
|
-
return
|
|
6835
|
+
return Oc(n) || Ro(n, 1, o) || lt(n, 1);
|
|
6833
6836
|
if (o == (fe ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
6834
6837
|
return !0;
|
|
6835
6838
|
}
|
|
@@ -6887,7 +6890,7 @@ function jn(n, e, t, o, r) {
|
|
|
6887
6890
|
} else
|
|
6888
6891
|
n.someProp("transformPastedHTML", (u) => {
|
|
6889
6892
|
t = u(t, n);
|
|
6890
|
-
}), s =
|
|
6893
|
+
}), s = Pc(t), Lt && zc(s);
|
|
6891
6894
|
let c = s && s.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
6892
6895
|
if (d && d[3])
|
|
6893
6896
|
for (let u = +d[3]; u > 0; u--) {
|
|
@@ -6902,11 +6905,11 @@ function jn(n, e, t, o, r) {
|
|
|
6902
6905
|
preserveWhitespace: !!(a || d),
|
|
6903
6906
|
context: r,
|
|
6904
6907
|
ruleFromNode(f) {
|
|
6905
|
-
return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !
|
|
6908
|
+
return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Ac.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
6906
6909
|
}
|
|
6907
6910
|
})), d)
|
|
6908
|
-
l =
|
|
6909
|
-
else if (l = E.maxOpen(
|
|
6911
|
+
l = Bc(Bo(l, +d[1], +d[2]), d[4]);
|
|
6912
|
+
else if (l = E.maxOpen(Ec(l.content, r), !0), l.openStart || l.openEnd) {
|
|
6910
6913
|
let u = 0, f = 0;
|
|
6911
6914
|
for (let m = l.content.firstChild; u < l.openStart && !m.type.spec.isolating; u++, m = m.firstChild)
|
|
6912
6915
|
;
|
|
@@ -6918,8 +6921,8 @@ function jn(n, e, t, o, r) {
|
|
|
6918
6921
|
l = u(l, n);
|
|
6919
6922
|
}), l;
|
|
6920
6923
|
}
|
|
6921
|
-
const
|
|
6922
|
-
function
|
|
6924
|
+
const Ac = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
|
|
6925
|
+
function Ec(n, e) {
|
|
6923
6926
|
if (n.childCount < 2)
|
|
6924
6927
|
return n;
|
|
6925
6928
|
for (let t = e.depth; t >= 0; t--) {
|
|
@@ -6985,27 +6988,27 @@ function fi() {
|
|
|
6985
6988
|
return Lo || (Lo = document.implementation.createHTMLDocument("title"));
|
|
6986
6989
|
}
|
|
6987
6990
|
let yn = null;
|
|
6988
|
-
function
|
|
6991
|
+
function Rc(n) {
|
|
6989
6992
|
let e = window.trustedTypes;
|
|
6990
6993
|
return e ? (yn || (yn = e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), yn.createHTML(n)) : n;
|
|
6991
6994
|
}
|
|
6992
|
-
function
|
|
6995
|
+
function Pc(n) {
|
|
6993
6996
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
6994
6997
|
e && (n = n.slice(e[0].length));
|
|
6995
6998
|
let t = fi().createElement("div"), o = /<([a-z][^>\s]+)/i.exec(n), r;
|
|
6996
|
-
if ((r = o && hi[o[1].toLowerCase()]) && (n = r.map((i) => "<" + i + ">").join("") + n + r.map((i) => "</" + i + ">").reverse().join("")), t.innerHTML =
|
|
6999
|
+
if ((r = o && hi[o[1].toLowerCase()]) && (n = r.map((i) => "<" + i + ">").join("") + n + r.map((i) => "</" + i + ">").reverse().join("")), t.innerHTML = Rc(n), r)
|
|
6997
7000
|
for (let i = 0; i < r.length; i++)
|
|
6998
7001
|
t = t.querySelector(r[i]) || t;
|
|
6999
7002
|
return t;
|
|
7000
7003
|
}
|
|
7001
|
-
function
|
|
7004
|
+
function zc(n) {
|
|
7002
7005
|
let e = n.querySelectorAll(te ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
7003
7006
|
for (let t = 0; t < e.length; t++) {
|
|
7004
7007
|
let o = e[t];
|
|
7005
7008
|
o.childNodes.length == 1 && o.textContent == " " && o.parentNode && o.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), o);
|
|
7006
7009
|
}
|
|
7007
7010
|
}
|
|
7008
|
-
function
|
|
7011
|
+
function Bc(n, e) {
|
|
7009
7012
|
if (!n.size)
|
|
7010
7013
|
return n;
|
|
7011
7014
|
let t = n.content.firstChild.type.schema, o;
|
|
@@ -7023,25 +7026,25 @@ function zc(n, e) {
|
|
|
7023
7026
|
}
|
|
7024
7027
|
return new E(r, i, s);
|
|
7025
7028
|
}
|
|
7026
|
-
const ie = {}, se = {},
|
|
7027
|
-
class
|
|
7029
|
+
const ie = {}, se = {}, Lc = { touchstart: !0, touchmove: !0 };
|
|
7030
|
+
class Vc {
|
|
7028
7031
|
constructor() {
|
|
7029
7032
|
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
|
|
7030
7033
|
}
|
|
7031
7034
|
}
|
|
7032
|
-
function
|
|
7035
|
+
function Fc(n) {
|
|
7033
7036
|
for (let e in ie) {
|
|
7034
7037
|
let t = ie[e];
|
|
7035
7038
|
n.dom.addEventListener(e, n.input.eventHandlers[e] = (o) => {
|
|
7036
|
-
|
|
7037
|
-
},
|
|
7039
|
+
Hc(n, o) && !Yn(n, o) && (n.editable || !(o.type in se)) && t(n, o);
|
|
7040
|
+
}, Lc[e] ? { passive: !0 } : void 0);
|
|
7038
7041
|
}
|
|
7039
7042
|
re && n.dom.addEventListener("input", () => null), zn(n);
|
|
7040
7043
|
}
|
|
7041
7044
|
function Fe(n, e) {
|
|
7042
7045
|
n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
|
|
7043
7046
|
}
|
|
7044
|
-
function
|
|
7047
|
+
function $c(n) {
|
|
7045
7048
|
n.domObserver.stop();
|
|
7046
7049
|
for (let e in n.input.eventHandlers)
|
|
7047
7050
|
n.dom.removeEventListener(e, n.input.eventHandlers[e]);
|
|
@@ -7059,7 +7062,7 @@ function Yn(n, e) {
|
|
|
7059
7062
|
return o ? o(n, e) || e.defaultPrevented : !1;
|
|
7060
7063
|
});
|
|
7061
7064
|
}
|
|
7062
|
-
function
|
|
7065
|
+
function Hc(n, e) {
|
|
7063
7066
|
if (!e.bubbles)
|
|
7064
7067
|
return !0;
|
|
7065
7068
|
if (e.defaultPrevented)
|
|
@@ -7069,7 +7072,7 @@ function $c(n, e) {
|
|
|
7069
7072
|
return !1;
|
|
7070
7073
|
return !0;
|
|
7071
7074
|
}
|
|
7072
|
-
function
|
|
7075
|
+
function qc(n, e) {
|
|
7073
7076
|
!Yn(n, e) && ie[e.type] && (n.editable || !(e.type in se)) && ie[e.type](n, e);
|
|
7074
7077
|
}
|
|
7075
7078
|
se.keydown = (n, e) => {
|
|
@@ -7080,7 +7083,7 @@ se.keydown = (n, e) => {
|
|
|
7080
7083
|
n.input.lastIOSEnter = o, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
7081
7084
|
n.input.lastIOSEnter == o && (n.someProp("handleKeyDown", (r) => r(n, Ue(13, "Enter"))), n.input.lastIOSEnter = 0);
|
|
7082
7085
|
}, 200);
|
|
7083
|
-
} else n.someProp("handleKeyDown", (o) => o(n, t)) ||
|
|
7086
|
+
} else n.someProp("handleKeyDown", (o) => o(n, t)) || Ic(n, t) ? t.preventDefault() : Fe(n, "key");
|
|
7084
7087
|
};
|
|
7085
7088
|
se.keyup = (n, e) => {
|
|
7086
7089
|
e.keyCode == 16 && (n.input.shiftKey = !1);
|
|
@@ -7102,7 +7105,7 @@ se.keypress = (n, e) => {
|
|
|
7102
7105
|
function sn(n) {
|
|
7103
7106
|
return { left: n.clientX, top: n.clientY };
|
|
7104
7107
|
}
|
|
7105
|
-
function
|
|
7108
|
+
function Wc(n, e) {
|
|
7106
7109
|
let t = e.x - n.clientX, o = e.y - n.clientY;
|
|
7107
7110
|
return t * t + o * o < 100;
|
|
7108
7111
|
}
|
|
@@ -7121,13 +7124,13 @@ function ht(n, e, t) {
|
|
|
7121
7124
|
let o = n.state.tr.setSelection(e);
|
|
7122
7125
|
o.setMeta("pointer", !0), n.dispatch(o);
|
|
7123
7126
|
}
|
|
7124
|
-
function
|
|
7127
|
+
function Jc(n, e) {
|
|
7125
7128
|
if (e == -1)
|
|
7126
7129
|
return !1;
|
|
7127
7130
|
let t = n.state.doc.resolve(e), o = t.nodeAfter;
|
|
7128
7131
|
return o && o.isAtom && T.isSelectable(o) ? (ht(n, new T(t)), !0) : !1;
|
|
7129
7132
|
}
|
|
7130
|
-
function
|
|
7133
|
+
function Kc(n, e) {
|
|
7131
7134
|
if (e == -1)
|
|
7132
7135
|
return !1;
|
|
7133
7136
|
let t = n.state.selection, o, r;
|
|
@@ -7142,16 +7145,16 @@ function Jc(n, e) {
|
|
|
7142
7145
|
}
|
|
7143
7146
|
return r != null ? (ht(n, T.create(n.state.doc, r)), !0) : !1;
|
|
7144
7147
|
}
|
|
7145
|
-
function
|
|
7146
|
-
return Gn(n, "handleClickOn", e, t, o) || n.someProp("handleClick", (i) => i(n, e, o)) || (r ?
|
|
7148
|
+
function Uc(n, e, t, o, r) {
|
|
7149
|
+
return Gn(n, "handleClickOn", e, t, o) || n.someProp("handleClick", (i) => i(n, e, o)) || (r ? Kc(n, t) : Jc(n, t));
|
|
7147
7150
|
}
|
|
7148
|
-
function
|
|
7151
|
+
function jc(n, e, t, o) {
|
|
7149
7152
|
return Gn(n, "handleDoubleClickOn", e, t, o) || n.someProp("handleDoubleClick", (r) => r(n, e, o));
|
|
7150
7153
|
}
|
|
7151
|
-
function
|
|
7152
|
-
return Gn(n, "handleTripleClickOn", e, t, o) || n.someProp("handleTripleClick", (r) => r(n, e, o)) ||
|
|
7154
|
+
function Yc(n, e, t, o) {
|
|
7155
|
+
return Gn(n, "handleTripleClickOn", e, t, o) || n.someProp("handleTripleClick", (r) => r(n, e, o)) || Gc(n, t, o);
|
|
7153
7156
|
}
|
|
7154
|
-
function
|
|
7157
|
+
function Gc(n, e, t) {
|
|
7155
7158
|
if (t.button != 0)
|
|
7156
7159
|
return !1;
|
|
7157
7160
|
let o = n.state.doc;
|
|
@@ -7177,11 +7180,11 @@ ie.mousedown = (n, e) => {
|
|
|
7177
7180
|
let t = e;
|
|
7178
7181
|
n.input.shiftKey = t.shiftKey;
|
|
7179
7182
|
let o = Xn(n), r = Date.now(), i = "singleClick";
|
|
7180
|
-
r - n.input.lastClick.time < 500 &&
|
|
7183
|
+
r - n.input.lastClick.time < 500 && Wc(t, n.input.lastClick) && !t[pi] && (n.input.lastClick.type == "singleClick" ? i = "doubleClick" : n.input.lastClick.type == "doubleClick" && (i = "tripleClick")), n.input.lastClick = { time: r, x: t.clientX, y: t.clientY, type: i };
|
|
7181
7184
|
let s = n.posAtCoords(sn(t));
|
|
7182
|
-
s && (i == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new
|
|
7185
|
+
s && (i == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Xc(n, s, t, !!o)) : (i == "doubleClick" ? jc : Yc)(n, s.pos, s.inside, t) ? t.preventDefault() : Fe(n, "pointer"));
|
|
7183
7186
|
};
|
|
7184
|
-
class
|
|
7187
|
+
class Xc {
|
|
7185
7188
|
constructor(e, t, o, r) {
|
|
7186
7189
|
this.view = e, this.pos = t, this.event = o, this.flushed = r, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!o[pi], this.allowDefault = o.shiftKey;
|
|
7187
7190
|
let i, s;
|
|
@@ -7210,7 +7213,7 @@ class Gc {
|
|
|
7210
7213
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
7211
7214
|
return;
|
|
7212
7215
|
let t = this.pos;
|
|
7213
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(sn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fe(this.view, "pointer") :
|
|
7216
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(sn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fe(this.view, "pointer") : Uc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
7214
7217
|
re && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
7215
7218
|
// cursor, but still report that the node is selected
|
|
7216
7219
|
// when asked through getSelection. You'll then get a
|
|
@@ -7237,7 +7240,7 @@ ie.contextmenu = (n) => Xn(n);
|
|
|
7237
7240
|
function mi(n, e) {
|
|
7238
7241
|
return n.composing ? !0 : re && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
7239
7242
|
}
|
|
7240
|
-
const
|
|
7243
|
+
const _c = Re ? 5e3 : -1;
|
|
7241
7244
|
se.compositionstart = se.compositionupdate = (n) => {
|
|
7242
7245
|
if (!n.composing) {
|
|
7243
7246
|
n.domObserver.flush();
|
|
@@ -7260,7 +7263,7 @@ se.compositionstart = se.compositionupdate = (n) => {
|
|
|
7260
7263
|
}
|
|
7261
7264
|
n.input.composing = !0;
|
|
7262
7265
|
}
|
|
7263
|
-
gi(n,
|
|
7266
|
+
gi(n, _c);
|
|
7264
7267
|
};
|
|
7265
7268
|
se.compositionend = (n, e) => {
|
|
7266
7269
|
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, gi(n, 20));
|
|
@@ -7269,14 +7272,14 @@ function gi(n, e) {
|
|
|
7269
7272
|
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => At(n), e));
|
|
7270
7273
|
}
|
|
7271
7274
|
function bi(n) {
|
|
7272
|
-
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt =
|
|
7275
|
+
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Qc()); n.input.compositionNodes.length > 0; )
|
|
7273
7276
|
n.input.compositionNodes.pop().markParentsDirty();
|
|
7274
7277
|
}
|
|
7275
|
-
function
|
|
7278
|
+
function Zc(n) {
|
|
7276
7279
|
let e = n.domSelectionRange();
|
|
7277
7280
|
if (!e.focusNode)
|
|
7278
7281
|
return null;
|
|
7279
|
-
let t =
|
|
7282
|
+
let t = Ja(e.focusNode, e.focusOffset), o = Ka(e.focusNode, e.focusOffset);
|
|
7280
7283
|
if (t && o && t != o) {
|
|
7281
7284
|
let r = o.pmViewDesc, i = n.domObserver.lastChangedTextNode;
|
|
7282
7285
|
if (t == i || o == i)
|
|
@@ -7291,7 +7294,7 @@ function _c(n) {
|
|
|
7291
7294
|
}
|
|
7292
7295
|
return t || o;
|
|
7293
7296
|
}
|
|
7294
|
-
function
|
|
7297
|
+
function Qc() {
|
|
7295
7298
|
let n = document.createEvent("Event");
|
|
7296
7299
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
7297
7300
|
}
|
|
@@ -7304,7 +7307,7 @@ function At(n, e = !1) {
|
|
|
7304
7307
|
return !1;
|
|
7305
7308
|
}
|
|
7306
7309
|
}
|
|
7307
|
-
function
|
|
7310
|
+
function ed(n, e) {
|
|
7308
7311
|
if (!n.dom.parentNode)
|
|
7309
7312
|
return;
|
|
7310
7313
|
let t = n.dom.parentNode.appendChild(document.createElement("div"));
|
|
@@ -7314,18 +7317,18 @@ function Qc(n, e) {
|
|
|
7314
7317
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
7315
7318
|
}, 50);
|
|
7316
7319
|
}
|
|
7317
|
-
const Et = ae && He < 15 || gt &&
|
|
7320
|
+
const Et = ae && He < 15 || gt && Xa < 604;
|
|
7318
7321
|
ie.copy = se.cut = (n, e) => {
|
|
7319
7322
|
let t = e, o = n.state.selection, r = t.type == "cut";
|
|
7320
7323
|
if (o.empty)
|
|
7321
7324
|
return;
|
|
7322
7325
|
let i = Et ? null : t.clipboardData, s = o.content(), { dom: l, text: a } = Un(n, s);
|
|
7323
|
-
i ? (t.preventDefault(), i.clearData(), i.setData("text/html", l.innerHTML), i.setData("text/plain", a)) :
|
|
7326
|
+
i ? (t.preventDefault(), i.clearData(), i.setData("text/html", l.innerHTML), i.setData("text/plain", a)) : ed(n, l), r && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
7324
7327
|
};
|
|
7325
|
-
function
|
|
7328
|
+
function td(n) {
|
|
7326
7329
|
return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
|
|
7327
7330
|
}
|
|
7328
|
-
function
|
|
7331
|
+
function nd(n, e) {
|
|
7329
7332
|
if (!n.dom.parentNode)
|
|
7330
7333
|
return;
|
|
7331
7334
|
let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, o = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
|
|
@@ -7341,7 +7344,7 @@ function Rt(n, e, t, o, r) {
|
|
|
7341
7344
|
return !0;
|
|
7342
7345
|
if (!i)
|
|
7343
7346
|
return !1;
|
|
7344
|
-
let s =
|
|
7347
|
+
let s = td(i), l = s ? n.state.tr.replaceSelectionWith(s, o) : n.state.tr.replaceSelection(i);
|
|
7345
7348
|
return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
7346
7349
|
}
|
|
7347
7350
|
function yi(n) {
|
|
@@ -7356,7 +7359,7 @@ se.paste = (n, e) => {
|
|
|
7356
7359
|
if (n.composing && !Re)
|
|
7357
7360
|
return;
|
|
7358
7361
|
let o = Et ? null : t.clipboardData, r = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
7359
|
-
o && Rt(n, yi(o), o.getData("text/html"), r, t) ? t.preventDefault() :
|
|
7362
|
+
o && Rt(n, yi(o), o.getData("text/html"), r, t) ? t.preventDefault() : nd(n, t);
|
|
7360
7363
|
};
|
|
7361
7364
|
class ki {
|
|
7362
7365
|
constructor(e, t, o) {
|
|
@@ -7406,7 +7409,7 @@ se.drop = (n, e) => {
|
|
|
7406
7409
|
if (!s)
|
|
7407
7410
|
return;
|
|
7408
7411
|
t.preventDefault();
|
|
7409
|
-
let a = s ?
|
|
7412
|
+
let a = s ? La(n.state.doc, i.pos, s) : i.pos;
|
|
7410
7413
|
a == null && (a = i.pos);
|
|
7411
7414
|
let c = n.state.tr;
|
|
7412
7415
|
if (l) {
|
|
@@ -7644,7 +7647,7 @@ class G {
|
|
|
7644
7647
|
let a = this.local[l].map(e, o, r);
|
|
7645
7648
|
a && a.type.valid(t, a) ? (s || (s = [])).push(a) : i.onRemove && i.onRemove(this.local[l].spec);
|
|
7646
7649
|
}
|
|
7647
|
-
return this.children.length ?
|
|
7650
|
+
return this.children.length ? od(this.children, s || [], e, t, o, r, i) : s ? new G(s.sort(et), ct) : ee;
|
|
7648
7651
|
}
|
|
7649
7652
|
/**
|
|
7650
7653
|
Add the given array of decorations to the ones in the set,
|
|
@@ -7822,7 +7825,7 @@ class Ve {
|
|
|
7822
7825
|
this.members[t].forEachSet(e);
|
|
7823
7826
|
}
|
|
7824
7827
|
}
|
|
7825
|
-
function
|
|
7828
|
+
function od(n, e, t, o, r, i, s) {
|
|
7826
7829
|
let l = n.slice();
|
|
7827
7830
|
for (let c = 0, d = i; c < t.maps.length; c++) {
|
|
7828
7831
|
let u = 0;
|
|
@@ -7858,7 +7861,7 @@ function nd(n, e, t, o, r, i, s) {
|
|
|
7858
7861
|
a = !0;
|
|
7859
7862
|
}
|
|
7860
7863
|
if (a) {
|
|
7861
|
-
let c =
|
|
7864
|
+
let c = rd(l, n, e, t, r, i, s), d = tn(c, o, 0, s);
|
|
7862
7865
|
e = d.local;
|
|
7863
7866
|
for (let u = 0; u < l.length; u += 3)
|
|
7864
7867
|
l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
|
|
@@ -7881,7 +7884,7 @@ function Ci(n, e) {
|
|
|
7881
7884
|
}
|
|
7882
7885
|
return t;
|
|
7883
7886
|
}
|
|
7884
|
-
function
|
|
7887
|
+
function rd(n, e, t, o, r, i, s) {
|
|
7885
7888
|
function l(a, c) {
|
|
7886
7889
|
for (let d = 0; d < a.local.length; d++) {
|
|
7887
7890
|
let u = a.local[d].map(o, r, c);
|
|
@@ -7956,15 +7959,15 @@ function kn(n) {
|
|
|
7956
7959
|
o && o != ee && e.push(o);
|
|
7957
7960
|
}), n.cursorWrapper && e.push(G.create(n.state.doc, [n.cursorWrapper.deco])), Ve.from(e);
|
|
7958
7961
|
}
|
|
7959
|
-
const
|
|
7962
|
+
const id = {
|
|
7960
7963
|
childList: !0,
|
|
7961
7964
|
characterData: !0,
|
|
7962
7965
|
characterDataOldValue: !0,
|
|
7963
7966
|
attributes: !0,
|
|
7964
7967
|
attributeOldValue: !0,
|
|
7965
7968
|
subtree: !0
|
|
7966
|
-
},
|
|
7967
|
-
class
|
|
7969
|
+
}, sd = ae && He <= 11;
|
|
7970
|
+
class ld {
|
|
7968
7971
|
constructor() {
|
|
7969
7972
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
7970
7973
|
}
|
|
@@ -7978,13 +7981,13 @@ class sd {
|
|
|
7978
7981
|
return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
|
|
7979
7982
|
}
|
|
7980
7983
|
}
|
|
7981
|
-
class
|
|
7984
|
+
class ad {
|
|
7982
7985
|
constructor(e, t) {
|
|
7983
|
-
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new
|
|
7986
|
+
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new ld(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
|
|
7984
7987
|
for (let r = 0; r < o.length; r++)
|
|
7985
7988
|
this.queue.push(o[r]);
|
|
7986
7989
|
ae && He <= 11 && o.some((r) => r.type == "childList" && r.removedNodes.length || r.type == "characterData" && r.oldValue.length > r.target.nodeValue.length) ? this.flushSoon() : this.flush();
|
|
7987
|
-
}),
|
|
7990
|
+
}), sd && (this.onCharData = (o) => {
|
|
7988
7991
|
this.queue.push({ target: o.target, type: "characterData", oldValue: o.prevValue }), this.flushSoon();
|
|
7989
7992
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
7990
7993
|
}
|
|
@@ -7997,7 +8000,7 @@ class ld {
|
|
|
7997
8000
|
this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
|
|
7998
8001
|
}
|
|
7999
8002
|
start() {
|
|
8000
|
-
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom,
|
|
8003
|
+
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, id)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
|
|
8001
8004
|
}
|
|
8002
8005
|
stop() {
|
|
8003
8006
|
if (this.observer) {
|
|
@@ -8080,12 +8083,12 @@ class ld {
|
|
|
8080
8083
|
let { focusNode: u } = this.currentSelection;
|
|
8081
8084
|
for (let f of d) {
|
|
8082
8085
|
let m = f.parentNode;
|
|
8083
|
-
m && m.nodeName == "LI" && (!u ||
|
|
8086
|
+
m && m.nodeName == "LI" && (!u || ud(e, u) != m) && f.remove();
|
|
8084
8087
|
}
|
|
8085
8088
|
}
|
|
8086
8089
|
}
|
|
8087
8090
|
let c = null;
|
|
8088
|
-
i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && on(o) && (c = Jn(e)) && c.eq(q.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Pe(e), this.currentSelection.set(o)) : (i > -1 || r) && (i > -1 && (e.docView.markDirty(i, s),
|
|
8091
|
+
i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && on(o) && (c = Jn(e)) && c.eq(q.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Pe(e), this.currentSelection.set(o)) : (i > -1 || r) && (i > -1 && (e.docView.markDirty(i, s), cd(e)), this.handleDOMChange(i, s, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(o) || Pe(e), this.currentSelection.set(o));
|
|
8089
8092
|
}
|
|
8090
8093
|
registerMutation(e, t) {
|
|
8091
8094
|
if (t.indexOf(e.target) > -1)
|
|
@@ -8121,7 +8124,7 @@ class ld {
|
|
|
8121
8124
|
}
|
|
8122
8125
|
}
|
|
8123
8126
|
let Fo = /* @__PURE__ */ new WeakMap(), $o = !1;
|
|
8124
|
-
function
|
|
8127
|
+
function cd(n) {
|
|
8125
8128
|
if (!Fo.has(n) && (Fo.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
8126
8129
|
if (n.requiresGeckoHackNode = ke, $o)
|
|
8127
8130
|
return;
|
|
@@ -8132,7 +8135,7 @@ function Ho(n, e) {
|
|
|
8132
8135
|
let t = e.startContainer, o = e.startOffset, r = e.endContainer, i = e.endOffset, s = n.domAtPos(n.state.selection.anchor);
|
|
8133
8136
|
return tt(s.node, s.offset, r, i) && ([t, o, r, i] = [r, i, t, o]), { anchorNode: t, anchorOffset: o, focusNode: r, focusOffset: i };
|
|
8134
8137
|
}
|
|
8135
|
-
function
|
|
8138
|
+
function dd(n, e) {
|
|
8136
8139
|
if (e.getComposedRanges) {
|
|
8137
8140
|
let r = e.getComposedRanges(n.root)[0];
|
|
8138
8141
|
if (r)
|
|
@@ -8144,7 +8147,7 @@ function cd(n, e) {
|
|
|
8144
8147
|
}
|
|
8145
8148
|
return n.dom.addEventListener("beforeinput", o, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", o, !0), t ? Ho(n, t) : null;
|
|
8146
8149
|
}
|
|
8147
|
-
function
|
|
8150
|
+
function ud(n, e) {
|
|
8148
8151
|
for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
|
|
8149
8152
|
let o = n.docView.nearestDesc(t, !0);
|
|
8150
8153
|
if (o && o.node.isBlock)
|
|
@@ -8152,7 +8155,7 @@ function dd(n, e) {
|
|
|
8152
8155
|
}
|
|
8153
8156
|
return null;
|
|
8154
8157
|
}
|
|
8155
|
-
function
|
|
8158
|
+
function hd(n, e, t) {
|
|
8156
8159
|
let { node: o, fromOffset: r, toOffset: i, from: s, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
|
|
8157
8160
|
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], on(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), te && n.input.lastKeyCode === 8)
|
|
8158
8161
|
for (let g = i; g > r; g--) {
|
|
@@ -8172,7 +8175,7 @@ function ud(n, e, t) {
|
|
|
8172
8175
|
to: i,
|
|
8173
8176
|
preserveWhitespace: m.parent.type.whitespace == "pre" ? "full" : !0,
|
|
8174
8177
|
findPositions: c,
|
|
8175
|
-
ruleFromNode:
|
|
8178
|
+
ruleFromNode: fd,
|
|
8176
8179
|
context: m
|
|
8177
8180
|
});
|
|
8178
8181
|
if (c && c[0].pos != null) {
|
|
@@ -8181,7 +8184,7 @@ function ud(n, e, t) {
|
|
|
8181
8184
|
}
|
|
8182
8185
|
return { doc: b, sel: p, from: s, to: l };
|
|
8183
8186
|
}
|
|
8184
|
-
function
|
|
8187
|
+
function fd(n) {
|
|
8185
8188
|
let e = n.pmViewDesc;
|
|
8186
8189
|
if (e)
|
|
8187
8190
|
return e.parseRule();
|
|
@@ -8195,8 +8198,8 @@ function hd(n) {
|
|
|
8195
8198
|
return { ignore: !0 };
|
|
8196
8199
|
return null;
|
|
8197
8200
|
}
|
|
8198
|
-
const
|
|
8199
|
-
function
|
|
8201
|
+
const pd = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
8202
|
+
function md(n, e, t, o, r) {
|
|
8200
8203
|
let i = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
|
|
8201
8204
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
8202
8205
|
let N = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, X = Jn(n, N);
|
|
@@ -8210,10 +8213,10 @@ function pd(n, e, t, o, r) {
|
|
|
8210
8213
|
}
|
|
8211
8214
|
let s = n.state.doc.resolve(e), l = s.sharedDepth(t);
|
|
8212
8215
|
e = s.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
|
|
8213
|
-
let a = n.state.selection, c =
|
|
8216
|
+
let a = n.state.selection, c = hd(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, m;
|
|
8214
8217
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, m = "end") : (f = n.state.selection.from, m = "start"), n.input.lastKeyCode = null;
|
|
8215
|
-
let p =
|
|
8216
|
-
if (p && n.input.domChangeCount++, (gt && n.input.lastIOSEnter > Date.now() - 225 || Re) && r.some((N) => N.nodeType == 1 && !
|
|
8218
|
+
let p = yd(u.content, c.doc.content, c.from, f, m);
|
|
8219
|
+
if (p && n.input.domChangeCount++, (gt && n.input.lastIOSEnter > Date.now() - 225 || Re) && r.some((N) => N.nodeType == 1 && !pd.test(N.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (N) => N(n, Ue(13, "Enter")))) {
|
|
8217
8220
|
n.input.lastIOSEnter = 0;
|
|
8218
8221
|
return;
|
|
8219
8222
|
}
|
|
@@ -8236,7 +8239,7 @@ function pd(n, e, t, o, r) {
|
|
|
8236
8239
|
n.input.lastIOSEnter = 0;
|
|
8237
8240
|
return;
|
|
8238
8241
|
}
|
|
8239
|
-
if (n.state.selection.anchor > p.start &&
|
|
8242
|
+
if (n.state.selection.anchor > p.start && bd(d, p.start, p.endA, b, g) && n.someProp("handleKeyDown", (N) => N(n, Ue(8, "Backspace")))) {
|
|
8240
8243
|
Re && te && n.domObserver.suppressSelectionUpdates();
|
|
8241
8244
|
return;
|
|
8242
8245
|
}
|
|
@@ -8251,7 +8254,7 @@ function pd(n, e, t, o, r) {
|
|
|
8251
8254
|
ae && He <= 11 && b.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Pe(n), 20)), M = n.state.tr.delete(k, I), v = d.resolve(p.start).marksAcross(d.resolve(p.endA));
|
|
8252
8255
|
else if (
|
|
8253
8256
|
// Adding or removing a mark
|
|
8254
|
-
p.endA == p.endB && (w =
|
|
8257
|
+
p.endA == p.endB && (w = gd(b.parent.content.cut(b.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
|
|
8255
8258
|
)
|
|
8256
8259
|
M = n.state.tr, w.type == "add" ? M.addMark(k, I, w.mark) : M.removeMark(k, I, w.mark);
|
|
8257
8260
|
else if (b.parent.child(b.index()).isText && b.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
@@ -8270,7 +8273,7 @@ function pd(n, e, t, o, r) {
|
|
|
8270
8273
|
function qo(n, e, t) {
|
|
8271
8274
|
return Math.max(t.anchor, t.head) > e.content.size ? null : Kn(n, e.resolve(t.anchor), e.resolve(t.head));
|
|
8272
8275
|
}
|
|
8273
|
-
function
|
|
8276
|
+
function gd(n, e) {
|
|
8274
8277
|
let t = n.firstChild.marks, o = e.firstChild.marks, r = t, i = o, s, l, a;
|
|
8275
8278
|
for (let d = 0; d < o.length; d++)
|
|
8276
8279
|
r = o[d].removeFromSet(r);
|
|
@@ -8288,7 +8291,7 @@ function md(n, e) {
|
|
|
8288
8291
|
if (A.from(c).eq(n))
|
|
8289
8292
|
return { mark: l, type: s };
|
|
8290
8293
|
}
|
|
8291
|
-
function
|
|
8294
|
+
function bd(n, e, t, o, r) {
|
|
8292
8295
|
if (
|
|
8293
8296
|
// The content must have shrunk
|
|
8294
8297
|
t - e <= r.pos - o.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
@@ -8316,7 +8319,7 @@ function xn(n, e, t) {
|
|
|
8316
8319
|
}
|
|
8317
8320
|
return r;
|
|
8318
8321
|
}
|
|
8319
|
-
function
|
|
8322
|
+
function yd(n, e, t, o, r) {
|
|
8320
8323
|
let i = n.findDiffStart(e, t);
|
|
8321
8324
|
if (i == null)
|
|
8322
8325
|
return null;
|
|
@@ -8340,8 +8343,8 @@ function Wo(n) {
|
|
|
8340
8343
|
let e = n.charCodeAt(0), t = n.charCodeAt(1);
|
|
8341
8344
|
return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
|
|
8342
8345
|
}
|
|
8343
|
-
const
|
|
8344
|
-
class
|
|
8346
|
+
const kd = jn, xd = At;
|
|
8347
|
+
class Cd {
|
|
8345
8348
|
/**
|
|
8346
8349
|
Create a view. `place` may be a DOM node that the editor should
|
|
8347
8350
|
be appended to, a function that will place it into the document,
|
|
@@ -8350,7 +8353,7 @@ class xd {
|
|
|
8350
8353
|
added to the document.
|
|
8351
8354
|
*/
|
|
8352
8355
|
constructor(e, t) {
|
|
8353
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new
|
|
8356
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Vc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Yo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Uo(this), Ko(this), this.nodeViews = jo(this), this.docView = To(this.state.doc, Jo(this), kn(this), this.dom, this), this.domObserver = new ad(this, (o, r, i, s) => md(this, o, r, i, s)), this.domObserver.start(), Fc(this), this.updatePluginViews();
|
|
8354
8357
|
}
|
|
8355
8358
|
/**
|
|
8356
8359
|
Holds `true` when a
|
|
@@ -8410,22 +8413,22 @@ class xd {
|
|
|
8410
8413
|
let l = r.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
8411
8414
|
if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
8412
8415
|
let m = jo(this);
|
|
8413
|
-
|
|
8416
|
+
Nd(m, this.nodeViews) && (this.nodeViews = m, i = !0);
|
|
8414
8417
|
}
|
|
8415
8418
|
(l || t.handleDOMEvents != this._props.handleDOMEvents) && zn(this), this.editable = Uo(this), Ko(this);
|
|
8416
8419
|
let a = kn(this), c = Jo(this), d = r.plugins != e.plugins && !r.doc.eq(e.doc) ? "reset" : e.scrollToSelection > r.scrollToSelection ? "to selection" : "preserve", u = i || !this.docView.matchesNode(e.doc, c, a);
|
|
8417
8420
|
(u || !e.selection.eq(r.selection)) && (s = !0);
|
|
8418
|
-
let f = d == "preserve" && s && this.dom.style.overflowAnchor == null &&
|
|
8421
|
+
let f = d == "preserve" && s && this.dom.style.overflowAnchor == null && Qa(this);
|
|
8419
8422
|
if (s) {
|
|
8420
8423
|
this.domObserver.stop();
|
|
8421
|
-
let m = u && (ae || te) && !this.composing && !r.selection.empty && !e.selection.empty &&
|
|
8424
|
+
let m = u && (ae || te) && !this.composing && !r.selection.empty && !e.selection.empty && Sd(r.selection, e.selection);
|
|
8422
8425
|
if (u) {
|
|
8423
8426
|
let p = te ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
8424
|
-
this.composing && (this.input.compositionNode =
|
|
8427
|
+
this.composing && (this.input.compositionNode = Zc(this)), (i || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = To(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (m = !0);
|
|
8425
8428
|
}
|
|
8426
|
-
m || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) &&
|
|
8429
|
+
m || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Nc(this)) ? Pe(this, m) : (si(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
8427
8430
|
}
|
|
8428
|
-
this.updatePluginViews(r), !((o = this.dragging) === null || o === void 0) && o.node && !r.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, r), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f &&
|
|
8431
|
+
this.updatePluginViews(r), !((o = this.dragging) === null || o === void 0) && o.node && !r.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, r), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && ec(f);
|
|
8429
8432
|
}
|
|
8430
8433
|
/**
|
|
8431
8434
|
@internal
|
|
@@ -8512,7 +8515,7 @@ class xd {
|
|
|
8512
8515
|
Focus the editor.
|
|
8513
8516
|
*/
|
|
8514
8517
|
focus() {
|
|
8515
|
-
this.domObserver.stop(), this.editable &&
|
|
8518
|
+
this.domObserver.stop(), this.editable && tc(this.dom), Pe(this), this.domObserver.start();
|
|
8516
8519
|
}
|
|
8517
8520
|
/**
|
|
8518
8521
|
Get the document root in which the editor exists. This will
|
|
@@ -8546,7 +8549,7 @@ class xd {
|
|
|
8546
8549
|
the top level, not in any node.
|
|
8547
8550
|
*/
|
|
8548
8551
|
posAtCoords(e) {
|
|
8549
|
-
return
|
|
8552
|
+
return sc(this, e);
|
|
8550
8553
|
}
|
|
8551
8554
|
/**
|
|
8552
8555
|
Returns the viewport rectangle at a given document position.
|
|
@@ -8611,7 +8614,7 @@ class xd {
|
|
|
8611
8614
|
pass a different state.
|
|
8612
8615
|
*/
|
|
8613
8616
|
endOfTextblock(e, t) {
|
|
8614
|
-
return
|
|
8617
|
+
return uc(this, t || this.state, e);
|
|
8615
8618
|
}
|
|
8616
8619
|
/**
|
|
8617
8620
|
Run the editor's paste logic with the given HTML string. The
|
|
@@ -8643,7 +8646,7 @@ class xd {
|
|
|
8643
8646
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
8644
8647
|
*/
|
|
8645
8648
|
destroy() {
|
|
8646
|
-
this.docView && (
|
|
8649
|
+
this.docView && ($c(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], kn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, qa());
|
|
8647
8650
|
}
|
|
8648
8651
|
/**
|
|
8649
8652
|
This is true when the view has been
|
|
@@ -8657,7 +8660,7 @@ class xd {
|
|
|
8657
8660
|
Used for testing.
|
|
8658
8661
|
*/
|
|
8659
8662
|
dispatchEvent(e) {
|
|
8660
|
-
return
|
|
8663
|
+
return qc(this, e);
|
|
8661
8664
|
}
|
|
8662
8665
|
/**
|
|
8663
8666
|
Dispatch a transaction. Will call
|
|
@@ -8677,7 +8680,7 @@ class xd {
|
|
|
8677
8680
|
*/
|
|
8678
8681
|
domSelectionRange() {
|
|
8679
8682
|
let e = this.domSelection();
|
|
8680
|
-
return e ? re && this.root.nodeType === 11 &&
|
|
8683
|
+
return e ? re && this.root.nodeType === 11 && ja(this.dom.ownerDocument) == this.dom && dd(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
8681
8684
|
}
|
|
8682
8685
|
/**
|
|
8683
8686
|
@internal
|
|
@@ -8704,7 +8707,7 @@ function Ko(n) {
|
|
|
8704
8707
|
function Uo(n) {
|
|
8705
8708
|
return !n.someProp("editable", (e) => e(n.state) === !1);
|
|
8706
8709
|
}
|
|
8707
|
-
function
|
|
8710
|
+
function Sd(n, e) {
|
|
8708
8711
|
let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
|
|
8709
8712
|
return n.$anchor.start(t) != e.$anchor.start(t);
|
|
8710
8713
|
}
|
|
@@ -8716,7 +8719,7 @@ function jo(n) {
|
|
|
8716
8719
|
}
|
|
8717
8720
|
return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
|
|
8718
8721
|
}
|
|
8719
|
-
function
|
|
8722
|
+
function Nd(n, e) {
|
|
8720
8723
|
let t = 0, o = 0;
|
|
8721
8724
|
for (let r in n) {
|
|
8722
8725
|
if (n[r] != e[r])
|
|
@@ -8731,30 +8734,30 @@ function Yo(n) {
|
|
|
8731
8734
|
if (n.spec.state || n.spec.filterTransaction || n.spec.appendTransaction)
|
|
8732
8735
|
throw new RangeError("Plugins passed directly to the view must not have a state component");
|
|
8733
8736
|
}
|
|
8734
|
-
const
|
|
8737
|
+
const Td = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8735
8738
|
__proto__: null,
|
|
8736
8739
|
Decoration: me,
|
|
8737
8740
|
DecorationSet: G,
|
|
8738
|
-
EditorView:
|
|
8739
|
-
__endComposition:
|
|
8740
|
-
__parseFromClipboard:
|
|
8741
|
+
EditorView: Cd,
|
|
8742
|
+
__endComposition: xd,
|
|
8743
|
+
__parseFromClipboard: kd
|
|
8741
8744
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8742
|
-
function
|
|
8745
|
+
function wd() {
|
|
8743
8746
|
try {
|
|
8744
|
-
return
|
|
8747
|
+
return Td;
|
|
8745
8748
|
} catch {
|
|
8746
8749
|
return null;
|
|
8747
8750
|
}
|
|
8748
8751
|
}
|
|
8749
|
-
function
|
|
8752
|
+
function Dd(n, e) {
|
|
8750
8753
|
if (n && typeof n.serializeForClipboard == "function")
|
|
8751
8754
|
return n.serializeForClipboard(e);
|
|
8752
|
-
const t =
|
|
8755
|
+
const t = wd();
|
|
8753
8756
|
if (t && typeof (t == null ? void 0 : t.__serializeForClipboard) == "function")
|
|
8754
8757
|
return t.__serializeForClipboard(n, e);
|
|
8755
8758
|
throw new Error("No supported clipboard serialization method found.");
|
|
8756
8759
|
}
|
|
8757
|
-
function
|
|
8760
|
+
function Md(n) {
|
|
8758
8761
|
const e = n.getBoundingClientRect(), t = n.closest('[role="dialog"]'), o = n.closest(".ProseMirror"), r = o == null ? void 0 : o.getBoundingClientRect(), i = window.pageXOffset || document.documentElement.scrollLeft, s = window.pageYOffset || document.documentElement.scrollTop;
|
|
8759
8762
|
if (t && window.getComputedStyle(t).transform !== "none") {
|
|
8760
8763
|
const l = t.getBoundingClientRect();
|
|
@@ -8803,7 +8806,7 @@ function Ut(n, e) {
|
|
|
8803
8806
|
const t = e.state.doc.resolve(n);
|
|
8804
8807
|
return t.depth > 1 ? t.before(t.depth) : n;
|
|
8805
8808
|
}
|
|
8806
|
-
function
|
|
8809
|
+
function Od(n) {
|
|
8807
8810
|
let e = "", t = !1;
|
|
8808
8811
|
function o(d, u) {
|
|
8809
8812
|
if (u.focus(), !d.dataTransfer) return;
|
|
@@ -8842,7 +8845,7 @@ function Md(n) {
|
|
|
8842
8845
|
k = T.create(u.state.doc, w.before());
|
|
8843
8846
|
}
|
|
8844
8847
|
u.dispatch(u.state.tr.setSelection(k)), u.state.selection instanceof T && u.state.selection.node.type.name === "listItem" && (e = f.parentElement.tagName);
|
|
8845
|
-
const I = u.state.selection.content(), { dom: M, text: v } =
|
|
8848
|
+
const I = u.state.selection.content(), { dom: M, text: v } = Dd(u, I);
|
|
8846
8849
|
d.dataTransfer.clearData(), d.dataTransfer.setData("text/html", M.innerHTML), d.dataTransfer.setData("text/plain", v), d.dataTransfer.effectAllowed = "copyMove", d.dataTransfer.setDragImage(f, 0, 0), u.dragging = { slice: I, move: d.ctrlKey };
|
|
8847
8850
|
}
|
|
8848
8851
|
let r = null;
|
|
@@ -8878,8 +8881,8 @@ function Md(n) {
|
|
|
8878
8881
|
const f = u.closest(".drag-handle") || u.classList.contains("drag-handle"), m = u.closest(".tiptap") || u.classList.contains("tiptap");
|
|
8879
8882
|
!f && !m && !t && i();
|
|
8880
8883
|
}
|
|
8881
|
-
return new
|
|
8882
|
-
key: new
|
|
8884
|
+
return new $a({
|
|
8885
|
+
key: new Ha(n.pluginKey),
|
|
8883
8886
|
view: (d) => {
|
|
8884
8887
|
var b, g, y, C;
|
|
8885
8888
|
const u = n.dragHandleSelector ? document.querySelector(n.dragHandleSelector) : null;
|
|
@@ -8935,7 +8938,7 @@ function Md(n) {
|
|
|
8935
8938
|
b != null && b >= 0 && (r.dataset.nodePos = String(
|
|
8936
8939
|
Ut(b, d)
|
|
8937
8940
|
));
|
|
8938
|
-
const g = window.getComputedStyle(f), y = parseInt(g.lineHeight, 10), C = isNaN(y) ? parseInt(g.fontSize) * 1.2 : y, O = parseInt(g.paddingTop, 10), k =
|
|
8941
|
+
const g = window.getComputedStyle(f), y = parseInt(g.lineHeight, 10), C = isNaN(y) ? parseInt(g.fontSize) * 1.2 : y, O = parseInt(g.paddingTop, 10), k = Md(f);
|
|
8939
8942
|
k.top += (C - 24) / 2, k.top += O, f.matches("ul:not([data-type=taskList]) li, ol li") && (k.left -= n.dragHandleWidth - 28), k.width = n.dragHandleWidth, r && (r.style.position = "absolute", r.style.left = `${k.left - k.width}px`, r.style.top = `${k.top}px`, s());
|
|
8940
8943
|
},
|
|
8941
8944
|
keydown: () => {
|
|
@@ -8995,7 +8998,7 @@ function Md(n) {
|
|
|
8995
8998
|
}
|
|
8996
8999
|
});
|
|
8997
9000
|
}
|
|
8998
|
-
const
|
|
9001
|
+
const vd = zl.create({
|
|
8999
9002
|
name: "globalDragHandle",
|
|
9000
9003
|
addOptions() {
|
|
9001
9004
|
return {
|
|
@@ -9007,7 +9010,7 @@ const Od = Pl.create({
|
|
|
9007
9010
|
},
|
|
9008
9011
|
addProseMirrorPlugins() {
|
|
9009
9012
|
return [
|
|
9010
|
-
|
|
9013
|
+
Od({
|
|
9011
9014
|
pluginKey: "globalDragHandle",
|
|
9012
9015
|
dragHandleWidth: this.options.dragHandleWidth,
|
|
9013
9016
|
scrollTreshold: this.options.scrollTreshold,
|
|
@@ -9017,18 +9020,18 @@ const Od = Pl.create({
|
|
|
9017
9020
|
})
|
|
9018
9021
|
];
|
|
9019
9022
|
}
|
|
9020
|
-
}),
|
|
9023
|
+
}), Id = ll, Ad = Gs.configure({
|
|
9021
9024
|
placeholder: "撰写任何内容,或者按“/”输入命令..."
|
|
9022
|
-
}),
|
|
9025
|
+
}), Ed = Xs.configure({
|
|
9023
9026
|
HTMLAttributes: {
|
|
9024
9027
|
class: le(
|
|
9025
9028
|
"text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
|
|
9026
9029
|
)
|
|
9027
9030
|
}
|
|
9028
|
-
}),
|
|
9031
|
+
}), Rd = _s.extend({
|
|
9029
9032
|
addProseMirrorPlugins() {
|
|
9030
9033
|
return [
|
|
9031
|
-
|
|
9034
|
+
Zs({
|
|
9032
9035
|
imageClass: le("opacity-40 rounded-lg border border-stone-200")
|
|
9033
9036
|
})
|
|
9034
9037
|
];
|
|
@@ -9038,24 +9041,24 @@ const Od = Pl.create({
|
|
|
9038
9041
|
HTMLAttributes: {
|
|
9039
9042
|
class: le("rounded-lg border border-muted")
|
|
9040
9043
|
}
|
|
9041
|
-
}),
|
|
9044
|
+
}), Pd = Qs.configure({
|
|
9042
9045
|
HTMLAttributes: {
|
|
9043
9046
|
class: le("rounded-lg border border-muted")
|
|
9044
9047
|
}
|
|
9045
|
-
}),
|
|
9048
|
+
}), zd = el.configure({
|
|
9046
9049
|
HTMLAttributes: {
|
|
9047
9050
|
class: le("not-prose pl-2 ")
|
|
9048
9051
|
}
|
|
9049
|
-
}),
|
|
9052
|
+
}), Bd = tl.configure({
|
|
9050
9053
|
HTMLAttributes: {
|
|
9051
9054
|
class: le("flex gap-2 items-start my-4")
|
|
9052
9055
|
},
|
|
9053
9056
|
nested: !0
|
|
9054
|
-
}),
|
|
9057
|
+
}), Ld = nl.configure({
|
|
9055
9058
|
HTMLAttributes: {
|
|
9056
9059
|
class: le("mt-4 mb-6 border-t border-muted-foreground")
|
|
9057
9060
|
}
|
|
9058
|
-
}),
|
|
9061
|
+
}), Vd = ol.configure({
|
|
9059
9062
|
bulletList: {
|
|
9060
9063
|
HTMLAttributes: {
|
|
9061
9064
|
class: le("list-disc list-outside leading-3 -mt-2")
|
|
@@ -9095,18 +9098,18 @@ const Od = Pl.create({
|
|
|
9095
9098
|
width: 4
|
|
9096
9099
|
},
|
|
9097
9100
|
gapcursor: !1
|
|
9098
|
-
}),
|
|
9101
|
+
}), Fd = rl.configure({
|
|
9099
9102
|
// configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
|
|
9100
9103
|
// common: covers 37 language grammars which should be good enough in most cases
|
|
9101
|
-
lowlight:
|
|
9102
|
-
}),
|
|
9104
|
+
lowlight: Rl(Pl)
|
|
9105
|
+
}), $d = il.configure({
|
|
9103
9106
|
HTMLAttributes: {
|
|
9104
9107
|
class: le("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
|
|
9105
9108
|
},
|
|
9106
9109
|
katexOptions: {
|
|
9107
9110
|
throwOnError: !1
|
|
9108
9111
|
}
|
|
9109
|
-
}),
|
|
9112
|
+
}), Hd = sl.configure(), qd = Al.configure({
|
|
9110
9113
|
html: !0,
|
|
9111
9114
|
tightLists: !0,
|
|
9112
9115
|
tightListClass: "tight",
|
|
@@ -9115,30 +9118,30 @@ const Od = Pl.create({
|
|
|
9115
9118
|
breaks: !1,
|
|
9116
9119
|
transformPastedText: !1,
|
|
9117
9120
|
transformCopiedText: !1
|
|
9118
|
-
}),
|
|
9121
|
+
}), Wd = vd.configure({
|
|
9119
9122
|
dragHandleWidth: 56,
|
|
9120
9123
|
dragHandleSelector: ".custom-drag-handle"
|
|
9121
9124
|
}), Ti = [
|
|
9122
|
-
|
|
9123
|
-
Id,
|
|
9125
|
+
Vd,
|
|
9124
9126
|
Ad,
|
|
9125
9127
|
Ed,
|
|
9126
9128
|
Rd,
|
|
9127
9129
|
Pd,
|
|
9128
9130
|
zd,
|
|
9129
9131
|
Bd,
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
+
Ld,
|
|
9133
|
+
Id,
|
|
9132
9134
|
Fd,
|
|
9133
9135
|
$d,
|
|
9134
|
-
ll,
|
|
9135
9136
|
Hd,
|
|
9136
9137
|
al,
|
|
9138
|
+
qd,
|
|
9137
9139
|
cl,
|
|
9138
9140
|
dl,
|
|
9139
9141
|
ul,
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
+
hl,
|
|
9143
|
+
Wd
|
|
9144
|
+
], Jd = wt.Root, wi = wt.Trigger, ln = ne.forwardRef(({ className: n, align: e = "center", sideOffset: t = 4, ...o }, r) => /* @__PURE__ */ h(wt.Portal, { children: /* @__PURE__ */ h(
|
|
9142
9145
|
wt.Content,
|
|
9143
9146
|
{
|
|
9144
9147
|
ref: r,
|
|
@@ -9152,7 +9155,7 @@ const Od = Pl.create({
|
|
|
9152
9155
|
}
|
|
9153
9156
|
) }));
|
|
9154
9157
|
ln.displayName = wt.Content.displayName;
|
|
9155
|
-
const
|
|
9158
|
+
const Kd = El(
|
|
9156
9159
|
"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",
|
|
9157
9160
|
{
|
|
9158
9161
|
variants: {
|
|
@@ -9178,9 +9181,9 @@ const Jd = Al(
|
|
|
9178
9181
|
}
|
|
9179
9182
|
), be = ne.forwardRef(
|
|
9180
9183
|
({ className: n, variant: e, size: t, asChild: o = !1, ...r }, i) => /* @__PURE__ */ h(
|
|
9181
|
-
o ?
|
|
9184
|
+
o ? Ll : "button",
|
|
9182
9185
|
{
|
|
9183
|
-
className: D(
|
|
9186
|
+
className: D(Kd({ variant: e, size: t, className: n })),
|
|
9184
9187
|
ref: i,
|
|
9185
9188
|
...r
|
|
9186
9189
|
}
|
|
@@ -9295,7 +9298,7 @@ const _o = [
|
|
|
9295
9298
|
showArrow: !1,
|
|
9296
9299
|
...n
|
|
9297
9300
|
}
|
|
9298
|
-
),
|
|
9301
|
+
), Ud = ({ open: n, onOpenChange: e }) => {
|
|
9299
9302
|
const { editor: t } = xe();
|
|
9300
9303
|
if (!t) return null;
|
|
9301
9304
|
const o = _o.find(
|
|
@@ -9303,7 +9306,7 @@ const _o = [
|
|
|
9303
9306
|
), r = Zo.find(
|
|
9304
9307
|
({ color: i }) => t.isActive("highlight", { color: i })
|
|
9305
9308
|
);
|
|
9306
|
-
return /* @__PURE__ */ x(
|
|
9309
|
+
return /* @__PURE__ */ x(Jd, { modal: !0, open: n, onOpenChange: e, children: [
|
|
9307
9310
|
/* @__PURE__ */ h(ot, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ h(wi, { asChild: !0, children: /* @__PURE__ */ x(be, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
|
|
9308
9311
|
/* @__PURE__ */ h(
|
|
9309
9312
|
"span",
|
|
@@ -9384,15 +9387,15 @@ const _o = [
|
|
|
9384
9387
|
)
|
|
9385
9388
|
] });
|
|
9386
9389
|
};
|
|
9387
|
-
function
|
|
9390
|
+
function jd(n) {
|
|
9388
9391
|
try {
|
|
9389
9392
|
return new URL(n), !0;
|
|
9390
9393
|
} catch {
|
|
9391
9394
|
return !1;
|
|
9392
9395
|
}
|
|
9393
9396
|
}
|
|
9394
|
-
function
|
|
9395
|
-
if (
|
|
9397
|
+
function Yd(n) {
|
|
9398
|
+
if (jd(n)) return n;
|
|
9396
9399
|
try {
|
|
9397
9400
|
if (n.includes(".") && !n.includes(" "))
|
|
9398
9401
|
return new URL(`https://${n}`).toString();
|
|
@@ -9400,20 +9403,20 @@ function jd(n) {
|
|
|
9400
9403
|
return null;
|
|
9401
9404
|
}
|
|
9402
9405
|
}
|
|
9403
|
-
const
|
|
9406
|
+
const Gd = ({ open: n, onOpenChange: e }) => {
|
|
9404
9407
|
const t = mt(null), { editor: o } = xe();
|
|
9405
9408
|
return $e(() => {
|
|
9406
9409
|
var r;
|
|
9407
9410
|
(r = t.current) == null || r.focus();
|
|
9408
9411
|
}), o ? /* @__PURE__ */ x(gr, { modal: !0, open: n, onOpenChange: e, children: [
|
|
9409
|
-
/* @__PURE__ */ h(ot, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ h(
|
|
9412
|
+
/* @__PURE__ */ h(ot, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ h(Bl, { asChild: !0, children: /* @__PURE__ */ x(
|
|
9410
9413
|
be,
|
|
9411
9414
|
{
|
|
9412
9415
|
size: "sm",
|
|
9413
9416
|
variant: "ghost",
|
|
9414
9417
|
className: "gap-2 rounded-md border-none",
|
|
9415
9418
|
children: [
|
|
9416
|
-
/* @__PURE__ */ h("p", { className: "text-base", children: /* @__PURE__ */ h(
|
|
9419
|
+
/* @__PURE__ */ h("p", { className: "text-base", children: /* @__PURE__ */ h(is, { size: 16 }) }),
|
|
9417
9420
|
/* @__PURE__ */ h(
|
|
9418
9421
|
"p",
|
|
9419
9422
|
{
|
|
@@ -9435,7 +9438,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
|
|
|
9435
9438
|
onSubmit: (r) => {
|
|
9436
9439
|
const i = r.currentTarget;
|
|
9437
9440
|
r.preventDefault();
|
|
9438
|
-
const s = i[0], l =
|
|
9441
|
+
const s = i[0], l = Yd(s.value);
|
|
9439
9442
|
l && (o.chain().focus().setLink({ href: l }).run(), e(!1));
|
|
9440
9443
|
},
|
|
9441
9444
|
className: "flex p-1 ",
|
|
@@ -9467,7 +9470,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
|
|
|
9467
9470
|
}
|
|
9468
9471
|
) })
|
|
9469
9472
|
] }) : null;
|
|
9470
|
-
},
|
|
9473
|
+
}, Xd = () => {
|
|
9471
9474
|
const { editor: n } = xe();
|
|
9472
9475
|
return n ? /* @__PURE__ */ h(ot, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ h(
|
|
9473
9476
|
be,
|
|
@@ -9485,7 +9488,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
|
|
|
9485
9488
|
}
|
|
9486
9489
|
},
|
|
9487
9490
|
children: /* @__PURE__ */ h(
|
|
9488
|
-
|
|
9491
|
+
Vl,
|
|
9489
9492
|
{
|
|
9490
9493
|
className: D("size-4", { "text-blue-500": n.isActive("math") }),
|
|
9491
9494
|
strokeWidth: 2.3
|
|
@@ -9557,7 +9560,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
|
|
|
9557
9560
|
command: (n) => n.chain().focus().clearNodes().toggleCodeBlock().run(),
|
|
9558
9561
|
isActive: (n) => n.isActive("codeBlock")
|
|
9559
9562
|
}
|
|
9560
|
-
],
|
|
9563
|
+
], _d = ({ open: n, onOpenChange: e }) => {
|
|
9561
9564
|
const { editor: t } = xe();
|
|
9562
9565
|
if (!t) return null;
|
|
9563
9566
|
const o = Bn.filter(
|
|
@@ -9617,7 +9620,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
|
|
|
9617
9620
|
)
|
|
9618
9621
|
);
|
|
9619
9622
|
dt.displayName = br.Root.displayName;
|
|
9620
|
-
const
|
|
9623
|
+
const Zd = () => /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-0.5", children: [
|
|
9621
9624
|
/* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
|
|
9622
9625
|
/* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
|
|
9623
9626
|
/* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
|
|
@@ -9651,8 +9654,8 @@ const Mi = ne.forwardRef(({ className: n, orientation: e = "vertical", ...t }, o
|
|
|
9651
9654
|
}
|
|
9652
9655
|
));
|
|
9653
9656
|
Mi.displayName = Ze.ScrollAreaScrollbar.displayName;
|
|
9654
|
-
const
|
|
9655
|
-
|
|
9657
|
+
const Qd = we.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
9658
|
+
we.Overlay,
|
|
9656
9659
|
{
|
|
9657
9660
|
ref: t,
|
|
9658
9661
|
className: D(
|
|
@@ -9662,11 +9665,11 @@ const Zd = Te.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PU
|
|
|
9662
9665
|
...e
|
|
9663
9666
|
}
|
|
9664
9667
|
));
|
|
9665
|
-
Oi.displayName =
|
|
9666
|
-
const
|
|
9668
|
+
Oi.displayName = we.Overlay.displayName;
|
|
9669
|
+
const eu = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE__ */ x(Qd, { children: [
|
|
9667
9670
|
/* @__PURE__ */ h(Oi, {}),
|
|
9668
9671
|
/* @__PURE__ */ x(
|
|
9669
|
-
|
|
9672
|
+
we.Content,
|
|
9670
9673
|
{
|
|
9671
9674
|
ref: o,
|
|
9672
9675
|
className: D(
|
|
@@ -9676,17 +9679,17 @@ const Qd = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE_
|
|
|
9676
9679
|
...t,
|
|
9677
9680
|
children: [
|
|
9678
9681
|
e,
|
|
9679
|
-
/* @__PURE__ */ x(
|
|
9680
|
-
/* @__PURE__ */ h(
|
|
9682
|
+
/* @__PURE__ */ x(we.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
9683
|
+
/* @__PURE__ */ h(Fl, { className: "h-4 w-4" }),
|
|
9681
9684
|
/* @__PURE__ */ h("span", { className: "sr-only", children: "Close" })
|
|
9682
9685
|
] })
|
|
9683
9686
|
]
|
|
9684
9687
|
}
|
|
9685
9688
|
)
|
|
9686
9689
|
] }));
|
|
9687
|
-
|
|
9688
|
-
const
|
|
9689
|
-
|
|
9690
|
+
eu.displayName = we.Content.displayName;
|
|
9691
|
+
const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
9692
|
+
we.Title,
|
|
9690
9693
|
{
|
|
9691
9694
|
ref: t,
|
|
9692
9695
|
className: D(
|
|
@@ -9696,16 +9699,16 @@ const eu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
|
9696
9699
|
...e
|
|
9697
9700
|
}
|
|
9698
9701
|
));
|
|
9699
|
-
|
|
9700
|
-
const
|
|
9701
|
-
|
|
9702
|
+
tu.displayName = we.Title.displayName;
|
|
9703
|
+
const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
9704
|
+
we.Description,
|
|
9702
9705
|
{
|
|
9703
9706
|
ref: t,
|
|
9704
9707
|
className: D("text-sm text-muted-foreground", n),
|
|
9705
9708
|
...e
|
|
9706
9709
|
}
|
|
9707
9710
|
));
|
|
9708
|
-
|
|
9711
|
+
nu.displayName = we.Description.displayName;
|
|
9709
9712
|
const vi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
9710
9713
|
ce,
|
|
9711
9714
|
{
|
|
@@ -9733,7 +9736,7 @@ const Ii = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ x("div",
|
|
|
9733
9736
|
)
|
|
9734
9737
|
] }));
|
|
9735
9738
|
Ii.displayName = ce.Input.displayName;
|
|
9736
|
-
const
|
|
9739
|
+
const ou = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
9737
9740
|
ce.List,
|
|
9738
9741
|
{
|
|
9739
9742
|
ref: t,
|
|
@@ -9741,8 +9744,8 @@ const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
|
9741
9744
|
...e
|
|
9742
9745
|
}
|
|
9743
9746
|
));
|
|
9744
|
-
|
|
9745
|
-
const
|
|
9747
|
+
ou.displayName = ce.List.displayName;
|
|
9748
|
+
const ru = ne.forwardRef((n, e) => /* @__PURE__ */ h(
|
|
9746
9749
|
ce.Empty,
|
|
9747
9750
|
{
|
|
9748
9751
|
ref: e,
|
|
@@ -9750,7 +9753,7 @@ const ou = ne.forwardRef((n, e) => /* @__PURE__ */ h(
|
|
|
9750
9753
|
...n
|
|
9751
9754
|
}
|
|
9752
9755
|
));
|
|
9753
|
-
|
|
9756
|
+
ru.displayName = ce.Empty.displayName;
|
|
9754
9757
|
const zt = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
9755
9758
|
ce.Group,
|
|
9756
9759
|
{
|
|
@@ -9784,7 +9787,7 @@ const ft = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
|
|
|
9784
9787
|
}
|
|
9785
9788
|
));
|
|
9786
9789
|
ft.displayName = ce.Item.displayName;
|
|
9787
|
-
const
|
|
9790
|
+
const iu = ({
|
|
9788
9791
|
completion: n,
|
|
9789
9792
|
onDiscard: e
|
|
9790
9793
|
}) => {
|
|
@@ -9807,7 +9810,7 @@ const ru = ({
|
|
|
9807
9810
|
).run();
|
|
9808
9811
|
},
|
|
9809
9812
|
children: [
|
|
9810
|
-
/* @__PURE__ */ h(
|
|
9813
|
+
/* @__PURE__ */ h($l, { className: "h-4 w-4 text-muted-foreground" }),
|
|
9811
9814
|
"替换选择"
|
|
9812
9815
|
]
|
|
9813
9816
|
}
|
|
@@ -9822,7 +9825,7 @@ const ru = ({
|
|
|
9822
9825
|
t.chain().focus().insertContentAt(o.to + 1, n).run();
|
|
9823
9826
|
},
|
|
9824
9827
|
children: [
|
|
9825
|
-
/* @__PURE__ */ h(
|
|
9828
|
+
/* @__PURE__ */ h(Hl, { className: "h-4 w-4 text-muted-foreground" }),
|
|
9826
9829
|
"在下面插入"
|
|
9827
9830
|
]
|
|
9828
9831
|
}
|
|
@@ -9830,41 +9833,41 @@ const ru = ({
|
|
|
9830
9833
|
] }),
|
|
9831
9834
|
/* @__PURE__ */ h(Qn, {}),
|
|
9832
9835
|
/* @__PURE__ */ h(zt, { children: /* @__PURE__ */ x(ft, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
|
|
9833
|
-
/* @__PURE__ */ h(
|
|
9836
|
+
/* @__PURE__ */ h(ql, { className: "h-4 w-4 text-muted-foreground" }),
|
|
9834
9837
|
"丢弃"
|
|
9835
9838
|
] }) })
|
|
9836
9839
|
] });
|
|
9837
|
-
},
|
|
9840
|
+
}, su = [
|
|
9838
9841
|
{
|
|
9839
9842
|
value: "improve",
|
|
9840
9843
|
label: "改进写作",
|
|
9841
9844
|
// Improve writing
|
|
9842
|
-
icon:
|
|
9845
|
+
icon: Wl
|
|
9843
9846
|
},
|
|
9844
9847
|
{
|
|
9845
9848
|
value: "fix",
|
|
9846
9849
|
label: "修正语法",
|
|
9847
9850
|
// Fix grammar
|
|
9848
|
-
icon:
|
|
9851
|
+
icon: Jl
|
|
9849
9852
|
},
|
|
9850
9853
|
{
|
|
9851
9854
|
value: "shorter",
|
|
9852
9855
|
label: "缩短文本",
|
|
9853
9856
|
// Make shorter
|
|
9854
|
-
icon:
|
|
9857
|
+
icon: Kl
|
|
9855
9858
|
},
|
|
9856
9859
|
{
|
|
9857
9860
|
value: "longer",
|
|
9858
9861
|
label: "扩展文本",
|
|
9859
9862
|
// Make longer
|
|
9860
|
-
icon:
|
|
9863
|
+
icon: Ul
|
|
9861
9864
|
}
|
|
9862
|
-
],
|
|
9865
|
+
], lu = ({ onSelect: n }) => {
|
|
9863
9866
|
const { editor: e } = xe();
|
|
9864
9867
|
return /* @__PURE__ */ x(rt, { children: [
|
|
9865
9868
|
/* @__PURE__ */ x(zt, { heading: "编辑或校对选中文本", children: [
|
|
9866
9869
|
" ",
|
|
9867
|
-
|
|
9870
|
+
su.map((t) => /* @__PURE__ */ x(
|
|
9868
9871
|
ft,
|
|
9869
9872
|
{
|
|
9870
9873
|
onSelect: (o) => {
|
|
@@ -9890,13 +9893,13 @@ const ru = ({
|
|
|
9890
9893
|
ft,
|
|
9891
9894
|
{
|
|
9892
9895
|
onSelect: () => {
|
|
9893
|
-
const t = e.state.selection.from, o =
|
|
9896
|
+
const t = e.state.selection.from, o = fl(e, t);
|
|
9894
9897
|
n(o, "continue");
|
|
9895
9898
|
},
|
|
9896
9899
|
value: "continue",
|
|
9897
9900
|
className: "gap-2 px-4",
|
|
9898
9901
|
children: [
|
|
9899
|
-
/* @__PURE__ */ h(
|
|
9902
|
+
/* @__PURE__ */ h(jl, { className: "h-4 w-4 text-purple-500" }),
|
|
9900
9903
|
"继续写作"
|
|
9901
9904
|
]
|
|
9902
9905
|
}
|
|
@@ -9904,8 +9907,8 @@ const ru = ({
|
|
|
9904
9907
|
] })
|
|
9905
9908
|
] });
|
|
9906
9909
|
};
|
|
9907
|
-
function
|
|
9908
|
-
const { editor: t } = xe(), [o, r] = J(""), { completion: i, complete: s, isLoading: l } =
|
|
9910
|
+
function au({ onOpenChange: n, options: e }) {
|
|
9911
|
+
const { editor: t } = xe(), [o, r] = J(""), { completion: i, complete: s, isLoading: l } = ea({
|
|
9909
9912
|
// id: "novel",
|
|
9910
9913
|
api: "/api/generate",
|
|
9911
9914
|
onResponse: (c) => {
|
|
@@ -9924,7 +9927,7 @@ function lu({ onOpenChange: n, options: e }) {
|
|
|
9924
9927
|
l && /* @__PURE__ */ x("div", { className: "flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-purple-500", children: [
|
|
9925
9928
|
/* @__PURE__ */ h(Fn, { size: 14, className: "mr-2 shrink-0" }),
|
|
9926
9929
|
"AI正在思考",
|
|
9927
|
-
/* @__PURE__ */ h("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ h(
|
|
9930
|
+
/* @__PURE__ */ h("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ h(Zd, {}) })
|
|
9928
9931
|
] }),
|
|
9929
9932
|
!l && /* @__PURE__ */ x(rt, { children: [
|
|
9930
9933
|
/* @__PURE__ */ x("div", { className: "relative", children: [
|
|
@@ -9935,7 +9938,7 @@ function lu({ onOpenChange: n, options: e }) {
|
|
|
9935
9938
|
onValueChange: r,
|
|
9936
9939
|
autoFocus: !0,
|
|
9937
9940
|
placeholder: a ? "告诉AI下一步该怎么做" : "要求AI编辑或生成……",
|
|
9938
|
-
onFocus: () =>
|
|
9941
|
+
onFocus: () => pl(t)
|
|
9939
9942
|
}
|
|
9940
9943
|
),
|
|
9941
9944
|
/* @__PURE__ */ h(
|
|
@@ -9955,12 +9958,12 @@ function lu({ onOpenChange: n, options: e }) {
|
|
|
9955
9958
|
body: { option: "zap", command: o }
|
|
9956
9959
|
}).then(() => r(""));
|
|
9957
9960
|
},
|
|
9958
|
-
children: /* @__PURE__ */ h(
|
|
9961
|
+
children: /* @__PURE__ */ h(Yl, { className: "h-4 w-4" })
|
|
9959
9962
|
}
|
|
9960
9963
|
)
|
|
9961
9964
|
] }),
|
|
9962
9965
|
a ? /* @__PURE__ */ h(
|
|
9963
|
-
|
|
9966
|
+
iu,
|
|
9964
9967
|
{
|
|
9965
9968
|
onDiscard: () => {
|
|
9966
9969
|
t.chain().unsetHighlight().focus().run(), n(!1);
|
|
@@ -9968,7 +9971,7 @@ function lu({ onOpenChange: n, options: e }) {
|
|
|
9968
9971
|
completion: i
|
|
9969
9972
|
}
|
|
9970
9973
|
) : /* @__PURE__ */ h(
|
|
9971
|
-
|
|
9974
|
+
lu,
|
|
9972
9975
|
{
|
|
9973
9976
|
onSelect: (c, d) => s(c, { body: { option: d } })
|
|
9974
9977
|
}
|
|
@@ -9976,7 +9979,7 @@ function lu({ onOpenChange: n, options: e }) {
|
|
|
9976
9979
|
] })
|
|
9977
9980
|
] });
|
|
9978
9981
|
}
|
|
9979
|
-
const
|
|
9982
|
+
const cu = ({
|
|
9980
9983
|
children: n,
|
|
9981
9984
|
open: e,
|
|
9982
9985
|
onOpenChange: t,
|
|
@@ -9985,9 +9988,9 @@ const au = ({
|
|
|
9985
9988
|
}) => {
|
|
9986
9989
|
const { editor: i } = xe();
|
|
9987
9990
|
return $e(() => {
|
|
9988
|
-
e ||
|
|
9991
|
+
e || ml(i);
|
|
9989
9992
|
}, [e]), /* @__PURE__ */ x(
|
|
9990
|
-
|
|
9993
|
+
gl,
|
|
9991
9994
|
{
|
|
9992
9995
|
tippyOptions: {
|
|
9993
9996
|
placement: e ? "bottom-start" : "top",
|
|
@@ -9998,14 +10001,14 @@ const au = ({
|
|
|
9998
10001
|
className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
|
|
9999
10002
|
children: [
|
|
10000
10003
|
e && o && /* @__PURE__ */ h(
|
|
10001
|
-
|
|
10004
|
+
au,
|
|
10002
10005
|
{
|
|
10003
10006
|
open: e,
|
|
10004
10007
|
onOpenChange: t,
|
|
10005
10008
|
options: r
|
|
10006
10009
|
}
|
|
10007
10010
|
),
|
|
10008
|
-
!e && /* @__PURE__ */ x(
|
|
10011
|
+
!e && /* @__PURE__ */ x(Fi, { children: [
|
|
10009
10012
|
o && /* @__PURE__ */ x(
|
|
10010
10013
|
be,
|
|
10011
10014
|
{
|
|
@@ -10024,7 +10027,7 @@ const au = ({
|
|
|
10024
10027
|
]
|
|
10025
10028
|
}
|
|
10026
10029
|
);
|
|
10027
|
-
},
|
|
10030
|
+
}, du = (n) => {
|
|
10028
10031
|
const e = fetch("/api/upload", {
|
|
10029
10032
|
method: "POST",
|
|
10030
10033
|
headers: {
|
|
@@ -10050,10 +10053,10 @@ const au = ({
|
|
|
10050
10053
|
}
|
|
10051
10054
|
);
|
|
10052
10055
|
});
|
|
10053
|
-
},
|
|
10054
|
-
onUpload:
|
|
10056
|
+
}, uu = mr({
|
|
10057
|
+
onUpload: du,
|
|
10055
10058
|
validateFn: (n) => n.type.includes("image/") ? n.size / 1024 / 1024 > 20 ? (Dt.error("File size too big (max 20MB)."), !1) : !0 : (Dt.error("File type not supported."), !1)
|
|
10056
|
-
}),
|
|
10059
|
+
}), hu = () => {
|
|
10057
10060
|
const { editor: n } = xe();
|
|
10058
10061
|
return n ? /* @__PURE__ */ h("div", { className: "flex", children: [
|
|
10059
10062
|
{
|
|
@@ -10061,35 +10064,35 @@ const au = ({
|
|
|
10061
10064
|
// bold
|
|
10062
10065
|
isActive: (t) => t.isActive("bold"),
|
|
10063
10066
|
command: (t) => t.chain().focus().toggleBold().run(),
|
|
10064
|
-
icon:
|
|
10067
|
+
icon: Gl
|
|
10065
10068
|
},
|
|
10066
10069
|
{
|
|
10067
10070
|
name: "斜体",
|
|
10068
10071
|
// italic
|
|
10069
10072
|
isActive: (t) => t.isActive("italic"),
|
|
10070
10073
|
command: (t) => t.chain().focus().toggleItalic().run(),
|
|
10071
|
-
icon:
|
|
10074
|
+
icon: Xl
|
|
10072
10075
|
},
|
|
10073
10076
|
{
|
|
10074
10077
|
name: "下划线",
|
|
10075
10078
|
// underline
|
|
10076
10079
|
isActive: (t) => t.isActive("underline"),
|
|
10077
10080
|
command: (t) => t.chain().focus().toggleUnderline().run(),
|
|
10078
|
-
icon:
|
|
10081
|
+
icon: _l
|
|
10079
10082
|
},
|
|
10080
10083
|
{
|
|
10081
10084
|
name: "删除线",
|
|
10082
10085
|
// strike
|
|
10083
10086
|
isActive: (t) => t.isActive("strike"),
|
|
10084
10087
|
command: (t) => t.chain().focus().toggleStrike().run(),
|
|
10085
|
-
icon:
|
|
10088
|
+
icon: Zl
|
|
10086
10089
|
},
|
|
10087
10090
|
{
|
|
10088
10091
|
name: "代码",
|
|
10089
10092
|
// code
|
|
10090
10093
|
isActive: (t) => t.isActive("code"),
|
|
10091
10094
|
command: (t) => t.chain().focus().toggleCode().run(),
|
|
10092
|
-
icon:
|
|
10095
|
+
icon: Ql
|
|
10093
10096
|
}
|
|
10094
10097
|
].map((t) => /* @__PURE__ */ h(
|
|
10095
10098
|
Xt,
|
|
@@ -10117,7 +10120,7 @@ const au = ({
|
|
|
10117
10120
|
},
|
|
10118
10121
|
t.name
|
|
10119
10122
|
)) }) : null;
|
|
10120
|
-
}, Ai = ({ uploadFn: n }) =>
|
|
10123
|
+
}, Ai = ({ uploadFn: n }) => yl([
|
|
10121
10124
|
{
|
|
10122
10125
|
title: "文本",
|
|
10123
10126
|
// "Text",
|
|
@@ -10219,7 +10222,7 @@ const au = ({
|
|
|
10219
10222
|
description: "从您的计算机上传图像。",
|
|
10220
10223
|
// "Upload an image from your computer.",
|
|
10221
10224
|
searchTerms: ["photo", "picture", "media"],
|
|
10222
|
-
icon: /* @__PURE__ */ h(
|
|
10225
|
+
icon: /* @__PURE__ */ h(ss, { size: 18 }),
|
|
10223
10226
|
command: ({ editor: e, range: t }) => {
|
|
10224
10227
|
e.chain().focus().deleteRange(t).run();
|
|
10225
10228
|
const o = document.createElement("input");
|
|
@@ -10232,15 +10235,15 @@ const au = ({
|
|
|
10232
10235
|
}, o.click();
|
|
10233
10236
|
}
|
|
10234
10237
|
}
|
|
10235
|
-
]),
|
|
10238
|
+
]), fu = (n) => bl.configure({
|
|
10236
10239
|
suggestion: {
|
|
10237
10240
|
items: () => Ai(n),
|
|
10238
|
-
render:
|
|
10241
|
+
render: kl
|
|
10239
10242
|
}
|
|
10240
|
-
}),
|
|
10243
|
+
}), pu = {
|
|
10241
10244
|
type: "doc",
|
|
10242
10245
|
content: []
|
|
10243
|
-
}, Ei =
|
|
10246
|
+
}, Ei = $i(({ children: n, items: e, ...t }, o) => {
|
|
10244
10247
|
const r = (s) => /* @__PURE__ */ x(
|
|
10245
10248
|
qt.Item,
|
|
10246
10249
|
{
|
|
@@ -10262,7 +10265,7 @@ const au = ({
|
|
|
10262
10265
|
return /* @__PURE__ */ h(
|
|
10263
10266
|
qt.SubMenu,
|
|
10264
10267
|
{
|
|
10265
|
-
expandIcon: /* @__PURE__ */ h(
|
|
10268
|
+
expandIcon: /* @__PURE__ */ h(ls, { size: 16 }),
|
|
10266
10269
|
popupClassName: D(
|
|
10267
10270
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
|
|
10268
10271
|
S`
|
|
@@ -10300,7 +10303,7 @@ const au = ({
|
|
|
10300
10303
|
);
|
|
10301
10304
|
};
|
|
10302
10305
|
return /* @__PURE__ */ h(
|
|
10303
|
-
|
|
10306
|
+
na,
|
|
10304
10307
|
{
|
|
10305
10308
|
ref: o,
|
|
10306
10309
|
trigger: "click",
|
|
@@ -10327,7 +10330,7 @@ const au = ({
|
|
|
10327
10330
|
);
|
|
10328
10331
|
});
|
|
10329
10332
|
Ei.displayName = "DropdownMenu";
|
|
10330
|
-
const
|
|
10333
|
+
const mu = ({ children: n, ...e }) => {
|
|
10331
10334
|
const { editor: t } = xe(), o = () => {
|
|
10332
10335
|
t && t.state.selection instanceof T && (t.commands.deleteSelection(), t.commands.focus());
|
|
10333
10336
|
}, r = () => {
|
|
@@ -10352,13 +10355,13 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10352
10355
|
{
|
|
10353
10356
|
key: "transform",
|
|
10354
10357
|
type: "submenu",
|
|
10355
|
-
icon: /* @__PURE__ */ h(
|
|
10358
|
+
icon: /* @__PURE__ */ h(as, { size: 16 }),
|
|
10356
10359
|
label: "转换成",
|
|
10357
10360
|
children: i
|
|
10358
10361
|
},
|
|
10359
10362
|
{
|
|
10360
10363
|
key: "duplicate",
|
|
10361
|
-
icon: /* @__PURE__ */ h(
|
|
10364
|
+
icon: /* @__PURE__ */ h(cs, { size: 16 }),
|
|
10362
10365
|
label: "创建副本",
|
|
10363
10366
|
onClick: r
|
|
10364
10367
|
},
|
|
@@ -10371,7 +10374,7 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10371
10374
|
onClick: o
|
|
10372
10375
|
}
|
|
10373
10376
|
], ...e, children: n });
|
|
10374
|
-
},
|
|
10377
|
+
}, gu = () => {
|
|
10375
10378
|
const { editor: n } = xe(), e = (t) => {
|
|
10376
10379
|
if (!n) return;
|
|
10377
10380
|
const o = t.target.closest(".custom-drag-handle");
|
|
@@ -10410,12 +10413,12 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10410
10413
|
variant: "ghost",
|
|
10411
10414
|
className: "w-auto h-auto p-0.5",
|
|
10412
10415
|
onClick: e,
|
|
10413
|
-
children: /* @__PURE__ */ h(
|
|
10416
|
+
children: /* @__PURE__ */ h(ds, { className: "cursor-pointer", size: 22 })
|
|
10414
10417
|
}
|
|
10415
10418
|
)
|
|
10416
10419
|
}
|
|
10417
10420
|
),
|
|
10418
|
-
/* @__PURE__ */ h(
|
|
10421
|
+
/* @__PURE__ */ h(mu, { children: /* @__PURE__ */ h(
|
|
10419
10422
|
ot,
|
|
10420
10423
|
{
|
|
10421
10424
|
placement: "bottom",
|
|
@@ -10423,13 +10426,13 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10423
10426
|
"拖动",
|
|
10424
10427
|
/* @__PURE__ */ h("span", { className: "text-muted-foreground", children: "以移动" })
|
|
10425
10428
|
] }) }),
|
|
10426
|
-
children: /* @__PURE__ */ h(be, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ h(
|
|
10429
|
+
children: /* @__PURE__ */ h(be, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ h(us, { size: 22 }) })
|
|
10427
10430
|
}
|
|
10428
10431
|
) })
|
|
10429
10432
|
]
|
|
10430
10433
|
}
|
|
10431
10434
|
);
|
|
10432
|
-
},
|
|
10435
|
+
}, bu = (n) => {
|
|
10433
10436
|
const {
|
|
10434
10437
|
className: e,
|
|
10435
10438
|
initialContent: t = {},
|
|
@@ -10447,9 +10450,9 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10447
10450
|
), [p, b] = J("Saved"), [g, y] = J(), [C, O] = J(!1), [k, I] = J(!1), [M, v] = J(!1), [w, N] = J(!1), X = (R) => {
|
|
10448
10451
|
const U = new DOMParser().parseFromString(R, "text/html");
|
|
10449
10452
|
return U.querySelectorAll("pre code").forEach((V) => {
|
|
10450
|
-
|
|
10453
|
+
ta.highlightElement(V);
|
|
10451
10454
|
}), new XMLSerializer().serializeToString(U);
|
|
10452
|
-
}, K =
|
|
10455
|
+
}, K = Il(
|
|
10453
10456
|
async (R) => {
|
|
10454
10457
|
const U = R.getJSON();
|
|
10455
10458
|
y(R.storage.characterCount.words()), o == null || o(U), i && (window.localStorage.setItem(
|
|
@@ -10462,13 +10465,13 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10462
10465
|
},
|
|
10463
10466
|
500
|
|
10464
10467
|
), Ce = pt(() => {
|
|
10465
|
-
if (!a) return
|
|
10468
|
+
if (!a) return uu;
|
|
10466
10469
|
const {
|
|
10467
10470
|
beforeUpload: R,
|
|
10468
10471
|
maxSize: U,
|
|
10469
10472
|
action: V,
|
|
10470
10473
|
headers: de,
|
|
10471
|
-
method:
|
|
10474
|
+
method: Se,
|
|
10472
10475
|
name: an,
|
|
10473
10476
|
onSuccess: Ft,
|
|
10474
10477
|
onError: $t
|
|
@@ -10478,7 +10481,7 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10478
10481
|
const P = new FormData();
|
|
10479
10482
|
P.append(an || "file", ze);
|
|
10480
10483
|
const Q = fetch(V, {
|
|
10481
|
-
method:
|
|
10484
|
+
method: Se || "POST",
|
|
10482
10485
|
headers: {
|
|
10483
10486
|
...de
|
|
10484
10487
|
},
|
|
@@ -10510,11 +10513,11 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10510
10513
|
if ($e(() => {
|
|
10511
10514
|
if (!i) return;
|
|
10512
10515
|
const R = window.localStorage.getItem(r);
|
|
10513
|
-
m(R ? JSON.parse(R) :
|
|
10516
|
+
m(R ? JSON.parse(R) : pu);
|
|
10514
10517
|
}, [r, i]), !f) return null;
|
|
10515
|
-
const
|
|
10518
|
+
const Oe = [
|
|
10516
10519
|
...Ti,
|
|
10517
|
-
|
|
10520
|
+
fu({
|
|
10518
10521
|
uploadFn: Ce
|
|
10519
10522
|
})
|
|
10520
10523
|
];
|
|
@@ -10532,21 +10535,21 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10532
10535
|
}
|
|
10533
10536
|
)
|
|
10534
10537
|
] }),
|
|
10535
|
-
/* @__PURE__ */ h(
|
|
10536
|
-
|
|
10538
|
+
/* @__PURE__ */ h(xl, { children: /* @__PURE__ */ x(
|
|
10539
|
+
Cl,
|
|
10537
10540
|
{
|
|
10538
10541
|
onCreate: ({ editor: R }) => {
|
|
10539
10542
|
c && (c.current = R);
|
|
10540
10543
|
},
|
|
10541
10544
|
initialContent: f,
|
|
10542
|
-
extensions:
|
|
10545
|
+
extensions: Oe,
|
|
10543
10546
|
className: "relative min-h-[500px] w-full max-w-screen-lg border-muted bg-background sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:shadow-lg editor-content",
|
|
10544
10547
|
editorProps: {
|
|
10545
10548
|
handleDOMEvents: {
|
|
10546
|
-
keydown: (R, U) =>
|
|
10549
|
+
keydown: (R, U) => Tl(U)
|
|
10547
10550
|
},
|
|
10548
|
-
handlePaste: (R, U) =>
|
|
10549
|
-
handleDrop: (R, U, V, de) =>
|
|
10551
|
+
handlePaste: (R, U) => Nl(R, U, Ce),
|
|
10552
|
+
handleDrop: (R, U, V, de) => Sl(R, U, de, Ce),
|
|
10550
10553
|
attributes: {
|
|
10551
10554
|
class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
|
|
10552
10555
|
}
|
|
@@ -10554,14 +10557,14 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10554
10557
|
onUpdate: ({ editor: R }) => {
|
|
10555
10558
|
K(R), b("Unsaved");
|
|
10556
10559
|
},
|
|
10557
|
-
slotAfter: /* @__PURE__ */ h(
|
|
10560
|
+
slotAfter: /* @__PURE__ */ h(vl, {}),
|
|
10558
10561
|
children: [
|
|
10559
|
-
/* @__PURE__ */ x(
|
|
10560
|
-
/* @__PURE__ */ h(
|
|
10561
|
-
/* @__PURE__ */ h(
|
|
10562
|
+
/* @__PURE__ */ x(wl, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
|
|
10563
|
+
/* @__PURE__ */ h(Dl, { className: "px-2 text-muted-foreground", children: "没有结果" }),
|
|
10564
|
+
/* @__PURE__ */ h(Ml, { children: Ai({
|
|
10562
10565
|
uploadFn: Ce
|
|
10563
10566
|
}).map((R) => /* @__PURE__ */ x(
|
|
10564
|
-
|
|
10567
|
+
Ol,
|
|
10565
10568
|
{
|
|
10566
10569
|
value: R.title,
|
|
10567
10570
|
onCommand: (U) => R.command(U),
|
|
@@ -10578,7 +10581,7 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10578
10581
|
)) })
|
|
10579
10582
|
] }),
|
|
10580
10583
|
/* @__PURE__ */ x(
|
|
10581
|
-
|
|
10584
|
+
cu,
|
|
10582
10585
|
{
|
|
10583
10586
|
open: w,
|
|
10584
10587
|
onOpenChange: N,
|
|
@@ -10586,32 +10589,32 @@ const pu = ({ children: n, ...e }) => {
|
|
|
10586
10589
|
aiOptions: u,
|
|
10587
10590
|
children: [
|
|
10588
10591
|
d && /* @__PURE__ */ h(dt, { orientation: "vertical" }),
|
|
10589
|
-
/* @__PURE__ */ h(
|
|
10592
|
+
/* @__PURE__ */ h(_d, { open: C, onOpenChange: O }),
|
|
10590
10593
|
/* @__PURE__ */ h(dt, { orientation: "vertical" }),
|
|
10591
|
-
/* @__PURE__ */ h(
|
|
10594
|
+
/* @__PURE__ */ h(Gd, { open: M, onOpenChange: v }),
|
|
10592
10595
|
/* @__PURE__ */ h(dt, { orientation: "vertical" }),
|
|
10593
|
-
/* @__PURE__ */ h(
|
|
10596
|
+
/* @__PURE__ */ h(Xd, {}),
|
|
10594
10597
|
/* @__PURE__ */ h(dt, { orientation: "vertical" }),
|
|
10595
|
-
/* @__PURE__ */ h(
|
|
10598
|
+
/* @__PURE__ */ h(hu, {}),
|
|
10596
10599
|
/* @__PURE__ */ h(dt, { orientation: "vertical" }),
|
|
10597
|
-
/* @__PURE__ */ h(
|
|
10600
|
+
/* @__PURE__ */ h(Ud, { open: k, onOpenChange: I })
|
|
10598
10601
|
]
|
|
10599
10602
|
}
|
|
10600
10603
|
),
|
|
10601
|
-
/* @__PURE__ */ h(
|
|
10604
|
+
/* @__PURE__ */ h(gu, {})
|
|
10602
10605
|
]
|
|
10603
10606
|
}
|
|
10604
10607
|
) })
|
|
10605
10608
|
] });
|
|
10606
|
-
},
|
|
10607
|
-
const e = pt(() =>
|
|
10609
|
+
}, yu = ({ json: n }) => {
|
|
10610
|
+
const e = pt(() => oa(n ?? {}, Ti), [n]);
|
|
10608
10611
|
return /* @__PURE__ */ h("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ h("div", { dangerouslySetInnerHTML: { __html: e } }) });
|
|
10609
|
-
},
|
|
10610
|
-
|
|
10612
|
+
}, ku = bu;
|
|
10613
|
+
ku.Preview = yu;
|
|
10611
10614
|
export {
|
|
10612
|
-
|
|
10615
|
+
lh as Desktop,
|
|
10613
10616
|
Ar as Dock,
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
+
ku as Editor,
|
|
10618
|
+
Na as Markdown,
|
|
10619
|
+
Ta as MdEditor
|
|
10617
10620
|
};
|