@blocklet/pages-kit-inner-components 0.5.40 → 0.5.42
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/{array-Cr5KF-hM.js → array-Cip5uTnI.js} +1 -1
- package/lib/cjs/chunks/{config-string-BYZ5HfyY.js → config-string-CEipCOnU.js} +1 -1
- package/lib/cjs/chunks/{draft-data-6zW9mu28.js → draft-data-F0V4PcIs.js} +1 -1
- package/lib/cjs/chunks/home-BCFoaIEZ.js +38 -0
- package/lib/cjs/chunks/{publish-button-B-H_3RtT.js → publish-button-Bbd4z1_d.js} +1 -1
- package/lib/cjs/chunks/site-state-CeQEnrvX.js +57 -0
- package/lib/cjs/chunks/state-UwRWAZRe.js +1 -0
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/project-html.js +3 -3
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +2 -2
- package/lib/cjs/site-state.js +1 -1
- package/lib/cjs/theme.js +1 -1
- package/lib/es/add-component.js +3 -3
- package/lib/es/chunks/{array-D34Qpnhk.js → array-DM0x2Sjw.js} +1 -1
- package/lib/es/chunks/{config-string-DgK7ETCs.js → config-string-Dw6sJMn_.js} +1 -1
- package/lib/es/chunks/{draft-data-B5kzDvTI.js → draft-data-sTSk4UTm.js} +1 -1
- package/lib/es/chunks/home-ClxOpmCx.js +569 -0
- package/lib/es/chunks/{publish-button-CvQPEUZl.js → publish-button-CKXdANG9.js} +3 -3
- package/lib/es/chunks/{site-state-DI5PAxyt.js → site-state-BeEHvakk.js} +410 -399
- package/lib/es/chunks/{state-BzwEX9VC.js → state-COB6reM7.js} +98 -103
- package/lib/es/components.js +1 -1
- package/lib/es/home.js +3 -3
- package/lib/es/project-html.js +70 -70
- package/lib/es/resources.js +1 -1
- package/lib/es/setting.js +1152 -888
- package/lib/es/site-state.js +1 -1
- package/lib/es/theme.js +14 -11
- package/package.json +11 -11
- package/lib/cjs/chunks/home-DJPbdJux.js +0 -38
- package/lib/cjs/chunks/site-state-6tgRGL_9.js +0 -57
- package/lib/cjs/chunks/state-BWuBNdK8.js +0 -1
- package/lib/es/chunks/home-DpmpXDlo.js +0 -532
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
-
import { u as Q, d as X, e as fe, f as he, g as be, c as ye } from "./state-BzwEX9VC.js";
|
|
3
|
-
import { useLocaleContext as Y } from "@arcblock/ux/lib/Locale/context";
|
|
4
|
-
import Z from "@arcblock/ux/lib/Result";
|
|
5
|
-
import { useHeaderState as ve } from "@blocklet/pages-kit/builtin/page/header";
|
|
6
|
-
import { useColorConvert as we } from "@blocklet/pages-kit/contexts/color";
|
|
7
|
-
import { setPageDataSource as ee } from "@blocklet/pages-kit/utils/data-source";
|
|
8
|
-
import { generateParamCombinations as Pe } from "@blocklet/pages-kit/utils/route";
|
|
9
|
-
import xe from "@blocklet/ui-react/lib/Header";
|
|
10
|
-
import { cx as te } from "@emotion/css";
|
|
11
|
-
import { Global as oe, css as ne } from "@emotion/react";
|
|
12
|
-
import re from "@emotion/styled";
|
|
13
|
-
import { Box as _, CircularProgress as Se, useTheme as ae, Button as ke, Stack as Ce, alpha as q, useMediaQuery as je } from "@mui/material";
|
|
14
|
-
import { useReactive as se, useScroll as Ie } from "ahooks";
|
|
15
|
-
import Re from "isomorphic-dompurify";
|
|
16
|
-
import A from "lodash/cloneDeep";
|
|
17
|
-
import Ee from "lodash/isEmpty";
|
|
18
|
-
import ie from "lodash/isEqual";
|
|
19
|
-
import { useEffect as N, lazy as le, useMemo as T, useRef as ce, Suspense as Te, useState as Me } from "react";
|
|
20
|
-
import { Helmet as Oe } from "react-helmet";
|
|
21
|
-
import { useSearchParams as ue, Routes as Be, Route as E, Navigate as Fe, ScrollRestoration as Ne } from "react-router-dom";
|
|
22
|
-
import { useAsync as pe } from "react-use";
|
|
23
|
-
import { joinURL as k } from "ufo";
|
|
24
|
-
import { S as _e, n as K, P as De, a as Le, B as $e, g as Ae } from "./array-D34Qpnhk.js";
|
|
25
|
-
import { styled as me, useTheme as He } from "@arcblock/ux/lib/Theme";
|
|
26
|
-
import Ue from "@blocklet/ui-react/lib/Footer";
|
|
27
|
-
import "webfontloader";
|
|
28
|
-
import { u as Ve, a as ze } from "./session-CVblGhSp.js";
|
|
29
|
-
const Ge = me(Ue, { shouldForwardProp: (t) => !!t })`
|
|
30
|
-
& > div > .MuiContainer-root {
|
|
31
|
-
max-width: unset;
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
function We({ meta: t, ...n }) {
|
|
35
|
-
const a = He();
|
|
36
|
-
return /* @__PURE__ */ e(Ge, { ...n, meta: t, theme: a || {} });
|
|
37
|
-
}
|
|
38
|
-
function qe(t) {
|
|
39
|
-
return /* @__PURE__ */ e(_, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(Se, { size: 30 }) });
|
|
40
|
-
}
|
|
41
|
-
function Ke(t) {
|
|
42
|
-
return /* @__PURE__ */ e(Je, { ...t });
|
|
43
|
-
}
|
|
44
|
-
const Je = me(_)`
|
|
45
|
-
position: fixed;
|
|
46
|
-
left: 0;
|
|
47
|
-
top: 0;
|
|
48
|
-
z-index: 999999999999;
|
|
49
|
-
width: 80px;
|
|
50
|
-
font-size: 12px;
|
|
51
|
-
text-align: center;
|
|
52
|
-
opacity: 0.7;
|
|
53
|
-
transform: translateX(-23%) translateY(70%) rotate(-45deg);
|
|
54
|
-
pointer-events: none;
|
|
55
|
-
`, Qe = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
56
|
-
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;
|
|
57
|
-
function Xe({
|
|
58
|
-
titleFontFamily: t,
|
|
59
|
-
descriptionFontFamily: n
|
|
60
|
-
}) {
|
|
61
|
-
var o;
|
|
62
|
-
const a = ae(), s = (o = a == null ? void 0 : a.typography) == null ? void 0 : o.fontFamily;
|
|
63
|
-
N(() => {
|
|
64
|
-
}, [t, n]);
|
|
65
|
-
const i = `${s}, ${Qe}`;
|
|
66
|
-
return /* @__PURE__ */ e(
|
|
67
|
-
oe,
|
|
68
|
-
{
|
|
69
|
-
styles: ne`
|
|
70
|
-
#app {
|
|
71
|
-
font-family: ${i};
|
|
72
|
-
|
|
73
|
-
.page-kit-section__title {
|
|
74
|
-
font-family: ${i};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.page-kit-section__description {
|
|
78
|
-
font-family: ${i};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
`
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
function Ot() {
|
|
86
|
-
const [t] = ue(), { session: n } = Ve(), a = ze("owner", "admin", "pagesEditor", "member"), s = T(() => {
|
|
87
|
-
const o = t.get("mode");
|
|
88
|
-
return _e.includes(o) ? o : "production";
|
|
89
|
-
}, [t]), i = s === "production" ? s : n.user ? a ? s : "production" : null;
|
|
90
|
-
return i ? /* @__PURE__ */ e(Ye, { mode: i }) : null;
|
|
91
|
-
}
|
|
92
|
-
function Ye({ mode: t }) {
|
|
93
|
-
if (t !== "draft") {
|
|
94
|
-
const n = window.__PAGE_STATE__;
|
|
95
|
-
return n ? /* @__PURE__ */ e(V, { mode: t, state: n }) : /* @__PURE__ */ e(et, { mode: t, children: ({ state: a }) => /* @__PURE__ */ e(V, { mode: t, state: a }) });
|
|
96
|
-
}
|
|
97
|
-
return /* @__PURE__ */ e(Ze, { children: ({ state: n }) => /* @__PURE__ */ e(V, { mode: t, state: n }) });
|
|
98
|
-
}
|
|
99
|
-
const Ze = le(() => import("./draft-data-B5kzDvTI.js"));
|
|
100
|
-
function et({
|
|
101
|
-
mode: t,
|
|
102
|
-
children: n
|
|
103
|
-
}) {
|
|
104
|
-
const a = document.querySelector('meta[property="pages:version"]'), s = a == null ? void 0 : a.content, i = Q(), o = T(() => {
|
|
105
|
-
if (s === "{{pagesPublishedAt}}") {
|
|
106
|
-
const u = localStorage.getItem(ye(i ?? ""));
|
|
107
|
-
return Number(u) ? Number(u) : (/* @__PURE__ */ new Date()).getTime();
|
|
108
|
-
}
|
|
109
|
-
return Number(s);
|
|
110
|
-
}, [s]), { loading: m, value: l } = pe(() => Ae({ mode: t, version: o }), [t, o]);
|
|
111
|
-
return m ? /* @__PURE__ */ e(qe, {}) : l ? n({ state: l }) : null;
|
|
112
|
-
}
|
|
113
|
-
function V({ mode: t, state: n }) {
|
|
114
|
-
const { t: a, locale: s } = Y(), [i] = ue(), o = Q(), m = fe(), l = i.get("hiddenBadge") === "true", u = i.get("showPublish") === "true", {
|
|
115
|
-
pageIds: f,
|
|
116
|
-
pages: p,
|
|
117
|
-
routeIds: d,
|
|
118
|
-
routes: h,
|
|
119
|
-
supportedLocales: b,
|
|
120
|
-
config: { defaultLocale: y },
|
|
121
|
-
resources: C
|
|
122
|
-
} = n, g = X(n), P = T(
|
|
123
|
-
() => b != null && b.some((c) => c.locale === s) ? s : void 0,
|
|
124
|
-
[s, b]
|
|
125
|
-
), M = Object.values(h || {}).find((c) => (c == null ? void 0 : c.path) === "/") || Object.values(p).find((c) => (c == null ? void 0 : c.slug) === "/") ? void 0 : Object.values(p)[0], D = T(() => t === "production" ? f.map((c) => {
|
|
126
|
-
const r = p[c];
|
|
127
|
-
return r && {
|
|
128
|
-
id: r.id,
|
|
129
|
-
path: k("/", m || o || "", r.slug)
|
|
130
|
-
};
|
|
131
|
-
}).filter(K) : d.map((c) => {
|
|
132
|
-
const r = h[c];
|
|
133
|
-
return r ? {
|
|
134
|
-
id: r.id,
|
|
135
|
-
path: k("/", m || o || "", r.path, `?mode=${t}&showPublish=true`)
|
|
136
|
-
} : null;
|
|
137
|
-
}).filter(K), [f, p, t, h, d, o, m]), S = ([...c]) => (t !== "production" && u && c.unshift(
|
|
138
|
-
/* @__PURE__ */ e(Te, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(tt, { mode: "production", state: n }) })
|
|
139
|
-
), c);
|
|
140
|
-
return /* @__PURE__ */ $(De, { value: { pages: D }, children: [
|
|
141
|
-
/* @__PURE__ */ $(Be, { children: [
|
|
142
|
-
M && /* @__PURE__ */ e(E, { index: !0, element: /* @__PURE__ */ e(Fe, { to: k("/", P || "", M.slug) }) }),
|
|
143
|
-
d == null ? void 0 : d.map((c) => {
|
|
144
|
-
var w, v, x, L;
|
|
145
|
-
const r = h == null ? void 0 : h[c];
|
|
146
|
-
if (!r || !r.displayTemplateId) return null;
|
|
147
|
-
const j = p[r.displayTemplateId];
|
|
148
|
-
if (!j) return null;
|
|
149
|
-
let I = [];
|
|
150
|
-
if (r.params && r.params.length > 0) {
|
|
151
|
-
const R = Pe({
|
|
152
|
-
basePath: r.path,
|
|
153
|
-
params: r.params,
|
|
154
|
-
routeId: r.id,
|
|
155
|
-
paramsOptions: r.paramsOptions,
|
|
156
|
-
currentIndex: 0,
|
|
157
|
-
currentParams: [],
|
|
158
|
-
currentOptionIds: [],
|
|
159
|
-
result: []
|
|
160
|
-
});
|
|
161
|
-
I = R == null ? void 0 : R.map((O) => {
|
|
162
|
-
var F, z, G, W;
|
|
163
|
-
const B = O.paramOptionIds.join("-");
|
|
164
|
-
return /* @__PURE__ */ e(
|
|
165
|
-
E,
|
|
166
|
-
{
|
|
167
|
-
path: k(":projectIdOrSlug?", O.path),
|
|
168
|
-
element: /* @__PURE__ */ e(
|
|
169
|
-
J,
|
|
170
|
-
{
|
|
171
|
-
mode: t,
|
|
172
|
-
components: g,
|
|
173
|
-
page: j,
|
|
174
|
-
locale: P,
|
|
175
|
-
defaultLocale: y,
|
|
176
|
-
headerAddons: S,
|
|
177
|
-
state: n,
|
|
178
|
-
pageData: (W = (G = (z = (F = r.dataSource) == null ? void 0 : F.pathDataMappings) == null ? void 0 : z[B]) == null ? void 0 : G.dataCache) == null ? void 0 : W[P || y || "en"]
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
},
|
|
182
|
-
B
|
|
183
|
-
);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
return I.push(
|
|
187
|
-
/* @__PURE__ */ e(
|
|
188
|
-
E,
|
|
189
|
-
{
|
|
190
|
-
path: k(":projectIdOrSlug?", r.path),
|
|
191
|
-
element: /* @__PURE__ */ e(
|
|
192
|
-
J,
|
|
193
|
-
{
|
|
194
|
-
mode: t,
|
|
195
|
-
components: g,
|
|
196
|
-
page: j,
|
|
197
|
-
locale: P,
|
|
198
|
-
defaultLocale: y,
|
|
199
|
-
headerAddons: S,
|
|
200
|
-
state: n,
|
|
201
|
-
pageData: (L = (x = (v = (w = r.dataSource) == null ? void 0 : w.pathDataMappings) == null ? void 0 : v[r.id]) == null ? void 0 : x.dataCache) == null ? void 0 : L[P || y || "en"]
|
|
202
|
-
}
|
|
203
|
-
)
|
|
204
|
-
},
|
|
205
|
-
r.id
|
|
206
|
-
)
|
|
207
|
-
), I;
|
|
208
|
-
}),
|
|
209
|
-
f.map((c) => {
|
|
210
|
-
const r = p[c];
|
|
211
|
-
return r ? /* @__PURE__ */ e(
|
|
212
|
-
E,
|
|
213
|
-
{
|
|
214
|
-
path: k(":projectIdOrSlug?", r.slug),
|
|
215
|
-
element: /* @__PURE__ */ e(
|
|
216
|
-
H,
|
|
217
|
-
{
|
|
218
|
-
mode: t,
|
|
219
|
-
components: g,
|
|
220
|
-
page: r,
|
|
221
|
-
locale: P,
|
|
222
|
-
defaultLocale: y,
|
|
223
|
-
headerAddons: S
|
|
224
|
-
}
|
|
225
|
-
)
|
|
226
|
-
},
|
|
227
|
-
r.id
|
|
228
|
-
) : null;
|
|
229
|
-
}),
|
|
230
|
-
C.pages && Object.values(C.pages).map(({ blockletId: c, page: r }) => /* @__PURE__ */ e(
|
|
231
|
-
E,
|
|
232
|
-
{
|
|
233
|
-
path: k("/", `@${c}`, r.slug),
|
|
234
|
-
element: /* @__PURE__ */ e(
|
|
235
|
-
H,
|
|
236
|
-
{
|
|
237
|
-
mode: t,
|
|
238
|
-
components: g,
|
|
239
|
-
page: r,
|
|
240
|
-
locale: P,
|
|
241
|
-
defaultLocale: y,
|
|
242
|
-
headerAddons: S
|
|
243
|
-
}
|
|
244
|
-
)
|
|
245
|
-
},
|
|
246
|
-
r.id
|
|
247
|
-
)),
|
|
248
|
-
/* @__PURE__ */ e(
|
|
249
|
-
E,
|
|
250
|
-
{
|
|
251
|
-
path: "*",
|
|
252
|
-
element: /* @__PURE__ */ e(_, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(
|
|
253
|
-
Z,
|
|
254
|
-
{
|
|
255
|
-
status: 404,
|
|
256
|
-
extra: /* @__PURE__ */ e(ge, { href: "/", children: a("common.back") }),
|
|
257
|
-
sx: {
|
|
258
|
-
bgcolor: "transparent",
|
|
259
|
-
width: "100%",
|
|
260
|
-
height: "100%"
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
) })
|
|
264
|
-
}
|
|
265
|
-
)
|
|
266
|
-
] }),
|
|
267
|
-
t !== "production" && !l && /* @__PURE__ */ e(Ke, { sx: { bgcolor: "info.light" }, children: t }),
|
|
268
|
-
/* @__PURE__ */ e(Xe, {})
|
|
269
|
-
] });
|
|
270
|
-
}
|
|
271
|
-
function J({
|
|
272
|
-
mode: t,
|
|
273
|
-
pageData: n,
|
|
274
|
-
components: a,
|
|
275
|
-
page: s,
|
|
276
|
-
locale: i,
|
|
277
|
-
defaultLocale: o,
|
|
278
|
-
headerAddons: m,
|
|
279
|
-
state: l
|
|
280
|
-
}) {
|
|
281
|
-
const u = se({
|
|
282
|
-
page: null
|
|
283
|
-
});
|
|
284
|
-
N(() => {
|
|
285
|
-
const p = s || null;
|
|
286
|
-
p ? u.page = A(p) : u.page = null;
|
|
287
|
-
}, [s, JSON.stringify(s), u]);
|
|
288
|
-
const f = ce();
|
|
289
|
-
return N(() => {
|
|
290
|
-
ie(n, f.current) || n && u.page && (ee(u.page, l, i, n), f.current = A(n));
|
|
291
|
-
}, [u.page, n, i, l]), u.page ? /* @__PURE__ */ e(
|
|
292
|
-
H,
|
|
293
|
-
{
|
|
294
|
-
mode: t,
|
|
295
|
-
components: a,
|
|
296
|
-
page: u.page,
|
|
297
|
-
locale: i,
|
|
298
|
-
defaultLocale: o,
|
|
299
|
-
headerAddons: m
|
|
300
|
-
}
|
|
301
|
-
) : null;
|
|
302
|
-
}
|
|
303
|
-
function Bt({
|
|
304
|
-
mode: t,
|
|
305
|
-
state: n,
|
|
306
|
-
path: a,
|
|
307
|
-
pageData: s
|
|
308
|
-
}) {
|
|
309
|
-
const { t: i, locale: o } = Y(), {
|
|
310
|
-
pages: m,
|
|
311
|
-
supportedLocales: l,
|
|
312
|
-
config: { defaultLocale: u },
|
|
313
|
-
resources: f
|
|
314
|
-
} = n, p = Object.values(m).find((g) => (g == null ? void 0 : g.slug) === a), d = Object.values(f.pages || {}).find((g) => g.page.slug === a), h = T(
|
|
315
|
-
() => l != null && l.some((g) => g.locale === o) ? o : void 0,
|
|
316
|
-
[o, l]
|
|
317
|
-
), b = se({
|
|
318
|
-
page: null
|
|
319
|
-
});
|
|
320
|
-
N(() => {
|
|
321
|
-
const g = p || (d == null ? void 0 : d.page) || null;
|
|
322
|
-
g ? b.page = A(g) : b.page = null;
|
|
323
|
-
}, [p, d]);
|
|
324
|
-
const y = ce();
|
|
325
|
-
if (N(() => {
|
|
326
|
-
ie(s, y.current) || s && b.page && (ee(b.page, n, h, s), y.current = A(s));
|
|
327
|
-
}, [{}]), !p && !(d != null && d.page))
|
|
328
|
-
return /* @__PURE__ */ e(_, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Z, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ge, { href: "/", children: i("common.back") }) }) });
|
|
329
|
-
const C = X(n);
|
|
330
|
-
return b.page ? /* @__PURE__ */ e(
|
|
331
|
-
H,
|
|
332
|
-
{
|
|
333
|
-
mode: t,
|
|
334
|
-
components: C,
|
|
335
|
-
page: b.page,
|
|
336
|
-
locale: h,
|
|
337
|
-
defaultLocale: u
|
|
338
|
-
}
|
|
339
|
-
) : null;
|
|
340
|
-
}
|
|
341
|
-
function H({
|
|
342
|
-
mode: t,
|
|
343
|
-
components: n,
|
|
344
|
-
page: a,
|
|
345
|
-
locale: s,
|
|
346
|
-
defaultLocale: i,
|
|
347
|
-
headerAddons: o
|
|
348
|
-
}) {
|
|
349
|
-
var P, U, M, D, S, c, r, j, I;
|
|
350
|
-
const m = we(), l = ((P = a.locales) == null ? void 0 : P[s]) ?? ((U = a.locales) == null ? void 0 : U[i]) ?? {}, u = l.title || ((M = window.blocklet) == null ? void 0 : M.appName), f = l.description || ((D = window.blocklet) == null ? void 0 : D.appDescription), p = he(be(l.image), 540), { logo: d, brand: h, description: b, ...y } = ve(), C = T(
|
|
351
|
-
() => (w) => {
|
|
352
|
-
var x;
|
|
353
|
-
let v = (o == null ? void 0 : o(w)) ?? w;
|
|
354
|
-
return v = ((x = y.addons) == null ? void 0 : x.call(y, v)) ?? v, v;
|
|
355
|
-
},
|
|
356
|
-
[y.addons, o]
|
|
357
|
-
), g = (S = l.header) != null && S.translucent ? nt : de;
|
|
358
|
-
return /* @__PURE__ */ $(Le, { page: a, defaultLocale: i, currentLocale: s, children: [
|
|
359
|
-
/* @__PURE__ */ e(
|
|
360
|
-
oe,
|
|
361
|
-
{
|
|
362
|
-
styles: ne`
|
|
363
|
-
body {
|
|
364
|
-
background-color: ${m(
|
|
365
|
-
!l.backgroundColor || l.backgroundColor === "transparent" ? "background.default" : l.backgroundColor
|
|
366
|
-
)} !important;
|
|
367
|
-
}
|
|
368
|
-
`
|
|
369
|
-
}
|
|
370
|
-
),
|
|
371
|
-
/* @__PURE__ */ e(
|
|
372
|
-
g,
|
|
373
|
-
{
|
|
374
|
-
hideNavMenu: !!((c = l.header) != null && c.hideNavMenus),
|
|
375
|
-
translucentTextColor: (r = l.header) == null ? void 0 : r.translucentTextColor,
|
|
376
|
-
...d ? { logo: d } : {},
|
|
377
|
-
...h ? { brand: h } : {},
|
|
378
|
-
...b ? { description: b } : {},
|
|
379
|
-
className: te(((j = l.header) == null ? void 0 : j.sticky) && "sticky", "page-header"),
|
|
380
|
-
maxWidth: !1,
|
|
381
|
-
addons: C
|
|
382
|
-
}
|
|
383
|
-
),
|
|
384
|
-
/* @__PURE__ */ e(Ne, {}),
|
|
385
|
-
/* @__PURE__ */ $(Oe, { children: [
|
|
386
|
-
/* @__PURE__ */ e("title", { children: u }),
|
|
387
|
-
/* @__PURE__ */ e("meta", { name: "og:title", content: u }),
|
|
388
|
-
/* @__PURE__ */ e("meta", { name: "og:description", content: f }),
|
|
389
|
-
/* @__PURE__ */ e("meta", { name: "og:image", content: p }),
|
|
390
|
-
/* @__PURE__ */ e("meta", { name: "twitter:image:src", content: p }),
|
|
391
|
-
/* @__PURE__ */ e("meta", { name: "twitter:image", content: p }),
|
|
392
|
-
/* @__PURE__ */ e("meta", { property: "twitter:description", content: f }),
|
|
393
|
-
/* @__PURE__ */ e("meta", { property: "twitter:title", content: u }),
|
|
394
|
-
/* @__PURE__ */ e("meta", { name: "description", content: f })
|
|
395
|
-
] }),
|
|
396
|
-
/* @__PURE__ */ e(
|
|
397
|
-
Ce,
|
|
398
|
-
{
|
|
399
|
-
flexGrow: 1,
|
|
400
|
-
className: "PageView-root",
|
|
401
|
-
sx: {
|
|
402
|
-
// 第一个 .BlockBase-root 的 pt 为 0
|
|
403
|
-
"& .BlockBase-root:first-child": {
|
|
404
|
-
pt: "0 !important"
|
|
405
|
-
}
|
|
406
|
-
},
|
|
407
|
-
children: a.sectionIds.map((w) => {
|
|
408
|
-
var R, O, B, F;
|
|
409
|
-
const v = a.sections[w];
|
|
410
|
-
if (!v || v.visibility === "hidden") return null;
|
|
411
|
-
const x = (O = (R = a.dataSource) == null ? void 0 : R[w]) == null ? void 0 : O[s], L = ((F = (B = a.dataSource) == null ? void 0 : B[w]) == null ? void 0 : F[i]) ?? {};
|
|
412
|
-
return /* @__PURE__ */ e(
|
|
413
|
-
$e,
|
|
414
|
-
{
|
|
415
|
-
id: w,
|
|
416
|
-
type: v.component,
|
|
417
|
-
mode: t,
|
|
418
|
-
section: v,
|
|
419
|
-
config: {
|
|
420
|
-
...Ee(x) ? L : x,
|
|
421
|
-
locale: s,
|
|
422
|
-
dev: t === "draft" ? {
|
|
423
|
-
mode: t,
|
|
424
|
-
components: n,
|
|
425
|
-
defaultLocale: i
|
|
426
|
-
} : {
|
|
427
|
-
mode: t,
|
|
428
|
-
defaultLocale: i
|
|
429
|
-
// 用于 fallback 的 locale
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
page: a
|
|
433
|
-
},
|
|
434
|
-
w
|
|
435
|
-
);
|
|
436
|
-
})
|
|
437
|
-
}
|
|
438
|
-
),
|
|
439
|
-
!((I = l.footer) != null && I.hidden) && /* @__PURE__ */ e(We, {})
|
|
440
|
-
] });
|
|
441
|
-
}
|
|
442
|
-
const tt = le(() => import("./publish-button-CvQPEUZl.js")), de = re(xe)`
|
|
443
|
-
&.sticky {
|
|
444
|
-
position: sticky;
|
|
445
|
-
top: 0;
|
|
446
|
-
}
|
|
447
|
-
`;
|
|
448
|
-
function ot({ logo: t }) {
|
|
449
|
-
const [n, a] = Me(), s = je((o) => o.breakpoints.down("sm")), { value: i } = pe(() => {
|
|
450
|
-
var l, u;
|
|
451
|
-
const o = new URL(
|
|
452
|
-
s ? ((l = window == null ? void 0 : window.blocklet) == null ? void 0 : l.appLogo) || "/.well-known/service/blocklet/logo" : ((u = window == null ? void 0 : window.blocklet) == null ? void 0 : u.appLogoRect) || "/.well-known/service/blocklet/logo-rect",
|
|
453
|
-
window.location.origin
|
|
454
|
-
);
|
|
455
|
-
o.searchParams.delete("imageFilter"), o.searchParams.delete("f");
|
|
456
|
-
const m = o.toString();
|
|
457
|
-
return new Promise((f) => {
|
|
458
|
-
fetch(m).then((p) => {
|
|
459
|
-
const d = p.headers.get("content-type");
|
|
460
|
-
d != null && d.includes("svg") && p.text().then((h) => {
|
|
461
|
-
a(h), f(null);
|
|
462
|
-
}), f(p.url);
|
|
463
|
-
});
|
|
464
|
-
});
|
|
465
|
-
}, [s]);
|
|
466
|
-
if (t)
|
|
467
|
-
return t;
|
|
468
|
-
if (n)
|
|
469
|
-
return /* @__PURE__ */ e(_, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Re.sanitize(n) } });
|
|
470
|
-
if (i) {
|
|
471
|
-
const o = new URL(i);
|
|
472
|
-
o.searchParams.set("imageFilter", "convert"), o.searchParams.set("f", "png"), o.searchParams.set("h", "80");
|
|
473
|
-
const m = o.toString();
|
|
474
|
-
return /* @__PURE__ */ e("img", { src: m, alt: "logo" });
|
|
475
|
-
}
|
|
476
|
-
return null;
|
|
477
|
-
}
|
|
478
|
-
function nt({
|
|
479
|
-
logo: t,
|
|
480
|
-
translucentTextColor: n,
|
|
481
|
-
...a
|
|
482
|
-
}) {
|
|
483
|
-
const { top: s = 0 } = Ie(() => document.getElementById("app")) || {}, i = ae();
|
|
484
|
-
let o = Math.min(s / 800, 1), m = "";
|
|
485
|
-
return o > 0.1 ? (o = Math.max(o, 0.6), m = q(i.palette.text.primary, o)) : m = n || "#EEEEEE", /* @__PURE__ */ e(
|
|
486
|
-
de,
|
|
487
|
-
{
|
|
488
|
-
logo: /* @__PURE__ */ e(ot, { logo: t }),
|
|
489
|
-
...a,
|
|
490
|
-
className: te(o <= 0.7 && "reverse-color"),
|
|
491
|
-
style: {
|
|
492
|
-
backgroundColor: q(i.palette.background.default, o),
|
|
493
|
-
// @ts-ignore
|
|
494
|
-
"--logo-invert": o <= 0.7 ? 1 - o / 6 : 1 - o
|
|
495
|
-
},
|
|
496
|
-
sx: {
|
|
497
|
-
backdropFilter: o >= 0.6 ? "blur(10px)" : "blur(0px)",
|
|
498
|
-
transition: "all 0.3s ease",
|
|
499
|
-
position: "fixed !important",
|
|
500
|
-
left: 0,
|
|
501
|
-
top: 0,
|
|
502
|
-
right: 0,
|
|
503
|
-
bgcolor: "transparent",
|
|
504
|
-
"&.reverse-color": {
|
|
505
|
-
".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button": {
|
|
506
|
-
color: `${m} !important`
|
|
507
|
-
}
|
|
508
|
-
},
|
|
509
|
-
"& .navmenu--horizontal": {
|
|
510
|
-
bgcolor: "transparent !important"
|
|
511
|
-
},
|
|
512
|
-
".header-logo > div": {
|
|
513
|
-
filter: "invert(var(--logo-invert))"
|
|
514
|
-
},
|
|
515
|
-
".header-logo": {
|
|
516
|
-
color: m
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
const ge = re(ke)``;
|
|
523
|
-
export {
|
|
524
|
-
Ot as H,
|
|
525
|
-
qe as L,
|
|
526
|
-
V as P,
|
|
527
|
-
nt as T,
|
|
528
|
-
Ye as a,
|
|
529
|
-
J as b,
|
|
530
|
-
Bt as c,
|
|
531
|
-
H as d
|
|
532
|
-
};
|