@blocklet/ui-react 2.1.33 → 2.1.34

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.
@@ -182,7 +182,7 @@ function Header(_ref) {
182
182
  theme: muiTheme,
183
183
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledUxHeader, _objectSpread(_objectSpread({
184
184
  logo: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
185
- href: "/",
185
+ href: _utils.publicPath,
186
186
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
187
187
  src: appLogo,
188
188
  alt: "logo"
package/lib/utils.js CHANGED
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.matchPaths = exports.matchPath = exports.mapRecursive = exports.isUrl = exports.flatRecursive = void 0;
6
+ exports.publicPath = exports.matchPaths = exports.matchPath = exports.mapRecursive = exports.isUrl = exports.flatRecursive = void 0;
7
+
8
+ var _window, _window$blocklet;
7
9
 
8
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
11
 
@@ -83,4 +85,6 @@ const matchPaths = function matchPaths() {
83
85
  return mostSpecific.index;
84
86
  };
85
87
 
86
- exports.matchPaths = matchPaths;
88
+ exports.matchPaths = matchPaths;
89
+ const publicPath = ((_window = window) === null || _window === void 0 ? void 0 : (_window$blocklet = _window.blocklet) === null || _window$blocklet === void 0 ? void 0 : _window$blocklet.prefix) || '/';
90
+ exports.publicPath = publicPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.1.33",
3
+ "version": "2.1.34",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -34,8 +34,8 @@
34
34
  "url": "https://github.com/ArcBlock/ux/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@arcblock/did-connect": "^2.1.33",
38
- "@arcblock/ux": "^2.1.33",
37
+ "@arcblock/did-connect": "^2.1.34",
38
+ "@arcblock/ux": "^2.1.34",
39
39
  "@iconify/iconify": "^2.2.1",
40
40
  "@mui/material": "^5.6.4",
41
41
  "core-js": "^3.6.4",
@@ -57,5 +57,5 @@
57
57
  "eslint-plugin-react-hooks": "^4.2.0",
58
58
  "jest": "^24.1.0"
59
59
  },
60
- "gitHead": "616c11e20c48d33f153258bcf00eba030dabf648"
60
+ "gitHead": "cf0c00b60dfa2819e06e0e063614b99eeb392c79"
61
61
  }
@@ -14,7 +14,7 @@ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
14
14
  import '@iconify/iconify';
15
15
 
16
16
  import { blockletMetaProps, sessionManagerProps } from '../types';
17
- import { mapRecursive, flatRecursive, matchPaths } from '../utils';
17
+ import { mapRecursive, flatRecursive, matchPaths, publicPath } from '../utils';
18
18
 
19
19
  const muiTheme = create();
20
20
 
@@ -99,7 +99,7 @@ function Header({ meta, addons, sessionManagerProps, ...rest }) {
99
99
  <ThemeProvider theme={muiTheme}>
100
100
  <StyledUxHeader
101
101
  logo={
102
- <a href="/">
102
+ <a href={publicPath}>
103
103
  <img src={appLogo} alt="logo" />
104
104
  </a>
105
105
  }
package/src/utils.js CHANGED
@@ -49,3 +49,5 @@ export const matchPaths = (paths = []) => {
49
49
  }, matched[0]);
50
50
  return mostSpecific.index;
51
51
  };
52
+
53
+ export const publicPath = window?.blocklet?.prefix || '/';