@abtnode/ux 1.8.64 → 1.8.65-beta-5405baf2

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.
@@ -7,6 +7,7 @@ exports.default = BlockletAppAvatar;
7
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
8
8
  var _Avatar = _interopRequireDefault(require("@mui/material/Avatar"));
9
9
  var _Avatar2 = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar"));
10
+ var _constant = require("@blocklet/constant");
10
11
  var _useAppLogo = _interopRequireDefault(require("../hooks/use-app-logo"));
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  const _excluded = ["blocklet", "style", "size"];
@@ -41,10 +42,14 @@ function BlockletAppAvatar(_ref) {
41
42
  }
42
43
  });
43
44
  if (!blocklet.meta.logo) {
44
- imgEle = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar2.default, {
45
- did: blocklet.meta.did || '',
46
- responsive: true
47
- });
45
+ var _find;
46
+ const exist = (_find = (blocklet.configs || []).find(x => x.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE)) === null || _find === void 0 ? void 0 : _find.value;
47
+ if (!exist) {
48
+ imgEle = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar2.default, {
49
+ did: blocklet.meta.did || '',
50
+ responsive: true
51
+ });
52
+ }
48
53
  }
49
54
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, _objectSpread(_objectSpread({
50
55
  variant: variant || 'square',
@@ -80,9 +80,7 @@ function BlockletEnvironment(_ref) {
80
80
  const {
81
81
  site
82
82
  } = blocklet;
83
- const {
84
- domainAliases
85
- } = site;
83
+ const domains = (0, _util2.sortDomains)(site === null || site === void 0 ? void 0 : site.domainAliases);
86
84
  const clusterMode = (0, _get.default)(blocklet.meta, 'capabilities.clusterMode', false);
87
85
  useSubscription(_constant.EVENTS.NODE_RUNTIME_INFO, res => {
88
86
  if (clusterMode) {
@@ -398,7 +396,7 @@ function BlockletEnvironment(_ref) {
398
396
  }
399
397
  })
400
398
  })]
401
- }), domainAliases.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
399
+ }), domains.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
402
400
  display: "flex",
403
401
  alignItems: "center",
404
402
  justifyContent: "space-between",
@@ -460,7 +458,7 @@ function BlockletEnvironment(_ref) {
460
458
  })
461
459
  })
462
460
  })]
463
- }, domain.value)), !domainAliases.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
461
+ }, domain.value)), !domains.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
464
462
  mt: 4,
465
463
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
466
464
  children: t('common.empty')
@@ -99,7 +99,7 @@ const getEngineRows = (engine, t) => {
99
99
  }];
100
100
  };
101
101
  function BlockletOverview() {
102
- var _blocklet$settings;
102
+ var _blocklet$settings, _blocklet$site;
103
103
  const {
104
104
  t,
105
105
  locale
@@ -207,12 +207,7 @@ function BlockletOverview() {
207
207
  children: row.value
208
208
  }, row.name);
209
209
  });
210
- const {
211
- site
212
- } = blocklet;
213
- const {
214
- domainAliases = []
215
- } = site || {};
210
+ const domains = (0, _util2.sortDomains)((_blocklet$site = blocklet.site) === null || _blocklet$site === void 0 ? void 0 : _blocklet$site.domainAliases);
216
211
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, {
217
212
  component: "div",
218
213
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
@@ -231,7 +226,7 @@ function BlockletOverview() {
231
226
  severity: "warning",
232
227
  children: t('blocklet.router.noRunning')
233
228
  })
234
- }), domainAliases.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
229
+ }), domains.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
235
230
  display: "flex",
236
231
  alignItems: "center",
237
232
  justifyContent: "space-between",
@@ -260,7 +255,7 @@ function BlockletOverview() {
260
255
  }
261
256
  })]
262
257
  })
263
- }, domain.value)), !domainAliases.length && (loadingRuntimeInfo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner.default, {
258
+ }, domain.value)), !domains.length && (loadingRuntimeInfo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner.default, {
264
259
  size: 16
265
260
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
266
261
  children: t('common.empty')
@@ -71,6 +71,8 @@ function InvitationReceive(_ref) {
71
71
  className: "connect",
72
72
  action: "invite",
73
73
  checkFn: checkFn,
74
+ forceConnected: false,
75
+ autoConnect: false,
74
76
  checkTimeout: 10 * 60 * 1000,
75
77
  onSuccess: onSuccess,
76
78
  onClose: onClose,
@@ -105,6 +105,8 @@ function IssuePassport(_ref) {
105
105
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
106
106
  className: "connect",
107
107
  action: "issue-passport",
108
+ forceConnected: false,
109
+ autoConnect: false,
108
110
  checkFn: api.get,
109
111
  checkTimeout: 10 * 60 * 1000,
110
112
  socketUrl: api.socketUrl,
package/lib/locales/en.js CHANGED
@@ -1036,9 +1036,10 @@ module.exports = {
1036
1036
  appInfoDesc: 'Confirm the application information',
1037
1037
  author: 'Application Author: {author}',
1038
1038
  setup: 'Setup Blocklet',
1039
+ redirect: 'Redirect',
1039
1040
  alreadyRunning: 'Application {name} is already running on this Blocklet Server',
1040
1041
  alreadyInstalled: 'Application {name} is already installed on this Blocklet Server',
1041
- alreadyExists: 'This application already exists, please visit',
1042
+ alreadyExists: 'This application already exists, redirecting...',
1042
1043
  selectAbtNode: 'Select Blocklet Server',
1043
1044
  purchased: 'Already Purchased',
1044
1045
  purchase: 'Purchase',
package/lib/locales/zh.js CHANGED
@@ -1042,9 +1042,10 @@ module.exports = {
1042
1042
  appInfoDesc: '确认应用信息',
1043
1043
  author: '应用作者:{author}',
1044
1044
  setup: '设置应用',
1045
+ redirect: '跳转',
1045
1046
  alreadyRunning: '应用 {name} 已经运行在当前节点',
1046
1047
  alreadyInstalled: '应用 {name} 已经安装到当前节点,无需重复安装',
1047
- alreadyExists: '该应用已经存在,可直接访问',
1048
+ alreadyExists: '该应用已经存在,跳转中...',
1048
1049
  launchSuccess: '{appName} 已经启动成功!',
1049
1050
  selectAbtNode: '选择节点',
1050
1051
  nextStep: '下一步',
@@ -143,6 +143,8 @@ function LostPassport(_ref2) {
143
143
  hideCloseButton: true,
144
144
  className: "connect",
145
145
  action: "lost-passport-list",
146
+ forceConnected: false,
147
+ autoConnect: false,
146
148
  checkFn: api.get,
147
149
  checkTimeout: 10 * 60 * 1000,
148
150
  socketUrl: api.socketUrl,
package/lib/util/index.js CHANGED
@@ -40,7 +40,7 @@ exports.parseQuery = void 0;
40
40
  exports.patchJsxToLocale = patchJsxToLocale;
41
41
  exports.shouldCheckDomainStatus = void 0;
42
42
  exports.sleep = sleep;
43
- exports.validateDomain = exports.toSlotDomain = exports.stringSortHandlerAsc = void 0;
43
+ exports.validateDomain = exports.toSlotDomain = exports.stringSortHandlerAsc = exports.sortDomains = void 0;
44
44
  var _constant = require("@abtnode/constant");
45
45
  var _dayjs = _interopRequireDefault(require("dayjs"));
46
46
  require("moment/locale/zh-cn");
@@ -692,4 +692,25 @@ const getStoreList = _ref5 => {
692
692
  storeList
693
693
  };
694
694
  };
695
- exports.getStoreList = getStoreList;
695
+ exports.getStoreList = getStoreList;
696
+ const isDidDomainOrIpEchoDomain = domain => {
697
+ if (!domain) {
698
+ return false;
699
+ }
700
+ return domain.endsWith(_constant.DEFAULT_DID_DOMAIN) || domain.endsWith(_constant.DEFAULT_IP_DOMAIN_SUFFIX);
701
+ };
702
+ const sortDomains = domains => {
703
+ return (domains || []).sort((x, y) => {
704
+ if (isDidDomainOrIpEchoDomain(x.value) && isDidDomainOrIpEchoDomain(y.value)) {
705
+ return 0;
706
+ }
707
+ if (isDidDomainOrIpEchoDomain(x.value)) {
708
+ return 1;
709
+ }
710
+ if (isDidDomainOrIpEchoDomain(y.value)) {
711
+ return -1;
712
+ }
713
+ return 1;
714
+ });
715
+ };
716
+ exports.sortDomains = sortDomains;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.8.64",
6
+ "version": "1.8.65-beta-5405baf2",
7
7
  "description": "UX components shared across abtnode packages",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -21,18 +21,18 @@
21
21
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@abtnode/auth": "1.8.64",
25
- "@abtnode/constant": "1.8.64",
26
- "@abtnode/util": "1.8.64",
24
+ "@abtnode/auth": "1.8.65-beta-5405baf2",
25
+ "@abtnode/constant": "1.8.65-beta-5405baf2",
26
+ "@abtnode/util": "1.8.65-beta-5405baf2",
27
27
  "@arcblock/did-connect": "^2.4.66",
28
28
  "@arcblock/did-motif": "^1.1.10",
29
29
  "@arcblock/icons": "^2.4.66",
30
30
  "@arcblock/terminal": "^2.4.66",
31
31
  "@arcblock/ux": "^2.4.66",
32
- "@blocklet/constant": "1.8.64",
32
+ "@blocklet/constant": "1.8.65-beta-5405baf2",
33
33
  "@blocklet/launcher-layout": "^1.9.50",
34
34
  "@blocklet/list": "^0.10.47",
35
- "@blocklet/meta": "1.8.64",
35
+ "@blocklet/meta": "1.8.65-beta-5405baf2",
36
36
  "@blocklet/ui-react": "^2.4.66",
37
37
  "@emotion/react": "^11.10.4",
38
38
  "@emotion/styled": "^11.10.4",
@@ -86,5 +86,5 @@
86
86
  "@babel/preset-react": "^7.18.6",
87
87
  "babel-plugin-inline-react-svg": "^1.1.2"
88
88
  },
89
- "gitHead": "2abf7d3078ae9251ddeb394b4f0d82de4d9ababe"
89
+ "gitHead": "e5dc838baded7031096118462a604fd70d78ff1c"
90
90
  }