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.
Files changed (117) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +115 -115
  3. package/dist/animation/core/controllers/Animation.d.ts +16 -0
  4. package/dist/animation/core/controllers/FluidValue.d.ts +32 -0
  5. package/dist/animation/core/controllers/RequestAnimationFrame.d.ts +8 -0
  6. package/dist/animation/core/controllers/SpringAnimation.d.ts +41 -0
  7. package/dist/animation/core/controllers/TimingAnimation.d.ts +35 -0
  8. package/dist/animation/core/easing/Bezier.d.ts +8 -0
  9. package/dist/animation/core/easing/Easing.d.ts +40 -0
  10. package/dist/animation/core/helpers/camelCaseToKebabCase.d.ts +8 -0
  11. package/dist/animation/core/helpers/getCleanProps.d.ts +10 -0
  12. package/dist/animation/core/helpers/getCssValue.d.ts +8 -0
  13. package/dist/animation/core/helpers/index.d.ts +5 -0
  14. package/dist/animation/core/helpers/isDefined.d.ts +12 -0
  15. package/dist/animation/core/helpers/isFluidValue.d.ts +6 -0
  16. package/dist/animation/core/index.d.ts +11 -0
  17. package/dist/animation/core/interpolation/Colors.d.ts +25 -0
  18. package/dist/animation/core/interpolation/Interpolation.d.ts +80 -0
  19. package/dist/animation/core/interpolation/__tests__/Colors.test.d.ts +1 -0
  20. package/dist/animation/core/react/fluid.d.ts +6 -0
  21. package/dist/animation/core/react/makeFluid.d.ts +30 -0
  22. package/dist/animation/core/react/transforms.d.ts +6 -0
  23. package/dist/animation/core/react/useFluidValue.d.ts +9 -0
  24. package/dist/animation/core/react/useMount.d.ts +20 -0
  25. package/dist/animation/lib/animationType.d.ts +15 -0
  26. package/dist/animation/lib/getInitialConfig.d.ts +3 -0
  27. package/dist/animation/lib/index.d.ts +5 -0
  28. package/dist/animation/{interpolation.d.ts → lib/interpolation.d.ts} +20 -21
  29. package/dist/animation/lib/modules/AnimatedBlock.d.ts +8 -0
  30. package/dist/animation/lib/modules/AnimatedImage.d.ts +8 -0
  31. package/dist/animation/lib/modules/AnimatedInline.d.ts +8 -0
  32. package/dist/animation/lib/modules/MountedBlock.d.ts +29 -0
  33. package/dist/animation/{modules → lib/modules}/ScrollableBlock.d.ts +22 -21
  34. package/dist/animation/{modules → lib/modules}/TransitionBlock.d.ts +18 -17
  35. package/dist/animation/{modules → lib/modules}/index.d.ts +6 -6
  36. package/dist/animation/{useAnimatedValue.d.ts → lib/useAnimatedValue.d.ts} +17 -22
  37. package/dist/animation/{useMountedValue.d.ts → lib/useMountedValue.d.ts} +14 -15
  38. package/dist/gestures/controllers/DragGesture.d.ts +17 -17
  39. package/dist/gestures/controllers/Gesture.d.ts +20 -20
  40. package/dist/gestures/controllers/MouseMoveGesture.d.ts +13 -13
  41. package/dist/gestures/controllers/ScrollGesture.d.ts +14 -14
  42. package/dist/gestures/controllers/WheelGesture.d.ts +15 -15
  43. package/dist/gestures/controllers/index.d.ts +4 -4
  44. package/dist/gestures/helpers/eventAttacher.d.ts +11 -0
  45. package/dist/gestures/helpers/index.d.ts +1 -0
  46. package/dist/gestures/{math.d.ts → helpers/math.d.ts} +34 -34
  47. package/dist/gestures/{withDefault.d.ts → helpers/withDefault.d.ts} +4 -4
  48. package/dist/gestures/hooks/index.d.ts +5 -5
  49. package/dist/gestures/hooks/useDrag.d.ts +4 -4
  50. package/dist/gestures/hooks/useGesture.d.ts +9 -9
  51. package/dist/gestures/hooks/useMouseMove.d.ts +4 -4
  52. package/dist/gestures/hooks/useRecognizer.d.ts +10 -10
  53. package/dist/gestures/hooks/useScroll.d.ts +4 -4
  54. package/dist/gestures/hooks/useWheel.d.ts +4 -4
  55. package/dist/hooks/index.d.ts +3 -3
  56. package/dist/hooks/useMeasure.d.ts +14 -14
  57. package/dist/hooks/useOutsideClick.d.ts +2 -2
  58. package/dist/hooks/useWindowDimension.d.ts +9 -9
  59. package/dist/index.d.ts +9 -5
  60. package/dist/index.js +1 -1191
  61. package/dist/index.js.map +1 -1
  62. package/dist/utils/delay.d.ts +5 -5
  63. package/dist/utils/index.d.ts +1 -2
  64. package/package.json +49 -48
  65. package/.vscode/settings.json +0 -3
  66. package/dist/animation/animationType.d.ts +0 -15
  67. package/dist/animation/getInitialConfig.d.ts +0 -3
  68. package/dist/animation/index.d.ts +0 -6
  69. package/dist/animation/modules/AnimatedBlock.d.ts +0 -8
  70. package/dist/animation/modules/AnimatedImage.d.ts +0 -8
  71. package/dist/animation/modules/AnimatedInline.d.ts +0 -8
  72. package/dist/animation/modules/MountedBlock.d.ts +0 -18
  73. package/dist/gestures/eventAttacher.d.ts +0 -11
  74. package/dist/gestures/index.d.ts +0 -2
  75. package/dist/gestures/types.d.ts +0 -51
  76. package/dist/utils/isDefined.d.ts +0 -1
  77. package/rollup.config.js +0 -18
  78. package/src/animation/animationType.ts +0 -17
  79. package/src/animation/getInitialConfig.ts +0 -61
  80. package/src/animation/index.ts +0 -10
  81. package/src/animation/interpolation.ts +0 -48
  82. package/src/animation/modules/AnimatedBlock.ts +0 -8
  83. package/src/animation/modules/AnimatedImage.ts +0 -8
  84. package/src/animation/modules/AnimatedInline.ts +0 -8
  85. package/src/animation/modules/MountedBlock.tsx +0 -25
  86. package/src/animation/modules/ScrollableBlock.tsx +0 -69
  87. package/src/animation/modules/TransitionBlock.tsx +0 -29
  88. package/src/animation/modules/index.ts +0 -6
  89. package/src/animation/useAnimatedValue.ts +0 -71
  90. package/src/animation/useMountedValue.ts +0 -19
  91. package/src/gestures/controllers/DragGesture.ts +0 -177
  92. package/src/gestures/controllers/Gesture.ts +0 -54
  93. package/src/gestures/controllers/MouseMoveGesture.ts +0 -111
  94. package/src/gestures/controllers/ScrollGesture.ts +0 -107
  95. package/src/gestures/controllers/WheelGesture.ts +0 -123
  96. package/src/gestures/controllers/index.ts +0 -4
  97. package/src/gestures/eventAttacher.ts +0 -67
  98. package/src/gestures/hooks/index.ts +0 -5
  99. package/src/gestures/hooks/useDrag.ts +0 -14
  100. package/src/gestures/hooks/useGesture.ts +0 -38
  101. package/src/gestures/hooks/useMouseMove.ts +0 -11
  102. package/src/gestures/hooks/useRecognizer.ts +0 -59
  103. package/src/gestures/hooks/useScroll.ts +0 -11
  104. package/src/gestures/hooks/useWheel.ts +0 -11
  105. package/src/gestures/index.ts +0 -2
  106. package/src/gestures/math.ts +0 -120
  107. package/src/gestures/types.ts +0 -49
  108. package/src/gestures/withDefault.ts +0 -3
  109. package/src/hooks/index.ts +0 -3
  110. package/src/hooks/useMeasure.ts +0 -133
  111. package/src/hooks/useOutsideClick.ts +0 -36
  112. package/src/hooks/useWindowDimension.ts +0 -59
  113. package/src/index.ts +0 -5
  114. package/src/utils/delay.ts +0 -9
  115. package/src/utils/index.ts +0 -2
  116. package/src/utils/isDefined.ts +0 -4
  117. 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 | undefined) => {
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 | undefined) => {
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 | undefined) => {
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
- declare 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 | undefined) => {
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 | undefined) => {
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 | undefined) => {
3
- ref: any;
4
- };
1
+ import { WheelEventType } from '../types';
2
+ export declare function useWheel(callback: (event: WheelEventType) => void): (index?: number) => {
3
+ ref: any;
4
+ };
@@ -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 * as React from "react";
2
- declare type MeasurementValue = number | Array<number>;
3
- declare 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?: React.DependencyList): (index?: number | undefined) => {
12
- ref: React.MutableRefObject<null>;
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 * as React from "react";
2
- export declare function useOutsideClick(elementRef: React.RefObject<HTMLElement>, callback: (event: MouseEvent) => void, deps?: React.DependencyList): void;
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 * as React from "react";
2
- declare 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?: React.DependencyList): void;
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, makeAnimatedComponent } from '@raidipesh78/re-motion';
2
- export { delay } from './utils';
3
- export * from './animation';
4
- export * from './gestures';
5
- export * from './hooks';
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';