@blocklet/pages-kit-inner-components 0.5.28 → 0.5.29
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/project-html.js +6 -6
- package/lib/es/project-html.js +113 -121
- package/package.json +3 -4
package/lib/cjs/project-html.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";const
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
1
|
+
"use strict";const B=require("@arcblock/did-auth-storage-nedb"),O=require("@blocklet/sdk/lib/config"),H=require("@blocklet/sdk/lib/service/auth"),R=require("@blocklet/sdk/lib/wallet"),z=require("@blocklet/sdk/lib/wallet-authenticator"),J=require("@blocklet/sdk/lib/wallet-handler"),P=require("path"),C=require("./chunks/site-state-JgP3yURe.js"),G=require("@arcblock/crawler-middleware"),Y=require("@blocklet/pages-kit/types"),Q=require("@blocklet/pages-kit/utils/common"),V=require("@blocklet/pages-kit/utils/preload"),X=require("@blocklet/sdk/lib/component"),Z=require("cheerio/slim"),F=require("express"),x=require("fs"),ee=require("lodash/get"),te=require("mustache"),I=require("ufo"),d=n=>n&&n.__esModule?n:{default:n};function ne(n){if(n&&n.__esModule)return n;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const oe=d(B),s=d(O),ce=d(H),le=d(R),re=d(z),se=d(J),ae=d(P),W=ne(Z),ie=d(ee),de=d(te),ue=(n={})=>{const t={data:new Map,timers:new Map,set:(e,i,h=n.ttl||36e5)=>{n.max&&t.data.size>=n.max&&t.delete(t.data.keys().next().value),t.timers.has(e)&&clearTimeout(t.timers.get(e)),t.timers.set(e,setTimeout(()=>t.delete(e),h)),t.data.set(e,i)},get:e=>t.data.get(e),has:e=>t.data.has(e),delete:e=>(t.timers.has(e)&&clearTimeout(t.timers.get(e)),t.timers.delete(e),t.data.delete(e)),clear:()=>{t.data.clear();for(const e of t.timers.values())clearTimeout(e);t.timers.clear()}};return t},L=ue({max:1,ttl:1e3*30});le.default();const pe=new re.default;new se.default({authenticator:pe,tokenStorage:new oe.default({dbPath:ae.default.join(s.default.env.dataDir,"auth.db")})});const fe=new ce.default,he=async()=>{try{const n=L.get("blockletInfo");if(n)return n;const{blocklet:t}=await fe.getBlocklet();return L.set("blockletInfo",t),t}catch{return null}},me=["/assets/"];function ge({app:n,viteDevServer:t,state:e}){let i;if(t){const o=x.readFileSync(P.resolve(process.cwd(),"./index.html"),"utf-8");n.use(async(b,v,T)=>{const A=b.originalUrl;i=await t.transformIndexHtml(A,o),T()})}else i=x.readFileSync(P.resolve(process.env.BLOCKLET_APP_DIR,"dist/index.html"),"utf-8");const h=F.Router();h.use((o,b,v)=>{if(o.headers["x-unique-record"]==="dial_http"){C.logger.info("[html] dial http request, return 200 status code"),b.status(200).send("ok");return}v()}),s.default.env.preferences.snapkitEnabled&&s.default.env.preferences.snapkitEndpoint&&s.default.env.SNAP_KIT_ACCESS_KEY&&h.use(G.createSnapshotMiddleware({endpoint:s.default.env.preferences.snapkitEndpoint,accessKey:s.default.env.SNAP_KIT_ACCESS_KEY,cacheMax:s.default.env.preferences.snapkitCacheSize||100})),h.get("/:path(*)?",async(o,b,v)=>{var E,M,j;if(me.some(r=>{var p;return(p=o.path)==null?void 0:p.startsWith(r)})){v();return}const T=performance.now(),A=()=>Math.round(performance.now()-T),D="production";let l,m,k=i;if(o.path.startsWith("/pages")){const r=o.params.lang,p=o.cookies.nf_lang,S=new Set([...s.default.env.languages.map(w=>w.code)]);let _=(r&&S.has(r)?r:void 0)||(S.has(p)?p:void 0)||[...S][0];if((!_||!((E=e.supportedLocales)!=null&&E.find(w=>w.locale===_)))&&(_=((j=(M=e.supportedLocales)==null?void 0:M[0])==null?void 0:j.locale)||""),_){const w=[];Object.values(e.pages).forEach(a=>{const N=Object.values((a==null?void 0:a.sections)??{}).filter(f=>{var y;return f.component==="custom-component"&&((y=f.config)==null?void 0:y.componentId)}).map(f=>{var y,$;return{id:f.id,componentId:f.config.componentId,useCache:f.config.useCache,cacheDuration:f.config.cacheDuration,properties:($=(y=f.locales)==null?void 0:y[_])==null?void 0:$.properties}});w.push(...N)});const K=new Promise(a=>{setTimeout(()=>{a({})},90*1e3)});try{await Promise.race([K,C.getPreloadComponents({mode:D,req:o,state:e,locale:_,instances:w,module:Y.PreloadComponentScriptModule.UMD_FN}).then(a=>{a&&(m=V.injectPreloadComponents(a))})])}catch(a){C.logger.warn("getPreloadComponents timeout in promise race, skip inject html elements",a)}}}try{const r=(l==null?void 0:l.title)||s.default.env.appName,p=(l==null?void 0:l.description)||s.default.env.appDescription,S=I.withQuery(I.joinURL(s.default.env.appUrl,"/.well-known/service/blocklet/og.png"),{title:r,description:p});k=de.default.render(i,{ogTitle:r,ogDescription:p,ogImage:_e(l==null?void 0:l.image)||S,pagesPublishedAt:(e==null?void 0:e.config.publishedAt)||new Date().getTime()})}catch{}const c=e==null?void 0:e.config.fontFamily,U=o.query.mode==="draft"||o.url.includes("preview"),g=W.load(k);let u=l==null?void 0:l.backgroundColor;if(u&&Q.isMuiColorKey(u)){const r=await he();u=ie.default(r,`settings.theme.light.palette.${u}`,u)}g("head").find("#injected-head-elements").replaceWith(`
|
|
2
|
+
${u?`<meta name="theme-color" content="${u}" /><style>html,body,#app {background-color: ${u};}</style>`:""}
|
|
3
|
+
${c!=null&&c.title?`<link rel="preload" as="style" href="https://fonts.googleapis.com/css?family=${c.title}&display=swap">`:""}
|
|
4
|
+
${c!=null&&c.description&&(c==null?void 0:c.description)!==(c==null?void 0:c.title)?`<link rel="preload" as="style" href="https://fonts.googleapis.com/css?family=${c.description}&display=swap">`:""}
|
|
5
5
|
<script>
|
|
6
6
|
|
|
7
7
|
window.__PAGE_STATE__ = ${JSON.stringify(e,null,0)}
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
});
|
|
15
15
|
<\/script>
|
|
16
16
|
|
|
17
|
-
${
|
|
17
|
+
${U?`<script src="https://cdn.tailwindcss.com"><\/script>
|
|
18
18
|
<script>
|
|
19
19
|
window.tailwind.config = {
|
|
20
20
|
darkMode: "class",
|
|
21
21
|
};
|
|
22
22
|
<\/script>`:""}
|
|
23
|
-
`);const
|
|
23
|
+
`);const q=O.getBlockletJs();if(q&&g('script[src="__blocklet__.js"]').replaceWith(`<script>${q}<\/script>`),m!=null&&m.html&&g("head").find("#injected-html-elements").replaceWith(m.html),o.cachedHtml){const r=W.load(o.cachedHtml);g("body").html(r("body").html()||"")}k=g.html(),b.send(k),C.logger.info(`[html] render: ${o.path}, ${A()}ms`),g.root().children().remove(),k=null,l=null,m=null}),n.use(h)}function _e(n){const t=X.getComponentMountPoint("image-bin");return t&&n&&!/^(https?:\/\/|\/)/.test(n)?s.default.env.appUrl+I.joinURL(t,"uploads",n):n}module.exports=ge;
|
package/lib/es/project-html.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import N from "@arcblock/did-auth-storage-nedb";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { l as
|
|
9
|
-
import {
|
|
10
|
-
import { PreloadComponentScriptModule as
|
|
11
|
-
import { isMuiColorKey as
|
|
12
|
-
import { injectPreloadComponents as
|
|
13
|
-
import { getComponentMountPoint as
|
|
14
|
-
import * as
|
|
15
|
-
import { Router as
|
|
16
|
-
import { readFileSync as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { withQuery as
|
|
20
|
-
const
|
|
2
|
+
import i, { getBlockletJs as H } from "@blocklet/sdk/lib/config";
|
|
3
|
+
import O from "@blocklet/sdk/lib/service/auth";
|
|
4
|
+
import R from "@blocklet/sdk/lib/wallet";
|
|
5
|
+
import J from "@blocklet/sdk/lib/wallet-authenticator";
|
|
6
|
+
import z from "@blocklet/sdk/lib/wallet-handler";
|
|
7
|
+
import G, { resolve as x } from "path";
|
|
8
|
+
import { l as T, g as Y } from "./chunks/site-state-BB9-Tm4i.js";
|
|
9
|
+
import { createSnapshotMiddleware as Q } from "@arcblock/crawler-middleware";
|
|
10
|
+
import { PreloadComponentScriptModule as V } from "@blocklet/pages-kit/types";
|
|
11
|
+
import { isMuiColorKey as X } from "@blocklet/pages-kit/utils/common";
|
|
12
|
+
import { injectPreloadComponents as Z } from "@blocklet/pages-kit/utils/preload";
|
|
13
|
+
import { getComponentMountPoint as q } from "@blocklet/sdk/lib/component";
|
|
14
|
+
import * as M from "cheerio/slim";
|
|
15
|
+
import { Router as F } from "express";
|
|
16
|
+
import { readFileSync as L } from "fs";
|
|
17
|
+
import ee from "lodash/get";
|
|
18
|
+
import te from "mustache";
|
|
19
|
+
import { withQuery as oe, joinURL as W } from "ufo";
|
|
20
|
+
const ne = (o = {}) => {
|
|
21
21
|
const t = {
|
|
22
22
|
data: /* @__PURE__ */ new Map(),
|
|
23
23
|
timers: /* @__PURE__ */ new Map(),
|
|
24
|
-
set: (e, d,
|
|
24
|
+
set: (e, d, h = o.ttl || 36e5) => {
|
|
25
25
|
o.max && t.data.size >= o.max && t.delete(t.data.keys().next().value), t.timers.has(e) && clearTimeout(t.timers.get(e)), t.timers.set(
|
|
26
26
|
e,
|
|
27
|
-
setTimeout(() => t.delete(e),
|
|
27
|
+
setTimeout(() => t.delete(e), h)
|
|
28
28
|
), t.data.set(e, d);
|
|
29
29
|
},
|
|
30
30
|
get: (e) => t.data.get(e),
|
|
@@ -38,39 +38,31 @@ const ce = (o = {}) => {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
return t;
|
|
41
|
-
}, j =
|
|
41
|
+
}, j = ne({
|
|
42
42
|
max: 1,
|
|
43
43
|
ttl: 1e3 * 30
|
|
44
44
|
// 30 seconds
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
new
|
|
49
|
-
authenticator:
|
|
46
|
+
R();
|
|
47
|
+
const re = new J();
|
|
48
|
+
new z({
|
|
49
|
+
authenticator: re,
|
|
50
50
|
tokenStorage: new N({
|
|
51
|
-
dbPath:
|
|
51
|
+
dbPath: G.join(i.env.dataDir, "auth.db")
|
|
52
52
|
})
|
|
53
53
|
});
|
|
54
|
-
const
|
|
54
|
+
const ce = new O(), se = async () => {
|
|
55
55
|
try {
|
|
56
56
|
const o = j.get("blockletInfo");
|
|
57
57
|
if (o)
|
|
58
58
|
return o;
|
|
59
|
-
const { blocklet: t } = await
|
|
59
|
+
const { blocklet: t } = await ce.getBlocklet();
|
|
60
60
|
return j.set("blockletInfo", t), t;
|
|
61
61
|
} catch {
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
function
|
|
66
|
-
B() ? Y({
|
|
67
|
-
time: "0 0 */12 * * *",
|
|
68
|
-
options: {}
|
|
69
|
-
}) : Z();
|
|
70
|
-
}
|
|
71
|
-
U();
|
|
72
|
-
s.events.on(s.Events.envUpdate, U);
|
|
73
|
-
function Le({
|
|
64
|
+
}, ie = ["/assets/"];
|
|
65
|
+
function Pe({
|
|
74
66
|
app: o,
|
|
75
67
|
viteDevServer: t,
|
|
76
68
|
// projectId,
|
|
@@ -78,112 +70,112 @@ function Le({
|
|
|
78
70
|
}) {
|
|
79
71
|
let d;
|
|
80
72
|
if (t) {
|
|
81
|
-
const
|
|
82
|
-
o.use(async (
|
|
83
|
-
const
|
|
84
|
-
d = await t.transformIndexHtml(
|
|
73
|
+
const n = L(x(process.cwd(), "./index.html"), "utf-8");
|
|
74
|
+
o.use(async (k, _, y) => {
|
|
75
|
+
const C = k.originalUrl;
|
|
76
|
+
d = await t.transformIndexHtml(C, n), y();
|
|
85
77
|
});
|
|
86
78
|
} else
|
|
87
|
-
d =
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
d = L(x(process.env.BLOCKLET_APP_DIR, "dist/index.html"), "utf-8");
|
|
80
|
+
const h = F();
|
|
81
|
+
h.use((n, k, _) => {
|
|
82
|
+
if (n.headers["x-unique-record"] === "dial_http") {
|
|
83
|
+
T.info("[html] dial http request, return 200 status code"), k.status(200).send("ok");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
_();
|
|
87
|
+
}), i.env.preferences.snapkitEnabled && i.env.preferences.snapkitEndpoint && i.env.SNAP_KIT_ACCESS_KEY && h.use(
|
|
88
|
+
Q({
|
|
89
|
+
endpoint: i.env.preferences.snapkitEndpoint,
|
|
90
|
+
accessKey: i.env.SNAP_KIT_ACCESS_KEY,
|
|
91
|
+
cacheMax: i.env.preferences.snapkitCacheSize || 100
|
|
100
92
|
})
|
|
101
|
-
),
|
|
102
|
-
var
|
|
103
|
-
if (
|
|
104
|
-
var
|
|
105
|
-
return (
|
|
93
|
+
), h.get("/:path(*)?", async (n, k, _) => {
|
|
94
|
+
var E, P, A;
|
|
95
|
+
if (ie.some((s) => {
|
|
96
|
+
var p;
|
|
97
|
+
return (p = n.path) == null ? void 0 : p.startsWith(s);
|
|
106
98
|
})) {
|
|
107
|
-
|
|
99
|
+
_();
|
|
108
100
|
return;
|
|
109
101
|
}
|
|
110
|
-
const
|
|
111
|
-
let
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
let
|
|
115
|
-
if ((!
|
|
116
|
-
const
|
|
117
|
-
Object.values(e.pages).forEach((
|
|
118
|
-
const
|
|
119
|
-
(
|
|
120
|
-
var
|
|
121
|
-
return
|
|
102
|
+
const y = performance.now(), C = () => Math.round(performance.now() - y), D = "production";
|
|
103
|
+
let c, u, b = d;
|
|
104
|
+
if (n.path.startsWith("/pages")) {
|
|
105
|
+
const s = n.params.lang, p = n.cookies.nf_lang, v = /* @__PURE__ */ new Set([...i.env.languages.map((w) => w.code)]);
|
|
106
|
+
let g = (s && v.has(s) ? s : void 0) || (v.has(p) ? p : void 0) || [...v][0];
|
|
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
|
+
const w = [];
|
|
109
|
+
Object.values(e.pages).forEach((l) => {
|
|
110
|
+
const B = Object.values((l == null ? void 0 : l.sections) ?? {}).filter(
|
|
111
|
+
(m) => {
|
|
112
|
+
var S;
|
|
113
|
+
return m.component === "custom-component" && ((S = m.config) == null ? void 0 : S.componentId);
|
|
122
114
|
}
|
|
123
|
-
).map((
|
|
124
|
-
var
|
|
115
|
+
).map((m) => {
|
|
116
|
+
var S, $;
|
|
125
117
|
return {
|
|
126
|
-
id:
|
|
127
|
-
componentId:
|
|
128
|
-
useCache:
|
|
129
|
-
cacheDuration:
|
|
130
|
-
properties: (
|
|
118
|
+
id: m.id,
|
|
119
|
+
componentId: m.config.componentId,
|
|
120
|
+
useCache: m.config.useCache,
|
|
121
|
+
cacheDuration: m.config.cacheDuration,
|
|
122
|
+
properties: ($ = (S = m.locales) == null ? void 0 : S[g]) == null ? void 0 : $.properties
|
|
131
123
|
};
|
|
132
124
|
});
|
|
133
|
-
|
|
125
|
+
w.push(...B);
|
|
134
126
|
});
|
|
135
|
-
const
|
|
127
|
+
const U = new Promise((l) => {
|
|
136
128
|
setTimeout(() => {
|
|
137
|
-
|
|
129
|
+
l({});
|
|
138
130
|
}, 90 * 1e3);
|
|
139
131
|
});
|
|
140
132
|
try {
|
|
141
133
|
await Promise.race([
|
|
142
|
-
|
|
143
|
-
|
|
134
|
+
U,
|
|
135
|
+
Y({
|
|
144
136
|
mode: D,
|
|
145
|
-
req:
|
|
137
|
+
req: n,
|
|
146
138
|
state: e,
|
|
147
|
-
locale:
|
|
148
|
-
instances:
|
|
149
|
-
module:
|
|
150
|
-
}).then((
|
|
151
|
-
|
|
139
|
+
locale: g,
|
|
140
|
+
instances: w,
|
|
141
|
+
module: V.UMD_FN
|
|
142
|
+
}).then((l) => {
|
|
143
|
+
l && (u = Z(l));
|
|
152
144
|
})
|
|
153
145
|
]);
|
|
154
|
-
} catch (
|
|
155
|
-
|
|
146
|
+
} catch (l) {
|
|
147
|
+
T.warn("getPreloadComponents timeout in promise race, skip inject html elements", l);
|
|
156
148
|
}
|
|
157
149
|
}
|
|
158
150
|
}
|
|
159
151
|
try {
|
|
160
|
-
const
|
|
161
|
-
title:
|
|
162
|
-
description:
|
|
152
|
+
const s = (c == null ? void 0 : c.title) || i.env.appName, p = (c == null ? void 0 : c.description) || i.env.appDescription, v = oe(W(i.env.appUrl, "/.well-known/service/blocklet/og.png"), {
|
|
153
|
+
title: s,
|
|
154
|
+
description: p
|
|
163
155
|
});
|
|
164
|
-
|
|
165
|
-
ogTitle:
|
|
166
|
-
ogDescription:
|
|
167
|
-
ogImage:
|
|
156
|
+
b = te.render(d, {
|
|
157
|
+
ogTitle: s,
|
|
158
|
+
ogDescription: p,
|
|
159
|
+
ogImage: le(c == null ? void 0 : c.image) || v,
|
|
168
160
|
pagesPublishedAt: (e == null ? void 0 : e.config.publishedAt) || (/* @__PURE__ */ new Date()).getTime()
|
|
169
161
|
});
|
|
170
162
|
} catch {
|
|
171
163
|
}
|
|
172
|
-
const
|
|
173
|
-
let a =
|
|
174
|
-
if (a &&
|
|
175
|
-
const
|
|
176
|
-
a =
|
|
177
|
-
|
|
164
|
+
const r = e == null ? void 0 : e.config.fontFamily, K = n.query.mode === "draft" || n.url.includes("preview"), f = M.load(b);
|
|
165
|
+
let a = c == null ? void 0 : c.backgroundColor;
|
|
166
|
+
if (a && X(a)) {
|
|
167
|
+
const s = await se();
|
|
168
|
+
a = ee(
|
|
169
|
+
s,
|
|
178
170
|
// 目前 dark 和 light 还是前端行为,后端通过 从 light 中获取
|
|
179
171
|
`settings.theme.light.palette.${a}`,
|
|
180
172
|
a
|
|
181
173
|
);
|
|
182
174
|
}
|
|
183
|
-
|
|
175
|
+
f("head").find("#injected-head-elements").replaceWith(`
|
|
184
176
|
${a ? `<meta name="theme-color" content="${a}" /><style>html,body,#app {background-color: ${a};}</style>` : ""}
|
|
185
|
-
${
|
|
186
|
-
${
|
|
177
|
+
${r != null && r.title ? `<link rel="preload" as="style" href="https://fonts.googleapis.com/css?family=${r.title}&display=swap">` : ""}
|
|
178
|
+
${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">` : ""}
|
|
187
179
|
<script>
|
|
188
180
|
|
|
189
181
|
window.__PAGE_STATE__ = ${JSON.stringify(e, null, 0)}
|
|
@@ -196,25 +188,25 @@ function Le({
|
|
|
196
188
|
});
|
|
197
189
|
<\/script>
|
|
198
190
|
|
|
199
|
-
${
|
|
191
|
+
${K ? `<script src="https://cdn.tailwindcss.com"><\/script>
|
|
200
192
|
<script>
|
|
201
193
|
window.tailwind.config = {
|
|
202
194
|
darkMode: "class",
|
|
203
195
|
};
|
|
204
196
|
<\/script>` : ""}
|
|
205
197
|
`);
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
208
|
-
const
|
|
209
|
-
|
|
198
|
+
const I = H();
|
|
199
|
+
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) {
|
|
200
|
+
const s = M.load(n.cachedHtml);
|
|
201
|
+
f("body").html(s("body").html() || "");
|
|
210
202
|
}
|
|
211
|
-
|
|
212
|
-
}), o.use(
|
|
203
|
+
b = f.html(), k.send(b), T.info(`[html] render: ${n.path}, ${C()}ms`), f.root().children().remove(), b = null, c = null, u = null;
|
|
204
|
+
}), o.use(h);
|
|
213
205
|
}
|
|
214
|
-
function
|
|
215
|
-
const t =
|
|
216
|
-
return t && o && !/^(https?:\/\/|\/)/.test(o) ?
|
|
206
|
+
function le(o) {
|
|
207
|
+
const t = q("image-bin");
|
|
208
|
+
return t && o && !/^(https?:\/\/|\/)/.test(o) ? i.env.appUrl + W(t, "uploads", o) : o;
|
|
217
209
|
}
|
|
218
210
|
export {
|
|
219
|
-
|
|
211
|
+
Pe as default
|
|
220
212
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit-inner-components",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.29",
|
|
4
4
|
"description": "Pages Kit inner components library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -77,7 +77,6 @@
|
|
|
77
77
|
"@blocklet/ai-kit": "^0.1.78",
|
|
78
78
|
"@blocklet/ai-runtime": "^0.4.271",
|
|
79
79
|
"@blocklet/code-editor": "^0.4.271",
|
|
80
|
-
"@blocklet/crawler": "^2.3.54",
|
|
81
80
|
"@blocklet/embed": "^0.2.4",
|
|
82
81
|
"@blocklet/js-sdk": "^1.16.43",
|
|
83
82
|
"@blocklet/logger": "1.16.36",
|
|
@@ -205,8 +204,8 @@
|
|
|
205
204
|
"yaml": "^2.5.0",
|
|
206
205
|
"yjs": "^13.6.18",
|
|
207
206
|
"zustand": "^4.5.5",
|
|
208
|
-
"@blocklet/pages-kit": "^0.5.
|
|
209
|
-
"@blocklet/pages-kit-block-studio": "^0.5.
|
|
207
|
+
"@blocklet/pages-kit": "^0.5.29",
|
|
208
|
+
"@blocklet/pages-kit-block-studio": "^0.5.29"
|
|
210
209
|
},
|
|
211
210
|
"devDependencies": {
|
|
212
211
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|