@blocklet/ui-react 3.1.27 → 3.1.30

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.
@@ -1,39 +1,32 @@
1
- import { jsx as r, jsxs as m, Fragment as v } from "react/jsx-runtime";
2
- import { useState as N } from "react";
1
+ import { jsx as r, jsxs as m, Fragment as N } from "react/jsx-runtime";
2
+ import { useState as $ } from "react";
3
3
  import l from "prop-types";
4
- import { useCreation as $ } from "ahooks";
4
+ import { useCreation as M } from "ahooks";
5
5
  import j from "lodash/isInteger";
6
6
  import I from "lodash/isString";
7
7
  import { styled as z } from "@arcblock/ux/lib/Theme";
8
8
  import c from "clsx";
9
- import { ExpandMore as M } from "@mui/icons-material";
10
- import C from "../Icon/index.js";
9
+ import { ExpandMore as C } from "@mui/icons-material";
10
+ import P from "../Icon/index.js";
11
11
  import A from "../hooks/use-mobile.js";
12
- import { splitNavColumns as E } from "../utils.js";
13
- function F({ links: e = [], flowLayout: d = !1, columns: u, ...x }) {
14
- const [g, b] = N(-1), w = A({ key: "md" }), h = e.some((t) => t.items?.length), k = !w && h && j(u) && u > 1, p = ({ label: t, link: o, icon: i, render: a, props: n }) => {
12
+ import { splitNavColumns as E, isMailProtocol as F } from "../utils.js";
13
+ function R({ links: e = [], flowLayout: d = !1, columns: u, ...k }) {
14
+ const [g, b] = $(-1), w = A({ key: "md" }), h = e.some((t) => t.items?.length), x = !w && h && j(u) && u > 1, p = ({ label: t, link: o, icon: i, render: a, props: n }) => {
15
15
  let s = t;
16
16
  if (a)
17
17
  s = a({ label: t, link: o, props: n });
18
18
  else if (o && I(o)) {
19
- const f = o.startsWith("http") || o.startsWith("//");
20
- s = /* @__PURE__ */ r(
21
- "a",
22
- {
23
- href: o,
24
- "aria-label": `Footer link for ${t}`,
25
- target: f ? "_blank" : "_self",
26
- rel: f ? "noreferrer noopener" : void 0,
27
- ...n,
28
- children: t
29
- }
30
- );
31
- }
32
- return /* @__PURE__ */ m(v, { children: [
33
- i && /* @__PURE__ */ r(C, { icon: i, size: 20, sx: { mr: 0.5 } }),
19
+ const f = o.startsWith("http") || o.startsWith("//"), v = F(o) ? {} : {
20
+ target: f ? "_blank" : "_self",
21
+ rel: f ? "noreferrer noopener" : void 0
22
+ };
23
+ s = /* @__PURE__ */ r("a", { href: o, "aria-label": `Footer link for ${t}`, ...v, ...n, children: t });
24
+ }
25
+ return /* @__PURE__ */ m(N, { children: [
26
+ i && /* @__PURE__ */ r(P, { icon: i, size: 20, sx: { mr: 0.5 } }),
34
27
  s
35
28
  ] });
36
- }, y = $(() => e?.length ? d ? e.map((t, o) => /* @__PURE__ */ r("span", { className: "footer-links-item", children: p(t) }, o)) : k ? E(e, { columns: u }).map((t, o) => /* @__PURE__ */ r("div", { className: "footer-links-column", children: t.filter((i) => i.group).map((i, a) => {
29
+ }, y = M(() => e?.length ? d ? e.map((t, o) => /* @__PURE__ */ r("span", { className: "footer-links-item", children: p(t) }, o)) : x ? E(e, { columns: u }).map((t, o) => /* @__PURE__ */ r("div", { className: "footer-links-column", children: t.filter((i) => i.group).map((i, a) => {
37
30
  const { items: n } = i;
38
31
  return /* @__PURE__ */ m("div", { className: "footer-links-group", children: [
39
32
  /* @__PURE__ */ r("span", { className: "footer-links-item", children: p(i) }),
@@ -59,7 +52,7 @@ function F({ links: e = [], flowLayout: d = !1, columns: u, ...x }) {
59
52
  /* @__PURE__ */ m("span", { className: "footer-links-item", children: [
60
53
  p(t),
61
54
  !!i?.length && /* @__PURE__ */ r("span", { className: "footer-links-group-expand-icon", children: /* @__PURE__ */ r(
62
- M,
55
+ C,
63
56
  {
64
57
  style: {
65
58
  transform: `rotate(${a ? 180 : 0}deg)`
@@ -72,21 +65,21 @@ function F({ links: e = [], flowLayout: d = !1, columns: u, ...x }) {
72
65
  },
73
66
  o
74
67
  );
75
- }) : null, [e, d, k, g]);
68
+ }) : null, [e, d, x, g]);
76
69
  return e?.length ? /* @__PURE__ */ r(
77
- R,
70
+ S,
78
71
  {
79
- ...x,
80
- className: c(x.className, {
72
+ ...k,
73
+ className: c(k.className, {
81
74
  "footer-links--grouped": h,
82
75
  "footer-links--flow": d,
83
- "footer-links--columns": k
76
+ "footer-links--columns": x
84
77
  }),
85
78
  children: /* @__PURE__ */ r("div", { className: "footer-links-inner", children: y })
86
79
  }
87
80
  ) : null;
88
81
  }
89
- F.propTypes = {
82
+ R.propTypes = {
90
83
  links: l.arrayOf(
91
84
  l.shape({
92
85
  label: l.string,
@@ -100,7 +93,7 @@ F.propTypes = {
100
93
  // 列布局
101
94
  columns: l.number.isRequired
102
95
  };
103
- const R = z("div")`
96
+ const S = z("div")`
104
97
  overflow: hidden;
105
98
  color: ${({ theme: e }) => e.palette.text.secondary};
106
99
  .footer-links-inner {
@@ -251,5 +244,5 @@ const R = z("div")`
251
244
  }
252
245
  `;
253
246
  export {
254
- F as default
247
+ R as default
255
248
  };
@@ -1,8 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
  import { UserCenterTab } from '../../@types';
3
- declare function Fallback({ currentActiveTab, isMyself, children, }: {
3
+ declare function Fallback({ currentActiveTab, isMyself, isSupportFollow, children, }: {
4
4
  currentActiveTab: UserCenterTab;
5
5
  isMyself: boolean;
6
+ isSupportFollow?: boolean;
6
7
  children: React.ReactNode;
7
8
  }): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
8
9
  export default Fallback;
@@ -1,21 +1,22 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as l } from "react/jsx-runtime";
2
2
  import n from "@arcblock/ux/lib/Empty";
3
- import { translate as c } from "@arcblock/ux/lib/Locale/util";
4
- import { useMemoizedFn as d } from "ahooks";
5
- import { useLocaleContext as u } from "@arcblock/ux/lib/Locale/context";
6
- import { translations as a } from "../libs/locales.js";
7
- import { useUserFollowersContext as w } from "../../contexts/user-followers.js";
8
- function k({
9
- currentActiveTab: o,
10
- isMyself: m,
11
- children: l
3
+ import { translate as a } from "@arcblock/ux/lib/Locale/util";
4
+ import { useMemoizedFn as c } from "ahooks";
5
+ import { useLocaleContext as d } from "@arcblock/ux/lib/Locale/context";
6
+ import { translations as w } from "../libs/locales.js";
7
+ import { useUserFollowersContext as x } from "../../contexts/user-followers.js";
8
+ function z({
9
+ currentActiveTab: r,
10
+ isMyself: f,
11
+ isSupportFollow: m = !1,
12
+ children: t
12
13
  }) {
13
- const { locale: f } = u(), r = d((s, p = {}) => c(a, s, f, "en", p)), { followed: i } = w();
14
- if (m || !o?.protected || o?.protected === "all")
15
- return l;
16
- const { protected: t } = o;
17
- return t === !0 || t === "private" ? /* @__PURE__ */ e(n, { children: r("underProtected") }) : t === "follower-only" ? i ? l : /* @__PURE__ */ e(n, { children: r("followersOnly") }) : /* @__PURE__ */ e(n, { children: r("underProtected") });
14
+ const { locale: s } = d(), e = c((p, u = {}) => a(w, p, s, "en", u)), { followed: i } = x();
15
+ if (f || !r?.protected || r?.protected === "all")
16
+ return t;
17
+ const { protected: o } = r;
18
+ return !m && o === "follower-only" ? t : o === !0 || o === "private" ? /* @__PURE__ */ l(n, { children: e("underProtected") }) : o === "follower-only" ? i ? t : /* @__PURE__ */ l(n, { children: e("followersOnly") }) : /* @__PURE__ */ l(n, { children: e("underProtected") });
18
19
  }
19
20
  export {
20
- k as default
21
+ z as default
21
22
  };