@gjsify/dom-elements 0.4.28 → 0.4.29
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/element.js +1 -1
- package/lib/esm/html-element.js +1 -1
- package/lib/esm/notify-resize.js +1 -1
- package/lib/types/document-fragment.d.ts +1 -1
- package/lib/types/document.d.ts +1 -1
- package/lib/types/element.d.ts +19 -1
- package/lib/types/html-canvas-element.d.ts +1 -1
- package/lib/types/html-element.d.ts +0 -1
- package/lib/types/node.d.ts +2 -1
- package/lib/types/types/predefined-color-space.d.ts +1 -1
- package/package.json +7 -7
package/lib/esm/element.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{attributes as e,childNodesList as t,elementChildren as n,localName as r,namespaceURI as i,nodeType as a,parentNode as o,prefix as s,propertyEventListeners as c,tagName as l}from"./property-symbol.js";import{NodeType as u}from"./node-type.js";import{Node as d}from"./node.js";import{NamespaceURI as f}from"./namespace-uri.js";import{NamedNodeMap as p}from"./named-node-map.js";let m,h,g,_,v,y;var Element=class extends d{constructor(){super(),this[m]=``,this[h]=``,this[g]=f.html,this[_]=null,this[v]=new p(this),this[y]=new Map,this._resizeSubscribers=null,this._pointerCaptures=new Set,this[a]=u.ELEMENT_NODE}get tagName(){return this[l]}get localName(){return this[r]}get namespaceURI(){return this[i]}get prefix(){return this[s]}get nodeName(){return this[l]}get attributes(){return this[e]}get id(){return this.getAttribute(`id`)??``}set id(e){this.setAttribute(`id`,e)}get className(){return this.getAttribute(`class`)??``}set className(e){this.setAttribute(`class`,e)}get children(){return this[n]}get childElementCount(){return this[n].length}get firstElementChild(){return this[n][0]??null}get lastElementChild(){let e=this[n];return e[e.length-1]??null}get previousElementSibling(){let e=this[o];if(!e)return null;let t=e[n],r=t.indexOf(this);return r>0?t[r-1]:null}get nextElementSibling(){let e=this[o];if(!e)return null;let t=e[n],r=t.indexOf(this);return r!==-1&&r<t.length-1?t[r+1]:null}get textContent(){let e=``;for(let n of this[t])n.textContent!==null&&(e+=n.textContent);return e}set textContent(e){let n=this[t];for(;n.length>0;)this.removeChild(n[0])}getAttribute(t){let n=this[e].getNamedItem(t);return n?n.value:null}getAttributeNS(t,n){let r=this[e].getNamedItemNS(t,n);return r?r.value:null}setAttribute(t,n){this[e]._setNamedItem(t,String(n))}setAttributeNS(t,n,r){let i=t===``?null:t,a=n.split(`:`),o=a.length>1?a[0]:null;this[e]._setNamedItem(n,String(r),i,o)}removeAttribute(t){this[e]._removeNamedItem(t)}removeAttributeNS(t,n){let r=t===``?null:t;this[e]._removeNamedItemNS(r,n)}hasAttribute(t){return this[e].getNamedItem(t)!==null}hasAttributeNS(t,n){return this[e].getNamedItemNS(t,n)!==null}getAttributeNode(t){return this[e].getNamedItem(t)}setAttributeNode(t){return this[e].setNamedItem(t)}removeAttributeNode(t){let n=this[e].getNamedItem(t.name);if(!n)throw new DOMException(`Failed to execute 'removeAttributeNode' on 'Element': The attribute is not owned by this element.`,`NotFoundError`);return this[e].removeNamedItem(n.name),n}toggleAttribute(e,t){return t===void 0?this.hasAttribute(e)?(this.removeAttribute(e),!1):(this.setAttribute(e,``),!0):t?(this.setAttribute(e,``),!0):(this.removeAttribute(e),!1)}hasAttributes(){return this[e].length>0}dispatchEvent(e){let t=super.dispatchEvent(e),n=this[c].get(`on`+e.type);return typeof n==`function`&&n.call(this,e),t}querySelector(e){return null}querySelectorAll(e){return[]}matches(e){return!1}closest(e){return null}getElementsByTagName(e){let n=[],r=e.toUpperCase(),walk=i=>{for(let o of i[t])if(o[a]===u.ELEMENT_NODE){let t=o;(e===`*`||t[l]===r)&&n.push(t),walk(t)}};return walk(this),n}getElementsByClassName(e){let n=[],r=e.split(/\s+/).filter(Boolean),walk=e=>{for(let i of e[t])if(i[a]===u.ELEMENT_NODE){let e=i,t=e.className.split(/\s+/);r.every(e=>t.includes(e))&&n.push(e),walk(e)}};return walk(this),n}cloneNode(n=!1){let a=super.cloneNode(!1);a[l]=this[l],a[r]=this[r],a[i]=this[i],a[s]=this[s];for(let t of this[e])a.setAttributeNS(t.namespaceURI,t.name,t.value);if(n)for(let e of this[t])a.appendChild(e.cloneNode(!0));return a}_onResize(e){let t=this._resizeSubscribers??=new Set;return t.add(e),()=>{t.delete(e),t.size===0&&(this._resizeSubscribers=null)}}_fireResizeSubscribers(e,t){let n=this._resizeSubscribers;if(!(!n||n.size===0))for(let r of[...n])try{r(e,t)}catch(e){console.error(`ResizeObserver subscriber threw:`,e)}}setPointerCapture(e){this._pointerCaptures.add(e)}releasePointerCapture(e){this._pointerCaptures.delete(e)}hasPointerCapture(e){return this._pointerCaptures.has(e)}get[(m=l,h=r,g=i,_=s,v=e,y=c,Symbol.toStringTag)](){return`Element`}};export{Element};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{attributes as e,childNodesList as t,elementChildren as n,localName as r,namespaceURI as i,nodeType as a,parentNode as o,prefix as s,propertyEventListeners as c,tagName as l}from"./property-symbol.js";import{NodeType as u}from"./node-type.js";import{Node as d}from"./node.js";import{NamespaceURI as f}from"./namespace-uri.js";import{NamedNodeMap as p}from"./named-node-map.js";let m,h,g,_,v,y;var Element=class extends d{constructor(){super(),this[m]=``,this[h]=``,this[g]=f.html,this[_]=null,this[v]=new p(this),this[y]=new Map,this._resizeSubscribers=null,this._allocatedClientWidth=0,this._allocatedClientHeight=0,this._pointerCaptures=new Set,this[a]=u.ELEMENT_NODE}get tagName(){return this[l]}get localName(){return this[r]}get namespaceURI(){return this[i]}get prefix(){return this[s]}get nodeName(){return this[l]}get attributes(){return this[e]}get id(){return this.getAttribute(`id`)??``}set id(e){this.setAttribute(`id`,e)}get className(){return this.getAttribute(`class`)??``}set className(e){this.setAttribute(`class`,e)}get children(){return this[n]}get childElementCount(){return this[n].length}get firstElementChild(){return this[n][0]??null}get lastElementChild(){let e=this[n];return e[e.length-1]??null}get previousElementSibling(){let e=this[o];if(!e)return null;let t=e[n],r=t.indexOf(this);return r>0?t[r-1]:null}get nextElementSibling(){let e=this[o];if(!e)return null;let t=e[n],r=t.indexOf(this);return r!==-1&&r<t.length-1?t[r+1]:null}get textContent(){let e=``;for(let n of this[t])n.textContent!==null&&(e+=n.textContent);return e}set textContent(e){let n=this[t];for(;n.length>0;)this.removeChild(n[0])}getAttribute(t){let n=this[e].getNamedItem(t);return n?n.value:null}getAttributeNS(t,n){let r=this[e].getNamedItemNS(t,n);return r?r.value:null}setAttribute(t,n){this[e]._setNamedItem(t,String(n))}setAttributeNS(t,n,r){let i=t===``?null:t,a=n.split(`:`),o=a.length>1?a[0]:null;this[e]._setNamedItem(n,String(r),i,o)}removeAttribute(t){this[e]._removeNamedItem(t)}removeAttributeNS(t,n){let r=t===``?null:t;this[e]._removeNamedItemNS(r,n)}hasAttribute(t){return this[e].getNamedItem(t)!==null}hasAttributeNS(t,n){return this[e].getNamedItemNS(t,n)!==null}getAttributeNode(t){return this[e].getNamedItem(t)}setAttributeNode(t){return this[e].setNamedItem(t)}removeAttributeNode(t){let n=this[e].getNamedItem(t.name);if(!n)throw new DOMException(`Failed to execute 'removeAttributeNode' on 'Element': The attribute is not owned by this element.`,`NotFoundError`);return this[e].removeNamedItem(n.name),n}toggleAttribute(e,t){return t===void 0?this.hasAttribute(e)?(this.removeAttribute(e),!1):(this.setAttribute(e,``),!0):t?(this.setAttribute(e,``),!0):(this.removeAttribute(e),!1)}hasAttributes(){return this[e].length>0}dispatchEvent(e){let t=super.dispatchEvent(e),n=this[c].get(`on`+e.type);return typeof n==`function`&&n.call(this,e),t}querySelector(e){return null}querySelectorAll(e){return[]}matches(e){return!1}closest(e){return null}getElementsByTagName(e){let n=[],r=e.toUpperCase(),walk=i=>{for(let o of i[t])if(o[a]===u.ELEMENT_NODE){let t=o;(e===`*`||t[l]===r)&&n.push(t),walk(t)}};return walk(this),n}getElementsByClassName(e){let n=[],r=e.split(/\s+/).filter(Boolean),walk=e=>{for(let i of e[t])if(i[a]===u.ELEMENT_NODE){let e=i,t=e.className.split(/\s+/);r.every(e=>t.includes(e))&&n.push(e),walk(e)}};return walk(this),n}cloneNode(n=!1){let a=super.cloneNode(!1);a[l]=this[l],a[r]=this[r],a[i]=this[i],a[s]=this[s];for(let t of this[e])a.setAttributeNS(t.namespaceURI,t.name,t.value);if(n)for(let e of this[t])a.appendChild(e.cloneNode(!0));return a}_onResize(e){let t=this._resizeSubscribers??=new Set;return t.add(e),()=>{t.delete(e),t.size===0&&(this._resizeSubscribers=null)}}_fireResizeSubscribers(e,t){let n=this._resizeSubscribers;if(!(!n||n.size===0))for(let r of[...n])try{r(e,t)}catch(e){console.error(`ResizeObserver subscriber threw:`,e)}}setPointerCapture(e){this._pointerCaptures.add(e)}releasePointerCapture(e){this._pointerCaptures.delete(e)}hasPointerCapture(e){return this._pointerCaptures.has(e)}get[(m=l,h=r,g=i,_=s,v=e,y=c,Symbol.toStringTag)](){return`Element`}};export{Element};
|
package/lib/esm/html-element.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{propertyEventListeners as e}from"./property-symbol.js";import{Element as t}from"./element.js";import{Event as n}from"@gjsify/dom-events";var CSSStyleDeclaration=class{constructor(){this._cssText=``}get cssText(){return this._cssText}set cssText(e){this._cssText=e;for(let t of e.split(`;`)){let e=t.indexOf(`:`);if(e===-1)continue;let n=t.slice(0,e).trim(),r=t.slice(e+1).trim();if(!n)continue;let i=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());this[i]=r}}setProperty(e,t,n){this[e]=t}getPropertyValue(e){let t=this[e];return typeof t==`string`?t:``}removeProperty(e){let t=this[e];return delete this[e],typeof t==`string`?t:``}getPropertyPriority(e){return``}},HTMLElement=class extends t{constructor(...e){super(...e),this.style=new CSSStyleDeclaration}get dataset(){let e=this;return new Proxy({},{get(t,n){if(typeof n!=`string`)return;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.getAttribute(r)??void 0},set(t,n,r){if(typeof n!=`string`)return!1;let i=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.setAttribute(i,String(r)),!0},deleteProperty(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.removeAttribute(r),!0},has(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.hasAttribute(r)}})}get title(){return this.getAttribute(`title`)??``}set title(e){this.setAttribute(`title`,e)}get lang(){return this.getAttribute(`lang`)??``}set lang(e){this.setAttribute(`lang`,e)}get dir(){return this.getAttribute(`dir`)??``}set dir(e){this.setAttribute(`dir`,e)}get accessKey(){return this.getAttribute(`accesskey`)??``}set accessKey(e){this.setAttribute(`accesskey`,e)}get accessKeyLabel(){return this.getAttribute(`accesskey`)??``}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}get draggable(){return this.getAttribute(`draggable`)===`true`}set draggable(e){this.setAttribute(`draggable`,String(e))}get spellcheck(){let e=this.getAttribute(`spellcheck`);return e===`false`?!1:e!==null}set spellcheck(e){this.setAttribute(`spellcheck`,String(e))}get translate(){return this.getAttribute(`translate`)!==`no`}set translate(e){this.setAttribute(`translate`,e?`yes`:`no`)}get tabIndex(){let e=this.getAttribute(`tabindex`);return e===null?-1:Number(e)}set tabIndex(e){this.setAttribute(`tabindex`,String(e))}get contentEditable(){let e=this.getAttribute(`contenteditable`);return e===``||e===`true`?`true`:e===`false`?`false`:`inherit`}set contentEditable(e){e===`inherit`?this.removeAttribute(`contenteditable`):this.setAttribute(`contenteditable`,e)}get isContentEditable(){return this.contentEditable===`true`}get offsetHeight(){return
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{propertyEventListeners as e}from"./property-symbol.js";import{Element as t}from"./element.js";import{Event as n}from"@gjsify/dom-events";var CSSStyleDeclaration=class{constructor(){this._cssText=``}get cssText(){return this._cssText}set cssText(e){this._cssText=e;for(let t of e.split(`;`)){let e=t.indexOf(`:`);if(e===-1)continue;let n=t.slice(0,e).trim(),r=t.slice(e+1).trim();if(!n)continue;let i=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());this[i]=r}}setProperty(e,t,n){this[e]=t}getPropertyValue(e){let t=this[e];return typeof t==`string`?t:``}removeProperty(e){let t=this[e];return delete this[e],typeof t==`string`?t:``}getPropertyPriority(e){return``}},HTMLElement=class extends t{constructor(...e){super(...e),this.style=new CSSStyleDeclaration}get dataset(){let e=this;return new Proxy({},{get(t,n){if(typeof n!=`string`)return;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.getAttribute(r)??void 0},set(t,n,r){if(typeof n!=`string`)return!1;let i=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.setAttribute(i,String(r)),!0},deleteProperty(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.removeAttribute(r),!0},has(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.hasAttribute(r)}})}get title(){return this.getAttribute(`title`)??``}set title(e){this.setAttribute(`title`,e)}get lang(){return this.getAttribute(`lang`)??``}set lang(e){this.setAttribute(`lang`,e)}get dir(){return this.getAttribute(`dir`)??``}set dir(e){this.setAttribute(`dir`,e)}get accessKey(){return this.getAttribute(`accesskey`)??``}set accessKey(e){this.setAttribute(`accesskey`,e)}get accessKeyLabel(){return this.getAttribute(`accesskey`)??``}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}get draggable(){return this.getAttribute(`draggable`)===`true`}set draggable(e){this.setAttribute(`draggable`,String(e))}get spellcheck(){let e=this.getAttribute(`spellcheck`);return e===`false`?!1:e!==null}set spellcheck(e){this.setAttribute(`spellcheck`,String(e))}get translate(){return this.getAttribute(`translate`)!==`no`}set translate(e){this.setAttribute(`translate`,e?`yes`:`no`)}get tabIndex(){let e=this.getAttribute(`tabindex`);return e===null?-1:Number(e)}set tabIndex(e){this.setAttribute(`tabindex`,String(e))}get contentEditable(){let e=this.getAttribute(`contenteditable`);return e===``||e===`true`?`true`:e===`false`?`false`:`inherit`}set contentEditable(e){e===`inherit`?this.removeAttribute(`contenteditable`):this.setAttribute(`contenteditable`,e)}get isContentEditable(){return this.contentEditable===`true`}get offsetHeight(){return this._allocatedClientHeight}get offsetWidth(){return this._allocatedClientWidth}get offsetLeft(){return 0}get offsetTop(){return 0}get offsetParent(){return null}get clientHeight(){return this._allocatedClientHeight}get clientWidth(){return this._allocatedClientWidth}get clientLeft(){return 0}get clientTop(){return 0}get scrollHeight(){return this._allocatedClientHeight}get scrollWidth(){return this._allocatedClientWidth}get scrollTop(){return 0}set scrollTop(e){}get scrollLeft(){return 0}set scrollLeft(e){}getBoundingClientRect(){let e=this.clientWidth,t=this.clientHeight;return{x:0,y:0,top:0,left:0,right:e,bottom:t,width:e,height:t,toJSON(){return this}}}click(){this.dispatchEvent(new n(`click`,{bubbles:!0,cancelable:!0}))}blur(){this.dispatchEvent(new n(`blur`))}focus(){this.dispatchEvent(new n(`focus`))}get onclick(){return this[e].get(`onclick`)??null}set onclick(t){this[e].set(`onclick`,t)}get ondblclick(){return this[e].get(`ondblclick`)??null}set ondblclick(t){this[e].set(`ondblclick`,t)}get onload(){return this[e].get(`onload`)??null}set onload(t){this[e].set(`onload`,t)}get onerror(){return this[e].get(`onerror`)??null}set onerror(t){this[e].set(`onerror`,t)}get onabort(){return this[e].get(`onabort`)??null}set onabort(t){this[e].set(`onabort`,t)}get onfocus(){return this[e].get(`onfocus`)??null}set onfocus(t){this[e].set(`onfocus`,t)}get onblur(){return this[e].get(`onblur`)??null}set onblur(t){this[e].set(`onblur`,t)}get onchange(){return this[e].get(`onchange`)??null}set onchange(t){this[e].set(`onchange`,t)}get oninput(){return this[e].get(`oninput`)??null}set oninput(t){this[e].set(`oninput`,t)}get onsubmit(){return this[e].get(`onsubmit`)??null}get onreset(){return this[e].get(`onreset`)??null}set onreset(t){this[e].set(`onreset`,t)}get onscroll(){return this[e].get(`onscroll`)??null}set onscroll(t){this[e].set(`onscroll`,t)}get onresize(){return this[e].get(`onresize`)??null}set onresize(t){this[e].set(`onresize`,t)}get onmousedown(){return this[e].get(`onmousedown`)??null}set onmousedown(t){this[e].set(`onmousedown`,t)}get onmouseup(){return this[e].get(`onmouseup`)??null}set onmouseup(t){this[e].set(`onmouseup`,t)}get onmousemove(){return this[e].get(`onmousemove`)??null}set onmousemove(t){this[e].set(`onmousemove`,t)}get onmouseover(){return this[e].get(`onmouseover`)??null}set onmouseover(t){this[e].set(`onmouseover`,t)}get onmouseout(){return this[e].get(`onmouseout`)??null}set onmouseout(t){this[e].set(`onmouseout`,t)}get onmouseenter(){return this[e].get(`onmouseenter`)??null}set onmouseenter(t){this[e].set(`onmouseenter`,t)}get onmouseleave(){return this[e].get(`onmouseleave`)??null}set onmouseleave(t){this[e].set(`onmouseleave`,t)}get oncontextmenu(){return this[e].get(`oncontextmenu`)??null}set oncontextmenu(t){this[e].set(`oncontextmenu`,t)}get onwheel(){return this[e].get(`onwheel`)??null}set onwheel(t){this[e].set(`onwheel`,t)}get onkeydown(){return this[e].get(`onkeydown`)??null}set onkeydown(t){this[e].set(`onkeydown`,t)}get onkeyup(){return this[e].get(`onkeyup`)??null}set onkeyup(t){this[e].set(`onkeyup`,t)}get ontouchstart(){return this[e].get(`ontouchstart`)??null}set ontouchstart(t){this[e].set(`ontouchstart`,t)}get ontouchend(){return this[e].get(`ontouchend`)??null}set ontouchend(t){this[e].set(`ontouchend`,t)}get ontouchmove(){return this[e].get(`ontouchmove`)??null}set ontouchmove(t){this[e].set(`ontouchmove`,t)}get onpointerdown(){return this[e].get(`onpointerdown`)??null}set onpointerdown(t){this[e].set(`onpointerdown`,t)}get onpointerup(){return this[e].get(`onpointerup`)??null}set onpointerup(t){this[e].set(`onpointerup`,t)}get onpointermove(){return this[e].get(`onpointermove`)??null}set onpointermove(t){this[e].set(`onpointermove`,t)}cloneNode(e=!1){return super.cloneNode(e)}get[Symbol.toStringTag](){return`HTMLElement`}};export{CSSStyleDeclaration,HTMLElement};
|
package/lib/esm/notify-resize.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{Element as e}from"./element.js";function notifyElementResize(t,n,r){t._fireResizeSubscribers(n,r);let i=t.parentNode;for(;i;)i instanceof e&&i._fireResizeSubscribers(n,r),i=i.parentNode}export{notifyElementResize};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{Element as e}from"./element.js";function notifyElementResize(t,n,r){t._allocatedClientWidth=n,t._allocatedClientHeight=r,t._fireResizeSubscribers(n,r);let i=t.parentNode;for(;i;)i instanceof e&&(i._allocatedClientWidth=n,i._allocatedClientHeight=r,i._fireResizeSubscribers(n,r)),i=i.parentNode}export{notifyElementResize};
|
package/lib/types/document.d.ts
CHANGED
package/lib/types/element.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Event } from '@gjsify/dom-events';
|
|
1
|
+
import type { Event } from '@gjsify/dom-events';
|
|
2
2
|
import { Node } from './node.js';
|
|
3
3
|
import { NamedNodeMap } from './named-node-map.js';
|
|
4
4
|
import * as PS from './property-symbol.js';
|
|
@@ -55,6 +55,24 @@ export declare class Element extends Node {
|
|
|
55
55
|
getElementsByClassName(className: string): Element[];
|
|
56
56
|
cloneNode(deep?: boolean): Element;
|
|
57
57
|
private _resizeSubscribers;
|
|
58
|
+
/**
|
|
59
|
+
* Latest known allocation from a backing GTK widget, written by
|
|
60
|
+
* `notifyElementResize()` (target + every ancestor). The polyfill
|
|
61
|
+
* has no layout engine, so without this `clientWidth` /
|
|
62
|
+
* `clientHeight` would always return 0 — which breaks consumers
|
|
63
|
+
* that use `ResizeObserver` to react to a parent's size
|
|
64
|
+
* (Excalibur.js `DisplayMode.FillContainer` reads
|
|
65
|
+
* `canvas.parentElement.clientWidth` to compute its resolution;
|
|
66
|
+
* with 0 the resolution comes out 0×0 and the canvas renders
|
|
67
|
+
* blank).
|
|
68
|
+
*
|
|
69
|
+
* Multi-bridge scenarios fall back to last-write-wins on
|
|
70
|
+
* shared ancestors (typically `document.body`) — acceptable
|
|
71
|
+
* because the consumers that care (one canvas filling the
|
|
72
|
+
* window) have a 1-to-1 bridge / ancestor mapping anyway.
|
|
73
|
+
*/
|
|
74
|
+
_allocatedClientWidth: number;
|
|
75
|
+
_allocatedClientHeight: number;
|
|
58
76
|
/**
|
|
59
77
|
* @internal Subscribe to backing-widget resize notifications.
|
|
60
78
|
*
|
|
@@ -34,7 +34,7 @@ export declare class HTMLCanvasElement extends HTMLElement {
|
|
|
34
34
|
/** Returns a data URL representing the canvas image. Delegates to the active 2D context if available. */
|
|
35
35
|
toDataURL(type?: string, quality?: any): string;
|
|
36
36
|
/** Converts the canvas to a Blob and passes it to the callback. Delegates to the active 2D context if available. */
|
|
37
|
-
toBlob(callback: (
|
|
37
|
+
toBlob(callback: (blob: Blob | null) => void, type?: string, quality?: any): void;
|
|
38
38
|
/** Returns a MediaStream capturing the canvas. Stub — returns empty object. */
|
|
39
39
|
captureStream(_frameRequestRate?: number): any;
|
|
40
40
|
}
|
|
@@ -95,7 +95,6 @@ export declare class HTMLElement extends Element {
|
|
|
95
95
|
get oninput(): ((event: Event) => void) | null;
|
|
96
96
|
set oninput(value: ((event: Event) => void) | null);
|
|
97
97
|
get onsubmit(): ((event: Event) => void) | null;
|
|
98
|
-
set onsubmit(value: ((event: Event) => void) | null);
|
|
99
98
|
get onreset(): ((event: Event) => void) | null;
|
|
100
99
|
set onreset(value: ((event: Event) => void) | null);
|
|
101
100
|
get onscroll(): ((event: Event) => void) | null;
|
package/lib/types/node.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Event as DOMEvent } from '@gjsify/dom-events';
|
|
2
|
+
import { EventTarget } from '@gjsify/dom-events';
|
|
2
3
|
import { NodeList } from './node-list.js';
|
|
3
4
|
import * as PS from './property-symbol.js';
|
|
4
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type PredefinedColorSpace =
|
|
1
|
+
export type PredefinedColorSpace = 'display-p3' | 'srgb';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/dom-elements",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.29",
|
|
4
4
|
"description": "DOM element hierarchy (Node, Element, HTMLElement, HTMLImageElement) for GJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -68,15 +68,15 @@
|
|
|
68
68
|
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.1",
|
|
69
69
|
"@girs/gjs": "4.0.1",
|
|
70
70
|
"@girs/glib-2.0": "2.88.0-4.0.1",
|
|
71
|
-
"@gjsify/abort-controller": "^0.4.
|
|
72
|
-
"@gjsify/canvas2d-core": "^0.4.
|
|
73
|
-
"@gjsify/dom-events": "^0.4.
|
|
74
|
-
"@gjsify/fetch": "^0.4.
|
|
71
|
+
"@gjsify/abort-controller": "^0.4.29",
|
|
72
|
+
"@gjsify/canvas2d-core": "^0.4.29",
|
|
73
|
+
"@gjsify/dom-events": "^0.4.29",
|
|
74
|
+
"@gjsify/fetch": "^0.4.29"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@girs/gst-1.0": "1.28.1-4.0.1",
|
|
78
|
-
"@gjsify/cli": "^0.4.
|
|
79
|
-
"@gjsify/unit": "^0.4.
|
|
78
|
+
"@gjsify/cli": "^0.4.29",
|
|
79
|
+
"@gjsify/unit": "^0.4.29",
|
|
80
80
|
"@types/node": "^25.9.1",
|
|
81
81
|
"typescript": "^6.0.3"
|
|
82
82
|
}
|