zs_library 0.4.22 → 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,11 +6,11 @@ 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
|
|
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
|
-
import { AnimatePresence as Ue, motion as R, useMotionValue as ct, useTransform as
|
|
13
|
+
import { AnimatePresence as Ue, motion as R, useMotionValue as ct, useTransform as ge, useSpring as Ae } from "framer-motion";
|
|
14
14
|
import { useMotionValue as Ps } from "framer-motion";
|
|
15
15
|
import { useLocalStorageState as no, useDebounceEffect as ao } from "ahooks";
|
|
16
16
|
import { v4 as Oe } from "uuid";
|
|
@@ -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";
|
|
@@ -159,7 +159,7 @@ const qe = {
|
|
|
159
159
|
}, Tt = st(
|
|
160
160
|
{}
|
|
161
161
|
), Mt = (r) => {
|
|
162
|
-
const { children: e, theme: o, ...n } = r, a =
|
|
162
|
+
const { children: e, theme: o, ...n } = r, a = be(() => o === "light" ? qe : o === "dark" ? Ye : o, [o]);
|
|
163
163
|
return /* @__PURE__ */ t(Tt.Provider, { value: { theme: a, ...n }, children: e });
|
|
164
164
|
}, le = () => it(Tt), Ve = {
|
|
165
165
|
maxRow: 2,
|
|
@@ -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,30 +234,30 @@ 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
|
-
), [
|
|
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
|
-
}),
|
|
247
|
-
D(null), clearTimeout(i), d(void 0),
|
|
248
|
-
},
|
|
249
|
-
D({ ...
|
|
250
|
-
},
|
|
251
|
-
const { config: z = {} } =
|
|
246
|
+
}), X = () => {
|
|
247
|
+
D(null), clearTimeout(i), d(void 0), g.current = null;
|
|
248
|
+
}, $ = (w, B) => {
|
|
249
|
+
D({ ...w, pageX: w.pageX, pageY: w.pageY, data: B }), clearTimeout(i);
|
|
250
|
+
}, Z = (w, B = !0) => {
|
|
251
|
+
const { config: z = {} } = w;
|
|
252
252
|
return z.allowContextMenu === !1 ? {} : {
|
|
253
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
|
},
|
|
@@ -265,132 +265,132 @@ const At = st({
|
|
|
265
265
|
clearTimeout(p), x(void 0), clearTimeout(i), d(void 0);
|
|
266
266
|
},
|
|
267
267
|
onContextMenu: (T) => {
|
|
268
|
-
B && (T.preventDefault(),
|
|
268
|
+
B && (T.preventDefault(), $(T, w));
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
|
-
},
|
|
272
|
-
(
|
|
271
|
+
}, oe = to(
|
|
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
|
|
279
|
-
if (z.length &&
|
|
280
|
-
if (((et =
|
|
281
|
-
(
|
|
282
|
-
).length) === 1 &&
|
|
283
|
-
const
|
|
284
|
-
return P.splice(
|
|
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
|
+
).length) === 1 && w.length === 1) {
|
|
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 T =
|
|
301
|
-
n == null || n(T),
|
|
300
|
+
const T = K.uniqueArray(w);
|
|
301
|
+
n == null || n(T), f(T);
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
304
|
[n]
|
|
305
|
-
), $e = (
|
|
306
|
-
|
|
307
|
-
const T = [...z],
|
|
305
|
+
), $e = (w, B) => {
|
|
306
|
+
f((z) => {
|
|
307
|
+
const T = [...z], H = (F) => {
|
|
308
308
|
var P;
|
|
309
|
-
for (let
|
|
310
|
-
if (
|
|
311
|
-
|
|
309
|
+
for (let _ = 0; _ < F.length; _++)
|
|
310
|
+
if (F[_].id === w) {
|
|
311
|
+
F[_].config = B;
|
|
312
312
|
break;
|
|
313
|
-
} else ((P =
|
|
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
|
-
}, Se = (
|
|
318
|
-
|
|
319
|
-
const T = [...z],
|
|
317
|
+
}, Se = (w, B) => {
|
|
318
|
+
f((z) => {
|
|
319
|
+
const T = [...z], H = (F) => {
|
|
320
320
|
var P;
|
|
321
|
-
for (let
|
|
322
|
-
if (
|
|
323
|
-
|
|
321
|
+
for (let _ = 0; _ < F.length; _++)
|
|
322
|
+
if (F[_].id === w) {
|
|
323
|
+
F[_].data = B;
|
|
324
324
|
break;
|
|
325
|
-
} else ((P =
|
|
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
|
-
}, Te = (
|
|
330
|
-
|
|
331
|
-
const z = [...B], T = (
|
|
332
|
-
var
|
|
333
|
-
for (let P = 0; P <
|
|
334
|
-
if (
|
|
335
|
-
|
|
329
|
+
}, Te = (w) => {
|
|
330
|
+
f((B) => {
|
|
331
|
+
const z = [...B], T = (H) => {
|
|
332
|
+
var F;
|
|
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 ((
|
|
337
|
+
} else ((F = H[P].children) == null ? void 0 : F.length) !== void 0 && T(H[P].children);
|
|
338
338
|
};
|
|
339
339
|
return T(z), n == null || n(z), z;
|
|
340
340
|
});
|
|
341
|
-
}, ie = (
|
|
342
|
-
const z = [...
|
|
343
|
-
const P =
|
|
344
|
-
if (
|
|
345
|
-
if (
|
|
346
|
-
|
|
341
|
+
}, ie = (w, B) => {
|
|
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
|
+
if (_) {
|
|
345
|
+
if (F.length)
|
|
346
|
+
_.children = T(_.children || [], F);
|
|
347
347
|
else {
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
...
|
|
348
|
+
const re = (w == null ? void 0 : w.type) ?? "app";
|
|
349
|
+
_.children = [
|
|
350
|
+
..._.children ?? [],
|
|
351
351
|
{
|
|
352
|
-
...
|
|
352
|
+
...w,
|
|
353
353
|
id: Oe(),
|
|
354
|
-
config: (
|
|
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
|
-
|
|
363
|
-
}, Me = (
|
|
364
|
-
|
|
365
|
-
const z = (
|
|
366
|
-
...
|
|
362
|
+
f(T(z, B));
|
|
363
|
+
}, Me = (w) => {
|
|
364
|
+
f((B) => {
|
|
365
|
+
const z = (w == null ? void 0 : w.type) ?? "app", T = {
|
|
366
|
+
...w,
|
|
367
367
|
id: Oe(),
|
|
368
|
-
config: (
|
|
369
|
-
},
|
|
370
|
-
return n == null || n(
|
|
368
|
+
config: (w == null ? void 0 : w.config) ?? Be[z]
|
|
369
|
+
}, H = [...B, T];
|
|
370
|
+
return n == null || n(H), H;
|
|
371
371
|
});
|
|
372
|
-
}, He = (
|
|
373
|
-
|
|
374
|
-
const T = [...z],
|
|
375
|
-
return
|
|
372
|
+
}, He = (w, B) => {
|
|
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
|
-
},
|
|
378
|
-
|
|
379
|
-
const z = B.filter((T) => T.id !==
|
|
377
|
+
}, ye = (w) => {
|
|
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,30 +398,30 @@ 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:
|
|
408
|
-
hideContextMenu:
|
|
409
|
-
showInfoItemData:
|
|
407
|
+
contextMenuFuns: Z,
|
|
408
|
+
hideContextMenu: X,
|
|
409
|
+
showInfoItemData: I,
|
|
410
410
|
setShowInfoItemData: y,
|
|
411
|
-
openGroupItemData:
|
|
411
|
+
openGroupItemData: N,
|
|
412
412
|
setOpenGroupItemData: u,
|
|
413
|
-
longPressTriggered:
|
|
413
|
+
longPressTriggered: S,
|
|
414
414
|
updateItemConfig: $e,
|
|
415
415
|
updateItem: Se,
|
|
416
416
|
removeItem: Te,
|
|
417
417
|
addItem: ie,
|
|
418
418
|
addRootItem: Me,
|
|
419
419
|
updateRootItem: He,
|
|
420
|
-
removeRootItem:
|
|
421
|
-
moveItemId:
|
|
422
|
-
setMoveItemId:
|
|
423
|
-
moveTargetId:
|
|
424
|
-
setMoveTargetId:
|
|
420
|
+
removeRootItem: ye,
|
|
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;
|
|
@@ -555,14 +555,14 @@ const At = st({
|
|
|
555
555
|
label: "修改大小",
|
|
556
556
|
key: "size",
|
|
557
557
|
icon: /* @__PURE__ */ t(so, { size: 14 }),
|
|
558
|
-
items:
|
|
558
|
+
items: N().map((u) => ({
|
|
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,29 +846,29 @@ 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};
|
|
859
859
|
box-shadow: 0 0 0.5rem ${y.itemIconShadowColor};
|
|
860
860
|
@media (prefers-color-scheme: dark) {
|
|
861
|
-
background-color: ${
|
|
862
|
-
box-shadow: 0 0 0.5rem ${
|
|
861
|
+
background-color: ${N.itemIconBackgroundColor};
|
|
862
|
+
box-shadow: 0 0 0.5rem ${N.itemIconShadowColor};
|
|
863
863
|
}
|
|
864
|
-
`,
|
|
865
|
-
if (
|
|
864
|
+
`, X = () => {
|
|
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%;
|
|
@@ -879,55 +879,55 @@ const At = st({
|
|
|
879
879
|
top: 0;
|
|
880
880
|
border-radius: 0.75rem;
|
|
881
881
|
@media (prefers-color-scheme: dark) {
|
|
882
|
-
background-color: ${
|
|
882
|
+
background-color: ${N.itemIconBackgroundColor};
|
|
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,33 +1026,33 @@ 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;
|
|
1035
1035
|
background-color: ${y.groupItemIconBackgroundColor};
|
|
1036
1036
|
box-shadow: 0 0 0.5rem ${y.groupItemIconShadowColor};
|
|
1037
1037
|
@media (prefers-color-scheme: dark) {
|
|
1038
|
-
background-color: ${
|
|
1039
|
-
box-shadow: 0 0 0.5rem ${
|
|
1038
|
+
background-color: ${N.groupItemIconBackgroundColor};
|
|
1039
|
+
box-shadow: 0 0 0.5rem ${N.groupItemIconShadowColor};
|
|
1040
1040
|
}
|
|
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%;
|
|
@@ -1062,13 +1062,13 @@ const At = st({
|
|
|
1062
1062
|
padding: 0.375rem;
|
|
1063
1063
|
`,
|
|
1064
1064
|
children: [
|
|
1065
|
-
|
|
1065
|
+
X(),
|
|
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
|
-
color: ${
|
|
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: (
|
|
1251
|
-
var
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1250
|
+
setList: (f) => {
|
|
1251
|
+
var N, u;
|
|
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 =
|
|
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,16 +1592,16 @@ 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
|
-
const y = pe(),
|
|
1599
|
-
return
|
|
1600
|
-
e && (typeof e == "function" ? e({ state: y, config:
|
|
1601
|
-
}, [y,
|
|
1601
|
+
const y = pe(), N = le();
|
|
1602
|
+
return se(() => {
|
|
1603
|
+
e && (typeof e == "function" ? e({ state: y, config: N }) : e.current = { state: y, config: N });
|
|
1604
|
+
}, [y, N]), null;
|
|
1602
1605
|
}, {}),
|
|
1603
1606
|
/* @__PURE__ */ t(Pt, { ...D })
|
|
1604
1607
|
] }) });
|
|
@@ -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;
|
|
@@ -1995,13 +1998,13 @@ const At = st({
|
|
|
1995
1998
|
className: s,
|
|
1996
1999
|
theme: i = "auto",
|
|
1997
2000
|
...d
|
|
1998
|
-
} = r, p =
|
|
2001
|
+
} = r, p = xe(null), {
|
|
1999
2002
|
image: x,
|
|
2000
2003
|
diffSource: l = {
|
|
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 =
|
|
2158
|
-
var
|
|
2159
|
-
const
|
|
2160
|
-
return
|
|
2161
|
-
}), v =
|
|
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
|
-
}),
|
|
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%" },
|
|
@@ -2211,15 +2214,19 @@ const Ke = (r) => {
|
|
|
2211
2214
|
/* @__PURE__ */ t(
|
|
2212
2215
|
R.div,
|
|
2213
2216
|
{
|
|
2214
|
-
style: {
|
|
2217
|
+
style: {
|
|
2218
|
+
width: N,
|
|
2219
|
+
height: u,
|
|
2220
|
+
fontSize: S
|
|
2221
|
+
},
|
|
2215
2222
|
className: ve("flex items-center justify-center", x),
|
|
2216
|
-
children: s || n
|
|
2223
|
+
children: typeof s == "function" ? s({ widthIcon: N, heightIcon: u, fontSizeTransform: S }) : s || n
|
|
2217
2224
|
}
|
|
2218
2225
|
)
|
|
2219
2226
|
]
|
|
2220
2227
|
}
|
|
2221
2228
|
);
|
|
2222
|
-
return a ? /* @__PURE__ */ t("a", { href: a, children:
|
|
2229
|
+
return a ? /* @__PURE__ */ t("a", { href: a, children: k }) : k;
|
|
2223
2230
|
}, Je = (r) => {
|
|
2224
2231
|
const {
|
|
2225
2232
|
items: e = [],
|
|
@@ -2281,7 +2288,7 @@ const Ke = (r) => {
|
|
|
2281
2288
|
autoHidden: a = !1,
|
|
2282
2289
|
itemBuilder: s,
|
|
2283
2290
|
children: i
|
|
2284
|
-
} = r, [d, p] =
|
|
2291
|
+
} = r, [d, p] = O(!1), x = () => {
|
|
2285
2292
|
p(!d);
|
|
2286
2293
|
};
|
|
2287
2294
|
return /* @__PURE__ */ m(
|
|
@@ -2439,43 +2446,43 @@ function Wn(r) {
|
|
|
2439
2446
|
let e = "", o = !1;
|
|
2440
2447
|
function n(l, c) {
|
|
2441
2448
|
if (c.focus(), !l.dataTransfer) return;
|
|
2442
|
-
const
|
|
2449
|
+
const g = ot(
|
|
2443
2450
|
{
|
|
2444
2451
|
x: l.clientX + 50 + r.dragHandleWidth,
|
|
2445
2452
|
y: l.clientY
|
|
2446
2453
|
},
|
|
2447
2454
|
r
|
|
2448
2455
|
);
|
|
2449
|
-
if (!(
|
|
2450
|
-
let v = rt(
|
|
2456
|
+
if (!(g instanceof Element)) return;
|
|
2457
|
+
let v = rt(g, c, r);
|
|
2451
2458
|
if (v == null || v < 0) return;
|
|
2452
2459
|
v = Re(v, c);
|
|
2453
|
-
const { from: D, to:
|
|
2460
|
+
const { from: D, to: b } = c.state.selection, f = D - b, I = Re(D, c);
|
|
2454
2461
|
let y = !1;
|
|
2455
|
-
const
|
|
2456
|
-
if (
|
|
2462
|
+
const N = c.state.doc.resolve(I);
|
|
2463
|
+
if (N.node().type.name === "doc") y = !0;
|
|
2457
2464
|
else {
|
|
2458
|
-
const
|
|
2465
|
+
const k = Q.create(
|
|
2459
2466
|
c.state.doc,
|
|
2460
|
-
|
|
2467
|
+
N.before()
|
|
2461
2468
|
);
|
|
2462
|
-
y = !(v + 1 >=
|
|
2469
|
+
y = !(v + 1 >= k.$from.pos && v <= k.$to.pos);
|
|
2463
2470
|
}
|
|
2464
2471
|
let u = c.state.selection;
|
|
2465
|
-
if (!y &&
|
|
2466
|
-
const
|
|
2472
|
+
if (!y && f !== 0 && !(c.state.selection instanceof Q)) {
|
|
2473
|
+
const k = Q.create(c.state.doc, b - 1);
|
|
2467
2474
|
u = tn.create(
|
|
2468
2475
|
c.state.doc,
|
|
2469
2476
|
v,
|
|
2470
|
-
|
|
2477
|
+
k.$to.pos
|
|
2471
2478
|
);
|
|
2472
|
-
} else if (u =
|
|
2473
|
-
const
|
|
2474
|
-
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());
|
|
2475
2482
|
}
|
|
2476
|
-
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof
|
|
2477
|
-
const
|
|
2478
|
-
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 };
|
|
2479
2486
|
}
|
|
2480
2487
|
let a = null;
|
|
2481
2488
|
function s() {
|
|
@@ -2485,14 +2492,14 @@ function Wn(r) {
|
|
|
2485
2492
|
a && a.classList.remove("hide");
|
|
2486
2493
|
}
|
|
2487
2494
|
function d(l, c) {
|
|
2488
|
-
const
|
|
2495
|
+
const g = Re(c, l), v = Q.create(l.state.doc, g);
|
|
2489
2496
|
l.dispatch(l.state.tr.setSelection(v)), l.focus(), o = !0;
|
|
2490
2497
|
}
|
|
2491
2498
|
function p(l) {
|
|
2492
|
-
if (o = l.state.selection instanceof
|
|
2493
|
-
const
|
|
2499
|
+
if (o = l.state.selection instanceof Q, o && (a != null && a.dataset.nodePos)) {
|
|
2500
|
+
const g = parseInt(a.dataset.nodePos, 10);
|
|
2494
2501
|
try {
|
|
2495
|
-
const v = l.state.doc.resolve(
|
|
2502
|
+
const v = l.state.doc.resolve(g);
|
|
2496
2503
|
v && v.parent && v.parent.type.name !== "doc" || (o = !1, s());
|
|
2497
2504
|
} catch {
|
|
2498
2505
|
o = !1, s();
|
|
@@ -2507,40 +2514,40 @@ function Wn(r) {
|
|
|
2507
2514
|
o || s();
|
|
2508
2515
|
return;
|
|
2509
2516
|
}
|
|
2510
|
-
const
|
|
2511
|
-
!
|
|
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();
|
|
2512
2519
|
}
|
|
2513
2520
|
return new Qr({
|
|
2514
2521
|
key: new en(r.pluginKey),
|
|
2515
2522
|
view: (l) => {
|
|
2516
|
-
var
|
|
2523
|
+
var b, f, I, y;
|
|
2517
2524
|
const c = r.dragHandleSelector ? document.querySelector(r.dragHandleSelector) : null;
|
|
2518
2525
|
a = c ?? document.createElement("div"), a.draggable = !0, a.dataset.dragHandle = "", a.classList.add("drag-handle");
|
|
2519
|
-
function
|
|
2520
|
-
n(
|
|
2526
|
+
function g(N) {
|
|
2527
|
+
n(N, l);
|
|
2521
2528
|
}
|
|
2522
|
-
a.addEventListener("dragstart",
|
|
2523
|
-
function v(
|
|
2524
|
-
c || (
|
|
2529
|
+
a.addEventListener("dragstart", g);
|
|
2530
|
+
function v(N) {
|
|
2531
|
+
c || (N.preventDefault(), N.stopPropagation());
|
|
2525
2532
|
const u = a == null ? void 0 : a.dataset.nodePos;
|
|
2526
2533
|
u && d(l, parseInt(u, 10));
|
|
2527
2534
|
}
|
|
2528
2535
|
a.addEventListener("click", v);
|
|
2529
|
-
function D(
|
|
2536
|
+
function D(N) {
|
|
2530
2537
|
s();
|
|
2531
2538
|
const u = window.scrollY;
|
|
2532
|
-
|
|
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" });
|
|
2533
2540
|
}
|
|
2534
|
-
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(
|
|
2535
2542
|
"mouseout",
|
|
2536
2543
|
x
|
|
2537
2544
|
), {
|
|
2538
2545
|
destroy: () => {
|
|
2539
|
-
var
|
|
2540
|
-
c || (
|
|
2546
|
+
var N, u, S;
|
|
2547
|
+
c || (N = a == null ? void 0 : a.remove) == null || N.call(a), a == null || a.removeEventListener("drag", D), a == null || a.removeEventListener(
|
|
2541
2548
|
"dragstart",
|
|
2542
|
-
|
|
2543
|
-
), 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(
|
|
2544
2551
|
"mouseout",
|
|
2545
2552
|
x
|
|
2546
2553
|
);
|
|
@@ -2552,23 +2559,23 @@ function Wn(r) {
|
|
|
2552
2559
|
mousemove: (l, c) => {
|
|
2553
2560
|
if (!l.editable)
|
|
2554
2561
|
return;
|
|
2555
|
-
const
|
|
2562
|
+
const g = ot(
|
|
2556
2563
|
{
|
|
2557
2564
|
x: c.clientX + 50 + r.dragHandleWidth,
|
|
2558
2565
|
y: c.clientY
|
|
2559
2566
|
},
|
|
2560
2567
|
r
|
|
2561
|
-
), v =
|
|
2562
|
-
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) {
|
|
2563
2570
|
o || s();
|
|
2564
2571
|
return;
|
|
2565
2572
|
}
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2568
|
-
Re(
|
|
2573
|
+
const b = rt(g, l, r);
|
|
2574
|
+
b != null && b >= 0 && (a.dataset.nodePos = String(
|
|
2575
|
+
Re(b, l)
|
|
2569
2576
|
));
|
|
2570
|
-
const
|
|
2571
|
-
u.top += (y - 24) / 2, u.top +=
|
|
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());
|
|
2572
2579
|
},
|
|
2573
2580
|
keydown: () => {
|
|
2574
2581
|
o || s();
|
|
@@ -2585,20 +2592,20 @@ function Wn(r) {
|
|
|
2585
2592
|
l.dom.classList.add("dragging");
|
|
2586
2593
|
},
|
|
2587
2594
|
drop: (l, c) => {
|
|
2588
|
-
var
|
|
2595
|
+
var f;
|
|
2589
2596
|
l.dom.classList.remove("dragging"), s();
|
|
2590
|
-
let
|
|
2597
|
+
let g = null;
|
|
2591
2598
|
const v = l.posAtCoords({
|
|
2592
2599
|
left: c.clientX,
|
|
2593
2600
|
top: c.clientY
|
|
2594
2601
|
});
|
|
2595
|
-
if (!v || (l.state.selection instanceof
|
|
2596
|
-
const
|
|
2597
|
-
if (l.state.selection instanceof
|
|
2598
|
-
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(
|
|
2599
2606
|
null,
|
|
2600
|
-
|
|
2601
|
-
), y = new on(rn.from(
|
|
2607
|
+
g
|
|
2608
|
+
), y = new on(rn.from(I), 0, 0);
|
|
2602
2609
|
l.dragging = { slice: y, move: c.ctrlKey };
|
|
2603
2610
|
}
|
|
2604
2611
|
},
|
|
@@ -2612,12 +2619,12 @@ function Wn(r) {
|
|
|
2612
2619
|
init() {
|
|
2613
2620
|
return {};
|
|
2614
2621
|
},
|
|
2615
|
-
apply(l, c,
|
|
2622
|
+
apply(l, c, g, v) {
|
|
2616
2623
|
if (l.docChanged && a && a.dataset.nodePos) {
|
|
2617
2624
|
const D = parseInt(a.dataset.nodePos, 10);
|
|
2618
2625
|
try {
|
|
2619
|
-
const
|
|
2620
|
-
(!
|
|
2626
|
+
const b = v.doc.resolve(D);
|
|
2627
|
+
(!b || b.parent.type.name === "doc") && (o = !1, s());
|
|
2621
2628
|
} catch {
|
|
2622
2629
|
o = !1, s();
|
|
2623
2630
|
}
|
|
@@ -2653,7 +2660,7 @@ const Kn = Zr.create({
|
|
|
2653
2660
|
placeholder: "撰写任何内容,或者按“/”输入命令..."
|
|
2654
2661
|
}), Qn = pr.configure({
|
|
2655
2662
|
HTMLAttributes: {
|
|
2656
|
-
class:
|
|
2663
|
+
class: W(
|
|
2657
2664
|
"text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
|
|
2658
2665
|
)
|
|
2659
2666
|
}
|
|
@@ -2661,63 +2668,63 @@ const Kn = Zr.create({
|
|
|
2661
2668
|
addProseMirrorPlugins() {
|
|
2662
2669
|
return [
|
|
2663
2670
|
fr({
|
|
2664
|
-
imageClass:
|
|
2671
|
+
imageClass: W("opacity-40 rounded-lg border border-stone-200")
|
|
2665
2672
|
})
|
|
2666
2673
|
];
|
|
2667
2674
|
}
|
|
2668
2675
|
}).configure({
|
|
2669
2676
|
allowBase64: !0,
|
|
2670
2677
|
HTMLAttributes: {
|
|
2671
|
-
class:
|
|
2678
|
+
class: W("rounded-lg border border-muted")
|
|
2672
2679
|
}
|
|
2673
2680
|
}), ta = hr.configure({
|
|
2674
2681
|
HTMLAttributes: {
|
|
2675
|
-
class:
|
|
2682
|
+
class: W("rounded-lg border border-muted")
|
|
2676
2683
|
}
|
|
2677
2684
|
}), oa = br.configure({
|
|
2678
2685
|
HTMLAttributes: {
|
|
2679
|
-
class:
|
|
2686
|
+
class: W("not-prose pl-2 ")
|
|
2680
2687
|
}
|
|
2681
2688
|
}), ra = xr.configure({
|
|
2682
2689
|
HTMLAttributes: {
|
|
2683
|
-
class:
|
|
2690
|
+
class: W("flex gap-2 items-start my-4")
|
|
2684
2691
|
},
|
|
2685
2692
|
nested: !0
|
|
2686
2693
|
}), na = yr.configure({
|
|
2687
2694
|
HTMLAttributes: {
|
|
2688
|
-
class:
|
|
2695
|
+
class: W("mt-4 mb-6 border-t border-muted-foreground")
|
|
2689
2696
|
}
|
|
2690
2697
|
}), aa = vr.configure({
|
|
2691
2698
|
bulletList: {
|
|
2692
2699
|
HTMLAttributes: {
|
|
2693
|
-
class:
|
|
2700
|
+
class: W("list-disc list-outside leading-3 -mt-2")
|
|
2694
2701
|
}
|
|
2695
2702
|
},
|
|
2696
2703
|
orderedList: {
|
|
2697
2704
|
HTMLAttributes: {
|
|
2698
|
-
class:
|
|
2705
|
+
class: W("list-decimal list-outside leading-3 -mt-2")
|
|
2699
2706
|
}
|
|
2700
2707
|
},
|
|
2701
2708
|
listItem: {
|
|
2702
2709
|
HTMLAttributes: {
|
|
2703
|
-
class:
|
|
2710
|
+
class: W("leading-normal -mb-2")
|
|
2704
2711
|
}
|
|
2705
2712
|
},
|
|
2706
2713
|
blockquote: {
|
|
2707
2714
|
HTMLAttributes: {
|
|
2708
|
-
class:
|
|
2715
|
+
class: W("border-l-4 border-primary")
|
|
2709
2716
|
}
|
|
2710
2717
|
},
|
|
2711
2718
|
codeBlock: {
|
|
2712
2719
|
HTMLAttributes: {
|
|
2713
|
-
class:
|
|
2720
|
+
class: W(
|
|
2714
2721
|
"rounded-md bg-muted text-muted-foreground border p-5 font-mono font-medium"
|
|
2715
2722
|
)
|
|
2716
2723
|
}
|
|
2717
2724
|
},
|
|
2718
2725
|
code: {
|
|
2719
2726
|
HTMLAttributes: {
|
|
2720
|
-
class:
|
|
2727
|
+
class: W("rounded-md bg-muted px-1.5 py-1 font-mono font-medium"),
|
|
2721
2728
|
spellcheck: "false"
|
|
2722
2729
|
}
|
|
2723
2730
|
},
|
|
@@ -2733,7 +2740,7 @@ const Kn = Zr.create({
|
|
|
2733
2740
|
lowlight: Kr(Jr)
|
|
2734
2741
|
}), ia = Cr.configure({
|
|
2735
2742
|
HTMLAttributes: {
|
|
2736
|
-
class:
|
|
2743
|
+
class: W("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
|
|
2737
2744
|
},
|
|
2738
2745
|
katexOptions: {
|
|
2739
2746
|
throwOnError: !1
|
|
@@ -2776,7 +2783,7 @@ const Kn = Zr.create({
|
|
|
2776
2783
|
ref: a,
|
|
2777
2784
|
align: e,
|
|
2778
2785
|
sideOffset: o,
|
|
2779
|
-
className:
|
|
2786
|
+
className: C(
|
|
2780
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",
|
|
2781
2788
|
r
|
|
2782
2789
|
),
|
|
@@ -2808,17 +2815,17 @@ const ua = Wr(
|
|
|
2808
2815
|
size: "default"
|
|
2809
2816
|
}
|
|
2810
2817
|
}
|
|
2811
|
-
),
|
|
2818
|
+
), ee = q.forwardRef(
|
|
2812
2819
|
({ className: r, variant: e, size: o, asChild: n = !1, ...a }, s) => /* @__PURE__ */ t(
|
|
2813
2820
|
n ? sn : "button",
|
|
2814
2821
|
{
|
|
2815
|
-
className:
|
|
2822
|
+
className: C(ua({ variant: e, size: o, className: r })),
|
|
2816
2823
|
ref: s,
|
|
2817
2824
|
...a
|
|
2818
2825
|
}
|
|
2819
2826
|
)
|
|
2820
2827
|
);
|
|
2821
|
-
|
|
2828
|
+
ee.displayName = "Button";
|
|
2822
2829
|
const nt = [
|
|
2823
2830
|
{
|
|
2824
2831
|
name: "默认",
|
|
@@ -2915,7 +2922,7 @@ const nt = [
|
|
|
2915
2922
|
dt,
|
|
2916
2923
|
{
|
|
2917
2924
|
classNames: {
|
|
2918
|
-
root:
|
|
2925
|
+
root: h`
|
|
2919
2926
|
background-color: transparent;
|
|
2920
2927
|
padding: 0;
|
|
2921
2928
|
.rc-tooltip-content {
|
|
@@ -2928,7 +2935,7 @@ const nt = [
|
|
|
2928
2935
|
...r
|
|
2929
2936
|
}
|
|
2930
2937
|
), pa = ({ open: r, onOpenChange: e }) => {
|
|
2931
|
-
const { editor: o } =
|
|
2938
|
+
const { editor: o } = te();
|
|
2932
2939
|
if (!o) return null;
|
|
2933
2940
|
const n = nt.find(
|
|
2934
2941
|
({ color: s }) => o.isActive("textStyle", { color: s })
|
|
@@ -2936,7 +2943,7 @@ const nt = [
|
|
|
2936
2943
|
({ color: s }) => o.isActive("highlight", { color: s })
|
|
2937
2944
|
);
|
|
2938
2945
|
return /* @__PURE__ */ m(ma, { modal: !0, open: r, onOpenChange: e, children: [
|
|
2939
|
-
/* @__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: [
|
|
2940
2947
|
/* @__PURE__ */ t(
|
|
2941
2948
|
"span",
|
|
2942
2949
|
{
|
|
@@ -3033,13 +3040,13 @@ function fa(r) {
|
|
|
3033
3040
|
}
|
|
3034
3041
|
}
|
|
3035
3042
|
const ha = ({ open: r, onOpenChange: e }) => {
|
|
3036
|
-
const o =
|
|
3037
|
-
return
|
|
3043
|
+
const o = xe(null), { editor: n } = te();
|
|
3044
|
+
return se(() => {
|
|
3038
3045
|
var a;
|
|
3039
3046
|
(a = o.current) == null || a.focus();
|
|
3040
3047
|
}), n ? /* @__PURE__ */ m(It, { modal: !0, open: r, onOpenChange: e, children: [
|
|
3041
3048
|
/* @__PURE__ */ t(me, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(an, { asChild: !0, children: /* @__PURE__ */ m(
|
|
3042
|
-
|
|
3049
|
+
ee,
|
|
3043
3050
|
{
|
|
3044
3051
|
size: "sm",
|
|
3045
3052
|
variant: "ghost",
|
|
@@ -3049,7 +3056,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3049
3056
|
/* @__PURE__ */ t(
|
|
3050
3057
|
"p",
|
|
3051
3058
|
{
|
|
3052
|
-
className:
|
|
3059
|
+
className: C(
|
|
3053
3060
|
"underline decoration-stone-400 underline-offset-4",
|
|
3054
3061
|
{
|
|
3055
3062
|
"text-blue-500": n.isActive("link")
|
|
@@ -3083,7 +3090,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3083
3090
|
}
|
|
3084
3091
|
),
|
|
3085
3092
|
n.getAttributes("link").href ? /* @__PURE__ */ t(
|
|
3086
|
-
|
|
3093
|
+
ee,
|
|
3087
3094
|
{
|
|
3088
3095
|
size: "icon",
|
|
3089
3096
|
variant: "outline",
|
|
@@ -3094,15 +3101,15 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3094
3101
|
},
|
|
3095
3102
|
children: /* @__PURE__ */ t(ut, { className: "h-4 w-4" })
|
|
3096
3103
|
}
|
|
3097
|
-
) : /* @__PURE__ */ t(
|
|
3104
|
+
) : /* @__PURE__ */ t(ee, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ke, { className: "h-4 w-4" }) })
|
|
3098
3105
|
]
|
|
3099
3106
|
}
|
|
3100
3107
|
) })
|
|
3101
3108
|
] }) : null;
|
|
3102
3109
|
}, ba = () => {
|
|
3103
|
-
const { editor: r } =
|
|
3110
|
+
const { editor: r } = te();
|
|
3104
3111
|
return r ? /* @__PURE__ */ t(me, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ t(
|
|
3105
|
-
|
|
3112
|
+
ee,
|
|
3106
3113
|
{
|
|
3107
3114
|
variant: "ghost",
|
|
3108
3115
|
size: "sm",
|
|
@@ -3119,7 +3126,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3119
3126
|
children: /* @__PURE__ */ t(
|
|
3120
3127
|
ln,
|
|
3121
3128
|
{
|
|
3122
|
-
className:
|
|
3129
|
+
className: C("size-4", { "text-blue-500": r.isActive("math") }),
|
|
3123
3130
|
strokeWidth: 2.3
|
|
3124
3131
|
}
|
|
3125
3132
|
)
|
|
@@ -3190,7 +3197,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3190
3197
|
isActive: (r) => r.isActive("codeBlock")
|
|
3191
3198
|
}
|
|
3192
3199
|
], xa = ({ open: r, onOpenChange: e }) => {
|
|
3193
|
-
const { editor: o } =
|
|
3200
|
+
const { editor: o } = te();
|
|
3194
3201
|
if (!o) return null;
|
|
3195
3202
|
const n = je.filter(
|
|
3196
3203
|
(a) => a.isActive(o)
|
|
@@ -3204,7 +3211,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3204
3211
|
{
|
|
3205
3212
|
asChild: !0,
|
|
3206
3213
|
className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
|
|
3207
|
-
children: /* @__PURE__ */ m(
|
|
3214
|
+
children: /* @__PURE__ */ m(ee, { size: "sm", variant: "ghost", children: [
|
|
3208
3215
|
/* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children: n.name }),
|
|
3209
3216
|
/* @__PURE__ */ t(mt, {})
|
|
3210
3217
|
] })
|
|
@@ -3232,14 +3239,14 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3232
3239
|
))
|
|
3233
3240
|
] })
|
|
3234
3241
|
] });
|
|
3235
|
-
},
|
|
3242
|
+
}, fe = q.forwardRef(
|
|
3236
3243
|
({ className: r, orientation: e = "horizontal", decorative: o = !0, ...n }, a) => /* @__PURE__ */ t(
|
|
3237
3244
|
St.Root,
|
|
3238
3245
|
{
|
|
3239
3246
|
ref: a,
|
|
3240
3247
|
decorative: o,
|
|
3241
3248
|
orientation: e,
|
|
3242
|
-
className:
|
|
3249
|
+
className: C(
|
|
3243
3250
|
"shrink-0 bg-border",
|
|
3244
3251
|
e === "horizontal" ? "h-[1px] w-full" : " w-[1px]",
|
|
3245
3252
|
r
|
|
@@ -3248,7 +3255,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
|
|
|
3248
3255
|
}
|
|
3249
3256
|
)
|
|
3250
3257
|
);
|
|
3251
|
-
|
|
3258
|
+
fe.displayName = St.Root.displayName;
|
|
3252
3259
|
const ya = () => /* @__PURE__ */ m("div", { className: "flex items-center justify-center gap-0.5", children: [
|
|
3253
3260
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
|
|
3254
3261
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
|
|
@@ -3257,7 +3264,7 @@ const ya = () => /* @__PURE__ */ m("div", { className: "flex items-center justif
|
|
|
3257
3264
|
de.Root,
|
|
3258
3265
|
{
|
|
3259
3266
|
ref: n,
|
|
3260
|
-
className:
|
|
3267
|
+
className: C("relative overflow-hidden", r),
|
|
3261
3268
|
...o,
|
|
3262
3269
|
children: [
|
|
3263
3270
|
/* @__PURE__ */ t(de.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
|
|
@@ -3272,7 +3279,7 @@ const jt = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, n)
|
|
|
3272
3279
|
{
|
|
3273
3280
|
ref: n,
|
|
3274
3281
|
orientation: e,
|
|
3275
|
-
className:
|
|
3282
|
+
className: C(
|
|
3276
3283
|
"flex touch-none select-none transition-colors",
|
|
3277
3284
|
e === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
3278
3285
|
e === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -3283,32 +3290,32 @@ const jt = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, n)
|
|
|
3283
3290
|
}
|
|
3284
3291
|
));
|
|
3285
3292
|
jt.displayName = de.ScrollAreaScrollbar.displayName;
|
|
3286
|
-
const va =
|
|
3287
|
-
|
|
3293
|
+
const va = ne.Portal, Xt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3294
|
+
ne.Overlay,
|
|
3288
3295
|
{
|
|
3289
3296
|
ref: o,
|
|
3290
|
-
className:
|
|
3297
|
+
className: C(
|
|
3291
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",
|
|
3292
3299
|
r
|
|
3293
3300
|
),
|
|
3294
3301
|
...e
|
|
3295
3302
|
}
|
|
3296
3303
|
));
|
|
3297
|
-
Xt.displayName =
|
|
3304
|
+
Xt.displayName = ne.Overlay.displayName;
|
|
3298
3305
|
const ka = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__ */ m(va, { children: [
|
|
3299
3306
|
/* @__PURE__ */ t(Xt, {}),
|
|
3300
3307
|
/* @__PURE__ */ m(
|
|
3301
|
-
|
|
3308
|
+
ne.Content,
|
|
3302
3309
|
{
|
|
3303
3310
|
ref: n,
|
|
3304
|
-
className:
|
|
3311
|
+
className: C(
|
|
3305
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",
|
|
3306
3313
|
r
|
|
3307
3314
|
),
|
|
3308
3315
|
...o,
|
|
3309
3316
|
children: [
|
|
3310
3317
|
e,
|
|
3311
|
-
/* @__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: [
|
|
3312
3319
|
/* @__PURE__ */ t(cn, { className: "h-4 w-4" }),
|
|
3313
3320
|
/* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
|
|
3314
3321
|
] })
|
|
@@ -3316,47 +3323,47 @@ const ka = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__
|
|
|
3316
3323
|
}
|
|
3317
3324
|
)
|
|
3318
3325
|
] }));
|
|
3319
|
-
ka.displayName =
|
|
3326
|
+
ka.displayName = ne.Content.displayName;
|
|
3320
3327
|
const Ca = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3321
|
-
|
|
3328
|
+
ne.Title,
|
|
3322
3329
|
{
|
|
3323
3330
|
ref: o,
|
|
3324
|
-
className:
|
|
3331
|
+
className: C(
|
|
3325
3332
|
"text-lg font-semibold leading-none tracking-tight",
|
|
3326
3333
|
r
|
|
3327
3334
|
),
|
|
3328
3335
|
...e
|
|
3329
3336
|
}
|
|
3330
3337
|
));
|
|
3331
|
-
Ca.displayName =
|
|
3338
|
+
Ca.displayName = ne.Title.displayName;
|
|
3332
3339
|
const wa = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3333
|
-
|
|
3340
|
+
ne.Description,
|
|
3334
3341
|
{
|
|
3335
3342
|
ref: o,
|
|
3336
|
-
className:
|
|
3343
|
+
className: C("text-sm text-muted-foreground", r),
|
|
3337
3344
|
...e
|
|
3338
3345
|
}
|
|
3339
3346
|
));
|
|
3340
|
-
wa.displayName =
|
|
3347
|
+
wa.displayName = ne.Description.displayName;
|
|
3341
3348
|
const Ut = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3342
|
-
|
|
3349
|
+
J,
|
|
3343
3350
|
{
|
|
3344
3351
|
ref: o,
|
|
3345
|
-
className:
|
|
3352
|
+
className: C(
|
|
3346
3353
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
3347
3354
|
r
|
|
3348
3355
|
),
|
|
3349
3356
|
...e
|
|
3350
3357
|
}
|
|
3351
3358
|
));
|
|
3352
|
-
Ut.displayName =
|
|
3359
|
+
Ut.displayName = J.displayName;
|
|
3353
3360
|
const Gt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
|
|
3354
3361
|
/* @__PURE__ */ t(Ge, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
|
|
3355
3362
|
/* @__PURE__ */ t(
|
|
3356
|
-
|
|
3363
|
+
J.Input,
|
|
3357
3364
|
{
|
|
3358
3365
|
ref: o,
|
|
3359
|
-
className:
|
|
3366
|
+
className: C(
|
|
3360
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",
|
|
3361
3368
|
r
|
|
3362
3369
|
),
|
|
@@ -3364,67 +3371,67 @@ const Gt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div",
|
|
|
3364
3371
|
}
|
|
3365
3372
|
)
|
|
3366
3373
|
] }));
|
|
3367
|
-
Gt.displayName =
|
|
3374
|
+
Gt.displayName = J.Input.displayName;
|
|
3368
3375
|
const Na = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3369
|
-
|
|
3376
|
+
J.List,
|
|
3370
3377
|
{
|
|
3371
3378
|
ref: o,
|
|
3372
|
-
className:
|
|
3379
|
+
className: C("max-h-[300px] overflow-y-auto overflow-x-hidden", r),
|
|
3373
3380
|
...e
|
|
3374
3381
|
}
|
|
3375
3382
|
));
|
|
3376
|
-
Na.displayName =
|
|
3383
|
+
Na.displayName = J.List.displayName;
|
|
3377
3384
|
const Ia = q.forwardRef((r, e) => /* @__PURE__ */ t(
|
|
3378
|
-
|
|
3385
|
+
J.Empty,
|
|
3379
3386
|
{
|
|
3380
3387
|
ref: e,
|
|
3381
3388
|
className: "py-6 text-center text-sm",
|
|
3382
3389
|
...r
|
|
3383
3390
|
}
|
|
3384
3391
|
));
|
|
3385
|
-
Ia.displayName =
|
|
3392
|
+
Ia.displayName = J.Empty.displayName;
|
|
3386
3393
|
const Ne = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3387
|
-
|
|
3394
|
+
J.Group,
|
|
3388
3395
|
{
|
|
3389
3396
|
ref: o,
|
|
3390
|
-
className:
|
|
3397
|
+
className: C(
|
|
3391
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",
|
|
3392
3399
|
r
|
|
3393
3400
|
),
|
|
3394
3401
|
...e
|
|
3395
3402
|
}
|
|
3396
3403
|
));
|
|
3397
|
-
Ne.displayName =
|
|
3404
|
+
Ne.displayName = J.Group.displayName;
|
|
3398
3405
|
const Qe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3399
|
-
|
|
3406
|
+
J.Separator,
|
|
3400
3407
|
{
|
|
3401
3408
|
ref: o,
|
|
3402
|
-
className:
|
|
3409
|
+
className: C("-mx-1 h-px bg-border", r),
|
|
3403
3410
|
...e
|
|
3404
3411
|
}
|
|
3405
3412
|
));
|
|
3406
|
-
Qe.displayName =
|
|
3407
|
-
const
|
|
3408
|
-
|
|
3413
|
+
Qe.displayName = J.Separator.displayName;
|
|
3414
|
+
const he = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3415
|
+
J.Item,
|
|
3409
3416
|
{
|
|
3410
3417
|
ref: o,
|
|
3411
|
-
className:
|
|
3418
|
+
className: C(
|
|
3412
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",
|
|
3413
3420
|
r
|
|
3414
3421
|
),
|
|
3415
3422
|
...e
|
|
3416
3423
|
}
|
|
3417
3424
|
));
|
|
3418
|
-
|
|
3425
|
+
he.displayName = J.Item.displayName;
|
|
3419
3426
|
const Sa = ({
|
|
3420
3427
|
completion: r,
|
|
3421
3428
|
onDiscard: e
|
|
3422
3429
|
}) => {
|
|
3423
|
-
const { editor: o } =
|
|
3430
|
+
const { editor: o } = te();
|
|
3424
3431
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3425
3432
|
/* @__PURE__ */ m(Ne, { children: [
|
|
3426
3433
|
/* @__PURE__ */ m(
|
|
3427
|
-
|
|
3434
|
+
he,
|
|
3428
3435
|
{
|
|
3429
3436
|
className: "gap-2 px-4",
|
|
3430
3437
|
value: "replace",
|
|
@@ -3445,7 +3452,7 @@ const Sa = ({
|
|
|
3445
3452
|
}
|
|
3446
3453
|
),
|
|
3447
3454
|
/* @__PURE__ */ m(
|
|
3448
|
-
|
|
3455
|
+
he,
|
|
3449
3456
|
{
|
|
3450
3457
|
className: "gap-2 px-4",
|
|
3451
3458
|
value: "insert",
|
|
@@ -3461,7 +3468,7 @@ const Sa = ({
|
|
|
3461
3468
|
)
|
|
3462
3469
|
] }),
|
|
3463
3470
|
/* @__PURE__ */ t(Qe, {}),
|
|
3464
|
-
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ m(
|
|
3471
|
+
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ m(he, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
|
|
3465
3472
|
/* @__PURE__ */ t(un, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3466
3473
|
"丢弃"
|
|
3467
3474
|
] }) })
|
|
@@ -3492,12 +3499,12 @@ const Sa = ({
|
|
|
3492
3499
|
icon: hn
|
|
3493
3500
|
}
|
|
3494
3501
|
], Ma = ({ onSelect: r }) => {
|
|
3495
|
-
const { editor: e } =
|
|
3502
|
+
const { editor: e } = te();
|
|
3496
3503
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3497
3504
|
/* @__PURE__ */ m(Ne, { heading: "编辑或校对选中文本", children: [
|
|
3498
3505
|
" ",
|
|
3499
3506
|
Ta.map((o) => /* @__PURE__ */ m(
|
|
3500
|
-
|
|
3507
|
+
he,
|
|
3501
3508
|
{
|
|
3502
3509
|
onSelect: (n) => {
|
|
3503
3510
|
const a = e.state.selection.content(), s = e.storage.markdown.serializer.serialize(
|
|
@@ -3519,7 +3526,7 @@ const Sa = ({
|
|
|
3519
3526
|
/* @__PURE__ */ m(Ne, { heading: "使用 AI 完成更多", children: [
|
|
3520
3527
|
" ",
|
|
3521
3528
|
/* @__PURE__ */ m(
|
|
3522
|
-
|
|
3529
|
+
he,
|
|
3523
3530
|
{
|
|
3524
3531
|
onSelect: () => {
|
|
3525
3532
|
const o = e.state.selection.from, n = Ar(e, o);
|
|
@@ -3537,7 +3544,7 @@ const Sa = ({
|
|
|
3537
3544
|
] });
|
|
3538
3545
|
};
|
|
3539
3546
|
function La({ onOpenChange: r, options: e }) {
|
|
3540
|
-
const { editor: o } =
|
|
3547
|
+
const { editor: o } = te(), [n, a] = O(""), { completion: s, complete: i, isLoading: d } = Nn({
|
|
3541
3548
|
// id: "novel",
|
|
3542
3549
|
api: "/api/generate",
|
|
3543
3550
|
onResponse: (x) => {
|
|
@@ -3571,7 +3578,7 @@ function La({ onOpenChange: r, options: e }) {
|
|
|
3571
3578
|
}
|
|
3572
3579
|
),
|
|
3573
3580
|
/* @__PURE__ */ t(
|
|
3574
|
-
|
|
3581
|
+
ee,
|
|
3575
3582
|
{
|
|
3576
3583
|
size: "icon",
|
|
3577
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",
|
|
@@ -3615,8 +3622,8 @@ const Aa = ({
|
|
|
3615
3622
|
enableAI: n = !1,
|
|
3616
3623
|
aiOptions: a
|
|
3617
3624
|
}) => {
|
|
3618
|
-
const { editor: s } =
|
|
3619
|
-
return
|
|
3625
|
+
const { editor: s } = te();
|
|
3626
|
+
return se(() => {
|
|
3620
3627
|
e || Rr(s);
|
|
3621
3628
|
}, [e]), /* @__PURE__ */ m(
|
|
3622
3629
|
Pr,
|
|
@@ -3639,7 +3646,7 @@ const Aa = ({
|
|
|
3639
3646
|
),
|
|
3640
3647
|
!e && /* @__PURE__ */ m(oo, { children: [
|
|
3641
3648
|
n && /* @__PURE__ */ m(
|
|
3642
|
-
|
|
3649
|
+
ee,
|
|
3643
3650
|
{
|
|
3644
3651
|
className: "gap-1 text-purple-500",
|
|
3645
3652
|
variant: "ghost",
|
|
@@ -3686,7 +3693,7 @@ const Aa = ({
|
|
|
3686
3693
|
onUpload: Da,
|
|
3687
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)
|
|
3688
3695
|
}), Pa = () => {
|
|
3689
|
-
const { editor: r } =
|
|
3696
|
+
const { editor: r } = te();
|
|
3690
3697
|
return r ? /* @__PURE__ */ t("div", { className: "flex", children: [
|
|
3691
3698
|
{
|
|
3692
3699
|
name: "粗体",
|
|
@@ -3730,7 +3737,7 @@ const Aa = ({
|
|
|
3730
3737
|
o.command(n);
|
|
3731
3738
|
},
|
|
3732
3739
|
children: /* @__PURE__ */ t(me, { overlay: o.name, placement: "top", children: /* @__PURE__ */ t(
|
|
3733
|
-
|
|
3740
|
+
ee,
|
|
3734
3741
|
{
|
|
3735
3742
|
size: "sm",
|
|
3736
3743
|
className: "rounded-md",
|
|
@@ -3739,7 +3746,7 @@ const Aa = ({
|
|
|
3739
3746
|
children: /* @__PURE__ */ t(
|
|
3740
3747
|
o.icon,
|
|
3741
3748
|
{
|
|
3742
|
-
className:
|
|
3749
|
+
className: C("h-4 w-4", {
|
|
3743
3750
|
"text-blue-500": o.isActive(r)
|
|
3744
3751
|
})
|
|
3745
3752
|
}
|
|
@@ -3877,7 +3884,7 @@ const Aa = ({
|
|
|
3877
3884
|
De.Item,
|
|
3878
3885
|
{
|
|
3879
3886
|
onClick: i.onClick,
|
|
3880
|
-
className:
|
|
3887
|
+
className: C(
|
|
3881
3888
|
"gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3882
3889
|
i.className
|
|
3883
3890
|
),
|
|
@@ -3895,9 +3902,9 @@ const Aa = ({
|
|
|
3895
3902
|
De.SubMenu,
|
|
3896
3903
|
{
|
|
3897
3904
|
expandIcon: /* @__PURE__ */ t(wo, { size: 16 }),
|
|
3898
|
-
popupClassName:
|
|
3905
|
+
popupClassName: C(
|
|
3899
3906
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
|
|
3900
|
-
|
|
3907
|
+
h`
|
|
3901
3908
|
.rc-menu {
|
|
3902
3909
|
border: none !important;
|
|
3903
3910
|
box-shadow: none !important;
|
|
@@ -3905,9 +3912,9 @@ const Aa = ({
|
|
|
3905
3912
|
`
|
|
3906
3913
|
),
|
|
3907
3914
|
popupOffset: [4, 0],
|
|
3908
|
-
className:
|
|
3915
|
+
className: C(
|
|
3909
3916
|
"gap-2 !p-0 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3910
|
-
|
|
3917
|
+
h`
|
|
3911
3918
|
.rc-menu-submenu-title {
|
|
3912
3919
|
display: flex;
|
|
3913
3920
|
align-items: center;
|
|
@@ -3939,9 +3946,9 @@ const Aa = ({
|
|
|
3939
3946
|
overlay: /* @__PURE__ */ t(
|
|
3940
3947
|
De,
|
|
3941
3948
|
{
|
|
3942
|
-
className:
|
|
3949
|
+
className: C(
|
|
3943
3950
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
|
|
3944
|
-
|
|
3951
|
+
h`
|
|
3945
3952
|
.rc-menu-submenu-active {
|
|
3946
3953
|
.rc-menu-submenu-title {
|
|
3947
3954
|
background-color: hsl(var(--accent)) !important;
|
|
@@ -3960,10 +3967,10 @@ const Aa = ({
|
|
|
3960
3967
|
});
|
|
3961
3968
|
Yt.displayName = "DropdownMenu";
|
|
3962
3969
|
const Ea = ({ children: r, ...e }) => {
|
|
3963
|
-
const { editor: o } =
|
|
3964
|
-
o && o.state.selection instanceof
|
|
3970
|
+
const { editor: o } = te(), n = () => {
|
|
3971
|
+
o && o.state.selection instanceof Q && (o.commands.deleteSelection(), o.commands.focus());
|
|
3965
3972
|
}, a = () => {
|
|
3966
|
-
if (o && o.state.selection instanceof
|
|
3973
|
+
if (o && o.state.selection instanceof Q) {
|
|
3967
3974
|
const d = o.state.selection.node, p = o.state.selection.to;
|
|
3968
3975
|
o.chain().insertContentAt(p, {
|
|
3969
3976
|
type: d.type.name,
|
|
@@ -3976,7 +3983,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
3976
3983
|
icon: /* @__PURE__ */ t(d.icon, { size: 16 }),
|
|
3977
3984
|
label: d.name,
|
|
3978
3985
|
onClick: () => {
|
|
3979
|
-
o && o.state.selection instanceof
|
|
3986
|
+
o && o.state.selection instanceof Q && d.command(o);
|
|
3980
3987
|
},
|
|
3981
3988
|
isActive: d.isActive(o)
|
|
3982
3989
|
}));
|
|
@@ -4004,7 +4011,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4004
4011
|
}
|
|
4005
4012
|
], ...e, children: r });
|
|
4006
4013
|
}, $a = () => {
|
|
4007
|
-
const { editor: r } =
|
|
4014
|
+
const { editor: r } = te(), e = (o) => {
|
|
4008
4015
|
if (!r) return;
|
|
4009
4016
|
const n = o.target.closest(".custom-drag-handle");
|
|
4010
4017
|
if (!n) return;
|
|
@@ -4017,9 +4024,9 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4017
4024
|
return /* @__PURE__ */ m(
|
|
4018
4025
|
"div",
|
|
4019
4026
|
{
|
|
4020
|
-
className:
|
|
4027
|
+
className: C(
|
|
4021
4028
|
"custom-drag-handle",
|
|
4022
|
-
|
|
4029
|
+
h`
|
|
4023
4030
|
width: auto;
|
|
4024
4031
|
background: none;
|
|
4025
4032
|
display: flex;
|
|
@@ -4036,7 +4043,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4036
4043
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以在下方添加快" })
|
|
4037
4044
|
] }),
|
|
4038
4045
|
children: /* @__PURE__ */ t(
|
|
4039
|
-
|
|
4046
|
+
ee,
|
|
4040
4047
|
{
|
|
4041
4048
|
size: "icon",
|
|
4042
4049
|
variant: "ghost",
|
|
@@ -4055,7 +4062,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4055
4062
|
"拖动",
|
|
4056
4063
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以移动" })
|
|
4057
4064
|
] }) }),
|
|
4058
|
-
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 }) })
|
|
4059
4066
|
}
|
|
4060
4067
|
) })
|
|
4061
4068
|
]
|
|
@@ -4074,33 +4081,33 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4074
4081
|
editorRef: x,
|
|
4075
4082
|
enableAI: l = !1,
|
|
4076
4083
|
aiOptions: c
|
|
4077
|
-
} = r, [
|
|
4084
|
+
} = r, [g, v] = O(
|
|
4078
4085
|
o
|
|
4079
|
-
), [D,
|
|
4080
|
-
const
|
|
4081
|
-
return
|
|
4082
|
-
In.highlightElement(
|
|
4083
|
-
}), new XMLSerializer().serializeToString(
|
|
4084
|
-
},
|
|
4085
|
-
async (
|
|
4086
|
-
const
|
|
4087
|
-
|
|
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($);
|
|
4090
|
+
}), new XMLSerializer().serializeToString(X);
|
|
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(
|
|
4088
4095
|
"html-content",
|
|
4089
|
-
|
|
4090
|
-
), window.localStorage.setItem(a, JSON.stringify(
|
|
4096
|
+
E(M.getHTML())
|
|
4097
|
+
), window.localStorage.setItem(a, JSON.stringify(X)), window.localStorage.setItem(
|
|
4091
4098
|
"markdown",
|
|
4092
|
-
|
|
4093
|
-
),
|
|
4099
|
+
M.storage.markdown.getMarkdown()
|
|
4100
|
+
), b("Saved"));
|
|
4094
4101
|
},
|
|
4095
4102
|
500
|
|
4096
|
-
),
|
|
4103
|
+
), V = be(() => {
|
|
4097
4104
|
if (!p) return Ra;
|
|
4098
4105
|
const {
|
|
4099
|
-
beforeUpload:
|
|
4100
|
-
maxSize:
|
|
4101
|
-
action:
|
|
4102
|
-
headers:
|
|
4103
|
-
method:
|
|
4106
|
+
beforeUpload: M,
|
|
4107
|
+
maxSize: X,
|
|
4108
|
+
action: $,
|
|
4109
|
+
headers: Z,
|
|
4110
|
+
method: oe,
|
|
4104
4111
|
name: $e,
|
|
4105
4112
|
onSuccess: Se,
|
|
4106
4113
|
onError: Te
|
|
@@ -4109,56 +4116,56 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4109
4116
|
onUpload: (ie) => {
|
|
4110
4117
|
const Me = new FormData();
|
|
4111
4118
|
Me.append($e || "file", ie);
|
|
4112
|
-
const He = fetch(
|
|
4113
|
-
method:
|
|
4119
|
+
const He = fetch($, {
|
|
4120
|
+
method: oe || "POST",
|
|
4114
4121
|
headers: {
|
|
4115
|
-
...
|
|
4122
|
+
...Z
|
|
4116
4123
|
},
|
|
4117
4124
|
body: Me
|
|
4118
4125
|
});
|
|
4119
|
-
return new Promise((
|
|
4126
|
+
return new Promise((ye, w) => {
|
|
4120
4127
|
He.then(async (B) => {
|
|
4121
4128
|
if (Se) {
|
|
4122
4129
|
const z = await B.json();
|
|
4123
|
-
|
|
4130
|
+
ye(Se(z));
|
|
4124
4131
|
return;
|
|
4125
4132
|
}
|
|
4126
4133
|
if (B.status === 200) {
|
|
4127
4134
|
const { url: z } = await B.json(), T = new Image();
|
|
4128
4135
|
T.src = z, T.onload = () => {
|
|
4129
|
-
|
|
4136
|
+
ye(z);
|
|
4130
4137
|
};
|
|
4131
|
-
} else throw B.status === 401 ? (
|
|
4138
|
+
} else throw B.status === 401 ? (ye(ie), new Error(
|
|
4132
4139
|
"`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead."
|
|
4133
4140
|
)) : new Error("Error uploading image. Please try again.");
|
|
4134
4141
|
}).catch((B) => {
|
|
4135
|
-
Te && Te(B),
|
|
4142
|
+
Te && Te(B), w(B);
|
|
4136
4143
|
});
|
|
4137
4144
|
});
|
|
4138
4145
|
},
|
|
4139
|
-
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)
|
|
4140
4147
|
});
|
|
4141
4148
|
}, [p]);
|
|
4142
|
-
if (
|
|
4149
|
+
if (se(() => {
|
|
4143
4150
|
if (!s) return;
|
|
4144
|
-
const
|
|
4145
|
-
v(
|
|
4146
|
-
}, [a, s]), !
|
|
4147
|
-
const
|
|
4151
|
+
const M = window.localStorage.getItem(a);
|
|
4152
|
+
v(M ? JSON.parse(M) : za);
|
|
4153
|
+
}, [a, s]), !g) return null;
|
|
4154
|
+
const Y = [
|
|
4148
4155
|
...Ot,
|
|
4149
4156
|
Ba({
|
|
4150
|
-
uploadFn:
|
|
4157
|
+
uploadFn: V
|
|
4151
4158
|
})
|
|
4152
4159
|
];
|
|
4153
|
-
return /* @__PURE__ */ m("div", { className:
|
|
4160
|
+
return /* @__PURE__ */ m("div", { className: C("relative w-full max-w-screen-lg", e), children: [
|
|
4154
4161
|
(s && i || d) && /* @__PURE__ */ m("div", { className: "flex absolute right-5 top-5 z-10 mb-5 gap-2", children: [
|
|
4155
4162
|
s && i && /* @__PURE__ */ t("div", { className: "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground", children: D }),
|
|
4156
4163
|
d && /* @__PURE__ */ m(
|
|
4157
4164
|
"div",
|
|
4158
4165
|
{
|
|
4159
|
-
className:
|
|
4166
|
+
className: f ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
|
|
4160
4167
|
children: [
|
|
4161
|
-
|
|
4168
|
+
f,
|
|
4162
4169
|
" Words"
|
|
4163
4170
|
]
|
|
4164
4171
|
}
|
|
@@ -4167,66 +4174,66 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4167
4174
|
/* @__PURE__ */ t($r, { children: /* @__PURE__ */ m(
|
|
4168
4175
|
Hr,
|
|
4169
4176
|
{
|
|
4170
|
-
onCreate: ({ editor:
|
|
4171
|
-
x && (x.current =
|
|
4177
|
+
onCreate: ({ editor: M }) => {
|
|
4178
|
+
x && (x.current = M);
|
|
4172
4179
|
},
|
|
4173
|
-
initialContent:
|
|
4174
|
-
extensions:
|
|
4180
|
+
initialContent: g,
|
|
4181
|
+
extensions: Y,
|
|
4175
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",
|
|
4176
4183
|
editorProps: {
|
|
4177
4184
|
handleDOMEvents: {
|
|
4178
|
-
keydown: (
|
|
4185
|
+
keydown: (M, X) => _r(X)
|
|
4179
4186
|
},
|
|
4180
|
-
handlePaste: (
|
|
4181
|
-
handleDrop: (
|
|
4187
|
+
handlePaste: (M, X) => Fr(M, X, V),
|
|
4188
|
+
handleDrop: (M, X, $, Z) => Or(M, X, Z, V),
|
|
4182
4189
|
attributes: {
|
|
4183
4190
|
class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
|
|
4184
4191
|
}
|
|
4185
4192
|
},
|
|
4186
|
-
onUpdate: ({ editor:
|
|
4187
|
-
|
|
4193
|
+
onUpdate: ({ editor: M }) => {
|
|
4194
|
+
A(M), b("Unsaved");
|
|
4188
4195
|
},
|
|
4189
4196
|
slotAfter: /* @__PURE__ */ t(qr, {}),
|
|
4190
4197
|
children: [
|
|
4191
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: [
|
|
4192
4199
|
/* @__PURE__ */ t(Xr, { className: "px-2 text-muted-foreground", children: "没有结果" }),
|
|
4193
4200
|
/* @__PURE__ */ t(Ur, { children: qt({
|
|
4194
|
-
uploadFn:
|
|
4195
|
-
}).map((
|
|
4201
|
+
uploadFn: V
|
|
4202
|
+
}).map((M) => /* @__PURE__ */ m(
|
|
4196
4203
|
Gr,
|
|
4197
4204
|
{
|
|
4198
|
-
value:
|
|
4199
|
-
onCommand: (
|
|
4205
|
+
value: M.title,
|
|
4206
|
+
onCommand: (X) => M.command(X),
|
|
4200
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",
|
|
4201
4208
|
children: [
|
|
4202
|
-
/* @__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 }),
|
|
4203
4210
|
/* @__PURE__ */ m("div", { children: [
|
|
4204
|
-
/* @__PURE__ */ t("p", { className: "font-medium", children:
|
|
4205
|
-
/* @__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 })
|
|
4206
4213
|
] })
|
|
4207
4214
|
]
|
|
4208
4215
|
},
|
|
4209
|
-
|
|
4216
|
+
M.title
|
|
4210
4217
|
)) })
|
|
4211
4218
|
] }),
|
|
4212
4219
|
/* @__PURE__ */ m(
|
|
4213
4220
|
Aa,
|
|
4214
4221
|
{
|
|
4215
|
-
open:
|
|
4216
|
-
onOpenChange:
|
|
4222
|
+
open: k,
|
|
4223
|
+
onOpenChange: L,
|
|
4217
4224
|
enableAI: l,
|
|
4218
4225
|
aiOptions: c,
|
|
4219
4226
|
children: [
|
|
4220
|
-
l && /* @__PURE__ */ t(
|
|
4221
|
-
/* @__PURE__ */ t(xa, { open: y, onOpenChange:
|
|
4222
|
-
/* @__PURE__ */ t(
|
|
4223
|
-
/* @__PURE__ */ t(ha, { open:
|
|
4224
|
-
/* @__PURE__ */ t(
|
|
4227
|
+
l && /* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4228
|
+
/* @__PURE__ */ t(xa, { open: y, onOpenChange: N }),
|
|
4229
|
+
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4230
|
+
/* @__PURE__ */ t(ha, { open: U, onOpenChange: j }),
|
|
4231
|
+
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4225
4232
|
/* @__PURE__ */ t(ba, {}),
|
|
4226
|
-
/* @__PURE__ */ t(
|
|
4233
|
+
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4227
4234
|
/* @__PURE__ */ t(Pa, {}),
|
|
4228
|
-
/* @__PURE__ */ t(
|
|
4229
|
-
/* @__PURE__ */ t(pa, { open: u, onOpenChange:
|
|
4235
|
+
/* @__PURE__ */ t(fe, { orientation: "vertical" }),
|
|
4236
|
+
/* @__PURE__ */ t(pa, { open: u, onOpenChange: S })
|
|
4230
4237
|
]
|
|
4231
4238
|
}
|
|
4232
4239
|
),
|
|
@@ -4236,7 +4243,7 @@ const Ea = ({ children: r, ...e }) => {
|
|
|
4236
4243
|
) })
|
|
4237
4244
|
] });
|
|
4238
4245
|
}, Oa = ({ json: r }) => {
|
|
4239
|
-
const e =
|
|
4246
|
+
const e = be(() => Tn(r ?? {}, Ot), [r]);
|
|
4240
4247
|
return /* @__PURE__ */ t("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e } }) });
|
|
4241
4248
|
}, Vt = Ha;
|
|
4242
4249
|
Vt.Preview = Oa;
|
|
@@ -4254,7 +4261,7 @@ const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4254
4261
|
Editor: Vt,
|
|
4255
4262
|
Markdown: $t,
|
|
4256
4263
|
MdEditor: Ht,
|
|
4257
|
-
SortableUtils:
|
|
4264
|
+
SortableUtils: K,
|
|
4258
4265
|
desktopAppConfig: Ve,
|
|
4259
4266
|
desktopConfigMap: Be,
|
|
4260
4267
|
desktopGroupConfig: Lt,
|
|
@@ -4275,7 +4282,7 @@ export {
|
|
|
4275
4282
|
Vt as Editor,
|
|
4276
4283
|
$t as Markdown,
|
|
4277
4284
|
Ht as MdEditor,
|
|
4278
|
-
|
|
4285
|
+
K as SortableUtils,
|
|
4279
4286
|
As as default,
|
|
4280
4287
|
Ve as desktopAppConfig,
|
|
4281
4288
|
Be as desktopConfigMap,
|