solid-js 1.4.1 → 1.4.4
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 +18 -12
- package/dist/dev.js +18 -12
- package/dist/server.cjs +9 -6
- package/dist/server.js +9 -6
- package/dist/solid.cjs +15 -12
- package/dist/solid.js +15 -12
- package/html/dist/html.cjs +34 -17
- package/html/dist/html.js +34 -17
- package/package.json +2 -2
- package/store/README.md +2 -2
- package/store/dist/dev.cjs +31 -16
- package/store/dist/dev.js +31 -16
- package/store/dist/server.cjs +16 -2
- package/store/dist/server.js +16 -2
- package/store/dist/store.cjs +31 -16
- package/store/dist/store.js +31 -16
- package/store/types/modifiers.d.ts +1 -2
- package/store/types/server.d.ts +3 -3
- package/store/types/store.d.ts +12 -5
- package/types/reactive/signal.d.ts +9 -6
- package/types/render/component.d.ts +8 -14
- package/types/render/hydration.d.ts +1 -1
- package/web/dist/dev.cjs +26 -14
- package/web/dist/dev.js +26 -14
- package/web/dist/server.cjs +2 -2
- package/web/dist/server.js +2 -2
- package/web/dist/web.cjs +26 -14
- package/web/dist/web.js +26 -14
- package/web/types/index.d.ts +6 -3
- package/web/types/server-mock.d.ts +1 -1
package/web/dist/web.js
CHANGED
|
@@ -2,8 +2,8 @@ import { createMemo, createRoot, createRenderEffect, sharedConfig, enableHydrati
|
|
|
2
2
|
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps } from 'solid-js';
|
|
3
3
|
|
|
4
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
|
-
const ChildProperties = new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
5
|
+
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
6
|
+
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
7
7
|
const Aliases = {
|
|
8
8
|
className: "class",
|
|
9
9
|
htmlFor: "for"
|
|
@@ -16,8 +16,8 @@ const PropAliases = {
|
|
|
16
16
|
playsinline: "playsInline",
|
|
17
17
|
readonly: "readOnly"
|
|
18
18
|
};
|
|
19
|
-
const DelegatedEvents = new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
20
|
-
const SVGElements = new Set([
|
|
19
|
+
const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
20
|
+
const SVGElements = /*#__PURE__*/new Set([
|
|
21
21
|
"altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
|
|
22
22
|
"set", "stop",
|
|
23
23
|
"svg", "switch", "symbol", "text", "textPath",
|
|
@@ -26,7 +26,7 @@ const SVGNamespace = {
|
|
|
26
26
|
xlink: "http://www.w3.org/1999/xlink",
|
|
27
27
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
28
28
|
};
|
|
29
|
-
const DOMElements = new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
|
|
29
|
+
const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
|
|
30
30
|
|
|
31
31
|
function memo(fn, equals) {
|
|
32
32
|
return createMemo(fn, undefined, !equals ? {
|
|
@@ -142,7 +142,8 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
142
142
|
node[`$$${name}Data`] = handler[1];
|
|
143
143
|
} else node[`$$${name}`] = handler;
|
|
144
144
|
} else if (Array.isArray(handler)) {
|
|
145
|
-
|
|
145
|
+
const handlerFn = handler[0];
|
|
146
|
+
node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
|
|
146
147
|
} else node.addEventListener(name, handler);
|
|
147
148
|
}
|
|
148
149
|
function classList(node, value, prev = {}) {
|
|
@@ -306,14 +307,24 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
306
307
|
value(node);
|
|
307
308
|
}
|
|
308
309
|
} else if (prop.slice(0, 3) === "on:") {
|
|
309
|
-
|
|
310
|
+
const e = prop.slice(3);
|
|
311
|
+
prev && node.removeEventListener(e, prev);
|
|
312
|
+
value && node.addEventListener(e, value);
|
|
310
313
|
} else if (prop.slice(0, 10) === "oncapture:") {
|
|
311
|
-
|
|
314
|
+
const e = prop.slice(10);
|
|
315
|
+
prev && node.removeEventListener(e, prev, true);
|
|
316
|
+
value && node.addEventListener(e, value, true);
|
|
312
317
|
} else if (prop.slice(0, 2) === "on") {
|
|
313
318
|
const name = prop.slice(2).toLowerCase();
|
|
314
319
|
const delegate = DelegatedEvents.has(name);
|
|
315
|
-
|
|
316
|
-
|
|
320
|
+
if (!delegate && prev) {
|
|
321
|
+
const h = Array.isArray(prev) ? prev[0] : prev;
|
|
322
|
+
node.removeEventListener(name, h);
|
|
323
|
+
}
|
|
324
|
+
if (delegate || value) {
|
|
325
|
+
addEventListener(node, name, value, delegate);
|
|
326
|
+
delegate && delegateEvents([name]);
|
|
327
|
+
}
|
|
317
328
|
} else if ((isChildProp = ChildProperties.has(prop)) || !isSVG && (PropAliases[prop] || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
|
|
318
329
|
if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[PropAliases[prop] || prop] = value;
|
|
319
330
|
} else {
|
|
@@ -345,7 +356,7 @@ function eventHandler(e) {
|
|
|
345
356
|
const handler = node[key];
|
|
346
357
|
if (handler && !node.disabled) {
|
|
347
358
|
const data = node[`${key}Data`];
|
|
348
|
-
data !== undefined ? handler(data, e) : handler(e);
|
|
359
|
+
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
349
360
|
if (e.cancelBubble) return;
|
|
350
361
|
}
|
|
351
362
|
node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
|
|
@@ -504,7 +515,7 @@ function resolveSSRNode(node) {}
|
|
|
504
515
|
function ssrClassList(value) {}
|
|
505
516
|
function ssrStyle(value) {}
|
|
506
517
|
function ssrSpread(accessor) {}
|
|
507
|
-
function
|
|
518
|
+
function ssrAttribute(key, value) {}
|
|
508
519
|
function ssrHydrationKey() {}
|
|
509
520
|
function escape(html) {}
|
|
510
521
|
function generateHydrationScript() {}
|
|
@@ -557,8 +568,9 @@ function Portal(props) {
|
|
|
557
568
|
}
|
|
558
569
|
function Dynamic(props) {
|
|
559
570
|
const [p, others] = splitProps(props, ["component"]);
|
|
571
|
+
const cached = createMemo(() => p.component);
|
|
560
572
|
return createMemo(() => {
|
|
561
|
-
const component =
|
|
573
|
+
const component = cached();
|
|
562
574
|
switch (typeof component) {
|
|
563
575
|
case "function":
|
|
564
576
|
return untrack(() => component(others));
|
|
@@ -571,4 +583,4 @@ function Dynamic(props) {
|
|
|
571
583
|
});
|
|
572
584
|
}
|
|
573
585
|
|
|
574
|
-
export { Aliases, Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Assets as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, generateHydrationScript, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr,
|
|
586
|
+
export { Aliases, Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Assets as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, generateHydrationScript, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrHydrationKey, ssrSpread, ssrStyle, style, template };
|
package/web/types/index.d.ts
CHANGED
|
@@ -12,10 +12,13 @@ export declare const hydrate: typeof hydrateCore;
|
|
|
12
12
|
*
|
|
13
13
|
* @description https://www.solidjs.com/docs/latest/api#%3Cportal%3E
|
|
14
14
|
*/
|
|
15
|
-
export declare function Portal(props: {
|
|
15
|
+
export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
|
|
16
16
|
mount?: Node;
|
|
17
|
-
useShadow?:
|
|
18
|
-
isSVG?:
|
|
17
|
+
useShadow?: T;
|
|
18
|
+
isSVG?: S;
|
|
19
|
+
ref?: (S extends true ? SVGGElement : HTMLDivElement) | ((el: (T extends true ? {
|
|
20
|
+
readonly shadowRoot: ShadowRoot;
|
|
21
|
+
} : {}) & (S extends true ? SVGGElement : HTMLDivElement)) => void);
|
|
19
22
|
children: JSX.Element;
|
|
20
23
|
}): Text;
|
|
21
24
|
declare type DynamicProps<T> = T & {
|
|
@@ -33,7 +33,7 @@ export declare function ssrStyle(value: {
|
|
|
33
33
|
[k: string]: string;
|
|
34
34
|
}): string;
|
|
35
35
|
export declare function ssrSpread(accessor: any): () => string;
|
|
36
|
-
export declare function
|
|
36
|
+
export declare function ssrAttribute(key: string, value: boolean): string;
|
|
37
37
|
export declare function ssrHydrationKey(): string;
|
|
38
38
|
export declare function escape(html: string): string;
|
|
39
39
|
export declare function generateHydrationScript(): string;
|