@arcblock/ux 2.10.67 → 2.10.69

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 (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 +3 -19
  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 +2 -17
  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 +5 -15
  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 +10 -19
  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 +17 -8
  161. package/lib/Util/index.js +22 -3
  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} +18 -20
  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} +14 -19
  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} +9 -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} +13 -16
  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 +26 -9
  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
@@ -13,9 +13,9 @@ import Dialog from './dialog';
13
13
  * onConfirm: Function,
14
14
  * onCancel: Function,
15
15
  * children?: React.ReactNode,
16
- * showCancelButton?: boolean,
17
- * showCloseButton?: boolean,
18
- * fullScreen?: boolean,
16
+ * showCancelButton?: true | false,
17
+ * showCloseButton?: true | false,
18
+ * fullScreen?: false | true,
19
19
  * confirmButton?: {text: string, props?: ButtonProps}
20
20
  * cancelButton?: {text: string, props?: ButtonProps}
21
21
  * PaperProps?: PaperProps
@@ -5,7 +5,7 @@ export interface OpenConfirmProps {
5
5
  content: ReactNode;
6
6
  onConfirm?: (close: () => void) => void;
7
7
  onCancel?: () => void;
8
- showCancelButton?: boolean;
8
+ showCancelButton?: true | false;
9
9
  confirmButtonText?: string;
10
10
  cancelButtonText?: string;
11
11
  }
@@ -1,26 +1,6 @@
1
- declare function DidLogo({ style, size, className }: {
2
- style: any;
3
- size: any;
4
- className: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- declare namespace DidLogo {
7
- namespace propTypes {
8
- let style: PropTypes.Requireable<object>;
9
- let size: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
10
- let className: PropTypes.Requireable<string>;
11
- }
12
- namespace defaultProps {
13
- export { defaultStyle as style };
14
- let size_1: number;
15
- export { size_1 as size };
16
- let className_1: string;
17
- export { className_1 as className };
18
- }
19
- }
20
- export default DidLogo;
21
- import PropTypes from 'prop-types';
22
- declare namespace defaultStyle {
23
- let width: string;
24
- let height: string;
25
- let fill: string;
1
+ export interface DidLogoProps {
2
+ style?: React.CSSProperties;
3
+ size?: string | number;
4
+ className?: string;
26
5
  }
6
+ export default function DidLogo({ style, size, className }: DidLogoProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import DidLogoIcon from '@arcblock/icons/lib/DidLogo';
4
3
  const defaultStyle = {
5
4
  width: 'auto',
@@ -7,9 +6,9 @@ const defaultStyle = {
7
6
  fill: 'currentColor'
8
7
  };
9
8
  export default function DidLogo({
10
- style,
11
- size,
12
- className
9
+ style = defaultStyle,
10
+ size = 0,
11
+ className = ''
13
12
  }) {
14
13
  const height = Number(size) > 0 ? `${Number(size)}px` : size;
15
14
  return /*#__PURE__*/_jsx(DidLogoIcon, {
@@ -18,14 +17,4 @@ export default function DidLogo({
18
17
  height
19
18
  } : {})
20
19
  });
21
- }
22
- DidLogo.propTypes = {
23
- style: PropTypes.object,
24
- size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
25
- className: PropTypes.string
26
- };
27
- DidLogo.defaultProps = {
28
- style: defaultStyle,
29
- size: 0,
30
- className: ''
31
- };
20
+ }
@@ -1,24 +1,18 @@
1
- declare class DriftBot extends Component<any, any, any> {
2
- constructor(props: any);
1
+ import { Component } from 'react';
2
+ export interface DriftBotProps {
3
+ appId: string;
4
+ userId?: string;
5
+ attributes?: Record<string, any>;
6
+ }
7
+ export default class DriftBot extends Component<DriftBotProps> {
8
+ static defaultProps: {
9
+ userId: string;
10
+ attributes: Record<string, any>;
11
+ };
12
+ constructor(props: DriftBotProps);
13
+ insertScript(scriptText: string): void;
3
14
  addMainScript(): void;
4
15
  addIdentityVariables(): void;
5
- insertScript(scriptText: any): void;
6
16
  componentDidMount(): void;
7
17
  render(): string;
8
18
  }
9
- declare namespace DriftBot {
10
- namespace propTypes {
11
- let appId: PropTypes.Validator<string>;
12
- let userId: PropTypes.Requireable<string>;
13
- let attributes: PropTypes.Requireable<object>;
14
- }
15
- namespace defaultProps {
16
- let userId_1: string;
17
- export { userId_1 as userId };
18
- let attributes_1: {};
19
- export { attributes_1 as attributes };
20
- }
21
- }
22
- export default DriftBot;
23
- import { Component } from 'react';
24
- import PropTypes from 'prop-types';
@@ -1,6 +1,8 @@
1
+ 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; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ 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); }
1
4
  /* eslint-disable max-len */
2
5
  import { Component } from 'react';
3
- import PropTypes from 'prop-types';
4
6
  import { mergeProps } from '../Util';
5
7
  export default class DriftBot extends Component {
6
8
  constructor(props) {
@@ -59,11 +61,8 @@ export default class DriftBot extends Component {
59
61
  return '';
60
62
  }
61
63
  }
62
- DriftBot.propTypes = {
63
- appId: PropTypes.string.isRequired,
64
- userId: PropTypes.string,
65
- attributes: PropTypes.object
66
- };
64
+ // eslint-disable-next-line react/static-property-placement
65
+ _defineProperty(DriftBot, "defaultProps", void 0);
67
66
  DriftBot.defaultProps = {
68
67
  userId: '',
69
68
  attributes: {}
@@ -1,11 +1,29 @@
1
- declare const _default: (props: {
2
- theme: any;
3
- width: any;
4
- height: any;
5
- enableRotation: any;
6
- rotationSpeed: any;
7
- markers: any;
8
- activeMarkerId: any;
9
- colors: any;
10
- }) => import("react/jsx-runtime").JSX.Element;
1
+ export type Marker = {
2
+ id: string;
3
+ title: string;
4
+ description: string;
5
+ country: string;
6
+ latitude: number;
7
+ longitude: number;
8
+ };
9
+ export type Colors = {
10
+ ocean: string;
11
+ graticule: string;
12
+ land: string;
13
+ activeLand: string;
14
+ border: string;
15
+ marker: string;
16
+ activeMarker: string;
17
+ };
18
+ export interface EarthProps {
19
+ theme?: 'light' | 'dark';
20
+ width?: number;
21
+ height?: number;
22
+ enableRotation?: false | true;
23
+ rotationSpeed?: number;
24
+ activeMarkerId?: string;
25
+ markers?: Marker[];
26
+ colors?: Partial<Colors>;
27
+ }
28
+ declare const _default: (props: EarthProps) => import("react/jsx-runtime").JSX.Element;
11
29
  export default _default;
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /* eslint-disable consistent-return */
3
3
  import { useReducer, useRef, useEffect } from 'react';
4
4
  import useSpring from 'react-use/lib/useSpring';
5
- import PropTypes from 'prop-types';
6
5
  import * as d3 from 'd3-geo';
7
6
  import * as topojson from 'topojson-client';
8
7
  import versor from 'versor';
@@ -53,16 +52,16 @@ function stateReducer(state, action) {
53
52
  }
54
53
  }
55
54
  function Earth({
56
- theme,
57
- width,
58
- height,
59
- enableRotation,
60
- rotationSpeed,
61
- markers,
55
+ theme = 'dark',
56
+ width = 1200,
57
+ height = 600,
58
+ enableRotation = false,
59
+ rotationSpeed = 5,
62
60
  activeMarkerId,
63
- colors
61
+ markers = [],
62
+ colors: _colors = {}
64
63
  }) {
65
- Object.assign(colors, themes[theme]);
64
+ const colors = Object.assign(_colors, themes[theme]);
66
65
  const [state, dispatch] = useReducer(stateReducer, {
67
66
  rotation: [0, 0, 0],
68
67
  isDragging: false,
@@ -73,11 +72,7 @@ function Earth({
73
72
  const svgRef = useRef(null);
74
73
 
75
74
  // variables used to track drag and rotate
76
- const dragRef = useRef({
77
- v0: undefined,
78
- r0: undefined,
79
- q0: undefined
80
- });
75
+ const dragRef = useRef({});
81
76
 
82
77
  // variables used to track start and end position when there is active marker
83
78
  const rotateRef = useRef({
@@ -151,7 +146,7 @@ function Earth({
151
146
  });
152
147
  const getMousePosition = event => {
153
148
  const node = svgRef.current;
154
- const rect = node.getBoundingClientRect();
149
+ const rect = node?.getBoundingClientRect();
155
150
  const mousePosition = [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
156
151
  return mousePosition;
157
152
  };
@@ -279,7 +274,7 @@ function Earth({
279
274
  return /*#__PURE__*/_jsxs(Container, {
280
275
  width: width,
281
276
  height: height,
282
- theme: theme,
277
+ $theme: theme,
283
278
  colors: colors,
284
279
  onMouseLeave: onDragEnd,
285
280
  children: [renderTooltip(), /*#__PURE__*/_jsxs("svg", {
@@ -361,46 +356,11 @@ function Earth({
361
356
  })]
362
357
  });
363
358
  }
364
- Earth.propTypes = {
365
- theme: PropTypes.oneOf(['light', 'dark']),
366
- width: PropTypes.number,
367
- height: PropTypes.number,
368
- enableRotation: PropTypes.bool,
369
- rotationSpeed: PropTypes.number,
370
- activeMarkerId: PropTypes.string,
371
- markers: PropTypes.arrayOf(PropTypes.shape({
372
- id: PropTypes.string.isRequired,
373
- title: PropTypes.string.isRequired,
374
- description: PropTypes.string.isRequired,
375
- country: PropTypes.string.isRequired,
376
- latitude: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
377
- longitude: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
378
- })),
379
- colors: PropTypes.shape({
380
- ocean: PropTypes.string,
381
- graticule: PropTypes.string,
382
- land: PropTypes.string,
383
- activeLand: PropTypes.string,
384
- border: PropTypes.string,
385
- marker: PropTypes.string,
386
- activeMarker: PropTypes.string
387
- })
388
- };
389
- Earth.defaultProps = {
390
- theme: 'dark',
391
- width: 1200,
392
- height: 600,
393
- enableRotation: false,
394
- rotationSpeed: 5,
395
- markers: [],
396
- activeMarkerId: undefined,
397
- colors: {}
398
- };
399
359
  export default withDeprecated(Earth, {
400
360
  name: 'Earth'
401
361
  });
402
362
  const Container = styled('div')`
403
- background-color: ${props => props.theme === 'light' ? '#f7f7f7' : '#222'};
363
+ background-color: ${props => props.$theme === 'light' ? '#f7f7f7' : '#222'};
404
364
  width: ${props => props.width}px;
405
365
  height: ${props => props.height}px;
406
366
  position: relative;
@@ -1,7 +1,12 @@
1
+ export type Vec3 = [number, number, number];
2
+ export type Vec2 = [number, number];
3
+ export type Quaternion = [number, number, number, number];
4
+ export type Rotation = Vec3;
5
+ export type Angles = Vec3;
1
6
  export default class Util {
2
- static fromAngles([l, p, g]: [any, any, any]): number[];
3
- static toAngles([a, b, c, d]: [any, any, any, any]): number[];
4
- static interpolateAngles(a: any, b: any): (t: any) => number[];
5
- static interpolateLinear([a1, b1, c1, d1]: [any, any, any, any], [a2, b2, c2, d2]: [any, any, any, any]): (t: any) => any[];
6
- static interpolate([a1, b1, c1, d1]: [any, any, any, any], [a2, b2, c2, d2]: [any, any, any, any]): (t: any) => any[];
7
+ static fromAngles([l, p, g]: Angles): Quaternion;
8
+ static toAngles([a, b, c, d]: Quaternion): number[];
9
+ static interpolateAngles(a: [number, number, number], b: [number, number, number]): (t: number) => number[];
10
+ static interpolateLinear([a1, b1, c1, d1]: Quaternion, [a2, b2, c2, d2]: Quaternion): (t: number) => Quaternion;
11
+ static interpolate([a1, b1, c1, d1]: Quaternion, [a2, b2, c2, d2]: Quaternion): (t: number) => Quaternion;
7
12
  }
package/lib/Earth/util.js CHANGED
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable */
2
2
  // Code from: https://observablehq.com/@d3/world-tour
3
+
3
4
  export default class Util {
4
5
  static fromAngles([l, p, g]) {
5
6
  l *= Math.PI / 360;
@@ -1,21 +1,14 @@
1
- export function ErrorFallback({ error }: {
2
- error: any;
3
- }): import("react/jsx-runtime").JSX.Element;
4
- export namespace ErrorFallback {
5
- namespace propTypes {
6
- let error: PropTypes.Validator<Error>;
7
- }
1
+ export interface InternalErrorFallbackProps {
2
+ title?: string;
3
+ desc: string;
4
+ retryFunc?: (() => void) | null;
8
5
  }
9
- export function ErrorFallbackRetry({ error, resetErrorBoundary }: {
10
- error: any;
11
- resetErrorBoundary: any;
12
- }): import("react/jsx-runtime").JSX.Element;
13
- export namespace ErrorFallbackRetry {
14
- export namespace propTypes_1 {
15
- let error_1: PropTypes.Validator<Error>;
16
- export { error_1 as error };
17
- export let resetErrorBoundary: PropTypes.Validator<(...args: any[]) => any>;
18
- }
19
- export { propTypes_1 as propTypes };
6
+ export interface ErrorFallbackProps {
7
+ error: Error;
20
8
  }
21
- import PropTypes from 'prop-types';
9
+ export declare function ErrorFallback({ error }: ErrorFallbackProps): import("react/jsx-runtime").JSX.Element;
10
+ export interface ErrorFallbackRetryProps {
11
+ error: Error;
12
+ resetErrorBoundary: () => void;
13
+ }
14
+ export declare function ErrorFallbackRetry({ error, resetErrorBoundary }: ErrorFallbackRetryProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import { red } from '@mui/material/colors';
4
3
  import Button from '../Button';
5
4
  import { styled } from '../Theme';
6
5
  function InternalErrorFallback({
7
- title,
6
+ title = 'Something went wrong...',
8
7
  desc,
9
- retryFunc
8
+ retryFunc = null
10
9
  }) {
11
10
  return /*#__PURE__*/_jsxs(Root, {
12
11
  role: "alert",
@@ -23,15 +22,6 @@ function InternalErrorFallback({
23
22
  })]
24
23
  });
25
24
  }
26
- InternalErrorFallback.propTypes = {
27
- title: PropTypes.string,
28
- desc: PropTypes.string.isRequired,
29
- retryFunc: PropTypes.func
30
- };
31
- InternalErrorFallback.defaultProps = {
32
- title: 'Something went wrong...',
33
- retryFunc: null
34
- };
35
25
  export function ErrorFallback({
36
26
  error
37
27
  }) {
@@ -39,9 +29,6 @@ export function ErrorFallback({
39
29
  desc: error.message
40
30
  });
41
31
  }
42
- ErrorFallback.propTypes = {
43
- error: PropTypes.instanceOf(Error).isRequired
44
- };
45
32
  export function ErrorFallbackRetry({
46
33
  error,
47
34
  resetErrorBoundary
@@ -51,10 +38,6 @@ export function ErrorFallbackRetry({
51
38
  retryFunc: resetErrorBoundary
52
39
  });
53
40
  }
54
- ErrorFallbackRetry.propTypes = {
55
- error: PropTypes.instanceOf(Error).isRequired,
56
- resetErrorBoundary: PropTypes.func.isRequired
57
- };
58
41
  const Root = styled('div')`
59
42
  padding: 16px;
60
43
  border: 2px solid ${props => props.theme.palette.error.main};
@@ -1 +1 @@
1
- export * from "./fallback";
1
+ export * from './fallback';
@@ -1,27 +1,20 @@
1
- declare function Footer(props: any): import("react/jsx-runtime").JSX.Element;
1
+ export interface FooterProps {
2
+ dark?: false | true;
3
+ className?: string;
4
+ copyStart?: number | string;
5
+ brand?: string;
6
+ style?: React.CSSProperties;
7
+ addon?: React.ReactNode;
8
+ }
9
+ declare function Footer(props: FooterProps): import("react/jsx-runtime").JSX.Element;
2
10
  declare namespace Footer {
3
- namespace propTypes {
4
- let dark: PropTypes.Requireable<boolean>;
5
- let className: PropTypes.Requireable<string>;
6
- let copyStart: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
7
- let brand: PropTypes.Requireable<string>;
8
- let style: PropTypes.Requireable<object>;
9
- let addon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
10
- }
11
- namespace defaultProps {
12
- let dark_1: boolean;
13
- export { dark_1 as dark };
14
- let brand_1: string;
15
- export { brand_1 as brand };
16
- let copyStart_1: string;
17
- export { copyStart_1 as copyStart };
18
- let className_1: string;
19
- export { className_1 as className };
20
- let style_1: {};
21
- export { style_1 as style };
22
- let addon_1: null;
23
- export { addon_1 as addon };
24
- }
11
+ var defaultProps: {
12
+ dark: boolean;
13
+ className: string;
14
+ copyStart: string;
15
+ brand: string;
16
+ style: {};
17
+ addon: null;
18
+ };
25
19
  }
26
20
  export default Footer;
27
- import PropTypes from 'prop-types';
@@ -1,6 +1,5 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  /* eslint-disable react/no-unused-prop-types */
3
- import PropTypes from 'prop-types';
4
3
  import Typography from '@mui/material/Typography';
5
4
  import MuiContainer from '@mui/material/Container';
6
5
  import Box from '@mui/material/Box';
@@ -87,19 +86,11 @@ export default function Footer(props) {
87
86
  })]
88
87
  });
89
88
  }
90
- Footer.propTypes = {
91
- dark: PropTypes.bool,
92
- className: PropTypes.string,
93
- copyStart: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
94
- brand: PropTypes.string,
95
- style: PropTypes.object,
96
- addon: PropTypes.node
97
- };
98
89
  Footer.defaultProps = {
99
90
  dark: false,
100
- brand: 'ArcBlock',
101
- copyStart: '2017',
102
91
  className: '',
92
+ copyStart: '2017',
93
+ brand: 'ArcBlock',
103
94
  style: {},
104
95
  addon: null
105
96
  };
@@ -1,5 +1,5 @@
1
- import { type Breakpoint } from '@mui/material';
2
- export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
1
+ import { type BoxProps, type Breakpoint } from '@mui/material';
2
+ export interface HeaderProps extends Omit<BoxProps, 'maxWidth'> {
3
3
  /** logo img/svg, 可以包裹一个 a 标签 */
4
4
  logo?: React.ReactNode;
5
5
  /** 相当于 Title, 可以包裹一个 a 标签 */
@@ -1,9 +1,10 @@
1
- export interface ImageIconProps extends React.HTMLAttributes<HTMLDivElement> {
1
+ import { type ImgProps } from '../Img';
2
+ export interface ImageIconProps extends Omit<ImgProps, 'size' | 'src'> {
2
3
  name: string;
3
4
  size?: number;
4
5
  color?: string;
5
6
  alt?: string;
6
7
  prefix?: string;
7
- showBadge?: boolean;
8
+ showBadge?: false | true;
8
9
  }
9
10
  export default function ImageIcon({ name, size, alt, color, prefix, showBadge, style, ...rest }: ImageIconProps): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,12 @@
1
- export interface IconProps extends React.HTMLAttributes<HTMLElement> {
1
+ import { type SxProps } from '@mui/material';
2
+ export interface IconProps extends React.HTMLAttributes<HTMLDivElement> {
2
3
  name: string;
3
4
  color?: string;
4
5
  size?: number;
5
6
  variant?: 'light' | 'regular' | 'solid';
6
- rounded?: boolean;
7
- forwardedRef?: React.ForwardedRef<HTMLElement>;
7
+ rounded?: false | true;
8
+ forwardedRef?: React.ForwardedRef<HTMLDivElement>;
9
+ sx?: SxProps;
8
10
  }
9
- declare const _default: (props: IconProps & import("react").RefAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
11
+ declare const _default: (props: IconProps & import("react").RefAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
10
12
  export default _default;
@@ -19,7 +19,7 @@ export type ImgExProps = {
19
19
  onError?: Function | undefined;
20
20
  onSuccess?: Function | undefined;
21
21
  };
22
- export type ImgProps = ImgExProps & import("react").ComponentPropsWithoutRef<"div">;
22
+ export type ImgProps = ImgExProps & import("@mui/material").BoxProps;
23
23
  /**
24
24
  *
25
25
  * @param {ImgProps} props
package/lib/Img/index.js CHANGED
@@ -28,7 +28,7 @@ import noop from 'lodash/noop';
28
28
  */
29
29
 
30
30
  /**
31
- * @typedef {ImgExProps & import('react').ComponentPropsWithoutRef<"div">} ImgProps
31
+ * @typedef {ImgExProps & import('@mui/material').BoxProps} ImgProps
32
32
  */
33
33
 
34
34
  const PREFIX = 'Img';
@@ -1,33 +1,10 @@
1
- export default InfoRow;
2
- declare function InfoRow({ name, nameFormatter, layout, children, valueComponent, nameWidth, ...rest }: {
3
- [x: string]: any;
4
- name: any;
5
- nameFormatter: any;
6
- layout: any;
7
- children: any;
8
- valueComponent: any;
9
- nameWidth: any;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- declare namespace InfoRow {
12
- namespace propTypes {
13
- let name: PropTypes.Validator<any>;
14
- let layout: PropTypes.Requireable<string>;
15
- let children: PropTypes.Requireable<any>;
16
- let nameFormatter: PropTypes.Requireable<(...args: any[]) => any>;
17
- let valueComponent: PropTypes.Requireable<string>;
18
- let nameWidth: PropTypes.Requireable<number>;
19
- }
20
- namespace defaultProps {
21
- let children_1: null;
22
- export { children_1 as children };
23
- let nameWidth_1: number;
24
- export { nameWidth_1 as nameWidth };
25
- export function nameFormatter_1(name: any): any;
26
- export { nameFormatter_1 as nameFormatter };
27
- let valueComponent_1: string;
28
- export { valueComponent_1 as valueComponent };
29
- let layout_1: string;
30
- export { layout_1 as layout };
31
- }
1
+ export interface InfoRowProps {
2
+ name: React.ReactNode;
3
+ nameFormatter: (name: React.ReactNode) => React.ReactNode;
4
+ layout?: 'horizontal' | 'vertical';
5
+ children: React.ReactNode;
6
+ valueComponent?: React.ElementType;
7
+ nameWidth?: number;
32
8
  }
33
- import PropTypes from 'prop-types';
9
+ declare function InfoRow({ name, nameFormatter, layout, children, valueComponent, nameWidth, ...rest }: InfoRowProps): import("react/jsx-runtime").JSX.Element;
10
+ export default InfoRow;
@@ -1,16 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import camelCase from 'lodash/camelCase';
4
3
  import upperFirst from 'lodash/upperFirst';
5
4
  import Typography from '@mui/material/Typography';
6
5
  import { styled } from '../Theme';
7
6
  function InfoRow({
8
7
  name,
9
- nameFormatter,
10
- layout,
8
+ // eslint-disable-next-line no-shadow
9
+ nameFormatter = name => {
10
+ if (typeof name === 'string') {
11
+ return name.split(' ').map(x => upperFirst(camelCase(x))).join(' ');
12
+ }
13
+ return name;
14
+ },
15
+ layout = 'horizontal',
11
16
  children,
12
- valueComponent,
13
- nameWidth,
17
+ valueComponent = 'div',
18
+ nameWidth = 90,
14
19
  ...rest
15
20
  }) {
16
21
  return /*#__PURE__*/_jsxs(Container, {
@@ -29,24 +34,6 @@ function InfoRow({
29
34
  })]
30
35
  });
31
36
  }
32
- InfoRow.propTypes = {
33
- name: PropTypes.any.isRequired,
34
- layout: PropTypes.oneOf(['horizontal', 'vertical']),
35
- children: PropTypes.any,
36
- nameFormatter: PropTypes.func,
37
- valueComponent: PropTypes.string,
38
- nameWidth: PropTypes.number
39
- };
40
- InfoRow.defaultProps = {
41
- children: null,
42
- nameWidth: 90,
43
- nameFormatter: name => {
44
- const resetName = name.split(' ').map(x => upperFirst(camelCase(x))).join(' ');
45
- return typeof name === 'string' ? resetName : name;
46
- },
47
- valueComponent: 'div',
48
- layout: 'horizontal'
49
- };
50
37
  const Container = styled('div')`
51
38
  display: flex;
52
39
  flex-direction: ${props => props.layout === 'vertical' ? 'column' : 'row'};