@abtnode/ux 1.8.65-beta-81d3340c → 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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
}),
|
|
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)), !
|
|
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')
|
package/lib/blocklet/overview.js
CHANGED
|
@@ -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
|
-
}),
|
|
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)), !
|
|
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')
|
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.65-beta-
|
|
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.65-beta-
|
|
25
|
-
"@abtnode/constant": "1.8.65-beta-
|
|
26
|
-
"@abtnode/util": "1.8.65-beta-
|
|
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.65-beta-
|
|
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.65-beta-
|
|
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": "
|
|
89
|
+
"gitHead": "e5dc838baded7031096118462a604fd70d78ff1c"
|
|
90
90
|
}
|