@abtnode/ux 1.16.33 → 1.16.34-beta-20241120-080738-bbbe036c

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.
@@ -381,8 +381,7 @@ function BlockletActions({
381
381
  }
382
382
  }),
383
383
  name: t('sidebar.dashboard'),
384
- handler: handleOpenDashboard,
385
- disabled: disableStart || blocklet.status !== 'running'
384
+ handler: handleOpenDashboard
386
385
  } : null].filter(Boolean);
387
386
  if (tab === EXTERNAL) {
388
387
  // eslint-disable-next-line no-return-assign
@@ -1,3 +1,4 @@
1
+ import PropTypes from 'prop-types';
1
2
  import { useCreation } from 'ahooks';
2
3
  import { useSearchParams } from 'react-router-dom';
3
4
  import { Grid, Box, Stack, styled } from '@mui/material';
@@ -11,7 +12,10 @@ import useMobile from '../../hooks/use-mobile';
11
12
  import BlockletBackup from './backup';
12
13
  import BlockletStorage from './storage';
13
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- export default function BlockletDIDSpaces() {
15
+ export default function BlockletDIDSpaces({
16
+ navOrientation,
17
+ ...rest
18
+ }) {
15
19
  const {
16
20
  t,
17
21
  locale
@@ -25,6 +29,7 @@ export default function BlockletDIDSpaces() {
25
29
  });
26
30
  const [searchParams, setSearchParams] = useSearchParams();
27
31
  const current = searchParams.get('tab') || 'backup';
32
+ const orientation = isMobile ? 'horizontal' : navOrientation;
28
33
  const tabs = useCreation(() => {
29
34
  const results = [{
30
35
  label: /*#__PURE__*/_jsxs(Stack, {
@@ -58,7 +63,7 @@ export default function BlockletDIDSpaces() {
58
63
  });
59
64
  }
60
65
  return results;
61
- }, [locale]);
66
+ }, [locale, orientation]);
62
67
  const contentMaps = useCreation(() => ({
63
68
  backup: /*#__PURE__*/_jsx(BlockletBackup, {}),
64
69
  storage: /*#__PURE__*/_jsx(BlockletStorage, {})
@@ -79,45 +84,68 @@ export default function BlockletDIDSpaces() {
79
84
  children: content
80
85
  });
81
86
  }
82
- return /*#__PURE__*/_jsxs(Grid, {
83
- container: true,
84
- spacing: 4,
85
- columns: 24,
86
- sx: {
87
- marginTop: isMobile ? -6 : -4
88
- },
89
- children: [/*#__PURE__*/_jsx(Grid, {
90
- item: true,
91
- xs: 24,
92
- md: 5,
93
- lg: 4,
94
- children: /*#__PURE__*/_jsx(Tabs, {
95
- tabs: tabs,
96
- current: current,
97
- orientation: isMobile ? 'horizontal' : 'vertical',
98
- onChange: onTabChange,
99
- sx: [{
100
- borderRight: 1,
101
- height: '100%',
102
- borderColor: 'divider'
103
- }, isMobile && {
104
- borderRight: 0
105
- }]
87
+ const nav = /*#__PURE__*/_jsx(Tabs, {
88
+ tabs: tabs,
89
+ current: current,
90
+ orientation: orientation,
91
+ onChange: onTabChange,
92
+ sx: [{
93
+ borderRight: 1,
94
+ height: '100%',
95
+ borderColor: 'divider'
96
+ }, orientation === 'horizontal' && {
97
+ borderRight: 0
98
+ }]
99
+ });
100
+ if (orientation === 'vertical') {
101
+ return /*#__PURE__*/_jsx(Box, {
102
+ ...rest,
103
+ children: /*#__PURE__*/_jsxs(Grid, {
104
+ container: true,
105
+ columnSpacing: 4,
106
+ columns: 24,
107
+ sx: {
108
+ mt: -1
109
+ },
110
+ children: [/*#__PURE__*/_jsx(Grid, {
111
+ item: true,
112
+ md: 5,
113
+ lg: 4,
114
+ children: nav
115
+ }), /*#__PURE__*/_jsx(Grid, {
116
+ item: true,
117
+ md: 19,
118
+ lg: 20,
119
+ children: /*#__PURE__*/_jsx(ContentBox, {
120
+ sx: {
121
+ mt: 1
122
+ },
123
+ children: content
124
+ })
125
+ })]
106
126
  })
107
- }), /*#__PURE__*/_jsx(Grid, {
108
- item: true,
109
- xs: 24,
110
- md: 19,
111
- lg: 20,
112
- children: /*#__PURE__*/_jsx(ContentBox, {
127
+ });
128
+ }
129
+ if (orientation === 'horizontal') {
130
+ return /*#__PURE__*/_jsxs(Box, {
131
+ ...rest,
132
+ children: [nav, /*#__PURE__*/_jsx(ContentBox, {
133
+ sx: {
134
+ mt: 2
135
+ },
113
136
  children: content
114
- })
115
- })]
116
- });
137
+ })]
138
+ });
139
+ }
117
140
  }
141
+ BlockletDIDSpaces.propTypes = {
142
+ navOrientation: PropTypes.oneOf(['vertical', 'horizontal'])
143
+ };
144
+ BlockletDIDSpaces.defaultProps = {
145
+ navOrientation: 'vertical'
146
+ };
118
147
  const ContentBox = styled(Box)`
119
148
  position: relative;
120
149
  min-height: 66vh;
121
- height: 100%;
122
150
  overflow: hidden;
123
151
  `;
@@ -33,6 +33,7 @@ function Storage() {
33
33
  }
34
34
  return /*#__PURE__*/_jsxs(Box, {
35
35
  sx: {
36
+ maxWidth: 'md',
36
37
  position: 'relative'
37
38
  },
38
39
  children: [hasStorageEndpoint ? /*#__PURE__*/_jsx(Connected, {
@@ -21,7 +21,7 @@ export default function BlockletDiskInfo({
21
21
  actions
22
22
  } = useBlockletContext();
23
23
  useEffect(() => {
24
- actions.refreshBlocklet({
24
+ actions?.refreshBlocklet({
25
25
  showError: false,
26
26
  attachDiskInfo: true
27
27
  });
package/lib/store/add.js CHANGED
@@ -133,6 +133,7 @@ export default function AddStore({
133
133
  autoComplete: "off",
134
134
  variant: "outlined",
135
135
  name: "url",
136
+ "data-cy": "add-blocklet-store-url",
136
137
  fullWidth: true,
137
138
  value: url,
138
139
  onChange: e => {
@@ -43,7 +43,7 @@ export default function DeleteStore({
43
43
  scope
44
44
  }
45
45
  });
46
- await blockletContext?.actions.refreshBlocklet();
46
+ await blockletContext?.actions?.refreshBlocklet();
47
47
  if (onDelete && typeof onDelete === 'function') {
48
48
  onDelete();
49
49
  }
@@ -81,6 +81,7 @@ export default function DeleteStore({
81
81
  onClick: onMenuItemClick,
82
82
  children: children
83
83
  }) : /*#__PURE__*/_jsx(Button, {
84
+ "data-cy": "store-action-delete",
84
85
  color: "primary",
85
86
  disabled: loading,
86
87
  onClick: onMenuItemClick,
package/lib/store/item.js CHANGED
@@ -378,6 +378,7 @@ export default function StoreItem({
378
378
  },
379
379
  size: "small",
380
380
  children: [/*#__PURE__*/_jsx(Button, {
381
+ "data-cy": "store-open-url",
381
382
  onClick: handleOpenUrl,
382
383
  children: /*#__PURE__*/_jsx(LaunchIcon, {
383
384
  sx: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.33",
3
+ "version": "1.16.34-beta-20241120-080738-bbbe036c",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,9 +25,9 @@
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.33",
29
- "@abtnode/constant": "1.16.33",
30
- "@abtnode/util": "1.16.33",
28
+ "@abtnode/auth": "1.16.34-beta-20241120-080738-bbbe036c",
29
+ "@abtnode/constant": "1.16.34-beta-20241120-080738-bbbe036c",
30
+ "@abtnode/util": "1.16.34-beta-20241120-080738-bbbe036c",
31
31
  "@ahooksjs/use-url-state": "^3.5.1",
32
32
  "@arcblock/did": "^1.18.139",
33
33
  "@arcblock/did-connect": "^2.10.65",
@@ -37,12 +37,12 @@
37
37
  "@arcblock/react-hooks": "^2.10.65",
38
38
  "@arcblock/terminal": "^2.10.65",
39
39
  "@arcblock/ux": "^2.10.65",
40
- "@blocklet/constant": "1.16.33",
40
+ "@blocklet/constant": "1.16.34-beta-20241120-080738-bbbe036c",
41
41
  "@blocklet/did-space-react": "^0.5.65",
42
- "@blocklet/js-sdk": "1.16.33",
42
+ "@blocklet/js-sdk": "1.16.34-beta-20241120-080738-bbbe036c",
43
43
  "@blocklet/launcher-layout": "2.10.65",
44
44
  "@blocklet/list": "^0.14.18",
45
- "@blocklet/meta": "1.16.33",
45
+ "@blocklet/meta": "1.16.34-beta-20241120-080738-bbbe036c",
46
46
  "@blocklet/ui-react": "^2.10.65",
47
47
  "@blocklet/uploader": "0.1.51",
48
48
  "@emotion/react": "^11.10.4",
@@ -111,5 +111,5 @@
111
111
  "jest": "^29.7.0",
112
112
  "jest-environment-jsdom": "^29.7.0"
113
113
  },
114
- "gitHead": "f314706b7a6150adbf6bf700f06d2989981eaf1f"
114
+ "gitHead": "4bc345b51743e28a95bf09f7e0c0740838b39ad3"
115
115
  }