@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.
- package/assets/style.css +1 -1
- package/index.js +606 -505
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
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
|
|
6
|
-
import { GoogleNavbar as
|
|
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
|
|
18
|
-
process.env.NODE_ENV !== "production" && (
|
|
19
|
-
const
|
|
20
|
-
process.env.NODE_ENV !== "production" && (
|
|
21
|
-
const Me = /* @__PURE__ */
|
|
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__ */
|
|
23
|
+
const ze = /* @__PURE__ */ S.createContext(null);
|
|
24
24
|
process.env.NODE_ENV !== "production" && (ze.displayName = "Navigation");
|
|
25
|
-
const
|
|
26
|
-
process.env.NODE_ENV !== "production" && (
|
|
27
|
-
const
|
|
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" && (
|
|
33
|
-
const We = /* @__PURE__ */
|
|
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__ */
|
|
36
|
-
function Le(
|
|
37
|
-
let
|
|
38
|
-
return
|
|
39
|
-
value:
|
|
40
|
-
},
|
|
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(
|
|
43
|
-
return Le(
|
|
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
|
|
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
|
|
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
|
|
77
|
+
const _e = ve(
|
|
78
78
|
({
|
|
79
|
-
color:
|
|
80
|
-
size:
|
|
81
|
-
strokeWidth:
|
|
82
|
-
absoluteStrokeWidth:
|
|
83
|
-
className:
|
|
79
|
+
color: e = "currentColor",
|
|
80
|
+
size: o = 24,
|
|
81
|
+
strokeWidth: n = 2,
|
|
82
|
+
absoluteStrokeWidth: h,
|
|
83
|
+
className: a = "",
|
|
84
84
|
children: $,
|
|
85
|
-
iconNode:
|
|
86
|
-
...
|
|
87
|
-
},
|
|
85
|
+
iconNode: W,
|
|
86
|
+
...M
|
|
87
|
+
}, _) => le(
|
|
88
88
|
"svg",
|
|
89
89
|
{
|
|
90
|
-
ref:
|
|
91
|
-
...
|
|
92
|
-
width:
|
|
93
|
-
height:
|
|
94
|
-
stroke:
|
|
95
|
-
strokeWidth:
|
|
96
|
-
className:
|
|
97
|
-
...
|
|
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
|
-
...
|
|
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
|
|
112
|
-
const
|
|
113
|
-
({ className:
|
|
111
|
+
const Ce = (e, o) => {
|
|
112
|
+
const n = ve(
|
|
113
|
+
({ className: h, ...a }, $) => le(_e, {
|
|
114
114
|
ref: $,
|
|
115
|
-
iconNode:
|
|
116
|
-
className:
|
|
117
|
-
...
|
|
115
|
+
iconNode: o,
|
|
116
|
+
className: ye(`lucide-${He(e)}`, h),
|
|
117
|
+
...a
|
|
118
118
|
})
|
|
119
119
|
);
|
|
120
|
-
return
|
|
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
|
|
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
|
|
138
|
+
const U = Ce("ChevronRight", [
|
|
139
139
|
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
140
|
-
]),
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
188
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
`,
|
|
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:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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: ${(
|
|
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
|
-
`,
|
|
322
|
+
`, oe = l.div.attrs({
|
|
323
|
+
className: "dashboard-container-breadcrumb-separator"
|
|
324
|
+
})`
|
|
233
325
|
display: flex;
|
|
234
326
|
align-items: center;
|
|
235
|
-
color:
|
|
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
|
-
`,
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
392
|
+
// 以下参数为兼容旧版本保留,当前未使用
|
|
393
|
+
dockActiveMode: W = "single",
|
|
394
|
+
defaultDockActiveId: M,
|
|
395
|
+
defaultDockActiveIds: _,
|
|
396
|
+
styles: f,
|
|
397
|
+
eventsEmit: p
|
|
264
398
|
}) => {
|
|
265
|
-
|
|
266
|
-
const L = be(), S = E(
|
|
399
|
+
const O = se(), I = K(
|
|
267
400
|
// 基础:默认主题 + useTheme的配置
|
|
268
|
-
|
|
401
|
+
K({ theme: F, mode: "light" }, O),
|
|
269
402
|
// 最高层:用户手动传入的styles
|
|
270
|
-
|
|
271
|
-
),
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
},
|
|
280
|
-
if (!
|
|
281
|
-
const
|
|
282
|
-
if (!
|
|
283
|
-
|
|
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
|
|
287
|
-
let
|
|
288
|
-
if (
|
|
289
|
-
|
|
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
|
|
293
|
-
|
|
294
|
-
start:
|
|
295
|
-
end:
|
|
296
|
-
showEllipsis:
|
|
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
|
-
}, [
|
|
299
|
-
if (
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
|
|
431
|
+
}, [a.length]);
|
|
432
|
+
if (w.useEffect(() => {
|
|
433
|
+
j();
|
|
434
|
+
const b = new ResizeObserver(() => {
|
|
435
|
+
j();
|
|
303
436
|
});
|
|
304
|
-
return
|
|
305
|
-
|
|
437
|
+
return N.current && b.observe(N.current), () => {
|
|
438
|
+
b.disconnect();
|
|
306
439
|
};
|
|
307
|
-
}, [
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
|
|
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:
|
|
313
|
-
$isClickable: !!(
|
|
314
|
-
onClick: () =>
|
|
315
|
-
|
|
316
|
-
|
|
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
|
-
|
|
323
|
-
] },
|
|
324
|
-
const { start:
|
|
325
|
-
return /* @__PURE__ */
|
|
326
|
-
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
|
|
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:
|
|
331
|
-
$isClickable: !!(
|
|
332
|
-
onClick: () =>
|
|
333
|
-
|
|
334
|
-
|
|
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
|
-
|
|
341
|
-
] },
|
|
342
|
-
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
|
|
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: `${
|
|
483
|
+
title: `${a.slice(H, -1).map((b) => b.label).join(" > ")}`,
|
|
355
484
|
children: "..."
|
|
356
485
|
}
|
|
357
486
|
),
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
|
|
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: !!
|
|
364
|
-
onClick: () =>
|
|
365
|
-
|
|
366
|
-
|
|
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
|
-
}, [
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
defaultOpen: !0
|
|
518
|
+
onClick: A,
|
|
519
|
+
theme: s,
|
|
520
|
+
title: "\u8FD4\u56DE",
|
|
521
|
+
children: /* @__PURE__ */ t(Ve, { size: 18 })
|
|
392
522
|
}
|
|
393
|
-
)
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
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: ${(
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
508
|
-
children:
|
|
509
|
-
backgroundImage:
|
|
510
|
-
backgroundColor:
|
|
511
|
-
header:
|
|
512
|
-
dockItems:
|
|
605
|
+
`, Ao = ({
|
|
606
|
+
children: e,
|
|
607
|
+
backgroundImage: o,
|
|
608
|
+
backgroundColor: n,
|
|
609
|
+
header: h,
|
|
610
|
+
dockItems: a,
|
|
513
611
|
dockActiveMode: $ = "single",
|
|
514
|
-
defaultDockActiveId:
|
|
515
|
-
defaultDockActiveIds:
|
|
516
|
-
styles:
|
|
517
|
-
eventsEmit:
|
|
612
|
+
defaultDockActiveId: W,
|
|
613
|
+
defaultDockActiveIds: M,
|
|
614
|
+
styles: _,
|
|
615
|
+
eventsEmit: f
|
|
518
616
|
}) => {
|
|
519
|
-
var
|
|
520
|
-
const
|
|
617
|
+
var L, T;
|
|
618
|
+
const p = se(), O = K(
|
|
521
619
|
// 基础:默认主题 + useTheme的配置
|
|
522
|
-
|
|
620
|
+
K({ theme: F, mode: "light" }, p),
|
|
523
621
|
// 最高层:用户手动传入的styles
|
|
524
|
-
|
|
525
|
-
),
|
|
526
|
-
|
|
527
|
-
},
|
|
528
|
-
|
|
529
|
-
},
|
|
530
|
-
|
|
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__ */
|
|
533
|
-
|
|
630
|
+
return /* @__PURE__ */ x(
|
|
631
|
+
Ue,
|
|
534
632
|
{
|
|
535
|
-
backgroundImage:
|
|
536
|
-
backgroundColor:
|
|
633
|
+
backgroundImage: o,
|
|
634
|
+
backgroundColor: n,
|
|
537
635
|
children: [
|
|
538
|
-
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
|
|
636
|
+
h && /* @__PURE__ */ t(eo, { children: h }),
|
|
637
|
+
/* @__PURE__ */ t(
|
|
638
|
+
oo,
|
|
541
639
|
{
|
|
542
640
|
style: {
|
|
543
|
-
color:
|
|
544
|
-
fontFamily: ((
|
|
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:
|
|
644
|
+
children: e
|
|
547
645
|
}
|
|
548
646
|
),
|
|
549
|
-
|
|
550
|
-
|
|
647
|
+
a && a.length > 0 && /* @__PURE__ */ t(to, { children: /* @__PURE__ */ t(
|
|
648
|
+
Te,
|
|
551
649
|
{
|
|
552
|
-
items:
|
|
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:
|
|
559
|
-
defaultActiveIds:
|
|
560
|
-
onItemClick:
|
|
561
|
-
onActiveChange:
|
|
562
|
-
onActiveChangeMultiple:
|
|
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
|
-
},
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
691
|
+
`, io = l.div`
|
|
594
692
|
display: flex;
|
|
595
693
|
align-items: center;
|
|
596
694
|
gap: 12px;
|
|
597
695
|
min-width: 0;
|
|
598
|
-
`,
|
|
696
|
+
`, ao = l.div`
|
|
599
697
|
display: flex;
|
|
600
698
|
align-items: center;
|
|
601
699
|
gap: 8px;
|
|
602
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
735
|
+
`, so = l.aside`
|
|
638
736
|
position: relative;
|
|
639
|
-
`,
|
|
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: ${(
|
|
646
|
-
transform: translateX(${(
|
|
647
|
-
pointer-events: ${(
|
|
648
|
-
`,
|
|
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
|
-
`,
|
|
761
|
+
`, po = l.div`
|
|
664
762
|
height: 100%;
|
|
665
763
|
overflow: auto;
|
|
666
764
|
padding-right: 8px;
|
|
667
|
-
`,
|
|
765
|
+
`, uo = l.main`
|
|
668
766
|
position: relative;
|
|
669
767
|
min-width: 0;
|
|
670
768
|
height: 100%;
|
|
671
769
|
overflow: auto; /* 文档渲染区独立滚动 */
|
|
672
|
-
`,
|
|
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
|
-
`,
|
|
778
|
+
`, fo = l.div`
|
|
681
779
|
height: 100%;
|
|
682
780
|
transition: opacity .5s ease;
|
|
683
|
-
opacity: ${(
|
|
684
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
799
|
+
`, wo = l.div`
|
|
702
800
|
transition: opacity .2s ease, transform .2s ease;
|
|
703
|
-
opacity: ${(
|
|
704
|
-
transform: translateX(${(
|
|
705
|
-
pointer-events: ${(
|
|
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
|
|
824
|
+
const ae = l.div`
|
|
727
825
|
font-size: 12px;
|
|
728
826
|
opacity: .7;
|
|
729
827
|
padding: 8px 8px;
|
|
730
|
-
`,
|
|
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
|
-
${(
|
|
758
|
-
`,
|
|
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
|
-
`,
|
|
869
|
+
`, vo = l.div`
|
|
769
870
|
width: 1px;
|
|
770
871
|
height: 16px;
|
|
771
872
|
background: currentColor;
|
|
772
873
|
opacity: .2;
|
|
773
|
-
`,
|
|
874
|
+
`, mo = {
|
|
774
875
|
theme: {
|
|
775
|
-
...
|
|
876
|
+
...F,
|
|
776
877
|
colors: {
|
|
777
|
-
...
|
|
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
|
-
},
|
|
888
|
+
}, yo = {
|
|
788
889
|
theme: {
|
|
789
|
-
...
|
|
890
|
+
...F,
|
|
790
891
|
colors: {
|
|
791
|
-
...
|
|
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
|
-
},
|
|
803
|
-
var
|
|
903
|
+
}, To = (e) => {
|
|
904
|
+
var ue, ge, fe, xe;
|
|
804
905
|
const {
|
|
805
|
-
children:
|
|
806
|
-
headerLogo:
|
|
807
|
-
contentKey:
|
|
808
|
-
modules:
|
|
906
|
+
children: o,
|
|
907
|
+
headerLogo: n,
|
|
908
|
+
contentKey: h,
|
|
909
|
+
modules: a,
|
|
809
910
|
activeModuleKey: $,
|
|
810
|
-
onModuleChange:
|
|
811
|
-
languages:
|
|
812
|
-
activeLanguageKey:
|
|
813
|
-
onLanguageChange:
|
|
814
|
-
themes:
|
|
815
|
-
activeThemeKey:
|
|
816
|
-
onThemeChange:
|
|
817
|
-
sidebarItems:
|
|
818
|
-
activeSidebarId:
|
|
819
|
-
onSidebarItemClick:
|
|
820
|
-
activeTocId:
|
|
821
|
-
onTocItemClick:
|
|
822
|
-
collapsibleSidebar:
|
|
823
|
-
styles:
|
|
824
|
-
} =
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
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
|
-
|
|
830
|
-
),
|
|
831
|
-
|
|
832
|
-
if (
|
|
833
|
-
|
|
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
|
-
|
|
837
|
-
const
|
|
838
|
-
|
|
937
|
+
he(0);
|
|
938
|
+
const i = setTimeout(() => {
|
|
939
|
+
de(o), requestAnimationFrame(() => he(1));
|
|
839
940
|
}, 120);
|
|
840
|
-
return () => clearTimeout(
|
|
841
|
-
}, [
|
|
842
|
-
var
|
|
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: (
|
|
845
|
-
secondaryColor: (
|
|
846
|
-
backgroundColor: (
|
|
847
|
-
textColor: (
|
|
848
|
-
borderColor: (B =
|
|
849
|
-
disabledBackground: (
|
|
850
|
-
borderRadius: (v =
|
|
851
|
-
padding: (
|
|
852
|
-
margin: (
|
|
853
|
-
baseFontSize: (
|
|
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
|
-
}, [
|
|
856
|
-
if (
|
|
857
|
-
|
|
956
|
+
}, [r]), w.useEffect(() => {
|
|
957
|
+
if (e.tocItems)
|
|
958
|
+
E(void 0);
|
|
858
959
|
else {
|
|
859
|
-
|
|
860
|
-
let
|
|
861
|
-
const
|
|
862
|
-
let
|
|
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
|
|
865
|
-
if (!
|
|
866
|
-
|
|
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(
|
|
970
|
+
const v = Array.from(c.querySelectorAll("h1, h2, h3"));
|
|
870
971
|
if (v.length === 0) {
|
|
871
|
-
|
|
972
|
+
i < u ? (i++, d = setTimeout(B, 200)) : E([]);
|
|
872
973
|
return;
|
|
873
974
|
}
|
|
874
|
-
const
|
|
875
|
-
var
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
const
|
|
879
|
-
C.id || (C.id =
|
|
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:
|
|
982
|
+
return { id: X, label: C.textContent || "", level: De };
|
|
882
983
|
});
|
|
883
|
-
|
|
984
|
+
E(G);
|
|
884
985
|
};
|
|
885
|
-
return
|
|
886
|
-
|
|
986
|
+
return y = requestAnimationFrame(() => {
|
|
987
|
+
d = setTimeout(B, 100);
|
|
887
988
|
}), () => {
|
|
888
|
-
|
|
989
|
+
y !== null && cancelAnimationFrame(y), d !== null && clearTimeout(d);
|
|
889
990
|
};
|
|
890
991
|
}
|
|
891
|
-
}, [
|
|
892
|
-
if (
|
|
893
|
-
const
|
|
894
|
-
if (
|
|
895
|
-
|
|
896
|
-
const
|
|
897
|
-
var
|
|
898
|
-
const v =
|
|
899
|
-
(
|
|
900
|
-
}, B = new IntersectionObserver(
|
|
901
|
-
return
|
|
902
|
-
const v = document.getElementById(
|
|
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
|
-
}, [
|
|
906
|
-
const
|
|
907
|
-
if (!
|
|
908
|
-
const
|
|
909
|
-
return
|
|
910
|
-
},
|
|
911
|
-
const
|
|
912
|
-
|
|
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__ */
|
|
915
|
-
|
|
1015
|
+
return /* @__PURE__ */ t(Ne, { theme: r, mode: m.mode, children: /* @__PURE__ */ x(
|
|
1016
|
+
no,
|
|
916
1017
|
{
|
|
917
1018
|
style: {
|
|
918
|
-
background:
|
|
919
|
-
color:
|
|
920
|
-
fontFamily: ((
|
|
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__ */
|
|
924
|
-
|
|
1024
|
+
/* @__PURE__ */ x(
|
|
1025
|
+
ro,
|
|
925
1026
|
{
|
|
926
1027
|
style: {
|
|
927
|
-
background:
|
|
928
|
-
color:
|
|
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__ */
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
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:
|
|
937
|
-
onClick: () =>
|
|
938
|
-
title:
|
|
939
|
-
children:
|
|
1037
|
+
$active: i.key === $,
|
|
1038
|
+
onClick: () => W == null ? void 0 : W(i.key),
|
|
1039
|
+
title: i.label,
|
|
1040
|
+
children: i.label
|
|
940
1041
|
},
|
|
941
|
-
|
|
1042
|
+
i.key
|
|
942
1043
|
)) })
|
|
943
1044
|
] }),
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
|
|
947
|
-
|
|
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
|
|
951
|
-
|
|
1051
|
+
const i = pe(M, _);
|
|
1052
|
+
i && (f == null || f(i));
|
|
952
1053
|
},
|
|
953
|
-
title: ((
|
|
1054
|
+
title: ((fe = M.find((i) => i.key === _)) == null ? void 0 : fe.label) || "Language",
|
|
954
1055
|
"aria-label": "language",
|
|
955
|
-
style: { color:
|
|
956
|
-
children: /* @__PURE__ */
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
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__ */
|
|
963
|
-
|
|
964
|
-
|
|
1063
|
+
/* @__PURE__ */ t(vo, {}),
|
|
1064
|
+
p && p.length > 0 && /* @__PURE__ */ t(
|
|
1065
|
+
ke,
|
|
965
1066
|
{
|
|
966
1067
|
onClick: () => {
|
|
967
|
-
const
|
|
968
|
-
|
|
1068
|
+
const i = pe(p, O);
|
|
1069
|
+
i && (I == null || I(i));
|
|
969
1070
|
},
|
|
970
|
-
title: ((
|
|
1071
|
+
title: ((xe = p.find((i) => i.key === O)) == null ? void 0 : xe.label) || "Theme",
|
|
971
1072
|
"aria-label": "theme",
|
|
972
|
-
style: { color:
|
|
973
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
983
|
-
return /* @__PURE__ */
|
|
984
|
-
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
|
|
987
|
-
const
|
|
988
|
-
return
|
|
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(([
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
|
|
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:
|
|
1096
|
+
$active: g.id === N,
|
|
996
1097
|
onClick: () => {
|
|
997
|
-
|
|
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:
|
|
1000
|
-
children:
|
|
1100
|
+
title: g.label,
|
|
1101
|
+
children: g.label
|
|
1001
1102
|
},
|
|
1002
|
-
|
|
1103
|
+
g.id
|
|
1003
1104
|
)) })
|
|
1004
|
-
] },
|
|
1005
|
-
|
|
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__ */
|
|
1008
|
-
|
|
1108
|
+
/* @__PURE__ */ t(uo, { children: /* @__PURE__ */ t(
|
|
1109
|
+
go,
|
|
1009
1110
|
{
|
|
1010
|
-
ref:
|
|
1011
|
-
children: /* @__PURE__ */
|
|
1111
|
+
ref: P,
|
|
1112
|
+
children: /* @__PURE__ */ t(fo, { $opacity: Be, children: $e })
|
|
1012
1113
|
}
|
|
1013
1114
|
) }),
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */
|
|
1017
|
-
|
|
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: (
|
|
1120
|
+
$active: (Q ? L : ce) === c.id,
|
|
1020
1121
|
onClick: () => {
|
|
1021
|
-
|
|
1122
|
+
ie(c.id), T == null || T(c);
|
|
1022
1123
|
},
|
|
1023
|
-
title:
|
|
1024
|
-
style: { paddingLeft: Math.max(0, (
|
|
1025
|
-
children:
|
|
1124
|
+
title: c.label,
|
|
1125
|
+
style: { paddingLeft: Math.max(0, (c.level || 1) - 1) * 12 + 10 },
|
|
1126
|
+
children: c.label
|
|
1026
1127
|
},
|
|
1027
|
-
|
|
1128
|
+
c.id
|
|
1028
1129
|
)) })
|
|
1029
1130
|
] }) }) })
|
|
1030
1131
|
] });
|
|
1031
1132
|
})(),
|
|
1032
|
-
|
|
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: () =>
|
|
1045
|
-
children: /* @__PURE__ */
|
|
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:
|
|
1053
|
-
color:
|
|
1054
|
-
borderRight: `1px solid ${
|
|
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: (
|
|
1158
|
+
onClick: (i) => i.stopPropagation(),
|
|
1058
1159
|
children: [
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1064
|
-
|
|
1065
|
-
const
|
|
1066
|
-
return
|
|
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(([
|
|
1069
|
-
/* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1071
|
-
|
|
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:
|
|
1174
|
+
$active: d.id === N,
|
|
1074
1175
|
onClick: () => {
|
|
1075
|
-
|
|
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:
|
|
1178
|
+
children: d.label
|
|
1078
1179
|
},
|
|
1079
|
-
|
|
1180
|
+
d.id
|
|
1080
1181
|
)) })
|
|
1081
|
-
] },
|
|
1182
|
+
] }, i)) })
|
|
1082
1183
|
]
|
|
1083
1184
|
}
|
|
1084
1185
|
)
|
|
@@ -1089,7 +1190,7 @@ const ge = l.div`
|
|
|
1089
1190
|
) });
|
|
1090
1191
|
};
|
|
1091
1192
|
export {
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1193
|
+
No as DashboardContainer,
|
|
1194
|
+
Ao as DockContainer,
|
|
1195
|
+
To as DocumentContainer
|
|
1095
1196
|
};
|