@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.
Files changed (2) hide show
  1. package/index.js +275 -263
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as n, jsxs as b, Fragment as ye } from "react/jsx-runtime";
2
- import * as T from "react";
3
- import k, { forwardRef as Ce, createElement as se } from "react";
4
- import l from "styled-components";
5
- import { useTheme as de, deepMergeTheme as G, defaultTheme as F, ThemeProvider as Ae } from "@mxmweb/zui-theme";
6
- import { GoogleNavbar as Te, CustomDock as Fe } from "@mxmweb/zui-components";
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 ze = /* @__PURE__ */ T.createContext(null);
18
- process.env.NODE_ENV !== "production" && (ze.displayName = "DataRouter");
19
- const Me = /* @__PURE__ */ T.createContext(null);
20
- process.env.NODE_ENV !== "production" && (Me.displayName = "DataRouterState");
21
- const Re = /* @__PURE__ */ T.createContext(null);
22
- process.env.NODE_ENV !== "production" && (Re.displayName = "Await");
23
- const We = /* @__PURE__ */ T.createContext(null);
24
- process.env.NODE_ENV !== "production" && (We.displayName = "Navigation");
25
- const Oe = /* @__PURE__ */ T.createContext(null);
26
- process.env.NODE_ENV !== "production" && (Oe.displayName = "Location");
27
- const $e = /* @__PURE__ */ T.createContext({
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" && ($e.displayName = "Route");
33
- const He = /* @__PURE__ */ T.createContext(null);
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 Le = /* @__PURE__ */ T.createContext(null);
36
- function je(e) {
37
- let t = T.useContext($e).outlet;
38
- return t && /* @__PURE__ */ T.createElement(Le.Provider, {
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 Pe(e) {
43
- return je(e.context);
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(), Be = (...e) => e.filter((t, o, d) => !!t && t.trim() !== "" && d.indexOf(t) === o).join(" ").trim();
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 _e = Ce(
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: D,
85
+ iconNode: N,
86
86
  ...B
87
- }, H) => se(
87
+ }, R) => de(
88
88
  "svg",
89
89
  {
90
- ref: H,
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: Be("lucide", i),
96
+ className: De("lucide", i),
97
97
  ...B
98
98
  },
99
99
  [
100
- ...D.map(([z, s]) => se(z, s)),
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 De = (e, t) => {
112
- const o = Ce(
113
- ({ className: d, ...i }, p) => se(_e, {
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: Be(`lucide-${Ee(e)}`, d),
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 Ge = De("ArrowLeft", [
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 = De("ChevronRight", [
138
+ const ee = Ne("ChevronRight", [
139
139
  ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
140
- ]), Ke = l.div.attrs({
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
- `, Ye = l.div.attrs({
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
- `, qe = l.button.attrs({
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
- `, Ze = l.div.attrs({
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
- `, Xe = l.div.attrs({
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
- `, ke = l.div.attrs({
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 = l.div.attrs({
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 = l.div.attrs({
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
- `, Je = l.div.attrs({
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, B;
345
- const t = ((D = e.space) == null ? void 0 : D.dashboardHeaderHeight) ?? "38px", d = (((B = e.space) == null ? void 0 : B.dashboardHeaderPadding) ?? "0 0 8px 0").trim().split(/\s+/);
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
- return 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), t === "auto" ? `calc(100% - ${i} - ${p} - 10px)` : `calc(100% - ${t} - ${i} - ${p} - 10px)`;
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
- `, Qe = l.div.attrs({
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
- `, Ue = l.div.attrs({
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
- `, et = l.div.attrs({
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
- `, Ft = ({
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: D = "single",
416
+ dockActiveMode: N = "single",
405
417
  defaultDockActiveId: B,
406
- defaultDockActiveIds: H,
407
- styles: z,
408
- eventsEmit: s
418
+ defaultDockActiveIds: R,
419
+ styles: D,
420
+ eventsEmit: l
409
421
  }) => {
410
- const K = de(), I = G(
422
+ const K = ce(), I = G(
411
423
  // 基础:默认主题 + useTheme的配置
412
- G({ theme: F, mode: "light" }, K),
424
+ G({ theme: z, mode: "light" }, K),
413
425
  // 最高层:用户手动传入的styles
414
- z
415
- ), c = (I == null ? void 0 : I.theme) || F, N = k.useRef(null), S = () => {
416
- s != null && s.onGoBack ? s.onGoBack() : t && t();
417
- }, L = () => {
418
- s != null && s.onTitleClick && s.onTitleClick();
419
- }, A = (u, r) => {
420
- s != null && s.onBreadcrumbClick ? s.onBreadcrumbClick(u, r) : u.onClick && u.onClick();
421
- }, Y = (u, r) => {
422
- s != null && s.onDockItemClick && s.onDockItemClick(u, r);
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 [u, r] = k.useState({ start: 0, end: i.length, showEllipsis: !1 }), R = k.useCallback(() => {
426
- if (!N.current || i.length <= 3) {
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 v = N.current.offsetWidth * 0.5;
431
- let V = Math.floor((v - 30) / (120 + 20));
432
- if (V < 2 && (V = 2), V >= i.length) {
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, O = Math.min(V - 1, i.length);
448
+ const J = 0, L = Math.min(E - 1, i.length);
437
449
  r({
438
450
  start: J,
439
- end: O,
440
- showEllipsis: O < i.length - 1
451
+ end: L,
452
+ showEllipsis: L < i.length - 1
441
453
  });
442
454
  }, [i.length]);
443
455
  if (k.useEffect(() => {
444
- R();
456
+ W();
445
457
  const w = new ResizeObserver(() => {
446
- R();
458
+ W();
447
459
  });
448
- return N.current && w.observe(N.current), () => {
460
+ return S.current && w.observe(S.current), () => {
449
461
  w.disconnect();
450
462
  };
451
- }, [R]), i.length <= 3)
452
- return /* @__PURE__ */ n(ke, { theme: c, children: i.map((w, v) => /* @__PURE__ */ b(k.Fragment, { children: [
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: v === i.length - 1,
457
- $isClickable: !!(v < i.length - 1 || w.onClick),
458
- onClick: () => A(w, v),
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
- v < i.length - 1 && /* @__PURE__ */ n(oe, { theme: c, children: /* @__PURE__ */ n(ee, { size: 14 }) })
476
+ m < i.length - 1 && /* @__PURE__ */ n(oe, { theme: c, children: /* @__PURE__ */ n(ee, { size: 14 }) })
465
477
  ] }, w.id)) });
466
- const { start: E, end: W, showEllipsis: re } = u;
467
- return /* @__PURE__ */ b(ke, { theme: c, children: [
468
- i.slice(E, W).map((w, v) => /* @__PURE__ */ b(k.Fragment, { children: [
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: v === W - E - 1 && !re,
473
- $isClickable: !!(v < W - E - 1 || w.onClick),
474
- onClick: () => A(w, E + v),
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
- v < W - E - 1 && /* @__PURE__ */ n(oe, { theme: c, children: /* @__PURE__ */ n(ee, { size: 14 }) })
492
+ m < O - _ - 1 && /* @__PURE__ */ n(oe, { theme: c, children: /* @__PURE__ */ n(ee, { size: 14 }) })
481
493
  ] }, w.id)),
482
- re && /* @__PURE__ */ b(ye, { children: [
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(W, -1).map((w) => w.label).join(" > ")}`,
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: () => A(i[i.length - 1], i.length - 1),
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(Ke, { theme: c, children: /* @__PURE__ */ b(et, { theme: c, children: [
514
- p && p.length > 0 && /* @__PURE__ */ n(Qe, { $isOpen: P, theme: c, children: /* @__PURE__ */ n(
515
- Te,
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: (u) => Y({ id: String(u.key), label: u.name }, 0),
532
+ onItemClick: (g) => Y({ id: String(g.key), label: g.name }, 0),
521
533
  defaultOpen: !0
522
534
  }
523
535
  ) }),
524
- /* @__PURE__ */ b(Ue, { theme: c, children: [
525
- (o || d || t || i) && /* @__PURE__ */ b(Ye, { ref: N, theme: c, children: [
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
- qe,
539
+ Ze,
528
540
  {
529
- onClick: S,
541
+ onClick: A,
530
542
  theme: c,
531
543
  title: "\u8FD4\u56DE",
532
- children: /* @__PURE__ */ n(Ge, { size: 18 })
544
+ children: /* @__PURE__ */ n(Ke, { size: 18 })
533
545
  }
534
546
  ),
535
547
  j(),
536
548
  o && /* @__PURE__ */ n(
537
- Ze,
549
+ Xe,
538
550
  {
539
- onClick: L,
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
- Xe,
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(Je, { theme: c, children: e || /* @__PURE__ */ n(Pe, {}) })
566
+ /* @__PURE__ */ n(Qe, { theme: c, children: e || /* @__PURE__ */ n(_e, {}) })
555
567
  ] })
556
568
  ] }) });
557
- }, tt = l.div.withConfig({
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
- `, ot = l.div.attrs({ className: "dock-container-main-area" })`
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
- `, nt = l.div`
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
- `, rt = l.div`
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, it = 48, at = it + ne * 2, ve = at + ne * 2, lt = l.div.withConfig({
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
- `, zt = ({
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: D = "single",
652
+ dockActiveMode: N = "single",
641
653
  defaultDockActiveId: B,
642
- defaultDockActiveIds: H,
643
- styles: z,
644
- eventsEmit: s
654
+ defaultDockActiveIds: R,
655
+ styles: D,
656
+ eventsEmit: l
645
657
  }) => {
646
658
  var P, q;
647
- const K = de(), I = G(
659
+ const K = ce(), I = G(
648
660
  // 基础:默认主题 + useTheme的配置
649
- G({ theme: F, mode: "light" }, K),
661
+ G({ theme: z, mode: "light" }, K),
650
662
  // 最高层:用户手动传入的styles
651
- z
652
- ), c = (I == null ? void 0 : I.theme) || F, N = (u, r) => {
653
- s != null && s.onDockItemClick ? s.onDockItemClick(u, r) : u.onClick && u.onClick();
654
- }, S = (u, r) => {
655
- s != null && s.onDockActiveChange && s.onDockActiveChange(u, r);
656
- }, L = (u, r) => {
657
- s != null && s.onDockActiveChangeMultiple && s.onDockActiveChangeMultiple(u, r);
658
- }, A = p === "left" || p === "right", Y = /* @__PURE__ */ b(ye, { children: [
659
- d && /* @__PURE__ */ n(nt, { children: d }),
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
- rt,
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(lt, { dockPosition: p, children: /* @__PURE__ */ n(
671
- Fe,
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: A ? "vertical" : "horizontal",
690
+ direction: T ? "vertical" : "horizontal",
679
691
  dockPosition: p,
680
- activeMode: D,
692
+ activeMode: N,
681
693
  defaultActiveId: B,
682
- defaultActiveIds: H,
683
- onItemClick: N,
684
- onActiveChange: S,
685
- onActiveChangeMultiple: L
694
+ defaultActiveIds: R,
695
+ onItemClick: S,
696
+ onActiveChange: A,
697
+ onActiveChangeMultiple: H
686
698
  }
687
699
  ) });
688
700
  return /* @__PURE__ */ b(
689
- tt,
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
- A ? /* @__PURE__ */ n(ot, { children: Y }) : Y,
709
+ T ? /* @__PURE__ */ n(nt, { children: Y }) : Y,
698
710
  (p === "bottom" || p === "right") && j
699
711
  ]
700
712
  }
701
713
  );
702
- }, st = l.div`
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
- `, dt = l.div`
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
- `, ct = l.div`
739
+ `, ht = s.div`
728
740
  display: flex;
729
741
  align-items: center;
730
742
  gap: 12px;
731
743
  min-width: 0;
732
- `, ht = l.div`
744
+ `, pt = s.div`
733
745
  display: flex;
734
746
  align-items: center;
735
747
  gap: 8px;
736
- `, me = l.button`
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
- `, pt = l.div`
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 = l.aside`
783
+ `, gt = s.aside`
772
784
  position: relative;
773
- `, ut = l.div`
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
- `, ft = l.button`
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
- `, xt = l.div`
809
+ `, bt = s.div`
798
810
  height: 100%;
799
811
  overflow: auto;
800
812
  padding-right: 8px;
801
- `, bt = l.main`
813
+ `, wt = s.main`
802
814
  position: relative;
803
815
  min-width: 0;
804
816
  height: 100%;
805
817
  overflow: auto; /* 文档渲染区独立滚动 */
806
- `, wt = l.div`
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
- `, kt = l.div`
826
+ `, mt = s.div`
815
827
  height: 100%;
816
828
  transition: opacity .5s ease;
817
829
  opacity: ${(e) => e.$opacity};
818
- `, vt = l.aside`
830
+ `, vt = s.aside`
819
831
  position: relative;
820
832
  z-index: 1;
821
833
  height: 100%;
822
834
  overflow: hidden;
823
- `, mt = l.div`
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
- `, yt = l.div`
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
- l.button`
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 le = l.div`
872
+ const se = s.div`
861
873
  font-size: 12px;
862
874
  opacity: .7;
863
875
  padding: 8px 8px;
864
- `, X = l.button`
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
- `, Ct = l.div`
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
- `, $t = l.div`
917
+ `, Bt = s.div`
906
918
  width: 1px;
907
919
  height: 16px;
908
920
  background: currentColor;
909
921
  opacity: .2;
910
- `, Bt = {
922
+ `, Dt = {
911
923
  theme: {
912
- ...F,
924
+ ...z,
913
925
  colors: {
914
- ...F.colors,
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
- }, Dt = {
936
+ }, Nt = {
925
937
  theme: {
926
- ...F,
938
+ ...z,
927
939
  colors: {
928
- ...F.colors,
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
- }, Mt = (e) => {
940
- var ue, fe, xe, be;
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: D,
959
+ onModuleChange: N,
948
960
  languages: B,
949
- activeLanguageKey: H,
950
- onLanguageChange: z,
951
- themes: s,
961
+ activeLanguageKey: R,
962
+ onLanguageChange: D,
963
+ themes: l,
952
964
  activeThemeKey: K,
953
965
  onThemeChange: I,
954
966
  sidebarItems: c,
955
- activeSidebarId: N,
956
- onSidebarItemClick: S,
957
- activeTocId: L,
958
- onTocItemClick: A,
967
+ activeSidebarId: S,
968
+ onSidebarItemClick: A,
969
+ activeTocId: H,
970
+ onTocItemClick: T,
959
971
  collapsibleSidebar: Y = !0,
960
972
  styles: j
961
- } = e, P = de(), q = e.activeThemeKey === "dark" ? Dt : Bt, u = G(
973
+ } = e, P = ce(), q = e.activeThemeKey === "dark" ? Nt : Dt, g = G(
962
974
  G(
963
- G({ theme: F, mode: "light" }, P),
975
+ G({ theme: z, mode: "light" }, P),
964
976
  q
965
977
  ),
966
978
  j
967
- ), r = (u == null ? void 0 : u.theme) || F, [R, E] = k.useState(!1), [W, re] = k.useState(!1), [w, v] = k.useState(!1), U = typeof L == "string", [ce, ie] = k.useState(L), V = k.useRef(null), [J, O] = k.useState(void 0), [Ie, he] = k.useState(t), [Ne, pe] = k.useState(1);
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
- he(t);
982
+ pe(t);
971
983
  return;
972
984
  }
973
- pe(0);
985
+ ue(0);
974
986
  const a = setTimeout(() => {
975
- he(t), requestAnimationFrame(() => pe(1));
987
+ pe(t), requestAnimationFrame(() => ue(1));
976
988
  }, 120);
977
989
  return () => clearTimeout(a);
978
990
  }, [d, t]), k.useMemo(() => {
979
- var a, f, g, y, $, h, m, x, _, C, M, Z, Q;
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: (g = r == null ? void 0 : r.colors) == null ? void 0 : g.appBackground,
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: (m = r == null ? void 0 : r.space) == null ? void 0 : m.radius,
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: (_ = r == null ? void 0 : r.space) == null ? void 0 : _.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
- O(void 0);
1006
+ L(void 0);
995
1007
  else {
996
- d !== void 0 && O(void 0);
1008
+ d !== void 0 && L(void 0);
997
1009
  let a = 0;
998
1010
  const f = 10;
999
- let g = null, y = null;
1011
+ let u = null, y = null;
1000
1012
  const $ = () => {
1001
- const h = V.current;
1013
+ const h = E.current;
1002
1014
  if (!h) {
1003
- a < f ? (a++, g = setTimeout($, 200)) : O([]);
1015
+ a < f ? (a++, u = setTimeout($, 200)) : L([]);
1004
1016
  return;
1005
1017
  }
1006
- const m = Array.from(h.querySelectorAll("h1, h2, h3"));
1007
- if (m.length === 0) {
1008
- a < f ? (a++, g = setTimeout($, 200)) : O([]);
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(), _ = m.map((C) => {
1012
- var we;
1013
- const M = C.id || ((we = C.textContent) == null ? void 0 : we.trim().replace(/\s+/g, "-").toLowerCase()) || "", Z = x.get(M) || 0;
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 Se = C.tagName === "H1" ? 1 : C.tagName === "H2" ? 2 : 3;
1018
- return { id: Q, label: C.textContent || "", level: Se };
1029
+ const Ae = C.tagName === "H1" ? 1 : C.tagName === "H2" ? 2 : 3;
1030
+ return { id: Q, label: C.textContent || "", level: Ae };
1019
1031
  });
1020
- O(_);
1032
+ L(V);
1021
1033
  };
1022
1034
  return y = requestAnimationFrame(() => {
1023
- g = setTimeout($, 100);
1035
+ u = setTimeout($, 100);
1024
1036
  }), () => {
1025
- y !== null && cancelAnimationFrame(y), g !== null && clearTimeout(g);
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 g = { root: null, rootMargin: "0px 0px -70% 0px", threshold: 0 }, y = (h) => {
1034
- var x, _;
1035
- const m = h.filter((C) => C.isIntersecting).sort((C, M) => C.boundingClientRect.top - M.boundingClientRect.top);
1036
- (_ = (x = m[0]) == null ? void 0 : x.target) != null && _.id && ie(m[0].target.id);
1037
- }, $ = new IntersectionObserver(y, g);
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 m = document.getElementById(h);
1040
- m && $.observe(m);
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 g = Math.max(0, a.findIndex(($) => $.key === f)), y = a[(g + 1) % a.length];
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(Ae, { theme: r, mode: u.mode, children: /* @__PURE__ */ b(
1052
- st,
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: ((fe = (ue = r.fonts) == null ? void 0 : ue.body) == null ? void 0 : fe.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
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
- dt,
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(ct, { children: [
1080
+ /* @__PURE__ */ b(ht, { children: [
1069
1081
  o,
1070
- i && i.length > 0 && /* @__PURE__ */ n(Ct, { children: i.map((a) => /* @__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: () => D == null ? void 0 : D(a.key),
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(ht, { children: [
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
- me,
1096
+ ye,
1085
1097
  {
1086
1098
  onClick: () => {
1087
- const a = ge(B, H);
1088
- a && (z == null || z(a));
1099
+ const a = ge(B, R);
1100
+ a && (D == null || D(a));
1089
1101
  },
1090
- title: ((xe = B.find((a) => a.key === H)) == null ? void 0 : xe.label) || "Language",
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($t, {}),
1100
- s && s.length > 0 && /* @__PURE__ */ n(
1101
- me,
1111
+ /* @__PURE__ */ n(Bt, {}),
1112
+ l && l.length > 0 && /* @__PURE__ */ n(
1113
+ ye,
1102
1114
  {
1103
1115
  onClick: () => {
1104
- const a = ge(s, K);
1116
+ const a = ge(l, K);
1105
1117
  a && (I == null || I(a));
1106
1118
  },
1107
- title: ((be = s.find((a) => a.key === K)) == null ? void 0 : be.label) || "Theme",
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: () => v(!0), title: "\u6253\u5F00\u76EE\u5F55", children: "\u76EE\u5F55" }) })
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, g = f ? R ? "10px" : "var(--sidebar-width)" : "0px", y = W ? "10px" : "var(--toc-width)", $ = f ? `${g} 1fr ${y}` : `1fr ${y}`;
1120
- return /* @__PURE__ */ b(pt, { style: { gridTemplateColumns: $ }, children: [
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(ut, { $collapsed: R, children: /* @__PURE__ */ n(xt, { children: c && c.length > 0 && /* @__PURE__ */ n("div", { children: Object.entries(
1123
- c.reduce((h, m) => {
1124
- const x = m.group || "\u6587\u6863";
1125
- return h[x] = h[x] || [], h[x].push(m), h;
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, m]) => /* @__PURE__ */ b("div", { children: [
1128
- /* @__PURE__ */ n(le, { children: h }),
1129
- /* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: m.map((x) => /* @__PURE__ */ n(
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 === N,
1144
+ $active: x.id === S,
1133
1145
  onClick: () => {
1134
- x.href && (x.href.startsWith("#") ? ae(x.href.slice(1)) : window.location.href = x.href), S == null || S(x), v(!1);
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(ft, { onClick: () => E((h) => !h), title: R ? "\u5C55\u5F00\u5DE6\u4FA7\u680F" : "\u6536\u8D77\u5DE6\u4FA7\u680F", "aria-label": "toggle-left", children: R ? /* @__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" }) }) })
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(bt, { children: /* @__PURE__ */ n(
1145
- wt,
1156
+ /* @__PURE__ */ n(wt, { children: /* @__PURE__ */ n(
1157
+ kt,
1146
1158
  {
1147
- ref: V,
1148
- children: /* @__PURE__ */ n(kt, { $opacity: Ne, children: Ie })
1159
+ ref: E,
1160
+ children: /* @__PURE__ */ n(mt, { $opacity: Se, children: Ie })
1149
1161
  }
1150
1162
  ) }),
1151
- /* @__PURE__ */ n(vt, { children: /* @__PURE__ */ n(mt, { children: /* @__PURE__ */ b(yt, { $collapsed: W, children: [
1152
- /* @__PURE__ */ n(le, { children: "\u672C\u9875\u76EE\u5F55" }),
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 ? L : ce) === h.id,
1168
+ $active: (U ? H : he) === h.id,
1157
1169
  onClick: () => {
1158
- ae(h.id), A == null || A(h);
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: () => v(!1),
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: () => v(!1), children: "\u5173\u95ED" })
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 g = f.group || "\u6587\u6863";
1203
- return a[g] = a[g] || [], a[g].push(f), 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(le, { children: a }),
1207
- /* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: f.map((g) => /* @__PURE__ */ n(
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: g.id === N,
1222
+ $active: u.id === S,
1211
1223
  onClick: () => {
1212
- g.href && (g.href.startsWith("#") ? ae(g.href.slice(1)) : window.location.href = g.href), S == null || S(g), v(!1);
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: g.label
1226
+ children: u.label
1215
1227
  },
1216
- g.id
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
- Ft as DashboardContainer,
1230
- zt as DockContainer,
1231
- Mt as DocumentContainer
1241
+ zt as DashboardContainer,
1242
+ Mt as DockContainer,
1243
+ Rt as DocumentContainer
1232
1244
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "style": "assets/style.css",
6
6
  "types": "lib_enter.d.ts",
7
7
  "private": false,
8
- "version": "1.3.15",
8
+ "version": "1.3.16",
9
9
  "author": "hanfeng_Zhang",
10
10
  "type": "module",
11
11
  "scripts": {