@gjsify/dom-elements 0.3.19 → 0.3.21
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/_virtual/_rolldown/runtime.js +1 -1
- package/lib/esm/attr.js +1 -1
- package/lib/esm/character-data.js +1 -1
- package/lib/esm/comment.js +1 -1
- package/lib/esm/document-fragment.js +1 -1
- package/lib/esm/document.js +1 -1
- package/lib/esm/dom-matrix.js +1 -1
- package/lib/esm/dom-token-list.js +1 -1
- package/lib/esm/element.js +1 -1
- package/lib/esm/font-face.js +1 -1
- package/lib/esm/gst-time.js +1 -1
- package/lib/esm/html-canvas-element.js +1 -1
- package/lib/esm/html-element.js +1 -1
- package/lib/esm/html-image-element.js +1 -1
- package/lib/esm/html-media-element.js +1 -1
- package/lib/esm/html-video-element.js +1 -1
- package/lib/esm/image.js +1 -1
- package/lib/esm/intersection-observer.js +1 -1
- package/lib/esm/match-media.js +1 -1
- package/lib/esm/mutation-observer.js +1 -1
- package/lib/esm/named-node-map.js +1 -1
- package/lib/esm/node-list.js +1 -1
- package/lib/esm/node.js +1 -1
- package/lib/esm/register/helpers.js +1 -1
- package/lib/esm/resize-observer.js +1 -1
- package/lib/esm/text.js +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,
|
|
1
|
+
var e=Object.defineProperty,__exportAll=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};export{__exportAll};
|
package/lib/esm/attr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{name as e,ownerElement as t,value as n}from"./property-symbol.js";var
|
|
1
|
+
import{name as e,ownerElement as t,value as n}from"./property-symbol.js";var Attr=class{constructor(r,i,a=null,o=null,s=null){this.specified=!0,this[e]=r,this[n]=i,this[t]=s,this.namespaceURI=a,this.prefix=o;let c=r.indexOf(`:`);this.localName=c===-1?r:r.slice(c+1)}get name(){return this[e]}get value(){return this[n]}set value(e){this[n]=e}get ownerElement(){return this[t]}get[Symbol.toStringTag](){return`Attr`}};export{Attr};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nodeType as e}from"./property-symbol.js";import{NodeType as t}from"./node-type.js";import{Node as n}from"./node.js";var
|
|
1
|
+
import{nodeType as e}from"./property-symbol.js";import{NodeType as t}from"./node-type.js";import{Node as n}from"./node.js";var CharacterData=class extends n{constructor(n=``){super(),this[e]=t.TEXT_NODE,this._data=n}get data(){return this._data}set data(e){this._data=e}get textContent(){return this._data}set textContent(e){this._data=e}get nodeValue(){return this._data}set nodeValue(e){this._data=e}get length(){return this._data.length}appendData(e){this._data+=e}deleteData(e,t){this._data=this._data.substring(0,e)+this._data.substring(e+t)}insertData(e,t){this._data=this._data.substring(0,e)+t+this._data.substring(e)}replaceData(e,t,n){this._data=this._data.substring(0,e)+n+this._data.substring(e+t)}substringData(e,t){return this._data.substring(e,e+t)}cloneNode(e=!1){return new this.constructor(this._data)}get[Symbol.toStringTag](){return`CharacterData`}};export{CharacterData};
|
package/lib/esm/comment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nodeType as e}from"./property-symbol.js";import{NodeType as t}from"./node-type.js";import{CharacterData as n}from"./character-data.js";var r=class
|
|
1
|
+
import{nodeType as e}from"./property-symbol.js";import{NodeType as t}from"./node-type.js";import{CharacterData as n}from"./character-data.js";var r=class Comment extends n{constructor(n=``){super(n),this[e]=t.COMMENT_NODE}get nodeName(){return`#comment`}cloneNode(e=!1){return new Comment(this.data)}get[Symbol.toStringTag](){return`Comment`}};export{r as Comment};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{elementChildren as e,nodeType as t}from"./property-symbol.js";import{NodeType as n}from"./node-type.js";import{Node as r}from"./node.js";import{Text as i}from"./text.js";var a=class
|
|
1
|
+
import{elementChildren as e,nodeType as t}from"./property-symbol.js";import{NodeType as n}from"./node-type.js";import{Node as r}from"./node.js";import{Text as i}from"./text.js";var a=class DocumentFragment extends r{constructor(){super(),this[t]=n.DOCUMENT_FRAGMENT_NODE}get nodeName(){return`#document-fragment`}get children(){return this[e]}get childElementCount(){return this[e].length}get firstElementChild(){return this[e][0]??null}get lastElementChild(){let t=this[e];return t[t.length-1]??null}get textContent(){let e=``;for(let t of this.childNodes)t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){for(;this.firstChild;)this.removeChild(this.firstChild);e&&this.appendChild(new i(e))}append(...e){for(let t of e)typeof t==`string`?this.appendChild(new i(t)):this.appendChild(t)}prepend(...e){let t=this.firstChild;for(let n of e)typeof n==`string`?this.insertBefore(new i(n),t):this.insertBefore(n,t)}replaceChildren(...e){for(;this.firstChild;)this.removeChild(this.firstChild);this.append(...e)}getElementById(e){for(let t of this.children){if(t.id===e)return t;let n=this._findById(t,e);if(n)return n}return null}_findById(e,t){for(let n of e.children){if(n.id===t)return n;let e=this._findById(n,t);if(e)return e}return null}cloneNode(e=!1){let t=new DocumentFragment;if(e)for(let e of this.childNodes)t.appendChild(e.cloneNode(!0));return t}get[Symbol.toStringTag](){return`DocumentFragment`}};export{a as DocumentFragment};
|
package/lib/esm/document.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Node as e}from"./node.js";import{Comment as t}from"./comment.js";import{Text as n}from"./text.js";import{DocumentFragment as r}from"./document-fragment.js";import{HTMLElement as i}from"./html-element.js";import{HTMLImageElement as a}from"./html-image-element.js";import{HTMLVideoElement as o}from"./html-video-element.js";import{HTMLCanvasElement as s}from"./html-canvas-element.js";import{Event as c}from"@gjsify/dom-events";var l=class
|
|
1
|
+
import{Node as e}from"./node.js";import{Comment as t}from"./comment.js";import{Text as n}from"./text.js";import{DocumentFragment as r}from"./document-fragment.js";import{HTMLElement as i}from"./html-element.js";import{HTMLImageElement as a}from"./html-image-element.js";import{HTMLVideoElement as o}from"./html-video-element.js";import{HTMLCanvasElement as s}from"./html-canvas-element.js";import{Event as c}from"@gjsify/dom-events";var l=class Document extends e{static{this._elementFactories=new Map}constructor(){super(),this.body=new i,this.head=new i,this.documentElement=new i,this.appendChild(this.documentElement),this.documentElement.appendChild(this.body)}static registerElementFactory(e,t){Document._elementFactories.set(e.toLowerCase(),t)}createElementNS(e,t){let n=t.toLowerCase();switch(n){case`img`:return new a;case`video`:return new o;case`canvas`:return new s;default:{let e=Document._elementFactories.get(n);return e?e():new i}}}createElement(e){return this.createElementNS(`http://www.w3.org/1999/xhtml`,e)}createTextNode(e){return new n(e)}createComment(e){return new t(e)}createDocumentFragment(){return new r}createEvent(e){return new c(e)}getElementById(e){return this._findById(this.body,e)}_findById(e,t){if(e.id===t)return e;for(let n of e.children){let e=this._findById(n,t);if(e)return e}return null}get[Symbol.toStringTag](){return`Document`}};const u=new l;export{l as Document,u as document};
|
package/lib/esm/dom-matrix.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=class
|
|
1
|
+
var e=class DOMMatrix{constructor(e){this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this.m11=1,this.m12=0,this.m13=0,this.m14=0,this.m21=0,this.m22=1,this.m23=0,this.m24=0,this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m41=0,this.m42=0,this.m43=0,this.m44=1,this.is2D=!0,this.isIdentity=!0,Array.isArray(e)&&(e.length===6?(this.a=this.m11=e[0],this.b=this.m12=e[1],this.c=this.m21=e[2],this.d=this.m22=e[3],this.e=this.m41=e[4],this.f=this.m42=e[5],this.is2D=!0):e.length===16&&(this.m11=e[0],this.m12=e[1],this.m13=e[2],this.m14=e[3],this.m21=e[4],this.m22=e[5],this.m23=e[6],this.m24=e[7],this.m31=e[8],this.m32=e[9],this.m33=e[10],this.m34=e[11],this.m41=e[12],this.m42=e[13],this.m43=e[14],this.m44=e[15],this.a=this.m11,this.b=this.m12,this.c=this.m21,this.d=this.m22,this.e=this.m41,this.f=this.m42,this.is2D=!1),this.isIdentity=this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.e===0&&this.f===0)}multiply(e){return new DOMMatrix([this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.e+this.c*e.f+this.e,this.b*e.e+this.d*e.f+this.f])}multiplySelf(e){let t=this.multiply(e);return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,this.f=t.f,this.m11=this.a,this.m12=this.b,this.m21=this.c,this.m22=this.d,this.m41=this.e,this.m42=this.f,this.isIdentity=!1,this}inverse(){let e=this.a*this.d-this.b*this.c;if(e===0)return new DOMMatrix([1,0,0,1,0,0]);let t=1/e;return new DOMMatrix([this.d*t,-this.b*t,-this.c*t,this.a*t,(this.c*this.f-this.d*this.e)*t,(this.b*this.e-this.a*this.f)*t])}translate(e=0,t=0){return this.multiply({a:1,b:0,c:0,d:1,e,f:t})}scale(e=1,t=e){return this.multiply({a:e,b:0,c:0,d:t,e:0,f:0})}};const t=e;export{e as DOMMatrix,t as DOMMatrixReadOnly};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DOMTokenList=class{constructor(e,t){this._ownerElement=e,this._attributeName=t}_getTokens(){let e=this._ownerElement.getAttribute(this._attributeName);return e?e.split(/\s+/).filter(e=>e.length>0):[]}_setTokens(e){let t=e.join(` `);t?this._ownerElement.setAttribute(this._attributeName,t):this._ownerElement.removeAttribute(this._attributeName)}get length(){return this._getTokens().length}get value(){return this._ownerElement.getAttribute(this._attributeName)??``}set value(e){e?this._ownerElement.setAttribute(this._attributeName,e):this._ownerElement.removeAttribute(this._attributeName)}item(e){let t=this._getTokens();return e>=0&&e<t.length?t[e]:null}contains(e){return this._getTokens().includes(e)}add(...e){let t=this._getTokens();for(let n of e)n&&!t.includes(n)&&t.push(n);this._setTokens(t)}remove(...e){let t=this._getTokens().filter(t=>!e.includes(t));this._setTokens(t)}toggle(e,t){let n=this.contains(e);return t===void 0?n?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){let n=this._getTokens(),r=n.indexOf(e);return r===-1?!1:(n[r]=t,this._setTokens(n),!0)}supports(e){return!0}forEach(e){let t=this._getTokens();for(let n=0;n<t.length;n++)e(t[n],n,this)}keys(){return this._getTokens().keys()}values(){return this._getTokens().values()}entries(){return this._getTokens().entries()}[Symbol.iterator](){return this._getTokens().values()}toString(){return this.value}get[Symbol.toStringTag](){return`DOMTokenList`}};export{DOMTokenList};
|
package/lib/esm/element.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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
|
|
1
|
+
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._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}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/font-face.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var FontFace=class{constructor(e,t,n){this.status=`unloaded`,this.display=`auto`,this.style=`normal`,this.weight=`normal`,this.stretch=`normal`,this.unicodeRange=`U+0-10FFFF`,this.variant=`normal`,this.featureSettings=`normal`,this.family=e,this.source=typeof t==`string`?t:`[binary]`,this.loaded=Promise.resolve(this)}_extractFilePath(){let e=this.source.match(/url\s*\(\s*["']?(file:\/\/\/[^"')]+)["']?\s*\)/i);return e?e[1].replace(/^file:\/\//,``):null}async load(){this.status=`loading`;let e=this._extractFilePath();if(e)try{let{default:t}=await import(`gi://PangoCairo?version=1.0`);t.font_map_get_default().add_font_file(e)}catch{}return this.status=`loaded`,this}},FontFaceSet=class{constructor(){this.status=`loaded`,this.ready=Promise.resolve(this),this._faces=new Set}addEventListener(e,t){}removeEventListener(e,t){}dispatchEvent(e){return!0}add(e){return this._faces.add(e),this}delete(e){return this._faces.delete(e)}clear(){this._faces.clear()}has(e){return this._faces.has(e)}check(e,t){return!1}load(e,t){return Promise.resolve([])}forEach(e){this._faces.forEach(t=>e(t,t,this))}values(){return this._faces.values()}keys(){return this._faces.values()}entries(){return Array.from(this._faces).map(e=>[e,e])[Symbol.iterator]()}[Symbol.iterator](){return this._faces[Symbol.iterator]()}get size(){return this._faces.size}};export{FontFace,FontFaceSet};
|
package/lib/esm/gst-time.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=1e9;function
|
|
1
|
+
const e=1e9;function secondsToGstTime(t){return BigInt(Math.round(t*e))}function gstTimeToSeconds(t){return Number(t)/e}export{gstTimeToSeconds,secondsToGstTime};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HTMLElement as e}from"./html-element.js";var t=class
|
|
1
|
+
import{HTMLElement as e}from"./html-element.js";var t=class HTMLCanvasElement extends e{constructor(...e){super(...e),this.oncontextlost=null,this.oncontextrestored=null,this.onwebglcontextcreationerror=null,this.onwebglcontextlost=null,this.onwebglcontextrestored=null}static{this._contextFactories=new Map}static registerContextFactory(e,t){HTMLCanvasElement._contextFactories.set(e,t)}get width(){let e=this.getAttribute(`width`);return e===null?300:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get height(){let e=this.getAttribute(`height`);return e===null?150:Number(e)}set height(e){this.setAttribute(`height`,String(e))}getContext(e,t){let n=HTMLCanvasElement._contextFactories.get(e);return n?n(this,t):null}toDataURL(e,t){let n=this.getContext(`2d`);return n&&typeof n._toDataURL==`function`?n._toDataURL(e,t):``}toBlob(e,t,n){let r=this.toDataURL(t,n);if(!r){e(null);return}let[i,a]=r.split(`,`),o=i.split(`:`)[1].split(`;`)[0],s=atob(a),c=new Uint8Array(s.length);for(let e=0;e<s.length;e++)c[e]=s.charCodeAt(e);e(new Blob([c],{type:o}))}captureStream(e){return{}}};export{t as HTMLCanvasElement};
|
package/lib/esm/html-element.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{propertyEventListeners as e}from"./property-symbol.js";import{Element as t}from"./element.js";import{Event as n}from"@gjsify/dom-events";var
|
|
1
|
+
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 0}get offsetWidth(){return 0}get offsetLeft(){return 0}get offsetTop(){return 0}get offsetParent(){return null}get clientHeight(){return 0}get clientWidth(){return 0}get clientLeft(){return 0}get clientTop(){return 0}get scrollHeight(){return 0}get scrollWidth(){return 0}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}set onsubmit(t){this[e].set(`onsubmit`,t)}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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{localName as e,namespaceURI as t,tagName as n}from"./property-symbol.js";import{NamespaceURI as r}from"./namespace-uri.js";import{HTMLElement as i}from"./html-element.js";import{Event as a}from"@gjsify/dom-events";import o from"@girs/glib-2.0";import s from"@girs/gio-2.0";import c from"@girs/gdkpixbuf-2.0";import l from"system";var
|
|
1
|
+
import{localName as e,namespaceURI as t,tagName as n}from"./property-symbol.js";import{NamespaceURI as r}from"./namespace-uri.js";import{HTMLElement as i}from"./html-element.js";import{Event as a}from"@gjsify/dom-events";import o from"@girs/glib-2.0";import s from"@girs/gio-2.0";import c from"@girs/gdkpixbuf-2.0";import l from"system";var HTMLImageElement=class extends i{constructor(){super(),this._complete=!1,this._naturalHeight=0,this._naturalWidth=0,this[n]=`IMG`,this[e]=`img`,this[t]=r.html}get complete(){return this._complete}get naturalHeight(){return this._naturalHeight}get naturalWidth(){return this._naturalWidth}get currentSrc(){return this.src}get x(){return 0}get y(){return 0}get alt(){return this.getAttribute(`alt`)??``}set alt(e){this.setAttribute(`alt`,e)}get crossOrigin(){return this.getAttribute(`crossorigin`)}set crossOrigin(e){e===null?this.removeAttribute(`crossorigin`):this.setAttribute(`crossorigin`,e)}get decoding(){return this.getAttribute(`decoding`)??`auto`}set decoding(e){this.setAttribute(`decoding`,e)}get loading(){let e=this.getAttribute(`loading`);return e===`lazy`||e===`eager`?e:`auto`}set loading(e){this.setAttribute(`loading`,e)}get referrerPolicy(){return this.getAttribute(`referrerpolicy`)??``}set referrerPolicy(e){this.setAttribute(`referrerpolicy`,e)}get sizes(){return this.getAttribute(`sizes`)??``}set sizes(e){this.setAttribute(`sizes`,e)}get src(){return this.getAttribute(`src`)??``}set src(e){this.setAttribute(`src`,e);let t=globalThis.__GJSIFY_DEBUG_IMG===!0;if(e.startsWith(`data:`)){let n=e.indexOf(`,`);if(n===-1){this._complete=!0,this.dispatchEvent(new a(`error`));return}let r=e.slice(5,n),i=e.slice(n+1),l=r.includes(`;base64`);try{let e;e=l?o.base64_decode(i):new TextEncoder().encode(decodeURIComponent(i));let n=o.Bytes.new(e),r=s.MemoryInputStream.new_from_bytes(n);this._pixbuf=c.Pixbuf.new_from_stream(r,null),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&console.log(`[img] ok data: (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new a(`load`))}catch(e){t&&console.warn(`[img] error data:: ${e?.message??e}`),this._complete=!0,this.dispatchEvent(new a(`error`))}return}let n;if(e.startsWith(`file://`))n=o.filename_from_uri(e)[0];else if(e.startsWith(`http://`)||e.startsWith(`https://`)){this._complete=!0,this.dispatchEvent(new a(`error`));return}else{let t=o.path_get_dirname(l.programInvocationName);n=o.build_filenamev([t,e])}try{t&&console.log(`[img] load ${n}`),this._pixbuf=c.Pixbuf.new_from_file(n),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&console.log(`[img] ok ${n} (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new a(`load`))}catch(e){t&&console.warn(`[img] error ${n}: ${e?.message??e}`),this._complete=!0,this.dispatchEvent(new a(`error`))}}get srcset(){return this.getAttribute(`srcset`)??``}set srcset(e){this.setAttribute(`srcset`,e)}get useMap(){return this.getAttribute(`usemap`)??``}set useMap(e){this.setAttribute(`usemap`,e)}get height(){if(this._pixbuf)return this._pixbuf.get_height();let e=this.getAttribute(`height`);return e===null?0:Number(e)}set height(e){this.setAttribute(`height`,String(e))}get width(){if(this._pixbuf)return this._pixbuf.get_width();let e=this.getAttribute(`width`);return e===null?0:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get isMap(){return this.hasAttribute(`ismap`)}set isMap(e){e?this.setAttribute(`ismap`,``):this.removeAttribute(`ismap`)}decode(){return Promise.resolve()}cloneNode(e=!1){return super.cloneNode(e)}getImageData(){if(!this._pixbuf)return null;let e=this._pixbuf.get_has_alpha()?this._pixbuf:this._pixbuf.add_alpha(!1,0,0,0)??this._pixbuf;return{colorSpace:`srgb`,data:new Uint8ClampedArray(e.get_pixels()),height:e.get_height(),width:e.get_width()}}isPixbuf(){return!!this._pixbuf}get[Symbol.toStringTag](){return`HTMLImageElement`}};export{HTMLImageElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HTMLElement as e}from"./html-element.js";import{Event as t}from"@gjsify/dom-events";const n=0,r=1,i=2,a=3,o=4,s=0,c=1,l=2,u=3;var
|
|
1
|
+
import{HTMLElement as e}from"./html-element.js";import{Event as t}from"@gjsify/dom-events";const n=0,r=1,i=2,a=3,o=4,s=0,c=1,l=2,u=3;var HTMLMediaElement=class extends e{constructor(...e){super(...e),this._src=``,this._srcObject=null,this.currentTime=0,this.duration=NaN,this.paused=!0,this.ended=!1,this.volume=1,this.muted=!1,this.defaultMuted=!1,this.loop=!1,this.autoplay=!1,this.preload=``,this.playbackRate=1,this.defaultPlaybackRate=1,this.readyState=0,this.networkState=0}get buffered(){return{length:0,start:()=>0,end:()=>0}}get seekable(){return{length:0,start:()=>0,end:()=>0}}get played(){return{length:0,start:()=>0,end:()=>0}}get src(){return this._src}set src(e){this._src=e,this._srcObject=null,this.dispatchEvent(new t(`srcchange`))}get srcObject(){return this._srcObject}set srcObject(e){this._srcObject=e,this._src=``,this.dispatchEvent(new t(`srcobjectchange`))}play(){return this.paused=!1,this.ended=!1,this.dispatchEvent(new t(`play`)),Promise.resolve()}pause(){this.paused=!0,this.dispatchEvent(new t(`pause`))}load(){this.readyState=0,this.networkState=2,this.dispatchEvent(new t(`loadstart`))}canPlayType(e){return``}static{this.HAVE_NOTHING=0}static{this.HAVE_METADATA=1}static{this.HAVE_CURRENT_DATA=2}static{this.HAVE_FUTURE_DATA=3}static{this.HAVE_ENOUGH_DATA=4}static{this.NETWORK_EMPTY=0}static{this.NETWORK_IDLE=1}static{this.NETWORK_LOADING=2}static{this.NETWORK_NO_SOURCE=3}get[Symbol.toStringTag](){return`HTMLMediaElement`}};export{i as HAVE_CURRENT_DATA,o as HAVE_ENOUGH_DATA,a as HAVE_FUTURE_DATA,r as HAVE_METADATA,n as HAVE_NOTHING,HTMLMediaElement,s as NETWORK_EMPTY,c as NETWORK_IDLE,l as NETWORK_LOADING,u as NETWORK_NO_SOURCE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{localName as e,namespaceURI as t,tagName as n}from"./property-symbol.js";import{NamespaceURI as r}from"./namespace-uri.js";import{HTMLMediaElement as i}from"./html-media-element.js";import{gstTimeToSeconds as a,secondsToGstTime as o}from"./gst-time.js";import{Event as s}from"@gjsify/dom-events";var
|
|
1
|
+
import{localName as e,namespaceURI as t,tagName as n}from"./property-symbol.js";import{NamespaceURI as r}from"./namespace-uri.js";import{HTMLMediaElement as i}from"./html-media-element.js";import{gstTimeToSeconds as a,secondsToGstTime as o}from"./gst-time.js";import{Event as s}from"@gjsify/dom-events";var HTMLVideoElement=class extends i{constructor(){super(),this._pipeline=null,this._videoWidth=0,this._videoHeight=0,this.poster=``,this[n]=`VIDEO`,this[e]=`video`,this[t]=r.html;let i=this;Object.defineProperty(this,`paused`,{get(){if(!i._pipeline)return!0;let[,e]=i._pipeline.get_state(0n);return e!==4},configurable:!0,enumerable:!0}),Object.defineProperty(this,`currentTime`,{get(){if(!i._pipeline)return 0;let[e,t]=i._pipeline.query_position(3);return e?a(t):0},set(e){i._pipeline?.seek(1,3,5,1,o(e),0,-1n)},configurable:!0,enumerable:!0}),Object.defineProperty(this,`duration`,{get(){if(!i._pipeline)return NaN;let[e,t]=i._pipeline.query_duration(3);return e&&Number(t)>0?a(t):NaN},configurable:!0,enumerable:!0}),Object.defineProperty(this,`volume`,{get(){return i._playbin()?.volume??1},set(e){let t=i._playbin();t&&(t.volume=Math.max(0,Math.min(1,e)))},configurable:!0,enumerable:!0}),Object.defineProperty(this,`muted`,{get(){return i._playbin()?.mute??!1},set(e){let t=i._playbin();t&&(t.mute=e)},configurable:!0,enumerable:!0})}async play(){this._pipeline?.set_state(4),this.dispatchEvent(new s(`play`)),this.dispatchEvent(new s(`playing`))}pause(){this._pipeline?.set_state(3),this.dispatchEvent(new s(`pause`))}get videoWidth(){return this._videoWidth}set videoWidth(e){this._videoWidth=e}get videoHeight(){return this._videoHeight}set videoHeight(e){this._videoHeight=e}get[Symbol.toStringTag](){return`HTMLVideoElement`}_playbin(){return this._pipeline?.get_by_name(`playbin`)??null}};export{HTMLVideoElement};
|
package/lib/esm/image.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HTMLImageElement as e}from"./html-image-element.js";var
|
|
1
|
+
import{HTMLImageElement as e}from"./html-image-element.js";var Image=class extends e{constructor(e=null,t=null){super(),e!==null&&(this.width=e),t!==null&&(this.height=t)}};export{e as HTMLImageElement,Image,Image as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var IntersectionObserver=class{constructor(e,t){this.root=t?.root??null,this.rootMargin=t?.rootMargin??`0px`,this.thresholds=Array.isArray(t?.threshold)?t.threshold:[t?.threshold??0]}observe(e){}unobserve(e){}disconnect(){}takeRecords(){return[]}};export{IntersectionObserver};
|
package/lib/esm/match-media.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EventTarget as e}from"@gjsify/dom-events";var
|
|
1
|
+
import{EventTarget as e}from"@gjsify/dom-events";var MediaQueryList=class extends e{constructor(e){super(),this.onchange=null,this.media=e,this.matches=!1}addListener(e){}removeListener(e){}};function matchMedia(e){return new MediaQueryList(e)}export{MediaQueryList,matchMedia};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var MutationObserver=class{constructor(e){}observe(e,t){}disconnect(){}takeRecords(){return[]}};export{MutationObserver};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Attr as e}from"./attr.js";import{NamespaceURI as t}from"./namespace-uri.js";var
|
|
1
|
+
import{Attr as e}from"./attr.js";import{NamespaceURI as t}from"./namespace-uri.js";var NamedNodeMap=class{constructor(e){this._items=[],this._ownerElement=e}get length(){return this._items.length}item(e){return this._items[e]??null}getNamedItem(e){return this._findByName(e)}getNamedItemNS(e,t){let n=e===``?null:e;for(let e of this._items)if(e.namespaceURI===n&&e.localName===t)return e;return null}setNamedItem(e){return this._setAttr(e)}setNamedItemNS(e){return this._setAttr(e)}removeNamedItem(e){let t=this._findByName(e);if(!t)throw new DOMException(`Failed to execute 'removeNamedItem' on 'NamedNodeMap': No item with name '${e}' was found.`,`NotFoundError`);return this._removeAttr(t),t}removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);if(!n)throw new DOMException(`Failed to execute 'removeNamedItemNS' on 'NamedNodeMap': No item with namespace '${e}' and localName '${t}' was found.`,`NotFoundError`);return this._removeAttr(n),n}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NamedNodeMap`}_setNamedItem(t,n,r=null,i=null){let a=r===null?this._findByName(t):this.getNamedItemNS(r,t.includes(`:`)?t.split(`:`)[1]:t);if(a)a.value=n;else{let a=new e(t,n,r,i,this._ownerElement);this._items.push(a)}}_removeNamedItem(e){let t=this._findByName(e);return t?(this._removeAttr(t),!0):!1}_removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);return n?(this._removeAttr(n),!0):!1}_findByName(e){let n=this._ownerElement.namespaceURI===t.html,r=n?e.toLowerCase():e;for(let e of this._items)if((n?e.name.toLowerCase():e.name)===r)return e;return null}_setAttr(t){let n=null;if(n=t.namespaceURI===null?this._findByName(t.name):this.getNamedItemNS(t.namespaceURI,t.localName),n){let r=new e(n.name,n.value,n.namespaceURI,n.prefix,n.ownerElement);return n.value=t.value,r}return this._items.push(t),null}_removeAttr(e){let t=this._items.indexOf(e);t!==-1&&this._items.splice(t,1)}};export{NamedNodeMap};
|
package/lib/esm/node-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var NodeList=class{constructor(e){this._items=e}get length(){return this._items.length}item(e){return this._items[e]??null}forEach(e,t){for(let n=0;n<this._items.length;n++)e.call(t,this._items[n],n,this)}entries(){return this._items.entries()}keys(){return this._items.keys()}values(){return this._items.values()}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NodeList`}};export{NodeList};
|
package/lib/esm/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{childNodesList as e,elementChildren as t,isConnected as n,nodeType as r,parentNode as i}from"./property-symbol.js";import{NodeType as a}from"./node-type.js";import{NodeList as o}from"./node-list.js";import{EventTarget as s}from"@gjsify/dom-events";let c,l,u,d,f;var p=class
|
|
1
|
+
import{childNodesList as e,elementChildren as t,isConnected as n,nodeType as r,parentNode as i}from"./property-symbol.js";import{NodeType as a}from"./node-type.js";import{NodeList as o}from"./node-list.js";import{EventTarget as s}from"@gjsify/dom-events";let c,l,u,d,f;var p=class Node extends s{constructor(...e){super(...e),this.ELEMENT_NODE=a.ELEMENT_NODE,this.ATTRIBUTE_NODE=a.ATTRIBUTE_NODE,this.TEXT_NODE=a.TEXT_NODE,this.CDATA_SECTION_NODE=a.CDATA_SECTION_NODE,this.PROCESSING_INSTRUCTION_NODE=a.PROCESSING_INSTRUCTION_NODE,this.COMMENT_NODE=a.COMMENT_NODE,this.DOCUMENT_NODE=a.DOCUMENT_NODE,this.DOCUMENT_TYPE_NODE=a.DOCUMENT_TYPE_NODE,this.DOCUMENT_FRAGMENT_NODE=a.DOCUMENT_FRAGMENT_NODE,this[c]=a.ELEMENT_NODE,this[l]=null,this[u]=[],this[d]=[],this[f]=!1}static{this.ELEMENT_NODE=a.ELEMENT_NODE}static{this.ATTRIBUTE_NODE=a.ATTRIBUTE_NODE}static{this.TEXT_NODE=a.TEXT_NODE}static{this.CDATA_SECTION_NODE=a.CDATA_SECTION_NODE}static{this.PROCESSING_INSTRUCTION_NODE=a.PROCESSING_INSTRUCTION_NODE}static{this.COMMENT_NODE=a.COMMENT_NODE}static{this.DOCUMENT_NODE=a.DOCUMENT_NODE}static{this.DOCUMENT_TYPE_NODE=a.DOCUMENT_TYPE_NODE}static{this.DOCUMENT_FRAGMENT_NODE=a.DOCUMENT_FRAGMENT_NODE}static{this.DOCUMENT_POSITION_DISCONNECTED=1}static{this.DOCUMENT_POSITION_PRECEDING=2}static{this.DOCUMENT_POSITION_FOLLOWING=4}static{this.DOCUMENT_POSITION_CONTAINS=8}static{this.DOCUMENT_POSITION_CONTAINED_BY=16}static{this.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32}get nodeType(){return this[r]}get nodeName(){return``}get parentNode(){return this[i]}get parentElement(){let e=this[i];return e&&e[r]===a.ELEMENT_NODE?e:null}get childNodes(){return new o(this[e])}get firstChild(){return this[e][0]??null}get lastChild(){let t=this[e];return t[t.length-1]??null}get previousSibling(){let t=this[i];if(!t)return null;let n=t[e],r=n.indexOf(this);return r>0?n[r-1]:null}get nextSibling(){let t=this[i];if(!t)return null;let n=t[e],r=n.indexOf(this);return r!==-1&&r<n.length-1?n[r+1]:null}get textContent(){return null}set textContent(e){}get nodeValue(){return null}set nodeValue(e){}get ownerDocument(){let e=this;for(;e[i];)e=e[i];let t=globalThis.document;return e===t?t:null}get isConnected(){return this[n]}hasChildNodes(){return this[e].length>0}contains(e){if(e===null)return!1;if(e===this)return!0;let t=e;for(;t;){if(t===this)return!0;t=t[i]}return!1}getRootNode(){let e=this;for(;e[i];)e=e[i];return e}appendChild(n){return n[i]&&n[i].removeChild(n),n[i]=this,this[e].push(n),n[r]===a.ELEMENT_NODE&&this[t].push(n),n}removeChild(n){let o=this[e],s=o.indexOf(n);if(s===-1)throw new DOMException(`Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.`,`NotFoundError`);if(o.splice(s,1),n[i]=null,n[r]===a.ELEMENT_NODE){let e=this[t].indexOf(n);e!==-1&&this[t].splice(e,1)}return n}insertBefore(n,o){if(o===null)return this.appendChild(n);let s=this[e],c=s.indexOf(o);if(c===-1)throw new DOMException(`Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.`,`NotFoundError`);if(n[i]&&n[i].removeChild(n),n[i]=this,s.splice(c,0,n),n[r]===a.ELEMENT_NODE){let e=this[t],i=e.length;for(let t=c;t<s.length;t++)if(s[t][r]===a.ELEMENT_NODE&&s[t]!==n){i=e.indexOf(s[t]);break}e.splice(i,0,n)}return n}replaceChild(e,t){return this.insertBefore(e,t),this.removeChild(t),t}cloneNode(t=!1){let n=new this.constructor;if(n[r]=this[r],t)for(let t of this[e])n.appendChild(t.cloneNode(!0));return n}dispatchEvent(e){let t=super.dispatchEvent(e);if(e.bubbles&&!e.cancelBubble){let t=this[i];for(;t&&(Object.getPrototypeOf(Node.prototype).dispatchEvent.call(t,e),!e.cancelBubble);)t=t[i]}return t}get[(c=r,l=i,u=e,d=t,f=n,Symbol.toStringTag)](){return`Node`}};export{p as Node};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function defineGlobal(e,t){Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0})}function defineGlobalIfMissing(e,t){globalThis[e]===void 0&&defineGlobal(e,t)}export{defineGlobal,defineGlobalIfMissing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ResizeObserver=class{constructor(e){}observe(e){}unobserve(e){}disconnect(){}};export{ResizeObserver};
|
package/lib/esm/text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nodeType as e}from"./property-symbol.js";import{NodeType as t}from"./node-type.js";import{CharacterData as n}from"./character-data.js";var r=class
|
|
1
|
+
import{nodeType as e}from"./property-symbol.js";import{NodeType as t}from"./node-type.js";import{CharacterData as n}from"./character-data.js";var r=class Text extends n{constructor(n=``){super(n),this[e]=t.TEXT_NODE}get nodeName(){return`#text`}get wholeText(){let e=this.data,t=this.previousSibling;for(;t&&t instanceof Text;)e=t.data+e,t=t.previousSibling;let n=this.nextSibling;for(;n&&n instanceof Text;)e+=n.data,n=n.nextSibling;return e}splitText(e){let t=this.data.substring(e);this.data=this.data.substring(0,e);let n=new Text(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}cloneNode(e=!1){return new Text(this.data)}get[Symbol.toStringTag](){return`Text`}};export{r as Text};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/dom-elements",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "DOM element hierarchy (Node, Element, HTMLElement, HTMLImageElement) for GJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -65,15 +65,15 @@
|
|
|
65
65
|
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-rc.14",
|
|
66
66
|
"@girs/gjs": "4.0.0-rc.14",
|
|
67
67
|
"@girs/glib-2.0": "2.88.0-4.0.0-rc.14",
|
|
68
|
-
"@gjsify/abort-controller": "^0.3.
|
|
69
|
-
"@gjsify/canvas2d-core": "^0.3.
|
|
70
|
-
"@gjsify/dom-events": "^0.3.
|
|
71
|
-
"@gjsify/fetch": "^0.3.
|
|
68
|
+
"@gjsify/abort-controller": "^0.3.21",
|
|
69
|
+
"@gjsify/canvas2d-core": "^0.3.21",
|
|
70
|
+
"@gjsify/dom-events": "^0.3.21",
|
|
71
|
+
"@gjsify/fetch": "^0.3.21"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@girs/gst-1.0": "1.28.1-4.0.0-rc.14",
|
|
75
|
-
"@gjsify/cli": "^0.3.
|
|
76
|
-
"@gjsify/unit": "^0.3.
|
|
75
|
+
"@gjsify/cli": "^0.3.21",
|
|
76
|
+
"@gjsify/unit": "^0.3.21",
|
|
77
77
|
"@types/node": "^25.6.2",
|
|
78
78
|
"typescript": "^6.0.3"
|
|
79
79
|
}
|