@number10/jsx-phaser 5.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 (689) hide show
  1. package/LICENSE +667 -0
  2. package/README.md +44 -0
  3. package/dist/_virtual/_commonjsHelpers.cjs +7 -0
  4. package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
  5. package/dist/_virtual/_commonjsHelpers.js +7 -0
  6. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  7. package/dist/_virtual/index.cjs +7 -0
  8. package/dist/_virtual/index.cjs.map +1 -0
  9. package/dist/_virtual/index.js +8 -0
  10. package/dist/_virtual/index.js.map +1 -0
  11. package/dist/animation/index.d.ts +7 -0
  12. package/dist/animation/index.d.ts.map +1 -0
  13. package/dist/camera/index.d.ts +5 -0
  14. package/dist/camera/index.d.ts.map +1 -0
  15. package/dist/camera/use-camera-fx.cjs +49 -0
  16. package/dist/camera/use-camera-fx.cjs.map +1 -0
  17. package/dist/camera/use-camera-fx.d.ts +25 -0
  18. package/dist/camera/use-camera-fx.d.ts.map +1 -0
  19. package/dist/camera/use-camera-fx.js +49 -0
  20. package/dist/camera/use-camera-fx.js.map +1 -0
  21. package/dist/clip/index.cjs +8 -0
  22. package/dist/clip/index.cjs.map +1 -0
  23. package/dist/clip/index.d.ts +3 -0
  24. package/dist/clip/index.d.ts.map +1 -0
  25. package/dist/clip/index.js +9 -0
  26. package/dist/clip/index.js.map +1 -0
  27. package/dist/clip/stencil-clip-depth.cjs +24 -0
  28. package/dist/clip/stencil-clip-depth.cjs.map +1 -0
  29. package/dist/clip/stencil-clip-depth.d.ts +10 -0
  30. package/dist/clip/stencil-clip-depth.d.ts.map +1 -0
  31. package/dist/clip/stencil-clip-depth.js +24 -0
  32. package/dist/clip/stencil-clip-depth.js.map +1 -0
  33. package/dist/clip/stencil-clip-extension.cjs +113 -0
  34. package/dist/clip/stencil-clip-extension.cjs.map +1 -0
  35. package/dist/clip/stencil-clip-extension.d.ts +18 -0
  36. package/dist/clip/stencil-clip-extension.d.ts.map +1 -0
  37. package/dist/clip/stencil-clip-extension.js +96 -0
  38. package/dist/clip/stencil-clip-extension.js.map +1 -0
  39. package/dist/clip/stencil-clip-fbo-bridge.cjs +46 -0
  40. package/dist/clip/stencil-clip-fbo-bridge.cjs.map +1 -0
  41. package/dist/clip/stencil-clip-fbo-bridge.d.ts +7 -0
  42. package/dist/clip/stencil-clip-fbo-bridge.d.ts.map +1 -0
  43. package/dist/clip/stencil-clip-fbo-bridge.js +46 -0
  44. package/dist/clip/stencil-clip-fbo-bridge.js.map +1 -0
  45. package/dist/clip/stencil-clip-renderer.cjs +300 -0
  46. package/dist/clip/stencil-clip-renderer.cjs.map +1 -0
  47. package/dist/clip/stencil-clip-renderer.d.ts +7 -0
  48. package/dist/clip/stencil-clip-renderer.d.ts.map +1 -0
  49. package/dist/clip/stencil-clip-renderer.js +300 -0
  50. package/dist/clip/stencil-clip-renderer.js.map +1 -0
  51. package/dist/clip/stencil-clip-state.cjs +84 -0
  52. package/dist/clip/stencil-clip-state.cjs.map +1 -0
  53. package/dist/clip/stencil-clip-state.d.ts +28 -0
  54. package/dist/clip/stencil-clip-state.d.ts.map +1 -0
  55. package/dist/clip/stencil-clip-state.js +84 -0
  56. package/dist/clip/stencil-clip-state.js.map +1 -0
  57. package/dist/clip/stencil-clip-types.d.ts +67 -0
  58. package/dist/clip/stencil-clip-types.d.ts.map +1 -0
  59. package/dist/clip/stencil-clip.cjs +138 -0
  60. package/dist/clip/stencil-clip.cjs.map +1 -0
  61. package/dist/clip/stencil-clip.d.ts +53 -0
  62. package/dist/clip/stencil-clip.d.ts.map +1 -0
  63. package/dist/clip/stencil-clip.js +122 -0
  64. package/dist/clip/stencil-clip.js.map +1 -0
  65. package/dist/colors/use-color-mode.cjs +28 -0
  66. package/dist/colors/use-color-mode.cjs.map +1 -0
  67. package/dist/colors/use-color-mode.d.ts +22 -0
  68. package/dist/colors/use-color-mode.d.ts.map +1 -0
  69. package/dist/colors/use-color-mode.js +28 -0
  70. package/dist/colors/use-color-mode.js.map +1 -0
  71. package/dist/colors/use-colors.cjs +45 -0
  72. package/dist/colors/use-colors.cjs.map +1 -0
  73. package/dist/colors/use-colors.d.ts +36 -0
  74. package/dist/colors/use-colors.d.ts.map +1 -0
  75. package/dist/colors/use-colors.js +45 -0
  76. package/dist/colors/use-colors.js.map +1 -0
  77. package/dist/components/DebugPanel.cjs +88 -0
  78. package/dist/components/DebugPanel.cjs.map +1 -0
  79. package/dist/components/DebugPanel.d.ts +45 -0
  80. package/dist/components/DebugPanel.d.ts.map +1 -0
  81. package/dist/components/DebugPanel.js +71 -0
  82. package/dist/components/DebugPanel.js.map +1 -0
  83. package/dist/components/appliers/applyBackground.cjs +89 -0
  84. package/dist/components/appliers/applyBackground.cjs.map +1 -0
  85. package/dist/components/appliers/applyBackground.d.ts +18 -0
  86. package/dist/components/appliers/applyBackground.d.ts.map +1 -0
  87. package/dist/components/appliers/applyBackground.js +89 -0
  88. package/dist/components/appliers/applyBackground.js.map +1 -0
  89. package/dist/components/appliers/applyGestures.cjs +85 -0
  90. package/dist/components/appliers/applyGestures.cjs.map +1 -0
  91. package/dist/components/appliers/applyGestures.d.ts +12 -0
  92. package/dist/components/appliers/applyGestures.d.ts.map +1 -0
  93. package/dist/components/appliers/applyGestures.js +68 -0
  94. package/dist/components/appliers/applyGestures.js.map +1 -0
  95. package/dist/components/appliers/applyGraphics.cjs +21 -0
  96. package/dist/components/appliers/applyGraphics.cjs.map +1 -0
  97. package/dist/components/appliers/applyGraphics.d.ts +13 -0
  98. package/dist/components/appliers/applyGraphics.d.ts.map +1 -0
  99. package/dist/components/appliers/applyGraphics.js +21 -0
  100. package/dist/components/appliers/applyGraphics.js.map +1 -0
  101. package/dist/components/appliers/applyGraphicsLayout.cjs +18 -0
  102. package/dist/components/appliers/applyGraphicsLayout.cjs.map +1 -0
  103. package/dist/components/appliers/applyGraphicsLayout.d.ts +13 -0
  104. package/dist/components/appliers/applyGraphicsLayout.d.ts.map +1 -0
  105. package/dist/components/appliers/applyGraphicsLayout.js +18 -0
  106. package/dist/components/appliers/applyGraphicsLayout.js.map +1 -0
  107. package/dist/components/appliers/applyImage.cjs +92 -0
  108. package/dist/components/appliers/applyImage.cjs.map +1 -0
  109. package/dist/components/appliers/applyImage.d.ts +47 -0
  110. package/dist/components/appliers/applyImage.d.ts.map +1 -0
  111. package/dist/components/appliers/applyImage.js +92 -0
  112. package/dist/components/appliers/applyImage.js.map +1 -0
  113. package/dist/components/appliers/applyImageLayout.cjs +18 -0
  114. package/dist/components/appliers/applyImageLayout.cjs.map +1 -0
  115. package/dist/components/appliers/applyImageLayout.d.ts +18 -0
  116. package/dist/components/appliers/applyImageLayout.d.ts.map +1 -0
  117. package/dist/components/appliers/applyImageLayout.js +18 -0
  118. package/dist/components/appliers/applyImageLayout.js.map +1 -0
  119. package/dist/components/appliers/applyLayout.cjs +108 -0
  120. package/dist/components/appliers/applyLayout.cjs.map +1 -0
  121. package/dist/components/appliers/applyLayout.d.ts +19 -0
  122. package/dist/components/appliers/applyLayout.d.ts.map +1 -0
  123. package/dist/components/appliers/applyLayout.js +91 -0
  124. package/dist/components/appliers/applyLayout.js.map +1 -0
  125. package/dist/components/appliers/applyNineSlice.cjs +37 -0
  126. package/dist/components/appliers/applyNineSlice.cjs.map +1 -0
  127. package/dist/components/appliers/applyNineSlice.d.ts +14 -0
  128. package/dist/components/appliers/applyNineSlice.d.ts.map +1 -0
  129. package/dist/components/appliers/applyNineSlice.js +37 -0
  130. package/dist/components/appliers/applyNineSlice.js.map +1 -0
  131. package/dist/components/appliers/applyNineSliceLayout.cjs +18 -0
  132. package/dist/components/appliers/applyNineSliceLayout.cjs.map +1 -0
  133. package/dist/components/appliers/applyNineSliceLayout.d.ts +18 -0
  134. package/dist/components/appliers/applyNineSliceLayout.d.ts.map +1 -0
  135. package/dist/components/appliers/applyNineSliceLayout.js +18 -0
  136. package/dist/components/appliers/applyNineSliceLayout.js.map +1 -0
  137. package/dist/components/appliers/applyParticles.cjs +46 -0
  138. package/dist/components/appliers/applyParticles.cjs.map +1 -0
  139. package/dist/components/appliers/applyParticles.d.ts +7 -0
  140. package/dist/components/appliers/applyParticles.d.ts.map +1 -0
  141. package/dist/components/appliers/applyParticles.js +46 -0
  142. package/dist/components/appliers/applyParticles.js.map +1 -0
  143. package/dist/components/appliers/applyParticlesLayout.cjs +7 -0
  144. package/dist/components/appliers/applyParticlesLayout.cjs.map +1 -0
  145. package/dist/components/appliers/applyParticlesLayout.d.ts +11 -0
  146. package/dist/components/appliers/applyParticlesLayout.d.ts.map +1 -0
  147. package/dist/components/appliers/applyParticlesLayout.js +7 -0
  148. package/dist/components/appliers/applyParticlesLayout.js.map +1 -0
  149. package/dist/components/appliers/applyPhaser.cjs +40 -0
  150. package/dist/components/appliers/applyPhaser.cjs.map +1 -0
  151. package/dist/components/appliers/applyPhaser.d.ts +24 -0
  152. package/dist/components/appliers/applyPhaser.d.ts.map +1 -0
  153. package/dist/components/appliers/applyPhaser.js +40 -0
  154. package/dist/components/appliers/applyPhaser.js.map +1 -0
  155. package/dist/components/appliers/applySprite.cjs +124 -0
  156. package/dist/components/appliers/applySprite.cjs.map +1 -0
  157. package/dist/components/appliers/applySprite.d.ts +13 -0
  158. package/dist/components/appliers/applySprite.d.ts.map +1 -0
  159. package/dist/components/appliers/applySprite.js +124 -0
  160. package/dist/components/appliers/applySprite.js.map +1 -0
  161. package/dist/components/appliers/applySpriteLayout.cjs +7 -0
  162. package/dist/components/appliers/applySpriteLayout.cjs.map +1 -0
  163. package/dist/components/appliers/applySpriteLayout.d.ts +17 -0
  164. package/dist/components/appliers/applySpriteLayout.d.ts.map +1 -0
  165. package/dist/components/appliers/applySpriteLayout.js +7 -0
  166. package/dist/components/appliers/applySpriteLayout.js.map +1 -0
  167. package/dist/components/appliers/applyText.cjs +142 -0
  168. package/dist/components/appliers/applyText.cjs.map +1 -0
  169. package/dist/components/appliers/applyText.d.ts +32 -0
  170. package/dist/components/appliers/applyText.d.ts.map +1 -0
  171. package/dist/components/appliers/applyText.js +142 -0
  172. package/dist/components/appliers/applyText.js.map +1 -0
  173. package/dist/components/appliers/applyTextLayout.cjs +16 -0
  174. package/dist/components/appliers/applyTextLayout.cjs.map +1 -0
  175. package/dist/components/appliers/applyTextLayout.d.ts +18 -0
  176. package/dist/components/appliers/applyTextLayout.d.ts.map +1 -0
  177. package/dist/components/appliers/applyTextLayout.js +16 -0
  178. package/dist/components/appliers/applyTextLayout.js.map +1 -0
  179. package/dist/components/appliers/applyTooltip.cjs +247 -0
  180. package/dist/components/appliers/applyTooltip.cjs.map +1 -0
  181. package/dist/components/appliers/applyTooltip.d.ts +16 -0
  182. package/dist/components/appliers/applyTooltip.d.ts.map +1 -0
  183. package/dist/components/appliers/applyTooltip.js +247 -0
  184. package/dist/components/appliers/applyTooltip.js.map +1 -0
  185. package/dist/components/appliers/applyTransform.cjs +61 -0
  186. package/dist/components/appliers/applyTransform.cjs.map +1 -0
  187. package/dist/components/appliers/applyTransform.d.ts +24 -0
  188. package/dist/components/appliers/applyTransform.d.ts.map +1 -0
  189. package/dist/components/appliers/applyTransform.js +61 -0
  190. package/dist/components/appliers/applyTransform.js.map +1 -0
  191. package/dist/components/backgroundImage.cjs +411 -0
  192. package/dist/components/backgroundImage.cjs.map +1 -0
  193. package/dist/components/backgroundImage.d.ts +14 -0
  194. package/dist/components/backgroundImage.d.ts.map +1 -0
  195. package/dist/components/backgroundImage.js +411 -0
  196. package/dist/components/backgroundImage.js.map +1 -0
  197. package/dist/components/creators/createBackground.cjs +18 -0
  198. package/dist/components/creators/createBackground.cjs.map +1 -0
  199. package/dist/components/creators/createBackground.d.ts +20 -0
  200. package/dist/components/creators/createBackground.d.ts.map +1 -0
  201. package/dist/components/creators/createBackground.js +18 -0
  202. package/dist/components/creators/createBackground.js.map +1 -0
  203. package/dist/components/creators/createGestures.cjs +51 -0
  204. package/dist/components/creators/createGestures.cjs.map +1 -0
  205. package/dist/components/creators/createGestures.d.ts +11 -0
  206. package/dist/components/creators/createGestures.d.ts.map +1 -0
  207. package/dist/components/creators/createGestures.js +34 -0
  208. package/dist/components/creators/createGestures.js.map +1 -0
  209. package/dist/components/creators/createGraphicsLayout.cjs +24 -0
  210. package/dist/components/creators/createGraphicsLayout.cjs.map +1 -0
  211. package/dist/components/creators/createGraphicsLayout.d.ts +12 -0
  212. package/dist/components/creators/createGraphicsLayout.d.ts.map +1 -0
  213. package/dist/components/creators/createGraphicsLayout.js +24 -0
  214. package/dist/components/creators/createGraphicsLayout.js.map +1 -0
  215. package/dist/components/creators/createImageLayout.cjs +16 -0
  216. package/dist/components/creators/createImageLayout.cjs.map +1 -0
  217. package/dist/components/creators/createImageLayout.d.ts +17 -0
  218. package/dist/components/creators/createImageLayout.d.ts.map +1 -0
  219. package/dist/components/creators/createImageLayout.js +16 -0
  220. package/dist/components/creators/createImageLayout.js.map +1 -0
  221. package/dist/components/creators/createLayout.cjs +61 -0
  222. package/dist/components/creators/createLayout.cjs.map +1 -0
  223. package/dist/components/creators/createLayout.d.ts +15 -0
  224. package/dist/components/creators/createLayout.d.ts.map +1 -0
  225. package/dist/components/creators/createLayout.js +61 -0
  226. package/dist/components/creators/createLayout.js.map +1 -0
  227. package/dist/components/creators/createNineSliceLayout.cjs +16 -0
  228. package/dist/components/creators/createNineSliceLayout.cjs.map +1 -0
  229. package/dist/components/creators/createNineSliceLayout.d.ts +17 -0
  230. package/dist/components/creators/createNineSliceLayout.d.ts.map +1 -0
  231. package/dist/components/creators/createNineSliceLayout.js +16 -0
  232. package/dist/components/creators/createNineSliceLayout.js.map +1 -0
  233. package/dist/components/creators/createParticlesLayout.cjs +8 -0
  234. package/dist/components/creators/createParticlesLayout.cjs.map +1 -0
  235. package/dist/components/creators/createParticlesLayout.d.ts +14 -0
  236. package/dist/components/creators/createParticlesLayout.d.ts.map +1 -0
  237. package/dist/components/creators/createParticlesLayout.js +8 -0
  238. package/dist/components/creators/createParticlesLayout.js.map +1 -0
  239. package/dist/components/creators/createPhaser.cjs +36 -0
  240. package/dist/components/creators/createPhaser.cjs.map +1 -0
  241. package/dist/components/creators/createPhaser.d.ts +14 -0
  242. package/dist/components/creators/createPhaser.d.ts.map +1 -0
  243. package/dist/components/creators/createPhaser.js +36 -0
  244. package/dist/components/creators/createPhaser.js.map +1 -0
  245. package/dist/components/creators/createSpriteLayout.cjs +10 -0
  246. package/dist/components/creators/createSpriteLayout.cjs.map +1 -0
  247. package/dist/components/creators/createSpriteLayout.d.ts +18 -0
  248. package/dist/components/creators/createSpriteLayout.d.ts.map +1 -0
  249. package/dist/components/creators/createSpriteLayout.js +10 -0
  250. package/dist/components/creators/createSpriteLayout.js.map +1 -0
  251. package/dist/components/creators/createTextLayout.cjs +16 -0
  252. package/dist/components/creators/createTextLayout.cjs.map +1 -0
  253. package/dist/components/creators/createTextLayout.d.ts +17 -0
  254. package/dist/components/creators/createTextLayout.d.ts.map +1 -0
  255. package/dist/components/creators/createTextLayout.js +16 -0
  256. package/dist/components/creators/createTextLayout.js.map +1 -0
  257. package/dist/components/creators/createTransform.cjs +83 -0
  258. package/dist/components/creators/createTransform.cjs.map +1 -0
  259. package/dist/components/creators/createTransform.d.ts +26 -0
  260. package/dist/components/creators/createTransform.d.ts.map +1 -0
  261. package/dist/components/creators/createTransform.js +83 -0
  262. package/dist/components/creators/createTransform.js.map +1 -0
  263. package/dist/components/custom/Graphics.cjs +13 -0
  264. package/dist/components/custom/Graphics.cjs.map +1 -0
  265. package/dist/components/custom/Graphics.d.ts +50 -0
  266. package/dist/components/custom/Graphics.d.ts.map +1 -0
  267. package/dist/components/custom/Graphics.js +13 -0
  268. package/dist/components/custom/Graphics.js.map +1 -0
  269. package/dist/components/custom/NineSlice.cjs +13 -0
  270. package/dist/components/custom/NineSlice.cjs.map +1 -0
  271. package/dist/components/custom/NineSlice.d.ts +87 -0
  272. package/dist/components/custom/NineSlice.d.ts.map +1 -0
  273. package/dist/components/custom/NineSlice.js +13 -0
  274. package/dist/components/custom/NineSlice.js.map +1 -0
  275. package/dist/components/custom/Particles.cjs +8 -0
  276. package/dist/components/custom/Particles.cjs.map +1 -0
  277. package/dist/components/custom/Particles.d.ts +28 -0
  278. package/dist/components/custom/Particles.d.ts.map +1 -0
  279. package/dist/components/custom/Particles.js +8 -0
  280. package/dist/components/custom/Particles.js.map +1 -0
  281. package/dist/components/custom/RefOriginView.cjs +67 -0
  282. package/dist/components/custom/RefOriginView.cjs.map +1 -0
  283. package/dist/components/custom/RefOriginView.d.ts +49 -0
  284. package/dist/components/custom/RefOriginView.d.ts.map +1 -0
  285. package/dist/components/custom/RefOriginView.js +67 -0
  286. package/dist/components/custom/RefOriginView.js.map +1 -0
  287. package/dist/components/custom/Sprite.cjs +13 -0
  288. package/dist/components/custom/Sprite.cjs.map +1 -0
  289. package/dist/components/custom/Sprite.d.ts +79 -0
  290. package/dist/components/custom/Sprite.d.ts.map +1 -0
  291. package/dist/components/custom/Sprite.js +13 -0
  292. package/dist/components/custom/Sprite.js.map +1 -0
  293. package/dist/components/custom/TileSprite.cjs +13 -0
  294. package/dist/components/custom/TileSprite.cjs.map +1 -0
  295. package/dist/components/custom/TileSprite.d.ts +65 -0
  296. package/dist/components/custom/TileSprite.d.ts.map +1 -0
  297. package/dist/components/custom/TileSprite.js +13 -0
  298. package/dist/components/custom/TileSprite.js.map +1 -0
  299. package/dist/components/custom/index.d.ts +15 -0
  300. package/dist/components/custom/index.d.ts.map +1 -0
  301. package/dist/components/index.cjs +33 -0
  302. package/dist/components/index.cjs.map +1 -0
  303. package/dist/components/index.d.ts +11 -0
  304. package/dist/components/index.d.ts.map +1 -0
  305. package/dist/components/index.js +33 -0
  306. package/dist/components/index.js.map +1 -0
  307. package/dist/components/internal/SceneWrapper.cjs +10 -0
  308. package/dist/components/internal/SceneWrapper.cjs.map +1 -0
  309. package/dist/components/internal/SceneWrapper.d.ts +20 -0
  310. package/dist/components/internal/SceneWrapper.d.ts.map +1 -0
  311. package/dist/components/internal/SceneWrapper.js +10 -0
  312. package/dist/components/internal/SceneWrapper.js.map +1 -0
  313. package/dist/components/primitives/graphics.cjs +29 -0
  314. package/dist/components/primitives/graphics.cjs.map +1 -0
  315. package/dist/components/primitives/graphics.d.ts +146 -0
  316. package/dist/components/primitives/graphics.d.ts.map +1 -0
  317. package/dist/components/primitives/graphics.js +29 -0
  318. package/dist/components/primitives/graphics.js.map +1 -0
  319. package/dist/components/primitives/image.cjs +110 -0
  320. package/dist/components/primitives/image.cjs.map +1 -0
  321. package/dist/components/primitives/image.d.ts +170 -0
  322. package/dist/components/primitives/image.d.ts.map +1 -0
  323. package/dist/components/primitives/image.js +110 -0
  324. package/dist/components/primitives/image.js.map +1 -0
  325. package/dist/components/primitives/nineslice.cjs +42 -0
  326. package/dist/components/primitives/nineslice.cjs.map +1 -0
  327. package/dist/components/primitives/nineslice.d.ts +271 -0
  328. package/dist/components/primitives/nineslice.d.ts.map +1 -0
  329. package/dist/components/primitives/nineslice.js +42 -0
  330. package/dist/components/primitives/nineslice.js.map +1 -0
  331. package/dist/components/primitives/particles.cjs +77 -0
  332. package/dist/components/primitives/particles.cjs.map +1 -0
  333. package/dist/components/primitives/particles.d.ts +47 -0
  334. package/dist/components/primitives/particles.d.ts.map +1 -0
  335. package/dist/components/primitives/particles.js +77 -0
  336. package/dist/components/primitives/particles.js.map +1 -0
  337. package/dist/components/primitives/sprite.cjs +100 -0
  338. package/dist/components/primitives/sprite.cjs.map +1 -0
  339. package/dist/components/primitives/sprite.d.ts +147 -0
  340. package/dist/components/primitives/sprite.d.ts.map +1 -0
  341. package/dist/components/primitives/sprite.js +100 -0
  342. package/dist/components/primitives/sprite.js.map +1 -0
  343. package/dist/components/primitives/text.cjs +73 -0
  344. package/dist/components/primitives/text.cjs.map +1 -0
  345. package/dist/components/primitives/text.d.ts +155 -0
  346. package/dist/components/primitives/text.d.ts.map +1 -0
  347. package/dist/components/primitives/text.js +73 -0
  348. package/dist/components/primitives/text.js.map +1 -0
  349. package/dist/components/primitives/tilesprite.cjs +77 -0
  350. package/dist/components/primitives/tilesprite.cjs.map +1 -0
  351. package/dist/components/primitives/tilesprite.d.ts +157 -0
  352. package/dist/components/primitives/tilesprite.d.ts.map +1 -0
  353. package/dist/components/primitives/tilesprite.js +77 -0
  354. package/dist/components/primitives/tilesprite.js.map +1 -0
  355. package/dist/components/primitives/vectorDraw.cjs +73 -0
  356. package/dist/components/primitives/vectorDraw.cjs.map +1 -0
  357. package/dist/components/primitives/vectorDraw.d.ts +4 -0
  358. package/dist/components/primitives/vectorDraw.d.ts.map +1 -0
  359. package/dist/components/primitives/vectorDraw.js +73 -0
  360. package/dist/components/primitives/vectorDraw.js.map +1 -0
  361. package/dist/components/primitives/view.cjs +105 -0
  362. package/dist/components/primitives/view.cjs.map +1 -0
  363. package/dist/components/primitives/view.d.ts +23 -0
  364. package/dist/components/primitives/view.d.ts.map +1 -0
  365. package/dist/components/primitives/view.js +105 -0
  366. package/dist/components/primitives/view.js.map +1 -0
  367. package/dist/core-props.d.ts +105 -0
  368. package/dist/core-props.d.ts.map +1 -0
  369. package/dist/core-types.d.ts +71 -0
  370. package/dist/core-types.d.ts.map +1 -0
  371. package/dist/design-tokens/resolve-theme-tokens.cjs +27 -0
  372. package/dist/design-tokens/resolve-theme-tokens.cjs.map +1 -0
  373. package/dist/design-tokens/resolve-theme-tokens.d.ts +9 -0
  374. package/dist/design-tokens/resolve-theme-tokens.d.ts.map +1 -0
  375. package/dist/design-tokens/resolve-theme-tokens.js +27 -0
  376. package/dist/design-tokens/resolve-theme-tokens.js.map +1 -0
  377. package/dist/design-tokens/use-theme-tokens.cjs +26 -0
  378. package/dist/design-tokens/use-theme-tokens.cjs.map +1 -0
  379. package/dist/design-tokens/use-theme-tokens.d.ts +28 -0
  380. package/dist/design-tokens/use-theme-tokens.d.ts.map +1 -0
  381. package/dist/design-tokens/use-theme-tokens.js +26 -0
  382. package/dist/design-tokens/use-theme-tokens.js.map +1 -0
  383. package/dist/effects/index.d.ts +2 -0
  384. package/dist/effects/index.d.ts.map +1 -0
  385. package/dist/effects/phaser-effects-bridge.cjs +48 -0
  386. package/dist/effects/phaser-effects-bridge.cjs.map +1 -0
  387. package/dist/effects/phaser-effects-bridge.d.ts +2 -0
  388. package/dist/effects/phaser-effects-bridge.d.ts.map +1 -0
  389. package/dist/effects/phaser-effects-bridge.js +30 -0
  390. package/dist/effects/phaser-effects-bridge.js.map +1 -0
  391. package/dist/effects/use-effect.cjs +155 -0
  392. package/dist/effects/use-effect.cjs.map +1 -0
  393. package/dist/effects/use-effect.d.ts +30 -0
  394. package/dist/effects/use-effect.d.ts.map +1 -0
  395. package/dist/effects/use-effect.js +155 -0
  396. package/dist/effects/use-effect.js.map +1 -0
  397. package/dist/fx/convenience-hooks/index.d.ts +7 -0
  398. package/dist/fx/convenience-hooks/index.d.ts.map +1 -0
  399. package/dist/fx/convenience-hooks/use-blur.cjs +18 -0
  400. package/dist/fx/convenience-hooks/use-blur.cjs.map +1 -0
  401. package/dist/fx/convenience-hooks/use-blur.d.ts +21 -0
  402. package/dist/fx/convenience-hooks/use-blur.d.ts.map +1 -0
  403. package/dist/fx/convenience-hooks/use-blur.js +18 -0
  404. package/dist/fx/convenience-hooks/use-blur.js.map +1 -0
  405. package/dist/fx/convenience-hooks/use-glow.cjs +18 -0
  406. package/dist/fx/convenience-hooks/use-glow.cjs.map +1 -0
  407. package/dist/fx/convenience-hooks/use-glow.d.ts +21 -0
  408. package/dist/fx/convenience-hooks/use-glow.d.ts.map +1 -0
  409. package/dist/fx/convenience-hooks/use-glow.js +18 -0
  410. package/dist/fx/convenience-hooks/use-glow.js.map +1 -0
  411. package/dist/fx/convenience-hooks/use-shadow.cjs +18 -0
  412. package/dist/fx/convenience-hooks/use-shadow.cjs.map +1 -0
  413. package/dist/fx/convenience-hooks/use-shadow.d.ts +21 -0
  414. package/dist/fx/convenience-hooks/use-shadow.d.ts.map +1 -0
  415. package/dist/fx/convenience-hooks/use-shadow.js +18 -0
  416. package/dist/fx/convenience-hooks/use-shadow.js.map +1 -0
  417. package/dist/fx/fx-creators/blur.cjs +20 -0
  418. package/dist/fx/fx-creators/blur.cjs.map +1 -0
  419. package/dist/fx/fx-creators/blur.d.ts +37 -0
  420. package/dist/fx/fx-creators/blur.d.ts.map +1 -0
  421. package/dist/fx/fx-creators/blur.js +20 -0
  422. package/dist/fx/fx-creators/blur.js.map +1 -0
  423. package/dist/fx/fx-creators/color-matrix.cjs +47 -0
  424. package/dist/fx/fx-creators/color-matrix.cjs.map +1 -0
  425. package/dist/fx/fx-creators/color-matrix.d.ts +31 -0
  426. package/dist/fx/fx-creators/color-matrix.d.ts.map +1 -0
  427. package/dist/fx/fx-creators/color-matrix.js +47 -0
  428. package/dist/fx/fx-creators/color-matrix.js.map +1 -0
  429. package/dist/fx/fx-creators/glow.cjs +27 -0
  430. package/dist/fx/fx-creators/glow.cjs.map +1 -0
  431. package/dist/fx/fx-creators/glow.d.ts +36 -0
  432. package/dist/fx/fx-creators/glow.d.ts.map +1 -0
  433. package/dist/fx/fx-creators/glow.js +27 -0
  434. package/dist/fx/fx-creators/glow.js.map +1 -0
  435. package/dist/fx/fx-creators/index.d.ts +10 -0
  436. package/dist/fx/fx-creators/index.d.ts.map +1 -0
  437. package/dist/fx/fx-creators/pixelate.cjs +20 -0
  438. package/dist/fx/fx-creators/pixelate.cjs.map +1 -0
  439. package/dist/fx/fx-creators/pixelate.d.ts +24 -0
  440. package/dist/fx/fx-creators/pixelate.d.ts.map +1 -0
  441. package/dist/fx/fx-creators/pixelate.js +20 -0
  442. package/dist/fx/fx-creators/pixelate.js.map +1 -0
  443. package/dist/fx/fx-creators/shadow.cjs +28 -0
  444. package/dist/fx/fx-creators/shadow.cjs.map +1 -0
  445. package/dist/fx/fx-creators/shadow.d.ts +43 -0
  446. package/dist/fx/fx-creators/shadow.d.ts.map +1 -0
  447. package/dist/fx/fx-creators/shadow.js +28 -0
  448. package/dist/fx/fx-creators/shadow.js.map +1 -0
  449. package/dist/fx/fx-creators/vignette.cjs +20 -0
  450. package/dist/fx/fx-creators/vignette.cjs.map +1 -0
  451. package/dist/fx/fx-creators/vignette.d.ts +33 -0
  452. package/dist/fx/fx-creators/vignette.d.ts.map +1 -0
  453. package/dist/fx/fx-creators/vignette.js +20 -0
  454. package/dist/fx/fx-creators/vignette.js.map +1 -0
  455. package/dist/fx/fx-registry.cjs +43 -0
  456. package/dist/fx/fx-registry.cjs.map +1 -0
  457. package/dist/fx/fx-registry.d.ts +59 -0
  458. package/dist/fx/fx-registry.d.ts.map +1 -0
  459. package/dist/fx/fx-registry.js +43 -0
  460. package/dist/fx/fx-registry.js.map +1 -0
  461. package/dist/fx/index.d.ts +51 -0
  462. package/dist/fx/index.d.ts.map +1 -0
  463. package/dist/fx/use-fx.cjs +54 -0
  464. package/dist/fx/use-fx.cjs.map +1 -0
  465. package/dist/fx/use-fx.d.ts +53 -0
  466. package/dist/fx/use-fx.d.ts.map +1 -0
  467. package/dist/fx/use-fx.js +54 -0
  468. package/dist/fx/use-fx.js.map +1 -0
  469. package/dist/gestures/gesture-manager.cjs +773 -0
  470. package/dist/gestures/gesture-manager.cjs.map +1 -0
  471. package/dist/gestures/gesture-manager.d.ts +158 -0
  472. package/dist/gestures/gesture-manager.d.ts.map +1 -0
  473. package/dist/gestures/gesture-manager.js +773 -0
  474. package/dist/gestures/gesture-manager.js.map +1 -0
  475. package/dist/gestures/gesture-types.cjs +9 -0
  476. package/dist/gestures/gesture-types.cjs.map +1 -0
  477. package/dist/gestures/gesture-types.d.ts +232 -0
  478. package/dist/gestures/gesture-types.d.ts.map +1 -0
  479. package/dist/gestures/gesture-types.js +9 -0
  480. package/dist/gestures/gesture-types.js.map +1 -0
  481. package/dist/hooks.cjs +193 -0
  482. package/dist/hooks.cjs.map +1 -0
  483. package/dist/hooks.d.ts +151 -0
  484. package/dist/hooks.d.ts.map +1 -0
  485. package/dist/hooks.js +146 -0
  486. package/dist/hooks.js.map +1 -0
  487. package/dist/host.cjs +85 -0
  488. package/dist/host.cjs.map +1 -0
  489. package/dist/host.d.ts +78 -0
  490. package/dist/host.d.ts.map +1 -0
  491. package/dist/host.js +85 -0
  492. package/dist/host.js.map +1 -0
  493. package/dist/index.cjs +614 -0
  494. package/dist/index.cjs.map +1 -0
  495. package/dist/index.d.ts +61 -0
  496. package/dist/index.d.ts.map +1 -0
  497. package/dist/index.js +273 -0
  498. package/dist/index.js.map +1 -0
  499. package/dist/jsx-dev-runtime.cjs +20 -0
  500. package/dist/jsx-dev-runtime.cjs.map +1 -0
  501. package/dist/jsx-dev-runtime.d.ts +8 -0
  502. package/dist/jsx-dev-runtime.d.ts.map +1 -0
  503. package/dist/jsx-dev-runtime.js +8 -0
  504. package/dist/jsx-dev-runtime.js.map +1 -0
  505. package/dist/jsx-runtime.cjs +16 -0
  506. package/dist/jsx-runtime.cjs.map +1 -0
  507. package/dist/jsx-runtime.d.ts +9 -0
  508. package/dist/jsx-runtime.d.ts.map +1 -0
  509. package/dist/jsx-runtime.js +7 -0
  510. package/dist/jsx-runtime.js.map +1 -0
  511. package/dist/jsx-types.d.ts +40 -0
  512. package/dist/jsx-types.d.ts.map +1 -0
  513. package/dist/layout/appliers/background-applier.cjs +40 -0
  514. package/dist/layout/appliers/background-applier.cjs.map +1 -0
  515. package/dist/layout/appliers/background-applier.d.ts +16 -0
  516. package/dist/layout/appliers/background-applier.d.ts.map +1 -0
  517. package/dist/layout/appliers/background-applier.js +40 -0
  518. package/dist/layout/appliers/background-applier.js.map +1 -0
  519. package/dist/layout/index.d.ts +5 -0
  520. package/dist/layout/index.d.ts.map +1 -0
  521. package/dist/layout/layout-engine-test-utils.d.ts +24 -0
  522. package/dist/layout/layout-engine-test-utils.d.ts.map +1 -0
  523. package/dist/layout/phaser-layout-bridge.cjs +41 -0
  524. package/dist/layout/phaser-layout-bridge.cjs.map +1 -0
  525. package/dist/layout/phaser-layout-bridge.d.ts +9 -0
  526. package/dist/layout/phaser-layout-bridge.d.ts.map +1 -0
  527. package/dist/layout/phaser-layout-bridge.js +40 -0
  528. package/dist/layout/phaser-layout-bridge.js.map +1 -0
  529. package/dist/layout/types.d.ts +14 -0
  530. package/dist/layout/types.d.ts.map +1 -0
  531. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.cjs +39 -0
  532. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.cjs.map +1 -0
  533. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +39 -0
  534. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +1 -0
  535. package/dist/particles/emit-zone.cjs +205 -0
  536. package/dist/particles/emit-zone.cjs.map +1 -0
  537. package/dist/particles/emit-zone.d.ts +88 -0
  538. package/dist/particles/emit-zone.d.ts.map +1 -0
  539. package/dist/particles/emit-zone.js +205 -0
  540. package/dist/particles/emit-zone.js.map +1 -0
  541. package/dist/particles/index.d.ts +8 -0
  542. package/dist/particles/index.d.ts.map +1 -0
  543. package/dist/particles/particle-types.d.ts +25 -0
  544. package/dist/particles/particle-types.d.ts.map +1 -0
  545. package/dist/particles/preset-registry.cjs +57 -0
  546. package/dist/particles/preset-registry.cjs.map +1 -0
  547. package/dist/particles/preset-registry.d.ts +49 -0
  548. package/dist/particles/preset-registry.d.ts.map +1 -0
  549. package/dist/particles/preset-registry.js +57 -0
  550. package/dist/particles/preset-registry.js.map +1 -0
  551. package/dist/particles/use-particles.cjs +67 -0
  552. package/dist/particles/use-particles.cjs.map +1 -0
  553. package/dist/particles/use-particles.d.ts +19 -0
  554. package/dist/particles/use-particles.d.ts.map +1 -0
  555. package/dist/particles/use-particles.js +67 -0
  556. package/dist/particles/use-particles.js.map +1 -0
  557. package/dist/particles/utils.cjs +82 -0
  558. package/dist/particles/utils.cjs.map +1 -0
  559. package/dist/particles/utils.d.ts +10 -0
  560. package/dist/particles/utils.d.ts.map +1 -0
  561. package/dist/particles/utils.js +82 -0
  562. package/dist/particles/utils.js.map +1 -0
  563. package/dist/phaser-bridges.cjs +148 -0
  564. package/dist/phaser-bridges.cjs.map +1 -0
  565. package/dist/phaser-bridges.d.ts +78 -0
  566. package/dist/phaser-bridges.d.ts.map +1 -0
  567. package/dist/phaser-bridges.js +131 -0
  568. package/dist/phaser-bridges.js.map +1 -0
  569. package/dist/phaser-host-adapter.cjs +148 -0
  570. package/dist/phaser-host-adapter.cjs.map +1 -0
  571. package/dist/phaser-host-adapter.d.ts +30 -0
  572. package/dist/phaser-host-adapter.d.ts.map +1 -0
  573. package/dist/phaser-host-adapter.js +148 -0
  574. package/dist/phaser-host-adapter.js.map +1 -0
  575. package/dist/phaser-runtime-types.d.ts +89 -0
  576. package/dist/phaser-runtime-types.d.ts.map +1 -0
  577. package/dist/phaser-surface-adapter.cjs +488 -0
  578. package/dist/phaser-surface-adapter.cjs.map +1 -0
  579. package/dist/phaser-surface-adapter.d.ts +74 -0
  580. package/dist/phaser-surface-adapter.d.ts.map +1 -0
  581. package/dist/phaser-surface-adapter.js +471 -0
  582. package/dist/phaser-surface-adapter.js.map +1 -0
  583. package/dist/phaser-vdom-runtime.cjs +63 -0
  584. package/dist/phaser-vdom-runtime.cjs.map +1 -0
  585. package/dist/phaser-vdom-runtime.d.ts +2 -0
  586. package/dist/phaser-vdom-runtime.d.ts.map +1 -0
  587. package/dist/phaser-vdom-runtime.js +63 -0
  588. package/dist/phaser-vdom-runtime.js.map +1 -0
  589. package/dist/plugin.cjs +182 -0
  590. package/dist/plugin.cjs.map +1 -0
  591. package/dist/plugin.d.ts +161 -0
  592. package/dist/plugin.d.ts.map +1 -0
  593. package/dist/plugin.js +165 -0
  594. package/dist/plugin.js.map +1 -0
  595. package/dist/render-context.cjs +106 -0
  596. package/dist/render-context.cjs.map +1 -0
  597. package/dist/render-context.d.ts +66 -0
  598. package/dist/render-context.d.ts.map +1 -0
  599. package/dist/render-context.js +106 -0
  600. package/dist/render-context.js.map +1 -0
  601. package/dist/scene-backgrounds.cjs +285 -0
  602. package/dist/scene-backgrounds.cjs.map +1 -0
  603. package/dist/scene-backgrounds.d.ts +69 -0
  604. package/dist/scene-backgrounds.d.ts.map +1 -0
  605. package/dist/scene-backgrounds.js +268 -0
  606. package/dist/scene-backgrounds.js.map +1 -0
  607. package/dist/theme-base.d.ts +133 -0
  608. package/dist/theme-base.d.ts.map +1 -0
  609. package/dist/theme-custom.d.ts +13 -0
  610. package/dist/theme-custom.d.ts.map +1 -0
  611. package/dist/theme-defaults.cjs +29 -0
  612. package/dist/theme-defaults.cjs.map +1 -0
  613. package/dist/theme-defaults.d.ts +1 -0
  614. package/dist/theme-defaults.d.ts.map +1 -0
  615. package/dist/theme-defaults.js +28 -0
  616. package/dist/theme-defaults.js.map +1 -0
  617. package/dist/theme.cjs +34 -0
  618. package/dist/theme.cjs.map +1 -0
  619. package/dist/theme.d.ts +36 -0
  620. package/dist/theme.d.ts.map +1 -0
  621. package/dist/theme.js +32 -0
  622. package/dist/theme.js.map +1 -0
  623. package/dist/tooltip/tooltip-types.d.ts +6 -0
  624. package/dist/tooltip/tooltip-types.d.ts.map +1 -0
  625. package/dist/types.d.ts +22 -0
  626. package/dist/types.d.ts.map +1 -0
  627. package/dist/utils/KeyboardInputManager.cjs +112 -0
  628. package/dist/utils/KeyboardInputManager.cjs.map +1 -0
  629. package/dist/utils/KeyboardInputManager.d.ts +48 -0
  630. package/dist/utils/KeyboardInputManager.d.ts.map +1 -0
  631. package/dist/utils/KeyboardInputManager.js +112 -0
  632. package/dist/utils/KeyboardInputManager.js.map +1 -0
  633. package/dist/utils/dom-input-manager.cjs +253 -0
  634. package/dist/utils/dom-input-manager.cjs.map +1 -0
  635. package/dist/utils/dom-input-manager.d.ts +113 -0
  636. package/dist/utils/dom-input-manager.d.ts.map +1 -0
  637. package/dist/utils/dom-input-manager.js +253 -0
  638. package/dist/utils/dom-input-manager.js.map +1 -0
  639. package/dist/utils/fast-deep-equal.cjs +7 -0
  640. package/dist/utils/fast-deep-equal.cjs.map +1 -0
  641. package/dist/utils/fast-deep-equal.d.ts +4 -0
  642. package/dist/utils/fast-deep-equal.d.ts.map +1 -0
  643. package/dist/utils/fast-deep-equal.js +7 -0
  644. package/dist/utils/fast-deep-equal.js.map +1 -0
  645. package/dist/utils/image-subtexture-registry.cjs +98 -0
  646. package/dist/utils/image-subtexture-registry.cjs.map +1 -0
  647. package/dist/utils/image-subtexture-registry.d.ts +17 -0
  648. package/dist/utils/image-subtexture-registry.d.ts.map +1 -0
  649. package/dist/utils/image-subtexture-registry.js +98 -0
  650. package/dist/utils/image-subtexture-registry.js.map +1 -0
  651. package/dist/utils/phaser-guards.cjs +15 -0
  652. package/dist/utils/phaser-guards.cjs.map +1 -0
  653. package/dist/utils/phaser-guards.d.ts +7 -0
  654. package/dist/utils/phaser-guards.d.ts.map +1 -0
  655. package/dist/utils/phaser-guards.js +15 -0
  656. package/dist/utils/phaser-guards.js.map +1 -0
  657. package/dist/utils/svg-texture.cjs +48 -0
  658. package/dist/utils/svg-texture.cjs.map +1 -0
  659. package/dist/utils/svg-texture.d.ts +34 -0
  660. package/dist/utils/svg-texture.d.ts.map +1 -0
  661. package/dist/utils/svg-texture.js +48 -0
  662. package/dist/utils/svg-texture.js.map +1 -0
  663. package/dist/utils/texture-registry.cjs +117 -0
  664. package/dist/utils/texture-registry.cjs.map +1 -0
  665. package/dist/utils/texture-registry.d.ts +53 -0
  666. package/dist/utils/texture-registry.d.ts.map +1 -0
  667. package/dist/utils/texture-registry.js +117 -0
  668. package/dist/utils/texture-registry.js.map +1 -0
  669. package/dist/vdom-host-types.d.ts +12 -0
  670. package/dist/vdom-host-types.d.ts.map +1 -0
  671. package/dist/vdom-registry.d.ts +27 -0
  672. package/dist/vdom-registry.d.ts.map +1 -0
  673. package/dist/vdom-utils.d.ts +16 -0
  674. package/dist/vdom-utils.d.ts.map +1 -0
  675. package/dist/vdom.cjs +36 -0
  676. package/dist/vdom.cjs.map +1 -0
  677. package/dist/vdom.d.ts +23 -0
  678. package/dist/vdom.d.ts.map +1 -0
  679. package/dist/vdom.js +36 -0
  680. package/dist/vdom.js.map +1 -0
  681. package/dist/vector/PhaserVectorDrawContext.cjs +97 -0
  682. package/dist/vector/PhaserVectorDrawContext.cjs.map +1 -0
  683. package/dist/vector/PhaserVectorDrawContext.d.ts +27 -0
  684. package/dist/vector/PhaserVectorDrawContext.d.ts.map +1 -0
  685. package/dist/vector/PhaserVectorDrawContext.js +97 -0
  686. package/dist/vector/PhaserVectorDrawContext.js.map +1 -0
  687. package/dist/vector/index.d.ts +2 -0
  688. package/dist/vector/index.d.ts.map +1 -0
  689. package/package.json +96 -0
@@ -0,0 +1,170 @@
1
+ import { LayoutProps, PhaserProps, TransformProps } from '../../core-props';
2
+ import { HostCreator, HostPatcher } from '../../host';
3
+ import { PropsDefaultExtension } from '../../types';
4
+ /**
5
+ * Image component - Phaser Image GameObject (static texture)
6
+ * Status: IMPLEMENTED ✅
7
+ *
8
+ * Design Overview:
9
+ * ================
10
+ *
11
+ * 1. Component Role: TEXTURE RENDERING
12
+ * Purpose: Display static textures in UI layouts (icons, avatars, illustrations)
13
+ * Phaser Type: Phaser.GameObjects.Image (texture-based rendering)
14
+ * Characteristics:
15
+ * - Layout-aware by default (participates in parent layout)
16
+ * - Auto-sizing based on texture dimensions (like HTML <img>)
17
+ * - Supports Phaser texture system (atlases, frames)
18
+ *
19
+ * 2. Headless Default: FALSE ✅
20
+ * Decision: Image participates in layout by default
21
+ * Reasoning:
22
+ * - Images are UI elements (icons, avatars, illustrations)
23
+ * - Should affect parent container dimensions
24
+ * - Similar to Text component behavior
25
+ * Use Cases:
26
+ * - ✅ Layout-aware (default): Icons, avatars, logos, UI illustrations
27
+ * - ❌ Headless (optional): Decorative backgrounds, overlays, parallax layers
28
+ * Usage:
29
+ * <Image texture="icon" /> // Layout-aware
30
+ * <Image texture="bg" headless={true} /> // Decorative (no layout impact)
31
+ *
32
+ * 3. Layout Size Provider: DISPLAY DIMENSIONS ✅
33
+ * Implementation: Uses image.displayWidth and image.displayHeight
34
+ * Behavior:
35
+ * - Returns scaled display dimensions
36
+ * - Rotation is IGNORED for layout-aware images (headless=false)
37
+ * - Rotation only works with headless=true (no layout impact)
38
+ * Reasoning:
39
+ * - Flow layout is incompatible with rotation (causes positioning issues)
40
+ * - Rotated images would overlap siblings in flow layout
41
+ * - Matches Text component behavior
42
+ * Example:
43
+ * <Image texture="icon" /> // ✅ Layout size: 64x64
44
+ * <Image texture="icon" rotation={Math.PI/4} /> // ⚠️ Rotation IGNORED, size: 64x64
45
+ * <Image texture="icon" rotation={Math.PI/4} headless={true} /> // ✅ Rotated, no layout
46
+ * Recommendation: Use rotation only with headless=true or absolute positioning
47
+ *
48
+ * 4. Sizing Strategy: HYBRID APPROACH ✅
49
+ * Auto-Size (default):
50
+ * - No displayWidth/displayHeight → Use texture dimensions
51
+ * - Like HTML <img> natural size
52
+ * Explicit Size:
53
+ * - displayWidth + displayHeight → Scale to fit
54
+ * - fit prop controls aspect ratio handling
55
+ * Example:
56
+ * <Image texture="icon" /> // Auto-size
57
+ * <Image texture="icon" displayWidth={64} displayHeight={64} fit="contain" />
58
+ *
59
+ * 5. Fit Modes: CSS-LIKE BEHAVIOR ✅
60
+ * Decision: Implement CSS object-fit equivalent
61
+ * Modes:
62
+ * - 'fill' (default): Stretch to fill bounds (may distort aspect ratio)
63
+ * - 'contain': Scale to fit within bounds, preserve aspect ratio (letterbox)
64
+ * - 'cover': Scale to cover bounds, preserve aspect ratio (crop)
65
+ * Implementation: Calculate scale in applier based on fit mode
66
+ *
67
+ * 6. Origin Behavior: HEADLESS-AWARE ✅
68
+ * Current: Like Text component
69
+ * - Layout-aware (headless=false): Origin (0, 0) - top-left, UI-friendly
70
+ * - Headless (headless=true): Origin (0.5, 0.5) - centered, game object semantics
71
+ * Reasoning:
72
+ * - UI elements align naturally with top-left origin
73
+ * - Game objects (headless) work better centered
74
+ * - Consistent with Text component behavior
75
+ *
76
+ * 7. Rotation Behavior: LIKE TEXT ✅
77
+ * Decision: Rotation only supported with headless=true
78
+ * Reasoning:
79
+ * - Flow layout is incompatible with rotation
80
+ * - Matches Text component constraints
81
+ * - Props normalized: rotation removed if headless=false
82
+ *
83
+ * 8. Common Patterns:
84
+ * Icon:
85
+ * <View direction="row" gap={10}>
86
+ * <Image texture="icon-user" />
87
+ * <Text text="Username" />
88
+ * </View>
89
+ * Avatar:
90
+ * <Image texture="avatar" displayWidth={64} displayHeight={64} fit="cover" />
91
+ * Background (headless):
92
+ * <Image texture="bg" headless={true} alpha={0.5} />
93
+ *
94
+ * 9. Performance Considerations:
95
+ * - Texture atlases recommended (reduce texture switches)
96
+ * - Static images are efficient (single draw call)
97
+ * - Texture changes trigger re-render
98
+ * - Scaling via displayWidth/displayHeight is GPU-accelerated
99
+ *
100
+ * 10. Known Limitations:
101
+ * - Rotation only supported with headless=true (ignored for layout-aware)
102
+ * - Missing textures show Phaser default (white square)
103
+ * - No built-in loading states
104
+ * - Texture must be preloaded before use
105
+ *
106
+ * Implementation Status:
107
+ * ======================
108
+ * [✅] Phaser Image creation with texture/frame support
109
+ * [✅] Transform props (position, scale, alpha)
110
+ * [✅] Layout system integration (__layoutProps, __getLayoutSize)
111
+ * [✅] Origin handling (headless-aware: 0,0 vs 0.5,0.5)
112
+ * [✅] Display size with fit modes (contain/cover/fill)
113
+ * [✅] Tint support
114
+ * [✅] Texture and frame patching
115
+ * [⚠️] Rotation - Only with headless=true (ignored for layout-aware)
116
+ */
117
+ import type * as Phaser from 'phaser';
118
+ /**
119
+ * Base props for Image component
120
+ */
121
+ export interface ImageBaseProps extends TransformProps, PhaserProps, LayoutProps {
122
+ /** Texture key (loaded via Phaser's texture manager) */
123
+ texture: string;
124
+ /** Optional frame from texture atlas */
125
+ frame?: string | number;
126
+ /** Tint color applied to image (0xRRGGBB) */
127
+ tint?: number | undefined;
128
+ /** Display width (scales image to fit) */
129
+ displayWidth?: number | undefined;
130
+ /** Display height (scales image to fit) */
131
+ displayHeight?: number | undefined;
132
+ /**
133
+ * How image should fit within bounds (if displayWidth/displayHeight set)
134
+ * - 'fill': Stretch to fill (default, may distort aspect ratio)
135
+ * - 'contain': Scale to fit within bounds, preserve aspect ratio
136
+ * - 'cover': Scale to cover bounds, preserve aspect ratio (may crop)
137
+ */
138
+ fit?: 'fill' | 'contain' | 'cover';
139
+ /** Origin X (0-1, default 0.5) */
140
+ originX?: number;
141
+ /** Origin Y (0-1, default 0.5) */
142
+ originY?: number;
143
+ /**
144
+ * Optional explicit source region within the texture/frame.
145
+ * When set, the image renders only this sub-rectangle as a derived texture.
146
+ * Coordinates are relative to the frame origin (if frame is specified)
147
+ * or the texture origin otherwise.
148
+ */
149
+ sourceRect?: {
150
+ x: number;
151
+ y: number;
152
+ w: number;
153
+ h: number;
154
+ } | undefined;
155
+ }
156
+ /**
157
+ * Props for primitive image component (internal use only)
158
+ * For public API, use ImageProps from custom/Image.tsx
159
+ */
160
+ export interface ImagePrimitiveProps extends ImageBaseProps, PropsDefaultExtension<Phaser.GameObjects.Image> {
161
+ }
162
+ /**
163
+ * Image creator - creates a Phaser Image object
164
+ */
165
+ export declare const imageCreator: HostCreator<'Image'>;
166
+ /**
167
+ * Image patcher - updates Image properties
168
+ */
169
+ export declare const imagePatcher: HostPatcher<'Image'>;
170
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAiBxD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,cAAc,EAAE,WAAW,EAAE,WAAW;IAC9E,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAA;IAEf,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAEzB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAEjC,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAElC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IAElC,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;;OAKG;IACH,UAAU,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;CACxE;AAED;;;GAGG;AACH,MAAM,WAAW,mBACf,SAAQ,cAAc,EAAE,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC;CAAG;AAM5E;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,OAAO,CAwF7C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,OAAO,CA+C7C,CAAA"}
@@ -0,0 +1,110 @@
1
+ import { retainImageSubTexture, releaseImageSubTexture } from "../../utils/image-subtexture-registry.js";
2
+ import { applyImageProps, calculateImageFitScale, getImageSourceDimensions } from "../appliers/applyImage.js";
3
+ import { applyImageLayout } from "../appliers/applyImageLayout.js";
4
+ import { applyPhaserProps } from "../appliers/applyPhaser.js";
5
+ import { applyTransformProps } from "../appliers/applyTransform.js";
6
+ import { createImageLayout } from "../creators/createImageLayout.js";
7
+ import { createPhaser } from "../creators/createPhaser.js";
8
+ import { resolveAnimatableNumber, createTransform } from "../creators/createTransform.js";
9
+ const imageCreator = (scene, props) => {
10
+ const resolvedSource = retainImageSubTexture(scene, props.texture, props.frame, props.sourceRect);
11
+ const image = scene.add.image(
12
+ resolveAnimatableNumber(props.x) ?? 0,
13
+ resolveAnimatableNumber(props.y) ?? 0,
14
+ resolvedSource.texture,
15
+ resolvedSource.frame
16
+ );
17
+ image.__subTextureCacheKey = resolvedSource.cacheKey;
18
+ if (resolvedSource.cacheKey) {
19
+ image.once?.("destroy", () => {
20
+ releaseImageSubTexture(scene, image.__subTextureCacheKey);
21
+ image.__subTextureCacheKey = void 0;
22
+ });
23
+ }
24
+ if (props.headless) {
25
+ image.setOrigin(0.5, 0.5);
26
+ } else {
27
+ image.setOrigin(0, 0);
28
+ }
29
+ if (props.originX !== void 0 || props.originY !== void 0) {
30
+ image.setOrigin(props.originX ?? image.originX, props.originY ?? image.originY);
31
+ }
32
+ const normalizedProps = { ...props };
33
+ if (props.headless) {
34
+ delete normalizedProps.padding;
35
+ delete normalizedProps.margin;
36
+ delete normalizedProps.gap;
37
+ } else {
38
+ if (normalizedProps.rotation !== void 0) {
39
+ delete normalizedProps.rotation;
40
+ }
41
+ }
42
+ createTransform(image, normalizedProps);
43
+ createPhaser(image, normalizedProps);
44
+ if (props.tint !== void 0) {
45
+ image.setTint(props.tint);
46
+ }
47
+ if (props.displayWidth !== void 0 || props.displayHeight !== void 0) {
48
+ if (props.displayWidth !== void 0 && props.displayHeight !== void 0) {
49
+ const { scaleX, scaleY } = calculateImageFitScale(
50
+ image,
51
+ props.displayWidth,
52
+ props.displayHeight,
53
+ props.fit,
54
+ props.sourceRect
55
+ );
56
+ image.setScale(scaleX, scaleY);
57
+ } else if (props.displayWidth !== void 0) {
58
+ const { width } = getImageSourceDimensions(image, props.sourceRect);
59
+ const scale = width > 0 ? props.displayWidth / width : 1;
60
+ image.setScale(scale);
61
+ } else if (props.displayHeight !== void 0) {
62
+ const { height } = getImageSourceDimensions(image, props.sourceRect);
63
+ const scale = height > 0 ? props.displayHeight / height : 1;
64
+ image.setScale(scale);
65
+ }
66
+ }
67
+ createImageLayout(image, normalizedProps);
68
+ if (props.onReady) {
69
+ props.onReady(image);
70
+ }
71
+ return image;
72
+ };
73
+ const imagePatcher = (node, prev, next) => {
74
+ if (prev.headless !== next.headless) {
75
+ if (next.headless) {
76
+ node.setOrigin(0.5, 0.5);
77
+ } else {
78
+ node.setOrigin(0, 0);
79
+ }
80
+ }
81
+ const normalizedPrev = { ...prev };
82
+ const normalizedNext = { ...next };
83
+ if (next.headless) {
84
+ delete normalizedNext.padding;
85
+ delete normalizedNext.margin;
86
+ delete normalizedNext.gap;
87
+ } else {
88
+ if (normalizedNext.rotation !== void 0) {
89
+ delete normalizedNext.rotation;
90
+ }
91
+ }
92
+ if (prev.headless) {
93
+ delete normalizedPrev.padding;
94
+ delete normalizedPrev.margin;
95
+ delete normalizedPrev.gap;
96
+ } else {
97
+ if (normalizedPrev.rotation !== void 0) {
98
+ delete normalizedPrev.rotation;
99
+ }
100
+ }
101
+ applyTransformProps(node, normalizedPrev, normalizedNext);
102
+ applyPhaserProps(node, normalizedPrev, normalizedNext);
103
+ applyImageProps(node, normalizedPrev, normalizedNext);
104
+ applyImageLayout(node, normalizedPrev, normalizedNext);
105
+ };
106
+ export {
107
+ imageCreator,
108
+ imagePatcher
109
+ };
110
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.js","sources":["../../../src/components/primitives/image.ts"],"sourcesContent":["/**\n * Image component - Phaser Image GameObject (static texture)\n * Status: IMPLEMENTED ✅\n *\n * Design Overview:\n * ================\n *\n * 1. Component Role: TEXTURE RENDERING\n * Purpose: Display static textures in UI layouts (icons, avatars, illustrations)\n * Phaser Type: Phaser.GameObjects.Image (texture-based rendering)\n * Characteristics:\n * - Layout-aware by default (participates in parent layout)\n * - Auto-sizing based on texture dimensions (like HTML <img>)\n * - Supports Phaser texture system (atlases, frames)\n *\n * 2. Headless Default: FALSE ✅\n * Decision: Image participates in layout by default\n * Reasoning:\n * - Images are UI elements (icons, avatars, illustrations)\n * - Should affect parent container dimensions\n * - Similar to Text component behavior\n * Use Cases:\n * - ✅ Layout-aware (default): Icons, avatars, logos, UI illustrations\n * - ❌ Headless (optional): Decorative backgrounds, overlays, parallax layers\n * Usage:\n * <Image texture=\"icon\" /> // Layout-aware\n * <Image texture=\"bg\" headless={true} /> // Decorative (no layout impact)\n *\n * 3. Layout Size Provider: DISPLAY DIMENSIONS ✅\n * Implementation: Uses image.displayWidth and image.displayHeight\n * Behavior:\n * - Returns scaled display dimensions\n * - Rotation is IGNORED for layout-aware images (headless=false)\n * - Rotation only works with headless=true (no layout impact)\n * Reasoning:\n * - Flow layout is incompatible with rotation (causes positioning issues)\n * - Rotated images would overlap siblings in flow layout\n * - Matches Text component behavior\n * Example:\n * <Image texture=\"icon\" /> // ✅ Layout size: 64x64\n * <Image texture=\"icon\" rotation={Math.PI/4} /> // ⚠️ Rotation IGNORED, size: 64x64\n * <Image texture=\"icon\" rotation={Math.PI/4} headless={true} /> // ✅ Rotated, no layout\n * Recommendation: Use rotation only with headless=true or absolute positioning\n *\n * 4. Sizing Strategy: HYBRID APPROACH ✅\n * Auto-Size (default):\n * - No displayWidth/displayHeight → Use texture dimensions\n * - Like HTML <img> natural size\n * Explicit Size:\n * - displayWidth + displayHeight → Scale to fit\n * - fit prop controls aspect ratio handling\n * Example:\n * <Image texture=\"icon\" /> // Auto-size\n * <Image texture=\"icon\" displayWidth={64} displayHeight={64} fit=\"contain\" />\n *\n * 5. Fit Modes: CSS-LIKE BEHAVIOR ✅\n * Decision: Implement CSS object-fit equivalent\n * Modes:\n * - 'fill' (default): Stretch to fill bounds (may distort aspect ratio)\n * - 'contain': Scale to fit within bounds, preserve aspect ratio (letterbox)\n * - 'cover': Scale to cover bounds, preserve aspect ratio (crop)\n * Implementation: Calculate scale in applier based on fit mode\n *\n * 6. Origin Behavior: HEADLESS-AWARE ✅\n * Current: Like Text component\n * - Layout-aware (headless=false): Origin (0, 0) - top-left, UI-friendly\n * - Headless (headless=true): Origin (0.5, 0.5) - centered, game object semantics\n * Reasoning:\n * - UI elements align naturally with top-left origin\n * - Game objects (headless) work better centered\n * - Consistent with Text component behavior\n *\n * 7. Rotation Behavior: LIKE TEXT ✅\n * Decision: Rotation only supported with headless=true\n * Reasoning:\n * - Flow layout is incompatible with rotation\n * - Matches Text component constraints\n * - Props normalized: rotation removed if headless=false\n *\n * 8. Common Patterns:\n * Icon:\n * <View direction=\"row\" gap={10}>\n * <Image texture=\"icon-user\" />\n * <Text text=\"Username\" />\n * </View>\n * Avatar:\n * <Image texture=\"avatar\" displayWidth={64} displayHeight={64} fit=\"cover\" />\n * Background (headless):\n * <Image texture=\"bg\" headless={true} alpha={0.5} />\n *\n * 9. Performance Considerations:\n * - Texture atlases recommended (reduce texture switches)\n * - Static images are efficient (single draw call)\n * - Texture changes trigger re-render\n * - Scaling via displayWidth/displayHeight is GPU-accelerated\n *\n * 10. Known Limitations:\n * - Rotation only supported with headless=true (ignored for layout-aware)\n * - Missing textures show Phaser default (white square)\n * - No built-in loading states\n * - Texture must be preloaded before use\n *\n * Implementation Status:\n * ======================\n * [✅] Phaser Image creation with texture/frame support\n * [✅] Transform props (position, scale, alpha)\n * [✅] Layout system integration (__layoutProps, __getLayoutSize)\n * [✅] Origin handling (headless-aware: 0,0 vs 0.5,0.5)\n * [✅] Display size with fit modes (contain/cover/fill)\n * [✅] Tint support\n * [✅] Texture and frame patching\n * [⚠️] Rotation - Only with headless=true (ignored for layout-aware)\n */\nimport type * as Phaser from 'phaser'\nimport type { LayoutProps, PhaserProps, TransformProps } from '../../core-props'\nimport type { HostCreator, HostPatcher } from '../../host'\nimport type { PropsDefaultExtension } from '../../types'\nimport {\n releaseImageSubTexture,\n retainImageSubTexture,\n} from '../../utils/image-subtexture-registry'\nimport {\n applyImageProps,\n calculateImageFitScale,\n getImageSourceDimensions,\n} from '../appliers/applyImage'\nimport { applyImageLayout } from '../appliers/applyImageLayout'\nimport { applyPhaserProps } from '../appliers/applyPhaser'\nimport { applyTransformProps } from '../appliers/applyTransform'\nimport { createImageLayout } from '../creators/createImageLayout'\nimport { createPhaser } from '../creators/createPhaser'\nimport { createTransform, resolveAnimatableNumber } from '../creators/createTransform'\n\n/**\n * Base props for Image component\n */\nexport interface ImageBaseProps extends TransformProps, PhaserProps, LayoutProps {\n /** Texture key (loaded via Phaser's texture manager) */\n texture: string\n\n /** Optional frame from texture atlas */\n frame?: string | number\n\n /** Tint color applied to image (0xRRGGBB) */\n tint?: number | undefined\n\n /** Display width (scales image to fit) */\n displayWidth?: number | undefined\n\n /** Display height (scales image to fit) */\n displayHeight?: number | undefined\n\n /**\n * How image should fit within bounds (if displayWidth/displayHeight set)\n * - 'fill': Stretch to fill (default, may distort aspect ratio)\n * - 'contain': Scale to fit within bounds, preserve aspect ratio\n * - 'cover': Scale to cover bounds, preserve aspect ratio (may crop)\n */\n fit?: 'fill' | 'contain' | 'cover'\n\n /** Origin X (0-1, default 0.5) */\n originX?: number\n\n /** Origin Y (0-1, default 0.5) */\n originY?: number\n\n /**\n * Optional explicit source region within the texture/frame.\n * When set, the image renders only this sub-rectangle as a derived texture.\n * Coordinates are relative to the frame origin (if frame is specified)\n * or the texture origin otherwise.\n */\n sourceRect?: { x: number; y: number; w: number; h: number } | undefined\n}\n\n/**\n * Props for primitive image component (internal use only)\n * For public API, use ImageProps from custom/Image.tsx\n */\nexport interface ImagePrimitiveProps\n extends ImageBaseProps, PropsDefaultExtension<Phaser.GameObjects.Image> {}\n\ntype DerivedTextureImage = Phaser.GameObjects.Image & {\n __subTextureCacheKey?: string | undefined\n}\n\n/**\n * Image creator - creates a Phaser Image object\n */\nexport const imageCreator: HostCreator<'Image'> = (scene, props) => {\n const resolvedSource = retainImageSubTexture(scene, props.texture, props.frame, props.sourceRect)\n const image = scene.add.image(\n resolveAnimatableNumber(props.x) ?? 0,\n resolveAnimatableNumber(props.y) ?? 0,\n resolvedSource.texture,\n resolvedSource.frame\n ) as DerivedTextureImage\n image.__subTextureCacheKey = resolvedSource.cacheKey\n if (resolvedSource.cacheKey) {\n image.once?.('destroy', () => {\n releaseImageSubTexture(scene, image.__subTextureCacheKey)\n image.__subTextureCacheKey = undefined\n })\n }\n\n // Set origin based on headless flag\n // Headless: (0.5, 0.5) - centered, works naturally with rotation/scale\n // Layout-aware: (0, 0) - top-left, aligns with layout flow\n if (props.headless) {\n image.setOrigin(0.5, 0.5)\n } else {\n image.setOrigin(0, 0)\n }\n\n // Apply custom origin if specified\n if (props.originX !== undefined || props.originY !== undefined) {\n image.setOrigin(props.originX ?? image.originX, props.originY ?? image.originY)\n }\n\n // Normalize props for headless objects\n // Headless objects are positioned as points - no spacing or rotation constraints\n const normalizedProps = { ...props } as Record<string, unknown>\n if (props.headless) {\n // Remove spacing props (headless = positioned as point)\n delete normalizedProps.padding\n delete normalizedProps.margin\n delete normalizedProps.gap\n } else {\n // Remove rotation (only supported with headless=true)\n if (normalizedProps.rotation !== undefined) {\n delete normalizedProps.rotation\n }\n }\n\n // Apply transform props (scale, rotation if headless)\n createTransform(image, normalizedProps)\n\n // Apply Phaser display props (alpha, depth, visible)\n createPhaser(image, normalizedProps)\n\n // Apply image-specific props (tint, displaySize, fit)\n if (props.tint !== undefined) {\n image.setTint(props.tint)\n }\n\n // Apply displayWidth/displayHeight if specified\n // (now computed from cropped dimensions)\n if (props.displayWidth !== undefined || props.displayHeight !== undefined) {\n if (props.displayWidth !== undefined && props.displayHeight !== undefined) {\n const { scaleX, scaleY } = calculateImageFitScale(\n image,\n props.displayWidth,\n props.displayHeight,\n props.fit,\n props.sourceRect\n )\n image.setScale(scaleX, scaleY)\n } else if (props.displayWidth !== undefined) {\n const { width } = getImageSourceDimensions(image, props.sourceRect)\n const scale = width > 0 ? props.displayWidth / width : 1\n image.setScale(scale)\n } else if (props.displayHeight !== undefined) {\n const { height } = getImageSourceDimensions(image, props.sourceRect)\n const scale = height > 0 ? props.displayHeight / height : 1\n image.setScale(scale)\n }\n }\n\n // Setup layout system (props and size provider)\n createImageLayout(image, normalizedProps)\n\n // Call onReady callback if provided\n if (props.onReady) {\n props.onReady(image)\n }\n\n return image\n}\n\n/**\n * Image patcher - updates Image properties\n */\nexport const imagePatcher: HostPatcher<'Image'> = (node, prev, next) => {\n // Update origin if headless flag changed\n if (prev.headless !== next.headless) {\n if (next.headless) {\n node.setOrigin(0.5, 0.5) // Headless: centered\n } else {\n node.setOrigin(0, 0) // Layout-aware: top-left\n }\n }\n\n // Normalize props for headless objects\n const normalizedPrev = { ...prev } as Record<string, unknown>\n const normalizedNext = { ...next } as Record<string, unknown>\n\n if (next.headless) {\n // Remove spacing props (headless = positioned as point)\n delete normalizedNext.padding\n delete normalizedNext.margin\n delete normalizedNext.gap\n } else {\n // Remove rotation (only supported with headless=true)\n if (normalizedNext.rotation !== undefined) {\n delete normalizedNext.rotation\n }\n }\n\n if (prev.headless) {\n delete normalizedPrev.padding\n delete normalizedPrev.margin\n delete normalizedPrev.gap\n } else {\n if (normalizedPrev.rotation !== undefined) {\n delete normalizedPrev.rotation\n }\n }\n\n // Apply transform props (position, rotation only if headless, scale)\n applyTransformProps(node, normalizedPrev, normalizedNext)\n\n // Apply Phaser display props (alpha, depth, visible)\n applyPhaserProps(node, normalizedPrev, normalizedNext)\n\n // Apply image-specific props (texture, frame, tint, displaySize, fit)\n applyImageProps(node, normalizedPrev, normalizedNext)\n\n // Apply layout props and update size provider if needed\n applyImageLayout(node, normalizedPrev, normalizedNext)\n}\n"],"names":[],"mappings":";;;;;;;;AA6LO,MAAM,eAAqC,CAAC,OAAO,UAAU;AAClE,QAAM,iBAAiB,sBAAsB,OAAO,MAAM,SAAS,MAAM,OAAO,MAAM,UAAU;AAChG,QAAM,QAAQ,MAAM,IAAI;AAAA,IACtB,wBAAwB,MAAM,CAAC,KAAK;AAAA,IACpC,wBAAwB,MAAM,CAAC,KAAK;AAAA,IACpC,eAAe;AAAA,IACf,eAAe;AAAA,EAAA;AAEjB,QAAM,uBAAuB,eAAe;AAC5C,MAAI,eAAe,UAAU;AAC3B,UAAM,OAAO,WAAW,MAAM;AAC5B,6BAAuB,OAAO,MAAM,oBAAoB;AACxD,YAAM,uBAAuB;AAAA,IAC/B,CAAC;AAAA,EACH;AAKA,MAAI,MAAM,UAAU;AAClB,UAAM,UAAU,KAAK,GAAG;AAAA,EAC1B,OAAO;AACL,UAAM,UAAU,GAAG,CAAC;AAAA,EACtB;AAGA,MAAI,MAAM,YAAY,UAAa,MAAM,YAAY,QAAW;AAC9D,UAAM,UAAU,MAAM,WAAW,MAAM,SAAS,MAAM,WAAW,MAAM,OAAO;AAAA,EAChF;AAIA,QAAM,kBAAkB,EAAE,GAAG,MAAA;AAC7B,MAAI,MAAM,UAAU;AAElB,WAAO,gBAAgB;AACvB,WAAO,gBAAgB;AACvB,WAAO,gBAAgB;AAAA,EACzB,OAAO;AAEL,QAAI,gBAAgB,aAAa,QAAW;AAC1C,aAAO,gBAAgB;AAAA,IACzB;AAAA,EACF;AAGA,kBAAgB,OAAO,eAAe;AAGtC,eAAa,OAAO,eAAe;AAGnC,MAAI,MAAM,SAAS,QAAW;AAC5B,UAAM,QAAQ,MAAM,IAAI;AAAA,EAC1B;AAIA,MAAI,MAAM,iBAAiB,UAAa,MAAM,kBAAkB,QAAW;AACzE,QAAI,MAAM,iBAAiB,UAAa,MAAM,kBAAkB,QAAW;AACzE,YAAM,EAAE,QAAQ,OAAA,IAAW;AAAA,QACzB;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,MAAA;AAER,YAAM,SAAS,QAAQ,MAAM;AAAA,IAC/B,WAAW,MAAM,iBAAiB,QAAW;AAC3C,YAAM,EAAE,MAAA,IAAU,yBAAyB,OAAO,MAAM,UAAU;AAClE,YAAM,QAAQ,QAAQ,IAAI,MAAM,eAAe,QAAQ;AACvD,YAAM,SAAS,KAAK;AAAA,IACtB,WAAW,MAAM,kBAAkB,QAAW;AAC5C,YAAM,EAAE,OAAA,IAAW,yBAAyB,OAAO,MAAM,UAAU;AACnE,YAAM,QAAQ,SAAS,IAAI,MAAM,gBAAgB,SAAS;AAC1D,YAAM,SAAS,KAAK;AAAA,IACtB;AAAA,EACF;AAGA,oBAAkB,OAAO,eAAe;AAGxC,MAAI,MAAM,SAAS;AACjB,UAAM,QAAQ,KAAK;AAAA,EACrB;AAEA,SAAO;AACT;AAKO,MAAM,eAAqC,CAAC,MAAM,MAAM,SAAS;AAEtE,MAAI,KAAK,aAAa,KAAK,UAAU;AACnC,QAAI,KAAK,UAAU;AACjB,WAAK,UAAU,KAAK,GAAG;AAAA,IACzB,OAAO;AACL,WAAK,UAAU,GAAG,CAAC;AAAA,IACrB;AAAA,EACF;AAGA,QAAM,iBAAiB,EAAE,GAAG,KAAA;AAC5B,QAAM,iBAAiB,EAAE,GAAG,KAAA;AAE5B,MAAI,KAAK,UAAU;AAEjB,WAAO,eAAe;AACtB,WAAO,eAAe;AACtB,WAAO,eAAe;AAAA,EACxB,OAAO;AAEL,QAAI,eAAe,aAAa,QAAW;AACzC,aAAO,eAAe;AAAA,IACxB;AAAA,EACF;AAEA,MAAI,KAAK,UAAU;AACjB,WAAO,eAAe;AACtB,WAAO,eAAe;AACtB,WAAO,eAAe;AAAA,EACxB,OAAO;AACL,QAAI,eAAe,aAAa,QAAW;AACzC,aAAO,eAAe;AAAA,IACxB;AAAA,EACF;AAGA,sBAAoB,MAAM,gBAAgB,cAAc;AAGxD,mBAAiB,MAAM,gBAAgB,cAAc;AAGrD,kBAAgB,MAAM,gBAAgB,cAAc;AAGpD,mBAAiB,MAAM,gBAAgB,cAAc;AACvD;"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const applyNineSlice = require("../appliers/applyNineSlice.cjs");
4
+ const applyNineSliceLayout = require("../appliers/applyNineSliceLayout.cjs");
5
+ const applyPhaser = require("../appliers/applyPhaser.cjs");
6
+ const applyTransform = require("../appliers/applyTransform.cjs");
7
+ const createNineSliceLayout = require("../creators/createNineSliceLayout.cjs");
8
+ const createPhaser = require("../creators/createPhaser.cjs");
9
+ const createTransform = require("../creators/createTransform.cjs");
10
+ const nineSliceCreator = (scene, props) => {
11
+ const initialWidth = typeof props.width === "number" ? props.width : 64;
12
+ const initialHeight = typeof props.height === "number" ? props.height : 64;
13
+ const nineSlice = scene.add.nineslice(
14
+ createTransform.resolveAnimatableNumber(props.x) ?? 0,
15
+ createTransform.resolveAnimatableNumber(props.y) ?? 0,
16
+ props.texture,
17
+ props.frame,
18
+ initialWidth,
19
+ initialHeight,
20
+ props.leftWidth,
21
+ props.rightWidth,
22
+ props.topHeight,
23
+ props.bottomHeight
24
+ );
25
+ nineSlice.setOrigin(0, 0);
26
+ if (props.tint !== void 0) {
27
+ nineSlice.setTint(props.tint);
28
+ }
29
+ createTransform.createTransform(nineSlice, props);
30
+ createPhaser.createPhaser(nineSlice, props);
31
+ createNineSliceLayout.createNineSliceLayout(nineSlice, props);
32
+ return nineSlice;
33
+ };
34
+ const nineSlicePatcher = (node, prev, next) => {
35
+ applyTransform.applyTransformProps(node, prev, next);
36
+ applyPhaser.applyPhaserProps(node, prev, next);
37
+ applyNineSlice.applyNineSliceProps(node, prev, next);
38
+ applyNineSliceLayout.applyNineSliceLayout(node, prev, next);
39
+ };
40
+ exports.nineSliceCreator = nineSliceCreator;
41
+ exports.nineSlicePatcher = nineSlicePatcher;
42
+ //# sourceMappingURL=nineslice.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nineslice.cjs","sources":["../../../src/components/primitives/nineslice.ts"],"sourcesContent":["/**\n * NineSlice component - Phaser NineSlice GameObject for scalable UI panels\n * Status: IMPLEMENTED ✅\n *\n * Design Overview:\n * ================\n *\n * 1. Component Role: SCALABLE UI PANELS\n * Purpose: Create resizable UI elements that preserve border/corner integrity\n * Phaser Type: Phaser.GameObjects.NineSlice (9-slice scaling)\n * Use Cases:\n * - Buttons with fixed corner radius\n * - Dialog boxes with preserved borders\n * - Progress bars with capped ends\n * - Panels that scale without distorting decorative edges\n *\n * 2. Nine-Slice Scaling Concept:\n * Texture divided into 9 regions:\n * ┌─────┬─────────┬─────┐\n * │ TL │ Top │ TR │ (corners + edges)\n * ├─────┼─────────┼─────┤\n * │Left │ Center │Right│ (center scales, edges stretch)\n * ├─────┼─────────┼─────┤\n * │ BL │ Bottom │ BR │ (corners stay fixed)\n * └─────┴─────────┴─────┘\n * Behavior:\n * - Corners: Never scale (preserve pixel-perfect)\n * - Edges: Stretch along one axis (top/bottom: horizontal, left/right: vertical)\n * - Center: Scales in both directions\n * Benefit: UI elements scale to any size without visual distortion\n *\n * 3. Three-Slice Mode (Optional):\n * Feature: Omit topHeight/bottomHeight for horizontal-only slicing\n * Use Case: Horizontal buttons, progress bars\n * Layout:\n * ┌─────┬─────────────────┬─────┐\n * │Left │ Center │Right│\n * └─────┴─────────────────┴─────┘\n * Props: Only leftWidth + rightWidth required\n *\n * 4. Headless Default: FALSE ✅\n * Decision: NineSlice participates in layout by default\n * Reasoning:\n * - NineSlice is a UI element (buttons, panels, containers)\n * - Should affect parent container dimensions\n * - Similar to View component (container semantics)\n * Use Cases:\n * - ✅ Layout-aware (default): Buttons, panels, dialogs, cards\n * - ❌ Headless (optional): Background overlays, decorative frames\n * Usage:\n * <NineSlice texture=\"panel\" leftWidth={16} rightWidth={16} width={200} height={100} />\n * <NineSlice texture=\"frame\" headless={true} /> // Decorative\n *\n * 5. Layout Size Provider:\n * Implementation: Uses explicit width/height (required props)\n * Reasoning:\n * - NineSlice requires explicit dimensions (Phaser constructor param)\n * - No auto-sizing (unlike Text)\n * - Dimensions always known and stable\n * __getLayoutSize:\n * return { width: nineSlice.width, height: nineSlice.height }\n * Note: getBounds() not needed (no rotation typically applied)\n *\n * 6. Slice Configuration:\n * Required Props:\n * - texture: string (texture key)\n * - leftWidth: number (pixels)\n * - rightWidth: number (pixels)\n * - width: number (total width)\n * - height: number (total height)\n * Optional Props:\n * - topHeight: number (9-slice mode, default: 0 for 3-slice)\n * - bottomHeight: number (9-slice mode, default: 0 for 3-slice)\n * - frame: string | number (texture atlas frame)\n * Validation:\n * - Width must be >= leftWidth + rightWidth\n * - Height must be >= topHeight + bottomHeight\n * - Slice widths/heights define source texture regions\n *\n * 7. Inner Bounds Feature:\n * Purpose: Calculate content area excluding slices\n * Use Case: Position children inside panel borders\n * Calculation:\n * innerBounds = {\n * x: leftWidth,\n * y: topHeight,\n * width: totalWidth - leftWidth - rightWidth,\n * height: totalHeight - topHeight - bottomHeight\n * }\n * Access:\n * const ref = useRef<NineSliceRef>(null)\n * <NineSlice ref={ref} ... />\n * console.log(ref.current?.innerBounds) // { x, y, width, height }\n * Pattern: Useful for padding-aware content positioning\n *\n * 8. Ref Extension:\n * Feature: NineSliceRef provides slice metadata\n * Properties:\n * - node: Phaser.GameObjects.NineSlice (the GameObject)\n * - leftWidth, rightWidth, topHeight, bottomHeight: Slice dimensions\n * - innerBounds: Content area calculation\n * Usage:\n * const panelRef = useRef<NineSliceRef>(null)\n * // Access slice info for child positioning\n * const { innerBounds } = panelRef.current\n *\n * 9. Common Patterns:\n * Button:\n * <NineSlice\n * texture=\"button\"\n * leftWidth={16} rightWidth={16}\n * topHeight={16} bottomHeight={16}\n * width={200} height={60}\n * >\n * <Text text=\"Click Me\" />\n * </NineSlice>\n * Dialog Box:\n * <NineSlice\n * texture=\"panel\"\n * leftWidth={32} rightWidth={32}\n * topHeight={32} bottomHeight={32}\n * width={400} height={300}\n * >\n * <View padding={32}> {/* Padding matches slice sizes * }\n * <Text text=\"Dialog Content\" />\n * </View>\n * </NineSlice>\n * Progress Bar (3-slice):\n * <NineSlice\n * texture=\"progressbar\"\n * leftWidth={8} rightWidth={8}\n * width={progress * 200} height={20}\n * />\n *\n * 10. Performance Considerations:\n * - Efficient rendering (single draw call per NineSlice)\n * - Texture atlases recommended (reduce texture switches)\n * - Scaling performance: No geometry regeneration needed\n * - Slice configuration: Calculated once on creation\n * - Dynamic resizing: Efficiently handled by Phaser\n *\n * 11. Known Limitations:\n * - Requires pre-designed 9-slice texture\n * - Slice dimensions must match source texture layout exactly\n * - Rotation not recommended (distorts slice alignment)\n * - Can't animate slice dimensions (only width/height)\n * - No rounded corner support (must be in texture)\n *\n * Implementation Status:\n * ======================\n * [✅] Phaser NineSlice creation with slice configuration\n * [✅] Transform props (position, scale, alpha, depth)\n * [✅] Layout system integration (__layoutProps, __getLayoutSize)\n * [✅] Width/height as layout props (explicit sizing)\n * [✅] Three-slice mode support (optional topHeight/bottomHeight)\n * [✅] NineSliceRef with innerBounds calculation\n * [✅] Slice dimension validation\n * [✅] Theme system integration\n * [✅] Dynamic resizing support (width/height patching)\n */\nimport type * as Phaser from 'phaser'\nimport type { LayoutProps, PhaserProps, TransformProps } from '../../core-props'\nimport type { HostCreator, HostPatcher } from '../../host'\nimport type { PropsDefaultExtension } from '../../types'\nimport { applyNineSliceProps } from '../appliers/applyNineSlice'\nimport { applyNineSliceLayout } from '../appliers/applyNineSliceLayout'\nimport { applyPhaserProps } from '../appliers/applyPhaser'\nimport { applyTransformProps } from '../appliers/applyTransform'\nimport { createNineSliceLayout } from '../creators/createNineSliceLayout'\nimport { createPhaser } from '../creators/createPhaser'\nimport { createTransform, resolveAnimatableNumber } from '../creators/createTransform'\n\n/**\n * Inner bounds of a NineSlice - the content area excluding slices\n */\nexport interface NineSliceInnerBounds {\n /**\n * X offset from left edge (equals leftWidth)\n */\n x: number\n /**\n * Y offset from top edge (equals topHeight)\n */\n y: number\n /**\n * Width of inner content area (totalWidth - leftWidth - rightWidth)\n */\n width: number\n /**\n * Height of inner content area (totalHeight - topHeight - bottomHeight)\n */\n height: number\n}\n\n/**\n * Extended NineSlice reference with slice information and inner bounds\n */\nexport interface NineSliceRef {\n /**\n * The underlying Phaser NineSlice GameObject\n */\n node: Phaser.GameObjects.NineSlice | null\n /**\n * Width of the left slice in pixels\n */\n leftWidth: number\n /**\n * Width of the right slice in pixels\n */\n rightWidth: number\n /**\n * Height of the top slice in pixels (0 for 3-slice mode)\n */\n topHeight: number\n /**\n * Height of the bottom slice in pixels (0 for 3-slice mode)\n */\n bottomHeight: number\n /**\n * Inner content bounds excluding slices\n * Useful for positioning content within the NineSlice\n */\n innerBounds: NineSliceInnerBounds\n}\n\n/**\n * NineSlice-specific properties for texture and slice configuration\n */\nexport interface NineSliceSpecificProps {\n /**\n * Texture key to use for the NineSlice\n */\n texture: string\n\n /**\n * Optional tint to apply to the NineSlice\n */\n tint?: number | undefined\n\n /**\n * Optional frame within the texture atlas\n */\n frame?: string | number\n\n /**\n * Width of the left slice (in pixels of source texture)\n */\n leftWidth: number\n\n /**\n * Width of the right slice (in pixels of source texture)\n */\n rightWidth: number\n\n /**\n * Height of the top slice (in pixels of source texture)\n * Optional - omit for 3-slice mode (horizontal only)\n */\n topHeight?: number\n\n /**\n * Height of the bottom slice (in pixels of source texture)\n * Optional - omit for 3-slice mode (horizontal only)\n */\n bottomHeight?: number\n}\n\n/**\n * Base props for NineSlice - composing shared prop groups\n * Note: No InteractionProps - interaction should be handled by parent View container\n */\nexport interface NineSliceBaseProps\n extends TransformProps, PhaserProps, LayoutProps, NineSliceSpecificProps {}\n\n/**\n * Props for NineSlice primitive - extends base props with JSX-specific props\n * Renamed to avoid conflict with custom NineSlice wrapper\n */\nexport interface NineSlicePrimitiveProps\n extends NineSliceBaseProps, PropsDefaultExtension<Phaser.GameObjects.NineSlice> {}\n\n/**\n * NineSlice creator - creates a Phaser NineSlice object\n */\nexport const nineSliceCreator: HostCreator<'NineSlice'> = (scene, props) => {\n // For width/height, use a small default that will be overridden by layout system\n // This prevents the NineSlice from being created with huge dimensions\n const initialWidth = typeof props.width === 'number' ? props.width : 64\n const initialHeight = typeof props.height === 'number' ? props.height : 64\n\n const nineSlice = scene.add.nineslice(\n resolveAnimatableNumber(props.x) ?? 0,\n resolveAnimatableNumber(props.y) ?? 0,\n props.texture,\n props.frame,\n initialWidth,\n initialHeight,\n props.leftWidth,\n props.rightWidth,\n props.topHeight,\n props.bottomHeight\n )\n nineSlice.setOrigin(0, 0) // Top-left origin for easier layout handling as it is in UI\n\n // Apply tint if provided\n if (props.tint !== undefined) {\n nineSlice.setTint(props.tint)\n }\n\n // Apply transform props (scale, rotation)\n createTransform(nineSlice, props)\n\n // Apply Phaser display props (alpha, depth, visible)\n createPhaser(nineSlice, props)\n\n // Setup layout system (props and size provider)\n createNineSliceLayout(nineSlice, props)\n\n return nineSlice\n}\n\n/**\n * NineSlice patcher - updates NineSlice properties\n */\nexport const nineSlicePatcher: HostPatcher<'NineSlice'> = (node, prev, next) => {\n // Apply transform props (position, rotation, scale)\n applyTransformProps(node, prev, next)\n\n // Apply Phaser display props (alpha, depth, visible)\n applyPhaserProps(node, prev, next)\n\n // Apply NineSlice-specific props (texture, frame, slice dimensions)\n applyNineSliceProps(node, prev, next)\n\n // Apply layout props and update size provider if needed\n applyNineSliceLayout(node, prev, next)\n}\n"],"names":["resolveAnimatableNumber","createTransform","createPhaser","createNineSliceLayout","applyTransformProps","applyPhaserProps","applyNineSliceProps","applyNineSliceLayout"],"mappings":";;;;;;;;;AA4RO,MAAM,mBAA6C,CAAC,OAAO,UAAU;AAG1E,QAAM,eAAe,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ;AACrE,QAAM,gBAAgB,OAAO,MAAM,WAAW,WAAW,MAAM,SAAS;AAExE,QAAM,YAAY,MAAM,IAAI;AAAA,IAC1BA,wCAAwB,MAAM,CAAC,KAAK;AAAA,IACpCA,wCAAwB,MAAM,CAAC,KAAK;AAAA,IACpC,MAAM;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAER,YAAU,UAAU,GAAG,CAAC;AAGxB,MAAI,MAAM,SAAS,QAAW;AAC5B,cAAU,QAAQ,MAAM,IAAI;AAAA,EAC9B;AAGAC,kBAAAA,gBAAgB,WAAW,KAAK;AAGhCC,eAAAA,aAAa,WAAW,KAAK;AAG7BC,wBAAAA,sBAAsB,WAAW,KAAK;AAEtC,SAAO;AACT;AAKO,MAAM,mBAA6C,CAAC,MAAM,MAAM,SAAS;AAE9EC,qCAAoB,MAAM,MAAM,IAAI;AAGpCC,+BAAiB,MAAM,MAAM,IAAI;AAGjCC,qCAAoB,MAAM,MAAM,IAAI;AAGpCC,4CAAqB,MAAM,MAAM,IAAI;AACvC;;;"}
@@ -0,0 +1,271 @@
1
+ import { LayoutProps, PhaserProps, TransformProps } from '../../core-props';
2
+ import { HostCreator, HostPatcher } from '../../host';
3
+ import { PropsDefaultExtension } from '../../types';
4
+ /**
5
+ * NineSlice component - Phaser NineSlice GameObject for scalable UI panels
6
+ * Status: IMPLEMENTED ✅
7
+ *
8
+ * Design Overview:
9
+ * ================
10
+ *
11
+ * 1. Component Role: SCALABLE UI PANELS
12
+ * Purpose: Create resizable UI elements that preserve border/corner integrity
13
+ * Phaser Type: Phaser.GameObjects.NineSlice (9-slice scaling)
14
+ * Use Cases:
15
+ * - Buttons with fixed corner radius
16
+ * - Dialog boxes with preserved borders
17
+ * - Progress bars with capped ends
18
+ * - Panels that scale without distorting decorative edges
19
+ *
20
+ * 2. Nine-Slice Scaling Concept:
21
+ * Texture divided into 9 regions:
22
+ * ┌─────┬─────────┬─────┐
23
+ * │ TL │ Top │ TR │ (corners + edges)
24
+ * ├─────┼─────────┼─────┤
25
+ * │Left │ Center │Right│ (center scales, edges stretch)
26
+ * ├─────┼─────────┼─────┤
27
+ * │ BL │ Bottom │ BR │ (corners stay fixed)
28
+ * └─────┴─────────┴─────┘
29
+ * Behavior:
30
+ * - Corners: Never scale (preserve pixel-perfect)
31
+ * - Edges: Stretch along one axis (top/bottom: horizontal, left/right: vertical)
32
+ * - Center: Scales in both directions
33
+ * Benefit: UI elements scale to any size without visual distortion
34
+ *
35
+ * 3. Three-Slice Mode (Optional):
36
+ * Feature: Omit topHeight/bottomHeight for horizontal-only slicing
37
+ * Use Case: Horizontal buttons, progress bars
38
+ * Layout:
39
+ * ┌─────┬─────────────────┬─────┐
40
+ * │Left │ Center │Right│
41
+ * └─────┴─────────────────┴─────┘
42
+ * Props: Only leftWidth + rightWidth required
43
+ *
44
+ * 4. Headless Default: FALSE ✅
45
+ * Decision: NineSlice participates in layout by default
46
+ * Reasoning:
47
+ * - NineSlice is a UI element (buttons, panels, containers)
48
+ * - Should affect parent container dimensions
49
+ * - Similar to View component (container semantics)
50
+ * Use Cases:
51
+ * - ✅ Layout-aware (default): Buttons, panels, dialogs, cards
52
+ * - ❌ Headless (optional): Background overlays, decorative frames
53
+ * Usage:
54
+ * <NineSlice texture="panel" leftWidth={16} rightWidth={16} width={200} height={100} />
55
+ * <NineSlice texture="frame" headless={true} /> // Decorative
56
+ *
57
+ * 5. Layout Size Provider:
58
+ * Implementation: Uses explicit width/height (required props)
59
+ * Reasoning:
60
+ * - NineSlice requires explicit dimensions (Phaser constructor param)
61
+ * - No auto-sizing (unlike Text)
62
+ * - Dimensions always known and stable
63
+ * __getLayoutSize:
64
+ * return { width: nineSlice.width, height: nineSlice.height }
65
+ * Note: getBounds() not needed (no rotation typically applied)
66
+ *
67
+ * 6. Slice Configuration:
68
+ * Required Props:
69
+ * - texture: string (texture key)
70
+ * - leftWidth: number (pixels)
71
+ * - rightWidth: number (pixels)
72
+ * - width: number (total width)
73
+ * - height: number (total height)
74
+ * Optional Props:
75
+ * - topHeight: number (9-slice mode, default: 0 for 3-slice)
76
+ * - bottomHeight: number (9-slice mode, default: 0 for 3-slice)
77
+ * - frame: string | number (texture atlas frame)
78
+ * Validation:
79
+ * - Width must be >= leftWidth + rightWidth
80
+ * - Height must be >= topHeight + bottomHeight
81
+ * - Slice widths/heights define source texture regions
82
+ *
83
+ * 7. Inner Bounds Feature:
84
+ * Purpose: Calculate content area excluding slices
85
+ * Use Case: Position children inside panel borders
86
+ * Calculation:
87
+ * innerBounds = {
88
+ * x: leftWidth,
89
+ * y: topHeight,
90
+ * width: totalWidth - leftWidth - rightWidth,
91
+ * height: totalHeight - topHeight - bottomHeight
92
+ * }
93
+ * Access:
94
+ * const ref = useRef<NineSliceRef>(null)
95
+ * <NineSlice ref={ref} ... />
96
+ * console.log(ref.current?.innerBounds) // { x, y, width, height }
97
+ * Pattern: Useful for padding-aware content positioning
98
+ *
99
+ * 8. Ref Extension:
100
+ * Feature: NineSliceRef provides slice metadata
101
+ * Properties:
102
+ * - node: Phaser.GameObjects.NineSlice (the GameObject)
103
+ * - leftWidth, rightWidth, topHeight, bottomHeight: Slice dimensions
104
+ * - innerBounds: Content area calculation
105
+ * Usage:
106
+ * const panelRef = useRef<NineSliceRef>(null)
107
+ * // Access slice info for child positioning
108
+ * const { innerBounds } = panelRef.current
109
+ *
110
+ * 9. Common Patterns:
111
+ * Button:
112
+ * <NineSlice
113
+ * texture="button"
114
+ * leftWidth={16} rightWidth={16}
115
+ * topHeight={16} bottomHeight={16}
116
+ * width={200} height={60}
117
+ * >
118
+ * <Text text="Click Me" />
119
+ * </NineSlice>
120
+ * Dialog Box:
121
+ * <NineSlice
122
+ * texture="panel"
123
+ * leftWidth={32} rightWidth={32}
124
+ * topHeight={32} bottomHeight={32}
125
+ * width={400} height={300}
126
+ * >
127
+ * <View padding={32}> {/* Padding matches slice sizes * }
128
+ * <Text text="Dialog Content" />
129
+ * </View>
130
+ * </NineSlice>
131
+ * Progress Bar (3-slice):
132
+ * <NineSlice
133
+ * texture="progressbar"
134
+ * leftWidth={8} rightWidth={8}
135
+ * width={progress * 200} height={20}
136
+ * />
137
+ *
138
+ * 10. Performance Considerations:
139
+ * - Efficient rendering (single draw call per NineSlice)
140
+ * - Texture atlases recommended (reduce texture switches)
141
+ * - Scaling performance: No geometry regeneration needed
142
+ * - Slice configuration: Calculated once on creation
143
+ * - Dynamic resizing: Efficiently handled by Phaser
144
+ *
145
+ * 11. Known Limitations:
146
+ * - Requires pre-designed 9-slice texture
147
+ * - Slice dimensions must match source texture layout exactly
148
+ * - Rotation not recommended (distorts slice alignment)
149
+ * - Can't animate slice dimensions (only width/height)
150
+ * - No rounded corner support (must be in texture)
151
+ *
152
+ * Implementation Status:
153
+ * ======================
154
+ * [✅] Phaser NineSlice creation with slice configuration
155
+ * [✅] Transform props (position, scale, alpha, depth)
156
+ * [✅] Layout system integration (__layoutProps, __getLayoutSize)
157
+ * [✅] Width/height as layout props (explicit sizing)
158
+ * [✅] Three-slice mode support (optional topHeight/bottomHeight)
159
+ * [✅] NineSliceRef with innerBounds calculation
160
+ * [✅] Slice dimension validation
161
+ * [✅] Theme system integration
162
+ * [✅] Dynamic resizing support (width/height patching)
163
+ */
164
+ import type * as Phaser from 'phaser';
165
+ /**
166
+ * Inner bounds of a NineSlice - the content area excluding slices
167
+ */
168
+ export interface NineSliceInnerBounds {
169
+ /**
170
+ * X offset from left edge (equals leftWidth)
171
+ */
172
+ x: number;
173
+ /**
174
+ * Y offset from top edge (equals topHeight)
175
+ */
176
+ y: number;
177
+ /**
178
+ * Width of inner content area (totalWidth - leftWidth - rightWidth)
179
+ */
180
+ width: number;
181
+ /**
182
+ * Height of inner content area (totalHeight - topHeight - bottomHeight)
183
+ */
184
+ height: number;
185
+ }
186
+ /**
187
+ * Extended NineSlice reference with slice information and inner bounds
188
+ */
189
+ export interface NineSliceRef {
190
+ /**
191
+ * The underlying Phaser NineSlice GameObject
192
+ */
193
+ node: Phaser.GameObjects.NineSlice | null;
194
+ /**
195
+ * Width of the left slice in pixels
196
+ */
197
+ leftWidth: number;
198
+ /**
199
+ * Width of the right slice in pixels
200
+ */
201
+ rightWidth: number;
202
+ /**
203
+ * Height of the top slice in pixels (0 for 3-slice mode)
204
+ */
205
+ topHeight: number;
206
+ /**
207
+ * Height of the bottom slice in pixels (0 for 3-slice mode)
208
+ */
209
+ bottomHeight: number;
210
+ /**
211
+ * Inner content bounds excluding slices
212
+ * Useful for positioning content within the NineSlice
213
+ */
214
+ innerBounds: NineSliceInnerBounds;
215
+ }
216
+ /**
217
+ * NineSlice-specific properties for texture and slice configuration
218
+ */
219
+ export interface NineSliceSpecificProps {
220
+ /**
221
+ * Texture key to use for the NineSlice
222
+ */
223
+ texture: string;
224
+ /**
225
+ * Optional tint to apply to the NineSlice
226
+ */
227
+ tint?: number | undefined;
228
+ /**
229
+ * Optional frame within the texture atlas
230
+ */
231
+ frame?: string | number;
232
+ /**
233
+ * Width of the left slice (in pixels of source texture)
234
+ */
235
+ leftWidth: number;
236
+ /**
237
+ * Width of the right slice (in pixels of source texture)
238
+ */
239
+ rightWidth: number;
240
+ /**
241
+ * Height of the top slice (in pixels of source texture)
242
+ * Optional - omit for 3-slice mode (horizontal only)
243
+ */
244
+ topHeight?: number;
245
+ /**
246
+ * Height of the bottom slice (in pixels of source texture)
247
+ * Optional - omit for 3-slice mode (horizontal only)
248
+ */
249
+ bottomHeight?: number;
250
+ }
251
+ /**
252
+ * Base props for NineSlice - composing shared prop groups
253
+ * Note: No InteractionProps - interaction should be handled by parent View container
254
+ */
255
+ export interface NineSliceBaseProps extends TransformProps, PhaserProps, LayoutProps, NineSliceSpecificProps {
256
+ }
257
+ /**
258
+ * Props for NineSlice primitive - extends base props with JSX-specific props
259
+ * Renamed to avoid conflict with custom NineSlice wrapper
260
+ */
261
+ export interface NineSlicePrimitiveProps extends NineSliceBaseProps, PropsDefaultExtension<Phaser.GameObjects.NineSlice> {
262
+ }
263
+ /**
264
+ * NineSlice creator - creates a Phaser NineSlice object
265
+ */
266
+ export declare const nineSliceCreator: HostCreator<'NineSlice'>;
267
+ /**
268
+ * NineSlice patcher - updates NineSlice properties
269
+ */
270
+ export declare const nineSlicePatcher: HostPatcher<'NineSlice'>;
271
+ //# sourceMappingURL=nineslice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nineslice.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/nineslice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+JG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AASxD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,CAAC,EAAE,MAAM,CAAA;IACT;;OAEG;IACH,CAAC,EAAE,MAAM,CAAA;IACT;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAA;IACzC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,WAAW,EAAE,oBAAoB,CAAA;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAEzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,kBACf,SAAQ,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,sBAAsB;CAAG;AAE7E;;;GAGG;AACH,MAAM,WAAW,uBACf,SAAQ,kBAAkB,EAAE,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC;CAAG;AAEpF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,WAAW,CAmCrD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,WAAW,CAYrD,CAAA"}