@inglorious/renderer-react-dom 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/renderer-react-dom",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "A renderer for the Inglorious Engine, using React components.",
5
5
  "author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -24,18 +24,24 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@inglorious/engine": "0.11.0",
28
- "@inglorious/utils": "3.0.0"
29
- },
30
- "devDependencies": {
31
- "eslint": "^9.34.0",
32
- "prettier": "^3.6.2",
33
- "vitest": "^1.6.0"
27
+ "react": "^19.1.1",
28
+ "react-dom": "^19.1.1",
29
+ "react-redux": "^9.2.0",
30
+ "@inglorious/engine": "2.1.0",
31
+ "@inglorious/utils": "3.5.0"
34
32
  },
35
33
  "peerDependencies": {
36
34
  "react": "^19.1.1",
37
35
  "react-dom": "^19.1.1",
38
- "react-redux": "^9.2.0"
36
+ "react-redux": "^9.2.0",
37
+ "@inglorious/engine": "2.1.0",
38
+ "@inglorious/utils": "3.5.0"
39
+ },
40
+ "devDependencies": {
41
+ "eslint": "^9.34.0",
42
+ "prettier": "^3.6.2",
43
+ "vitest": "^1.6.0",
44
+ "@inglorious/eslint-config": "1.0.0"
39
45
  },
40
46
  "scripts": {
41
47
  "format": "prettier --write '**/*.{js,jsx}'",
@@ -1,4 +1,5 @@
1
- import { track } from "@inglorious/engine/behaviors/input/mouse.js"
1
+ import { trackMouse } from "@inglorious/engine/behaviors/input/mouse.js"
2
+ import { trackTouch } from "@inglorious/engine/behaviors/input/touch.js"
2
3
  import { useRef } from "react"
3
4
  import { useDispatch } from "react-redux"
4
5
 
@@ -10,7 +11,11 @@ export default function Scene({ entities, children }) {
10
11
  const [gameWidth, gameHeight] = entities.game.size
11
12
 
12
13
  const ref = useRef()
13
- const mouseHandlers = track(ref.current, {
14
+ const mouseHandlers = trackMouse(ref.current, {
15
+ notify: (type, payload) => dispatch({ type, payload }),
16
+ })
17
+
18
+ const touchHandlers = trackTouch(ref.current, {
14
19
  notify: (type, payload) => dispatch({ type, payload }),
15
20
  })
16
21
 
@@ -20,6 +25,7 @@ export default function Scene({ entities, children }) {
20
25
  style={{ "--width": `${gameWidth}px`, "--height": `${gameHeight}px` }}
21
26
  ref={ref}
22
27
  {...mouseHandlers}
28
+ {...touchHandlers}
23
29
  >
24
30
  {children}
25
31
  </div>