@blocklet/ui-react 2.1.11 → 2.1.15

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.
@@ -64,4 +64,4 @@ Brand.defaultProps = {
64
64
  const Root = _styledComponents.default.div.withConfig({
65
65
  displayName: "brand__Root",
66
66
  componentId: "sc-6z2c3k-0"
67
- })(["display:flex;flex-direction:column;width:240px;font-size:14px;a{text-decoration:none;color:inherit;}> div:first-child{display:flex;align-items:center;}.footer-brand-logo{height:32px;margin-right:8px;img,svg{max-width:100%;max-height:100%;}}.footer-brand-name{font-size:16px;font-weight:bold;}.footer-brand-desc{margin-top:16px;}", "{width:auto;}"], props => props.$theme.breakpoints.down('sm'));
67
+ })(["display:flex;flex-direction:column;width:240px;font-size:14px;a{text-decoration:none;color:inherit;}> div:first-child{display:flex;align-items:center;}.footer-brand-logo{display:flex;align-items:center;margin-right:16px;line-height:1;img,svg{max-height:44px;min-height:32px;}}.footer-brand-name{font-size:16px;font-weight:bold;}.footer-brand-desc{margin-top:16px;}", "{width:auto;}"], props => props.$theme.breakpoints.down('sm'));
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = Footer;
6
+ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -15,6 +15,10 @@ var _Box = _interopRequireDefault(require("@mui/material/Box"));
15
15
 
16
16
  var _Container = _interopRequireDefault(require("@mui/material/Container"));
17
17
 
18
+ var _reactErrorBoundary = require("react-error-boundary");
19
+
20
+ var _ErrorBoundary = require("@arcblock/ux/lib/ErrorBoundary");
21
+
18
22
  var _brand = _interopRequireDefault(require("./brand"));
19
23
 
20
24
  var _links = _interopRequireDefault(require("./links"));
@@ -62,6 +66,8 @@ function Footer(_ref) {
62
66
  const {
63
67
  appLogo,
64
68
  appName,
69
+ appDescription,
70
+ description,
65
71
  theme: blockletTheme,
66
72
  navigation = [],
67
73
  copyrightOwner,
@@ -80,7 +86,7 @@ function Footer(_ref) {
80
86
  }), /*#__PURE__*/_react.default.createElement(_Container.default, null, /*#__PURE__*/_react.default.createElement(_row.default, null, /*#__PURE__*/_react.default.createElement(_Box.default, null, /*#__PURE__*/_react.default.createElement(_brand.default, {
81
87
  name: appName,
82
88
  logo: appLogo,
83
- description: "Official DID Wallet webapp implementation that makes it possible to manage your digital identities and assets from the browser."
89
+ description: appDescription || description
84
90
  }), /*#__PURE__*/_react.default.createElement(_socialMedia.default, {
85
91
  items: socialMedia,
86
92
  style: {
@@ -119,4 +125,10 @@ const Root = _styledComponents.default.div.withConfig({
119
125
  $bgcolor
120
126
  } = _ref2;
121
127
  return $bgcolor && "background-color: ".concat($bgcolor, ";");
122
- });
128
+ });
129
+
130
+ var _default = (0, _reactErrorBoundary.withErrorBoundary)(Footer, {
131
+ FallbackComponent: _ErrorBoundary.ErrorFallback
132
+ });
133
+
134
+ exports.default = _default;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = Header;
6
+ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -13,6 +13,10 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
14
  var _styles = require("@mui/material/styles");
15
15
 
16
+ var _reactErrorBoundary = require("react-error-boundary");
17
+
18
+ var _ErrorBoundary = require("@arcblock/ux/lib/ErrorBoundary");
19
+
16
20
  var _Theme = require("@arcblock/ux/lib/Theme");
17
21
 
18
22
  var _Header = require("@arcblock/ux/lib/Header");
@@ -205,4 +209,10 @@ const StyledUxHeader = (0, _styledComponents.default)(_Header.ResponsiveHeader).
205
209
  $bgcolor
206
210
  } = _ref3;
207
211
  return "background-color: ".concat($bgcolor || '#fff', ";");
208
- });
212
+ });
213
+
214
+ var _default = (0, _reactErrorBoundary.withErrorBoundary)(Header, {
215
+ FallbackComponent: _ErrorBoundary.ErrorFallback
216
+ });
217
+
218
+ exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.1.11",
3
+ "version": "2.1.15",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -34,11 +34,12 @@
34
34
  "url": "https://github.com/ArcBlock/ux/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@arcblock/did-connect": "^2.1.11",
38
- "@arcblock/ux": "^2.1.11",
37
+ "@arcblock/did-connect": "^2.1.15",
38
+ "@arcblock/ux": "^2.1.15",
39
39
  "@iconify/iconify": "^2.2.1",
40
40
  "@mui/material": "^5.6.4",
41
41
  "core-js": "^3.6.4",
42
+ "react-error-boundary": "^3.1.4",
42
43
  "styled-components": "^5.0.0"
43
44
  },
44
45
  "peerDependencies": {
@@ -56,5 +57,5 @@
56
57
  "eslint-plugin-react-hooks": "^4.2.0",
57
58
  "jest": "^24.1.0"
58
59
  },
59
- "gitHead": "ce03cc62eb231442c6c2e29d262ea073925a8cb2"
60
+ "gitHead": "7cf6582840eac13158ecc4e25ec6ec13cdb97799"
60
61
  }
@@ -48,12 +48,14 @@ const Root = styled.div`
48
48
  align-items: center;
49
49
  }
50
50
  .footer-brand-logo {
51
- height: 32px;
52
- margin-right: 8px;
51
+ display: flex;
52
+ align-items: center;
53
+ margin-right: 16px;
54
+ line-height: 1;
53
55
  img,
54
56
  svg {
55
- max-width: 100%;
56
- max-height: 100%;
57
+ max-height: 44px;
58
+ min-height: 32px;
57
59
  }
58
60
  }
59
61
  .footer-brand-name {
@@ -3,6 +3,8 @@ import styled from 'styled-components';
3
3
  import useTheme from '@mui/styles/useTheme';
4
4
  import Box from '@mui/material/Box';
5
5
  import Container from '@mui/material/Container';
6
+ import { withErrorBoundary } from 'react-error-boundary';
7
+ import { ErrorFallback } from '@arcblock/ux/lib/ErrorBoundary';
6
8
  import Brand from './brand';
7
9
  import Links from './links';
8
10
  import SocialMedia from './social-media';
@@ -15,7 +17,7 @@ import { blockletMetaProps } from '../types';
15
17
  /**
16
18
  * 专门用于 (composable) blocklet 的 Footer 组件, 基于 blocklet meta 中的数据渲染
17
19
  */
18
- export default function Footer({ meta, ...rest }) {
20
+ function Footer({ meta, ...rest }) {
19
21
  const theme = useTheme();
20
22
  const blocklet = Object.assign({}, window.blocklet, meta);
21
23
  if (!blocklet.appName) {
@@ -25,6 +27,8 @@ export default function Footer({ meta, ...rest }) {
25
27
  const {
26
28
  appLogo,
27
29
  appName,
30
+ appDescription,
31
+ description,
28
32
  theme: blockletTheme,
29
33
  navigation = [],
30
34
  copyrightOwner,
@@ -48,11 +52,7 @@ export default function Footer({ meta, ...rest }) {
48
52
  <Container>
49
53
  <Row>
50
54
  <Box>
51
- <Brand
52
- name={appName}
53
- logo={appLogo}
54
- description="Official DID Wallet webapp implementation that makes it possible to manage your digital identities and assets from the browser."
55
- />
55
+ <Brand name={appName} logo={appLogo} description={appDescription || description} />
56
56
  <SocialMedia items={socialMedia} style={{ marginTop: 24 }} />
57
57
  </Box>
58
58
  <Links links={navMenuItems} />
@@ -80,3 +80,7 @@ const Root = styled.div`
80
80
  color: ${props => props.$theme.palette.grey[600]};
81
81
  ${({ $bgcolor }) => $bgcolor && `background-color: ${$bgcolor};`}
82
82
  `;
83
+
84
+ export default withErrorBoundary(Footer, {
85
+ FallbackComponent: ErrorFallback,
86
+ });
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
  import { ThemeProvider } from '@mui/material/styles';
5
+ import { withErrorBoundary } from 'react-error-boundary';
6
+ import { ErrorFallback } from '@arcblock/ux/lib/ErrorBoundary';
5
7
  import { create } from '@arcblock/ux/lib/Theme';
6
8
  import { ResponsiveHeader } from '@arcblock/ux/lib/Header';
7
9
  import NavMenu from '@arcblock/ux/lib/NavMenu';
@@ -58,7 +60,7 @@ const parseNavigation = navigation => {
58
60
  * 专门用于 (composable) blocklet 的 Header 组件, 解析 blocklet meta 中的数据, 通过组合 UX 中的 Header & NavMenu 组件来渲染
59
61
  */
60
62
  // eslint-disable-next-line no-shadow
61
- export default function Header({ meta, addons, sessionManagerProps, ...rest }) {
63
+ function Header({ meta, addons, sessionManagerProps, ...rest }) {
62
64
  const sessionInfo = React.useContext(SessionContext);
63
65
  const { locale } = useLocaleContext() || {};
64
66
  const blocklet = Object.assign({}, window.blocklet, meta);
@@ -157,3 +159,7 @@ const StyledUxHeader = styled(ResponsiveHeader)`
157
159
  }
158
160
  }
159
161
  `;
162
+
163
+ export default withErrorBoundary(Header, {
164
+ FallbackComponent: ErrorFallback,
165
+ });