zs_library 0.4.17 → 0.4.19
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/components/dock/dock-desktop.d.ts +3 -0
- package/dist/components/dock/index.d.ts +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +601 -592
- package/package.json +146 -146
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
var Yt = Object.defineProperty;
|
|
2
2
|
var Vt = (r, e, o) => e in r ? Yt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
|
|
3
|
-
var
|
|
3
|
+
var Te = (r, e, o) => Vt(r, typeof e != "symbol" ? e + "" : e, o);
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import Wt from "i18next";
|
|
6
6
|
import { initReactI18next as Kt } from "react-i18next";
|
|
7
7
|
import { jsx as t, jsxs as m, Fragment as ue } from "react/jsx-runtime";
|
|
8
|
-
import * as
|
|
9
|
-
import Jt, { createContext as
|
|
10
|
-
import { cx as k, css as
|
|
8
|
+
import * as q from "react";
|
|
9
|
+
import Jt, { createContext as rt, useMemo as he, useContext as nt, useState as O, useRef as be, useEffect as ae, forwardRef as at, Fragment as Zt } from "react";
|
|
10
|
+
import { cx as k, css as b } from "@emotion/css";
|
|
11
11
|
import Qt from "react-slick";
|
|
12
|
-
import { ReactSortable as
|
|
13
|
-
import { AnimatePresence as
|
|
12
|
+
import { ReactSortable as He } from "react-sortablejs";
|
|
13
|
+
import { AnimatePresence as Oe, motion as R, useMotionValue as st, useTransform as xe, useSpring as Me } from "framer-motion";
|
|
14
14
|
import { useMotionValue as Ls } from "framer-motion";
|
|
15
15
|
import { useLocalStorageState as eo, useDebounceEffect as to } from "ahooks";
|
|
16
|
-
import { v4 as
|
|
17
|
-
import
|
|
18
|
-
import { RiPencilRuler2Line as oo, RiShareLine as ro, RiInformationLine as no, RiCloseCircleLine as ao, RiArrowUpDownLine as so, RiArrowLeftRightLine as io, RiArrowRightLine as lo, RiArrowLeftLine as co, RiCloseLine as mo, RiZoomOutLine as uo, RiZoomInLine as po, RiClockwise2Line as go, RiAnticlockwise2Line as fo, RiMoreLine as ho, RiArrowDropDownLine as
|
|
19
|
-
import
|
|
16
|
+
import { v4 as Ze } from "uuid";
|
|
17
|
+
import it from "rc-tooltip";
|
|
18
|
+
import { RiPencilRuler2Line as oo, RiShareLine as ro, RiInformationLine as no, RiCloseCircleLine as ao, RiArrowUpDownLine as so, RiArrowLeftRightLine as io, RiArrowRightLine as lo, RiArrowLeftLine as co, RiCloseLine as mo, RiZoomOutLine as uo, RiZoomInLine as po, RiClockwise2Line as go, RiAnticlockwise2Line as fo, RiMoreLine as ho, RiArrowDropDownLine as lt, RiCheckLine as ve, RiLink as bo, RiDeleteBinLine as ct, RiText as dt, RiH1 as mt, RiH2 as ut, RiH3 as pt, RiListCheck as gt, RiListUnordered as ft, RiListOrdered as ht, RiQuoteText as bt, RiCodeLine as xt, RiSparklingFill as Fe, RiImageLine as xo, RiArrowRightSLine as yo, RiRepeatLine as vo, RiFileCopyLine as ko, RiAddLine as Co, RiDraggable as wo } from "@remixicon/react";
|
|
19
|
+
import yt from "rc-dialog";
|
|
20
20
|
import No from "react-json-view";
|
|
21
21
|
import { AdmonitionDirectiveDescriptor as Io, MDXEditor as So, toolbarPlugin as To, diffSourcePlugin as Mo, listsPlugin as Lo, quotePlugin as Ao, headingsPlugin as Do, linkPlugin as Ro, linkDialogPlugin as Po, imagePlugin as Bo, tablePlugin as zo, thematicBreakPlugin as Eo, frontmatterPlugin as $o, codeBlockPlugin as Ho, codeMirrorPlugin as Oo, markdownShortcutPlugin as Fo, directivesPlugin as _o, DiffSourceToggleWrapper as jo, UndoRedo as Xo, Separator as ce, BoldItalicUnderlineToggles as Uo, CodeToggle as Go, StrikeThroughSupSubToggles as qo, ListsToggle as Yo, CreateLink as Vo, InsertImage as Wo, InsertTable as Ko, InsertThematicBreak as Jo, InsertCodeBlock as Zo, InsertFrontmatter as Qo } from "@mdxeditor/editor";
|
|
22
|
-
import
|
|
22
|
+
import vt from "react-markdown";
|
|
23
23
|
import er from "remark-gfm";
|
|
24
24
|
import tr from "remark-emoji";
|
|
25
25
|
import or from "rehype-raw";
|
|
@@ -28,28 +28,28 @@ import { oneLight as nr } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
|
28
28
|
import ar from "rc-image";
|
|
29
29
|
import { clsx as sr } from "clsx";
|
|
30
30
|
import { twMerge as ir } from "tailwind-merge";
|
|
31
|
-
import { Placeholder as lr, TiptapLink as cr, TiptapImage as dr, UploadImagesPlugin as mr, UpdatedImage as ur, TaskList as pr, TaskItem as gr, HorizontalRule as fr, StarterKit as hr, CodeBlockLowlight as br, Mathematics as xr, CharacterCount as yr, AIHighlight as vr, TiptapUnderline as kr, HighlightExtension as Cr, TextStyle as wr, Color as Nr, CustomKeymap as Ir, useEditor as Q, EditorBubbleItem as
|
|
31
|
+
import { Placeholder as lr, TiptapLink as cr, TiptapImage as dr, UploadImagesPlugin as mr, UpdatedImage as ur, TaskList as pr, TaskItem as gr, HorizontalRule as fr, StarterKit as hr, CodeBlockLowlight as br, Mathematics as xr, CharacterCount as yr, AIHighlight as vr, TiptapUnderline as kr, HighlightExtension as Cr, TextStyle as wr, Color as Nr, CustomKeymap as Ir, useEditor as Q, EditorBubbleItem as De, getPrevText as Sr, addAIHighlight as Tr, removeAIHighlight as Mr, EditorBubble as Lr, createImageUpload as kt, Command as Ar, createSuggestionItems as Dr, renderItems as Rr, EditorRoot as Pr, EditorContent as Br, handleImageDrop as zr, handleImagePaste as Er, handleCommandNavigation as $r, EditorCommand as Hr, EditorCommandEmpty as Or, EditorCommandList as Fr, EditorCommandItem as _r, ImageResizer as jr } from "novel";
|
|
32
32
|
import { useDebouncedCallback as Xr } from "use-debounce";
|
|
33
33
|
import { Markdown as Ur } from "tiptap-markdown";
|
|
34
|
-
import { cx as
|
|
34
|
+
import { cx as Y, cva as Gr } from "class-variance-authority";
|
|
35
35
|
import { createLowlight as qr, common as Yr } from "lowlight";
|
|
36
36
|
import { Extension as Vr } from "@tiptap/core";
|
|
37
37
|
import { Plugin as Wr, PluginKey as Kr, NodeSelection as J, TextSelection as Jr } from "prosemirror-state";
|
|
38
38
|
import { Slice as Zr, Fragment as Qr } from "prosemirror-model";
|
|
39
39
|
import * as en from "prosemirror-view";
|
|
40
|
-
import * as
|
|
41
|
-
import { Popover as
|
|
40
|
+
import * as ke from "@radix-ui/react-popover";
|
|
41
|
+
import { Popover as Ct, PopoverTrigger as tn } from "@radix-ui/react-popover";
|
|
42
42
|
import { Slot as on } from "@radix-ui/react-slot";
|
|
43
43
|
import { SigmaIcon as rn, X as nn, Check as an, TextQuote as sn, TrashIcon as ln, RefreshCcwDot as cn, CheckCheck as dn, ArrowDownWideNarrow as mn, WrapText as un, StepForward as pn, ArrowUp as gn, BoldIcon as fn, ItalicIcon as hn, UnderlineIcon as bn, StrikethroughIcon as xn, CodeIcon as yn } from "lucide-react";
|
|
44
|
-
import * as
|
|
44
|
+
import * as wt from "@radix-ui/react-separator";
|
|
45
45
|
import { useCompletion as vn } from "@ai-sdk/react";
|
|
46
|
-
import { toast as
|
|
46
|
+
import { toast as Ce } from "sonner";
|
|
47
47
|
import * as de from "@radix-ui/react-scroll-area";
|
|
48
|
-
import { Command as
|
|
48
|
+
import { Command as W } from "cmdk";
|
|
49
49
|
import * as te from "@radix-ui/react-dialog";
|
|
50
50
|
import kn from "highlight.js";
|
|
51
51
|
import Cn from "rc-dropdown";
|
|
52
|
-
import
|
|
52
|
+
import Le from "rc-menu";
|
|
53
53
|
import { generateHTML as wn } from "@tiptap/html";
|
|
54
54
|
function Nn(r, e) {
|
|
55
55
|
for (var o = 0; o < e.length; o++) {
|
|
@@ -130,7 +130,7 @@ Wt.use(Kt).init({
|
|
|
130
130
|
escapeValue: !1
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
const
|
|
133
|
+
const _e = {
|
|
134
134
|
token: {
|
|
135
135
|
itemNameColor: "#1a1a1a",
|
|
136
136
|
itemIconBackgroundColor: "white",
|
|
@@ -143,7 +143,7 @@ const Fe = {
|
|
|
143
143
|
contextMenuBackgroundColor: "white",
|
|
144
144
|
contextMenuShadowColor: "rgba(0, 0, 0, 0.1)"
|
|
145
145
|
}
|
|
146
|
-
},
|
|
146
|
+
}, je = {
|
|
147
147
|
token: {
|
|
148
148
|
itemNameColor: "white",
|
|
149
149
|
itemIconBackgroundColor: "#1f2937",
|
|
@@ -156,27 +156,27 @@ const Fe = {
|
|
|
156
156
|
contextMenuBackgroundColor: "#1a1a1a",
|
|
157
157
|
contextMenuShadowColor: "rgba(255, 255, 255, 0.1)"
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, Nt = rt(
|
|
160
160
|
{}
|
|
161
|
-
),
|
|
162
|
-
const { children: e, theme: o, ...a } = r, n = he(() => o === "light" ?
|
|
163
|
-
return /* @__PURE__ */ t(
|
|
164
|
-
}, le = () =>
|
|
161
|
+
), It = (r) => {
|
|
162
|
+
const { children: e, theme: o, ...a } = r, n = he(() => o === "light" ? _e : o === "dark" ? je : o, [o]);
|
|
163
|
+
return /* @__PURE__ */ t(Nt.Provider, { value: { theme: n, ...a }, children: e });
|
|
164
|
+
}, le = () => nt(Nt), Xe = {
|
|
165
165
|
maxRow: 2,
|
|
166
166
|
maxCol: 2
|
|
167
|
-
},
|
|
168
|
-
...
|
|
169
|
-
},
|
|
170
|
-
app:
|
|
171
|
-
group:
|
|
167
|
+
}, St = {
|
|
168
|
+
...Xe
|
|
169
|
+
}, Ue = {
|
|
170
|
+
app: Xe,
|
|
171
|
+
group: St
|
|
172
172
|
};
|
|
173
|
-
class
|
|
173
|
+
class V {
|
|
174
174
|
}
|
|
175
175
|
/** 清理重复id */
|
|
176
|
-
|
|
177
|
-
const o =
|
|
176
|
+
Te(V, "uniqueArray", (e) => e.reduce((o, a) => o.find((s) => s.id === a.id) ? o : o.concat([a]), [])), Te(V, "getTheme", (e) => {
|
|
177
|
+
const o = _e.token, a = je.token, n = { ...o, ...e == null ? void 0 : e.token }, s = { ...a, ...e == null ? void 0 : e.token };
|
|
178
178
|
return { light: n, dark: s };
|
|
179
|
-
}),
|
|
179
|
+
}), Te(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 @@ Se(Y, "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 Tt = rt({
|
|
190
190
|
list: [],
|
|
191
191
|
setList: () => {
|
|
192
192
|
},
|
|
@@ -221,33 +221,33 @@ const St = ot({
|
|
|
221
221
|
moveTargetId: null,
|
|
222
222
|
setMoveTargetId: () => {
|
|
223
223
|
}
|
|
224
|
-
}),
|
|
224
|
+
}), Mt = (r) => {
|
|
225
225
|
const {
|
|
226
226
|
children: e,
|
|
227
227
|
list: o = [],
|
|
228
228
|
onChange: a,
|
|
229
229
|
storageKey: n = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
230
230
|
enableCaching: s = !0
|
|
231
|
-
} = r, [i, d] =
|
|
231
|
+
} = r, [i, d] = O(), [p, x] = O(), [l, c] = O(null), g = be(l), [v, D] = O(null), [h, f] = O([]), [I, y] = O(
|
|
232
232
|
null
|
|
233
|
-
), [
|
|
233
|
+
), [N, u] = O(
|
|
234
234
|
null
|
|
235
|
-
), [S, T] =
|
|
235
|
+
), [S, T] = O(!1), [w, C] = O(null), [$, U] = O(
|
|
236
236
|
null
|
|
237
|
-
), [_, se] =
|
|
237
|
+
), [_, se] = O(!1), [oe, M] = eo(n, {
|
|
238
238
|
defaultValue: [],
|
|
239
239
|
listenStorageChange: !0
|
|
240
240
|
}), F = () => {
|
|
241
|
-
D(null), clearTimeout(i), d(void 0),
|
|
242
|
-
}, B = (L,
|
|
243
|
-
D({ ...L, pageX: L.pageX, pageY: L.pageY, data:
|
|
244
|
-
}, K = (L,
|
|
241
|
+
D(null), clearTimeout(i), d(void 0), g.current = null;
|
|
242
|
+
}, B = (L, G) => {
|
|
243
|
+
D({ ...L, pageX: L.pageX, pageY: L.pageY, data: G }), clearTimeout(i);
|
|
244
|
+
}, K = (L, G = !0) => {
|
|
245
245
|
const { config: j = {} } = L;
|
|
246
246
|
return j.allowContextMenu === !1 ? {} : {
|
|
247
247
|
onMouseDown: (E) => {
|
|
248
248
|
d(
|
|
249
249
|
setTimeout(() => {
|
|
250
|
-
|
|
250
|
+
G && g.current === null && B(E, L);
|
|
251
251
|
}, 800)
|
|
252
252
|
), T(!1), x(
|
|
253
253
|
setTimeout(() => {
|
|
@@ -259,18 +259,18 @@ const St = ot({
|
|
|
259
259
|
clearTimeout(p), x(void 0), clearTimeout(i), d(void 0);
|
|
260
260
|
},
|
|
261
261
|
onContextMenu: (E) => {
|
|
262
|
-
|
|
262
|
+
G && (E.preventDefault(), B(E, L));
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
}, re = (L,
|
|
266
|
-
const j = [...
|
|
265
|
+
}, re = (L, G) => {
|
|
266
|
+
const j = [...G || []];
|
|
267
267
|
if (j.length > 0)
|
|
268
|
-
|
|
268
|
+
f((E) => {
|
|
269
269
|
const P = [...E], z = (A) => {
|
|
270
|
-
var
|
|
271
|
-
const
|
|
270
|
+
var Ke, Je;
|
|
271
|
+
const H = j.shift(), X = A.find((ne) => ne.id === H), ee = A.findIndex((ne) => ne.id === H);
|
|
272
272
|
if (j.length && X) {
|
|
273
|
-
if (((
|
|
273
|
+
if (((Ke = X.children) == null ? void 0 : Ke.filter(
|
|
274
274
|
(ne) => !L.some((qt) => qt.id === ne.id)
|
|
275
275
|
).length) === 1 && L.length === 1) {
|
|
276
276
|
const ne = { ...L[0] };
|
|
@@ -279,47 +279,47 @@ const St = ot({
|
|
|
279
279
|
return X.children = z(X.children || []), A.splice(ee, 1, X), a == null || a(A), A;
|
|
280
280
|
}
|
|
281
281
|
if (X) {
|
|
282
|
-
if (!((
|
|
282
|
+
if (!((Je = X.children) != null && Je.length) && L.length) {
|
|
283
283
|
const ne = { ...X };
|
|
284
|
-
return X.data = { name: "文件夹" }, X.type = "group", X.children = [ne, ...L], X.id =
|
|
284
|
+
return X.data = { name: "文件夹" }, X.type = "group", X.children = [ne, ...L], X.id = Ze(), A.splice(ee, 1, X), a == null || a(A), A;
|
|
285
285
|
}
|
|
286
|
-
return X.children =
|
|
286
|
+
return X.children = V.uniqueArray(L), A.splice(ee, 1, X), a == null || a(A), A;
|
|
287
287
|
}
|
|
288
|
-
return
|
|
288
|
+
return V.uniqueArray(L);
|
|
289
289
|
};
|
|
290
|
-
return
|
|
290
|
+
return V.uniqueArray(z(P));
|
|
291
291
|
});
|
|
292
292
|
else {
|
|
293
|
-
const E =
|
|
294
|
-
a == null || a(E),
|
|
293
|
+
const E = V.uniqueArray(L);
|
|
294
|
+
a == null || a(E), f(E);
|
|
295
295
|
}
|
|
296
|
-
},
|
|
297
|
-
|
|
296
|
+
}, Be = (L, G) => {
|
|
297
|
+
f((j) => {
|
|
298
298
|
const E = [...j], P = (z) => {
|
|
299
299
|
var A;
|
|
300
|
-
for (let
|
|
301
|
-
if (z[
|
|
302
|
-
z[
|
|
300
|
+
for (let H = 0; H < z.length; H++)
|
|
301
|
+
if (z[H].id === L) {
|
|
302
|
+
z[H].config = G;
|
|
303
303
|
break;
|
|
304
|
-
} else ((A = z[
|
|
304
|
+
} else ((A = z[H].children) == null ? void 0 : A.length) !== void 0 && P(z[H].children);
|
|
305
305
|
};
|
|
306
306
|
return P(E), a == null || a(E), E;
|
|
307
307
|
});
|
|
308
|
-
},
|
|
309
|
-
|
|
308
|
+
}, Ie = (L, G) => {
|
|
309
|
+
f((j) => {
|
|
310
310
|
const E = [...j], P = (z) => {
|
|
311
311
|
var A;
|
|
312
|
-
for (let
|
|
313
|
-
if (z[
|
|
314
|
-
z[
|
|
312
|
+
for (let H = 0; H < z.length; H++)
|
|
313
|
+
if (z[H].id === L) {
|
|
314
|
+
z[H].data = G;
|
|
315
315
|
break;
|
|
316
|
-
} else ((A = z[
|
|
316
|
+
} else ((A = z[H].children) == null ? void 0 : A.length) !== void 0 && P(z[H].children);
|
|
317
317
|
};
|
|
318
318
|
return P(E), a == null || a(E), E;
|
|
319
319
|
});
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
const j = [...
|
|
320
|
+
}, Se = (L) => {
|
|
321
|
+
f((G) => {
|
|
322
|
+
const j = [...G], E = (P) => {
|
|
323
323
|
var z;
|
|
324
324
|
for (let A = 0; A < P.length; A++)
|
|
325
325
|
if (P[A].id === L) {
|
|
@@ -329,48 +329,48 @@ const St = ot({
|
|
|
329
329
|
};
|
|
330
330
|
return E(j), a == null || a(j), j;
|
|
331
331
|
});
|
|
332
|
-
}, ie = (L,
|
|
333
|
-
const j = [...
|
|
334
|
-
const A = z.shift(),
|
|
335
|
-
if (
|
|
332
|
+
}, ie = (L, G) => {
|
|
333
|
+
const j = [...h], E = (P, z) => {
|
|
334
|
+
const A = z.shift(), H = P.find((ee) => ee.id === A), X = P.findIndex((ee) => ee.id === A);
|
|
335
|
+
if (H) {
|
|
336
336
|
if (z.length)
|
|
337
|
-
|
|
337
|
+
H.children = E(H.children || [], z);
|
|
338
338
|
else {
|
|
339
339
|
const ee = (L == null ? void 0 : L.type) ?? "app";
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
H.children = [
|
|
341
|
+
...H.children ?? [],
|
|
342
342
|
{
|
|
343
343
|
...L,
|
|
344
|
-
id:
|
|
345
|
-
config: (L == null ? void 0 : L.config) ??
|
|
344
|
+
id: Ze(),
|
|
345
|
+
config: (L == null ? void 0 : L.config) ?? Ue[ee]
|
|
346
346
|
}
|
|
347
347
|
];
|
|
348
348
|
}
|
|
349
|
-
return P.splice(X, 1,
|
|
349
|
+
return P.splice(X, 1, H), P;
|
|
350
350
|
} else
|
|
351
351
|
return P;
|
|
352
352
|
};
|
|
353
|
-
|
|
353
|
+
f(E(j, G));
|
|
354
354
|
};
|
|
355
355
|
return ae(() => {
|
|
356
|
-
(o == null ? void 0 : o.length) > 0 &&
|
|
356
|
+
(o == null ? void 0 : o.length) > 0 && h.length === 0 && re(o);
|
|
357
357
|
}, [o]), ae(() => {
|
|
358
|
-
|
|
358
|
+
g.current = l, l !== null && F();
|
|
359
359
|
}, [l]), ae(() => {
|
|
360
360
|
s && oe != null && oe.length && !_ && (re(oe), se(!0));
|
|
361
361
|
}, [oe, _, s]), to(
|
|
362
362
|
() => {
|
|
363
|
-
s && M(
|
|
363
|
+
s && M(h);
|
|
364
364
|
},
|
|
365
|
-
[
|
|
365
|
+
[h, s],
|
|
366
366
|
{
|
|
367
367
|
wait: 1e3
|
|
368
368
|
}
|
|
369
369
|
), /* @__PURE__ */ t(
|
|
370
|
-
|
|
370
|
+
Tt.Provider,
|
|
371
371
|
{
|
|
372
372
|
value: {
|
|
373
|
-
list:
|
|
373
|
+
list: h,
|
|
374
374
|
setList: re,
|
|
375
375
|
contextMenu: v,
|
|
376
376
|
setContextMenu: D,
|
|
@@ -380,34 +380,34 @@ const St = ot({
|
|
|
380
380
|
hideContextMenu: F,
|
|
381
381
|
showInfoItemData: I,
|
|
382
382
|
setShowInfoItemData: y,
|
|
383
|
-
openGroupItemData:
|
|
383
|
+
openGroupItemData: N,
|
|
384
384
|
setOpenGroupItemData: u,
|
|
385
385
|
longPressTriggered: S,
|
|
386
|
-
updateItemConfig:
|
|
387
|
-
updateItem:
|
|
388
|
-
removeItem:
|
|
386
|
+
updateItemConfig: Be,
|
|
387
|
+
updateItem: Ie,
|
|
388
|
+
removeItem: Se,
|
|
389
389
|
addItem: ie,
|
|
390
|
-
moveItemId:
|
|
391
|
-
setMoveItemId:
|
|
392
|
-
moveTargetId:
|
|
393
|
-
setMoveTargetId:
|
|
390
|
+
moveItemId: w,
|
|
391
|
+
setMoveItemId: C,
|
|
392
|
+
moveTargetId: $,
|
|
393
|
+
setMoveTargetId: U
|
|
394
394
|
},
|
|
395
395
|
children: e
|
|
396
396
|
}
|
|
397
397
|
);
|
|
398
|
-
}, pe = () =>
|
|
398
|
+
}, pe = () => nt(Tt), Mn = {
|
|
399
399
|
menuShow: {
|
|
400
400
|
opacity: 1,
|
|
401
401
|
y: 0,
|
|
402
402
|
transition: { type: "spring", stiffness: 300, damping: 24 }
|
|
403
403
|
},
|
|
404
404
|
menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
|
|
405
|
-
},
|
|
406
|
-
const { icon: e, title: o, onClick: a } = r, { theme: n } = le(), { light: s, dark: i } =
|
|
405
|
+
}, ze = (r) => {
|
|
406
|
+
const { icon: e, title: o, onClick: a } = r, { theme: n } = le(), { light: s, dark: i } = V.getTheme(n);
|
|
407
407
|
return /* @__PURE__ */ t(
|
|
408
408
|
R.div,
|
|
409
409
|
{
|
|
410
|
-
className:
|
|
410
|
+
className: b`
|
|
411
411
|
&:hover {
|
|
412
412
|
background-color: ${s.contextMenuActiveColor};
|
|
413
413
|
@media (prefers-color-scheme: dark) {
|
|
@@ -433,7 +433,7 @@ const St = ot({
|
|
|
433
433
|
{
|
|
434
434
|
className: k(
|
|
435
435
|
"py-1.5 px-3 rounded-lg",
|
|
436
|
-
|
|
436
|
+
b`
|
|
437
437
|
padding-top: 0.375rem;
|
|
438
438
|
padding-bottom: 0.375rem;
|
|
439
439
|
padding-left: 0.75rem;
|
|
@@ -447,7 +447,7 @@ const St = ot({
|
|
|
447
447
|
R.div,
|
|
448
448
|
{
|
|
449
449
|
className: k(
|
|
450
|
-
|
|
450
|
+
b`
|
|
451
451
|
margin-bottom: 0.375rem;
|
|
452
452
|
display: flex;
|
|
453
453
|
justify-content: center;
|
|
@@ -476,17 +476,17 @@ const St = ot({
|
|
|
476
476
|
setContextMenu: x,
|
|
477
477
|
hideContextMenu: l,
|
|
478
478
|
setShowInfoItemData: c,
|
|
479
|
-
removeItem:
|
|
479
|
+
removeItem: g,
|
|
480
480
|
updateItemConfig: v
|
|
481
|
-
} = pe(), { theme: D } = le(), { light:
|
|
481
|
+
} = pe(), { theme: D } = le(), { light: h, dark: f } = V.getTheme(D), { data: I } = p ?? {}, { config: y = {} } = I ?? {}, N = () => {
|
|
482
482
|
var T;
|
|
483
|
-
const u =
|
|
484
|
-
for (let
|
|
485
|
-
for (let
|
|
486
|
-
S.push(`${
|
|
483
|
+
const u = Ue[(T = p == null ? void 0 : p.data) == null ? void 0 : T.type], S = [];
|
|
484
|
+
for (let w = 1; w <= ((u == null ? void 0 : u.maxRow) ?? 2); w++)
|
|
485
|
+
for (let C = 1; C <= ((u == null ? void 0 : u.maxCol) ?? 2); C++)
|
|
486
|
+
S.push(`${w}x${C}`);
|
|
487
487
|
return S;
|
|
488
488
|
};
|
|
489
|
-
return /* @__PURE__ */ t(
|
|
489
|
+
return /* @__PURE__ */ t(Oe, { children: p && /* @__PURE__ */ m(
|
|
490
490
|
R.div,
|
|
491
491
|
{
|
|
492
492
|
initial: { opacity: 0 },
|
|
@@ -500,21 +500,21 @@ const St = ot({
|
|
|
500
500
|
R.div,
|
|
501
501
|
{
|
|
502
502
|
className: k(
|
|
503
|
-
|
|
503
|
+
b`
|
|
504
504
|
border-radius: 0.5rem;
|
|
505
505
|
overflow: hidden;
|
|
506
|
-
background-color: ${
|
|
507
|
-
box-shadow: 0 0 0.5rem ${
|
|
506
|
+
background-color: ${h.contextMenuBackgroundColor};
|
|
507
|
+
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
508
508
|
@media (prefers-color-scheme: dark) {
|
|
509
|
-
background-color: ${
|
|
510
|
-
box-shadow: 0 0 0.5rem ${
|
|
509
|
+
background-color: ${f.contextMenuBackgroundColor};
|
|
510
|
+
box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
|
|
511
511
|
}
|
|
512
512
|
`
|
|
513
513
|
),
|
|
514
514
|
children: n && y.allowResize !== !1 && /* @__PURE__ */ t(
|
|
515
515
|
R.ul,
|
|
516
516
|
{
|
|
517
|
-
className:
|
|
517
|
+
className: b`
|
|
518
518
|
background-color: white;
|
|
519
519
|
padding: 0.25rem;
|
|
520
520
|
margin: 0;
|
|
@@ -524,7 +524,7 @@ const St = ot({
|
|
|
524
524
|
label: "修改大小",
|
|
525
525
|
key: "size",
|
|
526
526
|
icon: /* @__PURE__ */ t(oo, { size: 14 }),
|
|
527
|
-
items:
|
|
527
|
+
items: N().map((u) => ({
|
|
528
528
|
label: u,
|
|
529
529
|
key: u,
|
|
530
530
|
onClick: () => {
|
|
@@ -539,7 +539,7 @@ const St = ot({
|
|
|
539
539
|
].map((u) => /* @__PURE__ */ m(
|
|
540
540
|
R.li,
|
|
541
541
|
{
|
|
542
|
-
className:
|
|
542
|
+
className: b`
|
|
543
543
|
padding-top: 0.5rem;
|
|
544
544
|
padding-bottom: 0.5rem;
|
|
545
545
|
padding-left: 0.75rem;
|
|
@@ -549,7 +549,7 @@ const St = ot({
|
|
|
549
549
|
/* @__PURE__ */ m(
|
|
550
550
|
R.p,
|
|
551
551
|
{
|
|
552
|
-
className:
|
|
552
|
+
className: b`
|
|
553
553
|
display: flex;
|
|
554
554
|
align-items: center;
|
|
555
555
|
font-size: 0.875rem;
|
|
@@ -557,9 +557,9 @@ const St = ot({
|
|
|
557
557
|
gap: 0.5rem;
|
|
558
558
|
padding-bottom: 0.5rem;
|
|
559
559
|
margin: 0;
|
|
560
|
-
color: ${
|
|
560
|
+
color: ${h.contextMenuTextColor};
|
|
561
561
|
@media (prefers-color-scheme: dark) {
|
|
562
|
-
color: ${
|
|
562
|
+
color: ${f.contextMenuTextColor};
|
|
563
563
|
}
|
|
564
564
|
`,
|
|
565
565
|
children: [
|
|
@@ -572,7 +572,7 @@ const St = ot({
|
|
|
572
572
|
/* @__PURE__ */ t(
|
|
573
573
|
R.div,
|
|
574
574
|
{
|
|
575
|
-
className:
|
|
575
|
+
className: b`
|
|
576
576
|
display: grid;
|
|
577
577
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
578
578
|
gap: 0.25rem;
|
|
@@ -582,7 +582,7 @@ const St = ot({
|
|
|
582
582
|
{
|
|
583
583
|
className: k(
|
|
584
584
|
"py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",
|
|
585
|
-
|
|
585
|
+
b`
|
|
586
586
|
padding-top: 0.25rem;
|
|
587
587
|
padding-bottom: 0.25rem;
|
|
588
588
|
padding-left: 0.5rem;
|
|
@@ -593,21 +593,21 @@ const St = ot({
|
|
|
593
593
|
line-height: 1.25rem;
|
|
594
594
|
cursor: pointer;
|
|
595
595
|
text-align: center;
|
|
596
|
-
color: ${
|
|
596
|
+
color: ${h.contextMenuTextColor};
|
|
597
597
|
@media (prefers-color-scheme: dark) {
|
|
598
|
-
color: ${
|
|
598
|
+
color: ${f.contextMenuTextColor};
|
|
599
599
|
}
|
|
600
600
|
&:hover {
|
|
601
|
-
background-color: ${
|
|
601
|
+
background-color: ${h.contextMenuActiveColor};
|
|
602
602
|
@media (prefers-color-scheme: dark) {
|
|
603
|
-
background-color: ${
|
|
603
|
+
background-color: ${f.contextMenuActiveColor};
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
`,
|
|
607
|
-
`${y.row}x${y.col}` === S.key &&
|
|
608
|
-
background-color: ${
|
|
607
|
+
`${y.row}x${y.col}` === S.key && b`
|
|
608
|
+
background-color: ${h.contextMenuActiveColor};
|
|
609
609
|
@media (prefers-color-scheme: dark) {
|
|
610
|
-
background-color: ${
|
|
610
|
+
background-color: ${f.contextMenuActiveColor};
|
|
611
611
|
}
|
|
612
612
|
`
|
|
613
613
|
),
|
|
@@ -630,12 +630,12 @@ const St = ot({
|
|
|
630
630
|
R.div,
|
|
631
631
|
{
|
|
632
632
|
className: k(
|
|
633
|
-
|
|
634
|
-
background-color: ${
|
|
635
|
-
box-shadow: 0 0 0.5rem ${
|
|
633
|
+
b`
|
|
634
|
+
background-color: ${h.contextMenuBackgroundColor};
|
|
635
|
+
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
636
636
|
@media (prefers-color-scheme: dark) {
|
|
637
|
-
background-color: ${
|
|
638
|
-
box-shadow: 0 0 0.5rem ${
|
|
637
|
+
background-color: ${f.contextMenuBackgroundColor};
|
|
638
|
+
box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
|
|
639
639
|
}
|
|
640
640
|
display: flex;
|
|
641
641
|
justify-content: space-around;
|
|
@@ -648,7 +648,7 @@ const St = ot({
|
|
|
648
648
|
),
|
|
649
649
|
children: [
|
|
650
650
|
a && /* @__PURE__ */ t(
|
|
651
|
-
|
|
651
|
+
ze,
|
|
652
652
|
{
|
|
653
653
|
icon: /* @__PURE__ */ t(ro, { size: 20 }),
|
|
654
654
|
title: "分享",
|
|
@@ -661,7 +661,7 @@ const St = ot({
|
|
|
661
661
|
}
|
|
662
662
|
),
|
|
663
663
|
e && /* @__PURE__ */ t(
|
|
664
|
-
|
|
664
|
+
ze,
|
|
665
665
|
{
|
|
666
666
|
icon: /* @__PURE__ */ t(no, { size: 20 }),
|
|
667
667
|
title: "信息",
|
|
@@ -679,16 +679,16 @@ const St = ot({
|
|
|
679
679
|
}
|
|
680
680
|
),
|
|
681
681
|
o && /* @__PURE__ */ t(
|
|
682
|
-
|
|
682
|
+
ze,
|
|
683
683
|
{
|
|
684
684
|
icon: /* @__PURE__ */ t(ao, { size: 20 }),
|
|
685
685
|
title: "移除",
|
|
686
686
|
onClick: () => {
|
|
687
687
|
if (d) {
|
|
688
|
-
d(p.data,
|
|
688
|
+
d(p.data, g);
|
|
689
689
|
return;
|
|
690
690
|
}
|
|
691
|
-
x(null),
|
|
691
|
+
x(null), g(p.data.id);
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
)
|
|
@@ -699,12 +699,12 @@ const St = ot({
|
|
|
699
699
|
}
|
|
700
700
|
) });
|
|
701
701
|
}, An = (r) => {
|
|
702
|
-
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: a } = pe(), { itemIconBuilder: n, theme: s, contextMenu: i } = le(), { light: d, dark: p } =
|
|
702
|
+
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: a } = pe(), { itemIconBuilder: n, theme: s, contextMenu: i } = le(), { light: d, dark: p } = V.getTheme(s), { data: x = {} } = e, { name: l } = x;
|
|
703
703
|
return /* @__PURE__ */ m(ue, { children: [
|
|
704
704
|
/* @__PURE__ */ t(
|
|
705
705
|
R.div,
|
|
706
706
|
{
|
|
707
|
-
className:
|
|
707
|
+
className: b`
|
|
708
708
|
width: 4rem;
|
|
709
709
|
height: 4rem;
|
|
710
710
|
background-color: ${d.itemIconBackgroundColor};
|
|
@@ -722,7 +722,7 @@ const St = ot({
|
|
|
722
722
|
children: /* @__PURE__ */ t(
|
|
723
723
|
"div",
|
|
724
724
|
{
|
|
725
|
-
className:
|
|
725
|
+
className: b`
|
|
726
726
|
position: absolute;
|
|
727
727
|
left: 0;
|
|
728
728
|
top: 0;
|
|
@@ -744,13 +744,13 @@ const St = ot({
|
|
|
744
744
|
{
|
|
745
745
|
className: k(
|
|
746
746
|
"whitespace-nowrap text-ellipsis overflow-hidden text-center mt-1 mb-0 max-w-16",
|
|
747
|
-
|
|
747
|
+
b`
|
|
748
748
|
color: ${d.itemNameColor};
|
|
749
749
|
@media (prefers-color-scheme: dark) {
|
|
750
750
|
color: ${p.itemNameColor};
|
|
751
751
|
}
|
|
752
752
|
`,
|
|
753
|
-
o &&
|
|
753
|
+
o && b`
|
|
754
754
|
color: transparent;
|
|
755
755
|
`
|
|
756
756
|
),
|
|
@@ -758,7 +758,7 @@ const St = ot({
|
|
|
758
758
|
}
|
|
759
759
|
)
|
|
760
760
|
] });
|
|
761
|
-
},
|
|
761
|
+
}, Ge = (r) => {
|
|
762
762
|
const {
|
|
763
763
|
data: e,
|
|
764
764
|
className: o,
|
|
@@ -770,10 +770,10 @@ const St = ot({
|
|
|
770
770
|
childrenLength: p
|
|
771
771
|
} = r, { contextMenu: x, setContextMenu: l } = pe(), { contextMenu: c } = le();
|
|
772
772
|
return /* @__PURE__ */ t(
|
|
773
|
-
|
|
773
|
+
it,
|
|
774
774
|
{
|
|
775
775
|
placement: "bottom",
|
|
776
|
-
overlayClassName:
|
|
776
|
+
overlayClassName: b`
|
|
777
777
|
background-color: transparent;
|
|
778
778
|
.rc-tooltip-inner {
|
|
779
779
|
background-color: transparent;
|
|
@@ -783,8 +783,8 @@ const St = ot({
|
|
|
783
783
|
`,
|
|
784
784
|
overlay: /* @__PURE__ */ t(Ln, { ...c }),
|
|
785
785
|
visible: (x == null ? void 0 : x.data.id) === e.id,
|
|
786
|
-
onVisibleChange: (
|
|
787
|
-
|
|
786
|
+
onVisibleChange: (g) => {
|
|
787
|
+
g || l(null);
|
|
788
788
|
},
|
|
789
789
|
destroyTooltipOnHide: !0,
|
|
790
790
|
children: /* @__PURE__ */ t(
|
|
@@ -815,29 +815,29 @@ const St = ot({
|
|
|
815
815
|
setOpenGroupItemData: x,
|
|
816
816
|
longPressTriggered: l,
|
|
817
817
|
moveItemId: c,
|
|
818
|
-
moveTargetId:
|
|
818
|
+
moveTargetId: g,
|
|
819
819
|
setMoveTargetId: v,
|
|
820
820
|
listStatus: D
|
|
821
|
-
} = pe(), { itemIconBuilder:
|
|
821
|
+
} = pe(), { itemIconBuilder: h, theme: f, contextMenu: I } = le(), { light: y, dark: N } = V.getTheme(f), { children: u, data: S, config: T } = e, { row: w = 1, col: C = 1 } = T ?? {}, $ = {
|
|
822
822
|
visible: { opacity: 1, scale: 1 },
|
|
823
823
|
hidden: { opacity: 0, scale: 0.95 }
|
|
824
|
-
},
|
|
824
|
+
}, U = ((u == null ? void 0 : u.length) ?? 0) === 0, _ = U ? [e] : [...u ?? []].slice(0, 9), se = he(() => c === e.id.toString(), [e.id, c]), oe = he(() => g === e.id, [e.id, g]), M = b`
|
|
825
825
|
overflow: hidden;
|
|
826
826
|
cursor: pointer;
|
|
827
827
|
background-color: ${y.itemIconBackgroundColor};
|
|
828
828
|
box-shadow: 0 0 0.5rem ${y.itemIconShadowColor};
|
|
829
829
|
@media (prefers-color-scheme: dark) {
|
|
830
|
-
background-color: ${
|
|
831
|
-
box-shadow: 0 0 0.5rem ${
|
|
830
|
+
background-color: ${N.itemIconBackgroundColor};
|
|
831
|
+
box-shadow: 0 0 0.5rem ${N.itemIconShadowColor};
|
|
832
832
|
}
|
|
833
833
|
`, F = () => {
|
|
834
|
-
if (
|
|
834
|
+
if (U)
|
|
835
835
|
return /* @__PURE__ */ t(
|
|
836
836
|
R.div,
|
|
837
837
|
{
|
|
838
838
|
className: k(
|
|
839
839
|
"sortable-group-item",
|
|
840
|
-
|
|
840
|
+
b`
|
|
841
841
|
overflow: hidden;
|
|
842
842
|
cursor: pointer;
|
|
843
843
|
width: 100%;
|
|
@@ -848,28 +848,28 @@ const St = ot({
|
|
|
848
848
|
top: 0;
|
|
849
849
|
border-radius: 0.75rem;
|
|
850
850
|
@media (prefers-color-scheme: dark) {
|
|
851
|
-
background-color: ${
|
|
851
|
+
background-color: ${N.itemIconBackgroundColor};
|
|
852
852
|
}
|
|
853
853
|
`
|
|
854
854
|
),
|
|
855
855
|
onClick: (B) => {
|
|
856
856
|
B.stopPropagation(), s == null || s(e);
|
|
857
857
|
},
|
|
858
|
-
children:
|
|
858
|
+
children: h == null ? void 0 : h(e)
|
|
859
859
|
}
|
|
860
860
|
);
|
|
861
|
-
if (
|
|
861
|
+
if (w === 1 && C === 1 || w === 2 && C === 2)
|
|
862
862
|
return /* @__PURE__ */ t(
|
|
863
863
|
R.div,
|
|
864
864
|
{
|
|
865
|
-
className:
|
|
865
|
+
className: b`
|
|
866
866
|
display: grid;
|
|
867
867
|
width: 100%;
|
|
868
868
|
height: 100%;
|
|
869
869
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
870
870
|
grid-template-rows: repeat(3, minmax(0, 1fr));
|
|
871
|
-
padding: ${
|
|
872
|
-
gap: ${
|
|
871
|
+
padding: ${C === 1 ? "0.125rem" : "0.25rem"};
|
|
872
|
+
gap: ${C === 1 ? "0.125rem" : "0.5rem"};
|
|
873
873
|
place-items: center;
|
|
874
874
|
`,
|
|
875
875
|
children: _ == null ? void 0 : _.slice(0, 9).map((B) => /* @__PURE__ */ t(
|
|
@@ -877,8 +877,8 @@ const St = ot({
|
|
|
877
877
|
{
|
|
878
878
|
className: k(
|
|
879
879
|
M,
|
|
880
|
-
|
|
881
|
-
border-radius: ${
|
|
880
|
+
b`
|
|
881
|
+
border-radius: ${C === 1 ? "0.25rem" : "0.5rem"};
|
|
882
882
|
width: 100%;
|
|
883
883
|
height: 100%;
|
|
884
884
|
`
|
|
@@ -886,17 +886,17 @@ const St = ot({
|
|
|
886
886
|
onClick: (K) => {
|
|
887
887
|
K.stopPropagation(), s == null || s(B);
|
|
888
888
|
},
|
|
889
|
-
children:
|
|
889
|
+
children: h == null ? void 0 : h(B)
|
|
890
890
|
},
|
|
891
891
|
B.id
|
|
892
892
|
))
|
|
893
893
|
}
|
|
894
894
|
);
|
|
895
|
-
if (
|
|
895
|
+
if (w === 1 && C === 2)
|
|
896
896
|
return /* @__PURE__ */ t(
|
|
897
897
|
R.div,
|
|
898
898
|
{
|
|
899
|
-
className:
|
|
899
|
+
className: b`
|
|
900
900
|
display: grid;
|
|
901
901
|
grid-template-columns: repeat(10, minmax(0, 1fr));
|
|
902
902
|
grid-template-rows: repeat(4, minmax(0, 1fr));
|
|
@@ -911,13 +911,13 @@ const St = ot({
|
|
|
911
911
|
{
|
|
912
912
|
className: k(
|
|
913
913
|
M,
|
|
914
|
-
K < 2 ?
|
|
914
|
+
K < 2 ? b`
|
|
915
915
|
width: 52px;
|
|
916
916
|
height: 52px;
|
|
917
917
|
border-radius: 0.5rem;
|
|
918
918
|
grid-column: span 4 / span 4;
|
|
919
919
|
grid-row: span 4 / span 4;
|
|
920
|
-
` :
|
|
920
|
+
` : b`
|
|
921
921
|
width: 1.5rem;
|
|
922
922
|
height: 1.5rem;
|
|
923
923
|
border-radius: 0.375rem;
|
|
@@ -928,17 +928,17 @@ const St = ot({
|
|
|
928
928
|
onClick: (re) => {
|
|
929
929
|
K > 2 || (re.stopPropagation(), s == null || s(B));
|
|
930
930
|
},
|
|
931
|
-
children:
|
|
931
|
+
children: h == null ? void 0 : h(B)
|
|
932
932
|
},
|
|
933
933
|
B.id
|
|
934
934
|
))
|
|
935
935
|
}
|
|
936
936
|
);
|
|
937
|
-
if (
|
|
937
|
+
if (w === 2 && C === 1)
|
|
938
938
|
return /* @__PURE__ */ t(
|
|
939
939
|
R.div,
|
|
940
940
|
{
|
|
941
|
-
className:
|
|
941
|
+
className: b`
|
|
942
942
|
display: grid;
|
|
943
943
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
944
944
|
grid-template-rows: repeat(10, minmax(0, 1fr));
|
|
@@ -953,13 +953,13 @@ const St = ot({
|
|
|
953
953
|
{
|
|
954
954
|
className: k(
|
|
955
955
|
M,
|
|
956
|
-
K < 2 ?
|
|
956
|
+
K < 2 ? b`
|
|
957
957
|
width: 52px;
|
|
958
958
|
height: 52px;
|
|
959
959
|
border-radius: 0.5rem;
|
|
960
960
|
grid-column: span 4 / span 4;
|
|
961
961
|
grid-row: span 4 / span 4;
|
|
962
|
-
` :
|
|
962
|
+
` : b`
|
|
963
963
|
width: 1.5rem;
|
|
964
964
|
height: 1.5rem;
|
|
965
965
|
grid-column: span 2 / span 2;
|
|
@@ -969,7 +969,7 @@ const St = ot({
|
|
|
969
969
|
onClick: (re) => {
|
|
970
970
|
K > 2 || (re.stopPropagation(), s == null || s(B));
|
|
971
971
|
},
|
|
972
|
-
children:
|
|
972
|
+
children: h == null ? void 0 : h(B)
|
|
973
973
|
},
|
|
974
974
|
B.id
|
|
975
975
|
))
|
|
@@ -977,16 +977,16 @@ const St = ot({
|
|
|
977
977
|
);
|
|
978
978
|
};
|
|
979
979
|
return /* @__PURE__ */ m(
|
|
980
|
-
|
|
980
|
+
Ge,
|
|
981
981
|
{
|
|
982
982
|
data: e,
|
|
983
983
|
itemIndex: n,
|
|
984
984
|
parentIds: a,
|
|
985
985
|
childrenLength: u == null ? void 0 : u.length,
|
|
986
986
|
className: k(
|
|
987
|
-
|
|
988
|
-
grid-row: span ${
|
|
989
|
-
grid-column: span ${
|
|
987
|
+
b`
|
|
988
|
+
grid-row: span ${w};
|
|
989
|
+
grid-column: span ${C};
|
|
990
990
|
`,
|
|
991
991
|
o
|
|
992
992
|
),
|
|
@@ -997,31 +997,31 @@ const St = ot({
|
|
|
997
997
|
whileTap: { scale: 0.9 },
|
|
998
998
|
className: k(
|
|
999
999
|
oe ? "!scale-110" : "",
|
|
1000
|
-
|
|
1000
|
+
b`
|
|
1001
1001
|
cursor: pointer;
|
|
1002
1002
|
position: relative;
|
|
1003
1003
|
border-radius: 0.75rem;
|
|
1004
1004
|
background-color: ${y.groupItemIconBackgroundColor};
|
|
1005
1005
|
box-shadow: 0 0 0.5rem ${y.groupItemIconShadowColor};
|
|
1006
1006
|
@media (prefers-color-scheme: dark) {
|
|
1007
|
-
background-color: ${
|
|
1008
|
-
box-shadow: 0 0 0.5rem ${
|
|
1007
|
+
background-color: ${N.groupItemIconBackgroundColor};
|
|
1008
|
+
box-shadow: 0 0 0.5rem ${N.groupItemIconShadowColor};
|
|
1009
1009
|
}
|
|
1010
1010
|
/* overflow: hidden; */
|
|
1011
1011
|
transition: all 0.3s;
|
|
1012
1012
|
margin: 0 auto;
|
|
1013
|
-
width: ${
|
|
1014
|
-
height: ${
|
|
1013
|
+
width: ${C * 64 + 32 * (C - 1)}px;
|
|
1014
|
+
height: ${w * 64 + 32 * (w - 1)}px;
|
|
1015
1015
|
`
|
|
1016
1016
|
),
|
|
1017
1017
|
onClick: (B) => {
|
|
1018
|
-
!
|
|
1018
|
+
!U && !l && (e.parentIds = a, e.pageX = B.pageX, e.pageY = B.pageY, x(e));
|
|
1019
1019
|
},
|
|
1020
1020
|
...d(e, I !== !1),
|
|
1021
1021
|
children: /* @__PURE__ */ m(
|
|
1022
1022
|
R.div,
|
|
1023
1023
|
{
|
|
1024
|
-
className:
|
|
1024
|
+
className: b`
|
|
1025
1025
|
position: relative;
|
|
1026
1026
|
width: 100%;
|
|
1027
1027
|
height: 100%;
|
|
@@ -1033,11 +1033,11 @@ const St = ot({
|
|
|
1033
1033
|
children: [
|
|
1034
1034
|
F(),
|
|
1035
1035
|
/* @__PURE__ */ t(
|
|
1036
|
-
|
|
1036
|
+
He,
|
|
1037
1037
|
{
|
|
1038
1038
|
className: k(
|
|
1039
1039
|
"sortable-group-item",
|
|
1040
|
-
|
|
1040
|
+
b`
|
|
1041
1041
|
position: absolute;
|
|
1042
1042
|
cursor: pointer;
|
|
1043
1043
|
left: 0.375rem;
|
|
@@ -1072,17 +1072,17 @@ const St = ot({
|
|
|
1072
1072
|
{
|
|
1073
1073
|
className: k(
|
|
1074
1074
|
"whitespace-nowrap text-ellipsis overflow-hidden text-center mt-1 mb-0 max-w-16",
|
|
1075
|
-
|
|
1075
|
+
b`
|
|
1076
1076
|
color: ${y.itemNameColor};
|
|
1077
1077
|
@media (prefers-color-scheme: dark) {
|
|
1078
|
-
color: ${
|
|
1078
|
+
color: ${N.itemNameColor};
|
|
1079
1079
|
}
|
|
1080
1080
|
`,
|
|
1081
|
-
i &&
|
|
1081
|
+
i && b`
|
|
1082
1082
|
color: transparent;
|
|
1083
1083
|
`
|
|
1084
1084
|
),
|
|
1085
|
-
variants:
|
|
1085
|
+
variants: $,
|
|
1086
1086
|
animate: se ? "hidden" : "visible",
|
|
1087
1087
|
children: (S == null ? void 0 : S.name) ?? "文件夹"
|
|
1088
1088
|
}
|
|
@@ -1090,7 +1090,7 @@ const St = ot({
|
|
|
1090
1090
|
]
|
|
1091
1091
|
}
|
|
1092
1092
|
);
|
|
1093
|
-
},
|
|
1093
|
+
}, Lt = b`
|
|
1094
1094
|
padding: 8px;
|
|
1095
1095
|
transition: all 0.2s;
|
|
1096
1096
|
> div {
|
|
@@ -1110,12 +1110,12 @@ const St = ot({
|
|
|
1110
1110
|
setMoveItemId: d,
|
|
1111
1111
|
setMoveTargetId: p,
|
|
1112
1112
|
updateItem: x
|
|
1113
|
-
} = pe(), { theme: l } = le(), { light: c, dark:
|
|
1113
|
+
} = pe(), { theme: l } = le(), { light: c, dark: g } = V.getTheme(l), [v, D] = O("文件夹"), h = [...(e == null ? void 0 : e.children) ?? []];
|
|
1114
1114
|
return ae(() => {
|
|
1115
|
-
var
|
|
1116
|
-
e && D((
|
|
1115
|
+
var f;
|
|
1116
|
+
e && D((f = e.data) == null ? void 0 : f.name);
|
|
1117
1117
|
}, [e]), /* @__PURE__ */ t(
|
|
1118
|
-
|
|
1118
|
+
yt,
|
|
1119
1119
|
{
|
|
1120
1120
|
visible: !!e,
|
|
1121
1121
|
onClose: () => {
|
|
@@ -1130,7 +1130,7 @@ const St = ot({
|
|
|
1130
1130
|
title: /* @__PURE__ */ t(
|
|
1131
1131
|
"input",
|
|
1132
1132
|
{
|
|
1133
|
-
className:
|
|
1133
|
+
className: b`
|
|
1134
1134
|
background-color: transparent;
|
|
1135
1135
|
border-style: none;
|
|
1136
1136
|
text-align: center;
|
|
@@ -1145,8 +1145,8 @@ const St = ot({
|
|
|
1145
1145
|
}
|
|
1146
1146
|
`,
|
|
1147
1147
|
value: v,
|
|
1148
|
-
onChange: (
|
|
1149
|
-
D(
|
|
1148
|
+
onChange: (f) => {
|
|
1149
|
+
D(f.target.value);
|
|
1150
1150
|
},
|
|
1151
1151
|
onBlur: () => {
|
|
1152
1152
|
e && x(e.id, {
|
|
@@ -1160,7 +1160,7 @@ const St = ot({
|
|
|
1160
1160
|
closable: !1,
|
|
1161
1161
|
className: k(
|
|
1162
1162
|
"group-item-modal",
|
|
1163
|
-
|
|
1163
|
+
b`
|
|
1164
1164
|
.rc-dialog-content {
|
|
1165
1165
|
background-color: transparent;
|
|
1166
1166
|
box-shadow: none;
|
|
@@ -1177,7 +1177,7 @@ const St = ot({
|
|
|
1177
1177
|
.rc-dialog-body {
|
|
1178
1178
|
background-color: ${c.groupItemModalBackgroundColor};
|
|
1179
1179
|
@media (prefers-color-scheme: dark) {
|
|
1180
|
-
background-color: ${
|
|
1180
|
+
background-color: ${g.groupItemModalBackgroundColor};
|
|
1181
1181
|
}
|
|
1182
1182
|
border-radius: 0.5rem;
|
|
1183
1183
|
overflow: hidden;
|
|
@@ -1190,21 +1190,21 @@ const St = ot({
|
|
|
1190
1190
|
children: /* @__PURE__ */ t(
|
|
1191
1191
|
"div",
|
|
1192
1192
|
{
|
|
1193
|
-
className:
|
|
1193
|
+
className: b`
|
|
1194
1194
|
overflow-y: auto;
|
|
1195
1195
|
max-height: 60vh;
|
|
1196
1196
|
padding: 1.25rem 0;
|
|
1197
1197
|
`,
|
|
1198
|
-
onDragLeave: (
|
|
1199
|
-
const I =
|
|
1200
|
-
I && (
|
|
1198
|
+
onDragLeave: (f) => {
|
|
1199
|
+
const I = f.relatedTarget;
|
|
1200
|
+
I && (f.currentTarget.contains(I) || setTimeout(() => {
|
|
1201
1201
|
o();
|
|
1202
1202
|
}, 500));
|
|
1203
1203
|
},
|
|
1204
1204
|
children: /* @__PURE__ */ t(
|
|
1205
|
-
|
|
1205
|
+
He,
|
|
1206
1206
|
{
|
|
1207
|
-
className:
|
|
1207
|
+
className: b`
|
|
1208
1208
|
display: grid;
|
|
1209
1209
|
gap: 1rem;
|
|
1210
1210
|
place-items: center;
|
|
@@ -1216,28 +1216,28 @@ const St = ot({
|
|
|
1216
1216
|
animation: 150,
|
|
1217
1217
|
fallbackOnBody: !0,
|
|
1218
1218
|
list: (e == null ? void 0 : e.children) ?? [],
|
|
1219
|
-
setList: (
|
|
1220
|
-
var
|
|
1221
|
-
const I =
|
|
1222
|
-
I.length === (y == null ? void 0 : y.length) && I.every((S, T) => S === y[T]) || I.length < ((y == null ? void 0 : y.length) ?? 0) || s(
|
|
1219
|
+
setList: (f) => {
|
|
1220
|
+
var N, u;
|
|
1221
|
+
const I = f.map((S) => S.id), y = (u = (N = n.find((S) => S.id === (e == null ? void 0 : e.id))) == null ? void 0 : N.children) == null ? void 0 : u.map((S) => S.id);
|
|
1222
|
+
I.length === (y == null ? void 0 : y.length) && I.every((S, T) => S === y[T]) || I.length < ((y == null ? void 0 : y.length) ?? 0) || s(f, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
|
|
1223
1223
|
},
|
|
1224
1224
|
onMove: () => (p(null), i("onMove"), !0),
|
|
1225
|
-
onStart: (
|
|
1226
|
-
const I =
|
|
1225
|
+
onStart: (f) => {
|
|
1226
|
+
const I = f.item.dataset;
|
|
1227
1227
|
I != null && I.id && d(I.id), i("onMove");
|
|
1228
1228
|
},
|
|
1229
1229
|
onEnd: () => {
|
|
1230
1230
|
d(null), p(null), i(null);
|
|
1231
1231
|
},
|
|
1232
|
-
ghostClass:
|
|
1233
|
-
children:
|
|
1234
|
-
|
|
1232
|
+
ghostClass: Lt,
|
|
1233
|
+
children: h.map((f, I) => /* @__PURE__ */ t(
|
|
1234
|
+
Ge,
|
|
1235
1235
|
{
|
|
1236
|
-
data:
|
|
1236
|
+
data: f,
|
|
1237
1237
|
itemIndex: I,
|
|
1238
1238
|
onClick: a
|
|
1239
1239
|
},
|
|
1240
|
-
|
|
1240
|
+
f.id
|
|
1241
1241
|
))
|
|
1242
1242
|
}
|
|
1243
1243
|
)
|
|
@@ -1249,7 +1249,7 @@ const St = ot({
|
|
|
1249
1249
|
var a;
|
|
1250
1250
|
const { data: e, onClose: o } = r;
|
|
1251
1251
|
return /* @__PURE__ */ t(
|
|
1252
|
-
|
|
1252
|
+
yt,
|
|
1253
1253
|
{
|
|
1254
1254
|
visible: !!e,
|
|
1255
1255
|
onClose: () => {
|
|
@@ -1269,7 +1269,7 @@ const St = ot({
|
|
|
1269
1269
|
] })
|
|
1270
1270
|
}
|
|
1271
1271
|
);
|
|
1272
|
-
},
|
|
1272
|
+
}, At = (r) => {
|
|
1273
1273
|
const {
|
|
1274
1274
|
pagination: e = { position: "bottom" },
|
|
1275
1275
|
className: o,
|
|
@@ -1281,14 +1281,14 @@ const St = ot({
|
|
|
1281
1281
|
setList: x,
|
|
1282
1282
|
setListStatus: l,
|
|
1283
1283
|
showInfoItemData: c,
|
|
1284
|
-
setShowInfoItemData:
|
|
1284
|
+
setShowInfoItemData: g,
|
|
1285
1285
|
openGroupItemData: v,
|
|
1286
1286
|
setOpenGroupItemData: D,
|
|
1287
|
-
setMoveItemId:
|
|
1288
|
-
setMoveTargetId:
|
|
1287
|
+
setMoveItemId: h,
|
|
1288
|
+
setMoveTargetId: f,
|
|
1289
1289
|
addItem: I
|
|
1290
|
-
} = pe(), { pagingDotBuilder: y, pagingDotsBuilder:
|
|
1291
|
-
top:
|
|
1290
|
+
} = pe(), { pagingDotBuilder: y, pagingDotsBuilder: N, itemBuilder: u } = le(), S = he(() => e === !1 ? {} : {
|
|
1291
|
+
top: b`
|
|
1292
1292
|
display: flex;
|
|
1293
1293
|
flex-direction: column;
|
|
1294
1294
|
.slick-list {
|
|
@@ -1298,12 +1298,12 @@ const St = ot({
|
|
|
1298
1298
|
position: static;
|
|
1299
1299
|
}
|
|
1300
1300
|
`,
|
|
1301
|
-
bottom:
|
|
1301
|
+
bottom: b`
|
|
1302
1302
|
.slick-dots {
|
|
1303
1303
|
position: static;
|
|
1304
1304
|
}
|
|
1305
1305
|
`,
|
|
1306
|
-
left:
|
|
1306
|
+
left: b`
|
|
1307
1307
|
.slick-dots {
|
|
1308
1308
|
position: absolute;
|
|
1309
1309
|
width: auto;
|
|
@@ -1319,7 +1319,7 @@ const St = ot({
|
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
`,
|
|
1322
|
-
right:
|
|
1322
|
+
right: b`
|
|
1323
1323
|
.slick-dots {
|
|
1324
1324
|
position: absolute;
|
|
1325
1325
|
width: auto;
|
|
@@ -1350,7 +1350,7 @@ const St = ot({
|
|
|
1350
1350
|
lazyLoad: "anticipated",
|
|
1351
1351
|
className: k(
|
|
1352
1352
|
S,
|
|
1353
|
-
|
|
1353
|
+
b`
|
|
1354
1354
|
.slick-track {
|
|
1355
1355
|
display: flex;
|
|
1356
1356
|
align-items: stretch;
|
|
@@ -1369,13 +1369,13 @@ const St = ot({
|
|
|
1369
1369
|
o
|
|
1370
1370
|
),
|
|
1371
1371
|
customPaging: (T) => {
|
|
1372
|
-
var
|
|
1372
|
+
var w, C;
|
|
1373
1373
|
if (y) {
|
|
1374
|
-
const
|
|
1375
|
-
return Jt.cloneElement(
|
|
1376
|
-
onDragEnter: (
|
|
1374
|
+
const $ = y(p[T], T);
|
|
1375
|
+
return Jt.cloneElement($, {
|
|
1376
|
+
onDragEnter: (U) => {
|
|
1377
1377
|
var _;
|
|
1378
|
-
(_ = (n ?? i).current) == null || _.slickGoTo(T),
|
|
1378
|
+
(_ = (n ?? i).current) == null || _.slickGoTo(T), $.props && $.props.onDragEnter && $.props.onDragEnter(U);
|
|
1379
1379
|
}
|
|
1380
1380
|
});
|
|
1381
1381
|
}
|
|
@@ -1383,20 +1383,20 @@ const St = ot({
|
|
|
1383
1383
|
"div",
|
|
1384
1384
|
{
|
|
1385
1385
|
onDragEnter: () => {
|
|
1386
|
-
var
|
|
1387
|
-
(
|
|
1386
|
+
var $;
|
|
1387
|
+
($ = (n ?? i).current) == null || $.slickGoTo(T);
|
|
1388
1388
|
},
|
|
1389
|
-
children: (
|
|
1389
|
+
children: (C = (w = p[T]) == null ? void 0 : w.data) == null ? void 0 : C.name
|
|
1390
1390
|
}
|
|
1391
1391
|
);
|
|
1392
1392
|
},
|
|
1393
|
-
appendDots: (T) =>
|
|
1393
|
+
appendDots: (T) => N ? N(T) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
1394
1394
|
"ul",
|
|
1395
1395
|
{
|
|
1396
1396
|
ref: d,
|
|
1397
1397
|
className: k(
|
|
1398
1398
|
"slick-dots-default",
|
|
1399
|
-
|
|
1399
|
+
b`
|
|
1400
1400
|
padding: 0.5rem;
|
|
1401
1401
|
display: inline-flex;
|
|
1402
1402
|
justify-content: center;
|
|
@@ -1424,24 +1424,24 @@ const St = ot({
|
|
|
1424
1424
|
children: p.map((T) => /* @__PURE__ */ t(
|
|
1425
1425
|
"div",
|
|
1426
1426
|
{
|
|
1427
|
-
onDrop: (
|
|
1428
|
-
|
|
1429
|
-
const
|
|
1430
|
-
if (
|
|
1427
|
+
onDrop: (w) => {
|
|
1428
|
+
w.preventDefault();
|
|
1429
|
+
const C = w.dataTransfer.getData("text/plain");
|
|
1430
|
+
if (V.quickJSONCheck(C))
|
|
1431
1431
|
try {
|
|
1432
|
-
I(JSON.parse(
|
|
1433
|
-
} catch (
|
|
1434
|
-
console.log("drag error",
|
|
1432
|
+
I(JSON.parse(C), [T.id]);
|
|
1433
|
+
} catch (U) {
|
|
1434
|
+
console.log("drag error", U);
|
|
1435
1435
|
}
|
|
1436
1436
|
},
|
|
1437
|
-
onDragOver: (
|
|
1438
|
-
|
|
1437
|
+
onDragOver: (w) => {
|
|
1438
|
+
w.preventDefault();
|
|
1439
1439
|
},
|
|
1440
1440
|
children: /* @__PURE__ */ t(
|
|
1441
|
-
|
|
1441
|
+
He,
|
|
1442
1442
|
{
|
|
1443
1443
|
className: k(
|
|
1444
|
-
|
|
1444
|
+
b`
|
|
1445
1445
|
display: grid;
|
|
1446
1446
|
transition: all 0.3s;
|
|
1447
1447
|
grid-template-columns: repeat(auto-fill, 96px);
|
|
@@ -1457,52 +1457,52 @@ const St = ot({
|
|
|
1457
1457
|
swapThreshold: 0.65,
|
|
1458
1458
|
group: "nested",
|
|
1459
1459
|
list: T.children ?? [],
|
|
1460
|
-
setList: (
|
|
1460
|
+
setList: (w) => x(w, [T.id]),
|
|
1461
1461
|
filter: ".drag-disabled",
|
|
1462
|
-
onMove: (
|
|
1462
|
+
onMove: (w) => {
|
|
1463
1463
|
l("onMove");
|
|
1464
|
-
const { dragged:
|
|
1465
|
-
return
|
|
1464
|
+
const { dragged: C, related: $ } = w, U = C.dataset, _ = $.dataset;
|
|
1465
|
+
return f(null), !((Object.keys(_).length === 0 || _.parentIds) && Number(U.childrenLength) > 0 && $.classList.contains("sortable-group-item"));
|
|
1466
1466
|
},
|
|
1467
|
-
onStart: (
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1467
|
+
onStart: (w) => {
|
|
1468
|
+
const C = w.item.dataset;
|
|
1469
|
+
C != null && C.id && h(C.id), l("onMove");
|
|
1470
1470
|
},
|
|
1471
1471
|
onEnd: () => {
|
|
1472
|
-
|
|
1472
|
+
h(null), f(null), l(null);
|
|
1473
1473
|
},
|
|
1474
|
-
ghostClass:
|
|
1475
|
-
children: (T.children ?? []).map((
|
|
1476
|
-
let
|
|
1474
|
+
ghostClass: Lt,
|
|
1475
|
+
children: (T.children ?? []).map((w, C) => {
|
|
1476
|
+
let $;
|
|
1477
1477
|
if (u)
|
|
1478
|
-
return u(
|
|
1479
|
-
switch (
|
|
1478
|
+
return u(w);
|
|
1479
|
+
switch (w.type) {
|
|
1480
1480
|
case "group":
|
|
1481
1481
|
case "app":
|
|
1482
|
-
|
|
1482
|
+
$ = /* @__PURE__ */ t(
|
|
1483
1483
|
Dn,
|
|
1484
1484
|
{
|
|
1485
|
-
data:
|
|
1486
|
-
itemIndex:
|
|
1487
|
-
parentIds: [T.id,
|
|
1485
|
+
data: w,
|
|
1486
|
+
itemIndex: C,
|
|
1487
|
+
parentIds: [T.id, w.id],
|
|
1488
1488
|
onClick: s
|
|
1489
1489
|
},
|
|
1490
|
-
|
|
1490
|
+
w.id
|
|
1491
1491
|
);
|
|
1492
1492
|
break;
|
|
1493
1493
|
default:
|
|
1494
|
-
|
|
1495
|
-
|
|
1494
|
+
$ = /* @__PURE__ */ t(
|
|
1495
|
+
Ge,
|
|
1496
1496
|
{
|
|
1497
|
-
data:
|
|
1498
|
-
itemIndex:
|
|
1497
|
+
data: w,
|
|
1498
|
+
itemIndex: C,
|
|
1499
1499
|
onClick: s
|
|
1500
1500
|
},
|
|
1501
|
-
|
|
1501
|
+
w.id
|
|
1502
1502
|
);
|
|
1503
1503
|
break;
|
|
1504
1504
|
}
|
|
1505
|
-
return
|
|
1505
|
+
return $;
|
|
1506
1506
|
})
|
|
1507
1507
|
}
|
|
1508
1508
|
)
|
|
@@ -1516,7 +1516,7 @@ const St = ot({
|
|
|
1516
1516
|
{
|
|
1517
1517
|
data: c,
|
|
1518
1518
|
onClose: () => {
|
|
1519
|
-
|
|
1519
|
+
g(null);
|
|
1520
1520
|
}
|
|
1521
1521
|
}
|
|
1522
1522
|
),
|
|
@@ -1531,7 +1531,7 @@ const St = ot({
|
|
|
1531
1531
|
}
|
|
1532
1532
|
)
|
|
1533
1533
|
] });
|
|
1534
|
-
}, Bn =
|
|
1534
|
+
}, Bn = at(
|
|
1535
1535
|
(r, e) => {
|
|
1536
1536
|
const {
|
|
1537
1537
|
list: o,
|
|
@@ -1544,32 +1544,32 @@ const St = ot({
|
|
|
1544
1544
|
contextMenuBuilder: x,
|
|
1545
1545
|
itemBuilder: l,
|
|
1546
1546
|
itemIconBuilder: c,
|
|
1547
|
-
pagingDotBuilder:
|
|
1547
|
+
pagingDotBuilder: g,
|
|
1548
1548
|
pagingDotsBuilder: v,
|
|
1549
1549
|
...D
|
|
1550
1550
|
} = r;
|
|
1551
|
-
return /* @__PURE__ */ t(
|
|
1551
|
+
return /* @__PURE__ */ t(Mt, { ...{
|
|
1552
1552
|
list: o,
|
|
1553
1553
|
onChange: a,
|
|
1554
1554
|
storageKey: n,
|
|
1555
1555
|
enableCaching: s
|
|
1556
|
-
}, children: /* @__PURE__ */ m(
|
|
1556
|
+
}, children: /* @__PURE__ */ m(It, { ...{
|
|
1557
1557
|
theme: i,
|
|
1558
1558
|
noLetters: d,
|
|
1559
1559
|
contextMenu: p,
|
|
1560
1560
|
pagingDotsBuilder: v,
|
|
1561
|
-
pagingDotBuilder:
|
|
1561
|
+
pagingDotBuilder: g,
|
|
1562
1562
|
itemBuilder: l,
|
|
1563
1563
|
itemIconBuilder: c,
|
|
1564
1564
|
contextMenuBuilder: x
|
|
1565
1565
|
}, children: [
|
|
1566
1566
|
/* @__PURE__ */ t(() => {
|
|
1567
|
-
const y = pe(),
|
|
1567
|
+
const y = pe(), N = le();
|
|
1568
1568
|
return ae(() => {
|
|
1569
|
-
e && (typeof e == "function" ? e({ state: y, config:
|
|
1570
|
-
}, [y,
|
|
1569
|
+
e && (typeof e == "function" ? e({ state: y, config: N }) : e.current = { state: y, config: N });
|
|
1570
|
+
}, [y, N]), null;
|
|
1571
1571
|
}, {}),
|
|
1572
|
-
/* @__PURE__ */ t(
|
|
1572
|
+
/* @__PURE__ */ t(At, { ...D })
|
|
1573
1573
|
] }) });
|
|
1574
1574
|
}
|
|
1575
1575
|
), zn = {
|
|
@@ -1695,7 +1695,7 @@ const St = ot({
|
|
|
1695
1695
|
zn
|
|
1696
1696
|
);
|
|
1697
1697
|
return typeof n != "string" ? e : o ? n.replace(/{{(.*?)}}/g, (s, i) => o[i]) : n;
|
|
1698
|
-
}, $n =
|
|
1698
|
+
}, $n = b`
|
|
1699
1699
|
--accentBase: var(--tomato-1);
|
|
1700
1700
|
--accentBgSubtle: var(--tomato-2);
|
|
1701
1701
|
--accentBg: var(--tomato-3);
|
|
@@ -1749,7 +1749,7 @@ const St = ot({
|
|
|
1749
1749
|
rgba(255, 255, 255, 0.05),
|
|
1750
1750
|
rgba(255, 255, 255, 0.05)
|
|
1751
1751
|
);
|
|
1752
|
-
`, Hn =
|
|
1752
|
+
`, Hn = b`
|
|
1753
1753
|
[class*="_toolbarRoot"] {
|
|
1754
1754
|
flex-wrap: wrap;
|
|
1755
1755
|
transition: all 0.3s;
|
|
@@ -1819,9 +1819,9 @@ const St = ot({
|
|
|
1819
1819
|
margin-bottom: 0;
|
|
1820
1820
|
}
|
|
1821
1821
|
}
|
|
1822
|
-
`,
|
|
1822
|
+
`, Dt = k(
|
|
1823
1823
|
"markdown-body",
|
|
1824
|
-
|
|
1824
|
+
b`
|
|
1825
1825
|
p {
|
|
1826
1826
|
margin-bottom: 8px;
|
|
1827
1827
|
}
|
|
@@ -1842,7 +1842,7 @@ const St = ot({
|
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
1844
|
`
|
|
1845
|
-
),
|
|
1845
|
+
), Rt = b`
|
|
1846
1846
|
.markdown-body {
|
|
1847
1847
|
/* light */
|
|
1848
1848
|
color-scheme: light;
|
|
@@ -1897,7 +1897,7 @@ const St = ot({
|
|
|
1897
1897
|
--color-prettylights-syntax-meta-diff-range: #8250df;
|
|
1898
1898
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
|
|
1899
1899
|
}
|
|
1900
|
-
`,
|
|
1900
|
+
`, Pt = b`
|
|
1901
1901
|
.markdown-body {
|
|
1902
1902
|
/* dark */
|
|
1903
1903
|
color-scheme: dark;
|
|
@@ -1952,7 +1952,7 @@ const St = ot({
|
|
|
1952
1952
|
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
|
|
1953
1953
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
|
|
1954
1954
|
}
|
|
1955
|
-
`,
|
|
1955
|
+
`, Ee = (r) => {
|
|
1956
1956
|
var e, o;
|
|
1957
1957
|
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
1958
|
}, On = (r) => {
|
|
@@ -1970,7 +1970,7 @@ const St = ot({
|
|
|
1970
1970
|
viewMode: "rich-text"
|
|
1971
1971
|
},
|
|
1972
1972
|
headings: c,
|
|
1973
|
-
link:
|
|
1973
|
+
link: g,
|
|
1974
1974
|
codeBlock: v,
|
|
1975
1975
|
codeMirror: D = {
|
|
1976
1976
|
codeBlockLanguages: {
|
|
@@ -1981,10 +1981,10 @@ const St = ot({
|
|
|
1981
1981
|
"": "Unspecified"
|
|
1982
1982
|
}
|
|
1983
1983
|
},
|
|
1984
|
-
directives:
|
|
1984
|
+
directives: h = {
|
|
1985
1985
|
directiveDescriptors: [Io]
|
|
1986
1986
|
}
|
|
1987
|
-
} = n ?? {}, [
|
|
1987
|
+
} = n ?? {}, [f, I] = O("");
|
|
1988
1988
|
return ae(() => {
|
|
1989
1989
|
var y;
|
|
1990
1990
|
e !== void 0 && p.current && ((y = p.current) == null || y.setMarkdown(e), I(e));
|
|
@@ -1994,12 +1994,12 @@ const St = ot({
|
|
|
1994
1994
|
ref: p,
|
|
1995
1995
|
className: k(
|
|
1996
1996
|
Hn,
|
|
1997
|
-
|
|
1998
|
-
|
|
1997
|
+
Ee(i) ? $n : "",
|
|
1998
|
+
Ee(i) ? Pt : Rt,
|
|
1999
1999
|
s
|
|
2000
2000
|
),
|
|
2001
|
-
contentEditableClassName:
|
|
2002
|
-
markdown:
|
|
2001
|
+
contentEditableClassName: Dt,
|
|
2002
|
+
markdown: f,
|
|
2003
2003
|
onChange: (y) => {
|
|
2004
2004
|
!e && !o && I(y), o && o(y);
|
|
2005
2005
|
},
|
|
@@ -2031,7 +2031,7 @@ const St = ot({
|
|
|
2031
2031
|
Lo(),
|
|
2032
2032
|
Ao(),
|
|
2033
2033
|
Do(c),
|
|
2034
|
-
Ro(
|
|
2034
|
+
Ro(g),
|
|
2035
2035
|
Po(),
|
|
2036
2036
|
Bo(x),
|
|
2037
2037
|
zo(),
|
|
@@ -2040,21 +2040,21 @@ const St = ot({
|
|
|
2040
2040
|
Ho(v),
|
|
2041
2041
|
Oo(D),
|
|
2042
2042
|
Fo(),
|
|
2043
|
-
_o(
|
|
2043
|
+
_o(h)
|
|
2044
2044
|
],
|
|
2045
2045
|
...d
|
|
2046
2046
|
}
|
|
2047
2047
|
);
|
|
2048
|
-
},
|
|
2048
|
+
}, Bt = (r) => {
|
|
2049
2049
|
const { children: e = "", className: o, theme: a = "auto", imageProps: n } = r;
|
|
2050
2050
|
return /* @__PURE__ */ t(
|
|
2051
2051
|
"div",
|
|
2052
2052
|
{
|
|
2053
|
-
className:
|
|
2053
|
+
className: Ee(a) ? Pt : Rt,
|
|
2054
2054
|
children: /* @__PURE__ */ t(
|
|
2055
|
-
|
|
2055
|
+
vt,
|
|
2056
2056
|
{
|
|
2057
|
-
className: k(
|
|
2057
|
+
className: k(Dt, o),
|
|
2058
2058
|
remarkPlugins: [er, tr],
|
|
2059
2059
|
rehypePlugins: [or],
|
|
2060
2060
|
components: {
|
|
@@ -2093,7 +2093,7 @@ const St = ot({
|
|
|
2093
2093
|
mask: " ",
|
|
2094
2094
|
...i
|
|
2095
2095
|
},
|
|
2096
|
-
className:
|
|
2096
|
+
className: b`
|
|
2097
2097
|
cursor: zoom-in;
|
|
2098
2098
|
`,
|
|
2099
2099
|
...d
|
|
@@ -2106,12 +2106,12 @@ const St = ot({
|
|
|
2106
2106
|
)
|
|
2107
2107
|
}
|
|
2108
2108
|
);
|
|
2109
|
-
},
|
|
2110
|
-
|
|
2111
|
-
function
|
|
2109
|
+
}, zt = On;
|
|
2110
|
+
zt.Preview = Bt;
|
|
2111
|
+
function ye(...r) {
|
|
2112
2112
|
return ir(sr(r));
|
|
2113
2113
|
}
|
|
2114
|
-
const
|
|
2114
|
+
const qe = (r) => {
|
|
2115
2115
|
const {
|
|
2116
2116
|
mouseX: e,
|
|
2117
2117
|
title: o,
|
|
@@ -2119,91 +2119,100 @@ const Ge = (r) => {
|
|
|
2119
2119
|
href: n,
|
|
2120
2120
|
children: s,
|
|
2121
2121
|
as: i = R.div,
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
x,
|
|
2122
|
+
componentClassName: d = "rounded-full bg-gray-200 dark:bg-neutral-800",
|
|
2123
|
+
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
|
+
childrenClassName: x,
|
|
2125
|
+
...l
|
|
2126
|
+
} = r, c = be(null), g = xe(e, (C) => {
|
|
2127
|
+
var U;
|
|
2128
|
+
const $ = ((U = c.current) == null ? void 0 : U.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
2129
|
+
return C - $.x - $.width / 2;
|
|
2130
|
+
}), v = xe(g, [-150, 0, 150], [40, 80, 40]), D = xe(g, [-150, 0, 150], [40, 80, 40]), h = xe(
|
|
2131
|
+
g,
|
|
2129
2132
|
[-150, 0, 150],
|
|
2130
2133
|
[20, 40, 20]
|
|
2131
|
-
),
|
|
2132
|
-
|
|
2134
|
+
), f = xe(
|
|
2135
|
+
g,
|
|
2133
2136
|
[-150, 0, 150],
|
|
2134
2137
|
[20, 40, 20]
|
|
2135
|
-
),
|
|
2138
|
+
), I = Me(v, {
|
|
2136
2139
|
mass: 0.1,
|
|
2137
2140
|
stiffness: 150,
|
|
2138
2141
|
damping: 12
|
|
2139
|
-
}),
|
|
2142
|
+
}), y = Me(D, {
|
|
2140
2143
|
mass: 0.1,
|
|
2141
2144
|
stiffness: 150,
|
|
2142
2145
|
damping: 12
|
|
2143
|
-
}),
|
|
2146
|
+
}), N = Me(h, {
|
|
2144
2147
|
mass: 0.1,
|
|
2145
2148
|
stiffness: 150,
|
|
2146
2149
|
damping: 12
|
|
2147
|
-
}),
|
|
2150
|
+
}), u = Me(f, {
|
|
2148
2151
|
mass: 0.1,
|
|
2149
2152
|
stiffness: 150,
|
|
2150
2153
|
damping: 12
|
|
2151
|
-
}), [
|
|
2154
|
+
}), [S, T] = O(!1), w = /* @__PURE__ */ m(
|
|
2152
2155
|
i,
|
|
2153
2156
|
{
|
|
2154
|
-
ref:
|
|
2155
|
-
style: { width:
|
|
2156
|
-
onMouseEnter: () =>
|
|
2157
|
-
onMouseLeave: () =>
|
|
2158
|
-
className:
|
|
2159
|
-
|
|
2157
|
+
ref: c,
|
|
2158
|
+
style: { width: I, height: y },
|
|
2159
|
+
onMouseEnter: () => T(!0),
|
|
2160
|
+
onMouseLeave: () => T(!1),
|
|
2161
|
+
className: ye(
|
|
2162
|
+
"aspect-square flex items-center justify-center relative",
|
|
2163
|
+
d
|
|
2164
|
+
),
|
|
2165
|
+
...l,
|
|
2160
2166
|
children: [
|
|
2161
|
-
o && /* @__PURE__ */ t(
|
|
2167
|
+
o && /* @__PURE__ */ t(Oe, { children: S && /* @__PURE__ */ t(
|
|
2162
2168
|
R.div,
|
|
2163
2169
|
{
|
|
2164
2170
|
initial: { opacity: 0, y: 10, x: "-50%" },
|
|
2165
2171
|
animate: { opacity: 1, y: 0, x: "-50%" },
|
|
2166
2172
|
exit: { opacity: 0, y: 2, x: "-50%" },
|
|
2167
|
-
className:
|
|
2173
|
+
className: ye(
|
|
2174
|
+
"px-2 py-0.5 whitespace-pre absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",
|
|
2175
|
+
p
|
|
2176
|
+
),
|
|
2168
2177
|
children: o
|
|
2169
2178
|
}
|
|
2170
2179
|
) }),
|
|
2171
2180
|
/* @__PURE__ */ t(
|
|
2172
2181
|
R.div,
|
|
2173
2182
|
{
|
|
2174
|
-
style: { width:
|
|
2175
|
-
className: "flex items-center justify-center",
|
|
2183
|
+
style: { width: N, height: u },
|
|
2184
|
+
className: ye("flex items-center justify-center", x),
|
|
2176
2185
|
children: s || a
|
|
2177
2186
|
}
|
|
2178
2187
|
)
|
|
2179
2188
|
]
|
|
2180
2189
|
}
|
|
2181
2190
|
);
|
|
2182
|
-
return n ? /* @__PURE__ */ t("a", { href: n }) :
|
|
2183
|
-
},
|
|
2191
|
+
return n ? /* @__PURE__ */ t("a", { href: n, children: w }) : w;
|
|
2192
|
+
}, Ye = (r) => {
|
|
2184
2193
|
const {
|
|
2185
2194
|
items: e = [],
|
|
2186
|
-
className: o,
|
|
2195
|
+
className: o = "rounded-2xl bg-gray-50 dark:bg-neutral-900",
|
|
2187
2196
|
itemBuilder: a,
|
|
2188
2197
|
children: n,
|
|
2189
2198
|
mouseX: s,
|
|
2190
2199
|
as: i = R.div
|
|
2191
|
-
} = r, d =
|
|
2200
|
+
} = r, d = st(1 / 0), p = s ?? d;
|
|
2192
2201
|
return /* @__PURE__ */ t(
|
|
2193
2202
|
i,
|
|
2194
2203
|
{
|
|
2195
2204
|
onMouseMove: (x) => p.set(x.pageX),
|
|
2196
2205
|
onMouseLeave: () => p.set(1 / 0),
|
|
2197
|
-
className:
|
|
2198
|
-
"mx-auto hidden md:flex h-16 gap-4 items-end
|
|
2206
|
+
className: ye(
|
|
2207
|
+
"mx-auto hidden md:flex h-16 gap-4 items-end px-4 pb-3",
|
|
2199
2208
|
o
|
|
2200
2209
|
),
|
|
2201
2210
|
children: n || e.map(
|
|
2202
|
-
(x) => a ? a(x, p) : /* @__PURE__ */ t(
|
|
2211
|
+
(x) => a ? a(x, p) : /* @__PURE__ */ t(qe, { mouseX: p, ...x }, x.title)
|
|
2203
2212
|
)
|
|
2204
2213
|
}
|
|
2205
2214
|
);
|
|
2206
|
-
},
|
|
2215
|
+
}, Re = (r) => {
|
|
2207
2216
|
const { title: e, icon: o, href: a, index: n, totalItems: s, children: i, ...d } = r;
|
|
2208
2217
|
return /* @__PURE__ */ t(
|
|
2209
2218
|
R.div,
|
|
@@ -2233,7 +2242,7 @@ const Ge = (r) => {
|
|
|
2233
2242
|
},
|
|
2234
2243
|
e
|
|
2235
2244
|
);
|
|
2236
|
-
},
|
|
2245
|
+
}, Ve = (r) => {
|
|
2237
2246
|
const {
|
|
2238
2247
|
items: e = [],
|
|
2239
2248
|
className: o,
|
|
@@ -2241,22 +2250,22 @@ const Ge = (r) => {
|
|
|
2241
2250
|
autoHidden: n = !1,
|
|
2242
2251
|
itemBuilder: s,
|
|
2243
2252
|
children: i
|
|
2244
|
-
} = r, [d, p] =
|
|
2253
|
+
} = r, [d, p] = O(!1), x = () => {
|
|
2245
2254
|
p(!d);
|
|
2246
2255
|
};
|
|
2247
2256
|
return /* @__PURE__ */ m(
|
|
2248
2257
|
"div",
|
|
2249
2258
|
{
|
|
2250
|
-
className:
|
|
2259
|
+
className: ye("relative block", n ? "md:hidden" : "", o),
|
|
2251
2260
|
children: [
|
|
2252
|
-
/* @__PURE__ */ t(
|
|
2261
|
+
/* @__PURE__ */ t(Oe, { children: d && /* @__PURE__ */ t(
|
|
2253
2262
|
R.div,
|
|
2254
2263
|
{
|
|
2255
2264
|
layoutId: "nav",
|
|
2256
2265
|
className: "absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",
|
|
2257
2266
|
children: i || e.map(
|
|
2258
2267
|
(l, c) => s ? /* @__PURE__ */ t(
|
|
2259
|
-
|
|
2268
|
+
Re,
|
|
2260
2269
|
{
|
|
2261
2270
|
...l,
|
|
2262
2271
|
index: c,
|
|
@@ -2265,7 +2274,7 @@ const Ge = (r) => {
|
|
|
2265
2274
|
},
|
|
2266
2275
|
l.title
|
|
2267
2276
|
) : /* @__PURE__ */ t(
|
|
2268
|
-
|
|
2277
|
+
Re,
|
|
2269
2278
|
{
|
|
2270
2279
|
...l,
|
|
2271
2280
|
index: c,
|
|
@@ -2301,7 +2310,7 @@ const Ge = (r) => {
|
|
|
2301
2310
|
} = r;
|
|
2302
2311
|
return /* @__PURE__ */ m(ue, { children: [
|
|
2303
2312
|
/* @__PURE__ */ t(
|
|
2304
|
-
|
|
2313
|
+
Ye,
|
|
2305
2314
|
{
|
|
2306
2315
|
items: e,
|
|
2307
2316
|
className: o,
|
|
@@ -2312,7 +2321,7 @@ const Ge = (r) => {
|
|
|
2312
2321
|
}
|
|
2313
2322
|
),
|
|
2314
2323
|
/* @__PURE__ */ t(
|
|
2315
|
-
|
|
2324
|
+
Ve,
|
|
2316
2325
|
{
|
|
2317
2326
|
items: e,
|
|
2318
2327
|
className: a,
|
|
@@ -2323,11 +2332,11 @@ const Ge = (r) => {
|
|
|
2323
2332
|
}
|
|
2324
2333
|
)
|
|
2325
2334
|
] });
|
|
2326
|
-
},
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2335
|
+
}, Ne = Fn;
|
|
2336
|
+
Ne.Desktop = Ye;
|
|
2337
|
+
Ne.DesktopItem = qe;
|
|
2338
|
+
Ne.Mobile = Ve;
|
|
2339
|
+
Ne.MobileItem = Re;
|
|
2331
2340
|
const _n = /* @__PURE__ */ Nn({
|
|
2332
2341
|
__proto__: null
|
|
2333
2342
|
}, [en]);
|
|
@@ -2362,7 +2371,7 @@ function Un(r) {
|
|
|
2362
2371
|
width: e.width
|
|
2363
2372
|
};
|
|
2364
2373
|
}
|
|
2365
|
-
function
|
|
2374
|
+
function Qe(r, e) {
|
|
2366
2375
|
const o = [
|
|
2367
2376
|
"li",
|
|
2368
2377
|
"p:not(:first-child)",
|
|
@@ -2383,7 +2392,7 @@ function Ze(r, e) {
|
|
|
2383
2392
|
}
|
|
2384
2393
|
);
|
|
2385
2394
|
}
|
|
2386
|
-
function
|
|
2395
|
+
function et(r, e, o) {
|
|
2387
2396
|
var n;
|
|
2388
2397
|
const a = r.getBoundingClientRect();
|
|
2389
2398
|
return (n = e.posAtCoords({
|
|
@@ -2391,7 +2400,7 @@ function Qe(r, e, o) {
|
|
|
2391
2400
|
top: a.top + 1
|
|
2392
2401
|
})) == null ? void 0 : n.inside;
|
|
2393
2402
|
}
|
|
2394
|
-
function
|
|
2403
|
+
function Ae(r, e) {
|
|
2395
2404
|
const o = e.state.doc.resolve(r);
|
|
2396
2405
|
return o.depth > 1 ? o.before(o.depth) : r;
|
|
2397
2406
|
}
|
|
@@ -2399,43 +2408,43 @@ function Gn(r) {
|
|
|
2399
2408
|
let e = "", o = !1;
|
|
2400
2409
|
function a(l, c) {
|
|
2401
2410
|
if (c.focus(), !l.dataTransfer) return;
|
|
2402
|
-
const
|
|
2411
|
+
const g = Qe(
|
|
2403
2412
|
{
|
|
2404
2413
|
x: l.clientX + 50 + r.dragHandleWidth,
|
|
2405
2414
|
y: l.clientY
|
|
2406
2415
|
},
|
|
2407
2416
|
r
|
|
2408
2417
|
);
|
|
2409
|
-
if (!(
|
|
2410
|
-
let v =
|
|
2418
|
+
if (!(g instanceof Element)) return;
|
|
2419
|
+
let v = et(g, c, r);
|
|
2411
2420
|
if (v == null || v < 0) return;
|
|
2412
|
-
v =
|
|
2413
|
-
const { from: D, to:
|
|
2421
|
+
v = Ae(v, c);
|
|
2422
|
+
const { from: D, to: h } = c.state.selection, f = D - h, I = Ae(D, c);
|
|
2414
2423
|
let y = !1;
|
|
2415
|
-
const
|
|
2416
|
-
if (
|
|
2424
|
+
const N = c.state.doc.resolve(I);
|
|
2425
|
+
if (N.node().type.name === "doc") y = !0;
|
|
2417
2426
|
else {
|
|
2418
|
-
const
|
|
2427
|
+
const C = J.create(
|
|
2419
2428
|
c.state.doc,
|
|
2420
|
-
|
|
2429
|
+
N.before()
|
|
2421
2430
|
);
|
|
2422
|
-
y = !(v + 1 >=
|
|
2431
|
+
y = !(v + 1 >= C.$from.pos && v <= C.$to.pos);
|
|
2423
2432
|
}
|
|
2424
2433
|
let u = c.state.selection;
|
|
2425
|
-
if (!y &&
|
|
2426
|
-
const
|
|
2434
|
+
if (!y && f !== 0 && !(c.state.selection instanceof J)) {
|
|
2435
|
+
const C = J.create(c.state.doc, h - 1);
|
|
2427
2436
|
u = Jr.create(
|
|
2428
2437
|
c.state.doc,
|
|
2429
2438
|
v,
|
|
2430
|
-
|
|
2439
|
+
C.$to.pos
|
|
2431
2440
|
);
|
|
2432
2441
|
} else if (u = J.create(c.state.doc, v), u.node.type.isInline || u.node.type.name === "tableRow") {
|
|
2433
|
-
const
|
|
2434
|
-
u = J.create(c.state.doc,
|
|
2442
|
+
const C = c.state.doc.resolve(u.from);
|
|
2443
|
+
u = J.create(c.state.doc, C.before());
|
|
2435
2444
|
}
|
|
2436
|
-
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof J && c.state.selection.node.type.name === "listItem" && (e =
|
|
2437
|
-
const S = c.state.selection.content(), { dom: T, text:
|
|
2438
|
-
l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", T.innerHTML), l.dataTransfer.setData("text/plain",
|
|
2445
|
+
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof J && c.state.selection.node.type.name === "listItem" && (e = g.parentElement.tagName);
|
|
2446
|
+
const S = c.state.selection.content(), { dom: T, text: w } = Xn(c, S);
|
|
2447
|
+
l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", T.innerHTML), l.dataTransfer.setData("text/plain", w), l.dataTransfer.effectAllowed = "copyMove", l.dataTransfer.setDragImage(g, 0, 0), c.dragging = { slice: S, move: l.ctrlKey };
|
|
2439
2448
|
}
|
|
2440
2449
|
let n = null;
|
|
2441
2450
|
function s() {
|
|
@@ -2445,14 +2454,14 @@ function Gn(r) {
|
|
|
2445
2454
|
n && n.classList.remove("hide");
|
|
2446
2455
|
}
|
|
2447
2456
|
function d(l, c) {
|
|
2448
|
-
const
|
|
2457
|
+
const g = Ae(c, l), v = J.create(l.state.doc, g);
|
|
2449
2458
|
l.dispatch(l.state.tr.setSelection(v)), l.focus(), o = !0;
|
|
2450
2459
|
}
|
|
2451
2460
|
function p(l) {
|
|
2452
2461
|
if (o = l.state.selection instanceof J, o && (n != null && n.dataset.nodePos)) {
|
|
2453
|
-
const
|
|
2462
|
+
const g = parseInt(n.dataset.nodePos, 10);
|
|
2454
2463
|
try {
|
|
2455
|
-
const v = l.state.doc.resolve(
|
|
2464
|
+
const v = l.state.doc.resolve(g);
|
|
2456
2465
|
v && v.parent && v.parent.type.name !== "doc" || (o = !1, s());
|
|
2457
2466
|
} catch {
|
|
2458
2467
|
o = !1, s();
|
|
@@ -2467,39 +2476,39 @@ function Gn(r) {
|
|
|
2467
2476
|
o || s();
|
|
2468
2477
|
return;
|
|
2469
2478
|
}
|
|
2470
|
-
const
|
|
2471
|
-
!
|
|
2479
|
+
const g = c.closest(".drag-handle") || c.classList.contains("drag-handle"), v = c.closest(".tiptap") || c.classList.contains("tiptap");
|
|
2480
|
+
!g && !v && !o && s();
|
|
2472
2481
|
}
|
|
2473
2482
|
return new Wr({
|
|
2474
2483
|
key: new Kr(r.pluginKey),
|
|
2475
2484
|
view: (l) => {
|
|
2476
|
-
var
|
|
2485
|
+
var h, f, I, y;
|
|
2477
2486
|
const c = r.dragHandleSelector ? document.querySelector(r.dragHandleSelector) : null;
|
|
2478
2487
|
n = c ?? document.createElement("div"), n.draggable = !0, n.dataset.dragHandle = "", n.classList.add("drag-handle");
|
|
2479
|
-
function
|
|
2480
|
-
a(
|
|
2488
|
+
function g(N) {
|
|
2489
|
+
a(N, l);
|
|
2481
2490
|
}
|
|
2482
|
-
n.addEventListener("dragstart",
|
|
2483
|
-
function v(
|
|
2484
|
-
c || (
|
|
2491
|
+
n.addEventListener("dragstart", g);
|
|
2492
|
+
function v(N) {
|
|
2493
|
+
c || (N.preventDefault(), N.stopPropagation());
|
|
2485
2494
|
const u = n == null ? void 0 : n.dataset.nodePos;
|
|
2486
2495
|
u && d(l, parseInt(u, 10));
|
|
2487
2496
|
}
|
|
2488
2497
|
n.addEventListener("click", v);
|
|
2489
|
-
function D(
|
|
2498
|
+
function D(N) {
|
|
2490
2499
|
s();
|
|
2491
2500
|
const u = window.scrollY;
|
|
2492
|
-
|
|
2501
|
+
N.clientY < r.scrollTreshold ? window.scrollTo({ top: u - 30, behavior: "smooth" }) : window.innerHeight - N.clientY < r.scrollTreshold && window.scrollTo({ top: u + 30, behavior: "smooth" });
|
|
2493
2502
|
}
|
|
2494
|
-
return n.addEventListener("drag", D), s(), c || (
|
|
2503
|
+
return n.addEventListener("drag", D), s(), c || (f = (h = l == null ? void 0 : l.dom) == null ? void 0 : h.parentElement) == null || f.appendChild(n), (y = (I = l == null ? void 0 : l.dom) == null ? void 0 : I.parentElement) == null || y.addEventListener(
|
|
2495
2504
|
"mouseout",
|
|
2496
2505
|
x
|
|
2497
2506
|
), {
|
|
2498
2507
|
destroy: () => {
|
|
2499
|
-
var
|
|
2500
|
-
c || (
|
|
2508
|
+
var N, u, S;
|
|
2509
|
+
c || (N = n == null ? void 0 : n.remove) == null || N.call(n), n == null || n.removeEventListener("drag", D), n == null || n.removeEventListener(
|
|
2501
2510
|
"dragstart",
|
|
2502
|
-
|
|
2511
|
+
g
|
|
2503
2512
|
), n == null || n.removeEventListener("click", v), n = null, (S = (u = l == null ? void 0 : l.dom) == null ? void 0 : u.parentElement) == null || S.removeEventListener(
|
|
2504
2513
|
"mouseout",
|
|
2505
2514
|
x
|
|
@@ -2512,23 +2521,23 @@ function Gn(r) {
|
|
|
2512
2521
|
mousemove: (l, c) => {
|
|
2513
2522
|
if (!l.editable)
|
|
2514
2523
|
return;
|
|
2515
|
-
const
|
|
2524
|
+
const g = Qe(
|
|
2516
2525
|
{
|
|
2517
2526
|
x: c.clientX + 50 + r.dragHandleWidth,
|
|
2518
2527
|
y: c.clientY
|
|
2519
2528
|
},
|
|
2520
2529
|
r
|
|
2521
|
-
), v =
|
|
2522
|
-
if (!(
|
|
2530
|
+
), v = g == null ? void 0 : g.closest(".not-draggable"), D = r.excludedTags.concat(["ol", "ul"]).join(", ");
|
|
2531
|
+
if (!(g instanceof Element) || g.matches(D) || v) {
|
|
2523
2532
|
o || s();
|
|
2524
2533
|
return;
|
|
2525
2534
|
}
|
|
2526
|
-
const
|
|
2527
|
-
|
|
2528
|
-
|
|
2535
|
+
const h = et(g, l, r);
|
|
2536
|
+
h != null && h >= 0 && (n.dataset.nodePos = String(
|
|
2537
|
+
Ae(h, l)
|
|
2529
2538
|
));
|
|
2530
|
-
const
|
|
2531
|
-
u.top += (y - 24) / 2, u.top +=
|
|
2539
|
+
const f = window.getComputedStyle(g), I = parseInt(f.lineHeight, 10), y = isNaN(I) ? parseInt(f.fontSize) * 1.2 : I, N = parseInt(f.paddingTop, 10), u = Un(g);
|
|
2540
|
+
u.top += (y - 24) / 2, u.top += N, g.matches("ul:not([data-type=taskList]) li, ol li") && (u.left -= r.dragHandleWidth - 28), u.width = r.dragHandleWidth, n && (n.style.position = "absolute", n.style.left = `${u.left - u.width}px`, n.style.top = `${u.top}px`, i());
|
|
2532
2541
|
},
|
|
2533
2542
|
keydown: () => {
|
|
2534
2543
|
o || s();
|
|
@@ -2545,19 +2554,19 @@ function Gn(r) {
|
|
|
2545
2554
|
l.dom.classList.add("dragging");
|
|
2546
2555
|
},
|
|
2547
2556
|
drop: (l, c) => {
|
|
2548
|
-
var
|
|
2557
|
+
var f;
|
|
2549
2558
|
l.dom.classList.remove("dragging"), s();
|
|
2550
|
-
let
|
|
2559
|
+
let g = null;
|
|
2551
2560
|
const v = l.posAtCoords({
|
|
2552
2561
|
left: c.clientX,
|
|
2553
2562
|
top: c.clientY
|
|
2554
2563
|
});
|
|
2555
|
-
if (!v || (l.state.selection instanceof J && (
|
|
2556
|
-
const
|
|
2557
|
-
if (l.state.selection instanceof J && l.state.selection.node.type.name === "listItem" && !
|
|
2558
|
-
const I = (
|
|
2564
|
+
if (!v || (l.state.selection instanceof J && (g = l.state.selection.node), !g)) return;
|
|
2565
|
+
const h = l.state.doc.resolve(v.pos).parent.type.name === "listItem";
|
|
2566
|
+
if (l.state.selection instanceof J && l.state.selection.node.type.name === "listItem" && !h && e == "OL") {
|
|
2567
|
+
const I = (f = l.state.schema.nodes.orderedList) == null ? void 0 : f.createAndFill(
|
|
2559
2568
|
null,
|
|
2560
|
-
|
|
2569
|
+
g
|
|
2561
2570
|
), y = new Zr(Qr.from(I), 0, 0);
|
|
2562
2571
|
l.dragging = { slice: y, move: c.ctrlKey };
|
|
2563
2572
|
}
|
|
@@ -2572,12 +2581,12 @@ function Gn(r) {
|
|
|
2572
2581
|
init() {
|
|
2573
2582
|
return {};
|
|
2574
2583
|
},
|
|
2575
|
-
apply(l, c,
|
|
2584
|
+
apply(l, c, g, v) {
|
|
2576
2585
|
if (l.docChanged && n && n.dataset.nodePos) {
|
|
2577
2586
|
const D = parseInt(n.dataset.nodePos, 10);
|
|
2578
2587
|
try {
|
|
2579
|
-
const
|
|
2580
|
-
(!
|
|
2588
|
+
const h = v.doc.resolve(D);
|
|
2589
|
+
(!h || h.parent.type.name === "doc") && (o = !1, s());
|
|
2581
2590
|
} catch {
|
|
2582
2591
|
o = !1, s();
|
|
2583
2592
|
}
|
|
@@ -2613,7 +2622,7 @@ const qn = Vr.create({
|
|
|
2613
2622
|
placeholder: "撰写任何内容,或者按“/”输入命令..."
|
|
2614
2623
|
}), Wn = cr.configure({
|
|
2615
2624
|
HTMLAttributes: {
|
|
2616
|
-
class:
|
|
2625
|
+
class: Y(
|
|
2617
2626
|
"text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
|
|
2618
2627
|
)
|
|
2619
2628
|
}
|
|
@@ -2621,63 +2630,63 @@ const qn = Vr.create({
|
|
|
2621
2630
|
addProseMirrorPlugins() {
|
|
2622
2631
|
return [
|
|
2623
2632
|
mr({
|
|
2624
|
-
imageClass:
|
|
2633
|
+
imageClass: Y("opacity-40 rounded-lg border border-stone-200")
|
|
2625
2634
|
})
|
|
2626
2635
|
];
|
|
2627
2636
|
}
|
|
2628
2637
|
}).configure({
|
|
2629
2638
|
allowBase64: !0,
|
|
2630
2639
|
HTMLAttributes: {
|
|
2631
|
-
class:
|
|
2640
|
+
class: Y("rounded-lg border border-muted")
|
|
2632
2641
|
}
|
|
2633
2642
|
}), Jn = ur.configure({
|
|
2634
2643
|
HTMLAttributes: {
|
|
2635
|
-
class:
|
|
2644
|
+
class: Y("rounded-lg border border-muted")
|
|
2636
2645
|
}
|
|
2637
2646
|
}), Zn = pr.configure({
|
|
2638
2647
|
HTMLAttributes: {
|
|
2639
|
-
class:
|
|
2648
|
+
class: Y("not-prose pl-2 ")
|
|
2640
2649
|
}
|
|
2641
2650
|
}), Qn = gr.configure({
|
|
2642
2651
|
HTMLAttributes: {
|
|
2643
|
-
class:
|
|
2652
|
+
class: Y("flex gap-2 items-start my-4")
|
|
2644
2653
|
},
|
|
2645
2654
|
nested: !0
|
|
2646
2655
|
}), ea = fr.configure({
|
|
2647
2656
|
HTMLAttributes: {
|
|
2648
|
-
class:
|
|
2657
|
+
class: Y("mt-4 mb-6 border-t border-muted-foreground")
|
|
2649
2658
|
}
|
|
2650
2659
|
}), ta = hr.configure({
|
|
2651
2660
|
bulletList: {
|
|
2652
2661
|
HTMLAttributes: {
|
|
2653
|
-
class:
|
|
2662
|
+
class: Y("list-disc list-outside leading-3 -mt-2")
|
|
2654
2663
|
}
|
|
2655
2664
|
},
|
|
2656
2665
|
orderedList: {
|
|
2657
2666
|
HTMLAttributes: {
|
|
2658
|
-
class:
|
|
2667
|
+
class: Y("list-decimal list-outside leading-3 -mt-2")
|
|
2659
2668
|
}
|
|
2660
2669
|
},
|
|
2661
2670
|
listItem: {
|
|
2662
2671
|
HTMLAttributes: {
|
|
2663
|
-
class:
|
|
2672
|
+
class: Y("leading-normal -mb-2")
|
|
2664
2673
|
}
|
|
2665
2674
|
},
|
|
2666
2675
|
blockquote: {
|
|
2667
2676
|
HTMLAttributes: {
|
|
2668
|
-
class:
|
|
2677
|
+
class: Y("border-l-4 border-primary")
|
|
2669
2678
|
}
|
|
2670
2679
|
},
|
|
2671
2680
|
codeBlock: {
|
|
2672
2681
|
HTMLAttributes: {
|
|
2673
|
-
class:
|
|
2682
|
+
class: Y(
|
|
2674
2683
|
"rounded-md bg-muted text-muted-foreground border p-5 font-mono font-medium"
|
|
2675
2684
|
)
|
|
2676
2685
|
}
|
|
2677
2686
|
},
|
|
2678
2687
|
code: {
|
|
2679
2688
|
HTMLAttributes: {
|
|
2680
|
-
class:
|
|
2689
|
+
class: Y("rounded-md bg-muted px-1.5 py-1 font-mono font-medium"),
|
|
2681
2690
|
spellcheck: "false"
|
|
2682
2691
|
}
|
|
2683
2692
|
},
|
|
@@ -2693,7 +2702,7 @@ const qn = Vr.create({
|
|
|
2693
2702
|
lowlight: qr(Yr)
|
|
2694
2703
|
}), ra = xr.configure({
|
|
2695
2704
|
HTMLAttributes: {
|
|
2696
|
-
class:
|
|
2705
|
+
class: Y("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
|
|
2697
2706
|
},
|
|
2698
2707
|
katexOptions: {
|
|
2699
2708
|
throwOnError: !1
|
|
@@ -2730,8 +2739,8 @@ const qn = Vr.create({
|
|
|
2730
2739
|
Nr,
|
|
2731
2740
|
Ir,
|
|
2732
2741
|
sa
|
|
2733
|
-
], ia =
|
|
2734
|
-
|
|
2742
|
+
], ia = ke.Root, $t = ke.Trigger, Pe = q.forwardRef(({ className: r, align: e = "center", sideOffset: o = 4, ...a }, n) => /* @__PURE__ */ t(ke.Portal, { children: /* @__PURE__ */ t(
|
|
2743
|
+
ke.Content,
|
|
2735
2744
|
{
|
|
2736
2745
|
ref: n,
|
|
2737
2746
|
align: e,
|
|
@@ -2743,7 +2752,7 @@ const qn = Vr.create({
|
|
|
2743
2752
|
...a
|
|
2744
2753
|
}
|
|
2745
2754
|
) }));
|
|
2746
|
-
|
|
2755
|
+
Pe.displayName = ke.Content.displayName;
|
|
2747
2756
|
const la = Gr(
|
|
2748
2757
|
"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",
|
|
2749
2758
|
{
|
|
@@ -2768,7 +2777,7 @@ const la = Gr(
|
|
|
2768
2777
|
size: "default"
|
|
2769
2778
|
}
|
|
2770
2779
|
}
|
|
2771
|
-
), Z =
|
|
2780
|
+
), Z = q.forwardRef(
|
|
2772
2781
|
({ className: r, variant: e, size: o, asChild: a = !1, ...n }, s) => /* @__PURE__ */ t(
|
|
2773
2782
|
a ? on : "button",
|
|
2774
2783
|
{
|
|
@@ -2779,7 +2788,7 @@ const la = Gr(
|
|
|
2779
2788
|
)
|
|
2780
2789
|
);
|
|
2781
2790
|
Z.displayName = "Button";
|
|
2782
|
-
const
|
|
2791
|
+
const tt = [
|
|
2783
2792
|
{
|
|
2784
2793
|
name: "默认",
|
|
2785
2794
|
// Default
|
|
@@ -2825,7 +2834,7 @@ const et = [
|
|
|
2825
2834
|
// Gray
|
|
2826
2835
|
color: "#A8A29E"
|
|
2827
2836
|
}
|
|
2828
|
-
],
|
|
2837
|
+
], ot = [
|
|
2829
2838
|
{
|
|
2830
2839
|
name: "默认背景",
|
|
2831
2840
|
// Default
|
|
@@ -2872,10 +2881,10 @@ const et = [
|
|
|
2872
2881
|
color: "var(--novel-highlight-gray)"
|
|
2873
2882
|
}
|
|
2874
2883
|
], me = (r) => /* @__PURE__ */ t(
|
|
2875
|
-
|
|
2884
|
+
it,
|
|
2876
2885
|
{
|
|
2877
2886
|
classNames: {
|
|
2878
|
-
root:
|
|
2887
|
+
root: b`
|
|
2879
2888
|
background-color: transparent;
|
|
2880
2889
|
padding: 0;
|
|
2881
2890
|
.rc-tooltip-content {
|
|
@@ -2890,9 +2899,9 @@ const et = [
|
|
|
2890
2899
|
), ca = ({ open: r, onOpenChange: e }) => {
|
|
2891
2900
|
const { editor: o } = Q();
|
|
2892
2901
|
if (!o) return null;
|
|
2893
|
-
const a =
|
|
2902
|
+
const a = tt.find(
|
|
2894
2903
|
({ color: s }) => o.isActive("textStyle", { color: s })
|
|
2895
|
-
), n =
|
|
2904
|
+
), n = ot.find(
|
|
2896
2905
|
({ color: s }) => o.isActive("highlight", { color: s })
|
|
2897
2906
|
);
|
|
2898
2907
|
return /* @__PURE__ */ m(ia, { modal: !0, open: r, onOpenChange: e, children: [
|
|
@@ -2908,10 +2917,10 @@ const et = [
|
|
|
2908
2917
|
children: "A"
|
|
2909
2918
|
}
|
|
2910
2919
|
),
|
|
2911
|
-
/* @__PURE__ */ t(
|
|
2920
|
+
/* @__PURE__ */ t(lt, {})
|
|
2912
2921
|
] }) }) }),
|
|
2913
2922
|
/* @__PURE__ */ m(
|
|
2914
|
-
|
|
2923
|
+
Pe,
|
|
2915
2924
|
{
|
|
2916
2925
|
sideOffset: 5,
|
|
2917
2926
|
className: "my-1 flex max-h-80 w-48 flex-col overflow-hidden overflow-y-auto rounded border p-1 shadow-xl ",
|
|
@@ -2919,8 +2928,8 @@ const et = [
|
|
|
2919
2928
|
children: [
|
|
2920
2929
|
/* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
2921
2930
|
/* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "颜色" }),
|
|
2922
|
-
|
|
2923
|
-
|
|
2931
|
+
tt.map(({ name: s, color: i }) => /* @__PURE__ */ m(
|
|
2932
|
+
De,
|
|
2924
2933
|
{
|
|
2925
2934
|
onSelect: () => {
|
|
2926
2935
|
o.commands.unsetColor(), s !== "Default" && o.chain().focus().setColor(i || "").run(), e(!1);
|
|
@@ -2938,7 +2947,7 @@ const et = [
|
|
|
2938
2947
|
),
|
|
2939
2948
|
/* @__PURE__ */ t("span", { children: s })
|
|
2940
2949
|
] }),
|
|
2941
|
-
o.isActive("textStyle", { color: i }) && /* @__PURE__ */ t(
|
|
2950
|
+
o.isActive("textStyle", { color: i }) && /* @__PURE__ */ t(ve, { size: 14 })
|
|
2942
2951
|
]
|
|
2943
2952
|
},
|
|
2944
2953
|
s
|
|
@@ -2946,8 +2955,8 @@ const et = [
|
|
|
2946
2955
|
] }),
|
|
2947
2956
|
/* @__PURE__ */ m("div", { children: [
|
|
2948
2957
|
/* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "背景 " }),
|
|
2949
|
-
|
|
2950
|
-
|
|
2958
|
+
ot.map(({ name: s, color: i }) => /* @__PURE__ */ m(
|
|
2959
|
+
De,
|
|
2951
2960
|
{
|
|
2952
2961
|
onSelect: () => {
|
|
2953
2962
|
o.commands.unsetHighlight(), s !== "Default" && o.chain().focus().setHighlight({ color: i }).run(), e(!1);
|
|
@@ -2965,7 +2974,7 @@ const et = [
|
|
|
2965
2974
|
),
|
|
2966
2975
|
/* @__PURE__ */ t("span", { children: s })
|
|
2967
2976
|
] }),
|
|
2968
|
-
o.isActive("highlight", { color: i }) && /* @__PURE__ */ t(
|
|
2977
|
+
o.isActive("highlight", { color: i }) && /* @__PURE__ */ t(ve, { size: 14 })
|
|
2969
2978
|
]
|
|
2970
2979
|
},
|
|
2971
2980
|
s
|
|
@@ -2997,7 +3006,7 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
2997
3006
|
return ae(() => {
|
|
2998
3007
|
var n;
|
|
2999
3008
|
(n = o.current) == null || n.focus();
|
|
3000
|
-
}), a ? /* @__PURE__ */ m(
|
|
3009
|
+
}), a ? /* @__PURE__ */ m(Ct, { modal: !0, open: r, onOpenChange: e, children: [
|
|
3001
3010
|
/* @__PURE__ */ t(me, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(tn, { asChild: !0, children: /* @__PURE__ */ m(
|
|
3002
3011
|
Z,
|
|
3003
3012
|
{
|
|
@@ -3021,7 +3030,7 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3021
3030
|
]
|
|
3022
3031
|
}
|
|
3023
3032
|
) }) }),
|
|
3024
|
-
/* @__PURE__ */ t(
|
|
3033
|
+
/* @__PURE__ */ t(Pe, { align: "start", className: "w-60 p-0", sideOffset: 10, children: /* @__PURE__ */ m(
|
|
3025
3034
|
"form",
|
|
3026
3035
|
{
|
|
3027
3036
|
onSubmit: (n) => {
|
|
@@ -3052,9 +3061,9 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3052
3061
|
onClick: () => {
|
|
3053
3062
|
a.chain().focus().unsetLink().run(), o.current.value = "", e(!1);
|
|
3054
3063
|
},
|
|
3055
|
-
children: /* @__PURE__ */ t(
|
|
3064
|
+
children: /* @__PURE__ */ t(ct, { className: "h-4 w-4" })
|
|
3056
3065
|
}
|
|
3057
|
-
) : /* @__PURE__ */ t(Z, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(
|
|
3066
|
+
) : /* @__PURE__ */ t(Z, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ve, { className: "h-4 w-4" }) })
|
|
3058
3067
|
]
|
|
3059
3068
|
}
|
|
3060
3069
|
) })
|
|
@@ -3085,80 +3094,80 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3085
3094
|
)
|
|
3086
3095
|
}
|
|
3087
3096
|
) }) : null;
|
|
3088
|
-
},
|
|
3097
|
+
}, $e = [
|
|
3089
3098
|
{
|
|
3090
3099
|
name: "正文",
|
|
3091
3100
|
// Text
|
|
3092
|
-
icon:
|
|
3101
|
+
icon: dt,
|
|
3093
3102
|
command: (r) => r.chain().focus().clearNodes().run(),
|
|
3094
3103
|
isActive: (r) => r.isActive("paragraph") && !r.isActive("bulletList") && !r.isActive("orderedList")
|
|
3095
3104
|
},
|
|
3096
3105
|
{
|
|
3097
3106
|
name: "标题 1",
|
|
3098
3107
|
// Heading 1
|
|
3099
|
-
icon:
|
|
3108
|
+
icon: mt,
|
|
3100
3109
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 1 }).run(),
|
|
3101
3110
|
isActive: (r) => r.isActive("heading", { level: 1 })
|
|
3102
3111
|
},
|
|
3103
3112
|
{
|
|
3104
3113
|
name: "标题 2",
|
|
3105
3114
|
// Heading 2
|
|
3106
|
-
icon:
|
|
3115
|
+
icon: ut,
|
|
3107
3116
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 2 }).run(),
|
|
3108
3117
|
isActive: (r) => r.isActive("heading", { level: 2 })
|
|
3109
3118
|
},
|
|
3110
3119
|
{
|
|
3111
3120
|
name: "标题 3",
|
|
3112
3121
|
// Heading 3
|
|
3113
|
-
icon:
|
|
3122
|
+
icon: pt,
|
|
3114
3123
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 3 }).run(),
|
|
3115
3124
|
isActive: (r) => r.isActive("heading", { level: 3 })
|
|
3116
3125
|
},
|
|
3117
3126
|
{
|
|
3118
3127
|
name: "待办列表",
|
|
3119
3128
|
// To-do List
|
|
3120
|
-
icon:
|
|
3129
|
+
icon: gt,
|
|
3121
3130
|
command: (r) => r.chain().focus().clearNodes().toggleTaskList().run(),
|
|
3122
3131
|
isActive: (r) => r.isActive("taskItem")
|
|
3123
3132
|
},
|
|
3124
3133
|
{
|
|
3125
3134
|
name: "无序列表",
|
|
3126
3135
|
// Bullet List
|
|
3127
|
-
icon:
|
|
3136
|
+
icon: ft,
|
|
3128
3137
|
command: (r) => r.chain().focus().clearNodes().toggleBulletList().run(),
|
|
3129
3138
|
isActive: (r) => r.isActive("bulletList")
|
|
3130
3139
|
},
|
|
3131
3140
|
{
|
|
3132
3141
|
name: "有序列表",
|
|
3133
3142
|
// Numbered List
|
|
3134
|
-
icon:
|
|
3143
|
+
icon: ht,
|
|
3135
3144
|
command: (r) => r.chain().focus().clearNodes().toggleOrderedList().run(),
|
|
3136
3145
|
isActive: (r) => r.isActive("orderedList")
|
|
3137
3146
|
},
|
|
3138
3147
|
{
|
|
3139
3148
|
name: "引用",
|
|
3140
3149
|
// Quote
|
|
3141
|
-
icon:
|
|
3150
|
+
icon: bt,
|
|
3142
3151
|
command: (r) => r.chain().focus().clearNodes().toggleBlockquote().run(),
|
|
3143
3152
|
isActive: (r) => r.isActive("blockquote")
|
|
3144
3153
|
},
|
|
3145
3154
|
{
|
|
3146
3155
|
name: "代码块",
|
|
3147
3156
|
// Code
|
|
3148
|
-
icon:
|
|
3157
|
+
icon: xt,
|
|
3149
3158
|
command: (r) => r.chain().focus().clearNodes().toggleCodeBlock().run(),
|
|
3150
3159
|
isActive: (r) => r.isActive("codeBlock")
|
|
3151
3160
|
}
|
|
3152
3161
|
], ga = ({ open: r, onOpenChange: e }) => {
|
|
3153
3162
|
const { editor: o } = Q();
|
|
3154
3163
|
if (!o) return null;
|
|
3155
|
-
const a =
|
|
3164
|
+
const a = $e.filter(
|
|
3156
3165
|
(n) => n.isActive(o)
|
|
3157
3166
|
).pop() ?? {
|
|
3158
3167
|
name: "多个选中"
|
|
3159
3168
|
// Multiple
|
|
3160
3169
|
};
|
|
3161
|
-
return /* @__PURE__ */ m(
|
|
3170
|
+
return /* @__PURE__ */ m(Ct, { modal: !0, open: r, onOpenChange: e, children: [
|
|
3162
3171
|
/* @__PURE__ */ t(me, { overlay: "转换成", placement: "top", children: /* @__PURE__ */ t(
|
|
3163
3172
|
$t,
|
|
3164
3173
|
{
|
|
@@ -3166,15 +3175,15 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3166
3175
|
className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
|
|
3167
3176
|
children: /* @__PURE__ */ m(Z, { size: "sm", variant: "ghost", children: [
|
|
3168
3177
|
/* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children: a.name }),
|
|
3169
|
-
/* @__PURE__ */ t(
|
|
3178
|
+
/* @__PURE__ */ t(lt, {})
|
|
3170
3179
|
] })
|
|
3171
3180
|
}
|
|
3172
3181
|
) }),
|
|
3173
|
-
/* @__PURE__ */ m(
|
|
3182
|
+
/* @__PURE__ */ m(Pe, { sideOffset: 5, align: "start", className: "w-48 p-1", children: [
|
|
3174
3183
|
/* @__PURE__ */ t("p", { className: "mb-2 text-sm text-secondary-foreground", children: "转换成" }),
|
|
3175
3184
|
" ",
|
|
3176
|
-
|
|
3177
|
-
|
|
3185
|
+
$e.map((n) => /* @__PURE__ */ m(
|
|
3186
|
+
De,
|
|
3178
3187
|
{
|
|
3179
3188
|
onSelect: (s) => {
|
|
3180
3189
|
n.command(s), e(!1);
|
|
@@ -3185,16 +3194,16 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3185
3194
|
/* @__PURE__ */ t("div", { className: "rounded-sm border p-1", children: /* @__PURE__ */ t(n.icon, { className: "h-3 w-3" }) }),
|
|
3186
3195
|
/* @__PURE__ */ t("span", { children: n.name })
|
|
3187
3196
|
] }),
|
|
3188
|
-
a.name === n.name && /* @__PURE__ */ t(
|
|
3197
|
+
a.name === n.name && /* @__PURE__ */ t(ve, { size: 14 })
|
|
3189
3198
|
]
|
|
3190
3199
|
},
|
|
3191
3200
|
n.name
|
|
3192
3201
|
))
|
|
3193
3202
|
] })
|
|
3194
3203
|
] });
|
|
3195
|
-
}, ge =
|
|
3204
|
+
}, ge = q.forwardRef(
|
|
3196
3205
|
({ className: r, orientation: e = "horizontal", decorative: o = !0, ...a }, n) => /* @__PURE__ */ t(
|
|
3197
|
-
|
|
3206
|
+
wt.Root,
|
|
3198
3207
|
{
|
|
3199
3208
|
ref: n,
|
|
3200
3209
|
decorative: o,
|
|
@@ -3208,12 +3217,12 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3208
3217
|
}
|
|
3209
3218
|
)
|
|
3210
3219
|
);
|
|
3211
|
-
ge.displayName =
|
|
3220
|
+
ge.displayName = wt.Root.displayName;
|
|
3212
3221
|
const fa = () => /* @__PURE__ */ m("div", { className: "flex items-center justify-center gap-0.5", children: [
|
|
3213
3222
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
|
|
3214
3223
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
|
|
3215
3224
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
|
|
3216
|
-
] }), Ht =
|
|
3225
|
+
] }), Ht = q.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__ */ m(
|
|
3217
3226
|
de.Root,
|
|
3218
3227
|
{
|
|
3219
3228
|
ref: a,
|
|
@@ -3227,7 +3236,7 @@ const fa = () => /* @__PURE__ */ m("div", { className: "flex items-center justif
|
|
|
3227
3236
|
}
|
|
3228
3237
|
));
|
|
3229
3238
|
Ht.displayName = de.Root.displayName;
|
|
3230
|
-
const Ot =
|
|
3239
|
+
const Ot = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, a) => /* @__PURE__ */ t(
|
|
3231
3240
|
de.ScrollAreaScrollbar,
|
|
3232
3241
|
{
|
|
3233
3242
|
ref: a,
|
|
@@ -3243,7 +3252,7 @@ const Ot = G.forwardRef(({ className: r, orientation: e = "vertical", ...o }, a)
|
|
|
3243
3252
|
}
|
|
3244
3253
|
));
|
|
3245
3254
|
Ot.displayName = de.ScrollAreaScrollbar.displayName;
|
|
3246
|
-
const ha = te.Portal, Ft =
|
|
3255
|
+
const ha = te.Portal, Ft = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3247
3256
|
te.Overlay,
|
|
3248
3257
|
{
|
|
3249
3258
|
ref: o,
|
|
@@ -3255,7 +3264,7 @@ const ha = te.Portal, Ft = G.forwardRef(({ className: r, ...e }, o) => /* @__PUR
|
|
|
3255
3264
|
}
|
|
3256
3265
|
));
|
|
3257
3266
|
Ft.displayName = te.Overlay.displayName;
|
|
3258
|
-
const ba =
|
|
3267
|
+
const ba = q.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__ */ m(ha, { children: [
|
|
3259
3268
|
/* @__PURE__ */ t(Ft, {}),
|
|
3260
3269
|
/* @__PURE__ */ m(
|
|
3261
3270
|
te.Content,
|
|
@@ -3277,7 +3286,7 @@ const ba = G.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__
|
|
|
3277
3286
|
)
|
|
3278
3287
|
] }));
|
|
3279
3288
|
ba.displayName = te.Content.displayName;
|
|
3280
|
-
const xa =
|
|
3289
|
+
const xa = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3281
3290
|
te.Title,
|
|
3282
3291
|
{
|
|
3283
3292
|
ref: o,
|
|
@@ -3289,7 +3298,7 @@ const xa = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3289
3298
|
}
|
|
3290
3299
|
));
|
|
3291
3300
|
xa.displayName = te.Title.displayName;
|
|
3292
|
-
const ya =
|
|
3301
|
+
const ya = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3293
3302
|
te.Description,
|
|
3294
3303
|
{
|
|
3295
3304
|
ref: o,
|
|
@@ -3298,8 +3307,8 @@ const ya = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3298
3307
|
}
|
|
3299
3308
|
));
|
|
3300
3309
|
ya.displayName = te.Description.displayName;
|
|
3301
|
-
const _t =
|
|
3302
|
-
|
|
3310
|
+
const _t = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3311
|
+
W,
|
|
3303
3312
|
{
|
|
3304
3313
|
ref: o,
|
|
3305
3314
|
className: k(
|
|
@@ -3309,11 +3318,11 @@ const _t = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3309
3318
|
...e
|
|
3310
3319
|
}
|
|
3311
3320
|
));
|
|
3312
|
-
_t.displayName =
|
|
3313
|
-
const jt =
|
|
3314
|
-
/* @__PURE__ */ t(
|
|
3321
|
+
_t.displayName = W.displayName;
|
|
3322
|
+
const jt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
|
|
3323
|
+
/* @__PURE__ */ t(Fe, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
|
|
3315
3324
|
/* @__PURE__ */ t(
|
|
3316
|
-
|
|
3325
|
+
W.Input,
|
|
3317
3326
|
{
|
|
3318
3327
|
ref: o,
|
|
3319
3328
|
className: k(
|
|
@@ -3324,27 +3333,27 @@ const jt = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div",
|
|
|
3324
3333
|
}
|
|
3325
3334
|
)
|
|
3326
3335
|
] }));
|
|
3327
|
-
jt.displayName =
|
|
3328
|
-
const va =
|
|
3329
|
-
|
|
3336
|
+
jt.displayName = W.Input.displayName;
|
|
3337
|
+
const va = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3338
|
+
W.List,
|
|
3330
3339
|
{
|
|
3331
3340
|
ref: o,
|
|
3332
3341
|
className: k("max-h-[300px] overflow-y-auto overflow-x-hidden", r),
|
|
3333
3342
|
...e
|
|
3334
3343
|
}
|
|
3335
3344
|
));
|
|
3336
|
-
va.displayName =
|
|
3337
|
-
const ka =
|
|
3338
|
-
|
|
3345
|
+
va.displayName = W.List.displayName;
|
|
3346
|
+
const ka = q.forwardRef((r, e) => /* @__PURE__ */ t(
|
|
3347
|
+
W.Empty,
|
|
3339
3348
|
{
|
|
3340
3349
|
ref: e,
|
|
3341
3350
|
className: "py-6 text-center text-sm",
|
|
3342
3351
|
...r
|
|
3343
3352
|
}
|
|
3344
3353
|
));
|
|
3345
|
-
ka.displayName =
|
|
3346
|
-
const
|
|
3347
|
-
|
|
3354
|
+
ka.displayName = W.Empty.displayName;
|
|
3355
|
+
const we = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3356
|
+
W.Group,
|
|
3348
3357
|
{
|
|
3349
3358
|
ref: o,
|
|
3350
3359
|
className: k(
|
|
@@ -3354,18 +3363,18 @@ const Ce = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3354
3363
|
...e
|
|
3355
3364
|
}
|
|
3356
3365
|
));
|
|
3357
|
-
|
|
3358
|
-
const
|
|
3359
|
-
|
|
3366
|
+
we.displayName = W.Group.displayName;
|
|
3367
|
+
const We = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3368
|
+
W.Separator,
|
|
3360
3369
|
{
|
|
3361
3370
|
ref: o,
|
|
3362
3371
|
className: k("-mx-1 h-px bg-border", r),
|
|
3363
3372
|
...e
|
|
3364
3373
|
}
|
|
3365
3374
|
));
|
|
3366
|
-
|
|
3367
|
-
const fe =
|
|
3368
|
-
|
|
3375
|
+
We.displayName = W.Separator.displayName;
|
|
3376
|
+
const fe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3377
|
+
W.Item,
|
|
3369
3378
|
{
|
|
3370
3379
|
ref: o,
|
|
3371
3380
|
className: k(
|
|
@@ -3375,14 +3384,14 @@ const fe = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3375
3384
|
...e
|
|
3376
3385
|
}
|
|
3377
3386
|
));
|
|
3378
|
-
fe.displayName =
|
|
3387
|
+
fe.displayName = W.Item.displayName;
|
|
3379
3388
|
const Ca = ({
|
|
3380
3389
|
completion: r,
|
|
3381
3390
|
onDiscard: e
|
|
3382
3391
|
}) => {
|
|
3383
3392
|
const { editor: o } = Q();
|
|
3384
3393
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3385
|
-
/* @__PURE__ */ m(
|
|
3394
|
+
/* @__PURE__ */ m(we, { children: [
|
|
3386
3395
|
/* @__PURE__ */ m(
|
|
3387
3396
|
fe,
|
|
3388
3397
|
{
|
|
@@ -3420,8 +3429,8 @@ const Ca = ({
|
|
|
3420
3429
|
}
|
|
3421
3430
|
)
|
|
3422
3431
|
] }),
|
|
3423
|
-
/* @__PURE__ */ t(
|
|
3424
|
-
/* @__PURE__ */ t(
|
|
3432
|
+
/* @__PURE__ */ t(We, {}),
|
|
3433
|
+
/* @__PURE__ */ t(we, { children: /* @__PURE__ */ m(fe, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
|
|
3425
3434
|
/* @__PURE__ */ t(ln, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3426
3435
|
"丢弃"
|
|
3427
3436
|
] }) })
|
|
@@ -3454,7 +3463,7 @@ const Ca = ({
|
|
|
3454
3463
|
], Na = ({ onSelect: r }) => {
|
|
3455
3464
|
const { editor: e } = Q();
|
|
3456
3465
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3457
|
-
/* @__PURE__ */ m(
|
|
3466
|
+
/* @__PURE__ */ m(we, { heading: "编辑或校对选中文本", children: [
|
|
3458
3467
|
" ",
|
|
3459
3468
|
wa.map((o) => /* @__PURE__ */ m(
|
|
3460
3469
|
fe,
|
|
@@ -3475,8 +3484,8 @@ const Ca = ({
|
|
|
3475
3484
|
o.value
|
|
3476
3485
|
))
|
|
3477
3486
|
] }),
|
|
3478
|
-
/* @__PURE__ */ t(
|
|
3479
|
-
/* @__PURE__ */ m(
|
|
3487
|
+
/* @__PURE__ */ t(We, {}),
|
|
3488
|
+
/* @__PURE__ */ m(we, { heading: "使用 AI 完成更多", children: [
|
|
3480
3489
|
" ",
|
|
3481
3490
|
/* @__PURE__ */ m(
|
|
3482
3491
|
fe,
|
|
@@ -3497,24 +3506,24 @@ const Ca = ({
|
|
|
3497
3506
|
] });
|
|
3498
3507
|
};
|
|
3499
3508
|
function Ia({ onOpenChange: r, options: e }) {
|
|
3500
|
-
const { editor: o } = Q(), [a, n] =
|
|
3509
|
+
const { editor: o } = Q(), [a, n] = O(""), { completion: s, complete: i, isLoading: d } = vn({
|
|
3501
3510
|
// id: "novel",
|
|
3502
3511
|
api: "/api/generate",
|
|
3503
3512
|
onResponse: (x) => {
|
|
3504
3513
|
if (x.status === 429) {
|
|
3505
|
-
|
|
3514
|
+
Ce.error("You have reached your request limit for the day.");
|
|
3506
3515
|
return;
|
|
3507
3516
|
}
|
|
3508
3517
|
},
|
|
3509
3518
|
onError: (x) => {
|
|
3510
|
-
|
|
3519
|
+
Ce.error(x.message);
|
|
3511
3520
|
},
|
|
3512
3521
|
...e
|
|
3513
3522
|
}), p = s.length > 0;
|
|
3514
3523
|
return /* @__PURE__ */ m(_t, { className: "w-[350px]", children: [
|
|
3515
|
-
p && /* @__PURE__ */ t("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ t(Ht, { children: /* @__PURE__ */ t("div", { className: "prose p-2 px-4 prose-sm", children: /* @__PURE__ */ t(
|
|
3524
|
+
p && /* @__PURE__ */ t("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ t(Ht, { children: /* @__PURE__ */ t("div", { className: "prose p-2 px-4 prose-sm", children: /* @__PURE__ */ t(vt, { children: s }) }) }) }),
|
|
3516
3525
|
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: [
|
|
3517
|
-
/* @__PURE__ */ t(
|
|
3526
|
+
/* @__PURE__ */ t(Fe, { size: 14, className: "mr-2 shrink-0" }),
|
|
3518
3527
|
"AI正在思考",
|
|
3519
3528
|
/* @__PURE__ */ t("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ t(fa, {}) })
|
|
3520
3529
|
] }),
|
|
@@ -3606,7 +3615,7 @@ const Sa = ({
|
|
|
3606
3615
|
onClick: () => o(!0),
|
|
3607
3616
|
size: "sm",
|
|
3608
3617
|
children: [
|
|
3609
|
-
/* @__PURE__ */ t(
|
|
3618
|
+
/* @__PURE__ */ t(Fe, { size: 14 }),
|
|
3610
3619
|
"询问AI"
|
|
3611
3620
|
]
|
|
3612
3621
|
}
|
|
@@ -3626,7 +3635,7 @@ const Sa = ({
|
|
|
3626
3635
|
body: r
|
|
3627
3636
|
});
|
|
3628
3637
|
return new Promise((o, a) => {
|
|
3629
|
-
|
|
3638
|
+
Ce.promise(
|
|
3630
3639
|
e.then(async (n) => {
|
|
3631
3640
|
if (n.status === 200) {
|
|
3632
3641
|
const { url: s } = await n.json(), i = new Image();
|
|
@@ -3642,9 +3651,9 @@ const Sa = ({
|
|
|
3642
3651
|
}
|
|
3643
3652
|
);
|
|
3644
3653
|
});
|
|
3645
|
-
}, Ma =
|
|
3654
|
+
}, Ma = kt({
|
|
3646
3655
|
onUpload: Ta,
|
|
3647
|
-
validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (
|
|
3656
|
+
validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (Ce.error("File size too big (max 20MB)."), !1) : !0 : (Ce.error("File type not supported."), !1)
|
|
3648
3657
|
}), La = () => {
|
|
3649
3658
|
const { editor: r } = Q();
|
|
3650
3659
|
return r ? /* @__PURE__ */ t("div", { className: "flex", children: [
|
|
@@ -3684,7 +3693,7 @@ const Sa = ({
|
|
|
3684
3693
|
icon: yn
|
|
3685
3694
|
}
|
|
3686
3695
|
].map((o) => /* @__PURE__ */ t(
|
|
3687
|
-
|
|
3696
|
+
De,
|
|
3688
3697
|
{
|
|
3689
3698
|
onSelect: (a) => {
|
|
3690
3699
|
o.command(a);
|
|
@@ -3716,7 +3725,7 @@ const Sa = ({
|
|
|
3716
3725
|
description: "从纯文本开始编写。",
|
|
3717
3726
|
// "Just start typing with plain text.",
|
|
3718
3727
|
searchTerms: ["p", "paragraph"],
|
|
3719
|
-
icon: /* @__PURE__ */ t(
|
|
3728
|
+
icon: /* @__PURE__ */ t(dt, { size: 18 }),
|
|
3720
3729
|
command: ({ editor: e, range: o }) => {
|
|
3721
3730
|
e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").run();
|
|
3722
3731
|
}
|
|
@@ -3727,7 +3736,7 @@ const Sa = ({
|
|
|
3727
3736
|
description: "大标题。",
|
|
3728
3737
|
// "Big section heading.",
|
|
3729
3738
|
searchTerms: ["title", "big", "large"],
|
|
3730
|
-
icon: /* @__PURE__ */ t(
|
|
3739
|
+
icon: /* @__PURE__ */ t(mt, { size: 18 }),
|
|
3731
3740
|
command: ({ editor: e, range: o }) => {
|
|
3732
3741
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 1 }).run();
|
|
3733
3742
|
}
|
|
@@ -3738,7 +3747,7 @@ const Sa = ({
|
|
|
3738
3747
|
description: "中标题。",
|
|
3739
3748
|
// "Medium section heading.",
|
|
3740
3749
|
searchTerms: ["subtitle", "medium"],
|
|
3741
|
-
icon: /* @__PURE__ */ t(
|
|
3750
|
+
icon: /* @__PURE__ */ t(ut, { size: 18 }),
|
|
3742
3751
|
command: ({ editor: e, range: o }) => {
|
|
3743
3752
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 2 }).run();
|
|
3744
3753
|
}
|
|
@@ -3749,7 +3758,7 @@ const Sa = ({
|
|
|
3749
3758
|
description: "小标题。",
|
|
3750
3759
|
// "Small section heading.",
|
|
3751
3760
|
searchTerms: ["subtitle", "small"],
|
|
3752
|
-
icon: /* @__PURE__ */ t(
|
|
3761
|
+
icon: /* @__PURE__ */ t(pt, { size: 18 }),
|
|
3753
3762
|
command: ({ editor: e, range: o }) => {
|
|
3754
3763
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 3 }).run();
|
|
3755
3764
|
}
|
|
@@ -3760,7 +3769,7 @@ const Sa = ({
|
|
|
3760
3769
|
description: "使用待办清单追踪任务。",
|
|
3761
3770
|
// "Track tasks with a to-do list.",
|
|
3762
3771
|
searchTerms: ["todo", "task", "list", "check", "checkbox"],
|
|
3763
|
-
icon: /* @__PURE__ */ t(
|
|
3772
|
+
icon: /* @__PURE__ */ t(gt, { size: 18 }),
|
|
3764
3773
|
command: ({ editor: e, range: o }) => {
|
|
3765
3774
|
e.chain().focus().deleteRange(o).toggleTaskList().run();
|
|
3766
3775
|
}
|
|
@@ -3771,7 +3780,7 @@ const Sa = ({
|
|
|
3771
3780
|
description: "创建一个简单的项目符号列表。",
|
|
3772
3781
|
// "Create a simple bullet list.",
|
|
3773
3782
|
searchTerms: ["unordered", "point"],
|
|
3774
|
-
icon: /* @__PURE__ */ t(
|
|
3783
|
+
icon: /* @__PURE__ */ t(ft, { size: 18 }),
|
|
3775
3784
|
command: ({ editor: e, range: o }) => {
|
|
3776
3785
|
e.chain().focus().deleteRange(o).toggleBulletList().run();
|
|
3777
3786
|
}
|
|
@@ -3782,7 +3791,7 @@ const Sa = ({
|
|
|
3782
3791
|
description: "创建一个带有序号的列表。",
|
|
3783
3792
|
// "Create a list with numbering.",
|
|
3784
3793
|
searchTerms: ["ordered"],
|
|
3785
|
-
icon: /* @__PURE__ */ t(
|
|
3794
|
+
icon: /* @__PURE__ */ t(ht, { size: 18 }),
|
|
3786
3795
|
command: ({ editor: e, range: o }) => {
|
|
3787
3796
|
e.chain().focus().deleteRange(o).toggleOrderedList().run();
|
|
3788
3797
|
}
|
|
@@ -3793,7 +3802,7 @@ const Sa = ({
|
|
|
3793
3802
|
description: "摘取引用。",
|
|
3794
3803
|
// "Capture a quote.",
|
|
3795
3804
|
searchTerms: ["blockquote"],
|
|
3796
|
-
icon: /* @__PURE__ */ t(
|
|
3805
|
+
icon: /* @__PURE__ */ t(bt, { size: 18 }),
|
|
3797
3806
|
command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").toggleBlockquote().run()
|
|
3798
3807
|
},
|
|
3799
3808
|
{
|
|
@@ -3802,7 +3811,7 @@ const Sa = ({
|
|
|
3802
3811
|
description: "捕获代码段。",
|
|
3803
3812
|
// "Capture a code snippet.",
|
|
3804
3813
|
searchTerms: ["codeblock"],
|
|
3805
|
-
icon: /* @__PURE__ */ t(
|
|
3814
|
+
icon: /* @__PURE__ */ t(xt, { size: 18 }),
|
|
3806
3815
|
command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleCodeBlock().run()
|
|
3807
3816
|
},
|
|
3808
3817
|
{
|
|
@@ -3832,16 +3841,16 @@ const Sa = ({
|
|
|
3832
3841
|
}), Da = {
|
|
3833
3842
|
type: "doc",
|
|
3834
3843
|
content: []
|
|
3835
|
-
}, Ut =
|
|
3844
|
+
}, Ut = at(({ children: r, items: e, ...o }, a) => {
|
|
3836
3845
|
const n = (i) => /* @__PURE__ */ m(
|
|
3837
|
-
|
|
3846
|
+
Le.Item,
|
|
3838
3847
|
{
|
|
3839
3848
|
onClick: i.onClick,
|
|
3840
3849
|
className: k(
|
|
3841
3850
|
"gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3842
3851
|
i.className
|
|
3843
3852
|
),
|
|
3844
|
-
itemIcon: i.isActive ? /* @__PURE__ */ t(
|
|
3853
|
+
itemIcon: i.isActive ? /* @__PURE__ */ t(ve, { size: 16 }) : void 0,
|
|
3845
3854
|
children: [
|
|
3846
3855
|
i.icon,
|
|
3847
3856
|
i.label,
|
|
@@ -3852,12 +3861,12 @@ const Sa = ({
|
|
|
3852
3861
|
), s = (i) => {
|
|
3853
3862
|
var d;
|
|
3854
3863
|
return /* @__PURE__ */ t(
|
|
3855
|
-
|
|
3864
|
+
Le.SubMenu,
|
|
3856
3865
|
{
|
|
3857
3866
|
expandIcon: /* @__PURE__ */ t(yo, { size: 16 }),
|
|
3858
3867
|
popupClassName: k(
|
|
3859
3868
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
|
|
3860
|
-
|
|
3869
|
+
b`
|
|
3861
3870
|
.rc-menu {
|
|
3862
3871
|
border: none !important;
|
|
3863
3872
|
box-shadow: none !important;
|
|
@@ -3867,7 +3876,7 @@ const Sa = ({
|
|
|
3867
3876
|
popupOffset: [4, 0],
|
|
3868
3877
|
className: k(
|
|
3869
3878
|
"gap-2 !p-0 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3870
|
-
|
|
3879
|
+
b`
|
|
3871
3880
|
.rc-menu-submenu-title {
|
|
3872
3881
|
display: flex;
|
|
3873
3882
|
align-items: center;
|
|
@@ -3897,11 +3906,11 @@ const Sa = ({
|
|
|
3897
3906
|
ref: a,
|
|
3898
3907
|
trigger: "click",
|
|
3899
3908
|
overlay: /* @__PURE__ */ t(
|
|
3900
|
-
|
|
3909
|
+
Le,
|
|
3901
3910
|
{
|
|
3902
3911
|
className: k(
|
|
3903
3912
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
|
|
3904
|
-
|
|
3913
|
+
b`
|
|
3905
3914
|
.rc-menu-submenu-active {
|
|
3906
3915
|
.rc-menu-submenu-title {
|
|
3907
3916
|
background-color: hsl(var(--accent)) !important;
|
|
@@ -3910,7 +3919,7 @@ const Sa = ({
|
|
|
3910
3919
|
`
|
|
3911
3920
|
),
|
|
3912
3921
|
...o,
|
|
3913
|
-
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(
|
|
3922
|
+
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(Le.Divider, { className: "!my-1" }, i.key) : i.type === "submenu" ? s(i) : n(i))
|
|
3914
3923
|
}
|
|
3915
3924
|
),
|
|
3916
3925
|
...o,
|
|
@@ -3931,7 +3940,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
3931
3940
|
content: d.content.toJSON()
|
|
3932
3941
|
}).focus().run();
|
|
3933
3942
|
}
|
|
3934
|
-
}, s =
|
|
3943
|
+
}, s = $e.map((d) => ({
|
|
3935
3944
|
key: `transform-${d.name}`,
|
|
3936
3945
|
icon: /* @__PURE__ */ t(d.icon, { size: 16 }),
|
|
3937
3946
|
label: d.name,
|
|
@@ -3957,7 +3966,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
3957
3966
|
{ key: "divider", type: "divider" },
|
|
3958
3967
|
{
|
|
3959
3968
|
key: "delete",
|
|
3960
|
-
icon: /* @__PURE__ */ t(
|
|
3969
|
+
icon: /* @__PURE__ */ t(ct, { size: 16 }),
|
|
3961
3970
|
label: "删除",
|
|
3962
3971
|
className: "text-red-500",
|
|
3963
3972
|
onClick: a
|
|
@@ -3979,7 +3988,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
3979
3988
|
{
|
|
3980
3989
|
className: k(
|
|
3981
3990
|
"custom-drag-handle",
|
|
3982
|
-
|
|
3991
|
+
b`
|
|
3983
3992
|
width: auto;
|
|
3984
3993
|
background: none;
|
|
3985
3994
|
display: flex;
|
|
@@ -4034,9 +4043,9 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4034
4043
|
editorRef: x,
|
|
4035
4044
|
enableAI: l = !1,
|
|
4036
4045
|
aiOptions: c
|
|
4037
|
-
} = r, [
|
|
4046
|
+
} = r, [g, v] = O(
|
|
4038
4047
|
o
|
|
4039
|
-
), [D,
|
|
4048
|
+
), [D, h] = O("Saved"), [f, I] = O(), [y, N] = O(!1), [u, S] = O(!1), [T, w] = O(!1), [C, $] = O(!1), U = (M) => {
|
|
4040
4049
|
const F = new DOMParser().parseFromString(M, "text/html");
|
|
4041
4050
|
return F.querySelectorAll("pre code").forEach((B) => {
|
|
4042
4051
|
kn.highlightElement(B);
|
|
@@ -4046,11 +4055,11 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4046
4055
|
const F = M.getJSON();
|
|
4047
4056
|
I(M.storage.characterCount.words()), a == null || a(F), s && (window.localStorage.setItem(
|
|
4048
4057
|
"html-content",
|
|
4049
|
-
|
|
4058
|
+
U(M.getHTML())
|
|
4050
4059
|
), window.localStorage.setItem(n, JSON.stringify(F)), window.localStorage.setItem(
|
|
4051
4060
|
"markdown",
|
|
4052
4061
|
M.storage.markdown.getMarkdown()
|
|
4053
|
-
),
|
|
4062
|
+
), h("Saved"));
|
|
4054
4063
|
},
|
|
4055
4064
|
500
|
|
4056
4065
|
), se = he(() => {
|
|
@@ -4061,15 +4070,15 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4061
4070
|
action: B,
|
|
4062
4071
|
headers: K,
|
|
4063
4072
|
method: re,
|
|
4064
|
-
name:
|
|
4065
|
-
onSuccess:
|
|
4066
|
-
onError:
|
|
4073
|
+
name: Be,
|
|
4074
|
+
onSuccess: Ie,
|
|
4075
|
+
onError: Se
|
|
4067
4076
|
} = p;
|
|
4068
|
-
return
|
|
4077
|
+
return kt({
|
|
4069
4078
|
onUpload: (ie) => {
|
|
4070
4079
|
const L = new FormData();
|
|
4071
|
-
L.append(
|
|
4072
|
-
const
|
|
4080
|
+
L.append(Be || "file", ie);
|
|
4081
|
+
const G = fetch(B, {
|
|
4073
4082
|
method: re || "POST",
|
|
4074
4083
|
headers: {
|
|
4075
4084
|
...K
|
|
@@ -4077,10 +4086,10 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4077
4086
|
body: L
|
|
4078
4087
|
});
|
|
4079
4088
|
return new Promise((j, E) => {
|
|
4080
|
-
|
|
4081
|
-
if (
|
|
4089
|
+
G.then(async (P) => {
|
|
4090
|
+
if (Ie) {
|
|
4082
4091
|
const z = await P.json();
|
|
4083
|
-
j(
|
|
4092
|
+
j(Ie(z));
|
|
4084
4093
|
return;
|
|
4085
4094
|
}
|
|
4086
4095
|
if (P.status === 200) {
|
|
@@ -4092,7 +4101,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4092
4101
|
"`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead."
|
|
4093
4102
|
)) : new Error("Error uploading image. Please try again.");
|
|
4094
4103
|
}).catch((P) => {
|
|
4095
|
-
|
|
4104
|
+
Se && Se(P), E(P);
|
|
4096
4105
|
});
|
|
4097
4106
|
});
|
|
4098
4107
|
},
|
|
@@ -4103,7 +4112,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4103
4112
|
if (!s) return;
|
|
4104
4113
|
const M = window.localStorage.getItem(n);
|
|
4105
4114
|
v(M ? JSON.parse(M) : Da);
|
|
4106
|
-
}, [n, s]), !
|
|
4115
|
+
}, [n, s]), !g) return null;
|
|
4107
4116
|
const oe = [
|
|
4108
4117
|
...Et,
|
|
4109
4118
|
Aa({
|
|
@@ -4116,9 +4125,9 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4116
4125
|
d && /* @__PURE__ */ m(
|
|
4117
4126
|
"div",
|
|
4118
4127
|
{
|
|
4119
|
-
className:
|
|
4128
|
+
className: f ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
|
|
4120
4129
|
children: [
|
|
4121
|
-
|
|
4130
|
+
f,
|
|
4122
4131
|
" Words"
|
|
4123
4132
|
]
|
|
4124
4133
|
}
|
|
@@ -4130,7 +4139,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4130
4139
|
onCreate: ({ editor: M }) => {
|
|
4131
4140
|
x && (x.current = M);
|
|
4132
4141
|
},
|
|
4133
|
-
initialContent:
|
|
4142
|
+
initialContent: g,
|
|
4134
4143
|
extensions: oe,
|
|
4135
4144
|
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",
|
|
4136
4145
|
editorProps: {
|
|
@@ -4144,7 +4153,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4144
4153
|
}
|
|
4145
4154
|
},
|
|
4146
4155
|
onUpdate: ({ editor: M }) => {
|
|
4147
|
-
_(M),
|
|
4156
|
+
_(M), h("Unsaved");
|
|
4148
4157
|
},
|
|
4149
4158
|
slotAfter: /* @__PURE__ */ t(jr, {}),
|
|
4150
4159
|
children: [
|
|
@@ -4172,15 +4181,15 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4172
4181
|
/* @__PURE__ */ m(
|
|
4173
4182
|
Sa,
|
|
4174
4183
|
{
|
|
4175
|
-
open:
|
|
4176
|
-
onOpenChange:
|
|
4184
|
+
open: C,
|
|
4185
|
+
onOpenChange: $,
|
|
4177
4186
|
enableAI: l,
|
|
4178
4187
|
aiOptions: c,
|
|
4179
4188
|
children: [
|
|
4180
4189
|
l && /* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
4181
|
-
/* @__PURE__ */ t(ga, { open: y, onOpenChange:
|
|
4190
|
+
/* @__PURE__ */ t(ga, { open: y, onOpenChange: N }),
|
|
4182
4191
|
/* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
4183
|
-
/* @__PURE__ */ t(ua, { open: T, onOpenChange:
|
|
4192
|
+
/* @__PURE__ */ t(ua, { open: T, onOpenChange: w }),
|
|
4184
4193
|
/* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
4185
4194
|
/* @__PURE__ */ t(pa, {}),
|
|
4186
4195
|
/* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
@@ -4203,44 +4212,44 @@ Gt.Preview = za;
|
|
|
4203
4212
|
const Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4204
4213
|
__proto__: null,
|
|
4205
4214
|
Desktop: Bn,
|
|
4206
|
-
DesktopSortable:
|
|
4207
|
-
DesktopSortableConfigProvider:
|
|
4208
|
-
DesktopSortableStateProvider:
|
|
4209
|
-
Dock:
|
|
4210
|
-
DockDesktop:
|
|
4211
|
-
DockDesktopItem:
|
|
4212
|
-
DockMobile:
|
|
4213
|
-
DockMobileItem:
|
|
4215
|
+
DesktopSortable: At,
|
|
4216
|
+
DesktopSortableConfigProvider: It,
|
|
4217
|
+
DesktopSortableStateProvider: Mt,
|
|
4218
|
+
Dock: Ne,
|
|
4219
|
+
DockDesktop: Ye,
|
|
4220
|
+
DockDesktopItem: qe,
|
|
4221
|
+
DockMobile: Ve,
|
|
4222
|
+
DockMobileItem: Re,
|
|
4214
4223
|
Editor: Gt,
|
|
4215
|
-
Markdown:
|
|
4216
|
-
MdEditor:
|
|
4217
|
-
SortableUtils:
|
|
4218
|
-
desktopAppConfig:
|
|
4219
|
-
desktopConfigMap:
|
|
4220
|
-
desktopGroupConfig:
|
|
4221
|
-
desktopThemeDark:
|
|
4222
|
-
desktopThemeLight:
|
|
4223
|
-
useDockDesktopMouseX:
|
|
4224
|
+
Markdown: Bt,
|
|
4225
|
+
MdEditor: zt,
|
|
4226
|
+
SortableUtils: V,
|
|
4227
|
+
desktopAppConfig: Xe,
|
|
4228
|
+
desktopConfigMap: Ue,
|
|
4229
|
+
desktopGroupConfig: St,
|
|
4230
|
+
desktopThemeDark: je,
|
|
4231
|
+
desktopThemeLight: _e,
|
|
4232
|
+
useDockDesktopMouseX: st
|
|
4224
4233
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4225
4234
|
export {
|
|
4226
4235
|
Bn as Desktop,
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4236
|
+
At as DesktopSortable,
|
|
4237
|
+
It as DesktopSortableConfigProvider,
|
|
4238
|
+
Mt as DesktopSortableStateProvider,
|
|
4239
|
+
Ne as Dock,
|
|
4240
|
+
Ye as DockDesktop,
|
|
4241
|
+
qe as DockDesktopItem,
|
|
4242
|
+
Ve as DockMobile,
|
|
4243
|
+
Re as DockMobileItem,
|
|
4235
4244
|
Gt as Editor,
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4245
|
+
Bt as Markdown,
|
|
4246
|
+
zt as MdEditor,
|
|
4247
|
+
V as SortableUtils,
|
|
4239
4248
|
Ss as default,
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4249
|
+
Xe as desktopAppConfig,
|
|
4250
|
+
Ue as desktopConfigMap,
|
|
4251
|
+
St as desktopGroupConfig,
|
|
4252
|
+
je as desktopThemeDark,
|
|
4253
|
+
_e as desktopThemeLight,
|
|
4245
4254
|
Ls as useDockDesktopMouseX
|
|
4246
4255
|
};
|