@arcblock/ux 2.1.18 → 2.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ActionButton/index.js +16 -8
- package/lib/ActivityIndicator/index.js +49 -36
- package/lib/Alert/index.js +25 -17
- package/lib/AnimationWaiter/index.js +44 -35
- package/lib/Async/index.js +15 -3
- package/lib/Badge/index.js +14 -4
- package/lib/Blocklet/blocklet.js +81 -62
- package/lib/BlockletNFT/index.js +95 -76
- package/lib/Button/wrap.js +13 -9
- package/lib/Center/index.js +6 -5
- package/lib/ClickToCopy/index.js +31 -21
- package/lib/CodeBlock/index.js +35 -27
- package/lib/ContactForm/index.js +46 -41
- package/lib/CookieConsent/index.js +33 -21
- package/lib/CountDown/index.js +50 -34
- package/lib/Datatable/CustomToolbar.js +138 -97
- package/lib/Datatable/DatatableContext.js +9 -12
- package/lib/Datatable/TableSearch.js +44 -27
- package/lib/Datatable/index.js +44 -28
- package/lib/Dialog/confirm.js +26 -13
- package/lib/Dialog/dialog.js +42 -26
- package/lib/DriftBot/index.js +2 -2
- package/lib/Earth/index.js +121 -107
- package/lib/Empty/index.js +19 -10
- package/lib/ErrorBoundary/fallback.js +18 -12
- package/lib/Footer/index.js +32 -26
- package/lib/Header/header.js +37 -21
- package/lib/Header/responsive-header.js +40 -30
- package/lib/Icon/image.js +22 -15
- package/lib/Icon/index.js +17 -7
- package/lib/Img/index.js +34 -32
- package/lib/InfoRow/index.js +23 -13
- package/lib/Layout/dashboard/index.js +66 -54
- package/lib/Layout/dashboard/sidebar.js +39 -26
- package/lib/Layout/dashboard-legacy/header.js +56 -38
- package/lib/Layout/dashboard-legacy/index.js +54 -44
- package/lib/Layout/dashboard-legacy/sidebar.js +48 -38
- package/lib/Layout/index.js +147 -111
- package/lib/Locale/context.js +8 -10
- package/lib/Locale/selector.js +55 -41
- package/lib/Logo/index.js +50 -30
- package/lib/Metric/index.js +30 -23
- package/lib/NFTDisplay/aspect-ratio-container.js +15 -6
- package/lib/NFTDisplay/broken.js +3 -3
- package/lib/NFTDisplay/index.js +29 -28
- package/lib/NFTDisplay/loading.js +6 -5
- package/lib/NFTDisplay/svg-embedder/img.js +10 -4
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +14 -6
- package/lib/NavMenu/nav-menu.js +60 -49
- package/lib/PageScroller/index.js +29 -27
- package/lib/PageScroller/usePrevValue.js +1 -5
- package/lib/PricingTable/PricingPlan.js +46 -36
- package/lib/PricingTable/index.js +22 -20
- package/lib/QRCode/index.js +6 -9
- package/lib/RelativeTime/index.js +14 -5
- package/lib/Result/common.js +49 -44
- package/lib/Result/index.js +6 -6
- package/lib/Result/result.js +29 -18
- package/lib/Screenshot/index.js +32 -21
- package/lib/Spinner/index.js +3 -3
- package/lib/SplitButton/index.js +40 -24
- package/lib/Switch/index.js +12 -6
- package/lib/Tabs/index.js +18 -12
- package/lib/Tag/index.js +14 -4
- package/lib/Terminal/Player.js +108 -92
- package/lib/Terminal/index.js +3 -1
- package/lib/TextCollapse/index.js +18 -8
- package/lib/Toast/index.js +17 -14
- package/lib/Video/index.js +31 -25
- package/lib/Wallet/Action.js +37 -25
- package/lib/Wallet/Download.js +236 -181
- package/lib/Wallet/Open.js +6 -5
- package/lib/WechatPrompt/index.js +40 -28
- package/lib/withTheme/index.js +23 -9
- package/lib/withTracker/error_boundary.js +10 -7
- package/lib/withTracker/index.js +8 -4
- package/package.json +4 -4
- package/src/ActionButton/index.js +3 -4
- package/src/ActivityIndicator/index.js +4 -7
- package/src/Alert/index.js +4 -10
- package/src/AnimationWaiter/index.js +4 -2
- package/src/Async/index.js +4 -8
- package/src/Badge/index.js +2 -2
- package/src/Blocklet/blocklet.js +16 -27
- package/src/Blocklet/utils.js +3 -3
- package/src/BlockletNFT/index.js +7 -15
- package/src/Button/wrap.js +2 -2
- package/src/Center/index.js +0 -1
- package/src/ClickToCopy/index.js +5 -12
- package/src/CodeBlock/index.js +2 -7
- package/src/Colors/index.js +1 -0
- package/src/ContactForm/index.js +16 -16
- package/src/CookieConsent/index.js +3 -2
- package/src/CountDown/index.js +8 -8
- package/src/Datatable/CustomToolbar.js +8 -9
- package/src/Datatable/DatatableContext.js +3 -3
- package/src/Datatable/TableSearch.js +18 -13
- package/src/Datatable/index.js +13 -12
- package/src/Datatable/utils.js +19 -23
- package/src/Dialog/confirm.js +0 -1
- package/src/Dialog/dialog.js +7 -27
- package/src/Dialog/index.js +1 -0
- package/src/DriftBot/index.js +2 -2
- package/src/Earth/index.js +26 -44
- package/src/Empty/index.js +0 -1
- package/src/ErrorBoundary/fallback.js +2 -3
- package/src/Footer/index.js +3 -7
- package/src/Header/header.js +4 -5
- package/src/Header/responsive-header.js +4 -10
- package/src/Icon/image.js +0 -1
- package/src/Icon/index.js +8 -8
- package/src/Img/index.js +6 -6
- package/src/InfoRow/index.js +22 -21
- package/src/Layout/dashboard/index.js +9 -4
- package/src/Layout/dashboard/sidebar.js +4 -10
- package/src/Layout/dashboard-legacy/header.js +9 -15
- package/src/Layout/dashboard-legacy/index.js +4 -11
- package/src/Layout/dashboard-legacy/sidebar.js +7 -7
- package/src/Layout/index.js +12 -26
- package/src/Locale/browser-lang.js +2 -2
- package/src/Locale/context.js +7 -11
- package/src/Locale/selector.js +8 -8
- package/src/Logo/index.js +4 -6
- package/src/Metric/index.js +9 -10
- package/src/NFTDisplay/aspect-ratio-container.js +0 -1
- package/src/NFTDisplay/broken.js +0 -1
- package/src/NFTDisplay/index.js +10 -8
- package/src/NFTDisplay/loading.js +0 -1
- package/src/NFTDisplay/svg-embedder/img.js +1 -2
- package/src/NFTDisplay/svg-embedder/inline-svg.js +0 -1
- package/src/NavMenu/index.js +1 -0
- package/src/NavMenu/nav-menu.js +14 -27
- package/src/NavMenu/style.js +3 -3
- package/src/PageScroller/index.js +19 -35
- package/src/PageScroller/usePrevValue.js +1 -1
- package/src/PricingTable/PricingPlan.js +31 -30
- package/src/PricingTable/index.js +4 -5
- package/src/QRCode/index.js +3 -2
- package/src/RelativeTime/index.js +1 -5
- package/src/Result/common.js +19 -20
- package/src/Result/index.js +5 -6
- package/src/Result/result.js +2 -3
- package/src/Result/translations.js +1 -2
- package/src/Screenshot/index.js +10 -10
- package/src/Spinner/index.js +0 -1
- package/src/SplitButton/index.js +6 -19
- package/src/Switch/index.js +40 -41
- package/src/Tabs/index.js +2 -9
- package/src/Tag/index.js +2 -2
- package/src/Terminal/Player.js +7 -8
- package/src/Terminal/index.js +4 -3
- package/src/Terminal/util.js +3 -3
- package/src/TextCollapse/index.js +4 -10
- package/src/Theme/index.js +1 -8
- package/src/Toast/index.js +6 -10
- package/src/Util/index.js +15 -27
- package/src/Video/index.js +2 -8
- package/src/Wallet/Action.js +5 -6
- package/src/Wallet/Download.js +6 -7
- package/src/Wallet/Open.js +1 -2
- package/src/WechatPrompt/index.js +2 -7
- package/src/withTheme/index.js +5 -5
- package/src/withTracker/error_boundary.js +3 -3
- package/src/withTracker/index.js +2 -2
package/lib/Wallet/Open.js
CHANGED
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = OpenInWallet;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
9
|
|
|
12
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
@@ -15,6 +13,8 @@ var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useB
|
|
|
15
13
|
|
|
16
14
|
var _Fab = _interopRequireDefault(require("@mui/material/Fab"));
|
|
17
15
|
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
20
|
function OpenInWallet(_ref) {
|
|
@@ -27,15 +27,16 @@ function OpenInWallet(_ref) {
|
|
|
27
27
|
|
|
28
28
|
if (browser.mobile.any && !browser.wallet && !browser.wechat) {
|
|
29
29
|
const deepLink = "abt://abtwallet.io/i?action=requestOpenUrl&url=".concat(encodeURIComponent(link));
|
|
30
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
31
31
|
size: "small",
|
|
32
32
|
href: deepLink,
|
|
33
33
|
variant: "extended",
|
|
34
34
|
color: "primary",
|
|
35
35
|
rounded: true,
|
|
36
36
|
target: "_blank",
|
|
37
|
-
className: "open-in-wallet-button"
|
|
38
|
-
|
|
37
|
+
className: "open-in-wallet-button",
|
|
38
|
+
children: buttonText
|
|
39
|
+
});
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
return null;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = WechatPrompt;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
9
|
|
|
12
10
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
@@ -19,6 +17,8 @@ var _ios = _interopRequireDefault(require("./images/ios.png"));
|
|
|
19
17
|
|
|
20
18
|
var _android = _interopRequireDefault(require("./images/android.png"));
|
|
21
19
|
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
24
|
function WechatPrompt() {
|
|
@@ -33,36 +33,48 @@ function WechatPrompt() {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
if (browser.android) {
|
|
36
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
37
37
|
open: true,
|
|
38
|
-
fullScreen: true
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
fullScreen: true,
|
|
39
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
40
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
41
|
+
className: "wechat-title",
|
|
42
|
+
children: "1. \u8F7B\u89E6\u53F3\u4E0A\u65B9\u83DC\u5355"
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
44
|
+
className: "wechat-tip",
|
|
45
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
46
|
+
className: "wechat-tip-text",
|
|
47
|
+
children: "2. \u70B9\u51FB\u201C\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u201D\uFF0C\u624D\u80FD\u8C03\u8D77 DID \u94B1\u5305"
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
49
|
+
className: "wechat-tip-img",
|
|
50
|
+
src: _android.default,
|
|
51
|
+
alt: "Open in Android Browser"
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
});
|
|
50
56
|
}
|
|
51
57
|
|
|
52
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
53
59
|
open: true,
|
|
54
|
-
fullScreen: true
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
fullScreen: true,
|
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
62
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
63
|
+
className: "wechat-title",
|
|
64
|
+
children: "1. \u8F7B\u89E6\u53F3\u4E0A\u65B9\u83DC\u5355"
|
|
65
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
66
|
+
className: "wechat-tip",
|
|
67
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
68
|
+
className: "wechat-tip-text",
|
|
69
|
+
children: "2. \u70B9\u51FB\u201C\u5728Safari\u4E2D\u6253\u5F00\u201D\uFF0C\u624D\u80FD\u8C03\u8D77 DID \u94B1\u5305"
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
71
|
+
className: "wechat-tip-img",
|
|
72
|
+
src: _ios.default,
|
|
73
|
+
alt: "Open in Safari"
|
|
74
|
+
})]
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
});
|
|
66
78
|
}
|
|
67
79
|
|
|
68
80
|
const Container = _styledComponents.default.div.withConfig({
|
package/lib/withTheme/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _styledComponents = require("styled-components");
|
|
11
11
|
|
|
@@ -15,8 +15,20 @@ var _CssBaseline = _interopRequireDefault(require("@mui/material/CssBaseline"));
|
|
|
15
15
|
|
|
16
16
|
var _Theme = require("../Theme");
|
|
17
17
|
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
+
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
+
|
|
30
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
|
|
20
32
|
const GlobalStyle = (0, _styledComponents.createGlobalStyle)(["font-family:", ";color:", ";a,a:hover,a:active{text-decoration:none;color:", ";}a:hover{color:", ";}.section--latest-post{p:last-of-type{margin:0;}}.has-scrolled{.section--footnotes{position:static !important;transition-property:background-color;transition-duration:600ms;transition-timing-function:ease;.footnote__title{color:#fff;}}}"], props => props.theme.typography.fontFamily, props => props.theme.typography.color.main, props => props.theme.palette.primary.dark, props => props.theme.palette.primary.main);
|
|
21
33
|
|
|
22
34
|
function withTheme(Component) {
|
|
@@ -27,7 +39,7 @@ function withTheme(Component) {
|
|
|
27
39
|
typography
|
|
28
40
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29
41
|
|
|
30
|
-
class WithTheme extends
|
|
42
|
+
class WithTheme extends React.Component {
|
|
31
43
|
constructor(props) {
|
|
32
44
|
super(props);
|
|
33
45
|
this.theme = (0, _Theme.create)({
|
|
@@ -48,13 +60,15 @@ function withTheme(Component) {
|
|
|
48
60
|
}
|
|
49
61
|
|
|
50
62
|
render() {
|
|
51
|
-
return /*#__PURE__*/
|
|
52
|
-
theme: this.theme
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
|
|
64
|
+
theme: this.theme,
|
|
65
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CssBaseline.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalStyle, {
|
|
66
|
+
theme: this.theme
|
|
67
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.ThemeProvider, {
|
|
68
|
+
theme: this.theme,
|
|
69
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, this.props))
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
58
72
|
}
|
|
59
73
|
|
|
60
74
|
}
|
|
@@ -5,20 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
var Sentry = _interopRequireWildcard(require("@sentry/browser"));
|
|
11
11
|
|
|
12
12
|
var _Alert = _interopRequireDefault(require("../Alert"));
|
|
13
13
|
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
14
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
19
|
|
|
16
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
21
|
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
22
|
/* eslint-disable import/no-unresolved */
|
|
21
|
-
class ErrorBoundary extends _react.
|
|
23
|
+
class ErrorBoundary extends _react.Component {
|
|
22
24
|
constructor(props) {
|
|
23
25
|
super(props);
|
|
24
26
|
this.state = {
|
|
@@ -38,10 +40,11 @@ class ErrorBoundary extends _react.default.Component {
|
|
|
38
40
|
|
|
39
41
|
render() {
|
|
40
42
|
if (this.state.error) {
|
|
41
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
42
44
|
type: "error",
|
|
43
|
-
variant: "icon"
|
|
44
|
-
|
|
45
|
+
variant: "icon",
|
|
46
|
+
children: "Oops! We encountered an error, please try reload this application."
|
|
47
|
+
});
|
|
45
48
|
} // eslint-disable-next-line react/prop-types
|
|
46
49
|
|
|
47
50
|
|
package/lib/withTracker/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -17,12 +17,14 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
17
17
|
|
|
18
18
|
var _error_boundary = _interopRequireDefault(require("./error_boundary"));
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
23
|
|
|
24
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
25
|
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
26
28
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
29
|
|
|
28
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -80,10 +82,12 @@ var _default = function _default(WrappedComponent) {
|
|
|
80
82
|
|
|
81
83
|
render() {
|
|
82
84
|
if (process.env.NODE_ENV === 'production') {
|
|
83
|
-
return /*#__PURE__*/
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_error_boundary.default, {
|
|
86
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, _objectSpread({}, this.props))
|
|
87
|
+
});
|
|
84
88
|
}
|
|
85
89
|
|
|
86
|
-
return /*#__PURE__*/
|
|
90
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, _objectSpread({}, this.props));
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.21",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=18.1.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "ee49a5560e16fa5791cef6ab0cc5930c4f1c2cf5",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^2.1.
|
|
58
|
-
"@arcblock/react-hooks": "^2.1.
|
|
57
|
+
"@arcblock/icons": "^2.1.21",
|
|
58
|
+
"@arcblock/react-hooks": "^2.1.21",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@emotion/react": "^11.9.0",
|
|
61
61
|
"@emotion/styled": "^11.8.1",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
|
|
4
3
|
import Button from '../Button';
|
|
5
4
|
import { mergeProps } from '../Util';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
function ActionButton(props) {
|
|
8
7
|
const newProps = mergeProps(props, ActionButton);
|
|
9
8
|
const { href, icon, size, color, theme, variant, gradient, children, text, ...rest } = newProps;
|
|
10
9
|
const styles = {};
|
|
@@ -13,7 +12,7 @@ const ActionButton = props => {
|
|
|
13
12
|
styles.borderColor = 'transparent';
|
|
14
13
|
}
|
|
15
14
|
const attrs = ['color', 'border', 'width'];
|
|
16
|
-
attrs.forEach(x => {
|
|
15
|
+
attrs.forEach((x) => {
|
|
17
16
|
if (newProps[x]) {
|
|
18
17
|
styles[x] = newProps[x];
|
|
19
18
|
}
|
|
@@ -33,7 +32,7 @@ const ActionButton = props => {
|
|
|
33
32
|
{text || children}
|
|
34
33
|
</Button>
|
|
35
34
|
);
|
|
36
|
-
}
|
|
35
|
+
}
|
|
37
36
|
|
|
38
37
|
ActionButton.propTypes = {
|
|
39
38
|
href: PropTypes.string.isRequired,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { green, blue } from '@mui/material/colors';
|
|
@@ -91,16 +91,13 @@ const Div = styled.div`
|
|
|
91
91
|
}
|
|
92
92
|
`;
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
function Orbit({ size, orbitColor, atomColor, duration, ...rest }) {
|
|
95
95
|
return (
|
|
96
|
-
<OrbitRoot
|
|
97
|
-
$duration={duration}
|
|
98
|
-
style={{ width: size, height: size, border: `1px solid ${orbitColor}` }}
|
|
99
|
-
{...rest}>
|
|
96
|
+
<OrbitRoot $duration={duration} style={{ width: size, height: size, border: `1px solid ${orbitColor}` }} {...rest}>
|
|
100
97
|
<div style={{ background: atomColor }} />
|
|
101
98
|
</OrbitRoot>
|
|
102
99
|
);
|
|
103
|
-
}
|
|
100
|
+
}
|
|
104
101
|
|
|
105
102
|
Orbit.propTypes = {
|
|
106
103
|
size: PropTypes.number.isRequired,
|
package/src/Alert/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import Typography from '@mui/material/Typography';
|
|
@@ -35,7 +34,7 @@ const types = {
|
|
|
35
34
|
},
|
|
36
35
|
};
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
function Alert(props) {
|
|
39
38
|
const newProps = mergeProps(props, Alert, ['style']);
|
|
40
39
|
const { type, children, style, className, variant, ...rest } = newProps;
|
|
41
40
|
const { icon, color, backgroundColor, borderColor } = types[type] || types.success;
|
|
@@ -49,19 +48,14 @@ const Alert = props => {
|
|
|
49
48
|
);
|
|
50
49
|
|
|
51
50
|
return (
|
|
52
|
-
<Container
|
|
53
|
-
{
|
|
54
|
-
className={`alert alert--${type} alert--${variant} ${className}`.trim()}
|
|
55
|
-
style={styles}>
|
|
56
|
-
{variant === 'icon' && (
|
|
57
|
-
<Icon className="alert-icon" name={icon} size={24} style={{ color }} />
|
|
58
|
-
)}
|
|
51
|
+
<Container {...rest} className={`alert alert--${type} alert--${variant} ${className}`.trim()} style={styles}>
|
|
52
|
+
{variant === 'icon' && <Icon className="alert-icon" name={icon} size={24} style={{ color }} />}
|
|
59
53
|
<Typography component="div" className="alert-content">
|
|
60
54
|
{children}
|
|
61
55
|
</Typography>
|
|
62
56
|
</Container>
|
|
63
57
|
);
|
|
64
|
-
}
|
|
58
|
+
}
|
|
65
59
|
|
|
66
60
|
Alert.propTypes = {
|
|
67
61
|
type: PropTypes.oneOf(Object.keys(types)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import Lottie from 'react-lottie-player';
|
|
@@ -66,6 +66,7 @@ export default function AnimationWaiter({
|
|
|
66
66
|
return () => {
|
|
67
67
|
clearInterval(timer);
|
|
68
68
|
};
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
70
|
}, [message, messageDuration]);
|
|
70
71
|
|
|
71
72
|
// tips
|
|
@@ -103,9 +104,10 @@ export default function AnimationWaiter({
|
|
|
103
104
|
}, 1000);
|
|
104
105
|
|
|
105
106
|
return () => clearTimeout(timer);
|
|
107
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
106
108
|
}, [currentSpeed]);
|
|
107
109
|
|
|
108
|
-
const getMsgClassName = index => {
|
|
110
|
+
const getMsgClassName = (index) => {
|
|
109
111
|
let className = 'message-before';
|
|
110
112
|
if (messageId === index) {
|
|
111
113
|
className = 'show-message';
|
package/src/Async/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
4
4
|
|
|
@@ -15,8 +15,8 @@ export default function LoadAsyncComponent(importComponent, key = 'default', sho
|
|
|
15
15
|
|
|
16
16
|
componentDidMount() {
|
|
17
17
|
importComponent()
|
|
18
|
-
.then(asyncModule => this.setState({ Component: asyncModule[key] }))
|
|
19
|
-
.catch(err => this.setState({ error: `Failed to load async component: ${err.message}` }));
|
|
18
|
+
.then((asyncModule) => this.setState({ Component: asyncModule[key] }))
|
|
19
|
+
.catch((err) => this.setState({ error: `Failed to load async component: ${err.message}` }));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
render() {
|
|
@@ -27,11 +27,7 @@ export default function LoadAsyncComponent(importComponent, key = 'default', sho
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// eslint-disable-next-line no-nested-ternary
|
|
30
|
-
return Component ?
|
|
31
|
-
<Component {...this.props} />
|
|
32
|
-
) : showProgress ? (
|
|
33
|
-
<CircularProgress color="primary" />
|
|
34
|
-
) : null;
|
|
30
|
+
return Component ? <Component {...this.props} /> : showProgress ? <CircularProgress color="primary" /> : null;
|
|
35
31
|
}
|
|
36
32
|
}
|
|
37
33
|
|
package/src/Badge/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
@@ -57,7 +57,7 @@ Badge.defaultProps = {
|
|
|
57
57
|
style: '{}',
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
export default
|
|
60
|
+
export default forwardRef((props, ref) => <Badge {...props} forwardedRef={ref} />);
|
|
61
61
|
|
|
62
62
|
const Span = styled(Typography)`
|
|
63
63
|
&& {
|
package/src/Blocklet/blocklet.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import Typography from '@mui/material/Typography';
|
|
@@ -12,25 +11,25 @@ import Img from '../Img';
|
|
|
12
11
|
|
|
13
12
|
const Div = styled.div`
|
|
14
13
|
&.arcblock-blocklet {
|
|
15
|
-
padding: ${props => props.theme.spacing(2)} ${props => props.theme.spacing(2)} 0
|
|
16
|
-
${props => props.theme.spacing(2)};
|
|
14
|
+
padding: ${(props) => props.theme.spacing(2)} ${(props) => props.theme.spacing(2)} 0
|
|
15
|
+
${(props) => props.theme.spacing(2)};
|
|
17
16
|
}
|
|
18
17
|
.arcblock-blocklet__content {
|
|
19
18
|
cursor: pointer;
|
|
20
19
|
display: flex;
|
|
21
|
-
${props => props.theme.breakpoints.up('sm')} {
|
|
20
|
+
${(props) => props.theme.breakpoints.up('sm')} {
|
|
22
21
|
align-items: center;
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
.arcblock-blocklet__cover {
|
|
26
25
|
width: 64px;
|
|
27
26
|
height: 64px;
|
|
28
|
-
margin-right: ${props => props.theme.spacing(2)};
|
|
27
|
+
margin-right: ${(props) => props.theme.spacing(2)};
|
|
29
28
|
overflow: hidden;
|
|
30
29
|
border-radius: 12px;
|
|
31
30
|
/* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
|
|
32
31
|
transform: translateZ(0);
|
|
33
|
-
${props => props.theme.breakpoints.up('sm')} {
|
|
32
|
+
${(props) => props.theme.breakpoints.up('sm')} {
|
|
34
33
|
width: 80px;
|
|
35
34
|
height: 80px;
|
|
36
35
|
margin-bottom: 12px;
|
|
@@ -57,7 +56,7 @@ const Div = styled.div`
|
|
|
57
56
|
position: absolute;
|
|
58
57
|
height: 100%;
|
|
59
58
|
width: 100%;
|
|
60
|
-
background-color: ${props => props.theme.palette.primary.main};
|
|
59
|
+
background-color: ${(props) => props.theme.palette.primary.main};
|
|
61
60
|
transform: scale(0.1);
|
|
62
61
|
opacity: 0;
|
|
63
62
|
z-index: -1;
|
|
@@ -72,19 +71,19 @@ const Div = styled.div`
|
|
|
72
71
|
|
|
73
72
|
&:not(.Mui-disabled) {
|
|
74
73
|
background-color: transparent !important;
|
|
75
|
-
color: ${props => props.theme.palette.primary.main};
|
|
74
|
+
color: ${(props) => props.theme.palette.primary.main};
|
|
76
75
|
}
|
|
77
76
|
&:not(.Mui-disabled) {
|
|
78
77
|
&:hover {
|
|
79
|
-
color: ${props => props.theme.palette.common.white};
|
|
78
|
+
color: ${(props) => props.theme.palette.common.white};
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
.arcblock-blocklet__info {
|
|
84
83
|
flex: 1;
|
|
85
84
|
overflow: hidden;
|
|
86
|
-
border-bottom: 1px solid ${props => props.theme.palette.divider};
|
|
87
|
-
padding-bottom: ${props => props.theme.spacing(2)};
|
|
85
|
+
border-bottom: 1px solid ${(props) => props.theme.palette.divider};
|
|
86
|
+
padding-bottom: ${(props) => props.theme.spacing(2)};
|
|
88
87
|
}
|
|
89
88
|
.arcblock-blocklet__text {
|
|
90
89
|
height: 57px;
|
|
@@ -100,8 +99,8 @@ const Div = styled.div`
|
|
|
100
99
|
white-space: nowrap;
|
|
101
100
|
}
|
|
102
101
|
.arcblock-blocklet__describe {
|
|
103
|
-
margin-top: ${props => props.theme.spacing(0.5)};
|
|
104
|
-
color: ${props => props.theme.palette.grey[600]};
|
|
102
|
+
margin-top: ${(props) => props.theme.spacing(0.5)};
|
|
103
|
+
color: ${(props) => props.theme.palette.grey[600]};
|
|
105
104
|
font-size: 14px;
|
|
106
105
|
font-weight: 500;
|
|
107
106
|
line-height: 17px;
|
|
@@ -114,7 +113,7 @@ const Div = styled.div`
|
|
|
114
113
|
word-break: break-word;
|
|
115
114
|
}
|
|
116
115
|
.arcblock-blocklet__version {
|
|
117
|
-
color: ${props => props.theme.palette.grey[600]};
|
|
116
|
+
color: ${(props) => props.theme.palette.grey[600]};
|
|
118
117
|
font-size: 12px;
|
|
119
118
|
}
|
|
120
119
|
`;
|
|
@@ -173,19 +172,11 @@ export default function BlockletStore({
|
|
|
173
172
|
)}
|
|
174
173
|
<div className="arcblock-blocklet__info">
|
|
175
174
|
<div className="arcblock-blocklet__text">
|
|
176
|
-
<Typography
|
|
177
|
-
component="h3"
|
|
178
|
-
variant="h3"
|
|
179
|
-
className="arcblock-blocklet__title"
|
|
180
|
-
title={title}>
|
|
175
|
+
<Typography component="h3" variant="h3" className="arcblock-blocklet__title" title={title}>
|
|
181
176
|
{title}
|
|
182
177
|
</Typography>
|
|
183
178
|
{description && (
|
|
184
|
-
<Typography
|
|
185
|
-
component="div"
|
|
186
|
-
variant="body2"
|
|
187
|
-
className="arcblock-blocklet__describe"
|
|
188
|
-
title={description}>
|
|
179
|
+
<Typography component="div" variant="body2" className="arcblock-blocklet__describe" title={description}>
|
|
189
180
|
{description}
|
|
190
181
|
</Typography>
|
|
191
182
|
)}
|
|
@@ -212,9 +203,7 @@ export default function BlockletStore({
|
|
|
212
203
|
minWidth: '92px',
|
|
213
204
|
textAlign: 'center',
|
|
214
205
|
}}>
|
|
215
|
-
{buttonLoading &&
|
|
216
|
-
<CircularProgress size={15} style={{ marginRight: 3, color: 'inherit' }} />
|
|
217
|
-
)}
|
|
206
|
+
{buttonLoading && <CircularProgress size={15} style={{ marginRight: 3, color: 'inherit' }} />}
|
|
218
207
|
{buttonText}
|
|
219
208
|
</Button>
|
|
220
209
|
))}
|
package/src/Blocklet/utils.js
CHANGED
|
@@ -25,7 +25,7 @@ const ActionButton = styled.div`
|
|
|
25
25
|
top: 0;
|
|
26
26
|
left: 0;
|
|
27
27
|
border-radius: 2px;
|
|
28
|
-
background-color: ${props => props.theme.palette.primary.main};
|
|
28
|
+
background-color: ${(props) => props.theme.palette.primary.main};
|
|
29
29
|
transform: scale(0.1);
|
|
30
30
|
opacity: 0;
|
|
31
31
|
z-index: -1;
|
|
@@ -39,11 +39,11 @@ const ActionButton = styled.div`
|
|
|
39
39
|
}
|
|
40
40
|
& > :not(.Mui-disabled) {
|
|
41
41
|
background-color: transparent !important;
|
|
42
|
-
color: ${props => props.theme.palette.primary.main}!important;
|
|
42
|
+
color: ${(props) => props.theme.palette.primary.main}!important;
|
|
43
43
|
}
|
|
44
44
|
& > :not(.Mui-disabled) {
|
|
45
45
|
&:hover {
|
|
46
|
-
color: ${props => props.theme.palette.common.white}!important;
|
|
46
|
+
color: ${(props) => props.theme.palette.common.white}!important;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
`;
|