react-ui-animate 2.0.0 → 3.0.0-rc.1
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/LICENSE +21 -21
- package/README.md +115 -115
- package/dist/animation/core/controllers/Animation.d.ts +16 -0
- package/dist/animation/core/controllers/FluidValue.d.ts +32 -0
- package/dist/animation/core/controllers/RequestAnimationFrame.d.ts +8 -0
- package/dist/animation/core/controllers/SpringAnimation.d.ts +41 -0
- package/dist/animation/core/controllers/TimingAnimation.d.ts +35 -0
- package/dist/animation/core/easing/Bezier.d.ts +8 -0
- package/dist/animation/core/easing/Easing.d.ts +40 -0
- package/dist/animation/core/helpers/camelCaseToKebabCase.d.ts +8 -0
- package/dist/animation/core/helpers/getCleanProps.d.ts +10 -0
- package/dist/animation/core/helpers/getCssValue.d.ts +8 -0
- package/dist/animation/core/helpers/index.d.ts +5 -0
- package/dist/animation/core/helpers/isDefined.d.ts +12 -0
- package/dist/animation/core/helpers/isFluidValue.d.ts +6 -0
- package/dist/animation/core/index.d.ts +11 -0
- package/dist/animation/core/interpolation/Colors.d.ts +25 -0
- package/dist/animation/core/interpolation/Interpolation.d.ts +80 -0
- package/dist/animation/core/interpolation/__tests__/Colors.test.d.ts +1 -0
- package/dist/animation/core/react/fluid.d.ts +6 -0
- package/dist/animation/core/react/makeFluid.d.ts +30 -0
- package/dist/animation/core/react/transforms.d.ts +6 -0
- package/dist/animation/core/react/useFluidValue.d.ts +9 -0
- package/dist/animation/core/react/useMount.d.ts +20 -0
- package/dist/animation/lib/animationType.d.ts +15 -0
- package/dist/animation/lib/getInitialConfig.d.ts +3 -0
- package/dist/animation/lib/index.d.ts +5 -0
- package/dist/animation/{interpolation.d.ts → lib/interpolation.d.ts} +20 -21
- package/dist/animation/lib/modules/AnimatedBlock.d.ts +8 -0
- package/dist/animation/lib/modules/AnimatedImage.d.ts +8 -0
- package/dist/animation/lib/modules/AnimatedInline.d.ts +8 -0
- package/dist/animation/lib/modules/MountedBlock.d.ts +29 -0
- package/dist/animation/{modules → lib/modules}/ScrollableBlock.d.ts +22 -21
- package/dist/animation/{modules → lib/modules}/TransitionBlock.d.ts +18 -17
- package/dist/animation/{modules → lib/modules}/index.d.ts +6 -6
- package/dist/animation/{useAnimatedValue.d.ts → lib/useAnimatedValue.d.ts} +17 -22
- package/dist/animation/{useMountedValue.d.ts → lib/useMountedValue.d.ts} +14 -15
- package/dist/gestures/controllers/DragGesture.d.ts +17 -17
- package/dist/gestures/controllers/Gesture.d.ts +20 -20
- package/dist/gestures/controllers/MouseMoveGesture.d.ts +13 -13
- package/dist/gestures/controllers/ScrollGesture.d.ts +14 -14
- package/dist/gestures/controllers/WheelGesture.d.ts +15 -15
- package/dist/gestures/controllers/index.d.ts +4 -4
- package/dist/gestures/helpers/eventAttacher.d.ts +11 -0
- package/dist/gestures/helpers/index.d.ts +1 -0
- package/dist/gestures/{math.d.ts → helpers/math.d.ts} +34 -34
- package/dist/gestures/{withDefault.d.ts → helpers/withDefault.d.ts} +4 -4
- package/dist/gestures/hooks/index.d.ts +5 -5
- package/dist/gestures/hooks/useDrag.d.ts +4 -4
- package/dist/gestures/hooks/useGesture.d.ts +9 -9
- package/dist/gestures/hooks/useMouseMove.d.ts +4 -4
- package/dist/gestures/hooks/useRecognizer.d.ts +10 -10
- package/dist/gestures/hooks/useScroll.d.ts +4 -4
- package/dist/gestures/hooks/useWheel.d.ts +4 -4
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/useMeasure.d.ts +14 -14
- package/dist/hooks/useOutsideClick.d.ts +2 -2
- package/dist/hooks/useWindowDimension.d.ts +9 -9
- package/dist/index.d.ts +9 -5
- package/dist/index.js +1 -1191
- package/dist/index.js.map +1 -1
- package/dist/utils/delay.d.ts +5 -5
- package/dist/utils/index.d.ts +1 -2
- package/package.json +49 -48
- package/.vscode/settings.json +0 -3
- package/dist/animation/animationType.d.ts +0 -15
- package/dist/animation/getInitialConfig.d.ts +0 -3
- package/dist/animation/index.d.ts +0 -6
- package/dist/animation/modules/AnimatedBlock.d.ts +0 -8
- package/dist/animation/modules/AnimatedImage.d.ts +0 -8
- package/dist/animation/modules/AnimatedInline.d.ts +0 -8
- package/dist/animation/modules/MountedBlock.d.ts +0 -18
- package/dist/gestures/eventAttacher.d.ts +0 -11
- package/dist/gestures/index.d.ts +0 -2
- package/dist/gestures/types.d.ts +0 -51
- package/dist/utils/isDefined.d.ts +0 -1
- package/rollup.config.js +0 -18
- package/src/animation/animationType.ts +0 -17
- package/src/animation/getInitialConfig.ts +0 -61
- package/src/animation/index.ts +0 -10
- package/src/animation/interpolation.ts +0 -48
- package/src/animation/modules/AnimatedBlock.ts +0 -8
- package/src/animation/modules/AnimatedImage.ts +0 -8
- package/src/animation/modules/AnimatedInline.ts +0 -8
- package/src/animation/modules/MountedBlock.tsx +0 -25
- package/src/animation/modules/ScrollableBlock.tsx +0 -69
- package/src/animation/modules/TransitionBlock.tsx +0 -29
- package/src/animation/modules/index.ts +0 -6
- package/src/animation/useAnimatedValue.ts +0 -71
- package/src/animation/useMountedValue.ts +0 -19
- package/src/gestures/controllers/DragGesture.ts +0 -177
- package/src/gestures/controllers/Gesture.ts +0 -54
- package/src/gestures/controllers/MouseMoveGesture.ts +0 -111
- package/src/gestures/controllers/ScrollGesture.ts +0 -107
- package/src/gestures/controllers/WheelGesture.ts +0 -123
- package/src/gestures/controllers/index.ts +0 -4
- package/src/gestures/eventAttacher.ts +0 -67
- package/src/gestures/hooks/index.ts +0 -5
- package/src/gestures/hooks/useDrag.ts +0 -14
- package/src/gestures/hooks/useGesture.ts +0 -38
- package/src/gestures/hooks/useMouseMove.ts +0 -11
- package/src/gestures/hooks/useRecognizer.ts +0 -59
- package/src/gestures/hooks/useScroll.ts +0 -11
- package/src/gestures/hooks/useWheel.ts +0 -11
- package/src/gestures/index.ts +0 -2
- package/src/gestures/math.ts +0 -120
- package/src/gestures/types.ts +0 -49
- package/src/gestures/withDefault.ts +0 -3
- package/src/hooks/index.ts +0 -3
- package/src/hooks/useMeasure.ts +0 -133
- package/src/hooks/useOutsideClick.ts +0 -36
- package/src/hooks/useWindowDimension.ts +0 -59
- package/src/index.ts +0 -5
- package/src/utils/delay.ts +0 -9
- package/src/utils/index.ts +0 -2
- package/src/utils/isDefined.ts +0 -4
- package/tsconfig.json +0 -25
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* bin(booleanValue)
|
|
3
|
-
* returns 1 if booleanValue == true and 0 if booleanValue == false
|
|
4
|
-
*/
|
|
5
|
-
export declare function bin(bool: boolean): 1 | 0;
|
|
6
|
-
/**
|
|
7
|
-
* mix(progress, a, b)
|
|
8
|
-
* linear interpolation between a and b
|
|
9
|
-
*/
|
|
10
|
-
export declare function mix(perc: number, val1: number, val2: number): number;
|
|
11
|
-
/**
|
|
12
|
-
* clamp(value, min, max)
|
|
13
|
-
* clamps value for min and max bounds
|
|
14
|
-
*/
|
|
15
|
-
export declare function clamp(value: number, lowerbound: number, upperbound: number): number;
|
|
16
|
-
/**
|
|
17
|
-
* rubberClamp(value, min, max, constant?)
|
|
18
|
-
* constant is optional : default 0.15
|
|
19
|
-
* clamps the value for min and max value and
|
|
20
|
-
* extends beyond min and max values with constant
|
|
21
|
-
* factor to create elastic rubber band effect
|
|
22
|
-
*/
|
|
23
|
-
export declare function rubberClamp(value: number, lowerbound: number, upperbound: number, constant?: number): number;
|
|
24
|
-
/**
|
|
25
|
-
* snapTo(value, velocity, snapPoints[])
|
|
26
|
-
* Calculates the final snapPoint according to given current value,
|
|
27
|
-
* velocity and snapPoints array
|
|
28
|
-
*/
|
|
29
|
-
export declare function snapTo(value: number, velocity: number, snapPoints: Array<number>): number;
|
|
30
|
-
/**
|
|
31
|
-
* move(array, moveIndex, toIndex)
|
|
32
|
-
* move array item from moveIndex to toIndex without array modification
|
|
33
|
-
*/
|
|
34
|
-
export declare function move(array: Array<any>, moveIndex: number, toIndex: number): any[];
|
|
1
|
+
/**
|
|
2
|
+
* bin(booleanValue)
|
|
3
|
+
* returns 1 if booleanValue == true and 0 if booleanValue == false
|
|
4
|
+
*/
|
|
5
|
+
export declare function bin(bool: boolean): 1 | 0;
|
|
6
|
+
/**
|
|
7
|
+
* mix(progress, a, b)
|
|
8
|
+
* linear interpolation between a and b
|
|
9
|
+
*/
|
|
10
|
+
export declare function mix(perc: number, val1: number, val2: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* clamp(value, min, max)
|
|
13
|
+
* clamps value for min and max bounds
|
|
14
|
+
*/
|
|
15
|
+
export declare function clamp(value: number, lowerbound: number, upperbound: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* rubberClamp(value, min, max, constant?)
|
|
18
|
+
* constant is optional : default 0.15
|
|
19
|
+
* clamps the value for min and max value and
|
|
20
|
+
* extends beyond min and max values with constant
|
|
21
|
+
* factor to create elastic rubber band effect
|
|
22
|
+
*/
|
|
23
|
+
export declare function rubberClamp(value: number, lowerbound: number, upperbound: number, constant?: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* snapTo(value, velocity, snapPoints[])
|
|
26
|
+
* Calculates the final snapPoint according to given current value,
|
|
27
|
+
* velocity and snapPoints array
|
|
28
|
+
*/
|
|
29
|
+
export declare function snapTo(value: number, velocity: number, snapPoints: Array<number>): number;
|
|
30
|
+
/**
|
|
31
|
+
* move(array, moveIndex, toIndex)
|
|
32
|
+
* move array item from moveIndex to toIndex without array modification
|
|
33
|
+
*/
|
|
34
|
+
export declare function move(array: Array<any>, moveIndex: number, toIndex: number): any[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const withDefault: (x: number, y: number) => {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
};
|
|
1
|
+
export declare const withDefault: (x: number, y: number) => {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './useDrag';
|
|
2
|
-
export * from './useMouseMove';
|
|
3
|
-
export * from './useScroll';
|
|
4
|
-
export * from './useWheel';
|
|
5
|
-
export * from './useGesture';
|
|
1
|
+
export * from './useDrag';
|
|
2
|
+
export * from './useMouseMove';
|
|
3
|
+
export * from './useScroll';
|
|
4
|
+
export * from './useWheel';
|
|
5
|
+
export * from './useGesture';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DragEventType, UseDragConfig } from '../types';
|
|
2
|
-
export declare function useDrag(callback: (event: DragEventType) => void, config?: UseDragConfig): (index?: number
|
|
3
|
-
ref: any;
|
|
4
|
-
};
|
|
1
|
+
import { DragEventType, UseDragConfig } from '../types';
|
|
2
|
+
export declare function useDrag(callback: (event: DragEventType) => void, config?: UseDragConfig): (index?: number) => {
|
|
3
|
+
ref: any;
|
|
4
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DragEventType, WheelEventType, ScrollEventType, MouseMoveEventType } from '../types';
|
|
2
|
-
export declare function useGesture({ onDrag, onWheel, onScroll, onMouseMove, }: {
|
|
3
|
-
onDrag?: (event: DragEventType) => void;
|
|
4
|
-
onWheel?: (event: WheelEventType) => void;
|
|
5
|
-
onScroll?: (event: ScrollEventType) => void;
|
|
6
|
-
onMouseMove?: (event: MouseMoveEventType) => void;
|
|
7
|
-
}): (index?: number
|
|
8
|
-
ref: any;
|
|
9
|
-
};
|
|
1
|
+
import { DragEventType, WheelEventType, ScrollEventType, MouseMoveEventType } from '../types';
|
|
2
|
+
export declare function useGesture({ onDrag, onWheel, onScroll, onMouseMove, }: {
|
|
3
|
+
onDrag?: (event: DragEventType) => void;
|
|
4
|
+
onWheel?: (event: WheelEventType) => void;
|
|
5
|
+
onScroll?: (event: ScrollEventType) => void;
|
|
6
|
+
onMouseMove?: (event: MouseMoveEventType) => void;
|
|
7
|
+
}): (index?: number) => {
|
|
8
|
+
ref: any;
|
|
9
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseMoveEventType } from '../types';
|
|
2
|
-
export declare function useMouseMove(callback: (event: MouseMoveEventType) => void): (index?: number
|
|
3
|
-
ref: any;
|
|
4
|
-
};
|
|
1
|
+
import { MouseMoveEventType } from '../types';
|
|
2
|
+
export declare function useMouseMove(callback: (event: MouseMoveEventType) => void): (index?: number) => {
|
|
3
|
+
ref: any;
|
|
4
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
key: 'drag' | 'wheel' | 'move' | 'scroll',
|
|
3
|
-
gesture: any,
|
|
4
|
-
callback: any,
|
|
5
|
-
config?: any
|
|
6
|
-
]>;
|
|
7
|
-
export declare const useRecognizer: (handlers: UseRecognizerHandlerType) => (index?: number
|
|
8
|
-
ref: any;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
1
|
+
type UseRecognizerHandlerType = Array<[
|
|
2
|
+
key: 'drag' | 'wheel' | 'move' | 'scroll',
|
|
3
|
+
gesture: any,
|
|
4
|
+
callback: any,
|
|
5
|
+
config?: any
|
|
6
|
+
]>;
|
|
7
|
+
export declare const useRecognizer: (handlers: UseRecognizerHandlerType) => (index?: number) => {
|
|
8
|
+
ref: any;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ScrollEventType } from '../types';
|
|
2
|
-
export declare function useScroll(callback: (event: ScrollEventType) => void): (index?: number
|
|
3
|
-
ref: any;
|
|
4
|
-
};
|
|
1
|
+
import { ScrollEventType } from '../types';
|
|
2
|
+
export declare function useScroll(callback: (event: ScrollEventType) => void): (index?: number) => {
|
|
3
|
+
ref: any;
|
|
4
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WheelEventType } from '../types';
|
|
2
|
-
export declare function useWheel(callback: (event: WheelEventType) => void): (index?: number
|
|
3
|
-
ref: any;
|
|
4
|
-
};
|
|
1
|
+
import { WheelEventType } from '../types';
|
|
2
|
+
export declare function useWheel(callback: (event: WheelEventType) => void): (index?: number) => {
|
|
3
|
+
ref: any;
|
|
4
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./useOutsideClick";
|
|
2
|
-
export * from "./useMeasure";
|
|
3
|
-
export * from "./useWindowDimension";
|
|
1
|
+
export * from "./useOutsideClick";
|
|
2
|
+
export * from "./useMeasure";
|
|
3
|
+
export * from "./useWindowDimension";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
left: MeasurementValue;
|
|
5
|
-
top: MeasurementValue;
|
|
6
|
-
width: MeasurementValue;
|
|
7
|
-
height: MeasurementValue;
|
|
8
|
-
vLeft: MeasurementValue;
|
|
9
|
-
vTop: MeasurementValue;
|
|
10
|
-
};
|
|
11
|
-
export declare function useMeasure(callback: (event: MeasurementType) => void, deps?:
|
|
12
|
-
ref:
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
1
|
+
import { DependencyList } from 'react';
|
|
2
|
+
type MeasurementValue = number | Array<number>;
|
|
3
|
+
type MeasurementType = {
|
|
4
|
+
left: MeasurementValue;
|
|
5
|
+
top: MeasurementValue;
|
|
6
|
+
width: MeasurementValue;
|
|
7
|
+
height: MeasurementValue;
|
|
8
|
+
vLeft: MeasurementValue;
|
|
9
|
+
vTop: MeasurementValue;
|
|
10
|
+
};
|
|
11
|
+
export declare function useMeasure(callback: (event: MeasurementType) => void, deps?: DependencyList): (index?: number) => {
|
|
12
|
+
ref: import("react").MutableRefObject<null>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function useOutsideClick(elementRef:
|
|
1
|
+
import { RefObject, DependencyList } from 'react';
|
|
2
|
+
export declare function useOutsideClick(elementRef: RefObject<HTMLElement>, callback: (event: MouseEvent) => void, deps?: DependencyList): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
innerWidth: number;
|
|
6
|
-
innerHeight: number;
|
|
7
|
-
};
|
|
8
|
-
export declare function useWindowDimension(callback: (event: WindowDimensionType) => void, deps?:
|
|
9
|
-
export {};
|
|
1
|
+
import { DependencyList } from 'react';
|
|
2
|
+
type WindowDimensionType = {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
innerWidth: number;
|
|
6
|
+
innerHeight: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function useWindowDimension(callback: (event: WindowDimensionType) => void, deps?: DependencyList): void;
|
|
9
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export { Easing,
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export { Easing, makeFluid, fluid } from './animation/core';
|
|
2
|
+
export { AnimatedBlock, AnimatedImage, AnimatedInline, AnimationConfigUtils, MountedBlock, ScrollableBlock, TransitionBlock, } from './animation/lib';
|
|
3
|
+
export { bInterpolate, interpolate } from './animation/lib';
|
|
4
|
+
export { useAnimatedValue, useMountedValue } from './animation/lib';
|
|
5
|
+
export { delay } from './utils';
|
|
6
|
+
export { useMeasure, useOutsideClick, useWindowDimension } from './hooks';
|
|
7
|
+
export { useDrag, useGesture, useMouseMove, useScroll, useWheel, } from './gestures/hooks';
|
|
8
|
+
export { bin, clamp, mix, rubberClamp, move, snapTo } from './gestures/helpers';
|
|
9
|
+
export type { UseAnimatedValueConfig } from './animation/lib';
|