@davidsouther/jiffies 2026.4.0 → 2026.4.1
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/package.json +3 -1
- package/src/dom/README.md +1 -1
- package/src/dom/dom.ts +7 -0
- package/src/dom/fc.ts +4 -1
- package/src/dom/html.ts +1 -1
- package/src/dom/router/router.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davidsouther/jiffies",
|
|
3
|
-
"version": "2026.4.
|
|
3
|
+
"version": "2026.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"displayName": "JEFRi Jiffies",
|
|
6
6
|
"type": "module",
|
|
@@ -29,9 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@biomejs/biome": "^2.3.11",
|
|
32
|
+
"@types/jsdom": "^27.0.0",
|
|
32
33
|
"@types/node": "^20.8.9"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
36
|
+
"jsdom": "^27.4.0",
|
|
35
37
|
"ts-blank-space": "^0.7.0",
|
|
36
38
|
"typescript": "^5.9.3"
|
|
37
39
|
}
|
package/src/dom/README.md
CHANGED
package/src/dom/dom.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { assertExists } from "../assert.ts";
|
|
2
2
|
import type { Properties as SVGProperties } from "./types/css.ts";
|
|
3
3
|
|
|
4
|
+
if (typeof window === "undefined") {
|
|
5
|
+
const { JSDOM } = await import("jsdom");
|
|
6
|
+
// biome-ignore lint/suspicious/noGlobalAssign: Load JSDom globally
|
|
7
|
+
window = global.window = new JSDOM().window as unknown as Window &
|
|
8
|
+
typeof globalThis;
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
export const XHTML_NAMESPACE_URI = "http://www.w3.org/1999/xhtml";
|
|
5
12
|
export const SVG_NAMESPACE_URI = "http://www.w3.org/2000/svg";
|
|
6
13
|
|
package/src/dom/fc.ts
CHANGED
|
@@ -68,7 +68,10 @@ export function FC<Props extends object, State extends object = object>(
|
|
|
68
68
|
attrs?: Attrs<Props> | DenormChildren,
|
|
69
69
|
...children: DenormChildren[]
|
|
70
70
|
): FCComponent<Props, State> => {
|
|
71
|
-
const element = document.createElement(name) as FCComponent<
|
|
71
|
+
const element = window.document.createElement(name) as FCComponent<
|
|
72
|
+
Props,
|
|
73
|
+
State
|
|
74
|
+
>;
|
|
72
75
|
element.update(attrs, ...children);
|
|
73
76
|
return element;
|
|
74
77
|
};
|
package/src/dom/html.ts
CHANGED
package/src/dom/router/router.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface Router {
|
|
|
7
7
|
(target: DOMElement): DOMElement;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const baseURI = `${document.baseURI}`;
|
|
10
|
+
const baseURI = `${window.document.baseURI}`;
|
|
11
11
|
const normalizeHref = () => {
|
|
12
12
|
return `${location.href}/` === baseURI ? baseURI : location.href;
|
|
13
13
|
};
|