@abtnode/ux 1.16.17-beta-a8cf4b25 → 1.16.17-beta-d81014f4

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.
@@ -11,6 +11,7 @@ var _ButtonGroup = _interopRequireDefault(require("@mui/material/ButtonGroup"));
11
11
  var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
12
12
  var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
13
13
  var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
14
+ var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
14
15
  var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
15
16
  var _Select = _interopRequireDefault(require("@mui/material/Select"));
16
17
  var _Toolbar = _interopRequireDefault(require("@mui/material/Toolbar"));
@@ -78,6 +79,7 @@ function ConfigNavigation() {
78
79
  const {
79
80
  roles
80
81
  } = (0, _team.useTeamContext)();
82
+ const isMobile = (0, _useMediaQuery.default)(theme => theme.breakpoints.down('md'));
81
83
  const pageState = (0, _ahooks.useReactive)({
82
84
  saveLoading: false,
83
85
  resetLoading: false,
@@ -148,7 +150,7 @@ function ConfigNavigation() {
148
150
  try {
149
151
  pageState.resetLoading = true;
150
152
  await resetNavigation();
151
- _Toast.default.success('重置成功', {
153
+ _Toast.default.success(t('navigation.action.resetSuccessful'), {
152
154
  variant: 'success'
153
155
  });
154
156
  } catch (e) {
@@ -177,7 +179,16 @@ function ConfigNavigation() {
177
179
  };
178
180
  }, [blocklet.appDid, pageState.mockRole]);
179
181
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
180
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroup.default, {
182
+ children: [isMobile && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
183
+ fullWidth: true,
184
+ size: "small",
185
+ value: navigationState.activeSection,
186
+ onChange: event => updateActiveSection(event.target.value),
187
+ children: Object.keys(navigationTypeMap).map(key => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MenuItem.default, {
188
+ value: key,
189
+ children: [navigationTypeMap[key], " (".concat(getNavigation(key).length, ")")]
190
+ }))
191
+ }), !isMobile && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroup.default, {
181
192
  variant: "outlined",
182
193
  children: Object.keys(navigationTypeMap).map(key => {
183
194
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button.default, {
@@ -199,7 +210,7 @@ function ConfigNavigation() {
199
210
  sx: {
200
211
  flexGrow: 1
201
212
  },
202
- children: "Config"
213
+ children: t('common.config')
203
214
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroup.default, {
204
215
  variant: "outlined",
205
216
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingButton.default, {
@@ -217,7 +228,7 @@ function ConfigNavigation() {
217
228
  onClick: () => {
218
229
  pageState.showResetConfirm = true;
219
230
  },
220
- children: "\u91CD\u7F6E"
231
+ children: t('navigation.action.reset')
221
232
  })
222
233
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ButtonGroup.default, {
223
234
  variant: "outlined",
@@ -228,7 +239,7 @@ function ConfigNavigation() {
228
239
  icon: "mdi:plus"
229
240
  }),
230
241
  onClick: () => handleAddNavigation(),
231
- children: "\u65B0\u5EFA"
242
+ children: t('navigation.action.new')
232
243
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingButton.default, {
233
244
  size: "small",
234
245
  variant: "contained",
@@ -238,7 +249,7 @@ function ConfigNavigation() {
238
249
  loading: pageState.saveLoading,
239
250
  loadingPosition: "start",
240
251
  onClick: handleSaveNavigation,
241
- children: "\u4FDD\u5B58"
252
+ children: t('common.save')
242
253
  })]
243
254
  })]
244
255
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Paper.default, {
@@ -304,7 +315,7 @@ function ConfigNavigation() {
304
315
  sx: {
305
316
  flexGrow: 1
306
317
  },
307
- children: "Preview"
318
+ children: t('common.preview')
308
319
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_FormControl.default, {
309
320
  sx: {
310
321
  m: 1,
@@ -312,7 +323,7 @@ function ConfigNavigation() {
312
323
  },
313
324
  size: "small",
314
325
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
315
- children: "Role"
326
+ children: t('common.role')
316
327
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
317
328
  value: pageState.mockRole,
318
329
  label: "Role",
@@ -339,8 +350,21 @@ function ConfigNavigation() {
339
350
  components: navigationState.components,
340
351
  rawNavigations: navigationState.rawNavigation
341
352
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.Confirm, {
353
+ confirmButton: {
354
+ text: t('common.confirm'),
355
+ props: {
356
+ variant: 'contained',
357
+ color: 'error'
358
+ }
359
+ },
360
+ cancelButton: {
361
+ text: t('common.cancel'),
362
+ props: {
363
+ color: 'primary'
364
+ }
365
+ },
342
366
  open: pageState.showResetConfirm,
343
- title: "\u662F\u5426\u6E05\u7A7A\u6240\u6709\u81EA\u5B9A\u4E49\u5BFC\u822A",
367
+ title: t('navigation.action.restConfirmTitle'),
344
368
  onConfirm: async () => {
345
369
  await handleResetNavigation();
346
370
  pageState.showResetConfirm = false;
@@ -349,7 +373,7 @@ function ConfigNavigation() {
349
373
  pageState.showResetConfirm = false;
350
374
  },
351
375
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
352
- children: "\u6E05\u7A7A\u540E\uFF0C\u5BFC\u822A\u4F1A\u6062\u590D\u5230 Blocklet \u539F\u6709\u9ED8\u8BA4\u7684\u914D\u7F6E"
376
+ children: t('navigation.action.restConfirmDesc')
353
377
  })
354
378
  })]
355
379
  });
@@ -70,7 +70,6 @@ function DomainStatus(_ref) {
70
70
  style: {
71
71
  color: '#D0021B',
72
72
  fontSize: 20,
73
- marginLeft: 8,
74
73
  cursor: 'pointer'
75
74
  }
76
75
  })
@@ -42,7 +42,6 @@ function Certificate(_ref) {
42
42
  style: {
43
43
  color: '#44cdc6',
44
44
  fontSize: 20,
45
- marginLeft: 8,
46
45
  cursor: 'pointer'
47
46
  }
48
47
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
package/lib/dot.js CHANGED
@@ -13,6 +13,6 @@ const color = {
13
13
  error: '#D0021B'
14
14
  };
15
15
  const defaultSize = '10px';
16
- const Dot = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n width: ", ";\n height: ", ";\n background: ", ";\n border-radius: 100%;\n"])), props => props.size || defaultSize, props => props.size || defaultSize, props => color[props.color] || props.color || color.success);
16
+ const Dot = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n min-width: ", ";\n min-height: ", ";\n background: ", ";\n border-radius: 100%;\n"])), props => props.size || defaultSize, props => props.size || defaultSize, props => color[props.color] || props.color || color.success);
17
17
  var _default = Dot;
18
18
  exports.default = _default;
package/lib/locales/en.js CHANGED
@@ -233,6 +233,7 @@ module.exports = {
233
233
  port: 'Port',
234
234
  pre: 'Previous',
235
235
  preferences: 'Preferences',
236
+ preview: 'Preview',
236
237
  protected: 'Protected',
237
238
  protocol: 'Protocol',
238
239
  publish: 'Publish',
@@ -1432,9 +1433,14 @@ module.exports = {
1432
1433
  hide: 'Hide navigation',
1433
1434
  show: 'Show navigation',
1434
1435
  del: 'Delete navigation',
1436
+ new: 'New',
1435
1437
  noAddSub: "Uninstalled component can't add sub navigation",
1436
1438
  noEdit: "Uninstalled component can't edit",
1437
- noDel: 'Not allowed delete built-in navigation'
1439
+ noDel: 'Not allowed delete built-in navigation',
1440
+ reset: 'Reset',
1441
+ restConfirmTitle: 'Do you want to clear all custom navigation?',
1442
+ restConfirmDesc: "After clearing, the navigation will be restored to Blocklet's original default configuration.",
1443
+ resetSuccessful: 'Reset successful'
1438
1444
  }
1439
1445
  },
1440
1446
  storage: {
package/lib/locales/zh.js CHANGED
@@ -238,6 +238,7 @@ module.exports = {
238
238
  port: '端口',
239
239
  pre: '上一步',
240
240
  preferences: '偏好',
241
+ preview: '预览',
241
242
  protected: '受保护',
242
243
  protocol: '协议',
243
244
  publish: '发布',
@@ -1409,8 +1410,8 @@ module.exports = {
1409
1410
  }
1410
1411
  },
1411
1412
  navigation: {
1412
- navigation: '导航',
1413
1413
  actionFailed: '操作失败',
1414
+ navigation: '导航',
1414
1415
  form: {
1415
1416
  title: '标题',
1416
1417
  titlePlaceholder: '请输入导航标题',
@@ -1437,9 +1438,14 @@ module.exports = {
1437
1438
  hide: '隐藏导航',
1438
1439
  show: '显示导航',
1439
1440
  del: '删除导航',
1441
+ new: '新建',
1440
1442
  noAddSub: '未安装组件无法添加子导航',
1441
1443
  noEdit: '未安装组件的导航无法编辑',
1442
- noDel: '内置的导航无法删除'
1444
+ noDel: '内置的导航无法删除',
1445
+ reset: '重置',
1446
+ restConfirmTitle: '是否清空所有自定义导航?',
1447
+ restConfirmDesc: '清空后,导航会恢复到 Blocklet 原有默认的配置.',
1448
+ resetSuccessful: '重置成功'
1443
1449
  }
1444
1450
  },
1445
1451
  storage: {
@@ -9,6 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _styled = _interopRequireDefault(require("@emotion/styled"));
10
10
  var _Add = _interopRequireDefault(require("@mui/icons-material/Add"));
11
11
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
12
+ var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
12
13
  var _context = require("@arcblock/ux/lib/Locale/context");
13
14
  var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
14
15
  var _SplitButton = _interopRequireDefault(require("@arcblock/ux/lib/SplitButton"));
@@ -16,7 +17,7 @@ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularPr
16
17
  var _EditIcon = _interopRequireDefault(require("@arcblock/icons/lib/EditIcon"));
17
18
  var _LockIcon = _interopRequireDefault(require("@arcblock/icons/lib/LockIcon"));
18
19
  var _ExternalIssuerIcon = _interopRequireDefault(require("@arcblock/icons/lib/ExternalIssuerIcon"));
19
- var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
20
+ var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
20
21
  var _node = require("../../contexts/node");
21
22
  var _team = require("../../contexts/team");
22
23
  var _util = require("../../util");
@@ -62,6 +63,7 @@ function PassportList(_ref) {
62
63
  const [showTrustedFactories, setShowTrustedFactories] = (0, _react.useState)(false);
63
64
  const [search, setSearch] = (0, _react.useState)('');
64
65
  const [loading, setLoading] = (0, _react.useState)(false);
66
+ const isMobile = (0, _useMediaQuery.default)(x => x.breakpoints.down('md'));
65
67
  const toggleShowIssue = async e => {
66
68
  e.stopPropagation();
67
69
  if (loading) {
@@ -186,6 +188,10 @@ function PassportList(_ref) {
186
188
  className: "list",
187
189
  children: filteredRoles.map(role => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
188
190
  "data-cy": "passport-".concat(role.name),
191
+ sx: {
192
+ display: 'flex',
193
+ justifyContent: 'space-between'
194
+ },
189
195
  className: "item",
190
196
  display: "flex",
191
197
  alignItems: "center",
@@ -215,7 +221,7 @@ function PassportList(_ref) {
215
221
  className: "title",
216
222
  children: role.title
217
223
  })]
218
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
224
+ }), !isMobile && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
219
225
  className: "description",
220
226
  children: role.description
221
227
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_permission.default, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.17-beta-a8cf4b25",
3
+ "version": "1.16.17-beta-d81014f4",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -27,23 +27,23 @@
27
27
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@abtnode/auth": "1.16.17-beta-a8cf4b25",
31
- "@abtnode/constant": "1.16.17-beta-a8cf4b25",
32
- "@abtnode/util": "1.16.17-beta-a8cf4b25",
30
+ "@abtnode/auth": "1.16.17-beta-d81014f4",
31
+ "@abtnode/constant": "1.16.17-beta-d81014f4",
32
+ "@abtnode/util": "1.16.17-beta-d81014f4",
33
33
  "@ahooksjs/use-url-state": "^3.5.1",
34
34
  "@arcblock/did": "^1.18.93",
35
- "@arcblock/did-connect": "^2.8.4",
35
+ "@arcblock/did-connect": "^2.8.5",
36
36
  "@arcblock/did-motif": "^1.1.13",
37
- "@arcblock/icons": "^2.8.4",
38
- "@arcblock/nft-display": "2.8.4",
39
- "@arcblock/react-hooks": "^2.8.4",
40
- "@arcblock/terminal": "^2.8.4",
41
- "@arcblock/ux": "^2.8.4",
42
- "@blocklet/constant": "1.16.17-beta-a8cf4b25",
37
+ "@arcblock/icons": "^2.8.5",
38
+ "@arcblock/nft-display": "2.8.5",
39
+ "@arcblock/react-hooks": "^2.8.5",
40
+ "@arcblock/terminal": "^2.8.5",
41
+ "@arcblock/ux": "^2.8.5",
42
+ "@blocklet/constant": "1.16.17-beta-d81014f4",
43
43
  "@blocklet/launcher-layout": "2.2.22",
44
44
  "@blocklet/list": "^0.12.46",
45
- "@blocklet/meta": "1.16.17-beta-a8cf4b25",
46
- "@blocklet/ui-react": "^2.8.4",
45
+ "@blocklet/meta": "1.16.17-beta-d81014f4",
46
+ "@blocklet/ui-react": "^2.8.5",
47
47
  "@blocklet/uploader": "^0.0.32",
48
48
  "@emotion/react": "^11.10.4",
49
49
  "@emotion/styled": "^11.10.4",
@@ -100,7 +100,7 @@
100
100
  "babel-plugin-inline-react-svg": "^1.1.2",
101
101
  "glob": "^10.3.3"
102
102
  },
103
- "gitHead": "df8486ab9a180f0f3fc812821440a995d65bc63d",
103
+ "gitHead": "0317f39a400a7ee4475e09e9154de5d8f8227b50",
104
104
  "exports": {
105
105
  ".": {
106
106
  "import": "./es/index.js",