@abtnode/ux 1.8.48 → 1.8.49
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/access/index.js +2 -2
- package/lib/blocklet/app-avatar.js +67 -0
- package/lib/blocklet/{avatar.js → bundle-avatar.js} +2 -2
- package/lib/blocklet/component/index.js +89 -43
- package/lib/blocklet/component/navigation/navigation-preview.js +2 -2
- package/lib/blocklet/configuration.js +15 -5
- package/lib/blocklet/preferences/index.js +2 -2
- package/lib/hooks/use-app-logo.js +24 -0
- package/lib/hooks/{use-avatar.js → use-bundle-logo.js} +3 -3
- package/lib/locales/en.js +5 -2
- package/lib/locales/zh.js +5 -2
- package/package.json +13 -13
|
@@ -23,7 +23,7 @@ var _blocklet = require("../../contexts/blocklet");
|
|
|
23
23
|
var _team = require("../../contexts/team");
|
|
24
24
|
var _util2 = require("../../util");
|
|
25
25
|
var _line = _interopRequireDefault(require("../component/line"));
|
|
26
|
-
var
|
|
26
|
+
var _bundleAvatar = _interopRequireDefault(require("../bundle-avatar"));
|
|
27
27
|
var _configAccess = _interopRequireWildcard(require("./config-access"));
|
|
28
28
|
var _config = _interopRequireDefault(require("../../who-can-access/config"));
|
|
29
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -111,7 +111,7 @@ function ComponentItem(_ref) {
|
|
|
111
111
|
onClick: () => canExpand && setExpand(!expand),
|
|
112
112
|
children: [canExpand ? expandIcon : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
113
113
|
width: 28
|
|
114
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
114
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bundleAvatar.default, {
|
|
115
115
|
blocklet: blocklet,
|
|
116
116
|
ancestors: ancestors
|
|
117
117
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = BlockletAppAvatar;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _Avatar = _interopRequireDefault(require("@mui/material/Avatar"));
|
|
9
|
+
var _Avatar2 = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar"));
|
|
10
|
+
var _useAppLogo = _interopRequireDefault(require("../hooks/use-app-logo"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
const _excluded = ["blocklet", "style", "size"];
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
+
function BlockletAppAvatar(_ref) {
|
|
20
|
+
let {
|
|
21
|
+
blocklet,
|
|
22
|
+
style,
|
|
23
|
+
size
|
|
24
|
+
} = _ref,
|
|
25
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
const {
|
|
27
|
+
logoUrl
|
|
28
|
+
} = (0, _useAppLogo.default)({
|
|
29
|
+
blocklet
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
variant
|
|
33
|
+
} = rest;
|
|
34
|
+
let imgEle = /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
35
|
+
src: logoUrl,
|
|
36
|
+
alt: "",
|
|
37
|
+
style: {
|
|
38
|
+
width: size
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
if (!blocklet.meta.logo) {
|
|
42
|
+
imgEle = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar2.default, {
|
|
43
|
+
did: blocklet.meta.did || '',
|
|
44
|
+
responsive: true
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, _objectSpread(_objectSpread({
|
|
48
|
+
variant: variant || 'square',
|
|
49
|
+
style: Object.assign({
|
|
50
|
+
backgroundColor: 'transparent',
|
|
51
|
+
width: size,
|
|
52
|
+
height: size,
|
|
53
|
+
borderRadius: 10
|
|
54
|
+
}, style)
|
|
55
|
+
}, rest), {}, {
|
|
56
|
+
children: imgEle
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
BlockletAppAvatar.propTypes = {
|
|
60
|
+
blocklet: _propTypes.default.object.isRequired,
|
|
61
|
+
style: _propTypes.default.object,
|
|
62
|
+
size: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
63
|
+
};
|
|
64
|
+
BlockletAppAvatar.defaultProps = {
|
|
65
|
+
style: {},
|
|
66
|
+
size: 40
|
|
67
|
+
};
|
|
@@ -7,7 +7,7 @@ exports.default = BlockletAvatar;
|
|
|
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
|
|
10
|
+
var _useBundleLogo = _interopRequireDefault(require("../hooks/use-bundle-logo"));
|
|
11
11
|
var _node = require("../contexts/node");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
const _excluded = ["blocklet", "style", "size", "ancestors"];
|
|
@@ -29,7 +29,7 @@ function BlockletAvatar(_ref) {
|
|
|
29
29
|
const {
|
|
30
30
|
logoUrl,
|
|
31
31
|
inService
|
|
32
|
-
} = (0,
|
|
32
|
+
} = (0, _useBundleLogo.default)({
|
|
33
33
|
blocklet,
|
|
34
34
|
ancestors
|
|
35
35
|
});
|
|
@@ -26,6 +26,7 @@ var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
|
26
26
|
var _ArrowForward = _interopRequireDefault(require("@mui/icons-material/ArrowForward"));
|
|
27
27
|
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
28
28
|
var _ChevronRight = _interopRequireDefault(require("@mui/icons-material/ChevronRight"));
|
|
29
|
+
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
29
30
|
var _Spinner = _interopRequireDefault(require("@arcblock/ux/lib/Spinner"));
|
|
30
31
|
var _InfoRow = _interopRequireDefault(require("@arcblock/ux/lib/InfoRow"));
|
|
31
32
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
@@ -43,7 +44,7 @@ var _version = _interopRequireDefault(require("../version"));
|
|
|
43
44
|
var _node = require("../../contexts/node");
|
|
44
45
|
var _util2 = require("../../util");
|
|
45
46
|
var _permission = _interopRequireDefault(require("../../permission"));
|
|
46
|
-
var
|
|
47
|
+
var _bundleAvatar = _interopRequireDefault(require("../bundle-avatar"));
|
|
47
48
|
var _mode = _interopRequireDefault(require("../mode"));
|
|
48
49
|
var _configuration = _interopRequireDefault(require("./configuration"));
|
|
49
50
|
var _delete = _interopRequireDefault(require("./delete"));
|
|
@@ -256,7 +257,7 @@ function ComponentItem(_ref) {
|
|
|
256
257
|
onClick: () => canExpand && setExpand(!expand),
|
|
257
258
|
children: [canExpand ? expandIcon : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
258
259
|
width: 28
|
|
259
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
260
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bundleAvatar.default, {
|
|
260
261
|
blocklet: blocklet,
|
|
261
262
|
ancestors: ancestors
|
|
262
263
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
@@ -321,7 +322,6 @@ function ComponentItem(_ref) {
|
|
|
321
322
|
target: "_blank",
|
|
322
323
|
href: href,
|
|
323
324
|
rel: "noopener noreferrer",
|
|
324
|
-
title: href,
|
|
325
325
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
326
326
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Launch.default, {})
|
|
327
327
|
})
|
|
@@ -508,19 +508,33 @@ function BlockletComponent(_ref4) {
|
|
|
508
508
|
const updateItem = updateList.find(x => x.id === id);
|
|
509
509
|
if (updateItem) {
|
|
510
510
|
const name = ancestors.slice(1).concat(b).map(x => x.meta.title || x.meta.name).join(' / ');
|
|
511
|
+
|
|
512
|
+
// groupId 为一级组件的 id
|
|
513
|
+
const groupId = (ancestors[1] || b).meta.did;
|
|
511
514
|
list.push({
|
|
515
|
+
groupId,
|
|
512
516
|
name,
|
|
513
517
|
version: b.meta.version,
|
|
514
518
|
newVersion: updateItem.meta.version
|
|
515
519
|
});
|
|
516
520
|
}
|
|
517
521
|
});
|
|
522
|
+
const checks = {};
|
|
523
|
+
list.forEach(x => {
|
|
524
|
+
if (!checks[x.groupId]) {
|
|
525
|
+
checks[x.groupId] = true;
|
|
526
|
+
} else {
|
|
527
|
+
x.disabled = true;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
518
530
|
setUpdateConfirm({
|
|
519
|
-
type: '
|
|
531
|
+
type: 'component',
|
|
520
532
|
params: {
|
|
521
533
|
updateId
|
|
522
534
|
},
|
|
523
|
-
list
|
|
535
|
+
list,
|
|
536
|
+
checks,
|
|
537
|
+
hasChecks: true
|
|
524
538
|
});
|
|
525
539
|
} catch (err) {
|
|
526
540
|
setLoading(false);
|
|
@@ -542,9 +556,11 @@ function BlockletComponent(_ref4) {
|
|
|
542
556
|
};
|
|
543
557
|
} else {
|
|
544
558
|
fn = api.upgradeComponents.bind(api);
|
|
559
|
+
const selectedComponents = Object.keys(updateConfirm.checks).filter(x => updateConfirm.checks[x]);
|
|
545
560
|
input = {
|
|
546
561
|
updateId: updateConfirm.params.updateId,
|
|
547
|
-
rootDid: blocklet.meta.did
|
|
562
|
+
rootDid: blocklet.meta.did,
|
|
563
|
+
selectedComponents
|
|
548
564
|
};
|
|
549
565
|
}
|
|
550
566
|
try {
|
|
@@ -576,6 +592,23 @@ function BlockletComponent(_ref4) {
|
|
|
576
592
|
removeDeletingDid(d.meta.did);
|
|
577
593
|
}
|
|
578
594
|
};
|
|
595
|
+
const onUpdateChecksChange = (e, groupId) => {
|
|
596
|
+
const {
|
|
597
|
+
checked: newValue
|
|
598
|
+
} = e.target;
|
|
599
|
+
setUpdateConfirm(x => {
|
|
600
|
+
const checks = Object.entries(x.checks).reduce((o, _ref6) => {
|
|
601
|
+
let [key, oldValue] = _ref6;
|
|
602
|
+
o[key] = groupId === key ? newValue : oldValue;
|
|
603
|
+
return o;
|
|
604
|
+
}, {});
|
|
605
|
+
const hasChecks = Object.values(checks).includes(true);
|
|
606
|
+
return _objectSpread(_objectSpread({}, x), {}, {
|
|
607
|
+
checks,
|
|
608
|
+
hasChecks
|
|
609
|
+
});
|
|
610
|
+
});
|
|
611
|
+
};
|
|
579
612
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, _objectSpread(_objectSpread({
|
|
580
613
|
component: "div"
|
|
581
614
|
}, rest), {}, {
|
|
@@ -623,10 +656,10 @@ function BlockletComponent(_ref4) {
|
|
|
623
656
|
display: "flex",
|
|
624
657
|
alignItems: "center",
|
|
625
658
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_addRule.default, {
|
|
626
|
-
children:
|
|
659
|
+
children: _ref7 => {
|
|
627
660
|
let {
|
|
628
661
|
open
|
|
629
|
-
} =
|
|
662
|
+
} = _ref7;
|
|
630
663
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button.default, {
|
|
631
664
|
disabled: loading || (0, _util2.isInProgress)(blocklet.status),
|
|
632
665
|
variant: "text",
|
|
@@ -643,10 +676,10 @@ function BlockletComponent(_ref4) {
|
|
|
643
676
|
}
|
|
644
677
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_add.default, {
|
|
645
678
|
blocklet: blocklet,
|
|
646
|
-
children:
|
|
679
|
+
children: _ref8 => {
|
|
647
680
|
let {
|
|
648
681
|
open
|
|
649
|
-
} =
|
|
682
|
+
} = _ref8;
|
|
650
683
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button.default, {
|
|
651
684
|
disabled: loading || (0, _util2.isInProgress)(blocklet.status),
|
|
652
685
|
variant: "text",
|
|
@@ -693,44 +726,57 @@ function BlockletComponent(_ref4) {
|
|
|
693
726
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
694
727
|
paddingY: 1.5,
|
|
695
728
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogTitle.default, {
|
|
696
|
-
children: t('blocklet.component.updateTitle')
|
|
729
|
+
children: updateConfirm.type === 'component' ? t('blocklet.component.updateTitle') : t('blocklet.component.updateAppTitle')
|
|
697
730
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
698
731
|
component: _DialogContent.default,
|
|
699
732
|
py: 4,
|
|
700
|
-
ml: 4,
|
|
733
|
+
ml: updateConfirm.type === 'component' ? 0 : 4,
|
|
701
734
|
children: updateConfirm.list.map(x => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
717
|
-
item: true,
|
|
718
|
-
xs: 1,
|
|
719
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowForward.default, {
|
|
720
|
-
style: {
|
|
721
|
-
fontSize: '0.9em'
|
|
722
|
-
}
|
|
723
|
-
})
|
|
724
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
735
|
+
display: "flex",
|
|
736
|
+
alignItems: "center",
|
|
737
|
+
children: [updateConfirm.type === 'component' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
738
|
+
checked: updateConfirm.checks[x.groupId],
|
|
739
|
+
onChange: e => onUpdateChecksChange(e, x.groupId),
|
|
740
|
+
style: {
|
|
741
|
+
marginLeft: x.disabled ? 16 : 0
|
|
742
|
+
},
|
|
743
|
+
defaultChecked: true,
|
|
744
|
+
disabled: x.disabled
|
|
745
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
746
|
+
flexGrow: 1,
|
|
747
|
+
mt: 3,
|
|
748
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
725
749
|
item: true,
|
|
726
|
-
xs:
|
|
727
|
-
children:
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
750
|
+
xs: 8,
|
|
751
|
+
children: x.name
|
|
752
|
+
}), x.version && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Grid.default, {
|
|
753
|
+
fontSize: "h6.fontSize",
|
|
754
|
+
container: true,
|
|
755
|
+
spacing: 2,
|
|
756
|
+
alignItems: "center",
|
|
757
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
758
|
+
item: true,
|
|
759
|
+
xs: 3,
|
|
760
|
+
children: x.version
|
|
761
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
762
|
+
item: true,
|
|
763
|
+
xs: 1,
|
|
764
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowForward.default, {
|
|
765
|
+
style: {
|
|
766
|
+
fontSize: '0.9em'
|
|
767
|
+
}
|
|
768
|
+
})
|
|
769
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
770
|
+
item: true,
|
|
771
|
+
xs: 3,
|
|
772
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
773
|
+
color: "secondary.main",
|
|
774
|
+
children: x.newVersion
|
|
775
|
+
})
|
|
776
|
+
})]
|
|
731
777
|
})]
|
|
732
|
-
})]
|
|
733
|
-
}
|
|
778
|
+
}, "".concat(x.name, "-").concat(x.newVersion))]
|
|
779
|
+
}))
|
|
734
780
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_DialogActions.default, {
|
|
735
781
|
style: {
|
|
736
782
|
padding: '8px 24px 24px'
|
|
@@ -746,7 +792,7 @@ function BlockletComponent(_ref4) {
|
|
|
746
792
|
onConfirmUpdate();
|
|
747
793
|
},
|
|
748
794
|
color: "primary",
|
|
749
|
-
disabled: loading,
|
|
795
|
+
disabled: loading || updateConfirm.type === 'component' && !updateConfirm.hasChecks,
|
|
750
796
|
variant: "contained",
|
|
751
797
|
autoFocus: true,
|
|
752
798
|
children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner.default, {
|
|
@@ -12,7 +12,7 @@ var _linkBlocker = _interopRequireDefault(require("@blocklet/ui-react/lib/common
|
|
|
12
12
|
var _material = require("@mui/material");
|
|
13
13
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
14
14
|
var _blocklet = require("../../../contexts/blocklet");
|
|
15
|
-
var
|
|
15
|
+
var _useAppLogo = _interopRequireDefault(require("../../../hooks/use-app-logo"));
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
var _templateObject;
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -27,7 +27,7 @@ function NavigationPreview(_ref) {
|
|
|
27
27
|
} = (0, _blocklet.useBlockletContext)();
|
|
28
28
|
const {
|
|
29
29
|
logoUrl
|
|
30
|
-
} = (0,
|
|
30
|
+
} = (0, _useAppLogo.default)({
|
|
31
31
|
blocklet
|
|
32
32
|
});
|
|
33
33
|
const blockletInfo = {
|
|
@@ -101,8 +101,10 @@ function BlockletEnvironment(_ref) {
|
|
|
101
101
|
const customDelete = blocklet.environments.find(x => x.key === 'BLOCKLET_DELETABLE');
|
|
102
102
|
const deletable = !customDelete || customDelete.value === 'yes';
|
|
103
103
|
const customUrl = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_URL');
|
|
104
|
-
const customLogo = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO');
|
|
105
104
|
const customLogoSquare = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_SQUARE');
|
|
105
|
+
const customLogoRect = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_RECT');
|
|
106
|
+
const customLogoFavicon = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_FAVICON');
|
|
107
|
+
const customLogoDeprecated = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO');
|
|
106
108
|
const configurableEnvs = [{
|
|
107
109
|
key: _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,
|
|
108
110
|
description: t('blocklet.config.name'),
|
|
@@ -115,14 +117,22 @@ function BlockletEnvironment(_ref) {
|
|
|
115
117
|
key: _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,
|
|
116
118
|
description: t('blocklet.config.appUrl'),
|
|
117
119
|
value: customUrl ? customUrl.value : ''
|
|
118
|
-
}, {
|
|
119
|
-
key: _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO,
|
|
120
|
-
description: t('blocklet.config.logo'),
|
|
121
|
-
value: customLogo ? customLogo.value : ''
|
|
122
120
|
}, {
|
|
123
121
|
key: _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE,
|
|
124
122
|
description: t('blocklet.config.logoSquare'),
|
|
125
123
|
value: customLogoSquare ? customLogoSquare.value : ''
|
|
124
|
+
}, {
|
|
125
|
+
key: _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT,
|
|
126
|
+
description: t('blocklet.config.logoRect'),
|
|
127
|
+
value: customLogoRect ? customLogoRect.value : ''
|
|
128
|
+
}, {
|
|
129
|
+
key: _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON,
|
|
130
|
+
description: t('blocklet.config.logoFavicon'),
|
|
131
|
+
value: customLogoFavicon ? customLogoFavicon.value : ''
|
|
132
|
+
}, {
|
|
133
|
+
key: _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO,
|
|
134
|
+
description: t('blocklet.config.logo'),
|
|
135
|
+
value: customLogoDeprecated ? customLogoDeprecated.value : ''
|
|
126
136
|
}];
|
|
127
137
|
if (clusterMode) {
|
|
128
138
|
const exist = blocklet.configs.find(x => x.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE);
|
|
@@ -19,7 +19,7 @@ var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore
|
|
|
19
19
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
20
20
|
var _Tabs = _interopRequireDefault(require("@arcblock/ux/lib/Tabs"));
|
|
21
21
|
var _util = require("@blocklet/meta/lib/util");
|
|
22
|
-
var
|
|
22
|
+
var _bundleAvatar = _interopRequireDefault(require("../bundle-avatar"));
|
|
23
23
|
var _configuration = _interopRequireDefault(require("../configuration"));
|
|
24
24
|
var _index = _interopRequireDefault(require("../access/index"));
|
|
25
25
|
var _node = require("../../contexts/node");
|
|
@@ -45,7 +45,7 @@ const addComponentTabs = function addComponentTabs(tabs, blocklet) {
|
|
|
45
45
|
display: "flex",
|
|
46
46
|
alignItems: "center",
|
|
47
47
|
justifyContent: "flex-start",
|
|
48
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
48
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bundleAvatar.default, {
|
|
49
49
|
size: 24,
|
|
50
50
|
blocklet: blocklet,
|
|
51
51
|
ancestors: ancestors
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useAppLogo;
|
|
7
|
+
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
8
|
+
var _node = require("../contexts/node");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function useAppLogo(_ref) {
|
|
11
|
+
var _window$env, _blocklet$meta;
|
|
12
|
+
let {
|
|
13
|
+
blocklet
|
|
14
|
+
} = _ref;
|
|
15
|
+
const {
|
|
16
|
+
inService
|
|
17
|
+
} = (0, _node.useNodeContext)();
|
|
18
|
+
const prefix = ((_window$env = window.env) === null || _window$env === void 0 ? void 0 : _window$env.apiPrefix) || '/';
|
|
19
|
+
const search = "?v=".concat(blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version);
|
|
20
|
+
const logoUrl = (0, _urlJoin.default)(prefix, "/blocklet/logo/".concat(inService ? '' : blocklet.meta.did), search);
|
|
21
|
+
return {
|
|
22
|
+
logoUrl
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -19,15 +19,15 @@ function useAvatar(_ref) {
|
|
|
19
19
|
const {
|
|
20
20
|
inService
|
|
21
21
|
} = node;
|
|
22
|
-
const search = "?
|
|
23
|
-
let logoUrl = inService ? (0, _urlJoin.default)(_util.APP_PREFIX, _constant.WELLKNOWN_SERVICE_PATH_PREFIX, '/blocklet/logo', search) : (0, _urlJoin.default)(node.prefix, 'blocklet.png');
|
|
22
|
+
const search = "?v=".concat(blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version);
|
|
23
|
+
let logoUrl = inService ? (0, _urlJoin.default)(_util.APP_PREFIX, _constant.WELLKNOWN_SERVICE_PATH_PREFIX, '/blocklet/logo-bundle', search) : (0, _urlJoin.default)(node.prefix, 'blocklet.png');
|
|
24
24
|
if (blocklet.source === 'registry' && blocklet.deployedFrom && blocklet.meta.logo) {
|
|
25
25
|
logoUrl = (0, _urlJoin.default)(blocklet.deployedFrom, (0, _util.formatRegistryLogoPath)(blocklet.meta.bundleDid, blocklet.meta.logo), search);
|
|
26
26
|
} else {
|
|
27
27
|
const prefix = window.env.apiPrefix || '/';
|
|
28
28
|
const components = ancestors.concat(blocklet);
|
|
29
29
|
const list = inService ? components.slice(1) : components;
|
|
30
|
-
logoUrl = (0, _urlJoin.default)(prefix, "/blocklet/logo".concat(list.map(x => "/".concat(x.meta.did)).join('')), search);
|
|
30
|
+
logoUrl = (0, _urlJoin.default)(prefix, "/blocklet/logo-bundle".concat(list.map(x => "/".concat(x.meta.did)).join('')), search);
|
|
31
31
|
}
|
|
32
32
|
return {
|
|
33
33
|
logoUrl,
|
package/lib/locales/en.js
CHANGED
|
@@ -336,8 +336,10 @@ module.exports = {
|
|
|
336
336
|
name: 'Blocklet Name',
|
|
337
337
|
description: 'Blocklet Description',
|
|
338
338
|
sk: 'Secret key for the blocklet wallet',
|
|
339
|
-
logo: 'Logo URL or path for the blocklet
|
|
340
|
-
logoSquare: 'Square logo URL or path for the blocklet (optional, default to logo)',
|
|
339
|
+
logo: '(Deprecated) Logo URL or path for the blocklet',
|
|
340
|
+
logoSquare: 'Square logo URL or path for the blocklet (optional, default to logo from blocklet store)',
|
|
341
|
+
logoRect: 'Horizontal logo URL or path for the blocklet (optional)',
|
|
342
|
+
logoFavicon: 'favicon URL or path for the blocklet (optional, default to square logo)',
|
|
341
343
|
clusterSize: 'Instance count when run this blocklet in cluster mode',
|
|
342
344
|
deletable: {
|
|
343
345
|
name: 'Delete Protection',
|
|
@@ -437,6 +439,7 @@ module.exports = {
|
|
|
437
439
|
component: {
|
|
438
440
|
checkUpdateTitle: 'Check for Updates',
|
|
439
441
|
updateTitle: 'Update Components',
|
|
442
|
+
updateAppTitle: 'Update Blocklet',
|
|
440
443
|
noUpdate: 'No components to update',
|
|
441
444
|
add: 'Add Component',
|
|
442
445
|
selectComponent: 'Select Component',
|
package/lib/locales/zh.js
CHANGED
|
@@ -341,8 +341,10 @@ module.exports = {
|
|
|
341
341
|
name: '应用名称',
|
|
342
342
|
description: '应用描述',
|
|
343
343
|
sk: '应用账户私钥',
|
|
344
|
-
logo: '
|
|
345
|
-
logoSquare: '正方形 Logo 地址或路径 (
|
|
344
|
+
logo: '(即将废弃)应用 Logo 地址或路径',
|
|
345
|
+
logoSquare: '正方形 Logo 地址或路径 (可选,默认使用发布到 Store 的 Blocklet Logo)',
|
|
346
|
+
logoRect: '横版 Logo 地址或路径 (可选)',
|
|
347
|
+
logoFavicon: 'favicon 地址或路径 (可选,默认和正方形 Logo 相同)',
|
|
346
348
|
clusterSize: '以 Cluster 模式启动时的实例数量',
|
|
347
349
|
deletable: {
|
|
348
350
|
name: '删除保护',
|
|
@@ -445,6 +447,7 @@ module.exports = {
|
|
|
445
447
|
component: {
|
|
446
448
|
checkUpdateTitle: '检查更新',
|
|
447
449
|
updateTitle: '更新组件',
|
|
450
|
+
updateAppTitle: '更新 Blocklet',
|
|
448
451
|
noUpdate: '没有需要更新的组件',
|
|
449
452
|
add: '添加组件',
|
|
450
453
|
selectComponent: '选择组件',
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.49",
|
|
7
7
|
"description": "UX components shared across abtnode packages",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@abtnode/auth": "1.8.
|
|
25
|
-
"@abtnode/constant": "1.8.
|
|
26
|
-
"@abtnode/util": "1.8.
|
|
27
|
-
"@arcblock/did-connect": "^2.4.
|
|
24
|
+
"@abtnode/auth": "1.8.49",
|
|
25
|
+
"@abtnode/constant": "1.8.49",
|
|
26
|
+
"@abtnode/util": "1.8.49",
|
|
27
|
+
"@arcblock/did-connect": "^2.4.61",
|
|
28
28
|
"@arcblock/did-motif": "^1.1.10",
|
|
29
|
-
"@arcblock/icons": "^2.4.
|
|
30
|
-
"@arcblock/terminal": "^2.4.
|
|
31
|
-
"@arcblock/ux": "^2.4.
|
|
32
|
-
"@blocklet/constant": "1.8.
|
|
33
|
-
"@blocklet/launcher-layout": "^1.9.
|
|
29
|
+
"@arcblock/icons": "^2.4.61",
|
|
30
|
+
"@arcblock/terminal": "^2.4.61",
|
|
31
|
+
"@arcblock/ux": "^2.4.61",
|
|
32
|
+
"@blocklet/constant": "1.8.49",
|
|
33
|
+
"@blocklet/launcher-layout": "^1.9.28",
|
|
34
34
|
"@blocklet/list": "^0.10.43",
|
|
35
|
-
"@blocklet/meta": "1.8.
|
|
36
|
-
"@blocklet/ui-react": "^2.4.
|
|
35
|
+
"@blocklet/meta": "1.8.49",
|
|
36
|
+
"@blocklet/ui-react": "^2.4.61",
|
|
37
37
|
"@emotion/react": "^11.10.4",
|
|
38
38
|
"@emotion/styled": "^11.10.4",
|
|
39
39
|
"@iconify/react": "^4.0.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"@babel/preset-react": "^7.18.6",
|
|
85
85
|
"babel-plugin-inline-react-svg": "^1.1.2"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "627ac4fb21957fcbaf7c2c21e77de0f51ef9e30d"
|
|
88
88
|
}
|