@gjsify/dom-elements 0.21.0 → 0.23.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/dom-matrix.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";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){
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";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){let t=this.a*e.a+this.c*e.b,n=this.b*e.a+this.d*e.b,r=this.a*e.c+this.c*e.d,i=this.b*e.c+this.d*e.d,a=this.a*e.e+this.c*e.f+this.e,o=this.b*e.e+this.d*e.f+this.f;return new DOMMatrix([t,n,r,i,a,o])}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
|
-
import"./_virtual/_rolldown/runtime.js";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
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{HTMLCanvasElement as e}from"../html-canvas-element.js";import{DOMMatrix as t,DOMMatrixReadOnly as n}from"../dom-matrix.js";import{defineGlobal as r}from"./helpers.js";import{CanvasRenderingContext2D as i}from"@gjsify/canvas2d-core";r(`HTMLCanvasElement`,e),r(`CanvasRenderingContext2D`,i),r(`DOMMatrix`,t),r(`DOMMatrixReadOnly`,n);const a=Symbol.for(`gjsify_canvas2d_context`);e.registerContextFactory(`2d`,(e,t)=>{let n=e,r=n[a];if(r)return r;let o=new i(e,t);return n[a]=o,o});
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{HTMLCanvasElement as e}from"../html-canvas-element.js";import{DOMMatrix as t,DOMMatrixReadOnly as n}from"../dom-matrix.js";import{defineGlobal as r}from"./helpers.js";import{CanvasRenderingContext2D as i}from"@gjsify/canvas2d-core";import"@gjsify/canvas2d-core/gdk";r(`HTMLCanvasElement`,e),r(`CanvasRenderingContext2D`,i),r(`DOMMatrix`,t),r(`DOMMatrixReadOnly`,n);const a=Symbol.for(`gjsify_canvas2d_context`);e.registerContextFactory(`2d`,(e,t)=>{let n=e,r=n[a];if(r)return r;let o=new i(e,t);return n[a]=o,o});
|
|
@@ -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{EventTarget as s}from"@gjsify/dom-events";a(`Text`,t),a(`Comment`,e),a(`DocumentFragment`,n),a(`DOMTokenList`,i),a(`document`,r),o(`self`,globalThis);var Window=class{};o(`Window`,Window),o(`window`,globalThis),o(`focus`,()=>{}),o(`blur`,()=>{});{let e=globalThis;if(typeof e.addEventListener!=`function`){let t=new s;e.__gjsify_globalEventTarget=t,e.addEventListener=(e,n,r)=>t.addEventListener(e,n,r),e.removeEventListener=(e,n,r)=>t.removeEventListener(e,n,r),e.dispatchEvent=e=>t.dispatchEvent(e)}}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
|
|
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{EventTarget as s}from"@gjsify/dom-events";a(`Text`,t),a(`Comment`,e),a(`DocumentFragment`,n),a(`DOMTokenList`,i),a(`document`,r),o(`self`,globalThis);var Window=class{};o(`Window`,Window),o(`window`,globalThis),o(`focus`,()=>{}),o(`blur`,()=>{});{let e=globalThis;if(typeof e.addEventListener!=`function`){let t=new s;e.__gjsify_globalEventTarget=t,e.addEventListener=(e,n,r)=>t.addEventListener(e,n,r),e.removeEventListener=(e,n,r)=>t.removeEventListener(e,n,r),e.dispatchEvent=e=>t.dispatchEvent(e)}}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
|
-
import{FontFace as e,FontFaceSet as t}from"../font-face.js";import{defineGlobalIfMissing as n}from"./helpers.js";const r=globalThis;n(`FontFace`,e),r.FontFace===void 0&&(r.FontFace=e);const i=r.document;i&&i.fonts===void 0&&Object.defineProperty(i
|
|
1
|
+
import{FontFace as e,FontFaceSet as t}from"../font-face.js";import{defineGlobalIfMissing as n}from"./helpers.js";const r=globalThis;n(`FontFace`,e),r.FontFace===void 0&&(r.FontFace=e);const i=r.document;i&&i.fonts===void 0&&Object.defineProperty(i,"fonts",{value:new t,configurable:!0,writable:!0});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@gjsify/canvas2d-core/gdk';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/dom-elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "DOM element hierarchy (Node, Element, HTMLElement, HTMLImageElement) for GJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
"@girs/gdkpixbuf-2.0": "^4.1.0",
|
|
72
72
|
"@girs/gjs": "^4.1.0",
|
|
73
73
|
"@girs/glib-2.0": "^4.1.0",
|
|
74
|
-
"@gjsify/abort-controller": "^0.
|
|
75
|
-
"@gjsify/canvas2d-core": "^0.
|
|
76
|
-
"@gjsify/dom-events": "^0.
|
|
77
|
-
"@gjsify/fetch": "^0.
|
|
74
|
+
"@gjsify/abort-controller": "^0.23.0",
|
|
75
|
+
"@gjsify/canvas2d-core": "^0.23.0",
|
|
76
|
+
"@gjsify/dom-events": "^0.23.0",
|
|
77
|
+
"@gjsify/fetch": "^0.23.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@girs/gst-1.0": "^4.1.0",
|
|
81
|
-
"@gjsify/cli": "^0.
|
|
82
|
-
"@gjsify/unit": "^0.
|
|
81
|
+
"@gjsify/cli": "^0.23.0",
|
|
82
|
+
"@gjsify/unit": "^0.23.0",
|
|
83
83
|
"@types/node": "^25.9.2",
|
|
84
84
|
"typescript": "^6.0.3"
|
|
85
85
|
},
|