@mxmweb/zui-layouts 1.3.5 → 1.3.7
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/index.js +98 -91
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -50,14 +50,14 @@ new Promise(() => {
|
|
|
50
50
|
* This source code is licensed under the ISC license.
|
|
51
51
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
|
-
const
|
|
53
|
+
const He = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ye = (...e) => e.filter((o, n, h) => !!o && o.trim() !== "" && h.indexOf(o) === n).join(" ").trim();
|
|
54
54
|
/**
|
|
55
55
|
* @license lucide-react v0.456.0 - ISC
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
58
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
59
|
*/
|
|
60
|
-
var
|
|
60
|
+
var Ee = {
|
|
61
61
|
xmlns: "http://www.w3.org/2000/svg",
|
|
62
62
|
width: 24,
|
|
63
63
|
height: 24,
|
|
@@ -79,7 +79,7 @@ const _e = ve(
|
|
|
79
79
|
color: e = "currentColor",
|
|
80
80
|
size: o = 24,
|
|
81
81
|
strokeWidth: n = 2,
|
|
82
|
-
absoluteStrokeWidth:
|
|
82
|
+
absoluteStrokeWidth: h,
|
|
83
83
|
className: a = "",
|
|
84
84
|
children: $,
|
|
85
85
|
iconNode: W,
|
|
@@ -88,16 +88,16 @@ const _e = ve(
|
|
|
88
88
|
"svg",
|
|
89
89
|
{
|
|
90
90
|
ref: _,
|
|
91
|
-
...
|
|
91
|
+
...Ee,
|
|
92
92
|
width: o,
|
|
93
93
|
height: o,
|
|
94
94
|
stroke: e,
|
|
95
|
-
strokeWidth:
|
|
95
|
+
strokeWidth: h ? Number(n) * 24 / Number(o) : n,
|
|
96
96
|
className: ye("lucide", a),
|
|
97
97
|
...M
|
|
98
98
|
},
|
|
99
99
|
[
|
|
100
|
-
...W.map(([f,
|
|
100
|
+
...W.map(([f, p]) => le(f, p)),
|
|
101
101
|
...Array.isArray($) ? $ : [$]
|
|
102
102
|
]
|
|
103
103
|
)
|
|
@@ -110,10 +110,10 @@ const _e = ve(
|
|
|
110
110
|
*/
|
|
111
111
|
const Ce = (e, o) => {
|
|
112
112
|
const n = ve(
|
|
113
|
-
({ className:
|
|
113
|
+
({ className: h, ...a }, $) => le(_e, {
|
|
114
114
|
ref: $,
|
|
115
115
|
iconNode: o,
|
|
116
|
-
className: ye(`lucide-${
|
|
116
|
+
className: ye(`lucide-${He(e)}`, h),
|
|
117
117
|
...a
|
|
118
118
|
})
|
|
119
119
|
);
|
|
@@ -153,8 +153,8 @@ const U = Ce("ChevronRight", [
|
|
|
153
153
|
max-width: 98%;
|
|
154
154
|
position: relative;
|
|
155
155
|
background: ${({ theme: e }) => {
|
|
156
|
-
var o;
|
|
157
|
-
return ((o = e.colors) == null ? void 0 : o.appBackground)
|
|
156
|
+
var o, n;
|
|
157
|
+
return ((o = e.colors) == null ? void 0 : o.dashboardBackground) ?? ((n = e.colors) == null ? void 0 : n.appBackground) ?? "transparent";
|
|
158
158
|
}};
|
|
159
159
|
color: ${({ theme: e }) => {
|
|
160
160
|
var o;
|
|
@@ -168,7 +168,10 @@ const U = Ce("ChevronRight", [
|
|
|
168
168
|
className: "dashboard-container-header"
|
|
169
169
|
})`
|
|
170
170
|
display: flex;
|
|
171
|
-
height:
|
|
171
|
+
height: ${({ theme: e }) => {
|
|
172
|
+
var o;
|
|
173
|
+
return ((o = e.space) == null ? void 0 : o.dashboardHeaderHeight) ?? "38px";
|
|
174
|
+
}};
|
|
172
175
|
z-index: 10;
|
|
173
176
|
background: transparent;
|
|
174
177
|
gap: ${({ theme: e }) => {
|
|
@@ -299,8 +302,8 @@ const U = Ce("ChevronRight", [
|
|
|
299
302
|
return ((n = (o = e.fonts) == null ? void 0 : o.body) == null ? void 0 : n.size) || "14px";
|
|
300
303
|
}};
|
|
301
304
|
color: ${({ $isLast: e, theme: o }) => {
|
|
302
|
-
var n,
|
|
303
|
-
return e ? ((n = o.colors) == null ? void 0 : n.text) || "#343a40" : ((
|
|
305
|
+
var n, h, a;
|
|
306
|
+
return e ? ((n = o.colors) == null ? void 0 : n.text) || "#343a40" : ((h = o.colors) == null ? void 0 : h.textSecondary) || ((a = o.colors) == null ? void 0 : a.disabledText) || "#6c757d";
|
|
304
307
|
}};
|
|
305
308
|
font-weight: ${({ $isLast: e }) => e ? "600" : "normal"};
|
|
306
309
|
cursor: ${({ $isClickable: e }) => e ? "pointer" : "default"};
|
|
@@ -345,8 +348,8 @@ const U = Ce("ChevronRight", [
|
|
|
345
348
|
return ((o = e.colors) == null ? void 0 : o.dashboardBorder) !== void 0 ? e.colors.dashboardBorder : (n = e.colors) != null && n.border ? `1px solid ${e.colors.border}` : "none";
|
|
346
349
|
}};
|
|
347
350
|
border-radius: ${({ theme: e }) => {
|
|
348
|
-
var o;
|
|
349
|
-
return ((o = e.space) == null ? void 0 : o.radius)
|
|
351
|
+
var o, n, h;
|
|
352
|
+
return ((o = e.space) == null ? void 0 : o.dashboardContentRadius) ?? ((n = e.colors) == null ? void 0 : n.dashboardContentRadius) ?? ((h = e.space) == null ? void 0 : h.radius) ?? "4px";
|
|
350
353
|
}};
|
|
351
354
|
/* 优先使用 dashboardShadow,如果没有则使用 shadow */
|
|
352
355
|
box-shadow: ${({ theme: e }) => {
|
|
@@ -365,6 +368,10 @@ const U = Ce("ChevronRight", [
|
|
|
365
368
|
flex-direction: column;
|
|
366
369
|
flex: 1;
|
|
367
370
|
min-width: 0;
|
|
371
|
+
background: ${({ theme: e }) => {
|
|
372
|
+
var o;
|
|
373
|
+
return ((o = e.colors) == null ? void 0 : o.dashboardMainBackground) ?? "transparent";
|
|
374
|
+
}};
|
|
368
375
|
`, Qe = l.div.attrs({
|
|
369
376
|
className: "dashboard-container-main-layout"
|
|
370
377
|
})`
|
|
@@ -379,7 +386,7 @@ const U = Ce("ChevronRight", [
|
|
|
379
386
|
children: e,
|
|
380
387
|
goBack: o,
|
|
381
388
|
title: n,
|
|
382
|
-
description:
|
|
389
|
+
description: h,
|
|
383
390
|
breadcrumbs: a,
|
|
384
391
|
dockItems: $,
|
|
385
392
|
// 以下参数为兼容旧版本保留,当前未使用
|
|
@@ -387,7 +394,7 @@ const U = Ce("ChevronRight", [
|
|
|
387
394
|
defaultDockActiveId: M,
|
|
388
395
|
defaultDockActiveIds: _,
|
|
389
396
|
styles: f,
|
|
390
|
-
eventsEmit:
|
|
397
|
+
eventsEmit: p
|
|
391
398
|
}) => {
|
|
392
399
|
const O = se(), I = K(
|
|
393
400
|
// 基础:默认主题 + useTheme的配置
|
|
@@ -395,13 +402,13 @@ const U = Ce("ChevronRight", [
|
|
|
395
402
|
// 最高层:用户手动传入的styles
|
|
396
403
|
f
|
|
397
404
|
), s = (I == null ? void 0 : I.theme) || F, N = w.useRef(null), A = () => {
|
|
398
|
-
|
|
405
|
+
p != null && p.onGoBack ? p.onGoBack() : o && o();
|
|
399
406
|
}, L = () => {
|
|
400
|
-
|
|
407
|
+
p != null && p.onTitleClick && p.onTitleClick();
|
|
401
408
|
}, T = (m, r) => {
|
|
402
|
-
|
|
403
|
-
},
|
|
404
|
-
|
|
409
|
+
p != null && p.onBreadcrumbClick ? p.onBreadcrumbClick(m, r) : m.onClick && m.onClick();
|
|
410
|
+
}, D = (m, r) => {
|
|
411
|
+
p != null && p.onDockItemClick && p.onDockItemClick(m, r);
|
|
405
412
|
}, z = () => {
|
|
406
413
|
if (!a || a.length === 0) return null;
|
|
407
414
|
const [m, r] = w.useState({ start: 0, end: a.length, showEllipsis: !1 }), j = w.useCallback(() => {
|
|
@@ -415,11 +422,11 @@ const U = Ce("ChevronRight", [
|
|
|
415
422
|
r({ start: 0, end: a.length, showEllipsis: !1 });
|
|
416
423
|
return;
|
|
417
424
|
}
|
|
418
|
-
const Z = 0,
|
|
425
|
+
const Z = 0, E = Math.min(P - 1, a.length);
|
|
419
426
|
r({
|
|
420
427
|
start: Z,
|
|
421
|
-
end:
|
|
422
|
-
showEllipsis:
|
|
428
|
+
end: E,
|
|
429
|
+
showEllipsis: E < a.length - 1
|
|
423
430
|
});
|
|
424
431
|
}, [a.length]);
|
|
425
432
|
if (w.useEffect(() => {
|
|
@@ -445,21 +452,21 @@ const U = Ce("ChevronRight", [
|
|
|
445
452
|
),
|
|
446
453
|
k < a.length - 1 && /* @__PURE__ */ t(oe, { theme: s, children: /* @__PURE__ */ t(U, { size: 14 }) })
|
|
447
454
|
] }, b.id)) });
|
|
448
|
-
const { start: V, end:
|
|
455
|
+
const { start: V, end: H, showEllipsis: ne } = m;
|
|
449
456
|
return /* @__PURE__ */ x(we, { theme: s, children: [
|
|
450
|
-
a.slice(V,
|
|
457
|
+
a.slice(V, H).map((b, k) => /* @__PURE__ */ x(w.Fragment, { children: [
|
|
451
458
|
/* @__PURE__ */ t(
|
|
452
459
|
ee,
|
|
453
460
|
{
|
|
454
|
-
$isLast: k ===
|
|
455
|
-
$isClickable: !!(k <
|
|
461
|
+
$isLast: k === H - V - 1 && !ne,
|
|
462
|
+
$isClickable: !!(k < H - V - 1 || b.onClick),
|
|
456
463
|
onClick: () => T(b, V + k),
|
|
457
464
|
theme: s,
|
|
458
465
|
title: b.label,
|
|
459
466
|
children: b.label
|
|
460
467
|
}
|
|
461
468
|
),
|
|
462
|
-
k <
|
|
469
|
+
k < H - V - 1 && /* @__PURE__ */ t(oe, { theme: s, children: /* @__PURE__ */ t(U, { size: 14 }) })
|
|
463
470
|
] }, b.id)),
|
|
464
471
|
ne && /* @__PURE__ */ x(Ie, { children: [
|
|
465
472
|
/* @__PURE__ */ t(oe, { theme: s, children: /* @__PURE__ */ t(U, { size: 14 }) }),
|
|
@@ -473,7 +480,7 @@ const U = Ce("ChevronRight", [
|
|
|
473
480
|
cursor: "default",
|
|
474
481
|
maxWidth: "auto"
|
|
475
482
|
},
|
|
476
|
-
title: `${a.slice(
|
|
483
|
+
title: `${a.slice(H, -1).map((b) => b.label).join(" > ")}`,
|
|
477
484
|
children: "..."
|
|
478
485
|
}
|
|
479
486
|
),
|
|
@@ -499,12 +506,12 @@ const U = Ce("ChevronRight", [
|
|
|
499
506
|
items: $,
|
|
500
507
|
open: J,
|
|
501
508
|
onOpenChange: te,
|
|
502
|
-
onItemClick: (m) =>
|
|
509
|
+
onItemClick: (m) => D({ id: String(m.key), label: m.name }, 0),
|
|
503
510
|
defaultOpen: !0
|
|
504
511
|
}
|
|
505
512
|
) }),
|
|
506
513
|
/* @__PURE__ */ x(Je, { theme: s, children: [
|
|
507
|
-
(n ||
|
|
514
|
+
(n || h || o || a) && /* @__PURE__ */ x(Ge, { ref: N, theme: s, children: [
|
|
508
515
|
o && /* @__PURE__ */ t(
|
|
509
516
|
Ke,
|
|
510
517
|
{
|
|
@@ -524,12 +531,12 @@ const U = Ce("ChevronRight", [
|
|
|
524
531
|
children: n
|
|
525
532
|
}
|
|
526
533
|
),
|
|
527
|
-
|
|
534
|
+
h && /* @__PURE__ */ t(
|
|
528
535
|
qe,
|
|
529
536
|
{
|
|
530
537
|
theme: s,
|
|
531
|
-
title:
|
|
532
|
-
children:
|
|
538
|
+
title: h,
|
|
539
|
+
children: h
|
|
533
540
|
}
|
|
534
541
|
)
|
|
535
542
|
] }),
|
|
@@ -599,7 +606,7 @@ const U = Ce("ChevronRight", [
|
|
|
599
606
|
children: e,
|
|
600
607
|
backgroundImage: o,
|
|
601
608
|
backgroundColor: n,
|
|
602
|
-
header:
|
|
609
|
+
header: h,
|
|
603
610
|
dockItems: a,
|
|
604
611
|
dockActiveMode: $ = "single",
|
|
605
612
|
defaultDockActiveId: W,
|
|
@@ -608,17 +615,17 @@ const U = Ce("ChevronRight", [
|
|
|
608
615
|
eventsEmit: f
|
|
609
616
|
}) => {
|
|
610
617
|
var L, T;
|
|
611
|
-
const
|
|
618
|
+
const p = se(), O = K(
|
|
612
619
|
// 基础:默认主题 + useTheme的配置
|
|
613
|
-
K({ theme: F, mode: "light" },
|
|
620
|
+
K({ theme: F, mode: "light" }, p),
|
|
614
621
|
// 最高层:用户手动传入的styles
|
|
615
622
|
_
|
|
616
|
-
), I = (O == null ? void 0 : O.theme) || F, s = (
|
|
617
|
-
f != null && f.onDockItemClick ? f.onDockItemClick(
|
|
618
|
-
}, N = (
|
|
619
|
-
f != null && f.onDockActiveChange && f.onDockActiveChange(
|
|
620
|
-
}, A = (
|
|
621
|
-
f != null && f.onDockActiveChangeMultiple && f.onDockActiveChangeMultiple(
|
|
623
|
+
), I = (O == null ? void 0 : O.theme) || F, s = (D, z) => {
|
|
624
|
+
f != null && f.onDockItemClick ? f.onDockItemClick(D, z) : D.onClick && D.onClick();
|
|
625
|
+
}, N = (D, z) => {
|
|
626
|
+
f != null && f.onDockActiveChange && f.onDockActiveChange(D, z);
|
|
627
|
+
}, A = (D, z) => {
|
|
628
|
+
f != null && f.onDockActiveChangeMultiple && f.onDockActiveChangeMultiple(D, z);
|
|
622
629
|
};
|
|
623
630
|
return /* @__PURE__ */ x(
|
|
624
631
|
Ue,
|
|
@@ -626,7 +633,7 @@ const U = Ce("ChevronRight", [
|
|
|
626
633
|
backgroundImage: o,
|
|
627
634
|
backgroundColor: n,
|
|
628
635
|
children: [
|
|
629
|
-
|
|
636
|
+
h && /* @__PURE__ */ t(eo, { children: h }),
|
|
630
637
|
/* @__PURE__ */ t(
|
|
631
638
|
oo,
|
|
632
639
|
{
|
|
@@ -898,14 +905,14 @@ const ae = l.div`
|
|
|
898
905
|
const {
|
|
899
906
|
children: o,
|
|
900
907
|
headerLogo: n,
|
|
901
|
-
contentKey:
|
|
908
|
+
contentKey: h,
|
|
902
909
|
modules: a,
|
|
903
910
|
activeModuleKey: $,
|
|
904
911
|
onModuleChange: W,
|
|
905
912
|
languages: M,
|
|
906
913
|
activeLanguageKey: _,
|
|
907
914
|
onLanguageChange: f,
|
|
908
|
-
themes:
|
|
915
|
+
themes: p,
|
|
909
916
|
activeThemeKey: O,
|
|
910
917
|
onThemeChange: I,
|
|
911
918
|
sidebarItems: s,
|
|
@@ -913,7 +920,7 @@ const ae = l.div`
|
|
|
913
920
|
onSidebarItemClick: A,
|
|
914
921
|
activeTocId: L,
|
|
915
922
|
onTocItemClick: T,
|
|
916
|
-
collapsibleSidebar:
|
|
923
|
+
collapsibleSidebar: D = !0,
|
|
917
924
|
styles: z
|
|
918
925
|
} = e, J = se(), te = e.activeThemeKey === "dark" ? yo : mo, m = K(
|
|
919
926
|
K(
|
|
@@ -921,9 +928,9 @@ const ae = l.div`
|
|
|
921
928
|
te
|
|
922
929
|
),
|
|
923
930
|
z
|
|
924
|
-
), r = (m == null ? void 0 : m.theme) || F, [j, V] = w.useState(!1), [
|
|
931
|
+
), r = (m == null ? void 0 : m.theme) || F, [j, V] = w.useState(!1), [H, ne] = w.useState(!1), [b, k] = w.useState(!1), Q = typeof L == "string", [ce, re] = w.useState(L), P = w.useRef(null), [Z, E] = w.useState(void 0), [$e, de] = w.useState(o), [Be, he] = w.useState(1);
|
|
925
932
|
w.useEffect(() => {
|
|
926
|
-
if (
|
|
933
|
+
if (h === void 0) {
|
|
927
934
|
de(o);
|
|
928
935
|
return;
|
|
929
936
|
}
|
|
@@ -932,14 +939,14 @@ const ae = l.div`
|
|
|
932
939
|
de(o), requestAnimationFrame(() => he(1));
|
|
933
940
|
}, 120);
|
|
934
941
|
return () => clearTimeout(i);
|
|
935
|
-
}, [
|
|
936
|
-
var i,
|
|
942
|
+
}, [h, o]), w.useMemo(() => {
|
|
943
|
+
var i, u, d, y, B, c, v, g, G, C, R, Y, X;
|
|
937
944
|
return {
|
|
938
945
|
primaryColor: (i = r == null ? void 0 : r.colors) == null ? void 0 : i.primary,
|
|
939
|
-
secondaryColor: (
|
|
946
|
+
secondaryColor: (u = r == null ? void 0 : r.colors) == null ? void 0 : u.secondary,
|
|
940
947
|
backgroundColor: (d = r == null ? void 0 : r.colors) == null ? void 0 : d.appBackground,
|
|
941
948
|
textColor: (y = r == null ? void 0 : r.colors) == null ? void 0 : y.text,
|
|
942
|
-
borderColor: (
|
|
949
|
+
borderColor: (B = r == null ? void 0 : r.colors) == null ? void 0 : B.border,
|
|
943
950
|
disabledBackground: (c = r == null ? void 0 : r.colors) == null ? void 0 : c.disabledBackground,
|
|
944
951
|
borderRadius: (v = r == null ? void 0 : r.space) == null ? void 0 : v.radius,
|
|
945
952
|
padding: (g = r == null ? void 0 : r.space) == null ? void 0 : g.padding,
|
|
@@ -948,21 +955,21 @@ const ae = l.div`
|
|
|
948
955
|
};
|
|
949
956
|
}, [r]), w.useEffect(() => {
|
|
950
957
|
if (e.tocItems)
|
|
951
|
-
|
|
958
|
+
E(void 0);
|
|
952
959
|
else {
|
|
953
|
-
|
|
960
|
+
h !== void 0 && E(void 0);
|
|
954
961
|
let i = 0;
|
|
955
|
-
const
|
|
962
|
+
const u = 10;
|
|
956
963
|
let d = null, y = null;
|
|
957
|
-
const
|
|
964
|
+
const B = () => {
|
|
958
965
|
const c = P.current;
|
|
959
966
|
if (!c) {
|
|
960
|
-
i <
|
|
967
|
+
i < u ? (i++, d = setTimeout(B, 200)) : E([]);
|
|
961
968
|
return;
|
|
962
969
|
}
|
|
963
970
|
const v = Array.from(c.querySelectorAll("h1, h2, h3"));
|
|
964
971
|
if (v.length === 0) {
|
|
965
|
-
i <
|
|
972
|
+
i < u ? (i++, d = setTimeout(B, 200)) : E([]);
|
|
966
973
|
return;
|
|
967
974
|
}
|
|
968
975
|
const g = /* @__PURE__ */ new Map(), G = v.map((C) => {
|
|
@@ -971,39 +978,39 @@ const ae = l.div`
|
|
|
971
978
|
g.set(R, Y + 1);
|
|
972
979
|
const X = Y > 0 ? `${R}-${Y}` : R;
|
|
973
980
|
C.id || (C.id = X);
|
|
974
|
-
const
|
|
975
|
-
return { id: X, label: C.textContent || "", level:
|
|
981
|
+
const De = C.tagName === "H1" ? 1 : C.tagName === "H2" ? 2 : 3;
|
|
982
|
+
return { id: X, label: C.textContent || "", level: De };
|
|
976
983
|
});
|
|
977
|
-
|
|
984
|
+
E(G);
|
|
978
985
|
};
|
|
979
986
|
return y = requestAnimationFrame(() => {
|
|
980
|
-
d = setTimeout(
|
|
987
|
+
d = setTimeout(B, 100);
|
|
981
988
|
}), () => {
|
|
982
989
|
y !== null && cancelAnimationFrame(y), d !== null && clearTimeout(d);
|
|
983
990
|
};
|
|
984
991
|
}
|
|
985
|
-
}, [o, e.tocItems,
|
|
992
|
+
}, [o, e.tocItems, h]), w.useEffect(() => {
|
|
986
993
|
if (Q) return;
|
|
987
|
-
const
|
|
988
|
-
if (
|
|
994
|
+
const u = ((e.tocItems ?? Z) || []).map((c) => c.id).filter(Boolean);
|
|
995
|
+
if (u.length === 0) return;
|
|
989
996
|
re(void 0);
|
|
990
997
|
const d = { root: null, rootMargin: "0px 0px -70% 0px", threshold: 0 }, y = (c) => {
|
|
991
998
|
var g, G;
|
|
992
999
|
const v = c.filter((C) => C.isIntersecting).sort((C, R) => C.boundingClientRect.top - R.boundingClientRect.top);
|
|
993
1000
|
(G = (g = v[0]) == null ? void 0 : g.target) != null && G.id && re(v[0].target.id);
|
|
994
|
-
},
|
|
995
|
-
return
|
|
1001
|
+
}, B = new IntersectionObserver(y, d);
|
|
1002
|
+
return u.forEach((c) => {
|
|
996
1003
|
const v = document.getElementById(c);
|
|
997
|
-
v &&
|
|
998
|
-
}), () =>
|
|
999
|
-
}, [Z, Q, e.tocItems,
|
|
1000
|
-
const pe = (i,
|
|
1004
|
+
v && B.observe(v);
|
|
1005
|
+
}), () => B.disconnect();
|
|
1006
|
+
}, [Z, Q, e.tocItems, h]);
|
|
1007
|
+
const pe = (i, u) => {
|
|
1001
1008
|
if (!i || i.length === 0) return;
|
|
1002
|
-
const d = Math.max(0, i.findIndex((
|
|
1009
|
+
const d = Math.max(0, i.findIndex((B) => B.key === u)), y = i[(d + 1) % i.length];
|
|
1003
1010
|
return y == null ? void 0 : y.key;
|
|
1004
1011
|
}, ie = (i) => {
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1012
|
+
const u = document.getElementById(i);
|
|
1013
|
+
u && u.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" });
|
|
1007
1014
|
};
|
|
1008
1015
|
return /* @__PURE__ */ t(Ne, { theme: r, mode: m.mode, children: /* @__PURE__ */ x(
|
|
1009
1016
|
no,
|
|
@@ -1054,14 +1061,14 @@ const ae = l.div`
|
|
|
1054
1061
|
}
|
|
1055
1062
|
),
|
|
1056
1063
|
/* @__PURE__ */ t(vo, {}),
|
|
1057
|
-
|
|
1064
|
+
p && p.length > 0 && /* @__PURE__ */ t(
|
|
1058
1065
|
ke,
|
|
1059
1066
|
{
|
|
1060
1067
|
onClick: () => {
|
|
1061
|
-
const i = pe(
|
|
1068
|
+
const i = pe(p, O);
|
|
1062
1069
|
i && (I == null || I(i));
|
|
1063
1070
|
},
|
|
1064
|
-
title: ((xe =
|
|
1071
|
+
title: ((xe = p.find((i) => i.key === O)) == null ? void 0 : xe.label) || "Theme",
|
|
1065
1072
|
"aria-label": "theme",
|
|
1066
1073
|
style: { color: r.colors.text },
|
|
1067
1074
|
children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79Z", stroke: "currentColor", strokeWidth: "1.6" }) })
|
|
@@ -1073,9 +1080,9 @@ const ae = l.div`
|
|
|
1073
1080
|
}
|
|
1074
1081
|
),
|
|
1075
1082
|
(() => {
|
|
1076
|
-
const
|
|
1077
|
-
return /* @__PURE__ */ x(lo, { style: { gridTemplateColumns:
|
|
1078
|
-
|
|
1083
|
+
const u = (Array.isArray(s) ? s.length : 0) > 1, d = u ? j ? "10px" : "var(--sidebar-width)" : "0px", y = H ? "10px" : "var(--toc-width)", B = u ? `${d} 1fr ${y}` : `1fr ${y}`;
|
|
1084
|
+
return /* @__PURE__ */ x(lo, { style: { gridTemplateColumns: B }, children: [
|
|
1085
|
+
u && /* @__PURE__ */ x(so, { children: [
|
|
1079
1086
|
/* @__PURE__ */ t(co, { $collapsed: j, children: /* @__PURE__ */ t(po, { children: s && s.length > 0 && /* @__PURE__ */ t("div", { children: Object.entries(
|
|
1080
1087
|
s.reduce((c, v) => {
|
|
1081
1088
|
const g = v.group || "\u6587\u6863";
|
|
@@ -1096,16 +1103,16 @@ const ae = l.div`
|
|
|
1096
1103
|
g.id
|
|
1097
1104
|
)) })
|
|
1098
1105
|
] }, c)) }) }) }),
|
|
1099
|
-
|
|
1106
|
+
D && u && /* @__PURE__ */ t(ho, { onClick: () => V((c) => !c), title: j ? "\u5C55\u5F00\u5DE6\u4FA7\u680F" : "\u6536\u8D77\u5DE6\u4FA7\u680F", "aria-label": "toggle-left", children: j ? /* @__PURE__ */ t("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M9 6l6 6-6 6", stroke: "currentColor", strokeWidth: "1.6" }) }) : /* @__PURE__ */ t("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M15 6l-6 6 6 6", stroke: "currentColor", strokeWidth: "1.6" }) }) })
|
|
1100
1107
|
] }),
|
|
1101
1108
|
/* @__PURE__ */ t(uo, { children: /* @__PURE__ */ t(
|
|
1102
1109
|
go,
|
|
1103
1110
|
{
|
|
1104
1111
|
ref: P,
|
|
1105
|
-
children: /* @__PURE__ */ t(fo, { $opacity:
|
|
1112
|
+
children: /* @__PURE__ */ t(fo, { $opacity: Be, children: $e })
|
|
1106
1113
|
}
|
|
1107
1114
|
) }),
|
|
1108
|
-
/* @__PURE__ */ t(xo, { children: /* @__PURE__ */ t(bo, { children: /* @__PURE__ */ x(wo, { $collapsed:
|
|
1115
|
+
/* @__PURE__ */ t(xo, { children: /* @__PURE__ */ t(bo, { children: /* @__PURE__ */ x(wo, { $collapsed: H, children: [
|
|
1109
1116
|
/* @__PURE__ */ t(ae, { children: "\u672C\u9875\u76EE\u5F55" }),
|
|
1110
1117
|
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px", width: "100%", maxWidth: "100%", overflow: "hidden" }, children: ((e.tocItems ?? Z) || []).map((c) => /* @__PURE__ */ t(
|
|
1111
1118
|
q,
|
|
@@ -1155,13 +1162,13 @@ const ae = l.div`
|
|
|
1155
1162
|
/* @__PURE__ */ t(q, { onClick: () => k(!1), children: "\u5173\u95ED" })
|
|
1156
1163
|
] }),
|
|
1157
1164
|
s && s.length > 0 && /* @__PURE__ */ t("div", { style: { overflow: "auto", height: "calc(100% - 40px)" }, children: Object.entries(
|
|
1158
|
-
s.reduce((i,
|
|
1159
|
-
const d =
|
|
1160
|
-
return i[d] = i[d] || [], i[d].push(
|
|
1165
|
+
s.reduce((i, u) => {
|
|
1166
|
+
const d = u.group || "\u6587\u6863";
|
|
1167
|
+
return i[d] = i[d] || [], i[d].push(u), i;
|
|
1161
1168
|
}, {})
|
|
1162
|
-
).map(([i,
|
|
1169
|
+
).map(([i, u]) => /* @__PURE__ */ x("div", { children: [
|
|
1163
1170
|
/* @__PURE__ */ t(ae, { children: i }),
|
|
1164
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children:
|
|
1171
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: u.map((d) => /* @__PURE__ */ t(
|
|
1165
1172
|
q,
|
|
1166
1173
|
{
|
|
1167
1174
|
$active: d.id === N,
|