@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.
- package/LICENSE +667 -0
- package/README.md +44 -0
- package/dist/_virtual/_commonjsHelpers.cjs +7 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +7 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/index.cjs +7 -0
- package/dist/_virtual/index.cjs.map +1 -0
- package/dist/_virtual/index.js +8 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/animation/index.d.ts +7 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/camera/index.d.ts +5 -0
- package/dist/camera/index.d.ts.map +1 -0
- package/dist/camera/use-camera-fx.cjs +49 -0
- package/dist/camera/use-camera-fx.cjs.map +1 -0
- package/dist/camera/use-camera-fx.d.ts +25 -0
- package/dist/camera/use-camera-fx.d.ts.map +1 -0
- package/dist/camera/use-camera-fx.js +49 -0
- package/dist/camera/use-camera-fx.js.map +1 -0
- package/dist/clip/index.cjs +8 -0
- package/dist/clip/index.cjs.map +1 -0
- package/dist/clip/index.d.ts +3 -0
- package/dist/clip/index.d.ts.map +1 -0
- package/dist/clip/index.js +9 -0
- package/dist/clip/index.js.map +1 -0
- package/dist/clip/stencil-clip-depth.cjs +24 -0
- package/dist/clip/stencil-clip-depth.cjs.map +1 -0
- package/dist/clip/stencil-clip-depth.d.ts +10 -0
- package/dist/clip/stencil-clip-depth.d.ts.map +1 -0
- package/dist/clip/stencil-clip-depth.js +24 -0
- package/dist/clip/stencil-clip-depth.js.map +1 -0
- package/dist/clip/stencil-clip-extension.cjs +113 -0
- package/dist/clip/stencil-clip-extension.cjs.map +1 -0
- package/dist/clip/stencil-clip-extension.d.ts +18 -0
- package/dist/clip/stencil-clip-extension.d.ts.map +1 -0
- package/dist/clip/stencil-clip-extension.js +96 -0
- package/dist/clip/stencil-clip-extension.js.map +1 -0
- package/dist/clip/stencil-clip-fbo-bridge.cjs +46 -0
- package/dist/clip/stencil-clip-fbo-bridge.cjs.map +1 -0
- package/dist/clip/stencil-clip-fbo-bridge.d.ts +7 -0
- package/dist/clip/stencil-clip-fbo-bridge.d.ts.map +1 -0
- package/dist/clip/stencil-clip-fbo-bridge.js +46 -0
- package/dist/clip/stencil-clip-fbo-bridge.js.map +1 -0
- package/dist/clip/stencil-clip-renderer.cjs +300 -0
- package/dist/clip/stencil-clip-renderer.cjs.map +1 -0
- package/dist/clip/stencil-clip-renderer.d.ts +7 -0
- package/dist/clip/stencil-clip-renderer.d.ts.map +1 -0
- package/dist/clip/stencil-clip-renderer.js +300 -0
- package/dist/clip/stencil-clip-renderer.js.map +1 -0
- package/dist/clip/stencil-clip-state.cjs +84 -0
- package/dist/clip/stencil-clip-state.cjs.map +1 -0
- package/dist/clip/stencil-clip-state.d.ts +28 -0
- package/dist/clip/stencil-clip-state.d.ts.map +1 -0
- package/dist/clip/stencil-clip-state.js +84 -0
- package/dist/clip/stencil-clip-state.js.map +1 -0
- package/dist/clip/stencil-clip-types.d.ts +67 -0
- package/dist/clip/stencil-clip-types.d.ts.map +1 -0
- package/dist/clip/stencil-clip.cjs +138 -0
- package/dist/clip/stencil-clip.cjs.map +1 -0
- package/dist/clip/stencil-clip.d.ts +53 -0
- package/dist/clip/stencil-clip.d.ts.map +1 -0
- package/dist/clip/stencil-clip.js +122 -0
- package/dist/clip/stencil-clip.js.map +1 -0
- package/dist/colors/use-color-mode.cjs +28 -0
- package/dist/colors/use-color-mode.cjs.map +1 -0
- package/dist/colors/use-color-mode.d.ts +22 -0
- package/dist/colors/use-color-mode.d.ts.map +1 -0
- package/dist/colors/use-color-mode.js +28 -0
- package/dist/colors/use-color-mode.js.map +1 -0
- package/dist/colors/use-colors.cjs +45 -0
- package/dist/colors/use-colors.cjs.map +1 -0
- package/dist/colors/use-colors.d.ts +36 -0
- package/dist/colors/use-colors.d.ts.map +1 -0
- package/dist/colors/use-colors.js +45 -0
- package/dist/colors/use-colors.js.map +1 -0
- package/dist/components/DebugPanel.cjs +88 -0
- package/dist/components/DebugPanel.cjs.map +1 -0
- package/dist/components/DebugPanel.d.ts +45 -0
- package/dist/components/DebugPanel.d.ts.map +1 -0
- package/dist/components/DebugPanel.js +71 -0
- package/dist/components/DebugPanel.js.map +1 -0
- package/dist/components/appliers/applyBackground.cjs +89 -0
- package/dist/components/appliers/applyBackground.cjs.map +1 -0
- package/dist/components/appliers/applyBackground.d.ts +18 -0
- package/dist/components/appliers/applyBackground.d.ts.map +1 -0
- package/dist/components/appliers/applyBackground.js +89 -0
- package/dist/components/appliers/applyBackground.js.map +1 -0
- package/dist/components/appliers/applyGestures.cjs +85 -0
- package/dist/components/appliers/applyGestures.cjs.map +1 -0
- package/dist/components/appliers/applyGestures.d.ts +12 -0
- package/dist/components/appliers/applyGestures.d.ts.map +1 -0
- package/dist/components/appliers/applyGestures.js +68 -0
- package/dist/components/appliers/applyGestures.js.map +1 -0
- package/dist/components/appliers/applyGraphics.cjs +21 -0
- package/dist/components/appliers/applyGraphics.cjs.map +1 -0
- package/dist/components/appliers/applyGraphics.d.ts +13 -0
- package/dist/components/appliers/applyGraphics.d.ts.map +1 -0
- package/dist/components/appliers/applyGraphics.js +21 -0
- package/dist/components/appliers/applyGraphics.js.map +1 -0
- package/dist/components/appliers/applyGraphicsLayout.cjs +18 -0
- package/dist/components/appliers/applyGraphicsLayout.cjs.map +1 -0
- package/dist/components/appliers/applyGraphicsLayout.d.ts +13 -0
- package/dist/components/appliers/applyGraphicsLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyGraphicsLayout.js +18 -0
- package/dist/components/appliers/applyGraphicsLayout.js.map +1 -0
- package/dist/components/appliers/applyImage.cjs +92 -0
- package/dist/components/appliers/applyImage.cjs.map +1 -0
- package/dist/components/appliers/applyImage.d.ts +47 -0
- package/dist/components/appliers/applyImage.d.ts.map +1 -0
- package/dist/components/appliers/applyImage.js +92 -0
- package/dist/components/appliers/applyImage.js.map +1 -0
- package/dist/components/appliers/applyImageLayout.cjs +18 -0
- package/dist/components/appliers/applyImageLayout.cjs.map +1 -0
- package/dist/components/appliers/applyImageLayout.d.ts +18 -0
- package/dist/components/appliers/applyImageLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyImageLayout.js +18 -0
- package/dist/components/appliers/applyImageLayout.js.map +1 -0
- package/dist/components/appliers/applyLayout.cjs +108 -0
- package/dist/components/appliers/applyLayout.cjs.map +1 -0
- package/dist/components/appliers/applyLayout.d.ts +19 -0
- package/dist/components/appliers/applyLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyLayout.js +91 -0
- package/dist/components/appliers/applyLayout.js.map +1 -0
- package/dist/components/appliers/applyNineSlice.cjs +37 -0
- package/dist/components/appliers/applyNineSlice.cjs.map +1 -0
- package/dist/components/appliers/applyNineSlice.d.ts +14 -0
- package/dist/components/appliers/applyNineSlice.d.ts.map +1 -0
- package/dist/components/appliers/applyNineSlice.js +37 -0
- package/dist/components/appliers/applyNineSlice.js.map +1 -0
- package/dist/components/appliers/applyNineSliceLayout.cjs +18 -0
- package/dist/components/appliers/applyNineSliceLayout.cjs.map +1 -0
- package/dist/components/appliers/applyNineSliceLayout.d.ts +18 -0
- package/dist/components/appliers/applyNineSliceLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyNineSliceLayout.js +18 -0
- package/dist/components/appliers/applyNineSliceLayout.js.map +1 -0
- package/dist/components/appliers/applyParticles.cjs +46 -0
- package/dist/components/appliers/applyParticles.cjs.map +1 -0
- package/dist/components/appliers/applyParticles.d.ts +7 -0
- package/dist/components/appliers/applyParticles.d.ts.map +1 -0
- package/dist/components/appliers/applyParticles.js +46 -0
- package/dist/components/appliers/applyParticles.js.map +1 -0
- package/dist/components/appliers/applyParticlesLayout.cjs +7 -0
- package/dist/components/appliers/applyParticlesLayout.cjs.map +1 -0
- package/dist/components/appliers/applyParticlesLayout.d.ts +11 -0
- package/dist/components/appliers/applyParticlesLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyParticlesLayout.js +7 -0
- package/dist/components/appliers/applyParticlesLayout.js.map +1 -0
- package/dist/components/appliers/applyPhaser.cjs +40 -0
- package/dist/components/appliers/applyPhaser.cjs.map +1 -0
- package/dist/components/appliers/applyPhaser.d.ts +24 -0
- package/dist/components/appliers/applyPhaser.d.ts.map +1 -0
- package/dist/components/appliers/applyPhaser.js +40 -0
- package/dist/components/appliers/applyPhaser.js.map +1 -0
- package/dist/components/appliers/applySprite.cjs +124 -0
- package/dist/components/appliers/applySprite.cjs.map +1 -0
- package/dist/components/appliers/applySprite.d.ts +13 -0
- package/dist/components/appliers/applySprite.d.ts.map +1 -0
- package/dist/components/appliers/applySprite.js +124 -0
- package/dist/components/appliers/applySprite.js.map +1 -0
- package/dist/components/appliers/applySpriteLayout.cjs +7 -0
- package/dist/components/appliers/applySpriteLayout.cjs.map +1 -0
- package/dist/components/appliers/applySpriteLayout.d.ts +17 -0
- package/dist/components/appliers/applySpriteLayout.d.ts.map +1 -0
- package/dist/components/appliers/applySpriteLayout.js +7 -0
- package/dist/components/appliers/applySpriteLayout.js.map +1 -0
- package/dist/components/appliers/applyText.cjs +142 -0
- package/dist/components/appliers/applyText.cjs.map +1 -0
- package/dist/components/appliers/applyText.d.ts +32 -0
- package/dist/components/appliers/applyText.d.ts.map +1 -0
- package/dist/components/appliers/applyText.js +142 -0
- package/dist/components/appliers/applyText.js.map +1 -0
- package/dist/components/appliers/applyTextLayout.cjs +16 -0
- package/dist/components/appliers/applyTextLayout.cjs.map +1 -0
- package/dist/components/appliers/applyTextLayout.d.ts +18 -0
- package/dist/components/appliers/applyTextLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyTextLayout.js +16 -0
- package/dist/components/appliers/applyTextLayout.js.map +1 -0
- package/dist/components/appliers/applyTooltip.cjs +247 -0
- package/dist/components/appliers/applyTooltip.cjs.map +1 -0
- package/dist/components/appliers/applyTooltip.d.ts +16 -0
- package/dist/components/appliers/applyTooltip.d.ts.map +1 -0
- package/dist/components/appliers/applyTooltip.js +247 -0
- package/dist/components/appliers/applyTooltip.js.map +1 -0
- package/dist/components/appliers/applyTransform.cjs +61 -0
- package/dist/components/appliers/applyTransform.cjs.map +1 -0
- package/dist/components/appliers/applyTransform.d.ts +24 -0
- package/dist/components/appliers/applyTransform.d.ts.map +1 -0
- package/dist/components/appliers/applyTransform.js +61 -0
- package/dist/components/appliers/applyTransform.js.map +1 -0
- package/dist/components/backgroundImage.cjs +411 -0
- package/dist/components/backgroundImage.cjs.map +1 -0
- package/dist/components/backgroundImage.d.ts +14 -0
- package/dist/components/backgroundImage.d.ts.map +1 -0
- package/dist/components/backgroundImage.js +411 -0
- package/dist/components/backgroundImage.js.map +1 -0
- package/dist/components/creators/createBackground.cjs +18 -0
- package/dist/components/creators/createBackground.cjs.map +1 -0
- package/dist/components/creators/createBackground.d.ts +20 -0
- package/dist/components/creators/createBackground.d.ts.map +1 -0
- package/dist/components/creators/createBackground.js +18 -0
- package/dist/components/creators/createBackground.js.map +1 -0
- package/dist/components/creators/createGestures.cjs +51 -0
- package/dist/components/creators/createGestures.cjs.map +1 -0
- package/dist/components/creators/createGestures.d.ts +11 -0
- package/dist/components/creators/createGestures.d.ts.map +1 -0
- package/dist/components/creators/createGestures.js +34 -0
- package/dist/components/creators/createGestures.js.map +1 -0
- package/dist/components/creators/createGraphicsLayout.cjs +24 -0
- package/dist/components/creators/createGraphicsLayout.cjs.map +1 -0
- package/dist/components/creators/createGraphicsLayout.d.ts +12 -0
- package/dist/components/creators/createGraphicsLayout.d.ts.map +1 -0
- package/dist/components/creators/createGraphicsLayout.js +24 -0
- package/dist/components/creators/createGraphicsLayout.js.map +1 -0
- package/dist/components/creators/createImageLayout.cjs +16 -0
- package/dist/components/creators/createImageLayout.cjs.map +1 -0
- package/dist/components/creators/createImageLayout.d.ts +17 -0
- package/dist/components/creators/createImageLayout.d.ts.map +1 -0
- package/dist/components/creators/createImageLayout.js +16 -0
- package/dist/components/creators/createImageLayout.js.map +1 -0
- package/dist/components/creators/createLayout.cjs +61 -0
- package/dist/components/creators/createLayout.cjs.map +1 -0
- package/dist/components/creators/createLayout.d.ts +15 -0
- package/dist/components/creators/createLayout.d.ts.map +1 -0
- package/dist/components/creators/createLayout.js +61 -0
- package/dist/components/creators/createLayout.js.map +1 -0
- package/dist/components/creators/createNineSliceLayout.cjs +16 -0
- package/dist/components/creators/createNineSliceLayout.cjs.map +1 -0
- package/dist/components/creators/createNineSliceLayout.d.ts +17 -0
- package/dist/components/creators/createNineSliceLayout.d.ts.map +1 -0
- package/dist/components/creators/createNineSliceLayout.js +16 -0
- package/dist/components/creators/createNineSliceLayout.js.map +1 -0
- package/dist/components/creators/createParticlesLayout.cjs +8 -0
- package/dist/components/creators/createParticlesLayout.cjs.map +1 -0
- package/dist/components/creators/createParticlesLayout.d.ts +14 -0
- package/dist/components/creators/createParticlesLayout.d.ts.map +1 -0
- package/dist/components/creators/createParticlesLayout.js +8 -0
- package/dist/components/creators/createParticlesLayout.js.map +1 -0
- package/dist/components/creators/createPhaser.cjs +36 -0
- package/dist/components/creators/createPhaser.cjs.map +1 -0
- package/dist/components/creators/createPhaser.d.ts +14 -0
- package/dist/components/creators/createPhaser.d.ts.map +1 -0
- package/dist/components/creators/createPhaser.js +36 -0
- package/dist/components/creators/createPhaser.js.map +1 -0
- package/dist/components/creators/createSpriteLayout.cjs +10 -0
- package/dist/components/creators/createSpriteLayout.cjs.map +1 -0
- package/dist/components/creators/createSpriteLayout.d.ts +18 -0
- package/dist/components/creators/createSpriteLayout.d.ts.map +1 -0
- package/dist/components/creators/createSpriteLayout.js +10 -0
- package/dist/components/creators/createSpriteLayout.js.map +1 -0
- package/dist/components/creators/createTextLayout.cjs +16 -0
- package/dist/components/creators/createTextLayout.cjs.map +1 -0
- package/dist/components/creators/createTextLayout.d.ts +17 -0
- package/dist/components/creators/createTextLayout.d.ts.map +1 -0
- package/dist/components/creators/createTextLayout.js +16 -0
- package/dist/components/creators/createTextLayout.js.map +1 -0
- package/dist/components/creators/createTransform.cjs +83 -0
- package/dist/components/creators/createTransform.cjs.map +1 -0
- package/dist/components/creators/createTransform.d.ts +26 -0
- package/dist/components/creators/createTransform.d.ts.map +1 -0
- package/dist/components/creators/createTransform.js +83 -0
- package/dist/components/creators/createTransform.js.map +1 -0
- package/dist/components/custom/Graphics.cjs +13 -0
- package/dist/components/custom/Graphics.cjs.map +1 -0
- package/dist/components/custom/Graphics.d.ts +50 -0
- package/dist/components/custom/Graphics.d.ts.map +1 -0
- package/dist/components/custom/Graphics.js +13 -0
- package/dist/components/custom/Graphics.js.map +1 -0
- package/dist/components/custom/NineSlice.cjs +13 -0
- package/dist/components/custom/NineSlice.cjs.map +1 -0
- package/dist/components/custom/NineSlice.d.ts +87 -0
- package/dist/components/custom/NineSlice.d.ts.map +1 -0
- package/dist/components/custom/NineSlice.js +13 -0
- package/dist/components/custom/NineSlice.js.map +1 -0
- package/dist/components/custom/Particles.cjs +8 -0
- package/dist/components/custom/Particles.cjs.map +1 -0
- package/dist/components/custom/Particles.d.ts +28 -0
- package/dist/components/custom/Particles.d.ts.map +1 -0
- package/dist/components/custom/Particles.js +8 -0
- package/dist/components/custom/Particles.js.map +1 -0
- package/dist/components/custom/RefOriginView.cjs +67 -0
- package/dist/components/custom/RefOriginView.cjs.map +1 -0
- package/dist/components/custom/RefOriginView.d.ts +49 -0
- package/dist/components/custom/RefOriginView.d.ts.map +1 -0
- package/dist/components/custom/RefOriginView.js +67 -0
- package/dist/components/custom/RefOriginView.js.map +1 -0
- package/dist/components/custom/Sprite.cjs +13 -0
- package/dist/components/custom/Sprite.cjs.map +1 -0
- package/dist/components/custom/Sprite.d.ts +79 -0
- package/dist/components/custom/Sprite.d.ts.map +1 -0
- package/dist/components/custom/Sprite.js +13 -0
- package/dist/components/custom/Sprite.js.map +1 -0
- package/dist/components/custom/TileSprite.cjs +13 -0
- package/dist/components/custom/TileSprite.cjs.map +1 -0
- package/dist/components/custom/TileSprite.d.ts +65 -0
- package/dist/components/custom/TileSprite.d.ts.map +1 -0
- package/dist/components/custom/TileSprite.js +13 -0
- package/dist/components/custom/TileSprite.js.map +1 -0
- package/dist/components/custom/index.d.ts +15 -0
- package/dist/components/custom/index.d.ts.map +1 -0
- package/dist/components/index.cjs +33 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +33 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/internal/SceneWrapper.cjs +10 -0
- package/dist/components/internal/SceneWrapper.cjs.map +1 -0
- package/dist/components/internal/SceneWrapper.d.ts +20 -0
- package/dist/components/internal/SceneWrapper.d.ts.map +1 -0
- package/dist/components/internal/SceneWrapper.js +10 -0
- package/dist/components/internal/SceneWrapper.js.map +1 -0
- package/dist/components/primitives/graphics.cjs +29 -0
- package/dist/components/primitives/graphics.cjs.map +1 -0
- package/dist/components/primitives/graphics.d.ts +146 -0
- package/dist/components/primitives/graphics.d.ts.map +1 -0
- package/dist/components/primitives/graphics.js +29 -0
- package/dist/components/primitives/graphics.js.map +1 -0
- package/dist/components/primitives/image.cjs +110 -0
- package/dist/components/primitives/image.cjs.map +1 -0
- package/dist/components/primitives/image.d.ts +170 -0
- package/dist/components/primitives/image.d.ts.map +1 -0
- package/dist/components/primitives/image.js +110 -0
- package/dist/components/primitives/image.js.map +1 -0
- package/dist/components/primitives/nineslice.cjs +42 -0
- package/dist/components/primitives/nineslice.cjs.map +1 -0
- package/dist/components/primitives/nineslice.d.ts +271 -0
- package/dist/components/primitives/nineslice.d.ts.map +1 -0
- package/dist/components/primitives/nineslice.js +42 -0
- package/dist/components/primitives/nineslice.js.map +1 -0
- package/dist/components/primitives/particles.cjs +77 -0
- package/dist/components/primitives/particles.cjs.map +1 -0
- package/dist/components/primitives/particles.d.ts +47 -0
- package/dist/components/primitives/particles.d.ts.map +1 -0
- package/dist/components/primitives/particles.js +77 -0
- package/dist/components/primitives/particles.js.map +1 -0
- package/dist/components/primitives/sprite.cjs +100 -0
- package/dist/components/primitives/sprite.cjs.map +1 -0
- package/dist/components/primitives/sprite.d.ts +147 -0
- package/dist/components/primitives/sprite.d.ts.map +1 -0
- package/dist/components/primitives/sprite.js +100 -0
- package/dist/components/primitives/sprite.js.map +1 -0
- package/dist/components/primitives/text.cjs +73 -0
- package/dist/components/primitives/text.cjs.map +1 -0
- package/dist/components/primitives/text.d.ts +155 -0
- package/dist/components/primitives/text.d.ts.map +1 -0
- package/dist/components/primitives/text.js +73 -0
- package/dist/components/primitives/text.js.map +1 -0
- package/dist/components/primitives/tilesprite.cjs +77 -0
- package/dist/components/primitives/tilesprite.cjs.map +1 -0
- package/dist/components/primitives/tilesprite.d.ts +157 -0
- package/dist/components/primitives/tilesprite.d.ts.map +1 -0
- package/dist/components/primitives/tilesprite.js +77 -0
- package/dist/components/primitives/tilesprite.js.map +1 -0
- package/dist/components/primitives/vectorDraw.cjs +73 -0
- package/dist/components/primitives/vectorDraw.cjs.map +1 -0
- package/dist/components/primitives/vectorDraw.d.ts +4 -0
- package/dist/components/primitives/vectorDraw.d.ts.map +1 -0
- package/dist/components/primitives/vectorDraw.js +73 -0
- package/dist/components/primitives/vectorDraw.js.map +1 -0
- package/dist/components/primitives/view.cjs +105 -0
- package/dist/components/primitives/view.cjs.map +1 -0
- package/dist/components/primitives/view.d.ts +23 -0
- package/dist/components/primitives/view.d.ts.map +1 -0
- package/dist/components/primitives/view.js +105 -0
- package/dist/components/primitives/view.js.map +1 -0
- package/dist/core-props.d.ts +105 -0
- package/dist/core-props.d.ts.map +1 -0
- package/dist/core-types.d.ts +71 -0
- package/dist/core-types.d.ts.map +1 -0
- package/dist/design-tokens/resolve-theme-tokens.cjs +27 -0
- package/dist/design-tokens/resolve-theme-tokens.cjs.map +1 -0
- package/dist/design-tokens/resolve-theme-tokens.d.ts +9 -0
- package/dist/design-tokens/resolve-theme-tokens.d.ts.map +1 -0
- package/dist/design-tokens/resolve-theme-tokens.js +27 -0
- package/dist/design-tokens/resolve-theme-tokens.js.map +1 -0
- package/dist/design-tokens/use-theme-tokens.cjs +26 -0
- package/dist/design-tokens/use-theme-tokens.cjs.map +1 -0
- package/dist/design-tokens/use-theme-tokens.d.ts +28 -0
- package/dist/design-tokens/use-theme-tokens.d.ts.map +1 -0
- package/dist/design-tokens/use-theme-tokens.js +26 -0
- package/dist/design-tokens/use-theme-tokens.js.map +1 -0
- package/dist/effects/index.d.ts +2 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/phaser-effects-bridge.cjs +48 -0
- package/dist/effects/phaser-effects-bridge.cjs.map +1 -0
- package/dist/effects/phaser-effects-bridge.d.ts +2 -0
- package/dist/effects/phaser-effects-bridge.d.ts.map +1 -0
- package/dist/effects/phaser-effects-bridge.js +30 -0
- package/dist/effects/phaser-effects-bridge.js.map +1 -0
- package/dist/effects/use-effect.cjs +155 -0
- package/dist/effects/use-effect.cjs.map +1 -0
- package/dist/effects/use-effect.d.ts +30 -0
- package/dist/effects/use-effect.d.ts.map +1 -0
- package/dist/effects/use-effect.js +155 -0
- package/dist/effects/use-effect.js.map +1 -0
- package/dist/fx/convenience-hooks/index.d.ts +7 -0
- package/dist/fx/convenience-hooks/index.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-blur.cjs +18 -0
- package/dist/fx/convenience-hooks/use-blur.cjs.map +1 -0
- package/dist/fx/convenience-hooks/use-blur.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-blur.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-blur.js +18 -0
- package/dist/fx/convenience-hooks/use-blur.js.map +1 -0
- package/dist/fx/convenience-hooks/use-glow.cjs +18 -0
- package/dist/fx/convenience-hooks/use-glow.cjs.map +1 -0
- package/dist/fx/convenience-hooks/use-glow.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-glow.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-glow.js +18 -0
- package/dist/fx/convenience-hooks/use-glow.js.map +1 -0
- package/dist/fx/convenience-hooks/use-shadow.cjs +18 -0
- package/dist/fx/convenience-hooks/use-shadow.cjs.map +1 -0
- package/dist/fx/convenience-hooks/use-shadow.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-shadow.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-shadow.js +18 -0
- package/dist/fx/convenience-hooks/use-shadow.js.map +1 -0
- package/dist/fx/fx-creators/blur.cjs +20 -0
- package/dist/fx/fx-creators/blur.cjs.map +1 -0
- package/dist/fx/fx-creators/blur.d.ts +37 -0
- package/dist/fx/fx-creators/blur.d.ts.map +1 -0
- package/dist/fx/fx-creators/blur.js +20 -0
- package/dist/fx/fx-creators/blur.js.map +1 -0
- package/dist/fx/fx-creators/color-matrix.cjs +47 -0
- package/dist/fx/fx-creators/color-matrix.cjs.map +1 -0
- package/dist/fx/fx-creators/color-matrix.d.ts +31 -0
- package/dist/fx/fx-creators/color-matrix.d.ts.map +1 -0
- package/dist/fx/fx-creators/color-matrix.js +47 -0
- package/dist/fx/fx-creators/color-matrix.js.map +1 -0
- package/dist/fx/fx-creators/glow.cjs +27 -0
- package/dist/fx/fx-creators/glow.cjs.map +1 -0
- package/dist/fx/fx-creators/glow.d.ts +36 -0
- package/dist/fx/fx-creators/glow.d.ts.map +1 -0
- package/dist/fx/fx-creators/glow.js +27 -0
- package/dist/fx/fx-creators/glow.js.map +1 -0
- package/dist/fx/fx-creators/index.d.ts +10 -0
- package/dist/fx/fx-creators/index.d.ts.map +1 -0
- package/dist/fx/fx-creators/pixelate.cjs +20 -0
- package/dist/fx/fx-creators/pixelate.cjs.map +1 -0
- package/dist/fx/fx-creators/pixelate.d.ts +24 -0
- package/dist/fx/fx-creators/pixelate.d.ts.map +1 -0
- package/dist/fx/fx-creators/pixelate.js +20 -0
- package/dist/fx/fx-creators/pixelate.js.map +1 -0
- package/dist/fx/fx-creators/shadow.cjs +28 -0
- package/dist/fx/fx-creators/shadow.cjs.map +1 -0
- package/dist/fx/fx-creators/shadow.d.ts +43 -0
- package/dist/fx/fx-creators/shadow.d.ts.map +1 -0
- package/dist/fx/fx-creators/shadow.js +28 -0
- package/dist/fx/fx-creators/shadow.js.map +1 -0
- package/dist/fx/fx-creators/vignette.cjs +20 -0
- package/dist/fx/fx-creators/vignette.cjs.map +1 -0
- package/dist/fx/fx-creators/vignette.d.ts +33 -0
- package/dist/fx/fx-creators/vignette.d.ts.map +1 -0
- package/dist/fx/fx-creators/vignette.js +20 -0
- package/dist/fx/fx-creators/vignette.js.map +1 -0
- package/dist/fx/fx-registry.cjs +43 -0
- package/dist/fx/fx-registry.cjs.map +1 -0
- package/dist/fx/fx-registry.d.ts +59 -0
- package/dist/fx/fx-registry.d.ts.map +1 -0
- package/dist/fx/fx-registry.js +43 -0
- package/dist/fx/fx-registry.js.map +1 -0
- package/dist/fx/index.d.ts +51 -0
- package/dist/fx/index.d.ts.map +1 -0
- package/dist/fx/use-fx.cjs +54 -0
- package/dist/fx/use-fx.cjs.map +1 -0
- package/dist/fx/use-fx.d.ts +53 -0
- package/dist/fx/use-fx.d.ts.map +1 -0
- package/dist/fx/use-fx.js +54 -0
- package/dist/fx/use-fx.js.map +1 -0
- package/dist/gestures/gesture-manager.cjs +773 -0
- package/dist/gestures/gesture-manager.cjs.map +1 -0
- package/dist/gestures/gesture-manager.d.ts +158 -0
- package/dist/gestures/gesture-manager.d.ts.map +1 -0
- package/dist/gestures/gesture-manager.js +773 -0
- package/dist/gestures/gesture-manager.js.map +1 -0
- package/dist/gestures/gesture-types.cjs +9 -0
- package/dist/gestures/gesture-types.cjs.map +1 -0
- package/dist/gestures/gesture-types.d.ts +232 -0
- package/dist/gestures/gesture-types.d.ts.map +1 -0
- package/dist/gestures/gesture-types.js +9 -0
- package/dist/gestures/gesture-types.js.map +1 -0
- package/dist/hooks.cjs +193 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.ts +151 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +146 -0
- package/dist/hooks.js.map +1 -0
- package/dist/host.cjs +85 -0
- package/dist/host.cjs.map +1 -0
- package/dist/host.d.ts +78 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +85 -0
- package/dist/host.js.map +1 -0
- package/dist/index.cjs +614 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +273 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-dev-runtime.cjs +20 -0
- package/dist/jsx-dev-runtime.cjs.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +8 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +8 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.cjs +16 -0
- package/dist/jsx-runtime.cjs.map +1 -0
- package/dist/jsx-runtime.d.ts +9 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +7 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-types.d.ts +40 -0
- package/dist/jsx-types.d.ts.map +1 -0
- package/dist/layout/appliers/background-applier.cjs +40 -0
- package/dist/layout/appliers/background-applier.cjs.map +1 -0
- package/dist/layout/appliers/background-applier.d.ts +16 -0
- package/dist/layout/appliers/background-applier.d.ts.map +1 -0
- package/dist/layout/appliers/background-applier.js +40 -0
- package/dist/layout/appliers/background-applier.js.map +1 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/layout-engine-test-utils.d.ts +24 -0
- package/dist/layout/layout-engine-test-utils.d.ts.map +1 -0
- package/dist/layout/phaser-layout-bridge.cjs +41 -0
- package/dist/layout/phaser-layout-bridge.cjs.map +1 -0
- package/dist/layout/phaser-layout-bridge.d.ts +9 -0
- package/dist/layout/phaser-layout-bridge.d.ts.map +1 -0
- package/dist/layout/phaser-layout-bridge.js +40 -0
- package/dist/layout/phaser-layout-bridge.js.map +1 -0
- package/dist/layout/types.d.ts +14 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.cjs +39 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +39 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +1 -0
- package/dist/particles/emit-zone.cjs +205 -0
- package/dist/particles/emit-zone.cjs.map +1 -0
- package/dist/particles/emit-zone.d.ts +88 -0
- package/dist/particles/emit-zone.d.ts.map +1 -0
- package/dist/particles/emit-zone.js +205 -0
- package/dist/particles/emit-zone.js.map +1 -0
- package/dist/particles/index.d.ts +8 -0
- package/dist/particles/index.d.ts.map +1 -0
- package/dist/particles/particle-types.d.ts +25 -0
- package/dist/particles/particle-types.d.ts.map +1 -0
- package/dist/particles/preset-registry.cjs +57 -0
- package/dist/particles/preset-registry.cjs.map +1 -0
- package/dist/particles/preset-registry.d.ts +49 -0
- package/dist/particles/preset-registry.d.ts.map +1 -0
- package/dist/particles/preset-registry.js +57 -0
- package/dist/particles/preset-registry.js.map +1 -0
- package/dist/particles/use-particles.cjs +67 -0
- package/dist/particles/use-particles.cjs.map +1 -0
- package/dist/particles/use-particles.d.ts +19 -0
- package/dist/particles/use-particles.d.ts.map +1 -0
- package/dist/particles/use-particles.js +67 -0
- package/dist/particles/use-particles.js.map +1 -0
- package/dist/particles/utils.cjs +82 -0
- package/dist/particles/utils.cjs.map +1 -0
- package/dist/particles/utils.d.ts +10 -0
- package/dist/particles/utils.d.ts.map +1 -0
- package/dist/particles/utils.js +82 -0
- package/dist/particles/utils.js.map +1 -0
- package/dist/phaser-bridges.cjs +148 -0
- package/dist/phaser-bridges.cjs.map +1 -0
- package/dist/phaser-bridges.d.ts +78 -0
- package/dist/phaser-bridges.d.ts.map +1 -0
- package/dist/phaser-bridges.js +131 -0
- package/dist/phaser-bridges.js.map +1 -0
- package/dist/phaser-host-adapter.cjs +148 -0
- package/dist/phaser-host-adapter.cjs.map +1 -0
- package/dist/phaser-host-adapter.d.ts +30 -0
- package/dist/phaser-host-adapter.d.ts.map +1 -0
- package/dist/phaser-host-adapter.js +148 -0
- package/dist/phaser-host-adapter.js.map +1 -0
- package/dist/phaser-runtime-types.d.ts +89 -0
- package/dist/phaser-runtime-types.d.ts.map +1 -0
- package/dist/phaser-surface-adapter.cjs +488 -0
- package/dist/phaser-surface-adapter.cjs.map +1 -0
- package/dist/phaser-surface-adapter.d.ts +74 -0
- package/dist/phaser-surface-adapter.d.ts.map +1 -0
- package/dist/phaser-surface-adapter.js +471 -0
- package/dist/phaser-surface-adapter.js.map +1 -0
- package/dist/phaser-vdom-runtime.cjs +63 -0
- package/dist/phaser-vdom-runtime.cjs.map +1 -0
- package/dist/phaser-vdom-runtime.d.ts +2 -0
- package/dist/phaser-vdom-runtime.d.ts.map +1 -0
- package/dist/phaser-vdom-runtime.js +63 -0
- package/dist/phaser-vdom-runtime.js.map +1 -0
- package/dist/plugin.cjs +182 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.ts +161 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +165 -0
- package/dist/plugin.js.map +1 -0
- package/dist/render-context.cjs +106 -0
- package/dist/render-context.cjs.map +1 -0
- package/dist/render-context.d.ts +66 -0
- package/dist/render-context.d.ts.map +1 -0
- package/dist/render-context.js +106 -0
- package/dist/render-context.js.map +1 -0
- package/dist/scene-backgrounds.cjs +285 -0
- package/dist/scene-backgrounds.cjs.map +1 -0
- package/dist/scene-backgrounds.d.ts +69 -0
- package/dist/scene-backgrounds.d.ts.map +1 -0
- package/dist/scene-backgrounds.js +268 -0
- package/dist/scene-backgrounds.js.map +1 -0
- package/dist/theme-base.d.ts +133 -0
- package/dist/theme-base.d.ts.map +1 -0
- package/dist/theme-custom.d.ts +13 -0
- package/dist/theme-custom.d.ts.map +1 -0
- package/dist/theme-defaults.cjs +29 -0
- package/dist/theme-defaults.cjs.map +1 -0
- package/dist/theme-defaults.d.ts +1 -0
- package/dist/theme-defaults.d.ts.map +1 -0
- package/dist/theme-defaults.js +28 -0
- package/dist/theme-defaults.js.map +1 -0
- package/dist/theme.cjs +34 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.ts +36 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +32 -0
- package/dist/theme.js.map +1 -0
- package/dist/tooltip/tooltip-types.d.ts +6 -0
- package/dist/tooltip/tooltip-types.d.ts.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/KeyboardInputManager.cjs +112 -0
- package/dist/utils/KeyboardInputManager.cjs.map +1 -0
- package/dist/utils/KeyboardInputManager.d.ts +48 -0
- package/dist/utils/KeyboardInputManager.d.ts.map +1 -0
- package/dist/utils/KeyboardInputManager.js +112 -0
- package/dist/utils/KeyboardInputManager.js.map +1 -0
- package/dist/utils/dom-input-manager.cjs +253 -0
- package/dist/utils/dom-input-manager.cjs.map +1 -0
- package/dist/utils/dom-input-manager.d.ts +113 -0
- package/dist/utils/dom-input-manager.d.ts.map +1 -0
- package/dist/utils/dom-input-manager.js +253 -0
- package/dist/utils/dom-input-manager.js.map +1 -0
- package/dist/utils/fast-deep-equal.cjs +7 -0
- package/dist/utils/fast-deep-equal.cjs.map +1 -0
- package/dist/utils/fast-deep-equal.d.ts +4 -0
- package/dist/utils/fast-deep-equal.d.ts.map +1 -0
- package/dist/utils/fast-deep-equal.js +7 -0
- package/dist/utils/fast-deep-equal.js.map +1 -0
- package/dist/utils/image-subtexture-registry.cjs +98 -0
- package/dist/utils/image-subtexture-registry.cjs.map +1 -0
- package/dist/utils/image-subtexture-registry.d.ts +17 -0
- package/dist/utils/image-subtexture-registry.d.ts.map +1 -0
- package/dist/utils/image-subtexture-registry.js +98 -0
- package/dist/utils/image-subtexture-registry.js.map +1 -0
- package/dist/utils/phaser-guards.cjs +15 -0
- package/dist/utils/phaser-guards.cjs.map +1 -0
- package/dist/utils/phaser-guards.d.ts +7 -0
- package/dist/utils/phaser-guards.d.ts.map +1 -0
- package/dist/utils/phaser-guards.js +15 -0
- package/dist/utils/phaser-guards.js.map +1 -0
- package/dist/utils/svg-texture.cjs +48 -0
- package/dist/utils/svg-texture.cjs.map +1 -0
- package/dist/utils/svg-texture.d.ts +34 -0
- package/dist/utils/svg-texture.d.ts.map +1 -0
- package/dist/utils/svg-texture.js +48 -0
- package/dist/utils/svg-texture.js.map +1 -0
- package/dist/utils/texture-registry.cjs +117 -0
- package/dist/utils/texture-registry.cjs.map +1 -0
- package/dist/utils/texture-registry.d.ts +53 -0
- package/dist/utils/texture-registry.d.ts.map +1 -0
- package/dist/utils/texture-registry.js +117 -0
- package/dist/utils/texture-registry.js.map +1 -0
- package/dist/vdom-host-types.d.ts +12 -0
- package/dist/vdom-host-types.d.ts.map +1 -0
- package/dist/vdom-registry.d.ts +27 -0
- package/dist/vdom-registry.d.ts.map +1 -0
- package/dist/vdom-utils.d.ts +16 -0
- package/dist/vdom-utils.d.ts.map +1 -0
- package/dist/vdom.cjs +36 -0
- package/dist/vdom.cjs.map +1 -0
- package/dist/vdom.d.ts +23 -0
- package/dist/vdom.d.ts.map +1 -0
- package/dist/vdom.js +36 -0
- package/dist/vdom.js.map +1 -0
- package/dist/vector/PhaserVectorDrawContext.cjs +97 -0
- package/dist/vector/PhaserVectorDrawContext.cjs.map +1 -0
- package/dist/vector/PhaserVectorDrawContext.d.ts +27 -0
- package/dist/vector/PhaserVectorDrawContext.d.ts.map +1 -0
- package/dist/vector/PhaserVectorDrawContext.js +97 -0
- package/dist/vector/PhaserVectorDrawContext.js.map +1 -0
- package/dist/vector/index.d.ts +2 -0
- package/dist/vector/index.d.ts.map +1 -0
- 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":["svgTo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,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":";AAwBA,MAAM,gBAAgB;AAAA;AAAA,EAEZ,oCAAoB,IAAA;AAAA;AAAA;AAAA;AAAA,EAKpB,cAAc,OAAgD;AACpE,QAAI,WAAW,KAAK,cAAc,IAAI,KAAK;AAC3C,QAAI,CAAC,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AACzD,UAAM,WAAW,KAAK,cAAc,IAAI,KAAK;AAC7C,QAAI,CAAC,SAAU,QAAO;AACtB,UAAM,QAAQ,SAAS,IAAI,GAAG;AAC9B,WAAO,OAAO,UAAU;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKA,kBAAkB,OAA+B;AAC/C,UAAM,WAAW,KAAK,cAAc,IAAI,KAAK;AAC7C,QAAI,CAAC,SAAU,QAAO,CAAA;AACtB,WAAO,MAAM,KAAK,SAAS,QAAA,CAAS,EACjC,OAAO,CAAC,CAAA,EAAG,KAAK,MAAM,MAAM,MAAM,EAClC,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAa,OAAqB;AAChC,UAAM,WAAW,KAAK,cAAc,IAAI,KAAK;AAC7C,QAAI,CAAC,SAAU;AAEf,eAAW,OAAO,SAAS,QAAQ;AACjC,UAAI,MAAM,SAAS,OAAO,GAAG,GAAG;AAC9B,cAAM,SAAS,OAAO,GAAG;AAAA,MAC3B;AAAA,IACF;AACA,SAAK,cAAc,OAAO,KAAK;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAa;AACX,eAAW,CAAC,OAAO,QAAQ,KAAK,KAAK,cAAc,WAAW;AAC5D,iBAAW,OAAO,SAAS,QAAQ;AACjC,YAAI,MAAM,SAAS,OAAO,GAAG,GAAG;AAC9B,gBAAM,SAAS,OAAO,GAAG;AAAA,QAC3B;AAAA,MACF;AAAA,IACF;AACA,SAAK,cAAc,MAAA;AAAA,EACrB;AACF;AAGO,MAAM,kBAAkB,IAAI,gBAAA;"}
|
|
@@ -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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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
|
package/dist/vdom.js.map
ADDED
|
@@ -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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ACA,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
|