@energy8platform/game-engine 0.14.10 → 0.15.1
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/dist/audio.cjs.js +6 -1
- package/dist/audio.cjs.js.map +1 -1
- package/dist/audio.esm.js +6 -1
- package/dist/audio.esm.js.map +1 -1
- package/dist/core.cjs.js +6 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.esm.js +6 -1
- package/dist/core.esm.js.map +1 -1
- package/dist/index.cjs.js +28 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +24 -5
- package/dist/index.esm.js +28 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/react-jsx.cjs.js +3 -0
- package/dist/react-jsx.cjs.js.map +1 -0
- package/dist/react-jsx.d.ts +602 -0
- package/dist/react-jsx.esm.js +2 -0
- package/dist/react-jsx.esm.js.map +1 -0
- package/dist/react.cjs.js +146 -11
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.d.ts +600 -1
- package/dist/react.esm.js +146 -11
- package/dist/react.esm.js.map +1 -1
- package/dist/ui.cjs.js +114 -8
- package/dist/ui.cjs.js.map +1 -1
- package/dist/ui.d.ts +82 -7
- package/dist/ui.esm.js +114 -9
- package/dist/ui.esm.js.map +1 -1
- package/package.json +6 -1
- package/src/audio/AudioManager.ts +6 -1
- package/src/react/applyProps.ts +32 -1
- package/src/react/extendAll.ts +2 -2
- package/src/react/index.ts +6 -0
- package/src/react/jsx-runtime.ts +346 -0
- package/src/react/reconciler.ts +1 -1
- package/src/ui/FlexContainer.ts +44 -11
- package/src/ui/LabelValue.ts +122 -0
- package/src/ui/index.ts +2 -0
- package/src/react/jsx.d.ts +0 -261
package/src/react/jsx.d.ts
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JSX IntrinsicElements type declarations for the PixiJS React reconciler.
|
|
3
|
-
*
|
|
4
|
-
* Provides TypeScript autocompletion and type safety for:
|
|
5
|
-
* - Standard PixiJS elements: <container>, <sprite>, <text>, <graphics>
|
|
6
|
-
* - Engine UI components: <button>, <label>, <panel>, <flexContainer>, etc.
|
|
7
|
-
*
|
|
8
|
-
* Dash-notation is supported for nested config objects:
|
|
9
|
-
* <button colors-default={0xff0000} colors-hover={0x00ff00} />
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import type { Container, Texture, TextStyle } from 'pixi.js';
|
|
13
|
-
import type { ViewInput } from '../ui/view';
|
|
14
|
-
import type { ButtonConfig, ButtonState } from '../ui/Button';
|
|
15
|
-
import type { LabelConfig } from '../ui/Label';
|
|
16
|
-
import type { PanelConfig } from '../ui/Panel';
|
|
17
|
-
import type { FlexContainerConfig, FlexItemConfig, AlignSelf, AlignContent } from '../ui/FlexContainer';
|
|
18
|
-
import type { ProgressBarConfig } from '../ui/ProgressBar';
|
|
19
|
-
import type { ScrollContainerConfig } from '../ui/ScrollContainer';
|
|
20
|
-
import type { ModalConfig } from '../ui/Modal';
|
|
21
|
-
import type { ToastConfig } from '../ui/Toast';
|
|
22
|
-
import type { BalanceDisplayConfig } from '../ui/BalanceDisplay';
|
|
23
|
-
import type { WinDisplayConfig } from '../ui/WinDisplay';
|
|
24
|
-
import type { LayoutConfig } from '../ui/Layout';
|
|
25
|
-
import type { SliderConfig } from '../ui/Slider';
|
|
26
|
-
import type { ToggleConfig } from '../ui/Toggle';
|
|
27
|
-
|
|
28
|
-
// ─── Event props ─────────────────────────────────────────
|
|
29
|
-
|
|
30
|
-
interface PixiEventProps {
|
|
31
|
-
onClick?: (e: any) => void;
|
|
32
|
-
onPointerDown?: (e: any) => void;
|
|
33
|
-
onPointerUp?: (e: any) => void;
|
|
34
|
-
onPointerMove?: (e: any) => void;
|
|
35
|
-
onPointerOver?: (e: any) => void;
|
|
36
|
-
onPointerOut?: (e: any) => void;
|
|
37
|
-
onPointerEnter?: (e: any) => void;
|
|
38
|
-
onPointerLeave?: (e: any) => void;
|
|
39
|
-
onPointerCancel?: (e: any) => void;
|
|
40
|
-
onPointerTap?: (e: any) => void;
|
|
41
|
-
onPointerUpOutside?: (e: any) => void;
|
|
42
|
-
onMouseDown?: (e: any) => void;
|
|
43
|
-
onMouseUp?: (e: any) => void;
|
|
44
|
-
onMouseMove?: (e: any) => void;
|
|
45
|
-
onMouseOver?: (e: any) => void;
|
|
46
|
-
onMouseOut?: (e: any) => void;
|
|
47
|
-
onWheel?: (e: any) => void;
|
|
48
|
-
onTap?: (e: any) => void;
|
|
49
|
-
onRightClick?: (e: any) => void;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// ─── Base container props (shared by all elements) ───────
|
|
53
|
-
|
|
54
|
-
interface BaseProps extends PixiEventProps {
|
|
55
|
-
key?: React.Key;
|
|
56
|
-
ref?: React.Ref<any>;
|
|
57
|
-
children?: React.ReactNode;
|
|
58
|
-
|
|
59
|
-
// Container props
|
|
60
|
-
x?: number;
|
|
61
|
-
y?: number;
|
|
62
|
-
width?: number;
|
|
63
|
-
height?: number;
|
|
64
|
-
alpha?: number;
|
|
65
|
-
visible?: boolean;
|
|
66
|
-
rotation?: number;
|
|
67
|
-
angle?: number;
|
|
68
|
-
zIndex?: number;
|
|
69
|
-
label?: string;
|
|
70
|
-
cursor?: string;
|
|
71
|
-
eventMode?: 'auto' | 'none' | 'passive' | 'static' | 'dynamic';
|
|
72
|
-
|
|
73
|
-
// Nested via dash-notation
|
|
74
|
-
'scale-x'?: number;
|
|
75
|
-
'scale-y'?: number;
|
|
76
|
-
'pivot-x'?: number;
|
|
77
|
-
'pivot-y'?: number;
|
|
78
|
-
'position-x'?: number;
|
|
79
|
-
'position-y'?: number;
|
|
80
|
-
'anchor-x'?: number;
|
|
81
|
-
'anchor-y'?: number;
|
|
82
|
-
|
|
83
|
-
// Allow scale as number (uniform)
|
|
84
|
-
scale?: number | { x: number; y: number };
|
|
85
|
-
|
|
86
|
-
// Flex item props (used when child of <flexContainer>)
|
|
87
|
-
flexGrow?: number;
|
|
88
|
-
flexShrink?: number;
|
|
89
|
-
layoutWidth?: number | string;
|
|
90
|
-
layoutHeight?: number | string;
|
|
91
|
-
alignSelf?: AlignSelf;
|
|
92
|
-
flexExclude?: boolean;
|
|
93
|
-
// Absolute positioning for flexExclude children
|
|
94
|
-
top?: number;
|
|
95
|
-
right?: number;
|
|
96
|
-
bottom?: number;
|
|
97
|
-
left?: number;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// ─── PixiJS primitive elements ───────────────────────────
|
|
101
|
-
|
|
102
|
-
interface SpriteProps extends BaseProps {
|
|
103
|
-
texture?: string | Texture;
|
|
104
|
-
anchor?: number | { x: number; y: number };
|
|
105
|
-
tint?: number;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
interface TextProps extends BaseProps {
|
|
109
|
-
text?: string;
|
|
110
|
-
style?: Partial<TextStyle>;
|
|
111
|
-
anchor?: number | { x: number; y: number };
|
|
112
|
-
// Dash-notation for style
|
|
113
|
-
'style-fontSize'?: number;
|
|
114
|
-
'style-fill'?: number | string;
|
|
115
|
-
'style-fontFamily'?: string;
|
|
116
|
-
'style-fontWeight'?: string;
|
|
117
|
-
'style-letterSpacing'?: number;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
interface GraphicsProps extends BaseProps {
|
|
121
|
-
/** Draw function: receives the Graphics instance, called on mount and updates */
|
|
122
|
-
draw?: (g: any) => void;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// ─── Engine UI component props ───────────────────────────
|
|
126
|
-
|
|
127
|
-
interface ButtonComponentProps extends BaseProps, Omit<ButtonConfig, 'colors' | 'textStyle'> {
|
|
128
|
-
// Full object form
|
|
129
|
-
colors?: Partial<Record<ButtonState, number>>;
|
|
130
|
-
textStyle?: Record<string, unknown>;
|
|
131
|
-
// Custom views (ViewInput: string texture name, Texture, or Container)
|
|
132
|
-
defaultView?: ViewInput;
|
|
133
|
-
hoverView?: ViewInput;
|
|
134
|
-
pressedView?: ViewInput;
|
|
135
|
-
disabledView?: ViewInput;
|
|
136
|
-
// Dash-notation for nested objects
|
|
137
|
-
'colors-default'?: number;
|
|
138
|
-
'colors-hover'?: number;
|
|
139
|
-
'colors-pressed'?: number;
|
|
140
|
-
'colors-disabled'?: number;
|
|
141
|
-
'textStyle-fontSize'?: number;
|
|
142
|
-
'textStyle-fill'?: number | string;
|
|
143
|
-
'textStyle-fontFamily'?: string;
|
|
144
|
-
'textStyle-fontWeight'?: string;
|
|
145
|
-
'textStyle-fontStyle'?: string;
|
|
146
|
-
'textStyle-letterSpacing'?: number;
|
|
147
|
-
// Component callbacks
|
|
148
|
-
onPress?: () => void;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
interface LabelComponentProps extends BaseProps, Omit<LabelConfig, 'style'> {
|
|
152
|
-
style?: Partial<TextStyle>;
|
|
153
|
-
'style-fontSize'?: number;
|
|
154
|
-
'style-fill'?: number | string;
|
|
155
|
-
'style-fontFamily'?: string;
|
|
156
|
-
'style-fontWeight'?: string;
|
|
157
|
-
'style-letterSpacing'?: number;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
interface PanelComponentProps extends BaseProps, Omit<PanelConfig, 'layout'> {
|
|
161
|
-
layout?: Partial<FlexContainerConfig>;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
interface FlexContainerComponentProps extends BaseProps, FlexContainerConfig {
|
|
165
|
-
padding?: number | [number, number, number, number];
|
|
166
|
-
paddingTop?: number;
|
|
167
|
-
paddingRight?: number;
|
|
168
|
-
paddingBottom?: number;
|
|
169
|
-
paddingLeft?: number;
|
|
170
|
-
alignContent?: AlignContent;
|
|
171
|
-
width?: number | string;
|
|
172
|
-
height?: number | string;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
interface ProgressBarComponentProps extends BaseProps, ProgressBarConfig {
|
|
176
|
-
progress?: number;
|
|
177
|
-
/** Custom track background (string texture name, Texture, or Container) */
|
|
178
|
-
trackView?: ViewInput;
|
|
179
|
-
/** Custom fill bar */
|
|
180
|
-
fillView?: ViewInput;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
interface ScrollContainerComponentProps extends BaseProps, Omit<ScrollContainerConfig, 'width' | 'height'> {
|
|
184
|
-
width: number;
|
|
185
|
-
height: number;
|
|
186
|
-
/** Show scrollbar indicator */
|
|
187
|
-
scrollbar?: boolean;
|
|
188
|
-
/** Custom scrollbar thumb view */
|
|
189
|
-
thumbView?: ViewInput;
|
|
190
|
-
scrollbarWidth?: number;
|
|
191
|
-
scrollbarPadding?: number;
|
|
192
|
-
scrollbarColor?: number;
|
|
193
|
-
scrollbarAlpha?: number;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
interface ModalComponentProps extends BaseProps, ModalConfig {
|
|
197
|
-
onClose?: () => void;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
interface ToastComponentProps extends BaseProps, ToastConfig {
|
|
201
|
-
/** Custom background view */
|
|
202
|
-
backgroundView?: ViewInput;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
interface BalanceDisplayComponentProps extends BaseProps, BalanceDisplayConfig {
|
|
206
|
-
/** Current balance value */
|
|
207
|
-
value?: number;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
interface WinDisplayComponentProps extends BaseProps, WinDisplayConfig {}
|
|
211
|
-
|
|
212
|
-
interface LayoutComponentProps extends BaseProps, LayoutConfig {}
|
|
213
|
-
|
|
214
|
-
interface SliderComponentProps extends BaseProps, Omit<SliderConfig, 'width' | 'height'> {
|
|
215
|
-
width?: number;
|
|
216
|
-
height?: number;
|
|
217
|
-
onUpdate?: (value: number) => void;
|
|
218
|
-
onChange?: (value: number) => void;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
interface ToggleComponentProps extends BaseProps, Omit<ToggleConfig, 'width' | 'height'> {
|
|
222
|
-
width?: number;
|
|
223
|
-
height?: number;
|
|
224
|
-
onView?: ViewInput;
|
|
225
|
-
offView?: ViewInput;
|
|
226
|
-
onChange?: (value: boolean) => void;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// ─── JSX IntrinsicElements ───────────────────────────────
|
|
230
|
-
|
|
231
|
-
declare global {
|
|
232
|
-
namespace JSX {
|
|
233
|
-
interface IntrinsicElements {
|
|
234
|
-
// PixiJS primitives
|
|
235
|
-
container: BaseProps;
|
|
236
|
-
sprite: SpriteProps;
|
|
237
|
-
text: TextProps;
|
|
238
|
-
graphics: GraphicsProps;
|
|
239
|
-
animatedSprite: BaseProps & { textures?: Texture[]; animationSpeed?: number; loop?: boolean; playing?: boolean };
|
|
240
|
-
nineSliceSprite: BaseProps & { texture?: string | Texture; leftWidth?: number; topHeight?: number; rightWidth?: number; bottomHeight?: number };
|
|
241
|
-
tilingSprite: BaseProps & { texture?: string | Texture; tilePosition?: { x: number; y: number } };
|
|
242
|
-
|
|
243
|
-
// Engine UI components
|
|
244
|
-
button: ButtonComponentProps;
|
|
245
|
-
label: LabelComponentProps;
|
|
246
|
-
panel: PanelComponentProps;
|
|
247
|
-
flexContainer: FlexContainerComponentProps;
|
|
248
|
-
progressBar: ProgressBarComponentProps;
|
|
249
|
-
scrollContainer: ScrollContainerComponentProps;
|
|
250
|
-
modal: ModalComponentProps;
|
|
251
|
-
toast: ToastComponentProps;
|
|
252
|
-
balanceDisplay: BalanceDisplayComponentProps;
|
|
253
|
-
winDisplay: WinDisplayComponentProps;
|
|
254
|
-
layout: LayoutComponentProps;
|
|
255
|
-
slider: SliderComponentProps;
|
|
256
|
-
toggle: ToggleComponentProps;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export {};
|