@number10/phaserjsx 0.6.0 → 4.0.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 (82) hide show
  1. package/README.md +13 -3
  2. package/dist/clip/stencil-clip.d.ts +86 -0
  3. package/dist/clip/stencil-clip.d.ts.map +1 -0
  4. package/dist/components/appliers/applyGestures.d.ts.map +1 -1
  5. package/dist/components/creators/createGestures.d.ts.map +1 -1
  6. package/dist/components/custom/CharText/CharText.d.ts.map +1 -1
  7. package/dist/components/custom/Dialog.d.ts +1 -1
  8. package/dist/components/custom/Divider.d.ts +1 -1
  9. package/dist/components/custom/Graphics.d.ts +1 -1
  10. package/dist/components/custom/Graphics.d.ts.map +1 -1
  11. package/dist/components/custom/Icon.d.ts.map +1 -1
  12. package/dist/components/custom/Image.d.ts.map +1 -1
  13. package/dist/components/custom/Joystick.d.ts +1 -1
  14. package/dist/components/custom/NineSlice.d.ts.map +1 -1
  15. package/dist/components/custom/Particles.d.ts +1 -1
  16. package/dist/components/custom/Particles.d.ts.map +1 -1
  17. package/dist/components/custom/Portal.d.ts.map +1 -1
  18. package/dist/components/custom/RefOriginView.d.ts +1 -1
  19. package/dist/components/custom/ScrollView.d.ts.map +1 -1
  20. package/dist/components/custom/Sprite.d.ts +1 -1
  21. package/dist/components/custom/Sprite.d.ts.map +1 -1
  22. package/dist/components/custom/Text.d.ts.map +1 -1
  23. package/dist/components/custom/TileSprite.d.ts +1 -1
  24. package/dist/components/custom/TileSprite.d.ts.map +1 -1
  25. package/dist/components/custom/View.d.ts.map +1 -1
  26. package/dist/components/custom/index.cjs +34 -36
  27. package/dist/components/custom/index.js +2 -37
  28. package/dist/components/primitives/graphics.d.ts.map +1 -1
  29. package/dist/components/primitives/image.d.ts.map +1 -1
  30. package/dist/components/primitives/nineslice.d.ts.map +1 -1
  31. package/dist/components/primitives/particles.d.ts.map +1 -1
  32. package/dist/components/primitives/sprite.d.ts.map +1 -1
  33. package/dist/components/primitives/text.d.ts.map +1 -1
  34. package/dist/components/primitives/tilesprite.d.ts.map +1 -1
  35. package/dist/components/primitives/view.d.ts.map +1 -1
  36. package/dist/custom-BN31OAJq.cjs +30826 -0
  37. package/dist/custom-BN31OAJq.cjs.map +1 -0
  38. package/dist/custom-oy3mBnrW.js +29562 -0
  39. package/dist/custom-oy3mBnrW.js.map +1 -0
  40. package/dist/fx/fx-creators/blur.d.ts.map +1 -1
  41. package/dist/fx/fx-creators/color-matrix.d.ts.map +1 -1
  42. package/dist/fx/fx-creators/glow.d.ts.map +1 -1
  43. package/dist/fx/fx-creators/pixelate.d.ts.map +1 -1
  44. package/dist/fx/fx-creators/shadow.d.ts.map +1 -1
  45. package/dist/fx/fx-creators/vignette.d.ts.map +1 -1
  46. package/dist/fx/use-fx.d.ts +3 -3
  47. package/dist/fx/use-fx.d.ts.map +1 -1
  48. package/dist/gestures/gesture-manager.d.ts +3 -1
  49. package/dist/gestures/gesture-manager.d.ts.map +1 -1
  50. package/dist/gestures/gesture-types.d.ts +1 -1
  51. package/dist/gestures/gesture-types.d.ts.map +1 -1
  52. package/dist/index.cjs +1547 -2837
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.js +1356 -2866
  55. package/dist/index.js.map +1 -1
  56. package/dist/jsx-dev-runtime.cjs +12 -7
  57. package/dist/jsx-dev-runtime.cjs.map +1 -1
  58. package/dist/jsx-dev-runtime.js +11 -11
  59. package/dist/jsx-dev-runtime.js.map +1 -1
  60. package/dist/jsx-runtime.cjs +55 -33
  61. package/dist/jsx-runtime.cjs.map +1 -1
  62. package/dist/jsx-runtime.js +56 -37
  63. package/dist/jsx-runtime.js.map +1 -1
  64. package/dist/layout/layout-engine.d.ts.map +1 -1
  65. package/dist/scripts/generate-icon-loaders.js +146 -143
  66. package/dist/scripts/generate-icon-types.js +94 -83
  67. package/dist/scripts/generate-icons.d.ts +1 -2
  68. package/dist/scripts/generate-icons.d.ts.map +1 -1
  69. package/dist/scripts/generate-icons.js +381 -399
  70. package/dist/scripts/icon-generator-config.d.ts +0 -1
  71. package/dist/scripts/icon-generator-config.js +7 -4
  72. package/dist/theme-base.d.ts.map +1 -1
  73. package/dist/utils/svg-texture.d.ts.map +1 -1
  74. package/dist/vite-plugin-icons.d.ts +1 -2
  75. package/dist/vite-plugin-icons.js +109 -90
  76. package/package.json +24 -22
  77. package/dist/TransformOriginView-DsD_qZno.cjs +0 -17115
  78. package/dist/TransformOriginView-DsD_qZno.cjs.map +0 -1
  79. package/dist/TransformOriginView-uYYqbEHW.js +0 -17099
  80. package/dist/TransformOriginView-uYYqbEHW.js.map +0 -1
  81. package/dist/components/custom/index.cjs.map +0 -1
  82. package/dist/components/custom/index.js.map +0 -1
@@ -84,4 +84,3 @@ export interface IconGeneratorConfig {
84
84
  * Helper function to define config with type safety
85
85
  */
86
86
  export declare function defineIconConfig(config: IconGeneratorConfig): IconGeneratorConfig;
87
- //# sourceMappingURL=icon-generator-config.d.ts.map
@@ -1,6 +1,9 @@
1
+ //#region src/scripts/icon-generator-config.ts
2
+ /**
3
+ * Helper function to define config with type safety
4
+ */
1
5
  function defineIconConfig(config) {
2
- return config;
6
+ return config;
3
7
  }
4
- export {
5
- defineIconConfig
6
- };
8
+ //#endregion
9
+ export { defineIconConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"theme-base.d.ts","sourceRoot":"","sources":["../src/theme-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,cAAc,EACf,MAAM,cAAc,CAAA;AAErB;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,OAAO,CACX,MAAM,eAAe,EACrB,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAC7F,CAAC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,CAAA;AA0BrC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,MAAW,EAClB,MAAM,GAAE,MAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CAyDf"}
1
+ {"version":3,"file":"svg-texture.d.ts","sourceRoot":"","sources":["../../src/utils/svg-texture.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AAqCrC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,MAAW,EAClB,MAAM,GAAE,MAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CA4Df"}
@@ -1,4 +1,4 @@
1
- import { Plugin } from 'vite';
1
+ import type { Plugin } from 'vite';
2
2
  export interface IconGeneratorPluginOptions {
3
3
  /** Path to icon generator config file */
4
4
  configPath: string;
@@ -26,4 +26,3 @@ export interface IconGeneratorPluginOptions {
26
26
  * Vite plugin for icon generation
27
27
  */
28
28
  export declare function iconGeneratorPlugin(options: IconGeneratorPluginOptions): Plugin;
29
- //# sourceMappingURL=vite-plugin-icons.d.ts.map
@@ -1,95 +1,114 @@
1
1
  import { resolve } from "node:path";
2
+ //#region src/vite-plugin-icons.ts
3
+ /**
4
+ * Vite plugin for automatic icon generation
5
+ * Integrates icon generator into Vite's build pipeline
6
+ *
7
+ * Usage in vite.config.ts:
8
+ * import { iconGeneratorPlugin } from '@number10/phaserjsx/vite-plugin-icons'
9
+ *
10
+ * export default defineConfig({
11
+ * plugins: [
12
+ * iconGeneratorPlugin({
13
+ * configPath: './icon-generator.config.ts',
14
+ * watch: true, // Enable in dev mode
15
+ * })
16
+ * ]
17
+ * })
18
+ */
19
+ /**
20
+ * Import generation functions dynamically to avoid circular deps
21
+ */
2
22
  async function loadGeneratorFunctions() {
3
- const module = await import("./scripts/generate-icons.js");
4
- return {
5
- loadConfig: module.loadConfig,
6
- generateTypes: module.generateTypes,
7
- generateLoaders: module.generateLoaders,
8
- scanIconSources: module.scanIconSources
9
- };
23
+ const module = await import("./scripts/generate-icons.js");
24
+ return {
25
+ loadConfig: module.loadConfig,
26
+ generateTypes: module.generateTypes,
27
+ generateLoaders: module.generateLoaders,
28
+ scanIconSources: module.scanIconSources
29
+ };
10
30
  }
31
+ /**
32
+ * Vite plugin for icon generation
33
+ */
11
34
  function iconGeneratorPlugin(options) {
12
- let config;
13
- let root;
14
- let isDevMode = false;
15
- return {
16
- name: "vite-plugin-icon-generator",
17
- async configResolved(resolvedConfig) {
18
- root = resolvedConfig.root;
19
- isDevMode = resolvedConfig.command === "serve";
20
- try {
21
- const { loadConfig } = await loadGeneratorFunctions();
22
- config = await loadConfig(options.configPath, root);
23
- if (options.typesOnly && config.loaders) {
24
- config = { ...config, loaders: { ...config.loaders, enabled: false } };
25
- }
26
- if (options.loadersOnly && config.types) {
27
- config = { ...config, types: { ...config.types, enabled: false } };
28
- }
29
- } catch (error) {
30
- this.error(`Icon Generator Plugin: ${error}`);
31
- }
32
- },
33
- async buildStart() {
34
- if (!config) return;
35
- const scanIconDirectory = config.types?.scanIconDirectory ?? options.scanIconDirectory ?? "watch";
36
- const generateLoadersMode = config.loaders?.generateLoaders ?? options.generateLoaders ?? "watch";
37
- const shouldGenerateTypes = scanIconDirectory !== "never" && config.types?.enabled;
38
- const shouldGenerateLoaders = config.loaders?.enabled && (isDevMode ? generateLoadersMode === "start" : true);
39
- if (!shouldGenerateTypes && !shouldGenerateLoaders) return;
40
- console.log("🎨 [Icon Generator] Generating icons...");
41
- try {
42
- const { generateTypes, generateLoaders, scanIconSources } = await loadGeneratorFunctions();
43
- let typesResult = shouldGenerateTypes ? await generateTypes(config, root) : null;
44
- if (shouldGenerateLoaders) {
45
- if (!typesResult && config.types?.enabled) {
46
- typesResult = await scanIconSources(config, root);
47
- }
48
- await generateLoaders(config, root, typesResult || void 0);
49
- }
50
- console.log("✨ [Icon Generator] Done!");
51
- } catch (error) {
52
- this.error(`Icon Generator Plugin: ${error}`);
53
- }
54
- },
55
- async handleHotUpdate({ file, server }) {
56
- if (!isDevMode || !config || options.watch === false) return;
57
- const scanIconDirectory = config.types?.scanIconDirectory ?? options.scanIconDirectory ?? "watch";
58
- const generateLoadersMode = config.loaders?.generateLoaders ?? options.generateLoaders ?? "watch";
59
- const scanDirAbs = config.loaders?.enabled ? resolve(root, config.loaders.scanDir) : null;
60
- const shouldRegenerateLoaders = generateLoadersMode === "watch" && config.loaders?.enabled && scanDirAbs && file.startsWith(scanDirAbs) && /\.(tsx?|jsx?)$/.test(file) && !file.endsWith(".generated.ts");
61
- const sources = Array.isArray(config.source) ? config.source : [config.source];
62
- const sourceAbsPaths = sources.filter((s) => s.directory).map((s) => resolve(root, s.directory));
63
- const shouldRegenerateTypes = scanIconDirectory === "watch" && config.types?.enabled && file.endsWith(".svg") && sourceAbsPaths.some((path) => file.startsWith(path));
64
- if (shouldRegenerateLoaders || shouldRegenerateTypes) {
65
- console.log("🔄 [Icon Generator] File changed, regenerating...");
66
- try {
67
- const { generateTypes, generateLoaders, scanIconSources } = await loadGeneratorFunctions();
68
- let typesResult = null;
69
- if (shouldRegenerateTypes) {
70
- typesResult = await generateTypes(config, root);
71
- } else if (shouldRegenerateLoaders && config.types?.enabled) {
72
- if (scanIconDirectory === "watch") {
73
- typesResult = await generateTypes(config, root);
74
- } else {
75
- typesResult = await scanIconSources(config, root);
76
- }
77
- }
78
- if (shouldRegenerateLoaders) {
79
- await generateLoaders(config, root, typesResult || void 0);
80
- }
81
- console.log("✅ [Icon Generator] Regenerated");
82
- server.ws.send({
83
- type: "full-reload",
84
- path: "*"
85
- });
86
- } catch (error) {
87
- console.error("❌ [Icon Generator] Error:", error);
88
- }
89
- }
90
- }
91
- };
35
+ let config;
36
+ let root;
37
+ let isDevMode = false;
38
+ return {
39
+ name: "vite-plugin-icon-generator",
40
+ async configResolved(resolvedConfig) {
41
+ root = resolvedConfig.root;
42
+ isDevMode = resolvedConfig.command === "serve";
43
+ try {
44
+ const { loadConfig } = await loadGeneratorFunctions();
45
+ config = await loadConfig(options.configPath, root);
46
+ if (options.typesOnly && config.loaders) config = {
47
+ ...config,
48
+ loaders: {
49
+ ...config.loaders,
50
+ enabled: false
51
+ }
52
+ };
53
+ if (options.loadersOnly && config.types) config = {
54
+ ...config,
55
+ types: {
56
+ ...config.types,
57
+ enabled: false
58
+ }
59
+ };
60
+ } catch (error) {
61
+ this.error(`Icon Generator Plugin: ${error}`);
62
+ }
63
+ },
64
+ async buildStart() {
65
+ if (!config) return;
66
+ const scanIconDirectory = config.types?.scanIconDirectory ?? options.scanIconDirectory ?? "watch";
67
+ const generateLoadersMode = config.loaders?.generateLoaders ?? options.generateLoaders ?? "watch";
68
+ const shouldGenerateTypes = scanIconDirectory !== "never" && config.types?.enabled;
69
+ const shouldGenerateLoaders = config.loaders?.enabled && (isDevMode ? generateLoadersMode === "start" : true);
70
+ if (!shouldGenerateTypes && !shouldGenerateLoaders) return;
71
+ console.log("🎨 [Icon Generator] Generating icons...");
72
+ try {
73
+ const { generateTypes, generateLoaders, scanIconSources } = await loadGeneratorFunctions();
74
+ let typesResult = shouldGenerateTypes ? await generateTypes(config, root) : null;
75
+ if (shouldGenerateLoaders) {
76
+ if (!typesResult && config.types?.enabled) typesResult = await scanIconSources(config, root);
77
+ await generateLoaders(config, root, typesResult || void 0);
78
+ }
79
+ console.log("✨ [Icon Generator] Done!");
80
+ } catch (error) {
81
+ this.error(`Icon Generator Plugin: ${error}`);
82
+ }
83
+ },
84
+ async handleHotUpdate({ file, server }) {
85
+ if (!isDevMode || !config || options.watch === false) return;
86
+ const scanIconDirectory = config.types?.scanIconDirectory ?? options.scanIconDirectory ?? "watch";
87
+ const generateLoadersMode = config.loaders?.generateLoaders ?? options.generateLoaders ?? "watch";
88
+ const scanDirAbs = config.loaders?.enabled ? resolve(root, config.loaders.scanDir) : null;
89
+ const shouldRegenerateLoaders = generateLoadersMode === "watch" && config.loaders?.enabled && scanDirAbs && file.startsWith(scanDirAbs) && /\.(tsx?|jsx?)$/.test(file) && !file.endsWith(".generated.ts");
90
+ const sourceAbsPaths = (Array.isArray(config.source) ? config.source : [config.source]).filter((s) => s.directory).map((s) => resolve(root, s.directory));
91
+ const shouldRegenerateTypes = scanIconDirectory === "watch" && config.types?.enabled && file.endsWith(".svg") && sourceAbsPaths.some((path) => file.startsWith(path));
92
+ if (shouldRegenerateLoaders || shouldRegenerateTypes) {
93
+ console.log("🔄 [Icon Generator] File changed, regenerating...");
94
+ try {
95
+ const { generateTypes, generateLoaders, scanIconSources } = await loadGeneratorFunctions();
96
+ let typesResult = null;
97
+ if (shouldRegenerateTypes) typesResult = await generateTypes(config, root);
98
+ else if (shouldRegenerateLoaders && config.types?.enabled) if (scanIconDirectory === "watch") typesResult = await generateTypes(config, root);
99
+ else typesResult = await scanIconSources(config, root);
100
+ if (shouldRegenerateLoaders) await generateLoaders(config, root, typesResult || void 0);
101
+ console.log("✅ [Icon Generator] Regenerated");
102
+ server.ws.send({
103
+ type: "full-reload",
104
+ path: "*"
105
+ });
106
+ } catch (error) {
107
+ console.error("❌ [Icon Generator] Error:", error);
108
+ }
109
+ }
110
+ }
111
+ };
92
112
  }
93
- export {
94
- iconGeneratorPlugin
95
- };
113
+ //#endregion
114
+ export { iconGeneratorPlugin };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@number10/phaserjsx",
3
- "version": "0.6.0",
3
+ "version": "4.0.0",
4
4
  "type": "module",
5
- "description": "Declarative Phaser3 + UI renderer core library",
5
+ "description": "Declarative Phaser 4 + UI renderer core library",
6
6
  "author": "Michael Rieck (Michael--) <mr@number10.de>",
7
7
  "main": "./dist/index.cjs",
8
8
  "module": "./dist/index.js",
@@ -59,7 +59,7 @@
59
59
  ],
60
60
  "keywords": [
61
61
  "phaser",
62
- "phaser3",
62
+ "phaser4",
63
63
  "declarative",
64
64
  "typescript",
65
65
  "game-engine",
@@ -83,25 +83,26 @@
83
83
  "url": "https://github.com/Michael--/phaserjsx/issues"
84
84
  },
85
85
  "devDependencies": {
86
- "@types/lodash": "^4.17.20",
87
- "@types/node": "^24.10.1",
88
- "@typescript-eslint/eslint-plugin": "^8.46.4",
89
- "@typescript-eslint/parser": "^8.46.4",
90
- "@vitest/coverage-v8": "4.0.8",
91
- "eslint": "^9.39.1",
86
+ "@eslint/js": "^10.0.1",
87
+ "@types/lodash": "^4.17.24",
88
+ "@types/node": "^25.9.0",
89
+ "@typescript-eslint/eslint-plugin": "^8.59.4",
90
+ "@typescript-eslint/parser": "^8.59.4",
91
+ "@vitest/coverage-v8": "4.1.6",
92
+ "eslint": "^10.4.0",
92
93
  "eslint-config-prettier": "^10.1.8",
93
94
  "eslint-plugin-import": "^2.32.0",
94
- "eslint-plugin-unused-imports": "^4.3.0",
95
- "happy-dom": "^20.0.10",
96
- "jsdom": "^27.2.0",
97
- "prettier": "^3.6.2",
98
- "typescript": "^5.9.3",
99
- "vite": "^7.2.2",
100
- "vite-plugin-dts": "^4.5.4",
101
- "vitest": "^4.0.8"
95
+ "eslint-plugin-unused-imports": "^4.4.1",
96
+ "happy-dom": "^20.9.0",
97
+ "jsdom": "^29.1.1",
98
+ "prettier": "^3.8.3",
99
+ "typescript": "^6.0.3",
100
+ "vite": "^8.0.13",
101
+ "vite-plugin-dts": "^5.0.1",
102
+ "vitest": "^4.1.6"
102
103
  },
103
104
  "peerDependencies": {
104
- "phaser": "^3.90.0"
105
+ "phaser": "^4.1.0"
105
106
  },
106
107
  "peerDependenciesMeta": {
107
108
  "phaser": {
@@ -109,15 +110,16 @@
109
110
  }
110
111
  },
111
112
  "dependencies": {
112
- "@preact/signals-core": "^1.12.1",
113
+ "@preact/signals-core": "^1.14.2",
113
114
  "fast-deep-equal": "^3.1.3",
114
- "lodash": "^4.17.21",
115
- "tsx": "^4.20.6"
115
+ "lodash": "^4.18.1",
116
+ "tsx": "^4.22.3"
116
117
  },
117
118
  "scripts": {
118
119
  "dev": "vite build --watch",
119
120
  "build": "tsc --noEmit && vite build && pnpm build:scripts",
120
- "build:scripts": "vite build --config scripts.vite.config.ts && chmod +x dist/scripts/*.js",
121
+ "build:scripts": "vite build --config scripts.vite.config.ts && pnpm build:scripts:types && chmod +x dist/scripts/*.js",
122
+ "build:scripts:types": "tsc --ignoreConfig src/scripts/icon-generator-config.ts src/vite-plugin-icons.ts --declaration --emitDeclarationOnly --declarationMap false --outDir dist --moduleResolution bundler --module ESNext --target ES2022 --skipLibCheck --types node",
121
123
  "test": "vitest run",
122
124
  "test:watch": "vitest",
123
125
  "test:coverage": "vitest run --coverage",