@abtnode/ux 1.16.6-beta-4562aa60 → 1.16.6-beta-eaa4d39d

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.
@@ -30,6 +30,20 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
30
30
  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; }
31
31
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
32
32
  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); }
33
+ const getDescription = (data, t) => {
34
+ let {
35
+ description
36
+ } = data;
37
+ if (Object.values(_constant.CHAIN_PROP_MAP).includes(data.key)) {
38
+ description = "".concat(data.description, " (").concat(t('blocklet.config.sharedToAllComponents'), ")");
39
+ }
40
+ return description && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
41
+ style: {
42
+ marginLeft: 12
43
+ },
44
+ children: description
45
+ });
46
+ };
33
47
  function ComponentEnvironment(_ref) {
34
48
  let {
35
49
  blocklet,
@@ -141,7 +155,7 @@ function ComponentEnvironment(_ref) {
141
155
  const sharedConfigObj = (0, _util.getSharedConfigObj)(blocklet, ancestors);
142
156
  const missingRequiredConfigs = (0, _util.getComponentMissingConfigs)(blocklet, ancestors);
143
157
  const configs = componentConfigs.map(x => _objectSpread(_objectSpread({}, x), {}, {
144
- value: sharedConfigObj[x.key] || x.value
158
+ value: Object.values(_constant.CHAIN_PROP_MAP).includes(x.key) && Object.keys(sharedConfigObj).includes(x.key) ? sharedConfigObj[x.key] : sharedConfigObj[x.key] || x.value
145
159
  }));
146
160
  const hasBWAConfig = configs.some(x => x.key && x.key.startsWith('BWA_'));
147
161
  const action = {
@@ -224,12 +238,7 @@ function ComponentEnvironment(_ref) {
224
238
  placeholder: t('blocklet.config.environment.value'),
225
239
  margin: "dense",
226
240
  autoFocus: true
227
- }), rowData.description && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
228
- style: {
229
- marginLeft: 12
230
- },
231
- children: rowData.description
232
- })]
241
+ }), getDescription(rowData, t)]
233
242
  });
234
243
  }
235
244
  }];
@@ -74,7 +74,10 @@ const SpaceConnector = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
74
74
  } = (0, _react.useContext)(_context.LocaleContext);
75
75
  /** @type {{ blocklet: import('@abtnode/client').BlockletState }} */
76
76
  const {
77
- blocklet
77
+ blocklet,
78
+ actions: {
79
+ refreshBlocklet
80
+ }
78
81
  } = (0, _blocklet.useBlockletContext)();
79
82
  const [gatewayUrl, setGatewayUrl] = (0, _react.useState)('');
80
83
  const spaceProps = (0, _react.useMemo)(() => {
@@ -116,6 +119,7 @@ const SpaceConnector = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
116
119
  open: false
117
120
  }));
118
121
  onConnect === null || onConnect === void 0 ? void 0 : onConnect();
122
+ refreshBlocklet();
119
123
  }, 3000);
120
124
  };
121
125
  const [authorizeConnect, setAuthorizeConnect] = (0, _react.useState)({
@@ -4,29 +4,35 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = BlockletOverview;
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
8
8
  var _styled = _interopRequireDefault(require("@emotion/styled"));
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
- var _Box = _interopRequireDefault(require("@mui/material/Box"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
11
  var _Alert = _interopRequireDefault(require("@mui/material/Alert"));
12
+ var _Box = _interopRequireDefault(require("@mui/material/Box"));
12
13
  var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
13
- var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
14
- var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
15
- var _Tag = _interopRequireDefault(require("@arcblock/ux/lib/Tag"));
14
+ var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
15
+ var _ExpandLess = _interopRequireDefault(require("@mui/icons-material/ExpandLess"));
16
+ var _base = require("@abtnode/util/lib/base32");
17
+ var _Empty = _interopRequireDefault(require("@arcblock/ux/lib/Empty"));
16
18
  var _InfoRow = _interopRequireDefault(require("@arcblock/ux/lib/InfoRow"));
17
- var _util = require("@blocklet/meta/lib/util");
18
19
  var _context = require("@arcblock/ux/lib/Locale/context");
19
- var _Empty = _interopRequireDefault(require("@arcblock/ux/lib/Empty"));
20
+ var _Tag = _interopRequireDefault(require("@arcblock/ux/lib/Tag"));
21
+ var _util = require("@blocklet/meta/lib/util");
22
+ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
23
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
20
24
  var _blocklet = require("../contexts/blocklet");
21
25
  var _node = require("../contexts/node");
22
- var _util2 = require("../util");
23
26
  var _didAddress = _interopRequireDefault(require("../did-address"));
24
- var _status = _interopRequireDefault(require("./status"));
27
+ var _util2 = require("../util");
28
+ var _expiration = _interopRequireDefault(require("./component/expiration"));
25
29
  var _domainStatus = _interopRequireDefault(require("./router/domain-status"));
30
+ var _status = _interopRequireDefault(require("./status"));
26
31
  var _types = require("./types");
27
- var _expiration = _interopRequireDefault(require("./component/expiration"));
28
32
  var _jsxRuntime = require("react/jsx-runtime");
29
33
  var _templateObject, _templateObject2;
34
+ 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); }
35
+ 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; }
30
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
37
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
32
38
  function DomainLink(_ref) {
@@ -90,6 +96,8 @@ function BlockletOverview() {
90
96
  info: nodeInfo,
91
97
  inService
92
98
  } = (0, _node.useNodeContext)();
99
+ const [showAllDomains, setShowAllDomains] = (0, _react.useState)(false);
100
+ const [showAllDIDs, setShowAllDIDs] = (0, _react.useState)(false);
93
101
  const {
94
102
  blocklet,
95
103
  loadingRuntimeInfo
@@ -111,9 +119,18 @@ function BlockletOverview() {
111
119
  })
112
120
  } : null, (migratedFrom === null || migratedFrom === void 0 ? void 0 : migratedFrom.length) > 1 ? {
113
121
  name: t('blocklet.alsoKnownAs'),
114
- value: migratedFrom.slice(1).map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
115
- did: x.appDid
116
- }))
122
+ value: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
123
+ children: [(showAllDIDs ? migratedFrom.slice(1) : migratedFrom.slice(1, 2)).map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
124
+ did: x.appDid
125
+ })), migratedFrom.length > 2 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
126
+ style: {
127
+ marginLeft: '18px'
128
+ },
129
+ endIcon: showAllDIDs ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandLess.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {}),
130
+ onClick: () => setShowAllDIDs(!showAllDIDs),
131
+ children: showAllDIDs ? t('common.collapseAll') : t('blocklet.router.showAllDIDs')
132
+ })]
133
+ })
117
134
  } : null, {
118
135
  name: t('common.name'),
119
136
  value: (0, _util.getDisplayName)(blocklet, true)
@@ -165,6 +182,10 @@ function BlockletOverview() {
165
182
  }
166
183
  const renderRows = rows => rows.map(row => {
167
184
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
185
+ style: {
186
+ display: 'flex',
187
+ alignItems: 'flex-start'
188
+ },
168
189
  valueComponent: "div",
169
190
  nameWidth: 120,
170
191
  name: row.name,
@@ -173,6 +194,17 @@ function BlockletOverview() {
173
194
  }, row.name);
174
195
  });
175
196
  const domains = (0, _util2.sortDomains)((_blocklet$site = blocklet.site) === null || _blocklet$site === void 0 ? void 0 : _blocklet$site.domainAliases);
197
+ const displayDomains = [];
198
+ const hiddenDomains = [];
199
+ const pidBase32 = (0, _base.encode)(blocklet.appPid);
200
+ domains.forEach(domain => {
201
+ const value = domain.value || '';
202
+ if (value.endsWith(nodeInfo.didDomain || 'did.abtnet.io') && !value.startsWith(pidBase32)) {
203
+ hiddenDomains.push(domain);
204
+ } else {
205
+ displayDomains.push(domain);
206
+ }
207
+ });
176
208
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, {
177
209
  component: "div",
178
210
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
@@ -191,7 +223,7 @@ function BlockletOverview() {
191
223
  severity: "warning",
192
224
  children: t('blocklet.router.noRunning')
193
225
  })
194
- }), domains.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
226
+ }), (showAllDomains ? domains : displayDomains).map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
195
227
  display: "flex",
196
228
  alignItems: "center",
197
229
  justifyContent: "space-between",
@@ -220,7 +252,17 @@ function BlockletOverview() {
220
252
  }
221
253
  })]
222
254
  })
223
- }, domain.value)), !domains.length && (loadingRuntimeInfo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
255
+ }, domain.value)), hiddenDomains.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
256
+ style: {
257
+ marginLeft: '20px',
258
+ marginTop: '12px'
259
+ },
260
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
261
+ endIcon: showAllDomains ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandLess.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {}),
262
+ onClick: () => setShowAllDomains(!showAllDomains),
263
+ children: showAllDomains ? t('common.collapseAll') : t('blocklet.router.showAllDomains')
264
+ })
265
+ }), !domains.length && (loadingRuntimeInfo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
224
266
  size: 16
225
267
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
226
268
  children: t('common.empty')
@@ -44,17 +44,14 @@ function useBackupProgress(_ref) {
44
44
  completed: false
45
45
  });
46
46
  const node = (0, _node.useNodeContext)();
47
- const webSocketClient = node.ws.getWsClient();
48
- (0, _react.useEffect)(() => {
49
- webSocketClient.on(_constant.BlockletEvents.backupProgress, data => {
50
- if (appDid === (data === null || data === void 0 ? void 0 : data.appDid)) {
51
- setProgress(preValue => _objectSpread(_objectSpread({}, preValue), data));
52
- }
53
- });
54
- return () => {
55
- webSocketClient.off(_constant.BlockletEvents.backupProgress);
56
- };
57
- }, [appDid, webSocketClient]);
47
+ const {
48
+ ws: {
49
+ useSubscription
50
+ }
51
+ } = node;
52
+ useSubscription(_constant.BlockletEvents.backupProgress, data => {
53
+ setProgress(preValue => _objectSpread(_objectSpread({}, preValue), data));
54
+ }, [appDid]);
58
55
  return progress;
59
56
  }
60
57
  function Storage() {
@@ -162,7 +159,7 @@ function Storage() {
162
159
  },
163
160
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.LinearProgress, {
164
161
  color: "primary",
165
- variant: "indeterminate",
162
+ variant: "determinate",
166
163
  value: progress === null || progress === void 0 ? void 0 : progress.progress
167
164
  })
168
165
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
package/lib/locales/en.js CHANGED
@@ -424,7 +424,8 @@ module.exports = {
424
424
  appDidChangeTipL2: 'The DID domain name of the application will change, and the original domain name will become invalid',
425
425
  appSkChangeTip: 'You are changing application secret key',
426
426
  walletTypeTitle: 'Update Wallet Type',
427
- appSkTitle: 'Update Application Secret Key'
427
+ appSkTitle: 'Update Application Secret Key',
428
+ sharedToAllComponents: 'Will be shared to all components'
428
429
  },
429
430
  overview: {
430
431
  source: 'Source',
@@ -528,7 +529,9 @@ module.exports = {
528
529
  urlInaccessible: 'It may be due to network reasons, the address is temporarily inaccessible',
529
530
  noAccessibleUrl: 'No accessible URL',
530
531
  domainLockTooltip: 'The system generated Domain cannot be edited.',
531
- urlLockTooltip: 'The system generated URL Path cannot be edited.'
532
+ urlLockTooltip: 'The system generated URL Path cannot be edited.',
533
+ showAllDomains: 'Show all domains',
534
+ showAllDIDs: 'Show all DIDs'
532
535
  },
533
536
  export: {
534
537
  title: 'Export Blocklet',
@@ -661,6 +664,7 @@ module.exports = {
661
664
  dialog: 'Click on "confirm" to install the update. Blocklet Server will enter maintenance mode until the update is completed and return to production mode automatically.',
662
665
  confirm: 'Upgrade',
663
666
  switchLabel: 'Auto Update Check',
667
+ enableBetaRelease: 'Enable Beta Release',
664
668
  setup: 'Preparing the upgrade',
665
669
  installing: 'Installing Blocklet Server v{version}',
666
670
  restarting: 'Restarting Blocklet Server',
package/lib/locales/zh.js CHANGED
@@ -429,7 +429,8 @@ module.exports = {
429
429
  appDidChangeTipL2: '应用的 DID 域名会发生变化,原域名将会失效',
430
430
  appSkChangeTip: '你正在修改应用私钥',
431
431
  walletTypeTitle: '修改钱包类型',
432
- appSkTitle: '修改应用私钥'
432
+ appSkTitle: '修改应用私钥',
433
+ sharedToAllComponents: '将共享给所有组件'
433
434
  },
434
435
  overview: {
435
436
  source: '来源',
@@ -535,7 +536,9 @@ module.exports = {
535
536
  urlInaccessible: '可能因为网络的原因,该地址暂时无法访问',
536
537
  noAccessibleUrl: '没有可访问的地址',
537
538
  domainLockTooltip: '无法编辑由系统生成的 域名',
538
- urlLockTooltip: '无法编辑由系统生成的 URL 路径'
539
+ urlLockTooltip: '无法编辑由系统生成的 URL 路径',
540
+ showAllDomains: '显示所有域名',
541
+ showAllDIDs: '显示所有 DID'
539
542
  },
540
543
  export: {
541
544
  title: '导出 Blocklet',
@@ -661,6 +664,7 @@ module.exports = {
661
664
  dialog: '点击 “确认” 安装更新。节点将进入维护模式,直到更新完成并自动返回生产模式。',
662
665
  confirm: '升级',
663
666
  switchLabel: '自动更新检查',
667
+ enableBetaRelease: '允许安装测试版',
664
668
  setup: '准备升级中',
665
669
  installing: '安装节点新版本(v{version})',
666
670
  restarting: '重新启动节点',
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.6-beta-4562aa60",
6
+ "version": "1.16.6-beta-eaa4d39d",
7
7
  "description": "UX components shared across abtnode packages",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -22,20 +22,20 @@
22
22
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@abtnode/auth": "1.16.6-beta-4562aa60",
26
- "@abtnode/constant": "1.16.6-beta-4562aa60",
27
- "@abtnode/util": "1.16.6-beta-4562aa60",
28
- "@arcblock/did-connect": "^2.5.27",
25
+ "@abtnode/auth": "1.16.6-beta-eaa4d39d",
26
+ "@abtnode/constant": "1.16.6-beta-eaa4d39d",
27
+ "@abtnode/util": "1.16.6-beta-eaa4d39d",
28
+ "@arcblock/did-connect": "^2.5.30",
29
29
  "@arcblock/did-motif": "^1.1.10",
30
- "@arcblock/icons": "^2.5.27",
31
- "@arcblock/react-hooks": "^2.5.27",
32
- "@arcblock/terminal": "^2.5.27",
33
- "@arcblock/ux": "^2.5.27",
34
- "@blocklet/constant": "1.16.6-beta-4562aa60",
35
- "@blocklet/launcher-layout": "2.0.30",
30
+ "@arcblock/icons": "^2.5.30",
31
+ "@arcblock/react-hooks": "^2.5.30",
32
+ "@arcblock/terminal": "^2.5.30",
33
+ "@arcblock/ux": "^2.5.30",
34
+ "@blocklet/constant": "1.16.6-beta-eaa4d39d",
35
+ "@blocklet/launcher-layout": "2.0.32",
36
36
  "@blocklet/list": "^0.11.18",
37
- "@blocklet/meta": "1.16.6-beta-4562aa60",
38
- "@blocklet/ui-react": "^2.5.27",
37
+ "@blocklet/meta": "1.16.6-beta-eaa4d39d",
38
+ "@blocklet/ui-react": "^2.5.30",
39
39
  "@emotion/react": "^11.10.4",
40
40
  "@emotion/styled": "^11.10.4",
41
41
  "@iconify/react": "^4.0.0",
@@ -90,5 +90,5 @@
90
90
  "@babel/preset-react": "^7.18.6",
91
91
  "babel-plugin-inline-react-svg": "^1.1.2"
92
92
  },
93
- "gitHead": "e49856099ffc3c16eda77480a7ad93b2e9760764"
93
+ "gitHead": "0d2ab99f67109e989f8182fc70bc3ee9fa430585"
94
94
  }