@mxmweb/zui-layouts 1.3.7 → 1.3.9

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