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