@blocklet/pages-kit-inner-components 0.4.85 → 0.4.86

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.
@@ -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, b as c, f as g } from "./chunks/site-state-D5tVTSMt.js";
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, b as c, f as g } from "./chunks/site-state-eOo5A_KN.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,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "./chunks/state-DqChB5ys.js";
3
- import { a as b, P as h, c as x, b as y, T as B, H as R } from "./chunks/home-BX1L-H5W.js";
3
+ import { a as h, P as x, c as y, b as B, T as R, H as j } from "./chunks/home-Y2IIftcZ.js";
4
4
  import "@arcblock/ux/lib/Locale/context";
5
5
  import "@arcblock/ux/lib/Result";
6
6
  import "@blocklet/pages-kit/builtin/page/header";
@@ -11,18 +11,19 @@ import "@emotion/styled";
11
11
  import "@mui/material";
12
12
  import "ahooks";
13
13
  import "isomorphic-dompurify";
14
- import "lodash";
14
+ import "lodash/cloneDeep";
15
15
  import "lodash/isEmpty";
16
+ import "lodash/isEqual";
16
17
  import "react";
17
18
  import "react-helmet";
18
19
  import "react-router-dom";
19
20
  import "react-use";
20
21
  import "ufo";
21
22
  export {
22
- b as HomeView,
23
- h as PageRoutes,
24
- x as PageView,
25
- y as PageViewByPath,
26
- B as TranslucentHeader,
27
- R as default
23
+ h as HomeView,
24
+ x as PageRoutes,
25
+ y as PageView,
26
+ B as PageViewByPath,
27
+ R as TranslucentHeader,
28
+ j as default
28
29
  };
package/lib/es/locales.js CHANGED
@@ -376,6 +376,92 @@ const t = e({
376
376
  deleted: "Deleted",
377
377
  undo: "Undo",
378
378
  redo: "Redo"
379
+ },
380
+ style: {
381
+ title: "Layout",
382
+ preview: {
383
+ content: "Preview Content"
384
+ },
385
+ width: {
386
+ title: "Width",
387
+ custom: "Custom Width"
388
+ },
389
+ height: {
390
+ title: "Height",
391
+ custom: "Custom Height"
392
+ },
393
+ spacing: {
394
+ title: "Spacing"
395
+ },
396
+ controls: {
397
+ unlink: "Configure each property separately",
398
+ link: "Configure all properties uniformly"
399
+ },
400
+ padding: {
401
+ title: "Padding",
402
+ description: "Set the distance between the element content and the border",
403
+ top: "Top",
404
+ right: "Right",
405
+ bottom: "Bottom",
406
+ left: "Left",
407
+ link: "Link all padding",
408
+ unlink: "Unlink all padding"
409
+ },
410
+ margin: {
411
+ title: "Margin",
412
+ description: "Set the distance between the element and the other elements",
413
+ top: "Top",
414
+ right: "Right",
415
+ bottom: "Bottom",
416
+ left: "Left",
417
+ link: "Link all margin",
418
+ unlink: "Unlink all margin"
419
+ },
420
+ size: {
421
+ title: "Size",
422
+ auto: "Auto",
423
+ full: "100%",
424
+ threeQuarters: "75%",
425
+ half: "50%",
426
+ quarter: "25%",
427
+ custom: "Custom",
428
+ px: "px",
429
+ percent: "%"
430
+ },
431
+ border: {
432
+ title: "Border",
433
+ style: "Border Style",
434
+ none: "None",
435
+ solid: "Solid",
436
+ dashed: "Dashed",
437
+ dotted: "Dotted",
438
+ width: "Border Width",
439
+ color: "Border Color"
440
+ },
441
+ borderRadius: {
442
+ title: "Border Radius",
443
+ description: "Set the radius of the element border",
444
+ all: "All",
445
+ topLeft: "Top Left",
446
+ topRight: "Top Right",
447
+ bottomLeft: "Bottom Left",
448
+ bottomRight: "Bottom Right"
449
+ },
450
+ shadow: {
451
+ title: "Shadow",
452
+ preset: "Shadow Preset",
453
+ description: "Set the shadow of the element",
454
+ none: "None",
455
+ light: "Light",
456
+ medium: "Medium",
457
+ strong: "Strong",
458
+ heavy: "Heavy",
459
+ intense: "Intense"
460
+ },
461
+ background: {
462
+ title: "Background",
463
+ color: "Background Color"
464
+ }
379
465
  }
380
466
  }), o = e({
381
467
  deleteProjectAlertPrefix: "这将永久删除名称为",
@@ -754,6 +840,94 @@ const t = e({
754
840
  deleted: "已删除",
755
841
  undo: "撤销",
756
842
  redo: "重做"
843
+ },
844
+ style: {
845
+ title: "布局",
846
+ preview: {
847
+ content: "预览内容"
848
+ },
849
+ width: {
850
+ title: "宽度",
851
+ custom: "自定义宽度"
852
+ },
853
+ height: {
854
+ title: "高度",
855
+ custom: "自定义高度"
856
+ },
857
+ spacing: {
858
+ title: "间距设置"
859
+ },
860
+ controls: {
861
+ unlink: "单独配置属性",
862
+ link: "统一配置属性"
863
+ },
864
+ padding: {
865
+ title: "内边距",
866
+ description: "设置元素内容与边框之间的距离",
867
+ top: "上边距",
868
+ right: "右边距",
869
+ bottom: "下边距",
870
+ left: "左边距",
871
+ link: "统一设置所有边距",
872
+ unlink: "分别设置各边距"
873
+ },
874
+ margin: {
875
+ title: "外边距",
876
+ description: "设置元素与其他元素之间的距离",
877
+ top: "上边距",
878
+ right: "右边距",
879
+ bottom: "下边距",
880
+ left: "左边距",
881
+ link: "统一设置所有边距",
882
+ unlink: "分别设置各边距"
883
+ },
884
+ size: {
885
+ title: "尺寸设置",
886
+ auto: "自动",
887
+ full: "100%",
888
+ threeQuarters: "75%",
889
+ half: "50%",
890
+ quarter: "25%",
891
+ custom: "自定义",
892
+ px: "px",
893
+ percent: "%"
894
+ },
895
+ border: {
896
+ title: "边框设置",
897
+ style: "边框样式",
898
+ none: "无边框",
899
+ solid: "实线",
900
+ dashed: "虚线",
901
+ dotted: "点线",
902
+ width: "边框宽度",
903
+ color: "边框颜色"
904
+ },
905
+ borderRadius: {
906
+ title: "圆角设置",
907
+ description: "设置元素边框的圆角程度",
908
+ all: "所有角",
909
+ topLeft: "左上角",
910
+ topRight: "右上角",
911
+ bottomLeft: "左下角",
912
+ bottomRight: "右下角",
913
+ link: "统一设置所有圆角",
914
+ unlink: "分别设置各圆角"
915
+ },
916
+ shadow: {
917
+ title: "阴影设置",
918
+ preset: "阴影预设",
919
+ description: "设置元素的阴影效果",
920
+ none: "无阴影",
921
+ light: "轻微阴影",
922
+ medium: "中等阴影",
923
+ strong: "强烈阴影",
924
+ heavy: "重型阴影",
925
+ intense: "强烈扩散阴影"
926
+ },
927
+ background: {
928
+ title: "背景设置",
929
+ color: "背景颜色"
930
+ }
757
931
  }
758
932
  }), i = { en: t, zh: o };
759
933
  export {
@@ -1,4 +1,4 @@
1
- import { l as k, b as H } from "./chunks/site-state-D5tVTSMt.js";
1
+ import { b as H, l as _ } from "./chunks/site-state-eOo5A_KN.js";
2
2
  import { initCronCrawlBlocklet as W, cancelCronCrawlBlocklet as N, initSEOMiddleware as J } from "@blocklet/crawler/middlewares";
3
3
  import { PreloadComponentScriptModule as G } from "@blocklet/pages-kit/types";
4
4
  import { injectPreloadComponents as K } from "@blocklet/pages-kit/utils/preload";
@@ -28,36 +28,36 @@ function me({
28
28
  let C;
29
29
  if (h) {
30
30
  const t = I(j(process.cwd(), "./index.html"), "utf-8");
31
- c.use(async (y, $, v) => {
32
- const _ = y.originalUrl;
33
- C = await h.transformIndexHtml(_, t), v();
31
+ c.use(async (b, $, y) => {
32
+ const v = b.originalUrl;
33
+ C = await h.transformIndexHtml(v, t), y();
34
34
  });
35
35
  } else
36
36
  C = I(j(process.env.BLOCKLET_APP_DIR, "dist/index.html"), "utf-8");
37
- const b = V();
38
- b.use(
37
+ const k = V();
38
+ k.use(
39
39
  J({
40
40
  autoReturnHtml: !0,
41
41
  allowCrawler: M
42
42
  })
43
- ), b.get("/:path(*)?", async (t, y, $) => {
43
+ ), k.get("/:path(*)?", async (t, b, $) => {
44
44
  var T, E, S;
45
- if (Z.some((r) => {
45
+ if (Z.some((l) => {
46
46
  var i;
47
- return (i = t.path) == null ? void 0 : i.startsWith(r);
47
+ return (i = t.path) == null ? void 0 : i.startsWith(l);
48
48
  })) {
49
49
  $();
50
50
  return;
51
51
  }
52
- const v = performance.now(), _ = () => Math.round(performance.now() - v), O = "production";
52
+ const y = performance.now(), v = () => Math.round(performance.now() - y), O = "production";
53
53
  let e, p, f = C;
54
54
  if (t.path.startsWith("/pages")) {
55
- const r = t.params.lang, i = t.cookies.nf_lang, g = /* @__PURE__ */ new Set([...a.env.languages.map((u) => u.code)]);
56
- let d = (r && g.has(r) ? r : void 0) || (g.has(i) ? i : void 0) || [...g][0];
55
+ const l = t.params.lang, i = t.cookies.nf_lang, g = /* @__PURE__ */ new Set([...a.env.languages.map((u) => u.code)]);
56
+ let d = (l && g.has(l) ? l : void 0) || (g.has(i) ? i : void 0) || [...g][0];
57
57
  if ((!d || !((T = n.supportedLocales) != null && T.find((u) => u.locale === d))) && (d = ((S = (E = n.supportedLocales) == null ? void 0 : E[0]) == null ? void 0 : S.locale) || ""), d) {
58
58
  const u = [];
59
- Object.values(n.pages).forEach((l) => {
60
- const B = Object.values((l == null ? void 0 : l.sections) ?? {}).filter(
59
+ Object.values(n.pages).forEach((r) => {
60
+ const B = Object.values((r == null ? void 0 : r.sections) ?? {}).filter(
61
61
  (s) => {
62
62
  var w;
63
63
  return s.component === "custom-component" && ((w = s.config) == null ? void 0 : w.componentId);
@@ -74,9 +74,9 @@ function me({
74
74
  });
75
75
  u.push(...B);
76
76
  });
77
- const x = new Promise((l) => {
77
+ const x = new Promise((r) => {
78
78
  setTimeout(() => {
79
- k.error("get preload components timeout"), l({});
79
+ r({});
80
80
  }, 90 * 1e3);
81
81
  });
82
82
  try {
@@ -89,22 +89,22 @@ function me({
89
89
  locale: d,
90
90
  instances: u,
91
91
  module: G.UMD_FN
92
- }).then((l) => {
93
- l && (p = K(l));
92
+ }).then((r) => {
93
+ r && (p = K(r));
94
94
  })
95
95
  ]);
96
- } catch (l) {
97
- k.warn("getPreloadComponents timeout in promise race, skip inject html elements"), k.warn(l);
96
+ } catch (r) {
97
+ _.warn("getPreloadComponents timeout in promise race, skip inject html elements"), _.warn(r);
98
98
  }
99
99
  }
100
100
  }
101
101
  try {
102
- const r = (e == null ? void 0 : e.title) || a.env.appName, i = (e == null ? void 0 : e.description) || a.env.appDescription, g = Y(U(a.env.appUrl, "/.well-known/service/blocklet/og.png"), {
103
- title: r,
102
+ const l = (e == null ? void 0 : e.title) || a.env.appName, i = (e == null ? void 0 : e.description) || a.env.appDescription, g = Y(U(a.env.appUrl, "/.well-known/service/blocklet/og.png"), {
103
+ title: l,
104
104
  description: i
105
105
  });
106
106
  f = X.render(C, {
107
- ogTitle: r,
107
+ ogTitle: l,
108
108
  ogDescription: i,
109
109
  ogImage: F(e == null ? void 0 : e.image) || g,
110
110
  pagesPublishedAt: (n == null ? void 0 : n.config.publishedAt) || (/* @__PURE__ */ new Date()).getTime()
@@ -137,11 +137,11 @@ function me({
137
137
  `);
138
138
  const P = z();
139
139
  if (P && m('script[src="__blocklet__.js"]').replaceWith(`<script>${P}<\/script>`), p != null && p.html && m("head").find("#injected-html-elements").replaceWith(p.html), t.cachedHtml) {
140
- const r = A.load(t.cachedHtml);
141
- m("body").html(r("body").html() || "");
140
+ const l = A.load(t.cachedHtml);
141
+ m("body").html(l("body").html() || "");
142
142
  }
143
- f = m.html(), y.send(f), k.info(`[html] render: ${t.path}, ${_()}ms`), m.root().children().remove(), f = null, e = null, p = null;
144
- }), c.use(b);
143
+ f = m.html(), b.send(f), _.info(`[html] render: ${t.path}, ${v()}ms`), m.root().children().remove(), f = null, e = null, p = null;
144
+ }), c.use(k);
145
145
  }
146
146
  function F(c) {
147
147
  const h = Q("image-bin");
@@ -1,9 +1,10 @@
1
- import { P as S, i as b, g as M, l as x, C as J, R as X, S as N, t as W, a as G } from "./chunks/site-state-D5tVTSMt.js";
1
+ import { P as S, i as b, g as M, l as x, C as J, R as X, S as N, t as W, a as G } from "./chunks/site-state-eOo5A_KN.js";
2
2
  import { AsyncLocalStorage as K } from "async_hooks";
3
3
  import { Router as Y } from "express";
4
4
  import d from "fs";
5
5
  import g from "joi";
6
- import { groupBy as _, sortBy as $ } from "lodash";
6
+ import _ from "lodash/groupBy";
7
+ import $ from "lodash/sortBy";
7
8
  import C, { join as z } from "path";
8
9
  import D from "@blocklet/sdk/lib/middlewares/auth";
9
10
  import { getResourceExportDir as H } from "@blocklet/sdk/lib/component";