@mxmweb/zui-layouts 1.3.3 → 1.3.7

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/assets/style.css +1 -1
  2. package/index.js +606 -505
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as e, jsxs as g, Fragment as Ie } from "react/jsx-runtime";
2
- import * as R from "react";
3
- import x, { forwardRef as me, createElement as xe } from "react";
1
+ import { jsx as t, jsxs as x, Fragment as Ie } from "react/jsx-runtime";
2
+ import * as S from "react";
3
+ import w, { forwardRef as ve, createElement as le } from "react";
4
4
  import l from "styled-components";
5
- import { useTheme as be, deepMergeTheme as E, defaultTheme as M, ThemeProvider as Se } from "@mxmweb/zui-theme";
6
- import { GoogleNavbar as Te, CustomDock as Ae } from "@mxmweb/zui-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";
7
7
  /**
8
8
  * React Router v6.30.1
9
9
  *
@@ -14,33 +14,33 @@ import { GoogleNavbar as Te, CustomDock as Ae } from "@mxmweb/zui-components";
14
14
  *
15
15
  * @license MIT
16
16
  */
17
- const Ne = /* @__PURE__ */ R.createContext(null);
18
- process.env.NODE_ENV !== "production" && (Ne.displayName = "DataRouter");
19
- const Re = /* @__PURE__ */ R.createContext(null);
20
- process.env.NODE_ENV !== "production" && (Re.displayName = "DataRouterState");
21
- const Me = /* @__PURE__ */ R.createContext(null);
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
22
  process.env.NODE_ENV !== "production" && (Me.displayName = "Await");
23
- const ze = /* @__PURE__ */ R.createContext(null);
23
+ const ze = /* @__PURE__ */ S.createContext(null);
24
24
  process.env.NODE_ENV !== "production" && (ze.displayName = "Navigation");
25
- const Fe = /* @__PURE__ */ R.createContext(null);
26
- process.env.NODE_ENV !== "production" && (Fe.displayName = "Location");
27
- const Ce = /* @__PURE__ */ R.createContext({
25
+ const Re = /* @__PURE__ */ S.createContext(null);
26
+ process.env.NODE_ENV !== "production" && (Re.displayName = "Location");
27
+ const me = /* @__PURE__ */ S.createContext({
28
28
  outlet: null,
29
29
  matches: [],
30
30
  isDataRoute: !1
31
31
  });
32
- process.env.NODE_ENV !== "production" && (Ce.displayName = "Route");
33
- const We = /* @__PURE__ */ R.createContext(null);
32
+ process.env.NODE_ENV !== "production" && (me.displayName = "Route");
33
+ const We = /* @__PURE__ */ S.createContext(null);
34
34
  process.env.NODE_ENV !== "production" && (We.displayName = "RouteError");
35
- const Oe = /* @__PURE__ */ R.createContext(null);
36
- function Le(t) {
37
- let c = R.useContext(Ce).outlet;
38
- return c && /* @__PURE__ */ R.createElement(Oe.Provider, {
39
- value: t
40
- }, c);
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, {
39
+ value: e
40
+ }, o);
41
41
  }
42
- function je(t) {
43
- return Le(t.context);
42
+ function je(e) {
43
+ return Le(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 Ve = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), $e = (...t) => t.filter((c, k, b) => !!c && c.trim() !== "" && b.indexOf(c) === k).join(" ").trim();
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();
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 Pe = {
60
+ var Ee = {
61
61
  xmlns: "http://www.w3.org/2000/svg",
62
62
  width: 24,
63
63
  height: 24,
@@ -74,30 +74,30 @@ var Pe = {
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 He = me(
77
+ const _e = ve(
78
78
  ({
79
- color: t = "currentColor",
80
- size: c = 24,
81
- strokeWidth: k = 2,
82
- absoluteStrokeWidth: b,
83
- className: i = "",
79
+ color: e = "currentColor",
80
+ size: o = 24,
81
+ strokeWidth: n = 2,
82
+ absoluteStrokeWidth: h,
83
+ className: a = "",
84
84
  children: $,
85
- iconNode: O,
86
- ...z
87
- }, P) => xe(
85
+ iconNode: W,
86
+ ...M
87
+ }, _) => le(
88
88
  "svg",
89
89
  {
90
- ref: P,
91
- ...Pe,
92
- width: c,
93
- height: c,
94
- stroke: t,
95
- strokeWidth: b ? Number(k) * 24 / Number(c) : k,
96
- className: $e("lucide", i),
97
- ...z
90
+ ref: _,
91
+ ...Ee,
92
+ width: o,
93
+ height: o,
94
+ stroke: e,
95
+ strokeWidth: h ? Number(n) * 24 / Number(o) : n,
96
+ className: ye("lucide", a),
97
+ ...M
98
98
  },
99
99
  [
100
- ...O.map(([u, d]) => xe(u, d)),
100
+ ...W.map(([f, p]) => le(f, p)),
101
101
  ...Array.isArray($) ? $ : [$]
102
102
  ]
103
103
  )
@@ -108,16 +108,16 @@ const He = me(
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 Be = (t, c) => {
112
- const k = me(
113
- ({ className: b, ...i }, $) => xe(He, {
111
+ const Ce = (e, o) => {
112
+ const n = ve(
113
+ ({ className: h, ...a }, $) => le(_e, {
114
114
  ref: $,
115
- iconNode: c,
116
- className: $e(`lucide-${Ve(t)}`, b),
117
- ...i
115
+ iconNode: o,
116
+ className: ye(`lucide-${He(e)}`, h),
117
+ ...a
118
118
  })
119
119
  );
120
- return k.displayName = `${t}`, k;
120
+ return n.displayName = `${e}`, n;
121
121
  };
122
122
  /**
123
123
  * @license lucide-react v0.456.0 - ISC
@@ -125,7 +125,7 @@ const Be = (t, c) => {
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 _e = Be("ArrowLeft", [
128
+ const Ve = Ce("ArrowLeft", [
129
129
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
130
130
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
131
131
  ]);
@@ -135,30 +135,57 @@ const _e = Be("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 se = Be("ChevronRight", [
138
+ const U = Ce("ChevronRight", [
139
139
  ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
140
- ]), Ge = l.div`
140
+ ]), Pe = l.div.attrs({
141
+ className: "dashboard-container-wrapper"
142
+ })`
141
143
  display: flex;
142
144
  justify-content: flex-start;
143
145
  align-items: flex-start;
144
- margin-left: 20px;
146
+ margin-left: ${({ theme: e }) => {
147
+ var o;
148
+ return ((o = e.space) == null ? void 0 : o.margin) || "20px";
149
+ }};
145
150
  flex-direction: column;
146
151
  height: 100%;
147
152
  width: 100%;
148
153
  max-width: 98%;
149
154
  position: relative;
150
- `, Ke = l.div`
155
+ background: ${({ theme: e }) => {
156
+ var o, n;
157
+ return ((o = e.colors) == null ? void 0 : o.dashboardBackground) ?? ((n = e.colors) == null ? void 0 : n.appBackground) ?? "transparent";
158
+ }};
159
+ color: ${({ theme: e }) => {
160
+ var o;
161
+ return ((o = e.colors) == null ? void 0 : o.text) || "#1D2129";
162
+ }};
163
+ font-family: ${({ theme: e }) => {
164
+ var o, n;
165
+ return ((n = (o = e.fonts) == null ? void 0 : o.body) == null ? void 0 : n.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif";
166
+ }};
167
+ `, Ge = l.div.attrs({
168
+ className: "dashboard-container-header"
169
+ })`
151
170
  display: flex;
152
- height: 38px;
171
+ height: ${({ theme: e }) => {
172
+ var o;
173
+ return ((o = e.space) == null ? void 0 : o.dashboardHeaderHeight) ?? "38px";
174
+ }};
153
175
  z-index: 10;
154
176
  background: transparent;
155
- gap: 8px;
177
+ gap: ${({ theme: e }) => {
178
+ var o;
179
+ return ((o = e.space) == null ? void 0 : o.padding) || "8px";
180
+ }};
156
181
  flex-direction: row;
157
182
  align-items: center;
158
183
  justify-content: flex-start;
159
184
  width: 100%;
160
185
  min-width: 0; /* 确保 flex 子元素可以收缩 */
161
- `, Ye = l.button`
186
+ `, Ke = l.button.attrs({
187
+ className: "dashboard-container-back-button"
188
+ })`
162
189
  display: flex;
163
190
  align-items: center;
164
191
  justify-content: center;
@@ -167,6 +194,14 @@ const se = Be("ChevronRight", [
167
194
  background: transparent;
168
195
  border: none;
169
196
  cursor: pointer;
197
+ color: ${({ theme: e }) => {
198
+ var o;
199
+ return ((o = e.colors) == null ? void 0 : o.primary) || "#4E6EF2";
200
+ }};
201
+ border-radius: ${({ theme: e }) => {
202
+ var o;
203
+ return ((o = e.space) == null ? void 0 : o.radius) || "6px";
204
+ }};
170
205
 
171
206
  /* 仅让图标在 hover 时上浮,按钮背景保持透明 */
172
207
  svg {
@@ -179,13 +214,26 @@ const se = Be("ChevronRight", [
179
214
 
180
215
  &:hover svg {
181
216
  transform: translateY(-1px);
217
+ color: ${({ theme: e }) => {
218
+ var o, n;
219
+ return ((o = e.colors) == null ? void 0 : o.primaryHover) || ((n = e.colors) == null ? void 0 : n.primary) || "#6D86F5";
220
+ }};
182
221
  }
183
222
 
184
223
  &:active svg {
185
224
  transform: translateY(0);
225
+ color: ${({ theme: e }) => {
226
+ var o, n;
227
+ return ((o = e.colors) == null ? void 0 : o.primaryActive) || ((n = e.colors) == null ? void 0 : n.primary) || "#2D4BE0";
228
+ }};
186
229
  }
187
- `, Ee = l.div`
188
- line-height: 1.4;
230
+ `, Ye = l.div.attrs({
231
+ className: "dashboard-container-title"
232
+ })`
233
+ line-height: ${({ theme: e }) => {
234
+ var o;
235
+ return ((o = e.space) == null ? void 0 : o.lineHeight) || "1.4";
236
+ }};
189
237
  cursor: pointer;
190
238
  transition: color 0.2s ease;
191
239
  white-space: nowrap;
@@ -193,18 +241,49 @@ const se = Be("ChevronRight", [
193
241
  text-overflow: ellipsis;
194
242
  max-width: 200px;
195
243
  min-width: 0;
244
+ color: ${({ theme: e }) => {
245
+ var o;
246
+ return ((o = e.colors) == null ? void 0 : o.text) || "#1D2129";
247
+ }};
248
+ font-size: ${({ theme: e }) => {
249
+ var o, n;
250
+ return ((n = (o = e.fonts) == null ? void 0 : o.heading) == null ? void 0 : n.size) || "16px";
251
+ }};
252
+ font-weight: ${({ theme: e }) => {
253
+ var o, n;
254
+ return ((n = (o = e.fonts) == null ? void 0 : o.heading) == null ? void 0 : n.weight) || "600";
255
+ }};
196
256
 
197
257
  &:hover {
198
- color: #007bff;
258
+ color: ${({ theme: e }) => {
259
+ var o;
260
+ return ((o = e.colors) == null ? void 0 : o.primary) || "#4E6EF2";
261
+ }};
199
262
  }
200
- `, qe = l.div`
201
- line-height: 1.4;
263
+ `, qe = l.div.attrs({
264
+ className: "dashboard-container-description"
265
+ })`
266
+ line-height: ${({ theme: e }) => {
267
+ var o;
268
+ return ((o = e.space) == null ? void 0 : o.lineHeight) || "1.4";
269
+ }};
202
270
  white-space: nowrap;
203
271
  overflow: hidden;
204
272
  text-overflow: ellipsis;
205
273
  flex: 1;
206
274
  min-width: 0;
207
- `, ve = l.div`
275
+ color: ${({ theme: e }) => {
276
+ var o, n;
277
+ return ((o = e.colors) == null ? void 0 : o.textSecondary) || ((n = e.colors) == null ? void 0 : n.disabledText) || "#4E5969";
278
+ }};
279
+ opacity: 0.7;
280
+ font-size: ${({ theme: e }) => {
281
+ var o, n;
282
+ return ((n = (o = e.fonts) == null ? void 0 : o.body) == null ? void 0 : n.size) || "12px";
283
+ }};
284
+ `, we = l.div.attrs({
285
+ className: "dashboard-container-breadcrumb"
286
+ })`
208
287
  display: flex;
209
288
  align-items: center;
210
289
  gap: 4px;
@@ -212,14 +291,22 @@ const se = Be("ChevronRight", [
212
291
  max-width: 50%;
213
292
  min-width: 0;
214
293
  overflow: hidden;
215
- `, ce = l.div`
294
+ `, ee = l.div.attrs({
295
+ className: "dashboard-container-breadcrumb-item"
296
+ })`
216
297
  display: flex;
217
298
  align-items: center;
218
299
  gap: 4px;
219
- font-size: 14px;
220
- color: ${(t) => t.$isLast ? "#343a40" : "#6c757d"};
221
- font-weight: ${(t) => t.$isLast ? "600" : "normal"};
222
- cursor: ${(t) => t.$isClickable ? "pointer" : "default"};
300
+ font-size: ${({ theme: e }) => {
301
+ var o, n;
302
+ return ((n = (o = e.fonts) == null ? void 0 : o.body) == null ? void 0 : n.size) || "14px";
303
+ }};
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";
307
+ }};
308
+ font-weight: ${({ $isLast: e }) => e ? "600" : "normal"};
309
+ cursor: ${({ $isClickable: e }) => e ? "pointer" : "default"};
223
310
  transition: color 0.2s ease;
224
311
  white-space: nowrap;
225
312
  overflow: hidden;
@@ -227,238 +314,249 @@ const se = Be("ChevronRight", [
227
314
  max-width: 120px;
228
315
 
229
316
  &:hover {
230
- color: ${(t) => t.$isLast ? "#007bff" : "inherit"};
317
+ color: ${({ $isLast: e, theme: o }) => {
318
+ var n;
319
+ return e ? ((n = o.colors) == null ? void 0 : n.primary) || "#4E6EF2" : "inherit";
320
+ }};
231
321
  }
232
- `, de = l.div`
322
+ `, oe = l.div.attrs({
323
+ className: "dashboard-container-breadcrumb-separator"
324
+ })`
233
325
  display: flex;
234
326
  align-items: center;
235
- color: #6c757d;
327
+ color: ${({ theme: e }) => {
328
+ var o, n;
329
+ return ((o = e.colors) == null ? void 0 : o.textSecondary) || ((n = e.colors) == null ? void 0 : n.disabledText) || "#6c757d";
330
+ }};
236
331
  margin: 0 2px;
237
- `, Xe = l.div`
332
+ `, Ze = l.div.attrs({
333
+ className: "dashboard-container-content"
334
+ })`
238
335
  display: flex;
239
336
  flex-direction: column;
240
337
  width: 100%;
241
338
  height: calc(100% - 45px);
242
339
  min-height: 650px;
243
340
  overflow: auto;
244
- `;
245
- l.div`
246
- position: fixed;
247
- bottom: 20px;
248
- left: 50%;
249
- transform: translateX(-50%);
250
- z-index: 1000;
251
- `;
252
- const $t = ({
253
- children: t,
254
- goBack: c,
255
- title: k,
256
- description: b,
257
- breadcrumbs: i,
341
+ background: ${({ theme: e }) => {
342
+ var o, n;
343
+ return ((o = e.colors) == null ? void 0 : o.dashboardBackground) || ((n = e.colors) == null ? void 0 : n.background) || "#FFFFFF";
344
+ }};
345
+ /* 优先使用 dashboardBorder,如果没有则使用 border 颜色构建默认 border */
346
+ border: ${({ theme: e }) => {
347
+ var o, n;
348
+ 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
+ }};
350
+ 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";
353
+ }};
354
+ /* 优先使用 dashboardShadow,如果没有则使用 shadow */
355
+ box-shadow: ${({ theme: e }) => {
356
+ var o, n;
357
+ return ((o = e.colors) == null ? void 0 : o.dashboardShadow) || ((n = e.colors) == null ? void 0 : n.shadow) || "none";
358
+ }};
359
+ `, Xe = l.div.attrs({
360
+ className: "dashboard-container-nav"
361
+ })`
362
+ flex: 0 0 ${({ $isOpen: e }) => e ? "72px" : "28px"};
363
+ transition: flex-basis 0.2s ease;
364
+ `, Je = l.div.attrs({
365
+ className: "dashboard-container-main-wrapper"
366
+ })`
367
+ display: flex;
368
+ flex-direction: column;
369
+ flex: 1;
370
+ min-width: 0;
371
+ background: ${({ theme: e }) => {
372
+ var o;
373
+ return ((o = e.colors) == null ? void 0 : o.dashboardMainBackground) ?? "transparent";
374
+ }};
375
+ `, Qe = l.div.attrs({
376
+ className: "dashboard-container-main-layout"
377
+ })`
378
+ height: 100%;
379
+ display: flex;
380
+ width: 100%;
381
+ gap: ${({ theme: e }) => {
382
+ var o;
383
+ return ((o = e.space) == null ? void 0 : o.size) || "12px";
384
+ }};
385
+ `, No = ({
386
+ children: e,
387
+ goBack: o,
388
+ title: n,
389
+ description: h,
390
+ breadcrumbs: a,
258
391
  dockItems: $,
259
- dockActiveMode: O = "single",
260
- defaultDockActiveId: z,
261
- defaultDockActiveIds: P,
262
- styles: u,
263
- eventsEmit: d
392
+ // 以下参数为兼容旧版本保留,当前未使用
393
+ dockActiveMode: W = "single",
394
+ defaultDockActiveId: M,
395
+ defaultDockActiveIds: _,
396
+ styles: f,
397
+ eventsEmit: p
264
398
  }) => {
265
- var H, o, _, ie, U, pe, re, V;
266
- const L = be(), S = E(
399
+ const O = se(), I = K(
267
400
  // 基础:默认主题 + useTheme的配置
268
- E({ theme: M, mode: "light" }, L),
401
+ K({ theme: F, mode: "light" }, O),
269
402
  // 最高层:用户手动传入的styles
270
- u
271
- ), r = (S == null ? void 0 : S.theme) || M, q = x.useRef(null), T = () => {
272
- d != null && d.onGoBack ? d.onGoBack() : c && c();
273
- }, j = () => {
274
- d != null && d.onTitleClick && d.onTitleClick();
275
- }, A = (w, G) => {
276
- d != null && d.onBreadcrumbClick ? d.onBreadcrumbClick(w, G) : w.onClick && w.onClick();
277
- }, I = (w, G) => {
278
- d != null && d.onDockItemClick && d.onDockItemClick(w, G);
279
- }, F = () => {
280
- if (!i || i.length === 0) return null;
281
- const w = x.useRef(null), [G, X] = x.useState({ start: 0, end: i.length, showEllipsis: !1 }), Z = x.useCallback(() => {
282
- if (!w.current || i.length <= 3) {
283
- X({ start: 0, end: i.length, showEllipsis: !1 });
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 = () => {
413
+ 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) {
416
+ r({ start: 0, end: a.length, showEllipsis: !1 });
284
417
  return;
285
418
  }
286
- const y = w.current.offsetWidth * 0.5;
287
- let K = Math.floor((y - 30) / (120 + 20));
288
- if (K < 2 && (K = 2), K >= i.length) {
289
- X({ start: 0, end: i.length, showEllipsis: !1 });
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
+ r({ start: 0, end: a.length, showEllipsis: !1 });
290
423
  return;
291
424
  }
292
- const ae = 0, te = Math.min(K - 1, i.length);
293
- X({
294
- start: ae,
295
- end: te,
296
- showEllipsis: te < i.length - 1
425
+ const Z = 0, E = Math.min(P - 1, a.length);
426
+ r({
427
+ start: Z,
428
+ end: E,
429
+ showEllipsis: E < a.length - 1
297
430
  });
298
- }, [i.length]);
299
- if (x.useEffect(() => {
300
- Z();
301
- const f = new ResizeObserver(() => {
302
- Z();
431
+ }, [a.length]);
432
+ if (w.useEffect(() => {
433
+ j();
434
+ const b = new ResizeObserver(() => {
435
+ j();
303
436
  });
304
- return w.current && f.observe(w.current), () => {
305
- f.disconnect();
437
+ return N.current && b.observe(N.current), () => {
438
+ b.disconnect();
306
439
  };
307
- }, [Z]), i.length <= 3)
308
- return /* @__PURE__ */ e(ve, { children: i.map((f, y) => /* @__PURE__ */ g(x.Fragment, { children: [
309
- /* @__PURE__ */ e(
310
- ce,
440
+ }, [j]), a.length <= 3)
441
+ return /* @__PURE__ */ t(we, { theme: s, children: a.map((b, k) => /* @__PURE__ */ x(w.Fragment, { children: [
442
+ /* @__PURE__ */ t(
443
+ ee,
311
444
  {
312
- $isLast: y === i.length - 1,
313
- $isClickable: !!(y < i.length - 1 || f.onClick),
314
- onClick: () => A(f, y),
315
- style: {
316
- color: y === i.length - 1 ? r.colors.text : r.colors.textSecondary || r.colors.disabledText
317
- },
318
- title: f.label,
319
- children: f.label
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
320
451
  }
321
452
  ),
322
- y < i.length - 1 && /* @__PURE__ */ e(de, { children: /* @__PURE__ */ e(se, { size: 14 }) })
323
- ] }, f.id)) });
324
- const { start: N, end: D, showEllipsis: ee } = G;
325
- return /* @__PURE__ */ g(ve, { children: [
326
- i.slice(N, D).map((f, y) => /* @__PURE__ */ g(x.Fragment, { children: [
327
- /* @__PURE__ */ e(
328
- ce,
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: [
458
+ /* @__PURE__ */ t(
459
+ ee,
329
460
  {
330
- $isLast: y === D - N - 1 && !ee,
331
- $isClickable: !!(y < D - N - 1 || f.onClick),
332
- onClick: () => A(f, N + y),
333
- style: {
334
- color: y === D - N - 1 && !ee ? r.colors.text : r.colors.textSecondary || r.colors.disabledText
335
- },
336
- title: f.label,
337
- children: f.label
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
338
467
  }
339
468
  ),
340
- y < D - N - 1 && /* @__PURE__ */ e(de, { children: /* @__PURE__ */ e(se, { size: 14 }) })
341
- ] }, f.id)),
342
- ee && /* @__PURE__ */ g(Ie, { children: [
343
- /* @__PURE__ */ e(de, { children: /* @__PURE__ */ e(se, { size: 14 }) }),
344
- /* @__PURE__ */ e(
345
- ce,
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 }) }),
473
+ /* @__PURE__ */ t(
474
+ ee,
346
475
  {
347
476
  $isLast: !1,
348
477
  $isClickable: !1,
478
+ theme: s,
349
479
  style: {
350
- color: r.colors.textSecondary || r.colors.disabledText,
351
480
  cursor: "default",
352
481
  maxWidth: "auto"
353
482
  },
354
- title: `${i.slice(D, -1).map((f) => f.label).join(" > ")}`,
483
+ title: `${a.slice(H, -1).map((b) => b.label).join(" > ")}`,
355
484
  children: "..."
356
485
  }
357
486
  ),
358
- /* @__PURE__ */ e(de, { children: /* @__PURE__ */ e(se, { size: 14 }) }),
359
- /* @__PURE__ */ e(
360
- ce,
487
+ /* @__PURE__ */ t(oe, { theme: s, children: /* @__PURE__ */ t(U, { size: 14 }) }),
488
+ /* @__PURE__ */ t(
489
+ ee,
361
490
  {
362
491
  $isLast: !0,
363
- $isClickable: !!i[i.length - 1].onClick,
364
- onClick: () => A(i[i.length - 1], i.length - 1),
365
- style: {
366
- color: r.colors.text
367
- },
368
- title: i[i.length - 1].label,
369
- children: i[i.length - 1].label
492
+ $isClickable: !!a[a.length - 1].onClick,
493
+ onClick: () => T(a[a.length - 1], a.length - 1),
494
+ theme: s,
495
+ title: a[a.length - 1].label,
496
+ children: a[a.length - 1].label
370
497
  }
371
498
  )
372
499
  ] })
373
500
  ] });
374
- }, [ne, he] = x.useState(!0);
375
- return /* @__PURE__ */ e(
376
- Ge,
377
- {
378
- style: {
379
- background: r.colors.appBackground,
380
- color: r.colors.text,
381
- fontFamily: ((o = (H = r.fonts) == null ? void 0 : H.body) == null ? void 0 : o.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
382
- },
383
- children: /* @__PURE__ */ g("div", { style: { height: "100%", display: "flex", width: "100%", gap: 12 }, children: [
384
- $ && $.length > 0 && /* @__PURE__ */ e("div", { style: { flex: `0 0 ${ne ? 72 : 28}px`, transition: "flex-basis .2s ease" }, children: /* @__PURE__ */ e(
385
- Te,
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,
505
+ {
506
+ items: $,
507
+ open: J,
508
+ onOpenChange: te,
509
+ onItemClick: (m) => D({ id: String(m.key), label: m.name }, 0),
510
+ defaultOpen: !0
511
+ }
512
+ ) }),
513
+ /* @__PURE__ */ x(Je, { theme: s, children: [
514
+ (n || h || o || a) && /* @__PURE__ */ x(Ge, { ref: N, theme: s, children: [
515
+ o && /* @__PURE__ */ t(
516
+ Ke,
386
517
  {
387
- items: $,
388
- open: ne,
389
- onOpenChange: he,
390
- onItemClick: (w) => I({ id: String(w.key), label: w.name }, 0),
391
- defaultOpen: !0
518
+ onClick: A,
519
+ theme: s,
520
+ title: "\u8FD4\u56DE",
521
+ children: /* @__PURE__ */ t(Ve, { size: 18 })
392
522
  }
393
- ) }),
394
- /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0 }, children: [
395
- (k || b || c || i) && /* @__PURE__ */ g(Ke, { ref: q, children: [
396
- c && /* @__PURE__ */ e(
397
- Ye,
398
- {
399
- onClick: T,
400
- style: { color: r.colors.primary, borderRadius: r.space.radius || "6px" },
401
- title: "\u8FD4\u56DE",
402
- children: /* @__PURE__ */ e(_e, { size: 18 })
403
- }
404
- ),
405
- F(),
406
- k && /* @__PURE__ */ e(
407
- Ee,
408
- {
409
- onClick: j,
410
- style: {
411
- color: r.colors.text,
412
- fontSize: ((ie = (_ = r.fonts) == null ? void 0 : _.heading) == null ? void 0 : ie.size) || "16px",
413
- fontWeight: ((pe = (U = r.fonts) == null ? void 0 : U.heading) == null ? void 0 : pe.weight) || "600"
414
- },
415
- title: k,
416
- children: k
417
- }
418
- ),
419
- b && /* @__PURE__ */ e(
420
- qe,
421
- {
422
- style: {
423
- color: r.colors.textSecondary || r.colors.disabledText,
424
- opacity: 0.7,
425
- fontSize: ((V = (re = r.fonts) == null ? void 0 : re.body) == null ? void 0 : V.size) || "12px"
426
- },
427
- title: b,
428
- children: b
429
- }
430
- )
431
- ] }),
432
- /* @__PURE__ */ e(
433
- Xe,
434
- {
435
- style: {
436
- background: r.colors.dashboardBackground || "transparent",
437
- border: `1px solid ${r.colors.border}` || void 0,
438
- borderRadius: r.space.radius || void 0,
439
- boxShadow: r.colors.shadow || void 0
440
- },
441
- children: t || /* @__PURE__ */ e(je, {})
442
- }
443
- )
444
- ] })
445
- ] })
446
- }
447
- );
448
- }, Ze = l.div.withConfig({
449
- shouldForwardProp: (t) => !["backgroundImage", "backgroundColor"].includes(t)
523
+ ),
524
+ z(),
525
+ n && /* @__PURE__ */ t(
526
+ Ye,
527
+ {
528
+ onClick: L,
529
+ theme: s,
530
+ title: n,
531
+ children: n
532
+ }
533
+ ),
534
+ h && /* @__PURE__ */ t(
535
+ qe,
536
+ {
537
+ theme: s,
538
+ title: h,
539
+ children: h
540
+ }
541
+ )
542
+ ] }),
543
+ /* @__PURE__ */ t(Ze, { theme: s, children: e || /* @__PURE__ */ t(je, {}) })
544
+ ] })
545
+ ] }) });
546
+ }, Ue = l.div.withConfig({
547
+ shouldForwardProp: (e) => !["backgroundImage", "backgroundColor"].includes(e)
450
548
  })`
451
549
  position: fixed;
452
550
  top: 0;
453
551
  left: 0;
454
552
  width: 100vw;
455
553
  height: 100vh;
456
- background: ${(t) => t.backgroundImage ? `url(${t.backgroundImage}) center/cover no-repeat` : t.backgroundColor || "#1a1a1a"};
554
+ background: ${(e) => e.backgroundImage ? `url(${e.backgroundImage}) center/cover no-repeat` : e.backgroundColor || "#1a1a1a"};
457
555
  display: flex;
458
556
  flex-direction: column;
459
557
  overflow: hidden;
460
558
  z-index: 1;
461
- `, Je = l.div`
559
+ `, eo = l.div`
462
560
  height: 48px;
463
561
  width: 100%;
464
562
  display: flex;
@@ -467,7 +565,7 @@ const $t = ({
467
565
  background: transparent;
468
566
  z-index: 10;
469
567
  flex-shrink: 0;
470
- `, Qe = l.div`
568
+ `, oo = l.div`
471
569
  flex: 1;
472
570
  width: 100%;
473
571
  overflow-y: auto;
@@ -494,7 +592,7 @@ const $t = ({
494
592
  &::-webkit-scrollbar-thumb:hover {
495
593
  background: rgba(255, 255, 255, 0.5);
496
594
  }
497
- `, Ue = l.div`
595
+ `, to = l.div`
498
596
  height: 80px;
499
597
  width: 100%;
500
598
  display: flex;
@@ -504,68 +602,68 @@ const $t = ({
504
602
  background: transparent;
505
603
  z-index: 10;
506
604
  flex-shrink: 0;
507
- `, Bt = ({
508
- children: t,
509
- backgroundImage: c,
510
- backgroundColor: k,
511
- header: b,
512
- dockItems: i,
605
+ `, Ao = ({
606
+ children: e,
607
+ backgroundImage: o,
608
+ backgroundColor: n,
609
+ header: h,
610
+ dockItems: a,
513
611
  dockActiveMode: $ = "single",
514
- defaultDockActiveId: O,
515
- defaultDockActiveIds: z,
516
- styles: P,
517
- eventsEmit: u
612
+ defaultDockActiveId: W,
613
+ defaultDockActiveIds: M,
614
+ styles: _,
615
+ eventsEmit: f
518
616
  }) => {
519
- var j, A;
520
- const d = be(), L = E(
617
+ var L, T;
618
+ const p = se(), O = K(
521
619
  // 基础:默认主题 + useTheme的配置
522
- E({ theme: M, mode: "light" }, d),
620
+ K({ theme: F, mode: "light" }, p),
523
621
  // 最高层:用户手动传入的styles
524
- P
525
- ), S = (L == null ? void 0 : L.theme) || M, r = (I, F) => {
526
- u != null && u.onDockItemClick ? u.onDockItemClick(I, F) : I.onClick && I.onClick();
527
- }, q = (I, F) => {
528
- u != null && u.onDockActiveChange && u.onDockActiveChange(I, F);
529
- }, T = (I, F) => {
530
- u != null && u.onDockActiveChangeMultiple && u.onDockActiveChangeMultiple(I, F);
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);
531
629
  };
532
- return /* @__PURE__ */ g(
533
- Ze,
630
+ return /* @__PURE__ */ x(
631
+ Ue,
534
632
  {
535
- backgroundImage: c,
536
- backgroundColor: k,
633
+ backgroundImage: o,
634
+ backgroundColor: n,
537
635
  children: [
538
- b && /* @__PURE__ */ e(Je, { children: b }),
539
- /* @__PURE__ */ e(
540
- Qe,
636
+ h && /* @__PURE__ */ t(eo, { children: h }),
637
+ /* @__PURE__ */ t(
638
+ oo,
541
639
  {
542
640
  style: {
543
- color: S.colors.text,
544
- fontFamily: ((A = (j = S.fonts) == null ? void 0 : j.body) == null ? void 0 : A.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
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"
545
643
  },
546
- children: t
644
+ children: e
547
645
  }
548
646
  ),
549
- i && i.length > 0 && /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e(
550
- Ae,
647
+ a && a.length > 0 && /* @__PURE__ */ t(to, { children: /* @__PURE__ */ t(
648
+ Te,
551
649
  {
552
- items: i,
650
+ items: a,
553
651
  itemWidth: 48,
554
652
  itemHeight: 48,
555
653
  magnification: 1.5,
556
654
  itemGap: 8,
557
655
  activeMode: $,
558
- defaultActiveId: O,
559
- defaultActiveIds: z,
560
- onItemClick: r,
561
- onActiveChange: q,
562
- onActiveChangeMultiple: T
656
+ defaultActiveId: W,
657
+ defaultActiveIds: M,
658
+ onItemClick: s,
659
+ onActiveChange: N,
660
+ onActiveChangeMultiple: A
563
661
  }
564
662
  ) })
565
663
  ]
566
664
  }
567
665
  );
568
- }, et = l.div`
666
+ }, no = l.div`
569
667
  --header-height: 56px;
570
668
  --page-gutter: 16px;
571
669
  --sidebar-width: 264px;
@@ -578,7 +676,7 @@ const $t = ({
578
676
  min-height: 100vh;
579
677
  height: 100vh; /* 以视口高度为基准,便于内部独立滚动布局 */
580
678
  position: relative;
581
- `, tt = l.div`
679
+ `, ro = l.div`
582
680
  position: sticky;
583
681
  top: 0;
584
682
  z-index: 30;
@@ -590,16 +688,16 @@ const $t = ({
590
688
  padding: 0 16px;
591
689
  border-bottom: 1px solid rgba(0,0,0,0.06);
592
690
  backdrop-filter: blur(8px);
593
- `, ot = l.div`
691
+ `, io = l.div`
594
692
  display: flex;
595
693
  align-items: center;
596
694
  gap: 12px;
597
695
  min-width: 0;
598
- `, nt = l.div`
696
+ `, ao = l.div`
599
697
  display: flex;
600
698
  align-items: center;
601
699
  gap: 8px;
602
- `, ye = l.button`
700
+ `, ke = l.button`
603
701
  display: inline-flex;
604
702
  align-items: center;
605
703
  justify-content: center;
@@ -613,7 +711,7 @@ const $t = ({
613
711
 
614
712
  &:hover { background: rgba(0,0,0,0.04); }
615
713
  &:active { transform: translateY(1px); }
616
- `, it = l.div`
714
+ `, lo = l.div`
617
715
  display: grid;
618
716
  grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
619
717
  gap: 16px;
@@ -634,18 +732,18 @@ const $t = ({
634
732
  gap: 12px;
635
733
  padding: 12px 12px 20px 12px;
636
734
  }
637
- `, rt = l.aside`
735
+ `, so = l.aside`
638
736
  position: relative;
639
- `, lt = l.div`
737
+ `, co = l.div`
640
738
  height: 100%;
641
739
  overflow: hidden;
642
740
  padding-right: 8px;
643
741
  border-right: 1px solid rgba(0,0,0,0.06);
644
742
  transition: opacity .2s ease, transform .2s ease;
645
- opacity: ${(t) => t.$collapsed ? 0 : 1};
646
- transform: translateX(${(t) => t.$collapsed ? "-6px" : "0px"});
647
- pointer-events: ${(t) => t.$collapsed ? "none" : "auto"};
648
- `, at = l.button`
743
+ opacity: ${(e) => e.$collapsed ? 0 : 1};
744
+ transform: translateX(${(e) => e.$collapsed ? "-6px" : "0px"});
745
+ pointer-events: ${(e) => e.$collapsed ? "none" : "auto"};
746
+ `, ho = l.button`
649
747
  position: absolute;
650
748
  top: 6px;
651
749
  right: -10px;
@@ -660,16 +758,16 @@ const $t = ({
660
758
  justify-content: center;
661
759
  transition: background .15s ease;
662
760
  &:hover { background: rgba(0,0,0,0.12); }
663
- `, st = l.div`
761
+ `, po = l.div`
664
762
  height: 100%;
665
763
  overflow: auto;
666
764
  padding-right: 8px;
667
- `, ct = l.main`
765
+ `, uo = l.main`
668
766
  position: relative;
669
767
  min-width: 0;
670
768
  height: 100%;
671
769
  overflow: auto; /* 文档渲染区独立滚动 */
672
- `, dt = l.div`
770
+ `, go = l.div`
673
771
  width: 100%;
674
772
  max-width: var(--content-max);
675
773
  margin: 0 auto;
@@ -677,16 +775,16 @@ const $t = ({
677
775
  border-radius: 8px;
678
776
  padding: 0px 12px;
679
777
  padding-bottom: 120px; /* 底部留出足够的 margin,确保可以滚动到最底部 */
680
- `, ht = l.div`
778
+ `, fo = l.div`
681
779
  height: 100%;
682
780
  transition: opacity .5s ease;
683
- opacity: ${(t) => t.$opacity};
684
- `, pt = l.aside`
781
+ opacity: ${(e) => e.$opacity};
782
+ `, xo = l.aside`
685
783
  position: relative;
686
784
  z-index: 1;
687
785
  height: 100%;
688
786
  overflow: hidden;
689
- `, ut = l.div`
787
+ `, bo = l.div`
690
788
  /* 右侧目录独立滚动 */
691
789
  position: relative;
692
790
  height: 100%;
@@ -698,11 +796,11 @@ const $t = ({
698
796
  border-left: 1px solid rgba(0,0,0,0.06);
699
797
  background: transparent;
700
798
  z-index: 1;
701
- `, ft = l.div`
799
+ `, wo = l.div`
702
800
  transition: opacity .2s ease, transform .2s ease;
703
- opacity: ${(t) => t.$collapsed ? 0 : 1};
704
- transform: translateX(${(t) => t.$collapsed ? "6px" : "0px"});
705
- pointer-events: ${(t) => t.$collapsed ? "none" : "auto"};
801
+ opacity: ${(e) => e.$collapsed ? 0 : 1};
802
+ transform: translateX(${(e) => e.$collapsed ? "6px" : "0px"});
803
+ pointer-events: ${(e) => e.$collapsed ? "none" : "auto"};
706
804
  width: 100%;
707
805
  max-width: 100%;
708
806
  /* 不设置高度限制,让内容自然流动,由父容器 TocFloat 控制滚动 */
@@ -723,11 +821,11 @@ l.button`
723
821
  transition: background .15s ease;
724
822
  &:hover { background: rgba(0,0,0,0.12); }
725
823
  `;
726
- const ge = l.div`
824
+ const ae = l.div`
727
825
  font-size: 12px;
728
826
  opacity: .7;
729
827
  padding: 8px 8px;
730
- `, Q = l.button`
828
+ `, q = l.button`
731
829
  width: 100%;
732
830
  padding: 8px 10px;
733
831
  background: transparent;
@@ -742,6 +840,7 @@ const ge = l.div`
742
840
  word-wrap: break-word;
743
841
  word-break: break-word;
744
842
  overflow-wrap: break-word;
843
+ box-sizing: border-box; /* 确保 padding 包含在高度内 */
745
844
  /* 限制为最多两行,超出显示省略号 */
746
845
  display: -webkit-box;
747
846
  -webkit-line-clamp: 2;
@@ -749,13 +848,15 @@ const ge = l.div`
749
848
  overflow: hidden;
750
849
  text-overflow: ellipsis;
751
850
  min-width: 0; /* 允许内容收缩 */
851
+ /* 强制限制高度为两行:font-size(13px) * line-height(1.5) * 2行 = 39px,加上上下padding(16px) = 55px */
852
+ max-height: calc(13px * 1.5 * 2 + 16px); /* 强制限制高度,防止第三行显示 */
752
853
 
753
854
  &:hover {
754
855
  background: rgba(0,0,0,0.04);
755
856
  }
756
857
 
757
- ${(t) => t.$active ? "background: rgba(0,0,0,0.08); font-weight: 600;" : ""}
758
- `, gt = l.div`
858
+ ${(e) => e.$active ? "background: rgba(0,0,0,0.08); font-weight: 600;" : ""}
859
+ `, ko = l.div`
759
860
  display: flex;
760
861
  align-items: center;
761
862
  gap: 8px;
@@ -765,16 +866,16 @@ const ge = l.div`
765
866
  overflow-y: hidden;
766
867
  scrollbar-width: none;
767
868
  &::-webkit-scrollbar { display: none; }
768
- `, xt = l.div`
869
+ `, vo = l.div`
769
870
  width: 1px;
770
871
  height: 16px;
771
872
  background: currentColor;
772
873
  opacity: .2;
773
- `, bt = {
874
+ `, mo = {
774
875
  theme: {
775
- ...M,
876
+ ...F,
776
877
  colors: {
777
- ...M.colors,
878
+ ...F.colors,
778
879
  appBackground: "#ffffff",
779
880
  panelBackground: "#ffffff",
780
881
  dashboardBackground: "#ffffff",
@@ -784,11 +885,11 @@ const ge = l.div`
784
885
  shadow: "0 1px 2px rgba(0,0,0,0.06)"
785
886
  }
786
887
  }
787
- }, wt = {
888
+ }, yo = {
788
889
  theme: {
789
- ...M,
890
+ ...F,
790
891
  colors: {
791
- ...M.colors,
892
+ ...F.colors,
792
893
  appBackground: "#0f172a",
793
894
  panelBackground: "#111827",
794
895
  dashboardBackground: "#0b1220",
@@ -799,237 +900,237 @@ const ge = l.div`
799
900
  }
800
901
  },
801
902
  mode: "dark"
802
- }, Dt = (t) => {
803
- var K, ae, te, we;
903
+ }, To = (e) => {
904
+ var ue, ge, fe, xe;
804
905
  const {
805
- children: c,
806
- headerLogo: k,
807
- contentKey: b,
808
- modules: i,
906
+ children: o,
907
+ headerLogo: n,
908
+ contentKey: h,
909
+ modules: a,
809
910
  activeModuleKey: $,
810
- onModuleChange: O,
811
- languages: z,
812
- activeLanguageKey: P,
813
- onLanguageChange: u,
814
- themes: d,
815
- activeThemeKey: L,
816
- onThemeChange: S,
817
- sidebarItems: r,
818
- activeSidebarId: q,
819
- onSidebarItemClick: T,
820
- activeTocId: j,
821
- onTocItemClick: A,
822
- collapsibleSidebar: I = !0,
823
- styles: F
824
- } = t, ne = be(), he = t.activeThemeKey === "dark" ? wt : bt, H = E(
825
- E(
826
- E({ theme: M, mode: "light" }, ne),
827
- he
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
828
929
  ),
829
- F
830
- ), o = (H == null ? void 0 : H.theme) || M, [_, ie] = x.useState(!1), [U, pe] = x.useState(!1), [re, V] = x.useState(!1), w = typeof j == "string", [G, X] = x.useState(j), Z = x.useRef(null), [N, D] = x.useState(void 0), [ee, f] = x.useState(c), [y, ue] = x.useState(1);
831
- x.useEffect(() => {
832
- if (b === void 0) {
833
- f(c);
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);
834
935
  return;
835
936
  }
836
- ue(0);
837
- const n = setTimeout(() => {
838
- f(c), requestAnimationFrame(() => ue(1));
937
+ he(0);
938
+ const i = setTimeout(() => {
939
+ de(o), requestAnimationFrame(() => he(1));
839
940
  }, 120);
840
- return () => clearTimeout(n);
841
- }, [b, c]), x.useMemo(() => {
842
- var n, h, s, m, B, a, v, p, Y, C, W, J, oe;
941
+ return () => clearTimeout(i);
942
+ }, [h, o]), w.useMemo(() => {
943
+ var i, u, d, y, B, c, v, g, G, C, R, Y, X;
843
944
  return {
844
- primaryColor: (n = o == null ? void 0 : o.colors) == null ? void 0 : n.primary,
845
- secondaryColor: (h = o == null ? void 0 : o.colors) == null ? void 0 : h.secondary,
846
- backgroundColor: (s = o == null ? void 0 : o.colors) == null ? void 0 : s.appBackground,
847
- textColor: (m = o == null ? void 0 : o.colors) == null ? void 0 : m.text,
848
- borderColor: (B = o == null ? void 0 : o.colors) == null ? void 0 : B.border,
849
- disabledBackground: (a = o == null ? void 0 : o.colors) == null ? void 0 : a.disabledBackground,
850
- borderRadius: (v = o == null ? void 0 : o.space) == null ? void 0 : v.radius,
851
- padding: (p = o == null ? void 0 : o.space) == null ? void 0 : p.padding,
852
- margin: (Y = o == null ? void 0 : o.space) == null ? void 0 : Y.margin,
853
- baseFontSize: (W = (C = o == null ? void 0 : o.fonts) == null ? void 0 : C.body) != null && W.size ? parseInt((oe = (J = o == null ? void 0 : o.fonts) == null ? void 0 : J.body) == null ? void 0 : oe.size, 10) : void 0
945
+ 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,
948
+ 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,
951
+ 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
854
955
  };
855
- }, [o]), x.useEffect(() => {
856
- if (t.tocItems)
857
- D(void 0);
956
+ }, [r]), w.useEffect(() => {
957
+ if (e.tocItems)
958
+ E(void 0);
858
959
  else {
859
- b !== void 0 && D(void 0);
860
- let n = 0;
861
- const h = 10;
862
- let s = null, m = null;
960
+ h !== void 0 && E(void 0);
961
+ let i = 0;
962
+ const u = 10;
963
+ let d = null, y = null;
863
964
  const B = () => {
864
- const a = Z.current;
865
- if (!a) {
866
- n < h ? (n++, s = setTimeout(B, 200)) : D([]);
965
+ const c = P.current;
966
+ if (!c) {
967
+ i < u ? (i++, d = setTimeout(B, 200)) : E([]);
867
968
  return;
868
969
  }
869
- const v = Array.from(a.querySelectorAll("h1, h2, h3"));
970
+ const v = Array.from(c.querySelectorAll("h1, h2, h3"));
870
971
  if (v.length === 0) {
871
- n < h ? (n++, s = setTimeout(B, 200)) : D([]);
972
+ i < u ? (i++, d = setTimeout(B, 200)) : E([]);
872
973
  return;
873
974
  }
874
- const p = /* @__PURE__ */ new Map(), Y = v.map((C) => {
875
- var ke;
876
- const W = C.id || ((ke = C.textContent) == null ? void 0 : ke.trim().replace(/\s+/g, "-").toLowerCase()) || "", J = p.get(W) || 0;
877
- p.set(W, J + 1);
878
- const oe = J > 0 ? `${W}-${J}` : W;
879
- C.id || (C.id = oe);
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);
880
981
  const De = C.tagName === "H1" ? 1 : C.tagName === "H2" ? 2 : 3;
881
- return { id: oe, label: C.textContent || "", level: De };
982
+ return { id: X, label: C.textContent || "", level: De };
882
983
  });
883
- D(Y);
984
+ E(G);
884
985
  };
885
- return m = requestAnimationFrame(() => {
886
- s = setTimeout(B, 100);
986
+ return y = requestAnimationFrame(() => {
987
+ d = setTimeout(B, 100);
887
988
  }), () => {
888
- m !== null && cancelAnimationFrame(m), s !== null && clearTimeout(s);
989
+ y !== null && cancelAnimationFrame(y), d !== null && clearTimeout(d);
889
990
  };
890
991
  }
891
- }, [c, t.tocItems, b]), x.useEffect(() => {
892
- if (w) return;
893
- const h = ((t.tocItems ?? N) || []).map((a) => a.id).filter(Boolean);
894
- if (h.length === 0) return;
895
- X(void 0);
896
- const s = { root: null, rootMargin: "0px 0px -70% 0px", threshold: 0 }, m = (a) => {
897
- var p, Y;
898
- const v = a.filter((C) => C.isIntersecting).sort((C, W) => C.boundingClientRect.top - W.boundingClientRect.top);
899
- (Y = (p = v[0]) == null ? void 0 : p.target) != null && Y.id && X(v[0].target.id);
900
- }, B = new IntersectionObserver(m, s);
901
- return h.forEach((a) => {
902
- const v = document.getElementById(a);
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);
903
1004
  v && B.observe(v);
904
1005
  }), () => B.disconnect();
905
- }, [N, w, t.tocItems, b]);
906
- const fe = (n, h) => {
907
- if (!n || n.length === 0) return;
908
- const s = Math.max(0, n.findIndex((B) => B.key === h)), m = n[(s + 1) % n.length];
909
- return m == null ? void 0 : m.key;
910
- }, le = (n) => {
911
- const h = document.getElementById(n);
912
- h && h.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" });
1006
+ }, [Z, Q, e.tocItems, h]);
1007
+ const pe = (i, u) => {
1008
+ if (!i || i.length === 0) return;
1009
+ const d = Math.max(0, i.findIndex((B) => B.key === u)), y = i[(d + 1) % i.length];
1010
+ 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" });
913
1014
  };
914
- return /* @__PURE__ */ e(Se, { theme: o, mode: H.mode, children: /* @__PURE__ */ g(
915
- et,
1015
+ return /* @__PURE__ */ t(Ne, { theme: r, mode: m.mode, children: /* @__PURE__ */ x(
1016
+ no,
916
1017
  {
917
1018
  style: {
918
- background: o.colors.appBackground,
919
- color: o.colors.text,
920
- fontFamily: ((ae = (K = o.fonts) == null ? void 0 : K.body) == null ? void 0 : ae.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
1019
+ background: r.colors.appBackground,
1020
+ 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"
921
1022
  },
922
1023
  children: [
923
- /* @__PURE__ */ g(
924
- tt,
1024
+ /* @__PURE__ */ x(
1025
+ ro,
925
1026
  {
926
1027
  style: {
927
- background: o.colors.panelBackground || o.colors.dashboardBackground || "rgba(255,255,255,0.6)",
928
- color: o.colors.text
1028
+ background: r.colors.panelBackground || r.colors.dashboardBackground || "rgba(255,255,255,0.6)",
1029
+ color: r.colors.text
929
1030
  },
930
1031
  children: [
931
- /* @__PURE__ */ g(ot, { children: [
932
- k,
933
- i && i.length > 0 && /* @__PURE__ */ e(gt, { children: i.map((n) => /* @__PURE__ */ e(
934
- Q,
1032
+ /* @__PURE__ */ x(io, { children: [
1033
+ n,
1034
+ a && a.length > 0 && /* @__PURE__ */ t(ko, { children: a.map((i) => /* @__PURE__ */ t(
1035
+ q,
935
1036
  {
936
- $active: n.key === $,
937
- onClick: () => O == null ? void 0 : O(n.key),
938
- title: n.label,
939
- children: n.label
1037
+ $active: i.key === $,
1038
+ onClick: () => W == null ? void 0 : W(i.key),
1039
+ title: i.label,
1040
+ children: i.label
940
1041
  },
941
- n.key
1042
+ i.key
942
1043
  )) })
943
1044
  ] }),
944
- /* @__PURE__ */ g(nt, { children: [
945
- /* @__PURE__ */ e("div", { className: "hide-on-desktop", style: { display: "none" } }),
946
- z && z.length > 0 && /* @__PURE__ */ e(
947
- ye,
1045
+ /* @__PURE__ */ x(ao, { children: [
1046
+ /* @__PURE__ */ t("div", { className: "hide-on-desktop", style: { display: "none" } }),
1047
+ M && M.length > 0 && /* @__PURE__ */ t(
1048
+ ke,
948
1049
  {
949
1050
  onClick: () => {
950
- const n = fe(z, P);
951
- n && (u == null || u(n));
1051
+ const i = pe(M, _);
1052
+ i && (f == null || f(i));
952
1053
  },
953
- title: ((te = z.find((n) => n.key === P)) == null ? void 0 : te.label) || "Language",
1054
+ title: ((fe = M.find((i) => i.key === _)) == null ? void 0 : fe.label) || "Language",
954
1055
  "aria-label": "language",
955
- style: { color: o.colors.text },
956
- children: /* @__PURE__ */ g("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
957
- /* @__PURE__ */ e("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" }),
958
- /* @__PURE__ */ e("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" })
1056
+ 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: [
1058
+ /* @__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
+ /* @__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" })
959
1060
  ] })
960
1061
  }
961
1062
  ),
962
- /* @__PURE__ */ e(xt, {}),
963
- d && d.length > 0 && /* @__PURE__ */ e(
964
- ye,
1063
+ /* @__PURE__ */ t(vo, {}),
1064
+ p && p.length > 0 && /* @__PURE__ */ t(
1065
+ ke,
965
1066
  {
966
1067
  onClick: () => {
967
- const n = fe(d, L);
968
- n && (S == null || S(n));
1068
+ const i = pe(p, O);
1069
+ i && (I == null || I(i));
969
1070
  },
970
- title: ((we = d.find((n) => n.key === L)) == null ? void 0 : we.label) || "Theme",
1071
+ title: ((xe = p.find((i) => i.key === O)) == null ? void 0 : xe.label) || "Theme",
971
1072
  "aria-label": "theme",
972
- style: { color: o.colors.text },
973
- children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("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" }) })
1073
+ style: { color: r.colors.text },
1074
+ 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" }) })
974
1075
  }
975
1076
  ),
976
- /* @__PURE__ */ e("div", { className: "mobile-only", style: { display: "none" }, children: /* @__PURE__ */ e(Q, { onClick: () => V(!0), title: "\u6253\u5F00\u76EE\u5F55", children: "\u76EE\u5F55" }) })
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" }) })
977
1078
  ] })
978
1079
  ]
979
1080
  }
980
1081
  ),
981
1082
  (() => {
982
- const h = (Array.isArray(r) ? r.length : 0) > 1, s = h ? _ ? "10px" : "var(--sidebar-width)" : "0px", m = U ? "10px" : "var(--toc-width)", B = h ? `${s} 1fr ${m}` : `1fr ${m}`;
983
- return /* @__PURE__ */ g(it, { style: { gridTemplateColumns: B }, children: [
984
- h && /* @__PURE__ */ g(rt, { children: [
985
- /* @__PURE__ */ e(lt, { $collapsed: _, children: /* @__PURE__ */ e(st, { children: r && r.length > 0 && /* @__PURE__ */ e("div", { children: Object.entries(
986
- r.reduce((a, v) => {
987
- const p = v.group || "\u6587\u6863";
988
- return a[p] = a[p] || [], a[p].push(v), a;
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;
989
1090
  }, {})
990
- ).map(([a, v]) => /* @__PURE__ */ g("div", { children: [
991
- /* @__PURE__ */ e(ge, { children: a }),
992
- /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: v.map((p) => /* @__PURE__ */ e(
993
- Q,
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,
994
1095
  {
995
- $active: p.id === q,
1096
+ $active: g.id === N,
996
1097
  onClick: () => {
997
- p.href && (p.href.startsWith("#") ? le(p.href.slice(1)) : window.location.href = p.href), T == null || T(p), V(!1);
1098
+ g.href && (g.href.startsWith("#") ? ie(g.href.slice(1)) : window.location.href = g.href), A == null || A(g), k(!1);
998
1099
  },
999
- title: p.label,
1000
- children: p.label
1100
+ title: g.label,
1101
+ children: g.label
1001
1102
  },
1002
- p.id
1103
+ g.id
1003
1104
  )) })
1004
- ] }, a)) }) }) }),
1005
- I && h && /* @__PURE__ */ e(at, { onClick: () => ie((a) => !a), title: _ ? "\u5C55\u5F00\u5DE6\u4FA7\u680F" : "\u6536\u8D77\u5DE6\u4FA7\u680F", "aria-label": "toggle-left", children: _ ? /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M9 6l6 6-6 6", stroke: "currentColor", strokeWidth: "1.6" }) }) : /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M15 6l-6 6 6 6", stroke: "currentColor", strokeWidth: "1.6" }) }) })
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" }) }) })
1006
1107
  ] }),
1007
- /* @__PURE__ */ e(ct, { children: /* @__PURE__ */ e(
1008
- dt,
1108
+ /* @__PURE__ */ t(uo, { children: /* @__PURE__ */ t(
1109
+ go,
1009
1110
  {
1010
- ref: Z,
1011
- children: /* @__PURE__ */ e(ht, { $opacity: y, children: ee })
1111
+ ref: P,
1112
+ children: /* @__PURE__ */ t(fo, { $opacity: Be, children: $e })
1012
1113
  }
1013
1114
  ) }),
1014
- /* @__PURE__ */ e(pt, { children: /* @__PURE__ */ e(ut, { children: /* @__PURE__ */ g(ft, { $collapsed: U, children: [
1015
- /* @__PURE__ */ e(ge, { children: "\u672C\u9875\u76EE\u5F55" }),
1016
- /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: ((t.tocItems ?? N) || []).map((a) => /* @__PURE__ */ e(
1017
- Q,
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,
1018
1119
  {
1019
- $active: (w ? j : G) === a.id,
1120
+ $active: (Q ? L : ce) === c.id,
1020
1121
  onClick: () => {
1021
- le(a.id), A == null || A(a);
1122
+ ie(c.id), T == null || T(c);
1022
1123
  },
1023
- title: a.label,
1024
- style: { paddingLeft: Math.max(0, (a.level || 1) - 1) * 12 + 10 },
1025
- children: a.label
1124
+ title: c.label,
1125
+ style: { paddingLeft: Math.max(0, (c.level || 1) - 1) * 12 + 10 },
1126
+ children: c.label
1026
1127
  },
1027
- a.id
1128
+ c.id
1028
1129
  )) })
1029
1130
  ] }) }) })
1030
1131
  ] });
1031
1132
  })(),
1032
- re && /* @__PURE__ */ e(
1133
+ b && /* @__PURE__ */ t(
1033
1134
  "div",
1034
1135
  {
1035
1136
  role: "dialog",
@@ -1041,44 +1142,44 @@ const ge = l.div`
1041
1142
  background: "rgba(0,0,0,0.45)",
1042
1143
  display: "flex"
1043
1144
  },
1044
- onClick: () => V(!1),
1045
- children: /* @__PURE__ */ g(
1145
+ onClick: () => k(!1),
1146
+ children: /* @__PURE__ */ x(
1046
1147
  "div",
1047
1148
  {
1048
1149
  style: {
1049
1150
  width: "82%",
1050
1151
  maxWidth: 320,
1051
1152
  height: "100%",
1052
- background: o.colors.panelBackground || o.colors.dashboardBackground || "#fff",
1053
- color: o.colors.text,
1054
- borderRight: `1px solid ${o.colors.border}`,
1153
+ background: r.colors.panelBackground || r.colors.dashboardBackground || "#fff",
1154
+ color: r.colors.text,
1155
+ borderRight: `1px solid ${r.colors.border}`,
1055
1156
  padding: 12
1056
1157
  },
1057
- onClick: (n) => n.stopPropagation(),
1158
+ onClick: (i) => i.stopPropagation(),
1058
1159
  children: [
1059
- /* @__PURE__ */ g("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
1060
- /* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: "\u76EE\u5F55" }),
1061
- /* @__PURE__ */ e(Q, { onClick: () => V(!1), children: "\u5173\u95ED" })
1160
+ /* @__PURE__ */ x("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
1161
+ /* @__PURE__ */ t("div", { style: { fontWeight: 600 }, children: "\u76EE\u5F55" }),
1162
+ /* @__PURE__ */ t(q, { onClick: () => k(!1), children: "\u5173\u95ED" })
1062
1163
  ] }),
1063
- r && r.length > 0 && /* @__PURE__ */ e("div", { style: { overflow: "auto", height: "calc(100% - 40px)" }, children: Object.entries(
1064
- r.reduce((n, h) => {
1065
- const s = h.group || "\u6587\u6863";
1066
- return n[s] = n[s] || [], n[s].push(h), n;
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;
1067
1168
  }, {})
1068
- ).map(([n, h]) => /* @__PURE__ */ g("div", { children: [
1069
- /* @__PURE__ */ e(ge, { children: n }),
1070
- /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "0 8px 8px 8px" }, children: h.map((s) => /* @__PURE__ */ e(
1071
- Q,
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,
1072
1173
  {
1073
- $active: s.id === q,
1174
+ $active: d.id === N,
1074
1175
  onClick: () => {
1075
- s.href && (s.href.startsWith("#") ? le(s.href.slice(1)) : window.location.href = s.href), T == null || T(s), V(!1);
1176
+ d.href && (d.href.startsWith("#") ? ie(d.href.slice(1)) : window.location.href = d.href), A == null || A(d), k(!1);
1076
1177
  },
1077
- children: s.label
1178
+ children: d.label
1078
1179
  },
1079
- s.id
1180
+ d.id
1080
1181
  )) })
1081
- ] }, n)) })
1182
+ ] }, i)) })
1082
1183
  ]
1083
1184
  }
1084
1185
  )
@@ -1089,7 +1190,7 @@ const ge = l.div`
1089
1190
  ) });
1090
1191
  };
1091
1192
  export {
1092
- $t as DashboardContainer,
1093
- Bt as DockContainer,
1094
- Dt as DocumentContainer
1193
+ No as DashboardContainer,
1194
+ Ao as DockContainer,
1195
+ To as DocumentContainer
1095
1196
  };