@abtnode/ux 1.16.26-beta-351de484 → 1.16.26-beta-63f52a83

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.
Files changed (59) hide show
  1. package/es/blocklet/app-avatar.js +7 -19
  2. package/es/blocklet/authentication/index.js +1 -3
  3. package/es/blocklet/authentication/oauth/apple.js +39 -15
  4. package/es/blocklet/authentication/oauth/auth0.js +18 -12
  5. package/es/blocklet/authentication/oauth/github.js +10 -9
  6. package/es/blocklet/authentication/oauth/google.js +10 -9
  7. package/es/blocklet/component/component-cell.js +201 -359
  8. package/es/blocklet/component/component-info-dialog.js +257 -0
  9. package/es/blocklet/component/index.js +14 -12
  10. package/es/blocklet/component/store-blocklet-list.js +3 -0
  11. package/es/blocklet/publish/connect-store-list.js +33 -4
  12. package/es/blocklet/publish/create-release.js +9 -4
  13. package/es/blocklet/status.js +13 -7
  14. package/es/locales/ar.js +19 -12
  15. package/es/locales/de.js +19 -12
  16. package/es/locales/en.js +18 -11
  17. package/es/locales/es.js +20 -13
  18. package/es/locales/fr.js +19 -12
  19. package/es/locales/hi.js +19 -12
  20. package/es/locales/i18n.db +0 -0
  21. package/es/locales/id.js +19 -12
  22. package/es/locales/ja.js +19 -12
  23. package/es/locales/ko.js +19 -12
  24. package/es/locales/pt.js +19 -12
  25. package/es/locales/ru.js +19 -12
  26. package/es/locales/th.js +19 -12
  27. package/es/locales/vi.js +19 -12
  28. package/es/locales/zh-tw.js +28 -21
  29. package/es/locales/zh.js +27 -20
  30. package/lib/blocklet/app-avatar.js +7 -20
  31. package/lib/blocklet/authentication/index.js +1 -3
  32. package/lib/blocklet/authentication/oauth/apple.js +51 -28
  33. package/lib/blocklet/authentication/oauth/auth0.js +18 -16
  34. package/lib/blocklet/authentication/oauth/github.js +10 -13
  35. package/lib/blocklet/authentication/oauth/google.js +10 -13
  36. package/lib/blocklet/component/component-cell.js +209 -370
  37. package/lib/blocklet/component/component-info-dialog.js +253 -0
  38. package/lib/blocklet/component/index.js +14 -12
  39. package/lib/blocklet/component/store-blocklet-list.js +3 -0
  40. package/lib/blocklet/publish/connect-store-list.js +32 -3
  41. package/lib/blocklet/publish/create-release.js +9 -4
  42. package/lib/blocklet/status.js +14 -8
  43. package/lib/locales/ar.js +19 -12
  44. package/lib/locales/de.js +19 -12
  45. package/lib/locales/en.js +18 -11
  46. package/lib/locales/es.js +20 -13
  47. package/lib/locales/fr.js +19 -12
  48. package/lib/locales/hi.js +19 -12
  49. package/lib/locales/i18n.db +0 -0
  50. package/lib/locales/id.js +19 -12
  51. package/lib/locales/ja.js +19 -12
  52. package/lib/locales/ko.js +19 -12
  53. package/lib/locales/pt.js +19 -12
  54. package/lib/locales/ru.js +19 -12
  55. package/lib/locales/th.js +19 -12
  56. package/lib/locales/vi.js +19 -12
  57. package/lib/locales/zh-tw.js +28 -21
  58. package/lib/locales/zh.js +27 -20
  59. package/package.json +17 -17
@@ -16,24 +16,15 @@ var _Replay = _interopRequireDefault(require("@mui/icons-material/Replay"));
16
16
  var _Autorenew = _interopRequireDefault(require("@mui/icons-material/Autorenew"));
17
17
  var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
18
18
  var _Delete = _interopRequireDefault(require("@mui/icons-material/Delete"));
19
- var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
20
- var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
21
- var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
22
19
  var _react2 = require("@iconify/react");
23
- var _InfoRow = _interopRequireDefault(require("@arcblock/ux/lib/InfoRow"));
24
20
  var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
25
21
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
26
22
  var _normalizePathPrefix = _interopRequireDefault(require("@abtnode/util/lib/normalize-path-prefix"));
27
23
  var _util = require("@blocklet/meta/lib/util");
28
24
  var _SettingsOutlined = _interopRequireDefault(require("@mui/icons-material/SettingsOutlined"));
29
25
  var _deletingBlocklets = require("../../contexts/deleting-blocklets");
30
- var _tag = _interopRequireDefault(require("../../tag"));
31
26
  var _configuration = _interopRequireDefault(require("./configuration"));
32
- var _util2 = require("../../util");
33
- var _didAddress = _interopRequireDefault(require("../../did-address"));
34
- var _blockletSource = _interopRequireDefault(require("../blocklet-source"));
35
27
  var _status = _interopRequireDefault(require("../status"));
36
- var _version = _interopRequireDefault(require("../version"));
37
28
  var _confirm = _interopRequireDefault(require("../../confirm"));
38
29
  var _bundleAvatar = _interopRequireDefault(require("../bundle-avatar"));
39
30
  var _mode = _interopRequireDefault(require("../mode"));
@@ -41,58 +32,14 @@ var _delete = _interopRequireDefault(require("./delete"));
41
32
  var _start = _interopRequireDefault(require("./start"));
42
33
  var _line = _interopRequireDefault(require("./line"));
43
34
  var _actions = _interopRequireDefault(require("../../actions"));
35
+ var _componentInfoDialog = _interopRequireDefault(require("./component-info-dialog"));
44
36
  var _jsxRuntime = require("react/jsx-runtime");
45
37
  var _templateObject, _templateObject2;
46
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47
39
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
48
- const getEngineRows = (engine, t) => {
49
- if (!engine) {
50
- return [];
51
- }
52
- return [{
53
- name: t('common.name'),
54
- value: engine.displayName
55
- }, {
56
- name: t('common.description'),
57
- value: engine.description
58
- }, {
59
- name: t('common.version'),
60
- value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tag.default, {
61
- children: engine.version
62
- })
63
- }];
64
- };
65
- const getSourceInfo = blocklet => {
66
- const {
67
- source,
68
- deployedFrom,
69
- bundleSource
70
- } = blocklet;
71
- if (source) {
72
- return {
73
- source,
74
- deployedFrom
75
- };
76
- }
77
- if (!bundleSource) {
78
- return {
79
- source: 'upload',
80
- deployedFrom
81
- };
82
- }
83
- if (bundleSource.url) {
84
- return {
85
- source: 'url',
86
- deployedFrom: deployedFrom || Array.isArray(bundleSource.url) ? bundleSource.url[0] : bundleSource.url
87
- };
88
- }
89
- if (bundleSource.store) {
90
- return {
91
- source: 'registry',
92
- deployedFrom: deployedFrom || Array.isArray(bundleSource.store) ? bundleSource.store[0] : bundleSource.store
93
- };
94
- }
95
- return {};
40
+ const isResource = component => {
41
+ var _component$meta;
42
+ return !(component !== null && component !== void 0 && (_component$meta = component.meta) !== null && _component$meta !== void 0 && _component$meta.group);
96
43
  };
97
44
  const getComponentName = (componentId, app) => {
98
45
  const ids = componentId.split('/').slice(1);
@@ -110,12 +57,8 @@ const getComponentName = (componentId, app) => {
110
57
  }
111
58
  return names.join(' / ');
112
59
  };
113
- const isPack = component => {
114
- var _component$meta;
115
- return (component === null || component === void 0 || (_component$meta = component.meta) === null || _component$meta === void 0 ? void 0 : _component$meta.group) === 'pack';
116
- };
117
60
  function ComponentCell(_ref) {
118
- var _blocklet$dependents, _blocklet$meta$resour, _blocklet$dependents2, _blocklet$meta, _blocklet$dependents3;
61
+ var _blocklet$dependents, _blocklet$meta, _blocklet$dependents2;
119
62
  let {
120
63
  blocklet,
121
64
  ancestors,
@@ -129,8 +72,7 @@ function ComponentCell(_ref) {
129
72
  app
130
73
  } = _ref;
131
74
  const {
132
- t,
133
- locale
75
+ t
134
76
  } = (0, _react.useContext)(_context.LocaleContext);
135
77
  const [componentInfo, setComponentInfo] = (0, _react.useState)();
136
78
  const [showDeleteConfirm, setShowDeleteConfirm] = (0, _react.useState)(false);
@@ -147,109 +89,12 @@ function ComponentCell(_ref) {
147
89
  }
148
90
  const mountPoint = "/".concat(blocklet.mountPoint || '/').replace(/\/+/g, '/');
149
91
  const href = getComponentUrl(mountPoint);
150
- const renderRows = rows => rows.map(row => {
151
- if (row.name === t('common.did') || row.name === t('blocklet.appId')) {
152
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
153
- valueComponent: "div",
154
- nameWidth: 120,
155
- name: row.name,
156
- nameFormatter: () => row.name,
157
- children: row.value
158
- }, row.name);
159
- }
160
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
161
- valueComponent: "div",
162
- nameWidth: 120,
163
- name: row.name,
164
- children: row.value
165
- }, row.name);
166
- });
167
- const sourceInfo = componentInfo ? getSourceInfo(componentInfo) : {};
168
- const componentRows = componentInfo ? [{
169
- name: t('common.name'),
170
- value: (0, _util.getDisplayName)(componentInfo, true)
171
- }, {
172
- name: t('common.version'),
173
- value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_version.default, {
174
- blocklet: componentInfo,
175
- checkUpgrade: false
176
- })
177
- }, {
178
- name: t('common.status'),
179
- value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_status.default, {
180
- status: status,
181
- source: componentInfo.source,
182
- progress: blocklet.progress
183
- })
184
- }, blocklet.status === 'running' ? {
185
- name: t('blocklet.startedAt'),
186
- value: (0, _util2.formatToDatetime)(blocklet.startedAt, locale)
187
- } : null, blocklet.status !== 'running' ? {
188
- name: t('blocklet.stoppedAt'),
189
- value: (0, _util2.formatToDatetime)(blocklet.stoppedAt, locale)
190
- } : null, blocklet.installedAt ? {
191
- name: t('blocklet.installedAt'),
192
- value: (0, _util2.formatToDatetime)(blocklet.installedAt, locale)
193
- } : null, (0, _util.hasStartEngine)(blocklet.meta) ? {
194
- name: t('common.mountPoint'),
195
- value: mountPoint
196
- } : null, componentInfo.meta.group ? {
197
- name: t('common.group'),
198
- value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tag.default, {
199
- type: "success",
200
- children: componentInfo.meta.group
201
- })
202
- } : null, {
203
- name: t('blocklet.overview.source'),
204
- value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockletSource.default, {
205
- sourceInfo: sourceInfo,
206
- blocklet: blocklet
207
- })
208
- }, {
209
- name: t('blocklet.overview.deployedFrom'),
210
- value: sourceInfo.deployedFrom || '-'
211
- }, {
212
- name: t('common.did'),
213
- value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
214
- did: componentInfo.meta.did,
215
- showQrcode: true
216
- })
217
- }, {
218
- name: t('common.author'),
219
- value: (0, _util2.formatPerson)(componentInfo.meta.author)
220
- }, {
221
- name: t('common.engine'),
222
- value: getEngineRows(componentInfo.engine, t).map(_ref2 => {
223
- let {
224
- name,
225
- value
226
- } = _ref2;
227
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
228
- style: {
229
- marginBottom: 4
230
- },
231
- nameWidth: 120,
232
- name: name,
233
- children: value
234
- }, name);
235
- })
236
- }, (_blocklet$dependents = blocklet.dependents) !== null && _blocklet$dependents !== void 0 && _blocklet$dependents.length ? {
237
- name: t('common.dependents'),
238
- value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
239
- children: blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
240
- children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
241
- }, x.id))
242
- })
243
- } : null, (_blocklet$meta$resour = blocklet.meta.resources) !== null && _blocklet$meta$resour !== void 0 && _blocklet$meta$resour.length ? {
244
- name: t('common.resource'),
245
- value: blocklet.meta.resources.join(', ')
246
- } : null].filter(Boolean) : [];
247
92
  const appInProgress = (0, _util.isInProgress)(app.status);
248
93
  const componentInProgress = (0, _util.isInProgress)(blocklet.status);
249
94
  let deleteDisabledTip = '';
250
95
  if (appInProgress || componentInProgress || depth === 1 && deletingComponents.includes(blocklet.meta.did)) {
251
96
  deleteDisabledTip = t('blocklet.component.tip.stopBlocklet');
252
- } else if ((_blocklet$dependents2 = blocklet.dependents) !== null && _blocklet$dependents2 !== void 0 && _blocklet$dependents2.length) {
97
+ } else if ((_blocklet$dependents = blocklet.dependents) !== null && _blocklet$dependents !== void 0 && _blocklet$dependents.length) {
253
98
  const requires = blocklet.dependents.filter(x => x.required);
254
99
  if (requires.length) {
255
100
  const names = requires.map(x => getComponentName(x.id, app));
@@ -258,229 +103,223 @@ function ComponentCell(_ref) {
258
103
  });
259
104
  }
260
105
  }
261
- return [/*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledComponentRow, {
262
- display: "flex",
263
- py: 2,
264
- className: "component-item",
265
- justifyContent: "flex-start",
266
- alignItems: "center",
267
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
268
- pl: 2,
269
- width: {
270
- xs: 300,
271
- md: 400
272
- },
106
+ const handleRemove = async function handleRemove() {
107
+ setLoading(true);
108
+ try {
109
+ await onRemove(...arguments);
110
+ } catch (_unused) {
111
+ // ignore
112
+ }
113
+ setLoading(false);
114
+ setShowDeleteConfirm(false);
115
+ };
116
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
117
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledComponentRow, {
273
118
  display: "flex",
119
+ py: 2,
120
+ className: "component-item",
121
+ justifyContent: "flex-start",
274
122
  alignItems: "center",
275
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bundleAvatar.default, {
276
- blocklet: blocklet,
277
- ancestors: ancestors
278
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
279
- ml: "16px",
280
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
281
- className: "component-header",
282
- onClick: () => setComponentInfo(blocklet),
283
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
284
- className: "component-name",
285
- children: (0, _util.getDisplayName)(blocklet, true)
286
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
287
- className: "component-version",
288
- children: blocklet === null || blocklet === void 0 || (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version
289
- })]
123
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
124
+ pl: 2,
125
+ width: {
126
+ xs: 300,
127
+ md: 400
128
+ },
129
+ display: "flex",
130
+ alignItems: "center",
131
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bundleAvatar.default, {
132
+ blocklet: blocklet,
133
+ ancestors: ancestors
290
134
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
291
- display: "flex",
292
- alignItems: "center",
293
- sx: {
294
- mt: '2px',
295
- ml: -0.5
296
- },
297
- children: [status !== 'unknown' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_status.default, {
298
- style: {
299
- marginLeft: 4
300
- },
301
- status: status,
302
- source: blocklet.source,
303
- progress: blocklet.progress
304
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_mode.default, {
305
- style: {
306
- marginLeft: 4
135
+ ml: "16px",
136
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
137
+ className: "component-header",
138
+ onClick: () => setComponentInfo(blocklet),
139
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
140
+ className: "component-name",
141
+ children: (0, _util.getDisplayName)(blocklet, true)
142
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
143
+ className: "component-version",
144
+ children: blocklet === null || blocklet === void 0 || (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version
145
+ })]
146
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
147
+ display: "flex",
148
+ alignItems: "center",
149
+ sx: {
150
+ mt: '2px',
151
+ ml: -0.5
307
152
  },
308
- mode: blocklet.mode || ''
309
- }), !!((_blocklet$dependents3 = blocklet.dependents) !== null && _blocklet$dependents3 !== void 0 && _blocklet$dependents3.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
310
- title: ["".concat(t('common.dependents'), ": "), blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
311
- pl: 1,
312
- children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
313
- }, x.id))],
314
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
315
- display: "flex",
316
- color: "primary.main",
317
- ml: 1,
318
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
319
- icon: "octicon:package-dependents-16"
153
+ children: [status !== 'unknown' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_status.default, {
154
+ style: {
155
+ marginLeft: 4
156
+ },
157
+ status: status,
158
+ source: blocklet.source,
159
+ progress: blocklet.progress
160
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_mode.default, {
161
+ style: {
162
+ marginLeft: 4
163
+ },
164
+ mode: blocklet.mode || ''
165
+ }), !!((_blocklet$dependents2 = blocklet.dependents) !== null && _blocklet$dependents2 !== void 0 && _blocklet$dependents2.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
166
+ title: ["".concat(t('common.dependents'), ": "), blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
167
+ pl: 1,
168
+ children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
169
+ }, x.id))],
170
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
171
+ display: "flex",
172
+ color: "primary.main",
173
+ ml: 1,
174
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
175
+ icon: "octicon:package-dependents-16"
176
+ })
320
177
  })
321
- })
178
+ })]
322
179
  })]
323
180
  })]
324
- })]
325
- }, blocklet), (0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
326
- sx: {
327
- display: {
328
- xs: 'none',
329
- md: 'flex'
330
- }
331
- },
332
- alignItems: "center",
333
- flexGrow: "1",
334
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
335
- target: "_blank",
336
- href: href,
337
- rel: "noopener noreferrer",
338
- title: href,
339
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
340
- maxWidth: 400,
341
- sx: {
342
- color: 'secondary.main',
343
- fontSize: 16,
344
- px: 2
345
- },
346
- overflow: "hidden",
347
- whiteSpace: "nowrap",
348
- textOverflow: "ellipsis",
349
- children: (0, _normalizePathPrefix.default)(mountPoint)
350
- })
351
- })
352
- }, mountPoint), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
353
- style: {
354
- flex: 1
355
- }
356
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
357
- display: "flex",
358
- alignItems: "center",
359
- children: [(0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
360
- title: t('common.visit'),
181
+ }, blocklet), (0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
182
+ sx: {
183
+ display: {
184
+ xs: 'none',
185
+ md: 'flex'
186
+ }
187
+ },
188
+ alignItems: "center",
189
+ flexGrow: "1",
361
190
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
362
191
  target: "_blank",
363
192
  href: href,
364
193
  rel: "noopener noreferrer",
365
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
366
- size: "small",
367
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Launch.default, {})
194
+ title: href,
195
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
196
+ maxWidth: 400,
197
+ sx: {
198
+ color: 'secondary.main',
199
+ fontSize: 16,
200
+ px: 2
201
+ },
202
+ overflow: "hidden",
203
+ whiteSpace: "nowrap",
204
+ textOverflow: "ellipsis",
205
+ children: (0, _normalizePathPrefix.default)(mountPoint)
368
206
  })
369
207
  })
370
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_configuration.default, {
371
- blocklet: blocklet,
372
- ancestors: ancestors,
373
- children: _ref3 => {
374
- let {
375
- open
376
- } = _ref3;
377
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
378
- title: t('common.config'),
379
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
380
- color: "error",
381
- badgeContent: "",
382
- variant: "dot",
383
- invisible: !(0, _util.getComponentMissingConfigs)(blocklet, ancestors[0]).length,
384
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
385
- onClick: open,
386
- size: "small",
387
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingsOutlined.default, {})
388
- })
389
- })
390
- }, "config");
208
+ }, mountPoint), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
209
+ style: {
210
+ flex: 1
391
211
  }
392
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_start.default, {
393
- blocklet: app,
394
- component: blocklet,
395
- onStart: onStart,
396
- onStop: onStop,
397
- disabled: !['starting', 'stopping'].includes(app.status) && (0, _util.isInProgress)(app.status)
398
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_actions.default, {
399
- "data-cy": "component-actions",
400
- actions: [(0, _util.hasStartEngine)(blocklet.meta) ? {
401
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoOutlined.default, {}),
402
- text: t('common.detail'),
403
- onClick: () => {
404
- setComponentInfo(blocklet);
212
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
213
+ display: "flex",
214
+ alignItems: "center",
215
+ children: [(0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
216
+ title: t('common.visit'),
217
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
218
+ target: "_blank",
219
+ href: href,
220
+ rel: "noopener noreferrer",
221
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
222
+ size: "small",
223
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Launch.default, {})
224
+ })
225
+ })
226
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_configuration.default, {
227
+ blocklet: blocklet,
228
+ ancestors: ancestors,
229
+ children: _ref2 => {
230
+ let {
231
+ open
232
+ } = _ref2;
233
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
234
+ title: t('common.config'),
235
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
236
+ color: "error",
237
+ badgeContent: "",
238
+ variant: "dot",
239
+ invisible: !(0, _util.getComponentMissingConfigs)(blocklet, ancestors[0]).length,
240
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
241
+ onClick: open,
242
+ size: "small",
243
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingsOutlined.default, {})
244
+ })
245
+ })
246
+ }, "config");
405
247
  }
406
- } : null, !isPack(blocklet) && {
407
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Replay.default, {}),
408
- text: t('common.restart'),
409
- onClick: () => {
410
- setConfirmSetting({
411
- title: "".concat(t('common.restart'), " ").concat(blocklet.meta.title),
412
- description: t('blocklet.action.restartDescription'),
413
- confirm: t('blocklet.action.confirmRestart'),
414
- cancel: t('common.cancel'),
415
- onConfirm: async () => {
416
- setLoading(true);
417
- await onRestart(blocklet);
418
- setLoading(false);
419
- },
420
- onCancel: () => setConfirmSetting(null)
421
- });
422
- },
423
- disabled: appInProgress || componentInProgress || blocklet.status !== 'running'
424
- }, !isPack(blocklet) && {
425
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autorenew.default, {}),
426
- text: t('common.reload'),
427
- onClick: async () => {
428
- setLoading(true);
429
- await onReload(blocklet);
430
- setLoading(false);
431
- },
432
- disabled: loading || appInProgress || componentInProgress || blocklet.status !== 'running'
433
- }, {
434
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Delete.default, {}),
435
- text: t('common.delete'),
436
- onClick: () => {
437
- setShowDeleteConfirm(true);
438
- },
439
- disabled: appInProgress || componentInProgress || !!deleteDisabledTip,
440
- tip: deleteDisabledTip
441
- }].filter(Boolean)
442
- })]
443
- }, "actions")]
444
- }, "group-not-gateway-box"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_line.default, {}, "line"), !!componentInfo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
445
- open: true,
446
- fullWidth: true,
447
- maxWidth: "md",
448
- onClose: () => {
449
- setComponentInfo(null);
450
- },
451
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
452
- paddingY: 1.5,
453
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogTitle.default, {
454
- children: t('common.componentBasicInfo')
455
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContent.default, {
456
- children: renderRows(componentRows)
457
- })]
458
- }, "dialog-wrapper")
459
- }, "base-info-dialog"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_delete.default, {
460
- blocklet: app,
461
- component: blocklet,
462
- remove: async function remove() {
463
- setLoading(true);
464
- try {
465
- await onRemove(...arguments);
466
- } catch (_unused) {
467
- // ignore
468
- }
469
- setLoading(false);
470
- setShowDeleteConfirm(false);
471
- },
472
- onCancel: () => setShowDeleteConfirm(false),
473
- hideBtn: true,
474
- showConfirm: showDeleteConfirm
475
- }, "delete-component"), confirmSetting && /*#__PURE__*/(0, _jsxRuntime.jsx)(_confirm.default, {
476
- title: confirmSetting.title,
477
- description: confirmSetting.description,
478
- confirm: confirmSetting.confirm,
479
- cancel: confirmSetting.cancel,
480
- params: confirmSetting.params,
481
- onConfirm: confirmSetting.onConfirm,
482
- onCancel: confirmSetting.onCancel
483
- }, "confirm-setting")];
248
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_start.default, {
249
+ blocklet: app,
250
+ component: blocklet,
251
+ onStart: onStart,
252
+ onStop: onStop,
253
+ disabled: !['starting', 'stopping'].includes(app.status) && (0, _util.isInProgress)(app.status)
254
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_actions.default, {
255
+ "data-cy": "component-actions",
256
+ actions: [(0, _util.hasStartEngine)(blocklet.meta) ? {
257
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoOutlined.default, {}),
258
+ text: t('common.detail'),
259
+ onClick: () => {
260
+ setComponentInfo(blocklet);
261
+ }
262
+ } : null, !isResource(blocklet) && {
263
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Replay.default, {}),
264
+ text: t('common.restart'),
265
+ onClick: () => {
266
+ setConfirmSetting({
267
+ title: "".concat(t('common.restart'), " ").concat(blocklet.meta.title),
268
+ description: t('blocklet.action.restartDescription'),
269
+ confirm: t('blocklet.action.confirmRestart'),
270
+ cancel: t('common.cancel'),
271
+ onConfirm: async () => {
272
+ setLoading(true);
273
+ await onRestart(blocklet);
274
+ setLoading(false);
275
+ },
276
+ onCancel: () => setConfirmSetting(null)
277
+ });
278
+ },
279
+ disabled: appInProgress || componentInProgress || blocklet.status !== 'running'
280
+ }, !isResource(blocklet) && {
281
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autorenew.default, {}),
282
+ text: t('common.reload'),
283
+ onClick: async () => {
284
+ setLoading(true);
285
+ await onReload(blocklet);
286
+ setLoading(false);
287
+ },
288
+ disabled: loading || appInProgress || componentInProgress || blocklet.status !== 'running'
289
+ }, {
290
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Delete.default, {}),
291
+ text: t('common.delete'),
292
+ onClick: () => {
293
+ setShowDeleteConfirm(true);
294
+ },
295
+ disabled: appInProgress || componentInProgress || !!deleteDisabledTip,
296
+ tip: deleteDisabledTip
297
+ }].filter(Boolean)
298
+ })]
299
+ }, "actions")]
300
+ }, "group-not-gateway-box"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_line.default, {}, "line"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentInfoDialog.default, {
301
+ componentInfo: componentInfo,
302
+ onClose: setComponentInfo,
303
+ blocklet: blocklet,
304
+ app: app,
305
+ depth: depth
306
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_delete.default, {
307
+ blocklet: app,
308
+ component: blocklet,
309
+ remove: handleRemove,
310
+ onCancel: () => setShowDeleteConfirm(false),
311
+ hideBtn: true,
312
+ showConfirm: showDeleteConfirm
313
+ }, "delete-component"), confirmSetting && /*#__PURE__*/(0, _jsxRuntime.jsx)(_confirm.default, {
314
+ title: confirmSetting.title,
315
+ description: confirmSetting.description,
316
+ confirm: confirmSetting.confirm,
317
+ cancel: confirmSetting.cancel,
318
+ params: confirmSetting.params,
319
+ onConfirm: confirmSetting.onConfirm,
320
+ onCancel: confirmSetting.onCancel
321
+ }, "confirm-setting")]
322
+ });
484
323
  }
485
324
  ComponentCell.propTypes = {
486
325
  blocklet: _propTypes.default.object.isRequired,