@abtnode/ux 1.16.28 → 1.16.29-beta-e04c6f40

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 (44) hide show
  1. package/lib/blocklet/add-cert.js +2 -2
  2. package/lib/blocklet/component/add-component/add-component-core.js +2 -2
  3. package/lib/blocklet/component/did-space/connect-to.js +2 -2
  4. package/lib/blocklet/install-from-url.js +2 -2
  5. package/lib/blocklet/migration.js +2 -2
  6. package/lib/blocklet/notification/push-kit.js +17 -3
  7. package/lib/blocklet/publish/create-release/blocklets.js +1 -1
  8. package/lib/blocklet/publish/create-release/branding.js +2 -1
  9. package/lib/blocklet/publish/create-release/connect-store-button.js +99 -23
  10. package/lib/blocklet/publish/create-release/connect-store-list.js +37 -29
  11. package/lib/blocklet/publish/create-release/index.js +5 -2
  12. package/lib/blocklet/publish/release-list.js +2 -1
  13. package/lib/blocklet/storage/connect-to.js +2 -2
  14. package/lib/blocklet/transfer-owner.js +2 -2
  15. package/lib/hooks/use-navigation.js +31 -2
  16. package/lib/invitation/invitation-receive.js +46 -25
  17. package/lib/invitation/invitation.js +4 -4
  18. package/lib/locales/ar.js +15 -4
  19. package/lib/locales/de.js +15 -4
  20. package/lib/locales/en.js +14 -3
  21. package/lib/locales/es.js +15 -4
  22. package/lib/locales/fr.js +15 -4
  23. package/lib/locales/hi.js +15 -4
  24. package/lib/locales/i18n.db +0 -0
  25. package/lib/locales/id.js +15 -4
  26. package/lib/locales/ja.js +15 -4
  27. package/lib/locales/ko.js +15 -4
  28. package/lib/locales/pt.js +15 -4
  29. package/lib/locales/ru.js +15 -4
  30. package/lib/locales/th.js +15 -4
  31. package/lib/locales/vi.js +15 -4
  32. package/lib/locales/zh-tw.js +15 -4
  33. package/lib/locales/zh.js +15 -4
  34. package/lib/store/add.js +31 -13
  35. package/lib/store/connect-actions.js +18 -18
  36. package/lib/store/item.js +30 -5
  37. package/lib/team/members/index.js +33 -1
  38. package/lib/team/members/invite-member.js +99 -67
  39. package/lib/team/members/issue-passport.js +2 -2
  40. package/lib/team/members/transfer-node.js +5 -5
  41. package/lib/team/passports/mutate-role.js +2 -2
  42. package/lib/util/index.js +1 -1
  43. package/lib/util/sdk.js +3 -0
  44. package/package.json +8 -7
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import useAsyncRetry from 'react-use/lib/useAsyncRetry';
5
5
  import Tooltip from '@mui/material/Tooltip';
6
6
  import CircularProgress from '@mui/material/CircularProgress';
7
- import Alert from '@arcblock/ux/lib/Alert';
7
+ import Alert from '@mui/material/Alert';
8
8
  import Toast from '@arcblock/ux/lib/Toast';
9
9
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
10
10
  import { BlockletEvents } from '@blocklet/constant';
@@ -121,7 +121,7 @@ function Add(props) {
121
121
  title: t('router.cert.genLetsEncryptCert.title'),
122
122
  description: /*#__PURE__*/_jsxs("div", {
123
123
  children: [/*#__PURE__*/_jsx(Alert, {
124
- type: "success",
124
+ severity: "success",
125
125
  children: t('router.cert.genLetsEncryptCert.dnsTip')
126
126
  }), t('router.cert.genLetsEncryptCert.description')]
127
127
  }),
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { useEffect, useRef, useState } from 'react';
4
4
  import { useParams } from 'react-router-dom';
5
5
  import { isInServerlessMode } from '@abtnode/util/lib/serverless';
6
- import Alert from '@arcblock/ux/lib/Alert';
6
+ import Alert from '@mui/material/Alert';
7
7
  import AnimationWaiter from '@arcblock/ux/lib/AnimationWaiter';
8
8
  import Button from '@arcblock/ux/lib/Button';
9
9
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
@@ -887,7 +887,7 @@ export default function AddComponentCore({
887
887
  }));
888
888
  }
889
889
  }), !!error && /*#__PURE__*/_jsx(Alert, {
890
- type: "error",
890
+ severity: "error",
891
891
  style: {
892
892
  width: '100%',
893
893
  marginTop: 8
@@ -7,7 +7,7 @@ import { joinURL } from 'ufo';
7
7
  import toast from '@arcblock/ux/lib/Toast';
8
8
  import SplitButton from '@arcblock/ux/lib/SplitButton';
9
9
  import Dialog from '@arcblock/ux/lib/Dialog';
10
- import Alert from '@arcblock/ux/lib/Alert';
10
+ import Alert from '@mui/material/Alert';
11
11
  import { func } from 'prop-types';
12
12
  import isEmpty from 'lodash/isEmpty';
13
13
  import useBlockletInfoForConnectDIDSpaces from '../../../hooks/use-blocklet-info-for-connect-did-spaces';
@@ -333,7 +333,7 @@ function ConnectTo({
333
333
  })
334
334
  })
335
335
  }), Boolean(errorMessage) && /*#__PURE__*/_jsx(Alert, {
336
- type: "error",
336
+ severity: "error",
337
337
  style: {
338
338
  width: '100%'
339
339
  },
@@ -12,7 +12,7 @@ import InfoRow from '@arcblock/ux/lib/InfoRow';
12
12
  import DidConnect from '@arcblock/did-connect/lib/Connect';
13
13
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
14
14
  import Button from '@arcblock/ux/lib/Button';
15
- import Alert from '@arcblock/ux/lib/Alert';
15
+ import Alert from '@mui/material/Alert';
16
16
  import { getDisplayName } from '@blocklet/meta/lib/util';
17
17
  import { useNodeContext } from '../contexts/node';
18
18
  import { useSessionContext } from '../contexts/session';
@@ -288,7 +288,7 @@ export default function InstallFromUrl({
288
288
  },
289
289
  children: step.body
290
290
  }), !!error && /*#__PURE__*/_jsx(Alert, {
291
- type: "error",
291
+ severity: "error",
292
292
  style: {
293
293
  width: '100%',
294
294
  marginTop: 8
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import Box from '@mui/material/Box';
3
- import Alert from '@arcblock/ux/lib/Alert';
3
+ import Alert from '@mui/material/Alert';
4
4
  import Button from '@arcblock/ux/lib/Button';
5
5
  import { APP_STRUCT_VERSION, DEFAULT_DID_DOMAIN, DEFAULT_IP_DOMAIN_SUFFIX } from '@abtnode/constant';
6
6
  import DidConnect from '@arcblock/did-connect/lib/Connect';
@@ -95,7 +95,7 @@ export default function BlockletMigration() {
95
95
  };
96
96
  const onClose = () => setOpenConnect(false);
97
97
  return [needMigration && /*#__PURE__*/_jsxs(Alert, {
98
- type: "warning",
98
+ severity: "warning",
99
99
  style: {
100
100
  margin: '12px 0'
101
101
  },
@@ -6,6 +6,7 @@ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
6
6
  import Toast from '@arcblock/ux/lib/Toast';
7
7
  import Button from '@arcblock/ux/lib/Button';
8
8
  import isURL from 'validator/lib/isURL';
9
+ import { joinURL, withQuery } from 'ufo';
9
10
  import { useNodeContext } from '../../contexts/node';
10
11
  import { useBlockletContext } from '../../contexts/blocklet';
11
12
  import useConfirm from '../../hooks/confirm';
@@ -82,15 +83,28 @@ function NotificationPushKit() {
82
83
  if (formState.isDirty) {
83
84
  await onSubmit(data, event, false);
84
85
  }
86
+ const appUrl = (blocklet?.configs || []).find(x => x.key === 'BLOCKLET_APP_URL')?.value;
85
87
  await api.sendPush({
86
88
  input: {
87
89
  did,
88
90
  receiver: pageState.testReceiver,
89
91
  notification: JSON.stringify({
90
- title: 'Test push-kit notification',
91
- body: 'This is message from push-kit config test',
92
92
  type: 'passthrough',
93
- passthroughType: 'messageStatus'
93
+ passthroughType: 'messageStatus',
94
+ data: {
95
+ message: {
96
+ title: 'Test push-kit notification',
97
+ body: 'This is message from push-kit config test',
98
+ sender: {
99
+ did: blocklet?.appDid,
100
+ fullName: blocklet?.meta?.title,
101
+ avatar: withQuery(joinURL(appUrl, '/.well-known/service/blocklet/logo'), {
102
+ v: blocklet?.meta?.version,
103
+ t: new Date(blocklet?.updatedAt || 0).getTime()
104
+ })
105
+ }
106
+ }
107
+ }
94
108
  })
95
109
  }
96
110
  });
@@ -155,7 +155,7 @@ export default function Blocklets({
155
155
  rowsPerPage: 50
156
156
  }
157
157
  }), /*#__PURE__*/_jsx(Alert, {
158
- type: "info",
158
+ severity: "info",
159
159
  style: {
160
160
  width: '100%'
161
161
  },
@@ -169,6 +169,7 @@ function Branding({
169
169
  children: /*#__PURE__*/_jsx(ConnectStoreButton, {
170
170
  blocklet: blocklet,
171
171
  store: wantToConnectStore,
172
+ componentDid: componentDid,
172
173
  onChangeStore: setWantToConnectStore,
173
174
  disabled: !params.blockletTitle || readOnly || loading,
174
175
  loading: loading,
@@ -178,7 +179,7 @@ function Branding({
178
179
  },
179
180
  error: !!paramsErrTip.projectId,
180
181
  helperText: paramsErrTip.projectId || '',
181
- value: projectId === UNOWNED_DID ? '' : projectId,
182
+ value: projectId === UNOWNED_DID ? '' : `did:abt:${projectId}`,
182
183
  sx: {
183
184
  mt: 3
184
185
  }
@@ -1,16 +1,16 @@
1
- import { useState, useRef } from 'react';
2
- import PropTypes from 'prop-types';
3
- import Button from '@mui/material/Button';
4
- import ButtonGroup from '@mui/material/ButtonGroup';
5
- import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
6
- import ClickAwayListener from '@mui/material/ClickAwayListener';
7
- import Grow from '@mui/material/Grow';
8
- import Paper from '@mui/material/Paper';
9
- import Popper from '@mui/material/Popper';
10
- import MenuItem from '@mui/material/MenuItem';
11
- import MenuList from '@mui/material/MenuList';
12
- import Spinner from '@mui/material/CircularProgress';
13
1
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
2
+ import { BLOCKLET_TENANT_MODES } from '@blocklet/constant';
3
+ import AddIcon from '@mui/icons-material/Add';
4
+ import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
5
+ import { Button, ButtonGroup, CircularProgress, ClickAwayListener, Divider, Grow, IconButton, MenuItem, MenuList, Paper, Popper, Typography } from '@mui/material';
6
+ import PropTypes from 'prop-types';
7
+ import { Icon } from '@iconify/react';
8
+ import { useRef, useState } from 'react';
9
+ import Toast from '@arcblock/ux/lib/Toast';
10
+ import formatError from '@abtnode/util/lib/format-error';
11
+ import AddStore from '../../../store/add';
12
+ import { useNodeContext } from '../../../contexts/node';
13
+ import ConfirmDialog from '../../../confirm';
14
14
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
15
15
  export default function ConnectStoreButton({
16
16
  blocklet,
@@ -18,19 +18,25 @@ export default function ConnectStoreButton({
18
18
  onChangeStore,
19
19
  onClick,
20
20
  disabled,
21
- loading
21
+ loading,
22
+ componentDid
22
23
  }) {
23
24
  const {
24
25
  t
25
26
  } = useLocaleContext();
26
27
  const [open, setOpen] = useState(false);
27
28
  const anchorRef = useRef(null);
28
- const handleMenuItemClick = nextStore => {
29
+ const [openAddStore, setOpenAddStore] = useState(false);
30
+ const {
31
+ api
32
+ } = useNodeContext();
33
+ const [deleteStore, setDeleteStore] = useState(null);
34
+ const handleSelectStore = nextStore => {
29
35
  onChangeStore(nextStore);
30
36
  setOpen(false);
31
37
  };
32
38
  const handleToggle = () => {
33
- setOpen(prevOpen => !prevOpen);
39
+ setOpen(true);
34
40
  };
35
41
  const handleClose = event => {
36
42
  if (anchorRef.current && anchorRef.current.contains(event.target)) {
@@ -38,7 +44,32 @@ export default function ConnectStoreButton({
38
44
  }
39
45
  setOpen(false);
40
46
  };
41
- const options = blocklet?.settings?.storeList || [];
47
+ const handleOpenAddStore = () => {
48
+ setOpenAddStore(true);
49
+ };
50
+ const handleCloseAddStore = () => {
51
+ setOpenAddStore(false);
52
+ };
53
+ const handleDeleteStore = async () => {
54
+ if (!deleteStore) {
55
+ return;
56
+ }
57
+ try {
58
+ await api.deleteBlockletStore({
59
+ input: {
60
+ teamDid: blocklet.meta.did,
61
+ url: deleteStore.url,
62
+ projectId: ''
63
+ }
64
+ });
65
+ setDeleteStore(null);
66
+ } catch (err) {
67
+ Toast.error(`Remove Blocklet Store Error: ${formatError(err)}`);
68
+ }
69
+ };
70
+ const storeList = blocklet?.settings?.storeList || [];
71
+ const did = blocklet?.meta?.did;
72
+ const manageable = !(componentDid && window.blocklet?.tenantMode === BLOCKLET_TENANT_MODES.MULTIPLE);
42
73
  return /*#__PURE__*/_jsxs(_Fragment, {
43
74
  children: [/*#__PURE__*/_jsxs(ButtonGroup, {
44
75
  disabled: disabled,
@@ -48,7 +79,7 @@ export default function ConnectStoreButton({
48
79
  "aria-label": "Button group with connect store",
49
80
  children: [/*#__PURE__*/_jsxs(Button, {
50
81
  onClick: onClick,
51
- children: [loading && /*#__PURE__*/_jsx(Spinner, {
82
+ children: [loading && /*#__PURE__*/_jsx(CircularProgress, {
52
83
  size: 14,
53
84
  sx: {
54
85
  mr: 0.5
@@ -83,18 +114,60 @@ export default function ConnectStoreButton({
83
114
  children: /*#__PURE__*/_jsx(Paper, {
84
115
  children: /*#__PURE__*/_jsx(ClickAwayListener, {
85
116
  onClickAway: handleClose,
86
- children: /*#__PURE__*/_jsx(MenuList, {
117
+ children: /*#__PURE__*/_jsxs(MenuList, {
87
118
  id: "split-button-menu",
88
119
  autoFocusItem: true,
89
- children: options.map(option => /*#__PURE__*/_jsx(MenuItem, {
120
+ children: [storeList.map(option => /*#__PURE__*/_jsxs(MenuItem, {
90
121
  selected: option.id === store.id,
91
- onClick: () => handleMenuItemClick(option),
92
- children: option.name
93
- }, option))
122
+ sx: {
123
+ height: 40
124
+ },
125
+ onClick: () => handleSelectStore(option),
126
+ children: [/*#__PURE__*/_jsx(Typography, {
127
+ variant: "inherit",
128
+ children: option.name
129
+ }), manageable && !option.protected && /*#__PURE__*/_jsx(IconButton, {
130
+ sx: {
131
+ ml: 1
132
+ },
133
+ onClick: e => {
134
+ e.preventDefault();
135
+ e.stopPropagation();
136
+ setDeleteStore(option);
137
+ },
138
+ children: /*#__PURE__*/_jsx(Icon, {
139
+ icon: "ic:outline-delete"
140
+ })
141
+ })]
142
+ }, option.url)), manageable && /*#__PURE__*/_jsx(Divider, {}), manageable && /*#__PURE__*/_jsxs(MenuItem, {
143
+ onClick: handleOpenAddStore,
144
+ children: [/*#__PURE__*/_jsx(AddIcon, {
145
+ font: true
146
+ }), /*#__PURE__*/_jsx(Typography, {
147
+ variant: "inherit",
148
+ children: t('store.blockletRegistry.addRegistry')
149
+ })]
150
+ })]
94
151
  })
95
152
  })
96
153
  })
97
154
  })
155
+ }), openAddStore && /*#__PURE__*/_jsx(AddStore, {
156
+ hiddenChildren: true,
157
+ open: true,
158
+ onClose: handleCloseAddStore,
159
+ teamDid: did,
160
+ storeList: storeList,
161
+ scope: "studio"
162
+ }), deleteStore && /*#__PURE__*/_jsx(ConfirmDialog, {
163
+ displayError: true,
164
+ title: `${t('common.delete')} ${deleteStore.name}`,
165
+ description: t('blocklet.publish.deleteStoreTip', {
166
+ name: deleteStore.name
167
+ }),
168
+ confirm: t('common.confirm'),
169
+ onConfirm: handleDeleteStore,
170
+ onCancel: () => setDeleteStore(null)
98
171
  })]
99
172
  });
100
173
  }
@@ -104,7 +177,10 @@ ConnectStoreButton.propTypes = {
104
177
  onChangeStore: PropTypes.func.isRequired,
105
178
  onClick: PropTypes.func.isRequired,
106
179
  loading: PropTypes.bool.isRequired,
107
- disabled: PropTypes.bool.isRequired
180
+ disabled: PropTypes.bool.isRequired,
181
+ componentDid: PropTypes.string.isRequired,
182
+ projectType: PropTypes.string.isRequired,
183
+ getData: PropTypes.func.isRequired
108
184
  };
109
185
  ConnectStoreButton.defaultProps = {
110
186
  store: null,
@@ -1,14 +1,13 @@
1
1
  import { useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Box, List, ListItem, ListItemText } from '@mui/material';
4
- import Alert from '@arcblock/ux/lib/Alert';
3
+ import { Box, List, Alert, ListItem, ListItemText } from '@mui/material';
5
4
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
6
5
  import LaunchIcon from '@mui/icons-material/Launch';
7
6
  import { blueGrey } from '@mui/material/colors';
8
7
  import { BLOCKLET_TENANT_MODES } from '@blocklet/constant';
9
8
  import AddStore from '../../../store/add';
10
9
  import StoreItem from '../../../store/item';
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
11
  function ConnectStoreList({
13
12
  blocklet,
14
13
  releaseId,
@@ -20,7 +19,9 @@ function ConnectStoreList({
20
19
  onDelete,
21
20
  projectType,
22
21
  componentDid,
23
- onOpenConnectStore
22
+ onOpenConnectStore,
23
+ behavior,
24
+ onSelectConnectStore
24
25
  }) {
25
26
  const {
26
27
  t
@@ -36,27 +37,9 @@ function ConnectStoreList({
36
37
  }, {});
37
38
  }, [connectedStores]);
38
39
  const did = blocklet?.meta?.did;
39
- const handleAddStore = () => {};
40
- return /*#__PURE__*/_jsxs(List, {
41
- children: [storeList?.map(x => /*#__PURE__*/_jsx(ListItem, {
42
- "data-cy": "store-switch",
43
- children: /*#__PURE__*/_jsx(ListItemText, {
44
- children: /*#__PURE__*/_jsx(StoreItem, {
45
- releaseId: releaseId,
46
- projectId: projectId,
47
- releaseType: releaseType,
48
- kind: "publish",
49
- teamDid: did,
50
- store: x,
51
- published: publishedStoreIds?.indexOf(x.id) > -1,
52
- connectedStore: connectedMap[x.id],
53
- onPublish: onPublish,
54
- onDelete: onDelete,
55
- onOpenConnectStore: onOpenConnectStore
56
- })
57
- })
58
- }, x.url)), !!storeList?.length && /*#__PURE__*/_jsx(Alert, {
59
- type: "info",
40
+ return /*#__PURE__*/_jsxs(_Fragment, {
41
+ children: [behavior === 'connect' && !!storeList?.length && /*#__PURE__*/_jsx(Alert, {
42
+ severity: "info",
60
43
  style: {
61
44
  width: '100%'
62
45
  },
@@ -74,10 +57,31 @@ function ConnectStoreList({
74
57
  }
75
58
  })]
76
59
  })
60
+ }), /*#__PURE__*/_jsx(List, {
61
+ children: storeList?.map(x => /*#__PURE__*/_jsx(ListItem, {
62
+ "data-cy": "store-switch",
63
+ children: /*#__PURE__*/_jsx(ListItemText, {
64
+ children: /*#__PURE__*/_jsx(StoreItem, {
65
+ behavior: behavior,
66
+ onSelectConnectStore: onSelectConnectStore,
67
+ releaseId: releaseId,
68
+ projectId: projectId,
69
+ releaseType: releaseType,
70
+ kind: "publish",
71
+ teamDid: did,
72
+ store: x,
73
+ published: publishedStoreIds?.indexOf(x.id) > -1,
74
+ connectedStore: connectedMap[x.id],
75
+ onPublish: onPublish,
76
+ onDelete: onDelete,
77
+ onOpenConnectStore: onOpenConnectStore
78
+ })
79
+ })
80
+ }, x.url))
77
81
  }), componentDid && window.blocklet?.tenantMode === BLOCKLET_TENANT_MODES.MULTIPLE ? null : /*#__PURE__*/_jsx(AddStore, {
78
- onAdd: handleAddStore,
79
82
  teamDid: did,
80
- storeList: storeList
83
+ storeList: storeList,
84
+ scope: "studio"
81
85
  })]
82
86
  });
83
87
  }
@@ -92,7 +96,9 @@ ConnectStoreList.propTypes = {
92
96
  connectedStores: PropTypes.arrayOf(PropTypes.object).isRequired,
93
97
  projectType: PropTypes.string,
94
98
  componentDid: PropTypes.string,
95
- onOpenConnectStore: PropTypes.func
99
+ onOpenConnectStore: PropTypes.func,
100
+ onSelectConnectStore: PropTypes.func,
101
+ behavior: PropTypes.string
96
102
  };
97
103
  ConnectStoreList.defaultProps = {
98
104
  projectType: '',
@@ -100,6 +106,8 @@ ConnectStoreList.defaultProps = {
100
106
  publishedStoreIds: [],
101
107
  onPublish: () => {},
102
108
  onDelete: () => {},
103
- onOpenConnectStore: () => {}
109
+ onOpenConnectStore: () => {},
110
+ onSelectConnectStore: () => {},
111
+ behavior: 'connect'
104
112
  };
105
113
  export default ConnectStoreList;
@@ -53,7 +53,9 @@ const addComponentTabs = ({
53
53
  });
54
54
  };
55
55
  const pickParams = (baseParams, app) => {
56
- const params = pick(baseParams, ['blockletVersion', 'blockletTitle', 'blockletDescription', 'blockletLogo', 'blockletIntroduction', 'blockletScreenshots', 'connectedStores', 'blockletComponents', 'lastReleaseId', 'uploadedResource', 'note']);
56
+ const params = pick(baseParams, ['blockletVersion', 'blockletTitle', 'blockletDescription', 'blockletLogo', 'blockletIntroduction', 'blockletScreenshots', 'connectedStores', 'blockletComponents', 'lastReleaseId', 'uploadedResource'
57
+ // 'note',
58
+ ]);
57
59
  if (!params.blockletComponents) {
58
60
  params.blockletComponents = (app.children || []).map(x => ({
59
61
  did: x.meta.did,
@@ -145,7 +147,7 @@ export default function CreateRelease({
145
147
  });
146
148
  }
147
149
  }, [projectId, setParamsErrTip]);
148
- const projectType = useMemo(() => params?.blockletComponents?.some(x => x.included) ? 'pack' : 'resource', [params?.blockletComponents]);
150
+ const projectType = useMemo(() => params?.blockletComponents?.some(x => x.included) || params?.uploadedResource ? 'pack' : 'resource', [params?.blockletComponents, params?.uploadedResource]);
149
151
  const tabs = [];
150
152
  const resourceComponents = (blocklet?.children || []).filter(x => x.meta.resource?.exportApi).filter(x => !componentDid || x.meta.did === componentDid);
151
153
  resourceComponents.forEach(item => {
@@ -338,6 +340,7 @@ export default function CreateRelease({
338
340
  initLogoUrl: initLogoUrl,
339
341
  releaseId: releaseId,
340
342
  projectId: projectId,
343
+ projectType: projectType,
341
344
  resourceComponents: resourceComponents,
342
345
  resourceComponentsMap: resourceComponentsMap,
343
346
  resourceRelateComponents: resourceRelateComponents,
@@ -241,10 +241,11 @@ export default function ReleaseList() {
241
241
  installUrl = url.href;
242
242
  downloadUrl = joinURL(`${WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${blocklet.meta.did}/${project.id}/${project.lastReleaseId}/download/${(project.lastReleaseFiles || [])[0]}`);
243
243
  }
244
+ const projectType = project.blockletComponents?.some(x => x.included) || release.uploadedResource ? 'pack' : 'resource';
244
245
  return /*#__PURE__*/_jsxs(Box, {
245
246
  display: "flex",
246
247
  alignItems: "center",
247
- children: [published && project.type === 'pack' && /*#__PURE__*/_jsx(Tooltip, {
248
+ children: [published && projectType === 'pack' && /*#__PURE__*/_jsx(Tooltip, {
248
249
  title: t('blocklet.publish.install', {
249
250
  name: project.blockletTitle
250
251
  }),
@@ -7,7 +7,7 @@ import { joinURL } from 'ufo';
7
7
  import toast from '@arcblock/ux/lib/Toast';
8
8
  import SplitButton from '@arcblock/ux/lib/SplitButton';
9
9
  import Dialog from '@arcblock/ux/lib/Dialog';
10
- import Alert from '@arcblock/ux/lib/Alert';
10
+ import Alert from '@mui/material/Alert';
11
11
  import { isEmpty } from 'lodash';
12
12
  import { useBlockletContext } from '../../contexts/blocklet';
13
13
  import { axios } from '../../util/api';
@@ -339,7 +339,7 @@ function ConnectTo({
339
339
  })
340
340
  })
341
341
  }), Boolean(errorMessage) && /*#__PURE__*/_jsx(Alert, {
342
- type: "error",
342
+ severity: "error",
343
343
  style: {
344
344
  width: '100%'
345
345
  },
@@ -10,7 +10,7 @@ import Typography from '@mui/material/Typography';
10
10
  import Connect from '@arcblock/did-connect/lib/Connect';
11
11
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
12
12
  import Button from '@arcblock/ux/lib/Button';
13
- import Alert from '@arcblock/ux/lib/Alert';
13
+ import Alert from '@mui/material/Alert';
14
14
  import FormControlLabel from '@mui/material/FormControlLabel';
15
15
  import Checkbox from '@mui/material/Checkbox';
16
16
  import ClickToCopy from '../click-to-copy';
@@ -176,7 +176,7 @@ export default function TransferOwner({
176
176
  component: "div",
177
177
  children: typeof step.body === 'function' ? step.body() : step.body
178
178
  }), !!error && /*#__PURE__*/_jsx(Alert, {
179
- type: "error",
179
+ severity: "error",
180
180
  variant: "icon",
181
181
  children: error
182
182
  })]
@@ -3,10 +3,12 @@ import cloneDeep from 'lodash/cloneDeep';
3
3
  import isNil from 'lodash/isNil';
4
4
  import omit from 'lodash/omit';
5
5
  import omitBy from 'lodash/omitBy';
6
+ import { joinURL } from 'ufo';
6
7
  import { useMemo } from 'react';
7
8
  import { Chip } from '@mui/material';
8
- import { deepWalk, parseNavigation, isMatchSection, nestNavigationList, filterNavigation, joinLink, cleanOrphanNavigation, flattenNavigation } from '@blocklet/meta/lib/parse-navigation-from-blocklet';
9
+ import { deepWalk, parseNavigation, isMatchSection, nestNavigationList, filterNavigation, joinLink, cleanOrphanNavigation, flattenNavigation, cleanOldNavigationHistory } from '@blocklet/meta/lib/parse-navigation-from-blocklet';
9
10
  import { WELLKNOWN_SERVICE_PATH_PREFIX } from '@abtnode/constant';
11
+ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
10
12
  import { useBlockletContext } from '../contexts/blocklet';
11
13
  import { nanoid } from '../util';
12
14
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -69,11 +71,38 @@ function isSameNavigation(a, b) {
69
71
  }
70
72
  return a.id === b.id;
71
73
  }
74
+ const createNavigationItem = (id, title, icon, link) => ({
75
+ id,
76
+ from: 'tmpl',
77
+ title,
78
+ icon,
79
+ link: joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, link)
80
+ });
81
+ const createNavigationSection = (id, title, items) => ({
82
+ id,
83
+ from: 'tmpl',
84
+ title,
85
+ role: ['owner', 'admin', 'member'],
86
+ section: ['dashboard'],
87
+ link: '',
88
+ items
89
+ });
90
+ const ensureServiceNavigation = (t, input) => {
91
+ const navigation = cleanOldNavigationHistory(input);
92
+ const index = navigation.findIndex(x => x.id === '/team');
93
+ if (index === -1) {
94
+ navigation.unshift(createNavigationSection('/team', t('navigation.blockletService'), [createNavigationItem('dashboard', t('navigation.dashboard'), 'ant-design:dashboard-outlined', '/admin'), createNavigationItem('member', t('navigation.members'), 'ant-design:user-outlined', '/admin/members'), createNavigationItem('passport', t('navigation.passport'), 'icon-park-outline:passport', '/admin/passports'), createNavigationItem('studio', t('navigation.studio'), 'eos-icons:subscriptions-created-outlined', '/admin/publish'), createNavigationItem('analytics', t('navigation.analytics'), 'mdi:chart-timeline-variant-shimmer', '/admin/analytics')]));
95
+ }
96
+ return navigation;
97
+ };
72
98
  export default function useNavigation() {
73
99
  const {
74
100
  blocklet,
75
101
  actions
76
102
  } = useBlockletContext();
103
+ const {
104
+ t
105
+ } = useLocaleContext();
77
106
  const {
78
107
  navigationList,
79
108
  components,
@@ -87,7 +116,7 @@ export default function useNavigation() {
87
116
  copyList.push(item);
88
117
  }
89
118
  });
90
- return copyList;
119
+ return ensureServiceNavigation(t, copyList);
91
120
  }
92
121
  });
93
122
  const state = useReactive({