xxf_react 0.6.8 → 0.6.9

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.
package/README.md CHANGED
@@ -36,3 +36,7 @@ This project was created using `bun init` in bun v1.3.2. [Bun](https://bun.com)
36
36
  ## 详细文档
37
37
 
38
38
  - [PlaybackQueue 播放队列状态管理](./src/media/playback-queue-store.md)
39
+
40
+ ## 第三方库推荐
41
+ 1. 做滑动分页等等
42
+ https://swiperjs.com/demos
@@ -142,6 +142,6 @@ export interface XHoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onMou
142
142
  * </XHover>
143
143
  * ```
144
144
  */
145
- export declare function XHover({ children, hoverDelay, onEnter, onHover, onLeave, hoverLayer, disabled, as: Component, style, ...rest }: XHoverProps): React.JSX.Element;
145
+ export declare const XHover: React.ForwardRefExoticComponent<XHoverProps & React.RefAttributes<HTMLElement>>;
146
146
  export default XHover;
147
147
  //# sourceMappingURL=XHover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XHover.d.ts","sourceRoot":"","sources":["../../../src/layout/hover/XHover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2C,SAAS,EAAE,cAAc,EAAC,MAAM,OAAO,CAAA;AAEhG;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,cAAc,CAAC;IACtG;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;IAEnB;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAEtC;;;;;;;;;;;;;;;;;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AA;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,eAAO,MAAM,MAAM,iFAyFjB,CAAA;AAEF,eAAe,MAAM,CAAA"}
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useRef, useEffect, useState } from 'react';
1
+ import React, { forwardRef, useCallback, useRef, useEffect, useState } from 'react';
2
2
  /**
3
3
  * 悬浮触发组件
4
4
  *
@@ -63,7 +63,7 @@ import React, { useCallback, useRef, useEffect, useState } from 'react';
63
63
  * </XHover>
64
64
  * ```
65
65
  */
66
- export function XHover({ children, hoverDelay = 0, onEnter, onHover, onLeave, hoverLayer, disabled = false, as: Component = 'div', style, ...rest }) {
66
+ export const XHover = forwardRef(function XHover({ children, hoverDelay = 0, onEnter, onHover, onLeave, hoverLayer, disabled = false, as: Component = 'div', style, ...rest }, ref) {
67
67
  const timerRef = useRef(null);
68
68
  const hasTriggeredRef = useRef(false);
69
69
  // 只有 hoverLayer 存在时才需要状态
@@ -121,8 +121,8 @@ export function XHover({ children, hoverDelay = 0, onEnter, onHover, onLeave, ho
121
121
  const containerStyle = hoverLayer
122
122
  ? { position: 'relative', ...style }
123
123
  : style;
124
- return (React.createElement(Component, { ...rest, style: containerStyle, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
124
+ return (React.createElement(Component, { ref: ref, ...rest, style: containerStyle, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
125
125
  children,
126
126
  hoverLayer && showLayer && hoverLayer()));
127
- }
127
+ });
128
128
  export default XHover;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xxf_react",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",