@arcblock/ux 3.0.6 → 3.0.8
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/ActionButton/index.d.ts +1 -1
- package/lib/ActionButton/index.js +1 -1
- package/lib/Address/compact-text.d.ts +1 -1
- package/lib/Address/compact-text.js +5 -5
- package/lib/Address/did-address.js +1 -1
- package/lib/Address/index.js +5 -5
- package/lib/Address/responsive-did-address.js +14 -14
- package/lib/Alert/index.d.ts +1 -1
- package/lib/Alert/index.js +1 -1
- package/lib/Avatar/index.d.ts +1 -1
- package/lib/Avatar/index.js +1 -1
- package/lib/Badge/index.js +1 -1
- package/lib/BlockletContext/index.d.ts +1 -1
- package/lib/BlockletNFT/index.js +1 -1
- package/lib/BlockletV2/blocklet.d.ts +1 -1
- package/lib/BlockletV2/blocklet.js +1 -1
- package/lib/BlockletV2/components/icon-text.d.ts +1 -1
- package/lib/BlockletV2/components/icon-text.js +13 -13
- package/lib/BlockletV2/components/tooltip-icon.js +22 -20
- package/lib/Button/wrap.js +1 -1
- package/lib/Center/index.js +3 -3
- package/lib/ClickToCopy/copy-button.js +3 -3
- package/lib/CloseButton/index.js +1 -1
- package/lib/ContactForm/index.js +22 -21
- package/lib/DID/index.js +45 -44
- package/lib/DIDConnect/app-info-item.js +1 -1
- package/lib/DIDConnect/auth-apps/index.js +48 -48
- package/lib/DIDConnect/did-connect-container.js +22 -22
- package/lib/DIDConnect/did-connect-footer.js +1 -1
- package/lib/DIDConnect/landing-page.js +27 -27
- package/lib/DIDConnect/request-storage-access-api-dialog.js +39 -40
- package/lib/Datatable/CustomToolbar.d.ts +3 -1
- package/lib/Datatable/CustomToolbar.js +1 -1
- package/lib/Datatable/index.js +2 -2
- package/lib/Dialog/confirm.d.ts +1 -1
- package/lib/Dialog/confirm.js +12 -12
- package/lib/Earth/index.js +1 -1
- package/lib/Footer/index.d.ts +1 -1
- package/lib/Footer/index.js +5 -5
- package/lib/Header/addon-button.d.ts +1 -1
- package/lib/Header/addon-button.js +11 -6
- package/lib/Header/header.js +1 -1
- package/lib/Header/responsive-header.d.ts +1 -1
- package/lib/Header/responsive-header.js +33 -34
- package/lib/Icon/index.js +12 -12
- package/lib/InfoRow/index.d.ts +1 -1
- package/lib/InfoRow/index.js +0 -1
- package/lib/Layout/dashboard/external-link.d.ts +1 -1
- package/lib/Layout/dashboard/external-link.js +1 -1
- package/lib/Layout/dashboard/full-page.js +8 -8
- package/lib/Layout/dashboard/index.js +1 -1
- package/lib/Layout/dashboard/sidebar.js +1 -1
- package/lib/Layout/dashboard-legacy/header.js +10 -10
- package/lib/Layout/dashboard-legacy/index.js +16 -16
- package/lib/Layout/dashboard-legacy/sidebar.d.ts +1 -1
- package/lib/Layout/dashboard-legacy/sidebar.js +19 -12
- package/lib/Layout/index.js +2 -2
- package/lib/LoadingMask/index.d.ts +1 -1
- package/lib/LoadingMask/index.js +4 -4
- package/lib/Locale/context.js +24 -24
- package/lib/Locale/selector.d.ts +1 -1
- package/lib/Locale/selector.js +1 -1
- package/lib/Logo/index.js +3 -3
- package/lib/NFTDisplay/aspect-ratio-container.d.ts +1 -1
- package/lib/NFTDisplay/index.js +5 -2
- package/lib/NFTDisplay/render-svg.js +3 -3
- package/lib/NavMenu/nav-menu.js +29 -26
- package/lib/NavMenu/products.js +1 -1
- package/lib/PageScroller/index.js +43 -43
- package/lib/PhoneInput/country-select.js +23 -23
- package/lib/PhoneInput/index.js +11 -11
- package/lib/PoweredByArcBlock/index.js +10 -6
- package/lib/QRCode/index.js +5 -5
- package/lib/RelativeTime/index.js +16 -16
- package/lib/Result/result.js +5 -5
- package/lib/Screenshot/index.d.ts +1 -1
- package/lib/Screenshot/index.js +1 -1
- package/lib/SessionUser/components/did-space.d.ts +1 -1
- package/lib/SessionUser/components/session-user-item.js +10 -10
- package/lib/SharedBridge/index.js +6 -6
- package/lib/Spinner/index.js +1 -1
- package/lib/SplitButton/index.d.ts +1 -1
- package/lib/SplitButton/index.js +1 -1
- package/lib/Success/index.js +1 -1
- package/lib/Tabs/index.js +15 -8
- package/lib/Tag/index.d.ts +1 -1
- package/lib/Tag/index.js +1 -1
- package/lib/TextCollapse/index.js +1 -1
- package/lib/Theme/theme-provider.js +58 -53
- package/lib/Theme/theme.js +1 -0
- package/lib/Typography/index.js +13 -13
- package/lib/UserCard/Cards/basic-info.d.ts +1 -1
- package/lib/UserCard/Cards/basic-info.js +1 -1
- package/lib/UserCard/Cards/index.d.ts +1 -1
- package/lib/UserCard/Cards/index.js +1 -1
- package/lib/UserCard/Container/card.js +6 -6
- package/lib/UserCard/Container/dialog.js +1 -1
- package/lib/UserCard/Content/basic.js +2 -2
- package/lib/UserCard/Content/minimal.d.ts +1 -1
- package/lib/UserCard/Content/minimal.js +1 -1
- package/lib/UserCard/Content/tooltip-avatar.js +17 -17
- package/lib/VerificationCode/index.js +1 -1
- package/lib/WalletOSIcon/index.d.ts +2 -2
- package/lib/WalletOSIcon/index.js +7 -2
- package/lib/WebWalletSWKeeper/index.d.ts +3 -1
- package/lib/WebWalletSWKeeper/index.js +4 -1
- package/lib/withTheme/index.d.ts +3 -2
- package/lib/withTheme/index.js +16 -16
- package/package.json +7 -7
- package/src/ActionButton/index.jsx +1 -1
- package/src/Address/compact-text.jsx +1 -1
- package/src/Address/did-address.tsx +1 -1
- package/src/Address/index.tsx +1 -1
- package/src/Address/responsive-did-address.tsx +3 -3
- package/src/Alert/index.jsx +1 -1
- package/src/Avatar/index.jsx +1 -1
- package/src/Badge/index.jsx +1 -1
- package/src/BlockletContext/index.tsx +1 -1
- package/src/BlockletNFT/index.jsx +1 -1
- package/src/BlockletV2/blocklet.tsx +1 -1
- package/src/BlockletV2/components/icon-text.tsx +4 -4
- package/src/BlockletV2/components/tooltip-icon.tsx +5 -3
- package/src/Button/wrap.jsx +1 -1
- package/src/Center/index.tsx +1 -1
- package/src/ClickToCopy/copy-button.tsx +1 -1
- package/src/CloseButton/index.tsx +1 -1
- package/src/ContactForm/index.tsx +9 -2
- package/src/DID/index.tsx +5 -4
- package/src/DIDConnect/app-info-item.tsx +1 -1
- package/src/DIDConnect/auth-apps/index.tsx +8 -8
- package/src/DIDConnect/did-connect-container.tsx +2 -2
- package/src/DIDConnect/did-connect-footer.tsx +1 -1
- package/src/DIDConnect/landing-page.tsx +6 -6
- package/src/DIDConnect/request-storage-access-api-dialog.tsx +1 -2
- package/src/Datatable/CustomToolbar.jsx +1 -1
- package/src/Datatable/index.jsx +2 -2
- package/src/Dialog/confirm.jsx +1 -1
- package/src/Earth/index.tsx +1 -1
- package/src/Footer/index.tsx +5 -2
- package/src/Header/addon-button.tsx +7 -2
- package/src/Header/header.tsx +1 -1
- package/src/Header/responsive-header.tsx +1 -2
- package/src/Icon/index.tsx +1 -1
- package/src/InfoRow/index.tsx +1 -2
- package/src/Layout/dashboard/external-link.tsx +1 -1
- package/src/Layout/dashboard/full-page.tsx +1 -1
- package/src/Layout/dashboard/index.tsx +1 -1
- package/src/Layout/dashboard/sidebar.tsx +5 -2
- package/src/Layout/dashboard-legacy/header.tsx +5 -5
- package/src/Layout/dashboard-legacy/index.tsx +3 -3
- package/src/Layout/dashboard-legacy/sidebar.tsx +10 -2
- package/src/Layout/index.tsx +2 -2
- package/src/LoadingMask/index.tsx +5 -5
- package/src/Locale/context.tsx +3 -3
- package/src/Locale/selector.tsx +1 -1
- package/src/Logo/index.tsx +1 -1
- package/src/NFTDisplay/aspect-ratio-container.tsx +1 -1
- package/src/NFTDisplay/index.tsx +2 -1
- package/src/NFTDisplay/render-svg.tsx +1 -1
- package/src/NavMenu/nav-menu.tsx +8 -5
- package/src/NavMenu/products.tsx +3 -1
- package/src/PageScroller/index.tsx +4 -4
- package/src/PhoneInput/country-select.tsx +3 -3
- package/src/PhoneInput/index.tsx +1 -1
- package/src/PoweredByArcBlock/index.tsx +5 -1
- package/src/QRCode/index.tsx +1 -1
- package/src/RelativeTime/index.tsx +3 -3
- package/src/Result/result.tsx +1 -1
- package/src/Screenshot/index.tsx +2 -2
- package/src/SessionUser/components/did-space.tsx +1 -1
- package/src/SessionUser/components/session-user-item.tsx +1 -1
- package/src/SharedBridge/index.tsx +2 -2
- package/src/Spinner/index.tsx +1 -1
- package/src/SplitButton/index.tsx +1 -1
- package/src/Success/index.tsx +1 -1
- package/src/Tabs/index.tsx +10 -3
- package/src/Tag/index.jsx +1 -1
- package/src/TextCollapse/index.tsx +1 -1
- package/src/Theme/theme-provider.tsx +11 -6
- package/src/Theme/theme.ts +5 -0
- package/src/Typography/index.tsx +1 -1
- package/src/UserCard/Cards/basic-info.tsx +1 -1
- package/src/UserCard/Cards/index.tsx +1 -1
- package/src/UserCard/Container/card.tsx +2 -2
- package/src/UserCard/Container/dialog.tsx +1 -1
- package/src/UserCard/Content/basic.tsx +2 -2
- package/src/UserCard/Content/minimal.tsx +1 -1
- package/src/UserCard/Content/tooltip-avatar.tsx +4 -4
- package/src/VerificationCode/index.tsx +1 -1
- package/src/WalletOSIcon/index.tsx +7 -2
- package/src/WebWalletSWKeeper/index.tsx +6 -1
- package/src/withTheme/index.tsx +7 -3
- package/vite.config.mjs +4 -1
- package/lib/ActionButton/ActionButton.stories.d.ts +0 -18
- package/lib/ActivityIndicator/ActivityIndicator.stories.d.ts +0 -8
- package/lib/Address/Address.stories.d.ts +0 -16
- package/lib/Alert/Alert.stories.d.ts +0 -28
- package/lib/AnimationWaiter/AnimationWaiter.stories.d.ts +0 -21
- package/lib/Avatar/Avatar.stories.d.ts +0 -11
- package/lib/Badge/Badge.stories.d.ts +0 -13
- package/lib/Blocklet/Blocklet.stories.d.ts +0 -17
- package/lib/BlockletNFT/BlockletNFT.stories.d.ts +0 -17
- package/lib/BlockletV2/Blocklet.stories.d.ts +0 -18
- package/lib/Button/Button.stories.d.ts +0 -19
- package/lib/Center/Center.stories.d.ts +0 -18
- package/lib/ClickToCopy/ClickToCopy.stories.d.ts +0 -16
- package/lib/CodeBlock/CodeBlock.stories.d.ts +0 -20
- package/lib/Colors/Colors.stories.d.ts +0 -34
- package/lib/Config/Config.stories.d.ts +0 -14
- package/lib/ContactForm/ContactForm.stories.d.ts +0 -23
- package/lib/CookieConsent/CookieConsent.stories.d.ts +0 -18
- package/lib/CountDown/CountDown.stories.d.ts +0 -14
- package/lib/DID/DID.stories.d.ts +0 -15
- package/lib/Datatable/Datatable.stories.d.ts +0 -32
- package/lib/Dialog/Dialog.stories.d.ts +0 -20
- package/lib/DidLogo/Logo.stories.d.ts +0 -8
- package/lib/Earth/Earth.stories.d.ts +0 -18
- package/lib/Empty/Empty.stories.d.ts +0 -17
- package/lib/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -12
- package/lib/Footer/Footer.stories.d.ts +0 -12
- package/lib/Header/Header.stories.d.ts +0 -21
- package/lib/Icon/Icon.stories.d.ts +0 -23
- package/lib/Img/Img.stories.d.ts +0 -13
- package/lib/InfoRow/InfoRow.stories.d.ts +0 -14
- package/lib/Layout/Layout.stories.d.ts +0 -23
- package/lib/Locale/LocaleSelector.stories.d.ts +0 -22
- package/lib/Logo/Logo.stories.d.ts +0 -22
- package/lib/Metric/Metric.stories.d.ts +0 -14
- package/lib/NFTDisplay/NFTDisplay.stories.d.ts +0 -15
- package/lib/NavMenu/NavMenu.stories.d.ts +0 -17
- package/lib/PageScroller/story/PageScroller.stories.d.ts +0 -13
- package/lib/PhoneInput/PhoneInput.stories.d.ts +0 -12
- package/lib/PricingTable/PricingTable.stories.d.ts +0 -8
- package/lib/QRCode/QRCode.stories.d.ts +0 -13
- package/lib/RelativeTime/RelativeTime.stories.d.ts +0 -20
- package/lib/Result/Result.stories.d.ts +0 -21
- package/lib/Screenshot/Screenshot.stories.d.ts +0 -13
- package/lib/SessionManager/SessionManager.stories.d.ts +0 -9
- package/lib/Sparkline/Sparkline.stories.d.ts +0 -12
- package/lib/Spinner/Spinner.stories.d.ts +0 -18
- package/lib/SplitButton/SplitButton.stories.d.ts +0 -15
- package/lib/Switch/Switch.stories.d.ts +0 -13
- package/lib/Tabs/Tabs.stories.d.ts +0 -14
- package/lib/Tag/Tag.stories.d.ts +0 -13
- package/lib/TextCollapse/TextCollapse.stories.d.ts +0 -28
- package/lib/Theme/Theme.stories.d.ts +0 -10
- package/lib/Toast/Toast.stories.d.ts +0 -15
- package/lib/UserCard/UserCard.stories.d.ts +0 -18
- package/lib/Util/WebWalletOpener.stories.d.ts +0 -5
- package/lib/Video/Video.stories.d.ts +0 -6
- package/lib/Wallet/Action.stories.d.ts +0 -8
- package/lib/Wallet/Download.stories.d.ts +0 -9
- package/lib/Wallet/OpenInWallet.stories.d.ts +0 -5
package/lib/DID/index.js
CHANGED
@@ -5,15 +5,16 @@ import q from "qrcode.react";
|
|
5
5
|
import { Icon as X } from "@iconify/react";
|
6
6
|
import Y from "@iconify-icons/material-symbols/qr-code-rounded";
|
7
7
|
import { Box as N, Dialog as G, DialogContent as J, Typography as S } from "@mui/material";
|
8
|
-
import { useMemoizedFn as
|
8
|
+
import { useMemoizedFn as v, useCreation as g } from "ahooks";
|
9
9
|
import { useRef as K, useState as V, useImperativeHandle as Z } from "react";
|
10
10
|
import { toAddress as ee } from "@arcblock/did";
|
11
|
+
import oe from "lodash/noop";
|
11
12
|
import k from "../Address/index.js";
|
12
|
-
import
|
13
|
-
import { DID_PREFIX as
|
14
|
-
import { translate as
|
15
|
-
import { isEthereumDid as
|
16
|
-
const
|
13
|
+
import re from "../Avatar/index.js";
|
14
|
+
import { DID_PREFIX as te } from "../Util/constant.js";
|
15
|
+
import { translate as ne } from "../Locale/util.js";
|
16
|
+
import { isEthereumDid as se, getDIDColor as ie } from "../Util/index.js";
|
17
|
+
const ae = {
|
17
18
|
en: {
|
18
19
|
scanQrcode: "Scan with DID Wallet to view the {role}",
|
19
20
|
download: "Download",
|
@@ -24,29 +25,29 @@ const ie = {
|
|
24
25
|
download: "下载",
|
25
26
|
downloadTips: "没有 DID Wallet ?"
|
26
27
|
}
|
27
|
-
},
|
28
|
-
main:
|
29
|
-
"main.abtnetwork.io":
|
28
|
+
}, A = "xenon-2020-01-15", W = {
|
29
|
+
main: A,
|
30
|
+
"main.abtnetwork.io": A,
|
30
31
|
"beta.abtnetwork.io": "beta"
|
31
|
-
},
|
32
|
+
}, le = (e, r, o) => o ? ie(e) : r.color, de = (e) => !{
|
32
33
|
0: !0,
|
33
34
|
// ACCOUNT
|
34
35
|
6: !0,
|
35
36
|
// ASSET
|
36
37
|
17: !0
|
37
38
|
// TOKEN
|
38
|
-
}[e],
|
39
|
+
}[e], ce = (e) => {
|
39
40
|
if (e === P.RoleType.ROLE_ANY)
|
40
41
|
return "DID";
|
41
42
|
const [r] = Object.entries(P.RoleType).find((o) => o[1] === e) || [];
|
42
43
|
return r ? r.toLowerCase().replace(/role_(\S)/g, (o, n) => n.toUpperCase()) : "DID";
|
43
|
-
},
|
44
|
+
}, pe = (e, r, o) => r || de(e.roleType) ? o * 0.75 : o;
|
44
45
|
function F({ did: e, showAvatar: r }) {
|
45
|
-
const o =
|
46
|
+
const o = se(e), n = o ? void 0 : j(e), f = g(() => o ? e : `${te}${e}`, [e, o]), c = v((i, a) => [
|
46
47
|
/* @__PURE__ */ t(
|
47
48
|
"span",
|
48
49
|
{
|
49
|
-
style: { flex: "0 0 auto", color:
|
50
|
+
style: { flex: "0 0 auto", color: le(e, n, o) },
|
50
51
|
children: "DID:"
|
51
52
|
},
|
52
53
|
`${a}-prefix-did-${i}`
|
@@ -56,11 +57,11 @@ function F({ did: e, showAvatar: r }) {
|
|
56
57
|
":"
|
57
58
|
] }, `${a}-prefix-abt-${i}`),
|
58
59
|
r && /* @__PURE__ */ t(
|
59
|
-
|
60
|
+
re,
|
60
61
|
{
|
61
62
|
src: "",
|
62
63
|
did: e,
|
63
|
-
size:
|
64
|
+
size: pe(n, o, i || 18),
|
64
65
|
style: { display: "inline-flex", alignItems: "center", marginLeft: 2, marginRight: 4 },
|
65
66
|
blockiesPadding: !1,
|
66
67
|
className: "did-address-avatar",
|
@@ -72,22 +73,22 @@ function F({ did: e, showAvatar: r }) {
|
|
72
73
|
return {
|
73
74
|
isEthDid: o,
|
74
75
|
didMotifInfo: n,
|
75
|
-
content:
|
76
|
+
content: f,
|
76
77
|
getPrepend: c
|
77
78
|
};
|
78
79
|
}
|
79
|
-
function
|
80
|
-
ref: e,
|
80
|
+
function _e({
|
81
|
+
ref: e = void 0,
|
81
82
|
...r
|
82
83
|
}) {
|
83
84
|
const {
|
84
85
|
did: o,
|
85
86
|
chainId: n,
|
86
|
-
roleType:
|
87
|
+
roleType: f,
|
87
88
|
showAvatar: c = !0,
|
88
89
|
showQrcode: i = !1,
|
89
90
|
locale: a = "en",
|
90
|
-
size:
|
91
|
+
size: T = 0,
|
91
92
|
component: l = "span",
|
92
93
|
copyable: R = !0,
|
93
94
|
responsive: h = !0,
|
@@ -99,9 +100,9 @@ function Re({
|
|
99
100
|
endChars: _ = 6,
|
100
101
|
style: w,
|
101
102
|
className: Q,
|
102
|
-
sx:
|
103
|
+
sx: m
|
103
104
|
} = r, s = ee(o), d = {
|
104
|
-
size:
|
105
|
+
size: T,
|
105
106
|
component: l,
|
106
107
|
copyable: R,
|
107
108
|
responsive: h,
|
@@ -113,10 +114,10 @@ function Re({
|
|
113
114
|
endChars: _,
|
114
115
|
style: w,
|
115
116
|
className: Q,
|
116
|
-
sx:
|
117
|
-
}, C = K(null), { content: L, getPrepend: M } = F({ did: s, showAvatar: c }), [U, b] = V(!1), B =
|
117
|
+
sx: m
|
118
|
+
}, C = K(null), { content: L, getPrepend: M } = F({ did: s, showAvatar: c }), [U, b] = V(!1), B = v(() => {
|
118
119
|
b(!1);
|
119
|
-
}), O =
|
120
|
+
}), O = v((y) => {
|
120
121
|
y.stopPropagation(), y.preventDefault(), b(!0);
|
121
122
|
});
|
122
123
|
return Z(e, () => new Proxy(
|
@@ -162,11 +163,11 @@ function Re({
|
|
162
163
|
"address"
|
163
164
|
),
|
164
165
|
/* @__PURE__ */ t(
|
165
|
-
|
166
|
+
ue,
|
166
167
|
{
|
167
168
|
did: s,
|
168
169
|
chainId: n,
|
169
|
-
roleType:
|
170
|
+
roleType: f,
|
170
171
|
showAvatar: c,
|
171
172
|
open: U,
|
172
173
|
onClose: B,
|
@@ -175,22 +176,22 @@ function Re({
|
|
175
176
|
)
|
176
177
|
] });
|
177
178
|
}
|
178
|
-
function
|
179
|
+
function ue({
|
179
180
|
did: e,
|
180
|
-
chainId: r,
|
181
|
-
roleType: o,
|
181
|
+
chainId: r = void 0,
|
182
|
+
roleType: o = void 0,
|
182
183
|
showAvatar: n = !0,
|
183
184
|
// DialogProps
|
184
|
-
open:
|
185
|
+
open: f,
|
185
186
|
fullScreen: c = !1,
|
186
187
|
fullWidth: i = !1,
|
187
188
|
scroll: a = "paper",
|
188
|
-
onClose:
|
189
|
+
onClose: T = oe,
|
189
190
|
// AddressProps
|
190
191
|
locale: l = "en",
|
191
192
|
...R
|
192
193
|
}) {
|
193
|
-
const h =
|
194
|
+
const h = v((m, s = {}) => ne(ae, m, l, "en", s)), { isEthDid: p, content: u, didMotifInfo: D, getPrepend: $ } = F({ did: e, showAvatar: n }), I = g(() => ["zh", "en"].includes(l) ? `https://www.didwallet.io/${l}` : "https://www.didwallet.io/en", [l]), _ = g(() => /* @__PURE__ */ x(H, { children: [
|
194
195
|
h("downloadTips"),
|
195
196
|
" ",
|
196
197
|
/* @__PURE__ */ t(
|
@@ -211,24 +212,24 @@ function pe({
|
|
211
212
|
}
|
212
213
|
)
|
213
214
|
] }), [I]), w = g(() => {
|
214
|
-
var
|
215
|
+
var m;
|
215
216
|
if (r)
|
216
217
|
return W[r] || r;
|
217
218
|
if (p) return "1";
|
218
219
|
try {
|
219
|
-
const s = (
|
220
|
+
const s = (m = window.blocklet) == null ? void 0 : m.CHAIN_HOST, d = new URL(s).hostname;
|
220
221
|
if (d)
|
221
|
-
return W[d] ||
|
222
|
+
return W[d] || A;
|
222
223
|
} catch (s) {
|
223
224
|
console.warn("Failed to parse chainHost:", s);
|
224
225
|
}
|
225
|
-
return
|
226
|
+
return A;
|
226
227
|
}, [p, r]), Q = g(() => p ? `ethereum:abtwallet.io/i?address=${u}&action=didRecognize&chainID=${w}` : `abt://abtwallet.io/i?did=${u}&action=didRecognize&chainID=${w}`, [u, p, w]);
|
227
228
|
return /* @__PURE__ */ t(
|
228
229
|
G,
|
229
230
|
{
|
230
|
-
open:
|
231
|
-
onClose:
|
231
|
+
open: f,
|
232
|
+
onClose: T,
|
232
233
|
fullScreen: c,
|
233
234
|
fullWidth: i,
|
234
235
|
scroll: a,
|
@@ -240,7 +241,7 @@ function pe({
|
|
240
241
|
}
|
241
242
|
},
|
242
243
|
children: /* @__PURE__ */ x(J, { align: "center", sx: { p: 3 }, children: [
|
243
|
-
/* @__PURE__ */ t(S, { sx: { mb: 2, fontWeight: 500, fontSize: 18 }, children: h("scanQrcode", { role:
|
244
|
+
/* @__PURE__ */ t(S, { sx: { mb: 2, fontWeight: 500, fontSize: 18 }, children: h("scanQrcode", { role: ce(o || (D == null ? void 0 : D.roleType)) }) }),
|
244
245
|
/* @__PURE__ */ t(
|
245
246
|
q,
|
246
247
|
{
|
@@ -280,7 +281,7 @@ function pe({
|
|
280
281
|
);
|
281
282
|
}
|
282
283
|
export {
|
283
|
-
|
284
|
-
|
285
|
-
|
284
|
+
_e as DID,
|
285
|
+
ue as DIDDialog,
|
286
|
+
_e as default
|
286
287
|
};
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { CircularProgress as x, Box as l, Stack as H, Button as
|
1
|
+
import { jsx as i, jsxs as r, Fragment as G } from "react/jsx-runtime";
|
2
|
+
import { CircularProgress as x, Box as l, Stack as H, Button as v, Typography as J, Link as K } from "@mui/material";
|
3
3
|
import { useReactive as O, useMemoizedFn as t } from "ahooks";
|
4
|
-
import
|
4
|
+
import c from "lodash/noop";
|
5
5
|
import Q from "../did-connect-container.js";
|
6
6
|
import S from "./auth-apps-info.js";
|
7
7
|
import V from "../../Center/index.js";
|
@@ -10,7 +10,7 @@ import { translate as Y } from "../../Locale/util.js";
|
|
10
10
|
import { useLocaleContext as Z } from "../../Locale/context.js";
|
11
11
|
import _ from "../../UserCard/index.js";
|
12
12
|
import { InfoType as $, CardType as P } from "../../UserCard/types.js";
|
13
|
-
import { mergeSx as
|
13
|
+
import { mergeSx as b } from "../../Util/style.js";
|
14
14
|
const ee = {
|
15
15
|
en: {
|
16
16
|
notThis: "Not this?",
|
@@ -29,57 +29,57 @@ const ee = {
|
|
29
29
|
};
|
30
30
|
function ge({
|
31
31
|
session: a,
|
32
|
-
requestAppInfo:
|
33
|
-
currentAppInfo:
|
34
|
-
children: T,
|
35
|
-
userInfo: s,
|
32
|
+
requestAppInfo: z,
|
33
|
+
currentAppInfo: k,
|
34
|
+
children: T = null,
|
35
|
+
userInfo: s = void 0,
|
36
36
|
hideSwitchConnect: A = !1,
|
37
37
|
hideAuthorize: D = !1,
|
38
38
|
hideCancel: I = !1,
|
39
|
-
notThisText: L,
|
40
|
-
authorizeText: W,
|
41
|
-
connectText: j,
|
42
|
-
cancelText: w,
|
43
|
-
useAnotherText: B,
|
44
|
-
slotProps: e,
|
45
|
-
onConnect: u =
|
46
|
-
onAuthorize: h =
|
47
|
-
onSwitchConnect: m =
|
48
|
-
onCancel: f =
|
39
|
+
notThisText: L = void 0,
|
40
|
+
authorizeText: W = void 0,
|
41
|
+
connectText: j = void 0,
|
42
|
+
cancelText: w = void 0,
|
43
|
+
useAnotherText: B = void 0,
|
44
|
+
slotProps: e = void 0,
|
45
|
+
onConnect: u = c,
|
46
|
+
onAuthorize: h = c,
|
47
|
+
onSwitchConnect: m = c,
|
48
|
+
onCancel: f = c
|
49
49
|
}) {
|
50
|
-
var C, y
|
51
|
-
const
|
50
|
+
var p, C, y;
|
51
|
+
const n = O({
|
52
52
|
loading: !1
|
53
53
|
}), { locale: F = "en" } = Z() || {}, d = t((q, E = {}) => Y(ee, q, F, "en", E)), g = t(() => {
|
54
|
-
|
54
|
+
n.loading = !1;
|
55
55
|
}), M = t(() => {
|
56
|
-
|
56
|
+
n.loading = !0, u == null || u(g);
|
57
57
|
}), R = t(() => {
|
58
|
-
|
58
|
+
n.loading = !0, m == null || m(g);
|
59
59
|
}), U = t(() => {
|
60
|
-
|
60
|
+
n.loading = !0, h == null || h(g);
|
61
61
|
}), N = t(() => {
|
62
62
|
f == null || f();
|
63
63
|
});
|
64
64
|
if (a.loading || !a.initialized)
|
65
|
-
return /* @__PURE__ */
|
66
|
-
const
|
67
|
-
return /* @__PURE__ */
|
65
|
+
return /* @__PURE__ */ i(V, { children: /* @__PURE__ */ i(x, {}) });
|
66
|
+
const o = s ?? (a == null ? void 0 : a.user);
|
67
|
+
return /* @__PURE__ */ i(X, { did: (p = window.blocklet) == null ? void 0 : p.appPid, standalone: !0, children: /* @__PURE__ */ i(
|
68
68
|
l,
|
69
69
|
{
|
70
70
|
...e == null ? void 0 : e.root,
|
71
|
-
sx:
|
71
|
+
sx: b(
|
72
72
|
{
|
73
73
|
width: 420,
|
74
74
|
maxWidth: "100%"
|
75
75
|
},
|
76
|
-
(
|
76
|
+
(C = e == null ? void 0 : e.root) == null ? void 0 : C.sx
|
77
77
|
),
|
78
|
-
children: /* @__PURE__ */
|
78
|
+
children: /* @__PURE__ */ i(Q, { hideCloseButton: !0, ...e == null ? void 0 : e.didConnectContainer, children: /* @__PURE__ */ r(
|
79
79
|
l,
|
80
80
|
{
|
81
81
|
...e == null ? void 0 : e.contentContainer,
|
82
|
-
sx:
|
82
|
+
sx: b(
|
83
83
|
{
|
84
84
|
display: "flex",
|
85
85
|
flexDirection: "column",
|
@@ -95,16 +95,16 @@ function ge({
|
|
95
95
|
},
|
96
96
|
bgcolor: "background.paper"
|
97
97
|
},
|
98
|
-
(
|
98
|
+
(y = e == null ? void 0 : e.contentContainer) == null ? void 0 : y.sx
|
99
99
|
),
|
100
100
|
children: [
|
101
|
-
/* @__PURE__ */
|
102
|
-
|
103
|
-
/* @__PURE__ */
|
104
|
-
/* @__PURE__ */
|
101
|
+
/* @__PURE__ */ i(S, { requestAppInfo: z, currentAppInfo: k }),
|
102
|
+
o ? /* @__PURE__ */ r(G, { children: [
|
103
|
+
/* @__PURE__ */ i(_, { user: o, showDid: !0, cardType: P.Detailed, infoType: $.Minimal }),
|
104
|
+
/* @__PURE__ */ i(l, {})
|
105
105
|
] }) : null,
|
106
106
|
T,
|
107
|
-
/* @__PURE__ */
|
107
|
+
/* @__PURE__ */ i(
|
108
108
|
l,
|
109
109
|
{
|
110
110
|
sx: {
|
@@ -117,8 +117,8 @@ function ge({
|
|
117
117
|
}
|
118
118
|
),
|
119
119
|
/* @__PURE__ */ r(H, { direction: "row", spacing: 2, children: [
|
120
|
-
I ? null : /* @__PURE__ */
|
121
|
-
|
120
|
+
I ? null : /* @__PURE__ */ i(
|
121
|
+
v,
|
122
122
|
{
|
123
123
|
color: "inherit",
|
124
124
|
variant: "outlined",
|
@@ -131,35 +131,35 @@ function ge({
|
|
131
131
|
children: w || d("cancel")
|
132
132
|
}
|
133
133
|
),
|
134
|
-
|
135
|
-
|
134
|
+
o && !D ? /* @__PURE__ */ r(
|
135
|
+
v,
|
136
136
|
{
|
137
137
|
variant: "contained",
|
138
138
|
size: "large",
|
139
139
|
fullWidth: !0,
|
140
140
|
onClick: U,
|
141
|
-
disabled:
|
141
|
+
disabled: n.loading,
|
142
142
|
children: [
|
143
|
-
|
143
|
+
n.loading ? /* @__PURE__ */ i(x, { size: 20, sx: { mr: 1 } }) : null,
|
144
144
|
W || d("authorize")
|
145
145
|
]
|
146
146
|
}
|
147
147
|
) : /* @__PURE__ */ r(
|
148
|
-
|
148
|
+
v,
|
149
149
|
{
|
150
150
|
variant: "contained",
|
151
151
|
size: "large",
|
152
152
|
fullWidth: !0,
|
153
|
-
disabled:
|
153
|
+
disabled: n.loading,
|
154
154
|
onClick: M,
|
155
155
|
children: [
|
156
|
-
|
156
|
+
n.loading ? /* @__PURE__ */ i(x, { size: 20, sx: { mr: 1 } }) : null,
|
157
157
|
j || d("connect")
|
158
158
|
]
|
159
159
|
}
|
160
160
|
)
|
161
161
|
] }),
|
162
|
-
A || !
|
162
|
+
A || !o ? null : /* @__PURE__ */ i(l, { sx: { textAlign: "center" }, children: /* @__PURE__ */ r(
|
163
163
|
J,
|
164
164
|
{
|
165
165
|
variant: "body2",
|
@@ -172,7 +172,7 @@ function ge({
|
|
172
172
|
children: [
|
173
173
|
L || d("notThis"),
|
174
174
|
" ",
|
175
|
-
/* @__PURE__ */
|
175
|
+
/* @__PURE__ */ i(
|
176
176
|
K,
|
177
177
|
{
|
178
178
|
underline: "hover",
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { jsx as
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
2
2
|
import { memo as J, createElement as U, useRef as X } from "react";
|
3
3
|
import { useBrowser as Y } from "@arcblock/react-hooks";
|
4
4
|
import { Backdrop as Z, useMediaQuery as P, useTheme as ee, Box as l, Drawer as oe, SwipeableDrawer as re, Dialog as ne, DialogContent as ae } from "@mui/material";
|
5
|
-
import { useCreation as
|
5
|
+
import { useCreation as ie, useDebounce as te } from "ahooks";
|
6
6
|
import de from "color-convert";
|
7
7
|
import { getDIDMotifInfo as ce } from "@arcblock/did-motif";
|
8
8
|
import le from "lodash/noop";
|
@@ -30,31 +30,31 @@ function ye({
|
|
30
30
|
popup: f = !1,
|
31
31
|
hideCloseButton: w = !1,
|
32
32
|
children: g,
|
33
|
-
appPid: E,
|
34
|
-
slotProps: e,
|
33
|
+
appPid: E = void 0,
|
34
|
+
slotProps: e = void 0,
|
35
35
|
onClose: G = le,
|
36
36
|
keepMounted: k = !1
|
37
37
|
}) {
|
38
38
|
var y, A, L, _, B, I, z, M;
|
39
|
-
const n =
|
40
|
-
const o = E || window.blocklet.appPid, r = ue(o),
|
41
|
-
return r ? se(o) :
|
39
|
+
const n = ie(() => {
|
40
|
+
const o = E || window.blocklet.appPid, r = ue(o), i = r ? void 0 : ce(o);
|
41
|
+
return r ? se(o) : i.color;
|
42
42
|
}, []), C = X(null), N = Y(), O = P("(max-width:640px)");
|
43
43
|
let s = "page";
|
44
44
|
f && (s = "dialog", O && N.mobile.any && (s = "drawer"));
|
45
|
-
const b = ee(), T = ((A = (y = b == null ? void 0 : b.transitions) == null ? void 0 : y.duration) == null ? void 0 : A.leavingScreen) || 500, W =
|
45
|
+
const b = ee(), T = ((A = (y = b == null ? void 0 : b.transitions) == null ? void 0 : y.duration) == null ? void 0 : A.leavingScreen) || 500, W = te(a, {
|
46
46
|
wait: T
|
47
47
|
}), D = (o, r) => {
|
48
48
|
["backdropClick", "escapeKeyDown"].includes(r) || G();
|
49
|
-
},
|
49
|
+
}, v = W || a || k, F = w ? oe : re, H = de.hex.hsl(n), [R, $, d] = H, x = [0, 30, 60, 30, 0, 30, 60, 30], K = Math.max(...x), Q = Math.min(...x);
|
50
50
|
let p = !1;
|
51
51
|
(d * (100 + K) / 100 > 100 || d * (100 + Q) / 100 < 0) && (p = !0);
|
52
52
|
const V = `linear-gradient(45deg, ${x.map((o) => {
|
53
|
-
let r = d * (100 + o) / 100,
|
54
|
-
return p ?
|
53
|
+
let r = d * (100 + o) / 100, i = 0.6;
|
54
|
+
return p ? i = 0.5 * (100 + o) / 100 : r = d * (100 + o) / 100, `hsla(${R}, ${$}%, ${r}%, ${i})`;
|
55
55
|
}).join(", ")})`, q = `linear-gradient(45deg, ${x.map((o) => {
|
56
|
-
let r = d * (100 + o) / 100,
|
57
|
-
return p ?
|
56
|
+
let r = d * (100 + o) / 100, i = 0.2;
|
57
|
+
return p ? i = 0.3 * (100 + o) / 100 : r = d * (100 + o) / 100, `hsla(${R}, ${$}%, ${r}%, ${i})`;
|
58
58
|
}).join(", ")})`, S = a ? {
|
59
59
|
overflow: "visible",
|
60
60
|
"&::before, &::after": {
|
@@ -87,7 +87,7 @@ function ye({
|
|
87
87
|
}
|
88
88
|
}
|
89
89
|
} : {};
|
90
|
-
return s === "page" ? /* @__PURE__ */
|
90
|
+
return s === "page" ? /* @__PURE__ */ t(
|
91
91
|
l,
|
92
92
|
{
|
93
93
|
className: "did-connect__container-page",
|
@@ -115,7 +115,7 @@ function ye({
|
|
115
115
|
},
|
116
116
|
children: [
|
117
117
|
g,
|
118
|
-
/* @__PURE__ */
|
118
|
+
/* @__PURE__ */ t(h, { currentAppColor: n, sx: c({ mx: 0 }, (_ = e == null ? void 0 : e.footer) == null ? void 0 : _.sx) })
|
119
119
|
]
|
120
120
|
}
|
121
121
|
)
|
@@ -163,7 +163,7 @@ function ye({
|
|
163
163
|
)
|
164
164
|
},
|
165
165
|
children: [
|
166
|
-
w ? null : /* @__PURE__ */
|
166
|
+
w ? null : /* @__PURE__ */ t(
|
167
167
|
l,
|
168
168
|
{
|
169
169
|
ref: C,
|
@@ -175,7 +175,7 @@ function ye({
|
|
175
175
|
mb: -2,
|
176
176
|
zIndex: 2
|
177
177
|
},
|
178
|
-
children: /* @__PURE__ */
|
178
|
+
children: /* @__PURE__ */ t(
|
179
179
|
l,
|
180
180
|
{
|
181
181
|
sx: {
|
@@ -199,14 +199,14 @@ function ye({
|
|
199
199
|
backgroundColor: "background.default"
|
200
200
|
},
|
201
201
|
children: [
|
202
|
-
|
203
|
-
/* @__PURE__ */
|
202
|
+
v ? g : null,
|
203
|
+
/* @__PURE__ */ t(h, { currentAppColor: n, sx: c({ mx: 0 }, (I = e == null ? void 0 : e.footer) == null ? void 0 : I.sx) })
|
204
204
|
]
|
205
205
|
}
|
206
206
|
)
|
207
207
|
]
|
208
208
|
}
|
209
|
-
) : /* @__PURE__ */
|
209
|
+
) : /* @__PURE__ */ t(
|
210
210
|
ne,
|
211
211
|
{
|
212
212
|
open: a,
|
@@ -243,8 +243,8 @@ function ye({
|
|
243
243
|
backgroundColor: "background.default"
|
244
244
|
},
|
245
245
|
children: [
|
246
|
-
|
247
|
-
/* @__PURE__ */
|
246
|
+
v ? g : null,
|
247
|
+
/* @__PURE__ */ t(h, { currentAppColor: n, sx: c({ mx: 0 }, (M = e == null ? void 0 : e.footer) == null ? void 0 : M.sx) })
|
248
248
|
]
|
249
249
|
}
|
250
250
|
)
|
@@ -12,7 +12,7 @@ import { DID_CONNECT_MEDIUM_WIDTH as D } from "../Util/constant.js";
|
|
12
12
|
function z({
|
13
13
|
currentAppInfo: r = globalThis.blocklet,
|
14
14
|
currentAppColor: n = ((s) => (s = globalThis.blocklet) == null ? void 0 : s.appPid)() ? I(((f) => (f = globalThis.blocklet) == null ? void 0 : f.appPid)()) : "#fff",
|
15
|
-
sx: l
|
15
|
+
sx: l = {}
|
16
16
|
}) {
|
17
17
|
const p = u(), t = x(null), o = c(t), i = d(() => o ? o.width < D - 50 : !0, [o, o == null ? void 0 : o.width]);
|
18
18
|
return /* @__PURE__ */ m(
|
@@ -6,42 +6,42 @@ import { useCreation as T } from "ahooks";
|
|
6
6
|
import "../Theme/theme.js";
|
7
7
|
import "../Theme/theme-provider.js";
|
8
8
|
import E from "../PoweredByArcBlock/index.js";
|
9
|
-
import
|
9
|
+
import b from "../Avatar/index.js";
|
10
10
|
import { getDIDColor as M, hexToRgba as z } from "../Util/index.js";
|
11
11
|
import L from "../hooks/use-blocklet-logo.js";
|
12
12
|
function K({
|
13
13
|
did: a,
|
14
14
|
children: n,
|
15
|
-
title: l,
|
16
|
-
description: s,
|
17
|
-
actions: h,
|
18
|
-
logo:
|
19
|
-
logoSize:
|
20
|
-
poweredBy:
|
21
|
-
termsOfUse: u,
|
22
|
-
standalone:
|
15
|
+
title: l = void 0,
|
16
|
+
description: s = void 0,
|
17
|
+
actions: h = void 0,
|
18
|
+
logo: i = void 0,
|
19
|
+
logoSize: d = 50,
|
20
|
+
poweredBy: m = void 0,
|
21
|
+
termsOfUse: u = void 0,
|
22
|
+
standalone: y = !1
|
23
23
|
}) {
|
24
|
-
const
|
25
|
-
meta:
|
24
|
+
const o = (globalThis == null ? void 0 : globalThis.blocklet) || (globalThis == null ? void 0 : globalThis.env) || {}, { palette: g } = C(), c = j((r) => r.breakpoints.down("lg")), I = L({
|
25
|
+
meta: o
|
26
26
|
}), D = T(() => {
|
27
|
-
const
|
28
|
-
return
|
29
|
-
}, [
|
27
|
+
const r = o.appPid, v = B(r), w = v ? void 0 : P(r);
|
28
|
+
return v ? M(r) : w.color;
|
29
|
+
}, [o == null ? void 0 : o.appPid]);
|
30
30
|
if (!a)
|
31
31
|
return n;
|
32
|
-
l === void 0 && (l =
|
32
|
+
l === void 0 && (l = o.appName), s === void 0 && (s = o.appDescription), i === void 0 && (i = I || ""), typeof i == "string" && (i ? i = /* @__PURE__ */ t(
|
33
33
|
e,
|
34
34
|
{
|
35
35
|
sx: {
|
36
|
-
height:
|
37
|
-
maxHeight:
|
36
|
+
height: d,
|
37
|
+
maxHeight: d,
|
38
38
|
objectFit: "contain"
|
39
39
|
},
|
40
40
|
component: "img",
|
41
|
-
src:
|
42
|
-
alt: `${
|
41
|
+
src: i,
|
42
|
+
alt: `${o.appName}'s logo`
|
43
43
|
}
|
44
|
-
) :
|
44
|
+
) : i = /* @__PURE__ */ t(b, { size: d, did: a, src: i, variant: "rounded" })), m === void 0 && (m = /* @__PURE__ */ t(
|
45
45
|
E,
|
46
46
|
{
|
47
47
|
linkProps: {
|
@@ -52,7 +52,7 @@ function K({
|
|
52
52
|
}
|
53
53
|
}
|
54
54
|
},
|
55
|
-
showExtra: !
|
55
|
+
showExtra: !c,
|
56
56
|
sx: {
|
57
57
|
textAlign: "center",
|
58
58
|
fontSize: "12px",
|
@@ -61,19 +61,19 @@ function K({
|
|
61
61
|
}
|
62
62
|
));
|
63
63
|
let p = n;
|
64
|
-
!n && !
|
64
|
+
!n && !c && (p = /* @__PURE__ */ t(
|
65
65
|
e,
|
66
66
|
{
|
67
67
|
sx: {
|
68
68
|
filter: "blur(180px)",
|
69
69
|
display: "flex"
|
70
70
|
},
|
71
|
-
children: /* @__PURE__ */ t(
|
71
|
+
children: /* @__PURE__ */ t(b, { size: 210, did: a, variant: "rounded" })
|
72
72
|
}
|
73
73
|
));
|
74
74
|
const k = !!n;
|
75
|
-
let f = !
|
76
|
-
return
|
75
|
+
let f = !y;
|
76
|
+
return c && (f = !k), /* @__PURE__ */ x(
|
77
77
|
e,
|
78
78
|
{
|
79
79
|
sx: {
|
@@ -121,7 +121,7 @@ function K({
|
|
121
121
|
gap: 1.5
|
122
122
|
},
|
123
123
|
children: [
|
124
|
-
/* @__PURE__ */ t(e, { sx: { display: "flex", alignItems: "center" }, children:
|
124
|
+
/* @__PURE__ */ t(e, { sx: { display: "flex", alignItems: "center" }, children: i }),
|
125
125
|
/* @__PURE__ */ t(
|
126
126
|
A,
|
127
127
|
{
|
@@ -167,7 +167,7 @@ function K({
|
|
167
167
|
right: 10,
|
168
168
|
textAlign: "center"
|
169
169
|
},
|
170
|
-
children:
|
170
|
+
children: m
|
171
171
|
}
|
172
172
|
)
|
173
173
|
]
|