react-ui-animate 4.3.1 → 4.3.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.
Files changed (60) hide show
  1. package/dist/animation/{helpers/animationType.d.ts → Config.d.ts} +9 -9
  2. package/dist/animation/descriptors.d.ts +7 -0
  3. package/dist/animation/drivers.d.ts +4 -0
  4. package/dist/animation/helpers.d.ts +3 -0
  5. package/dist/animation/hooks/index.d.ts +2 -3
  6. package/dist/animation/hooks/useMount.d.ts +16 -10
  7. package/dist/animation/hooks/useValue.d.ts +8 -6
  8. package/dist/animation/index.d.ts +5 -5
  9. package/dist/animation/modules/Mount.d.ts +17 -0
  10. package/dist/animation/modules/index.d.ts +1 -2
  11. package/dist/animation/to.d.ts +9 -0
  12. package/dist/animation/types.d.ts +41 -15
  13. package/dist/gestures/controllers/DragGesture.d.ts +45 -15
  14. package/dist/gestures/controllers/Gesture.d.ts +12 -19
  15. package/dist/gestures/controllers/MoveGesture.d.ts +30 -0
  16. package/dist/gestures/controllers/ScrollGesture.d.ts +27 -12
  17. package/dist/gestures/controllers/WheelGesture.d.ts +26 -13
  18. package/dist/gestures/hooks/index.d.ts +4 -5
  19. package/dist/gestures/hooks/useDrag.d.ts +5 -4
  20. package/dist/gestures/hooks/useMove.d.ts +8 -0
  21. package/dist/gestures/hooks/useRecognizer.d.ts +12 -9
  22. package/dist/gestures/hooks/useScroll.d.ts +8 -4
  23. package/dist/gestures/hooks/useWheel.d.ts +8 -4
  24. package/dist/gestures/index.d.ts +1 -0
  25. package/dist/hooks/index.d.ts +1 -3
  26. package/dist/hooks/useOutsideClick.d.ts +1 -1
  27. package/dist/index.d.ts +5 -9
  28. package/dist/index.js +1 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/utils/index.d.ts +4 -0
  31. package/package.json +1 -1
  32. package/dist/animation/controllers/index.d.ts +0 -8
  33. package/dist/animation/controllers/withDecay.d.ts +0 -11
  34. package/dist/animation/controllers/withDelay.d.ts +0 -4
  35. package/dist/animation/controllers/withEase.d.ts +0 -8
  36. package/dist/animation/controllers/withLoop.d.ts +0 -8
  37. package/dist/animation/controllers/withNative.d.ts +0 -5
  38. package/dist/animation/controllers/withSequence.d.ts +0 -8
  39. package/dist/animation/controllers/withSpring.d.ts +0 -12
  40. package/dist/animation/controllers/withTiming.d.ts +0 -11
  41. package/dist/animation/helpers/getToValue.d.ts +0 -2
  42. package/dist/animation/helpers/index.d.ts +0 -2
  43. package/dist/animation/hooks/useValues.d.ts +0 -7
  44. package/dist/animation/interpolation/colors.d.ts +0 -25
  45. package/dist/animation/interpolation/index.d.ts +0 -1
  46. package/dist/animation/interpolation/interpolate.d.ts +0 -11
  47. package/dist/animation/interpolation/interpolateNumbers.d.ts +0 -8
  48. package/dist/animation/modules/MountedBlock.d.ts +0 -11
  49. package/dist/animation/modules/ScrollableBlock.d.ts +0 -11
  50. package/dist/gestures/controllers/MouseMoveGesture.d.ts +0 -13
  51. package/dist/gestures/controllers/index.d.ts +0 -4
  52. package/dist/gestures/helpers/eventAttacher.d.ts +0 -11
  53. package/dist/gestures/helpers/index.d.ts +0 -1
  54. package/dist/gestures/helpers/math.d.ts +0 -34
  55. package/dist/gestures/helpers/withDefault.d.ts +0 -4
  56. package/dist/gestures/hooks/useGesture.d.ts +0 -9
  57. package/dist/gestures/hooks/useMouseMove.d.ts +0 -4
  58. package/dist/gestures/types/index.d.ts +0 -51
  59. package/dist/hooks/useMeasure.d.ts +0 -14
  60. package/dist/hooks/useWindowDimension.d.ts +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-ui-animate",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "React library for gestures and animation",
5
5
  "main": "dist/index.js",
6
6
  "peerDependencies": {
@@ -1,8 +0,0 @@
1
- export { withDecay } from './withDecay';
2
- export { withDelay } from './withDelay';
3
- export { withSequence } from './withSequence';
4
- export { withSpring } from './withSpring';
5
- export { withTiming } from './withTiming';
6
- export { withLoop } from './withLoop';
7
- export { withNative } from './withNative';
8
- export { withEase } from './withEase';
@@ -1,11 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- import type { WithCallbacks } from '../types';
3
- interface WithDecayConfig extends WithCallbacks {
4
- velocity?: number;
5
- deceleration?: number;
6
- }
7
- export declare const withDecay: (config?: WithDecayConfig, callback?: (result: any) => void) => (value: FluidValue) => {
8
- controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
9
- callback: ((result: any) => void) | undefined;
10
- };
11
- export {};
@@ -1,4 +0,0 @@
1
- export declare const withDelay: (ms: number, callback?: (result: any) => void) => () => {
2
- controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
3
- callback: ((result: any) => void) | undefined;
4
- };
@@ -1,8 +0,0 @@
1
- import type { WithCallbacks } from '../types';
2
- interface WithEaseConfig extends WithCallbacks {
3
- }
4
- export declare const withEase: (toValue: number, config?: WithEaseConfig, callback?: (result: any) => void) => (value: import("@raidipesh78/re-motion").FluidValue) => {
5
- controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
6
- callback: ((result: any) => void) | undefined;
7
- };
8
- export {};
@@ -1,8 +0,0 @@
1
- import { FluidValue, loop } from '@raidipesh78/re-motion';
2
- export declare const withLoop: (animations: (value: FluidValue) => {
3
- controller: ReturnType<typeof loop>;
4
- callback?: (result: any) => void;
5
- }, iterations: number, callback?: (result: any) => void) => (value: FluidValue) => {
6
- controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
7
- callback: ((result: any) => void) | undefined;
8
- };
@@ -1,5 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- export declare const withNative: (toValue: number | string, callback?: (result: any) => void) => (value: FluidValue) => {
3
- controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
4
- callback: ((result: any) => void) | undefined;
5
- };
@@ -1,8 +0,0 @@
1
- import { FluidValue, sequence } from '@raidipesh78/re-motion';
2
- export declare const withSequence: (animations: Array<(value: FluidValue) => {
3
- controller: ReturnType<typeof sequence>;
4
- callback?: (result: any) => void;
5
- }>, callback?: (result: any) => void) => (value: FluidValue) => {
6
- controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
7
- callback: ((result: any) => void) | undefined;
8
- };
@@ -1,12 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- import type { WithCallbacks } from '../types';
3
- interface WithSpringConfig extends WithCallbacks {
4
- mass?: number;
5
- friction?: number;
6
- tension?: number;
7
- }
8
- export declare const withSpring: (toValue: number, config?: WithSpringConfig, callback?: (result: any) => void) => (value: FluidValue) => {
9
- controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
10
- callback: ((result: any) => void) | undefined;
11
- };
12
- export {};
@@ -1,11 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- import type { WithCallbacks } from '../types';
3
- interface WithTimingConfig extends WithCallbacks {
4
- duration?: number;
5
- easing?: (t: number) => number;
6
- }
7
- export declare const withTiming: (toValue: number, config?: WithTimingConfig, callback?: (result: any) => void) => (value: FluidValue) => {
8
- controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
9
- callback: ((result: any) => void) | undefined;
10
- };
11
- export {};
@@ -1,2 +0,0 @@
1
- import { ToValue } from '../types';
2
- export declare function getToValue(val: string | number | ToValue): ToValue;
@@ -1,2 +0,0 @@
1
- export * from './animationType';
2
- export * from './getToValue';
@@ -1,7 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- import type { ToValue } from '../types';
3
- export declare function useValues(initialValue: number[] | string[]): {
4
- get value(): FluidValue[];
5
- set value(to: number[] | string[] | ToValue[]);
6
- readonly currentValue: (string | number)[];
7
- };
@@ -1,25 +0,0 @@
1
- export declare const COLOR_NUMBER_REGEX: RegExp;
2
- export declare const HEX_NAME_COLOR: RegExp;
3
- interface classNameType {
4
- [name: string]: string;
5
- }
6
- export declare const colorNames: classNameType;
7
- export declare function hexToRgba(hex: string): {
8
- r: number;
9
- g: number;
10
- b: number;
11
- a: number;
12
- };
13
- export declare function rgbaToHex(rgba: {
14
- r: number;
15
- g: number;
16
- b: number;
17
- a: number;
18
- }): string;
19
- export declare function processColor(color: number | string): {
20
- r: number;
21
- g: number;
22
- b: number;
23
- a: number;
24
- };
25
- export {};
@@ -1 +0,0 @@
1
- export { interpolate, bInterpolate } from './interpolate';
@@ -1,11 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- type ExtrapolateType = 'identity' | 'extend' | 'clamp';
3
- type ExtrapolateConfig = {
4
- extrapolate?: ExtrapolateType;
5
- extrapolateLeft?: ExtrapolateType;
6
- extrapolateRight?: ExtrapolateType;
7
- };
8
- type InterpolateReturnType<T> = T extends number ? number : ReturnType<FluidValue['interpolate']>;
9
- export declare const interpolate: <T extends number | FluidValue>(value: T, inputRange: number[], outputRange: number[] | string[], extrapolateConfig?: ExtrapolateConfig) => InterpolateReturnType<T>;
10
- export declare const bInterpolate: <T extends number | FluidValue>(value: T, minOutput: number | string, maxOutput: number | string, extrapolateConfig?: ExtrapolateConfig) => InterpolateReturnType<T>;
11
- export {};
@@ -1,8 +0,0 @@
1
- type ExtrapolateType = 'identity' | 'extend' | 'clamp';
2
- type ExtrapolateConfig = {
3
- extrapolate?: ExtrapolateType;
4
- extrapolateLeft?: ExtrapolateType;
5
- extrapolateRight?: ExtrapolateType;
6
- };
7
- export declare function interpolateNumbers(value: number, inputRange: Array<number>, outputRange: Array<number | string>, extrapolateConfig?: ExtrapolateConfig): any;
8
- export {};
@@ -1,11 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { FluidValue } from '@raidipesh78/re-motion';
3
- import { type UseMountConfig } from '../hooks';
4
- interface MountedBlockProps extends Partial<UseMountConfig> {
5
- state: boolean;
6
- children: (animation: {
7
- value: FluidValue;
8
- }) => ReactNode;
9
- }
10
- export declare const MountedBlock: ({ state, children, from, enter, exit, }: MountedBlockProps) => import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,11 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { FluidValue } from '@raidipesh78/re-motion';
3
- interface ScrollableBlockProps {
4
- children?: (animation: {
5
- value: FluidValue;
6
- }) => ReactNode;
7
- direction?: 'single' | 'both';
8
- threshold?: number;
9
- }
10
- export declare const ScrollableBlock: (props: ScrollableBlockProps) => import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,13 +0,0 @@
1
- import { Vector2 } from '../types';
2
- import { Gesture } from './Gesture';
3
- export declare class MouseMoveGesture extends Gesture {
4
- event?: MouseEvent;
5
- isActiveID?: any;
6
- movement: Vector2;
7
- previousMovement: Vector2;
8
- velocity: Vector2;
9
- direction: Vector2;
10
- _initEvents(): void;
11
- _handleCallback(): void;
12
- onMouseMove(e: MouseEvent): void;
13
- }
@@ -1,4 +0,0 @@
1
- export * from './DragGesture';
2
- export * from './MouseMoveGesture';
3
- export * from './ScrollGesture';
4
- export * from './WheelGesture';
@@ -1,11 +0,0 @@
1
- type MouseEventType = 'click' | 'dblclick' | 'mousedown' | 'mousemove' | 'mouseup' | 'touchstart' | 'touchmove' | 'touchend' | 'mouseenter' | 'mouseleave' | 'mouseout' | 'mouseover' | 'scroll' | 'wheel' | 'contextmenu';
2
- type DomTargetTypes = Array<Window | Document | HTMLElement>;
3
- /**
4
- * Attach multiple document / window event / HTMLElement
5
- */
6
- export declare function attachEvents(domTargets: DomTargetTypes, events: Array<[
7
- event: MouseEventType,
8
- callback: (e: any) => void,
9
- capture?: any
10
- ]>): (eventKeys?: Array<string>) => void;
11
- export {};
@@ -1 +0,0 @@
1
- export * from './math';
@@ -1,34 +0,0 @@
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 +0,0 @@
1
- export declare const withDefault: (x: number, y: number) => {
2
- x: number;
3
- y: number;
4
- };
@@ -1,9 +0,0 @@
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 +0,0 @@
1
- import { MouseMoveEventType } from '../types';
2
- export declare function useMouseMove(callback: (event: MouseMoveEventType) => void): (index?: number) => {
3
- ref: any;
4
- };
@@ -1,51 +0,0 @@
1
- type GenericEventType = {
2
- velocityX: number;
3
- velocityY: number;
4
- directionX: number;
5
- directionY: number;
6
- };
7
- export type DragEventType = {
8
- args: Array<number | undefined>;
9
- down: boolean;
10
- movementX: number;
11
- movementY: number;
12
- offsetX: number;
13
- offsetY: number;
14
- distanceX: number;
15
- distanceY: number;
16
- cancel: () => void;
17
- } & GenericEventType;
18
- export type MouseMoveEventType = {
19
- args: Array<number | undefined>;
20
- event: MouseEvent;
21
- target: EventTarget | undefined | null;
22
- isMoving: boolean;
23
- mouseX: number;
24
- mouseY: number;
25
- } & GenericEventType;
26
- export type ScrollEventType = {
27
- isScrolling: boolean;
28
- scrollX: number;
29
- scrollY: number;
30
- } & GenericEventType;
31
- export type WheelEventType = {
32
- target: HTMLElement | undefined | null;
33
- isWheeling: boolean;
34
- movementX: number;
35
- movementY: number;
36
- offsetX: number;
37
- offsetY: number;
38
- deltaX: number;
39
- deltaY: number;
40
- } & GenericEventType;
41
- export type UseDragConfig = {
42
- initial?: () => {
43
- movementX: number;
44
- movementY: number;
45
- };
46
- };
47
- export type Vector2 = {
48
- x: number;
49
- y: number;
50
- };
51
- export {};
@@ -1,14 +0,0 @@
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,9 +0,0 @@
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 {};