@arcblock/ux 3.0.7 → 3.0.9
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.js +8 -8
- package/lib/ActivityIndicator/index.js +7 -6
- package/lib/Address/compact-text.js +3 -2
- package/lib/Address/did-address.js +3 -3
- package/lib/Address/index.js +2 -2
- package/lib/Address/responsive-did-address.js +3 -3
- package/lib/Alert/index.js +7 -7
- package/lib/AnimationWaiter/dark-animation.json.js +27 -0
- package/lib/AnimationWaiter/default-animation.json.js +29 -0
- package/lib/AnimationWaiter/index.js +10 -10
- package/lib/Async/index.js +4 -4
- package/lib/Avatar/etherscan-blockies.js +15 -15
- package/lib/Avatar/index.js +5 -5
- package/lib/Badge/index.js +4 -4
- package/lib/Blocklet/blocklet.js +10 -10
- package/lib/Blocklet/index.js +5 -6
- package/lib/Blocklet/utils.js +1 -1
- package/lib/BlockletContext/index.js +1 -1
- package/lib/BlockletNFT/index.js +18 -18
- package/lib/BlockletV2/blocklet.js +36 -35
- package/lib/BlockletV2/components/icon-text.js +1 -1
- package/lib/BlockletV2/components/tooltip-icon.js +1 -1
- package/lib/BlockletV2/index.js +7 -8
- package/lib/BlockletV2/utils.js +1 -1
- package/lib/Button/index.js +1 -1
- package/lib/Button/wrap.js +2 -2
- package/lib/ButtonGroup/index.js +1 -1
- package/lib/Center/index.js +1 -1
- package/lib/ClickToCopy/copy-button.js +1 -1
- package/lib/ClickToCopy/index.js +5 -5
- package/lib/CloseButton/index.js +1 -1
- package/lib/CodeBlock/index.js +3 -3
- package/lib/Colors/index.js +3 -3
- package/lib/Config/config-provider.js +16 -15
- package/lib/Config/index.js +5 -3
- package/lib/Config/theme-mode-toggle.js +1 -1
- package/lib/ContactForm/index.js +4 -4
- package/lib/CookieConsent/index.js +1 -1
- package/lib/CountDown/index.js +2 -2
- package/lib/DID/index.js +49 -49
- package/lib/DIDConnect/app-icon.js +10 -10
- package/lib/DIDConnect/app-info-item.js +4 -4
- package/lib/DIDConnect/auth-apps/auth-apps-info.js +1 -1
- package/lib/DIDConnect/auth-apps/index.js +9 -9
- package/lib/DIDConnect/did-connect-container.js +19 -18
- package/lib/DIDConnect/did-connect-footer.js +6 -6
- package/lib/DIDConnect/index.js +10 -10
- package/lib/DIDConnect/landing-page.js +30 -29
- package/lib/DIDConnect/powered-by.js +2 -2
- package/lib/DIDConnect/request-storage-access-api-dialog.js +5 -5
- package/lib/DIDConnect/with-container.js +26 -25
- package/lib/DIDConnect/with-ux-theme.js +7 -6
- package/lib/Datatable/CustomToolbar.js +12 -12
- package/lib/Datatable/TableSearch.js +2 -2
- package/lib/Datatable/index.js +4 -4
- package/lib/Dialog/confirm.js +10 -10
- package/lib/Dialog/dialog.js +7 -7
- package/lib/Dialog/index.js +3 -3
- package/lib/Dialog/use-confirm.js +1 -1
- package/lib/DriftBot/index.js +1 -1
- package/lib/Earth/countries.json.js +13 -0
- package/lib/Earth/index.js +9 -9
- package/lib/Empty/index.js +1 -1
- package/lib/ErrorBoundary/fallback.js +15 -15
- package/lib/ErrorBoundary/index.js +6 -1
- package/lib/Footer/index.js +3 -3
- package/lib/Header/auto-hidden.js +1 -1
- package/lib/Header/header.js +3 -3
- package/lib/Header/index.js +3 -3
- package/lib/Header/responsive-header.js +6 -6
- package/lib/Icon/image.js +2 -2
- package/lib/Icon/index.js +18 -18
- package/lib/Img/index.js +1 -1
- package/lib/InfoRow/index.js +1 -1
- package/lib/Layout/dashboard/index.js +31 -29
- package/lib/Layout/dashboard/sidebar.js +2 -2
- package/lib/Layout/dashboard-legacy/header.js +2 -2
- package/lib/Layout/dashboard-legacy/index.js +4 -4
- package/lib/Layout/dashboard-legacy/sidebar.js +8 -8
- package/lib/Layout/index.js +5 -5
- package/lib/Locale/context.js +20 -20
- package/lib/Locale/selector.js +3 -3
- package/lib/Logo/images/logo-dark-text.svg.js +5 -0
- package/lib/Logo/images/logo-dark-top.svg.js +5 -0
- package/lib/Logo/images/logo-light-text.svg.js +5 -0
- package/lib/Logo/images/logo-light-top.svg.js +5 -0
- package/lib/Logo/index.js +18 -18
- package/lib/Metric/index.js +2 -2
- package/lib/NFTDisplay/NFTBroken.svg.js +108 -0
- package/lib/NFTDisplay/aspect-ratio-container.js +1 -1
- package/lib/NFTDisplay/broken.js +2 -2
- package/lib/NFTDisplay/index.js +35 -35
- package/lib/NFTDisplay/loading.js +1 -1
- package/lib/NFTDisplay/render-svg.js +1 -1
- package/lib/NFTDisplay/svg-embedder/img.js +3 -3
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -1
- package/lib/NavMenu/images/OCAP.svg.js +5 -0
- package/lib/NavMenu/images/abt-network.svg.js +7 -0
- package/lib/NavMenu/images/ai-kit.svg.js +7 -0
- package/lib/NavMenu/images/aigne.svg.js +7 -0
- package/lib/NavMenu/images/aistro.svg.js +5 -0
- package/lib/NavMenu/images/arcsphere.svg.js +10 -0
- package/lib/NavMenu/images/blocklet-framework.svg.js +7 -0
- package/lib/NavMenu/images/blocklet-launcher.svg.js +5 -0
- package/lib/NavMenu/images/blocklet-server.svg.js +7 -0
- package/lib/NavMenu/images/blocklet-store.svg.js +5 -0
- package/lib/NavMenu/images/creator-studio.svg.js +7 -0
- package/lib/NavMenu/images/did-connect.svg.js +5 -0
- package/lib/NavMenu/images/did-name-service.svg.js +5 -0
- package/lib/NavMenu/images/did-wallet.svg.js +7 -0
- package/lib/NavMenu/images/did.svg.js +5 -0
- package/lib/NavMenu/images/nft-studio.svg.js +5 -0
- package/lib/NavMenu/images/vc.svg.js +5 -0
- package/lib/NavMenu/images/web3-kit.svg.js +7 -0
- package/lib/NavMenu/index.js +2 -2
- package/lib/NavMenu/nav-menu.js +23 -22
- package/lib/NavMenu/products.js +32 -32
- package/lib/NavMenu/style.js +1 -1
- package/lib/NavMenu/sub-item-group.js +1 -1
- package/lib/PageScroller/index.js +19 -19
- package/lib/PageScroller/story/FullPage.js +27 -27
- package/lib/PageScroller/story/PageContain.js +8 -8
- package/lib/Passport/index.js +2 -3
- package/lib/Passport/passport.js +2 -2
- package/lib/PhoneInput/country-select.js +1 -1
- package/lib/PhoneInput/index.js +2 -2
- package/lib/PricingTable/PricingPlan.js +1 -1
- package/lib/PricingTable/index.js +3 -3
- package/lib/RelativeTime/index.js +1 -1
- package/lib/Result/common.js +6 -4
- package/lib/Result/index.js +2 -2
- package/lib/Result/result.js +1 -1
- package/lib/Screenshot/BaseScreenshot/index.js +3 -3
- package/lib/Screenshot/index.js +9 -9
- package/lib/SessionBlocklet/index.js +8 -8
- package/lib/SessionManager/index.js +2 -3
- package/lib/SessionUser/components/did-space.js +14 -14
- package/lib/SessionUser/components/logged-in.js +33 -33
- package/lib/SessionUser/components/quick-login-item.js +29 -29
- package/lib/SessionUser/components/session-user-item.js +23 -23
- package/lib/SessionUser/components/session-user-switch.js +4 -4
- package/lib/SessionUser/components/un-login.js +7 -7
- package/lib/SessionUser/components/user-info.js +16 -16
- package/lib/SessionUser/images/did-spaces.svg.js +5 -0
- package/lib/SessionUser/index.js +2 -2
- package/lib/SharedBridge/index.js +23 -23
- package/lib/Spinner/index.js +1 -1
- package/lib/SplitButton/index.js +1 -1
- package/lib/Switch/index.js +1 -1
- package/lib/Tabs/index.js +1 -1
- package/lib/Tag/index.js +6 -6
- package/lib/TextCollapse/index.js +2 -2
- package/lib/Theme/index.js +22 -11
- package/lib/Theme/theme-provider.js +2 -2
- package/lib/Theme/theme.js +4 -4
- package/lib/Toast/index.js +11 -11
- package/lib/UserCard/Cards/avatar-only.js +2 -2
- package/lib/UserCard/Cards/basic-info.js +3 -3
- package/lib/UserCard/Cards/index.js +3 -3
- package/lib/UserCard/Cards/name-only.js +1 -1
- package/lib/UserCard/Container/card.js +2 -2
- package/lib/UserCard/Container/dialog.js +1 -1
- package/lib/UserCard/Content/basic.js +1 -1
- package/lib/UserCard/Content/clock.js +3 -3
- package/lib/UserCard/Content/minimal.js +8 -8
- package/lib/UserCard/Content/tooltip-avatar.js +1 -1
- package/lib/UserCard/components.js +23 -23
- package/lib/UserCard/index.js +12 -12
- package/lib/Util/index.js +2 -2
- package/lib/VerificationCode/index.js +1 -1
- package/lib/Video/index.js +2 -2
- package/lib/Wallet/Action.js +4 -4
- package/lib/Wallet/Download.js +6 -6
- package/lib/Wallet/Open.js +1 -1
- package/lib/Wallet/images/android_download.svg.js +5 -0
- package/lib/Wallet/images/app-store.svg.js +5 -0
- package/lib/Wallet/images/google-play.svg.js +5 -0
- package/lib/WalletOSIcon/index.js +1 -1
- package/lib/WebWalletSWKeeper/index.js +2 -2
- package/lib/WechatPrompt/index.js +1 -1
- package/lib/hooks/use-blocklet-logo.js +15 -13
- package/lib/hooks/use-clock.js +1 -1
- package/lib/index.js +79 -74
- package/lib/ux.css +1 -0
- package/lib/withTheme/index.js +7 -6
- package/lib/withTracker/error_boundary.js +1 -1
- package/package.json +7 -7
- package/vite.config.mjs +1 -1
package/lib/CodeBlock/index.js
CHANGED
@@ -19,9 +19,9 @@ import b from "highlight.js/lib/languages/plaintext";
|
|
19
19
|
import B from "highlight.js/lib/languages/markdown";
|
20
20
|
import "highlight.js/styles/atom-one-dark.css";
|
21
21
|
import { FileCopy as S, Check as T } from "@mui/icons-material";
|
22
|
-
import o from "../Colors";
|
23
|
-
import { styled as A } from "../Theme";
|
24
|
-
import E from "./LightBox";
|
22
|
+
import o from "../Colors/themes/default.js";
|
23
|
+
import { styled as A } from "../Theme/index.js";
|
24
|
+
import E from "./LightBox.js";
|
25
25
|
e.registerLanguage("javascript", n);
|
26
26
|
e.registerLanguage("js", n);
|
27
27
|
e.registerLanguage("jsx", n);
|
package/lib/Colors/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { default as t } from "./themes/default";
|
2
|
-
import { default as f } from "./themes/temp";
|
3
|
-
import { default as d } from "./themes/did-connect";
|
1
|
+
import { default as t } from "./themes/default.js";
|
2
|
+
import { default as f } from "./themes/temp.js";
|
3
|
+
import { default as d } from "./themes/did-connect.js";
|
4
4
|
export {
|
5
5
|
t as default,
|
6
6
|
d as didConnectColors,
|
@@ -1,16 +1,17 @@
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
2
|
-
import { LocaleProvider as
|
3
|
-
import x, { useColorScheme as a } from "../Theme/theme-provider";
|
4
|
-
import { useTheme as d } from "
|
5
|
-
|
2
|
+
import { LocaleProvider as p, useLocaleContext as C } from "../Locale/context.js";
|
3
|
+
import x, { useColorScheme as a } from "../Theme/theme-provider.js";
|
4
|
+
import { useTheme as d } from "@mui/material";
|
5
|
+
import "../Theme/theme.js";
|
6
|
+
function T({
|
6
7
|
children: o,
|
7
8
|
// theme provider
|
8
9
|
theme: e,
|
9
10
|
injectFirst: r,
|
10
11
|
darkSchemeClass: m,
|
11
|
-
prefer:
|
12
|
-
disableBlockletTheme:
|
13
|
-
enableColorScheme:
|
12
|
+
prefer: i,
|
13
|
+
disableBlockletTheme: n = !1,
|
14
|
+
enableColorScheme: c,
|
14
15
|
// locale provider
|
15
16
|
locale: f,
|
16
17
|
fallbackLocale: s,
|
@@ -24,11 +25,11 @@ function S({
|
|
24
25
|
theme: e,
|
25
26
|
injectFirst: r,
|
26
27
|
darkSchemeClass: m,
|
27
|
-
prefer:
|
28
|
-
disableBlockletTheme:
|
29
|
-
enableColorScheme:
|
28
|
+
prefer: i,
|
29
|
+
disableBlockletTheme: n,
|
30
|
+
enableColorScheme: c,
|
30
31
|
children: /* @__PURE__ */ t(
|
31
|
-
|
32
|
+
p,
|
32
33
|
{
|
33
34
|
locale: f,
|
34
35
|
fallbackLocale: s,
|
@@ -41,8 +42,8 @@ function S({
|
|
41
42
|
}
|
42
43
|
);
|
43
44
|
}
|
44
|
-
function
|
45
|
-
const o = d(), e =
|
45
|
+
function j() {
|
46
|
+
const o = d(), e = C(), r = a();
|
46
47
|
return {
|
47
48
|
theme: o,
|
48
49
|
...e,
|
@@ -50,6 +51,6 @@ function T() {
|
|
50
51
|
};
|
51
52
|
}
|
52
53
|
export {
|
53
|
-
|
54
|
-
|
54
|
+
T as ConfigProvider,
|
55
|
+
j as useConfig
|
55
56
|
};
|
package/lib/Config/index.js
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
import { default as
|
1
|
+
import { ConfigProvider as r, useConfig as f } from "./config-provider.js";
|
2
|
+
import { default as d } from "./theme-mode-toggle.js";
|
3
3
|
export {
|
4
|
-
|
4
|
+
r as ConfigProvider,
|
5
|
+
d as ThemeModeToggle,
|
6
|
+
f as useConfig
|
5
7
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
2
|
import { IconButton as l } from "@mui/material";
|
3
3
|
import { Brightness2Outlined as s, LightModeOutlined as m } from "@mui/icons-material";
|
4
|
-
import { useColorScheme as u } from "../Theme/theme-provider";
|
4
|
+
import { useColorScheme as u } from "../Theme/theme-provider.js";
|
5
5
|
function h() {
|
6
6
|
var r, t;
|
7
7
|
const { mode: n, toggleMode: o, prefer: i } = u();
|
package/lib/ContactForm/index.js
CHANGED
@@ -2,10 +2,10 @@ import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import f from "react";
|
3
3
|
import g from "axios";
|
4
4
|
import { Typography as m, CircularProgress as b } from "@mui/material";
|
5
|
-
import { mergeProps as y } from "../Util";
|
6
|
-
import { warn as x } from "../Util/deprecate";
|
7
|
-
import v from "../Button";
|
8
|
-
import { styled as w } from "../Theme";
|
5
|
+
import { mergeProps as y } from "../Util/index.js";
|
6
|
+
import { warn as x } from "../Util/deprecate.js";
|
7
|
+
import v from "../Button/index.js";
|
8
|
+
import { styled as w } from "../Theme/index.js";
|
9
9
|
function S({ formId: t, portalId: e }, s, r) {
|
10
10
|
const a = `https://api.hsforms.com/submissions/v3/integration/submit/${e}/${t}`;
|
11
11
|
return g.post(a, {
|
@@ -2,7 +2,7 @@ import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Button as d } from "@mui/material";
|
3
3
|
import s from "react-cookie-consent";
|
4
4
|
import { resetCookieConsentValue as y } from "react-cookie-consent";
|
5
|
-
import { styled as p } from "../Theme";
|
5
|
+
import { styled as p } from "../Theme/index.js";
|
6
6
|
const n = {
|
7
7
|
en: {
|
8
8
|
content: "We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content, to analyze our website traffic, and to understand where our visitors are coming from.",
|
package/lib/CountDown/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { jsxs as g, jsx as s } from "react/jsx-runtime";
|
2
2
|
import { Component as b } from "react";
|
3
3
|
import p from "lodash/isUndefined";
|
4
|
-
import { getColor as u, mergeProps as y } from "../Util";
|
5
|
-
import { styled as k } from "../Theme";
|
4
|
+
import { getColor as u, mergeProps as y } from "../Util/index.js";
|
5
|
+
import { styled as k } from "../Theme/index.js";
|
6
6
|
const c = 60, d = 60 * c, m = 24 * d;
|
7
7
|
function h(e) {
|
8
8
|
const n = (/* @__PURE__ */ new Date()).getTime(), t = Math.round((e - n) / 1e3), i = Math.floor(t / m), r = Math.floor(t % m / d), o = Math.floor(t % m % d / c), a = Math.round(t % m % d % c);
|
package/lib/DID/index.js
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import { jsxs as x, Fragment as H, jsx as
|
2
|
-
import { getDIDMotifInfo as
|
3
|
-
import { types as
|
4
|
-
import
|
1
|
+
import { jsxs as x, Fragment as H, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { getDIDMotifInfo as j } from "@arcblock/did-motif";
|
3
|
+
import { types as P } from "@ocap/mcrypto";
|
4
|
+
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
|
-
import { Box as N, Dialog as G, DialogContent as J, Typography as
|
7
|
+
import { Box as N, Dialog as G, DialogContent as J, Typography as S } from "@mui/material";
|
8
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
11
|
import oe from "lodash/noop";
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import { DID_PREFIX as
|
15
|
-
import { translate as ne } from "../Locale/util";
|
16
|
-
import { isEthereumDid as se, getDIDColor as ie } from "../Util";
|
12
|
+
import k from "../Address/index.js";
|
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
17
|
const ae = {
|
18
18
|
en: {
|
19
19
|
scanQrcode: "Scan with DID Wallet to view the {role}",
|
@@ -25,11 +25,11 @@ const ae = {
|
|
25
25
|
download: "下载",
|
26
26
|
downloadTips: "没有 DID Wallet ?"
|
27
27
|
}
|
28
|
-
}, A = "xenon-2020-01-15",
|
28
|
+
}, A = "xenon-2020-01-15", W = {
|
29
29
|
main: A,
|
30
30
|
"main.abtnetwork.io": A,
|
31
31
|
"beta.abtnetwork.io": "beta"
|
32
|
-
}, le = (e,
|
32
|
+
}, le = (e, r, o) => o ? ie(e) : r.color, de = (e) => !{
|
33
33
|
0: !0,
|
34
34
|
// ACCOUNT
|
35
35
|
6: !0,
|
@@ -37,14 +37,14 @@ const ae = {
|
|
37
37
|
17: !0
|
38
38
|
// TOKEN
|
39
39
|
}[e], ce = (e) => {
|
40
|
-
if (e ===
|
40
|
+
if (e === P.RoleType.ROLE_ANY)
|
41
41
|
return "DID";
|
42
|
-
const [
|
43
|
-
return
|
44
|
-
}, pe = (e,
|
45
|
-
function
|
46
|
-
const o = se(e), n = o ? void 0 :
|
47
|
-
/* @__PURE__ */
|
42
|
+
const [r] = Object.entries(P.RoleType).find((o) => o[1] === e) || [];
|
43
|
+
return r ? r.toLowerCase().replace(/role_(\S)/g, (o, n) => n.toUpperCase()) : "DID";
|
44
|
+
}, pe = (e, r, o) => r || de(e.roleType) ? o * 0.75 : o;
|
45
|
+
function F({ did: e, showAvatar: r }) {
|
46
|
+
const o = se(e), n = o ? void 0 : j(e), f = g(() => o ? e : `${te}${e}`, [e, o]), c = v((i, a) => [
|
47
|
+
/* @__PURE__ */ t(
|
48
48
|
"span",
|
49
49
|
{
|
50
50
|
style: { flex: "0 0 auto", color: le(e, n, o) },
|
@@ -56,8 +56,8 @@ function L({ did: e, showAvatar: t }) {
|
|
56
56
|
o ? "ETH" : "ABT",
|
57
57
|
":"
|
58
58
|
] }, `${a}-prefix-abt-${i}`),
|
59
|
-
|
60
|
-
|
59
|
+
r && /* @__PURE__ */ t(
|
60
|
+
re,
|
61
61
|
{
|
62
62
|
src: "",
|
63
63
|
did: e,
|
@@ -79,7 +79,7 @@ function L({ did: e, showAvatar: t }) {
|
|
79
79
|
}
|
80
80
|
function _e({
|
81
81
|
ref: e = void 0,
|
82
|
-
...
|
82
|
+
...r
|
83
83
|
}) {
|
84
84
|
const {
|
85
85
|
did: o,
|
@@ -101,7 +101,7 @@ function _e({
|
|
101
101
|
style: w,
|
102
102
|
className: Q,
|
103
103
|
sx: m
|
104
|
-
} =
|
104
|
+
} = r, s = ee(o), d = {
|
105
105
|
size: T,
|
106
106
|
component: l,
|
107
107
|
copyable: R,
|
@@ -115,9 +115,9 @@ function _e({
|
|
115
115
|
style: w,
|
116
116
|
className: Q,
|
117
117
|
sx: m
|
118
|
-
}, C = K(null), { content:
|
118
|
+
}, C = K(null), { content: L, getPrepend: M } = F({ did: s, showAvatar: c }), [U, b] = V(!1), B = v(() => {
|
119
119
|
b(!1);
|
120
|
-
}),
|
120
|
+
}), O = v((y) => {
|
121
121
|
y.stopPropagation(), y.preventDefault(), b(!0);
|
122
122
|
});
|
123
123
|
return Z(e, () => new Proxy(
|
@@ -127,27 +127,27 @@ function _e({
|
|
127
127
|
},
|
128
128
|
{
|
129
129
|
get(y, z) {
|
130
|
-
var
|
131
|
-
return y[z] || ((
|
130
|
+
var E;
|
131
|
+
return y[z] || ((E = C == null ? void 0 : C.current) == null ? void 0 : E[z]);
|
132
132
|
}
|
133
133
|
}
|
134
134
|
)), /* @__PURE__ */ x(H, { children: [
|
135
|
-
/* @__PURE__ */
|
136
|
-
|
135
|
+
/* @__PURE__ */ t(
|
136
|
+
k,
|
137
137
|
{
|
138
138
|
locale: a,
|
139
|
-
content:
|
139
|
+
content: L,
|
140
140
|
...d,
|
141
141
|
ref: C,
|
142
142
|
prepend: M(d.size, "address"),
|
143
143
|
append: /* @__PURE__ */ x(H, { children: [
|
144
|
-
i ? /* @__PURE__ */
|
144
|
+
i ? /* @__PURE__ */ t(
|
145
145
|
N,
|
146
146
|
{
|
147
147
|
id: "did-qrcode-button",
|
148
148
|
component: X,
|
149
149
|
icon: Y,
|
150
|
-
onClick:
|
150
|
+
onClick: O,
|
151
151
|
sx: {
|
152
152
|
flexShrink: 0,
|
153
153
|
cursor: "pointer",
|
@@ -162,7 +162,7 @@ function _e({
|
|
162
162
|
},
|
163
163
|
"address"
|
164
164
|
),
|
165
|
-
/* @__PURE__ */
|
165
|
+
/* @__PURE__ */ t(
|
166
166
|
ue,
|
167
167
|
{
|
168
168
|
did: s,
|
@@ -170,7 +170,7 @@ function _e({
|
|
170
170
|
roleType: f,
|
171
171
|
showAvatar: c,
|
172
172
|
open: U,
|
173
|
-
onClose:
|
173
|
+
onClose: B,
|
174
174
|
...d
|
175
175
|
}
|
176
176
|
)
|
@@ -178,7 +178,7 @@ function _e({
|
|
178
178
|
}
|
179
179
|
function ue({
|
180
180
|
did: e,
|
181
|
-
chainId:
|
181
|
+
chainId: r = void 0,
|
182
182
|
roleType: o = void 0,
|
183
183
|
showAvatar: n = !0,
|
184
184
|
// DialogProps
|
@@ -191,10 +191,10 @@ function ue({
|
|
191
191
|
locale: l = "en",
|
192
192
|
...R
|
193
193
|
}) {
|
194
|
-
const h = v((m, s = {}) => ne(ae, m, l, "en", s)), { isEthDid: p, content: u, didMotifInfo: D, getPrepend: $ } =
|
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: [
|
195
195
|
h("downloadTips"),
|
196
196
|
" ",
|
197
|
-
/* @__PURE__ */
|
197
|
+
/* @__PURE__ */ t(
|
198
198
|
N,
|
199
199
|
{
|
200
200
|
component: "a",
|
@@ -213,19 +213,19 @@ function ue({
|
|
213
213
|
)
|
214
214
|
] }), [I]), w = g(() => {
|
215
215
|
var m;
|
216
|
-
if (
|
217
|
-
return
|
216
|
+
if (r)
|
217
|
+
return W[r] || r;
|
218
218
|
if (p) return "1";
|
219
219
|
try {
|
220
220
|
const s = (m = window.blocklet) == null ? void 0 : m.CHAIN_HOST, d = new URL(s).hostname;
|
221
221
|
if (d)
|
222
|
-
return
|
222
|
+
return W[d] || A;
|
223
223
|
} catch (s) {
|
224
224
|
console.warn("Failed to parse chainHost:", s);
|
225
225
|
}
|
226
226
|
return A;
|
227
|
-
}, [p,
|
228
|
-
return /* @__PURE__ */
|
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]);
|
228
|
+
return /* @__PURE__ */ t(
|
229
229
|
G,
|
230
230
|
{
|
231
231
|
open: f,
|
@@ -241,9 +241,9 @@ function ue({
|
|
241
241
|
}
|
242
242
|
},
|
243
243
|
children: /* @__PURE__ */ x(J, { align: "center", sx: { p: 3 }, children: [
|
244
|
-
/* @__PURE__ */
|
245
|
-
/* @__PURE__ */
|
246
|
-
|
244
|
+
/* @__PURE__ */ t(S, { sx: { mb: 2, fontWeight: 500, fontSize: 18 }, children: h("scanQrcode", { role: ce(o || (D == null ? void 0 : D.roleType)) }) }),
|
245
|
+
/* @__PURE__ */ t(
|
246
|
+
q,
|
247
247
|
{
|
248
248
|
value: Q,
|
249
249
|
size: 256,
|
@@ -251,8 +251,8 @@ function ue({
|
|
251
251
|
level: "M"
|
252
252
|
}
|
253
253
|
),
|
254
|
-
/* @__PURE__ */
|
255
|
-
|
254
|
+
/* @__PURE__ */ t(N, { sx: { mt: 1.5, textAlign: "center" }, children: /* @__PURE__ */ t(
|
255
|
+
k,
|
256
256
|
{
|
257
257
|
locale: l,
|
258
258
|
content: u,
|
@@ -264,8 +264,8 @@ function ue({
|
|
264
264
|
},
|
265
265
|
"dialog-address"
|
266
266
|
) }),
|
267
|
-
/* @__PURE__ */
|
268
|
-
|
267
|
+
/* @__PURE__ */ t(
|
268
|
+
S,
|
269
269
|
{
|
270
270
|
variant: "body2",
|
271
271
|
sx: {
|
@@ -1,26 +1,26 @@
|
|
1
|
-
import { jsx as
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
2
2
|
import { useState as p } from "react";
|
3
3
|
import { joinURL as a } from "ufo";
|
4
|
-
import
|
5
|
-
import { isUrl as
|
6
|
-
import
|
7
|
-
function
|
4
|
+
import u from "../Img/index.js";
|
5
|
+
import { isUrl as c } from "../Util/index.js";
|
6
|
+
import d from "../Avatar/index.js";
|
7
|
+
function E({ appInfo: r, size: t = 32, ...m }) {
|
8
8
|
const [e, l] = p(!1);
|
9
9
|
if (e || !(r.appUrl || r.appLogo))
|
10
|
-
return /* @__PURE__ */
|
10
|
+
return /* @__PURE__ */ i(d, { did: r.appPid, size: t });
|
11
11
|
let o = r.appLogo || "";
|
12
|
-
return
|
13
|
-
|
12
|
+
return c(o) || (o = a(r.appUrl || "", o)), /* @__PURE__ */ i(
|
13
|
+
u,
|
14
14
|
{
|
15
15
|
src: o,
|
16
16
|
alt: r.appName || "Blocklet Icon",
|
17
17
|
width: t,
|
18
18
|
height: t,
|
19
|
-
...
|
19
|
+
...m,
|
20
20
|
onError: () => l(!0)
|
21
21
|
}
|
22
22
|
);
|
23
23
|
}
|
24
24
|
export {
|
25
|
-
|
25
|
+
E as default
|
26
26
|
};
|
@@ -4,10 +4,10 @@ import f from "@iconify-icons/material-symbols/check";
|
|
4
4
|
import { Icon as d } from "@iconify/react";
|
5
5
|
import { useSize as h, useCreation as u } from "ahooks";
|
6
6
|
import { useRef as x } from "react";
|
7
|
-
import { DID as w } from "../DID";
|
8
|
-
import { mergeSx as I } from "../Util/style";
|
9
|
-
import N from "./app-icon";
|
10
|
-
import { DID_CONNECT_MEDIUM_WIDTH as C } from "../Util/constant";
|
7
|
+
import { DID as w } from "../DID/index.js";
|
8
|
+
import { mergeSx as I } from "../Util/style.js";
|
9
|
+
import N from "./app-icon.js";
|
10
|
+
import { DID_CONNECT_MEDIUM_WIDTH as C } from "../Util/constant.js";
|
11
11
|
function b({
|
12
12
|
appInfo: r,
|
13
13
|
active: l = !1,
|
@@ -2,15 +2,15 @@ import { jsx as i, jsxs as r, Fragment as G } from "react/jsx-runtime";
|
|
2
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
4
|
import c from "lodash/noop";
|
5
|
-
import Q from "../did-connect-container";
|
6
|
-
import S from "./auth-apps-info";
|
7
|
-
import V from "../../Center";
|
8
|
-
import X from "../landing-page";
|
9
|
-
import { translate as Y } from "../../Locale/util";
|
10
|
-
import { useLocaleContext as Z } from "../../Locale/context";
|
11
|
-
import _ from "../../UserCard";
|
12
|
-
import { InfoType as $, CardType as P } from "../../UserCard/types";
|
13
|
-
import { mergeSx as b } from "../../Util/style";
|
5
|
+
import Q from "../did-connect-container.js";
|
6
|
+
import S from "./auth-apps-info.js";
|
7
|
+
import V from "../../Center/index.js";
|
8
|
+
import X from "../landing-page.js";
|
9
|
+
import { translate as Y } from "../../Locale/util.js";
|
10
|
+
import { useLocaleContext as Z } from "../../Locale/context.js";
|
11
|
+
import _ from "../../UserCard/index.js";
|
12
|
+
import { InfoType as $, CardType as P } from "../../UserCard/types.js";
|
13
|
+
import { mergeSx as b } from "../../Util/style.js";
|
14
14
|
const ee = {
|
15
15
|
en: {
|
16
16
|
notThis: "Not this?",
|
@@ -1,15 +1,16 @@
|
|
1
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
|
-
import { Backdrop as Z, useMediaQuery as P, Box as l, Drawer as
|
5
|
-
import { useCreation as
|
6
|
-
import
|
7
|
-
import { getDIDMotifInfo as
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import {
|
12
|
-
import
|
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 ie, useDebounce as te } from "ahooks";
|
6
|
+
import de from "color-convert";
|
7
|
+
import { getDIDMotifInfo as ce } from "@arcblock/did-motif";
|
8
|
+
import le from "lodash/noop";
|
9
|
+
import "../Theme/theme.js";
|
10
|
+
import "../Theme/theme-provider.js";
|
11
|
+
import { mergeSx as c } from "../Util/style.js";
|
12
|
+
import { isEthereumDid as ue, getDIDColor as se, hexToRgba as u } from "../Util/index.js";
|
13
|
+
import h from "./did-connect-footer.js";
|
13
14
|
const j = J(({ ref: a, ...f }) => /* @__PURE__ */ U(
|
14
15
|
Z,
|
15
16
|
{
|
@@ -24,28 +25,28 @@ const j = J(({ ref: a, ...f }) => /* @__PURE__ */ U(
|
|
24
25
|
key: "background"
|
25
26
|
}
|
26
27
|
));
|
27
|
-
function
|
28
|
+
function ye({
|
28
29
|
open: a = !1,
|
29
30
|
popup: f = !1,
|
30
31
|
hideCloseButton: w = !1,
|
31
32
|
children: g,
|
32
33
|
appPid: E = void 0,
|
33
34
|
slotProps: e = void 0,
|
34
|
-
onClose: G =
|
35
|
+
onClose: G = le,
|
35
36
|
keepMounted: k = !1
|
36
37
|
}) {
|
37
38
|
var y, A, L, _, B, I, z, M;
|
38
|
-
const n =
|
39
|
-
const o = E || window.blocklet.appPid, r = ue(o), i = r ? void 0 :
|
39
|
+
const n = ie(() => {
|
40
|
+
const o = E || window.blocklet.appPid, r = ue(o), i = r ? void 0 : ce(o);
|
40
41
|
return r ? se(o) : i.color;
|
41
42
|
}, []), C = X(null), N = Y(), O = P("(max-width:640px)");
|
42
43
|
let s = "page";
|
43
44
|
f && (s = "dialog", O && N.mobile.any && (s = "drawer"));
|
44
|
-
const b =
|
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, {
|
45
46
|
wait: T
|
46
47
|
}), D = (o, r) => {
|
47
48
|
["backdropClick", "escapeKeyDown"].includes(r) || G();
|
48
|
-
}, v = W || a || k, F = w ?
|
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);
|
49
50
|
let p = !1;
|
50
51
|
(d * (100 + K) / 100 > 100 || d * (100 + Q) / 100 < 0) && (p = !0);
|
51
52
|
const V = `linear-gradient(45deg, ${x.map((o) => {
|
@@ -206,7 +207,7 @@ function Se({
|
|
206
207
|
]
|
207
208
|
}
|
208
209
|
) : /* @__PURE__ */ t(
|
209
|
-
|
210
|
+
ne,
|
210
211
|
{
|
211
212
|
open: a,
|
212
213
|
slots: {
|
@@ -230,7 +231,7 @@ function Se({
|
|
230
231
|
)
|
231
232
|
},
|
232
233
|
children: /* @__PURE__ */ m(
|
233
|
-
|
234
|
+
ae,
|
234
235
|
{
|
235
236
|
sx: {
|
236
237
|
maxWidth: "calc(100vw - 18px)",
|
@@ -251,5 +252,5 @@ function Se({
|
|
251
252
|
);
|
252
253
|
}
|
253
254
|
export {
|
254
|
-
|
255
|
+
ye as default
|
255
256
|
};
|
@@ -3,12 +3,12 @@ import { Box as a } from "@mui/material";
|
|
3
3
|
import { useSize as c, useCreation as d } from "ahooks";
|
4
4
|
import { useRef as x } from "react";
|
5
5
|
import u from "@arcblock/react-hooks/lib/useBrowser";
|
6
|
-
import b from "./powered-by";
|
7
|
-
import h from "./app-info-item";
|
8
|
-
import w from "./app-icon";
|
9
|
-
import { hexToRgba as g, getDIDColor as I } from "../Util";
|
10
|
-
import { mergeSx as C } from "../Util/style";
|
11
|
-
import { DID_CONNECT_MEDIUM_WIDTH as D } from "../Util/constant";
|
6
|
+
import b from "./powered-by.js";
|
7
|
+
import h from "./app-info-item.js";
|
8
|
+
import w from "./app-icon.js";
|
9
|
+
import { hexToRgba as g, getDIDColor as I } from "../Util/index.js";
|
10
|
+
import { mergeSx as C } from "../Util/style.js";
|
11
|
+
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",
|
package/lib/DIDConnect/index.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
import { default as t } from "./did-connect-footer";
|
2
|
-
import { default as a } from "./app-info-item";
|
3
|
-
import { default as p } from "./app-icon";
|
4
|
-
import { default as m } from "./powered-by";
|
5
|
-
import { default as u } from "./with-container";
|
6
|
-
import { default as l } from "./with-ux-theme";
|
7
|
-
import { default as D } from "./did-connect-logo";
|
8
|
-
import { default as i } from "./did-connect-container";
|
9
|
-
import { default as I } from "./request-storage-access-api-dialog";
|
10
|
-
import { default as h } from "./auth-apps";
|
1
|
+
import { default as t } from "./did-connect-footer.js";
|
2
|
+
import { default as a } from "./app-info-item.js";
|
3
|
+
import { default as p } from "./app-icon.js";
|
4
|
+
import { default as m } from "./powered-by.js";
|
5
|
+
import { default as u } from "./with-container.js";
|
6
|
+
import { default as l } from "./with-ux-theme.js";
|
7
|
+
import { default as D } from "./did-connect-logo.js";
|
8
|
+
import { default as i } from "./did-connect-container.js";
|
9
|
+
import { default as I } from "./request-storage-access-api-dialog.js";
|
10
|
+
import { default as h } from "./auth-apps/index.js";
|
11
11
|
export {
|
12
12
|
p as AppIcon,
|
13
13
|
a as AppInfoItem,
|