@tremolo-ui/react 0.1.1 → 0.1.2
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/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/hooks/useAnimationFrame.d.ts +1 -1
- package/dist/cjs/types/hooks/useAnimationFrame.d.ts.map +1 -1
- package/dist/cjs/types/hooks/useDrag.d.ts +2 -3
- package/dist/cjs/types/hooks/useDrag.d.ts.map +1 -1
- package/dist/cjs/types/hooks/useDragWithElement.d.ts +2 -3
- package/dist/cjs/types/hooks/useDragWithElement.d.ts.map +1 -1
- package/dist/cjs/types/index.d.ts +15 -15
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/hooks/useAnimationFrame.d.ts +1 -1
- package/dist/esm/types/hooks/useAnimationFrame.d.ts.map +1 -1
- package/dist/esm/types/hooks/useDrag.d.ts +2 -3
- package/dist/esm/types/hooks/useDrag.d.ts.map +1 -1
- package/dist/esm/types/hooks/useDragWithElement.d.ts +2 -3
- package/dist/esm/types/hooks/useDragWithElement.d.ts.map +1 -1
- package/dist/esm/types/index.d.ts +15 -15
- package/dist/esm/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useAnimationFrame.ts +2 -2
- package/src/hooks/useDrag.ts +2 -2
- package/src/hooks/useDragWithElement.ts +2 -2
- package/src/index.ts +79 -15
package/dist/cjs/index.js
CHANGED
|
@@ -1995,7 +1995,7 @@ const XYPad = React.forwardRef((_a, ref) => {
|
|
|
1995
1995
|
} }, thumbProps)) }, areaProps)) }) })));
|
|
1996
1996
|
});
|
|
1997
1997
|
|
|
1998
|
-
|
|
1998
|
+
function useAnimationFrame(callback = () => { }, deps = []) {
|
|
1999
1999
|
const reqIdRef = React.useRef(-1);
|
|
2000
2000
|
const loop = React.useCallback(() => {
|
|
2001
2001
|
reqIdRef.current = requestAnimationFrame(loop);
|
|
@@ -2006,7 +2006,7 @@ const useAnimationFrame = (callback = () => { }, deps = []) => {
|
|
|
2006
2006
|
reqIdRef.current = requestAnimationFrame(loop);
|
|
2007
2007
|
return () => cancelAnimationFrame(reqIdRef.current);
|
|
2008
2008
|
}, [loop]);
|
|
2009
|
-
}
|
|
2009
|
+
}
|
|
2010
2010
|
|
|
2011
2011
|
exports.AnimationCanvas = AnimationCanvas;
|
|
2012
2012
|
exports.AnimationKnob = AnimationKnob;
|