@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.
- package/lib/Footer/links.js +26 -33
- package/lib/UserCenter/components/fallback.d.ts +2 -1
- package/lib/UserCenter/components/fallback.js +17 -16
- package/lib/UserCenter/components/user-center.js +187 -173
- package/lib/UserCenter/components/user-info/social-actions/chat.js +12 -11
- package/lib/UserCenter/components/user-info/user-basic-info.d.ts +2 -1
- package/lib/UserCenter/components/user-info/user-basic-info.js +45 -44
- package/lib/blocklets.js +56 -54
- package/lib/common/notification-addon.js +8 -8
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +36 -43
- package/package.json +9 -10
- package/src/Footer/links.jsx +10 -7
- package/src/UserCenter/components/fallback.tsx +6 -0
- package/src/UserCenter/components/user-center.tsx +16 -6
- package/src/UserCenter/components/user-info/social-actions/chat.tsx +2 -1
- package/src/UserCenter/components/user-info/user-basic-info.tsx +3 -1
- package/src/blocklets.js +5 -1
- package/src/common/notification-addon.jsx +1 -1
- package/src/utils.js +5 -26
package/lib/Footer/links.js
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
import { jsx as r, jsxs as m, Fragment as
|
|
2
|
-
import { useState as
|
|
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
|
|
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
|
|
10
|
-
import
|
|
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
|
|
14
|
-
const [g, b] =
|
|
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
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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 =
|
|
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
|
-
|
|
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,
|
|
68
|
+
}) : null, [e, d, x, g]);
|
|
76
69
|
return e?.length ? /* @__PURE__ */ r(
|
|
77
|
-
|
|
70
|
+
S,
|
|
78
71
|
{
|
|
79
|
-
...
|
|
80
|
-
className: c(
|
|
72
|
+
...k,
|
|
73
|
+
className: c(k.className, {
|
|
81
74
|
"footer-links--grouped": h,
|
|
82
75
|
"footer-links--flow": d,
|
|
83
|
-
"footer-links--columns":
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import n from "@arcblock/ux/lib/Empty";
|
|
3
|
-
import { translate as
|
|
4
|
-
import { useMemoizedFn as
|
|
5
|
-
import { useLocaleContext as
|
|
6
|
-
import { translations as
|
|
7
|
-
import { useUserFollowersContext as
|
|
8
|
-
function
|
|
9
|
-
currentActiveTab:
|
|
10
|
-
isMyself:
|
|
11
|
-
|
|
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:
|
|
14
|
-
if (
|
|
15
|
-
return
|
|
16
|
-
const { protected:
|
|
17
|
-
return t === !0 ||
|
|
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
|
-
|
|
21
|
+
z as default
|
|
21
22
|
};
|