zs_library 0.4.21 → 0.4.23
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.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Kt = Object.defineProperty;
|
|
2
|
+
var Jt = (r, e, o) => e in r ? Kt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
|
|
3
|
+
var Le = (r, e, o) => Jt(r, typeof e != "symbol" ? e + "" : e, o);
|
|
4
4
|
import "./index.css";
|
|
5
|
-
import
|
|
6
|
-
import { initReactI18next as
|
|
5
|
+
import Zt from "i18next";
|
|
6
|
+
import { initReactI18next as Qt } from "react-i18next";
|
|
7
7
|
import { jsx as t, jsxs as m, Fragment as ue } from "react/jsx-runtime";
|
|
8
8
|
import * as q from "react";
|
|
9
|
-
import
|
|
9
|
+
import eo, { createContext as st, useMemo as be, useContext as it, useState as j, useRef as xe, useCallback as to, useEffect as ae, forwardRef as lt, Fragment as oo } from "react";
|
|
10
10
|
import { cx as k, css as b } from "@emotion/css";
|
|
11
|
-
import
|
|
12
|
-
import { ReactSortable as
|
|
13
|
-
import { AnimatePresence as
|
|
14
|
-
import { useMotionValue as
|
|
15
|
-
import { useLocalStorageState as
|
|
16
|
-
import { v4 as
|
|
17
|
-
import
|
|
18
|
-
import { RiPencilRuler2Line as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { AdmonitionDirectiveDescriptor as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { Prism as
|
|
27
|
-
import { oneLight as
|
|
28
|
-
import
|
|
29
|
-
import { clsx as
|
|
30
|
-
import { twMerge as
|
|
31
|
-
import { Placeholder as
|
|
32
|
-
import { useDebouncedCallback as
|
|
33
|
-
import { Markdown as
|
|
34
|
-
import { cx as Y, cva as
|
|
35
|
-
import { createLowlight as
|
|
36
|
-
import { Extension as
|
|
37
|
-
import { Plugin as
|
|
38
|
-
import { Slice as
|
|
39
|
-
import * as
|
|
40
|
-
import * as
|
|
41
|
-
import { Popover as
|
|
42
|
-
import { Slot as
|
|
43
|
-
import { SigmaIcon as
|
|
44
|
-
import * as
|
|
45
|
-
import { useCompletion as
|
|
46
|
-
import { toast as
|
|
11
|
+
import ro from "react-slick";
|
|
12
|
+
import { ReactSortable as Xe } from "react-sortablejs";
|
|
13
|
+
import { AnimatePresence as Ue, motion as R, useMotionValue as ct, useTransform as ge, useSpring as Ae } from "framer-motion";
|
|
14
|
+
import { useMotionValue as Ps } from "framer-motion";
|
|
15
|
+
import { useLocalStorageState as no, useDebounceEffect as ao } from "ahooks";
|
|
16
|
+
import { v4 as Oe } from "uuid";
|
|
17
|
+
import dt from "rc-tooltip";
|
|
18
|
+
import { RiPencilRuler2Line as so, RiShareLine as io, RiInformationLine as lo, RiCloseCircleLine as co, RiArrowUpDownLine as mo, RiArrowLeftRightLine as uo, RiArrowRightLine as po, RiArrowLeftLine as go, RiCloseLine as fo, RiZoomOutLine as ho, RiZoomInLine as bo, RiClockwise2Line as xo, RiAnticlockwise2Line as yo, RiMoreLine as vo, RiArrowDropDownLine as mt, RiCheckLine as ke, RiLink as ko, RiDeleteBinLine as ut, RiText as pt, RiH1 as gt, RiH2 as ft, RiH3 as ht, RiListCheck as bt, RiListUnordered as xt, RiListOrdered as yt, RiQuoteText as vt, RiCodeLine as kt, RiSparklingFill as Ge, RiImageLine as Co, RiArrowRightSLine as wo, RiRepeatLine as No, RiFileCopyLine as Io, RiAddLine as So, RiDraggable as To } from "@remixicon/react";
|
|
19
|
+
import Ct from "rc-dialog";
|
|
20
|
+
import Mo from "react-json-view";
|
|
21
|
+
import { AdmonitionDirectiveDescriptor as Lo, MDXEditor as Ao, toolbarPlugin as Do, diffSourcePlugin as Ro, listsPlugin as Po, quotePlugin as Bo, headingsPlugin as zo, linkPlugin as Eo, linkDialogPlugin as $o, imagePlugin as Ho, tablePlugin as Oo, thematicBreakPlugin as Fo, frontmatterPlugin as _o, codeBlockPlugin as jo, codeMirrorPlugin as Xo, markdownShortcutPlugin as Uo, directivesPlugin as Go, DiffSourceToggleWrapper as qo, UndoRedo as Yo, Separator as ce, BoldItalicUnderlineToggles as Vo, CodeToggle as Wo, StrikeThroughSupSubToggles as Ko, ListsToggle as Jo, CreateLink as Zo, InsertImage as Qo, InsertTable as er, InsertThematicBreak as tr, InsertCodeBlock as or, InsertFrontmatter as rr } from "@mdxeditor/editor";
|
|
22
|
+
import wt from "react-markdown";
|
|
23
|
+
import nr from "remark-gfm";
|
|
24
|
+
import ar from "remark-emoji";
|
|
25
|
+
import sr from "rehype-raw";
|
|
26
|
+
import { Prism as ir } from "react-syntax-highlighter";
|
|
27
|
+
import { oneLight as lr } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
28
|
+
import cr from "rc-image";
|
|
29
|
+
import { clsx as dr } from "clsx";
|
|
30
|
+
import { twMerge as mr } from "tailwind-merge";
|
|
31
|
+
import { Placeholder as ur, TiptapLink as pr, TiptapImage as gr, UploadImagesPlugin as fr, UpdatedImage as hr, TaskList as br, TaskItem as xr, HorizontalRule as yr, StarterKit as vr, CodeBlockLowlight as kr, Mathematics as Cr, CharacterCount as wr, AIHighlight as Nr, TiptapUnderline as Ir, HighlightExtension as Sr, TextStyle as Tr, Color as Mr, CustomKeymap as Lr, useEditor as Q, EditorBubbleItem as Pe, getPrevText as Ar, addAIHighlight as Dr, removeAIHighlight as Rr, EditorBubble as Pr, createImageUpload as Nt, Command as Br, createSuggestionItems as zr, renderItems as Er, EditorRoot as $r, EditorContent as Hr, handleImageDrop as Or, handleImagePaste as Fr, handleCommandNavigation as _r, EditorCommand as jr, EditorCommandEmpty as Xr, EditorCommandList as Ur, EditorCommandItem as Gr, ImageResizer as qr } from "novel";
|
|
32
|
+
import { useDebouncedCallback as Yr } from "use-debounce";
|
|
33
|
+
import { Markdown as Vr } from "tiptap-markdown";
|
|
34
|
+
import { cx as Y, cva as Wr } from "class-variance-authority";
|
|
35
|
+
import { createLowlight as Kr, common as Jr } from "lowlight";
|
|
36
|
+
import { Extension as Zr } from "@tiptap/core";
|
|
37
|
+
import { Plugin as Qr, PluginKey as en, NodeSelection as J, TextSelection as tn } from "prosemirror-state";
|
|
38
|
+
import { Slice as on, Fragment as rn } from "prosemirror-model";
|
|
39
|
+
import * as nn from "prosemirror-view";
|
|
40
|
+
import * as Ce from "@radix-ui/react-popover";
|
|
41
|
+
import { Popover as It, PopoverTrigger as an } from "@radix-ui/react-popover";
|
|
42
|
+
import { Slot as sn } from "@radix-ui/react-slot";
|
|
43
|
+
import { SigmaIcon as ln, X as cn, Check as dn, TextQuote as mn, TrashIcon as un, RefreshCcwDot as pn, CheckCheck as gn, ArrowDownWideNarrow as fn, WrapText as hn, StepForward as bn, ArrowUp as xn, BoldIcon as yn, ItalicIcon as vn, UnderlineIcon as kn, StrikethroughIcon as Cn, CodeIcon as wn } from "lucide-react";
|
|
44
|
+
import * as St from "@radix-ui/react-separator";
|
|
45
|
+
import { useCompletion as Nn } from "@ai-sdk/react";
|
|
46
|
+
import { toast as we } from "sonner";
|
|
47
47
|
import * as de from "@radix-ui/react-scroll-area";
|
|
48
48
|
import { Command as W } from "cmdk";
|
|
49
|
-
import * as
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import { generateHTML as
|
|
54
|
-
function
|
|
49
|
+
import * as oe from "@radix-ui/react-dialog";
|
|
50
|
+
import In from "highlight.js";
|
|
51
|
+
import Sn from "rc-dropdown";
|
|
52
|
+
import De from "rc-menu";
|
|
53
|
+
import { generateHTML as Tn } from "@tiptap/html";
|
|
54
|
+
function Mn(r, e) {
|
|
55
55
|
for (var o = 0; o < e.length; o++) {
|
|
56
|
-
const
|
|
57
|
-
if (typeof
|
|
58
|
-
for (const
|
|
59
|
-
if (
|
|
60
|
-
const s = Object.getOwnPropertyDescriptor(
|
|
61
|
-
s && Object.defineProperty(r,
|
|
56
|
+
const n = e[o];
|
|
57
|
+
if (typeof n != "string" && !Array.isArray(n)) {
|
|
58
|
+
for (const a in n)
|
|
59
|
+
if (a !== "default" && !(a in r)) {
|
|
60
|
+
const s = Object.getOwnPropertyDescriptor(n, a);
|
|
61
|
+
s && Object.defineProperty(r, a, s.get ? s : {
|
|
62
62
|
enumerable: !0,
|
|
63
|
-
get: () => a
|
|
63
|
+
get: () => n[a]
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const Ln = {
|
|
71
71
|
common: {
|
|
72
72
|
ok: "确定",
|
|
73
73
|
cancel: "取消",
|
|
@@ -92,7 +92,7 @@ const In = {
|
|
|
92
92
|
link: "链接",
|
|
93
93
|
image: "图片"
|
|
94
94
|
}
|
|
95
|
-
},
|
|
95
|
+
}, An = {
|
|
96
96
|
common: {
|
|
97
97
|
ok: "OK",
|
|
98
98
|
cancel: "Cancel",
|
|
@@ -117,20 +117,20 @@ const In = {
|
|
|
117
117
|
link: "Link",
|
|
118
118
|
image: "Image"
|
|
119
119
|
}
|
|
120
|
-
},
|
|
121
|
-
|
|
120
|
+
}, Dn = "common";
|
|
121
|
+
Zt.use(Qt).init({
|
|
122
122
|
resources: {
|
|
123
|
-
"zh-CN":
|
|
124
|
-
"en-US":
|
|
123
|
+
"zh-CN": Ln,
|
|
124
|
+
"en-US": An
|
|
125
125
|
},
|
|
126
126
|
lng: "zh-CN",
|
|
127
127
|
fallbackLng: "zh-CN",
|
|
128
|
-
defaultNS:
|
|
128
|
+
defaultNS: Dn,
|
|
129
129
|
interpolation: {
|
|
130
130
|
escapeValue: !1
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
const
|
|
133
|
+
const qe = {
|
|
134
134
|
token: {
|
|
135
135
|
itemNameColor: "#1a1a1a",
|
|
136
136
|
itemIconBackgroundColor: "white",
|
|
@@ -143,7 +143,7 @@ const _e = {
|
|
|
143
143
|
contextMenuBackgroundColor: "white",
|
|
144
144
|
contextMenuShadowColor: "rgba(0, 0, 0, 0.1)"
|
|
145
145
|
}
|
|
146
|
-
},
|
|
146
|
+
}, Ye = {
|
|
147
147
|
token: {
|
|
148
148
|
itemNameColor: "white",
|
|
149
149
|
itemIconBackgroundColor: "#1f2937",
|
|
@@ -156,27 +156,27 @@ const _e = {
|
|
|
156
156
|
contextMenuBackgroundColor: "#1a1a1a",
|
|
157
157
|
contextMenuShadowColor: "rgba(255, 255, 255, 0.1)"
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, Tt = st(
|
|
160
160
|
{}
|
|
161
|
-
),
|
|
162
|
-
const { children: e, theme: o, ...
|
|
163
|
-
return /* @__PURE__ */ t(
|
|
164
|
-
}, le = () =>
|
|
161
|
+
), Mt = (r) => {
|
|
162
|
+
const { children: e, theme: o, ...n } = r, a = be(() => o === "light" ? qe : o === "dark" ? Ye : o, [o]);
|
|
163
|
+
return /* @__PURE__ */ t(Tt.Provider, { value: { theme: a, ...n }, children: e });
|
|
164
|
+
}, le = () => it(Tt), Ve = {
|
|
165
165
|
maxRow: 2,
|
|
166
166
|
maxCol: 2
|
|
167
|
-
},
|
|
168
|
-
...
|
|
169
|
-
},
|
|
170
|
-
app:
|
|
171
|
-
group:
|
|
167
|
+
}, Lt = {
|
|
168
|
+
...Ve
|
|
169
|
+
}, Be = {
|
|
170
|
+
app: Ve,
|
|
171
|
+
group: Lt
|
|
172
172
|
};
|
|
173
173
|
class V {
|
|
174
174
|
}
|
|
175
175
|
/** 清理重复id */
|
|
176
|
-
|
|
177
|
-
const o =
|
|
178
|
-
return { light:
|
|
179
|
-
}),
|
|
176
|
+
Le(V, "uniqueArray", (e) => e.reduce((o, n) => o.find((s) => s.id === n.id) ? o : o.concat([n]), [])), Le(V, "getTheme", (e) => {
|
|
177
|
+
const o = qe.token, n = Ye.token, a = { ...o, ...e == null ? void 0 : e.token }, s = { ...n, ...e == null ? void 0 : e.token };
|
|
178
|
+
return { light: a, dark: s };
|
|
179
|
+
}), Le(V, "quickJSONCheck", (e) => {
|
|
180
180
|
if (typeof e != "string" || e.trim() === "") return !1;
|
|
181
181
|
if (!/^\s*(\{.*\}|\[.*\])\s*$/.test(e))
|
|
182
182
|
return /^\s*(".*?"|[\d.]+|true|false|null)\s*$/.test(e);
|
|
@@ -186,7 +186,7 @@ Te(V, "uniqueArray", (e) => e.reduce((o, a) => o.find((s) => s.id === a.id) ? o
|
|
|
186
186
|
return !1;
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
|
-
const
|
|
189
|
+
const At = st({
|
|
190
190
|
list: [],
|
|
191
191
|
setList: () => {
|
|
192
192
|
},
|
|
@@ -215,195 +215,226 @@ const Tt = rt({
|
|
|
215
215
|
},
|
|
216
216
|
addItem: () => {
|
|
217
217
|
},
|
|
218
|
+
addRootItem: () => {
|
|
219
|
+
},
|
|
220
|
+
updateRootItem: () => {
|
|
221
|
+
},
|
|
222
|
+
removeRootItem: () => {
|
|
223
|
+
},
|
|
218
224
|
moveItemId: null,
|
|
219
225
|
setMoveItemId: () => {
|
|
220
226
|
},
|
|
221
227
|
moveTargetId: null,
|
|
222
228
|
setMoveTargetId: () => {
|
|
223
229
|
}
|
|
224
|
-
}),
|
|
230
|
+
}), Dt = (r) => {
|
|
225
231
|
const {
|
|
226
232
|
children: e,
|
|
227
233
|
list: o = [],
|
|
228
|
-
onChange:
|
|
229
|
-
storageKey:
|
|
234
|
+
onChange: n,
|
|
235
|
+
storageKey: a = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
230
236
|
enableCaching: s = !0
|
|
231
|
-
} = r, [i, d] =
|
|
237
|
+
} = r, [i, d] = j(), [p, x] = j(), [l, c] = j(null), f = xe(l), [v, D] = j(null), [h, g] = j([]), [S, y] = j(
|
|
232
238
|
null
|
|
233
|
-
), [N, u] =
|
|
239
|
+
), [N, u] = j(
|
|
234
240
|
null
|
|
235
|
-
), [
|
|
241
|
+
), [T, A] = j(!1), [I, C] = j(null), [H, G] = j(
|
|
236
242
|
null
|
|
237
|
-
), [
|
|
243
|
+
), [O, se] = j(!1), [re, L] = no(a, {
|
|
238
244
|
defaultValue: [],
|
|
239
245
|
listenStorageChange: !0
|
|
240
|
-
}),
|
|
241
|
-
D(null), clearTimeout(i), d(void 0),
|
|
242
|
-
},
|
|
243
|
-
D({ ...
|
|
244
|
-
}, K = (
|
|
245
|
-
const { config:
|
|
246
|
-
return
|
|
247
|
-
onMouseDown: (
|
|
246
|
+
}), X = () => {
|
|
247
|
+
D(null), clearTimeout(i), d(void 0), f.current = null;
|
|
248
|
+
}, E = (w, B) => {
|
|
249
|
+
D({ ...w, pageX: w.pageX, pageY: w.pageY, data: B }), clearTimeout(i);
|
|
250
|
+
}, K = (w, B = !0) => {
|
|
251
|
+
const { config: z = {} } = w;
|
|
252
|
+
return z.allowContextMenu === !1 ? {} : {
|
|
253
|
+
onMouseDown: (M) => {
|
|
248
254
|
d(
|
|
249
255
|
setTimeout(() => {
|
|
250
|
-
|
|
256
|
+
B && f.current === null && E(M, w);
|
|
251
257
|
}, 800)
|
|
252
|
-
),
|
|
258
|
+
), A(!1), x(
|
|
253
259
|
setTimeout(() => {
|
|
254
|
-
|
|
260
|
+
A(!0);
|
|
255
261
|
}, 800)
|
|
256
262
|
);
|
|
257
263
|
},
|
|
258
264
|
onMouseUp: () => {
|
|
259
265
|
clearTimeout(p), x(void 0), clearTimeout(i), d(void 0);
|
|
260
266
|
},
|
|
261
|
-
onContextMenu: (
|
|
262
|
-
|
|
267
|
+
onContextMenu: (M) => {
|
|
268
|
+
B && (M.preventDefault(), E(M, w));
|
|
263
269
|
}
|
|
264
270
|
};
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (
|
|
274
|
-
(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
}, ee = to(
|
|
272
|
+
(w, B) => {
|
|
273
|
+
const z = [...B || []];
|
|
274
|
+
if (z.length > 0)
|
|
275
|
+
g((M) => {
|
|
276
|
+
const $ = [...M], F = (P) => {
|
|
277
|
+
var et, tt;
|
|
278
|
+
const _ = z.shift(), U = P.find((ne) => ne.id === _), te = P.findIndex((ne) => ne.id === _);
|
|
279
|
+
if (z.length && U) {
|
|
280
|
+
if (((et = U.children) == null ? void 0 : et.filter(
|
|
281
|
+
(ne) => !w.some((Wt) => Wt.id === ne.id)
|
|
282
|
+
).length) === 1 && w.length === 1) {
|
|
283
|
+
const ne = { ...w[0] };
|
|
284
|
+
return P.splice(te, 1, ne), n == null || n(P), P;
|
|
285
|
+
}
|
|
286
|
+
return U.children = F(U.children || []), P.splice(te, 1, U), n == null || n(P), P;
|
|
278
287
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return
|
|
288
|
+
if (U) {
|
|
289
|
+
if (!((tt = U.children) != null && tt.length) && w.length) {
|
|
290
|
+
const ne = { ...U };
|
|
291
|
+
return U.data = { name: "文件夹" }, U.type = "group", U.children = [ne, ...w], U.id = Oe(), P.splice(te, 1, U), n == null || n(P), P;
|
|
292
|
+
}
|
|
293
|
+
return U.children = V.uniqueArray(w), P.splice(te, 1, U), n == null || n(P), P;
|
|
285
294
|
}
|
|
286
|
-
return
|
|
287
|
-
}
|
|
288
|
-
return V.uniqueArray(
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
var
|
|
300
|
-
for (let
|
|
301
|
-
if (
|
|
302
|
-
|
|
295
|
+
return V.uniqueArray(w);
|
|
296
|
+
};
|
|
297
|
+
return V.uniqueArray(F($));
|
|
298
|
+
});
|
|
299
|
+
else {
|
|
300
|
+
const M = V.uniqueArray(w);
|
|
301
|
+
n == null || n(M), g(M);
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
[n]
|
|
305
|
+
), $e = (w, B) => {
|
|
306
|
+
g((z) => {
|
|
307
|
+
const M = [...z], $ = (F) => {
|
|
308
|
+
var P;
|
|
309
|
+
for (let _ = 0; _ < F.length; _++)
|
|
310
|
+
if (F[_].id === w) {
|
|
311
|
+
F[_].config = B;
|
|
303
312
|
break;
|
|
304
|
-
} else ((
|
|
313
|
+
} else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 && $(F[_].children);
|
|
305
314
|
};
|
|
306
|
-
return
|
|
315
|
+
return $(M), n == null || n(M), M;
|
|
307
316
|
});
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
var
|
|
312
|
-
for (let
|
|
313
|
-
if (
|
|
314
|
-
|
|
317
|
+
}, Se = (w, B) => {
|
|
318
|
+
g((z) => {
|
|
319
|
+
const M = [...z], $ = (F) => {
|
|
320
|
+
var P;
|
|
321
|
+
for (let _ = 0; _ < F.length; _++)
|
|
322
|
+
if (F[_].id === w) {
|
|
323
|
+
F[_].data = B;
|
|
315
324
|
break;
|
|
316
|
-
} else ((
|
|
325
|
+
} else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 && $(F[_].children);
|
|
317
326
|
};
|
|
318
|
-
return
|
|
327
|
+
return $(M), n == null || n(M), M;
|
|
319
328
|
});
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
const
|
|
323
|
-
var
|
|
324
|
-
for (let
|
|
325
|
-
if (P
|
|
326
|
-
|
|
329
|
+
}, Te = (w) => {
|
|
330
|
+
g((B) => {
|
|
331
|
+
const z = [...B], M = ($) => {
|
|
332
|
+
var F;
|
|
333
|
+
for (let P = 0; P < $.length; P++)
|
|
334
|
+
if ($[P].id === w) {
|
|
335
|
+
$.splice(P, 1);
|
|
327
336
|
break;
|
|
328
|
-
} else ((
|
|
337
|
+
} else ((F = $[P].children) == null ? void 0 : F.length) !== void 0 && M($[P].children);
|
|
329
338
|
};
|
|
330
|
-
return
|
|
339
|
+
return M(z), n == null || n(z), z;
|
|
331
340
|
});
|
|
332
|
-
}, ie = (
|
|
333
|
-
const
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
336
|
-
if (
|
|
337
|
-
|
|
341
|
+
}, ie = (w, B) => {
|
|
342
|
+
const z = [...h], M = ($, F) => {
|
|
343
|
+
const P = F.shift(), _ = $.find((te) => te.id === P), U = $.findIndex((te) => te.id === P);
|
|
344
|
+
if (_) {
|
|
345
|
+
if (F.length)
|
|
346
|
+
_.children = M(_.children || [], F);
|
|
338
347
|
else {
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
...
|
|
348
|
+
const te = (w == null ? void 0 : w.type) ?? "app";
|
|
349
|
+
_.children = [
|
|
350
|
+
..._.children ?? [],
|
|
342
351
|
{
|
|
343
|
-
...
|
|
344
|
-
id:
|
|
345
|
-
config: (
|
|
352
|
+
...w,
|
|
353
|
+
id: Oe(),
|
|
354
|
+
config: (w == null ? void 0 : w.config) ?? Be[te]
|
|
346
355
|
}
|
|
347
356
|
];
|
|
348
357
|
}
|
|
349
|
-
return
|
|
358
|
+
return $.splice(U, 1, _), $;
|
|
350
359
|
} else
|
|
351
|
-
return
|
|
360
|
+
return $;
|
|
352
361
|
};
|
|
353
|
-
|
|
362
|
+
g(M(z, B));
|
|
363
|
+
}, Me = (w) => {
|
|
364
|
+
g((B) => {
|
|
365
|
+
const z = (w == null ? void 0 : w.type) ?? "app", M = {
|
|
366
|
+
...w,
|
|
367
|
+
id: Oe(),
|
|
368
|
+
config: (w == null ? void 0 : w.config) ?? Be[z]
|
|
369
|
+
}, $ = [...B, M];
|
|
370
|
+
return n == null || n($), $;
|
|
371
|
+
});
|
|
372
|
+
}, He = (w, B) => {
|
|
373
|
+
g((z) => {
|
|
374
|
+
const M = [...z], $ = M.findIndex((F) => F.id === w);
|
|
375
|
+
return $ !== -1 && (M[$] = { ...M[$], ...B }, n == null || n(M)), M;
|
|
376
|
+
});
|
|
377
|
+
}, ye = (w) => {
|
|
378
|
+
g((B) => {
|
|
379
|
+
const z = B.filter((M) => M.id !== w);
|
|
380
|
+
return n == null || n(z), z;
|
|
381
|
+
});
|
|
354
382
|
};
|
|
355
383
|
return ae(() => {
|
|
356
|
-
(o == null ? void 0 : o.length) > 0 && h.length === 0 &&
|
|
384
|
+
(o == null ? void 0 : o.length) > 0 && h.length === 0 && ee(o);
|
|
357
385
|
}, [o]), ae(() => {
|
|
358
|
-
|
|
386
|
+
f.current = l, l !== null && X();
|
|
359
387
|
}, [l]), ae(() => {
|
|
360
|
-
s &&
|
|
361
|
-
}, [
|
|
388
|
+
s && re != null && re.length && !O && (ee(re), se(!0));
|
|
389
|
+
}, [re, O, s, ee]), ao(
|
|
362
390
|
() => {
|
|
363
|
-
s &&
|
|
391
|
+
s && L(h);
|
|
364
392
|
},
|
|
365
393
|
[h, s],
|
|
366
394
|
{
|
|
367
395
|
wait: 1e3
|
|
368
396
|
}
|
|
369
397
|
), /* @__PURE__ */ t(
|
|
370
|
-
|
|
398
|
+
At.Provider,
|
|
371
399
|
{
|
|
372
400
|
value: {
|
|
373
401
|
list: h,
|
|
374
|
-
setList:
|
|
402
|
+
setList: ee,
|
|
375
403
|
contextMenu: v,
|
|
376
404
|
setContextMenu: D,
|
|
377
405
|
listStatus: l,
|
|
378
406
|
setListStatus: c,
|
|
379
407
|
contextMenuFuns: K,
|
|
380
|
-
hideContextMenu:
|
|
381
|
-
showInfoItemData:
|
|
408
|
+
hideContextMenu: X,
|
|
409
|
+
showInfoItemData: S,
|
|
382
410
|
setShowInfoItemData: y,
|
|
383
411
|
openGroupItemData: N,
|
|
384
412
|
setOpenGroupItemData: u,
|
|
385
|
-
longPressTriggered:
|
|
386
|
-
updateItemConfig:
|
|
387
|
-
updateItem:
|
|
388
|
-
removeItem:
|
|
413
|
+
longPressTriggered: T,
|
|
414
|
+
updateItemConfig: $e,
|
|
415
|
+
updateItem: Se,
|
|
416
|
+
removeItem: Te,
|
|
389
417
|
addItem: ie,
|
|
390
|
-
|
|
418
|
+
addRootItem: Me,
|
|
419
|
+
updateRootItem: He,
|
|
420
|
+
removeRootItem: ye,
|
|
421
|
+
moveItemId: I,
|
|
391
422
|
setMoveItemId: C,
|
|
392
|
-
moveTargetId:
|
|
393
|
-
setMoveTargetId:
|
|
423
|
+
moveTargetId: H,
|
|
424
|
+
setMoveTargetId: G
|
|
394
425
|
},
|
|
395
426
|
children: e
|
|
396
427
|
}
|
|
397
428
|
);
|
|
398
|
-
}, pe = () =>
|
|
429
|
+
}, pe = () => it(At), Rn = {
|
|
399
430
|
menuShow: {
|
|
400
431
|
opacity: 1,
|
|
401
432
|
y: 0,
|
|
402
433
|
transition: { type: "spring", stiffness: 300, damping: 24 }
|
|
403
434
|
},
|
|
404
435
|
menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
|
|
405
|
-
},
|
|
406
|
-
const { icon: e, title: o, onClick:
|
|
436
|
+
}, Fe = (r) => {
|
|
437
|
+
const { icon: e, title: o, onClick: n } = r, { theme: a } = le(), { light: s, dark: i } = V.getTheme(a);
|
|
407
438
|
return /* @__PURE__ */ t(
|
|
408
439
|
R.div,
|
|
409
440
|
{
|
|
@@ -425,9 +456,9 @@ const Tt = rt({
|
|
|
425
456
|
border-radius: 0.5rem;
|
|
426
457
|
`,
|
|
427
458
|
onClick: (d) => {
|
|
428
|
-
d.stopPropagation(),
|
|
459
|
+
d.stopPropagation(), n == null || n();
|
|
429
460
|
},
|
|
430
|
-
variants:
|
|
461
|
+
variants: Rn,
|
|
431
462
|
children: /* @__PURE__ */ m(
|
|
432
463
|
R.div,
|
|
433
464
|
{
|
|
@@ -462,12 +493,12 @@ const Tt = rt({
|
|
|
462
493
|
)
|
|
463
494
|
}
|
|
464
495
|
);
|
|
465
|
-
},
|
|
496
|
+
}, Pn = (r) => {
|
|
466
497
|
const {
|
|
467
498
|
showInfoButton: e = !0,
|
|
468
499
|
showRemoveButton: o = !0,
|
|
469
|
-
showShareButton:
|
|
470
|
-
showSizeButton:
|
|
500
|
+
showShareButton: n = !0,
|
|
501
|
+
showSizeButton: a = !0,
|
|
471
502
|
onInfoClick: s,
|
|
472
503
|
onShareClick: i,
|
|
473
504
|
onRemoveClick: d
|
|
@@ -476,17 +507,17 @@ const Tt = rt({
|
|
|
476
507
|
setContextMenu: x,
|
|
477
508
|
hideContextMenu: l,
|
|
478
509
|
setShowInfoItemData: c,
|
|
479
|
-
removeItem:
|
|
510
|
+
removeItem: f,
|
|
480
511
|
updateItemConfig: v
|
|
481
|
-
} = pe(), { theme: D } = le(), { light: h, dark:
|
|
482
|
-
var
|
|
483
|
-
const u =
|
|
484
|
-
for (let
|
|
512
|
+
} = pe(), { theme: D } = le(), { light: h, dark: g } = V.getTheme(D), { data: S } = p ?? {}, { config: y = {} } = S ?? {}, N = () => {
|
|
513
|
+
var A;
|
|
514
|
+
const u = Be[(A = p == null ? void 0 : p.data) == null ? void 0 : A.type], T = [];
|
|
515
|
+
for (let I = 1; I <= ((u == null ? void 0 : u.maxRow) ?? 2); I++)
|
|
485
516
|
for (let C = 1; C <= ((u == null ? void 0 : u.maxCol) ?? 2); C++)
|
|
486
|
-
|
|
487
|
-
return
|
|
517
|
+
T.push(`${I}x${C}`);
|
|
518
|
+
return T;
|
|
488
519
|
};
|
|
489
|
-
return /* @__PURE__ */ t(
|
|
520
|
+
return /* @__PURE__ */ t(Ue, { children: p && /* @__PURE__ */ m(
|
|
490
521
|
R.div,
|
|
491
522
|
{
|
|
492
523
|
initial: { opacity: 0 },
|
|
@@ -506,12 +537,12 @@ const Tt = rt({
|
|
|
506
537
|
background-color: ${h.contextMenuBackgroundColor};
|
|
507
538
|
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
508
539
|
@media (prefers-color-scheme: dark) {
|
|
509
|
-
background-color: ${
|
|
510
|
-
box-shadow: 0 0 0.5rem ${
|
|
540
|
+
background-color: ${g.contextMenuBackgroundColor};
|
|
541
|
+
box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
|
|
511
542
|
}
|
|
512
543
|
`
|
|
513
544
|
),
|
|
514
|
-
children:
|
|
545
|
+
children: a && y.allowResize !== !1 && /* @__PURE__ */ t(
|
|
515
546
|
R.ul,
|
|
516
547
|
{
|
|
517
548
|
className: b`
|
|
@@ -523,15 +554,15 @@ const Tt = rt({
|
|
|
523
554
|
{
|
|
524
555
|
label: "修改大小",
|
|
525
556
|
key: "size",
|
|
526
|
-
icon: /* @__PURE__ */ t(
|
|
557
|
+
icon: /* @__PURE__ */ t(so, { size: 14 }),
|
|
527
558
|
items: N().map((u) => ({
|
|
528
559
|
label: u,
|
|
529
560
|
key: u,
|
|
530
561
|
onClick: () => {
|
|
531
|
-
const [
|
|
562
|
+
const [T, A] = u.split("x").map(Number);
|
|
532
563
|
v(p.data.id, {
|
|
533
|
-
row:
|
|
534
|
-
col:
|
|
564
|
+
row: T,
|
|
565
|
+
col: A
|
|
535
566
|
});
|
|
536
567
|
}
|
|
537
568
|
}))
|
|
@@ -559,7 +590,7 @@ const Tt = rt({
|
|
|
559
590
|
margin: 0;
|
|
560
591
|
color: ${h.contextMenuTextColor};
|
|
561
592
|
@media (prefers-color-scheme: dark) {
|
|
562
|
-
color: ${
|
|
593
|
+
color: ${g.contextMenuTextColor};
|
|
563
594
|
}
|
|
564
595
|
`,
|
|
565
596
|
children: [
|
|
@@ -577,7 +608,7 @@ const Tt = rt({
|
|
|
577
608
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
578
609
|
gap: 0.25rem;
|
|
579
610
|
`,
|
|
580
|
-
children: u.items.map((
|
|
611
|
+
children: u.items.map((T) => /* @__PURE__ */ t(
|
|
581
612
|
R.div,
|
|
582
613
|
{
|
|
583
614
|
className: k(
|
|
@@ -595,26 +626,26 @@ const Tt = rt({
|
|
|
595
626
|
text-align: center;
|
|
596
627
|
color: ${h.contextMenuTextColor};
|
|
597
628
|
@media (prefers-color-scheme: dark) {
|
|
598
|
-
color: ${
|
|
629
|
+
color: ${g.contextMenuTextColor};
|
|
599
630
|
}
|
|
600
631
|
&:hover {
|
|
601
632
|
background-color: ${h.contextMenuActiveColor};
|
|
602
633
|
@media (prefers-color-scheme: dark) {
|
|
603
|
-
background-color: ${
|
|
634
|
+
background-color: ${g.contextMenuActiveColor};
|
|
604
635
|
}
|
|
605
636
|
}
|
|
606
637
|
`,
|
|
607
|
-
`${y.row}x${y.col}` ===
|
|
638
|
+
`${y.row}x${y.col}` === T.key && b`
|
|
608
639
|
background-color: ${h.contextMenuActiveColor};
|
|
609
640
|
@media (prefers-color-scheme: dark) {
|
|
610
|
-
background-color: ${
|
|
641
|
+
background-color: ${g.contextMenuActiveColor};
|
|
611
642
|
}
|
|
612
643
|
`
|
|
613
644
|
),
|
|
614
|
-
onClick:
|
|
615
|
-
children:
|
|
645
|
+
onClick: T.onClick,
|
|
646
|
+
children: T.label
|
|
616
647
|
},
|
|
617
|
-
|
|
648
|
+
T.key
|
|
618
649
|
))
|
|
619
650
|
}
|
|
620
651
|
)
|
|
@@ -634,8 +665,8 @@ const Tt = rt({
|
|
|
634
665
|
background-color: ${h.contextMenuBackgroundColor};
|
|
635
666
|
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
636
667
|
@media (prefers-color-scheme: dark) {
|
|
637
|
-
background-color: ${
|
|
638
|
-
box-shadow: 0 0 0.5rem ${
|
|
668
|
+
background-color: ${g.contextMenuBackgroundColor};
|
|
669
|
+
box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
|
|
639
670
|
}
|
|
640
671
|
display: flex;
|
|
641
672
|
justify-content: space-around;
|
|
@@ -647,10 +678,10 @@ const Tt = rt({
|
|
|
647
678
|
`
|
|
648
679
|
),
|
|
649
680
|
children: [
|
|
650
|
-
|
|
651
|
-
|
|
681
|
+
n && /* @__PURE__ */ t(
|
|
682
|
+
Fe,
|
|
652
683
|
{
|
|
653
|
-
icon: /* @__PURE__ */ t(
|
|
684
|
+
icon: /* @__PURE__ */ t(io, { size: 20 }),
|
|
654
685
|
title: "分享",
|
|
655
686
|
onClick: () => {
|
|
656
687
|
if (i) {
|
|
@@ -661,9 +692,9 @@ const Tt = rt({
|
|
|
661
692
|
}
|
|
662
693
|
),
|
|
663
694
|
e && /* @__PURE__ */ t(
|
|
664
|
-
|
|
695
|
+
Fe,
|
|
665
696
|
{
|
|
666
|
-
icon: /* @__PURE__ */ t(
|
|
697
|
+
icon: /* @__PURE__ */ t(lo, { size: 20 }),
|
|
667
698
|
title: "信息",
|
|
668
699
|
onClick: () => {
|
|
669
700
|
if (s) {
|
|
@@ -679,16 +710,16 @@ const Tt = rt({
|
|
|
679
710
|
}
|
|
680
711
|
),
|
|
681
712
|
o && /* @__PURE__ */ t(
|
|
682
|
-
|
|
713
|
+
Fe,
|
|
683
714
|
{
|
|
684
|
-
icon: /* @__PURE__ */ t(
|
|
715
|
+
icon: /* @__PURE__ */ t(co, { size: 20 }),
|
|
685
716
|
title: "移除",
|
|
686
717
|
onClick: () => {
|
|
687
718
|
if (d) {
|
|
688
|
-
d(p.data,
|
|
719
|
+
d(p.data, f);
|
|
689
720
|
return;
|
|
690
721
|
}
|
|
691
|
-
x(null),
|
|
722
|
+
x(null), f(p.data.id);
|
|
692
723
|
}
|
|
693
724
|
}
|
|
694
725
|
)
|
|
@@ -698,8 +729,8 @@ const Tt = rt({
|
|
|
698
729
|
]
|
|
699
730
|
}
|
|
700
731
|
) });
|
|
701
|
-
},
|
|
702
|
-
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns:
|
|
732
|
+
}, Bn = (r) => {
|
|
733
|
+
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: n } = pe(), { itemIconBuilder: a, theme: s, contextMenu: i } = le(), { light: d, dark: p } = V.getTheme(s), { data: x = {} } = e, { name: l } = x;
|
|
703
734
|
return /* @__PURE__ */ m(ue, { children: [
|
|
704
735
|
/* @__PURE__ */ t(
|
|
705
736
|
R.div,
|
|
@@ -733,8 +764,8 @@ const Tt = rt({
|
|
|
733
764
|
color: ${p.itemNameColor};
|
|
734
765
|
}
|
|
735
766
|
`,
|
|
736
|
-
...
|
|
737
|
-
children:
|
|
767
|
+
...n(e, i !== !1),
|
|
768
|
+
children: a == null ? void 0 : a(e)
|
|
738
769
|
}
|
|
739
770
|
)
|
|
740
771
|
}
|
|
@@ -758,19 +789,19 @@ const Tt = rt({
|
|
|
758
789
|
}
|
|
759
790
|
)
|
|
760
791
|
] });
|
|
761
|
-
},
|
|
792
|
+
}, We = (r) => {
|
|
762
793
|
const {
|
|
763
794
|
data: e,
|
|
764
795
|
className: o,
|
|
765
|
-
itemIndex:
|
|
766
|
-
onClick:
|
|
796
|
+
itemIndex: n,
|
|
797
|
+
onClick: a,
|
|
767
798
|
disabledDrag: s = !1,
|
|
768
799
|
children: i,
|
|
769
800
|
parentIds: d,
|
|
770
801
|
childrenLength: p
|
|
771
802
|
} = r, { contextMenu: x, setContextMenu: l } = pe(), { contextMenu: c } = le();
|
|
772
803
|
return /* @__PURE__ */ t(
|
|
773
|
-
|
|
804
|
+
dt,
|
|
774
805
|
{
|
|
775
806
|
placement: "bottom",
|
|
776
807
|
overlayClassName: b`
|
|
@@ -781,32 +812,32 @@ const Tt = rt({
|
|
|
781
812
|
border: none;
|
|
782
813
|
}
|
|
783
814
|
`,
|
|
784
|
-
overlay: /* @__PURE__ */ t(
|
|
815
|
+
overlay: /* @__PURE__ */ t(Pn, { ...c }),
|
|
785
816
|
visible: (x == null ? void 0 : x.data.id) === e.id,
|
|
786
|
-
onVisibleChange: (
|
|
787
|
-
|
|
817
|
+
onVisibleChange: (f) => {
|
|
818
|
+
f || l(null);
|
|
788
819
|
},
|
|
789
820
|
destroyTooltipOnHide: !0,
|
|
790
821
|
children: /* @__PURE__ */ t(
|
|
791
822
|
R.div,
|
|
792
823
|
{
|
|
793
824
|
"data-id": e.id,
|
|
794
|
-
"data-index":
|
|
825
|
+
"data-index": n,
|
|
795
826
|
"data-parent-ids": d == null ? void 0 : d.join(","),
|
|
796
827
|
"data-children-length": p,
|
|
797
|
-
onClick: () =>
|
|
828
|
+
onClick: () => a == null ? void 0 : a(e),
|
|
798
829
|
className: k(s && "drag-disabled", o),
|
|
799
|
-
children: i ?? /* @__PURE__ */ t(
|
|
830
|
+
children: i ?? /* @__PURE__ */ t(Bn, { ...r })
|
|
800
831
|
}
|
|
801
832
|
)
|
|
802
833
|
}
|
|
803
834
|
);
|
|
804
|
-
},
|
|
835
|
+
}, zn = (r) => {
|
|
805
836
|
const {
|
|
806
837
|
data: e,
|
|
807
838
|
className: o,
|
|
808
|
-
parentIds:
|
|
809
|
-
itemIndex:
|
|
839
|
+
parentIds: n,
|
|
840
|
+
itemIndex: a,
|
|
810
841
|
onClick: s,
|
|
811
842
|
noLetters: i = !1
|
|
812
843
|
} = r, {
|
|
@@ -815,13 +846,13 @@ const Tt = rt({
|
|
|
815
846
|
setOpenGroupItemData: x,
|
|
816
847
|
longPressTriggered: l,
|
|
817
848
|
moveItemId: c,
|
|
818
|
-
moveTargetId:
|
|
849
|
+
moveTargetId: f,
|
|
819
850
|
setMoveTargetId: v,
|
|
820
851
|
listStatus: D
|
|
821
|
-
} = pe(), { itemIconBuilder: h, theme:
|
|
852
|
+
} = pe(), { itemIconBuilder: h, theme: g, contextMenu: S } = le(), { light: y, dark: N } = V.getTheme(g), { children: u, data: T, config: A } = e, { row: I = 1, col: C = 1 } = A ?? {}, H = {
|
|
822
853
|
visible: { opacity: 1, scale: 1 },
|
|
823
854
|
hidden: { opacity: 0, scale: 0.95 }
|
|
824
|
-
},
|
|
855
|
+
}, G = ((u == null ? void 0 : u.length) ?? 0) === 0, O = G ? [e] : [...u ?? []].slice(0, 9), se = be(() => c === e.id.toString(), [e.id, c]), re = be(() => f === e.id, [e.id, f]), L = b`
|
|
825
856
|
overflow: hidden;
|
|
826
857
|
cursor: pointer;
|
|
827
858
|
background-color: ${y.itemIconBackgroundColor};
|
|
@@ -830,8 +861,8 @@ const Tt = rt({
|
|
|
830
861
|
background-color: ${N.itemIconBackgroundColor};
|
|
831
862
|
box-shadow: 0 0 0.5rem ${N.itemIconShadowColor};
|
|
832
863
|
}
|
|
833
|
-
`,
|
|
834
|
-
if (
|
|
864
|
+
`, X = () => {
|
|
865
|
+
if (G)
|
|
835
866
|
return /* @__PURE__ */ t(
|
|
836
867
|
R.div,
|
|
837
868
|
{
|
|
@@ -852,13 +883,13 @@ const Tt = rt({
|
|
|
852
883
|
}
|
|
853
884
|
`
|
|
854
885
|
),
|
|
855
|
-
onClick: (
|
|
856
|
-
|
|
886
|
+
onClick: (E) => {
|
|
887
|
+
E.stopPropagation(), s == null || s(e);
|
|
857
888
|
},
|
|
858
889
|
children: h == null ? void 0 : h(e)
|
|
859
890
|
}
|
|
860
891
|
);
|
|
861
|
-
if (
|
|
892
|
+
if (I === 1 && C === 1 || I === 2 && C === 2)
|
|
862
893
|
return /* @__PURE__ */ t(
|
|
863
894
|
R.div,
|
|
864
895
|
{
|
|
@@ -872,11 +903,11 @@ const Tt = rt({
|
|
|
872
903
|
gap: ${C === 1 ? "0.125rem" : "0.5rem"};
|
|
873
904
|
place-items: center;
|
|
874
905
|
`,
|
|
875
|
-
children:
|
|
906
|
+
children: O == null ? void 0 : O.slice(0, 9).map((E) => /* @__PURE__ */ t(
|
|
876
907
|
R.div,
|
|
877
908
|
{
|
|
878
909
|
className: k(
|
|
879
|
-
|
|
910
|
+
L,
|
|
880
911
|
b`
|
|
881
912
|
border-radius: ${C === 1 ? "0.25rem" : "0.5rem"};
|
|
882
913
|
width: 100%;
|
|
@@ -884,15 +915,15 @@ const Tt = rt({
|
|
|
884
915
|
`
|
|
885
916
|
),
|
|
886
917
|
onClick: (K) => {
|
|
887
|
-
K.stopPropagation(), s == null || s(
|
|
918
|
+
K.stopPropagation(), s == null || s(E);
|
|
888
919
|
},
|
|
889
|
-
children: h == null ? void 0 : h(
|
|
920
|
+
children: h == null ? void 0 : h(E)
|
|
890
921
|
},
|
|
891
|
-
|
|
922
|
+
E.id
|
|
892
923
|
))
|
|
893
924
|
}
|
|
894
925
|
);
|
|
895
|
-
if (
|
|
926
|
+
if (I === 1 && C === 2)
|
|
896
927
|
return /* @__PURE__ */ t(
|
|
897
928
|
R.div,
|
|
898
929
|
{
|
|
@@ -906,11 +937,11 @@ const Tt = rt({
|
|
|
906
937
|
height: 52px;
|
|
907
938
|
place-items: center;
|
|
908
939
|
`,
|
|
909
|
-
children:
|
|
940
|
+
children: O == null ? void 0 : O.slice(0, 4).map((E, K) => /* @__PURE__ */ t(
|
|
910
941
|
R.div,
|
|
911
942
|
{
|
|
912
943
|
className: k(
|
|
913
|
-
|
|
944
|
+
L,
|
|
914
945
|
K < 2 ? b`
|
|
915
946
|
width: 52px;
|
|
916
947
|
height: 52px;
|
|
@@ -925,16 +956,16 @@ const Tt = rt({
|
|
|
925
956
|
grid-row: span 2 / span 2;
|
|
926
957
|
`
|
|
927
958
|
),
|
|
928
|
-
onClick: (
|
|
929
|
-
K > 2 || (
|
|
959
|
+
onClick: (ee) => {
|
|
960
|
+
K > 2 || (ee.stopPropagation(), s == null || s(E));
|
|
930
961
|
},
|
|
931
|
-
children: h == null ? void 0 : h(
|
|
962
|
+
children: h == null ? void 0 : h(E)
|
|
932
963
|
},
|
|
933
|
-
|
|
964
|
+
E.id
|
|
934
965
|
))
|
|
935
966
|
}
|
|
936
967
|
);
|
|
937
|
-
if (
|
|
968
|
+
if (I === 2 && C === 1)
|
|
938
969
|
return /* @__PURE__ */ t(
|
|
939
970
|
R.div,
|
|
940
971
|
{
|
|
@@ -948,11 +979,11 @@ const Tt = rt({
|
|
|
948
979
|
height: 144px;
|
|
949
980
|
place-items: center;
|
|
950
981
|
`,
|
|
951
|
-
children:
|
|
982
|
+
children: O == null ? void 0 : O.slice(0, 4).map((E, K) => /* @__PURE__ */ t(
|
|
952
983
|
R.div,
|
|
953
984
|
{
|
|
954
985
|
className: k(
|
|
955
|
-
|
|
986
|
+
L,
|
|
956
987
|
K < 2 ? b`
|
|
957
988
|
width: 52px;
|
|
958
989
|
height: 52px;
|
|
@@ -966,26 +997,26 @@ const Tt = rt({
|
|
|
966
997
|
grid-row: span 2 / span 2;
|
|
967
998
|
`
|
|
968
999
|
),
|
|
969
|
-
onClick: (
|
|
970
|
-
K > 2 || (
|
|
1000
|
+
onClick: (ee) => {
|
|
1001
|
+
K > 2 || (ee.stopPropagation(), s == null || s(E));
|
|
971
1002
|
},
|
|
972
|
-
children: h == null ? void 0 : h(
|
|
1003
|
+
children: h == null ? void 0 : h(E)
|
|
973
1004
|
},
|
|
974
|
-
|
|
1005
|
+
E.id
|
|
975
1006
|
))
|
|
976
1007
|
}
|
|
977
1008
|
);
|
|
978
1009
|
};
|
|
979
1010
|
return /* @__PURE__ */ m(
|
|
980
|
-
|
|
1011
|
+
We,
|
|
981
1012
|
{
|
|
982
1013
|
data: e,
|
|
983
|
-
itemIndex:
|
|
984
|
-
parentIds:
|
|
1014
|
+
itemIndex: a,
|
|
1015
|
+
parentIds: n,
|
|
985
1016
|
childrenLength: u == null ? void 0 : u.length,
|
|
986
1017
|
className: k(
|
|
987
1018
|
b`
|
|
988
|
-
grid-row: span ${
|
|
1019
|
+
grid-row: span ${I};
|
|
989
1020
|
grid-column: span ${C};
|
|
990
1021
|
`,
|
|
991
1022
|
o
|
|
@@ -996,7 +1027,7 @@ const Tt = rt({
|
|
|
996
1027
|
{
|
|
997
1028
|
whileTap: { scale: 0.9 },
|
|
998
1029
|
className: k(
|
|
999
|
-
|
|
1030
|
+
re ? "!scale-110" : "",
|
|
1000
1031
|
b`
|
|
1001
1032
|
cursor: pointer;
|
|
1002
1033
|
position: relative;
|
|
@@ -1011,13 +1042,13 @@ const Tt = rt({
|
|
|
1011
1042
|
transition: all 0.3s;
|
|
1012
1043
|
margin: 0 auto;
|
|
1013
1044
|
width: ${C * 64 + 32 * (C - 1)}px;
|
|
1014
|
-
height: ${
|
|
1045
|
+
height: ${I * 64 + 32 * (I - 1)}px;
|
|
1015
1046
|
`
|
|
1016
1047
|
),
|
|
1017
|
-
onClick: (
|
|
1018
|
-
!
|
|
1048
|
+
onClick: (E) => {
|
|
1049
|
+
!G && !l && (e.parentIds = n, e.pageX = E.pageX, e.pageY = E.pageY, x(e));
|
|
1019
1050
|
},
|
|
1020
|
-
...d(e,
|
|
1051
|
+
...d(e, S !== !1),
|
|
1021
1052
|
children: /* @__PURE__ */ m(
|
|
1022
1053
|
R.div,
|
|
1023
1054
|
{
|
|
@@ -1031,9 +1062,9 @@ const Tt = rt({
|
|
|
1031
1062
|
padding: 0.375rem;
|
|
1032
1063
|
`,
|
|
1033
1064
|
children: [
|
|
1034
|
-
|
|
1065
|
+
X(),
|
|
1035
1066
|
/* @__PURE__ */ t(
|
|
1036
|
-
|
|
1067
|
+
Xe,
|
|
1037
1068
|
{
|
|
1038
1069
|
className: k(
|
|
1039
1070
|
"sortable-group-item",
|
|
@@ -1054,7 +1085,7 @@ const Tt = rt({
|
|
|
1054
1085
|
animation: 150,
|
|
1055
1086
|
fallbackOnBody: !0,
|
|
1056
1087
|
list: u ?? [],
|
|
1057
|
-
setList: (
|
|
1088
|
+
setList: (E) => p(E, n),
|
|
1058
1089
|
filter: () => !0,
|
|
1059
1090
|
"data-id": e.id,
|
|
1060
1091
|
onChange: () => {
|
|
@@ -1082,15 +1113,15 @@ const Tt = rt({
|
|
|
1082
1113
|
color: transparent;
|
|
1083
1114
|
`
|
|
1084
1115
|
),
|
|
1085
|
-
variants:
|
|
1116
|
+
variants: H,
|
|
1086
1117
|
animate: se ? "hidden" : "visible",
|
|
1087
|
-
children: (
|
|
1118
|
+
children: (T == null ? void 0 : T.name) ?? "文件夹"
|
|
1088
1119
|
}
|
|
1089
1120
|
)
|
|
1090
1121
|
]
|
|
1091
1122
|
}
|
|
1092
1123
|
);
|
|
1093
|
-
},
|
|
1124
|
+
}, Rt = b`
|
|
1094
1125
|
padding: 8px;
|
|
1095
1126
|
transition: all 0.2s;
|
|
1096
1127
|
> div {
|
|
@@ -1102,20 +1133,20 @@ const Tt = rt({
|
|
|
1102
1133
|
transition: all 0.2s;
|
|
1103
1134
|
}
|
|
1104
1135
|
}
|
|
1105
|
-
`,
|
|
1106
|
-
const { data: e, onClose: o, onItemClick:
|
|
1107
|
-
list:
|
|
1136
|
+
`, En = (r) => {
|
|
1137
|
+
const { data: e, onClose: o, onItemClick: n } = r, {
|
|
1138
|
+
list: a,
|
|
1108
1139
|
setList: s,
|
|
1109
1140
|
setListStatus: i,
|
|
1110
1141
|
setMoveItemId: d,
|
|
1111
1142
|
setMoveTargetId: p,
|
|
1112
1143
|
updateItem: x
|
|
1113
|
-
} = pe(), { theme: l } = le(), { light: c, dark:
|
|
1144
|
+
} = pe(), { theme: l } = le(), { light: c, dark: f } = V.getTheme(l), [v, D] = j("文件夹"), h = [...(e == null ? void 0 : e.children) ?? []];
|
|
1114
1145
|
return ae(() => {
|
|
1115
|
-
var
|
|
1116
|
-
e && D((
|
|
1146
|
+
var g;
|
|
1147
|
+
e && D((g = e.data) == null ? void 0 : g.name);
|
|
1117
1148
|
}, [e]), /* @__PURE__ */ t(
|
|
1118
|
-
|
|
1149
|
+
Ct,
|
|
1119
1150
|
{
|
|
1120
1151
|
visible: !!e,
|
|
1121
1152
|
onClose: () => {
|
|
@@ -1145,8 +1176,8 @@ const Tt = rt({
|
|
|
1145
1176
|
}
|
|
1146
1177
|
`,
|
|
1147
1178
|
value: v,
|
|
1148
|
-
onChange: (
|
|
1149
|
-
D(
|
|
1179
|
+
onChange: (g) => {
|
|
1180
|
+
D(g.target.value);
|
|
1150
1181
|
},
|
|
1151
1182
|
onBlur: () => {
|
|
1152
1183
|
e && x(e.id, {
|
|
@@ -1177,7 +1208,7 @@ const Tt = rt({
|
|
|
1177
1208
|
.rc-dialog-body {
|
|
1178
1209
|
background-color: ${c.groupItemModalBackgroundColor};
|
|
1179
1210
|
@media (prefers-color-scheme: dark) {
|
|
1180
|
-
background-color: ${
|
|
1211
|
+
background-color: ${f.groupItemModalBackgroundColor};
|
|
1181
1212
|
}
|
|
1182
1213
|
border-radius: 0.5rem;
|
|
1183
1214
|
overflow: hidden;
|
|
@@ -1195,14 +1226,14 @@ const Tt = rt({
|
|
|
1195
1226
|
max-height: 60vh;
|
|
1196
1227
|
padding: 1.25rem 0;
|
|
1197
1228
|
`,
|
|
1198
|
-
onDragLeave: (
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1229
|
+
onDragLeave: (g) => {
|
|
1230
|
+
const S = g.relatedTarget;
|
|
1231
|
+
S && (g.currentTarget.contains(S) || setTimeout(() => {
|
|
1201
1232
|
o();
|
|
1202
1233
|
}, 500));
|
|
1203
1234
|
},
|
|
1204
1235
|
children: /* @__PURE__ */ t(
|
|
1205
|
-
|
|
1236
|
+
Xe,
|
|
1206
1237
|
{
|
|
1207
1238
|
className: b`
|
|
1208
1239
|
display: grid;
|
|
@@ -1216,28 +1247,28 @@ const Tt = rt({
|
|
|
1216
1247
|
animation: 150,
|
|
1217
1248
|
fallbackOnBody: !0,
|
|
1218
1249
|
list: (e == null ? void 0 : e.children) ?? [],
|
|
1219
|
-
setList: (
|
|
1250
|
+
setList: (g) => {
|
|
1220
1251
|
var N, u;
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1252
|
+
const S = g.map((T) => T.id), y = (u = (N = a.find((T) => T.id === (e == null ? void 0 : e.id))) == null ? void 0 : N.children) == null ? void 0 : u.map((T) => T.id);
|
|
1253
|
+
S.length === (y == null ? void 0 : y.length) && S.every((T, A) => T === y[A]) || S.length < ((y == null ? void 0 : y.length) ?? 0) || s(g, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
|
|
1223
1254
|
},
|
|
1224
1255
|
onMove: () => (p(null), i("onMove"), !0),
|
|
1225
|
-
onStart: (
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1256
|
+
onStart: (g) => {
|
|
1257
|
+
const S = g.item.dataset;
|
|
1258
|
+
S != null && S.id && d(S.id), i("onMove");
|
|
1228
1259
|
},
|
|
1229
1260
|
onEnd: () => {
|
|
1230
1261
|
d(null), p(null), i(null);
|
|
1231
1262
|
},
|
|
1232
|
-
ghostClass:
|
|
1233
|
-
children: h.map((
|
|
1234
|
-
|
|
1263
|
+
ghostClass: Rt,
|
|
1264
|
+
children: h.map((g, S) => /* @__PURE__ */ t(
|
|
1265
|
+
We,
|
|
1235
1266
|
{
|
|
1236
|
-
data:
|
|
1237
|
-
itemIndex:
|
|
1238
|
-
onClick:
|
|
1267
|
+
data: g,
|
|
1268
|
+
itemIndex: S,
|
|
1269
|
+
onClick: n
|
|
1239
1270
|
},
|
|
1240
|
-
|
|
1271
|
+
g.id
|
|
1241
1272
|
))
|
|
1242
1273
|
}
|
|
1243
1274
|
)
|
|
@@ -1245,11 +1276,11 @@ const Tt = rt({
|
|
|
1245
1276
|
)
|
|
1246
1277
|
}
|
|
1247
1278
|
);
|
|
1248
|
-
},
|
|
1249
|
-
var
|
|
1279
|
+
}, $n = (r) => {
|
|
1280
|
+
var n;
|
|
1250
1281
|
const { data: e, onClose: o } = r;
|
|
1251
1282
|
return /* @__PURE__ */ t(
|
|
1252
|
-
|
|
1283
|
+
Ct,
|
|
1253
1284
|
{
|
|
1254
1285
|
visible: !!e,
|
|
1255
1286
|
onClose: () => {
|
|
@@ -1262,32 +1293,32 @@ const Tt = rt({
|
|
|
1262
1293
|
y: e == null ? void 0 : e.pageY
|
|
1263
1294
|
} : null,
|
|
1264
1295
|
footer: null,
|
|
1265
|
-
title: ((
|
|
1296
|
+
title: ((n = e == null ? void 0 : e.data) == null ? void 0 : n.name) ?? "信息",
|
|
1266
1297
|
children: e && /* @__PURE__ */ m("div", { children: [
|
|
1267
1298
|
/* @__PURE__ */ t("div", { className: "mb-2", children: "开发者信息" }),
|
|
1268
|
-
/* @__PURE__ */ t("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ t(
|
|
1299
|
+
/* @__PURE__ */ t("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ t(Mo, { src: e, theme: "monokai" }) })
|
|
1269
1300
|
] })
|
|
1270
1301
|
}
|
|
1271
1302
|
);
|
|
1272
|
-
},
|
|
1303
|
+
}, Pt = (r) => {
|
|
1273
1304
|
const {
|
|
1274
1305
|
pagination: e = { position: "bottom" },
|
|
1275
1306
|
className: o,
|
|
1276
|
-
sliderProps:
|
|
1277
|
-
sliderRef:
|
|
1307
|
+
sliderProps: n,
|
|
1308
|
+
sliderRef: a,
|
|
1278
1309
|
onItemClick: s
|
|
1279
|
-
} = r, i =
|
|
1310
|
+
} = r, i = xe(null), d = xe(null), {
|
|
1280
1311
|
list: p,
|
|
1281
1312
|
setList: x,
|
|
1282
1313
|
setListStatus: l,
|
|
1283
1314
|
showInfoItemData: c,
|
|
1284
|
-
setShowInfoItemData:
|
|
1315
|
+
setShowInfoItemData: f,
|
|
1285
1316
|
openGroupItemData: v,
|
|
1286
1317
|
setOpenGroupItemData: D,
|
|
1287
1318
|
setMoveItemId: h,
|
|
1288
|
-
setMoveTargetId:
|
|
1289
|
-
addItem:
|
|
1290
|
-
} = pe(), { pagingDotBuilder: y, pagingDotsBuilder: N, itemBuilder: u } = le(),
|
|
1319
|
+
setMoveTargetId: g,
|
|
1320
|
+
addItem: S
|
|
1321
|
+
} = pe(), { pagingDotBuilder: y, pagingDotsBuilder: N, itemBuilder: u } = le(), T = be(() => e === !1 ? {} : {
|
|
1291
1322
|
top: b`
|
|
1292
1323
|
display: flex;
|
|
1293
1324
|
flex-direction: column;
|
|
@@ -1338,18 +1369,18 @@ const Tt = rt({
|
|
|
1338
1369
|
}[e.position ?? "bottom"], [e]);
|
|
1339
1370
|
return /* @__PURE__ */ m(ue, { children: [
|
|
1340
1371
|
/* @__PURE__ */ t(
|
|
1341
|
-
|
|
1372
|
+
ro,
|
|
1342
1373
|
{
|
|
1343
1374
|
useCSS: !0,
|
|
1344
1375
|
useTransform: !0,
|
|
1345
1376
|
arrows: !1,
|
|
1346
|
-
ref:
|
|
1377
|
+
ref: a ?? i,
|
|
1347
1378
|
infinite: !1,
|
|
1348
1379
|
dots: !0,
|
|
1349
1380
|
touchMove: !1,
|
|
1350
1381
|
lazyLoad: "anticipated",
|
|
1351
1382
|
className: k(
|
|
1352
|
-
|
|
1383
|
+
T,
|
|
1353
1384
|
b`
|
|
1354
1385
|
.slick-track {
|
|
1355
1386
|
display: flex;
|
|
@@ -1368,14 +1399,14 @@ const Tt = rt({
|
|
|
1368
1399
|
`,
|
|
1369
1400
|
o
|
|
1370
1401
|
),
|
|
1371
|
-
customPaging: (
|
|
1372
|
-
var
|
|
1402
|
+
customPaging: (A) => {
|
|
1403
|
+
var I, C;
|
|
1373
1404
|
if (y) {
|
|
1374
|
-
const
|
|
1375
|
-
return
|
|
1376
|
-
onDragEnter: (
|
|
1377
|
-
var
|
|
1378
|
-
(
|
|
1405
|
+
const H = y(p[A], A);
|
|
1406
|
+
return eo.cloneElement(H, {
|
|
1407
|
+
onDragEnter: (G) => {
|
|
1408
|
+
var O;
|
|
1409
|
+
(O = (a ?? i).current) == null || O.slickGoTo(A), H.props && H.props.onDragEnter && H.props.onDragEnter(G);
|
|
1379
1410
|
}
|
|
1380
1411
|
});
|
|
1381
1412
|
}
|
|
@@ -1383,14 +1414,14 @@ const Tt = rt({
|
|
|
1383
1414
|
"div",
|
|
1384
1415
|
{
|
|
1385
1416
|
onDragEnter: () => {
|
|
1386
|
-
var
|
|
1387
|
-
(
|
|
1417
|
+
var H;
|
|
1418
|
+
(H = (a ?? i).current) == null || H.slickGoTo(A);
|
|
1388
1419
|
},
|
|
1389
|
-
children: (C = (
|
|
1420
|
+
children: (C = (I = p[A]) == null ? void 0 : I.data) == null ? void 0 : C.name
|
|
1390
1421
|
}
|
|
1391
1422
|
);
|
|
1392
1423
|
},
|
|
1393
|
-
appendDots: (
|
|
1424
|
+
appendDots: (A) => N ? N(A) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
1394
1425
|
"ul",
|
|
1395
1426
|
{
|
|
1396
1427
|
ref: d,
|
|
@@ -1417,28 +1448,28 @@ const Tt = rt({
|
|
|
1417
1448
|
}
|
|
1418
1449
|
`
|
|
1419
1450
|
),
|
|
1420
|
-
children:
|
|
1451
|
+
children: A
|
|
1421
1452
|
}
|
|
1422
1453
|
) }),
|
|
1423
|
-
...
|
|
1424
|
-
children: p.map((
|
|
1454
|
+
...n,
|
|
1455
|
+
children: p.map((A) => /* @__PURE__ */ t(
|
|
1425
1456
|
"div",
|
|
1426
1457
|
{
|
|
1427
|
-
onDrop: (
|
|
1428
|
-
|
|
1429
|
-
const C =
|
|
1458
|
+
onDrop: (I) => {
|
|
1459
|
+
I.preventDefault();
|
|
1460
|
+
const C = I.dataTransfer.getData("text/plain");
|
|
1430
1461
|
if (V.quickJSONCheck(C))
|
|
1431
1462
|
try {
|
|
1432
|
-
|
|
1433
|
-
} catch (
|
|
1434
|
-
console.log("drag error",
|
|
1463
|
+
S(JSON.parse(C), [A.id]);
|
|
1464
|
+
} catch (G) {
|
|
1465
|
+
console.log("drag error", G);
|
|
1435
1466
|
}
|
|
1436
1467
|
},
|
|
1437
|
-
onDragOver: (
|
|
1438
|
-
|
|
1468
|
+
onDragOver: (I) => {
|
|
1469
|
+
I.preventDefault();
|
|
1439
1470
|
},
|
|
1440
1471
|
children: /* @__PURE__ */ t(
|
|
1441
|
-
|
|
1472
|
+
Xe,
|
|
1442
1473
|
{
|
|
1443
1474
|
className: k(
|
|
1444
1475
|
b`
|
|
@@ -1456,72 +1487,72 @@ const Tt = rt({
|
|
|
1456
1487
|
fallbackOnBody: !0,
|
|
1457
1488
|
swapThreshold: 0.65,
|
|
1458
1489
|
group: "nested",
|
|
1459
|
-
list:
|
|
1460
|
-
setList: (
|
|
1490
|
+
list: A.children ?? [],
|
|
1491
|
+
setList: (I) => x(I, [A.id]),
|
|
1461
1492
|
filter: ".drag-disabled",
|
|
1462
|
-
onMove: (
|
|
1493
|
+
onMove: (I) => {
|
|
1463
1494
|
l("onMove");
|
|
1464
|
-
const { dragged: C, related:
|
|
1465
|
-
return
|
|
1495
|
+
const { dragged: C, related: H } = I, G = C.dataset, O = H.dataset;
|
|
1496
|
+
return g(null), !((Object.keys(O).length === 0 || O.parentIds) && Number(G.childrenLength) > 0 && H.classList.contains("sortable-group-item"));
|
|
1466
1497
|
},
|
|
1467
|
-
onStart: (
|
|
1468
|
-
const C =
|
|
1498
|
+
onStart: (I) => {
|
|
1499
|
+
const C = I.item.dataset;
|
|
1469
1500
|
C != null && C.id && h(C.id), l("onMove");
|
|
1470
1501
|
},
|
|
1471
1502
|
onEnd: () => {
|
|
1472
|
-
h(null),
|
|
1503
|
+
h(null), g(null), l(null);
|
|
1473
1504
|
},
|
|
1474
|
-
ghostClass:
|
|
1475
|
-
children: (
|
|
1476
|
-
let
|
|
1505
|
+
ghostClass: Rt,
|
|
1506
|
+
children: (A.children ?? []).map((I, C) => {
|
|
1507
|
+
let H;
|
|
1477
1508
|
if (u)
|
|
1478
|
-
return u(
|
|
1479
|
-
switch (
|
|
1509
|
+
return u(I);
|
|
1510
|
+
switch (I.type) {
|
|
1480
1511
|
case "group":
|
|
1481
1512
|
case "app":
|
|
1482
|
-
|
|
1483
|
-
|
|
1513
|
+
H = /* @__PURE__ */ t(
|
|
1514
|
+
zn,
|
|
1484
1515
|
{
|
|
1485
|
-
data:
|
|
1516
|
+
data: I,
|
|
1486
1517
|
itemIndex: C,
|
|
1487
|
-
parentIds: [
|
|
1518
|
+
parentIds: [A.id, I.id],
|
|
1488
1519
|
onClick: s
|
|
1489
1520
|
},
|
|
1490
|
-
|
|
1521
|
+
I.id
|
|
1491
1522
|
);
|
|
1492
1523
|
break;
|
|
1493
1524
|
default:
|
|
1494
|
-
|
|
1495
|
-
|
|
1525
|
+
H = /* @__PURE__ */ t(
|
|
1526
|
+
We,
|
|
1496
1527
|
{
|
|
1497
|
-
data:
|
|
1528
|
+
data: I,
|
|
1498
1529
|
itemIndex: C,
|
|
1499
1530
|
onClick: s
|
|
1500
1531
|
},
|
|
1501
|
-
|
|
1532
|
+
I.id
|
|
1502
1533
|
);
|
|
1503
1534
|
break;
|
|
1504
1535
|
}
|
|
1505
|
-
return
|
|
1536
|
+
return H;
|
|
1506
1537
|
})
|
|
1507
1538
|
}
|
|
1508
1539
|
)
|
|
1509
1540
|
},
|
|
1510
|
-
|
|
1541
|
+
A.id
|
|
1511
1542
|
))
|
|
1512
1543
|
}
|
|
1513
1544
|
),
|
|
1514
1545
|
/* @__PURE__ */ t(
|
|
1515
|
-
|
|
1546
|
+
$n,
|
|
1516
1547
|
{
|
|
1517
1548
|
data: c,
|
|
1518
1549
|
onClose: () => {
|
|
1519
|
-
|
|
1550
|
+
f(null);
|
|
1520
1551
|
}
|
|
1521
1552
|
}
|
|
1522
1553
|
),
|
|
1523
1554
|
/* @__PURE__ */ t(
|
|
1524
|
-
|
|
1555
|
+
En,
|
|
1525
1556
|
{
|
|
1526
1557
|
data: v,
|
|
1527
1558
|
onClose: () => {
|
|
@@ -1531,12 +1562,12 @@ const Tt = rt({
|
|
|
1531
1562
|
}
|
|
1532
1563
|
)
|
|
1533
1564
|
] });
|
|
1534
|
-
},
|
|
1565
|
+
}, Hn = lt(
|
|
1535
1566
|
(r, e) => {
|
|
1536
1567
|
const {
|
|
1537
1568
|
list: o,
|
|
1538
|
-
onChange:
|
|
1539
|
-
storageKey:
|
|
1569
|
+
onChange: n,
|
|
1570
|
+
storageKey: a,
|
|
1540
1571
|
enableCaching: s,
|
|
1541
1572
|
theme: i,
|
|
1542
1573
|
noLetters: d,
|
|
@@ -1544,21 +1575,21 @@ const Tt = rt({
|
|
|
1544
1575
|
contextMenuBuilder: x,
|
|
1545
1576
|
itemBuilder: l,
|
|
1546
1577
|
itemIconBuilder: c,
|
|
1547
|
-
pagingDotBuilder:
|
|
1578
|
+
pagingDotBuilder: f,
|
|
1548
1579
|
pagingDotsBuilder: v,
|
|
1549
1580
|
...D
|
|
1550
1581
|
} = r;
|
|
1551
|
-
return /* @__PURE__ */ t(
|
|
1582
|
+
return /* @__PURE__ */ t(Dt, { ...{
|
|
1552
1583
|
list: o,
|
|
1553
|
-
onChange:
|
|
1554
|
-
storageKey:
|
|
1584
|
+
onChange: n,
|
|
1585
|
+
storageKey: a,
|
|
1555
1586
|
enableCaching: s
|
|
1556
|
-
}, children: /* @__PURE__ */ m(
|
|
1587
|
+
}, children: /* @__PURE__ */ m(Mt, { ...{
|
|
1557
1588
|
theme: i,
|
|
1558
1589
|
noLetters: d,
|
|
1559
1590
|
contextMenu: p,
|
|
1560
1591
|
pagingDotsBuilder: v,
|
|
1561
|
-
pagingDotBuilder:
|
|
1592
|
+
pagingDotBuilder: f,
|
|
1562
1593
|
itemBuilder: l,
|
|
1563
1594
|
itemIconBuilder: c,
|
|
1564
1595
|
contextMenuBuilder: x
|
|
@@ -1569,10 +1600,10 @@ const Tt = rt({
|
|
|
1569
1600
|
e && (typeof e == "function" ? e({ state: y, config: N }) : e.current = { state: y, config: N });
|
|
1570
1601
|
}, [y, N]), null;
|
|
1571
1602
|
}, {}),
|
|
1572
|
-
/* @__PURE__ */ t(
|
|
1603
|
+
/* @__PURE__ */ t(Pt, { ...D })
|
|
1573
1604
|
] }) });
|
|
1574
1605
|
}
|
|
1575
|
-
),
|
|
1606
|
+
), On = {
|
|
1576
1607
|
frontmatterEditor: {
|
|
1577
1608
|
title: "编辑前置元数据",
|
|
1578
1609
|
key: "键",
|
|
@@ -1689,13 +1720,13 @@ const Tt = rt({
|
|
|
1689
1720
|
image: {
|
|
1690
1721
|
delete: "删除图片"
|
|
1691
1722
|
}
|
|
1692
|
-
},
|
|
1693
|
-
const
|
|
1723
|
+
}, Fn = (r, e, o) => {
|
|
1724
|
+
const a = r.split(".").reduce(
|
|
1694
1725
|
(s, i) => typeof s == "string" ? s : s[i],
|
|
1695
|
-
|
|
1726
|
+
On
|
|
1696
1727
|
);
|
|
1697
|
-
return typeof
|
|
1698
|
-
},
|
|
1728
|
+
return typeof a != "string" ? e : o ? a.replace(/{{(.*?)}}/g, (s, i) => o[i]) : a;
|
|
1729
|
+
}, _n = b`
|
|
1699
1730
|
--accentBase: var(--tomato-1);
|
|
1700
1731
|
--accentBgSubtle: var(--tomato-2);
|
|
1701
1732
|
--accentBg: var(--tomato-3);
|
|
@@ -1749,7 +1780,7 @@ const Tt = rt({
|
|
|
1749
1780
|
rgba(255, 255, 255, 0.05),
|
|
1750
1781
|
rgba(255, 255, 255, 0.05)
|
|
1751
1782
|
);
|
|
1752
|
-
`,
|
|
1783
|
+
`, jn = b`
|
|
1753
1784
|
[class*="_toolbarRoot"] {
|
|
1754
1785
|
flex-wrap: wrap;
|
|
1755
1786
|
transition: all 0.3s;
|
|
@@ -1819,7 +1850,7 @@ const Tt = rt({
|
|
|
1819
1850
|
margin-bottom: 0;
|
|
1820
1851
|
}
|
|
1821
1852
|
}
|
|
1822
|
-
`,
|
|
1853
|
+
`, Bt = k(
|
|
1823
1854
|
"markdown-body",
|
|
1824
1855
|
b`
|
|
1825
1856
|
p {
|
|
@@ -1842,7 +1873,7 @@ const Tt = rt({
|
|
|
1842
1873
|
}
|
|
1843
1874
|
}
|
|
1844
1875
|
`
|
|
1845
|
-
),
|
|
1876
|
+
), zt = b`
|
|
1846
1877
|
.markdown-body {
|
|
1847
1878
|
/* light */
|
|
1848
1879
|
color-scheme: light;
|
|
@@ -1897,7 +1928,7 @@ const Tt = rt({
|
|
|
1897
1928
|
--color-prettylights-syntax-meta-diff-range: #8250df;
|
|
1898
1929
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
|
|
1899
1930
|
}
|
|
1900
|
-
`,
|
|
1931
|
+
`, Et = b`
|
|
1901
1932
|
.markdown-body {
|
|
1902
1933
|
/* dark */
|
|
1903
1934
|
color-scheme: dark;
|
|
@@ -1952,25 +1983,25 @@ const Tt = rt({
|
|
|
1952
1983
|
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
|
|
1953
1984
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
|
|
1954
1985
|
}
|
|
1955
|
-
`,
|
|
1986
|
+
`, _e = (r) => {
|
|
1956
1987
|
var e, o;
|
|
1957
1988
|
return r === "dark" ? !0 : r === "light" ? !1 : (e = document.documentElement.getAttribute("style")) != null && e.includes("color-scheme: dark;") ? !0 : (o = document.documentElement.getAttribute("style")) != null && o.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1958
|
-
},
|
|
1989
|
+
}, Xn = (r) => {
|
|
1959
1990
|
const {
|
|
1960
1991
|
value: e,
|
|
1961
1992
|
onChange: o,
|
|
1962
|
-
translation:
|
|
1963
|
-
pluginConfig:
|
|
1993
|
+
translation: n,
|
|
1994
|
+
pluginConfig: a,
|
|
1964
1995
|
className: s,
|
|
1965
1996
|
theme: i = "auto",
|
|
1966
1997
|
...d
|
|
1967
|
-
} = r, p =
|
|
1998
|
+
} = r, p = xe(null), {
|
|
1968
1999
|
image: x,
|
|
1969
2000
|
diffSource: l = {
|
|
1970
2001
|
viewMode: "rich-text"
|
|
1971
2002
|
},
|
|
1972
2003
|
headings: c,
|
|
1973
|
-
link:
|
|
2004
|
+
link: f,
|
|
1974
2005
|
codeBlock: v,
|
|
1975
2006
|
codeMirror: D = {
|
|
1976
2007
|
codeBlockLanguages: {
|
|
@@ -1982,112 +2013,112 @@ const Tt = rt({
|
|
|
1982
2013
|
}
|
|
1983
2014
|
},
|
|
1984
2015
|
directives: h = {
|
|
1985
|
-
directiveDescriptors: [
|
|
2016
|
+
directiveDescriptors: [Lo]
|
|
1986
2017
|
}
|
|
1987
|
-
} =
|
|
2018
|
+
} = a ?? {}, [g, S] = j("");
|
|
1988
2019
|
return ae(() => {
|
|
1989
2020
|
var y;
|
|
1990
|
-
e !== void 0 && p.current && ((y = p.current) == null || y.setMarkdown(e),
|
|
2021
|
+
e !== void 0 && p.current && ((y = p.current) == null || y.setMarkdown(e), S(e));
|
|
1991
2022
|
}, [e, p]), /* @__PURE__ */ t(
|
|
1992
|
-
|
|
2023
|
+
Ao,
|
|
1993
2024
|
{
|
|
1994
2025
|
ref: p,
|
|
1995
2026
|
className: k(
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2027
|
+
jn,
|
|
2028
|
+
_e(i) ? _n : "",
|
|
2029
|
+
_e(i) ? Et : zt,
|
|
1999
2030
|
s
|
|
2000
2031
|
),
|
|
2001
|
-
contentEditableClassName:
|
|
2002
|
-
markdown:
|
|
2032
|
+
contentEditableClassName: Bt,
|
|
2033
|
+
markdown: g,
|
|
2003
2034
|
onChange: (y) => {
|
|
2004
|
-
!e && !o &&
|
|
2035
|
+
!e && !o && S(y), o && o(y);
|
|
2005
2036
|
},
|
|
2006
|
-
translation:
|
|
2037
|
+
translation: n ?? Fn,
|
|
2007
2038
|
plugins: [
|
|
2008
|
-
|
|
2009
|
-
toolbarContents: () => /* @__PURE__ */ m(
|
|
2010
|
-
/* @__PURE__ */ t(Xo, {}),
|
|
2011
|
-
/* @__PURE__ */ t(ce, {}),
|
|
2012
|
-
/* @__PURE__ */ t(Uo, {}),
|
|
2013
|
-
/* @__PURE__ */ t(Go, {}),
|
|
2014
|
-
/* @__PURE__ */ t(ce, {}),
|
|
2015
|
-
/* @__PURE__ */ t(qo, {}),
|
|
2016
|
-
/* @__PURE__ */ t(ce, {}),
|
|
2039
|
+
Do({
|
|
2040
|
+
toolbarContents: () => /* @__PURE__ */ m(qo, { options: ["rich-text", "source"], children: [
|
|
2017
2041
|
/* @__PURE__ */ t(Yo, {}),
|
|
2018
2042
|
/* @__PURE__ */ t(ce, {}),
|
|
2019
2043
|
/* @__PURE__ */ t(Vo, {}),
|
|
2020
2044
|
/* @__PURE__ */ t(Wo, {}),
|
|
2021
2045
|
/* @__PURE__ */ t(ce, {}),
|
|
2022
2046
|
/* @__PURE__ */ t(Ko, {}),
|
|
2047
|
+
/* @__PURE__ */ t(ce, {}),
|
|
2023
2048
|
/* @__PURE__ */ t(Jo, {}),
|
|
2024
2049
|
/* @__PURE__ */ t(ce, {}),
|
|
2025
2050
|
/* @__PURE__ */ t(Zo, {}),
|
|
2051
|
+
/* @__PURE__ */ t(Qo, {}),
|
|
2052
|
+
/* @__PURE__ */ t(ce, {}),
|
|
2053
|
+
/* @__PURE__ */ t(er, {}),
|
|
2054
|
+
/* @__PURE__ */ t(tr, {}),
|
|
2026
2055
|
/* @__PURE__ */ t(ce, {}),
|
|
2027
|
-
/* @__PURE__ */ t(
|
|
2056
|
+
/* @__PURE__ */ t(or, {}),
|
|
2057
|
+
/* @__PURE__ */ t(ce, {}),
|
|
2058
|
+
/* @__PURE__ */ t(rr, {})
|
|
2028
2059
|
] })
|
|
2029
2060
|
}),
|
|
2030
|
-
|
|
2031
|
-
Lo(),
|
|
2032
|
-
Ao(),
|
|
2033
|
-
Do(c),
|
|
2034
|
-
Ro(g),
|
|
2061
|
+
Ro(l),
|
|
2035
2062
|
Po(),
|
|
2036
|
-
Bo(
|
|
2037
|
-
zo(),
|
|
2038
|
-
Eo(),
|
|
2063
|
+
Bo(),
|
|
2064
|
+
zo(c),
|
|
2065
|
+
Eo(f),
|
|
2039
2066
|
$o(),
|
|
2040
|
-
Ho(
|
|
2041
|
-
Oo(
|
|
2067
|
+
Ho(x),
|
|
2068
|
+
Oo(),
|
|
2042
2069
|
Fo(),
|
|
2043
|
-
_o(
|
|
2070
|
+
_o(),
|
|
2071
|
+
jo(v),
|
|
2072
|
+
Xo(D),
|
|
2073
|
+
Uo(),
|
|
2074
|
+
Go(h)
|
|
2044
2075
|
],
|
|
2045
2076
|
...d
|
|
2046
2077
|
}
|
|
2047
2078
|
);
|
|
2048
|
-
},
|
|
2049
|
-
const { children: e = "", className: o, theme:
|
|
2079
|
+
}, $t = (r) => {
|
|
2080
|
+
const { children: e = "", className: o, theme: n = "auto", imageProps: a } = r;
|
|
2050
2081
|
return /* @__PURE__ */ t(
|
|
2051
2082
|
"div",
|
|
2052
2083
|
{
|
|
2053
|
-
className:
|
|
2084
|
+
className: _e(n) ? Et : zt,
|
|
2054
2085
|
children: /* @__PURE__ */ t(
|
|
2055
|
-
|
|
2086
|
+
wt,
|
|
2056
2087
|
{
|
|
2057
|
-
className: k(
|
|
2058
|
-
remarkPlugins: [
|
|
2059
|
-
rehypePlugins: [
|
|
2088
|
+
className: k(Bt, o),
|
|
2089
|
+
remarkPlugins: [nr, ar],
|
|
2090
|
+
rehypePlugins: [sr],
|
|
2060
2091
|
components: {
|
|
2061
2092
|
code(s) {
|
|
2062
2093
|
const { children: i, className: d, node: p, ref: x, ...l } = s, c = /language-(\w+)/.exec(d || "");
|
|
2063
2094
|
return c ? /* @__PURE__ */ t(
|
|
2064
|
-
|
|
2095
|
+
ir,
|
|
2065
2096
|
{
|
|
2066
2097
|
...l,
|
|
2067
2098
|
PreTag: "div",
|
|
2068
2099
|
children: String(i).replace(/\n$/, ""),
|
|
2069
2100
|
language: c[1],
|
|
2070
|
-
style:
|
|
2101
|
+
style: lr
|
|
2071
2102
|
}
|
|
2072
2103
|
) : /* @__PURE__ */ t("code", { ...l, className: d, children: i });
|
|
2073
2104
|
},
|
|
2074
2105
|
img(s) {
|
|
2075
|
-
const { preview: i, ...d } =
|
|
2106
|
+
const { preview: i, ...d } = a ?? {};
|
|
2076
2107
|
return /* @__PURE__ */ t(
|
|
2077
|
-
|
|
2108
|
+
cr,
|
|
2078
2109
|
{
|
|
2079
2110
|
...s,
|
|
2080
2111
|
preview: i instanceof Boolean ? i : {
|
|
2081
2112
|
icons: {
|
|
2082
|
-
rotateLeft: /* @__PURE__ */ t(
|
|
2083
|
-
rotateRight: /* @__PURE__ */ t(
|
|
2084
|
-
zoomIn: /* @__PURE__ */ t(
|
|
2085
|
-
zoomOut: /* @__PURE__ */ t(
|
|
2086
|
-
close: /* @__PURE__ */ t(
|
|
2087
|
-
left: /* @__PURE__ */ t(
|
|
2088
|
-
right: /* @__PURE__ */ t(
|
|
2089
|
-
flipX: /* @__PURE__ */ t(
|
|
2090
|
-
flipY: /* @__PURE__ */ t(
|
|
2113
|
+
rotateLeft: /* @__PURE__ */ t(yo, {}),
|
|
2114
|
+
rotateRight: /* @__PURE__ */ t(xo, {}),
|
|
2115
|
+
zoomIn: /* @__PURE__ */ t(bo, {}),
|
|
2116
|
+
zoomOut: /* @__PURE__ */ t(ho, {}),
|
|
2117
|
+
close: /* @__PURE__ */ t(fo, {}),
|
|
2118
|
+
left: /* @__PURE__ */ t(go, {}),
|
|
2119
|
+
right: /* @__PURE__ */ t(po, {}),
|
|
2120
|
+
flipX: /* @__PURE__ */ t(uo, {}),
|
|
2121
|
+
flipY: /* @__PURE__ */ t(mo, {})
|
|
2091
2122
|
},
|
|
2092
2123
|
zIndex: 9999,
|
|
2093
2124
|
mask: " ",
|
|
@@ -2106,114 +2137,119 @@ const Tt = rt({
|
|
|
2106
2137
|
)
|
|
2107
2138
|
}
|
|
2108
2139
|
);
|
|
2109
|
-
},
|
|
2110
|
-
|
|
2111
|
-
function
|
|
2112
|
-
return
|
|
2140
|
+
}, Ht = Xn;
|
|
2141
|
+
Ht.Preview = $t;
|
|
2142
|
+
function ve(...r) {
|
|
2143
|
+
return mr(dr(r));
|
|
2113
2144
|
}
|
|
2114
|
-
const
|
|
2145
|
+
const Ke = (r) => {
|
|
2115
2146
|
const {
|
|
2116
2147
|
mouseX: e,
|
|
2117
2148
|
title: o,
|
|
2118
|
-
icon:
|
|
2119
|
-
href:
|
|
2149
|
+
icon: n,
|
|
2150
|
+
href: a,
|
|
2120
2151
|
children: s,
|
|
2121
2152
|
as: i = R.div,
|
|
2122
2153
|
componentClassName: d = "rounded-full bg-gray-200 dark:bg-neutral-800",
|
|
2123
2154
|
titleClassName: p = "rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700",
|
|
2124
2155
|
childrenClassName: x,
|
|
2125
2156
|
...l
|
|
2126
|
-
} = r, c =
|
|
2127
|
-
var
|
|
2128
|
-
const
|
|
2129
|
-
return
|
|
2130
|
-
}), v =
|
|
2131
|
-
|
|
2157
|
+
} = r, c = xe(null), f = ge(e, (H) => {
|
|
2158
|
+
var O;
|
|
2159
|
+
const G = ((O = c.current) == null ? void 0 : O.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
2160
|
+
return H - G.x - G.width / 2;
|
|
2161
|
+
}), v = ge(f, [-150, 0, 150], [40, 80, 40]), D = ge(f, [-150, 0, 150], [40, 80, 40]), h = ge(
|
|
2162
|
+
f,
|
|
2132
2163
|
[-150, 0, 150],
|
|
2133
2164
|
[20, 40, 20]
|
|
2134
|
-
),
|
|
2135
|
-
|
|
2165
|
+
), g = ge(
|
|
2166
|
+
f,
|
|
2136
2167
|
[-150, 0, 150],
|
|
2137
2168
|
[20, 40, 20]
|
|
2138
|
-
),
|
|
2169
|
+
), S = Ae(v, {
|
|
2139
2170
|
mass: 0.1,
|
|
2140
2171
|
stiffness: 150,
|
|
2141
2172
|
damping: 12
|
|
2142
|
-
}), y =
|
|
2173
|
+
}), y = Ae(D, {
|
|
2143
2174
|
mass: 0.1,
|
|
2144
2175
|
stiffness: 150,
|
|
2145
2176
|
damping: 12
|
|
2146
|
-
}), N =
|
|
2177
|
+
}), N = Ae(h, {
|
|
2147
2178
|
mass: 0.1,
|
|
2148
2179
|
stiffness: 150,
|
|
2149
2180
|
damping: 12
|
|
2150
|
-
}), u =
|
|
2181
|
+
}), u = Ae(g, {
|
|
2151
2182
|
mass: 0.1,
|
|
2152
2183
|
stiffness: 150,
|
|
2153
2184
|
damping: 12
|
|
2154
|
-
}), [
|
|
2185
|
+
}), T = ge(N, (H) => `${H}px`), [A, I] = j(!1), C = /* @__PURE__ */ m(
|
|
2155
2186
|
i,
|
|
2156
2187
|
{
|
|
2157
2188
|
ref: c,
|
|
2158
|
-
style: { width:
|
|
2159
|
-
onMouseEnter: () =>
|
|
2160
|
-
onMouseLeave: () =>
|
|
2161
|
-
className:
|
|
2189
|
+
style: { width: S, height: y },
|
|
2190
|
+
onMouseEnter: () => I(!0),
|
|
2191
|
+
onMouseLeave: () => I(!1),
|
|
2192
|
+
className: ve(
|
|
2162
2193
|
"aspect-square flex items-center justify-center relative",
|
|
2163
2194
|
d
|
|
2164
2195
|
),
|
|
2165
2196
|
...l,
|
|
2166
2197
|
children: [
|
|
2167
|
-
o && /* @__PURE__ */ t(
|
|
2198
|
+
o && /* @__PURE__ */ t(Ue, { children: A && /* @__PURE__ */ t(
|
|
2168
2199
|
R.div,
|
|
2169
2200
|
{
|
|
2170
2201
|
initial: { opacity: 0, y: 10, x: "-50%" },
|
|
2171
2202
|
animate: { opacity: 1, y: 0, x: "-50%" },
|
|
2172
2203
|
exit: { opacity: 0, y: 2, x: "-50%" },
|
|
2173
|
-
className:
|
|
2204
|
+
className: ve(
|
|
2174
2205
|
"px-2 py-0.5 whitespace-pre absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",
|
|
2175
2206
|
p
|
|
2176
2207
|
),
|
|
2177
2208
|
children: o
|
|
2178
2209
|
}
|
|
2179
2210
|
) }),
|
|
2211
|
+
" ",
|
|
2180
2212
|
/* @__PURE__ */ t(
|
|
2181
2213
|
R.div,
|
|
2182
2214
|
{
|
|
2183
|
-
style: {
|
|
2184
|
-
|
|
2185
|
-
|
|
2215
|
+
style: {
|
|
2216
|
+
width: N,
|
|
2217
|
+
height: u,
|
|
2218
|
+
fontSize: T
|
|
2219
|
+
},
|
|
2220
|
+
className: ve("flex items-center justify-center", x),
|
|
2221
|
+
children: typeof s == "function" ? s({ widthIcon: N, heightIcon: u, fontSizeTransform: T }) : s || n
|
|
2186
2222
|
}
|
|
2187
2223
|
)
|
|
2188
2224
|
]
|
|
2189
2225
|
}
|
|
2190
2226
|
);
|
|
2191
|
-
return
|
|
2192
|
-
},
|
|
2227
|
+
return a ? /* @__PURE__ */ t("a", { href: a, children: C }) : C;
|
|
2228
|
+
}, Je = (r) => {
|
|
2193
2229
|
const {
|
|
2194
2230
|
items: e = [],
|
|
2195
2231
|
className: o = "rounded-2xl bg-gray-50 dark:bg-neutral-900",
|
|
2196
|
-
itemBuilder:
|
|
2197
|
-
children:
|
|
2232
|
+
itemBuilder: n,
|
|
2233
|
+
children: a,
|
|
2198
2234
|
mouseX: s,
|
|
2199
2235
|
as: i = R.div
|
|
2200
|
-
} = r, d =
|
|
2236
|
+
} = r, d = ct(1 / 0), p = s ?? d;
|
|
2201
2237
|
return /* @__PURE__ */ t(
|
|
2202
2238
|
i,
|
|
2203
2239
|
{
|
|
2204
2240
|
onMouseMove: (x) => p.set(x.pageX),
|
|
2205
2241
|
onMouseLeave: () => p.set(1 / 0),
|
|
2206
|
-
className:
|
|
2242
|
+
className: ve(
|
|
2207
2243
|
"mx-auto hidden md:flex h-16 gap-4 items-end px-4 pb-3",
|
|
2208
2244
|
o
|
|
2209
2245
|
),
|
|
2210
|
-
children:
|
|
2211
|
-
(x) =>
|
|
2246
|
+
children: a || e.map(
|
|
2247
|
+
(x) => n ? n(x, p) : /* @__PURE__ */ t(Ke, { mouseX: p, ...x }, x.title)
|
|
2212
2248
|
)
|
|
2213
2249
|
}
|
|
2214
2250
|
);
|
|
2215
|
-
},
|
|
2216
|
-
const { title: e, icon: o, href:
|
|
2251
|
+
}, ze = (r) => {
|
|
2252
|
+
const { title: e, icon: o, href: n, index: a, totalItems: s, children: i, ...d } = r;
|
|
2217
2253
|
return /* @__PURE__ */ t(
|
|
2218
2254
|
R.div,
|
|
2219
2255
|
{
|
|
@@ -2226,15 +2262,15 @@ const qe = (r) => {
|
|
|
2226
2262
|
opacity: 0,
|
|
2227
2263
|
y: 10,
|
|
2228
2264
|
transition: {
|
|
2229
|
-
delay:
|
|
2265
|
+
delay: a * 0.05
|
|
2230
2266
|
}
|
|
2231
2267
|
},
|
|
2232
|
-
transition: { delay: (s - 1 -
|
|
2268
|
+
transition: { delay: (s - 1 - a) * 0.05 },
|
|
2233
2269
|
...d,
|
|
2234
2270
|
children: i || /* @__PURE__ */ t(
|
|
2235
2271
|
"a",
|
|
2236
2272
|
{
|
|
2237
|
-
href:
|
|
2273
|
+
href: n,
|
|
2238
2274
|
className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",
|
|
2239
2275
|
children: /* @__PURE__ */ t("div", { className: "h-4 w-4", children: o })
|
|
2240
2276
|
}
|
|
@@ -2242,30 +2278,30 @@ const qe = (r) => {
|
|
|
2242
2278
|
},
|
|
2243
2279
|
e
|
|
2244
2280
|
);
|
|
2245
|
-
},
|
|
2281
|
+
}, Ze = (r) => {
|
|
2246
2282
|
const {
|
|
2247
2283
|
items: e = [],
|
|
2248
2284
|
className: o,
|
|
2249
|
-
collapseIcon:
|
|
2250
|
-
autoHidden:
|
|
2285
|
+
collapseIcon: n,
|
|
2286
|
+
autoHidden: a = !1,
|
|
2251
2287
|
itemBuilder: s,
|
|
2252
2288
|
children: i
|
|
2253
|
-
} = r, [d, p] =
|
|
2289
|
+
} = r, [d, p] = j(!1), x = () => {
|
|
2254
2290
|
p(!d);
|
|
2255
2291
|
};
|
|
2256
2292
|
return /* @__PURE__ */ m(
|
|
2257
2293
|
"div",
|
|
2258
2294
|
{
|
|
2259
|
-
className:
|
|
2295
|
+
className: ve("relative block", a ? "md:hidden" : "", o),
|
|
2260
2296
|
children: [
|
|
2261
|
-
/* @__PURE__ */ t(
|
|
2297
|
+
/* @__PURE__ */ t(Ue, { children: d && /* @__PURE__ */ t(
|
|
2262
2298
|
R.div,
|
|
2263
2299
|
{
|
|
2264
2300
|
layoutId: "nav",
|
|
2265
2301
|
className: "absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",
|
|
2266
2302
|
children: i || e.map(
|
|
2267
2303
|
(l, c) => s ? /* @__PURE__ */ t(
|
|
2268
|
-
|
|
2304
|
+
ze,
|
|
2269
2305
|
{
|
|
2270
2306
|
...l,
|
|
2271
2307
|
index: c,
|
|
@@ -2274,7 +2310,7 @@ const qe = (r) => {
|
|
|
2274
2310
|
},
|
|
2275
2311
|
l.title
|
|
2276
2312
|
) : /* @__PURE__ */ t(
|
|
2277
|
-
|
|
2313
|
+
ze,
|
|
2278
2314
|
{
|
|
2279
2315
|
...l,
|
|
2280
2316
|
index: c,
|
|
@@ -2290,18 +2326,18 @@ const qe = (r) => {
|
|
|
2290
2326
|
{
|
|
2291
2327
|
onClick: x,
|
|
2292
2328
|
className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",
|
|
2293
|
-
children:
|
|
2329
|
+
children: n || /* @__PURE__ */ t(vo, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
|
|
2294
2330
|
}
|
|
2295
2331
|
)
|
|
2296
2332
|
]
|
|
2297
2333
|
}
|
|
2298
2334
|
);
|
|
2299
|
-
},
|
|
2335
|
+
}, Un = (r) => {
|
|
2300
2336
|
const {
|
|
2301
2337
|
items: e,
|
|
2302
2338
|
desktopClassName: o,
|
|
2303
|
-
mobileClassName:
|
|
2304
|
-
desktopItemBuilder:
|
|
2339
|
+
mobileClassName: n,
|
|
2340
|
+
desktopItemBuilder: a,
|
|
2305
2341
|
mobileItemBuilder: s,
|
|
2306
2342
|
desktopChildren: i,
|
|
2307
2343
|
mobileChildren: d,
|
|
@@ -2310,21 +2346,21 @@ const qe = (r) => {
|
|
|
2310
2346
|
} = r;
|
|
2311
2347
|
return /* @__PURE__ */ m(ue, { children: [
|
|
2312
2348
|
/* @__PURE__ */ t(
|
|
2313
|
-
|
|
2349
|
+
Je,
|
|
2314
2350
|
{
|
|
2315
2351
|
items: e,
|
|
2316
2352
|
className: o,
|
|
2317
|
-
itemBuilder:
|
|
2353
|
+
itemBuilder: a,
|
|
2318
2354
|
children: i,
|
|
2319
2355
|
mouseX: p,
|
|
2320
2356
|
...x
|
|
2321
2357
|
}
|
|
2322
2358
|
),
|
|
2323
2359
|
/* @__PURE__ */ t(
|
|
2324
|
-
|
|
2360
|
+
Ze,
|
|
2325
2361
|
{
|
|
2326
2362
|
items: e,
|
|
2327
|
-
className:
|
|
2363
|
+
className: n,
|
|
2328
2364
|
itemBuilder: s,
|
|
2329
2365
|
children: d,
|
|
2330
2366
|
autoHidden: !0,
|
|
@@ -2332,31 +2368,31 @@ const qe = (r) => {
|
|
|
2332
2368
|
}
|
|
2333
2369
|
)
|
|
2334
2370
|
] });
|
|
2335
|
-
},
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
const
|
|
2371
|
+
}, Ie = Un;
|
|
2372
|
+
Ie.Desktop = Je;
|
|
2373
|
+
Ie.DesktopItem = Ke;
|
|
2374
|
+
Ie.Mobile = Ze;
|
|
2375
|
+
Ie.MobileItem = ze;
|
|
2376
|
+
const Gn = /* @__PURE__ */ Mn({
|
|
2341
2377
|
__proto__: null
|
|
2342
|
-
}, [
|
|
2343
|
-
function
|
|
2378
|
+
}, [nn]);
|
|
2379
|
+
function qn() {
|
|
2344
2380
|
try {
|
|
2345
|
-
return
|
|
2381
|
+
return Gn;
|
|
2346
2382
|
} catch {
|
|
2347
2383
|
return null;
|
|
2348
2384
|
}
|
|
2349
2385
|
}
|
|
2350
|
-
function
|
|
2386
|
+
function Yn(r, e) {
|
|
2351
2387
|
if (r && typeof r.serializeForClipboard == "function")
|
|
2352
2388
|
return r.serializeForClipboard(e);
|
|
2353
|
-
const o =
|
|
2389
|
+
const o = qn();
|
|
2354
2390
|
if (o && typeof (o == null ? void 0 : o.__serializeForClipboard) == "function")
|
|
2355
2391
|
return o.__serializeForClipboard(r, e);
|
|
2356
2392
|
throw new Error("No supported clipboard serialization method found.");
|
|
2357
2393
|
}
|
|
2358
|
-
function
|
|
2359
|
-
const e = r.getBoundingClientRect(), o = r.closest('[role="dialog"]'),
|
|
2394
|
+
function Vn(r) {
|
|
2395
|
+
const e = r.getBoundingClientRect(), o = r.closest('[role="dialog"]'), n = r.closest(".ProseMirror"), a = n == null ? void 0 : n.getBoundingClientRect(), s = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop;
|
|
2360
2396
|
if (o && window.getComputedStyle(o).transform !== "none") {
|
|
2361
2397
|
const d = o.getBoundingClientRect();
|
|
2362
2398
|
return {
|
|
@@ -2366,12 +2402,12 @@ function Un(r) {
|
|
|
2366
2402
|
};
|
|
2367
2403
|
}
|
|
2368
2404
|
return {
|
|
2369
|
-
top:
|
|
2370
|
-
left:
|
|
2405
|
+
top: a ? e.top - a.top : e.top + i,
|
|
2406
|
+
left: a ? e.left - a.left : e.left + s,
|
|
2371
2407
|
width: e.width
|
|
2372
2408
|
};
|
|
2373
2409
|
}
|
|
2374
|
-
function
|
|
2410
|
+
function ot(r, e) {
|
|
2375
2411
|
const o = [
|
|
2376
2412
|
"li",
|
|
2377
2413
|
"p:not(:first-child)",
|
|
@@ -2383,45 +2419,45 @@ function Qe(r, e) {
|
|
|
2383
2419
|
"h4",
|
|
2384
2420
|
"h5",
|
|
2385
2421
|
"h6",
|
|
2386
|
-
...e.customNodes.map((
|
|
2422
|
+
...e.customNodes.map((n) => `[data-type=${n}]`)
|
|
2387
2423
|
].join(", ");
|
|
2388
2424
|
return document.elementsFromPoint(r.x, r.y).find(
|
|
2389
|
-
(
|
|
2390
|
-
var
|
|
2391
|
-
return ((s = (
|
|
2425
|
+
(n) => {
|
|
2426
|
+
var a, s;
|
|
2427
|
+
return ((s = (a = n.parentElement) == null ? void 0 : a.matches) == null ? void 0 : s.call(a, ".ProseMirror")) || n.matches(o);
|
|
2392
2428
|
}
|
|
2393
2429
|
);
|
|
2394
2430
|
}
|
|
2395
|
-
function
|
|
2396
|
-
var
|
|
2397
|
-
const
|
|
2398
|
-
return (
|
|
2399
|
-
left:
|
|
2400
|
-
top:
|
|
2401
|
-
})) == null ? void 0 :
|
|
2431
|
+
function rt(r, e, o) {
|
|
2432
|
+
var a;
|
|
2433
|
+
const n = r.getBoundingClientRect();
|
|
2434
|
+
return (a = e.posAtCoords({
|
|
2435
|
+
left: n.left + 50 + o.dragHandleWidth,
|
|
2436
|
+
top: n.top + 1
|
|
2437
|
+
})) == null ? void 0 : a.inside;
|
|
2402
2438
|
}
|
|
2403
|
-
function
|
|
2439
|
+
function Re(r, e) {
|
|
2404
2440
|
const o = e.state.doc.resolve(r);
|
|
2405
2441
|
return o.depth > 1 ? o.before(o.depth) : r;
|
|
2406
2442
|
}
|
|
2407
|
-
function
|
|
2443
|
+
function Wn(r) {
|
|
2408
2444
|
let e = "", o = !1;
|
|
2409
|
-
function
|
|
2445
|
+
function n(l, c) {
|
|
2410
2446
|
if (c.focus(), !l.dataTransfer) return;
|
|
2411
|
-
const
|
|
2447
|
+
const f = ot(
|
|
2412
2448
|
{
|
|
2413
2449
|
x: l.clientX + 50 + r.dragHandleWidth,
|
|
2414
2450
|
y: l.clientY
|
|
2415
2451
|
},
|
|
2416
2452
|
r
|
|
2417
2453
|
);
|
|
2418
|
-
if (!(
|
|
2419
|
-
let v =
|
|
2454
|
+
if (!(f instanceof Element)) return;
|
|
2455
|
+
let v = rt(f, c, r);
|
|
2420
2456
|
if (v == null || v < 0) return;
|
|
2421
|
-
v =
|
|
2422
|
-
const { from: D, to: h } = c.state.selection,
|
|
2457
|
+
v = Re(v, c);
|
|
2458
|
+
const { from: D, to: h } = c.state.selection, g = D - h, S = Re(D, c);
|
|
2423
2459
|
let y = !1;
|
|
2424
|
-
const N = c.state.doc.resolve(
|
|
2460
|
+
const N = c.state.doc.resolve(S);
|
|
2425
2461
|
if (N.node().type.name === "doc") y = !0;
|
|
2426
2462
|
else {
|
|
2427
2463
|
const C = J.create(
|
|
@@ -2431,9 +2467,9 @@ function Gn(r) {
|
|
|
2431
2467
|
y = !(v + 1 >= C.$from.pos && v <= C.$to.pos);
|
|
2432
2468
|
}
|
|
2433
2469
|
let u = c.state.selection;
|
|
2434
|
-
if (!y &&
|
|
2470
|
+
if (!y && g !== 0 && !(c.state.selection instanceof J)) {
|
|
2435
2471
|
const C = J.create(c.state.doc, h - 1);
|
|
2436
|
-
u =
|
|
2472
|
+
u = tn.create(
|
|
2437
2473
|
c.state.doc,
|
|
2438
2474
|
v,
|
|
2439
2475
|
C.$to.pos
|
|
@@ -2442,32 +2478,32 @@ function Gn(r) {
|
|
|
2442
2478
|
const C = c.state.doc.resolve(u.from);
|
|
2443
2479
|
u = J.create(c.state.doc, C.before());
|
|
2444
2480
|
}
|
|
2445
|
-
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof J && c.state.selection.node.type.name === "listItem" && (e =
|
|
2446
|
-
const
|
|
2447
|
-
l.dataTransfer.clearData(), l.dataTransfer.setData("text/html",
|
|
2481
|
+
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof J && c.state.selection.node.type.name === "listItem" && (e = f.parentElement.tagName);
|
|
2482
|
+
const T = c.state.selection.content(), { dom: A, text: I } = Yn(c, T);
|
|
2483
|
+
l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", A.innerHTML), l.dataTransfer.setData("text/plain", I), l.dataTransfer.effectAllowed = "copyMove", l.dataTransfer.setDragImage(f, 0, 0), c.dragging = { slice: T, move: l.ctrlKey };
|
|
2448
2484
|
}
|
|
2449
|
-
let
|
|
2485
|
+
let a = null;
|
|
2450
2486
|
function s() {
|
|
2451
|
-
|
|
2487
|
+
a && a.classList.add("hide");
|
|
2452
2488
|
}
|
|
2453
2489
|
function i() {
|
|
2454
|
-
|
|
2490
|
+
a && a.classList.remove("hide");
|
|
2455
2491
|
}
|
|
2456
2492
|
function d(l, c) {
|
|
2457
|
-
const
|
|
2493
|
+
const f = Re(c, l), v = J.create(l.state.doc, f);
|
|
2458
2494
|
l.dispatch(l.state.tr.setSelection(v)), l.focus(), o = !0;
|
|
2459
2495
|
}
|
|
2460
2496
|
function p(l) {
|
|
2461
|
-
if (o = l.state.selection instanceof J, o && (
|
|
2462
|
-
const
|
|
2497
|
+
if (o = l.state.selection instanceof J, o && (a != null && a.dataset.nodePos)) {
|
|
2498
|
+
const f = parseInt(a.dataset.nodePos, 10);
|
|
2463
2499
|
try {
|
|
2464
|
-
const v = l.state.doc.resolve(
|
|
2500
|
+
const v = l.state.doc.resolve(f);
|
|
2465
2501
|
v && v.parent && v.parent.type.name !== "doc" || (o = !1, s());
|
|
2466
2502
|
} catch {
|
|
2467
2503
|
o = !1, s();
|
|
2468
2504
|
}
|
|
2469
2505
|
}
|
|
2470
|
-
o &&
|
|
2506
|
+
o && a && !a.classList.contains("hide") ? i() : o || s();
|
|
2471
2507
|
}
|
|
2472
2508
|
function x(l) {
|
|
2473
2509
|
if (!(l.target instanceof Element)) return;
|
|
@@ -2476,40 +2512,40 @@ function Gn(r) {
|
|
|
2476
2512
|
o || s();
|
|
2477
2513
|
return;
|
|
2478
2514
|
}
|
|
2479
|
-
const
|
|
2480
|
-
!
|
|
2515
|
+
const f = c.closest(".drag-handle") || c.classList.contains("drag-handle"), v = c.closest(".tiptap") || c.classList.contains("tiptap");
|
|
2516
|
+
!f && !v && !o && s();
|
|
2481
2517
|
}
|
|
2482
|
-
return new
|
|
2483
|
-
key: new
|
|
2518
|
+
return new Qr({
|
|
2519
|
+
key: new en(r.pluginKey),
|
|
2484
2520
|
view: (l) => {
|
|
2485
|
-
var h,
|
|
2521
|
+
var h, g, S, y;
|
|
2486
2522
|
const c = r.dragHandleSelector ? document.querySelector(r.dragHandleSelector) : null;
|
|
2487
|
-
|
|
2488
|
-
function
|
|
2489
|
-
|
|
2523
|
+
a = c ?? document.createElement("div"), a.draggable = !0, a.dataset.dragHandle = "", a.classList.add("drag-handle");
|
|
2524
|
+
function f(N) {
|
|
2525
|
+
n(N, l);
|
|
2490
2526
|
}
|
|
2491
|
-
|
|
2527
|
+
a.addEventListener("dragstart", f);
|
|
2492
2528
|
function v(N) {
|
|
2493
2529
|
c || (N.preventDefault(), N.stopPropagation());
|
|
2494
|
-
const u =
|
|
2530
|
+
const u = a == null ? void 0 : a.dataset.nodePos;
|
|
2495
2531
|
u && d(l, parseInt(u, 10));
|
|
2496
2532
|
}
|
|
2497
|
-
|
|
2533
|
+
a.addEventListener("click", v);
|
|
2498
2534
|
function D(N) {
|
|
2499
2535
|
s();
|
|
2500
2536
|
const u = window.scrollY;
|
|
2501
2537
|
N.clientY < r.scrollTreshold ? window.scrollTo({ top: u - 30, behavior: "smooth" }) : window.innerHeight - N.clientY < r.scrollTreshold && window.scrollTo({ top: u + 30, behavior: "smooth" });
|
|
2502
2538
|
}
|
|
2503
|
-
return
|
|
2539
|
+
return a.addEventListener("drag", D), s(), c || (g = (h = l == null ? void 0 : l.dom) == null ? void 0 : h.parentElement) == null || g.appendChild(a), (y = (S = l == null ? void 0 : l.dom) == null ? void 0 : S.parentElement) == null || y.addEventListener(
|
|
2504
2540
|
"mouseout",
|
|
2505
2541
|
x
|
|
2506
2542
|
), {
|
|
2507
2543
|
destroy: () => {
|
|
2508
|
-
var N, u,
|
|
2509
|
-
c || (N =
|
|
2544
|
+
var N, u, T;
|
|
2545
|
+
c || (N = a == null ? void 0 : a.remove) == null || N.call(a), a == null || a.removeEventListener("drag", D), a == null || a.removeEventListener(
|
|
2510
2546
|
"dragstart",
|
|
2511
|
-
|
|
2512
|
-
),
|
|
2547
|
+
f
|
|
2548
|
+
), a == null || a.removeEventListener("click", v), a = null, (T = (u = l == null ? void 0 : l.dom) == null ? void 0 : u.parentElement) == null || T.removeEventListener(
|
|
2513
2549
|
"mouseout",
|
|
2514
2550
|
x
|
|
2515
2551
|
);
|
|
@@ -2521,23 +2557,23 @@ function Gn(r) {
|
|
|
2521
2557
|
mousemove: (l, c) => {
|
|
2522
2558
|
if (!l.editable)
|
|
2523
2559
|
return;
|
|
2524
|
-
const
|
|
2560
|
+
const f = ot(
|
|
2525
2561
|
{
|
|
2526
2562
|
x: c.clientX + 50 + r.dragHandleWidth,
|
|
2527
2563
|
y: c.clientY
|
|
2528
2564
|
},
|
|
2529
2565
|
r
|
|
2530
|
-
), v =
|
|
2531
|
-
if (!(
|
|
2566
|
+
), v = f == null ? void 0 : f.closest(".not-draggable"), D = r.excludedTags.concat(["ol", "ul"]).join(", ");
|
|
2567
|
+
if (!(f instanceof Element) || f.matches(D) || v) {
|
|
2532
2568
|
o || s();
|
|
2533
2569
|
return;
|
|
2534
2570
|
}
|
|
2535
|
-
const h =
|
|
2536
|
-
h != null && h >= 0 && (
|
|
2537
|
-
|
|
2571
|
+
const h = rt(f, l, r);
|
|
2572
|
+
h != null && h >= 0 && (a.dataset.nodePos = String(
|
|
2573
|
+
Re(h, l)
|
|
2538
2574
|
));
|
|
2539
|
-
const
|
|
2540
|
-
u.top += (y - 24) / 2, u.top += N,
|
|
2575
|
+
const g = window.getComputedStyle(f), S = parseInt(g.lineHeight, 10), y = isNaN(S) ? parseInt(g.fontSize) * 1.2 : S, N = parseInt(g.paddingTop, 10), u = Vn(f);
|
|
2576
|
+
u.top += (y - 24) / 2, u.top += N, f.matches("ul:not([data-type=taskList]) li, ol li") && (u.left -= r.dragHandleWidth - 28), u.width = r.dragHandleWidth, a && (a.style.position = "absolute", a.style.left = `${u.left - u.width}px`, a.style.top = `${u.top}px`, i());
|
|
2541
2577
|
},
|
|
2542
2578
|
keydown: () => {
|
|
2543
2579
|
o || s();
|
|
@@ -2554,20 +2590,20 @@ function Gn(r) {
|
|
|
2554
2590
|
l.dom.classList.add("dragging");
|
|
2555
2591
|
},
|
|
2556
2592
|
drop: (l, c) => {
|
|
2557
|
-
var
|
|
2593
|
+
var g;
|
|
2558
2594
|
l.dom.classList.remove("dragging"), s();
|
|
2559
|
-
let
|
|
2595
|
+
let f = null;
|
|
2560
2596
|
const v = l.posAtCoords({
|
|
2561
2597
|
left: c.clientX,
|
|
2562
2598
|
top: c.clientY
|
|
2563
2599
|
});
|
|
2564
|
-
if (!v || (l.state.selection instanceof J && (
|
|
2600
|
+
if (!v || (l.state.selection instanceof J && (f = l.state.selection.node), !f)) return;
|
|
2565
2601
|
const h = l.state.doc.resolve(v.pos).parent.type.name === "listItem";
|
|
2566
2602
|
if (l.state.selection instanceof J && l.state.selection.node.type.name === "listItem" && !h && e == "OL") {
|
|
2567
|
-
const
|
|
2603
|
+
const S = (g = l.state.schema.nodes.orderedList) == null ? void 0 : g.createAndFill(
|
|
2568
2604
|
null,
|
|
2569
|
-
|
|
2570
|
-
), y = new
|
|
2605
|
+
f
|
|
2606
|
+
), y = new on(rn.from(S), 0, 0);
|
|
2571
2607
|
l.dragging = { slice: y, move: c.ctrlKey };
|
|
2572
2608
|
}
|
|
2573
2609
|
},
|
|
@@ -2581,9 +2617,9 @@ function Gn(r) {
|
|
|
2581
2617
|
init() {
|
|
2582
2618
|
return {};
|
|
2583
2619
|
},
|
|
2584
|
-
apply(l, c,
|
|
2585
|
-
if (l.docChanged &&
|
|
2586
|
-
const D = parseInt(
|
|
2620
|
+
apply(l, c, f, v) {
|
|
2621
|
+
if (l.docChanged && a && a.dataset.nodePos) {
|
|
2622
|
+
const D = parseInt(a.dataset.nodePos, 10);
|
|
2587
2623
|
try {
|
|
2588
2624
|
const h = v.doc.resolve(D);
|
|
2589
2625
|
(!h || h.parent.type.name === "doc") && (o = !1, s());
|
|
@@ -2596,7 +2632,7 @@ function Gn(r) {
|
|
|
2596
2632
|
}
|
|
2597
2633
|
});
|
|
2598
2634
|
}
|
|
2599
|
-
const
|
|
2635
|
+
const Kn = Zr.create({
|
|
2600
2636
|
name: "globalDragHandle",
|
|
2601
2637
|
addOptions() {
|
|
2602
2638
|
return {
|
|
@@ -2608,7 +2644,7 @@ const qn = Vr.create({
|
|
|
2608
2644
|
},
|
|
2609
2645
|
addProseMirrorPlugins() {
|
|
2610
2646
|
return [
|
|
2611
|
-
|
|
2647
|
+
Wn({
|
|
2612
2648
|
pluginKey: "globalDragHandle",
|
|
2613
2649
|
dragHandleWidth: this.options.dragHandleWidth,
|
|
2614
2650
|
scrollTreshold: this.options.scrollTreshold,
|
|
@@ -2618,18 +2654,18 @@ const qn = Vr.create({
|
|
|
2618
2654
|
})
|
|
2619
2655
|
];
|
|
2620
2656
|
}
|
|
2621
|
-
}),
|
|
2657
|
+
}), Jn = Nr, Zn = ur.configure({
|
|
2622
2658
|
placeholder: "撰写任何内容,或者按“/”输入命令..."
|
|
2623
|
-
}),
|
|
2659
|
+
}), Qn = pr.configure({
|
|
2624
2660
|
HTMLAttributes: {
|
|
2625
2661
|
class: Y(
|
|
2626
2662
|
"text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
|
|
2627
2663
|
)
|
|
2628
2664
|
}
|
|
2629
|
-
}),
|
|
2665
|
+
}), ea = gr.extend({
|
|
2630
2666
|
addProseMirrorPlugins() {
|
|
2631
2667
|
return [
|
|
2632
|
-
|
|
2668
|
+
fr({
|
|
2633
2669
|
imageClass: Y("opacity-40 rounded-lg border border-stone-200")
|
|
2634
2670
|
})
|
|
2635
2671
|
];
|
|
@@ -2639,24 +2675,24 @@ const qn = Vr.create({
|
|
|
2639
2675
|
HTMLAttributes: {
|
|
2640
2676
|
class: Y("rounded-lg border border-muted")
|
|
2641
2677
|
}
|
|
2642
|
-
}),
|
|
2678
|
+
}), ta = hr.configure({
|
|
2643
2679
|
HTMLAttributes: {
|
|
2644
2680
|
class: Y("rounded-lg border border-muted")
|
|
2645
2681
|
}
|
|
2646
|
-
}),
|
|
2682
|
+
}), oa = br.configure({
|
|
2647
2683
|
HTMLAttributes: {
|
|
2648
2684
|
class: Y("not-prose pl-2 ")
|
|
2649
2685
|
}
|
|
2650
|
-
}),
|
|
2686
|
+
}), ra = xr.configure({
|
|
2651
2687
|
HTMLAttributes: {
|
|
2652
2688
|
class: Y("flex gap-2 items-start my-4")
|
|
2653
2689
|
},
|
|
2654
2690
|
nested: !0
|
|
2655
|
-
}),
|
|
2691
|
+
}), na = yr.configure({
|
|
2656
2692
|
HTMLAttributes: {
|
|
2657
2693
|
class: Y("mt-4 mb-6 border-t border-muted-foreground")
|
|
2658
2694
|
}
|
|
2659
|
-
}),
|
|
2695
|
+
}), aa = vr.configure({
|
|
2660
2696
|
bulletList: {
|
|
2661
2697
|
HTMLAttributes: {
|
|
2662
2698
|
class: Y("list-disc list-outside leading-3 -mt-2")
|
|
@@ -2696,18 +2732,18 @@ const qn = Vr.create({
|
|
|
2696
2732
|
width: 4
|
|
2697
2733
|
},
|
|
2698
2734
|
gapcursor: !1
|
|
2699
|
-
}),
|
|
2735
|
+
}), sa = kr.configure({
|
|
2700
2736
|
// configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
|
|
2701
2737
|
// common: covers 37 language grammars which should be good enough in most cases
|
|
2702
|
-
lowlight:
|
|
2703
|
-
}),
|
|
2738
|
+
lowlight: Kr(Jr)
|
|
2739
|
+
}), ia = Cr.configure({
|
|
2704
2740
|
HTMLAttributes: {
|
|
2705
2741
|
class: Y("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
|
|
2706
2742
|
},
|
|
2707
2743
|
katexOptions: {
|
|
2708
2744
|
throwOnError: !1
|
|
2709
2745
|
}
|
|
2710
|
-
}),
|
|
2746
|
+
}), la = wr.configure(), ca = Vr.configure({
|
|
2711
2747
|
html: !0,
|
|
2712
2748
|
tightLists: !0,
|
|
2713
2749
|
tightListClass: "tight",
|
|
@@ -2716,44 +2752,44 @@ const qn = Vr.create({
|
|
|
2716
2752
|
breaks: !1,
|
|
2717
2753
|
transformPastedText: !1,
|
|
2718
2754
|
transformCopiedText: !1
|
|
2719
|
-
}),
|
|
2755
|
+
}), da = Kn.configure({
|
|
2720
2756
|
dragHandleWidth: 56,
|
|
2721
2757
|
dragHandleSelector: ".custom-drag-handle"
|
|
2722
|
-
}),
|
|
2723
|
-
|
|
2724
|
-
Vn,
|
|
2725
|
-
Wn,
|
|
2726
|
-
Kn,
|
|
2727
|
-
Jn,
|
|
2758
|
+
}), Ot = [
|
|
2759
|
+
aa,
|
|
2728
2760
|
Zn,
|
|
2729
2761
|
Qn,
|
|
2730
2762
|
ea,
|
|
2731
|
-
|
|
2763
|
+
ta,
|
|
2732
2764
|
oa,
|
|
2733
2765
|
ra,
|
|
2734
2766
|
na,
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
Nr,
|
|
2767
|
+
Jn,
|
|
2768
|
+
sa,
|
|
2769
|
+
ia,
|
|
2770
|
+
la,
|
|
2740
2771
|
Ir,
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2772
|
+
ca,
|
|
2773
|
+
Sr,
|
|
2774
|
+
Tr,
|
|
2775
|
+
Mr,
|
|
2776
|
+
Lr,
|
|
2777
|
+
da
|
|
2778
|
+
], ma = Ce.Root, Ft = Ce.Trigger, Ee = q.forwardRef(({ className: r, align: e = "center", sideOffset: o = 4, ...n }, a) => /* @__PURE__ */ t(Ce.Portal, { children: /* @__PURE__ */ t(
|
|
2779
|
+
Ce.Content,
|
|
2744
2780
|
{
|
|
2745
|
-
ref:
|
|
2781
|
+
ref: a,
|
|
2746
2782
|
align: e,
|
|
2747
2783
|
sideOffset: o,
|
|
2748
2784
|
className: k(
|
|
2749
2785
|
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2750
2786
|
r
|
|
2751
2787
|
),
|
|
2752
|
-
...
|
|
2788
|
+
...n
|
|
2753
2789
|
}
|
|
2754
2790
|
) }));
|
|
2755
|
-
|
|
2756
|
-
const
|
|
2791
|
+
Ee.displayName = Ce.Content.displayName;
|
|
2792
|
+
const ua = Wr(
|
|
2757
2793
|
"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",
|
|
2758
2794
|
{
|
|
2759
2795
|
variants: {
|
|
@@ -2778,17 +2814,17 @@ const la = Gr(
|
|
|
2778
2814
|
}
|
|
2779
2815
|
}
|
|
2780
2816
|
), Z = q.forwardRef(
|
|
2781
|
-
({ className: r, variant: e, size: o, asChild:
|
|
2782
|
-
|
|
2817
|
+
({ className: r, variant: e, size: o, asChild: n = !1, ...a }, s) => /* @__PURE__ */ t(
|
|
2818
|
+
n ? sn : "button",
|
|
2783
2819
|
{
|
|
2784
|
-
className: k(
|
|
2820
|
+
className: k(ua({ variant: e, size: o, className: r })),
|
|
2785
2821
|
ref: s,
|
|
2786
|
-
...
|
|
2822
|
+
...a
|
|
2787
2823
|
}
|
|
2788
2824
|
)
|
|
2789
2825
|
);
|
|
2790
2826
|
Z.displayName = "Button";
|
|
2791
|
-
const
|
|
2827
|
+
const nt = [
|
|
2792
2828
|
{
|
|
2793
2829
|
name: "默认",
|
|
2794
2830
|
// Default
|
|
@@ -2834,7 +2870,7 @@ const tt = [
|
|
|
2834
2870
|
// Gray
|
|
2835
2871
|
color: "#A8A29E"
|
|
2836
2872
|
}
|
|
2837
|
-
],
|
|
2873
|
+
], at = [
|
|
2838
2874
|
{
|
|
2839
2875
|
name: "默认背景",
|
|
2840
2876
|
// Default
|
|
@@ -2881,7 +2917,7 @@ const tt = [
|
|
|
2881
2917
|
color: "var(--novel-highlight-gray)"
|
|
2882
2918
|
}
|
|
2883
2919
|
], me = (r) => /* @__PURE__ */ t(
|
|
2884
|
-
|
|
2920
|
+
dt,
|
|
2885
2921
|
{
|
|
2886
2922
|
classNames: {
|
|
2887
2923
|
root: b`
|
|
@@ -2896,31 +2932,31 @@ const tt = [
|
|
|
2896
2932
|
showArrow: !1,
|
|
2897
2933
|
...r
|
|
2898
2934
|
}
|
|
2899
|
-
),
|
|
2935
|
+
), pa = ({ open: r, onOpenChange: e }) => {
|
|
2900
2936
|
const { editor: o } = Q();
|
|
2901
2937
|
if (!o) return null;
|
|
2902
|
-
const
|
|
2938
|
+
const n = nt.find(
|
|
2903
2939
|
({ color: s }) => o.isActive("textStyle", { color: s })
|
|
2904
|
-
),
|
|
2940
|
+
), a = at.find(
|
|
2905
2941
|
({ color: s }) => o.isActive("highlight", { color: s })
|
|
2906
2942
|
);
|
|
2907
|
-
return /* @__PURE__ */ m(
|
|
2908
|
-
/* @__PURE__ */ t(me, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(
|
|
2943
|
+
return /* @__PURE__ */ m(ma, { modal: !0, open: r, onOpenChange: e, children: [
|
|
2944
|
+
/* @__PURE__ */ t(me, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(Ft, { asChild: !0, children: /* @__PURE__ */ m(Z, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
|
|
2909
2945
|
/* @__PURE__ */ t(
|
|
2910
2946
|
"span",
|
|
2911
2947
|
{
|
|
2912
2948
|
className: "rounded-sm px-1",
|
|
2913
2949
|
style: {
|
|
2914
|
-
color:
|
|
2915
|
-
backgroundColor:
|
|
2950
|
+
color: n == null ? void 0 : n.color,
|
|
2951
|
+
backgroundColor: a == null ? void 0 : a.color
|
|
2916
2952
|
},
|
|
2917
2953
|
children: "A"
|
|
2918
2954
|
}
|
|
2919
2955
|
),
|
|
2920
|
-
/* @__PURE__ */ t(
|
|
2956
|
+
/* @__PURE__ */ t(mt, {})
|
|
2921
2957
|
] }) }) }),
|
|
2922
2958
|
/* @__PURE__ */ m(
|
|
2923
|
-
|
|
2959
|
+
Ee,
|
|
2924
2960
|
{
|
|
2925
2961
|
sideOffset: 5,
|
|
2926
2962
|
className: "my-1 flex max-h-80 w-48 flex-col overflow-hidden overflow-y-auto rounded border p-1 shadow-xl ",
|
|
@@ -2928,8 +2964,8 @@ const tt = [
|
|
|
2928
2964
|
children: [
|
|
2929
2965
|
/* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
2930
2966
|
/* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "颜色" }),
|
|
2931
|
-
|
|
2932
|
-
|
|
2967
|
+
nt.map(({ name: s, color: i }) => /* @__PURE__ */ m(
|
|
2968
|
+
Pe,
|
|
2933
2969
|
{
|
|
2934
2970
|
onSelect: () => {
|
|
2935
2971
|
o.commands.unsetColor(), s !== "Default" && o.chain().focus().setColor(i || "").run(), e(!1);
|
|
@@ -2947,7 +2983,7 @@ const tt = [
|
|
|
2947
2983
|
),
|
|
2948
2984
|
/* @__PURE__ */ t("span", { children: s })
|
|
2949
2985
|
] }),
|
|
2950
|
-
o.isActive("textStyle", { color: i }) && /* @__PURE__ */ t(
|
|
2986
|
+
o.isActive("textStyle", { color: i }) && /* @__PURE__ */ t(ke, { size: 14 })
|
|
2951
2987
|
]
|
|
2952
2988
|
},
|
|
2953
2989
|
s
|
|
@@ -2955,8 +2991,8 @@ const tt = [
|
|
|
2955
2991
|
] }),
|
|
2956
2992
|
/* @__PURE__ */ m("div", { children: [
|
|
2957
2993
|
/* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "背景 " }),
|
|
2958
|
-
|
|
2959
|
-
|
|
2994
|
+
at.map(({ name: s, color: i }) => /* @__PURE__ */ m(
|
|
2995
|
+
Pe,
|
|
2960
2996
|
{
|
|
2961
2997
|
onSelect: () => {
|
|
2962
2998
|
o.commands.unsetHighlight(), s !== "Default" && o.chain().focus().setHighlight({ color: i }).run(), e(!1);
|
|
@@ -2974,7 +3010,7 @@ const tt = [
|
|
|
2974
3010
|
),
|
|
2975
3011
|
/* @__PURE__ */ t("span", { children: s })
|
|
2976
3012
|
] }),
|
|
2977
|
-
o.isActive("highlight", { color: i }) && /* @__PURE__ */ t(
|
|
3013
|
+
o.isActive("highlight", { color: i }) && /* @__PURE__ */ t(ke, { size: 14 })
|
|
2978
3014
|
]
|
|
2979
3015
|
},
|
|
2980
3016
|
s
|
|
@@ -2985,15 +3021,15 @@ const tt = [
|
|
|
2985
3021
|
)
|
|
2986
3022
|
] });
|
|
2987
3023
|
};
|
|
2988
|
-
function
|
|
3024
|
+
function ga(r) {
|
|
2989
3025
|
try {
|
|
2990
3026
|
return new URL(r), !0;
|
|
2991
3027
|
} catch {
|
|
2992
3028
|
return !1;
|
|
2993
3029
|
}
|
|
2994
3030
|
}
|
|
2995
|
-
function
|
|
2996
|
-
if (
|
|
3031
|
+
function fa(r) {
|
|
3032
|
+
if (ga(r)) return r;
|
|
2997
3033
|
try {
|
|
2998
3034
|
if (r.includes(".") && !r.includes(" "))
|
|
2999
3035
|
return new URL(`https://${r}`).toString();
|
|
@@ -3001,27 +3037,27 @@ function ma(r) {
|
|
|
3001
3037
|
return null;
|
|
3002
3038
|
}
|
|
3003
3039
|
}
|
|
3004
|
-
const
|
|
3005
|
-
const o =
|
|
3040
|
+
const ha = ({ open: r, onOpenChange: e }) => {
|
|
3041
|
+
const o = xe(null), { editor: n } = Q();
|
|
3006
3042
|
return ae(() => {
|
|
3007
|
-
var
|
|
3008
|
-
(
|
|
3009
|
-
}),
|
|
3010
|
-
/* @__PURE__ */ t(me, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(
|
|
3043
|
+
var a;
|
|
3044
|
+
(a = o.current) == null || a.focus();
|
|
3045
|
+
}), n ? /* @__PURE__ */ m(It, { modal: !0, open: r, onOpenChange: e, children: [
|
|
3046
|
+
/* @__PURE__ */ t(me, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(an, { asChild: !0, children: /* @__PURE__ */ m(
|
|
3011
3047
|
Z,
|
|
3012
3048
|
{
|
|
3013
3049
|
size: "sm",
|
|
3014
3050
|
variant: "ghost",
|
|
3015
3051
|
className: "gap-2 rounded-md border-none",
|
|
3016
3052
|
children: [
|
|
3017
|
-
/* @__PURE__ */ t("p", { className: "text-base", children: /* @__PURE__ */ t(
|
|
3053
|
+
/* @__PURE__ */ t("p", { className: "text-base", children: /* @__PURE__ */ t(ko, { size: 16 }) }),
|
|
3018
3054
|
/* @__PURE__ */ t(
|
|
3019
3055
|
"p",
|
|
3020
3056
|
{
|
|
3021
3057
|
className: k(
|
|
3022
3058
|
"underline decoration-stone-400 underline-offset-4",
|
|
3023
3059
|
{
|
|
3024
|
-
"text-blue-500":
|
|
3060
|
+
"text-blue-500": n.isActive("link")
|
|
3025
3061
|
}
|
|
3026
3062
|
),
|
|
3027
3063
|
children: "链接 "
|
|
@@ -3030,14 +3066,14 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3030
3066
|
]
|
|
3031
3067
|
}
|
|
3032
3068
|
) }) }),
|
|
3033
|
-
/* @__PURE__ */ t(
|
|
3069
|
+
/* @__PURE__ */ t(Ee, { align: "start", className: "w-60 p-0", sideOffset: 10, children: /* @__PURE__ */ m(
|
|
3034
3070
|
"form",
|
|
3035
3071
|
{
|
|
3036
|
-
onSubmit: (
|
|
3037
|
-
const s =
|
|
3038
|
-
|
|
3039
|
-
const i = s[0], d =
|
|
3040
|
-
d && (
|
|
3072
|
+
onSubmit: (a) => {
|
|
3073
|
+
const s = a.currentTarget;
|
|
3074
|
+
a.preventDefault();
|
|
3075
|
+
const i = s[0], d = fa(i.value);
|
|
3076
|
+
d && (n.chain().focus().setLink({ href: d }).run(), e(!1));
|
|
3041
3077
|
},
|
|
3042
3078
|
className: "flex p-1 ",
|
|
3043
3079
|
children: [
|
|
@@ -3048,10 +3084,10 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3048
3084
|
type: "text",
|
|
3049
3085
|
placeholder: "粘贴链接",
|
|
3050
3086
|
className: "flex-1 bg-background p-1 text-sm outline-none",
|
|
3051
|
-
defaultValue:
|
|
3087
|
+
defaultValue: n.getAttributes("link").href || ""
|
|
3052
3088
|
}
|
|
3053
3089
|
),
|
|
3054
|
-
|
|
3090
|
+
n.getAttributes("link").href ? /* @__PURE__ */ t(
|
|
3055
3091
|
Z,
|
|
3056
3092
|
{
|
|
3057
3093
|
size: "icon",
|
|
@@ -3059,16 +3095,16 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3059
3095
|
type: "button",
|
|
3060
3096
|
className: "flex h-8 items-center rounded-sm p-1 text-red-600 transition-all hover:bg-red-100 dark:hover:bg-red-800",
|
|
3061
3097
|
onClick: () => {
|
|
3062
|
-
|
|
3098
|
+
n.chain().focus().unsetLink().run(), o.current.value = "", e(!1);
|
|
3063
3099
|
},
|
|
3064
|
-
children: /* @__PURE__ */ t(
|
|
3100
|
+
children: /* @__PURE__ */ t(ut, { className: "h-4 w-4" })
|
|
3065
3101
|
}
|
|
3066
|
-
) : /* @__PURE__ */ t(Z, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(
|
|
3102
|
+
) : /* @__PURE__ */ t(Z, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ke, { className: "h-4 w-4" }) })
|
|
3067
3103
|
]
|
|
3068
3104
|
}
|
|
3069
3105
|
) })
|
|
3070
3106
|
] }) : null;
|
|
3071
|
-
},
|
|
3107
|
+
}, ba = () => {
|
|
3072
3108
|
const { editor: r } = Q();
|
|
3073
3109
|
return r ? /* @__PURE__ */ t(me, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ t(
|
|
3074
3110
|
Z,
|
|
@@ -3080,13 +3116,13 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3080
3116
|
if (r.isActive("math"))
|
|
3081
3117
|
r.chain().focus().unsetLatex().run();
|
|
3082
3118
|
else {
|
|
3083
|
-
const { from: e, to: o } = r.state.selection,
|
|
3084
|
-
if (!
|
|
3085
|
-
r.chain().focus().setLatex({ latex:
|
|
3119
|
+
const { from: e, to: o } = r.state.selection, n = r.state.doc.textBetween(e, o);
|
|
3120
|
+
if (!n) return;
|
|
3121
|
+
r.chain().focus().setLatex({ latex: n }).run();
|
|
3086
3122
|
}
|
|
3087
3123
|
},
|
|
3088
3124
|
children: /* @__PURE__ */ t(
|
|
3089
|
-
|
|
3125
|
+
ln,
|
|
3090
3126
|
{
|
|
3091
3127
|
className: k("size-4", { "text-blue-500": r.isActive("math") }),
|
|
3092
3128
|
strokeWidth: 2.3
|
|
@@ -3094,118 +3130,118 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3094
3130
|
)
|
|
3095
3131
|
}
|
|
3096
3132
|
) }) : null;
|
|
3097
|
-
},
|
|
3133
|
+
}, je = [
|
|
3098
3134
|
{
|
|
3099
3135
|
name: "正文",
|
|
3100
3136
|
// Text
|
|
3101
|
-
icon:
|
|
3137
|
+
icon: pt,
|
|
3102
3138
|
command: (r) => r.chain().focus().clearNodes().run(),
|
|
3103
3139
|
isActive: (r) => r.isActive("paragraph") && !r.isActive("bulletList") && !r.isActive("orderedList")
|
|
3104
3140
|
},
|
|
3105
3141
|
{
|
|
3106
3142
|
name: "标题 1",
|
|
3107
3143
|
// Heading 1
|
|
3108
|
-
icon:
|
|
3144
|
+
icon: gt,
|
|
3109
3145
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 1 }).run(),
|
|
3110
3146
|
isActive: (r) => r.isActive("heading", { level: 1 })
|
|
3111
3147
|
},
|
|
3112
3148
|
{
|
|
3113
3149
|
name: "标题 2",
|
|
3114
3150
|
// Heading 2
|
|
3115
|
-
icon:
|
|
3151
|
+
icon: ft,
|
|
3116
3152
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 2 }).run(),
|
|
3117
3153
|
isActive: (r) => r.isActive("heading", { level: 2 })
|
|
3118
3154
|
},
|
|
3119
3155
|
{
|
|
3120
3156
|
name: "标题 3",
|
|
3121
3157
|
// Heading 3
|
|
3122
|
-
icon:
|
|
3158
|
+
icon: ht,
|
|
3123
3159
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 3 }).run(),
|
|
3124
3160
|
isActive: (r) => r.isActive("heading", { level: 3 })
|
|
3125
3161
|
},
|
|
3126
3162
|
{
|
|
3127
3163
|
name: "待办列表",
|
|
3128
3164
|
// To-do List
|
|
3129
|
-
icon:
|
|
3165
|
+
icon: bt,
|
|
3130
3166
|
command: (r) => r.chain().focus().clearNodes().toggleTaskList().run(),
|
|
3131
3167
|
isActive: (r) => r.isActive("taskItem")
|
|
3132
3168
|
},
|
|
3133
3169
|
{
|
|
3134
3170
|
name: "无序列表",
|
|
3135
3171
|
// Bullet List
|
|
3136
|
-
icon:
|
|
3172
|
+
icon: xt,
|
|
3137
3173
|
command: (r) => r.chain().focus().clearNodes().toggleBulletList().run(),
|
|
3138
3174
|
isActive: (r) => r.isActive("bulletList")
|
|
3139
3175
|
},
|
|
3140
3176
|
{
|
|
3141
3177
|
name: "有序列表",
|
|
3142
3178
|
// Numbered List
|
|
3143
|
-
icon:
|
|
3179
|
+
icon: yt,
|
|
3144
3180
|
command: (r) => r.chain().focus().clearNodes().toggleOrderedList().run(),
|
|
3145
3181
|
isActive: (r) => r.isActive("orderedList")
|
|
3146
3182
|
},
|
|
3147
3183
|
{
|
|
3148
3184
|
name: "引用",
|
|
3149
3185
|
// Quote
|
|
3150
|
-
icon:
|
|
3186
|
+
icon: vt,
|
|
3151
3187
|
command: (r) => r.chain().focus().clearNodes().toggleBlockquote().run(),
|
|
3152
3188
|
isActive: (r) => r.isActive("blockquote")
|
|
3153
3189
|
},
|
|
3154
3190
|
{
|
|
3155
3191
|
name: "代码块",
|
|
3156
3192
|
// Code
|
|
3157
|
-
icon:
|
|
3193
|
+
icon: kt,
|
|
3158
3194
|
command: (r) => r.chain().focus().clearNodes().toggleCodeBlock().run(),
|
|
3159
3195
|
isActive: (r) => r.isActive("codeBlock")
|
|
3160
3196
|
}
|
|
3161
|
-
],
|
|
3197
|
+
], xa = ({ open: r, onOpenChange: e }) => {
|
|
3162
3198
|
const { editor: o } = Q();
|
|
3163
3199
|
if (!o) return null;
|
|
3164
|
-
const
|
|
3165
|
-
(
|
|
3200
|
+
const n = je.filter(
|
|
3201
|
+
(a) => a.isActive(o)
|
|
3166
3202
|
).pop() ?? {
|
|
3167
3203
|
name: "多个选中"
|
|
3168
3204
|
// Multiple
|
|
3169
3205
|
};
|
|
3170
|
-
return /* @__PURE__ */ m(
|
|
3206
|
+
return /* @__PURE__ */ m(It, { modal: !0, open: r, onOpenChange: e, children: [
|
|
3171
3207
|
/* @__PURE__ */ t(me, { overlay: "转换成", placement: "top", children: /* @__PURE__ */ t(
|
|
3172
|
-
|
|
3208
|
+
Ft,
|
|
3173
3209
|
{
|
|
3174
3210
|
asChild: !0,
|
|
3175
3211
|
className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
|
|
3176
3212
|
children: /* @__PURE__ */ m(Z, { size: "sm", variant: "ghost", children: [
|
|
3177
|
-
/* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children:
|
|
3178
|
-
/* @__PURE__ */ t(
|
|
3213
|
+
/* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children: n.name }),
|
|
3214
|
+
/* @__PURE__ */ t(mt, {})
|
|
3179
3215
|
] })
|
|
3180
3216
|
}
|
|
3181
3217
|
) }),
|
|
3182
|
-
/* @__PURE__ */ m(
|
|
3218
|
+
/* @__PURE__ */ m(Ee, { sideOffset: 5, align: "start", className: "w-48 p-1", children: [
|
|
3183
3219
|
/* @__PURE__ */ t("p", { className: "mb-2 text-sm text-secondary-foreground", children: "转换成" }),
|
|
3184
3220
|
" ",
|
|
3185
|
-
|
|
3186
|
-
|
|
3221
|
+
je.map((a) => /* @__PURE__ */ m(
|
|
3222
|
+
Pe,
|
|
3187
3223
|
{
|
|
3188
3224
|
onSelect: (s) => {
|
|
3189
|
-
|
|
3225
|
+
a.command(s), e(!1);
|
|
3190
3226
|
},
|
|
3191
3227
|
className: "flex cursor-pointer items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-accent",
|
|
3192
3228
|
children: [
|
|
3193
3229
|
/* @__PURE__ */ m("div", { className: "flex items-center space-x-2", children: [
|
|
3194
|
-
/* @__PURE__ */ t("div", { className: "rounded-sm border p-1", children: /* @__PURE__ */ t(
|
|
3195
|
-
/* @__PURE__ */ t("span", { children:
|
|
3230
|
+
/* @__PURE__ */ t("div", { className: "rounded-sm border p-1", children: /* @__PURE__ */ t(a.icon, { className: "h-3 w-3" }) }),
|
|
3231
|
+
/* @__PURE__ */ t("span", { children: a.name })
|
|
3196
3232
|
] }),
|
|
3197
|
-
|
|
3233
|
+
n.name === a.name && /* @__PURE__ */ t(ke, { size: 14 })
|
|
3198
3234
|
]
|
|
3199
3235
|
},
|
|
3200
|
-
|
|
3236
|
+
a.name
|
|
3201
3237
|
))
|
|
3202
3238
|
] })
|
|
3203
3239
|
] });
|
|
3204
|
-
},
|
|
3205
|
-
({ className: r, orientation: e = "horizontal", decorative: o = !0, ...
|
|
3206
|
-
|
|
3240
|
+
}, fe = q.forwardRef(
|
|
3241
|
+
({ className: r, orientation: e = "horizontal", decorative: o = !0, ...n }, a) => /* @__PURE__ */ t(
|
|
3242
|
+
St.Root,
|
|
3207
3243
|
{
|
|
3208
|
-
ref:
|
|
3244
|
+
ref: a,
|
|
3209
3245
|
decorative: o,
|
|
3210
3246
|
orientation: e,
|
|
3211
3247
|
className: k(
|
|
@@ -3213,33 +3249,33 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3213
3249
|
e === "horizontal" ? "h-[1px] w-full" : " w-[1px]",
|
|
3214
3250
|
r
|
|
3215
3251
|
),
|
|
3216
|
-
...
|
|
3252
|
+
...n
|
|
3217
3253
|
}
|
|
3218
3254
|
)
|
|
3219
3255
|
);
|
|
3220
|
-
|
|
3221
|
-
const
|
|
3256
|
+
fe.displayName = St.Root.displayName;
|
|
3257
|
+
const ya = () => /* @__PURE__ */ m("div", { className: "flex items-center justify-center gap-0.5", children: [
|
|
3222
3258
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
|
|
3223
3259
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
|
|
3224
3260
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
|
|
3225
|
-
] }),
|
|
3261
|
+
] }), _t = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__ */ m(
|
|
3226
3262
|
de.Root,
|
|
3227
3263
|
{
|
|
3228
|
-
ref:
|
|
3264
|
+
ref: n,
|
|
3229
3265
|
className: k("relative overflow-hidden", r),
|
|
3230
3266
|
...o,
|
|
3231
3267
|
children: [
|
|
3232
3268
|
/* @__PURE__ */ t(de.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
|
|
3233
|
-
/* @__PURE__ */ t(
|
|
3269
|
+
/* @__PURE__ */ t(jt, {}),
|
|
3234
3270
|
/* @__PURE__ */ t(de.Corner, {})
|
|
3235
3271
|
]
|
|
3236
3272
|
}
|
|
3237
3273
|
));
|
|
3238
|
-
|
|
3239
|
-
const
|
|
3274
|
+
_t.displayName = de.Root.displayName;
|
|
3275
|
+
const jt = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, n) => /* @__PURE__ */ t(
|
|
3240
3276
|
de.ScrollAreaScrollbar,
|
|
3241
3277
|
{
|
|
3242
|
-
ref:
|
|
3278
|
+
ref: n,
|
|
3243
3279
|
orientation: e,
|
|
3244
3280
|
className: k(
|
|
3245
3281
|
"flex touch-none select-none transition-colors",
|
|
@@ -3251,9 +3287,9 @@ const Ot = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, a)
|
|
|
3251
3287
|
children: /* @__PURE__ */ t(de.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
3252
3288
|
}
|
|
3253
3289
|
));
|
|
3254
|
-
|
|
3255
|
-
const
|
|
3256
|
-
|
|
3290
|
+
jt.displayName = de.ScrollAreaScrollbar.displayName;
|
|
3291
|
+
const va = oe.Portal, Xt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3292
|
+
oe.Overlay,
|
|
3257
3293
|
{
|
|
3258
3294
|
ref: o,
|
|
3259
3295
|
className: k(
|
|
@@ -3263,13 +3299,13 @@ const ha = te.Portal, Ft = q.forwardRef(({ className: r, ...e }, o) => /* @__PUR
|
|
|
3263
3299
|
...e
|
|
3264
3300
|
}
|
|
3265
3301
|
));
|
|
3266
|
-
|
|
3267
|
-
const
|
|
3268
|
-
/* @__PURE__ */ t(
|
|
3302
|
+
Xt.displayName = oe.Overlay.displayName;
|
|
3303
|
+
const ka = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__ */ m(va, { children: [
|
|
3304
|
+
/* @__PURE__ */ t(Xt, {}),
|
|
3269
3305
|
/* @__PURE__ */ m(
|
|
3270
|
-
|
|
3306
|
+
oe.Content,
|
|
3271
3307
|
{
|
|
3272
|
-
ref:
|
|
3308
|
+
ref: n,
|
|
3273
3309
|
className: k(
|
|
3274
3310
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
3275
3311
|
r
|
|
@@ -3277,17 +3313,17 @@ const ba = q.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__
|
|
|
3277
3313
|
...o,
|
|
3278
3314
|
children: [
|
|
3279
3315
|
e,
|
|
3280
|
-
/* @__PURE__ */ m(
|
|
3281
|
-
/* @__PURE__ */ t(
|
|
3316
|
+
/* @__PURE__ */ m(oe.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: [
|
|
3317
|
+
/* @__PURE__ */ t(cn, { className: "h-4 w-4" }),
|
|
3282
3318
|
/* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
|
|
3283
3319
|
] })
|
|
3284
3320
|
]
|
|
3285
3321
|
}
|
|
3286
3322
|
)
|
|
3287
3323
|
] }));
|
|
3288
|
-
|
|
3289
|
-
const
|
|
3290
|
-
|
|
3324
|
+
ka.displayName = oe.Content.displayName;
|
|
3325
|
+
const Ca = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3326
|
+
oe.Title,
|
|
3291
3327
|
{
|
|
3292
3328
|
ref: o,
|
|
3293
3329
|
className: k(
|
|
@@ -3297,17 +3333,17 @@ const xa = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3297
3333
|
...e
|
|
3298
3334
|
}
|
|
3299
3335
|
));
|
|
3300
|
-
|
|
3301
|
-
const
|
|
3302
|
-
|
|
3336
|
+
Ca.displayName = oe.Title.displayName;
|
|
3337
|
+
const wa = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3338
|
+
oe.Description,
|
|
3303
3339
|
{
|
|
3304
3340
|
ref: o,
|
|
3305
3341
|
className: k("text-sm text-muted-foreground", r),
|
|
3306
3342
|
...e
|
|
3307
3343
|
}
|
|
3308
3344
|
));
|
|
3309
|
-
|
|
3310
|
-
const
|
|
3345
|
+
wa.displayName = oe.Description.displayName;
|
|
3346
|
+
const Ut = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3311
3347
|
W,
|
|
3312
3348
|
{
|
|
3313
3349
|
ref: o,
|
|
@@ -3318,9 +3354,9 @@ const _t = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3318
3354
|
...e
|
|
3319
3355
|
}
|
|
3320
3356
|
));
|
|
3321
|
-
|
|
3322
|
-
const
|
|
3323
|
-
/* @__PURE__ */ t(
|
|
3357
|
+
Ut.displayName = W.displayName;
|
|
3358
|
+
const Gt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
|
|
3359
|
+
/* @__PURE__ */ t(Ge, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
|
|
3324
3360
|
/* @__PURE__ */ t(
|
|
3325
3361
|
W.Input,
|
|
3326
3362
|
{
|
|
@@ -3333,8 +3369,8 @@ const jt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div",
|
|
|
3333
3369
|
}
|
|
3334
3370
|
)
|
|
3335
3371
|
] }));
|
|
3336
|
-
|
|
3337
|
-
const
|
|
3372
|
+
Gt.displayName = W.Input.displayName;
|
|
3373
|
+
const Na = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3338
3374
|
W.List,
|
|
3339
3375
|
{
|
|
3340
3376
|
ref: o,
|
|
@@ -3342,8 +3378,8 @@ const va = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3342
3378
|
...e
|
|
3343
3379
|
}
|
|
3344
3380
|
));
|
|
3345
|
-
|
|
3346
|
-
const
|
|
3381
|
+
Na.displayName = W.List.displayName;
|
|
3382
|
+
const Ia = q.forwardRef((r, e) => /* @__PURE__ */ t(
|
|
3347
3383
|
W.Empty,
|
|
3348
3384
|
{
|
|
3349
3385
|
ref: e,
|
|
@@ -3351,8 +3387,8 @@ const ka = q.forwardRef((r, e) => /* @__PURE__ */ t(
|
|
|
3351
3387
|
...r
|
|
3352
3388
|
}
|
|
3353
3389
|
));
|
|
3354
|
-
|
|
3355
|
-
const
|
|
3390
|
+
Ia.displayName = W.Empty.displayName;
|
|
3391
|
+
const Ne = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3356
3392
|
W.Group,
|
|
3357
3393
|
{
|
|
3358
3394
|
ref: o,
|
|
@@ -3363,8 +3399,8 @@ const we = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3363
3399
|
...e
|
|
3364
3400
|
}
|
|
3365
3401
|
));
|
|
3366
|
-
|
|
3367
|
-
const
|
|
3402
|
+
Ne.displayName = W.Group.displayName;
|
|
3403
|
+
const Qe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3368
3404
|
W.Separator,
|
|
3369
3405
|
{
|
|
3370
3406
|
ref: o,
|
|
@@ -3372,8 +3408,8 @@ const We = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3372
3408
|
...e
|
|
3373
3409
|
}
|
|
3374
3410
|
));
|
|
3375
|
-
|
|
3376
|
-
const
|
|
3411
|
+
Qe.displayName = W.Separator.displayName;
|
|
3412
|
+
const he = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3377
3413
|
W.Item,
|
|
3378
3414
|
{
|
|
3379
3415
|
ref: o,
|
|
@@ -3384,95 +3420,95 @@ const fe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3384
3420
|
...e
|
|
3385
3421
|
}
|
|
3386
3422
|
));
|
|
3387
|
-
|
|
3388
|
-
const
|
|
3423
|
+
he.displayName = W.Item.displayName;
|
|
3424
|
+
const Sa = ({
|
|
3389
3425
|
completion: r,
|
|
3390
3426
|
onDiscard: e
|
|
3391
3427
|
}) => {
|
|
3392
3428
|
const { editor: o } = Q();
|
|
3393
3429
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3394
|
-
/* @__PURE__ */ m(
|
|
3430
|
+
/* @__PURE__ */ m(Ne, { children: [
|
|
3395
3431
|
/* @__PURE__ */ m(
|
|
3396
|
-
|
|
3432
|
+
he,
|
|
3397
3433
|
{
|
|
3398
3434
|
className: "gap-2 px-4",
|
|
3399
3435
|
value: "replace",
|
|
3400
3436
|
onSelect: () => {
|
|
3401
|
-
const
|
|
3437
|
+
const n = o.view.state.selection;
|
|
3402
3438
|
o.chain().focus().insertContentAt(
|
|
3403
3439
|
{
|
|
3404
|
-
from:
|
|
3405
|
-
to:
|
|
3440
|
+
from: n.from,
|
|
3441
|
+
to: n.to
|
|
3406
3442
|
},
|
|
3407
3443
|
r
|
|
3408
3444
|
).run();
|
|
3409
3445
|
},
|
|
3410
3446
|
children: [
|
|
3411
|
-
/* @__PURE__ */ t(
|
|
3447
|
+
/* @__PURE__ */ t(dn, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3412
3448
|
"替换选择"
|
|
3413
3449
|
]
|
|
3414
3450
|
}
|
|
3415
3451
|
),
|
|
3416
3452
|
/* @__PURE__ */ m(
|
|
3417
|
-
|
|
3453
|
+
he,
|
|
3418
3454
|
{
|
|
3419
3455
|
className: "gap-2 px-4",
|
|
3420
3456
|
value: "insert",
|
|
3421
3457
|
onSelect: () => {
|
|
3422
|
-
const
|
|
3423
|
-
o.chain().focus().insertContentAt(
|
|
3458
|
+
const n = o.view.state.selection;
|
|
3459
|
+
o.chain().focus().insertContentAt(n.to + 1, r).run();
|
|
3424
3460
|
},
|
|
3425
3461
|
children: [
|
|
3426
|
-
/* @__PURE__ */ t(
|
|
3462
|
+
/* @__PURE__ */ t(mn, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3427
3463
|
"在下面插入"
|
|
3428
3464
|
]
|
|
3429
3465
|
}
|
|
3430
3466
|
)
|
|
3431
3467
|
] }),
|
|
3432
|
-
/* @__PURE__ */ t(
|
|
3433
|
-
/* @__PURE__ */ t(
|
|
3434
|
-
/* @__PURE__ */ t(
|
|
3468
|
+
/* @__PURE__ */ t(Qe, {}),
|
|
3469
|
+
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ m(he, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
|
|
3470
|
+
/* @__PURE__ */ t(un, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3435
3471
|
"丢弃"
|
|
3436
3472
|
] }) })
|
|
3437
3473
|
] });
|
|
3438
|
-
},
|
|
3474
|
+
}, Ta = [
|
|
3439
3475
|
{
|
|
3440
3476
|
value: "improve",
|
|
3441
3477
|
label: "改进写作",
|
|
3442
3478
|
// Improve writing
|
|
3443
|
-
icon:
|
|
3479
|
+
icon: pn
|
|
3444
3480
|
},
|
|
3445
3481
|
{
|
|
3446
3482
|
value: "fix",
|
|
3447
3483
|
label: "修正语法",
|
|
3448
3484
|
// Fix grammar
|
|
3449
|
-
icon:
|
|
3485
|
+
icon: gn
|
|
3450
3486
|
},
|
|
3451
3487
|
{
|
|
3452
3488
|
value: "shorter",
|
|
3453
3489
|
label: "缩短文本",
|
|
3454
3490
|
// Make shorter
|
|
3455
|
-
icon:
|
|
3491
|
+
icon: fn
|
|
3456
3492
|
},
|
|
3457
3493
|
{
|
|
3458
3494
|
value: "longer",
|
|
3459
3495
|
label: "扩展文本",
|
|
3460
3496
|
// Make longer
|
|
3461
|
-
icon:
|
|
3497
|
+
icon: hn
|
|
3462
3498
|
}
|
|
3463
|
-
],
|
|
3499
|
+
], Ma = ({ onSelect: r }) => {
|
|
3464
3500
|
const { editor: e } = Q();
|
|
3465
3501
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3466
|
-
/* @__PURE__ */ m(
|
|
3502
|
+
/* @__PURE__ */ m(Ne, { heading: "编辑或校对选中文本", children: [
|
|
3467
3503
|
" ",
|
|
3468
|
-
|
|
3469
|
-
|
|
3504
|
+
Ta.map((o) => /* @__PURE__ */ m(
|
|
3505
|
+
he,
|
|
3470
3506
|
{
|
|
3471
|
-
onSelect: (
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3507
|
+
onSelect: (n) => {
|
|
3508
|
+
const a = e.state.selection.content(), s = e.storage.markdown.serializer.serialize(
|
|
3509
|
+
a.content
|
|
3474
3510
|
);
|
|
3475
|
-
r(s,
|
|
3511
|
+
r(s, n);
|
|
3476
3512
|
},
|
|
3477
3513
|
className: "flex gap-2 px-4",
|
|
3478
3514
|
value: o.value,
|
|
@@ -3484,20 +3520,20 @@ const Ca = ({
|
|
|
3484
3520
|
o.value
|
|
3485
3521
|
))
|
|
3486
3522
|
] }),
|
|
3487
|
-
/* @__PURE__ */ t(
|
|
3488
|
-
/* @__PURE__ */ m(
|
|
3523
|
+
/* @__PURE__ */ t(Qe, {}),
|
|
3524
|
+
/* @__PURE__ */ m(Ne, { heading: "使用 AI 完成更多", children: [
|
|
3489
3525
|
" ",
|
|
3490
3526
|
/* @__PURE__ */ m(
|
|
3491
|
-
|
|
3527
|
+
he,
|
|
3492
3528
|
{
|
|
3493
3529
|
onSelect: () => {
|
|
3494
|
-
const o = e.state.selection.from,
|
|
3495
|
-
r(
|
|
3530
|
+
const o = e.state.selection.from, n = Ar(e, o);
|
|
3531
|
+
r(n, "continue");
|
|
3496
3532
|
},
|
|
3497
3533
|
value: "continue",
|
|
3498
3534
|
className: "gap-2 px-4",
|
|
3499
3535
|
children: [
|
|
3500
|
-
/* @__PURE__ */ t(
|
|
3536
|
+
/* @__PURE__ */ t(bn, { className: "h-4 w-4 text-purple-500" }),
|
|
3501
3537
|
"继续写作"
|
|
3502
3538
|
]
|
|
3503
3539
|
}
|
|
@@ -3505,38 +3541,38 @@ const Ca = ({
|
|
|
3505
3541
|
] })
|
|
3506
3542
|
] });
|
|
3507
3543
|
};
|
|
3508
|
-
function
|
|
3509
|
-
const { editor: o } = Q(), [
|
|
3544
|
+
function La({ onOpenChange: r, options: e }) {
|
|
3545
|
+
const { editor: o } = Q(), [n, a] = j(""), { completion: s, complete: i, isLoading: d } = Nn({
|
|
3510
3546
|
// id: "novel",
|
|
3511
3547
|
api: "/api/generate",
|
|
3512
3548
|
onResponse: (x) => {
|
|
3513
3549
|
if (x.status === 429) {
|
|
3514
|
-
|
|
3550
|
+
we.error("You have reached your request limit for the day.");
|
|
3515
3551
|
return;
|
|
3516
3552
|
}
|
|
3517
3553
|
},
|
|
3518
3554
|
onError: (x) => {
|
|
3519
|
-
|
|
3555
|
+
we.error(x.message);
|
|
3520
3556
|
},
|
|
3521
3557
|
...e
|
|
3522
3558
|
}), p = s.length > 0;
|
|
3523
|
-
return /* @__PURE__ */ m(
|
|
3524
|
-
p && /* @__PURE__ */ t("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ t(
|
|
3559
|
+
return /* @__PURE__ */ m(Ut, { className: "w-[350px]", children: [
|
|
3560
|
+
p && /* @__PURE__ */ t("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ t(_t, { children: /* @__PURE__ */ t("div", { className: "prose p-2 px-4 prose-sm", children: /* @__PURE__ */ t(wt, { children: s }) }) }) }),
|
|
3525
3561
|
d && /* @__PURE__ */ m("div", { className: "flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-purple-500", children: [
|
|
3526
|
-
/* @__PURE__ */ t(
|
|
3562
|
+
/* @__PURE__ */ t(Ge, { size: 14, className: "mr-2 shrink-0" }),
|
|
3527
3563
|
"AI正在思考",
|
|
3528
|
-
/* @__PURE__ */ t("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ t(
|
|
3564
|
+
/* @__PURE__ */ t("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ t(ya, {}) })
|
|
3529
3565
|
] }),
|
|
3530
3566
|
!d && /* @__PURE__ */ m(ue, { children: [
|
|
3531
3567
|
/* @__PURE__ */ m("div", { className: "relative", children: [
|
|
3532
3568
|
/* @__PURE__ */ t(
|
|
3533
|
-
|
|
3569
|
+
Gt,
|
|
3534
3570
|
{
|
|
3535
|
-
value:
|
|
3536
|
-
onValueChange:
|
|
3571
|
+
value: n,
|
|
3572
|
+
onValueChange: a,
|
|
3537
3573
|
autoFocus: !0,
|
|
3538
3574
|
placeholder: p ? "告诉AI下一步该怎么做" : "要求AI编辑或生成……",
|
|
3539
|
-
onFocus: () =>
|
|
3575
|
+
onFocus: () => Dr(o)
|
|
3540
3576
|
}
|
|
3541
3577
|
),
|
|
3542
3578
|
/* @__PURE__ */ t(
|
|
@@ -3547,21 +3583,21 @@ function Ia({ onOpenChange: r, options: e }) {
|
|
|
3547
3583
|
onClick: () => {
|
|
3548
3584
|
if (s)
|
|
3549
3585
|
return i(s, {
|
|
3550
|
-
body: { option: "zap", command:
|
|
3551
|
-
}).then(() =>
|
|
3586
|
+
body: { option: "zap", command: n }
|
|
3587
|
+
}).then(() => a(""));
|
|
3552
3588
|
const x = o.state.selection.content(), l = o.storage.markdown.serializer.serialize(
|
|
3553
3589
|
x.content
|
|
3554
3590
|
);
|
|
3555
3591
|
i(l, {
|
|
3556
|
-
body: { option: "zap", command:
|
|
3557
|
-
}).then(() =>
|
|
3592
|
+
body: { option: "zap", command: n }
|
|
3593
|
+
}).then(() => a(""));
|
|
3558
3594
|
},
|
|
3559
|
-
children: /* @__PURE__ */ t(
|
|
3595
|
+
children: /* @__PURE__ */ t(xn, { className: "h-4 w-4" })
|
|
3560
3596
|
}
|
|
3561
3597
|
)
|
|
3562
3598
|
] }),
|
|
3563
3599
|
p ? /* @__PURE__ */ t(
|
|
3564
|
-
|
|
3600
|
+
Sa,
|
|
3565
3601
|
{
|
|
3566
3602
|
onDiscard: () => {
|
|
3567
3603
|
o.chain().unsetHighlight().focus().run(), r(!1);
|
|
@@ -3569,7 +3605,7 @@ function Ia({ onOpenChange: r, options: e }) {
|
|
|
3569
3605
|
completion: s
|
|
3570
3606
|
}
|
|
3571
3607
|
) : /* @__PURE__ */ t(
|
|
3572
|
-
|
|
3608
|
+
Ma,
|
|
3573
3609
|
{
|
|
3574
3610
|
onSelect: (x, l) => i(x, { body: { option: l } })
|
|
3575
3611
|
}
|
|
@@ -3577,18 +3613,18 @@ function Ia({ onOpenChange: r, options: e }) {
|
|
|
3577
3613
|
] })
|
|
3578
3614
|
] });
|
|
3579
3615
|
}
|
|
3580
|
-
const
|
|
3616
|
+
const Aa = ({
|
|
3581
3617
|
children: r,
|
|
3582
3618
|
open: e,
|
|
3583
3619
|
onOpenChange: o,
|
|
3584
|
-
enableAI:
|
|
3585
|
-
aiOptions:
|
|
3620
|
+
enableAI: n = !1,
|
|
3621
|
+
aiOptions: a
|
|
3586
3622
|
}) => {
|
|
3587
3623
|
const { editor: s } = Q();
|
|
3588
3624
|
return ae(() => {
|
|
3589
|
-
e ||
|
|
3625
|
+
e || Rr(s);
|
|
3590
3626
|
}, [e]), /* @__PURE__ */ m(
|
|
3591
|
-
|
|
3627
|
+
Pr,
|
|
3592
3628
|
{
|
|
3593
3629
|
tippyOptions: {
|
|
3594
3630
|
placement: e ? "bottom-start" : "top",
|
|
@@ -3598,16 +3634,16 @@ const Sa = ({
|
|
|
3598
3634
|
},
|
|
3599
3635
|
className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
|
|
3600
3636
|
children: [
|
|
3601
|
-
e &&
|
|
3602
|
-
|
|
3637
|
+
e && n && /* @__PURE__ */ t(
|
|
3638
|
+
La,
|
|
3603
3639
|
{
|
|
3604
3640
|
open: e,
|
|
3605
3641
|
onOpenChange: o,
|
|
3606
|
-
options:
|
|
3642
|
+
options: a
|
|
3607
3643
|
}
|
|
3608
3644
|
),
|
|
3609
|
-
!e && /* @__PURE__ */ m(
|
|
3610
|
-
|
|
3645
|
+
!e && /* @__PURE__ */ m(oo, { children: [
|
|
3646
|
+
n && /* @__PURE__ */ m(
|
|
3611
3647
|
Z,
|
|
3612
3648
|
{
|
|
3613
3649
|
className: "gap-1 text-purple-500",
|
|
@@ -3615,7 +3651,7 @@ const Sa = ({
|
|
|
3615
3651
|
onClick: () => o(!0),
|
|
3616
3652
|
size: "sm",
|
|
3617
3653
|
children: [
|
|
3618
|
-
/* @__PURE__ */ t(
|
|
3654
|
+
/* @__PURE__ */ t(Ge, { size: 14 }),
|
|
3619
3655
|
"询问AI"
|
|
3620
3656
|
]
|
|
3621
3657
|
}
|
|
@@ -3625,7 +3661,7 @@ const Sa = ({
|
|
|
3625
3661
|
]
|
|
3626
3662
|
}
|
|
3627
3663
|
);
|
|
3628
|
-
},
|
|
3664
|
+
}, Da = (r) => {
|
|
3629
3665
|
const e = fetch("/api/upload", {
|
|
3630
3666
|
method: "POST",
|
|
3631
3667
|
headers: {
|
|
@@ -3634,27 +3670,27 @@ const Sa = ({
|
|
|
3634
3670
|
},
|
|
3635
3671
|
body: r
|
|
3636
3672
|
});
|
|
3637
|
-
return new Promise((o,
|
|
3638
|
-
|
|
3639
|
-
e.then(async (
|
|
3640
|
-
if (
|
|
3641
|
-
const { url: s } = await
|
|
3673
|
+
return new Promise((o, n) => {
|
|
3674
|
+
we.promise(
|
|
3675
|
+
e.then(async (a) => {
|
|
3676
|
+
if (a.status === 200) {
|
|
3677
|
+
const { url: s } = await a.json(), i = new Image();
|
|
3642
3678
|
i.src = s, i.onload = () => {
|
|
3643
3679
|
o(s);
|
|
3644
3680
|
};
|
|
3645
|
-
} else throw
|
|
3681
|
+
} else throw a.status === 401 ? (o(r), new Error("`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead.")) : new Error("Error uploading image. Please try again.");
|
|
3646
3682
|
}),
|
|
3647
3683
|
{
|
|
3648
3684
|
loading: "Uploading image...",
|
|
3649
3685
|
success: "Image uploaded successfully.",
|
|
3650
|
-
error: (
|
|
3686
|
+
error: (a) => (n(a), a.message)
|
|
3651
3687
|
}
|
|
3652
3688
|
);
|
|
3653
3689
|
});
|
|
3654
|
-
},
|
|
3655
|
-
onUpload:
|
|
3656
|
-
validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (
|
|
3657
|
-
}),
|
|
3690
|
+
}, Ra = Nt({
|
|
3691
|
+
onUpload: Da,
|
|
3692
|
+
validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (we.error("File size too big (max 20MB)."), !1) : !0 : (we.error("File type not supported."), !1)
|
|
3693
|
+
}), Pa = () => {
|
|
3658
3694
|
const { editor: r } = Q();
|
|
3659
3695
|
return r ? /* @__PURE__ */ t("div", { className: "flex", children: [
|
|
3660
3696
|
{
|
|
@@ -3662,41 +3698,41 @@ const Sa = ({
|
|
|
3662
3698
|
// bold
|
|
3663
3699
|
isActive: (o) => o.isActive("bold"),
|
|
3664
3700
|
command: (o) => o.chain().focus().toggleBold().run(),
|
|
3665
|
-
icon:
|
|
3701
|
+
icon: yn
|
|
3666
3702
|
},
|
|
3667
3703
|
{
|
|
3668
3704
|
name: "斜体",
|
|
3669
3705
|
// italic
|
|
3670
3706
|
isActive: (o) => o.isActive("italic"),
|
|
3671
3707
|
command: (o) => o.chain().focus().toggleItalic().run(),
|
|
3672
|
-
icon:
|
|
3708
|
+
icon: vn
|
|
3673
3709
|
},
|
|
3674
3710
|
{
|
|
3675
3711
|
name: "下划线",
|
|
3676
3712
|
// underline
|
|
3677
3713
|
isActive: (o) => o.isActive("underline"),
|
|
3678
3714
|
command: (o) => o.chain().focus().toggleUnderline().run(),
|
|
3679
|
-
icon:
|
|
3715
|
+
icon: kn
|
|
3680
3716
|
},
|
|
3681
3717
|
{
|
|
3682
3718
|
name: "删除线",
|
|
3683
3719
|
// strike
|
|
3684
3720
|
isActive: (o) => o.isActive("strike"),
|
|
3685
3721
|
command: (o) => o.chain().focus().toggleStrike().run(),
|
|
3686
|
-
icon:
|
|
3722
|
+
icon: Cn
|
|
3687
3723
|
},
|
|
3688
3724
|
{
|
|
3689
3725
|
name: "代码",
|
|
3690
3726
|
// code
|
|
3691
3727
|
isActive: (o) => o.isActive("code"),
|
|
3692
3728
|
command: (o) => o.chain().focus().toggleCode().run(),
|
|
3693
|
-
icon:
|
|
3729
|
+
icon: wn
|
|
3694
3730
|
}
|
|
3695
3731
|
].map((o) => /* @__PURE__ */ t(
|
|
3696
|
-
|
|
3732
|
+
Pe,
|
|
3697
3733
|
{
|
|
3698
|
-
onSelect: (
|
|
3699
|
-
o.command(
|
|
3734
|
+
onSelect: (n) => {
|
|
3735
|
+
o.command(n);
|
|
3700
3736
|
},
|
|
3701
3737
|
children: /* @__PURE__ */ t(me, { overlay: o.name, placement: "top", children: /* @__PURE__ */ t(
|
|
3702
3738
|
Z,
|
|
@@ -3718,14 +3754,14 @@ const Sa = ({
|
|
|
3718
3754
|
},
|
|
3719
3755
|
o.name
|
|
3720
3756
|
)) }) : null;
|
|
3721
|
-
},
|
|
3757
|
+
}, qt = ({ uploadFn: r }) => zr([
|
|
3722
3758
|
{
|
|
3723
3759
|
title: "文本",
|
|
3724
3760
|
// "Text",
|
|
3725
3761
|
description: "从纯文本开始编写。",
|
|
3726
3762
|
// "Just start typing with plain text.",
|
|
3727
3763
|
searchTerms: ["p", "paragraph"],
|
|
3728
|
-
icon: /* @__PURE__ */ t(
|
|
3764
|
+
icon: /* @__PURE__ */ t(pt, { size: 18 }),
|
|
3729
3765
|
command: ({ editor: e, range: o }) => {
|
|
3730
3766
|
e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").run();
|
|
3731
3767
|
}
|
|
@@ -3736,7 +3772,7 @@ const Sa = ({
|
|
|
3736
3772
|
description: "大标题。",
|
|
3737
3773
|
// "Big section heading.",
|
|
3738
3774
|
searchTerms: ["title", "big", "large"],
|
|
3739
|
-
icon: /* @__PURE__ */ t(
|
|
3775
|
+
icon: /* @__PURE__ */ t(gt, { size: 18 }),
|
|
3740
3776
|
command: ({ editor: e, range: o }) => {
|
|
3741
3777
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 1 }).run();
|
|
3742
3778
|
}
|
|
@@ -3747,7 +3783,7 @@ const Sa = ({
|
|
|
3747
3783
|
description: "中标题。",
|
|
3748
3784
|
// "Medium section heading.",
|
|
3749
3785
|
searchTerms: ["subtitle", "medium"],
|
|
3750
|
-
icon: /* @__PURE__ */ t(
|
|
3786
|
+
icon: /* @__PURE__ */ t(ft, { size: 18 }),
|
|
3751
3787
|
command: ({ editor: e, range: o }) => {
|
|
3752
3788
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 2 }).run();
|
|
3753
3789
|
}
|
|
@@ -3758,7 +3794,7 @@ const Sa = ({
|
|
|
3758
3794
|
description: "小标题。",
|
|
3759
3795
|
// "Small section heading.",
|
|
3760
3796
|
searchTerms: ["subtitle", "small"],
|
|
3761
|
-
icon: /* @__PURE__ */ t(
|
|
3797
|
+
icon: /* @__PURE__ */ t(ht, { size: 18 }),
|
|
3762
3798
|
command: ({ editor: e, range: o }) => {
|
|
3763
3799
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 3 }).run();
|
|
3764
3800
|
}
|
|
@@ -3769,7 +3805,7 @@ const Sa = ({
|
|
|
3769
3805
|
description: "使用待办清单追踪任务。",
|
|
3770
3806
|
// "Track tasks with a to-do list.",
|
|
3771
3807
|
searchTerms: ["todo", "task", "list", "check", "checkbox"],
|
|
3772
|
-
icon: /* @__PURE__ */ t(
|
|
3808
|
+
icon: /* @__PURE__ */ t(bt, { size: 18 }),
|
|
3773
3809
|
command: ({ editor: e, range: o }) => {
|
|
3774
3810
|
e.chain().focus().deleteRange(o).toggleTaskList().run();
|
|
3775
3811
|
}
|
|
@@ -3780,7 +3816,7 @@ const Sa = ({
|
|
|
3780
3816
|
description: "创建一个简单的项目符号列表。",
|
|
3781
3817
|
// "Create a simple bullet list.",
|
|
3782
3818
|
searchTerms: ["unordered", "point"],
|
|
3783
|
-
icon: /* @__PURE__ */ t(
|
|
3819
|
+
icon: /* @__PURE__ */ t(xt, { size: 18 }),
|
|
3784
3820
|
command: ({ editor: e, range: o }) => {
|
|
3785
3821
|
e.chain().focus().deleteRange(o).toggleBulletList().run();
|
|
3786
3822
|
}
|
|
@@ -3791,7 +3827,7 @@ const Sa = ({
|
|
|
3791
3827
|
description: "创建一个带有序号的列表。",
|
|
3792
3828
|
// "Create a list with numbering.",
|
|
3793
3829
|
searchTerms: ["ordered"],
|
|
3794
|
-
icon: /* @__PURE__ */ t(
|
|
3830
|
+
icon: /* @__PURE__ */ t(yt, { size: 18 }),
|
|
3795
3831
|
command: ({ editor: e, range: o }) => {
|
|
3796
3832
|
e.chain().focus().deleteRange(o).toggleOrderedList().run();
|
|
3797
3833
|
}
|
|
@@ -3802,7 +3838,7 @@ const Sa = ({
|
|
|
3802
3838
|
description: "摘取引用。",
|
|
3803
3839
|
// "Capture a quote.",
|
|
3804
3840
|
searchTerms: ["blockquote"],
|
|
3805
|
-
icon: /* @__PURE__ */ t(
|
|
3841
|
+
icon: /* @__PURE__ */ t(vt, { size: 18 }),
|
|
3806
3842
|
command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").toggleBlockquote().run()
|
|
3807
3843
|
},
|
|
3808
3844
|
{
|
|
@@ -3811,7 +3847,7 @@ const Sa = ({
|
|
|
3811
3847
|
description: "捕获代码段。",
|
|
3812
3848
|
// "Capture a code snippet.",
|
|
3813
3849
|
searchTerms: ["codeblock"],
|
|
3814
|
-
icon: /* @__PURE__ */ t(
|
|
3850
|
+
icon: /* @__PURE__ */ t(kt, { size: 18 }),
|
|
3815
3851
|
command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleCodeBlock().run()
|
|
3816
3852
|
},
|
|
3817
3853
|
{
|
|
@@ -3820,37 +3856,37 @@ const Sa = ({
|
|
|
3820
3856
|
description: "从您的计算机上传图像。",
|
|
3821
3857
|
// "Upload an image from your computer.",
|
|
3822
3858
|
searchTerms: ["photo", "picture", "media"],
|
|
3823
|
-
icon: /* @__PURE__ */ t(
|
|
3859
|
+
icon: /* @__PURE__ */ t(Co, { size: 18 }),
|
|
3824
3860
|
command: ({ editor: e, range: o }) => {
|
|
3825
3861
|
e.chain().focus().deleteRange(o).run();
|
|
3826
|
-
const
|
|
3827
|
-
|
|
3828
|
-
var
|
|
3829
|
-
if ((
|
|
3830
|
-
const s =
|
|
3862
|
+
const n = document.createElement("input");
|
|
3863
|
+
n.type = "file", n.accept = "image/*", n.onchange = async () => {
|
|
3864
|
+
var a;
|
|
3865
|
+
if ((a = n.files) != null && a.length) {
|
|
3866
|
+
const s = n.files[0], i = e.view.state.selection.from;
|
|
3831
3867
|
r(s, e.view, i);
|
|
3832
3868
|
}
|
|
3833
|
-
},
|
|
3869
|
+
}, n.click();
|
|
3834
3870
|
}
|
|
3835
3871
|
}
|
|
3836
|
-
]),
|
|
3872
|
+
]), Ba = (r) => Br.configure({
|
|
3837
3873
|
suggestion: {
|
|
3838
|
-
items: () =>
|
|
3839
|
-
render:
|
|
3874
|
+
items: () => qt(r),
|
|
3875
|
+
render: Er
|
|
3840
3876
|
}
|
|
3841
|
-
}),
|
|
3877
|
+
}), za = {
|
|
3842
3878
|
type: "doc",
|
|
3843
3879
|
content: []
|
|
3844
|
-
},
|
|
3845
|
-
const
|
|
3846
|
-
|
|
3880
|
+
}, Yt = lt(({ children: r, items: e, ...o }, n) => {
|
|
3881
|
+
const a = (i) => /* @__PURE__ */ m(
|
|
3882
|
+
De.Item,
|
|
3847
3883
|
{
|
|
3848
3884
|
onClick: i.onClick,
|
|
3849
3885
|
className: k(
|
|
3850
3886
|
"gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3851
3887
|
i.className
|
|
3852
3888
|
),
|
|
3853
|
-
itemIcon: i.isActive ? /* @__PURE__ */ t(
|
|
3889
|
+
itemIcon: i.isActive ? /* @__PURE__ */ t(ke, { size: 16 }) : void 0,
|
|
3854
3890
|
children: [
|
|
3855
3891
|
i.icon,
|
|
3856
3892
|
i.label,
|
|
@@ -3861,9 +3897,9 @@ const Sa = ({
|
|
|
3861
3897
|
), s = (i) => {
|
|
3862
3898
|
var d;
|
|
3863
3899
|
return /* @__PURE__ */ t(
|
|
3864
|
-
|
|
3900
|
+
De.SubMenu,
|
|
3865
3901
|
{
|
|
3866
|
-
expandIcon: /* @__PURE__ */ t(
|
|
3902
|
+
expandIcon: /* @__PURE__ */ t(wo, { size: 16 }),
|
|
3867
3903
|
popupClassName: k(
|
|
3868
3904
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
|
|
3869
3905
|
b`
|
|
@@ -3895,18 +3931,18 @@ const Sa = ({
|
|
|
3895
3931
|
i.label,
|
|
3896
3932
|
/* @__PURE__ */ t("div", { className: "flex-1" })
|
|
3897
3933
|
] }),
|
|
3898
|
-
children: (d = i.children) == null ? void 0 : d.map(
|
|
3934
|
+
children: (d = i.children) == null ? void 0 : d.map(a)
|
|
3899
3935
|
},
|
|
3900
3936
|
i.key
|
|
3901
3937
|
);
|
|
3902
3938
|
};
|
|
3903
3939
|
return /* @__PURE__ */ t(
|
|
3904
|
-
|
|
3940
|
+
Sn,
|
|
3905
3941
|
{
|
|
3906
|
-
ref:
|
|
3942
|
+
ref: n,
|
|
3907
3943
|
trigger: "click",
|
|
3908
3944
|
overlay: /* @__PURE__ */ t(
|
|
3909
|
-
|
|
3945
|
+
De,
|
|
3910
3946
|
{
|
|
3911
3947
|
className: k(
|
|
3912
3948
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
|
|
@@ -3919,7 +3955,7 @@ const Sa = ({
|
|
|
3919
3955
|
`
|
|
3920
3956
|
),
|
|
3921
3957
|
...o,
|
|
3922
|
-
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(
|
|
3958
|
+
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(De.Divider, { className: "!my-1" }, i.key) : i.type === "submenu" ? s(i) : a(i))
|
|
3923
3959
|
}
|
|
3924
3960
|
),
|
|
3925
3961
|
...o,
|
|
@@ -3927,11 +3963,11 @@ const Sa = ({
|
|
|
3927
3963
|
}
|
|
3928
3964
|
);
|
|
3929
3965
|
});
|
|
3930
|
-
|
|
3931
|
-
const
|
|
3932
|
-
const { editor: o } = Q(),
|
|
3966
|
+
Yt.displayName = "DropdownMenu";
|
|
3967
|
+
const Ea = ({ children: r, ...e }) => {
|
|
3968
|
+
const { editor: o } = Q(), n = () => {
|
|
3933
3969
|
o && o.state.selection instanceof J && (o.commands.deleteSelection(), o.commands.focus());
|
|
3934
|
-
},
|
|
3970
|
+
}, a = () => {
|
|
3935
3971
|
if (o && o.state.selection instanceof J) {
|
|
3936
3972
|
const d = o.state.selection.node, p = o.state.selection.to;
|
|
3937
3973
|
o.chain().insertContentAt(p, {
|
|
@@ -3940,7 +3976,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
3940
3976
|
content: d.content.toJSON()
|
|
3941
3977
|
}).focus().run();
|
|
3942
3978
|
}
|
|
3943
|
-
}, s =
|
|
3979
|
+
}, s = je.map((d) => ({
|
|
3944
3980
|
key: `transform-${d.name}`,
|
|
3945
3981
|
icon: /* @__PURE__ */ t(d.icon, { size: 16 }),
|
|
3946
3982
|
label: d.name,
|
|
@@ -3949,35 +3985,35 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
3949
3985
|
},
|
|
3950
3986
|
isActive: d.isActive(o)
|
|
3951
3987
|
}));
|
|
3952
|
-
return /* @__PURE__ */ t(
|
|
3988
|
+
return /* @__PURE__ */ t(Yt, { items: [
|
|
3953
3989
|
{
|
|
3954
3990
|
key: "transform",
|
|
3955
3991
|
type: "submenu",
|
|
3956
|
-
icon: /* @__PURE__ */ t(
|
|
3992
|
+
icon: /* @__PURE__ */ t(No, { size: 16 }),
|
|
3957
3993
|
label: "转换成",
|
|
3958
3994
|
children: s
|
|
3959
3995
|
},
|
|
3960
3996
|
{
|
|
3961
3997
|
key: "duplicate",
|
|
3962
|
-
icon: /* @__PURE__ */ t(
|
|
3998
|
+
icon: /* @__PURE__ */ t(Io, { size: 16 }),
|
|
3963
3999
|
label: "创建副本",
|
|
3964
|
-
onClick:
|
|
4000
|
+
onClick: a
|
|
3965
4001
|
},
|
|
3966
4002
|
{ key: "divider", type: "divider" },
|
|
3967
4003
|
{
|
|
3968
4004
|
key: "delete",
|
|
3969
|
-
icon: /* @__PURE__ */ t(
|
|
4005
|
+
icon: /* @__PURE__ */ t(ut, { size: 16 }),
|
|
3970
4006
|
label: "删除",
|
|
3971
4007
|
className: "text-red-500",
|
|
3972
|
-
onClick:
|
|
4008
|
+
onClick: n
|
|
3973
4009
|
}
|
|
3974
4010
|
], ...e, children: r });
|
|
3975
|
-
},
|
|
4011
|
+
}, $a = () => {
|
|
3976
4012
|
const { editor: r } = Q(), e = (o) => {
|
|
3977
4013
|
if (!r) return;
|
|
3978
|
-
const
|
|
3979
|
-
if (!
|
|
3980
|
-
const
|
|
4014
|
+
const n = o.target.closest(".custom-drag-handle");
|
|
4015
|
+
if (!n) return;
|
|
4016
|
+
const a = n.dataset.nodePos, s = a !== void 0 ? parseInt(n.dataset.nodePos || "0", 10) : a;
|
|
3981
4017
|
s !== void 0 && (r.commands.focus(), r.commands.setNodeSelection(s), r.commands.createParagraphNear() ? r.commands.insertContent("/") : r.chain().insertContentAt(s, {
|
|
3982
4018
|
type: "paragraph",
|
|
3983
4019
|
content: [{ type: "text", text: "/" }]
|
|
@@ -4011,12 +4047,12 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4011
4047
|
variant: "ghost",
|
|
4012
4048
|
className: "w-auto h-auto p-0.5",
|
|
4013
4049
|
onClick: e,
|
|
4014
|
-
children: /* @__PURE__ */ t(
|
|
4050
|
+
children: /* @__PURE__ */ t(So, { className: "cursor-pointer", size: 22 })
|
|
4015
4051
|
}
|
|
4016
4052
|
)
|
|
4017
4053
|
}
|
|
4018
4054
|
),
|
|
4019
|
-
/* @__PURE__ */ t(
|
|
4055
|
+
/* @__PURE__ */ t(Ea, { children: /* @__PURE__ */ t(
|
|
4020
4056
|
me,
|
|
4021
4057
|
{
|
|
4022
4058
|
placement: "bottom",
|
|
@@ -4024,18 +4060,18 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4024
4060
|
"拖动",
|
|
4025
4061
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以移动" })
|
|
4026
4062
|
] }) }),
|
|
4027
|
-
children: /* @__PURE__ */ t(Z, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(
|
|
4063
|
+
children: /* @__PURE__ */ t(Z, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(To, { size: 22 }) })
|
|
4028
4064
|
}
|
|
4029
4065
|
) })
|
|
4030
4066
|
]
|
|
4031
4067
|
}
|
|
4032
4068
|
);
|
|
4033
|
-
},
|
|
4069
|
+
}, Ha = (r) => {
|
|
4034
4070
|
const {
|
|
4035
4071
|
className: e,
|
|
4036
4072
|
initialContent: o = {},
|
|
4037
|
-
onChange:
|
|
4038
|
-
cacheKey:
|
|
4073
|
+
onChange: n,
|
|
4074
|
+
cacheKey: a = "novel-content",
|
|
4039
4075
|
enableCache: s = !1,
|
|
4040
4076
|
showSaveStatus: i = !0,
|
|
4041
4077
|
showWordCount: d = !0,
|
|
@@ -4043,79 +4079,79 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4043
4079
|
editorRef: x,
|
|
4044
4080
|
enableAI: l = !1,
|
|
4045
4081
|
aiOptions: c
|
|
4046
|
-
} = r, [
|
|
4082
|
+
} = r, [f, v] = j(
|
|
4047
4083
|
o
|
|
4048
|
-
), [D, h] =
|
|
4049
|
-
const
|
|
4050
|
-
return
|
|
4051
|
-
|
|
4052
|
-
}), new XMLSerializer().serializeToString(
|
|
4053
|
-
},
|
|
4054
|
-
async (
|
|
4055
|
-
const
|
|
4056
|
-
|
|
4084
|
+
), [D, h] = j("Saved"), [g, S] = j(), [y, N] = j(!1), [u, T] = j(!1), [A, I] = j(!1), [C, H] = j(!1), G = (L) => {
|
|
4085
|
+
const X = new DOMParser().parseFromString(L, "text/html");
|
|
4086
|
+
return X.querySelectorAll("pre code").forEach((E) => {
|
|
4087
|
+
In.highlightElement(E);
|
|
4088
|
+
}), new XMLSerializer().serializeToString(X);
|
|
4089
|
+
}, O = Yr(
|
|
4090
|
+
async (L) => {
|
|
4091
|
+
const X = L.getJSON();
|
|
4092
|
+
S(L.storage.characterCount.words()), n == null || n(X), s && (window.localStorage.setItem(
|
|
4057
4093
|
"html-content",
|
|
4058
|
-
|
|
4059
|
-
), window.localStorage.setItem(
|
|
4094
|
+
G(L.getHTML())
|
|
4095
|
+
), window.localStorage.setItem(a, JSON.stringify(X)), window.localStorage.setItem(
|
|
4060
4096
|
"markdown",
|
|
4061
|
-
|
|
4097
|
+
L.storage.markdown.getMarkdown()
|
|
4062
4098
|
), h("Saved"));
|
|
4063
4099
|
},
|
|
4064
4100
|
500
|
|
4065
|
-
), se =
|
|
4066
|
-
if (!p) return
|
|
4101
|
+
), se = be(() => {
|
|
4102
|
+
if (!p) return Ra;
|
|
4067
4103
|
const {
|
|
4068
|
-
beforeUpload:
|
|
4069
|
-
maxSize:
|
|
4070
|
-
action:
|
|
4104
|
+
beforeUpload: L,
|
|
4105
|
+
maxSize: X,
|
|
4106
|
+
action: E,
|
|
4071
4107
|
headers: K,
|
|
4072
|
-
method:
|
|
4073
|
-
name:
|
|
4074
|
-
onSuccess:
|
|
4075
|
-
onError:
|
|
4108
|
+
method: ee,
|
|
4109
|
+
name: $e,
|
|
4110
|
+
onSuccess: Se,
|
|
4111
|
+
onError: Te
|
|
4076
4112
|
} = p;
|
|
4077
|
-
return
|
|
4113
|
+
return Nt({
|
|
4078
4114
|
onUpload: (ie) => {
|
|
4079
|
-
const
|
|
4080
|
-
|
|
4081
|
-
const
|
|
4082
|
-
method:
|
|
4115
|
+
const Me = new FormData();
|
|
4116
|
+
Me.append($e || "file", ie);
|
|
4117
|
+
const He = fetch(E, {
|
|
4118
|
+
method: ee || "POST",
|
|
4083
4119
|
headers: {
|
|
4084
4120
|
...K
|
|
4085
4121
|
},
|
|
4086
|
-
body:
|
|
4122
|
+
body: Me
|
|
4087
4123
|
});
|
|
4088
|
-
return new Promise((
|
|
4089
|
-
|
|
4090
|
-
if (
|
|
4091
|
-
const z = await
|
|
4092
|
-
|
|
4124
|
+
return new Promise((ye, w) => {
|
|
4125
|
+
He.then(async (B) => {
|
|
4126
|
+
if (Se) {
|
|
4127
|
+
const z = await B.json();
|
|
4128
|
+
ye(Se(z));
|
|
4093
4129
|
return;
|
|
4094
4130
|
}
|
|
4095
|
-
if (
|
|
4096
|
-
const { url: z } = await
|
|
4097
|
-
|
|
4098
|
-
|
|
4131
|
+
if (B.status === 200) {
|
|
4132
|
+
const { url: z } = await B.json(), M = new Image();
|
|
4133
|
+
M.src = z, M.onload = () => {
|
|
4134
|
+
ye(z);
|
|
4099
4135
|
};
|
|
4100
|
-
} else throw
|
|
4136
|
+
} else throw B.status === 401 ? (ye(ie), new Error(
|
|
4101
4137
|
"`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead."
|
|
4102
4138
|
)) : new Error("Error uploading image. Please try again.");
|
|
4103
|
-
}).catch((
|
|
4104
|
-
|
|
4139
|
+
}).catch((B) => {
|
|
4140
|
+
Te && Te(B), w(B);
|
|
4105
4141
|
});
|
|
4106
4142
|
});
|
|
4107
4143
|
},
|
|
4108
|
-
validateFn: (ie) =>
|
|
4144
|
+
validateFn: (ie) => L ? L(ie) : ie.type.includes("image/") ? X && ie.size > X ? (console.error("File size too big (max 20MB)."), !1) : !0 : (console.error("File type not supported."), !1)
|
|
4109
4145
|
});
|
|
4110
4146
|
}, [p]);
|
|
4111
4147
|
if (ae(() => {
|
|
4112
4148
|
if (!s) return;
|
|
4113
|
-
const
|
|
4114
|
-
v(
|
|
4115
|
-
}, [
|
|
4116
|
-
const
|
|
4117
|
-
...
|
|
4118
|
-
|
|
4149
|
+
const L = window.localStorage.getItem(a);
|
|
4150
|
+
v(L ? JSON.parse(L) : za);
|
|
4151
|
+
}, [a, s]), !f) return null;
|
|
4152
|
+
const re = [
|
|
4153
|
+
...Ot,
|
|
4154
|
+
Ba({
|
|
4119
4155
|
uploadFn: se
|
|
4120
4156
|
})
|
|
4121
4157
|
];
|
|
@@ -4125,131 +4161,131 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4125
4161
|
d && /* @__PURE__ */ m(
|
|
4126
4162
|
"div",
|
|
4127
4163
|
{
|
|
4128
|
-
className:
|
|
4164
|
+
className: g ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
|
|
4129
4165
|
children: [
|
|
4130
|
-
|
|
4166
|
+
g,
|
|
4131
4167
|
" Words"
|
|
4132
4168
|
]
|
|
4133
4169
|
}
|
|
4134
4170
|
)
|
|
4135
4171
|
] }),
|
|
4136
|
-
/* @__PURE__ */ t(
|
|
4137
|
-
|
|
4172
|
+
/* @__PURE__ */ t($r, { children: /* @__PURE__ */ m(
|
|
4173
|
+
Hr,
|
|
4138
4174
|
{
|
|
4139
|
-
onCreate: ({ editor:
|
|
4140
|
-
x && (x.current =
|
|
4175
|
+
onCreate: ({ editor: L }) => {
|
|
4176
|
+
x && (x.current = L);
|
|
4141
4177
|
},
|
|
4142
|
-
initialContent:
|
|
4143
|
-
extensions:
|
|
4178
|
+
initialContent: f,
|
|
4179
|
+
extensions: re,
|
|
4144
4180
|
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",
|
|
4145
4181
|
editorProps: {
|
|
4146
4182
|
handleDOMEvents: {
|
|
4147
|
-
keydown: (
|
|
4183
|
+
keydown: (L, X) => _r(X)
|
|
4148
4184
|
},
|
|
4149
|
-
handlePaste: (
|
|
4150
|
-
handleDrop: (
|
|
4185
|
+
handlePaste: (L, X) => Fr(L, X, se),
|
|
4186
|
+
handleDrop: (L, X, E, K) => Or(L, X, K, se),
|
|
4151
4187
|
attributes: {
|
|
4152
4188
|
class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
|
|
4153
4189
|
}
|
|
4154
4190
|
},
|
|
4155
|
-
onUpdate: ({ editor:
|
|
4156
|
-
|
|
4191
|
+
onUpdate: ({ editor: L }) => {
|
|
4192
|
+
O(L), h("Unsaved");
|
|
4157
4193
|
},
|
|
4158
|
-
slotAfter: /* @__PURE__ */ t(
|
|
4194
|
+
slotAfter: /* @__PURE__ */ t(qr, {}),
|
|
4159
4195
|
children: [
|
|
4160
|
-
/* @__PURE__ */ m(
|
|
4161
|
-
/* @__PURE__ */ t(
|
|
4162
|
-
/* @__PURE__ */ t(
|
|
4196
|
+
/* @__PURE__ */ m(jr, { 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: [
|
|
4197
|
+
/* @__PURE__ */ t(Xr, { className: "px-2 text-muted-foreground", children: "没有结果" }),
|
|
4198
|
+
/* @__PURE__ */ t(Ur, { children: qt({
|
|
4163
4199
|
uploadFn: se
|
|
4164
|
-
}).map((
|
|
4165
|
-
|
|
4200
|
+
}).map((L) => /* @__PURE__ */ m(
|
|
4201
|
+
Gr,
|
|
4166
4202
|
{
|
|
4167
|
-
value:
|
|
4168
|
-
onCommand: (
|
|
4203
|
+
value: L.title,
|
|
4204
|
+
onCommand: (X) => L.command(X),
|
|
4169
4205
|
className: "flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm hover:bg-accent aria-selected:bg-accent",
|
|
4170
4206
|
children: [
|
|
4171
|
-
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children:
|
|
4207
|
+
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children: L.icon }),
|
|
4172
4208
|
/* @__PURE__ */ m("div", { children: [
|
|
4173
|
-
/* @__PURE__ */ t("p", { className: "font-medium", children:
|
|
4174
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children:
|
|
4209
|
+
/* @__PURE__ */ t("p", { className: "font-medium", children: L.title }),
|
|
4210
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: L.description })
|
|
4175
4211
|
] })
|
|
4176
4212
|
]
|
|
4177
4213
|
},
|
|
4178
|
-
|
|
4214
|
+
L.title
|
|
4179
4215
|
)) })
|
|
4180
4216
|
] }),
|
|
4181
4217
|
/* @__PURE__ */ m(
|
|
4182
|
-
|
|
4218
|
+
Aa,
|
|
4183
4219
|
{
|
|
4184
4220
|
open: C,
|
|
4185
|
-
onOpenChange:
|
|
4221
|
+
onOpenChange: H,
|
|
4186
4222
|
enableAI: l,
|
|
4187
4223
|
aiOptions: c,
|
|
4188
4224
|
children: [
|
|
4189
|
-
l && /* @__PURE__ */ t(
|
|
4190
|
-
/* @__PURE__ */ t(
|
|
4191
|
-
/* @__PURE__ */ t(
|
|
4192
|
-
/* @__PURE__ */ t(
|
|
4193
|
-
/* @__PURE__ */ t(
|
|
4194
|
-
/* @__PURE__ */ t(
|
|
4195
|
-
/* @__PURE__ */ t(
|
|
4196
|
-
/* @__PURE__ */ t(
|
|
4197
|
-
/* @__PURE__ */ t(
|
|
4198
|
-
/* @__PURE__ */ t(
|
|
4225
|
+
l && /* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4226
|
+
/* @__PURE__ */ t(xa, { open: y, onOpenChange: N }),
|
|
4227
|
+
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4228
|
+
/* @__PURE__ */ t(ha, { open: A, onOpenChange: I }),
|
|
4229
|
+
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4230
|
+
/* @__PURE__ */ t(ba, {}),
|
|
4231
|
+
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4232
|
+
/* @__PURE__ */ t(Pa, {}),
|
|
4233
|
+
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4234
|
+
/* @__PURE__ */ t(pa, { open: u, onOpenChange: T })
|
|
4199
4235
|
]
|
|
4200
4236
|
}
|
|
4201
4237
|
),
|
|
4202
|
-
/* @__PURE__ */ t(
|
|
4238
|
+
/* @__PURE__ */ t($a, {})
|
|
4203
4239
|
]
|
|
4204
4240
|
}
|
|
4205
4241
|
) })
|
|
4206
4242
|
] });
|
|
4207
|
-
},
|
|
4208
|
-
const e =
|
|
4243
|
+
}, Oa = ({ json: r }) => {
|
|
4244
|
+
const e = be(() => Tn(r ?? {}, Ot), [r]);
|
|
4209
4245
|
return /* @__PURE__ */ t("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e } }) });
|
|
4210
|
-
},
|
|
4211
|
-
|
|
4212
|
-
const
|
|
4246
|
+
}, Vt = Ha;
|
|
4247
|
+
Vt.Preview = Oa;
|
|
4248
|
+
const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4213
4249
|
__proto__: null,
|
|
4214
|
-
Desktop:
|
|
4215
|
-
DesktopSortable:
|
|
4216
|
-
DesktopSortableConfigProvider:
|
|
4217
|
-
DesktopSortableStateProvider:
|
|
4218
|
-
Dock:
|
|
4219
|
-
DockDesktop:
|
|
4220
|
-
DockDesktopItem:
|
|
4221
|
-
DockMobile:
|
|
4222
|
-
DockMobileItem:
|
|
4223
|
-
Editor:
|
|
4224
|
-
Markdown:
|
|
4225
|
-
MdEditor:
|
|
4250
|
+
Desktop: Hn,
|
|
4251
|
+
DesktopSortable: Pt,
|
|
4252
|
+
DesktopSortableConfigProvider: Mt,
|
|
4253
|
+
DesktopSortableStateProvider: Dt,
|
|
4254
|
+
Dock: Ie,
|
|
4255
|
+
DockDesktop: Je,
|
|
4256
|
+
DockDesktopItem: Ke,
|
|
4257
|
+
DockMobile: Ze,
|
|
4258
|
+
DockMobileItem: ze,
|
|
4259
|
+
Editor: Vt,
|
|
4260
|
+
Markdown: $t,
|
|
4261
|
+
MdEditor: Ht,
|
|
4226
4262
|
SortableUtils: V,
|
|
4227
|
-
desktopAppConfig:
|
|
4228
|
-
desktopConfigMap:
|
|
4229
|
-
desktopGroupConfig:
|
|
4230
|
-
desktopThemeDark:
|
|
4231
|
-
desktopThemeLight:
|
|
4232
|
-
useDockDesktopMouseX:
|
|
4263
|
+
desktopAppConfig: Ve,
|
|
4264
|
+
desktopConfigMap: Be,
|
|
4265
|
+
desktopGroupConfig: Lt,
|
|
4266
|
+
desktopThemeDark: Ye,
|
|
4267
|
+
desktopThemeLight: qe,
|
|
4268
|
+
useDockDesktopMouseX: ct
|
|
4233
4269
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4234
4270
|
export {
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4271
|
+
Hn as Desktop,
|
|
4272
|
+
Pt as DesktopSortable,
|
|
4273
|
+
Mt as DesktopSortableConfigProvider,
|
|
4274
|
+
Dt as DesktopSortableStateProvider,
|
|
4275
|
+
Ie as Dock,
|
|
4276
|
+
Je as DockDesktop,
|
|
4277
|
+
Ke as DockDesktopItem,
|
|
4278
|
+
Ze as DockMobile,
|
|
4279
|
+
ze as DockMobileItem,
|
|
4280
|
+
Vt as Editor,
|
|
4281
|
+
$t as Markdown,
|
|
4282
|
+
Ht as MdEditor,
|
|
4247
4283
|
V as SortableUtils,
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4284
|
+
As as default,
|
|
4285
|
+
Ve as desktopAppConfig,
|
|
4286
|
+
Be as desktopConfigMap,
|
|
4287
|
+
Lt as desktopGroupConfig,
|
|
4288
|
+
Ye as desktopThemeDark,
|
|
4289
|
+
qe as desktopThemeLight,
|
|
4290
|
+
Ps as useDockDesktopMouseX
|
|
4255
4291
|
};
|