@arcblock/ux 3.1.55 → 3.1.57
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/UserCard/Content/minimal.js +86 -80
- package/lib/Util/logger.js +10 -9
- package/lib/package.json.js +1 -1
- package/package.json +7 -7
- package/src/UserCard/Content/minimal.tsx +24 -21
- package/src/Util/logger.ts +6 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useMediaQuery as
|
|
1
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as w } from "react";
|
|
3
|
+
import { useMediaQuery as g, Box as o, Typography as y, Divider as C } from "@mui/material";
|
|
4
4
|
import { DID as S } from "../../DID/index.js";
|
|
5
5
|
import b from "./tooltip-avatar.js";
|
|
6
6
|
import { renderTopRight as v } from "../components.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import j from "./shorten-label.js";
|
|
8
|
+
import W from "../Cards/social-actions.js";
|
|
9
9
|
function A({ ...s }) {
|
|
10
10
|
const {
|
|
11
11
|
user: e,
|
|
@@ -13,16 +13,16 @@ function A({ ...s }) {
|
|
|
13
13
|
didProps: d,
|
|
14
14
|
avatarSize: m,
|
|
15
15
|
shouldShowHoverCard: p,
|
|
16
|
-
renderCardContent:
|
|
16
|
+
renderCardContent: h,
|
|
17
17
|
renderTopRightContent: l,
|
|
18
|
-
topRightMaxWidth:
|
|
18
|
+
topRightMaxWidth: f,
|
|
19
19
|
avatarProps: x,
|
|
20
20
|
shortenLabelProps: u,
|
|
21
21
|
renderName: a,
|
|
22
|
-
...
|
|
23
|
-
} = s,
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
22
|
+
...i
|
|
23
|
+
} = s, n = g("(max-width:500px)");
|
|
24
|
+
return /* @__PURE__ */ t(
|
|
25
|
+
o,
|
|
26
26
|
{
|
|
27
27
|
className: "user-card__avatar-content",
|
|
28
28
|
sx: {
|
|
@@ -30,82 +30,88 @@ function A({ ...s }) {
|
|
|
30
30
|
justifyContent: "space-between",
|
|
31
31
|
alignItems: "center"
|
|
32
32
|
},
|
|
33
|
-
children:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
user: e,
|
|
53
|
-
avatarSize: m,
|
|
54
|
-
shouldShowHoverCard: p,
|
|
55
|
-
renderCardContent: f,
|
|
56
|
-
avatarProps: x,
|
|
57
|
-
...o
|
|
58
|
-
}
|
|
59
|
-
),
|
|
60
|
-
/* @__PURE__ */ r(n, { children: [
|
|
33
|
+
children: /* @__PURE__ */ r(
|
|
34
|
+
o,
|
|
35
|
+
{
|
|
36
|
+
sx: {
|
|
37
|
+
display: "flex",
|
|
38
|
+
justifyContent: "space-between",
|
|
39
|
+
flexDirection: n ? "column" : "row",
|
|
40
|
+
alignItems: n ? "flex-start" : "center",
|
|
41
|
+
gap: n ? 2 : 1,
|
|
42
|
+
flex: 1,
|
|
43
|
+
minWidth: 0,
|
|
44
|
+
flexWrap: "wrap"
|
|
45
|
+
},
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ r(
|
|
48
|
+
o,
|
|
49
|
+
{
|
|
50
|
+
sx: { display: "flex", justifyContent: "flex-start", alignItems: "center", gap: 1, flex: 1, width: "100%" },
|
|
51
|
+
children: [
|
|
61
52
|
/* @__PURE__ */ t(
|
|
62
|
-
|
|
53
|
+
b,
|
|
63
54
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
fontSize: 18,
|
|
71
|
-
lineHeight: 1.1
|
|
72
|
-
},
|
|
73
|
-
children: a ? a(e) : /* @__PURE__ */ t(W, { sx: { fontWeight: 500 }, ...u, children: e.fullName || e.email || e.did })
|
|
55
|
+
user: e,
|
|
56
|
+
avatarSize: m,
|
|
57
|
+
shouldShowHoverCard: p,
|
|
58
|
+
renderCardContent: h,
|
|
59
|
+
avatarProps: x,
|
|
60
|
+
...i
|
|
74
61
|
}
|
|
75
62
|
),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
63
|
+
/* @__PURE__ */ r(o, { sx: { width: "100%" }, children: [
|
|
64
|
+
/* @__PURE__ */ r(o, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1, width: "100%" }, children: [
|
|
65
|
+
/* @__PURE__ */ t(
|
|
66
|
+
y,
|
|
67
|
+
{
|
|
68
|
+
variant: "subtitle1",
|
|
69
|
+
className: "user-card__full-name-label",
|
|
70
|
+
noWrap: !0,
|
|
71
|
+
sx: {
|
|
72
|
+
fontWeight: 500,
|
|
73
|
+
color: "text.primary",
|
|
74
|
+
fontSize: 18,
|
|
75
|
+
lineHeight: 1.1
|
|
76
|
+
},
|
|
77
|
+
children: a ? a(e) : /* @__PURE__ */ t(j, { sx: { fontWeight: 500 }, ...u, children: e.fullName || e.email || e.did })
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
v(l, f)
|
|
81
|
+
] }),
|
|
82
|
+
c && e.did ? /* @__PURE__ */ t(
|
|
83
|
+
S,
|
|
84
|
+
{
|
|
85
|
+
did: e.did,
|
|
86
|
+
size: 14,
|
|
87
|
+
copyable: !0,
|
|
88
|
+
compact: !0,
|
|
89
|
+
locale: "en",
|
|
90
|
+
sx: { lineHeight: 1.5 },
|
|
91
|
+
...d ?? {}
|
|
92
|
+
}
|
|
93
|
+
) : null
|
|
94
|
+
] })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
n && !l && i.showSocialActions ? /* @__PURE__ */ t(C, { sx: { width: "100%" } }) : null,
|
|
99
|
+
l ? null : /* @__PURE__ */ t(
|
|
100
|
+
W,
|
|
101
|
+
{
|
|
102
|
+
onFollowClick: i.onFollowClick,
|
|
103
|
+
showSocialActions: i.showSocialActions,
|
|
104
|
+
user: e,
|
|
105
|
+
session: i.session
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
)
|
|
105
111
|
}
|
|
106
112
|
);
|
|
107
113
|
}
|
|
108
|
-
const P =
|
|
114
|
+
const P = w(A);
|
|
109
115
|
export {
|
|
110
116
|
P as default
|
|
111
117
|
};
|
package/lib/Util/logger.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
get(
|
|
4
|
-
return (...
|
|
1
|
+
import n from "debug";
|
|
2
|
+
const c = n, u = (o) => new Proxy(window.console, {
|
|
3
|
+
get(r, e) {
|
|
4
|
+
return (...i) => {
|
|
5
5
|
try {
|
|
6
|
-
return ["log", "debug", "info", "warn", "error"].includes(
|
|
7
|
-
} catch (
|
|
8
|
-
console.error(`Logger error in ${
|
|
6
|
+
return ["log", "debug", "info", "warn", "error"].includes(e) ? r[e](o, ...i) : r[e] instanceof Function ? r[e](...i) : r[e];
|
|
7
|
+
} catch (l) {
|
|
8
|
+
console.error(`Logger error in ${o}:`, l);
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
+
window.blocklet?.ENABLE_DEBUG_TMP === "false" ? n.disable() : window.blocklet?.ENABLE_DEBUG_TMP && n.enable(window.blocklet?.ENABLE_DEBUG_TMP);
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
c as createDebug,
|
|
17
|
+
u as createLogger
|
|
17
18
|
};
|
package/lib/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.57",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -68,16 +68,16 @@
|
|
|
68
68
|
"react": "^19.0.0",
|
|
69
69
|
"react-router-dom": "^6.22.3"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "ff0e37a8ddeb14f0ebd4e1d55a308b17041e4d70",
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@arcblock/bridge": "3.1.
|
|
73
|
+
"@arcblock/bridge": "3.1.57",
|
|
74
74
|
"@arcblock/did": "^1.27.2",
|
|
75
75
|
"@arcblock/did-motif": "^1.1.14",
|
|
76
|
-
"@arcblock/icons": "3.1.
|
|
77
|
-
"@arcblock/nft-display": "3.1.
|
|
78
|
-
"@arcblock/react-hooks": "3.1.
|
|
76
|
+
"@arcblock/icons": "3.1.57",
|
|
77
|
+
"@arcblock/nft-display": "3.1.57",
|
|
78
|
+
"@arcblock/react-hooks": "3.1.57",
|
|
79
79
|
"@blocklet/js-sdk": "1.17.0-beta-20251104-112713-e947b159",
|
|
80
|
-
"@blocklet/theme": "3.1.
|
|
80
|
+
"@blocklet/theme": "3.1.57",
|
|
81
81
|
"@fontsource/roboto": "~5.1.1",
|
|
82
82
|
"@fontsource/ubuntu-mono": "^5.2.6",
|
|
83
83
|
"@iconify-icons/logos": "^1.2.36",
|
|
@@ -51,7 +51,8 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
|
51
51
|
minWidth: 0,
|
|
52
52
|
flexWrap: 'wrap',
|
|
53
53
|
}}>
|
|
54
|
-
<Box
|
|
54
|
+
<Box
|
|
55
|
+
sx={{ display: 'flex', justifyContent: 'flex-start', alignItems: 'center', gap: 1, flex: 1, width: '100%' }}>
|
|
55
56
|
<TooltipAvatar
|
|
56
57
|
user={user}
|
|
57
58
|
avatarSize={avatarSize}
|
|
@@ -60,25 +61,28 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
|
60
61
|
avatarProps={avatarProps}
|
|
61
62
|
{...rest}
|
|
62
63
|
/>
|
|
63
|
-
<Box>
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
renderName(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
64
|
+
<Box sx={{ width: '100%' }}>
|
|
65
|
+
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 1, width: '100%' }}>
|
|
66
|
+
<Typography
|
|
67
|
+
variant="subtitle1"
|
|
68
|
+
className="user-card__full-name-label"
|
|
69
|
+
noWrap
|
|
70
|
+
sx={{
|
|
71
|
+
fontWeight: 500,
|
|
72
|
+
color: 'text.primary',
|
|
73
|
+
fontSize: 18,
|
|
74
|
+
lineHeight: 1.1,
|
|
75
|
+
}}>
|
|
76
|
+
{renderName ? (
|
|
77
|
+
renderName(user)
|
|
78
|
+
) : (
|
|
79
|
+
<ShortenLabel sx={{ fontWeight: 500 }} {...shortenLabelProps}>
|
|
80
|
+
{user.fullName || user.email || user.did}
|
|
81
|
+
</ShortenLabel>
|
|
82
|
+
)}
|
|
83
|
+
</Typography>
|
|
84
|
+
{renderTopRight(renderTopRightContent, topRightMaxWidth)}
|
|
85
|
+
</Box>
|
|
82
86
|
|
|
83
87
|
{showDid && user.did ? (
|
|
84
88
|
<DID
|
|
@@ -103,7 +107,6 @@ function MinimalContent({ ...props }: MinimalContentProps) {
|
|
|
103
107
|
/>
|
|
104
108
|
) : null}
|
|
105
109
|
</Box>
|
|
106
|
-
{renderTopRight(renderTopRightContent, topRightMaxWidth)}
|
|
107
110
|
</Box>
|
|
108
111
|
);
|
|
109
112
|
}
|
package/src/Util/logger.ts
CHANGED