@abtnode/ux 1.16.0-beta-ad6df3ae → 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.
- package/lib/blocklet/install-from-url.js +2 -0
- package/lib/blocklet/migration.js +5 -1
- package/lib/blocklet/util.js +28 -2
- package/lib/locales/en.js +7 -4
- package/lib/locales/zh.js +7 -4
- package/lib/lost-passport.js +2 -0
- package/lib/util/index.js +3 -0
- package/package.json +8 -7
|
@@ -23,6 +23,7 @@ var _util = require("@blocklet/meta/lib/util");
|
|
|
23
23
|
var _node = require("../contexts/node");
|
|
24
24
|
var _session = require("../contexts/session");
|
|
25
25
|
var _util2 = require("../util");
|
|
26
|
+
var _util3 = require("./util");
|
|
26
27
|
var _didAddress = _interopRequireDefault(require("../did-address"));
|
|
27
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -319,6 +320,7 @@ function InstallFromUrl(_ref) {
|
|
|
319
320
|
onSuccess: onEndInstall,
|
|
320
321
|
extraParams: {
|
|
321
322
|
title: meta.title,
|
|
323
|
+
wt: (0, _util3.getWalletType)(meta),
|
|
322
324
|
blockletMetaUrl: decodeURIComponent(url.trim())
|
|
323
325
|
},
|
|
324
326
|
messages: {
|
|
@@ -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: {
|
package/lib/blocklet/util.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.fixBlocklet = exports.ensureDomainAliases = void 0;
|
|
|
8
8
|
exports.genExportedMeta = genExportedMeta;
|
|
9
9
|
exports.getLaunchAgreementUrl = exports.getAppCapabilities = void 0;
|
|
10
10
|
exports.getNameByTitle = getNameByTitle;
|
|
11
|
-
exports.getServerUrl = void 0;
|
|
11
|
+
exports.getWalletType = exports.getServerUrl = void 0;
|
|
12
12
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
13
13
|
var _pick = _interopRequireDefault(require("lodash/pick"));
|
|
14
14
|
var _pickBy = _interopRequireDefault(require("lodash/pickBy"));
|
|
@@ -230,4 +230,30 @@ const fixBlocklet = async function fixBlocklet(blocklet) {
|
|
|
230
230
|
}
|
|
231
231
|
blocklet.capabilities = getAppCapabilities(blocklet);
|
|
232
232
|
};
|
|
233
|
-
exports.fixBlocklet = fixBlocklet;
|
|
233
|
+
exports.fixBlocklet = fixBlocklet;
|
|
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;
|
|
258
|
+
};
|
|
259
|
+
exports.getWalletType = getWalletType;
|
package/lib/locales/en.js
CHANGED
|
@@ -228,6 +228,7 @@ module.exports = {
|
|
|
228
228
|
requiredErrorText: '{name} is required',
|
|
229
229
|
resource: 'Resource',
|
|
230
230
|
restart: 'Restart',
|
|
231
|
+
restore: 'Restore',
|
|
231
232
|
retry: 'Retry',
|
|
232
233
|
revoke: 'Revoke',
|
|
233
234
|
role: 'Role',
|
|
@@ -306,6 +307,7 @@ module.exports = {
|
|
|
306
307
|
reloadSuccess: 'Blocklet was reloaded successfully',
|
|
307
308
|
statusTip: 'Blocklet is {status}',
|
|
308
309
|
initialUptime: 'Less than 1m',
|
|
310
|
+
dashboard: 'Blocklet Dashboard',
|
|
309
311
|
fromUrl: {
|
|
310
312
|
title: 'Install Blocklet',
|
|
311
313
|
label: 'Blocklet Meta URL',
|
|
@@ -321,8 +323,8 @@ module.exports = {
|
|
|
321
323
|
confirmStop: 'Yes, Stop It',
|
|
322
324
|
cancelDownloadDescription: 'Cancel download {name} ?',
|
|
323
325
|
removeApplicationDescription: 'Removing the application will erase code and data generated by this application, which is not recoverable if you do not have any backups',
|
|
324
|
-
removeApplicationAfterBackup: 'Backup and
|
|
325
|
-
removeApplicationComplete: '
|
|
326
|
+
removeApplicationAfterBackup: 'Backup and remove the application. You can restore the application from this server if you need',
|
|
327
|
+
removeApplicationComplete: 'Remove both code and data for this application',
|
|
326
328
|
removeComponentDescription: 'Removing the component will erase code and data generated by this component, which is not recoverable if you do not have any backups',
|
|
327
329
|
removeComponentKeepData: 'Keep data for this component, only remove code',
|
|
328
330
|
removeComponentComplete: 'Remove both code and data for this component',
|
|
@@ -1105,8 +1107,8 @@ module.exports = {
|
|
|
1105
1107
|
confirmInstall: 'Confirm Installation',
|
|
1106
1108
|
dialog: {
|
|
1107
1109
|
title: 'Authorization Required',
|
|
1108
|
-
freeDescription: 'You need to present Blocklet
|
|
1109
|
-
freeServerlessDescription: 'Please provide
|
|
1110
|
+
freeDescription: 'You need to present Blocklet Space NFT or Blocklet Server Passport to launch application',
|
|
1111
|
+
freeServerlessDescription: 'Please provide Blocklet Space NFT',
|
|
1110
1112
|
nonFreeDescription: 'You need to present application purchase NFT and Blocklet Server NFT to launch application',
|
|
1111
1113
|
confirm: 'Confirm on your DID Wallet',
|
|
1112
1114
|
success: 'Authorization Successfully',
|
|
@@ -1151,6 +1153,7 @@ module.exports = {
|
|
|
1151
1153
|
title: 'Lost Passport',
|
|
1152
1154
|
description: 'The owner of {name} can scan the QR code to retrieve the passport, members please contact the owner to reissue the passport',
|
|
1153
1155
|
dialog: {
|
|
1156
|
+
title: 'Recover Passport',
|
|
1154
1157
|
scan: 'Use your DID Wallet to recover the passport',
|
|
1155
1158
|
confirm: 'Confirm on your DID Wallet',
|
|
1156
1159
|
success: 'The passport has been successfully added in your wallet'
|
package/lib/locales/zh.js
CHANGED
|
@@ -234,6 +234,7 @@ module.exports = {
|
|
|
234
234
|
requiredErrorText: '{name}是必填的',
|
|
235
235
|
resource: '资源',
|
|
236
236
|
restart: '重启',
|
|
237
|
+
restore: '还原',
|
|
237
238
|
retry: '重试',
|
|
238
239
|
revoke: '撤销',
|
|
239
240
|
role: '角色',
|
|
@@ -312,13 +313,14 @@ module.exports = {
|
|
|
312
313
|
reloadSuccess: 'Blocklet 重启成功',
|
|
313
314
|
statusTip: 'Blocklet {status}',
|
|
314
315
|
initialUptime: '少于1分钟',
|
|
316
|
+
dashboard: 'Blocklet 控制台',
|
|
315
317
|
action: {
|
|
316
318
|
stopDescription: '停止该基石程序将会使页面不可以访问,可能会导致使用它的用户出现错误',
|
|
317
319
|
confirmStop: '是的,停止',
|
|
318
320
|
cancelDownloadDescription: '取消下载 {name} ?',
|
|
319
321
|
removeApplicationDescription: '如果没有备份数据,删除应用将会删除所有数据,包括应用运行时产生的所有数据',
|
|
320
|
-
removeApplicationAfterBackup: '
|
|
321
|
-
removeApplicationComplete: '
|
|
322
|
+
removeApplicationAfterBackup: '备份后删除应用。 需要时您可以从此服务器恢复该应用',
|
|
323
|
+
removeApplicationComplete: '直接删除应用程序和数据',
|
|
322
324
|
removeComponentDescription: '如果没有备份数据,删除该组件将会删除所有数据,包括组件运行时产生的所有数据',
|
|
323
325
|
removeComponentKeepData: '保留该组件的数据,只删除组件',
|
|
324
326
|
removeComponentComplete: '删除组件和数据',
|
|
@@ -1111,8 +1113,8 @@ module.exports = {
|
|
|
1111
1113
|
confirmInstall: '确认安装',
|
|
1112
1114
|
dialog: {
|
|
1113
1115
|
title: '需要您的授权',
|
|
1114
|
-
freeDescription: '
|
|
1115
|
-
freeServerlessDescription: '
|
|
1116
|
+
freeDescription: '你需要提供应用空间 NFT 或节点通行证凭据来启动应用',
|
|
1117
|
+
freeServerlessDescription: '请提应用空间 NFT',
|
|
1116
1118
|
nonFreeDescription: '你需要提供应用购买凭证和节点通行证来启动应用',
|
|
1117
1119
|
confirm: '在您的 DID 钱包上确认',
|
|
1118
1120
|
success: '授权成功',
|
|
@@ -1156,6 +1158,7 @@ module.exports = {
|
|
|
1156
1158
|
title: '找回通行证',
|
|
1157
1159
|
description: '{name} 所有者可扫描二维码找回通行证,成员请联系所有者重新颁发通行证',
|
|
1158
1160
|
dialog: {
|
|
1161
|
+
title: '找回通行证',
|
|
1159
1162
|
scan: '用您的 DID 钱包扫描下面的二维码',
|
|
1160
1163
|
confirm: '在您的 DID 钱包上确认',
|
|
1161
1164
|
success: '通行证已成功添加到您的 DID 钱包'
|
package/lib/lost-passport.js
CHANGED
|
@@ -170,6 +170,7 @@ function LostPassport(_ref2) {
|
|
|
170
170
|
onSuccess: onGetUser,
|
|
171
171
|
locale: locale,
|
|
172
172
|
messages: {
|
|
173
|
+
title: t('lostPassport.dialog.title'),
|
|
173
174
|
scan: t('lostPassport.dialog.scan'),
|
|
174
175
|
confirm: t('lostPassport.dialog.confirm'),
|
|
175
176
|
success: t('lostPassport.dialog.success')
|
|
@@ -260,6 +261,7 @@ function LostPassport(_ref2) {
|
|
|
260
261
|
onSuccess: onReceivePassport,
|
|
261
262
|
locale: locale,
|
|
262
263
|
messages: {
|
|
264
|
+
title: "".concat(t('lostPassport.dialog.title')),
|
|
263
265
|
scan: t('lostPassport.dialog.scan'),
|
|
264
266
|
confirm: t('lostPassport.dialog.confirm'),
|
|
265
267
|
success: t('lostPassport.dialog.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-
|
|
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-
|
|
25
|
-
"@abtnode/constant": "1.16.0-beta-
|
|
26
|
-
"@abtnode/util": "1.16.0-beta-
|
|
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-
|
|
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-
|
|
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": "
|
|
92
|
+
"gitHead": "c25ddcc371454b2e2f7038aa5e64c7b7c27763cb"
|
|
92
93
|
}
|