@blocklet/pages-kit-inner-components 0.5.35 → 0.5.37
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 +2 -2
- package/lib/cjs/chunks/{array-DxhrK2d5.js → array-Cr5KF-hM.js} +1 -1
- package/lib/cjs/chunks/{config-string-DqWgB7yO.js → config-string-BYZ5HfyY.js} +1 -1
- package/lib/cjs/chunks/{draft-data-DzN2u_NT.js → draft-data-6zW9mu28.js} +1 -1
- package/lib/cjs/chunks/{home-0fezWT4S.js → home-C0ZSLVcc.js} +3 -3
- package/lib/cjs/chunks/{publish-button-D2jaaXXn.js → publish-button-CPmErdXB.js} +1 -1
- package/lib/cjs/chunks/site-state-CIPfhJn5.js +57 -0
- package/lib/cjs/chunks/state-BWuBNdK8.js +1 -0
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/project-html.js +5 -5
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +2 -2
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/add-component.js +4 -4
- package/lib/es/chunks/{array-D6qyZucY.js → array-D34Qpnhk.js} +1 -1
- package/lib/es/chunks/{config-string-Btybe5Rd.js → config-string-DgK7ETCs.js} +1 -1
- package/lib/es/chunks/{draft-data-DQ7_JyJX.js → draft-data-B5kzDvTI.js} +1 -1
- package/lib/es/chunks/{home-Dox9JwvF.js → home-B1ALs6m4.js} +4 -4
- package/lib/es/chunks/{publish-button-T2YJBoty.js → publish-button-9J9uRZtS.js} +3 -3
- package/lib/es/chunks/site-state-CfrteYXm.js +2137 -0
- package/lib/es/chunks/{state-NhsHvaKm.js → state-BzwEX9VC.js} +204 -200
- package/lib/es/components.js +1 -1
- package/lib/es/home.js +3 -3
- package/lib/es/project-html.js +16 -16
- package/lib/es/resources.js +1 -1
- package/lib/es/setting.js +617 -610
- package/lib/es/site-state.js +1 -1
- package/package.json +3 -3
- package/lib/cjs/chunks/site-state-D00xEf4T.js +0 -57
- package/lib/cjs/chunks/state-DoGBMTzI.js +0 -1
- package/lib/es/chunks/site-state-nXcBqjeR.js +0 -2076
package/lib/es/components.js
CHANGED
|
@@ -7,7 +7,7 @@ import "lru-cache";
|
|
|
7
7
|
import "node-fetch";
|
|
8
8
|
import "ufo";
|
|
9
9
|
import "crypto";
|
|
10
|
-
import { c as _, G as E, d as i, e as d, j as l, k as N, m as O, h as P, g as c, f as g } from "./chunks/site-state-
|
|
10
|
+
import { c as _, G as E, d as i, e as d, j as l, k as N, m as O, h as P, g as c, f as g } from "./chunks/site-state-CfrteYXm.js";
|
|
11
11
|
export {
|
|
12
12
|
_ as CUSTOM_COMPONENT_CACHE_DURATION_IN_SECONDS,
|
|
13
13
|
E as GET_SERVER_SIDE_PROPS_TIMEOUT_IN_SECONDS,
|
package/lib/es/home.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "./chunks/state-
|
|
2
|
+
import "./chunks/state-BzwEX9VC.js";
|
|
3
3
|
import "@arcblock/ux/lib/Locale/context";
|
|
4
4
|
import "@arcblock/ux/lib/Result";
|
|
5
5
|
import "@blocklet/pages-kit/builtin/page/header";
|
|
@@ -21,8 +21,8 @@ import "react-helmet";
|
|
|
21
21
|
import "react-router-dom";
|
|
22
22
|
import "react-use";
|
|
23
23
|
import "ufo";
|
|
24
|
-
import "./chunks/array-
|
|
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-
|
|
24
|
+
import "./chunks/array-D34Qpnhk.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-B1ALs6m4.js";
|
|
26
26
|
import "./chunks/session-CVblGhSp.js";
|
|
27
27
|
export {
|
|
28
28
|
R as HomeView,
|
package/lib/es/project-html.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import l, { getBlockletJs as
|
|
3
|
-
import
|
|
1
|
+
import U from "@arcblock/did-auth-storage-nedb";
|
|
2
|
+
import l, { getBlockletJs as O } from "@blocklet/sdk/lib/config";
|
|
3
|
+
import H from "@blocklet/sdk/lib/service/auth";
|
|
4
4
|
import R from "@blocklet/sdk/lib/wallet";
|
|
5
5
|
import J from "@blocklet/sdk/lib/wallet-authenticator";
|
|
6
6
|
import z from "@blocklet/sdk/lib/wallet-handler";
|
|
7
7
|
import G, { resolve as x } from "path";
|
|
8
|
-
import { l as T, g as Y } from "./chunks/site-state-
|
|
8
|
+
import { l as T, g as Y } from "./chunks/site-state-CfrteYXm.js";
|
|
9
9
|
import { createSnapshotMiddleware as Q } from "@arcblock/crawler-middleware";
|
|
10
10
|
import { PreloadComponentScriptModule as V } from "@blocklet/pages-kit/types";
|
|
11
11
|
import { isMuiColorKey as X } from "@blocklet/pages-kit/utils/common";
|
|
@@ -47,11 +47,11 @@ R();
|
|
|
47
47
|
const re = new J();
|
|
48
48
|
new z({
|
|
49
49
|
authenticator: re,
|
|
50
|
-
tokenStorage: new
|
|
50
|
+
tokenStorage: new U({
|
|
51
51
|
dbPath: G.join(l.env.dataDir, "auth.db")
|
|
52
52
|
})
|
|
53
53
|
});
|
|
54
|
-
const ce = new
|
|
54
|
+
const ce = new H(), ie = async () => {
|
|
55
55
|
try {
|
|
56
56
|
const o = j.get("blockletInfo");
|
|
57
57
|
if (o)
|
|
@@ -99,7 +99,7 @@ function Pe({
|
|
|
99
99
|
_();
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
const y = performance.now(), C = () => Math.round(performance.now() - y),
|
|
102
|
+
const y = performance.now(), C = () => Math.round(performance.now() - y), B = "production";
|
|
103
103
|
let c, u, S = d;
|
|
104
104
|
if (n.path.startsWith("/pages")) {
|
|
105
105
|
const s = n.params.lang, m = n.cookies.nf_lang, b = /* @__PURE__ */ new Set([...l.env.languages.map((w) => w.code)]);
|
|
@@ -107,7 +107,7 @@ function Pe({
|
|
|
107
107
|
if ((!g || !((E = e.supportedLocales) != null && E.find((w) => w.locale === g))) && (g = ((A = (P = e.supportedLocales) == null ? void 0 : P[0]) == null ? void 0 : A.locale) || ""), g) {
|
|
108
108
|
const w = [];
|
|
109
109
|
Object.values(e.pages).forEach((i) => {
|
|
110
|
-
const
|
|
110
|
+
const N = Object.values((i == null ? void 0 : i.sections) ?? {}).filter(
|
|
111
111
|
(p) => {
|
|
112
112
|
var v;
|
|
113
113
|
return p.component === "custom-component" && ((v = p.config) == null ? void 0 : v.componentId);
|
|
@@ -123,18 +123,18 @@ function Pe({
|
|
|
123
123
|
// ?? i.locales?.[respectLocale!]?.properties,
|
|
124
124
|
};
|
|
125
125
|
});
|
|
126
|
-
w.push(...
|
|
126
|
+
w.push(...N);
|
|
127
127
|
});
|
|
128
|
-
const
|
|
128
|
+
const K = new Promise((i) => {
|
|
129
129
|
setTimeout(() => {
|
|
130
130
|
i({});
|
|
131
131
|
}, 90 * 1e3);
|
|
132
132
|
});
|
|
133
133
|
try {
|
|
134
134
|
await Promise.race([
|
|
135
|
-
|
|
135
|
+
K,
|
|
136
136
|
Y({
|
|
137
|
-
mode:
|
|
137
|
+
mode: B,
|
|
138
138
|
req: n,
|
|
139
139
|
state: e,
|
|
140
140
|
locale: g,
|
|
@@ -162,7 +162,7 @@ function Pe({
|
|
|
162
162
|
});
|
|
163
163
|
} catch {
|
|
164
164
|
}
|
|
165
|
-
const r = e == null ? void 0 : e.config.fontFamily,
|
|
165
|
+
const r = e == null ? void 0 : e.config.fontFamily, D = n.query.mode === "draft" || n.url.includes("preview"), f = M.load(S);
|
|
166
166
|
let a = c == null ? void 0 : c.backgroundColor;
|
|
167
167
|
if (a && X(a)) {
|
|
168
168
|
const s = await ie();
|
|
@@ -179,7 +179,7 @@ function Pe({
|
|
|
179
179
|
${r != null && r.description && (r == null ? void 0 : r.description) !== (r == null ? void 0 : r.title) ? `<link rel="preload" as="style" href="https://fonts.googleapis.com/css?family=${r.description}&display=swap">` : ""}
|
|
180
180
|
<script>
|
|
181
181
|
|
|
182
|
-
window.__PAGE_STATE__ = ${JSON.stringify(e, null, 0)}
|
|
182
|
+
window.__PAGE_STATE__ = JSON.parse(atob('${Buffer.from(JSON.stringify(e, null, 0) || "", "utf8").toString("base64")}'));
|
|
183
183
|
|
|
184
184
|
document.querySelectorAll('link[rel="preload"][as="style"]').forEach(function (link) {
|
|
185
185
|
const l = document.createElement('link');
|
|
@@ -189,14 +189,14 @@ function Pe({
|
|
|
189
189
|
});
|
|
190
190
|
<\/script>
|
|
191
191
|
|
|
192
|
-
${
|
|
192
|
+
${D ? `<script src="https://cdn.tailwindcss.com"><\/script>
|
|
193
193
|
<script>
|
|
194
194
|
window.tailwind.config = {
|
|
195
195
|
darkMode: "class",
|
|
196
196
|
};
|
|
197
197
|
<\/script>` : ""}
|
|
198
198
|
`);
|
|
199
|
-
const I =
|
|
199
|
+
const I = O();
|
|
200
200
|
if (I && f('script[src="__blocklet__.js"]').replaceWith(`<script>${I}<\/script>`), u != null && u.html && f("head").find("#injected-html-elements").replaceWith(u.html), n.cachedHtml) {
|
|
201
201
|
const s = M.load(n.cachedHtml);
|
|
202
202
|
f("body").html(s("body").html() || "");
|
package/lib/es/resources.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as S, i as b, a as M, l as x, C as J, R as X, S as N, t as W, b as G } from "./chunks/site-state-
|
|
1
|
+
import { P as S, i as b, a as M, l as x, C as J, R as X, S as N, t as W, b as G } from "./chunks/site-state-CfrteYXm.js";
|
|
2
2
|
import { AsyncLocalStorage as K } from "async_hooks";
|
|
3
3
|
import { Router as Y } from "express";
|
|
4
4
|
import d from "fs";
|