@blocklet/pages-kit-inner-components 0.5.21 → 0.5.23
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 +9 -9
- package/lib/cjs/chunks/home-5a40bAJ6.js +38 -0
- package/lib/cjs/chunks/{publish-button-Cw_MfRfv.js → publish-button-DUYSuenR.js} +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/setting.js +2 -2
- package/lib/es/add-component.js +4 -4
- package/lib/es/chunks/{home-BjT8iYTg.js → home-BB778Odl.js} +174 -171
- package/lib/es/chunks/{publish-button-eIyM_BsP.js → publish-button-BJSEYd0m.js} +1 -1
- package/lib/es/home.js +1 -1
- package/lib/es/setting.js +46 -46
- package/package.json +8 -8
- package/lib/cjs/chunks/home-DH9Z8Tuv.js +0 -38
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsx as e, jsxs as N } 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
|
|
9
|
-
import
|
|
10
|
-
import { cx as
|
|
11
|
-
import { Global as
|
|
12
|
-
import
|
|
13
|
-
import { Box as L, CircularProgress as
|
|
14
|
-
import { useReactive as
|
|
15
|
-
import
|
|
2
|
+
import { d as K, e as me, g as de, u as ge, c as fe } from "./state-j8jViBMV.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 ye } from "@blocklet/pages-kit/utils/route";
|
|
9
|
+
import ve from "@blocklet/ui-react/lib/Header";
|
|
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 Pe, Stack as xe, alpha as G, useMediaQuery as ke } from "@mui/material";
|
|
14
|
+
import { useReactive as ne, useScroll as Se } from "ahooks";
|
|
15
|
+
import Ce from "isomorphic-dompurify";
|
|
16
16
|
import $ from "lodash/cloneDeep";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useEffect as F, lazy as
|
|
20
|
-
import { Helmet as
|
|
21
|
-
import { useSearchParams as
|
|
22
|
-
import { useAsync as
|
|
23
|
-
import { joinURL as
|
|
24
|
-
import { S as
|
|
25
|
-
import { styled as
|
|
17
|
+
import Ie from "lodash/isEmpty";
|
|
18
|
+
import re from "lodash/isEqual";
|
|
19
|
+
import { useEffect as F, lazy as ae, useMemo as R, useRef as se, Suspense as je, useState as Re } from "react";
|
|
20
|
+
import { Helmet as Ee } from "react-helmet";
|
|
21
|
+
import { useSearchParams as ie, Routes as Te, Route as j, Navigate as Me, ScrollRestoration as Be } from "react-router-dom";
|
|
22
|
+
import { useAsync as le } from "react-use";
|
|
23
|
+
import { joinURL as S } from "ufo";
|
|
24
|
+
import { S as Oe, n as W, P as Fe, a as Le, B as _e, g as De } from "./array-B1QKSYbX.js";
|
|
25
|
+
import { styled as ce, useTheme as Ne } from "@arcblock/ux/lib/Theme";
|
|
26
26
|
import $e from "@blocklet/ui-react/lib/Footer";
|
|
27
27
|
import "webfontloader";
|
|
28
28
|
import { u as Ae, a as He } from "./session-CVblGhSp.js";
|
|
29
|
-
const Ue =
|
|
29
|
+
const Ue = ce($e, { shouldForwardProp: (t) => !!t })`
|
|
30
30
|
& > div > .MuiContainer-root {
|
|
31
31
|
max-width: unset;
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
34
|
function Ve({ meta: t, ...n }) {
|
|
35
|
-
const
|
|
36
|
-
return /* @__PURE__ */ e(Ue, { ...n, meta: t, theme:
|
|
35
|
+
const s = Ne();
|
|
36
|
+
return /* @__PURE__ */ e(Ue, { ...n, meta: t, theme: s || {} });
|
|
37
37
|
}
|
|
38
38
|
function ze(t) {
|
|
39
|
-
return /* @__PURE__ */ e(L, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__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
40
|
}
|
|
41
41
|
function Ge(t) {
|
|
42
42
|
return /* @__PURE__ */ e(We, { ...t });
|
|
43
43
|
}
|
|
44
|
-
const We =
|
|
44
|
+
const We = ce(L)`
|
|
45
45
|
position: fixed;
|
|
46
46
|
left: 0;
|
|
47
47
|
top: 0;
|
|
@@ -59,14 +59,14 @@ function Ke({
|
|
|
59
59
|
descriptionFontFamily: n
|
|
60
60
|
}) {
|
|
61
61
|
var o;
|
|
62
|
-
const
|
|
62
|
+
const s = oe(), a = (o = s == null ? void 0 : s.typography) == null ? void 0 : o.fontFamily;
|
|
63
63
|
F(() => {
|
|
64
64
|
}, [t, n]);
|
|
65
|
-
const l = `${
|
|
65
|
+
const l = `${a}, ${qe}`;
|
|
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
|
|
|
@@ -83,96 +83,99 @@ function Ke({
|
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
function Et() {
|
|
86
|
-
const [t] =
|
|
86
|
+
const [t] = ie(), { session: n } = Ae(), s = He("owner", "admin", "pagesEditor", "member"), a = R(() => {
|
|
87
87
|
const o = t.get("mode");
|
|
88
|
-
return
|
|
89
|
-
}, [t]), l =
|
|
88
|
+
return Oe.includes(o) ? o : "production";
|
|
89
|
+
}, [t]), l = a === "production" ? a : n.user ? s ? a : "production" : null;
|
|
90
90
|
return l ? /* @__PURE__ */ e(Qe, { mode: l }) : null;
|
|
91
91
|
}
|
|
92
92
|
function Qe({ mode: t }) {
|
|
93
93
|
if (t !== "draft") {
|
|
94
94
|
const n = window.__PAGE_STATE__;
|
|
95
|
-
return n ? /* @__PURE__ */ e(H, { mode: t, state: n }) : /* @__PURE__ */ e(Ye, { mode: t, children: ({ state:
|
|
95
|
+
return n ? /* @__PURE__ */ e(H, { mode: t, state: n }) : /* @__PURE__ */ e(Ye, { mode: t, children: ({ state: s }) => /* @__PURE__ */ e(H, { mode: t, state: s }) });
|
|
96
96
|
}
|
|
97
97
|
return /* @__PURE__ */ e(Xe, { children: ({ state: n }) => /* @__PURE__ */ e(H, { mode: t, state: n }) });
|
|
98
98
|
}
|
|
99
|
-
const Xe =
|
|
99
|
+
const Xe = ae(() => import("./draft-data-DyeHwihR.js"));
|
|
100
100
|
function Ye({
|
|
101
101
|
mode: t,
|
|
102
102
|
children: n
|
|
103
103
|
}) {
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
const c = localStorage.getItem(
|
|
104
|
+
const s = document.querySelector('meta[property="pages:version"]'), a = s == null ? void 0 : s.content, l = ge(), o = R(() => {
|
|
105
|
+
if (a === "{{pagesPublishedAt}}") {
|
|
106
|
+
const c = localStorage.getItem(fe(l ?? ""));
|
|
107
107
|
return Number(c) ? Number(c) : (/* @__PURE__ */ new Date()).getTime();
|
|
108
108
|
}
|
|
109
|
-
return Number(
|
|
110
|
-
}, [
|
|
111
|
-
return d ? /* @__PURE__ */ e(ze, {}) :
|
|
109
|
+
return Number(a);
|
|
110
|
+
}, [a]), { loading: d, value: i } = le(() => De({ mode: t, version: o }), [t, o]);
|
|
111
|
+
return d ? /* @__PURE__ */ e(ze, {}) : i ? n({ state: i }) : null;
|
|
112
112
|
}
|
|
113
113
|
function H({ mode: t, state: n }) {
|
|
114
|
-
const { t:
|
|
115
|
-
pageIds:
|
|
114
|
+
const { t: s, locale: a } = Q(), [l] = ie(), o = l.get("hiddenBadge") === "true", d = l.get("showPublish") === "true", {
|
|
115
|
+
pageIds: i,
|
|
116
116
|
pages: c,
|
|
117
117
|
routeIds: g,
|
|
118
118
|
routes: p,
|
|
119
119
|
supportedLocales: m,
|
|
120
120
|
config: { defaultLocale: f },
|
|
121
121
|
resources: v
|
|
122
|
-
} = n, w =
|
|
123
|
-
() => m != null && m.some((u) => u.locale ===
|
|
124
|
-
[
|
|
125
|
-
), 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], _ = R(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
122
|
+
} = n, w = K(n), h = R(
|
|
123
|
+
() => m != null && m.some((u) => u.locale === a) ? a : void 0,
|
|
124
|
+
[a, m]
|
|
125
|
+
), 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], _ = R(() => t === "production" ? i.map((u) => {
|
|
126
|
+
const r = c[u];
|
|
127
|
+
return r && {
|
|
128
|
+
id: r.id,
|
|
129
|
+
path: S("/", h || "", r.slug)
|
|
130
|
+
};
|
|
131
|
+
}).filter(W) : g.map((u) => {
|
|
132
|
+
const r = p[u];
|
|
133
|
+
return r ? {
|
|
134
|
+
id: r.id,
|
|
135
|
+
path: S("/", h || "", r.path, `?mode=${t}`)
|
|
136
|
+
} : null;
|
|
137
|
+
}).filter(W), [i, c, h, t, p, g]), k = ([...u]) => (t !== "production" && d && u.unshift(
|
|
138
|
+
/* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(Je, { mode: "production", state: n }) })
|
|
136
139
|
), u);
|
|
137
140
|
return /* @__PURE__ */ N(Fe, { value: { pages: _ }, children: [
|
|
138
|
-
/* @__PURE__ */ N(
|
|
139
|
-
E && /* @__PURE__ */ e(
|
|
141
|
+
/* @__PURE__ */ N(Te, { children: [
|
|
142
|
+
E && /* @__PURE__ */ e(j, { index: !0, element: /* @__PURE__ */ e(Me, { to: S("/", h || "", E.slug) }) }),
|
|
140
143
|
g == null ? void 0 : g.map((u) => {
|
|
141
|
-
var T, M, P,
|
|
142
|
-
const
|
|
143
|
-
if (!
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
146
|
-
let
|
|
147
|
-
if (
|
|
148
|
-
const x =
|
|
149
|
-
basePath:
|
|
150
|
-
params:
|
|
151
|
-
routeId:
|
|
152
|
-
paramsOptions:
|
|
144
|
+
var T, M, P, b;
|
|
145
|
+
const r = p == null ? void 0 : p[u];
|
|
146
|
+
if (!r || !r.displayTemplateId) return null;
|
|
147
|
+
const C = c[r.displayTemplateId];
|
|
148
|
+
if (!C) return null;
|
|
149
|
+
let I = [];
|
|
150
|
+
if (r.params && r.params.length > 0) {
|
|
151
|
+
const x = ye({
|
|
152
|
+
basePath: r.path,
|
|
153
|
+
params: r.params,
|
|
154
|
+
routeId: r.id,
|
|
155
|
+
paramsOptions: r.paramsOptions,
|
|
153
156
|
currentIndex: 0,
|
|
154
157
|
currentParams: [],
|
|
155
158
|
currentOptionIds: [],
|
|
156
159
|
result: []
|
|
157
160
|
});
|
|
158
|
-
|
|
161
|
+
I = x == null ? void 0 : x.map((D) => {
|
|
159
162
|
var O, U, V, z;
|
|
160
163
|
const B = D.paramOptionIds.join("-");
|
|
161
164
|
return /* @__PURE__ */ e(
|
|
162
|
-
|
|
165
|
+
j,
|
|
163
166
|
{
|
|
164
|
-
path:
|
|
167
|
+
path: S(":projectIdOrSlug?", D.path),
|
|
165
168
|
element: /* @__PURE__ */ e(
|
|
166
|
-
|
|
169
|
+
q,
|
|
167
170
|
{
|
|
168
171
|
mode: t,
|
|
169
172
|
components: w,
|
|
170
|
-
page:
|
|
171
|
-
locale:
|
|
173
|
+
page: C,
|
|
174
|
+
locale: h,
|
|
172
175
|
defaultLocale: f,
|
|
173
176
|
headerAddons: k,
|
|
174
177
|
state: n,
|
|
175
|
-
pageData: (z = (V = (U = (O =
|
|
178
|
+
pageData: (z = (V = (U = (O = r.dataSource) == null ? void 0 : O.pathDataMappings) == null ? void 0 : U[B]) == null ? void 0 : V.dataCache) == null ? void 0 : z[h || f || "en"]
|
|
176
179
|
}
|
|
177
180
|
)
|
|
178
181
|
},
|
|
@@ -180,73 +183,73 @@ function H({ mode: t, state: n }) {
|
|
|
180
183
|
);
|
|
181
184
|
});
|
|
182
185
|
}
|
|
183
|
-
return
|
|
186
|
+
return I.push(
|
|
184
187
|
/* @__PURE__ */ e(
|
|
185
|
-
|
|
188
|
+
j,
|
|
186
189
|
{
|
|
187
|
-
path:
|
|
190
|
+
path: S(":projectIdOrSlug?", r.path),
|
|
188
191
|
element: /* @__PURE__ */ e(
|
|
189
|
-
|
|
192
|
+
q,
|
|
190
193
|
{
|
|
191
194
|
mode: t,
|
|
192
195
|
components: w,
|
|
193
|
-
page:
|
|
194
|
-
locale:
|
|
196
|
+
page: C,
|
|
197
|
+
locale: h,
|
|
195
198
|
defaultLocale: f,
|
|
196
199
|
headerAddons: k,
|
|
197
200
|
state: n,
|
|
198
|
-
pageData: (
|
|
201
|
+
pageData: (b = (P = (M = (T = r.dataSource) == null ? void 0 : T.pathDataMappings) == null ? void 0 : M[r.id]) == null ? void 0 : P.dataCache) == null ? void 0 : b[h || f || "en"]
|
|
199
202
|
}
|
|
200
203
|
)
|
|
201
204
|
},
|
|
202
|
-
|
|
205
|
+
r.id
|
|
203
206
|
)
|
|
204
|
-
),
|
|
207
|
+
), I;
|
|
205
208
|
}),
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
return
|
|
209
|
-
|
|
209
|
+
i.map((u) => {
|
|
210
|
+
const r = c[u];
|
|
211
|
+
return r ? /* @__PURE__ */ e(
|
|
212
|
+
j,
|
|
210
213
|
{
|
|
211
|
-
path:
|
|
214
|
+
path: S(":projectIdOrSlug?", r.slug),
|
|
212
215
|
element: /* @__PURE__ */ e(
|
|
213
216
|
A,
|
|
214
217
|
{
|
|
215
218
|
mode: t,
|
|
216
219
|
components: w,
|
|
217
|
-
page:
|
|
218
|
-
locale:
|
|
220
|
+
page: r,
|
|
221
|
+
locale: h,
|
|
219
222
|
defaultLocale: f,
|
|
220
223
|
headerAddons: k
|
|
221
224
|
}
|
|
222
225
|
)
|
|
223
226
|
},
|
|
224
|
-
|
|
227
|
+
r.id
|
|
225
228
|
) : null;
|
|
226
229
|
}),
|
|
227
|
-
v.pages && Object.values(v.pages).map(({ blockletId: u, page:
|
|
228
|
-
|
|
230
|
+
v.pages && Object.values(v.pages).map(({ blockletId: u, page: r }) => /* @__PURE__ */ e(
|
|
231
|
+
j,
|
|
229
232
|
{
|
|
230
|
-
path:
|
|
233
|
+
path: S("/", `@${u}`, r.slug),
|
|
231
234
|
element: /* @__PURE__ */ e(
|
|
232
235
|
A,
|
|
233
236
|
{
|
|
234
237
|
mode: t,
|
|
235
238
|
components: w,
|
|
236
|
-
page:
|
|
237
|
-
locale:
|
|
239
|
+
page: r,
|
|
240
|
+
locale: h,
|
|
238
241
|
defaultLocale: f,
|
|
239
242
|
headerAddons: k
|
|
240
243
|
}
|
|
241
244
|
)
|
|
242
245
|
},
|
|
243
|
-
|
|
246
|
+
r.id
|
|
244
247
|
)),
|
|
245
248
|
/* @__PURE__ */ e(
|
|
246
|
-
|
|
249
|
+
j,
|
|
247
250
|
{
|
|
248
251
|
path: "*",
|
|
249
|
-
element: /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(
|
|
252
|
+
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: s("common.back") }) }) })
|
|
250
253
|
}
|
|
251
254
|
)
|
|
252
255
|
] }),
|
|
@@ -254,31 +257,31 @@ function H({ mode: t, state: n }) {
|
|
|
254
257
|
/* @__PURE__ */ e(Ke, {})
|
|
255
258
|
] });
|
|
256
259
|
}
|
|
257
|
-
function
|
|
260
|
+
function q({
|
|
258
261
|
mode: t,
|
|
259
262
|
pageData: n,
|
|
260
|
-
components:
|
|
261
|
-
page:
|
|
263
|
+
components: s,
|
|
264
|
+
page: a,
|
|
262
265
|
locale: l,
|
|
263
266
|
defaultLocale: o,
|
|
264
267
|
headerAddons: d,
|
|
265
|
-
state:
|
|
268
|
+
state: i
|
|
266
269
|
}) {
|
|
267
|
-
const c =
|
|
270
|
+
const c = ne({
|
|
268
271
|
page: null
|
|
269
272
|
});
|
|
270
273
|
F(() => {
|
|
271
|
-
const p =
|
|
274
|
+
const p = a || null;
|
|
272
275
|
p ? c.page = $(p) : c.page = null;
|
|
273
|
-
}, [
|
|
274
|
-
const g =
|
|
276
|
+
}, [a, c]);
|
|
277
|
+
const g = se();
|
|
275
278
|
return F(() => {
|
|
276
|
-
|
|
277
|
-
}, [c.page, n, l,
|
|
279
|
+
re(n, g.current) || n && c.page && (Y(c.page, i, l, n), g.current = $(n));
|
|
280
|
+
}, [c.page, n, l, i]), c.page ? /* @__PURE__ */ e(
|
|
278
281
|
A,
|
|
279
282
|
{
|
|
280
283
|
mode: t,
|
|
281
|
-
components:
|
|
284
|
+
components: s,
|
|
282
285
|
page: c.page,
|
|
283
286
|
locale: l,
|
|
284
287
|
defaultLocale: o,
|
|
@@ -289,35 +292,35 @@ function W({
|
|
|
289
292
|
function Tt({
|
|
290
293
|
mode: t,
|
|
291
294
|
state: n,
|
|
292
|
-
path:
|
|
293
|
-
pageData:
|
|
295
|
+
path: s,
|
|
296
|
+
pageData: a
|
|
294
297
|
}) {
|
|
295
|
-
const { t: l, locale: o } =
|
|
298
|
+
const { t: l, locale: o } = Q(), {
|
|
296
299
|
pages: d,
|
|
297
|
-
supportedLocales:
|
|
300
|
+
supportedLocales: i,
|
|
298
301
|
config: { defaultLocale: c },
|
|
299
302
|
resources: g
|
|
300
|
-
} = n, p = Object.values(d).find((y) => (y == null ? void 0 : y.slug) ===
|
|
301
|
-
() =>
|
|
302
|
-
[o,
|
|
303
|
-
), v =
|
|
303
|
+
} = n, p = Object.values(d).find((y) => (y == null ? void 0 : y.slug) === s), m = Object.values(g.pages || {}).find((y) => y.page.slug === s), f = R(
|
|
304
|
+
() => i != null && i.some((y) => y.locale === o) ? o : void 0,
|
|
305
|
+
[o, i]
|
|
306
|
+
), v = ne({
|
|
304
307
|
page: null
|
|
305
308
|
});
|
|
306
309
|
F(() => {
|
|
307
310
|
const y = p || (m == null ? void 0 : m.page) || null;
|
|
308
311
|
y ? v.page = $(y) : v.page = null;
|
|
309
312
|
}, [p, m]);
|
|
310
|
-
const w =
|
|
313
|
+
const w = se();
|
|
311
314
|
if (F(() => {
|
|
312
|
-
|
|
315
|
+
re(a, w.current) || a && v.page && (Y(v.page, n, f, a), w.current = $(a));
|
|
313
316
|
}, [{}]), !p && !(m != null && m.page))
|
|
314
|
-
return /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(
|
|
315
|
-
const
|
|
317
|
+
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") }) }) });
|
|
318
|
+
const h = K(n);
|
|
316
319
|
return v.page ? /* @__PURE__ */ e(
|
|
317
320
|
A,
|
|
318
321
|
{
|
|
319
322
|
mode: t,
|
|
320
|
-
components:
|
|
323
|
+
components: h,
|
|
321
324
|
page: v.page,
|
|
322
325
|
locale: f,
|
|
323
326
|
defaultLocale: c
|
|
@@ -327,28 +330,28 @@ function Tt({
|
|
|
327
330
|
function A({
|
|
328
331
|
mode: t,
|
|
329
332
|
components: n,
|
|
330
|
-
page:
|
|
331
|
-
locale:
|
|
333
|
+
page: s,
|
|
334
|
+
locale: a,
|
|
332
335
|
defaultLocale: l,
|
|
333
336
|
headerAddons: o
|
|
334
337
|
}) {
|
|
335
|
-
var E, _, k, u,
|
|
336
|
-
const d =
|
|
338
|
+
var E, _, k, u, r, C, I, T, M;
|
|
339
|
+
const d = be(), i = ((E = s.locales) == null ? void 0 : E[a]) ?? ((_ = s.locales) == null ? void 0 : _[l]) ?? {}, c = i.title || ((k = window.blocklet) == null ? void 0 : k.appName), g = i.description || ((u = window.blocklet) == null ? void 0 : u.appDescription), p = me(de(i.image), 540), { logo: m, brand: f, description: v, ...w } = he(), h = R(
|
|
337
340
|
() => (P) => {
|
|
338
341
|
var x;
|
|
339
|
-
let
|
|
340
|
-
return
|
|
342
|
+
let b = (o == null ? void 0 : o(P)) ?? P;
|
|
343
|
+
return b = ((x = w.addons) == null ? void 0 : x.call(w, b)) ?? b, b;
|
|
341
344
|
},
|
|
342
345
|
[w.addons, o]
|
|
343
|
-
), y = (
|
|
344
|
-
return /* @__PURE__ */ N(Le, { page:
|
|
346
|
+
), y = (r = i.header) != null && r.translucent ? et : ue;
|
|
347
|
+
return /* @__PURE__ */ N(Le, { page: s, defaultLocale: l, currentLocale: a, children: [
|
|
345
348
|
/* @__PURE__ */ e(
|
|
346
|
-
|
|
349
|
+
Z,
|
|
347
350
|
{
|
|
348
|
-
styles:
|
|
351
|
+
styles: ee`
|
|
349
352
|
body {
|
|
350
353
|
background-color: ${d(
|
|
351
|
-
!
|
|
354
|
+
!i.backgroundColor || i.backgroundColor === "transparent" ? "background.default" : i.backgroundColor
|
|
352
355
|
)} !important;
|
|
353
356
|
}
|
|
354
357
|
`
|
|
@@ -357,18 +360,18 @@ function A({
|
|
|
357
360
|
/* @__PURE__ */ e(
|
|
358
361
|
y,
|
|
359
362
|
{
|
|
360
|
-
hideNavMenu: !!((
|
|
361
|
-
translucentTextColor: (
|
|
363
|
+
hideNavMenu: !!((C = i.header) != null && C.hideNavMenus),
|
|
364
|
+
translucentTextColor: (I = i.header) == null ? void 0 : I.translucentTextColor,
|
|
362
365
|
...m ? { logo: m } : {},
|
|
363
366
|
...f ? { brand: f } : {},
|
|
364
367
|
...v ? { description: v } : {},
|
|
365
|
-
className:
|
|
368
|
+
className: J(((T = i.header) == null ? void 0 : T.sticky) && "sticky", "page-header"),
|
|
366
369
|
maxWidth: !1,
|
|
367
|
-
addons:
|
|
370
|
+
addons: h
|
|
368
371
|
}
|
|
369
372
|
),
|
|
370
|
-
/* @__PURE__ */ e(
|
|
371
|
-
/* @__PURE__ */ N(
|
|
373
|
+
/* @__PURE__ */ e(Be, {}),
|
|
374
|
+
/* @__PURE__ */ N(Ee, { children: [
|
|
372
375
|
/* @__PURE__ */ e("title", { children: c }),
|
|
373
376
|
/* @__PURE__ */ e("meta", { name: "og:title", content: c }),
|
|
374
377
|
/* @__PURE__ */ e("meta", { name: "og:description", content: g }),
|
|
@@ -380,7 +383,7 @@ function A({
|
|
|
380
383
|
/* @__PURE__ */ e("meta", { name: "description", content: g })
|
|
381
384
|
] }),
|
|
382
385
|
/* @__PURE__ */ e(
|
|
383
|
-
|
|
386
|
+
xe,
|
|
384
387
|
{
|
|
385
388
|
flexGrow: 1,
|
|
386
389
|
className: "PageView-root",
|
|
@@ -390,21 +393,21 @@ function A({
|
|
|
390
393
|
pt: "0 !important"
|
|
391
394
|
}
|
|
392
395
|
},
|
|
393
|
-
children:
|
|
396
|
+
children: s.sectionIds.map((P) => {
|
|
394
397
|
var B, O;
|
|
395
|
-
const
|
|
396
|
-
if (!
|
|
397
|
-
const x = (B =
|
|
398
|
+
const b = s.sections[P];
|
|
399
|
+
if (!b || b.visibility === "hidden") return null;
|
|
400
|
+
const x = (B = b.locales) == null ? void 0 : B[a], D = ((O = b.locales) == null ? void 0 : O[l]) ?? {};
|
|
398
401
|
return /* @__PURE__ */ e(
|
|
399
402
|
_e,
|
|
400
403
|
{
|
|
401
404
|
id: P,
|
|
402
|
-
type:
|
|
405
|
+
type: b.component,
|
|
403
406
|
mode: t,
|
|
404
|
-
section:
|
|
407
|
+
section: b,
|
|
405
408
|
config: {
|
|
406
|
-
...
|
|
407
|
-
locale:
|
|
409
|
+
...Ie(x) ? D : x,
|
|
410
|
+
locale: a,
|
|
408
411
|
dev: t === "draft" ? {
|
|
409
412
|
mode: t,
|
|
410
413
|
components: n,
|
|
@@ -417,20 +420,20 @@ function A({
|
|
|
417
420
|
})
|
|
418
421
|
}
|
|
419
422
|
),
|
|
420
|
-
!((M =
|
|
423
|
+
!((M = i.footer) != null && M.hidden) && /* @__PURE__ */ e(Ve, {})
|
|
421
424
|
] });
|
|
422
425
|
}
|
|
423
|
-
const Je =
|
|
426
|
+
const Je = ae(() => import("./publish-button-BJSEYd0m.js")), ue = te(ve)`
|
|
424
427
|
&.sticky {
|
|
425
428
|
position: sticky;
|
|
426
429
|
top: 0;
|
|
427
430
|
}
|
|
428
431
|
`;
|
|
429
432
|
function Ze({ logo: t }) {
|
|
430
|
-
const [n,
|
|
431
|
-
var
|
|
433
|
+
const [n, s] = Re(), a = ke((o) => o.breakpoints.down("sm")), { value: l } = le(() => {
|
|
434
|
+
var i, c;
|
|
432
435
|
const o = new URL(
|
|
433
|
-
|
|
436
|
+
a ? ((i = window == null ? void 0 : window.blocklet) == null ? void 0 : i.appLogo) || "/.well-known/service/blocklet/logo" : ((c = window == null ? void 0 : window.blocklet) == null ? void 0 : c.appLogoRect) || "/.well-known/service/blocklet/logo-rect",
|
|
434
437
|
window.location.origin
|
|
435
438
|
);
|
|
436
439
|
o.searchParams.delete("imageFilter"), o.searchParams.delete("f");
|
|
@@ -439,15 +442,15 @@ function Ze({ logo: t }) {
|
|
|
439
442
|
fetch(d).then((p) => {
|
|
440
443
|
const m = p.headers.get("content-type");
|
|
441
444
|
m != null && m.includes("svg") && p.text().then((f) => {
|
|
442
|
-
|
|
445
|
+
s(f), g(null);
|
|
443
446
|
}), g(p.url);
|
|
444
447
|
});
|
|
445
448
|
});
|
|
446
|
-
}, [
|
|
449
|
+
}, [a]);
|
|
447
450
|
if (t)
|
|
448
451
|
return t;
|
|
449
452
|
if (n)
|
|
450
|
-
return /* @__PURE__ */ e(L, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html:
|
|
453
|
+
return /* @__PURE__ */ e(L, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Ce.sanitize(n) } });
|
|
451
454
|
if (l) {
|
|
452
455
|
const o = new URL(l);
|
|
453
456
|
o.searchParams.set("imageFilter", "convert"), o.searchParams.set("f", "png"), o.searchParams.set("h", "80");
|
|
@@ -459,16 +462,16 @@ function Ze({ logo: t }) {
|
|
|
459
462
|
function et({
|
|
460
463
|
logo: t,
|
|
461
464
|
translucentTextColor: n,
|
|
462
|
-
...
|
|
465
|
+
...s
|
|
463
466
|
}) {
|
|
464
|
-
const { top:
|
|
465
|
-
let o = Math.min(
|
|
467
|
+
const { top: a = 0 } = Se(() => document.getElementById("app")) || {}, l = oe();
|
|
468
|
+
let o = Math.min(a / 800, 1), d = "";
|
|
466
469
|
return o > 0.1 ? (o = Math.max(o, 0.6), d = G(l.palette.text.primary, o)) : d = n || "#EEEEEE", /* @__PURE__ */ e(
|
|
467
|
-
|
|
470
|
+
ue,
|
|
468
471
|
{
|
|
469
472
|
logo: /* @__PURE__ */ e(Ze, { logo: t }),
|
|
470
|
-
...
|
|
471
|
-
className:
|
|
473
|
+
...s,
|
|
474
|
+
className: J(o <= 0.7 && "reverse-color"),
|
|
472
475
|
style: {
|
|
473
476
|
backgroundColor: G(l.palette.background.default, o),
|
|
474
477
|
// @ts-ignore
|
|
@@ -500,14 +503,14 @@ function et({
|
|
|
500
503
|
}
|
|
501
504
|
);
|
|
502
505
|
}
|
|
503
|
-
const
|
|
506
|
+
const pe = te(Pe)``;
|
|
504
507
|
export {
|
|
505
508
|
Et as H,
|
|
506
509
|
ze as L,
|
|
507
510
|
H as P,
|
|
508
511
|
et as T,
|
|
509
512
|
Qe as a,
|
|
510
|
-
|
|
513
|
+
q as b,
|
|
511
514
|
Tt as c,
|
|
512
515
|
A as d
|
|
513
516
|
};
|
|
@@ -10,7 +10,7 @@ import { produce as Oe } from "immer";
|
|
|
10
10
|
import ee from "lodash/difference";
|
|
11
11
|
import { useState as T, useMemo as R, useCallback as j, forwardRef as Te, useImperativeHandle as je, useEffect as $, useRef as ve } from "react";
|
|
12
12
|
import { useAsync as Re } from "react-use";
|
|
13
|
-
import { L as ze } from "./home-
|
|
13
|
+
import { L as ze } from "./home-BB778Odl.js";
|
|
14
14
|
import { p as Le, g as Be } from "./array-B1QKSYbX.js";
|
|
15
15
|
function Ee(s) {
|
|
16
16
|
const [y, w] = T(!1);
|
package/lib/es/home.js
CHANGED
|
@@ -22,7 +22,7 @@ import "react-router-dom";
|
|
|
22
22
|
import "react-use";
|
|
23
23
|
import "ufo";
|
|
24
24
|
import "./chunks/array-B1QKSYbX.js";
|
|
25
|
-
import { a as R, P as S, d as W, c as j, b as k, T as q, H as v } from "./chunks/home-
|
|
25
|
+
import { a as R, P as S, d as W, c as j, b as k, T as q, H as v } from "./chunks/home-BB778Odl.js";
|
|
26
26
|
import "./chunks/session-CVblGhSp.js";
|
|
27
27
|
export {
|
|
28
28
|
R as HomeView,
|