@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,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const svgTexture = require("./svg-texture.cjs");
4
+ class TextureRegistry {
5
+ // Map of scene -> textures in that scene
6
+ sceneTextures = /* @__PURE__ */ new Map();
7
+ /**
8
+ * Get or create texture map for a scene
9
+ */
10
+ getTextureMap(scene) {
11
+ let textures = this.sceneTextures.get(scene);
12
+ if (!textures) {
13
+ textures = /* @__PURE__ */ new Map();
14
+ this.sceneTextures.set(scene, textures);
15
+ }
16
+ return textures;
17
+ }
18
+ /**
19
+ * Request a texture in a specific scene, incrementing reference count
20
+ * Loads the texture if it's the first request in this scene
21
+ */
22
+ async requestTexture(scene, request) {
23
+ const { key } = request;
24
+ const textures = this.getTextureMap(scene);
25
+ let entry = textures.get(key);
26
+ if (!entry) {
27
+ entry = {
28
+ refCount: 0,
29
+ promise: null,
30
+ loaded: false
31
+ };
32
+ textures.set(key, entry);
33
+ }
34
+ entry.refCount++;
35
+ if (!entry.loaded && !entry.promise) {
36
+ entry.promise = svgTexture.svgToTexture(scene, request.key, request.svg, request.width, request.height).then(() => {
37
+ if (entry) {
38
+ entry.loaded = true;
39
+ entry.promise = null;
40
+ }
41
+ }).catch((err) => {
42
+ if (entry) {
43
+ entry.promise = null;
44
+ }
45
+ throw err;
46
+ });
47
+ }
48
+ if (entry.promise) {
49
+ await entry.promise;
50
+ }
51
+ }
52
+ /**
53
+ * Release a texture in a specific scene, decrementing reference count
54
+ * Removes the texture if reference count reaches zero
55
+ */
56
+ releaseTexture(scene, key) {
57
+ const textures = this.sceneTextures.get(scene);
58
+ if (!textures) return;
59
+ const entry = textures.get(key);
60
+ if (!entry) return;
61
+ entry.refCount--;
62
+ if (entry.refCount <= 0) {
63
+ if (scene.textures.exists(key)) {
64
+ scene.textures.remove(key);
65
+ }
66
+ textures.delete(key);
67
+ }
68
+ }
69
+ /**
70
+ * Check if a texture is loaded in a specific scene
71
+ */
72
+ isTextureLoaded(scene, key) {
73
+ const textures = this.sceneTextures.get(scene);
74
+ if (!textures) return false;
75
+ const entry = textures.get(key);
76
+ return entry?.loaded ?? false;
77
+ }
78
+ /**
79
+ * Get all loaded textures in a specific scene
80
+ */
81
+ getLoadedTextures(scene) {
82
+ const textures = this.sceneTextures.get(scene);
83
+ if (!textures) return [];
84
+ return Array.from(textures.entries()).filter(([, entry]) => entry.loaded).map(([key]) => key);
85
+ }
86
+ /**
87
+ * Release all textures in a specific scene
88
+ * Called automatically when scene shuts down
89
+ */
90
+ releaseScene(scene) {
91
+ const textures = this.sceneTextures.get(scene);
92
+ if (!textures) return;
93
+ for (const key of textures.keys()) {
94
+ if (scene.textures.exists(key)) {
95
+ scene.textures.remove(key);
96
+ }
97
+ }
98
+ this.sceneTextures.delete(scene);
99
+ }
100
+ /**
101
+ * Release all textures from all scenes
102
+ * Use with caution - removes all textures from all Phaser scenes
103
+ */
104
+ releaseAll() {
105
+ for (const [scene, textures] of this.sceneTextures.entries()) {
106
+ for (const key of textures.keys()) {
107
+ if (scene.textures.exists(key)) {
108
+ scene.textures.remove(key);
109
+ }
110
+ }
111
+ }
112
+ this.sceneTextures.clear();
113
+ }
114
+ }
115
+ const textureRegistry = new TextureRegistry();
116
+ exports.textureRegistry = textureRegistry;
117
+ //# sourceMappingURL=texture-registry.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"texture-registry.cjs","sources":["../../src/utils/texture-registry.ts"],"sourcesContent":["/**\n * Texture Registry for managing SVG texture loading and reference counting\n * Prevents race conditions when multiple components request the same texture\n */\nimport type * as Phaser from 'phaser'\nimport { svgToTexture } from './svg-texture'\n\ninterface TextureRequest {\n key: string\n svg: string\n width: number\n height: number\n}\n\ninterface TextureEntry {\n refCount: number\n promise: Promise<void> | null\n loaded: boolean\n}\n\n/**\n * Global texture registry to manage texture loading and cleanup\n * Uses reference counting per scene to ensure textures are only removed when no longer needed\n */\nclass TextureRegistry {\n // Map of scene -> textures in that scene\n private sceneTextures = new Map<Phaser.Scene, Map<string, TextureEntry>>()\n\n /**\n * Get or create texture map for a scene\n */\n private getTextureMap(scene: Phaser.Scene): Map<string, TextureEntry> {\n let textures = this.sceneTextures.get(scene)\n if (!textures) {\n textures = new Map()\n this.sceneTextures.set(scene, textures)\n }\n return textures\n }\n\n /**\n * Request a texture in a specific scene, incrementing reference count\n * Loads the texture if it's the first request in this scene\n */\n async requestTexture(scene: Phaser.Scene, request: TextureRequest): Promise<void> {\n const { key } = request\n const textures = this.getTextureMap(scene)\n let entry = textures.get(key)\n\n if (!entry) {\n // First request for this texture in this scene\n entry = {\n refCount: 0,\n promise: null,\n loaded: false,\n }\n textures.set(key, entry)\n }\n\n entry.refCount++\n\n if (!entry.loaded && !entry.promise) {\n // Start loading\n entry.promise = svgToTexture(scene, request.key, request.svg, request.width, request.height)\n .then(() => {\n if (entry) {\n entry.loaded = true\n entry.promise = null\n }\n })\n .catch((err) => {\n if (entry) {\n entry.promise = null\n }\n throw err\n })\n }\n\n // Wait for loading if in progress\n if (entry.promise) {\n await entry.promise\n }\n }\n\n /**\n * Release a texture in a specific scene, decrementing reference count\n * Removes the texture if reference count reaches zero\n */\n releaseTexture(scene: Phaser.Scene, key: string) {\n const textures = this.sceneTextures.get(scene)\n if (!textures) return\n\n const entry = textures.get(key)\n if (!entry) return\n\n entry.refCount--\n if (entry.refCount <= 0) {\n // No more references, remove texture\n if (scene.textures.exists(key)) {\n scene.textures.remove(key)\n }\n textures.delete(key)\n }\n }\n\n /**\n * Check if a texture is loaded in a specific scene\n */\n isTextureLoaded(scene: Phaser.Scene, key: string): boolean {\n const textures = this.sceneTextures.get(scene)\n if (!textures) return false\n const entry = textures.get(key)\n return entry?.loaded ?? false\n }\n\n /**\n * Get all loaded textures in a specific scene\n */\n getLoadedTextures(scene: Phaser.Scene): string[] {\n const textures = this.sceneTextures.get(scene)\n if (!textures) return []\n return Array.from(textures.entries())\n .filter(([, entry]) => entry.loaded)\n .map(([key]) => key)\n }\n\n /**\n * Release all textures in a specific scene\n * Called automatically when scene shuts down\n */\n releaseScene(scene: Phaser.Scene) {\n const textures = this.sceneTextures.get(scene)\n if (!textures) return\n\n for (const key of textures.keys()) {\n if (scene.textures.exists(key)) {\n scene.textures.remove(key)\n }\n }\n this.sceneTextures.delete(scene)\n }\n\n /**\n * Release all textures from all scenes\n * Use with caution - removes all textures from all Phaser scenes\n */\n releaseAll() {\n for (const [scene, textures] of this.sceneTextures.entries()) {\n for (const key of textures.keys()) {\n if (scene.textures.exists(key)) {\n scene.textures.remove(key)\n }\n }\n }\n this.sceneTextures.clear()\n }\n}\n\n// Global instance\nexport const textureRegistry = new TextureRegistry()\n"],"names":["svgToTexture"],"mappings":"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"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Texture Registry for managing SVG texture loading and reference counting
3
+ * Prevents race conditions when multiple components request the same texture
4
+ */
5
+ import type * as Phaser from 'phaser';
6
+ interface TextureRequest {
7
+ key: string;
8
+ svg: string;
9
+ width: number;
10
+ height: number;
11
+ }
12
+ /**
13
+ * Global texture registry to manage texture loading and cleanup
14
+ * Uses reference counting per scene to ensure textures are only removed when no longer needed
15
+ */
16
+ declare class TextureRegistry {
17
+ private sceneTextures;
18
+ /**
19
+ * Get or create texture map for a scene
20
+ */
21
+ private getTextureMap;
22
+ /**
23
+ * Request a texture in a specific scene, incrementing reference count
24
+ * Loads the texture if it's the first request in this scene
25
+ */
26
+ requestTexture(scene: Phaser.Scene, request: TextureRequest): Promise<void>;
27
+ /**
28
+ * Release a texture in a specific scene, decrementing reference count
29
+ * Removes the texture if reference count reaches zero
30
+ */
31
+ releaseTexture(scene: Phaser.Scene, key: string): void;
32
+ /**
33
+ * Check if a texture is loaded in a specific scene
34
+ */
35
+ isTextureLoaded(scene: Phaser.Scene, key: string): boolean;
36
+ /**
37
+ * Get all loaded textures in a specific scene
38
+ */
39
+ getLoadedTextures(scene: Phaser.Scene): string[];
40
+ /**
41
+ * Release all textures in a specific scene
42
+ * Called automatically when scene shuts down
43
+ */
44
+ releaseScene(scene: Phaser.Scene): void;
45
+ /**
46
+ * Release all textures from all scenes
47
+ * Use with caution - removes all textures from all Phaser scenes
48
+ */
49
+ releaseAll(): void;
50
+ }
51
+ export declare const textureRegistry: TextureRegistry;
52
+ export {};
53
+ //# sourceMappingURL=texture-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"texture-registry.d.ts","sourceRoot":"","sources":["../../src/utils/texture-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AAGrC,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAQD;;;GAGG;AACH,cAAM,eAAe;IAEnB,OAAO,CAAC,aAAa,CAAqD;IAE1E;;OAEG;IACH,OAAO,CAAC,aAAa;IASrB;;;OAGG;IACG,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCjF;;;OAGG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM;IAiB/C;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAO1D;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,MAAM,EAAE;IAQhD;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK;IAYhC;;;OAGG;IACH,UAAU;CAUX;AAGD,eAAO,MAAM,eAAe,iBAAwB,CAAA"}
@@ -0,0 +1,117 @@
1
+ import { svgToTexture } from "./svg-texture.js";
2
+ class TextureRegistry {
3
+ // Map of scene -> textures in that scene
4
+ sceneTextures = /* @__PURE__ */ new Map();
5
+ /**
6
+ * Get or create texture map for a scene
7
+ */
8
+ getTextureMap(scene) {
9
+ let textures = this.sceneTextures.get(scene);
10
+ if (!textures) {
11
+ textures = /* @__PURE__ */ new Map();
12
+ this.sceneTextures.set(scene, textures);
13
+ }
14
+ return textures;
15
+ }
16
+ /**
17
+ * Request a texture in a specific scene, incrementing reference count
18
+ * Loads the texture if it's the first request in this scene
19
+ */
20
+ async requestTexture(scene, request) {
21
+ const { key } = request;
22
+ const textures = this.getTextureMap(scene);
23
+ let entry = textures.get(key);
24
+ if (!entry) {
25
+ entry = {
26
+ refCount: 0,
27
+ promise: null,
28
+ loaded: false
29
+ };
30
+ textures.set(key, entry);
31
+ }
32
+ entry.refCount++;
33
+ if (!entry.loaded && !entry.promise) {
34
+ entry.promise = svgToTexture(scene, request.key, request.svg, request.width, request.height).then(() => {
35
+ if (entry) {
36
+ entry.loaded = true;
37
+ entry.promise = null;
38
+ }
39
+ }).catch((err) => {
40
+ if (entry) {
41
+ entry.promise = null;
42
+ }
43
+ throw err;
44
+ });
45
+ }
46
+ if (entry.promise) {
47
+ await entry.promise;
48
+ }
49
+ }
50
+ /**
51
+ * Release a texture in a specific scene, decrementing reference count
52
+ * Removes the texture if reference count reaches zero
53
+ */
54
+ releaseTexture(scene, key) {
55
+ const textures = this.sceneTextures.get(scene);
56
+ if (!textures) return;
57
+ const entry = textures.get(key);
58
+ if (!entry) return;
59
+ entry.refCount--;
60
+ if (entry.refCount <= 0) {
61
+ if (scene.textures.exists(key)) {
62
+ scene.textures.remove(key);
63
+ }
64
+ textures.delete(key);
65
+ }
66
+ }
67
+ /**
68
+ * Check if a texture is loaded in a specific scene
69
+ */
70
+ isTextureLoaded(scene, key) {
71
+ const textures = this.sceneTextures.get(scene);
72
+ if (!textures) return false;
73
+ const entry = textures.get(key);
74
+ return entry?.loaded ?? false;
75
+ }
76
+ /**
77
+ * Get all loaded textures in a specific scene
78
+ */
79
+ getLoadedTextures(scene) {
80
+ const textures = this.sceneTextures.get(scene);
81
+ if (!textures) return [];
82
+ return Array.from(textures.entries()).filter(([, entry]) => entry.loaded).map(([key]) => key);
83
+ }
84
+ /**
85
+ * Release all textures in a specific scene
86
+ * Called automatically when scene shuts down
87
+ */
88
+ releaseScene(scene) {
89
+ const textures = this.sceneTextures.get(scene);
90
+ if (!textures) return;
91
+ for (const key of textures.keys()) {
92
+ if (scene.textures.exists(key)) {
93
+ scene.textures.remove(key);
94
+ }
95
+ }
96
+ this.sceneTextures.delete(scene);
97
+ }
98
+ /**
99
+ * Release all textures from all scenes
100
+ * Use with caution - removes all textures from all Phaser scenes
101
+ */
102
+ releaseAll() {
103
+ for (const [scene, textures] of this.sceneTextures.entries()) {
104
+ for (const key of textures.keys()) {
105
+ if (scene.textures.exists(key)) {
106
+ scene.textures.remove(key);
107
+ }
108
+ }
109
+ }
110
+ this.sceneTextures.clear();
111
+ }
112
+ }
113
+ const textureRegistry = new TextureRegistry();
114
+ export {
115
+ textureRegistry
116
+ };
117
+ //# sourceMappingURL=texture-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"texture-registry.js","sources":["../../src/utils/texture-registry.ts"],"sourcesContent":["/**\n * Texture Registry for managing SVG texture loading and reference counting\n * Prevents race conditions when multiple components request the same texture\n */\nimport type * as Phaser from 'phaser'\nimport { svgToTexture } from './svg-texture'\n\ninterface TextureRequest {\n key: string\n svg: string\n width: number\n height: number\n}\n\ninterface TextureEntry {\n refCount: number\n promise: Promise<void> | null\n loaded: boolean\n}\n\n/**\n * Global texture registry to manage texture loading and cleanup\n * Uses reference counting per scene to ensure textures are only removed when no longer needed\n */\nclass TextureRegistry {\n // Map of scene -> textures in that scene\n private sceneTextures = new Map<Phaser.Scene, Map<string, TextureEntry>>()\n\n /**\n * Get or create texture map for a scene\n */\n private getTextureMap(scene: Phaser.Scene): Map<string, TextureEntry> {\n let textures = this.sceneTextures.get(scene)\n if (!textures) {\n textures = new Map()\n this.sceneTextures.set(scene, textures)\n }\n return textures\n }\n\n /**\n * Request a texture in a specific scene, incrementing reference count\n * Loads the texture if it's the first request in this scene\n */\n async requestTexture(scene: Phaser.Scene, request: TextureRequest): Promise<void> {\n const { key } = request\n const textures = this.getTextureMap(scene)\n let entry = textures.get(key)\n\n if (!entry) {\n // First request for this texture in this scene\n entry = {\n refCount: 0,\n promise: null,\n loaded: false,\n }\n textures.set(key, entry)\n }\n\n entry.refCount++\n\n if (!entry.loaded && !entry.promise) {\n // Start loading\n entry.promise = svgToTexture(scene, request.key, request.svg, request.width, request.height)\n .then(() => {\n if (entry) {\n entry.loaded = true\n entry.promise = null\n }\n })\n .catch((err) => {\n if (entry) {\n entry.promise = null\n }\n throw err\n })\n }\n\n // Wait for loading if in progress\n if (entry.promise) {\n await entry.promise\n }\n }\n\n /**\n * Release a texture in a specific scene, decrementing reference count\n * Removes the texture if reference count reaches zero\n */\n releaseTexture(scene: Phaser.Scene, key: string) {\n const textures = this.sceneTextures.get(scene)\n if (!textures) return\n\n const entry = textures.get(key)\n if (!entry) return\n\n entry.refCount--\n if (entry.refCount <= 0) {\n // No more references, remove texture\n if (scene.textures.exists(key)) {\n scene.textures.remove(key)\n }\n textures.delete(key)\n }\n }\n\n /**\n * Check if a texture is loaded in a specific scene\n */\n isTextureLoaded(scene: Phaser.Scene, key: string): boolean {\n const textures = this.sceneTextures.get(scene)\n if (!textures) return false\n const entry = textures.get(key)\n return entry?.loaded ?? false\n }\n\n /**\n * Get all loaded textures in a specific scene\n */\n getLoadedTextures(scene: Phaser.Scene): string[] {\n const textures = this.sceneTextures.get(scene)\n if (!textures) return []\n return Array.from(textures.entries())\n .filter(([, entry]) => entry.loaded)\n .map(([key]) => key)\n }\n\n /**\n * Release all textures in a specific scene\n * Called automatically when scene shuts down\n */\n releaseScene(scene: Phaser.Scene) {\n const textures = this.sceneTextures.get(scene)\n if (!textures) return\n\n for (const key of textures.keys()) {\n if (scene.textures.exists(key)) {\n scene.textures.remove(key)\n }\n }\n this.sceneTextures.delete(scene)\n }\n\n /**\n * Release all textures from all scenes\n * Use with caution - removes all textures from all Phaser scenes\n */\n releaseAll() {\n for (const [scene, textures] of this.sceneTextures.entries()) {\n for (const key of textures.keys()) {\n if (scene.textures.exists(key)) {\n scene.textures.remove(key)\n }\n }\n }\n this.sceneTextures.clear()\n }\n}\n\n// Global instance\nexport const textureRegistry = new TextureRegistry()\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ import { HostNode, LayoutContainer, SurfaceTarget } from '@number10/jsx-core';
2
+ export type MountedHostNode = HostNode & {
3
+ scene?: SurfaceTarget;
4
+ parentContainer?: MountedHostContainer | null;
5
+ };
6
+ export type MountedHostContainer = MountedHostNode & LayoutContainer & {
7
+ list?: unknown[];
8
+ getAll?: () => unknown[];
9
+ remove?: (child: unknown, destroyChild?: boolean) => void;
10
+ };
11
+ export type MountTarget = SurfaceTarget | MountedHostNode;
12
+ //# sourceMappingURL=vdom-host-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vdom-host-types.d.ts","sourceRoot":"","sources":["../src/vdom-host-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElF,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG;IACvC,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,eAAe,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAA;CAC9C,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAChD,eAAe,GAAG;IAChB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,OAAO,EAAE,CAAA;IACxB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;CAC1D,CAAA;AAEH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,eAAe,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { HostAdapter, SurfaceAdapter } from '@number10/jsx-core';
2
+ export declare const mountRegistry: {
3
+ register(entry: Omit<import('@number10/jsx-core').MountRegistryEntry, "id">): number;
4
+ unregister(id: number): void;
5
+ findByParentAndKey(parent: import('@number10/jsx-core').HostParent, key?: string): import('@number10/jsx-core').MountRegistryEntry | undefined;
6
+ getAllEntries(): import('@number10/jsx-core').MountRegistryEntry[];
7
+ getEntry(id: number): import('@number10/jsx-core').MountRegistryEntry | undefined;
8
+ clear(): void;
9
+ };
10
+ export declare function setHostAdapter(adapter: HostAdapter): HostAdapter;
11
+ export declare function getHostAdapter(): HostAdapter;
12
+ export declare function setSurfaceAdapter(adapter: SurfaceAdapter): SurfaceAdapter;
13
+ export declare function getSurfaceAdapter(): SurfaceAdapter;
14
+ export declare function getMountStats(): {
15
+ totalMounts: number;
16
+ byType: Map<string, number>;
17
+ byParent: Map<import('@number10/jsx-core').HostParent, number>;
18
+ byKey: Map<string, number>;
19
+ mounts: Array<{
20
+ id: number;
21
+ type: string;
22
+ key?: string;
23
+ parentType: string;
24
+ propsKeys: string[];
25
+ }>;
26
+ };
27
+ //# sourceMappingURL=vdom-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vdom-registry.d.ts","sourceRoot":"","sources":["../src/vdom-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGrE,eAAO,MAAM,aAAa;;;;;;;CAAkC,CAAA;AAE5D,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,CAEhE;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAEzE;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAElD;AAED,wBAAgB,aAAa;;;;;;;;WAG62D,CAAC;;;;EAD14D"}
@@ -0,0 +1,16 @@
1
+ import { VNode } from './hooks';
2
+ import { VNodeLike } from './types';
3
+ /**
4
+ * Normalizes a component return into a single VNode or null.
5
+ * Wraps arrays into a Fragment VNode for consistent mounting.
6
+ */
7
+ export declare function normalizeVNodeLike(rendered: VNodeLike): VNode | null;
8
+ /**
9
+ * Creates a VNode element (alternative to JSX)
10
+ * @param type - Element type (string or component)
11
+ * @param props - Element props
12
+ * @param children - Child elements
13
+ * @returns VNode object
14
+ */
15
+ export declare function createElement(type: string | ((props: Record<string, unknown>) => VNode), props: Record<string, unknown> | null, ...children: VNode[]): VNode;
16
+ //# sourceMappingURL=vdom-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vdom-utils.d.ts","sourceRoot":"","sources":["../src/vdom-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,KAAK,GAAG,IAAI,CAOpE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,KAAK,CAAC,EAC1D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACrC,GAAG,QAAQ,EAAE,KAAK,EAAE,GACnB,KAAK,CAGP"}
package/dist/vdom.cjs ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const phaserVdomRuntime = require("./phaser-vdom-runtime.cjs");
4
+ const {
5
+ createElement,
6
+ getHostAdapter,
7
+ getMountStats,
8
+ getSurfaceAdapter,
9
+ mount,
10
+ normalizeVNodeLike,
11
+ patchVNode,
12
+ remountAll,
13
+ setHostAdapter,
14
+ setSurfaceAdapter,
15
+ unmount
16
+ } = phaserVdomRuntime.phaserVDOMRuntime;
17
+ function mountJSX(parentOrScene, type, props = { width: 0, height: 0 }) {
18
+ return phaserVdomRuntime.phaserVDOMRuntime.mountJSX(parentOrScene, type, props);
19
+ }
20
+ function unmountJSX(target) {
21
+ phaserVdomRuntime.phaserVDOMRuntime.unmountJSX(target);
22
+ }
23
+ exports.createElement = createElement;
24
+ exports.getHostAdapter = getHostAdapter;
25
+ exports.getMountStats = getMountStats;
26
+ exports.getSurfaceAdapter = getSurfaceAdapter;
27
+ exports.mount = mount;
28
+ exports.mountJSX = mountJSX;
29
+ exports.normalizeVNodeLike = normalizeVNodeLike;
30
+ exports.patchVNode = patchVNode;
31
+ exports.remountAll = remountAll;
32
+ exports.setHostAdapter = setHostAdapter;
33
+ exports.setSurfaceAdapter = setSurfaceAdapter;
34
+ exports.unmount = unmount;
35
+ exports.unmountJSX = unmountJSX;
36
+ //# sourceMappingURL=vdom.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vdom.cjs","sources":["../src/vdom.ts"],"sourcesContent":["/**\n * Shared VDOM runtime bound to Phaser bridges.\n * The VDOM implementation lives in @number10/jsx-core; this file only wires\n * Phaser-specific theme/surface/layout behavior into the generic runtime.\n */\nimport type { MountComponentProps, MountHandle, MountProps } from '@number10/jsx-core/vdom'\nimport type { NodeProps, NodeType } from './core-types'\nimport { phaserVDOMRuntime } from './phaser-vdom-runtime'\nimport type { ParentType, VNodeLike } from './types'\nimport type { MountTarget } from './vdom-host-types'\n\nexport type { VNodeLike } from './types'\n\nexport const {\n createElement,\n getHostAdapter,\n getMountStats,\n getSurfaceAdapter,\n mount,\n normalizeVNodeLike,\n patchVNode,\n remountAll,\n setHostAdapter,\n setSurfaceAdapter,\n unmount,\n} = phaserVDOMRuntime\n\nexport type { MountComponentProps, MountHandle, MountProps }\n\nexport function mountJSX<T extends NodeType>(\n parentOrScene: ParentType,\n type: T,\n props: MountComponentProps<NodeProps<T>>\n): MountHandle\n\nexport function mountJSX<P = Record<string, never>>(\n parentOrScene: ParentType,\n type: (props: P & MountProps) => VNodeLike,\n props: MountComponentProps<P>\n): MountHandle\n\nexport function mountJSX(\n parentOrScene: ParentType,\n type: NodeType | ((props: unknown) => VNodeLike),\n props: MountProps & Record<string, unknown> = { width: 0, height: 0 }\n): MountHandle {\n return phaserVDOMRuntime.mountJSX(parentOrScene, type, props)\n}\n\nexport function unmountJSX(target: MountTarget): void {\n phaserVDOMRuntime.unmountJSX(target)\n}\n"],"names":["phaserVDOMRuntime"],"mappings":";;;AAaO,MAAM;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAIA,kBAAAA;AAgBG,SAAS,SACd,eACA,MACA,QAA8C,EAAE,OAAO,GAAG,QAAQ,KACrD;AACb,SAAOA,kBAAAA,kBAAkB,SAAS,eAAe,MAAM,KAAK;AAC9D;AAEO,SAAS,WAAW,QAA2B;AACpDA,oBAAAA,kBAAkB,WAAW,MAAM;AACrC;;;;;;;;;;;;;;"}
package/dist/vdom.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { MountComponentProps, MountHandle, MountProps } from '@number10/jsx-core/vdom';
2
+ import { NodeProps, NodeType } from './core-types';
3
+ import { ParentType, VNodeLike } from './types';
4
+ import { MountTarget } from './vdom-host-types';
5
+ export type { VNodeLike } from './types';
6
+ export declare const createElement: (type: string | ((props: Record<string, unknown>) => import('@number10/jsx-core').VNode), props: Record<string, unknown> | null, ...children: import('@number10/jsx-core').VNode[]) => import('@number10/jsx-core').VNode, getHostAdapter: () => import('@number10/jsx-core').HostAdapter, getMountStats: () => ReturnType<(hostAdapter: import('@number10/jsx-core').HostAdapter) => {
7
+ totalMounts: number;
8
+ byType: Map<string, number>;
9
+ byParent: Map<import('@number10/jsx-core').HostParent, number>;
10
+ byKey: Map<string, number>;
11
+ mounts: Array<{
12
+ id: number;
13
+ type: string;
14
+ key?: string;
15
+ parentType: string;
16
+ propsKeys: string[];
17
+ }>;
18
+ }>, getSurfaceAdapter: () => import('@number10/jsx-core').SurfaceAdapter, mount: (parent: import('@number10/jsx-core').HostParent, vnode: import('@number10/jsx-core').VNode) => import('@number10/jsx-core').HostNode, normalizeVNodeLike: (rendered: VNodeLike) => import('@number10/jsx-core').VNode | null, patchVNode: (parent: import('@number10/jsx-core').HostParent, oldV: import('@number10/jsx-core').VNode | null, newV: import('@number10/jsx-core').VNode | null) => void, remountAll: () => void, setHostAdapter: (adapter: import('@number10/jsx-core').HostAdapter) => import('@number10/jsx-core').HostAdapter, setSurfaceAdapter: (adapter: import('@number10/jsx-core').SurfaceAdapter) => import('@number10/jsx-core').SurfaceAdapter, unmount: (vnode: import('@number10/jsx-core').VNode | null | undefined | false) => void;
19
+ export type { MountComponentProps, MountHandle, MountProps };
20
+ export declare function mountJSX<T extends NodeType>(parentOrScene: ParentType, type: T, props: MountComponentProps<NodeProps<T>>): MountHandle;
21
+ export declare function mountJSX<P = Record<string, never>>(parentOrScene: ParentType, type: (props: P & MountProps) => VNodeLike, props: MountComponentProps<P>): MountHandle;
22
+ export declare function unmountJSX(target: MountTarget): void;
23
+ //# sourceMappingURL=vdom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vdom.d.ts","sourceRoot":"","sources":["../src/vdom.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,eAAO,MACL,aAAa,6NACb,cAAc,kDACd,aAAa;;;;;;;;WAoC0lC,CAAC;;;;IAnCxmC,iBAAiB,qDACjB,KAAK,yIACL,kBAAkB,sEAClB,UAAU,+JACV,UAAU,cACV,cAAc,mGACd,iBAAiB,yGACjB,OAAO,gFACY,CAAA;AAErB,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,EAAE,CAAA;AAE5D,wBAAgB,QAAQ,CAAC,CAAC,SAAS,QAAQ,EACzC,aAAa,EAAE,UAAU,EACzB,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GACvC,WAAW,CAAA;AAEd,wBAAgB,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAChD,aAAa,EAAE,UAAU,EACzB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,UAAU,KAAK,SAAS,EAC1C,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC5B,WAAW,CAAA;AAUd,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAEpD"}
package/dist/vdom.js ADDED
@@ -0,0 +1,36 @@
1
+ import { phaserVDOMRuntime } from "./phaser-vdom-runtime.js";
2
+ const {
3
+ createElement,
4
+ getHostAdapter,
5
+ getMountStats,
6
+ getSurfaceAdapter,
7
+ mount,
8
+ normalizeVNodeLike,
9
+ patchVNode,
10
+ remountAll,
11
+ setHostAdapter,
12
+ setSurfaceAdapter,
13
+ unmount
14
+ } = phaserVDOMRuntime;
15
+ function mountJSX(parentOrScene, type, props = { width: 0, height: 0 }) {
16
+ return phaserVDOMRuntime.mountJSX(parentOrScene, type, props);
17
+ }
18
+ function unmountJSX(target) {
19
+ phaserVDOMRuntime.unmountJSX(target);
20
+ }
21
+ export {
22
+ createElement,
23
+ getHostAdapter,
24
+ getMountStats,
25
+ getSurfaceAdapter,
26
+ mount,
27
+ mountJSX,
28
+ normalizeVNodeLike,
29
+ patchVNode,
30
+ remountAll,
31
+ setHostAdapter,
32
+ setSurfaceAdapter,
33
+ unmount,
34
+ unmountJSX
35
+ };
36
+ //# sourceMappingURL=vdom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vdom.js","sources":["../src/vdom.ts"],"sourcesContent":["/**\n * Shared VDOM runtime bound to Phaser bridges.\n * The VDOM implementation lives in @number10/jsx-core; this file only wires\n * Phaser-specific theme/surface/layout behavior into the generic runtime.\n */\nimport type { MountComponentProps, MountHandle, MountProps } from '@number10/jsx-core/vdom'\nimport type { NodeProps, NodeType } from './core-types'\nimport { phaserVDOMRuntime } from './phaser-vdom-runtime'\nimport type { ParentType, VNodeLike } from './types'\nimport type { MountTarget } from './vdom-host-types'\n\nexport type { VNodeLike } from './types'\n\nexport const {\n createElement,\n getHostAdapter,\n getMountStats,\n getSurfaceAdapter,\n mount,\n normalizeVNodeLike,\n patchVNode,\n remountAll,\n setHostAdapter,\n setSurfaceAdapter,\n unmount,\n} = phaserVDOMRuntime\n\nexport type { MountComponentProps, MountHandle, MountProps }\n\nexport function mountJSX<T extends NodeType>(\n parentOrScene: ParentType,\n type: T,\n props: MountComponentProps<NodeProps<T>>\n): MountHandle\n\nexport function mountJSX<P = Record<string, never>>(\n parentOrScene: ParentType,\n type: (props: P & MountProps) => VNodeLike,\n props: MountComponentProps<P>\n): MountHandle\n\nexport function mountJSX(\n parentOrScene: ParentType,\n type: NodeType | ((props: unknown) => VNodeLike),\n props: MountProps & Record<string, unknown> = { width: 0, height: 0 }\n): MountHandle {\n return phaserVDOMRuntime.mountJSX(parentOrScene, type, props)\n}\n\nexport function unmountJSX(target: MountTarget): void {\n phaserVDOMRuntime.unmountJSX(target)\n}\n"],"names":[],"mappings":";AAaO,MAAM;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAI;AAgBG,SAAS,SACd,eACA,MACA,QAA8C,EAAE,OAAO,GAAG,QAAQ,KACrD;AACb,SAAO,kBAAkB,SAAS,eAAe,MAAM,KAAK;AAC9D;AAEO,SAAS,WAAW,QAA2B;AACpD,oBAAkB,WAAW,MAAM;AACrC;"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ class PhaserVectorDrawContext {
4
+ constructor(graphics) {
5
+ this.graphics = graphics;
6
+ }
7
+ graphics;
8
+ clear() {
9
+ this.graphics.clear();
10
+ return this;
11
+ }
12
+ fillStyle(color, alpha = 1) {
13
+ this.graphics.fillStyle(color, alpha);
14
+ return this;
15
+ }
16
+ lineStyle(width, color, alpha = 1) {
17
+ this.graphics.lineStyle(width, color, alpha);
18
+ return this;
19
+ }
20
+ arc(x, y, radius, startAngle, endAngle, anticlockwise) {
21
+ this.graphics.arc(x, y, radius, startAngle, endAngle, anticlockwise);
22
+ return this;
23
+ }
24
+ fillCircle(x, y, radius) {
25
+ this.graphics.fillCircle(x, y, radius);
26
+ return this;
27
+ }
28
+ strokeCircle(x, y, radius) {
29
+ this.graphics.strokeCircle(x, y, radius);
30
+ return this;
31
+ }
32
+ fillRect(x, y, width, height) {
33
+ this.graphics.fillRect(x, y, width, height);
34
+ return this;
35
+ }
36
+ strokeRect(x, y, width, height) {
37
+ this.graphics.strokeRect(x, y, width, height);
38
+ return this;
39
+ }
40
+ fillRoundedRect(x, y, width, height, radius) {
41
+ this.graphics.fillRoundedRect(x, y, width, height, radius);
42
+ return this;
43
+ }
44
+ strokeRoundedRect(x, y, width, height, radius) {
45
+ this.graphics.strokeRoundedRect(x, y, width, height, radius);
46
+ return this;
47
+ }
48
+ beginPath() {
49
+ this.graphics.beginPath();
50
+ return this;
51
+ }
52
+ moveTo(x, y) {
53
+ this.graphics.moveTo(x, y);
54
+ return this;
55
+ }
56
+ lineTo(x, y) {
57
+ this.graphics.lineTo(x, y);
58
+ return this;
59
+ }
60
+ closePath() {
61
+ this.graphics.closePath();
62
+ return this;
63
+ }
64
+ fillPath() {
65
+ this.graphics.fillPath();
66
+ return this;
67
+ }
68
+ strokePath() {
69
+ this.graphics.strokePath();
70
+ return this;
71
+ }
72
+ lineBetween(x1, y1, x2, y2) {
73
+ this.graphics.lineBetween(x1, y1, x2, y2);
74
+ return this;
75
+ }
76
+ fillCircleStyled(x, y, radius, color, alpha) {
77
+ this.graphics.fillStyle(color, alpha);
78
+ this.graphics.fillCircle(x, y, radius);
79
+ return this;
80
+ }
81
+ strokeLine(x1, y1, x2, y2, width, color, alpha) {
82
+ this.graphics.lineStyle(width, color, alpha);
83
+ this.graphics.lineBetween(x1, y1, x2, y2);
84
+ return this;
85
+ }
86
+ fillArc(cx, cy, r, startAngle, endAngle, color, alpha) {
87
+ this.graphics.fillStyle(color, alpha);
88
+ this.graphics.beginPath();
89
+ this.graphics.moveTo(cx, cy);
90
+ this.graphics.arc(cx, cy, r, startAngle, endAngle);
91
+ this.graphics.closePath();
92
+ this.graphics.fillPath();
93
+ return this;
94
+ }
95
+ }
96
+ exports.PhaserVectorDrawContext = PhaserVectorDrawContext;
97
+ //# sourceMappingURL=PhaserVectorDrawContext.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhaserVectorDrawContext.cjs","sources":["../../src/vector/PhaserVectorDrawContext.ts"],"sourcesContent":["import type { VectorDrawContext } from '@number10/jsx-core'\nimport type * as Phaser from 'phaser'\n\nexport class PhaserVectorDrawContext implements VectorDrawContext {\n constructor(readonly graphics: Phaser.GameObjects.Graphics) {}\n\n clear(): this {\n this.graphics.clear()\n return this\n }\n\n fillStyle(color: number, alpha = 1): this {\n this.graphics.fillStyle(color, alpha)\n return this\n }\n\n lineStyle(width: number, color: number, alpha = 1): this {\n this.graphics.lineStyle(width, color, alpha)\n return this\n }\n\n arc(\n x: number,\n y: number,\n radius: number,\n startAngle: number,\n endAngle: number,\n anticlockwise?: boolean\n ): this {\n this.graphics.arc(x, y, radius, startAngle, endAngle, anticlockwise)\n return this\n }\n\n fillCircle(x: number, y: number, radius: number): this {\n this.graphics.fillCircle(x, y, radius)\n return this\n }\n\n strokeCircle(x: number, y: number, radius: number): this {\n this.graphics.strokeCircle(x, y, radius)\n return this\n }\n\n fillRect(x: number, y: number, width: number, height: number): this {\n this.graphics.fillRect(x, y, width, height)\n return this\n }\n\n strokeRect(x: number, y: number, width: number, height: number): this {\n this.graphics.strokeRect(x, y, width, height)\n return this\n }\n\n fillRoundedRect(x: number, y: number, width: number, height: number, radius: number): this {\n this.graphics.fillRoundedRect(x, y, width, height, radius)\n return this\n }\n\n strokeRoundedRect(x: number, y: number, width: number, height: number, radius: number): this {\n this.graphics.strokeRoundedRect(x, y, width, height, radius)\n return this\n }\n\n beginPath(): this {\n this.graphics.beginPath()\n return this\n }\n\n moveTo(x: number, y: number): this {\n this.graphics.moveTo(x, y)\n return this\n }\n\n lineTo(x: number, y: number): this {\n this.graphics.lineTo(x, y)\n return this\n }\n\n closePath(): this {\n this.graphics.closePath()\n return this\n }\n\n fillPath(): this {\n this.graphics.fillPath()\n return this\n }\n\n strokePath(): this {\n this.graphics.strokePath()\n return this\n }\n\n lineBetween(x1: number, y1: number, x2: number, y2: number): this {\n this.graphics.lineBetween(x1, y1, x2, y2)\n return this\n }\n\n fillCircleStyled(x: number, y: number, radius: number, color: number, alpha: number): this {\n this.graphics.fillStyle(color, alpha)\n this.graphics.fillCircle(x, y, radius)\n return this\n }\n\n strokeLine(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n width: number,\n color: number,\n alpha: number\n ): this {\n this.graphics.lineStyle(width, color, alpha)\n this.graphics.lineBetween(x1, y1, x2, y2)\n return this\n }\n\n fillArc(\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n color: number,\n alpha: number\n ): this {\n this.graphics.fillStyle(color, alpha)\n this.graphics.beginPath()\n this.graphics.moveTo(cx, cy)\n this.graphics.arc(cx, cy, r, startAngle, endAngle)\n this.graphics.closePath()\n this.graphics.fillPath()\n return this\n }\n}\n"],"names":[],"mappings":";;AAGO,MAAM,wBAAqD;AAAA,EAChE,YAAqB,UAAuC;AAAvC,SAAA,WAAA;AAAA,EAAwC;AAAA,EAAxC;AAAA,EAErB,QAAc;AACZ,SAAK,SAAS,MAAA;AACd,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,OAAe,QAAQ,GAAS;AACxC,SAAK,SAAS,UAAU,OAAO,KAAK;AACpC,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,OAAe,OAAe,QAAQ,GAAS;AACvD,SAAK,SAAS,UAAU,OAAO,OAAO,KAAK;AAC3C,WAAO;AAAA,EACT;AAAA,EAEA,IACE,GACA,GACA,QACA,YACA,UACA,eACM;AACN,SAAK,SAAS,IAAI,GAAG,GAAG,QAAQ,YAAY,UAAU,aAAa;AACnE,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,GAAW,GAAW,QAAsB;AACrD,SAAK,SAAS,WAAW,GAAG,GAAG,MAAM;AACrC,WAAO;AAAA,EACT;AAAA,EAEA,aAAa,GAAW,GAAW,QAAsB;AACvD,SAAK,SAAS,aAAa,GAAG,GAAG,MAAM;AACvC,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,GAAW,GAAW,OAAe,QAAsB;AAClE,SAAK,SAAS,SAAS,GAAG,GAAG,OAAO,MAAM;AAC1C,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,GAAW,GAAW,OAAe,QAAsB;AACpE,SAAK,SAAS,WAAW,GAAG,GAAG,OAAO,MAAM;AAC5C,WAAO;AAAA,EACT;AAAA,EAEA,gBAAgB,GAAW,GAAW,OAAe,QAAgB,QAAsB;AACzF,SAAK,SAAS,gBAAgB,GAAG,GAAG,OAAO,QAAQ,MAAM;AACzD,WAAO;AAAA,EACT;AAAA,EAEA,kBAAkB,GAAW,GAAW,OAAe,QAAgB,QAAsB;AAC3F,SAAK,SAAS,kBAAkB,GAAG,GAAG,OAAO,QAAQ,MAAM;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,YAAkB;AAChB,SAAK,SAAS,UAAA;AACd,WAAO;AAAA,EACT;AAAA,EAEA,OAAO,GAAW,GAAiB;AACjC,SAAK,SAAS,OAAO,GAAG,CAAC;AACzB,WAAO;AAAA,EACT;AAAA,EAEA,OAAO,GAAW,GAAiB;AACjC,SAAK,SAAS,OAAO,GAAG,CAAC;AACzB,WAAO;AAAA,EACT;AAAA,EAEA,YAAkB;AAChB,SAAK,SAAS,UAAA;AACd,WAAO;AAAA,EACT;AAAA,EAEA,WAAiB;AACf,SAAK,SAAS,SAAA;AACd,WAAO;AAAA,EACT;AAAA,EAEA,aAAmB;AACjB,SAAK,SAAS,WAAA;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,IAAY,IAAY,IAAY,IAAkB;AAChE,SAAK,SAAS,YAAY,IAAI,IAAI,IAAI,EAAE;AACxC,WAAO;AAAA,EACT;AAAA,EAEA,iBAAiB,GAAW,GAAW,QAAgB,OAAe,OAAqB;AACzF,SAAK,SAAS,UAAU,OAAO,KAAK;AACpC,SAAK,SAAS,WAAW,GAAG,GAAG,MAAM;AACrC,WAAO;AAAA,EACT;AAAA,EAEA,WACE,IACA,IACA,IACA,IACA,OACA,OACA,OACM;AACN,SAAK,SAAS,UAAU,OAAO,OAAO,KAAK;AAC3C,SAAK,SAAS,YAAY,IAAI,IAAI,IAAI,EAAE;AACxC,WAAO;AAAA,EACT;AAAA,EAEA,QACE,IACA,IACA,GACA,YACA,UACA,OACA,OACM;AACN,SAAK,SAAS,UAAU,OAAO,KAAK;AACpC,SAAK,SAAS,UAAA;AACd,SAAK,SAAS,OAAO,IAAI,EAAE;AAC3B,SAAK,SAAS,IAAI,IAAI,IAAI,GAAG,YAAY,QAAQ;AACjD,SAAK,SAAS,UAAA;AACd,SAAK,SAAS,SAAA;AACd,WAAO;AAAA,EACT;AACF;;"}
@@ -0,0 +1,27 @@
1
+ import { VectorDrawContext } from '@number10/jsx-core';
2
+ import type * as Phaser from 'phaser';
3
+ export declare class PhaserVectorDrawContext implements VectorDrawContext {
4
+ readonly graphics: Phaser.GameObjects.Graphics;
5
+ constructor(graphics: Phaser.GameObjects.Graphics);
6
+ clear(): this;
7
+ fillStyle(color: number, alpha?: number): this;
8
+ lineStyle(width: number, color: number, alpha?: number): this;
9
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): this;
10
+ fillCircle(x: number, y: number, radius: number): this;
11
+ strokeCircle(x: number, y: number, radius: number): this;
12
+ fillRect(x: number, y: number, width: number, height: number): this;
13
+ strokeRect(x: number, y: number, width: number, height: number): this;
14
+ fillRoundedRect(x: number, y: number, width: number, height: number, radius: number): this;
15
+ strokeRoundedRect(x: number, y: number, width: number, height: number, radius: number): this;
16
+ beginPath(): this;
17
+ moveTo(x: number, y: number): this;
18
+ lineTo(x: number, y: number): this;
19
+ closePath(): this;
20
+ fillPath(): this;
21
+ strokePath(): this;
22
+ lineBetween(x1: number, y1: number, x2: number, y2: number): this;
23
+ fillCircleStyled(x: number, y: number, radius: number, color: number, alpha: number): this;
24
+ strokeLine(x1: number, y1: number, x2: number, y2: number, width: number, color: number, alpha: number): this;
25
+ fillArc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, color: number, alpha: number): this;
26
+ }
27
+ //# sourceMappingURL=PhaserVectorDrawContext.d.ts.map