@arcblock/ux 2.5.58 → 2.5.60

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 (135) hide show
  1. package/lib/ActionButton/index.js +20 -39
  2. package/lib/ActivityIndicator/index.js +20 -41
  3. package/lib/Address/compact-text.js +16 -38
  4. package/lib/Address/did-address.js +22 -51
  5. package/lib/Address/index.js +6 -19
  6. package/lib/Address/responsive-did-address.js +20 -36
  7. package/lib/Alert/index.js +12 -34
  8. package/lib/AnimationWaiter/index.js +35 -59
  9. package/lib/Async/index.js +5 -19
  10. package/lib/Avatar/did-motif.js +12 -26
  11. package/lib/Avatar/etherscan-blockies.js +2 -20
  12. package/lib/Avatar/index.js +28 -54
  13. package/lib/Badge/index.js +12 -33
  14. package/lib/Blocklet/blocklet.js +20 -47
  15. package/lib/Blocklet/index.js +0 -6
  16. package/lib/Blocklet/utils.js +0 -6
  17. package/lib/BlockletNFT/index.js +37 -67
  18. package/lib/Button/index.js +0 -4
  19. package/lib/Button/wrap.js +19 -38
  20. package/lib/ButtonGroup/index.js +0 -5
  21. package/lib/CardSelector/index.js +9 -22
  22. package/lib/Center/index.js +2 -12
  23. package/lib/ClickToCopy/copy-button.js +9 -26
  24. package/lib/ClickToCopy/hook.js +0 -10
  25. package/lib/ClickToCopy/index.js +13 -41
  26. package/lib/CodeBlock/LightBox.js +1 -6
  27. package/lib/CodeBlock/index.js +12 -80
  28. package/lib/Colors/index.js +0 -2
  29. package/lib/Colors/themes/default.js +2 -3
  30. package/lib/ContactForm/index.js +5 -35
  31. package/lib/CookieConsent/index.js +10 -32
  32. package/lib/CountDown/index.js +10 -35
  33. package/lib/DID/index.js +8 -32
  34. package/lib/Datatable/CustomToolbar.js +9 -56
  35. package/lib/Datatable/DatatableContext.js +2 -5
  36. package/lib/Datatable/TableSearch.js +0 -21
  37. package/lib/Datatable/index.js +76 -152
  38. package/lib/Datatable/utils.js +14 -27
  39. package/lib/Dialog/confirm.js +18 -31
  40. package/lib/Dialog/dialog.js +24 -50
  41. package/lib/Dialog/index.js +0 -3
  42. package/lib/DidLogo/index.js +0 -7
  43. package/lib/DriftBot/index.js +1 -12
  44. package/lib/Earth/index.js +17 -58
  45. package/lib/Earth/util.js +0 -7
  46. package/lib/Empty/index.js +9 -23
  47. package/lib/ErrorBoundary/fallback.js +0 -14
  48. package/lib/ErrorBoundary/index.js +0 -2
  49. package/lib/Footer/index.js +1 -14
  50. package/lib/Header/auto-hidden.js +9 -23
  51. package/lib/Header/header.js +19 -38
  52. package/lib/Header/index.js +0 -3
  53. package/lib/Header/responsive-header.js +16 -40
  54. package/lib/Icon/image.js +12 -26
  55. package/lib/Icon/index.js +15 -34
  56. package/lib/Img/index.js +32 -54
  57. package/lib/InfoRow/index.js +11 -27
  58. package/lib/Layout/dashboard/external-link.js +13 -30
  59. package/lib/Layout/dashboard/full-page.js +8 -24
  60. package/lib/Layout/dashboard/index.js +28 -72
  61. package/lib/Layout/dashboard/sidebar.js +11 -31
  62. package/lib/Layout/dashboard-legacy/header.js +14 -36
  63. package/lib/Layout/dashboard-legacy/index.js +19 -44
  64. package/lib/Layout/dashboard-legacy/sidebar.js +10 -32
  65. package/lib/Layout/index.js +18 -52
  66. package/lib/Locale/browser-lang.js +6 -19
  67. package/lib/Locale/context.js +15 -51
  68. package/lib/Locale/languages.js +3 -7
  69. package/lib/Locale/selector.js +11 -44
  70. package/lib/Locale/util.js +0 -10
  71. package/lib/Logo/index.js +10 -33
  72. package/lib/Metric/index.js +1 -9
  73. package/lib/NFTDisplay/aspect-ratio-container.js +7 -20
  74. package/lib/NFTDisplay/broken.js +0 -8
  75. package/lib/NFTDisplay/index.js +63 -110
  76. package/lib/NFTDisplay/loading.js +0 -6
  77. package/lib/NFTDisplay/svg-embedder/img.js +9 -22
  78. package/lib/NFTDisplay/svg-embedder/inline-svg.js +9 -23
  79. package/lib/NavMenu/index.js +0 -2
  80. package/lib/NavMenu/nav-menu.js +40 -69
  81. package/lib/NavMenu/style.js +1 -5
  82. package/lib/PageScroller/index.js +9 -39
  83. package/lib/PageScroller/story/FifthComponent.js +0 -2
  84. package/lib/PageScroller/story/FirstComponent.js +0 -2
  85. package/lib/PageScroller/story/FourthComponent.js +0 -2
  86. package/lib/PageScroller/story/FullPage.js +1 -14
  87. package/lib/PageScroller/story/PageContain.js +1 -14
  88. package/lib/PageScroller/story/SecondComponent.js +0 -2
  89. package/lib/PageScroller/story/ThirdComponent.js +0 -2
  90. package/lib/PageScroller/usePrevValue.js +1 -2
  91. package/lib/PricingTable/PricingPlan.js +0 -12
  92. package/lib/PricingTable/index.js +0 -14
  93. package/lib/QRCode/index.js +14 -24
  94. package/lib/RelativeTime/index.js +12 -45
  95. package/lib/Result/common.js +43 -63
  96. package/lib/Result/index.js +6 -23
  97. package/lib/Result/result.js +9 -23
  98. package/lib/Screenshot/BaseScreenshot/index.js +9 -26
  99. package/lib/Screenshot/BaseScreenshot/shells/Macbook.js +9 -10
  100. package/lib/Screenshot/BaseScreenshot/shells/Phone.js +3 -8
  101. package/lib/Screenshot/index.js +32 -65
  102. package/lib/SessionManager/federated-login-detecter.js +171 -0
  103. package/lib/SessionManager/index.js +189 -271
  104. package/lib/SessionManager/user-popper.js +83 -0
  105. package/lib/Sparkline/index.js +40 -42
  106. package/lib/Spinner/index.js +12 -23
  107. package/lib/SplitButton/index.js +20 -48
  108. package/lib/Switch/index.js +7 -22
  109. package/lib/Tabs/index.js +8 -22
  110. package/lib/Tag/index.js +13 -33
  111. package/lib/TextCollapse/index.js +14 -31
  112. package/lib/Theme/index.js +3 -13
  113. package/lib/Theme/theme-provider.js +1 -10
  114. package/lib/Theme/theme.js +15 -27
  115. package/lib/Toast/index.js +13 -40
  116. package/lib/Util/deprecate.js +3 -12
  117. package/lib/Util/index.js +13 -74
  118. package/lib/Util/wallet.js +3 -10
  119. package/lib/Video/index.js +3 -19
  120. package/lib/Wallet/Action.js +9 -28
  121. package/lib/Wallet/Download.js +11 -36
  122. package/lib/Wallet/Open.js +0 -12
  123. package/lib/WebWalletSWKeeper/index.js +30 -55
  124. package/lib/WechatPrompt/index.js +0 -16
  125. package/lib/index.js +0 -38
  126. package/lib/withTheme/index.js +3 -15
  127. package/lib/withTracker/error_boundary.js +3 -14
  128. package/lib/withTracker/index.js +3 -24
  129. package/package.json +5 -5
  130. package/src/Blocklet/blocklet.js +1 -1
  131. package/src/BlockletNFT/index.js +1 -1
  132. package/src/NFTDisplay/index.js +4 -4
  133. package/src/SessionManager/federated-login-detecter.jsx +138 -0
  134. package/src/SessionManager/index.jsx +140 -233
  135. package/src/SessionManager/user-popper.jsx +121 -0
package/lib/Util/index.js CHANGED
@@ -17,14 +17,11 @@ exports.parseQuery = parseQuery;
17
17
  exports.setDateTool = setDateTool;
18
18
  exports.str2color = void 0;
19
19
  exports.stringifyQuery = stringifyQuery;
20
-
21
20
  var _padStart = _interopRequireDefault(require("lodash/padStart"));
22
-
23
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
-
25
22
  /* eslint-disable no-bitwise */
26
- let dateTool = null;
27
23
 
24
+ let dateTool = null;
28
25
  function parseQuery(str) {
29
26
  return str.replace(/^\?/, '').split('&').map(x => x.split('=')).filter(_ref => {
30
27
  let [key] = _ref;
@@ -36,83 +33,65 @@ function parseQuery(str) {
36
33
  return memo;
37
34
  }, {});
38
35
  }
39
-
40
36
  function stringifyQuery() {
41
37
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
42
38
  return new URLSearchParams(params).toString();
43
39
  }
40
+
44
41
  /**
45
42
  * @param {number} opts.expireInDays
46
43
  * @param {string} opts.path
47
44
  * @param {domain} opts.domain
48
45
  * @param {boolean} opts.returnDomain if === false, opts.domain will be skipped
49
46
  */
50
-
51
-
52
47
  function getCookieOptions() {
53
48
  let expireInDays = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
54
49
  let opts = {
55
50
  expireInDays
56
51
  };
57
-
58
52
  if (typeof expireInDays === 'object') {
59
53
  opts = expireInDays;
60
54
  }
61
-
62
55
  if (opts.path === undefined) {
63
56
  opts.path = '/';
64
57
  }
65
-
66
58
  if (!opts.expireInDays) {
67
59
  opts.expireInDays = 1;
68
60
  }
69
-
70
61
  const options = {
71
62
  expires: opts.expireInDays,
72
63
  path: opts.path,
73
64
  domain: opts.domain || '',
74
65
  sameSite: opts.sameSite || 'lax'
75
66
  };
76
-
77
67
  if (typeof window === 'undefined' || opts.domain || opts.returnDomain === false) {
78
68
  if (opts.returnDomain === false) {
79
69
  delete options.domain;
80
70
  }
81
-
82
71
  return options;
83
72
  }
84
-
85
73
  return options;
86
74
  }
87
-
88
75
  const getColor = props => {
89
76
  if (props.color) {
90
77
  return props.color;
91
78
  }
92
-
93
79
  if (props.dark) {
94
80
  return props.theme.palette.common.white;
95
81
  }
96
-
97
82
  return props.theme.palette.text.primary;
98
83
  };
99
-
100
84
  exports.getColor = getColor;
101
-
102
85
  const getBackground = props => {
103
86
  if (props.background) {
104
87
  return props.background;
105
88
  }
106
-
107
89
  if (props.dark) {
108
90
  return props.theme.palette.common.black;
109
91
  }
110
-
111
92
  return props.theme.palette.common.white;
112
93
  };
113
-
114
94
  exports.getBackground = getBackground;
115
-
116
95
  function mergeProps(props, component) {
117
96
  let jsonAttrs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
118
97
  const newProps = Object.assign({}, props);
@@ -121,18 +100,17 @@ function mergeProps(props, component) {
121
100
  newProps[x] = component.defaultProps[x];
122
101
  }
123
102
  });
124
-
125
103
  if (Array.isArray(jsonAttrs)) {
126
104
  jsonAttrs.forEach(x => {
127
105
  if (typeof newProps[x] === 'string') {
128
106
  try {
129
107
  newProps[x] = JSON.parse(newProps[x]);
130
- } catch (err) {// Do nothing
108
+ } catch (err) {
109
+ // Do nothing
131
110
  }
132
111
  }
133
112
  });
134
113
  }
135
-
136
114
  Object.keys(newProps).forEach(x => {
137
115
  if (typeof newProps[x] === 'string' && newProps[x].indexOf('::prop::') === 0) {
138
116
  newProps[x] = '';
@@ -140,42 +118,31 @@ function mergeProps(props, component) {
140
118
  });
141
119
  return newProps;
142
120
  }
143
-
144
121
  function getCopyright() {
145
122
  let startYear = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2017;
146
123
  const currentYear = new Date().getFullYear();
147
124
  return "".concat(currentYear) === "".concat(startYear) ? "\xA9 ArcBlock ".concat(currentYear) : "\xA9 ArcBlock ".concat(startYear, " - ").concat(currentYear);
148
125
  }
149
-
150
126
  const getTimezone = () => {
151
127
  if (typeof Intl === 'object' && typeof Intl.DateTimeFormat === 'function' && typeof Intl.DateTimeFormat().resolvedOptions === 'function') {
152
128
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
153
129
  }
154
-
155
130
  return '';
156
131
  };
157
-
158
132
  exports.getTimezone = getTimezone;
159
-
160
133
  const str2color = str => {
161
134
  let hash = 0;
162
-
163
135
  for (let i = 0; i < str.length; i++) {
164
136
  hash = str.charCodeAt(i) + ((hash << 5) - hash);
165
137
  }
166
-
167
138
  let colour = '#';
168
-
169
139
  for (let j = 0; j < 3; j++) {
170
140
  const value = hash >> j * 8 & 0xff;
171
141
  colour += "00".concat(value.toString(16)).substr(-2);
172
142
  }
173
-
174
143
  return colour;
175
144
  };
176
-
177
145
  exports.str2color = str2color;
178
-
179
146
  const formatUptime = uptime => {
180
147
  const total = Math.round(uptime / 1000);
181
148
  const hours = Math.floor(total / 3600);
@@ -183,49 +150,40 @@ const formatUptime = uptime => {
183
150
  const seconds = total % 60;
184
151
  return "".concat((0, _padStart.default)(hours, 2, '0'), ":").concat((0, _padStart.default)(minutes, 2, '0'), ":").concat((0, _padStart.default)(seconds, 2, '0'));
185
152
  };
153
+
186
154
  /**
187
155
  * Set the date tool library which support for format() and locale() functions,
188
156
  * moment and dayjs are recommended.
189
157
  * @param {object} the date tool library
190
158
  */
191
-
192
-
193
159
  exports.formatUptime = formatUptime;
194
-
195
160
  function setDateTool(tool) {
196
161
  dateTool = tool;
197
162
  }
198
-
199
163
  function getDateTool() {
200
164
  return dateTool;
201
165
  }
202
-
203
166
  const createDateFormater = format => (date, _ref2) => {
204
167
  let {
205
168
  locale,
206
169
  tz
207
170
  } = _ref2;
208
-
209
171
  if (dateTool === null) {
210
172
  throw new Error('call setDateTool to set the date tool library, such as: setDateTool(dayjs)');
211
173
  }
212
-
213
174
  if (!date) {
214
175
  return '-';
215
176
  }
216
-
217
177
  let instance = dateTool(date);
218
-
219
178
  if (tz) {
220
179
  instance = instance.tz(tz);
221
180
  }
222
-
223
181
  if (typeof locale !== 'undefined') {
224
182
  instance = instance.locale(locale);
225
183
  }
226
-
227
184
  return instance.format(format);
228
185
  };
186
+
229
187
  /**
230
188
  * Format the time string as `ll` format: MMM D, YYYY
231
189
  * Ensure that the setDateTool() function is called first to set the time tool library.
@@ -235,8 +193,6 @@ const createDateFormater = format => (date, _ref2) => {
235
193
  * @param {string} option.tz, default: timzone
236
194
  * @returns formated date string
237
195
  */
238
-
239
-
240
196
  function formatToDate(date) {
241
197
  let {
242
198
  locale,
@@ -247,6 +203,7 @@ function formatToDate(date) {
247
203
  tz
248
204
  });
249
205
  }
206
+
250
207
  /**
251
208
  * Format the time string as `lll` format: MMM D, YYYY h:mm A
252
209
  * Ensure that the setDateTool() function is called first to set the time tool library.
@@ -256,8 +213,6 @@ function formatToDate(date) {
256
213
  * @param {string} option.tz, default: timzone
257
214
  * @returns formated date string
258
215
  */
259
-
260
-
261
216
  function formatToDatetime(date) {
262
217
  let {
263
218
  locale,
@@ -268,19 +223,14 @@ function formatToDatetime(date) {
268
223
  tz
269
224
  });
270
225
  }
271
-
272
226
  function detectWalletExtension() {
273
227
  var _window;
274
-
275
228
  const extension = ((_window = window) === null || _window === void 0 ? void 0 : _window.ABT_DEV) || window.ABT;
276
-
277
229
  if (extension && typeof extension.open === 'function') {
278
230
  return extension;
279
231
  }
280
-
281
232
  return null;
282
233
  }
283
-
284
234
  function openWebWallet(_ref3) {
285
235
  let {
286
236
  webWalletUrl,
@@ -291,7 +241,6 @@ function openWebWallet(_ref3) {
291
241
  } = _ref3;
292
242
  // web wallet extension
293
243
  const extension = detectWalletExtension();
294
-
295
244
  if (extension) {
296
245
  extension.open({
297
246
  action,
@@ -300,7 +249,6 @@ function openWebWallet(_ref3) {
300
249
  });
301
250
  return;
302
251
  }
303
-
304
252
  const defaultWindowFeatures = {
305
253
  toolbar: 'no',
306
254
  location: 'no',
@@ -314,47 +262,38 @@ function openWebWallet(_ref3) {
314
262
  };
315
263
  const windowUrl = "".concat(webWalletUrl, "?action=").concat(action, "&locale=").concat(locale, "&url=").concat(encodeURIComponent(url));
316
264
  const mergedWindowFeatures = Object.assign({}, defaultWindowFeatures, windowFeatures);
317
-
318
265
  const getWindowWidth = win => {
319
266
  return win.innerWidth || win.document.documentElement.clientWidth || win.document.body.clientWidth;
320
- }; // 默认在浏览器右上角弹出窗口
321
-
322
-
267
+ };
268
+ // 默认在浏览器右上角弹出窗口
323
269
  if (!('left' in mergedWindowFeatures)) {
324
270
  const winWidth = getWindowWidth(window.top || window);
325
271
  const winLeft = window.screenLeft || window.screenX;
326
272
  mergedWindowFeatures.left = winWidth + winLeft - mergedWindowFeatures.width;
327
273
  }
328
-
329
274
  if (!('top' in mergedWindowFeatures)) {
330
275
  const winTop = window.screenTop || window.screenY;
331
276
  mergedWindowFeatures.top = winTop;
332
277
  }
333
-
334
278
  const strWindowFeatures = Object.keys(mergedWindowFeatures).map(key => "".concat(key, "=").concat(mergedWindowFeatures[key])).join(',');
335
279
  window.open(windowUrl, 'targetWindow', strWindowFeatures);
336
280
  }
337
-
338
281
  const getFontSize = size => {
339
282
  // 12px 及以上的 size 有效, 否则返回 inherit
340
283
  if (size && Number(size) >= 12) {
341
284
  return "".concat(Number(size), "px");
342
285
  }
343
-
344
286
  return 'inherit';
345
- }; // 参考: asset-chain @arcblock/did
346
-
287
+ };
347
288
 
289
+ // 参考: asset-chain @arcblock/did
348
290
  exports.getFontSize = getFontSize;
349
-
350
291
  const isEthereumDid = did => {
351
- const address = did.replace('did:abt:', ''); // check if it has the basic requirements of an address
352
-
292
+ const address = did.replace('did:abt:', '');
293
+ // check if it has the basic requirements of an address
353
294
  if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) {
354
295
  return false;
355
296
  }
356
-
357
297
  return true;
358
298
  };
359
-
360
299
  exports.isEthereumDid = isEthereumDid;
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.providerName = exports.getWebWalletUrl = exports.checkSameProtocol = void 0;
7
-
8
7
  /* eslint-disable import/prefer-default-export */
9
8
  const providerName = 'wallet_url';
9
+
10
10
  /**
11
11
  * 获取 web wallet url, 常用于为 did connect 组件传递 webWalletUrl 参数,
12
12
  * 更明确的说, 这里获取的应该是 **default web wallet url**,
@@ -19,31 +19,24 @@ const providerName = 'wallet_url';
19
19
  * - window.blocklet.webWalletUrl
20
20
  * - production web wallet url
21
21
  */
22
-
23
22
  exports.providerName = providerName;
24
-
25
23
  const getWebWalletUrl = () => {
26
24
  var _window$env, _window$blocklet;
27
-
28
25
  return window.localStorage.getItem(providerName) || ((_window$env = window.env) === null || _window$env === void 0 ? void 0 : _window$env.webWalletUrl) || ((_window$blocklet = window.blocklet) === null || _window$blocklet === void 0 ? void 0 : _window$blocklet.webWalletUrl) || 'https://web.abtwallet.io/';
29
- }; // 检查 wallet url protocol 和当前页面地址的 protocol 是否一致
30
-
26
+ };
31
27
 
28
+ // 检查 wallet url protocol 和当前页面地址的 protocol 是否一致
32
29
  exports.getWebWalletUrl = getWebWalletUrl;
33
-
34
30
  const checkSameProtocol = webWalletUrl => {
35
31
  const {
36
32
  protocol
37
33
  } = window.location;
38
34
  let walletProtocol = '';
39
-
40
35
  try {
41
36
  walletProtocol = new URL(webWalletUrl).protocol;
42
37
  } catch (error) {
43
38
  walletProtocol = '';
44
39
  }
45
-
46
40
  return protocol === walletProtocol;
47
41
  };
48
-
49
42
  exports.checkSameProtocol = checkSameProtocol;
@@ -4,33 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = Video;
7
-
8
7
  var _react = require("react");
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _reactPlayer = _interopRequireDefault(require("react-player"));
13
-
14
10
  var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
15
-
16
11
  var _Util = require("../Util");
17
-
18
12
  var _Theme = require("../Theme");
19
-
20
13
  var _jsxRuntime = require("react/jsx-runtime");
21
-
22
14
  var _templateObject;
23
-
24
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
16
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
27
-
28
17
  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; }
29
-
30
18
  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; }
31
-
32
- 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; }
33
-
19
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
21
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
34
22
  const {
35
23
  string,
36
24
  number,
@@ -38,7 +26,6 @@ const {
38
26
  oneOfType,
39
27
  object
40
28
  } = _propTypes.default;
41
-
42
29
  function Video(props) {
43
30
  const newProps = (0, _Util.mergeProps)(props, Video, ['style']);
44
31
  const {
@@ -55,7 +42,6 @@ function Video(props) {
55
42
  height,
56
43
  visibility: loaded ? 'visible' : 'hidden'
57
44
  });
58
-
59
45
  if (url.indexOf('v.qq.com') > 0) {
60
46
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Placeholder, {
61
47
  style: {
@@ -74,7 +60,6 @@ function Video(props) {
74
60
  })]
75
61
  });
76
62
  }
77
-
78
63
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Placeholder, {
79
64
  style: {
80
65
  width,
@@ -90,7 +75,6 @@ function Video(props) {
90
75
  })]
91
76
  });
92
77
  }
93
-
94
78
  Video.propTypes = {
95
79
  url: oneOfType([string, array, object]).isRequired,
96
80
  width: oneOfType([string, number]),
@@ -4,52 +4,34 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = WalletAction;
7
-
8
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
-
10
8
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
11
-
12
9
  var _abtwallet = _interopRequireDefault(require("./images/abtwallet.png"));
13
-
14
10
  var _Util = require("../Util");
15
-
16
11
  var _Colors = _interopRequireDefault(require("../Colors"));
17
-
18
12
  var _Button = _interopRequireDefault(require("../Button"));
19
-
20
13
  var _Theme = require("../Theme");
21
-
22
14
  var _jsxRuntime = require("react/jsx-runtime");
23
-
24
15
  var _templateObject;
25
-
26
16
  const _excluded = ["action", "size", "textLayout", "style"];
27
-
28
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
-
30
18
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
31
-
32
19
  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; }
33
-
34
20
  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; }
35
-
36
- 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; }
37
-
21
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
23
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
38
24
  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; }
39
-
40
25
  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; }
41
-
42
26
  function WalletAction(props) {
43
27
  const newProps = (0, _Util.mergeProps)(props, WalletAction, ['style']);
44
-
45
28
  const {
46
- action,
47
- size,
48
- textLayout,
49
- style = {}
50
- } = newProps,
51
- rest = _objectWithoutProperties(newProps, _excluded);
52
-
29
+ action,
30
+ size,
31
+ textLayout,
32
+ style = {}
33
+ } = newProps,
34
+ rest = _objectWithoutProperties(newProps, _excluded);
53
35
  const styles = Object.assign({}, style, {
54
36
  border: 'none',
55
37
  padding: 0
@@ -85,7 +67,6 @@ function WalletAction(props) {
85
67
  })
86
68
  }));
87
69
  }
88
-
89
70
  WalletAction.propTypes = {
90
71
  action: _propTypes.default.string,
91
72
  size: _propTypes.default.oneOf(['xlarge', 'large', 'medium', 'small']),
@@ -4,41 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = WalletDownload;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
13
-
14
10
  var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
15
-
16
11
  var _Button = _interopRequireDefault(require("../Button"));
17
-
18
12
  var _Util = require("../Util");
19
-
20
13
  var _Theme = require("../Theme");
21
-
22
14
  var _jsxRuntime = require("react/jsx-runtime");
23
-
24
15
  var _templateObject;
25
-
26
16
  const _excluded = ["title", "children", "iosLink", "androidLink", "androidDownLoadUrl", "locale"];
27
-
28
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
-
30
18
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
31
-
32
19
  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; }
33
-
34
20
  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; }
35
-
36
- 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; }
37
-
21
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
23
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
38
24
  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; }
39
-
40
25
  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; }
41
-
42
26
  var AppStoreIcon = function AppStoreIcon(props) {
43
27
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", _objectSpread(_objectSpread({}, props), {}, {
44
28
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("title", {
@@ -62,14 +46,12 @@ var AppStoreIcon = function AppStoreIcon(props) {
62
46
  })]
63
47
  }));
64
48
  };
65
-
66
49
  AppStoreIcon.defaultProps = {
67
50
  width: "172",
68
51
  height: "50",
69
52
  viewBox: "0 0 172 50",
70
53
  xmlns: "http://www.w3.org/2000/svg"
71
54
  };
72
-
73
55
  var GooglePlayIcon = function GooglePlayIcon(props) {
74
56
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", _objectSpread(_objectSpread({}, props), {}, {
75
57
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("title", {
@@ -184,7 +166,6 @@ var GooglePlayIcon = function GooglePlayIcon(props) {
184
166
  })]
185
167
  }));
186
168
  };
187
-
188
169
  GooglePlayIcon.defaultProps = {
189
170
  width: "172",
190
171
  height: "50",
@@ -192,7 +173,6 @@ GooglePlayIcon.defaultProps = {
192
173
  xmlns: "http://www.w3.org/2000/svg",
193
174
  xmlnsXlink: "http://www.w3.org/1999/xlink"
194
175
  };
195
-
196
176
  var AndroidDownloadIcon = function AndroidDownloadIcon(props) {
197
177
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", _objectSpread(_objectSpread({}, props), {}, {
198
178
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("title", {
@@ -234,28 +214,24 @@ var AndroidDownloadIcon = function AndroidDownloadIcon(props) {
234
214
  })]
235
215
  }));
236
216
  };
237
-
238
217
  AndroidDownloadIcon.defaultProps = {
239
218
  width: "172",
240
219
  height: "50",
241
220
  viewBox: "0 0 172 50",
242
221
  xmlns: "http://www.w3.org/2000/svg"
243
222
  };
244
-
245
223
  function WalletDownload(props) {
246
224
  const browser = (0, _useBrowser.default)();
247
225
  const newProps = (0, _Util.mergeProps)(props, WalletDownload, ['style']);
248
-
249
226
  const {
250
- title,
251
- children,
252
- iosLink,
253
- androidLink,
254
- androidDownLoadUrl,
255
- locale
256
- } = newProps,
257
- rest = _objectWithoutProperties(newProps, _excluded);
258
-
227
+ title,
228
+ children,
229
+ iosLink,
230
+ androidLink,
231
+ androidDownLoadUrl,
232
+ locale
233
+ } = newProps,
234
+ rest = _objectWithoutProperties(newProps, _excluded);
259
235
  const isAndroid = browser.mobile.android.phone || browser.mobile.android.tablet;
260
236
  const isIOS = browser.mobile.apple.phone || browser.mobile.apple.tablet;
261
237
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, _objectSpread(_objectSpread({}, rest), {}, {
@@ -315,7 +291,6 @@ function WalletDownload(props) {
315
291
  })]
316
292
  }));
317
293
  }
318
-
319
294
  WalletDownload.propTypes = {
320
295
  title: _propTypes.default.string,
321
296
  layout: _propTypes.default.oneOf(['vertical', 'horizontal']),
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = OpenInWallet;
7
-
8
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
-
10
8
  var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
11
-
12
9
  var _Fab = _interopRequireDefault(require("@mui/material/Fab"));
13
-
14
10
  var _Theme = require("../Theme");
15
-
16
11
  var _jsxRuntime = require("react/jsx-runtime");
17
-
18
12
  var _templateObject;
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
14
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
23
-
24
15
  function OpenInWallet(_ref) {
25
16
  let {
26
17
  locale,
@@ -28,7 +19,6 @@ function OpenInWallet(_ref) {
28
19
  } = _ref;
29
20
  const buttonText = locale === 'zh' ? '在 DID 钱包打开' : 'Open in DID Wallet';
30
21
  const browser = (0, _useBrowser.default)();
31
-
32
22
  if (browser.mobile.any && !browser.wallet && !browser.wechat) {
33
23
  const deepLink = "abt://abtwallet.io/i?action=requestOpenUrl&url=".concat(encodeURIComponent(link));
34
24
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
@@ -42,10 +32,8 @@ function OpenInWallet(_ref) {
42
32
  children: buttonText
43
33
  });
44
34
  }
45
-
46
35
  return null;
47
36
  }
48
-
49
37
  OpenInWallet.propTypes = {
50
38
  locale: _propTypes.default.oneOf(['en', 'zh']),
51
39
  link: _propTypes.default.string.isRequired