@blocklet/ui-react 2.4.12 → 2.4.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.
@@ -11,6 +11,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _Theme = require("@arcblock/ux/lib/Theme");
13
13
 
14
+ var _Box = _interopRequireDefault(require("@mui/material/Box"));
15
+
14
16
  var _reactErrorBoundary = require("react-error-boundary");
15
17
 
16
18
  var _context = require("@arcblock/ux/lib/Locale/context");
@@ -51,7 +53,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
51
53
  * 专门用于 (composable) blocklet 的 Footer 组件, 基于 blocklet meta 中的数据渲染
52
54
  */
53
55
  function Footer(_ref) {
54
- var _formattedBlocklet$na, _formattedBlocklet$na2, _formattedBlocklet$na3, _theme$background;
56
+ var _formattedBlocklet$na, _formattedBlocklet$na2, _formattedBlocklet$na3, _theme$background, _window, _window$blocklet;
55
57
 
56
58
  let {
57
59
  meta,
@@ -105,11 +107,23 @@ function Footer(_ref) {
105
107
  label: item.title
106
108
  }))
107
109
  };
108
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_overridableThemeProvider.default, {
110
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_overridableThemeProvider.default, {
109
111
  theme: themeOverrides,
110
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInternalFooter, _objectSpread(_objectSpread(_objectSpread({}, props), rest), {}, {
112
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInternalFooter, _objectSpread(_objectSpread(_objectSpread({}, props), rest), {}, {
111
113
  $bgcolor: theme === null || theme === void 0 ? void 0 : (_theme$background = theme.background) === null || _theme$background === void 0 ? void 0 : _theme$background.footer
112
- }))
114
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
115
+ position: "absolute",
116
+ right: 0,
117
+ bottom: 0,
118
+ sx: {
119
+ color: 'transparent',
120
+ '::selection': {
121
+ background: '#000',
122
+ color: '#fff'
123
+ }
124
+ },
125
+ children: (_window = window) === null || _window === void 0 ? void 0 : (_window$blocklet = _window.blocklet) === null || _window$blocklet === void 0 ? void 0 : _window$blocklet.version
126
+ })]
113
127
  });
114
128
  }
115
129
 
@@ -122,7 +136,7 @@ Footer.defaultProps = {
122
136
  meta: {},
123
137
  theme: null
124
138
  };
125
- const StyledInternalFooter = (0, _Theme.styled)(_internalFooter.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-top: 1px solid #eee;\n color: ", ";\n ", "\n font-family: Lato, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n"])), props => props.theme.palette.grey[600], _ref2 => {
139
+ const StyledInternalFooter = (0, _Theme.styled)(_internalFooter.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n border-top: 1px solid #eee;\n color: ", ";\n ", "\n font-family: Lato, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n"])), props => props.theme.palette.grey[600], _ref2 => {
126
140
  let {
127
141
  $bgcolor
128
142
  } = _ref2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.4.12",
3
+ "version": "2.4.15",
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.12",
34
- "@arcblock/ux": "^2.4.12",
33
+ "@arcblock/did-connect": "^2.4.15",
34
+ "@arcblock/ux": "^2.4.15",
35
35
  "@emotion/react": "^11.10.0",
36
36
  "@emotion/styled": "^11.10.0",
37
37
  "@iconify/iconify": "^2.2.1",
@@ -53,5 +53,5 @@
53
53
  "eslint-plugin-react-hooks": "^4.6.0",
54
54
  "jest": "^24.9.0"
55
55
  },
56
- "gitHead": "67b9da0555a2ee6ddd151b2e0dd1e7bdae6108ef"
56
+ "gitHead": "c07a38a4575a4f41e116743b2450e468c19d55f3"
57
57
  }
@@ -1,6 +1,7 @@
1
1
  import { useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { styled } from '@arcblock/ux/lib/Theme';
4
+ import Box from '@mui/material/Box';
4
5
  import { withErrorBoundary } from 'react-error-boundary';
5
6
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
6
7
  import { ErrorFallback } from '@arcblock/ux/lib/ErrorBoundary';
@@ -61,6 +62,13 @@ function Footer({ meta, theme: themeOverrides, ...rest }) {
61
62
  return (
62
63
  <OverridableThemeProvider theme={themeOverrides}>
63
64
  <StyledInternalFooter {...props} {...rest} $bgcolor={theme?.background?.footer} />
65
+ <Box
66
+ position="absolute"
67
+ right={0}
68
+ bottom={0}
69
+ sx={{ color: 'transparent', '::selection': { background: '#000', color: '#fff' } }}>
70
+ {window?.blocklet?.version}
71
+ </Box>
64
72
  </OverridableThemeProvider>
65
73
  );
66
74
  }
@@ -77,6 +85,7 @@ Footer.defaultProps = {
77
85
  };
78
86
 
79
87
  const StyledInternalFooter = styled(InternalFooter)`
88
+ position: relative;
80
89
  border-top: 1px solid #eee;
81
90
  color: ${(props) => props.theme.palette.grey[600]};
82
91
  ${({ $bgcolor }) => $bgcolor && `background-color: ${$bgcolor};`}