@blocklet/pages-kit-inner-components 0.4.109 → 0.4.111

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.
Files changed (31) hide show
  1. package/lib/cjs/add-component.js +1 -1
  2. package/lib/cjs/chunks/{array-DHXwpDtd.js → array-CnXbKOG_.js} +23 -23
  3. package/lib/cjs/chunks/config-color-BBSht7j-.js +21 -0
  4. package/lib/cjs/chunks/{draft-data-UP_7unuZ.js → draft-data-DPTVTTlh.js} +1 -1
  5. package/lib/cjs/chunks/{home-Bouu7xjV.js → home-BXkUy2B8.js} +3 -3
  6. package/lib/cjs/chunks/{publish-button-BSxaxRDn.js → publish-button-B7nhzpwi.js} +1 -1
  7. package/lib/cjs/chunks/state-DDwYX2mu.js +1 -0
  8. package/lib/cjs/home.js +1 -1
  9. package/lib/cjs/locales.js +1 -1
  10. package/lib/cjs/setting.js +2 -2
  11. package/lib/cjs/uploader.js +1 -1
  12. package/lib/es/add-component.js +3 -3
  13. package/lib/es/chunks/{array-CVceCpS9.js → array-nAv4MiIp.js} +369 -344
  14. package/lib/es/chunks/config-color-JrBPRsTv.js +121 -0
  15. package/lib/es/chunks/{draft-data-0n1CKRWr.js → draft-data-BFlmvWXx.js} +3 -3
  16. package/lib/es/chunks/{home-2Nd5wxm6.js → home-Cjs79tsI.js} +4 -4
  17. package/lib/es/chunks/{publish-button-ChN-Liyi.js → publish-button-DhOdksVJ.js} +3 -3
  18. package/lib/es/chunks/{site-state-Bn8mEgOx.js → site-state-BVZLaWr2.js} +3 -3
  19. package/lib/es/chunks/{state-DsXKwImw.js → state-BgKqNapt.js} +12 -12
  20. package/lib/es/components.js +1 -1
  21. package/lib/es/home.js +3 -3
  22. package/lib/es/locales.js +4 -0
  23. package/lib/es/project-html.js +12 -12
  24. package/lib/es/resources.js +1 -1
  25. package/lib/es/setting.js +152 -151
  26. package/lib/es/site-state.js +6 -6
  27. package/lib/es/uploader.js +6 -64
  28. package/package.json +12 -12
  29. package/lib/cjs/chunks/config-color-Da8lKUL0.js +0 -21
  30. package/lib/cjs/chunks/state-BoXTl4DM.js +0 -1
  31. package/lib/es/chunks/config-color-B-ax03qd.js +0 -328
@@ -0,0 +1,121 @@
1
+ import { jsx as o, jsxs as d, Fragment as z } from "react/jsx-runtime";
2
+ import "@arcblock/ux/lib/Locale/context";
3
+ import { styled as w } from "@arcblock/ux/lib/Theme";
4
+ import "@blocklet/pages-kit/builtin/color-picker";
5
+ import "@emotion/css";
6
+ import { TextField as P, Stack as _, FormControlLabel as k, Switch as A, Box as y, InputAdornment as j } from "@mui/material";
7
+ import "ahooks";
8
+ import "lodash/without";
9
+ import { forwardRef as F, useState as L, useEffect as B, useImperativeHandle as D } from "react";
10
+ import { red as E, pink as U, purple as V, indigo as C, blue as G, cyan as H, teal as K, green as R, lime as T, yellow as W, amber as q, orange as J, brown as N, grey as O, blueGrey as Q } from "@mui/material/colors";
11
+ import { getImageSize as b, getVideoSize as g, UploaderButton as X } from "@blocklet/pages-kit/builtin/uploader";
12
+ import { Icon as Y } from "@iconify-icon/react";
13
+ import { useDebounce as Z } from "react-use";
14
+ import { b as x } from "./state-BgKqNapt.js";
15
+ E[300], U[300], V[300], // deepPurple['300'],
16
+ C[300], G[300], // lightBlue['300'],
17
+ H[300], K[300], R[300], // lightGreen['300'],
18
+ T[300], W[300], q[300], J[300], // deepOrange['300'],
19
+ N[300], O[300], Q[300];
20
+ const dt = F(function({ showMarkdown: h, markdown: I, onMarkdownChange: n, showUploader: S, value: r, meta: M, onChange: l, ...m }, v) {
21
+ const [e, a] = L("");
22
+ B(() => {
23
+ a(r || "");
24
+ }, [r, a]);
25
+ const s = async () => {
26
+ if (e !== r) {
27
+ const t = x(e);
28
+ if (!t) {
29
+ l(e, void 0);
30
+ return;
31
+ }
32
+ const i = await b(t).catch(() => g(t)).catch(() => {
33
+ });
34
+ l(e, { ...i, filename: e });
35
+ }
36
+ };
37
+ Z(
38
+ () => {
39
+ e !== r && l(e);
40
+ },
41
+ 300,
42
+ [e]
43
+ ), D(v, () => ({
44
+ submit: s
45
+ }));
46
+ const p = {};
47
+ return S && (p.InputProps = {
48
+ sx: { pr: 0 },
49
+ endAdornment: /* @__PURE__ */ o(j, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ o(
50
+ X,
51
+ {
52
+ onChange: async ({ response: t }) => {
53
+ var u;
54
+ const i = (u = t == null ? void 0 : t.data) == null ? void 0 : u.filename, c = x(i) || "";
55
+ let f = {};
56
+ c && (f = await b(c).catch(() => g(c)).catch(() => {
57
+ })), l(i, {
58
+ ...f,
59
+ filename: i
60
+ });
61
+ }
62
+ }
63
+ ) })
64
+ }), /* @__PURE__ */ o(
65
+ P,
66
+ {
67
+ size: "small",
68
+ fullWidth: !0,
69
+ ...m,
70
+ label: /* @__PURE__ */ d(_, { direction: "row", spacing: 1, alignItems: "center", children: [
71
+ m.label,
72
+ h && /* @__PURE__ */ d(z, { children: [
73
+ " (",
74
+ /* @__PURE__ */ o(
75
+ k,
76
+ {
77
+ checked: I,
78
+ label: /* @__PURE__ */ o(y, { component: Y, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
79
+ labelPlacement: "start",
80
+ control: /* @__PURE__ */ o(A, { size: "small" }),
81
+ sx: { ml: 0.25, pr: 1 },
82
+ onChange: (t, i) => n == null ? void 0 : n(i)
83
+ }
84
+ ),
85
+ ")"
86
+ ] })
87
+ ] }),
88
+ InputLabelProps: { shrink: !0, ...m.InputLabelProps },
89
+ value: e,
90
+ onChange: (t) => a(t.target.value),
91
+ ...p,
92
+ onKeyDown: (t) => {
93
+ t.keyCode !== 229 && t.key === "Enter" && s();
94
+ }
95
+ }
96
+ );
97
+ });
98
+ w(y)`
99
+ .color-item {
100
+ position: relative;
101
+ }
102
+ .color-item__checked {
103
+ position: absolute;
104
+ top: 0;
105
+ bottom: 0;
106
+ left: 0;
107
+ right: 0;
108
+ display: flex;
109
+ justify-content: center;
110
+ align-items: center;
111
+ color: rgba(255, 255, 255, 0.85);
112
+ }
113
+ .color-item__delete {
114
+ position: absolute;
115
+ top: 0;
116
+ right: 0;
117
+ }
118
+ `;
119
+ export {
120
+ dt as C
121
+ };
@@ -1,8 +1,8 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { u as o, S as a, l as s, d as n } from "./state-DsXKwImw.js";
2
+ import { u as a, S as o, g as s, a as n } from "./state-BgKqNapt.js";
3
3
  function d({ children: t }) {
4
- const r = o();
5
- return /* @__PURE__ */ e(a, { url: s(r ?? ""), name: "root", waitingSynced: !0, children: /* @__PURE__ */ e(i, { children: t }) });
4
+ const r = a();
5
+ return /* @__PURE__ */ e(o, { url: s(r ?? ""), name: "root", waitingSynced: !0, children: /* @__PURE__ */ e(i, { children: t }) });
6
6
  }
7
7
  function i({ children: t }) {
8
8
  const { state: r } = n();
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as M } from "react/jsx-runtime";
2
- import { g as D, a as re, b as se, u as ie, c as ce } from "./state-DsXKwImw.js";
2
+ import { f as D, h as re, b as se, u as ie, d as ce } from "./state-BgKqNapt.js";
3
3
  import { cloneDeep as P } from "lodash";
4
4
  import { useLocaleContext as q } from "@arcblock/ux/lib/Locale/context";
5
5
  import J from "@arcblock/ux/lib/Result";
@@ -20,7 +20,7 @@ import { Helmet as Pe } from "react-helmet";
20
20
  import { useSearchParams as Ce, Routes as je, Route as E, Navigate as Ee, ScrollRestoration as Re } from "react-router-dom";
21
21
  import { useWindowScroll as Me, useAsync as F } from "react-use";
22
22
  import { joinURL as R } from "ufo";
23
- import { S as $e, n as Ie, P as Te, a as Oe, B as Ne, g as _e } from "./array-CVceCpS9.js";
23
+ import { S as $e, n as Ie, P as Te, a as Oe, B as Ne, g as _e } from "./array-nAv4MiIp.js";
24
24
  import { styled as ee, useTheme as Be } from "@arcblock/ux/lib/Theme";
25
25
  import Ae from "@blocklet/ui-react/lib/Footer";
26
26
  import He from "webfontloader";
@@ -158,7 +158,7 @@ function Ze({ mode: e }) {
158
158
  }
159
159
  return /* @__PURE__ */ o(Ke, { children: ({ state: r }) => /* @__PURE__ */ o(I, { mode: e, state: r }) });
160
160
  }
161
- const Ke = K(() => import("./draft-data-0n1CKRWr.js"));
161
+ const Ke = K(() => import("./draft-data-BFlmvWXx.js"));
162
162
  function Fe({
163
163
  mode: e,
164
164
  children: r
@@ -380,7 +380,7 @@ function O({
380
380
  !((U = a.footer) != null && U.hidden) && /* @__PURE__ */ o(Ve, {})
381
381
  ] });
382
382
  }
383
- const et = K(() => import("./publish-button-ChN-Liyi.js")), te = Z(ue)`
383
+ const et = K(() => import("./publish-button-DhOdksVJ.js")), te = Z(ue)`
384
384
  &.sticky {
385
385
  position: sticky;
386
386
  top: 0;
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as p, Fragment as H } from "react/jsx-runtime";
2
- import { u as R, m as J, c as q, P as G } from "./state-DsXKwImw.js";
2
+ import { u as R, c as J, d as q, P as G } from "./state-BgKqNapt.js";
3
3
  import { useLocaleContext as V } from "@arcblock/ux/lib/Locale/context";
4
4
  import I from "@arcblock/ux/lib/Toast";
5
5
  import { Warning as F, Sync as Q, VisibilityOff as U } from "@mui/icons-material";
@@ -9,8 +9,8 @@ import { produce as oe } from "immer";
9
9
  import N from "lodash/difference";
10
10
  import { useState as D, useMemo as j, useCallback as L, forwardRef as se, useImperativeHandle as le, useEffect as ce } from "react";
11
11
  import { useAsync as ae } from "react-use";
12
- import { L as de } from "./home-2Nd5wxm6.js";
13
- import { p as ue, g as me } from "./array-CVceCpS9.js";
12
+ import { L as de } from "./home-Cjs79tsI.js";
13
+ import { p as ue, g as me } from "./array-nAv4MiIp.js";
14
14
  function ge(r) {
15
15
  const [a, y] = D(!1);
16
16
  return /* @__PURE__ */ e(
@@ -1523,13 +1523,13 @@ export {
1523
1523
  Y as P,
1524
1524
  Ge as R,
1525
1525
  ue as S,
1526
- De as a,
1527
- Oo as b,
1526
+ Io as a,
1527
+ De as b,
1528
1528
  us as c,
1529
1529
  ds as d,
1530
1530
  ms as e,
1531
1531
  fs as f,
1532
- Io as g,
1532
+ Oo as g,
1533
1533
  gs as h,
1534
1534
  bo as i,
1535
1535
  pe as j,
@@ -32,7 +32,7 @@ function qt(e) {
32
32
  return `${e}:pages:version`;
33
33
  }
34
34
  function Kt(e, o) {
35
- return o === "yaml" ? Z(e) ? "" : Y.stringify(e, { indent: 2 }) : o === "json" ? JSON.parse(JSON.stringify(e || "{}")) : o === "array" ? JSON.parse(JSON.stringify(e || "[]")) : e;
35
+ return o === "yaml" ? Z(e) ? "" : Y.stringify(e, { indent: 2 }) : o === "json" ? JSON.parse(JSON.stringify(e || {})) : o === "array" ? JSON.parse(JSON.stringify(e || [])) : e;
36
36
  }
37
37
  function Qt({ error: e }) {
38
38
  return /* @__PURE__ */ I(L, { children: /* @__PURE__ */ I(q, { severity: "error", children: e.message }) });
@@ -406,19 +406,19 @@ export {
406
406
  Qt as E,
407
407
  oe as P,
408
408
  Ht as S,
409
- Yt as a,
409
+ vt as a,
410
410
  Zt as b,
411
- qt as c,
412
- vt as d,
411
+ ee as c,
412
+ qt as d,
413
413
  te as e,
414
- z as f,
415
- jt as g,
416
- Gt as h,
417
- kt as i,
418
- yt as j,
419
- pt as k,
420
- Xt as l,
421
- ee as m,
414
+ jt as f,
415
+ Xt as g,
416
+ Yt as h,
417
+ z as i,
418
+ Gt as j,
419
+ kt as k,
420
+ yt as l,
421
+ pt as m,
422
422
  D as n,
423
423
  Kt as t,
424
424
  V as u
@@ -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-Bn8mEgOx.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, g as c, f as g } from "./chunks/site-state-BVZLaWr2.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
- import "./chunks/state-DsXKwImw.js";
3
- import { a as y, P as B, c as R, b as j, T as k, H as q } from "./chunks/home-2Nd5wxm6.js";
2
+ import "./chunks/state-BgKqNapt.js";
3
+ import { a as y, P as B, c as R, b as j, T as k, H as q } from "./chunks/home-Cjs79tsI.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";
@@ -20,7 +20,7 @@ import "react-helmet";
20
20
  import "react-router-dom";
21
21
  import "react-use";
22
22
  import "ufo";
23
- import "./chunks/array-CVceCpS9.js";
23
+ import "./chunks/array-nAv4MiIp.js";
24
24
  export {
25
25
  y as HomeView,
26
26
  B as PageRoutes,
package/lib/es/locales.js CHANGED
@@ -208,6 +208,8 @@ const t = e({
208
208
  paddingY: "Vertical Padding",
209
209
  paddingX: "Horizontal Padding",
210
210
  maxWidth: "Max Width",
211
+ maxWidthCustomTip: "For example: 1200px, 80%, 50vw",
212
+ customValue: "Custom Value",
211
213
  stickyHeader: "Sticky Header",
212
214
  translucent: "Translucent Mode",
213
215
  hideNavMenus: "Hide Navigation Menus",
@@ -620,6 +622,8 @@ const t = e({
620
622
  paddingY: "上下内边距",
621
623
  paddingX: "左右内边距",
622
624
  maxWidth: "最大宽度",
625
+ maxWidthCustomTip: "例如: 1200px, 80%, 50vw",
626
+ customValue: "自定义值",
623
627
  stickyHeader: "固定导航栏",
624
628
  translucent: "沉浸式",
625
629
  hideNavMenus: "隐藏导航菜单",
@@ -1,4 +1,4 @@
1
- import { l as y, b as H } from "./chunks/site-state-Bn8mEgOx.js";
1
+ import { l as _, g as H } from "./chunks/site-state-BVZLaWr2.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,32 +28,32 @@ function de({
28
28
  let C;
29
29
  if (h) {
30
30
  const o = I(j(process.cwd(), "./index.html"), "utf-8");
31
- c.use(async (f, b, v) => {
31
+ c.use(async (f, y, v) => {
32
32
  const $ = f.originalUrl;
33
33
  C = await h.transformIndexHtml($, o), v();
34
34
  });
35
35
  } else
36
36
  C = I(j(process.env.BLOCKLET_APP_DIR, "dist/index.html"), "utf-8");
37
- const _ = V();
38
- _.use(
39
- (o, f, b) => {
37
+ const b = V();
38
+ b.use(
39
+ (o, f, y) => {
40
40
  if (o.headers["x-unique-record"] === "dial_http") {
41
- y.info("[html] dial http request, return 200 status code"), f.status(200).send("ok");
41
+ _.info("[html] dial http request, return 200 status code"), f.status(200).send("ok");
42
42
  return;
43
43
  }
44
- b();
44
+ y();
45
45
  },
46
46
  J({
47
47
  autoReturnHtml: !0,
48
48
  allowCrawler: M
49
49
  })
50
- ), _.get("/:path(*)?", async (o, f, b) => {
50
+ ), b.get("/:path(*)?", async (o, f, y) => {
51
51
  var T, E, S;
52
52
  if (Z.some((r) => {
53
53
  var s;
54
54
  return (s = o.path) == null ? void 0 : s.startsWith(r);
55
55
  })) {
56
- b();
56
+ y();
57
57
  return;
58
58
  }
59
59
  const v = performance.now(), $ = () => Math.round(performance.now() - v), D = "production";
@@ -101,7 +101,7 @@ function de({
101
101
  })
102
102
  ]);
103
103
  } catch (l) {
104
- y.warn("getPreloadComponents timeout in promise race, skip inject html elements"), y.warn(l);
104
+ _.warn("getPreloadComponents timeout in promise race, skip inject html elements"), _.warn(l);
105
105
  }
106
106
  }
107
107
  }
@@ -147,8 +147,8 @@ function de({
147
147
  const r = A.load(o.cachedHtml);
148
148
  d("body").html(r("body").html() || "");
149
149
  }
150
- g = d.html(), f.send(g), y.info(`[html] render: ${o.path}, ${$()}ms`), d.root().children().remove(), g = null, e = null, p = null;
151
- }), c.use(_);
150
+ g = d.html(), f.send(g), _.info(`[html] render: ${o.path}, ${$()}ms`), d.root().children().remove(), g = null, e = null, p = null;
151
+ }), c.use(b);
152
152
  }
153
153
  function q(c) {
154
154
  const h = Q("image-bin");
@@ -1,4 +1,4 @@
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-Bn8mEgOx.js";
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-BVZLaWr2.js";
2
2
  import { AsyncLocalStorage as K } from "async_hooks";
3
3
  import { Router as Y } from "express";
4
4
  import d from "fs";