react-ui-animate 4.0.0-alpha.0 → 4.0.0-rc.0

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/README.md CHANGED
@@ -21,7 +21,7 @@ yarn add react-ui-animate
21
21
  The `react-ui-animate` library provides a straightforward way to add animations and gestures to your React components. Here’s how you can get started quickly:
22
22
 
23
23
  ```javascript
24
- import { animate.div, useAnimatedValue } from 'react-ui-animate';
24
+ import { animate, useAnimatedValue } from 'react-ui-animate';
25
25
 
26
26
  export default function () {
27
27
  // Initialize an animated opacity value
@@ -89,7 +89,7 @@ const width = useAnimatedValue(100); // Start with a width of 100
89
89
  The `interpolate()` function is useful for mapping values from one range to another, enabling more complex animations.
90
90
 
91
91
  ```javascript
92
- import { useAnimatedValue, animate.div, interpolate } from 'react-ui-animate';
92
+ import { useAnimatedValue, animate, interpolate } from 'react-ui-animate';
93
93
 
94
94
  const width = useAnimatedValue(100); // Start with a width of 100
95
95
 
@@ -175,7 +175,7 @@ The `react-ui-animate` library also provides several hooks for handling differen
175
175
  Here’s an example of using the useDrag hook to enable drag gestures:
176
176
 
177
177
  ```jsx
178
- import { useAnimatedValue, animate.div, useDrag } from 'react-ui-animate';
178
+ import { useAnimatedValue, animate, useDrag } from 'react-ui-animate';
179
179
 
180
180
  export const Draggable = () => {
181
181
  const translateX = useAnimatedValue(0);
@@ -1,16 +1,16 @@
1
- import { UseFluidValueConfig } from '@raidipesh78/re-motion';
1
+ import type { UseAnimatedValueConfig } from './useAnimatedValue';
2
2
  export declare const AnimationConfigUtils: {
3
- ELASTIC: UseFluidValueConfig;
4
- BOUNCE: UseFluidValueConfig;
5
- EASE: UseFluidValueConfig;
6
- STIFF: UseFluidValueConfig;
7
- WOOBLE: UseFluidValueConfig;
8
- EASE_IN: UseFluidValueConfig;
9
- EASE_OUT: UseFluidValueConfig;
10
- EASE_IN_OUT: UseFluidValueConfig;
11
- POWER1: UseFluidValueConfig;
12
- POWER2: UseFluidValueConfig;
13
- POWER3: UseFluidValueConfig;
14
- POWER4: UseFluidValueConfig;
15
- LINEAR: UseFluidValueConfig;
3
+ ELASTIC: UseAnimatedValueConfig;
4
+ BOUNCE: UseAnimatedValueConfig;
5
+ EASE: UseAnimatedValueConfig;
6
+ STIFF: UseAnimatedValueConfig;
7
+ WOOBLE: UseAnimatedValueConfig;
8
+ EASE_IN: UseAnimatedValueConfig;
9
+ EASE_OUT: UseAnimatedValueConfig;
10
+ EASE_IN_OUT: UseAnimatedValueConfig;
11
+ POWER1: UseAnimatedValueConfig;
12
+ POWER2: UseAnimatedValueConfig;
13
+ POWER3: UseAnimatedValueConfig;
14
+ POWER4: UseAnimatedValueConfig;
15
+ LINEAR: UseAnimatedValueConfig;
16
16
  };
@@ -0,0 +1,7 @@
1
+ import type { AssignValue, UseFluidValueConfig } from './FluidController';
2
+ export declare class FluidArrayController {
3
+ private fluidControllers;
4
+ constructor(values: number[], config?: UseFluidValueConfig);
5
+ setFluid(updateValue: AssignValue[], callback?: () => void): void;
6
+ getFluid(): import("@raidipesh78/re-motion").FluidValue[];
7
+ }
@@ -0,0 +1,32 @@
1
+ import { FluidValue } from '@raidipesh78/re-motion';
2
+ type Fn<T, U> = (value: T) => U;
3
+ export interface UseFluidValueConfig {
4
+ mass?: number;
5
+ tension?: number;
6
+ friction?: number;
7
+ duration?: number;
8
+ easing?: Fn<number, number>;
9
+ immediate?: boolean;
10
+ delay?: number;
11
+ restDistance?: number;
12
+ onChange?: Fn<number, void>;
13
+ onRest?: Fn<number, void>;
14
+ onStart?: Fn<number, void>;
15
+ decay?: boolean;
16
+ velocity?: number;
17
+ deceleration?: number;
18
+ }
19
+ type UpdateValue = {
20
+ toValue?: number;
21
+ config?: UseFluidValueConfig;
22
+ };
23
+ export type AssignValue = UpdateValue | Fn<Fn<UpdateValue, Promise<any>>, void>;
24
+ export declare class FluidController {
25
+ private fluid;
26
+ private defaultConfig?;
27
+ constructor(value: number, config?: UseFluidValueConfig);
28
+ private runAnimation;
29
+ setFluid(updateValue: AssignValue, callback?: (value: number) => void): void;
30
+ getFluid(): FluidValue;
31
+ }
32
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FluidValue } from '@raidipesh78/re-motion';
2
+ type ExtrapolateType = 'extend' | 'identity' | 'clamp';
3
+ export type ExtrapolateConfig = {
4
+ extrapolate?: ExtrapolateType;
5
+ extrapolateLeft?: ExtrapolateType;
6
+ extrapolateRight?: ExtrapolateType;
7
+ };
8
+ export declare const interpolate: (value: FluidValue, inputRange: Array<number>, outputRange: Array<number> | Array<string>, extrapolateConfig?: ExtrapolateConfig) => import("@raidipesh78/re-motion/dist/fluids/FluidInterpolation").FluidInterpolation;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ import { FluidValue } from '@raidipesh78/re-motion';
2
+ import { AssignValue, UseFluidValueConfig } from './FluidController';
3
+ export declare const useFluidValue: <T extends number | number[]>(value: T, config?: UseFluidValueConfig) => [T extends number ? FluidValue : FluidValue[], (updateValue: T extends number ? AssignValue : AssignValue[], callback?: () => void) => void];
@@ -0,0 +1,18 @@
1
+ import { FluidValue } from '@raidipesh78/re-motion';
2
+ import type { AssignValue, UseFluidValueConfig } from './FluidController';
3
+ export interface UseMountConfig {
4
+ from: number;
5
+ enter: number | AssignValue;
6
+ exit: number | AssignValue;
7
+ config?: UseFluidValueConfig;
8
+ }
9
+ /**
10
+ * `useMount`
11
+ *
12
+ * applies mounting and unmounting of a component according to state change
13
+ * applying transitions
14
+ *
15
+ * @param state - boolean indicating mount state of a component
16
+ * @param config - the config object `UseMountConfig`
17
+ */
18
+ export declare const useMount: (state: boolean, config: UseMountConfig) => (callback: (animation: FluidValue, mounted: boolean) => React.ReactNode) => import("react").ReactNode;
@@ -1,4 +1,4 @@
1
- import { ExtrapolateConfig } from '@raidipesh78/re-motion';
1
+ import { ExtrapolateConfig } from './core/inerpolate';
2
2
  /**
3
3
  * Maps the input range to the given output range using the specified extrapolation configuration.
4
4
  * The function ensures that the value is either a number or a FluidValue.
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
- import { UseFluidValueConfig } from '@raidipesh78/re-motion';
3
- import type { UpdateValue } from '../useAnimatedValue';
2
+ import type { UpdateValue, UseAnimatedValueConfig } from '../useAnimatedValue';
4
3
  interface MountedBlockProps {
5
4
  state: boolean;
6
5
  children: (animation: {
@@ -9,7 +8,7 @@ interface MountedBlockProps {
9
8
  from?: number;
10
9
  enter?: number | UpdateValue;
11
10
  exit?: number | UpdateValue;
12
- config?: UseFluidValueConfig;
11
+ config?: UseAnimatedValueConfig;
13
12
  }
14
13
  /**
15
14
  * MountedBlock - Higher order component which handles mounting and unmounting of a component.
@@ -18,7 +17,7 @@ interface MountedBlockProps {
18
17
  * @param { number } } from - Number that dictates the beginning state for animation.
19
18
  * @param { number | { toValue: number, config: MountedValueConfig } } enter - Number that dictates the entry state for animation.
20
19
  * @param { number | { toValue: number, config: MountedValueConfig } } exit - Number that dictates the exit state for animation.
21
- * @param { UseFluidValueConfig } config - Animation configuration for overall animation.
20
+ * @param { UseAnimatedValueConfig } config - Animation configuration for overall animation.
22
21
  */
23
22
  export declare const MountedBlock: ({ state, children, from, enter, exit, config, }: MountedBlockProps) => import("react/jsx-runtime").JSX.Element;
24
23
  export {};
@@ -1,4 +1,4 @@
1
- import { UseFluidValueConfig } from '@raidipesh78/re-motion';
1
+ import type { UseFluidValueConfig } from './core/FluidController';
2
2
  export interface UseAnimatedValueConfig extends UseFluidValueConfig {
3
3
  }
4
4
  type AssignValue = {
@@ -8,14 +8,14 @@ type AssignValue = {
8
8
  export type UpdateValue = AssignValue | ((update: (next: AssignValue) => Promise<any>) => void);
9
9
  /**
10
10
  * `useAnimatedValue` returns an animation value with `.value` and `.currentValue` property which is
11
- * initialized when passed to argument (`initialValue`). The retured value persist until the lifetime of
12
- * a component. It doesnot cast any re-renders which can is very good for performance optimization.
11
+ * initialized when passed to argument (`initialValue`). The returned value persist until the lifetime of
12
+ * a component. It doesn't cast any re-renders which can is very good for performance optimization.
13
13
  *
14
14
  * @param { string | number } initialValue - Initial value
15
15
  * @param { UseAnimatedValueConfig } config - Animation configuration object.
16
16
  */
17
- export declare function useAnimatedValue(initialValue: number, config?: UseAnimatedValueConfig): {
18
- value: any;
19
- currentValue: number;
17
+ export declare function useAnimatedValue<T extends number | number[]>(initialValue: T, config?: UseAnimatedValueConfig): {
18
+ value: T extends number ? any : any[];
19
+ currentValue: T extends number ? number : number[];
20
20
  };
21
21
  export {};
@@ -1,13 +1,14 @@
1
- import { UseMountConfig, FluidValue } from '@raidipesh78/re-motion';
1
+ import { FluidValue } from '@raidipesh78/re-motion';
2
+ import { UseMountConfig } from './core/useMount';
2
3
  export interface UseMountedValueConfig extends UseMountConfig {
3
4
  }
4
5
  /**
5
6
  * `useMountedValue` handles mounting and unmounting of a component which captures current state
6
- * passed as an arugment (`state`) and exposes the shadow state which handles the mount and unmount
7
+ * passed as an argument (`state`) and exposes the shadow state which handles the mount and unmount
7
8
  * of a component.
8
9
  *
9
10
  * @param { boolean } state - Boolean indicating the component should mount or unmount.
10
- * @param { UseMountedValueConfig } config - Animation configuration.
11
+ * @param { UseAnimatedValueConfig } config - Animation configuration.
11
12
  */
12
13
  export declare function useMountedValue(state: boolean, config: UseMountedValueConfig): (cb: (value: {
13
14
  value: FluidValue;
@@ -1,34 +1,30 @@
1
- import type { UseFluidValueConfig } from '@raidipesh78/re-motion';
2
- interface WithOnCallbacks extends Pick<UseFluidValueConfig, 'onRest' | 'onStart' | 'onChange'> {
3
- }
4
- interface WithEaseConfig extends WithOnCallbacks {
5
- }
6
- interface WithSpringConfig extends Pick<UseFluidValueConfig, 'mass' | 'friction' | 'tension'>, WithOnCallbacks {
7
- }
8
- interface WithTimingConfig extends Pick<UseFluidValueConfig, 'duration' | 'easing'>, WithOnCallbacks {
9
- }
10
- interface WithDecayConfig extends Pick<UseFluidValueConfig, 'decay' | 'velocity' | 'deceleration'>, WithOnCallbacks {
1
+ import type { UseAnimatedValueConfig } from './useAnimatedValue';
2
+ interface WithOnCallbacks extends Pick<UseAnimatedValueConfig, 'onRest' | 'onStart' | 'onChange'> {
11
3
  }
12
4
  /**
13
5
  * Creates a default animation configuration.
14
6
  * @param {number} toValue - The target value of the animation.
15
- * @param {UseFluidValueConfig} config - Optional configuration.
16
- * @returns {{ toValue: number; config: UseFluidValueConfig }}
7
+ * @param {UseAnimatedValueConfig} config - Optional configuration.
8
+ * @returns {{ toValue: number; config: UseAnimatedValueConfig }}
17
9
  */
18
- export declare const withConfig: (toValue: number, config?: UseFluidValueConfig) => {
10
+ export declare const withConfig: (toValue: number, config?: UseAnimatedValueConfig) => {
19
11
  toValue: number;
20
- config: UseFluidValueConfig | undefined;
12
+ config: UseAnimatedValueConfig | undefined;
21
13
  };
14
+ interface WithEaseConfig extends WithOnCallbacks {
15
+ }
22
16
  /**
23
17
  * Creates an ease animation configuration.
24
18
  * @param {number} toValue - The target value of the animation.
25
- * @param {UseFluidValueConfig} [config=AnimationConfigUtils.EASE] - Optional ease configuration.
26
- * @returns {{ toValue: number; config: UseFluidValueConfig }}
19
+ * @param {UseAnimatedValueConfig} [config=AnimationConfigUtils.EASE] - Optional ease configuration.
20
+ * @returns {{ toValue: number; config: UseAnimatedValueConfig }}
27
21
  */
28
22
  export declare const withEase: (toValue: number, config?: WithEaseConfig) => {
29
23
  toValue: number;
30
- config: UseFluidValueConfig | undefined;
24
+ config: UseAnimatedValueConfig | undefined;
31
25
  };
26
+ interface WithSpringConfig extends Pick<UseAnimatedValueConfig, 'mass' | 'friction' | 'tension'>, WithOnCallbacks {
27
+ }
32
28
  /**
33
29
  * Creates a spring animation configuration.
34
30
  * @param {number} toValue - The target value of the animation.
@@ -37,8 +33,10 @@ export declare const withEase: (toValue: number, config?: WithEaseConfig) => {
37
33
  */
38
34
  export declare const withSpring: (toValue: number, config?: WithSpringConfig) => {
39
35
  toValue: number;
40
- config: UseFluidValueConfig | undefined;
36
+ config: UseAnimatedValueConfig | undefined;
41
37
  };
38
+ interface WithTimingConfig extends Pick<UseAnimatedValueConfig, 'duration' | 'easing'>, WithOnCallbacks {
39
+ }
42
40
  /**
43
41
  * Creates a timing animation configuration.
44
42
  * @param {number} toValue - The target value of the animation.
@@ -47,37 +45,46 @@ export declare const withSpring: (toValue: number, config?: WithSpringConfig) =>
47
45
  */
48
46
  export declare const withTiming: (toValue: number, config?: WithTimingConfig) => {
49
47
  toValue: number;
50
- config: UseFluidValueConfig | undefined;
48
+ config: UseAnimatedValueConfig | undefined;
51
49
  };
50
+ interface WithDecayConfig extends Pick<UseAnimatedValueConfig, 'velocity' | 'deceleration'>, WithOnCallbacks {
51
+ }
52
52
  /**
53
53
  * Creates a decay animation configuration.
54
54
  * @param {WithDecayConfig} config - Optional decay configuration.
55
55
  * @returns {{ config: WithDecayConfig }}
56
56
  */
57
- export declare const withDecay: (config: WithDecayConfig) => {
58
- config: WithDecayConfig;
57
+ export declare const withDecay: (config?: WithDecayConfig) => {
58
+ config: {
59
+ velocity?: number;
60
+ deceleration?: number;
61
+ onRest?: (value: number) => void;
62
+ onStart?: (value: number) => void;
63
+ onChange?: (value: number) => void;
64
+ decay: boolean;
65
+ };
59
66
  };
60
67
  /**
61
68
  * Creates a sequence of animations that run one after another.
62
- * @param {Array<{ toValue: number; config?: UseFluidValueConfig } | number>} configs - An array of animation configurations or delays.
69
+ * @param {Array<{ toValue: number; config?: UseAnimatedValueConfig } | number>} configs - An array of animation configurations or delays.
63
70
  * @returns {Function} An async function that runs the animations in sequence.
64
71
  */
65
72
  export declare const withSequence: (configs: Array<{
66
73
  toValue?: number;
67
- config?: UseFluidValueConfig;
74
+ config?: UseAnimatedValueConfig;
68
75
  } | number>) => (next: (arg: {
69
76
  toValue?: number;
70
- config?: UseFluidValueConfig;
77
+ config?: UseAnimatedValueConfig;
71
78
  }) => void) => Promise<void>;
72
79
  /**
73
80
  * Adds a delay before the given animation.
74
81
  * @param {number} delay - The delay in milliseconds.
75
- * @param {{ toValue: number; config?: UseFluidValueConfig }} animation - The animation configuration (withTiming | withSpring).
76
- * @returns {{ toValue: number; config: UseFluidValueConfig }} The updated animation configuration with delay.
82
+ * @param {{ toValue: number; config?: UseAnimatedValueConfig }} animation - The animation configuration (withTiming | withSpring).
83
+ * @returns {{ toValue: number; config: UseAnimatedValueConfig }} The updated animation configuration with delay.
77
84
  */
78
85
  export declare const withDelay: (delay: number, animation: {
79
86
  toValue: number;
80
- config?: UseFluidValueConfig;
87
+ config?: UseAnimatedValueConfig;
81
88
  }) => {
82
89
  config: {
83
90
  delay: number;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var t=require("@raidipesh78/re-motion"),e=require("react/jsx-runtime"),n=require("react");function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var r=i(n),o=function(t){return null!=t};function s(e){if(!(o(e)&&e instanceof t.FluidValue))throw console.log(e),new Error("Invalid ".concat(e," type for interpolate function. Expected FluidValue."));return e}function u(e,n){var i=t.useMount(e,n);return function(t){return i((function(e,n){return t({value:e},n)}))}}var c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},c(t,e)};function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var l=function(){return l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},l.apply(this,arguments)};function h(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{c(i.next(t))}catch(t){o(t)}}function u(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}c((i=i.apply(t,e||[])).next())}))}function f(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(n=1,i&&(r=2&u[0]?i.return:u[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,u[1])).done)return r;switch(i=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,i=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(6===u[0]&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=e.call(t,s)}catch(t){u=[6,t],i=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function v(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function p(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var y=function(e){switch(e){case"elastic":return{mass:1,friction:18,tension:250};case"stiff":return{mass:1,friction:18,tension:350};case"wooble":return{mass:1,friction:8,tension:250};case"bounce":return{duration:500,easing:t.Easing.bounce};case"power1":return{duration:500,easing:t.Easing.bezier(.17,.42,.51,.97)};case"power2":return{duration:500,easing:t.Easing.bezier(.07,.11,.13,1)};case"power3":return{duration:500,easing:t.Easing.bezier(.09,.7,.16,1.04)};case"power4":return{duration:500,easing:t.Easing.bezier(.05,.54,0,1.03)};case"linear":return{duration:500,easing:t.Easing.linear};case"easein":return{duration:500,easing:t.Easing.in(t.Easing.ease)};case"easeout":return{duration:500,easing:t.Easing.out(t.Easing.ease)};case"easeinout":return{duration:500,easing:t.Easing.inOut(t.Easing.ease)};default:return{mass:1,friction:26,tension:170}}},d={ELASTIC:y("elastic"),BOUNCE:y("bounce"),EASE:y("ease"),STIFF:y("stiff"),WOOBLE:y("wooble"),EASE_IN:y("easein"),EASE_OUT:y("easeout"),EASE_IN_OUT:y("easeinout"),POWER1:y("power1"),POWER2:y("power2"),POWER3:y("power3"),POWER4:y("power4"),LINEAR:y("linear")};function x(e,n){var i=m(t.useFluidValue(e,l(l({},d.EASE),n)),2),r=i[0],o=i[1],s={value:r,currentValue:r.get()};return new Proxy(s,{set:function(t,e,n){if("value"===e)return"number"==typeof n?queueMicrotask((function(){return o({toValue:n})})):"function"==typeof n&&queueMicrotask((function(){return o(n)})),!0;throw new Error("You cannot set any other property to animation node.")},get:function(t,e){if("value"===e)return r;if("currentValue"===e)return r.get();throw new Error("You cannot access any other property from animation node.")}})}function b(t){return t?1:0}function g(t,e,n){return Math.min(Math.max(t,e),n)}function E(t,e,n){return 0===e||Math.abs(e)===1/0?function(t,e){return Math.pow(t,5*e)}(t,n):t*e*n/(e+n*t)}var w=function(t,e){return{toValue:t,config:e}};function M(t,e){var n=new Map;return e.forEach((function(e){var i=m(e,3),r=i[0],o=i[1],s=i[2],u=void 0!==s&&s;n.set(r,function(t,e,n,i){return void 0===i&&(i=!1),t.forEach((function(t){t.addEventListener(e,n,i)})),function(){t.forEach((function(t){t.removeEventListener(e,n,i)}))}}(t,r,o,u))})),function(t){var e,i;try{for(var r=v(n.entries()),o=r.next();!o.done;o=r.next()){var s=m(o.value,2),u=s[0],c=s[1];if(!t)return void c();-1!==t.indexOf(u)&&c()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}}var _=function(t,e){return{x:t,y:e}},I=function(){function t(){this.lastTimeStamp=Date.now(),this.isActive=!1,this.targetElements=[]}return t.prototype._initEvents=function(){},t.prototype._cancelEvents=function(){this._subscribe&&this._subscribe()},t.prototype.applyCallback=function(t){this.callback=t},t.prototype.applyGesture=function(t){var e=this,n=t.targetElement,i=t.targetElements,r=t.callback,o=t.config;return this.targetElement=n,this.targetElements=i.map((function(t){return t.current})),this.callback=r,this.config=o,this._initEvents(),function(){return e._subscribe&&e._subscribe()}},t._VELOCITY_LIMIT=20,t}(),T=function(t){function e(){var e=t.apply(this,p([],m(arguments),!1))||this;return e.movementStart=_(0,0),e.initialMovement=_(0,0),e.movement=_(0,0),e.previousMovement=_(0,0),e.translation=_(0,0),e.offset=_(0,0),e.velocity=_(0,0),e}return a(e,t),e.prototype._initEvents=function(){(this.targetElement||this.targetElements.length>0)&&(this._subscribe=M([window],[["mousedown",this.pointerDown.bind(this)],["mousemove",this.pointerMove.bind(this)],["mouseup",this.pointerUp.bind(this)],["touchstart",this.pointerDown.bind(this),{passive:!1}],["touchmove",this.pointerMove.bind(this),{passive:!1}],["touchend",this.pointerUp.bind(this)]]))},e.prototype._cancelEvents=function(){this._subscribe&&this._subscribe(["mousedown","mousemove","touchstart","touchmove"])},e.prototype._handleCallback=function(){var t=this;this.callback&&this.callback({args:[this.currentIndex],down:this.isActive,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.translation.x,offsetY:this.translation.y,velocityX:this.velocity.x,velocityY:this.velocity.y,distanceX:Math.abs(this.movement.x),distanceY:Math.abs(this.movement.y),directionX:Math.sign(this.movement.x),directionY:Math.sign(this.movement.y),cancel:function(){t._cancelEvents()}})},e.prototype.pointerDown=function(t){var e;"touchstart"===t.type?this.movementStart={x:t.touches[0].clientX,y:t.touches[0].clientY}:this.movementStart={x:t.clientX,y:t.clientY},this.movement={x:0,y:0},this.offset={x:this.translation.x,y:this.translation.y},this.previousMovement={x:0,y:0},this.velocity={x:0,y:0};var n=this.targetElements.find((function(e){return e===t.target}));if(t.target===this.targetElement||n){this.isActive=!0,t.preventDefault(),n&&(this.currentIndex=this.targetElements.indexOf(n));var i=(null===(e=this.config)||void 0===e?void 0:e.initial)&&this.config.initial(),r=null==i?void 0:i.movementX,o=null==i?void 0:i.movementY;this.initialMovement={x:null!=r?r:0,y:null!=o?o:0},this.movement={x:this.initialMovement.x,y:this.initialMovement.y},this.previousMovement={x:this.initialMovement.x,y:this.initialMovement.y},this._handleCallback()}},e.prototype.pointerMove=function(t){if(this.isActive){t.preventDefault();var e=Date.now(),n=g(e-this.lastTimeStamp,.1,64);this.lastTimeStamp=e;var i=n/1e3;"touchmove"===t.type?this.movement={x:this.initialMovement.x+(t.touches[0].clientX-this.movementStart.x),y:this.initialMovement.y+(t.touches[0].clientY-this.movementStart.y)}:this.movement={x:this.initialMovement.x+(t.clientX-this.movementStart.x),y:this.initialMovement.y+(t.clientY-this.movementStart.y)},this.translation={x:this.offset.x+this.movement.x,y:this.offset.y+this.movement.y},this.velocity={x:g((this.movement.x-this.previousMovement.x)/i/1e3,-1*I._VELOCITY_LIMIT,I._VELOCITY_LIMIT),y:g((this.movement.y-this.previousMovement.y)/i/1e3,-1*I._VELOCITY_LIMIT,I._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()}},e.prototype.pointerUp=function(){this.isActive&&(this.isActive=!1,this._handleCallback(),this._cancelEvents(),this._initEvents())},e}(I),O=function(t){function e(){var e=t.apply(this,p([],m(arguments),!1))||this;return e.movement=_(0,0),e.previousMovement=_(0,0),e.velocity=_(0,0),e.direction=_(0,0),e}return a(e,t),e.prototype._initEvents=function(){this.targetElement?this._subscribe=M([this.targetElement],[["mousemove",this.onMouseMove.bind(this)]]):this.targetElements.length>0?this._subscribe=M(this.targetElements,[["mousemove",this.onMouseMove.bind(this)]]):this._subscribe=M([window],[["mousemove",this.onMouseMove.bind(this)]])},e.prototype._handleCallback=function(){var t;this.callback&&this.callback({args:[this.currentIndex],event:this.event,isMoving:this.isActive,target:null===(t=this.event)||void 0===t?void 0:t.target,mouseX:this.movement.x,mouseY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},e.prototype.onMouseMove=function(t){var e=this,n=this.targetElements.find((function(e){return e===t.target}));n&&(this.currentIndex=this.targetElements.indexOf(n)),this.event=t;var i=Date.now(),r=Math.min(i-this.lastTimeStamp,64);this.lastTimeStamp=i;var o=r/1e3,s=t.clientX,u=t.clientY;this.movement={x:s,y:u},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.direction={x:0,y:0},e.velocity={x:0,y:0},e._handleCallback()}),250);var c=this.movement.x-this.previousMovement.x,a=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(c),y:Math.sign(a)},this.velocity={x:g(c/o/1e3,-1*I._VELOCITY_LIMIT,I._VELOCITY_LIMIT),y:g(a/o/1e3,-1*I._VELOCITY_LIMIT,I._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e}(I),L=function(t){function e(){var e=t.apply(this,p([],m(arguments),!1))||this;return e.movement=_(0,0),e.previousMovement=_(0,0),e.direction=_(0,0),e.velocity=_(0,0),e}return a(e,t),e.prototype._initEvents=function(){this.targetElement?this._subscribe=M([this.targetElement],[["scroll",this.scrollElementListener.bind(this)]]):this._subscribe=M([window],[["scroll",this.scrollListener.bind(this)]])},e.prototype._handleCallback=function(){this.callback&&this.callback({isScrolling:this.isActive,scrollX:this.movement.x,scrollY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},e.prototype.onScroll=function(t){var e=this,n=t.x,i=t.y,r=Date.now(),o=Math.min(r-this.lastTimeStamp,64);this.lastTimeStamp=r;var s=o/1e3;this.movement={x:n,y:i},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.direction={x:0,y:0},e.velocity={x:0,y:0},e._handleCallback()}),250);var u=this.movement.x-this.previousMovement.x,c=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(u),y:Math.sign(c)},this.velocity={x:g(u/s/1e3,-1*I._VELOCITY_LIMIT,I._VELOCITY_LIMIT),y:g(c/s/1e3,-1*I._VELOCITY_LIMIT,I._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e.prototype.scrollListener=function(){var t=window.pageYOffset,e=window.pageXOffset;this.onScroll({x:e,y:t})},e.prototype.scrollElementListener=function(){var t,e,n=(null===(t=this.targetElement)||void 0===t?void 0:t.scrollLeft)||0,i=(null===(e=this.targetElement)||void 0===e?void 0:e.scrollTop)||0;this.onScroll({x:n,y:i})},e}(I),Y=function(t){function e(){var e=t.apply(this,p([],m(arguments),!1))||this;return e.movement=_(0,0),e.previousMovement=_(0,0),e.direction=_(0,0),e.velocity=_(0,0),e.delta=_(0,0),e.offset=_(0,0),e.translation=_(0,0),e}return a(e,t),e.prototype._initEvents=function(){this.targetElement&&(this._subscribe=M([this.targetElement],[["wheel",this.onWheel.bind(this)]]))},e.prototype._handleCallback=function(){this.callback&&this.callback({target:this.targetElement,isWheeling:this.isActive,deltaX:this.delta.x,deltaY:this.delta.y,directionX:this.direction.x,directionY:this.direction.y,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.offset.x,offsetY:this.offset.y,velocityX:this.velocity.x,velocityY:this.velocity.y})},e.prototype.onWheel=function(t){var e=this,n=t.deltaX,i=t.deltaY,r=t.deltaMode,o=Date.now(),s=Math.min(o-this.lastTimeStamp,64);this.lastTimeStamp=o;var u=s/1e3;this.isActive=!0,-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.translation={x:e.offset.x,y:e.offset.y},e._handleCallback(),e.velocity={x:0,y:0},e.movement={x:0,y:0}}),200),1===r?(n*=40,i*=40):2===r&&(n*=800,i*=800),this.delta={x:n,y:i},this.movement={x:this.movement.x+n,y:this.movement.y+i},this.offset={x:this.translation.x+this.movement.x,y:this.translation.y+this.movement.y};var c=this.movement.x-this.previousMovement.x,a=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(c),y:Math.sign(a)},this.velocity={x:g(c/u/1e3,-1*I._VELOCITY_LIMIT,I._VELOCITY_LIMIT),y:g(a/u/1e3,-1*I._VELOCITY_LIMIT,I._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e}(I),k=function(t){var e=r.useRef(),n=r.useRef([]),i=r.useRef(new Map).current;return r.useEffect((function(){var e,n;try{for(var r=v(i.entries()),o=r.next();!o.done;o=r.next()){var s=m(o.value,2)[1],u=s.keyIndex,c=s.gesture,a=m(t[u],3)[2];c.applyCallback(a)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}),[t]),r.useEffect((function(){return t.forEach((function(t,r){var o=m(t,4),s=o[0],u=o[1],c=o[2],a=o[3];queueMicrotask((function(){return i.set(s,{keyIndex:r,gesture:u,unsubscribe:u.applyGesture({targetElement:e.current,targetElements:n.current,callback:c,config:a})})}))})),function(){var t,e;try{for(var n=v(i.entries()),r=n.next();!r.done;r=n.next()){var o=m(r.value,2)[1].unsubscribe;o&&o()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}})),function(t){return null==t?{ref:e}:(n.current[t]=n.current[t]||r.createRef(),{ref:n.current[t]})}};Object.defineProperty(exports,"Easing",{enumerable:!0,get:function(){return t.Easing}}),Object.defineProperty(exports,"animate",{enumerable:!0,get:function(){return t.fluid}}),Object.defineProperty(exports,"makeAnimated",{enumerable:!0,get:function(){return t.makeFluid}}),exports.AnimationConfigUtils=d,exports.MountedBlock=function(t){var n=t.state,i=t.children,r=t.from,o=void 0===r?0:r,s=t.enter,c=void 0===s?1:s,a=t.exit,l=u(n,{from:o,enter:c,exit:void 0===a?0:a,config:t.config});return e.jsx(e.Fragment,{children:l((function(t,e){return e&&i({value:t.value})}))})},exports.ScrollableBlock=function(t){var n=t.children,i=t.direction,o=void 0===i?"single":i,s=t.animationConfig,u=t.threshold,c=void 0===u?.2:u,a=r.useRef(null),l=x(0,s);return r.useEffect((function(){var t=a.current,e=new IntersectionObserver((function(t){m(t,1)[0].isIntersecting?l.value=1:"both"===o&&(l.value=0)}),{root:null,threshold:c});return t&&e.observe(t),function(){t&&e.unobserve(t)}}),[]),e.jsx("div",{ref:a,children:n&&n({value:l.value})})},exports.TransitionBlock=function(t){var n=t.state,i=t.children,r=t.config,o=x(b(n),r);return e.jsx(e.Fragment,{children:i({value:o.value})})},exports.bInterpolate=function(e,n,i,r){var o=s(e);return t.interpolate(o,[0,1],[n,i],r)},exports.bin=b,exports.clamp=g,exports.delay=function(t){return new Promise((function(e){setTimeout((function(){return e(null)}),t)}))},exports.interpolate=function(e,n,i,r){var o=s(e);return t.interpolate(o,n,i,r)},exports.mix=function(t,e,n){return e*(1-t)+n*t},exports.move=function(t,e,n){var i=t[e],r=t.length,o=e-n;if(o>0)return p(p(p(p([],m(t.slice(0,n)),!1),[i],!1),m(t.slice(n,e)),!1),m(t.slice(e+1,r)),!1);if(o<0){var s=n+1;return p(p(p(p([],m(t.slice(0,e)),!1),m(t.slice(e+1,s)),!1),[i],!1),m(t.slice(s,r)),!1)}return t},exports.rubberClamp=function(t,e,n,i){return void 0===i&&(i=.15),0===i?g(t,e,n):t<e?-E(e-t,n-e,i)+e:t>n?+E(t-n,n-e,i)+n:t},exports.snapTo=function(t,e,n){var i=t+.2*e,r=function(t){return Math.abs(t-i)},o=n.map(r),s=Math.min.apply(Math,p([],m(o),!1));return n.reduce((function(t,e){return r(e)===s?e:t}))},exports.useAnimatedValue=x,exports.useDrag=function(t,e){var n=r.useRef(new T).current;return k([["drag",n,t,e]])},exports.useGesture=function(t){var e=t.onDrag,n=t.onWheel,i=t.onScroll,o=t.onMouseMove,s=r.useRef(new T).current,u=r.useRef(new Y).current,c=r.useRef(new L).current,a=r.useRef(new O).current;return k([["drag",s,e],["wheel",u,n],["scroll",c,i],["move",a,o]])},exports.useMeasure=function(t,e){var i=n.useRef(null),r=n.useRef([]),o=n.useRef(t);return n.useEffect((function(){return o.current=t,function(){o.current=function(){return!1}}}),e),n.useEffect((function(){var t=i.current||document.documentElement,e=r.current,n=new ResizeObserver((function(e){var n=m(e,1)[0].target.getBoundingClientRect(),i=n.left,r=n.top,s=n.width,u=n.height,c=window.pageXOffset,a=window.pageYOffset;if(o){if(t===document.documentElement)return;o.current({left:i+c,top:r+a,width:s,height:u,vLeft:i,vTop:r})}})),s=new ResizeObserver((function(t){var e=[],n=[],i=[],r=[],s=[],u=[];t.forEach((function(t){var o=t.target.getBoundingClientRect(),c=o.left,a=o.top,l=o.width,h=o.height,f=c+window.pageXOffset,v=a+window.pageYOffset;e.push(f),n.push(v),i.push(l),r.push(h),s.push(c),u.push(a)})),o&&o.current({left:e,top:n,width:i,height:r,vLeft:s,vTop:u})}));return t&&(t===document.documentElement&&e.length>0?e.forEach((function(t){s.observe(t.current)})):n.observe(t)),function(){t&&(t===document.documentElement&&e.length>0?e.forEach((function(t){s.unobserve(t.current)})):n.unobserve(t))}}),[]),function(t){return null==t?{ref:i}:(r.current[t]=r.current[t]||n.createRef(),{ref:r.current[t]})}},exports.useMountedValue=u,exports.useMouseMove=function(t){var e=r.useRef(new O).current;return k([["move",e,t]])},exports.useOutsideClick=function(t,e,i){var r=n.useRef();r.current||(r.current=e),n.useEffect((function(){return r.current=e,function(){r.current=function(){return!1}}}),i),n.useEffect((function(){var e=M([document],[["click",function(e){var n;(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.contains(e.target))||r.current&&r.current(e)}]]);return function(){return e&&e()}}),[])},exports.useScroll=function(t){var e=r.useRef(new L).current;return k([["scroll",e,t]])},exports.useWheel=function(t){var e=r.useRef(new Y).current;return k([["wheel",e,t]])},exports.useWindowDimension=function(t,e){var i=n.useRef({width:0,height:0,innerWidth:0,innerHeight:0}),r=n.useRef(t);n.useEffect((function(){return r.current=t,function(){r.current=function(){return!1}}}),e),n.useEffect((function(){var t=new ResizeObserver((function(t){var e=m(t,1)[0].target,n=e.clientWidth,o=e.clientHeight,s=window.innerWidth,u=window.innerHeight;i.current={width:n,height:o,innerWidth:s,innerHeight:u},r&&r.current(l({},i.current))}));return t.observe(document.documentElement),function(){return t.unobserve(document.documentElement)}}),[])},exports.withConfig=w,exports.withDecay=function(t){return{config:t}},exports.withDelay=function(t,e){return l(l({},e),{config:l(l({},e.config),{delay:t})})},exports.withEase=function(t,e){return void 0===e&&(e=d.EASE),w(t,e)},exports.withSequence=function(t){return function(e){return h(void 0,void 0,void 0,(function(){var n,i,r,o,s,u;return f(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,7]),n=v(t),i=n.next(),c.label=1;case 1:return i.done?[3,4]:(r=i.value,[4,e("number"==typeof r?{toValue:r}:r)]);case 2:c.sent(),c.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return o=c.sent(),s={error:o},[3,7];case 6:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(s)throw s.error}return[7];case 7:return[2]}}))}))}},exports.withSpring=function(t,e){return void 0===e&&(e=d.ELASTIC),w(t,e)},exports.withTiming=function(t,e){return void 0===e&&(e={duration:250}),w(t,e)};
1
+ var t=require("@raidipesh78/re-motion"),e=require("react/jsx-runtime"),n=require("react");function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var r=i(n),o=function(t,e,n,i){return t.interpolate(e,n,i)},s=function(t){return null!=t};function u(e){if(!(s(e)&&e instanceof t.FluidValue))throw console.log(e),new Error("Invalid ".concat(e," type for interpolate function. Expected FluidValue."));return e}var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)};function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var l=function(){return l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},l.apply(this,arguments)};function f(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))}function h(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(n=1,i&&(r=2&u[0]?i.return:u[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,u[1])).done)return r;switch(i=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,i=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(6===u[0]&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=e.call(t,s)}catch(t){u=[6,t],i=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function v(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function d(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var p=function(){function e(e,n){this.fluid=new t.FluidValue(e),this.defaultConfig=n}return e.prototype.runAnimation=function(e,n){var i=l(l({},this.defaultConfig),e.config);this.fluid.removeAllListeners(),(null==i?void 0:i.onStart)&&i.onStart(this.fluid.get()),(null==i?void 0:i.onChange)&&this.fluid.addListener((function(t){var e;return null===(e=null==i?void 0:i.onChange)||void 0===e?void 0:e.call(i,t)}));var r=function(t){var e,r=t.finished,o=t.value;r&&(null===(e=null==i?void 0:i.onRest)||void 0===e||e.call(i,o),null==n||n(o))};if(s(null==i?void 0:i.duration)||(null==i?void 0:i.immediate)){if(!s(e.toValue))throw new Error("No `toValue` is defined");var o={toValue:e.toValue,delay:null==i?void 0:i.delay,duration:(null==i?void 0:i.immediate)?0:null==i?void 0:i.duration,easing:null==i?void 0:i.easing};t.timing(this.fluid,o).start(r)}else if(null==i?void 0:i.decay){var u={velocity:null==i?void 0:i.velocity,deceleration:null==i?void 0:i.deceleration,delay:null==i?void 0:i.delay};t.decay(this.fluid,u).start(r)}else{if(!s(e.toValue))throw new Error("No `toValue` is defined");var a={toValue:e.toValue,delay:null==i?void 0:i.delay,mass:null==i?void 0:i.mass,tension:null==i?void 0:i.tension,friction:null==i?void 0:i.friction,restDistance:null==i?void 0:i.restDistance};t.spring(this.fluid,a).start(r)}},e.prototype.setFluid=function(t,e){var n=this;t&&("function"==typeof t?t((function(t){return new Promise((function(i){n.runAnimation(t,(function(n){i(t),e&&e(n)}))}))})):this.runAnimation(t,e))},e.prototype.getFluid=function(){return this.fluid},e}(),y=function(){function t(t,e){this.fluidControllers=t.map((function(t){return new p(t,e)}))}return t.prototype.setFluid=function(t,e){this.fluidControllers.map((function(n,i){n.setFluid(t[i],e)}))},t.prototype.getFluid=function(){return this.fluidControllers.map((function(t){return t.getFluid()}))},t}(),g=function(t,e){var i=n.useRef(Array.isArray(t)?new y(t,e):new p(t,e)).current,r=n.useCallback((function(t,e){i.setFluid(t,e)}),[]);return[n.useMemo((function(){return i.getFluid()}),[]),r]};function b(t,e){var i=function(t,e){var i=m(n.useState(!1),2),r=i[0],o=i[1],s=n.useRef(e).current,u=s.from,a=s.enter,c=s.exit,l=s.config,f=m(g(u,l),2),h=f[0],v=f[1];return n.useLayoutEffect((function(){t?(o(!0),queueMicrotask((function(){return v("number"==typeof a?{toValue:a,config:l}:a)}))):v("number"==typeof c?{toValue:c,config:l}:c,(function(){o(!1),h.getSubscriptions().forEach((function(t){return h.removeSubscription(t)}))}))}),[t,e]),function(t){return t(h,r)}}(t,e);return function(t){return i((function(e,n){return t({value:e},n)}))}}var x=function(e){switch(e){case"elastic":return{mass:1,friction:18,tension:250};case"stiff":return{mass:1,friction:18,tension:350};case"wooble":return{mass:1,friction:8,tension:250};case"bounce":return{duration:500,easing:t.Easing.bounce};case"power1":return{duration:500,easing:t.Easing.bezier(.17,.42,.51,.97)};case"power2":return{duration:500,easing:t.Easing.bezier(.07,.11,.13,1)};case"power3":return{duration:500,easing:t.Easing.bezier(.09,.7,.16,1.04)};case"power4":return{duration:500,easing:t.Easing.bezier(.05,.54,0,1.03)};case"linear":return{duration:500,easing:t.Easing.linear};case"easein":return{duration:500,easing:t.Easing.in(t.Easing.ease)};case"easeout":return{duration:500,easing:t.Easing.out(t.Easing.ease)};case"easeinout":return{duration:500,easing:t.Easing.inOut(t.Easing.ease)};default:return{mass:1,friction:26,tension:170}}},E={ELASTIC:x("elastic"),BOUNCE:x("bounce"),EASE:x("ease"),STIFF:x("stiff"),WOOBLE:x("wooble"),EASE_IN:x("easein"),EASE_OUT:x("easeout"),EASE_IN_OUT:x("easeinout"),POWER1:x("power1"),POWER2:x("power2"),POWER3:x("power3"),POWER4:x("power4"),LINEAR:x("linear")},w=function(t){return"number"==typeof t?{toValue:t}:t};function M(t,e){var i=n.useRef(!0),r=m(g(t,l(l({},E.EASE),e)),2),o=r[0],s=r[1],u=Array.isArray(o)?o.map((function(t){return t.get()})):o.get(),a={value:o,currentValue:u},c=n.useCallback((function(t){var e=w(t);Array.isArray(t)?s(t.map((function(t){return w(t)}))):queueMicrotask((function(){return s(e)}))}),[]);return n.useLayoutEffect((function(){i.current||c(t),i.current=!1}),[t,e]),new Proxy(a,{set:function(t,e,n){if("value"===e)return c(n),!0;throw new Error("You cannot set any other property to animation node.")},get:function(t,e){if("value"===e)return o;if("currentValue"===e)return Array.isArray(o)?o.map((function(t){return t.get()})):o.get();throw new Error("You cannot access any other property from animation node.")}})}function _(t){return t?1:0}function I(t,e,n){return Math.min(Math.max(t,e),n)}function T(t,e,n){return 0===e||Math.abs(e)===1/0?function(t,e){return Math.pow(t,5*e)}(t,n):t*e*n/(e+n*t)}var O=function(t,e){return{toValue:t,config:e}};function A(t,e){var n=new Map;return e.forEach((function(e){var i=m(e,3),r=i[0],o=i[1],s=i[2],u=void 0!==s&&s;n.set(r,function(t,e,n,i){return void 0===i&&(i=!1),t.forEach((function(t){t.addEventListener(e,n,i)})),function(){t.forEach((function(t){t.removeEventListener(e,n,i)}))}}(t,r,o,u))})),function(t){var e,i;try{for(var r=v(n.entries()),o=r.next();!o.done;o=r.next()){var s=m(o.value,2),u=s[0],a=s[1];if(!t)return void a();-1!==t.indexOf(u)&&a()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}}var C=function(t,e){return{x:t,y:e}},L=function(){function t(){this.lastTimeStamp=Date.now(),this.isActive=!1,this.targetElements=[]}return t.prototype._initEvents=function(){},t.prototype._cancelEvents=function(){this._subscribe&&this._subscribe()},t.prototype.applyCallback=function(t){this.callback=t},t.prototype.applyGesture=function(t){var e=this,n=t.targetElement,i=t.targetElements,r=t.callback,o=t.config;return this.targetElement=n,this.targetElements=i.map((function(t){return t.current})),this.callback=r,this.config=o,this._initEvents(),function(){return e._subscribe&&e._subscribe()}},t._VELOCITY_LIMIT=20,t}(),S=function(t){function e(){var e=t.apply(this,d([],m(arguments),!1))||this;return e.movementStart=C(0,0),e.initialMovement=C(0,0),e.movement=C(0,0),e.previousMovement=C(0,0),e.translation=C(0,0),e.offset=C(0,0),e.velocity=C(0,0),e}return c(e,t),e.prototype._initEvents=function(){(this.targetElement||this.targetElements.length>0)&&(this._subscribe=A([window],[["mousedown",this.pointerDown.bind(this)],["mousemove",this.pointerMove.bind(this)],["mouseup",this.pointerUp.bind(this)],["touchstart",this.pointerDown.bind(this),{passive:!1}],["touchmove",this.pointerMove.bind(this),{passive:!1}],["touchend",this.pointerUp.bind(this)]]))},e.prototype._cancelEvents=function(){this._subscribe&&this._subscribe(["mousedown","mousemove","touchstart","touchmove"])},e.prototype._handleCallback=function(){var t=this;this.callback&&this.callback({args:[this.currentIndex],down:this.isActive,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.translation.x,offsetY:this.translation.y,velocityX:this.velocity.x,velocityY:this.velocity.y,distanceX:Math.abs(this.movement.x),distanceY:Math.abs(this.movement.y),directionX:Math.sign(this.movement.x),directionY:Math.sign(this.movement.y),cancel:function(){t._cancelEvents()}})},e.prototype.pointerDown=function(t){var e;"touchstart"===t.type?this.movementStart={x:t.touches[0].clientX,y:t.touches[0].clientY}:this.movementStart={x:t.clientX,y:t.clientY},this.movement={x:0,y:0},this.offset={x:this.translation.x,y:this.translation.y},this.previousMovement={x:0,y:0},this.velocity={x:0,y:0};var n=this.targetElements.find((function(e){return e===t.target}));if(t.target===this.targetElement||n){this.isActive=!0,t.preventDefault(),n&&(this.currentIndex=this.targetElements.indexOf(n));var i=(null===(e=this.config)||void 0===e?void 0:e.initial)&&this.config.initial(),r=null==i?void 0:i.movementX,o=null==i?void 0:i.movementY;this.initialMovement={x:null!=r?r:0,y:null!=o?o:0},this.movement={x:this.initialMovement.x,y:this.initialMovement.y},this.previousMovement={x:this.initialMovement.x,y:this.initialMovement.y},this._handleCallback()}},e.prototype.pointerMove=function(t){if(this.isActive){t.preventDefault();var e=Date.now(),n=I(e-this.lastTimeStamp,.1,64);this.lastTimeStamp=e;var i=n/1e3;"touchmove"===t.type?this.movement={x:this.initialMovement.x+(t.touches[0].clientX-this.movementStart.x),y:this.initialMovement.y+(t.touches[0].clientY-this.movementStart.y)}:this.movement={x:this.initialMovement.x+(t.clientX-this.movementStart.x),y:this.initialMovement.y+(t.clientY-this.movementStart.y)},this.translation={x:this.offset.x+this.movement.x,y:this.offset.y+this.movement.y},this.velocity={x:I((this.movement.x-this.previousMovement.x)/i/1e3,-1*L._VELOCITY_LIMIT,L._VELOCITY_LIMIT),y:I((this.movement.y-this.previousMovement.y)/i/1e3,-1*L._VELOCITY_LIMIT,L._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()}},e.prototype.pointerUp=function(){this.isActive&&(this.isActive=!1,this._handleCallback(),this._cancelEvents(),this._initEvents())},e}(L),k=function(t){function e(){var e=t.apply(this,d([],m(arguments),!1))||this;return e.movement=C(0,0),e.previousMovement=C(0,0),e.velocity=C(0,0),e.direction=C(0,0),e}return c(e,t),e.prototype._initEvents=function(){this.targetElement?this._subscribe=A([this.targetElement],[["mousemove",this.onMouseMove.bind(this)]]):this.targetElements.length>0?this._subscribe=A(this.targetElements,[["mousemove",this.onMouseMove.bind(this)]]):this._subscribe=A([window],[["mousemove",this.onMouseMove.bind(this)]])},e.prototype._handleCallback=function(){var t;this.callback&&this.callback({args:[this.currentIndex],event:this.event,isMoving:this.isActive,target:null===(t=this.event)||void 0===t?void 0:t.target,mouseX:this.movement.x,mouseY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},e.prototype.onMouseMove=function(t){var e=this,n=this.targetElements.find((function(e){return e===t.target}));n&&(this.currentIndex=this.targetElements.indexOf(n)),this.event=t;var i=Date.now(),r=Math.min(i-this.lastTimeStamp,64);this.lastTimeStamp=i;var o=r/1e3,s=t.clientX,u=t.clientY;this.movement={x:s,y:u},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.direction={x:0,y:0},e.velocity={x:0,y:0},e._handleCallback()}),250);var a=this.movement.x-this.previousMovement.x,c=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(a),y:Math.sign(c)},this.velocity={x:I(a/o/1e3,-1*L._VELOCITY_LIMIT,L._VELOCITY_LIMIT),y:I(c/o/1e3,-1*L._VELOCITY_LIMIT,L._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e}(L),Y=function(t){function e(){var e=t.apply(this,d([],m(arguments),!1))||this;return e.movement=C(0,0),e.previousMovement=C(0,0),e.direction=C(0,0),e.velocity=C(0,0),e}return c(e,t),e.prototype._initEvents=function(){this.targetElement?this._subscribe=A([this.targetElement],[["scroll",this.scrollElementListener.bind(this)]]):this._subscribe=A([window],[["scroll",this.scrollListener.bind(this)]])},e.prototype._handleCallback=function(){this.callback&&this.callback({isScrolling:this.isActive,scrollX:this.movement.x,scrollY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},e.prototype.onScroll=function(t){var e=this,n=t.x,i=t.y,r=Date.now(),o=Math.min(r-this.lastTimeStamp,64);this.lastTimeStamp=r;var s=o/1e3;this.movement={x:n,y:i},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.direction={x:0,y:0},e.velocity={x:0,y:0},e._handleCallback()}),250);var u=this.movement.x-this.previousMovement.x,a=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(u),y:Math.sign(a)},this.velocity={x:I(u/s/1e3,-1*L._VELOCITY_LIMIT,L._VELOCITY_LIMIT),y:I(a/s/1e3,-1*L._VELOCITY_LIMIT,L._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e.prototype.scrollListener=function(){var t=window.pageYOffset,e=window.pageXOffset;this.onScroll({x:e,y:t})},e.prototype.scrollElementListener=function(){var t,e,n=(null===(t=this.targetElement)||void 0===t?void 0:t.scrollLeft)||0,i=(null===(e=this.targetElement)||void 0===e?void 0:e.scrollTop)||0;this.onScroll({x:n,y:i})},e}(L),V=function(t){function e(){var e=t.apply(this,d([],m(arguments),!1))||this;return e.movement=C(0,0),e.previousMovement=C(0,0),e.direction=C(0,0),e.velocity=C(0,0),e.delta=C(0,0),e.offset=C(0,0),e.translation=C(0,0),e}return c(e,t),e.prototype._initEvents=function(){this.targetElement&&(this._subscribe=A([this.targetElement],[["wheel",this.onWheel.bind(this)]]))},e.prototype._handleCallback=function(){this.callback&&this.callback({target:this.targetElement,isWheeling:this.isActive,deltaX:this.delta.x,deltaY:this.delta.y,directionX:this.direction.x,directionY:this.direction.y,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.offset.x,offsetY:this.offset.y,velocityX:this.velocity.x,velocityY:this.velocity.y})},e.prototype.onWheel=function(t){var e=this,n=t.deltaX,i=t.deltaY,r=t.deltaMode,o=Date.now(),s=Math.min(o-this.lastTimeStamp,64);this.lastTimeStamp=o;var u=s/1e3;this.isActive=!0,-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.translation={x:e.offset.x,y:e.offset.y},e._handleCallback(),e.velocity={x:0,y:0},e.movement={x:0,y:0}}),200),1===r?(n*=40,i*=40):2===r&&(n*=800,i*=800),this.delta={x:n,y:i},this.movement={x:this.movement.x+n,y:this.movement.y+i},this.offset={x:this.translation.x+this.movement.x,y:this.translation.y+this.movement.y};var a=this.movement.x-this.previousMovement.x,c=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(a),y:Math.sign(c)},this.velocity={x:I(a/u/1e3,-1*L._VELOCITY_LIMIT,L._VELOCITY_LIMIT),y:I(c/u/1e3,-1*L._VELOCITY_LIMIT,L._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e}(L),R=function(t){var e=r.useRef(),n=r.useRef([]),i=r.useRef(new Map).current;return r.useEffect((function(){var e,n;try{for(var r=v(i.entries()),o=r.next();!o.done;o=r.next()){var s=m(o.value,2)[1],u=s.keyIndex,a=s.gesture,c=m(t[u],3)[2];a.applyCallback(c)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}),[t]),r.useEffect((function(){return t.forEach((function(t,r){var o=m(t,4),s=o[0],u=o[1],a=o[2],c=o[3];queueMicrotask((function(){return i.set(s,{keyIndex:r,gesture:u,unsubscribe:u.applyGesture({targetElement:e.current,targetElements:n.current,callback:a,config:c})})}))})),function(){var t,e;try{for(var n=v(i.entries()),r=n.next();!r.done;r=n.next()){var o=m(r.value,2)[1].unsubscribe;o&&o()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}})),function(t){return null==t?{ref:e}:(n.current[t]=n.current[t]||r.createRef(),{ref:n.current[t]})}};Object.defineProperty(exports,"Easing",{enumerable:!0,get:function(){return t.Easing}}),Object.defineProperty(exports,"animate",{enumerable:!0,get:function(){return t.fluid}}),Object.defineProperty(exports,"makeAnimated",{enumerable:!0,get:function(){return t.makeFluid}}),exports.AnimationConfigUtils=E,exports.MountedBlock=function(t){var n=t.state,i=t.children,r=t.from,o=void 0===r?0:r,s=t.enter,u=void 0===s?1:s,a=t.exit,c=b(n,{from:o,enter:u,exit:void 0===a?0:a,config:t.config});return e.jsx(e.Fragment,{children:c((function(t,e){return e&&i({value:t.value})}))})},exports.ScrollableBlock=function(t){var n=t.children,i=t.direction,o=void 0===i?"single":i,s=t.animationConfig,u=t.threshold,a=void 0===u?.2:u,c=r.useRef(null),l=M(0,s);return r.useEffect((function(){var t=c.current,e=new IntersectionObserver((function(t){m(t,1)[0].isIntersecting?l.value=1:"both"===o&&(l.value=0)}),{root:null,threshold:a});return t&&e.observe(t),function(){t&&e.unobserve(t)}}),[]),e.jsx("div",{ref:c,children:n&&n({value:l.value})})},exports.TransitionBlock=function(t){var n=t.state,i=t.children,r=t.config,o=M(_(n),r);return e.jsx(e.Fragment,{children:i({value:o.value})})},exports.bInterpolate=function(t,e,n,i){var r=u(t);return o(r,[0,1],[e,n],i)},exports.bin=_,exports.clamp=I,exports.delay=function(t){return new Promise((function(e){setTimeout((function(){return e(null)}),t)}))},exports.interpolate=function(t,e,n,i){var r=u(t);return o(r,e,n,i)},exports.mix=function(t,e,n){return e*(1-t)+n*t},exports.move=function(t,e,n){var i=t[e],r=t.length,o=e-n;if(o>0)return d(d(d(d([],m(t.slice(0,n)),!1),[i],!1),m(t.slice(n,e)),!1),m(t.slice(e+1,r)),!1);if(o<0){var s=n+1;return d(d(d(d([],m(t.slice(0,e)),!1),m(t.slice(e+1,s)),!1),[i],!1),m(t.slice(s,r)),!1)}return t},exports.rubberClamp=function(t,e,n,i){return void 0===i&&(i=.15),0===i?I(t,e,n):t<e?-T(e-t,n-e,i)+e:t>n?+T(t-n,n-e,i)+n:t},exports.snapTo=function(t,e,n){var i=t+.2*e,r=function(t){return Math.abs(t-i)},o=n.map(r),s=Math.min.apply(Math,d([],m(o),!1));return n.reduce((function(t,e){return r(e)===s?e:t}))},exports.useAnimatedValue=M,exports.useDrag=function(t,e){var n=r.useRef(new S).current;return R([["drag",n,t,e]])},exports.useGesture=function(t){var e=t.onDrag,n=t.onWheel,i=t.onScroll,o=t.onMouseMove,s=r.useRef(new S).current,u=r.useRef(new V).current,a=r.useRef(new Y).current,c=r.useRef(new k).current;return R([["drag",s,e],["wheel",u,n],["scroll",a,i],["move",c,o]])},exports.useMeasure=function(t,e){var i=n.useRef(null),r=n.useRef([]),o=n.useRef(t);return n.useEffect((function(){return o.current=t,function(){o.current=function(){return!1}}}),e),n.useEffect((function(){var t=i.current||document.documentElement,e=r.current,n=new ResizeObserver((function(e){var n=m(e,1)[0].target.getBoundingClientRect(),i=n.left,r=n.top,s=n.width,u=n.height,a=window.pageXOffset,c=window.pageYOffset;if(o){if(t===document.documentElement)return;o.current({left:i+a,top:r+c,width:s,height:u,vLeft:i,vTop:r})}})),s=new ResizeObserver((function(t){var e=[],n=[],i=[],r=[],s=[],u=[];t.forEach((function(t){var o=t.target.getBoundingClientRect(),a=o.left,c=o.top,l=o.width,f=o.height,h=a+window.pageXOffset,v=c+window.pageYOffset;e.push(h),n.push(v),i.push(l),r.push(f),s.push(a),u.push(c)})),o&&o.current({left:e,top:n,width:i,height:r,vLeft:s,vTop:u})}));return t&&(t===document.documentElement&&e.length>0?e.forEach((function(t){s.observe(t.current)})):n.observe(t)),function(){t&&(t===document.documentElement&&e.length>0?e.forEach((function(t){s.unobserve(t.current)})):n.unobserve(t))}}),[]),function(t){return null==t?{ref:i}:(r.current[t]=r.current[t]||n.createRef(),{ref:r.current[t]})}},exports.useMountedValue=b,exports.useMouseMove=function(t){var e=r.useRef(new k).current;return R([["move",e,t]])},exports.useOutsideClick=function(t,e,i){var r=n.useRef();r.current||(r.current=e),n.useEffect((function(){return r.current=e,function(){r.current=function(){return!1}}}),i),n.useEffect((function(){var e=A([document],[["click",function(e){var n;(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.contains(e.target))||r.current&&r.current(e)}]]);return function(){return e&&e()}}),[])},exports.useScroll=function(t){var e=r.useRef(new Y).current;return R([["scroll",e,t]])},exports.useWheel=function(t){var e=r.useRef(new V).current;return R([["wheel",e,t]])},exports.useWindowDimension=function(t,e){var i=n.useRef({width:0,height:0,innerWidth:0,innerHeight:0}),r=n.useRef(t);n.useEffect((function(){return r.current=t,function(){r.current=function(){return!1}}}),e),n.useEffect((function(){var t=new ResizeObserver((function(t){var e=m(t,1)[0].target,n=e.clientWidth,o=e.clientHeight,s=window.innerWidth,u=window.innerHeight;i.current={width:n,height:o,innerWidth:s,innerHeight:u},r&&r.current(l({},i.current))}));return t.observe(document.documentElement),function(){return t.unobserve(document.documentElement)}}),[])},exports.withConfig=O,exports.withDecay=function(t){return{config:l({decay:!0},t)}},exports.withDelay=function(t,e){return l(l({},e),{config:l(l({},e.config),{delay:t})})},exports.withEase=function(t,e){return O(t,l(l({},E.EASE),e))},exports.withSequence=function(t){return function(e){return f(void 0,void 0,void 0,(function(){var n,i,r,o,s,u;return h(this,(function(a){switch(a.label){case 0:a.trys.push([0,5,6,7]),n=v(t),i=n.next(),a.label=1;case 1:return i.done?[3,4]:(r=i.value,[4,e("number"==typeof r?{toValue:r}:r)]);case 2:a.sent(),a.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return o=a.sent(),s={error:o},[3,7];case 6:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(s)throw s.error}return[7];case 7:return[2]}}))}))}},exports.withSpring=function(t,e){return O(t,l(l({},E.ELASTIC),e))},exports.withTiming=function(t,e){return O(t,l({duration:250},e))};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/animation/helpers/isDefined.ts","../src/animation/interpolation.ts","../src/animation/useMountedValue.ts","../src/animation/modules/MountedBlock.tsx","../src/animation/animationType.ts","../src/animation/useAnimatedValue.ts","../src/gestures/helpers/math.ts","../src/animation/modules/TransitionBlock.tsx","../src/animation/withFunctions.ts","../src/gestures/helpers/eventAttacher.ts","../src/gestures/helpers/withDefault.ts","../src/gestures/controllers/Gesture.ts","../src/gestures/controllers/DragGesture.ts","../src/gestures/controllers/MouseMoveGesture.ts","../src/gestures/controllers/ScrollGesture.ts","../src/gestures/controllers/WheelGesture.ts","../src/gestures/hooks/useRecognizer.ts","../src/animation/modules/ScrollableBlock.tsx","../src/animation/helpers/delay.ts","../src/gestures/hooks/useDrag.ts","../src/gestures/hooks/useGesture.ts","../src/hooks/useMeasure.ts","../src/gestures/hooks/useMouseMove.ts","../src/hooks/useOutsideClick.ts","../src/gestures/hooks/useScroll.ts","../src/gestures/hooks/useWheel.ts","../src/hooks/useWindowDimension.ts"],"sourcesContent":["export const isDefined = <T>(value: T): value is NonNullable<T> => {\n return value !== null && value !== undefined;\n};\n","import {\n ExtrapolateConfig,\n FluidValue,\n interpolate as _interpolate,\n} from '@raidipesh78/re-motion';\n\nimport { isDefined } from './helpers';\n\nfunction checkFluidValue(value: unknown): FluidValue {\n if (!isDefined(value) || !(value instanceof FluidValue)) {\n console.log(value);\n throw new Error(\n `Invalid ${value} type for interpolate function. Expected FluidValue.`\n );\n }\n return value;\n}\n\n/**\n * Maps the input range to the given output range using the specified extrapolation configuration.\n * The function ensures that the value is either a number or a FluidValue.\n *\n * @param value - The value to be interpolated, which must be a number or FluidValue.\n * @param inputRange - An array of numbers defining the input range.\n * @param outputRange - An array of numbers or strings defining the output range.\n * @param extrapolateConfig - The extrapolation configuration, which can be \"clamp\", \"identity\", or \"extend\".\n * @returns - The interpolated value, which will be a number or FluidValue.\n * @throws - Will throw an error if the value is not a number or FluidValue.\n */\nexport function interpolate(\n value: any,\n inputRange: number[],\n outputRange: number[] | string[],\n extrapolateConfig?: ExtrapolateConfig\n) {\n const checkedValue = checkFluidValue(value);\n\n return _interpolate(checkedValue, inputRange, outputRange, extrapolateConfig);\n}\n\n/**\n * A shorthand function for interpolate that maps the input range [0, 1] to the given [minOutput, maxOutput].\n * The function ensures that the value is either a number or a FluidValue.\n *\n * @param value - The value to be interpolated, which must be a number or FluidValue.\n * @param minOutput - The minimum value of the output range, which can be a number or string.\n * @param maxOutput - The maximum value of the output range, which can be a number or string.\n * @param extrapolateConfig - The extrapolation configuration, which can be \"clamp\", \"identity\", or \"extend\".\n * @returns - The interpolated value, which will be a number or FluidValue.\n * @throws - Will throw an error if the value is not a number or FluidValue.\n */\nexport function bInterpolate(\n value: any,\n minOutput: number | string,\n maxOutput: number | string,\n extrapolateConfig?: ExtrapolateConfig\n) {\n const checkedValue = checkFluidValue(value);\n\n return _interpolate(\n checkedValue,\n [0, 1],\n [minOutput, maxOutput] as number[] | string[],\n extrapolateConfig\n );\n}\n","import { useMount, UseMountConfig, FluidValue } from '@raidipesh78/re-motion';\n\nexport interface UseMountedValueConfig extends UseMountConfig {}\n\n/**\n * `useMountedValue` handles mounting and unmounting of a component which captures current state\n * passed as an arugment (`state`) and exposes the shadow state which handles the mount and unmount\n * of a component.\n *\n * @param { boolean } state - Boolean indicating the component should mount or unmount.\n * @param { UseMountedValueConfig } config - Animation configuration.\n */\nexport function useMountedValue(state: boolean, config: UseMountedValueConfig) {\n const mv = useMount(state, config);\n return (\n cb: (value: { value: FluidValue }, mounted: boolean) => React.ReactNode\n ) => mv((a, m) => cb({ value: a }, m));\n}\n","import * as React from 'react';\nimport { UseFluidValueConfig } from '@raidipesh78/re-motion';\n\nimport { useMountedValue } from '../useMountedValue';\nimport type { UpdateValue } from '../useAnimatedValue';\n\ninterface MountedBlockProps {\n state: boolean;\n children: (animation: { value: any }) => React.ReactNode;\n from?: number;\n enter?: number | UpdateValue;\n exit?: number | UpdateValue;\n config?: UseFluidValueConfig;\n}\n\n/**\n * MountedBlock - Higher order component which handles mounting and unmounting of a component.\n * @param { boolean } state - Boolean indicating the component should mount or unmount.\n * @param { function } children - Child as a function with `AnimatedValue` on `.value` property.\n * @param { number } } from - Number that dictates the beginning state for animation.\n * @param { number | { toValue: number, config: MountedValueConfig } } enter - Number that dictates the entry state for animation.\n * @param { number | { toValue: number, config: MountedValueConfig } } exit - Number that dictates the exit state for animation.\n * @param { UseFluidValueConfig } config - Animation configuration for overall animation.\n */\nexport const MountedBlock = ({\n state,\n children,\n from = 0,\n enter = 1,\n exit = 0,\n config,\n}: MountedBlockProps) => {\n const open = useMountedValue(state, {\n from,\n enter,\n exit,\n config,\n });\n\n return (\n <>\n {open(\n (animation, mounted) =>\n mounted && children({ value: animation.value as any })\n )}\n </>\n );\n};\n","import { Easing, UseFluidValueConfig } from '@raidipesh78/re-motion';\n\ntype InitialConfigType =\n | 'linear'\n | 'easein'\n | 'easeout'\n | 'easeinout'\n | 'ease'\n | 'power1'\n | 'power2'\n | 'power3'\n | 'power4'\n | 'elastic'\n | 'stiff'\n | 'wooble'\n | 'bounce';\n\nconst getInitialConfig = (\n animationType?: InitialConfigType\n): UseFluidValueConfig => {\n switch (animationType) {\n case 'elastic':\n return { mass: 1, friction: 18, tension: 250 };\n\n case 'stiff':\n return { mass: 1, friction: 18, tension: 350 };\n\n case 'wooble':\n return { mass: 1, friction: 8, tension: 250 };\n\n case 'bounce':\n return { duration: 500, easing: Easing.bounce };\n\n case 'power1':\n return { duration: 500, easing: Easing.bezier(0.17, 0.42, 0.51, 0.97) };\n\n case 'power2':\n return { duration: 500, easing: Easing.bezier(0.07, 0.11, 0.13, 1) };\n\n case 'power3':\n return { duration: 500, easing: Easing.bezier(0.09, 0.7, 0.16, 1.04) };\n\n case 'power4':\n return { duration: 500, easing: Easing.bezier(0.05, 0.54, 0, 1.03) };\n\n case 'linear':\n return { duration: 500, easing: Easing.linear };\n\n case 'easein':\n return { duration: 500, easing: Easing.in(Easing.ease) };\n\n case 'easeout':\n return { duration: 500, easing: Easing.out(Easing.ease) };\n\n case 'easeinout':\n return { duration: 500, easing: Easing.inOut(Easing.ease) };\n\n case 'ease':\n default:\n return { mass: 1, friction: 26, tension: 170 };\n }\n};\n\nexport const AnimationConfigUtils = {\n ELASTIC: getInitialConfig('elastic'),\n BOUNCE: getInitialConfig('bounce'),\n EASE: getInitialConfig('ease'),\n STIFF: getInitialConfig('stiff'),\n WOOBLE: getInitialConfig('wooble'),\n EASE_IN: getInitialConfig('easein'),\n EASE_OUT: getInitialConfig('easeout'),\n EASE_IN_OUT: getInitialConfig('easeinout'),\n POWER1: getInitialConfig('power1'),\n POWER2: getInitialConfig('power2'),\n POWER3: getInitialConfig('power3'),\n POWER4: getInitialConfig('power4'),\n LINEAR: getInitialConfig('linear'),\n};\n","import { useFluidValue, UseFluidValueConfig } from '@raidipesh78/re-motion';\n\nimport { AnimationConfigUtils } from './animationType';\n\nexport interface UseAnimatedValueConfig extends UseFluidValueConfig {}\n\ntype AssignValue = {\n toValue?: number;\n config?: UseAnimatedValueConfig;\n};\n\nexport type UpdateValue =\n | AssignValue\n | ((update: (next: AssignValue) => Promise<any>) => void);\n\n/**\n * `useAnimatedValue` returns an animation value with `.value` and `.currentValue` property which is\n * initialized when passed to argument (`initialValue`). The retured value persist until the lifetime of\n * a component. It doesnot cast any re-renders which can is very good for performance optimization.\n *\n * @param { string | number } initialValue - Initial value\n * @param { UseAnimatedValueConfig } config - Animation configuration object.\n */\nexport function useAnimatedValue(\n initialValue: number,\n config?: UseAnimatedValueConfig\n) {\n const [animation, setAnimation] = useFluidValue(initialValue, {\n ...AnimationConfigUtils.EASE,\n ...config,\n });\n\n const targetObject: {\n value: any;\n currentValue: number;\n } = {\n value: animation,\n currentValue: animation.get(),\n };\n\n return new Proxy(targetObject, {\n set: function (_, key, value: number | UpdateValue) {\n if (key === 'value') {\n if (typeof value === 'number') {\n queueMicrotask(() => setAnimation({ toValue: value }));\n } else if (typeof value === 'function') {\n queueMicrotask(() => setAnimation(value));\n }\n\n return true;\n }\n\n throw new Error('You cannot set any other property to animation node.');\n },\n get: function (_, key) {\n if (key === 'value') {\n return animation;\n }\n\n if (key === 'currentValue') {\n return animation.get();\n }\n\n throw new Error(\n 'You cannot access any other property from animation node.'\n );\n },\n });\n}\n","/**\n * bin(booleanValue)\n * returns 1 if booleanValue == true and 0 if booleanValue == false\n */\nexport function bin(bool: boolean) {\n return bool ? 1 : 0;\n}\n\n/**\n * mix(progress, a, b)\n * linear interpolation between a and b\n */\nexport function mix(perc: number, val1: number, val2: number) {\n return val1 * (1 - perc) + val2 * perc;\n}\n\n/**\n * clamp(value, min, max)\n * clamps value for min and max bounds\n */\nexport function clamp(value: number, lowerbound: number, upperbound: number) {\n return Math.min(Math.max(value, lowerbound), upperbound);\n}\n\nfunction rubber2(distanceFromEdge: number, constant: number) {\n return Math.pow(distanceFromEdge, constant * 5);\n}\n\nfunction rubber(distanceFromEdge: number, dimension: number, constant: number) {\n if (dimension === 0 || Math.abs(dimension) === Infinity)\n return rubber2(distanceFromEdge, constant);\n return (\n (distanceFromEdge * dimension * constant) /\n (dimension + constant * distanceFromEdge)\n );\n}\n\n/**\n * rubberClamp(value, min, max, constant?)\n * constant is optional : default 0.15\n * clamps the value for min and max value and\n * extends beyond min and max values with constant\n * factor to create elastic rubber band effect\n */\nexport function rubberClamp(\n value: number,\n lowerbound: number,\n upperbound: number,\n constant: number = 0.15\n) {\n if (constant === 0) return clamp(value, lowerbound, upperbound);\n\n if (value < lowerbound) {\n return (\n -rubber(lowerbound - value, upperbound - lowerbound, constant) +\n lowerbound\n );\n }\n\n if (value > upperbound) {\n return (\n +rubber(value - upperbound, upperbound - lowerbound, constant) +\n upperbound\n );\n }\n\n return value;\n}\n\n/**\n * snapTo(value, velocity, snapPoints[])\n * Calculates the final snapPoint according to given current value,\n * velocity and snapPoints array\n */\nexport function snapTo(\n value: number,\n velocity: number,\n snapPoints: Array<number>\n): number {\n const finalValue = value + velocity * 0.2;\n const getDiff = (point: number) => Math.abs(point - finalValue);\n const deltas = snapPoints.map(getDiff);\n const minDelta = Math.min(...deltas);\n\n return snapPoints.reduce(function (acc, point) {\n if (getDiff(point) === minDelta) {\n return point;\n } else {\n return acc;\n }\n });\n}\n\n/**\n * move(array, moveIndex, toIndex)\n * move array item from moveIndex to toIndex without array modification\n */\nexport function move(array: Array<any>, moveIndex: number, toIndex: number) {\n const item = array[moveIndex];\n const length = array.length;\n const diff = moveIndex - toIndex;\n\n if (diff > 0) {\n return [\n ...array.slice(0, toIndex),\n item,\n ...array.slice(toIndex, moveIndex),\n ...array.slice(moveIndex + 1, length),\n ];\n } else if (diff < 0) {\n const targetIndex = toIndex + 1;\n return [\n ...array.slice(0, moveIndex),\n ...array.slice(moveIndex + 1, targetIndex),\n item,\n ...array.slice(targetIndex, length),\n ];\n }\n return array;\n}\n","import * as React from 'react';\n\nimport { bin } from '../../gestures/helpers/math';\nimport { useAnimatedValue, UseAnimatedValueConfig } from '../useAnimatedValue';\n\ninterface TransitionBlockProps {\n state: boolean;\n children: (animation: { value: any }) => React.ReactNode;\n config?: UseAnimatedValueConfig;\n}\n\n/**\n * TransitionBlock - Higher order component which animates on state change.\n * @prop { boolean } state - Boolean indicating the current state of animation, usually `false = 0 and true = 1`.\n * @prop { function } children - Child as a function with `AnimatedValue` on `.value` property.\n * @prop { UseAnimatedValueConfig } config - Animation configuration.\n */\nexport const TransitionBlock = ({\n state,\n children,\n config,\n}: TransitionBlockProps) => {\n const amv = useAnimatedValue(bin(state), config);\n\n return <>{children({ value: amv.value })}</>;\n};\n","import type { UseFluidValueConfig } from '@raidipesh78/re-motion';\n\nimport { AnimationConfigUtils } from './animationType';\n\n// Base interfaces for callbacks\ninterface WithOnCallbacks\n extends Pick<UseFluidValueConfig, 'onRest' | 'onStart' | 'onChange'> {}\n\n// Configuration interfaces\ninterface WithEaseConfig extends WithOnCallbacks {}\ninterface WithSpringConfig\n extends Pick<UseFluidValueConfig, 'mass' | 'friction' | 'tension'>,\n WithOnCallbacks {}\ninterface WithTimingConfig\n extends Pick<UseFluidValueConfig, 'duration' | 'easing'>,\n WithOnCallbacks {}\ninterface WithDecayConfig\n extends Pick<UseFluidValueConfig, 'decay' | 'velocity' | 'deceleration'>,\n WithOnCallbacks {}\n\n/**\n * Creates a default animation configuration.\n * @param {number} toValue - The target value of the animation.\n * @param {UseFluidValueConfig} config - Optional configuration.\n * @returns {{ toValue: number; config: UseFluidValueConfig }}\n */\nexport const withConfig = (toValue: number, config?: UseFluidValueConfig) => ({\n toValue,\n config,\n});\n\n/**\n * Creates an ease animation configuration.\n * @param {number} toValue - The target value of the animation.\n * @param {UseFluidValueConfig} [config=AnimationConfigUtils.EASE] - Optional ease configuration.\n * @returns {{ toValue: number; config: UseFluidValueConfig }}\n */\nexport const withEase = (\n toValue: number,\n config: WithEaseConfig = AnimationConfigUtils.EASE\n) => withConfig(toValue, config);\n\n/**\n * Creates a spring animation configuration.\n * @param {number} toValue - The target value of the animation.\n * @param {WithSpringConfig} [config=AnimationConfigUtils.ELASTIC] - Optional spring configuration.\n * @returns {{ toValue: number; config: WithSpringConfig }}\n */\nexport const withSpring = (\n toValue: number,\n config: WithSpringConfig = AnimationConfigUtils.ELASTIC\n) => withConfig(toValue, config);\n\n/**\n * Creates a timing animation configuration.\n * @param {number} toValue - The target value of the animation.\n * @param {WithTimingConfig} [config={ duration: 250 }] - Optional timing configuration.\n * @returns {{ toValue: number; config: WithTimingConfig }}\n */\nexport const withTiming = (\n toValue: number,\n config: WithTimingConfig = { duration: 250 }\n) => withConfig(toValue, config);\n\n/**\n * Creates a decay animation configuration.\n * @param {WithDecayConfig} config - Optional decay configuration.\n * @returns {{ config: WithDecayConfig }}\n */\nexport const withDecay = (config: WithDecayConfig) => ({\n config,\n});\n\n/**\n * Creates a sequence of animations that run one after another.\n * @param {Array<{ toValue: number; config?: UseFluidValueConfig } | number>} configs - An array of animation configurations or delays.\n * @returns {Function} An async function that runs the animations in sequence.\n */\nexport const withSequence = (\n configs: Array<\n | {\n toValue?: number;\n config?: UseFluidValueConfig;\n }\n | number\n >\n) => {\n return async (\n next: (arg: { toValue?: number; config?: UseFluidValueConfig }) => void\n ) => {\n for (const config of configs) {\n await next(typeof config === 'number' ? { toValue: config } : config);\n }\n };\n};\n\n/**\n * Adds a delay before the given animation.\n * @param {number} delay - The delay in milliseconds.\n * @param {{ toValue: number; config?: UseFluidValueConfig }} animation - The animation configuration (withTiming | withSpring).\n * @returns {{ toValue: number; config: UseFluidValueConfig }} The updated animation configuration with delay.\n */\nexport const withDelay = (\n delay: number,\n animation: { toValue: number; config?: UseFluidValueConfig }\n) => ({\n ...animation,\n config: {\n ...animation.config,\n delay,\n },\n});\n","type MouseEventType =\n | 'click'\n | 'dblclick'\n | 'mousedown'\n | 'mousemove'\n | 'mouseup'\n | 'touchstart'\n | 'touchmove'\n | 'touchend'\n | 'mouseenter'\n | 'mouseleave'\n | 'mouseout'\n | 'mouseover'\n | 'scroll'\n | 'wheel'\n | 'contextmenu';\n\ntype DomTargetTypes = Array<Window | Document | HTMLElement>;\n\n/**\n * Attach single document / window event / HTMLElement\n */\nfunction attachEvent(\n domTargets: DomTargetTypes,\n event: MouseEventType,\n callback: (e: any) => void,\n capture: any = false\n) {\n domTargets.forEach((target) => {\n target.addEventListener(event, callback, capture);\n });\n\n return function () {\n domTargets.forEach((target) => {\n target.removeEventListener(event, callback, capture);\n });\n };\n}\n\n/**\n * Attach multiple document / window event / HTMLElement\n */\nexport function attachEvents(\n domTargets: DomTargetTypes,\n events: Array<\n [event: MouseEventType, callback: (e: any) => void, capture?: any]\n >\n) {\n const subscribers = new Map();\n\n events.forEach(function ([event, callback, capture = false]) {\n subscribers.set(event, attachEvent(domTargets, event, callback, capture));\n });\n\n return function (eventKeys?: Array<string>) {\n for (const [eventKey, subscriber] of subscribers.entries()) {\n if (!eventKeys) {\n subscriber();\n return;\n }\n\n if (eventKeys.indexOf(eventKey) !== -1) {\n subscriber();\n }\n }\n };\n}\n","export const withDefault = (x: number, y: number) => {\n return { x, y };\n};\n","export class Gesture {\n currentIndex?: number;\n lastTimeStamp: number = Date.now();\n isActive: boolean = false;\n targetElement?: HTMLElement; // represents the bounded element\n targetElements: Array<HTMLElement> = []; // represents the bounded elements\n config?: any;\n callback?: <T>(event: T) => void;\n _subscribe?: (eventKeys?: Array<string>) => void;\n static _VELOCITY_LIMIT: number = 20;\n\n // it must be overridden by other child classes\n _initEvents() {}\n\n // cancel events\n // we only canceled down and move events because mouse up\n // will not be triggered\n _cancelEvents() {\n if (this._subscribe) {\n this._subscribe();\n }\n }\n\n // re-apply new callback\n applyCallback(callback: <T>(event: T) => void) {\n this.callback = callback;\n }\n\n // apply gesture\n applyGesture({\n targetElement,\n targetElements,\n callback,\n config,\n }: {\n targetElement?: any;\n targetElements?: any;\n callback: <T>(event: T) => void;\n config?: any;\n }) {\n this.targetElement = targetElement;\n this.targetElements = targetElements.map(\n (element: { current: any }) => element.current\n );\n this.callback = callback;\n this.config = config;\n\n // initialize events\n this._initEvents();\n\n // unbind\n return () => this._subscribe && this._subscribe();\n }\n}\n","import { attachEvents } from '../helpers/eventAttacher';\nimport { clamp } from '../helpers/math';\nimport { withDefault } from '../helpers/withDefault';\nimport { Gesture } from './Gesture';\n\nimport type { Vector2 } from '../types';\n\nexport class DragGesture extends Gesture {\n movementStart: Vector2 = withDefault(0, 0);\n initialMovement: Vector2 = withDefault(0, 0);\n movement: Vector2 = withDefault(0, 0);\n previousMovement: Vector2 = withDefault(0, 0);\n translation: Vector2 = withDefault(0, 0);\n offset: Vector2 = withDefault(0, 0);\n velocity: Vector2 = withDefault(0, 0);\n\n // @override\n // initialize the events\n _initEvents() {\n if (this.targetElement || this.targetElements.length > 0) {\n this._subscribe = attachEvents(\n [window],\n [\n ['mousedown', this.pointerDown.bind(this)],\n ['mousemove', this.pointerMove.bind(this)],\n ['mouseup', this.pointerUp.bind(this)],\n ['touchstart', this.pointerDown.bind(this), { passive: false }],\n ['touchmove', this.pointerMove.bind(this), { passive: false }],\n ['touchend', this.pointerUp.bind(this)],\n ]\n );\n }\n }\n\n // @override - cancel events\n // we only canceled down and move events because mouse up\n // will not be triggered\n _cancelEvents() {\n if (this._subscribe) {\n this._subscribe(['mousedown', 'mousemove', 'touchstart', 'touchmove']);\n }\n }\n\n _handleCallback() {\n if (this.callback) {\n this.callback({\n args: [this.currentIndex],\n down: this.isActive,\n movementX: this.movement.x,\n movementY: this.movement.y,\n offsetX: this.translation.x,\n offsetY: this.translation.y,\n velocityX: this.velocity.x,\n velocityY: this.velocity.y,\n distanceX: Math.abs(this.movement.x),\n distanceY: Math.abs(this.movement.y),\n directionX: Math.sign(this.movement.x),\n directionY: Math.sign(this.movement.y),\n cancel: () => {\n this._cancelEvents();\n },\n });\n }\n }\n\n pointerDown(e: any) {\n if (e.type === 'touchstart') {\n this.movementStart = {\n x: e.touches[0].clientX,\n y: e.touches[0].clientY,\n };\n } else {\n this.movementStart = { x: e.clientX, y: e.clientY };\n }\n\n this.movement = { x: 0, y: 0 };\n this.offset = { x: this.translation.x, y: this.translation.y };\n this.previousMovement = { x: 0, y: 0 };\n this.velocity = { x: 0, y: 0 };\n\n // find current selected element\n const currElem = this.targetElements.find((elem: any) => elem === e.target);\n\n if (e.target === this.targetElement || currElem) {\n this.isActive = true;\n e.preventDefault();\n\n // set args\n if (currElem) {\n this.currentIndex = this.targetElements.indexOf(currElem);\n }\n\n // if initial function is defined then call it to get initial movementX and movementY\n // if only select to bounded draggable element\n const initial = this.config?.initial && this.config.initial();\n const initialMovementX = initial?.movementX;\n const initialMovementY = initial?.movementY;\n\n this.initialMovement = {\n x: initialMovementX ?? 0,\n y: initialMovementY ?? 0,\n };\n\n this.movement = {\n x: this.initialMovement.x,\n y: this.initialMovement.y,\n };\n\n this.previousMovement = {\n x: this.initialMovement.x,\n y: this.initialMovement.y,\n };\n\n this._handleCallback();\n }\n }\n\n pointerMove(e: any) {\n if (this.isActive) {\n e.preventDefault();\n const now = Date.now();\n const deltaTime = clamp(now - this.lastTimeStamp, 0.1, 64);\n this.lastTimeStamp = now;\n\n const t = deltaTime / 1000;\n\n if (e.type === 'touchmove') {\n this.movement = {\n x:\n this.initialMovement.x +\n (e.touches[0].clientX - this.movementStart.x),\n y:\n this.initialMovement.y +\n (e.touches[0].clientY - this.movementStart.y),\n };\n } else {\n this.movement = {\n x: this.initialMovement.x + (e.clientX - this.movementStart.x),\n y: this.initialMovement.y + (e.clientY - this.movementStart.y),\n };\n }\n\n this.translation = {\n x: this.offset.x + this.movement.x,\n y: this.offset.y + this.movement.y,\n };\n\n this.velocity = {\n x: clamp(\n (this.movement.x - this.previousMovement.x) / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n y: clamp(\n (this.movement.y - this.previousMovement.y) / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n };\n\n this.previousMovement = {\n x: this.movement.x,\n y: this.movement.y,\n };\n\n this._handleCallback();\n }\n }\n\n pointerUp() {\n if (this.isActive) {\n this.isActive = false;\n this._handleCallback();\n this._cancelEvents();\n this._initEvents();\n }\n }\n}\n","import { attachEvents } from '../helpers/eventAttacher';\nimport { Vector2 } from '../types';\nimport { clamp } from '../helpers/math';\nimport { withDefault } from '../helpers/withDefault';\nimport { Gesture } from './Gesture';\n\nexport class MouseMoveGesture extends Gesture {\n event?: MouseEvent;\n isActiveID?: any;\n movement: Vector2 = withDefault(0, 0);\n previousMovement: Vector2 = withDefault(0, 0);\n velocity: Vector2 = withDefault(0, 0);\n direction: Vector2 = withDefault(0, 0);\n\n // @override\n // initialize the events\n _initEvents() {\n if (this.targetElement) {\n this._subscribe = attachEvents(\n [this.targetElement],\n [['mousemove', this.onMouseMove.bind(this)]]\n );\n } else if (this.targetElements.length > 0) {\n this._subscribe = attachEvents(this.targetElements, [\n ['mousemove', this.onMouseMove.bind(this)],\n ]);\n } else {\n this._subscribe = attachEvents(\n [window],\n [['mousemove', this.onMouseMove.bind(this)]]\n );\n }\n }\n\n _handleCallback() {\n if (this.callback) {\n this.callback({\n args: [this.currentIndex],\n event: this.event,\n isMoving: this.isActive,\n target: this.event?.target,\n mouseX: this.movement.x,\n mouseY: this.movement.y,\n velocityX: this.velocity.x,\n velocityY: this.velocity.y,\n directionX: this.direction.x,\n directionY: this.direction.y,\n });\n }\n }\n\n onMouseMove(e: MouseEvent) {\n // find current selected element\n const currElem = this.targetElements.find((elem: any) => elem === e.target);\n\n // set args\n if (currElem) {\n this.currentIndex = this.targetElements.indexOf(currElem);\n }\n\n this.event = e;\n\n const now: number = Date.now();\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\n this.lastTimeStamp = now;\n const t = deltaTime / 1000; // seconds\n\n const x = e.clientX;\n const y = e.clientY;\n\n this.movement = { x, y };\n\n if (this.isActiveID !== -1) {\n this.isActive = true;\n clearTimeout(this.isActiveID);\n }\n\n this.isActiveID = setTimeout(() => {\n this.isActive = false;\n this.direction = { x: 0, y: 0 };\n this.velocity = { x: 0, y: 0 };\n\n this._handleCallback();\n }, 250); // Debounce 250 milliseconds\n\n const diffX = this.movement.x - this.previousMovement.x;\n const diffY = this.movement.y - this.previousMovement.y;\n\n this.direction = {\n x: Math.sign(diffX),\n y: Math.sign(diffY),\n };\n\n this.velocity = {\n x: clamp(\n diffX / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n y: clamp(\n diffY / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n };\n\n this.previousMovement = { x: this.movement.x, y: this.movement.y };\n\n this._handleCallback();\n }\n}\n","import { attachEvents } from '../helpers/eventAttacher';\nimport { Vector2 } from '../types';\nimport { clamp } from '../helpers/math';\nimport { withDefault } from '../helpers/withDefault';\nimport { Gesture } from './Gesture';\n\nexport class ScrollGesture extends Gesture {\n isActiveID?: any;\n movement: Vector2 = withDefault(0, 0);\n previousMovement: Vector2 = withDefault(0, 0);\n direction: Vector2 = withDefault(0, 0);\n velocity: Vector2 = withDefault(0, 0);\n\n // @override\n // initialize the events\n _initEvents() {\n if (this.targetElement) {\n this._subscribe = attachEvents(\n [this.targetElement],\n [['scroll', this.scrollElementListener.bind(this)]]\n );\n } else {\n this._subscribe = attachEvents(\n [window],\n [['scroll', this.scrollListener.bind(this)]]\n );\n }\n }\n\n _handleCallback() {\n if (this.callback) {\n this.callback({\n isScrolling: this.isActive,\n scrollX: this.movement.x,\n scrollY: this.movement.y,\n velocityX: this.velocity.x,\n velocityY: this.velocity.y,\n directionX: this.direction.x,\n directionY: this.direction.y,\n });\n }\n }\n\n onScroll({ x, y }: Vector2) {\n const now: number = Date.now();\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\n this.lastTimeStamp = now;\n const t = deltaTime / 1000; // seconds\n\n this.movement = { x, y };\n\n // Clear if scrolling\n if (this.isActiveID !== -1) {\n this.isActive = true;\n clearTimeout(this.isActiveID);\n }\n\n this.isActiveID = setTimeout(() => {\n this.isActive = false;\n this.direction = { x: 0, y: 0 };\n\n // Reset Velocity\n this.velocity = { x: 0, y: 0 };\n\n this._handleCallback(); // Debounce 250milliseconds\n }, 250);\n\n const diffX = this.movement.x - this.previousMovement.x;\n const diffY = this.movement.y - this.previousMovement.y;\n\n this.direction = {\n x: Math.sign(diffX),\n y: Math.sign(diffY),\n };\n\n this.velocity = {\n x: clamp(\n diffX / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n y: clamp(\n diffY / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n };\n\n this.previousMovement = {\n x: this.movement.x,\n y: this.movement.y,\n };\n\n this._handleCallback();\n }\n\n scrollListener() {\n const { pageYOffset: y, pageXOffset: x } = window;\n this.onScroll({ x, y });\n }\n\n scrollElementListener() {\n const x = this.targetElement?.scrollLeft || 0;\n const y = this.targetElement?.scrollTop || 0;\n this.onScroll({ x, y });\n }\n}\n","import { attachEvents } from '../helpers/eventAttacher';\nimport { Vector2 } from '../types';\nimport { clamp } from '../helpers/math';\nimport { withDefault } from '../helpers/withDefault';\nimport { Gesture } from './Gesture';\n\nconst LINE_HEIGHT = 40;\nconst PAGE_HEIGHT = 800;\n\nexport class WheelGesture extends Gesture {\n isActiveID?: any;\n movement: Vector2 = withDefault(0, 0);\n previousMovement: Vector2 = withDefault(0, 0);\n direction: Vector2 = withDefault(0, 0);\n velocity: Vector2 = withDefault(0, 0);\n delta: Vector2 = withDefault(0, 0);\n\n // Holds offsets\n offset: Vector2 = withDefault(0, 0);\n translation: Vector2 = withDefault(0, 0);\n\n // @override\n // initialize the events\n _initEvents() {\n if (this.targetElement) {\n this._subscribe = attachEvents(\n [this.targetElement],\n [['wheel', this.onWheel.bind(this)]]\n );\n }\n }\n\n _handleCallback() {\n if (this.callback) {\n this.callback({\n target: this.targetElement,\n isWheeling: this.isActive,\n deltaX: this.delta.x,\n deltaY: this.delta.y,\n directionX: this.direction.x,\n directionY: this.direction.y,\n movementX: this.movement.x,\n movementY: this.movement.y,\n offsetX: this.offset.x,\n offsetY: this.offset.y,\n velocityX: this.velocity.x,\n velocityY: this.velocity.y,\n });\n }\n }\n\n onWheel(event: WheelEvent) {\n let { deltaX, deltaY, deltaMode } = event;\n\n const now: number = Date.now();\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\n this.lastTimeStamp = now;\n const t = deltaTime / 1000; // seconds\n\n this.isActive = true;\n\n if (this.isActiveID !== -1) {\n this.isActive = true;\n clearTimeout(this.isActiveID);\n }\n\n this.isActiveID = setTimeout(() => {\n this.isActive = false;\n this.translation = { x: this.offset.x, y: this.offset.y };\n this._handleCallback();\n\n this.velocity = { x: 0, y: 0 }; // Reset Velocity\n this.movement = { x: 0, y: 0 };\n }, 200);\n\n // normalize wheel values, especially for Firefox\n if (deltaMode === 1) {\n deltaX *= LINE_HEIGHT;\n deltaY *= LINE_HEIGHT;\n } else if (deltaMode === 2) {\n deltaX *= PAGE_HEIGHT;\n deltaY *= PAGE_HEIGHT;\n }\n\n this.delta = { x: deltaX, y: deltaY };\n this.movement = {\n x: this.movement.x + deltaX,\n y: this.movement.y + deltaY,\n };\n this.offset = {\n x: this.translation.x + this.movement.x,\n y: this.translation.y + this.movement.y,\n };\n\n const diffX = this.movement.x - this.previousMovement.x;\n const diffY = this.movement.y - this.previousMovement.y;\n\n this.direction = {\n x: Math.sign(diffX),\n y: Math.sign(diffY),\n };\n\n this.velocity = {\n x: clamp(\n diffX / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n y: clamp(\n diffY / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n };\n\n this.previousMovement = {\n x: this.movement.x,\n y: this.movement.y,\n };\n\n this._handleCallback();\n }\n}\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport * as React from 'react';\n\ntype UseRecognizerHandlerType = Array<\n [\n key: 'drag' | 'wheel' | 'move' | 'scroll',\n gesture: any,\n callback: any,\n config?: any\n ]\n>;\n\nexport const useRecognizer = (handlers: UseRecognizerHandlerType) => {\n const ref = React.useRef<any>();\n const elementRefs = React.useRef<Array<any>>([]);\n const subscribers = React.useRef<\n Map<string, { keyIndex: number; gesture: any; unsubscribe: any }>\n >(new Map()).current;\n\n // re-initiate callback on change\n React.useEffect(() => {\n for (let [, { keyIndex, gesture }] of subscribers.entries()) {\n const [, , callback] = handlers[keyIndex];\n gesture.applyCallback(callback);\n }\n }, [handlers]);\n\n React.useEffect(() => {\n handlers.forEach(([key, gesture, callback, config], keyIndex) => {\n queueMicrotask(() =>\n subscribers.set(key, {\n keyIndex,\n gesture,\n unsubscribe: gesture.applyGesture({\n targetElement: ref.current,\n targetElements: elementRefs.current,\n callback,\n config,\n }),\n })\n );\n });\n\n return () => {\n for (let [, { unsubscribe }] of subscribers.entries()) {\n unsubscribe && unsubscribe();\n }\n };\n });\n\n return (index?: number) => {\n if (index === null || index === undefined) {\n return { ref };\n } else {\n elementRefs.current[index] =\n elementRefs.current[index] || React.createRef();\n\n return { ref: elementRefs.current[index] };\n }\n };\n};\n","import * as React from 'react';\n\nimport { useAnimatedValue, UseAnimatedValueConfig } from '../useAnimatedValue';\n\ninterface ScrollableBlockProps {\n children?: (animation: { value: any }) => React.ReactNode;\n direction?: 'single' | 'both';\n threshold?: number;\n animationConfig?: UseAnimatedValueConfig;\n}\n\n/**\n * ScrollableBlock - Higher order component to handle the entrance or exit animation\n * of a component when it enters or exit the viewport. Accepts child as a function with\n * `AnimatedValue` as its first argument which can be interpolated on input range [0, 1]\n * @prop { function } children - child as a function with `AnimatedValue` as its first argument.\n * @prop { 'single' | 'both' } direction - single applies animation on enter once, both applies on enter and exit.\n * @prop { number } threshold - should be in range 0 to 1 which equivalent to `IntersectionObserver` threshold.\n * @prop { UseAnimatedValueConfig } animationConfig - Animation config\n */\nexport const ScrollableBlock = (props: ScrollableBlockProps) => {\n const {\n children,\n direction = 'single',\n animationConfig,\n threshold = 0.2,\n } = props;\n const scrollableBlockRef = React.useRef<HTMLDivElement>(null);\n const animation = useAnimatedValue(0, animationConfig); // 0: not intersecting | 1: intersecting\n\n React.useEffect(() => {\n const _scrollableBlock = scrollableBlockRef.current;\n\n const observer = new IntersectionObserver(\n function ([entry]) {\n const { isIntersecting } = entry;\n\n if (isIntersecting) {\n animation.value = 1;\n } else {\n if (direction === 'both') animation.value = 0;\n }\n },\n {\n root: null, // FOR VIEWPORT ONLY\n threshold,\n }\n );\n\n if (_scrollableBlock) {\n observer.observe(_scrollableBlock);\n }\n\n return () => {\n if (_scrollableBlock) {\n observer.unobserve(_scrollableBlock);\n }\n };\n }, []);\n\n return (\n <div ref={scrollableBlockRef}>\n {children && children({ value: animation.value })}\n </div>\n );\n};\n","/**\n * @param { number } ms - number of milliseconds to delay code execution\n * @returns Promise\n */\nexport function delay(ms: number) {\n return new Promise((resolve) => {\n setTimeout(() => resolve(null), ms);\n });\n}\n","import * as React from 'react';\n\nimport { DragEventType, UseDragConfig } from '../types';\nimport { DragGesture } from '../controllers';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useDrag(\n callback: (event: DragEventType) => void,\n config?: UseDragConfig\n) {\n const gesture = React.useRef(new DragGesture()).current;\n\n return useRecognizer([['drag', gesture, callback, config]]);\n}\n","import * as React from 'react';\nimport {\n DragGesture,\n MouseMoveGesture,\n ScrollGesture,\n WheelGesture,\n} from '../controllers';\nimport {\n DragEventType,\n WheelEventType,\n ScrollEventType,\n MouseMoveEventType,\n} from '../types';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useGesture({\n onDrag,\n onWheel,\n onScroll,\n onMouseMove,\n}: {\n onDrag?: (event: DragEventType) => void;\n onWheel?: (event: WheelEventType) => void;\n onScroll?: (event: ScrollEventType) => void;\n onMouseMove?: (event: MouseMoveEventType) => void;\n}) {\n const dragGesture = React.useRef(new DragGesture()).current;\n const wheelGesture = React.useRef(new WheelGesture()).current;\n const scrollGesture = React.useRef(new ScrollGesture()).current;\n const mouseMoveGesture = React.useRef(new MouseMoveGesture()).current;\n\n return useRecognizer([\n ['drag', dragGesture, onDrag],\n ['wheel', wheelGesture, onWheel],\n ['scroll', scrollGesture, onScroll],\n ['move', mouseMoveGesture, onMouseMove],\n ]);\n}\n","import { useRef, useEffect, DependencyList, createRef } from 'react';\n\ntype MeasurementValue = number | Array<number>;\n\ntype MeasurementType = {\n left: MeasurementValue;\n top: MeasurementValue;\n width: MeasurementValue;\n height: MeasurementValue;\n vLeft: MeasurementValue;\n vTop: MeasurementValue;\n};\n\nexport function useMeasure(\n callback: (event: MeasurementType) => void,\n deps?: DependencyList\n) {\n const ref = useRef(null);\n const elementRefs = useRef([]);\n const callbackRef = useRef<(event: MeasurementType) => void>(callback);\n\n // Reinitiate callback when dependency change\n useEffect(() => {\n callbackRef.current = callback;\n\n return () => {\n callbackRef.current = () => false;\n };\n }, deps);\n\n useEffect(() => {\n const _refElement = ref.current || document.documentElement;\n const _refElementsMultiple = elementRefs.current;\n\n const resizeObserver = new ResizeObserver(([entry]) => {\n const { left, top, width, height } = entry.target.getBoundingClientRect();\n const { pageXOffset, pageYOffset } = window;\n\n if (callbackRef) {\n if (_refElement === document.documentElement) {\n return; // no-op for document\n } else {\n callbackRef.current({\n left: left + pageXOffset,\n top: top + pageYOffset,\n width,\n height,\n vLeft: left,\n vTop: top,\n });\n }\n }\n });\n\n const resizeObserverMultiple = new ResizeObserver((entries) => {\n const left: Array<number> = [];\n const top: Array<number> = [];\n const width: Array<number> = [];\n const height: Array<number> = [];\n const vLeft: Array<number> = [];\n const vTop: Array<number> = [];\n\n entries.forEach((entry) => {\n const {\n left: _left,\n top: _top,\n width: _width,\n height: _height,\n } = entry.target.getBoundingClientRect();\n const { pageXOffset, pageYOffset } = window;\n const _pageLeft = _left + pageXOffset;\n const _pageTop = _top + pageYOffset;\n\n left.push(_pageLeft);\n top.push(_pageTop);\n width.push(_width);\n height.push(_height);\n vLeft.push(_left);\n vTop.push(_top);\n });\n\n if (callbackRef) {\n callbackRef.current({\n left,\n top,\n width,\n height,\n vLeft,\n vTop,\n });\n }\n });\n\n if (_refElement) {\n if (\n _refElement === document.documentElement &&\n _refElementsMultiple.length > 0\n ) {\n _refElementsMultiple.forEach((element: any) => {\n resizeObserverMultiple.observe(element.current);\n });\n } else {\n resizeObserver.observe(_refElement);\n }\n }\n\n return () => {\n if (_refElement) {\n if (\n _refElement === document.documentElement &&\n _refElementsMultiple.length > 0\n ) {\n _refElementsMultiple.forEach((element: any) => {\n resizeObserverMultiple.unobserve(element.current);\n });\n } else {\n resizeObserver.unobserve(_refElement);\n }\n }\n };\n }, []);\n\n return (index?: number) => {\n if (index === null || index === undefined) {\n return { ref };\n } else {\n elementRefs.current[index] = elementRefs.current[index] || createRef();\n\n return { ref: elementRefs.current[index] };\n }\n }; // ...bind() or ...bind(index) for multiple\n}\n","import * as React from 'react';\n\nimport { MouseMoveEventType } from '../types';\nimport { MouseMoveGesture } from '../controllers';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useMouseMove(callback: (event: MouseMoveEventType) => void) {\n const gesture = React.useRef(new MouseMoveGesture()).current;\n\n return useRecognizer([['move', gesture, callback]]);\n}\n","import { useRef, useEffect, RefObject, DependencyList } from 'react';\n\nimport { attachEvents } from '../gestures/helpers/eventAttacher';\n\nexport function useOutsideClick(\n elementRef: RefObject<HTMLElement>,\n callback: (event: MouseEvent) => void,\n deps?: DependencyList\n) {\n const callbackRef = useRef<(event: MouseEvent) => void>();\n\n if (!callbackRef.current) {\n callbackRef.current = callback;\n }\n\n // Reinitiate callback when dependency change\n useEffect(() => {\n callbackRef.current = callback;\n\n return () => {\n callbackRef.current = () => false;\n };\n }, deps);\n\n useEffect(() => {\n const handleOutsideClick = (e: MouseEvent) => {\n if (!elementRef?.current?.contains(e.target as Element)) {\n callbackRef.current && callbackRef.current(e);\n }\n };\n\n const subscribe = attachEvents([document], [['click', handleOutsideClick]]);\n\n return () => subscribe && subscribe();\n }, []);\n}\n","import * as React from 'react';\n\nimport { ScrollEventType } from '../types';\nimport { ScrollGesture } from '../controllers';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useScroll(callback: (event: ScrollEventType) => void) {\n const gesture = React.useRef(new ScrollGesture()).current;\n\n return useRecognizer([['scroll', gesture, callback]]);\n}\n","import * as React from 'react';\n\nimport { WheelEventType } from '../types';\nimport { WheelGesture } from '../controllers';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useWheel(callback: (event: WheelEventType) => void) {\n const gesture = React.useRef(new WheelGesture()).current;\n\n return useRecognizer([['wheel', gesture, callback]]);\n}\n","import { useRef, useEffect, DependencyList } from 'react';\n\ntype WindowDimensionType = {\n width: number;\n height: number;\n innerWidth: number;\n innerHeight: number;\n};\n\nexport function useWindowDimension(\n callback: (event: WindowDimensionType) => void,\n deps?: DependencyList\n) {\n const windowDimensionsRef = useRef<WindowDimensionType>({\n width: 0,\n height: 0,\n innerWidth: 0,\n innerHeight: 0,\n });\n const callbackRef = useRef<(event: WindowDimensionType) => void>(callback);\n\n const handleCallback: () => void = () => {\n if (callbackRef) {\n callbackRef.current({\n ...windowDimensionsRef.current,\n });\n }\n };\n\n // Reinitiate callback when dependency change\n useEffect(() => {\n callbackRef.current = callback;\n\n return () => {\n callbackRef.current = () => false;\n };\n }, deps);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(([entry]) => {\n const { clientWidth, clientHeight } = entry.target;\n const { innerWidth, innerHeight } = window;\n\n windowDimensionsRef.current = {\n width: clientWidth,\n height: clientHeight,\n innerWidth,\n innerHeight,\n };\n\n handleCallback();\n });\n\n resizeObserver.observe(document.documentElement);\n\n return () => resizeObserver.unobserve(document.documentElement);\n }, []);\n}\n"],"names":["isDefined","value","checkFluidValue","FluidValue","console","log","Error","useMountedValue","state","config","mv","useMount","cb","a","m","getInitialConfig","animationType","mass","friction","tension","duration","easing","Easing","bounce","bezier","linear","in","ease","out","inOut","AnimationConfigUtils","ELASTIC","BOUNCE","EASE","STIFF","WOOBLE","EASE_IN","EASE_OUT","EASE_IN_OUT","POWER1","POWER2","POWER3","POWER4","LINEAR","useAnimatedValue","initialValue","_a","__read","useFluidValue","__assign","animation","setAnimation","targetObject","currentValue","get","Proxy","set","_","key","queueMicrotask","toValue","bin","bool","clamp","lowerbound","upperbound","Math","min","max","rubber","distanceFromEdge","dimension","constant","abs","Infinity","pow","rubber2","withConfig","attachEvents","domTargets","events","subscribers","Map","forEach","_b","event","callback","_c","capture","target","addEventListener","removeEventListener","attachEvent","eventKeys","__values","entries","next","done","_d","eventKey","subscriber","indexOf","withDefault","x","y","Gesture","this","lastTimeStamp","Date","now","isActive","targetElements","prototype","_initEvents","_cancelEvents","_subscribe","applyCallback","applyGesture","_this","targetElement","map","element","current","_VELOCITY_LIMIT","DragGesture","_super","movementStart","initialMovement","movement","previousMovement","translation","offset","velocity","__extends","length","window","pointerDown","bind","pointerMove","pointerUp","passive","_handleCallback","args","currentIndex","down","movementX","movementY","offsetX","offsetY","velocityX","velocityY","distanceX","distanceY","directionX","sign","directionY","cancel","e","type","touches","clientX","clientY","currElem","find","elem","preventDefault","initial","initialMovementX","initialMovementY","deltaTime","t","MouseMoveGesture","direction","onMouseMove","isMoving","mouseX","mouseY","isActiveID","clearTimeout","setTimeout","diffX","diffY","ScrollGesture","scrollElementListener","scrollListener","isScrolling","scrollX","scrollY","onScroll","pageYOffset","pageXOffset","scrollLeft","scrollTop","WheelGesture","delta","onWheel","isWheeling","deltaX","deltaY","deltaMode","useRecognizer","handlers","ref","React","useRef","elementRefs","useEffect","_e","keyIndex","gesture","unsubscribe","index","createRef","children","from","enter","exit","open","_jsx","_Fragment","mounted","props","animationConfig","threshold","scrollableBlockRef","_scrollableBlock","observer","IntersectionObserver","isIntersecting","root","observe","unobserve","amv","minOutput","maxOutput","extrapolateConfig","checkedValue","_interpolate","interpolate","ms","Promise","resolve","inputRange","outputRange","perc","val1","val2","array","moveIndex","toIndex","item","diff","__spreadArray","slice","targetIndex","snapPoints","finalValue","getDiff","point","deltas","minDelta","reduce","acc","onDrag","dragGesture","wheelGesture","scrollGesture","mouseMoveGesture","deps","callbackRef","_refElement","document","documentElement","_refElementsMultiple","resizeObserver","ResizeObserver","getBoundingClientRect","left","top","width","height","vLeft","vTop","resizeObserverMultiple","entry","_left","_top","_width","_height","_pageLeft","_pageTop","push","elementRef","subscribe","contains","windowDimensionsRef","innerWidth","innerHeight","clientWidth","clientHe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jB,EAASnD,EAApB,uBAsCuB,SAC1BoS,GAQA,OAAO,SACL7M,GAAuE,OAAA8M,OAAA,OAAA,OAAA,GAAA,oGAElDC,EAAAjN,EAAA+M,GAAOG,EAAAD,EAAA/M,6CAAjBvF,EAAMuS,EAAA/S,MACf,CAAA,EAAM+F,EAAuB,iBAAXvF,EAAsB,CAAEmD,QAASnD,GAAWA,YAA9D2E,EAAA6N,0NAGN,qBA9C0B,SACxBrP,EACAnD,GACG,YADH,IAAAA,IAAAA,EAA2BqB,EAAqBC,SAC7C8C,EAAWjB,EAASnD,EAApB,qBAQqB,SACxBmD,EACAnD,GACG,YADH,IAAAA,IAAAA,EAAA,CAA6BW,SAAU,MACpCyD,EAAWjB,EAASnD,EAApB"}
1
+ {"version":3,"file":"index.js","sources":["../src/animation/core/inerpolate.ts","../src/animation/helpers/isDefined.ts","../src/animation/interpolation.ts","../src/animation/core/FluidController.ts","../src/animation/core/FluidArrayController.ts","../src/animation/core/useFluidValue.ts","../src/animation/useMountedValue.ts","../src/animation/core/useMount.ts","../src/animation/modules/MountedBlock.tsx","../src/animation/animationType.ts","../src/animation/useAnimatedValue.ts","../src/gestures/helpers/math.ts","../src/animation/modules/TransitionBlock.tsx","../src/animation/withFunctions.ts","../src/gestures/helpers/eventAttacher.ts","../src/gestures/helpers/withDefault.ts","../src/gestures/controllers/Gesture.ts","../src/gestures/controllers/DragGesture.ts","../src/gestures/controllers/MouseMoveGesture.ts","../src/gestures/controllers/ScrollGesture.ts","../src/gestures/controllers/WheelGesture.ts","../src/gestures/hooks/useRecognizer.ts","../src/animation/modules/ScrollableBlock.tsx","../src/animation/helpers/delay.ts","../src/gestures/hooks/useDrag.ts","../src/gestures/hooks/useGesture.ts","../src/hooks/useMeasure.ts","../src/gestures/hooks/useMouseMove.ts","../src/hooks/useOutsideClick.ts","../src/gestures/hooks/useScroll.ts","../src/gestures/hooks/useWheel.ts","../src/hooks/useWindowDimension.ts"],"sourcesContent":["import { FluidValue } from '@raidipesh78/re-motion';\n\ntype ExtrapolateType = 'extend' | 'identity' | 'clamp';\n\nexport type ExtrapolateConfig = {\n extrapolate?: ExtrapolateType;\n extrapolateLeft?: ExtrapolateType;\n extrapolateRight?: ExtrapolateType;\n};\n\nexport const interpolate = (\n value: FluidValue,\n inputRange: Array<number>,\n outputRange: Array<number> | Array<string>,\n extrapolateConfig?: ExtrapolateConfig\n) => value.interpolate(inputRange, outputRange, extrapolateConfig);\n","export const isDefined = <T>(value: T): value is NonNullable<T> => {\n return value !== null && value !== undefined;\n};\n","import { FluidValue } from '@raidipesh78/re-motion';\n\nimport {\n interpolate as _interpolate,\n ExtrapolateConfig,\n} from './core/inerpolate';\nimport { isDefined } from './helpers';\n\nfunction checkFluidValue(value: unknown): FluidValue {\n if (!isDefined(value) || !(value instanceof FluidValue)) {\n console.log(value);\n throw new Error(\n `Invalid ${value} type for interpolate function. Expected FluidValue.`\n );\n }\n return value;\n}\n\n/**\n * Maps the input range to the given output range using the specified extrapolation configuration.\n * The function ensures that the value is either a number or a FluidValue.\n *\n * @param value - The value to be interpolated, which must be a number or FluidValue.\n * @param inputRange - An array of numbers defining the input range.\n * @param outputRange - An array of numbers or strings defining the output range.\n * @param extrapolateConfig - The extrapolation configuration, which can be \"clamp\", \"identity\", or \"extend\".\n * @returns - The interpolated value, which will be a number or FluidValue.\n * @throws - Will throw an error if the value is not a number or FluidValue.\n */\nexport function interpolate(\n value: any,\n inputRange: number[],\n outputRange: number[] | string[],\n extrapolateConfig?: ExtrapolateConfig\n) {\n const checkedValue = checkFluidValue(value);\n\n return _interpolate(checkedValue, inputRange, outputRange, extrapolateConfig);\n}\n\n/**\n * A shorthand function for interpolate that maps the input range [0, 1] to the given [minOutput, maxOutput].\n * The function ensures that the value is either a number or a FluidValue.\n *\n * @param value - The value to be interpolated, which must be a number or FluidValue.\n * @param minOutput - The minimum value of the output range, which can be a number or string.\n * @param maxOutput - The maximum value of the output range, which can be a number or string.\n * @param extrapolateConfig - The extrapolation configuration, which can be \"clamp\", \"identity\", or \"extend\".\n * @returns - The interpolated value, which will be a number or FluidValue.\n * @throws - Will throw an error if the value is not a number or FluidValue.\n */\nexport function bInterpolate(\n value: any,\n minOutput: number | string,\n maxOutput: number | string,\n extrapolateConfig?: ExtrapolateConfig\n) {\n const checkedValue = checkFluidValue(value);\n\n return _interpolate(\n checkedValue,\n [0, 1],\n [minOutput, maxOutput] as number[] | string[],\n extrapolateConfig\n );\n}\n","import { FluidValue, timing, decay, spring } from '@raidipesh78/re-motion';\n\nimport { isDefined } from '../helpers';\n\ntype Fn<T, U> = (value: T) => U;\n\nexport interface UseFluidValueConfig {\n mass?: number;\n tension?: number;\n friction?: number;\n duration?: number;\n easing?: Fn<number, number>;\n immediate?: boolean;\n delay?: number;\n restDistance?: number;\n onChange?: Fn<number, void>;\n onRest?: Fn<number, void>;\n onStart?: Fn<number, void>;\n decay?: boolean;\n velocity?: number;\n deceleration?: number;\n}\n\ntype UpdateValue = {\n toValue?: number;\n config?: UseFluidValueConfig;\n};\n\nexport type AssignValue = UpdateValue | Fn<Fn<UpdateValue, Promise<any>>, void>;\n\nexport class FluidController {\n private fluid: FluidValue;\n private defaultConfig?: UseFluidValueConfig;\n\n constructor(value: number, config?: UseFluidValueConfig) {\n this.fluid = new FluidValue(value);\n this.defaultConfig = config;\n }\n\n private runAnimation(\n updateValue: UpdateValue,\n onComplete?: (value: number) => void\n ) {\n const config = { ...this.defaultConfig, ...updateValue.config };\n\n this.fluid.removeAllListeners();\n config?.onStart && config.onStart(this.fluid.get());\n\n if (config?.onChange) {\n this.fluid.addListener((value) => config?.onChange?.(value));\n }\n\n const onRest = ({\n finished,\n value,\n }: {\n finished: boolean;\n value: number;\n }) => {\n if (finished) {\n config?.onRest?.(value);\n onComplete?.(value);\n }\n };\n\n if (isDefined(config?.duration) || config?.immediate) {\n if (!isDefined(updateValue.toValue)) {\n throw new Error('No `toValue` is defined');\n }\n\n const timingConfig = {\n toValue: updateValue.toValue,\n delay: config?.delay,\n duration: config?.immediate ? 0 : config?.duration,\n easing: config?.easing,\n };\n\n timing(this.fluid, timingConfig).start(onRest);\n } else if (config?.decay) {\n const decayConfig = {\n velocity: config?.velocity,\n deceleration: config?.deceleration,\n delay: config?.delay,\n };\n\n decay(this.fluid, decayConfig).start(onRest);\n } else {\n if (!isDefined(updateValue.toValue)) {\n throw new Error('No `toValue` is defined');\n }\n\n const springConfig = {\n toValue: updateValue.toValue,\n delay: config?.delay,\n mass: config?.mass,\n tension: config?.tension,\n friction: config?.friction,\n restDistance: config?.restDistance,\n };\n\n spring(this.fluid, springConfig).start(onRest);\n }\n }\n\n public setFluid(\n updateValue: AssignValue,\n callback?: (value: number) => void\n ) {\n if (!updateValue) {\n return;\n }\n\n if (typeof updateValue === 'function') {\n updateValue((nextValue) => {\n return new Promise((resolve) => {\n this.runAnimation(nextValue, (value) => {\n resolve(nextValue);\n\n if (callback) {\n callback(value);\n }\n });\n });\n });\n } else {\n this.runAnimation(updateValue, callback);\n }\n }\n\n public getFluid() {\n return this.fluid;\n }\n}\n","import { FluidController } from './FluidController';\n\nimport type { AssignValue, UseFluidValueConfig } from './FluidController';\n\nexport class FluidArrayController {\n private fluidControllers: FluidController[];\n\n constructor(values: number[], config?: UseFluidValueConfig) {\n this.fluidControllers = values.map((v) => new FluidController(v, config));\n }\n\n public setFluid(updateValue: AssignValue[], callback?: () => void) {\n this.fluidControllers.map((fc, i) => {\n fc.setFluid(updateValue[i], callback);\n });\n }\n\n public getFluid() {\n return this.fluidControllers.map((fc) => fc.getFluid());\n }\n}\n","import { useCallback, useMemo, useRef } from 'react';\nimport { FluidValue } from '@raidipesh78/re-motion';\n\nimport {\n AssignValue,\n FluidController,\n UseFluidValueConfig,\n} from './FluidController';\nimport { FluidArrayController } from './FluidArrayController';\n\nexport const useFluidValue = <T extends number | number[]>(\n value: T,\n config?: UseFluidValueConfig\n): [\n T extends number ? FluidValue : FluidValue[],\n (\n updateValue: T extends number ? AssignValue : AssignValue[],\n callback?: () => void\n ) => void\n] => {\n const fluidController = useRef(\n Array.isArray(value)\n ? new FluidArrayController(value, config)\n : new FluidController(value, config)\n ).current;\n\n const onUpdate = useCallback(\n (\n updateValue: T extends number ? AssignValue : AssignValue[],\n callback?: () => void\n ) => {\n if (fluidController instanceof FluidArrayController) {\n fluidController.setFluid(updateValue as AssignValue[], callback);\n } else {\n fluidController.setFluid(updateValue as AssignValue, callback);\n }\n },\n []\n );\n\n const fluidValue = useMemo(() => fluidController.getFluid(), []);\n\n return [fluidValue as T extends number ? FluidValue : FluidValue[], onUpdate];\n};\n","import { FluidValue } from '@raidipesh78/re-motion';\n\nimport { useMount, UseMountConfig } from './core/useMount';\n\nexport interface UseMountedValueConfig extends UseMountConfig {}\n\n/**\n * `useMountedValue` handles mounting and unmounting of a component which captures current state\n * passed as an argument (`state`) and exposes the shadow state which handles the mount and unmount\n * of a component.\n *\n * @param { boolean } state - Boolean indicating the component should mount or unmount.\n * @param { UseAnimatedValueConfig } config - Animation configuration.\n */\nexport function useMountedValue(state: boolean, config: UseMountedValueConfig) {\n const mv = useMount(state, config);\n return (\n cb: (value: { value: FluidValue }, mounted: boolean) => React.ReactNode\n ) => mv((a, m) => cb({ value: a }, m));\n}\n","import { useState, useLayoutEffect, useRef } from 'react';\nimport { FluidValue } from '@raidipesh78/re-motion';\n\nimport { useFluidValue } from './useFluidValue';\n\nimport type { AssignValue, UseFluidValueConfig } from './FluidController';\n\nexport interface UseMountConfig {\n from: number;\n enter: number | AssignValue;\n exit: number | AssignValue;\n config?: UseFluidValueConfig;\n}\n\n/**\n * `useMount`\n *\n * applies mounting and unmounting of a component according to state change\n * applying transitions\n *\n * @param state - boolean indicating mount state of a component\n * @param config - the config object `UseMountConfig`\n */\nexport const useMount = (state: boolean, config: UseMountConfig) => {\n const [mounted, setMounted] = useState(false);\n const { from, enter, exit, config: innerConfig } = useRef(config).current;\n const [animation, setAnimation] = useFluidValue(from, innerConfig);\n\n useLayoutEffect(() => {\n if (state) {\n setMounted(true);\n queueMicrotask(() =>\n setAnimation(\n typeof enter === 'number'\n ? { toValue: enter, config: innerConfig }\n : enter\n )\n );\n } else {\n setAnimation(\n typeof exit === 'number'\n ? {\n toValue: exit,\n config: innerConfig,\n }\n : exit,\n () => {\n setMounted(false);\n\n animation\n .getSubscriptions()\n .forEach((s) => animation.removeSubscription(s));\n }\n );\n }\n }, [state, config]);\n\n return (\n callback: (animation: FluidValue, mounted: boolean) => React.ReactNode\n ) => callback(animation, mounted);\n};\n","import * as React from 'react';\n\nimport { useMountedValue } from '../useMountedValue';\n\nimport type { UpdateValue, UseAnimatedValueConfig } from '../useAnimatedValue';\n\ninterface MountedBlockProps {\n state: boolean;\n children: (animation: { value: any }) => React.ReactNode;\n from?: number;\n enter?: number | UpdateValue;\n exit?: number | UpdateValue;\n config?: UseAnimatedValueConfig;\n}\n\n/**\n * MountedBlock - Higher order component which handles mounting and unmounting of a component.\n * @param { boolean } state - Boolean indicating the component should mount or unmount.\n * @param { function } children - Child as a function with `AnimatedValue` on `.value` property.\n * @param { number } } from - Number that dictates the beginning state for animation.\n * @param { number | { toValue: number, config: MountedValueConfig } } enter - Number that dictates the entry state for animation.\n * @param { number | { toValue: number, config: MountedValueConfig } } exit - Number that dictates the exit state for animation.\n * @param { UseAnimatedValueConfig } config - Animation configuration for overall animation.\n */\nexport const MountedBlock = ({\n state,\n children,\n from = 0,\n enter = 1,\n exit = 0,\n config,\n}: MountedBlockProps) => {\n const open = useMountedValue(state, {\n from,\n enter,\n exit,\n config,\n });\n\n return (\n <>\n {open(\n (animation, mounted) =>\n mounted && children({ value: animation.value as any })\n )}\n </>\n );\n};\n","import { Easing } from '@raidipesh78/re-motion';\n\nimport type { UseAnimatedValueConfig } from './useAnimatedValue';\n\ntype InitialConfigType =\n | 'linear'\n | 'easein'\n | 'easeout'\n | 'easeinout'\n | 'ease'\n | 'power1'\n | 'power2'\n | 'power3'\n | 'power4'\n | 'elastic'\n | 'stiff'\n | 'wooble'\n | 'bounce';\n\nconst getInitialConfig = (\n animationType?: InitialConfigType\n): UseAnimatedValueConfig => {\n switch (animationType) {\n case 'elastic':\n return { mass: 1, friction: 18, tension: 250 };\n\n case 'stiff':\n return { mass: 1, friction: 18, tension: 350 };\n\n case 'wooble':\n return { mass: 1, friction: 8, tension: 250 };\n\n case 'bounce':\n return { duration: 500, easing: Easing.bounce };\n\n case 'power1':\n return { duration: 500, easing: Easing.bezier(0.17, 0.42, 0.51, 0.97) };\n\n case 'power2':\n return { duration: 500, easing: Easing.bezier(0.07, 0.11, 0.13, 1) };\n\n case 'power3':\n return { duration: 500, easing: Easing.bezier(0.09, 0.7, 0.16, 1.04) };\n\n case 'power4':\n return { duration: 500, easing: Easing.bezier(0.05, 0.54, 0, 1.03) };\n\n case 'linear':\n return { duration: 500, easing: Easing.linear };\n\n case 'easein':\n return { duration: 500, easing: Easing.in(Easing.ease) };\n\n case 'easeout':\n return { duration: 500, easing: Easing.out(Easing.ease) };\n\n case 'easeinout':\n return { duration: 500, easing: Easing.inOut(Easing.ease) };\n\n case 'ease':\n default:\n return { mass: 1, friction: 26, tension: 170 };\n }\n};\n\nexport const AnimationConfigUtils = {\n ELASTIC: getInitialConfig('elastic'),\n BOUNCE: getInitialConfig('bounce'),\n EASE: getInitialConfig('ease'),\n STIFF: getInitialConfig('stiff'),\n WOOBLE: getInitialConfig('wooble'),\n EASE_IN: getInitialConfig('easein'),\n EASE_OUT: getInitialConfig('easeout'),\n EASE_IN_OUT: getInitialConfig('easeinout'),\n POWER1: getInitialConfig('power1'),\n POWER2: getInitialConfig('power2'),\n POWER3: getInitialConfig('power3'),\n POWER4: getInitialConfig('power4'),\n LINEAR: getInitialConfig('linear'),\n};\n","import { useCallback, useLayoutEffect, useRef } from 'react';\nimport { FluidValue } from '@raidipesh78/re-motion';\n\nimport { useFluidValue } from './core/useFluidValue';\nimport { AnimationConfigUtils } from './animationType';\n\nimport type { UseFluidValueConfig } from './core/FluidController';\n\nexport interface UseAnimatedValueConfig extends UseFluidValueConfig {}\n\ntype AssignValue = {\n toValue?: number;\n config?: UseAnimatedValueConfig;\n};\n\nexport type UpdateValue =\n | AssignValue\n | ((update: (next: AssignValue) => Promise<any>) => void);\n\nconst getValue = (value: unknown) =>\n typeof value === 'number' ? { toValue: value } : value;\n\n/**\n * `useAnimatedValue` returns an animation value with `.value` and `.currentValue` property which is\n * initialized when passed to argument (`initialValue`). The returned value persist until the lifetime of\n * a component. It doesn't cast any re-renders which can is very good for performance optimization.\n *\n * @param { string | number } initialValue - Initial value\n * @param { UseAnimatedValueConfig } config - Animation configuration object.\n */\nexport function useAnimatedValue<T extends number | number[]>(\n initialValue: T,\n config?: UseAnimatedValueConfig\n) {\n const isInitialRender = useRef(true);\n const [animation, setAnimation] = useFluidValue(initialValue, {\n ...AnimationConfigUtils.EASE,\n ...config,\n });\n\n const currentValue = Array.isArray(animation)\n ? animation.map((a) => a.get())\n : (animation as FluidValue).get();\n\n const targetObject: {\n value: T extends number ? any : any[];\n currentValue: T extends number ? number : number[];\n } = {\n value: animation as T extends number ? FluidValue : FluidValue[],\n currentValue: currentValue as T extends number ? number : number[],\n };\n\n const updateAnimation = useCallback((value: unknown) => {\n const updateValue = getValue(value);\n\n if (Array.isArray(value)) {\n setAnimation(value.map((v) => getValue(v)) as any);\n } else {\n queueMicrotask(() => setAnimation(updateValue as any));\n }\n }, []);\n\n useLayoutEffect(() => {\n if (!isInitialRender.current) {\n updateAnimation(initialValue);\n }\n\n isInitialRender.current = false;\n }, [initialValue, config]);\n\n return new Proxy(targetObject, {\n set: function (\n _,\n key,\n value: number | UpdateValue | number[] | UpdateValue[]\n ) {\n if (key === 'value') {\n updateAnimation(value);\n\n return true;\n }\n\n throw new Error('You cannot set any other property to animation node.');\n },\n get: function (_, key) {\n if (key === 'value') {\n return animation;\n }\n\n if (key === 'currentValue') {\n return Array.isArray(animation)\n ? animation.map((a) => a.get())\n : animation.get();\n }\n\n throw new Error(\n 'You cannot access any other property from animation node.'\n );\n },\n });\n}\n","/**\n * bin(booleanValue)\n * returns 1 if booleanValue == true and 0 if booleanValue == false\n */\nexport function bin(bool: boolean) {\n return bool ? 1 : 0;\n}\n\n/**\n * mix(progress, a, b)\n * linear interpolation between a and b\n */\nexport function mix(perc: number, val1: number, val2: number) {\n return val1 * (1 - perc) + val2 * perc;\n}\n\n/**\n * clamp(value, min, max)\n * clamps value for min and max bounds\n */\nexport function clamp(value: number, lowerbound: number, upperbound: number) {\n return Math.min(Math.max(value, lowerbound), upperbound);\n}\n\nfunction rubber2(distanceFromEdge: number, constant: number) {\n return Math.pow(distanceFromEdge, constant * 5);\n}\n\nfunction rubber(distanceFromEdge: number, dimension: number, constant: number) {\n if (dimension === 0 || Math.abs(dimension) === Infinity)\n return rubber2(distanceFromEdge, constant);\n return (\n (distanceFromEdge * dimension * constant) /\n (dimension + constant * distanceFromEdge)\n );\n}\n\n/**\n * rubberClamp(value, min, max, constant?)\n * constant is optional : default 0.15\n * clamps the value for min and max value and\n * extends beyond min and max values with constant\n * factor to create elastic rubber band effect\n */\nexport function rubberClamp(\n value: number,\n lowerbound: number,\n upperbound: number,\n constant: number = 0.15\n) {\n if (constant === 0) return clamp(value, lowerbound, upperbound);\n\n if (value < lowerbound) {\n return (\n -rubber(lowerbound - value, upperbound - lowerbound, constant) +\n lowerbound\n );\n }\n\n if (value > upperbound) {\n return (\n +rubber(value - upperbound, upperbound - lowerbound, constant) +\n upperbound\n );\n }\n\n return value;\n}\n\n/**\n * snapTo(value, velocity, snapPoints[])\n * Calculates the final snapPoint according to given current value,\n * velocity and snapPoints array\n */\nexport function snapTo(\n value: number,\n velocity: number,\n snapPoints: Array<number>\n): number {\n const finalValue = value + velocity * 0.2;\n const getDiff = (point: number) => Math.abs(point - finalValue);\n const deltas = snapPoints.map(getDiff);\n const minDelta = Math.min(...deltas);\n\n return snapPoints.reduce(function (acc, point) {\n if (getDiff(point) === minDelta) {\n return point;\n } else {\n return acc;\n }\n });\n}\n\n/**\n * move(array, moveIndex, toIndex)\n * move array item from moveIndex to toIndex without array modification\n */\nexport function move(array: Array<any>, moveIndex: number, toIndex: number) {\n const item = array[moveIndex];\n const length = array.length;\n const diff = moveIndex - toIndex;\n\n if (diff > 0) {\n return [\n ...array.slice(0, toIndex),\n item,\n ...array.slice(toIndex, moveIndex),\n ...array.slice(moveIndex + 1, length),\n ];\n } else if (diff < 0) {\n const targetIndex = toIndex + 1;\n return [\n ...array.slice(0, moveIndex),\n ...array.slice(moveIndex + 1, targetIndex),\n item,\n ...array.slice(targetIndex, length),\n ];\n }\n return array;\n}\n","import * as React from 'react';\n\nimport { bin } from '../../gestures/helpers/math';\nimport { useAnimatedValue, UseAnimatedValueConfig } from '../useAnimatedValue';\n\ninterface TransitionBlockProps {\n state: boolean;\n children: (animation: { value: any }) => React.ReactNode;\n config?: UseAnimatedValueConfig;\n}\n\n/**\n * TransitionBlock - Higher order component which animates on state change.\n * @prop { boolean } state - Boolean indicating the current state of animation, usually `false = 0 and true = 1`.\n * @prop { function } children - Child as a function with `AnimatedValue` on `.value` property.\n * @prop { UseAnimatedValueConfig } config - Animation configuration.\n */\nexport const TransitionBlock = ({\n state,\n children,\n config,\n}: TransitionBlockProps) => {\n const amv = useAnimatedValue(bin(state), config);\n\n return <>{children({ value: amv.value })}</>;\n};\n","import { AnimationConfigUtils } from './animationType';\n\nimport type { UseAnimatedValueConfig } from './useAnimatedValue';\n\n// Base interfaces for callbacks\ninterface WithOnCallbacks\n extends Pick<UseAnimatedValueConfig, 'onRest' | 'onStart' | 'onChange'> {}\n\n/**\n * Creates a default animation configuration.\n * @param {number} toValue - The target value of the animation.\n * @param {UseAnimatedValueConfig} config - Optional configuration.\n * @returns {{ toValue: number; config: UseAnimatedValueConfig }}\n */\nexport const withConfig = (\n toValue: number,\n config?: UseAnimatedValueConfig\n) => ({\n toValue,\n config,\n});\n\n// Configuration interfaces\ninterface WithEaseConfig extends WithOnCallbacks {}\n\n/**\n * Creates an ease animation configuration.\n * @param {number} toValue - The target value of the animation.\n * @param {UseAnimatedValueConfig} [config=AnimationConfigUtils.EASE] - Optional ease configuration.\n * @returns {{ toValue: number; config: UseAnimatedValueConfig }}\n */\nexport const withEase = (toValue: number, config?: WithEaseConfig) =>\n withConfig(toValue, { ...AnimationConfigUtils.EASE, ...config });\n\ninterface WithSpringConfig\n extends Pick<UseAnimatedValueConfig, 'mass' | 'friction' | 'tension'>,\n WithOnCallbacks {}\n\n/**\n * Creates a spring animation configuration.\n * @param {number} toValue - The target value of the animation.\n * @param {WithSpringConfig} [config=AnimationConfigUtils.ELASTIC] - Optional spring configuration.\n * @returns {{ toValue: number; config: WithSpringConfig }}\n */\nexport const withSpring = (toValue: number, config?: WithSpringConfig) =>\n withConfig(toValue, { ...AnimationConfigUtils.ELASTIC, ...config });\n\ninterface WithTimingConfig\n extends Pick<UseAnimatedValueConfig, 'duration' | 'easing'>,\n WithOnCallbacks {}\n\n/**\n * Creates a timing animation configuration.\n * @param {number} toValue - The target value of the animation.\n * @param {WithTimingConfig} [config={ duration: 250 }] - Optional timing configuration.\n * @returns {{ toValue: number; config: WithTimingConfig }}\n */\nexport const withTiming = (toValue: number, config?: WithTimingConfig) =>\n withConfig(toValue, { duration: 250, ...config });\n\ninterface WithDecayConfig\n extends Pick<UseAnimatedValueConfig, 'velocity' | 'deceleration'>,\n WithOnCallbacks {}\n\n/**\n * Creates a decay animation configuration.\n * @param {WithDecayConfig} config - Optional decay configuration.\n * @returns {{ config: WithDecayConfig }}\n */\nexport const withDecay = (config?: WithDecayConfig) => ({\n config: {\n decay: true,\n ...config,\n },\n});\n\n/**\n * Creates a sequence of animations that run one after another.\n * @param {Array<{ toValue: number; config?: UseAnimatedValueConfig } | number>} configs - An array of animation configurations or delays.\n * @returns {Function} An async function that runs the animations in sequence.\n */\nexport const withSequence = (\n configs: Array<\n | {\n toValue?: number;\n config?: UseAnimatedValueConfig;\n }\n | number\n >\n) => {\n return async (\n next: (arg: { toValue?: number; config?: UseAnimatedValueConfig }) => void\n ) => {\n for (const config of configs) {\n await next(typeof config === 'number' ? { toValue: config } : config);\n }\n };\n};\n\n/**\n * Adds a delay before the given animation.\n * @param {number} delay - The delay in milliseconds.\n * @param {{ toValue: number; config?: UseAnimatedValueConfig }} animation - The animation configuration (withTiming | withSpring).\n * @returns {{ toValue: number; config: UseAnimatedValueConfig }} The updated animation configuration with delay.\n */\nexport const withDelay = (\n delay: number,\n animation: { toValue: number; config?: UseAnimatedValueConfig }\n) => ({\n ...animation,\n config: {\n ...animation.config,\n delay,\n },\n});\n","type MouseEventType =\n | 'click'\n | 'dblclick'\n | 'mousedown'\n | 'mousemove'\n | 'mouseup'\n | 'touchstart'\n | 'touchmove'\n | 'touchend'\n | 'mouseenter'\n | 'mouseleave'\n | 'mouseout'\n | 'mouseover'\n | 'scroll'\n | 'wheel'\n | 'contextmenu';\n\ntype DomTargetTypes = Array<Window | Document | HTMLElement>;\n\n/**\n * Attach single document / window event / HTMLElement\n */\nfunction attachEvent(\n domTargets: DomTargetTypes,\n event: MouseEventType,\n callback: (e: any) => void,\n capture: any = false\n) {\n domTargets.forEach((target) => {\n target.addEventListener(event, callback, capture);\n });\n\n return function () {\n domTargets.forEach((target) => {\n target.removeEventListener(event, callback, capture);\n });\n };\n}\n\n/**\n * Attach multiple document / window event / HTMLElement\n */\nexport function attachEvents(\n domTargets: DomTargetTypes,\n events: Array<\n [event: MouseEventType, callback: (e: any) => void, capture?: any]\n >\n) {\n const subscribers = new Map();\n\n events.forEach(function ([event, callback, capture = false]) {\n subscribers.set(event, attachEvent(domTargets, event, callback, capture));\n });\n\n return function (eventKeys?: Array<string>) {\n for (const [eventKey, subscriber] of subscribers.entries()) {\n if (!eventKeys) {\n subscriber();\n return;\n }\n\n if (eventKeys.indexOf(eventKey) !== -1) {\n subscriber();\n }\n }\n };\n}\n","export const withDefault = (x: number, y: number) => {\n return { x, y };\n};\n","export class Gesture {\n currentIndex?: number;\n lastTimeStamp: number = Date.now();\n isActive: boolean = false;\n targetElement?: HTMLElement; // represents the bounded element\n targetElements: Array<HTMLElement> = []; // represents the bounded elements\n config?: any;\n callback?: <T>(event: T) => void;\n _subscribe?: (eventKeys?: Array<string>) => void;\n static _VELOCITY_LIMIT: number = 20;\n\n // it must be overridden by other child classes\n _initEvents() {}\n\n // cancel events\n // we only canceled down and move events because mouse up\n // will not be triggered\n _cancelEvents() {\n if (this._subscribe) {\n this._subscribe();\n }\n }\n\n // re-apply new callback\n applyCallback(callback: <T>(event: T) => void) {\n this.callback = callback;\n }\n\n // apply gesture\n applyGesture({\n targetElement,\n targetElements,\n callback,\n config,\n }: {\n targetElement?: any;\n targetElements?: any;\n callback: <T>(event: T) => void;\n config?: any;\n }) {\n this.targetElement = targetElement;\n this.targetElements = targetElements.map(\n (element: { current: any }) => element.current\n );\n this.callback = callback;\n this.config = config;\n\n // initialize events\n this._initEvents();\n\n // unbind\n return () => this._subscribe && this._subscribe();\n }\n}\n","import { attachEvents } from '../helpers/eventAttacher';\nimport { clamp } from '../helpers/math';\nimport { withDefault } from '../helpers/withDefault';\nimport { Gesture } from './Gesture';\n\nimport type { Vector2 } from '../types';\n\nexport class DragGesture extends Gesture {\n movementStart: Vector2 = withDefault(0, 0);\n initialMovement: Vector2 = withDefault(0, 0);\n movement: Vector2 = withDefault(0, 0);\n previousMovement: Vector2 = withDefault(0, 0);\n translation: Vector2 = withDefault(0, 0);\n offset: Vector2 = withDefault(0, 0);\n velocity: Vector2 = withDefault(0, 0);\n\n // @override\n // initialize the events\n _initEvents() {\n if (this.targetElement || this.targetElements.length > 0) {\n this._subscribe = attachEvents(\n [window],\n [\n ['mousedown', this.pointerDown.bind(this)],\n ['mousemove', this.pointerMove.bind(this)],\n ['mouseup', this.pointerUp.bind(this)],\n ['touchstart', this.pointerDown.bind(this), { passive: false }],\n ['touchmove', this.pointerMove.bind(this), { passive: false }],\n ['touchend', this.pointerUp.bind(this)],\n ]\n );\n }\n }\n\n // @override - cancel events\n // we only canceled down and move events because mouse up\n // will not be triggered\n _cancelEvents() {\n if (this._subscribe) {\n this._subscribe(['mousedown', 'mousemove', 'touchstart', 'touchmove']);\n }\n }\n\n _handleCallback() {\n if (this.callback) {\n this.callback({\n args: [this.currentIndex],\n down: this.isActive,\n movementX: this.movement.x,\n movementY: this.movement.y,\n offsetX: this.translation.x,\n offsetY: this.translation.y,\n velocityX: this.velocity.x,\n velocityY: this.velocity.y,\n distanceX: Math.abs(this.movement.x),\n distanceY: Math.abs(this.movement.y),\n directionX: Math.sign(this.movement.x),\n directionY: Math.sign(this.movement.y),\n cancel: () => {\n this._cancelEvents();\n },\n });\n }\n }\n\n pointerDown(e: any) {\n if (e.type === 'touchstart') {\n this.movementStart = {\n x: e.touches[0].clientX,\n y: e.touches[0].clientY,\n };\n } else {\n this.movementStart = { x: e.clientX, y: e.clientY };\n }\n\n this.movement = { x: 0, y: 0 };\n this.offset = { x: this.translation.x, y: this.translation.y };\n this.previousMovement = { x: 0, y: 0 };\n this.velocity = { x: 0, y: 0 };\n\n // find current selected element\n const currElem = this.targetElements.find((elem: any) => elem === e.target);\n\n if (e.target === this.targetElement || currElem) {\n this.isActive = true;\n e.preventDefault();\n\n // set args\n if (currElem) {\n this.currentIndex = this.targetElements.indexOf(currElem);\n }\n\n // if initial function is defined then call it to get initial movementX and movementY\n // if only select to bounded draggable element\n const initial = this.config?.initial && this.config.initial();\n const initialMovementX = initial?.movementX;\n const initialMovementY = initial?.movementY;\n\n this.initialMovement = {\n x: initialMovementX ?? 0,\n y: initialMovementY ?? 0,\n };\n\n this.movement = {\n x: this.initialMovement.x,\n y: this.initialMovement.y,\n };\n\n this.previousMovement = {\n x: this.initialMovement.x,\n y: this.initialMovement.y,\n };\n\n this._handleCallback();\n }\n }\n\n pointerMove(e: any) {\n if (this.isActive) {\n e.preventDefault();\n const now = Date.now();\n const deltaTime = clamp(now - this.lastTimeStamp, 0.1, 64);\n this.lastTimeStamp = now;\n\n const t = deltaTime / 1000;\n\n if (e.type === 'touchmove') {\n this.movement = {\n x:\n this.initialMovement.x +\n (e.touches[0].clientX - this.movementStart.x),\n y:\n this.initialMovement.y +\n (e.touches[0].clientY - this.movementStart.y),\n };\n } else {\n this.movement = {\n x: this.initialMovement.x + (e.clientX - this.movementStart.x),\n y: this.initialMovement.y + (e.clientY - this.movementStart.y),\n };\n }\n\n this.translation = {\n x: this.offset.x + this.movement.x,\n y: this.offset.y + this.movement.y,\n };\n\n this.velocity = {\n x: clamp(\n (this.movement.x - this.previousMovement.x) / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n y: clamp(\n (this.movement.y - this.previousMovement.y) / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n };\n\n this.previousMovement = {\n x: this.movement.x,\n y: this.movement.y,\n };\n\n this._handleCallback();\n }\n }\n\n pointerUp() {\n if (this.isActive) {\n this.isActive = false;\n this._handleCallback();\n this._cancelEvents();\n this._initEvents();\n }\n }\n}\n","import { attachEvents } from '../helpers/eventAttacher';\nimport { Vector2 } from '../types';\nimport { clamp } from '../helpers/math';\nimport { withDefault } from '../helpers/withDefault';\nimport { Gesture } from './Gesture';\n\nexport class MouseMoveGesture extends Gesture {\n event?: MouseEvent;\n isActiveID?: any;\n movement: Vector2 = withDefault(0, 0);\n previousMovement: Vector2 = withDefault(0, 0);\n velocity: Vector2 = withDefault(0, 0);\n direction: Vector2 = withDefault(0, 0);\n\n // @override\n // initialize the events\n _initEvents() {\n if (this.targetElement) {\n this._subscribe = attachEvents(\n [this.targetElement],\n [['mousemove', this.onMouseMove.bind(this)]]\n );\n } else if (this.targetElements.length > 0) {\n this._subscribe = attachEvents(this.targetElements, [\n ['mousemove', this.onMouseMove.bind(this)],\n ]);\n } else {\n this._subscribe = attachEvents(\n [window],\n [['mousemove', this.onMouseMove.bind(this)]]\n );\n }\n }\n\n _handleCallback() {\n if (this.callback) {\n this.callback({\n args: [this.currentIndex],\n event: this.event,\n isMoving: this.isActive,\n target: this.event?.target,\n mouseX: this.movement.x,\n mouseY: this.movement.y,\n velocityX: this.velocity.x,\n velocityY: this.velocity.y,\n directionX: this.direction.x,\n directionY: this.direction.y,\n });\n }\n }\n\n onMouseMove(e: MouseEvent) {\n // find current selected element\n const currElem = this.targetElements.find((elem: any) => elem === e.target);\n\n // set args\n if (currElem) {\n this.currentIndex = this.targetElements.indexOf(currElem);\n }\n\n this.event = e;\n\n const now: number = Date.now();\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\n this.lastTimeStamp = now;\n const t = deltaTime / 1000; // seconds\n\n const x = e.clientX;\n const y = e.clientY;\n\n this.movement = { x, y };\n\n if (this.isActiveID !== -1) {\n this.isActive = true;\n clearTimeout(this.isActiveID);\n }\n\n this.isActiveID = setTimeout(() => {\n this.isActive = false;\n this.direction = { x: 0, y: 0 };\n this.velocity = { x: 0, y: 0 };\n\n this._handleCallback();\n }, 250); // Debounce 250 milliseconds\n\n const diffX = this.movement.x - this.previousMovement.x;\n const diffY = this.movement.y - this.previousMovement.y;\n\n this.direction = {\n x: Math.sign(diffX),\n y: Math.sign(diffY),\n };\n\n this.velocity = {\n x: clamp(\n diffX / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n y: clamp(\n diffY / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n };\n\n this.previousMovement = { x: this.movement.x, y: this.movement.y };\n\n this._handleCallback();\n }\n}\n","import { attachEvents } from '../helpers/eventAttacher';\nimport { Vector2 } from '../types';\nimport { clamp } from '../helpers/math';\nimport { withDefault } from '../helpers/withDefault';\nimport { Gesture } from './Gesture';\n\nexport class ScrollGesture extends Gesture {\n isActiveID?: any;\n movement: Vector2 = withDefault(0, 0);\n previousMovement: Vector2 = withDefault(0, 0);\n direction: Vector2 = withDefault(0, 0);\n velocity: Vector2 = withDefault(0, 0);\n\n // @override\n // initialize the events\n _initEvents() {\n if (this.targetElement) {\n this._subscribe = attachEvents(\n [this.targetElement],\n [['scroll', this.scrollElementListener.bind(this)]]\n );\n } else {\n this._subscribe = attachEvents(\n [window],\n [['scroll', this.scrollListener.bind(this)]]\n );\n }\n }\n\n _handleCallback() {\n if (this.callback) {\n this.callback({\n isScrolling: this.isActive,\n scrollX: this.movement.x,\n scrollY: this.movement.y,\n velocityX: this.velocity.x,\n velocityY: this.velocity.y,\n directionX: this.direction.x,\n directionY: this.direction.y,\n });\n }\n }\n\n onScroll({ x, y }: Vector2) {\n const now: number = Date.now();\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\n this.lastTimeStamp = now;\n const t = deltaTime / 1000; // seconds\n\n this.movement = { x, y };\n\n // Clear if scrolling\n if (this.isActiveID !== -1) {\n this.isActive = true;\n clearTimeout(this.isActiveID);\n }\n\n this.isActiveID = setTimeout(() => {\n this.isActive = false;\n this.direction = { x: 0, y: 0 };\n\n // Reset Velocity\n this.velocity = { x: 0, y: 0 };\n\n this._handleCallback(); // Debounce 250milliseconds\n }, 250);\n\n const diffX = this.movement.x - this.previousMovement.x;\n const diffY = this.movement.y - this.previousMovement.y;\n\n this.direction = {\n x: Math.sign(diffX),\n y: Math.sign(diffY),\n };\n\n this.velocity = {\n x: clamp(\n diffX / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n y: clamp(\n diffY / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n };\n\n this.previousMovement = {\n x: this.movement.x,\n y: this.movement.y,\n };\n\n this._handleCallback();\n }\n\n scrollListener() {\n const { pageYOffset: y, pageXOffset: x } = window;\n this.onScroll({ x, y });\n }\n\n scrollElementListener() {\n const x = this.targetElement?.scrollLeft || 0;\n const y = this.targetElement?.scrollTop || 0;\n this.onScroll({ x, y });\n }\n}\n","import { attachEvents } from '../helpers/eventAttacher';\nimport { Vector2 } from '../types';\nimport { clamp } from '../helpers/math';\nimport { withDefault } from '../helpers/withDefault';\nimport { Gesture } from './Gesture';\n\nconst LINE_HEIGHT = 40;\nconst PAGE_HEIGHT = 800;\n\nexport class WheelGesture extends Gesture {\n isActiveID?: any;\n movement: Vector2 = withDefault(0, 0);\n previousMovement: Vector2 = withDefault(0, 0);\n direction: Vector2 = withDefault(0, 0);\n velocity: Vector2 = withDefault(0, 0);\n delta: Vector2 = withDefault(0, 0);\n\n // Holds offsets\n offset: Vector2 = withDefault(0, 0);\n translation: Vector2 = withDefault(0, 0);\n\n // @override\n // initialize the events\n _initEvents() {\n if (this.targetElement) {\n this._subscribe = attachEvents(\n [this.targetElement],\n [['wheel', this.onWheel.bind(this)]]\n );\n }\n }\n\n _handleCallback() {\n if (this.callback) {\n this.callback({\n target: this.targetElement,\n isWheeling: this.isActive,\n deltaX: this.delta.x,\n deltaY: this.delta.y,\n directionX: this.direction.x,\n directionY: this.direction.y,\n movementX: this.movement.x,\n movementY: this.movement.y,\n offsetX: this.offset.x,\n offsetY: this.offset.y,\n velocityX: this.velocity.x,\n velocityY: this.velocity.y,\n });\n }\n }\n\n onWheel(event: WheelEvent) {\n let { deltaX, deltaY, deltaMode } = event;\n\n const now: number = Date.now();\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\n this.lastTimeStamp = now;\n const t = deltaTime / 1000; // seconds\n\n this.isActive = true;\n\n if (this.isActiveID !== -1) {\n this.isActive = true;\n clearTimeout(this.isActiveID);\n }\n\n this.isActiveID = setTimeout(() => {\n this.isActive = false;\n this.translation = { x: this.offset.x, y: this.offset.y };\n this._handleCallback();\n\n this.velocity = { x: 0, y: 0 }; // Reset Velocity\n this.movement = { x: 0, y: 0 };\n }, 200);\n\n // normalize wheel values, especially for Firefox\n if (deltaMode === 1) {\n deltaX *= LINE_HEIGHT;\n deltaY *= LINE_HEIGHT;\n } else if (deltaMode === 2) {\n deltaX *= PAGE_HEIGHT;\n deltaY *= PAGE_HEIGHT;\n }\n\n this.delta = { x: deltaX, y: deltaY };\n this.movement = {\n x: this.movement.x + deltaX,\n y: this.movement.y + deltaY,\n };\n this.offset = {\n x: this.translation.x + this.movement.x,\n y: this.translation.y + this.movement.y,\n };\n\n const diffX = this.movement.x - this.previousMovement.x;\n const diffY = this.movement.y - this.previousMovement.y;\n\n this.direction = {\n x: Math.sign(diffX),\n y: Math.sign(diffY),\n };\n\n this.velocity = {\n x: clamp(\n diffX / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n y: clamp(\n diffY / t / 1000,\n -1 * Gesture._VELOCITY_LIMIT,\n Gesture._VELOCITY_LIMIT\n ),\n };\n\n this.previousMovement = {\n x: this.movement.x,\n y: this.movement.y,\n };\n\n this._handleCallback();\n }\n}\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport * as React from 'react';\n\ntype UseRecognizerHandlerType = Array<\n [\n key: 'drag' | 'wheel' | 'move' | 'scroll',\n gesture: any,\n callback: any,\n config?: any\n ]\n>;\n\nexport const useRecognizer = (handlers: UseRecognizerHandlerType) => {\n const ref = React.useRef<any>();\n const elementRefs = React.useRef<Array<any>>([]);\n const subscribers = React.useRef<\n Map<string, { keyIndex: number; gesture: any; unsubscribe: any }>\n >(new Map()).current;\n\n // re-initiate callback on change\n React.useEffect(() => {\n for (let [, { keyIndex, gesture }] of subscribers.entries()) {\n const [, , callback] = handlers[keyIndex];\n gesture.applyCallback(callback);\n }\n }, [handlers]);\n\n React.useEffect(() => {\n handlers.forEach(([key, gesture, callback, config], keyIndex) => {\n queueMicrotask(() =>\n subscribers.set(key, {\n keyIndex,\n gesture,\n unsubscribe: gesture.applyGesture({\n targetElement: ref.current,\n targetElements: elementRefs.current,\n callback,\n config,\n }),\n })\n );\n });\n\n return () => {\n for (let [, { unsubscribe }] of subscribers.entries()) {\n unsubscribe && unsubscribe();\n }\n };\n });\n\n return (index?: number) => {\n if (index === null || index === undefined) {\n return { ref };\n } else {\n elementRefs.current[index] =\n elementRefs.current[index] || React.createRef();\n\n return { ref: elementRefs.current[index] };\n }\n };\n};\n","import * as React from 'react';\n\nimport { useAnimatedValue, UseAnimatedValueConfig } from '../useAnimatedValue';\n\ninterface ScrollableBlockProps {\n children?: (animation: { value: any }) => React.ReactNode;\n direction?: 'single' | 'both';\n threshold?: number;\n animationConfig?: UseAnimatedValueConfig;\n}\n\n/**\n * ScrollableBlock - Higher order component to handle the entrance or exit animation\n * of a component when it enters or exit the viewport. Accepts child as a function with\n * `AnimatedValue` as its first argument which can be interpolated on input range [0, 1]\n * @prop { function } children - child as a function with `AnimatedValue` as its first argument.\n * @prop { 'single' | 'both' } direction - single applies animation on enter once, both applies on enter and exit.\n * @prop { number } threshold - should be in range 0 to 1 which equivalent to `IntersectionObserver` threshold.\n * @prop { UseAnimatedValueConfig } animationConfig - Animation config\n */\nexport const ScrollableBlock = (props: ScrollableBlockProps) => {\n const {\n children,\n direction = 'single',\n animationConfig,\n threshold = 0.2,\n } = props;\n const scrollableBlockRef = React.useRef<HTMLDivElement>(null);\n const animation = useAnimatedValue(0, animationConfig); // 0: not intersecting | 1: intersecting\n\n React.useEffect(() => {\n const _scrollableBlock = scrollableBlockRef.current;\n\n const observer = new IntersectionObserver(\n function ([entry]) {\n const { isIntersecting } = entry;\n\n if (isIntersecting) {\n animation.value = 1;\n } else {\n if (direction === 'both') animation.value = 0;\n }\n },\n {\n root: null, // FOR VIEWPORT ONLY\n threshold,\n }\n );\n\n if (_scrollableBlock) {\n observer.observe(_scrollableBlock);\n }\n\n return () => {\n if (_scrollableBlock) {\n observer.unobserve(_scrollableBlock);\n }\n };\n }, []);\n\n return (\n <div ref={scrollableBlockRef}>\n {children && children({ value: animation.value })}\n </div>\n );\n};\n","/**\n * @param { number } ms - number of milliseconds to delay code execution\n * @returns Promise\n */\nexport function delay(ms: number) {\n return new Promise((resolve) => {\n setTimeout(() => resolve(null), ms);\n });\n}\n","import * as React from 'react';\n\nimport { DragEventType, UseDragConfig } from '../types';\nimport { DragGesture } from '../controllers';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useDrag(\n callback: (event: DragEventType) => void,\n config?: UseDragConfig\n) {\n const gesture = React.useRef(new DragGesture()).current;\n\n return useRecognizer([['drag', gesture, callback, config]]);\n}\n","import * as React from 'react';\nimport {\n DragGesture,\n MouseMoveGesture,\n ScrollGesture,\n WheelGesture,\n} from '../controllers';\nimport {\n DragEventType,\n WheelEventType,\n ScrollEventType,\n MouseMoveEventType,\n} from '../types';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useGesture({\n onDrag,\n onWheel,\n onScroll,\n onMouseMove,\n}: {\n onDrag?: (event: DragEventType) => void;\n onWheel?: (event: WheelEventType) => void;\n onScroll?: (event: ScrollEventType) => void;\n onMouseMove?: (event: MouseMoveEventType) => void;\n}) {\n const dragGesture = React.useRef(new DragGesture()).current;\n const wheelGesture = React.useRef(new WheelGesture()).current;\n const scrollGesture = React.useRef(new ScrollGesture()).current;\n const mouseMoveGesture = React.useRef(new MouseMoveGesture()).current;\n\n return useRecognizer([\n ['drag', dragGesture, onDrag],\n ['wheel', wheelGesture, onWheel],\n ['scroll', scrollGesture, onScroll],\n ['move', mouseMoveGesture, onMouseMove],\n ]);\n}\n","import { useRef, useEffect, DependencyList, createRef } from 'react';\n\ntype MeasurementValue = number | Array<number>;\n\ntype MeasurementType = {\n left: MeasurementValue;\n top: MeasurementValue;\n width: MeasurementValue;\n height: MeasurementValue;\n vLeft: MeasurementValue;\n vTop: MeasurementValue;\n};\n\nexport function useMeasure(\n callback: (event: MeasurementType) => void,\n deps?: DependencyList\n) {\n const ref = useRef(null);\n const elementRefs = useRef([]);\n const callbackRef = useRef<(event: MeasurementType) => void>(callback);\n\n // Reinitiate callback when dependency change\n useEffect(() => {\n callbackRef.current = callback;\n\n return () => {\n callbackRef.current = () => false;\n };\n }, deps);\n\n useEffect(() => {\n const _refElement = ref.current || document.documentElement;\n const _refElementsMultiple = elementRefs.current;\n\n const resizeObserver = new ResizeObserver(([entry]) => {\n const { left, top, width, height } = entry.target.getBoundingClientRect();\n const { pageXOffset, pageYOffset } = window;\n\n if (callbackRef) {\n if (_refElement === document.documentElement) {\n return; // no-op for document\n } else {\n callbackRef.current({\n left: left + pageXOffset,\n top: top + pageYOffset,\n width,\n height,\n vLeft: left,\n vTop: top,\n });\n }\n }\n });\n\n const resizeObserverMultiple = new ResizeObserver((entries) => {\n const left: Array<number> = [];\n const top: Array<number> = [];\n const width: Array<number> = [];\n const height: Array<number> = [];\n const vLeft: Array<number> = [];\n const vTop: Array<number> = [];\n\n entries.forEach((entry) => {\n const {\n left: _left,\n top: _top,\n width: _width,\n height: _height,\n } = entry.target.getBoundingClientRect();\n const { pageXOffset, pageYOffset } = window;\n const _pageLeft = _left + pageXOffset;\n const _pageTop = _top + pageYOffset;\n\n left.push(_pageLeft);\n top.push(_pageTop);\n width.push(_width);\n height.push(_height);\n vLeft.push(_left);\n vTop.push(_top);\n });\n\n if (callbackRef) {\n callbackRef.current({\n left,\n top,\n width,\n height,\n vLeft,\n vTop,\n });\n }\n });\n\n if (_refElement) {\n if (\n _refElement === document.documentElement &&\n _refElementsMultiple.length > 0\n ) {\n _refElementsMultiple.forEach((element: any) => {\n resizeObserverMultiple.observe(element.current);\n });\n } else {\n resizeObserver.observe(_refElement);\n }\n }\n\n return () => {\n if (_refElement) {\n if (\n _refElement === document.documentElement &&\n _refElementsMultiple.length > 0\n ) {\n _refElementsMultiple.forEach((element: any) => {\n resizeObserverMultiple.unobserve(element.current);\n });\n } else {\n resizeObserver.unobserve(_refElement);\n }\n }\n };\n }, []);\n\n return (index?: number) => {\n if (index === null || index === undefined) {\n return { ref };\n } else {\n elementRefs.current[index] = elementRefs.current[index] || createRef();\n\n return { ref: elementRefs.current[index] };\n }\n }; // ...bind() or ...bind(index) for multiple\n}\n","import * as React from 'react';\n\nimport { MouseMoveEventType } from '../types';\nimport { MouseMoveGesture } from '../controllers';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useMouseMove(callback: (event: MouseMoveEventType) => void) {\n const gesture = React.useRef(new MouseMoveGesture()).current;\n\n return useRecognizer([['move', gesture, callback]]);\n}\n","import { useRef, useEffect, RefObject, DependencyList } from 'react';\n\nimport { attachEvents } from '../gestures/helpers/eventAttacher';\n\nexport function useOutsideClick(\n elementRef: RefObject<HTMLElement>,\n callback: (event: MouseEvent) => void,\n deps?: DependencyList\n) {\n const callbackRef = useRef<(event: MouseEvent) => void>();\n\n if (!callbackRef.current) {\n callbackRef.current = callback;\n }\n\n // Reinitiate callback when dependency change\n useEffect(() => {\n callbackRef.current = callback;\n\n return () => {\n callbackRef.current = () => false;\n };\n }, deps);\n\n useEffect(() => {\n const handleOutsideClick = (e: MouseEvent) => {\n if (!elementRef?.current?.contains(e.target as Element)) {\n callbackRef.current && callbackRef.current(e);\n }\n };\n\n const subscribe = attachEvents([document], [['click', handleOutsideClick]]);\n\n return () => subscribe && subscribe();\n }, []);\n}\n","import * as React from 'react';\n\nimport { ScrollEventType } from '../types';\nimport { ScrollGesture } from '../controllers';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useScroll(callback: (event: ScrollEventType) => void) {\n const gesture = React.useRef(new ScrollGesture()).current;\n\n return useRecognizer([['scroll', gesture, callback]]);\n}\n","import * as React from 'react';\n\nimport { WheelEventType } from '../types';\nimport { WheelGesture } from '../controllers';\nimport { useRecognizer } from './useRecognizer';\n\nexport function useWheel(callback: (event: WheelEventType) => void) {\n const gesture = React.useRef(new WheelGesture()).current;\n\n return useRecognizer([['wheel', gesture, callback]]);\n}\n","import { useRef, useEffect, DependencyList } from 'react';\n\ntype WindowDimensionType = {\n width: number;\n height: number;\n innerWidth: number;\n innerHeight: number;\n};\n\nexport function useWindowDimension(\n callback: (event: WindowDimensionType) => void,\n deps?: DependencyList\n) {\n const windowDimensionsRef = useRef<WindowDimensionType>({\n width: 0,\n height: 0,\n innerWidth: 0,\n innerHeight: 0,\n });\n const callbackRef = useRef<(event: WindowDimensionType) => void>(callback);\n\n const handleCallback: () => void = () => {\n if (callbackRef) {\n callbackRef.current({\n ...windowDimensionsRef.current,\n });\n }\n };\n\n // Reinitiate callback when dependency change\n useEffect(() => {\n callbackRef.current = callback;\n\n return () => {\n callbackRef.current = () => false;\n };\n }, deps);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(([entry]) => {\n const { clientWidth, clientHeight } = entry.target;\n const { innerWidth, innerHeight } = window;\n\n windowDimensionsRef.current = {\n width: clientWidth,\n height: clientHeight,\n innerWidth,\n innerHeight,\n };\n\n handleCallback();\n });\n\n resizeObserver.observe(document.documentElement);\n\n return () => resizeObserver.unobserve(document.documentElement);\n }, []);\n}\n"],"names":["interpolate","value","inputRange","outputRange","extrapolateConfig","isDefined","checkFluidValue","FluidValue","console","log","Error","FluidController","config","this","fluid","defaultConfig","prototype","runAnimation","updateValue","onComplete","__assign","removeAllListeners","onStart","get","onChange","addListener","_a","call","onRest","finished","_b","duration","immediate","toValue","timingConfig","delay","easing","timing","start","decay","decayConfig","velocity","deceleration","springConfig","mass","tension","friction","restDistance","spring","setFluid","callback","_this","nextValue","Promise","resolve","getFluid","FluidArrayController","values","fluidControllers","map","v","fc","i","useFluidValue","fluidController","useRef","Array","isArray","current","onUpdate","useCallback","useMemo","useMountedValue","state","mv","__read","useState","mounted","setMounted","from","enter","exit","innerConfig","_c","animation","setAnimation","useLayoutEffect","queueMicrotask","getSubscriptions","forEach","s","removeSubscription","useMount","cb","a","m","getInitialConfig","animationType","Easing","bounce","bezier","linear","in","ease","out","inOut","AnimationConfigUtils","ELASTIC","BOUNCE","EASE","STIFF","WOOBLE","EASE_IN","EASE_OUT","EASE_IN_OUT","POWER1","POWER2","POWER3","POWER4","LINEAR","getValue","useAnimatedValue","initialValue","isInitialRender","currentValue","targetObject","updateAnimation","Proxy","set","_","key","bin","bool","clamp","lowerbound","upperbound","Math","min","max","rubber","distanceFromEdge","dimension","constant","abs","Infinity","pow","rubber2","withConfig","attachEvents","domTargets","events","subscribers","Map","event","capture","target","addEventListener","removeEventListener","attachEvent","eventKeys","__values","entries","next","done","_d","eventKey","subscriber","indexOf","withDefault","x","y","Gesture","lastTimeStamp","Date","now","isActive","targetElements","_initEvents","_cancelEvents","_subscribe","applyCallback","applyGesture","targetElement","element","_VELOCITY_LIMIT","DragGesture","_super","movementStart","initialMovement","movement","previousMovement","translation","offset","__extends","length","window","pointerDown","bind","pointerMove","pointerUp","passive","_handleCallback","args","currentIndex","down","movementX","movementY","offsetX","offsetY","velocityX","velocityY","distanceX","distanceY","directionX","sign","directionY","cancel","e","type","touches","clientX","clientY","currElem","find","elem","preventDefault","initial","initialMovementX","initialMovementY","deltaTime","t","MouseMoveGesture","direction","onMouseMove","isMoving","mouseX","mouseY","isActiveID","clearTimeout","setTimeout","diffX","diffY","ScrollGesture","scrollElementListener","scrollListener","isScrolling","scrollX","scrollY","onScroll","pageYOffset","pageXOffset","scrollLeft","scrollTop","WheelGesture","delta","onWheel","isWheeling","deltaX","deltaY","deltaMode","useRecognizer","handlers","ref","React","elementRefs","useEffect","_e","keyIndex","gesture","unsubscribe","index","createRef","children","open","_jsx","_Fragment","props","animationConfig","threshold","scrollableBlockRef","_scrollableBlock","observer","IntersectionObserver","isIntersecting","root","observe","unobserve","amv","minOutput","maxOutput","checkedValue","_interpolate","ms","perc","val1","val2","array","moveIndex","toIndex","item","diff","__spreadArray","slice","targetIndex","snapPoints","finalValue","getDiff","point","deltas","minDelta","reduce","acc","onDrag","dragGesture","wheelGesture","scrollGesture","mouseMoveGesture","deps","callbackRef","_refElement","document","documentElement","_refElementsMultiple","resizeObserver","ResizeObserver","getBoundingClientRect","left","top","width","height","vLeft","vTop","resizeObserverMultiple","entry","_left","_top","_width","_height","_pageLeft","_pageTop","push","elementRef","subscribe","contains","windowDimensionsRef","innerWidth","innerHeight","clientWidth","clientHeight","configs","__awaiter","configs_1","configs_1_1","sent"],"mappings":"wWAUaA,EAAc,SACzBC,EACAC,EACAC,EACAC,GACG,OAAAH,EAAMD,YAAYE,EAAYC,EAAaC,EAAkB,ECfrDC,EAAY,SAAIJ,GAC3B,OAAOA,OACT,ECMA,SAASK,EAAgBL,GACvB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GAAE,GACL,yClBYyB,SAACrT,GAA6B,MAAC,CACtDA,UACE2B,OAAO,GACJ3B,GAEJ,oBA+BsB,SACvBuB,EACAiD,GACG,OACAhE,EAAAA,EAAA,CAAA,EAAAgE,IACHxE,OAAMQ,EAAAA,EAAA,GACDgE,EAAUxE,QAAM,CACnBuB,MAAKA,KAJJ,mBA7EmB,SAACF,EAAiBrB,GACxC,OAAAuI,EAAWlH,EAAOb,EAAAA,EAAA,GAAOsF,EAAqBG,MAASjG,GAAvD,uBAiD0B,SAC1BiV,GAQA,OAAO,SACL3L,GAA0E,OAAA4L,OAAA,OAAA,OAAA,GAAA,oGAErDC,EAAA/L,EAAA6L,GAAOG,EAAAD,EAAA7L,6CAAjBtJ,EAAMoV,EAAA/V,MACf,CAAA,EAAMiK,EAAuB,iBAAXtJ,EAAsB,CAAEqB,QAASrB,GAAWA,YAA9DkB,EAAAmU,0NAGN,qBArD0B,SAAChU,EAAiBrB,GAC1C,OAAAuI,EAAWlH,EAAOb,EAAAA,EAAA,GAAOsF,EAAqBC,SAAY/F,GAA1D,qBAYwB,SAACqB,EAAiBrB,GAC1C,OAAAuI,EAAWlH,EAAOb,EAAA,CAAIW,SAAU,KAAQnB,GAAxC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "react-ui-animate",
3
- "version": "4.0.0-alpha.0",
3
+ "version": "4.0.0-rc.0",
4
4
  "description": "React library for gestures and animation",
5
5
  "main": "dist/index.js",
6
6
  "peerDependencies": {
7
7
  "react": ">=16.8.0 || >=17.0.0 || >=18.0.0"
8
8
  },
9
9
  "dependencies": {
10
- "@raidipesh78/re-motion": "^4.0.0-alpha.3"
10
+ "@raidipesh78/re-motion": "^4.0.1"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@rollup/plugin-terser": "^0.4.4",