solid-js 1.9.11 → 2.0.0-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 +733 -1678
- package/dist/dev.js +598 -1643
- package/dist/server.cjs +769 -703
- package/dist/server.js +682 -670
- package/dist/solid.cjs +699 -1618
- package/dist/solid.js +563 -1582
- package/package.json +7 -151
- package/types/{render → client}/component.d.ts +1 -38
- package/types/client/core.d.ts +65 -0
- package/types/client/flow.d.ts +100 -0
- package/types/client/hydration.d.ts +76 -0
- package/types/index.d.ts +11 -14
- package/types/jsx.d.ts +1508 -1633
- package/types/server/component.d.ts +66 -0
- package/types/server/core.d.ts +44 -0
- package/types/server/flow.d.ts +60 -0
- package/types/server/hydration.d.ts +21 -0
- package/types/server/index.d.ts +12 -3
- package/types/server/shared.d.ts +45 -0
- package/types/server/signals.d.ts +60 -0
- package/h/dist/h.cjs +0 -115
- package/h/dist/h.js +0 -113
- package/h/jsx-dev-runtime/package.json +0 -8
- package/h/jsx-runtime/dist/jsx.cjs +0 -15
- package/h/jsx-runtime/dist/jsx.js +0 -10
- package/h/jsx-runtime/package.json +0 -8
- package/h/jsx-runtime/types/index.d.ts +0 -11
- package/h/jsx-runtime/types/jsx.d.ts +0 -4242
- package/h/package.json +0 -8
- package/h/types/hyperscript.d.ts +0 -20
- package/h/types/index.d.ts +0 -3
- package/html/dist/html.cjs +0 -583
- package/html/dist/html.js +0 -581
- package/html/package.json +0 -8
- package/html/types/index.d.ts +0 -3
- package/html/types/lit.d.ts +0 -41
- package/store/dist/dev.cjs +0 -458
- package/store/dist/dev.js +0 -449
- package/store/dist/server.cjs +0 -126
- package/store/dist/server.js +0 -114
- package/store/dist/store.cjs +0 -438
- package/store/dist/store.js +0 -429
- package/store/package.json +0 -46
- package/store/types/index.d.ts +0 -12
- package/store/types/modifiers.d.ts +0 -6
- package/store/types/mutable.d.ts +0 -5
- package/store/types/server.d.ts +0 -17
- package/store/types/store.d.ts +0 -107
- package/types/reactive/array.d.ts +0 -44
- package/types/reactive/observable.d.ts +0 -36
- package/types/reactive/scheduler.d.ts +0 -10
- package/types/reactive/signal.d.ts +0 -577
- package/types/render/Suspense.d.ts +0 -26
- package/types/render/flow.d.ts +0 -118
- package/types/render/hydration.d.ts +0 -24
- package/types/render/index.d.ts +0 -4
- package/types/server/reactive.d.ts +0 -98
- package/types/server/rendering.d.ts +0 -159
- package/universal/dist/dev.cjs +0 -245
- package/universal/dist/dev.js +0 -243
- package/universal/dist/universal.cjs +0 -245
- package/universal/dist/universal.js +0 -243
- package/universal/package.json +0 -20
- package/universal/types/index.d.ts +0 -3
- package/universal/types/universal.d.ts +0 -30
- package/web/dist/dev.cjs +0 -894
- package/web/dist/dev.js +0 -782
- package/web/dist/server.cjs +0 -892
- package/web/dist/server.js +0 -782
- package/web/dist/web.cjs +0 -883
- package/web/dist/web.js +0 -771
- package/web/package.json +0 -46
- package/web/storage/dist/storage.cjs +0 -12
- package/web/storage/dist/storage.js +0 -10
- package/web/storage/package.json +0 -15
- package/web/storage/types/index.d.ts +0 -2
- package/web/types/client.d.ts +0 -79
- package/web/types/core.d.ts +0 -2
- package/web/types/index.d.ts +0 -50
- package/web/types/jsx.d.ts +0 -1
- package/web/types/server-mock.d.ts +0 -65
- package/web/types/server.d.ts +0 -177
package/web/dist/web.cjs
DELETED
|
@@ -1,883 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var solidJs = require('solid-js');
|
|
4
|
-
|
|
5
|
-
const booleans = ["allowfullscreen", "async", "alpha",
|
|
6
|
-
"autofocus",
|
|
7
|
-
"autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden",
|
|
8
|
-
"indeterminate", "inert",
|
|
9
|
-
"ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless",
|
|
10
|
-
"selected", "adauctionheaders",
|
|
11
|
-
"browsingtopics",
|
|
12
|
-
"credentialless",
|
|
13
|
-
"defaultchecked", "defaultmuted", "defaultselected", "defer", "disablepictureinpicture", "disableremoteplayback", "preservespitch",
|
|
14
|
-
"shadowrootclonable", "shadowrootcustomelementregistry",
|
|
15
|
-
"shadowrootdelegatesfocus", "shadowrootserializable",
|
|
16
|
-
"sharedstoragewritable"
|
|
17
|
-
];
|
|
18
|
-
const Properties = /*#__PURE__*/new Set([
|
|
19
|
-
"className", "value",
|
|
20
|
-
"readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", "adAuctionHeaders",
|
|
21
|
-
"allowFullscreen", "browsingTopics",
|
|
22
|
-
"defaultChecked", "defaultMuted", "defaultSelected", "disablePictureInPicture", "disableRemotePlayback", "preservesPitch", "shadowRootClonable", "shadowRootCustomElementRegistry",
|
|
23
|
-
"shadowRootDelegatesFocus", "shadowRootSerializable",
|
|
24
|
-
"sharedStorageWritable",
|
|
25
|
-
...booleans]);
|
|
26
|
-
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
27
|
-
const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
28
|
-
className: "class",
|
|
29
|
-
htmlFor: "for"
|
|
30
|
-
});
|
|
31
|
-
const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
32
|
-
class: "className",
|
|
33
|
-
novalidate: {
|
|
34
|
-
$: "noValidate",
|
|
35
|
-
FORM: 1
|
|
36
|
-
},
|
|
37
|
-
formnovalidate: {
|
|
38
|
-
$: "formNoValidate",
|
|
39
|
-
BUTTON: 1,
|
|
40
|
-
INPUT: 1
|
|
41
|
-
},
|
|
42
|
-
ismap: {
|
|
43
|
-
$: "isMap",
|
|
44
|
-
IMG: 1
|
|
45
|
-
},
|
|
46
|
-
nomodule: {
|
|
47
|
-
$: "noModule",
|
|
48
|
-
SCRIPT: 1
|
|
49
|
-
},
|
|
50
|
-
playsinline: {
|
|
51
|
-
$: "playsInline",
|
|
52
|
-
VIDEO: 1
|
|
53
|
-
},
|
|
54
|
-
readonly: {
|
|
55
|
-
$: "readOnly",
|
|
56
|
-
INPUT: 1,
|
|
57
|
-
TEXTAREA: 1
|
|
58
|
-
},
|
|
59
|
-
adauctionheaders: {
|
|
60
|
-
$: "adAuctionHeaders",
|
|
61
|
-
IFRAME: 1
|
|
62
|
-
},
|
|
63
|
-
allowfullscreen: {
|
|
64
|
-
$: "allowFullscreen",
|
|
65
|
-
IFRAME: 1
|
|
66
|
-
},
|
|
67
|
-
browsingtopics: {
|
|
68
|
-
$: "browsingTopics",
|
|
69
|
-
IMG: 1
|
|
70
|
-
},
|
|
71
|
-
defaultchecked: {
|
|
72
|
-
$: "defaultChecked",
|
|
73
|
-
INPUT: 1
|
|
74
|
-
},
|
|
75
|
-
defaultmuted: {
|
|
76
|
-
$: "defaultMuted",
|
|
77
|
-
AUDIO: 1,
|
|
78
|
-
VIDEO: 1
|
|
79
|
-
},
|
|
80
|
-
defaultselected: {
|
|
81
|
-
$: "defaultSelected",
|
|
82
|
-
OPTION: 1
|
|
83
|
-
},
|
|
84
|
-
disablepictureinpicture: {
|
|
85
|
-
$: "disablePictureInPicture",
|
|
86
|
-
VIDEO: 1
|
|
87
|
-
},
|
|
88
|
-
disableremoteplayback: {
|
|
89
|
-
$: "disableRemotePlayback",
|
|
90
|
-
AUDIO: 1,
|
|
91
|
-
VIDEO: 1
|
|
92
|
-
},
|
|
93
|
-
preservespitch: {
|
|
94
|
-
$: "preservesPitch",
|
|
95
|
-
AUDIO: 1,
|
|
96
|
-
VIDEO: 1
|
|
97
|
-
},
|
|
98
|
-
shadowrootclonable: {
|
|
99
|
-
$: "shadowRootClonable",
|
|
100
|
-
TEMPLATE: 1
|
|
101
|
-
},
|
|
102
|
-
shadowrootdelegatesfocus: {
|
|
103
|
-
$: "shadowRootDelegatesFocus",
|
|
104
|
-
TEMPLATE: 1
|
|
105
|
-
},
|
|
106
|
-
shadowrootserializable: {
|
|
107
|
-
$: "shadowRootSerializable",
|
|
108
|
-
TEMPLATE: 1
|
|
109
|
-
},
|
|
110
|
-
sharedstoragewritable: {
|
|
111
|
-
$: "sharedStorageWritable",
|
|
112
|
-
IFRAME: 1,
|
|
113
|
-
IMG: 1
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
function getPropAlias(prop, tagName) {
|
|
117
|
-
const a = PropAliases[prop];
|
|
118
|
-
return typeof a === "object" ? a[tagName] ? a["$"] : undefined : a;
|
|
119
|
-
}
|
|
120
|
-
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"]);
|
|
121
|
-
const SVGElements = /*#__PURE__*/new Set([
|
|
122
|
-
"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",
|
|
123
|
-
"set", "stop",
|
|
124
|
-
"svg", "switch", "symbol", "text", "textPath",
|
|
125
|
-
"tref", "tspan", "use", "view", "vkern"]);
|
|
126
|
-
const SVGNamespace = {
|
|
127
|
-
xlink: "http://www.w3.org/1999/xlink",
|
|
128
|
-
xml: "http://www.w3.org/XML/1998/namespace"
|
|
129
|
-
};
|
|
130
|
-
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",
|
|
131
|
-
"webview",
|
|
132
|
-
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
133
|
-
|
|
134
|
-
const memo = fn => solidJs.createMemo(() => fn());
|
|
135
|
-
|
|
136
|
-
function reconcileArrays(parentNode, a, b) {
|
|
137
|
-
let bLength = b.length,
|
|
138
|
-
aEnd = a.length,
|
|
139
|
-
bEnd = bLength,
|
|
140
|
-
aStart = 0,
|
|
141
|
-
bStart = 0,
|
|
142
|
-
after = a[aEnd - 1].nextSibling,
|
|
143
|
-
map = null;
|
|
144
|
-
while (aStart < aEnd || bStart < bEnd) {
|
|
145
|
-
if (a[aStart] === b[bStart]) {
|
|
146
|
-
aStart++;
|
|
147
|
-
bStart++;
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
while (a[aEnd - 1] === b[bEnd - 1]) {
|
|
151
|
-
aEnd--;
|
|
152
|
-
bEnd--;
|
|
153
|
-
}
|
|
154
|
-
if (aEnd === aStart) {
|
|
155
|
-
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
156
|
-
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
157
|
-
} else if (bEnd === bStart) {
|
|
158
|
-
while (aStart < aEnd) {
|
|
159
|
-
if (!map || !map.has(a[aStart])) a[aStart].remove();
|
|
160
|
-
aStart++;
|
|
161
|
-
}
|
|
162
|
-
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
163
|
-
const node = a[--aEnd].nextSibling;
|
|
164
|
-
parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
|
|
165
|
-
parentNode.insertBefore(b[--bEnd], node);
|
|
166
|
-
a[aEnd] = b[bEnd];
|
|
167
|
-
} else {
|
|
168
|
-
if (!map) {
|
|
169
|
-
map = new Map();
|
|
170
|
-
let i = bStart;
|
|
171
|
-
while (i < bEnd) map.set(b[i], i++);
|
|
172
|
-
}
|
|
173
|
-
const index = map.get(a[aStart]);
|
|
174
|
-
if (index != null) {
|
|
175
|
-
if (bStart < index && index < bEnd) {
|
|
176
|
-
let i = aStart,
|
|
177
|
-
sequence = 1,
|
|
178
|
-
t;
|
|
179
|
-
while (++i < aEnd && i < bEnd) {
|
|
180
|
-
if ((t = map.get(a[i])) == null || t !== index + sequence) break;
|
|
181
|
-
sequence++;
|
|
182
|
-
}
|
|
183
|
-
if (sequence > index - bStart) {
|
|
184
|
-
const node = a[aStart];
|
|
185
|
-
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
186
|
-
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
187
|
-
} else aStart++;
|
|
188
|
-
} else a[aStart++].remove();
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const $$EVENTS = "_$DX_DELEGATE";
|
|
194
|
-
function render(code, element, init, options = {}) {
|
|
195
|
-
let disposer;
|
|
196
|
-
solidJs.createRoot(dispose => {
|
|
197
|
-
disposer = dispose;
|
|
198
|
-
element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
|
|
199
|
-
}, options.owner);
|
|
200
|
-
return () => {
|
|
201
|
-
disposer();
|
|
202
|
-
element.textContent = "";
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
function template(html, isImportNode, isSVG, isMathML) {
|
|
206
|
-
let node;
|
|
207
|
-
const create = () => {
|
|
208
|
-
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
209
|
-
t.innerHTML = html;
|
|
210
|
-
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
211
|
-
};
|
|
212
|
-
const fn = isImportNode ? () => solidJs.untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
213
|
-
fn.cloneNode = fn;
|
|
214
|
-
return fn;
|
|
215
|
-
}
|
|
216
|
-
function delegateEvents(eventNames, document = window.document) {
|
|
217
|
-
const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());
|
|
218
|
-
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
219
|
-
const name = eventNames[i];
|
|
220
|
-
if (!e.has(name)) {
|
|
221
|
-
e.add(name);
|
|
222
|
-
document.addEventListener(name, eventHandler);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
function clearDelegatedEvents(document = window.document) {
|
|
227
|
-
if (document[$$EVENTS]) {
|
|
228
|
-
for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);
|
|
229
|
-
delete document[$$EVENTS];
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
function setProperty(node, name, value) {
|
|
233
|
-
if (isHydrating(node)) return;
|
|
234
|
-
node[name] = value;
|
|
235
|
-
}
|
|
236
|
-
function setAttribute(node, name, value) {
|
|
237
|
-
if (isHydrating(node)) return;
|
|
238
|
-
if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
|
|
239
|
-
}
|
|
240
|
-
function setAttributeNS(node, namespace, name, value) {
|
|
241
|
-
if (isHydrating(node)) return;
|
|
242
|
-
if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
|
|
243
|
-
}
|
|
244
|
-
function setBoolAttribute(node, name, value) {
|
|
245
|
-
if (isHydrating(node)) return;
|
|
246
|
-
value ? node.setAttribute(name, "") : node.removeAttribute(name);
|
|
247
|
-
}
|
|
248
|
-
function className(node, value) {
|
|
249
|
-
if (isHydrating(node)) return;
|
|
250
|
-
if (value == null) node.removeAttribute("class");else node.className = value;
|
|
251
|
-
}
|
|
252
|
-
function addEventListener(node, name, handler, delegate) {
|
|
253
|
-
if (delegate) {
|
|
254
|
-
if (Array.isArray(handler)) {
|
|
255
|
-
node[`$$${name}`] = handler[0];
|
|
256
|
-
node[`$$${name}Data`] = handler[1];
|
|
257
|
-
} else node[`$$${name}`] = handler;
|
|
258
|
-
} else if (Array.isArray(handler)) {
|
|
259
|
-
const handlerFn = handler[0];
|
|
260
|
-
node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
|
|
261
|
-
} else node.addEventListener(name, handler, typeof handler !== "function" && handler);
|
|
262
|
-
}
|
|
263
|
-
function classList(node, value, prev = {}) {
|
|
264
|
-
const classKeys = Object.keys(value || {}),
|
|
265
|
-
prevKeys = Object.keys(prev);
|
|
266
|
-
let i, len;
|
|
267
|
-
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
268
|
-
const key = prevKeys[i];
|
|
269
|
-
if (!key || key === "undefined" || value[key]) continue;
|
|
270
|
-
toggleClassKey(node, key, false);
|
|
271
|
-
delete prev[key];
|
|
272
|
-
}
|
|
273
|
-
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
274
|
-
const key = classKeys[i],
|
|
275
|
-
classValue = !!value[key];
|
|
276
|
-
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
277
|
-
toggleClassKey(node, key, true);
|
|
278
|
-
prev[key] = classValue;
|
|
279
|
-
}
|
|
280
|
-
return prev;
|
|
281
|
-
}
|
|
282
|
-
function style(node, value, prev) {
|
|
283
|
-
if (!value) return prev ? setAttribute(node, "style") : value;
|
|
284
|
-
const nodeStyle = node.style;
|
|
285
|
-
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
286
|
-
typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
|
|
287
|
-
prev || (prev = {});
|
|
288
|
-
value || (value = {});
|
|
289
|
-
let v, s;
|
|
290
|
-
for (s in prev) {
|
|
291
|
-
value[s] == null && nodeStyle.removeProperty(s);
|
|
292
|
-
delete prev[s];
|
|
293
|
-
}
|
|
294
|
-
for (s in value) {
|
|
295
|
-
v = value[s];
|
|
296
|
-
if (v !== prev[s]) {
|
|
297
|
-
nodeStyle.setProperty(s, v);
|
|
298
|
-
prev[s] = v;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return prev;
|
|
302
|
-
}
|
|
303
|
-
function setStyleProperty(node, name, value) {
|
|
304
|
-
value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
|
|
305
|
-
}
|
|
306
|
-
function spread(node, props = {}, isSVG, skipChildren) {
|
|
307
|
-
const prevProps = {};
|
|
308
|
-
if (!skipChildren) {
|
|
309
|
-
solidJs.createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
310
|
-
}
|
|
311
|
-
solidJs.createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
|
|
312
|
-
solidJs.createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
313
|
-
return prevProps;
|
|
314
|
-
}
|
|
315
|
-
function dynamicProperty(props, key) {
|
|
316
|
-
const src = props[key];
|
|
317
|
-
Object.defineProperty(props, key, {
|
|
318
|
-
get() {
|
|
319
|
-
return src();
|
|
320
|
-
},
|
|
321
|
-
enumerable: true
|
|
322
|
-
});
|
|
323
|
-
return props;
|
|
324
|
-
}
|
|
325
|
-
function use(fn, element, arg) {
|
|
326
|
-
return solidJs.untrack(() => fn(element, arg));
|
|
327
|
-
}
|
|
328
|
-
function insert(parent, accessor, marker, initial) {
|
|
329
|
-
if (marker !== undefined && !initial) initial = [];
|
|
330
|
-
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
331
|
-
solidJs.createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);
|
|
332
|
-
}
|
|
333
|
-
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
334
|
-
props || (props = {});
|
|
335
|
-
for (const prop in prevProps) {
|
|
336
|
-
if (!(prop in props)) {
|
|
337
|
-
if (prop === "children") continue;
|
|
338
|
-
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
for (const prop in props) {
|
|
342
|
-
if (prop === "children") {
|
|
343
|
-
if (!skipChildren) insertExpression(node, props.children);
|
|
344
|
-
continue;
|
|
345
|
-
}
|
|
346
|
-
const value = props[prop];
|
|
347
|
-
prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
function hydrate$1(code, element, options = {}) {
|
|
351
|
-
if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options);
|
|
352
|
-
solidJs.sharedConfig.completed = globalThis._$HY.completed;
|
|
353
|
-
solidJs.sharedConfig.events = globalThis._$HY.events;
|
|
354
|
-
solidJs.sharedConfig.load = id => globalThis._$HY.r[id];
|
|
355
|
-
solidJs.sharedConfig.has = id => id in globalThis._$HY.r;
|
|
356
|
-
solidJs.sharedConfig.gather = root => gatherHydratable(element, root);
|
|
357
|
-
solidJs.sharedConfig.registry = new Map();
|
|
358
|
-
solidJs.sharedConfig.context = {
|
|
359
|
-
id: options.renderId || "",
|
|
360
|
-
count: 0
|
|
361
|
-
};
|
|
362
|
-
try {
|
|
363
|
-
gatherHydratable(element, options.renderId);
|
|
364
|
-
return render(code, element, [...element.childNodes], options);
|
|
365
|
-
} finally {
|
|
366
|
-
solidJs.sharedConfig.context = null;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
function getNextElement(template) {
|
|
370
|
-
let node,
|
|
371
|
-
key,
|
|
372
|
-
hydrating = isHydrating();
|
|
373
|
-
if (!hydrating || !(node = solidJs.sharedConfig.registry.get(key = getHydrationKey()))) {
|
|
374
|
-
return template();
|
|
375
|
-
}
|
|
376
|
-
if (solidJs.sharedConfig.completed) solidJs.sharedConfig.completed.add(node);
|
|
377
|
-
solidJs.sharedConfig.registry.delete(key);
|
|
378
|
-
return node;
|
|
379
|
-
}
|
|
380
|
-
function getNextMatch(el, nodeName) {
|
|
381
|
-
while (el && el.localName !== nodeName) el = el.nextSibling;
|
|
382
|
-
return el;
|
|
383
|
-
}
|
|
384
|
-
function getNextMarker(start) {
|
|
385
|
-
let end = start,
|
|
386
|
-
count = 0,
|
|
387
|
-
current = [];
|
|
388
|
-
if (isHydrating(start)) {
|
|
389
|
-
while (end) {
|
|
390
|
-
if (end.nodeType === 8) {
|
|
391
|
-
const v = end.nodeValue;
|
|
392
|
-
if (v === "$") count++;else if (v === "/") {
|
|
393
|
-
if (count === 0) return [end, current];
|
|
394
|
-
count--;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
current.push(end);
|
|
398
|
-
end = end.nextSibling;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
return [end, current];
|
|
402
|
-
}
|
|
403
|
-
function runHydrationEvents() {
|
|
404
|
-
if (solidJs.sharedConfig.events && !solidJs.sharedConfig.events.queued) {
|
|
405
|
-
queueMicrotask(() => {
|
|
406
|
-
const {
|
|
407
|
-
completed,
|
|
408
|
-
events
|
|
409
|
-
} = solidJs.sharedConfig;
|
|
410
|
-
if (!events) return;
|
|
411
|
-
events.queued = false;
|
|
412
|
-
while (events.length) {
|
|
413
|
-
const [el, e] = events[0];
|
|
414
|
-
if (!completed.has(el)) return;
|
|
415
|
-
events.shift();
|
|
416
|
-
eventHandler(e);
|
|
417
|
-
}
|
|
418
|
-
if (solidJs.sharedConfig.done) {
|
|
419
|
-
solidJs.sharedConfig.events = _$HY.events = null;
|
|
420
|
-
solidJs.sharedConfig.completed = _$HY.completed = null;
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
solidJs.sharedConfig.events.queued = true;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
function isHydrating(node) {
|
|
427
|
-
return !!solidJs.sharedConfig.context && !solidJs.sharedConfig.done && (!node || node.isConnected);
|
|
428
|
-
}
|
|
429
|
-
function toPropertyName(name) {
|
|
430
|
-
return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
|
|
431
|
-
}
|
|
432
|
-
function toggleClassKey(node, key, value) {
|
|
433
|
-
const classNames = key.trim().split(/\s+/);
|
|
434
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
|
|
435
|
-
}
|
|
436
|
-
function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
|
|
437
|
-
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
438
|
-
if (prop === "style") return style(node, value, prev);
|
|
439
|
-
if (prop === "classList") return classList(node, value, prev);
|
|
440
|
-
if (value === prev) return prev;
|
|
441
|
-
if (prop === "ref") {
|
|
442
|
-
if (!skipRef) value(node);
|
|
443
|
-
} else if (prop.slice(0, 3) === "on:") {
|
|
444
|
-
const e = prop.slice(3);
|
|
445
|
-
prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
|
|
446
|
-
value && node.addEventListener(e, value, typeof value !== "function" && value);
|
|
447
|
-
} else if (prop.slice(0, 10) === "oncapture:") {
|
|
448
|
-
const e = prop.slice(10);
|
|
449
|
-
prev && node.removeEventListener(e, prev, true);
|
|
450
|
-
value && node.addEventListener(e, value, true);
|
|
451
|
-
} else if (prop.slice(0, 2) === "on") {
|
|
452
|
-
const name = prop.slice(2).toLowerCase();
|
|
453
|
-
const delegate = DelegatedEvents.has(name);
|
|
454
|
-
if (!delegate && prev) {
|
|
455
|
-
const h = Array.isArray(prev) ? prev[0] : prev;
|
|
456
|
-
node.removeEventListener(name, h);
|
|
457
|
-
}
|
|
458
|
-
if (delegate || value) {
|
|
459
|
-
addEventListener(node, name, value, delegate);
|
|
460
|
-
delegate && delegateEvents([name]);
|
|
461
|
-
}
|
|
462
|
-
} else if (prop.slice(0, 5) === "attr:") {
|
|
463
|
-
setAttribute(node, prop.slice(5), value);
|
|
464
|
-
} else if (prop.slice(0, 5) === "bool:") {
|
|
465
|
-
setBoolAttribute(node, prop.slice(5), value);
|
|
466
|
-
} else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) {
|
|
467
|
-
if (forceProp) {
|
|
468
|
-
prop = prop.slice(5);
|
|
469
|
-
isProp = true;
|
|
470
|
-
} else if (isHydrating(node)) return value;
|
|
471
|
-
if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[propAlias || prop] = value;
|
|
472
|
-
} else {
|
|
473
|
-
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
474
|
-
if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, Aliases[prop] || prop, value);
|
|
475
|
-
}
|
|
476
|
-
return value;
|
|
477
|
-
}
|
|
478
|
-
function eventHandler(e) {
|
|
479
|
-
if (solidJs.sharedConfig.registry && solidJs.sharedConfig.events) {
|
|
480
|
-
if (solidJs.sharedConfig.events.find(([el, ev]) => ev === e)) return;
|
|
481
|
-
}
|
|
482
|
-
let node = e.target;
|
|
483
|
-
const key = `$$${e.type}`;
|
|
484
|
-
const oriTarget = e.target;
|
|
485
|
-
const oriCurrentTarget = e.currentTarget;
|
|
486
|
-
const retarget = value => Object.defineProperty(e, "target", {
|
|
487
|
-
configurable: true,
|
|
488
|
-
value
|
|
489
|
-
});
|
|
490
|
-
const handleNode = () => {
|
|
491
|
-
const handler = node[key];
|
|
492
|
-
if (handler && !node.disabled) {
|
|
493
|
-
const data = node[`${key}Data`];
|
|
494
|
-
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
495
|
-
if (e.cancelBubble) return;
|
|
496
|
-
}
|
|
497
|
-
node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
|
|
498
|
-
return true;
|
|
499
|
-
};
|
|
500
|
-
const walkUpTree = () => {
|
|
501
|
-
while (handleNode() && (node = node._$host || node.parentNode || node.host));
|
|
502
|
-
};
|
|
503
|
-
Object.defineProperty(e, "currentTarget", {
|
|
504
|
-
configurable: true,
|
|
505
|
-
get() {
|
|
506
|
-
return node || document;
|
|
507
|
-
}
|
|
508
|
-
});
|
|
509
|
-
if (solidJs.sharedConfig.registry && !solidJs.sharedConfig.done) solidJs.sharedConfig.done = _$HY.done = true;
|
|
510
|
-
if (e.composedPath) {
|
|
511
|
-
const path = e.composedPath();
|
|
512
|
-
retarget(path[0]);
|
|
513
|
-
for (let i = 0; i < path.length - 2; i++) {
|
|
514
|
-
node = path[i];
|
|
515
|
-
if (!handleNode()) break;
|
|
516
|
-
if (node._$host) {
|
|
517
|
-
node = node._$host;
|
|
518
|
-
walkUpTree();
|
|
519
|
-
break;
|
|
520
|
-
}
|
|
521
|
-
if (node.parentNode === oriCurrentTarget) {
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
else walkUpTree();
|
|
527
|
-
retarget(oriTarget);
|
|
528
|
-
}
|
|
529
|
-
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
530
|
-
const hydrating = isHydrating(parent);
|
|
531
|
-
if (hydrating) {
|
|
532
|
-
!current && (current = [...parent.childNodes]);
|
|
533
|
-
let cleaned = [];
|
|
534
|
-
for (let i = 0; i < current.length; i++) {
|
|
535
|
-
const node = current[i];
|
|
536
|
-
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();else cleaned.push(node);
|
|
537
|
-
}
|
|
538
|
-
current = cleaned;
|
|
539
|
-
}
|
|
540
|
-
while (typeof current === "function") current = current();
|
|
541
|
-
if (value === current) return current;
|
|
542
|
-
const t = typeof value,
|
|
543
|
-
multi = marker !== undefined;
|
|
544
|
-
parent = multi && current[0] && current[0].parentNode || parent;
|
|
545
|
-
if (t === "string" || t === "number") {
|
|
546
|
-
if (hydrating) return current;
|
|
547
|
-
if (t === "number") {
|
|
548
|
-
value = value.toString();
|
|
549
|
-
if (value === current) return current;
|
|
550
|
-
}
|
|
551
|
-
if (multi) {
|
|
552
|
-
let node = current[0];
|
|
553
|
-
if (node && node.nodeType === 3) {
|
|
554
|
-
node.data !== value && (node.data = value);
|
|
555
|
-
} else node = document.createTextNode(value);
|
|
556
|
-
current = cleanChildren(parent, current, marker, node);
|
|
557
|
-
} else {
|
|
558
|
-
if (current !== "" && typeof current === "string") {
|
|
559
|
-
current = parent.firstChild.data = value;
|
|
560
|
-
} else current = parent.textContent = value;
|
|
561
|
-
}
|
|
562
|
-
} else if (value == null || t === "boolean") {
|
|
563
|
-
if (hydrating) return current;
|
|
564
|
-
current = cleanChildren(parent, current, marker);
|
|
565
|
-
} else if (t === "function") {
|
|
566
|
-
solidJs.createRenderEffect(() => {
|
|
567
|
-
let v = value();
|
|
568
|
-
while (typeof v === "function") v = v();
|
|
569
|
-
current = insertExpression(parent, v, current, marker);
|
|
570
|
-
});
|
|
571
|
-
return () => current;
|
|
572
|
-
} else if (Array.isArray(value)) {
|
|
573
|
-
const array = [];
|
|
574
|
-
const currentArray = current && Array.isArray(current);
|
|
575
|
-
if (normalizeIncomingArray(array, value, current, unwrapArray)) {
|
|
576
|
-
solidJs.createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
577
|
-
return () => current;
|
|
578
|
-
}
|
|
579
|
-
if (hydrating) {
|
|
580
|
-
if (!array.length) return current;
|
|
581
|
-
if (marker === undefined) return current = [...parent.childNodes];
|
|
582
|
-
let node = array[0];
|
|
583
|
-
if (node.parentNode !== parent) return current;
|
|
584
|
-
const nodes = [node];
|
|
585
|
-
while ((node = node.nextSibling) !== marker) nodes.push(node);
|
|
586
|
-
return current = nodes;
|
|
587
|
-
}
|
|
588
|
-
if (array.length === 0) {
|
|
589
|
-
current = cleanChildren(parent, current, marker);
|
|
590
|
-
if (multi) return current;
|
|
591
|
-
} else if (currentArray) {
|
|
592
|
-
if (current.length === 0) {
|
|
593
|
-
appendNodes(parent, array, marker);
|
|
594
|
-
} else reconcileArrays(parent, current, array);
|
|
595
|
-
} else {
|
|
596
|
-
current && cleanChildren(parent);
|
|
597
|
-
appendNodes(parent, array);
|
|
598
|
-
}
|
|
599
|
-
current = array;
|
|
600
|
-
} else if (value.nodeType) {
|
|
601
|
-
if (hydrating && value.parentNode) return current = multi ? [value] : value;
|
|
602
|
-
if (Array.isArray(current)) {
|
|
603
|
-
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
604
|
-
cleanChildren(parent, current, null, value);
|
|
605
|
-
} else if (current == null || current === "" || !parent.firstChild) {
|
|
606
|
-
parent.appendChild(value);
|
|
607
|
-
} else parent.replaceChild(value, parent.firstChild);
|
|
608
|
-
current = value;
|
|
609
|
-
} else ;
|
|
610
|
-
return current;
|
|
611
|
-
}
|
|
612
|
-
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
613
|
-
let dynamic = false;
|
|
614
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
615
|
-
let item = array[i],
|
|
616
|
-
prev = current && current[normalized.length],
|
|
617
|
-
t;
|
|
618
|
-
if (item == null || item === true || item === false) ; else if ((t = typeof item) === "object" && item.nodeType) {
|
|
619
|
-
normalized.push(item);
|
|
620
|
-
} else if (Array.isArray(item)) {
|
|
621
|
-
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
622
|
-
} else if (t === "function") {
|
|
623
|
-
if (unwrap) {
|
|
624
|
-
while (typeof item === "function") item = item();
|
|
625
|
-
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
626
|
-
} else {
|
|
627
|
-
normalized.push(item);
|
|
628
|
-
dynamic = true;
|
|
629
|
-
}
|
|
630
|
-
} else {
|
|
631
|
-
const value = String(item);
|
|
632
|
-
if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value));
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
return dynamic;
|
|
636
|
-
}
|
|
637
|
-
function appendNodes(parent, array, marker = null) {
|
|
638
|
-
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
639
|
-
}
|
|
640
|
-
function cleanChildren(parent, current, marker, replacement) {
|
|
641
|
-
if (marker === undefined) return parent.textContent = "";
|
|
642
|
-
const node = replacement || document.createTextNode("");
|
|
643
|
-
if (current.length) {
|
|
644
|
-
let inserted = false;
|
|
645
|
-
for (let i = current.length - 1; i >= 0; i--) {
|
|
646
|
-
const el = current[i];
|
|
647
|
-
if (node !== el) {
|
|
648
|
-
const isParent = el.parentNode === parent;
|
|
649
|
-
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
|
|
650
|
-
} else inserted = true;
|
|
651
|
-
}
|
|
652
|
-
} else parent.insertBefore(node, marker);
|
|
653
|
-
return [node];
|
|
654
|
-
}
|
|
655
|
-
function gatherHydratable(element, root) {
|
|
656
|
-
const templates = element.querySelectorAll(`*[data-hk]`);
|
|
657
|
-
for (let i = 0; i < templates.length; i++) {
|
|
658
|
-
const node = templates[i];
|
|
659
|
-
const key = node.getAttribute("data-hk");
|
|
660
|
-
if ((!root || key.startsWith(root)) && !solidJs.sharedConfig.registry.has(key)) solidJs.sharedConfig.registry.set(key, node);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
function getHydrationKey() {
|
|
664
|
-
return solidJs.sharedConfig.getNextContextId();
|
|
665
|
-
}
|
|
666
|
-
function NoHydration(props) {
|
|
667
|
-
return solidJs.sharedConfig.context ? undefined : props.children;
|
|
668
|
-
}
|
|
669
|
-
function Hydration(props) {
|
|
670
|
-
return props.children;
|
|
671
|
-
}
|
|
672
|
-
const voidFn = () => undefined;
|
|
673
|
-
const RequestContext = Symbol();
|
|
674
|
-
function innerHTML(parent, content) {
|
|
675
|
-
!solidJs.sharedConfig.context && (parent.innerHTML = content);
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
function throwInBrowser(func) {
|
|
679
|
-
const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
|
|
680
|
-
console.error(err);
|
|
681
|
-
}
|
|
682
|
-
function renderToString(fn, options) {
|
|
683
|
-
throwInBrowser(renderToString);
|
|
684
|
-
}
|
|
685
|
-
function renderToStringAsync(fn, options) {
|
|
686
|
-
throwInBrowser(renderToStringAsync);
|
|
687
|
-
}
|
|
688
|
-
function renderToStream(fn, options) {
|
|
689
|
-
throwInBrowser(renderToStream);
|
|
690
|
-
}
|
|
691
|
-
function ssr(template, ...nodes) {}
|
|
692
|
-
function ssrElement(name, props, children, needsId) {}
|
|
693
|
-
function ssrClassList(value) {}
|
|
694
|
-
function ssrStyle(value) {}
|
|
695
|
-
function ssrAttribute(key, value) {}
|
|
696
|
-
function ssrHydrationKey() {}
|
|
697
|
-
function resolveSSRNode(node) {}
|
|
698
|
-
function escape(html) {}
|
|
699
|
-
function ssrSpread(props, isSVG, skipChildren) {}
|
|
700
|
-
|
|
701
|
-
const isServer = false;
|
|
702
|
-
const isDev = false;
|
|
703
|
-
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
704
|
-
function createElement(tagName, isSVG = false, is = undefined) {
|
|
705
|
-
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, {
|
|
706
|
-
is
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
const hydrate = (...args) => {
|
|
710
|
-
solidJs.enableHydration();
|
|
711
|
-
return hydrate$1(...args);
|
|
712
|
-
};
|
|
713
|
-
function Portal(props) {
|
|
714
|
-
const {
|
|
715
|
-
useShadow
|
|
716
|
-
} = props,
|
|
717
|
-
marker = document.createTextNode(""),
|
|
718
|
-
mount = () => props.mount || document.body,
|
|
719
|
-
owner = solidJs.getOwner();
|
|
720
|
-
let content;
|
|
721
|
-
let hydrating = !!solidJs.sharedConfig.context;
|
|
722
|
-
solidJs.createEffect(() => {
|
|
723
|
-
if (hydrating) solidJs.getOwner().user = hydrating = false;
|
|
724
|
-
content || (content = solidJs.runWithOwner(owner, () => solidJs.createMemo(() => props.children)));
|
|
725
|
-
const el = mount();
|
|
726
|
-
if (el instanceof HTMLHeadElement) {
|
|
727
|
-
const [clean, setClean] = solidJs.createSignal(false);
|
|
728
|
-
const cleanup = () => setClean(true);
|
|
729
|
-
solidJs.createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null));
|
|
730
|
-
solidJs.onCleanup(cleanup);
|
|
731
|
-
} else {
|
|
732
|
-
const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
|
|
733
|
-
renderRoot = useShadow && container.attachShadow ? container.attachShadow({
|
|
734
|
-
mode: "open"
|
|
735
|
-
}) : container;
|
|
736
|
-
Object.defineProperty(container, "_$host", {
|
|
737
|
-
get() {
|
|
738
|
-
return marker.parentNode;
|
|
739
|
-
},
|
|
740
|
-
configurable: true
|
|
741
|
-
});
|
|
742
|
-
insert(renderRoot, content);
|
|
743
|
-
el.appendChild(container);
|
|
744
|
-
props.ref && props.ref(container);
|
|
745
|
-
solidJs.onCleanup(() => el.removeChild(container));
|
|
746
|
-
}
|
|
747
|
-
}, undefined, {
|
|
748
|
-
render: !hydrating
|
|
749
|
-
});
|
|
750
|
-
return marker;
|
|
751
|
-
}
|
|
752
|
-
function createDynamic(component, props) {
|
|
753
|
-
const cached = solidJs.createMemo(component);
|
|
754
|
-
return solidJs.createMemo(() => {
|
|
755
|
-
const component = cached();
|
|
756
|
-
switch (typeof component) {
|
|
757
|
-
case "function":
|
|
758
|
-
return solidJs.untrack(() => component(props));
|
|
759
|
-
case "string":
|
|
760
|
-
const isSvg = SVGElements.has(component);
|
|
761
|
-
const el = solidJs.sharedConfig.context ? getNextElement() : createElement(component, isSvg, solidJs.untrack(() => props.is));
|
|
762
|
-
spread(el, props, isSvg);
|
|
763
|
-
return el;
|
|
764
|
-
}
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
function Dynamic(props) {
|
|
768
|
-
const [, others] = solidJs.splitProps(props, ["component"]);
|
|
769
|
-
return createDynamic(() => props.component, others);
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
Object.defineProperty(exports, "ErrorBoundary", {
|
|
773
|
-
enumerable: true,
|
|
774
|
-
get: function () { return solidJs.ErrorBoundary; }
|
|
775
|
-
});
|
|
776
|
-
Object.defineProperty(exports, "For", {
|
|
777
|
-
enumerable: true,
|
|
778
|
-
get: function () { return solidJs.For; }
|
|
779
|
-
});
|
|
780
|
-
Object.defineProperty(exports, "Index", {
|
|
781
|
-
enumerable: true,
|
|
782
|
-
get: function () { return solidJs.Index; }
|
|
783
|
-
});
|
|
784
|
-
Object.defineProperty(exports, "Match", {
|
|
785
|
-
enumerable: true,
|
|
786
|
-
get: function () { return solidJs.Match; }
|
|
787
|
-
});
|
|
788
|
-
Object.defineProperty(exports, "Show", {
|
|
789
|
-
enumerable: true,
|
|
790
|
-
get: function () { return solidJs.Show; }
|
|
791
|
-
});
|
|
792
|
-
Object.defineProperty(exports, "Suspense", {
|
|
793
|
-
enumerable: true,
|
|
794
|
-
get: function () { return solidJs.Suspense; }
|
|
795
|
-
});
|
|
796
|
-
Object.defineProperty(exports, "SuspenseList", {
|
|
797
|
-
enumerable: true,
|
|
798
|
-
get: function () { return solidJs.SuspenseList; }
|
|
799
|
-
});
|
|
800
|
-
Object.defineProperty(exports, "Switch", {
|
|
801
|
-
enumerable: true,
|
|
802
|
-
get: function () { return solidJs.Switch; }
|
|
803
|
-
});
|
|
804
|
-
Object.defineProperty(exports, "createComponent", {
|
|
805
|
-
enumerable: true,
|
|
806
|
-
get: function () { return solidJs.createComponent; }
|
|
807
|
-
});
|
|
808
|
-
Object.defineProperty(exports, "effect", {
|
|
809
|
-
enumerable: true,
|
|
810
|
-
get: function () { return solidJs.createRenderEffect; }
|
|
811
|
-
});
|
|
812
|
-
Object.defineProperty(exports, "getOwner", {
|
|
813
|
-
enumerable: true,
|
|
814
|
-
get: function () { return solidJs.getOwner; }
|
|
815
|
-
});
|
|
816
|
-
Object.defineProperty(exports, "mergeProps", {
|
|
817
|
-
enumerable: true,
|
|
818
|
-
get: function () { return solidJs.mergeProps; }
|
|
819
|
-
});
|
|
820
|
-
Object.defineProperty(exports, "untrack", {
|
|
821
|
-
enumerable: true,
|
|
822
|
-
get: function () { return solidJs.untrack; }
|
|
823
|
-
});
|
|
824
|
-
exports.Aliases = Aliases;
|
|
825
|
-
exports.Assets = voidFn;
|
|
826
|
-
exports.ChildProperties = ChildProperties;
|
|
827
|
-
exports.DOMElements = DOMElements;
|
|
828
|
-
exports.DelegatedEvents = DelegatedEvents;
|
|
829
|
-
exports.Dynamic = Dynamic;
|
|
830
|
-
exports.Hydration = Hydration;
|
|
831
|
-
exports.HydrationScript = voidFn;
|
|
832
|
-
exports.NoHydration = NoHydration;
|
|
833
|
-
exports.Portal = Portal;
|
|
834
|
-
exports.Properties = Properties;
|
|
835
|
-
exports.RequestContext = RequestContext;
|
|
836
|
-
exports.SVGElements = SVGElements;
|
|
837
|
-
exports.SVGNamespace = SVGNamespace;
|
|
838
|
-
exports.addEventListener = addEventListener;
|
|
839
|
-
exports.assign = assign;
|
|
840
|
-
exports.classList = classList;
|
|
841
|
-
exports.className = className;
|
|
842
|
-
exports.clearDelegatedEvents = clearDelegatedEvents;
|
|
843
|
-
exports.createDynamic = createDynamic;
|
|
844
|
-
exports.delegateEvents = delegateEvents;
|
|
845
|
-
exports.dynamicProperty = dynamicProperty;
|
|
846
|
-
exports.escape = escape;
|
|
847
|
-
exports.generateHydrationScript = voidFn;
|
|
848
|
-
exports.getAssets = voidFn;
|
|
849
|
-
exports.getHydrationKey = getHydrationKey;
|
|
850
|
-
exports.getNextElement = getNextElement;
|
|
851
|
-
exports.getNextMarker = getNextMarker;
|
|
852
|
-
exports.getNextMatch = getNextMatch;
|
|
853
|
-
exports.getPropAlias = getPropAlias;
|
|
854
|
-
exports.getRequestEvent = voidFn;
|
|
855
|
-
exports.hydrate = hydrate;
|
|
856
|
-
exports.innerHTML = innerHTML;
|
|
857
|
-
exports.insert = insert;
|
|
858
|
-
exports.isDev = isDev;
|
|
859
|
-
exports.isServer = isServer;
|
|
860
|
-
exports.memo = memo;
|
|
861
|
-
exports.render = render;
|
|
862
|
-
exports.renderToStream = renderToStream;
|
|
863
|
-
exports.renderToString = renderToString;
|
|
864
|
-
exports.renderToStringAsync = renderToStringAsync;
|
|
865
|
-
exports.resolveSSRNode = resolveSSRNode;
|
|
866
|
-
exports.runHydrationEvents = runHydrationEvents;
|
|
867
|
-
exports.setAttribute = setAttribute;
|
|
868
|
-
exports.setAttributeNS = setAttributeNS;
|
|
869
|
-
exports.setBoolAttribute = setBoolAttribute;
|
|
870
|
-
exports.setProperty = setProperty;
|
|
871
|
-
exports.setStyleProperty = setStyleProperty;
|
|
872
|
-
exports.spread = spread;
|
|
873
|
-
exports.ssr = ssr;
|
|
874
|
-
exports.ssrAttribute = ssrAttribute;
|
|
875
|
-
exports.ssrClassList = ssrClassList;
|
|
876
|
-
exports.ssrElement = ssrElement;
|
|
877
|
-
exports.ssrHydrationKey = ssrHydrationKey;
|
|
878
|
-
exports.ssrSpread = ssrSpread;
|
|
879
|
-
exports.ssrStyle = ssrStyle;
|
|
880
|
-
exports.style = style;
|
|
881
|
-
exports.template = template;
|
|
882
|
-
exports.use = use;
|
|
883
|
-
exports.useAssets = voidFn;
|