@blocklet/launcher-layout 3.0.8 → 3.0.10

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 (3) hide show
  1. package/lib/header.js +33 -33
  2. package/lib/nav.js +32 -33
  3. package/package.json +5 -5
package/lib/header.js CHANGED
@@ -1,39 +1,39 @@
1
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
- import v from "@arcblock/ux/lib/Img";
1
+ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import b from "@arcblock/ux/lib/Img";
3
3
  import f from "@emotion/styled";
4
- import { useMediaQuery as b, Skeleton as p } from "@mui/material";
5
- import $ from "is-empty";
4
+ import { useMediaQuery as v, Skeleton as p } from "@mui/material";
5
+ import k from "is-empty";
6
6
  import o from "prop-types";
7
- import { useRef as k, useState as N, useEffect as j } from "react";
7
+ import { useRef as $, useState as N, useEffect as j } from "react";
8
8
  import A from "url-join";
9
9
  import S from "./assets/blocklet-default-logo.png";
10
10
  import { getLaunchingText as z } from "./locale.js";
11
- const g = (e) => (e == null ? void 0 : e.title) || (e == null ? void 0 : e.name) || "";
12
- function T({ blockletMeta: e = {}, subTitle: n = "", logoUrl: i = "", locale: m = "", navLogo: d = "", loading: a = !1 }) {
13
- const r = b((y) => y.breakpoints.down("md")), c = r ? 18 : 48, h = k(null), [s, x] = N("");
11
+ const g = (e) => e?.title || e?.name || "";
12
+ function T({ blockletMeta: e = {}, subTitle: i = "", logoUrl: n = "", locale: m = "", navLogo: c = "", loading: a = !1 }) {
13
+ const l = v((y) => y.breakpoints.down("md")), d = l ? 18 : 48, h = $(null), [r, x] = N("");
14
14
  return j(() => {
15
- h.current && h.current.offsetHeight > 34 && (s === "" ? x("middle") : s === "middle" && x("small"));
16
- }, [s]), /* @__PURE__ */ l(R, { className: s === "small" ? "center-mode" : "", children: [
17
- r ? /* @__PURE__ */ t("div", { className: "app-icon", children: d }) : /* @__PURE__ */ l("div", { className: "app-icon", children: [
18
- a && /* @__PURE__ */ t(I, { blockletSize: c, isMobile: r }),
19
- !a && /* @__PURE__ */ t(u, { blockletSize: c, logoUrl: i })
15
+ h.current && h.current.offsetHeight > 34 && (r === "" ? x("middle") : r === "middle" && x("small"));
16
+ }, [r]), /* @__PURE__ */ s(R, { className: r === "small" ? "center-mode" : "", children: [
17
+ l ? /* @__PURE__ */ t("div", { className: "app-icon", children: c }) : /* @__PURE__ */ s("div", { className: "app-icon", children: [
18
+ a && /* @__PURE__ */ t(I, { blockletSize: d, isMobile: l }),
19
+ !a && /* @__PURE__ */ t(u, { blockletSize: d, logoUrl: n })
20
20
  ] }),
21
- /* @__PURE__ */ l("div", { className: "header-title", children: [
22
- r && n && /* @__PURE__ */ t("div", { className: "header-title-sub", children: n }),
23
- /* @__PURE__ */ l("div", { className: "app-name-content", children: [
24
- !r && /* @__PURE__ */ t("div", { className: "launching-context", children: n || z(m) }),
21
+ /* @__PURE__ */ s("div", { className: "header-title", children: [
22
+ l && i && /* @__PURE__ */ t("div", { className: "header-title-sub", children: i }),
23
+ /* @__PURE__ */ s("div", { className: "app-name-content", children: [
24
+ !l && /* @__PURE__ */ t("div", { className: "launching-context", children: i || z(m) }),
25
25
  /* @__PURE__ */ t(
26
26
  "div",
27
27
  {
28
- className: `header-title-name ${s === "middle" || s === "small" ? "middle-size" : ""}`,
28
+ className: `header-title-name ${r === "middle" || r === "small" ? "middle-size" : ""}`,
29
29
  ref: h,
30
30
  children: /* @__PURE__ */ t(
31
31
  w,
32
32
  {
33
- logoUrl: i,
34
- isMobile: r,
33
+ logoUrl: n,
34
+ isMobile: l,
35
35
  blockletMeta: e,
36
- blockletSize: c,
36
+ blockletSize: d,
37
37
  loading: a
38
38
  }
39
39
  )
@@ -51,15 +51,15 @@ T.propTypes = {
51
51
  navLogo: o.any,
52
52
  loading: o.bool
53
53
  };
54
- function I({ blockletSize: e, isMobile: n }) {
55
- return n ? /* @__PURE__ */ t(p, { variant: "rectangular", width: 100, height: 16, alt: "icon", style: { marginTop: 4 } }) : /* @__PURE__ */ t(p, { variant: "rectangular", width: e, height: e });
54
+ function I({ blockletSize: e, isMobile: i }) {
55
+ return i ? /* @__PURE__ */ t(p, { variant: "rectangular", width: 100, height: 16, alt: "icon", style: { marginTop: 4 } }) : /* @__PURE__ */ t(p, { variant: "rectangular", width: e, height: e });
56
56
  }
57
- function u({ logoUrl: e, blockletSize: n }) {
57
+ function u({ logoUrl: e, blockletSize: i }) {
58
58
  return /* @__PURE__ */ t(
59
- v,
59
+ b,
60
60
  {
61
- width: n,
62
- height: n,
61
+ width: i,
62
+ height: i,
63
63
  src: e,
64
64
  alt: "blocklet icon",
65
65
  fallback: S,
@@ -68,17 +68,17 @@ function u({ logoUrl: e, blockletSize: n }) {
68
68
  `layout-app-icon-${e}`
69
69
  );
70
70
  }
71
- function w({ isMobile: e, logoUrl: n, blockletMeta: i = {}, blockletSize: m, loading: d }) {
72
- const a = g(i);
73
- return d ? /* @__PURE__ */ t(p, { variant: "rectangular", width: 100, height: 16, alt: "icon", style: { marginTop: 4 } }) : $(i) ? /* @__PURE__ */ t(p, { variant: "rectangular", animation: !1, width: 100, height: 16, alt: "icon", style: { marginTop: 4 } }) : e ? /* @__PURE__ */ l(L, { children: [
74
- /* @__PURE__ */ t(u, { blockletSize: m, logoUrl: n }),
75
- /* @__PURE__ */ t("span", { className: "ellipsis-title", children: g(i) })
71
+ function w({ isMobile: e, logoUrl: i, blockletMeta: n = {}, blockletSize: m, loading: c }) {
72
+ const a = g(n);
73
+ return c ? /* @__PURE__ */ t(p, { variant: "rectangular", width: 100, height: 16, alt: "icon", style: { marginTop: 4 } }) : k(n) ? /* @__PURE__ */ t(p, { variant: "rectangular", animation: !1, width: 100, height: 16, alt: "icon", style: { marginTop: 4 } }) : e ? /* @__PURE__ */ s(L, { children: [
74
+ /* @__PURE__ */ t(u, { blockletSize: m, logoUrl: i }),
75
+ /* @__PURE__ */ t("span", { className: "ellipsis-title", children: g(n) })
76
76
  ] }) : /* @__PURE__ */ t(
77
77
  E,
78
78
  {
79
79
  className: "app-link",
80
80
  target: "_blank",
81
- href: A((i == null ? void 0 : i.registryUrl) || "", `/blocklets/${i == null ? void 0 : i.did}`),
81
+ href: A(n?.registryUrl || "", `/blocklets/${n?.did}`),
82
82
  title: a,
83
83
  children: a
84
84
  }
package/lib/nav.js CHANGED
@@ -1,22 +1,21 @@
1
1
  import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
- import k from "@emotion/styled";
3
- import { Check as B } from "@mui/icons-material";
4
- import { Box as x, Skeleton as A, Tooltip as P, Button as g, Typography as I } from "@mui/material";
2
+ import b from "@emotion/styled";
3
+ import { Check as T } from "@mui/icons-material";
4
+ import { Box as g, Skeleton as j, Tooltip as B, Button as m, Typography as A } from "@mui/material";
5
5
  import s from "prop-types";
6
- import { useStepContext as M } from "./context/step.js";
7
- import N from "./header.js";
8
- function _({
6
+ import { useStepContext as P } from "./context/step.js";
7
+ import I from "./header.js";
8
+ function M({
9
9
  blockletMeta: e,
10
- logoUrl: f = "",
11
- locale: u = "",
12
- useOfSkeleton: y = !1,
13
- subTitle: w = "",
10
+ logoUrl: k = "",
11
+ locale: x = "",
12
+ useOfSkeleton: f = !1,
13
+ subTitle: u = "",
14
14
  loading: d = !1,
15
15
  extraNav: t = null,
16
- sx: v
16
+ sx: y
17
17
  }) {
18
- var m, b;
19
- const { steps: $, activeStep: S, setActiveStepByKey: C, setActiveStepByIndex: z, getStepStatus: h, canBackToStep: T } = M(), c = y ? d : !1, j = (i, p) => {
18
+ const { steps: w, activeStep: v, setActiveStepByKey: $, setActiveStepByIndex: S, getStepStatus: h, canBackToStep: C } = P(), c = f ? d : !1, z = (i, p) => {
20
19
  const n = ["step-block"], a = h(i.key);
21
20
  switch (a) {
22
21
  case "current":
@@ -37,14 +36,14 @@ function _({
37
36
  n.push("always-step-child");
38
37
  break;
39
38
  }
40
- return i.optional === !0 && S < p && n.push("step-optional"), n.join(" ");
39
+ return i.optional === !0 && v < p && n.push("step-optional"), n.join(" ");
41
40
  };
42
- return /* @__PURE__ */ l(q, { sx: v, children: [
43
- /* @__PURE__ */ o(N, { blockletMeta: e, loading: d, logoUrl: f, locale: u, subTitle: w }),
44
- /* @__PURE__ */ o(D, { className: `${c ? "hide-child-step-desc" : ""}`, children: $.map((i, p) => {
45
- const n = !c && T(p);
46
- return /* @__PURE__ */ l("div", { className: j(i, p), children: [
47
- /* @__PURE__ */ o("div", { className: "step-icon", children: /* @__PURE__ */ o(B, { style: { fontSize: 16 } }) }),
41
+ return /* @__PURE__ */ l(N, { sx: y, children: [
42
+ /* @__PURE__ */ o(I, { blockletMeta: e, loading: d, logoUrl: k, locale: x, subTitle: u }),
43
+ /* @__PURE__ */ o(_, { className: `${c ? "hide-child-step-desc" : ""}`, children: w.map((i, p) => {
44
+ const n = !c && C(p);
45
+ return /* @__PURE__ */ l("div", { className: z(i, p), children: [
46
+ /* @__PURE__ */ o("div", { className: "step-icon", children: /* @__PURE__ */ o(T, { style: { fontSize: 16 } }) }),
48
47
  /* @__PURE__ */ o("div", { className: "step-line" }),
49
48
  /* @__PURE__ */ l("div", { className: "step-content", title: i.name, children: [
50
49
  /* @__PURE__ */ o(
@@ -54,13 +53,13 @@ function _({
54
53
  onClick: () => {
55
54
  if (n) {
56
55
  if (i.key) {
57
- C(i.key);
56
+ $(i.key);
58
57
  return;
59
58
  }
60
- z(p);
59
+ S(p);
61
60
  }
62
61
  },
63
- children: c ? /* @__PURE__ */ o(A, { variant: "text", width: 100 }) : i.name
62
+ children: c ? /* @__PURE__ */ o(j, { variant: "text", width: 100 }) : i.name
64
63
  }
65
64
  ),
66
65
  i.description && /* @__PURE__ */ o("div", { className: "step-desc", children: i.description }),
@@ -80,10 +79,10 @@ function _({
80
79
  ] }, i.key);
81
80
  }) }),
82
81
  t && /* @__PURE__ */ l("div", { className: "extra-nav", children: [
83
- t.tooltipText ? /* @__PURE__ */ o(P, { title: t.tooltipText, children: /* @__PURE__ */ o(
84
- g,
82
+ t.tooltipText ? /* @__PURE__ */ o(B, { title: t.tooltipText, children: /* @__PURE__ */ o(
83
+ m,
85
84
  {
86
- variant: ((m = t.buttonProps) == null ? void 0 : m.variant) || "text",
85
+ variant: t.buttonProps?.variant || "text",
87
86
  onClick: () => {
88
87
  t.link && window.open(t.link, "_blank");
89
88
  },
@@ -94,9 +93,9 @@ function _({
94
93
  children: t.text
95
94
  }
96
95
  ) }) : /* @__PURE__ */ o(
97
- g,
96
+ m,
98
97
  {
99
- variant: ((b = t.buttonProps) == null ? void 0 : b.variant) || "text",
98
+ variant: t.buttonProps?.variant || "text",
100
99
  onClick: () => {
101
100
  t.link && window.open(t.link, "_blank");
102
101
  },
@@ -108,7 +107,7 @@ function _({
108
107
  }
109
108
  ),
110
109
  t.description && /* @__PURE__ */ o(
111
- I,
110
+ A,
112
111
  {
113
112
  variant: "caption",
114
113
  sx: { color: "text.secondary", mt: 0.5 },
@@ -120,7 +119,7 @@ function _({
120
119
  ] })
121
120
  ] });
122
121
  }
123
- const q = k(x)`
122
+ const N = b(g)`
124
123
  overflow-y: auto;
125
124
  display: flex;
126
125
  flex-direction: column;
@@ -168,7 +167,7 @@ const q = k(x)`
168
167
  .extra-nav-button {
169
168
  cursor: pointer;
170
169
  }
171
- `, D = k(x)`
170
+ `, _ = b(g)`
172
171
  display: flex;
173
172
  flex-direction: column;
174
173
  margin-top: 60px;
@@ -372,7 +371,7 @@ const q = k(x)`
372
371
  }
373
372
  }
374
373
  `;
375
- _.propTypes = {
374
+ M.propTypes = {
376
375
  blockletMeta: s.object.isRequired,
377
376
  logoUrl: s.string,
378
377
  locale: s.string,
@@ -383,5 +382,5 @@ _.propTypes = {
383
382
  sx: s.any
384
383
  };
385
384
  export {
386
- _ as default
385
+ M as default
387
386
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-layout",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "description": "Common ux components of launcher",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -36,14 +36,14 @@
36
36
  "url": "https://github.com/ArcBlock/ux/issues"
37
37
  },
38
38
  "peerDependencies": {
39
- "@arcblock/did-connect": "workspace:*",
40
- "@arcblock/ux": "workspace:*",
39
+ "@arcblock/did-connect": "^3.0.8",
40
+ "@arcblock/ux": "^3.0.8",
41
41
  "@mui/icons-material": "^7.1.2",
42
42
  "@mui/material": "^7.1.2",
43
43
  "react": "^19.0.0"
44
44
  },
45
45
  "dependencies": {
46
- "@arcblock/icons": "3.0.8",
46
+ "@arcblock/icons": "3.0.10",
47
47
  "@blocklet/meta": "^1.16.44",
48
48
  "@emotion/react": "^11.14.0",
49
49
  "@emotion/styled": "^11.14.0",
@@ -55,5 +55,5 @@
55
55
  "rehype-react": "^7.2.0",
56
56
  "url-join": "^4.0.1"
57
57
  },
58
- "gitHead": "30b21395b2f3ef6824df728aeafd10e9dea173d9"
58
+ "gitHead": "8e4b3b4f9cc52c8f1f1d270ab03a3c566073617a"
59
59
  }