@solidjs/web 2.0.0-experimental.5 → 2.0.0-experimental.6
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 +19 -50
- package/dist/dev.js +19 -49
- package/dist/server.cjs +114 -110
- package/dist/server.js +112 -111
- package/dist/web.cjs +19 -50
- package/dist/web.js +19 -49
- package/package.json +3 -3
- package/types/client.d.ts +0 -2
- package/types/server.d.ts +0 -1
package/dist/dev.cjs
CHANGED
|
@@ -2,38 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var solidJs = require('solid-js');
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const Properties = /*#__PURE__*/new Set([
|
|
6
|
+
"value", "checked", "selected", "muted"]);
|
|
7
7
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
8
|
-
const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
9
|
-
class: "className",
|
|
10
|
-
formnovalidate: {
|
|
11
|
-
$: "formNoValidate",
|
|
12
|
-
BUTTON: 1,
|
|
13
|
-
INPUT: 1
|
|
14
|
-
},
|
|
15
|
-
ismap: {
|
|
16
|
-
$: "isMap",
|
|
17
|
-
IMG: 1
|
|
18
|
-
},
|
|
19
|
-
nomodule: {
|
|
20
|
-
$: "noModule",
|
|
21
|
-
SCRIPT: 1
|
|
22
|
-
},
|
|
23
|
-
playsinline: {
|
|
24
|
-
$: "playsInline",
|
|
25
|
-
VIDEO: 1
|
|
26
|
-
},
|
|
27
|
-
readonly: {
|
|
28
|
-
$: "readOnly",
|
|
29
|
-
INPUT: 1,
|
|
30
|
-
TEXTAREA: 1
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
function getPropAlias(prop, tagName) {
|
|
34
|
-
const a = PropAliases[prop];
|
|
35
|
-
return typeof a === "object" ? a[tagName] ? a["$"] : undefined : a;
|
|
36
|
-
}
|
|
37
8
|
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"]);
|
|
38
9
|
const SVGElements = /*#__PURE__*/new Set([
|
|
39
10
|
"altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "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",
|
|
@@ -44,7 +15,9 @@ const SVGNamespace = {
|
|
|
44
15
|
xlink: "http://www.w3.org/1999/xlink",
|
|
45
16
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
46
17
|
};
|
|
47
|
-
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", "h1", "h2", "h3", "h4", "h5", "h6"
|
|
18
|
+
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", "h1", "h2", "h3", "h4", "h5", "h6",
|
|
19
|
+
"webview",
|
|
20
|
+
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
48
21
|
|
|
49
22
|
const memo = fn => solidJs.createMemo(() => fn());
|
|
50
23
|
|
|
@@ -154,19 +127,15 @@ function setProperty(node, name, value) {
|
|
|
154
127
|
}
|
|
155
128
|
function setAttribute(node, name, value) {
|
|
156
129
|
if (isHydrating(node)) return;
|
|
157
|
-
if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
|
|
130
|
+
if (value == null || value === false) node.removeAttribute(name);else node.setAttribute(name, value === true ? "" : value);
|
|
158
131
|
}
|
|
159
132
|
function setAttributeNS(node, namespace, name, value) {
|
|
160
133
|
if (isHydrating(node)) return;
|
|
161
134
|
if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
|
|
162
135
|
}
|
|
163
|
-
function setBoolAttribute(node, name, value) {
|
|
164
|
-
if (isHydrating(node)) return;
|
|
165
|
-
value ? node.setAttribute(name, "") : node.removeAttribute(name);
|
|
166
|
-
}
|
|
167
136
|
function className(node, value, isSVG, prev) {
|
|
168
137
|
if (isHydrating(node)) return;
|
|
169
|
-
if (value == null) {
|
|
138
|
+
if (value == null || value === false) {
|
|
170
139
|
prev && node.removeAttribute("class");
|
|
171
140
|
return;
|
|
172
141
|
}
|
|
@@ -223,6 +192,9 @@ function style(node, value, prev) {
|
|
|
223
192
|
}
|
|
224
193
|
for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
|
|
225
194
|
}
|
|
195
|
+
function setStyleProperty(node, name, value) {
|
|
196
|
+
value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
|
|
197
|
+
}
|
|
226
198
|
function spread(node, props = {}, isSVG, skipChildren) {
|
|
227
199
|
const prevProps = {};
|
|
228
200
|
if (!skipChildren) {
|
|
@@ -381,7 +353,7 @@ function flattenClassList(list, result) {
|
|
|
381
353
|
}
|
|
382
354
|
}
|
|
383
355
|
function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
384
|
-
let
|
|
356
|
+
let forceProp;
|
|
385
357
|
if (prop === "style") return style(node, value, prev), value;
|
|
386
358
|
if (prop === "class") return className(node, value, isSVG, prev), value;
|
|
387
359
|
if (value === prev) return prev;
|
|
@@ -402,13 +374,9 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
402
374
|
addEventListener(node, name, value, delegate);
|
|
403
375
|
delegate && delegateEvents([name]);
|
|
404
376
|
}
|
|
405
|
-
} else if (prop.slice(0, 5) === "
|
|
406
|
-
setAttribute(node, prop.slice(5), value);
|
|
407
|
-
} else if (prop.slice(0, 5) === "bool:") {
|
|
408
|
-
setBoolAttribute(node, prop.slice(5), value);
|
|
409
|
-
} else if ((forceProp = prop.slice(0, 5) === "prop:") || ChildProperties.has(prop) || !isSVG && (propAlias = getPropAlias(prop, node.tagName)) || Properties.has(prop)) {
|
|
377
|
+
} else if ((forceProp = prop.slice(0, 5) === "prop:") || ChildProperties.has(prop) || !isSVG && Properties.has(prop)) {
|
|
410
378
|
if (forceProp) prop = prop.slice(5);else if (isHydrating(node)) return value;
|
|
411
|
-
if (prop === "value" && node.nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else node[
|
|
379
|
+
if (prop === "value" && node.nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else node[prop] = value;
|
|
412
380
|
} else {
|
|
413
381
|
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
414
382
|
if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, prop, value);
|
|
@@ -576,8 +544,10 @@ function escape(html) {}
|
|
|
576
544
|
const isServer = false;
|
|
577
545
|
const isDev = true;
|
|
578
546
|
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
579
|
-
function createElement(tagName, isSVG = false) {
|
|
580
|
-
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName
|
|
547
|
+
function createElement(tagName, isSVG = false, is = undefined) {
|
|
548
|
+
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, {
|
|
549
|
+
is
|
|
550
|
+
});
|
|
581
551
|
}
|
|
582
552
|
const hydrate = (...args) => {
|
|
583
553
|
solidJs.enableHydration();
|
|
@@ -632,7 +602,7 @@ function createDynamic(component, props) {
|
|
|
632
602
|
return solidJs.untrack(() => component(props));
|
|
633
603
|
case "string":
|
|
634
604
|
const isSvg = SVGElements.has(component);
|
|
635
|
-
const el = solidJs.sharedConfig.
|
|
605
|
+
const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, isSvg, solidJs.untrack(() => props.is));
|
|
636
606
|
spread(el, props, isSvg);
|
|
637
607
|
return el;
|
|
638
608
|
}
|
|
@@ -714,7 +684,6 @@ exports.getHydrationKey = getHydrationKey;
|
|
|
714
684
|
exports.getNextElement = getNextElement;
|
|
715
685
|
exports.getNextMarker = getNextMarker;
|
|
716
686
|
exports.getNextMatch = getNextMatch;
|
|
717
|
-
exports.getPropAlias = getPropAlias;
|
|
718
687
|
exports.getRequestEvent = voidFn;
|
|
719
688
|
exports.hydrate = hydrate;
|
|
720
689
|
exports.insert = insert;
|
|
@@ -729,8 +698,8 @@ exports.resolveSSRNode = resolveSSRNode;
|
|
|
729
698
|
exports.runHydrationEvents = runHydrationEvents;
|
|
730
699
|
exports.setAttribute = setAttribute;
|
|
731
700
|
exports.setAttributeNS = setAttributeNS;
|
|
732
|
-
exports.setBoolAttribute = setBoolAttribute;
|
|
733
701
|
exports.setProperty = setProperty;
|
|
702
|
+
exports.setStyleProperty = setStyleProperty;
|
|
734
703
|
exports.spread = spread;
|
|
735
704
|
exports.ssr = ssr;
|
|
736
705
|
exports.ssrAttribute = ssrAttribute;
|
package/dist/dev.js
CHANGED
|
@@ -1,38 +1,9 @@
|
|
|
1
1
|
import { createMemo, createRoot, flatten, untrack, createRenderEffect, sharedConfig, enableHydration, $DEVCOMP, omit } from 'solid-js';
|
|
2
2
|
export { ErrorBoundary, For, Match, Show, Suspense, Switch, createComponent, createRenderEffect as effect, getOwner, merge as mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const Properties = /*#__PURE__*/new Set([
|
|
5
|
+
"value", "checked", "selected", "muted"]);
|
|
6
6
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
7
|
-
const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
8
|
-
class: "className",
|
|
9
|
-
formnovalidate: {
|
|
10
|
-
$: "formNoValidate",
|
|
11
|
-
BUTTON: 1,
|
|
12
|
-
INPUT: 1
|
|
13
|
-
},
|
|
14
|
-
ismap: {
|
|
15
|
-
$: "isMap",
|
|
16
|
-
IMG: 1
|
|
17
|
-
},
|
|
18
|
-
nomodule: {
|
|
19
|
-
$: "noModule",
|
|
20
|
-
SCRIPT: 1
|
|
21
|
-
},
|
|
22
|
-
playsinline: {
|
|
23
|
-
$: "playsInline",
|
|
24
|
-
VIDEO: 1
|
|
25
|
-
},
|
|
26
|
-
readonly: {
|
|
27
|
-
$: "readOnly",
|
|
28
|
-
INPUT: 1,
|
|
29
|
-
TEXTAREA: 1
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
function getPropAlias(prop, tagName) {
|
|
33
|
-
const a = PropAliases[prop];
|
|
34
|
-
return typeof a === "object" ? a[tagName] ? a["$"] : undefined : a;
|
|
35
|
-
}
|
|
36
7
|
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"]);
|
|
37
8
|
const SVGElements = /*#__PURE__*/new Set([
|
|
38
9
|
"altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "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",
|
|
@@ -43,7 +14,9 @@ const SVGNamespace = {
|
|
|
43
14
|
xlink: "http://www.w3.org/1999/xlink",
|
|
44
15
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
45
16
|
};
|
|
46
|
-
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", "h1", "h2", "h3", "h4", "h5", "h6"
|
|
17
|
+
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", "h1", "h2", "h3", "h4", "h5", "h6",
|
|
18
|
+
"webview",
|
|
19
|
+
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
47
20
|
|
|
48
21
|
const memo = fn => createMemo(() => fn());
|
|
49
22
|
|
|
@@ -153,19 +126,15 @@ function setProperty(node, name, value) {
|
|
|
153
126
|
}
|
|
154
127
|
function setAttribute(node, name, value) {
|
|
155
128
|
if (isHydrating(node)) return;
|
|
156
|
-
if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
|
|
129
|
+
if (value == null || value === false) node.removeAttribute(name);else node.setAttribute(name, value === true ? "" : value);
|
|
157
130
|
}
|
|
158
131
|
function setAttributeNS(node, namespace, name, value) {
|
|
159
132
|
if (isHydrating(node)) return;
|
|
160
133
|
if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
|
|
161
134
|
}
|
|
162
|
-
function setBoolAttribute(node, name, value) {
|
|
163
|
-
if (isHydrating(node)) return;
|
|
164
|
-
value ? node.setAttribute(name, "") : node.removeAttribute(name);
|
|
165
|
-
}
|
|
166
135
|
function className(node, value, isSVG, prev) {
|
|
167
136
|
if (isHydrating(node)) return;
|
|
168
|
-
if (value == null) {
|
|
137
|
+
if (value == null || value === false) {
|
|
169
138
|
prev && node.removeAttribute("class");
|
|
170
139
|
return;
|
|
171
140
|
}
|
|
@@ -222,6 +191,9 @@ function style(node, value, prev) {
|
|
|
222
191
|
}
|
|
223
192
|
for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
|
|
224
193
|
}
|
|
194
|
+
function setStyleProperty(node, name, value) {
|
|
195
|
+
value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
|
|
196
|
+
}
|
|
225
197
|
function spread(node, props = {}, isSVG, skipChildren) {
|
|
226
198
|
const prevProps = {};
|
|
227
199
|
if (!skipChildren) {
|
|
@@ -380,7 +352,7 @@ function flattenClassList(list, result) {
|
|
|
380
352
|
}
|
|
381
353
|
}
|
|
382
354
|
function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
383
|
-
let
|
|
355
|
+
let forceProp;
|
|
384
356
|
if (prop === "style") return style(node, value, prev), value;
|
|
385
357
|
if (prop === "class") return className(node, value, isSVG, prev), value;
|
|
386
358
|
if (value === prev) return prev;
|
|
@@ -401,13 +373,9 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
401
373
|
addEventListener(node, name, value, delegate);
|
|
402
374
|
delegate && delegateEvents([name]);
|
|
403
375
|
}
|
|
404
|
-
} else if (prop.slice(0, 5) === "
|
|
405
|
-
setAttribute(node, prop.slice(5), value);
|
|
406
|
-
} else if (prop.slice(0, 5) === "bool:") {
|
|
407
|
-
setBoolAttribute(node, prop.slice(5), value);
|
|
408
|
-
} else if ((forceProp = prop.slice(0, 5) === "prop:") || ChildProperties.has(prop) || !isSVG && (propAlias = getPropAlias(prop, node.tagName)) || Properties.has(prop)) {
|
|
376
|
+
} else if ((forceProp = prop.slice(0, 5) === "prop:") || ChildProperties.has(prop) || !isSVG && Properties.has(prop)) {
|
|
409
377
|
if (forceProp) prop = prop.slice(5);else if (isHydrating(node)) return value;
|
|
410
|
-
if (prop === "value" && node.nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else node[
|
|
378
|
+
if (prop === "value" && node.nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else node[prop] = value;
|
|
411
379
|
} else {
|
|
412
380
|
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
413
381
|
if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, prop, value);
|
|
@@ -575,8 +543,10 @@ function escape(html) {}
|
|
|
575
543
|
const isServer = false;
|
|
576
544
|
const isDev = true;
|
|
577
545
|
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
578
|
-
function createElement(tagName, isSVG = false) {
|
|
579
|
-
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName
|
|
546
|
+
function createElement(tagName, isSVG = false, is = undefined) {
|
|
547
|
+
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, {
|
|
548
|
+
is
|
|
549
|
+
});
|
|
580
550
|
}
|
|
581
551
|
const hydrate = (...args) => {
|
|
582
552
|
enableHydration();
|
|
@@ -631,7 +601,7 @@ function createDynamic(component, props) {
|
|
|
631
601
|
return untrack(() => component(props));
|
|
632
602
|
case "string":
|
|
633
603
|
const isSvg = SVGElements.has(component);
|
|
634
|
-
const el = sharedConfig.
|
|
604
|
+
const el = sharedConfig.hydrating ? getNextElement() : createElement(component, isSvg, untrack(() => props.is));
|
|
635
605
|
spread(el, props, isSvg);
|
|
636
606
|
return el;
|
|
637
607
|
}
|
|
@@ -642,4 +612,4 @@ function Dynamic(props) {
|
|
|
642
612
|
return createDynamic(() => props.component, others);
|
|
643
613
|
}
|
|
644
614
|
|
|
645
|
-
export { voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, assign, className, clearDelegatedEvents, createDynamic, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch,
|
|
615
|
+
export { voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, assign, className, clearDelegatedEvents, createDynamic, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, voidFn as getRequestEvent, hydrate, insert, isDev, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrStyle, style, template, use, voidFn as useAssets };
|