@abtnode/ux 1.16.0-beta-58020de5 → 1.16.0-beta-7a7d5d97

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.
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = BlockletMigration;
7
- var _react = require("react");
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
9
9
  var _Alert = _interopRequireDefault(require("@arcblock/ux/lib/Alert"));
10
10
  var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
@@ -17,8 +17,11 @@ var _blocklet = require("../contexts/blocklet");
17
17
  var _session = require("../contexts/session");
18
18
  var _toast = _interopRequireDefault(require("../toast"));
19
19
  var _util2 = require("../util");
20
+ var _util3 = require("./util");
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+ 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); }
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; }
22
25
  const findDuplicate = blocklet => {
23
26
  const map = {};
24
27
  let duplicate = null;
@@ -137,6 +140,7 @@ function BlockletMigration() {
137
140
  onSuccess: onSuccess,
138
141
  extraParams: {
139
142
  did: blocklet.meta.did,
143
+ wt: (0, _util3.getWalletType)(blocklet, true),
140
144
  title: (0, _util.getDisplayName)(blocklet)
141
145
  },
142
146
  messages: {
@@ -231,8 +231,29 @@ const fixBlocklet = async function fixBlocklet(blocklet) {
231
231
  blocklet.capabilities = getAppCapabilities(blocklet);
232
232
  };
233
233
  exports.fixBlocklet = fixBlocklet;
234
- const getWalletType = meta => {
235
- const type = (meta.environments || []).find(x => x.name === 'BLOCKLET_WALLET_TYPE');
236
- return (type === null || type === void 0 ? void 0 : type.default) || 'default';
234
+ const DEFAULT_WALLET_TYPE = 'default';
235
+ const getWalletType = function getWalletType(raw) {
236
+ let fromState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
237
+ let item;
238
+
239
+ // from state: migrating
240
+ if (fromState) {
241
+ item = (raw.configs || []).find(x => x.key === 'BLOCKLET_WALLET_TYPE');
242
+ if (item && item.value) {
243
+ return item.value;
244
+ }
245
+ item = (raw.environments || []).find(x => x.key === 'BLOCKLET_WALLET_TYPE');
246
+ if (item && item.value) {
247
+ return item.value;
248
+ }
249
+ return DEFAULT_WALLET_TYPE;
250
+ }
251
+
252
+ // from meta: installing
253
+ item = (raw.environments || []).find(x => x.name === 'BLOCKLET_WALLET_TYPE');
254
+ if (item && item.default) {
255
+ return item.default;
256
+ }
257
+ return DEFAULT_WALLET_TYPE;
237
258
  };
238
259
  exports.getWalletType = getWalletType;
package/lib/locales/en.js CHANGED
@@ -1107,8 +1107,8 @@ module.exports = {
1107
1107
  confirmInstall: 'Confirm Installation',
1108
1108
  dialog: {
1109
1109
  title: 'Authorization Required',
1110
- freeDescription: 'You need to present Blocklet Server Ownership NFT or Blocklet Server Passport to launch application',
1111
- freeServerlessDescription: 'Please provide serverless NFT',
1110
+ freeDescription: 'You need to present Blocklet Space NFT or Blocklet Server Passport to launch application',
1111
+ freeServerlessDescription: 'Please provide Blocklet Space NFT',
1112
1112
  nonFreeDescription: 'You need to present application purchase NFT and Blocklet Server NFT to launch application',
1113
1113
  confirm: 'Confirm on your DID Wallet',
1114
1114
  success: 'Authorization Successfully',
package/lib/locales/zh.js CHANGED
@@ -1113,8 +1113,8 @@ module.exports = {
1113
1113
  confirmInstall: '确认安装',
1114
1114
  dialog: {
1115
1115
  title: '需要您的授权',
1116
- freeDescription: '你需要提供节点所有权 NFT 或节点通行证凭据来启动应用',
1117
- freeServerlessDescription: '请提供无服务 NFT',
1116
+ freeDescription: '你需要提供应用空间 NFT 或节点通行证凭据来启动应用',
1117
+ freeServerlessDescription: '请提应用空间 NFT',
1118
1118
  nonFreeDescription: '你需要提供应用购买凭证和节点通行证来启动应用',
1119
1119
  confirm: '在您的 DID 钱包上确认',
1120
1120
  success: '授权成功',
package/lib/util/index.js CHANGED
@@ -471,6 +471,9 @@ const getBlockletLogoUrl = _ref4 => {
471
471
  baseUrl,
472
472
  logoPath
473
473
  } = _ref4;
474
+ if (logoPath && logoPath.startsWith('http')) {
475
+ return logoPath;
476
+ }
474
477
  if (baseUrl.startsWith('http') && logoPath) {
475
478
  return (0, _urlJoin.default)(baseUrl, formatRegistryLogoPath(did, logoPath));
476
479
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.0-beta-58020de5",
6
+ "version": "1.16.0-beta-7a7d5d97",
7
7
  "description": "UX components shared across abtnode packages",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -15,25 +15,26 @@
15
15
  "prepublishOnly": "npm run build",
16
16
  "build": "babel src --out-dir lib --copy-files",
17
17
  "watch": "babel src --out-dir lib -w --copy-files",
18
+ "coverage": "npm run test -- --coverage",
18
19
  "test": "node tools/jest.js"
19
20
  },
20
21
  "keywords": [],
21
22
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
22
23
  "license": "MIT",
23
24
  "dependencies": {
24
- "@abtnode/auth": "1.16.0-beta-58020de5",
25
- "@abtnode/constant": "1.16.0-beta-58020de5",
26
- "@abtnode/util": "1.16.0-beta-58020de5",
25
+ "@abtnode/auth": "1.16.0-beta-7a7d5d97",
26
+ "@abtnode/constant": "1.16.0-beta-7a7d5d97",
27
+ "@abtnode/util": "1.16.0-beta-7a7d5d97",
27
28
  "@arcblock/did-connect": "^2.5.16",
28
29
  "@arcblock/did-motif": "^1.1.10",
29
30
  "@arcblock/icons": "^2.5.16",
30
31
  "@arcblock/react-hooks": "^2.5.16",
31
32
  "@arcblock/terminal": "^2.5.16",
32
33
  "@arcblock/ux": "^2.5.16",
33
- "@blocklet/constant": "1.16.0-beta-58020de5",
34
+ "@blocklet/constant": "1.16.0-beta-7a7d5d97",
34
35
  "@blocklet/launcher-layout": "1.9.65",
35
36
  "@blocklet/list": "^0.11.10",
36
- "@blocklet/meta": "1.16.0-beta-58020de5",
37
+ "@blocklet/meta": "1.16.0-beta-7a7d5d97",
37
38
  "@blocklet/ui-react": "^2.5.16",
38
39
  "@emotion/react": "^11.10.4",
39
40
  "@emotion/styled": "^11.10.4",
@@ -88,5 +89,5 @@
88
89
  "@babel/preset-react": "^7.18.6",
89
90
  "babel-plugin-inline-react-svg": "^1.1.2"
90
91
  },
91
- "gitHead": "9d3f47f9827acf13e9efea38cd605d3b36f9f523"
92
+ "gitHead": "c25ddcc371454b2e2f7038aa5e64c7b7c27763cb"
92
93
  }