react-ui-animate 3.0.0-rc.0 → 3.0.0-rc.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 (161) hide show
  1. package/dist/animation/core/helpers/isDefined.d.ts +1 -1
  2. package/dist/animation/core/helpers/isFluidValue.d.ts +8 -4
  3. package/dist/animation/lib/interpolation.d.ts +20 -15
  4. package/dist/gestures/helpers/math.d.ts +1 -1
  5. package/dist/index.js +1 -2897
  6. package/dist/index.js.map +1 -1
  7. package/package.json +2 -1
  8. package/.vscode/settings.json +0 -3
  9. package/dist/animation/animationType.d.ts +0 -15
  10. package/dist/animation/core/animation/Animation.d.ts +0 -16
  11. package/dist/animation/core/animation/FluidValue.d.ts +0 -21
  12. package/dist/animation/core/animation/RequestAnimationFrame.d.ts +0 -8
  13. package/dist/animation/core/animation/SpringAnimation.d.ts +0 -41
  14. package/dist/animation/core/animation/TimingAnimation.d.ts +0 -35
  15. package/dist/animation/core/animation/TransitionValue.d.ts +0 -21
  16. package/dist/animation/core/helpers/camelToDash.d.ts +0 -7
  17. package/dist/animation/core/helpers/canInterpolate.d.ts +0 -11
  18. package/dist/animation/core/helpers/getAnimatableObject.d.ts +0 -22
  19. package/dist/animation/core/helpers/getNonAnimatableStyle.d.ts +0 -6
  20. package/dist/animation/core/react/Tags.d.ts +0 -3
  21. package/dist/animation/core/react/TransformStyles.d.ts +0 -8
  22. package/dist/animation/core/react/animated.d.ts +0 -29
  23. package/dist/animation/core/react/combineRefs.d.ts +0 -2
  24. package/dist/animation/core/react/functions/camelToDash.d.ts +0 -7
  25. package/dist/animation/core/react/functions/getAnimatableObject.d.ts +0 -22
  26. package/dist/animation/core/react/functions/getCleanProps.d.ts +0 -4
  27. package/dist/animation/core/react/functions/getCssValue.d.ts +0 -8
  28. package/dist/animation/core/react/functions/getNonAnimatableStyle.d.ts +0 -6
  29. package/dist/animation/core/react/functions/index.d.ts +0 -7
  30. package/dist/animation/core/react/functions/isDefined.d.ts +0 -6
  31. package/dist/animation/core/react/functions/isTransitionValue.d.ts +0 -6
  32. package/dist/animation/core/react/helpers/camelToDash.d.ts +0 -7
  33. package/dist/animation/core/react/helpers/canInterpolate.d.ts +0 -7
  34. package/dist/animation/core/react/helpers/getAnimatableObject.d.ts +0 -22
  35. package/dist/animation/core/react/helpers/getCleanProps.d.ts +0 -4
  36. package/dist/animation/core/react/helpers/getCssValue.d.ts +0 -8
  37. package/dist/animation/core/react/helpers/getNonAnimatableStyle.d.ts +0 -6
  38. package/dist/animation/core/react/helpers/index.d.ts +0 -7
  39. package/dist/animation/core/react/helpers/isDefined.d.ts +0 -6
  40. package/dist/animation/core/react/helpers/isFluidValue.d.ts +0 -6
  41. package/dist/animation/core/react/helpers/isTransitionValue.d.ts +0 -6
  42. package/dist/animation/core/react/useMounts.d.ts +0 -26
  43. package/dist/animation/core/react/useTransition.d.ts +0 -9
  44. package/dist/animation/core/react/useTransitions.d.ts +0 -11
  45. package/dist/animation/core/types/animation.d.ts +0 -54
  46. package/dist/animation/core/types/common.d.ts +0 -4
  47. package/dist/animation/core/types/fluid.d.ts +0 -19
  48. package/dist/animation/core/types/index.d.ts +0 -2
  49. package/dist/animation/getInitialConfig.d.ts +0 -3
  50. package/dist/animation/index.d.ts +0 -6
  51. package/dist/animation/interpolation.d.ts +0 -21
  52. package/dist/animation/modules/AnimatedBlock.d.ts +0 -8
  53. package/dist/animation/modules/AnimatedImage.d.ts +0 -8
  54. package/dist/animation/modules/AnimatedInline.d.ts +0 -8
  55. package/dist/animation/modules/MountedBlock.d.ts +0 -29
  56. package/dist/animation/modules/ScrollableBlock.d.ts +0 -21
  57. package/dist/animation/modules/TransitionBlock.d.ts +0 -17
  58. package/dist/animation/modules/index.d.ts +0 -6
  59. package/dist/animation/useAnimatedValue.d.ts +0 -22
  60. package/dist/animation/useMountedValue.d.ts +0 -15
  61. package/dist/gestures/eventAttacher.d.ts +0 -11
  62. package/dist/gestures/index.d.ts +0 -2
  63. package/dist/gestures/math.d.ts +0 -34
  64. package/dist/gestures/types.d.ts +0 -51
  65. package/dist/gestures/withDefault.d.ts +0 -4
  66. package/dist/utils/isDefined.d.ts +0 -1
  67. package/ecosystem.config.js +0 -12
  68. package/example/README.md +0 -46
  69. package/example/package-lock.json +0 -19597
  70. package/example/package.json +0 -45
  71. package/example/public/favicon.ico +0 -0
  72. package/example/public/index.html +0 -20
  73. package/example/public/logo192.png +0 -0
  74. package/example/public/logo512.png +0 -0
  75. package/example/public/manifest.json +0 -25
  76. package/example/public/robots.txt +0 -3
  77. package/example/src/App.tsx +0 -41
  78. package/example/src/components/Draggable.tsx +0 -46
  79. package/example/src/components/Gestures.tsx +0 -151
  80. package/example/src/components/Interpolation.tsx +0 -21
  81. package/example/src/components/Loop.tsx +0 -48
  82. package/example/src/components/MountedBlock.tsx +0 -25
  83. package/example/src/components/MouseMove.tsx +0 -59
  84. package/example/src/components/MultistageTransition.tsx +0 -34
  85. package/example/src/components/Scroll.tsx +0 -39
  86. package/example/src/components/ScrollableBlock.tsx +0 -27
  87. package/example/src/components/SnapTo.tsx +0 -55
  88. package/example/src/components/TransitionBlock.tsx +0 -37
  89. package/example/src/components/Wheel.tsx +0 -39
  90. package/example/src/components/index.ts +0 -18
  91. package/example/src/components/svgLine.tsx +0 -48
  92. package/example/src/components/useAnimatedValue.tsx +0 -57
  93. package/example/src/components/useMountedValue.tsx +0 -62
  94. package/example/src/index.css +0 -8
  95. package/example/src/index.tsx +0 -16
  96. package/example/tsconfig.json +0 -26
  97. package/rollup.config.mjs +0 -18
  98. package/src/animation/core/controllers/Animation.ts +0 -27
  99. package/src/animation/core/controllers/FluidValue.ts +0 -97
  100. package/src/animation/core/controllers/RequestAnimationFrame.ts +0 -13
  101. package/src/animation/core/controllers/SpringAnimation.ts +0 -218
  102. package/src/animation/core/controllers/TimingAnimation.ts +0 -152
  103. package/src/animation/core/easing/Bezier.ts +0 -146
  104. package/src/animation/core/easing/Easing.ts +0 -132
  105. package/src/animation/core/helpers/camelCaseToKebabCase.ts +0 -10
  106. package/src/animation/core/helpers/getCleanProps.ts +0 -16
  107. package/src/animation/core/helpers/getCssValue.ts +0 -60
  108. package/src/animation/core/helpers/index.ts +0 -5
  109. package/src/animation/core/helpers/isDefined.ts +0 -14
  110. package/src/animation/core/helpers/isFluidValue.ts +0 -11
  111. package/src/animation/core/index.ts +0 -16
  112. package/src/animation/core/interpolation/Colors.ts +0 -232
  113. package/src/animation/core/interpolation/Interpolation.ts +0 -395
  114. package/src/animation/core/interpolation/__tests__/Colors.test.tsx +0 -35
  115. package/src/animation/core/react/fluid.ts +0 -197
  116. package/src/animation/core/react/makeFluid.ts +0 -294
  117. package/src/animation/core/react/transforms.ts +0 -90
  118. package/src/animation/core/react/useFluidValue.ts +0 -43
  119. package/src/animation/core/react/useMount.ts +0 -58
  120. package/src/animation/core/types/animation.d.ts +0 -56
  121. package/src/animation/core/types/common.d.ts +0 -4
  122. package/src/animation/core/types/fluid.d.ts +0 -38
  123. package/src/animation/lib/animationType.ts +0 -17
  124. package/src/animation/lib/getInitialConfig.ts +0 -61
  125. package/src/animation/lib/index.ts +0 -12
  126. package/src/animation/lib/interpolation.ts +0 -47
  127. package/src/animation/lib/modules/AnimatedBlock.ts +0 -8
  128. package/src/animation/lib/modules/AnimatedImage.ts +0 -8
  129. package/src/animation/lib/modules/AnimatedInline.ts +0 -8
  130. package/src/animation/lib/modules/MountedBlock.tsx +0 -51
  131. package/src/animation/lib/modules/ScrollableBlock.tsx +0 -68
  132. package/src/animation/lib/modules/TransitionBlock.tsx +0 -28
  133. package/src/animation/lib/modules/index.ts +0 -6
  134. package/src/animation/lib/useAnimatedValue.ts +0 -60
  135. package/src/animation/lib/useMountedValue.ts +0 -18
  136. package/src/gestures/controllers/DragGesture.ts +0 -178
  137. package/src/gestures/controllers/Gesture.ts +0 -54
  138. package/src/gestures/controllers/MouseMoveGesture.ts +0 -111
  139. package/src/gestures/controllers/ScrollGesture.ts +0 -107
  140. package/src/gestures/controllers/WheelGesture.ts +0 -123
  141. package/src/gestures/controllers/index.ts +0 -4
  142. package/src/gestures/helpers/eventAttacher.ts +0 -67
  143. package/src/gestures/helpers/index.ts +0 -1
  144. package/src/gestures/helpers/math.ts +0 -120
  145. package/src/gestures/helpers/withDefault.ts +0 -3
  146. package/src/gestures/hooks/index.ts +0 -5
  147. package/src/gestures/hooks/useDrag.ts +0 -14
  148. package/src/gestures/hooks/useGesture.ts +0 -38
  149. package/src/gestures/hooks/useMouseMove.ts +0 -11
  150. package/src/gestures/hooks/useRecognizer.ts +0 -59
  151. package/src/gestures/hooks/useScroll.ts +0 -11
  152. package/src/gestures/hooks/useWheel.ts +0 -11
  153. package/src/gestures/types/index.d.ts +0 -49
  154. package/src/hooks/index.ts +0 -3
  155. package/src/hooks/useMeasure.ts +0 -132
  156. package/src/hooks/useOutsideClick.ts +0 -36
  157. package/src/hooks/useWindowDimension.ts +0 -58
  158. package/src/index.ts +0 -42
  159. package/src/utils/delay.ts +0 -9
  160. package/src/utils/index.ts +0 -1
  161. package/tsconfig.json +0 -24
@@ -9,4 +9,4 @@
9
9
  * @returns {boolean} - Returns `true` if the value is neither `null` nor `undefined`, otherwise returns `false`.
10
10
  *
11
11
  */
12
- export declare const isDefined: <T>(value: T) => value is T & {};
12
+ export declare const isDefined: <T>(value: T) => value is NonNullable<T>;
@@ -1,6 +1,10 @@
1
+ import { FluidValue } from '../controllers/FluidValue';
1
2
  /**
2
- * isFluidValue to check the value is FluidValue or not
3
- * @param value - any
4
- * @returns - boolean
3
+ * Checks if the given value is of type FluidValue.
4
+ * A value is considered a FluidValue if it is defined,
5
+ * an object, and contains the '_subscribe' property.
6
+ *
7
+ * @param value - The value to check.
8
+ * @returns - True if the value is a FluidValue, false otherwise.
5
9
  */
6
- export declare const isFluidValue: (value: any) => any;
10
+ export declare const isFluidValue: (value: unknown) => value is FluidValue;
@@ -1,20 +1,25 @@
1
1
  import { ExtrapolateConfig, FluidValue } from '../core';
2
2
  /**
3
- * interpolate functions maps input range to given output range
4
- * @param value - number | TransitionValue
5
- * @param inputRange - Array<number>
6
- * @param outputRange - Array<number | string>
7
- * @param extrapolateConfig - "clamp" | "identity" | "extend"
8
- * @returns - number | TransitionValue
3
+ * Maps the input range to the given output range using the specified extrapolation configuration.
4
+ * The function ensures that the value is either a number or a FluidValue.
5
+ *
6
+ * @param value - The value to be interpolated, which must be a number or FluidValue.
7
+ * @param inputRange - An array of numbers defining the input range.
8
+ * @param outputRange - An array of numbers or strings defining the output range.
9
+ * @param extrapolateConfig - The extrapolation configuration, which can be "clamp", "identity", or "extend".
10
+ * @returns - The interpolated value, which will be a number or FluidValue.
11
+ * @throws - Will throw an error if the value is not a number or FluidValue.
9
12
  */
10
- export declare function interpolate(value: number | FluidValue, inputRange: Array<number>, outputRange: Array<number | string>, extrapolateConfig?: ExtrapolateConfig): any;
13
+ export declare function interpolate(value: FluidValue | number | string | undefined, inputRange: Array<number>, outputRange: Array<number | string>, extrapolateConfig?: ExtrapolateConfig): any;
11
14
  /**
12
- * bInterpolate functions maps input range [0, 1] to given [minOutput, maxOutput]
13
- * sorthand function to interpolate input range [0, 1]
14
- * @param value - number | TransitionValue
15
- * @param minOutput - number | string
16
- * @param maxOutput - number | string
17
- * @param extrapolateConfig - "clamp" | "identity" | "extend"
18
- * @returns - number | TransitionValue
15
+ * A shorthand function for interpolate that maps the input range [0, 1] to the given [minOutput, maxOutput].
16
+ * The function ensures that the value is either a number or a FluidValue.
17
+ *
18
+ * @param value - The value to be interpolated, which must be a number or FluidValue.
19
+ * @param minOutput - The minimum value of the output range, which can be a number or string.
20
+ * @param maxOutput - The maximum value of the output range, which can be a number or string.
21
+ * @param extrapolateConfig - The extrapolation configuration, which can be "clamp", "identity", or "extend".
22
+ * @returns - The interpolated value, which will be a number or FluidValue.
23
+ * @throws - Will throw an error if the value is not a number or FluidValue.
19
24
  */
20
- export declare function bInterpolate(value: number | FluidValue, minOutput: number | string, maxOutput: number | string, extrapolateConfig?: ExtrapolateConfig): any;
25
+ export declare function bInterpolate(value: FluidValue | number | string | undefined, minOutput: number | string, maxOutput: number | string, extrapolateConfig?: ExtrapolateConfig): any;
@@ -2,7 +2,7 @@
2
2
  * bin(booleanValue)
3
3
  * returns 1 if booleanValue == true and 0 if booleanValue == false
4
4
  */
5
- export declare function bin(bool: boolean): 0 | 1;
5
+ export declare function bin(bool: boolean): 1 | 0;
6
6
  /**
7
7
  * mix(progress, a, b)
8
8
  * linear interpolation between a and b