@solidjs/web 2.0.0-beta.2 → 2.0.0-beta.20
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/README.md +27 -4
- package/dist/dev.cjs +783 -223
- package/dist/dev.js +757 -217
- package/dist/server.cjs +742 -186
- package/dist/server.js +714 -183
- package/dist/web.cjs +772 -196
- package/dist/web.js +746 -190
- package/package.json +193 -38
- package/serialization/dist/serialization.cjs +83 -0
- package/serialization/dist/serialization.js +75 -0
- package/serialization/package.json +20 -0
- package/serialization/types/index.d.ts +139 -0
- package/serialization/types-cjs/index.d.cts +139 -0
- package/serialization/types-cjs/package.json +3 -0
- package/server-functions/dist/client.cjs +370 -0
- package/server-functions/dist/client.js +363 -0
- package/server-functions/dist/server.cjs +542 -0
- package/server-functions/dist/server.js +531 -0
- package/server-functions/package.json +30 -0
- package/storage/package.json +8 -3
- package/storage/types/index.d.ts +26 -0
- package/storage/types-cjs/index.d.cts +28 -0
- package/storage/types-cjs/package.json +3 -0
- package/types/client.d.ts +64 -21
- package/types/core.d.ts +3 -3
- package/types/index.d.ts +156 -24
- package/types/jsx-properties.d.ts +93 -0
- package/types/jsx.d.ts +4135 -1
- package/types/response.d.ts +93 -0
- package/types/serializer.d.ts +139 -0
- package/types/server-functions/client.d.ts +63 -0
- package/types/server-functions/server.d.ts +188 -0
- package/types/server-functions/shared.d.ts +171 -0
- package/types/server-mock.d.ts +89 -0
- package/types/server.d.ts +123 -28
- package/types-cjs/client.d.cts +131 -0
- package/types-cjs/core.d.cts +3 -0
- package/types-cjs/index.d.cts +178 -0
- package/types-cjs/jsx-properties.d.cts +93 -0
- package/types-cjs/jsx.d.cts +4135 -0
- package/types-cjs/package.json +3 -0
- package/types-cjs/response.d.cts +93 -0
- package/types-cjs/serializer.d.cts +139 -0
- package/types-cjs/server-functions/client.d.cts +63 -0
- package/types-cjs/server-functions/server.d.cts +188 -0
- package/types-cjs/server-functions/shared.d.cts +171 -0
- package/types-cjs/server-mock.d.cts +161 -0
- package/types-cjs/server.d.cts +251 -0
- package/storage/types/src/client.d.ts +0 -1
- package/storage/types/src/index.d.ts +0 -46
- package/storage/types/src/server-mock.d.ts +0 -72
- package/storage/types/storage/src/index.d.ts +0 -2
package/dist/dev.cjs
CHANGED
|
@@ -1,40 +1,81 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var solidJs = require('solid-js');
|
|
4
|
-
var signals = require('@solidjs/signals');
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const DOMWithState = {
|
|
6
|
+
INPUT: {
|
|
7
|
+
value: 1,
|
|
8
|
+
defaultValue: 2,
|
|
9
|
+
checked: 1,
|
|
10
|
+
defaultChecked: 2
|
|
11
|
+
},
|
|
12
|
+
SELECT: {
|
|
13
|
+
value: 1
|
|
14
|
+
},
|
|
15
|
+
OPTION: {
|
|
16
|
+
value: 1,
|
|
17
|
+
selected: 1,
|
|
18
|
+
defaultSelected: 2
|
|
19
|
+
},
|
|
20
|
+
TEXTAREA: {
|
|
21
|
+
value: 1,
|
|
22
|
+
defaultValue: 2
|
|
23
|
+
},
|
|
24
|
+
VIDEO: {
|
|
25
|
+
muted: 1,
|
|
26
|
+
defaultMuted: 2
|
|
27
|
+
},
|
|
28
|
+
AUDIO: {
|
|
29
|
+
muted: 1,
|
|
30
|
+
defaultMuted: 2
|
|
31
|
+
}
|
|
32
|
+
};
|
|
8
33
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
34
|
+
const $$SLOT = /*#__PURE__*/Symbol("slot");
|
|
35
|
+
const $$HOST = /*#__PURE__*/Symbol("host");
|
|
9
36
|
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"]);
|
|
10
37
|
const SVGElements = /*#__PURE__*/new Set([
|
|
11
38
|
"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",
|
|
12
39
|
"set", "stop",
|
|
13
40
|
"svg", "switch", "symbol", "text", "textPath",
|
|
14
41
|
"tref", "tspan", "use", "view", "vkern"]);
|
|
15
|
-
const
|
|
42
|
+
const MathMLElements = /*#__PURE__*/new Set(["annotation", "annotation-xml", "maction", "math", "menclose", "merror", "mfenced", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics"]);
|
|
43
|
+
const Namespaces = {
|
|
44
|
+
svg: "http://www.w3.org/2000/svg",
|
|
45
|
+
mathml: "http://www.w3.org/1998/Math/MathML",
|
|
16
46
|
xlink: "http://www.w3.org/1999/xlink",
|
|
17
47
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
18
48
|
};
|
|
19
|
-
const
|
|
20
|
-
"
|
|
21
|
-
"isindex
|
|
49
|
+
const VoidElements = /*#__PURE__*/new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
|
|
50
|
+
const RawTextElements = /*#__PURE__*/new Set(["style", "script", "noscript", "template", "textarea", "title"]);
|
|
51
|
+
const DOMElements = /*#__PURE__*/new Set(/*#__PURE__*/"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,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,math,menu,menuitem,meta,meter,multicol,nav,nextid,nobr,noembed,noframes,noindex,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,portal,pre,progress,q,rb,rp,rt,rtc,ruby,s,samp,script,search,section,select,shadow,slot,small,source,spacer,span,strike,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,webview,xmp".split(","));
|
|
22
52
|
|
|
23
|
-
const
|
|
24
|
-
transparent: true
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
53
|
+
const transparentOptions = {
|
|
54
|
+
transparent: true,
|
|
55
|
+
sync: true
|
|
56
|
+
};
|
|
57
|
+
const syncOptions = {
|
|
58
|
+
sync: true
|
|
59
|
+
};
|
|
60
|
+
const effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
|
|
61
|
+
sync: true,
|
|
62
|
+
...options,
|
|
63
|
+
transparent: !options.scope
|
|
64
|
+
} : transparentOptions);
|
|
65
|
+
const memo = fn => solidJs.createMemo(() => fn(), syncOptions);
|
|
29
66
|
|
|
30
|
-
function reconcileArrays(parentNode, a, b) {
|
|
67
|
+
function reconcileArrays(parentNode, a, b, marker) {
|
|
31
68
|
let bLength = b.length,
|
|
32
69
|
aEnd = a.length,
|
|
33
70
|
bEnd = bLength,
|
|
34
71
|
aStart = 0,
|
|
35
72
|
bStart = 0,
|
|
36
|
-
|
|
37
|
-
|
|
73
|
+
tail = a[aEnd - 1],
|
|
74
|
+
tailTag = tail[$$SLOT],
|
|
75
|
+
after = tail.parentNode === parentNode && (!tailTag || tailTag === marker) ? tail.nextSibling : marker || null,
|
|
76
|
+
map = null,
|
|
77
|
+
anchor,
|
|
78
|
+
anchorTag;
|
|
38
79
|
while (aStart < aEnd || bStart < bEnd) {
|
|
39
80
|
if (a[aStart] === b[bStart]) {
|
|
40
81
|
aStart++;
|
|
@@ -46,18 +87,43 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
46
87
|
bEnd--;
|
|
47
88
|
}
|
|
48
89
|
if (aEnd === aStart) {
|
|
49
|
-
|
|
50
|
-
|
|
90
|
+
let node;
|
|
91
|
+
if (bEnd < bLength) {
|
|
92
|
+
if (bStart) {
|
|
93
|
+
const prev = b[bStart - 1];
|
|
94
|
+
const prevTag = prev[$$SLOT];
|
|
95
|
+
node = prev.parentNode === parentNode && (!prevTag || prevTag === marker) ? prev.nextSibling : after;
|
|
96
|
+
} else node = b[bEnd - bStart];
|
|
97
|
+
} else node = after;
|
|
98
|
+
while (bStart < bEnd) {
|
|
99
|
+
const n = b[bStart++];
|
|
100
|
+
parentNode.insertBefore(n, node);
|
|
101
|
+
if (marker) n[$$SLOT] = marker;
|
|
102
|
+
}
|
|
51
103
|
} else if (bEnd === bStart) {
|
|
52
104
|
while (aStart < aEnd) {
|
|
53
|
-
|
|
54
|
-
|
|
105
|
+
const n = a[aStart++];
|
|
106
|
+
if (!map || !map.has(n)) {
|
|
107
|
+
const tag = n[$$SLOT];
|
|
108
|
+
if (n.parentNode === parentNode && (!tag || tag === marker)) n.remove();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} else if ((anchor = a[aStart]) === b[bEnd - 1] && b[bStart] === a[aEnd - 1] && anchor.parentNode === parentNode && (!(anchorTag = anchor[$$SLOT]) || anchorTag === marker)) {
|
|
112
|
+
if (marker) {
|
|
113
|
+
do {
|
|
114
|
+
const n = a[--aEnd];
|
|
115
|
+
parentNode.insertBefore(n, anchor);
|
|
116
|
+
n[$$SLOT] = marker;
|
|
117
|
+
bStart++;
|
|
118
|
+
if (aStart >= aEnd - 1 || bStart >= bEnd) break;
|
|
119
|
+
} while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
|
|
120
|
+
} else {
|
|
121
|
+
do {
|
|
122
|
+
parentNode.insertBefore(a[--aEnd], anchor);
|
|
123
|
+
bStart++;
|
|
124
|
+
if (aStart >= aEnd - 1 || bStart >= bEnd) break;
|
|
125
|
+
} while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
|
|
55
126
|
}
|
|
56
|
-
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
57
|
-
const node = a[--aEnd].nextSibling;
|
|
58
|
-
parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
|
|
59
|
-
parentNode.insertBefore(b[--bEnd], node);
|
|
60
|
-
a[aEnd] = b[bEnd];
|
|
61
127
|
} else {
|
|
62
128
|
if (!map) {
|
|
63
129
|
map = new Map();
|
|
@@ -75,58 +141,141 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
75
141
|
sequence++;
|
|
76
142
|
}
|
|
77
143
|
if (sequence > index - bStart) {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
144
|
+
const head = a[aStart];
|
|
145
|
+
const headTag = head[$$SLOT];
|
|
146
|
+
const node = head.parentNode === parentNode && (!headTag || headTag === marker) ? head : after;
|
|
147
|
+
while (bStart < index) {
|
|
148
|
+
const n = b[bStart++];
|
|
149
|
+
parentNode.insertBefore(n, node);
|
|
150
|
+
if (marker) n[$$SLOT] = marker;
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
const oldNode = a[aStart++];
|
|
154
|
+
const newNode = b[bStart++];
|
|
155
|
+
const oldTag = oldNode[$$SLOT];
|
|
156
|
+
if (oldNode.parentNode === parentNode && (!oldTag || oldTag === marker)) {
|
|
157
|
+
parentNode.replaceChild(newNode, oldNode);
|
|
158
|
+
} else {
|
|
159
|
+
parentNode.insertBefore(newNode, after);
|
|
160
|
+
}
|
|
161
|
+
if (marker) newNode[$$SLOT] = marker;
|
|
162
|
+
}
|
|
81
163
|
} else aStart++;
|
|
82
|
-
} else
|
|
164
|
+
} else {
|
|
165
|
+
const n = a[aStart++];
|
|
166
|
+
const nTag = n[$$SLOT];
|
|
167
|
+
if (n.parentNode === parentNode && (!nTag || nTag === marker)) n.remove();
|
|
168
|
+
}
|
|
83
169
|
}
|
|
84
170
|
}
|
|
85
171
|
}
|
|
86
172
|
|
|
87
|
-
const $$
|
|
173
|
+
const $$EVENT_OWNER = "_$DX_EVENT_OWNER";
|
|
174
|
+
const INNER_OWNED = {};
|
|
175
|
+
const delegatedEvents = new Set();
|
|
176
|
+
const delegatedContainers = new Map();
|
|
88
177
|
function render$1(code, element, init, options = {}) {
|
|
89
178
|
if (!element) {
|
|
90
179
|
throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
|
|
91
180
|
}
|
|
92
181
|
let disposer;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
182
|
+
registerDelegatedRoot(element);
|
|
183
|
+
try {
|
|
184
|
+
solidJs.createRoot(dispose => {
|
|
185
|
+
disposer = dispose;
|
|
186
|
+
if (element === document) {
|
|
187
|
+
const tree = code();
|
|
188
|
+
effect(() => solidJs.flatten(tree), () => {});
|
|
189
|
+
} else {
|
|
190
|
+
const tree = code();
|
|
191
|
+
insert(element, () => tree, element.firstChild ? null : undefined, init, options.insertOptions);
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
id: options.renderId
|
|
195
|
+
});
|
|
196
|
+
} catch (err) {
|
|
197
|
+
if (disposer) disposer();
|
|
198
|
+
unregisterDelegatedRoot(element);
|
|
199
|
+
throw err;
|
|
200
|
+
}
|
|
99
201
|
return () => {
|
|
100
202
|
disposer();
|
|
203
|
+
unregisterDelegatedRoot(element);
|
|
101
204
|
element.textContent = "";
|
|
102
205
|
};
|
|
103
206
|
}
|
|
104
|
-
function
|
|
207
|
+
function create(html, bypassGuard, flag) {
|
|
208
|
+
if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
|
|
209
|
+
const t = document.createElement("template");
|
|
210
|
+
t.innerHTML = html;
|
|
211
|
+
return flag === 2 ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
212
|
+
}
|
|
213
|
+
function template(html, flag) {
|
|
105
214
|
let node;
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
109
|
-
t.innerHTML = html;
|
|
110
|
-
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
111
|
-
};
|
|
112
|
-
const fn = isImportNode ? bypassGuard => solidJs.untrack(() => document.importNode(node || (node = create(bypassGuard)), true)) : bypassGuard => (node || (node = create(bypassGuard))).cloneNode(true);
|
|
113
|
-
fn._html = html;
|
|
215
|
+
const fn = flag === 1 ? bypassGuard => document.importNode(node || (node = create(html, bypassGuard, flag)), true) : bypassGuard => (node || (node = create(html, bypassGuard, flag))).cloneNode(true);
|
|
216
|
+
fn._html = flag === 2 ? html.replace(/^<[^>]+>/, "") : html;
|
|
114
217
|
return fn;
|
|
115
218
|
}
|
|
116
|
-
function delegateEvents(eventNames
|
|
117
|
-
const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());
|
|
219
|
+
function delegateEvents(eventNames) {
|
|
118
220
|
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
119
221
|
const name = eventNames[i];
|
|
120
|
-
if (!
|
|
121
|
-
|
|
122
|
-
|
|
222
|
+
if (!delegatedEvents.has(name)) {
|
|
223
|
+
delegatedEvents.add(name);
|
|
224
|
+
delegatedContainers.forEach((state, container) => attachDelegatedEvent(name, container, state));
|
|
123
225
|
}
|
|
124
226
|
}
|
|
125
227
|
}
|
|
126
|
-
function
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
228
|
+
function registerDelegatedRoot(root) {
|
|
229
|
+
const state = registerDelegatedContainer(root, root);
|
|
230
|
+
if (state) state.roots = (state.roots || 0) + 1;
|
|
231
|
+
}
|
|
232
|
+
function unregisterDelegatedRoot(root) {
|
|
233
|
+
const state = delegatedContainers.get(root);
|
|
234
|
+
if (state) state.roots > 1 ? state.roots-- : delete state.roots;
|
|
235
|
+
unregisterDelegatedContainer(root, root);
|
|
236
|
+
}
|
|
237
|
+
function registerDelegatedContainer(container, owner = container) {
|
|
238
|
+
if (!container || !owner) return;
|
|
239
|
+
let state = delegatedContainers.get(container);
|
|
240
|
+
if (!state) delegatedContainers.set(container, state = {
|
|
241
|
+
owners: new Map(),
|
|
242
|
+
handlers: new Map()
|
|
243
|
+
});
|
|
244
|
+
state.owners.set(owner, (state.owners.get(owner) || 0) + 1);
|
|
245
|
+
delegatedEvents.forEach(name => attachDelegatedEvent(name, container, state));
|
|
246
|
+
return state;
|
|
247
|
+
}
|
|
248
|
+
function unregisterDelegatedContainer(container, owner = container) {
|
|
249
|
+
const state = delegatedContainers.get(container);
|
|
250
|
+
if (!state) return;
|
|
251
|
+
const count = state.owners.get(owner);
|
|
252
|
+
if (count > 1) state.owners.set(owner, count - 1);else state.owners.delete(owner);
|
|
253
|
+
if (state.owners.size) return;
|
|
254
|
+
state.handlers.forEach((handler, name) => container.removeEventListener(name, handler));
|
|
255
|
+
delegatedContainers.delete(container);
|
|
256
|
+
}
|
|
257
|
+
function attachDelegatedEvent(name, container, state) {
|
|
258
|
+
if (state.handlers.has(name)) return;
|
|
259
|
+
const handler = e => eventHandler(e, container, state);
|
|
260
|
+
state.handlers.set(name, handler);
|
|
261
|
+
container.addEventListener(name, handler);
|
|
262
|
+
}
|
|
263
|
+
function getDelegatedRoot(node) {
|
|
264
|
+
while (node) {
|
|
265
|
+
if (delegatedContainers.get(node)?.roots) return node;
|
|
266
|
+
node = node._$host || node.parentNode || node.host;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function findOwner(target, state) {
|
|
270
|
+
let node = target;
|
|
271
|
+
let distance = 0;
|
|
272
|
+
while (node) {
|
|
273
|
+
if (state.owners.has(node)) return {
|
|
274
|
+
owner: node,
|
|
275
|
+
distance
|
|
276
|
+
};
|
|
277
|
+
distance++;
|
|
278
|
+
node = node._$host || node.parentNode || node.host;
|
|
130
279
|
}
|
|
131
280
|
}
|
|
132
281
|
function setProperty(node, name, value) {
|
|
@@ -139,16 +288,16 @@ function setAttribute(node, name, value) {
|
|
|
139
288
|
}
|
|
140
289
|
function setAttributeNS(node, namespace, name, value) {
|
|
141
290
|
if (isHydrating(node)) return;
|
|
142
|
-
if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
|
|
291
|
+
if (value == null || value === false) node.removeAttributeNS(namespace, name.indexOf(":") > -1 ? name.split(":").pop() : name);else node.setAttributeNS(namespace, name, value === true ? "" : value);
|
|
143
292
|
}
|
|
144
|
-
function className(node, value,
|
|
293
|
+
function className(node, value, prev) {
|
|
145
294
|
if (isHydrating(node)) return;
|
|
146
295
|
if (value == null || value === false) {
|
|
147
296
|
prev && node.removeAttribute("class");
|
|
148
297
|
return;
|
|
149
298
|
}
|
|
150
299
|
if (typeof value === "string") {
|
|
151
|
-
value !== prev &&
|
|
300
|
+
value !== prev && node.setAttribute("class", value);
|
|
152
301
|
return;
|
|
153
302
|
}
|
|
154
303
|
if (typeof prev === "string") {
|
|
@@ -162,16 +311,16 @@ function className(node, value, isSVG, prev) {
|
|
|
162
311
|
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
163
312
|
const key = prevKeys[i];
|
|
164
313
|
if (!key || key === "undefined" || value[key]) continue;
|
|
165
|
-
|
|
314
|
+
node.classList.remove(key);
|
|
166
315
|
}
|
|
167
316
|
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
168
317
|
const key = classKeys[i],
|
|
169
318
|
classValue = !!value[key];
|
|
170
319
|
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
171
|
-
|
|
320
|
+
node.classList.add(key);
|
|
172
321
|
}
|
|
173
322
|
}
|
|
174
|
-
function
|
|
323
|
+
function addEvent(node, name, handler, delegate) {
|
|
175
324
|
if (delegate) {
|
|
176
325
|
if (Array.isArray(handler)) {
|
|
177
326
|
node[`$$${name}`] = handler[0];
|
|
@@ -184,33 +333,48 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
184
333
|
}
|
|
185
334
|
function style(node, value, prev) {
|
|
186
335
|
if (!value) {
|
|
187
|
-
if (prev
|
|
336
|
+
if (prev || node._$styles) {
|
|
337
|
+
setAttribute(node, "style");
|
|
338
|
+
node._$styles = undefined;
|
|
339
|
+
}
|
|
188
340
|
return;
|
|
189
341
|
}
|
|
190
342
|
const nodeStyle = node.style;
|
|
191
|
-
if (typeof value === "string")
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
343
|
+
if (typeof value === "string") {
|
|
344
|
+
node._$styles = undefined;
|
|
345
|
+
return nodeStyle.cssText = value;
|
|
346
|
+
}
|
|
347
|
+
if (typeof prev === "string") {
|
|
348
|
+
nodeStyle.cssText = "";
|
|
349
|
+
prev = undefined;
|
|
350
|
+
}
|
|
351
|
+
let applied = node._$styles;
|
|
352
|
+
if (!applied) {
|
|
353
|
+
applied = node._$styles = prev ? {
|
|
354
|
+
...prev
|
|
355
|
+
} : {};
|
|
356
|
+
}
|
|
195
357
|
let v, s;
|
|
358
|
+
for (s in applied) {
|
|
359
|
+
if (value[s] == null) {
|
|
360
|
+
nodeStyle.removeProperty(s);
|
|
361
|
+
delete applied[s];
|
|
362
|
+
}
|
|
363
|
+
}
|
|
196
364
|
for (s in value) {
|
|
197
365
|
v = value[s];
|
|
198
|
-
if (v !==
|
|
199
|
-
|
|
366
|
+
if (v != null && v !== applied[s]) {
|
|
367
|
+
nodeStyle.setProperty(s, v);
|
|
368
|
+
applied[s] = v;
|
|
369
|
+
}
|
|
200
370
|
}
|
|
201
|
-
for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
|
|
202
371
|
}
|
|
203
372
|
function setStyleProperty(node, name, value) {
|
|
204
373
|
value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
|
|
205
374
|
}
|
|
206
|
-
function spread(node, props = {},
|
|
375
|
+
function spread(node, props = {}, skipChildren) {
|
|
207
376
|
const prevProps = {};
|
|
208
|
-
if (!skipChildren)
|
|
209
|
-
effect(() => normalize(props.children, prevProps.children), value => {
|
|
210
|
-
insertExpression(node, value, prevProps.children);
|
|
211
|
-
prevProps.children = value;
|
|
212
|
-
});
|
|
213
|
-
}
|
|
377
|
+
if (!skipChildren) insert(node, () => props.children);
|
|
214
378
|
effect(() => {
|
|
215
379
|
const r = props.ref;
|
|
216
380
|
(typeof r === "function" || Array.isArray(r)) && ref(() => r, node);
|
|
@@ -222,7 +386,7 @@ function spread(node, props = {}, isSVG, skipChildren) {
|
|
|
222
386
|
newProps[prop] = props[prop];
|
|
223
387
|
}
|
|
224
388
|
return newProps;
|
|
225
|
-
}, props => assign(node, props,
|
|
389
|
+
}, props => assign(node, props, true, prevProps, true));
|
|
226
390
|
return prevProps;
|
|
227
391
|
}
|
|
228
392
|
function dynamicProperty(props, key) {
|
|
@@ -242,49 +406,235 @@ function ref(fn, element) {
|
|
|
242
406
|
const resolved = solidJs.untrack(fn);
|
|
243
407
|
solidJs.runWithOwner(null, () => applyRef(resolved, element));
|
|
244
408
|
}
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
409
|
+
function scope(fn) {
|
|
410
|
+
fn.$s = true;
|
|
411
|
+
return fn;
|
|
412
|
+
}
|
|
413
|
+
const SCOPE_OPTIONS = {
|
|
414
|
+
scope: true
|
|
415
|
+
};
|
|
416
|
+
let hydrationRt = null;
|
|
417
|
+
function installHydrationRuntime() {
|
|
418
|
+
hydrationRt = {
|
|
419
|
+
claimInitial(parent, multi, initial) {
|
|
420
|
+
if (isHydrating(parent)) {
|
|
421
|
+
if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
|
|
422
|
+
if (Array.isArray(initial)) stripTextSeparators(initial);
|
|
254
423
|
}
|
|
255
|
-
initial
|
|
424
|
+
return initial;
|
|
425
|
+
},
|
|
426
|
+
reclaimRegion(current, parent, marker) {
|
|
427
|
+
if (!solidJs.sharedConfig.hydrating || !current || !parent.isConnected) return current;
|
|
428
|
+
const first = Array.isArray(current) ? current[0] : current;
|
|
429
|
+
if (!first || !first.nodeType || first.isConnected) return current;
|
|
430
|
+
let nodes;
|
|
431
|
+
if (marker) {
|
|
432
|
+
nodes = [];
|
|
433
|
+
let node = marker.previousSibling,
|
|
434
|
+
depth = 0;
|
|
435
|
+
while (node) {
|
|
436
|
+
if (node.nodeType === 8) {
|
|
437
|
+
const v = node.nodeValue;
|
|
438
|
+
if (v === "/") depth++;else if (v === "$") {
|
|
439
|
+
if (depth === 0) break;
|
|
440
|
+
depth--;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
nodes.unshift(node);
|
|
444
|
+
node = node.previousSibling;
|
|
445
|
+
}
|
|
446
|
+
} else nodes = [...parent.childNodes];
|
|
447
|
+
return stripTextSeparators(nodes);
|
|
448
|
+
},
|
|
449
|
+
dedupEvent(e) {
|
|
450
|
+
return !!(solidJs.sharedConfig.registry && solidJs.sharedConfig.events && solidJs.sharedConfig.events.find(([el, ev]) => ev === e));
|
|
256
451
|
}
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
function stripTextSeparators(nodes) {
|
|
455
|
+
let j = 0;
|
|
456
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
457
|
+
if (nodes[i].nodeType === 8 && nodes[i].nodeValue === "!$") nodes[i].remove();else nodes[j++] = nodes[i];
|
|
257
458
|
}
|
|
459
|
+
nodes.length = j;
|
|
460
|
+
return nodes;
|
|
461
|
+
}
|
|
462
|
+
function insert(parent, accessor, marker, initial, options) {
|
|
463
|
+
const multi = marker !== undefined;
|
|
464
|
+
const host = options && options.host;
|
|
465
|
+
if (multi && !initial) initial = [];
|
|
466
|
+
if (hydrationRt !== null) initial = hydrationRt.claimInitial(parent, multi, initial);
|
|
258
467
|
if (typeof accessor !== "function") {
|
|
259
468
|
accessor = normalize(accessor, initial, multi, true);
|
|
260
|
-
if (typeof accessor !== "function")
|
|
469
|
+
if (typeof accessor !== "function") {
|
|
470
|
+
insertExpression(parent, accessor, initial, marker);
|
|
471
|
+
host && tagHost(accessor, host);
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
261
474
|
}
|
|
262
|
-
|
|
263
|
-
if (multi && initial.length === 0 && !isHydrating(parent)) {
|
|
475
|
+
if (multi && initial.length === 0) {
|
|
264
476
|
const placeholder = document.createTextNode("");
|
|
265
477
|
parent.insertBefore(placeholder, marker);
|
|
266
478
|
initial = [placeholder];
|
|
267
479
|
}
|
|
268
|
-
|
|
480
|
+
let current = initial;
|
|
481
|
+
effect(prev => {
|
|
482
|
+
if (hydrationRt !== null) current = hydrationRt.reclaimRegion(current, parent, marker);
|
|
483
|
+
const value = normalize(accessor(), current, multi, true);
|
|
484
|
+
if (typeof value !== "function") return value;
|
|
485
|
+
effect(() => (hydrationRt !== null && (current = hydrationRt.reclaimRegion(current, parent, marker)), normalize(value, current, multi)), inner => {
|
|
486
|
+
insertExpression(parent, inner, current, marker);
|
|
487
|
+
current = inner;
|
|
488
|
+
host && tagHost(current, host);
|
|
489
|
+
}, prev !== undefined && !(options && options.schedule) ? {
|
|
490
|
+
...options,
|
|
491
|
+
schedule: true
|
|
492
|
+
} : options);
|
|
493
|
+
return INNER_OWNED;
|
|
494
|
+
}, value => {
|
|
495
|
+
if (value === INNER_OWNED) return;
|
|
496
|
+
insertExpression(parent, value, current, marker);
|
|
497
|
+
current = value;
|
|
498
|
+
host && tagHost(current, host);
|
|
499
|
+
},
|
|
500
|
+
accessor.$s ? options ? {
|
|
501
|
+
...options,
|
|
502
|
+
scope: true
|
|
503
|
+
} : SCOPE_OPTIONS : options);
|
|
269
504
|
}
|
|
270
|
-
function assign(node, props,
|
|
505
|
+
function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
|
|
506
|
+
const nodeName = node.nodeName;
|
|
271
507
|
props || (props = {});
|
|
272
508
|
for (const prop in prevProps) {
|
|
273
509
|
if (!(prop in props)) {
|
|
274
510
|
if (prop === "children") continue;
|
|
275
|
-
prevProps[prop] = assignProp(node, prop, null, prevProps[prop],
|
|
511
|
+
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], skipRef, nodeName);
|
|
276
512
|
}
|
|
277
513
|
}
|
|
278
514
|
for (const prop in props) {
|
|
279
515
|
if (prop === "children") {
|
|
280
|
-
if (!skipChildren) insertExpression(node, props.children);
|
|
516
|
+
if (!skipChildren) insertExpression(node, normalize(props.children, undefined, false));
|
|
281
517
|
continue;
|
|
282
518
|
}
|
|
283
|
-
|
|
284
|
-
|
|
519
|
+
prevProps[prop] = assignProp(node, prop, props[prop], prevProps[prop], skipRef, nodeName);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
const ASSET_REMOVAL_GRACE = 100;
|
|
523
|
+
const assetRegistry = new Map();
|
|
524
|
+
function assetEntryKey(descriptor) {
|
|
525
|
+
if (descriptor.policy === "exclusive") return "x|" + descriptor.key;
|
|
526
|
+
return descriptor.type === "inline-style" ? "i|" + descriptor.id : descriptor.type + "|" + descriptor.href;
|
|
527
|
+
}
|
|
528
|
+
function findAssetElement(selector, attr, value) {
|
|
529
|
+
const nodes = document.querySelectorAll(selector);
|
|
530
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
531
|
+
if (nodes[i].getAttribute(attr) === value) return nodes[i];
|
|
532
|
+
}
|
|
533
|
+
return null;
|
|
534
|
+
}
|
|
535
|
+
function mountAssetElement(descriptor) {
|
|
536
|
+
let el;
|
|
537
|
+
if (descriptor.type === "inline-style") {
|
|
538
|
+
el = findAssetElement("style[data-asset]", "data-asset", descriptor.id);
|
|
539
|
+
if (!el) {
|
|
540
|
+
el = document.createElement("style");
|
|
541
|
+
el.setAttribute("data-asset", descriptor.id);
|
|
542
|
+
el.textContent = descriptor.content || "";
|
|
543
|
+
}
|
|
544
|
+
} else {
|
|
545
|
+
const rel = descriptor.type === "module" ? "modulepreload" : "stylesheet";
|
|
546
|
+
el = findAssetElement(`link[rel="${rel}"]`, "href", descriptor.href);
|
|
547
|
+
if (!el) {
|
|
548
|
+
el = document.createElement("link");
|
|
549
|
+
el.rel = rel;
|
|
550
|
+
el.href = descriptor.href;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
if (descriptor.attrs) {
|
|
554
|
+
for (const name in descriptor.attrs) el.setAttribute(name, descriptor.attrs[name]);
|
|
555
|
+
}
|
|
556
|
+
if (!el.isConnected) document.head.appendChild(el);
|
|
557
|
+
return el;
|
|
558
|
+
}
|
|
559
|
+
function acquireAsset(descriptor) {
|
|
560
|
+
const key = assetEntryKey(descriptor);
|
|
561
|
+
let entry = assetRegistry.get(key);
|
|
562
|
+
if (descriptor.policy === "exclusive") {
|
|
563
|
+
if (!entry) {
|
|
564
|
+
entry = {
|
|
565
|
+
original: descriptor.get(),
|
|
566
|
+
set: descriptor.set,
|
|
567
|
+
writers: []
|
|
568
|
+
};
|
|
569
|
+
assetRegistry.set(key, entry);
|
|
570
|
+
}
|
|
571
|
+
const writer = {
|
|
572
|
+
value: descriptor.value
|
|
573
|
+
};
|
|
574
|
+
entry.writers.push(writer);
|
|
575
|
+
entry.set(writer.value);
|
|
576
|
+
let released = false;
|
|
577
|
+
return () => {
|
|
578
|
+
if (released) return;
|
|
579
|
+
released = true;
|
|
580
|
+
const index = entry.writers.indexOf(writer);
|
|
581
|
+
const wasTop = index === entry.writers.length - 1;
|
|
582
|
+
entry.writers.splice(index, 1);
|
|
583
|
+
if (!wasTop) return;
|
|
584
|
+
if (entry.writers.length) {
|
|
585
|
+
entry.set(entry.writers[entry.writers.length - 1].value);
|
|
586
|
+
} else {
|
|
587
|
+
entry.set(entry.original);
|
|
588
|
+
assetRegistry.delete(key);
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
if (!entry) {
|
|
593
|
+
entry = {
|
|
594
|
+
count: 0,
|
|
595
|
+
element: null,
|
|
596
|
+
timer: null
|
|
597
|
+
};
|
|
598
|
+
assetRegistry.set(key, entry);
|
|
599
|
+
}
|
|
600
|
+
if (entry.timer) {
|
|
601
|
+
clearTimeout(entry.timer);
|
|
602
|
+
entry.timer = null;
|
|
603
|
+
}
|
|
604
|
+
entry.count++;
|
|
605
|
+
if (!entry.element || !entry.element.isConnected) entry.element = mountAssetElement(descriptor);
|
|
606
|
+
let released = false;
|
|
607
|
+
return () => {
|
|
608
|
+
if (released) return;
|
|
609
|
+
released = true;
|
|
610
|
+
if (--entry.count > 0) return;
|
|
611
|
+
entry.timer = setTimeout(() => {
|
|
612
|
+
assetRegistry.delete(key);
|
|
613
|
+
entry.element && entry.element.remove();
|
|
614
|
+
}, ASSET_REMOVAL_GRACE);
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
function loadModuleAssets(mapping) {
|
|
618
|
+
const hy = globalThis._$HY;
|
|
619
|
+
if (!hy) return;
|
|
620
|
+
const pending = [];
|
|
621
|
+
for (const key in mapping) {
|
|
622
|
+
if (hy.modules[key]) continue;
|
|
623
|
+
const entryUrl = mapping[key];
|
|
624
|
+
if (!hy.loading[key]) {
|
|
625
|
+
hy.loading[key] = import(entryUrl).then(mod => {
|
|
626
|
+
hy.modules[key] = mod;
|
|
627
|
+
}, err => {
|
|
628
|
+
delete hy.loading[key];
|
|
629
|
+
throw err;
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
pending.push(hy.loading[key]);
|
|
285
633
|
}
|
|
634
|
+
return pending.length ? Promise.all(pending).then(() => {}) : undefined;
|
|
286
635
|
}
|
|
287
636
|
function hydrate$1(code, element, options = {}) {
|
|
637
|
+
installHydrationRuntime();
|
|
288
638
|
if (globalThis._$HY.done) return render$1(code, element, [...element.childNodes], options);
|
|
289
639
|
options.renderId ||= "";
|
|
290
640
|
if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
|
|
@@ -294,6 +644,7 @@ function hydrate$1(code, element, options = {}) {
|
|
|
294
644
|
solidJs.sharedConfig.load = id => globalThis._$HY.r[id];
|
|
295
645
|
solidJs.sharedConfig.has = id => id in globalThis._$HY.r;
|
|
296
646
|
solidJs.sharedConfig.gather = root => gatherHydratable(element, root);
|
|
647
|
+
solidJs.sharedConfig.loadModuleAssets = loadModuleAssets;
|
|
297
648
|
solidJs.sharedConfig.cleanupFragment = id => {
|
|
298
649
|
const tpl = document.getElementById("pl-" + id);
|
|
299
650
|
if (tpl) {
|
|
@@ -315,11 +666,34 @@ function hydrate$1(code, element, options = {}) {
|
|
|
315
666
|
{
|
|
316
667
|
solidJs.sharedConfig.verifyHydration = () => {
|
|
317
668
|
if (solidJs.sharedConfig.registry && solidJs.sharedConfig.registry.size) {
|
|
318
|
-
const orphaned = [...solidJs.sharedConfig.registry.values()];
|
|
669
|
+
const orphaned = [...solidJs.sharedConfig.registry.values()].filter(node => node.isConnected);
|
|
670
|
+
solidJs.sharedConfig.registry.clear();
|
|
671
|
+
if (!orphaned.length) return;
|
|
319
672
|
console.warn(`Hydration completed with ${orphaned.length} unclaimed server-rendered node(s):\n` + orphaned.map(node => ` ${node.outerHTML.slice(0, 100)}`).join("\n"));
|
|
320
673
|
}
|
|
321
674
|
};
|
|
322
675
|
}
|
|
676
|
+
const rootMapping = globalThis._$HY.r && globalThis._$HY.r["_assets"];
|
|
677
|
+
if (rootMapping && typeof rootMapping === "object") {
|
|
678
|
+
const p = loadModuleAssets(rootMapping);
|
|
679
|
+
if (p) {
|
|
680
|
+
gatherHydratable(element, options.renderId);
|
|
681
|
+
let disposer;
|
|
682
|
+
p.then(() => {
|
|
683
|
+
try {
|
|
684
|
+
disposer = render$1(code, element, [...element.childNodes], options);
|
|
685
|
+
} finally {
|
|
686
|
+
solidJs.sharedConfig.hydrating = false;
|
|
687
|
+
}
|
|
688
|
+
}, err => {
|
|
689
|
+
console.error("Hydration module preload failed, falling back to client render:", err);
|
|
690
|
+
solidJs.sharedConfig.hydrating = false;
|
|
691
|
+
solidJs.sharedConfig.registry = undefined;
|
|
692
|
+
disposer = render$1(code, element, [...element.childNodes], options);
|
|
693
|
+
});
|
|
694
|
+
return () => disposer && disposer();
|
|
695
|
+
}
|
|
696
|
+
}
|
|
323
697
|
try {
|
|
324
698
|
gatherHydratable(element, options.renderId);
|
|
325
699
|
return render$1(code, element, [...element.childNodes], options);
|
|
@@ -381,20 +755,21 @@ function getFirstChild(node, expectedTag) {
|
|
|
381
755
|
function getNextSibling(node, expectedTag) {
|
|
382
756
|
const sibling = node.nextSibling;
|
|
383
757
|
if (isHydrating() && expectedTag && sibling?.localName !== expectedTag) {
|
|
384
|
-
const parent = node.
|
|
758
|
+
const parent = node.parentNode;
|
|
385
759
|
const isMissing = !sibling || sibling.nodeType !== 1;
|
|
386
760
|
console.warn("Hydration structure mismatch: expected <" + expectedTag + "> after", node, "in", parent, "\n " + describeSiblings(parent, sibling, expectedTag, isMissing));
|
|
387
761
|
}
|
|
388
762
|
return sibling;
|
|
389
763
|
}
|
|
390
764
|
function describeSiblings(parent, mismatchChild, expectedTag, isMissing) {
|
|
765
|
+
if (!parent) return `<${expectedTag} \u2190 parent unavailable>`;
|
|
391
766
|
const children = [];
|
|
392
767
|
let child = parent.firstChild;
|
|
393
768
|
while (child) {
|
|
394
769
|
if (child.nodeType === 1) children.push(child);
|
|
395
770
|
child = child.nextSibling;
|
|
396
771
|
}
|
|
397
|
-
const pTag = parent.localName;
|
|
772
|
+
const pTag = parent.localName || "#fragment";
|
|
398
773
|
if (isMissing) {
|
|
399
774
|
const tags = children.map(c => `<${c.localName}>`).join("");
|
|
400
775
|
return `<${pTag}>${tags}<${expectedTag} \u2190 missing></${pTag}>`;
|
|
@@ -426,7 +801,32 @@ function runHydrationEvents() {
|
|
|
426
801
|
const [el, e] = events[0];
|
|
427
802
|
if (!completed.has(el)) return;
|
|
428
803
|
events.shift();
|
|
429
|
-
|
|
804
|
+
let matchContainer, matchState, matchDistance, matches;
|
|
805
|
+
for (const [container, state] of delegatedContainers) {
|
|
806
|
+
if (!state.handlers.has(e.type)) continue;
|
|
807
|
+
const entry = findOwner(e.target, state);
|
|
808
|
+
if (!entry) continue;
|
|
809
|
+
if (matchContainer) {
|
|
810
|
+
if (!matches) matches = [{
|
|
811
|
+
container: matchContainer,
|
|
812
|
+
state: matchState,
|
|
813
|
+
distance: matchDistance
|
|
814
|
+
}];
|
|
815
|
+
matches.push({
|
|
816
|
+
container,
|
|
817
|
+
state,
|
|
818
|
+
distance: entry.distance
|
|
819
|
+
});
|
|
820
|
+
} else {
|
|
821
|
+
matchContainer = container;
|
|
822
|
+
matchState = state;
|
|
823
|
+
matchDistance = entry.distance;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
if (matches) {
|
|
827
|
+
matches.sort((a, b) => a.distance - b.distance);
|
|
828
|
+
for (let i = 0; i < matches.length; i++) eventHandler(e, matches[i].container, matches[i].state);
|
|
829
|
+
} else if (matchContainer) eventHandler(e, matchContainer, matchState);
|
|
430
830
|
}
|
|
431
831
|
if (solidJs.sharedConfig.done) {
|
|
432
832
|
solidJs.sharedConfig.events = _$HY.events = null;
|
|
@@ -439,14 +839,21 @@ function runHydrationEvents() {
|
|
|
439
839
|
function isHydrating(node) {
|
|
440
840
|
return solidJs.sharedConfig.hydrating && (!node || node.isConnected);
|
|
441
841
|
}
|
|
442
|
-
function toggleClassKey(node, key, value) {
|
|
443
|
-
const classNames = key.trim().split(/\s+/);
|
|
444
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
|
|
445
|
-
}
|
|
446
842
|
function classListToObject(classList) {
|
|
447
843
|
if (Array.isArray(classList)) {
|
|
448
844
|
const result = {};
|
|
449
845
|
flattenClassList(classList, result);
|
|
846
|
+
classList = result;
|
|
847
|
+
}
|
|
848
|
+
if (classList && typeof classList === "object") {
|
|
849
|
+
const result = {},
|
|
850
|
+
keys = Object.keys(classList);
|
|
851
|
+
for (let i = 0, len = keys.length; i < len; i++) {
|
|
852
|
+
const key = keys[i];
|
|
853
|
+
if (!classList[key]) continue;
|
|
854
|
+
const classNames = key.trim().split(/\s+/);
|
|
855
|
+
for (let j = 0, nameLen = classNames.length; j < nameLen; j++) classNames[j] && (result[classNames[j]] = true);
|
|
856
|
+
}
|
|
450
857
|
return result;
|
|
451
858
|
}
|
|
452
859
|
return classList;
|
|
@@ -457,18 +864,16 @@ function flattenClassList(list, result) {
|
|
|
457
864
|
if (Array.isArray(item)) flattenClassList(item, result);else if (typeof item === "object" && item != null) Object.assign(result, item);else if (item || item === 0) result[item] = true;
|
|
458
865
|
}
|
|
459
866
|
}
|
|
460
|
-
function assignProp(node, prop, value, prev,
|
|
461
|
-
let forceProp;
|
|
867
|
+
function assignProp(node, prop, value, prev, skipRef, nodeName) {
|
|
462
868
|
if (prop === "style") return style(node, value, prev), value;
|
|
463
|
-
if (prop === "class") return className(node, value,
|
|
464
|
-
if (value === prev) return prev;
|
|
869
|
+
if (prop === "class") return className(node, value, prev), value;
|
|
870
|
+
if (value === prev && DOMWithState[nodeName]?.[prop] !== 1) return prev;
|
|
465
871
|
if (prop === "ref") {
|
|
466
872
|
if (!skipRef && value) ref(() => value, node);
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
} else if (prop.slice(0, 2) === "on") {
|
|
873
|
+
return value;
|
|
874
|
+
}
|
|
875
|
+
const hasNamespace = prop.indexOf(":") > -1;
|
|
876
|
+
if (!hasNamespace && prop.slice(0, 2) === "on") {
|
|
472
877
|
const name = prop.slice(2).toLowerCase();
|
|
473
878
|
const delegate = DelegatedEvents.has(name);
|
|
474
879
|
if (!delegate && prev) {
|
|
@@ -476,26 +881,33 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
476
881
|
node.removeEventListener(name, h);
|
|
477
882
|
}
|
|
478
883
|
if (delegate || value) {
|
|
479
|
-
|
|
884
|
+
addEvent(node, name, value, delegate);
|
|
480
885
|
delegate && delegateEvents([name]);
|
|
481
886
|
}
|
|
482
|
-
} else if (
|
|
483
|
-
if (
|
|
484
|
-
if (prop === "value" &&
|
|
887
|
+
} else if (hasNamespace && prop.slice(0, 5) === "prop:" || ChildProperties.has(prop) || DOMWithState[nodeName]?.[prop]) {
|
|
888
|
+
if (hasNamespace) prop = prop.slice(5);else if (isHydrating(node)) return value;
|
|
889
|
+
if (prop === "value" && nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else node[prop] = value;
|
|
485
890
|
} else {
|
|
486
|
-
const ns =
|
|
891
|
+
const ns = hasNamespace && Namespaces[prop.split(":")[0]];
|
|
487
892
|
if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, prop, value);
|
|
488
893
|
}
|
|
489
894
|
return value;
|
|
490
895
|
}
|
|
491
|
-
function eventHandler(e) {
|
|
492
|
-
if (
|
|
493
|
-
|
|
896
|
+
function eventHandler(e, container, state) {
|
|
897
|
+
if (hydrationRt !== null && hydrationRt.dedupEvent(e)) return;
|
|
898
|
+
const prev = e[$$EVENT_OWNER];
|
|
899
|
+
let resumeNode;
|
|
900
|
+
if (prev) {
|
|
901
|
+
if (prev === true || prev === container || !container.contains(prev)) return;
|
|
902
|
+
resumeNode = prev;
|
|
494
903
|
}
|
|
495
|
-
|
|
904
|
+
const owner = state && (state.owners.size === 1 && state.owners.has(container) ? container : findOwner(e.target, state)?.owner);
|
|
905
|
+
if (state && !owner) return;
|
|
906
|
+
e[$$EVENT_OWNER] = owner || true;
|
|
907
|
+
let node = resumeNode || e.target;
|
|
496
908
|
const key = `$$${e.type}`;
|
|
497
909
|
const oriTarget = e.target;
|
|
498
|
-
const
|
|
910
|
+
const boundary = owner || container || e.currentTarget;
|
|
499
911
|
const retarget = value => Object.defineProperty(e, "target", {
|
|
500
912
|
configurable: true,
|
|
501
913
|
value
|
|
@@ -511,35 +923,43 @@ function eventHandler(e) {
|
|
|
511
923
|
return true;
|
|
512
924
|
};
|
|
513
925
|
const walkUpTree = () => {
|
|
514
|
-
while (handleNode()
|
|
926
|
+
while (handleNode()) {
|
|
927
|
+
if (node === boundary || node.parentNode === boundary) break;
|
|
928
|
+
node = node._$host || node.parentNode || node.host;
|
|
929
|
+
}
|
|
515
930
|
};
|
|
516
931
|
Object.defineProperty(e, "currentTarget", {
|
|
517
932
|
configurable: true,
|
|
518
933
|
get() {
|
|
519
|
-
return node || document;
|
|
934
|
+
return node || boundary || document;
|
|
520
935
|
}
|
|
521
936
|
});
|
|
522
|
-
if (
|
|
937
|
+
if (resumeNode) {
|
|
938
|
+
if (resumeNode === e.target) node = resumeNode._$host || resumeNode.parentNode || resumeNode.host;
|
|
939
|
+
if (node && node !== boundary) walkUpTree();
|
|
940
|
+
} else if (e.composedPath) {
|
|
523
941
|
const path = e.composedPath();
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
942
|
+
if (path.length) {
|
|
943
|
+
retarget(path[0]);
|
|
944
|
+
for (let i = 0; i < path.length; i++) {
|
|
945
|
+
node = path[i];
|
|
946
|
+
if (!handleNode()) break;
|
|
947
|
+
if (node._$host) {
|
|
948
|
+
node = node._$host;
|
|
949
|
+
walkUpTree();
|
|
950
|
+
break;
|
|
951
|
+
}
|
|
952
|
+
if (node === boundary || node.parentNode === boundary) {
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
535
955
|
}
|
|
536
|
-
}
|
|
956
|
+
} else walkUpTree();
|
|
537
957
|
}
|
|
538
958
|
else walkUpTree();
|
|
539
959
|
retarget(oriTarget);
|
|
540
960
|
}
|
|
541
961
|
function insertExpression(parent, value, current, marker) {
|
|
542
|
-
if (isHydrating(parent)) return;
|
|
962
|
+
if (hydrationRt !== null && isHydrating(parent)) return;
|
|
543
963
|
if (value === current) return;
|
|
544
964
|
const t = typeof value,
|
|
545
965
|
multi = marker !== undefined;
|
|
@@ -547,15 +967,25 @@ function insertExpression(parent, value, current, marker) {
|
|
|
547
967
|
const tc = typeof current;
|
|
548
968
|
if (tc === "string" || tc === "number") {
|
|
549
969
|
parent.firstChild.data = value;
|
|
550
|
-
} else
|
|
970
|
+
} else {
|
|
971
|
+
if (ownsAllChildren(parent, current)) parent.textContent = value;else {
|
|
972
|
+
removeOwnedChildren(parent, current);
|
|
973
|
+
parent.insertBefore(document.createTextNode(value), parent.firstChild);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
551
976
|
} else if (value === undefined) {
|
|
552
977
|
cleanChildren(parent, current, marker);
|
|
553
978
|
} else if (value.nodeType) {
|
|
554
979
|
if (Array.isArray(current)) {
|
|
555
980
|
cleanChildren(parent, current, multi ? marker : null, value);
|
|
556
|
-
} else if (current
|
|
981
|
+
} else if (current && current.nodeType) {
|
|
982
|
+
current.parentNode === parent ? parent.replaceChild(value, current) : parent.appendChild(value);
|
|
983
|
+
} else if (current && parent.firstChild) {
|
|
984
|
+
parent.replaceChild(value, parent.firstChild);
|
|
985
|
+
} else {
|
|
557
986
|
parent.appendChild(value);
|
|
558
|
-
}
|
|
987
|
+
}
|
|
988
|
+
if (marker) value[$$SLOT] = marker;
|
|
559
989
|
} else if (Array.isArray(value)) {
|
|
560
990
|
const currentArray = current && Array.isArray(current);
|
|
561
991
|
if (value.length === 0) {
|
|
@@ -563,9 +993,9 @@ function insertExpression(parent, value, current, marker) {
|
|
|
563
993
|
} else if (currentArray) {
|
|
564
994
|
if (current.length === 0) {
|
|
565
995
|
appendNodes(parent, value, marker);
|
|
566
|
-
} else reconcileArrays(parent, current, value);
|
|
996
|
+
} else reconcileArrays(parent, current, value, marker);
|
|
567
997
|
} else {
|
|
568
|
-
current && cleanChildren(parent);
|
|
998
|
+
current && cleanChildren(parent, current);
|
|
569
999
|
appendNodes(parent, value);
|
|
570
1000
|
}
|
|
571
1001
|
} else console.warn(`Unrecognized value. Skipped inserting`, value);
|
|
@@ -587,21 +1017,64 @@ function normalize(value, current, multi, doNotUnwrap) {
|
|
|
587
1017
|
}
|
|
588
1018
|
return value;
|
|
589
1019
|
}
|
|
1020
|
+
function tagHost(value, host) {
|
|
1021
|
+
if (Array.isArray(value)) {
|
|
1022
|
+
for (let i = 0, len = value.length; i < len; i++) tagHost(value[i], host);
|
|
1023
|
+
} else if (value && value.nodeType && value[$$HOST] !== host) {
|
|
1024
|
+
value[$$HOST] = host;
|
|
1025
|
+
Object.defineProperty(value, "_$host", {
|
|
1026
|
+
get: host,
|
|
1027
|
+
configurable: true
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
590
1031
|
function appendNodes(parent, array, marker = null) {
|
|
591
|
-
for (let i = 0, len = array.length; i < len; i++)
|
|
1032
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
1033
|
+
const n = array[i];
|
|
1034
|
+
parent.insertBefore(n, marker);
|
|
1035
|
+
if (marker) n[$$SLOT] = marker;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
function ownsAllChildren(parent, current) {
|
|
1039
|
+
if (current == null) return true;
|
|
1040
|
+
if (Array.isArray(current)) {
|
|
1041
|
+
return current.length ? parent.firstChild === current[0] && parent.lastChild === current[current.length - 1] : parent.firstChild === null;
|
|
1042
|
+
}
|
|
1043
|
+
if (current === "") return parent.firstChild === null;
|
|
1044
|
+
if (current.nodeType) return parent.firstChild === current && parent.lastChild === current;
|
|
1045
|
+
const first = parent.firstChild;
|
|
1046
|
+
return first !== null && first.nodeType === 3 && parent.lastChild === first;
|
|
1047
|
+
}
|
|
1048
|
+
function removeOwnedChildren(parent, current) {
|
|
1049
|
+
if (Array.isArray(current)) {
|
|
1050
|
+
for (let i = 0; i < current.length; i++) {
|
|
1051
|
+
const el = current[i];
|
|
1052
|
+
if (el.parentNode === parent) el.remove();
|
|
1053
|
+
}
|
|
1054
|
+
} else if (current.nodeType) {
|
|
1055
|
+
if (current.parentNode === parent) current.remove();
|
|
1056
|
+
} else {
|
|
1057
|
+
const first = parent.firstChild;
|
|
1058
|
+
if (first && first.nodeType === 3) first.remove();
|
|
1059
|
+
}
|
|
592
1060
|
}
|
|
593
1061
|
function cleanChildren(parent, current, marker, replacement) {
|
|
594
|
-
if (marker === undefined)
|
|
1062
|
+
if (marker === undefined) {
|
|
1063
|
+
if (ownsAllChildren(parent, current)) return parent.textContent = "";
|
|
1064
|
+
return removeOwnedChildren(parent, current);
|
|
1065
|
+
}
|
|
595
1066
|
if (current.length) {
|
|
596
1067
|
let inserted = false;
|
|
597
1068
|
for (let i = current.length - 1; i >= 0; i--) {
|
|
598
1069
|
const el = current[i];
|
|
599
1070
|
if (replacement !== el) {
|
|
600
|
-
const
|
|
601
|
-
|
|
1071
|
+
const tag = el[$$SLOT];
|
|
1072
|
+
const owns = el.parentNode === parent && (!tag || tag === marker);
|
|
1073
|
+
if (replacement && !inserted && !i) owns ? parent.replaceChild(replacement, el) : parent.insertBefore(replacement, marker);else if (owns) el.remove();
|
|
602
1074
|
} else inserted = true;
|
|
603
1075
|
}
|
|
604
1076
|
} else if (replacement) parent.insertBefore(replacement, marker);
|
|
1077
|
+
if (replacement && marker) replacement[$$SLOT] = marker;
|
|
605
1078
|
}
|
|
606
1079
|
function gatherHydratable(element, root) {
|
|
607
1080
|
const templates = element.querySelectorAll(`*[_hk]`);
|
|
@@ -639,101 +1112,168 @@ function ssrHydrationKey() {}
|
|
|
639
1112
|
function resolveSSRNode(node) {}
|
|
640
1113
|
function escape(html) {}
|
|
641
1114
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
{
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
});
|
|
1115
|
+
const ENVELOPE = Symbol.for("solid.ResponseEnvelope");
|
|
1116
|
+
class ResponseEnvelope {
|
|
1117
|
+
constructor(response, value) {
|
|
1118
|
+
this.response = response;
|
|
1119
|
+
this.value = value;
|
|
648
1120
|
}
|
|
649
|
-
const result = render$1(...args);
|
|
650
|
-
{
|
|
651
|
-
solidJs.setOnUnhandledAsync(null);
|
|
652
|
-
if (unhandledAsync) {
|
|
653
|
-
const message = "Async content was used in JSX without a <Loading> boundary. " + "Wrap async content in <Loading> to show a fallback while loading.";
|
|
654
|
-
result();
|
|
655
|
-
const container = args[1];
|
|
656
|
-
container.textContent = "";
|
|
657
|
-
const msg = document.createElement("pre");
|
|
658
|
-
msg.style.cssText = "color:#e53e3e;background:#fff5f5;border:2px solid #e53e3e;" + "border-radius:4px;padding:16px;margin:16px;font-family:monospace;" + "white-space:pre-wrap;word-break:break-word;";
|
|
659
|
-
msg.textContent = message;
|
|
660
|
-
container.appendChild(msg);
|
|
661
|
-
console.error(message);
|
|
662
|
-
return () => {};
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
return result;
|
|
666
1121
|
}
|
|
1122
|
+
ResponseEnvelope.prototype[ENVELOPE] = true;
|
|
1123
|
+
function isResponseEnvelope(value) {
|
|
1124
|
+
return !!(value && typeof value === "object" && value[ENVELOPE]);
|
|
1125
|
+
}
|
|
1126
|
+
function initWithRevalidate(init) {
|
|
1127
|
+
const {
|
|
1128
|
+
revalidate,
|
|
1129
|
+
...responseInit
|
|
1130
|
+
} = init;
|
|
1131
|
+
const headers = new Headers(responseInit.headers);
|
|
1132
|
+
revalidate !== undefined && headers.set("X-Revalidate", revalidate.toString());
|
|
1133
|
+
return {
|
|
1134
|
+
responseInit,
|
|
1135
|
+
headers
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
function redirect(url, init = 302) {
|
|
1139
|
+
const {
|
|
1140
|
+
responseInit,
|
|
1141
|
+
headers
|
|
1142
|
+
} = initWithRevalidate(typeof init === "number" ? {
|
|
1143
|
+
status: init
|
|
1144
|
+
} : init);
|
|
1145
|
+
if (responseInit.status === undefined) {
|
|
1146
|
+
responseInit.status = 302;
|
|
1147
|
+
}
|
|
1148
|
+
headers.set("Location", url);
|
|
1149
|
+
return new Response(null, {
|
|
1150
|
+
...responseInit,
|
|
1151
|
+
headers
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
function reload(init = {}) {
|
|
1155
|
+
const {
|
|
1156
|
+
responseInit,
|
|
1157
|
+
headers
|
|
1158
|
+
} = initWithRevalidate(init);
|
|
1159
|
+
return new Response(null, {
|
|
1160
|
+
...responseInit,
|
|
1161
|
+
headers
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
function respond(value, init = {}) {
|
|
1165
|
+
const {
|
|
1166
|
+
responseInit,
|
|
1167
|
+
headers
|
|
1168
|
+
} = initWithRevalidate(init);
|
|
1169
|
+
headers.set("Content-Type", "application/json");
|
|
1170
|
+
return new ResponseEnvelope(new Response(JSON.stringify(value), {
|
|
1171
|
+
...responseInit,
|
|
1172
|
+
headers
|
|
1173
|
+
}), value);
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
const mergeProps = solidJs.merge;
|
|
667
1177
|
const isServer = false;
|
|
668
1178
|
const isDev = true;
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
1179
|
+
function render(code, element, init, options = {}) {
|
|
1180
|
+
solidJs.enforceLoadingBoundary(true);
|
|
1181
|
+
try {
|
|
1182
|
+
const dispose = render$1(code, element, init, {
|
|
1183
|
+
...options,
|
|
1184
|
+
insertOptions: {
|
|
1185
|
+
schedule: true
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
solidJs.flush();
|
|
1189
|
+
return dispose;
|
|
1190
|
+
} finally {
|
|
1191
|
+
solidJs.enforceLoadingBoundary(false);
|
|
1192
|
+
}
|
|
674
1193
|
}
|
|
675
1194
|
const hydrate = (...args) => {
|
|
676
1195
|
solidJs.enableHydration();
|
|
677
1196
|
return hydrate$1(...args);
|
|
678
1197
|
};
|
|
679
1198
|
function Portal(props) {
|
|
1199
|
+
return solidJs.runWithOwner(solidJs.createOwner(), () => portalImpl(props));
|
|
1200
|
+
}
|
|
1201
|
+
function portalImpl(props) {
|
|
680
1202
|
const treeMarker = document.createTextNode(""),
|
|
681
1203
|
startMarker = document.createTextNode(""),
|
|
682
1204
|
endMarker = document.createTextNode(""),
|
|
683
|
-
mount = () =>
|
|
684
|
-
|
|
685
|
-
|
|
1205
|
+
mount = () => props.mount || document.body,
|
|
1206
|
+
content = solidJs.createMemo(() => [startMarker, props.children], {
|
|
1207
|
+
ssrSource: "client"
|
|
1208
|
+
});
|
|
1209
|
+
solidJs.createRenderEffect(
|
|
1210
|
+
() => [mount(), content(), solidJs.getOwner()], ([, c, owner]) => {
|
|
1211
|
+
const m = solidJs.untrack(mount);
|
|
686
1212
|
m.appendChild(endMarker);
|
|
687
|
-
|
|
1213
|
+
const dispose = solidJs.runWithOwner(owner, () => solidJs.createRoot(d => {
|
|
1214
|
+
insert(m, c, endMarker, undefined, {
|
|
1215
|
+
host: () => treeMarker.parentNode
|
|
1216
|
+
});
|
|
1217
|
+
return d;
|
|
1218
|
+
}));
|
|
688
1219
|
return () => {
|
|
1220
|
+
dispose();
|
|
689
1221
|
let c = startMarker;
|
|
690
|
-
while (c
|
|
1222
|
+
while (c) {
|
|
691
1223
|
const n = c.nextSibling;
|
|
692
1224
|
m.removeChild(c);
|
|
1225
|
+
if (c === endMarker) break;
|
|
693
1226
|
c = n;
|
|
694
1227
|
}
|
|
695
1228
|
};
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
schedule: true,
|
|
1232
|
+
ssrSource: "client"
|
|
1233
|
+
});
|
|
1234
|
+
solidJs.createEffect(mount, () => {
|
|
1235
|
+
const m = solidJs.untrack(mount);
|
|
1236
|
+
const ownerRoot = getDelegatedRoot(treeMarker);
|
|
1237
|
+
if (!ownerRoot || ownerRoot.contains(m)) return;
|
|
1238
|
+
registerDelegatedContainer(m, ownerRoot);
|
|
1239
|
+
return () => unregisterDelegatedContainer(m, ownerRoot);
|
|
1240
|
+
}, {
|
|
1241
|
+
ssrSource: "client"
|
|
1242
|
+
});
|
|
1243
|
+
if (solidJs.sharedConfig.hydrating) return solidJs.createMemo(() => treeMarker, {
|
|
1244
|
+
ssrSource: "client"
|
|
696
1245
|
});
|
|
697
1246
|
return treeMarker;
|
|
698
1247
|
}
|
|
699
|
-
function
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
1248
|
+
function dynamic(source) {
|
|
1249
|
+
const cached = solidJs.createMemo(source, {
|
|
1250
|
+
lazy: true
|
|
1251
|
+
});
|
|
1252
|
+
return props => {
|
|
1253
|
+
return solidJs.createMemo(() => {
|
|
1254
|
+
const component = cached();
|
|
1255
|
+
switch (typeof component) {
|
|
1256
|
+
case "function":
|
|
1257
|
+
Object.assign(component, {
|
|
1258
|
+
[solidJs.$DEVCOMP]: true
|
|
707
1259
|
});
|
|
708
|
-
|
|
709
|
-
|
|
1260
|
+
return solidJs.untrack(() => component(props));
|
|
1261
|
+
case "string":
|
|
1262
|
+
const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, solidJs.untrack(() => props.is));
|
|
1263
|
+
spread(el, props);
|
|
1264
|
+
return el;
|
|
710
1265
|
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
}
|
|
714
|
-
});
|
|
715
|
-
}
|
|
716
|
-
function createDynamic(component, props) {
|
|
717
|
-
const cached = solidJs.createMemo(component);
|
|
718
|
-
return solidJs.createMemo(() => {
|
|
719
|
-
const component = cached();
|
|
720
|
-
switch (typeof component) {
|
|
721
|
-
case "function":
|
|
722
|
-
Object.assign(component, {
|
|
723
|
-
[solidJs.$DEVCOMP]: true
|
|
724
|
-
});
|
|
725
|
-
return solidJs.untrack(() => component(props));
|
|
726
|
-
case "string":
|
|
727
|
-
const isSvg = SVGElements.has(component);
|
|
728
|
-
const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, isSvg, solidJs.untrack(() => props.is));
|
|
729
|
-
spread(el, props, isSvg);
|
|
730
|
-
return el;
|
|
731
|
-
}
|
|
732
|
-
});
|
|
1266
|
+
});
|
|
1267
|
+
};
|
|
733
1268
|
}
|
|
734
1269
|
function Dynamic(props) {
|
|
735
|
-
const
|
|
736
|
-
return
|
|
1270
|
+
const Comp = dynamic(() => props.component);
|
|
1271
|
+
return solidJs.createComponent(Comp, solidJs.omit(props, "component"));
|
|
1272
|
+
}
|
|
1273
|
+
function createElement(tagName, is = undefined) {
|
|
1274
|
+
return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
1275
|
+
is
|
|
1276
|
+
});
|
|
737
1277
|
}
|
|
738
1278
|
|
|
739
1279
|
Object.defineProperty(exports, "Errored", {
|
|
@@ -760,6 +1300,14 @@ Object.defineProperty(exports, "NoHydration", {
|
|
|
760
1300
|
enumerable: true,
|
|
761
1301
|
get: function () { return solidJs.NoHydration; }
|
|
762
1302
|
});
|
|
1303
|
+
Object.defineProperty(exports, "Repeat", {
|
|
1304
|
+
enumerable: true,
|
|
1305
|
+
get: function () { return solidJs.Repeat; }
|
|
1306
|
+
});
|
|
1307
|
+
Object.defineProperty(exports, "Reveal", {
|
|
1308
|
+
enumerable: true,
|
|
1309
|
+
get: function () { return solidJs.Reveal; }
|
|
1310
|
+
});
|
|
763
1311
|
Object.defineProperty(exports, "Show", {
|
|
764
1312
|
enumerable: true,
|
|
765
1313
|
get: function () { return solidJs.Show; }
|
|
@@ -776,10 +1324,6 @@ Object.defineProperty(exports, "getOwner", {
|
|
|
776
1324
|
enumerable: true,
|
|
777
1325
|
get: function () { return solidJs.getOwner; }
|
|
778
1326
|
});
|
|
779
|
-
Object.defineProperty(exports, "mergeProps", {
|
|
780
|
-
enumerable: true,
|
|
781
|
-
get: function () { return solidJs.merge; }
|
|
782
|
-
});
|
|
783
1327
|
Object.defineProperty(exports, "untrack", {
|
|
784
1328
|
enumerable: true,
|
|
785
1329
|
get: function () { return solidJs.untrack; }
|
|
@@ -787,26 +1331,31 @@ Object.defineProperty(exports, "untrack", {
|
|
|
787
1331
|
exports.Assets = voidFn;
|
|
788
1332
|
exports.ChildProperties = ChildProperties;
|
|
789
1333
|
exports.DOMElements = DOMElements;
|
|
1334
|
+
exports.DOMWithState = DOMWithState;
|
|
790
1335
|
exports.DelegatedEvents = DelegatedEvents;
|
|
791
1336
|
exports.Dynamic = Dynamic;
|
|
792
1337
|
exports.HydrationScript = voidFn;
|
|
1338
|
+
exports.MathMLElements = MathMLElements;
|
|
1339
|
+
exports.Namespaces = Namespaces;
|
|
793
1340
|
exports.Portal = Portal;
|
|
794
|
-
exports.
|
|
1341
|
+
exports.RawTextElements = RawTextElements;
|
|
795
1342
|
exports.RequestContext = RequestContext;
|
|
1343
|
+
exports.ResponseEnvelope = ResponseEnvelope;
|
|
796
1344
|
exports.SVGElements = SVGElements;
|
|
797
|
-
exports.
|
|
798
|
-
exports.
|
|
1345
|
+
exports.VoidElements = VoidElements;
|
|
1346
|
+
exports.acquireAsset = acquireAsset;
|
|
1347
|
+
exports.addEvent = addEvent;
|
|
799
1348
|
exports.applyRef = applyRef;
|
|
800
1349
|
exports.assign = assign;
|
|
801
1350
|
exports.className = className;
|
|
802
|
-
exports.clearDelegatedEvents = clearDelegatedEvents;
|
|
803
|
-
exports.createDynamic = createDynamic;
|
|
804
1351
|
exports.delegateEvents = delegateEvents;
|
|
1352
|
+
exports.dynamic = dynamic;
|
|
805
1353
|
exports.dynamicProperty = dynamicProperty;
|
|
806
1354
|
exports.effect = effect;
|
|
807
1355
|
exports.escape = escape;
|
|
808
1356
|
exports.generateHydrationScript = voidFn;
|
|
809
1357
|
exports.getAssets = voidFn;
|
|
1358
|
+
exports.getDelegatedRoot = getDelegatedRoot;
|
|
810
1359
|
exports.getFirstChild = getFirstChild;
|
|
811
1360
|
exports.getHydrationKey = getHydrationKey;
|
|
812
1361
|
exports.getNextElement = getNextElement;
|
|
@@ -816,16 +1365,25 @@ exports.getNextSibling = getNextSibling;
|
|
|
816
1365
|
exports.getRequestEvent = voidFn;
|
|
817
1366
|
exports.hydrate = hydrate;
|
|
818
1367
|
exports.insert = insert;
|
|
1368
|
+
exports.installHydrationRuntime = installHydrationRuntime;
|
|
819
1369
|
exports.isDev = isDev;
|
|
1370
|
+
exports.isResponseEnvelope = isResponseEnvelope;
|
|
820
1371
|
exports.isServer = isServer;
|
|
821
1372
|
exports.memo = memo;
|
|
1373
|
+
exports.mergeProps = mergeProps;
|
|
1374
|
+
exports.redirect = redirect;
|
|
822
1375
|
exports.ref = ref;
|
|
1376
|
+
exports.registerDelegatedContainer = registerDelegatedContainer;
|
|
1377
|
+
exports.registerDelegatedRoot = registerDelegatedRoot;
|
|
1378
|
+
exports.reload = reload;
|
|
823
1379
|
exports.render = render;
|
|
824
1380
|
exports.renderToStream = renderToStream;
|
|
825
1381
|
exports.renderToString = renderToString;
|
|
826
1382
|
exports.renderToStringAsync = renderToStringAsync;
|
|
827
1383
|
exports.resolveSSRNode = resolveSSRNode;
|
|
1384
|
+
exports.respond = respond;
|
|
828
1385
|
exports.runHydrationEvents = runHydrationEvents;
|
|
1386
|
+
exports.scope = scope;
|
|
829
1387
|
exports.setAttribute = setAttribute;
|
|
830
1388
|
exports.setAttributeNS = setAttributeNS;
|
|
831
1389
|
exports.setProperty = setProperty;
|
|
@@ -839,4 +1397,6 @@ exports.ssrHydrationKey = ssrHydrationKey;
|
|
|
839
1397
|
exports.ssrStyle = ssrStyle;
|
|
840
1398
|
exports.style = style;
|
|
841
1399
|
exports.template = template;
|
|
1400
|
+
exports.unregisterDelegatedContainer = unregisterDelegatedContainer;
|
|
1401
|
+
exports.unregisterDelegatedRoot = unregisterDelegatedRoot;
|
|
842
1402
|
exports.useAssets = voidFn;
|