@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,411 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxCore = require("@number10/jsx-core");
|
|
4
|
+
require("phaser");
|
|
5
|
+
const PhaserVectorDrawContext = require("../vector/PhaserVectorDrawContext.cjs");
|
|
6
|
+
const sceneBackgroundTextureCaches = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
class OffsetVectorDrawContext {
|
|
8
|
+
constructor(base, dx, dy) {
|
|
9
|
+
this.base = base;
|
|
10
|
+
this.dx = dx;
|
|
11
|
+
this.dy = dy;
|
|
12
|
+
}
|
|
13
|
+
base;
|
|
14
|
+
dx;
|
|
15
|
+
dy;
|
|
16
|
+
clear() {
|
|
17
|
+
this.base.clear();
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
fillStyle(color, alpha) {
|
|
21
|
+
this.base.fillStyle(color, alpha);
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
lineStyle(width, color, alpha) {
|
|
25
|
+
this.base.lineStyle(width, color, alpha);
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
arc(x, y, radius, startAngle, endAngle, anticlockwise) {
|
|
29
|
+
this.base.arc(x + this.dx, y + this.dy, radius, startAngle, endAngle, anticlockwise);
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
fillCircle(x, y, radius) {
|
|
33
|
+
this.base.fillCircle(x + this.dx, y + this.dy, radius);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
strokeCircle(x, y, radius) {
|
|
37
|
+
this.base.strokeCircle(x + this.dx, y + this.dy, radius);
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
fillCircleStyled(x, y, radius, color, alpha) {
|
|
41
|
+
this.base.fillCircleStyled(x + this.dx, y + this.dy, radius, color, alpha);
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
fillRect(x, y, width, height) {
|
|
45
|
+
this.base.fillRect(x + this.dx, y + this.dy, width, height);
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
strokeRect(x, y, width, height) {
|
|
49
|
+
this.base.strokeRect(x + this.dx, y + this.dy, width, height);
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
fillRoundedRect(x, y, width, height, radius) {
|
|
53
|
+
this.base.fillRoundedRect(x + this.dx, y + this.dy, width, height, radius);
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
strokeRoundedRect(x, y, width, height, radius) {
|
|
57
|
+
this.base.strokeRoundedRect(x + this.dx, y + this.dy, width, height, radius);
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
beginPath() {
|
|
61
|
+
this.base.beginPath();
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
moveTo(x, y) {
|
|
65
|
+
this.base.moveTo(x + this.dx, y + this.dy);
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
lineTo(x, y) {
|
|
69
|
+
this.base.lineTo(x + this.dx, y + this.dy);
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
closePath() {
|
|
73
|
+
this.base.closePath();
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
fillPath() {
|
|
77
|
+
this.base.fillPath();
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
strokePath() {
|
|
81
|
+
this.base.strokePath();
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
lineBetween(x1, y1, x2, y2) {
|
|
85
|
+
this.base.lineBetween(x1 + this.dx, y1 + this.dy, x2 + this.dx, y2 + this.dy);
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
strokeLine(x1, y1, x2, y2, width, color, alpha) {
|
|
89
|
+
this.base.strokeLine(
|
|
90
|
+
x1 + this.dx,
|
|
91
|
+
y1 + this.dy,
|
|
92
|
+
x2 + this.dx,
|
|
93
|
+
y2 + this.dy,
|
|
94
|
+
width,
|
|
95
|
+
color,
|
|
96
|
+
alpha
|
|
97
|
+
);
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
fillArc(cx, cy, r, startAngle, endAngle, color, alpha) {
|
|
101
|
+
this.base.fillArc(cx + this.dx, cy + this.dy, r, startAngle, endAngle, color, alpha);
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function hasAdvancedBorder(props) {
|
|
106
|
+
const border = props.border;
|
|
107
|
+
if (!border) return false;
|
|
108
|
+
const w = jsxCore.resolveBorderSides(border.width);
|
|
109
|
+
return w.top > 0 || w.right > 0 || w.bottom > 0 || w.left > 0;
|
|
110
|
+
}
|
|
111
|
+
function normalizeBorderForCache(border) {
|
|
112
|
+
const width = border.width;
|
|
113
|
+
const widthStr = typeof width === "number" ? String(width) : `${width?.top ?? 0},${width?.right ?? 0},${width?.bottom ?? 0},${width?.left ?? 0}`;
|
|
114
|
+
return [
|
|
115
|
+
border.color ?? "none",
|
|
116
|
+
widthStr,
|
|
117
|
+
border.style ?? "solid",
|
|
118
|
+
border.dash?.join(",") ?? "",
|
|
119
|
+
border.dashOffset ?? 0,
|
|
120
|
+
border.cap ?? "",
|
|
121
|
+
border.join ?? "",
|
|
122
|
+
border.align ?? "center"
|
|
123
|
+
].join("|");
|
|
124
|
+
}
|
|
125
|
+
function hasRenderableBackground(props) {
|
|
126
|
+
const hasBackground = props.backgroundColor !== void 0;
|
|
127
|
+
const hasBorder = (props.borderWidth ?? 0) > 0 && props.borderColor !== void 0;
|
|
128
|
+
const hasAdvanced = hasAdvancedBorder(props);
|
|
129
|
+
return hasBackground || hasBorder || hasAdvanced;
|
|
130
|
+
}
|
|
131
|
+
function hasRoundedCorners(radius) {
|
|
132
|
+
if (typeof radius === "number") {
|
|
133
|
+
return radius !== 0;
|
|
134
|
+
}
|
|
135
|
+
return (radius.tl ?? 0) !== 0 || (radius.tr ?? 0) !== 0 || (radius.bl ?? 0) !== 0 || (radius.br ?? 0) !== 0;
|
|
136
|
+
}
|
|
137
|
+
function insetCornerRadius(radius, inset) {
|
|
138
|
+
const insetSingleRadius = (value) => {
|
|
139
|
+
const resolved = value ?? 0;
|
|
140
|
+
const sign = resolved < 0 ? -1 : 1;
|
|
141
|
+
return sign * Math.max(0, Math.abs(resolved) - inset);
|
|
142
|
+
};
|
|
143
|
+
if (typeof radius === "number") {
|
|
144
|
+
return insetSingleRadius(radius);
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
tl: insetSingleRadius(radius.tl),
|
|
148
|
+
tr: insetSingleRadius(radius.tr),
|
|
149
|
+
bl: insetSingleRadius(radius.bl),
|
|
150
|
+
br: insetSingleRadius(radius.br)
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function offsetCornerRadius(radius, offset) {
|
|
154
|
+
const shiftSingleRadius = (value) => Math.max(0, (value ?? 0) - offset);
|
|
155
|
+
if (typeof radius === "number") {
|
|
156
|
+
return shiftSingleRadius(radius);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
tl: shiftSingleRadius(radius.tl),
|
|
160
|
+
tr: shiftSingleRadius(radius.tr),
|
|
161
|
+
bl: shiftSingleRadius(radius.bl),
|
|
162
|
+
br: shiftSingleRadius(radius.br)
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function resolveBackgroundPadding(props) {
|
|
166
|
+
const border = props.border;
|
|
167
|
+
if (!border) return { left: 0, top: 0, right: 0, bottom: 0 };
|
|
168
|
+
const sides = jsxCore.resolveBorderSides(border.width);
|
|
169
|
+
const align = border.align ?? "center";
|
|
170
|
+
const dotDiameterOverride = border.style === "dotted" ? border.dash?.[1] : void 0;
|
|
171
|
+
const resolveSidePadding = (sideWidth) => {
|
|
172
|
+
const dotRadius = dotDiameterOverride !== void 0 ? dotDiameterOverride / 2 : sideWidth / 2;
|
|
173
|
+
if (align === "inside") {
|
|
174
|
+
return Math.max(0, dotRadius - sideWidth / 2);
|
|
175
|
+
}
|
|
176
|
+
if (align === "outside") {
|
|
177
|
+
return sideWidth / 2 + dotRadius;
|
|
178
|
+
}
|
|
179
|
+
return dotRadius;
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
left: resolveSidePadding(sides.left),
|
|
183
|
+
top: resolveSidePadding(sides.top),
|
|
184
|
+
right: resolveSidePadding(sides.right),
|
|
185
|
+
bottom: resolveSidePadding(sides.bottom)
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function drawAdvancedBorder(graphics, w, h, cornerRadius, border, offsetX = 0, offsetY = 0) {
|
|
189
|
+
const sides = jsxCore.resolveBorderSides(border.width);
|
|
190
|
+
const corners = jsxCore.resolveCornerRadii(cornerRadius);
|
|
191
|
+
const maxSw = Math.max(sides.top, sides.right, sides.bottom, sides.left);
|
|
192
|
+
if (maxSw <= 0) return;
|
|
193
|
+
const isSolidUniform = jsxCore.isUniformBorder(sides) && (border.style ?? "solid") === "solid";
|
|
194
|
+
if (!isSolidUniform) {
|
|
195
|
+
const ctx = new OffsetVectorDrawContext(new PhaserVectorDrawContext.PhaserVectorDrawContext(graphics), offsetX, offsetY);
|
|
196
|
+
jsxCore.drawBorderGeometry(ctx, { box: { x: 0, y: 0, w, h }, sides, corners }, border);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const color = border.color ?? 16777215;
|
|
200
|
+
const alpha = typeof border.alpha === "number" ? border.alpha : 1;
|
|
201
|
+
const lineWidth = sides.top;
|
|
202
|
+
const rounded = jsxCore.hasAnyCornerRadius(corners);
|
|
203
|
+
const alignOff = (lw) => {
|
|
204
|
+
if (border.align === "inside") return lw / 2;
|
|
205
|
+
if (border.align === "outside") return -lw / 2;
|
|
206
|
+
return 0;
|
|
207
|
+
};
|
|
208
|
+
const offset = alignOff(lineWidth);
|
|
209
|
+
graphics.lineStyle(lineWidth, color, alpha);
|
|
210
|
+
if (rounded) {
|
|
211
|
+
graphics.strokeRoundedRect(
|
|
212
|
+
offsetX + offset,
|
|
213
|
+
offsetY + offset,
|
|
214
|
+
Math.max(0, w - offset * 2),
|
|
215
|
+
Math.max(0, h - offset * 2),
|
|
216
|
+
offsetCornerRadius(cornerRadius, offset)
|
|
217
|
+
);
|
|
218
|
+
} else {
|
|
219
|
+
graphics.strokeRect(
|
|
220
|
+
offsetX + offset,
|
|
221
|
+
offsetY + offset,
|
|
222
|
+
Math.max(0, w - offset * 2),
|
|
223
|
+
Math.max(0, h - offset * 2)
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function drawBackground(graphics, props, width, height, offsetX = 0, offsetY = 0) {
|
|
228
|
+
if (width <= 0 || height <= 0) return;
|
|
229
|
+
const unwrap = (v, fallback) => v !== void 0 && jsxCore.isAnimatedSignal(v) ? v.value : v ?? fallback;
|
|
230
|
+
const bgColor = props.backgroundColor;
|
|
231
|
+
const bgAlpha = unwrap(props.backgroundAlpha, 1);
|
|
232
|
+
const cornerRadius = props.cornerRadius ?? 0;
|
|
233
|
+
const advancedBorder = hasAdvancedBorder(props);
|
|
234
|
+
const borderWidth = advancedBorder ? jsxCore.resolveBorderSides(props.border?.width).top : props.borderWidth ?? 0;
|
|
235
|
+
const borderAlpha = advancedBorder ? unwrap(props.border?.alpha, 1) : unwrap(props.borderAlpha, 1);
|
|
236
|
+
const hasLegacyBorder = !advancedBorder && borderWidth > 0 && props.borderColor !== void 0;
|
|
237
|
+
const resolvedBorderColor = hasLegacyBorder ? props.borderColor : void 0;
|
|
238
|
+
const rounded = hasRoundedCorners(cornerRadius);
|
|
239
|
+
if (bgColor !== void 0) {
|
|
240
|
+
graphics.fillStyle(bgColor, bgAlpha);
|
|
241
|
+
}
|
|
242
|
+
if (hasLegacyBorder) {
|
|
243
|
+
graphics.lineStyle(borderWidth, resolvedBorderColor ?? 42, borderAlpha);
|
|
244
|
+
}
|
|
245
|
+
if (rounded) {
|
|
246
|
+
if (bgColor !== void 0) {
|
|
247
|
+
graphics.fillRoundedRect(offsetX, offsetY, width, height, cornerRadius);
|
|
248
|
+
}
|
|
249
|
+
if (hasLegacyBorder) {
|
|
250
|
+
const inset = borderWidth / 2;
|
|
251
|
+
graphics.strokeRoundedRect(
|
|
252
|
+
offsetX + inset,
|
|
253
|
+
offsetY + inset,
|
|
254
|
+
Math.max(0, width - borderWidth),
|
|
255
|
+
Math.max(0, height - borderWidth),
|
|
256
|
+
insetCornerRadius(cornerRadius, inset)
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
} else {
|
|
260
|
+
if (bgColor !== void 0) {
|
|
261
|
+
graphics.fillRect(offsetX, offsetY, width, height);
|
|
262
|
+
}
|
|
263
|
+
if (hasLegacyBorder) {
|
|
264
|
+
const inset = borderWidth / 2;
|
|
265
|
+
graphics.strokeRect(
|
|
266
|
+
offsetX + inset,
|
|
267
|
+
offsetY + inset,
|
|
268
|
+
Math.max(0, width - borderWidth),
|
|
269
|
+
Math.max(0, height - borderWidth)
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (advancedBorder && props.border) {
|
|
274
|
+
drawAdvancedBorder(graphics, width, height, cornerRadius, props.border, offsetX, offsetY);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function getSceneBackgroundTextureCache(scene) {
|
|
278
|
+
let cache = sceneBackgroundTextureCaches.get(scene);
|
|
279
|
+
if (!cache) {
|
|
280
|
+
cache = /* @__PURE__ */ new Map();
|
|
281
|
+
sceneBackgroundTextureCaches.set(scene, cache);
|
|
282
|
+
}
|
|
283
|
+
return cache;
|
|
284
|
+
}
|
|
285
|
+
function hashCacheKey(value) {
|
|
286
|
+
let hash = 2166136261;
|
|
287
|
+
for (let i = 0; i < value.length; i++) {
|
|
288
|
+
hash ^= value.charCodeAt(i);
|
|
289
|
+
hash = Math.imul(hash, 16777619);
|
|
290
|
+
}
|
|
291
|
+
return (hash >>> 0).toString(36);
|
|
292
|
+
}
|
|
293
|
+
function normalizeCornerRadius(radius) {
|
|
294
|
+
if (typeof radius === "number") {
|
|
295
|
+
return String(radius);
|
|
296
|
+
}
|
|
297
|
+
if (!radius) {
|
|
298
|
+
return "0";
|
|
299
|
+
}
|
|
300
|
+
return `${radius.tl ?? 0},${radius.tr ?? 0},${radius.bl ?? 0},${radius.br ?? 0}`;
|
|
301
|
+
}
|
|
302
|
+
function clearExistingCanvasTexture(scene, textureKey) {
|
|
303
|
+
if (!scene.textures.exists(textureKey)) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const texture = scene.textures.get(textureKey);
|
|
307
|
+
const source = texture?.getSourceImage?.();
|
|
308
|
+
if (!source || typeof source.getContext !== "function") {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const canvas = source;
|
|
312
|
+
const ctx = canvas.getContext("2d", { willReadFrequently: true });
|
|
313
|
+
if (!ctx) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
ctx.clearRect(0, 0, canvas.width ?? 0, canvas.height ?? 0);
|
|
317
|
+
}
|
|
318
|
+
function getBackgroundImageCacheKey(props, width, height) {
|
|
319
|
+
const padding = resolveBackgroundPadding(props);
|
|
320
|
+
const textureWidth = Math.max(1, Math.ceil(width + padding.left + padding.right));
|
|
321
|
+
const textureHeight = Math.max(1, Math.ceil(height + padding.top + padding.bottom));
|
|
322
|
+
const advanced = hasAdvancedBorder(props) && props.border;
|
|
323
|
+
const borderSuffix = advanced ? normalizeBorderForCache(props.border ?? {}) : "";
|
|
324
|
+
return [
|
|
325
|
+
textureWidth,
|
|
326
|
+
textureHeight,
|
|
327
|
+
props.backgroundColor ?? "none",
|
|
328
|
+
1,
|
|
329
|
+
// backgroundAlpha — handled via Image.alpha
|
|
330
|
+
normalizeCornerRadius(props.cornerRadius),
|
|
331
|
+
props.borderWidth ?? 0,
|
|
332
|
+
props.borderColor ?? "none",
|
|
333
|
+
1,
|
|
334
|
+
// borderAlpha — handled via Image.alpha
|
|
335
|
+
advanced ? `adv:${borderSuffix}` : ""
|
|
336
|
+
].join("|");
|
|
337
|
+
}
|
|
338
|
+
function createBackgroundImage(scene, props, width, height) {
|
|
339
|
+
if (!hasRenderableBackground(props)) {
|
|
340
|
+
return void 0;
|
|
341
|
+
}
|
|
342
|
+
const padding = resolveBackgroundPadding(props);
|
|
343
|
+
const textureWidth = Math.max(1, Math.ceil(width + padding.left + padding.right));
|
|
344
|
+
const textureHeight = Math.max(1, Math.ceil(height + padding.top + padding.bottom));
|
|
345
|
+
const cacheKey = getBackgroundImageCacheKey(props, width, height);
|
|
346
|
+
const textureKey = `__phaserjsx_bg_${hashCacheKey(cacheKey)}`;
|
|
347
|
+
const cache = getSceneBackgroundTextureCache(scene);
|
|
348
|
+
let entry = cache.get(cacheKey);
|
|
349
|
+
if (!entry || !scene.textures.exists(entry.textureKey)) {
|
|
350
|
+
const graphics = scene.add.graphics();
|
|
351
|
+
clearExistingCanvasTexture(scene, textureKey);
|
|
352
|
+
drawBackground(
|
|
353
|
+
graphics,
|
|
354
|
+
{ ...props, backgroundAlpha: 1, borderAlpha: 1 },
|
|
355
|
+
width,
|
|
356
|
+
height,
|
|
357
|
+
padding.left,
|
|
358
|
+
padding.top
|
|
359
|
+
);
|
|
360
|
+
graphics.generateTexture(textureKey, textureWidth, textureHeight);
|
|
361
|
+
graphics.destroy();
|
|
362
|
+
entry = { textureKey, refs: 0 };
|
|
363
|
+
cache.set(cacheKey, entry);
|
|
364
|
+
}
|
|
365
|
+
entry.refs++;
|
|
366
|
+
const bgAlpha = Math.max(
|
|
367
|
+
0,
|
|
368
|
+
Math.min(
|
|
369
|
+
1,
|
|
370
|
+
props.backgroundAlpha !== void 0 && jsxCore.isAnimatedSignal(props.backgroundAlpha) ? props.backgroundAlpha.value : props.backgroundAlpha ?? 1
|
|
371
|
+
)
|
|
372
|
+
);
|
|
373
|
+
const background = scene.add.image(0, 0, entry.textureKey);
|
|
374
|
+
background.setOrigin(0, 0);
|
|
375
|
+
background.setPosition(-padding.left, -padding.top);
|
|
376
|
+
background.alpha = bgAlpha;
|
|
377
|
+
background.__isBackground = true;
|
|
378
|
+
background.__backgroundCacheKey = cacheKey;
|
|
379
|
+
background.__backgroundTextureKey = entry.textureKey;
|
|
380
|
+
background.__backgroundOffsetX = -padding.left;
|
|
381
|
+
background.__backgroundOffsetY = -padding.top;
|
|
382
|
+
background.once("destroy", () => releaseBackgroundImageTexture(background));
|
|
383
|
+
return background;
|
|
384
|
+
}
|
|
385
|
+
function releaseBackgroundImageTexture(background) {
|
|
386
|
+
if (background.__backgroundTextureReleased) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const scene = background.scene;
|
|
390
|
+
const cacheKey = background.__backgroundCacheKey;
|
|
391
|
+
background.__backgroundTextureReleased = true;
|
|
392
|
+
if (!scene || !cacheKey) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const cache = sceneBackgroundTextureCaches.get(scene);
|
|
396
|
+
const entry = cache?.get(cacheKey);
|
|
397
|
+
if (!cache || !entry) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
entry.refs--;
|
|
401
|
+
if (entry.refs <= 0) {
|
|
402
|
+
cache.delete(cacheKey);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function destroyBackgroundImage(background) {
|
|
406
|
+
background.destroy();
|
|
407
|
+
}
|
|
408
|
+
exports.createBackgroundImage = createBackgroundImage;
|
|
409
|
+
exports.destroyBackgroundImage = destroyBackgroundImage;
|
|
410
|
+
exports.getBackgroundImageCacheKey = getBackgroundImageCacheKey;
|
|
411
|
+
//# sourceMappingURL=backgroundImage.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundImage.cjs","sources":["../../src/components/backgroundImage.ts"],"sourcesContent":["import {\n drawBorderGeometry,\n hasAnyCornerRadius,\n isAnimatedSignal,\n isUniformBorder,\n resolveBorderSides,\n resolveCornerRadii,\n type BorderPropsV2,\n type VectorDrawContext,\n} from '@number10/jsx-core'\nimport * as Phaser from 'phaser'\nimport type { BackgroundProps } from '../core-props'\nimport { PhaserVectorDrawContext } from '../vector/PhaserVectorDrawContext'\n\nexport type BackgroundImage = Phaser.GameObjects.Image & {\n __isBackground?: boolean\n __backgroundCacheKey?: string\n __backgroundTextureKey?: string\n __backgroundTextureReleased?: boolean\n __backgroundOffsetX?: number\n __backgroundOffsetY?: number\n}\n\ntype BackgroundTextureCacheEntry = {\n textureKey: string\n refs: number\n}\n\nconst sceneBackgroundTextureCaches = new WeakMap<\n Phaser.Scene,\n Map<string, BackgroundTextureCacheEntry>\n>()\n\ntype CornerRadius = NonNullable<BackgroundProps['cornerRadius']>\ntype RenderPadding = { left: number; top: number; right: number; bottom: number }\n\nclass OffsetVectorDrawContext implements VectorDrawContext {\n constructor(\n private readonly base: VectorDrawContext,\n private readonly dx: number,\n private readonly dy: number\n ) {}\n\n clear(): this {\n this.base.clear()\n return this\n }\n\n fillStyle(color: number, alpha?: number): this {\n this.base.fillStyle(color, alpha)\n return this\n }\n\n lineStyle(width: number, color: number, alpha?: number): this {\n this.base.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.base.arc(x + this.dx, y + this.dy, radius, startAngle, endAngle, anticlockwise)\n return this\n }\n\n fillCircle(x: number, y: number, radius: number): this {\n this.base.fillCircle(x + this.dx, y + this.dy, radius)\n return this\n }\n\n strokeCircle(x: number, y: number, radius: number): this {\n this.base.strokeCircle(x + this.dx, y + this.dy, radius)\n return this\n }\n\n fillCircleStyled(x: number, y: number, radius: number, color: number, alpha: number): this {\n this.base.fillCircleStyled(x + this.dx, y + this.dy, radius, color, alpha)\n return this\n }\n\n fillRect(x: number, y: number, width: number, height: number): this {\n this.base.fillRect(x + this.dx, y + this.dy, width, height)\n return this\n }\n\n strokeRect(x: number, y: number, width: number, height: number): this {\n this.base.strokeRect(x + this.dx, y + this.dy, width, height)\n return this\n }\n\n fillRoundedRect(x: number, y: number, width: number, height: number, radius: number): this {\n this.base.fillRoundedRect(x + this.dx, y + this.dy, width, height, radius)\n return this\n }\n\n strokeRoundedRect(x: number, y: number, width: number, height: number, radius: number): this {\n this.base.strokeRoundedRect(x + this.dx, y + this.dy, width, height, radius)\n return this\n }\n\n beginPath(): this {\n this.base.beginPath()\n return this\n }\n\n moveTo(x: number, y: number): this {\n this.base.moveTo(x + this.dx, y + this.dy)\n return this\n }\n\n lineTo(x: number, y: number): this {\n this.base.lineTo(x + this.dx, y + this.dy)\n return this\n }\n\n closePath(): this {\n this.base.closePath()\n return this\n }\n\n fillPath(): this {\n this.base.fillPath()\n return this\n }\n\n strokePath(): this {\n this.base.strokePath()\n return this\n }\n\n lineBetween(x1: number, y1: number, x2: number, y2: number): this {\n this.base.lineBetween(x1 + this.dx, y1 + this.dy, x2 + this.dx, y2 + this.dy)\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.base.strokeLine(\n x1 + this.dx,\n y1 + this.dy,\n x2 + this.dx,\n y2 + this.dy,\n width,\n color,\n alpha\n )\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.base.fillArc(cx + this.dx, cy + this.dy, r, startAngle, endAngle, color, alpha)\n return this\n }\n}\n\n/**\n * Check whether the props contain a BorderPropsV2 with renderable width.\n */\nfunction hasAdvancedBorder(props: Partial<BackgroundProps>): boolean {\n const border = props.border\n if (!border) return false\n const w = resolveBorderSides(border.width)\n return w.top > 0 || w.right > 0 || w.bottom > 0 || w.left > 0\n}\n\n/**\n * Normalize a BorderPropsV2 for cache key purposes (strip animated alpha).\n */\nfunction normalizeBorderForCache(border: BorderPropsV2): string {\n const width = border.width\n const widthStr =\n typeof width === 'number'\n ? String(width)\n : `${width?.top ?? 0},${width?.right ?? 0},${width?.bottom ?? 0},${width?.left ?? 0}`\n return [\n border.color ?? 'none',\n widthStr,\n border.style ?? 'solid',\n border.dash?.join(',') ?? '',\n border.dashOffset ?? 0,\n border.cap ?? '',\n border.join ?? '',\n border.align ?? 'center',\n ].join('|')\n}\n\nfunction hasRenderableBackground(props: Partial<BackgroundProps>): boolean {\n const hasBackground = props.backgroundColor !== undefined\n const hasBorder = (props.borderWidth ?? 0) > 0 && props.borderColor !== undefined\n const hasAdvanced = hasAdvancedBorder(props)\n return hasBackground || hasBorder || hasAdvanced\n}\n\nfunction hasRoundedCorners(radius: CornerRadius): boolean {\n if (typeof radius === 'number') {\n return radius !== 0\n }\n\n return (\n (radius.tl ?? 0) !== 0 ||\n (radius.tr ?? 0) !== 0 ||\n (radius.bl ?? 0) !== 0 ||\n (radius.br ?? 0) !== 0\n )\n}\n\nfunction insetCornerRadius(radius: CornerRadius, inset: number): CornerRadius {\n const insetSingleRadius = (value: number | undefined): number => {\n const resolved = value ?? 0\n const sign = resolved < 0 ? -1 : 1\n return sign * Math.max(0, Math.abs(resolved) - inset)\n }\n\n if (typeof radius === 'number') {\n return insetSingleRadius(radius)\n }\n\n return {\n tl: insetSingleRadius(radius.tl),\n tr: insetSingleRadius(radius.tr),\n bl: insetSingleRadius(radius.bl),\n br: insetSingleRadius(radius.br),\n }\n}\n\nfunction offsetCornerRadius(radius: CornerRadius, offset: number): CornerRadius {\n const shiftSingleRadius = (value: number | undefined): number =>\n Math.max(0, (value ?? 0) - offset)\n\n if (typeof radius === 'number') {\n return shiftSingleRadius(radius)\n }\n\n return {\n tl: shiftSingleRadius(radius.tl),\n tr: shiftSingleRadius(radius.tr),\n bl: shiftSingleRadius(radius.bl),\n br: shiftSingleRadius(radius.br),\n }\n}\n\nfunction resolveBackgroundPadding(props: Partial<BackgroundProps>): RenderPadding {\n const border = props.border\n if (!border) return { left: 0, top: 0, right: 0, bottom: 0 }\n\n const sides = resolveBorderSides(border.width)\n const align = border.align ?? 'center'\n const dotDiameterOverride = border.style === 'dotted' ? border.dash?.[1] : undefined\n\n const resolveSidePadding = (sideWidth: number): number => {\n const dotRadius = dotDiameterOverride !== undefined ? dotDiameterOverride / 2 : sideWidth / 2\n if (align === 'inside') {\n return Math.max(0, dotRadius - sideWidth / 2)\n }\n if (align === 'outside') {\n return sideWidth / 2 + dotRadius\n }\n return dotRadius\n }\n\n return {\n left: resolveSidePadding(sides.left),\n top: resolveSidePadding(sides.top),\n right: resolveSidePadding(sides.right),\n bottom: resolveSidePadding(sides.bottom),\n }\n}\n\n/**\n * Draw an advanced border using either the core geometry fallback (for\n * asymmetric, dashed, dotted, and other problematic cases) or native\n * Phaser stroke (for simple symmetric solid borders).\n *\n * ## Core Fallback\n *\n * All asymmetric, dashed, and dotted borders are routed through\n * {@link drawBorderGeometry} from `@number10/jsx-core`. This ensures:\n * - Single source of truth for border geometry\n * - Consistent dotted rendering (real round circles)\n * - Proper dashed arc-following on rounded corners\n *\n * ## Native Path\n *\n * Only symmetric solid borders use the native Phaser `strokeRect` /\n * `strokeRoundedRect` for optimal performance.\n */\nfunction drawAdvancedBorder(\n graphics: Phaser.GameObjects.Graphics,\n w: number,\n h: number,\n cornerRadius: CornerRadius,\n border: BorderPropsV2,\n offsetX = 0,\n offsetY = 0\n): void {\n const sides = resolveBorderSides(border.width)\n const corners = resolveCornerRadii(cornerRadius)\n const maxSw = Math.max(sides.top, sides.right, sides.bottom, sides.left)\n if (maxSw <= 0) return\n\n const isSolidUniform = isUniformBorder(sides) && (border.style ?? 'solid') === 'solid'\n\n if (!isSolidUniform) {\n // Route through core: asymmetric, dashed, dotted, rounded-complex\n const ctx = new OffsetVectorDrawContext(new PhaserVectorDrawContext(graphics), offsetX, offsetY)\n drawBorderGeometry(ctx, { box: { x: 0, y: 0, w, h }, sides, corners }, border)\n return\n }\n\n // --- Native path: symmetric solid only ---\n const color = border.color ?? 0xffffff\n const alpha = typeof border.alpha === 'number' ? border.alpha : 1\n const lineWidth = sides.top\n const rounded = hasAnyCornerRadius(corners)\n\n const alignOff = (lw: number): number => {\n if (border.align === 'inside') return lw / 2\n if (border.align === 'outside') return -lw / 2\n return 0\n }\n const offset = alignOff(lineWidth)\n graphics.lineStyle(lineWidth, color, alpha)\n if (rounded) {\n graphics.strokeRoundedRect(\n offsetX + offset,\n offsetY + offset,\n Math.max(0, w - offset * 2),\n Math.max(0, h - offset * 2),\n offsetCornerRadius(cornerRadius, offset)\n )\n } else {\n graphics.strokeRect(\n offsetX + offset,\n offsetY + offset,\n Math.max(0, w - offset * 2),\n Math.max(0, h - offset * 2)\n )\n }\n}\n\nfunction drawBackground(\n graphics: Phaser.GameObjects.Graphics,\n props: Partial<BackgroundProps>,\n width: number,\n height: number,\n offsetX = 0,\n offsetY = 0\n): void {\n if (width <= 0 || height <= 0) return\n\n const unwrap = (v: unknown, fallback: number): number =>\n v !== undefined && isAnimatedSignal(v) ? v.value : ((v as number) ?? fallback)\n const bgColor = props.backgroundColor\n const bgAlpha = unwrap(props.backgroundAlpha, 1)\n const cornerRadius = props.cornerRadius ?? 0\n const advancedBorder = hasAdvancedBorder(props)\n const borderWidth = advancedBorder\n ? resolveBorderSides(props.border?.width).top\n : (props.borderWidth ?? 0)\n const borderAlpha = advancedBorder ? unwrap(props.border?.alpha, 1) : unwrap(props.borderAlpha, 1)\n const hasLegacyBorder = !advancedBorder && borderWidth > 0 && props.borderColor !== undefined\n const resolvedBorderColor = hasLegacyBorder ? (props.borderColor as number) : undefined\n const rounded = hasRoundedCorners(cornerRadius)\n\n if (bgColor !== undefined) {\n graphics.fillStyle(bgColor, bgAlpha)\n }\n\n if (hasLegacyBorder) {\n graphics.lineStyle(borderWidth, resolvedBorderColor ?? 42, borderAlpha)\n }\n\n if (rounded) {\n if (bgColor !== undefined) {\n graphics.fillRoundedRect(offsetX, offsetY, width, height, cornerRadius)\n }\n if (hasLegacyBorder) {\n const inset = borderWidth / 2\n graphics.strokeRoundedRect(\n offsetX + inset,\n offsetY + inset,\n Math.max(0, width - borderWidth),\n Math.max(0, height - borderWidth),\n insetCornerRadius(cornerRadius, inset)\n )\n }\n } else {\n if (bgColor !== undefined) {\n graphics.fillRect(offsetX, offsetY, width, height)\n }\n if (hasLegacyBorder) {\n const inset = borderWidth / 2\n graphics.strokeRect(\n offsetX + inset,\n offsetY + inset,\n Math.max(0, width - borderWidth),\n Math.max(0, height - borderWidth)\n )\n }\n }\n\n // Draw advanced border on top of background fill\n if (advancedBorder && props.border) {\n drawAdvancedBorder(graphics, width, height, cornerRadius, props.border, offsetX, offsetY)\n }\n}\n\nfunction getSceneBackgroundTextureCache(\n scene: Phaser.Scene\n): Map<string, BackgroundTextureCacheEntry> {\n let cache = sceneBackgroundTextureCaches.get(scene)\n\n if (!cache) {\n cache = new Map()\n sceneBackgroundTextureCaches.set(scene, cache)\n }\n\n return cache\n}\n\nfunction hashCacheKey(value: string): string {\n let hash = 2166136261\n\n for (let i = 0; i < value.length; i++) {\n hash ^= value.charCodeAt(i)\n hash = Math.imul(hash, 16777619)\n }\n\n return (hash >>> 0).toString(36)\n}\n\nfunction normalizeCornerRadius(radius: BackgroundProps['cornerRadius']): string {\n if (typeof radius === 'number') {\n return String(radius)\n }\n\n if (!radius) {\n return '0'\n }\n\n return `${radius.tl ?? 0},${radius.tr ?? 0},${radius.bl ?? 0},${radius.br ?? 0}`\n}\n\nfunction clearExistingCanvasTexture(scene: Phaser.Scene, textureKey: string): void {\n if (!scene.textures.exists(textureKey)) {\n return\n }\n\n const texture = scene.textures.get(textureKey)\n const source = texture?.getSourceImage?.()\n\n if (!source || typeof (source as { getContext?: unknown }).getContext !== 'function') {\n return\n }\n\n const canvas = source as {\n width?: number\n height?: number\n getContext: (\n type: string,\n options?: { willReadFrequently?: boolean }\n ) => CanvasRenderingContext2D | null\n }\n const ctx = canvas.getContext('2d', { willReadFrequently: true })\n if (!ctx) {\n return\n }\n\n ctx.clearRect(0, 0, canvas.width ?? 0, canvas.height ?? 0)\n}\n\nexport function getBackgroundImageCacheKey(\n props: Partial<BackgroundProps>,\n width: number,\n height: number\n): string {\n // Alpha is applied via Image.alpha, not baked into the texture,\n // so always use 1 for the cache key.\n const padding = resolveBackgroundPadding(props)\n const textureWidth = Math.max(1, Math.ceil(width + padding.left + padding.right))\n const textureHeight = Math.max(1, Math.ceil(height + padding.top + padding.bottom))\n const advanced = hasAdvancedBorder(props) && props.border\n const borderSuffix = advanced ? normalizeBorderForCache(props.border ?? {}) : ''\n return [\n textureWidth,\n textureHeight,\n props.backgroundColor ?? 'none',\n 1, // backgroundAlpha — handled via Image.alpha\n normalizeCornerRadius(props.cornerRadius),\n props.borderWidth ?? 0,\n props.borderColor ?? 'none',\n 1, // borderAlpha — handled via Image.alpha\n advanced ? `adv:${borderSuffix}` : '',\n ].join('|')\n}\n\nexport function createBackgroundImage(\n scene: Phaser.Scene,\n props: Partial<BackgroundProps>,\n width: number,\n height: number\n): BackgroundImage | undefined {\n if (!hasRenderableBackground(props)) {\n return undefined\n }\n\n const padding = resolveBackgroundPadding(props)\n const textureWidth = Math.max(1, Math.ceil(width + padding.left + padding.right))\n const textureHeight = Math.max(1, Math.ceil(height + padding.top + padding.bottom))\n const cacheKey = getBackgroundImageCacheKey(props, width, height)\n const textureKey = `__phaserjsx_bg_${hashCacheKey(cacheKey)}`\n const cache = getSceneBackgroundTextureCache(scene)\n let entry = cache.get(cacheKey)\n\n if (!entry || !scene.textures.exists(entry.textureKey)) {\n const graphics = scene.add.graphics()\n\n clearExistingCanvasTexture(scene, textureKey)\n\n // Draw texture with alpha=1 — the actual alpha is applied via Image.alpha\n // so that animated signals can update it without recreating the texture.\n drawBackground(\n graphics,\n { ...props, backgroundAlpha: 1, borderAlpha: 1 },\n width,\n height,\n padding.left,\n padding.top\n )\n graphics.generateTexture(textureKey, textureWidth, textureHeight)\n graphics.destroy()\n\n entry = { textureKey, refs: 0 }\n cache.set(cacheKey, entry)\n }\n\n entry.refs++\n\n const bgAlpha = Math.max(\n 0,\n Math.min(\n 1,\n props.backgroundAlpha !== undefined && isAnimatedSignal(props.backgroundAlpha)\n ? props.backgroundAlpha.value\n : (props.backgroundAlpha ?? 1)\n )\n )\n const background = scene.add.image(0, 0, entry.textureKey) as BackgroundImage\n background.setOrigin(0, 0)\n background.setPosition(-padding.left, -padding.top)\n background.alpha = bgAlpha as number\n background.__isBackground = true\n background.__backgroundCacheKey = cacheKey\n background.__backgroundTextureKey = entry.textureKey\n background.__backgroundOffsetX = -padding.left\n background.__backgroundOffsetY = -padding.top\n background.once('destroy', () => releaseBackgroundImageTexture(background))\n\n return background\n}\n\nfunction releaseBackgroundImageTexture(background: BackgroundImage): void {\n if (background.__backgroundTextureReleased) {\n return\n }\n\n const scene = background.scene\n const cacheKey = background.__backgroundCacheKey\n\n background.__backgroundTextureReleased = true\n\n if (!scene || !cacheKey) {\n return\n }\n\n const cache = sceneBackgroundTextureCaches.get(scene)\n const entry = cache?.get(cacheKey)\n\n if (!cache || !entry) {\n return\n }\n\n entry.refs--\n\n if (entry.refs <= 0) {\n // NOTE: Do NOT call scene.textures.remove() here.\n // Removing a texture from Phaser's texture manager while live Image\n // game objects still reference it causes a null-texture crash in\n // Phaser's rendering pipeline (TexturerImage.run → resolution of null).\n // This happens when multiple tabs share the same background cache key\n // and the VDOM processes children in an order where one tab's old\n // background is destroyed after another tab's new background was\n // created with the same texture key. The eager removal nulls the\n // texture on the newly created Image before it renders.\n //\n // Instead, we simply drop the cache entry and let Phaser manage the\n // texture lifecycle. Background textures are typically small\n // solid-color textures (a few KB), so the memory cost of keeping\n // them in the texture manager is negligible.\n cache.delete(cacheKey)\n }\n}\n\nexport function destroyBackgroundImage(background: BackgroundImage): void {\n background.destroy()\n}\n"],"names":["resolveBorderSides","resolveCornerRadii","isUniformBorder","PhaserVectorDrawContext","drawBorderGeometry","hasAnyCornerRadius","isAnimatedSignal"],"mappings":";;;;;AA4BA,MAAM,mDAAmC,QAAA;AAQzC,MAAM,wBAAqD;AAAA,EACzD,YACmB,MACA,IACA,IACjB;AAHiB,SAAA,OAAA;AACA,SAAA,KAAA;AACA,SAAA,KAAA;AAAA,EAChB;AAAA,EAHgB;AAAA,EACA;AAAA,EACA;AAAA,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AAEA,SAAS,8BAA8B,YAAmC;AACxE,MAAI,WAAW,6BAA6B;AAC1C;AAAA,EACF;AAEA,QAAM,QAAQ,WAAW;AACzB,QAAM,WAAW,WAAW;AAE5B,aAAW,8BAA8B;AAEzC,MAAI,CAAC,SAAS,CAAC,UAAU;AACvB;AAAA,EACF;AAEA,QAAM,QAAQ,6BAA6B,IAAI,KAAK;AACpD,QAAM,QAAQ,OAAO,IAAI,QAAQ;AAEjC,MAAI,CAAC,SAAS,CAAC,OAAO;AACpB;AAAA,EACF;AAEA,QAAM;AAEN,MAAI,MAAM,QAAQ,GAAG;AAenB,UAAM,OAAO,QAAQ;AAAA,EACvB;AACF;AAEO,SAAS,uBAAuB,YAAmC;AACxE,aAAW,QAAA;AACb;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BackgroundProps } from '../core-props';
|
|
2
|
+
import * as Phaser from 'phaser';
|
|
3
|
+
export type BackgroundImage = Phaser.GameObjects.Image & {
|
|
4
|
+
__isBackground?: boolean;
|
|
5
|
+
__backgroundCacheKey?: string;
|
|
6
|
+
__backgroundTextureKey?: string;
|
|
7
|
+
__backgroundTextureReleased?: boolean;
|
|
8
|
+
__backgroundOffsetX?: number;
|
|
9
|
+
__backgroundOffsetY?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function getBackgroundImageCacheKey(props: Partial<BackgroundProps>, width: number, height: number): string;
|
|
12
|
+
export declare function createBackgroundImage(scene: Phaser.Scene, props: Partial<BackgroundProps>, width: number, height: number): BackgroundImage | undefined;
|
|
13
|
+
export declare function destroyBackgroundImage(background: BackgroundImage): void;
|
|
14
|
+
//# sourceMappingURL=backgroundImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundImage.d.ts","sourceRoot":"","sources":["../../src/components/backgroundImage.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,GAAG;IACvD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,2BAA2B,CAAC,EAAE,OAAO,CAAA;IACrC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAsdD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,EAC/B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM,CAmBR;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,EAC/B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,SAAS,CA0D7B;AA4CD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAExE"}
|