@arcblock/ux 2.10.67 → 2.10.68

Sign up to get free protection for your applications and to get access to all the features.
Files changed (294) hide show
  1. package/lib/Address/did-address.d.ts +6 -5
  2. package/lib/Address/index.d.ts +1 -1
  3. package/lib/Avatar/index.d.ts +10 -8
  4. package/lib/Avatar/index.js +6 -4
  5. package/lib/Blocklet/blocklet.d.ts +4 -4
  6. package/lib/Blocklet/blocklet.js +2 -2
  7. package/lib/BlockletContext/index.d.ts +3 -3
  8. package/lib/BlockletNFT/index.d.ts +6 -6
  9. package/lib/BlockletNFT/index.js +3 -3
  10. package/lib/BlockletV2/blocklet.d.ts +2 -2
  11. package/lib/Button/wrap.d.ts +4 -4
  12. package/lib/Button/wrap.js +2 -2
  13. package/lib/CardSelector/index.js +0 -1
  14. package/lib/Center/index.d.ts +1 -1
  15. package/lib/ClickToCopy/copy-button.d.ts +5 -4
  16. package/lib/ClickToCopy/copy-button.js +0 -1
  17. package/lib/ClickToCopy/hook.d.ts +3 -8
  18. package/lib/ClickToCopy/index.d.ts +6 -4
  19. package/lib/CodeBlock/index.d.ts +3 -1
  20. package/lib/CookieConsent/index.d.ts +8 -29
  21. package/lib/CookieConsent/index.js +3 -17
  22. package/lib/CountDown/index.d.ts +21 -25
  23. package/lib/CountDown/index.js +12 -11
  24. package/lib/DID/index.d.ts +9 -8
  25. package/lib/Datatable/index.d.ts +5 -5
  26. package/lib/Datatable/index.js +5 -5
  27. package/lib/Dialog/confirm.d.ts +6 -6
  28. package/lib/Dialog/confirm.js +3 -3
  29. package/lib/Dialog/types.d.ts +1 -1
  30. package/lib/DidLogo/index.d.ts +5 -25
  31. package/lib/DidLogo/index.js +4 -15
  32. package/lib/DriftBot/index.d.ts +13 -19
  33. package/lib/DriftBot/index.js +5 -6
  34. package/lib/Earth/index.d.ts +28 -10
  35. package/lib/Earth/index.js +12 -52
  36. package/lib/Earth/util.d.ts +10 -5
  37. package/lib/Earth/util.js +1 -0
  38. package/lib/ErrorBoundary/fallback.d.ts +12 -19
  39. package/lib/ErrorBoundary/fallback.js +2 -19
  40. package/lib/ErrorBoundary/index.d.ts +1 -1
  41. package/lib/Footer/index.d.ts +17 -24
  42. package/lib/Footer/index.js +2 -11
  43. package/lib/Header/header.d.ts +2 -2
  44. package/lib/Icon/image.d.ts +3 -2
  45. package/lib/Icon/index.d.ts +6 -4
  46. package/lib/Img/index.d.ts +1 -1
  47. package/lib/Img/index.js +1 -1
  48. package/lib/InfoRow/index.d.ts +9 -32
  49. package/lib/InfoRow/index.js +10 -23
  50. package/lib/Layout/dashboard/external-link.d.ts +13 -14
  51. package/lib/Layout/dashboard/external-link.js +5 -22
  52. package/lib/Layout/dashboard/full-page.d.ts +19 -11
  53. package/lib/Layout/dashboard/full-page.js +2 -6
  54. package/lib/Layout/dashboard/index.d.ts +20 -39
  55. package/lib/Layout/dashboard/index.js +10 -38
  56. package/lib/Layout/dashboard/sidebar.d.ts +17 -20
  57. package/lib/Layout/dashboard/sidebar.js +3 -16
  58. package/lib/Layout/dashboard-legacy/header.d.ts +10 -36
  59. package/lib/Layout/dashboard-legacy/header.js +5 -24
  60. package/lib/Layout/dashboard-legacy/index.d.ts +17 -56
  61. package/lib/Layout/dashboard-legacy/index.js +12 -41
  62. package/lib/Layout/dashboard-legacy/sidebar.d.ts +15 -26
  63. package/lib/Layout/dashboard-legacy/sidebar.js +5 -15
  64. package/lib/Layout/index.d.ts +17 -56
  65. package/lib/Layout/index.js +24 -50
  66. package/lib/LoadingMask/index.d.ts +8 -31
  67. package/lib/LoadingMask/index.js +2 -18
  68. package/lib/Locale/browser-lang.d.ts +4 -1
  69. package/lib/Locale/browser-lang.js +8 -3
  70. package/lib/Locale/context.d.ts +18 -8
  71. package/lib/Locale/context.js +1 -1
  72. package/lib/Locale/languages.d.ts +9 -55
  73. package/lib/Locale/selector.d.ts +10 -26
  74. package/lib/Locale/selector.js +8 -25
  75. package/lib/Locale/util.d.ts +4 -3
  76. package/lib/Locale/util.js +0 -1
  77. package/lib/Logo/index.d.ts +9 -40
  78. package/lib/Logo/index.js +88 -46
  79. package/lib/Metric/index.d.ts +9 -31
  80. package/lib/Metric/index.js +5 -20
  81. package/lib/NFTDisplay/aspect-ratio-container.d.ts +5 -12
  82. package/lib/NFTDisplay/aspect-ratio-container.js +0 -5
  83. package/lib/NFTDisplay/broken.d.ts +3 -13
  84. package/lib/NFTDisplay/broken.js +80 -10
  85. package/lib/NFTDisplay/displayApi.d.ts +1 -1
  86. package/lib/NFTDisplay/index.d.ts +28 -6
  87. package/lib/NFTDisplay/index.js +17 -51
  88. package/lib/NFTDisplay/svg-embedder/img.d.ts +8 -23
  89. package/lib/NFTDisplay/svg-embedder/img.js +3 -17
  90. package/lib/NFTDisplay/svg-embedder/inline-svg.d.ts +7 -13
  91. package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -8
  92. package/lib/NavMenu/nav-menu.d.ts +2 -0
  93. package/lib/NavMenu/nav-menu.js +0 -1
  94. package/lib/PageScroller/index.d.ts +14 -13
  95. package/lib/PageScroller/index.js +12 -37
  96. package/lib/PageScroller/usePrevValue.d.ts +1 -1
  97. package/lib/PageScroller/usePrevValue.js +1 -2
  98. package/lib/Passport/index.d.ts +1 -1
  99. package/lib/Passport/passport.d.ts +10 -30
  100. package/lib/Passport/passport.js +5 -19
  101. package/lib/PoweredByArcBlock/index.d.ts +4 -14
  102. package/lib/PoweredByArcBlock/index.js +1 -8
  103. package/lib/PricingTable/PricingPlan.d.ts +11 -9
  104. package/lib/PricingTable/PricingPlan.js +0 -4
  105. package/lib/PricingTable/index.d.ts +5 -3
  106. package/lib/PricingTable/index.js +1 -5
  107. package/lib/QRCode/index.d.ts +11 -22
  108. package/lib/QRCode/index.js +1 -15
  109. package/lib/RelativeTime/index.d.ts +12 -40
  110. package/lib/RelativeTime/index.js +7 -27
  111. package/lib/Result/common.d.ts +26 -45
  112. package/lib/Result/common.js +2 -4
  113. package/lib/Result/index.d.ts +5 -18
  114. package/lib/Result/index.js +1 -9
  115. package/lib/Result/result.d.ts +7 -29
  116. package/lib/Result/result.js +2 -17
  117. package/lib/Result/translations.d.ts +2 -54
  118. package/lib/Screenshot/BaseScreenshot/index.d.ts +7 -24
  119. package/lib/Screenshot/BaseScreenshot/index.js +2 -15
  120. package/lib/Screenshot/BaseScreenshot/shells/Macbook.d.ts +25 -19
  121. package/lib/Screenshot/BaseScreenshot/shells/Phone.d.ts +25 -19
  122. package/lib/Screenshot/index.d.ts +84 -28
  123. package/lib/Screenshot/index.js +14 -43
  124. package/lib/SessionBlocklet/index.d.ts +6 -19
  125. package/lib/SessionBlocklet/index.js +3 -14
  126. package/lib/SessionManager/index.d.ts +1 -1
  127. package/lib/SessionPermission/index.d.ts +9 -17
  128. package/lib/SessionPermission/index.js +3 -11
  129. package/lib/SessionUser/components/logged-in.d.ts +9 -31
  130. package/lib/SessionUser/components/logged-in.js +13 -29
  131. package/lib/SessionUser/components/session-user-item.d.ts +8 -1
  132. package/lib/SessionUser/components/session-user-item.js +2 -12
  133. package/lib/SessionUser/components/session-user-switch.d.ts +9 -21
  134. package/lib/SessionUser/components/session-user-switch.js +3 -15
  135. package/lib/SessionUser/components/un-login.d.ts +7 -23
  136. package/lib/SessionUser/components/un-login.js +4 -16
  137. package/lib/SessionUser/components/user-info.d.ts +12 -29
  138. package/lib/SessionUser/components/user-info.js +4 -19
  139. package/lib/SessionUser/index.d.ts +7 -30
  140. package/lib/SessionUser/index.js +5 -26
  141. package/lib/SessionUser/libs/translation.d.ts +2 -31
  142. package/lib/SessionUser/libs/translation.js +1 -0
  143. package/lib/SessionUser/libs/utils.d.ts +10 -9
  144. package/lib/Sparkline/index.d.ts +22 -1
  145. package/lib/Sparkline/index.js +25 -17
  146. package/lib/Spinner/index.d.ts +6 -1
  147. package/lib/Spinner/index.js +4 -11
  148. package/lib/Success/index.d.ts +5 -21
  149. package/lib/Success/index.js +4 -16
  150. package/lib/Tabs/index.d.ts +12 -26
  151. package/lib/Tabs/index.js +7 -37
  152. package/lib/TextCollapse/index.d.ts +10 -10
  153. package/lib/TextCollapse/index.js +4 -21
  154. package/lib/Theme/index.js +0 -2
  155. package/lib/Theme/theme-provider.d.ts +1 -1
  156. package/lib/Theme/theme.d.ts +4 -1
  157. package/lib/Theme/theme.js +1 -2
  158. package/lib/Typography/index.d.ts +5 -24
  159. package/lib/Typography/index.js +5 -17
  160. package/lib/Util/index.d.ts +11 -6
  161. package/lib/Util/index.js +6 -0
  162. package/lib/Video/index.d.ts +12 -16
  163. package/lib/Video/index.js +0 -14
  164. package/lib/Wallet/Action.d.ts +13 -18
  165. package/lib/Wallet/Action.js +0 -7
  166. package/lib/Wallet/Download.d.ts +24 -30
  167. package/lib/Wallet/Download.js +201 -18
  168. package/lib/Wallet/Open.d.ts +5 -15
  169. package/lib/Wallet/Open.js +5 -11
  170. package/lib/WalletOSIcon/index.d.ts +6 -25
  171. package/lib/WalletOSIcon/index.js +3 -16
  172. package/lib/WebWalletSWKeeper/index.d.ts +8 -20
  173. package/lib/WebWalletSWKeeper/index.js +14 -19
  174. package/lib/WechatPrompt/index.js +2 -0
  175. package/lib/global.d.ts +15 -0
  176. package/lib/type.d.ts +12 -3
  177. package/lib/withTheme/index.d.ts +8 -6
  178. package/lib/withTracker/index.d.ts +1 -1
  179. package/lib/withTracker/index.js +3 -0
  180. package/package.json +9 -5
  181. package/src/Address/did-address.tsx +7 -6
  182. package/src/Address/index.tsx +1 -1
  183. package/src/Avatar/index.jsx +6 -4
  184. package/src/Blocklet/blocklet.jsx +2 -2
  185. package/src/BlockletContext/index.tsx +3 -3
  186. package/src/BlockletNFT/index.jsx +3 -3
  187. package/src/BlockletV2/blocklet.tsx +2 -2
  188. package/src/Button/wrap.jsx +2 -2
  189. package/src/CardSelector/index.tsx +0 -1
  190. package/src/Center/index.tsx +1 -1
  191. package/src/ClickToCopy/copy-button.tsx +4 -4
  192. package/src/ClickToCopy/hook.ts +3 -2
  193. package/src/ClickToCopy/index.tsx +6 -5
  194. package/src/CodeBlock/index.tsx +3 -1
  195. package/src/CookieConsent/{index.jsx → index.tsx} +16 -19
  196. package/src/CountDown/{index.jsx → index.tsx} +30 -16
  197. package/src/DID/index.tsx +9 -8
  198. package/src/Datatable/index.jsx +5 -5
  199. package/src/Dialog/confirm.jsx +3 -3
  200. package/src/Dialog/types.d.ts +1 -1
  201. package/src/DidLogo/{index.jsx → index.tsx} +7 -14
  202. package/src/DriftBot/{index.jsx → index.tsx} +13 -11
  203. package/src/Earth/{index.jsx → index.tsx} +94 -66
  204. package/src/Earth/{util.js → util.ts} +20 -17
  205. package/src/ErrorBoundary/{fallback.jsx → fallback.tsx} +20 -21
  206. package/src/Footer/{index.jsx → index.tsx} +17 -14
  207. package/src/Header/header.tsx +2 -3
  208. package/src/Header/responsive-header.tsx +0 -1
  209. package/src/Icon/image.tsx +3 -3
  210. package/src/Icon/index.tsx +7 -4
  211. package/src/Img/index.jsx +1 -1
  212. package/src/InfoRow/{index.jsx → index.tsx} +32 -25
  213. package/src/Layout/dashboard/external-link.tsx +46 -0
  214. package/src/Layout/dashboard/{full-page.jsx → full-page.tsx} +20 -9
  215. package/src/Layout/dashboard/{index.jsx → index.tsx} +42 -44
  216. package/src/Layout/dashboard/{sidebar.jsx → sidebar.tsx} +23 -20
  217. package/src/Layout/dashboard-legacy/{header.jsx → header.tsx} +16 -26
  218. package/src/Layout/dashboard-legacy/{index.jsx → index.tsx} +32 -46
  219. package/src/Layout/dashboard-legacy/{sidebar.jsx → sidebar.tsx} +27 -19
  220. package/src/Layout/{index.jsx → index.tsx} +41 -47
  221. package/src/LoadingMask/{index.jsx → index.tsx} +17 -19
  222. package/src/Locale/{browser-lang.js → browser-lang.ts} +9 -7
  223. package/src/Locale/context.tsx +18 -11
  224. package/src/Locale/{languages.js → languages.ts} +1 -1
  225. package/src/Locale/{selector.jsx → selector.tsx} +32 -29
  226. package/src/Locale/{util.js → util.ts} +9 -2
  227. package/src/Logo/index.tsx +58 -0
  228. package/src/Metric/{index.jsx → index.tsx} +23 -18
  229. package/src/NFTDisplay/{aspect-ratio-container.jsx → aspect-ratio-container.tsx} +9 -7
  230. package/src/NFTDisplay/{broken.jsx → broken.tsx} +7 -12
  231. package/src/NFTDisplay/{displayApi.js → displayApi.ts} +4 -4
  232. package/src/NFTDisplay/{index.jsx → index.tsx} +59 -64
  233. package/src/NFTDisplay/svg-embedder/{img.jsx → img.tsx} +10 -18
  234. package/src/NFTDisplay/svg-embedder/{inline-svg.jsx → inline-svg.tsx} +8 -9
  235. package/src/NavMenu/nav-menu.tsx +2 -3
  236. package/src/PageScroller/{index.jsx → index.tsx} +40 -53
  237. package/src/PageScroller/{usePrevValue.js → usePrevValue.ts} +2 -3
  238. package/src/Passport/{passport.jsx → passport.tsx} +22 -19
  239. package/src/PoweredByArcBlock/{index.jsx → index.tsx} +6 -11
  240. package/src/PricingTable/{PricingPlan.jsx → PricingPlan.tsx} +15 -5
  241. package/src/PricingTable/{index.jsx → index.tsx} +9 -6
  242. package/src/QRCode/{index.jsx → index.tsx} +13 -17
  243. package/src/RelativeTime/{index.jsx → index.tsx} +24 -24
  244. package/src/Result/{common.jsx → common.tsx} +17 -13
  245. package/src/Result/index.tsx +30 -0
  246. package/src/Result/{result.jsx → result.tsx} +8 -17
  247. package/src/Result/{translations.js → translations.ts} +3 -1
  248. package/src/Screenshot/BaseScreenshot/{index.jsx → index.tsx} +9 -15
  249. package/src/Screenshot/BaseScreenshot/shells/{Macbook.jsx → Macbook.tsx} +3 -1
  250. package/src/Screenshot/BaseScreenshot/shells/{Phone.jsx → Phone.tsx} +3 -1
  251. package/src/Screenshot/{index.jsx → index.tsx} +60 -54
  252. package/src/SessionBlocklet/{index.jsx → index.tsx} +8 -14
  253. package/src/SessionPermission/index.tsx +25 -0
  254. package/src/SessionUser/components/{logged-in.jsx → logged-in.tsx} +49 -31
  255. package/src/SessionUser/components/session-user-item.tsx +97 -0
  256. package/src/SessionUser/components/{session-user-switch.jsx → session-user-switch.tsx} +16 -21
  257. package/src/SessionUser/components/{un-login.jsx → un-login.tsx} +10 -15
  258. package/src/SessionUser/components/{user-info.jsx → user-info.tsx} +16 -22
  259. package/src/SessionUser/index.tsx +26 -0
  260. package/src/SessionUser/libs/{translation.js → translation.ts} +3 -1
  261. package/src/SessionUser/libs/utils.ts +39 -0
  262. package/src/Sparkline/{index.jsx → index.tsx} +38 -22
  263. package/src/Spinner/index.tsx +20 -0
  264. package/src/Success/{index.jsx → index.tsx} +7 -13
  265. package/src/Tabs/{index.jsx → index.tsx} +26 -40
  266. package/src/TextCollapse/{index.jsx → index.tsx} +26 -21
  267. package/src/Theme/index.ts +0 -1
  268. package/src/Theme/theme-provider.tsx +1 -1
  269. package/src/Theme/theme.ts +6 -3
  270. package/src/Typography/{index.jsx → index.tsx} +19 -22
  271. package/src/Util/index.ts +14 -8
  272. package/src/Video/{index.jsx → index.tsx} +7 -10
  273. package/src/Wallet/{Action.jsx → Action.tsx} +16 -12
  274. package/src/Wallet/{Download.jsx → Download.tsx} +25 -21
  275. package/src/Wallet/{Open.jsx → Open.tsx} +8 -11
  276. package/src/WalletOSIcon/{index.jsx → index.tsx} +8 -16
  277. package/src/WebWalletSWKeeper/{index.jsx → index.tsx} +21 -24
  278. package/src/WechatPrompt/{index.jsx → index.tsx} +1 -0
  279. package/src/global.d.ts +15 -0
  280. package/src/type.d.ts +12 -3
  281. package/src/withTheme/{index.jsx → index.tsx} +12 -2
  282. package/src/withTracker/{index.jsx → index.tsx} +6 -4
  283. package/src/Layout/dashboard/external-link.jsx +0 -47
  284. package/src/Logo/index.jsx +0 -66
  285. package/src/Result/index.jsx +0 -33
  286. package/src/SessionPermission/index.jsx +0 -28
  287. package/src/SessionUser/components/session-user-item.jsx +0 -93
  288. package/src/SessionUser/index.jsx +0 -38
  289. package/src/SessionUser/libs/utils.js +0 -37
  290. package/src/Spinner/index.jsx +0 -21
  291. /package/src/ErrorBoundary/{index.jsx → index.ts} +0 -0
  292. /package/src/NFTDisplay/{loading.jsx → loading.tsx} +0 -0
  293. /package/src/Passport/{index.jsx → index.ts} +0 -0
  294. /package/src/SessionManager/{index.jsx → index.tsx} +0 -0
@@ -1,22 +1,23 @@
1
1
  import '@fontsource/ubuntu-mono/400.css';
2
2
  import { BoxProps } from '@mui/material';
3
3
  import React, { ReactNode } from 'react';
4
+ import type { Locale } from '../type';
4
5
  export interface HTMLDidAddressElement extends HTMLDivElement {
5
6
  copy: () => void;
6
7
  }
7
8
  export interface IDidAddressProps extends BoxProps {
8
9
  component?: React.ElementType;
9
10
  size?: number;
10
- copyable?: boolean;
11
- showCopyButtonInTooltip?: boolean;
11
+ copyable?: true | false;
12
+ showCopyButtonInTooltip?: false | true;
12
13
  content?: string;
13
- inline?: boolean;
14
+ inline?: false | true;
14
15
  prepend?: ReactNode;
15
16
  append?: ReactNode;
16
- compact?: boolean;
17
+ compact?: false | true;
17
18
  startChars?: number;
18
19
  endChars?: number;
19
- locale?: 'en' | 'zh';
20
+ locale?: Locale;
20
21
  }
21
22
  /**
22
23
  * DidAddress 组件 (新版设计)
@@ -1,6 +1,6 @@
1
1
  import { HTMLDidAddressElement, IDidAddressProps } from './did-address';
2
2
  export interface IDidAddressWrapper extends IDidAddressProps {
3
- responsive?: boolean;
3
+ responsive?: true | false;
4
4
  }
5
5
  declare const DidAddressWrapper: import("react").ForwardRefExoticComponent<Omit<IDidAddressWrapper, "ref"> & import("react").RefAttributes<HTMLDidAddressElement>>;
6
6
  export default DidAddressWrapper;
@@ -12,25 +12,27 @@ export default AvatarWithErrorBoundary;
12
12
  * Avatar component
13
13
  */
14
14
  export type AvatarProps = {
15
+ src?: string;
15
16
  did?: string;
16
17
  size?: number;
17
18
  variant?: "circle" | "rounded" | "default";
18
- animation?: boolean;
19
+ animation?: false | true;
19
20
  shape?: "" | "rectangle" | "square" | "hexagon" | "circle";
20
- blockiesPadding?: boolean;
21
- responsive?: boolean;
22
- } & Omit<import("../Img").ImgProps, "size">;
21
+ blockiesPadding?: true | false;
22
+ responsive?: false | true;
23
+ } & Omit<import("../Img").ImgProps, "size" | "src">;
23
24
  /**
24
25
  * Avatar component
25
26
  * @typedef {{
27
+ * src?: string;
26
28
  * did?: string;
27
29
  * size?: number;
28
30
  * variant?: 'circle' | 'rounded' | 'default';
29
- * animation?: boolean;
31
+ * animation?: false | true;
30
32
  * shape?: '' | 'rectangle' | 'square' | 'hexagon' | 'circle';
31
- * blockiesPadding?: boolean;
32
- * responsive?: boolean;
33
- * } & Omit<import('../Img').ImgProps, 'size'>} AvatarProps
33
+ * blockiesPadding?: true | false;
34
+ * responsive?: false | true;
35
+ * } & Omit<import('../Img').ImgProps, 'size' | 'src'>} AvatarProps
34
36
  */
35
37
  /**
36
38
  * @see 参考: https://github.com/blocklet/block-explorer/issues/478#issuecomment-1038954976
@@ -14,14 +14,15 @@ import { DID_PREFIX } from '../Util/constant';
14
14
  /**
15
15
  * Avatar component
16
16
  * @typedef {{
17
+ * src?: string;
17
18
  * did?: string;
18
19
  * size?: number;
19
20
  * variant?: 'circle' | 'rounded' | 'default';
20
- * animation?: boolean;
21
+ * animation?: false | true;
21
22
  * shape?: '' | 'rectangle' | 'square' | 'hexagon' | 'circle';
22
- * blockiesPadding?: boolean;
23
- * responsive?: boolean;
24
- * } & Omit<import('../Img').ImgProps, 'size'>} AvatarProps
23
+ * blockiesPadding?: true | false;
24
+ * responsive?: false | true;
25
+ * } & Omit<import('../Img').ImgProps, 'size' | 'src'>} AvatarProps
25
26
  */
26
27
 
27
28
  /**
@@ -31,6 +32,7 @@ import { DID_PREFIX } from '../Util/constant';
31
32
  */
32
33
  function Avatar(props) {
33
34
  const [imgError, setImgError] = useState(false);
35
+ /** @type {AvatarProps} */
34
36
  const newProps = mergeProps(props, Avatar, []);
35
37
  const {
36
38
  did = '',
@@ -7,8 +7,8 @@
7
7
  * cover?: string;
8
8
  * version?: string;
9
9
  * buttonText?: string;
10
- * buttonDisabled?: boolean;
11
- * buttonLoading?: boolean;
10
+ * buttonDisabled?: false | true;
11
+ * buttonLoading?: false | true;
12
12
  * button?: JSX.Element;
13
13
  * onButtonClick?: Function;
14
14
  * onMainClick?: Function;
@@ -74,8 +74,8 @@ export type BlockletStoreProps = {
74
74
  cover?: string;
75
75
  version?: string;
76
76
  buttonText?: string;
77
- buttonDisabled?: boolean;
78
- buttonLoading?: boolean;
77
+ buttonDisabled?: false | true;
78
+ buttonLoading?: false | true;
79
79
  button?: JSX.Element;
80
80
  onButtonClick?: Function;
81
81
  onMainClick?: Function;
@@ -131,8 +131,8 @@ const Div = styled('div')`
131
131
  * cover?: string;
132
132
  * version?: string;
133
133
  * buttonText?: string;
134
- * buttonDisabled?: boolean;
135
- * buttonLoading?: boolean;
134
+ * buttonDisabled?: false | true;
135
+ * buttonLoading?: false | true;
136
136
  * button?: JSX.Element;
137
137
  * onButtonClick?: Function;
138
138
  * onMainClick?: Function;
@@ -2,12 +2,12 @@ import type { Blocklet } from '../type';
2
2
  declare const BlockletContext: import("react").Context<Blocklet | null>;
3
3
  declare const Consumer: import("react").Consumer<Blocklet | null>;
4
4
  declare function BlockletProvider({ children, baseUrl, loading, }: {
5
- children: React.ReactNode;
5
+ children?: React.ReactNode;
6
6
  /**
7
7
  * baseUrl 为 blocklet origin + blocklet prefix
8
8
  */
9
- baseUrl: string;
10
- loading: React.ReactNode;
9
+ baseUrl?: string;
10
+ loading?: React.ReactNode;
11
11
  }): import("react/jsx-runtime").JSX.Element;
12
12
  declare function useBlockletContext(): {
13
13
  blocklet: Blocklet | null;
@@ -5,10 +5,10 @@
5
5
  * description?: string;
6
6
  * cover?: string;
7
7
  * did?: string;
8
- * isStickyButton?: boolean;
8
+ * isStickyButton?: false | true;
9
9
  * buttonText?: string;
10
- * buttonDisabled?: boolean;
11
- * buttonLoading?: boolean;
10
+ * buttonDisabled?: false | true;
11
+ * buttonLoading?: false | true;
12
12
  * button?: JSX.Element;
13
13
  * addons?: Array<any>;
14
14
  * size?: 'xs' | 'sm' | 'md' | 'auto';
@@ -86,10 +86,10 @@ export type BlockletNFTProps = {
86
86
  description?: string;
87
87
  cover?: string;
88
88
  did?: string;
89
- isStickyButton?: boolean;
89
+ isStickyButton?: false | true;
90
90
  buttonText?: string;
91
- buttonDisabled?: boolean;
92
- buttonLoading?: boolean;
91
+ buttonDisabled?: false | true;
92
+ buttonLoading?: false | true;
93
93
  button?: JSX.Element;
94
94
  addons?: Array<any>;
95
95
  size?: "xs" | "sm" | "md" | "auto";
@@ -216,10 +216,10 @@ BlockletIcon.propTypes = {
216
216
  * description?: string;
217
217
  * cover?: string;
218
218
  * did?: string;
219
- * isStickyButton?: boolean;
219
+ * isStickyButton?: false | true;
220
220
  * buttonText?: string;
221
- * buttonDisabled?: boolean;
222
- * buttonLoading?: boolean;
221
+ * buttonDisabled?: false | true;
222
+ * buttonLoading?: false | true;
223
223
  * button?: JSX.Element;
224
224
  * addons?: Array<any>;
225
225
  * size?: 'xs' | 'sm' | 'md' | 'auto';
@@ -15,8 +15,8 @@ export interface IBlockletStore extends CardProps {
15
15
  };
16
16
  button?: React.ReactNode;
17
17
  buttonText?: string;
18
- buttonDisabled?: boolean;
19
- buttonLoading?: boolean;
18
+ buttonDisabled?: false | true;
19
+ buttonLoading?: false | true;
20
20
  onButtonClick?: Function;
21
21
  onMainClick?: Function;
22
22
  className?: string;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @typedef {import('@mui/material').ButtonProps} MuiButtonProps
3
3
  * @typedef {{
4
- * rounded?: boolean,
5
- * loading?: boolean,
4
+ * rounded?: false | true,
5
+ * loading?: false | true,
6
6
  * forwardedRef?: import('react').ForwardedRef<any>,
7
7
  * color?: MuiButtonProps['color'] | 'reverse' | 'did'
8
8
  * }} CustomButtonProps
@@ -20,8 +20,8 @@
20
20
  export default function _default(BaseComponent: import("@mui/material").ExtendButtonBase<import("@mui/material").ButtonTypeMap<{}, "button">>): ButtonComponent;
21
21
  export type MuiButtonProps = import("@mui/material").ButtonProps;
22
22
  export type CustomButtonProps = {
23
- rounded?: boolean;
24
- loading?: boolean;
23
+ rounded?: false | true;
24
+ loading?: false | true;
25
25
  forwardedRef?: import("react").ForwardedRef<any>;
26
26
  color?: MuiButtonProps["color"] | "reverse" | "did";
27
27
  };
@@ -32,8 +32,8 @@ const extendedColors = {
32
32
  /**
33
33
  * @typedef {import('@mui/material').ButtonProps} MuiButtonProps
34
34
  * @typedef {{
35
- * rounded?: boolean,
36
- * loading?: boolean,
35
+ * rounded?: false | true,
36
+ * loading?: false | true,
37
37
  * forwardedRef?: import('react').ForwardedRef<any>,
38
38
  * color?: MuiButtonProps['color'] | 'reverse' | 'did'
39
39
  * }} CustomButtonProps
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /* eslint-disable no-unused-vars */
3
2
  import { useState, useEffect, useRef } from 'react';
4
3
  import styled from '@emotion/styled';
5
4
  import noop from 'lodash/noop';
@@ -1,5 +1,5 @@
1
1
  export default function Center({ children, relative, }: {
2
- children: React.ReactNode;
2
+ children?: React.ReactNode;
3
3
  /**
4
4
  * 容器相对尺寸,默认相对屏幕(screen),可设置为父容器(parent)
5
5
  */
@@ -1,10 +1,11 @@
1
+ import type { Locale } from '../type';
1
2
  export interface CopyButtonProps extends React.HTMLAttributes<HTMLSpanElement> {
2
3
  content?: string;
3
- locale?: 'en' | 'zh';
4
+ locale?: Locale;
4
5
  render?: (props: {
5
6
  copyButton: React.ReactNode;
6
7
  containerRef: React.RefObject<HTMLElement>;
7
- }) => React.ReactNode;
8
- showTooltip?: boolean;
8
+ }) => JSX.Element | null;
9
+ showTooltip?: true | false;
9
10
  }
10
- export default function CopyButton({ content, locale, render, showTooltip, ...rest }: CopyButtonProps): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
11
+ export default function CopyButton({ content, locale, render, showTooltip, ...rest }: CopyButtonProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /* eslint-disable no-unused-vars */
3
2
  import Tooltip from '@mui/material/Tooltip';
4
3
  import { green } from '@mui/material/colors';
5
4
  import CopyIcon from '@mui/icons-material/ContentCopy';
@@ -1,15 +1,10 @@
1
+ import type { Locale } from '../type';
1
2
  export default function useCopy({ content, locale }: {
2
3
  content?: string;
3
- locale?: 'en' | 'zh';
4
+ locale?: Locale;
4
5
  }): {
5
6
  containerRef: import("react").MutableRefObject<HTMLElement | null>;
6
7
  copied: boolean;
7
8
  copy: (e: React.MouseEvent) => void;
8
- texts: {
9
- copy: string;
10
- copied: string;
11
- } | {
12
- copy: string;
13
- copied: string;
14
- };
9
+ texts: Record<string, any>;
15
10
  };
@@ -1,11 +1,13 @@
1
+ import { type TooltipProps } from '@mui/material/Tooltip';
2
+ import type { Locale } from '../type';
1
3
  export { default as CopyButton } from './copy-button';
2
- export interface ClickToCopyProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ export interface ClickToCopyProps extends TooltipProps {
3
5
  content?: string;
4
- locale?: 'en' | 'zh';
6
+ locale?: Locale;
5
7
  tip?: string;
6
8
  tipPlacement?: string;
7
9
  copiedTip?: string;
8
- unstyled?: boolean;
10
+ unstyled?: false | true;
9
11
  }
10
12
  declare function ClickToCopy(props: ClickToCopyProps): import("react/jsx-runtime").JSX.Element;
11
13
  declare namespace ClickToCopy {
@@ -14,7 +16,7 @@ declare namespace ClickToCopy {
14
16
  tip: string;
15
17
  copiedTip: string;
16
18
  tipPlacement: string;
17
- locale: "en";
19
+ locale: string;
18
20
  unstyled: boolean;
19
21
  };
20
22
  }
@@ -1,8 +1,10 @@
1
+ import { type SxProps } from '@mui/material';
1
2
  import 'highlight.js/styles/atom-one-dark.css';
2
3
  export interface CodeBlockProps extends React.HTMLAttributes<HTMLPreElement> {
3
4
  code?: string;
4
5
  language?: string;
5
6
  children?: React.ReactNode;
6
- dark?: boolean;
7
+ dark?: true | false;
8
+ sx?: SxProps;
7
9
  }
8
10
  export default function CodeBlock({ code, language, children, dark, ...rest }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -1,34 +1,13 @@
1
+ import CookieConsent, { resetCookieConsentValue } from 'react-cookie-consent';
2
+ import type { Locale } from '../type';
3
+ export { resetCookieConsentValue };
4
+ export interface CookieConsentProps extends React.ComponentProps<typeof CookieConsent> {
5
+ locale?: Locale;
6
+ displayInIframe?: false | true;
7
+ }
1
8
  /**
2
9
  * DefaultCookieConsent, 对 react-cookie-consent package 封装, 以便 arcblock 内部产品可以快速使用
3
10
  * - 默认内容
4
11
  * - 默认配置/样式
5
12
  */
6
- declare function DefaultCookieConsent({ children, locale, style, displayInIframe, ...rest }: {
7
- [x: string]: any;
8
- children: any;
9
- locale: any;
10
- style: any;
11
- displayInIframe: any;
12
- }): import("react/jsx-runtime").JSX.Element | null;
13
- declare namespace DefaultCookieConsent {
14
- namespace propTypes {
15
- let children: PropTypes.Requireable<any>;
16
- let style: PropTypes.Requireable<object>;
17
- let locale: PropTypes.Requireable<string>;
18
- let displayInIframe: PropTypes.Requireable<boolean>;
19
- }
20
- namespace defaultProps {
21
- let children_1: null;
22
- export { children_1 as children };
23
- let style_1: {};
24
- export { style_1 as style };
25
- let locale_1: string;
26
- export { locale_1 as locale };
27
- let displayInIframe_1: boolean;
28
- export { displayInIframe_1 as displayInIframe };
29
- }
30
- }
31
- export default DefaultCookieConsent;
32
- export { resetCookieConsentValue };
33
- import PropTypes from 'prop-types';
34
- import { resetCookieConsentValue } from 'react-cookie-consent';
13
+ export default function DefaultCookieConsent({ children, locale, style, displayInIframe, ...rest }: CookieConsentProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import Button from '@mui/material/Button';
4
3
  import CookieConsent, { resetCookieConsentValue } from 'react-cookie-consent';
5
4
  import { styled } from '../Theme';
@@ -27,7 +26,6 @@ function AcceptButton(props) {
27
26
  ...props
28
27
  });
29
28
  }
30
-
31
29
  /**
32
30
  * DefaultCookieConsent, 对 react-cookie-consent package 封装, 以便 arcblock 内部产品可以快速使用
33
31
  * - 默认内容
@@ -35,9 +33,9 @@ function AcceptButton(props) {
35
33
  */
36
34
  export default function DefaultCookieConsent({
37
35
  children,
38
- locale,
39
- style,
40
- displayInIframe,
36
+ locale = 'en',
37
+ style = {},
38
+ displayInIframe = false,
41
39
  ...rest
42
40
  }) {
43
41
  if (!displayInIframe && inIframe()) {
@@ -68,18 +66,6 @@ export default function DefaultCookieConsent({
68
66
  })
69
67
  });
70
68
  }
71
- DefaultCookieConsent.propTypes = {
72
- children: PropTypes.any,
73
- style: PropTypes.object,
74
- locale: PropTypes.string,
75
- displayInIframe: PropTypes.bool
76
- };
77
- DefaultCookieConsent.defaultProps = {
78
- children: null,
79
- style: {},
80
- locale: 'en',
81
- displayInIframe: false
82
- };
83
69
  const Wrapper = styled('div')`
84
70
  box-sizing: border-box;
85
71
  position: fixed;
@@ -1,30 +1,26 @@
1
- declare class CountDown extends Component<any, any, any> {
2
- constructor(props: any);
3
- state: {
4
- days: number;
5
- hours: number;
6
- minutes: number;
7
- seconds: number;
8
- done: boolean;
1
+ import { Component } from 'react';
2
+ import { type SxProps } from '@mui/material';
3
+ export interface CountDownProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** endTime should be UTC */
5
+ endTime: number;
6
+ dark?: true | false;
7
+ sx?: SxProps;
8
+ }
9
+ export interface CountDownState {
10
+ days: number;
11
+ hours: number;
12
+ minutes: number;
13
+ seconds: number;
14
+ done: boolean;
15
+ }
16
+ export default class CountDown extends Component<CountDownProps, CountDownState> {
17
+ static defaultProps: {
18
+ dark: boolean;
19
+ style: {};
9
20
  };
10
- timer: any;
21
+ timer?: NodeJS.Timeout;
22
+ constructor(props: CountDownProps);
11
23
  componentDidMount(): void;
12
24
  componentWillUnmount(): void;
13
25
  render(): import("react/jsx-runtime").JSX.Element;
14
26
  }
15
- declare namespace CountDown {
16
- namespace propTypes {
17
- let endTime: PropTypes.Validator<number>;
18
- let dark: PropTypes.Requireable<boolean>;
19
- let style: PropTypes.Requireable<object>;
20
- }
21
- namespace defaultProps {
22
- let dark_1: boolean;
23
- export { dark_1 as dark };
24
- let style_1: {};
25
- export { style_1 as style };
26
- }
27
- }
28
- export default CountDown;
29
- import { Component } from 'react';
30
- import PropTypes from 'prop-types';
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2
5
  import { Component } from 'react';
3
- import PropTypes from 'prop-types';
4
6
  import { getColor, mergeProps } from '../Util';
5
7
  import { styled } from '../Theme';
6
8
  const SECONDS_OF_MINUTE = 60;
@@ -53,16 +55,17 @@ function FixWidthNumber({
53
55
  export default class CountDown extends Component {
54
56
  constructor(props) {
55
57
  super(props);
58
+ _defineProperty(this, "timer", void 0);
56
59
  const newProps = mergeProps(props, CountDown, ['dark', 'endTime', 'style']);
57
60
  this.state = getRemaining(newProps.endTime);
58
- this.timer = null;
61
+ this.timer = undefined;
59
62
  }
60
63
  componentDidMount() {
61
64
  this.timer = setInterval(() => {
62
65
  const remaining = getRemaining(this.props.endTime);
63
66
  if (remaining.done) {
64
67
  clearInterval(this.timer);
65
- this.timer = null;
68
+ this.timer = undefined;
66
69
  }
67
70
  this.setState(remaining);
68
71
  }, 1000);
@@ -70,7 +73,7 @@ export default class CountDown extends Component {
70
73
  componentWillUnmount() {
71
74
  if (this.timer) {
72
75
  clearInterval(this.timer);
73
- this.timer = null;
76
+ this.timer = undefined;
74
77
  }
75
78
  }
76
79
  render() {
@@ -113,19 +116,17 @@ export default class CountDown extends Component {
113
116
  });
114
117
  }
115
118
  }
116
- CountDown.propTypes = {
117
- endTime: PropTypes.number.isRequired,
118
- // endTime should be UTC
119
- dark: PropTypes.bool,
120
- style: PropTypes.object
121
- };
119
+ // eslint-disable-next-line react/static-property-placement
120
+ _defineProperty(CountDown, "defaultProps", void 0);
122
121
  CountDown.defaultProps = {
123
122
  dark: true,
124
123
  style: {}
125
124
  };
126
125
  const textBackground = `linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
127
126
  linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5) 77%, rgba(0, 0, 0, 0.5))`;
128
- const Container = styled('div')`
127
+ const Container = styled('div', {
128
+ shouldForwardProp: prop => prop !== 'dark'
129
+ })`
129
130
  color: ${props => getColor(props)};
130
131
  font-size: 50px;
131
132
  display: flex;
@@ -1,21 +1,22 @@
1
1
  import React from 'react';
2
2
  import { IDidAddressWrapper } from '../Address';
3
3
  import { HTMLDidAddressElement } from '../Address/did-address';
4
+ import type { Locale } from '../type';
4
5
  interface IDIDPropTypes extends IDidAddressWrapper {
5
6
  did: string;
6
7
  size?: number;
7
8
  component?: React.ElementType;
8
- copyable?: boolean;
9
- responsive?: boolean;
10
- showCopyButtonInTooltip?: boolean;
11
- showAvatar?: boolean;
12
- showQrcode?: boolean;
13
- inline?: boolean;
9
+ copyable?: true | false;
10
+ responsive?: true | false;
11
+ showCopyButtonInTooltip?: false | true;
12
+ showAvatar?: true | false;
13
+ showQrcode?: false | true;
14
+ inline?: false | true;
14
15
  append?: any;
15
- compact?: boolean;
16
+ compact?: false | true;
16
17
  startChars?: number;
17
18
  endChars?: number;
18
- locale?: 'en' | 'zh';
19
+ locale?: Locale;
19
20
  chainId?: string;
20
21
  roleType?: number;
21
22
  }
@@ -23,18 +23,18 @@ export type ModifiedMUIDataTableProps = {
23
23
  export type DataTableProps = {
24
24
  data: Array<object | number[] | string[]>;
25
25
  columns: Array<DataTableColumn>;
26
- locale?: string;
26
+ locale?: import("../type").Locale;
27
27
  options?: {
28
28
  searchDebounceTime?: number;
29
29
  } & import("mui-datatables").MUIDataTableOptions;
30
30
  style?: import("react").CSSProperties;
31
31
  customButtons?: Array<DataTableCustomButton>;
32
32
  onChange?: (state: DataTableState, action: string) => void | Promise<void>;
33
- loading?: boolean;
34
- disabled?: boolean;
35
- stripped?: boolean;
33
+ loading?: false | true;
34
+ disabled?: false | true;
35
+ stripped?: false | true;
36
36
  verticalKeyWidth?: number | string;
37
- hideTableHeader?: boolean;
37
+ hideTableHeader?: false | true;
38
38
  components?: ModifiedMUIDataTableProps["components"];
39
39
  emptyNode?: import("react").ReactNode;
40
40
  durable?: string;
@@ -44,16 +44,16 @@ import { styled } from '../Theme';
44
44
  * @typedef {{
45
45
  * data: Array<object | number[] | string[]>,
46
46
  * columns: Array<DataTableColumn>,
47
- * locale?: string,
47
+ * locale?: import('../type').Locale,
48
48
  * options?: { searchDebounceTime?: number } & import('mui-datatables').MUIDataTableOptions,
49
49
  * style?: import('react').CSSProperties,
50
50
  * customButtons?: Array<DataTableCustomButton>,
51
51
  * onChange?: (state: DataTableState, action: string) => void | Promise<void>,
52
- * loading?: boolean,
53
- * disabled?: boolean,
54
- * stripped?: boolean,
52
+ * loading?: false | true,
53
+ * disabled?: false | true,
54
+ * stripped?: false | true,
55
55
  * verticalKeyWidth?: number | string,
56
- * hideTableHeader?: boolean,
56
+ * hideTableHeader?: false | true,
57
57
  * components?: ModifiedMUIDataTableProps['components'],
58
58
  * emptyNode?: import('react').ReactNode,
59
59
  * durable?: string,
@@ -7,9 +7,9 @@
7
7
  * onConfirm: Function,
8
8
  * onCancel: Function,
9
9
  * children?: React.ReactNode,
10
- * showCancelButton?: boolean,
11
- * showCloseButton?: boolean,
12
- * fullScreen?: boolean,
10
+ * showCancelButton?: true | false,
11
+ * showCloseButton?: true | false,
12
+ * fullScreen?: false | true,
13
13
  * confirmButton?: {text: string, props?: ButtonProps}
14
14
  * cancelButton?: {text: string, props?: ButtonProps}
15
15
  * PaperProps?: PaperProps
@@ -70,9 +70,9 @@ export type ConfirmProps = {
70
70
  onConfirm: Function;
71
71
  onCancel: Function;
72
72
  children?: React.ReactNode;
73
- showCancelButton?: boolean;
74
- showCloseButton?: boolean;
75
- fullScreen?: boolean;
73
+ showCancelButton?: true | false;
74
+ showCloseButton?: true | false;
75
+ fullScreen?: false | true;
76
76
  confirmButton?: {
77
77
  text: string;
78
78
  props?: ButtonProps;