@arcblock/ux 3.0.28 → 3.0.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,12 +1,21 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { Box as
|
3
|
-
import
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
2
|
+
import { Box as r, Typography as n } from "@mui/material";
|
3
|
+
import i from "../../Img/index.js";
|
4
|
+
import { BLOCKLET_SERVICE_PATH_PREFIX as s } from "../../Util/constant.js";
|
5
|
+
const l = (e) => {
|
6
|
+
if (!e) return "";
|
7
|
+
try {
|
8
|
+
return new URL(e).protocol !== "https:" ? (console.warn("Image URL must use HTTPS protocol:", e), "") : `${s}/proxy?url=${e}`;
|
9
|
+
} catch (t) {
|
10
|
+
return console.warn("Invalid image URL format:", e, t), "";
|
11
|
+
}
|
12
|
+
};
|
13
|
+
function g({
|
14
|
+
requestAppInfo: e,
|
15
|
+
currentAppInfo: t
|
7
16
|
}) {
|
8
|
-
return /* @__PURE__ */
|
9
|
-
|
17
|
+
return /* @__PURE__ */ a(
|
18
|
+
r,
|
10
19
|
{
|
11
20
|
sx: {
|
12
21
|
textAlign: "center",
|
@@ -16,8 +25,8 @@ function c({
|
|
16
25
|
gap: 2
|
17
26
|
},
|
18
27
|
children: [
|
19
|
-
/* @__PURE__ */
|
20
|
-
|
28
|
+
/* @__PURE__ */ a(
|
29
|
+
r,
|
21
30
|
{
|
22
31
|
sx: {
|
23
32
|
display: "flex",
|
@@ -25,9 +34,18 @@ function c({
|
|
25
34
|
justifyContent: "center"
|
26
35
|
},
|
27
36
|
children: [
|
28
|
-
/* @__PURE__ */
|
29
|
-
|
30
|
-
|
37
|
+
/* @__PURE__ */ o(
|
38
|
+
i,
|
39
|
+
{
|
40
|
+
src: t.appLogo,
|
41
|
+
alt: "Server",
|
42
|
+
width: 48,
|
43
|
+
height: 48,
|
44
|
+
fallback: l(t.appLogo)
|
45
|
+
}
|
46
|
+
),
|
47
|
+
/* @__PURE__ */ a(
|
48
|
+
r,
|
31
49
|
{
|
32
50
|
sx: {
|
33
51
|
mx: 2,
|
@@ -42,18 +60,27 @@ function c({
|
|
42
60
|
}
|
43
61
|
},
|
44
62
|
children: [
|
45
|
-
/* @__PURE__ */
|
46
|
-
/* @__PURE__ */
|
47
|
-
/* @__PURE__ */
|
63
|
+
/* @__PURE__ */ o(r, { className: "dot" }),
|
64
|
+
/* @__PURE__ */ o(r, { className: "dot" }),
|
65
|
+
/* @__PURE__ */ o(r, { className: "dot" })
|
48
66
|
]
|
49
67
|
}
|
50
68
|
),
|
51
|
-
/* @__PURE__ */
|
69
|
+
/* @__PURE__ */ o(
|
70
|
+
i,
|
71
|
+
{
|
72
|
+
src: e.appLogo,
|
73
|
+
alt: e.appName,
|
74
|
+
width: 48,
|
75
|
+
height: 48,
|
76
|
+
fallback: l(e.appLogo)
|
77
|
+
}
|
78
|
+
)
|
52
79
|
]
|
53
80
|
}
|
54
81
|
),
|
55
|
-
/* @__PURE__ */
|
56
|
-
|
82
|
+
/* @__PURE__ */ a(
|
83
|
+
n,
|
57
84
|
{
|
58
85
|
sx: {
|
59
86
|
mb: 1,
|
@@ -62,7 +89,7 @@ function c({
|
|
62
89
|
children: [
|
63
90
|
"Authorize",
|
64
91
|
" ",
|
65
|
-
/* @__PURE__ */
|
92
|
+
/* @__PURE__ */ o(r, { component: "span", sx: { color: "primary.main" }, children: e.appName })
|
66
93
|
]
|
67
94
|
}
|
68
95
|
)
|
@@ -71,5 +98,5 @@ function c({
|
|
71
98
|
);
|
72
99
|
}
|
73
100
|
export {
|
74
|
-
|
101
|
+
g as default
|
75
102
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.30",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -60,16 +60,16 @@
|
|
60
60
|
"react": "^19.0.0",
|
61
61
|
"react-router-dom": "^6.22.3"
|
62
62
|
},
|
63
|
-
"gitHead": "
|
63
|
+
"gitHead": "bd150f8c141a1d246073a775e4f2ab6de4ad5891",
|
64
64
|
"dependencies": {
|
65
|
-
"@arcblock/bridge": "3.0.
|
66
|
-
"@arcblock/did": "^1.
|
65
|
+
"@arcblock/bridge": "3.0.30",
|
66
|
+
"@arcblock/did": "^1.21.0",
|
67
67
|
"@arcblock/did-motif": "^1.1.14",
|
68
|
-
"@arcblock/icons": "3.0.
|
69
|
-
"@arcblock/nft-display": "3.0.
|
70
|
-
"@arcblock/react-hooks": "3.0.
|
68
|
+
"@arcblock/icons": "3.0.30",
|
69
|
+
"@arcblock/nft-display": "3.0.30",
|
70
|
+
"@arcblock/react-hooks": "3.0.30",
|
71
71
|
"@blocklet/js-sdk": "^1.16.46",
|
72
|
-
"@blocklet/theme": "3.0.
|
72
|
+
"@blocklet/theme": "3.0.30",
|
73
73
|
"@fontsource/roboto": "~5.1.1",
|
74
74
|
"@fontsource/ubuntu-mono": "^5.2.6",
|
75
75
|
"@iconify-icons/logos": "^1.2.36",
|
@@ -77,7 +77,7 @@
|
|
77
77
|
"@iconify-icons/mdi": "^1.2.48",
|
78
78
|
"@iconify-icons/tabler": "^1.2.95",
|
79
79
|
"@iconify/react": "^5.2.1",
|
80
|
-
"@ocap/mcrypto": "^1.
|
80
|
+
"@ocap/mcrypto": "^1.21.0",
|
81
81
|
"@solana/qr-code-styling": "^1.6.0",
|
82
82
|
"@types/dompurify": "^3.2.0",
|
83
83
|
"@types/mui-datatables": "^4.3.12",
|
@@ -1,5 +1,28 @@
|
|
1
1
|
import { Box, Typography } from '@mui/material';
|
2
2
|
import Img from '../../Img';
|
3
|
+
import { BLOCKLET_SERVICE_PATH_PREFIX } from '../../Util/constant';
|
4
|
+
|
5
|
+
const getProxyImageUrl = (url: string) => {
|
6
|
+
if (!url) return '';
|
7
|
+
|
8
|
+
try {
|
9
|
+
// 检查是否是一个有效的URL
|
10
|
+
const urlObj = new URL(url);
|
11
|
+
|
12
|
+
// 检查协议是否是https
|
13
|
+
if (urlObj.protocol !== 'https:') {
|
14
|
+
console.warn('Image URL must use HTTPS protocol:', url);
|
15
|
+
return '';
|
16
|
+
}
|
17
|
+
|
18
|
+
// 返回代理URL
|
19
|
+
return `${BLOCKLET_SERVICE_PATH_PREFIX}/proxy?url=${url}`;
|
20
|
+
} catch (error) {
|
21
|
+
// URL construction failed, indicating invalid URL format
|
22
|
+
console.warn('Invalid image URL format:', url, error);
|
23
|
+
return '';
|
24
|
+
}
|
25
|
+
};
|
3
26
|
|
4
27
|
export type RequestAppInfo = {
|
5
28
|
appLogo: string;
|
@@ -36,7 +59,13 @@ export default function AuthAppsInfo({
|
|
36
59
|
justifyContent: 'center',
|
37
60
|
}}>
|
38
61
|
{/* FIXME: @zhanghan 增加 hover 的效果 */}
|
39
|
-
<Img
|
62
|
+
<Img
|
63
|
+
src={currentAppInfo.appLogo}
|
64
|
+
alt="Server"
|
65
|
+
width={48}
|
66
|
+
height={48}
|
67
|
+
fallback={getProxyImageUrl(currentAppInfo.appLogo)}
|
68
|
+
/>
|
40
69
|
|
41
70
|
<Box
|
42
71
|
sx={{
|
@@ -57,7 +86,13 @@ export default function AuthAppsInfo({
|
|
57
86
|
</Box>
|
58
87
|
|
59
88
|
{/* FIXME: @zhanghan 增加 hover 的效果 */}
|
60
|
-
<Img
|
89
|
+
<Img
|
90
|
+
src={requestAppInfo.appLogo}
|
91
|
+
alt={requestAppInfo.appName}
|
92
|
+
width={48}
|
93
|
+
height={48}
|
94
|
+
fallback={getProxyImageUrl(requestAppInfo.appLogo)}
|
95
|
+
/>
|
61
96
|
</Box>
|
62
97
|
|
63
98
|
<Typography
|