@blocklet/ui-react 3.1.4 → 3.1.6

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.
@@ -1,6 +1,6 @@
1
1
  declare const _default: import('react').ComponentType<{
2
2
  [x: string]: any;
3
3
  meta?: {} | undefined;
4
- theme?: null | undefined;
4
+ theme?: {} | undefined;
5
5
  }>;
6
6
  export default _default;
@@ -9,11 +9,11 @@ import L from "@arcblock/ux/lib/hooks/use-blocklet-logo";
9
9
  import j from "lodash/omit";
10
10
  import C from "./internal-footer.js";
11
11
  import { mapRecursive as E } from "../utils.js";
12
- import { formatBlockletInfo as I, getLocalizedNavigation as a } from "../blocklets.js";
12
+ import { formatBlockletInfo as I, getLocalizedNavigation as l } from "../blocklets.js";
13
13
  import { BlockletMetaProps as P } from "../types.js";
14
14
  import z from "../libs/with-hide-when-embed.js";
15
- function d({ meta: o = {}, theme: t = null, ...n }) {
16
- const { locale: l } = N() || {}, c = x(), r = s(() => {
15
+ function d({ meta: o = {}, theme: t = {}, ...n }) {
16
+ const { locale: i } = N() || {}, c = x(), r = s(() => {
17
17
  const e = Object.assign({}, window.blocklet, o);
18
18
  try {
19
19
  return I(e);
@@ -28,18 +28,18 @@ function d({ meta: o = {}, theme: t = null, ...n }) {
28
28
  });
29
29
  if (!r.appName)
30
30
  return null;
31
- const { appName: b, appDescription: k, description: u, copyright: g } = r, h = m.palette.background.default, i = {
32
- footerNav: a(r?.navigation?.footer, l) || [],
33
- socialMedia: a(r?.navigation?.social, l) || [],
34
- links: a(r?.navigation?.bottom, l) || []
31
+ const { appName: b, appDescription: k, description: g, copyright: u } = r, h = m.palette.background.default, a = {
32
+ footerNav: l(r?.navigation?.footer, i) || [],
33
+ socialMedia: l(r?.navigation?.social, i) || [],
34
+ links: l(r?.navigation?.bottom, i) || []
35
35
  }, y = {
36
36
  brand: {
37
37
  name: b,
38
- description: k || u,
38
+ description: k || g,
39
39
  logo: f
40
40
  },
41
41
  navigation: E(
42
- i.footerNav,
42
+ a.footerNav,
43
43
  (e) => ({
44
44
  ...e,
45
45
  label: e.title,
@@ -47,9 +47,9 @@ function d({ meta: o = {}, theme: t = null, ...n }) {
47
47
  }),
48
48
  "items"
49
49
  ),
50
- copyright: g,
51
- socialMedia: i.socialMedia,
52
- links: i.links.map((e) => ({ ...e, label: e.title }))
50
+ copyright: u,
51
+ socialMedia: a.socialMedia,
52
+ links: a.links.map((e) => ({ ...e, label: e.title }))
53
53
  };
54
54
  return /* @__PURE__ */ p(B, { theme: m, children: /* @__PURE__ */ p(D, { ...y, ...j(n, ["bordered"]), $bordered: n?.bordered, $bgcolor: h }) });
55
55
  }
@@ -59,7 +59,7 @@ function Y({
59
59
  showRole: !0
60
60
  },
61
61
  homeLink: c = q,
62
- theme: l = void 0,
62
+ theme: l = {},
63
63
  hideNavMenu: p = !1,
64
64
  showDomainWarningDialog: e = !0,
65
65
  ...i
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -35,9 +35,9 @@
35
35
  "dependencies": {
36
36
  "@abtnode/constant": "^1.16.47",
37
37
  "@abtnode/util": "^1.16.47",
38
- "@arcblock/bridge": "3.1.4",
39
- "@arcblock/icons": "3.1.4",
40
- "@arcblock/react-hooks": "3.1.4",
38
+ "@arcblock/bridge": "3.1.6",
39
+ "@arcblock/icons": "3.1.6",
40
+ "@arcblock/react-hooks": "3.1.6",
41
41
  "@arcblock/ws": "^1.21.2",
42
42
  "@blocklet/constant": "^1.16.47",
43
43
  "@blocklet/did-space-react": "^1.1.14",
@@ -84,7 +84,7 @@
84
84
  "access": "public"
85
85
  },
86
86
  "devDependencies": {
87
- "@arcblock/did-connect-react": "3.1.4",
87
+ "@arcblock/did-connect-react": "3.1.6",
88
88
  "@types/dompurify": "^3.2.0",
89
89
  "@types/ua-parser-js": "^0.7.39",
90
90
  "@types/validator": "^13.15.2",
@@ -92,5 +92,5 @@
92
92
  "jest": "^29.7.0",
93
93
  "unbuild": "^2.0.0"
94
94
  },
95
- "gitHead": "fdcb00a80f946b112c9e1301a206d0593b149505"
95
+ "gitHead": "d3267421c4d35038b226d34edc0e7bc943c5c926"
96
96
  }
@@ -16,7 +16,7 @@ import withHideWhenEmbed from '../libs/with-hide-when-embed';
16
16
  /**
17
17
  * 专门用于 (composable) blocklet 的 Footer 组件, 基于 blocklet meta 中的数据渲染
18
18
  */
19
- function Footer({ meta = {}, theme: themeOverrides = null, ...rest }) {
19
+ function Footer({ meta = {}, theme: themeOverrides = {}, ...rest }) {
20
20
  const { locale } = useLocaleContext() || {};
21
21
  const parentTheme = useTheme();
22
22
  const formattedBlocklet = useMemo(() => {
@@ -10,7 +10,7 @@ import { translate } from '@arcblock/ux/lib/Locale/util';
10
10
  import useBlockletLogo from '@arcblock/ux/lib/hooks/use-blocklet-logo';
11
11
  import omit from 'lodash/omit';
12
12
  import isFinite from 'lodash/isFinite';
13
- import type { BoxProps, Breakpoint } from '@mui/material';
13
+ import type { BoxProps, Breakpoint, Theme } from '@mui/material';
14
14
  import clsx from 'clsx';
15
15
 
16
16
  import Icon from '../Icon';
@@ -107,7 +107,7 @@ function Header({
107
107
  showRole: true,
108
108
  },
109
109
  homeLink = publicPath,
110
- theme: themeOverrides = undefined,
110
+ theme: themeOverrides = {},
111
111
  hideNavMenu = false,
112
112
  showDomainWarningDialog = true,
113
113
  ...rest
@@ -127,7 +127,7 @@ function Header({
127
127
  return blocklet;
128
128
  }
129
129
  }, [meta]);
130
- const mergeTheme = useMemo(() => deepmerge(parentTheme, themeOverrides), [parentTheme, themeOverrides]);
130
+ const mergeTheme = useMemo(() => deepmerge(parentTheme, themeOverrides), [parentTheme, themeOverrides]) as Theme;
131
131
  const appLogo = useBlockletLogo({
132
132
  meta,
133
133
  theme: themeOverrides,