@lobehub/ui 1.153.16 → 1.153.17

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,8 +1,7 @@
1
- import { StyleProviderProps as AntdStyleProviderProps } from '@ant-design/cssinjs';
2
1
  import { ThemeProviderProps as AntdThemeProviderProps, CustomStylishParams, CustomTokenParams } from 'antd-style';
3
2
  import { CSSProperties } from 'react';
4
3
  import { NeutralColors, PrimaryColors } from "../styles";
5
- export interface ThemeProviderProps extends AntdThemeProviderProps<any>, Pick<AntdStyleProviderProps, 'cache' | 'ssrInline'> {
4
+ export interface ThemeProviderProps extends AntdThemeProviderProps<any> {
6
5
  className?: string;
7
6
  /**
8
7
  * @description Webfont loader css strings
@@ -2,11 +2,11 @@
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["children", "customStylish", "customToken", "enableCustomFonts", "enableGlobalStyle", "customFonts", "customTheme", "className", "style", "cache", "ssrInline", "theme"];
5
+ var _excluded = ["children", "customStylish", "customToken", "enableCustomFonts", "enableGlobalStyle", "customFonts", "customTheme", "className", "style", "theme"];
6
6
  import { App } from 'antd';
7
- import { ThemeProvider as AntdThemeProvider, StyleProvider } from 'antd-style';
7
+ import { ThemeProvider as AntdThemeProvider } from 'antd-style';
8
8
  import { merge } from 'lodash-es';
9
- import { memo, useCallback } from 'react';
9
+ import { memo, useCallback, useMemo } from 'react';
10
10
  import { useCdnFn } from "../ConfigProvider";
11
11
  import FontLoader from "../FontLoader";
12
12
  import { lobeCustomStylish, lobeCustomToken } from "../styles";
@@ -28,28 +28,24 @@ var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
28
28
  customTheme = _ref$customTheme === void 0 ? {} : _ref$customTheme,
29
29
  className = _ref.className,
30
30
  style = _ref.style,
31
- cache = _ref.cache,
32
- ssrInline = _ref.ssrInline,
33
31
  antdTheme = _ref.theme,
34
32
  rest = _objectWithoutProperties(_ref, _excluded);
35
33
  var genCdnUrl = useCdnFn();
36
- var webfontUrls = customFonts || [genCdnUrl({
37
- path: 'css/index.css',
38
- pkg: '@lobehub/webfont-mono',
39
- version: '1.0.0'
40
- }), genCdnUrl({
41
- path: 'css/index.css',
42
- pkg: '@lobehub/webfont-harmony-sans',
43
- version: '1.0.0'
44
- }), genCdnUrl({
45
- path: 'css/index.css',
46
- pkg: '@lobehub/webfont-harmony-sans-sc',
47
- version: '1.0.0'
48
- }), genCdnUrl({
49
- path: 'dist/katex.min.css',
50
- pkg: 'katex',
51
- version: '0.16.8'
52
- })];
34
+ var webfontUrls = useMemo(function () {
35
+ return customFonts || [genCdnUrl({
36
+ path: 'css/index.css',
37
+ pkg: '@lobehub/webfont-mono'
38
+ }), genCdnUrl({
39
+ path: 'css/index.css',
40
+ pkg: '@lobehub/webfont-harmony-sans'
41
+ }), genCdnUrl({
42
+ path: 'css/index.css',
43
+ pkg: '@lobehub/webfont-harmony-sans-sc'
44
+ }), genCdnUrl({
45
+ path: 'dist/katex.min.css',
46
+ pkg: 'katex'
47
+ })];
48
+ }, [customFonts, genCdnUrl]);
53
49
  var stylish = useCallback(function (theme) {
54
50
  return _objectSpread(_objectSpread({}, lobeCustomStylish(theme)), customStylish === null || customStylish === void 0 ? void 0 : customStylish(theme));
55
51
  }, [customStylish]);
@@ -69,26 +65,20 @@ var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
69
65
  return /*#__PURE__*/_jsx(FontLoader, {
70
66
  url: webfont
71
67
  }, webfont);
72
- }), /*#__PURE__*/_jsx(StyleProvider, {
73
- cache: cache,
74
- prefix: rest === null || rest === void 0 ? void 0 : rest.prefixCls,
75
- speedy: process.env.NODE_ENV === 'production',
76
- ssrInline: ssrInline,
77
- children: /*#__PURE__*/_jsxs(AntdThemeProvider, _objectSpread(_objectSpread({
78
- customStylish: stylish,
79
- customToken: token,
80
- theme: theme
81
- }, rest), {}, {
82
- children: [enableGlobalStyle && /*#__PURE__*/_jsx(GlobalStyle, {}), /*#__PURE__*/_jsx(App, {
83
- className: className,
84
- style: _objectSpread({
85
- minHeight: 'inherit',
86
- width: 'inherit'
87
- }, style),
88
- children: children
89
- })]
90
- }))
91
- })]
68
+ }), /*#__PURE__*/_jsxs(AntdThemeProvider, _objectSpread(_objectSpread({
69
+ customStylish: stylish,
70
+ customToken: token,
71
+ theme: theme
72
+ }, rest), {}, {
73
+ children: [enableGlobalStyle && /*#__PURE__*/_jsx(GlobalStyle, {}), /*#__PURE__*/_jsx(App, {
74
+ className: className,
75
+ style: _objectSpread({
76
+ minHeight: 'inherit',
77
+ width: 'inherit'
78
+ }, style),
79
+ children: children
80
+ })]
81
+ }))]
92
82
  });
93
83
  });
94
84
  ThemeProvider.displayName = 'LobeThemeProvider';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.153.16",
3
+ "version": "1.153.17",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",