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