@bloopjs/web 0.0.107 → 0.0.109

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.
@@ -1 +1 @@
1
- {"version":3,"file":"DebugUi.d.ts","sourceRoot":"","sources":["../../src/debugui/DebugUi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,UAAU,EAAc,MAAM,YAAY,CAAC;AAGtE,MAAM,MAAM,cAAc,GAAG;IAC3B,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6DAA6D;IAC7D,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,qBAAa,OAAO;;gBAQN,OAAO,GAAE,cAAmB;IAgExC,4CAA4C;IAC5C,IAAI,MAAM,IAAI,iBAAiB,CAE9B;IAED,mDAAmD;IACnD,IAAI,KAAK,IAAI,UAAU,CAEtB;IAED,mDAAmD;IACnD,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAE3B;IAED,OAAO,IAAI,IAAI;CAKhB"}
1
+ {"version":3,"file":"DebugUi.d.ts","sourceRoot":"","sources":["../../src/debugui/DebugUi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,UAAU,EAAc,MAAM,YAAY,CAAC;AAGtE,MAAM,MAAM,cAAc,GAAG;IAC3B,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6DAA6D;IAC7D,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,qBAAa,OAAO;;gBAQN,OAAO,GAAE,cAAmB;IA6DxC,4CAA4C;IAC5C,IAAI,MAAM,IAAI,iBAAiB,CAE9B;IAED,mDAAmD;IACnD,IAAI,KAAK,IAAI,UAAU,CAEtB;IAED,mDAAmD;IACnD,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAE3B;IAED,OAAO,IAAI,IAAI;CAKhB"}
@@ -1,6 +1,7 @@
1
1
  type RootProps = {
2
+ canvas: HTMLCanvasElement;
2
3
  hotkey?: string;
3
4
  };
4
- export declare function Root({ hotkey }: RootProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function Root({ canvas, hotkey }: RootProps): import("react/jsx-runtime").JSX.Element;
5
6
  export {};
6
7
  //# sourceMappingURL=Root.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../../src/debugui/components/Root.tsx"],"names":[],"mappings":"AAQA,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,IAAI,CAAC,EAAE,MAAiB,EAAE,EAAE,SAAS,2CAwCpD"}
1
+ {"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../../src/debugui/components/Root.tsx"],"names":[],"mappings":"AASA,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,IAAI,CAAC,EAAE,MAAM,EAAE,MAAiB,EAAE,EAAE,SAAS,2CAwC5D"}
package/dist/mod.js CHANGED
@@ -1504,7 +1504,7 @@ function readTapeHeader(tape) {
1504
1504
  eventCount: view.getUint16(14, true)
1505
1505
  };
1506
1506
  }
1507
- var DEFAULT_WASM_URL = new URL("https://unpkg.com/@bloopjs/engine@0.0.107/wasm/bloop.wasm");
1507
+ var DEFAULT_WASM_URL = new URL("https://unpkg.com/@bloopjs/engine@0.0.109/wasm/bloop.wasm");
1508
1508
  var MAX_ROLLBACK_FRAMES = 500;
1509
1509
  var TIME_CTX_OFFSET = 0;
1510
1510
  var INPUT_CTX_OFFSET = TIME_CTX_OFFSET + 4;
@@ -3390,7 +3390,7 @@ function readTapeHeader2(tape) {
3390
3390
  eventCount: view.getUint16(14, true)
3391
3391
  };
3392
3392
  }
3393
- var DEFAULT_WASM_URL2 = new URL("https://unpkg.com/@bloopjs/engine@0.0.107/wasm/bloop.wasm");
3393
+ var DEFAULT_WASM_URL2 = new URL("https://unpkg.com/@bloopjs/engine@0.0.109/wasm/bloop.wasm");
3394
3394
  var TIME_CTX_OFFSET2 = 0;
3395
3395
  var INPUT_CTX_OFFSET2 = TIME_CTX_OFFSET2 + 4;
3396
3396
  var EVENTS_OFFSET2 = INPUT_CTX_OFFSET2 + 4;
@@ -5623,14 +5623,16 @@ function BottomBar() {
5623
5623
  }
5624
5624
 
5625
5625
  // src/debugui/components/Root.tsx
5626
- function Root({ hotkey = "Escape" }) {
5626
+ function Root({ canvas, hotkey = "Escape" }) {
5627
5627
  const layoutMode2 = debugState.layoutMode.value;
5628
5628
  if (layoutMode2 === "off") {
5629
5629
  return /* @__PURE__ */ u4(k, {
5630
5630
  children: [
5631
5631
  /* @__PURE__ */ u4("main", {
5632
5632
  className: "fullscreen",
5633
- children: /* @__PURE__ */ u4(CanvasSlot, {}, undefined, false, undefined, this)
5633
+ children: /* @__PURE__ */ u4(GameCanvas, {
5634
+ canvas
5635
+ }, undefined, false, undefined, this)
5634
5636
  }, undefined, false, undefined, this),
5635
5637
  /* @__PURE__ */ u4(DebugToggle, {
5636
5638
  hotkey
@@ -5641,7 +5643,9 @@ function Root({ hotkey = "Escape" }) {
5641
5643
  if (layoutMode2 === "letterboxed") {
5642
5644
  return /* @__PURE__ */ u4(k, {
5643
5645
  children: [
5644
- /* @__PURE__ */ u4(LetterboxedLayout, {}, undefined, false, undefined, this),
5646
+ /* @__PURE__ */ u4(LetterboxedLayout, {
5647
+ canvas
5648
+ }, undefined, false, undefined, this),
5645
5649
  /* @__PURE__ */ u4(DebugToggle, {
5646
5650
  hotkey
5647
5651
  }, undefined, false, undefined, this)
@@ -5655,7 +5659,9 @@ function Root({ hotkey = "Escape" }) {
5655
5659
  children: [
5656
5660
  /* @__PURE__ */ u4("section", {
5657
5661
  className: "game",
5658
- children: /* @__PURE__ */ u4(CanvasSlot, {}, undefined, false, undefined, this)
5662
+ children: /* @__PURE__ */ u4(GameCanvas, {
5663
+ canvas
5664
+ }, undefined, false, undefined, this)
5659
5665
  }, undefined, false, undefined, this),
5660
5666
  /* @__PURE__ */ u4("section", {
5661
5667
  className: "stats",
@@ -5673,7 +5679,7 @@ function Root({ hotkey = "Escape" }) {
5673
5679
  ]
5674
5680
  }, undefined, true, undefined, this);
5675
5681
  }
5676
- function LetterboxedLayout() {
5682
+ function LetterboxedLayout({ canvas }) {
5677
5683
  const isOnline = debugState.netStatus.value.peers.length > 0;
5678
5684
  const advantage = debugState.advantage.value ?? 0;
5679
5685
  const frameTime2 = debugState.frameTime.value;
@@ -5705,7 +5711,9 @@ function LetterboxedLayout() {
5705
5711
  }, undefined, false, undefined, this),
5706
5712
  /* @__PURE__ */ u4("div", {
5707
5713
  className: gameClassName,
5708
- children: /* @__PURE__ */ u4(CanvasSlot, {}, undefined, false, undefined, this)
5714
+ children: /* @__PURE__ */ u4(GameCanvas, {
5715
+ canvas
5716
+ }, undefined, false, undefined, this)
5709
5717
  }, undefined, false, undefined, this),
5710
5718
  /* @__PURE__ */ u4(VerticalBar, {
5711
5719
  value: rightValue,
@@ -5717,10 +5725,17 @@ function LetterboxedLayout() {
5717
5725
  ]
5718
5726
  }, undefined, true, undefined, this);
5719
5727
  }
5720
- function CanvasSlot() {
5728
+ function GameCanvas({ canvas }) {
5729
+ const containerRef = A2(null);
5730
+ y2(() => {
5731
+ const container = containerRef.current;
5732
+ if (container && !container.contains(canvas)) {
5733
+ container.appendChild(canvas);
5734
+ }
5735
+ }, [canvas]);
5721
5736
  return /* @__PURE__ */ u4("div", {
5722
5737
  className: "canvas-container",
5723
- children: /* @__PURE__ */ u4("slot", {}, undefined, false, undefined, this)
5738
+ ref: containerRef
5724
5739
  }, undefined, false, undefined, this);
5725
5740
  }
5726
5741
 
@@ -6562,7 +6577,6 @@ class DebugUi {
6562
6577
  this.#shadow.appendChild(this.#mountPoint);
6563
6578
  debugState.layoutMode.value = initiallyVisible ? "letterboxed" : "off";
6564
6579
  this.#canvas = options.canvas ?? document.createElement("canvas");
6565
- this.#host.appendChild(this.#canvas);
6566
6580
  this.#render();
6567
6581
  container.appendChild(this.#host);
6568
6582
  this.#cleanup = this.#setupHotkey();
@@ -6571,7 +6585,7 @@ class DebugUi {
6571
6585
  });
6572
6586
  }
6573
6587
  #render() {
6574
- G(Root({ hotkey: this.#hotkey }), this.#mountPoint);
6588
+ G(Root({ canvas: this.#canvas, hotkey: this.#hotkey }), this.#mountPoint);
6575
6589
  }
6576
6590
  #setupHotkey() {
6577
6591
  const handler = (e4) => {
@@ -7877,5 +7891,5 @@ export {
7877
7891
  App
7878
7892
  };
7879
7893
 
7880
- //# debugId=7B9494D52075E71364756E2164756E21
7894
+ //# debugId=E832C4B244063C1E64756E2164756E21
7881
7895
  //# sourceMappingURL=mod.js.map