@simpludify/web 0.1.4 → 0.1.6

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.
@@ -0,0 +1,33 @@
1
+ import { InputCapture, type InputCaptureOptions, type InputSystem, type Scene } from "@simpludify/core";
2
+ import type { GamepadState } from "./gamepads.js";
3
+ /** @internal One Game-owned observer; existing adapters retain gameplay ownership. */
4
+ export declare class InputCaptureManager {
5
+ private readonly host;
6
+ private readonly input;
7
+ private readonly scene;
8
+ private readonly releasePointers;
9
+ private readonly report;
10
+ private readonly abort;
11
+ private current;
12
+ private readonly keys;
13
+ private readonly blockedKeys;
14
+ private readonly blockedPointers;
15
+ private readonly blockedAuxiliary;
16
+ private mouseButtons;
17
+ private needsPadSample;
18
+ private pads;
19
+ private readonly readyPads;
20
+ private dead;
21
+ constructor(host: HTMLElement, input: InputSystem, scene: () => Scene, releasePointers: () => void, report: (error: unknown) => void);
22
+ start(options?: InputCaptureOptions): InputCapture;
23
+ private arm;
24
+ private keyDown;
25
+ private surface;
26
+ private pointer;
27
+ /** Same validated gamepad poll as gameplay; no navigator polling in this manager. */
28
+ sample(pads: ReadonlyMap<number, GamepadState>): void;
29
+ private consume;
30
+ private guard;
31
+ private interrupt;
32
+ dispose(): void;
33
+ }
package/dist/pointer.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PointerInfo } from "@simpludify/core";
1
+ import type { InputSystem, PointerInfo } from "@simpludify/core";
2
2
  import { PointerRouting, type ViewTransform, type WorldPoint } from "@simpludify/core";
3
3
  /** One DOM capture-phase adapter per Game; Pixi federated events never route these widgets. */
4
4
  export declare class BrowserPointer {
@@ -6,8 +6,14 @@ export declare class BrowserPointer {
6
6
  private readonly project;
7
7
  private readonly report;
8
8
  private readonly flush;
9
+ private readonly input?;
9
10
  readonly routing: PointerRouting;
10
11
  private readonly abort;
12
+ private readonly mouse;
13
+ private readonly mouseStates;
14
+ private readonly blockedMouse;
15
+ private readonly auxiliary;
16
+ private readonly offInput;
11
17
  constructor(host: HTMLElement, project: (event: {
12
18
  clientX: number;
13
19
  clientY: number;
@@ -15,7 +21,11 @@ export declare class BrowserPointer {
15
21
  screen: PointerInfo["screen"];
16
22
  world: WorldPoint;
17
23
  view: ViewTransform;
18
- }, report: (error: unknown) => void, flush: () => void);
24
+ }, report: (error: unknown) => void, flush: () => void, input?: InputSystem | undefined);
25
+ private applyMouse;
26
+ private releaseMouse;
27
+ private updateMouse;
28
+ private resetMouse;
19
29
  private surface;
20
30
  private data;
21
31
  private guard;
@@ -1,6 +1,7 @@
1
- import type { CanvasUI, PointerRouting } from "@simpludify/core";
1
+ import type { CanvasUI, PointerRouting, VirtualInput } from "@simpludify/core";
2
2
  import { type PreparedScene, type RendererPort, type Scene } from "@simpludify/core";
3
3
  import { type CanvasPresentation } from "./canvas-visual.js";
4
+ import { type VirtualInputPresentation } from "./virtual-input-visual.js";
4
5
  export declare class PixiRenderer implements RendererPort {
5
6
  private readonly host;
6
7
  private readonly background;
@@ -8,6 +9,13 @@ export declare class PixiRenderer implements RendererPort {
8
9
  private readonly app;
9
10
  private readonly pendingUITextKeys;
10
11
  private readonly canvasPresentations;
12
+ private readonly virtualPresentations;
13
+ get virtualInputDiagnostics(): {
14
+ presentations: number;
15
+ controls: number;
16
+ visible: number;
17
+ };
18
+ prepareVirtualInput(input: VirtualInput): VirtualInputPresentation;
11
19
  get canvasDiagnostics(): {
12
20
  presentations: number;
13
21
  nodes: number;
@@ -0,0 +1,22 @@
1
+ import { type VirtualInput } from "@simpludify/core";
2
+ import { Container, Graphics } from "pixi.js";
3
+ export interface VirtualInputPresentation {
4
+ update(): void;
5
+ dispose(): void;
6
+ }
7
+ /** Screen-space presentation only. The existing BrowserPointer is the sole event adapter. */
8
+ export declare class VirtualInputVisual implements VirtualInputPresentation {
9
+ private readonly input;
10
+ private readonly release;
11
+ readonly display: Container<import("pixi.js").ContainerChild>;
12
+ private readonly entries;
13
+ private dead;
14
+ private readonly off;
15
+ constructor(input: VirtualInput, release: (graphics: Graphics) => void);
16
+ get diagnostics(): {
17
+ controls: number;
18
+ visible: number;
19
+ };
20
+ update(): void;
21
+ dispose(): void;
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpludify/web",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -14,7 +14,7 @@
14
14
  "./package.json": "./package.json"
15
15
  },
16
16
  "dependencies": {
17
- "@simpludify/core": "0.1.4",
17
+ "@simpludify/core": "0.1.6",
18
18
  "pixi.js": "8.22.0"
19
19
  },
20
20
  "description": "Browser host, PixiJS rendering and input for the experimental Simpludify 2D engine.",