@abtnode/ux 1.16.15-beta-e143b1cf → 1.16.15-beta-12f50442

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.
@@ -15,6 +15,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
16
  import { Fragment as _Fragment } from "react/jsx-runtime";
17
17
  const ALERT_THRESHOLD_MS = 30 * 24 * 60 * 60 * 1000;
18
+ const DEFAULT_LAUNCHER_URL = 'https://launcher.arcblock.io/'; // 兼容: 旧版本的 blocklet.controller 没有 launcherUrl 字段
19
+
18
20
  function Subscription({
19
21
  launcherUrl,
20
22
  chainHost,
@@ -37,7 +39,7 @@ function Subscription({
37
39
  } = props;
38
40
  const asyncState = useAsyncRetry(async () => {
39
41
  const [asset, subscriptionURL] = await Promise.all([getAsset(chainHost, nftId), getSubscriptionURL({
40
- launcherUrl,
42
+ launcherUrl: launcherUrl || DEFAULT_LAUNCHER_URL,
41
43
  nftId,
42
44
  locale
43
45
  })]);
@@ -154,12 +156,10 @@ Subscription.propTypes = {
154
156
  nftId: PropTypes.string.isRequired,
155
157
  sx: PropTypes.object,
156
158
  retention: PropTypes.number,
157
- launcherUrl: PropTypes.string
159
+ launcherUrl: PropTypes.string.isRequired
158
160
  };
159
161
  Subscription.defaultProps = {
160
162
  sx: {},
161
- retention: 0,
162
- launcherUrl: 'https://launcher.arcblock.io/' // 兼容: 旧版本的 blocklet.controller 没有 launcherUrl 字段
163
+ retention: 0
163
164
  };
164
-
165
165
  export default Subscription;
@@ -29,6 +29,8 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
29
29
  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; }
30
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
31
  const ALERT_THRESHOLD_MS = 30 * 24 * 60 * 60 * 1000;
32
+ const DEFAULT_LAUNCHER_URL = 'https://launcher.arcblock.io/'; // 兼容: 旧版本的 blocklet.controller 没有 launcherUrl 字段
33
+
32
34
  function Subscription(_ref) {
33
35
  var _asyncState$value, _asyncState$value2;
34
36
  let {
@@ -53,7 +55,7 @@ function Subscription(_ref) {
53
55
  rest = _objectWithoutProperties(props, _excluded2);
54
56
  const asyncState = (0, _useAsyncRetry.default)(async () => {
55
57
  const [asset, subscriptionURL] = await Promise.all([(0, _util.getAsset)(chainHost, nftId), (0, _util.getSubscriptionURL)({
56
- launcherUrl,
58
+ launcherUrl: launcherUrl || DEFAULT_LAUNCHER_URL,
57
59
  nftId,
58
60
  locale
59
61
  })]);
@@ -167,12 +169,11 @@ Subscription.propTypes = {
167
169
  nftId: _propTypes.default.string.isRequired,
168
170
  sx: _propTypes.default.object,
169
171
  retention: _propTypes.default.number,
170
- launcherUrl: _propTypes.default.string
172
+ launcherUrl: _propTypes.default.string.isRequired
171
173
  };
172
174
  Subscription.defaultProps = {
173
175
  sx: {},
174
- retention: 0,
175
- launcherUrl: 'https://launcher.arcblock.io/' // 兼容: 旧版本的 blocklet.controller 没有 launcherUrl 字段
176
+ retention: 0
176
177
  };
177
178
  var _default = Subscription;
178
179
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.15-beta-e143b1cf",
3
+ "version": "1.16.15-beta-12f50442",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -27,9 +27,9 @@
27
27
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@abtnode/auth": "1.16.15-beta-e143b1cf",
31
- "@abtnode/constant": "1.16.15-beta-e143b1cf",
32
- "@abtnode/util": "1.16.15-beta-e143b1cf",
30
+ "@abtnode/auth": "1.16.15-beta-12f50442",
31
+ "@abtnode/constant": "1.16.15-beta-12f50442",
32
+ "@abtnode/util": "1.16.15-beta-12f50442",
33
33
  "@ahooksjs/use-url-state": "^3.5.1",
34
34
  "@arcblock/did": "^1.18.89",
35
35
  "@arcblock/did-connect": "^2.7.9",
@@ -39,10 +39,10 @@
39
39
  "@arcblock/react-hooks": "^2.7.9",
40
40
  "@arcblock/terminal": "^2.7.9",
41
41
  "@arcblock/ux": "^2.7.9",
42
- "@blocklet/constant": "1.16.15-beta-e143b1cf",
42
+ "@blocklet/constant": "1.16.15-beta-12f50442",
43
43
  "@blocklet/launcher-layout": "2.1.101",
44
44
  "@blocklet/list": "^0.12.31",
45
- "@blocklet/meta": "1.16.15-beta-e143b1cf",
45
+ "@blocklet/meta": "1.16.15-beta-12f50442",
46
46
  "@blocklet/ui-react": "^2.7.9",
47
47
  "@emotion/react": "^11.10.4",
48
48
  "@emotion/styled": "^11.10.4",
@@ -98,7 +98,7 @@
98
98
  "babel-plugin-inline-react-svg": "^1.1.2",
99
99
  "glob": "^10.3.3"
100
100
  },
101
- "gitHead": "86dcc908f3cb7259d1ca92b9ae75160a6e43509a",
101
+ "gitHead": "48bda4b29eb31a70e0eb9cab0bce6e544960c7fd",
102
102
  "exports": {
103
103
  ".": {
104
104
  "import": "./es/index.js",