solid-js 1.1.2 → 1.1.6-beta.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/dist/dev.cjs +169 -147
- package/dist/dev.js +169 -147
- package/dist/solid.cjs +159 -145
- package/dist/solid.js +159 -145
- package/package.json +2 -2
- package/store/dist/dev.cjs +2 -2
- package/store/dist/dev.js +2 -2
- package/store/dist/store.cjs +2 -2
- package/store/dist/store.js +2 -2
- package/store/types/store.d.ts +15 -9
- package/types/jsx.d.ts +4 -0
- package/types/reactive/array.d.ts +14 -0
- package/types/reactive/observable.d.ts +10 -0
- package/types/reactive/signal noarray.d.ts +429 -0
- package/types/reactive/signal option.d.ts +178 -0
- package/types/reactive/signal.d.ts +279 -30
- package/types/render/Suspense.d.ts +16 -0
- package/types/render/component.d.ts +10 -4
- package/types/render/flow.d.ts +70 -2
- package/web/dist/dev.cjs +11 -7
- package/web/dist/dev.js +11 -7
- package/web/dist/server.cjs +2 -2
- package/web/dist/server.js +2 -2
- package/web/dist/web.cjs +11 -7
- package/web/dist/web.js +11 -7
- package/web/types/index.d.ts +14 -0
package/web/dist/dev.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createMemo, createRoot, createRenderEffect, sharedConfig, createSignal, onCleanup, splitProps, untrack } from 'solid-js';
|
|
2
2
|
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps } from 'solid-js';
|
|
3
3
|
|
|
4
|
-
const booleans = ["allowfullscreen", "
|
|
5
|
-
const Properties = new Set(["className", "
|
|
4
|
+
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
5
|
+
const Properties = new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
6
6
|
const ChildProperties = new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
7
7
|
const Aliases = {
|
|
8
8
|
className: "class",
|
|
@@ -10,6 +10,10 @@ const Aliases = {
|
|
|
10
10
|
};
|
|
11
11
|
const PropAliases = {
|
|
12
12
|
class: "className",
|
|
13
|
+
formnovalidate: "formNoValidate",
|
|
14
|
+
ismap: "isMap",
|
|
15
|
+
nomodule: "noModule",
|
|
16
|
+
playsinline: "playsInline",
|
|
13
17
|
readonly: "readOnly"
|
|
14
18
|
};
|
|
15
19
|
const DelegatedEvents = new Set(["beforeinput", "click", "dblclick", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
@@ -139,27 +143,27 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
139
143
|
} else node.addEventListener(name, handler);
|
|
140
144
|
}
|
|
141
145
|
function classList(node, value, prev = {}) {
|
|
142
|
-
const classKeys = Object.keys(value),
|
|
146
|
+
const classKeys = Object.keys(value || {}),
|
|
143
147
|
prevKeys = Object.keys(prev);
|
|
144
148
|
let i, len;
|
|
145
149
|
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
146
150
|
const key = prevKeys[i];
|
|
147
|
-
if (!key || key === "undefined" || key
|
|
151
|
+
if (!key || key === "undefined" || value[key]) continue;
|
|
148
152
|
toggleClassKey(node, key, false);
|
|
149
153
|
delete prev[key];
|
|
150
154
|
}
|
|
151
155
|
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
152
156
|
const key = classKeys[i],
|
|
153
157
|
classValue = !!value[key];
|
|
154
|
-
if (!key || key === "undefined" || prev[key] === classValue) continue;
|
|
155
|
-
toggleClassKey(node, key,
|
|
158
|
+
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
159
|
+
toggleClassKey(node, key, true);
|
|
156
160
|
prev[key] = classValue;
|
|
157
161
|
}
|
|
158
162
|
return prev;
|
|
159
163
|
}
|
|
160
164
|
function style(node, value, prev = {}) {
|
|
161
165
|
const nodeStyle = node.style;
|
|
162
|
-
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
166
|
+
if (value == null || typeof value === "string") return nodeStyle.cssText = value;
|
|
163
167
|
typeof prev === "string" && (prev = {});
|
|
164
168
|
let v, s;
|
|
165
169
|
for (s in prev) {
|
package/web/dist/server.cjs
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var solidJs = require('solid-js');
|
|
6
6
|
|
|
7
|
-
const booleans = ["allowfullscreen", "
|
|
7
|
+
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
8
8
|
const BooleanAttributes = new Set(booleans);
|
|
9
|
-
new Set(["className", "
|
|
9
|
+
new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
10
10
|
const Aliases = {
|
|
11
11
|
className: "class",
|
|
12
12
|
htmlFor: "for"
|
package/web/dist/server.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { sharedConfig, awaitSuspense, splitProps } from 'solid-js';
|
|
2
2
|
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, mergeProps } from 'solid-js';
|
|
3
3
|
|
|
4
|
-
const booleans = ["allowfullscreen", "
|
|
4
|
+
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
5
5
|
const BooleanAttributes = new Set(booleans);
|
|
6
|
-
new Set(["className", "
|
|
6
|
+
new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
7
7
|
const Aliases = {
|
|
8
8
|
className: "class",
|
|
9
9
|
htmlFor: "for"
|
package/web/dist/web.cjs
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var solidJs = require('solid-js');
|
|
6
6
|
|
|
7
|
-
const booleans = ["allowfullscreen", "
|
|
8
|
-
const Properties = new Set(["className", "
|
|
7
|
+
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
8
|
+
const Properties = new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
9
9
|
const ChildProperties = new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
10
10
|
const Aliases = {
|
|
11
11
|
className: "class",
|
|
@@ -13,6 +13,10 @@ const Aliases = {
|
|
|
13
13
|
};
|
|
14
14
|
const PropAliases = {
|
|
15
15
|
class: "className",
|
|
16
|
+
formnovalidate: "formNoValidate",
|
|
17
|
+
ismap: "isMap",
|
|
18
|
+
nomodule: "noModule",
|
|
19
|
+
playsinline: "playsInline",
|
|
16
20
|
readonly: "readOnly"
|
|
17
21
|
};
|
|
18
22
|
const DelegatedEvents = new Set(["beforeinput", "click", "dblclick", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
@@ -141,27 +145,27 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
141
145
|
} else node.addEventListener(name, handler);
|
|
142
146
|
}
|
|
143
147
|
function classList(node, value, prev = {}) {
|
|
144
|
-
const classKeys = Object.keys(value),
|
|
148
|
+
const classKeys = Object.keys(value || {}),
|
|
145
149
|
prevKeys = Object.keys(prev);
|
|
146
150
|
let i, len;
|
|
147
151
|
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
148
152
|
const key = prevKeys[i];
|
|
149
|
-
if (!key || key === "undefined" || key
|
|
153
|
+
if (!key || key === "undefined" || value[key]) continue;
|
|
150
154
|
toggleClassKey(node, key, false);
|
|
151
155
|
delete prev[key];
|
|
152
156
|
}
|
|
153
157
|
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
154
158
|
const key = classKeys[i],
|
|
155
159
|
classValue = !!value[key];
|
|
156
|
-
if (!key || key === "undefined" || prev[key] === classValue) continue;
|
|
157
|
-
toggleClassKey(node, key,
|
|
160
|
+
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
161
|
+
toggleClassKey(node, key, true);
|
|
158
162
|
prev[key] = classValue;
|
|
159
163
|
}
|
|
160
164
|
return prev;
|
|
161
165
|
}
|
|
162
166
|
function style(node, value, prev = {}) {
|
|
163
167
|
const nodeStyle = node.style;
|
|
164
|
-
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
168
|
+
if (value == null || typeof value === "string") return nodeStyle.cssText = value;
|
|
165
169
|
typeof prev === "string" && (prev = {});
|
|
166
170
|
let v, s;
|
|
167
171
|
for (s in prev) {
|
package/web/dist/web.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createMemo, createRoot, createRenderEffect, sharedConfig, createSignal, onCleanup, splitProps, untrack } from 'solid-js';
|
|
2
2
|
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps } from 'solid-js';
|
|
3
3
|
|
|
4
|
-
const booleans = ["allowfullscreen", "
|
|
5
|
-
const Properties = new Set(["className", "
|
|
4
|
+
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
5
|
+
const Properties = new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
6
6
|
const ChildProperties = new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
7
7
|
const Aliases = {
|
|
8
8
|
className: "class",
|
|
@@ -10,6 +10,10 @@ const Aliases = {
|
|
|
10
10
|
};
|
|
11
11
|
const PropAliases = {
|
|
12
12
|
class: "className",
|
|
13
|
+
formnovalidate: "formNoValidate",
|
|
14
|
+
ismap: "isMap",
|
|
15
|
+
nomodule: "noModule",
|
|
16
|
+
playsinline: "playsInline",
|
|
13
17
|
readonly: "readOnly"
|
|
14
18
|
};
|
|
15
19
|
const DelegatedEvents = new Set(["beforeinput", "click", "dblclick", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
@@ -138,27 +142,27 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
138
142
|
} else node.addEventListener(name, handler);
|
|
139
143
|
}
|
|
140
144
|
function classList(node, value, prev = {}) {
|
|
141
|
-
const classKeys = Object.keys(value),
|
|
145
|
+
const classKeys = Object.keys(value || {}),
|
|
142
146
|
prevKeys = Object.keys(prev);
|
|
143
147
|
let i, len;
|
|
144
148
|
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
145
149
|
const key = prevKeys[i];
|
|
146
|
-
if (!key || key === "undefined" || key
|
|
150
|
+
if (!key || key === "undefined" || value[key]) continue;
|
|
147
151
|
toggleClassKey(node, key, false);
|
|
148
152
|
delete prev[key];
|
|
149
153
|
}
|
|
150
154
|
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
151
155
|
const key = classKeys[i],
|
|
152
156
|
classValue = !!value[key];
|
|
153
|
-
if (!key || key === "undefined" || prev[key] === classValue) continue;
|
|
154
|
-
toggleClassKey(node, key,
|
|
157
|
+
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
158
|
+
toggleClassKey(node, key, true);
|
|
155
159
|
prev[key] = classValue;
|
|
156
160
|
}
|
|
157
161
|
return prev;
|
|
158
162
|
}
|
|
159
163
|
function style(node, value, prev = {}) {
|
|
160
164
|
const nodeStyle = node.style;
|
|
161
|
-
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
165
|
+
if (value == null || typeof value === "string") return nodeStyle.cssText = value;
|
|
162
166
|
typeof prev === "string" && (prev = {});
|
|
163
167
|
let v, s;
|
|
164
168
|
for (s in prev) {
|
package/web/types/index.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ export * from "./client";
|
|
|
3
3
|
export { For, Show, Suspense, SuspenseList, Switch, Match, Index, ErrorBoundary, mergeProps } from "../..";
|
|
4
4
|
export * from "./server-mock";
|
|
5
5
|
export declare const isServer = false;
|
|
6
|
+
/**
|
|
7
|
+
* renders components somewhere else in the DOM
|
|
8
|
+
*
|
|
9
|
+
* Useful for inserting modals and tooltips outside of an cropping layout. If no mount point is given, the portal is inserted in document.body; it is wrapped in a `<div>` unless the target is document.head or `isSVG` is true. setting `useShadow` to true places the element in a shadow root to isolate styles.
|
|
10
|
+
*
|
|
11
|
+
* @description https://www.solidjs.com/docs/latest/api#%3Cportal%3E
|
|
12
|
+
*/
|
|
6
13
|
export declare function Portal(props: {
|
|
7
14
|
mount?: Node;
|
|
8
15
|
useShadow?: boolean;
|
|
@@ -13,4 +20,11 @@ declare type DynamicProps<T> = T & {
|
|
|
13
20
|
children?: any;
|
|
14
21
|
component?: Component<T> | string | keyof JSX.IntrinsicElements;
|
|
15
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* renders an arbitrary custom or native component and passes the other props
|
|
25
|
+
* ```typescript
|
|
26
|
+
* <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />
|
|
27
|
+
* ```
|
|
28
|
+
* @description https://www.solidjs.com/docs/latest/api#%3Cdynamic%3E
|
|
29
|
+
*/
|
|
16
30
|
export declare function Dynamic<T>(props: DynamicProps<T>): Accessor<JSX.Element>;
|