zs_library 0.4.23 → 0.4.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import Zt from "i18next";
|
|
|
6
6
|
import { initReactI18next as Qt } from "react-i18next";
|
|
7
7
|
import { jsx as t, jsxs as m, Fragment as ue } from "react/jsx-runtime";
|
|
8
8
|
import * as q from "react";
|
|
9
|
-
import eo, { createContext as st, useMemo as be, useContext as it, useState as
|
|
10
|
-
import { cx as
|
|
9
|
+
import eo, { createContext as st, useMemo as be, useContext as it, useState as O, useRef as xe, useCallback as to, useEffect as se, forwardRef as lt, Fragment as oo } from "react";
|
|
10
|
+
import { cx as C, css as h } from "@emotion/css";
|
|
11
11
|
import ro from "react-slick";
|
|
12
12
|
import { ReactSortable as Xe } from "react-sortablejs";
|
|
13
13
|
import { AnimatePresence as Ue, motion as R, useMotionValue as ct, useTransform as ge, useSpring as Ae } from "framer-motion";
|
|
@@ -28,13 +28,13 @@ import { oneLight as lr } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
|
28
28
|
import cr from "rc-image";
|
|
29
29
|
import { clsx as dr } from "clsx";
|
|
30
30
|
import { twMerge as mr } from "tailwind-merge";
|
|
31
|
-
import { Placeholder as ur, TiptapLink as pr, TiptapImage as gr, UploadImagesPlugin as fr, UpdatedImage as hr, TaskList as br, TaskItem as xr, HorizontalRule as yr, StarterKit as vr, CodeBlockLowlight as kr, Mathematics as Cr, CharacterCount as wr, AIHighlight as Nr, TiptapUnderline as Ir, HighlightExtension as Sr, TextStyle as Tr, Color as Mr, CustomKeymap as Lr, useEditor as
|
|
31
|
+
import { Placeholder as ur, TiptapLink as pr, TiptapImage as gr, UploadImagesPlugin as fr, UpdatedImage as hr, TaskList as br, TaskItem as xr, HorizontalRule as yr, StarterKit as vr, CodeBlockLowlight as kr, Mathematics as Cr, CharacterCount as wr, AIHighlight as Nr, TiptapUnderline as Ir, HighlightExtension as Sr, TextStyle as Tr, Color as Mr, CustomKeymap as Lr, useEditor as te, EditorBubbleItem as Pe, getPrevText as Ar, addAIHighlight as Dr, removeAIHighlight as Rr, EditorBubble as Pr, createImageUpload as Nt, Command as Br, createSuggestionItems as zr, renderItems as Er, EditorRoot as $r, EditorContent as Hr, handleImageDrop as Or, handleImagePaste as Fr, handleCommandNavigation as _r, EditorCommand as jr, EditorCommandEmpty as Xr, EditorCommandList as Ur, EditorCommandItem as Gr, ImageResizer as qr } from "novel";
|
|
32
32
|
import { useDebouncedCallback as Yr } from "use-debounce";
|
|
33
33
|
import { Markdown as Vr } from "tiptap-markdown";
|
|
34
|
-
import { cx as
|
|
34
|
+
import { cx as W, cva as Wr } from "class-variance-authority";
|
|
35
35
|
import { createLowlight as Kr, common as Jr } from "lowlight";
|
|
36
36
|
import { Extension as Zr } from "@tiptap/core";
|
|
37
|
-
import { Plugin as Qr, PluginKey as en, NodeSelection as
|
|
37
|
+
import { Plugin as Qr, PluginKey as en, NodeSelection as Q, TextSelection as tn } from "prosemirror-state";
|
|
38
38
|
import { Slice as on, Fragment as rn } from "prosemirror-model";
|
|
39
39
|
import * as nn from "prosemirror-view";
|
|
40
40
|
import * as Ce from "@radix-ui/react-popover";
|
|
@@ -45,8 +45,8 @@ import * as St from "@radix-ui/react-separator";
|
|
|
45
45
|
import { useCompletion as Nn } from "@ai-sdk/react";
|
|
46
46
|
import { toast as we } from "sonner";
|
|
47
47
|
import * as de from "@radix-ui/react-scroll-area";
|
|
48
|
-
import { Command as
|
|
49
|
-
import * as
|
|
48
|
+
import { Command as J } from "cmdk";
|
|
49
|
+
import * as ne from "@radix-ui/react-dialog";
|
|
50
50
|
import In from "highlight.js";
|
|
51
51
|
import Sn from "rc-dropdown";
|
|
52
52
|
import De from "rc-menu";
|
|
@@ -170,13 +170,13 @@ const qe = {
|
|
|
170
170
|
app: Ve,
|
|
171
171
|
group: Lt
|
|
172
172
|
};
|
|
173
|
-
class
|
|
173
|
+
class K {
|
|
174
174
|
}
|
|
175
175
|
/** 清理重复id */
|
|
176
|
-
Le(
|
|
176
|
+
Le(K, "uniqueArray", (e) => e.reduce((o, n) => o.find((s) => s.id === n.id) ? o : o.concat([n]), [])), Le(K, "getTheme", (e) => {
|
|
177
177
|
const o = qe.token, n = Ye.token, a = { ...o, ...e == null ? void 0 : e.token }, s = { ...n, ...e == null ? void 0 : e.token };
|
|
178
178
|
return { light: a, dark: s };
|
|
179
|
-
}), Le(
|
|
179
|
+
}), Le(K, "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);
|
|
@@ -234,163 +234,163 @@ const At = st({
|
|
|
234
234
|
onChange: n,
|
|
235
235
|
storageKey: a = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
236
236
|
enableCaching: s = !0
|
|
237
|
-
} = r, [i, d] =
|
|
237
|
+
} = r, [i, d] = O(), [p, x] = O(), [l, c] = O(null), g = xe(l), [v, D] = O(null), [b, f] = O([]), [I, y] = O(
|
|
238
238
|
null
|
|
239
|
-
), [N, u] =
|
|
239
|
+
), [N, u] = O(
|
|
240
240
|
null
|
|
241
|
-
), [
|
|
241
|
+
), [S, U] = O(!1), [j, k] = O(null), [L, E] = O(
|
|
242
242
|
null
|
|
243
|
-
), [
|
|
243
|
+
), [A, V] = O(!1), [Y, M] = no(a, {
|
|
244
244
|
defaultValue: [],
|
|
245
245
|
listenStorageChange: !0
|
|
246
246
|
}), X = () => {
|
|
247
|
-
D(null), clearTimeout(i), d(void 0),
|
|
248
|
-
},
|
|
247
|
+
D(null), clearTimeout(i), d(void 0), g.current = null;
|
|
248
|
+
}, $ = (w, B) => {
|
|
249
249
|
D({ ...w, pageX: w.pageX, pageY: w.pageY, data: B }), clearTimeout(i);
|
|
250
|
-
},
|
|
250
|
+
}, Z = (w, B = !0) => {
|
|
251
251
|
const { config: z = {} } = w;
|
|
252
252
|
return z.allowContextMenu === !1 ? {} : {
|
|
253
|
-
onMouseDown: (
|
|
253
|
+
onMouseDown: (T) => {
|
|
254
254
|
d(
|
|
255
255
|
setTimeout(() => {
|
|
256
|
-
B &&
|
|
256
|
+
B && g.current === null && $(T, w);
|
|
257
257
|
}, 800)
|
|
258
|
-
),
|
|
258
|
+
), U(!1), x(
|
|
259
259
|
setTimeout(() => {
|
|
260
|
-
|
|
260
|
+
U(!0);
|
|
261
261
|
}, 800)
|
|
262
262
|
);
|
|
263
263
|
},
|
|
264
264
|
onMouseUp: () => {
|
|
265
265
|
clearTimeout(p), x(void 0), clearTimeout(i), d(void 0);
|
|
266
266
|
},
|
|
267
|
-
onContextMenu: (
|
|
268
|
-
B && (
|
|
267
|
+
onContextMenu: (T) => {
|
|
268
|
+
B && (T.preventDefault(), $(T, w));
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
|
-
},
|
|
271
|
+
}, oe = to(
|
|
272
272
|
(w, B) => {
|
|
273
273
|
const z = [...B || []];
|
|
274
274
|
if (z.length > 0)
|
|
275
|
-
|
|
276
|
-
const
|
|
275
|
+
f((T) => {
|
|
276
|
+
const H = [...T], F = (P) => {
|
|
277
277
|
var et, tt;
|
|
278
|
-
const _ = z.shift(),
|
|
279
|
-
if (z.length &&
|
|
280
|
-
if (((et =
|
|
281
|
-
(
|
|
278
|
+
const _ = z.shift(), G = P.find((ae) => ae.id === _), re = P.findIndex((ae) => ae.id === _);
|
|
279
|
+
if (z.length && G) {
|
|
280
|
+
if (((et = G.children) == null ? void 0 : et.filter(
|
|
281
|
+
(ae) => !w.some((Wt) => Wt.id === ae.id)
|
|
282
282
|
).length) === 1 && w.length === 1) {
|
|
283
|
-
const
|
|
284
|
-
return P.splice(
|
|
283
|
+
const ae = { ...w[0] };
|
|
284
|
+
return P.splice(re, 1, ae), n == null || n(P), P;
|
|
285
285
|
}
|
|
286
|
-
return
|
|
286
|
+
return G.children = F(G.children || []), P.splice(re, 1, G), n == null || n(P), P;
|
|
287
287
|
}
|
|
288
|
-
if (
|
|
289
|
-
if (!((tt =
|
|
290
|
-
const
|
|
291
|
-
return
|
|
288
|
+
if (G) {
|
|
289
|
+
if (!((tt = G.children) != null && tt.length) && w.length) {
|
|
290
|
+
const ae = { ...G };
|
|
291
|
+
return G.data = { name: "文件夹" }, G.type = "group", G.children = [ae, ...w], G.id = Oe(), P.splice(re, 1, G), n == null || n(P), P;
|
|
292
292
|
}
|
|
293
|
-
return
|
|
293
|
+
return G.children = K.uniqueArray(w), P.splice(re, 1, G), n == null || n(P), P;
|
|
294
294
|
}
|
|
295
|
-
return
|
|
295
|
+
return K.uniqueArray(w);
|
|
296
296
|
};
|
|
297
|
-
return
|
|
297
|
+
return K.uniqueArray(F(H));
|
|
298
298
|
});
|
|
299
299
|
else {
|
|
300
|
-
const
|
|
301
|
-
n == null || n(
|
|
300
|
+
const T = K.uniqueArray(w);
|
|
301
|
+
n == null || n(T), f(T);
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
304
|
[n]
|
|
305
305
|
), $e = (w, B) => {
|
|
306
|
-
|
|
307
|
-
const
|
|
306
|
+
f((z) => {
|
|
307
|
+
const T = [...z], H = (F) => {
|
|
308
308
|
var P;
|
|
309
309
|
for (let _ = 0; _ < F.length; _++)
|
|
310
310
|
if (F[_].id === w) {
|
|
311
311
|
F[_].config = B;
|
|
312
312
|
break;
|
|
313
|
-
} else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 &&
|
|
313
|
+
} else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 && H(F[_].children);
|
|
314
314
|
};
|
|
315
|
-
return
|
|
315
|
+
return H(T), n == null || n(T), T;
|
|
316
316
|
});
|
|
317
317
|
}, Se = (w, B) => {
|
|
318
|
-
|
|
319
|
-
const
|
|
318
|
+
f((z) => {
|
|
319
|
+
const T = [...z], H = (F) => {
|
|
320
320
|
var P;
|
|
321
321
|
for (let _ = 0; _ < F.length; _++)
|
|
322
322
|
if (F[_].id === w) {
|
|
323
323
|
F[_].data = B;
|
|
324
324
|
break;
|
|
325
|
-
} else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 &&
|
|
325
|
+
} else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 && H(F[_].children);
|
|
326
326
|
};
|
|
327
|
-
return
|
|
327
|
+
return H(T), n == null || n(T), T;
|
|
328
328
|
});
|
|
329
329
|
}, Te = (w) => {
|
|
330
|
-
|
|
331
|
-
const z = [...B],
|
|
330
|
+
f((B) => {
|
|
331
|
+
const z = [...B], T = (H) => {
|
|
332
332
|
var F;
|
|
333
|
-
for (let P = 0; P <
|
|
334
|
-
if (
|
|
335
|
-
|
|
333
|
+
for (let P = 0; P < H.length; P++)
|
|
334
|
+
if (H[P].id === w) {
|
|
335
|
+
H.splice(P, 1);
|
|
336
336
|
break;
|
|
337
|
-
} else ((F =
|
|
337
|
+
} else ((F = H[P].children) == null ? void 0 : F.length) !== void 0 && T(H[P].children);
|
|
338
338
|
};
|
|
339
|
-
return
|
|
339
|
+
return T(z), n == null || n(z), z;
|
|
340
340
|
});
|
|
341
341
|
}, ie = (w, B) => {
|
|
342
|
-
const z = [...
|
|
343
|
-
const P = F.shift(), _ =
|
|
342
|
+
const z = [...b], T = (H, F) => {
|
|
343
|
+
const P = F.shift(), _ = H.find((re) => re.id === P), G = H.findIndex((re) => re.id === P);
|
|
344
344
|
if (_) {
|
|
345
345
|
if (F.length)
|
|
346
|
-
_.children =
|
|
346
|
+
_.children = T(_.children || [], F);
|
|
347
347
|
else {
|
|
348
|
-
const
|
|
348
|
+
const re = (w == null ? void 0 : w.type) ?? "app";
|
|
349
349
|
_.children = [
|
|
350
350
|
..._.children ?? [],
|
|
351
351
|
{
|
|
352
352
|
...w,
|
|
353
353
|
id: Oe(),
|
|
354
|
-
config: (w == null ? void 0 : w.config) ?? Be[
|
|
354
|
+
config: (w == null ? void 0 : w.config) ?? Be[re]
|
|
355
355
|
}
|
|
356
356
|
];
|
|
357
357
|
}
|
|
358
|
-
return
|
|
358
|
+
return H.splice(G, 1, _), H;
|
|
359
359
|
} else
|
|
360
|
-
return
|
|
360
|
+
return H;
|
|
361
361
|
};
|
|
362
|
-
|
|
362
|
+
f(T(z, B));
|
|
363
363
|
}, Me = (w) => {
|
|
364
|
-
|
|
365
|
-
const z = (w == null ? void 0 : w.type) ?? "app",
|
|
364
|
+
f((B) => {
|
|
365
|
+
const z = (w == null ? void 0 : w.type) ?? "app", T = {
|
|
366
366
|
...w,
|
|
367
367
|
id: Oe(),
|
|
368
368
|
config: (w == null ? void 0 : w.config) ?? Be[z]
|
|
369
|
-
},
|
|
370
|
-
return n == null || n(
|
|
369
|
+
}, H = [...B, T];
|
|
370
|
+
return n == null || n(H), H;
|
|
371
371
|
});
|
|
372
372
|
}, He = (w, B) => {
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
return
|
|
373
|
+
f((z) => {
|
|
374
|
+
const T = [...z], H = T.findIndex((F) => F.id === w);
|
|
375
|
+
return H !== -1 && (T[H] = { ...T[H], ...B }, n == null || n(T)), T;
|
|
376
376
|
});
|
|
377
377
|
}, ye = (w) => {
|
|
378
|
-
|
|
379
|
-
const z = B.filter((
|
|
378
|
+
f((B) => {
|
|
379
|
+
const z = B.filter((T) => T.id !== w);
|
|
380
380
|
return n == null || n(z), z;
|
|
381
381
|
});
|
|
382
382
|
};
|
|
383
|
-
return
|
|
384
|
-
(o == null ? void 0 : o.length) > 0 &&
|
|
385
|
-
}, [o]),
|
|
386
|
-
|
|
387
|
-
}, [l]),
|
|
388
|
-
s &&
|
|
389
|
-
}, [
|
|
383
|
+
return se(() => {
|
|
384
|
+
(o == null ? void 0 : o.length) > 0 && b.length === 0 && oe(o);
|
|
385
|
+
}, [o]), se(() => {
|
|
386
|
+
g.current = l, l !== null && X();
|
|
387
|
+
}, [l]), se(() => {
|
|
388
|
+
s && Y != null && Y.length && !A && (oe(Y), V(!0));
|
|
389
|
+
}, [Y, A, s, oe]), ao(
|
|
390
390
|
() => {
|
|
391
|
-
s &&
|
|
391
|
+
s && M(b);
|
|
392
392
|
},
|
|
393
|
-
[
|
|
393
|
+
[b, s],
|
|
394
394
|
{
|
|
395
395
|
wait: 1e3
|
|
396
396
|
}
|
|
@@ -398,19 +398,19 @@ const At = st({
|
|
|
398
398
|
At.Provider,
|
|
399
399
|
{
|
|
400
400
|
value: {
|
|
401
|
-
list:
|
|
402
|
-
setList:
|
|
401
|
+
list: b,
|
|
402
|
+
setList: oe,
|
|
403
403
|
contextMenu: v,
|
|
404
404
|
setContextMenu: D,
|
|
405
405
|
listStatus: l,
|
|
406
406
|
setListStatus: c,
|
|
407
|
-
contextMenuFuns:
|
|
407
|
+
contextMenuFuns: Z,
|
|
408
408
|
hideContextMenu: X,
|
|
409
|
-
showInfoItemData:
|
|
409
|
+
showInfoItemData: I,
|
|
410
410
|
setShowInfoItemData: y,
|
|
411
411
|
openGroupItemData: N,
|
|
412
412
|
setOpenGroupItemData: u,
|
|
413
|
-
longPressTriggered:
|
|
413
|
+
longPressTriggered: S,
|
|
414
414
|
updateItemConfig: $e,
|
|
415
415
|
updateItem: Se,
|
|
416
416
|
removeItem: Te,
|
|
@@ -418,10 +418,10 @@ const At = st({
|
|
|
418
418
|
addRootItem: Me,
|
|
419
419
|
updateRootItem: He,
|
|
420
420
|
removeRootItem: ye,
|
|
421
|
-
moveItemId:
|
|
422
|
-
setMoveItemId:
|
|
423
|
-
moveTargetId:
|
|
424
|
-
setMoveTargetId:
|
|
421
|
+
moveItemId: j,
|
|
422
|
+
setMoveItemId: k,
|
|
423
|
+
moveTargetId: L,
|
|
424
|
+
setMoveTargetId: E
|
|
425
425
|
},
|
|
426
426
|
children: e
|
|
427
427
|
}
|
|
@@ -434,11 +434,11 @@ const At = st({
|
|
|
434
434
|
},
|
|
435
435
|
menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
|
|
436
436
|
}, Fe = (r) => {
|
|
437
|
-
const { icon: e, title: o, onClick: n } = r, { theme: a } = le(), { light: s, dark: i } =
|
|
437
|
+
const { icon: e, title: o, onClick: n } = r, { theme: a } = le(), { light: s, dark: i } = K.getTheme(a);
|
|
438
438
|
return /* @__PURE__ */ t(
|
|
439
439
|
R.div,
|
|
440
440
|
{
|
|
441
|
-
className:
|
|
441
|
+
className: h`
|
|
442
442
|
&:hover {
|
|
443
443
|
background-color: ${s.contextMenuActiveColor};
|
|
444
444
|
@media (prefers-color-scheme: dark) {
|
|
@@ -462,9 +462,9 @@ const At = st({
|
|
|
462
462
|
children: /* @__PURE__ */ m(
|
|
463
463
|
R.div,
|
|
464
464
|
{
|
|
465
|
-
className:
|
|
465
|
+
className: C(
|
|
466
466
|
"py-1.5 px-3 rounded-lg",
|
|
467
|
-
|
|
467
|
+
h`
|
|
468
468
|
padding-top: 0.375rem;
|
|
469
469
|
padding-bottom: 0.375rem;
|
|
470
470
|
padding-left: 0.75rem;
|
|
@@ -477,8 +477,8 @@ const At = st({
|
|
|
477
477
|
/* @__PURE__ */ t(
|
|
478
478
|
R.div,
|
|
479
479
|
{
|
|
480
|
-
className:
|
|
481
|
-
|
|
480
|
+
className: C(
|
|
481
|
+
h`
|
|
482
482
|
margin-bottom: 0.375rem;
|
|
483
483
|
display: flex;
|
|
484
484
|
justify-content: center;
|
|
@@ -507,15 +507,15 @@ const At = st({
|
|
|
507
507
|
setContextMenu: x,
|
|
508
508
|
hideContextMenu: l,
|
|
509
509
|
setShowInfoItemData: c,
|
|
510
|
-
removeItem:
|
|
510
|
+
removeItem: g,
|
|
511
511
|
updateItemConfig: v
|
|
512
|
-
} = pe(), { theme: D } = le(), { light:
|
|
513
|
-
var
|
|
514
|
-
const u = Be[(
|
|
515
|
-
for (let
|
|
516
|
-
for (let
|
|
517
|
-
|
|
518
|
-
return
|
|
512
|
+
} = pe(), { theme: D } = le(), { light: b, dark: f } = K.getTheme(D), { data: I } = p ?? {}, { config: y = {} } = I ?? {}, N = () => {
|
|
513
|
+
var U;
|
|
514
|
+
const u = Be[(U = p == null ? void 0 : p.data) == null ? void 0 : U.type], S = [];
|
|
515
|
+
for (let j = 1; j <= ((u == null ? void 0 : u.maxRow) ?? 2); j++)
|
|
516
|
+
for (let k = 1; k <= ((u == null ? void 0 : u.maxCol) ?? 2); k++)
|
|
517
|
+
S.push(`${j}x${k}`);
|
|
518
|
+
return S;
|
|
519
519
|
};
|
|
520
520
|
return /* @__PURE__ */ t(Ue, { children: p && /* @__PURE__ */ m(
|
|
521
521
|
R.div,
|
|
@@ -530,22 +530,22 @@ const At = st({
|
|
|
530
530
|
/* @__PURE__ */ t(
|
|
531
531
|
R.div,
|
|
532
532
|
{
|
|
533
|
-
className:
|
|
534
|
-
|
|
533
|
+
className: C(
|
|
534
|
+
h`
|
|
535
535
|
border-radius: 0.5rem;
|
|
536
536
|
overflow: hidden;
|
|
537
|
-
background-color: ${
|
|
538
|
-
box-shadow: 0 0 0.5rem ${
|
|
537
|
+
background-color: ${b.contextMenuBackgroundColor};
|
|
538
|
+
box-shadow: 0 0 0.5rem ${b.contextMenuShadowColor};
|
|
539
539
|
@media (prefers-color-scheme: dark) {
|
|
540
|
-
background-color: ${
|
|
541
|
-
box-shadow: 0 0 0.5rem ${
|
|
540
|
+
background-color: ${f.contextMenuBackgroundColor};
|
|
541
|
+
box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
|
|
542
542
|
}
|
|
543
543
|
`
|
|
544
544
|
),
|
|
545
545
|
children: a && y.allowResize !== !1 && /* @__PURE__ */ t(
|
|
546
546
|
R.ul,
|
|
547
547
|
{
|
|
548
|
-
className:
|
|
548
|
+
className: h`
|
|
549
549
|
background-color: white;
|
|
550
550
|
padding: 0.25rem;
|
|
551
551
|
margin: 0;
|
|
@@ -559,10 +559,10 @@ const At = st({
|
|
|
559
559
|
label: u,
|
|
560
560
|
key: u,
|
|
561
561
|
onClick: () => {
|
|
562
|
-
const [
|
|
562
|
+
const [S, U] = u.split("x").map(Number);
|
|
563
563
|
v(p.data.id, {
|
|
564
|
-
row:
|
|
565
|
-
col:
|
|
564
|
+
row: S,
|
|
565
|
+
col: U
|
|
566
566
|
});
|
|
567
567
|
}
|
|
568
568
|
}))
|
|
@@ -570,7 +570,7 @@ const At = st({
|
|
|
570
570
|
].map((u) => /* @__PURE__ */ m(
|
|
571
571
|
R.li,
|
|
572
572
|
{
|
|
573
|
-
className:
|
|
573
|
+
className: h`
|
|
574
574
|
padding-top: 0.5rem;
|
|
575
575
|
padding-bottom: 0.5rem;
|
|
576
576
|
padding-left: 0.75rem;
|
|
@@ -580,7 +580,7 @@ const At = st({
|
|
|
580
580
|
/* @__PURE__ */ m(
|
|
581
581
|
R.p,
|
|
582
582
|
{
|
|
583
|
-
className:
|
|
583
|
+
className: h`
|
|
584
584
|
display: flex;
|
|
585
585
|
align-items: center;
|
|
586
586
|
font-size: 0.875rem;
|
|
@@ -588,9 +588,9 @@ const At = st({
|
|
|
588
588
|
gap: 0.5rem;
|
|
589
589
|
padding-bottom: 0.5rem;
|
|
590
590
|
margin: 0;
|
|
591
|
-
color: ${
|
|
591
|
+
color: ${b.contextMenuTextColor};
|
|
592
592
|
@media (prefers-color-scheme: dark) {
|
|
593
|
-
color: ${
|
|
593
|
+
color: ${f.contextMenuTextColor};
|
|
594
594
|
}
|
|
595
595
|
`,
|
|
596
596
|
children: [
|
|
@@ -603,17 +603,17 @@ const At = st({
|
|
|
603
603
|
/* @__PURE__ */ t(
|
|
604
604
|
R.div,
|
|
605
605
|
{
|
|
606
|
-
className:
|
|
606
|
+
className: h`
|
|
607
607
|
display: grid;
|
|
608
608
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
609
609
|
gap: 0.25rem;
|
|
610
610
|
`,
|
|
611
|
-
children: u.items.map((
|
|
611
|
+
children: u.items.map((S) => /* @__PURE__ */ t(
|
|
612
612
|
R.div,
|
|
613
613
|
{
|
|
614
|
-
className:
|
|
614
|
+
className: C(
|
|
615
615
|
"py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",
|
|
616
|
-
|
|
616
|
+
h`
|
|
617
617
|
padding-top: 0.25rem;
|
|
618
618
|
padding-bottom: 0.25rem;
|
|
619
619
|
padding-left: 0.5rem;
|
|
@@ -624,28 +624,28 @@ const At = st({
|
|
|
624
624
|
line-height: 1.25rem;
|
|
625
625
|
cursor: pointer;
|
|
626
626
|
text-align: center;
|
|
627
|
-
color: ${
|
|
627
|
+
color: ${b.contextMenuTextColor};
|
|
628
628
|
@media (prefers-color-scheme: dark) {
|
|
629
|
-
color: ${
|
|
629
|
+
color: ${f.contextMenuTextColor};
|
|
630
630
|
}
|
|
631
631
|
&:hover {
|
|
632
|
-
background-color: ${
|
|
632
|
+
background-color: ${b.contextMenuActiveColor};
|
|
633
633
|
@media (prefers-color-scheme: dark) {
|
|
634
|
-
background-color: ${
|
|
634
|
+
background-color: ${f.contextMenuActiveColor};
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
`,
|
|
638
|
-
`${y.row}x${y.col}` ===
|
|
639
|
-
background-color: ${
|
|
638
|
+
`${y.row}x${y.col}` === S.key && h`
|
|
639
|
+
background-color: ${b.contextMenuActiveColor};
|
|
640
640
|
@media (prefers-color-scheme: dark) {
|
|
641
|
-
background-color: ${
|
|
641
|
+
background-color: ${f.contextMenuActiveColor};
|
|
642
642
|
}
|
|
643
643
|
`
|
|
644
644
|
),
|
|
645
|
-
onClick:
|
|
646
|
-
children:
|
|
645
|
+
onClick: S.onClick,
|
|
646
|
+
children: S.label
|
|
647
647
|
},
|
|
648
|
-
|
|
648
|
+
S.key
|
|
649
649
|
))
|
|
650
650
|
}
|
|
651
651
|
)
|
|
@@ -660,13 +660,13 @@ const At = st({
|
|
|
660
660
|
/* @__PURE__ */ m(
|
|
661
661
|
R.div,
|
|
662
662
|
{
|
|
663
|
-
className:
|
|
664
|
-
|
|
665
|
-
background-color: ${
|
|
666
|
-
box-shadow: 0 0 0.5rem ${
|
|
663
|
+
className: C(
|
|
664
|
+
h`
|
|
665
|
+
background-color: ${b.contextMenuBackgroundColor};
|
|
666
|
+
box-shadow: 0 0 0.5rem ${b.contextMenuShadowColor};
|
|
667
667
|
@media (prefers-color-scheme: dark) {
|
|
668
|
-
background-color: ${
|
|
669
|
-
box-shadow: 0 0 0.5rem ${
|
|
668
|
+
background-color: ${f.contextMenuBackgroundColor};
|
|
669
|
+
box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
|
|
670
670
|
}
|
|
671
671
|
display: flex;
|
|
672
672
|
justify-content: space-around;
|
|
@@ -716,10 +716,10 @@ const At = st({
|
|
|
716
716
|
title: "移除",
|
|
717
717
|
onClick: () => {
|
|
718
718
|
if (d) {
|
|
719
|
-
d(p.data,
|
|
719
|
+
d(p.data, g);
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
|
-
x(null),
|
|
722
|
+
x(null), g(p.data.id);
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
)
|
|
@@ -730,12 +730,12 @@ const At = st({
|
|
|
730
730
|
}
|
|
731
731
|
) });
|
|
732
732
|
}, Bn = (r) => {
|
|
733
|
-
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: n } = pe(), { itemIconBuilder: a, theme: s, contextMenu: i } = le(), { light: d, dark: p } =
|
|
733
|
+
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: n } = pe(), { itemIconBuilder: a, theme: s, contextMenu: i } = le(), { light: d, dark: p } = K.getTheme(s), { data: x = {} } = e, { name: l } = x;
|
|
734
734
|
return /* @__PURE__ */ m(ue, { children: [
|
|
735
735
|
/* @__PURE__ */ t(
|
|
736
736
|
R.div,
|
|
737
737
|
{
|
|
738
|
-
className:
|
|
738
|
+
className: h`
|
|
739
739
|
width: 4rem;
|
|
740
740
|
height: 4rem;
|
|
741
741
|
background-color: ${d.itemIconBackgroundColor};
|
|
@@ -753,7 +753,7 @@ const At = st({
|
|
|
753
753
|
children: /* @__PURE__ */ t(
|
|
754
754
|
"div",
|
|
755
755
|
{
|
|
756
|
-
className:
|
|
756
|
+
className: h`
|
|
757
757
|
position: absolute;
|
|
758
758
|
left: 0;
|
|
759
759
|
top: 0;
|
|
@@ -773,15 +773,15 @@ const At = st({
|
|
|
773
773
|
/* @__PURE__ */ t(
|
|
774
774
|
R.p,
|
|
775
775
|
{
|
|
776
|
-
className:
|
|
776
|
+
className: C(
|
|
777
777
|
"whitespace-nowrap text-ellipsis overflow-hidden text-center mt-1 mb-0 max-w-16",
|
|
778
|
-
|
|
778
|
+
h`
|
|
779
779
|
color: ${d.itemNameColor};
|
|
780
780
|
@media (prefers-color-scheme: dark) {
|
|
781
781
|
color: ${p.itemNameColor};
|
|
782
782
|
}
|
|
783
783
|
`,
|
|
784
|
-
o &&
|
|
784
|
+
o && h`
|
|
785
785
|
color: transparent;
|
|
786
786
|
`
|
|
787
787
|
),
|
|
@@ -804,7 +804,7 @@ const At = st({
|
|
|
804
804
|
dt,
|
|
805
805
|
{
|
|
806
806
|
placement: "bottom",
|
|
807
|
-
overlayClassName:
|
|
807
|
+
overlayClassName: h`
|
|
808
808
|
background-color: transparent;
|
|
809
809
|
.rc-tooltip-inner {
|
|
810
810
|
background-color: transparent;
|
|
@@ -814,8 +814,8 @@ const At = st({
|
|
|
814
814
|
`,
|
|
815
815
|
overlay: /* @__PURE__ */ t(Pn, { ...c }),
|
|
816
816
|
visible: (x == null ? void 0 : x.data.id) === e.id,
|
|
817
|
-
onVisibleChange: (
|
|
818
|
-
|
|
817
|
+
onVisibleChange: (g) => {
|
|
818
|
+
g || l(null);
|
|
819
819
|
},
|
|
820
820
|
destroyTooltipOnHide: !0,
|
|
821
821
|
children: /* @__PURE__ */ t(
|
|
@@ -826,7 +826,7 @@ const At = st({
|
|
|
826
826
|
"data-parent-ids": d == null ? void 0 : d.join(","),
|
|
827
827
|
"data-children-length": p,
|
|
828
828
|
onClick: () => a == null ? void 0 : a(e),
|
|
829
|
-
className:
|
|
829
|
+
className: C(s && "drag-disabled", o),
|
|
830
830
|
children: i ?? /* @__PURE__ */ t(Bn, { ...r })
|
|
831
831
|
}
|
|
832
832
|
)
|
|
@@ -846,13 +846,13 @@ const At = st({
|
|
|
846
846
|
setOpenGroupItemData: x,
|
|
847
847
|
longPressTriggered: l,
|
|
848
848
|
moveItemId: c,
|
|
849
|
-
moveTargetId:
|
|
849
|
+
moveTargetId: g,
|
|
850
850
|
setMoveTargetId: v,
|
|
851
851
|
listStatus: D
|
|
852
|
-
} = pe(), { itemIconBuilder:
|
|
852
|
+
} = pe(), { itemIconBuilder: b, theme: f, contextMenu: I } = le(), { light: y, dark: N } = K.getTheme(f), { children: u, data: S, config: U } = e, { row: j = 1, col: k = 1 } = U ?? {}, L = {
|
|
853
853
|
visible: { opacity: 1, scale: 1 },
|
|
854
854
|
hidden: { opacity: 0, scale: 0.95 }
|
|
855
|
-
},
|
|
855
|
+
}, E = ((u == null ? void 0 : u.length) ?? 0) === 0, A = E ? [e] : [...u ?? []].slice(0, 9), V = be(() => c === e.id.toString(), [e.id, c]), Y = be(() => g === e.id, [e.id, g]), M = h`
|
|
856
856
|
overflow: hidden;
|
|
857
857
|
cursor: pointer;
|
|
858
858
|
background-color: ${y.itemIconBackgroundColor};
|
|
@@ -862,13 +862,13 @@ const At = st({
|
|
|
862
862
|
box-shadow: 0 0 0.5rem ${N.itemIconShadowColor};
|
|
863
863
|
}
|
|
864
864
|
`, X = () => {
|
|
865
|
-
if (
|
|
865
|
+
if (E)
|
|
866
866
|
return /* @__PURE__ */ t(
|
|
867
867
|
R.div,
|
|
868
868
|
{
|
|
869
|
-
className:
|
|
869
|
+
className: C(
|
|
870
870
|
"sortable-group-item",
|
|
871
|
-
|
|
871
|
+
h`
|
|
872
872
|
overflow: hidden;
|
|
873
873
|
cursor: pointer;
|
|
874
874
|
width: 100%;
|
|
@@ -883,51 +883,51 @@ const At = st({
|
|
|
883
883
|
}
|
|
884
884
|
`
|
|
885
885
|
),
|
|
886
|
-
onClick: (
|
|
887
|
-
|
|
886
|
+
onClick: ($) => {
|
|
887
|
+
$.stopPropagation(), s == null || s(e);
|
|
888
888
|
},
|
|
889
|
-
children:
|
|
889
|
+
children: b == null ? void 0 : b(e)
|
|
890
890
|
}
|
|
891
891
|
);
|
|
892
|
-
if (
|
|
892
|
+
if (j === 1 && k === 1 || j === 2 && k === 2)
|
|
893
893
|
return /* @__PURE__ */ t(
|
|
894
894
|
R.div,
|
|
895
895
|
{
|
|
896
|
-
className:
|
|
896
|
+
className: h`
|
|
897
897
|
display: grid;
|
|
898
898
|
width: 100%;
|
|
899
899
|
height: 100%;
|
|
900
900
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
901
901
|
grid-template-rows: repeat(3, minmax(0, 1fr));
|
|
902
|
-
padding: ${
|
|
903
|
-
gap: ${
|
|
902
|
+
padding: ${k === 1 ? "0.125rem" : "0.25rem"};
|
|
903
|
+
gap: ${k === 1 ? "0.125rem" : "0.5rem"};
|
|
904
904
|
place-items: center;
|
|
905
905
|
`,
|
|
906
|
-
children:
|
|
906
|
+
children: A == null ? void 0 : A.slice(0, 9).map(($) => /* @__PURE__ */ t(
|
|
907
907
|
R.div,
|
|
908
908
|
{
|
|
909
|
-
className:
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
border-radius: ${
|
|
909
|
+
className: C(
|
|
910
|
+
M,
|
|
911
|
+
h`
|
|
912
|
+
border-radius: ${k === 1 ? "0.25rem" : "0.5rem"};
|
|
913
913
|
width: 100%;
|
|
914
914
|
height: 100%;
|
|
915
915
|
`
|
|
916
916
|
),
|
|
917
|
-
onClick: (
|
|
918
|
-
|
|
917
|
+
onClick: (Z) => {
|
|
918
|
+
Z.stopPropagation(), s == null || s($);
|
|
919
919
|
},
|
|
920
|
-
children:
|
|
920
|
+
children: b == null ? void 0 : b($)
|
|
921
921
|
},
|
|
922
|
-
|
|
922
|
+
$.id
|
|
923
923
|
))
|
|
924
924
|
}
|
|
925
925
|
);
|
|
926
|
-
if (
|
|
926
|
+
if (j === 1 && k === 2)
|
|
927
927
|
return /* @__PURE__ */ t(
|
|
928
928
|
R.div,
|
|
929
929
|
{
|
|
930
|
-
className:
|
|
930
|
+
className: h`
|
|
931
931
|
display: grid;
|
|
932
932
|
grid-template-columns: repeat(10, minmax(0, 1fr));
|
|
933
933
|
grid-template-rows: repeat(4, minmax(0, 1fr));
|
|
@@ -937,18 +937,18 @@ const At = st({
|
|
|
937
937
|
height: 52px;
|
|
938
938
|
place-items: center;
|
|
939
939
|
`,
|
|
940
|
-
children:
|
|
940
|
+
children: A == null ? void 0 : A.slice(0, 4).map(($, Z) => /* @__PURE__ */ t(
|
|
941
941
|
R.div,
|
|
942
942
|
{
|
|
943
|
-
className:
|
|
944
|
-
|
|
945
|
-
|
|
943
|
+
className: C(
|
|
944
|
+
M,
|
|
945
|
+
Z < 2 ? h`
|
|
946
946
|
width: 52px;
|
|
947
947
|
height: 52px;
|
|
948
948
|
border-radius: 0.5rem;
|
|
949
949
|
grid-column: span 4 / span 4;
|
|
950
950
|
grid-row: span 4 / span 4;
|
|
951
|
-
` :
|
|
951
|
+
` : h`
|
|
952
952
|
width: 1.5rem;
|
|
953
953
|
height: 1.5rem;
|
|
954
954
|
border-radius: 0.375rem;
|
|
@@ -956,20 +956,20 @@ const At = st({
|
|
|
956
956
|
grid-row: span 2 / span 2;
|
|
957
957
|
`
|
|
958
958
|
),
|
|
959
|
-
onClick: (
|
|
960
|
-
|
|
959
|
+
onClick: (oe) => {
|
|
960
|
+
Z > 2 || (oe.stopPropagation(), s == null || s($));
|
|
961
961
|
},
|
|
962
|
-
children:
|
|
962
|
+
children: b == null ? void 0 : b($)
|
|
963
963
|
},
|
|
964
|
-
|
|
964
|
+
$.id
|
|
965
965
|
))
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
|
-
if (
|
|
968
|
+
if (j === 2 && k === 1)
|
|
969
969
|
return /* @__PURE__ */ t(
|
|
970
970
|
R.div,
|
|
971
971
|
{
|
|
972
|
-
className:
|
|
972
|
+
className: h`
|
|
973
973
|
display: grid;
|
|
974
974
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
975
975
|
grid-template-rows: repeat(10, minmax(0, 1fr));
|
|
@@ -979,30 +979,30 @@ const At = st({
|
|
|
979
979
|
height: 144px;
|
|
980
980
|
place-items: center;
|
|
981
981
|
`,
|
|
982
|
-
children:
|
|
982
|
+
children: A == null ? void 0 : A.slice(0, 4).map(($, Z) => /* @__PURE__ */ t(
|
|
983
983
|
R.div,
|
|
984
984
|
{
|
|
985
|
-
className:
|
|
986
|
-
|
|
987
|
-
|
|
985
|
+
className: C(
|
|
986
|
+
M,
|
|
987
|
+
Z < 2 ? h`
|
|
988
988
|
width: 52px;
|
|
989
989
|
height: 52px;
|
|
990
990
|
border-radius: 0.5rem;
|
|
991
991
|
grid-column: span 4 / span 4;
|
|
992
992
|
grid-row: span 4 / span 4;
|
|
993
|
-
` :
|
|
993
|
+
` : h`
|
|
994
994
|
width: 1.5rem;
|
|
995
995
|
height: 1.5rem;
|
|
996
996
|
grid-column: span 2 / span 2;
|
|
997
997
|
grid-row: span 2 / span 2;
|
|
998
998
|
`
|
|
999
999
|
),
|
|
1000
|
-
onClick: (
|
|
1001
|
-
|
|
1000
|
+
onClick: (oe) => {
|
|
1001
|
+
Z > 2 || (oe.stopPropagation(), s == null || s($));
|
|
1002
1002
|
},
|
|
1003
|
-
children:
|
|
1003
|
+
children: b == null ? void 0 : b($)
|
|
1004
1004
|
},
|
|
1005
|
-
|
|
1005
|
+
$.id
|
|
1006
1006
|
))
|
|
1007
1007
|
}
|
|
1008
1008
|
);
|
|
@@ -1014,10 +1014,10 @@ const At = st({
|
|
|
1014
1014
|
itemIndex: a,
|
|
1015
1015
|
parentIds: n,
|
|
1016
1016
|
childrenLength: u == null ? void 0 : u.length,
|
|
1017
|
-
className:
|
|
1018
|
-
|
|
1019
|
-
grid-row: span ${
|
|
1020
|
-
grid-column: span ${
|
|
1017
|
+
className: C(
|
|
1018
|
+
h`
|
|
1019
|
+
grid-row: span ${j};
|
|
1020
|
+
grid-column: span ${k};
|
|
1021
1021
|
`,
|
|
1022
1022
|
o
|
|
1023
1023
|
),
|
|
@@ -1026,9 +1026,9 @@ const At = st({
|
|
|
1026
1026
|
R.div,
|
|
1027
1027
|
{
|
|
1028
1028
|
whileTap: { scale: 0.9 },
|
|
1029
|
-
className:
|
|
1030
|
-
|
|
1031
|
-
|
|
1029
|
+
className: C(
|
|
1030
|
+
Y ? "!scale-110" : "",
|
|
1031
|
+
h`
|
|
1032
1032
|
cursor: pointer;
|
|
1033
1033
|
position: relative;
|
|
1034
1034
|
border-radius: 0.75rem;
|
|
@@ -1041,18 +1041,18 @@ const At = st({
|
|
|
1041
1041
|
/* overflow: hidden; */
|
|
1042
1042
|
transition: all 0.3s;
|
|
1043
1043
|
margin: 0 auto;
|
|
1044
|
-
width: ${
|
|
1045
|
-
height: ${
|
|
1044
|
+
width: ${k * 64 + 32 * (k - 1)}px;
|
|
1045
|
+
height: ${j * 64 + 32 * (j - 1)}px;
|
|
1046
1046
|
`
|
|
1047
1047
|
),
|
|
1048
|
-
onClick: (
|
|
1049
|
-
!
|
|
1048
|
+
onClick: ($) => {
|
|
1049
|
+
!E && !l && (e.parentIds = n, e.pageX = $.pageX, e.pageY = $.pageY, x(e));
|
|
1050
1050
|
},
|
|
1051
|
-
...d(e,
|
|
1051
|
+
...d(e, I !== !1),
|
|
1052
1052
|
children: /* @__PURE__ */ m(
|
|
1053
1053
|
R.div,
|
|
1054
1054
|
{
|
|
1055
|
-
className:
|
|
1055
|
+
className: h`
|
|
1056
1056
|
position: relative;
|
|
1057
1057
|
width: 100%;
|
|
1058
1058
|
height: 100%;
|
|
@@ -1066,9 +1066,9 @@ const At = st({
|
|
|
1066
1066
|
/* @__PURE__ */ t(
|
|
1067
1067
|
Xe,
|
|
1068
1068
|
{
|
|
1069
|
-
className:
|
|
1069
|
+
className: C(
|
|
1070
1070
|
"sortable-group-item",
|
|
1071
|
-
|
|
1071
|
+
h`
|
|
1072
1072
|
position: absolute;
|
|
1073
1073
|
cursor: pointer;
|
|
1074
1074
|
left: 0.375rem;
|
|
@@ -1085,7 +1085,7 @@ const At = st({
|
|
|
1085
1085
|
animation: 150,
|
|
1086
1086
|
fallbackOnBody: !0,
|
|
1087
1087
|
list: u ?? [],
|
|
1088
|
-
setList: (
|
|
1088
|
+
setList: ($) => p($, n),
|
|
1089
1089
|
filter: () => !0,
|
|
1090
1090
|
"data-id": e.id,
|
|
1091
1091
|
onChange: () => {
|
|
@@ -1101,27 +1101,27 @@ const At = st({
|
|
|
1101
1101
|
/* @__PURE__ */ t(
|
|
1102
1102
|
R.p,
|
|
1103
1103
|
{
|
|
1104
|
-
className:
|
|
1104
|
+
className: C(
|
|
1105
1105
|
"whitespace-nowrap text-ellipsis overflow-hidden text-center mt-1 mb-0 max-w-16",
|
|
1106
|
-
|
|
1106
|
+
h`
|
|
1107
1107
|
color: ${y.itemNameColor};
|
|
1108
1108
|
@media (prefers-color-scheme: dark) {
|
|
1109
1109
|
color: ${N.itemNameColor};
|
|
1110
1110
|
}
|
|
1111
1111
|
`,
|
|
1112
|
-
i &&
|
|
1112
|
+
i && h`
|
|
1113
1113
|
color: transparent;
|
|
1114
1114
|
`
|
|
1115
1115
|
),
|
|
1116
|
-
variants:
|
|
1117
|
-
animate:
|
|
1118
|
-
children: (
|
|
1116
|
+
variants: L,
|
|
1117
|
+
animate: V ? "hidden" : "visible",
|
|
1118
|
+
children: (S == null ? void 0 : S.name) ?? "文件夹"
|
|
1119
1119
|
}
|
|
1120
1120
|
)
|
|
1121
1121
|
]
|
|
1122
1122
|
}
|
|
1123
1123
|
);
|
|
1124
|
-
}, Rt =
|
|
1124
|
+
}, Rt = h`
|
|
1125
1125
|
padding: 8px;
|
|
1126
1126
|
transition: all 0.2s;
|
|
1127
1127
|
> div {
|
|
@@ -1141,10 +1141,10 @@ const At = st({
|
|
|
1141
1141
|
setMoveItemId: d,
|
|
1142
1142
|
setMoveTargetId: p,
|
|
1143
1143
|
updateItem: x
|
|
1144
|
-
} = pe(), { theme: l } = le(), { light: c, dark:
|
|
1145
|
-
return
|
|
1146
|
-
var
|
|
1147
|
-
e && D((
|
|
1144
|
+
} = pe(), { theme: l } = le(), { light: c, dark: g } = K.getTheme(l), [v, D] = O("文件夹"), b = [...(e == null ? void 0 : e.children) ?? []];
|
|
1145
|
+
return se(() => {
|
|
1146
|
+
var f;
|
|
1147
|
+
e && D((f = e.data) == null ? void 0 : f.name);
|
|
1148
1148
|
}, [e]), /* @__PURE__ */ t(
|
|
1149
1149
|
Ct,
|
|
1150
1150
|
{
|
|
@@ -1161,7 +1161,7 @@ const At = st({
|
|
|
1161
1161
|
title: /* @__PURE__ */ t(
|
|
1162
1162
|
"input",
|
|
1163
1163
|
{
|
|
1164
|
-
className:
|
|
1164
|
+
className: h`
|
|
1165
1165
|
background-color: transparent;
|
|
1166
1166
|
border-style: none;
|
|
1167
1167
|
text-align: center;
|
|
@@ -1176,8 +1176,8 @@ const At = st({
|
|
|
1176
1176
|
}
|
|
1177
1177
|
`,
|
|
1178
1178
|
value: v,
|
|
1179
|
-
onChange: (
|
|
1180
|
-
D(
|
|
1179
|
+
onChange: (f) => {
|
|
1180
|
+
D(f.target.value);
|
|
1181
1181
|
},
|
|
1182
1182
|
onBlur: () => {
|
|
1183
1183
|
e && x(e.id, {
|
|
@@ -1189,9 +1189,9 @@ const At = st({
|
|
|
1189
1189
|
),
|
|
1190
1190
|
footer: null,
|
|
1191
1191
|
closable: !1,
|
|
1192
|
-
className:
|
|
1192
|
+
className: C(
|
|
1193
1193
|
"group-item-modal",
|
|
1194
|
-
|
|
1194
|
+
h`
|
|
1195
1195
|
.rc-dialog-content {
|
|
1196
1196
|
background-color: transparent;
|
|
1197
1197
|
box-shadow: none;
|
|
@@ -1208,7 +1208,7 @@ const At = st({
|
|
|
1208
1208
|
.rc-dialog-body {
|
|
1209
1209
|
background-color: ${c.groupItemModalBackgroundColor};
|
|
1210
1210
|
@media (prefers-color-scheme: dark) {
|
|
1211
|
-
background-color: ${
|
|
1211
|
+
background-color: ${g.groupItemModalBackgroundColor};
|
|
1212
1212
|
}
|
|
1213
1213
|
border-radius: 0.5rem;
|
|
1214
1214
|
overflow: hidden;
|
|
@@ -1221,21 +1221,21 @@ const At = st({
|
|
|
1221
1221
|
children: /* @__PURE__ */ t(
|
|
1222
1222
|
"div",
|
|
1223
1223
|
{
|
|
1224
|
-
className:
|
|
1224
|
+
className: h`
|
|
1225
1225
|
overflow-y: auto;
|
|
1226
1226
|
max-height: 60vh;
|
|
1227
1227
|
padding: 1.25rem 0;
|
|
1228
1228
|
`,
|
|
1229
|
-
onDragLeave: (
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1229
|
+
onDragLeave: (f) => {
|
|
1230
|
+
const I = f.relatedTarget;
|
|
1231
|
+
I && (f.currentTarget.contains(I) || setTimeout(() => {
|
|
1232
1232
|
o();
|
|
1233
1233
|
}, 500));
|
|
1234
1234
|
},
|
|
1235
1235
|
children: /* @__PURE__ */ t(
|
|
1236
1236
|
Xe,
|
|
1237
1237
|
{
|
|
1238
|
-
className:
|
|
1238
|
+
className: h`
|
|
1239
1239
|
display: grid;
|
|
1240
1240
|
gap: 1rem;
|
|
1241
1241
|
place-items: center;
|
|
@@ -1247,28 +1247,28 @@ const At = st({
|
|
|
1247
1247
|
animation: 150,
|
|
1248
1248
|
fallbackOnBody: !0,
|
|
1249
1249
|
list: (e == null ? void 0 : e.children) ?? [],
|
|
1250
|
-
setList: (
|
|
1250
|
+
setList: (f) => {
|
|
1251
1251
|
var N, u;
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1252
|
+
const I = f.map((S) => S.id), y = (u = (N = a.find((S) => S.id === (e == null ? void 0 : e.id))) == null ? void 0 : N.children) == null ? void 0 : u.map((S) => S.id);
|
|
1253
|
+
I.length === (y == null ? void 0 : y.length) && I.every((S, U) => S === y[U]) || I.length < ((y == null ? void 0 : y.length) ?? 0) || s(f, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
|
|
1254
1254
|
},
|
|
1255
1255
|
onMove: () => (p(null), i("onMove"), !0),
|
|
1256
|
-
onStart: (
|
|
1257
|
-
const
|
|
1258
|
-
|
|
1256
|
+
onStart: (f) => {
|
|
1257
|
+
const I = f.item.dataset;
|
|
1258
|
+
I != null && I.id && d(I.id), i("onMove");
|
|
1259
1259
|
},
|
|
1260
1260
|
onEnd: () => {
|
|
1261
1261
|
d(null), p(null), i(null);
|
|
1262
1262
|
},
|
|
1263
1263
|
ghostClass: Rt,
|
|
1264
|
-
children:
|
|
1264
|
+
children: b.map((f, I) => /* @__PURE__ */ t(
|
|
1265
1265
|
We,
|
|
1266
1266
|
{
|
|
1267
|
-
data:
|
|
1268
|
-
itemIndex:
|
|
1267
|
+
data: f,
|
|
1268
|
+
itemIndex: I,
|
|
1269
1269
|
onClick: n
|
|
1270
1270
|
},
|
|
1271
|
-
|
|
1271
|
+
f.id
|
|
1272
1272
|
))
|
|
1273
1273
|
}
|
|
1274
1274
|
)
|
|
@@ -1307,19 +1307,19 @@ const At = st({
|
|
|
1307
1307
|
sliderProps: n,
|
|
1308
1308
|
sliderRef: a,
|
|
1309
1309
|
onItemClick: s
|
|
1310
|
-
} = r, i = xe(null), d = xe(null), {
|
|
1311
|
-
list:
|
|
1312
|
-
setList:
|
|
1313
|
-
setListStatus:
|
|
1314
|
-
showInfoItemData:
|
|
1315
|
-
setShowInfoItemData:
|
|
1316
|
-
openGroupItemData:
|
|
1317
|
-
setOpenGroupItemData:
|
|
1318
|
-
setMoveItemId:
|
|
1319
|
-
setMoveTargetId:
|
|
1320
|
-
addItem:
|
|
1321
|
-
} = pe(), { pagingDotBuilder:
|
|
1322
|
-
top:
|
|
1310
|
+
} = r, i = xe(null), d = xe(null), [p, x] = O(0), {
|
|
1311
|
+
list: l,
|
|
1312
|
+
setList: c,
|
|
1313
|
+
setListStatus: g,
|
|
1314
|
+
showInfoItemData: v,
|
|
1315
|
+
setShowInfoItemData: D,
|
|
1316
|
+
openGroupItemData: b,
|
|
1317
|
+
setOpenGroupItemData: f,
|
|
1318
|
+
setMoveItemId: I,
|
|
1319
|
+
setMoveTargetId: y,
|
|
1320
|
+
addItem: N
|
|
1321
|
+
} = pe(), { pagingDotBuilder: u, pagingDotsBuilder: S, itemBuilder: U } = le(), j = be(() => e === !1 ? {} : {
|
|
1322
|
+
top: h`
|
|
1323
1323
|
display: flex;
|
|
1324
1324
|
flex-direction: column;
|
|
1325
1325
|
.slick-list {
|
|
@@ -1329,12 +1329,12 @@ const At = st({
|
|
|
1329
1329
|
position: static;
|
|
1330
1330
|
}
|
|
1331
1331
|
`,
|
|
1332
|
-
bottom:
|
|
1332
|
+
bottom: h`
|
|
1333
1333
|
.slick-dots {
|
|
1334
1334
|
position: static;
|
|
1335
1335
|
}
|
|
1336
1336
|
`,
|
|
1337
|
-
left:
|
|
1337
|
+
left: h`
|
|
1338
1338
|
.slick-dots {
|
|
1339
1339
|
position: absolute;
|
|
1340
1340
|
width: auto;
|
|
@@ -1350,7 +1350,7 @@ const At = st({
|
|
|
1350
1350
|
}
|
|
1351
1351
|
}
|
|
1352
1352
|
`,
|
|
1353
|
-
right:
|
|
1353
|
+
right: h`
|
|
1354
1354
|
.slick-dots {
|
|
1355
1355
|
position: absolute;
|
|
1356
1356
|
width: auto;
|
|
@@ -1379,9 +1379,9 @@ const At = st({
|
|
|
1379
1379
|
dots: !0,
|
|
1380
1380
|
touchMove: !1,
|
|
1381
1381
|
lazyLoad: "anticipated",
|
|
1382
|
-
className:
|
|
1383
|
-
|
|
1384
|
-
|
|
1382
|
+
className: C(
|
|
1383
|
+
j,
|
|
1384
|
+
h`
|
|
1385
1385
|
.slick-track {
|
|
1386
1386
|
display: flex;
|
|
1387
1387
|
align-items: stretch;
|
|
@@ -1399,14 +1399,14 @@ const At = st({
|
|
|
1399
1399
|
`,
|
|
1400
1400
|
o
|
|
1401
1401
|
),
|
|
1402
|
-
customPaging: (
|
|
1403
|
-
var
|
|
1404
|
-
if (
|
|
1405
|
-
const
|
|
1406
|
-
return eo.cloneElement(
|
|
1407
|
-
onDragEnter: (
|
|
1408
|
-
var
|
|
1409
|
-
(
|
|
1402
|
+
customPaging: (k) => {
|
|
1403
|
+
var L, E;
|
|
1404
|
+
if (u) {
|
|
1405
|
+
const A = u(l[k], k, p === k);
|
|
1406
|
+
return eo.cloneElement(A, {
|
|
1407
|
+
onDragEnter: (V) => {
|
|
1408
|
+
var Y;
|
|
1409
|
+
(Y = (a ?? i).current) == null || Y.slickGoTo(k), A.props && A.props.onDragEnter && A.props.onDragEnter(V);
|
|
1410
1410
|
}
|
|
1411
1411
|
});
|
|
1412
1412
|
}
|
|
@@ -1414,20 +1414,20 @@ const At = st({
|
|
|
1414
1414
|
"div",
|
|
1415
1415
|
{
|
|
1416
1416
|
onDragEnter: () => {
|
|
1417
|
-
var
|
|
1418
|
-
(
|
|
1417
|
+
var A;
|
|
1418
|
+
(A = (a ?? i).current) == null || A.slickGoTo(k);
|
|
1419
1419
|
},
|
|
1420
|
-
children: (
|
|
1420
|
+
children: (E = (L = l[k]) == null ? void 0 : L.data) == null ? void 0 : E.name
|
|
1421
1421
|
}
|
|
1422
1422
|
);
|
|
1423
1423
|
},
|
|
1424
|
-
appendDots: (
|
|
1424
|
+
appendDots: (k) => S ? S(k) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
1425
1425
|
"ul",
|
|
1426
1426
|
{
|
|
1427
1427
|
ref: d,
|
|
1428
|
-
className:
|
|
1428
|
+
className: C(
|
|
1429
1429
|
"slick-dots-default",
|
|
1430
|
-
|
|
1430
|
+
h`
|
|
1431
1431
|
padding: 0.5rem;
|
|
1432
1432
|
display: inline-flex;
|
|
1433
1433
|
justify-content: center;
|
|
@@ -1448,31 +1448,34 @@ const At = st({
|
|
|
1448
1448
|
}
|
|
1449
1449
|
`
|
|
1450
1450
|
),
|
|
1451
|
-
children:
|
|
1451
|
+
children: k
|
|
1452
1452
|
}
|
|
1453
1453
|
) }),
|
|
1454
|
+
beforeChange: (k, L) => {
|
|
1455
|
+
x(L);
|
|
1456
|
+
},
|
|
1454
1457
|
...n,
|
|
1455
|
-
children:
|
|
1458
|
+
children: l.map((k) => /* @__PURE__ */ t(
|
|
1456
1459
|
"div",
|
|
1457
1460
|
{
|
|
1458
|
-
onDrop: (
|
|
1459
|
-
|
|
1460
|
-
const
|
|
1461
|
-
if (
|
|
1461
|
+
onDrop: (L) => {
|
|
1462
|
+
L.preventDefault();
|
|
1463
|
+
const E = L.dataTransfer.getData("text/plain");
|
|
1464
|
+
if (K.quickJSONCheck(E))
|
|
1462
1465
|
try {
|
|
1463
|
-
|
|
1464
|
-
} catch (
|
|
1465
|
-
console.log("drag error",
|
|
1466
|
+
N(JSON.parse(E), [k.id]);
|
|
1467
|
+
} catch (V) {
|
|
1468
|
+
console.log("drag error", V);
|
|
1466
1469
|
}
|
|
1467
1470
|
},
|
|
1468
|
-
onDragOver: (
|
|
1469
|
-
|
|
1471
|
+
onDragOver: (L) => {
|
|
1472
|
+
L.preventDefault();
|
|
1470
1473
|
},
|
|
1471
1474
|
children: /* @__PURE__ */ t(
|
|
1472
1475
|
Xe,
|
|
1473
1476
|
{
|
|
1474
|
-
className:
|
|
1475
|
-
|
|
1477
|
+
className: C(
|
|
1478
|
+
h`
|
|
1476
1479
|
display: grid;
|
|
1477
1480
|
transition: all 0.3s;
|
|
1478
1481
|
grid-template-columns: repeat(auto-fill, 96px);
|
|
@@ -1487,76 +1490,76 @@ const At = st({
|
|
|
1487
1490
|
fallbackOnBody: !0,
|
|
1488
1491
|
swapThreshold: 0.65,
|
|
1489
1492
|
group: "nested",
|
|
1490
|
-
list:
|
|
1491
|
-
setList: (
|
|
1493
|
+
list: k.children ?? [],
|
|
1494
|
+
setList: (L) => c(L, [k.id]),
|
|
1492
1495
|
filter: ".drag-disabled",
|
|
1493
|
-
onMove: (
|
|
1494
|
-
|
|
1495
|
-
const { dragged:
|
|
1496
|
-
return
|
|
1496
|
+
onMove: (L) => {
|
|
1497
|
+
g("onMove");
|
|
1498
|
+
const { dragged: E, related: A } = L, V = E.dataset, Y = A.dataset;
|
|
1499
|
+
return y(null), !((Object.keys(Y).length === 0 || Y.parentIds) && Number(V.childrenLength) > 0 && A.classList.contains("sortable-group-item"));
|
|
1497
1500
|
},
|
|
1498
|
-
onStart: (
|
|
1499
|
-
const
|
|
1500
|
-
|
|
1501
|
+
onStart: (L) => {
|
|
1502
|
+
const E = L.item.dataset;
|
|
1503
|
+
E != null && E.id && I(E.id), g("onMove");
|
|
1501
1504
|
},
|
|
1502
1505
|
onEnd: () => {
|
|
1503
|
-
|
|
1506
|
+
I(null), y(null), g(null);
|
|
1504
1507
|
},
|
|
1505
1508
|
ghostClass: Rt,
|
|
1506
|
-
children: (
|
|
1507
|
-
let
|
|
1508
|
-
if (
|
|
1509
|
-
return
|
|
1510
|
-
switch (
|
|
1509
|
+
children: (k.children ?? []).map((L, E) => {
|
|
1510
|
+
let A;
|
|
1511
|
+
if (U)
|
|
1512
|
+
return U(L);
|
|
1513
|
+
switch (L.type) {
|
|
1511
1514
|
case "group":
|
|
1512
1515
|
case "app":
|
|
1513
|
-
|
|
1516
|
+
A = /* @__PURE__ */ t(
|
|
1514
1517
|
zn,
|
|
1515
1518
|
{
|
|
1516
|
-
data:
|
|
1517
|
-
itemIndex:
|
|
1518
|
-
parentIds: [
|
|
1519
|
+
data: L,
|
|
1520
|
+
itemIndex: E,
|
|
1521
|
+
parentIds: [k.id, L.id],
|
|
1519
1522
|
onClick: s
|
|
1520
1523
|
},
|
|
1521
|
-
|
|
1524
|
+
L.id
|
|
1522
1525
|
);
|
|
1523
1526
|
break;
|
|
1524
1527
|
default:
|
|
1525
|
-
|
|
1528
|
+
A = /* @__PURE__ */ t(
|
|
1526
1529
|
We,
|
|
1527
1530
|
{
|
|
1528
|
-
data:
|
|
1529
|
-
itemIndex:
|
|
1531
|
+
data: L,
|
|
1532
|
+
itemIndex: E,
|
|
1530
1533
|
onClick: s
|
|
1531
1534
|
},
|
|
1532
|
-
|
|
1535
|
+
L.id
|
|
1533
1536
|
);
|
|
1534
1537
|
break;
|
|
1535
1538
|
}
|
|
1536
|
-
return
|
|
1539
|
+
return A;
|
|
1537
1540
|
})
|
|
1538
1541
|
}
|
|
1539
1542
|
)
|
|
1540
1543
|
},
|
|
1541
|
-
|
|
1544
|
+
k.id
|
|
1542
1545
|
))
|
|
1543
1546
|
}
|
|
1544
1547
|
),
|
|
1545
1548
|
/* @__PURE__ */ t(
|
|
1546
1549
|
$n,
|
|
1547
1550
|
{
|
|
1548
|
-
data:
|
|
1551
|
+
data: v,
|
|
1549
1552
|
onClose: () => {
|
|
1550
|
-
|
|
1553
|
+
D(null);
|
|
1551
1554
|
}
|
|
1552
1555
|
}
|
|
1553
1556
|
),
|
|
1554
1557
|
/* @__PURE__ */ t(
|
|
1555
1558
|
En,
|
|
1556
1559
|
{
|
|
1557
|
-
data:
|
|
1560
|
+
data: b,
|
|
1558
1561
|
onClose: () => {
|
|
1559
|
-
|
|
1562
|
+
f(null);
|
|
1560
1563
|
},
|
|
1561
1564
|
onItemClick: s
|
|
1562
1565
|
}
|
|
@@ -1575,7 +1578,7 @@ const At = st({
|
|
|
1575
1578
|
contextMenuBuilder: x,
|
|
1576
1579
|
itemBuilder: l,
|
|
1577
1580
|
itemIconBuilder: c,
|
|
1578
|
-
pagingDotBuilder:
|
|
1581
|
+
pagingDotBuilder: g,
|
|
1579
1582
|
pagingDotsBuilder: v,
|
|
1580
1583
|
...D
|
|
1581
1584
|
} = r;
|
|
@@ -1589,14 +1592,14 @@ const At = st({
|
|
|
1589
1592
|
noLetters: d,
|
|
1590
1593
|
contextMenu: p,
|
|
1591
1594
|
pagingDotsBuilder: v,
|
|
1592
|
-
pagingDotBuilder:
|
|
1595
|
+
pagingDotBuilder: g,
|
|
1593
1596
|
itemBuilder: l,
|
|
1594
1597
|
itemIconBuilder: c,
|
|
1595
1598
|
contextMenuBuilder: x
|
|
1596
1599
|
}, children: [
|
|
1597
1600
|
/* @__PURE__ */ t(() => {
|
|
1598
1601
|
const y = pe(), N = le();
|
|
1599
|
-
return
|
|
1602
|
+
return se(() => {
|
|
1600
1603
|
e && (typeof e == "function" ? e({ state: y, config: N }) : e.current = { state: y, config: N });
|
|
1601
1604
|
}, [y, N]), null;
|
|
1602
1605
|
}, {}),
|
|
@@ -1726,7 +1729,7 @@ const At = st({
|
|
|
1726
1729
|
On
|
|
1727
1730
|
);
|
|
1728
1731
|
return typeof a != "string" ? e : o ? a.replace(/{{(.*?)}}/g, (s, i) => o[i]) : a;
|
|
1729
|
-
}, _n =
|
|
1732
|
+
}, _n = h`
|
|
1730
1733
|
--accentBase: var(--tomato-1);
|
|
1731
1734
|
--accentBgSubtle: var(--tomato-2);
|
|
1732
1735
|
--accentBg: var(--tomato-3);
|
|
@@ -1780,7 +1783,7 @@ const At = st({
|
|
|
1780
1783
|
rgba(255, 255, 255, 0.05),
|
|
1781
1784
|
rgba(255, 255, 255, 0.05)
|
|
1782
1785
|
);
|
|
1783
|
-
`, jn =
|
|
1786
|
+
`, jn = h`
|
|
1784
1787
|
[class*="_toolbarRoot"] {
|
|
1785
1788
|
flex-wrap: wrap;
|
|
1786
1789
|
transition: all 0.3s;
|
|
@@ -1850,9 +1853,9 @@ const At = st({
|
|
|
1850
1853
|
margin-bottom: 0;
|
|
1851
1854
|
}
|
|
1852
1855
|
}
|
|
1853
|
-
`, Bt =
|
|
1856
|
+
`, Bt = C(
|
|
1854
1857
|
"markdown-body",
|
|
1855
|
-
|
|
1858
|
+
h`
|
|
1856
1859
|
p {
|
|
1857
1860
|
margin-bottom: 8px;
|
|
1858
1861
|
}
|
|
@@ -1873,7 +1876,7 @@ const At = st({
|
|
|
1873
1876
|
}
|
|
1874
1877
|
}
|
|
1875
1878
|
`
|
|
1876
|
-
), zt =
|
|
1879
|
+
), zt = h`
|
|
1877
1880
|
.markdown-body {
|
|
1878
1881
|
/* light */
|
|
1879
1882
|
color-scheme: light;
|
|
@@ -1928,7 +1931,7 @@ const At = st({
|
|
|
1928
1931
|
--color-prettylights-syntax-meta-diff-range: #8250df;
|
|
1929
1932
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
|
|
1930
1933
|
}
|
|
1931
|
-
`, Et =
|
|
1934
|
+
`, Et = h`
|
|
1932
1935
|
.markdown-body {
|
|
1933
1936
|
/* dark */
|
|
1934
1937
|
color-scheme: dark;
|
|
@@ -2001,7 +2004,7 @@ const At = st({
|
|
|
2001
2004
|
viewMode: "rich-text"
|
|
2002
2005
|
},
|
|
2003
2006
|
headings: c,
|
|
2004
|
-
link:
|
|
2007
|
+
link: g,
|
|
2005
2008
|
codeBlock: v,
|
|
2006
2009
|
codeMirror: D = {
|
|
2007
2010
|
codeBlockLanguages: {
|
|
@@ -2012,27 +2015,27 @@ const At = st({
|
|
|
2012
2015
|
"": "Unspecified"
|
|
2013
2016
|
}
|
|
2014
2017
|
},
|
|
2015
|
-
directives:
|
|
2018
|
+
directives: b = {
|
|
2016
2019
|
directiveDescriptors: [Lo]
|
|
2017
2020
|
}
|
|
2018
|
-
} = a ?? {}, [
|
|
2019
|
-
return
|
|
2021
|
+
} = a ?? {}, [f, I] = O("");
|
|
2022
|
+
return se(() => {
|
|
2020
2023
|
var y;
|
|
2021
|
-
e !== void 0 && p.current && ((y = p.current) == null || y.setMarkdown(e),
|
|
2024
|
+
e !== void 0 && p.current && ((y = p.current) == null || y.setMarkdown(e), I(e));
|
|
2022
2025
|
}, [e, p]), /* @__PURE__ */ t(
|
|
2023
2026
|
Ao,
|
|
2024
2027
|
{
|
|
2025
2028
|
ref: p,
|
|
2026
|
-
className:
|
|
2029
|
+
className: C(
|
|
2027
2030
|
jn,
|
|
2028
2031
|
_e(i) ? _n : "",
|
|
2029
2032
|
_e(i) ? Et : zt,
|
|
2030
2033
|
s
|
|
2031
2034
|
),
|
|
2032
2035
|
contentEditableClassName: Bt,
|
|
2033
|
-
markdown:
|
|
2036
|
+
markdown: f,
|
|
2034
2037
|
onChange: (y) => {
|
|
2035
|
-
!e && !o &&
|
|
2038
|
+
!e && !o && I(y), o && o(y);
|
|
2036
2039
|
},
|
|
2037
2040
|
translation: n ?? Fn,
|
|
2038
2041
|
plugins: [
|
|
@@ -2062,7 +2065,7 @@ const At = st({
|
|
|
2062
2065
|
Po(),
|
|
2063
2066
|
Bo(),
|
|
2064
2067
|
zo(c),
|
|
2065
|
-
Eo(
|
|
2068
|
+
Eo(g),
|
|
2066
2069
|
$o(),
|
|
2067
2070
|
Ho(x),
|
|
2068
2071
|
Oo(),
|
|
@@ -2071,7 +2074,7 @@ const At = st({
|
|
|
2071
2074
|
jo(v),
|
|
2072
2075
|
Xo(D),
|
|
2073
2076
|
Uo(),
|
|
2074
|
-
Go(
|
|
2077
|
+
Go(b)
|
|
2075
2078
|
],
|
|
2076
2079
|
...d
|
|
2077
2080
|
}
|
|
@@ -2085,7 +2088,7 @@ const At = st({
|
|
|
2085
2088
|
children: /* @__PURE__ */ t(
|
|
2086
2089
|
wt,
|
|
2087
2090
|
{
|
|
2088
|
-
className:
|
|
2091
|
+
className: C(Bt, o),
|
|
2089
2092
|
remarkPlugins: [nr, ar],
|
|
2090
2093
|
rehypePlugins: [sr],
|
|
2091
2094
|
components: {
|
|
@@ -2124,7 +2127,7 @@ const At = st({
|
|
|
2124
2127
|
mask: " ",
|
|
2125
2128
|
...i
|
|
2126
2129
|
},
|
|
2127
|
-
className:
|
|
2130
|
+
className: h`
|
|
2128
2131
|
cursor: zoom-in;
|
|
2129
2132
|
`,
|
|
2130
2133
|
...d
|
|
@@ -2154,19 +2157,19 @@ const Ke = (r) => {
|
|
|
2154
2157
|
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",
|
|
2155
2158
|
childrenClassName: x,
|
|
2156
2159
|
...l
|
|
2157
|
-
} = r, c = xe(null),
|
|
2158
|
-
var
|
|
2159
|
-
const
|
|
2160
|
-
return
|
|
2161
|
-
}), v = ge(
|
|
2162
|
-
|
|
2160
|
+
} = r, c = xe(null), g = ge(e, (L) => {
|
|
2161
|
+
var A;
|
|
2162
|
+
const E = ((A = c.current) == null ? void 0 : A.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
2163
|
+
return L - E.x - E.width / 2;
|
|
2164
|
+
}), v = ge(g, [-150, 0, 150], [40, 80, 40]), D = ge(g, [-150, 0, 150], [40, 80, 40]), b = ge(
|
|
2165
|
+
g,
|
|
2163
2166
|
[-150, 0, 150],
|
|
2164
2167
|
[20, 40, 20]
|
|
2165
|
-
),
|
|
2166
|
-
|
|
2168
|
+
), f = ge(
|
|
2169
|
+
g,
|
|
2167
2170
|
[-150, 0, 150],
|
|
2168
2171
|
[20, 40, 20]
|
|
2169
|
-
),
|
|
2172
|
+
), I = Ae(v, {
|
|
2170
2173
|
mass: 0.1,
|
|
2171
2174
|
stiffness: 150,
|
|
2172
2175
|
damping: 12
|
|
@@ -2174,28 +2177,28 @@ const Ke = (r) => {
|
|
|
2174
2177
|
mass: 0.1,
|
|
2175
2178
|
stiffness: 150,
|
|
2176
2179
|
damping: 12
|
|
2177
|
-
}), N = Ae(
|
|
2180
|
+
}), N = Ae(b, {
|
|
2178
2181
|
mass: 0.1,
|
|
2179
2182
|
stiffness: 150,
|
|
2180
2183
|
damping: 12
|
|
2181
|
-
}), u = Ae(
|
|
2184
|
+
}), u = Ae(f, {
|
|
2182
2185
|
mass: 0.1,
|
|
2183
2186
|
stiffness: 150,
|
|
2184
2187
|
damping: 12
|
|
2185
|
-
}),
|
|
2188
|
+
}), S = ge(N, (L) => `${L}px`), [U, j] = O(!1), k = /* @__PURE__ */ m(
|
|
2186
2189
|
i,
|
|
2187
2190
|
{
|
|
2188
2191
|
ref: c,
|
|
2189
|
-
style: { width:
|
|
2190
|
-
onMouseEnter: () =>
|
|
2191
|
-
onMouseLeave: () =>
|
|
2192
|
+
style: { width: I, height: y },
|
|
2193
|
+
onMouseEnter: () => j(!0),
|
|
2194
|
+
onMouseLeave: () => j(!1),
|
|
2192
2195
|
className: ve(
|
|
2193
2196
|
"aspect-square flex items-center justify-center relative",
|
|
2194
2197
|
d
|
|
2195
2198
|
),
|
|
2196
2199
|
...l,
|
|
2197
2200
|
children: [
|
|
2198
|
-
o && /* @__PURE__ */ t(Ue, { children:
|
|
2201
|
+
o && /* @__PURE__ */ t(Ue, { children: U && /* @__PURE__ */ t(
|
|
2199
2202
|
R.div,
|
|
2200
2203
|
{
|
|
2201
2204
|
initial: { opacity: 0, y: 10, x: "-50%" },
|
|
@@ -2208,23 +2211,22 @@ const Ke = (r) => {
|
|
|
2208
2211
|
children: o
|
|
2209
2212
|
}
|
|
2210
2213
|
) }),
|
|
2211
|
-
" ",
|
|
2212
2214
|
/* @__PURE__ */ t(
|
|
2213
2215
|
R.div,
|
|
2214
2216
|
{
|
|
2215
2217
|
style: {
|
|
2216
2218
|
width: N,
|
|
2217
2219
|
height: u,
|
|
2218
|
-
fontSize:
|
|
2220
|
+
fontSize: S
|
|
2219
2221
|
},
|
|
2220
2222
|
className: ve("flex items-center justify-center", x),
|
|
2221
|
-
children: typeof s == "function" ? s({ widthIcon: N, heightIcon: u, fontSizeTransform:
|
|
2223
|
+
children: typeof s == "function" ? s({ widthIcon: N, heightIcon: u, fontSizeTransform: S }) : s || n
|
|
2222
2224
|
}
|
|
2223
2225
|
)
|
|
2224
2226
|
]
|
|
2225
2227
|
}
|
|
2226
2228
|
);
|
|
2227
|
-
return a ? /* @__PURE__ */ t("a", { href: a, children:
|
|
2229
|
+
return a ? /* @__PURE__ */ t("a", { href: a, children: k }) : k;
|
|
2228
2230
|
}, Je = (r) => {
|
|
2229
2231
|
const {
|
|
2230
2232
|
items: e = [],
|
|
@@ -2286,7 +2288,7 @@ const Ke = (r) => {
|
|
|
2286
2288
|
autoHidden: a = !1,
|
|
2287
2289
|
itemBuilder: s,
|
|
2288
2290
|
children: i
|
|
2289
|
-
} = r, [d, p] =
|
|
2291
|
+
} = r, [d, p] = O(!1), x = () => {
|
|
2290
2292
|
p(!d);
|
|
2291
2293
|
};
|
|
2292
2294
|
return /* @__PURE__ */ m(
|
|
@@ -2444,43 +2446,43 @@ function Wn(r) {
|
|
|
2444
2446
|
let e = "", o = !1;
|
|
2445
2447
|
function n(l, c) {
|
|
2446
2448
|
if (c.focus(), !l.dataTransfer) return;
|
|
2447
|
-
const
|
|
2449
|
+
const g = ot(
|
|
2448
2450
|
{
|
|
2449
2451
|
x: l.clientX + 50 + r.dragHandleWidth,
|
|
2450
2452
|
y: l.clientY
|
|
2451
2453
|
},
|
|
2452
2454
|
r
|
|
2453
2455
|
);
|
|
2454
|
-
if (!(
|
|
2455
|
-
let v = rt(
|
|
2456
|
+
if (!(g instanceof Element)) return;
|
|
2457
|
+
let v = rt(g, c, r);
|
|
2456
2458
|
if (v == null || v < 0) return;
|
|
2457
2459
|
v = Re(v, c);
|
|
2458
|
-
const { from: D, to:
|
|
2460
|
+
const { from: D, to: b } = c.state.selection, f = D - b, I = Re(D, c);
|
|
2459
2461
|
let y = !1;
|
|
2460
|
-
const N = c.state.doc.resolve(
|
|
2462
|
+
const N = c.state.doc.resolve(I);
|
|
2461
2463
|
if (N.node().type.name === "doc") y = !0;
|
|
2462
2464
|
else {
|
|
2463
|
-
const
|
|
2465
|
+
const k = Q.create(
|
|
2464
2466
|
c.state.doc,
|
|
2465
2467
|
N.before()
|
|
2466
2468
|
);
|
|
2467
|
-
y = !(v + 1 >=
|
|
2469
|
+
y = !(v + 1 >= k.$from.pos && v <= k.$to.pos);
|
|
2468
2470
|
}
|
|
2469
2471
|
let u = c.state.selection;
|
|
2470
|
-
if (!y &&
|
|
2471
|
-
const
|
|
2472
|
+
if (!y && f !== 0 && !(c.state.selection instanceof Q)) {
|
|
2473
|
+
const k = Q.create(c.state.doc, b - 1);
|
|
2472
2474
|
u = tn.create(
|
|
2473
2475
|
c.state.doc,
|
|
2474
2476
|
v,
|
|
2475
|
-
|
|
2477
|
+
k.$to.pos
|
|
2476
2478
|
);
|
|
2477
|
-
} else if (u =
|
|
2478
|
-
const
|
|
2479
|
-
u =
|
|
2479
|
+
} else if (u = Q.create(c.state.doc, v), u.node.type.isInline || u.node.type.name === "tableRow") {
|
|
2480
|
+
const k = c.state.doc.resolve(u.from);
|
|
2481
|
+
u = Q.create(c.state.doc, k.before());
|
|
2480
2482
|
}
|
|
2481
|
-
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof
|
|
2482
|
-
const
|
|
2483
|
-
l.dataTransfer.clearData(), l.dataTransfer.setData("text/html",
|
|
2483
|
+
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof Q && c.state.selection.node.type.name === "listItem" && (e = g.parentElement.tagName);
|
|
2484
|
+
const S = c.state.selection.content(), { dom: U, text: j } = Yn(c, S);
|
|
2485
|
+
l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", U.innerHTML), l.dataTransfer.setData("text/plain", j), l.dataTransfer.effectAllowed = "copyMove", l.dataTransfer.setDragImage(g, 0, 0), c.dragging = { slice: S, move: l.ctrlKey };
|
|
2484
2486
|
}
|
|
2485
2487
|
let a = null;
|
|
2486
2488
|
function s() {
|
|
@@ -2490,14 +2492,14 @@ function Wn(r) {
|
|
|
2490
2492
|
a && a.classList.remove("hide");
|
|
2491
2493
|
}
|
|
2492
2494
|
function d(l, c) {
|
|
2493
|
-
const
|
|
2495
|
+
const g = Re(c, l), v = Q.create(l.state.doc, g);
|
|
2494
2496
|
l.dispatch(l.state.tr.setSelection(v)), l.focus(), o = !0;
|
|
2495
2497
|
}
|
|
2496
2498
|
function p(l) {
|
|
2497
|
-
if (o = l.state.selection instanceof
|
|
2498
|
-
const
|
|
2499
|
+
if (o = l.state.selection instanceof Q, o && (a != null && a.dataset.nodePos)) {
|
|
2500
|
+
const g = parseInt(a.dataset.nodePos, 10);
|
|
2499
2501
|
try {
|
|
2500
|
-
const v = l.state.doc.resolve(
|
|
2502
|
+
const v = l.state.doc.resolve(g);
|
|
2501
2503
|
v && v.parent && v.parent.type.name !== "doc" || (o = !1, s());
|
|
2502
2504
|
} catch {
|
|
2503
2505
|
o = !1, s();
|
|
@@ -2512,19 +2514,19 @@ function Wn(r) {
|
|
|
2512
2514
|
o || s();
|
|
2513
2515
|
return;
|
|
2514
2516
|
}
|
|
2515
|
-
const
|
|
2516
|
-
!
|
|
2517
|
+
const g = c.closest(".drag-handle") || c.classList.contains("drag-handle"), v = c.closest(".tiptap") || c.classList.contains("tiptap");
|
|
2518
|
+
!g && !v && !o && s();
|
|
2517
2519
|
}
|
|
2518
2520
|
return new Qr({
|
|
2519
2521
|
key: new en(r.pluginKey),
|
|
2520
2522
|
view: (l) => {
|
|
2521
|
-
var
|
|
2523
|
+
var b, f, I, y;
|
|
2522
2524
|
const c = r.dragHandleSelector ? document.querySelector(r.dragHandleSelector) : null;
|
|
2523
2525
|
a = c ?? document.createElement("div"), a.draggable = !0, a.dataset.dragHandle = "", a.classList.add("drag-handle");
|
|
2524
|
-
function
|
|
2526
|
+
function g(N) {
|
|
2525
2527
|
n(N, l);
|
|
2526
2528
|
}
|
|
2527
|
-
a.addEventListener("dragstart",
|
|
2529
|
+
a.addEventListener("dragstart", g);
|
|
2528
2530
|
function v(N) {
|
|
2529
2531
|
c || (N.preventDefault(), N.stopPropagation());
|
|
2530
2532
|
const u = a == null ? void 0 : a.dataset.nodePos;
|
|
@@ -2536,16 +2538,16 @@ function Wn(r) {
|
|
|
2536
2538
|
const u = window.scrollY;
|
|
2537
2539
|
N.clientY < r.scrollTreshold ? window.scrollTo({ top: u - 30, behavior: "smooth" }) : window.innerHeight - N.clientY < r.scrollTreshold && window.scrollTo({ top: u + 30, behavior: "smooth" });
|
|
2538
2540
|
}
|
|
2539
|
-
return a.addEventListener("drag", D), s(), c || (
|
|
2541
|
+
return a.addEventListener("drag", D), s(), c || (f = (b = l == null ? void 0 : l.dom) == null ? void 0 : b.parentElement) == null || f.appendChild(a), (y = (I = l == null ? void 0 : l.dom) == null ? void 0 : I.parentElement) == null || y.addEventListener(
|
|
2540
2542
|
"mouseout",
|
|
2541
2543
|
x
|
|
2542
2544
|
), {
|
|
2543
2545
|
destroy: () => {
|
|
2544
|
-
var N, u,
|
|
2546
|
+
var N, u, S;
|
|
2545
2547
|
c || (N = a == null ? void 0 : a.remove) == null || N.call(a), a == null || a.removeEventListener("drag", D), a == null || a.removeEventListener(
|
|
2546
2548
|
"dragstart",
|
|
2547
|
-
|
|
2548
|
-
), a == null || a.removeEventListener("click", v), a = null, (
|
|
2549
|
+
g
|
|
2550
|
+
), a == null || a.removeEventListener("click", v), a = null, (S = (u = l == null ? void 0 : l.dom) == null ? void 0 : u.parentElement) == null || S.removeEventListener(
|
|
2549
2551
|
"mouseout",
|
|
2550
2552
|
x
|
|
2551
2553
|
);
|
|
@@ -2557,23 +2559,23 @@ function Wn(r) {
|
|
|
2557
2559
|
mousemove: (l, c) => {
|
|
2558
2560
|
if (!l.editable)
|
|
2559
2561
|
return;
|
|
2560
|
-
const
|
|
2562
|
+
const g = ot(
|
|
2561
2563
|
{
|
|
2562
2564
|
x: c.clientX + 50 + r.dragHandleWidth,
|
|
2563
2565
|
y: c.clientY
|
|
2564
2566
|
},
|
|
2565
2567
|
r
|
|
2566
|
-
), v =
|
|
2567
|
-
if (!(
|
|
2568
|
+
), v = g == null ? void 0 : g.closest(".not-draggable"), D = r.excludedTags.concat(["ol", "ul"]).join(", ");
|
|
2569
|
+
if (!(g instanceof Element) || g.matches(D) || v) {
|
|
2568
2570
|
o || s();
|
|
2569
2571
|
return;
|
|
2570
2572
|
}
|
|
2571
|
-
const
|
|
2572
|
-
|
|
2573
|
-
Re(
|
|
2573
|
+
const b = rt(g, l, r);
|
|
2574
|
+
b != null && b >= 0 && (a.dataset.nodePos = String(
|
|
2575
|
+
Re(b, l)
|
|
2574
2576
|
));
|
|
2575
|
-
const
|
|
2576
|
-
u.top += (y - 24) / 2, u.top += N,
|
|
2577
|
+
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 = Vn(g);
|
|
2578
|
+
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, a && (a.style.position = "absolute", a.style.left = `${u.left - u.width}px`, a.style.top = `${u.top}px`, i());
|
|
2577
2579
|
},
|
|
2578
2580
|
keydown: () => {
|
|
2579
2581
|
o || s();
|
|
@@ -2590,20 +2592,20 @@ function Wn(r) {
|
|
|
2590
2592
|
l.dom.classList.add("dragging");
|
|
2591
2593
|
},
|
|
2592
2594
|
drop: (l, c) => {
|
|
2593
|
-
var
|
|
2595
|
+
var f;
|
|
2594
2596
|
l.dom.classList.remove("dragging"), s();
|
|
2595
|
-
let
|
|
2597
|
+
let g = null;
|
|
2596
2598
|
const v = l.posAtCoords({
|
|
2597
2599
|
left: c.clientX,
|
|
2598
2600
|
top: c.clientY
|
|
2599
2601
|
});
|
|
2600
|
-
if (!v || (l.state.selection instanceof
|
|
2601
|
-
const
|
|
2602
|
-
if (l.state.selection instanceof
|
|
2603
|
-
const
|
|
2602
|
+
if (!v || (l.state.selection instanceof Q && (g = l.state.selection.node), !g)) return;
|
|
2603
|
+
const b = l.state.doc.resolve(v.pos).parent.type.name === "listItem";
|
|
2604
|
+
if (l.state.selection instanceof Q && l.state.selection.node.type.name === "listItem" && !b && e == "OL") {
|
|
2605
|
+
const I = (f = l.state.schema.nodes.orderedList) == null ? void 0 : f.createAndFill(
|
|
2604
2606
|
null,
|
|
2605
|
-
|
|
2606
|
-
), y = new on(rn.from(
|
|
2607
|
+
g
|
|
2608
|
+
), y = new on(rn.from(I), 0, 0);
|
|
2607
2609
|
l.dragging = { slice: y, move: c.ctrlKey };
|
|
2608
2610
|
}
|
|
2609
2611
|
},
|
|
@@ -2617,12 +2619,12 @@ function Wn(r) {
|
|
|
2617
2619
|
init() {
|
|
2618
2620
|
return {};
|
|
2619
2621
|
},
|
|
2620
|
-
apply(l, c,
|
|
2622
|
+
apply(l, c, g, v) {
|
|
2621
2623
|
if (l.docChanged && a && a.dataset.nodePos) {
|
|
2622
2624
|
const D = parseInt(a.dataset.nodePos, 10);
|
|
2623
2625
|
try {
|
|
2624
|
-
const
|
|
2625
|
-
(!
|
|
2626
|
+
const b = v.doc.resolve(D);
|
|
2627
|
+
(!b || b.parent.type.name === "doc") && (o = !1, s());
|
|
2626
2628
|
} catch {
|
|
2627
2629
|
o = !1, s();
|
|
2628
2630
|
}
|
|
@@ -2658,7 +2660,7 @@ const Kn = Zr.create({
|
|
|
2658
2660
|
placeholder: "撰写任何内容,或者按“/”输入命令..."
|
|
2659
2661
|
}), Qn = pr.configure({
|
|
2660
2662
|
HTMLAttributes: {
|
|
2661
|
-
class:
|
|
2663
|
+
class: W(
|
|
2662
2664
|
"text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
|
|
2663
2665
|
)
|
|
2664
2666
|
}
|
|
@@ -2666,63 +2668,63 @@ const Kn = Zr.create({
|
|
|
2666
2668
|
addProseMirrorPlugins() {
|
|
2667
2669
|
return [
|
|
2668
2670
|
fr({
|
|
2669
|
-
imageClass:
|
|
2671
|
+
imageClass: W("opacity-40 rounded-lg border border-stone-200")
|
|
2670
2672
|
})
|
|
2671
2673
|
];
|
|
2672
2674
|
}
|
|
2673
2675
|
}).configure({
|
|
2674
2676
|
allowBase64: !0,
|
|
2675
2677
|
HTMLAttributes: {
|
|
2676
|
-
class:
|
|
2678
|
+
class: W("rounded-lg border border-muted")
|
|
2677
2679
|
}
|
|
2678
2680
|
}), ta = hr.configure({
|
|
2679
2681
|
HTMLAttributes: {
|
|
2680
|
-
class:
|
|
2682
|
+
class: W("rounded-lg border border-muted")
|
|
2681
2683
|
}
|
|
2682
2684
|
}), oa = br.configure({
|
|
2683
2685
|
HTMLAttributes: {
|
|
2684
|
-
class:
|
|
2686
|
+
class: W("not-prose pl-2 ")
|
|
2685
2687
|
}
|
|
2686
2688
|
}), ra = xr.configure({
|
|
2687
2689
|
HTMLAttributes: {
|
|
2688
|
-
class:
|
|
2690
|
+
class: W("flex gap-2 items-start my-4")
|
|
2689
2691
|
},
|
|
2690
2692
|
nested: !0
|
|
2691
2693
|
}), na = yr.configure({
|
|
2692
2694
|
HTMLAttributes: {
|
|
2693
|
-
class:
|
|
2695
|
+
class: W("mt-4 mb-6 border-t border-muted-foreground")
|
|
2694
2696
|
}
|
|
2695
2697
|
}), aa = vr.configure({
|
|
2696
2698
|
bulletList: {
|
|
2697
2699
|
HTMLAttributes: {
|
|
2698
|
-
class:
|
|
2700
|
+
class: W("list-disc list-outside leading-3 -mt-2")
|
|
2699
2701
|
}
|
|
2700
2702
|
},
|
|
2701
2703
|
orderedList: {
|
|
2702
2704
|
HTMLAttributes: {
|
|
2703
|
-
class:
|
|
2705
|
+
class: W("list-decimal list-outside leading-3 -mt-2")
|
|
2704
2706
|
}
|
|
2705
2707
|
},
|
|
2706
2708
|
listItem: {
|
|
2707
2709
|
HTMLAttributes: {
|
|
2708
|
-
class:
|
|
2710
|
+
class: W("leading-normal -mb-2")
|
|
2709
2711
|
}
|
|
2710
2712
|
},
|
|
2711
2713
|
blockquote: {
|
|
2712
2714
|
HTMLAttributes: {
|
|
2713
|
-
class:
|
|
2715
|
+
class: W("border-l-4 border-primary")
|
|
2714
2716
|
}
|
|
2715
2717
|
},
|
|
2716
2718
|
codeBlock: {
|
|
2717
2719
|
HTMLAttributes: {
|
|
2718
|
-
class:
|
|
2720
|
+
class: W(
|
|
2719
2721
|
"rounded-md bg-muted text-muted-foreground border p-5 font-mono font-medium"
|
|
2720
2722
|
)
|
|
2721
2723
|
}
|
|
2722
2724
|
},
|
|
2723
2725
|
code: {
|
|
2724
2726
|
HTMLAttributes: {
|
|
2725
|
-
class:
|
|
2727
|
+
class: W("rounded-md bg-muted px-1.5 py-1 font-mono font-medium"),
|
|
2726
2728
|
spellcheck: "false"
|
|
2727
2729
|
}
|
|
2728
2730
|
},
|
|
@@ -2738,7 +2740,7 @@ const Kn = Zr.create({
|
|
|
2738
2740
|
lowlight: Kr(Jr)
|
|
2739
2741
|
}), ia = Cr.configure({
|
|
2740
2742
|
HTMLAttributes: {
|
|
2741
|
-
class:
|
|
2743
|
+
class: W("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
|
|
2742
2744
|
},
|
|
2743
2745
|
katexOptions: {
|
|
2744
2746
|
throwOnError: !1
|
|
@@ -2781,7 +2783,7 @@ const Kn = Zr.create({
|
|
|
2781
2783
|
ref: a,
|
|
2782
2784
|
align: e,
|
|
2783
2785
|
sideOffset: o,
|
|
2784
|
-
className:
|
|
2786
|
+
className: C(
|
|
2785
2787
|
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2786
2788
|
r
|
|
2787
2789
|
),
|
|
@@ -2813,17 +2815,17 @@ const ua = Wr(
|
|
|
2813
2815
|
size: "default"
|
|
2814
2816
|
}
|
|
2815
2817
|
}
|
|
2816
|
-
),
|
|
2818
|
+
), ee = q.forwardRef(
|
|
2817
2819
|
({ className: r, variant: e, size: o, asChild: n = !1, ...a }, s) => /* @__PURE__ */ t(
|
|
2818
2820
|
n ? sn : "button",
|
|
2819
2821
|
{
|
|
2820
|
-
className:
|
|
2822
|
+
className: C(ua({ variant: e, size: o, className: r })),
|
|
2821
2823
|
ref: s,
|
|
2822
2824
|
...a
|
|
2823
2825
|
}
|
|
2824
2826
|
)
|
|
2825
2827
|
);
|
|
2826
|
-
|
|
2828
|
+
ee.displayName = "Button";
|
|
2827
2829
|
const nt = [
|
|
2828
2830
|
{
|
|
2829
2831
|
name: "默认",
|
|
@@ -2920,7 +2922,7 @@ const nt = [
|
|
|
2920
2922
|
dt,
|
|
2921
2923
|
{
|
|
2922
2924
|
classNames: {
|
|
2923
|
-
root:
|
|
2925
|
+
root: h`
|
|
2924
2926
|
background-color: transparent;
|
|
2925
2927
|
padding: 0;
|
|
2926
2928
|
.rc-tooltip-content {
|
|
@@ -2933,7 +2935,7 @@ const nt = [
|
|
|
2933
2935
|
...r
|
|
2934
2936
|
}
|
|
2935
2937
|
), pa = ({ open: r, onOpenChange: e }) => {
|
|
2936
|
-
const { editor: o } =
|
|
2938
|
+
const { editor: o } = te();
|
|
2937
2939
|
if (!o) return null;
|
|
2938
2940
|
const n = nt.find(
|
|
2939
2941
|
({ color: s }) => o.isActive("textStyle", { color: s })
|
|
@@ -2941,7 +2943,7 @@ const nt = [
|
|
|
2941
2943
|
({ color: s }) => o.isActive("highlight", { color: s })
|
|
2942
2944
|
);
|
|
2943
2945
|
return /* @__PURE__ */ m(ma, { modal: !0, open: r, onOpenChange: e, children: [
|
|
2944
|
-
/* @__PURE__ */ t(me, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(Ft, { asChild: !0, children: /* @__PURE__ */ m(
|
|
2946
|
+
/* @__PURE__ */ t(me, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(Ft, { asChild: !0, children: /* @__PURE__ */ m(ee, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
|
|
2945
2947
|
/* @__PURE__ */ t(
|
|
2946
2948
|
"span",
|
|
2947
2949
|
{
|
|
@@ -3038,13 +3040,13 @@ function fa(r) {
|
|
|
3038
3040
|
}
|
|
3039
3041
|
}
|
|
3040
3042
|
const ha = ({ open: r, onOpenChange: e }) => {
|
|
3041
|
-
const o = xe(null), { editor: n } =
|
|
3042
|
-
return
|
|
3043
|
+
const o = xe(null), { editor: n } = te();
|
|
3044
|
+
return se(() => {
|
|
3043
3045
|
var a;
|
|
3044
3046
|
(a = o.current) == null || a.focus();
|
|
3045
3047
|
}), n ? /* @__PURE__ */ m(It, { modal: !0, open: r, onOpenChange: e, children: [
|
|
3046
3048
|
/* @__PURE__ */ t(me, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(an, { asChild: !0, children: /* @__PURE__ */ m(
|
|
3047
|
-
|
|
3049
|
+
ee,
|
|
3048
3050
|
{
|
|
3049
3051
|
size: "sm",
|
|
3050
3052
|
variant: "ghost",
|
|
@@ -3054,7 +3056,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3054
3056
|
/* @__PURE__ */ t(
|
|
3055
3057
|
"p",
|
|
3056
3058
|
{
|
|
3057
|
-
className:
|
|
3059
|
+
className: C(
|
|
3058
3060
|
"underline decoration-stone-400 underline-offset-4",
|
|
3059
3061
|
{
|
|
3060
3062
|
"text-blue-500": n.isActive("link")
|
|
@@ -3088,7 +3090,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3088
3090
|
}
|
|
3089
3091
|
),
|
|
3090
3092
|
n.getAttributes("link").href ? /* @__PURE__ */ t(
|
|
3091
|
-
|
|
3093
|
+
ee,
|
|
3092
3094
|
{
|
|
3093
3095
|
size: "icon",
|
|
3094
3096
|
variant: "outline",
|
|
@@ -3099,15 +3101,15 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3099
3101
|
},
|
|
3100
3102
|
children: /* @__PURE__ */ t(ut, { className: "h-4 w-4" })
|
|
3101
3103
|
}
|
|
3102
|
-
) : /* @__PURE__ */ t(
|
|
3104
|
+
) : /* @__PURE__ */ t(ee, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ke, { className: "h-4 w-4" }) })
|
|
3103
3105
|
]
|
|
3104
3106
|
}
|
|
3105
3107
|
) })
|
|
3106
3108
|
] }) : null;
|
|
3107
3109
|
}, ba = () => {
|
|
3108
|
-
const { editor: r } =
|
|
3110
|
+
const { editor: r } = te();
|
|
3109
3111
|
return r ? /* @__PURE__ */ t(me, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ t(
|
|
3110
|
-
|
|
3112
|
+
ee,
|
|
3111
3113
|
{
|
|
3112
3114
|
variant: "ghost",
|
|
3113
3115
|
size: "sm",
|
|
@@ -3124,7 +3126,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3124
3126
|
children: /* @__PURE__ */ t(
|
|
3125
3127
|
ln,
|
|
3126
3128
|
{
|
|
3127
|
-
className:
|
|
3129
|
+
className: C("size-4", { "text-blue-500": r.isActive("math") }),
|
|
3128
3130
|
strokeWidth: 2.3
|
|
3129
3131
|
}
|
|
3130
3132
|
)
|
|
@@ -3195,7 +3197,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3195
3197
|
isActive: (r) => r.isActive("codeBlock")
|
|
3196
3198
|
}
|
|
3197
3199
|
], xa = ({ open: r, onOpenChange: e }) => {
|
|
3198
|
-
const { editor: o } =
|
|
3200
|
+
const { editor: o } = te();
|
|
3199
3201
|
if (!o) return null;
|
|
3200
3202
|
const n = je.filter(
|
|
3201
3203
|
(a) => a.isActive(o)
|
|
@@ -3209,7 +3211,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3209
3211
|
{
|
|
3210
3212
|
asChild: !0,
|
|
3211
3213
|
className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
|
|
3212
|
-
children: /* @__PURE__ */ m(
|
|
3214
|
+
children: /* @__PURE__ */ m(ee, { size: "sm", variant: "ghost", children: [
|
|
3213
3215
|
/* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children: n.name }),
|
|
3214
3216
|
/* @__PURE__ */ t(mt, {})
|
|
3215
3217
|
] })
|
|
@@ -3244,7 +3246,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3244
3246
|
ref: a,
|
|
3245
3247
|
decorative: o,
|
|
3246
3248
|
orientation: e,
|
|
3247
|
-
className:
|
|
3249
|
+
className: C(
|
|
3248
3250
|
"shrink-0 bg-border",
|
|
3249
3251
|
e === "horizontal" ? "h-[1px] w-full" : " w-[1px]",
|
|
3250
3252
|
r
|
|
@@ -3262,7 +3264,7 @@ const ya = () => /* @__PURE__ */ m("div", { className: "flex items-center justif
|
|
|
3262
3264
|
de.Root,
|
|
3263
3265
|
{
|
|
3264
3266
|
ref: n,
|
|
3265
|
-
className:
|
|
3267
|
+
className: C("relative overflow-hidden", r),
|
|
3266
3268
|
...o,
|
|
3267
3269
|
children: [
|
|
3268
3270
|
/* @__PURE__ */ t(de.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
|
|
@@ -3277,7 +3279,7 @@ const jt = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, n)
|
|
|
3277
3279
|
{
|
|
3278
3280
|
ref: n,
|
|
3279
3281
|
orientation: e,
|
|
3280
|
-
className:
|
|
3282
|
+
className: C(
|
|
3281
3283
|
"flex touch-none select-none transition-colors",
|
|
3282
3284
|
e === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
3283
3285
|
e === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -3288,32 +3290,32 @@ const jt = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, n)
|
|
|
3288
3290
|
}
|
|
3289
3291
|
));
|
|
3290
3292
|
jt.displayName = de.ScrollAreaScrollbar.displayName;
|
|
3291
|
-
const va =
|
|
3292
|
-
|
|
3293
|
+
const va = ne.Portal, Xt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3294
|
+
ne.Overlay,
|
|
3293
3295
|
{
|
|
3294
3296
|
ref: o,
|
|
3295
|
-
className:
|
|
3297
|
+
className: C(
|
|
3296
3298
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
3297
3299
|
r
|
|
3298
3300
|
),
|
|
3299
3301
|
...e
|
|
3300
3302
|
}
|
|
3301
3303
|
));
|
|
3302
|
-
Xt.displayName =
|
|
3304
|
+
Xt.displayName = ne.Overlay.displayName;
|
|
3303
3305
|
const ka = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__ */ m(va, { children: [
|
|
3304
3306
|
/* @__PURE__ */ t(Xt, {}),
|
|
3305
3307
|
/* @__PURE__ */ m(
|
|
3306
|
-
|
|
3308
|
+
ne.Content,
|
|
3307
3309
|
{
|
|
3308
3310
|
ref: n,
|
|
3309
|
-
className:
|
|
3311
|
+
className: C(
|
|
3310
3312
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
3311
3313
|
r
|
|
3312
3314
|
),
|
|
3313
3315
|
...o,
|
|
3314
3316
|
children: [
|
|
3315
3317
|
e,
|
|
3316
|
-
/* @__PURE__ */ m(
|
|
3318
|
+
/* @__PURE__ */ m(ne.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
3317
3319
|
/* @__PURE__ */ t(cn, { className: "h-4 w-4" }),
|
|
3318
3320
|
/* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
|
|
3319
3321
|
] })
|
|
@@ -3321,47 +3323,47 @@ const ka = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__
|
|
|
3321
3323
|
}
|
|
3322
3324
|
)
|
|
3323
3325
|
] }));
|
|
3324
|
-
ka.displayName =
|
|
3326
|
+
ka.displayName = ne.Content.displayName;
|
|
3325
3327
|
const Ca = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3326
|
-
|
|
3328
|
+
ne.Title,
|
|
3327
3329
|
{
|
|
3328
3330
|
ref: o,
|
|
3329
|
-
className:
|
|
3331
|
+
className: C(
|
|
3330
3332
|
"text-lg font-semibold leading-none tracking-tight",
|
|
3331
3333
|
r
|
|
3332
3334
|
),
|
|
3333
3335
|
...e
|
|
3334
3336
|
}
|
|
3335
3337
|
));
|
|
3336
|
-
Ca.displayName =
|
|
3338
|
+
Ca.displayName = ne.Title.displayName;
|
|
3337
3339
|
const wa = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3338
|
-
|
|
3340
|
+
ne.Description,
|
|
3339
3341
|
{
|
|
3340
3342
|
ref: o,
|
|
3341
|
-
className:
|
|
3343
|
+
className: C("text-sm text-muted-foreground", r),
|
|
3342
3344
|
...e
|
|
3343
3345
|
}
|
|
3344
3346
|
));
|
|
3345
|
-
wa.displayName =
|
|
3347
|
+
wa.displayName = ne.Description.displayName;
|
|
3346
3348
|
const Ut = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3347
|
-
|
|
3349
|
+
J,
|
|
3348
3350
|
{
|
|
3349
3351
|
ref: o,
|
|
3350
|
-
className:
|
|
3352
|
+
className: C(
|
|
3351
3353
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
3352
3354
|
r
|
|
3353
3355
|
),
|
|
3354
3356
|
...e
|
|
3355
3357
|
}
|
|
3356
3358
|
));
|
|
3357
|
-
Ut.displayName =
|
|
3359
|
+
Ut.displayName = J.displayName;
|
|
3358
3360
|
const Gt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
|
|
3359
3361
|
/* @__PURE__ */ t(Ge, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
|
|
3360
3362
|
/* @__PURE__ */ t(
|
|
3361
|
-
|
|
3363
|
+
J.Input,
|
|
3362
3364
|
{
|
|
3363
3365
|
ref: o,
|
|
3364
|
-
className:
|
|
3366
|
+
className: C(
|
|
3365
3367
|
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
3366
3368
|
r
|
|
3367
3369
|
),
|
|
@@ -3369,63 +3371,63 @@ const Gt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div",
|
|
|
3369
3371
|
}
|
|
3370
3372
|
)
|
|
3371
3373
|
] }));
|
|
3372
|
-
Gt.displayName =
|
|
3374
|
+
Gt.displayName = J.Input.displayName;
|
|
3373
3375
|
const Na = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3374
|
-
|
|
3376
|
+
J.List,
|
|
3375
3377
|
{
|
|
3376
3378
|
ref: o,
|
|
3377
|
-
className:
|
|
3379
|
+
className: C("max-h-[300px] overflow-y-auto overflow-x-hidden", r),
|
|
3378
3380
|
...e
|
|
3379
3381
|
}
|
|
3380
3382
|
));
|
|
3381
|
-
Na.displayName =
|
|
3383
|
+
Na.displayName = J.List.displayName;
|
|
3382
3384
|
const Ia = q.forwardRef((r, e) => /* @__PURE__ */ t(
|
|
3383
|
-
|
|
3385
|
+
J.Empty,
|
|
3384
3386
|
{
|
|
3385
3387
|
ref: e,
|
|
3386
3388
|
className: "py-6 text-center text-sm",
|
|
3387
3389
|
...r
|
|
3388
3390
|
}
|
|
3389
3391
|
));
|
|
3390
|
-
Ia.displayName =
|
|
3392
|
+
Ia.displayName = J.Empty.displayName;
|
|
3391
3393
|
const Ne = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3392
|
-
|
|
3394
|
+
J.Group,
|
|
3393
3395
|
{
|
|
3394
3396
|
ref: o,
|
|
3395
|
-
className:
|
|
3397
|
+
className: C(
|
|
3396
3398
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
3397
3399
|
r
|
|
3398
3400
|
),
|
|
3399
3401
|
...e
|
|
3400
3402
|
}
|
|
3401
3403
|
));
|
|
3402
|
-
Ne.displayName =
|
|
3404
|
+
Ne.displayName = J.Group.displayName;
|
|
3403
3405
|
const Qe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3404
|
-
|
|
3406
|
+
J.Separator,
|
|
3405
3407
|
{
|
|
3406
3408
|
ref: o,
|
|
3407
|
-
className:
|
|
3409
|
+
className: C("-mx-1 h-px bg-border", r),
|
|
3408
3410
|
...e
|
|
3409
3411
|
}
|
|
3410
3412
|
));
|
|
3411
|
-
Qe.displayName =
|
|
3413
|
+
Qe.displayName = J.Separator.displayName;
|
|
3412
3414
|
const he = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3413
|
-
|
|
3415
|
+
J.Item,
|
|
3414
3416
|
{
|
|
3415
3417
|
ref: o,
|
|
3416
|
-
className:
|
|
3418
|
+
className: C(
|
|
3417
3419
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
|
|
3418
3420
|
r
|
|
3419
3421
|
),
|
|
3420
3422
|
...e
|
|
3421
3423
|
}
|
|
3422
3424
|
));
|
|
3423
|
-
he.displayName =
|
|
3425
|
+
he.displayName = J.Item.displayName;
|
|
3424
3426
|
const Sa = ({
|
|
3425
3427
|
completion: r,
|
|
3426
3428
|
onDiscard: e
|
|
3427
3429
|
}) => {
|
|
3428
|
-
const { editor: o } =
|
|
3430
|
+
const { editor: o } = te();
|
|
3429
3431
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3430
3432
|
/* @__PURE__ */ m(Ne, { children: [
|
|
3431
3433
|
/* @__PURE__ */ m(
|
|
@@ -3497,7 +3499,7 @@ const Sa = ({
|
|
|
3497
3499
|
icon: hn
|
|
3498
3500
|
}
|
|
3499
3501
|
], Ma = ({ onSelect: r }) => {
|
|
3500
|
-
const { editor: e } =
|
|
3502
|
+
const { editor: e } = te();
|
|
3501
3503
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3502
3504
|
/* @__PURE__ */ m(Ne, { heading: "编辑或校对选中文本", children: [
|
|
3503
3505
|
" ",
|
|
@@ -3542,7 +3544,7 @@ const Sa = ({
|
|
|
3542
3544
|
] });
|
|
3543
3545
|
};
|
|
3544
3546
|
function La({ onOpenChange: r, options: e }) {
|
|
3545
|
-
const { editor: o } =
|
|
3547
|
+
const { editor: o } = te(), [n, a] = O(""), { completion: s, complete: i, isLoading: d } = Nn({
|
|
3546
3548
|
// id: "novel",
|
|
3547
3549
|
api: "/api/generate",
|
|
3548
3550
|
onResponse: (x) => {
|
|
@@ -3576,7 +3578,7 @@ function La({ onOpenChange: r, options: e }) {
|
|
|
3576
3578
|
}
|
|
3577
3579
|
),
|
|
3578
3580
|
/* @__PURE__ */ t(
|
|
3579
|
-
|
|
3581
|
+
ee,
|
|
3580
3582
|
{
|
|
3581
3583
|
size: "icon",
|
|
3582
3584
|
className: "absolute right-2 top-1/2 h-6 w-6 -translate-y-1/2 rounded-full bg-purple-500 hover:bg-purple-900",
|
|
@@ -3620,8 +3622,8 @@ const Aa = ({
|
|
|
3620
3622
|
enableAI: n = !1,
|
|
3621
3623
|
aiOptions: a
|
|
3622
3624
|
}) => {
|
|
3623
|
-
const { editor: s } =
|
|
3624
|
-
return
|
|
3625
|
+
const { editor: s } = te();
|
|
3626
|
+
return se(() => {
|
|
3625
3627
|
e || Rr(s);
|
|
3626
3628
|
}, [e]), /* @__PURE__ */ m(
|
|
3627
3629
|
Pr,
|
|
@@ -3644,7 +3646,7 @@ const Aa = ({
|
|
|
3644
3646
|
),
|
|
3645
3647
|
!e && /* @__PURE__ */ m(oo, { children: [
|
|
3646
3648
|
n && /* @__PURE__ */ m(
|
|
3647
|
-
|
|
3649
|
+
ee,
|
|
3648
3650
|
{
|
|
3649
3651
|
className: "gap-1 text-purple-500",
|
|
3650
3652
|
variant: "ghost",
|
|
@@ -3691,7 +3693,7 @@ const Aa = ({
|
|
|
3691
3693
|
onUpload: Da,
|
|
3692
3694
|
validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (we.error("File size too big (max 20MB)."), !1) : !0 : (we.error("File type not supported."), !1)
|
|
3693
3695
|
}), Pa = () => {
|
|
3694
|
-
const { editor: r } =
|
|
3696
|
+
const { editor: r } = te();
|
|
3695
3697
|
return r ? /* @__PURE__ */ t("div", { className: "flex", children: [
|
|
3696
3698
|
{
|
|
3697
3699
|
name: "粗体",
|
|
@@ -3735,7 +3737,7 @@ const Aa = ({
|
|
|
3735
3737
|
o.command(n);
|
|
3736
3738
|
},
|
|
3737
3739
|
children: /* @__PURE__ */ t(me, { overlay: o.name, placement: "top", children: /* @__PURE__ */ t(
|
|
3738
|
-
|
|
3740
|
+
ee,
|
|
3739
3741
|
{
|
|
3740
3742
|
size: "sm",
|
|
3741
3743
|
className: "rounded-md",
|
|
@@ -3744,7 +3746,7 @@ const Aa = ({
|
|
|
3744
3746
|
children: /* @__PURE__ */ t(
|
|
3745
3747
|
o.icon,
|
|
3746
3748
|
{
|
|
3747
|
-
className:
|
|
3749
|
+
className: C("h-4 w-4", {
|
|
3748
3750
|
"text-blue-500": o.isActive(r)
|
|
3749
3751
|
})
|
|
3750
3752
|
}
|
|
@@ -3882,7 +3884,7 @@ const Aa = ({
|
|
|
3882
3884
|
De.Item,
|
|
3883
3885
|
{
|
|
3884
3886
|
onClick: i.onClick,
|
|
3885
|
-
className:
|
|
3887
|
+
className: C(
|
|
3886
3888
|
"gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3887
3889
|
i.className
|
|
3888
3890
|
),
|
|
@@ -3900,9 +3902,9 @@ const Aa = ({
|
|
|
3900
3902
|
De.SubMenu,
|
|
3901
3903
|
{
|
|
3902
3904
|
expandIcon: /* @__PURE__ */ t(wo, { size: 16 }),
|
|
3903
|
-
popupClassName:
|
|
3905
|
+
popupClassName: C(
|
|
3904
3906
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
|
|
3905
|
-
|
|
3907
|
+
h`
|
|
3906
3908
|
.rc-menu {
|
|
3907
3909
|
border: none !important;
|
|
3908
3910
|
box-shadow: none !important;
|
|
@@ -3910,9 +3912,9 @@ const Aa = ({
|
|
|
3910
3912
|
`
|
|
3911
3913
|
),
|
|
3912
3914
|
popupOffset: [4, 0],
|
|
3913
|
-
className:
|
|
3915
|
+
className: C(
|
|
3914
3916
|
"gap-2 !p-0 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3915
|
-
|
|
3917
|
+
h`
|
|
3916
3918
|
.rc-menu-submenu-title {
|
|
3917
3919
|
display: flex;
|
|
3918
3920
|
align-items: center;
|
|
@@ -3944,9 +3946,9 @@ const Aa = ({
|
|
|
3944
3946
|
overlay: /* @__PURE__ */ t(
|
|
3945
3947
|
De,
|
|
3946
3948
|
{
|
|
3947
|
-
className:
|
|
3949
|
+
className: C(
|
|
3948
3950
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
|
|
3949
|
-
|
|
3951
|
+
h`
|
|
3950
3952
|
.rc-menu-submenu-active {
|
|
3951
3953
|
.rc-menu-submenu-title {
|
|
3952
3954
|
background-color: hsl(var(--accent)) !important;
|
|
@@ -3965,10 +3967,10 @@ const Aa = ({
|
|
|
3965
3967
|
});
|
|
3966
3968
|
Yt.displayName = "DropdownMenu";
|
|
3967
3969
|
const Ea = ({ children: r, ...e }) => {
|
|
3968
|
-
const { editor: o } =
|
|
3969
|
-
o && o.state.selection instanceof
|
|
3970
|
+
const { editor: o } = te(), n = () => {
|
|
3971
|
+
o && o.state.selection instanceof Q && (o.commands.deleteSelection(), o.commands.focus());
|
|
3970
3972
|
}, a = () => {
|
|
3971
|
-
if (o && o.state.selection instanceof
|
|
3973
|
+
if (o && o.state.selection instanceof Q) {
|
|
3972
3974
|
const d = o.state.selection.node, p = o.state.selection.to;
|
|
3973
3975
|
o.chain().insertContentAt(p, {
|
|
3974
3976
|
type: d.type.name,
|
|
@@ -3981,7 +3983,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
3981
3983
|
icon: /* @__PURE__ */ t(d.icon, { size: 16 }),
|
|
3982
3984
|
label: d.name,
|
|
3983
3985
|
onClick: () => {
|
|
3984
|
-
o && o.state.selection instanceof
|
|
3986
|
+
o && o.state.selection instanceof Q && d.command(o);
|
|
3985
3987
|
},
|
|
3986
3988
|
isActive: d.isActive(o)
|
|
3987
3989
|
}));
|
|
@@ -4009,7 +4011,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4009
4011
|
}
|
|
4010
4012
|
], ...e, children: r });
|
|
4011
4013
|
}, $a = () => {
|
|
4012
|
-
const { editor: r } =
|
|
4014
|
+
const { editor: r } = te(), e = (o) => {
|
|
4013
4015
|
if (!r) return;
|
|
4014
4016
|
const n = o.target.closest(".custom-drag-handle");
|
|
4015
4017
|
if (!n) return;
|
|
@@ -4022,9 +4024,9 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4022
4024
|
return /* @__PURE__ */ m(
|
|
4023
4025
|
"div",
|
|
4024
4026
|
{
|
|
4025
|
-
className:
|
|
4027
|
+
className: C(
|
|
4026
4028
|
"custom-drag-handle",
|
|
4027
|
-
|
|
4029
|
+
h`
|
|
4028
4030
|
width: auto;
|
|
4029
4031
|
background: none;
|
|
4030
4032
|
display: flex;
|
|
@@ -4041,7 +4043,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4041
4043
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以在下方添加快" })
|
|
4042
4044
|
] }),
|
|
4043
4045
|
children: /* @__PURE__ */ t(
|
|
4044
|
-
|
|
4046
|
+
ee,
|
|
4045
4047
|
{
|
|
4046
4048
|
size: "icon",
|
|
4047
4049
|
variant: "ghost",
|
|
@@ -4060,7 +4062,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4060
4062
|
"拖动",
|
|
4061
4063
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以移动" })
|
|
4062
4064
|
] }) }),
|
|
4063
|
-
children: /* @__PURE__ */ t(
|
|
4065
|
+
children: /* @__PURE__ */ t(ee, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(To, { size: 22 }) })
|
|
4064
4066
|
}
|
|
4065
4067
|
) })
|
|
4066
4068
|
]
|
|
@@ -4079,33 +4081,33 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4079
4081
|
editorRef: x,
|
|
4080
4082
|
enableAI: l = !1,
|
|
4081
4083
|
aiOptions: c
|
|
4082
|
-
} = r, [
|
|
4084
|
+
} = r, [g, v] = O(
|
|
4083
4085
|
o
|
|
4084
|
-
), [D,
|
|
4085
|
-
const X = new DOMParser().parseFromString(
|
|
4086
|
-
return X.querySelectorAll("pre code").forEach((
|
|
4087
|
-
In.highlightElement(
|
|
4086
|
+
), [D, b] = O("Saved"), [f, I] = O(), [y, N] = O(!1), [u, S] = O(!1), [U, j] = O(!1), [k, L] = O(!1), E = (M) => {
|
|
4087
|
+
const X = new DOMParser().parseFromString(M, "text/html");
|
|
4088
|
+
return X.querySelectorAll("pre code").forEach(($) => {
|
|
4089
|
+
In.highlightElement($);
|
|
4088
4090
|
}), new XMLSerializer().serializeToString(X);
|
|
4089
|
-
},
|
|
4090
|
-
async (
|
|
4091
|
-
const X =
|
|
4092
|
-
|
|
4091
|
+
}, A = Yr(
|
|
4092
|
+
async (M) => {
|
|
4093
|
+
const X = M.getJSON();
|
|
4094
|
+
I(M.storage.characterCount.words()), n == null || n(X), s && (window.localStorage.setItem(
|
|
4093
4095
|
"html-content",
|
|
4094
|
-
|
|
4096
|
+
E(M.getHTML())
|
|
4095
4097
|
), window.localStorage.setItem(a, JSON.stringify(X)), window.localStorage.setItem(
|
|
4096
4098
|
"markdown",
|
|
4097
|
-
|
|
4098
|
-
),
|
|
4099
|
+
M.storage.markdown.getMarkdown()
|
|
4100
|
+
), b("Saved"));
|
|
4099
4101
|
},
|
|
4100
4102
|
500
|
|
4101
|
-
),
|
|
4103
|
+
), V = be(() => {
|
|
4102
4104
|
if (!p) return Ra;
|
|
4103
4105
|
const {
|
|
4104
|
-
beforeUpload:
|
|
4106
|
+
beforeUpload: M,
|
|
4105
4107
|
maxSize: X,
|
|
4106
|
-
action:
|
|
4107
|
-
headers:
|
|
4108
|
-
method:
|
|
4108
|
+
action: $,
|
|
4109
|
+
headers: Z,
|
|
4110
|
+
method: oe,
|
|
4109
4111
|
name: $e,
|
|
4110
4112
|
onSuccess: Se,
|
|
4111
4113
|
onError: Te
|
|
@@ -4114,10 +4116,10 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4114
4116
|
onUpload: (ie) => {
|
|
4115
4117
|
const Me = new FormData();
|
|
4116
4118
|
Me.append($e || "file", ie);
|
|
4117
|
-
const He = fetch(
|
|
4118
|
-
method:
|
|
4119
|
+
const He = fetch($, {
|
|
4120
|
+
method: oe || "POST",
|
|
4119
4121
|
headers: {
|
|
4120
|
-
...
|
|
4122
|
+
...Z
|
|
4121
4123
|
},
|
|
4122
4124
|
body: Me
|
|
4123
4125
|
});
|
|
@@ -4129,8 +4131,8 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4129
4131
|
return;
|
|
4130
4132
|
}
|
|
4131
4133
|
if (B.status === 200) {
|
|
4132
|
-
const { url: z } = await B.json(),
|
|
4133
|
-
|
|
4134
|
+
const { url: z } = await B.json(), T = new Image();
|
|
4135
|
+
T.src = z, T.onload = () => {
|
|
4134
4136
|
ye(z);
|
|
4135
4137
|
};
|
|
4136
4138
|
} else throw B.status === 401 ? (ye(ie), new Error(
|
|
@@ -4141,29 +4143,29 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4141
4143
|
});
|
|
4142
4144
|
});
|
|
4143
4145
|
},
|
|
4144
|
-
validateFn: (ie) =>
|
|
4146
|
+
validateFn: (ie) => M ? M(ie) : ie.type.includes("image/") ? X && ie.size > X ? (console.error("File size too big (max 20MB)."), !1) : !0 : (console.error("File type not supported."), !1)
|
|
4145
4147
|
});
|
|
4146
4148
|
}, [p]);
|
|
4147
|
-
if (
|
|
4149
|
+
if (se(() => {
|
|
4148
4150
|
if (!s) return;
|
|
4149
|
-
const
|
|
4150
|
-
v(
|
|
4151
|
-
}, [a, s]), !
|
|
4152
|
-
const
|
|
4151
|
+
const M = window.localStorage.getItem(a);
|
|
4152
|
+
v(M ? JSON.parse(M) : za);
|
|
4153
|
+
}, [a, s]), !g) return null;
|
|
4154
|
+
const Y = [
|
|
4153
4155
|
...Ot,
|
|
4154
4156
|
Ba({
|
|
4155
|
-
uploadFn:
|
|
4157
|
+
uploadFn: V
|
|
4156
4158
|
})
|
|
4157
4159
|
];
|
|
4158
|
-
return /* @__PURE__ */ m("div", { className:
|
|
4160
|
+
return /* @__PURE__ */ m("div", { className: C("relative w-full max-w-screen-lg", e), children: [
|
|
4159
4161
|
(s && i || d) && /* @__PURE__ */ m("div", { className: "flex absolute right-5 top-5 z-10 mb-5 gap-2", children: [
|
|
4160
4162
|
s && i && /* @__PURE__ */ t("div", { className: "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground", children: D }),
|
|
4161
4163
|
d && /* @__PURE__ */ m(
|
|
4162
4164
|
"div",
|
|
4163
4165
|
{
|
|
4164
|
-
className:
|
|
4166
|
+
className: f ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
|
|
4165
4167
|
children: [
|
|
4166
|
-
|
|
4168
|
+
f,
|
|
4167
4169
|
" Words"
|
|
4168
4170
|
]
|
|
4169
4171
|
}
|
|
@@ -4172,66 +4174,66 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4172
4174
|
/* @__PURE__ */ t($r, { children: /* @__PURE__ */ m(
|
|
4173
4175
|
Hr,
|
|
4174
4176
|
{
|
|
4175
|
-
onCreate: ({ editor:
|
|
4176
|
-
x && (x.current =
|
|
4177
|
+
onCreate: ({ editor: M }) => {
|
|
4178
|
+
x && (x.current = M);
|
|
4177
4179
|
},
|
|
4178
|
-
initialContent:
|
|
4179
|
-
extensions:
|
|
4180
|
+
initialContent: g,
|
|
4181
|
+
extensions: Y,
|
|
4180
4182
|
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",
|
|
4181
4183
|
editorProps: {
|
|
4182
4184
|
handleDOMEvents: {
|
|
4183
|
-
keydown: (
|
|
4185
|
+
keydown: (M, X) => _r(X)
|
|
4184
4186
|
},
|
|
4185
|
-
handlePaste: (
|
|
4186
|
-
handleDrop: (
|
|
4187
|
+
handlePaste: (M, X) => Fr(M, X, V),
|
|
4188
|
+
handleDrop: (M, X, $, Z) => Or(M, X, Z, V),
|
|
4187
4189
|
attributes: {
|
|
4188
4190
|
class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
|
|
4189
4191
|
}
|
|
4190
4192
|
},
|
|
4191
|
-
onUpdate: ({ editor:
|
|
4192
|
-
|
|
4193
|
+
onUpdate: ({ editor: M }) => {
|
|
4194
|
+
A(M), b("Unsaved");
|
|
4193
4195
|
},
|
|
4194
4196
|
slotAfter: /* @__PURE__ */ t(qr, {}),
|
|
4195
4197
|
children: [
|
|
4196
4198
|
/* @__PURE__ */ m(jr, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
|
|
4197
4199
|
/* @__PURE__ */ t(Xr, { className: "px-2 text-muted-foreground", children: "没有结果" }),
|
|
4198
4200
|
/* @__PURE__ */ t(Ur, { children: qt({
|
|
4199
|
-
uploadFn:
|
|
4200
|
-
}).map((
|
|
4201
|
+
uploadFn: V
|
|
4202
|
+
}).map((M) => /* @__PURE__ */ m(
|
|
4201
4203
|
Gr,
|
|
4202
4204
|
{
|
|
4203
|
-
value:
|
|
4204
|
-
onCommand: (X) =>
|
|
4205
|
+
value: M.title,
|
|
4206
|
+
onCommand: (X) => M.command(X),
|
|
4205
4207
|
className: "flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm hover:bg-accent aria-selected:bg-accent",
|
|
4206
4208
|
children: [
|
|
4207
|
-
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children:
|
|
4209
|
+
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children: M.icon }),
|
|
4208
4210
|
/* @__PURE__ */ m("div", { children: [
|
|
4209
|
-
/* @__PURE__ */ t("p", { className: "font-medium", children:
|
|
4210
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children:
|
|
4211
|
+
/* @__PURE__ */ t("p", { className: "font-medium", children: M.title }),
|
|
4212
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: M.description })
|
|
4211
4213
|
] })
|
|
4212
4214
|
]
|
|
4213
4215
|
},
|
|
4214
|
-
|
|
4216
|
+
M.title
|
|
4215
4217
|
)) })
|
|
4216
4218
|
] }),
|
|
4217
4219
|
/* @__PURE__ */ m(
|
|
4218
4220
|
Aa,
|
|
4219
4221
|
{
|
|
4220
|
-
open:
|
|
4221
|
-
onOpenChange:
|
|
4222
|
+
open: k,
|
|
4223
|
+
onOpenChange: L,
|
|
4222
4224
|
enableAI: l,
|
|
4223
4225
|
aiOptions: c,
|
|
4224
4226
|
children: [
|
|
4225
4227
|
l && /* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4226
4228
|
/* @__PURE__ */ t(xa, { open: y, onOpenChange: N }),
|
|
4227
4229
|
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4228
|
-
/* @__PURE__ */ t(ha, { open:
|
|
4230
|
+
/* @__PURE__ */ t(ha, { open: U, onOpenChange: j }),
|
|
4229
4231
|
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4230
4232
|
/* @__PURE__ */ t(ba, {}),
|
|
4231
4233
|
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4232
4234
|
/* @__PURE__ */ t(Pa, {}),
|
|
4233
4235
|
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4234
|
-
/* @__PURE__ */ t(pa, { open: u, onOpenChange:
|
|
4236
|
+
/* @__PURE__ */ t(pa, { open: u, onOpenChange: S })
|
|
4235
4237
|
]
|
|
4236
4238
|
}
|
|
4237
4239
|
),
|
|
@@ -4259,7 +4261,7 @@ const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4259
4261
|
Editor: Vt,
|
|
4260
4262
|
Markdown: $t,
|
|
4261
4263
|
MdEditor: Ht,
|
|
4262
|
-
SortableUtils:
|
|
4264
|
+
SortableUtils: K,
|
|
4263
4265
|
desktopAppConfig: Ve,
|
|
4264
4266
|
desktopConfigMap: Be,
|
|
4265
4267
|
desktopGroupConfig: Lt,
|
|
@@ -4280,7 +4282,7 @@ export {
|
|
|
4280
4282
|
Vt as Editor,
|
|
4281
4283
|
$t as Markdown,
|
|
4282
4284
|
Ht as MdEditor,
|
|
4283
|
-
|
|
4285
|
+
K as SortableUtils,
|
|
4284
4286
|
As as default,
|
|
4285
4287
|
Ve as desktopAppConfig,
|
|
4286
4288
|
Be as desktopConfigMap,
|