@blocklet/pages-kit-inner-components 0.6.103 → 0.6.105
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/lib/cjs/add-component.js +1 -1
- package/lib/cjs/chunks/components-BmFOXvb0.js +57 -0
- package/lib/cjs/chunks/{draft-data-CkVvOh60.js → draft-data-e1KnFlxv.js} +1 -1
- package/lib/cjs/chunks/{home-DdN3Z-6B.js → home-DHmHyTMb.js} +10 -10
- package/lib/cjs/chunks/{index-B-Wh6PRT.js → index-Cu2Jg8OH.js} +24 -24
- package/lib/cjs/chunks/{publish-button-BtLFUEny.js → publish-button-Do7oJLSH.js} +1 -1
- package/lib/cjs/chunks/site-state-BQySNTiP.js +1 -0
- package/lib/cjs/chunks/state-DU3L5Lve.js +1 -0
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/project-html.js +1 -1
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +3 -3
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/add-component.js +2 -2
- package/lib/es/chunks/components-DLjI_Xlm.js +615 -0
- package/lib/es/chunks/{draft-data-BOoVhbon.js → draft-data-DRdPzuGm.js} +1 -1
- package/lib/es/chunks/{home-DVTVPkSm.js → home-DajDpGXA.js} +123 -123
- package/lib/es/chunks/{index-DENjTU8O.js → index-BpP1FqET.js} +239 -238
- package/lib/es/chunks/{publish-button-BVcMw8Fh.js → publish-button-8kEbdc0k.js} +3 -3
- package/lib/es/chunks/site-state-DS7eIMFg.js +1684 -0
- package/lib/es/chunks/{state-DNdwHwty.js → state-qDCrgEMQ.js} +114 -113
- package/lib/es/components.js +14 -13
- package/lib/es/home.js +3 -3
- package/lib/es/project-html.js +1 -1
- package/lib/es/resources.js +2 -2
- package/lib/es/setting.js +415 -413
- package/lib/es/site-state.js +2 -2
- package/package.json +7 -7
- package/lib/cjs/chunks/components-DsHjikTX.js +0 -57
- package/lib/cjs/chunks/site-state-DlLhHuIr.js +0 -1
- package/lib/cjs/chunks/state-BdtFHk36.js +0 -1
- package/lib/es/chunks/components-BIhMGXjB.js +0 -610
- package/lib/es/chunks/site-state-CN4Kulgk.js +0 -1671
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as T } from "react/jsx-runtime";
|
|
2
|
-
import { u as U, c as W, d as se, e as ie, f as le, b as ce } from "./state-
|
|
2
|
+
import { u as U, c as W, d as se, e as ie, f as le, b as ce } from "./state-qDCrgEMQ.js";
|
|
3
3
|
import { useLocaleContext as V } from "@arcblock/ux/lib/Locale/context";
|
|
4
4
|
import A from "@arcblock/ux/lib/Result";
|
|
5
5
|
import { styled as M, useTheme as ue } from "@arcblock/ux/lib/Theme";
|
|
@@ -10,44 +10,44 @@ import { generateParamCombinations as me } from "@blocklet/pages-kit/utils/route
|
|
|
10
10
|
import ge from "@blocklet/ui-react/lib/Header";
|
|
11
11
|
import { cx as he } from "@emotion/css";
|
|
12
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
|
|
14
|
-
import { useReactive as
|
|
15
|
-
import
|
|
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 Q, useDeepCompareEffect as xe, useScroll as ve } from "ahooks";
|
|
15
|
+
import Pe from "isomorphic-dompurify";
|
|
16
16
|
import R from "lodash/cloneDeep";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useRef as B, useEffect as C, lazy as
|
|
20
|
-
import { Helmet as
|
|
21
|
-
import { useSearchParams as Z, Routes as
|
|
17
|
+
import ke from "lodash/isEmpty";
|
|
18
|
+
import X from "lodash/isEqual";
|
|
19
|
+
import { useRef as B, useEffect as C, lazy as J, useMemo as x, Suspense as we, useState as Se } from "react";
|
|
20
|
+
import { Helmet as Ce } from "react-helmet";
|
|
21
|
+
import { useSearchParams as Z, Routes as Ie, Route as S, Navigate as Te, ScrollRestoration as Re } from "react-router-dom";
|
|
22
22
|
import { useAsync as ee } from "react-use";
|
|
23
23
|
import { joinURL as P } from "ufo";
|
|
24
|
-
import { u as
|
|
25
|
-
import
|
|
24
|
+
import { u as je, S as Me, i as z, P as Ee, a as Le, R as Oe, B as Ae, b as te, g as Be } from "./index-BpP1FqET.js";
|
|
25
|
+
import _e from "@blocklet/ui-react/lib/Footer";
|
|
26
26
|
import "webfontloader";
|
|
27
|
-
import { u as
|
|
27
|
+
import { u as De, a as Fe } from "./session-Dx5M-1r2.js";
|
|
28
28
|
const $e = M(k)`
|
|
29
29
|
display: contents;
|
|
30
30
|
& > div > div > .MuiContainer-root {
|
|
31
31
|
max-width: unset;
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
|
-
function
|
|
35
|
-
const a = ue(), { getPageMetaStyle:
|
|
34
|
+
function ze({ meta: t, ...o }) {
|
|
35
|
+
const a = ue(), { getPageMetaStyle: r } = je(), n = r();
|
|
36
36
|
return /* @__PURE__ */ e(
|
|
37
37
|
$e,
|
|
38
38
|
{
|
|
39
39
|
sx: {
|
|
40
40
|
".blocklet__footer .MuiContainer-root": {
|
|
41
|
-
...
|
|
42
|
-
maxWidth:
|
|
41
|
+
...n.maxWidth && {
|
|
42
|
+
maxWidth: n.maxWidth
|
|
43
43
|
},
|
|
44
|
-
...
|
|
45
|
-
px:
|
|
44
|
+
...n.px && {
|
|
45
|
+
px: n.px
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
children: /* @__PURE__ */ e(
|
|
50
|
-
|
|
50
|
+
_e,
|
|
51
51
|
{
|
|
52
52
|
...o,
|
|
53
53
|
meta: t,
|
|
@@ -60,8 +60,8 @@ function De({ meta: t, ...o }) {
|
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
-
let
|
|
64
|
-
function
|
|
63
|
+
let He = null;
|
|
64
|
+
function Ne(t) {
|
|
65
65
|
const o = B(null), { type: a } = t;
|
|
66
66
|
return C(() => {
|
|
67
67
|
a === "app" && o.current;
|
|
@@ -89,10 +89,10 @@ function He(t) {
|
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return /* @__PURE__ */ e(
|
|
92
|
+
function Ue(t) {
|
|
93
|
+
return /* @__PURE__ */ e(We, { ...t });
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const We = M(k)`
|
|
96
96
|
position: fixed;
|
|
97
97
|
left: 0;
|
|
98
98
|
top: 0;
|
|
@@ -103,29 +103,29 @@ const Ue = M(k)`
|
|
|
103
103
|
opacity: 0.7;
|
|
104
104
|
transform: translateX(-23%) translateY(70%) rotate(-45deg);
|
|
105
105
|
pointer-events: none;
|
|
106
|
-
`,
|
|
106
|
+
`, Ve = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
107
107
|
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;
|
|
108
|
-
function
|
|
108
|
+
function Ge({
|
|
109
109
|
titleFontFamily: t,
|
|
110
110
|
descriptionFontFamily: o
|
|
111
111
|
}) {
|
|
112
|
-
const
|
|
112
|
+
const r = Y()?.typography?.fontFamily;
|
|
113
113
|
C(() => {
|
|
114
114
|
}, [t, o]);
|
|
115
|
-
const
|
|
115
|
+
const n = `${r}, ${Ve}`;
|
|
116
116
|
return /* @__PURE__ */ e(
|
|
117
117
|
q,
|
|
118
118
|
{
|
|
119
119
|
styles: K`
|
|
120
120
|
#app {
|
|
121
|
-
font-family: ${
|
|
121
|
+
font-family: ${n};
|
|
122
122
|
|
|
123
123
|
.page-kit-section__title {
|
|
124
|
-
font-family: ${
|
|
124
|
+
font-family: ${n};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
.page-kit-section__description {
|
|
128
|
-
font-family: ${
|
|
128
|
+
font-family: ${n};
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
`
|
|
@@ -135,36 +135,36 @@ function Ve({
|
|
|
135
135
|
function H(t) {
|
|
136
136
|
return t != null;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
const [t] = Z(), { session: o } =
|
|
140
|
-
const
|
|
141
|
-
return
|
|
138
|
+
function Rt() {
|
|
139
|
+
const [t] = Z(), { session: o } = De(), a = Fe("owner", "admin", "pagesEditor", "member"), r = x(() => {
|
|
140
|
+
const n = t.get("mode");
|
|
141
|
+
return Me.includes(n) ? n : "production";
|
|
142
142
|
}, [t]);
|
|
143
|
-
return
|
|
143
|
+
return r === "draft" && (!a || !o.user) ? /* @__PURE__ */ e(A, { status: "403" }) : /* @__PURE__ */ e(qe, { mode: r });
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function qe({ mode: t }) {
|
|
146
146
|
if (t !== "draft") {
|
|
147
147
|
const o = window.__PAGE_STATE__;
|
|
148
|
-
return o ? /* @__PURE__ */ e(
|
|
148
|
+
return o ? /* @__PURE__ */ e(O, { mode: t, state: o }) : /* @__PURE__ */ e(Qe, { mode: t, children: ({ state: a }) => /* @__PURE__ */ e(O, { mode: t, state: a }) });
|
|
149
149
|
}
|
|
150
|
-
return /* @__PURE__ */ e(
|
|
150
|
+
return /* @__PURE__ */ e(Ye, { children: ({ state: o }) => /* @__PURE__ */ e(O, { mode: t, state: o }) });
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
function
|
|
152
|
+
const Ke = J(() => import("./publish-button-8kEbdc0k.js")), Ye = J(() => import("./draft-data-DRdPzuGm.js"));
|
|
153
|
+
function Qe({
|
|
154
154
|
mode: t,
|
|
155
155
|
children: o
|
|
156
156
|
}) {
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
159
|
-
const u = localStorage.getItem(ce(
|
|
157
|
+
const r = document.querySelector('meta[property="pages:version"]')?.content, n = U(), i = x(() => {
|
|
158
|
+
if (r === "{{pagesPublishedAt}}") {
|
|
159
|
+
const u = localStorage.getItem(ce(n ?? ""));
|
|
160
160
|
return Number(u) ? Number(u) : (/* @__PURE__ */ new Date()).getTime();
|
|
161
161
|
}
|
|
162
|
-
return Number(
|
|
163
|
-
}, [
|
|
164
|
-
return p ? /* @__PURE__ */ e(
|
|
162
|
+
return Number(r);
|
|
163
|
+
}, [r]), { loading: p, value: c } = ee(() => Be({ mode: t, version: i }), [t, i]);
|
|
164
|
+
return p ? /* @__PURE__ */ e(Ne, {}) : c ? o({ state: c }) : null;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
const { t: a, locale:
|
|
166
|
+
function O({ mode: t, state: o }) {
|
|
167
|
+
const { t: a, locale: r } = V(), [n] = Z(), i = U(), p = se(), c = n.get("hiddenBadge") === "true", u = n.get("showPublish") === "true", {
|
|
168
168
|
pageIds: d,
|
|
169
169
|
pages: l,
|
|
170
170
|
routeIds: f,
|
|
@@ -173,8 +173,8 @@ function L({ mode: t, state: o }) {
|
|
|
173
173
|
config: { defaultLocale: y },
|
|
174
174
|
resources: w
|
|
175
175
|
} = o, b = W(o), v = x(
|
|
176
|
-
() => g?.some((h) => h.locale ===
|
|
177
|
-
[
|
|
176
|
+
() => g?.some((h) => h.locale === r) ? r : void 0,
|
|
177
|
+
[r, g]
|
|
178
178
|
), _ = 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
179
|
const s = l[h];
|
|
180
180
|
return s && {
|
|
@@ -190,18 +190,18 @@ function L({ mode: t, state: o }) {
|
|
|
190
190
|
path: P("/", p || i || "", s.path, `?mode=${t}&showPublish=true`)
|
|
191
191
|
} : null;
|
|
192
192
|
}).filter(H), [d, l, t, m, f, i, p]), I = ([...h]) => (t !== "production" && u && h.unshift(
|
|
193
|
-
/* @__PURE__ */ e(
|
|
193
|
+
/* @__PURE__ */ e(we, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(Ke, { ref: { current: null }, mode: "production", state: o }) })
|
|
194
194
|
), h);
|
|
195
|
-
return /* @__PURE__ */ T(
|
|
196
|
-
/* @__PURE__ */ T(
|
|
197
|
-
_ && /* @__PURE__ */ e(S, { index: !0, element: /* @__PURE__ */ e(
|
|
195
|
+
return /* @__PURE__ */ T(Ee, { value: { pages: ae }, children: [
|
|
196
|
+
/* @__PURE__ */ T(Ie, { children: [
|
|
197
|
+
_ && /* @__PURE__ */ e(S, { index: !0, element: /* @__PURE__ */ e(Te, { to: P("/", v || "", _.slug) }) }),
|
|
198
198
|
f?.map((h) => {
|
|
199
199
|
const s = m?.[h];
|
|
200
200
|
if (!s || !s.displayTemplateId) return null;
|
|
201
|
-
const
|
|
202
|
-
if (!
|
|
203
|
-
let
|
|
204
|
-
return s.params && s.params.length > 0 && (
|
|
201
|
+
const E = l[s.displayTemplateId];
|
|
202
|
+
if (!E) return null;
|
|
203
|
+
let L = [];
|
|
204
|
+
return s.params && s.params.length > 0 && (L = me({
|
|
205
205
|
basePath: s.path,
|
|
206
206
|
params: s.params,
|
|
207
207
|
routeId: s.id,
|
|
@@ -210,29 +210,29 @@ function L({ mode: t, state: o }) {
|
|
|
210
210
|
currentParams: [],
|
|
211
211
|
currentOptionIds: [],
|
|
212
212
|
result: []
|
|
213
|
-
})?.map((
|
|
214
|
-
const
|
|
213
|
+
})?.map((D) => {
|
|
214
|
+
const F = D.paramOptionIds.join("-");
|
|
215
215
|
return /* @__PURE__ */ e(
|
|
216
216
|
S,
|
|
217
217
|
{
|
|
218
|
-
path: P(":projectIdOrSlug?",
|
|
218
|
+
path: P(":projectIdOrSlug?", D.path),
|
|
219
219
|
element: /* @__PURE__ */ e(
|
|
220
220
|
N,
|
|
221
221
|
{
|
|
222
222
|
mode: t,
|
|
223
223
|
components: b,
|
|
224
|
-
page:
|
|
224
|
+
page: E,
|
|
225
225
|
locale: v,
|
|
226
226
|
defaultLocale: y,
|
|
227
227
|
headerAddons: I,
|
|
228
228
|
state: o,
|
|
229
|
-
pageData: s.dataSource?.pathDataMappings?.[
|
|
229
|
+
pageData: s.dataSource?.pathDataMappings?.[F]?.dataCache?.[v || y || "en"]
|
|
230
230
|
}
|
|
231
231
|
)
|
|
232
232
|
},
|
|
233
|
-
|
|
233
|
+
F
|
|
234
234
|
);
|
|
235
|
-
})),
|
|
235
|
+
})), L.push(
|
|
236
236
|
/* @__PURE__ */ e(
|
|
237
237
|
S,
|
|
238
238
|
{
|
|
@@ -242,7 +242,7 @@ function L({ mode: t, state: o }) {
|
|
|
242
242
|
{
|
|
243
243
|
mode: t,
|
|
244
244
|
components: b,
|
|
245
|
-
page:
|
|
245
|
+
page: E,
|
|
246
246
|
locale: v,
|
|
247
247
|
defaultLocale: y,
|
|
248
248
|
headerAddons: I,
|
|
@@ -253,7 +253,7 @@ function L({ mode: t, state: o }) {
|
|
|
253
253
|
},
|
|
254
254
|
s.id
|
|
255
255
|
)
|
|
256
|
-
),
|
|
256
|
+
), L;
|
|
257
257
|
}),
|
|
258
258
|
d?.map((h) => {
|
|
259
259
|
const s = l[h];
|
|
@@ -325,49 +325,49 @@ function L({ mode: t, state: o }) {
|
|
|
325
325
|
}
|
|
326
326
|
)
|
|
327
327
|
] }),
|
|
328
|
-
t !== "production" && !c && /* @__PURE__ */ e(
|
|
329
|
-
/* @__PURE__ */ e(
|
|
328
|
+
t !== "production" && !c && /* @__PURE__ */ e(Ue, { sx: { bgcolor: "info.light" }, children: t }),
|
|
329
|
+
/* @__PURE__ */ e(Ge, {})
|
|
330
330
|
] });
|
|
331
331
|
}
|
|
332
332
|
function N({
|
|
333
333
|
mode: t,
|
|
334
334
|
pageData: o,
|
|
335
335
|
components: a,
|
|
336
|
-
page:
|
|
337
|
-
locale:
|
|
336
|
+
page: r,
|
|
337
|
+
locale: n,
|
|
338
338
|
defaultLocale: i,
|
|
339
339
|
headerAddons: p,
|
|
340
340
|
state: c
|
|
341
341
|
}) {
|
|
342
|
-
const u =
|
|
342
|
+
const u = Q({
|
|
343
343
|
page: null
|
|
344
344
|
});
|
|
345
|
-
|
|
346
|
-
const l =
|
|
345
|
+
xe(() => {
|
|
346
|
+
const l = r || null;
|
|
347
347
|
l ? u.page = R(l) : u.page = null;
|
|
348
|
-
}, [
|
|
348
|
+
}, [r, u]);
|
|
349
349
|
const d = B(void 0);
|
|
350
350
|
return C(() => {
|
|
351
|
-
|
|
352
|
-
}, [u.page, o,
|
|
351
|
+
X(o, d.current) || o && u.page && (G(u.page, c, n, o), d.current = R(o));
|
|
352
|
+
}, [u.page, o, n, c]), u.page ? /* @__PURE__ */ e(
|
|
353
353
|
j,
|
|
354
354
|
{
|
|
355
355
|
mode: t,
|
|
356
356
|
components: a,
|
|
357
357
|
page: u.page,
|
|
358
|
-
locale:
|
|
358
|
+
locale: n,
|
|
359
359
|
defaultLocale: i,
|
|
360
360
|
headerAddons: p
|
|
361
361
|
}
|
|
362
362
|
) : null;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function jt({
|
|
365
365
|
mode: t,
|
|
366
366
|
state: o,
|
|
367
367
|
path: a,
|
|
368
|
-
pageData:
|
|
368
|
+
pageData: r
|
|
369
369
|
}) {
|
|
370
|
-
const { t:
|
|
370
|
+
const { t: n, locale: i } = V(), {
|
|
371
371
|
pages: p,
|
|
372
372
|
supportedLocales: c,
|
|
373
373
|
config: { defaultLocale: u },
|
|
@@ -375,7 +375,7 @@ function Rt({
|
|
|
375
375
|
} = o, l = Object.values(p).find((b) => b?.slug === a), f = Object.values(d?.pages || {}).find((b) => b.page.slug === a), m = x(
|
|
376
376
|
() => c?.some((b) => b.locale === i) ? i : void 0,
|
|
377
377
|
[i, c]
|
|
378
|
-
), g =
|
|
378
|
+
), g = Q({
|
|
379
379
|
page: null
|
|
380
380
|
});
|
|
381
381
|
C(() => {
|
|
@@ -384,7 +384,7 @@ function Rt({
|
|
|
384
384
|
}, [l, f]);
|
|
385
385
|
const y = B(void 0);
|
|
386
386
|
if (C(() => {
|
|
387
|
-
|
|
387
|
+
X(r, y.current) || r && g.page && (G(g.page, o, m, r), y.current = R(r));
|
|
388
388
|
}, [{}]), !l && !f?.page)
|
|
389
389
|
return /* @__PURE__ */ e(
|
|
390
390
|
k,
|
|
@@ -396,7 +396,7 @@ function Rt({
|
|
|
396
396
|
justifyContent: "center",
|
|
397
397
|
alignItems: "center"
|
|
398
398
|
},
|
|
399
|
-
children: /* @__PURE__ */ e(A, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(re, { href: "/", children:
|
|
399
|
+
children: /* @__PURE__ */ e(A, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(re, { href: "/", children: n("common.back") }) })
|
|
400
400
|
}
|
|
401
401
|
);
|
|
402
402
|
const w = W(o);
|
|
@@ -415,12 +415,12 @@ function j({
|
|
|
415
415
|
mode: t,
|
|
416
416
|
components: o,
|
|
417
417
|
page: a,
|
|
418
|
-
locale:
|
|
419
|
-
defaultLocale:
|
|
418
|
+
locale: r,
|
|
419
|
+
defaultLocale: n,
|
|
420
420
|
headerAddons: i
|
|
421
421
|
}) {
|
|
422
|
-
const p = de(), c = a.locales?.[
|
|
423
|
-
return /* @__PURE__ */ T(
|
|
422
|
+
const p = de(), c = a.locales?.[r] ?? a.locales?.[n] ?? {}, u = c.title || window.blocklet?.appName, d = c.description || window.blocklet?.appDescription, l = ie(le(c.image), 540);
|
|
423
|
+
return /* @__PURE__ */ T(Le, { page: a, defaultLocale: n, currentLocale: r, children: [
|
|
424
424
|
/* @__PURE__ */ e(
|
|
425
425
|
q,
|
|
426
426
|
{
|
|
@@ -433,9 +433,9 @@ function j({
|
|
|
433
433
|
`
|
|
434
434
|
}
|
|
435
435
|
),
|
|
436
|
-
/* @__PURE__ */ e(
|
|
437
|
-
/* @__PURE__ */ e(
|
|
438
|
-
/* @__PURE__ */ T(
|
|
436
|
+
/* @__PURE__ */ e(Xe, { meta: c, headerAddons: i }),
|
|
437
|
+
/* @__PURE__ */ e(Re, {}),
|
|
438
|
+
/* @__PURE__ */ T(Ce, { children: [
|
|
439
439
|
/* @__PURE__ */ e("title", { children: u }),
|
|
440
440
|
/* @__PURE__ */ e("meta", { name: "og:title", content: u }),
|
|
441
441
|
/* @__PURE__ */ e("meta", { name: "og:description", content: d }),
|
|
@@ -459,27 +459,27 @@ function j({
|
|
|
459
459
|
zIndex: 0
|
|
460
460
|
// 确保页面内容在其他元素之上
|
|
461
461
|
},
|
|
462
|
-
children: /* @__PURE__ */ e(
|
|
462
|
+
children: /* @__PURE__ */ e(Oe, { children: a?.sectionIds?.map((f, m) => {
|
|
463
463
|
const g = a.sections[f];
|
|
464
464
|
if (!g || g.visibility === "hidden") return null;
|
|
465
|
-
const y = a.dataSource?.[f]?.[
|
|
465
|
+
const y = a.dataSource?.[f]?.[r], w = a.dataSource?.[f]?.[n] ?? {};
|
|
466
466
|
return /* @__PURE__ */ e(k, { sx: { position: "relative" }, children: /* @__PURE__ */ e(
|
|
467
|
-
|
|
467
|
+
Ae,
|
|
468
468
|
{
|
|
469
469
|
id: f,
|
|
470
470
|
type: g.component,
|
|
471
471
|
mode: t,
|
|
472
472
|
section: g,
|
|
473
473
|
config: {
|
|
474
|
-
...
|
|
475
|
-
locale:
|
|
474
|
+
...ke(y) ? w : y,
|
|
475
|
+
locale: r,
|
|
476
476
|
dev: t === "draft" ? {
|
|
477
477
|
mode: t,
|
|
478
478
|
components: o,
|
|
479
|
-
defaultLocale:
|
|
479
|
+
defaultLocale: n
|
|
480
480
|
} : {
|
|
481
481
|
mode: t,
|
|
482
|
-
defaultLocale:
|
|
482
|
+
defaultLocale: n
|
|
483
483
|
// 用于 fallback 的 locale
|
|
484
484
|
}
|
|
485
485
|
},
|
|
@@ -491,7 +491,7 @@ function j({
|
|
|
491
491
|
}) })
|
|
492
492
|
}
|
|
493
493
|
),
|
|
494
|
-
!c.footer?.hidden && /* @__PURE__ */ e(
|
|
494
|
+
!c.footer?.hidden && /* @__PURE__ */ e(ze, {})
|
|
495
495
|
] });
|
|
496
496
|
}
|
|
497
497
|
const oe = M(ge)`
|
|
@@ -500,15 +500,15 @@ const oe = M(ge)`
|
|
|
500
500
|
top: 0;
|
|
501
501
|
}
|
|
502
502
|
`;
|
|
503
|
-
function
|
|
504
|
-
const { logo: a, brand:
|
|
503
|
+
function Xe({ meta: t, headerAddons: o }) {
|
|
504
|
+
const { logo: a, brand: r, description: n, ...i } = pe(), p = te(), c = x(
|
|
505
505
|
() => (d) => {
|
|
506
506
|
let l = o?.(d) ?? d;
|
|
507
507
|
return l = i.addons?.(l) ?? l, l;
|
|
508
508
|
},
|
|
509
509
|
[i.addons, o]
|
|
510
510
|
), u = x(
|
|
511
|
-
() => t.header?.translucent ?
|
|
511
|
+
() => t.header?.translucent ? Je : oe,
|
|
512
512
|
[t.header?.translucent]
|
|
513
513
|
);
|
|
514
514
|
return /* @__PURE__ */ e(
|
|
@@ -517,8 +517,8 @@ function Je({ meta: t, headerAddons: o }) {
|
|
|
517
517
|
hideNavMenu: !!t.header?.hideNavMenus,
|
|
518
518
|
translucentTextColor: t.header?.translucentTextColor,
|
|
519
519
|
...a ? { logo: /* @__PURE__ */ e(ne, { logo: a }) } : {},
|
|
520
|
-
...
|
|
521
|
-
...
|
|
520
|
+
...r ? { brand: r } : {},
|
|
521
|
+
...n ? { description: n } : {},
|
|
522
522
|
className: he(t.header?.sticky && "sticky", "page-header"),
|
|
523
523
|
maxWidth: !1,
|
|
524
524
|
addons: c,
|
|
@@ -544,9 +544,9 @@ function Je({ meta: t, headerAddons: o }) {
|
|
|
544
544
|
);
|
|
545
545
|
}
|
|
546
546
|
function ne({ logo: t }) {
|
|
547
|
-
const [o, a] =
|
|
547
|
+
const [o, a] = Se(), r = te(), { value: n } = ee(() => {
|
|
548
548
|
const i = new URL(
|
|
549
|
-
|
|
549
|
+
r ? window?.blocklet?.appLogo || "/.well-known/service/blocklet/logo" : window?.blocklet?.appLogoRect || "/.well-known/service/blocklet/logo-rect",
|
|
550
550
|
window.location.origin
|
|
551
551
|
);
|
|
552
552
|
i.searchParams.delete("imageFilter"), i.searchParams.delete("f");
|
|
@@ -558,29 +558,29 @@ function ne({ logo: t }) {
|
|
|
558
558
|
}), c(u.url);
|
|
559
559
|
});
|
|
560
560
|
});
|
|
561
|
-
}, [
|
|
562
|
-
if (
|
|
561
|
+
}, [r]);
|
|
562
|
+
if (r)
|
|
563
563
|
return null;
|
|
564
564
|
if (t)
|
|
565
565
|
return t;
|
|
566
566
|
if (o)
|
|
567
|
-
return /* @__PURE__ */ e(k, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html:
|
|
568
|
-
if (
|
|
569
|
-
const i = new URL(
|
|
567
|
+
return /* @__PURE__ */ e(k, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Pe.sanitize(o) } });
|
|
568
|
+
if (n) {
|
|
569
|
+
const i = new URL(n);
|
|
570
570
|
i.searchParams.set("imageFilter", "convert"), i.searchParams.set("f", "png"), i.searchParams.set("h", "80");
|
|
571
571
|
const p = i.toString();
|
|
572
572
|
return /* @__PURE__ */ e("img", { src: p, alt: "logo" });
|
|
573
573
|
}
|
|
574
574
|
return null;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Je({
|
|
577
577
|
logo: t,
|
|
578
578
|
translucentTextColor: o,
|
|
579
579
|
...a
|
|
580
580
|
}) {
|
|
581
|
-
const
|
|
581
|
+
const n = ve(document.getElementById("app"), (m) => m.top < 1200), i = Y(), p = i.palette.mode === "dark", c = Math.min(n?.top ?? 0, 800), u = x(() => {
|
|
582
582
|
let m = Math.min(c / 800, 1), g = "";
|
|
583
|
-
return m > 0.1 ? (m = Math.max(m, 0.6), g =
|
|
583
|
+
return m > 0.1 ? (m = Math.max(m, 0.6), g = $(i.palette.text.primary, m)) : g = o || "#EEEEEE", {
|
|
584
584
|
backgroundOpacity: m,
|
|
585
585
|
textColor: g,
|
|
586
586
|
isReversed: m < 0.7
|
|
@@ -612,7 +612,7 @@ function Qe({
|
|
|
612
612
|
zIndex: -1,
|
|
613
613
|
// 置于内容下方
|
|
614
614
|
// 背景样式(颜色和模糊)是固定的
|
|
615
|
-
backgroundColor:
|
|
615
|
+
backgroundColor: $(i.palette.background.default, d),
|
|
616
616
|
backdropFilter: d >= 0.6 ? "blur(10px)" : "blur(0px)",
|
|
617
617
|
// **性能关键**: 只对 opacity 进行动画
|
|
618
618
|
// opacity: backgroundOpacity,
|
|
@@ -651,13 +651,13 @@ function Qe({
|
|
|
651
651
|
}
|
|
652
652
|
const re = M(be)``;
|
|
653
653
|
export {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
654
|
+
Rt as H,
|
|
655
|
+
Ne as L,
|
|
656
|
+
O as P,
|
|
657
|
+
Je as T,
|
|
658
|
+
qe as a,
|
|
659
659
|
N as b,
|
|
660
|
-
|
|
660
|
+
jt as c,
|
|
661
661
|
j as d,
|
|
662
|
-
|
|
662
|
+
Xe as e
|
|
663
663
|
};
|