@number10/phaserjsx 0.4.0 → 0.4.2
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/README.md +1 -1
- package/dist/{TransformOriginView-Bx81YEUU.cjs → TransformOriginView-CrzevUOh.cjs} +429 -388
- package/dist/TransformOriginView-CrzevUOh.cjs.map +1 -0
- package/dist/{TransformOriginView-DCvId72M.js → TransformOriginView-TeXhLqNs.js} +393 -369
- package/dist/TransformOriginView-TeXhLqNs.js.map +1 -0
- package/dist/camera/use-camera-fx.d.ts +4 -1
- package/dist/camera/use-camera-fx.d.ts.map +1 -1
- package/dist/components/appliers/applyBackground.d.ts +5 -1
- package/dist/components/appliers/applyBackground.d.ts.map +1 -1
- package/dist/components/appliers/applyGestures.d.ts +1 -1
- package/dist/components/appliers/applyGestures.d.ts.map +1 -1
- package/dist/components/appliers/applyGraphics.d.ts +4 -1
- package/dist/components/appliers/applyGraphics.d.ts.map +1 -1
- package/dist/components/appliers/applyGraphicsLayout.d.ts +4 -1
- package/dist/components/appliers/applyGraphicsLayout.d.ts.map +1 -1
- package/dist/components/appliers/applyImage.d.ts +4 -1
- package/dist/components/appliers/applyImage.d.ts.map +1 -1
- package/dist/components/appliers/applyImageLayout.d.ts +4 -1
- package/dist/components/appliers/applyImageLayout.d.ts.map +1 -1
- package/dist/components/appliers/applyNineSlice.d.ts +4 -1
- package/dist/components/appliers/applyNineSlice.d.ts.map +1 -1
- package/dist/components/appliers/applyNineSliceLayout.d.ts +4 -1
- package/dist/components/appliers/applyNineSliceLayout.d.ts.map +1 -1
- package/dist/components/appliers/applySprite.d.ts +4 -1
- package/dist/components/appliers/applySprite.d.ts.map +1 -1
- package/dist/components/appliers/applySpriteLayout.d.ts +4 -1
- package/dist/components/appliers/applySpriteLayout.d.ts.map +1 -1
- package/dist/components/appliers/applyTextLayout.d.ts +4 -1
- package/dist/components/appliers/applyTextLayout.d.ts.map +1 -1
- package/dist/components/appliers/applyTooltip.d.ts +5 -1
- package/dist/components/appliers/applyTooltip.d.ts.map +1 -1
- package/dist/components/creators/createBackground.d.ts +5 -1
- package/dist/components/creators/createBackground.d.ts.map +1 -1
- package/dist/components/creators/createGestures.d.ts +1 -1
- package/dist/components/creators/createGestures.d.ts.map +1 -1
- package/dist/components/creators/createGraphicsLayout.d.ts +4 -1
- package/dist/components/creators/createGraphicsLayout.d.ts.map +1 -1
- package/dist/components/creators/createImageLayout.d.ts +4 -1
- package/dist/components/creators/createImageLayout.d.ts.map +1 -1
- package/dist/components/creators/createNineSliceLayout.d.ts +4 -1
- package/dist/components/creators/createNineSliceLayout.d.ts.map +1 -1
- package/dist/components/creators/createSpriteLayout.d.ts +4 -1
- package/dist/components/creators/createSpriteLayout.d.ts.map +1 -1
- package/dist/components/creators/createTextLayout.d.ts +4 -1
- package/dist/components/creators/createTextLayout.d.ts.map +1 -1
- package/dist/components/custom/Graphics.d.ts +6 -1
- package/dist/components/custom/Graphics.d.ts.map +1 -1
- package/dist/components/custom/Image.d.ts +6 -1
- package/dist/components/custom/Image.d.ts.map +1 -1
- package/dist/components/custom/NineSlice.d.ts +6 -1
- package/dist/components/custom/NineSlice.d.ts.map +1 -1
- package/dist/components/custom/Sprite.d.ts +1 -1
- package/dist/components/custom/Sprite.d.ts.map +1 -1
- package/dist/components/custom/Text.d.ts +6 -1
- package/dist/components/custom/Text.d.ts.map +1 -1
- package/dist/components/custom/TileSprite.d.ts +1 -1
- package/dist/components/custom/TileSprite.d.ts.map +1 -1
- package/dist/components/custom/View.d.ts +6 -1
- package/dist/components/custom/View.d.ts.map +1 -1
- package/dist/components/custom/index.cjs +1 -1
- package/dist/components/custom/index.js +1 -1
- package/dist/components/primitives/graphics.d.ts +107 -1
- package/dist/components/primitives/graphics.d.ts.map +1 -1
- package/dist/components/primitives/image.d.ts +114 -1
- package/dist/components/primitives/image.d.ts.map +1 -1
- package/dist/components/primitives/nineslice.d.ts +161 -1
- package/dist/components/primitives/nineslice.d.ts.map +1 -1
- package/dist/components/primitives/sprite.d.ts +90 -1
- package/dist/components/primitives/sprite.d.ts.map +1 -1
- package/dist/components/primitives/text.d.ts +130 -1
- package/dist/components/primitives/text.d.ts.map +1 -1
- package/dist/components/primitives/tilesprite.d.ts +115 -1
- package/dist/components/primitives/tilesprite.d.ts.map +1 -1
- package/dist/components/primitives/view.d.ts +107 -1
- package/dist/components/primitives/view.d.ts.map +1 -1
- package/dist/core-types.d.ts +5 -1
- package/dist/core-types.d.ts.map +1 -1
- package/dist/design-tokens/design-token-types.d.ts +5 -1
- package/dist/design-tokens/design-token-types.d.ts.map +1 -1
- package/dist/gestures/gesture-manager.d.ts +5 -1
- package/dist/gestures/gesture-manager.d.ts.map +1 -1
- package/dist/gestures/gesture-types.d.ts +4 -1
- package/dist/gestures/gesture-types.d.ts.map +1 -1
- package/dist/hooks-svg.d.ts +5 -1
- package/dist/hooks-svg.d.ts.map +1 -1
- package/dist/host.d.ts +5 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/index.cjs +28 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/layout/appliers/background-applier.d.ts +4 -1
- package/dist/layout/appliers/background-applier.d.ts.map +1 -1
- package/dist/layout/appliers/container-applier.d.ts +4 -1
- package/dist/layout/appliers/container-applier.d.ts.map +1 -1
- package/dist/layout/layout-engine-test-utils.d.ts +4 -1
- package/dist/layout/layout-engine-test-utils.d.ts.map +1 -1
- package/dist/layout/layout-engine.d.ts +5 -1
- package/dist/layout/layout-engine.d.ts.map +1 -1
- package/dist/layout/types.d.ts +4 -1
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/layout/utils/child-utils.d.ts +4 -1
- package/dist/layout/utils/child-utils.d.ts.map +1 -1
- package/dist/particles/emit-zone.d.ts +4 -1
- package/dist/particles/emit-zone.d.ts.map +1 -1
- package/dist/particles/particle-types.d.ts +4 -1
- package/dist/particles/particle-types.d.ts.map +1 -1
- package/dist/particles/preset-registry.d.ts +4 -1
- package/dist/particles/preset-registry.d.ts.map +1 -1
- package/dist/plugin.d.ts +5 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/portal/portal-registry.d.ts +4 -1
- package/dist/portal/portal-registry.d.ts.map +1 -1
- package/dist/portal/portal-types.d.ts +5 -1
- package/dist/portal/portal-types.d.ts.map +1 -1
- package/dist/render-context.d.ts +5 -1
- package/dist/render-context.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/dom-input-manager.d.ts +5 -1
- package/dist/utils/dom-input-manager.d.ts.map +1 -1
- package/dist/utils/fast-deep-equal.d.ts +4 -0
- package/dist/utils/fast-deep-equal.d.ts.map +1 -0
- package/dist/utils/svg-texture.d.ts +5 -1
- package/dist/utils/svg-texture.d.ts.map +1 -1
- package/dist/utils/texture-registry.d.ts +5 -1
- package/dist/utils/texture-registry.d.ts.map +1 -1
- package/dist/vdom.d.ts +1 -1
- package/dist/vdom.d.ts.map +1 -1
- package/package.json +11 -1
- package/dist/TransformOriginView-Bx81YEUU.cjs.map +0 -1
- package/dist/TransformOriginView-DCvId72M.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgIG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgIG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,cAAc,EACf,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AASxD;;;GAGG;AACH,MAAM,WAAW,aACf,SAAQ,cAAc,EACpB,WAAW,EACX,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,EAC7B,iBAAiB;IACnB,MAAM,CAAC,EAAE,UAAU,CAAA;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;CAC5D;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;CAAG;AAEnG;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAqC3C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CA+C3C,CAAA"}
|
|
@@ -1,7 +1,121 @@
|
|
|
1
|
-
import { default as Phaser } from 'phaser';
|
|
2
1
|
import { TransformProps } from '../../core-props';
|
|
3
2
|
import { HostCreator, HostPatcher } from '../../host';
|
|
4
3
|
import { PropsDefaultExtension } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* TileSprite component - Phaser TileSprite GameObject (repeating texture pattern)
|
|
6
|
+
* Status: DUMMY - Not implemented yet
|
|
7
|
+
*
|
|
8
|
+
* Design Decisions & Answers:
|
|
9
|
+
* ===========================
|
|
10
|
+
*
|
|
11
|
+
* 1. Headless Default: TRUE ✅
|
|
12
|
+
* Rationale: TileSprites are typically backgrounds/patterns (decorative).
|
|
13
|
+
* They fill available space and shouldn't affect parent dimensions.
|
|
14
|
+
* Use Cases:
|
|
15
|
+
* - ✅ Headless (default): Scrolling backgrounds, parallax layers, repeating patterns
|
|
16
|
+
* - ❌ Layout-aware: Rare - textured progress bars, pattern-filled UI blocks
|
|
17
|
+
*
|
|
18
|
+
* 2. Layout Size Provider: SIMPLE DIMENSIONS ✅
|
|
19
|
+
* Decision: Use width/height directly (not getBounds)
|
|
20
|
+
* Reasoning:
|
|
21
|
+
* - TileSprite requires explicit width/height (Phaser constructor param)
|
|
22
|
+
* - Dimensions are always known and stable
|
|
23
|
+
* - getBounds() adds unnecessary overhead
|
|
24
|
+
* - Rotation affects visual but not logical dimensions (pattern stays in rect)
|
|
25
|
+
* Implementation: __getLayoutSize = () => ({ width, height })
|
|
26
|
+
*
|
|
27
|
+
* 3. Tiling Props: DIRECT PHASER MAPPING ✅
|
|
28
|
+
* Decision: Expose Phaser's tilePosition/tileScale props directly
|
|
29
|
+
* Props:
|
|
30
|
+
* - tilePositionX/Y: Offset for scrolling effect (default: 0)
|
|
31
|
+
* - tileScaleX/Y: Tile size multiplier (default: 1)
|
|
32
|
+
* Example:
|
|
33
|
+
* <TileSprite
|
|
34
|
+
* texture="clouds"
|
|
35
|
+
* width={800} height={200}
|
|
36
|
+
* tilePositionX={scrollOffset}
|
|
37
|
+
* tileScaleX={2} // Tiles 2x larger
|
|
38
|
+
* />
|
|
39
|
+
* Note: tilePosition updates are cheap (WebGL texture wrapping, no redraw)
|
|
40
|
+
*
|
|
41
|
+
* 4. Sizing Strategy: HYBRID LAYOUT SUPPORT ✅
|
|
42
|
+
* Decision: Support both explicit and layout-aware sizing
|
|
43
|
+
* Behavior:
|
|
44
|
+
* - Explicit pixels: width={800} height={200} → Fixed size
|
|
45
|
+
* - Layout string: width="100%" height="50%" → Resolved from parent
|
|
46
|
+
* - Layout fill: width={undefined} → Auto-fill parent (if parent sized)
|
|
47
|
+
* Implementation:
|
|
48
|
+
* - Resolve layout size in creator using existing size-resolver
|
|
49
|
+
* - Create TileSprite with resolved pixel dimensions
|
|
50
|
+
* - Update dimensions in patcher if layout props change
|
|
51
|
+
* Phaser Limitation: TileSprite dimensions can't change after creation
|
|
52
|
+
* → Workaround: Recreate TileSprite if dimensions change (expensive!)
|
|
53
|
+
*
|
|
54
|
+
* 5. Performance Characteristics: OPTIMAL FOR PATTERNS ✅
|
|
55
|
+
* Advantages:
|
|
56
|
+
* - WebGL texture wrapping (hardware-accelerated, no CPU cost)
|
|
57
|
+
* - tilePosition updates are free (just shader uniform)
|
|
58
|
+
* - Good for large repeating areas (better than multiple sprites)
|
|
59
|
+
* - No geometry regeneration on scroll
|
|
60
|
+
* Limitations:
|
|
61
|
+
* - Texture must support wrapping (power-of-2 dimensions recommended)
|
|
62
|
+
* - Rotation/scale affects entire area (not individual tiles)
|
|
63
|
+
* - Can't change dimensions dynamically (requires recreation)
|
|
64
|
+
*
|
|
65
|
+
* 6. Animation Support: USER CODE ✅
|
|
66
|
+
* Decision: No built-in animation helpers
|
|
67
|
+
* Reasoning:
|
|
68
|
+
* - Scrolling patterns vary widely (linear, sine wave, parallax)
|
|
69
|
+
* - Simple to implement in user code:
|
|
70
|
+
* const [scroll, setScroll] = useState(0)
|
|
71
|
+
* useEffect(() => {
|
|
72
|
+
* const timer = setInterval(() => setScroll(s => s + 1), 16)
|
|
73
|
+
* return () => clearInterval(timer)
|
|
74
|
+
* }, [])
|
|
75
|
+
* <TileSprite tilePositionX={scroll} />
|
|
76
|
+
* - No need for framework abstraction
|
|
77
|
+
* Future: Consider useScrollingPattern hook if demand is high
|
|
78
|
+
*
|
|
79
|
+
* 7. Common Use Cases & Patterns: DOCUMENTED ✅
|
|
80
|
+
* Best For:
|
|
81
|
+
* - ✅ Scrolling backgrounds (clouds, stars, terrain)
|
|
82
|
+
* - ✅ Infinite repeating patterns (tiles, grids)
|
|
83
|
+
* - ✅ Parallax layers (different scroll speeds)
|
|
84
|
+
* - ✅ Textured fills (progress bars, health bars)
|
|
85
|
+
* Avoid For:
|
|
86
|
+
* - ❌ Static backgrounds → Use Image (simpler)
|
|
87
|
+
* - ❌ Complex patterns → Use Graphics or multiple Sprites
|
|
88
|
+
* - ❌ Animated tiles → Use Sprite with animation
|
|
89
|
+
*
|
|
90
|
+
* 8. Origin Behavior: UI-FRIENDLY DEFAULT 🆕
|
|
91
|
+
* Decision: Default origin (0, 0) like Image (differs from Sprite!)
|
|
92
|
+
* Reasoning:
|
|
93
|
+
* - TileSprites typically used as backgrounds/fills (top-left alignment)
|
|
94
|
+
* - Matches Image component behavior (UI semantics)
|
|
95
|
+
* - Easier layout calculations
|
|
96
|
+
* - Allow override via originX/originY for special cases
|
|
97
|
+
*
|
|
98
|
+
* 9. Rotation & Tiling: DOCUMENTED BEHAVIOR 🆕
|
|
99
|
+
* Behavior:
|
|
100
|
+
* - Rotation rotates entire TileSprite area (not individual tiles)
|
|
101
|
+
* - Tile pattern remains axis-aligned in texture space
|
|
102
|
+
* - Useful for rotated pattern fills, but limited flexibility
|
|
103
|
+
* - For rotated individual tiles, use multiple Sprite instances
|
|
104
|
+
*
|
|
105
|
+
* Implementation Checklist:
|
|
106
|
+
* ========================
|
|
107
|
+
* [ ] Create TileSprite with scene.add.tileSprite(x, y, width, height, texture, frame)
|
|
108
|
+
* [ ] Set origin to (0, 0) by default (UI-friendly)
|
|
109
|
+
* [ ] Apply transform props via applyTransformProps
|
|
110
|
+
* [ ] Setup tilePosition/tileScale props
|
|
111
|
+
* [ ] Implement layout size resolver (support %, fill)
|
|
112
|
+
* [ ] Setup layout size provider (width/height)
|
|
113
|
+
* [ ] Handle dimension changes (recreate if needed)
|
|
114
|
+
* [ ] Support tint, origin props
|
|
115
|
+
* [ ] Test with scrolling, scaling, rotation
|
|
116
|
+
* [ ] Document power-of-2 texture recommendation
|
|
117
|
+
*/
|
|
118
|
+
import type * as Phaser from 'phaser';
|
|
5
119
|
/**
|
|
6
120
|
* Base props for TileSprite component
|
|
7
121
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tilesprite.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/tilesprite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"tilesprite.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/tilesprite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAA;IAEf,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IAEb,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAA;IAEd,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eACf,SAAQ,mBAAmB,EACzB,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;CAAG;AAE3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAIvD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAIvD,CAAA"}
|
|
@@ -1,7 +1,113 @@
|
|
|
1
|
-
import { default as Phaser } from 'phaser';
|
|
2
1
|
import { BackgroundProps, GestureProps, LayoutProps, PhaserProps, TransformProps } from '../../core-props';
|
|
3
2
|
import { HostCreator, HostPatcher } from '../../host';
|
|
4
3
|
import { PropsContainerExtension, PropsDefaultExtension } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* View component - Phaser Container with background Graphics and layout system
|
|
6
|
+
* Status: IMPLEMENTED ✅
|
|
7
|
+
*
|
|
8
|
+
* Design Overview:
|
|
9
|
+
* ================
|
|
10
|
+
*
|
|
11
|
+
* 1. Component Role: LAYOUT CONTAINER
|
|
12
|
+
* Purpose: Primary layout primitive for UI composition
|
|
13
|
+
* Composition: Phaser.Container + Background Graphics (optional)
|
|
14
|
+
* Responsibilities:
|
|
15
|
+
* - Layout orchestration (flexbox-style positioning of children)
|
|
16
|
+
* - Visual styling (background color, borders, corner radius)
|
|
17
|
+
* - Gesture handling (touch/mouse interaction)
|
|
18
|
+
* - Dimension management (defines its own size + provides context for children)
|
|
19
|
+
*
|
|
20
|
+
* 2. Headless Behavior: NEVER HEADLESS ⚠️
|
|
21
|
+
* Decision: View cannot be headless (always participates in layout)
|
|
22
|
+
* Reasoning:
|
|
23
|
+
* - View IS the layout system - it defines layout context for children
|
|
24
|
+
* - Background Graphics has special role (__isBackground flag)
|
|
25
|
+
* - Graphics is internal to View, excluded from child layout calculations
|
|
26
|
+
* - If you need non-layout container, use raw Phaser.Container directly
|
|
27
|
+
*
|
|
28
|
+
* 3. Layout System Architecture:
|
|
29
|
+
* Two-part system:
|
|
30
|
+
* A) Background Graphics (special role):
|
|
31
|
+
* - Defines View dimensions (not a layout child!)
|
|
32
|
+
* - Marked with __isBackground = true
|
|
33
|
+
* - Filtered out in layout calculations (see isLayoutChild helper)
|
|
34
|
+
* - Automatically resized to match container dimensions
|
|
35
|
+
* B) Layout Engine:
|
|
36
|
+
* - Processes children (Views, Text, Images, etc.)
|
|
37
|
+
* - Applies flexbox-style layout (row/column/stack)
|
|
38
|
+
* - Respects headless flag on children
|
|
39
|
+
* - Updates child positions/sizes based on layout props
|
|
40
|
+
*
|
|
41
|
+
* 4. Background Graphics vs. Graphics Component:
|
|
42
|
+
* Distinction:
|
|
43
|
+
* - View Background: Internal, auto-managed, defines dimensions, __isBackground=true
|
|
44
|
+
* - Graphics Component: User-facing, custom shapes, typically headless=true
|
|
45
|
+
* - Both use Phaser.Graphics but completely different purposes
|
|
46
|
+
*
|
|
47
|
+
* 5. Layout Size Provider:
|
|
48
|
+
* Implementation: __getLayoutSize returns explicit or calculated dimensions
|
|
49
|
+
* Behavior:
|
|
50
|
+
* - Explicit width/height: Use those values
|
|
51
|
+
* - Auto-size (undefined): Calculate from children + padding
|
|
52
|
+
* - Percentage/fill: Resolve from parent context
|
|
53
|
+
* - Critical: Background Graphics updates to match final size
|
|
54
|
+
*
|
|
55
|
+
* 6. Gesture System Integration:
|
|
56
|
+
* Features:
|
|
57
|
+
* - enableGestures: true enables touch/mouse interaction
|
|
58
|
+
* - Hit area automatically sized to container dimensions
|
|
59
|
+
* - Updated after layout recalculation (deferred queue)
|
|
60
|
+
* - Supports: onTouch, onTouchMove, onDoubleTap, onLongPress
|
|
61
|
+
* - Cross-platform (transparent mouse/touch support)
|
|
62
|
+
*
|
|
63
|
+
* 7. Styling Props:
|
|
64
|
+
* Background:
|
|
65
|
+
* - backgroundColor/backgroundAlpha: Fill color
|
|
66
|
+
* - cornerRadius: Rounded corners (number or per-corner object)
|
|
67
|
+
* - borderColor/borderWidth/borderAlpha: Stroke
|
|
68
|
+
* Auto-defaults:
|
|
69
|
+
* - backgroundAlpha defaults to 1 if backgroundColor set
|
|
70
|
+
* - borderWidth defaults to 1 if borderColor set
|
|
71
|
+
*
|
|
72
|
+
* 8. Common Patterns:
|
|
73
|
+
* Layout Container:
|
|
74
|
+
* <View direction="row" gap={10} padding={20}>
|
|
75
|
+
* <View flex={1}>Left</View>
|
|
76
|
+
* <View flex={2}>Right</View>
|
|
77
|
+
* </View>
|
|
78
|
+
* Styled Box:
|
|
79
|
+
* <View backgroundColor={0x3498db} cornerRadius={8} padding={16}>
|
|
80
|
+
* <Text text="Card Content" />
|
|
81
|
+
* </View>
|
|
82
|
+
* Interactive Area:
|
|
83
|
+
* <View enableGestures={true} onTouch={() => console.log('clicked')}>
|
|
84
|
+
* <Text text="Button" />
|
|
85
|
+
* </View>
|
|
86
|
+
*
|
|
87
|
+
* 9. Performance Considerations:
|
|
88
|
+
* - Background Graphics redrawn only when visual props change
|
|
89
|
+
* - Layout calculations batched (LayoutBatchQueue)
|
|
90
|
+
* - Gesture hit areas updated in deferred queue (post-layout)
|
|
91
|
+
* - Overflow masking (overflow="hidden") adds Phaser mask overhead
|
|
92
|
+
*
|
|
93
|
+
* 10. Known Limitations:
|
|
94
|
+
* - Background Graphics cannot be independently positioned/rotated
|
|
95
|
+
* - Nested View layout recalculations can be expensive (use sparingly)
|
|
96
|
+
* - Gesture system requires scene pointer plugin (auto-enabled)
|
|
97
|
+
*
|
|
98
|
+
* Implementation Status:
|
|
99
|
+
* ======================
|
|
100
|
+
* [✅] Phaser Container creation
|
|
101
|
+
* [✅] Background Graphics with styling (color, border, radius)
|
|
102
|
+
* [✅] Layout system integration (__layoutProps, __getLayoutSize)
|
|
103
|
+
* [✅] Transform props (position, rotation, scale, alpha)
|
|
104
|
+
* [✅] Gesture system (enableGestures, interaction callbacks)
|
|
105
|
+
* [✅] Auto-defaults for background/border alpha
|
|
106
|
+
* [✅] Overflow masking support
|
|
107
|
+
* [✅] Theme system integration
|
|
108
|
+
* [✅] Deferred layout queue for gesture updates
|
|
109
|
+
*/
|
|
110
|
+
import * as Phaser from 'phaser';
|
|
5
111
|
/**
|
|
6
112
|
* Base props for View - composing shared prop groups
|
|
7
113
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;AACH,OAAO,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,EACf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAiDjF;;GAEG;AACH,MAAM,WAAW,aACf,SAAQ,cAAc,EACpB,WAAW,EACX,WAAW,EACX,eAAe,EACf,YAAY;CAAG;AAEnB;;GAEG;AACH,MAAM,WAAW,SACf,SAAQ,aAAa,EACnB,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EACnD,uBAAuB;CAAG;AAE9B;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAyD3C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CA2C3C,CAAA"}
|
package/dist/core-types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as Phaser } from 'phaser';
|
|
2
1
|
import { GraphicsBaseProps } from './components/primitives/graphics';
|
|
3
2
|
import { ImageBaseProps } from './components/primitives/image';
|
|
4
3
|
import { NineSliceBaseProps } from './components/primitives/nineslice';
|
|
@@ -7,6 +6,11 @@ import { SpriteBaseProps } from './components/primitives/sprite';
|
|
|
7
6
|
import { TextBaseProps } from './components/primitives/text';
|
|
8
7
|
import { TileSpriteBaseProps } from './components/primitives/tilesprite';
|
|
9
8
|
import { ViewBaseProps } from './components/primitives/view';
|
|
9
|
+
/**
|
|
10
|
+
* Core type system for native Phaser GameObject primitives
|
|
11
|
+
* Defines the mapping between node type names and their corresponding Phaser types
|
|
12
|
+
*/
|
|
13
|
+
import type * as Phaser from 'phaser';
|
|
10
14
|
/**
|
|
11
15
|
* Maps node type names to Phaser GameObject classes
|
|
12
16
|
*/
|
package/dist/core-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-types.d.ts","sourceRoot":"","sources":["../src/core-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"core-types.d.ts","sourceRoot":"","sources":["../src/core-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAC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AC,WAAW,CAAC,QAAQ,CAAA;IACrC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAA;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAE3B,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,aAAa,CAAA;IACnB,SAAS,EAAE,kBAAkB,CAAA;IAC7B,SAAS,EAAE,kBAAkB,CAAA;IAC7B,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,cAAc,CAAA;IACrB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,UAAU,EAAE,mBAAmB,CAAA;IAE/B,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,aAAa,CAAA;IACnB,SAAS,EAAE,kBAAkB,CAAA;IAC7B,SAAS,EAAE,kBAAkB,CAAA;IAC7B,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,cAAc,CAAA;IACrB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,UAAU,EAAE,mBAAmB,CAAA;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAA;AAEpC;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;AAEpE;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { default as Phaser } from 'phaser';
|
|
2
1
|
import { ColorTokens } from '../colors';
|
|
2
|
+
/**
|
|
3
|
+
* Design token type definitions for PhaserJSX UI
|
|
4
|
+
* Provides semantic tokens for text styles, spacing, sizes, and other design properties
|
|
5
|
+
*/
|
|
6
|
+
import type * as Phaser from 'phaser';
|
|
3
7
|
/**
|
|
4
8
|
* Text style preset token
|
|
5
9
|
* Complete style object ready for Text component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-token-types.d.ts","sourceRoot":"","sources":["../../src/design-tokens/design-token-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"design-token-types.d.ts","sourceRoot":"","sources":["../../src/design-tokens/design-token-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,OAAO,EAAE,cAAc,CAAA;IACvB,2CAA2C;IAC3C,KAAK,EAAE,cAAc,CAAA;IACrB,4CAA4C;IAC5C,MAAM,EAAE,cAAc,CAAA;IACtB,gDAAgD;IAChD,KAAK,EAAE,cAAc,CAAA;IACrB,yCAAyC;IACzC,KAAK,EAAE,cAAc,CAAA;IACrB,0CAA0C;IAC1C,OAAO,EAAE,cAAc,CAAA;IACvB,iEAAiE;IACjE,OAAO,EAAE,cAAc,CAAA;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,kBAAkB;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,iCAAiC;IACjC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,MAAM,EAAE,WAAW,CAAA;IACnB,oDAAoD;IACpD,UAAU,EAAE,eAAe,CAAA;IAC3B,4CAA4C;IAC5C,OAAO,EAAE,aAAa,CAAA;IACtB,6CAA6C;IAC7C,KAAK,EAAE,UAAU,CAAA;IACjB,iDAAiD;IACjD,MAAM,EAAE,YAAY,CAAA;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { default as Phaser } from 'phaser';
|
|
2
1
|
import { GestureCallbacks, GestureConfig } from './gesture-types';
|
|
2
|
+
/**
|
|
3
|
+
* Global gesture manager for high-level touch and mouse interactions
|
|
4
|
+
* Uses global Phaser input events to track gestures even when pointer moves outside bounds
|
|
5
|
+
*/
|
|
6
|
+
import * as Phaser from 'phaser';
|
|
3
7
|
/**
|
|
4
8
|
* Generate unique mount root ID for mountJSX isolation
|
|
5
9
|
* @returns Unique root ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gesture-manager.d.ts","sourceRoot":"","sources":["../../src/gestures/gesture-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"gesture-manager.d.ts","sourceRoot":"","sources":["../../src/gestures/gesture-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EAKd,MAAM,iBAAiB,CAAA;AAMxB;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,UAAU,CAAiE;IAGnF,OAAO,CAAC,oBAAoB,CAA8C;IAG1E,OAAO,CAAC,iBAAiB,CAKV;IAGf,OAAO,CAAC,uBAAuB,CAAuD;IAGtF,OAAO,CAAC,iBAAiB,CAAmD;IAG5E,OAAO,CAAC,eAAe,CAAoB;IAE3C,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,WAAW,CAAQ;gBAEf,KAAK,EAAE,MAAM,CAAC,KAAK;IAI/B;;OAEG;IACH,OAAO,CAAC,UAAU;IA4BlB;;;;;;OAMG;IACH,iBAAiB,CACf,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EACvC,SAAS,EAAE,gBAAgB,EAC3B,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAC9B,MAAM,GAAE,aAAkB,GACzB,IAAI;IAkBP;;;OAGG;IACH,mBAAmB,CAAC,SAAS,EAAE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|
|
1
|
+
{"version":3,"file":"gesture-types.d.ts","sourceRoot":"","sources":["../../src/gestures/gesture-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AAErC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,KAAK,EAAE,aAAa,CAAA;IACpB,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAA;IACX,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,sCAAsC;IACtC,MAAM,EAAE,OAAO,CAAA;IACf,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAA;IACjB,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAA;IAChB,qDAAqD;IACrD,MAAM,EAAE,OAAO,CAAA;IAEf;;OAEG;IACH,cAAc,IAAI,IAAI,CAAA;IAEtB;;OAEG;IACH,eAAe,IAAI,IAAI,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,mCAAmC;IACnC,KAAK,EAAE,KAAK,CAAA;IAEZ;;OAEG;IACH,cAAc,IAAI,IAAI,CAAA;IAEtB;;OAEG;IACH,eAAe,IAAI,IAAI,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,KAAK,EAAE,UAAU,CAAA;IAEjB;;OAEG;IACH,cAAc,IAAI,IAAI,CAAA;IAEtB;;OAEG;IACH,eAAe,IAAI,IAAI,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAA;IAC7B,4DAA4D;IAC5D,MA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registry for isolation
|
|
4
|
+
*/
|
|
5
|
+
import * as Phaser from 'phaser';
|
|
2
6
|
/**
|
|
3
7
|
* SVG texture configuration for loading
|
|
4
8
|
*/
|
package/dist/hooks-svg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-svg.d.ts","sourceRoot":"","sources":["../src/hooks-svg.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"hooks-svg.d.ts","sourceRoot":"","sources":["../src/hooks-svg.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAKhC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAExE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAI5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,MAAW,EAClB,MAAM,GAAE,MAAW,GAClB,OAAO,CAoCT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAwDnE"}
|
package/dist/host.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { default as Phaser } from 'phaser';
|
|
2
1
|
import { NodeInstance, NodeProps, NodeType } from './core-types';
|
|
2
|
+
/**
|
|
3
|
+
* Host layer - Generic bridge between VDOM and Phaser GameObjects
|
|
4
|
+
* Provides type-safe creator/patcher pattern for extensible node types
|
|
5
|
+
*/
|
|
6
|
+
import * as Phaser from 'phaser';
|
|
3
7
|
/**
|
|
4
8
|
* Host creator function type - creates a node instance from props
|
|
5
9
|
*/
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAErE;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,QAAQ,IAAI,CAC5C,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAChB,YAAY,CAAC,CAAC,CAAC,CAAA;AAEpB;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,QAAQ,IAAI,CAC5C,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EACrB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAClB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KACf,IAAI,CAAA;AAET;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,QAAQ;IAChD,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;IACtB,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CACtB;AAED;;GAEG;AACH,KAAK,YAAY,GAAG;KACjB,CAAC,IAAI,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC;CACnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,YAAY,CAAM,CAAA;AAErD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAEzF;AAED;;GAEG;AACH,eAAO,MAAM,IAAI;IACf;;;;;;;OAOG;WACI,CAAC,SAAS,QAAQ,QAAQ,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC;IAQ9F;;;;;;OAMG;UACG,CAAC,SAAS,QAAQ,QAChB,CAAC,QACD,YAAY,CAAC,CAAC,CAAC,QACf,SAAS,CAAC,CAAC,CAAC,QACZ,SAAS,CAAC,CAAC,CAAC,GACjB,IAAI;IAQP;;;;OAIG;mBACY,OAAO,SAAS,OAAO;IAmBtC;;;;OAIG;mBACY,OAAO,SAAS,OAAO;IAiBtC;;OAEG;;CAKJ,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const vdom = require("./TransformOriginView-
|
|
3
|
+
const vdom = require("./TransformOriginView-CrzevUOh.cjs");
|
|
4
4
|
const Phaser$1 = require("phaser");
|
|
5
5
|
const jsxRuntime = require("./jsx-runtime.cjs");
|
|
6
6
|
const signalsCore = require("@preact/signals-core");
|
|
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$1);
|
|
7
24
|
function shallowEqual(a, b) {
|
|
8
25
|
if (!a || !b) return a === b;
|
|
9
26
|
if (a.length !== b.length) return false;
|
|
@@ -426,13 +443,13 @@ function buildZoneSource(zone, fallbackSize) {
|
|
|
426
443
|
const { width, height } = resolveZoneSize(zone, fallbackSize);
|
|
427
444
|
switch (zone.shape) {
|
|
428
445
|
case "rect":
|
|
429
|
-
return new
|
|
446
|
+
return new Phaser__namespace.Geom.Rectangle(baseX, baseY, width ?? 1, height ?? 1);
|
|
430
447
|
case "circle":
|
|
431
|
-
return new
|
|
448
|
+
return new Phaser__namespace.Geom.Circle(baseX, baseY, zone.radius ?? 1);
|
|
432
449
|
case "ellipse":
|
|
433
|
-
return new
|
|
450
|
+
return new Phaser__namespace.Geom.Ellipse(baseX, baseY, width ?? 1, height ?? 1);
|
|
434
451
|
case "line":
|
|
435
|
-
return new
|
|
452
|
+
return new Phaser__namespace.Geom.Line(
|
|
436
453
|
baseX,
|
|
437
454
|
baseY,
|
|
438
455
|
zone.endX ?? baseX + (width ?? 1),
|
|
@@ -1150,7 +1167,7 @@ function applyGesturesProps(scene, container, prev, next) {
|
|
|
1150
1167
|
width = bounds.width || 100;
|
|
1151
1168
|
height = bounds.height || 100;
|
|
1152
1169
|
}
|
|
1153
|
-
const hitArea = new
|
|
1170
|
+
const hitArea = new Phaser__namespace.Geom.Rectangle(0, 0, width, height);
|
|
1154
1171
|
const callbacks = {};
|
|
1155
1172
|
if (next.onTouch) callbacks.onTouch = next.onTouch;
|
|
1156
1173
|
if (next.onTouchOutside) callbacks.onTouchOutside = next.onTouchOutside;
|
|
@@ -1196,7 +1213,7 @@ function applyGesturesProps(scene, container, prev, next) {
|
|
|
1196
1213
|
width = bounds.width || 100;
|
|
1197
1214
|
height = bounds.height || 100;
|
|
1198
1215
|
}
|
|
1199
|
-
const hitArea = new
|
|
1216
|
+
const hitArea = new Phaser__namespace.Geom.Rectangle(0, 0, width, height);
|
|
1200
1217
|
manager.updateHitArea(container, hitArea);
|
|
1201
1218
|
}
|
|
1202
1219
|
}
|
|
@@ -1563,7 +1580,7 @@ function createGestures(scene, container, props) {
|
|
|
1563
1580
|
width = bounds.width || 100;
|
|
1564
1581
|
height = bounds.height || 100;
|
|
1565
1582
|
}
|
|
1566
|
-
const hitArea = new
|
|
1583
|
+
const hitArea = new Phaser__namespace.Geom.Rectangle(0, 0, width, height);
|
|
1567
1584
|
const callbacks = {};
|
|
1568
1585
|
if (props.onTouch) callbacks.onTouch = props.onTouch;
|
|
1569
1586
|
if (props.onTouchOutside) callbacks.onTouchOutside = props.onTouchOutside;
|
|
@@ -1747,7 +1764,7 @@ function registerBuiltins() {
|
|
|
1747
1764
|
}
|
|
1748
1765
|
const createCameraShakeFX = (camera, config) => {
|
|
1749
1766
|
const duration = config.duration ?? 250;
|
|
1750
|
-
const intensity = typeof config.intensity === "object" ? new
|
|
1767
|
+
const intensity = typeof config.intensity === "object" ? new Phaser__namespace.Math.Vector2(config.intensity.x, config.intensity.y) : config.intensity ?? 0.01;
|
|
1751
1768
|
camera.shake(duration, intensity, config.force ?? false, config.onComplete);
|
|
1752
1769
|
};
|
|
1753
1770
|
const createCameraFlashFX = (camera, config) => {
|
|
@@ -2161,7 +2178,7 @@ function createPhaserJSXPlugin(config) {
|
|
|
2161
2178
|
data: config
|
|
2162
2179
|
};
|
|
2163
2180
|
}
|
|
2164
|
-
class PhaserJSXPlugin extends
|
|
2181
|
+
class PhaserJSXPlugin extends Phaser__namespace.Plugins.BasePlugin {
|
|
2165
2182
|
config;
|
|
2166
2183
|
mountHandle;
|
|
2167
2184
|
container;
|
|
@@ -2406,7 +2423,7 @@ function setColorPreset(presetName, colorMode) {
|
|
|
2406
2423
|
return;
|
|
2407
2424
|
}
|
|
2408
2425
|
setTimeout(() => {
|
|
2409
|
-
Promise.resolve().then(() => require("./TransformOriginView-
|
|
2426
|
+
Promise.resolve().then(() => require("./TransformOriginView-CrzevUOh.cjs")).then((n) => n.vdom).then(({ remountAll }) => {
|
|
2410
2427
|
remountAll();
|
|
2411
2428
|
});
|
|
2412
2429
|
}, 0);
|