@abtnode/ux 1.16.23-beta-f85576a6 → 1.16.23-beta-aeb9f5bd
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/es/blocklet/agreement.js +85 -16
- package/es/blocklet/component/add-component-button.js +50 -0
- package/es/blocklet/component/add-component-core.js +35 -12
- package/es/blocklet/component/add-component-dialog.js +78 -0
- package/es/blocklet/component/component-cell.js +509 -0
- package/es/blocklet/component/index.js +78 -532
- package/es/blocklet/component/line.js +7 -3
- package/es/blocklet/component/optional-component-cell.js +145 -0
- package/es/blocklet/component/related-components-dialog.js +189 -0
- package/es/blocklet/component/store-blocklet-list.js +8 -1
- package/es/blocklet/config-navigation.js +2 -1
- package/es/hooks/use-check-update-by-url.js +1 -1
- package/es/hooks/use-components-by-blocklet-meta-url.js +36 -0
- package/es/hooks/use-install-component-by-url.js +64 -0
- package/es/hooks/use-navigation.js +0 -16
- package/es/locales/ar.js +13 -4
- package/es/locales/de.js +13 -4
- package/es/locales/en.js +6 -0
- package/es/locales/es.js +13 -4
- package/es/locales/fr.js +13 -4
- package/es/locales/hi.js +13 -4
- package/es/locales/i18n.db +0 -0
- package/es/locales/id.js +13 -4
- package/es/locales/ja.js +13 -4
- package/es/locales/ko.js +13 -4
- package/es/locales/pt.js +13 -4
- package/es/locales/ru.js +13 -4
- package/es/locales/th.js +13 -4
- package/es/locales/vi.js +13 -4
- package/es/locales/zh-tw.js +13 -4
- package/es/locales/zh.js +10 -3
- package/es/team/members/index.js +4 -3
- package/es/team/members/member.js +3 -3
- package/lib/actions.js +2 -2
- package/lib/analytics/card.js +2 -2
- package/lib/analytics/chart.js +2 -2
- package/lib/analytics/disk.js +2 -2
- package/lib/analytics/traffic.js +2 -2
- package/lib/blocklet/actions.js +2 -2
- package/lib/blocklet/add-cert.js +2 -2
- package/lib/blocklet/agreement-app.js +2 -2
- package/lib/blocklet/agreement.js +70 -14
- package/lib/blocklet/app-avatar.js +2 -2
- package/lib/blocklet/bundle-avatar.js +2 -2
- package/lib/blocklet/component/add-component-button.js +57 -0
- package/lib/blocklet/component/add-component-core.js +40 -15
- package/lib/blocklet/component/add-component-dialog.js +85 -0
- package/lib/blocklet/component/button.js +2 -2
- package/lib/blocklet/component/component-cell.js +507 -0
- package/lib/blocklet/component/delete.js +2 -2
- package/lib/blocklet/component/did-space/connect-to.js +2 -2
- package/lib/blocklet/component/did-space/disconnect.js +2 -2
- package/lib/blocklet/component/did-space/item.js +2 -2
- package/lib/blocklet/component/domain-list.js +2 -2
- package/lib/blocklet/component/environment.js +2 -2
- package/lib/blocklet/component/index.js +76 -539
- package/lib/blocklet/component/line.js +7 -3
- package/lib/blocklet/component/navigation/navigation-dialog.js +2 -2
- package/lib/blocklet/component/navigation/simple-select.js +2 -2
- package/lib/blocklet/component/optional-component-cell.js +112 -0
- package/lib/blocklet/component/related-components-dialog.js +196 -0
- package/lib/blocklet/component/select-store.js +2 -2
- package/lib/blocklet/component/setting.js +2 -2
- package/lib/blocklet/component/sortable-tree.js +2 -2
- package/lib/blocklet/component/space-connector.js +2 -2
- package/lib/blocklet/component/space-selector.js +2 -2
- package/lib/blocklet/component/store-blocklet-list.js +10 -3
- package/lib/blocklet/component/switch-control.js +2 -2
- package/lib/blocklet/config-navigation.js +4 -3
- package/lib/blocklet/configuration.js +2 -2
- package/lib/blocklet/disk-info.js +2 -2
- package/lib/blocklet/install-from-url.js +2 -2
- package/lib/blocklet/log.js +2 -2
- package/lib/blocklet/mode.js +2 -2
- package/lib/blocklet/notification/email.js +2 -2
- package/lib/blocklet/oauth/auth0.js +2 -2
- package/lib/blocklet/oauth/common-settings.js +2 -2
- package/lib/blocklet/page-group.js +2 -2
- package/lib/blocklet/preferences/index.js +2 -2
- package/lib/blocklet/publish/create-project.js +2 -2
- package/lib/blocklet/publish/create-release.js +2 -2
- package/lib/blocklet/purchase/component-purchase.js +2 -2
- package/lib/blocklet/resource-type.js +2 -2
- package/lib/blocklet/router/action/add-domain-alias.js +2 -2
- package/lib/blocklet/router/action/add-rule.js +2 -2
- package/lib/blocklet/router/action/config-routing-rule.js +2 -2
- package/lib/blocklet/router/action/update-rule.js +2 -2
- package/lib/blocklet/router/add-domain.js +2 -2
- package/lib/blocklet/router/dns-tip.js +2 -2
- package/lib/blocklet/router/rule-actions.js +2 -2
- package/lib/blocklet/router/rule-list.js +2 -2
- package/lib/blocklet/runtime-info.js +2 -2
- package/lib/blocklet/status.js +2 -2
- package/lib/blocklet/storage/action.js +2 -2
- package/lib/blocklet/storage/auto-backup.js +2 -2
- package/lib/blocklet/storage/auto-check-update.js +2 -2
- package/lib/blocklet/storage/backups.js +2 -2
- package/lib/blocklet/storage/connect-to.js +2 -2
- package/lib/blocklet/storage/disconnect.js +2 -2
- package/lib/blocklet/storage/item.js +2 -2
- package/lib/blocklet/storage/preview-nft.js +2 -2
- package/lib/blocklet/version.js +2 -2
- package/lib/clear-cache.js +2 -2
- package/lib/click-to-copy.js +2 -2
- package/lib/confirm.js +2 -2
- package/lib/contexts/blocklet-storage.js +2 -2
- package/lib/contexts/node.js +2 -2
- package/lib/delete-confirm.js +2 -2
- package/lib/did-address.js +2 -2
- package/lib/empty-spinner.js +2 -2
- package/lib/form/form-autocomplete-input.js +2 -2
- package/lib/form/form-select-input.js +2 -2
- package/lib/form/form-text-input.js +2 -2
- package/lib/hooks/blocklet.js +2 -2
- package/lib/hooks/url-evaluation.js +2 -2
- package/lib/hooks/use-backup-progress.js +2 -2
- package/lib/hooks/use-check-update-by-url.js +0 -1
- package/lib/hooks/use-components-by-blocklet-meta-url.js +42 -0
- package/lib/hooks/use-install-component-by-url.js +73 -0
- package/lib/hooks/use-navigation.js +2 -18
- package/lib/images.js +2 -2
- package/lib/invitation/invitation-app.js +2 -2
- package/lib/invitation/invitation-receive.js +2 -2
- package/lib/launch-blocklet/content-layout.js +2 -2
- package/lib/layout/addon.js +2 -2
- package/lib/locales/ar.js +13 -4
- package/lib/locales/de.js +13 -4
- package/lib/locales/en.js +6 -0
- package/lib/locales/es.js +13 -4
- package/lib/locales/fr.js +13 -4
- package/lib/locales/hi.js +13 -4
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +13 -4
- package/lib/locales/ja.js +13 -4
- package/lib/locales/ko.js +13 -4
- package/lib/locales/pt.js +13 -4
- package/lib/locales/ru.js +13 -4
- package/lib/locales/th.js +13 -4
- package/lib/locales/vi.js +13 -4
- package/lib/locales/zh-tw.js +13 -4
- package/lib/locales/zh.js +10 -3
- package/lib/logs/log-terminal.js +2 -2
- package/lib/nav-logo.js +2 -2
- package/lib/notifications/default-icon-variants.js +2 -2
- package/lib/notifications/notification.js +2 -2
- package/lib/notifications/tag.js +2 -2
- package/lib/passport-tag.js +2 -2
- package/lib/permission.js +2 -2
- package/lib/relative-time.js +2 -2
- package/lib/schema-form/index.js +2 -2
- package/lib/schema-form/passport-input.js +2 -2
- package/lib/schema-form/text-input.js +2 -2
- package/lib/subscription.js +2 -2
- package/lib/tag.js +2 -2
- package/lib/team/members/index.js +5 -4
- package/lib/team/members/member.js +3 -3
- package/lib/team/members/passport-item.js +2 -2
- package/lib/team/members/passports.js +2 -2
- package/lib/team/passports/color.js +2 -2
- package/lib/team/passports/detail.js +2 -2
- package/lib/team/passports/trusted-factories.js +2 -2
- package/lib/team/passports/trusted-issuer.js +2 -2
- package/lib/team/passports/trusted-issuers.js +2 -2
- package/lib/team/search-input.js +2 -2
- package/lib/util/space-gateway.js +2 -2
- package/lib/wrap-locale.js +2 -2
- package/package.json +25 -23
- package/es/blocklet/component/add.js +0 -95
- package/lib/blocklet/component/add.js +0 -100
|
@@ -15,531 +15,56 @@ var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions
|
|
|
15
15
|
var _Update = _interopRequireDefault(require("@mui/icons-material/Update"));
|
|
16
16
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
17
17
|
var _Add = _interopRequireDefault(require("@mui/icons-material/Add"));
|
|
18
|
-
var _Badge = _interopRequireDefault(require("@mui/material/Badge"));
|
|
19
18
|
var _SettingsOutlined = _interopRequireDefault(require("@mui/icons-material/SettingsOutlined"));
|
|
20
|
-
var _InfoOutlined = _interopRequireDefault(require("@mui/icons-material/InfoOutlined"));
|
|
21
|
-
var _Launch = _interopRequireDefault(require("@mui/icons-material/Launch"));
|
|
22
19
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
23
20
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
24
21
|
var _ArrowForward = _interopRequireDefault(require("@mui/icons-material/ArrowForward"));
|
|
25
22
|
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
26
|
-
var _Replay = _interopRequireDefault(require("@mui/icons-material/Replay"));
|
|
27
|
-
var _Autorenew = _interopRequireDefault(require("@mui/icons-material/Autorenew"));
|
|
28
|
-
var _Delete = _interopRequireDefault(require("@mui/icons-material/Delete"));
|
|
29
23
|
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
30
24
|
var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
|
|
31
|
-
var _react2 = require("@iconify/react");
|
|
32
25
|
var _constant = require("@abtnode/constant");
|
|
33
26
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
34
|
-
var _InfoRow = _interopRequireDefault(require("@arcblock/ux/lib/InfoRow"));
|
|
35
27
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
36
28
|
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
37
29
|
var _Empty = _interopRequireDefault(require("@arcblock/ux/lib/Empty"));
|
|
38
30
|
var _util = require("@blocklet/meta/lib/util");
|
|
39
|
-
var _normalizePathPrefix = _interopRequireDefault(require("@abtnode/util/lib/normalize-path-prefix"));
|
|
40
31
|
var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
41
32
|
var _deletingBlocklets = require("../../contexts/deleting-blocklets");
|
|
42
|
-
var _didAddress = _interopRequireDefault(require("../../did-address"));
|
|
43
|
-
var _tag = _interopRequireDefault(require("../../tag"));
|
|
44
|
-
var _blockletSource = _interopRequireDefault(require("../blocklet-source"));
|
|
45
|
-
var _status = _interopRequireDefault(require("../status"));
|
|
46
|
-
var _version = _interopRequireDefault(require("../version"));
|
|
47
|
-
var _confirm = _interopRequireDefault(require("../../confirm"));
|
|
48
33
|
var _autoCheckUpdate = _interopRequireDefault(require("../storage/auto-check-update"));
|
|
49
34
|
var _node = require("../../contexts/node");
|
|
50
35
|
var _util2 = require("../../util");
|
|
51
36
|
var _permission = _interopRequireDefault(require("../../permission"));
|
|
52
|
-
var _bundleAvatar = _interopRequireDefault(require("../bundle-avatar"));
|
|
53
|
-
var _mode = _interopRequireDefault(require("../mode"));
|
|
54
37
|
var _configuration = _interopRequireDefault(require("./configuration"));
|
|
55
|
-
var
|
|
56
|
-
var _start = _interopRequireDefault(require("./start"));
|
|
57
|
-
var _line = _interopRequireDefault(require("./line"));
|
|
58
|
-
var _add = _interopRequireDefault(require("./add"));
|
|
38
|
+
var _addComponentButton = _interopRequireDefault(require("./add-component-button"));
|
|
59
39
|
var _addRule = _interopRequireDefault(require("../router/action/add-rule"));
|
|
60
40
|
var _ruleList = _interopRequireDefault(require("../router/rule-list"));
|
|
61
|
-
var
|
|
62
|
-
var
|
|
41
|
+
var _useCheckUpdateByUrl = _interopRequireDefault(require("../../hooks/use-check-update-by-url"));
|
|
42
|
+
var _useInstallComponentByUrl = _interopRequireDefault(require("../../hooks/use-install-component-by-url"));
|
|
43
|
+
var _componentCell = _interopRequireWildcard(require("./component-cell"));
|
|
44
|
+
var _optionalComponentCell = _interopRequireDefault(require("./optional-component-cell"));
|
|
45
|
+
var _addComponentDialog = _interopRequireDefault(require("./add-component-dialog"));
|
|
63
46
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
64
|
-
const _excluded = ["blocklet", "onUpdate", "getComponentUrl"];
|
|
65
47
|
var _templateObject, _templateObject2, _templateObject3;
|
|
48
|
+
const _excluded = ["blocklet", "onUpdate", "getComponentUrl"];
|
|
66
49
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
67
50
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
68
51
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
52
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
69
53
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
70
54
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
71
55
|
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; }
|
|
72
|
-
function _toPropertyKey(
|
|
73
|
-
function _toPrimitive(
|
|
56
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
57
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
74
58
|
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; }
|
|
75
59
|
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; }
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
if (!engine) {
|
|
79
|
-
return [];
|
|
80
|
-
}
|
|
81
|
-
return [{
|
|
82
|
-
name: t('common.name'),
|
|
83
|
-
value: engine.displayName
|
|
84
|
-
}, {
|
|
85
|
-
name: t('common.description'),
|
|
86
|
-
value: engine.description
|
|
87
|
-
}, {
|
|
88
|
-
name: t('common.version'),
|
|
89
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tag.default, {
|
|
90
|
-
children: engine.version
|
|
91
|
-
})
|
|
92
|
-
}];
|
|
93
|
-
};
|
|
94
|
-
const getSourceInfo = blocklet => {
|
|
95
|
-
const {
|
|
96
|
-
source,
|
|
97
|
-
deployedFrom,
|
|
98
|
-
bundleSource
|
|
99
|
-
} = blocklet;
|
|
100
|
-
if (source) {
|
|
101
|
-
return {
|
|
102
|
-
source,
|
|
103
|
-
deployedFrom
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
if (!bundleSource) {
|
|
107
|
-
return {
|
|
108
|
-
source: 'upload',
|
|
109
|
-
deployedFrom
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
if (bundleSource.url) {
|
|
113
|
-
return {
|
|
114
|
-
source: 'url',
|
|
115
|
-
deployedFrom: deployedFrom || Array.isArray(bundleSource.url) ? bundleSource.url[0] : bundleSource.url
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
if (bundleSource.store) {
|
|
119
|
-
return {
|
|
120
|
-
source: 'registry',
|
|
121
|
-
deployedFrom: deployedFrom || Array.isArray(bundleSource.store) ? bundleSource.store[0] : bundleSource.store
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
return {};
|
|
125
|
-
};
|
|
126
|
-
const getComponentName = (componentId, app) => {
|
|
127
|
-
const ids = componentId.split('/').slice(1);
|
|
128
|
-
let parent = app;
|
|
129
|
-
let index = 0;
|
|
130
|
-
const names = [];
|
|
131
|
-
while (parent && index < ids.length) {
|
|
132
|
-
// eslint-disable-next-line no-loop-func
|
|
133
|
-
const component = parent.children.find(x => x.meta.did === ids[index]);
|
|
134
|
-
parent = component;
|
|
135
|
-
index++;
|
|
136
|
-
if (component) {
|
|
137
|
-
names.push(component.meta.title);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return names.join(' / ');
|
|
141
|
-
};
|
|
142
|
-
const isPack = component => {
|
|
143
|
-
var _component$meta;
|
|
144
|
-
return (component === null || component === void 0 ? void 0 : (_component$meta = component.meta) === null || _component$meta === void 0 ? void 0 : _component$meta.group) === 'pack';
|
|
145
|
-
};
|
|
146
|
-
function ComponentItem(_ref) {
|
|
147
|
-
var _blocklet$dependents, _blocklet$meta$resour, _blocklet$dependents2, _blocklet$meta, _blocklet$dependents3;
|
|
148
|
-
let {
|
|
149
|
-
blocklet,
|
|
150
|
-
ancestors,
|
|
151
|
-
depth,
|
|
152
|
-
onRemove,
|
|
153
|
-
onStart,
|
|
154
|
-
onStop,
|
|
155
|
-
onRestart,
|
|
156
|
-
onReload,
|
|
157
|
-
getComponentUrl,
|
|
158
|
-
app
|
|
159
|
-
} = _ref;
|
|
160
|
-
const {
|
|
161
|
-
t,
|
|
162
|
-
locale
|
|
163
|
-
} = (0, _react.useContext)(_context.LocaleContext);
|
|
164
|
-
const [componentInfo, setComponentInfo] = (0, _react.useState)();
|
|
165
|
-
const [showDeleteConfirm, setShowDeleteConfirm] = (0, _react.useState)(false);
|
|
166
|
-
const [loading, setLoading] = (0, _react.useState)(false);
|
|
167
|
-
const [confirmSetting, setConfirmSetting] = (0, _react.useState)(null);
|
|
168
|
-
const {
|
|
169
|
-
deletingBlocklets: deletingComponents
|
|
170
|
-
} = (0, _deletingBlocklets.useDeletingBlockletContext)();
|
|
171
|
-
let {
|
|
172
|
-
status
|
|
173
|
-
} = blocklet;
|
|
174
|
-
if (depth === 1 && deletingComponents.includes(blocklet.meta.did)) {
|
|
175
|
-
status = 'deleting';
|
|
176
|
-
}
|
|
177
|
-
const mountPoint = "/".concat(blocklet.mountPoint || '/').replace(/\/+/g, '/');
|
|
178
|
-
const href = getComponentUrl(mountPoint);
|
|
179
|
-
const renderRows = rows => rows.map(row => {
|
|
180
|
-
if (row.name === t('common.did') || row.name === t('blocklet.appId')) {
|
|
181
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
182
|
-
valueComponent: "div",
|
|
183
|
-
nameWidth: 120,
|
|
184
|
-
name: row.name,
|
|
185
|
-
nameFormatter: () => row.name,
|
|
186
|
-
children: row.value
|
|
187
|
-
}, row.name);
|
|
188
|
-
}
|
|
189
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
190
|
-
valueComponent: "div",
|
|
191
|
-
nameWidth: 120,
|
|
192
|
-
name: row.name,
|
|
193
|
-
children: row.value
|
|
194
|
-
}, row.name);
|
|
195
|
-
});
|
|
196
|
-
const sourceInfo = componentInfo ? getSourceInfo(componentInfo) : {};
|
|
197
|
-
const componentRows = componentInfo ? [{
|
|
198
|
-
name: t('common.name'),
|
|
199
|
-
value: (0, _util.getDisplayName)(componentInfo, true)
|
|
200
|
-
}, {
|
|
201
|
-
name: t('common.version'),
|
|
202
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_version.default, {
|
|
203
|
-
blocklet: componentInfo,
|
|
204
|
-
checkUpgrade: false
|
|
205
|
-
})
|
|
206
|
-
}, {
|
|
207
|
-
name: t('common.status'),
|
|
208
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_status.default, {
|
|
209
|
-
status: status,
|
|
210
|
-
source: componentInfo.source,
|
|
211
|
-
progress: blocklet.progress
|
|
212
|
-
})
|
|
213
|
-
}, blocklet.status === 'running' ? {
|
|
214
|
-
name: t('blocklet.startedAt'),
|
|
215
|
-
value: (0, _util2.formatToDatetime)(blocklet.startedAt, locale)
|
|
216
|
-
} : null, blocklet.status !== 'running' ? {
|
|
217
|
-
name: t('blocklet.stoppedAt'),
|
|
218
|
-
value: (0, _util2.formatToDatetime)(blocklet.stoppedAt, locale)
|
|
219
|
-
} : null, blocklet.installedAt ? {
|
|
220
|
-
name: t('blocklet.installedAt'),
|
|
221
|
-
value: (0, _util2.formatToDatetime)(blocklet.installedAt, locale)
|
|
222
|
-
} : null, (0, _util.hasStartEngine)(blocklet.meta) ? {
|
|
223
|
-
name: t('common.mountPoint'),
|
|
224
|
-
value: mountPoint
|
|
225
|
-
} : null, componentInfo.meta.group ? {
|
|
226
|
-
name: t('common.group'),
|
|
227
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tag.default, {
|
|
228
|
-
type: "success",
|
|
229
|
-
children: componentInfo.meta.group
|
|
230
|
-
})
|
|
231
|
-
} : null, {
|
|
232
|
-
name: t('blocklet.overview.source'),
|
|
233
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockletSource.default, {
|
|
234
|
-
sourceInfo: sourceInfo,
|
|
235
|
-
blocklet: blocklet
|
|
236
|
-
})
|
|
237
|
-
}, {
|
|
238
|
-
name: t('blocklet.overview.deployedFrom'),
|
|
239
|
-
value: sourceInfo.deployedFrom || '-'
|
|
240
|
-
}, {
|
|
241
|
-
name: t('common.did'),
|
|
242
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
243
|
-
did: componentInfo.meta.did
|
|
244
|
-
})
|
|
245
|
-
}, {
|
|
246
|
-
name: t('common.author'),
|
|
247
|
-
value: (0, _util2.formatPerson)(componentInfo.meta.author)
|
|
248
|
-
}, {
|
|
249
|
-
name: t('common.engine'),
|
|
250
|
-
value: getEngineRows(componentInfo.engine, t).map(_ref2 => {
|
|
251
|
-
let {
|
|
252
|
-
name,
|
|
253
|
-
value
|
|
254
|
-
} = _ref2;
|
|
255
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
256
|
-
style: {
|
|
257
|
-
marginBottom: 4
|
|
258
|
-
},
|
|
259
|
-
nameWidth: 120,
|
|
260
|
-
name: name,
|
|
261
|
-
children: value
|
|
262
|
-
}, name);
|
|
263
|
-
})
|
|
264
|
-
}, (_blocklet$dependents = blocklet.dependents) !== null && _blocklet$dependents !== void 0 && _blocklet$dependents.length ? {
|
|
265
|
-
name: t('common.dependents'),
|
|
266
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
267
|
-
children: blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
268
|
-
children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
|
|
269
|
-
}, x.id))
|
|
270
|
-
})
|
|
271
|
-
} : null, (_blocklet$meta$resour = blocklet.meta.resources) !== null && _blocklet$meta$resour !== void 0 && _blocklet$meta$resour.length ? {
|
|
272
|
-
name: t('common.resource'),
|
|
273
|
-
value: blocklet.meta.resources.join(', ')
|
|
274
|
-
} : null].filter(Boolean) : [];
|
|
275
|
-
const appInProgress = (0, _util.isInProgress)(app.status);
|
|
276
|
-
const componentInProgress = (0, _util.isInProgress)(blocklet.status);
|
|
277
|
-
let deleteDisabledTip = '';
|
|
278
|
-
if (appInProgress || componentInProgress || depth === 1 && deletingComponents.includes(blocklet.meta.did)) {
|
|
279
|
-
deleteDisabledTip = t('blocklet.component.tip.stopBlocklet');
|
|
280
|
-
} else if ((_blocklet$dependents2 = blocklet.dependents) !== null && _blocklet$dependents2 !== void 0 && _blocklet$dependents2.length) {
|
|
281
|
-
const requires = blocklet.dependents.filter(x => x.required);
|
|
282
|
-
if (requires.length) {
|
|
283
|
-
const names = requires.map(x => getComponentName(x.id, app));
|
|
284
|
-
deleteDisabledTip = t('blocklet.component.tip.requiredBy', {
|
|
285
|
-
name: names.join(', ')
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
return [/*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledComponentRow, {
|
|
290
|
-
display: "flex",
|
|
291
|
-
py: 2,
|
|
292
|
-
className: "component-item",
|
|
293
|
-
justifyContent: "space-between",
|
|
294
|
-
alignItems: "center",
|
|
295
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
296
|
-
pl: 2,
|
|
297
|
-
width: {
|
|
298
|
-
xs: 300,
|
|
299
|
-
md: 400
|
|
300
|
-
},
|
|
301
|
-
display: "flex",
|
|
302
|
-
alignItems: "center",
|
|
303
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bundleAvatar.default, {
|
|
304
|
-
blocklet: blocklet,
|
|
305
|
-
ancestors: ancestors
|
|
306
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
307
|
-
ml: "16px",
|
|
308
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
309
|
-
className: "component-header",
|
|
310
|
-
onClick: () => setComponentInfo(blocklet),
|
|
311
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
312
|
-
className: "component-name",
|
|
313
|
-
children: (0, _util.getDisplayName)(blocklet, true)
|
|
314
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
315
|
-
className: "component-version",
|
|
316
|
-
children: blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version
|
|
317
|
-
})]
|
|
318
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
319
|
-
display: "flex",
|
|
320
|
-
alignItems: "center",
|
|
321
|
-
sx: {
|
|
322
|
-
mt: '2px',
|
|
323
|
-
ml: -0.5
|
|
324
|
-
},
|
|
325
|
-
children: [status !== 'unknown' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_status.default, {
|
|
326
|
-
style: {
|
|
327
|
-
marginLeft: 4
|
|
328
|
-
},
|
|
329
|
-
status: status,
|
|
330
|
-
source: blocklet.source,
|
|
331
|
-
progress: blocklet.progress
|
|
332
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_mode.default, {
|
|
333
|
-
style: {
|
|
334
|
-
marginLeft: 4
|
|
335
|
-
},
|
|
336
|
-
mode: blocklet.mode || ''
|
|
337
|
-
}), !!((_blocklet$dependents3 = blocklet.dependents) !== null && _blocklet$dependents3 !== void 0 && _blocklet$dependents3.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
338
|
-
title: ["".concat(t('common.dependents'), ": "), blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
339
|
-
pl: 1,
|
|
340
|
-
children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
|
|
341
|
-
}, x.id))],
|
|
342
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
343
|
-
display: "flex",
|
|
344
|
-
color: "primary.main",
|
|
345
|
-
ml: 1,
|
|
346
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
|
|
347
|
-
icon: "octicon:package-dependents-16"
|
|
348
|
-
})
|
|
349
|
-
})
|
|
350
|
-
})]
|
|
351
|
-
})]
|
|
352
|
-
})]
|
|
353
|
-
}, blocklet), (0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
354
|
-
sx: {
|
|
355
|
-
display: {
|
|
356
|
-
xs: 'none',
|
|
357
|
-
md: 'flex'
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
alignItems: "center",
|
|
361
|
-
flexGrow: "1",
|
|
362
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
363
|
-
target: "_blank",
|
|
364
|
-
href: href,
|
|
365
|
-
rel: "noopener noreferrer",
|
|
366
|
-
title: href,
|
|
367
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
368
|
-
maxWidth: 400,
|
|
369
|
-
sx: {
|
|
370
|
-
color: 'secondary.main',
|
|
371
|
-
fontSize: 18,
|
|
372
|
-
px: 2
|
|
373
|
-
},
|
|
374
|
-
overflow: "hidden",
|
|
375
|
-
whiteSpace: "nowrap",
|
|
376
|
-
textOverflow: "ellipsis",
|
|
377
|
-
children: (0, _normalizePathPrefix.default)(mountPoint)
|
|
378
|
-
})
|
|
379
|
-
})
|
|
380
|
-
}, mountPoint), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
381
|
-
display: "flex",
|
|
382
|
-
alignItems: "center",
|
|
383
|
-
children: [(0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
384
|
-
title: t('common.visit'),
|
|
385
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
386
|
-
target: "_blank",
|
|
387
|
-
href: href,
|
|
388
|
-
rel: "noopener noreferrer",
|
|
389
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
390
|
-
size: "small",
|
|
391
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Launch.default, {})
|
|
392
|
-
})
|
|
393
|
-
})
|
|
394
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_configuration.default, {
|
|
395
|
-
blocklet: blocklet,
|
|
396
|
-
ancestors: ancestors,
|
|
397
|
-
children: _ref3 => {
|
|
398
|
-
let {
|
|
399
|
-
open
|
|
400
|
-
} = _ref3;
|
|
401
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
402
|
-
title: t('common.config'),
|
|
403
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
|
|
404
|
-
color: "error",
|
|
405
|
-
badgeContent: "",
|
|
406
|
-
variant: "dot",
|
|
407
|
-
invisible: !(0, _util.getComponentMissingConfigs)(blocklet, ancestors[0]).length,
|
|
408
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
409
|
-
onClick: open,
|
|
410
|
-
size: "small",
|
|
411
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingsOutlined.default, {})
|
|
412
|
-
})
|
|
413
|
-
})
|
|
414
|
-
}, "config");
|
|
415
|
-
}
|
|
416
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_start.default, {
|
|
417
|
-
blocklet: app,
|
|
418
|
-
component: blocklet,
|
|
419
|
-
onStart: onStart,
|
|
420
|
-
onStop: onStop,
|
|
421
|
-
disabled: !['starting', 'stopping'].includes(app.status) && (0, _util.isInProgress)(app.status)
|
|
422
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_actions.default, {
|
|
423
|
-
"data-cy": "component-actions",
|
|
424
|
-
actions: [(0, _util.hasStartEngine)(blocklet.meta) ? {
|
|
425
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoOutlined.default, {}),
|
|
426
|
-
text: t('common.detail'),
|
|
427
|
-
onClick: () => {
|
|
428
|
-
setComponentInfo(blocklet);
|
|
429
|
-
}
|
|
430
|
-
} : null, !isPack(blocklet) && {
|
|
431
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Replay.default, {}),
|
|
432
|
-
text: t('common.restart'),
|
|
433
|
-
onClick: () => {
|
|
434
|
-
setConfirmSetting({
|
|
435
|
-
title: "".concat(t('common.restart'), " ").concat(blocklet.meta.title),
|
|
436
|
-
description: t('blocklet.action.restartDescription'),
|
|
437
|
-
confirm: t('blocklet.action.confirmRestart'),
|
|
438
|
-
cancel: t('common.cancel'),
|
|
439
|
-
onConfirm: async () => {
|
|
440
|
-
setLoading(true);
|
|
441
|
-
await onRestart(blocklet);
|
|
442
|
-
setLoading(false);
|
|
443
|
-
},
|
|
444
|
-
onCancel: () => setConfirmSetting(null)
|
|
445
|
-
});
|
|
446
|
-
},
|
|
447
|
-
disabled: appInProgress || componentInProgress || blocklet.status !== 'running'
|
|
448
|
-
}, !isPack(blocklet) && {
|
|
449
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autorenew.default, {}),
|
|
450
|
-
text: t('common.reload'),
|
|
451
|
-
onClick: async () => {
|
|
452
|
-
setLoading(true);
|
|
453
|
-
await onReload(blocklet);
|
|
454
|
-
setLoading(false);
|
|
455
|
-
},
|
|
456
|
-
disabled: loading || appInProgress || componentInProgress || blocklet.status !== 'running'
|
|
457
|
-
}, {
|
|
458
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Delete.default, {}),
|
|
459
|
-
text: t('common.delete'),
|
|
460
|
-
onClick: () => {
|
|
461
|
-
setShowDeleteConfirm(true);
|
|
462
|
-
},
|
|
463
|
-
disabled: appInProgress || componentInProgress || !!deleteDisabledTip,
|
|
464
|
-
tip: deleteDisabledTip
|
|
465
|
-
}].filter(Boolean)
|
|
466
|
-
})]
|
|
467
|
-
}, "actions")]
|
|
468
|
-
}, "group-not-gateway-box"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_line.default, {
|
|
469
|
-
depth: 2
|
|
470
|
-
}, "line"), !!componentInfo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
471
|
-
open: true,
|
|
472
|
-
fullWidth: true,
|
|
473
|
-
maxWidth: "md",
|
|
474
|
-
onClose: () => {
|
|
475
|
-
setComponentInfo(null);
|
|
476
|
-
},
|
|
477
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
478
|
-
paddingY: 1.5,
|
|
479
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogTitle.default, {
|
|
480
|
-
children: t('common.componentBasicInfo')
|
|
481
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContent.default, {
|
|
482
|
-
children: renderRows(componentRows)
|
|
483
|
-
})]
|
|
484
|
-
}, "dialog-wrapper")
|
|
485
|
-
}, "base-info-dialog"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_delete.default, {
|
|
486
|
-
blocklet: app,
|
|
487
|
-
component: blocklet,
|
|
488
|
-
remove: async function remove() {
|
|
489
|
-
setLoading(true);
|
|
490
|
-
try {
|
|
491
|
-
await onRemove(...arguments);
|
|
492
|
-
} catch (_unused) {
|
|
493
|
-
// ignore
|
|
494
|
-
}
|
|
495
|
-
setLoading(false);
|
|
496
|
-
setShowDeleteConfirm(false);
|
|
497
|
-
},
|
|
498
|
-
onCancel: () => setShowDeleteConfirm(false),
|
|
499
|
-
hideBtn: true,
|
|
500
|
-
showConfirm: showDeleteConfirm
|
|
501
|
-
}, "delete-component"), confirmSetting && /*#__PURE__*/(0, _jsxRuntime.jsx)(_confirm.default, {
|
|
502
|
-
title: confirmSetting.title,
|
|
503
|
-
description: confirmSetting.description,
|
|
504
|
-
confirm: confirmSetting.confirm,
|
|
505
|
-
cancel: confirmSetting.cancel,
|
|
506
|
-
params: confirmSetting.params,
|
|
507
|
-
onConfirm: confirmSetting.onConfirm,
|
|
508
|
-
onCancel: confirmSetting.onCancel
|
|
509
|
-
}, "confirm-setting")];
|
|
510
|
-
}
|
|
511
|
-
ComponentItem.propTypes = {
|
|
512
|
-
blocklet: _propTypes.default.object.isRequired,
|
|
513
|
-
ancestors: _propTypes.default.array,
|
|
514
|
-
depth: _propTypes.default.number,
|
|
515
|
-
onRemove: _propTypes.default.func,
|
|
516
|
-
onStart: _propTypes.default.func,
|
|
517
|
-
onStop: _propTypes.default.func,
|
|
518
|
-
onRestart: _propTypes.default.func,
|
|
519
|
-
onReload: _propTypes.default.func,
|
|
520
|
-
getComponentUrl: _propTypes.default.func,
|
|
521
|
-
app: _propTypes.default.object
|
|
522
|
-
};
|
|
523
|
-
ComponentItem.defaultProps = {
|
|
524
|
-
ancestors: [],
|
|
525
|
-
depth: 0,
|
|
526
|
-
onRemove: () => {},
|
|
527
|
-
onStart: () => {},
|
|
528
|
-
onStop: () => {},
|
|
529
|
-
onRestart: () => {},
|
|
530
|
-
onReload: () => {},
|
|
531
|
-
getComponentUrl: () => window.location.origin,
|
|
532
|
-
app: null
|
|
533
|
-
};
|
|
534
|
-
const StyledBadge = (0, _styled.default)(_Badge.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .BaseBadge-badge {\n top: ", "px;\n right: ", "px;\n }\n"])), props => props.top * 8 || 6, props => props.right * 8 || 6);
|
|
535
|
-
const StyledComponentRow = (0, _styled.default)(_Box.default)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .component-header {\n display: flex;\n align-items: center;\n align-items: flex-end;\n cursor: pointer;\n }\n .component-name {\n color: #222;\n font-size: 16px;\n }\n .component-version {\n color: #999;\n font-size: 12px;\n margin-left: 4px;\n transform: translateY(-1px);\n }\n"])));
|
|
536
|
-
function BlockletComponent(_ref4) {
|
|
60
|
+
function BlockletComponent(_ref) {
|
|
61
|
+
var _blocklet$optionalCom;
|
|
537
62
|
let {
|
|
538
63
|
blocklet,
|
|
539
64
|
onUpdate,
|
|
540
65
|
getComponentUrl
|
|
541
|
-
} =
|
|
542
|
-
rest = _objectWithoutProperties(
|
|
66
|
+
} = _ref,
|
|
67
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
543
68
|
const {
|
|
544
69
|
t
|
|
545
70
|
} = (0, _react.useContext)(_context.LocaleContext);
|
|
@@ -557,6 +82,7 @@ function BlockletComponent(_ref4) {
|
|
|
557
82
|
const [updateConfirm, setUpdateConfirm] = (0, _react.useState)(null);
|
|
558
83
|
const [showSettings, setShowSettings] = (0, _react.useState)(null);
|
|
559
84
|
const [showContainer, setShowContainer] = (0, _react.useState)(false);
|
|
85
|
+
const [installComponentMeta, setInstallComponentMeta] = (0, _react.useState)(null);
|
|
560
86
|
const needMigration = blocklet && blocklet.structVersion !== _constant.APP_STRUCT_VERSION;
|
|
561
87
|
|
|
562
88
|
// update dot is not used but maybe useful in the further
|
|
@@ -588,11 +114,11 @@ function BlockletComponent(_ref4) {
|
|
|
588
114
|
return;
|
|
589
115
|
}
|
|
590
116
|
const list = [];
|
|
591
|
-
(0, _util.forEachChildSync)(blocklet, (b,
|
|
117
|
+
(0, _util.forEachChildSync)(blocklet, (b, _ref2) => {
|
|
592
118
|
let {
|
|
593
119
|
id,
|
|
594
120
|
ancestors
|
|
595
|
-
} =
|
|
121
|
+
} = _ref2;
|
|
596
122
|
const updateItem = updateList.find(x => x.id === id);
|
|
597
123
|
if (updateItem) {
|
|
598
124
|
const name = ancestors.slice(1).concat(b).map(x => x.meta.title || x.meta.name).join(' / ');
|
|
@@ -725,8 +251,8 @@ function BlockletComponent(_ref4) {
|
|
|
725
251
|
checked: newValue
|
|
726
252
|
} = e.target;
|
|
727
253
|
setUpdateConfirm(x => {
|
|
728
|
-
const checks = Object.entries(x.checks).reduce((o,
|
|
729
|
-
let [key, oldValue] =
|
|
254
|
+
const checks = Object.entries(x.checks).reduce((o, _ref3) => {
|
|
255
|
+
let [key, oldValue] = _ref3;
|
|
730
256
|
o[key] = groupId === key ? newValue : oldValue;
|
|
731
257
|
return o;
|
|
732
258
|
}, {});
|
|
@@ -737,27 +263,27 @@ function BlockletComponent(_ref4) {
|
|
|
737
263
|
});
|
|
738
264
|
});
|
|
739
265
|
};
|
|
740
|
-
(0, _useCheckUpdateByUrl.
|
|
266
|
+
(0, _useCheckUpdateByUrl.default)(checkForUpdates);
|
|
267
|
+
const _installComponentMeta = (0, _useInstallComponentByUrl.default)({
|
|
268
|
+
blocklet,
|
|
269
|
+
scrollToComponent: true
|
|
270
|
+
});
|
|
271
|
+
const parseInstallComponentMeta = installComponentMeta || _installComponentMeta;
|
|
741
272
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, _objectSpread(_objectSpread({
|
|
742
273
|
component: "div"
|
|
743
274
|
}, rest), {}, {
|
|
744
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
275
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TitleRow, {
|
|
745
276
|
display: "flex",
|
|
746
|
-
|
|
747
|
-
alignItems: "center",
|
|
748
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
749
|
-
className: "title",
|
|
277
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TitleItem, {
|
|
750
278
|
flexDirection: "row",
|
|
279
|
+
className: "title",
|
|
751
280
|
display: "flex",
|
|
752
281
|
alignItems: "center",
|
|
753
|
-
style: {
|
|
754
|
-
marginLeft: '1em'
|
|
755
|
-
},
|
|
756
282
|
children: [t('common.components'), !needMigration && /*#__PURE__*/(0, _jsxRuntime.jsx)(_permission.default, {
|
|
757
283
|
permission: inService ? '' : 'mutate_blocklets',
|
|
758
284
|
role: inService ? _util2.BlockletAdminRoles : [],
|
|
759
285
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_autoCheckUpdate.default, {
|
|
760
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
|
|
286
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentCell.StyledBadge, {
|
|
761
287
|
top: 1.2,
|
|
762
288
|
right: 0.4,
|
|
763
289
|
color: "error",
|
|
@@ -793,15 +319,16 @@ function BlockletComponent(_ref4) {
|
|
|
793
319
|
display: "flex",
|
|
794
320
|
alignItems: "center",
|
|
795
321
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_addRule.default, {
|
|
796
|
-
children:
|
|
322
|
+
children: _ref4 => {
|
|
797
323
|
let {
|
|
798
324
|
open
|
|
799
|
-
} =
|
|
325
|
+
} = _ref4;
|
|
800
326
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button.default, {
|
|
801
327
|
disabled: loading || (0, _util.isInProgress)(blocklet.status),
|
|
802
328
|
variant: "text",
|
|
803
329
|
color: "primary",
|
|
804
330
|
"data-cy": "add-rule",
|
|
331
|
+
className: "sm-hide-icon",
|
|
805
332
|
onClick: open,
|
|
806
333
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Add.default, {
|
|
807
334
|
style: {
|
|
@@ -811,18 +338,19 @@ function BlockletComponent(_ref4) {
|
|
|
811
338
|
}), t('router.rule.add.title')]
|
|
812
339
|
});
|
|
813
340
|
}
|
|
814
|
-
}), !needMigration && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
341
|
+
}), !needMigration && /*#__PURE__*/(0, _jsxRuntime.jsx)(_addComponentButton.default, {
|
|
815
342
|
blocklet: blocklet,
|
|
816
343
|
serverVersion: info.version,
|
|
817
|
-
children:
|
|
344
|
+
children: _ref5 => {
|
|
818
345
|
let {
|
|
819
346
|
open
|
|
820
|
-
} =
|
|
347
|
+
} = _ref5;
|
|
821
348
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button.default, {
|
|
822
349
|
disabled: loading || (0, _util.isInProgress)(blocklet.status),
|
|
823
350
|
variant: "text",
|
|
824
351
|
color: "primary",
|
|
825
352
|
"data-cy": "add-component",
|
|
353
|
+
className: "sm-hide-icon",
|
|
826
354
|
onClick: open,
|
|
827
355
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Add.default, {
|
|
828
356
|
style: {
|
|
@@ -835,10 +363,10 @@ function BlockletComponent(_ref4) {
|
|
|
835
363
|
}), !needMigration && /*#__PURE__*/(0, _jsxRuntime.jsx)(_configuration.default, {
|
|
836
364
|
blocklet: blocklet,
|
|
837
365
|
ancestors: [],
|
|
838
|
-
children:
|
|
366
|
+
children: _ref6 => {
|
|
839
367
|
let {
|
|
840
368
|
open
|
|
841
|
-
} =
|
|
369
|
+
} = _ref6;
|
|
842
370
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
843
371
|
title: "".concat(t('blocklet.component.container')).concat(t('common.config')),
|
|
844
372
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
@@ -856,34 +384,36 @@ function BlockletComponent(_ref4) {
|
|
|
856
384
|
})]
|
|
857
385
|
})
|
|
858
386
|
})]
|
|
859
|
-
}), components !== null && components !== void 0 && components.length ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
387
|
+
}), components !== null && components !== void 0 && components.length ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
388
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
389
|
+
mt: 2,
|
|
390
|
+
children: [blocklet.meta.group !== 'gateway' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentCell.default, {
|
|
391
|
+
blocklet: blocklet,
|
|
392
|
+
app: blocklet,
|
|
393
|
+
onRemove: removeComponent,
|
|
394
|
+
onStart: startComponent,
|
|
395
|
+
onStop: stopComponent,
|
|
396
|
+
onReload: reloadComponent,
|
|
397
|
+
onRestart: restartComponent,
|
|
398
|
+
getComponentUrl: getComponentUrl
|
|
399
|
+
}, "0-".concat(blocklet.meta.did)), blocklet.children.map(component => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentCell.default, {
|
|
400
|
+
depth: 1,
|
|
401
|
+
blocklet: component,
|
|
402
|
+
ancestors: [blocklet],
|
|
403
|
+
app: blocklet,
|
|
404
|
+
onRemove: removeComponent,
|
|
405
|
+
onStart: startComponent,
|
|
406
|
+
onStop: stopComponent,
|
|
407
|
+
onReload: reloadComponent,
|
|
408
|
+
onRestart: restartComponent,
|
|
409
|
+
getComponentUrl: getComponentUrl
|
|
410
|
+
}, "1-".concat(component.meta.did)))]
|
|
411
|
+
}, "top-blocklet-".concat(blocklet.meta.did)), (_blocklet$optionalCom = blocklet.optionalComponents) === null || _blocklet$optionalCom === void 0 ? void 0 : _blocklet$optionalCom.map(component => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentCell.StyledComponentRow, {
|
|
412
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_optionalComponentCell.default, _objectSpread({
|
|
413
|
+
setInstallComponentMeta: setInstallComponentMeta
|
|
414
|
+
}, component))
|
|
415
|
+
}, component.meta.did))]
|
|
416
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
887
417
|
mt: 8,
|
|
888
418
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
|
|
889
419
|
children: t('blocklet.component.noComponent')
|
|
@@ -996,6 +526,11 @@ function BlockletComponent(_ref4) {
|
|
|
996
526
|
})
|
|
997
527
|
})]
|
|
998
528
|
})
|
|
529
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_addComponentDialog.default, {
|
|
530
|
+
selectedMeta: parseInstallComponentMeta,
|
|
531
|
+
blocklet: blocklet,
|
|
532
|
+
showDialog: !!parseInstallComponentMeta,
|
|
533
|
+
setShowDialog: () => setInstallComponentMeta(null)
|
|
999
534
|
})]
|
|
1000
535
|
}));
|
|
1001
536
|
}
|
|
@@ -1008,4 +543,6 @@ BlockletComponent.defaultProps = {
|
|
|
1008
543
|
onUpdate: () => {},
|
|
1009
544
|
getComponentUrl: () => window.location.origin
|
|
1010
545
|
};
|
|
1011
|
-
const Div = _styled.default.div(
|
|
546
|
+
const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n\n @keyframes showDelay {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n }\n\n .component-item {\n animation: showDelay 0.75s ease 1;\n }\n"])));
|
|
547
|
+
const TitleRow = (0, _styled.default)(_Box.default)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", " {\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n }\n ", " {\n flex-direction: column;\n justify-content: flex-end;\n align-items: flex-end;\n .sm-hide-icon > svg {\n display: none;\n }\n }\n"])), props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('sm'));
|
|
548
|
+
const TitleItem = (0, _styled.default)(_Box.default)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", " {\n width: 100%;\n justify-content: space-between;\n }\n"])), props => props.theme.breakpoints.down('sm'));
|