@mxmweb/zui-layouts 1.3.5 → 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 +431 -396
  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 Ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ye = (...e) => e.filter((o, n, u) => !!o && o.trim() !== "" && u.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 He = {
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 He = {
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: u,
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
- ...He,
90
+ ref: L,
91
+ ..._e,
92
92
  width: o,
93
93
  height: o,
94
94
  stroke: e,
95
- strokeWidth: u ? 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, h]) => le(f, h)),
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: u, ...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-${Ee(e)}`, u),
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;
@@ -153,8 +153,8 @@ const U = Ce("ChevronRight", [
153
153
  max-width: 98%;
154
154
  position: relative;
155
155
  background: ${({ theme: e }) => {
156
- var o;
157
- return ((o = e.colors) == null ? void 0 : o.appBackground) || "transparent";
156
+ var o, n;
157
+ return ((o = e.colors) == null ? void 0 : o.dashboardBackground) ?? ((n = e.colors) == null ? void 0 : n.appBackground) ?? "transparent";
158
158
  }};
159
159
  color: ${({ theme: e }) => {
160
160
  var o;
@@ -164,11 +164,14 @@ 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;
171
- height: 38px;
171
+ height: ${({ theme: e }) => {
172
+ var o;
173
+ return ((o = e.space) == null ? void 0 : o.dashboardHeaderHeight) ?? "38px";
174
+ }};
172
175
  z-index: 10;
173
176
  background: transparent;
174
177
  gap: ${({ theme: e }) => {
@@ -180,7 +183,7 @@ const U = Ce("ChevronRight", [
180
183
  justify-content: flex-start;
181
184
  width: 100%;
182
185
  min-width: 0; /* 确保 flex 子元素可以收缩 */
183
- `, Ke = l.button.attrs({
186
+ `, qe = l.button.attrs({
184
187
  className: "dashboard-container-back-button"
185
188
  })`
186
189
  display: flex;
@@ -224,7 +227,7 @@ const U = Ce("ChevronRight", [
224
227
  return ((o = e.colors) == null ? void 0 : o.primaryActive) || ((n = e.colors) == null ? void 0 : n.primary) || "#2D4BE0";
225
228
  }};
226
229
  }
227
- `, Ye = l.div.attrs({
230
+ `, Ze = l.div.attrs({
228
231
  className: "dashboard-container-title"
229
232
  })`
230
233
  line-height: ${({ theme: e }) => {
@@ -257,7 +260,7 @@ const U = Ce("ChevronRight", [
257
260
  return ((o = e.colors) == null ? void 0 : o.primary) || "#4E6EF2";
258
261
  }};
259
262
  }
260
- `, qe = l.div.attrs({
263
+ `, Xe = l.div.attrs({
261
264
  className: "dashboard-container-description"
262
265
  })`
263
266
  line-height: ${({ theme: e }) => {
@@ -278,7 +281,7 @@ const U = Ce("ChevronRight", [
278
281
  var o, n;
279
282
  return ((n = (o = e.fonts) == null ? void 0 : o.body) == null ? void 0 : n.size) || "12px";
280
283
  }};
281
- `, we = l.div.attrs({
284
+ `, ke = l.div.attrs({
282
285
  className: "dashboard-container-breadcrumb"
283
286
  })`
284
287
  display: flex;
@@ -288,7 +291,7 @@ const U = Ce("ChevronRight", [
288
291
  max-width: 50%;
289
292
  min-width: 0;
290
293
  overflow: hidden;
291
- `, ee = l.div.attrs({
294
+ `, oe = l.div.attrs({
292
295
  className: "dashboard-container-breadcrumb-item"
293
296
  })`
294
297
  display: flex;
@@ -299,8 +302,8 @@ const U = Ce("ChevronRight", [
299
302
  return ((n = (o = e.fonts) == null ? void 0 : o.body) == null ? void 0 : n.size) || "14px";
300
303
  }};
301
304
  color: ${({ $isLast: e, theme: o }) => {
302
- var n, u, a;
303
- return e ? ((n = o.colors) == null ? void 0 : n.text) || "#343a40" : ((u = o.colors) == null ? void 0 : u.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";
304
307
  }};
305
308
  font-weight: ${({ $isLast: e }) => e ? "600" : "normal"};
306
309
  cursor: ${({ $isClickable: e }) => e ? "pointer" : "default"};
@@ -316,7 +319,7 @@ const U = Ce("ChevronRight", [
316
319
  return e ? ((n = o.colors) == null ? void 0 : n.primary) || "#4E6EF2" : "inherit";
317
320
  }};
318
321
  }
319
- `, oe = l.div.attrs({
322
+ `, te = l.div.attrs({
320
323
  className: "dashboard-container-breadcrumb-separator"
321
324
  })`
322
325
  display: flex;
@@ -326,13 +329,16 @@ const U = Ce("ChevronRight", [
326
329
  return ((o = e.colors) == null ? void 0 : o.textSecondary) || ((n = e.colors) == null ? void 0 : n.disabledText) || "#6c757d";
327
330
  }};
328
331
  margin: 0 2px;
329
- `, Ze = l.div.attrs({
332
+ `, Je = l.div.attrs({
330
333
  className: "dashboard-container-content"
331
334
  })`
332
335
  display: flex;
333
336
  flex-direction: column;
334
337
  width: 100%;
335
- 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
+ }};
336
342
  min-height: 650px;
337
343
  overflow: auto;
338
344
  background: ${({ theme: e }) => {
@@ -345,27 +351,31 @@ const U = Ce("ChevronRight", [
345
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";
346
352
  }};
347
353
  border-radius: ${({ theme: e }) => {
348
- var o;
349
- return ((o = e.space) == null ? void 0 : o.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";
350
356
  }};
351
357
  /* 优先使用 dashboardShadow,如果没有则使用 shadow */
352
358
  box-shadow: ${({ theme: e }) => {
353
359
  var o, n;
354
360
  return ((o = e.colors) == null ? void 0 : o.dashboardShadow) || ((n = e.colors) == null ? void 0 : n.shadow) || "none";
355
361
  }};
356
- `, Xe = l.div.attrs({
362
+ `, Qe = l.div.attrs({
357
363
  className: "dashboard-container-nav"
358
364
  })`
359
365
  flex: 0 0 ${({ $isOpen: e }) => e ? "72px" : "28px"};
360
366
  transition: flex-basis 0.2s ease;
361
- `, Je = l.div.attrs({
367
+ `, Ue = l.div.attrs({
362
368
  className: "dashboard-container-main-wrapper"
363
369
  })`
364
370
  display: flex;
365
371
  flex-direction: column;
366
372
  flex: 1;
367
373
  min-width: 0;
368
- `, Qe = l.div.attrs({
374
+ background: ${({ theme: e }) => {
375
+ var o;
376
+ return ((o = e.colors) == null ? void 0 : o.dashboardMainBackground) ?? "transparent";
377
+ }};
378
+ `, eo = l.div.attrs({
369
379
  className: "dashboard-container-main-layout"
370
380
  })`
371
381
  height: 100%;
@@ -375,169 +385,169 @@ const U = Ce("ChevronRight", [
375
385
  var o;
376
386
  return ((o = e.space) == null ? void 0 : o.size) || "12px";
377
387
  }};
378
- `, No = ({
388
+ `, zo = ({
379
389
  children: e,
380
390
  goBack: o,
381
391
  title: n,
382
- description: u,
392
+ description: p,
383
393
  breadcrumbs: a,
384
- dockItems: $,
394
+ dockItems: x,
385
395
  // 以下参数为兼容旧版本保留,当前未使用
386
- dockActiveMode: W = "single",
387
- defaultDockActiveId: M,
388
- defaultDockActiveIds: _,
389
- styles: f,
390
- eventsEmit: h
396
+ dockActiveMode: M = "single",
397
+ defaultDockActiveId: T,
398
+ defaultDockActiveIds: L,
399
+ styles: F,
400
+ eventsEmit: s
391
401
  }) => {
392
- const O = se(), I = K(
402
+ const K = ce(), B = G(
393
403
  // 基础:默认主题 + useTheme的配置
394
- K({ theme: F, mode: "light" }, O),
404
+ G({ theme: A, mode: "light" }, K),
395
405
  // 最高层:用户手动传入的styles
396
- f
397
- ), s = (I == null ? void 0 : I.theme) || F, N = w.useRef(null), A = () => {
398
- h != null && h.onGoBack ? h.onGoBack() : o && o();
399
- }, L = () => {
400
- h != null && h.onTitleClick && h.onTitleClick();
401
- }, T = (m, r) => {
402
- h != null && h.onBreadcrumbClick ? h.onBreadcrumbClick(m, r) : m.onClick && m.onClick();
403
- }, B = (m, r) => {
404
- h != null && h.onDockItemClick && h.onDockItemClick(m, r);
405
- }, 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 = () => {
406
416
  if (!a || a.length === 0) return null;
407
- const [m, r] = w.useState({ start: 0, end: a.length, showEllipsis: !1 }), j = w.useCallback(() => {
408
- 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) {
409
419
  r({ start: 0, end: a.length, showEllipsis: !1 });
410
420
  return;
411
421
  }
412
- const k = N.current.offsetWidth * 0.5;
413
- let P = Math.floor((k - 30) / (120 + 20));
414
- 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) {
415
425
  r({ start: 0, end: a.length, showEllipsis: !1 });
416
426
  return;
417
427
  }
418
- const Z = 0, H = Math.min(P - 1, a.length);
428
+ const J = 0, O = Math.min(_ - 1, a.length);
419
429
  r({
420
- start: Z,
421
- end: H,
422
- showEllipsis: H < a.length - 1
430
+ start: J,
431
+ end: O,
432
+ showEllipsis: O < a.length - 1
423
433
  });
424
434
  }, [a.length]);
425
- if (w.useEffect(() => {
426
- j();
427
- const b = new ResizeObserver(() => {
428
- j();
435
+ if (k.useEffect(() => {
436
+ R();
437
+ const w = new ResizeObserver(() => {
438
+ R();
429
439
  });
430
- return N.current && b.observe(N.current), () => {
431
- b.disconnect();
440
+ return D.current && w.observe(D.current), () => {
441
+ w.disconnect();
432
442
  };
433
- }, [j]), a.length <= 3)
434
- 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: [
435
445
  /* @__PURE__ */ t(
436
- ee,
446
+ oe,
437
447
  {
438
- $isLast: k === a.length - 1,
439
- $isClickable: !!(k < a.length - 1 || b.onClick),
440
- onClick: () => T(b, k),
441
- theme: s,
442
- title: b.label,
443
- 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
444
454
  }
445
455
  ),
446
- k < a.length - 1 && /* @__PURE__ */ t(oe, { theme: s, children: /* @__PURE__ */ t(U, { size: 14 }) })
447
- ] }, b.id)) });
448
- const { start: V, end: E, showEllipsis: ne } = m;
449
- return /* @__PURE__ */ x(we, { theme: s, children: [
450
- a.slice(V, E).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: [
451
461
  /* @__PURE__ */ t(
452
- ee,
462
+ oe,
453
463
  {
454
- $isLast: k === E - V - 1 && !ne,
455
- $isClickable: !!(k < E - V - 1 || b.onClick),
456
- onClick: () => T(b, V + k),
457
- theme: s,
458
- title: b.label,
459
- 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
460
470
  }
461
471
  ),
462
- k < E - V - 1 && /* @__PURE__ */ t(oe, { theme: s, children: /* @__PURE__ */ t(U, { size: 14 }) })
463
- ] }, b.id)),
464
- ne && /* @__PURE__ */ x(Ie, { children: [
465
- /* @__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 }) }),
466
476
  /* @__PURE__ */ t(
467
- ee,
477
+ oe,
468
478
  {
469
479
  $isLast: !1,
470
480
  $isClickable: !1,
471
- theme: s,
481
+ theme: c,
472
482
  style: {
473
483
  cursor: "default",
474
484
  maxWidth: "auto"
475
485
  },
476
- title: `${a.slice(E, -1).map((b) => b.label).join(" > ")}`,
486
+ title: `${a.slice(W, -1).map((w) => w.label).join(" > ")}`,
477
487
  children: "..."
478
488
  }
479
489
  ),
480
- /* @__PURE__ */ t(oe, { theme: s, children: /* @__PURE__ */ t(U, { size: 14 }) }),
490
+ /* @__PURE__ */ t(te, { theme: c, children: /* @__PURE__ */ t(ee, { size: 14 }) }),
481
491
  /* @__PURE__ */ t(
482
- ee,
492
+ oe,
483
493
  {
484
494
  $isLast: !0,
485
495
  $isClickable: !!a[a.length - 1].onClick,
486
- onClick: () => T(a[a.length - 1], a.length - 1),
487
- theme: s,
496
+ onClick: () => N(a[a.length - 1], a.length - 1),
497
+ theme: c,
488
498
  title: a[a.length - 1].label,
489
499
  children: a[a.length - 1].label
490
500
  }
491
501
  )
492
502
  ] })
493
503
  ] });
494
- }, [J, te] = w.useState(!0);
495
- return /* @__PURE__ */ t(Pe, { theme: s, children: /* @__PURE__ */ x(Qe, { theme: s, children: [
496
- $ && $.length > 0 && /* @__PURE__ */ t(Xe, { $isOpen: J, theme: s, children: /* @__PURE__ */ t(
497
- 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,
498
508
  {
499
- items: $,
500
- open: J,
501
- onOpenChange: te,
502
- onItemClick: (m) => B({ 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),
503
513
  defaultOpen: !0
504
514
  }
505
515
  ) }),
506
- /* @__PURE__ */ x(Je, { theme: s, children: [
507
- (n || u || 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: [
508
518
  o && /* @__PURE__ */ t(
509
- Ke,
519
+ qe,
510
520
  {
511
- onClick: A,
512
- theme: s,
521
+ onClick: I,
522
+ theme: c,
513
523
  title: "\u8FD4\u56DE",
514
- children: /* @__PURE__ */ t(Ve, { size: 18 })
524
+ children: /* @__PURE__ */ t(Ge, { size: 18 })
515
525
  }
516
526
  ),
517
- z(),
527
+ H(),
518
528
  n && /* @__PURE__ */ t(
519
- Ye,
529
+ Ze,
520
530
  {
521
- onClick: L,
522
- theme: s,
531
+ onClick: j,
532
+ theme: c,
523
533
  title: n,
524
534
  children: n
525
535
  }
526
536
  ),
527
- u && /* @__PURE__ */ t(
528
- qe,
537
+ p && /* @__PURE__ */ t(
538
+ Xe,
529
539
  {
530
- theme: s,
531
- title: u,
532
- children: u
540
+ theme: c,
541
+ title: p,
542
+ children: p
533
543
  }
534
544
  )
535
545
  ] }),
536
- /* @__PURE__ */ t(Ze, { theme: s, children: e || /* @__PURE__ */ t(je, {}) })
546
+ /* @__PURE__ */ t(Je, { theme: c, children: e || /* @__PURE__ */ t(Ee, {}) })
537
547
  ] })
538
548
  ] }) });
539
- }, Ue = l.div.withConfig({
540
- shouldForwardProp: (e) => !["backgroundImage", "backgroundColor"].includes(e)
549
+ }, oo = l.div.withConfig({
550
+ shouldForwardProp: (e) => !["backgroundImage", "backgroundColor", "dockPosition"].includes(e)
541
551
  })`
542
552
  position: fixed;
543
553
  top: 0;
@@ -546,10 +556,16 @@ const U = Ce("ChevronRight", [
546
556
  height: 100vh;
547
557
  background: ${(e) => e.backgroundImage ? `url(${e.backgroundImage}) center/cover no-repeat` : e.backgroundColor || "#1a1a1a"};
548
558
  display: flex;
549
- flex-direction: column;
559
+ flex-direction: ${(e) => e.dockPosition === "left" || e.dockPosition === "right" ? "row" : "column"};
550
560
  overflow: hidden;
551
561
  z-index: 1;
552
- `, 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`
553
569
  height: 48px;
554
570
  width: 100%;
555
571
  display: flex;
@@ -558,7 +574,7 @@ const U = Ce("ChevronRight", [
558
574
  background: transparent;
559
575
  z-index: 10;
560
576
  flex-shrink: 0;
561
- `, oo = l.div`
577
+ `, ro = l.div`
562
578
  flex: 1;
563
579
  width: 100%;
564
580
  overflow-y: auto;
@@ -585,78 +601,97 @@ const U = Ce("ChevronRight", [
585
601
  &::-webkit-scrollbar-thumb:hover {
586
602
  background: rgba(255, 255, 255, 0.5);
587
603
  }
588
- `, to = l.div`
589
- height: 80px;
590
- width: 100%;
591
- display: flex;
592
- align-items: flex-end;
593
- justify-content: center;
594
- 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
+ `}
595
622
  background: transparent;
596
623
  z-index: 10;
597
624
  flex-shrink: 0;
598
- `, Ao = ({
625
+ `, Mo = ({
599
626
  children: e,
600
627
  backgroundImage: o,
601
628
  backgroundColor: n,
602
- header: u,
629
+ header: p,
603
630
  dockItems: a,
604
- dockActiveMode: $ = "single",
605
- defaultDockActiveId: W,
606
- defaultDockActiveIds: M,
607
- styles: _,
608
- eventsEmit: f
631
+ dockPosition: x = "bottom",
632
+ dockActiveMode: M = "single",
633
+ defaultDockActiveId: T,
634
+ defaultDockActiveIds: L,
635
+ styles: F,
636
+ eventsEmit: s
609
637
  }) => {
610
- var L, T;
611
- const h = se(), O = K(
638
+ var E, q;
639
+ const K = ce(), B = G(
612
640
  // 基础:默认主题 + useTheme的配置
613
- K({ theme: F, mode: "light" }, h),
641
+ G({ theme: A, mode: "light" }, K),
614
642
  // 最高层:用户手动传入的styles
615
- _
616
- ), I = (O == null ? void 0 : O.theme) || F, s = (B, z) => {
617
- f != null && f.onDockItemClick ? f.onDockItemClick(B, z) : B.onClick && B.onClick();
618
- }, N = (B, z) => {
619
- f != null && f.onDockActiveChange && f.onDockActiveChange(B, z);
620
- }, A = (B, z) => {
621
- f != null && f.onDockActiveChangeMultiple && f.onDockActiveChangeMultiple(B, z);
622
- };
623
- return /* @__PURE__ */ x(
624
- 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,
625
682
  {
626
683
  backgroundImage: o,
627
684
  backgroundColor: n,
685
+ dockPosition: x,
628
686
  children: [
629
- u && /* @__PURE__ */ t(eo, { children: u }),
630
- /* @__PURE__ */ t(
631
- oo,
632
- {
633
- style: {
634
- color: I.colors.text,
635
- fontFamily: ((T = (L = I.fonts) == null ? void 0 : L.body) == null ? void 0 : T.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
636
- },
637
- children: e
638
- }
639
- ),
640
- a && a.length > 0 && /* @__PURE__ */ t(to, { children: /* @__PURE__ */ t(
641
- Te,
642
- {
643
- items: a,
644
- itemWidth: 48,
645
- itemHeight: 48,
646
- magnification: 1.5,
647
- itemGap: 8,
648
- activeMode: $,
649
- defaultActiveId: W,
650
- defaultActiveIds: M,
651
- onItemClick: s,
652
- onActiveChange: N,
653
- onActiveChangeMultiple: A
654
- }
655
- ) })
687
+ x === "top" && H,
688
+ x === "left" && H,
689
+ N ? /* @__PURE__ */ t(to, { children: Y }) : Y,
690
+ (x === "bottom" || x === "right") && H
656
691
  ]
657
692
  }
658
693
  );
659
- }, no = l.div`
694
+ }, so = l.div`
660
695
  --header-height: 56px;
661
696
  --page-gutter: 16px;
662
697
  --sidebar-width: 264px;
@@ -669,7 +704,7 @@ const U = Ce("ChevronRight", [
669
704
  min-height: 100vh;
670
705
  height: 100vh; /* 以视口高度为基准,便于内部独立滚动布局 */
671
706
  position: relative;
672
- `, ro = l.div`
707
+ `, co = l.div`
673
708
  position: sticky;
674
709
  top: 0;
675
710
  z-index: 30;
@@ -681,16 +716,16 @@ const U = Ce("ChevronRight", [
681
716
  padding: 0 16px;
682
717
  border-bottom: 1px solid rgba(0,0,0,0.06);
683
718
  backdrop-filter: blur(8px);
684
- `, io = l.div`
719
+ `, ho = l.div`
685
720
  display: flex;
686
721
  align-items: center;
687
722
  gap: 12px;
688
723
  min-width: 0;
689
- `, ao = l.div`
724
+ `, po = l.div`
690
725
  display: flex;
691
726
  align-items: center;
692
727
  gap: 8px;
693
- `, ke = l.button`
728
+ `, ve = l.button`
694
729
  display: inline-flex;
695
730
  align-items: center;
696
731
  justify-content: center;
@@ -704,7 +739,7 @@ const U = Ce("ChevronRight", [
704
739
 
705
740
  &:hover { background: rgba(0,0,0,0.04); }
706
741
  &:active { transform: translateY(1px); }
707
- `, lo = l.div`
742
+ `, uo = l.div`
708
743
  display: grid;
709
744
  grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
710
745
  gap: 16px;
@@ -725,9 +760,9 @@ const U = Ce("ChevronRight", [
725
760
  gap: 12px;
726
761
  padding: 12px 12px 20px 12px;
727
762
  }
728
- `, so = l.aside`
763
+ `, go = l.aside`
729
764
  position: relative;
730
- `, co = l.div`
765
+ `, fo = l.div`
731
766
  height: 100%;
732
767
  overflow: hidden;
733
768
  padding-right: 8px;
@@ -736,7 +771,7 @@ const U = Ce("ChevronRight", [
736
771
  opacity: ${(e) => e.$collapsed ? 0 : 1};
737
772
  transform: translateX(${(e) => e.$collapsed ? "-6px" : "0px"});
738
773
  pointer-events: ${(e) => e.$collapsed ? "none" : "auto"};
739
- `, ho = l.button`
774
+ `, xo = l.button`
740
775
  position: absolute;
741
776
  top: 6px;
742
777
  right: -10px;
@@ -751,16 +786,16 @@ const U = Ce("ChevronRight", [
751
786
  justify-content: center;
752
787
  transition: background .15s ease;
753
788
  &:hover { background: rgba(0,0,0,0.12); }
754
- `, po = l.div`
789
+ `, bo = l.div`
755
790
  height: 100%;
756
791
  overflow: auto;
757
792
  padding-right: 8px;
758
- `, uo = l.main`
793
+ `, wo = l.main`
759
794
  position: relative;
760
795
  min-width: 0;
761
796
  height: 100%;
762
797
  overflow: auto; /* 文档渲染区独立滚动 */
763
- `, go = l.div`
798
+ `, ko = l.div`
764
799
  width: 100%;
765
800
  max-width: var(--content-max);
766
801
  margin: 0 auto;
@@ -768,16 +803,16 @@ const U = Ce("ChevronRight", [
768
803
  border-radius: 8px;
769
804
  padding: 0px 12px;
770
805
  padding-bottom: 120px; /* 底部留出足够的 margin,确保可以滚动到最底部 */
771
- `, fo = l.div`
806
+ `, mo = l.div`
772
807
  height: 100%;
773
808
  transition: opacity .5s ease;
774
809
  opacity: ${(e) => e.$opacity};
775
- `, xo = l.aside`
810
+ `, vo = l.aside`
776
811
  position: relative;
777
812
  z-index: 1;
778
813
  height: 100%;
779
814
  overflow: hidden;
780
- `, bo = l.div`
815
+ `, yo = l.div`
781
816
  /* 右侧目录独立滚动 */
782
817
  position: relative;
783
818
  height: 100%;
@@ -789,7 +824,7 @@ const U = Ce("ChevronRight", [
789
824
  border-left: 1px solid rgba(0,0,0,0.06);
790
825
  background: transparent;
791
826
  z-index: 1;
792
- `, wo = l.div`
827
+ `, Co = l.div`
793
828
  transition: opacity .2s ease, transform .2s ease;
794
829
  opacity: ${(e) => e.$collapsed ? 0 : 1};
795
830
  transform: translateX(${(e) => e.$collapsed ? "6px" : "0px"});
@@ -814,11 +849,11 @@ l.button`
814
849
  transition: background .15s ease;
815
850
  &:hover { background: rgba(0,0,0,0.12); }
816
851
  `;
817
- const ae = l.div`
852
+ const le = l.div`
818
853
  font-size: 12px;
819
854
  opacity: .7;
820
855
  padding: 8px 8px;
821
- `, q = l.button`
856
+ `, X = l.button`
822
857
  width: 100%;
823
858
  padding: 8px 10px;
824
859
  background: transparent;
@@ -849,7 +884,7 @@ const ae = l.div`
849
884
  }
850
885
 
851
886
  ${(e) => e.$active ? "background: rgba(0,0,0,0.08); font-weight: 600;" : ""}
852
- `, ko = l.div`
887
+ `, $o = l.div`
853
888
  display: flex;
854
889
  align-items: center;
855
890
  gap: 8px;
@@ -859,16 +894,16 @@ const ae = l.div`
859
894
  overflow-y: hidden;
860
895
  scrollbar-width: none;
861
896
  &::-webkit-scrollbar { display: none; }
862
- `, vo = l.div`
897
+ `, Bo = l.div`
863
898
  width: 1px;
864
899
  height: 16px;
865
900
  background: currentColor;
866
901
  opacity: .2;
867
- `, mo = {
902
+ `, Do = {
868
903
  theme: {
869
- ...F,
904
+ ...A,
870
905
  colors: {
871
- ...F.colors,
906
+ ...A.colors,
872
907
  appBackground: "#ffffff",
873
908
  panelBackground: "#ffffff",
874
909
  dashboardBackground: "#ffffff",
@@ -878,11 +913,11 @@ const ae = l.div`
878
913
  shadow: "0 1px 2px rgba(0,0,0,0.06)"
879
914
  }
880
915
  }
881
- }, yo = {
916
+ }, Io = {
882
917
  theme: {
883
- ...F,
918
+ ...A,
884
919
  colors: {
885
- ...F.colors,
920
+ ...A.colors,
886
921
  appBackground: "#0f172a",
887
922
  panelBackground: "#111827",
888
923
  dashboardBackground: "#0b1220",
@@ -893,237 +928,237 @@ const ae = l.div`
893
928
  }
894
929
  },
895
930
  mode: "dark"
896
- }, To = (e) => {
897
- var ue, ge, fe, xe;
931
+ }, Ro = (e) => {
932
+ var ge, fe, xe, be;
898
933
  const {
899
934
  children: o,
900
935
  headerLogo: n,
901
- contentKey: u,
936
+ contentKey: p,
902
937
  modules: a,
903
- activeModuleKey: $,
904
- onModuleChange: W,
905
- languages: M,
906
- activeLanguageKey: _,
907
- onLanguageChange: f,
908
- themes: h,
909
- activeThemeKey: O,
910
- onThemeChange: I,
911
- sidebarItems: s,
912
- activeSidebarId: N,
913
- onSidebarItemClick: A,
914
- activeTocId: L,
915
- onTocItemClick: T,
916
- collapsibleSidebar: B = !0,
917
- styles: z
918
- } = e, J = se(), te = e.activeThemeKey === "dark" ? yo : mo, m = K(
919
- K(
920
- K({ theme: F, mode: "light" }, J),
921
- 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
922
957
  ),
923
- z
924
- ), r = (m == null ? void 0 : m.theme) || F, [j, V] = w.useState(!1), [E, ne] = w.useState(!1), [b, k] = w.useState(!1), Q = typeof L == "string", [ce, re] = w.useState(L), P = w.useRef(null), [Z, H] = w.useState(void 0), [$e, de] = w.useState(o), [De, he] = w.useState(1);
925
- w.useEffect(() => {
926
- if (u === void 0) {
927
- 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);
928
963
  return;
929
964
  }
930
- he(0);
965
+ pe(0);
931
966
  const i = setTimeout(() => {
932
- de(o), requestAnimationFrame(() => he(1));
967
+ he(o), requestAnimationFrame(() => pe(1));
933
968
  }, 120);
934
969
  return () => clearTimeout(i);
935
- }, [u, o]), w.useMemo(() => {
936
- var i, p, d, y, D, 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;
937
972
  return {
938
973
  primaryColor: (i = r == null ? void 0 : r.colors) == null ? void 0 : i.primary,
939
- secondaryColor: (p = r == null ? void 0 : r.colors) == null ? void 0 : p.secondary,
940
- 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,
941
976
  textColor: (y = r == null ? void 0 : r.colors) == null ? void 0 : y.text,
942
- borderColor: (D = r == null ? void 0 : r.colors) == null ? void 0 : D.border,
943
- 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,
944
979
  borderRadius: (v = r == null ? void 0 : r.space) == null ? void 0 : v.radius,
945
- padding: (g = r == null ? void 0 : r.space) == null ? void 0 : g.padding,
946
- margin: (G = r == null ? void 0 : r.space) == null ? void 0 : G.margin,
947
- 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
948
983
  };
949
- }, [r]), w.useEffect(() => {
984
+ }, [r]), k.useEffect(() => {
950
985
  if (e.tocItems)
951
- H(void 0);
986
+ O(void 0);
952
987
  else {
953
- u !== void 0 && H(void 0);
988
+ p !== void 0 && O(void 0);
954
989
  let i = 0;
955
- const p = 10;
956
- let d = null, y = null;
957
- const D = () => {
958
- const c = P.current;
959
- if (!c) {
960
- i < p ? (i++, d = setTimeout(D, 200)) : H([]);
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([]);
961
996
  return;
962
997
  }
963
- const v = Array.from(c.querySelectorAll("h1, h2, h3"));
998
+ const v = Array.from(d.querySelectorAll("h1, h2, h3"));
964
999
  if (v.length === 0) {
965
- i < p ? (i++, d = setTimeout(D, 200)) : H([]);
1000
+ i < g ? (i++, h = setTimeout($, 200)) : O([]);
966
1001
  return;
967
1002
  }
968
- const g = /* @__PURE__ */ new Map(), G = v.map((C) => {
969
- var be;
970
- const R = C.id || ((be = C.textContent) == null ? void 0 : be.trim().replace(/\s+/g, "-").toLowerCase()) || "", Y = g.get(R) || 0;
971
- g.set(R, Y + 1);
972
- const X = Y > 0 ? `${R}-${Y}` : R;
973
- C.id || (C.id = X);
974
- const Be = C.tagName === "H1" ? 1 : C.tagName === "H2" ? 2 : 3;
975
- return { id: X, label: C.textContent || "", level: Be };
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 };
976
1011
  });
977
- H(G);
1012
+ O(P);
978
1013
  };
979
1014
  return y = requestAnimationFrame(() => {
980
- d = setTimeout(D, 100);
1015
+ h = setTimeout($, 100);
981
1016
  }), () => {
982
- y !== null && cancelAnimationFrame(y), d !== null && clearTimeout(d);
1017
+ y !== null && cancelAnimationFrame(y), h !== null && clearTimeout(h);
983
1018
  };
984
1019
  }
985
- }, [o, e.tocItems, u]), w.useEffect(() => {
986
- if (Q) return;
987
- const p = ((e.tocItems ?? Z) || []).map((c) => c.id).filter(Boolean);
988
- if (p.length === 0) return;
989
- re(void 0);
990
- const d = { root: null, rootMargin: "0px 0px -70% 0px", threshold: 0 }, y = (c) => {
991
- var g, G;
992
- const v = c.filter((C) => C.isIntersecting).sort((C, R) => C.boundingClientRect.top - R.boundingClientRect.top);
993
- (G = (g = v[0]) == null ? void 0 : g.target) != null && G.id && re(v[0].target.id);
994
- }, D = new IntersectionObserver(y, d);
995
- return p.forEach((c) => {
996
- const v = document.getElementById(c);
997
- v && D.observe(v);
998
- }), () => D.disconnect();
999
- }, [Z, Q, e.tocItems, u]);
1000
- const pe = (i, p) => {
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) => {
1001
1036
  if (!i || i.length === 0) return;
1002
- const d = Math.max(0, i.findIndex((D) => D.key === p)), y = i[(d + 1) % i.length];
1037
+ const h = Math.max(0, i.findIndex(($) => $.key === g)), y = i[(h + 1) % i.length];
1003
1038
  return y == null ? void 0 : y.key;
1004
- }, ie = (i) => {
1005
- const p = document.getElementById(i);
1006
- p && p.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" });
1007
1042
  };
1008
- return /* @__PURE__ */ t(Ne, { theme: r, mode: m.mode, children: /* @__PURE__ */ x(
1009
- no,
1043
+ return /* @__PURE__ */ t(Ae, { theme: r, mode: u.mode, children: /* @__PURE__ */ b(
1044
+ so,
1010
1045
  {
1011
1046
  style: {
1012
1047
  background: r.colors.appBackground,
1013
1048
  color: r.colors.text,
1014
- 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"
1015
1050
  },
1016
1051
  children: [
1017
- /* @__PURE__ */ x(
1018
- ro,
1052
+ /* @__PURE__ */ b(
1053
+ co,
1019
1054
  {
1020
1055
  style: {
1021
1056
  background: r.colors.panelBackground || r.colors.dashboardBackground || "rgba(255,255,255,0.6)",
1022
1057
  color: r.colors.text
1023
1058
  },
1024
1059
  children: [
1025
- /* @__PURE__ */ x(io, { children: [
1060
+ /* @__PURE__ */ b(ho, { children: [
1026
1061
  n,
1027
- a && a.length > 0 && /* @__PURE__ */ t(ko, { children: a.map((i) => /* @__PURE__ */ t(
1028
- q,
1062
+ a && a.length > 0 && /* @__PURE__ */ t($o, { children: a.map((i) => /* @__PURE__ */ t(
1063
+ X,
1029
1064
  {
1030
- $active: i.key === $,
1031
- onClick: () => W == null ? void 0 : W(i.key),
1065
+ $active: i.key === x,
1066
+ onClick: () => M == null ? void 0 : M(i.key),
1032
1067
  title: i.label,
1033
1068
  children: i.label
1034
1069
  },
1035
1070
  i.key
1036
1071
  )) })
1037
1072
  ] }),
1038
- /* @__PURE__ */ x(ao, { children: [
1073
+ /* @__PURE__ */ b(po, { children: [
1039
1074
  /* @__PURE__ */ t("div", { className: "hide-on-desktop", style: { display: "none" } }),
1040
- M && M.length > 0 && /* @__PURE__ */ t(
1041
- ke,
1075
+ T && T.length > 0 && /* @__PURE__ */ t(
1076
+ ve,
1042
1077
  {
1043
1078
  onClick: () => {
1044
- const i = pe(M, _);
1045
- i && (f == null || f(i));
1079
+ const i = ue(T, L);
1080
+ i && (F == null || F(i));
1046
1081
  },
1047
- 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",
1048
1083
  "aria-label": "language",
1049
1084
  style: { color: r.colors.text },
1050
- 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: [
1051
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" }),
1052
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" })
1053
1088
  ] })
1054
1089
  }
1055
1090
  ),
1056
- /* @__PURE__ */ t(vo, {}),
1057
- h && h.length > 0 && /* @__PURE__ */ t(
1058
- ke,
1091
+ /* @__PURE__ */ t(Bo, {}),
1092
+ s && s.length > 0 && /* @__PURE__ */ t(
1093
+ ve,
1059
1094
  {
1060
1095
  onClick: () => {
1061
- const i = pe(h, O);
1062
- i && (I == null || I(i));
1096
+ const i = ue(s, K);
1097
+ i && (B == null || B(i));
1063
1098
  },
1064
- title: ((xe = h.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",
1065
1100
  "aria-label": "theme",
1066
1101
  style: { color: r.colors.text },
1067
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" }) })
1068
1103
  }
1069
1104
  ),
1070
- /* @__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" }) })
1071
1106
  ] })
1072
1107
  ]
1073
1108
  }
1074
1109
  ),
1075
1110
  (() => {
1076
- const p = (Array.isArray(s) ? s.length : 0) > 1, d = p ? j ? "10px" : "var(--sidebar-width)" : "0px", y = E ? "10px" : "var(--toc-width)", D = p ? `${d} 1fr ${y}` : `1fr ${y}`;
1077
- return /* @__PURE__ */ x(lo, { style: { gridTemplateColumns: D }, children: [
1078
- p && /* @__PURE__ */ x(so, { children: [
1079
- /* @__PURE__ */ t(co, { $collapsed: j, children: /* @__PURE__ */ t(po, { children: s && s.length > 0 && /* @__PURE__ */ t("div", { children: Object.entries(
1080
- s.reduce((c, v) => {
1081
- const g = v.group || "\u6587\u6863";
1082
- 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;
1083
1118
  }, {})
1084
- ).map(([c, v]) => /* @__PURE__ */ x("div", { children: [
1085
- /* @__PURE__ */ t(ae, { children: c }),
1086
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: v.map((g) => /* @__PURE__ */ t(
1087
- 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,
1088
1123
  {
1089
- $active: g.id === N,
1124
+ $active: f.id === D,
1090
1125
  onClick: () => {
1091
- 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);
1092
1127
  },
1093
- title: g.label,
1094
- children: g.label
1128
+ title: f.label,
1129
+ children: f.label
1095
1130
  },
1096
- g.id
1131
+ f.id
1097
1132
  )) })
1098
- ] }, c)) }) }) }),
1099
- B && p && /* @__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" }) }) })
1100
1135
  ] }),
1101
- /* @__PURE__ */ t(uo, { children: /* @__PURE__ */ t(
1102
- go,
1136
+ /* @__PURE__ */ t(wo, { children: /* @__PURE__ */ t(
1137
+ ko,
1103
1138
  {
1104
- ref: P,
1105
- children: /* @__PURE__ */ t(fo, { $opacity: De, children: $e })
1139
+ ref: _,
1140
+ children: /* @__PURE__ */ t(mo, { $opacity: Ne, children: Ie })
1106
1141
  }
1107
1142
  ) }),
1108
- /* @__PURE__ */ t(xo, { children: /* @__PURE__ */ t(bo, { children: /* @__PURE__ */ x(wo, { $collapsed: E, children: [
1109
- /* @__PURE__ */ t(ae, { children: "\u672C\u9875\u76EE\u5F55" }),
1110
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px", width: "100%", maxWidth: "100%", overflow: "hidden" }, children: ((e.tocItems ?? Z) || []).map((c) => /* @__PURE__ */ t(
1111
- 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,
1112
1147
  {
1113
- $active: (Q ? L : ce) === c.id,
1148
+ $active: (U ? j : de) === d.id,
1114
1149
  onClick: () => {
1115
- ie(c.id), T == null || T(c);
1150
+ ae(d.id), N == null || N(d);
1116
1151
  },
1117
- title: c.label,
1118
- style: { paddingLeft: Math.max(0, (c.level || 1) - 1) * 12 + 10 },
1119
- children: c.label
1152
+ title: d.label,
1153
+ style: { paddingLeft: Math.max(0, (d.level || 1) - 1) * 12 + 10 },
1154
+ children: d.label
1120
1155
  },
1121
- c.id
1156
+ d.id
1122
1157
  )) })
1123
1158
  ] }) }) })
1124
1159
  ] });
1125
1160
  })(),
1126
- b && /* @__PURE__ */ t(
1161
+ w && /* @__PURE__ */ t(
1127
1162
  "div",
1128
1163
  {
1129
1164
  role: "dialog",
@@ -1135,8 +1170,8 @@ const ae = l.div`
1135
1170
  background: "rgba(0,0,0,0.45)",
1136
1171
  display: "flex"
1137
1172
  },
1138
- onClick: () => k(!1),
1139
- children: /* @__PURE__ */ x(
1173
+ onClick: () => m(!1),
1174
+ children: /* @__PURE__ */ b(
1140
1175
  "div",
1141
1176
  {
1142
1177
  style: {
@@ -1150,27 +1185,27 @@ const ae = l.div`
1150
1185
  },
1151
1186
  onClick: (i) => i.stopPropagation(),
1152
1187
  children: [
1153
- /* @__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: [
1154
1189
  /* @__PURE__ */ t("div", { style: { fontWeight: 600 }, children: "\u76EE\u5F55" }),
1155
- /* @__PURE__ */ t(q, { onClick: () => k(!1), children: "\u5173\u95ED" })
1190
+ /* @__PURE__ */ t(X, { onClick: () => m(!1), children: "\u5173\u95ED" })
1156
1191
  ] }),
1157
- s && s.length > 0 && /* @__PURE__ */ t("div", { style: { overflow: "auto", height: "calc(100% - 40px)" }, children: Object.entries(
1158
- s.reduce((i, p) => {
1159
- const d = p.group || "\u6587\u6863";
1160
- return i[d] = i[d] || [], i[d].push(p), 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;
1161
1196
  }, {})
1162
- ).map(([i, p]) => /* @__PURE__ */ x("div", { children: [
1163
- /* @__PURE__ */ t(ae, { children: i }),
1164
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: p.map((d) => /* @__PURE__ */ t(
1165
- 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,
1166
1201
  {
1167
- $active: d.id === N,
1202
+ $active: h.id === D,
1168
1203
  onClick: () => {
1169
- 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);
1170
1205
  },
1171
- children: d.label
1206
+ children: h.label
1172
1207
  },
1173
- d.id
1208
+ h.id
1174
1209
  )) })
1175
1210
  ] }, i)) })
1176
1211
  ]
@@ -1183,7 +1218,7 @@ const ae = l.div`
1183
1218
  ) });
1184
1219
  };
1185
1220
  export {
1186
- No as DashboardContainer,
1187
- Ao as DockContainer,
1188
- To as DocumentContainer
1221
+ zo as DashboardContainer,
1222
+ Mo as DockContainer,
1223
+ Ro as DocumentContainer
1189
1224
  };