@abtnode/ux 1.16.29-beta-2eaf40bc → 1.16.29-beta-cbfd116d

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.
@@ -59,7 +59,7 @@ const StepContent = /*#__PURE__*/forwardRef(({
59
59
  }) : null,
60
60
  stepTip: t('blocklet.component.add'),
61
61
  children: /*#__PURE__*/_jsx(RightContent, {
62
- children: step?.body && typeof step.body === 'function' ? step.body() : step.body
62
+ children: typeof step?.body === 'function' ? step.body() : step?.body
63
63
  })
64
64
  })
65
65
  });
@@ -113,8 +113,6 @@ const ContentWrapper = styled(Box)`
113
113
  }
114
114
  }
115
115
 
116
-
117
-
118
116
  // content-panel
119
117
  .root-header + div{
120
118
  padding-top: 0;
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { ListItemIcon, ListItemText, MenuItem } from '@mui/material';
3
+ import { ListItemIcon, ListItemText, MenuItem, Typography } from '@mui/material';
4
4
  import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
5
5
  import Confirm from '@arcblock/ux/lib/Dialog/confirm';
6
6
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
@@ -73,8 +73,11 @@ function DeleteDIDSpacesGateWay({
73
73
  children: t('common.delete')
74
74
  })]
75
75
  }), /*#__PURE__*/_jsx(Confirm, {
76
- title: t('common.delConfirmDescription', {
77
- data: `${spaceGateway?.name}`
76
+ title: /*#__PURE__*/_jsx(Typography, {
77
+ variant: "h6",
78
+ children: t('common.delConfirmDescription', {
79
+ data: `${spaceGateway?.name}`
80
+ })
78
81
  }),
79
82
  open: open,
80
83
  confirmButton: {
@@ -219,7 +219,7 @@ function Disconnect() {
219
219
  alignContent: "center",
220
220
  children: [/*#__PURE__*/_jsx(EmptySpacesNFT, {
221
221
  style: {
222
- width: 200,
222
+ width: 250,
223
223
  height: 250
224
224
  }
225
225
  }), /*#__PURE__*/_jsx(Typography, {
@@ -1,16 +1,29 @@
1
1
  import React from 'react';
2
+ import isEmpty from 'lodash/isEmpty';
3
+ import Center from '@arcblock/ux/lib/Center';
4
+ import { CircularProgress } from '@mui/material';
2
5
  import Disconnect from './disconnect';
3
6
  import Connected from './connected';
4
- import { useBlockletStorageContext } from '../../contexts/blocklet-storage';
7
+ import { BlockletStorageProvider, useBlockletStorageContext } from '../../contexts/blocklet-storage';
5
8
  import { jsx as _jsx } from "react/jsx-runtime";
6
- function NewStorage() {
9
+ function StoragePage() {
7
10
  const {
8
- backupEndpoint
11
+ spaceGatewaysLoading,
12
+ spaceGateways
9
13
  } = useBlockletStorageContext();
10
- if (backupEndpoint) {
11
- return /*#__PURE__*/_jsx(Connected, {});
14
+ if (spaceGatewaysLoading) {
15
+ return /*#__PURE__*/_jsx(Center, {
16
+ relative: "parent",
17
+ children: /*#__PURE__*/_jsx(CircularProgress, {})
18
+ });
12
19
  }
13
- return /*#__PURE__*/_jsx(Disconnect, {});
20
+ if (isEmpty(spaceGateways)) {
21
+ return /*#__PURE__*/_jsx(Disconnect, {});
22
+ }
23
+ return /*#__PURE__*/_jsx(Connected, {});
14
24
  }
15
- NewStorage.propTypes = {};
16
- export default NewStorage;
25
+ export default function Storage() {
26
+ return /*#__PURE__*/_jsx(BlockletStorageProvider, {
27
+ children: /*#__PURE__*/_jsx(StoragePage, {})
28
+ });
29
+ }
@@ -104,6 +104,20 @@ function BlockletStorageProvider({
104
104
  setAutoCheckUpdateRefresh(x => !x);
105
105
  };
106
106
 
107
+ /**
108
+ * @description
109
+ * @param {AutoBackup} value
110
+ */
111
+ const updateAutoBackup = async value => {
112
+ await api.updateAutoBackup({
113
+ input: {
114
+ did: blocklet.meta.did,
115
+ autoBackup: value
116
+ }
117
+ });
118
+ refreshAutoBackup();
119
+ };
120
+
107
121
  /**
108
122
  * @description
109
123
  * @param {SpaceGateway} spaceGateway
@@ -144,6 +158,22 @@ function BlockletStorageProvider({
144
158
  if (!spaceGateway) {
145
159
  return;
146
160
  }
161
+ if (spaceGateway.endpoint === backupEndpoint) {
162
+ await api.configBlocklet({
163
+ input: {
164
+ did: [blocklet.meta.did],
165
+ configs: [{
166
+ key: BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,
167
+ value: ''
168
+ }]
169
+ }
170
+ });
171
+ if (autoBackup?.enabled) {
172
+ await updateAutoBackup({
173
+ enabled: false
174
+ });
175
+ }
176
+ }
147
177
  await api.deleteBlockletSpaceGateway({
148
178
  input: {
149
179
  did: blocklet.meta.did,
@@ -190,20 +220,6 @@ function BlockletStorageProvider({
190
220
  * @param {SpaceGateway} spaceGateway
191
221
  */
192
222
  const spaceGatewayIsSelected = spaceGateway => spaceGateway?.endpoint === backupEndpoint;
193
-
194
- /**
195
- * @description
196
- * @param {AutoBackup} value
197
- */
198
- const updateAutoBackup = async value => {
199
- await api.updateAutoBackup({
200
- input: {
201
- did: blocklet.meta.did,
202
- autoBackup: value
203
- }
204
- });
205
- refreshAutoBackup();
206
- };
207
223
  const updateAutoCheckUpdate = async value => {
208
224
  await api.updateAutoCheckUpdate({
209
225
  input: {
@@ -3,6 +3,13 @@ import { useAsyncEffect } from 'ahooks';
3
3
  import { useState } from 'react';
4
4
  import { useBlockletContext } from '../contexts/blocklet';
5
5
  import { useNodeContext } from '../contexts/node';
6
+
7
+ /**
8
+ * @description
9
+ * @export
10
+ * @param {*} [{ deps }={ deps: [] }]
11
+ * @return {import('@abtnode/client').AutoBackup | null}
12
+ */
6
13
  export function useAutoBackup({
7
14
  deps
8
15
  } = {
@@ -23,10 +23,7 @@ export default function useSpaceGateways({
23
23
  } = {}) {
24
24
  /** @type {{ blocklet: import('@abtnode/client').BlockletState }} */
25
25
  const {
26
- blocklet,
27
- actions: {
28
- refreshBlocklet
29
- }
26
+ blocklet
30
27
  } = useBlockletContext();
31
28
  const blockletDid = blocklet?.meta?.did;
32
29
  const [spaceGateways, setSpaceGateways] = useState([]);
@@ -59,7 +56,7 @@ export default function useSpaceGateways({
59
56
  } finally {
60
57
  setLoading?.(false);
61
58
  }
62
- }, [blockletDid, refreshBlocklet, refresh]);
59
+ }, [blockletDid, refresh]);
63
60
  return {
64
61
  spaceGateways
65
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.29-beta-2eaf40bc",
3
+ "version": "1.16.29-beta-cbfd116d",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,24 +25,24 @@
25
25
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/auth": "1.16.29-beta-2eaf40bc",
29
- "@abtnode/constant": "1.16.29-beta-2eaf40bc",
30
- "@abtnode/util": "1.16.29-beta-2eaf40bc",
28
+ "@abtnode/auth": "1.16.29-beta-cbfd116d",
29
+ "@abtnode/constant": "1.16.29-beta-cbfd116d",
30
+ "@abtnode/util": "1.16.29-beta-cbfd116d",
31
31
  "@ahooksjs/use-url-state": "^3.5.1",
32
32
  "@arcblock/did": "^1.18.126",
33
- "@arcblock/did-connect": "^2.10.5",
33
+ "@arcblock/did-connect": "^2.10.7",
34
34
  "@arcblock/did-motif": "^1.1.13",
35
- "@arcblock/icons": "^2.10.5",
36
- "@arcblock/nft-display": "2.10.5",
37
- "@arcblock/react-hooks": "^2.10.5",
38
- "@arcblock/terminal": "^2.10.5",
39
- "@arcblock/ux": "^2.10.5",
40
- "@blocklet/constant": "1.16.29-beta-2eaf40bc",
41
- "@blocklet/js-sdk": "1.16.29-beta-2eaf40bc",
42
- "@blocklet/launcher-layout": "2.3.30",
35
+ "@arcblock/icons": "^2.10.7",
36
+ "@arcblock/nft-display": "2.10.7",
37
+ "@arcblock/react-hooks": "^2.10.7",
38
+ "@arcblock/terminal": "^2.10.7",
39
+ "@arcblock/ux": "^2.10.7",
40
+ "@blocklet/constant": "1.16.29-beta-cbfd116d",
41
+ "@blocklet/js-sdk": "1.16.29-beta-cbfd116d",
42
+ "@blocklet/launcher-layout": "2.3.33",
43
43
  "@blocklet/list": "^0.13.9",
44
- "@blocklet/meta": "1.16.29-beta-2eaf40bc",
45
- "@blocklet/ui-react": "^2.10.5",
44
+ "@blocklet/meta": "1.16.29-beta-cbfd116d",
45
+ "@blocklet/ui-react": "^2.10.7",
46
46
  "@blocklet/uploader": "0.1.19",
47
47
  "@emotion/react": "^11.10.4",
48
48
  "@emotion/styled": "^11.10.4",
@@ -108,5 +108,5 @@
108
108
  "jest": "^29.7.0",
109
109
  "jest-environment-jsdom": "^29.7.0"
110
110
  },
111
- "gitHead": "d723d07ca8914468fc1b53af23aa53dc343e0a8c"
111
+ "gitHead": "e9bdb7af77f2d126e40195c67972b07fe683adf9"
112
112
  }