@gjsify/example-dom-canvas2d-fireworks 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.
- package/dist/gjs.js +16 -5
- package/package.json +4 -4
package/dist/gjs.js
CHANGED
|
@@ -2282,6 +2282,15 @@ var init_html_element = __esm({
|
|
|
2282
2282
|
set oncontextmenu(value2) {
|
|
2283
2283
|
this[propertyEventListeners].set("oncontextmenu", value2);
|
|
2284
2284
|
}
|
|
2285
|
+
// Wheel events — Excalibur detects wheel support via
|
|
2286
|
+
// `'onwheel' in document.createElement('div')` and only registers its
|
|
2287
|
+
// wheel listener when the property is present on the prototype chain.
|
|
2288
|
+
get onwheel() {
|
|
2289
|
+
return this[propertyEventListeners].get("onwheel") ?? null;
|
|
2290
|
+
}
|
|
2291
|
+
set onwheel(value2) {
|
|
2292
|
+
this[propertyEventListeners].set("onwheel", value2);
|
|
2293
|
+
}
|
|
2285
2294
|
// Keyboard events
|
|
2286
2295
|
get onkeydown() {
|
|
2287
2296
|
return this[propertyEventListeners].get("onkeydown") ?? null;
|
|
@@ -3113,6 +3122,10 @@ var init_document2 = __esm({
|
|
|
3113
3122
|
globalThis.dispatchEvent = (event) => _globalEventTarget.dispatchEvent(event);
|
|
3114
3123
|
}
|
|
3115
3124
|
defineGlobalIfMissing("devicePixelRatio", 1);
|
|
3125
|
+
defineGlobalIfMissing("scrollX", 0);
|
|
3126
|
+
defineGlobalIfMissing("scrollY", 0);
|
|
3127
|
+
defineGlobalIfMissing("pageXOffset", 0);
|
|
3128
|
+
defineGlobalIfMissing("pageYOffset", 0);
|
|
3116
3129
|
defineGlobalIfMissing("alert", (...args) => console.error("alert:", ...args));
|
|
3117
3130
|
if (typeof globalThis.top === "undefined") {
|
|
3118
3131
|
Object.defineProperty(globalThis, "top", {
|
|
@@ -3979,7 +3992,7 @@ function getArgv() {
|
|
|
3979
3992
|
try {
|
|
3980
3993
|
const system = getGjsGlobal().imports?.system;
|
|
3981
3994
|
if (system?.programArgs) {
|
|
3982
|
-
return [system.programInvocationName || "
|
|
3995
|
+
return ["gjs", system.programInvocationName || "", ...system.programArgs];
|
|
3983
3996
|
}
|
|
3984
3997
|
} catch {
|
|
3985
3998
|
}
|
|
@@ -6367,12 +6380,9 @@ function attachEventControllers(widget, getElement, options) {
|
|
|
6367
6380
|
widget.set_can_focus(true);
|
|
6368
6381
|
const state = { lastX: 0, lastY: 0, buttonsPressed: 0, pressedKeys: /* @__PURE__ */ new Set() };
|
|
6369
6382
|
const motionCtrl = new Gtk2.EventControllerMotion();
|
|
6370
|
-
motionCtrl.connect("motion", () => {
|
|
6383
|
+
motionCtrl.connect("motion", (_ctrl, x, y) => {
|
|
6371
6384
|
const el = getElement();
|
|
6372
6385
|
if (!el) return;
|
|
6373
|
-
const event = motionCtrl.get_current_event();
|
|
6374
|
-
if (!event) return;
|
|
6375
|
-
const [, x, y] = event.get_position?.() ?? [false, state.lastX, state.lastY];
|
|
6376
6386
|
const allocW = widget.get_allocated_width();
|
|
6377
6387
|
const allocH = widget.get_allocated_height();
|
|
6378
6388
|
const cx = Math.max(0, Math.min(x, allocW));
|
|
@@ -8118,6 +8128,7 @@ var FireworksWindow = class extends Adw.ApplicationWindow {
|
|
|
8118
8128
|
canvasWidget.installGlobals();
|
|
8119
8129
|
this._canvasContainer.append(canvasWidget);
|
|
8120
8130
|
canvasWidget.onReady(__assignType2((canvas) => {
|
|
8131
|
+
canvasWidget.grab_focus();
|
|
8121
8132
|
canvas.width = canvasWidget.get_allocated_width();
|
|
8122
8133
|
canvas.height = canvasWidget.get_allocated_height();
|
|
8123
8134
|
this._demo = start(canvas);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/example-dom-canvas2d-fireworks",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Colorful fireworks Canvas 2D example with Adwaita controls, adapted from https://codepen.io/juliangarnier/pen/gmOwJX",
|
|
5
5
|
"main": "dist/gjs.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@girs/gjs": "^4.0.0-rc.2",
|
|
28
28
|
"@girs/gobject-2.0": "^2.88.0-4.0.0-rc.2",
|
|
29
29
|
"@girs/gtk-4.0": "^4.23.0-4.0.0-rc.2",
|
|
30
|
-
"@gjsify/adwaita-web": "^0.1.
|
|
31
|
-
"@gjsify/canvas2d": "^0.1.
|
|
32
|
-
"@gjsify/cli": "^0.1.
|
|
30
|
+
"@gjsify/adwaita-web": "^0.1.11",
|
|
31
|
+
"@gjsify/canvas2d": "^0.1.11",
|
|
32
|
+
"@gjsify/cli": "^0.1.11",
|
|
33
33
|
"@types/node": "^25.6.0",
|
|
34
34
|
"http-server": "^14.1.1",
|
|
35
35
|
"typescript": "^6.0.2"
|