@blocklet/pages-kit-inner-components 0.6.38 → 0.6.40

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.
@@ -0,0 +1,654 @@
1
+ import { jsx as e, jsxs as T } from "react/jsx-runtime";
2
+ import { u as z, c as U, d as se, e as ie, f as le, b as ce } from "./state-DRjnlQY_.js";
3
+ import { useLocaleContext as W } from "@arcblock/ux/lib/Locale/context";
4
+ import V from "@arcblock/ux/lib/Result";
5
+ import { styled as M, useTheme as ue } from "@arcblock/ux/lib/Theme";
6
+ import { useHeaderState as pe } from "@blocklet/pages-kit/builtin/page/header";
7
+ import { useColorConvert as de } from "@blocklet/pages-kit/contexts/color";
8
+ import { setPageDataSource as G } from "@blocklet/pages-kit/utils/data-source";
9
+ import { generateParamCombinations as me } from "@blocklet/pages-kit/utils/route";
10
+ import ge from "@blocklet/ui-react/lib/Header";
11
+ import { cx as he } from "@emotion/css";
12
+ import { Global as q, css as K } from "@emotion/react";
13
+ import { Box as k, CircularProgress as fe, useTheme as Y, Button as be, Stack as ye, alpha as $ } from "@mui/material";
14
+ import { useReactive as J, useScroll as xe } from "ahooks";
15
+ import ve from "isomorphic-dompurify";
16
+ import R from "lodash/cloneDeep";
17
+ import Pe from "lodash/isEmpty";
18
+ import Q from "lodash/isEqual";
19
+ import { useRef as A, useEffect as C, lazy as X, useMemo as x, Suspense as ke, useState as we } from "react";
20
+ import { Helmet as Se } from "react-helmet";
21
+ import { useSearchParams as Z, Routes as Ce, Route as S, Navigate as Ie, ScrollRestoration as Te } from "react-router-dom";
22
+ import { useAsync as ee } from "react-use";
23
+ import { joinURL as P } from "ufo";
24
+ import { u as Re, S as je, i as D, P as Me, a as Oe, R as Ee, B as Le, b as te, g as Ae } from "./index-CqrEKyBA.js";
25
+ import Be from "@blocklet/ui-react/lib/Footer";
26
+ import "webfontloader";
27
+ import { u as _e, a as Fe } from "./session-C72Dq8zg.js";
28
+ const $e = M(k)`
29
+ display: contents;
30
+ & > div > div > .MuiContainer-root {
31
+ max-width: unset;
32
+ }
33
+ `;
34
+ function De({ meta: t, ...o }) {
35
+ const s = ue(), { getPageMetaStyle: n } = Re(), r = n();
36
+ return /* @__PURE__ */ e(
37
+ $e,
38
+ {
39
+ sx: {
40
+ ".blocklet__footer .MuiContainer-root": {
41
+ ...r.maxWidth && {
42
+ maxWidth: r.maxWidth
43
+ },
44
+ ...r.px && {
45
+ px: r.px
46
+ }
47
+ }
48
+ },
49
+ children: /* @__PURE__ */ e(
50
+ Be,
51
+ {
52
+ ...o,
53
+ meta: t,
54
+ theme: s || {},
55
+ sx: {
56
+ // ...getPageMetaStyle(),
57
+ }
58
+ }
59
+ )
60
+ }
61
+ );
62
+ }
63
+ let He = null;
64
+ function Ne(t) {
65
+ const o = A(null), { type: s } = t;
66
+ return C(() => {
67
+ s === "app" && o.current;
68
+ }, [s]), /* @__PURE__ */ e(
69
+ k,
70
+ {
71
+ ...t,
72
+ ref: o,
73
+ sx: [
74
+ {
75
+ display: "flex",
76
+ flex: 1,
77
+ height: "100%",
78
+ alignItems: "center",
79
+ justifyContent: "center",
80
+ ".spinner-wrapper": {
81
+ // 取消出现动画,减少页面撕裂感,但是有弊端,会让每次都出现一下加载 logo
82
+ // animation: 'unset',
83
+ // opacity: 1,
84
+ }
85
+ },
86
+ ...Array.isArray(t.sx) ? t.sx : [t.sx]
87
+ ],
88
+ children: s !== "app" && /* @__PURE__ */ e(fe, { size: 30 })
89
+ }
90
+ );
91
+ }
92
+ function ze(t) {
93
+ return /* @__PURE__ */ e(Ue, { ...t });
94
+ }
95
+ const Ue = M(k)`
96
+ position: fixed;
97
+ left: 0;
98
+ top: 0;
99
+ z-index: 999999999999;
100
+ width: 80px;
101
+ font-size: 12px;
102
+ text-align: center;
103
+ opacity: 0.7;
104
+ transform: translateX(-23%) translateY(70%) rotate(-45deg);
105
+ pointer-events: none;
106
+ `, We = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
107
+ sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;
108
+ function Ve({
109
+ titleFontFamily: t,
110
+ descriptionFontFamily: o
111
+ }) {
112
+ const n = Y()?.typography?.fontFamily;
113
+ C(() => {
114
+ }, [t, o]);
115
+ const r = `${n}, ${We}`;
116
+ return /* @__PURE__ */ e(
117
+ q,
118
+ {
119
+ styles: K`
120
+ #app {
121
+ font-family: ${r};
122
+
123
+ .page-kit-section__title {
124
+ font-family: ${r};
125
+ }
126
+
127
+ .page-kit-section__description {
128
+ font-family: ${r};
129
+ }
130
+ }
131
+ `
132
+ }
133
+ );
134
+ }
135
+ function H(t) {
136
+ return t != null;
137
+ }
138
+ function Tt() {
139
+ const [t] = Z(), { session: o } = _e(), s = Fe("owner", "admin", "pagesEditor", "member"), n = x(() => {
140
+ const a = t.get("mode");
141
+ return je.includes(a) ? a : "production";
142
+ }, [t]), r = n === "production" ? n : o.user ? s ? n : "production" : null;
143
+ return r ? /* @__PURE__ */ e(Ge, { mode: r }) : null;
144
+ }
145
+ function Ge({ mode: t }) {
146
+ if (t !== "draft") {
147
+ const o = window.__PAGE_STATE__;
148
+ return o ? /* @__PURE__ */ e(L, { mode: t, state: o }) : /* @__PURE__ */ e(Ye, { mode: t, children: ({ state: s }) => /* @__PURE__ */ e(L, { mode: t, state: s }) });
149
+ }
150
+ return /* @__PURE__ */ e(Ke, { children: ({ state: o }) => /* @__PURE__ */ e(L, { mode: t, state: o }) });
151
+ }
152
+ const qe = X(() => import("./publish-button-Bq41IJcY.js")), Ke = X(() => import("./draft-data-mNAXJMtq.js"));
153
+ function Ye({
154
+ mode: t,
155
+ children: o
156
+ }) {
157
+ const n = document.querySelector('meta[property="pages:version"]')?.content, r = z(), a = x(() => {
158
+ if (n === "{{pagesPublishedAt}}") {
159
+ const u = localStorage.getItem(ce(r ?? ""));
160
+ return Number(u) ? Number(u) : (/* @__PURE__ */ new Date()).getTime();
161
+ }
162
+ return Number(n);
163
+ }, [n]), { loading: p, value: c } = ee(() => Ae({ mode: t, version: a }), [t, a]);
164
+ return p ? /* @__PURE__ */ e(Ne, {}) : c ? o({ state: c }) : null;
165
+ }
166
+ function L({ mode: t, state: o }) {
167
+ const { t: s, locale: n } = W(), [r] = Z(), a = z(), p = se(), c = r.get("hiddenBadge") === "true", u = r.get("showPublish") === "true", {
168
+ pageIds: d,
169
+ pages: l,
170
+ routeIds: f,
171
+ routes: m,
172
+ supportedLocales: g,
173
+ config: { defaultLocale: y },
174
+ resources: w
175
+ } = o, b = U(o), v = x(
176
+ () => g?.some((h) => h.locale === n) ? n : void 0,
177
+ [n, g]
178
+ ), B = Object.values(m || {}).find((h) => h?.path === "/") || Object.values(l).find((h) => h?.slug === "/") ? void 0 : Object.values(l)[0], ae = x(() => t === "production" ? d?.map((h) => {
179
+ const i = l[h];
180
+ return i && {
181
+ id: i.id,
182
+ path: P("/", p || a || "", i.slug),
183
+ // 是否通过 Link 跳转,如果有 sectionIds 和 sections ,那么认为是内部页面,则通过 Link 跳转
184
+ isLinkToPage: D(i)
185
+ };
186
+ }).filter(H) : f?.map((h) => {
187
+ const i = m[h];
188
+ return i ? {
189
+ id: i.id,
190
+ path: P("/", p || a || "", i.path, `?mode=${t}&showPublish=true`)
191
+ } : null;
192
+ }).filter(H), [d, l, t, m, f, a, p]), I = ([...h]) => (t !== "production" && u && h.unshift(
193
+ /* @__PURE__ */ e(ke, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(qe, { ref: { current: null }, mode: "production", state: o }) })
194
+ ), h);
195
+ return /* @__PURE__ */ T(Me, { value: { pages: ae }, children: [
196
+ /* @__PURE__ */ T(Ce, { children: [
197
+ B && /* @__PURE__ */ e(S, { index: !0, element: /* @__PURE__ */ e(Ie, { to: P("/", v || "", B.slug) }) }),
198
+ f?.map((h) => {
199
+ const i = m?.[h];
200
+ if (!i || !i.displayTemplateId) return null;
201
+ const O = l[i.displayTemplateId];
202
+ if (!O) return null;
203
+ let E = [];
204
+ return i.params && i.params.length > 0 && (E = me({
205
+ basePath: i.path,
206
+ params: i.params,
207
+ routeId: i.id,
208
+ paramsOptions: i.paramsOptions,
209
+ currentIndex: 0,
210
+ currentParams: [],
211
+ currentOptionIds: [],
212
+ result: []
213
+ })?.map((_) => {
214
+ const F = _.paramOptionIds.join("-");
215
+ return /* @__PURE__ */ e(
216
+ S,
217
+ {
218
+ path: P(":projectIdOrSlug?", _.path),
219
+ element: /* @__PURE__ */ e(
220
+ N,
221
+ {
222
+ mode: t,
223
+ components: b,
224
+ page: O,
225
+ locale: v,
226
+ defaultLocale: y,
227
+ headerAddons: I,
228
+ state: o,
229
+ pageData: i.dataSource?.pathDataMappings?.[F]?.dataCache?.[v || y || "en"]
230
+ }
231
+ )
232
+ },
233
+ F
234
+ );
235
+ })), E.push(
236
+ /* @__PURE__ */ e(
237
+ S,
238
+ {
239
+ path: P(":projectIdOrSlug?", i.path),
240
+ element: /* @__PURE__ */ e(
241
+ N,
242
+ {
243
+ mode: t,
244
+ components: b,
245
+ page: O,
246
+ locale: v,
247
+ defaultLocale: y,
248
+ headerAddons: I,
249
+ state: o,
250
+ pageData: i.dataSource?.pathDataMappings?.[i.id]?.dataCache?.[v || y || "en"]
251
+ }
252
+ )
253
+ },
254
+ i.id
255
+ )
256
+ ), E;
257
+ }),
258
+ d?.map((h) => {
259
+ const i = l[h];
260
+ return !i || !D(i) ? null : /* @__PURE__ */ e(
261
+ S,
262
+ {
263
+ path: P(":projectIdOrSlug?", i.slug),
264
+ element: /* @__PURE__ */ e(
265
+ j,
266
+ {
267
+ mode: t,
268
+ components: b,
269
+ page: i,
270
+ locale: v,
271
+ defaultLocale: y,
272
+ headerAddons: I
273
+ }
274
+ )
275
+ },
276
+ i.id
277
+ );
278
+ }),
279
+ w?.pages && Object.values(w?.pages)?.map(({ blockletId: h, page: i }) => /* @__PURE__ */ e(
280
+ S,
281
+ {
282
+ path: P("/", `@${h}`, i.slug),
283
+ element: /* @__PURE__ */ e(
284
+ j,
285
+ {
286
+ mode: t,
287
+ components: b,
288
+ page: i,
289
+ locale: v,
290
+ defaultLocale: y,
291
+ headerAddons: I
292
+ }
293
+ )
294
+ },
295
+ i.id
296
+ )),
297
+ /* @__PURE__ */ e(
298
+ S,
299
+ {
300
+ path: "*",
301
+ element: /* @__PURE__ */ e(
302
+ k,
303
+ {
304
+ sx: {
305
+ width: "100vw",
306
+ height: "100vh",
307
+ display: "flex",
308
+ justifyContent: "center",
309
+ alignItems: "center"
310
+ },
311
+ children: /* @__PURE__ */ e(
312
+ V,
313
+ {
314
+ status: 404,
315
+ extra: /* @__PURE__ */ e(re, { href: "/", children: s("common.back") }),
316
+ sx: {
317
+ bgcolor: "transparent",
318
+ width: "100%",
319
+ height: "100%"
320
+ }
321
+ }
322
+ )
323
+ }
324
+ )
325
+ }
326
+ )
327
+ ] }),
328
+ t !== "production" && !c && /* @__PURE__ */ e(ze, { sx: { bgcolor: "info.light" }, children: t }),
329
+ /* @__PURE__ */ e(Ve, {})
330
+ ] });
331
+ }
332
+ function N({
333
+ mode: t,
334
+ pageData: o,
335
+ components: s,
336
+ page: n,
337
+ locale: r,
338
+ defaultLocale: a,
339
+ headerAddons: p,
340
+ state: c
341
+ }) {
342
+ const u = J({
343
+ page: null
344
+ });
345
+ C(() => {
346
+ const l = n || null;
347
+ l ? u.page = R(l) : u.page = null;
348
+ }, [n, JSON.stringify(n), u]);
349
+ const d = A(void 0);
350
+ return C(() => {
351
+ Q(o, d.current) || o && u.page && (G(u.page, c, r, o), d.current = R(o));
352
+ }, [u.page, o, r, c]), u.page ? /* @__PURE__ */ e(
353
+ j,
354
+ {
355
+ mode: t,
356
+ components: s,
357
+ page: u.page,
358
+ locale: r,
359
+ defaultLocale: a,
360
+ headerAddons: p
361
+ }
362
+ ) : null;
363
+ }
364
+ function Rt({
365
+ mode: t,
366
+ state: o,
367
+ path: s,
368
+ pageData: n
369
+ }) {
370
+ const { t: r, locale: a } = W(), {
371
+ pages: p,
372
+ supportedLocales: c,
373
+ config: { defaultLocale: u },
374
+ resources: d
375
+ } = o, l = Object.values(p).find((b) => b?.slug === s), f = Object.values(d?.pages || {}).find((b) => b.page.slug === s), m = x(
376
+ () => c?.some((b) => b.locale === a) ? a : void 0,
377
+ [a, c]
378
+ ), g = J({
379
+ page: null
380
+ });
381
+ C(() => {
382
+ const b = l || f?.page || null;
383
+ b ? g.page = R(b) : g.page = null;
384
+ }, [l, f]);
385
+ const y = A(void 0);
386
+ if (C(() => {
387
+ Q(n, y.current) || n && g.page && (G(g.page, o, m, n), y.current = R(n));
388
+ }, [{}]), !l && !f?.page)
389
+ return /* @__PURE__ */ e(
390
+ k,
391
+ {
392
+ sx: {
393
+ width: "100vw",
394
+ height: "100vh",
395
+ display: "flex",
396
+ justifyContent: "center",
397
+ alignItems: "center"
398
+ },
399
+ children: /* @__PURE__ */ e(V, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(re, { href: "/", children: r("common.back") }) })
400
+ }
401
+ );
402
+ const w = U(o);
403
+ return g.page ? /* @__PURE__ */ e(
404
+ j,
405
+ {
406
+ mode: t,
407
+ components: w,
408
+ page: g.page,
409
+ locale: m,
410
+ defaultLocale: u
411
+ }
412
+ ) : null;
413
+ }
414
+ function j({
415
+ mode: t,
416
+ components: o,
417
+ page: s,
418
+ locale: n,
419
+ defaultLocale: r,
420
+ headerAddons: a
421
+ }) {
422
+ const p = de(), c = s.locales?.[n] ?? s.locales?.[r] ?? {}, u = c.title || window.blocklet?.appName, d = c.description || window.blocklet?.appDescription, l = ie(le(c.image), 540);
423
+ return /* @__PURE__ */ T(Oe, { page: s, defaultLocale: r, currentLocale: n, children: [
424
+ /* @__PURE__ */ e(
425
+ q,
426
+ {
427
+ styles: K`
428
+ body {
429
+ background-color: ${p(
430
+ !c.backgroundColor || c.backgroundColor === "transparent" ? "background.default" : c.backgroundColor
431
+ )} !important;
432
+ }
433
+ `
434
+ }
435
+ ),
436
+ /* @__PURE__ */ e(Je, { meta: c, headerAddons: a }),
437
+ /* @__PURE__ */ e(Te, {}),
438
+ /* @__PURE__ */ T(Se, { children: [
439
+ /* @__PURE__ */ e("title", { children: u }),
440
+ /* @__PURE__ */ e("meta", { name: "og:title", content: u }),
441
+ /* @__PURE__ */ e("meta", { name: "og:description", content: d }),
442
+ /* @__PURE__ */ e("meta", { name: "og:image", content: l }),
443
+ /* @__PURE__ */ e("meta", { name: "twitter:image:src", content: l }),
444
+ /* @__PURE__ */ e("meta", { name: "twitter:image", content: l }),
445
+ /* @__PURE__ */ e("meta", { property: "twitter:description", content: d }),
446
+ /* @__PURE__ */ e("meta", { property: "twitter:title", content: u }),
447
+ /* @__PURE__ */ e("meta", { name: "description", content: d })
448
+ ] }),
449
+ /* @__PURE__ */ e(
450
+ ye,
451
+ {
452
+ className: "PageView-root",
453
+ sx: {
454
+ flexGrow: 1,
455
+ // 第一个 .BlockBase-root 的 pt 为 0
456
+ "& .BlockBase-root:first-child": {
457
+ pt: "0 !important"
458
+ },
459
+ zIndex: 0
460
+ // 确保页面内容在其他元素之上
461
+ },
462
+ children: /* @__PURE__ */ e(Ee, { children: s?.sectionIds?.map((f, m) => {
463
+ const g = s.sections[f];
464
+ if (!g || g.visibility === "hidden") return null;
465
+ const y = s.dataSource?.[f]?.[n], w = s.dataSource?.[f]?.[r] ?? {};
466
+ return /* @__PURE__ */ e(k, { sx: { position: "relative" }, children: /* @__PURE__ */ e(
467
+ Le,
468
+ {
469
+ id: f,
470
+ type: g.component,
471
+ mode: t,
472
+ section: g,
473
+ config: {
474
+ ...Pe(y) ? w : y,
475
+ locale: n,
476
+ dev: t === "draft" ? {
477
+ mode: t,
478
+ components: o,
479
+ defaultLocale: r
480
+ } : {
481
+ mode: t,
482
+ defaultLocale: r
483
+ // 用于 fallback 的 locale
484
+ }
485
+ },
486
+ page: s,
487
+ renderIndex: m
488
+ },
489
+ f
490
+ ) }, f);
491
+ }) })
492
+ }
493
+ ),
494
+ !c.footer?.hidden && /* @__PURE__ */ e(De, {})
495
+ ] });
496
+ }
497
+ const oe = M(ge)`
498
+ &.sticky {
499
+ position: sticky;
500
+ top: 0;
501
+ }
502
+ `;
503
+ function Je({ meta: t, headerAddons: o }) {
504
+ const { logo: s, brand: n, description: r, ...a } = pe(), p = te(), c = x(
505
+ () => (d) => {
506
+ let l = o?.(d) ?? d;
507
+ return l = a.addons?.(l) ?? l, l;
508
+ },
509
+ [a.addons, o]
510
+ ), u = x(
511
+ () => t.header?.translucent ? Qe : oe,
512
+ [t.header?.translucent]
513
+ );
514
+ return /* @__PURE__ */ e(
515
+ u,
516
+ {
517
+ hideNavMenu: !!t.header?.hideNavMenus,
518
+ translucentTextColor: t.header?.translucentTextColor,
519
+ ...s ? { logo: /* @__PURE__ */ e(ne, { logo: s }) } : {},
520
+ ...n ? { brand: n } : {},
521
+ ...r ? { description: r } : {},
522
+ className: he(t.header?.sticky && "sticky", "page-header"),
523
+ maxWidth: !1,
524
+ addons: c,
525
+ sx: {
526
+ ".header-logo": {
527
+ display: p ? "none !important" : "inline-flex",
528
+ alignItems: "center"
529
+ },
530
+ ".header-brand-wrapper": {
531
+ display: p ? "none !important" : "flex"
532
+ }
533
+ }
534
+ }
535
+ );
536
+ }
537
+ function ne({ logo: t }) {
538
+ const [o, s] = we(), n = te(), { value: r } = ee(() => {
539
+ const a = new URL(
540
+ n ? window?.blocklet?.appLogo || "/.well-known/service/blocklet/logo" : window?.blocklet?.appLogoRect || "/.well-known/service/blocklet/logo-rect",
541
+ window.location.origin
542
+ );
543
+ a.searchParams.delete("imageFilter"), a.searchParams.delete("f");
544
+ const p = a.toString();
545
+ return new Promise((c) => {
546
+ fetch(p).then((u) => {
547
+ u.headers.get("content-type")?.includes("svg") && u.text().then((l) => {
548
+ s(l), c(null);
549
+ }), c(u.url);
550
+ });
551
+ });
552
+ }, [n]);
553
+ if (n)
554
+ return null;
555
+ if (t)
556
+ return t;
557
+ if (o)
558
+ return /* @__PURE__ */ e(k, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: ve.sanitize(o) } });
559
+ if (r) {
560
+ const a = new URL(r);
561
+ a.searchParams.set("imageFilter", "convert"), a.searchParams.set("f", "png"), a.searchParams.set("h", "80");
562
+ const p = a.toString();
563
+ return /* @__PURE__ */ e("img", { src: p, alt: "logo" });
564
+ }
565
+ return null;
566
+ }
567
+ function Qe({
568
+ logo: t,
569
+ translucentTextColor: o,
570
+ ...s
571
+ }) {
572
+ const r = xe(document.getElementById("app"), (m) => m.top < 1200), a = Y(), p = a.palette.mode === "dark", c = Math.min(r?.top ?? 0, 800), u = x(() => {
573
+ let m = Math.min(c / 800, 1), g = "";
574
+ return m > 0.1 ? (m = Math.max(m, 0.6), g = $(a.palette.text.primary, m)) : g = o || "#EEEEEE", {
575
+ backgroundOpacity: m,
576
+ textColor: g,
577
+ isReversed: m < 0.7
578
+ };
579
+ }, [c, 800, a.palette.text.primary, o]), { backgroundOpacity: d, textColor: l, isReversed: f } = u;
580
+ return /* @__PURE__ */ e(
581
+ oe,
582
+ {
583
+ logo: /* @__PURE__ */ e(ne, { logo: t }),
584
+ ...s,
585
+ sx: {
586
+ // 基础布局和定位
587
+ position: "fixed !important",
588
+ top: 0,
589
+ left: 0,
590
+ right: 0,
591
+ zIndex: a.zIndex.appBar,
592
+ // 确保在顶层
593
+ backgroundColor: "transparent !important",
594
+ // 主元素始终透明
595
+ // 使用伪元素作为背景层
596
+ "&::before": {
597
+ content: '""',
598
+ position: "absolute",
599
+ top: 0,
600
+ left: 0,
601
+ right: 0,
602
+ bottom: 0,
603
+ zIndex: -1,
604
+ // 置于内容下方
605
+ // 背景样式(颜色和模糊)是固定的
606
+ backgroundColor: $(a.palette.background.default, d),
607
+ backdropFilter: d >= 0.6 ? "blur(10px)" : "blur(0px)",
608
+ // **性能关键**: 只对 opacity 进行动画
609
+ // opacity: backgroundOpacity,
610
+ // 让 CSS 平滑地处理透明度变化
611
+ transition: "backgroundColor 0.3s ease-in-out"
612
+ },
613
+ // --- 文字和图标颜色过渡 ---
614
+ // 直接为 Header 内所有相关元素设置颜色和过渡
615
+ // color: textColor,
616
+ transition: "color 0.3s ease-in-out",
617
+ // 覆盖子组件的颜色,使其继承父级的 `color`
618
+ ".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button": {
619
+ color: `${l} !important`
620
+ // 使用 inherit 来同步颜色
621
+ },
622
+ ".header-logo, .header-menu": {
623
+ color: `${l} !important`
624
+ },
625
+ "& .navmenu--horizontal": {
626
+ bgcolor: "transparent !important"
627
+ },
628
+ ".header-addons *": {
629
+ borderColor: `${l} !important`
630
+ },
631
+ // --- Logo 反色效果 ---
632
+ // filter 也是一个较昂贵的属性,但其影响远小于背景色的重绘
633
+ // 这里的逻辑保持不变,但可以考虑是否有更优的方案(如提供两个颜色的 Logo)
634
+ ".header-logo > div": {
635
+ // 暗黑模式不做反转
636
+ filter: p ? "unset" : `invert(${f ? 1 : 0})`,
637
+ transition: "filter 0.3s ease-in-out"
638
+ }
639
+ }
640
+ }
641
+ );
642
+ }
643
+ const re = M(be)``;
644
+ export {
645
+ Tt as H,
646
+ Ne as L,
647
+ L as P,
648
+ Qe as T,
649
+ Ge as a,
650
+ N as b,
651
+ Rt as c,
652
+ j as d,
653
+ Je as e
654
+ };