@easyv/react-components 0.0.33 → 0.0.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.
@@ -15,7 +15,7 @@ export function useTheme() {
15
15
  setTheme(getTheme());
16
16
  }, []);
17
17
  useEffect(function () {
18
- var observer = new MutationObserver(function (mutationsList, observer) {
18
+ var observer = new MutationObserver(function (mutationsList) {
19
19
  mutationsList.forEach(function (mutation) {
20
20
  if (mutation.type === 'attributes' && mutation.attributeName === 'arco-theme') {
21
21
  // 处理属性变化的逻辑
@@ -1 +1 @@
1
- export declare function getTheme(): any;
1
+ export declare function getTheme(): 'light' | 'dark';
package/dist/util/util.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export function getTheme() {
2
- return typeof document !== 'undefined' ? document.body.attributes['arco-theme'] || 'light' : 'light';
2
+ var _document$body$attrib;
3
+ var theme = typeof document !== 'undefined' ? ((_document$body$attrib = document.body.attributes['arco-theme']) === null || _document$body$attrib === void 0 ? void 0 : _document$body$attrib.value) || 'light' : 'light';
4
+ return ['light', 'dark'].includes(theme) ? theme : 'light';
3
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/react-components",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "description": "a react component library base on arco design",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import type { MenuProps } from './interface';
3
- import './index.less';
4
- declare const XMenu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<unknown>> & {
5
- Item: import("react").ForwardRefExoticComponent<import("@arco-design/web-react").MenuItemProps & import("react").RefAttributes<unknown>> & {
6
- menuType: string;
7
- };
8
- ItemGroup: import("react").ForwardRefExoticComponent<import("@arco-design/web-react").MenuItemGroupProps & import("react").RefAttributes<unknown>> & {
9
- menuType: string;
10
- };
11
- SubMenu: import("react").ForwardRefExoticComponent<import("@arco-design/web-react").MenuSubMenuProps & import("react").RefAttributes<unknown>> & {
12
- menuType: string;
13
- };
14
- __ARCO_MENU__: boolean;
15
- };
16
- export default XMenu;
17
- export { MenuProps };
@@ -1,3 +0,0 @@
1
- export * from './useClickOutside';
2
- export * from './useEventListener';
3
- export * from './useTheme';