@blocklet/ui-react 2.4.39 → 2.4.41
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.
- package/lib/Dashboard/index.js +0 -20
- package/lib/Header/index.js +0 -21
- package/package.json +4 -4
- package/src/Dashboard/index.js +1 -14
- package/src/Header/index.js +1 -16
package/lib/Dashboard/index.js
CHANGED
|
@@ -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;
|
|
@@ -158,21 +153,6 @@ function Dashboard(_ref) {
|
|
|
158
153
|
}, rest), {}, {
|
|
159
154
|
headerProps: _objectSpread({
|
|
160
155
|
homeLink: _blocklets.publicPath,
|
|
161
|
-
brand: appName,
|
|
162
|
-
description: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Address.default, {
|
|
163
|
-
compact: true,
|
|
164
|
-
responsive: false,
|
|
165
|
-
copyable: false,
|
|
166
|
-
showCopyButtonInTooltip: true,
|
|
167
|
-
prepend: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
168
|
-
did: did,
|
|
169
|
-
size: 16,
|
|
170
|
-
style: {
|
|
171
|
-
marginRight: 4
|
|
172
|
-
}
|
|
173
|
-
}),
|
|
174
|
-
children: did
|
|
175
|
-
}),
|
|
176
156
|
logo: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
177
157
|
src: appLogo,
|
|
178
158
|
alt: "logo"
|
package/lib/Header/index.js
CHANGED
|
@@ -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);
|
|
@@ -179,21 +173,6 @@ function Header(_ref) {
|
|
|
179
173
|
src: appLogo,
|
|
180
174
|
alt: "logo"
|
|
181
175
|
}),
|
|
182
|
-
brand: appName,
|
|
183
|
-
description: did ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Address.default, {
|
|
184
|
-
compact: true,
|
|
185
|
-
responsive: false,
|
|
186
|
-
copyable: false,
|
|
187
|
-
showCopyButtonInTooltip: true,
|
|
188
|
-
prepend: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
189
|
-
did: did,
|
|
190
|
-
size: 16,
|
|
191
|
-
style: {
|
|
192
|
-
marginRight: 4
|
|
193
|
-
}
|
|
194
|
-
}),
|
|
195
|
-
children: did
|
|
196
|
-
}) : null,
|
|
197
176
|
addons: headerAddons
|
|
198
177
|
}, rest), {}, {
|
|
199
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.
|
|
3
|
+
"version": "2.4.41",
|
|
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.
|
|
34
|
-
"@arcblock/ux": "^2.4.
|
|
33
|
+
"@arcblock/did-connect": "^2.4.41",
|
|
34
|
+
"@arcblock/ux": "^2.4.41",
|
|
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": "
|
|
56
|
+
"gitHead": "87dcf0b0f05b1bc45038095f34cd236c739c6180"
|
|
57
57
|
}
|
package/src/Dashboard/index.js
CHANGED
|
@@ -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 {
|
|
80
|
+
const { appLogo, appName } = formattedBlocklet;
|
|
83
81
|
const _headerAddons = (
|
|
84
82
|
<HeaderAddons
|
|
85
83
|
formattedBlocklet={formattedBlocklet}
|
|
@@ -98,17 +96,6 @@ function Dashboard({ meta, fallbackUrl, invalidPathFallback, headerAddons, sessi
|
|
|
98
96
|
{...rest}
|
|
99
97
|
headerProps={{
|
|
100
98
|
homeLink: publicPath,
|
|
101
|
-
brand: appName,
|
|
102
|
-
description: (
|
|
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
|
-
),
|
|
112
99
|
logo: <img src={appLogo} alt="logo" />,
|
|
113
100
|
addons: _headerAddons,
|
|
114
101
|
...rest.headerProps,
|
package/src/Header/index.js
CHANGED
|
@@ -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 {
|
|
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;
|
|
@@ -91,19 +89,6 @@ function Header({ meta, addons, sessionManagerProps, homeLink, theme: themeOverr
|
|
|
91
89
|
<StyledUxHeader
|
|
92
90
|
homeLink={homeLink}
|
|
93
91
|
logo={<img src={appLogo} alt="logo" />}
|
|
94
|
-
brand={appName}
|
|
95
|
-
description={
|
|
96
|
-
did ? (
|
|
97
|
-
<DidAddress
|
|
98
|
-
compact
|
|
99
|
-
responsive={false}
|
|
100
|
-
copyable={false}
|
|
101
|
-
showCopyButtonInTooltip
|
|
102
|
-
prepend={<DidAvatar did={did} size={16} style={{ marginRight: 4 }} />}>
|
|
103
|
-
{did}
|
|
104
|
-
</DidAddress>
|
|
105
|
-
) : null
|
|
106
|
-
}
|
|
107
92
|
addons={headerAddons}
|
|
108
93
|
{...rest}
|
|
109
94
|
$bgcolor={theme?.background?.header}>
|