react-ui-animate 3.3.2 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +209 -209
  3. package/dist/index.js.map +1 -1
  4. package/package.json +52 -52
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Dipesh Rai
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Dipesh Rai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,209 +1,209 @@
1
- # React UI Animate
2
-
3
- [![npm version](https://badge.fury.io/js/react-ui-animate.svg)](https://badge.fury.io/js/react-ui-animate)
4
-
5
- > Create smooth animations and interactive gestures in React applications effortlessly.
6
-
7
- ### Install
8
-
9
- You can install react-ui-animate via npm or yarn:
10
-
11
- ```sh
12
- npm i react-ui-animate
13
- ```
14
-
15
- ```sh
16
- yarn add react-ui-animate
17
- ```
18
-
19
- ### Getting Started
20
-
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
-
23
- ```javascript
24
- import { AnimatedBlock, useAnimatedValue } from 'react-ui-animate';
25
-
26
- export default function () {
27
- // Initialize an animated opacity value
28
- const opacity = useAnimatedValue(0);
29
-
30
- return (
31
- <div>
32
- {/* AnimatedBlock component uses the animated opacity value */}
33
- <AnimatedBlock
34
- style={{
35
- opacity: opacity.value, // using opacity with value property
36
- width: 100,
37
- padding: 20,
38
- background: '#39F',
39
- }}
40
- >
41
- ANIMATED
42
- </AnimatedBlock>
43
-
44
- {/* Clicking the button changes the opacity smoothly to 1 */}
45
- <button onClick={() => (opacity.value = 1)}>Animate Me</button>
46
- </div>
47
- );
48
- }
49
- ```
50
-
51
- In this example, clicking the "Animate Me" button smoothly changes the opacity of the animated block from 0 to 1.
52
-
53
- ### Key Features
54
-
55
- #### `useAnimatedValue()`
56
-
57
- The `useAnimatedValue()` hook is central to creating animations. It initializes an animated value and allows you to seamlessly update it to create dynamic effects.
58
-
59
- ```javascript
60
- const opacity = useAnimatedValue(0); // Start with opacity set to 0
61
-
62
- // Use in style
63
- style={{
64
- opacity: opacity.value, // Access the animated opacity value
65
- }}
66
-
67
- // Update the value on user interaction
68
- onClick={() => (opacity.value = 1)} // Changes the opacity to 1
69
- ```
70
-
71
- #### `AnimatedBlock`
72
-
73
- `AnimatedBlock` is a special component designed to work with `useAnimatedValue()`. It simplifies animating elements by directly using animated values.
74
-
75
- ```javascript
76
- const width = useAnimatedValue(100); // Start with a width of 100
77
-
78
- <AnimatedBlock
79
- style={{
80
- width: width.value,
81
- height: 100,
82
- backgroundColor: '#39f',
83
- }}
84
- />;
85
- ```
86
-
87
- #### `interpolate`
88
-
89
- The `interpolate()` function is useful for mapping values from one range to another, enabling more complex animations.
90
-
91
- ```javascript
92
- import { useAnimatedValue, AnimatedBlock, interpolate } from 'react-ui-animate';
93
-
94
- const width = useAnimatedValue(100); // Start with a width of 100
95
-
96
- <AnimatedBlock
97
- style={{
98
- width: width.value,
99
- height: 100,
100
- backgroundColor: interpolate(width.value, [100, 200], ['red', 'blue']),
101
- }}
102
- />;
103
- ```
104
-
105
- In this example, as the width changes from 100 to 200, the background color smoothly transitions from red to blue.
106
-
107
- #### Dynamic Animations and Sequence Transitions
108
-
109
- You can dynamically modify animation configurations by assigning values to an animated value using various animation functions.
110
-
111
- To apply a spring animation and update the value to `10`:
112
-
113
- ```jsx
114
- x.value = withSpring(10);
115
- ```
116
-
117
- To apply a timing animation with a duration of 5000 milliseconds:
118
-
119
- ```jsx
120
- x.value = withTiming(10, { duration: 5000 });
121
- ```
122
-
123
- To create sequential transitions using the `withSequence` function with dynamic modifiers like `withSpring` and `withTiming`:
124
-
125
- ```jsx
126
- x.value = withSequence([withSpring(50), withTiming(100), 200]);
127
- ```
128
-
129
- To delay an animation using the withDelay function:
130
-
131
- ```jsx
132
- x.value = withDelay(1000, withSpring(100));
133
- ```
134
-
135
- In this example, a spring animation to `100` will be applied after a 1-second delay.
136
-
137
- #### `useMountedValue()`
138
-
139
- The `useMountedValue()` hook facilitates managing the mounting and unmounting of a component with animations.
140
-
141
- ```jsx
142
- import { useMountedValue } from 'react-ui-animate';
143
-
144
- export default function App() {
145
- const [visible, setVisible] = useState(false);
146
-
147
- const open = useMountedValue(visible, {
148
- from: 0,
149
- enter: 1,
150
- exit: 0,
151
- });
152
-
153
- return open((animation, mounted) => mounted && <AnimatedBlock />);
154
- }
155
- ```
156
-
157
- In this example,
158
-
159
- 1. A state variable `visible` determines whether the component is visible.
160
- 2. The `useMountedValue` hook takes `visible` as an argument and provides animation states for mounting and unmounting.
161
- 3. The `open` function, returned by `useMountedValue`, is used to conditionally render `AnimatedBlock` based on the `mounted` boolean and apply the transition animation.
162
-
163
- ### Gestures
164
-
165
- The `react-ui-animate` library also provides several hooks for handling different types of gestures:
166
-
167
- 1. `useDrag`: Handles drag gestures on elements.
168
- 2. `useMouseMove`: Handles mouse movements.
169
- 3. `useScroll`: Handles scrolling of the document.
170
- 4. `useWheel`: Handles wheel rotation gestures.
171
- 5. `useGesture`: Handles combinations of various gestures.
172
-
173
- **Example**: `useDrag`
174
-
175
- Here’s an example of using the useDrag hook to enable drag gestures:
176
-
177
- ```jsx
178
- import { useAnimatedValue, AnimatedBlock, useDrag } from 'react-ui-animate';
179
-
180
- export const Draggable = () => {
181
- const translateX = useAnimatedValue(0);
182
-
183
- const bind = useDrag(function ({ down, movementX }) {
184
- translateX.value = down ? movementX : 0;
185
- });
186
-
187
- return (
188
- <AnimatedBlock
189
- {...bind()}
190
- style={{
191
- width: 100,
192
- height: 100,
193
- backgroundColor: '#3399ff',
194
- translateX: translateX.value, // Use translateX with animated value
195
- }}
196
- />
197
- );
198
- };
199
- ```
200
-
201
- In this example, the blue block can be dragged horizontally by clicking and dragging.
202
-
203
- ## Documentation
204
-
205
- For detailed documentation and examples, visit the official [react-ui-animate documentation](http://react-ui-animate.js.org/).
206
-
207
- ## License
208
-
209
- This library is licensed under the MIT License.
1
+ # React UI Animate
2
+
3
+ [![npm version](https://badge.fury.io/js/react-ui-animate.svg)](https://badge.fury.io/js/react-ui-animate)
4
+
5
+ > Create smooth animations and interactive gestures in React applications effortlessly.
6
+
7
+ ### Install
8
+
9
+ You can install react-ui-animate via npm or yarn:
10
+
11
+ ```sh
12
+ npm i react-ui-animate
13
+ ```
14
+
15
+ ```sh
16
+ yarn add react-ui-animate
17
+ ```
18
+
19
+ ### Getting Started
20
+
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
+
23
+ ```javascript
24
+ import { AnimatedBlock, useAnimatedValue } from 'react-ui-animate';
25
+
26
+ export default function () {
27
+ // Initialize an animated opacity value
28
+ const opacity = useAnimatedValue(0);
29
+
30
+ return (
31
+ <div>
32
+ {/* AnimatedBlock component uses the animated opacity value */}
33
+ <AnimatedBlock
34
+ style={{
35
+ opacity: opacity.value, // using opacity with value property
36
+ width: 100,
37
+ padding: 20,
38
+ background: '#39F',
39
+ }}
40
+ >
41
+ ANIMATED
42
+ </AnimatedBlock>
43
+
44
+ {/* Clicking the button changes the opacity smoothly to 1 */}
45
+ <button onClick={() => (opacity.value = 1)}>Animate Me</button>
46
+ </div>
47
+ );
48
+ }
49
+ ```
50
+
51
+ In this example, clicking the "Animate Me" button smoothly changes the opacity of the animated block from 0 to 1.
52
+
53
+ ### Key Features
54
+
55
+ #### `useAnimatedValue()`
56
+
57
+ The `useAnimatedValue()` hook is central to creating animations. It initializes an animated value and allows you to seamlessly update it to create dynamic effects.
58
+
59
+ ```javascript
60
+ const opacity = useAnimatedValue(0); // Start with opacity set to 0
61
+
62
+ // Use in style
63
+ style={{
64
+ opacity: opacity.value, // Access the animated opacity value
65
+ }}
66
+
67
+ // Update the value on user interaction
68
+ onClick={() => (opacity.value = 1)} // Changes the opacity to 1
69
+ ```
70
+
71
+ #### `AnimatedBlock`
72
+
73
+ `AnimatedBlock` is a special component designed to work with `useAnimatedValue()`. It simplifies animating elements by directly using animated values.
74
+
75
+ ```javascript
76
+ const width = useAnimatedValue(100); // Start with a width of 100
77
+
78
+ <AnimatedBlock
79
+ style={{
80
+ width: width.value,
81
+ height: 100,
82
+ backgroundColor: '#39f',
83
+ }}
84
+ />;
85
+ ```
86
+
87
+ #### `interpolate`
88
+
89
+ The `interpolate()` function is useful for mapping values from one range to another, enabling more complex animations.
90
+
91
+ ```javascript
92
+ import { useAnimatedValue, AnimatedBlock, interpolate } from 'react-ui-animate';
93
+
94
+ const width = useAnimatedValue(100); // Start with a width of 100
95
+
96
+ <AnimatedBlock
97
+ style={{
98
+ width: width.value,
99
+ height: 100,
100
+ backgroundColor: interpolate(width.value, [100, 200], ['red', 'blue']),
101
+ }}
102
+ />;
103
+ ```
104
+
105
+ In this example, as the width changes from 100 to 200, the background color smoothly transitions from red to blue.
106
+
107
+ #### Dynamic Animations and Sequence Transitions
108
+
109
+ You can dynamically modify animation configurations by assigning values to an animated value using various animation functions.
110
+
111
+ To apply a spring animation and update the value to `10`:
112
+
113
+ ```jsx
114
+ x.value = withSpring(10);
115
+ ```
116
+
117
+ To apply a timing animation with a duration of 5000 milliseconds:
118
+
119
+ ```jsx
120
+ x.value = withTiming(10, { duration: 5000 });
121
+ ```
122
+
123
+ To create sequential transitions using the `withSequence` function with dynamic modifiers like `withSpring` and `withTiming`:
124
+
125
+ ```jsx
126
+ x.value = withSequence([withSpring(50), withTiming(100), 200]);
127
+ ```
128
+
129
+ To delay an animation using the withDelay function:
130
+
131
+ ```jsx
132
+ x.value = withDelay(1000, withSpring(100));
133
+ ```
134
+
135
+ In this example, a spring animation to `100` will be applied after a 1-second delay.
136
+
137
+ #### `useMountedValue()`
138
+
139
+ The `useMountedValue()` hook facilitates managing the mounting and unmounting of a component with animations.
140
+
141
+ ```jsx
142
+ import { useMountedValue } from 'react-ui-animate';
143
+
144
+ export default function App() {
145
+ const [visible, setVisible] = useState(false);
146
+
147
+ const open = useMountedValue(visible, {
148
+ from: 0,
149
+ enter: 1,
150
+ exit: 0,
151
+ });
152
+
153
+ return open((animation, mounted) => mounted && <AnimatedBlock />);
154
+ }
155
+ ```
156
+
157
+ In this example,
158
+
159
+ 1. A state variable `visible` determines whether the component is visible.
160
+ 2. The `useMountedValue` hook takes `visible` as an argument and provides animation states for mounting and unmounting.
161
+ 3. The `open` function, returned by `useMountedValue`, is used to conditionally render `AnimatedBlock` based on the `mounted` boolean and apply the transition animation.
162
+
163
+ ### Gestures
164
+
165
+ The `react-ui-animate` library also provides several hooks for handling different types of gestures:
166
+
167
+ 1. `useDrag`: Handles drag gestures on elements.
168
+ 2. `useMouseMove`: Handles mouse movements.
169
+ 3. `useScroll`: Handles scrolling of the document.
170
+ 4. `useWheel`: Handles wheel rotation gestures.
171
+ 5. `useGesture`: Handles combinations of various gestures.
172
+
173
+ **Example**: `useDrag`
174
+
175
+ Here’s an example of using the useDrag hook to enable drag gestures:
176
+
177
+ ```jsx
178
+ import { useAnimatedValue, AnimatedBlock, useDrag } from 'react-ui-animate';
179
+
180
+ export const Draggable = () => {
181
+ const translateX = useAnimatedValue(0);
182
+
183
+ const bind = useDrag(function ({ down, movementX }) {
184
+ translateX.value = down ? movementX : 0;
185
+ });
186
+
187
+ return (
188
+ <AnimatedBlock
189
+ {...bind()}
190
+ style={{
191
+ width: 100,
192
+ height: 100,
193
+ backgroundColor: '#3399ff',
194
+ translateX: translateX.value, // Use translateX with animated value
195
+ }}
196
+ />
197
+ );
198
+ };
199
+ ```
200
+
201
+ In this example, the blue block can be dragged horizontally by clicking and dragging.
202
+
203
+ ## Documentation
204
+
205
+ For detailed documentation and examples, visit the official [react-ui-animate documentation](http://react-ui-animate.js.org/).
206
+
207
+ ## License
208
+
209
+ This library is licensed under the MIT License.
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/modules/AnimatedBlock.ts","../src/animation/modules/AnimatedInline.ts","../src/animation/modules/AnimatedImage.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> => {\r\n return value !== null && value !== undefined;\r\n};\r\n","import {\r\n ExtrapolateConfig,\r\n FluidValue,\r\n isFluidValue,\r\n interpolate as internalInterpolate,\r\n} from '@raidipesh78/re-motion';\r\n\r\nimport { isDefined } from './helpers';\r\nimport { ValueType } from './useAnimatedValue';\r\n\r\nfunction checkFluidValueOrNumber(value: unknown): number | FluidValue {\r\n if (\r\n !isDefined(value) ||\r\n !(typeof value === 'number' || isFluidValue(value))\r\n ) {\r\n console.log(value);\r\n throw new Error(\r\n `Invalid ${value} type for interpolate function. Expected number or FluidValue.`\r\n );\r\n }\r\n return value;\r\n}\r\n\r\n/**\r\n * Maps the input range to the given output range using the specified extrapolation configuration.\r\n * The function ensures that the value is either a number or a FluidValue.\r\n *\r\n * @param value - The value to be interpolated, which must be a number or FluidValue.\r\n * @param inputRange - An array of numbers defining the input range.\r\n * @param outputRange - An array of numbers or strings defining the output range.\r\n * @param extrapolateConfig - The extrapolation configuration, which can be \"clamp\", \"identity\", or \"extend\".\r\n * @returns - The interpolated value, which will be a number or FluidValue.\r\n * @throws - Will throw an error if the value is not a number or FluidValue.\r\n */\r\nexport function interpolate(\r\n value: FluidValue | ValueType | number,\r\n inputRange: Array<number>,\r\n outputRange: Array<number | string>,\r\n extrapolateConfig?: ExtrapolateConfig\r\n) {\r\n const checkedValue = checkFluidValueOrNumber(value);\r\n\r\n return internalInterpolate(\r\n checkedValue,\r\n inputRange,\r\n outputRange,\r\n extrapolateConfig\r\n );\r\n}\r\n\r\n/**\r\n * A shorthand function for interpolate that maps the input range [0, 1] to the given [minOutput, maxOutput].\r\n * The function ensures that the value is either a number or a FluidValue.\r\n *\r\n * @param value - The value to be interpolated, which must be a number or FluidValue.\r\n * @param minOutput - The minimum value of the output range, which can be a number or string.\r\n * @param maxOutput - The maximum value of the output range, which can be a number or string.\r\n * @param extrapolateConfig - The extrapolation configuration, which can be \"clamp\", \"identity\", or \"extend\".\r\n * @returns - The interpolated value, which will be a number or FluidValue.\r\n * @throws - Will throw an error if the value is not a number or FluidValue.\r\n */\r\nexport function bInterpolate(\r\n value: FluidValue | ValueType | number,\r\n minOutput: number | string,\r\n maxOutput: number | string,\r\n extrapolateConfig?: ExtrapolateConfig\r\n) {\r\n const checkedValue = checkFluidValueOrNumber(value);\r\n\r\n return internalInterpolate(\r\n checkedValue,\r\n [0, 1],\r\n [minOutput, maxOutput],\r\n extrapolateConfig\r\n );\r\n}\r\n","import { makeFluid } from '@raidipesh78/re-motion';\r\n\r\n/**\r\n * AnimatedBlock - A higher order component built upon `div` element\r\n * which can accept `AnimatedValue`. It also exposes some extra style properties like\r\n * translateX, translateY, rotateX, rotateY, scaleX, etc.\r\n */\r\nexport const AnimatedBlock = makeFluid('div');\r\n","import { makeFluid } from '@raidipesh78/re-motion';\r\n\r\n/**\r\n * AnimatedInline - A higher order component built upon `span` element\r\n * which can accept `AnimatedValue`. It also exposes some extra style properties like\r\n * translateX, translateY, rotateX, rotateY, scaleX, etc.\r\n */\r\nexport const AnimatedInline = makeFluid('span');\r\n","import { makeFluid } from '@raidipesh78/re-motion';\r\n\r\n/**\r\n * AnimatedImage - A higher order component built upon `img` element\r\n * which can accept `AnimatedValue`. It also exposes some extra style properties like\r\n * translateX, translateY, rotateX, rotateY, scaleX, etc.\r\n */\r\nexport const AnimatedImage = makeFluid('img');\r\n","import { useMount, UseMountConfig, FluidValue } from '@raidipesh78/re-motion';\r\n\r\nexport interface UseMountedValueConfig extends UseMountConfig {}\r\n\r\n/**\r\n * `useMountedValue` handles mounting and unmounting of a component which captures current state\r\n * passed as an arugment (`state`) and exposes the shadow state which handles the mount and unmount\r\n * of a component.\r\n *\r\n * @param { boolean } state - Boolean indicating the component should mount or unmount.\r\n * @param { UseMountedValueConfig } config - Animation configuration.\r\n */\r\nexport function useMountedValue(state: boolean, config: UseMountedValueConfig) {\r\n const mv = useMount(state, config);\r\n return (\r\n cb: (value: { value: FluidValue }, mounted: boolean) => React.ReactNode\r\n ) => mv((a, m) => cb({ value: a }, m));\r\n}\r\n","import * as React from 'react';\r\nimport type { FluidValueConfig, Length } from '@raidipesh78/re-motion';\r\n\r\nimport { useMountedValue } from '../useMountedValue';\r\nimport { ValueType } from '../useAnimatedValue';\r\n\r\ninterface MountedValueConfig extends FluidValueConfig {}\r\n\r\ntype AssignValue = {\r\n toValue?: Length;\r\n config?: MountedValueConfig;\r\n};\r\n\r\ninterface MountedBlockProps {\r\n state: boolean;\r\n children: (animation: { value: ValueType }) => React.ReactNode;\r\n from?: number;\r\n enter?:\r\n | number\r\n | AssignValue\r\n | ((update: (next: AssignValue) => Promise<any>) => void);\r\n exit?:\r\n | number\r\n | AssignValue\r\n | ((update: (next: AssignValue) => Promise<any>) => void);\r\n config?: MountedValueConfig;\r\n}\r\n\r\n/**\r\n * MountedBlock - Higher order component which handles mounting and unmounting of a component.\r\n * @param { boolean } state - Boolean indicating the component should mount or unmount.\r\n * @param { function } children - Child as a function with `AnimatedValue` on `.value` property.\r\n * @param { number } } from - Number that dictates the beginning state for animation.\r\n * @param { number | { toValue: number, config: MountedValueConfig } } enter - Number that dictates the entry state for animation.\r\n * @param { number | { toValue: number, config: MountedValueConfig } } exit - Number that dictates the exit state for animation.\r\n * @param { MountedValueConfig } config - Animation configuration for overall animation.\r\n */\r\nexport const MountedBlock = ({\r\n state,\r\n children,\r\n from = 0,\r\n enter = 1,\r\n exit = 0,\r\n config,\r\n}: MountedBlockProps) => {\r\n const open = useMountedValue(state, {\r\n from,\r\n enter,\r\n exit,\r\n config,\r\n });\r\n\r\n return (\r\n <>\r\n {open(\r\n (animation, mounted) =>\r\n mounted && children({ value: animation.value as any })\r\n )}\r\n </>\r\n );\r\n};\r\n","import { Easing, FluidValueConfig } from '@raidipesh78/re-motion';\r\n\r\ntype InitialConfigType =\r\n | 'linear'\r\n | 'easein'\r\n | 'easeout'\r\n | 'easeinout'\r\n | 'ease'\r\n | 'power1'\r\n | 'power2'\r\n | 'power3'\r\n | 'power4'\r\n | 'elastic'\r\n | 'stiff'\r\n | 'wooble'\r\n | 'bounce';\r\n\r\nconst getInitialConfig = (\r\n animationType?: InitialConfigType\r\n): FluidValueConfig => {\r\n switch (animationType) {\r\n case 'elastic':\r\n return { mass: 1, friction: 18, tension: 250 };\r\n\r\n case 'stiff':\r\n return { mass: 1, friction: 18, tension: 350 };\r\n\r\n case 'wooble':\r\n return { mass: 1, friction: 8, tension: 250 };\r\n\r\n case 'bounce':\r\n return { duration: 500, easing: Easing.bounce };\r\n\r\n case 'power1':\r\n return { duration: 500, easing: Easing.bezier(0.17, 0.42, 0.51, 0.97) };\r\n\r\n case 'power2':\r\n return { duration: 500, easing: Easing.bezier(0.07, 0.11, 0.13, 1) };\r\n\r\n case 'power3':\r\n return { duration: 500, easing: Easing.bezier(0.09, 0.7, 0.16, 1.04) };\r\n\r\n case 'power4':\r\n return { duration: 500, easing: Easing.bezier(0.05, 0.54, 0, 1.03) };\r\n\r\n case 'linear':\r\n return { duration: 500, easing: Easing.linear };\r\n\r\n case 'easein':\r\n return { duration: 500, easing: Easing.in(Easing.ease) };\r\n\r\n case 'easeout':\r\n return { duration: 500, easing: Easing.out(Easing.ease) };\r\n\r\n case 'easeinout':\r\n return { duration: 500, easing: Easing.inOut(Easing.ease) };\r\n\r\n case 'ease':\r\n default:\r\n return { mass: 1, friction: 34, tension: 290 };\r\n }\r\n};\r\n\r\nexport const AnimationConfigUtils = {\r\n ELASTIC: getInitialConfig('elastic'),\r\n BOUNCE: getInitialConfig('bounce'),\r\n EASE: getInitialConfig('ease'),\r\n STIFF: getInitialConfig('stiff'),\r\n WOOBLE: getInitialConfig('wooble'),\r\n EASE_IN: getInitialConfig('easein'),\r\n EASE_OUT: getInitialConfig('easeout'),\r\n EASE_IN_OUT: getInitialConfig('easeinout'),\r\n POWER1: getInitialConfig('power1'),\r\n POWER2: getInitialConfig('power2'),\r\n POWER3: getInitialConfig('power3'),\r\n POWER4: getInitialConfig('power4'),\r\n LINEAR: getInitialConfig('linear'),\r\n};\r\n","import { useFluidValue, FluidValueConfig } from '@raidipesh78/re-motion';\r\n\r\nimport { AnimationConfigUtils } from './animationType';\r\n\r\n// useAnimatedValue value type\r\ntype Length = number | string;\r\n\r\nexport interface UseAnimatedValueConfig extends FluidValueConfig {}\r\n\r\ntype AssignValue = {\r\n toValue?: Length;\r\n config?: UseAnimatedValueConfig;\r\n};\r\n\r\nexport type ValueType =\r\n | Length\r\n | AssignValue\r\n | ((update: (next: AssignValue) => Promise<any>) => void);\r\n/**\r\n * `useAnimatedValue` returns an animation value with `.value` and `.currentValue` property which is\r\n * initialized when passed to argument (`initialValue`). The retured value persist until the lifetime of\r\n * a component. It doesnot cast any re-renders which can is very good for performance optimization.\r\n *\r\n * @param { string | number } initialValue - Initial value\r\n * @param { UseAnimatedValueConfig } config - Animation configuration object.\r\n */\r\nexport function useAnimatedValue(\r\n initialValue: Length,\r\n config?: UseAnimatedValueConfig\r\n) {\r\n const [animation, setAnimation] = useFluidValue(initialValue, {\r\n ...AnimationConfigUtils.EASE,\r\n ...config,\r\n });\r\n\r\n const targetObject: {\r\n value: ValueType;\r\n currentValue: number | string;\r\n } = {\r\n value: animation as any,\r\n currentValue: animation.get(),\r\n };\r\n\r\n return new Proxy(targetObject, {\r\n set: function (_, key, value: ValueType) {\r\n if (key === 'value') {\r\n if (typeof value === 'number' || typeof value === 'string') {\r\n queueMicrotask(() => setAnimation({ toValue: value }));\r\n } else if (typeof value === 'object' || typeof value === 'function') {\r\n queueMicrotask(() => setAnimation(value));\r\n }\r\n\r\n return true;\r\n }\r\n\r\n throw new Error('You cannot set any other property to animation node.');\r\n },\r\n get: function (_, key) {\r\n if (key === 'value') {\r\n return animation;\r\n }\r\n\r\n if (key === 'currentValue') {\r\n return animation.get();\r\n }\r\n\r\n throw new Error(\r\n 'You cannot access any other property from animation node.'\r\n );\r\n },\r\n });\r\n}\r\n","/**\r\n * bin(booleanValue)\r\n * returns 1 if booleanValue == true and 0 if booleanValue == false\r\n */\r\nexport function bin(bool: boolean) {\r\n return bool ? 1 : 0;\r\n}\r\n\r\n/**\r\n * mix(progress, a, b)\r\n * linear interpolation between a and b\r\n */\r\nexport function mix(perc: number, val1: number, val2: number) {\r\n return val1 * (1 - perc) + val2 * perc;\r\n}\r\n\r\n/**\r\n * clamp(value, min, max)\r\n * clamps value for min and max bounds\r\n */\r\nexport function clamp(value: number, lowerbound: number, upperbound: number) {\r\n return Math.min(Math.max(value, lowerbound), upperbound);\r\n}\r\n\r\nfunction rubber2(distanceFromEdge: number, constant: number) {\r\n return Math.pow(distanceFromEdge, constant * 5);\r\n}\r\n\r\nfunction rubber(distanceFromEdge: number, dimension: number, constant: number) {\r\n if (dimension === 0 || Math.abs(dimension) === Infinity)\r\n return rubber2(distanceFromEdge, constant);\r\n return (\r\n (distanceFromEdge * dimension * constant) /\r\n (dimension + constant * distanceFromEdge)\r\n );\r\n}\r\n\r\n/**\r\n * rubberClamp(value, min, max, constant?)\r\n * constant is optional : default 0.15\r\n * clamps the value for min and max value and\r\n * extends beyond min and max values with constant\r\n * factor to create elastic rubber band effect\r\n */\r\nexport function rubberClamp(\r\n value: number,\r\n lowerbound: number,\r\n upperbound: number,\r\n constant: number = 0.15\r\n) {\r\n if (constant === 0) return clamp(value, lowerbound, upperbound);\r\n\r\n if (value < lowerbound) {\r\n return (\r\n -rubber(lowerbound - value, upperbound - lowerbound, constant) +\r\n lowerbound\r\n );\r\n }\r\n\r\n if (value > upperbound) {\r\n return (\r\n +rubber(value - upperbound, upperbound - lowerbound, constant) +\r\n upperbound\r\n );\r\n }\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * snapTo(value, velocity, snapPoints[])\r\n * Calculates the final snapPoint according to given current value,\r\n * velocity and snapPoints array\r\n */\r\nexport function snapTo(\r\n value: number,\r\n velocity: number,\r\n snapPoints: Array<number>\r\n): number {\r\n const finalValue = value + velocity * 0.2;\r\n const getDiff = (point: number) => Math.abs(point - finalValue);\r\n const deltas = snapPoints.map(getDiff);\r\n const minDelta = Math.min(...deltas);\r\n\r\n return snapPoints.reduce(function (acc, point) {\r\n if (getDiff(point) === minDelta) {\r\n return point;\r\n } else {\r\n return acc;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * move(array, moveIndex, toIndex)\r\n * move array item from moveIndex to toIndex without array modification\r\n */\r\nexport function move(array: Array<any>, moveIndex: number, toIndex: number) {\r\n const item = array[moveIndex];\r\n const length = array.length;\r\n const diff = moveIndex - toIndex;\r\n\r\n if (diff > 0) {\r\n return [\r\n ...array.slice(0, toIndex),\r\n item,\r\n ...array.slice(toIndex, moveIndex),\r\n ...array.slice(moveIndex + 1, length),\r\n ];\r\n } else if (diff < 0) {\r\n const targetIndex = toIndex + 1;\r\n return [\r\n ...array.slice(0, moveIndex),\r\n ...array.slice(moveIndex + 1, targetIndex),\r\n item,\r\n ...array.slice(targetIndex, length),\r\n ];\r\n }\r\n return array;\r\n}\r\n","import * as React from 'react';\r\nimport { bin } from '../../gestures/helpers/math';\r\nimport {\r\n useAnimatedValue,\r\n UseAnimatedValueConfig,\r\n ValueType,\r\n} from '../useAnimatedValue';\r\n\r\ninterface TransitionBlockProps {\r\n state: boolean;\r\n children: (animation: { value: ValueType }) => React.ReactNode;\r\n config?: UseAnimatedValueConfig;\r\n}\r\n\r\n/**\r\n * TransitionBlock - Higher order component which animates on state change.\r\n * @prop { boolean } state - Boolean indicating the current state of animation, usually `false = 0 and true = 1`.\r\n * @prop { function } children - Child as a function with `AnimatedValue` on `.value` property.\r\n * @prop { UseAnimatedValueConfig } config - Animation configuration.\r\n */\r\nexport const TransitionBlock = ({\r\n state,\r\n children,\r\n config,\r\n}: TransitionBlockProps) => {\r\n const amv = useAnimatedValue(bin(state), config);\r\n\r\n return <>{children({ value: amv.value })}</>;\r\n};\r\n","import type { FluidValueConfig, Length } from '@raidipesh78/re-motion';\r\n\r\nimport { AnimationConfigUtils } from './animationType';\r\n\r\n// Base interfaces for callbacks\r\ninterface WithOnCallbacks\r\n extends Pick<FluidValueConfig, 'onRest' | 'onStart' | 'onChange'> {}\r\n\r\n// Configuration interfaces\r\ninterface WithEaseConfig extends WithOnCallbacks {}\r\ninterface WithSpringConfig\r\n extends Pick<FluidValueConfig, 'mass' | 'friction' | 'tension'>,\r\n WithOnCallbacks {}\r\ninterface WithTimingConfig\r\n extends Pick<FluidValueConfig, 'duration' | 'easing'>,\r\n WithOnCallbacks {}\r\ninterface WithDecayConfig\r\n extends Pick<FluidValueConfig, 'decay' | 'velocity' | 'deceleration'>,\r\n WithOnCallbacks {}\r\n\r\n/**\r\n * Creates a default animation configuration.\r\n * @param {Length} toValue - The target value of the animation.\r\n * @param {FluidValueConfig} config - Optional configuration.\r\n * @returns {{ toValue: Length; config: FluidValueConfig }}\r\n */\r\nexport const withConfig = (toValue: Length, config?: FluidValueConfig) => ({\r\n toValue,\r\n config,\r\n});\r\n\r\n/**\r\n * Creates an ease animation configuration.\r\n * @param {Length} toValue - The target value of the animation.\r\n * @param {FluidValueConfig} [config=AnimationConfigUtils.EASE] - Optional ease configuration.\r\n * @returns {{ toValue: Length; config: FluidValueConfig }}\r\n */\r\nexport const withEase = (toValue: Length, config?: WithEaseConfig) =>\r\n withConfig(toValue, { ...AnimationConfigUtils.EASE, ...config });\r\n\r\n/**\r\n * Creates a spring animation configuration.\r\n * @param {Length} toValue - The target value of the animation.\r\n * @param {WithSpringConfig} [config=AnimationConfigUtils.ELASTIC] - Optional spring configuration.\r\n * @returns {{ toValue: Length; config: WithSpringConfig }}\r\n */\r\nexport const withSpring = (toValue: Length, config?: WithSpringConfig) =>\r\n withConfig(toValue, { ...AnimationConfigUtils.ELASTIC, ...config });\r\n\r\n/**\r\n * Creates a timing animation configuration.\r\n * @param {Length} toValue - The target value of the animation.\r\n * @param {WithTimingConfig} [config={ duration: 250 }] - Optional timing configuration.\r\n * @returns {{ toValue: Length; config: WithTimingConfig }}\r\n */\r\nexport const withTiming = (toValue: Length, config?: WithTimingConfig) =>\r\n withConfig(toValue, { duration: 250, ...config });\r\n\r\n/**\r\n * Creates a decay animation configuration.\r\n * @param {WithDecayConfig} config - Optional decay configuration.\r\n * @returns {{ config: WithDecayConfig }}\r\n */\r\nexport const withDecay = (config: WithDecayConfig) => ({\r\n config,\r\n});\r\n\r\n/**\r\n * Creates a sequence of animations that run one after another.\r\n * @param {Array<{ toValue: Length; config?: FluidValueConfig } | number>} configs - An array of animation configurations or delays.\r\n * @returns {Function} An async function that runs the animations in sequence.\r\n */\r\nexport const withSequence = (\r\n configs: Array<\r\n | {\r\n toValue?: Length;\r\n config?: FluidValueConfig;\r\n }\r\n | number\r\n >\r\n) => {\r\n return async (\r\n next: (arg: { toValue?: Length; config?: FluidValueConfig }) => void\r\n ) => {\r\n for (const config of configs) {\r\n await next(typeof config === 'number' ? { toValue: config } : config);\r\n }\r\n };\r\n};\r\n\r\n/**\r\n * Adds a delay before the given animation.\r\n * @param {number} delay - The delay in milliseconds.\r\n * @param {{ toValue: Length; config?: FluidValueConfig }} animation - The animation configuration (withTiming | withSpring).\r\n * @returns {{ toValue: Length; config: FluidValueConfig }} The updated animation configuration with delay.\r\n */\r\nexport const withDelay = (\r\n delay: number,\r\n animation: { toValue: Length; config?: FluidValueConfig }\r\n) => ({\r\n ...animation,\r\n config: {\r\n ...animation.config,\r\n delay,\r\n },\r\n});\r\n","type MouseEventType =\r\n | 'click'\r\n | 'dblclick'\r\n | 'mousedown'\r\n | 'mousemove'\r\n | 'mouseup'\r\n | 'touchstart'\r\n | 'touchmove'\r\n | 'touchend'\r\n | 'mouseenter'\r\n | 'mouseleave'\r\n | 'mouseout'\r\n | 'mouseover'\r\n | 'scroll'\r\n | 'wheel'\r\n | 'contextmenu';\r\n\r\ntype DomTargetTypes = Array<Window | Document | HTMLElement>;\r\n\r\n/**\r\n * Attach single document / window event / HTMLElement\r\n */\r\nfunction attachEvent(\r\n domTargets: DomTargetTypes,\r\n event: MouseEventType,\r\n callback: (e: any) => void,\r\n capture: any = false\r\n) {\r\n domTargets.forEach((target) => {\r\n target.addEventListener(event, callback, capture);\r\n });\r\n\r\n return function () {\r\n domTargets.forEach((target) => {\r\n target.removeEventListener(event, callback, capture);\r\n });\r\n };\r\n}\r\n\r\n/**\r\n * Attach multiple document / window event / HTMLElement\r\n */\r\nexport function attachEvents(\r\n domTargets: DomTargetTypes,\r\n events: Array<\r\n [event: MouseEventType, callback: (e: any) => void, capture?: any]\r\n >\r\n) {\r\n const subscribers = new Map();\r\n\r\n events.forEach(function ([event, callback, capture = false]) {\r\n subscribers.set(event, attachEvent(domTargets, event, callback, capture));\r\n });\r\n\r\n return function (eventKeys?: Array<string>) {\r\n for (const [eventKey, subscriber] of subscribers.entries()) {\r\n if (!eventKeys) {\r\n subscriber();\r\n return;\r\n }\r\n\r\n if (eventKeys.indexOf(eventKey) !== -1) {\r\n subscriber();\r\n }\r\n }\r\n };\r\n}\r\n","export const withDefault = (x: number, y: number) => {\r\n return { x, y };\r\n};\r\n","export class Gesture {\r\n currentIndex?: number;\r\n lastTimeStamp: number = Date.now();\r\n isActive: boolean = false;\r\n targetElement?: HTMLElement; // represents the bounded element\r\n targetElements: Array<HTMLElement> = []; // represents the bounded elements\r\n config?: any;\r\n callback?: <T>(event: T) => void;\r\n _subscribe?: (eventKeys?: Array<string>) => void;\r\n static _VELOCITY_LIMIT: number = 20;\r\n\r\n // it must be overridden by other child classes\r\n _initEvents() {}\r\n\r\n // cancel events\r\n // we only canceled down and move events because mouse up\r\n // will not be triggered\r\n _cancelEvents() {\r\n if (this._subscribe) {\r\n this._subscribe();\r\n }\r\n }\r\n\r\n // re-apply new callback\r\n applyCallback(callback: <T>(event: T) => void) {\r\n this.callback = callback;\r\n }\r\n\r\n // apply gesture\r\n applyGesture({\r\n targetElement,\r\n targetElements,\r\n callback,\r\n config,\r\n }: {\r\n targetElement?: any;\r\n targetElements?: any;\r\n callback: <T>(event: T) => void;\r\n config?: any;\r\n }) {\r\n this.targetElement = targetElement;\r\n this.targetElements = targetElements.map(\r\n (element: { current: any }) => element.current\r\n );\r\n this.callback = callback;\r\n this.config = config;\r\n\r\n // initialize events\r\n this._initEvents();\r\n\r\n // unbind\r\n return () => this._subscribe && this._subscribe();\r\n }\r\n}\r\n","import { attachEvents } from '../helpers/eventAttacher';\r\nimport { clamp } from '../helpers/math';\r\nimport { withDefault } from '../helpers/withDefault';\r\nimport { Gesture } from './Gesture';\r\n\r\nimport type { Vector2 } from '../types';\r\n\r\nexport class DragGesture extends Gesture {\r\n movementStart: Vector2 = withDefault(0, 0);\r\n initialMovement: Vector2 = withDefault(0, 0);\r\n movement: Vector2 = withDefault(0, 0);\r\n previousMovement: Vector2 = withDefault(0, 0);\r\n translation: Vector2 = withDefault(0, 0);\r\n offset: Vector2 = withDefault(0, 0);\r\n velocity: Vector2 = withDefault(0, 0);\r\n\r\n // @override\r\n // initialize the events\r\n _initEvents() {\r\n if (this.targetElement || this.targetElements.length > 0) {\r\n this._subscribe = attachEvents(\r\n [window],\r\n [\r\n ['mousedown', this.pointerDown.bind(this)],\r\n ['mousemove', this.pointerMove.bind(this)],\r\n ['mouseup', this.pointerUp.bind(this)],\r\n ['touchstart', this.pointerDown.bind(this), { passive: false }],\r\n ['touchmove', this.pointerMove.bind(this), { passive: false }],\r\n ['touchend', this.pointerUp.bind(this)],\r\n ]\r\n );\r\n }\r\n }\r\n\r\n // @override - cancel events\r\n // we only canceled down and move events because mouse up\r\n // will not be triggered\r\n _cancelEvents() {\r\n if (this._subscribe) {\r\n this._subscribe(['mousedown', 'mousemove', 'touchstart', 'touchmove']);\r\n }\r\n }\r\n\r\n _handleCallback() {\r\n if (this.callback) {\r\n this.callback({\r\n args: [this.currentIndex],\r\n down: this.isActive,\r\n movementX: this.movement.x,\r\n movementY: this.movement.y,\r\n offsetX: this.translation.x,\r\n offsetY: this.translation.y,\r\n velocityX: this.velocity.x,\r\n velocityY: this.velocity.y,\r\n distanceX: Math.abs(this.movement.x),\r\n distanceY: Math.abs(this.movement.y),\r\n directionX: Math.sign(this.movement.x),\r\n directionY: Math.sign(this.movement.y),\r\n cancel: () => {\r\n this._cancelEvents();\r\n },\r\n });\r\n }\r\n }\r\n\r\n pointerDown(e: any) {\r\n if (e.type === 'touchstart') {\r\n this.movementStart = {\r\n x: e.touches[0].clientX,\r\n y: e.touches[0].clientY,\r\n };\r\n } else {\r\n this.movementStart = { x: e.clientX, y: e.clientY };\r\n }\r\n\r\n this.movement = { x: 0, y: 0 };\r\n this.offset = { x: this.translation.x, y: this.translation.y };\r\n this.previousMovement = { x: 0, y: 0 };\r\n this.velocity = { x: 0, y: 0 };\r\n\r\n // find current selected element\r\n const currElem = this.targetElements.find((elem: any) => elem === e.target);\r\n\r\n if (e.target === this.targetElement || currElem) {\r\n this.isActive = true;\r\n e.preventDefault();\r\n\r\n // set args\r\n if (currElem) {\r\n this.currentIndex = this.targetElements.indexOf(currElem);\r\n }\r\n\r\n // if initial function is defined then call it to get initial movementX and movementY\r\n // if only select to bounded draggable element\r\n const initial = this.config?.initial && this.config.initial();\r\n const initialMovementX = initial?.movementX;\r\n const initialMovementY = initial?.movementY;\r\n\r\n this.initialMovement = {\r\n x: initialMovementX ?? 0,\r\n y: initialMovementY ?? 0,\r\n };\r\n\r\n this.movement = {\r\n x: this.initialMovement.x,\r\n y: this.initialMovement.y,\r\n };\r\n\r\n this.previousMovement = {\r\n x: this.initialMovement.x,\r\n y: this.initialMovement.y,\r\n };\r\n\r\n this._handleCallback();\r\n }\r\n }\r\n\r\n pointerMove(e: any) {\r\n if (this.isActive) {\r\n e.preventDefault();\r\n const now = Date.now();\r\n const deltaTime = clamp(now - this.lastTimeStamp, 0.1, 64);\r\n this.lastTimeStamp = now;\r\n\r\n const t = deltaTime / 1000;\r\n\r\n if (e.type === 'touchmove') {\r\n this.movement = {\r\n x:\r\n this.initialMovement.x +\r\n (e.touches[0].clientX - this.movementStart.x),\r\n y:\r\n this.initialMovement.y +\r\n (e.touches[0].clientY - this.movementStart.y),\r\n };\r\n } else {\r\n this.movement = {\r\n x: this.initialMovement.x + (e.clientX - this.movementStart.x),\r\n y: this.initialMovement.y + (e.clientY - this.movementStart.y),\r\n };\r\n }\r\n\r\n this.translation = {\r\n x: this.offset.x + this.movement.x,\r\n y: this.offset.y + this.movement.y,\r\n };\r\n\r\n this.velocity = {\r\n x: clamp(\r\n (this.movement.x - this.previousMovement.x) / t / 1000,\r\n -1 * Gesture._VELOCITY_LIMIT,\r\n Gesture._VELOCITY_LIMIT\r\n ),\r\n y: clamp(\r\n (this.movement.y - this.previousMovement.y) / t / 1000,\r\n -1 * Gesture._VELOCITY_LIMIT,\r\n Gesture._VELOCITY_LIMIT\r\n ),\r\n };\r\n\r\n this.previousMovement = {\r\n x: this.movement.x,\r\n y: this.movement.y,\r\n };\r\n\r\n this._handleCallback();\r\n }\r\n }\r\n\r\n pointerUp() {\r\n if (this.isActive) {\r\n this.isActive = false;\r\n this._handleCallback();\r\n this._cancelEvents();\r\n this._initEvents();\r\n }\r\n }\r\n}\r\n","import { attachEvents } from '../helpers/eventAttacher';\r\nimport { Vector2 } from '../types';\r\nimport { clamp } from '../helpers/math';\r\nimport { withDefault } from '../helpers/withDefault';\r\nimport { Gesture } from './Gesture';\r\n\r\nexport class MouseMoveGesture extends Gesture {\r\n event?: MouseEvent;\r\n isActiveID?: any;\r\n movement: Vector2 = withDefault(0, 0);\r\n previousMovement: Vector2 = withDefault(0, 0);\r\n velocity: Vector2 = withDefault(0, 0);\r\n direction: Vector2 = withDefault(0, 0);\r\n\r\n // @override\r\n // initialize the events\r\n _initEvents() {\r\n if (this.targetElement) {\r\n this._subscribe = attachEvents(\r\n [this.targetElement],\r\n [['mousemove', this.onMouseMove.bind(this)]]\r\n );\r\n } else if (this.targetElements.length > 0) {\r\n this._subscribe = attachEvents(this.targetElements, [\r\n ['mousemove', this.onMouseMove.bind(this)],\r\n ]);\r\n } else {\r\n this._subscribe = attachEvents(\r\n [window],\r\n [['mousemove', this.onMouseMove.bind(this)]]\r\n );\r\n }\r\n }\r\n\r\n _handleCallback() {\r\n if (this.callback) {\r\n this.callback({\r\n args: [this.currentIndex],\r\n event: this.event,\r\n isMoving: this.isActive,\r\n target: this.event?.target,\r\n mouseX: this.movement.x,\r\n mouseY: this.movement.y,\r\n velocityX: this.velocity.x,\r\n velocityY: this.velocity.y,\r\n directionX: this.direction.x,\r\n directionY: this.direction.y,\r\n });\r\n }\r\n }\r\n\r\n onMouseMove(e: MouseEvent) {\r\n // find current selected element\r\n const currElem = this.targetElements.find((elem: any) => elem === e.target);\r\n\r\n // set args\r\n if (currElem) {\r\n this.currentIndex = this.targetElements.indexOf(currElem);\r\n }\r\n\r\n this.event = e;\r\n\r\n const now: number = Date.now();\r\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\r\n this.lastTimeStamp = now;\r\n const t = deltaTime / 1000; // seconds\r\n\r\n const x = e.clientX;\r\n const y = e.clientY;\r\n\r\n this.movement = { x, y };\r\n\r\n if (this.isActiveID !== -1) {\r\n this.isActive = true;\r\n clearTimeout(this.isActiveID);\r\n }\r\n\r\n this.isActiveID = setTimeout(() => {\r\n this.isActive = false;\r\n this.direction = { x: 0, y: 0 };\r\n this.velocity = { x: 0, y: 0 };\r\n\r\n this._handleCallback();\r\n }, 250); // Debounce 250 milliseconds\r\n\r\n const diffX = this.movement.x - this.previousMovement.x;\r\n const diffY = this.movement.y - this.previousMovement.y;\r\n\r\n this.direction = {\r\n x: Math.sign(diffX),\r\n y: Math.sign(diffY),\r\n };\r\n\r\n this.velocity = {\r\n x: clamp(\r\n diffX / t / 1000,\r\n -1 * Gesture._VELOCITY_LIMIT,\r\n Gesture._VELOCITY_LIMIT\r\n ),\r\n y: clamp(\r\n diffY / t / 1000,\r\n -1 * Gesture._VELOCITY_LIMIT,\r\n Gesture._VELOCITY_LIMIT\r\n ),\r\n };\r\n\r\n this.previousMovement = { x: this.movement.x, y: this.movement.y };\r\n\r\n this._handleCallback();\r\n }\r\n}\r\n","import { attachEvents } from '../helpers/eventAttacher';\r\nimport { Vector2 } from '../types';\r\nimport { clamp } from '../helpers/math';\r\nimport { withDefault } from '../helpers/withDefault';\r\nimport { Gesture } from './Gesture';\r\n\r\nexport class ScrollGesture extends Gesture {\r\n isActiveID?: any;\r\n movement: Vector2 = withDefault(0, 0);\r\n previousMovement: Vector2 = withDefault(0, 0);\r\n direction: Vector2 = withDefault(0, 0);\r\n velocity: Vector2 = withDefault(0, 0);\r\n\r\n // @override\r\n // initialize the events\r\n _initEvents() {\r\n if (this.targetElement) {\r\n this._subscribe = attachEvents(\r\n [this.targetElement],\r\n [['scroll', this.scrollElementListener.bind(this)]]\r\n );\r\n } else {\r\n this._subscribe = attachEvents(\r\n [window],\r\n [['scroll', this.scrollListener.bind(this)]]\r\n );\r\n }\r\n }\r\n\r\n _handleCallback() {\r\n if (this.callback) {\r\n this.callback({\r\n isScrolling: this.isActive,\r\n scrollX: this.movement.x,\r\n scrollY: this.movement.y,\r\n velocityX: this.velocity.x,\r\n velocityY: this.velocity.y,\r\n directionX: this.direction.x,\r\n directionY: this.direction.y,\r\n });\r\n }\r\n }\r\n\r\n onScroll({ x, y }: Vector2) {\r\n const now: number = Date.now();\r\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\r\n this.lastTimeStamp = now;\r\n const t = deltaTime / 1000; // seconds\r\n\r\n this.movement = { x, y };\r\n\r\n // Clear if scrolling\r\n if (this.isActiveID !== -1) {\r\n this.isActive = true;\r\n clearTimeout(this.isActiveID);\r\n }\r\n\r\n this.isActiveID = setTimeout(() => {\r\n this.isActive = false;\r\n this.direction = { x: 0, y: 0 };\r\n\r\n // Reset Velocity\r\n this.velocity = { x: 0, y: 0 };\r\n\r\n this._handleCallback(); // Debounce 250milliseconds\r\n }, 250);\r\n\r\n const diffX = this.movement.x - this.previousMovement.x;\r\n const diffY = this.movement.y - this.previousMovement.y;\r\n\r\n this.direction = {\r\n x: Math.sign(diffX),\r\n y: Math.sign(diffY),\r\n };\r\n\r\n this.velocity = {\r\n x: clamp(\r\n diffX / t / 1000,\r\n -1 * Gesture._VELOCITY_LIMIT,\r\n Gesture._VELOCITY_LIMIT\r\n ),\r\n y: clamp(\r\n diffY / t / 1000,\r\n -1 * Gesture._VELOCITY_LIMIT,\r\n Gesture._VELOCITY_LIMIT\r\n ),\r\n };\r\n\r\n this.previousMovement = {\r\n x: this.movement.x,\r\n y: this.movement.y,\r\n };\r\n\r\n this._handleCallback();\r\n }\r\n\r\n scrollListener() {\r\n const { pageYOffset: y, pageXOffset: x } = window;\r\n this.onScroll({ x, y });\r\n }\r\n\r\n scrollElementListener() {\r\n const x = this.targetElement?.scrollLeft || 0;\r\n const y = this.targetElement?.scrollTop || 0;\r\n this.onScroll({ x, y });\r\n }\r\n}\r\n","import { attachEvents } from '../helpers/eventAttacher';\r\nimport { Vector2 } from '../types';\r\nimport { clamp } from '../helpers/math';\r\nimport { withDefault } from '../helpers/withDefault';\r\nimport { Gesture } from './Gesture';\r\n\r\nconst LINE_HEIGHT = 40;\r\nconst PAGE_HEIGHT = 800;\r\n\r\nexport class WheelGesture extends Gesture {\r\n isActiveID?: any;\r\n movement: Vector2 = withDefault(0, 0);\r\n previousMovement: Vector2 = withDefault(0, 0);\r\n direction: Vector2 = withDefault(0, 0);\r\n velocity: Vector2 = withDefault(0, 0);\r\n delta: Vector2 = withDefault(0, 0);\r\n\r\n // Holds offsets\r\n offset: Vector2 = withDefault(0, 0);\r\n translation: Vector2 = withDefault(0, 0);\r\n\r\n // @override\r\n // initialize the events\r\n _initEvents() {\r\n if (this.targetElement) {\r\n this._subscribe = attachEvents(\r\n [this.targetElement],\r\n [['wheel', this.onWheel.bind(this)]]\r\n );\r\n }\r\n }\r\n\r\n _handleCallback() {\r\n if (this.callback) {\r\n this.callback({\r\n target: this.targetElement,\r\n isWheeling: this.isActive,\r\n deltaX: this.delta.x,\r\n deltaY: this.delta.y,\r\n directionX: this.direction.x,\r\n directionY: this.direction.y,\r\n movementX: this.movement.x,\r\n movementY: this.movement.y,\r\n offsetX: this.offset.x,\r\n offsetY: this.offset.y,\r\n velocityX: this.velocity.x,\r\n velocityY: this.velocity.y,\r\n });\r\n }\r\n }\r\n\r\n onWheel(event: WheelEvent) {\r\n let { deltaX, deltaY, deltaMode } = event;\r\n\r\n const now: number = Date.now();\r\n const deltaTime = Math.min(now - this.lastTimeStamp, 64);\r\n this.lastTimeStamp = now;\r\n const t = deltaTime / 1000; // seconds\r\n\r\n this.isActive = true;\r\n\r\n if (this.isActiveID !== -1) {\r\n this.isActive = true;\r\n clearTimeout(this.isActiveID);\r\n }\r\n\r\n this.isActiveID = setTimeout(() => {\r\n this.isActive = false;\r\n this.translation = { x: this.offset.x, y: this.offset.y };\r\n this._handleCallback();\r\n\r\n this.velocity = { x: 0, y: 0 }; // Reset Velocity\r\n this.movement = { x: 0, y: 0 };\r\n }, 200);\r\n\r\n // normalize wheel values, especially for Firefox\r\n if (deltaMode === 1) {\r\n deltaX *= LINE_HEIGHT;\r\n deltaY *= LINE_HEIGHT;\r\n } else if (deltaMode === 2) {\r\n deltaX *= PAGE_HEIGHT;\r\n deltaY *= PAGE_HEIGHT;\r\n }\r\n\r\n this.delta = { x: deltaX, y: deltaY };\r\n this.movement = {\r\n x: this.movement.x + deltaX,\r\n y: this.movement.y + deltaY,\r\n };\r\n this.offset = {\r\n x: this.translation.x + this.movement.x,\r\n y: this.translation.y + this.movement.y,\r\n };\r\n\r\n const diffX = this.movement.x - this.previousMovement.x;\r\n const diffY = this.movement.y - this.previousMovement.y;\r\n\r\n this.direction = {\r\n x: Math.sign(diffX),\r\n y: Math.sign(diffY),\r\n };\r\n\r\n this.velocity = {\r\n x: clamp(\r\n diffX / t / 1000,\r\n -1 * Gesture._VELOCITY_LIMIT,\r\n Gesture._VELOCITY_LIMIT\r\n ),\r\n y: clamp(\r\n diffY / t / 1000,\r\n -1 * Gesture._VELOCITY_LIMIT,\r\n Gesture._VELOCITY_LIMIT\r\n ),\r\n };\r\n\r\n this.previousMovement = {\r\n x: this.movement.x,\r\n y: this.movement.y,\r\n };\r\n\r\n this._handleCallback();\r\n }\r\n}\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport * as React from 'react';\r\n\r\ntype UseRecognizerHandlerType = Array<\r\n [\r\n key: 'drag' | 'wheel' | 'move' | 'scroll',\r\n gesture: any,\r\n callback: any,\r\n config?: any\r\n ]\r\n>;\r\n\r\nexport const useRecognizer = (handlers: UseRecognizerHandlerType) => {\r\n const ref = React.useRef<any>();\r\n const elementRefs = React.useRef<Array<any>>([]);\r\n const subscribers = React.useRef<\r\n Map<string, { keyIndex: number; gesture: any; unsubscribe: any }>\r\n >(new Map()).current;\r\n\r\n // re-initiate callback on change\r\n React.useEffect(() => {\r\n for (let [, { keyIndex, gesture }] of subscribers.entries()) {\r\n const [, , callback] = handlers[keyIndex];\r\n gesture.applyCallback(callback);\r\n }\r\n }, [handlers]);\r\n\r\n React.useEffect(() => {\r\n handlers.forEach(([key, gesture, callback, config], keyIndex) => {\r\n queueMicrotask(() =>\r\n subscribers.set(key, {\r\n keyIndex,\r\n gesture,\r\n unsubscribe: gesture.applyGesture({\r\n targetElement: ref.current,\r\n targetElements: elementRefs.current,\r\n callback,\r\n config,\r\n }),\r\n })\r\n );\r\n });\r\n\r\n return () => {\r\n for (let [, { unsubscribe }] of subscribers.entries()) {\r\n unsubscribe && unsubscribe();\r\n }\r\n };\r\n });\r\n\r\n return (index?: number) => {\r\n if (index === null || index === undefined) {\r\n return { ref };\r\n } else {\r\n elementRefs.current[index] =\r\n elementRefs.current[index] || React.createRef();\r\n\r\n return { ref: elementRefs.current[index] };\r\n }\r\n };\r\n};\r\n","import * as React from 'react';\r\nimport {\r\n useAnimatedValue,\r\n UseAnimatedValueConfig,\r\n ValueType,\r\n} from '../useAnimatedValue';\r\n\r\ninterface ScrollableBlockProps {\r\n children?: (animation: { value: ValueType }) => React.ReactNode;\r\n direction?: 'single' | 'both';\r\n threshold?: number;\r\n animationConfig?: UseAnimatedValueConfig;\r\n}\r\n\r\n/**\r\n * ScrollableBlock - Higher order component to handle the entrance or exit animation\r\n * of a component when it enters or exit the viewport. Accepts child as a function with\r\n * `AnimatedValue` as its first argument which can be interpolated on input range [0, 1]\r\n * @prop { function } children - child as a function with `AnimatedValue` as its first argument.\r\n * @prop { 'single' | 'both' } direction - single applies animation on enter once, both applies on enter and exit.\r\n * @prop { number } threshold - should be in range 0 to 1 which equivalent to `IntersectionObserver` threshold.\r\n * @prop { UseAnimatedValueConfig } animationConfig - Animation config\r\n */\r\nexport const ScrollableBlock = (props: ScrollableBlockProps) => {\r\n const {\r\n children,\r\n direction = 'single',\r\n animationConfig,\r\n threshold = 0.2,\r\n } = props;\r\n const scrollableBlockRef = React.useRef<HTMLDivElement>(null);\r\n const animation = useAnimatedValue(0, animationConfig); // 0: not intersecting | 1: intersecting\r\n\r\n React.useEffect(() => {\r\n const _scrollableBlock = scrollableBlockRef.current;\r\n\r\n const observer = new IntersectionObserver(\r\n function ([entry]) {\r\n const { isIntersecting } = entry;\r\n\r\n if (isIntersecting) {\r\n animation.value = 1;\r\n } else {\r\n if (direction === 'both') animation.value = 0;\r\n }\r\n },\r\n {\r\n root: null, // FOR VIEWPORT ONLY\r\n threshold,\r\n }\r\n );\r\n\r\n if (_scrollableBlock) {\r\n observer.observe(_scrollableBlock);\r\n }\r\n\r\n return () => {\r\n if (_scrollableBlock) {\r\n observer.unobserve(_scrollableBlock);\r\n }\r\n };\r\n }, []);\r\n\r\n return (\r\n <div ref={scrollableBlockRef}>\r\n {children && children({ value: animation.value })}\r\n </div>\r\n );\r\n};\r\n","/**\r\n * @param { number } ms - number of milliseconds to delay code execution\r\n * @returns Promise\r\n */\r\nexport function delay(ms: number) {\r\n return new Promise((resolve) => {\r\n setTimeout(() => resolve(null), ms);\r\n });\r\n}\r\n","import * as React from 'react';\r\n\r\nimport { DragEventType, UseDragConfig } from '../types';\r\nimport { DragGesture } from '../controllers';\r\nimport { useRecognizer } from './useRecognizer';\r\n\r\nexport function useDrag(\r\n callback: (event: DragEventType) => void,\r\n config?: UseDragConfig\r\n) {\r\n const gesture = React.useRef(new DragGesture()).current;\r\n\r\n return useRecognizer([['drag', gesture, callback, config]]);\r\n}\r\n","import * as React from 'react';\r\nimport {\r\n DragGesture,\r\n MouseMoveGesture,\r\n ScrollGesture,\r\n WheelGesture,\r\n} from '../controllers';\r\nimport {\r\n DragEventType,\r\n WheelEventType,\r\n ScrollEventType,\r\n MouseMoveEventType,\r\n} from '../types';\r\nimport { useRecognizer } from './useRecognizer';\r\n\r\nexport function useGesture({\r\n onDrag,\r\n onWheel,\r\n onScroll,\r\n onMouseMove,\r\n}: {\r\n onDrag?: (event: DragEventType) => void;\r\n onWheel?: (event: WheelEventType) => void;\r\n onScroll?: (event: ScrollEventType) => void;\r\n onMouseMove?: (event: MouseMoveEventType) => void;\r\n}) {\r\n const dragGesture = React.useRef(new DragGesture()).current;\r\n const wheelGesture = React.useRef(new WheelGesture()).current;\r\n const scrollGesture = React.useRef(new ScrollGesture()).current;\r\n const mouseMoveGesture = React.useRef(new MouseMoveGesture()).current;\r\n\r\n return useRecognizer([\r\n ['drag', dragGesture, onDrag],\r\n ['wheel', wheelGesture, onWheel],\r\n ['scroll', scrollGesture, onScroll],\r\n ['move', mouseMoveGesture, onMouseMove],\r\n ]);\r\n}\r\n","import { useRef, useEffect, DependencyList, createRef } from 'react';\r\n\r\ntype MeasurementValue = number | Array<number>;\r\n\r\ntype MeasurementType = {\r\n left: MeasurementValue;\r\n top: MeasurementValue;\r\n width: MeasurementValue;\r\n height: MeasurementValue;\r\n vLeft: MeasurementValue;\r\n vTop: MeasurementValue;\r\n};\r\n\r\nexport function useMeasure(\r\n callback: (event: MeasurementType) => void,\r\n deps?: DependencyList\r\n) {\r\n const ref = useRef(null);\r\n const elementRefs = useRef([]);\r\n const callbackRef = useRef<(event: MeasurementType) => void>(callback);\r\n\r\n // Reinitiate callback when dependency change\r\n useEffect(() => {\r\n callbackRef.current = callback;\r\n\r\n return () => {\r\n callbackRef.current = () => false;\r\n };\r\n }, deps);\r\n\r\n useEffect(() => {\r\n const _refElement = ref.current || document.documentElement;\r\n const _refElementsMultiple = elementRefs.current;\r\n\r\n const resizeObserver = new ResizeObserver(([entry]) => {\r\n const { left, top, width, height } = entry.target.getBoundingClientRect();\r\n const { pageXOffset, pageYOffset } = window;\r\n\r\n if (callbackRef) {\r\n if (_refElement === document.documentElement) {\r\n return; // no-op for document\r\n } else {\r\n callbackRef.current({\r\n left: left + pageXOffset,\r\n top: top + pageYOffset,\r\n width,\r\n height,\r\n vLeft: left,\r\n vTop: top,\r\n });\r\n }\r\n }\r\n });\r\n\r\n const resizeObserverMultiple = new ResizeObserver((entries) => {\r\n const left: Array<number> = [];\r\n const top: Array<number> = [];\r\n const width: Array<number> = [];\r\n const height: Array<number> = [];\r\n const vLeft: Array<number> = [];\r\n const vTop: Array<number> = [];\r\n\r\n entries.forEach((entry) => {\r\n const {\r\n left: _left,\r\n top: _top,\r\n width: _width,\r\n height: _height,\r\n } = entry.target.getBoundingClientRect();\r\n const { pageXOffset, pageYOffset } = window;\r\n const _pageLeft = _left + pageXOffset;\r\n const _pageTop = _top + pageYOffset;\r\n\r\n left.push(_pageLeft);\r\n top.push(_pageTop);\r\n width.push(_width);\r\n height.push(_height);\r\n vLeft.push(_left);\r\n vTop.push(_top);\r\n });\r\n\r\n if (callbackRef) {\r\n callbackRef.current({\r\n left,\r\n top,\r\n width,\r\n height,\r\n vLeft,\r\n vTop,\r\n });\r\n }\r\n });\r\n\r\n if (_refElement) {\r\n if (\r\n _refElement === document.documentElement &&\r\n _refElementsMultiple.length > 0\r\n ) {\r\n _refElementsMultiple.forEach((element: any) => {\r\n resizeObserverMultiple.observe(element.current);\r\n });\r\n } else {\r\n resizeObserver.observe(_refElement);\r\n }\r\n }\r\n\r\n return () => {\r\n if (_refElement) {\r\n if (\r\n _refElement === document.documentElement &&\r\n _refElementsMultiple.length > 0\r\n ) {\r\n _refElementsMultiple.forEach((element: any) => {\r\n resizeObserverMultiple.unobserve(element.current);\r\n });\r\n } else {\r\n resizeObserver.unobserve(_refElement);\r\n }\r\n }\r\n };\r\n }, []);\r\n\r\n return (index?: number) => {\r\n if (index === null || index === undefined) {\r\n return { ref };\r\n } else {\r\n elementRefs.current[index] = elementRefs.current[index] || createRef();\r\n\r\n return { ref: elementRefs.current[index] };\r\n }\r\n }; // ...bind() or ...bind(index) for multiple\r\n}\r\n","import * as React from 'react';\r\n\r\nimport { MouseMoveEventType } from '../types';\r\nimport { MouseMoveGesture } from '../controllers';\r\nimport { useRecognizer } from './useRecognizer';\r\n\r\nexport function useMouseMove(callback: (event: MouseMoveEventType) => void) {\r\n const gesture = React.useRef(new MouseMoveGesture()).current;\r\n\r\n return useRecognizer([['move', gesture, callback]]);\r\n}\r\n","import { useRef, useEffect, RefObject, DependencyList } from 'react';\r\n\r\nimport { attachEvents } from '../gestures/helpers/eventAttacher';\r\n\r\nexport function useOutsideClick(\r\n elementRef: RefObject<HTMLElement>,\r\n callback: (event: MouseEvent) => void,\r\n deps?: DependencyList\r\n) {\r\n const callbackRef = useRef<(event: MouseEvent) => void>();\r\n\r\n if (!callbackRef.current) {\r\n callbackRef.current = callback;\r\n }\r\n\r\n // Reinitiate callback when dependency change\r\n useEffect(() => {\r\n callbackRef.current = callback;\r\n\r\n return () => {\r\n callbackRef.current = () => false;\r\n };\r\n }, deps);\r\n\r\n useEffect(() => {\r\n const handleOutsideClick = (e: MouseEvent) => {\r\n if (!elementRef?.current?.contains(e.target as Element)) {\r\n callbackRef.current && callbackRef.current(e);\r\n }\r\n };\r\n\r\n const subscribe = attachEvents([document], [['click', handleOutsideClick]]);\r\n\r\n return () => subscribe && subscribe();\r\n }, []);\r\n}\r\n","import * as React from 'react';\r\n\r\nimport { ScrollEventType } from '../types';\r\nimport { ScrollGesture } from '../controllers';\r\nimport { useRecognizer } from './useRecognizer';\r\n\r\nexport function useScroll(callback: (event: ScrollEventType) => void) {\r\n const gesture = React.useRef(new ScrollGesture()).current;\r\n\r\n return useRecognizer([['scroll', gesture, callback]]);\r\n}\r\n","import * as React from 'react';\r\n\r\nimport { WheelEventType } from '../types';\r\nimport { WheelGesture } from '../controllers';\r\nimport { useRecognizer } from './useRecognizer';\r\n\r\nexport function useWheel(callback: (event: WheelEventType) => void) {\r\n const gesture = React.useRef(new WheelGesture()).current;\r\n\r\n return useRecognizer([['wheel', gesture, callback]]);\r\n}\r\n","import { useRef, useEffect, DependencyList } from 'react';\r\n\r\ntype WindowDimensionType = {\r\n width: number;\r\n height: number;\r\n innerWidth: number;\r\n innerHeight: number;\r\n};\r\n\r\nexport function useWindowDimension(\r\n callback: (event: WindowDimensionType) => void,\r\n deps?: DependencyList\r\n) {\r\n const windowDimensionsRef = useRef<WindowDimensionType>({\r\n width: 0,\r\n height: 0,\r\n innerWidth: 0,\r\n innerHeight: 0,\r\n });\r\n const callbackRef = useRef<(event: WindowDimensionType) => void>(callback);\r\n\r\n const handleCallback: () => void = () => {\r\n if (callbackRef) {\r\n callbackRef.current({\r\n ...windowDimensionsRef.current,\r\n });\r\n }\r\n };\r\n\r\n // Reinitiate callback when dependency change\r\n useEffect(() => {\r\n callbackRef.current = callback;\r\n\r\n return () => {\r\n callbackRef.current = () => false;\r\n };\r\n }, deps);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(([entry]) => {\r\n const { clientWidth, clientHeight } = entry.target;\r\n const { innerWidth, innerHeight } = window;\r\n\r\n windowDimensionsRef.current = {\r\n width: clientWidth,\r\n height: clientHeight,\r\n innerWidth,\r\n innerHeight,\r\n };\r\n\r\n handleCallback();\r\n });\r\n\r\n resizeObserver.observe(document.documentElement);\r\n\r\n return () => resizeObserver.unobserve(document.documentElement);\r\n }, []);\r\n}\r\n"],"names":["isDefined","value","checkFluidValueOrNumber","isFluidValue","console","log","Error","AnimatedBlock","makeFluid","AnimatedInline","AnimatedImage","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","internalInterpolate","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","clientHeight","delay","configs","__awaiter","configs_1","configs_1_1","sent"],"mappings":"wWAAaA,EAAY,SAAIC,GAC3B,OAAOA,OACT,ECQA,SAASC,EAAwBD,GAC/B,IACGD,EAAUC,IACQ,iBAAVA,IAAsBE,EAAAA,aAAaF,GAG5C,MADAG,QAAQC,IAAIJ,GACN,IAAIK,MACR,kBAAWL,EAAK,mEAGpB,OAAOA,CACT,KCdaM,EAAgBC,EAASA,UAAC,OCA1BC,EAAiBD,EAASA,UAAC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AAAnT,MACf,CAAA,EAAMmG,EAAuB,iBAAXvF,EAAsB,CAAEmD,QAASnD,GAAWA,YAA9D2E,EAAA6N,0NAGN,qBA1C0B,SAACrP,EAAiBnD,GAC1C,OAAAoE,EAAWjB,EAAOX,EAAAA,EAAA,GAAOnB,EAAqBC,SAAYtB,GAA1D,qBAQwB,SAACmD,EAAiBnD,GAC1C,OAAAoE,EAAWjB,EAAOX,EAAA,CAAI7B,SAAU,KAAQX,GAAxC"}
1
+ {"version":3,"file":"index.js","sources":["../src/animation/helpers/isDefined.ts","../src/animation/interpolation.ts","../src/animation/modules/AnimatedBlock.ts","../src/animation/modules/AnimatedInline.ts","../src/animation/modules/AnimatedImage.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 isFluidValue,\n interpolate as internalInterpolate,\n} from '@raidipesh78/re-motion';\n\nimport { isDefined } from './helpers';\nimport { ValueType } from './useAnimatedValue';\n\nfunction checkFluidValueOrNumber(value: unknown): number | FluidValue {\n if (\n !isDefined(value) ||\n !(typeof value === 'number' || isFluidValue(value))\n ) {\n console.log(value);\n throw new Error(\n `Invalid ${value} type for interpolate function. Expected number or 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: FluidValue | ValueType | number,\n inputRange: Array<number>,\n outputRange: Array<number | string>,\n extrapolateConfig?: ExtrapolateConfig\n) {\n const checkedValue = checkFluidValueOrNumber(value);\n\n return internalInterpolate(\n checkedValue,\n inputRange,\n outputRange,\n extrapolateConfig\n );\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: FluidValue | ValueType | number,\n minOutput: number | string,\n maxOutput: number | string,\n extrapolateConfig?: ExtrapolateConfig\n) {\n const checkedValue = checkFluidValueOrNumber(value);\n\n return internalInterpolate(\n checkedValue,\n [0, 1],\n [minOutput, maxOutput],\n extrapolateConfig\n );\n}\n","import { makeFluid } from '@raidipesh78/re-motion';\n\n/**\n * AnimatedBlock - A higher order component built upon `div` element\n * which can accept `AnimatedValue`. It also exposes some extra style properties like\n * translateX, translateY, rotateX, rotateY, scaleX, etc.\n */\nexport const AnimatedBlock = makeFluid('div');\n","import { makeFluid } from '@raidipesh78/re-motion';\n\n/**\n * AnimatedInline - A higher order component built upon `span` element\n * which can accept `AnimatedValue`. It also exposes some extra style properties like\n * translateX, translateY, rotateX, rotateY, scaleX, etc.\n */\nexport const AnimatedInline = makeFluid('span');\n","import { makeFluid } from '@raidipesh78/re-motion';\n\n/**\n * AnimatedImage - A higher order component built upon `img` element\n * which can accept `AnimatedValue`. It also exposes some extra style properties like\n * translateX, translateY, rotateX, rotateY, scaleX, etc.\n */\nexport const AnimatedImage = makeFluid('img');\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 type { FluidValueConfig, Length } from '@raidipesh78/re-motion';\n\nimport { useMountedValue } from '../useMountedValue';\nimport { ValueType } from '../useAnimatedValue';\n\ninterface MountedValueConfig extends FluidValueConfig {}\n\ntype AssignValue = {\n toValue?: Length;\n config?: MountedValueConfig;\n};\n\ninterface MountedBlockProps {\n state: boolean;\n children: (animation: { value: ValueType }) => React.ReactNode;\n from?: number;\n enter?:\n | number\n | AssignValue\n | ((update: (next: AssignValue) => Promise<any>) => void);\n exit?:\n | number\n | AssignValue\n | ((update: (next: AssignValue) => Promise<any>) => void);\n config?: MountedValueConfig;\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 { MountedValueConfig } 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, FluidValueConfig } 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): FluidValueConfig => {\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: 34, tension: 290 };\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, FluidValueConfig } from '@raidipesh78/re-motion';\n\nimport { AnimationConfigUtils } from './animationType';\n\n// useAnimatedValue value type\ntype Length = number | string;\n\nexport interface UseAnimatedValueConfig extends FluidValueConfig {}\n\ntype AssignValue = {\n toValue?: Length;\n config?: UseAnimatedValueConfig;\n};\n\nexport type ValueType =\n | Length\n | AssignValue\n | ((update: (next: AssignValue) => Promise<any>) => void);\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: Length,\n config?: UseAnimatedValueConfig\n) {\n const [animation, setAnimation] = useFluidValue(initialValue, {\n ...AnimationConfigUtils.EASE,\n ...config,\n });\n\n const targetObject: {\n value: ValueType;\n currentValue: number | string;\n } = {\n value: animation as any,\n currentValue: animation.get(),\n };\n\n return new Proxy(targetObject, {\n set: function (_, key, value: ValueType) {\n if (key === 'value') {\n if (typeof value === 'number' || typeof value === 'string') {\n queueMicrotask(() => setAnimation({ toValue: value }));\n } else if (typeof value === 'object' || 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';\nimport { bin } from '../../gestures/helpers/math';\nimport {\n useAnimatedValue,\n UseAnimatedValueConfig,\n ValueType,\n} from '../useAnimatedValue';\n\ninterface TransitionBlockProps {\n state: boolean;\n children: (animation: { value: ValueType }) => 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 { FluidValueConfig, Length } from '@raidipesh78/re-motion';\n\nimport { AnimationConfigUtils } from './animationType';\n\n// Base interfaces for callbacks\ninterface WithOnCallbacks\n extends Pick<FluidValueConfig, 'onRest' | 'onStart' | 'onChange'> {}\n\n// Configuration interfaces\ninterface WithEaseConfig extends WithOnCallbacks {}\ninterface WithSpringConfig\n extends Pick<FluidValueConfig, 'mass' | 'friction' | 'tension'>,\n WithOnCallbacks {}\ninterface WithTimingConfig\n extends Pick<FluidValueConfig, 'duration' | 'easing'>,\n WithOnCallbacks {}\ninterface WithDecayConfig\n extends Pick<FluidValueConfig, 'decay' | 'velocity' | 'deceleration'>,\n WithOnCallbacks {}\n\n/**\n * Creates a default animation configuration.\n * @param {Length} toValue - The target value of the animation.\n * @param {FluidValueConfig} config - Optional configuration.\n * @returns {{ toValue: Length; config: FluidValueConfig }}\n */\nexport const withConfig = (toValue: Length, config?: FluidValueConfig) => ({\n toValue,\n config,\n});\n\n/**\n * Creates an ease animation configuration.\n * @param {Length} toValue - The target value of the animation.\n * @param {FluidValueConfig} [config=AnimationConfigUtils.EASE] - Optional ease configuration.\n * @returns {{ toValue: Length; config: FluidValueConfig }}\n */\nexport const withEase = (toValue: Length, config?: WithEaseConfig) =>\n withConfig(toValue, { ...AnimationConfigUtils.EASE, ...config });\n\n/**\n * Creates a spring animation configuration.\n * @param {Length} toValue - The target value of the animation.\n * @param {WithSpringConfig} [config=AnimationConfigUtils.ELASTIC] - Optional spring configuration.\n * @returns {{ toValue: Length; config: WithSpringConfig }}\n */\nexport const withSpring = (toValue: Length, config?: WithSpringConfig) =>\n withConfig(toValue, { ...AnimationConfigUtils.ELASTIC, ...config });\n\n/**\n * Creates a timing animation configuration.\n * @param {Length} toValue - The target value of the animation.\n * @param {WithTimingConfig} [config={ duration: 250 }] - Optional timing configuration.\n * @returns {{ toValue: Length; config: WithTimingConfig }}\n */\nexport const withTiming = (toValue: Length, config?: WithTimingConfig) =>\n withConfig(toValue, { duration: 250, ...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: Length; config?: FluidValueConfig } | 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?: Length;\n config?: FluidValueConfig;\n }\n | number\n >\n) => {\n return async (\n next: (arg: { toValue?: Length; config?: FluidValueConfig }) => 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: Length; config?: FluidValueConfig }} animation - The animation configuration (withTiming | withSpring).\n * @returns {{ toValue: Length; config: FluidValueConfig }} The updated animation configuration with delay.\n */\nexport const withDelay = (\n delay: number,\n animation: { toValue: Length; config?: FluidValueConfig }\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';\nimport {\n useAnimatedValue,\n UseAnimatedValueConfig,\n ValueType,\n} from '../useAnimatedValue';\n\ninterface ScrollableBlockProps {\n children?: (animation: { value: ValueType }) => 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","checkFluidValueOrNumber","isFluidValue","console","log","Error","AnimatedBlock","makeFluid","AnimatedInline","AnimatedImage","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","internalInterpolate","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","clientHeight","delay","configs","__awaiter","configs_1","configs_1_1","sent"],"mappings":"wWAAaA,EAAY,SAAIC,GAC3B,OAAOA,OACT,ECQA,SAASC,EAAwBD,GAC/B,IACGD,EAAUC,IACQ,iBAAVA,IAAsBE,EAAAA,aAAaF,GAG5C,MADAG,QAAQC,IAAIJ,GACN,IAAIK,MACR,kBAAWL,EAAK,mEAGpB,OAAOA,CACT,KCdaM,EAAgBC,EAASA,UAAC,OCA1BC,EAAiBD,EAASA,UAAC,QCA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T,MACf,CAAA,EAAMmG,EAAuB,iBAAXvF,EAAsB,CAAEmD,QAASnD,GAAWA,YAA9D2E,EAAA6N,0NAGN,qBA1C0B,SAACrP,EAAiBnD,GAC1C,OAAAoE,EAAWjB,EAAOX,EAAAA,EAAA,GAAOnB,EAAqBC,SAAYtB,GAA1D,qBAQwB,SAACmD,EAAiBnD,GAC1C,OAAAoE,EAAWjB,EAAOX,EAAA,CAAI7B,SAAU,KAAQX,GAAxC"}
package/package.json CHANGED
@@ -1,52 +1,52 @@
1
- {
2
- "name": "react-ui-animate",
3
- "version": "3.3.2",
4
- "description": "React library for gestures and animation",
5
- "main": "dist/index.js",
6
- "peerDependencies": {
7
- "react": ">=16.8.0 || >=17.0.0 || >=18.0.0"
8
- },
9
- "dependencies": {
10
- "@raidipesh78/re-motion": "^3.3.0"
11
- },
12
- "devDependencies": {
13
- "@rollup/plugin-terser": "^0.4.4",
14
- "@types/jest": "^29.5.12",
15
- "@types/node": "^20.14.9",
16
- "@types/react": "^18.3.3",
17
- "@types/react-dom": "^18.3.0",
18
- "@types/resize-observer-browser": "^0.1.11",
19
- "babel-core": "^5.8.38",
20
- "babel-runtime": "^6.26.0",
21
- "react": "^18.3.1",
22
- "react-dom": "^18.3.1",
23
- "rollup": "^4.18.0",
24
- "rollup-plugin-typescript2": "^0.36.0",
25
- "typescript": "^5.5.2"
26
- },
27
- "scripts": {
28
- "dev:start": "pm2 start ecosystem.config.js",
29
- "dev:end": "pm2 stop ecosystem.config.js",
30
- "build": "rollup -c",
31
- "start": "rollup -c -w",
32
- "test": "echo \"Error: no test specified\" && exit 1",
33
- "version:minor": "npm version --no-git-tag-version minor",
34
- "version:major": "npm version --no-git-tag-version major",
35
- "version:patch": "npm version --no-git-tag-version patch"
36
- },
37
- "repository": {
38
- "type": "git",
39
- "url": "git+https://github.com/dipeshrai123/react-ui-animate.git"
40
- },
41
- "keywords": [
42
- "gesture",
43
- "animation",
44
- "react-ui-animate"
45
- ],
46
- "author": "Dipesh Rai",
47
- "license": "MIT",
48
- "bugs": {
49
- "url": "https://github.com/dipeshrai123/react-ui-animate/issues"
50
- },
51
- "homepage": "https://github.com/dipeshrai123/react-ui-animate#readme"
52
- }
1
+ {
2
+ "name": "react-ui-animate",
3
+ "version": "3.3.3",
4
+ "description": "React library for gestures and animation",
5
+ "main": "dist/index.js",
6
+ "peerDependencies": {
7
+ "react": ">=16.8.0 || >=17.0.0 || >=18.0.0"
8
+ },
9
+ "dependencies": {
10
+ "@raidipesh78/re-motion": "^3.3.0"
11
+ },
12
+ "devDependencies": {
13
+ "@rollup/plugin-terser": "^0.4.4",
14
+ "@types/jest": "^29.5.12",
15
+ "@types/node": "^20.14.9",
16
+ "@types/react": "^18.3.3",
17
+ "@types/react-dom": "^18.3.0",
18
+ "@types/resize-observer-browser": "^0.1.11",
19
+ "babel-core": "^5.8.38",
20
+ "babel-runtime": "^6.26.0",
21
+ "react": "^18.3.1",
22
+ "react-dom": "^18.3.1",
23
+ "rollup": "^4.18.0",
24
+ "rollup-plugin-typescript2": "^0.36.0",
25
+ "typescript": "^5.5.2"
26
+ },
27
+ "scripts": {
28
+ "dev:start": "pm2 start ecosystem.config.js",
29
+ "dev:end": "pm2 stop ecosystem.config.js",
30
+ "build": "rollup -c",
31
+ "start": "rollup -c -w",
32
+ "test": "echo \"Error: no test specified\" && exit 1",
33
+ "version:minor": "npm version --no-git-tag-version minor",
34
+ "version:major": "npm version --no-git-tag-version major",
35
+ "version:patch": "npm version --no-git-tag-version patch"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/dipeshrai123/react-ui-animate.git"
40
+ },
41
+ "keywords": [
42
+ "gesture",
43
+ "animation",
44
+ "react-ui-animate"
45
+ ],
46
+ "author": "Dipesh Rai",
47
+ "license": "MIT",
48
+ "bugs": {
49
+ "url": "https://github.com/dipeshrai123/react-ui-animate/issues"
50
+ },
51
+ "homepage": "https://github.com/dipeshrai123/react-ui-animate#readme"
52
+ }