zs_library 0.3.22 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +105 -105
- package/dist/index.umd.js +30 -30
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Desktop, MdEditor, Dock } from './components';
|
|
1
|
+
export { Desktop, MdEditor, Markdown, Dock } from './components';
|
package/dist/index.es.js
CHANGED
|
@@ -14,7 +14,7 @@ import Oe from "rc-tooltip";
|
|
|
14
14
|
import { RiPencilRuler2Line as Ue, RiShareLine as Ve, RiInformationLine as _e, RiCloseCircleLine as We, RiAnticlockwise2Line as Je, RiClockwise2Line as Ke, RiZoomInLine as Ze, RiZoomOutLine as Qe, RiCloseLine as eo, RiArrowLeftLine as oo, RiArrowRightLine as to, RiArrowLeftRightLine as ro, RiArrowUpDownLine as no, RiMoreLine as ao } from "@remixicon/react";
|
|
15
15
|
import ve from "rc-dialog";
|
|
16
16
|
import lo from "react-json-view";
|
|
17
|
-
import { MDXEditor as io, toolbarPlugin as so, DiffSourceToggleWrapper as co, UndoRedo as go, Separator as J, BoldItalicUnderlineToggles as uo, CodeToggle as mo, StrikeThroughSupSubToggles as po, ListsToggle as ho, CreateLink as fo, InsertImage as bo, InsertTable as ko, InsertThematicBreak as vo, InsertCodeBlock as xo, InsertFrontmatter as yo, diffSourcePlugin as wo, listsPlugin as Co, quotePlugin as Io, headingsPlugin as Mo, linkPlugin as So, linkDialogPlugin as To, imagePlugin as
|
|
17
|
+
import { MDXEditor as io, toolbarPlugin as so, DiffSourceToggleWrapper as co, UndoRedo as go, Separator as J, BoldItalicUnderlineToggles as uo, CodeToggle as mo, StrikeThroughSupSubToggles as po, ListsToggle as ho, CreateLink as fo, InsertImage as bo, InsertTable as ko, InsertThematicBreak as vo, InsertCodeBlock as xo, InsertFrontmatter as yo, diffSourcePlugin as wo, listsPlugin as Co, quotePlugin as Io, headingsPlugin as Mo, linkPlugin as So, linkDialogPlugin as To, imagePlugin as Bo, tablePlugin as No, thematicBreakPlugin as Do, frontmatterPlugin as Ro, codeBlockPlugin as Lo, codeMirrorPlugin as Po, markdownShortcutPlugin as $o, directivesPlugin as zo, AdmonitionDirectiveDescriptor as Ao } from "@mdxeditor/editor";
|
|
18
18
|
import Eo from "react-markdown";
|
|
19
19
|
import jo from "remark-gfm";
|
|
20
20
|
import Ho from "remark-emoji";
|
|
@@ -112,7 +112,7 @@ const Me = be({
|
|
|
112
112
|
onChange: t,
|
|
113
113
|
storageKey: i = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
114
114
|
enableCaching: n = !0
|
|
115
|
-
} = a, [c,
|
|
115
|
+
} = a, [c, g] = X(), [s, y] = X(), [x, B] = X(null), N = te(x), [A, $] = X(null), [u, d] = X([]), [w, h] = X(
|
|
116
116
|
null
|
|
117
117
|
), [L, m] = X(
|
|
118
118
|
null
|
|
@@ -122,16 +122,16 @@ const Me = be({
|
|
|
122
122
|
defaultValue: [],
|
|
123
123
|
listenStorageChange: !0
|
|
124
124
|
}), re = () => {
|
|
125
|
-
$(null), clearTimeout(c),
|
|
125
|
+
$(null), clearTimeout(c), g(void 0), N.current = null;
|
|
126
126
|
}, D = (k, F) => {
|
|
127
127
|
$({ ...k, pageX: k.pageX, pageY: k.pageY, data: F }), clearTimeout(c);
|
|
128
128
|
}, O = (k, F = !0) => {
|
|
129
129
|
const { config: H = {} } = k;
|
|
130
130
|
return H.allowContextMenu === !1 ? {} : {
|
|
131
131
|
onMouseDown: (M) => {
|
|
132
|
-
|
|
132
|
+
g(
|
|
133
133
|
setTimeout(() => {
|
|
134
|
-
F &&
|
|
134
|
+
F && N.current === null && D(M, k);
|
|
135
135
|
}, 800)
|
|
136
136
|
), C(!1), y(
|
|
137
137
|
setTimeout(() => {
|
|
@@ -140,7 +140,7 @@ const Me = be({
|
|
|
140
140
|
);
|
|
141
141
|
},
|
|
142
142
|
onMouseUp: () => {
|
|
143
|
-
clearTimeout(s), y(void 0), clearTimeout(c),
|
|
143
|
+
clearTimeout(s), y(void 0), clearTimeout(c), g(void 0);
|
|
144
144
|
},
|
|
145
145
|
onContextMenu: (M) => {
|
|
146
146
|
F && (M.preventDefault(), D(M, k));
|
|
@@ -214,7 +214,7 @@ const Me = be({
|
|
|
214
214
|
return M(H), t == null || t(H), H;
|
|
215
215
|
});
|
|
216
216
|
}, Ee = (k, F) => {
|
|
217
|
-
const H = [...
|
|
217
|
+
const H = [...u], M = (P, R) => {
|
|
218
218
|
const v = R.shift(), S = P.find((q) => q.id === v), z = P.findIndex((q) => q.id === v);
|
|
219
219
|
if (S) {
|
|
220
220
|
if (R.length)
|
|
@@ -237,16 +237,16 @@ const Me = be({
|
|
|
237
237
|
d(M(H, F));
|
|
238
238
|
};
|
|
239
239
|
return oe(() => {
|
|
240
|
-
(r == null ? void 0 : r.length) > 0 &&
|
|
240
|
+
(r == null ? void 0 : r.length) > 0 && u.length === 0 && W(r);
|
|
241
241
|
}, [r]), oe(() => {
|
|
242
|
-
|
|
242
|
+
N.current = x, x !== null && re();
|
|
243
243
|
}, [x]), oe(() => {
|
|
244
244
|
n && _ != null && _.length && !j && (W(_), le(!0));
|
|
245
245
|
}, [_, j, n]), qe(
|
|
246
246
|
() => {
|
|
247
|
-
n && Q(
|
|
247
|
+
n && Q(u);
|
|
248
248
|
},
|
|
249
|
-
[
|
|
249
|
+
[u, n],
|
|
250
250
|
{
|
|
251
251
|
wait: 1e3
|
|
252
252
|
}
|
|
@@ -254,12 +254,12 @@ const Me = be({
|
|
|
254
254
|
Me.Provider,
|
|
255
255
|
{
|
|
256
256
|
value: {
|
|
257
|
-
list:
|
|
257
|
+
list: u,
|
|
258
258
|
setList: W,
|
|
259
259
|
contextMenu: A,
|
|
260
260
|
setContextMenu: $,
|
|
261
261
|
listStatus: x,
|
|
262
|
-
setListStatus:
|
|
262
|
+
setListStatus: B,
|
|
263
263
|
contextMenuFuns: O,
|
|
264
264
|
hideContextMenu: re,
|
|
265
265
|
showInfoItemData: w,
|
|
@@ -308,8 +308,8 @@ const Me = be({
|
|
|
308
308
|
user-select: none;
|
|
309
309
|
border-radius: 0.5rem;
|
|
310
310
|
`,
|
|
311
|
-
onClick: (
|
|
312
|
-
|
|
311
|
+
onClick: (g) => {
|
|
312
|
+
g.stopPropagation(), t == null || t();
|
|
313
313
|
},
|
|
314
314
|
variants: _o,
|
|
315
315
|
children: /* @__PURE__ */ G(
|
|
@@ -354,15 +354,15 @@ const Me = be({
|
|
|
354
354
|
showSizeButton: i = !0,
|
|
355
355
|
onInfoClick: n,
|
|
356
356
|
onShareClick: c,
|
|
357
|
-
onRemoveClick:
|
|
357
|
+
onRemoveClick: g
|
|
358
358
|
} = a, {
|
|
359
359
|
contextMenu: s,
|
|
360
360
|
setContextMenu: y,
|
|
361
361
|
hideContextMenu: x,
|
|
362
|
-
setShowInfoItemData:
|
|
363
|
-
removeItem:
|
|
362
|
+
setShowInfoItemData: B,
|
|
363
|
+
removeItem: N,
|
|
364
364
|
updateItemConfig: A
|
|
365
|
-
} = Z(), { theme: $ } = K(), { light:
|
|
365
|
+
} = Z(), { theme: $ } = K(), { light: u, dark: d } = Y.getTheme($), { data: w } = s ?? {}, { config: h = {} } = w ?? {}, L = () => {
|
|
366
366
|
var C;
|
|
367
367
|
const m = Ie[(C = s == null ? void 0 : s.data) == null ? void 0 : C.type], I = [];
|
|
368
368
|
for (let p = 1; p <= ((m == null ? void 0 : m.maxRow) ?? 2); p++)
|
|
@@ -387,8 +387,8 @@ const Me = be({
|
|
|
387
387
|
l`
|
|
388
388
|
border-radius: 0.5rem;
|
|
389
389
|
overflow: hidden;
|
|
390
|
-
background-color: ${
|
|
391
|
-
box-shadow: 0 0 0.5rem ${
|
|
390
|
+
background-color: ${u.contextMenuBackgroundColor};
|
|
391
|
+
box-shadow: 0 0 0.5rem ${u.contextMenuShadowColor};
|
|
392
392
|
@media (prefers-color-scheme: dark) {
|
|
393
393
|
background-color: ${d.contextMenuBackgroundColor};
|
|
394
394
|
box-shadow: 0 0 0.5rem ${d.contextMenuShadowColor};
|
|
@@ -473,19 +473,19 @@ const Me = be({
|
|
|
473
473
|
line-height: 1.25rem;
|
|
474
474
|
cursor: pointer;
|
|
475
475
|
text-align: center;
|
|
476
|
-
color: ${
|
|
476
|
+
color: ${u.contextMenuTextColor};
|
|
477
477
|
@media (prefers-color-scheme: dark) {
|
|
478
478
|
color: ${d.contextMenuTextColor};
|
|
479
479
|
}
|
|
480
480
|
&:hover {
|
|
481
|
-
background-color: ${
|
|
481
|
+
background-color: ${u.contextMenuActiveColor};
|
|
482
482
|
@media (prefers-color-scheme: dark) {
|
|
483
483
|
background-color: ${d.contextMenuActiveColor};
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
`,
|
|
487
487
|
`${h.row}x${h.col}` === I.key && l`
|
|
488
|
-
background-color: ${
|
|
488
|
+
background-color: ${u.contextMenuActiveColor};
|
|
489
489
|
@media (prefers-color-scheme: dark) {
|
|
490
490
|
background-color: ${d.contextMenuActiveColor};
|
|
491
491
|
}
|
|
@@ -511,8 +511,8 @@ const Me = be({
|
|
|
511
511
|
{
|
|
512
512
|
className: T(
|
|
513
513
|
l`
|
|
514
|
-
background-color: ${
|
|
515
|
-
box-shadow: 0 0 0.5rem ${
|
|
514
|
+
background-color: ${u.contextMenuBackgroundColor};
|
|
515
|
+
box-shadow: 0 0 0.5rem ${u.contextMenuShadowColor};
|
|
516
516
|
@media (prefers-color-scheme: dark) {
|
|
517
517
|
background-color: ${d.contextMenuBackgroundColor};
|
|
518
518
|
box-shadow: 0 0 0.5rem ${d.contextMenuShadowColor};
|
|
@@ -550,7 +550,7 @@ const Me = be({
|
|
|
550
550
|
n(s.data);
|
|
551
551
|
return;
|
|
552
552
|
}
|
|
553
|
-
|
|
553
|
+
B({
|
|
554
554
|
...s.data,
|
|
555
555
|
pageX: s.pageX,
|
|
556
556
|
pageY: s.pageY
|
|
@@ -564,11 +564,11 @@ const Me = be({
|
|
|
564
564
|
icon: /* @__PURE__ */ o(We, { size: 20 }),
|
|
565
565
|
title: "移除",
|
|
566
566
|
onClick: () => {
|
|
567
|
-
if (
|
|
568
|
-
|
|
567
|
+
if (g) {
|
|
568
|
+
g(s.data, N);
|
|
569
569
|
return;
|
|
570
570
|
}
|
|
571
|
-
y(null),
|
|
571
|
+
y(null), N(s.data.id);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
)
|
|
@@ -579,7 +579,7 @@ const Me = be({
|
|
|
579
579
|
}
|
|
580
580
|
) });
|
|
581
581
|
}, Jo = (a) => {
|
|
582
|
-
const { data: e, noLetters: r = !1 } = a, { contextMenuFuns: t } = Z(), { itemIconBuilder: i, theme: n, contextMenu: c } = K(), { light:
|
|
582
|
+
const { data: e, noLetters: r = !1 } = a, { contextMenuFuns: t } = Z(), { itemIconBuilder: i, theme: n, contextMenu: c } = K(), { light: g, dark: s } = Y.getTheme(n), { data: y = {} } = e, { name: x } = y;
|
|
583
583
|
return /* @__PURE__ */ G(de, { children: [
|
|
584
584
|
/* @__PURE__ */ o(
|
|
585
585
|
b.div,
|
|
@@ -587,9 +587,9 @@ const Me = be({
|
|
|
587
587
|
className: l`
|
|
588
588
|
width: 4rem;
|
|
589
589
|
height: 4rem;
|
|
590
|
-
background-color: ${
|
|
590
|
+
background-color: ${g.itemIconBackgroundColor};
|
|
591
591
|
border-radius: 0.75rem;
|
|
592
|
-
box-shadow: 0 0 0.5rem ${
|
|
592
|
+
box-shadow: 0 0 0.5rem ${g.itemIconShadowColor};
|
|
593
593
|
cursor: pointer;
|
|
594
594
|
position: relative;
|
|
595
595
|
overflow: hidden;
|
|
@@ -608,7 +608,7 @@ const Me = be({
|
|
|
608
608
|
top: 0;
|
|
609
609
|
width: 100%;
|
|
610
610
|
height: 100%;
|
|
611
|
-
color: ${
|
|
611
|
+
color: ${g.itemNameColor};
|
|
612
612
|
@media (prefers-color-scheme: dark) {
|
|
613
613
|
color: ${s.itemNameColor};
|
|
614
614
|
}
|
|
@@ -627,7 +627,7 @@ const Me = be({
|
|
|
627
627
|
text-align: center;
|
|
628
628
|
margin-top: 0.25rem;
|
|
629
629
|
margin-bottom: 0;
|
|
630
|
-
color: ${
|
|
630
|
+
color: ${g.itemNameColor};
|
|
631
631
|
@media (prefers-color-scheme: dark) {
|
|
632
632
|
color: ${s.itemNameColor};
|
|
633
633
|
}
|
|
@@ -648,9 +648,9 @@ const Me = be({
|
|
|
648
648
|
onClick: i,
|
|
649
649
|
disabledDrag: n = !1,
|
|
650
650
|
children: c,
|
|
651
|
-
parentIds:
|
|
651
|
+
parentIds: g,
|
|
652
652
|
childrenLength: s
|
|
653
|
-
} = a, { contextMenu: y, setContextMenu: x } = Z(), { contextMenu:
|
|
653
|
+
} = a, { contextMenu: y, setContextMenu: x } = Z(), { contextMenu: B } = K();
|
|
654
654
|
return /* @__PURE__ */ o(
|
|
655
655
|
Oe,
|
|
656
656
|
{
|
|
@@ -663,10 +663,10 @@ const Me = be({
|
|
|
663
663
|
border: none;
|
|
664
664
|
}
|
|
665
665
|
`,
|
|
666
|
-
overlay: /* @__PURE__ */ o(Wo, { ...
|
|
666
|
+
overlay: /* @__PURE__ */ o(Wo, { ...B }),
|
|
667
667
|
visible: (y == null ? void 0 : y.data.id) === e.id,
|
|
668
|
-
onVisibleChange: (
|
|
669
|
-
|
|
668
|
+
onVisibleChange: (N) => {
|
|
669
|
+
N || x(null);
|
|
670
670
|
},
|
|
671
671
|
destroyTooltipOnHide: !0,
|
|
672
672
|
children: /* @__PURE__ */ o(
|
|
@@ -674,7 +674,7 @@ const Me = be({
|
|
|
674
674
|
{
|
|
675
675
|
"data-id": e.id,
|
|
676
676
|
"data-index": t,
|
|
677
|
-
"data-parent-ids":
|
|
677
|
+
"data-parent-ids": g == null ? void 0 : g.join(","),
|
|
678
678
|
"data-children-length": s,
|
|
679
679
|
onClick: () => i == null ? void 0 : i(e),
|
|
680
680
|
className: T(n && "drag-disabled", r),
|
|
@@ -692,18 +692,18 @@ const Me = be({
|
|
|
692
692
|
onClick: n,
|
|
693
693
|
noLetters: c = !1
|
|
694
694
|
} = a, {
|
|
695
|
-
contextMenuFuns:
|
|
695
|
+
contextMenuFuns: g,
|
|
696
696
|
setList: s,
|
|
697
697
|
setOpenGroupItemData: y,
|
|
698
698
|
longPressTriggered: x,
|
|
699
|
-
moveItemId:
|
|
700
|
-
moveTargetId:
|
|
699
|
+
moveItemId: B,
|
|
700
|
+
moveTargetId: N,
|
|
701
701
|
setMoveTargetId: A,
|
|
702
702
|
listStatus: $
|
|
703
|
-
} = Z(), { itemIconBuilder:
|
|
703
|
+
} = Z(), { itemIconBuilder: u, theme: d, contextMenu: w } = K(), { light: h, dark: L } = Y.getTheme(d), { children: m, data: I, config: C } = e, { row: p = 1, col: f = 1 } = C ?? {}, E = {
|
|
704
704
|
visible: { opacity: 1, scale: 1 },
|
|
705
705
|
hidden: { opacity: 0, scale: 0.95 }
|
|
706
|
-
}, V = ((m == null ? void 0 : m.length) ?? 0) === 0, j = V ? [e] : [...m ?? []].slice(0, 9), le = ae(() =>
|
|
706
|
+
}, V = ((m == null ? void 0 : m.length) ?? 0) === 0, j = V ? [e] : [...m ?? []].slice(0, 9), le = ae(() => B === e.id.toString(), [e.id, B]), _ = ae(() => N === e.id, [e.id, N]), Q = l`
|
|
707
707
|
overflow: hidden;
|
|
708
708
|
cursor: pointer;
|
|
709
709
|
background-color: ${h.itemIconBackgroundColor};
|
|
@@ -737,7 +737,7 @@ const Me = be({
|
|
|
737
737
|
onClick: (D) => {
|
|
738
738
|
D.stopPropagation(), n == null || n(e);
|
|
739
739
|
},
|
|
740
|
-
children:
|
|
740
|
+
children: u == null ? void 0 : u(e)
|
|
741
741
|
}
|
|
742
742
|
);
|
|
743
743
|
if (p === 1 && f === 1 || p === 2 && f === 2)
|
|
@@ -768,7 +768,7 @@ const Me = be({
|
|
|
768
768
|
onClick: (O) => {
|
|
769
769
|
O.stopPropagation(), n == null || n(D);
|
|
770
770
|
},
|
|
771
|
-
children:
|
|
771
|
+
children: u == null ? void 0 : u(D)
|
|
772
772
|
},
|
|
773
773
|
D.id
|
|
774
774
|
))
|
|
@@ -810,7 +810,7 @@ const Me = be({
|
|
|
810
810
|
onClick: (W) => {
|
|
811
811
|
O > 2 || (W.stopPropagation(), n == null || n(D));
|
|
812
812
|
},
|
|
813
|
-
children:
|
|
813
|
+
children: u == null ? void 0 : u(D)
|
|
814
814
|
},
|
|
815
815
|
D.id
|
|
816
816
|
))
|
|
@@ -851,7 +851,7 @@ const Me = be({
|
|
|
851
851
|
onClick: (W) => {
|
|
852
852
|
O > 2 || (W.stopPropagation(), n == null || n(D));
|
|
853
853
|
},
|
|
854
|
-
children:
|
|
854
|
+
children: u == null ? void 0 : u(D)
|
|
855
855
|
},
|
|
856
856
|
D.id
|
|
857
857
|
))
|
|
@@ -899,7 +899,7 @@ const Me = be({
|
|
|
899
899
|
onClick: (D) => {
|
|
900
900
|
!V && !x && (e.parentIds = t, e.pageX = D.pageX, e.pageY = D.pageY, y(e));
|
|
901
901
|
},
|
|
902
|
-
...
|
|
902
|
+
...g(e, w !== !1),
|
|
903
903
|
children: /* @__PURE__ */ G(
|
|
904
904
|
b.div,
|
|
905
905
|
{
|
|
@@ -991,10 +991,10 @@ const Me = be({
|
|
|
991
991
|
list: i,
|
|
992
992
|
setList: n,
|
|
993
993
|
setListStatus: c,
|
|
994
|
-
setMoveItemId:
|
|
994
|
+
setMoveItemId: g,
|
|
995
995
|
setMoveTargetId: s,
|
|
996
996
|
updateItem: y
|
|
997
|
-
} = Z(), { theme: x } = K(), { light:
|
|
997
|
+
} = Z(), { theme: x } = K(), { light: B, dark: N } = Y.getTheme(x), [A, $] = X("文件夹"), u = [...(e == null ? void 0 : e.children) ?? []];
|
|
998
998
|
return oe(() => {
|
|
999
999
|
var d;
|
|
1000
1000
|
e && $((d = e.data) == null ? void 0 : d.name);
|
|
@@ -1059,9 +1059,9 @@ const Me = be({
|
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
1061
|
.rc-dialog-body {
|
|
1062
|
-
background-color: ${
|
|
1062
|
+
background-color: ${B.groupItemModalBackgroundColor};
|
|
1063
1063
|
@media (prefers-color-scheme: dark) {
|
|
1064
|
-
background-color: ${
|
|
1064
|
+
background-color: ${N.groupItemModalBackgroundColor};
|
|
1065
1065
|
}
|
|
1066
1066
|
border-radius: 0.5rem;
|
|
1067
1067
|
overflow: hidden;
|
|
@@ -1108,13 +1108,13 @@ const Me = be({
|
|
|
1108
1108
|
onMove: () => (s(null), c("onMove"), !0),
|
|
1109
1109
|
onStart: (d) => {
|
|
1110
1110
|
const w = d.item.dataset;
|
|
1111
|
-
w != null && w.id &&
|
|
1111
|
+
w != null && w.id && g(w.id), c("onMove");
|
|
1112
1112
|
},
|
|
1113
1113
|
onEnd: () => {
|
|
1114
|
-
|
|
1114
|
+
g(null), s(null), c(null);
|
|
1115
1115
|
},
|
|
1116
1116
|
ghostClass: Se,
|
|
1117
|
-
children:
|
|
1117
|
+
children: u.map((d, w) => /* @__PURE__ */ o(
|
|
1118
1118
|
me,
|
|
1119
1119
|
{
|
|
1120
1120
|
data: d,
|
|
@@ -1160,15 +1160,15 @@ const Me = be({
|
|
|
1160
1160
|
sliderProps: t,
|
|
1161
1161
|
sliderRef: i,
|
|
1162
1162
|
onItemClick: n
|
|
1163
|
-
} = a, c = te(null),
|
|
1163
|
+
} = a, c = te(null), g = te(null), {
|
|
1164
1164
|
list: s,
|
|
1165
1165
|
setList: y,
|
|
1166
1166
|
setListStatus: x,
|
|
1167
|
-
showInfoItemData:
|
|
1168
|
-
setShowInfoItemData:
|
|
1167
|
+
showInfoItemData: B,
|
|
1168
|
+
setShowInfoItemData: N,
|
|
1169
1169
|
openGroupItemData: A,
|
|
1170
1170
|
setOpenGroupItemData: $,
|
|
1171
|
-
setMoveItemId:
|
|
1171
|
+
setMoveItemId: u,
|
|
1172
1172
|
setMoveTargetId: d,
|
|
1173
1173
|
addItem: w
|
|
1174
1174
|
} = Z(), { pagingDotBuilder: h, pagingDotsBuilder: L, itemBuilder: m } = K(), I = ae(() => e === !1 ? {} : {
|
|
@@ -1268,7 +1268,7 @@ const Me = be({
|
|
|
1268
1268
|
appendDots: (C) => L ? L(C) : e === !1 ? /* @__PURE__ */ o("div", {}) : /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
1269
1269
|
"ul",
|
|
1270
1270
|
{
|
|
1271
|
-
ref:
|
|
1271
|
+
ref: g,
|
|
1272
1272
|
className: T(
|
|
1273
1273
|
"slick-dots-default",
|
|
1274
1274
|
l`
|
|
@@ -1341,10 +1341,10 @@ const Me = be({
|
|
|
1341
1341
|
},
|
|
1342
1342
|
onStart: (p) => {
|
|
1343
1343
|
const f = p.item.dataset;
|
|
1344
|
-
f != null && f.id &&
|
|
1344
|
+
f != null && f.id && u(f.id), x("onMove");
|
|
1345
1345
|
},
|
|
1346
1346
|
onEnd: () => {
|
|
1347
|
-
|
|
1347
|
+
u(null), d(null), x(null);
|
|
1348
1348
|
},
|
|
1349
1349
|
ghostClass: Se,
|
|
1350
1350
|
children: (C.children ?? []).map((p, f) => {
|
|
@@ -1389,9 +1389,9 @@ const Me = be({
|
|
|
1389
1389
|
/* @__PURE__ */ o(
|
|
1390
1390
|
Qo,
|
|
1391
1391
|
{
|
|
1392
|
-
data:
|
|
1392
|
+
data: B,
|
|
1393
1393
|
onClose: () => {
|
|
1394
|
-
|
|
1394
|
+
N(null);
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
1397
|
),
|
|
@@ -1414,12 +1414,12 @@ const Me = be({
|
|
|
1414
1414
|
enableCaching: i,
|
|
1415
1415
|
theme: n,
|
|
1416
1416
|
noLetters: c,
|
|
1417
|
-
contextMenu:
|
|
1417
|
+
contextMenu: g,
|
|
1418
1418
|
contextMenuBuilder: s,
|
|
1419
1419
|
itemBuilder: y,
|
|
1420
1420
|
itemIconBuilder: x,
|
|
1421
|
-
pagingDotBuilder:
|
|
1422
|
-
pagingDotsBuilder:
|
|
1421
|
+
pagingDotBuilder: B,
|
|
1422
|
+
pagingDotsBuilder: N,
|
|
1423
1423
|
...A
|
|
1424
1424
|
} = a;
|
|
1425
1425
|
return /* @__PURE__ */ o(Vo, { ...{
|
|
@@ -1430,9 +1430,9 @@ const Me = be({
|
|
|
1430
1430
|
}, children: /* @__PURE__ */ o(Oo, { ...{
|
|
1431
1431
|
theme: n,
|
|
1432
1432
|
noLetters: c,
|
|
1433
|
-
contextMenu:
|
|
1434
|
-
pagingDotsBuilder:
|
|
1435
|
-
pagingDotBuilder:
|
|
1433
|
+
contextMenu: g,
|
|
1434
|
+
pagingDotsBuilder: N,
|
|
1435
|
+
pagingDotBuilder: B,
|
|
1436
1436
|
itemBuilder: y,
|
|
1437
1437
|
itemIconBuilder: x,
|
|
1438
1438
|
contextMenuBuilder: s
|
|
@@ -1707,7 +1707,7 @@ const Me = be({
|
|
|
1707
1707
|
}
|
|
1708
1708
|
}
|
|
1709
1709
|
`
|
|
1710
|
-
),
|
|
1710
|
+
), Be = l`
|
|
1711
1711
|
.markdown-body {
|
|
1712
1712
|
/* light */
|
|
1713
1713
|
color-scheme: light;
|
|
@@ -1762,7 +1762,7 @@ const Me = be({
|
|
|
1762
1762
|
--color-prettylights-syntax-meta-diff-range: #8250df;
|
|
1763
1763
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
|
|
1764
1764
|
}
|
|
1765
|
-
`,
|
|
1765
|
+
`, Ne = l`
|
|
1766
1766
|
.markdown-body {
|
|
1767
1767
|
/* dark */
|
|
1768
1768
|
color-scheme: dark;
|
|
@@ -1828,14 +1828,14 @@ const Me = be({
|
|
|
1828
1828
|
pluginConfig: i,
|
|
1829
1829
|
className: n,
|
|
1830
1830
|
theme: c = "auto",
|
|
1831
|
-
...
|
|
1831
|
+
...g
|
|
1832
1832
|
} = a, s = te(null), {
|
|
1833
1833
|
image: y,
|
|
1834
1834
|
diffSource: x = {
|
|
1835
1835
|
viewMode: "rich-text"
|
|
1836
1836
|
},
|
|
1837
|
-
headings:
|
|
1838
|
-
link:
|
|
1837
|
+
headings: B,
|
|
1838
|
+
link: N,
|
|
1839
1839
|
codeBlock: A,
|
|
1840
1840
|
codeMirror: $ = {
|
|
1841
1841
|
codeBlockLanguages: {
|
|
@@ -1846,7 +1846,7 @@ const Me = be({
|
|
|
1846
1846
|
"": "Unspecified"
|
|
1847
1847
|
}
|
|
1848
1848
|
},
|
|
1849
|
-
directives:
|
|
1849
|
+
directives: u = {
|
|
1850
1850
|
directiveDescriptors: [Ao]
|
|
1851
1851
|
}
|
|
1852
1852
|
} = i ?? {}, [d, w] = X("");
|
|
@@ -1860,7 +1860,7 @@ const Me = be({
|
|
|
1860
1860
|
className: T(
|
|
1861
1861
|
nt,
|
|
1862
1862
|
ce(c) ? rt : "",
|
|
1863
|
-
ce(c) ?
|
|
1863
|
+
ce(c) ? Ne : Be,
|
|
1864
1864
|
n
|
|
1865
1865
|
),
|
|
1866
1866
|
contentEditableClassName: Te,
|
|
@@ -1895,19 +1895,19 @@ const Me = be({
|
|
|
1895
1895
|
wo(x),
|
|
1896
1896
|
Co(),
|
|
1897
1897
|
Io(),
|
|
1898
|
-
Mo(
|
|
1899
|
-
So(
|
|
1898
|
+
Mo(B),
|
|
1899
|
+
So(N),
|
|
1900
1900
|
To(),
|
|
1901
|
-
|
|
1902
|
-
|
|
1901
|
+
Bo(y),
|
|
1902
|
+
No(),
|
|
1903
1903
|
Do(),
|
|
1904
1904
|
Ro(),
|
|
1905
1905
|
Lo(A),
|
|
1906
1906
|
Po($),
|
|
1907
1907
|
$o(),
|
|
1908
|
-
zo(
|
|
1908
|
+
zo(u)
|
|
1909
1909
|
],
|
|
1910
|
-
...
|
|
1910
|
+
...g
|
|
1911
1911
|
}
|
|
1912
1912
|
);
|
|
1913
1913
|
}, lt = {
|
|
@@ -2403,7 +2403,7 @@ const Me = be({
|
|
|
2403
2403
|
return /* @__PURE__ */ o(
|
|
2404
2404
|
"div",
|
|
2405
2405
|
{
|
|
2406
|
-
className: ce(t) ?
|
|
2406
|
+
className: ce(t) ? Ne : Be,
|
|
2407
2407
|
children: /* @__PURE__ */ o(
|
|
2408
2408
|
Eo,
|
|
2409
2409
|
{
|
|
@@ -2412,24 +2412,25 @@ const Me = be({
|
|
|
2412
2412
|
rehypePlugins: [Xo],
|
|
2413
2413
|
components: {
|
|
2414
2414
|
code(n) {
|
|
2415
|
-
const { children: c, className:
|
|
2416
|
-
return
|
|
2415
|
+
const { children: c, className: g, node: s, ref: y, ...x } = n, B = /language-(\w+)/.exec(g || "");
|
|
2416
|
+
return B ? /* @__PURE__ */ o(
|
|
2417
2417
|
Fo,
|
|
2418
2418
|
{
|
|
2419
2419
|
...x,
|
|
2420
2420
|
PreTag: "div",
|
|
2421
2421
|
children: String(c).replace(/\n$/, ""),
|
|
2422
|
-
language:
|
|
2422
|
+
language: B[1],
|
|
2423
2423
|
style: lt
|
|
2424
2424
|
}
|
|
2425
|
-
) : /* @__PURE__ */ o("code", { ...x, className:
|
|
2425
|
+
) : /* @__PURE__ */ o("code", { ...x, className: g, children: c });
|
|
2426
2426
|
},
|
|
2427
2427
|
img(n) {
|
|
2428
|
+
const { preview: c, ...g } = i ?? {};
|
|
2428
2429
|
return /* @__PURE__ */ o(
|
|
2429
2430
|
Go,
|
|
2430
2431
|
{
|
|
2431
2432
|
...n,
|
|
2432
|
-
preview: {
|
|
2433
|
+
preview: c instanceof Boolean ? c : {
|
|
2433
2434
|
icons: {
|
|
2434
2435
|
rotateLeft: /* @__PURE__ */ o(Je, {}),
|
|
2435
2436
|
rotateRight: /* @__PURE__ */ o(Ke, {}),
|
|
@@ -2441,16 +2442,14 @@ const Me = be({
|
|
|
2441
2442
|
flipX: /* @__PURE__ */ o(ro, {}),
|
|
2442
2443
|
flipY: /* @__PURE__ */ o(no, {})
|
|
2443
2444
|
},
|
|
2444
|
-
onVisibleChange: (c) => {
|
|
2445
|
-
console.log("visible", c);
|
|
2446
|
-
},
|
|
2447
2445
|
zIndex: 9999,
|
|
2448
|
-
mask: ""
|
|
2446
|
+
mask: " ",
|
|
2447
|
+
...c
|
|
2449
2448
|
},
|
|
2450
2449
|
className: l`
|
|
2451
2450
|
cursor: zoom-in;
|
|
2452
2451
|
`,
|
|
2453
|
-
...
|
|
2452
|
+
...g
|
|
2454
2453
|
}
|
|
2455
2454
|
);
|
|
2456
2455
|
}
|
|
@@ -2470,7 +2469,7 @@ const ct = (a) => {
|
|
|
2470
2469
|
var L;
|
|
2471
2470
|
const h = ((L = n.current) == null ? void 0 : L.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
2472
2471
|
return w - h.x - h.width / 2;
|
|
2473
|
-
}),
|
|
2472
|
+
}), g = ee(c, [-150, 0, 150], [40, 80, 40]), s = ee(c, [-150, 0, 150], [40, 80, 40]), y = ee(
|
|
2474
2473
|
c,
|
|
2475
2474
|
[-150, 0, 150],
|
|
2476
2475
|
[20, 40, 20]
|
|
@@ -2478,11 +2477,11 @@ const ct = (a) => {
|
|
|
2478
2477
|
c,
|
|
2479
2478
|
[-150, 0, 150],
|
|
2480
2479
|
[20, 40, 20]
|
|
2481
|
-
),
|
|
2480
|
+
), B = ne(g, {
|
|
2482
2481
|
mass: 0.1,
|
|
2483
2482
|
stiffness: 150,
|
|
2484
2483
|
damping: 12
|
|
2485
|
-
}),
|
|
2484
|
+
}), N = ne(s, {
|
|
2486
2485
|
mass: 0.1,
|
|
2487
2486
|
stiffness: 150,
|
|
2488
2487
|
damping: 12
|
|
@@ -2494,17 +2493,17 @@ const ct = (a) => {
|
|
|
2494
2493
|
mass: 0.1,
|
|
2495
2494
|
stiffness: 150,
|
|
2496
2495
|
damping: 12
|
|
2497
|
-
}), [
|
|
2496
|
+
}), [u, d] = X(!1);
|
|
2498
2497
|
return /* @__PURE__ */ o("a", { href: i, children: /* @__PURE__ */ G(
|
|
2499
2498
|
b.div,
|
|
2500
2499
|
{
|
|
2501
2500
|
ref: n,
|
|
2502
|
-
style: { width:
|
|
2501
|
+
style: { width: B, height: N },
|
|
2503
2502
|
onMouseEnter: () => d(!0),
|
|
2504
2503
|
onMouseLeave: () => d(!1),
|
|
2505
2504
|
className: "aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",
|
|
2506
2505
|
children: [
|
|
2507
|
-
/* @__PURE__ */ o(ue, { children:
|
|
2506
|
+
/* @__PURE__ */ o(ue, { children: u && /* @__PURE__ */ o(
|
|
2508
2507
|
b.div,
|
|
2509
2508
|
{
|
|
2510
2509
|
initial: { opacity: 0, y: 10, x: "-50%" },
|
|
@@ -2540,7 +2539,7 @@ const ct = (a) => {
|
|
|
2540
2539
|
}
|
|
2541
2540
|
);
|
|
2542
2541
|
}, Le = (a) => {
|
|
2543
|
-
const { items: e, className: r, collapseIcon: t, autoHidden: i = !1 } = a, [n, c] = X(!1),
|
|
2542
|
+
const { items: e, className: r, collapseIcon: t, autoHidden: i = !1 } = a, [n, c] = X(!1), g = () => {
|
|
2544
2543
|
c(!n);
|
|
2545
2544
|
};
|
|
2546
2545
|
return /* @__PURE__ */ G(
|
|
@@ -2590,7 +2589,7 @@ const ct = (a) => {
|
|
|
2590
2589
|
/* @__PURE__ */ o(
|
|
2591
2590
|
"button",
|
|
2592
2591
|
{
|
|
2593
|
-
onClick:
|
|
2592
|
+
onClick: g,
|
|
2594
2593
|
className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",
|
|
2595
2594
|
children: t || /* @__PURE__ */ o(ao, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
|
|
2596
2595
|
}
|
|
@@ -2618,5 +2617,6 @@ Pe.Mobile = Le;
|
|
|
2618
2617
|
export {
|
|
2619
2618
|
$t as Desktop,
|
|
2620
2619
|
Pe as Dock,
|
|
2620
|
+
it as Markdown,
|
|
2621
2621
|
st as MdEditor
|
|
2622
2622
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("@emotion/css"),require("react"),require("react-slick"),require("react-sortablejs"),require("framer-motion"),require("ahooks"),require("uuid"),require("rc-tooltip"),require("@remixicon/react"),require("rc-dialog"),require("react-json-view"),require("@mdxeditor/editor"),require("react-markdown"),require("remark-gfm"),require("remark-emoji"),require("rehype-raw"),require("react-syntax-highlighter"),require("rc-image"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@emotion/css","react","react-slick","react-sortablejs","framer-motion","ahooks","uuid","rc-tooltip","@remixicon/react","rc-dialog","react-json-view","@mdxeditor/editor","react-markdown","remark-gfm","remark-emoji","rehype-raw","react-syntax-highlighter","rc-image","clsx","tailwind-merge"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.zs_library={},p.jsxRuntime,p.css,p.React,p.Slider,p.reactSortablejs,p.framerMotion,p.ahooks,p.uuid,p.RcTooltip,p.react$1,p.Dialog,p.ReactJson,p.MDXEditor,p.Markdown,p.remarkGfm,p.emoji,p.rehypeRaw,p.reactSyntaxHighlighter,p.Image,p.clsx,p.tailwindMerge))})(this,function(p,e,t,k,
|
|
1
|
+
(function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("@emotion/css"),require("react"),require("react-slick"),require("react-sortablejs"),require("framer-motion"),require("ahooks"),require("uuid"),require("rc-tooltip"),require("@remixicon/react"),require("rc-dialog"),require("react-json-view"),require("@mdxeditor/editor"),require("react-markdown"),require("remark-gfm"),require("remark-emoji"),require("rehype-raw"),require("react-syntax-highlighter"),require("rc-image"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@emotion/css","react","react-slick","react-sortablejs","framer-motion","ahooks","uuid","rc-tooltip","@remixicon/react","rc-dialog","react-json-view","@mdxeditor/editor","react-markdown","remark-gfm","remark-emoji","rehype-raw","react-syntax-highlighter","rc-image","clsx","tailwind-merge"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.zs_library={},p.jsxRuntime,p.css,p.React,p.Slider,p.reactSortablejs,p.framerMotion,p.ahooks,p.uuid,p.RcTooltip,p.react$1,p.Dialog,p.ReactJson,p.MDXEditor,p.Markdown,p.remarkGfm,p.emoji,p.rehypeRaw,p.reactSyntaxHighlighter,p.Image,p.clsx,p.tailwindMerge))})(this,function(p,e,t,k,Be,oe,s,se,ce,Ne,G,de,De,m,Le,Pe,ze,$e,Ae,qe,Ee,je){"use strict";var so=Object.defineProperty;var co=(p,e,t)=>e in p?so(p,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[e]=t;var ie=(p,e,t)=>co(p,typeof e!="symbol"?e+"":e,t);require("./zs_library.css");const ge={token:{itemNameColor:"#1a1a1a",itemIconBackgroundColor:"white",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(255, 255, 255, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(255, 255, 255, 0.8)",contextMenuTextColor:"black",contextMenuActiveColor:"#f3f4f6",contextMenuBackgroundColor:"white",contextMenuShadowColor:"rgba(0, 0, 0, 0.1)"}},ue={token:{itemNameColor:"white",itemIconBackgroundColor:"#1f2937",itemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemIconBackgroundColor:"rgba(0, 0, 0, 0.1)",groupItemIconShadowColor:"rgba(0, 0, 0, 0.1)",groupItemModalBackgroundColor:"rgba(0, 0, 0, 0.1)",contextMenuTextColor:"white",contextMenuActiveColor:"#1a1a1a",contextMenuBackgroundColor:"#1a1a1a",contextMenuShadowColor:"rgba(255, 255, 255, 0.1)"}},he=k.createContext({}),He=c=>{const{children:o,theme:n,...r}=c,l=k.useMemo(()=>n==="light"?ge:n==="dark"?ue:n,[n]);return e.jsx(he.Provider,{value:{theme:l,...r},children:o})},W=()=>k.useContext(he),pe={maxRow:2,maxCol:2},Fe={...pe},me={app:pe,group:Fe};class O{}ie(O,"uniqueArray",o=>o.reduce((n,r)=>n.find(a=>a.id===r.id)?n:n.concat([r]),[])),ie(O,"getTheme",o=>{const n=ge.token,r=ue.token,l={...n,...o==null?void 0:o.token},a={...r,...o==null?void 0:o.token};return{light:l,dark:a}});const fe=k.createContext({list:[],setList:()=>{},contextMenu:null,setContextMenu:()=>{},listStatus:null,setListStatus:()=>{},contextMenuFuns:()=>{},hideContextMenu:()=>{},showInfoItemData:null,setShowInfoItemData:()=>{},openGroupItemData:null,setOpenGroupItemData:()=>{},longPressTriggered:!1,updateItem:()=>{},updateItemConfig:()=>{},removeItem:()=>{},addItem:()=>{},moveItemId:null,setMoveItemId:()=>{},moveTargetId:null,setMoveTargetId:()=>{}}),Xe=c=>{const{children:o,list:n=[],onChange:r,storageKey:l="ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",enableCaching:a=!0}=c,[d,u]=k.useState(),[i,S]=k.useState(),[C,D]=k.useState(null),L=k.useRef(C),[j,q]=k.useState(null),[h,g]=k.useState([]),[I,x]=k.useState(null),[$,f]=k.useState(null),[M,T]=k.useState(!1),[b,y]=k.useState(null),[H,J]=k.useState(null),[F,le]=k.useState(!1),[K,R]=se.useLocalStorageState(l,{defaultValue:[],listenStorageChange:!0}),ee=()=>{q(null),clearTimeout(d),u(void 0),L.current=null},P=(v,Y)=>{q({...v,pageX:v.pageX,pageY:v.pageY,data:Y}),clearTimeout(d)},U=(v,Y=!0)=>{const{config:X={}}=v;return X.allowContextMenu===!1?{}:{onMouseDown:B=>{u(setTimeout(()=>{Y&&L.current===null&&P(B,v)},800)),T(!1),S(setTimeout(()=>{T(!0)},800))},onMouseUp:()=>{clearTimeout(i),S(void 0),clearTimeout(d),u(void 0)},onContextMenu:B=>{Y&&(B.preventDefault(),P(B,v))}}},Z=(v,Y)=>{const X=[...Y||[]];if(X.length>0)g(B=>{const A=[...B],z=w=>{var Te,Me;const N=X.shift(),E=w.find(V=>V.id===N),_=w.findIndex(V=>V.id===N);if(X.length&&E){if(((Te=E.children)==null?void 0:Te.filter(V=>!v.some(io=>io.id===V.id)).length)===1&&v.length===1){const V={...v[0]};return w.splice(_,1,V),r==null||r(w),w}return E.children=z(E.children||[]),w.splice(_,1,E),r==null||r(w),w}if(E){if(!((Me=E.children)!=null&&Me.length)&&v.length){const V={...E};return E.data={name:"文件夹"},E.type="group",E.children=[V,...v],E.id=ce.v4(),w.splice(_,1,E),r==null||r(w),w}return E.children=O.uniqueArray(v),w.splice(_,1,E),r==null||r(w),w}return O.uniqueArray(v)};return O.uniqueArray(z(A))});else{const B=O.uniqueArray(v);r==null||r(B),g(B)}},ro=(v,Y)=>{g(X=>{const B=[...X],A=z=>{var w;for(let N=0;N<z.length;N++)if(z[N].id===v){z[N].config=Y;break}else((w=z[N].children)==null?void 0:w.length)!==void 0&&A(z[N].children)};return A(B),r==null||r(B),B})},no=(v,Y)=>{g(X=>{const B=[...X],A=z=>{var w;for(let N=0;N<z.length;N++)if(z[N].id===v){z[N].data=Y;break}else((w=z[N].children)==null?void 0:w.length)!==void 0&&A(z[N].children)};return A(B),r==null||r(B),B})},ao=v=>{g(Y=>{const X=[...Y],B=A=>{var z;for(let w=0;w<A.length;w++)if(A[w].id===v){A.splice(w,1);break}else((z=A[w].children)==null?void 0:z.length)!==void 0&&B(A[w].children)};return B(X),r==null||r(X),X})},lo=(v,Y)=>{const X=[...h],B=(A,z)=>{const w=z.shift(),N=A.find(_=>_.id===w),E=A.findIndex(_=>_.id===w);if(N){if(z.length)N.children=B(N.children||[],z);else{const _=(v==null?void 0:v.type)??"app";N.children=[...N.children??[],{...v,id:ce.v4(),config:(v==null?void 0:v.config)??me[_]}]}return A.splice(E,1,N),A}else return A};g(B(X,Y))};return k.useEffect(()=>{(n==null?void 0:n.length)>0&&h.length===0&&Z(n)},[n]),k.useEffect(()=>{L.current=C,C!==null&&ee()},[C]),k.useEffect(()=>{a&&K!=null&&K.length&&!F&&(Z(K),le(!0))},[K,F,a]),se.useDebounceEffect(()=>{a&&R(h)},[h,a],{wait:1e3}),e.jsx(fe.Provider,{value:{list:h,setList:Z,contextMenu:j,setContextMenu:q,listStatus:C,setListStatus:D,contextMenuFuns:U,hideContextMenu:ee,showInfoItemData:I,setShowInfoItemData:x,openGroupItemData:$,setOpenGroupItemData:f,longPressTriggered:M,updateItemConfig:ro,updateItem:no,removeItem:ao,addItem:lo,moveItemId:b,setMoveItemId:y,moveTargetId:H,setMoveTargetId:J},children:o})},Q=()=>k.useContext(fe),Ge={menuShow:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},menuHide:{opacity:0,y:20,transition:{duration:.2}}},te=c=>{const{icon:o,title:n,onClick:r}=c,{theme:l}=W(),{light:a,dark:d}=O.getTheme(l);return e.jsx(s.motion.div,{className:t.css`
|
|
2
2
|
&:hover {
|
|
3
3
|
background-color: ${a.contextMenuActiveColor};
|
|
4
4
|
@media (prefers-color-scheme: dark) {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
transition: all 0.3s;
|
|
15
15
|
user-select: none;
|
|
16
16
|
border-radius: 0.5rem;
|
|
17
|
-
`,onClick:
|
|
17
|
+
`,onClick:u=>{u.stopPropagation(),r==null||r()},variants:Ge,children:e.jsxs(s.motion.div,{className:t.cx("py-1.5 px-3 rounded-lg",t.css`
|
|
18
18
|
padding-top: 0.375rem;
|
|
19
19
|
padding-bottom: 0.375rem;
|
|
20
20
|
padding-left: 0.75rem;
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
margin-bottom: 0.375rem;
|
|
25
25
|
display: flex;
|
|
26
26
|
justify-content: center;
|
|
27
|
-
`),children:o}),e.jsx(s.motion.div,{children:n})]})})},
|
|
27
|
+
`),children:o}),e.jsx(s.motion.div,{children:n})]})})},Ye=c=>{const{showInfoButton:o=!0,showRemoveButton:n=!0,showShareButton:r=!0,showSizeButton:l=!0,onInfoClick:a,onShareClick:d,onRemoveClick:u}=c,{contextMenu:i,setContextMenu:S,hideContextMenu:C,setShowInfoItemData:D,removeItem:L,updateItemConfig:j}=Q(),{theme:q}=W(),{light:h,dark:g}=O.getTheme(q),{data:I}=i??{},{config:x={}}=I??{},$=()=>{var T;const f=me[(T=i==null?void 0:i.data)==null?void 0:T.type],M=[];for(let b=1;b<=((f==null?void 0:f.maxRow)??2);b++)for(let y=1;y<=((f==null?void 0:f.maxCol)??2);y++)M.push(`${b}x${y}`);return M};return e.jsx(s.AnimatePresence,{children:i&&e.jsxs(s.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.stopPropagation(),f.preventDefault()},children:[e.jsx(s.motion.div,{className:t.cx(t.css`
|
|
28
28
|
border-radius: 0.5rem;
|
|
29
29
|
overflow: hidden;
|
|
30
|
-
background-color: ${
|
|
31
|
-
box-shadow: 0 0 0.5rem ${
|
|
30
|
+
background-color: ${h.contextMenuBackgroundColor};
|
|
31
|
+
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
32
32
|
@media (prefers-color-scheme: dark) {
|
|
33
33
|
background-color: ${g.contextMenuBackgroundColor};
|
|
34
34
|
box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
|
|
@@ -65,24 +65,24 @@
|
|
|
65
65
|
line-height: 1.25rem;
|
|
66
66
|
cursor: pointer;
|
|
67
67
|
text-align: center;
|
|
68
|
-
color: ${
|
|
68
|
+
color: ${h.contextMenuTextColor};
|
|
69
69
|
@media (prefers-color-scheme: dark) {
|
|
70
70
|
color: ${g.contextMenuTextColor};
|
|
71
71
|
}
|
|
72
72
|
&:hover {
|
|
73
|
-
background-color: ${
|
|
73
|
+
background-color: ${h.contextMenuActiveColor};
|
|
74
74
|
@media (prefers-color-scheme: dark) {
|
|
75
75
|
background-color: ${g.contextMenuActiveColor};
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
`,`${x.row}x${x.col}`===M.key&&t.css`
|
|
79
|
-
background-color: ${
|
|
79
|
+
background-color: ${h.contextMenuActiveColor};
|
|
80
80
|
@media (prefers-color-scheme: dark) {
|
|
81
81
|
background-color: ${g.contextMenuActiveColor};
|
|
82
82
|
}
|
|
83
83
|
`),onClick:M.onClick,children:M.label},M.key))})]},f.key))})}),e.jsxs(s.motion.div,{className:t.cx(t.css`
|
|
84
|
-
background-color: ${
|
|
85
|
-
box-shadow: 0 0 0.5rem ${
|
|
84
|
+
background-color: ${h.contextMenuBackgroundColor};
|
|
85
|
+
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
86
86
|
@media (prefers-color-scheme: dark) {
|
|
87
87
|
background-color: ${g.contextMenuBackgroundColor};
|
|
88
88
|
box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
border-radius: 0.5rem;
|
|
95
95
|
overflow: hidden;
|
|
96
96
|
padding: 0.25rem;
|
|
97
|
-
`),children:[r&&e.jsx(te,{icon:e.jsx(G.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(d){d(i.data);return}}}),o&&e.jsx(te,{icon:e.jsx(G.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(a){a(i.data);return}D({...i.data,pageX:i.pageX,pageY:i.pageY}),C()}}),n&&e.jsx(te,{icon:e.jsx(G.RiCloseCircleLine,{size:20}),title:"移除",onClick:()=>{if(
|
|
97
|
+
`),children:[r&&e.jsx(te,{icon:e.jsx(G.RiShareLine,{size:20}),title:"分享",onClick:()=>{if(d){d(i.data);return}}}),o&&e.jsx(te,{icon:e.jsx(G.RiInformationLine,{size:20}),title:"信息",onClick:()=>{if(a){a(i.data);return}D({...i.data,pageX:i.pageX,pageY:i.pageY}),C()}}),n&&e.jsx(te,{icon:e.jsx(G.RiCloseCircleLine,{size:20}),title:"移除",onClick:()=>{if(u){u(i.data,L);return}S(null),L(i.data.id)}})]})]})})},Oe=c=>{const{data:o,noLetters:n=!1}=c,{contextMenuFuns:r}=Q(),{itemIconBuilder:l,theme:a,contextMenu:d}=W(),{light:u,dark:i}=O.getTheme(a),{data:S={}}=o,{name:C}=S;return e.jsxs(e.Fragment,{children:[e.jsx(s.motion.div,{className:t.css`
|
|
98
98
|
width: 4rem;
|
|
99
99
|
height: 4rem;
|
|
100
|
-
background-color: ${
|
|
100
|
+
background-color: ${u.itemIconBackgroundColor};
|
|
101
101
|
border-radius: 0.75rem;
|
|
102
|
-
box-shadow: 0 0 0.5rem ${
|
|
102
|
+
box-shadow: 0 0 0.5rem ${u.itemIconShadowColor};
|
|
103
103
|
cursor: pointer;
|
|
104
104
|
position: relative;
|
|
105
105
|
overflow: hidden;
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
top: 0;
|
|
114
114
|
width: 100%;
|
|
115
115
|
height: 100%;
|
|
116
|
-
color: ${
|
|
116
|
+
color: ${u.itemNameColor};
|
|
117
117
|
@media (prefers-color-scheme: dark) {
|
|
118
118
|
color: ${i.itemNameColor};
|
|
119
119
|
}
|
|
@@ -121,20 +121,20 @@
|
|
|
121
121
|
text-align: center;
|
|
122
122
|
margin-top: 0.25rem;
|
|
123
123
|
margin-bottom: 0;
|
|
124
|
-
color: ${
|
|
124
|
+
color: ${u.itemNameColor};
|
|
125
125
|
@media (prefers-color-scheme: dark) {
|
|
126
126
|
color: ${i.itemNameColor};
|
|
127
127
|
}
|
|
128
128
|
`,n&&t.css`
|
|
129
129
|
color: transparent;
|
|
130
|
-
`),children:C})]})},re=c=>{const{data:o,className:n,itemIndex:r,onClick:l,disabledDrag:a=!1,children:d,parentIds:
|
|
130
|
+
`),children:C})]})},re=c=>{const{data:o,className:n,itemIndex:r,onClick:l,disabledDrag:a=!1,children:d,parentIds:u,childrenLength:i}=c,{contextMenu:S,setContextMenu:C}=Q(),{contextMenu:D}=W();return e.jsx(Ne,{placement:"bottom",overlayClassName:t.css`
|
|
131
131
|
background-color: transparent;
|
|
132
132
|
.rc-tooltip-inner {
|
|
133
133
|
background-color: transparent;
|
|
134
134
|
padding: 0;
|
|
135
135
|
border: none;
|
|
136
136
|
}
|
|
137
|
-
`,overlay:e.jsx(
|
|
137
|
+
`,overlay:e.jsx(Ye,{...D}),visible:(S==null?void 0:S.data.id)===o.id,onVisibleChange:L=>{L||C(null)},destroyTooltipOnHide:!0,children:e.jsx(s.motion.div,{"data-id":o.id,"data-index":r,"data-parent-ids":u==null?void 0:u.join(","),"data-children-length":i,onClick:()=>l==null?void 0:l(o),className:t.cx(a&&"drag-disabled",n),children:d??e.jsx(Oe,{...c})})})},_e=c=>{const{data:o,className:n,parentIds:r,itemIndex:l,onClick:a,noLetters:d=!1}=c,{contextMenuFuns:u,setList:i,setOpenGroupItemData:S,longPressTriggered:C,moveItemId:D,moveTargetId:L,setMoveTargetId:j,listStatus:q}=Q(),{itemIconBuilder:h,theme:g,contextMenu:I}=W(),{light:x,dark:$}=O.getTheme(g),{children:f,data:M,config:T}=o,{row:b=1,col:y=1}=T??{},H={visible:{opacity:1,scale:1},hidden:{opacity:0,scale:.95}},J=((f==null?void 0:f.length)??0)===0,F=J?[o]:[...f??[]].slice(0,9),le=k.useMemo(()=>D===o.id.toString(),[o.id,D]),K=k.useMemo(()=>L===o.id,[o.id,L]),R=t.css`
|
|
138
138
|
overflow: hidden;
|
|
139
139
|
cursor: pointer;
|
|
140
140
|
background-color: ${x.itemIconBackgroundColor};
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
@media (prefers-color-scheme: dark) {
|
|
157
157
|
background-color: ${$.itemIconBackgroundColor};
|
|
158
158
|
}
|
|
159
|
-
`),onClick:P=>{P.stopPropagation(),a==null||a(o)},children:
|
|
159
|
+
`),onClick:P=>{P.stopPropagation(),a==null||a(o)},children:h==null?void 0:h(o)});if(b===1&&y===1||b===2&&y===2)return e.jsx(s.motion.div,{className:t.css`
|
|
160
160
|
display: grid;
|
|
161
161
|
width: 100%;
|
|
162
162
|
height: 100%;
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
border-radius: ${y===1?"0.25rem":"0.5rem"};
|
|
170
170
|
width: 100%;
|
|
171
171
|
height: 100%;
|
|
172
|
-
`),onClick:U=>{U.stopPropagation(),a==null||a(P)},children:
|
|
172
|
+
`),onClick:U=>{U.stopPropagation(),a==null||a(P)},children:h==null?void 0:h(P)},P.id))});if(b===1&&y===2)return e.jsx(s.motion.div,{className:t.css`
|
|
173
173
|
display: grid;
|
|
174
174
|
grid-template-columns: repeat(10, minmax(0, 1fr));
|
|
175
175
|
grid-template-rows: repeat(4, minmax(0, 1fr));
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
border-radius: 0.375rem;
|
|
191
191
|
grid-column: span 2 / span 2;
|
|
192
192
|
grid-row: span 2 / span 2;
|
|
193
|
-
`),onClick:Z=>{U>2||(Z.stopPropagation(),a==null||a(P))},children:
|
|
193
|
+
`),onClick:Z=>{U>2||(Z.stopPropagation(),a==null||a(P))},children:h==null?void 0:h(P)},P.id))});if(b===2&&y===1)return e.jsx(s.motion.div,{className:t.css`
|
|
194
194
|
display: grid;
|
|
195
195
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
196
196
|
grid-template-rows: repeat(10, minmax(0, 1fr));
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
height: 1.5rem;
|
|
211
211
|
grid-column: span 2 / span 2;
|
|
212
212
|
grid-row: span 2 / span 2;
|
|
213
|
-
`),onClick:Z=>{U>2||(Z.stopPropagation(),a==null||a(P))},children:
|
|
213
|
+
`),onClick:Z=>{U>2||(Z.stopPropagation(),a==null||a(P))},children:h==null?void 0:h(P)},P.id))})};return e.jsxs(re,{data:o,itemIndex:l,parentIds:r,childrenLength:f==null?void 0:f.length,className:t.cx(t.css`
|
|
214
214
|
grid-row: span ${b};
|
|
215
215
|
grid-column: span ${y};
|
|
216
216
|
`,n),children:[e.jsx(s.motion.div,{whileTap:{scale:.9},className:t.cx(K?"!scale-110":"",t.css`
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
margin: 0 auto;
|
|
229
229
|
width: ${y*64+32*(y-1)}px;
|
|
230
230
|
height: ${b*64+32*(b-1)}px;
|
|
231
|
-
`),onClick:P=>{!J&&!C&&(o.parentIds=r,o.pageX=P.pageX,o.pageY=P.pageY,S(o))},...
|
|
231
|
+
`),onClick:P=>{!J&&!C&&(o.parentIds=r,o.pageX=P.pageX,o.pageY=P.pageY,S(o))},...u(o,I!==!1),children:e.jsxs(s.motion.div,{className:t.css`
|
|
232
232
|
position: relative;
|
|
233
233
|
width: 100%;
|
|
234
234
|
height: 100%;
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
transition: all 0.2s;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
`,
|
|
272
|
+
`,Ue=c=>{const{data:o,onClose:n,onItemClick:r}=c,{list:l,setList:a,setListStatus:d,setMoveItemId:u,setMoveTargetId:i,updateItem:S}=Q(),{theme:C}=W(),{light:D,dark:L}=O.getTheme(C),[j,q]=k.useState("文件夹"),h=[...(o==null?void 0:o.children)??[]];return k.useEffect(()=>{var g;o&&q((g=o.data)==null?void 0:g.name)},[o]),e.jsx(de,{visible:!!o,onClose:()=>{n()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,title:e.jsx("input",{className:t.css`
|
|
273
273
|
background-color: transparent;
|
|
274
274
|
border-style: none;
|
|
275
275
|
text-align: center;
|
|
@@ -316,7 +316,7 @@
|
|
|
316
316
|
grid-template-columns: repeat(auto-fill, 96px);
|
|
317
317
|
grid-auto-flow: dense;
|
|
318
318
|
grid-auto-rows: 96px;
|
|
319
|
-
`,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(o==null?void 0:o.children)??[],setList:g=>{var $,f;const I=g.map(M=>M.id),x=(f=($=l.find(M=>M.id===(o==null?void 0:o.id)))==null?void 0:$.children)==null?void 0:f.map(M=>M.id);I.length===(x==null?void 0:x.length)&&I.every((M,T)=>M===x[T])||I.length<((x==null?void 0:x.length)??0)||a(g,[...(o==null?void 0:o.parentIds)??[],o==null?void 0:o.id])},onMove:()=>(i(null),d("onMove"),!0),onStart:g=>{const I=g.item.dataset;I!=null&&I.id&&
|
|
319
|
+
`,group:{name:"nested",pull:!0,put:!1},animation:150,fallbackOnBody:!0,list:(o==null?void 0:o.children)??[],setList:g=>{var $,f;const I=g.map(M=>M.id),x=(f=($=l.find(M=>M.id===(o==null?void 0:o.id)))==null?void 0:$.children)==null?void 0:f.map(M=>M.id);I.length===(x==null?void 0:x.length)&&I.every((M,T)=>M===x[T])||I.length<((x==null?void 0:x.length)??0)||a(g,[...(o==null?void 0:o.parentIds)??[],o==null?void 0:o.id])},onMove:()=>(i(null),d("onMove"),!0),onStart:g=>{const I=g.item.dataset;I!=null&&I.id&&u(I.id),d("onMove")},onEnd:()=>{u(null),i(null),d(null)},ghostClass:be,children:h.map((g,I)=>e.jsx(re,{data:g,itemIndex:I,onClick:r},g.id))})})})},Ve=c=>{var r;const{data:o,onClose:n}=c;return e.jsx(de,{visible:!!o,onClose:()=>{n()},animation:"zoom",maskAnimation:"fade",mousePosition:o!=null&&o.pageX&&(o!=null&&o.pageY)?{x:o==null?void 0:o.pageX,y:o==null?void 0:o.pageY}:null,footer:null,title:((r=o==null?void 0:o.data)==null?void 0:r.name)??"信息",children:o&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:"开发者信息"}),e.jsx("div",{className:"p-2 rounded-md bg-[#272822]",children:e.jsx(De,{src:o,theme:"monokai"})})]})})},We=c=>{const{pagination:o={position:"bottom"},className:n,sliderProps:r,sliderRef:l,onItemClick:a}=c,d=k.useRef(null),u=k.useRef(null),{list:i,setList:S,setListStatus:C,showInfoItemData:D,setShowInfoItemData:L,openGroupItemData:j,setOpenGroupItemData:q,setMoveItemId:h,setMoveTargetId:g,addItem:I}=Q(),{pagingDotBuilder:x,pagingDotsBuilder:$,itemBuilder:f}=W(),M=k.useMemo(()=>o===!1?{}:{top:t.css`
|
|
320
320
|
display: flex;
|
|
321
321
|
flex-direction: column;
|
|
322
322
|
.slick-list {
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
flex-direction: column;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
`}[o.position??"bottom"],[o]);return e.jsxs(e.Fragment,{children:[e.jsx(
|
|
362
|
+
`}[o.position??"bottom"],[o]);return e.jsxs(e.Fragment,{children:[e.jsx(Be,{useCSS:!0,useTransform:!0,arrows:!1,ref:l??d,infinite:!1,dots:!0,touchMove:!1,lazyLoad:"anticipated",className:t.cx(M,t.css`
|
|
363
363
|
.slick-track {
|
|
364
364
|
display: flex;
|
|
365
365
|
align-items: stretch;
|
|
@@ -374,7 +374,7 @@
|
|
|
374
374
|
width: 100%;
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
`,n),customPaging:T=>{var b,y;return x?x(i[T],T):e.jsx("div",{onDragEnter:()=>{var H;(H=(l??d).current)==null||H.slickGoTo(T)},children:(y=(b=i[T])==null?void 0:b.data)==null?void 0:y.name})},appendDots:T=>$?$(T):o===!1?e.jsx("div",{}):e.jsx("div",{children:e.jsx("ul",{ref:
|
|
377
|
+
`,n),customPaging:T=>{var b,y;return x?x(i[T],T):e.jsx("div",{onDragEnter:()=>{var H;(H=(l??d).current)==null||H.slickGoTo(T)},children:(y=(b=i[T])==null?void 0:b.data)==null?void 0:y.name})},appendDots:T=>$?$(T):o===!1?e.jsx("div",{}):e.jsx("div",{children:e.jsx("ul",{ref:u,className:t.cx("slick-dots-default",t.css`
|
|
378
378
|
padding: 0.5rem;
|
|
379
379
|
display: inline-flex;
|
|
380
380
|
justify-content: center;
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
place-items: center;
|
|
403
403
|
justify-content: center;
|
|
404
404
|
align-items: center;
|
|
405
|
-
`),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:T.children??[],setList:b=>S(b,[T.id]),filter:".drag-disabled",onMove:b=>{C("onMove");const{dragged:y,related:H}=b,J=y.dataset,F=H.dataset;return g(null),!((Object.keys(F).length===0||F.parentIds)&&Number(J.childrenLength)>0&&H.classList.contains("sortable-group-item"))},onStart:b=>{const y=b.item.dataset;y!=null&&y.id&&
|
|
405
|
+
`),animation:150,fallbackOnBody:!0,swapThreshold:.65,group:"nested",list:T.children??[],setList:b=>S(b,[T.id]),filter:".drag-disabled",onMove:b=>{C("onMove");const{dragged:y,related:H}=b,J=y.dataset,F=H.dataset;return g(null),!((Object.keys(F).length===0||F.parentIds)&&Number(J.childrenLength)>0&&H.classList.contains("sortable-group-item"))},onStart:b=>{const y=b.item.dataset;y!=null&&y.id&&h(y.id),C("onMove")},onEnd:()=>{h(null),g(null),C(null)},ghostClass:be,children:(T.children??[]).map((b,y)=>{let H;if(f)return f(b);switch(b.type){case"group":case"app":H=e.jsx(_e,{data:b,itemIndex:y,parentIds:[T.id,b.id],onClick:a},b.id);break;default:H=e.jsx(re,{data:b,itemIndex:y,onClick:a},b.id);break}return H})})},T.id))}),e.jsx(Ve,{data:D,onClose:()=>{L(null)}}),e.jsx(Ue,{data:j,onClose:()=>{q(null)},onItemClick:a})]})},Je=c=>{const{list:o,onChange:n,storageKey:r,enableCaching:l,theme:a,noLetters:d,contextMenu:u,contextMenuBuilder:i,itemBuilder:S,itemIconBuilder:C,pagingDotBuilder:D,pagingDotsBuilder:L,...j}=c,q={list:o,onChange:n,storageKey:r,enableCaching:l},h={theme:a,noLetters:d,contextMenu:u,pagingDotsBuilder:L,pagingDotBuilder:D,itemBuilder:S,itemIconBuilder:C,contextMenuBuilder:i};return e.jsx(Xe,{...q,children:e.jsx(He,{...h,children:e.jsx(We,{...j})})})},Ke={frontmatterEditor:{title:"编辑前置元数据",key:"键",value:"值",addEntry:"添加项目"},dialogControls:{save:"保存",cancel:"取消"},uploadImage:{uploadInstructions:"从您的设备中上传图片:",addViaUrlInstructions:"或从网址新增图片:",autoCompletePlaceholder:"选择或粘贴图片",alt:"替代文本:",title:"标题:"},imageEditor:{editImage:"编辑图片"},createLink:{url:"网址",urlPlaceholder:"选择或粘贴网址",title:"标题",saveTooltip:"设置网址",cancelTooltip:"取消更改"},linkPreview:{open:"在新窗口中打开 {{url}}",edit:"编辑链接网址",copyToClipboard:"复制到剪贴板",copied:"已复制!",remove:"移除链接"},table:{deleteTable:"删除表格",columnMenu:"列菜单",textAlignment:"文字对齐",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",insertColumnLeft:"在当前列左侧插入一列",insertColumnRight:"在当前列右侧插入一列",deleteColumn:"删除此列",rowMenu:"行菜单",insertRowAbove:"在当前行上方插入一行",insertRowBelow:"在当前行下方插入一行",deleteRow:"删除此行"},toolbar:{blockTypes:{paragraph:"段落",quote:"引用",heading:"标题 {{level}}"},blockTypeSelect:{selectBlockTypeTooltip:"选择块类型",placeholder:"块类型"},toggleGroup:"切换组",removeBold:"移除粗体",bold:"粗体",removeItalic:"移除斜体",italic:"斜体",underline:"移除下划线",removeUnderline:"下划线",removeInlineCode:"移除内联代码样式",inlineCode:"内联代码样式",link:"创建链接",richText:"富文本",diffMode:"差异模式",source:"源码模式",admonition:"插入注释区块",codeBlock:"插入代码块",editFrontmatter:"编辑前置元数据",insertFrontmatter:"插入前置元数据",image:"插入图片",insertSandpack:"插入 Sandpack",table:"插入表格",thematicBreak:"插入主题换行",bulletedList:"无序列表",numberedList:"有序列表",checkList:"任务列表",deleteSandpack:"删除 Sandpack",undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",superscript:"上标",subscript:"下标",strikethrough:"删除线",removeSubscript:"移除下标",removeSuperscript:"移除上标",removeStrikethrough:"移除删除线"},admonitions:{note:"注意",tip:"提示",danger:"危险",info:"信息",caution:"警告",changeType:"选择注释区块类型",placeholder:"注释区块类型"},codeBlock:{language:"代码块语言",selectLanguage:"选择代码块语言",inlineLanguage:"代码块语言"},codeblock:{delete:"删除代码块"},contentArea:{editableMarkdown:"可编辑的 Markdown"},image:{delete:"删除图片"}},Ze=(c,o,n)=>{const l=c.split(".").reduce((a,d)=>typeof a=="string"?a:a[d],Ke);return typeof l!="string"?o:n?l.replace(/{{(.*?)}}/g,(a,d)=>n[d]):l},Qe=t.css`
|
|
406
406
|
--accentBase: var(--tomato-1);
|
|
407
407
|
--accentBgSubtle: var(--tomato-2);
|
|
408
408
|
--accentBg: var(--tomato-3);
|
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
rgba(255, 255, 255, 0.05),
|
|
457
457
|
rgba(255, 255, 255, 0.05)
|
|
458
458
|
);
|
|
459
|
-
`,
|
|
459
|
+
`,Re=t.css`
|
|
460
460
|
[class*="_toolbarRoot"] {
|
|
461
461
|
flex-wrap: wrap;
|
|
462
462
|
transition: all 0.3s;
|
|
@@ -656,6 +656,6 @@
|
|
|
656
656
|
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
|
|
657
657
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
|
|
658
658
|
}
|
|
659
|
-
`,ne=c=>{var o,n;return c==="dark"?!0:c==="light"?!1:(o=document.documentElement.getAttribute("style"))!=null&&o.includes("color-scheme: dark;")?!0:(n=document.documentElement.getAttribute("style"))!=null&&n.includes("color-scheme: light;")?!1:window.matchMedia("(prefers-color-scheme: dark)").matches},Re=c=>{const{value:o,onChange:n,translation:r,pluginConfig:l,className:a,theme:d="auto",...m}=c,i=k.useRef(null),{image:S,diffSource:C={viewMode:"rich-text"},headings:D,link:L,codeBlock:j,codeMirror:q={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:u={directiveDescriptors:[h.AdmonitionDirectiveDescriptor]}}=l??{},[g,I]=k.useState("");return k.useEffect(()=>{var x;o!==void 0&&i.current&&((x=i.current)==null||x.setMarkdown(o),I(o))},[o,i]),e.jsx(h.MDXEditor,{ref:i,className:t.cx(Qe,ne(d)?Ze:"",ne(d)?ye:xe,a),contentEditableClassName:ke,markdown:g,onChange:x=>{!o&&!n&&I(x),n&&n(x)},translation:r??Ke,plugins:[h.toolbarPlugin({toolbarContents:()=>e.jsxs(h.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[e.jsx(h.UndoRedo,{}),e.jsx(h.Separator,{}),e.jsx(h.BoldItalicUnderlineToggles,{}),e.jsx(h.CodeToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.StrikeThroughSupSubToggles,{}),e.jsx(h.Separator,{}),e.jsx(h.ListsToggle,{}),e.jsx(h.Separator,{}),e.jsx(h.CreateLink,{}),e.jsx(h.InsertImage,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertTable,{}),e.jsx(h.InsertThematicBreak,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertCodeBlock,{}),e.jsx(h.Separator,{}),e.jsx(h.InsertFrontmatter,{})]})}),h.diffSourcePlugin(C),h.listsPlugin(),h.quotePlugin(),h.headingsPlugin(D),h.linkPlugin(L),h.linkDialogPlugin(),h.imagePlugin(S),h.tablePlugin(),h.thematicBreakPlugin(),h.frontmatterPlugin(),h.codeBlockPlugin(j),h.codeMirrorPlugin(q),h.markdownShortcutPlugin(),h.directivesPlugin(u)],...m})},eo={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},oo=c=>{const{children:o="",className:n,theme:r="auto",imageProps:l}=c;return e.jsx("div",{className:ne(r)?ye:xe,children:e.jsx(De,{className:t.cx(ke,n),remarkPlugins:[Le,Pe],rehypePlugins:[ze],components:{code(a){const{children:d,className:m,node:i,ref:S,...C}=a,D=/language-(\w+)/.exec(m||"");return D?e.jsx($e.Prism,{...C,PreTag:"div",children:String(d).replace(/\n$/,""),language:D[1],style:eo}):e.jsx("code",{...C,className:m,children:d})},img(a){return e.jsx(Ae,{...a,preview:{icons:{rotateLeft:e.jsx(G.RiAnticlockwise2Line,{}),rotateRight:e.jsx(G.RiClockwise2Line,{}),zoomIn:e.jsx(G.RiZoomInLine,{}),zoomOut:e.jsx(G.RiZoomOutLine,{}),close:e.jsx(G.RiCloseLine,{}),left:e.jsx(G.RiArrowLeftLine,{}),right:e.jsx(G.RiArrowRightLine,{}),flipX:e.jsx(G.RiArrowLeftRightLine,{}),flipY:e.jsx(G.RiArrowUpDownLine,{})},onVisibleChange:d=>{console.log("visible",d)},zIndex:9999,mask:""},className:t.css`
|
|
659
|
+
`,ne=c=>{var o,n;return c==="dark"?!0:c==="light"?!1:(o=document.documentElement.getAttribute("style"))!=null&&o.includes("color-scheme: dark;")?!0:(n=document.documentElement.getAttribute("style"))!=null&&n.includes("color-scheme: light;")?!1:window.matchMedia("(prefers-color-scheme: dark)").matches},eo=c=>{const{value:o,onChange:n,translation:r,pluginConfig:l,className:a,theme:d="auto",...u}=c,i=k.useRef(null),{image:S,diffSource:C={viewMode:"rich-text"},headings:D,link:L,codeBlock:j,codeMirror:q={codeBlockLanguages:{js:"JavaScript",css:"CSS",txt:"Plain Text",tsx:"TypeScript","":"Unspecified"}},directives:h={directiveDescriptors:[m.AdmonitionDirectiveDescriptor]}}=l??{},[g,I]=k.useState("");return k.useEffect(()=>{var x;o!==void 0&&i.current&&((x=i.current)==null||x.setMarkdown(o),I(o))},[o,i]),e.jsx(m.MDXEditor,{ref:i,className:t.cx(Re,ne(d)?Qe:"",ne(d)?ye:xe,a),contentEditableClassName:ke,markdown:g,onChange:x=>{!o&&!n&&I(x),n&&n(x)},translation:r??Ze,plugins:[m.toolbarPlugin({toolbarContents:()=>e.jsxs(m.DiffSourceToggleWrapper,{options:["rich-text","source"],children:[e.jsx(m.UndoRedo,{}),e.jsx(m.Separator,{}),e.jsx(m.BoldItalicUnderlineToggles,{}),e.jsx(m.CodeToggle,{}),e.jsx(m.Separator,{}),e.jsx(m.StrikeThroughSupSubToggles,{}),e.jsx(m.Separator,{}),e.jsx(m.ListsToggle,{}),e.jsx(m.Separator,{}),e.jsx(m.CreateLink,{}),e.jsx(m.InsertImage,{}),e.jsx(m.Separator,{}),e.jsx(m.InsertTable,{}),e.jsx(m.InsertThematicBreak,{}),e.jsx(m.Separator,{}),e.jsx(m.InsertCodeBlock,{}),e.jsx(m.Separator,{}),e.jsx(m.InsertFrontmatter,{})]})}),m.diffSourcePlugin(C),m.listsPlugin(),m.quotePlugin(),m.headingsPlugin(D),m.linkPlugin(L),m.linkDialogPlugin(),m.imagePlugin(S),m.tablePlugin(),m.thematicBreakPlugin(),m.frontmatterPlugin(),m.codeBlockPlugin(j),m.codeMirrorPlugin(q),m.markdownShortcutPlugin(),m.directivesPlugin(h)],...u})},oo={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}},ve=c=>{const{children:o="",className:n,theme:r="auto",imageProps:l}=c;return e.jsx("div",{className:ne(r)?ye:xe,children:e.jsx(Le,{className:t.cx(ke,n),remarkPlugins:[Pe,ze],rehypePlugins:[$e],components:{code(a){const{children:d,className:u,node:i,ref:S,...C}=a,D=/language-(\w+)/.exec(u||"");return D?e.jsx(Ae.Prism,{...C,PreTag:"div",children:String(d).replace(/\n$/,""),language:D[1],style:oo}):e.jsx("code",{...C,className:u,children:d})},img(a){const{preview:d,...u}=l??{};return e.jsx(qe,{...a,preview:d instanceof Boolean?d:{icons:{rotateLeft:e.jsx(G.RiAnticlockwise2Line,{}),rotateRight:e.jsx(G.RiClockwise2Line,{}),zoomIn:e.jsx(G.RiZoomInLine,{}),zoomOut:e.jsx(G.RiZoomOutLine,{}),close:e.jsx(G.RiCloseLine,{}),left:e.jsx(G.RiArrowLeftLine,{}),right:e.jsx(G.RiArrowRightLine,{}),flipX:e.jsx(G.RiArrowLeftRightLine,{}),flipY:e.jsx(G.RiArrowUpDownLine,{})},zIndex:9999,mask:" ",...d},className:t.css`
|
|
660
660
|
cursor: zoom-in;
|
|
661
|
-
`,...
|
|
661
|
+
`,...u})}},children:o})})},we=eo;we.Preview=ve;function Ce(...c){return je.twMerge(Ee.clsx(c))}const to=c=>{const{mouseX:o,title:n,icon:r,href:l}=c,a=k.useRef(null),d=s.useTransform(o,I=>{var $;const x=(($=a.current)==null?void 0:$.getBoundingClientRect())??{x:0,width:0};return I-x.x-x.width/2}),u=s.useTransform(d,[-150,0,150],[40,80,40]),i=s.useTransform(d,[-150,0,150],[40,80,40]),S=s.useTransform(d,[-150,0,150],[20,40,20]),C=s.useTransform(d,[-150,0,150],[20,40,20]),D=s.useSpring(u,{mass:.1,stiffness:150,damping:12}),L=s.useSpring(i,{mass:.1,stiffness:150,damping:12}),j=s.useSpring(S,{mass:.1,stiffness:150,damping:12}),q=s.useSpring(C,{mass:.1,stiffness:150,damping:12}),[h,g]=k.useState(!1);return e.jsx("a",{href:l,children:e.jsxs(s.motion.div,{ref:a,style:{width:D,height:L},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:"aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",children:[e.jsx(s.AnimatePresence,{children:h&&e.jsx(s.motion.div,{initial:{opacity:0,y:10,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:2,x:"-50%"},className:"px-2 py-0.5 whitespace-pre rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700 absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",children:n})}),e.jsx(s.motion.div,{style:{width:j,height:q},className:"flex items-center justify-center",children:r})]})})},Se=c=>{const{items:o,className:n}=c,r=s.useMotionValue(1/0);return e.jsx(s.motion.div,{onMouseMove:l=>r.set(l.pageX),onMouseLeave:()=>r.set(1/0),className:Ce("mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",n),children:o.map(l=>e.jsx(to,{mouseX:r,...l},l.title))})},Ie=c=>{const{items:o,className:n,collapseIcon:r,autoHidden:l=!1}=c,[a,d]=k.useState(!1),u=()=>{d(!a)};return e.jsxs("div",{className:Ce("relative block",l?"md:hidden":"",n),children:[e.jsx(s.AnimatePresence,{children:a&&e.jsx(s.motion.div,{layoutId:"nav",className:"absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",children:o.map((i,S)=>e.jsx(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10,transition:{delay:S*.05}},transition:{delay:(o.length-1-S)*.05},children:e.jsx("a",{href:i.href,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",children:e.jsx("div",{className:"h-4 w-4",children:i.icon})},i.title)},i.title))})}),e.jsx("button",{onClick:u,className:"h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",children:r||e.jsx(G.RiMoreLine,{className:"h-5 w-5 text-neutral-500 dark:text-neutral-400"})})]})},ae=c=>{const{items:o,desktopClassName:n,mobileClassName:r,...l}=c;return e.jsxs(e.Fragment,{children:[e.jsx(Se,{items:o,className:n,...l}),e.jsx(Ie,{items:o,className:r,autoHidden:!0,...l})]})};ae.Desktop=Se,ae.Mobile=Ie,p.Desktop=Je,p.Dock=ae,p.Markdown=ve,p.MdEditor=we,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|