@gjsify/dom-elements 0.53.0 → 0.54.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/font-face.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";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)
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{fontMapHasFamily as e,registerFontFaces as t}from"@gjsify/utils/font-map";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){let n=t([e]);n.available&&reportRegistration(this.family,n)}return this.status=`loaded`,this}};function reportRegistration(t,n){for(let e of n.failed)console.warn(`FontFace.load: ${e.path} could not be read as a font (${e.message}), so text asking for "${t}" will render in a substituted one.`);for(let e of n.declined)console.warn(`FontFace.load: no font map in this process would take ${e} — Pango answers a family it does not hold with the default sans, and nothing else says so. A shipped .app reaches its faces through ATSApplicationFontsPath; a bare \`gjsify run\` needs initFonts() first.`);for(let e of n.unreachable)console.warn(`FontFace.load: ${e} is registered and "${t}" is a family this font map holds, but text asking for it will still render in a substituted one: the map had already resolved that family to the fallback, and that cached answer cannot be asked again. Register the face before anything lays text out.`);n.registered.length!==0&&n.map!==void 0&&(e(n.map,t)||console.warn(`FontFace.load: ${n.registered[0]} is registered, but "${t}" is not a family on the font map — it may be registered under a different name, and text asking for it will render in a substituted one.`))}var 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/dom-elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.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,17 +71,20 @@
|
|
|
71
71
|
"@girs/gdkpixbuf-2.0": "5.4.0",
|
|
72
72
|
"@girs/gjs": "5.4.0",
|
|
73
73
|
"@girs/glib-2.0": "5.4.0",
|
|
74
|
-
"@gjsify/abort-controller": "^0.
|
|
75
|
-
"@gjsify/canvas2d-core": "^0.
|
|
76
|
-
"@gjsify/dom-events": "^0.
|
|
77
|
-
"@gjsify/domparser": "^0.
|
|
78
|
-
"@gjsify/fetch": "^0.
|
|
79
|
-
"@gjsify/node-globals": "^0.
|
|
74
|
+
"@gjsify/abort-controller": "^0.54.0",
|
|
75
|
+
"@gjsify/canvas2d-core": "^0.54.0",
|
|
76
|
+
"@gjsify/dom-events": "^0.54.0",
|
|
77
|
+
"@gjsify/domparser": "^0.54.0",
|
|
78
|
+
"@gjsify/fetch": "^0.54.0",
|
|
79
|
+
"@gjsify/node-globals": "^0.54.0",
|
|
80
|
+
"@gjsify/utils": "^0.54.0"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
83
|
"@girs/gst-1.0": "5.4.0",
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
84
|
+
"@girs/pango-1.0": "5.4.0",
|
|
85
|
+
"@girs/pangocairo-1.0": "5.4.0",
|
|
86
|
+
"@gjsify/cli": "^0.54.0",
|
|
87
|
+
"@gjsify/unit": "^0.54.0",
|
|
85
88
|
"@types/node": "^25.9.2",
|
|
86
89
|
"typescript": "^6.0.3"
|
|
87
90
|
},
|