@blocklet/pages-kit-inner-components 0.6.34 → 0.6.36
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-C6w76oIG.js +39 -0
- package/lib/cjs/chunks/{index-CaivrAu8.js → index-DDXPTdvW.js} +18 -18
- package/lib/cjs/chunks/{publish-button-CRQmmzK4.js → publish-button-DjVJAqts.js} +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/es/add-component.js +1 -1
- package/lib/es/chunks/{home-DK0hbr0h.js → home-CCiZOODL.js} +169 -144
- package/lib/es/chunks/{index-DOEiNkBX.js → index-B6GyWmgC.js} +2 -1
- package/lib/es/chunks/{publish-button-C6Ixf5NB.js → publish-button-BTcQPSRb.js} +2 -2
- package/lib/es/home.js +2 -2
- package/package.json +3 -3
- package/lib/cjs/chunks/home-2n7dbQz5.js +0 -39
|
@@ -1,39 +1,64 @@
|
|
|
1
1
|
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-DRjnlQY_.js";
|
|
3
|
-
import { useLocaleContext as
|
|
4
|
-
import
|
|
5
|
-
import { styled as
|
|
3
|
+
import { useLocaleContext as W } from "@arcblock/ux/lib/Locale/context";
|
|
4
|
+
import V from "@arcblock/ux/lib/Result";
|
|
5
|
+
import { styled as E, useTheme as le } from "@arcblock/ux/lib/Theme";
|
|
6
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
|
-
import { setPageDataSource as
|
|
8
|
+
import { setPageDataSource as G } 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 w, CircularProgress as ge, useTheme as Y, Button as he, Stack as fe, alpha as
|
|
13
|
+
import { Box as w, CircularProgress as ge, useTheme as Y, Button as he, Stack as fe, alpha as D, useMediaQuery as be } from "@mui/material";
|
|
14
14
|
import { useReactive as J, useScroll as ye } from "ahooks";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
15
|
+
import xe from "isomorphic-dompurify";
|
|
16
|
+
import M from "lodash/cloneDeep";
|
|
17
|
+
import ve from "lodash/isEmpty";
|
|
18
18
|
import Q from "lodash/isEqual";
|
|
19
19
|
import { useEffect as T, lazy as X, useMemo as P, useRef as Z, Suspense as Pe, useState as ke } from "react";
|
|
20
20
|
import { Helmet as we } from "react-helmet";
|
|
21
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
23
|
import { joinURL as k } from "ufo";
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
24
|
+
import { u as Te, S as je, P as Re, a as Me, B as Oe, g as Ee } from "./index-B6GyWmgC.js";
|
|
25
|
+
import Ae from "@blocklet/ui-react/lib/Footer";
|
|
26
26
|
import "webfontloader";
|
|
27
|
-
import { u as
|
|
28
|
-
const
|
|
27
|
+
import { u as Be, a as Le } from "./session-C72Dq8zg.js";
|
|
28
|
+
const _e = E(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 l = le();
|
|
36
|
-
return /* @__PURE__ */ e(
|
|
35
|
+
const l = le(), { getPageMetaStyle: r } = Te(), a = r();
|
|
36
|
+
return /* @__PURE__ */ e(
|
|
37
|
+
_e,
|
|
38
|
+
{
|
|
39
|
+
sx: {
|
|
40
|
+
".blocklet__footer .MuiContainer-root": {
|
|
41
|
+
...a.maxWidth && {
|
|
42
|
+
maxWidth: a.maxWidth
|
|
43
|
+
},
|
|
44
|
+
...a.px && {
|
|
45
|
+
px: a.px
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
children: /* @__PURE__ */ e(
|
|
50
|
+
Ae,
|
|
51
|
+
{
|
|
52
|
+
...o,
|
|
53
|
+
meta: t,
|
|
54
|
+
theme: l || {},
|
|
55
|
+
sx: {
|
|
56
|
+
// ...getPageMetaStyle(),
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
37
62
|
}
|
|
38
63
|
function $e(t) {
|
|
39
64
|
return /* @__PURE__ */ e(
|
|
@@ -55,9 +80,9 @@ function $e(t) {
|
|
|
55
80
|
);
|
|
56
81
|
}
|
|
57
82
|
function De(t) {
|
|
58
|
-
return /* @__PURE__ */ e(
|
|
83
|
+
return /* @__PURE__ */ e(Ne, { ...t });
|
|
59
84
|
}
|
|
60
|
-
const
|
|
85
|
+
const Ne = E(w)`
|
|
61
86
|
position: fixed;
|
|
62
87
|
left: 0;
|
|
63
88
|
top: 0;
|
|
@@ -68,29 +93,29 @@ const _e = M(w)`
|
|
|
68
93
|
opacity: 0.7;
|
|
69
94
|
transform: translateX(-23%) translateY(70%) rotate(-45deg);
|
|
70
95
|
pointer-events: none;
|
|
71
|
-
`,
|
|
96
|
+
`, He = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
72
97
|
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;
|
|
73
|
-
function
|
|
98
|
+
function ze({
|
|
74
99
|
titleFontFamily: t,
|
|
75
100
|
descriptionFontFamily: o
|
|
76
101
|
}) {
|
|
77
102
|
const r = Y()?.typography?.fontFamily;
|
|
78
103
|
T(() => {
|
|
79
104
|
}, [t, o]);
|
|
80
|
-
const
|
|
105
|
+
const a = `${r}, ${He}`;
|
|
81
106
|
return /* @__PURE__ */ e(
|
|
82
107
|
q,
|
|
83
108
|
{
|
|
84
109
|
styles: K`
|
|
85
110
|
#app {
|
|
86
|
-
font-family: ${
|
|
111
|
+
font-family: ${a};
|
|
87
112
|
|
|
88
113
|
.page-kit-section__title {
|
|
89
|
-
font-family: ${
|
|
114
|
+
font-family: ${a};
|
|
90
115
|
}
|
|
91
116
|
|
|
92
117
|
.page-kit-section__description {
|
|
93
|
-
font-family: ${
|
|
118
|
+
font-family: ${a};
|
|
94
119
|
}
|
|
95
120
|
}
|
|
96
121
|
`
|
|
@@ -100,85 +125,85 @@ function He({
|
|
|
100
125
|
function N(t) {
|
|
101
126
|
return t != null;
|
|
102
127
|
}
|
|
103
|
-
function
|
|
104
|
-
const [t] = ee(), { session: o } =
|
|
128
|
+
function wt() {
|
|
129
|
+
const [t] = ee(), { session: o } = Be(), l = Le("owner", "admin", "pagesEditor", "member"), r = P(() => {
|
|
105
130
|
const n = t.get("mode");
|
|
106
|
-
return
|
|
107
|
-
}, [t]),
|
|
108
|
-
return
|
|
131
|
+
return je.includes(n) ? n : "production";
|
|
132
|
+
}, [t]), a = r === "production" ? r : o.user ? l ? r : "production" : null;
|
|
133
|
+
return a ? /* @__PURE__ */ e(Ue, { mode: a }) : null;
|
|
109
134
|
}
|
|
110
|
-
function
|
|
135
|
+
function Ue({ mode: t }) {
|
|
111
136
|
if (t !== "draft") {
|
|
112
137
|
const o = window.__PAGE_STATE__;
|
|
113
|
-
return o ? /* @__PURE__ */ e(
|
|
138
|
+
return o ? /* @__PURE__ */ e(_, { mode: t, state: o }) : /* @__PURE__ */ e(Ge, { mode: t, children: ({ state: l }) => /* @__PURE__ */ e(_, { mode: t, state: l }) });
|
|
114
139
|
}
|
|
115
|
-
return /* @__PURE__ */ e(Ve, { children: ({ state: o }) => /* @__PURE__ */ e(
|
|
140
|
+
return /* @__PURE__ */ e(Ve, { children: ({ state: o }) => /* @__PURE__ */ e(_, { mode: t, state: o }) });
|
|
116
141
|
}
|
|
117
|
-
const
|
|
142
|
+
const We = X(() => import("./publish-button-BTcQPSRb.js")), Ve = X(() => import("./draft-data-mNAXJMtq.js"));
|
|
118
143
|
function Ge({
|
|
119
144
|
mode: t,
|
|
120
145
|
children: o
|
|
121
146
|
}) {
|
|
122
|
-
const r = document.querySelector('meta[property="pages:version"]')?.content,
|
|
147
|
+
const r = document.querySelector('meta[property="pages:version"]')?.content, a = z(), n = P(() => {
|
|
123
148
|
if (r === "{{pagesPublishedAt}}") {
|
|
124
|
-
const c = localStorage.getItem(ie(
|
|
149
|
+
const c = localStorage.getItem(ie(a ?? ""));
|
|
125
150
|
return Number(c) ? Number(c) : (/* @__PURE__ */ new Date()).getTime();
|
|
126
151
|
}
|
|
127
152
|
return Number(r);
|
|
128
|
-
}, [r]), { loading: m, value:
|
|
129
|
-
return m ? /* @__PURE__ */ e($e, {}) :
|
|
153
|
+
}, [r]), { loading: m, value: i } = te(() => Ee({ mode: t, version: n }), [t, n]);
|
|
154
|
+
return m ? /* @__PURE__ */ e($e, {}) : i ? o({ state: i }) : null;
|
|
130
155
|
}
|
|
131
|
-
function
|
|
132
|
-
const { t: l, locale: r } =
|
|
156
|
+
function _({ mode: t, state: o }) {
|
|
157
|
+
const { t: l, locale: r } = W(), [a] = ee(), n = z(), m = re(), i = a.get("hiddenBadge") === "true", c = a.get("showPublish") === "true", {
|
|
133
158
|
pageIds: h,
|
|
134
159
|
pages: u,
|
|
135
160
|
routeIds: y,
|
|
136
161
|
routes: p,
|
|
137
162
|
supportedLocales: f,
|
|
138
|
-
config: { defaultLocale:
|
|
163
|
+
config: { defaultLocale: x },
|
|
139
164
|
resources: S
|
|
140
165
|
} = o, b = U(o), g = P(
|
|
141
166
|
() => f?.some((d) => d.locale === r) ? r : void 0,
|
|
142
167
|
[r, f]
|
|
143
168
|
), 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
|
|
145
|
-
return
|
|
146
|
-
id:
|
|
147
|
-
path: k("/", m || n || "",
|
|
169
|
+
const s = u[d];
|
|
170
|
+
return s && {
|
|
171
|
+
id: s.id,
|
|
172
|
+
path: k("/", m || n || "", s.slug)
|
|
148
173
|
};
|
|
149
174
|
}).filter(N) : y.map((d) => {
|
|
150
|
-
const
|
|
151
|
-
return
|
|
152
|
-
id:
|
|
153
|
-
path: k("/", m || n || "",
|
|
175
|
+
const s = p[d];
|
|
176
|
+
return s ? {
|
|
177
|
+
id: s.id,
|
|
178
|
+
path: k("/", m || n || "", s.path, `?mode=${t}&showPublish=true`)
|
|
154
179
|
} : null;
|
|
155
180
|
}).filter(N), [h, u, t, p, y, n, m]), j = ([...d]) => (t !== "production" && c && d.unshift(
|
|
156
|
-
/* @__PURE__ */ e(Pe, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(
|
|
181
|
+
/* @__PURE__ */ e(Pe, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(We, { ref: { current: null }, mode: "production", state: o }) })
|
|
157
182
|
), d);
|
|
158
|
-
return /* @__PURE__ */ R(
|
|
183
|
+
return /* @__PURE__ */ R(Re, { value: { pages: A }, children: [
|
|
159
184
|
/* @__PURE__ */ R(Se, { children: [
|
|
160
185
|
I && /* @__PURE__ */ e(C, { index: !0, element: /* @__PURE__ */ e(Ce, { to: k("/", g || "", I.slug) }) }),
|
|
161
186
|
y?.map((d) => {
|
|
162
|
-
const
|
|
163
|
-
if (!
|
|
164
|
-
const B = u[
|
|
187
|
+
const s = p?.[d];
|
|
188
|
+
if (!s || !s.displayTemplateId) return null;
|
|
189
|
+
const B = u[s.displayTemplateId];
|
|
165
190
|
if (!B) return null;
|
|
166
191
|
let L = [];
|
|
167
|
-
return
|
|
168
|
-
basePath:
|
|
169
|
-
params:
|
|
170
|
-
routeId:
|
|
171
|
-
paramsOptions:
|
|
192
|
+
return s.params && s.params.length > 0 && (L = pe({
|
|
193
|
+
basePath: s.path,
|
|
194
|
+
params: s.params,
|
|
195
|
+
routeId: s.id,
|
|
196
|
+
paramsOptions: s.paramsOptions,
|
|
172
197
|
currentIndex: 0,
|
|
173
198
|
currentParams: [],
|
|
174
199
|
currentOptionIds: [],
|
|
175
200
|
result: []
|
|
176
|
-
})?.map((
|
|
177
|
-
const
|
|
201
|
+
})?.map((F) => {
|
|
202
|
+
const $ = F.paramOptionIds.join("-");
|
|
178
203
|
return /* @__PURE__ */ e(
|
|
179
204
|
C,
|
|
180
205
|
{
|
|
181
|
-
path: k(":projectIdOrSlug?",
|
|
206
|
+
path: k(":projectIdOrSlug?", F.path),
|
|
182
207
|
element: /* @__PURE__ */ e(
|
|
183
208
|
H,
|
|
184
209
|
{
|
|
@@ -186,20 +211,20 @@ function F({ mode: t, state: o }) {
|
|
|
186
211
|
components: b,
|
|
187
212
|
page: B,
|
|
188
213
|
locale: g,
|
|
189
|
-
defaultLocale:
|
|
214
|
+
defaultLocale: x,
|
|
190
215
|
headerAddons: j,
|
|
191
216
|
state: o,
|
|
192
|
-
pageData:
|
|
217
|
+
pageData: s.dataSource?.pathDataMappings?.[$]?.dataCache?.[g || x || "en"]
|
|
193
218
|
}
|
|
194
219
|
)
|
|
195
220
|
},
|
|
196
|
-
|
|
221
|
+
$
|
|
197
222
|
);
|
|
198
223
|
})), L.push(
|
|
199
224
|
/* @__PURE__ */ e(
|
|
200
225
|
C,
|
|
201
226
|
{
|
|
202
|
-
path: k(":projectIdOrSlug?",
|
|
227
|
+
path: k(":projectIdOrSlug?", s.path),
|
|
203
228
|
element: /* @__PURE__ */ e(
|
|
204
229
|
H,
|
|
205
230
|
{
|
|
@@ -207,55 +232,55 @@ function F({ mode: t, state: o }) {
|
|
|
207
232
|
components: b,
|
|
208
233
|
page: B,
|
|
209
234
|
locale: g,
|
|
210
|
-
defaultLocale:
|
|
235
|
+
defaultLocale: x,
|
|
211
236
|
headerAddons: j,
|
|
212
237
|
state: o,
|
|
213
|
-
pageData:
|
|
238
|
+
pageData: s.dataSource?.pathDataMappings?.[s.id]?.dataCache?.[g || x || "en"]
|
|
214
239
|
}
|
|
215
240
|
)
|
|
216
241
|
},
|
|
217
|
-
|
|
242
|
+
s.id
|
|
218
243
|
)
|
|
219
244
|
), L;
|
|
220
245
|
}),
|
|
221
246
|
h.map((d) => {
|
|
222
|
-
const
|
|
223
|
-
return
|
|
247
|
+
const s = u[d];
|
|
248
|
+
return s ? /* @__PURE__ */ e(
|
|
224
249
|
C,
|
|
225
250
|
{
|
|
226
|
-
path: k(":projectIdOrSlug?",
|
|
251
|
+
path: k(":projectIdOrSlug?", s.slug),
|
|
227
252
|
element: /* @__PURE__ */ e(
|
|
228
|
-
|
|
253
|
+
O,
|
|
229
254
|
{
|
|
230
255
|
mode: t,
|
|
231
256
|
components: b,
|
|
232
|
-
page:
|
|
257
|
+
page: s,
|
|
233
258
|
locale: g,
|
|
234
|
-
defaultLocale:
|
|
259
|
+
defaultLocale: x,
|
|
235
260
|
headerAddons: j
|
|
236
261
|
}
|
|
237
262
|
)
|
|
238
263
|
},
|
|
239
|
-
|
|
264
|
+
s.id
|
|
240
265
|
) : null;
|
|
241
266
|
}),
|
|
242
|
-
S.pages && Object.values(S.pages).map(({ blockletId: d, page:
|
|
267
|
+
S.pages && Object.values(S.pages).map(({ blockletId: d, page: s }) => /* @__PURE__ */ e(
|
|
243
268
|
C,
|
|
244
269
|
{
|
|
245
|
-
path: k("/", `@${d}`,
|
|
270
|
+
path: k("/", `@${d}`, s.slug),
|
|
246
271
|
element: /* @__PURE__ */ e(
|
|
247
|
-
|
|
272
|
+
O,
|
|
248
273
|
{
|
|
249
274
|
mode: t,
|
|
250
275
|
components: b,
|
|
251
|
-
page:
|
|
276
|
+
page: s,
|
|
252
277
|
locale: g,
|
|
253
|
-
defaultLocale:
|
|
278
|
+
defaultLocale: x,
|
|
254
279
|
headerAddons: j
|
|
255
280
|
}
|
|
256
281
|
)
|
|
257
282
|
},
|
|
258
|
-
|
|
283
|
+
s.id
|
|
259
284
|
)),
|
|
260
285
|
/* @__PURE__ */ e(
|
|
261
286
|
C,
|
|
@@ -272,7 +297,7 @@ function F({ mode: t, state: o }) {
|
|
|
272
297
|
alignItems: "center"
|
|
273
298
|
},
|
|
274
299
|
children: /* @__PURE__ */ e(
|
|
275
|
-
|
|
300
|
+
V,
|
|
276
301
|
{
|
|
277
302
|
status: 404,
|
|
278
303
|
extra: /* @__PURE__ */ e(ne, { href: "/", children: l("common.back") }),
|
|
@@ -288,8 +313,8 @@ function F({ mode: t, state: o }) {
|
|
|
288
313
|
}
|
|
289
314
|
)
|
|
290
315
|
] }),
|
|
291
|
-
t !== "production" && !
|
|
292
|
-
/* @__PURE__ */ e(
|
|
316
|
+
t !== "production" && !i && /* @__PURE__ */ e(De, { sx: { bgcolor: "info.light" }, children: t }),
|
|
317
|
+
/* @__PURE__ */ e(ze, {})
|
|
293
318
|
] });
|
|
294
319
|
}
|
|
295
320
|
function H({
|
|
@@ -297,57 +322,57 @@ function H({
|
|
|
297
322
|
pageData: o,
|
|
298
323
|
components: l,
|
|
299
324
|
page: r,
|
|
300
|
-
locale:
|
|
325
|
+
locale: a,
|
|
301
326
|
defaultLocale: n,
|
|
302
327
|
headerAddons: m,
|
|
303
|
-
state:
|
|
328
|
+
state: i
|
|
304
329
|
}) {
|
|
305
330
|
const c = J({
|
|
306
331
|
page: null
|
|
307
332
|
});
|
|
308
333
|
T(() => {
|
|
309
334
|
const u = r || null;
|
|
310
|
-
u ? c.page =
|
|
335
|
+
u ? c.page = M(u) : c.page = null;
|
|
311
336
|
}, [r, JSON.stringify(r), c]);
|
|
312
337
|
const h = Z(void 0);
|
|
313
338
|
return T(() => {
|
|
314
|
-
Q(o, h.current) || o && c.page && (
|
|
315
|
-
}, [c.page, o,
|
|
316
|
-
|
|
339
|
+
Q(o, h.current) || o && c.page && (G(c.page, i, a, o), h.current = M(o));
|
|
340
|
+
}, [c.page, o, a, i]), c.page ? /* @__PURE__ */ e(
|
|
341
|
+
O,
|
|
317
342
|
{
|
|
318
343
|
mode: t,
|
|
319
344
|
components: l,
|
|
320
345
|
page: c.page,
|
|
321
|
-
locale:
|
|
346
|
+
locale: a,
|
|
322
347
|
defaultLocale: n,
|
|
323
348
|
headerAddons: m
|
|
324
349
|
}
|
|
325
350
|
) : null;
|
|
326
351
|
}
|
|
327
|
-
function
|
|
352
|
+
function St({
|
|
328
353
|
mode: t,
|
|
329
354
|
state: o,
|
|
330
355
|
path: l,
|
|
331
356
|
pageData: r
|
|
332
357
|
}) {
|
|
333
|
-
const { t:
|
|
358
|
+
const { t: a, locale: n } = W(), {
|
|
334
359
|
pages: m,
|
|
335
|
-
supportedLocales:
|
|
360
|
+
supportedLocales: i,
|
|
336
361
|
config: { defaultLocale: c },
|
|
337
362
|
resources: h
|
|
338
363
|
} = o, u = Object.values(m).find((b) => b?.slug === l), y = Object.values(h.pages || {}).find((b) => b.page.slug === l), p = P(
|
|
339
|
-
() =>
|
|
340
|
-
[n,
|
|
364
|
+
() => i?.some((b) => b.locale === n) ? n : void 0,
|
|
365
|
+
[n, i]
|
|
341
366
|
), f = J({
|
|
342
367
|
page: null
|
|
343
368
|
});
|
|
344
369
|
T(() => {
|
|
345
370
|
const b = u || y?.page || null;
|
|
346
|
-
b ? f.page =
|
|
371
|
+
b ? f.page = M(b) : f.page = null;
|
|
347
372
|
}, [u, y]);
|
|
348
|
-
const
|
|
373
|
+
const x = Z(void 0);
|
|
349
374
|
if (T(() => {
|
|
350
|
-
Q(r,
|
|
375
|
+
Q(r, x.current) || r && f.page && (G(f.page, o, p, r), x.current = M(r));
|
|
351
376
|
}, [{}]), !u && !y?.page)
|
|
352
377
|
return /* @__PURE__ */ e(
|
|
353
378
|
w,
|
|
@@ -359,12 +384,12 @@ function wt({
|
|
|
359
384
|
justifyContent: "center",
|
|
360
385
|
alignItems: "center"
|
|
361
386
|
},
|
|
362
|
-
children: /* @__PURE__ */ e(
|
|
387
|
+
children: /* @__PURE__ */ e(V, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ne, { href: "/", children: a("common.back") }) })
|
|
363
388
|
}
|
|
364
389
|
);
|
|
365
390
|
const S = U(o);
|
|
366
391
|
return f.page ? /* @__PURE__ */ e(
|
|
367
|
-
|
|
392
|
+
O,
|
|
368
393
|
{
|
|
369
394
|
mode: t,
|
|
370
395
|
components: S,
|
|
@@ -374,32 +399,32 @@ function wt({
|
|
|
374
399
|
}
|
|
375
400
|
) : null;
|
|
376
401
|
}
|
|
377
|
-
function
|
|
402
|
+
function O({
|
|
378
403
|
mode: t,
|
|
379
404
|
components: o,
|
|
380
405
|
page: l,
|
|
381
406
|
locale: r,
|
|
382
|
-
defaultLocale:
|
|
407
|
+
defaultLocale: a,
|
|
383
408
|
headerAddons: n
|
|
384
409
|
}) {
|
|
385
|
-
const m = ue(),
|
|
410
|
+
const m = ue(), i = l.locales?.[r] ?? l.locales?.[a] ?? {}, c = i.title || window.blocklet?.appName, h = i.description || window.blocklet?.appDescription, u = ae(se(i.image), 540), { logo: y, brand: p, description: f, ...x } = ce(), S = P(
|
|
386
411
|
() => (g) => {
|
|
387
|
-
let
|
|
388
|
-
return
|
|
412
|
+
let v = n?.(g) ?? g;
|
|
413
|
+
return v = x.addons?.(v) ?? v, v;
|
|
389
414
|
},
|
|
390
|
-
[
|
|
415
|
+
[x.addons, n]
|
|
391
416
|
), b = P(
|
|
392
|
-
() =>
|
|
393
|
-
[
|
|
417
|
+
() => i.header?.translucent ? Ke : oe,
|
|
418
|
+
[i.header?.translucent]
|
|
394
419
|
);
|
|
395
|
-
return /* @__PURE__ */ R(
|
|
420
|
+
return /* @__PURE__ */ R(Me, { page: l, defaultLocale: a, currentLocale: r, children: [
|
|
396
421
|
/* @__PURE__ */ e(
|
|
397
422
|
q,
|
|
398
423
|
{
|
|
399
424
|
styles: K`
|
|
400
425
|
body {
|
|
401
426
|
background-color: ${m(
|
|
402
|
-
!
|
|
427
|
+
!i.backgroundColor || i.backgroundColor === "transparent" ? "background.default" : i.backgroundColor
|
|
403
428
|
)} !important;
|
|
404
429
|
}
|
|
405
430
|
`
|
|
@@ -408,12 +433,12 @@ function E({
|
|
|
408
433
|
/* @__PURE__ */ e(
|
|
409
434
|
b,
|
|
410
435
|
{
|
|
411
|
-
hideNavMenu: !!
|
|
412
|
-
translucentTextColor:
|
|
436
|
+
hideNavMenu: !!i.header?.hideNavMenus,
|
|
437
|
+
translucentTextColor: i.header?.translucentTextColor,
|
|
413
438
|
...y ? { logo: y } : {},
|
|
414
439
|
...p ? { brand: p } : {},
|
|
415
440
|
...f ? { description: f } : {},
|
|
416
|
-
className: me(
|
|
441
|
+
className: me(i.header?.sticky && "sticky", "page-header"),
|
|
417
442
|
maxWidth: !1,
|
|
418
443
|
addons: S
|
|
419
444
|
}
|
|
@@ -442,26 +467,26 @@ function E({
|
|
|
442
467
|
}
|
|
443
468
|
},
|
|
444
469
|
children: l.sectionIds.map((g) => {
|
|
445
|
-
const
|
|
446
|
-
if (!
|
|
447
|
-
const I = l.dataSource?.[g]?.[r], A = l.dataSource?.[g]?.[
|
|
470
|
+
const v = l.sections[g];
|
|
471
|
+
if (!v || v.visibility === "hidden") return null;
|
|
472
|
+
const I = l.dataSource?.[g]?.[r], A = l.dataSource?.[g]?.[a] ?? {};
|
|
448
473
|
return /* @__PURE__ */ e(w, { sx: { position: "relative" }, children: /* @__PURE__ */ e(
|
|
449
474
|
Oe,
|
|
450
475
|
{
|
|
451
476
|
id: g,
|
|
452
|
-
type:
|
|
477
|
+
type: v.component,
|
|
453
478
|
mode: t,
|
|
454
|
-
section:
|
|
479
|
+
section: v,
|
|
455
480
|
config: {
|
|
456
|
-
...
|
|
481
|
+
...ve(I) ? A : I,
|
|
457
482
|
locale: r,
|
|
458
483
|
dev: t === "draft" ? {
|
|
459
484
|
mode: t,
|
|
460
485
|
components: o,
|
|
461
|
-
defaultLocale:
|
|
486
|
+
defaultLocale: a
|
|
462
487
|
} : {
|
|
463
488
|
mode: t,
|
|
464
|
-
defaultLocale:
|
|
489
|
+
defaultLocale: a
|
|
465
490
|
// 用于 fallback 的 locale
|
|
466
491
|
}
|
|
467
492
|
},
|
|
@@ -472,60 +497,60 @@ function E({
|
|
|
472
497
|
})
|
|
473
498
|
}
|
|
474
499
|
),
|
|
475
|
-
!
|
|
500
|
+
!i.footer?.hidden && /* @__PURE__ */ e(Fe, {})
|
|
476
501
|
] });
|
|
477
502
|
}
|
|
478
|
-
const oe =
|
|
503
|
+
const oe = E(de)`
|
|
479
504
|
&.sticky {
|
|
480
505
|
position: sticky;
|
|
481
506
|
top: 0;
|
|
482
507
|
}
|
|
483
508
|
`;
|
|
484
|
-
function
|
|
485
|
-
const [o, l] = ke(), r = be((n) => n.breakpoints.down("sm")), { value:
|
|
509
|
+
function qe({ logo: t }) {
|
|
510
|
+
const [o, l] = ke(), r = be((n) => n.breakpoints.down("sm")), { value: a } = te(() => {
|
|
486
511
|
const n = new URL(
|
|
487
512
|
r ? window?.blocklet?.appLogo || "/.well-known/service/blocklet/logo" : window?.blocklet?.appLogoRect || "/.well-known/service/blocklet/logo-rect",
|
|
488
513
|
window.location.origin
|
|
489
514
|
);
|
|
490
515
|
n.searchParams.delete("imageFilter"), n.searchParams.delete("f");
|
|
491
516
|
const m = n.toString();
|
|
492
|
-
return new Promise((
|
|
517
|
+
return new Promise((i) => {
|
|
493
518
|
fetch(m).then((c) => {
|
|
494
519
|
c.headers.get("content-type")?.includes("svg") && c.text().then((u) => {
|
|
495
|
-
l(u),
|
|
496
|
-
}),
|
|
520
|
+
l(u), i(null);
|
|
521
|
+
}), i(c.url);
|
|
497
522
|
});
|
|
498
523
|
});
|
|
499
524
|
}, [r]);
|
|
500
525
|
if (t)
|
|
501
526
|
return t;
|
|
502
527
|
if (o)
|
|
503
|
-
return /* @__PURE__ */ e(w, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html:
|
|
504
|
-
if (
|
|
505
|
-
const n = new URL(
|
|
528
|
+
return /* @__PURE__ */ e(w, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: xe.sanitize(o) } });
|
|
529
|
+
if (a) {
|
|
530
|
+
const n = new URL(a);
|
|
506
531
|
n.searchParams.set("imageFilter", "convert"), n.searchParams.set("f", "png"), n.searchParams.set("h", "80");
|
|
507
532
|
const m = n.toString();
|
|
508
533
|
return /* @__PURE__ */ e("img", { src: m, alt: "logo" });
|
|
509
534
|
}
|
|
510
535
|
return null;
|
|
511
536
|
}
|
|
512
|
-
function
|
|
537
|
+
function Ke({
|
|
513
538
|
logo: t,
|
|
514
539
|
translucentTextColor: o,
|
|
515
540
|
...l
|
|
516
541
|
}) {
|
|
517
|
-
const
|
|
518
|
-
let p = Math.min(
|
|
519
|
-
return p > 0.1 ? (p = Math.max(p, 0.6), f =
|
|
542
|
+
const a = ye(document.getElementById("app"), (p) => p.top < 1200), n = Y(), m = n.palette.mode === "dark", i = Math.min(a?.top ?? 0, 800), c = P(() => {
|
|
543
|
+
let p = Math.min(i / 800, 1), f = "";
|
|
544
|
+
return p > 0.1 ? (p = Math.max(p, 0.6), f = D(n.palette.text.primary, p)) : f = o || "#EEEEEE", {
|
|
520
545
|
backgroundOpacity: p,
|
|
521
546
|
textColor: f,
|
|
522
547
|
isReversed: p < 0.7
|
|
523
548
|
};
|
|
524
|
-
}, [
|
|
549
|
+
}, [i, 800, n.palette.text.primary, o]), { backgroundOpacity: h, textColor: u, isReversed: y } = c;
|
|
525
550
|
return /* @__PURE__ */ e(
|
|
526
551
|
oe,
|
|
527
552
|
{
|
|
528
|
-
logo: /* @__PURE__ */ e(
|
|
553
|
+
logo: /* @__PURE__ */ e(qe, { logo: t }),
|
|
529
554
|
...l,
|
|
530
555
|
sx: {
|
|
531
556
|
// 基础布局和定位
|
|
@@ -548,7 +573,7 @@ function qe({
|
|
|
548
573
|
zIndex: -1,
|
|
549
574
|
// 置于内容下方
|
|
550
575
|
// 背景样式(颜色和模糊)是固定的
|
|
551
|
-
backgroundColor:
|
|
576
|
+
backgroundColor: D(n.palette.background.default, h),
|
|
552
577
|
backdropFilter: h >= 0.6 ? "blur(10px)" : "blur(0px)",
|
|
553
578
|
// **性能关键**: 只对 opacity 进行动画
|
|
554
579
|
// opacity: backgroundOpacity,
|
|
@@ -585,14 +610,14 @@ function qe({
|
|
|
585
610
|
}
|
|
586
611
|
);
|
|
587
612
|
}
|
|
588
|
-
const ne =
|
|
613
|
+
const ne = E(he)``;
|
|
589
614
|
export {
|
|
590
|
-
|
|
615
|
+
wt as H,
|
|
591
616
|
$e as L,
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
617
|
+
_ as P,
|
|
618
|
+
Ke as T,
|
|
619
|
+
Ue as a,
|
|
595
620
|
H as b,
|
|
596
|
-
|
|
597
|
-
|
|
621
|
+
St as c,
|
|
622
|
+
O as d
|
|
598
623
|
};
|
|
@@ -10,8 +10,8 @@ import { produce as De } from "immer";
|
|
|
10
10
|
import Z from "lodash/difference";
|
|
11
11
|
import { useState as D, useMemo as C, useCallback as O, useImperativeHandle as Oe, useEffect as E, useRef as Ae } from "react";
|
|
12
12
|
import { useAsync as je } from "react-use";
|
|
13
|
-
import { L as ve } from "./home-
|
|
14
|
-
import { p as Ce, g as Re } from "./index-
|
|
13
|
+
import { L as ve } from "./home-CCiZOODL.js";
|
|
14
|
+
import { p as Ce, g as Re } from "./index-B6GyWmgC.js";
|
|
15
15
|
function ze(s) {
|
|
16
16
|
const [u, g] = D(!1);
|
|
17
17
|
return /* @__PURE__ */ t(
|