@arcblock/ux 2.9.53 → 2.9.55

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ import { styled } from '../../Theme';
7
7
  import { NavLink } from './external-link';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- function renderGroup(item) {
10
+ function renderGroup(item, index) {
11
11
  return /*#__PURE__*/_jsxs("li", {
12
12
  className: "layout-sidebar-group",
13
13
  children: [/*#__PURE__*/_jsx("span", {
@@ -16,11 +16,11 @@ function renderGroup(item) {
16
16
  }), /*#__PURE__*/_jsx("ul", {
17
17
  children: item.children.map(renderItem)
18
18
  })]
19
- }, `group-${item.title}`);
19
+ }, `group-${item.title}-${index}`);
20
20
  }
21
- function renderItem(item) {
21
+ function renderItem(item, index) {
22
22
  if (item.children?.length) {
23
- return renderGroup(item);
23
+ return renderGroup(item, index);
24
24
  }
25
25
  const {
26
26
  url,
@@ -50,7 +50,7 @@ function renderItem(item) {
50
50
  children: title
51
51
  })]
52
52
  })
53
- }, url);
53
+ }, `${url}-${index}`);
54
54
  }
55
55
  function Sidebar({
56
56
  links,
@@ -7,4 +7,8 @@ export const RELAY_SOCKET_PREFIX = '/.well-known/service';
7
7
  export const API_DID_PREFIX = '/api/did';
8
8
  export const DASHBOARD_URL = `${AUTH_SERVICE_PREFIX}/admin`;
9
9
  export const PROFILE_URL = `${AUTH_SERVICE_PREFIX}/user`;
10
- export const NAVIGATION_URL = `${AUTH_SERVICE_PREFIX}/admin/navigation`;
10
+ export const NAVIGATION_URL = `${AUTH_SERVICE_PREFIX}/admin/navigation`;
11
+ export const PASSPORT_STATUS = {
12
+ VALID: 'valid',
13
+ REVOKED: 'revoked'
14
+ };
@@ -23,7 +23,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
23
23
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
24
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
25
25
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
26
- function renderGroup(item) {
26
+ function renderGroup(item, index) {
27
27
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
28
28
  className: "layout-sidebar-group",
29
29
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -32,12 +32,12 @@ function renderGroup(item) {
32
32
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
33
33
  children: item.children.map(renderItem)
34
34
  })]
35
- }, "group-".concat(item.title));
35
+ }, "group-".concat(item.title, "-").concat(index));
36
36
  }
37
- function renderItem(item) {
37
+ function renderItem(item, index) {
38
38
  var _item$children;
39
39
  if ((_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
40
- return renderGroup(item);
40
+ return renderGroup(item, index);
41
41
  }
42
42
  const {
43
43
  url,
@@ -70,7 +70,7 @@ function renderItem(item) {
70
70
  children: title
71
71
  })]
72
72
  })
73
- }, url);
73
+ }, "".concat(url, "-").concat(index));
74
74
  }
75
75
  function Sidebar(_ref2) {
76
76
  let {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SESSION_TOKEN_STORAGE_KEY = exports.RELAY_SOCKET_PREFIX = exports.REFRESH_TOKEN_STORAGE_KEY = exports.PROFILE_URL = exports.NAVIGATION_URL = exports.DEFAULT_WINDOW_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DASHBOARD_URL = exports.AUTH_SERVICE_PREFIX = exports.API_DID_PREFIX = void 0;
6
+ exports.SESSION_TOKEN_STORAGE_KEY = exports.RELAY_SOCKET_PREFIX = exports.REFRESH_TOKEN_STORAGE_KEY = exports.PROFILE_URL = exports.PASSPORT_STATUS = exports.NAVIGATION_URL = exports.DEFAULT_WINDOW_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DASHBOARD_URL = exports.AUTH_SERVICE_PREFIX = exports.API_DID_PREFIX = void 0;
7
7
  const DEFAULT_TIMEOUT = exports.DEFAULT_TIMEOUT = 5 * 60;
8
8
  const DEFAULT_WINDOW_TIMEOUT = exports.DEFAULT_WINDOW_TIMEOUT = 30 * 60;
9
9
  const AUTH_SERVICE_PREFIX = exports.AUTH_SERVICE_PREFIX = '/.well-known/service';
@@ -13,4 +13,8 @@ const RELAY_SOCKET_PREFIX = exports.RELAY_SOCKET_PREFIX = '/.well-known/service'
13
13
  const API_DID_PREFIX = exports.API_DID_PREFIX = '/api/did';
14
14
  const DASHBOARD_URL = exports.DASHBOARD_URL = "".concat(AUTH_SERVICE_PREFIX, "/admin");
15
15
  const PROFILE_URL = exports.PROFILE_URL = "".concat(AUTH_SERVICE_PREFIX, "/user");
16
- const NAVIGATION_URL = exports.NAVIGATION_URL = "".concat(AUTH_SERVICE_PREFIX, "/admin/navigation");
16
+ const NAVIGATION_URL = exports.NAVIGATION_URL = "".concat(AUTH_SERVICE_PREFIX, "/admin/navigation");
17
+ const PASSPORT_STATUS = exports.PASSPORT_STATUS = {
18
+ VALID: 'valid',
19
+ REVOKED: 'revoked'
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.9.53",
3
+ "version": "2.9.55",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -358,12 +358,12 @@
358
358
  "@mui/material": "^5.15.0",
359
359
  "react": ">=18.2.0"
360
360
  },
361
- "gitHead": "bf54e5b6fe510e2340ae87d1561d38d04dc25363",
361
+ "gitHead": "7af825692b779acb044cbe80badc99da732d242a",
362
362
  "dependencies": {
363
363
  "@arcblock/did-motif": "^1.1.13",
364
- "@arcblock/icons": "^2.9.53",
365
- "@arcblock/nft-display": "^2.9.53",
366
- "@arcblock/react-hooks": "^2.9.53",
364
+ "@arcblock/icons": "^2.9.55",
365
+ "@arcblock/nft-display": "^2.9.55",
366
+ "@arcblock/react-hooks": "^2.9.55",
367
367
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
368
368
  "@emotion/react": "^11.10.4",
369
369
  "@emotion/styled": "^11.10.4",
@@ -6,23 +6,23 @@ import clsx from 'clsx';
6
6
  import { styled } from '../../Theme';
7
7
  import { NavLink } from './external-link';
8
8
 
9
- function renderGroup(item) {
9
+ function renderGroup(item, index) {
10
10
  return (
11
- <li key={`group-${item.title}`} className="layout-sidebar-group">
11
+ <li key={`group-${item.title}-${index}`} className="layout-sidebar-group">
12
12
  <span className="layout-sidebar-group-title">{item.title}</span>
13
13
  <ul>{item.children.map(renderItem)}</ul>
14
14
  </li>
15
15
  );
16
16
  }
17
17
 
18
- function renderItem(item) {
18
+ function renderItem(item, index) {
19
19
  if (item.children?.length) {
20
- return renderGroup(item);
20
+ return renderGroup(item, index);
21
21
  }
22
22
  const { url, icon, title, showBadge, external, active } = item;
23
23
  // external = true 时 link active 状态由传入 links 的调用方决定 (适用于 blocklet ui dashboard 的情况)
24
24
  return (
25
- <li key={url} className="layout-sidebar-item">
25
+ <li key={`${url}-${index}`} className="layout-sidebar-item">
26
26
  <NavLink
27
27
  external={external}
28
28
  to={url}
@@ -10,3 +10,8 @@ export const API_DID_PREFIX = '/api/did';
10
10
  export const DASHBOARD_URL = `${AUTH_SERVICE_PREFIX}/admin`;
11
11
  export const PROFILE_URL = `${AUTH_SERVICE_PREFIX}/user`;
12
12
  export const NAVIGATION_URL = `${AUTH_SERVICE_PREFIX}/admin/navigation`;
13
+
14
+ export const PASSPORT_STATUS = {
15
+ VALID: 'valid',
16
+ REVOKED: 'revoked',
17
+ };