@arcblock/ux 3.0.5 → 3.0.7

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 (370) hide show
  1. package/lib/ActionButton/index.d.ts +1 -1
  2. package/lib/ActionButton/index.js +9 -9
  3. package/lib/ActivityIndicator/index.js +6 -7
  4. package/lib/Address/compact-text.d.ts +1 -1
  5. package/lib/Address/compact-text.js +6 -7
  6. package/lib/Address/did-address.js +4 -4
  7. package/lib/Address/index.js +6 -6
  8. package/lib/Address/responsive-did-address.js +17 -17
  9. package/lib/Alert/index.d.ts +1 -1
  10. package/lib/Alert/index.js +8 -8
  11. package/lib/AnimationWaiter/index.js +10 -10
  12. package/lib/Async/index.js +4 -4
  13. package/lib/Avatar/etherscan-blockies.js +15 -15
  14. package/lib/Avatar/index.d.ts +1 -1
  15. package/lib/Avatar/index.js +6 -6
  16. package/lib/Badge/index.js +5 -5
  17. package/lib/Blocklet/blocklet.js +10 -10
  18. package/lib/Blocklet/index.js +6 -5
  19. package/lib/Blocklet/utils.js +1 -1
  20. package/lib/BlockletContext/index.d.ts +1 -1
  21. package/lib/BlockletContext/index.js +1 -1
  22. package/lib/BlockletNFT/index.js +19 -19
  23. package/lib/BlockletV2/blocklet.d.ts +1 -1
  24. package/lib/BlockletV2/blocklet.js +36 -37
  25. package/lib/BlockletV2/components/icon-text.d.ts +1 -1
  26. package/lib/BlockletV2/components/icon-text.js +13 -13
  27. package/lib/BlockletV2/components/tooltip-icon.js +22 -20
  28. package/lib/BlockletV2/index.js +8 -7
  29. package/lib/BlockletV2/utils.js +1 -1
  30. package/lib/Button/index.js +1 -1
  31. package/lib/Button/wrap.js +3 -3
  32. package/lib/ButtonGroup/index.js +1 -1
  33. package/lib/Center/index.js +4 -4
  34. package/lib/ClickToCopy/copy-button.js +3 -3
  35. package/lib/ClickToCopy/index.js +5 -5
  36. package/lib/CloseButton/index.js +2 -2
  37. package/lib/CodeBlock/index.js +3 -3
  38. package/lib/Colors/index.js +3 -3
  39. package/lib/Config/config-provider.js +15 -16
  40. package/lib/Config/index.js +3 -5
  41. package/lib/Config/theme-mode-toggle.js +1 -1
  42. package/lib/ContactForm/index.js +26 -25
  43. package/lib/CookieConsent/index.js +1 -1
  44. package/lib/CountDown/index.js +2 -2
  45. package/lib/DID/index.js +79 -78
  46. package/lib/DIDConnect/app-icon.js +10 -10
  47. package/lib/DIDConnect/app-info-item.js +5 -5
  48. package/lib/DIDConnect/auth-apps/auth-apps-info.js +1 -1
  49. package/lib/DIDConnect/auth-apps/index.js +56 -56
  50. package/lib/DIDConnect/did-connect-container.js +35 -36
  51. package/lib/DIDConnect/did-connect-footer.js +7 -7
  52. package/lib/DIDConnect/index.js +10 -10
  53. package/lib/DIDConnect/landing-page.js +45 -46
  54. package/lib/DIDConnect/powered-by.js +2 -2
  55. package/lib/DIDConnect/request-storage-access-api-dialog.js +44 -45
  56. package/lib/DIDConnect/with-container.js +25 -26
  57. package/lib/DIDConnect/with-ux-theme.js +6 -7
  58. package/lib/Datatable/CustomToolbar.d.ts +3 -1
  59. package/lib/Datatable/CustomToolbar.js +13 -13
  60. package/lib/Datatable/TableSearch.js +2 -2
  61. package/lib/Datatable/index.js +6 -6
  62. package/lib/Dialog/confirm.d.ts +1 -1
  63. package/lib/Dialog/confirm.js +20 -20
  64. package/lib/Dialog/dialog.js +7 -7
  65. package/lib/Dialog/index.js +3 -3
  66. package/lib/Dialog/types.d.ts +20 -0
  67. package/lib/Dialog/use-confirm.js +1 -1
  68. package/lib/DriftBot/index.js +1 -1
  69. package/lib/Earth/index.js +10 -10
  70. package/lib/Empty/index.js +1 -1
  71. package/lib/ErrorBoundary/fallback.js +15 -15
  72. package/lib/ErrorBoundary/index.js +1 -6
  73. package/lib/Footer/index.d.ts +1 -1
  74. package/lib/Footer/index.js +7 -7
  75. package/lib/Header/addon-button.d.ts +1 -1
  76. package/lib/Header/addon-button.js +11 -6
  77. package/lib/Header/auto-hidden.js +1 -1
  78. package/lib/Header/header.js +4 -4
  79. package/lib/Header/index.js +3 -3
  80. package/lib/Header/responsive-header.d.ts +1 -1
  81. package/lib/Header/responsive-header.js +33 -34
  82. package/lib/Icon/image.js +2 -2
  83. package/lib/Icon/index.js +12 -12
  84. package/lib/Img/index.js +1 -1
  85. package/lib/InfoRow/index.d.ts +1 -1
  86. package/lib/InfoRow/index.js +1 -2
  87. package/lib/Layout/dashboard/external-link.d.ts +1 -1
  88. package/lib/Layout/dashboard/external-link.js +1 -1
  89. package/lib/Layout/dashboard/full-page.js +8 -8
  90. package/lib/Layout/dashboard/index.js +30 -32
  91. package/lib/Layout/dashboard/sidebar.js +3 -3
  92. package/lib/Layout/dashboard-legacy/header.js +12 -12
  93. package/lib/Layout/dashboard-legacy/index.js +20 -20
  94. package/lib/Layout/dashboard-legacy/sidebar.d.ts +1 -1
  95. package/lib/Layout/dashboard-legacy/sidebar.js +20 -13
  96. package/lib/Layout/index.js +7 -7
  97. package/lib/LoadingMask/index.d.ts +1 -1
  98. package/lib/LoadingMask/index.js +4 -4
  99. package/lib/Locale/context.js +27 -27
  100. package/lib/Locale/selector.d.ts +1 -1
  101. package/lib/Locale/selector.js +4 -4
  102. package/lib/Logo/index.js +19 -19
  103. package/lib/Metric/index.js +2 -2
  104. package/lib/NFTDisplay/aspect-ratio-container.d.ts +1 -1
  105. package/lib/NFTDisplay/aspect-ratio-container.js +1 -1
  106. package/lib/NFTDisplay/broken.js +2 -2
  107. package/lib/NFTDisplay/index.js +38 -35
  108. package/lib/NFTDisplay/loading.js +1 -1
  109. package/lib/NFTDisplay/render-svg.js +4 -4
  110. package/lib/NFTDisplay/svg-embedder/img.js +3 -3
  111. package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -1
  112. package/lib/NavMenu/index.js +2 -2
  113. package/lib/NavMenu/nav-menu.js +46 -44
  114. package/lib/NavMenu/products.js +33 -33
  115. package/lib/NavMenu/style.js +1 -1
  116. package/lib/NavMenu/sub-item-group.js +1 -1
  117. package/lib/PageScroller/index.js +53 -53
  118. package/lib/PageScroller/story/FullPage.js +27 -27
  119. package/lib/PageScroller/story/PageContain.js +8 -8
  120. package/lib/Passport/index.js +3 -2
  121. package/lib/Passport/passport.js +2 -2
  122. package/lib/PhoneInput/country-select.js +24 -24
  123. package/lib/PhoneInput/index.js +13 -13
  124. package/lib/PoweredByArcBlock/index.js +10 -6
  125. package/lib/PricingTable/PricingPlan.js +1 -1
  126. package/lib/PricingTable/index.js +3 -3
  127. package/lib/QRCode/index.js +5 -5
  128. package/lib/RelativeTime/index.js +17 -17
  129. package/lib/Result/common.js +4 -6
  130. package/lib/Result/index.js +2 -2
  131. package/lib/Result/result.js +5 -5
  132. package/lib/Screenshot/BaseScreenshot/index.js +3 -3
  133. package/lib/Screenshot/index.d.ts +1 -1
  134. package/lib/Screenshot/index.js +10 -10
  135. package/lib/SessionBlocklet/index.js +8 -8
  136. package/lib/SessionManager/index.js +3 -2
  137. package/lib/SessionUser/components/did-space.d.ts +1 -1
  138. package/lib/SessionUser/components/did-space.js +14 -14
  139. package/lib/SessionUser/components/logged-in.js +33 -33
  140. package/lib/SessionUser/components/quick-login-item.js +29 -29
  141. package/lib/SessionUser/components/session-user-item.js +27 -27
  142. package/lib/SessionUser/components/session-user-switch.js +4 -4
  143. package/lib/SessionUser/components/un-login.js +7 -7
  144. package/lib/SessionUser/components/user-info.js +16 -16
  145. package/lib/SessionUser/index.js +2 -2
  146. package/lib/SharedBridge/index.js +23 -23
  147. package/lib/Spinner/index.js +2 -2
  148. package/lib/SplitButton/index.d.ts +1 -1
  149. package/lib/SplitButton/index.js +2 -2
  150. package/lib/Success/index.js +1 -1
  151. package/lib/Switch/index.js +1 -1
  152. package/lib/Tabs/index.js +16 -9
  153. package/lib/Tag/index.d.ts +1 -1
  154. package/lib/Tag/index.js +7 -7
  155. package/lib/TextCollapse/index.js +3 -3
  156. package/lib/Theme/index.js +11 -22
  157. package/lib/Theme/theme-provider.js +60 -55
  158. package/lib/Theme/theme.js +5 -4
  159. package/lib/Toast/index.js +11 -11
  160. package/lib/Typography/index.js +13 -13
  161. package/lib/UserCard/Cards/avatar-only.js +2 -2
  162. package/lib/UserCard/Cards/basic-info.d.ts +1 -1
  163. package/lib/UserCard/Cards/basic-info.js +4 -4
  164. package/lib/UserCard/Cards/index.d.ts +1 -1
  165. package/lib/UserCard/Cards/index.js +4 -4
  166. package/lib/UserCard/Cards/name-only.js +1 -1
  167. package/lib/UserCard/Container/card.js +8 -8
  168. package/lib/UserCard/Container/dialog.js +2 -2
  169. package/lib/UserCard/Content/basic.js +3 -3
  170. package/lib/UserCard/Content/clock.js +3 -3
  171. package/lib/UserCard/Content/minimal.d.ts +1 -1
  172. package/lib/UserCard/Content/minimal.js +8 -8
  173. package/lib/UserCard/Content/tooltip-avatar.js +18 -18
  174. package/lib/UserCard/components.js +23 -23
  175. package/lib/UserCard/index.js +12 -12
  176. package/lib/Util/index.js +2 -2
  177. package/lib/VerificationCode/index.js +2 -2
  178. package/lib/Video/index.js +2 -2
  179. package/lib/Wallet/Action.js +4 -4
  180. package/lib/Wallet/Download.js +6 -6
  181. package/lib/Wallet/Open.js +1 -1
  182. package/lib/WalletOSIcon/index.d.ts +2 -2
  183. package/lib/WalletOSIcon/index.js +8 -3
  184. package/lib/WebWalletSWKeeper/index.d.ts +3 -1
  185. package/lib/WebWalletSWKeeper/index.js +6 -3
  186. package/lib/WechatPrompt/index.js +1 -1
  187. package/lib/global.d.ts +28 -0
  188. package/lib/hooks/use-blocklet-logo.js +13 -15
  189. package/lib/hooks/use-clock.js +1 -1
  190. package/lib/index.js +74 -79
  191. package/lib/type.d.ts +44 -0
  192. package/lib/withTheme/index.d.ts +3 -2
  193. package/lib/withTheme/index.js +13 -14
  194. package/lib/withTracker/error_boundary.js +1 -1
  195. package/package.json +7 -7
  196. package/src/ActionButton/index.jsx +1 -1
  197. package/src/Address/compact-text.jsx +1 -1
  198. package/src/Address/did-address.tsx +1 -1
  199. package/src/Address/index.tsx +1 -1
  200. package/src/Address/responsive-did-address.tsx +3 -3
  201. package/src/Alert/index.jsx +1 -1
  202. package/src/Avatar/index.jsx +1 -1
  203. package/src/Badge/index.jsx +1 -1
  204. package/src/BlockletContext/index.tsx +1 -1
  205. package/src/BlockletNFT/index.jsx +1 -1
  206. package/src/BlockletV2/blocklet.tsx +1 -1
  207. package/src/BlockletV2/components/icon-text.tsx +4 -4
  208. package/src/BlockletV2/components/tooltip-icon.tsx +5 -3
  209. package/src/Button/wrap.jsx +1 -1
  210. package/src/Center/index.tsx +1 -1
  211. package/src/ClickToCopy/copy-button.tsx +1 -1
  212. package/src/CloseButton/index.tsx +1 -1
  213. package/src/ContactForm/index.tsx +9 -2
  214. package/src/DID/index.tsx +5 -4
  215. package/src/DIDConnect/app-info-item.tsx +1 -1
  216. package/src/DIDConnect/auth-apps/index.tsx +8 -8
  217. package/src/DIDConnect/did-connect-container.tsx +2 -2
  218. package/src/DIDConnect/did-connect-footer.tsx +1 -1
  219. package/src/DIDConnect/landing-page.tsx +6 -6
  220. package/src/DIDConnect/request-storage-access-api-dialog.tsx +1 -2
  221. package/src/Datatable/CustomToolbar.jsx +1 -1
  222. package/src/Datatable/index.jsx +2 -2
  223. package/src/Dialog/confirm.jsx +1 -1
  224. package/src/Earth/index.tsx +1 -1
  225. package/src/Footer/index.tsx +5 -2
  226. package/src/Header/addon-button.tsx +7 -2
  227. package/src/Header/header.tsx +1 -1
  228. package/src/Header/responsive-header.tsx +1 -2
  229. package/src/Icon/index.tsx +1 -1
  230. package/src/InfoRow/index.tsx +1 -2
  231. package/src/Layout/dashboard/external-link.tsx +1 -1
  232. package/src/Layout/dashboard/full-page.tsx +1 -1
  233. package/src/Layout/dashboard/index.tsx +1 -1
  234. package/src/Layout/dashboard/sidebar.tsx +5 -2
  235. package/src/Layout/dashboard-legacy/header.tsx +5 -5
  236. package/src/Layout/dashboard-legacy/index.tsx +3 -3
  237. package/src/Layout/dashboard-legacy/sidebar.tsx +10 -2
  238. package/src/Layout/index.tsx +2 -2
  239. package/src/LoadingMask/index.tsx +5 -5
  240. package/src/Locale/context.tsx +3 -3
  241. package/src/Locale/selector.tsx +1 -1
  242. package/src/Logo/index.tsx +1 -1
  243. package/src/NFTDisplay/aspect-ratio-container.tsx +1 -1
  244. package/src/NFTDisplay/index.tsx +2 -1
  245. package/src/NFTDisplay/render-svg.tsx +1 -1
  246. package/src/NavMenu/nav-menu.tsx +8 -5
  247. package/src/NavMenu/products.tsx +3 -1
  248. package/src/PageScroller/index.tsx +4 -4
  249. package/src/PhoneInput/country-select.tsx +3 -3
  250. package/src/PhoneInput/index.tsx +1 -1
  251. package/src/PoweredByArcBlock/index.tsx +5 -1
  252. package/src/QRCode/index.tsx +1 -1
  253. package/src/RelativeTime/index.tsx +3 -3
  254. package/src/Result/result.tsx +1 -1
  255. package/src/Screenshot/index.tsx +2 -2
  256. package/src/SessionUser/components/did-space.tsx +1 -1
  257. package/src/SessionUser/components/session-user-item.tsx +1 -1
  258. package/src/SharedBridge/index.tsx +2 -2
  259. package/src/Spinner/index.tsx +1 -1
  260. package/src/SplitButton/index.tsx +1 -1
  261. package/src/Success/index.tsx +1 -1
  262. package/src/Tabs/index.tsx +10 -3
  263. package/src/Tag/index.jsx +1 -1
  264. package/src/TextCollapse/index.tsx +1 -1
  265. package/src/Theme/theme-provider.tsx +11 -6
  266. package/src/Theme/theme.ts +5 -0
  267. package/src/Typography/index.tsx +1 -1
  268. package/src/UserCard/Cards/basic-info.tsx +1 -1
  269. package/src/UserCard/Cards/index.tsx +1 -1
  270. package/src/UserCard/Container/card.tsx +2 -2
  271. package/src/UserCard/Container/dialog.tsx +1 -1
  272. package/src/UserCard/Content/basic.tsx +2 -2
  273. package/src/UserCard/Content/minimal.tsx +1 -1
  274. package/src/UserCard/Content/tooltip-avatar.tsx +4 -4
  275. package/src/VerificationCode/index.tsx +1 -1
  276. package/src/WalletOSIcon/index.tsx +7 -2
  277. package/src/WebWalletSWKeeper/index.tsx +6 -1
  278. package/src/withTheme/index.tsx +7 -3
  279. package/vite.config.mjs +5 -2
  280. package/lib/ActionButton/ActionButton.stories.d.ts +0 -18
  281. package/lib/ActivityIndicator/ActivityIndicator.stories.d.ts +0 -8
  282. package/lib/Address/Address.stories.d.ts +0 -16
  283. package/lib/Alert/Alert.stories.d.ts +0 -28
  284. package/lib/AnimationWaiter/AnimationWaiter.stories.d.ts +0 -21
  285. package/lib/AnimationWaiter/dark-animation.json.js +0 -27
  286. package/lib/AnimationWaiter/default-animation.json.js +0 -29
  287. package/lib/Avatar/Avatar.stories.d.ts +0 -11
  288. package/lib/Badge/Badge.stories.d.ts +0 -13
  289. package/lib/Blocklet/Blocklet.stories.d.ts +0 -17
  290. package/lib/BlockletNFT/BlockletNFT.stories.d.ts +0 -17
  291. package/lib/BlockletV2/Blocklet.stories.d.ts +0 -18
  292. package/lib/Button/Button.stories.d.ts +0 -19
  293. package/lib/Center/Center.stories.d.ts +0 -18
  294. package/lib/ClickToCopy/ClickToCopy.stories.d.ts +0 -16
  295. package/lib/CodeBlock/CodeBlock.stories.d.ts +0 -20
  296. package/lib/Colors/Colors.stories.d.ts +0 -34
  297. package/lib/Config/Config.stories.d.ts +0 -14
  298. package/lib/ContactForm/ContactForm.stories.d.ts +0 -23
  299. package/lib/CookieConsent/CookieConsent.stories.d.ts +0 -18
  300. package/lib/CountDown/CountDown.stories.d.ts +0 -14
  301. package/lib/DID/DID.stories.d.ts +0 -15
  302. package/lib/Datatable/Datatable.stories.d.ts +0 -32
  303. package/lib/Dialog/Dialog.stories.d.ts +0 -20
  304. package/lib/DidLogo/Logo.stories.d.ts +0 -8
  305. package/lib/Earth/Earth.stories.d.ts +0 -18
  306. package/lib/Earth/countries.json.js +0 -13
  307. package/lib/Empty/Empty.stories.d.ts +0 -17
  308. package/lib/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -12
  309. package/lib/Footer/Footer.stories.d.ts +0 -12
  310. package/lib/Header/Header.stories.d.ts +0 -21
  311. package/lib/Icon/Icon.stories.d.ts +0 -23
  312. package/lib/Img/Img.stories.d.ts +0 -13
  313. package/lib/InfoRow/InfoRow.stories.d.ts +0 -14
  314. package/lib/Layout/Layout.stories.d.ts +0 -23
  315. package/lib/Locale/LocaleSelector.stories.d.ts +0 -22
  316. package/lib/Logo/Logo.stories.d.ts +0 -22
  317. package/lib/Logo/images/logo-dark-text.svg.js +0 -5
  318. package/lib/Logo/images/logo-dark-top.svg.js +0 -5
  319. package/lib/Logo/images/logo-light-text.svg.js +0 -5
  320. package/lib/Logo/images/logo-light-top.svg.js +0 -5
  321. package/lib/Metric/Metric.stories.d.ts +0 -14
  322. package/lib/NFTDisplay/NFTBroken.svg.js +0 -108
  323. package/lib/NFTDisplay/NFTDisplay.stories.d.ts +0 -15
  324. package/lib/NavMenu/NavMenu.stories.d.ts +0 -17
  325. package/lib/NavMenu/images/OCAP.svg.js +0 -5
  326. package/lib/NavMenu/images/abt-network.svg.js +0 -7
  327. package/lib/NavMenu/images/ai-kit.svg.js +0 -7
  328. package/lib/NavMenu/images/aigne.svg.js +0 -7
  329. package/lib/NavMenu/images/aistro.svg.js +0 -5
  330. package/lib/NavMenu/images/arcsphere.svg.js +0 -10
  331. package/lib/NavMenu/images/blocklet-framework.svg.js +0 -7
  332. package/lib/NavMenu/images/blocklet-launcher.svg.js +0 -5
  333. package/lib/NavMenu/images/blocklet-server.svg.js +0 -7
  334. package/lib/NavMenu/images/blocklet-store.svg.js +0 -5
  335. package/lib/NavMenu/images/creator-studio.svg.js +0 -7
  336. package/lib/NavMenu/images/did-connect.svg.js +0 -5
  337. package/lib/NavMenu/images/did-name-service.svg.js +0 -5
  338. package/lib/NavMenu/images/did-wallet.svg.js +0 -7
  339. package/lib/NavMenu/images/did.svg.js +0 -5
  340. package/lib/NavMenu/images/nft-studio.svg.js +0 -5
  341. package/lib/NavMenu/images/vc.svg.js +0 -5
  342. package/lib/NavMenu/images/web3-kit.svg.js +0 -7
  343. package/lib/PageScroller/story/PageScroller.stories.d.ts +0 -13
  344. package/lib/PhoneInput/PhoneInput.stories.d.ts +0 -12
  345. package/lib/PricingTable/PricingTable.stories.d.ts +0 -8
  346. package/lib/QRCode/QRCode.stories.d.ts +0 -13
  347. package/lib/RelativeTime/RelativeTime.stories.d.ts +0 -20
  348. package/lib/Result/Result.stories.d.ts +0 -21
  349. package/lib/Screenshot/Screenshot.stories.d.ts +0 -13
  350. package/lib/SessionManager/SessionManager.stories.d.ts +0 -9
  351. package/lib/SessionUser/images/did-spaces.svg.js +0 -5
  352. package/lib/Sparkline/Sparkline.stories.d.ts +0 -12
  353. package/lib/Spinner/Spinner.stories.d.ts +0 -18
  354. package/lib/SplitButton/SplitButton.stories.d.ts +0 -15
  355. package/lib/Switch/Switch.stories.d.ts +0 -13
  356. package/lib/Tabs/Tabs.stories.d.ts +0 -14
  357. package/lib/Tag/Tag.stories.d.ts +0 -13
  358. package/lib/TextCollapse/TextCollapse.stories.d.ts +0 -28
  359. package/lib/Theme/Theme.stories.d.ts +0 -10
  360. package/lib/Toast/Toast.stories.d.ts +0 -15
  361. package/lib/UserCard/UserCard.stories.d.ts +0 -18
  362. package/lib/Util/WebWalletOpener.stories.d.ts +0 -5
  363. package/lib/Video/Video.stories.d.ts +0 -6
  364. package/lib/Wallet/Action.stories.d.ts +0 -8
  365. package/lib/Wallet/Download.stories.d.ts +0 -9
  366. package/lib/Wallet/OpenInWallet.stories.d.ts +0 -5
  367. package/lib/Wallet/images/android_download.svg.js +0 -5
  368. package/lib/Wallet/images/app-store.svg.js +0 -5
  369. package/lib/Wallet/images/google-play.svg.js +0 -5
  370. package/lib/ux.css +0 -1
@@ -1,25 +1,25 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { Box as o, Avatar as f } from "@mui/material";
3
- import p from "../Avatar/index.js";
4
- import { createNameOnlyAvatar as u } from "./utils.js";
5
- const _ = (r, t = 48, n = void 0, e = void 0, s = !1) => {
6
- const c = (i) => {
7
- e == null || e(r, i);
2
+ import { Avatar as f, Box as l } from "@mui/material";
3
+ import p from "../Avatar";
4
+ import { createNameOnlyAvatar as x } from "./utils";
5
+ const _ = (t, r = 48, s = void 0, e = void 0, c = !1) => {
6
+ const n = (i) => {
7
+ e == null || e(t, i);
8
8
  };
9
- if (!r.avatar) {
10
- const i = u(r), { className: d, style: l, alt: m } = n || {};
9
+ if (!t.avatar) {
10
+ const i = x(t), { className: d, style: o, alt: m } = s || {};
11
11
  return /* @__PURE__ */ a(
12
12
  f,
13
13
  {
14
- onClick: c,
14
+ onClick: n,
15
15
  className: d,
16
- style: l,
16
+ style: o,
17
17
  alt: m,
18
18
  sx: {
19
- width: t,
20
- height: t,
21
- fontSize: t * 0.4,
22
- cursor: s || e ? "pointer" : "default"
19
+ width: r,
20
+ height: r,
21
+ fontSize: r * 0.4,
22
+ cursor: c || e ? "pointer" : "default"
23
23
  },
24
24
  variant: "circular",
25
25
  children: i
@@ -27,7 +27,7 @@ const _ = (r, t = 48, n = void 0, e = void 0, s = !1) => {
27
27
  );
28
28
  }
29
29
  return /* @__PURE__ */ a(
30
- o,
30
+ l,
31
31
  {
32
32
  className: "user-card__avatar",
33
33
  sx: {
@@ -36,21 +36,21 @@ const _ = (r, t = 48, n = void 0, e = void 0, s = !1) => {
36
36
  children: /* @__PURE__ */ a(
37
37
  p,
38
38
  {
39
- size: t,
40
- did: r.did,
39
+ size: r,
40
+ did: t.did,
41
41
  variant: "circle",
42
42
  style: {
43
- cursor: s || e ? "pointer" : "default"
43
+ cursor: c || e ? "pointer" : "default"
44
44
  },
45
- onClick: c,
46
- src: r.avatar,
47
- alt: r.fullName || "",
48
- ...n || {}
45
+ onClick: n,
46
+ src: t.avatar,
47
+ alt: t.fullName || "",
48
+ ...s || {}
49
49
  }
50
50
  )
51
51
  }
52
52
  );
53
- }, g = (r, t = 120) => r ? /* @__PURE__ */ a(o, { sx: { maxWidth: t }, className: "user-card__top-right-content", children: r() }) : null;
53
+ }, g = (t, r = 120) => t ? /* @__PURE__ */ a(l, { sx: { maxWidth: r }, className: "user-card__top-right-content", children: t() }) : null;
54
54
  export {
55
55
  _ as renderAvatar,
56
56
  g as renderTopRight
@@ -1,12 +1,12 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useRef as c, useState as h, useEffect as C } from "react";
3
- import { CardType as i } from "./types.js";
4
- import v from "./Cards/avatar-only.js";
5
- import f from "./Cards/index.js";
6
- import y from "./Container/dialog.js";
7
- import A from "./Container/card.js";
8
- import D from "../Avatar/index.js";
9
- import { isUserDid as P, getUserByDid as S } from "./utils.js";
3
+ import { CardType as i } from "./types";
4
+ import v from "./Cards/avatar-only";
5
+ import u from "./Cards";
6
+ import y from "./Container/dialog";
7
+ import A from "./Container/card";
8
+ import D from "../Avatar";
9
+ import { isUserDid as P, getUserByDid as S } from "./utils";
10
10
  function L(e) {
11
11
  if (!e) return null;
12
12
  let r = "";
@@ -15,16 +15,16 @@ function L(e) {
15
15
  function g(e) {
16
16
  const { cardType: r = i.Detailed, showHoverCard: d } = e, n = d !== void 0 ? d : r === i.AvatarOnly, m = c(null), [a, o] = h(() => e.user || null);
17
17
  if (C(() => {
18
- let u = !0;
18
+ let f = !0;
19
19
  return e.user ? o(e.user) : e.did && P(e.did) && !e.user && S(e.did).then((s) => {
20
- u && o(s || { fullName: "Anonymous", did: e.did, avatar: "" });
20
+ f && o(s || { fullName: "Anonymous", did: e.did, avatar: "" });
21
21
  }), () => {
22
- u = !1;
22
+ f = !1;
23
23
  };
24
24
  }, [e.did, e.user]), !a)
25
25
  return /* @__PURE__ */ t(D, { did: e.did, size: e.avatarSize, ...e.avatarProps });
26
26
  const l = () => /* @__PURE__ */ t(y, { sx: e.popupSx, children: /* @__PURE__ */ t(
27
- f,
27
+ u,
28
28
  {
29
29
  ...e,
30
30
  shouldShowHoverCard: !1,
@@ -47,7 +47,7 @@ function g(e) {
47
47
  user: a
48
48
  }
49
49
  ) : /* @__PURE__ */ t(A, { containerRef: m, cardType: r, sx: e.sx, children: /* @__PURE__ */ t(
50
- f,
50
+ u,
51
51
  {
52
52
  ...e,
53
53
  shouldShowHoverCard: n,
package/lib/Util/index.js CHANGED
@@ -14,8 +14,8 @@ import O from "dayjs/plugin/timezone";
14
14
  import R from "dayjs/plugin/relativeTime";
15
15
  import W from "dayjs/plugin/updateLocale";
16
16
  import L from "dayjs/plugin/localizedFormat";
17
- import { DID_PREFIX as P, BLOCKLET_SERVICE_PATH_PREFIX as v } from "./constant.js";
18
- import { getFederatedEnabled as C } from "./federated.js";
17
+ import { DID_PREFIX as P, BLOCKLET_SERVICE_PATH_PREFIX as v } from "./constant";
18
+ import { getFederatedEnabled as C } from "./federated";
19
19
  let f = null;
20
20
  const V = /^(\d{1,3}\.){3}\d{1,3}(:\d+)?$/, _ = /* @__PURE__ */ new Set(["co", "com", "net", "org", "gov", "edu", "ac"]), M = /* @__PURE__ */ new Set(["uk", "au", "cn", "nz", "za", "in", "br", "mx", "fr", "it", "ca"]);
21
21
  function z(e) {
@@ -3,14 +3,14 @@ import { useEffect as c } from "react";
3
3
  import { Box as l, TextField as y } from "@mui/material";
4
4
  import n from "lodash/trim";
5
5
  import a from "lodash/noop";
6
- import { mergeSx as b } from "../Util/style.js";
6
+ import { mergeSx as b } from "../Util/style";
7
7
  const d = 6;
8
8
  function j({
9
9
  length: i = d,
10
10
  code: e,
11
11
  onChange: u = a,
12
12
  onComplete: p = a,
13
- sx: s
13
+ sx: s = {}
14
14
  }) {
15
15
  return c(() => {
16
16
  e.length === i && (p == null || p(e));
@@ -3,8 +3,8 @@ import { useState as u } from "react";
3
3
  import h from "react-player";
4
4
  import { CircularProgress as m } from "@mui/material";
5
5
  import l from "lodash/isUndefined";
6
- import { mergeProps as g } from "../Util/index.js";
7
- import { styled as b } from "../Theme/index.js";
6
+ import { mergeProps as g } from "../Util";
7
+ import { styled as b } from "../Theme";
8
8
  function x(p) {
9
9
  const e = Object.assign({}, p);
10
10
  l(e.width) && (e.width = 640), l(e.height) && (e.height = 400), l(e.style) && (e.style = {});
@@ -2,10 +2,10 @@ import { jsx as l, jsxs as o } from "react/jsx-runtime";
2
2
  import { Typography as g } from "@mui/material";
3
3
  import i from "lodash/isUndefined";
4
4
  import x from "./images/abtwallet.png";
5
- import { mergeProps as y } from "../Util/index.js";
6
- import c from "../Colors/themes/default.js";
7
- import _ from "../Button/index.js";
8
- import { styled as h } from "../Theme/index.js";
5
+ import { mergeProps as y } from "../Util";
6
+ import c from "../Colors";
7
+ import _ from "../Button";
8
+ import { styled as h } from "../Theme";
9
9
  function u(t) {
10
10
  const e = Object.assign({}, t);
11
11
  i(e.action) && (e.action = "Login"), i(e.textLayout) && (e.textLayout = "vertical"), i(e.size) && (e.size = "medium"), i(e.style) && (e.style = {});
@@ -2,12 +2,12 @@ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import g from "@arcblock/react-hooks/lib/useBrowser";
3
3
  import { Typography as f } from "@mui/material";
4
4
  import a from "lodash/isUndefined";
5
- import v from "./images/app-store.svg.js";
6
- import b from "./images/google-play.svg.js";
7
- import L from "./images/android_download.svg.js";
8
- import i from "../Button/index.js";
9
- import { mergeProps as k } from "../Util/index.js";
10
- import { styled as x } from "../Theme/index.js";
5
+ import v from "./images/app-store.svg";
6
+ import b from "./images/google-play.svg";
7
+ import L from "./images/android_download.svg";
8
+ import i from "../Button";
9
+ import { mergeProps as k } from "../Util";
10
+ import { styled as x } from "../Theme";
11
11
  function D(t) {
12
12
  const l = g(), o = Object.assign({}, t);
13
13
  a(o.title) && (o.title = "Download DID Wallet"), a(o.layout) && (o.layout = "vertical"), a(o.storeLayout) && (o.storeLayout = "horizontal"), a(o.locale) && (o.locale = "zh"), a(o.iosLink) && (o.iosLink = "https://itunes.apple.com/app/id1460083542"), a(o.androidLink) && (o.androidLink = "https://play.google.com/store/apps/details?id=com.arcblock.wallet.app.product"), a(o.androidDownLoadUrl) && (o.androidDownLoadUrl = "https://releases.arcblockio.cn/arcwallet_android/latest/abtwallet.apk"), a(o.style) && (o.style = {});
@@ -1,7 +1,7 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import a from "@arcblock/react-hooks/lib/useBrowser";
3
3
  import { Fab as i } from "@mui/material";
4
- import { styled as s } from "../Theme/index.js";
4
+ import { styled as s } from "../Theme";
5
5
  function c({ link: e, locale: n = "zh" }) {
6
6
  const o = n === "zh" ? "在 DID Wallet 打开" : "Open in DID Wallet", t = a();
7
7
  if (t.mobile.any && !(t.wallet || t.arcSphere) && !t.wechat) {
@@ -1,7 +1,7 @@
1
1
  export interface WalletOSIconProps {
2
2
  loading?: false | true;
3
- walletOS?: string;
3
+ walletOS: string;
4
4
  provider?: string;
5
5
  color?: string;
6
6
  }
7
- export default function WalletOSIcon({ loading, walletOS, provider, color }: WalletOSIconProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export default function WalletOSIcon({ loading, walletOS, provider, color, }: WalletOSIconProps): import("react/jsx-runtime").JSX.Element | null;
@@ -6,9 +6,14 @@ import s from "@iconify-icons/material-symbols/language";
6
6
  import a from "@iconify-icons/material-symbols/android";
7
7
  import c from "@iconify-icons/material-symbols/question-mark-rounded";
8
8
  import u from "@iconify-icons/material-symbols/mail-outline-rounded";
9
- import { LOGIN_PROVIDER as p } from "../Util/constant.js";
10
- function x({ loading: t = !1, walletOS: i, provider: e, color: n = "black" }) {
11
- return t ? /* @__PURE__ */ r(o, { icon: c, style: { color: "transparent" } }) : e === p.AUTH0 ? /* @__PURE__ */ r(o, { icon: u, style: { color: n, transform: "scale(0.85)" } }) : i === "ios" ? /* @__PURE__ */ r(o, { icon: f, style: { color: n, transform: "scale(1.1)" } }) : i === "android" ? /* @__PURE__ */ r(o, { icon: a, style: { color: n } }) : i === "web" ? /* @__PURE__ */ r(o, { icon: s, style: { color: n } }) : i === "api" ? /* @__PURE__ */ r(o, { icon: m, style: { color: n, transform: "scale(1.05)" } }) : null;
9
+ import { LOGIN_PROVIDER as p } from "../Util/constant";
10
+ function x({
11
+ loading: i = !1,
12
+ walletOS: t,
13
+ provider: e = "wallet",
14
+ color: n = "black"
15
+ }) {
16
+ return i ? /* @__PURE__ */ r(o, { icon: c, style: { color: "transparent" } }) : e === p.AUTH0 ? /* @__PURE__ */ r(o, { icon: u, style: { color: n, transform: "scale(0.85)" } }) : t === "ios" ? /* @__PURE__ */ r(o, { icon: f, style: { color: n, transform: "scale(1.1)" } }) : t === "android" ? /* @__PURE__ */ r(o, { icon: a, style: { color: n } }) : t === "web" ? /* @__PURE__ */ r(o, { icon: s, style: { color: n } }) : t === "api" ? /* @__PURE__ */ r(o, { icon: m, style: { color: n, transform: "scale(1.05)" } }) : null;
12
17
  }
13
18
  export {
14
19
  x as default
@@ -2,7 +2,9 @@ interface WebWalletSWKeeperProps {
2
2
  webWalletUrl: string;
3
3
  maxIdleTime: number;
4
4
  }
5
- declare function WebWalletSWKeeper({ webWalletUrl, maxIdleTime }: WebWalletSWKeeperProps): null;
5
+ declare function WebWalletSWKeeper({ webWalletUrl, maxIdleTime, }: WebWalletSWKeeperProps & {
6
+ maxIdleTime?: number;
7
+ }): null;
6
8
  export declare const withWebWalletSWKeeper: <P extends {
7
9
  webWalletUrl: string;
8
10
  }>(Component: React.ComponentType<P>) => ({ webWalletUrl, maxIdleTime, ...rest }: WebWalletSWKeeperProps & P) => import("react/jsx-runtime").JSX.Element;
@@ -3,8 +3,8 @@ import { useRef as b, useEffect as l } from "react";
3
3
  import E from "react-use/lib/useIdle";
4
4
  import { useLocalStorageState as W } from "ahooks";
5
5
  import h from "@arcblock/react-hooks/lib/useBrowser";
6
- import { getWebWalletUrl as y, checkSameProtocol as S } from "../Util/wallet.js";
7
- import { detectWalletExtension as w } from "../Util/index.js";
6
+ import { getWebWalletUrl as y, checkSameProtocol as S } from "../Util/wallet";
7
+ import { detectWalletExtension as w } from "../Util";
8
8
  const I = 1e3 * 60 * 30, x = "wallet_sw_keeper_disabled";
9
9
  let s;
10
10
  const g = (t) => {
@@ -18,7 +18,10 @@ const g = (t) => {
18
18
  }, A = (t) => {
19
19
  s || (s = `web_wallet_sw_keeper_${Date.now()}`, g(t));
20
20
  };
21
- function K({ webWalletUrl: t, maxIdleTime: e = I }) {
21
+ function K({
22
+ webWalletUrl: t,
23
+ maxIdleTime: e = I
24
+ }) {
22
25
  const o = b(!!s), n = E(e), r = () => {
23
26
  o.current || k();
24
27
  };
@@ -3,7 +3,7 @@ import { Dialog as a, Typography as r } from "@mui/material";
3
3
  import l from "@arcblock/react-hooks/lib/useBrowser";
4
4
  import n from "./images/ios.png";
5
5
  import o from "./images/android.png";
6
- import { styled as s } from "../Theme/index.js";
6
+ import { styled as s } from "../Theme";
7
7
  function u() {
8
8
  const i = l();
9
9
  return !i.mobile.any || !i.wechat ? null : i.android ? /* @__PURE__ */ e(a, { open: !0, fullScreen: !0, children: /* @__PURE__ */ t(c, { children: [
@@ -0,0 +1,28 @@
1
+ declare module '@arcblock/did-motif';
2
+ declare module 'd3-geo';
3
+ declare module 'topojson-client';
4
+ declare module 'versor';
5
+ declare module 'axios/*';
6
+
7
+ // ux svg 由 babel-plugin-inline-react-svg 处理
8
+ declare module '*.svg?react' {
9
+ import React from 'react';
10
+ const SVG: React.FC<React.SVGProps<SVGSVGElement>>;
11
+ export default SVG;
12
+ }
13
+
14
+ declare module '*.png' {
15
+ export default string;
16
+ }
17
+
18
+ type Blocklet = import('./type').Blocklet;
19
+
20
+ interface Window {
21
+ blocklet?: Blocklet;
22
+ env?: Blocklet;
23
+ }
24
+
25
+ declare module globalThis {
26
+ var blocklet: Blocklet;
27
+ var env: Blocklet;
28
+ }
@@ -1,23 +1,21 @@
1
- import { useCreation as l } from "ahooks";
2
- import { useTheme as u } from "@mui/material";
3
- import "../Theme/theme.js";
4
- import "../Theme/theme-provider.js";
5
- import f from "./use-mobile.js";
6
- function d({
7
- key: L = "sm",
8
- meta: p = {},
1
+ import { useCreation as L } from "ahooks";
2
+ import { useTheme as f } from "../Theme";
3
+ import m from "./use-mobile";
4
+ function M({
5
+ key: i = "sm",
6
+ meta: n = {},
9
7
  theme: t = {},
10
- square: n
8
+ square: p
11
9
  } = {}) {
12
- const c = f({ key: L }), a = u(), e = l(() => {
10
+ const c = m({ key: i }), a = f(), e = L(() => {
13
11
  var o;
14
12
  return ((o = t == null ? void 0 : t.palette) == null ? void 0 : o.mode) || a.palette.mode;
15
13
  }, [a, t]);
16
- return l(() => {
17
- const { appLogo: o, appLogoDark: s, appLogoRect: r, appLogoRectDark: m } = Object.assign({}, window.blocklet ?? {}, p), g = e === "dark", i = (g ? s : o) || o;
18
- return c || n ? i : (g ? m || s : r) || r || i || "";
19
- }, [e, p, c, n]);
14
+ return L(() => {
15
+ const { appLogo: o, appLogoDark: s, appLogoRect: g, appLogoRectDark: u } = Object.assign({}, window.blocklet ?? {}, n), l = e === "dark", r = (l ? s : o) || o;
16
+ return c || p ? r : (l ? u || s : g) || g || r || "";
17
+ }, [e, n, c, p]);
20
18
  }
21
19
  export {
22
- d as default
20
+ M as default
23
21
  };
@@ -5,7 +5,7 @@ import T from "dayjs/plugin/timezone";
5
5
  import z from "dayjs/plugin/localizedFormat";
6
6
  import "dayjs/locale/zh-cn";
7
7
  import "dayjs/locale/en";
8
- import { formatToDatetime as I } from "../Util/index.js";
8
+ import { formatToDatetime as I } from "../Util";
9
9
  e.extend(h);
10
10
  e.extend(T);
11
11
  e.extend(z);
package/lib/index.js CHANGED
@@ -1,81 +1,76 @@
1
- import { default as s } from "./ActionButton/index.js";
2
- import { default as x } from "./ActivityIndicator/index.js";
3
- import { default as i } from "./Address/index.js";
4
- import { default as c } from "./Alert/index.js";
5
- import { default as A } from "./AnimationWaiter/index.js";
6
- import { default as W } from "./Async/index.js";
7
- import { default as C } from "./Avatar/index.js";
8
- import { default as w } from "./Badge/index.js";
9
- import { default as b } from "./Button/index.js";
10
- import { default as v } from "./ClickToCopy/index.js";
11
- import { default as I } from "./CodeBlock/index.js";
12
- import { default as S } from "./ContactForm/index.js";
13
- import { default as E } from "./CountDown/index.js";
14
- import { default as M } from "./Earth/index.js";
15
- import { default as R } from "./Footer/index.js";
16
- import { default as V } from "./Icon/index.js";
17
- import { default as j } from "./Locale/selector.js";
18
- import { default as z } from "./Logo/index.js";
19
- import { default as H } from "./RelativeTime/index.js";
20
- import { default as N } from "./SessionUser/index.js";
21
- import { default as Q } from "./Datatable/index.js";
22
- import { default as Y } from "./Dialog/dialog.js";
23
- import "./Dialog/confirm.js";
24
- import "react/jsx-runtime";
25
- import "react";
26
- import "ahooks";
27
- import "lodash/noop";
28
- import { default as _ } from "./DidLogo/index.js";
29
- import { default as to } from "./Tabs/index.js";
30
- import { default as ao } from "./Tag/index.js";
31
- import { default as fo } from "./TextCollapse/index.js";
32
- import * as f from "./Theme/index.js";
33
- import { default as mo } from "./Toast/index.js";
34
- import * as l from "./Util/index.js";
35
- import { default as so } from "./Video/index.js";
36
- import { default as uo } from "./WebWalletSWKeeper/index.js";
37
- import { default as no } from "./Wallet/Action.js";
38
- import { default as To } from "./Wallet/Download.js";
39
- import { default as go } from "./WechatPrompt/index.js";
40
- import { default as ho } from "./withTheme/index.js";
41
- import { default as Do } from "./withTracker/index.js";
42
- import { default as Bo } from "./Img/index.js";
1
+ import { default as r } from "./ActionButton";
2
+ import { default as l } from "./ActivityIndicator";
3
+ import { default as s } from "./Address";
4
+ import { default as p } from "./Alert";
5
+ import { default as x } from "./AnimationWaiter";
6
+ import { default as n } from "./Async";
7
+ import { default as T } from "./Avatar";
8
+ import { default as g } from "./Badge";
9
+ import { default as h } from "./Button";
10
+ import { default as D } from "./ClickToCopy";
11
+ import { default as B } from "./CodeBlock";
12
+ import { default as k } from "./ContactForm";
13
+ import { default as y } from "./CountDown";
14
+ import { default as L } from "./Earth";
15
+ import { default as F } from "./Footer";
16
+ import { default as K } from "./Icon";
17
+ import { default as P } from "./Locale/selector";
18
+ import { default as U } from "./Logo";
19
+ import { default as j } from "./RelativeTime";
20
+ import { default as z } from "./SessionManager";
21
+ import { default as H } from "./Datatable";
22
+ import { default as N } from "./Dialog";
23
+ import { default as Q } from "./DidLogo";
24
+ import { default as Y } from "./Tabs";
25
+ import { default as _ } from "./Tag";
26
+ import { default as oo } from "./TextCollapse";
27
+ import * as o from "./Theme";
28
+ import { default as eo } from "./Toast";
29
+ import * as t from "./Util";
30
+ import { default as ro } from "./Video";
31
+ import { default as lo } from "./WebWalletSWKeeper";
32
+ import { default as so } from "./Wallet/Action";
33
+ import { default as uo } from "./Wallet/Download";
34
+ import { default as io } from "./WechatPrompt";
35
+ import { default as co } from "./withTheme";
36
+ import { default as Ao } from "./withTracker";
37
+ import { default as Wo } from "./Img";
43
38
  export {
44
- s as ActionButton,
45
- x as ActivityIndicator,
46
- i as Address,
47
- c as Alert,
48
- A as AnimationWaiter,
49
- W as Async,
50
- C as Avatar,
51
- w as Badge,
52
- b as Button,
53
- v as ClickToCopy,
54
- I as CodeBlock,
55
- S as ContactForm,
56
- E as CountDown,
57
- Q as Datatable,
58
- Y as Dialog,
59
- _ as DidLogo,
60
- M as Earth,
61
- R as Footer,
62
- V as Icon,
63
- Bo as Img,
64
- j as LocaleSelector,
65
- z as Logo,
66
- H as RelativeTime,
67
- N as SessionManager,
68
- to as Tabs,
69
- ao as Tag,
70
- fo as TextCollapse,
71
- f as Theme,
72
- mo as Toast,
73
- l as Util,
74
- so as Video,
75
- no as WalletAction,
76
- To as WalletDownload,
77
- uo as WebWalletSWKeeper,
78
- go as WechatPrompt,
79
- ho as withTheme,
80
- Do as withTracker
39
+ r as ActionButton,
40
+ l as ActivityIndicator,
41
+ s as Address,
42
+ p as Alert,
43
+ x as AnimationWaiter,
44
+ n as Async,
45
+ T as Avatar,
46
+ g as Badge,
47
+ h as Button,
48
+ D as ClickToCopy,
49
+ B as CodeBlock,
50
+ k as ContactForm,
51
+ y as CountDown,
52
+ H as Datatable,
53
+ N as Dialog,
54
+ Q as DidLogo,
55
+ L as Earth,
56
+ F as Footer,
57
+ K as Icon,
58
+ Wo as Img,
59
+ P as LocaleSelector,
60
+ U as Logo,
61
+ j as RelativeTime,
62
+ z as SessionManager,
63
+ Y as Tabs,
64
+ _ as Tag,
65
+ oo as TextCollapse,
66
+ o as Theme,
67
+ eo as Toast,
68
+ t as Util,
69
+ ro as Video,
70
+ so as WalletAction,
71
+ uo as WalletDownload,
72
+ lo as WebWalletSWKeeper,
73
+ io as WechatPrompt,
74
+ co as withTheme,
75
+ Ao as withTracker
81
76
  };
package/lib/type.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ import type { Theme } from '@mui/material';
2
+ import type { LiteralUnion } from 'type-fest';
3
+
4
+ export type $TSFixMe = any;
5
+ export type Translations = Record<string, Record<string, any>>;
6
+ export type Locale = LiteralUnion<'en' | 'zh', string>;
7
+
8
+ // TODO: 以下为 blocklet 应用专属的全局对象类型,可以更加具体
9
+ export type User = Record<string, any>;
10
+ export type Session = Record<string, any>;
11
+ export type Passport = Record<string, any>;
12
+ export type Blocklet = {
13
+ appId: string;
14
+ appIds: string[];
15
+ appPid: string;
16
+ appName: string;
17
+ appDescription: string;
18
+ appLogo: string;
19
+ appLogoRect: string;
20
+ appUrl: string;
21
+ isComponent: boolean;
22
+ prefix: string;
23
+ groupPrefix: string;
24
+ pageGroup: string;
25
+ version: string;
26
+ mode: string;
27
+ tenantMode: 'single' | 'multiple';
28
+ theme: {
29
+ prefer?: 'light' | 'dark' | 'system';
30
+ light: Theme;
31
+ dark: Theme;
32
+ };
33
+ navigation: $TSFixMe[];
34
+ preferences: Record<string, any>;
35
+ languages: {
36
+ code: string;
37
+ name: string;
38
+ }[];
39
+ passportColor: string;
40
+ componentMountPoints: $TSFixMe[];
41
+ alsoKnownAs: string[];
42
+ trustedFactories: string[];
43
+ [x: string]: any;
44
+ };
@@ -1,8 +1,9 @@
1
- import { Breakpoint, PaletteMode, PaletteOptions, TypographyOptions } from '@mui/material';
1
+ import { Breakpoint, PaletteMode, PaletteOptions } from '@mui/material';
2
+ import { TypographyStyleOptions } from '@mui/material/styles/createTypography';
2
3
  declare function withTheme<P extends object>(Component: React.ComponentType<P>, { mode, pageWidth, palette, typography, }?: {
3
4
  mode?: PaletteMode;
4
5
  pageWidth?: Breakpoint;
5
6
  palette?: PaletteOptions;
6
- typography?: TypographyOptions;
7
+ typography?: TypographyStyleOptions;
7
8
  }): (props: P) => import("react/jsx-runtime").JSX.Element;
8
9
  export default withTheme;
@@ -1,18 +1,17 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import { useEffect as p } from "react";
3
- import { css as f, Global as h } from "@emotion/react";
4
- import { CssBaseline as d } from "@mui/material";
5
- import { createTheme as y } from "../Theme/theme.js";
6
- import u from "../Theme/theme-provider.js";
1
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
+ import { useEffect as f } from "react";
3
+ import { css as h, Global as d } from "@emotion/react";
4
+ import { CssBaseline as y } from "@mui/material";
5
+ import { createTheme as u, ThemeProvider as g } from "../Theme";
7
6
  function S(r, {
8
7
  mode: i = "light",
9
8
  pageWidth: n = "md",
10
9
  palette: s,
11
10
  typography: a
12
11
  } = {}) {
13
- const o = y({ mode: i, pageWidth: n, palette: s, typography: a }), m = f`
12
+ const o = u({ mode: i, pageWidth: n, palette: s, typography: a }), l = o.typography.color.main, m = h`
14
13
  font-family: ${o.typography.fontFamily};
15
- color: ${o.typography.color.main};
14
+ color: ${l};
16
15
 
17
16
  a,
18
17
  a:hover,
@@ -43,14 +42,14 @@ function S(r, {
43
42
  }
44
43
  }
45
44
  `;
46
- return function(l) {
47
- return p(() => {
45
+ return function(c) {
46
+ return f(() => {
48
47
  const t = document.querySelector("#jss-server-side");
49
48
  t && t.parentNode && t.parentNode.removeChild(t);
50
- }, []), /* @__PURE__ */ c(u, { theme: o, children: [
51
- /* @__PURE__ */ e(d, {}),
52
- /* @__PURE__ */ e(h, { styles: m }),
53
- /* @__PURE__ */ e(r, { ...l })
49
+ }, []), /* @__PURE__ */ p(g, { theme: o, children: [
50
+ /* @__PURE__ */ e(y, {}),
51
+ /* @__PURE__ */ e(d, { styles: m }),
52
+ /* @__PURE__ */ e(r, { ...c })
54
53
  ] });
55
54
  };
56
55
  }