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