@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.
Files changed (253) hide show
  1. package/lib/ActionButton/index.d.ts +1 -1
  2. package/lib/ActionButton/index.js +1 -1
  3. package/lib/Address/compact-text.d.ts +1 -1
  4. package/lib/Address/compact-text.js +5 -5
  5. package/lib/Address/did-address.js +1 -1
  6. package/lib/Address/index.js +5 -5
  7. package/lib/Address/responsive-did-address.js +14 -14
  8. package/lib/Alert/index.d.ts +1 -1
  9. package/lib/Alert/index.js +1 -1
  10. package/lib/Avatar/index.d.ts +1 -1
  11. package/lib/Avatar/index.js +1 -1
  12. package/lib/Badge/index.js +1 -1
  13. package/lib/BlockletContext/index.d.ts +1 -1
  14. package/lib/BlockletNFT/index.js +1 -1
  15. package/lib/BlockletV2/blocklet.d.ts +1 -1
  16. package/lib/BlockletV2/blocklet.js +1 -1
  17. package/lib/BlockletV2/components/icon-text.d.ts +1 -1
  18. package/lib/BlockletV2/components/icon-text.js +13 -13
  19. package/lib/BlockletV2/components/tooltip-icon.js +22 -20
  20. package/lib/Button/wrap.js +1 -1
  21. package/lib/Center/index.js +3 -3
  22. package/lib/ClickToCopy/copy-button.js +3 -3
  23. package/lib/CloseButton/index.js +1 -1
  24. package/lib/ContactForm/index.js +22 -21
  25. package/lib/DID/index.js +45 -44
  26. package/lib/DIDConnect/app-info-item.js +1 -1
  27. package/lib/DIDConnect/auth-apps/index.js +48 -48
  28. package/lib/DIDConnect/did-connect-container.js +22 -22
  29. package/lib/DIDConnect/did-connect-footer.js +1 -1
  30. package/lib/DIDConnect/landing-page.js +27 -27
  31. package/lib/DIDConnect/request-storage-access-api-dialog.js +39 -40
  32. package/lib/Datatable/CustomToolbar.d.ts +3 -1
  33. package/lib/Datatable/CustomToolbar.js +1 -1
  34. package/lib/Datatable/index.js +2 -2
  35. package/lib/Dialog/confirm.d.ts +1 -1
  36. package/lib/Dialog/confirm.js +12 -12
  37. package/lib/Earth/index.js +1 -1
  38. package/lib/Footer/index.d.ts +1 -1
  39. package/lib/Footer/index.js +5 -5
  40. package/lib/Header/addon-button.d.ts +1 -1
  41. package/lib/Header/addon-button.js +11 -6
  42. package/lib/Header/header.js +1 -1
  43. package/lib/Header/responsive-header.d.ts +1 -1
  44. package/lib/Header/responsive-header.js +33 -34
  45. package/lib/Icon/index.js +12 -12
  46. package/lib/InfoRow/index.d.ts +1 -1
  47. package/lib/InfoRow/index.js +0 -1
  48. package/lib/Layout/dashboard/external-link.d.ts +1 -1
  49. package/lib/Layout/dashboard/external-link.js +1 -1
  50. package/lib/Layout/dashboard/full-page.js +8 -8
  51. package/lib/Layout/dashboard/index.js +1 -1
  52. package/lib/Layout/dashboard/sidebar.js +1 -1
  53. package/lib/Layout/dashboard-legacy/header.js +10 -10
  54. package/lib/Layout/dashboard-legacy/index.js +16 -16
  55. package/lib/Layout/dashboard-legacy/sidebar.d.ts +1 -1
  56. package/lib/Layout/dashboard-legacy/sidebar.js +19 -12
  57. package/lib/Layout/index.js +2 -2
  58. package/lib/LoadingMask/index.d.ts +1 -1
  59. package/lib/LoadingMask/index.js +4 -4
  60. package/lib/Locale/context.js +24 -24
  61. package/lib/Locale/selector.d.ts +1 -1
  62. package/lib/Locale/selector.js +1 -1
  63. package/lib/Logo/index.js +3 -3
  64. package/lib/NFTDisplay/aspect-ratio-container.d.ts +1 -1
  65. package/lib/NFTDisplay/index.js +5 -2
  66. package/lib/NFTDisplay/render-svg.js +3 -3
  67. package/lib/NavMenu/nav-menu.js +29 -26
  68. package/lib/NavMenu/products.js +1 -1
  69. package/lib/PageScroller/index.js +43 -43
  70. package/lib/PhoneInput/country-select.js +23 -23
  71. package/lib/PhoneInput/index.js +11 -11
  72. package/lib/PoweredByArcBlock/index.js +10 -6
  73. package/lib/QRCode/index.js +5 -5
  74. package/lib/RelativeTime/index.js +16 -16
  75. package/lib/Result/result.js +5 -5
  76. package/lib/Screenshot/index.d.ts +1 -1
  77. package/lib/Screenshot/index.js +1 -1
  78. package/lib/SessionUser/components/did-space.d.ts +1 -1
  79. package/lib/SessionUser/components/session-user-item.js +10 -10
  80. package/lib/SharedBridge/index.js +6 -6
  81. package/lib/Spinner/index.js +1 -1
  82. package/lib/SplitButton/index.d.ts +1 -1
  83. package/lib/SplitButton/index.js +1 -1
  84. package/lib/Success/index.js +1 -1
  85. package/lib/Tabs/index.js +15 -8
  86. package/lib/Tag/index.d.ts +1 -1
  87. package/lib/Tag/index.js +1 -1
  88. package/lib/TextCollapse/index.js +1 -1
  89. package/lib/Theme/theme-provider.js +58 -53
  90. package/lib/Theme/theme.js +1 -0
  91. package/lib/Typography/index.js +13 -13
  92. package/lib/UserCard/Cards/basic-info.d.ts +1 -1
  93. package/lib/UserCard/Cards/basic-info.js +1 -1
  94. package/lib/UserCard/Cards/index.d.ts +1 -1
  95. package/lib/UserCard/Cards/index.js +1 -1
  96. package/lib/UserCard/Container/card.js +6 -6
  97. package/lib/UserCard/Container/dialog.js +1 -1
  98. package/lib/UserCard/Content/basic.js +2 -2
  99. package/lib/UserCard/Content/minimal.d.ts +1 -1
  100. package/lib/UserCard/Content/minimal.js +1 -1
  101. package/lib/UserCard/Content/tooltip-avatar.js +17 -17
  102. package/lib/VerificationCode/index.js +1 -1
  103. package/lib/WalletOSIcon/index.d.ts +2 -2
  104. package/lib/WalletOSIcon/index.js +7 -2
  105. package/lib/WebWalletSWKeeper/index.d.ts +3 -1
  106. package/lib/WebWalletSWKeeper/index.js +4 -1
  107. package/lib/withTheme/index.d.ts +3 -2
  108. package/lib/withTheme/index.js +16 -16
  109. package/package.json +7 -7
  110. package/src/ActionButton/index.jsx +1 -1
  111. package/src/Address/compact-text.jsx +1 -1
  112. package/src/Address/did-address.tsx +1 -1
  113. package/src/Address/index.tsx +1 -1
  114. package/src/Address/responsive-did-address.tsx +3 -3
  115. package/src/Alert/index.jsx +1 -1
  116. package/src/Avatar/index.jsx +1 -1
  117. package/src/Badge/index.jsx +1 -1
  118. package/src/BlockletContext/index.tsx +1 -1
  119. package/src/BlockletNFT/index.jsx +1 -1
  120. package/src/BlockletV2/blocklet.tsx +1 -1
  121. package/src/BlockletV2/components/icon-text.tsx +4 -4
  122. package/src/BlockletV2/components/tooltip-icon.tsx +5 -3
  123. package/src/Button/wrap.jsx +1 -1
  124. package/src/Center/index.tsx +1 -1
  125. package/src/ClickToCopy/copy-button.tsx +1 -1
  126. package/src/CloseButton/index.tsx +1 -1
  127. package/src/ContactForm/index.tsx +9 -2
  128. package/src/DID/index.tsx +5 -4
  129. package/src/DIDConnect/app-info-item.tsx +1 -1
  130. package/src/DIDConnect/auth-apps/index.tsx +8 -8
  131. package/src/DIDConnect/did-connect-container.tsx +2 -2
  132. package/src/DIDConnect/did-connect-footer.tsx +1 -1
  133. package/src/DIDConnect/landing-page.tsx +6 -6
  134. package/src/DIDConnect/request-storage-access-api-dialog.tsx +1 -2
  135. package/src/Datatable/CustomToolbar.jsx +1 -1
  136. package/src/Datatable/index.jsx +2 -2
  137. package/src/Dialog/confirm.jsx +1 -1
  138. package/src/Earth/index.tsx +1 -1
  139. package/src/Footer/index.tsx +5 -2
  140. package/src/Header/addon-button.tsx +7 -2
  141. package/src/Header/header.tsx +1 -1
  142. package/src/Header/responsive-header.tsx +1 -2
  143. package/src/Icon/index.tsx +1 -1
  144. package/src/InfoRow/index.tsx +1 -2
  145. package/src/Layout/dashboard/external-link.tsx +1 -1
  146. package/src/Layout/dashboard/full-page.tsx +1 -1
  147. package/src/Layout/dashboard/index.tsx +1 -1
  148. package/src/Layout/dashboard/sidebar.tsx +5 -2
  149. package/src/Layout/dashboard-legacy/header.tsx +5 -5
  150. package/src/Layout/dashboard-legacy/index.tsx +3 -3
  151. package/src/Layout/dashboard-legacy/sidebar.tsx +10 -2
  152. package/src/Layout/index.tsx +2 -2
  153. package/src/LoadingMask/index.tsx +5 -5
  154. package/src/Locale/context.tsx +3 -3
  155. package/src/Locale/selector.tsx +1 -1
  156. package/src/Logo/index.tsx +1 -1
  157. package/src/NFTDisplay/aspect-ratio-container.tsx +1 -1
  158. package/src/NFTDisplay/index.tsx +2 -1
  159. package/src/NFTDisplay/render-svg.tsx +1 -1
  160. package/src/NavMenu/nav-menu.tsx +8 -5
  161. package/src/NavMenu/products.tsx +3 -1
  162. package/src/PageScroller/index.tsx +4 -4
  163. package/src/PhoneInput/country-select.tsx +3 -3
  164. package/src/PhoneInput/index.tsx +1 -1
  165. package/src/PoweredByArcBlock/index.tsx +5 -1
  166. package/src/QRCode/index.tsx +1 -1
  167. package/src/RelativeTime/index.tsx +3 -3
  168. package/src/Result/result.tsx +1 -1
  169. package/src/Screenshot/index.tsx +2 -2
  170. package/src/SessionUser/components/did-space.tsx +1 -1
  171. package/src/SessionUser/components/session-user-item.tsx +1 -1
  172. package/src/SharedBridge/index.tsx +2 -2
  173. package/src/Spinner/index.tsx +1 -1
  174. package/src/SplitButton/index.tsx +1 -1
  175. package/src/Success/index.tsx +1 -1
  176. package/src/Tabs/index.tsx +10 -3
  177. package/src/Tag/index.jsx +1 -1
  178. package/src/TextCollapse/index.tsx +1 -1
  179. package/src/Theme/theme-provider.tsx +11 -6
  180. package/src/Theme/theme.ts +5 -0
  181. package/src/Typography/index.tsx +1 -1
  182. package/src/UserCard/Cards/basic-info.tsx +1 -1
  183. package/src/UserCard/Cards/index.tsx +1 -1
  184. package/src/UserCard/Container/card.tsx +2 -2
  185. package/src/UserCard/Container/dialog.tsx +1 -1
  186. package/src/UserCard/Content/basic.tsx +2 -2
  187. package/src/UserCard/Content/minimal.tsx +1 -1
  188. package/src/UserCard/Content/tooltip-avatar.tsx +4 -4
  189. package/src/VerificationCode/index.tsx +1 -1
  190. package/src/WalletOSIcon/index.tsx +7 -2
  191. package/src/WebWalletSWKeeper/index.tsx +6 -1
  192. package/src/withTheme/index.tsx +7 -3
  193. package/vite.config.mjs +4 -1
  194. package/lib/ActionButton/ActionButton.stories.d.ts +0 -18
  195. package/lib/ActivityIndicator/ActivityIndicator.stories.d.ts +0 -8
  196. package/lib/Address/Address.stories.d.ts +0 -16
  197. package/lib/Alert/Alert.stories.d.ts +0 -28
  198. package/lib/AnimationWaiter/AnimationWaiter.stories.d.ts +0 -21
  199. package/lib/Avatar/Avatar.stories.d.ts +0 -11
  200. package/lib/Badge/Badge.stories.d.ts +0 -13
  201. package/lib/Blocklet/Blocklet.stories.d.ts +0 -17
  202. package/lib/BlockletNFT/BlockletNFT.stories.d.ts +0 -17
  203. package/lib/BlockletV2/Blocklet.stories.d.ts +0 -18
  204. package/lib/Button/Button.stories.d.ts +0 -19
  205. package/lib/Center/Center.stories.d.ts +0 -18
  206. package/lib/ClickToCopy/ClickToCopy.stories.d.ts +0 -16
  207. package/lib/CodeBlock/CodeBlock.stories.d.ts +0 -20
  208. package/lib/Colors/Colors.stories.d.ts +0 -34
  209. package/lib/Config/Config.stories.d.ts +0 -14
  210. package/lib/ContactForm/ContactForm.stories.d.ts +0 -23
  211. package/lib/CookieConsent/CookieConsent.stories.d.ts +0 -18
  212. package/lib/CountDown/CountDown.stories.d.ts +0 -14
  213. package/lib/DID/DID.stories.d.ts +0 -15
  214. package/lib/Datatable/Datatable.stories.d.ts +0 -32
  215. package/lib/Dialog/Dialog.stories.d.ts +0 -20
  216. package/lib/DidLogo/Logo.stories.d.ts +0 -8
  217. package/lib/Earth/Earth.stories.d.ts +0 -18
  218. package/lib/Empty/Empty.stories.d.ts +0 -17
  219. package/lib/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -12
  220. package/lib/Footer/Footer.stories.d.ts +0 -12
  221. package/lib/Header/Header.stories.d.ts +0 -21
  222. package/lib/Icon/Icon.stories.d.ts +0 -23
  223. package/lib/Img/Img.stories.d.ts +0 -13
  224. package/lib/InfoRow/InfoRow.stories.d.ts +0 -14
  225. package/lib/Layout/Layout.stories.d.ts +0 -23
  226. package/lib/Locale/LocaleSelector.stories.d.ts +0 -22
  227. package/lib/Logo/Logo.stories.d.ts +0 -22
  228. package/lib/Metric/Metric.stories.d.ts +0 -14
  229. package/lib/NFTDisplay/NFTDisplay.stories.d.ts +0 -15
  230. package/lib/NavMenu/NavMenu.stories.d.ts +0 -17
  231. package/lib/PageScroller/story/PageScroller.stories.d.ts +0 -13
  232. package/lib/PhoneInput/PhoneInput.stories.d.ts +0 -12
  233. package/lib/PricingTable/PricingTable.stories.d.ts +0 -8
  234. package/lib/QRCode/QRCode.stories.d.ts +0 -13
  235. package/lib/RelativeTime/RelativeTime.stories.d.ts +0 -20
  236. package/lib/Result/Result.stories.d.ts +0 -21
  237. package/lib/Screenshot/Screenshot.stories.d.ts +0 -13
  238. package/lib/SessionManager/SessionManager.stories.d.ts +0 -9
  239. package/lib/Sparkline/Sparkline.stories.d.ts +0 -12
  240. package/lib/Spinner/Spinner.stories.d.ts +0 -18
  241. package/lib/SplitButton/SplitButton.stories.d.ts +0 -15
  242. package/lib/Switch/Switch.stories.d.ts +0 -13
  243. package/lib/Tabs/Tabs.stories.d.ts +0 -14
  244. package/lib/Tag/Tag.stories.d.ts +0 -13
  245. package/lib/TextCollapse/TextCollapse.stories.d.ts +0 -28
  246. package/lib/Theme/Theme.stories.d.ts +0 -10
  247. package/lib/Toast/Toast.stories.d.ts +0 -15
  248. package/lib/UserCard/UserCard.stories.d.ts +0 -18
  249. package/lib/Util/WebWalletOpener.stories.d.ts +0 -5
  250. package/lib/Video/Video.stories.d.ts +0 -6
  251. package/lib/Wallet/Action.stories.d.ts +0 -8
  252. package/lib/Wallet/Download.stories.d.ts +0 -9
  253. 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 A, useCreation as g } from "ahooks";
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 oe from "../Avatar/index.js";
13
- import { DID_PREFIX as re } from "../Util/constant.js";
14
- import { translate as te } from "../Locale/util.js";
15
- import { isEthereumDid as ne, getDIDColor as se } from "../Util/index.js";
16
- const ie = {
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
- }, T = "xenon-2020-01-15", W = {
28
- main: T,
29
- "main.abtnetwork.io": T,
28
+ }, A = "xenon-2020-01-15", W = {
29
+ main: A,
30
+ "main.abtnetwork.io": A,
30
31
  "beta.abtnetwork.io": "beta"
31
- }, ae = (e, r, o) => o ? se(e) : r.color, le = (e) => !{
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], de = (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
- }, ce = (e, r, o) => r || le(e.roleType) ? o * 0.75 : o;
44
+ }, pe = (e, r, o) => r || de(e.roleType) ? o * 0.75 : o;
44
45
  function F({ did: e, showAvatar: r }) {
45
- const o = ne(e), n = o ? void 0 : j(e), m = g(() => o ? e : `${re}${e}`, [e, o]), c = A((i, a) => [
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: ae(e, n, o) },
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
- oe,
60
+ re,
60
61
  {
61
62
  src: "",
62
63
  did: e,
63
- size: ce(n, o, i || 18),
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: m,
76
+ content: f,
76
77
  getPrepend: c
77
78
  };
78
79
  }
79
- function Re({
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: m,
87
+ roleType: f,
87
88
  showAvatar: c = !0,
88
89
  showQrcode: i = !1,
89
90
  locale: a = "en",
90
- size: v = 0,
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: f
103
+ sx: m
103
104
  } = r, s = ee(o), d = {
104
- size: v,
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: f
117
- }, C = K(null), { content: L, getPrepend: M } = F({ did: s, showAvatar: c }), [U, b] = V(!1), B = A(() => {
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 = A((y) => {
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
- pe,
166
+ ue,
166
167
  {
167
168
  did: s,
168
169
  chainId: n,
169
- roleType: m,
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 pe({
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: m,
185
+ open: f,
185
186
  fullScreen: c = !1,
186
187
  fullWidth: i = !1,
187
188
  scroll: a = "paper",
188
- onClose: v,
189
+ onClose: T = oe,
189
190
  // AddressProps
190
191
  locale: l = "en",
191
192
  ...R
192
193
  }) {
193
- const h = A((f, s = {}) => te(ie, f, 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
+ 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 f;
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 = (f = window.blocklet) == null ? void 0 : f.CHAIN_HOST, d = new URL(s).hostname;
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] || T;
222
+ return W[d] || A;
222
223
  } catch (s) {
223
224
  console.warn("Failed to parse chainHost:", s);
224
225
  }
225
- return T;
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: m,
231
- onClose: v,
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: de(o || (D == null ? void 0 : D.roleType)) }) }),
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
- Re as DID,
284
- pe as DIDDialog,
285
- Re as default
284
+ _e as DID,
285
+ ue as DIDDialog,
286
+ _e as default
286
287
  };
@@ -12,7 +12,7 @@ function b({
12
12
  appInfo: r,
13
13
  active: l = !1,
14
14
  appLogo: s = null,
15
- sx: a
15
+ sx: a = {}
16
16
  }) {
17
17
  const t = x(null), o = h(t), n = u(() => o ? o.width < C - 50 : !0, [o, o == null ? void 0 : o.width]);
18
18
  return /* @__PURE__ */ p(
@@ -1,7 +1,7 @@
1
- import { jsx as n, jsxs as r, Fragment as G } from "react/jsx-runtime";
2
- import { CircularProgress as x, Box as l, Stack as H, Button as p, Typography as J, Link as K } from "@mui/material";
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 o from "lodash/noop";
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 z } from "../../Util/style.js";
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: k,
33
- currentAppInfo: v,
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 = o,
46
- onAuthorize: h = o,
47
- onSwitchConnect: m = o,
48
- onCancel: f = o
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, b;
51
- const i = O({
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
- i.loading = !1;
54
+ n.loading = !1;
55
55
  }), M = t(() => {
56
- i.loading = !0, u == null || u(g);
56
+ n.loading = !0, u == null || u(g);
57
57
  }), R = t(() => {
58
- i.loading = !0, m == null || m(g);
58
+ n.loading = !0, m == null || m(g);
59
59
  }), U = t(() => {
60
- i.loading = !0, h == null || h(g);
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__ */ n(V, { children: /* @__PURE__ */ n(x, {}) });
66
- const c = s ?? (a == null ? void 0 : a.user);
67
- return /* @__PURE__ */ n(X, { did: (C = window.blocklet) == null ? void 0 : C.appPid, standalone: !0, children: /* @__PURE__ */ n(
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: z(
71
+ sx: b(
72
72
  {
73
73
  width: 420,
74
74
  maxWidth: "100%"
75
75
  },
76
- (y = e == null ? void 0 : e.root) == null ? void 0 : y.sx
76
+ (C = e == null ? void 0 : e.root) == null ? void 0 : C.sx
77
77
  ),
78
- children: /* @__PURE__ */ n(Q, { hideCloseButton: !0, ...e == null ? void 0 : e.didConnectContainer, children: /* @__PURE__ */ r(
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: z(
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
- (b = e == null ? void 0 : e.contentContainer) == null ? void 0 : b.sx
98
+ (y = e == null ? void 0 : e.contentContainer) == null ? void 0 : y.sx
99
99
  ),
100
100
  children: [
101
- /* @__PURE__ */ n(S, { requestAppInfo: k, currentAppInfo: v }),
102
- c ? /* @__PURE__ */ r(G, { children: [
103
- /* @__PURE__ */ n(_, { user: c, showDid: !0, cardType: P.Detailed, infoType: $.Minimal }),
104
- /* @__PURE__ */ n(l, {})
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__ */ n(
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__ */ n(
121
- p,
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
- c && !D ? /* @__PURE__ */ r(
135
- p,
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: i.loading,
141
+ disabled: n.loading,
142
142
  children: [
143
- i.loading ? /* @__PURE__ */ n(x, { size: 20, sx: { mr: 1 } }) : null,
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
- p,
148
+ v,
149
149
  {
150
150
  variant: "contained",
151
151
  size: "large",
152
152
  fullWidth: !0,
153
- disabled: i.loading,
153
+ disabled: n.loading,
154
154
  onClick: M,
155
155
  children: [
156
- i.loading ? /* @__PURE__ */ n(x, { size: 20, sx: { mr: 1 } }) : null,
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 || !c ? null : /* @__PURE__ */ n(l, { sx: { textAlign: "center" }, children: /* @__PURE__ */ r(
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__ */ n(
175
+ /* @__PURE__ */ i(
176
176
  K,
177
177
  {
178
178
  underline: "hover",
@@ -1,8 +1,8 @@
1
- import { jsx as i, jsxs as m } from "react/jsx-runtime";
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 te, useDebounce as ie } from "ahooks";
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 = te(() => {
40
- const o = E || window.blocklet.appPid, r = ue(o), t = r ? void 0 : ce(o);
41
- return r ? se(o) : t.color;
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 = ie(a, {
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
- }, R = W || a || k, F = w ? oe : re, H = de.hex.hsl(n), [$, v, d] = H, x = [0, 30, 60, 30, 0, 30, 60, 30], K = Math.max(...x), Q = Math.min(...x);
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, t = 0.6;
54
- return p ? t = 0.5 * (100 + o) / 100 : r = d * (100 + o) / 100, `hsla(${$}, ${v}%, ${r}%, ${t})`;
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, t = 0.2;
57
- return p ? t = 0.3 * (100 + o) / 100 : r = d * (100 + o) / 100, `hsla(${$}, ${v}%, ${r}%, ${t})`;
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__ */ i(
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__ */ i(h, { currentAppColor: n, sx: c({ mx: 0 }, (_ = e == null ? void 0 : e.footer) == null ? void 0 : _.sx) })
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__ */ i(
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__ */ i(
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
- R ? g : null,
203
- /* @__PURE__ */ i(h, { currentAppColor: n, sx: c({ mx: 0 }, (I = e == null ? void 0 : e.footer) == null ? void 0 : I.sx) })
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__ */ i(
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
- R ? g : null,
247
- /* @__PURE__ */ i(h, { currentAppColor: n, sx: c({ mx: 0 }, (M = e == null ? void 0 : e.footer) == null ? void 0 : M.sx) })
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 y from "../Avatar/index.js";
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: r,
19
- logoSize: m = 50,
20
- poweredBy: c,
21
- termsOfUse: u,
22
- standalone: v = !1
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 i = (globalThis == null ? void 0 : globalThis.blocklet) || (globalThis == null ? void 0 : globalThis.env) || {}, { palette: g } = C(), d = j((o) => o.breakpoints.down("lg")), I = L({
25
- meta: i
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 o = i.appPid, b = B(o), w = b ? void 0 : P(o);
28
- return b ? M(o) : w.color;
29
- }, [i == null ? void 0 : i.appPid]);
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 = i.appName), s === void 0 && (s = i.appDescription), r === void 0 && (r = I || ""), typeof r == "string" && (r ? r = /* @__PURE__ */ t(
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: m,
37
- maxHeight: m,
36
+ height: d,
37
+ maxHeight: d,
38
38
  objectFit: "contain"
39
39
  },
40
40
  component: "img",
41
- src: r,
42
- alt: `${i.appName}'s logo`
41
+ src: i,
42
+ alt: `${o.appName}'s logo`
43
43
  }
44
- ) : r = /* @__PURE__ */ t(y, { size: m, did: a, src: r, variant: "rounded" })), c === void 0 && (c = /* @__PURE__ */ t(
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: !d,
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 && !d && (p = /* @__PURE__ */ t(
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(y, { size: 210, did: a, variant: "rounded" })
71
+ children: /* @__PURE__ */ t(b, { size: 210, did: a, variant: "rounded" })
72
72
  }
73
73
  ));
74
74
  const k = !!n;
75
- let f = !v;
76
- return d && (f = !k), /* @__PURE__ */ x(
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: r }),
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: c
170
+ children: m
171
171
  }
172
172
  )
173
173
  ]