@gjsify/dom-elements 0.51.1 → 0.53.0
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/lib/esm/register/document.js +1 -1
- package/lib/esm/register/navigator.js +1 -1
- package/lib/types/register/document.d.ts +1 -1
- package/lib/types/register/navigator.d.ts +1 -1
- package/package.json +13 -12
- package/lib/esm/register/window-event-bus.js +0 -1
- package/lib/types/register/window-event-bus.d.ts +0 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{Comment as e}from"../comment.js";import{Text as t}from"../text.js";import{DocumentFragment as n}from"../document-fragment.js";import{document as r}from"../document.js";import{DOMTokenList as i}from"../dom-token-list.js";import{defineGlobal as a,defineGlobalIfMissing as o}from"./helpers.js";import
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{Comment as e}from"../comment.js";import{Text as t}from"../text.js";import{DocumentFragment as n}from"../document-fragment.js";import{document as r}from"../document.js";import{DOMTokenList as i}from"../dom-token-list.js";import{defineGlobal as a,defineGlobalIfMissing as o}from"./helpers.js";import"@gjsify/dom-events/register/global-event-target";a(`Text`,t),a(`Comment`,e),a(`DocumentFragment`,n),a(`DOMTokenList`,i),a(`document`,r),o(`self`,globalThis);var Window=class{static[Symbol.hasInstance](e){return e===globalThis}};o(`Window`,Window),o(`window`,globalThis),o(`focus`,()=>{}),o(`blur`,()=>{}),o(`devicePixelRatio`,1),o(`scrollX`,0),o(`scrollY`,0),o(`pageXOffset`,0),o(`pageYOffset`,0),o(`alert`,(...e)=>console.error(`alert:`,...e)),globalThis.top===void 0&&Object.defineProperty(globalThis,"top",{get:()=>globalThis,configurable:!0});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import"@gjsify/node-globals/register/navigator";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@gjsify/dom-events/register/global-event-target';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@gjsify/node-globals/register/navigator';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/dom-elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "DOM element hierarchy (Node, Element, HTMLElement, HTMLImageElement) for GJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -68,19 +68,20 @@
|
|
|
68
68
|
"node"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@girs/gdkpixbuf-2.0": "5.
|
|
72
|
-
"@girs/gjs": "5.
|
|
73
|
-
"@girs/glib-2.0": "5.
|
|
74
|
-
"@gjsify/abort-controller": "^0.
|
|
75
|
-
"@gjsify/canvas2d-core": "^0.
|
|
76
|
-
"@gjsify/dom-events": "^0.
|
|
77
|
-
"@gjsify/domparser": "^0.
|
|
78
|
-
"@gjsify/fetch": "^0.
|
|
71
|
+
"@girs/gdkpixbuf-2.0": "5.4.0",
|
|
72
|
+
"@girs/gjs": "5.4.0",
|
|
73
|
+
"@girs/glib-2.0": "5.4.0",
|
|
74
|
+
"@gjsify/abort-controller": "^0.53.0",
|
|
75
|
+
"@gjsify/canvas2d-core": "^0.53.0",
|
|
76
|
+
"@gjsify/dom-events": "^0.53.0",
|
|
77
|
+
"@gjsify/domparser": "^0.53.0",
|
|
78
|
+
"@gjsify/fetch": "^0.53.0",
|
|
79
|
+
"@gjsify/node-globals": "^0.53.0"
|
|
79
80
|
},
|
|
80
81
|
"devDependencies": {
|
|
81
|
-
"@girs/gst-1.0": "5.
|
|
82
|
-
"@gjsify/cli": "^0.
|
|
83
|
-
"@gjsify/unit": "^0.
|
|
82
|
+
"@girs/gst-1.0": "5.4.0",
|
|
83
|
+
"@gjsify/cli": "^0.53.0",
|
|
84
|
+
"@gjsify/unit": "^0.53.0",
|
|
84
85
|
"@types/node": "^25.9.2",
|
|
85
86
|
"typescript": "^6.0.3"
|
|
86
87
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{EventTarget as e}from"@gjsify/dom-events";function installWindowEventBus(t){if(t.__gjsify_globalEventTarget)return t.__gjsify_globalEventTarget;let n=new e,r=typeof t.addEventListener==`function`?t.addEventListener.bind(t):null,i=typeof t.removeEventListener==`function`?t.removeEventListener.bind(t):null;t.__gjsify_globalEventTarget=n;let define=(e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0});return define(`addEventListener`,(e,t,i)=>{n.addEventListener(e,t,i),r?.(e,t,i)}),define(`removeEventListener`,(e,t,r)=>{n.removeEventListener(e,t,r),i?.(e,t,r)}),define(`dispatchEvent`,e=>n.dispatchEvent(e)),n}export{installWindowEventBus};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { EventTarget as OurEventTarget } from '@gjsify/dom-events';
|
|
2
|
-
/** Structural view of the window-scope event-target surface on a global-like host. */
|
|
3
|
-
export interface WindowEventBusHost {
|
|
4
|
-
__gjsify_globalEventTarget?: OurEventTarget;
|
|
5
|
-
addEventListener?: (type: string, listener: unknown, options?: unknown) => void;
|
|
6
|
-
removeEventListener?: (type: string, listener: unknown, options?: unknown) => void;
|
|
7
|
-
dispatchEvent?: (event: unknown) => boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Install the gjsify window-scope event bus (`__gjsify_globalEventTarget`) on `host` and route
|
|
11
|
-
* `addEventListener` / `removeEventListener` / `dispatchEvent` through it.
|
|
12
|
-
*
|
|
13
|
-
* Installs unconditionally, because the bus must be the same object the GTK→DOM bridge dispatches
|
|
14
|
-
* on (`@gjsify/event-bridge` `attachEventControllers()` → `getGlobalEventTarget()`) or window-level
|
|
15
|
-
* input is lost. Bun and Deno ship a native `globalThis.addEventListener` where GJS and Node do
|
|
16
|
-
* not, so an install-only-when-missing guard split the bus there: Excalibur's `Keyboard.init`
|
|
17
|
-
* listeners sat on the native EventTarget while the bridge dispatched into a never-installed gjsify
|
|
18
|
-
* bus, leaving keyboard input dead on bun/deno with the identical bundle working on gjs/node.
|
|
19
|
-
*
|
|
20
|
-
* A pre-existing native surface is not discarded — registrations are forwarded to it too, so
|
|
21
|
-
* genuinely native events (Deno's 'unload', bun's 'error') still arrive. Dispatch goes to the
|
|
22
|
-
* gjsify bus only; the runtime never fires DOM input events globally, so nothing double-fires.
|
|
23
|
-
*/
|
|
24
|
-
export declare function installWindowEventBus(host: WindowEventBusHost): OurEventTarget;
|