@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,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxCore = require("@number10/jsx-core");
4
+ const signalsCore = require("@preact/signals-core");
5
+ function applySignalAlpha(node, key, prevValue, nextValue, apply) {
6
+ node.__signalEffects?.get(key)?.();
7
+ if (jsxCore.isAnimatedSignal(nextValue)) {
8
+ apply(nextValue.value);
9
+ const cleanup = signalsCore.effect(() => {
10
+ apply(nextValue.value);
11
+ });
12
+ if (!node.__signalEffects) {
13
+ node.__signalEffects = /* @__PURE__ */ new Map();
14
+ }
15
+ node.__signalEffects.set(key, cleanup);
16
+ } else if (typeof nextValue === "number" && nextValue !== prevValue) {
17
+ apply(nextValue);
18
+ }
19
+ }
20
+ function normalizeVisible(visible) {
21
+ if (visible === void 0) return true;
22
+ if (typeof visible === "boolean") return visible;
23
+ if (visible === "visible") return true;
24
+ if (visible === "invisible" || visible === "none") return false;
25
+ return true;
26
+ }
27
+ function applyPhaserProps(node, prev, next) {
28
+ applySignalAlpha(node, "alpha", prev.alpha, next.alpha, (v) => {
29
+ node.setAlpha?.(v);
30
+ });
31
+ if (prev.depth !== next.depth && typeof next.depth === "number") {
32
+ node.setDepth?.(next.depth);
33
+ }
34
+ if (prev.visible !== next.visible) {
35
+ const visibleValue = normalizeVisible(next.visible);
36
+ node.visible = visibleValue;
37
+ }
38
+ }
39
+ exports.applyPhaserProps = applyPhaserProps;
40
+ //# sourceMappingURL=applyPhaser.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPhaser.cjs","sources":["../../../src/components/appliers/applyPhaser.ts"],"sourcesContent":["/**\n * Applier for Phaser GameObject display properties\n *\n * Supports AnimatedSignal values — subscribes to signal changes and updates\n * native node properties directly, bypassing VDOM re-renders.\n */\nimport { isAnimatedSignal } from '@number10/jsx-core'\nimport { effect } from '@preact/signals-core'\nimport type { Display, PhaserProps, TransformProps } from '../../core-props'\n\n// Combined type — alpha comes from TransformProps, rest from PhaserProps\ntype PhaserDisplayProps = Partial<TransformProps & PhaserProps & { visible?: boolean | Display }>\n\n/**\n * Generic node type with Phaser GameObject display capabilities\n */\ntype PhaserNode = {\n visible: boolean\n setAlpha: (alpha: number) => void\n setDepth: (depth: number) => void\n}\n\ninterface SignalEffectNode {\n __signalEffects?: Map<string, () => void>\n}\n\n/**\n * Applies a prop value that may be an AnimatedSignal.\n * Subscribes to signal changes for live updates without VDOM re-renders.\n */\nfunction applySignalAlpha<T extends SignalEffectNode>(\n node: T,\n key: string,\n prevValue: unknown,\n nextValue: unknown,\n apply: (value: number) => void\n): void {\n node.__signalEffects?.get(key)?.()\n\n if (isAnimatedSignal(nextValue)) {\n apply(nextValue.value)\n const cleanup = effect(() => {\n apply(nextValue.value)\n })\n if (!node.__signalEffects) {\n node.__signalEffects = new Map()\n }\n node.__signalEffects.set(key, cleanup)\n } else if (typeof nextValue === 'number' && nextValue !== prevValue) {\n apply(nextValue)\n }\n}\n\n/**\n * Normalize visible prop to boolean for Phaser GameObject\n * - true / 'visible' → true (rendered)\n * - false / 'invisible' → false (not rendered, but takes space)\n * - 'none' → false (not rendered, no space)\n * @param visible - Visible prop value\n * @returns Boolean for Phaser GameObject.visible\n */\nfunction normalizeVisible(visible: boolean | Display | undefined): boolean {\n if (visible === undefined) return true // default: visible\n if (typeof visible === 'boolean') return visible\n // String values\n if (visible === 'visible') return true\n if (visible === 'invisible' || visible === 'none') return false\n return true\n}\n\n/**\n * Applies Phaser display properties (alpha, depth, visibility)\n * @param node - Node with Phaser GameObject properties\n * @param prev - Previous props\n * @param next - New props\n */\nexport function applyPhaserProps<T extends Partial<PhaserNode & SignalEffectNode>>(\n node: T,\n prev: PhaserDisplayProps,\n next: PhaserDisplayProps\n): void {\n // Alpha — supports AnimatedSignal for tween/spring-driven opacity\n applySignalAlpha(node, 'alpha', prev.alpha, next.alpha, (v) => {\n node.setAlpha?.(v)\n })\n\n // Depth\n if (prev.depth !== next.depth && typeof next.depth === 'number') {\n node.setDepth?.(next.depth)\n }\n\n // Visibility - supports boolean and Display type (from LayoutProps)\n if (prev.visible !== next.visible) {\n const visibleValue = normalizeVisible(next.visible)\n node.visible = visibleValue\n }\n}\n"],"names":["isAnimatedSignal","effect"],"mappings":";;;;AA8BA,SAAS,iBACP,MACA,KACA,WACA,WACA,OACM;AACN,OAAK,iBAAiB,IAAI,GAAG,IAAA;AAE7B,MAAIA,QAAAA,iBAAiB,SAAS,GAAG;AAC/B,UAAM,UAAU,KAAK;AACrB,UAAM,UAAUC,YAAAA,OAAO,MAAM;AAC3B,YAAM,UAAU,KAAK;AAAA,IACvB,CAAC;AACD,QAAI,CAAC,KAAK,iBAAiB;AACzB,WAAK,sCAAsB,IAAA;AAAA,IAC7B;AACA,SAAK,gBAAgB,IAAI,KAAK,OAAO;AAAA,EACvC,WAAW,OAAO,cAAc,YAAY,cAAc,WAAW;AACnE,UAAM,SAAS;AAAA,EACjB;AACF;AAUA,SAAS,iBAAiB,SAAiD;AACzE,MAAI,YAAY,OAAW,QAAO;AAClC,MAAI,OAAO,YAAY,UAAW,QAAO;AAEzC,MAAI,YAAY,UAAW,QAAO;AAClC,MAAI,YAAY,eAAe,YAAY,OAAQ,QAAO;AAC1D,SAAO;AACT;AAQO,SAAS,iBACd,MACA,MACA,MACM;AAEN,mBAAiB,MAAM,SAAS,KAAK,OAAO,KAAK,OAAO,CAAC,MAAM;AAC7D,SAAK,WAAW,CAAC;AAAA,EACnB,CAAC;AAGD,MAAI,KAAK,UAAU,KAAK,SAAS,OAAO,KAAK,UAAU,UAAU;AAC/D,SAAK,WAAW,KAAK,KAAK;AAAA,EAC5B;AAGA,MAAI,KAAK,YAAY,KAAK,SAAS;AACjC,UAAM,eAAe,iBAAiB,KAAK,OAAO;AAClD,SAAK,UAAU;AAAA,EACjB;AACF;;"}
@@ -0,0 +1,24 @@
1
+ import { Display, PhaserProps, TransformProps } from '../../core-props';
2
+ type PhaserDisplayProps = Partial<TransformProps & PhaserProps & {
3
+ visible?: boolean | Display;
4
+ }>;
5
+ /**
6
+ * Generic node type with Phaser GameObject display capabilities
7
+ */
8
+ type PhaserNode = {
9
+ visible: boolean;
10
+ setAlpha: (alpha: number) => void;
11
+ setDepth: (depth: number) => void;
12
+ };
13
+ interface SignalEffectNode {
14
+ __signalEffects?: Map<string, () => void>;
15
+ }
16
+ /**
17
+ * Applies Phaser display properties (alpha, depth, visibility)
18
+ * @param node - Node with Phaser GameObject properties
19
+ * @param prev - Previous props
20
+ * @param next - New props
21
+ */
22
+ export declare function applyPhaserProps<T extends Partial<PhaserNode & SignalEffectNode>>(node: T, prev: PhaserDisplayProps, next: PhaserDisplayProps): void;
23
+ export {};
24
+ //# sourceMappingURL=applyPhaser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPhaser.d.ts","sourceRoot":"","sources":["../../../src/components/appliers/applyPhaser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAG5E,KAAK,kBAAkB,GAAG,OAAO,CAAC,cAAc,GAAG,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAAE,CAAC,CAAA;AAEjG;;GAEG;AACH,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC,CAAA;AAED,UAAU,gBAAgB;IACxB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAA;CAC1C;AA8CD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,CAAC,UAAU,GAAG,gBAAgB,CAAC,EAC/E,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,kBAAkB,GACvB,IAAI,CAgBN"}
@@ -0,0 +1,40 @@
1
+ import { isAnimatedSignal } from "@number10/jsx-core";
2
+ import { effect } from "@preact/signals-core";
3
+ function applySignalAlpha(node, key, prevValue, nextValue, apply) {
4
+ node.__signalEffects?.get(key)?.();
5
+ if (isAnimatedSignal(nextValue)) {
6
+ apply(nextValue.value);
7
+ const cleanup = effect(() => {
8
+ apply(nextValue.value);
9
+ });
10
+ if (!node.__signalEffects) {
11
+ node.__signalEffects = /* @__PURE__ */ new Map();
12
+ }
13
+ node.__signalEffects.set(key, cleanup);
14
+ } else if (typeof nextValue === "number" && nextValue !== prevValue) {
15
+ apply(nextValue);
16
+ }
17
+ }
18
+ function normalizeVisible(visible) {
19
+ if (visible === void 0) return true;
20
+ if (typeof visible === "boolean") return visible;
21
+ if (visible === "visible") return true;
22
+ if (visible === "invisible" || visible === "none") return false;
23
+ return true;
24
+ }
25
+ function applyPhaserProps(node, prev, next) {
26
+ applySignalAlpha(node, "alpha", prev.alpha, next.alpha, (v) => {
27
+ node.setAlpha?.(v);
28
+ });
29
+ if (prev.depth !== next.depth && typeof next.depth === "number") {
30
+ node.setDepth?.(next.depth);
31
+ }
32
+ if (prev.visible !== next.visible) {
33
+ const visibleValue = normalizeVisible(next.visible);
34
+ node.visible = visibleValue;
35
+ }
36
+ }
37
+ export {
38
+ applyPhaserProps
39
+ };
40
+ //# sourceMappingURL=applyPhaser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPhaser.js","sources":["../../../src/components/appliers/applyPhaser.ts"],"sourcesContent":["/**\n * Applier for Phaser GameObject display properties\n *\n * Supports AnimatedSignal values — subscribes to signal changes and updates\n * native node properties directly, bypassing VDOM re-renders.\n */\nimport { isAnimatedSignal } from '@number10/jsx-core'\nimport { effect } from '@preact/signals-core'\nimport type { Display, PhaserProps, TransformProps } from '../../core-props'\n\n// Combined type — alpha comes from TransformProps, rest from PhaserProps\ntype PhaserDisplayProps = Partial<TransformProps & PhaserProps & { visible?: boolean | Display }>\n\n/**\n * Generic node type with Phaser GameObject display capabilities\n */\ntype PhaserNode = {\n visible: boolean\n setAlpha: (alpha: number) => void\n setDepth: (depth: number) => void\n}\n\ninterface SignalEffectNode {\n __signalEffects?: Map<string, () => void>\n}\n\n/**\n * Applies a prop value that may be an AnimatedSignal.\n * Subscribes to signal changes for live updates without VDOM re-renders.\n */\nfunction applySignalAlpha<T extends SignalEffectNode>(\n node: T,\n key: string,\n prevValue: unknown,\n nextValue: unknown,\n apply: (value: number) => void\n): void {\n node.__signalEffects?.get(key)?.()\n\n if (isAnimatedSignal(nextValue)) {\n apply(nextValue.value)\n const cleanup = effect(() => {\n apply(nextValue.value)\n })\n if (!node.__signalEffects) {\n node.__signalEffects = new Map()\n }\n node.__signalEffects.set(key, cleanup)\n } else if (typeof nextValue === 'number' && nextValue !== prevValue) {\n apply(nextValue)\n }\n}\n\n/**\n * Normalize visible prop to boolean for Phaser GameObject\n * - true / 'visible' → true (rendered)\n * - false / 'invisible' → false (not rendered, but takes space)\n * - 'none' → false (not rendered, no space)\n * @param visible - Visible prop value\n * @returns Boolean for Phaser GameObject.visible\n */\nfunction normalizeVisible(visible: boolean | Display | undefined): boolean {\n if (visible === undefined) return true // default: visible\n if (typeof visible === 'boolean') return visible\n // String values\n if (visible === 'visible') return true\n if (visible === 'invisible' || visible === 'none') return false\n return true\n}\n\n/**\n * Applies Phaser display properties (alpha, depth, visibility)\n * @param node - Node with Phaser GameObject properties\n * @param prev - Previous props\n * @param next - New props\n */\nexport function applyPhaserProps<T extends Partial<PhaserNode & SignalEffectNode>>(\n node: T,\n prev: PhaserDisplayProps,\n next: PhaserDisplayProps\n): void {\n // Alpha — supports AnimatedSignal for tween/spring-driven opacity\n applySignalAlpha(node, 'alpha', prev.alpha, next.alpha, (v) => {\n node.setAlpha?.(v)\n })\n\n // Depth\n if (prev.depth !== next.depth && typeof next.depth === 'number') {\n node.setDepth?.(next.depth)\n }\n\n // Visibility - supports boolean and Display type (from LayoutProps)\n if (prev.visible !== next.visible) {\n const visibleValue = normalizeVisible(next.visible)\n node.visible = visibleValue\n }\n}\n"],"names":[],"mappings":";;AA8BA,SAAS,iBACP,MACA,KACA,WACA,WACA,OACM;AACN,OAAK,iBAAiB,IAAI,GAAG,IAAA;AAE7B,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,UAAU,KAAK;AACrB,UAAM,UAAU,OAAO,MAAM;AAC3B,YAAM,UAAU,KAAK;AAAA,IACvB,CAAC;AACD,QAAI,CAAC,KAAK,iBAAiB;AACzB,WAAK,sCAAsB,IAAA;AAAA,IAC7B;AACA,SAAK,gBAAgB,IAAI,KAAK,OAAO;AAAA,EACvC,WAAW,OAAO,cAAc,YAAY,cAAc,WAAW;AACnE,UAAM,SAAS;AAAA,EACjB;AACF;AAUA,SAAS,iBAAiB,SAAiD;AACzE,MAAI,YAAY,OAAW,QAAO;AAClC,MAAI,OAAO,YAAY,UAAW,QAAO;AAEzC,MAAI,YAAY,UAAW,QAAO;AAClC,MAAI,YAAY,eAAe,YAAY,OAAQ,QAAO;AAC1D,SAAO;AACT;AAQO,SAAS,iBACd,MACA,MACA,MACM;AAEN,mBAAiB,MAAM,SAAS,KAAK,OAAO,KAAK,OAAO,CAAC,MAAM;AAC7D,SAAK,WAAW,CAAC;AAAA,EACnB,CAAC;AAGD,MAAI,KAAK,UAAU,KAAK,SAAS,OAAO,KAAK,UAAU,UAAU;AAC/D,SAAK,WAAW,KAAK,KAAK;AAAA,EAC5B;AAGA,MAAI,KAAK,YAAY,KAAK,SAAS;AACjC,UAAM,eAAe,iBAAiB,KAAK,OAAO;AAClD,SAAK,UAAU;AAAA,EACjB;AACF;"}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function getOriginalTextureDimensions(sprite) {
4
+ const frame = sprite.frame;
5
+ return {
6
+ width: frame.width,
7
+ height: frame.height
8
+ };
9
+ }
10
+ function calculateFitScale(sprite, targetWidth, targetHeight, fit = "fill") {
11
+ const { width: textureWidth, height: textureHeight } = getOriginalTextureDimensions(sprite);
12
+ if (textureWidth === 0 || textureHeight === 0) {
13
+ return { scaleX: 1, scaleY: 1 };
14
+ }
15
+ if (fit === "fill") {
16
+ return {
17
+ scaleX: targetWidth / textureWidth,
18
+ scaleY: targetHeight / textureHeight
19
+ };
20
+ }
21
+ const targetAspect = targetWidth / targetHeight;
22
+ const textureAspect = textureWidth / textureHeight;
23
+ if (fit === "contain") {
24
+ const scale = targetAspect > textureAspect ? targetHeight / textureHeight : targetWidth / textureWidth;
25
+ return { scaleX: scale, scaleY: scale };
26
+ }
27
+ if (fit === "cover") {
28
+ const scale = targetAspect < textureAspect ? targetHeight / textureHeight : targetWidth / textureWidth;
29
+ return { scaleX: scale, scaleY: scale };
30
+ }
31
+ return { scaleX: 1, scaleY: 1 };
32
+ }
33
+ function applySpriteProps(sprite, prev, next) {
34
+ const textureChanged = prev.texture !== next.texture || prev.frame !== next.frame;
35
+ if (textureChanged && next.texture) {
36
+ sprite.setTexture(next.texture, next.frame);
37
+ }
38
+ if (prev.tint !== next.tint) {
39
+ if (typeof next.tint === "number") {
40
+ sprite.setTint(next.tint);
41
+ } else {
42
+ sprite.clearTint();
43
+ }
44
+ }
45
+ if (prev.originX !== next.originX || prev.originY !== next.originY) {
46
+ const originX = next.originX ?? sprite.originX;
47
+ const originY = next.originY ?? sprite.originY;
48
+ sprite.setOrigin(originX, originY);
49
+ }
50
+ const displayWidthChanged = prev.displayWidth !== next.displayWidth;
51
+ const displayHeightChanged = prev.displayHeight !== next.displayHeight;
52
+ const fitChanged = prev.fit !== next.fit;
53
+ if (displayWidthChanged || displayHeightChanged || fitChanged || textureChanged) {
54
+ if (typeof next.displayWidth === "number" && typeof next.displayHeight === "number") {
55
+ const fit = next.fit ?? "fill";
56
+ if (fit === "fill") {
57
+ sprite.setDisplaySize(next.displayWidth, next.displayHeight);
58
+ } else {
59
+ const { scaleX, scaleY } = calculateFitScale(
60
+ sprite,
61
+ next.displayWidth,
62
+ next.displayHeight,
63
+ fit
64
+ );
65
+ sprite.setScale(scaleX, scaleY);
66
+ }
67
+ } else if (typeof next.displayWidth === "number") {
68
+ const { width: origWidth } = getOriginalTextureDimensions(sprite);
69
+ const scale = next.displayWidth / origWidth;
70
+ sprite.setScale(scale);
71
+ } else if (typeof next.displayHeight === "number") {
72
+ const { height: origHeight } = getOriginalTextureDimensions(sprite);
73
+ const scale = next.displayHeight / origHeight;
74
+ sprite.setScale(scale, scale);
75
+ } else {
76
+ sprite.setScale(1);
77
+ }
78
+ }
79
+ const animationChanged = prev.animationKey !== next.animationKey || prev.loop !== next.loop || prev.repeatDelay !== next.repeatDelay;
80
+ if (animationChanged) {
81
+ if (sprite.anims.isPlaying) {
82
+ sprite.anims.stop();
83
+ }
84
+ if (next.animationKey) {
85
+ sprite.anims.play({
86
+ key: next.animationKey,
87
+ repeat: next.loop ? -1 : 0,
88
+ repeatDelay: next.repeatDelay ?? 0
89
+ });
90
+ }
91
+ }
92
+ const callbacksChanged = prev.onAnimationStart !== next.onAnimationStart || prev.onAnimationComplete !== next.onAnimationComplete || prev.onAnimationRepeat !== next.onAnimationRepeat || prev.onAnimationUpdate !== next.onAnimationUpdate;
93
+ if (callbacksChanged) {
94
+ sprite.off("animationstart");
95
+ sprite.off("animationcomplete");
96
+ sprite.off("animationrepeat");
97
+ sprite.off("animationupdate");
98
+ if (next.onAnimationStart) {
99
+ sprite.on("animationstart", (anim) => {
100
+ next.onAnimationStart?.(anim.key);
101
+ });
102
+ }
103
+ if (next.onAnimationComplete) {
104
+ sprite.on("animationcomplete", (anim) => {
105
+ next.onAnimationComplete?.(anim.key);
106
+ });
107
+ }
108
+ if (next.onAnimationRepeat) {
109
+ sprite.on("animationrepeat", (anim) => {
110
+ next.onAnimationRepeat?.(anim.key);
111
+ });
112
+ }
113
+ if (next.onAnimationUpdate) {
114
+ sprite.on(
115
+ "animationupdate",
116
+ (anim, frame) => {
117
+ next.onAnimationUpdate?.(anim.key, frame);
118
+ }
119
+ );
120
+ }
121
+ }
122
+ }
123
+ exports.applySpriteProps = applySpriteProps;
124
+ //# sourceMappingURL=applySprite.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applySprite.cjs","sources":["../../../src/components/appliers/applySprite.ts"],"sourcesContent":["/**\n * Applier for Sprite-specific properties\n */\nimport type * as Phaser from 'phaser'\nimport type { SpriteBaseProps } from '../primitives/sprite'\n\n/**\n * Gets original texture dimensions (unscaled)\n * @param sprite - Phaser Sprite object\n * @returns Original width and height\n */\nfunction getOriginalTextureDimensions(sprite: Phaser.GameObjects.Sprite): {\n width: number\n height: number\n} {\n const frame = sprite.frame\n return {\n width: frame.width,\n height: frame.height,\n }\n}\n\n/**\n * Calculates scale factors for fit modes\n * @param sprite - Phaser Sprite object\n * @param targetWidth - Desired width\n * @param targetHeight - Desired height\n * @param fit - Fit mode\n * @returns Scale factors for x and y\n */\nfunction calculateFitScale(\n sprite: Phaser.GameObjects.Sprite,\n targetWidth: number,\n targetHeight: number,\n fit: 'fill' | 'contain' | 'cover' = 'fill'\n): { scaleX: number; scaleY: number } {\n const { width: textureWidth, height: textureHeight } = getOriginalTextureDimensions(sprite)\n\n if (textureWidth === 0 || textureHeight === 0) {\n return { scaleX: 1, scaleY: 1 }\n }\n\n if (fit === 'fill') {\n return {\n scaleX: targetWidth / textureWidth,\n scaleY: targetHeight / textureHeight,\n }\n }\n\n const targetAspect = targetWidth / targetHeight\n const textureAspect = textureWidth / textureHeight\n\n if (fit === 'contain') {\n const scale =\n targetAspect > textureAspect ? targetHeight / textureHeight : targetWidth / textureWidth\n return { scaleX: scale, scaleY: scale }\n }\n\n if (fit === 'cover') {\n const scale =\n targetAspect < textureAspect ? targetHeight / textureHeight : targetWidth / textureWidth\n return { scaleX: scale, scaleY: scale }\n }\n\n return { scaleX: 1, scaleY: 1 }\n}\n\n/**\n * Applies Sprite-specific properties (texture, frame, tint, displaySize, fit, animations)\n * @param sprite - Phaser Sprite object\n * @param prev - Previous props\n * @param next - New props\n */\nexport function applySpriteProps(\n sprite: Phaser.GameObjects.Sprite,\n prev: Partial<SpriteBaseProps>,\n next: Partial<SpriteBaseProps>\n): void {\n // Check if texture or frame changed\n const textureChanged = prev.texture !== next.texture || prev.frame !== next.frame\n if (textureChanged && next.texture) {\n sprite.setTexture(next.texture, next.frame)\n }\n\n // Apply tint\n if (prev.tint !== next.tint) {\n if (typeof next.tint === 'number') {\n sprite.setTint(next.tint)\n } else {\n sprite.clearTint()\n }\n }\n\n // Apply origin if specified\n if (prev.originX !== next.originX || prev.originY !== next.originY) {\n const originX = next.originX ?? sprite.originX\n const originY = next.originY ?? sprite.originY\n sprite.setOrigin(originX, originY)\n }\n\n // Apply displayWidth/displayHeight with fit mode\n const displayWidthChanged = prev.displayWidth !== next.displayWidth\n const displayHeightChanged = prev.displayHeight !== next.displayHeight\n const fitChanged = prev.fit !== next.fit\n\n if (displayWidthChanged || displayHeightChanged || fitChanged || textureChanged) {\n if (typeof next.displayWidth === 'number' && typeof next.displayHeight === 'number') {\n // Both specified - use fit mode\n const fit = next.fit ?? 'fill'\n\n if (fit === 'fill') {\n // Use setDisplaySize for fill mode (non-uniform scaling)\n sprite.setDisplaySize(next.displayWidth, next.displayHeight)\n } else {\n // Use setScale for contain/cover (uniform scaling)\n const { scaleX, scaleY } = calculateFitScale(\n sprite,\n next.displayWidth,\n next.displayHeight,\n fit\n )\n sprite.setScale(scaleX, scaleY)\n }\n } else if (typeof next.displayWidth === 'number') {\n // Only width - preserve aspect ratio (use original texture width)\n const { width: origWidth } = getOriginalTextureDimensions(sprite)\n const scale = next.displayWidth / origWidth\n sprite.setScale(scale)\n } else if (typeof next.displayHeight === 'number') {\n // Only height - preserve aspect ratio (use original texture height)\n const { height: origHeight } = getOriginalTextureDimensions(sprite)\n const scale = next.displayHeight / origHeight\n sprite.setScale(scale, scale)\n } else {\n // No display size specified - reset to default scale\n sprite.setScale(1)\n }\n }\n\n // Handle animation changes\n const animationChanged =\n prev.animationKey !== next.animationKey ||\n prev.loop !== next.loop ||\n prev.repeatDelay !== next.repeatDelay\n\n if (animationChanged) {\n // Stop previous animation if playing\n if (sprite.anims.isPlaying) {\n sprite.anims.stop()\n }\n\n // Play new animation if specified\n if (next.animationKey) {\n sprite.anims.play({\n key: next.animationKey,\n repeat: next.loop ? -1 : 0,\n repeatDelay: next.repeatDelay ?? 0,\n })\n }\n }\n\n // Update animation callbacks\n const callbacksChanged =\n prev.onAnimationStart !== next.onAnimationStart ||\n prev.onAnimationComplete !== next.onAnimationComplete ||\n prev.onAnimationRepeat !== next.onAnimationRepeat ||\n prev.onAnimationUpdate !== next.onAnimationUpdate\n\n if (callbacksChanged) {\n // Remove old listeners\n sprite.off('animationstart')\n sprite.off('animationcomplete')\n sprite.off('animationrepeat')\n sprite.off('animationupdate')\n\n // Add new listeners\n if (next.onAnimationStart) {\n sprite.on('animationstart', (anim: Phaser.Animations.Animation) => {\n next.onAnimationStart?.(anim.key)\n })\n }\n\n if (next.onAnimationComplete) {\n sprite.on('animationcomplete', (anim: Phaser.Animations.Animation) => {\n next.onAnimationComplete?.(anim.key)\n })\n }\n\n if (next.onAnimationRepeat) {\n sprite.on('animationrepeat', (anim: Phaser.Animations.Animation) => {\n next.onAnimationRepeat?.(anim.key)\n })\n }\n\n if (next.onAnimationUpdate) {\n sprite.on(\n 'animationupdate',\n (anim: Phaser.Animations.Animation, frame: Phaser.Animations.AnimationFrame) => {\n next.onAnimationUpdate?.(anim.key, frame)\n }\n )\n }\n }\n}\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ import { SpriteBaseProps } from '../primitives/sprite';
2
+ /**
3
+ * Applier for Sprite-specific properties
4
+ */
5
+ import type * as Phaser from 'phaser';
6
+ /**
7
+ * Applies Sprite-specific properties (texture, frame, tint, displaySize, fit, animations)
8
+ * @param sprite - Phaser Sprite object
9
+ * @param prev - Previous props
10
+ * @param next - New props
11
+ */
12
+ export declare function applySpriteProps(sprite: Phaser.GameObjects.Sprite, prev: Partial<SpriteBaseProps>, next: Partial<SpriteBaseProps>): void;
13
+ //# sourceMappingURL=applySprite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applySprite.d.ts","sourceRoot":"","sources":["../../../src/components/appliers/applySprite.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AA+D3D;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,EACjC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,EAC9B,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAC7B,IAAI,CA8HN"}
@@ -0,0 +1,124 @@
1
+ function getOriginalTextureDimensions(sprite) {
2
+ const frame = sprite.frame;
3
+ return {
4
+ width: frame.width,
5
+ height: frame.height
6
+ };
7
+ }
8
+ function calculateFitScale(sprite, targetWidth, targetHeight, fit = "fill") {
9
+ const { width: textureWidth, height: textureHeight } = getOriginalTextureDimensions(sprite);
10
+ if (textureWidth === 0 || textureHeight === 0) {
11
+ return { scaleX: 1, scaleY: 1 };
12
+ }
13
+ if (fit === "fill") {
14
+ return {
15
+ scaleX: targetWidth / textureWidth,
16
+ scaleY: targetHeight / textureHeight
17
+ };
18
+ }
19
+ const targetAspect = targetWidth / targetHeight;
20
+ const textureAspect = textureWidth / textureHeight;
21
+ if (fit === "contain") {
22
+ const scale = targetAspect > textureAspect ? targetHeight / textureHeight : targetWidth / textureWidth;
23
+ return { scaleX: scale, scaleY: scale };
24
+ }
25
+ if (fit === "cover") {
26
+ const scale = targetAspect < textureAspect ? targetHeight / textureHeight : targetWidth / textureWidth;
27
+ return { scaleX: scale, scaleY: scale };
28
+ }
29
+ return { scaleX: 1, scaleY: 1 };
30
+ }
31
+ function applySpriteProps(sprite, prev, next) {
32
+ const textureChanged = prev.texture !== next.texture || prev.frame !== next.frame;
33
+ if (textureChanged && next.texture) {
34
+ sprite.setTexture(next.texture, next.frame);
35
+ }
36
+ if (prev.tint !== next.tint) {
37
+ if (typeof next.tint === "number") {
38
+ sprite.setTint(next.tint);
39
+ } else {
40
+ sprite.clearTint();
41
+ }
42
+ }
43
+ if (prev.originX !== next.originX || prev.originY !== next.originY) {
44
+ const originX = next.originX ?? sprite.originX;
45
+ const originY = next.originY ?? sprite.originY;
46
+ sprite.setOrigin(originX, originY);
47
+ }
48
+ const displayWidthChanged = prev.displayWidth !== next.displayWidth;
49
+ const displayHeightChanged = prev.displayHeight !== next.displayHeight;
50
+ const fitChanged = prev.fit !== next.fit;
51
+ if (displayWidthChanged || displayHeightChanged || fitChanged || textureChanged) {
52
+ if (typeof next.displayWidth === "number" && typeof next.displayHeight === "number") {
53
+ const fit = next.fit ?? "fill";
54
+ if (fit === "fill") {
55
+ sprite.setDisplaySize(next.displayWidth, next.displayHeight);
56
+ } else {
57
+ const { scaleX, scaleY } = calculateFitScale(
58
+ sprite,
59
+ next.displayWidth,
60
+ next.displayHeight,
61
+ fit
62
+ );
63
+ sprite.setScale(scaleX, scaleY);
64
+ }
65
+ } else if (typeof next.displayWidth === "number") {
66
+ const { width: origWidth } = getOriginalTextureDimensions(sprite);
67
+ const scale = next.displayWidth / origWidth;
68
+ sprite.setScale(scale);
69
+ } else if (typeof next.displayHeight === "number") {
70
+ const { height: origHeight } = getOriginalTextureDimensions(sprite);
71
+ const scale = next.displayHeight / origHeight;
72
+ sprite.setScale(scale, scale);
73
+ } else {
74
+ sprite.setScale(1);
75
+ }
76
+ }
77
+ const animationChanged = prev.animationKey !== next.animationKey || prev.loop !== next.loop || prev.repeatDelay !== next.repeatDelay;
78
+ if (animationChanged) {
79
+ if (sprite.anims.isPlaying) {
80
+ sprite.anims.stop();
81
+ }
82
+ if (next.animationKey) {
83
+ sprite.anims.play({
84
+ key: next.animationKey,
85
+ repeat: next.loop ? -1 : 0,
86
+ repeatDelay: next.repeatDelay ?? 0
87
+ });
88
+ }
89
+ }
90
+ const callbacksChanged = prev.onAnimationStart !== next.onAnimationStart || prev.onAnimationComplete !== next.onAnimationComplete || prev.onAnimationRepeat !== next.onAnimationRepeat || prev.onAnimationUpdate !== next.onAnimationUpdate;
91
+ if (callbacksChanged) {
92
+ sprite.off("animationstart");
93
+ sprite.off("animationcomplete");
94
+ sprite.off("animationrepeat");
95
+ sprite.off("animationupdate");
96
+ if (next.onAnimationStart) {
97
+ sprite.on("animationstart", (anim) => {
98
+ next.onAnimationStart?.(anim.key);
99
+ });
100
+ }
101
+ if (next.onAnimationComplete) {
102
+ sprite.on("animationcomplete", (anim) => {
103
+ next.onAnimationComplete?.(anim.key);
104
+ });
105
+ }
106
+ if (next.onAnimationRepeat) {
107
+ sprite.on("animationrepeat", (anim) => {
108
+ next.onAnimationRepeat?.(anim.key);
109
+ });
110
+ }
111
+ if (next.onAnimationUpdate) {
112
+ sprite.on(
113
+ "animationupdate",
114
+ (anim, frame) => {
115
+ next.onAnimationUpdate?.(anim.key, frame);
116
+ }
117
+ );
118
+ }
119
+ }
120
+ }
121
+ export {
122
+ applySpriteProps
123
+ };
124
+ //# sourceMappingURL=applySprite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applySprite.js","sources":["../../../src/components/appliers/applySprite.ts"],"sourcesContent":["/**\n * Applier for Sprite-specific properties\n */\nimport type * as Phaser from 'phaser'\nimport type { SpriteBaseProps } from '../primitives/sprite'\n\n/**\n * Gets original texture dimensions (unscaled)\n * @param sprite - Phaser Sprite object\n * @returns Original width and height\n */\nfunction getOriginalTextureDimensions(sprite: Phaser.GameObjects.Sprite): {\n width: number\n height: number\n} {\n const frame = sprite.frame\n return {\n width: frame.width,\n height: frame.height,\n }\n}\n\n/**\n * Calculates scale factors for fit modes\n * @param sprite - Phaser Sprite object\n * @param targetWidth - Desired width\n * @param targetHeight - Desired height\n * @param fit - Fit mode\n * @returns Scale factors for x and y\n */\nfunction calculateFitScale(\n sprite: Phaser.GameObjects.Sprite,\n targetWidth: number,\n targetHeight: number,\n fit: 'fill' | 'contain' | 'cover' = 'fill'\n): { scaleX: number; scaleY: number } {\n const { width: textureWidth, height: textureHeight } = getOriginalTextureDimensions(sprite)\n\n if (textureWidth === 0 || textureHeight === 0) {\n return { scaleX: 1, scaleY: 1 }\n }\n\n if (fit === 'fill') {\n return {\n scaleX: targetWidth / textureWidth,\n scaleY: targetHeight / textureHeight,\n }\n }\n\n const targetAspect = targetWidth / targetHeight\n const textureAspect = textureWidth / textureHeight\n\n if (fit === 'contain') {\n const scale =\n targetAspect > textureAspect ? targetHeight / textureHeight : targetWidth / textureWidth\n return { scaleX: scale, scaleY: scale }\n }\n\n if (fit === 'cover') {\n const scale =\n targetAspect < textureAspect ? targetHeight / textureHeight : targetWidth / textureWidth\n return { scaleX: scale, scaleY: scale }\n }\n\n return { scaleX: 1, scaleY: 1 }\n}\n\n/**\n * Applies Sprite-specific properties (texture, frame, tint, displaySize, fit, animations)\n * @param sprite - Phaser Sprite object\n * @param prev - Previous props\n * @param next - New props\n */\nexport function applySpriteProps(\n sprite: Phaser.GameObjects.Sprite,\n prev: Partial<SpriteBaseProps>,\n next: Partial<SpriteBaseProps>\n): void {\n // Check if texture or frame changed\n const textureChanged = prev.texture !== next.texture || prev.frame !== next.frame\n if (textureChanged && next.texture) {\n sprite.setTexture(next.texture, next.frame)\n }\n\n // Apply tint\n if (prev.tint !== next.tint) {\n if (typeof next.tint === 'number') {\n sprite.setTint(next.tint)\n } else {\n sprite.clearTint()\n }\n }\n\n // Apply origin if specified\n if (prev.originX !== next.originX || prev.originY !== next.originY) {\n const originX = next.originX ?? sprite.originX\n const originY = next.originY ?? sprite.originY\n sprite.setOrigin(originX, originY)\n }\n\n // Apply displayWidth/displayHeight with fit mode\n const displayWidthChanged = prev.displayWidth !== next.displayWidth\n const displayHeightChanged = prev.displayHeight !== next.displayHeight\n const fitChanged = prev.fit !== next.fit\n\n if (displayWidthChanged || displayHeightChanged || fitChanged || textureChanged) {\n if (typeof next.displayWidth === 'number' && typeof next.displayHeight === 'number') {\n // Both specified - use fit mode\n const fit = next.fit ?? 'fill'\n\n if (fit === 'fill') {\n // Use setDisplaySize for fill mode (non-uniform scaling)\n sprite.setDisplaySize(next.displayWidth, next.displayHeight)\n } else {\n // Use setScale for contain/cover (uniform scaling)\n const { scaleX, scaleY } = calculateFitScale(\n sprite,\n next.displayWidth,\n next.displayHeight,\n fit\n )\n sprite.setScale(scaleX, scaleY)\n }\n } else if (typeof next.displayWidth === 'number') {\n // Only width - preserve aspect ratio (use original texture width)\n const { width: origWidth } = getOriginalTextureDimensions(sprite)\n const scale = next.displayWidth / origWidth\n sprite.setScale(scale)\n } else if (typeof next.displayHeight === 'number') {\n // Only height - preserve aspect ratio (use original texture height)\n const { height: origHeight } = getOriginalTextureDimensions(sprite)\n const scale = next.displayHeight / origHeight\n sprite.setScale(scale, scale)\n } else {\n // No display size specified - reset to default scale\n sprite.setScale(1)\n }\n }\n\n // Handle animation changes\n const animationChanged =\n prev.animationKey !== next.animationKey ||\n prev.loop !== next.loop ||\n prev.repeatDelay !== next.repeatDelay\n\n if (animationChanged) {\n // Stop previous animation if playing\n if (sprite.anims.isPlaying) {\n sprite.anims.stop()\n }\n\n // Play new animation if specified\n if (next.animationKey) {\n sprite.anims.play({\n key: next.animationKey,\n repeat: next.loop ? -1 : 0,\n repeatDelay: next.repeatDelay ?? 0,\n })\n }\n }\n\n // Update animation callbacks\n const callbacksChanged =\n prev.onAnimationStart !== next.onAnimationStart ||\n prev.onAnimationComplete !== next.onAnimationComplete ||\n prev.onAnimationRepeat !== next.onAnimationRepeat ||\n prev.onAnimationUpdate !== next.onAnimationUpdate\n\n if (callbacksChanged) {\n // Remove old listeners\n sprite.off('animationstart')\n sprite.off('animationcomplete')\n sprite.off('animationrepeat')\n sprite.off('animationupdate')\n\n // Add new listeners\n if (next.onAnimationStart) {\n sprite.on('animationstart', (anim: Phaser.Animations.Animation) => {\n next.onAnimationStart?.(anim.key)\n })\n }\n\n if (next.onAnimationComplete) {\n sprite.on('animationcomplete', (anim: Phaser.Animations.Animation) => {\n next.onAnimationComplete?.(anim.key)\n })\n }\n\n if (next.onAnimationRepeat) {\n sprite.on('animationrepeat', (anim: Phaser.Animations.Animation) => {\n next.onAnimationRepeat?.(anim.key)\n })\n }\n\n if (next.onAnimationUpdate) {\n sprite.on(\n 'animationupdate',\n (anim: Phaser.Animations.Animation, frame: Phaser.Animations.AnimationFrame) => {\n next.onAnimationUpdate?.(anim.key, frame)\n }\n )\n }\n }\n}\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function applySpriteLayout(sprite, _prev, next) {
4
+ sprite.__layoutProps = next;
5
+ }
6
+ exports.applySpriteLayout = applySpriteLayout;
7
+ //# sourceMappingURL=applySpriteLayout.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applySpriteLayout.cjs","sources":["../../../src/components/appliers/applySpriteLayout.ts"],"sourcesContent":["/**\n * Layout applier for Sprite components\n */\nimport type * as Phaser from 'phaser'\nimport type { LayoutProps } from '../../core-props'\nimport type { SpriteBaseProps } from '../primitives/sprite'\n\n/**\n * Applies layout props and updates layout size provider\n * Sprites are always headless (return minimal size)\n * @param sprite - Phaser Sprite object\n * @param _prev - Previous props (unused)\n * @param next - New props\n */\nexport function applySpriteLayout(\n sprite: Phaser.GameObjects.Sprite & {\n __layoutProps?: SpriteBaseProps\n },\n _prev: Partial<SpriteBaseProps & LayoutProps>,\n next: Partial<SpriteBaseProps & LayoutProps>\n): void {\n // Update layout props reference\n sprite.__layoutProps = next as SpriteBaseProps\n\n // Note: __getLayoutSize is set once in creator and never changes\n // Sprites are always headless (0.01x0.01)\n}\n"],"names":[],"mappings":";;AAcO,SAAS,kBACd,QAGA,OACA,MACM;AAEN,SAAO,gBAAgB;AAIzB;;"}
@@ -0,0 +1,17 @@
1
+ import { LayoutProps } from '../../core-props';
2
+ import { SpriteBaseProps } from '../primitives/sprite';
3
+ /**
4
+ * Layout applier for Sprite components
5
+ */
6
+ import type * as Phaser from 'phaser';
7
+ /**
8
+ * Applies layout props and updates layout size provider
9
+ * Sprites are always headless (return minimal size)
10
+ * @param sprite - Phaser Sprite object
11
+ * @param _prev - Previous props (unused)
12
+ * @param next - New props
13
+ */
14
+ export declare function applySpriteLayout(sprite: Phaser.GameObjects.Sprite & {
15
+ __layoutProps?: SpriteBaseProps;
16
+ }, _prev: Partial<SpriteBaseProps & LayoutProps>, next: Partial<SpriteBaseProps & LayoutProps>): void;
17
+ //# sourceMappingURL=applySpriteLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applySpriteLayout.d.ts","sourceRoot":"","sources":["../../../src/components/appliers/applySpriteLayout.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG;IAClC,aAAa,CAAC,EAAE,eAAe,CAAA;CAChC,EACD,KAAK,EAAE,OAAO,CAAC,eAAe,GAAG,WAAW,CAAC,EAC7C,IAAI,EAAE,OAAO,CAAC,eAAe,GAAG,WAAW,CAAC,GAC3C,IAAI,CAMN"}
@@ -0,0 +1,7 @@
1
+ function applySpriteLayout(sprite, _prev, next) {
2
+ sprite.__layoutProps = next;
3
+ }
4
+ export {
5
+ applySpriteLayout
6
+ };
7
+ //# sourceMappingURL=applySpriteLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applySpriteLayout.js","sources":["../../../src/components/appliers/applySpriteLayout.ts"],"sourcesContent":["/**\n * Layout applier for Sprite components\n */\nimport type * as Phaser from 'phaser'\nimport type { LayoutProps } from '../../core-props'\nimport type { SpriteBaseProps } from '../primitives/sprite'\n\n/**\n * Applies layout props and updates layout size provider\n * Sprites are always headless (return minimal size)\n * @param sprite - Phaser Sprite object\n * @param _prev - Previous props (unused)\n * @param next - New props\n */\nexport function applySpriteLayout(\n sprite: Phaser.GameObjects.Sprite & {\n __layoutProps?: SpriteBaseProps\n },\n _prev: Partial<SpriteBaseProps & LayoutProps>,\n next: Partial<SpriteBaseProps & LayoutProps>\n): void {\n // Update layout props reference\n sprite.__layoutProps = next as SpriteBaseProps\n\n // Note: __getLayoutSize is set once in creator and never changes\n // Sprites are always headless (0.01x0.01)\n}\n"],"names":[],"mappings":"AAcO,SAAS,kBACd,QAGA,OACA,MACM;AAEN,SAAO,gBAAgB;AAIzB;"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxCore = require("@number10/jsx-core");
4
+ const fastDeepEqual = require("../../utils/fast-deep-equal.cjs");
5
+ const RESETTABLE_TEXT_STYLE_DEFAULTS = {
6
+ fontStyle: "normal",
7
+ fontWeight: "normal"
8
+ };
9
+ function clampAlpha(value) {
10
+ if (!Number.isFinite(value)) return 1;
11
+ return Math.max(0, Math.min(1, value));
12
+ }
13
+ function parseTextBackgroundColor(value) {
14
+ if (typeof value === "number") {
15
+ const rgb = jsxCore.numberToRgb(value);
16
+ return { red: rgb.r, green: rgb.g, blue: rgb.b, alpha: 1 };
17
+ }
18
+ const normalized = value.trim();
19
+ if (normalized.length === 0) {
20
+ return null;
21
+ }
22
+ if (normalized.startsWith("#")) {
23
+ const hex = normalized.slice(1);
24
+ if (hex.length === 3 || hex.length === 4) {
25
+ const r = hex[0] ?? "0";
26
+ const g = hex[1] ?? "0";
27
+ const b = hex[2] ?? "0";
28
+ const a = hex[3] ?? "f";
29
+ return {
30
+ red: parseInt(r + r, 16),
31
+ green: parseInt(g + g, 16),
32
+ blue: parseInt(b + b, 16),
33
+ alpha: parseInt(a + a, 16) / 255
34
+ };
35
+ }
36
+ if (hex.length === 6 || hex.length === 8) {
37
+ return {
38
+ red: parseInt(hex.slice(0, 2), 16),
39
+ green: parseInt(hex.slice(2, 4), 16),
40
+ blue: parseInt(hex.slice(4, 6), 16),
41
+ alpha: hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1
42
+ };
43
+ }
44
+ }
45
+ const rgbaMatch = normalized.match(
46
+ /^rgba?\(\s*([0-9.]+)\s*,\s*([0-9.]+)\s*,\s*([0-9.]+)\s*(?:,\s*([0-9.]+)\s*)?\)$/i
47
+ );
48
+ if (rgbaMatch) {
49
+ return {
50
+ red: Math.max(0, Math.min(255, Number(rgbaMatch[1]))),
51
+ green: Math.max(0, Math.min(255, Number(rgbaMatch[2]))),
52
+ blue: Math.max(0, Math.min(255, Number(rgbaMatch[3]))),
53
+ alpha: clampAlpha(Number(rgbaMatch[4] ?? 1))
54
+ };
55
+ }
56
+ return null;
57
+ }
58
+ function normalizeTextStyleBackground(style, alphaValue) {
59
+ if (style === void 0 || alphaValue === void 0 || style.backgroundColor === void 0) {
60
+ return style;
61
+ }
62
+ const parsed = parseTextBackgroundColor(style.backgroundColor);
63
+ if (!parsed) {
64
+ return style;
65
+ }
66
+ const effectiveAlpha = clampAlpha(parsed.alpha * clampAlpha(alphaValue));
67
+ const colorNumber = parsed.red << 16 | parsed.green << 8 | parsed.blue;
68
+ return {
69
+ ...style,
70
+ backgroundColor: jsxCore.alpha(colorNumber, effectiveAlpha)
71
+ };
72
+ }
73
+ function getTextViewport(node) {
74
+ const surfaceViewport = node.__surfaceContext?.viewport;
75
+ if (typeof surfaceViewport?.width === "number" && typeof surfaceViewport?.height === "number") {
76
+ return surfaceViewport;
77
+ }
78
+ const width = node.scene?.scale?.width;
79
+ const height = node.scene?.scale?.height;
80
+ return {
81
+ width: typeof width === "number" ? width : 800,
82
+ height: typeof height === "number" ? height : 600
83
+ };
84
+ }
85
+ function normalizeResettableTextStyle(nextStyle, prevStyle) {
86
+ if (nextStyle === void 0) {
87
+ return void 0;
88
+ }
89
+ let resolvedStyle = nextStyle;
90
+ for (const key of Object.keys(RESETTABLE_TEXT_STYLE_DEFAULTS)) {
91
+ if (nextStyle[key] !== void 0 || prevStyle?.[key] === void 0) {
92
+ continue;
93
+ }
94
+ if (resolvedStyle === nextStyle) {
95
+ resolvedStyle = { ...nextStyle };
96
+ }
97
+ resolvedStyle[key] = RESETTABLE_TEXT_STYLE_DEFAULTS[key];
98
+ }
99
+ return resolvedStyle;
100
+ }
101
+ function applyTextProps(node, prev, next) {
102
+ if (node.active === false || node.scene && !node.scene.sys.game) {
103
+ return;
104
+ }
105
+ let needsUpdate = false;
106
+ if (prev.text !== next.text && typeof next.text === "string") {
107
+ node.setText(next.text);
108
+ needsUpdate = true;
109
+ }
110
+ const styleChanged = next.style !== void 0 && !fastDeepEqual(next.style, prev.style || {});
111
+ const alphaChanged = next.style?.backgroundColor !== void 0 && clampAlpha(next.alpha ?? 1) !== clampAlpha(prev.alpha ?? 1);
112
+ if (styleChanged || alphaChanged) {
113
+ try {
114
+ const resettableStyle = normalizeResettableTextStyle(next.style, prev.style);
115
+ const resolvedStyle = normalizeTextStyleBackground(resettableStyle, next.alpha);
116
+ if (resolvedStyle !== void 0) {
117
+ node.setStyle(resolvedStyle);
118
+ needsUpdate = true;
119
+ }
120
+ } catch (error) {
121
+ console.warn("Failed to apply text style (scene may be transitioning):", error);
122
+ }
123
+ }
124
+ if (next.maxWidth !== prev.maxWidth && next.maxWidth !== void 0) {
125
+ const viewport = getTextViewport(node);
126
+ const parsedMaxWidth = jsxCore.parseSize(next.maxWidth);
127
+ const resolvedMaxWidth = jsxCore.resolveSize(
128
+ parsedMaxWidth,
129
+ viewport.width,
130
+ void 0,
131
+ void 0,
132
+ viewport
133
+ );
134
+ node.setWordWrapWidth(resolvedMaxWidth, true);
135
+ needsUpdate = true;
136
+ }
137
+ if (needsUpdate && node.updateText) {
138
+ node.updateText();
139
+ }
140
+ }
141
+ exports.applyTextProps = applyTextProps;
142
+ //# sourceMappingURL=applyText.cjs.map