@blocklet/ui-react 2.4.38 → 2.4.40

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.
@@ -15,10 +15,6 @@ var _context = require("@arcblock/ux/lib/Locale/context");
15
15
 
16
16
  var _dashboard = _interopRequireDefault(require("@arcblock/ux/lib/Layout/dashboard"));
17
17
 
18
- var _Address = _interopRequireDefault(require("@arcblock/did-connect/lib/Address"));
19
-
20
- var _Avatar = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar"));
21
-
22
18
  var _types = require("../types");
23
19
 
24
20
  var _utils = require("../utils");
@@ -138,7 +134,6 @@ function Dashboard(_ref) {
138
134
  }
139
135
 
140
136
  const {
141
- appId: did,
142
137
  appLogo,
143
138
  appName
144
139
  } = formattedBlocklet;
@@ -157,33 +152,10 @@ function Dashboard(_ref) {
157
152
  links: localizedNav
158
153
  }, rest), {}, {
159
154
  headerProps: _objectSpread({
160
- brand: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
161
- href: _blocklets.publicPath,
162
- children: appName
163
- }),
164
- description: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
165
- href: _blocklets.publicPath,
166
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Address.default, {
167
- compact: true,
168
- responsive: false,
169
- copyable: false,
170
- showCopyButtonInTooltip: true,
171
- prepend: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
172
- did: did,
173
- size: 16,
174
- style: {
175
- marginRight: 4
176
- }
177
- }),
178
- children: did
179
- })
180
- }),
181
- logo: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
182
- href: _blocklets.publicPath,
183
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
184
- src: appLogo,
185
- alt: "logo"
186
- })
155
+ homeLink: _blocklets.publicPath,
156
+ logo: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
157
+ src: appLogo,
158
+ alt: "logo"
187
159
  }),
188
160
  addons: _headerAddons
189
161
  }, rest.headerProps)
@@ -21,10 +21,6 @@ var _NavMenu = _interopRequireDefault(require("@arcblock/ux/lib/NavMenu"));
21
21
 
22
22
  var _context = require("@arcblock/ux/lib/Locale/context");
23
23
 
24
- var _Address = _interopRequireDefault(require("@arcblock/did-connect/lib/Address"));
25
-
26
- var _Avatar = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar"));
27
-
28
24
  var _Icon = _interopRequireDefault(require("../Icon"));
29
25
 
30
26
  var _overridableThemeProvider = _interopRequireDefault(require("../common/overridable-theme-provider"));
@@ -150,9 +146,7 @@ function Header(_ref) {
150
146
  }
151
147
 
152
148
  const {
153
- appId: did,
154
149
  appLogo,
155
- appName,
156
150
  theme
157
151
  } = formattedBlocklet;
158
152
  const navigation = (0, _blocklets.getLocalizedNavigation)(formattedBlocklet === null || formattedBlocklet === void 0 ? void 0 : (_formattedBlocklet$na = formattedBlocklet.navigation) === null || _formattedBlocklet$na === void 0 ? void 0 : _formattedBlocklet$na.header, locale);
@@ -174,34 +168,11 @@ function Header(_ref) {
174
168
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_overridableThemeProvider.default, {
175
169
  theme: themeOverrides,
176
170
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledUxHeader, _objectSpread(_objectSpread({
177
- logo: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
178
- href: homeLink,
179
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
180
- src: appLogo,
181
- alt: "logo"
182
- })
183
- }),
184
- brand: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
185
- href: homeLink,
186
- children: appName
171
+ homeLink: homeLink,
172
+ logo: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
173
+ src: appLogo,
174
+ alt: "logo"
187
175
  }),
188
- description: did ? /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
189
- href: homeLink,
190
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Address.default, {
191
- compact: true,
192
- responsive: false,
193
- copyable: false,
194
- showCopyButtonInTooltip: true,
195
- prepend: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
196
- did: did,
197
- size: 16,
198
- style: {
199
- marginRight: 4
200
- }
201
- }),
202
- children: did
203
- })
204
- }) : null,
205
176
  addons: headerAddons
206
177
  }, rest), {}, {
207
178
  $bgcolor: theme === null || theme === void 0 ? void 0 : (_theme$background = theme.background) === null || _theme$background === void 0 ? void 0 : _theme$background.header,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.4.38",
3
+ "version": "2.4.40",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -30,8 +30,8 @@
30
30
  "url": "https://github.com/ArcBlock/ux/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@arcblock/did-connect": "^2.4.38",
34
- "@arcblock/ux": "^2.4.38",
33
+ "@arcblock/did-connect": "^2.4.40",
34
+ "@arcblock/ux": "^2.4.40",
35
35
  "@emotion/react": "^11.10.4",
36
36
  "@emotion/styled": "^11.10.4",
37
37
  "@iconify/iconify": "^2.2.1",
@@ -53,5 +53,5 @@
53
53
  "eslint-plugin-react-hooks": "^4.6.0",
54
54
  "jest": "^28.1.3"
55
55
  },
56
- "gitHead": "d5db89486d5c862c2f11c26991ac515e701ac7d3"
56
+ "gitHead": "c26da2c4ed0c311c2dceab75db245f0290344860"
57
57
  }
@@ -4,8 +4,6 @@ import PropTypes from 'prop-types';
4
4
  import { SessionContext } from '@arcblock/did-connect/lib/Session';
5
5
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
6
6
  import UxDashboard from '@arcblock/ux/lib/Layout/dashboard';
7
- import DidAddress from '@arcblock/did-connect/lib/Address';
8
- import DidAvatar from '@arcblock/did-connect/lib/Avatar';
9
7
  import { blockletMetaProps, sessionManagerProps } from '../types';
10
8
  import { mapRecursive, flatRecursive, matchPaths } from '../utils';
11
9
  import { publicPath, formatBlockletInfo, getLocalizedNavigation, filterNavByRole } from '../blocklets';
@@ -79,7 +77,7 @@ function Dashboard({ meta, fallbackUrl, invalidPathFallback, headerAddons, sessi
79
77
  if (!formattedBlocklet.appName) {
80
78
  return null;
81
79
  }
82
- const { appId: did, appLogo, appName } = formattedBlocklet;
80
+ const { appLogo, appName } = formattedBlocklet;
83
81
  const _headerAddons = (
84
82
  <HeaderAddons
85
83
  formattedBlocklet={formattedBlocklet}
@@ -97,24 +95,8 @@ function Dashboard({ meta, fallbackUrl, invalidPathFallback, headerAddons, sessi
97
95
  links={localizedNav}
98
96
  {...rest}
99
97
  headerProps={{
100
- brand: <a href={publicPath}>{appName}</a>,
101
- description: (
102
- <a href={publicPath}>
103
- <DidAddress
104
- compact
105
- responsive={false}
106
- copyable={false}
107
- showCopyButtonInTooltip
108
- prepend={<DidAvatar did={did} size={16} style={{ marginRight: 4 }} />}>
109
- {did}
110
- </DidAddress>
111
- </a>
112
- ),
113
- logo: (
114
- <a href={publicPath}>
115
- <img src={appLogo} alt="logo" />
116
- </a>
117
- ),
98
+ homeLink: publicPath,
99
+ logo: <img src={appLogo} alt="logo" />,
118
100
  addons: _headerAddons,
119
101
  ...rest.headerProps,
120
102
  }}
@@ -6,8 +6,6 @@ import { styled } from '@arcblock/ux/lib/Theme';
6
6
  import { ResponsiveHeader } from '@arcblock/ux/lib/Header';
7
7
  import NavMenu from '@arcblock/ux/lib/NavMenu';
8
8
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
9
- import DidAddress from '@arcblock/did-connect/lib/Address';
10
- import DidAvatar from '@arcblock/did-connect/lib/Avatar';
11
9
  import Icon from '../Icon';
12
10
  import OverridableThemeProvider from '../common/overridable-theme-provider';
13
11
 
@@ -75,7 +73,7 @@ function Header({ meta, addons, sessionManagerProps, homeLink, theme: themeOverr
75
73
  if (!formattedBlocklet.appName) {
76
74
  return null;
77
75
  }
78
- const { appId: did, appLogo, appName, theme } = formattedBlocklet;
76
+ const { appLogo, theme } = formattedBlocklet;
79
77
  const navigation = getLocalizedNavigation(formattedBlocklet?.navigation?.header, locale);
80
78
  const parsedNavigation = parseNavigation(navigation);
81
79
  const { navItems, activeId } = parsedNavigation;
@@ -89,26 +87,8 @@ function Header({ meta, addons, sessionManagerProps, homeLink, theme: themeOverr
89
87
  return (
90
88
  <OverridableThemeProvider theme={themeOverrides}>
91
89
  <StyledUxHeader
92
- logo={
93
- <a href={homeLink}>
94
- <img src={appLogo} alt="logo" />
95
- </a>
96
- }
97
- brand={<a href={homeLink}>{appName}</a>}
98
- description={
99
- did ? (
100
- <a href={homeLink}>
101
- <DidAddress
102
- compact
103
- responsive={false}
104
- copyable={false}
105
- showCopyButtonInTooltip
106
- prepend={<DidAvatar did={did} size={16} style={{ marginRight: 4 }} />}>
107
- {did}
108
- </DidAddress>
109
- </a>
110
- ) : null
111
- }
90
+ homeLink={homeLink}
91
+ logo={<img src={appLogo} alt="logo" />}
112
92
  addons={headerAddons}
113
93
  {...rest}
114
94
  $bgcolor={theme?.background?.header}>