@number10/phaserjsx 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +30 -0
  2. package/dist/chunk-C2EiDwsr.cjs +35 -0
  3. package/dist/clip/index.cjs +696 -0
  4. package/dist/clip/index.cjs.map +1 -0
  5. package/dist/clip/index.d.ts +3 -0
  6. package/dist/clip/index.d.ts.map +1 -0
  7. package/dist/clip/index.js +688 -0
  8. package/dist/clip/index.js.map +1 -0
  9. package/dist/clip/stencil-clip-extension.d.ts +18 -0
  10. package/dist/clip/stencil-clip-extension.d.ts.map +1 -0
  11. package/dist/clip/stencil-clip.d.ts +55 -7
  12. package/dist/clip/stencil-clip.d.ts.map +1 -1
  13. package/dist/components/appliers/applyBackground.d.ts +2 -1
  14. package/dist/components/appliers/applyBackground.d.ts.map +1 -1
  15. package/dist/components/appliers/applyTooltip.d.ts.map +1 -1
  16. package/dist/components/backgroundImage.d.ts +12 -0
  17. package/dist/components/backgroundImage.d.ts.map +1 -0
  18. package/dist/components/creators/createBackground.d.ts +2 -1
  19. package/dist/components/creators/createBackground.d.ts.map +1 -1
  20. package/dist/components/custom/Accordion.d.ts.map +1 -1
  21. package/dist/components/custom/Dropdown.d.ts.map +1 -1
  22. package/dist/components/custom/index.cjs +1 -1
  23. package/dist/components/custom/index.js +1 -1
  24. package/dist/components/primitives/view.d.ts.map +1 -1
  25. package/dist/{custom-oy3mBnrW.js → custom-C_w8D39m.js} +178 -481
  26. package/dist/custom-C_w8D39m.js.map +1 -0
  27. package/dist/{custom-BN31OAJq.cjs → custom-Dp3yAJdU.cjs} +187 -515
  28. package/dist/custom-Dp3yAJdU.cjs.map +1 -0
  29. package/dist/hooks.d.ts +9 -8
  30. package/dist/hooks.d.ts.map +1 -1
  31. package/dist/index.cjs +103 -22
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +96 -22
  36. package/dist/index.js.map +1 -1
  37. package/dist/layout/appliers/background-applier.d.ts.map +1 -1
  38. package/dist/layout/layout-engine.d.ts.map +1 -1
  39. package/dist/layout/types.d.ts +2 -1
  40. package/dist/layout/types.d.ts.map +1 -1
  41. package/dist/scene-backgrounds.d.ts +51 -1
  42. package/dist/scene-backgrounds.d.ts.map +1 -1
  43. package/package.json +6 -1
  44. package/dist/custom-BN31OAJq.cjs.map +0 -1
  45. package/dist/custom-oy3mBnrW.js.map +0 -1
package/README.md CHANGED
@@ -27,6 +27,7 @@ The 4.x line uses Phaser 4 render steps, filters, and WebGL behavior and is not
27
27
  - 📱 **Responsive Design** - Flexible layout with multiple size value formats (px, %, vw/vh, fill, auto, calc)
28
28
  - 🔧 **Custom Components** - Easy to create and integrate custom components
29
29
  - 🎮 **Phaser Integration** - Seamless integration with Phaser 4 game objects and scenes
30
+ - ✂️ **Stencil Clipping** - Native Phaser Container stencil clips with fast rounded rectangles and bitmap masks
30
31
  - 📊 **SVG Support** - Convert SVG to Phaser textures with caching
31
32
  - 🚀 **Performance** - Optimized VDOM reconciliation with smart dirty checking
32
33
 
@@ -97,6 +98,35 @@ const config: Phaser.Types.Core.GameConfig = {
97
98
  new Phaser.Game(config)
98
99
  ```
99
100
 
101
+ ## ✂️ Standalone Stencil Clip
102
+
103
+ The stencil clip extension can be used directly with native Phaser Containers, with or without PhaserJSX components:
104
+
105
+ ```ts
106
+ import '@number10/phaserjsx/clip'
107
+
108
+ const panel = this.add.container(40, 40)
109
+
110
+ panel.setStencilClip({
111
+ kind: 'roundRect',
112
+ width: 220,
113
+ height: 120,
114
+ cornerRadius: 16,
115
+ })
116
+ ```
117
+
118
+ Bitmap masks are also supported. They are evaluated as hard stencil masks using an alpha threshold:
119
+
120
+ ```ts
121
+ panel.setStencilClip({
122
+ kind: 'bitmap',
123
+ texture: 'panel-mask',
124
+ width: 220,
125
+ height: 120,
126
+ alphaThreshold: 0.5,
127
+ })
128
+ ```
129
+
100
130
  ## 📖 Documentation
101
131
 
102
132
  [📖 Full Documentation](https://michael--.github.io/phaserjsx/)
@@ -0,0 +1,35 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ //#endregion
24
+ Object.defineProperty(exports, "__commonJSMin", {
25
+ enumerable: true,
26
+ get: function() {
27
+ return __commonJSMin;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "__toESM", {
31
+ enumerable: true,
32
+ get: function() {
33
+ return __toESM;
34
+ }
35
+ });