solid-js 1.8.8 → 1.8.9
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/dev.cjs +17 -21
- package/dist/dev.js +554 -321
- package/dist/server.js +170 -75
- package/dist/solid.cjs +17 -21
- package/dist/solid.js +481 -279
- package/h/dist/h.js +34 -8
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +11 -8
- package/h/jsx-runtime/types/jsx.d.ts +2 -1
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +216 -94
- package/html/types/lit.d.ts +47 -33
- package/package.json +3 -2
- package/store/dist/dev.cjs +1 -1
- package/store/dist/dev.js +117 -42
- package/store/dist/server.js +19 -8
- package/store/dist/store.cjs +1 -1
- package/store/dist/store.js +108 -39
- package/store/types/index.d.ts +21 -7
- package/store/types/modifiers.d.ts +6 -3
- package/store/types/mutable.d.ts +5 -2
- package/store/types/server.d.ts +12 -4
- package/store/types/store.d.ts +218 -61
- package/types/index.d.ts +75 -10
- package/types/jsx.d.ts +2 -1
- package/types/reactive/array.d.ts +12 -4
- package/types/reactive/observable.d.ts +25 -17
- package/types/reactive/scheduler.d.ts +9 -6
- package/types/reactive/signal.d.ts +233 -142
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +64 -33
- package/types/render/flow.d.ts +43 -31
- package/types/render/hydration.d.ts +13 -13
- package/types/server/index.d.ts +57 -2
- package/types/server/reactive.d.ts +73 -42
- package/types/server/rendering.d.ts +167 -96
- package/universal/dist/dev.js +28 -12
- package/universal/dist/universal.js +28 -12
- package/universal/types/index.d.ts +3 -1
- package/universal/types/universal.d.ts +0 -1
- package/web/dist/dev.cjs +1 -1
- package/web/dist/dev.js +621 -82
- package/web/dist/server.cjs +30 -27
- package/web/dist/server.js +232 -121
- package/web/dist/storage.js +3 -3
- package/web/dist/web.cjs +1 -1
- package/web/dist/web.js +615 -81
- package/web/types/client.d.ts +2 -2
- package/web/types/core.d.ts +10 -1
- package/web/types/index.d.ts +27 -10
- package/web/types/server-mock.d.ts +47 -32
package/h/dist/h.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
spread,
|
|
3
|
+
assign,
|
|
4
|
+
insert,
|
|
5
|
+
createComponent,
|
|
6
|
+
dynamicProperty,
|
|
7
|
+
SVGElements
|
|
8
|
+
} from "solid-js/web";
|
|
2
9
|
|
|
3
10
|
const $ELEMENT = Symbol("hyper-element");
|
|
4
11
|
function createHyperScript(r) {
|
|
@@ -17,9 +24,16 @@ function createHyperScript(r) {
|
|
|
17
24
|
return ret;
|
|
18
25
|
function item(l) {
|
|
19
26
|
const type = typeof l;
|
|
20
|
-
if (l == null)
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
if (l == null);
|
|
28
|
+
else if ("string" === type) {
|
|
29
|
+
if (!e) parseClass(l);
|
|
30
|
+
else e.appendChild(document.createTextNode(l));
|
|
31
|
+
} else if (
|
|
32
|
+
"number" === type ||
|
|
33
|
+
"boolean" === type ||
|
|
34
|
+
l instanceof Date ||
|
|
35
|
+
l instanceof RegExp
|
|
36
|
+
) {
|
|
23
37
|
e.appendChild(document.createTextNode(l.toString()));
|
|
24
38
|
} else if (Array.isArray(l)) {
|
|
25
39
|
for (let i = 0; i < l.length; i++) item(l[i]);
|
|
@@ -34,12 +48,18 @@ function createHyperScript(r) {
|
|
|
34
48
|
dynamic = true;
|
|
35
49
|
} else if (d[k].get) dynamic = true;
|
|
36
50
|
}
|
|
37
|
-
dynamic
|
|
51
|
+
dynamic
|
|
52
|
+
? r.spread(e, l, e instanceof SVGElement, !!args.length)
|
|
53
|
+
: r.assign(e, l, e instanceof SVGElement, !!args.length);
|
|
38
54
|
} else if ("function" === type) {
|
|
39
55
|
if (!e) {
|
|
40
56
|
let props,
|
|
41
57
|
next = args[0];
|
|
42
|
-
if (
|
|
58
|
+
if (
|
|
59
|
+
next == null ||
|
|
60
|
+
(typeof next === "object" && !Array.isArray(next) && !(next instanceof Element))
|
|
61
|
+
)
|
|
62
|
+
props = args.shift();
|
|
43
63
|
props || (props = {});
|
|
44
64
|
if (args.length) {
|
|
45
65
|
props.children = args.length > 1 ? args : args[0];
|
|
@@ -55,7 +75,8 @@ function createHyperScript(r) {
|
|
|
55
75
|
return list;
|
|
56
76
|
};
|
|
57
77
|
r.dynamicProperty(props, k);
|
|
58
|
-
} else if (typeof d[k].value === "function" && !d[k].value.length)
|
|
78
|
+
} else if (typeof d[k].value === "function" && !d[k].value.length)
|
|
79
|
+
r.dynamicProperty(props, k);
|
|
59
80
|
}
|
|
60
81
|
e = r.createComponent(l, props);
|
|
61
82
|
args = [];
|
|
@@ -72,7 +93,12 @@ function createHyperScript(r) {
|
|
|
72
93
|
const v = m[i],
|
|
73
94
|
s = v.substring(1, v.length);
|
|
74
95
|
if (!v) continue;
|
|
75
|
-
if (!e)
|
|
96
|
+
if (!e)
|
|
97
|
+
e = r.SVGElements.has(v)
|
|
98
|
+
? document.createElementNS("http://www.w3.org/2000/svg", v)
|
|
99
|
+
: document.createElement(v);
|
|
100
|
+
else if (v[0] === ".") e.classList.add(s);
|
|
101
|
+
else if (v[0] === "#") e.setAttribute("id", s);
|
|
76
102
|
}
|
|
77
103
|
}
|
|
78
104
|
function detectMultiExpression(list) {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
export type { JSX } from "./jsx";
|
|
2
2
|
import type { JSX } from "./jsx";
|
|
3
|
-
declare function Fragment(props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})
|
|
3
|
+
declare function Fragment(props: { children: JSX.Element }): JSX.Element;
|
|
4
|
+
declare function jsx(
|
|
5
|
+
type: any,
|
|
6
|
+
props: any
|
|
7
|
+
): () =>
|
|
8
|
+
| (Node & {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
})
|
|
11
|
+
| (Node & {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
})[];
|
|
11
14
|
export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };
|
|
@@ -1995,7 +1995,8 @@ export namespace JSX {
|
|
|
1995
1995
|
ruby: HTMLAttributes<HTMLElement>;
|
|
1996
1996
|
s: HTMLAttributes<HTMLElement>;
|
|
1997
1997
|
samp: HTMLAttributes<HTMLElement>;
|
|
1998
|
-
script: ScriptHTMLAttributes<
|
|
1998
|
+
script: ScriptHTMLAttributes<HTMLScriptElement>;
|
|
1999
|
+
search: HTMLAttributes<HTMLElement>;
|
|
1999
2000
|
section: HTMLAttributes<HTMLElement>;
|
|
2000
2001
|
select: SelectHTMLAttributes<HTMLSelectElement>;
|
|
2001
2002
|
slot: HTMLSlotElementAttributes;
|
package/h/types/hyperscript.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
2
2
|
interface Runtime {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
|
|
4
|
+
spread(node: Element, accessor: any, isSVG?: Boolean, skipChildren?: Boolean): void;
|
|
5
|
+
assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
|
|
6
|
+
createComponent(Comp: (props: any) => any, props: any): any;
|
|
7
|
+
dynamicProperty(props: any, key: string): any;
|
|
8
|
+
SVGElements: Set<string>;
|
|
9
9
|
}
|
|
10
10
|
type ExpandableNode = Node & {
|
|
11
|
-
|
|
11
|
+
[key: string]: any;
|
|
12
12
|
};
|
|
13
13
|
export type HyperScript = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
(...args: any[]): () => ExpandableNode | ExpandableNode[];
|
|
15
|
+
Fragment: (props: {
|
|
16
|
+
children: (() => ExpandableNode) | (() => ExpandableNode)[];
|
|
17
|
+
}) => ExpandableNode[];
|
|
18
18
|
};
|
|
19
19
|
export declare function createHyperScript(r: Runtime): HyperScript;
|
|
20
20
|
export {};
|