@arcblock/ux 1.1.27 → 1.6.59
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/LICENSE +1 -1
- package/README.md +0 -56
- package/lib/ActionButton/index.js +5 -3
- package/lib/ActivityIndicator/index.js +75 -23
- package/lib/Alert/index.js +15 -11
- package/lib/Async/index.js +1 -1
- package/lib/Badge/index.js +16 -14
- package/lib/Blocklet/index.js +51 -25
- package/lib/Button/wrap.js +94 -37
- package/lib/ButtonGroup/index.js +3 -16
- package/lib/Center/index.js +30 -4
- package/lib/ClickToCopy/index.js +9 -7
- package/lib/CodeBlock/index.js +35 -8
- package/lib/Colors/index.js +15 -0
- package/lib/Colors/themes/default.js +85 -0
- package/lib/ContactForm/index.js +9 -9
- package/lib/CookieConsent/index.js +98 -0
- package/lib/CountDown/index.js +18 -14
- package/lib/Dialog/confirm.js +84 -0
- package/lib/Dialog/dialog.js +137 -0
- package/lib/Dialog/index.js +23 -0
- package/lib/Earth/index.js +31 -31
- package/lib/Empty/index.js +14 -6
- package/lib/Footer/index.js +15 -14
- package/lib/Icon/image.js +6 -4
- package/lib/Icon/index.js +9 -7
- package/lib/Img/index.js +22 -16
- package/lib/InfoRow/index.js +7 -5
- package/lib/Layout/dashboard/header.js +27 -19
- package/lib/Layout/dashboard/index.js +29 -18
- package/lib/Layout/dashboard/sidebar.js +22 -15
- package/lib/Layout/index.js +44 -33
- package/lib/Locale/context.js +91 -62
- package/lib/Locale/selector.js +28 -20
- package/lib/Logo/index.js +15 -13
- package/lib/Metric/index.js +5 -5
- package/lib/NFTDisplay/aspect-ratio-container.js +7 -5
- package/lib/NFTDisplay/broken.js +1 -1
- package/lib/NFTDisplay/index.js +66 -40
- package/lib/NFTDisplay/loading.js +2 -2
- package/lib/NFTDisplay/svg-embedder/img.js +5 -3
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +6 -4
- package/lib/PageScroller/index.js +9 -9
- package/lib/PageScroller/usePrevValue.js +2 -2
- package/lib/PricingTable/PricingPlan.js +12 -12
- package/lib/PricingTable/index.js +5 -5
- package/lib/Result/common.js +176 -0
- package/lib/Result/index.js +61 -0
- package/lib/Result/result.js +69 -0
- package/lib/Result/translations.js +61 -0
- package/lib/Screenshot/index.js +14 -12
- package/lib/Spinner/index.js +37 -0
- package/lib/SplitButton/index.js +126 -0
- package/lib/Switch/index.js +107 -0
- package/lib/Tabs/index.js +15 -6
- package/lib/Tag/index.js +14 -12
- package/lib/Terminal/Player.js +42 -42
- package/lib/Terminal/index.js +3 -1
- package/lib/Terminal/util.js +1 -1
- package/lib/TextCollapse/index.js +6 -4
- package/lib/Theme/index.js +79 -60
- package/lib/Theme/responsiveFontSizes.js +3 -3
- package/lib/Toast/index.js +10 -8
- package/lib/Util/index.js +83 -12
- package/lib/Video/index.js +8 -8
- package/lib/Wallet/Action.js +13 -11
- package/lib/Wallet/Download.js +59 -57
- package/lib/Wallet/Open.js +1 -1
- package/lib/WechatPrompt/index.js +10 -10
- package/lib/index.js +6 -6
- package/lib/withTheme/index.js +5 -17
- package/lib/withTracker/error_boundary.js +3 -3
- package/lib/withTracker/index.js +6 -6
- package/package.json +11 -12
- package/src/ActionButton/index.js +65 -0
- package/src/ActivityIndicator/index.js +141 -0
- package/src/Alert/index.js +104 -0
- package/src/Async/index.js +39 -0
- package/src/Badge/index.js +71 -0
- package/src/Blocklet/index.js +424 -0
- package/src/Button/index.js +4 -0
- package/src/Button/wrap.js +101 -0
- package/src/ButtonGroup/index.js +6 -0
- package/src/Center/index.js +40 -0
- package/src/ClickToCopy/index.js +90 -0
- package/src/CodeBlock/index.js +160 -0
- package/src/Colors/index.js +1 -0
- package/src/Colors/themes/default.js +54 -0
- package/src/ContactForm/index.js +240 -0
- package/src/CookieConsent/index.js +90 -0
- package/src/CountDown/index.js +151 -0
- package/src/Dialog/confirm.js +76 -0
- package/src/Dialog/dialog.js +162 -0
- package/src/Dialog/index.js +2 -0
- package/src/DriftBot/index.js +81 -0
- package/src/Earth/countries.json +8057 -0
- package/src/Earth/index.js +511 -0
- package/src/Earth/util.js +69 -0
- package/src/Empty/index.js +41 -0
- package/src/Footer/index.js +110 -0
- package/src/Icon/image.js +55 -0
- package/src/Icon/index.js +69 -0
- package/src/Img/index.js +172 -0
- package/src/InfoRow/index.js +83 -0
- package/src/Layout/dashboard/header.js +157 -0
- package/src/Layout/dashboard/index.js +150 -0
- package/src/Layout/dashboard/sidebar.js +122 -0
- package/src/Layout/index.js +318 -0
- package/src/Locale/browser-lang.js +63 -0
- package/src/Locale/context.js +94 -0
- package/src/Locale/images/globe-dark.png +0 -0
- package/src/Locale/images/globe-light.png +0 -0
- package/src/Locale/selector.js +135 -0
- package/src/Logo/images/logo-dark-text.svg +3 -0
- package/src/Logo/images/logo-dark-top.svg +6 -0
- package/src/Logo/images/logo-light-text.svg +3 -0
- package/src/Logo/images/logo-light-top.svg +6 -0
- package/src/Logo/index.js +47 -0
- package/src/Metric/index.js +115 -0
- package/src/NFTDisplay/README.md +59 -0
- package/src/NFTDisplay/aspect-ratio-container.js +34 -0
- package/src/NFTDisplay/broken.js +18 -0
- package/src/NFTDisplay/index.js +257 -0
- package/src/NFTDisplay/loading.js +17 -0
- package/src/NFTDisplay/svg-embedder/img.js +36 -0
- package/src/NFTDisplay/svg-embedder/inline-svg.js +37 -0
- package/src/PageScroller/index.js +342 -0
- package/src/PageScroller/usePrevValue.js +12 -0
- package/src/PricingTable/PricingPlan.js +112 -0
- package/src/PricingTable/index.js +43 -0
- package/src/Result/common.js +116 -0
- package/src/Result/index.js +31 -0
- package/src/Result/result.js +57 -0
- package/src/Result/translations.js +56 -0
- package/src/Screenshot/devices.css +1366 -0
- package/src/Screenshot/index.js +181 -0
- package/src/Spinner/index.js +19 -0
- package/src/SplitButton/index.js +112 -0
- package/src/Switch/index.js +78 -0
- package/src/Tabs/index.js +46 -0
- package/src/Tag/index.js +73 -0
- package/src/Terminal/Player.js +364 -0
- package/src/Terminal/index.js +150 -0
- package/src/Terminal/player.css +378 -0
- package/src/Terminal/util.js +167 -0
- package/src/Terminal/xterm.css +171 -0
- package/src/TextCollapse/index.js +92 -0
- package/src/Theme/index.js +184 -0
- package/src/Theme/responsiveFontSizes.js +94 -0
- package/src/Toast/index.js +118 -0
- package/src/Util/index.js +281 -0
- package/src/Video/index.js +72 -0
- package/src/Wallet/Action.js +105 -0
- package/src/Wallet/Download.js +130 -0
- package/src/Wallet/Open.js +50 -0
- package/src/Wallet/images/abtwallet.png +0 -0
- package/src/Wallet/images/android_download.svg +23 -0
- package/src/Wallet/images/app-store.svg +20 -0
- package/src/Wallet/images/google-play.svg +70 -0
- package/src/WechatPrompt/images/android.png +0 -0
- package/src/WechatPrompt/images/ios.png +0 -0
- package/src/WechatPrompt/index.js +81 -0
- package/src/index.js +63 -0
- package/src/withTheme/index.js +72 -0
- package/src/withTracker/README.md +34 -0
- package/src/withTracker/error_boundary.js +34 -0
- package/src/withTracker/index.js +70 -0
- package/lib/GraphQLPlayground/graphiql.css +0 -1850
- package/lib/GraphQLPlayground/index.js +0 -299
- package/lib/GraphQLPlayground/util.js +0 -55
package/lib/Theme/index.js
CHANGED
|
@@ -3,85 +3,83 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.create =
|
|
6
|
+
exports.create = void 0;
|
|
7
7
|
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
9
|
|
|
10
|
+
require("@fontsource/lato/400.css");
|
|
11
|
+
|
|
12
|
+
require("@fontsource/lato/700.css");
|
|
13
|
+
|
|
10
14
|
var _responsiveFontSizes = _interopRequireDefault(require("./responsiveFontSizes"));
|
|
11
15
|
|
|
16
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
17
|
+
|
|
18
|
+
const _excluded = ["mode", "pageWidth", "palette", "typography", "overrides"];
|
|
19
|
+
|
|
12
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
dark: '#4A707C',
|
|
18
|
-
gray: '#222222',
|
|
19
|
-
minor: '#9B9B9B',
|
|
20
|
-
darkText: '#DCDCDC',
|
|
21
|
-
background: '#F7F8F8',
|
|
22
|
-
yellow: '#FFCF71',
|
|
23
|
-
green: '#44cdc6',
|
|
24
|
-
red: '#D0021B',
|
|
25
|
-
blue: '#4E6AF6',
|
|
26
|
-
primary: '#222222',
|
|
27
|
-
black: '#222222',
|
|
28
|
-
secondary: '#44cdc6',
|
|
29
|
-
mint: '#44cdc6',
|
|
30
|
-
textSecondary: '#4A4A4A',
|
|
31
|
-
active: '#5b9025',
|
|
32
|
-
danger: '#D0021B',
|
|
33
|
-
lightGrey: '#BCBCBC'
|
|
34
|
-
}; // https://material-ui.com/customization/default-theme/
|
|
35
|
-
|
|
36
|
-
exports.colors = colors;
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
37
25
|
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
32
|
+
// https://material-ui.com/customization/default-theme/
|
|
33
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
38
34
|
const create = function create() {
|
|
39
|
-
let {
|
|
35
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
36
|
+
{
|
|
40
37
|
mode = 'light',
|
|
41
38
|
pageWidth = 'md',
|
|
42
39
|
palette,
|
|
43
40
|
typography,
|
|
44
41
|
overrides
|
|
45
|
-
} =
|
|
46
|
-
|
|
42
|
+
} = _ref,
|
|
43
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
+
|
|
45
|
+
const theme = (0, _styles.createTheme)(_objectSpread({
|
|
47
46
|
themeName: 'ArcBlock',
|
|
48
|
-
palette: Object.assign({
|
|
49
|
-
primary: {
|
|
50
|
-
main: colors.blue,
|
|
51
|
-
contrastText: colors.white
|
|
52
|
-
},
|
|
53
|
-
secondary: {
|
|
54
|
-
main: colors.mint,
|
|
55
|
-
contrastText: colors.white
|
|
56
|
-
},
|
|
57
|
-
danger: {
|
|
58
|
-
main: colors.danger,
|
|
59
|
-
contrastText: colors.white
|
|
60
|
-
},
|
|
61
|
-
text: {
|
|
62
|
-
primary: '#404040',
|
|
63
|
-
contrast: colors.white
|
|
64
|
-
},
|
|
47
|
+
palette: Object.assign(_objectSpread(_objectSpread({}, _Colors.default), {}, {
|
|
65
48
|
background: {
|
|
66
|
-
paper: mode === 'light' ?
|
|
67
|
-
default: mode === 'light' ?
|
|
49
|
+
paper: mode === 'light' ? _Colors.default.common.white : _Colors.default.grey[900],
|
|
50
|
+
default: mode === 'light' ? _Colors.default.background.default : _Colors.default.grey[900]
|
|
68
51
|
},
|
|
69
52
|
type: mode
|
|
70
|
-
}, palette || {}),
|
|
53
|
+
}), palette || {}),
|
|
71
54
|
typography: Object.assign({
|
|
72
55
|
useNextVariants: true,
|
|
73
56
|
color: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
// 此处 #222222 必须硬编码, layout/sidebar.js -> Icon/image 加载图片时 color 会影响加载路径
|
|
58
|
+
// TODO: 此处硬编码的色值后面需要改为 colors.grey[900],
|
|
59
|
+
// 或者如果可以的话直接删掉 typography#color, 文本颜色建议使用 theme.palette.text 中的色值?
|
|
60
|
+
// layout 组件建议重构, sidebar 中建议使用 icon 替换 img (#366)
|
|
61
|
+
main: mode === 'light' ? '#222222' : _Colors.default.common.white,
|
|
62
|
+
gray: mode === 'light' ? _Colors.default.grey[500] : _Colors.default.grey[300]
|
|
77
63
|
},
|
|
78
|
-
|
|
79
|
-
|
|
64
|
+
fontFamily: ['Lato', 'Avenir', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(','),
|
|
65
|
+
// 按最新设计规范, 只使用 400/700
|
|
66
|
+
fontWeightLight: 400,
|
|
67
|
+
fontWeightRegular: 400,
|
|
68
|
+
fontWeightMedium: 700,
|
|
69
|
+
fontWeightBold: 700,
|
|
70
|
+
// button 默认使用粗体
|
|
71
|
+
button: {
|
|
72
|
+
fontWeight: 700
|
|
73
|
+
}
|
|
80
74
|
}, typography || {}),
|
|
81
75
|
overrides: Object.assign({
|
|
82
76
|
MuiButton: {
|
|
83
77
|
root: {
|
|
84
|
-
|
|
78
|
+
boxShadow: 'none'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
MuiButtonGroup: {
|
|
82
|
+
contained: {
|
|
85
83
|
boxShadow: 'none'
|
|
86
84
|
}
|
|
87
85
|
},
|
|
@@ -92,7 +90,7 @@ const create = function create() {
|
|
|
92
90
|
},
|
|
93
91
|
MuiToolbar: {
|
|
94
92
|
root: {
|
|
95
|
-
background: mode === 'light' ?
|
|
93
|
+
background: mode === 'light' ? _Colors.default.background.default : _Colors.default.grey[900]
|
|
96
94
|
}
|
|
97
95
|
},
|
|
98
96
|
MuiTableCell: {
|
|
@@ -105,10 +103,10 @@ const create = function create() {
|
|
|
105
103
|
},
|
|
106
104
|
head: {
|
|
107
105
|
textTransform: 'uppercase',
|
|
108
|
-
color: mode === 'light' ?
|
|
106
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
109
107
|
},
|
|
110
108
|
body: {
|
|
111
|
-
color: mode === 'light' ?
|
|
109
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
112
110
|
}
|
|
113
111
|
},
|
|
114
112
|
MuiChip: {
|
|
@@ -131,17 +129,38 @@ const create = function create() {
|
|
|
131
129
|
},
|
|
132
130
|
MuiTypography: {
|
|
133
131
|
body1: {
|
|
134
|
-
color: mode === 'light' ?
|
|
132
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
135
133
|
},
|
|
136
134
|
body2: {
|
|
137
|
-
color: mode === 'light' ?
|
|
135
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
138
|
}, overrides || {}),
|
|
141
139
|
pageWidth,
|
|
142
|
-
colors,
|
|
140
|
+
// TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
|
|
141
|
+
// 可以从 Colors 模块/theme.palette/mui colors 中取值
|
|
142
|
+
colors: {
|
|
143
|
+
white: '#FFFFFF',
|
|
144
|
+
dark: '#4A707C',
|
|
145
|
+
gray: '#222222',
|
|
146
|
+
minor: '#9B9B9B',
|
|
147
|
+
darkText: '#DCDCDC',
|
|
148
|
+
background: '#F7F8F8',
|
|
149
|
+
yellow: '#FFCF71',
|
|
150
|
+
green: '#44cdc6',
|
|
151
|
+
red: '#D0021B',
|
|
152
|
+
blue: '#4E6AF6',
|
|
153
|
+
primary: '#222222',
|
|
154
|
+
black: '#222222',
|
|
155
|
+
secondary: '#44cdc6',
|
|
156
|
+
mint: '#44cdc6',
|
|
157
|
+
textSecondary: '#4A4A4A',
|
|
158
|
+
active: '#5b9025',
|
|
159
|
+
danger: '#D0021B',
|
|
160
|
+
lightGrey: '#BCBCBC'
|
|
161
|
+
},
|
|
143
162
|
mode
|
|
144
|
-
});
|
|
163
|
+
}, rest));
|
|
145
164
|
const enhanced = (0, _responsiveFontSizes.default)(theme, {
|
|
146
165
|
breakpoints: ['xs', 'sm', 'md', 'lg'],
|
|
147
166
|
disableAlign: false,
|
|
@@ -7,9 +7,9 @@ exports.default = responsiveFontSizes;
|
|
|
7
7
|
|
|
8
8
|
var _cssUtils = require("@material-ui/core/styles/cssUtils");
|
|
9
9
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
10
|
+
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; }
|
|
11
11
|
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
12
|
+
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; }
|
|
13
13
|
|
|
14
14
|
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; }
|
|
15
15
|
|
|
@@ -70,7 +70,7 @@ function responsiveFontSizes(themeInput) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
typography[variant] = _objectSpread({}, style,
|
|
73
|
+
typography[variant] = _objectSpread(_objectSpread({}, style), (0, _cssUtils.responsiveProperty)({
|
|
74
74
|
cssProperty: 'fontSize',
|
|
75
75
|
min: minFontSize,
|
|
76
76
|
max: maxFontSize,
|
package/lib/Toast/index.js
CHANGED
|
@@ -29,6 +29,8 @@ var _colors = require("@material-ui/core/colors");
|
|
|
29
29
|
|
|
30
30
|
var _styles = require("@material-ui/core/styles");
|
|
31
31
|
|
|
32
|
+
const _excluded = ["className", "message", "onClose", "variant"];
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -76,23 +78,23 @@ function SnackbarContentWrapper(props) {
|
|
|
76
78
|
onClose,
|
|
77
79
|
variant
|
|
78
80
|
} = props,
|
|
79
|
-
rest = _objectWithoutProperties(props,
|
|
81
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
80
82
|
|
|
81
83
|
const Icon = variantIcon[variant];
|
|
82
|
-
return _react.default.createElement(_SnackbarContent.default, Object.assign({
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement(_SnackbarContent.default, Object.assign({
|
|
83
85
|
className: [classes[variant], className].join(' ').trim(),
|
|
84
|
-
message: _react.default.createElement("span", {
|
|
86
|
+
message: /*#__PURE__*/_react.default.createElement("span", {
|
|
85
87
|
id: "client-snackbar",
|
|
86
88
|
className: classes.message
|
|
87
|
-
}, _react.default.createElement(Icon, {
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
88
90
|
className: [classes.icon, classes.iconVariant].join(' ').trim()
|
|
89
91
|
}), message),
|
|
90
|
-
action: [_react.default.createElement(_IconButton.default, {
|
|
92
|
+
action: [/*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
91
93
|
key: "close",
|
|
92
94
|
"aria-label": "close",
|
|
93
95
|
color: "inherit",
|
|
94
96
|
onClick: onClose
|
|
95
|
-
}, _react.default.createElement(_Close.default, {
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_Close.default, {
|
|
96
98
|
className: classes.icon
|
|
97
99
|
}))]
|
|
98
100
|
}, rest));
|
|
@@ -128,7 +130,7 @@ function Toast(_ref) {
|
|
|
128
130
|
onClose();
|
|
129
131
|
};
|
|
130
132
|
|
|
131
|
-
return _react.default.createElement(_Snackbar.default, {
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement(_Snackbar.default, {
|
|
132
134
|
open: open,
|
|
133
135
|
anchorOrigin: {
|
|
134
136
|
vertical: 'top',
|
|
@@ -136,7 +138,7 @@ function Toast(_ref) {
|
|
|
136
138
|
},
|
|
137
139
|
autoHideDuration: duration,
|
|
138
140
|
onClose: handleClose
|
|
139
|
-
}, _react.default.createElement(SnackbarContentWrapper, {
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement(SnackbarContentWrapper, {
|
|
140
142
|
onClose: handleClose,
|
|
141
143
|
variant: variant,
|
|
142
144
|
message: message
|
package/lib/Util/index.js
CHANGED
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.formatToDate = formatToDate;
|
|
7
|
+
exports.formatToDatetime = formatToDatetime;
|
|
8
|
+
exports.getColor = exports.getBackground = exports.formatUptime = void 0;
|
|
7
9
|
exports.getCookieOptions = getCookieOptions;
|
|
8
|
-
exports.mergeProps = mergeProps;
|
|
9
10
|
exports.getCopyright = getCopyright;
|
|
10
|
-
exports.setDateTool = setDateTool;
|
|
11
11
|
exports.getDateTool = getDateTool;
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
12
|
+
exports.getTimezone = void 0;
|
|
13
|
+
exports.mergeProps = mergeProps;
|
|
14
|
+
exports.openWebWallet = openWebWallet;
|
|
15
|
+
exports.parseQuery = parseQuery;
|
|
16
|
+
exports.setDateTool = setDateTool;
|
|
17
|
+
exports.str2color = void 0;
|
|
15
18
|
|
|
16
19
|
var _padStart = _interopRequireDefault(require("lodash/padStart"));
|
|
17
20
|
|
|
@@ -21,7 +24,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
24
|
let dateTool = null;
|
|
22
25
|
|
|
23
26
|
function parseQuery(str) {
|
|
24
|
-
return str.replace(/^\?/, '').split('&').map(x => x.split('=')).filter(
|
|
27
|
+
return str.replace(/^\?/, '').split('&').map(x => x.split('=')).filter(_ref => {
|
|
25
28
|
let [key] = _ref;
|
|
26
29
|
return !!key;
|
|
27
30
|
}).reduce((memo, x) => {
|
|
@@ -31,6 +34,13 @@ function parseQuery(str) {
|
|
|
31
34
|
return memo;
|
|
32
35
|
}, {});
|
|
33
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* @param {number} opts.expireInDays
|
|
39
|
+
* @param {string} opts.path
|
|
40
|
+
* @param {domain} opts.domain
|
|
41
|
+
* @param {boolean} opts.returnDomain if === false, opts.domain will be skipped
|
|
42
|
+
*/
|
|
43
|
+
|
|
34
44
|
|
|
35
45
|
function getCookieOptions() {
|
|
36
46
|
let expireInDays = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
@@ -53,10 +63,15 @@ function getCookieOptions() {
|
|
|
53
63
|
const options = {
|
|
54
64
|
expires: opts.expireInDays,
|
|
55
65
|
path: opts.path,
|
|
56
|
-
domain: opts.domain || ''
|
|
66
|
+
domain: opts.domain || '',
|
|
67
|
+
sameSite: opts.sameSite || 'lax'
|
|
57
68
|
};
|
|
58
69
|
|
|
59
|
-
if (typeof window === 'undefined' || opts.domain) {
|
|
70
|
+
if (typeof window === 'undefined' || opts.domain || opts.returnDomain === false) {
|
|
71
|
+
if (opts.returnDomain === false) {
|
|
72
|
+
delete options.domain;
|
|
73
|
+
}
|
|
74
|
+
|
|
60
75
|
return options;
|
|
61
76
|
}
|
|
62
77
|
|
|
@@ -90,7 +105,7 @@ const getColor = props => {
|
|
|
90
105
|
}
|
|
91
106
|
|
|
92
107
|
if (props.dark) {
|
|
93
|
-
return props.theme.palette.
|
|
108
|
+
return props.theme.palette.common.white;
|
|
94
109
|
}
|
|
95
110
|
|
|
96
111
|
return props.theme.palette.text.primary;
|
|
@@ -104,10 +119,10 @@ const getBackground = props => {
|
|
|
104
119
|
}
|
|
105
120
|
|
|
106
121
|
if (props.dark) {
|
|
107
|
-
return props.theme.palette.
|
|
122
|
+
return props.theme.palette.common.black;
|
|
108
123
|
}
|
|
109
124
|
|
|
110
|
-
return props.theme.palette.
|
|
125
|
+
return props.theme.palette.common.white;
|
|
111
126
|
};
|
|
112
127
|
|
|
113
128
|
exports.getBackground = getBackground;
|
|
@@ -266,4 +281,60 @@ function formatToDatetime(date) {
|
|
|
266
281
|
locale,
|
|
267
282
|
tz
|
|
268
283
|
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function openWebWallet(_ref3) {
|
|
287
|
+
var _window;
|
|
288
|
+
|
|
289
|
+
let {
|
|
290
|
+
webWalletUrl,
|
|
291
|
+
action = 'login',
|
|
292
|
+
locale = 'en',
|
|
293
|
+
url,
|
|
294
|
+
windowFeatures
|
|
295
|
+
} = _ref3;
|
|
296
|
+
// web wallet extension
|
|
297
|
+
const webWalletExtension = ((_window = window) === null || _window === void 0 ? void 0 : _window.ABT_DEV) || window.ABT;
|
|
298
|
+
|
|
299
|
+
if (webWalletExtension && typeof webWalletExtension.open === 'function') {
|
|
300
|
+
webWalletExtension.open({
|
|
301
|
+
action,
|
|
302
|
+
locale,
|
|
303
|
+
url: encodeURIComponent(url)
|
|
304
|
+
});
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const defaultWindowFeatures = {
|
|
309
|
+
toolbar: 'no',
|
|
310
|
+
location: 'no',
|
|
311
|
+
status: 'no',
|
|
312
|
+
menubar: 'no',
|
|
313
|
+
scrollbars: 'yes',
|
|
314
|
+
resizable: 'yes',
|
|
315
|
+
// iphone 8plus size
|
|
316
|
+
width: 414,
|
|
317
|
+
height: 736
|
|
318
|
+
};
|
|
319
|
+
const windowUrl = "".concat(webWalletUrl, "?action=").concat(action, "&locale=").concat(locale, "&url=").concat(encodeURIComponent(url));
|
|
320
|
+
const mergedWindowFeatures = Object.assign({}, defaultWindowFeatures, windowFeatures);
|
|
321
|
+
|
|
322
|
+
const getWindowWidth = win => {
|
|
323
|
+
return win.innerWidth || win.document.documentElement.clientWidth || win.document.body.clientWidth;
|
|
324
|
+
}; // 默认在浏览器右上角弹出窗口
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
if (!('left' in mergedWindowFeatures)) {
|
|
328
|
+
const winWidth = getWindowWidth(window.top || window);
|
|
329
|
+
const winLeft = window.screenLeft || window.screenX;
|
|
330
|
+
mergedWindowFeatures.left = winWidth + winLeft - mergedWindowFeatures.width;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (!('top' in mergedWindowFeatures)) {
|
|
334
|
+
const winTop = window.screenTop || window.screenY;
|
|
335
|
+
mergedWindowFeatures.top = winTop;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const strWindowFeatures = Object.keys(mergedWindowFeatures).map(key => "".concat(key, "=").concat(mergedWindowFeatures[key])).join(',');
|
|
339
|
+
window.open(windowUrl, 'targetWindow', strWindowFeatures);
|
|
269
340
|
}
|
package/lib/Video/index.js
CHANGED
|
@@ -19,9 +19,9 @@ var _Util = require("../Util");
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
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
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
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
26
|
const {
|
|
27
27
|
string,
|
|
@@ -49,33 +49,33 @@ function Video(props) {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
if (url.indexOf('v.qq.com') > 0) {
|
|
52
|
-
return _react.default.createElement(Placeholder, {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(Placeholder, {
|
|
53
53
|
style: {
|
|
54
54
|
width,
|
|
55
55
|
height
|
|
56
56
|
}
|
|
57
|
-
}, _react.default.createElement("iframe", {
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement("iframe", {
|
|
58
58
|
title: url,
|
|
59
59
|
style: styles,
|
|
60
60
|
src: url,
|
|
61
61
|
onLoad: () => setLoaded(true),
|
|
62
62
|
allowFullScreen: "true"
|
|
63
|
-
}), !loaded && _react.default.createElement(_CircularProgress.default, {
|
|
63
|
+
}), !loaded && /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
64
64
|
className: "loading-indicator",
|
|
65
65
|
color: "primary"
|
|
66
66
|
}));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
return _react.default.createElement(Placeholder, {
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(Placeholder, {
|
|
70
70
|
style: {
|
|
71
71
|
width,
|
|
72
72
|
height
|
|
73
73
|
}
|
|
74
|
-
}, _react.default.createElement(_reactPlayer.default, Object.assign({
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPlayer.default, Object.assign({
|
|
75
75
|
style: styles
|
|
76
76
|
}, newProps, {
|
|
77
77
|
onReady: () => setLoaded(true)
|
|
78
|
-
})), !loaded && _react.default.createElement(_CircularProgress.default, {
|
|
78
|
+
})), !loaded && /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
79
79
|
className: "loading-indicator",
|
|
80
80
|
color: "primary"
|
|
81
81
|
}));
|
package/lib/Wallet/Action.js
CHANGED
|
@@ -17,10 +17,12 @@ var _abtwallet = _interopRequireDefault(require("./images/abtwallet.png"));
|
|
|
17
17
|
|
|
18
18
|
var _Util = require("../Util");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
21
21
|
|
|
22
22
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
23
23
|
|
|
24
|
+
const _excluded = ["action", "size", "textLayout", "style"];
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -36,31 +38,31 @@ function WalletAction(props) {
|
|
|
36
38
|
textLayout,
|
|
37
39
|
style = {}
|
|
38
40
|
} = newProps,
|
|
39
|
-
rest = _objectWithoutProperties(newProps,
|
|
41
|
+
rest = _objectWithoutProperties(newProps, _excluded);
|
|
40
42
|
|
|
41
43
|
const styles = Object.assign({}, style, {
|
|
42
44
|
border: 'none',
|
|
43
45
|
padding: 0
|
|
44
46
|
});
|
|
45
|
-
return _react.default.createElement(_Button.default, Object.assign({
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, Object.assign({
|
|
46
48
|
style: styles
|
|
47
49
|
}, rest, {
|
|
48
50
|
variant: "outlined"
|
|
49
|
-
}), _react.default.createElement(Content, {
|
|
51
|
+
}), /*#__PURE__*/_react.default.createElement(Content, {
|
|
50
52
|
size: size,
|
|
51
53
|
color: styles.color
|
|
52
|
-
}, _react.default.createElement("img", {
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
53
55
|
src: _abtwallet.default,
|
|
54
56
|
className: "wallet-action__logo",
|
|
55
57
|
alt: "DID Wallet"
|
|
56
|
-
}), textLayout === 'vertical' && _react.default.createElement(_Typography.default, {
|
|
58
|
+
}), textLayout === 'vertical' && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
57
59
|
className: "wallet-action__text",
|
|
58
60
|
component: "div"
|
|
59
|
-
}, _react.default.createElement("span", {
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
60
62
|
className: "wallet-action__action"
|
|
61
|
-
}, action, " with"), _react.default.createElement("span", {
|
|
63
|
+
}, action, " with"), /*#__PURE__*/_react.default.createElement("span", {
|
|
62
64
|
className: "wallet-action__title"
|
|
63
|
-
}, "DID Wallet")), textLayout === 'horizontal' && _react.default.createElement("span", {
|
|
65
|
+
}, "DID Wallet")), textLayout === 'horizontal' && /*#__PURE__*/_react.default.createElement("span", {
|
|
64
66
|
className: "wallet-action__title",
|
|
65
67
|
style: {
|
|
66
68
|
padding: 8
|
|
@@ -97,5 +99,5 @@ const sizes = {
|
|
|
97
99
|
|
|
98
100
|
const Content = _styledComponents.default.div.withConfig({
|
|
99
101
|
displayName: "Action__Content",
|
|
100
|
-
componentId: "zuf4zr-0"
|
|
101
|
-
})(["display:flex;justify-content:center;align-items:center;&:hover{opacity:0.9;}.wallet-action__logo{width:auto;height:auto;max-width:", "px;margin-left:5px;}.wallet-action__text{padding:8px;display:flex;height:100%;flex-direction:column;justify-content:space-between;align-items:flex-start;}.wallet-action__action{font-size:", "px;text-transform:capitalize;margin-bottom:1px;color:", ";letter-spacing:1px;}.wallet-action__title{font-size:", "px;text-transform:capitalize;color:", ";letter-spacing:1px;}"], props => sizes.logo[props.size], props => sizes.font[props.size], props => props.color ||
|
|
102
|
+
componentId: "sc-zuf4zr-0"
|
|
103
|
+
})(["display:flex;justify-content:center;align-items:center;&:hover{opacity:0.9;}.wallet-action__logo{width:auto;height:auto;max-width:", "px;margin-left:5px;}.wallet-action__text{padding:8px;display:flex;height:100%;flex-direction:column;justify-content:space-between;align-items:flex-start;}.wallet-action__action{font-size:", "px;text-transform:capitalize;margin-bottom:1px;color:", ";letter-spacing:1px;}.wallet-action__title{font-size:", "px;text-transform:capitalize;color:", ";letter-spacing:1px;}"], props => sizes.logo[props.size], props => sizes.font[props.size], props => props.color || _Colors.default.primary.main, props => sizes.font[props.size] * 1.5, props => props.color || _Colors.default.primary.main);
|