@arcblock/ux 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.
- package/lib/Address/did-address.js +47 -49
- package/lib/Address/responsive-did-address.js +53 -57
- package/lib/Avatar/index.js +16 -16
- package/lib/BlockletV2/blocklet.js +64 -64
- package/lib/BlockletV2/components/tooltip-icon.js +26 -27
- package/lib/CardSelector/index.js +1 -2
- package/lib/ClickToCopy/hook.js +10 -11
- package/lib/ClickToCopy/index.js +16 -16
- package/lib/Config/theme-mode-toggle.js +7 -8
- package/lib/DID/index.js +131 -133
- package/lib/DIDConnect/app-info-item.js +18 -18
- package/lib/DIDConnect/auth-apps/index.js +83 -84
- package/lib/DIDConnect/did-connect-container.js +89 -90
- package/lib/DIDConnect/did-connect-footer.js +25 -25
- package/lib/DIDConnect/landing-page.js +17 -17
- package/lib/DIDConnect/powered-by.js +11 -11
- package/lib/DIDConnect/request-storage-access-api-dialog.js +36 -37
- package/lib/DIDConnect/with-container.js +66 -68
- package/lib/Dialog/use-confirm.js +40 -43
- package/lib/Earth/index.js +21 -22
- package/lib/Footer/index.js +15 -16
- package/lib/Header/responsive-header.js +23 -24
- package/lib/Layout/dashboard/index.js +63 -72
- package/lib/Layout/dashboard/sidebar.js +20 -21
- package/lib/Layout/dashboard-legacy/index.js +52 -52
- package/lib/Locale/context.js +36 -37
- package/lib/Locale/selector.js +40 -42
- package/lib/NFTDisplay/index.js +114 -118
- package/lib/NFTDisplay/render-svg.js +12 -12
- package/lib/NavMenu/nav-menu.js +159 -161
- package/lib/NavMenu/sub-container.js +25 -26
- package/lib/PageScroller/index.js +28 -32
- package/lib/Passport/passport.js +11 -11
- package/lib/PhoneInput/country-select.js +38 -38
- package/lib/PhoneInput/index.js +65 -66
- package/lib/Screenshot/index.js +26 -27
- package/lib/SessionBlocklet/index.js +87 -93
- package/lib/SessionPermission/index.js +5 -9
- package/lib/SessionUser/components/did-space.js +24 -25
- package/lib/SessionUser/components/logged-in.js +122 -127
- package/lib/SessionUser/components/quick-login-item.js +41 -42
- package/lib/SessionUser/components/session-user-item.js +35 -36
- package/lib/SessionUser/components/session-user-switch.js +81 -85
- package/lib/SessionUser/components/un-login.js +41 -41
- package/lib/SessionUser/components/user-info.js +43 -47
- package/lib/SessionUser/index.js +1 -1
- package/lib/SessionUser/libs/utils.js +24 -30
- package/lib/SharedBridge/index.js +35 -35
- package/lib/Theme/index.js +16 -16
- package/lib/Theme/theme.js +42 -43
- package/lib/Toast/index.js +24 -25
- package/lib/Typography/index.js +42 -42
- package/lib/UserCard/Content/basic.js +91 -93
- package/lib/UserCard/Content/shorten-label.js +9 -9
- package/lib/UserCard/components.js +15 -15
- package/lib/Util/deprecate.js +1 -1
- package/lib/Util/federated.js +28 -32
- package/lib/Util/iframe.js +9 -10
- package/lib/Util/index.js +134 -135
- package/lib/Util/security.js +9 -10
- package/lib/Util/wallet.js +6 -9
- package/lib/VerificationCode/index.js +26 -28
- package/lib/hooks/use-blocklet-logo.js +11 -14
- package/lib/ux.css +1 -1
- package/lib/withTracker/index.js +13 -14
- package/package.json +9 -10
@@ -1,49 +1,48 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { Tooltip as
|
3
|
-
import { mergeSx as
|
4
|
-
function
|
5
|
-
title:
|
6
|
-
sx:
|
7
|
-
children:
|
8
|
-
slotProps:
|
9
|
-
fontSize:
|
10
|
-
fontWeight:
|
11
|
-
color:
|
12
|
-
...
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
2
|
+
import { Tooltip as i, tooltipClasses as x } from "@mui/material";
|
3
|
+
import { mergeSx as l } from "../../Util/style.js";
|
4
|
+
function d({
|
5
|
+
title: o,
|
6
|
+
sx: n,
|
7
|
+
children: t,
|
8
|
+
slotProps: p,
|
9
|
+
fontSize: r = 12,
|
10
|
+
fontWeight: e = 500,
|
11
|
+
color: s = "text.contrast",
|
12
|
+
...a
|
13
13
|
}) {
|
14
|
-
|
15
|
-
|
16
|
-
n,
|
14
|
+
return o ? /* @__PURE__ */ m(
|
15
|
+
i,
|
17
16
|
{
|
18
|
-
title:
|
17
|
+
title: o,
|
19
18
|
placement: "top",
|
20
|
-
...
|
19
|
+
...a,
|
21
20
|
slotProps: {
|
22
21
|
popper: {
|
23
|
-
...
|
24
|
-
sx:
|
22
|
+
...p?.popper,
|
23
|
+
sx: l(
|
25
24
|
{
|
26
|
-
[`& .${
|
27
|
-
fontSize:
|
28
|
-
fontWeight:
|
25
|
+
[`& .${x.tooltip}`]: {
|
26
|
+
fontSize: r,
|
27
|
+
fontWeight: e,
|
29
28
|
boxShadow: 2,
|
30
29
|
marginBottom: "6px !important",
|
31
30
|
borderRadius: "8px",
|
32
31
|
cursor: "default",
|
33
|
-
color:
|
32
|
+
color: s,
|
34
33
|
display: "flex",
|
35
34
|
alignItems: "center"
|
36
35
|
}
|
37
36
|
},
|
38
37
|
// @ts-expect-error
|
39
|
-
|
38
|
+
p?.popper?.sx
|
40
39
|
)
|
41
40
|
}
|
42
41
|
},
|
43
|
-
children:
|
42
|
+
children: t
|
44
43
|
}
|
45
|
-
) :
|
44
|
+
) : t;
|
46
45
|
}
|
47
46
|
export {
|
48
|
-
|
47
|
+
d as default
|
49
48
|
};
|
@@ -20,8 +20,7 @@ function $({
|
|
20
20
|
}
|
21
21
|
};
|
22
22
|
y(() => {
|
23
|
-
|
24
|
-
n(h), (t = c.current) == null || t.addEventListener("touchmove", (e) => e.preventDefault(), { passive: !1 });
|
23
|
+
n(h), c.current?.addEventListener("touchmove", (t) => t.preventDefault(), { passive: !1 });
|
25
24
|
}, []);
|
26
25
|
let d;
|
27
26
|
return /* @__PURE__ */ r(b, { ref: c, onTouchStart: (t) => {
|
package/lib/ClickToCopy/hook.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { useState as
|
2
|
-
import
|
3
|
-
const
|
1
|
+
import { useState as p, useRef as u, useEffect as f } from "react";
|
2
|
+
import a from "copy-to-clipboard";
|
3
|
+
const i = {
|
4
4
|
en: {
|
5
5
|
copy: "Click To Copy",
|
6
6
|
copied: "Copied!"
|
@@ -10,21 +10,20 @@ const r = {
|
|
10
10
|
copied: "已复制!"
|
11
11
|
}
|
12
12
|
};
|
13
|
-
function
|
14
|
-
const [t, o] =
|
15
|
-
|
16
|
-
e && e.stopPropagation(), l(s || (((i = n.current) == null ? void 0 : i.textContent) ?? "")), o(!0);
|
13
|
+
function C({ content: r, locale: s = "en" }) {
|
14
|
+
const [t, o] = p(!1), n = u(null), c = (e) => {
|
15
|
+
e && e.stopPropagation(), a(r || (n.current?.textContent ?? "")), o(!0);
|
17
16
|
};
|
18
|
-
return
|
17
|
+
return f(() => {
|
19
18
|
let e;
|
20
19
|
return t && (e = setTimeout(() => o(!1), 2e3)), () => clearTimeout(e);
|
21
20
|
}, [t]), {
|
22
21
|
containerRef: n,
|
23
22
|
copied: t,
|
24
|
-
copy:
|
25
|
-
texts:
|
23
|
+
copy: c,
|
24
|
+
texts: i[s] || i.en
|
26
25
|
};
|
27
26
|
}
|
28
27
|
export {
|
29
|
-
|
28
|
+
C as default
|
30
29
|
};
|
package/lib/ClickToCopy/index.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
import { jsx as e, Fragment as
|
2
|
-
import { useSize as
|
3
|
-
import { Tooltip as
|
1
|
+
import { jsx as e, Fragment as j } from "react/jsx-runtime";
|
2
|
+
import { useSize as z } from "ahooks";
|
3
|
+
import { Tooltip as v } from "@mui/material";
|
4
4
|
import t from "lodash/isUndefined";
|
5
|
-
import { useSnackbar as
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import { mergeProps as
|
5
|
+
import { useSnackbar as F } from "notistack";
|
6
|
+
import S from "./hook.js";
|
7
|
+
import U, { ToastProvider as _ } from "../Toast/index.js";
|
8
|
+
import { mergeProps as B } from "../Util/index.js";
|
9
9
|
import { styled as s } from "../Theme/index.js";
|
10
10
|
import { default as X } from "./copy-button.js";
|
11
|
-
const
|
11
|
+
const L = s("span")`
|
12
12
|
display: inline;
|
13
13
|
white-space: pre-wrap;
|
14
14
|
word-wrap: break-word;
|
@@ -19,18 +19,18 @@ const R = s("span")`
|
|
19
19
|
padding: 1px 12px;
|
20
20
|
background-color: rgba(0, 0, 0, 0.08);
|
21
21
|
cursor: pointer;
|
22
|
-
`,
|
22
|
+
`, O = s("span")`
|
23
23
|
cursor: pointer;
|
24
24
|
`;
|
25
|
-
function
|
26
|
-
const o = Object.assign({},
|
25
|
+
function R(c) {
|
26
|
+
const o = Object.assign({}, c);
|
27
27
|
t(o.content) && (o.content = ""), t(o.tip) && (o.tip = ""), t(o.copiedTip) && (o.copiedTip = ""), t(o.tipPlacement) && (o.tipPlacement = "right"), t(o.locale) && (o.locale = "en"), t(o.unstyled) && (o.unstyled = !1);
|
28
|
-
const
|
29
|
-
|
30
|
-
}, children:
|
31
|
-
return
|
28
|
+
const a = B(o, R, ["style"]), { children: d, content: n, tip: l, copiedTip: m, tipPlacement: f, locale: u, style: y, unstyled: C, ...w } = a, { containerRef: b, copied: h, copy: g, texts: i } = S({ content: n, locale: u }), x = l || i.copy, r = m || i.copied, T = F(), k = z(document.body)?.width || 0, p = /* @__PURE__ */ e(v, { title: h ? r : x, ...w, placement: f, disableFocusListener: !0, children: /* @__PURE__ */ e(C ? O : L, { ref: b, style: y, onClick: (P) => {
|
29
|
+
g(P), k < 600 && U.success(r);
|
30
|
+
}, children: d || n }) });
|
31
|
+
return T ? /* @__PURE__ */ e(j, { children: p }) : /* @__PURE__ */ e(_, { children: p });
|
32
32
|
}
|
33
33
|
export {
|
34
34
|
X as CopyButton,
|
35
|
-
|
35
|
+
R as default
|
36
36
|
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
|
-
import { IconButton as
|
3
|
-
import { Brightness2Outlined as
|
4
|
-
import { useColorScheme as
|
5
|
-
function
|
6
|
-
|
7
|
-
|
8
|
-
return o ? i === "system" || ((t = (r = window.blocklet) == null ? void 0 : r.theme) == null ? void 0 : t.prefer) === "system" ? /* @__PURE__ */ e(l, { onClick: o, children: n === "light" ? /* @__PURE__ */ e(s, {}) : /* @__PURE__ */ e(m, {}) }) : null : (process.env.NODE_ENV !== "production" && console.warn("Please ensure the component is wrapped with ConfigProvider context"), null);
|
2
|
+
import { IconButton as n } from "@mui/material";
|
3
|
+
import { Brightness2Outlined as i, LightModeOutlined as l } from "@mui/icons-material";
|
4
|
+
import { useColorScheme as s } from "../Theme/theme-provider.js";
|
5
|
+
function f() {
|
6
|
+
const { mode: r, toggleMode: o, prefer: t } = s();
|
7
|
+
return o ? t === "system" || window.blocklet?.theme?.prefer === "system" ? /* @__PURE__ */ e(n, { onClick: o, children: r === "light" ? /* @__PURE__ */ e(i, {}) : /* @__PURE__ */ e(l, {}) }) : null : (process.env.NODE_ENV !== "production" && console.warn("Please ensure the component is wrapped with ConfigProvider context"), null);
|
9
8
|
}
|
10
9
|
export {
|
11
|
-
|
10
|
+
f as default
|
12
11
|
};
|
package/lib/DID/index.js
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { getDIDMotifInfo as
|
3
|
-
import { types as
|
4
|
-
import
|
5
|
-
import { Icon as
|
6
|
-
import
|
7
|
-
import { Box as
|
8
|
-
import { useMemoizedFn as
|
9
|
-
import { useRef as
|
10
|
-
import { toAddress as
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import { DID_PREFIX as
|
15
|
-
import { translate as
|
16
|
-
import { isEthereumDid as
|
17
|
-
const
|
1
|
+
import { jsxs as w, Fragment as Q, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { getDIDMotifInfo as O } from "@arcblock/did-motif";
|
3
|
+
import { types as E } from "@ocap/mcrypto";
|
4
|
+
import j from "qrcode.react";
|
5
|
+
import { Icon as q } from "@iconify/react";
|
6
|
+
import X from "@iconify-icons/material-symbols/qr-code-rounded";
|
7
|
+
import { Box as H, Dialog as Y, DialogContent as G, Typography as P } from "@mui/material";
|
8
|
+
import { useMemoizedFn as b, useCreation as D } from "ahooks";
|
9
|
+
import { useRef as J, useState as K, useImperativeHandle as V } from "react";
|
10
|
+
import { toAddress as Z } from "@arcblock/did";
|
11
|
+
import ee from "lodash/noop";
|
12
|
+
import W from "../Address/index.js";
|
13
|
+
import oe from "../Avatar/index.js";
|
14
|
+
import { DID_PREFIX as re } from "../Util/constant.js";
|
15
|
+
import { translate as te } from "../Locale/util.js";
|
16
|
+
import { isEthereumDid as ne, getDIDColor as se } from "../Util/index.js";
|
17
|
+
const ie = {
|
18
18
|
en: {
|
19
19
|
scanQrcode: "Scan with DID Wallet to view the {role}",
|
20
20
|
download: "Download",
|
@@ -25,129 +25,128 @@ const ae = {
|
|
25
25
|
download: "下载",
|
26
26
|
downloadTips: "没有 DID Wallet ?"
|
27
27
|
}
|
28
|
-
},
|
29
|
-
main:
|
30
|
-
"main.abtnetwork.io":
|
28
|
+
}, y = "xenon-2020-01-15", S = {
|
29
|
+
main: y,
|
30
|
+
"main.abtnetwork.io": y,
|
31
31
|
"beta.abtnetwork.io": "beta"
|
32
|
-
},
|
32
|
+
}, ae = (e, r, o) => o ? se(e) : r.color, de = (e) => !{
|
33
33
|
0: !0,
|
34
34
|
// ACCOUNT
|
35
35
|
6: !0,
|
36
36
|
// ASSET
|
37
37
|
17: !0
|
38
38
|
// TOKEN
|
39
|
-
}[e],
|
40
|
-
if (e ===
|
39
|
+
}[e], le = (e) => {
|
40
|
+
if (e === E.RoleType.ROLE_ANY)
|
41
41
|
return "DID";
|
42
|
-
const [r] = Object.entries(
|
42
|
+
const [r] = Object.entries(E.RoleType).find((o) => o[1] === e) || [];
|
43
43
|
return r ? r.toLowerCase().replace(/role_(\S)/g, (o, n) => n.toUpperCase()) : "DID";
|
44
|
-
},
|
45
|
-
function
|
46
|
-
const o =
|
44
|
+
}, ce = (e, r, o) => r || de(e.roleType) ? o * 0.75 : o;
|
45
|
+
function M({ did: e, showAvatar: r }) {
|
46
|
+
const o = ne(e), n = o ? void 0 : O(e), u = D(() => o ? e : `${re}${e}`, [e, o]), c = b((s, a) => [
|
47
47
|
/* @__PURE__ */ t(
|
48
48
|
"span",
|
49
49
|
{
|
50
|
-
style: { flex: "0 0 auto", color:
|
50
|
+
style: { flex: "0 0 auto", color: ae(e, n, o) },
|
51
51
|
children: "DID:"
|
52
52
|
},
|
53
|
-
`${a}-prefix-did-${
|
53
|
+
`${a}-prefix-did-${s}`
|
54
54
|
),
|
55
|
-
/* @__PURE__ */
|
55
|
+
/* @__PURE__ */ w("span", { className: "did-address-text", children: [
|
56
56
|
o ? "ETH" : "ABT",
|
57
57
|
":"
|
58
|
-
] }, `${a}-prefix-abt-${
|
58
|
+
] }, `${a}-prefix-abt-${s}`),
|
59
59
|
r && /* @__PURE__ */ t(
|
60
|
-
|
60
|
+
oe,
|
61
61
|
{
|
62
62
|
src: "",
|
63
63
|
did: e,
|
64
|
-
size:
|
64
|
+
size: ce(n, o, s || 18),
|
65
65
|
style: { display: "inline-flex", alignItems: "center", marginLeft: 2, marginRight: 4 },
|
66
66
|
blockiesPadding: !1,
|
67
67
|
className: "did-address-avatar",
|
68
68
|
sx: { flexShrink: 0 }
|
69
69
|
},
|
70
|
-
`${a}-avatar-${
|
70
|
+
`${a}-avatar-${s}`
|
71
71
|
)
|
72
72
|
]);
|
73
73
|
return {
|
74
74
|
isEthDid: o,
|
75
75
|
didMotifInfo: n,
|
76
|
-
content:
|
76
|
+
content: u,
|
77
77
|
getPrepend: c
|
78
78
|
};
|
79
79
|
}
|
80
|
-
function
|
80
|
+
function $e({
|
81
81
|
ref: e = void 0,
|
82
82
|
...r
|
83
83
|
}) {
|
84
84
|
const {
|
85
85
|
did: o,
|
86
86
|
chainId: n,
|
87
|
-
roleType:
|
87
|
+
roleType: u,
|
88
88
|
showAvatar: c = !0,
|
89
|
-
showQrcode:
|
89
|
+
showQrcode: s = !1,
|
90
90
|
locale: a = "en",
|
91
|
-
size:
|
92
|
-
component:
|
93
|
-
copyable:
|
94
|
-
responsive:
|
91
|
+
size: v = 0,
|
92
|
+
component: d = "span",
|
93
|
+
copyable: A = !0,
|
94
|
+
responsive: m = !0,
|
95
95
|
showCopyButtonInTooltip: p = !1,
|
96
|
-
inline:
|
97
|
-
append:
|
98
|
-
compact:
|
99
|
-
startChars:
|
100
|
-
endChars:
|
101
|
-
style:
|
102
|
-
className:
|
103
|
-
sx:
|
104
|
-
} = r,
|
105
|
-
size:
|
106
|
-
component:
|
107
|
-
copyable:
|
108
|
-
responsive:
|
96
|
+
inline: f = !1,
|
97
|
+
append: R = null,
|
98
|
+
compact: T = !1,
|
99
|
+
startChars: g = 6,
|
100
|
+
endChars: $ = 6,
|
101
|
+
style: h,
|
102
|
+
className: _,
|
103
|
+
sx: l
|
104
|
+
} = r, i = Z(o), x = {
|
105
|
+
size: v,
|
106
|
+
component: d,
|
107
|
+
copyable: A,
|
108
|
+
responsive: m,
|
109
109
|
showCopyButtonInTooltip: p,
|
110
|
-
inline:
|
111
|
-
append:
|
112
|
-
compact:
|
113
|
-
startChars:
|
114
|
-
endChars:
|
115
|
-
style:
|
116
|
-
className:
|
117
|
-
sx:
|
118
|
-
},
|
119
|
-
|
120
|
-
}),
|
121
|
-
|
110
|
+
inline: f,
|
111
|
+
append: R,
|
112
|
+
compact: T,
|
113
|
+
startChars: g,
|
114
|
+
endChars: $,
|
115
|
+
style: h,
|
116
|
+
className: _,
|
117
|
+
sx: l
|
118
|
+
}, N = J(null), { content: k, getPrepend: F } = M({ did: i, showAvatar: c }), [L, I] = K(!1), U = b(() => {
|
119
|
+
I(!1);
|
120
|
+
}), B = b((C) => {
|
121
|
+
C.stopPropagation(), C.preventDefault(), I(!0);
|
122
122
|
});
|
123
|
-
return
|
123
|
+
return V(e, () => new Proxy(
|
124
124
|
{
|
125
|
-
openQRCode: () =>
|
126
|
-
closeQRCode: () =>
|
125
|
+
openQRCode: () => I(!0),
|
126
|
+
closeQRCode: () => I(!1)
|
127
127
|
},
|
128
128
|
{
|
129
|
-
get(
|
130
|
-
|
131
|
-
return y[z] || ((E = C == null ? void 0 : C.current) == null ? void 0 : E[z]);
|
129
|
+
get(C, z) {
|
130
|
+
return C[z] || N?.current?.[z];
|
132
131
|
}
|
133
132
|
}
|
134
|
-
)), /* @__PURE__ */
|
133
|
+
)), /* @__PURE__ */ w(Q, { children: [
|
135
134
|
/* @__PURE__ */ t(
|
136
|
-
|
135
|
+
W,
|
137
136
|
{
|
138
137
|
locale: a,
|
139
|
-
content:
|
140
|
-
...
|
141
|
-
ref:
|
142
|
-
prepend:
|
143
|
-
append: /* @__PURE__ */
|
144
|
-
|
145
|
-
|
138
|
+
content: k,
|
139
|
+
...x,
|
140
|
+
ref: N,
|
141
|
+
prepend: F(x.size, "address"),
|
142
|
+
append: /* @__PURE__ */ w(Q, { children: [
|
143
|
+
s ? /* @__PURE__ */ t(
|
144
|
+
H,
|
146
145
|
{
|
147
146
|
id: "did-qrcode-button",
|
148
|
-
component:
|
149
|
-
icon:
|
150
|
-
onClick:
|
147
|
+
component: q,
|
148
|
+
icon: X,
|
149
|
+
onClick: B,
|
151
150
|
sx: {
|
152
151
|
flexShrink: 0,
|
153
152
|
cursor: "pointer",
|
@@ -156,49 +155,49 @@ function _e({
|
|
156
155
|
}
|
157
156
|
}
|
158
157
|
) : null,
|
159
|
-
|
158
|
+
x.append
|
160
159
|
] }),
|
161
|
-
children:
|
160
|
+
children: i
|
162
161
|
},
|
163
162
|
"address"
|
164
163
|
),
|
165
164
|
/* @__PURE__ */ t(
|
166
|
-
|
165
|
+
pe,
|
167
166
|
{
|
168
|
-
did:
|
167
|
+
did: i,
|
169
168
|
chainId: n,
|
170
|
-
roleType:
|
169
|
+
roleType: u,
|
171
170
|
showAvatar: c,
|
172
|
-
open:
|
173
|
-
onClose:
|
174
|
-
...
|
171
|
+
open: L,
|
172
|
+
onClose: U,
|
173
|
+
...x
|
175
174
|
}
|
176
175
|
)
|
177
176
|
] });
|
178
177
|
}
|
179
|
-
function
|
178
|
+
function pe({
|
180
179
|
did: e,
|
181
180
|
chainId: r = void 0,
|
182
181
|
roleType: o = void 0,
|
183
182
|
showAvatar: n = !0,
|
184
183
|
// DialogProps
|
185
|
-
open:
|
184
|
+
open: u,
|
186
185
|
fullScreen: c = !1,
|
187
|
-
fullWidth:
|
186
|
+
fullWidth: s = !1,
|
188
187
|
scroll: a = "paper",
|
189
|
-
onClose:
|
188
|
+
onClose: v = ee,
|
190
189
|
// AddressProps
|
191
|
-
locale:
|
192
|
-
...
|
190
|
+
locale: d = "en",
|
191
|
+
...A
|
193
192
|
}) {
|
194
|
-
const
|
195
|
-
|
193
|
+
const m = b((l, i = {}) => te(ie, l, d, "en", i)), { isEthDid: p, content: f, didMotifInfo: R, getPrepend: T } = M({ did: e, showAvatar: n }), g = D(() => ["zh", "en"].includes(d) ? `https://www.didwallet.io/${d}` : "https://www.didwallet.io/en", [d]), $ = D(() => /* @__PURE__ */ w(Q, { children: [
|
194
|
+
m("downloadTips"),
|
196
195
|
" ",
|
197
196
|
/* @__PURE__ */ t(
|
198
|
-
|
197
|
+
H,
|
199
198
|
{
|
200
199
|
component: "a",
|
201
|
-
href:
|
200
|
+
href: g,
|
202
201
|
target: "_blank",
|
203
202
|
rel: "noreferrer",
|
204
203
|
sx: {
|
@@ -208,30 +207,29 @@ function ue({
|
|
208
207
|
textDecoration: "underline"
|
209
208
|
}
|
210
209
|
},
|
211
|
-
children:
|
210
|
+
children: m("download")
|
212
211
|
}
|
213
212
|
)
|
214
|
-
] }), [
|
215
|
-
var m;
|
213
|
+
] }), [g]), h = D(() => {
|
216
214
|
if (r)
|
217
|
-
return
|
215
|
+
return S[r] || r;
|
218
216
|
if (p) return "1";
|
219
217
|
try {
|
220
|
-
const
|
221
|
-
if (
|
222
|
-
return
|
223
|
-
} catch (
|
224
|
-
console.warn("Failed to parse chainHost:",
|
218
|
+
const l = window.blocklet?.CHAIN_HOST, i = new URL(l).hostname;
|
219
|
+
if (i)
|
220
|
+
return S[i] || y;
|
221
|
+
} catch (l) {
|
222
|
+
console.warn("Failed to parse chainHost:", l);
|
225
223
|
}
|
226
|
-
return
|
227
|
-
}, [p, r]),
|
224
|
+
return y;
|
225
|
+
}, [p, r]), _ = D(() => p ? `ethereum:abtwallet.io/i?address=${f}&action=didRecognize&chainID=${h}` : `abt://abtwallet.io/i?did=${f}&action=didRecognize&chainID=${h}`, [f, p, h]);
|
228
226
|
return /* @__PURE__ */ t(
|
229
|
-
|
227
|
+
Y,
|
230
228
|
{
|
231
|
-
open:
|
232
|
-
onClose:
|
229
|
+
open: u,
|
230
|
+
onClose: v,
|
233
231
|
fullScreen: c,
|
234
|
-
fullWidth:
|
232
|
+
fullWidth: s,
|
235
233
|
scroll: a,
|
236
234
|
maxWidth: "sm",
|
237
235
|
PaperProps: {
|
@@ -240,24 +238,24 @@ function ue({
|
|
240
238
|
borderRadius: "12px"
|
241
239
|
}
|
242
240
|
},
|
243
|
-
children: /* @__PURE__ */
|
244
|
-
/* @__PURE__ */ t(
|
241
|
+
children: /* @__PURE__ */ w(G, { align: "center", sx: { p: 3 }, children: [
|
242
|
+
/* @__PURE__ */ t(P, { sx: { mb: 2, fontWeight: 500, fontSize: 18 }, children: m("scanQrcode", { role: le(o || R?.roleType) }) }),
|
245
243
|
/* @__PURE__ */ t(
|
246
|
-
|
244
|
+
j,
|
247
245
|
{
|
248
|
-
value:
|
246
|
+
value: _,
|
249
247
|
size: 256,
|
250
248
|
renderAs: "svg",
|
251
249
|
level: "M"
|
252
250
|
}
|
253
251
|
),
|
254
|
-
/* @__PURE__ */ t(
|
255
|
-
|
252
|
+
/* @__PURE__ */ t(H, { sx: { mt: 1.5, textAlign: "center" }, children: /* @__PURE__ */ t(
|
253
|
+
W,
|
256
254
|
{
|
257
|
-
locale:
|
258
|
-
content:
|
259
|
-
prepend:
|
260
|
-
...
|
255
|
+
locale: d,
|
256
|
+
content: f,
|
257
|
+
prepend: T(16, "dialog"),
|
258
|
+
...A,
|
261
259
|
size: 16,
|
262
260
|
copyable: !0,
|
263
261
|
children: e
|
@@ -265,7 +263,7 @@ function ue({
|
|
265
263
|
"dialog-address"
|
266
264
|
) }),
|
267
265
|
/* @__PURE__ */ t(
|
268
|
-
|
266
|
+
P,
|
269
267
|
{
|
270
268
|
variant: "body2",
|
271
269
|
sx: {
|
@@ -273,7 +271,7 @@ function ue({
|
|
273
271
|
fontSize: "12px",
|
274
272
|
mt: 1
|
275
273
|
},
|
276
|
-
children:
|
274
|
+
children: $
|
277
275
|
}
|
278
276
|
)
|
279
277
|
] })
|
@@ -281,7 +279,7 @@ function ue({
|
|
281
279
|
);
|
282
280
|
}
|
283
281
|
export {
|
284
|
-
|
285
|
-
|
286
|
-
|
282
|
+
$e as DID,
|
283
|
+
pe as DIDDialog,
|
284
|
+
$e as default
|
287
285
|
};
|