@bloopjs/web 0.0.83 → 0.0.85

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloopjs/web",
3
- "version": "0.0.83",
3
+ "version": "0.0.85",
4
4
  "author": "Neil Sarkar",
5
5
  "type": "module",
6
6
  "repository": {
@@ -33,8 +33,8 @@
33
33
  "typescript": "^5"
34
34
  },
35
35
  "dependencies": {
36
- "@bloopjs/bloop": "0.0.83",
37
- "@bloopjs/engine": "0.0.83",
36
+ "@bloopjs/bloop": "0.0.85",
37
+ "@bloopjs/engine": "0.0.85",
38
38
  "@preact/signals": "^1.3.1",
39
39
  "partysocket": "^1.1.6",
40
40
  "preact": "^10.25.4"
package/src/App.ts CHANGED
@@ -1,4 +1,10 @@
1
- import { type Bloop, type MountOptions, mount, type Sim } from "@bloopjs/bloop";
1
+ import {
2
+ type Bloop,
3
+ type LoadTapeOptions,
4
+ type MountOptions,
5
+ mount,
6
+ type Sim,
7
+ } from "@bloopjs/bloop";
2
8
  import type { Key } from "@bloopjs/engine";
3
9
  import { mouseButtonCodeToMouseButton, readTapeHeader } from "@bloopjs/engine";
4
10
  import { DebugUi, type DebugUiOptions } from "./debugui/mod.ts";
@@ -29,6 +35,8 @@ export type StartOptions = {
29
35
  brokerUrl?: string;
30
36
  /** Enable debug UI with optional configuration */
31
37
  debugUi?: boolean | DebugUiOptions;
38
+ /** Tape recording options */
39
+ tape?: MountOptions["tape"];
32
40
  };
33
41
 
34
42
  const DEFAULT_BROKER_URL = "wss://webrtc-divine-glade-8064.fly.dev/ws";
@@ -137,9 +145,9 @@ export class App {
137
145
  }
138
146
 
139
147
  /** Load a tape for replay */
140
- loadTape(tape: Uint8Array): void {
148
+ loadTape(tape: Uint8Array, options?: LoadTapeOptions): void {
141
149
  const header = readTapeHeader(tape);
142
- this.sim.loadTape(tape);
150
+ this.sim.loadTape(tape, options);
143
151
  this.sim.seek(header.startFrame);
144
152
  this.sim.pause();
145
153
 
@@ -76,7 +76,7 @@ function LetterboxedLayout({ canvas }: { canvas: HTMLCanvasElement }) {
76
76
  // Right bar: rollback depth (online) or snapshot size (offline)
77
77
  // For now, we don't have rollback depth exposed, so use a placeholder
78
78
  const rightValue = isOnline ? 0 : snapshotSize;
79
- const rightMax = isOnline ? 10 : 10000; // 10 frames rollback or 10KB
79
+ const rightMax = isOnline ? 10 : 10000; // 10k frames rollback or 10KB
80
80
  const rightLabel = isOnline ? "RB" : "KB";
81
81
 
82
82
  const gameClassName = hmrFlash ? "letterboxed-game hmr-flash" : "letterboxed-game";