@solidjs/h 2.0.0-rc.1 → 2.0.0-rc.3
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/dist/h.cjs +76 -91
- package/dist/h.js +77 -92
- package/jsx-runtime/types/jsx.d.ts +7 -1
- package/jsx-runtime/types-cjs/jsx.d.cts +7 -1
- package/package.json +13 -13
- package/types/hyperscript.d.ts +2 -14
- package/types/index.d.ts +1 -3
- package/types-cjs/hyperscript.d.cts +2 -14
- package/types-cjs/index.d.cts +1 -3
- package/LICENSE +0 -21
package/dist/h.cjs
CHANGED
|
@@ -34,105 +34,90 @@ function wrapCallback(orig) {
|
|
|
34
34
|
w[$WRAPPED] = true;
|
|
35
35
|
return w;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
classes = [];
|
|
71
|
-
}
|
|
72
|
-
if (k !== "ref" && k.slice(0, 2) !== "on" && typeof d[k].value === "function") {
|
|
73
|
-
r.dynamicProperty(l, k);
|
|
74
|
-
dynamic = true;
|
|
75
|
-
} else if (d[k].get) dynamic = true;
|
|
37
|
+
function h(...rawArgs) {
|
|
38
|
+
if (rawArgs.length === 1 && Array.isArray(rawArgs[0])) return rawArgs[0];
|
|
39
|
+
const thunk = () => web.untrack(() => materialize(rawArgs));
|
|
40
|
+
thunk[$ELEMENT] = true;
|
|
41
|
+
return thunk;
|
|
42
|
+
}
|
|
43
|
+
function materialize(args) {
|
|
44
|
+
let e;
|
|
45
|
+
let classes = [];
|
|
46
|
+
let multiExpression = false;
|
|
47
|
+
args = args.slice();
|
|
48
|
+
function item(l) {
|
|
49
|
+
if (l == null) return;
|
|
50
|
+
const type = typeof l;
|
|
51
|
+
if ("string" === type) {
|
|
52
|
+
if (!e) parseClass(l);else e.appendChild(document.createTextNode(l));
|
|
53
|
+
} else if ("number" === type || "boolean" === type || "bigint" === type || "symbol" === type || l instanceof Date || l instanceof RegExp) {
|
|
54
|
+
e.appendChild(document.createTextNode(l.toString()));
|
|
55
|
+
} else if (Array.isArray(l)) {
|
|
56
|
+
for (let i = 0; i < l.length; i++) item(l[i]);
|
|
57
|
+
} else if (l instanceof Element) {
|
|
58
|
+
web.insert(e, l, multiExpression ? null : undefined);
|
|
59
|
+
} else if ("object" === type) {
|
|
60
|
+
let dynamic = false;
|
|
61
|
+
const d = Object.getOwnPropertyDescriptors(l);
|
|
62
|
+
for (const k in d) {
|
|
63
|
+
if (k === "class" && classes.length !== 0) {
|
|
64
|
+
const value = typeof d["class"].value === "function" ? () => [...classes, d["class"].value()] : [...classes, l["class"]];
|
|
65
|
+
Object.defineProperty(l, "class", {
|
|
66
|
+
...d[k],
|
|
67
|
+
value
|
|
68
|
+
});
|
|
69
|
+
classes = [];
|
|
76
70
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
if (k !== "ref" && k.slice(0, 2) !== "on" && typeof d[k].value === "function") {
|
|
72
|
+
web.dynamicProperty(l, k);
|
|
73
|
+
dynamic = true;
|
|
74
|
+
} else if (d[k].get) dynamic = true;
|
|
75
|
+
}
|
|
76
|
+
dynamic ? web.spread(e, l, !!args.length) : web.assign(e, l, !!args.length);
|
|
77
|
+
} else if ("function" === type) {
|
|
78
|
+
if (!e) {
|
|
79
|
+
const first = args[0];
|
|
80
|
+
const props = first == null || typeof first === "object" && !Array.isArray(first) && !(first instanceof Element) ? args.shift() || {} : {};
|
|
81
|
+
if (args.length) props.children = args.length > 1 ? args : args[0];
|
|
82
|
+
for (const k in props) {
|
|
83
|
+
const v = props[k];
|
|
84
|
+
if (typeof v === "function") {
|
|
85
|
+
if (!v.length) web.dynamicProperty(props, k);else if (!v[$ELEMENT] && !v[$WRAPPED]) {
|
|
86
|
+
props[k] = wrapCallback(v);
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
89
|
+
}
|
|
90
|
+
e = web.createComponent(l, props);
|
|
91
|
+
while (typeof e === "function" && e[$ELEMENT]) e = e();
|
|
92
|
+
args = [];
|
|
93
|
+
} else if (l[$ELEMENT]) item(l());else web.insert(e, l, multiExpression ? null : undefined);
|
|
96
94
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
95
|
+
}
|
|
96
|
+
if (typeof args[0] === "string") detectMultiExpression(args);
|
|
97
|
+
while (args.length) item(args.shift());
|
|
98
|
+
if (e instanceof Element && classes.length) e.classList.add(...classes);
|
|
99
|
+
return e;
|
|
100
|
+
function parseClass(string) {
|
|
101
|
+
const m = string.split(/([\.#]?[^\s#.]+)/);
|
|
102
|
+
if (/^\.|#/.test(m[1])) e = document.createElement("div");
|
|
103
|
+
for (let i = 0; i < m.length; i++) {
|
|
104
|
+
const v = m[i],
|
|
105
|
+
s = v.substring(1, v.length);
|
|
106
|
+
if (!v) continue;
|
|
107
|
+
if (!e) e = web.SVGElements.has(v) ? document.createElementNS(web.Namespaces.svg, v) : web.MathMLElements.has(v) ? document.createElementNS(web.Namespaces.mathml, v) : document.createElement(v);else if (v[0] === ".") classes.push(s);else if (v[0] === "#") e.setAttribute("id", s);
|
|
110
108
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
}
|
|
110
|
+
function detectMultiExpression(list) {
|
|
111
|
+
for (let i = 1; i < list.length; i++) {
|
|
112
|
+
if (typeof list[i] === "function") {
|
|
113
|
+
multiExpression = true;
|
|
114
|
+
return;
|
|
115
|
+
} else if (Array.isArray(list[i])) {
|
|
116
|
+
detectMultiExpression(list[i]);
|
|
119
117
|
}
|
|
120
118
|
}
|
|
121
119
|
}
|
|
122
|
-
h.Fragment = props => props.children;
|
|
123
|
-
return h;
|
|
124
120
|
}
|
|
125
|
-
|
|
126
|
-
const h = createHyperScript({
|
|
127
|
-
spread: web.spread,
|
|
128
|
-
assign: web.assign,
|
|
129
|
-
insert: web.insert,
|
|
130
|
-
createComponent: web.createComponent,
|
|
131
|
-
dynamicProperty: web.dynamicProperty,
|
|
132
|
-
untrack: web.untrack,
|
|
133
|
-
SVGElements: web.SVGElements,
|
|
134
|
-
MathMLElements: web.MathMLElements,
|
|
135
|
-
Namespaces: web.Namespaces
|
|
136
|
-
});
|
|
121
|
+
h.Fragment = props => props.children;
|
|
137
122
|
|
|
138
123
|
module.exports = h;
|
package/dist/h.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { untrack, insert, dynamicProperty, spread, assign, createComponent, SVGElements, Namespaces, MathMLElements } from '@solidjs/web';
|
|
2
2
|
|
|
3
3
|
const $ELEMENT = Symbol("hyper-element");
|
|
4
4
|
const $WRAPPED = Symbol("hyper-wrapped");
|
|
@@ -32,105 +32,90 @@ function wrapCallback(orig) {
|
|
|
32
32
|
w[$WRAPPED] = true;
|
|
33
33
|
return w;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
classes = [];
|
|
69
|
-
}
|
|
70
|
-
if (k !== "ref" && k.slice(0, 2) !== "on" && typeof d[k].value === "function") {
|
|
71
|
-
r.dynamicProperty(l, k);
|
|
72
|
-
dynamic = true;
|
|
73
|
-
} else if (d[k].get) dynamic = true;
|
|
35
|
+
function h(...rawArgs) {
|
|
36
|
+
if (rawArgs.length === 1 && Array.isArray(rawArgs[0])) return rawArgs[0];
|
|
37
|
+
const thunk = () => untrack(() => materialize(rawArgs));
|
|
38
|
+
thunk[$ELEMENT] = true;
|
|
39
|
+
return thunk;
|
|
40
|
+
}
|
|
41
|
+
function materialize(args) {
|
|
42
|
+
let e;
|
|
43
|
+
let classes = [];
|
|
44
|
+
let multiExpression = false;
|
|
45
|
+
args = args.slice();
|
|
46
|
+
function item(l) {
|
|
47
|
+
if (l == null) return;
|
|
48
|
+
const type = typeof l;
|
|
49
|
+
if ("string" === type) {
|
|
50
|
+
if (!e) parseClass(l);else e.appendChild(document.createTextNode(l));
|
|
51
|
+
} else if ("number" === type || "boolean" === type || "bigint" === type || "symbol" === type || l instanceof Date || l instanceof RegExp) {
|
|
52
|
+
e.appendChild(document.createTextNode(l.toString()));
|
|
53
|
+
} else if (Array.isArray(l)) {
|
|
54
|
+
for (let i = 0; i < l.length; i++) item(l[i]);
|
|
55
|
+
} else if (l instanceof Element) {
|
|
56
|
+
insert(e, l, multiExpression ? null : undefined);
|
|
57
|
+
} else if ("object" === type) {
|
|
58
|
+
let dynamic = false;
|
|
59
|
+
const d = Object.getOwnPropertyDescriptors(l);
|
|
60
|
+
for (const k in d) {
|
|
61
|
+
if (k === "class" && classes.length !== 0) {
|
|
62
|
+
const value = typeof d["class"].value === "function" ? () => [...classes, d["class"].value()] : [...classes, l["class"]];
|
|
63
|
+
Object.defineProperty(l, "class", {
|
|
64
|
+
...d[k],
|
|
65
|
+
value
|
|
66
|
+
});
|
|
67
|
+
classes = [];
|
|
74
68
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
69
|
+
if (k !== "ref" && k.slice(0, 2) !== "on" && typeof d[k].value === "function") {
|
|
70
|
+
dynamicProperty(l, k);
|
|
71
|
+
dynamic = true;
|
|
72
|
+
} else if (d[k].get) dynamic = true;
|
|
73
|
+
}
|
|
74
|
+
dynamic ? spread(e, l, !!args.length) : assign(e, l, !!args.length);
|
|
75
|
+
} else if ("function" === type) {
|
|
76
|
+
if (!e) {
|
|
77
|
+
const first = args[0];
|
|
78
|
+
const props = first == null || typeof first === "object" && !Array.isArray(first) && !(first instanceof Element) ? args.shift() || {} : {};
|
|
79
|
+
if (args.length) props.children = args.length > 1 ? args : args[0];
|
|
80
|
+
for (const k in props) {
|
|
81
|
+
const v = props[k];
|
|
82
|
+
if (typeof v === "function") {
|
|
83
|
+
if (!v.length) dynamicProperty(props, k);else if (!v[$ELEMENT] && !v[$WRAPPED]) {
|
|
84
|
+
props[k] = wrapCallback(v);
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
87
|
+
}
|
|
88
|
+
e = createComponent(l, props);
|
|
89
|
+
while (typeof e === "function" && e[$ELEMENT]) e = e();
|
|
90
|
+
args = [];
|
|
91
|
+
} else if (l[$ELEMENT]) item(l());else insert(e, l, multiExpression ? null : undefined);
|
|
94
92
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
93
|
+
}
|
|
94
|
+
if (typeof args[0] === "string") detectMultiExpression(args);
|
|
95
|
+
while (args.length) item(args.shift());
|
|
96
|
+
if (e instanceof Element && classes.length) e.classList.add(...classes);
|
|
97
|
+
return e;
|
|
98
|
+
function parseClass(string) {
|
|
99
|
+
const m = string.split(/([\.#]?[^\s#.]+)/);
|
|
100
|
+
if (/^\.|#/.test(m[1])) e = document.createElement("div");
|
|
101
|
+
for (let i = 0; i < m.length; i++) {
|
|
102
|
+
const v = m[i],
|
|
103
|
+
s = v.substring(1, v.length);
|
|
104
|
+
if (!v) continue;
|
|
105
|
+
if (!e) e = SVGElements.has(v) ? document.createElementNS(Namespaces.svg, v) : MathMLElements.has(v) ? document.createElementNS(Namespaces.mathml, v) : document.createElement(v);else if (v[0] === ".") classes.push(s);else if (v[0] === "#") e.setAttribute("id", s);
|
|
108
106
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
}
|
|
108
|
+
function detectMultiExpression(list) {
|
|
109
|
+
for (let i = 1; i < list.length; i++) {
|
|
110
|
+
if (typeof list[i] === "function") {
|
|
111
|
+
multiExpression = true;
|
|
112
|
+
return;
|
|
113
|
+
} else if (Array.isArray(list[i])) {
|
|
114
|
+
detectMultiExpression(list[i]);
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
|
-
h.Fragment = props => props.children;
|
|
121
|
-
return h;
|
|
122
118
|
}
|
|
123
|
-
|
|
124
|
-
const h = createHyperScript({
|
|
125
|
-
spread,
|
|
126
|
-
assign,
|
|
127
|
-
insert,
|
|
128
|
-
createComponent,
|
|
129
|
-
dynamicProperty,
|
|
130
|
-
untrack,
|
|
131
|
-
SVGElements,
|
|
132
|
-
MathMLElements,
|
|
133
|
-
Namespaces
|
|
134
|
-
});
|
|
119
|
+
h.Fragment = props => props.children;
|
|
135
120
|
|
|
136
121
|
export { h as default };
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE IS GENERATED by `scripts/jsx-sync.mjs`.
|
|
3
|
+
* Edit `jsx-h.d.ts` and run `pnpm --filter @solidjs/web jsx-sync`
|
|
4
|
+
* (also runs as part of `pnpm types`).
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import * as csstype from "csstype";
|
|
2
8
|
import type { PropKey, WidenPropValue } from "./jsx-properties.js";
|
|
3
9
|
import type { Element as SolidElement } from "solid-js";
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
|
-
* Originally based on JSX types for Surplus and Inferno and adapted for
|
|
12
|
+
* Originally based on JSX types for Surplus and Inferno and adapted for Solid.
|
|
7
13
|
*
|
|
8
14
|
* - https://github.com/adamhaile/surplus/blob/master/index.d.ts
|
|
9
15
|
* - https://github.com/infernojs/inferno/blob/master/packages/inferno/src/core/types.ts
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE IS GENERATED by `scripts/jsx-sync.mjs`.
|
|
3
|
+
* Edit `jsx-h.d.ts` and run `pnpm --filter @solidjs/web jsx-sync`
|
|
4
|
+
* (also runs as part of `pnpm types`).
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import * as csstype from "csstype";
|
|
2
8
|
import type { PropKey, WidenPropValue } from "./jsx-properties.cjs";
|
|
3
9
|
import type { Element as SolidElement } from "solid-js";
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
|
-
* Originally based on JSX types for Surplus and Inferno and adapted for
|
|
12
|
+
* Originally based on JSX types for Surplus and Inferno and adapted for Solid.
|
|
7
13
|
*
|
|
8
14
|
* - https://github.com/adamhaile/surplus/blob/master/index.d.ts
|
|
9
15
|
* - https://github.com/infernojs/inferno/blob/master/packages/inferno/src/core/types.ts
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/h",
|
|
3
3
|
"description": "Hyperscript / h() factory for Solid — write components without compiled JSX.",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
4
|
+
"version": "2.0.0-rc.3",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/solidjs/solid.git",
|
|
11
|
-
"directory": "packages/
|
|
11
|
+
"directory": "packages/h"
|
|
12
12
|
},
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
@@ -62,24 +62,24 @@
|
|
|
62
62
|
},
|
|
63
63
|
"./types/*": "./types/*"
|
|
64
64
|
},
|
|
65
|
-
"peerDependencies": {
|
|
66
|
-
"@solidjs/web": "^2.0.0-rc.1"
|
|
67
|
-
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@solidjs/web": "2.0.0-rc.1",
|
|
70
|
-
"solid-js": "2.0.0-rc.1"
|
|
71
|
-
},
|
|
72
65
|
"scripts": {
|
|
73
66
|
"build": "npm-run-all -nl build:clean types:copy build:js",
|
|
74
67
|
"build:clean": "rimraf dist/ coverage/ /jsx-runtime/dist",
|
|
75
68
|
"build:js": "rollup -c",
|
|
76
69
|
"types": "npm-run-all -nl types:clean types:copy types:h types:jsx types:cjs",
|
|
77
70
|
"types:clean": "rimraf types/ types-cjs/ jsx-runtime/types-cjs/",
|
|
78
|
-
"types:copy": "ncp
|
|
79
|
-
"types:h": "tsc --project ./tsconfig.json
|
|
80
|
-
"types:jsx": "rimraf ./jsx-runtime/types && tsc --project ./jsx-runtime/tsconfig.json && ncp
|
|
71
|
+
"types:copy": "ncp ../web/jsx/jsx-properties.d.ts ./jsx-runtime/src/jsx-properties.d.ts && node ../web/scripts/jsx-sync.mjs --input ../web/jsx/jsx-h.d.ts --output ./jsx-runtime/src/jsx.d.ts --element \"SolidElement | Node | FunctionElement | ArrayElement\" --import \"import type { Element as SolidElement } from \\\"solid-js\\\";\"",
|
|
72
|
+
"types:h": "tsc --project ./tsconfig.json",
|
|
73
|
+
"types:jsx": "rimraf ./jsx-runtime/types && tsc --project ./jsx-runtime/tsconfig.json && ncp ../web/jsx/jsx-properties.d.ts ./jsx-runtime/types/jsx-properties.d.ts && node ../web/scripts/jsx-sync.mjs --input ../web/jsx/jsx-h.d.ts --output ./jsx-runtime/types/jsx.d.ts --element \"SolidElement | Node | FunctionElement | ArrayElement\" --import \"import type { Element as SolidElement } from \\\"solid-js\\\";\"",
|
|
81
74
|
"types:cjs": "node ../../scripts/sync-dual-types.mjs ./types ./types-cjs ./jsx-runtime/types ./jsx-runtime/types-cjs",
|
|
82
75
|
"link": "symlink-dir . node_modules/@solidjs/h",
|
|
83
76
|
"test": "vitest run"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"@solidjs/web": "^2.0.0-rc.3"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@solidjs/web": "workspace:*",
|
|
83
|
+
"solid-js": "workspace:*"
|
|
84
84
|
}
|
|
85
|
-
}
|
|
85
|
+
}
|
package/types/hyperscript.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
2
|
-
interface Runtime {
|
|
3
|
-
insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
|
|
4
|
-
spread(node: Element, accessor: any, skipChildren?: Boolean): void;
|
|
5
|
-
assign(node: Element, props: any, skipChildren?: Boolean): void;
|
|
6
|
-
createComponent(Comp: (props: any) => any, props: any): any;
|
|
7
|
-
dynamicProperty(props: any, key: string): any;
|
|
8
|
-
untrack<T>(fn: () => T): T;
|
|
9
|
-
SVGElements: Set<string>;
|
|
10
|
-
MathMLElements: Set<string>;
|
|
11
|
-
Namespaces: Record<string, string>;
|
|
12
|
-
}
|
|
13
1
|
type ExpandableNode = Node & {
|
|
14
2
|
[key: string]: any;
|
|
15
3
|
};
|
|
@@ -24,5 +12,5 @@ export type HyperScript = {
|
|
|
24
12
|
children: any;
|
|
25
13
|
}) => any;
|
|
26
14
|
};
|
|
27
|
-
|
|
28
|
-
export
|
|
15
|
+
declare const _default: HyperScript;
|
|
16
|
+
export default _default;
|
package/types/index.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
2
|
-
interface Runtime {
|
|
3
|
-
insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
|
|
4
|
-
spread(node: Element, accessor: any, skipChildren?: Boolean): void;
|
|
5
|
-
assign(node: Element, props: any, skipChildren?: Boolean): void;
|
|
6
|
-
createComponent(Comp: (props: any) => any, props: any): any;
|
|
7
|
-
dynamicProperty(props: any, key: string): any;
|
|
8
|
-
untrack<T>(fn: () => T): T;
|
|
9
|
-
SVGElements: Set<string>;
|
|
10
|
-
MathMLElements: Set<string>;
|
|
11
|
-
Namespaces: Record<string, string>;
|
|
12
|
-
}
|
|
13
1
|
type ExpandableNode = Node & {
|
|
14
2
|
[key: string]: any;
|
|
15
3
|
};
|
|
@@ -24,5 +12,5 @@ export type HyperScript = {
|
|
|
24
12
|
children: any;
|
|
25
13
|
}) => any;
|
|
26
14
|
};
|
|
27
|
-
|
|
28
|
-
export
|
|
15
|
+
declare const _default: HyperScript;
|
|
16
|
+
export default _default;
|
package/types-cjs/index.d.cts
CHANGED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016-2025 Ryan Carniato
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|