@msobiecki/react-marauders-path 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +9 -10
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -85,8 +85,8 @@ useKey(
85
85
  import { useWheel } from '@msobiecki/react-marauders-path';
86
86
 
87
87
  function MyComponent() {
88
- useWheel((event, delta) => {
89
- console.log(`Scrolled - X: ${delta.x}, Y: ${delta.y}`);
88
+ useWheel((event, data) => {
89
+ console.log(`Scrolled - X: ${data.deltaX}, Y: ${data.deltaY}`);
90
90
  });
91
91
 
92
92
  return <div>Scroll to interact</div>;
@@ -99,8 +99,8 @@ function MyComponent() {
99
99
  import { useSwipe } from '@msobiecki/react-marauders-path';
100
100
 
101
101
  function MyComponent() {
102
- useSwipe('left' (event, swipe) => {
103
- console.log(`Swiped ${swipe.direction} with velocity ${swipe.velocity}`);
102
+ useSwipe('left' (event, direction, data) => {
103
+ console.log(`Swiped ${direction} with velocity ${data.velocity}`);
104
104
  });
105
105
 
106
106
  return <div>Swipe left</div>;
@@ -140,7 +140,7 @@ Hook for handling mouse wheel events with support for different delta modes and
140
140
 
141
141
  **Parameters:**
142
142
 
143
- - `callback: (event: WheelEvent, delta: WheelData) => void | boolean` - Called when wheel event occurs
143
+ - `callback: (event: WheelEvent, data: WheelData) => void | boolean` - Called when wheel event occurs
144
144
  - `options?: UseWheelOptions` - Optional configuration
145
145
 
146
146
  **Options:**
@@ -160,9 +160,9 @@ interface UseWheelOptions {
160
160
 
161
161
  ```typescript
162
162
  interface WheelData {
163
- x: number; // Delta X value
164
- y: number; // Delta Y value
165
- z: number; // Delta Z value
163
+ deltaX: number; // Delta X value
164
+ deltaY: number; // Delta Y value
165
+ deltaZ: number; // Delta Z value
166
166
  deltaMode: number; // Delta mode value
167
167
  }
168
168
  ```
@@ -174,7 +174,7 @@ Hook for handling touch swipe gestures with configurable distance and velocity t
174
174
  **Parameters:**
175
175
 
176
176
  - `swipe: left | right | up | down | horizontal | vertical | both` - Allowed directions to listen
177
- - `callback: (event: TouchEvent, data: SwipeData) => void | boolean` - Called when a swipe event occurs
177
+ - `callback: (event: PointerEvent, direction: SwipeDirection, data: SwipeData) => void | boolean` - Called when a swipe event occurs
178
178
  - `options?: UseSwipeOptions` - Optional configuration
179
179
 
180
180
  **Options:**
@@ -194,7 +194,6 @@ interface UseSwipeOptions {
194
194
 
195
195
  ```typescript
196
196
  interface SwipeData {
197
- direction: SwipeDirection; // Resolved direction
198
197
  deltaX: number; // Horizontal travel
199
198
  deltaY: number; // Vertical travel
200
199
  velocity: number; // Average speed (distance / duration)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msobiecki/react-marauders-path",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22.17.1"
@@ -24,12 +24,12 @@
24
24
  "devDependencies": {
25
25
  "@anolilab/multi-semantic-release": "^4.1.1",
26
26
  "@commitlint/cli": "^20.4.1",
27
- "@commitlint/config-conventional": "^20.4.1",
27
+ "@commitlint/config-conventional": "^20.4.2",
28
28
  "@msobiecki/eslint-config": "^9.12.0",
29
29
  "@semantic-release/changelog": "^6.0.3",
30
30
  "@semantic-release/git": "^10.0.1",
31
31
  "@testing-library/react": "^16.3.2",
32
- "@types/node": "^25.2.3",
32
+ "@types/node": "^25.3.0",
33
33
  "@types/react": "^19.2.14",
34
34
  "@types/react-dom": "^19.2.3",
35
35
  "@vitejs/plugin-react-swc": "^4.2.3",