@gjsify/example-dom-excalibur-jelly-jumper 0.1.9 → 0.1.11

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.
Files changed (2) hide show
  1. package/dist/gjs.js +16 -5
  2. package/package.json +6 -6
package/dist/gjs.js CHANGED
@@ -4151,6 +4151,15 @@ var init_html_element = __esm({
4151
4151
  set oncontextmenu(value2) {
4152
4152
  this[propertyEventListeners].set("oncontextmenu", value2);
4153
4153
  }
4154
+ // Wheel events — Excalibur detects wheel support via
4155
+ // `'onwheel' in document.createElement('div')` and only registers its
4156
+ // wheel listener when the property is present on the prototype chain.
4157
+ get onwheel() {
4158
+ return this[propertyEventListeners].get("onwheel") ?? null;
4159
+ }
4160
+ set onwheel(value2) {
4161
+ this[propertyEventListeners].set("onwheel", value2);
4162
+ }
4154
4163
  // Keyboard events
4155
4164
  get onkeydown() {
4156
4165
  return this[propertyEventListeners].get("onkeydown") ?? null;
@@ -5223,6 +5232,10 @@ var init_document2 = __esm({
5223
5232
  globalThis.dispatchEvent = (event) => _globalEventTarget.dispatchEvent(event);
5224
5233
  }
5225
5234
  defineGlobalIfMissing("devicePixelRatio", 1);
5235
+ defineGlobalIfMissing("scrollX", 0);
5236
+ defineGlobalIfMissing("scrollY", 0);
5237
+ defineGlobalIfMissing("pageXOffset", 0);
5238
+ defineGlobalIfMissing("pageYOffset", 0);
5226
5239
  defineGlobalIfMissing("alert", (...args) => console.error("alert:", ...args));
5227
5240
  if (typeof globalThis.top === "undefined") {
5228
5241
  Object.defineProperty(globalThis, "top", {
@@ -7843,7 +7856,7 @@ function getArgv() {
7843
7856
  try {
7844
7857
  const system = getGjsGlobal().imports?.system;
7845
7858
  if (system?.programArgs) {
7846
- return [system.programInvocationName || "gjs", ...system.programArgs];
7859
+ return ["gjs", system.programInvocationName || "", ...system.programArgs];
7847
7860
  }
7848
7861
  } catch {
7849
7862
  }
@@ -23083,12 +23096,9 @@ function attachEventControllers(widget, getElement, options) {
23083
23096
  widget.set_can_focus(true);
23084
23097
  const state = { lastX: 0, lastY: 0, buttonsPressed: 0, pressedKeys: /* @__PURE__ */ new Set() };
23085
23098
  const motionCtrl = new Gtk2.EventControllerMotion();
23086
- motionCtrl.connect("motion", () => {
23099
+ motionCtrl.connect("motion", (_ctrl, x2, y) => {
23087
23100
  const el2 = getElement();
23088
23101
  if (!el2) return;
23089
- const event = motionCtrl.get_current_event();
23090
- if (!event) return;
23091
- const [, x2, y] = event.get_position?.() ?? [false, state.lastX, state.lastY];
23092
23102
  const allocW = widget.get_allocated_width();
23093
23103
  const allocH = widget.get_allocated_height();
23094
23104
  const cx = Math.max(0, Math.min(x2, allocW));
@@ -64431,6 +64441,7 @@ var JellyJumperWindow = class extends Adw.ApplicationWindow {
64431
64441
  widget.installGlobals();
64432
64442
  this._canvasContainer.append(widget);
64433
64443
  widget.onReady(__assignType18((canvas) => {
64444
+ widget.grab_focus();
64434
64445
  canvas.width = widget.get_allocated_width();
64435
64446
  canvas.height = widget.get_allocated_height();
64436
64447
  widget.onResize(__assignType18((w, h) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/example-dom-excalibur-jelly-jumper",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "2D platformer showcase using Excalibur.js 0.32.0 with Tiled tilemaps, running natively on GJS/GTK4 and in the browser",
5
5
  "main": "dist/gjs.js",
6
6
  "type": "module",
@@ -30,17 +30,17 @@
30
30
  "@girs/glib-2.0": "^2.88.0-4.0.0-rc.2",
31
31
  "@girs/gobject-2.0": "^2.88.0-4.0.0-rc.2",
32
32
  "@girs/gtk-4.0": "^4.23.0-4.0.0-rc.2",
33
- "@gjsify/adwaita-icons": "^0.1.9",
34
- "@gjsify/adwaita-web": "^0.1.9",
35
- "@gjsify/canvas2d": "^0.1.9",
36
- "@gjsify/cli": "^0.1.9",
33
+ "@gjsify/adwaita-icons": "^0.1.11",
34
+ "@gjsify/adwaita-web": "^0.1.11",
35
+ "@gjsify/canvas2d": "^0.1.11",
36
+ "@gjsify/cli": "^0.1.11",
37
37
  "@types/node": "^25.6.0",
38
38
  "excalibur": "0.32.0",
39
39
  "http-server": "^14.1.1",
40
40
  "typescript": "^6.0.2"
41
41
  },
42
42
  "dependencies": {
43
- "@gjsify/webgl": "^0.1.9"
43
+ "@gjsify/webgl": "^0.1.11"
44
44
  },
45
45
  "author": "Pascal Garber <pascal@artandcode.studio>",
46
46
  "license": "MIT"