@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 @@
|
|
|
1
|
+
{"version":3,"file":"use-particles.js","sources":["../../src/particles/use-particles.ts"],"sourcesContent":["/**\n * Hook for imperative particle control\n */\nimport { useCallback } from '../hooks'\nimport type { RefObject } from '../types'\nimport {\n buildDeathZonesFromLayout,\n buildEmitZoneFromLayout,\n type ParticleDeathZoneConfig,\n type ParticleZoneConfig,\n} from './emit-zone'\nimport type { ParticleEmitter, ParticleEmitterManagerLike, ParticlesHandle } from './particle-types'\nimport type { ParticleEmitterConfig } from './preset-registry'\nimport {\n applyDeathZone,\n applyEmitZone,\n applyEmitterConfig,\n getFirstEmitter,\n isParticleEmitter,\n} from './utils'\n\nexport function useParticles(ref: RefObject<ParticlesHandle | null>): {\n getManager: () => ParticlesHandle | null\n getEmitter: () => ParticleEmitter | null\n start: () => void\n stop: () => void\n explode: (count: number, x?: number, y?: number) => void\n setConfig: (config: ParticleEmitterConfig) => void\n setEmitZone: (zone: ParticleZoneConfig, width?: number, height?: number) => void\n setDeathZones: (\n zones: ParticleDeathZoneConfig | ParticleDeathZoneConfig[],\n width?: number,\n height?: number\n ) => void\n /**\n * @deprecated Use setDeathZones.\n */\n setExcludeZones: (\n zones: ParticleDeathZoneConfig | ParticleDeathZoneConfig[],\n width?: number,\n height?: number\n ) => void\n} {\n const getManager = useCallback(() => ref.current ?? null, [ref])\n const getEmitter = useCallback(() => {\n const current = ref.current\n if (!current) return null\n if (isParticleEmitter(current)) return current\n return getFirstEmitter(current as ParticleEmitterManagerLike)\n }, [ref])\n\n const start = useCallback(() => {\n const emitter = getEmitter()\n emitter?.start()\n }, [getEmitter])\n\n const stop = useCallback(() => {\n const emitter = getEmitter()\n emitter?.stop()\n }, [getEmitter])\n\n const explode = useCallback(\n (count: number, x?: number, y?: number) => {\n const emitter = getEmitter()\n emitter?.explode(count, x, y)\n },\n [getEmitter]\n )\n\n const setConfig = useCallback(\n (config: ParticleEmitterConfig) => {\n const emitter = getEmitter()\n applyEmitterConfig(emitter, config)\n },\n [getEmitter]\n )\n\n const setEmitZone = useCallback(\n (zone: ParticleZoneConfig, width?: number, height?: number) => {\n const emitter = getEmitter()\n const emitZone = buildEmitZoneFromLayout(zone, width, height)\n applyEmitZone(emitter, emitZone)\n },\n [getEmitter]\n )\n\n const setDeathZones = useCallback(\n (\n zones: ParticleDeathZoneConfig | ParticleDeathZoneConfig[],\n width?: number,\n height?: number\n ) => {\n const emitter = getEmitter()\n const manager = getManager()\n const deathZones = buildDeathZonesFromLayout(zones, width, height, manager ?? undefined)\n applyDeathZone(emitter, deathZones)\n },\n [getEmitter, getManager]\n )\n\n return {\n getManager,\n getEmitter,\n start,\n stop,\n explode,\n setConfig,\n setEmitZone,\n setDeathZones,\n setExcludeZones: setDeathZones,\n }\n}\n"],"names":[],"mappings":";;;;AAqBO,SAAS,aAAa,KAqB3B;AACA,QAAM,aAAa,YAAY,MAAM,IAAI,WAAW,MAAM,CAAC,GAAG,CAAC;AAC/D,QAAM,aAAa,YAAY,MAAM;AACnC,UAAM,UAAU,IAAI;AACpB,QAAI,CAAC,QAAS,QAAO;AACrB,QAAI,kBAAkB,OAAO,EAAG,QAAO;AACvC,WAAO,gBAAgB,OAAqC;AAAA,EAC9D,GAAG,CAAC,GAAG,CAAC;AAER,QAAM,QAAQ,YAAY,MAAM;AAC9B,UAAM,UAAU,WAAA;AAChB,aAAS,MAAA;AAAA,EACX,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,OAAO,YAAY,MAAM;AAC7B,UAAM,UAAU,WAAA;AAChB,aAAS,KAAA;AAAA,EACX,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,UAAU;AAAA,IACd,CAAC,OAAe,GAAY,MAAe;AACzC,YAAM,UAAU,WAAA;AAChB,eAAS,QAAQ,OAAO,GAAG,CAAC;AAAA,IAC9B;AAAA,IACA,CAAC,UAAU;AAAA,EAAA;AAGb,QAAM,YAAY;AAAA,IAChB,CAAC,WAAkC;AACjC,YAAM,UAAU,WAAA;AAChB,yBAAmB,SAAS,MAAM;AAAA,IACpC;AAAA,IACA,CAAC,UAAU;AAAA,EAAA;AAGb,QAAM,cAAc;AAAA,IAClB,CAAC,MAA0B,OAAgB,WAAoB;AAC7D,YAAM,UAAU,WAAA;AAChB,YAAM,WAAW,wBAAwB,MAAM,OAAO,MAAM;AAC5D,oBAAc,SAAS,QAAQ;AAAA,IACjC;AAAA,IACA,CAAC,UAAU;AAAA,EAAA;AAGb,QAAM,gBAAgB;AAAA,IACpB,CACE,OACA,OACA,WACG;AACH,YAAM,UAAU,WAAA;AAChB,YAAM,UAAU,WAAA;AAChB,YAAM,aAAa,0BAA0B,OAAO,OAAO,QAAQ,WAAW,MAAS;AACvF,qBAAe,SAAS,UAAU;AAAA,IACpC;AAAA,IACA,CAAC,YAAY,UAAU;AAAA,EAAA;AAGzB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB;AAAA,EAAA;AAErB;"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function isParticleEmitter(target) {
|
|
4
|
+
return !!target && typeof target.explode === "function";
|
|
5
|
+
}
|
|
6
|
+
function getFirstEmitter(manager) {
|
|
7
|
+
if (!manager) return null;
|
|
8
|
+
if (manager.__emitter) return manager.__emitter;
|
|
9
|
+
const emitters = manager.emitters;
|
|
10
|
+
if (Array.isArray(emitters)) {
|
|
11
|
+
return emitters[0] ?? null;
|
|
12
|
+
}
|
|
13
|
+
if (emitters && "list" in emitters && Array.isArray(emitters.list)) {
|
|
14
|
+
return emitters.list[0] ?? null;
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
function applyEmitterConfig(emitter, config) {
|
|
19
|
+
if (!emitter) return;
|
|
20
|
+
const withConfig = emitter;
|
|
21
|
+
if (withConfig.setConfig) {
|
|
22
|
+
withConfig.setConfig(config);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (withConfig.fromJSON) {
|
|
26
|
+
withConfig.fromJSON(config);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
Object.assign(emitter, config);
|
|
30
|
+
}
|
|
31
|
+
function applyEmitZone(emitter, emitZone) {
|
|
32
|
+
if (!emitter || !emitZone) return;
|
|
33
|
+
const withZone = emitter;
|
|
34
|
+
if (withZone.setEmitZone) {
|
|
35
|
+
withZone.setEmitZone(emitZone);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function applyDeathZone(emitter, deathZone) {
|
|
40
|
+
if (!emitter) return;
|
|
41
|
+
const withZone = emitter;
|
|
42
|
+
const isDefined = (value) => value !== null && value !== void 0;
|
|
43
|
+
const normalized = Array.isArray(deathZone) ? deathZone.filter(isDefined) : deathZone ? [deathZone] : [];
|
|
44
|
+
const hasZone = normalized.length > 0;
|
|
45
|
+
if (hasZone && withZone.setDeathZone) {
|
|
46
|
+
withZone.setDeathZone(normalized);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (!hasZone) {
|
|
50
|
+
if (withZone.clearDeathZones) {
|
|
51
|
+
withZone.clearDeathZones();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (withZone.deathZones) {
|
|
55
|
+
withZone.deathZones = [];
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (withZone.clearDeathZones) {
|
|
60
|
+
withZone.clearDeathZones();
|
|
61
|
+
}
|
|
62
|
+
if (withZone.addDeathZone) {
|
|
63
|
+
withZone.addDeathZone(normalized);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (withZone.deathZones) {
|
|
67
|
+
withZone.deathZones = normalized;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function mergeDeathZones(base, extra) {
|
|
71
|
+
const baseList = Array.isArray(base) ? base : base ? [base] : [];
|
|
72
|
+
const extraList = extra ?? [];
|
|
73
|
+
const merged = [...baseList, ...extraList];
|
|
74
|
+
return merged.length > 0 ? merged : void 0;
|
|
75
|
+
}
|
|
76
|
+
exports.applyDeathZone = applyDeathZone;
|
|
77
|
+
exports.applyEmitZone = applyEmitZone;
|
|
78
|
+
exports.applyEmitterConfig = applyEmitterConfig;
|
|
79
|
+
exports.getFirstEmitter = getFirstEmitter;
|
|
80
|
+
exports.isParticleEmitter = isParticleEmitter;
|
|
81
|
+
exports.mergeDeathZones = mergeDeathZones;
|
|
82
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../src/particles/utils.ts"],"sourcesContent":["/**\n * Particle utilities shared across hooks/components\n */\nimport type * as Phaser from 'phaser'\nimport type { DeathZoneConfig, EmitZoneConfig } from './emit-zone'\nimport type { ParticleEmitter, ParticleEmitterManagerLike, ParticlesHandle } from './particle-types'\nimport type { ParticleEmitterConfig } from './preset-registry'\n\nexport function isParticleEmitter(target: ParticlesHandle | null): target is ParticleEmitter {\n return !!target && typeof (target as ParticleEmitter).explode === 'function'\n}\n\nexport function getFirstEmitter(\n manager: ParticleEmitterManagerLike | null\n): ParticleEmitter | null {\n if (!manager) return null\n if (manager.__emitter) return manager.__emitter\n const emitters = (manager as unknown as { emitters?: { list?: unknown[] } | unknown[] }).emitters\n if (Array.isArray(emitters)) {\n return (emitters[0] as ParticleEmitter) ?? null\n }\n if (emitters && 'list' in emitters && Array.isArray(emitters.list)) {\n return (emitters.list[0] as ParticleEmitter) ?? null\n }\n return null\n}\n\nexport function applyEmitterConfig(\n emitter: ParticleEmitter | null,\n config: ParticleEmitterConfig\n): void {\n if (!emitter) return\n const withConfig = emitter as Phaser.GameObjects.Particles.ParticleEmitter & {\n setConfig?: (config: ParticleEmitterConfig) => void\n fromJSON?: (config: ParticleEmitterConfig) => void\n }\n\n if (withConfig.setConfig) {\n withConfig.setConfig(config)\n return\n }\n\n if (withConfig.fromJSON) {\n withConfig.fromJSON(config)\n return\n }\n\n Object.assign(emitter, config)\n}\n\nexport function applyEmitZone(\n emitter: ParticleEmitter | null,\n emitZone: EmitZoneConfig | undefined\n): void {\n if (!emitter || !emitZone) return\n const withZone = emitter as Phaser.GameObjects.Particles.ParticleEmitter & {\n setEmitZone?: (config: EmitZoneConfig) => void\n }\n\n if (withZone.setEmitZone) {\n withZone.setEmitZone(emitZone)\n return\n }\n}\n\nexport function applyDeathZone(\n emitter: ParticleEmitter | null,\n deathZone: DeathZoneConfig | DeathZoneConfig[] | undefined\n): void {\n if (!emitter) return\n const withZone = emitter as Phaser.GameObjects.Particles.ParticleEmitter & {\n setDeathZone?: (config: DeathZoneConfig | DeathZoneConfig[]) => void\n addDeathZone?: (config: DeathZoneConfig | DeathZoneConfig[]) => void\n clearDeathZones?: () => void\n deathZones?: unknown[]\n }\n\n const isDefined = <T>(value: T | null | undefined): value is T =>\n value !== null && value !== undefined\n const normalized = Array.isArray(deathZone)\n ? deathZone.filter(isDefined)\n : deathZone\n ? [deathZone]\n : []\n const hasZone = normalized.length > 0\n\n if (hasZone && withZone.setDeathZone) {\n withZone.setDeathZone(normalized)\n return\n }\n\n if (!hasZone) {\n if (withZone.clearDeathZones) {\n withZone.clearDeathZones()\n return\n }\n if (withZone.deathZones) {\n withZone.deathZones = []\n }\n return\n }\n\n if (withZone.clearDeathZones) {\n withZone.clearDeathZones()\n }\n if (withZone.addDeathZone) {\n withZone.addDeathZone(normalized)\n return\n }\n if (withZone.deathZones) {\n ;(withZone as unknown as { deathZones?: unknown[] }).deathZones = normalized\n }\n}\n\nexport function mergeDeathZones(\n base: unknown | unknown[] | undefined,\n extra: unknown[] | undefined\n): unknown[] | undefined {\n const baseList = Array.isArray(base) ? base : base ? [base] : []\n const extraList = extra ?? []\n const merged = [...baseList, ...extraList]\n return merged.length > 0 ? merged : undefined\n}\n"],"names":[],"mappings":";;AAQO,SAAS,kBAAkB,QAA2D;AAC3F,SAAO,CAAC,CAAC,UAAU,O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AI,SAAS,iBAAiB;AAC5B,aAAS,gBAAA;AAAA,EACX;AACA,MAAI,SAAS,cAAc;AACzB,aAAS,aAAa,UAAU;AAChC;AAAA,EACF;AACA,MAAI,SAAS,YAAY;AACrB,aAAmD,aAAa;AAAA,EACpE;AACF;AAEO,SAAS,gBACd,MACA,OACuB;AACvB,QAAM,WAAW,MAAM,QAAQ,IAAI,IAAI,OAAO,OAAO,CAAC,IAAI,IAAI,CAAA;AAC9D,QAAM,YAAY,SAAS,CAAA;AAC3B,QAAM,SAAS,CAAC,GAAG,UAAU,GAAG,SAAS;AACzC,SAAO,OAAO,SAAS,IAAI,SAAS;AACtC;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DeathZoneConfig, EmitZoneConfig } from './emit-zone';
|
|
2
|
+
import { ParticleEmitter, ParticleEmitterManagerLike, ParticlesHandle } from './particle-types';
|
|
3
|
+
import { ParticleEmitterConfig } from './preset-registry';
|
|
4
|
+
export declare function isParticleEmitter(target: ParticlesHandle | null): target is ParticleEmitter;
|
|
5
|
+
export declare function getFirstEmitter(manager: ParticleEmitterManagerLike | null): ParticleEmitter | null;
|
|
6
|
+
export declare function applyEmitterConfig(emitter: ParticleEmitter | null, config: ParticleEmitterConfig): void;
|
|
7
|
+
export declare function applyEmitZone(emitter: ParticleEmitter | null, emitZone: EmitZoneConfig | undefined): void;
|
|
8
|
+
export declare function applyDeathZone(emitter: ParticleEmitter | null, deathZone: DeathZoneConfig | DeathZoneConfig[] | undefined): void;
|
|
9
|
+
export declare function mergeDeathZones(base: unknown | unknown[] | undefined, extra: unknown[] | undefined): unknown[] | undefined;
|
|
10
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/particles/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAE9D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,MAAM,IAAI,eAAe,CAE3F;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,0BAA0B,GAAG,IAAI,GACzC,eAAe,GAAG,IAAI,CAWxB;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,eAAe,GAAG,IAAI,EAC/B,MAAM,EAAE,qBAAqB,GAC5B,IAAI,CAkBN;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,GAAG,IAAI,EAC/B,QAAQ,EAAE,cAAc,GAAG,SAAS,GACnC,IAAI,CAUN;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,GAAG,IAAI,EAC/B,SAAS,EAAE,eAAe,GAAG,eAAe,EAAE,GAAG,SAAS,GACzD,IAAI,CA4CN;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,SAAS,EACrC,KAAK,EAAE,OAAO,EAAE,GAAG,SAAS,GAC3B,OAAO,EAAE,GAAG,SAAS,CAKvB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
function isParticleEmitter(target) {
|
|
2
|
+
return !!target && typeof target.explode === "function";
|
|
3
|
+
}
|
|
4
|
+
function getFirstEmitter(manager) {
|
|
5
|
+
if (!manager) return null;
|
|
6
|
+
if (manager.__emitter) return manager.__emitter;
|
|
7
|
+
const emitters = manager.emitters;
|
|
8
|
+
if (Array.isArray(emitters)) {
|
|
9
|
+
return emitters[0] ?? null;
|
|
10
|
+
}
|
|
11
|
+
if (emitters && "list" in emitters && Array.isArray(emitters.list)) {
|
|
12
|
+
return emitters.list[0] ?? null;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function applyEmitterConfig(emitter, config) {
|
|
17
|
+
if (!emitter) return;
|
|
18
|
+
const withConfig = emitter;
|
|
19
|
+
if (withConfig.setConfig) {
|
|
20
|
+
withConfig.setConfig(config);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (withConfig.fromJSON) {
|
|
24
|
+
withConfig.fromJSON(config);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
Object.assign(emitter, config);
|
|
28
|
+
}
|
|
29
|
+
function applyEmitZone(emitter, emitZone) {
|
|
30
|
+
if (!emitter || !emitZone) return;
|
|
31
|
+
const withZone = emitter;
|
|
32
|
+
if (withZone.setEmitZone) {
|
|
33
|
+
withZone.setEmitZone(emitZone);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function applyDeathZone(emitter, deathZone) {
|
|
38
|
+
if (!emitter) return;
|
|
39
|
+
const withZone = emitter;
|
|
40
|
+
const isDefined = (value) => value !== null && value !== void 0;
|
|
41
|
+
const normalized = Array.isArray(deathZone) ? deathZone.filter(isDefined) : deathZone ? [deathZone] : [];
|
|
42
|
+
const hasZone = normalized.length > 0;
|
|
43
|
+
if (hasZone && withZone.setDeathZone) {
|
|
44
|
+
withZone.setDeathZone(normalized);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (!hasZone) {
|
|
48
|
+
if (withZone.clearDeathZones) {
|
|
49
|
+
withZone.clearDeathZones();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (withZone.deathZones) {
|
|
53
|
+
withZone.deathZones = [];
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (withZone.clearDeathZones) {
|
|
58
|
+
withZone.clearDeathZones();
|
|
59
|
+
}
|
|
60
|
+
if (withZone.addDeathZone) {
|
|
61
|
+
withZone.addDeathZone(normalized);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (withZone.deathZones) {
|
|
65
|
+
withZone.deathZones = normalized;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function mergeDeathZones(base, extra) {
|
|
69
|
+
const baseList = Array.isArray(base) ? base : base ? [base] : [];
|
|
70
|
+
const extraList = extra ?? [];
|
|
71
|
+
const merged = [...baseList, ...extraList];
|
|
72
|
+
return merged.length > 0 ? merged : void 0;
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
applyDeathZone,
|
|
76
|
+
applyEmitZone,
|
|
77
|
+
applyEmitterConfig,
|
|
78
|
+
getFirstEmitter,
|
|
79
|
+
isParticleEmitter,
|
|
80
|
+
mergeDeathZones
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/particles/utils.ts"],"sourcesContent":["/**\n * Particle utilities shared across hooks/components\n */\nimport type * as Phaser from 'phaser'\nimport type { DeathZoneConfig, EmitZoneConfig } from './emit-zone'\nimport type { ParticleEmitter, ParticleEmitterManagerLike, ParticlesHandle } from './particle-types'\nimport type { ParticleEmitterConfig } from './preset-registry'\n\nexport function isParticleEmitter(target: ParticlesHandle | null): target is ParticleEmitter {\n return !!target && typeof (target as ParticleEmitter).explode === 'function'\n}\n\nexport function getFirstEmitter(\n manager: ParticleEmitterManagerLike | null\n): ParticleEmitter | null {\n if (!manager) return null\n if (manager.__emitter) return manager.__emitter\n const emitters = (manager as unknown as { emitters?: { list?: unknown[] } | unknown[] }).emitters\n if (Array.isArray(emitters)) {\n return (emitters[0] as ParticleEmitter) ?? null\n }\n if (emitters && 'list' in emitters && Array.isArray(emitters.list)) {\n return (emitters.list[0] as ParticleEmitter) ?? null\n }\n return null\n}\n\nexport function applyEmitterConfig(\n emitter: ParticleEmitter | null,\n config: ParticleEmitterConfig\n): void {\n if (!emitter) return\n const withConfig = emitter as Phaser.GameObjects.Particles.ParticleEmitter & {\n setConfig?: (config: ParticleEmitterConfig) => void\n fromJSON?: (config: ParticleEmitterConfig) => void\n }\n\n if (withConfig.setConfig) {\n withConfig.setConfig(config)\n return\n }\n\n if (withConfig.fromJSON) {\n withConfig.fromJSON(config)\n return\n }\n\n Object.assign(emitter, config)\n}\n\nexport function applyEmitZone(\n emitter: ParticleEmitter | null,\n emitZone: EmitZoneConfig | undefined\n): void {\n if (!emitter || !emitZone) return\n const withZone = emitter as Phaser.GameObjects.Particles.ParticleEmitter & {\n setEmitZone?: (config: EmitZoneConfig) => void\n }\n\n if (withZone.setEmitZone) {\n withZone.setEmitZone(emitZone)\n return\n }\n}\n\nexport function applyDeathZone(\n emitter: ParticleEmitter | null,\n deathZone: DeathZoneConfig | DeathZoneConfig[] | undefined\n): void {\n if (!emitter) return\n const withZone = emitter as Phaser.GameObjects.Particles.ParticleEmitter & {\n setDeathZone?: (config: DeathZoneConfig | DeathZoneConfig[]) => void\n addDeathZone?: (config: DeathZoneConfig | DeathZoneConfig[]) => void\n clearDeathZones?: () => void\n deathZones?: unknown[]\n }\n\n const isDefined = <T>(value: T | null | undefined): value is T =>\n value !== null && value !== undefined\n const normalized = Array.isArray(deathZone)\n ? deathZone.filter(isDefined)\n : deathZone\n ? [deathZone]\n : []\n const hasZone = normalized.length > 0\n\n if (hasZone && withZone.setDeathZone) {\n withZone.setDeathZone(normalized)\n return\n }\n\n if (!hasZone) {\n if (withZone.clearDeathZones) {\n withZone.clearDeathZones()\n return\n }\n if (withZone.deathZones) {\n withZone.deathZones = []\n }\n return\n }\n\n if (withZone.clearDeathZones) {\n withZone.clearDeathZones()\n }\n if (withZone.addDeathZone) {\n withZone.addDeathZone(normalized)\n return\n }\n if (withZone.deathZones) {\n ;(withZone as unknown as { deathZones?: unknown[] }).deathZones = normalized\n }\n}\n\nexport function mergeDeathZones(\n base: unknown | unknown[] | undefined,\n extra: unknown[] | undefined\n): unknown[] | undefined {\n const baseList = Array.isArray(base) ? base : base ? [base] : []\n const extraList = extra ?? []\n const merged = [...baseList, ...extraList]\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AAA;AACT;AAAA,IACF;AACA,QAAI,SAAS,YAAY;AACvB,eAAS,aAAa,CAAA;AAAA,IACxB;AACA;AAAA,EACF;AAEA,MAAI,SAAS,iBAAiB;AAC5B,aAAS,gBAAA;AAAA,EACX;AACA,MAAI,SAAS,cAAc;AACzB,aAAS,aAAa,UAAU;AAChC;AAAA,EACF;AACA,MAAI,SAAS,YAAY;AACrB,aAAmD,aAAa;AAAA,EACpE;AACF;AAEO,SAAS,gBACd,MACA,OACuB;AACvB,QAAM,WAAW,MAAM,QAAQ,IAAI,IAAI,OAAO,OAAO,CAAC,IAAI,IAAI,CAAA;AAC9D,QAAM,YAAY,SAAS,CAAA;AAC3B,QAAM,SAAS,CAAC,GAAG,UAAU,GAAG,SAAS;AACzC,SAAO,OAAO,SAAS,IAAI,SAAS;AACtC;"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const Phaser = require("phaser");
|
|
4
|
+
const gestureManager = require("./gestures/gesture-manager.cjs");
|
|
5
|
+
const phaserSurfaceAdapter = require("./phaser-surface-adapter.cjs");
|
|
6
|
+
const phaserGuards = require("./utils/phaser-guards.cjs");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const Phaser__namespace = /* @__PURE__ */ _interopNamespaceDefault(Phaser);
|
|
24
|
+
function findAttachedSurfaceContext(target) {
|
|
25
|
+
let current = target;
|
|
26
|
+
while (current) {
|
|
27
|
+
if (current.__surfaceContext) {
|
|
28
|
+
return current.__surfaceContext;
|
|
29
|
+
}
|
|
30
|
+
current = current.parentContainer;
|
|
31
|
+
}
|
|
32
|
+
return void 0;
|
|
33
|
+
}
|
|
34
|
+
function createDummyNode(parent) {
|
|
35
|
+
const scene = getSceneFromParent(parent);
|
|
36
|
+
if (!scene || typeof scene.add?.container !== "function") {
|
|
37
|
+
const dummy2 = {
|
|
38
|
+
visible: false,
|
|
39
|
+
setVisible: (_v) => dummy2,
|
|
40
|
+
destroy: () => {
|
|
41
|
+
},
|
|
42
|
+
list: [],
|
|
43
|
+
getAll: () => [],
|
|
44
|
+
add: () => dummy2,
|
|
45
|
+
remove: () => dummy2
|
|
46
|
+
};
|
|
47
|
+
return dummy2;
|
|
48
|
+
}
|
|
49
|
+
const dummy = scene.add.container(0, 0);
|
|
50
|
+
if (typeof dummy.setVisible === "function") {
|
|
51
|
+
dummy.setVisible(false);
|
|
52
|
+
} else {
|
|
53
|
+
dummy.visible = false;
|
|
54
|
+
}
|
|
55
|
+
return dummy;
|
|
56
|
+
}
|
|
57
|
+
function deriveHostContext(parent) {
|
|
58
|
+
const attachedContext = findAttachedSurfaceContext(parent);
|
|
59
|
+
if (attachedContext) {
|
|
60
|
+
return attachedContext;
|
|
61
|
+
}
|
|
62
|
+
const scene = getSceneFromParent(parent);
|
|
63
|
+
if (!scene || !scene.scale) {
|
|
64
|
+
return {
|
|
65
|
+
viewport: { width: 800, height: 600 },
|
|
66
|
+
scheduler: {
|
|
67
|
+
requestAnimationFrame: () => ({ cancel: () => {
|
|
68
|
+
} }),
|
|
69
|
+
onFrame: () => ({ cancel: () => {
|
|
70
|
+
} }),
|
|
71
|
+
setTimeout: () => ({ cancel: () => {
|
|
72
|
+
} }),
|
|
73
|
+
setInterval: () => ({ cancel: () => {
|
|
74
|
+
} })
|
|
75
|
+
},
|
|
76
|
+
capabilities: /* @__PURE__ */ new Set(),
|
|
77
|
+
raw: scene ?? parent
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return phaserSurfaceAdapter.createPhaserSurfaceContext(scene);
|
|
81
|
+
}
|
|
82
|
+
function attachSurfaceContext(target, context) {
|
|
83
|
+
target.__surfaceContext = context;
|
|
84
|
+
}
|
|
85
|
+
function extractScene(parent) {
|
|
86
|
+
if (phaserGuards.isPhaserScene(parent)) {
|
|
87
|
+
return parent;
|
|
88
|
+
}
|
|
89
|
+
const go = parent;
|
|
90
|
+
return go.scene ?? null;
|
|
91
|
+
}
|
|
92
|
+
function isSceneTarget(target) {
|
|
93
|
+
return phaserGuards.isPhaserScene(target);
|
|
94
|
+
}
|
|
95
|
+
function updateGestureHitAreaAfterLayout(container) {
|
|
96
|
+
const phaserContainer = container;
|
|
97
|
+
if (!container.__getLayoutSize) return;
|
|
98
|
+
try {
|
|
99
|
+
const scene = phaserContainer.scene;
|
|
100
|
+
if (!scene) return;
|
|
101
|
+
const manager = gestureManager.getGestureManager(scene);
|
|
102
|
+
if (!manager.hasContainer(phaserContainer)) return;
|
|
103
|
+
const width = container.width ?? 0;
|
|
104
|
+
const height = container.height ?? 0;
|
|
105
|
+
const hitArea = new Phaser__namespace.Geom.Rectangle(0, 0, width, height);
|
|
106
|
+
manager.updateHitArea(phaserContainer, hitArea);
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function getParentContentSize(parent) {
|
|
111
|
+
if (!phaserGuards.isPhaserContainer(parent)) return void 0;
|
|
112
|
+
const container = parent;
|
|
113
|
+
if (!container.__getLayoutSize) return void 0;
|
|
114
|
+
const totalSize = container.__getLayoutSize();
|
|
115
|
+
const padding = container.__layoutProps?.padding ?? 0;
|
|
116
|
+
const normPadding = typeof padding === "number" ? { left: padding, right: padding, top: padding, bottom: padding } : {
|
|
117
|
+
left: padding.left ?? 0,
|
|
118
|
+
right: padding.right ?? 0,
|
|
119
|
+
top: padding.top ?? 0,
|
|
120
|
+
bottom: padding.bottom ?? 0
|
|
121
|
+
};
|
|
122
|
+
return {
|
|
123
|
+
width: totalSize.width - normPadding.left - normPadding.right,
|
|
124
|
+
height: totalSize.height - normPadding.top - normPadding.bottom
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function clearContainer(container, destroy = true) {
|
|
128
|
+
const typed = container;
|
|
129
|
+
const children = typed.getAll?.() ?? [];
|
|
130
|
+
children.forEach((child) => {
|
|
131
|
+
typed.remove?.(child, destroy);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function getSceneFromParent(parent) {
|
|
135
|
+
if (phaserGuards.isPhaserScene(parent)) {
|
|
136
|
+
return parent;
|
|
137
|
+
}
|
|
138
|
+
return parent.scene ?? null;
|
|
139
|
+
}
|
|
140
|
+
exports.attachSurfaceContext = attachSurfaceContext;
|
|
141
|
+
exports.clearContainer = clearContainer;
|
|
142
|
+
exports.createDummyNode = createDummyNode;
|
|
143
|
+
exports.deriveHostContext = deriveHostContext;
|
|
144
|
+
exports.extractScene = extractScene;
|
|
145
|
+
exports.getParentContentSize = getParentContentSize;
|
|
146
|
+
exports.isSceneTarget = isSceneTarget;
|
|
147
|
+
exports.updateGestureHitAreaAfterLayout = updateGestureHitAreaAfterLayout;
|
|
148
|
+
//# sourceMappingURL=phaser-bridges.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phaser-bridges.cjs","sources":["../src/phaser-bridges.ts"],"sourcesContent":["/**\n * Phaser Bridges — centralized Phaser-specific operations used by the VDOM.\n *\n * In Phase 2A, these functions are extracted from vdom.ts into a single module\n * to make the boundary between portable VDOM and Phaser-specific operations\n * explicit and auditable.\n *\n * When Phase 2C extracts the VDOM core into packages/core, these bridges stay\n * in the Phaser package. A portable VDOM core will use callback/hook patterns\n * instead of directly calling these functions.\n *\n * @migration(audit:scene-portal-mount) Phase 2A — centralized Phaser bridges\n */\n\nimport type {\n HostContext,\n HostNode,\n HostParent,\n LayoutContainer,\n SurfaceTarget,\n} from '@number10/jsx-core'\nimport * as Phaser from 'phaser'\nimport { getGestureManager } from './gestures/gesture-manager'\nimport type { ContainerLike, GameObjectLike, SceneLike } from './phaser-runtime-types'\nimport { createPhaserSurfaceContext } from './phaser-surface-adapter'\nimport { isPhaserContainer, isPhaserScene } from './utils/phaser-guards'\n\ntype SurfaceContextCarrier = {\n __surfaceContext?: HostContext\n parentContainer?: SurfaceContextCarrier | null\n}\n\nfunction findAttachedSurfaceContext(target: unknown): HostContext | undefined {\n let current = target as SurfaceContextCarrier | null | undefined\n\n while (current) {\n if (current.__surfaceContext) {\n return current.__surfaceContext\n }\n current = current.parentContainer\n }\n\n return undefined\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 1: Dummy node creation for error recovery\n// ---------------------------------------------------------------------------\n\n/**\n * Creates a dummy invisible container for error recovery when a VNode\n * is invalid or a component returns null.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core should not create\n * dummy nodes. Instead, the VDOM should handle null/error gracefully\n * without needing a placeholder object. This bridge stays in the Phaser\n * package as a renderer-specific error recovery mechanism.\n */\nexport function createDummyNode(parent: HostParent): HostNode {\n const scene = getSceneFromParent(parent)\n\n // Fallback for mock scenes in tests\n if (!scene || typeof scene.add?.container !== 'function') {\n const dummy = {\n visible: false,\n setVisible: (_v: boolean) => dummy,\n destroy: () => {},\n list: [],\n getAll: () => [],\n add: () => dummy,\n remove: () => dummy,\n } as HostNode\n return dummy\n }\n\n const dummy = scene.add.container(0, 0)\n if (typeof dummy.setVisible === 'function') {\n dummy.setVisible(false)\n } else {\n dummy.visible = false\n }\n return dummy\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 2: HostContext derivation from Phaser parent\n// ---------------------------------------------------------------------------\n\n/**\n * Derives a HostContext from a parent node (Scene or Container).\n * Centralizes the Phaser.Scene extraction so it can be replaced later\n * with a proper context lookup from SurfaceAdapter.\n *\n * Gracefully handles mock/non-Phaser scenes in tests by returning a\n * minimal context when the expected Phaser structure is missing.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core will receive\n * HostContext from the SurfaceAdapter, not derive it from parents.\n * This bridge stays in the Phaser package.\n */\nexport function deriveHostContext(parent: HostParent): HostContext {\n const attachedContext = findAttachedSurfaceContext(parent)\n if (attachedContext) {\n return attachedContext\n }\n\n const scene = getSceneFromParent(parent)\n\n // Guard against mock/non-Phaser scenes (e.g. in test environments)\n if (!scene || !scene.scale) {\n return {\n viewport: { width: 800, height: 600 },\n scheduler: {\n requestAnimationFrame: () => ({ cancel: () => {} }),\n onFrame: () => ({ cancel: () => {} }),\n setTimeout: () => ({ cancel: () => {} }),\n setInterval: () => ({ cancel: () => {} }),\n },\n capabilities: new Set(),\n raw: (scene as unknown) ?? parent,\n }\n }\n\n return createPhaserSurfaceContext(scene as Phaser.Scene)\n}\n\nexport function attachSurfaceContext(target: HostNode, context: HostContext): void {\n ;(target as SurfaceContextCarrier).__surfaceContext = context\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 3: Scene extraction from parent\n// ---------------------------------------------------------------------------\n\n/**\n * Extracts the Phaser.Scene from a parent node (Scene or Container).\n * Used for operations that need direct scene access (dummy nodes,\n * scene storage, portal registry).\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core should use\n * SurfaceContext.raw or SurfaceAdapter methods instead of extracting\n * the scene directly. This bridge stays in the Phaser package.\n */\nexport function extractScene(parent: HostParent): SurfaceTarget | null {\n if (isPhaserScene(parent)) {\n return parent as SurfaceTarget\n }\n const go = parent as GameObjectLike\n return (go.scene as SurfaceTarget) ?? null\n}\n\nexport function isSceneTarget(target: unknown): boolean {\n return isPhaserScene(target)\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 4: Gesture hit area update after layout\n// ---------------------------------------------------------------------------\n\n/**\n * Updates gesture hit area based on current layout size.\n * Called after layout recalculation to sync hit area with actual container size.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core should fire a\n * \"layout-complete\" callback; the Phaser package wires it to the gesture\n * manager. This bridge stays in the Phaser package.\n */\nexport function updateGestureHitAreaAfterLayout(container: LayoutContainer): void {\n const phaserContainer = container as ContainerLike\n\n // Only update if container has gesture system enabled and layout size available\n if (!container.__getLayoutSize) return\n\n try {\n const scene = phaserContainer.scene as Phaser.Scene | undefined\n if (!scene) return\n const manager = getGestureManager(scene)\n\n // Check if container is actually registered with gesture manager\n if (!manager.hasContainer(phaserContainer as unknown as Phaser.GameObjects.Container)) return\n\n const width = container.width ?? 0\n const height = container.height ?? 0\n const hitArea = new Phaser.Geom.Rectangle(0, 0, width, height)\n manager.updateHitArea(phaserContainer as unknown as Phaser.GameObjects.Container, hitArea)\n } catch {\n // Gesture manager or container not registered, ignore\n }\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 5: Parent size extraction for layout percentage resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Extracts the content-area dimensions of a parent container for use in\n * percentage-based layout calculations.\n *\n * Uses duck-typing (LayoutContainer) so the layout engine can work with\n * any renderer's container.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — This logic is portable\n * (pure LayoutContainer duck-typing). It can move to core alongside the\n * layout engine. The Phaser-specific isPhaserContainer guard is the only\n * part that stays in the Phaser package.\n */\nexport function getParentContentSize(parent: HostParent):\n | {\n width: number\n height: number\n }\n | undefined {\n if (!isPhaserContainer(parent)) return undefined\n\n const container = parent as LayoutContainer\n if (!container.__getLayoutSize) return undefined\n\n const totalSize = container.__getLayoutSize()\n const padding = (container.__layoutProps?.padding ?? 0) as\n | number\n | { left?: number; right?: number; top?: number; bottom?: number }\n\n const normPadding =\n typeof padding === 'number'\n ? { left: padding, right: padding, top: padding, bottom: padding }\n : {\n left: padding.left ?? 0,\n right: padding.right ?? 0,\n top: padding.top ?? 0,\n bottom: padding.bottom ?? 0,\n }\n\n return {\n width: totalSize.width - normPadding.left - normPadding.right,\n height: totalSize.height - normPadding.top - normPadding.bottom,\n }\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 6: Registry ID on root node\n// ---------------------------------------------------------------------------\n\n/**\n * Attaches/retrieves the mount registry ID on a root node.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core's MountRegistry should\n * use a WeakMap keyed by HostNode instead of mutating the node object.\n * This bridge stays in the Phaser package.\n */\n\n// ---------------------------------------------------------------------------\n// Bridge 8: Container child clearing (for remount)\n// ---------------------------------------------------------------------------\n\n/**\n * Removes all children from a Phaser container, optionally destroying them.\n * Used during remountAll() to clear the root container before re-mounting.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Should go through\n * hostAdapter.getChildren() + hostAdapter.remove() in a loop.\n * This bridge stays in the Phaser package.\n */\nexport function clearContainer(container: HostNode, destroy = true): void {\n const typed = container as ContainerLike\n const children = typed.getAll?.() ?? []\n children.forEach((child) => {\n typed.remove?.(child as Phaser.GameObjects.GameObject, destroy)\n })\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 10: Scene lifecycle check\n// ---------------------------------------------------------------------------\n\nfunction getSceneFromParent(parent: HostParent): SceneLike | null {\n if (isPhaserScene(parent)) {\n return parent as unknown as SceneLike\n }\n return ((parent as GameObjectLike).scene as SceneLike | null | undefined) ?? null\n}\n"],"names":["dummy","createPhaserSurfaceContext","isPhaserScene","getGestureManager","Phaser","isPhaserContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,2BAA2B,QAA0C;AAC5E,MAAI,UAAU;AAEd,SAAO,SAAS;AACd,QAAI,QAAQ,kBAAkB;AAC5B,aAAO,QAAQ;AAAA,IACjB;AACA,cAAU,QAAQ;AAAA,EACpB;AAEA,SAAO;AACT;AAeO,SAAS,gBAAgB,QAA8B;AAC5D,QAAM,QAAQ,mBAAmB,MAAM;AAGvC,MAAI,CAAC,SAAS,OAAO,MAAM,KAAK,cAAc,YAAY;AACxD,UAAMA,SAAQ;AAAA,MACZ,SAAS;AAAA,MACT,YAAY,CAAC,OAAgBA;AAAAA,MAC7B,SAAS,MAAM;AAAA,MAAC;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ACT;AACA,SAAS,OAA0B,SAA0C;AAC/E;;;;;;;;;"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { HostContext, HostNode, HostParent, LayoutContainer, SurfaceTarget } from '@number10/jsx-core';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a dummy invisible container for error recovery when a VNode
|
|
4
|
+
* is invalid or a component returns null.
|
|
5
|
+
*
|
|
6
|
+
* @migration(audit:scene-portal-mount) Phase 2C — Core should not create
|
|
7
|
+
* dummy nodes. Instead, the VDOM should handle null/error gracefully
|
|
8
|
+
* without needing a placeholder object. This bridge stays in the Phaser
|
|
9
|
+
* package as a renderer-specific error recovery mechanism.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createDummyNode(parent: HostParent): HostNode;
|
|
12
|
+
/**
|
|
13
|
+
* Derives a HostContext from a parent node (Scene or Container).
|
|
14
|
+
* Centralizes the Phaser.Scene extraction so it can be replaced later
|
|
15
|
+
* with a proper context lookup from SurfaceAdapter.
|
|
16
|
+
*
|
|
17
|
+
* Gracefully handles mock/non-Phaser scenes in tests by returning a
|
|
18
|
+
* minimal context when the expected Phaser structure is missing.
|
|
19
|
+
*
|
|
20
|
+
* @migration(audit:scene-portal-mount) Phase 2C — Core will receive
|
|
21
|
+
* HostContext from the SurfaceAdapter, not derive it from parents.
|
|
22
|
+
* This bridge stays in the Phaser package.
|
|
23
|
+
*/
|
|
24
|
+
export declare function deriveHostContext(parent: HostParent): HostContext;
|
|
25
|
+
export declare function attachSurfaceContext(target: HostNode, context: HostContext): void;
|
|
26
|
+
/**
|
|
27
|
+
* Extracts the Phaser.Scene from a parent node (Scene or Container).
|
|
28
|
+
* Used for operations that need direct scene access (dummy nodes,
|
|
29
|
+
* scene storage, portal registry).
|
|
30
|
+
*
|
|
31
|
+
* @migration(audit:scene-portal-mount) Phase 2C — Core should use
|
|
32
|
+
* SurfaceContext.raw or SurfaceAdapter methods instead of extracting
|
|
33
|
+
* the scene directly. This bridge stays in the Phaser package.
|
|
34
|
+
*/
|
|
35
|
+
export declare function extractScene(parent: HostParent): SurfaceTarget | null;
|
|
36
|
+
export declare function isSceneTarget(target: unknown): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Updates gesture hit area based on current layout size.
|
|
39
|
+
* Called after layout recalculation to sync hit area with actual container size.
|
|
40
|
+
*
|
|
41
|
+
* @migration(audit:scene-portal-mount) Phase 2C — Core should fire a
|
|
42
|
+
* "layout-complete" callback; the Phaser package wires it to the gesture
|
|
43
|
+
* manager. This bridge stays in the Phaser package.
|
|
44
|
+
*/
|
|
45
|
+
export declare function updateGestureHitAreaAfterLayout(container: LayoutContainer): void;
|
|
46
|
+
/**
|
|
47
|
+
* Extracts the content-area dimensions of a parent container for use in
|
|
48
|
+
* percentage-based layout calculations.
|
|
49
|
+
*
|
|
50
|
+
* Uses duck-typing (LayoutContainer) so the layout engine can work with
|
|
51
|
+
* any renderer's container.
|
|
52
|
+
*
|
|
53
|
+
* @migration(audit:scene-portal-mount) Phase 2C — This logic is portable
|
|
54
|
+
* (pure LayoutContainer duck-typing). It can move to core alongside the
|
|
55
|
+
* layout engine. The Phaser-specific isPhaserContainer guard is the only
|
|
56
|
+
* part that stays in the Phaser package.
|
|
57
|
+
*/
|
|
58
|
+
export declare function getParentContentSize(parent: HostParent): {
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
} | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Attaches/retrieves the mount registry ID on a root node.
|
|
64
|
+
*
|
|
65
|
+
* @migration(audit:scene-portal-mount) Phase 2C — Core's MountRegistry should
|
|
66
|
+
* use a WeakMap keyed by HostNode instead of mutating the node object.
|
|
67
|
+
* This bridge stays in the Phaser package.
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* Removes all children from a Phaser container, optionally destroying them.
|
|
71
|
+
* Used during remountAll() to clear the root container before re-mounting.
|
|
72
|
+
*
|
|
73
|
+
* @migration(audit:scene-portal-mount) Phase 2C — Should go through
|
|
74
|
+
* hostAdapter.getChildren() + hostAdapter.remove() in a loop.
|
|
75
|
+
* This bridge stays in the Phaser package.
|
|
76
|
+
*/
|
|
77
|
+
export declare function clearContainer(container: HostNode, destroy?: boolean): void;
|
|
78
|
+
//# sourceMappingURL=phaser-bridges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phaser-bridges.d.ts","sourceRoot":"","sources":["../src/phaser-bridges.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,eAAe,EACf,aAAa,EACd,MAAM,oBAAoB,CAAA;AA6B3B;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ,CAwB5D;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,CAwBjE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAEjF;AAMD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,GAAG,IAAI,CAMrE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAEtD;AAMD;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAqBhF;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GACnD;IACE,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,GACD,SAAS,CAyBZ;AAMD;;;;;;GAMG;AAMH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,UAAO,GAAG,IAAI,CAMxE"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as Phaser from "phaser";
|
|
2
|
+
import { getGestureManager } from "./gestures/gesture-manager.js";
|
|
3
|
+
import { createPhaserSurfaceContext } from "./phaser-surface-adapter.js";
|
|
4
|
+
import { isPhaserScene, isPhaserContainer } from "./utils/phaser-guards.js";
|
|
5
|
+
function findAttachedSurfaceContext(target) {
|
|
6
|
+
let current = target;
|
|
7
|
+
while (current) {
|
|
8
|
+
if (current.__surfaceContext) {
|
|
9
|
+
return current.__surfaceContext;
|
|
10
|
+
}
|
|
11
|
+
current = current.parentContainer;
|
|
12
|
+
}
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
function createDummyNode(parent) {
|
|
16
|
+
const scene = getSceneFromParent(parent);
|
|
17
|
+
if (!scene || typeof scene.add?.container !== "function") {
|
|
18
|
+
const dummy2 = {
|
|
19
|
+
visible: false,
|
|
20
|
+
setVisible: (_v) => dummy2,
|
|
21
|
+
destroy: () => {
|
|
22
|
+
},
|
|
23
|
+
list: [],
|
|
24
|
+
getAll: () => [],
|
|
25
|
+
add: () => dummy2,
|
|
26
|
+
remove: () => dummy2
|
|
27
|
+
};
|
|
28
|
+
return dummy2;
|
|
29
|
+
}
|
|
30
|
+
const dummy = scene.add.container(0, 0);
|
|
31
|
+
if (typeof dummy.setVisible === "function") {
|
|
32
|
+
dummy.setVisible(false);
|
|
33
|
+
} else {
|
|
34
|
+
dummy.visible = false;
|
|
35
|
+
}
|
|
36
|
+
return dummy;
|
|
37
|
+
}
|
|
38
|
+
function deriveHostContext(parent) {
|
|
39
|
+
const attachedContext = findAttachedSurfaceContext(parent);
|
|
40
|
+
if (attachedContext) {
|
|
41
|
+
return attachedContext;
|
|
42
|
+
}
|
|
43
|
+
const scene = getSceneFromParent(parent);
|
|
44
|
+
if (!scene || !scene.scale) {
|
|
45
|
+
return {
|
|
46
|
+
viewport: { width: 800, height: 600 },
|
|
47
|
+
scheduler: {
|
|
48
|
+
requestAnimationFrame: () => ({ cancel: () => {
|
|
49
|
+
} }),
|
|
50
|
+
onFrame: () => ({ cancel: () => {
|
|
51
|
+
} }),
|
|
52
|
+
setTimeout: () => ({ cancel: () => {
|
|
53
|
+
} }),
|
|
54
|
+
setInterval: () => ({ cancel: () => {
|
|
55
|
+
} })
|
|
56
|
+
},
|
|
57
|
+
capabilities: /* @__PURE__ */ new Set(),
|
|
58
|
+
raw: scene ?? parent
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return createPhaserSurfaceContext(scene);
|
|
62
|
+
}
|
|
63
|
+
function attachSurfaceContext(target, context) {
|
|
64
|
+
target.__surfaceContext = context;
|
|
65
|
+
}
|
|
66
|
+
function extractScene(parent) {
|
|
67
|
+
if (isPhaserScene(parent)) {
|
|
68
|
+
return parent;
|
|
69
|
+
}
|
|
70
|
+
const go = parent;
|
|
71
|
+
return go.scene ?? null;
|
|
72
|
+
}
|
|
73
|
+
function isSceneTarget(target) {
|
|
74
|
+
return isPhaserScene(target);
|
|
75
|
+
}
|
|
76
|
+
function updateGestureHitAreaAfterLayout(container) {
|
|
77
|
+
const phaserContainer = container;
|
|
78
|
+
if (!container.__getLayoutSize) return;
|
|
79
|
+
try {
|
|
80
|
+
const scene = phaserContainer.scene;
|
|
81
|
+
if (!scene) return;
|
|
82
|
+
const manager = getGestureManager(scene);
|
|
83
|
+
if (!manager.hasContainer(phaserContainer)) return;
|
|
84
|
+
const width = container.width ?? 0;
|
|
85
|
+
const height = container.height ?? 0;
|
|
86
|
+
const hitArea = new Phaser.Geom.Rectangle(0, 0, width, height);
|
|
87
|
+
manager.updateHitArea(phaserContainer, hitArea);
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function getParentContentSize(parent) {
|
|
92
|
+
if (!isPhaserContainer(parent)) return void 0;
|
|
93
|
+
const container = parent;
|
|
94
|
+
if (!container.__getLayoutSize) return void 0;
|
|
95
|
+
const totalSize = container.__getLayoutSize();
|
|
96
|
+
const padding = container.__layoutProps?.padding ?? 0;
|
|
97
|
+
const normPadding = typeof padding === "number" ? { left: padding, right: padding, top: padding, bottom: padding } : {
|
|
98
|
+
left: padding.left ?? 0,
|
|
99
|
+
right: padding.right ?? 0,
|
|
100
|
+
top: padding.top ?? 0,
|
|
101
|
+
bottom: padding.bottom ?? 0
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
width: totalSize.width - normPadding.left - normPadding.right,
|
|
105
|
+
height: totalSize.height - normPadding.top - normPadding.bottom
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function clearContainer(container, destroy = true) {
|
|
109
|
+
const typed = container;
|
|
110
|
+
const children = typed.getAll?.() ?? [];
|
|
111
|
+
children.forEach((child) => {
|
|
112
|
+
typed.remove?.(child, destroy);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function getSceneFromParent(parent) {
|
|
116
|
+
if (isPhaserScene(parent)) {
|
|
117
|
+
return parent;
|
|
118
|
+
}
|
|
119
|
+
return parent.scene ?? null;
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
attachSurfaceContext,
|
|
123
|
+
clearContainer,
|
|
124
|
+
createDummyNode,
|
|
125
|
+
deriveHostContext,
|
|
126
|
+
extractScene,
|
|
127
|
+
getParentContentSize,
|
|
128
|
+
isSceneTarget,
|
|
129
|
+
updateGestureHitAreaAfterLayout
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=phaser-bridges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phaser-bridges.js","sources":["../src/phaser-bridges.ts"],"sourcesContent":["/**\n * Phaser Bridges — centralized Phaser-specific operations used by the VDOM.\n *\n * In Phase 2A, these functions are extracted from vdom.ts into a single module\n * to make the boundary between portable VDOM and Phaser-specific operations\n * explicit and auditable.\n *\n * When Phase 2C extracts the VDOM core into packages/core, these bridges stay\n * in the Phaser package. A portable VDOM core will use callback/hook patterns\n * instead of directly calling these functions.\n *\n * @migration(audit:scene-portal-mount) Phase 2A — centralized Phaser bridges\n */\n\nimport type {\n HostContext,\n HostNode,\n HostParent,\n LayoutContainer,\n SurfaceTarget,\n} from '@number10/jsx-core'\nimport * as Phaser from 'phaser'\nimport { getGestureManager } from './gestures/gesture-manager'\nimport type { ContainerLike, GameObjectLike, SceneLike } from './phaser-runtime-types'\nimport { createPhaserSurfaceContext } from './phaser-surface-adapter'\nimport { isPhaserContainer, isPhaserScene } from './utils/phaser-guards'\n\ntype SurfaceContextCarrier = {\n __surfaceContext?: HostContext\n parentContainer?: SurfaceContextCarrier | null\n}\n\nfunction findAttachedSurfaceContext(target: unknown): HostContext | undefined {\n let current = target as SurfaceContextCarrier | null | undefined\n\n while (current) {\n if (current.__surfaceContext) {\n return current.__surfaceContext\n }\n current = current.parentContainer\n }\n\n return undefined\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 1: Dummy node creation for error recovery\n// ---------------------------------------------------------------------------\n\n/**\n * Creates a dummy invisible container for error recovery when a VNode\n * is invalid or a component returns null.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core should not create\n * dummy nodes. Instead, the VDOM should handle null/error gracefully\n * without needing a placeholder object. This bridge stays in the Phaser\n * package as a renderer-specific error recovery mechanism.\n */\nexport function createDummyNode(parent: HostParent): HostNode {\n const scene = getSceneFromParent(parent)\n\n // Fallback for mock scenes in tests\n if (!scene || typeof scene.add?.container !== 'function') {\n const dummy = {\n visible: false,\n setVisible: (_v: boolean) => dummy,\n destroy: () => {},\n list: [],\n getAll: () => [],\n add: () => dummy,\n remove: () => dummy,\n } as HostNode\n return dummy\n }\n\n const dummy = scene.add.container(0, 0)\n if (typeof dummy.setVisible === 'function') {\n dummy.setVisible(false)\n } else {\n dummy.visible = false\n }\n return dummy\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 2: HostContext derivation from Phaser parent\n// ---------------------------------------------------------------------------\n\n/**\n * Derives a HostContext from a parent node (Scene or Container).\n * Centralizes the Phaser.Scene extraction so it can be replaced later\n * with a proper context lookup from SurfaceAdapter.\n *\n * Gracefully handles mock/non-Phaser scenes in tests by returning a\n * minimal context when the expected Phaser structure is missing.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core will receive\n * HostContext from the SurfaceAdapter, not derive it from parents.\n * This bridge stays in the Phaser package.\n */\nexport function deriveHostContext(parent: HostParent): HostContext {\n const attachedContext = findAttachedSurfaceContext(parent)\n if (attachedContext) {\n return attachedContext\n }\n\n const scene = getSceneFromParent(parent)\n\n // Guard against mock/non-Phaser scenes (e.g. in test environments)\n if (!scene || !scene.scale) {\n return {\n viewport: { width: 800, height: 600 },\n scheduler: {\n requestAnimationFrame: () => ({ cancel: () => {} }),\n onFrame: () => ({ cancel: () => {} }),\n setTimeout: () => ({ cancel: () => {} }),\n setInterval: () => ({ cancel: () => {} }),\n },\n capabilities: new Set(),\n raw: (scene as unknown) ?? parent,\n }\n }\n\n return createPhaserSurfaceContext(scene as Phaser.Scene)\n}\n\nexport function attachSurfaceContext(target: HostNode, context: HostContext): void {\n ;(target as SurfaceContextCarrier).__surfaceContext = context\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 3: Scene extraction from parent\n// ---------------------------------------------------------------------------\n\n/**\n * Extracts the Phaser.Scene from a parent node (Scene or Container).\n * Used for operations that need direct scene access (dummy nodes,\n * scene storage, portal registry).\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core should use\n * SurfaceContext.raw or SurfaceAdapter methods instead of extracting\n * the scene directly. This bridge stays in the Phaser package.\n */\nexport function extractScene(parent: HostParent): SurfaceTarget | null {\n if (isPhaserScene(parent)) {\n return parent as SurfaceTarget\n }\n const go = parent as GameObjectLike\n return (go.scene as SurfaceTarget) ?? null\n}\n\nexport function isSceneTarget(target: unknown): boolean {\n return isPhaserScene(target)\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 4: Gesture hit area update after layout\n// ---------------------------------------------------------------------------\n\n/**\n * Updates gesture hit area based on current layout size.\n * Called after layout recalculation to sync hit area with actual container size.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core should fire a\n * \"layout-complete\" callback; the Phaser package wires it to the gesture\n * manager. This bridge stays in the Phaser package.\n */\nexport function updateGestureHitAreaAfterLayout(container: LayoutContainer): void {\n const phaserContainer = container as ContainerLike\n\n // Only update if container has gesture system enabled and layout size available\n if (!container.__getLayoutSize) return\n\n try {\n const scene = phaserContainer.scene as Phaser.Scene | undefined\n if (!scene) return\n const manager = getGestureManager(scene)\n\n // Check if container is actually registered with gesture manager\n if (!manager.hasContainer(phaserContainer as unknown as Phaser.GameObjects.Container)) return\n\n const width = container.width ?? 0\n const height = container.height ?? 0\n const hitArea = new Phaser.Geom.Rectangle(0, 0, width, height)\n manager.updateHitArea(phaserContainer as unknown as Phaser.GameObjects.Container, hitArea)\n } catch {\n // Gesture manager or container not registered, ignore\n }\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 5: Parent size extraction for layout percentage resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Extracts the content-area dimensions of a parent container for use in\n * percentage-based layout calculations.\n *\n * Uses duck-typing (LayoutContainer) so the layout engine can work with\n * any renderer's container.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — This logic is portable\n * (pure LayoutContainer duck-typing). It can move to core alongside the\n * layout engine. The Phaser-specific isPhaserContainer guard is the only\n * part that stays in the Phaser package.\n */\nexport function getParentContentSize(parent: HostParent):\n | {\n width: number\n height: number\n }\n | undefined {\n if (!isPhaserContainer(parent)) return undefined\n\n const container = parent as LayoutContainer\n if (!container.__getLayoutSize) return undefined\n\n const totalSize = container.__getLayoutSize()\n const padding = (container.__layoutProps?.padding ?? 0) as\n | number\n | { left?: number; right?: number; top?: number; bottom?: number }\n\n const normPadding =\n typeof padding === 'number'\n ? { left: padding, right: padding, top: padding, bottom: padding }\n : {\n left: padding.left ?? 0,\n right: padding.right ?? 0,\n top: padding.top ?? 0,\n bottom: padding.bottom ?? 0,\n }\n\n return {\n width: totalSize.width - normPadding.left - normPadding.right,\n height: totalSize.height - normPadding.top - normPadding.bottom,\n }\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 6: Registry ID on root node\n// ---------------------------------------------------------------------------\n\n/**\n * Attaches/retrieves the mount registry ID on a root node.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Core's MountRegistry should\n * use a WeakMap keyed by HostNode instead of mutating the node object.\n * This bridge stays in the Phaser package.\n */\n\n// ---------------------------------------------------------------------------\n// Bridge 8: Container child clearing (for remount)\n// ---------------------------------------------------------------------------\n\n/**\n * Removes all children from a Phaser container, optionally destroying them.\n * Used during remountAll() to clear the root container before re-mounting.\n *\n * @migration(audit:scene-portal-mount) Phase 2C — Should go through\n * hostAdapter.getChildren() + hostAdapter.remove() in a loop.\n * This bridge stays in the Phaser package.\n */\nexport function clearContainer(container: HostNode, destroy = true): void {\n const typed = container as ContainerLike\n const children = typed.getAll?.() ?? []\n children.forEach((child) => {\n typed.remove?.(child as Phaser.GameObjects.GameObject, destroy)\n })\n}\n\n// ---------------------------------------------------------------------------\n// Bridge 10: Scene lifecycle check\n// ---------------------------------------------------------------------------\n\nfunction getSceneFromParent(parent: HostParent): SceneLike | null {\n if (isPhaserScene(parent)) {\n return parent as unknown as SceneLike\n }\n return ((parent as GameObjectLike).scene as SceneLike | null | undefined) ?? null\n}\n"],"names":["dummy"],"mappings":";;;;AAgCA,SAAS,2BAA2B,QAA0C;AAC5E,MAAI,UAAU;AAEd,SAAO,SAAS;AACd,QAAI,QAAQ,kBAAkB;AAC5B,aAAO,QAAQ;AAAA,IACjB;AACA,cAAU,QAAQ;AAAA,EACpB;AAEA,SAAO;AACT;AAeO,SAAS,gBAAgB,QAA8B;AAC5D,QAAM,QAAQ,mBAAmB,MAAM;AAGvC,MAAI,CAAC,SAAS,OAAO,MAAM,KAAK,cAAc,YAAY;AACxD,UAAMA,SAAQ;AAAA,MACZ,SAAS;AAAA,MACT,YAAY,CAAC,OAAgBA;AAAAA,MAC7B,SAAS,MAAM;AAAA,MAAC;AAAA,MAChB,MAAM,CAAA;AAAA,MACN,QAAQ,M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