@mxmweb/zui-layouts 1.3.15 → 1.3.16
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 +275 -263
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as n, jsxs as b, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import k, { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { GoogleNavbar as
|
|
1
|
+
import { jsx as n, jsxs as b, Fragment as Ce } from "react/jsx-runtime";
|
|
2
|
+
import * as F from "react";
|
|
3
|
+
import k, { forwardRef as $e, createElement as de } from "react";
|
|
4
|
+
import s from "styled-components";
|
|
5
|
+
import { useTheme as ce, deepMergeTheme as G, defaultTheme as z, ThemeProvider as Te } from "@mxmweb/zui-theme";
|
|
6
|
+
import { GoogleNavbar as Fe, CustomDock as ze } from "@mxmweb/zui-components";
|
|
7
7
|
/**
|
|
8
8
|
* React Router v6.30.1
|
|
9
9
|
*
|
|
@@ -14,33 +14,33 @@ import { GoogleNavbar as Te, CustomDock as Fe } from "@mxmweb/zui-components";
|
|
|
14
14
|
*
|
|
15
15
|
* @license MIT
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
18
|
-
process.env.NODE_ENV !== "production" && (
|
|
19
|
-
const
|
|
20
|
-
process.env.NODE_ENV !== "production" && (
|
|
21
|
-
const
|
|
22
|
-
process.env.NODE_ENV !== "production" && (
|
|
23
|
-
const
|
|
24
|
-
process.env.NODE_ENV !== "production" && (
|
|
25
|
-
const
|
|
26
|
-
process.env.NODE_ENV !== "production" && (
|
|
27
|
-
const
|
|
17
|
+
const Me = /* @__PURE__ */ F.createContext(null);
|
|
18
|
+
process.env.NODE_ENV !== "production" && (Me.displayName = "DataRouter");
|
|
19
|
+
const Re = /* @__PURE__ */ F.createContext(null);
|
|
20
|
+
process.env.NODE_ENV !== "production" && (Re.displayName = "DataRouterState");
|
|
21
|
+
const We = /* @__PURE__ */ F.createContext(null);
|
|
22
|
+
process.env.NODE_ENV !== "production" && (We.displayName = "Await");
|
|
23
|
+
const Oe = /* @__PURE__ */ F.createContext(null);
|
|
24
|
+
process.env.NODE_ENV !== "production" && (Oe.displayName = "Navigation");
|
|
25
|
+
const Le = /* @__PURE__ */ F.createContext(null);
|
|
26
|
+
process.env.NODE_ENV !== "production" && (Le.displayName = "Location");
|
|
27
|
+
const Be = /* @__PURE__ */ F.createContext({
|
|
28
28
|
outlet: null,
|
|
29
29
|
matches: [],
|
|
30
30
|
isDataRoute: !1
|
|
31
31
|
});
|
|
32
|
-
process.env.NODE_ENV !== "production" && (
|
|
33
|
-
const He = /* @__PURE__ */
|
|
32
|
+
process.env.NODE_ENV !== "production" && (Be.displayName = "Route");
|
|
33
|
+
const He = /* @__PURE__ */ F.createContext(null);
|
|
34
34
|
process.env.NODE_ENV !== "production" && (He.displayName = "RouteError");
|
|
35
|
-
const
|
|
36
|
-
function
|
|
37
|
-
let t =
|
|
38
|
-
return t && /* @__PURE__ */
|
|
35
|
+
const je = /* @__PURE__ */ F.createContext(null);
|
|
36
|
+
function Pe(e) {
|
|
37
|
+
let t = F.useContext(Be).outlet;
|
|
38
|
+
return t && /* @__PURE__ */ F.createElement(je.Provider, {
|
|
39
39
|
value: e
|
|
40
40
|
}, t);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
42
|
+
function _e(e) {
|
|
43
|
+
return Pe(e.context);
|
|
44
44
|
}
|
|
45
45
|
new Promise(() => {
|
|
46
46
|
});
|
|
@@ -50,7 +50,7 @@ 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 Ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(),
|
|
53
|
+
const Ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), De = (...e) => e.filter((t, o, d) => !!t && t.trim() !== "" && d.indexOf(t) === o).join(" ").trim();
|
|
54
54
|
/**
|
|
55
55
|
* @license lucide-react v0.456.0 - ISC
|
|
56
56
|
*
|
|
@@ -74,7 +74,7 @@ var Ve = {
|
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
76
|
*/
|
|
77
|
-
const
|
|
77
|
+
const Ge = $e(
|
|
78
78
|
({
|
|
79
79
|
color: e = "currentColor",
|
|
80
80
|
size: t = 24,
|
|
@@ -82,22 +82,22 @@ const _e = Ce(
|
|
|
82
82
|
absoluteStrokeWidth: d,
|
|
83
83
|
className: i = "",
|
|
84
84
|
children: p,
|
|
85
|
-
iconNode:
|
|
85
|
+
iconNode: N,
|
|
86
86
|
...B
|
|
87
|
-
},
|
|
87
|
+
}, R) => de(
|
|
88
88
|
"svg",
|
|
89
89
|
{
|
|
90
|
-
ref:
|
|
90
|
+
ref: R,
|
|
91
91
|
...Ve,
|
|
92
92
|
width: t,
|
|
93
93
|
height: t,
|
|
94
94
|
stroke: e,
|
|
95
95
|
strokeWidth: d ? Number(o) * 24 / Number(t) : o,
|
|
96
|
-
className:
|
|
96
|
+
className: De("lucide", i),
|
|
97
97
|
...B
|
|
98
98
|
},
|
|
99
99
|
[
|
|
100
|
-
...
|
|
100
|
+
...N.map(([D, l]) => de(D, l)),
|
|
101
101
|
...Array.isArray(p) ? p : [p]
|
|
102
102
|
]
|
|
103
103
|
)
|
|
@@ -108,12 +108,12 @@ const _e = Ce(
|
|
|
108
108
|
* This source code is licensed under the ISC license.
|
|
109
109
|
* See the LICENSE file in the root directory of this source tree.
|
|
110
110
|
*/
|
|
111
|
-
const
|
|
112
|
-
const o =
|
|
113
|
-
({ className: d, ...i }, p) =>
|
|
111
|
+
const Ne = (e, t) => {
|
|
112
|
+
const o = $e(
|
|
113
|
+
({ className: d, ...i }, p) => de(Ge, {
|
|
114
114
|
ref: p,
|
|
115
115
|
iconNode: t,
|
|
116
|
-
className:
|
|
116
|
+
className: De(`lucide-${Ee(e)}`, d),
|
|
117
117
|
...i
|
|
118
118
|
})
|
|
119
119
|
);
|
|
@@ -125,7 +125,7 @@ const De = (e, t) => {
|
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
127
|
*/
|
|
128
|
-
const
|
|
128
|
+
const Ke = Ne("ArrowLeft", [
|
|
129
129
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
130
130
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
131
131
|
]);
|
|
@@ -135,9 +135,19 @@ const Ge = De("ArrowLeft", [
|
|
|
135
135
|
* This source code is licensed under the ISC license.
|
|
136
136
|
* See the LICENSE file in the root directory of this source tree.
|
|
137
137
|
*/
|
|
138
|
-
const ee =
|
|
138
|
+
const ee = Ne("ChevronRight", [
|
|
139
139
|
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
140
|
-
])
|
|
140
|
+
]);
|
|
141
|
+
function le(e, t) {
|
|
142
|
+
if (e === "auto") return "auto";
|
|
143
|
+
if (typeof e == "number" && Number.isFinite(e)) return `${e}px`;
|
|
144
|
+
if (typeof e == "string") {
|
|
145
|
+
const o = e.trim();
|
|
146
|
+
return o ? o === "auto" ? "auto" : /^-?\d+(\.\d+)?$/.test(o) ? `${o}px` : o : t;
|
|
147
|
+
}
|
|
148
|
+
return t;
|
|
149
|
+
}
|
|
150
|
+
const Ye = s.div.attrs({
|
|
141
151
|
className: "dashboard-container-wrapper"
|
|
142
152
|
})`
|
|
143
153
|
display: flex;
|
|
@@ -160,7 +170,7 @@ const ee = De("ChevronRight", [
|
|
|
160
170
|
var t, o;
|
|
161
171
|
return ((o = (t = e.fonts) == null ? void 0 : t.body) == null ? void 0 : o.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif";
|
|
162
172
|
}};
|
|
163
|
-
`,
|
|
173
|
+
`, qe = s.div.attrs({
|
|
164
174
|
className: "dashboard-container-header"
|
|
165
175
|
})`
|
|
166
176
|
display: flex;
|
|
@@ -183,7 +193,7 @@ const ee = De("ChevronRight", [
|
|
|
183
193
|
justify-content: flex-start;
|
|
184
194
|
width: 100%;
|
|
185
195
|
min-width: 0; /* 确保 flex 子元素可以收缩 */
|
|
186
|
-
`,
|
|
196
|
+
`, Ze = s.button.attrs({
|
|
187
197
|
className: "dashboard-container-back-button"
|
|
188
198
|
})`
|
|
189
199
|
display: flex;
|
|
@@ -227,7 +237,7 @@ const ee = De("ChevronRight", [
|
|
|
227
237
|
return ((t = e.colors) == null ? void 0 : t.primaryActive) || ((o = e.colors) == null ? void 0 : o.primary) || "#2D4BE0";
|
|
228
238
|
}};
|
|
229
239
|
}
|
|
230
|
-
`,
|
|
240
|
+
`, Xe = s.div.attrs({
|
|
231
241
|
className: "dashboard-container-title"
|
|
232
242
|
})`
|
|
233
243
|
line-height: ${({ theme: e }) => {
|
|
@@ -260,7 +270,7 @@ const ee = De("ChevronRight", [
|
|
|
260
270
|
return ((t = e.colors) == null ? void 0 : t.primary) || "#4E6EF2";
|
|
261
271
|
}};
|
|
262
272
|
}
|
|
263
|
-
`,
|
|
273
|
+
`, Je = s.div.attrs({
|
|
264
274
|
className: "dashboard-container-description"
|
|
265
275
|
})`
|
|
266
276
|
line-height: ${({ theme: e }) => {
|
|
@@ -281,7 +291,7 @@ const ee = De("ChevronRight", [
|
|
|
281
291
|
var t, o;
|
|
282
292
|
return ((o = (t = e.fonts) == null ? void 0 : t.body) == null ? void 0 : o.size) || "12px";
|
|
283
293
|
}};
|
|
284
|
-
`,
|
|
294
|
+
`, me = s.div.attrs({
|
|
285
295
|
className: "dashboard-container-breadcrumb"
|
|
286
296
|
})`
|
|
287
297
|
display: flex;
|
|
@@ -291,7 +301,7 @@ const ee = De("ChevronRight", [
|
|
|
291
301
|
max-width: 50%;
|
|
292
302
|
min-width: 0;
|
|
293
303
|
overflow: hidden;
|
|
294
|
-
`, te =
|
|
304
|
+
`, te = s.div.attrs({
|
|
295
305
|
className: "dashboard-container-breadcrumb-item"
|
|
296
306
|
})`
|
|
297
307
|
display: flex;
|
|
@@ -319,7 +329,7 @@ const ee = De("ChevronRight", [
|
|
|
319
329
|
return e ? ((o = t.colors) == null ? void 0 : o.primary) || "#4E6EF2" : "inherit";
|
|
320
330
|
}};
|
|
321
331
|
}
|
|
322
|
-
`, oe =
|
|
332
|
+
`, oe = s.div.attrs({
|
|
323
333
|
className: "dashboard-container-breadcrumb-separator"
|
|
324
334
|
})`
|
|
325
335
|
display: flex;
|
|
@@ -329,7 +339,7 @@ const ee = De("ChevronRight", [
|
|
|
329
339
|
return ((t = e.colors) == null ? void 0 : t.textSecondary) || ((o = e.colors) == null ? void 0 : o.disabledText) || "#6c757d";
|
|
330
340
|
}};
|
|
331
341
|
margin: 0 2px;
|
|
332
|
-
`,
|
|
342
|
+
`, Qe = s.div.attrs({
|
|
333
343
|
className: "dashboard-container-content"
|
|
334
344
|
})`
|
|
335
345
|
display: flex;
|
|
@@ -341,10 +351,12 @@ const ee = De("ChevronRight", [
|
|
|
341
351
|
return ((t = e == null ? void 0 : e.space) == null ? void 0 : t.dashboardContentPadding) ?? ((o = e == null ? void 0 : e.space) == null ? void 0 : o.padding) ?? "0";
|
|
342
352
|
}};
|
|
343
353
|
height: ${({ theme: e }) => {
|
|
344
|
-
var D,
|
|
345
|
-
const t = ((D = e.space) == null ? void 0 : D.dashboardHeaderHeight) ?? "38px", d = (((
|
|
354
|
+
var D, l;
|
|
355
|
+
const t = ((D = e.space) == null ? void 0 : D.dashboardHeaderHeight) ?? "38px", d = (((l = e.space) == null ? void 0 : l.dashboardHeaderPadding) ?? "0 0 8px 0").trim().split(/\s+/);
|
|
346
356
|
let i = "0px", p = "0px";
|
|
347
|
-
|
|
357
|
+
d.length === 1 ? i = p = d[0] : d.length === 2 ? ([i] = d, p = d[0]) : d.length === 3 ? [i, , p] = d : d.length >= 4 && ([i, , p] = d);
|
|
358
|
+
const N = le(i, "0px"), B = le(p, "0px");
|
|
359
|
+
return t === "auto" ? `calc(100% - ${N} - ${B} - 10px)` : `calc(100% - ${le(t, "38px")} - ${N} - ${B} - 10px)`;
|
|
348
360
|
}};
|
|
349
361
|
min-height: 420px;
|
|
350
362
|
overflow: auto;
|
|
@@ -366,12 +378,12 @@ const ee = De("ChevronRight", [
|
|
|
366
378
|
var t, o;
|
|
367
379
|
return ((t = e.colors) == null ? void 0 : t.dashboardShadow) || ((o = e.colors) == null ? void 0 : o.shadow) || "none";
|
|
368
380
|
}};
|
|
369
|
-
`,
|
|
381
|
+
`, Ue = s.div.attrs({
|
|
370
382
|
className: "dashboard-container-nav"
|
|
371
383
|
})`
|
|
372
384
|
flex: 0 0 ${({ $isOpen: e }) => e ? "72px" : "28px"};
|
|
373
385
|
transition: flex-basis 0.2s ease;
|
|
374
|
-
`,
|
|
386
|
+
`, et = s.div.attrs({
|
|
375
387
|
className: "dashboard-container-main-wrapper"
|
|
376
388
|
})`
|
|
377
389
|
display: flex;
|
|
@@ -383,7 +395,7 @@ const ee = De("ChevronRight", [
|
|
|
383
395
|
var t;
|
|
384
396
|
return ((t = e.colors) == null ? void 0 : t.dashboardMainBackground) ?? "transparent";
|
|
385
397
|
}};
|
|
386
|
-
`,
|
|
398
|
+
`, tt = s.div.attrs({
|
|
387
399
|
className: "dashboard-container-main-layout"
|
|
388
400
|
})`
|
|
389
401
|
height: 100%;
|
|
@@ -393,7 +405,7 @@ const ee = De("ChevronRight", [
|
|
|
393
405
|
var t;
|
|
394
406
|
return ((t = e.space) == null ? void 0 : t.size) || "12px";
|
|
395
407
|
}};
|
|
396
|
-
`,
|
|
408
|
+
`, zt = ({
|
|
397
409
|
children: e,
|
|
398
410
|
goBack: t,
|
|
399
411
|
title: o,
|
|
@@ -401,85 +413,85 @@ const ee = De("ChevronRight", [
|
|
|
401
413
|
breadcrumbs: i,
|
|
402
414
|
dockItems: p,
|
|
403
415
|
// 以下参数为兼容旧版本保留,当前未使用
|
|
404
|
-
dockActiveMode:
|
|
416
|
+
dockActiveMode: N = "single",
|
|
405
417
|
defaultDockActiveId: B,
|
|
406
|
-
defaultDockActiveIds:
|
|
407
|
-
styles:
|
|
408
|
-
eventsEmit:
|
|
418
|
+
defaultDockActiveIds: R,
|
|
419
|
+
styles: D,
|
|
420
|
+
eventsEmit: l
|
|
409
421
|
}) => {
|
|
410
|
-
const K =
|
|
422
|
+
const K = ce(), I = G(
|
|
411
423
|
// 基础:默认主题 + useTheme的配置
|
|
412
|
-
G({ theme:
|
|
424
|
+
G({ theme: z, mode: "light" }, K),
|
|
413
425
|
// 最高层:用户手动传入的styles
|
|
414
|
-
|
|
415
|
-
), c = (I == null ? void 0 : I.theme) ||
|
|
416
|
-
|
|
417
|
-
},
|
|
418
|
-
|
|
419
|
-
},
|
|
420
|
-
|
|
421
|
-
}, Y = (
|
|
422
|
-
|
|
426
|
+
D
|
|
427
|
+
), c = (I == null ? void 0 : I.theme) || z, S = k.useRef(null), A = () => {
|
|
428
|
+
l != null && l.onGoBack ? l.onGoBack() : t && t();
|
|
429
|
+
}, H = () => {
|
|
430
|
+
l != null && l.onTitleClick && l.onTitleClick();
|
|
431
|
+
}, T = (g, r) => {
|
|
432
|
+
l != null && l.onBreadcrumbClick ? l.onBreadcrumbClick(g, r) : g.onClick && g.onClick();
|
|
433
|
+
}, Y = (g, r) => {
|
|
434
|
+
l != null && l.onDockItemClick && l.onDockItemClick(g, r);
|
|
423
435
|
}, j = () => {
|
|
424
436
|
if (!i || i.length === 0) return null;
|
|
425
|
-
const [
|
|
426
|
-
if (!
|
|
437
|
+
const [g, r] = k.useState({ start: 0, end: i.length, showEllipsis: !1 }), W = k.useCallback(() => {
|
|
438
|
+
if (!S.current || i.length <= 3) {
|
|
427
439
|
r({ start: 0, end: i.length, showEllipsis: !1 });
|
|
428
440
|
return;
|
|
429
441
|
}
|
|
430
|
-
const
|
|
431
|
-
let
|
|
432
|
-
if (
|
|
442
|
+
const m = S.current.offsetWidth * 0.5;
|
|
443
|
+
let E = Math.floor((m - 30) / (120 + 20));
|
|
444
|
+
if (E < 2 && (E = 2), E >= i.length) {
|
|
433
445
|
r({ start: 0, end: i.length, showEllipsis: !1 });
|
|
434
446
|
return;
|
|
435
447
|
}
|
|
436
|
-
const J = 0,
|
|
448
|
+
const J = 0, L = Math.min(E - 1, i.length);
|
|
437
449
|
r({
|
|
438
450
|
start: J,
|
|
439
|
-
end:
|
|
440
|
-
showEllipsis:
|
|
451
|
+
end: L,
|
|
452
|
+
showEllipsis: L < i.length - 1
|
|
441
453
|
});
|
|
442
454
|
}, [i.length]);
|
|
443
455
|
if (k.useEffect(() => {
|
|
444
|
-
|
|
456
|
+
W();
|
|
445
457
|
const w = new ResizeObserver(() => {
|
|
446
|
-
|
|
458
|
+
W();
|
|
447
459
|
});
|
|
448
|
-
return
|
|
460
|
+
return S.current && w.observe(S.current), () => {
|
|
449
461
|
w.disconnect();
|
|
450
462
|
};
|
|
451
|
-
}, [
|
|
452
|
-
return /* @__PURE__ */ n(
|
|
463
|
+
}, [W]), i.length <= 3)
|
|
464
|
+
return /* @__PURE__ */ n(me, { theme: c, children: i.map((w, m) => /* @__PURE__ */ b(k.Fragment, { children: [
|
|
453
465
|
/* @__PURE__ */ n(
|
|
454
466
|
te,
|
|
455
467
|
{
|
|
456
|
-
$isLast:
|
|
457
|
-
$isClickable: !!(
|
|
458
|
-
onClick: () =>
|
|
468
|
+
$isLast: m === i.length - 1,
|
|
469
|
+
$isClickable: !!(m < i.length - 1 || w.onClick),
|
|
470
|
+
onClick: () => T(w, m),
|
|
459
471
|
theme: c,
|
|
460
472
|
title: w.label,
|
|
461
473
|
children: w.label
|
|
462
474
|
}
|
|
463
475
|
),
|
|
464
|
-
|
|
476
|
+
m < i.length - 1 && /* @__PURE__ */ n(oe, { theme: c, children: /* @__PURE__ */ n(ee, { size: 14 }) })
|
|
465
477
|
] }, w.id)) });
|
|
466
|
-
const { start:
|
|
467
|
-
return /* @__PURE__ */ b(
|
|
468
|
-
i.slice(
|
|
478
|
+
const { start: _, end: O, showEllipsis: re } = g;
|
|
479
|
+
return /* @__PURE__ */ b(me, { theme: c, children: [
|
|
480
|
+
i.slice(_, O).map((w, m) => /* @__PURE__ */ b(k.Fragment, { children: [
|
|
469
481
|
/* @__PURE__ */ n(
|
|
470
482
|
te,
|
|
471
483
|
{
|
|
472
|
-
$isLast:
|
|
473
|
-
$isClickable: !!(
|
|
474
|
-
onClick: () =>
|
|
484
|
+
$isLast: m === O - _ - 1 && !re,
|
|
485
|
+
$isClickable: !!(m < O - _ - 1 || w.onClick),
|
|
486
|
+
onClick: () => T(w, _ + m),
|
|
475
487
|
theme: c,
|
|
476
488
|
title: w.label,
|
|
477
489
|
children: w.label
|
|
478
490
|
}
|
|
479
491
|
),
|
|
480
|
-
|
|
492
|
+
m < O - _ - 1 && /* @__PURE__ */ n(oe, { theme: c, children: /* @__PURE__ */ n(ee, { size: 14 }) })
|
|
481
493
|
] }, w.id)),
|
|
482
|
-
re && /* @__PURE__ */ b(
|
|
494
|
+
re && /* @__PURE__ */ b(Ce, { children: [
|
|
483
495
|
/* @__PURE__ */ n(oe, { theme: c, children: /* @__PURE__ */ n(ee, { size: 14 }) }),
|
|
484
496
|
/* @__PURE__ */ n(
|
|
485
497
|
te,
|
|
@@ -491,7 +503,7 @@ const ee = De("ChevronRight", [
|
|
|
491
503
|
cursor: "default",
|
|
492
504
|
maxWidth: "auto"
|
|
493
505
|
},
|
|
494
|
-
title: `${i.slice(
|
|
506
|
+
title: `${i.slice(O, -1).map((w) => w.label).join(" > ")}`,
|
|
495
507
|
children: "..."
|
|
496
508
|
}
|
|
497
509
|
),
|
|
@@ -501,7 +513,7 @@ const ee = De("ChevronRight", [
|
|
|
501
513
|
{
|
|
502
514
|
$isLast: !0,
|
|
503
515
|
$isClickable: !!i[i.length - 1].onClick,
|
|
504
|
-
onClick: () =>
|
|
516
|
+
onClick: () => T(i[i.length - 1], i.length - 1),
|
|
505
517
|
theme: c,
|
|
506
518
|
title: i[i.length - 1].label,
|
|
507
519
|
children: i[i.length - 1].label
|
|
@@ -510,40 +522,40 @@ const ee = De("ChevronRight", [
|
|
|
510
522
|
] })
|
|
511
523
|
] });
|
|
512
524
|
}, [P, q] = k.useState(!0);
|
|
513
|
-
return /* @__PURE__ */ n(
|
|
514
|
-
p && p.length > 0 && /* @__PURE__ */ n(
|
|
515
|
-
|
|
525
|
+
return /* @__PURE__ */ n(Ye, { theme: c, children: /* @__PURE__ */ b(tt, { theme: c, children: [
|
|
526
|
+
p && p.length > 0 && /* @__PURE__ */ n(Ue, { $isOpen: P, theme: c, children: /* @__PURE__ */ n(
|
|
527
|
+
Fe,
|
|
516
528
|
{
|
|
517
529
|
items: p,
|
|
518
530
|
open: P,
|
|
519
531
|
onOpenChange: q,
|
|
520
|
-
onItemClick: (
|
|
532
|
+
onItemClick: (g) => Y({ id: String(g.key), label: g.name }, 0),
|
|
521
533
|
defaultOpen: !0
|
|
522
534
|
}
|
|
523
535
|
) }),
|
|
524
|
-
/* @__PURE__ */ b(
|
|
525
|
-
(o || d || t || i) && /* @__PURE__ */ b(
|
|
536
|
+
/* @__PURE__ */ b(et, { theme: c, children: [
|
|
537
|
+
(o || d || t || i) && /* @__PURE__ */ b(qe, { ref: S, theme: c, children: [
|
|
526
538
|
t && /* @__PURE__ */ n(
|
|
527
|
-
|
|
539
|
+
Ze,
|
|
528
540
|
{
|
|
529
|
-
onClick:
|
|
541
|
+
onClick: A,
|
|
530
542
|
theme: c,
|
|
531
543
|
title: "\u8FD4\u56DE",
|
|
532
|
-
children: /* @__PURE__ */ n(
|
|
544
|
+
children: /* @__PURE__ */ n(Ke, { size: 18 })
|
|
533
545
|
}
|
|
534
546
|
),
|
|
535
547
|
j(),
|
|
536
548
|
o && /* @__PURE__ */ n(
|
|
537
|
-
|
|
549
|
+
Xe,
|
|
538
550
|
{
|
|
539
|
-
onClick:
|
|
551
|
+
onClick: H,
|
|
540
552
|
theme: c,
|
|
541
553
|
title: o,
|
|
542
554
|
children: o
|
|
543
555
|
}
|
|
544
556
|
),
|
|
545
557
|
d && /* @__PURE__ */ n(
|
|
546
|
-
|
|
558
|
+
Je,
|
|
547
559
|
{
|
|
548
560
|
theme: c,
|
|
549
561
|
title: d,
|
|
@@ -551,10 +563,10 @@ const ee = De("ChevronRight", [
|
|
|
551
563
|
}
|
|
552
564
|
)
|
|
553
565
|
] }),
|
|
554
|
-
/* @__PURE__ */ n(
|
|
566
|
+
/* @__PURE__ */ n(Qe, { theme: c, children: e || /* @__PURE__ */ n(_e, {}) })
|
|
555
567
|
] })
|
|
556
568
|
] }) });
|
|
557
|
-
},
|
|
569
|
+
}, ot = s.div.withConfig({
|
|
558
570
|
shouldForwardProp: (e) => !["backgroundImage", "backgroundColor", "dockPosition"].includes(e)
|
|
559
571
|
})`
|
|
560
572
|
position: fixed;
|
|
@@ -567,13 +579,13 @@ const ee = De("ChevronRight", [
|
|
|
567
579
|
flex-direction: ${(e) => e.dockPosition === "left" || e.dockPosition === "right" ? "row" : "column"};
|
|
568
580
|
overflow: hidden;
|
|
569
581
|
z-index: 1;
|
|
570
|
-
`,
|
|
582
|
+
`, nt = s.div.attrs({ className: "dock-container-main-area" })`
|
|
571
583
|
flex: 1;
|
|
572
584
|
display: flex;
|
|
573
585
|
flex-direction: column;
|
|
574
586
|
overflow: hidden;
|
|
575
587
|
min-width: 0;
|
|
576
|
-
`,
|
|
588
|
+
`, rt = s.div`
|
|
577
589
|
height: 48px;
|
|
578
590
|
width: 100%;
|
|
579
591
|
display: flex;
|
|
@@ -582,7 +594,7 @@ const ee = De("ChevronRight", [
|
|
|
582
594
|
background: transparent;
|
|
583
595
|
z-index: 10;
|
|
584
596
|
flex-shrink: 0;
|
|
585
|
-
`,
|
|
597
|
+
`, it = s.div`
|
|
586
598
|
flex: 1;
|
|
587
599
|
width: 100%;
|
|
588
600
|
overflow-y: auto;
|
|
@@ -609,7 +621,7 @@ const ee = De("ChevronRight", [
|
|
|
609
621
|
&::-webkit-scrollbar-thumb:hover {
|
|
610
622
|
background: rgba(255, 255, 255, 0.5);
|
|
611
623
|
}
|
|
612
|
-
`, ne = 16,
|
|
624
|
+
`, ne = 16, at = 48, lt = at + ne * 2, ve = lt + ne * 2, st = s.div.withConfig({
|
|
613
625
|
shouldForwardProp: (e) => !["dockPosition"].includes(e)
|
|
614
626
|
})`
|
|
615
627
|
${(e) => e.dockPosition === "left" || e.dockPosition === "right" ? `
|
|
@@ -630,35 +642,35 @@ const ee = De("ChevronRight", [
|
|
|
630
642
|
background: transparent;
|
|
631
643
|
z-index: 10;
|
|
632
644
|
flex-shrink: 0;
|
|
633
|
-
`,
|
|
645
|
+
`, Mt = ({
|
|
634
646
|
children: e,
|
|
635
647
|
backgroundImage: t,
|
|
636
648
|
backgroundColor: o,
|
|
637
649
|
header: d,
|
|
638
650
|
dockItems: i,
|
|
639
651
|
dockPosition: p = "bottom",
|
|
640
|
-
dockActiveMode:
|
|
652
|
+
dockActiveMode: N = "single",
|
|
641
653
|
defaultDockActiveId: B,
|
|
642
|
-
defaultDockActiveIds:
|
|
643
|
-
styles:
|
|
644
|
-
eventsEmit:
|
|
654
|
+
defaultDockActiveIds: R,
|
|
655
|
+
styles: D,
|
|
656
|
+
eventsEmit: l
|
|
645
657
|
}) => {
|
|
646
658
|
var P, q;
|
|
647
|
-
const K =
|
|
659
|
+
const K = ce(), I = G(
|
|
648
660
|
// 基础:默认主题 + useTheme的配置
|
|
649
|
-
G({ theme:
|
|
661
|
+
G({ theme: z, mode: "light" }, K),
|
|
650
662
|
// 最高层:用户手动传入的styles
|
|
651
|
-
|
|
652
|
-
), c = (I == null ? void 0 : I.theme) ||
|
|
653
|
-
|
|
654
|
-
},
|
|
655
|
-
|
|
656
|
-
},
|
|
657
|
-
|
|
658
|
-
},
|
|
659
|
-
d && /* @__PURE__ */ n(
|
|
663
|
+
D
|
|
664
|
+
), c = (I == null ? void 0 : I.theme) || z, S = (g, r) => {
|
|
665
|
+
l != null && l.onDockItemClick ? l.onDockItemClick(g, r) : g.onClick && g.onClick();
|
|
666
|
+
}, A = (g, r) => {
|
|
667
|
+
l != null && l.onDockActiveChange && l.onDockActiveChange(g, r);
|
|
668
|
+
}, H = (g, r) => {
|
|
669
|
+
l != null && l.onDockActiveChangeMultiple && l.onDockActiveChangeMultiple(g, r);
|
|
670
|
+
}, T = p === "left" || p === "right", Y = /* @__PURE__ */ b(Ce, { children: [
|
|
671
|
+
d && /* @__PURE__ */ n(rt, { children: d }),
|
|
660
672
|
/* @__PURE__ */ n(
|
|
661
|
-
|
|
673
|
+
it,
|
|
662
674
|
{
|
|
663
675
|
style: {
|
|
664
676
|
color: c.colors.text,
|
|
@@ -667,26 +679,26 @@ const ee = De("ChevronRight", [
|
|
|
667
679
|
children: e
|
|
668
680
|
}
|
|
669
681
|
)
|
|
670
|
-
] }), j = i && i.length > 0 && /* @__PURE__ */ n(
|
|
671
|
-
|
|
682
|
+
] }), j = i && i.length > 0 && /* @__PURE__ */ n(st, { dockPosition: p, children: /* @__PURE__ */ n(
|
|
683
|
+
ze,
|
|
672
684
|
{
|
|
673
685
|
items: i,
|
|
674
686
|
itemWidth: 48,
|
|
675
687
|
itemHeight: 48,
|
|
676
688
|
magnification: 1.5,
|
|
677
689
|
itemGap: 8,
|
|
678
|
-
direction:
|
|
690
|
+
direction: T ? "vertical" : "horizontal",
|
|
679
691
|
dockPosition: p,
|
|
680
|
-
activeMode:
|
|
692
|
+
activeMode: N,
|
|
681
693
|
defaultActiveId: B,
|
|
682
|
-
defaultActiveIds:
|
|
683
|
-
onItemClick:
|
|
684
|
-
onActiveChange:
|
|
685
|
-
onActiveChangeMultiple:
|
|
694
|
+
defaultActiveIds: R,
|
|
695
|
+
onItemClick: S,
|
|
696
|
+
onActiveChange: A,
|
|
697
|
+
onActiveChangeMultiple: H
|
|
686
698
|
}
|
|
687
699
|
) });
|
|
688
700
|
return /* @__PURE__ */ b(
|
|
689
|
-
|
|
701
|
+
ot,
|
|
690
702
|
{
|
|
691
703
|
backgroundImage: t,
|
|
692
704
|
backgroundColor: o,
|
|
@@ -694,12 +706,12 @@ const ee = De("ChevronRight", [
|
|
|
694
706
|
children: [
|
|
695
707
|
p === "top" && j,
|
|
696
708
|
p === "left" && j,
|
|
697
|
-
|
|
709
|
+
T ? /* @__PURE__ */ n(nt, { children: Y }) : Y,
|
|
698
710
|
(p === "bottom" || p === "right") && j
|
|
699
711
|
]
|
|
700
712
|
}
|
|
701
713
|
);
|
|
702
|
-
},
|
|
714
|
+
}, dt = s.div`
|
|
703
715
|
--header-height: 56px;
|
|
704
716
|
--page-gutter: 16px;
|
|
705
717
|
--sidebar-width: 264px;
|
|
@@ -712,7 +724,7 @@ const ee = De("ChevronRight", [
|
|
|
712
724
|
min-height: 100vh;
|
|
713
725
|
height: 100vh; /* 以视口高度为基准,便于内部独立滚动布局 */
|
|
714
726
|
position: relative;
|
|
715
|
-
`,
|
|
727
|
+
`, ct = s.div`
|
|
716
728
|
position: sticky;
|
|
717
729
|
top: 0;
|
|
718
730
|
z-index: 30;
|
|
@@ -724,16 +736,16 @@ const ee = De("ChevronRight", [
|
|
|
724
736
|
padding: 0 16px;
|
|
725
737
|
border-bottom: 1px solid rgba(0,0,0,0.06);
|
|
726
738
|
backdrop-filter: blur(8px);
|
|
727
|
-
`,
|
|
739
|
+
`, ht = s.div`
|
|
728
740
|
display: flex;
|
|
729
741
|
align-items: center;
|
|
730
742
|
gap: 12px;
|
|
731
743
|
min-width: 0;
|
|
732
|
-
`,
|
|
744
|
+
`, pt = s.div`
|
|
733
745
|
display: flex;
|
|
734
746
|
align-items: center;
|
|
735
747
|
gap: 8px;
|
|
736
|
-
`,
|
|
748
|
+
`, ye = s.button`
|
|
737
749
|
display: inline-flex;
|
|
738
750
|
align-items: center;
|
|
739
751
|
justify-content: center;
|
|
@@ -747,7 +759,7 @@ const ee = De("ChevronRight", [
|
|
|
747
759
|
|
|
748
760
|
&:hover { background: rgba(0,0,0,0.04); }
|
|
749
761
|
&:active { transform: translateY(1px); }
|
|
750
|
-
`,
|
|
762
|
+
`, ut = s.div`
|
|
751
763
|
display: grid;
|
|
752
764
|
grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
|
|
753
765
|
gap: 16px;
|
|
@@ -768,9 +780,9 @@ const ee = De("ChevronRight", [
|
|
|
768
780
|
gap: 12px;
|
|
769
781
|
padding: 12px 12px 20px 12px;
|
|
770
782
|
}
|
|
771
|
-
`, gt =
|
|
783
|
+
`, gt = s.aside`
|
|
772
784
|
position: relative;
|
|
773
|
-
`,
|
|
785
|
+
`, ft = s.div`
|
|
774
786
|
height: 100%;
|
|
775
787
|
overflow: hidden;
|
|
776
788
|
padding-right: 8px;
|
|
@@ -779,7 +791,7 @@ const ee = De("ChevronRight", [
|
|
|
779
791
|
opacity: ${(e) => e.$collapsed ? 0 : 1};
|
|
780
792
|
transform: translateX(${(e) => e.$collapsed ? "-6px" : "0px"});
|
|
781
793
|
pointer-events: ${(e) => e.$collapsed ? "none" : "auto"};
|
|
782
|
-
`,
|
|
794
|
+
`, xt = s.button`
|
|
783
795
|
position: absolute;
|
|
784
796
|
top: 6px;
|
|
785
797
|
right: -10px;
|
|
@@ -794,16 +806,16 @@ const ee = De("ChevronRight", [
|
|
|
794
806
|
justify-content: center;
|
|
795
807
|
transition: background .15s ease;
|
|
796
808
|
&:hover { background: rgba(0,0,0,0.12); }
|
|
797
|
-
`,
|
|
809
|
+
`, bt = s.div`
|
|
798
810
|
height: 100%;
|
|
799
811
|
overflow: auto;
|
|
800
812
|
padding-right: 8px;
|
|
801
|
-
`,
|
|
813
|
+
`, wt = s.main`
|
|
802
814
|
position: relative;
|
|
803
815
|
min-width: 0;
|
|
804
816
|
height: 100%;
|
|
805
817
|
overflow: auto; /* 文档渲染区独立滚动 */
|
|
806
|
-
`,
|
|
818
|
+
`, kt = s.div`
|
|
807
819
|
width: 100%;
|
|
808
820
|
max-width: var(--content-max);
|
|
809
821
|
margin: 0 auto;
|
|
@@ -811,16 +823,16 @@ const ee = De("ChevronRight", [
|
|
|
811
823
|
border-radius: 8px;
|
|
812
824
|
padding: 0px 12px;
|
|
813
825
|
padding-bottom: 120px; /* 底部留出足够的 margin,确保可以滚动到最底部 */
|
|
814
|
-
`,
|
|
826
|
+
`, mt = s.div`
|
|
815
827
|
height: 100%;
|
|
816
828
|
transition: opacity .5s ease;
|
|
817
829
|
opacity: ${(e) => e.$opacity};
|
|
818
|
-
`, vt =
|
|
830
|
+
`, vt = s.aside`
|
|
819
831
|
position: relative;
|
|
820
832
|
z-index: 1;
|
|
821
833
|
height: 100%;
|
|
822
834
|
overflow: hidden;
|
|
823
|
-
`,
|
|
835
|
+
`, yt = s.div`
|
|
824
836
|
/* 右侧目录独立滚动 */
|
|
825
837
|
position: relative;
|
|
826
838
|
height: 100%;
|
|
@@ -832,7 +844,7 @@ const ee = De("ChevronRight", [
|
|
|
832
844
|
border-left: 1px solid rgba(0,0,0,0.06);
|
|
833
845
|
background: transparent;
|
|
834
846
|
z-index: 1;
|
|
835
|
-
`,
|
|
847
|
+
`, Ct = s.div`
|
|
836
848
|
transition: opacity .2s ease, transform .2s ease;
|
|
837
849
|
opacity: ${(e) => e.$collapsed ? 0 : 1};
|
|
838
850
|
transform: translateX(${(e) => e.$collapsed ? "6px" : "0px"});
|
|
@@ -841,7 +853,7 @@ const ee = De("ChevronRight", [
|
|
|
841
853
|
max-width: 100%;
|
|
842
854
|
/* 不设置高度限制,让内容自然流动,由父容器 TocFloat 控制滚动 */
|
|
843
855
|
`;
|
|
844
|
-
|
|
856
|
+
s.button`
|
|
845
857
|
position: absolute;
|
|
846
858
|
top: 6px;
|
|
847
859
|
left: -10px;
|
|
@@ -857,11 +869,11 @@ l.button`
|
|
|
857
869
|
transition: background .15s ease;
|
|
858
870
|
&:hover { background: rgba(0,0,0,0.12); }
|
|
859
871
|
`;
|
|
860
|
-
const
|
|
872
|
+
const se = s.div`
|
|
861
873
|
font-size: 12px;
|
|
862
874
|
opacity: .7;
|
|
863
875
|
padding: 8px 8px;
|
|
864
|
-
`, X =
|
|
876
|
+
`, X = s.button`
|
|
865
877
|
width: 100%;
|
|
866
878
|
padding: 8px 10px;
|
|
867
879
|
background: transparent;
|
|
@@ -892,7 +904,7 @@ const le = l.div`
|
|
|
892
904
|
}
|
|
893
905
|
|
|
894
906
|
${(e) => e.$active ? "background: rgba(0,0,0,0.08); font-weight: 600;" : ""}
|
|
895
|
-
`,
|
|
907
|
+
`, $t = s.div`
|
|
896
908
|
display: flex;
|
|
897
909
|
align-items: center;
|
|
898
910
|
gap: 8px;
|
|
@@ -902,16 +914,16 @@ const le = l.div`
|
|
|
902
914
|
overflow-y: hidden;
|
|
903
915
|
scrollbar-width: none;
|
|
904
916
|
&::-webkit-scrollbar { display: none; }
|
|
905
|
-
`,
|
|
917
|
+
`, Bt = s.div`
|
|
906
918
|
width: 1px;
|
|
907
919
|
height: 16px;
|
|
908
920
|
background: currentColor;
|
|
909
921
|
opacity: .2;
|
|
910
|
-
`,
|
|
922
|
+
`, Dt = {
|
|
911
923
|
theme: {
|
|
912
|
-
...
|
|
924
|
+
...z,
|
|
913
925
|
colors: {
|
|
914
|
-
...
|
|
926
|
+
...z.colors,
|
|
915
927
|
appBackground: "#ffffff",
|
|
916
928
|
panelBackground: "#ffffff",
|
|
917
929
|
dashboardBackground: "#ffffff",
|
|
@@ -921,11 +933,11 @@ const le = l.div`
|
|
|
921
933
|
shadow: "0 1px 2px rgba(0,0,0,0.06)"
|
|
922
934
|
}
|
|
923
935
|
}
|
|
924
|
-
},
|
|
936
|
+
}, Nt = {
|
|
925
937
|
theme: {
|
|
926
|
-
...
|
|
938
|
+
...z,
|
|
927
939
|
colors: {
|
|
928
|
-
...
|
|
940
|
+
...z.colors,
|
|
929
941
|
appBackground: "#0f172a",
|
|
930
942
|
panelBackground: "#111827",
|
|
931
943
|
dashboardBackground: "#0b1220",
|
|
@@ -936,93 +948,93 @@ const le = l.div`
|
|
|
936
948
|
}
|
|
937
949
|
},
|
|
938
950
|
mode: "dark"
|
|
939
|
-
},
|
|
940
|
-
var
|
|
951
|
+
}, Rt = (e) => {
|
|
952
|
+
var fe, xe, be, we;
|
|
941
953
|
const {
|
|
942
954
|
children: t,
|
|
943
955
|
headerLogo: o,
|
|
944
956
|
contentKey: d,
|
|
945
957
|
modules: i,
|
|
946
958
|
activeModuleKey: p,
|
|
947
|
-
onModuleChange:
|
|
959
|
+
onModuleChange: N,
|
|
948
960
|
languages: B,
|
|
949
|
-
activeLanguageKey:
|
|
950
|
-
onLanguageChange:
|
|
951
|
-
themes:
|
|
961
|
+
activeLanguageKey: R,
|
|
962
|
+
onLanguageChange: D,
|
|
963
|
+
themes: l,
|
|
952
964
|
activeThemeKey: K,
|
|
953
965
|
onThemeChange: I,
|
|
954
966
|
sidebarItems: c,
|
|
955
|
-
activeSidebarId:
|
|
956
|
-
onSidebarItemClick:
|
|
957
|
-
activeTocId:
|
|
958
|
-
onTocItemClick:
|
|
967
|
+
activeSidebarId: S,
|
|
968
|
+
onSidebarItemClick: A,
|
|
969
|
+
activeTocId: H,
|
|
970
|
+
onTocItemClick: T,
|
|
959
971
|
collapsibleSidebar: Y = !0,
|
|
960
972
|
styles: j
|
|
961
|
-
} = e, P =
|
|
973
|
+
} = e, P = ce(), q = e.activeThemeKey === "dark" ? Nt : Dt, g = G(
|
|
962
974
|
G(
|
|
963
|
-
G({ theme:
|
|
975
|
+
G({ theme: z, mode: "light" }, P),
|
|
964
976
|
q
|
|
965
977
|
),
|
|
966
978
|
j
|
|
967
|
-
), r = (
|
|
979
|
+
), r = (g == null ? void 0 : g.theme) || z, [W, _] = k.useState(!1), [O, re] = k.useState(!1), [w, m] = k.useState(!1), U = typeof H == "string", [he, ie] = k.useState(H), E = k.useRef(null), [J, L] = k.useState(void 0), [Ie, pe] = k.useState(t), [Se, ue] = k.useState(1);
|
|
968
980
|
k.useEffect(() => {
|
|
969
981
|
if (d === void 0) {
|
|
970
|
-
|
|
982
|
+
pe(t);
|
|
971
983
|
return;
|
|
972
984
|
}
|
|
973
|
-
|
|
985
|
+
ue(0);
|
|
974
986
|
const a = setTimeout(() => {
|
|
975
|
-
|
|
987
|
+
pe(t), requestAnimationFrame(() => ue(1));
|
|
976
988
|
}, 120);
|
|
977
989
|
return () => clearTimeout(a);
|
|
978
990
|
}, [d, t]), k.useMemo(() => {
|
|
979
|
-
var a, f,
|
|
991
|
+
var a, f, u, y, $, h, v, x, V, C, M, Z, Q;
|
|
980
992
|
return {
|
|
981
993
|
primaryColor: (a = r == null ? void 0 : r.colors) == null ? void 0 : a.primary,
|
|
982
994
|
secondaryColor: (f = r == null ? void 0 : r.colors) == null ? void 0 : f.secondary,
|
|
983
|
-
backgroundColor: (
|
|
995
|
+
backgroundColor: (u = r == null ? void 0 : r.colors) == null ? void 0 : u.appBackground,
|
|
984
996
|
textColor: (y = r == null ? void 0 : r.colors) == null ? void 0 : y.text,
|
|
985
997
|
borderColor: ($ = r == null ? void 0 : r.colors) == null ? void 0 : $.border,
|
|
986
998
|
disabledBackground: (h = r == null ? void 0 : r.colors) == null ? void 0 : h.disabledBackground,
|
|
987
|
-
borderRadius: (
|
|
999
|
+
borderRadius: (v = r == null ? void 0 : r.space) == null ? void 0 : v.radius,
|
|
988
1000
|
padding: (x = r == null ? void 0 : r.space) == null ? void 0 : x.padding,
|
|
989
|
-
margin: (
|
|
1001
|
+
margin: (V = r == null ? void 0 : r.space) == null ? void 0 : V.margin,
|
|
990
1002
|
baseFontSize: (M = (C = r == null ? void 0 : r.fonts) == null ? void 0 : C.body) != null && M.size ? parseInt((Q = (Z = r == null ? void 0 : r.fonts) == null ? void 0 : Z.body) == null ? void 0 : Q.size, 10) : void 0
|
|
991
1003
|
};
|
|
992
1004
|
}, [r]), k.useEffect(() => {
|
|
993
1005
|
if (e.tocItems)
|
|
994
|
-
|
|
1006
|
+
L(void 0);
|
|
995
1007
|
else {
|
|
996
|
-
d !== void 0 &&
|
|
1008
|
+
d !== void 0 && L(void 0);
|
|
997
1009
|
let a = 0;
|
|
998
1010
|
const f = 10;
|
|
999
|
-
let
|
|
1011
|
+
let u = null, y = null;
|
|
1000
1012
|
const $ = () => {
|
|
1001
|
-
const h =
|
|
1013
|
+
const h = E.current;
|
|
1002
1014
|
if (!h) {
|
|
1003
|
-
a < f ? (a++,
|
|
1015
|
+
a < f ? (a++, u = setTimeout($, 200)) : L([]);
|
|
1004
1016
|
return;
|
|
1005
1017
|
}
|
|
1006
|
-
const
|
|
1007
|
-
if (
|
|
1008
|
-
a < f ? (a++,
|
|
1018
|
+
const v = Array.from(h.querySelectorAll("h1, h2, h3"));
|
|
1019
|
+
if (v.length === 0) {
|
|
1020
|
+
a < f ? (a++, u = setTimeout($, 200)) : L([]);
|
|
1009
1021
|
return;
|
|
1010
1022
|
}
|
|
1011
|
-
const x = /* @__PURE__ */ new Map(),
|
|
1012
|
-
var
|
|
1013
|
-
const M = C.id || ((
|
|
1023
|
+
const x = /* @__PURE__ */ new Map(), V = v.map((C) => {
|
|
1024
|
+
var ke;
|
|
1025
|
+
const M = C.id || ((ke = C.textContent) == null ? void 0 : ke.trim().replace(/\s+/g, "-").toLowerCase()) || "", Z = x.get(M) || 0;
|
|
1014
1026
|
x.set(M, Z + 1);
|
|
1015
1027
|
const Q = Z > 0 ? `${M}-${Z}` : M;
|
|
1016
1028
|
C.id || (C.id = Q);
|
|
1017
|
-
const
|
|
1018
|
-
return { id: Q, label: C.textContent || "", level:
|
|
1029
|
+
const Ae = C.tagName === "H1" ? 1 : C.tagName === "H2" ? 2 : 3;
|
|
1030
|
+
return { id: Q, label: C.textContent || "", level: Ae };
|
|
1019
1031
|
});
|
|
1020
|
-
|
|
1032
|
+
L(V);
|
|
1021
1033
|
};
|
|
1022
1034
|
return y = requestAnimationFrame(() => {
|
|
1023
|
-
|
|
1035
|
+
u = setTimeout($, 100);
|
|
1024
1036
|
}), () => {
|
|
1025
|
-
y !== null && cancelAnimationFrame(y),
|
|
1037
|
+
y !== null && cancelAnimationFrame(y), u !== null && clearTimeout(u);
|
|
1026
1038
|
};
|
|
1027
1039
|
}
|
|
1028
1040
|
}, [t, e.tocItems, d]), k.useEffect(() => {
|
|
@@ -1030,64 +1042,64 @@ const le = l.div`
|
|
|
1030
1042
|
const f = ((e.tocItems ?? J) || []).map((h) => h.id).filter(Boolean);
|
|
1031
1043
|
if (f.length === 0) return;
|
|
1032
1044
|
ie(void 0);
|
|
1033
|
-
const
|
|
1034
|
-
var x,
|
|
1035
|
-
const
|
|
1036
|
-
(
|
|
1037
|
-
}, $ = new IntersectionObserver(y,
|
|
1045
|
+
const u = { root: null, rootMargin: "0px 0px -70% 0px", threshold: 0 }, y = (h) => {
|
|
1046
|
+
var x, V;
|
|
1047
|
+
const v = h.filter((C) => C.isIntersecting).sort((C, M) => C.boundingClientRect.top - M.boundingClientRect.top);
|
|
1048
|
+
(V = (x = v[0]) == null ? void 0 : x.target) != null && V.id && ie(v[0].target.id);
|
|
1049
|
+
}, $ = new IntersectionObserver(y, u);
|
|
1038
1050
|
return f.forEach((h) => {
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1051
|
+
const v = document.getElementById(h);
|
|
1052
|
+
v && $.observe(v);
|
|
1041
1053
|
}), () => $.disconnect();
|
|
1042
1054
|
}, [J, U, e.tocItems, d]);
|
|
1043
1055
|
const ge = (a, f) => {
|
|
1044
1056
|
if (!a || a.length === 0) return;
|
|
1045
|
-
const
|
|
1057
|
+
const u = Math.max(0, a.findIndex(($) => $.key === f)), y = a[(u + 1) % a.length];
|
|
1046
1058
|
return y == null ? void 0 : y.key;
|
|
1047
1059
|
}, ae = (a) => {
|
|
1048
1060
|
const f = document.getElementById(a);
|
|
1049
1061
|
f && f.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" });
|
|
1050
1062
|
};
|
|
1051
|
-
return /* @__PURE__ */ n(
|
|
1052
|
-
|
|
1063
|
+
return /* @__PURE__ */ n(Te, { theme: r, mode: g.mode, children: /* @__PURE__ */ b(
|
|
1064
|
+
dt,
|
|
1053
1065
|
{
|
|
1054
1066
|
style: {
|
|
1055
1067
|
background: r.colors.appBackground,
|
|
1056
1068
|
color: r.colors.text,
|
|
1057
|
-
fontFamily: ((
|
|
1069
|
+
fontFamily: ((xe = (fe = r.fonts) == null ? void 0 : fe.body) == null ? void 0 : xe.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
|
|
1058
1070
|
},
|
|
1059
1071
|
children: [
|
|
1060
1072
|
/* @__PURE__ */ b(
|
|
1061
|
-
|
|
1073
|
+
ct,
|
|
1062
1074
|
{
|
|
1063
1075
|
style: {
|
|
1064
1076
|
background: r.colors.panelBackground || r.colors.dashboardBackground || "rgba(255,255,255,0.6)",
|
|
1065
1077
|
color: r.colors.text
|
|
1066
1078
|
},
|
|
1067
1079
|
children: [
|
|
1068
|
-
/* @__PURE__ */ b(
|
|
1080
|
+
/* @__PURE__ */ b(ht, { children: [
|
|
1069
1081
|
o,
|
|
1070
|
-
i && i.length > 0 && /* @__PURE__ */ n(
|
|
1082
|
+
i && i.length > 0 && /* @__PURE__ */ n($t, { children: i.map((a) => /* @__PURE__ */ n(
|
|
1071
1083
|
X,
|
|
1072
1084
|
{
|
|
1073
1085
|
$active: a.key === p,
|
|
1074
|
-
onClick: () =>
|
|
1086
|
+
onClick: () => N == null ? void 0 : N(a.key),
|
|
1075
1087
|
title: a.label,
|
|
1076
1088
|
children: a.label
|
|
1077
1089
|
},
|
|
1078
1090
|
a.key
|
|
1079
1091
|
)) })
|
|
1080
1092
|
] }),
|
|
1081
|
-
/* @__PURE__ */ b(
|
|
1093
|
+
/* @__PURE__ */ b(pt, { children: [
|
|
1082
1094
|
/* @__PURE__ */ n("div", { className: "hide-on-desktop", style: { display: "none" } }),
|
|
1083
1095
|
B && B.length > 0 && /* @__PURE__ */ n(
|
|
1084
|
-
|
|
1096
|
+
ye,
|
|
1085
1097
|
{
|
|
1086
1098
|
onClick: () => {
|
|
1087
|
-
const a = ge(B,
|
|
1088
|
-
a && (
|
|
1099
|
+
const a = ge(B, R);
|
|
1100
|
+
a && (D == null || D(a));
|
|
1089
1101
|
},
|
|
1090
|
-
title: ((
|
|
1102
|
+
title: ((be = B.find((a) => a.key === R)) == null ? void 0 : be.label) || "Language",
|
|
1091
1103
|
"aria-label": "language",
|
|
1092
1104
|
style: { color: r.colors.text },
|
|
1093
1105
|
children: /* @__PURE__ */ b("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
@@ -1096,42 +1108,42 @@ const le = l.div`
|
|
|
1096
1108
|
] })
|
|
1097
1109
|
}
|
|
1098
1110
|
),
|
|
1099
|
-
/* @__PURE__ */ n(
|
|
1100
|
-
|
|
1101
|
-
|
|
1111
|
+
/* @__PURE__ */ n(Bt, {}),
|
|
1112
|
+
l && l.length > 0 && /* @__PURE__ */ n(
|
|
1113
|
+
ye,
|
|
1102
1114
|
{
|
|
1103
1115
|
onClick: () => {
|
|
1104
|
-
const a = ge(
|
|
1116
|
+
const a = ge(l, K);
|
|
1105
1117
|
a && (I == null || I(a));
|
|
1106
1118
|
},
|
|
1107
|
-
title: ((
|
|
1119
|
+
title: ((we = l.find((a) => a.key === K)) == null ? void 0 : we.label) || "Theme",
|
|
1108
1120
|
"aria-label": "theme",
|
|
1109
1121
|
style: { color: r.colors.text },
|
|
1110
1122
|
children: /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ n("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" }) })
|
|
1111
1123
|
}
|
|
1112
1124
|
),
|
|
1113
|
-
/* @__PURE__ */ n("div", { className: "mobile-only", style: { display: "none" }, children: /* @__PURE__ */ n(X, { onClick: () =>
|
|
1125
|
+
/* @__PURE__ */ n("div", { className: "mobile-only", style: { display: "none" }, children: /* @__PURE__ */ n(X, { onClick: () => m(!0), title: "\u6253\u5F00\u76EE\u5F55", children: "\u76EE\u5F55" }) })
|
|
1114
1126
|
] })
|
|
1115
1127
|
]
|
|
1116
1128
|
}
|
|
1117
1129
|
),
|
|
1118
1130
|
(() => {
|
|
1119
|
-
const f = (Array.isArray(c) ? c.length : 0) > 1,
|
|
1120
|
-
return /* @__PURE__ */ b(
|
|
1131
|
+
const f = (Array.isArray(c) ? c.length : 0) > 1, u = f ? W ? "10px" : "var(--sidebar-width)" : "0px", y = O ? "10px" : "var(--toc-width)", $ = f ? `${u} 1fr ${y}` : `1fr ${y}`;
|
|
1132
|
+
return /* @__PURE__ */ b(ut, { style: { gridTemplateColumns: $ }, children: [
|
|
1121
1133
|
f && /* @__PURE__ */ b(gt, { children: [
|
|
1122
|
-
/* @__PURE__ */ n(
|
|
1123
|
-
c.reduce((h,
|
|
1124
|
-
const x =
|
|
1125
|
-
return h[x] = h[x] || [], h[x].push(
|
|
1134
|
+
/* @__PURE__ */ n(ft, { $collapsed: W, children: /* @__PURE__ */ n(bt, { children: c && c.length > 0 && /* @__PURE__ */ n("div", { children: Object.entries(
|
|
1135
|
+
c.reduce((h, v) => {
|
|
1136
|
+
const x = v.group || "\u6587\u6863";
|
|
1137
|
+
return h[x] = h[x] || [], h[x].push(v), h;
|
|
1126
1138
|
}, {})
|
|
1127
|
-
).map(([h,
|
|
1128
|
-
/* @__PURE__ */ n(
|
|
1129
|
-
/* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children:
|
|
1139
|
+
).map(([h, v]) => /* @__PURE__ */ b("div", { children: [
|
|
1140
|
+
/* @__PURE__ */ n(se, { children: h }),
|
|
1141
|
+
/* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: v.map((x) => /* @__PURE__ */ n(
|
|
1130
1142
|
X,
|
|
1131
1143
|
{
|
|
1132
|
-
$active: x.id ===
|
|
1144
|
+
$active: x.id === S,
|
|
1133
1145
|
onClick: () => {
|
|
1134
|
-
x.href && (x.href.startsWith("#") ? ae(x.href.slice(1)) : window.location.href = x.href),
|
|
1146
|
+
x.href && (x.href.startsWith("#") ? ae(x.href.slice(1)) : window.location.href = x.href), A == null || A(x), m(!1);
|
|
1135
1147
|
},
|
|
1136
1148
|
title: x.label,
|
|
1137
1149
|
children: x.label
|
|
@@ -1139,23 +1151,23 @@ const le = l.div`
|
|
|
1139
1151
|
x.id
|
|
1140
1152
|
)) })
|
|
1141
1153
|
] }, h)) }) }) }),
|
|
1142
|
-
Y && f && /* @__PURE__ */ n(
|
|
1154
|
+
Y && f && /* @__PURE__ */ n(xt, { onClick: () => _((h) => !h), title: W ? "\u5C55\u5F00\u5DE6\u4FA7\u680F" : "\u6536\u8D77\u5DE6\u4FA7\u680F", "aria-label": "toggle-left", children: W ? /* @__PURE__ */ n("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6", stroke: "currentColor", strokeWidth: "1.6" }) }) : /* @__PURE__ */ n("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ n("path", { d: "M15 6l-6 6 6 6", stroke: "currentColor", strokeWidth: "1.6" }) }) })
|
|
1143
1155
|
] }),
|
|
1144
|
-
/* @__PURE__ */ n(
|
|
1145
|
-
|
|
1156
|
+
/* @__PURE__ */ n(wt, { children: /* @__PURE__ */ n(
|
|
1157
|
+
kt,
|
|
1146
1158
|
{
|
|
1147
|
-
ref:
|
|
1148
|
-
children: /* @__PURE__ */ n(
|
|
1159
|
+
ref: E,
|
|
1160
|
+
children: /* @__PURE__ */ n(mt, { $opacity: Se, children: Ie })
|
|
1149
1161
|
}
|
|
1150
1162
|
) }),
|
|
1151
|
-
/* @__PURE__ */ n(vt, { children: /* @__PURE__ */ n(
|
|
1152
|
-
/* @__PURE__ */ n(
|
|
1163
|
+
/* @__PURE__ */ n(vt, { children: /* @__PURE__ */ n(yt, { children: /* @__PURE__ */ b(Ct, { $collapsed: O, children: [
|
|
1164
|
+
/* @__PURE__ */ n(se, { children: "\u672C\u9875\u76EE\u5F55" }),
|
|
1153
1165
|
/* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px", width: "100%", maxWidth: "100%", overflow: "hidden" }, children: ((e.tocItems ?? J) || []).map((h) => /* @__PURE__ */ n(
|
|
1154
1166
|
X,
|
|
1155
1167
|
{
|
|
1156
|
-
$active: (U ?
|
|
1168
|
+
$active: (U ? H : he) === h.id,
|
|
1157
1169
|
onClick: () => {
|
|
1158
|
-
ae(h.id),
|
|
1170
|
+
ae(h.id), T == null || T(h);
|
|
1159
1171
|
},
|
|
1160
1172
|
title: h.label,
|
|
1161
1173
|
style: { paddingLeft: Math.max(0, (h.level || 1) - 1) * 12 + 10 },
|
|
@@ -1178,7 +1190,7 @@ const le = l.div`
|
|
|
1178
1190
|
background: "rgba(0,0,0,0.45)",
|
|
1179
1191
|
display: "flex"
|
|
1180
1192
|
},
|
|
1181
|
-
onClick: () =>
|
|
1193
|
+
onClick: () => m(!1),
|
|
1182
1194
|
children: /* @__PURE__ */ b(
|
|
1183
1195
|
"div",
|
|
1184
1196
|
{
|
|
@@ -1195,25 +1207,25 @@ const le = l.div`
|
|
|
1195
1207
|
children: [
|
|
1196
1208
|
/* @__PURE__ */ b("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
|
|
1197
1209
|
/* @__PURE__ */ n("div", { style: { fontWeight: 600 }, children: "\u76EE\u5F55" }),
|
|
1198
|
-
/* @__PURE__ */ n(X, { onClick: () =>
|
|
1210
|
+
/* @__PURE__ */ n(X, { onClick: () => m(!1), children: "\u5173\u95ED" })
|
|
1199
1211
|
] }),
|
|
1200
1212
|
c && c.length > 0 && /* @__PURE__ */ n("div", { style: { overflow: "auto", height: "calc(100% - 40px)" }, children: Object.entries(
|
|
1201
1213
|
c.reduce((a, f) => {
|
|
1202
|
-
const
|
|
1203
|
-
return a[
|
|
1214
|
+
const u = f.group || "\u6587\u6863";
|
|
1215
|
+
return a[u] = a[u] || [], a[u].push(f), a;
|
|
1204
1216
|
}, {})
|
|
1205
1217
|
).map(([a, f]) => /* @__PURE__ */ b("div", { children: [
|
|
1206
|
-
/* @__PURE__ */ n(
|
|
1207
|
-
/* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: f.map((
|
|
1218
|
+
/* @__PURE__ */ n(se, { children: a }),
|
|
1219
|
+
/* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: f.map((u) => /* @__PURE__ */ n(
|
|
1208
1220
|
X,
|
|
1209
1221
|
{
|
|
1210
|
-
$active:
|
|
1222
|
+
$active: u.id === S,
|
|
1211
1223
|
onClick: () => {
|
|
1212
|
-
|
|
1224
|
+
u.href && (u.href.startsWith("#") ? ae(u.href.slice(1)) : window.location.href = u.href), A == null || A(u), m(!1);
|
|
1213
1225
|
},
|
|
1214
|
-
children:
|
|
1226
|
+
children: u.label
|
|
1215
1227
|
},
|
|
1216
|
-
|
|
1228
|
+
u.id
|
|
1217
1229
|
)) })
|
|
1218
1230
|
] }, a)) })
|
|
1219
1231
|
]
|
|
@@ -1226,7 +1238,7 @@ const le = l.div`
|
|
|
1226
1238
|
) });
|
|
1227
1239
|
};
|
|
1228
1240
|
export {
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1241
|
+
zt as DashboardContainer,
|
|
1242
|
+
Mt as DockContainer,
|
|
1243
|
+
Rt as DocumentContainer
|
|
1232
1244
|
};
|