@blocklet/pages-kit-inner-components 0.6.24 → 0.6.26
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/home-DtcV9AQz.js +39 -0
- package/lib/cjs/chunks/index-B5nhwNMT.js +475 -0
- package/lib/cjs/chunks/{publish-button-BAFrnjhg.js → publish-button-1rzLInzU.js} +1 -1
- package/lib/cjs/chunks/site-state-8lUnv-C3.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/locales.js +2 -2
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/add-component.js +1 -1
- package/lib/es/chunks/{home-8eDa8KD4.js → home-CP6-1N2p.js} +182 -181
- package/lib/es/chunks/index-CaKPHd8j.js +3013 -0
- package/lib/es/chunks/{publish-button-CaPZ_kmc.js → publish-button-BvvRgazT.js} +2 -2
- package/lib/es/chunks/{site-state-CqlS8v17.js → site-state-Bx2ZDYuu.js} +1 -1
- package/lib/es/home.js +2 -2
- package/lib/es/locales.js +10 -4
- package/lib/es/resources.js +1 -1
- package/lib/es/site-state.js +1 -1
- package/package.json +12 -12
- package/lib/cjs/chunks/home-BUhkvEa6.js +0 -39
- package/lib/cjs/chunks/index-BIQBchDT.js +0 -475
- package/lib/cjs/chunks/site-state-CkqENAbR.js +0 -1
- package/lib/es/chunks/index-MrU6URFS.js +0 -2780
|
@@ -2,42 +2,42 @@ import { jsx as e, jsxs as R } from "react/jsx-runtime";
|
|
|
2
2
|
import { u as z, c as U, d as re, e as ae, f as se, b as ie } from "./state-DSo43FAB.js";
|
|
3
3
|
import { useLocaleContext as V } from "@arcblock/ux/lib/Locale/context";
|
|
4
4
|
import G from "@arcblock/ux/lib/Result";
|
|
5
|
-
import { styled as M, useTheme as
|
|
6
|
-
import { useHeaderState as
|
|
5
|
+
import { styled as M, useTheme as le } from "@arcblock/ux/lib/Theme";
|
|
6
|
+
import { useHeaderState as ce } from "@blocklet/pages-kit/builtin/page/header";
|
|
7
7
|
import { useColorConvert as ue } from "@blocklet/pages-kit/contexts/color";
|
|
8
8
|
import { setPageDataSource as W } from "@blocklet/pages-kit/utils/data-source";
|
|
9
9
|
import { generateParamCombinations as pe } from "@blocklet/pages-kit/utils/route";
|
|
10
10
|
import de from "@blocklet/ui-react/lib/Header";
|
|
11
11
|
import { cx as me } from "@emotion/css";
|
|
12
12
|
import { Global as q, css as K } from "@emotion/react";
|
|
13
|
-
import { Box as
|
|
13
|
+
import { Box as w, CircularProgress as ge, useTheme as Y, Button as he, Stack as fe, alpha as $, useMediaQuery as be } from "@mui/material";
|
|
14
14
|
import { useReactive as J, useScroll as ye } from "ahooks";
|
|
15
15
|
import ve from "isomorphic-dompurify";
|
|
16
16
|
import O from "lodash/cloneDeep";
|
|
17
17
|
import xe from "lodash/isEmpty";
|
|
18
18
|
import Q from "lodash/isEqual";
|
|
19
|
-
import { useEffect as T, lazy as X, useMemo as P, useRef as Z, Suspense as Pe, useState as
|
|
20
|
-
import { Helmet as
|
|
21
|
-
import { useSearchParams as ee, Routes as Se, Route as
|
|
19
|
+
import { useEffect as T, lazy as X, useMemo as P, useRef as Z, Suspense as Pe, useState as ke } from "react";
|
|
20
|
+
import { Helmet as we } from "react-helmet";
|
|
21
|
+
import { useSearchParams as ee, Routes as Se, Route as C, Navigate as Ce, ScrollRestoration as Ie } from "react-router-dom";
|
|
22
22
|
import { useAsync as te } from "react-use";
|
|
23
|
-
import { joinURL as
|
|
24
|
-
import { S as Te, P as je, a as Re, B as Oe, g as Ee } from "./index-
|
|
23
|
+
import { joinURL as k } from "ufo";
|
|
24
|
+
import { S as Te, P as je, a as Re, B as Oe, g as Ee } from "./index-CaKPHd8j.js";
|
|
25
25
|
import Me from "@blocklet/ui-react/lib/Footer";
|
|
26
26
|
import "webfontloader";
|
|
27
27
|
import { u as Ae, a as Be } from "./session-C72Dq8zg.js";
|
|
28
|
-
const Le = M(
|
|
28
|
+
const Le = M(w)`
|
|
29
29
|
display: contents;
|
|
30
30
|
& > div > div > .MuiContainer-root {
|
|
31
31
|
max-width: unset;
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
34
|
function Fe({ meta: t, ...o }) {
|
|
35
|
-
const
|
|
36
|
-
return /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(Me, { ...o, meta: t, theme:
|
|
35
|
+
const l = le();
|
|
36
|
+
return /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(Me, { ...o, meta: t, theme: l || {} }) });
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function De(t) {
|
|
39
39
|
return /* @__PURE__ */ e(
|
|
40
|
-
|
|
40
|
+
w,
|
|
41
41
|
{
|
|
42
42
|
...t,
|
|
43
43
|
sx: [
|
|
@@ -54,10 +54,10 @@ function _e(t) {
|
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return /* @__PURE__ */ e(
|
|
57
|
+
function _e(t) {
|
|
58
|
+
return /* @__PURE__ */ e($e, { ...t });
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const $e = M(w)`
|
|
61
61
|
position: fixed;
|
|
62
62
|
left: 0;
|
|
63
63
|
top: 0;
|
|
@@ -77,20 +77,20 @@ function He({
|
|
|
77
77
|
const r = Y()?.typography?.fontFamily;
|
|
78
78
|
T(() => {
|
|
79
79
|
}, [t, o]);
|
|
80
|
-
const
|
|
80
|
+
const i = `${r}, ${Ne}`;
|
|
81
81
|
return /* @__PURE__ */ e(
|
|
82
82
|
q,
|
|
83
83
|
{
|
|
84
84
|
styles: K`
|
|
85
85
|
#app {
|
|
86
|
-
font-family: ${
|
|
86
|
+
font-family: ${i};
|
|
87
87
|
|
|
88
88
|
.page-kit-section__title {
|
|
89
|
-
font-family: ${
|
|
89
|
+
font-family: ${i};
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.page-kit-section__description {
|
|
93
|
-
font-family: ${
|
|
93
|
+
font-family: ${i};
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
`
|
|
@@ -100,66 +100,66 @@ function He({
|
|
|
100
100
|
function N(t) {
|
|
101
101
|
return t != null;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const [t] = ee(), { session: o } = Ae(),
|
|
103
|
+
function kt() {
|
|
104
|
+
const [t] = ee(), { session: o } = Ae(), l = Be("owner", "admin", "pagesEditor", "member"), r = P(() => {
|
|
105
105
|
const n = t.get("mode");
|
|
106
106
|
return Te.includes(n) ? n : "production";
|
|
107
|
-
}, [t]),
|
|
108
|
-
return
|
|
107
|
+
}, [t]), i = r === "production" ? r : o.user ? l ? r : "production" : null;
|
|
108
|
+
return i ? /* @__PURE__ */ e(ze, { mode: i }) : null;
|
|
109
109
|
}
|
|
110
110
|
function ze({ mode: t }) {
|
|
111
111
|
if (t !== "draft") {
|
|
112
112
|
const o = window.__PAGE_STATE__;
|
|
113
|
-
return o ? /* @__PURE__ */ e(F, { mode: t, state: o }) : /* @__PURE__ */ e(Ge, { mode: t, children: ({ state:
|
|
113
|
+
return o ? /* @__PURE__ */ e(F, { mode: t, state: o }) : /* @__PURE__ */ e(Ge, { mode: t, children: ({ state: l }) => /* @__PURE__ */ e(F, { mode: t, state: l }) });
|
|
114
114
|
}
|
|
115
115
|
return /* @__PURE__ */ e(Ve, { children: ({ state: o }) => /* @__PURE__ */ e(F, { mode: t, state: o }) });
|
|
116
116
|
}
|
|
117
|
-
const Ue = X(() => import("./publish-button-
|
|
117
|
+
const Ue = X(() => import("./publish-button-BvvRgazT.js")), Ve = X(() => import("./draft-data-CpCuyq4R.js"));
|
|
118
118
|
function Ge({
|
|
119
119
|
mode: t,
|
|
120
120
|
children: o
|
|
121
121
|
}) {
|
|
122
|
-
const r = document.querySelector('meta[property="pages:version"]')?.content,
|
|
122
|
+
const r = document.querySelector('meta[property="pages:version"]')?.content, i = z(), n = P(() => {
|
|
123
123
|
if (r === "{{pagesPublishedAt}}") {
|
|
124
|
-
const
|
|
125
|
-
return Number(
|
|
124
|
+
const c = localStorage.getItem(ie(i ?? ""));
|
|
125
|
+
return Number(c) ? Number(c) : (/* @__PURE__ */ new Date()).getTime();
|
|
126
126
|
}
|
|
127
127
|
return Number(r);
|
|
128
|
-
}, [r]), { loading:
|
|
129
|
-
return
|
|
128
|
+
}, [r]), { loading: m, value: s } = te(() => Ee({ mode: t, version: n }), [t, n]);
|
|
129
|
+
return m ? /* @__PURE__ */ e(De, {}) : s ? o({ state: s }) : null;
|
|
130
130
|
}
|
|
131
131
|
function F({ mode: t, state: o }) {
|
|
132
|
-
const { t:
|
|
133
|
-
pageIds:
|
|
132
|
+
const { t: l, locale: r } = V(), [i] = ee(), n = z(), m = re(), s = i.get("hiddenBadge") === "true", c = i.get("showPublish") === "true", {
|
|
133
|
+
pageIds: h,
|
|
134
134
|
pages: u,
|
|
135
|
-
routeIds:
|
|
136
|
-
routes:
|
|
137
|
-
supportedLocales:
|
|
135
|
+
routeIds: y,
|
|
136
|
+
routes: p,
|
|
137
|
+
supportedLocales: f,
|
|
138
138
|
config: { defaultLocale: v },
|
|
139
|
-
resources:
|
|
140
|
-
} = o,
|
|
141
|
-
() =>
|
|
142
|
-
[r,
|
|
143
|
-
), I = Object.values(
|
|
144
|
-
const a = u[
|
|
139
|
+
resources: S
|
|
140
|
+
} = o, b = U(o), g = P(
|
|
141
|
+
() => f?.some((d) => d.locale === r) ? r : void 0,
|
|
142
|
+
[r, f]
|
|
143
|
+
), I = Object.values(p || {}).find((d) => d?.path === "/") || Object.values(u).find((d) => d?.slug === "/") ? void 0 : Object.values(u)[0], A = P(() => t === "production" ? h.map((d) => {
|
|
144
|
+
const a = u[d];
|
|
145
145
|
return a && {
|
|
146
146
|
id: a.id,
|
|
147
|
-
path:
|
|
147
|
+
path: k("/", m || n || "", a.slug)
|
|
148
148
|
};
|
|
149
|
-
}).filter(N) :
|
|
150
|
-
const a =
|
|
149
|
+
}).filter(N) : y.map((d) => {
|
|
150
|
+
const a = p[d];
|
|
151
151
|
return a ? {
|
|
152
152
|
id: a.id,
|
|
153
|
-
path:
|
|
153
|
+
path: k("/", m || n || "", a.path, `?mode=${t}&showPublish=true`)
|
|
154
154
|
} : null;
|
|
155
|
-
}).filter(N), [
|
|
155
|
+
}).filter(N), [h, u, t, p, y, n, m]), j = ([...d]) => (t !== "production" && c && d.unshift(
|
|
156
156
|
/* @__PURE__ */ e(Pe, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(Ue, { ref: { current: null }, mode: "production", state: o }) })
|
|
157
|
-
),
|
|
157
|
+
), d);
|
|
158
158
|
return /* @__PURE__ */ R(je, { value: { pages: A }, children: [
|
|
159
159
|
/* @__PURE__ */ R(Se, { children: [
|
|
160
|
-
I && /* @__PURE__ */ e(
|
|
161
|
-
|
|
162
|
-
const a =
|
|
160
|
+
I && /* @__PURE__ */ e(C, { index: !0, element: /* @__PURE__ */ e(Ce, { to: k("/", g || "", I.slug) }) }),
|
|
161
|
+
y?.map((d) => {
|
|
162
|
+
const a = p?.[d];
|
|
163
163
|
if (!a || !a.displayTemplateId) return null;
|
|
164
164
|
const B = u[a.displayTemplateId];
|
|
165
165
|
if (!B) return null;
|
|
@@ -173,44 +173,44 @@ function F({ mode: t, state: o }) {
|
|
|
173
173
|
currentParams: [],
|
|
174
174
|
currentOptionIds: [],
|
|
175
175
|
result: []
|
|
176
|
-
})?.map((
|
|
177
|
-
const
|
|
176
|
+
})?.map((D) => {
|
|
177
|
+
const _ = D.paramOptionIds.join("-");
|
|
178
178
|
return /* @__PURE__ */ e(
|
|
179
|
-
|
|
179
|
+
C,
|
|
180
180
|
{
|
|
181
|
-
path:
|
|
181
|
+
path: k(":projectIdOrSlug?", D.path),
|
|
182
182
|
element: /* @__PURE__ */ e(
|
|
183
183
|
H,
|
|
184
184
|
{
|
|
185
185
|
mode: t,
|
|
186
|
-
components:
|
|
186
|
+
components: b,
|
|
187
187
|
page: B,
|
|
188
|
-
locale:
|
|
188
|
+
locale: g,
|
|
189
189
|
defaultLocale: v,
|
|
190
190
|
headerAddons: j,
|
|
191
191
|
state: o,
|
|
192
|
-
pageData: a.dataSource?.pathDataMappings?.[
|
|
192
|
+
pageData: a.dataSource?.pathDataMappings?.[_]?.dataCache?.[g || v || "en"]
|
|
193
193
|
}
|
|
194
194
|
)
|
|
195
195
|
},
|
|
196
|
-
|
|
196
|
+
_
|
|
197
197
|
);
|
|
198
198
|
})), L.push(
|
|
199
199
|
/* @__PURE__ */ e(
|
|
200
|
-
|
|
200
|
+
C,
|
|
201
201
|
{
|
|
202
|
-
path:
|
|
202
|
+
path: k(":projectIdOrSlug?", a.path),
|
|
203
203
|
element: /* @__PURE__ */ e(
|
|
204
204
|
H,
|
|
205
205
|
{
|
|
206
206
|
mode: t,
|
|
207
|
-
components:
|
|
207
|
+
components: b,
|
|
208
208
|
page: B,
|
|
209
|
-
locale:
|
|
209
|
+
locale: g,
|
|
210
210
|
defaultLocale: v,
|
|
211
211
|
headerAddons: j,
|
|
212
212
|
state: o,
|
|
213
|
-
pageData: a.dataSource?.pathDataMappings?.[a.id]?.dataCache?.[
|
|
213
|
+
pageData: a.dataSource?.pathDataMappings?.[a.id]?.dataCache?.[g || v || "en"]
|
|
214
214
|
}
|
|
215
215
|
)
|
|
216
216
|
},
|
|
@@ -218,19 +218,19 @@ function F({ mode: t, state: o }) {
|
|
|
218
218
|
)
|
|
219
219
|
), L;
|
|
220
220
|
}),
|
|
221
|
-
|
|
222
|
-
const a = u[
|
|
221
|
+
h.map((d) => {
|
|
222
|
+
const a = u[d];
|
|
223
223
|
return a ? /* @__PURE__ */ e(
|
|
224
|
-
|
|
224
|
+
C,
|
|
225
225
|
{
|
|
226
|
-
path:
|
|
226
|
+
path: k(":projectIdOrSlug?", a.slug),
|
|
227
227
|
element: /* @__PURE__ */ e(
|
|
228
228
|
E,
|
|
229
229
|
{
|
|
230
230
|
mode: t,
|
|
231
|
-
components:
|
|
231
|
+
components: b,
|
|
232
232
|
page: a,
|
|
233
|
-
locale:
|
|
233
|
+
locale: g,
|
|
234
234
|
defaultLocale: v,
|
|
235
235
|
headerAddons: j
|
|
236
236
|
}
|
|
@@ -239,17 +239,17 @@ function F({ mode: t, state: o }) {
|
|
|
239
239
|
a.id
|
|
240
240
|
) : null;
|
|
241
241
|
}),
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
S.pages && Object.values(S.pages).map(({ blockletId: d, page: a }) => /* @__PURE__ */ e(
|
|
243
|
+
C,
|
|
244
244
|
{
|
|
245
|
-
path:
|
|
245
|
+
path: k("/", `@${d}`, a.slug),
|
|
246
246
|
element: /* @__PURE__ */ e(
|
|
247
247
|
E,
|
|
248
248
|
{
|
|
249
249
|
mode: t,
|
|
250
|
-
components:
|
|
250
|
+
components: b,
|
|
251
251
|
page: a,
|
|
252
|
-
locale:
|
|
252
|
+
locale: g,
|
|
253
253
|
defaultLocale: v,
|
|
254
254
|
headerAddons: j
|
|
255
255
|
}
|
|
@@ -258,11 +258,11 @@ function F({ mode: t, state: o }) {
|
|
|
258
258
|
a.id
|
|
259
259
|
)),
|
|
260
260
|
/* @__PURE__ */ e(
|
|
261
|
-
|
|
261
|
+
C,
|
|
262
262
|
{
|
|
263
263
|
path: "*",
|
|
264
264
|
element: /* @__PURE__ */ e(
|
|
265
|
-
|
|
265
|
+
w,
|
|
266
266
|
{
|
|
267
267
|
sx: {
|
|
268
268
|
width: "100vw",
|
|
@@ -275,7 +275,7 @@ function F({ mode: t, state: o }) {
|
|
|
275
275
|
G,
|
|
276
276
|
{
|
|
277
277
|
status: 404,
|
|
278
|
-
extra: /* @__PURE__ */ e(ne, { href: "/", children:
|
|
278
|
+
extra: /* @__PURE__ */ e(ne, { href: "/", children: l("common.back") }),
|
|
279
279
|
sx: {
|
|
280
280
|
bgcolor: "transparent",
|
|
281
281
|
width: "100%",
|
|
@@ -288,69 +288,69 @@ function F({ mode: t, state: o }) {
|
|
|
288
288
|
}
|
|
289
289
|
)
|
|
290
290
|
] }),
|
|
291
|
-
t !== "production" && !
|
|
291
|
+
t !== "production" && !s && /* @__PURE__ */ e(_e, { sx: { bgcolor: "info.light" }, children: t }),
|
|
292
292
|
/* @__PURE__ */ e(He, {})
|
|
293
293
|
] });
|
|
294
294
|
}
|
|
295
295
|
function H({
|
|
296
296
|
mode: t,
|
|
297
297
|
pageData: o,
|
|
298
|
-
components:
|
|
298
|
+
components: l,
|
|
299
299
|
page: r,
|
|
300
|
-
locale:
|
|
300
|
+
locale: i,
|
|
301
301
|
defaultLocale: n,
|
|
302
|
-
headerAddons:
|
|
303
|
-
state:
|
|
302
|
+
headerAddons: m,
|
|
303
|
+
state: s
|
|
304
304
|
}) {
|
|
305
|
-
const
|
|
305
|
+
const c = J({
|
|
306
306
|
page: null
|
|
307
307
|
});
|
|
308
308
|
T(() => {
|
|
309
309
|
const u = r || null;
|
|
310
|
-
u ?
|
|
311
|
-
}, [r, JSON.stringify(r),
|
|
312
|
-
const
|
|
310
|
+
u ? c.page = O(u) : c.page = null;
|
|
311
|
+
}, [r, JSON.stringify(r), c]);
|
|
312
|
+
const h = Z(void 0);
|
|
313
313
|
return T(() => {
|
|
314
|
-
Q(o,
|
|
315
|
-
}, [
|
|
314
|
+
Q(o, h.current) || o && c.page && (W(c.page, s, i, o), h.current = O(o));
|
|
315
|
+
}, [c.page, o, i, s]), c.page ? /* @__PURE__ */ e(
|
|
316
316
|
E,
|
|
317
317
|
{
|
|
318
318
|
mode: t,
|
|
319
|
-
components:
|
|
320
|
-
page:
|
|
321
|
-
locale:
|
|
319
|
+
components: l,
|
|
320
|
+
page: c.page,
|
|
321
|
+
locale: i,
|
|
322
322
|
defaultLocale: n,
|
|
323
|
-
headerAddons:
|
|
323
|
+
headerAddons: m
|
|
324
324
|
}
|
|
325
325
|
) : null;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function wt({
|
|
328
328
|
mode: t,
|
|
329
329
|
state: o,
|
|
330
|
-
path:
|
|
330
|
+
path: l,
|
|
331
331
|
pageData: r
|
|
332
332
|
}) {
|
|
333
|
-
const { t:
|
|
334
|
-
pages:
|
|
335
|
-
supportedLocales:
|
|
336
|
-
config: { defaultLocale:
|
|
337
|
-
resources:
|
|
338
|
-
} = o, u = Object.values(
|
|
339
|
-
() =>
|
|
340
|
-
[n,
|
|
341
|
-
),
|
|
333
|
+
const { t: i, locale: n } = V(), {
|
|
334
|
+
pages: m,
|
|
335
|
+
supportedLocales: s,
|
|
336
|
+
config: { defaultLocale: c },
|
|
337
|
+
resources: h
|
|
338
|
+
} = o, u = Object.values(m).find((b) => b?.slug === l), y = Object.values(h.pages || {}).find((b) => b.page.slug === l), p = P(
|
|
339
|
+
() => s?.some((b) => b.locale === n) ? n : void 0,
|
|
340
|
+
[n, s]
|
|
341
|
+
), f = J({
|
|
342
342
|
page: null
|
|
343
343
|
});
|
|
344
344
|
T(() => {
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
}, [u,
|
|
345
|
+
const b = u || y?.page || null;
|
|
346
|
+
b ? f.page = O(b) : f.page = null;
|
|
347
|
+
}, [u, y]);
|
|
348
348
|
const v = Z(void 0);
|
|
349
349
|
if (T(() => {
|
|
350
|
-
Q(r, v.current) || r &&
|
|
351
|
-
}, [{}]), !u && !
|
|
350
|
+
Q(r, v.current) || r && f.page && (W(f.page, o, p, r), v.current = O(r));
|
|
351
|
+
}, [{}]), !u && !y?.page)
|
|
352
352
|
return /* @__PURE__ */ e(
|
|
353
|
-
|
|
353
|
+
w,
|
|
354
354
|
{
|
|
355
355
|
sx: {
|
|
356
356
|
width: "100vw",
|
|
@@ -359,76 +359,76 @@ function kt({
|
|
|
359
359
|
justifyContent: "center",
|
|
360
360
|
alignItems: "center"
|
|
361
361
|
},
|
|
362
|
-
children: /* @__PURE__ */ e(G, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ne, { href: "/", children:
|
|
362
|
+
children: /* @__PURE__ */ e(G, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ne, { href: "/", children: i("common.back") }) })
|
|
363
363
|
}
|
|
364
364
|
);
|
|
365
|
-
const
|
|
366
|
-
return
|
|
365
|
+
const S = U(o);
|
|
366
|
+
return f.page ? /* @__PURE__ */ e(
|
|
367
367
|
E,
|
|
368
368
|
{
|
|
369
369
|
mode: t,
|
|
370
|
-
components:
|
|
371
|
-
page:
|
|
372
|
-
locale:
|
|
373
|
-
defaultLocale:
|
|
370
|
+
components: S,
|
|
371
|
+
page: f.page,
|
|
372
|
+
locale: p,
|
|
373
|
+
defaultLocale: c
|
|
374
374
|
}
|
|
375
375
|
) : null;
|
|
376
376
|
}
|
|
377
377
|
function E({
|
|
378
378
|
mode: t,
|
|
379
379
|
components: o,
|
|
380
|
-
page:
|
|
380
|
+
page: l,
|
|
381
381
|
locale: r,
|
|
382
|
-
defaultLocale:
|
|
382
|
+
defaultLocale: i,
|
|
383
383
|
headerAddons: n
|
|
384
384
|
}) {
|
|
385
|
-
const
|
|
386
|
-
() => (
|
|
387
|
-
let x = n?.(
|
|
385
|
+
const m = ue(), s = l.locales?.[r] ?? l.locales?.[i] ?? {}, c = s.title || window.blocklet?.appName, h = s.description || window.blocklet?.appDescription, u = ae(se(s.image), 540), { logo: y, brand: p, description: f, ...v } = ce(), S = P(
|
|
386
|
+
() => (g) => {
|
|
387
|
+
let x = n?.(g) ?? g;
|
|
388
388
|
return x = v.addons?.(x) ?? x, x;
|
|
389
389
|
},
|
|
390
390
|
[v.addons, n]
|
|
391
|
-
),
|
|
392
|
-
() =>
|
|
393
|
-
[
|
|
391
|
+
), b = P(
|
|
392
|
+
() => s.header?.translucent ? qe : oe,
|
|
393
|
+
[s.header?.translucent]
|
|
394
394
|
);
|
|
395
|
-
return /* @__PURE__ */ R(Re, { page:
|
|
395
|
+
return /* @__PURE__ */ R(Re, { page: l, defaultLocale: i, currentLocale: r, children: [
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
397
|
q,
|
|
398
398
|
{
|
|
399
399
|
styles: K`
|
|
400
400
|
body {
|
|
401
|
-
background-color: ${
|
|
402
|
-
!
|
|
401
|
+
background-color: ${m(
|
|
402
|
+
!s.backgroundColor || s.backgroundColor === "transparent" ? "background.default" : s.backgroundColor
|
|
403
403
|
)} !important;
|
|
404
404
|
}
|
|
405
405
|
`
|
|
406
406
|
}
|
|
407
407
|
),
|
|
408
408
|
/* @__PURE__ */ e(
|
|
409
|
-
|
|
409
|
+
b,
|
|
410
410
|
{
|
|
411
|
-
hideNavMenu: !!
|
|
412
|
-
translucentTextColor:
|
|
413
|
-
...
|
|
414
|
-
...
|
|
415
|
-
...
|
|
416
|
-
className: me(
|
|
411
|
+
hideNavMenu: !!s.header?.hideNavMenus,
|
|
412
|
+
translucentTextColor: s.header?.translucentTextColor,
|
|
413
|
+
...y ? { logo: y } : {},
|
|
414
|
+
...p ? { brand: p } : {},
|
|
415
|
+
...f ? { description: f } : {},
|
|
416
|
+
className: me(s.header?.sticky && "sticky", "page-header"),
|
|
417
417
|
maxWidth: !1,
|
|
418
|
-
addons:
|
|
418
|
+
addons: S
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
421
|
/* @__PURE__ */ e(Ie, {}),
|
|
422
|
-
/* @__PURE__ */ R(
|
|
423
|
-
/* @__PURE__ */ e("title", { children:
|
|
424
|
-
/* @__PURE__ */ e("meta", { name: "og:title", content:
|
|
425
|
-
/* @__PURE__ */ e("meta", { name: "og:description", content:
|
|
422
|
+
/* @__PURE__ */ R(we, { children: [
|
|
423
|
+
/* @__PURE__ */ e("title", { children: c }),
|
|
424
|
+
/* @__PURE__ */ e("meta", { name: "og:title", content: c }),
|
|
425
|
+
/* @__PURE__ */ e("meta", { name: "og:description", content: h }),
|
|
426
426
|
/* @__PURE__ */ e("meta", { name: "og:image", content: u }),
|
|
427
427
|
/* @__PURE__ */ e("meta", { name: "twitter:image:src", content: u }),
|
|
428
428
|
/* @__PURE__ */ e("meta", { name: "twitter:image", content: u }),
|
|
429
|
-
/* @__PURE__ */ e("meta", { property: "twitter:description", content:
|
|
430
|
-
/* @__PURE__ */ e("meta", { property: "twitter:title", content:
|
|
431
|
-
/* @__PURE__ */ e("meta", { name: "description", content:
|
|
429
|
+
/* @__PURE__ */ e("meta", { property: "twitter:description", content: h }),
|
|
430
|
+
/* @__PURE__ */ e("meta", { property: "twitter:title", content: c }),
|
|
431
|
+
/* @__PURE__ */ e("meta", { name: "description", content: h })
|
|
432
432
|
] }),
|
|
433
433
|
/* @__PURE__ */ e(
|
|
434
434
|
fe,
|
|
@@ -441,14 +441,14 @@ function E({
|
|
|
441
441
|
pt: "0 !important"
|
|
442
442
|
}
|
|
443
443
|
},
|
|
444
|
-
children:
|
|
445
|
-
const x =
|
|
444
|
+
children: l.sectionIds.map((g) => {
|
|
445
|
+
const x = l.sections[g];
|
|
446
446
|
if (!x || x.visibility === "hidden") return null;
|
|
447
|
-
const I =
|
|
448
|
-
return /* @__PURE__ */ e(
|
|
447
|
+
const I = l.dataSource?.[g]?.[r], A = l.dataSource?.[g]?.[i] ?? {};
|
|
448
|
+
return /* @__PURE__ */ e(w, { sx: { position: "relative" }, children: /* @__PURE__ */ e(
|
|
449
449
|
Oe,
|
|
450
450
|
{
|
|
451
|
-
id:
|
|
451
|
+
id: g,
|
|
452
452
|
type: x.component,
|
|
453
453
|
mode: t,
|
|
454
454
|
section: x,
|
|
@@ -458,21 +458,21 @@ function E({
|
|
|
458
458
|
dev: t === "draft" ? {
|
|
459
459
|
mode: t,
|
|
460
460
|
components: o,
|
|
461
|
-
defaultLocale:
|
|
461
|
+
defaultLocale: i
|
|
462
462
|
} : {
|
|
463
463
|
mode: t,
|
|
464
|
-
defaultLocale:
|
|
464
|
+
defaultLocale: i
|
|
465
465
|
// 用于 fallback 的 locale
|
|
466
466
|
}
|
|
467
467
|
},
|
|
468
|
-
page:
|
|
468
|
+
page: l
|
|
469
469
|
},
|
|
470
|
-
|
|
471
|
-
);
|
|
470
|
+
g
|
|
471
|
+
) }, g);
|
|
472
472
|
})
|
|
473
473
|
}
|
|
474
474
|
),
|
|
475
|
-
!
|
|
475
|
+
!s.footer?.hidden && /* @__PURE__ */ e(Fe, {})
|
|
476
476
|
] });
|
|
477
477
|
}
|
|
478
478
|
const oe = M(de)`
|
|
@@ -482,51 +482,51 @@ const oe = M(de)`
|
|
|
482
482
|
}
|
|
483
483
|
`;
|
|
484
484
|
function We({ logo: t }) {
|
|
485
|
-
const [o,
|
|
485
|
+
const [o, l] = ke(), r = be((n) => n.breakpoints.down("sm")), { value: i } = te(() => {
|
|
486
486
|
const n = new URL(
|
|
487
487
|
r ? window?.blocklet?.appLogo || "/.well-known/service/blocklet/logo" : window?.blocklet?.appLogoRect || "/.well-known/service/blocklet/logo-rect",
|
|
488
488
|
window.location.origin
|
|
489
489
|
);
|
|
490
490
|
n.searchParams.delete("imageFilter"), n.searchParams.delete("f");
|
|
491
|
-
const
|
|
492
|
-
return new Promise((
|
|
493
|
-
fetch(
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}),
|
|
491
|
+
const m = n.toString();
|
|
492
|
+
return new Promise((s) => {
|
|
493
|
+
fetch(m).then((c) => {
|
|
494
|
+
c.headers.get("content-type")?.includes("svg") && c.text().then((u) => {
|
|
495
|
+
l(u), s(null);
|
|
496
|
+
}), s(c.url);
|
|
497
497
|
});
|
|
498
498
|
});
|
|
499
499
|
}, [r]);
|
|
500
500
|
if (t)
|
|
501
501
|
return t;
|
|
502
502
|
if (o)
|
|
503
|
-
return /* @__PURE__ */ e(
|
|
504
|
-
if (
|
|
505
|
-
const n = new URL(
|
|
503
|
+
return /* @__PURE__ */ e(w, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: ve.sanitize(o) } });
|
|
504
|
+
if (i) {
|
|
505
|
+
const n = new URL(i);
|
|
506
506
|
n.searchParams.set("imageFilter", "convert"), n.searchParams.set("f", "png"), n.searchParams.set("h", "80");
|
|
507
|
-
const
|
|
508
|
-
return /* @__PURE__ */ e("img", { src:
|
|
507
|
+
const m = n.toString();
|
|
508
|
+
return /* @__PURE__ */ e("img", { src: m, alt: "logo" });
|
|
509
509
|
}
|
|
510
510
|
return null;
|
|
511
511
|
}
|
|
512
512
|
function qe({
|
|
513
513
|
logo: t,
|
|
514
514
|
translucentTextColor: o,
|
|
515
|
-
...
|
|
515
|
+
...l
|
|
516
516
|
}) {
|
|
517
|
-
const
|
|
518
|
-
let p = Math.min(
|
|
519
|
-
return p > 0.1 ? (p = Math.max(p, 0.6),
|
|
517
|
+
const i = ye(document.getElementById("app"), (p) => p.top < 1200), n = Y(), m = n.palette.mode === "dark", s = Math.min(i?.top ?? 0, 800), c = P(() => {
|
|
518
|
+
let p = Math.min(s / 800, 1), f = "";
|
|
519
|
+
return p > 0.1 ? (p = Math.max(p, 0.6), f = $(n.palette.text.primary, p)) : f = o || "#EEEEEE", {
|
|
520
520
|
backgroundOpacity: p,
|
|
521
|
-
textColor:
|
|
521
|
+
textColor: f,
|
|
522
522
|
isReversed: p < 0.7
|
|
523
523
|
};
|
|
524
|
-
}, [
|
|
524
|
+
}, [s, 800, n.palette.text.primary, o]), { backgroundOpacity: h, textColor: u, isReversed: y } = c;
|
|
525
525
|
return /* @__PURE__ */ e(
|
|
526
526
|
oe,
|
|
527
527
|
{
|
|
528
528
|
logo: /* @__PURE__ */ e(We, { logo: t }),
|
|
529
|
-
...
|
|
529
|
+
...l,
|
|
530
530
|
sx: {
|
|
531
531
|
// 基础布局和定位
|
|
532
532
|
position: "fixed !important",
|
|
@@ -548,8 +548,8 @@ function qe({
|
|
|
548
548
|
zIndex: -1,
|
|
549
549
|
// 置于内容下方
|
|
550
550
|
// 背景样式(颜色和模糊)是固定的
|
|
551
|
-
backgroundColor:
|
|
552
|
-
backdropFilter:
|
|
551
|
+
backgroundColor: $(n.palette.background.default, h),
|
|
552
|
+
backdropFilter: h >= 0.6 ? "blur(10px)" : "blur(0px)",
|
|
553
553
|
// **性能关键**: 只对 opacity 进行动画
|
|
554
554
|
// opacity: backgroundOpacity,
|
|
555
555
|
// 让 CSS 平滑地处理透明度变化
|
|
@@ -561,11 +561,11 @@ function qe({
|
|
|
561
561
|
transition: "color 0.3s ease-in-out",
|
|
562
562
|
// 覆盖子组件的颜色,使其继承父级的 `color`
|
|
563
563
|
".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button": {
|
|
564
|
-
color: `${
|
|
564
|
+
color: `${u} !important`
|
|
565
565
|
// 使用 inherit 来同步颜色
|
|
566
566
|
},
|
|
567
567
|
".header-logo": {
|
|
568
|
-
color: `${
|
|
568
|
+
color: `${u} !important`
|
|
569
569
|
},
|
|
570
570
|
"& .navmenu--horizontal": {
|
|
571
571
|
bgcolor: "transparent !important"
|
|
@@ -574,7 +574,8 @@ function qe({
|
|
|
574
574
|
// filter 也是一个较昂贵的属性,但其影响远小于背景色的重绘
|
|
575
575
|
// 这里的逻辑保持不变,但可以考虑是否有更优的方案(如提供两个颜色的 Logo)
|
|
576
576
|
".header-logo > div": {
|
|
577
|
-
|
|
577
|
+
// 暗黑模式不做反转
|
|
578
|
+
filter: m ? "unset" : `invert(${y ? 1 : 0})`,
|
|
578
579
|
transition: "filter 0.3s ease-in-out"
|
|
579
580
|
}
|
|
580
581
|
}
|
|
@@ -583,12 +584,12 @@ function qe({
|
|
|
583
584
|
}
|
|
584
585
|
const ne = M(he)``;
|
|
585
586
|
export {
|
|
586
|
-
|
|
587
|
-
|
|
587
|
+
kt as H,
|
|
588
|
+
De as L,
|
|
588
589
|
F as P,
|
|
589
590
|
qe as T,
|
|
590
591
|
ze as a,
|
|
591
592
|
H as b,
|
|
592
|
-
|
|
593
|
+
wt as c,
|
|
593
594
|
E as d
|
|
594
595
|
};
|