@abtnode/ux 1.16.25-next-bc2f4c63 → 1.16.26-beta-e0056285

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 (85) hide show
  1. package/es/analytics/disk.js +8 -11
  2. package/es/analytics/memory.js +1 -2
  3. package/es/analytics/runtime.js +1 -2
  4. package/es/analytics/traffic.js +1 -2
  5. package/es/blocklet/actions.js +11 -1
  6. package/es/blocklet/component/add-component-core.js +8 -0
  7. package/es/blocklet/component/component-cell.js +2 -1
  8. package/es/blocklet/component/select-store.js +8 -4
  9. package/es/blocklet/disk-info.js +1 -1
  10. package/es/blocklet/icons.js +3 -1
  11. package/es/blocklet/overview.js +13 -7
  12. package/es/blocklet/publish/connect-store-list.js +62 -0
  13. package/es/blocklet/publish/create-release.js +192 -49
  14. package/es/blocklet/publish/index.js +0 -4
  15. package/es/blocklet/publish/project-list.js +133 -29
  16. package/es/blocklet/publish/release-list.js +19 -5
  17. package/es/blocklet/publish/resource.js +46 -34
  18. package/es/blocklet/publish/select-components.js +3 -3
  19. package/es/blocklet/router/rule-list.js +2 -1
  20. package/es/locales/ar.js +23 -10
  21. package/es/locales/de.js +22 -9
  22. package/es/locales/en.js +21 -10
  23. package/es/locales/es.js +22 -9
  24. package/es/locales/fr.js +22 -9
  25. package/es/locales/hi.js +22 -9
  26. package/es/locales/i18n.db +0 -0
  27. package/es/locales/id.js +23 -10
  28. package/es/locales/ja.js +23 -10
  29. package/es/locales/ko.js +23 -10
  30. package/es/locales/pt.js +22 -9
  31. package/es/locales/ru.js +22 -9
  32. package/es/locales/th.js +22 -9
  33. package/es/locales/vi.js +23 -10
  34. package/es/locales/zh-tw.js +22 -9
  35. package/es/locales/zh.js +27 -14
  36. package/es/store/add.js +1 -0
  37. package/es/store/delete.js +9 -4
  38. package/es/store/item.js +233 -36
  39. package/es/team/members/connections.js +2 -1
  40. package/es/team/members/member.js +2 -1
  41. package/es/util/index.js +8 -8
  42. package/lib/analytics/disk.js +7 -10
  43. package/lib/analytics/memory.js +5 -6
  44. package/lib/analytics/runtime.js +1 -2
  45. package/lib/analytics/traffic.js +2 -3
  46. package/lib/blocklet/actions.js +14 -2
  47. package/lib/blocklet/component/add-component-core.js +4 -1
  48. package/lib/blocklet/component/component-cell.js +2 -1
  49. package/lib/blocklet/component/select-store.js +8 -4
  50. package/lib/blocklet/disk-info.js +2 -2
  51. package/lib/blocklet/icons.js +3 -1
  52. package/lib/blocklet/overview.js +13 -7
  53. package/lib/blocklet/publish/connect-store-list.js +72 -0
  54. package/lib/blocklet/publish/create-release.js +194 -47
  55. package/lib/blocklet/publish/index.js +0 -4
  56. package/lib/blocklet/publish/project-list.js +133 -29
  57. package/lib/blocklet/publish/release-list.js +19 -5
  58. package/lib/blocklet/publish/resource.js +45 -33
  59. package/lib/blocklet/publish/select-components.js +3 -3
  60. package/lib/blocklet/router/rule-list.js +2 -1
  61. package/lib/locales/ar.js +23 -10
  62. package/lib/locales/de.js +22 -9
  63. package/lib/locales/en.js +21 -10
  64. package/lib/locales/es.js +22 -9
  65. package/lib/locales/fr.js +22 -9
  66. package/lib/locales/hi.js +22 -9
  67. package/lib/locales/i18n.db +0 -0
  68. package/lib/locales/id.js +23 -10
  69. package/lib/locales/ja.js +23 -10
  70. package/lib/locales/ko.js +23 -10
  71. package/lib/locales/pt.js +22 -9
  72. package/lib/locales/ru.js +22 -9
  73. package/lib/locales/th.js +22 -9
  74. package/lib/locales/vi.js +23 -10
  75. package/lib/locales/zh-tw.js +22 -9
  76. package/lib/locales/zh.js +27 -14
  77. package/lib/store/add.js +1 -0
  78. package/lib/store/delete.js +9 -4
  79. package/lib/store/item.js +233 -37
  80. package/lib/team/members/connections.js +2 -1
  81. package/lib/team/members/member.js +2 -1
  82. package/lib/util/index.js +14 -13
  83. package/package.json +17 -17
  84. package/es/blocklet/publish/create-project.js +0 -205
  85. package/lib/blocklet/publish/create-project.js +0 -215
@@ -6,7 +6,7 @@ import LinearProgress from '@mui/material/LinearProgress';
6
6
  import Box from '@mui/material/Box';
7
7
  import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
8
8
  import Card from './card';
9
- import { formatDiskSize } from '../util/index';
9
+ import { filesize } from '../util/index';
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  const BorderLinearProgress = withStyles(theme => ({
12
12
  root: {
@@ -51,8 +51,7 @@ LinearProgressWithLabel.propTypes = {
51
51
  value: PropTypes.number.isRequired
52
52
  };
53
53
  export default function DiskMonitor({
54
- disk,
55
- platform
54
+ disk
56
55
  }) {
57
56
  const {
58
57
  t
@@ -61,21 +60,21 @@ export default function DiskMonitor({
61
60
  id: 1,
62
61
  className: 'used',
63
62
  title: t('system.used'),
64
- metric: formatDiskSize(disk.used, platform)
63
+ metric: filesize(disk.used)
65
64
  }, {
66
65
  id: 2,
67
66
  className: 'free',
68
67
  title: t('system.free'),
69
- metric: formatDiskSize(disk.free, platform)
68
+ metric: filesize(disk.free)
70
69
  }, {
71
70
  id: 3,
72
71
  className: 'total',
73
72
  title: t('system.total'),
74
- metric: formatDiskSize(disk.total, platform)
73
+ metric: filesize(disk.total)
75
74
  }];
76
75
  return /*#__PURE__*/_jsx(Card, {
77
76
  title: `${t('common.disk')} (${disk.device})`,
78
- value: formatDiskSize(disk.used, platform),
77
+ value: filesize(disk.used),
79
78
  graph: /*#__PURE__*/_jsx(Box, {
80
79
  mt: 3,
81
80
  children: /*#__PURE__*/_jsx(LinearProgressWithLabel, {
@@ -96,8 +95,7 @@ DiskMonitor.propTypes = {
96
95
  free: PropTypes.number,
97
96
  total: PropTypes.number,
98
97
  device: PropTypes.string
99
- }),
100
- platform: PropTypes.string
98
+ })
101
99
  };
102
100
  DiskMonitor.defaultProps = {
103
101
  disk: {
@@ -105,6 +103,5 @@ DiskMonitor.defaultProps = {
105
103
  free: 0,
106
104
  total: 1,
107
105
  device: ''
108
- },
109
- platform: ''
106
+ }
110
107
  };
@@ -1,10 +1,9 @@
1
1
  /* eslint-disable react/jsx-one-expression-per-line */
2
2
  import PropTypes from 'prop-types';
3
- import filesize from 'filesize';
4
3
  import Box from '@mui/material/Box';
5
4
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
6
5
  import Chart from './chart';
7
- import { formatTime } from '../util';
6
+ import { formatTime, filesize } from '../util';
8
7
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
9
8
  export default function MemoryMonitor({
10
9
  instanceCount,
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect, useMemo } from 'react';
2
2
  import styled from '@emotion/styled';
3
- import filesize from 'filesize';
4
3
  import prettyMs from 'pretty-ms-i18n';
5
4
  import Box from '@mui/material/Box';
6
5
  import Datatable from '@arcblock/ux/lib/Datatable';
@@ -8,7 +7,7 @@ import Typography from '@mui/material/Typography';
8
7
  import { getDisplayName, forEachBlockletSync } from '@blocklet/meta/lib/util';
9
8
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
10
9
  import { useBlockletContext } from '../contexts/blocklet';
11
- import { formatLocale } from '../util';
10
+ import { formatLocale, filesize } from '../util';
12
11
  import RuntimeInfo from '../blocklet/runtime-info';
13
12
  import BundleAvatar from '../blocklet/bundle-avatar';
14
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -4,7 +4,6 @@ import { useEffect, useState } from 'react';
4
4
  import dayjs from '@abtnode/util/lib/dayjs';
5
5
  import nthArg from 'lodash/nthArg';
6
6
  import joinUrl from 'url-join';
7
- import filesize from 'filesize';
8
7
  import useAsyncRetry from 'react-use/lib/useAsyncRetry';
9
8
  import Iframe from 'react-iframe';
10
9
  import Alert from '@mui/material/Alert';
@@ -22,7 +21,7 @@ import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
22
21
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
23
22
  import { WELLKNOWN_SERVICE_PATH_PREFIX } from '@abtnode/constant';
24
23
  import { startOfWeek, endOfWeek, addWeeks, startOfMonth, endOfMonth, addMonths, startOfYear, endOfYear, addYears } from 'date-fns';
25
- import { formatError, formatToDate } from '../util';
24
+ import { formatError, formatToDate, filesize } from '../util';
26
25
  import { useNodeContext } from '../contexts/node';
27
26
  import Chart from './chart';
28
27
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -296,7 +296,17 @@ export default function BlockletActions({
296
296
  } : null;
297
297
  const cancelDownloadAction = {
298
298
  action: 'remove',
299
- icon: Icons.Remove,
299
+ icon: ({
300
+ sx,
301
+ ...restProps
302
+ }) => /*#__PURE__*/_jsx(Icons.Cancel, {
303
+ sx: {
304
+ ...sx,
305
+ paddingRight: '2px',
306
+ zoom: 0.95
307
+ },
308
+ ...restProps
309
+ }),
300
310
  name: t('common.cancel'),
301
311
  handler: createHandler('cancelDownload', node.api.cancelDownloadBlocklet, true)
302
312
  };
@@ -683,6 +683,9 @@ export default function AddComponentCore({
683
683
  key: 'selectComponent',
684
684
  name: t('blocklet.component.selectComponent'),
685
685
  body: /*#__PURE__*/_jsxs(TypographyWrapper, {
686
+ sx: {
687
+ width: 400
688
+ },
686
689
  component: "div",
687
690
  children: [params.showFromUrlDialog && /*#__PURE__*/_jsx(InstallFromUrl
688
691
  // if not set defaultUrl, the dialog will always show step 1 when the dialog is opened
@@ -1237,6 +1240,11 @@ const ContentWrapper = styled(Box)`
1237
1240
  }
1238
1241
  return `
1239
1242
  position: relative;
1243
+ .ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
1244
+ width: 100%;
1245
+ height: 100%;
1246
+ }
1247
+
1240
1248
  .root-header {
1241
1249
  z-index: auto !important;
1242
1250
  position: fixed !important;
@@ -196,7 +196,8 @@ export default function ComponentCell({
196
196
  }, {
197
197
  name: t('common.did'),
198
198
  value: /*#__PURE__*/_jsx(DidAddress, {
199
- did: componentInfo.meta.did
199
+ did: componentInfo.meta.did,
200
+ showQrcode: true
200
201
  })
201
202
  }, {
202
203
  name: t('common.author'),
@@ -57,10 +57,10 @@ export default function SelectStore({
57
57
  children: [/*#__PURE__*/_jsxs(SelectStoreTitle, {
58
58
  children: [/*#__PURE__*/_jsx(Button, {
59
59
  ref: storeSelectRef,
60
- color: "secondary",
60
+ color: "primary",
61
61
  "data-cy": "add-component-select-store",
62
62
  endIcon: /*#__PURE__*/_jsx(ArrowDropDownIcon, {
63
- color: "secondary"
63
+ color: "primary"
64
64
  }),
65
65
  onClick: () => {
66
66
  setOpen(true);
@@ -69,11 +69,11 @@ export default function SelectStore({
69
69
  padding: '0 2px'
70
70
  },
71
71
  children: /*#__PURE__*/_jsx(Typography, {
72
- color: "secondary",
72
+ color: "primary",
73
73
  children: currentRegistry.name
74
74
  })
75
75
  }), /*#__PURE__*/_jsx(Typography, {
76
- color: "secondary",
76
+ color: "primary",
77
77
  children: extra
78
78
  })]
79
79
  }), /*#__PURE__*/_jsxs(TextField, {
@@ -110,6 +110,10 @@ export default function SelectStore({
110
110
  margin: "normal",
111
111
  children: [storeList?.map(x => {
112
112
  return /*#__PURE__*/_jsx(MenuItem, {
113
+ sx: {
114
+ width: '400px',
115
+ maxWidth: '90vw'
116
+ },
113
117
  value: x,
114
118
  "data-cy": x.url,
115
119
  children: /*#__PURE__*/_jsx(StoreItem, {
@@ -2,11 +2,11 @@
2
2
  import { useContext } from 'react';
3
3
  import styled from '@emotion/styled';
4
4
  import PropTypes from 'prop-types';
5
- import filesize from 'filesize';
6
5
  import Typography from '@mui/material/Typography';
7
6
  import Link from '@mui/material/Link';
8
7
  import InfoRow from '@arcblock/ux/lib/InfoRow';
9
8
  import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
9
+ import { filesize } from '../util';
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  export default function BlockletDiskInfo({
12
12
  blocklet,
@@ -6,6 +6,7 @@ import Reload from '@mui/icons-material/Autorenew';
6
6
  import Config from '@mui/icons-material/Settings';
7
7
  import Log from '@mui/icons-material/Receipt';
8
8
  import Group from '@mui/icons-material/Group';
9
+ import Cancel from '@mui/icons-material/NotInterested';
9
10
  export default {
10
11
  Start,
11
12
  Stop,
@@ -14,5 +15,6 @@ export default {
14
15
  Remove,
15
16
  Config,
16
17
  Log,
17
- Group
18
+ Group,
19
+ Cancel
18
20
  };
@@ -42,18 +42,21 @@ export default function BlockletOverview() {
42
42
  const infoRows = [appDid ? {
43
43
  name: t('blocklet.appId'),
44
44
  value: /*#__PURE__*/_jsx(DidAddress, {
45
- did: appDid
45
+ did: appDid,
46
+ showQrcode: true
46
47
  })
47
48
  } : null, appPid ? {
48
49
  name: t('blocklet.appPid'),
49
50
  value: /*#__PURE__*/_jsx(DidAddress, {
50
- did: appPid
51
+ did: appPid,
52
+ showQrcode: true
51
53
  })
52
54
  } : null, migratedFrom?.length > 1 ? {
53
55
  name: t('blocklet.alsoKnownAs'),
54
56
  value: /*#__PURE__*/_jsxs("div", {
55
57
  children: [(showAllDIDs ? migratedFrom.slice(1) : migratedFrom.slice(1, 2)).map(x => /*#__PURE__*/_jsx(DidAddress, {
56
- did: x.appDid
58
+ did: x.appDid,
59
+ showQrcode: true
57
60
  })), migratedFrom.length > 2 && /*#__PURE__*/_jsx(Button, {
58
61
  style: {
59
62
  marginLeft: '18px'
@@ -78,7 +81,8 @@ export default function BlockletOverview() {
78
81
  value: /*#__PURE__*/_jsx(DidAddress, {
79
82
  external: true,
80
83
  href: getExplorerLink(blocklet?.controller?.chainHost, blocklet?.controller?.nftId, 'asset'),
81
- did: blocklet?.controller?.nftId
84
+ did: blocklet?.controller?.nftId,
85
+ showQrcode: true
82
86
  })
83
87
  } : null, {
84
88
  name: t('blocklet.installedAt'),
@@ -89,8 +93,9 @@ export default function BlockletOverview() {
89
93
  }, {
90
94
  name: t('common.owner'),
91
95
  value: blocklet.settings?.owner ? /*#__PURE__*/_jsx(DidAddress, {
92
- did: blocklet.settings.owner.did
93
- }) : '--'
96
+ did: blocklet.settings.owner.did,
97
+ showQrcode: true
98
+ }) : '-'
94
99
  }, {
95
100
  name: t('blocklet.config.walletType.name'),
96
101
  value: WalletType[chainType || 'arcblock'] || chainType
@@ -102,7 +107,8 @@ export default function BlockletOverview() {
102
107
  infoRows.push({
103
108
  name: t('common.serverDid'),
104
109
  value: /*#__PURE__*/_jsx(DidAddress, {
105
- did: nodeInfo.did
110
+ did: nodeInfo.did,
111
+ showQrcode: true
106
112
  })
107
113
  }, {
108
114
  name: t('common.serverVersion'),
@@ -0,0 +1,62 @@
1
+ import { useMemo } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { List, ListItem, ListItemText } from '@mui/material';
4
+ import AddStore from '../../store/add';
5
+ import StoreItem from '../../store/item';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ function ConnectStoreList({
8
+ blocklet,
9
+ releaseId,
10
+ projectId,
11
+ releaseType,
12
+ publishedStoreIds,
13
+ onPublish
14
+ }) {
15
+ const storeList = blocklet?.settings?.storeList || [];
16
+ const connectedMap = useMemo(() => {
17
+ if (!blocklet?.settings?.connectedStores) {
18
+ return {};
19
+ }
20
+ return blocklet?.settings?.connectedStores?.reduce((acc, x) => {
21
+ acc[x.storeUrl] = x;
22
+ return acc;
23
+ }, {});
24
+ }, [blocklet?.settings?.connectedStores]);
25
+ const did = blocklet?.meta?.did;
26
+ const handleAddStore = () => {};
27
+ return /*#__PURE__*/_jsxs(List, {
28
+ children: [storeList?.map(x => /*#__PURE__*/_jsx(ListItem, {
29
+ "data-cy": "store-switch",
30
+ children: /*#__PURE__*/_jsx(ListItemText, {
31
+ children: /*#__PURE__*/_jsx(StoreItem, {
32
+ releaseId: releaseId,
33
+ projectId: projectId,
34
+ releaseType: releaseType,
35
+ kind: "publish",
36
+ teamDid: did,
37
+ store: x,
38
+ published: publishedStoreIds?.indexOf(x.id) > -1,
39
+ connected: !!connectedMap[x.url],
40
+ onPublish: onPublish
41
+ })
42
+ })
43
+ }, x.url)), /*#__PURE__*/_jsx(AddStore, {
44
+ onAdd: handleAddStore,
45
+ teamDid: did,
46
+ blockletRegistryList: storeList
47
+ })]
48
+ });
49
+ }
50
+ ConnectStoreList.propTypes = {
51
+ blocklet: PropTypes.object.isRequired,
52
+ projectId: PropTypes.string.isRequired,
53
+ releaseId: PropTypes.string.isRequired,
54
+ releaseType: PropTypes.string.isRequired,
55
+ onPublish: PropTypes.func,
56
+ publishedStoreIds: PropTypes.arrayOf(PropTypes.string)
57
+ };
58
+ ConnectStoreList.defaultProps = {
59
+ publishedStoreIds: [],
60
+ onPublish: () => {}
61
+ };
62
+ export default ConnectStoreList;