@number10/phaserjsx 0.6.1 → 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.
- package/README.md +43 -3
- package/dist/chunk-C2EiDwsr.cjs +35 -0
- package/dist/clip/index.cjs +696 -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 +688 -0
- package/dist/clip/index.js.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.d.ts +134 -0
- package/dist/clip/stencil-clip.d.ts.map +1 -0
- package/dist/components/appliers/applyBackground.d.ts +2 -1
- package/dist/components/appliers/applyBackground.d.ts.map +1 -1
- package/dist/components/appliers/applyGestures.d.ts.map +1 -1
- package/dist/components/appliers/applyTooltip.d.ts.map +1 -1
- package/dist/components/backgroundImage.d.ts +12 -0
- package/dist/components/backgroundImage.d.ts.map +1 -0
- package/dist/components/creators/createBackground.d.ts +2 -1
- package/dist/components/creators/createBackground.d.ts.map +1 -1
- package/dist/components/creators/createGestures.d.ts.map +1 -1
- package/dist/components/custom/Accordion.d.ts.map +1 -1
- package/dist/components/custom/CharText/CharText.d.ts.map +1 -1
- package/dist/components/custom/Dialog.d.ts +1 -1
- package/dist/components/custom/Divider.d.ts +1 -1
- package/dist/components/custom/Dropdown.d.ts.map +1 -1
- package/dist/components/custom/Graphics.d.ts +1 -1
- package/dist/components/custom/Graphics.d.ts.map +1 -1
- package/dist/components/custom/Icon.d.ts.map +1 -1
- package/dist/components/custom/Image.d.ts.map +1 -1
- package/dist/components/custom/Joystick.d.ts +1 -1
- package/dist/components/custom/NineSlice.d.ts.map +1 -1
- package/dist/components/custom/Particles.d.ts +1 -1
- package/dist/components/custom/Particles.d.ts.map +1 -1
- package/dist/components/custom/Portal.d.ts.map +1 -1
- package/dist/components/custom/RefOriginView.d.ts +1 -1
- package/dist/components/custom/ScrollView.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.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.map +1 -1
- package/dist/components/custom/index.cjs +34 -36
- package/dist/components/custom/index.js +2 -37
- package/dist/components/primitives/graphics.d.ts.map +1 -1
- package/dist/components/primitives/image.d.ts.map +1 -1
- package/dist/components/primitives/nineslice.d.ts.map +1 -1
- package/dist/components/primitives/particles.d.ts.map +1 -1
- package/dist/components/primitives/sprite.d.ts.map +1 -1
- package/dist/components/primitives/text.d.ts.map +1 -1
- package/dist/components/primitives/tilesprite.d.ts.map +1 -1
- package/dist/components/primitives/view.d.ts.map +1 -1
- package/dist/custom-C_w8D39m.js +29259 -0
- package/dist/custom-C_w8D39m.js.map +1 -0
- package/dist/custom-Dp3yAJdU.cjs +30498 -0
- package/dist/custom-Dp3yAJdU.cjs.map +1 -0
- package/dist/fx/fx-creators/blur.d.ts.map +1 -1
- package/dist/fx/fx-creators/color-matrix.d.ts.map +1 -1
- package/dist/fx/fx-creators/glow.d.ts.map +1 -1
- package/dist/fx/fx-creators/pixelate.d.ts.map +1 -1
- package/dist/fx/fx-creators/shadow.d.ts.map +1 -1
- package/dist/fx/fx-creators/vignette.d.ts.map +1 -1
- package/dist/fx/use-fx.d.ts +3 -3
- package/dist/fx/use-fx.d.ts.map +1 -1
- package/dist/gestures/gesture-manager.d.ts +3 -1
- package/dist/gestures/gesture-manager.d.ts.map +1 -1
- package/dist/gestures/gesture-types.d.ts +1 -1
- package/dist/gestures/gesture-types.d.ts.map +1 -1
- package/dist/hooks.d.ts +9 -8
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.cjs +1628 -2837
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1430 -2866
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.cjs +12 -7
- package/dist/jsx-dev-runtime.cjs.map +1 -1
- package/dist/jsx-dev-runtime.js +11 -11
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.cjs +55 -33
- package/dist/jsx-runtime.cjs.map +1 -1
- package/dist/jsx-runtime.js +56 -37
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/layout/appliers/background-applier.d.ts.map +1 -1
- package/dist/layout/layout-engine.d.ts.map +1 -1
- package/dist/layout/types.d.ts +2 -1
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/scene-backgrounds.d.ts +51 -1
- package/dist/scene-backgrounds.d.ts.map +1 -1
- package/dist/scripts/generate-icon-loaders.js +146 -143
- package/dist/scripts/generate-icon-types.js +94 -83
- package/dist/scripts/generate-icons.d.ts +1 -2
- package/dist/scripts/generate-icons.d.ts.map +1 -1
- package/dist/scripts/generate-icons.js +381 -399
- package/dist/scripts/icon-generator-config.d.ts +0 -1
- package/dist/scripts/icon-generator-config.js +7 -4
- package/dist/theme-base.d.ts.map +1 -1
- package/dist/vite-plugin-icons.d.ts +1 -2
- package/dist/vite-plugin-icons.js +109 -90
- package/package.json +29 -22
- package/dist/TransformOriginView-Dw_HKnFH.cjs +0 -17116
- package/dist/TransformOriginView-Dw_HKnFH.cjs.map +0 -1
- package/dist/TransformOriginView-i8uVBHb1.js +0 -17100
- package/dist/TransformOriginView-i8uVBHb1.js.map +0 -1
- package/dist/components/custom/index.cjs.map +0 -1
- package/dist/components/custom/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# @number10/phaserjsx
|
|
2
2
|
|
|
3
|
-
> Declarative
|
|
3
|
+
> Declarative Phaser 4 UI framework with React-like components and TypeScript
|
|
4
4
|
|
|
5
|
-
A modern, type-safe framework for building game UIs in
|
|
5
|
+
A modern, type-safe framework for building game UIs in Phaser 4 using JSX components, hooks, and a powerful theme system.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@number10/phaserjsx)
|
|
8
8
|
[](../../LICENSE)
|
|
9
9
|
|
|
10
|
+
## Compatibility
|
|
11
|
+
|
|
12
|
+
`@number10/phaserjsx` 4.x is built for Phaser 4 and has a `phaser@^4.1.0` peer dependency. Phaser 3 projects should stay on the previous UI line:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @number10/phaserjsx@0.6.1 phaser@^3
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The 4.x line uses Phaser 4 render steps, filters, and WebGL behavior and is not intended to be a drop-in upgrade for Phaser 3 projects.
|
|
19
|
+
|
|
10
20
|
## ✨ Features
|
|
11
21
|
|
|
12
22
|
- 🎨 **React-like API** - Familiar JSX syntax with hooks (useState, useEffect, useMemo, etc.)
|
|
@@ -16,7 +26,8 @@ A modern, type-safe framework for building game UIs in Phaser3 using JSX compone
|
|
|
16
26
|
- 🎭 **Built-in Effects** - 23+ animation effects (pulse, shake, fade, bounce, etc.)
|
|
17
27
|
- 📱 **Responsive Design** - Flexible layout with multiple size value formats (px, %, vw/vh, fill, auto, calc)
|
|
18
28
|
- 🔧 **Custom Components** - Easy to create and integrate custom components
|
|
19
|
-
- 🎮 **Phaser Integration** - Seamless integration with
|
|
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
|
|
20
31
|
- 📊 **SVG Support** - Convert SVG to Phaser textures with caching
|
|
21
32
|
- 🚀 **Performance** - Optimized VDOM reconciliation with smart dirty checking
|
|
22
33
|
|
|
@@ -87,6 +98,35 @@ const config: Phaser.Types.Core.GameConfig = {
|
|
|
87
98
|
new Phaser.Game(config)
|
|
88
99
|
```
|
|
89
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
|
+
|
|
90
130
|
## 📖 Documentation
|
|
91
131
|
|
|
92
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
|
+
});
|