@msobiecki/react-marauders-path 1.6.0 → 1.8.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 +10 -14
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -33,7 +33,6 @@ function MyComponent() {
33
33
  ### Multiple Patterns of Single Key Schema
34
34
 
35
35
  ```typescript
36
- // Listen to multiple key patterns
37
36
  useKey(["a", "b", "c"], (event, key) => {
38
37
  console.log(`Pressed ${key}`);
39
38
  });
@@ -42,7 +41,6 @@ useKey(["a", "b", "c"], (event, key) => {
42
41
  #### Combination Key Schema
43
42
 
44
43
  ```typescript
45
- // Listen for simultaneous key press (a + b pressed together within 500ms)
46
44
  useKey("a+b", (event, key) => {
47
45
  console.log(`Pressed ${key}`);
48
46
  });
@@ -51,7 +49,6 @@ useKey("a+b", (event, key) => {
51
49
  ### Multiple Patterns of Combination Key Schema
52
50
 
53
51
  ```typescript
54
- // Listen for multiple combination patterns
55
52
  useKey(["a+b", "c+d"], (event, key) => {
56
53
  console.log(`Pressed ${key}`);
57
54
  });
@@ -60,7 +57,6 @@ useKey(["a+b", "c+d"], (event, key) => {
60
57
  ### Sequential Key Schema
61
58
 
62
59
  ```typescript
63
- // Listen for Konami code
64
60
  useKey("ArrowUp ArrowUp ArrowDown ArrowDown", (event, key) => {
65
61
  console.log(`Pressed ${key}`);
66
62
  });
@@ -69,7 +65,6 @@ useKey("ArrowUp ArrowUp ArrowDown ArrowDown", (event, key) => {
69
65
  #### Multiple Patterns of Sequential Key Schema
70
66
 
71
67
  ```typescript
72
- // Listen for multiple sequences
73
68
  useKey(
74
69
  ["ArrowUp ArrowUp ArrowDown ArrowDown", "ArrowLeft ArrowRight"],
75
70
  (event, key) => {
@@ -100,7 +95,7 @@ interface UseKeyOptions {
100
95
  eventOnce?: boolean; // Default: false
101
96
  eventStopImmediatePropagation?: boolean; // Default: false
102
97
  sequenceThreshold?: number; // Default: 1000 (ms) - Timeout between sequence keys
103
- combinationThreshold?: number; // Default: 500 (ms) - Timeout between combination keys
98
+ combinationThreshold?: number; // Default: 200 (ms) - Timeout between combination keys
104
99
  container?: RefObject<HTMLElement>; // Default: window
105
100
  }
106
101
  ```
@@ -185,10 +180,7 @@ npm run dev
185
180
 
186
181
  This example demonstrates:
187
182
 
188
- - Real-time keyboard input handling with arrow keys
189
- - Sequential key patterns (e.g., Konami code)
190
- - Combination keys (simultaneous key presses)
191
- - Game collision detection and movement
183
+ - Combined mouse, touch, and keyboard input
192
184
 
193
185
  ## Development
194
186
 
@@ -212,10 +204,14 @@ npm lint
212
204
 
213
205
  ## Project Status
214
206
 
215
- - 🚧 Core `useKey` combination sequence pattern
216
- - 🚧 Core `useMouse` hook
217
- - 🚧 Core `useMouse` hook unit test coverage
218
- - 🚧 Example of usage
207
+ Hooks
208
+
209
+ - 🚧 `useMouse` Mouse interaction handling
210
+ - 🚧 `useMouse` Unit test coverage
211
+ - 🚧 `useTouch` – Touch interaction handling
212
+ - 🚧 `useTouch` – Unit test coverage
213
+ - 🚧 `useInteraction` – Unified mouse, touch, and keyboard interaction handling
214
+ - 🚧 `useInteraction` – Unit test coverage
219
215
 
220
216
  ## License
221
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msobiecki/react-marauders-path",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22.17.1"
@@ -29,13 +29,13 @@
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.2",
33
- "@types/react": "^19.2.13",
32
+ "@types/node": "^25.2.3",
33
+ "@types/react": "^19.2.14",
34
34
  "@types/react-dom": "^19.2.3",
35
35
  "@vitejs/plugin-react-swc": "^4.2.3",
36
36
  "eslint": "^9.39.2",
37
37
  "husky": "^9.1.7",
38
- "jsdom": "^28.0.0",
38
+ "jsdom": "^28.1.0",
39
39
  "lint-staged": "^16.2.7",
40
40
  "prettier": "^3.7.4",
41
41
  "semantic-release": "^25.0.3",