@holtjs/stage 0.3.0 → 0.4.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/CHANGELOG.md +20 -0
- package/dist/{game-NqFMKsuL.d.ts → game-C6NrnZ7-.d.ts} +603 -9
- package/dist/{game-BHDcwovp.js → game-CbmA4myj.js} +601 -1427
- package/dist/headless.d.ts +10 -3
- package/dist/headless.js +45 -16
- package/dist/index.d.ts +11 -4
- package/dist/index.js +7 -3
- package/dist/joystick.d.ts +1 -1
- package/dist/joystick.js +1 -1
- package/dist/kernel.d.ts +2 -0
- package/dist/kernel.js +639 -0
- package/dist/renderer-webgpu-Bvvi5jN8.js +2618 -0
- package/dist/renderer-webgpu.d.ts +2 -0
- package/dist/renderer-webgpu.js +1 -0
- package/dist/trace.d.ts +2 -143
- package/dist/trace.js +3 -2
- package/dist/{tween-D3Ztppuz.d.ts → tween-BiF1FUvc.d.ts} +2 -0
- package/dist/tween.d.ts +1 -1
- package/dist/tween.js +4 -0
- package/dist/{types-ChGhuDNX.js → types-DRFB0Klc.js} +5 -2
- package/package.json +11 -2
- package/skills/stage/SKILL.md +11 -21
- package/skills/stage/references/subpaths.md +17 -9
package/dist/headless.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { f as SceneInput, n as EngineClockSnapshot, r as Game, u as Scene } from "./game-
|
|
2
|
-
import { SceneDigest, SceneDigestOptions } from "./trace.js";
|
|
1
|
+
import { I as SceneDigestOptions, M as SceneDigest, T as StagePlugin, f as SceneInput, n as EngineClockSnapshot, r as Game, u as Scene } from "./game-C6NrnZ7-.js";
|
|
3
2
|
/** Minimal Canvas2D surface compatible with `@napi-rs/canvas`, `node-canvas`, and browser `<canvas>`. */
|
|
4
3
|
export interface HeadlessCanvasLike {
|
|
5
4
|
width: number;
|
|
@@ -27,6 +26,8 @@ export interface HeadlessStageOptions {
|
|
|
27
26
|
readonly pixelArt?: boolean;
|
|
28
27
|
/** Optional custom WebGL/WebGL2 context when testing GPU shaders headlessly; defaults to `CANVAS` (`Renderer2D`). */
|
|
29
28
|
readonly glContext?: WebGL2RenderingContext | WebGLRenderingContext | null;
|
|
29
|
+
/** Optional `StagePlugin[]` (e.g. `createInputTimeline`, `createInputRecorder`) mounted at boot. */
|
|
30
|
+
readonly plugins?: StagePlugin[];
|
|
30
31
|
/** Scene instance or constructor to boot synchronously at frame 0. */
|
|
31
32
|
readonly scene: SceneInput;
|
|
32
33
|
}
|
|
@@ -62,8 +63,10 @@ export interface HeadlessStage {
|
|
|
62
63
|
readonly height: number;
|
|
63
64
|
readonly fps: number;
|
|
64
65
|
readonly frameDurationMs: number;
|
|
65
|
-
/** Advance `frames` deterministic ticks (`dt = 1000 / fps`), rendering
|
|
66
|
+
/** Advance `frames` deterministic ticks (`dt = 1000 / fps`), rendering each frame. */
|
|
66
67
|
step(frames?: number): EngineClockSnapshot;
|
|
68
|
+
/** Fast-forward `frames` simulation ticks (`clock`, `tweens`, `kernel`, `scene.update`) WITHOUT rasterizing intermediate pixels! */
|
|
69
|
+
fastForward(frames?: number): EngineClockSnapshot;
|
|
67
70
|
/** Advance deterministically until `clock.simTimeMs >= targetSimTimeMs`. */
|
|
68
71
|
stepToMs(targetSimTimeMs: number): EngineClockSnapshot;
|
|
69
72
|
/** Advance deterministically until `clock.frameSeq >= targetFrameSeq`. */
|
|
@@ -74,6 +77,10 @@ export interface HeadlessStage {
|
|
|
74
77
|
pointerMove(x: number, y: number): void;
|
|
75
78
|
/** Synthesize a deterministic pointer-up event in canvas coordinates. */
|
|
76
79
|
pointerUp(x: number, y: number, button?: number): void;
|
|
80
|
+
/** Synthesize a deterministic key-down event (`code` such as `'KeyW'`, `'Space'`, `'ArrowRight'`). */
|
|
81
|
+
keyDown(code: string, key?: string): void;
|
|
82
|
+
/** Synthesize a deterministic key-up event. */
|
|
83
|
+
keyUp(code: string, key?: string): void;
|
|
77
84
|
/** Read raw W3C RGBA8888 pixels (`width * height * 4` bytes). */
|
|
78
85
|
toRgba(): Uint8Array;
|
|
79
86
|
/** Encode current frame to PNG bytes (requires `canvas.toBuffer('image/png')` such as `@napi-rs/canvas`). */
|
package/dist/headless.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import { n as Game } from "./game-
|
|
1
|
+
import "./types-DRFB0Klc.js";
|
|
2
|
+
import { n as Game } from "./game-CbmA4myj.js";
|
|
3
3
|
import { buildSceneDigest } from "./trace.js";
|
|
4
4
|
// src/headless.ts
|
|
5
5
|
function createVirtualDomHost(createCanvas, width, height) {
|
|
@@ -83,23 +83,14 @@ function createHeadlessStage(options) {
|
|
|
83
83
|
transparent: options.transparent ?? false,
|
|
84
84
|
pixelArt: options.pixelArt ?? false,
|
|
85
85
|
autoStart: false,
|
|
86
|
-
input: { keyboard:
|
|
86
|
+
input: { keyboard: true },
|
|
87
|
+
plugins: options.plugins,
|
|
87
88
|
scene: options.scene
|
|
88
89
|
});
|
|
89
90
|
const primaryScene = game.scene.scenes[0];
|
|
90
91
|
if (!primaryScene) throw new Error("createHeadlessStage: scene failed to initialize");
|
|
91
92
|
let simCursorMs = 0;
|
|
92
93
|
game.renderer.render(primaryScene._displayList, primaryScene.cameras.main);
|
|
93
|
-
const emitPointer = (eventName, x, y, isDown, button = 0) => {
|
|
94
|
-
const p = game.input.activePointer;
|
|
95
|
-
p.x = x;
|
|
96
|
-
p.y = y;
|
|
97
|
-
p.isDown = isDown;
|
|
98
|
-
p.button = button;
|
|
99
|
-
p.buttons = isDown ? 1 : 0;
|
|
100
|
-
p.updateWorldPoint(primaryScene.cameras.main);
|
|
101
|
-
game.input.emit(eventName, p);
|
|
102
|
-
};
|
|
103
94
|
const step = (frames = 1) => {
|
|
104
95
|
const count = Math.max(0, Math.floor(frames));
|
|
105
96
|
for (let i = 0; i < count; i++) {
|
|
@@ -108,6 +99,14 @@ function createHeadlessStage(options) {
|
|
|
108
99
|
}
|
|
109
100
|
return game.clock.snapshot();
|
|
110
101
|
};
|
|
102
|
+
const fastForward = (frames = 1) => {
|
|
103
|
+
const count = Math.max(0, Math.floor(frames));
|
|
104
|
+
for (let i = 0; i < count; i++) {
|
|
105
|
+
simCursorMs += dt;
|
|
106
|
+
game.stepSimOnly(simCursorMs, dt);
|
|
107
|
+
}
|
|
108
|
+
return game.clock.snapshot();
|
|
109
|
+
};
|
|
111
110
|
const stepToMs = (targetSimTimeMs) => {
|
|
112
111
|
while (simCursorMs + dt * .5 <= targetSimTimeMs) {
|
|
113
112
|
simCursorMs += dt;
|
|
@@ -171,11 +170,41 @@ function createHeadlessStage(options) {
|
|
|
171
170
|
fps,
|
|
172
171
|
frameDurationMs: dt,
|
|
173
172
|
step,
|
|
173
|
+
fastForward,
|
|
174
174
|
stepToMs,
|
|
175
175
|
stepToFrame,
|
|
176
|
-
pointerDown: (x, y, button = 0) =>
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
pointerDown: (x, y, button = 0) => game.kernel.dispatchInput({
|
|
177
|
+
kind: "pointerdown",
|
|
178
|
+
x,
|
|
179
|
+
y,
|
|
180
|
+
button,
|
|
181
|
+
source: "headless"
|
|
182
|
+
}),
|
|
183
|
+
pointerMove: (x, y) => game.kernel.dispatchInput({
|
|
184
|
+
kind: "pointermove",
|
|
185
|
+
x,
|
|
186
|
+
y,
|
|
187
|
+
source: "headless"
|
|
188
|
+
}),
|
|
189
|
+
pointerUp: (x, y, button = 0) => game.kernel.dispatchInput({
|
|
190
|
+
kind: "pointerup",
|
|
191
|
+
x,
|
|
192
|
+
y,
|
|
193
|
+
button,
|
|
194
|
+
source: "headless"
|
|
195
|
+
}),
|
|
196
|
+
keyDown: (code, key) => game.kernel.dispatchInput({
|
|
197
|
+
kind: "keydown",
|
|
198
|
+
code,
|
|
199
|
+
key,
|
|
200
|
+
source: "headless"
|
|
201
|
+
}),
|
|
202
|
+
keyUp: (code, key) => game.kernel.dispatchInput({
|
|
203
|
+
kind: "keyup",
|
|
204
|
+
code,
|
|
205
|
+
key,
|
|
206
|
+
source: "headless"
|
|
207
|
+
}),
|
|
179
208
|
toRgba,
|
|
180
209
|
toPng,
|
|
181
210
|
digest,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { SceneDigest, SceneDigestActiveFocus, SceneDigestEngineSandbox, SceneDigestNode, SceneDigestOptions, SceneDigestOverlayStats, SceneDigestSandbox, SceneDigestSurfaceEntry, SceneDigestSurfaceSource, SceneDigestSurfaces, buildSceneDigest, sanitizeTrackToken } from "./trace.js";
|
|
1
|
+
import { $ as WebGpuCanvasContextLike, $t as FilterMode, A as createInputReplay, At as RectangleObject, B as SceneDigestSurfaceSource, Bt as GlTextureHost, C as StageInputEvent, Ct as MsdfIconConfig, D as TimelineDragOptions, Dt as PanelOpenSide, E as TimelineClickOptions, Et as PanelObject, F as SceneDigestNode, Ft as Camera, G as InputPlugin, Gt as TextureManager, H as buildSceneDigest, Ht as Texture, I as SceneDigestOptions, It as CameraFollowOptions, J as PointerSample, Jt as BLACK_RGB, K as KeyboardPlugin, Kt as TextureSource, L as SceneDigestOverlayStats, Lt as HiDpiScaleLike, M as SceneDigest, Mt as TextObject, N as SceneDigestActiveFocus, Nt as TextStyleConfig, O as TimelineKeyOptions, Ot as PanelStyleConfig, P as SceneDigestEngineSandbox, Pt as TileSpriteObject, Q as WebGpuBootstrapResult, Qt as EventEmitter, R as SceneDigestSandbox, Rt as CanvasTexture, S as RecordedInputEntry, St as InstancedColumns, T as StagePlugin, Tt as NineSliceObject, U as sanitizeTrackToken, Ut as TextureImageOptions, V as SceneDigestSurfaces, Vt as SpriteSheetConfig, W as InputConfig, Wt as TextureImageSource, X as RendererWebGpuOptions, Xt as BlendModes, Y as RendererWebGpu, Yt as BlendMode, Z as RequestWebGpuOptions, Zt as CANVAS, _ as InputProvider, _t as DisplayObjectType, a as GameLoop, an as Scale, at as RendererStats, b as InputTimelineOptions, bt as ImageObject, c as LoaderPlugin, cn as TintModes, ct as BlitterObject, d as SceneCtor, dn as WHITE_RGB, dt as ContainerFiltersShim, en as FilterModeValue, et as WebGpuDeviceLike, f as SceneInput, fn as WorldView2D, ft as CustomPassCallback, g as ActionMap, gn as rgbToCss, gt as DisplayObject, h as StageRenderer, hn as parseColor, ht as DisplayList, i as GameConfig$1, in as RgbaColor, it as RendererGlOptions, j as createInputTimeline, jt as SceneHostLike, k as createInputRecorder, kt as RectClipMask, l as ScaleManager, ln as WEBGL, lt as Bob$1, m as SceneManager, mn as packColorAbgr, mt as CustomPassOptions, n as EngineClockSnapshot, nn as Matrix2D, nt as Renderer2D, o as GameObjectFactory, on as Scenes, ot as Stage2DCustomImageHandler, p as SceneLifecycleStats, pn as createMatrix2D, pt as CustomPassObject, q as Pointer, qt as AUTO, r as Game, rn as Rect2D, rt as RendererGl, s as JsonCache, sn as TintMode, st as StageRenderTarget, t as EngineClock, tn as HEX_MASK, tt as requestWebGpuDevice, u as Scene, un as WEBGPU, ut as Container, v as InputRecorderPlugin, vt as DisplaySemantics, w as StageKernel, wt as MsdfIconObject, x as InputTimelinePlugin, xt as InstancedBatchObject, y as InputTargetSpec, yt as Graphics, z as SceneDigestSurfaceEntry, zt as Frame } from "./game-C6NrnZ7-.js";
|
|
3
2
|
import { FlexAlign, FlexContainerSpec, FlexDir, FlexItemRect, FlexItemSpec, FlexJustify, FlexPadding, FlexResult, WrapContainerSpec, WrapItemRect, WrapItemSpec, WrapJustify, WrapResult, computeFlexLayout, computeWrapLayout, resolvePadding } from "./flex.js";
|
|
4
|
-
import { a as SpringHandle, c as TweenManager, i as Easings, l as TweenOptions, n as EasingFn, o as SpringOptions, r as EasingName, s as TweenHandle, t as DisposableOwner, u as TweenStats } from "./tween-
|
|
3
|
+
import { a as SpringHandle, c as TweenManager, i as Easings, l as TweenOptions, n as EasingFn, o as SpringOptions, r as EasingName, s as TweenHandle, t as DisposableOwner, u as TweenStats } from "./tween-BiF1FUvc.js";
|
|
5
4
|
import { JoystickDpad, JoystickDpadOptions, JoystickState, JoystickVector, JoystickViewport, JoystickZone, JoystickZonePredicate, JoystickZoneRect, VirtualJoystick, VirtualJoystickMode, VirtualJoystickOptions, VirtualJoystickStyle, clampJoystickOrigin, computeJoystickVector, isInJoystickZone, pullJoystickOrigin, quantizeJoystickDpad } from "./joystick.js";
|
|
6
5
|
import { SURFACE_BAND, SurfaceBand, SurfaceBandName, SurfaceBarrier, SurfaceCancelContext, SurfaceCancelDispatchResult, SurfaceCancelResult, SurfaceDomEntry, SurfaceFocusContext, SurfaceFocusDispatchResult, SurfaceFocusResult, SurfaceKeyContext, SurfaceKeyDispatchResult, SurfaceKeyResult, SurfaceNodeInfo, SurfaceNodeInput, SurfaceScope, SurfaceTree, computeSurfaceDomZ, createSurfaceTree, resolveSurfacePriority, surfacePriorityToDomZ } from "./surfaces.js";
|
|
7
6
|
export declare class SdfPanelBatcher {
|
|
@@ -136,9 +135,12 @@ export declare const Stage2D: {
|
|
|
136
135
|
readonly AUTO: 0;
|
|
137
136
|
readonly CANVAS: 1;
|
|
138
137
|
readonly WEBGL: 2;
|
|
138
|
+
readonly WEBGPU: 3;
|
|
139
139
|
readonly BlendModes: {
|
|
140
140
|
readonly NORMAL: 0;
|
|
141
141
|
readonly ADD: 1;
|
|
142
|
+
readonly MULTIPLY: 2;
|
|
143
|
+
readonly SCREEN: 3;
|
|
142
144
|
};
|
|
143
145
|
readonly TintModes: {
|
|
144
146
|
readonly MULTIPLY: 0;
|
|
@@ -187,6 +189,7 @@ export declare const Stage2D: {
|
|
|
187
189
|
readonly Text: typeof TextObject;
|
|
188
190
|
readonly Graphics: typeof Graphics;
|
|
189
191
|
readonly Blitter: typeof BlitterObject;
|
|
192
|
+
readonly InstancedBatch: typeof InstancedBatchObject;
|
|
190
193
|
readonly Container: typeof Container;
|
|
191
194
|
readonly CustomPass: typeof CustomPassObject;
|
|
192
195
|
};
|
|
@@ -239,9 +242,12 @@ export declare const Stage: {
|
|
|
239
242
|
readonly AUTO: 0;
|
|
240
243
|
readonly CANVAS: 1;
|
|
241
244
|
readonly WEBGL: 2;
|
|
245
|
+
readonly WEBGPU: 3;
|
|
242
246
|
readonly BlendModes: {
|
|
243
247
|
readonly NORMAL: 0;
|
|
244
248
|
readonly ADD: 1;
|
|
249
|
+
readonly MULTIPLY: 2;
|
|
250
|
+
readonly SCREEN: 3;
|
|
245
251
|
};
|
|
246
252
|
readonly TintModes: {
|
|
247
253
|
readonly MULTIPLY: 0;
|
|
@@ -290,6 +296,7 @@ export declare const Stage: {
|
|
|
290
296
|
readonly Text: typeof TextObject;
|
|
291
297
|
readonly Graphics: typeof Graphics;
|
|
292
298
|
readonly Blitter: typeof BlitterObject;
|
|
299
|
+
readonly InstancedBatch: typeof InstancedBatchObject;
|
|
293
300
|
readonly Container: typeof Container;
|
|
294
301
|
readonly CustomPass: typeof CustomPassObject;
|
|
295
302
|
};
|
|
@@ -304,4 +311,4 @@ export declare const Stage: {
|
|
|
304
311
|
};
|
|
305
312
|
};
|
|
306
313
|
};
|
|
307
|
-
export { AUTO, BLACK_RGB, type BlendMode, BlendModes, BlitterObject, type Bob$1 as Bob, CANVAS, Camera, CanvasTexture, Container, type ContainerFiltersShim, type CustomPassCallback, CustomPassObject, DisplayList, DisplayObject, type DisplayObjectType, type DisplaySemantics, type DisposableOwner, type EasingFn, type EasingName, Easings, EngineClock, type EngineClockSnapshot, EventEmitter, FilterMode, type FilterModeValue, type FlexAlign, type FlexContainerSpec, type FlexDir, type FlexItemRect, type FlexItemSpec, type FlexJustify, type FlexPadding, type FlexResult, Frame, Game, type GameConfig$1 as GameConfig, GameLoop, GameObjectFactory, type GlTextureHost, Graphics, HEX_MASK, ImageObject, type InputConfig, InputPlugin, type JoystickDpad, type JoystickDpadOptions, type JoystickState, type JoystickVector, type JoystickViewport, type JoystickZone, type JoystickZonePredicate, type JoystickZoneRect, JsonCache, KeyboardPlugin, LoaderPlugin, type Matrix2D, type MsdfIconConfig, MsdfIconObject, NineSliceObject, PanelObject, type PanelOpenSide, type PanelStyleConfig, Pointer, type PointerSample, type Rect2D, type RectClipMask, RectangleObject, Renderer2D, RendererGl, type RendererGlOptions, type RendererStats, type RgbaColor, SURFACE_BAND, Scale, ScaleManager, Scene, type SceneCtor, type SceneDigest, type SceneDigestActiveFocus, type SceneDigestEngineSandbox, type SceneDigestNode, type SceneDigestOptions, type SceneDigestOverlayStats, type SceneDigestSandbox, type SceneDigestSurfaceEntry, type SceneDigestSurfaceSource, type SceneDigestSurfaces, type SceneHostLike, type SceneInput, type SceneLifecycleStats, SceneManager, Scenes, type SpringHandle, type SpringOptions, type SpriteSheetConfig, Stage as default, type Stage2DCustomImageHandler, type StageRenderer, type SurfaceBand, type SurfaceBandName, type SurfaceBarrier, type SurfaceCancelContext, type SurfaceCancelDispatchResult, type SurfaceCancelResult, type SurfaceDomEntry, type SurfaceFocusContext, type SurfaceFocusDispatchResult, type SurfaceFocusResult, type SurfaceKeyContext, type SurfaceKeyDispatchResult, type SurfaceKeyResult, type SurfaceNodeInfo, type SurfaceNodeInput, type SurfaceScope, type SurfaceTree, TextObject, type TextStyleConfig, Texture, type TextureImageOptions, type TextureImageSource, TextureManager, TextureSource, TileSpriteObject, type TintMode, TintModes, type TweenHandle, TweenManager, type TweenOptions, type TweenStats, VirtualJoystick, type VirtualJoystickMode, type VirtualJoystickOptions, type VirtualJoystickStyle, WEBGL, WHITE_RGB, type WorldView2D, type WrapContainerSpec, type WrapItemRect, type WrapItemSpec, type WrapJustify, type WrapResult, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createMatrix2D, createSurfaceTree, isInJoystickZone, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
|
|
314
|
+
export { AUTO, ActionMap, BLACK_RGB, type BlendMode, BlendModes, BlitterObject, type Bob$1 as Bob, CANVAS, Camera, type CameraFollowOptions, CanvasTexture, Container, type ContainerFiltersShim, type CustomPassCallback, CustomPassObject, type CustomPassOptions, DisplayList, DisplayObject, type DisplayObjectType, type DisplaySemantics, type DisposableOwner, type EasingFn, type EasingName, Easings, EngineClock, type EngineClockSnapshot, EventEmitter, FilterMode, type FilterModeValue, type FlexAlign, type FlexContainerSpec, type FlexDir, type FlexItemRect, type FlexItemSpec, type FlexJustify, type FlexPadding, type FlexResult, Frame, Game, type GameConfig$1 as GameConfig, GameLoop, GameObjectFactory, type GlTextureHost, Graphics, HEX_MASK, type HiDpiScaleLike, ImageObject, type InputConfig, InputPlugin, type InputProvider, type InputRecorderPlugin, type InputTargetSpec, type InputTimelineOptions, type InputTimelinePlugin, InstancedBatchObject, type InstancedColumns, type JoystickDpad, type JoystickDpadOptions, type JoystickState, type JoystickVector, type JoystickViewport, type JoystickZone, type JoystickZonePredicate, type JoystickZoneRect, JsonCache, KeyboardPlugin, LoaderPlugin, type Matrix2D, type MsdfIconConfig, MsdfIconObject, NineSliceObject, PanelObject, type PanelOpenSide, type PanelStyleConfig, Pointer, type PointerSample, type RecordedInputEntry, type Rect2D, type RectClipMask, RectangleObject, Renderer2D, RendererGl, type RendererGlOptions, type RendererStats, RendererWebGpu, type RendererWebGpuOptions, type RequestWebGpuOptions, type RgbaColor, SURFACE_BAND, Scale, ScaleManager, Scene, type SceneCtor, type SceneDigest, type SceneDigestActiveFocus, type SceneDigestEngineSandbox, type SceneDigestNode, type SceneDigestOptions, type SceneDigestOverlayStats, type SceneDigestSandbox, type SceneDigestSurfaceEntry, type SceneDigestSurfaceSource, type SceneDigestSurfaces, type SceneHostLike, type SceneInput, type SceneLifecycleStats, SceneManager, Scenes, type SpringHandle, type SpringOptions, type SpriteSheetConfig, Stage as default, type Stage2DCustomImageHandler, type StageInputEvent, StageKernel, type StagePlugin, type StageRenderTarget, type StageRenderer, type SurfaceBand, type SurfaceBandName, type SurfaceBarrier, type SurfaceCancelContext, type SurfaceCancelDispatchResult, type SurfaceCancelResult, type SurfaceDomEntry, type SurfaceFocusContext, type SurfaceFocusDispatchResult, type SurfaceFocusResult, type SurfaceKeyContext, type SurfaceKeyDispatchResult, type SurfaceKeyResult, type SurfaceNodeInfo, type SurfaceNodeInput, type SurfaceScope, type SurfaceTree, TextObject, type TextStyleConfig, Texture, type TextureImageOptions, type TextureImageSource, TextureManager, TextureSource, TileSpriteObject, type TimelineClickOptions, type TimelineDragOptions, type TimelineKeyOptions, type TintMode, TintModes, type TweenHandle, TweenManager, type TweenOptions, type TweenStats, VirtualJoystick, type VirtualJoystickMode, type VirtualJoystickOptions, type VirtualJoystickStyle, WEBGL, WEBGPU, WHITE_RGB, type WebGpuBootstrapResult, type WebGpuCanvasContextLike, type WebGpuDeviceLike, type WorldView2D, type WrapContainerSpec, type WrapItemRect, type WrapItemSpec, type WrapJustify, type WrapResult, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createSurfaceTree, isInJoystickZone, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { a as EventEmitter, c as Scale, d as WEBGL, f as
|
|
2
|
-
import {
|
|
1
|
+
import { _ as rgbToCss, a as EventEmitter, c as Scale, d as WEBGL, f as WEBGPU, g as parseColor, h as packColorAbgr, i as CANVAS, l as Scenes, m as createMatrix2D, n as BLACK_RGB, o as FilterMode, p as WHITE_RGB, r as BlendModes, s as HEX_MASK, t as AUTO, u as TintModes } from "./types-DRFB0Klc.js";
|
|
2
|
+
import { C as TextureSource, S as TextureManager, _ as SdfPanelBatcher, a as JsonCache, b as Frame, c as Scene, d as KeyboardPlugin, f as Pointer, g as MsdfIconBatcher, h as PixelAaBatcher, i as GameObjectFactory, l as SceneManager, m as RendererGl, n as Game, o as LoaderPlugin, p as Renderer2D, r as GameLoop, s as ScaleManager, t as EngineClock, u as InputPlugin, v as Camera, x as Texture, y as CanvasTexture } from "./game-CbmA4myj.js";
|
|
3
|
+
import { a as CustomPassObject, c as Graphics, d as MsdfIconObject, f as NineSliceObject, g as TileSpriteObject, h as TextObject, i as Container, l as ImageObject, m as RectangleObject, n as requestWebGpuDevice, o as DisplayList, p as PanelObject, r as BlitterObject, s as DisplayObject, t as RendererWebGpu, u as InstancedBatchObject } from "./renderer-webgpu-Bvvi5jN8.js";
|
|
4
|
+
import { ActionMap, StageKernel, createInputRecorder, createInputReplay, createInputTimeline } from "./kernel.js";
|
|
3
5
|
import { buildSceneDigest, sanitizeTrackToken } from "./trace.js";
|
|
4
6
|
import { computeFlexLayout, computeWrapLayout, resolvePadding } from "./flex.js";
|
|
5
7
|
import { Easings, TweenManager } from "./tween.js";
|
|
@@ -10,6 +12,7 @@ const Stage2D = {
|
|
|
10
12
|
AUTO: 0,
|
|
11
13
|
CANVAS: 1,
|
|
12
14
|
WEBGL: 2,
|
|
15
|
+
WEBGPU: 3,
|
|
13
16
|
BlendModes,
|
|
14
17
|
TintModes,
|
|
15
18
|
Scale,
|
|
@@ -35,6 +38,7 @@ const Stage2D = {
|
|
|
35
38
|
Text: TextObject,
|
|
36
39
|
Graphics,
|
|
37
40
|
Blitter: BlitterObject,
|
|
41
|
+
InstancedBatch: InstancedBatchObject,
|
|
38
42
|
Container,
|
|
39
43
|
CustomPass: CustomPassObject
|
|
40
44
|
},
|
|
@@ -42,4 +46,4 @@ const Stage2D = {
|
|
|
42
46
|
Display: { Canvas: { CanvasPool: { enableSmoothing() {} } } }
|
|
43
47
|
};
|
|
44
48
|
const Stage = Stage2D;
|
|
45
|
-
export { AUTO, BLACK_RGB, BlendModes, BlitterObject, CANVAS, Camera, CanvasTexture, Container, CustomPassObject, DisplayList, DisplayObject, Easings, EngineClock, EventEmitter, FilterMode, Frame, Game, GameLoop, GameObjectFactory, Graphics, HEX_MASK, ImageObject, InputPlugin, JsonCache, KeyboardPlugin, LoaderPlugin, MsdfIconBatcher, MsdfIconObject, NineSliceObject, PanelObject, PixelAaBatcher, Pointer, RectangleObject, Renderer2D, RendererGl, SURFACE_BAND, Scale, ScaleManager, Scene, SceneManager, Scenes, SdfPanelBatcher, Stage, Stage as default, Stage2D, TextObject, Texture, TextureManager, TextureSource, TileSpriteObject, TintModes, TweenManager, VirtualJoystick, WEBGL, WHITE_RGB, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createMatrix2D, createSurfaceTree, isInJoystickZone, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
|
|
49
|
+
export { AUTO, ActionMap, BLACK_RGB, BlendModes, BlitterObject, CANVAS, Camera, CanvasTexture, Container, CustomPassObject, DisplayList, DisplayObject, Easings, EngineClock, EventEmitter, FilterMode, Frame, Game, GameLoop, GameObjectFactory, Graphics, HEX_MASK, ImageObject, InputPlugin, InstancedBatchObject, JsonCache, KeyboardPlugin, LoaderPlugin, MsdfIconBatcher, MsdfIconObject, NineSliceObject, PanelObject, PixelAaBatcher, Pointer, RectangleObject, Renderer2D, RendererGl, RendererWebGpu, SURFACE_BAND, Scale, ScaleManager, Scene, SceneManager, Scenes, SdfPanelBatcher, Stage, Stage as default, Stage2D, StageKernel, TextObject, Texture, TextureManager, TextureSource, TileSpriteObject, TintModes, TweenManager, VirtualJoystick, WEBGL, WEBGPU, WHITE_RGB, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createSurfaceTree, isInJoystickZone, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
|
package/dist/joystick.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as PanelObject, q as Pointer, u as Scene, ut as Container } from "./game-C6NrnZ7-.js";
|
|
2
2
|
export type VirtualJoystickMode = 'floating' | 'fixed';
|
|
3
3
|
export interface JoystickVector {
|
|
4
4
|
/** Normalized X axis in [-1, 1] after deadzone remapping. */
|
package/dist/joystick.js
CHANGED
package/dist/kernel.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as createInputReplay, C as StageInputEvent, D as TimelineDragOptions, E as TimelineClickOptions, O as TimelineKeyOptions, S as RecordedInputEntry, T as StagePlugin, _ as InputProvider, b as InputTimelineOptions, g as ActionMap, j as createInputTimeline, k as createInputRecorder, v as InputRecorderPlugin, w as StageKernel, x as InputTimelinePlugin, y as InputTargetSpec } from "./game-C6NrnZ7-.js";
|
|
2
|
+
export { ActionMap, InputProvider, InputRecorderPlugin, InputTargetSpec, InputTimelineOptions, InputTimelinePlugin, RecordedInputEntry, StageInputEvent, StageKernel, StagePlugin, TimelineClickOptions, TimelineDragOptions, TimelineKeyOptions, createInputRecorder, createInputReplay, createInputTimeline };
|