@number10/phaserjsx 0.2.0 → 0.3.1

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/dist/vdom.d.ts CHANGED
@@ -26,6 +26,13 @@ export interface MountProps {
26
26
  * Use this for type-safe mountJSX calls
27
27
  */
28
28
  export type MountComponentProps<P = Record<string, never>> = MountProps & P;
29
+ /**
30
+ * Returned handle from mountJSX
31
+ * Extends the root GameObject with a typed unmount helper
32
+ */
33
+ export interface MountHandle extends Phaser.GameObjects.GameObject {
34
+ unmount: () => void;
35
+ }
29
36
  /**
30
37
  * Creates a VNode element (alternative to JSX)
31
38
  * @param type - Element type (string or component)
@@ -61,6 +68,12 @@ export declare function patchVNode(parent: ParentType, oldV: VNode | null, newV:
61
68
  * @param props - Component props including width and height
62
69
  * @returns Created Phaser GameObject
63
70
  */
64
- export declare function mountJSX<T extends NodeType>(parentOrScene: ParentType, type: T, props: MountComponentProps<NodeProps<T>>): Phaser.GameObjects.GameObject;
65
- export declare function mountJSX<P = Record<string, never>>(parentOrScene: ParentType, type: (props: P & MountProps) => VNode, props: MountComponentProps<P>): Phaser.GameObjects.GameObject;
71
+ export declare function mountJSX<T extends NodeType>(parentOrScene: ParentType, type: T, props: MountComponentProps<NodeProps<T>>): MountHandle;
72
+ export declare function mountJSX<P = Record<string, never>>(parentOrScene: ParentType, type: (props: P & MountProps) => VNode, props: MountComponentProps<P>): MountHandle;
73
+ /**
74
+ * Convenience helper to unmount a tree created via mountJSX without manual casting
75
+ * Accepts either the root GameObject returned from mountJSX or the owning scene
76
+ * @param target - Root GameObject or Phaser scene that holds the mounted JSX tree
77
+ */
78
+ export declare function unmountJSX(target: Phaser.Scene | Phaser.GameObjects.GameObject): void;
66
79
  //# sourceMappingURL=vdom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vdom.d.ts","sourceRoot":"","sources":["../src/vdom.ts"],"names":[],"mappings":"AAKA,OAAO,MAAM,MAAM,QAAQ,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,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,UAAU,GAAG,IAAI,CA+BrF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@number10/phaserjsx",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "description": "Declarative Phaser3 + UI renderer core library",
6
6
  "author": "Michael Rieck (Michael--) <mr@number10.de>",
@@ -63,12 +63,12 @@
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",
66
- "url": "https://github.com/number10/phaserjsx.git",
66
+ "url": "https://github.com/Michael--/phaserjsx",
67
67
  "directory": "packages/ui"
68
68
  },
69
- "homepage": "https://github.com/number10/phaserjsx",
69
+ "homepage": "https://michael--.github.io/phaserjsx/",
70
70
  "bugs": {
71
- "url": "https://github.com/number10/phaserjsx/issues"
71
+ "url": "https://github.com/Michael--/phaserjsx/issues"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/lodash": "^4.17.20",
@@ -100,7 +100,6 @@
100
100
  "@preact/signals-core": "^1.12.1",
101
101
  "fast-deep-equal": "^3.1.3",
102
102
  "lodash": "^4.17.21",
103
- "phaser3-rex-plugins": "^1.80.17",
104
103
  "tsx": "^4.20.6"
105
104
  },
106
105
  "scripts": {