@solidjs/web 2.0.0-experimental.9 → 2.0.0-rc.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/README.md +22 -4
- package/dist/dev.cjs +1585 -225
- package/dist/dev.js +1510 -201
- package/dist/server.cjs +2642 -264
- package/dist/server.js +2542 -217
- package/dist/web.cjs +1523 -218
- package/dist/web.js +1448 -194
- package/frames/dist/client.cjs +1916 -0
- package/frames/dist/client.dev.cjs +1933 -0
- package/frames/dist/client.dev.js +1921 -0
- package/frames/dist/client.js +1904 -0
- package/frames/dist/server.cjs +3667 -0
- package/frames/dist/server.js +3654 -0
- package/frames/package.json +30 -0
- package/package.json +349 -37
- package/serialization/decode/package.json +20 -0
- package/serialization/dist/decode.cjs +110 -0
- package/serialization/dist/decode.js +104 -0
- package/serialization/dist/serialization.cjs +232 -0
- package/serialization/dist/serialization.js +215 -0
- package/serialization/package.json +20 -0
- package/serialization/types/index.d.ts +182 -0
- package/serialization/types/serializer-decode.d.ts +182 -0
- package/serialization/types-cjs/index.d.cts +182 -0
- package/serialization/types-cjs/package.json +3 -0
- package/serialization/types-cjs/serializer-decode.d.cts +182 -0
- package/server-functions/dist/client.cjs +646 -0
- package/server-functions/dist/client.js +617 -0
- package/server-functions/dist/rich-args.cjs +11 -0
- package/server-functions/dist/rich-args.js +9 -0
- package/server-functions/dist/server.cjs +1077 -0
- package/server-functions/dist/server.dev.cjs +1077 -0
- package/server-functions/dist/server.dev.js +1045 -0
- package/server-functions/dist/server.js +1045 -0
- package/server-functions/package.json +40 -0
- package/server-functions/rich-args/package.json +20 -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 +290 -27
- package/types/cookies.d.ts +93 -0
- package/types/core.d.ts +6 -2
- package/types/frames/client.d.ts +36 -0
- package/types/frames/frame-client.d.ts +338 -0
- package/types/frames/frame-sink.d.ts +194 -0
- package/types/frames/frame-transport.d.ts +222 -0
- package/types/frames/serializer.d.ts +182 -0
- package/types/frames/server.d.ts +52 -0
- package/types/index.d.ts +209 -24
- package/types/jsx-properties.d.ts +93 -0
- package/types/jsx.d.ts +4150 -1
- package/types/response.d.ts +174 -0
- package/types/serializer-decode.d.ts +182 -0
- package/types/serializer.d.ts +182 -0
- package/types/server-functions/client.d.ts +201 -0
- package/types/server-functions/flash.d.ts +38 -0
- package/types/server-functions/rich-args.d.ts +10 -0
- package/types/server-functions/server.d.ts +588 -0
- package/types/server-functions/shared.d.ts +523 -0
- package/types/server-mock.d.ts +249 -12
- package/types/server.d.ts +424 -51
- package/types-cjs/client.d.cts +337 -0
- package/types-cjs/cookies.d.cts +93 -0
- package/types-cjs/core.d.cts +6 -0
- package/types-cjs/frames/client.d.cts +36 -0
- package/types-cjs/frames/frame-client.d.cts +338 -0
- package/types-cjs/frames/frame-sink.d.cts +194 -0
- package/types-cjs/frames/frame-transport.d.cts +222 -0
- package/types-cjs/frames/serializer.d.cts +182 -0
- package/types-cjs/frames/server.d.cts +52 -0
- package/types-cjs/index.d.cts +230 -0
- package/types-cjs/jsx-properties.d.cts +93 -0
- package/types-cjs/jsx.d.cts +4150 -0
- package/types-cjs/package.json +3 -0
- package/types-cjs/response.d.cts +174 -0
- package/types-cjs/serializer-decode.d.cts +182 -0
- package/types-cjs/serializer.d.cts +182 -0
- package/types-cjs/server-functions/client.d.cts +201 -0
- package/types-cjs/server-functions/flash.d.cts +38 -0
- package/types-cjs/server-functions/rich-args.d.cts +10 -0
- package/types-cjs/server-functions/server.d.cts +588 -0
- package/types-cjs/server-functions/shared.d.cts +523 -0
- package/types-cjs/server-mock.d.cts +277 -0
- package/types-cjs/server.d.cts +523 -0
package/dist/dev.cjs
CHANGED
|
@@ -2,33 +2,91 @@
|
|
|
2
2
|
|
|
3
3
|
var solidJs = require('solid-js');
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
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
|
+
};
|
|
7
33
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
34
|
+
const $$SLOT = /*#__PURE__*/Symbol("slot");
|
|
35
|
+
const $$HOST = /*#__PURE__*/Symbol("host");
|
|
8
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"]);
|
|
9
37
|
const SVGElements = /*#__PURE__*/new Set([
|
|
10
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",
|
|
11
39
|
"set", "stop",
|
|
12
40
|
"svg", "switch", "symbol", "text", "textPath",
|
|
13
41
|
"tref", "tspan", "use", "view", "vkern"]);
|
|
14
|
-
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",
|
|
15
46
|
xlink: "http://www.w3.org/1999/xlink",
|
|
16
47
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
17
48
|
};
|
|
18
|
-
const
|
|
19
|
-
"
|
|
20
|
-
"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(","));
|
|
21
52
|
|
|
22
|
-
const
|
|
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);
|
|
66
|
+
const assetGates = new WeakMap();
|
|
67
|
+
const waitAsset = promise => {
|
|
68
|
+
let gate = assetGates.get(promise);
|
|
69
|
+
if (!gate) {
|
|
70
|
+
solidJs.runWithOwner(null, () => {
|
|
71
|
+
gate = solidJs.createMemo(() => promise);
|
|
72
|
+
});
|
|
73
|
+
assetGates.set(promise, gate);
|
|
74
|
+
}
|
|
75
|
+
gate();
|
|
76
|
+
};
|
|
23
77
|
|
|
24
|
-
function reconcileArrays(parentNode, a, b) {
|
|
78
|
+
function reconcileArrays(parentNode, a, b, marker) {
|
|
25
79
|
let bLength = b.length,
|
|
26
80
|
aEnd = a.length,
|
|
27
81
|
bEnd = bLength,
|
|
28
82
|
aStart = 0,
|
|
29
83
|
bStart = 0,
|
|
30
|
-
|
|
31
|
-
|
|
84
|
+
tail = a[aEnd - 1],
|
|
85
|
+
tailTag = tail[$$SLOT],
|
|
86
|
+
after = tail.parentNode === parentNode && (!tailTag || tailTag === marker) ? tail.nextSibling : marker || null,
|
|
87
|
+
map = null,
|
|
88
|
+
anchor,
|
|
89
|
+
anchorTag;
|
|
32
90
|
while (aStart < aEnd || bStart < bEnd) {
|
|
33
91
|
if (a[aStart] === b[bStart]) {
|
|
34
92
|
aStart++;
|
|
@@ -40,18 +98,43 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
40
98
|
bEnd--;
|
|
41
99
|
}
|
|
42
100
|
if (aEnd === aStart) {
|
|
43
|
-
|
|
44
|
-
|
|
101
|
+
let node;
|
|
102
|
+
if (bEnd < bLength) {
|
|
103
|
+
if (bStart) {
|
|
104
|
+
const prev = b[bStart - 1];
|
|
105
|
+
const prevTag = prev[$$SLOT];
|
|
106
|
+
node = prev.parentNode === parentNode && (!prevTag || prevTag === marker) ? prev.nextSibling : after;
|
|
107
|
+
} else node = b[bEnd - bStart];
|
|
108
|
+
} else node = after;
|
|
109
|
+
while (bStart < bEnd) {
|
|
110
|
+
const n = b[bStart++];
|
|
111
|
+
parentNode.insertBefore(n, node);
|
|
112
|
+
if (marker) n[$$SLOT] = marker;
|
|
113
|
+
}
|
|
45
114
|
} else if (bEnd === bStart) {
|
|
46
115
|
while (aStart < aEnd) {
|
|
47
|
-
|
|
48
|
-
|
|
116
|
+
const n = a[aStart++];
|
|
117
|
+
if (!map || !map.has(n)) {
|
|
118
|
+
const tag = n[$$SLOT];
|
|
119
|
+
if (n.parentNode === parentNode && (!tag || tag === marker)) n.remove();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} else if ((anchor = a[aStart]) === b[bEnd - 1] && b[bStart] === a[aEnd - 1] && anchor.parentNode === parentNode && (!(anchorTag = anchor[$$SLOT]) || anchorTag === marker)) {
|
|
123
|
+
if (marker) {
|
|
124
|
+
do {
|
|
125
|
+
const n = a[--aEnd];
|
|
126
|
+
parentNode.insertBefore(n, anchor);
|
|
127
|
+
n[$$SLOT] = marker;
|
|
128
|
+
bStart++;
|
|
129
|
+
if (aStart >= aEnd - 1 || bStart >= bEnd) break;
|
|
130
|
+
} while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
|
|
131
|
+
} else {
|
|
132
|
+
do {
|
|
133
|
+
parentNode.insertBefore(a[--aEnd], anchor);
|
|
134
|
+
bStart++;
|
|
135
|
+
if (aStart >= aEnd - 1 || bStart >= bEnd) break;
|
|
136
|
+
} while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
|
|
49
137
|
}
|
|
50
|
-
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
51
|
-
const node = a[--aEnd].nextSibling;
|
|
52
|
-
parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
|
|
53
|
-
parentNode.insertBefore(b[--bEnd], node);
|
|
54
|
-
a[aEnd] = b[bEnd];
|
|
55
138
|
} else {
|
|
56
139
|
if (!map) {
|
|
57
140
|
map = new Map();
|
|
@@ -69,78 +152,338 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
69
152
|
sequence++;
|
|
70
153
|
}
|
|
71
154
|
if (sequence > index - bStart) {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
155
|
+
const head = a[aStart];
|
|
156
|
+
const headTag = head[$$SLOT];
|
|
157
|
+
const node = head.parentNode === parentNode && (!headTag || headTag === marker) ? head : after;
|
|
158
|
+
while (bStart < index) {
|
|
159
|
+
const n = b[bStart++];
|
|
160
|
+
parentNode.insertBefore(n, node);
|
|
161
|
+
if (marker) n[$$SLOT] = marker;
|
|
162
|
+
}
|
|
163
|
+
} else {
|
|
164
|
+
const oldNode = a[aStart++];
|
|
165
|
+
const newNode = b[bStart++];
|
|
166
|
+
const oldTag = oldNode[$$SLOT];
|
|
167
|
+
if (oldNode.parentNode === parentNode && (!oldTag || oldTag === marker)) {
|
|
168
|
+
parentNode.replaceChild(newNode, oldNode);
|
|
169
|
+
} else {
|
|
170
|
+
parentNode.insertBefore(newNode, after);
|
|
171
|
+
}
|
|
172
|
+
if (marker) newNode[$$SLOT] = marker;
|
|
173
|
+
}
|
|
75
174
|
} else aStart++;
|
|
76
|
-
} else
|
|
175
|
+
} else {
|
|
176
|
+
const n = a[aStart++];
|
|
177
|
+
const nTag = n[$$SLOT];
|
|
178
|
+
if (n.parentNode === parentNode && (!nTag || nTag === marker)) n.remove();
|
|
179
|
+
}
|
|
77
180
|
}
|
|
78
181
|
}
|
|
79
182
|
}
|
|
80
183
|
|
|
81
|
-
const
|
|
82
|
-
|
|
184
|
+
const HEAD_ELIGIBLE_TAGS = new Set(["title", "meta", "link", "style", "script", "base"]);
|
|
185
|
+
const HEAD_ATTR_NAME = /^[a-zA-Z_][a-zA-Z0-9_:.-]*$/;
|
|
186
|
+
const RESOURCE_LINK_RELS = new Set(["preload", "modulepreload", "prefetch", "preconnect", "dns-prefetch", "stylesheet"]);
|
|
187
|
+
const RESOURCE_QUALIFIERS = ["as", "crossorigin", "type", "media", "imagesrcset", "imagesizes"];
|
|
188
|
+
const STYLESHEET_FETCH_META = new Set(["crossorigin", "integrity", "referrerpolicy", "fetchpriority"]);
|
|
189
|
+
function evalHeadValue(v) {
|
|
190
|
+
return typeof v === "function" ? v() : v;
|
|
191
|
+
}
|
|
192
|
+
function evalHeadProps(props, presets) {
|
|
193
|
+
const out = {};
|
|
194
|
+
for (const name in props) out[name] = presets && name in presets ? presets[name] : evalHeadValue(props[name]);
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
function classifyHeadTag(desc) {
|
|
198
|
+
const tag = desc.tag;
|
|
199
|
+
if (tag === "link") {
|
|
200
|
+
const rel = evalHeadValue(desc.props && desc.props.rel);
|
|
201
|
+
return {
|
|
202
|
+
resource: RESOURCE_LINK_RELS.has(rel),
|
|
203
|
+
rel
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
if (tag === "style") return {
|
|
207
|
+
resource: !!(desc.props && "href" in desc.props)
|
|
208
|
+
};
|
|
209
|
+
if (tag === "script") return {
|
|
210
|
+
resource: !!(desc.props && "src" in desc.props)
|
|
211
|
+
};
|
|
212
|
+
return {
|
|
213
|
+
resource: false
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function resourceIdentity(tag, props) {
|
|
217
|
+
let id = "res:" + tag + ":" + (props.rel || "") + ":" + (props.href || props.src || "");
|
|
218
|
+
for (let i = 0; i < RESOURCE_QUALIFIERS.length; i++) {
|
|
219
|
+
const q = RESOURCE_QUALIFIERS[i];
|
|
220
|
+
if (props[q] != null) id += ":" + q + "=" + props[q];
|
|
221
|
+
}
|
|
222
|
+
return id;
|
|
223
|
+
}
|
|
224
|
+
function replaceableIdentity(tag, props, key, unique) {
|
|
225
|
+
if (tag === "title") return "title";
|
|
226
|
+
if (tag === "base") return "base";
|
|
227
|
+
if (tag === "meta" && props.charset != null) return "charset";
|
|
228
|
+
if (key != null) return tag + ":key:" + key;
|
|
229
|
+
if (tag === "meta") {
|
|
230
|
+
for (const ns of ["name", "property", "http-equiv"]) if (props[ns] != null) return "meta:" + ns + ":" + props[ns] + (props.media != null ? ":media=" + props.media : "");
|
|
231
|
+
return unique;
|
|
232
|
+
}
|
|
233
|
+
if (tag === "link") {
|
|
234
|
+
const rel = props.rel || "";
|
|
235
|
+
if (rel === "icon" || rel === "apple-touch-icon") return "link:" + rel + (props.sizes != null ? ":sizes=" + props.sizes : "") + (props.type != null ? ":type=" + props.type : "");
|
|
236
|
+
return "link:" + rel + ":" + (props.href || "");
|
|
237
|
+
}
|
|
238
|
+
return unique;
|
|
239
|
+
}
|
|
240
|
+
function resolveHead(groups) {
|
|
241
|
+
const winners = new Map();
|
|
242
|
+
const sorted = groups.slice().sort((a, b) => a.seq - b.seq);
|
|
243
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
244
|
+
const group = sorted[i];
|
|
245
|
+
const byIdentity = new Map();
|
|
246
|
+
for (let j = 0; j < group.tags.length; j++) {
|
|
247
|
+
const t = group.tags[j];
|
|
248
|
+
let list = byIdentity.get(t.identity);
|
|
249
|
+
if (!list) byIdentity.set(t.identity, list = []);
|
|
250
|
+
list.push(t);
|
|
251
|
+
}
|
|
252
|
+
for (const [identity, tags] of byIdentity) {
|
|
253
|
+
if (identity === "title") {
|
|
254
|
+
if (tags.length > 1) console.warn("Multiple <title> tags in one head group; the last one wins.");
|
|
255
|
+
winners.set(identity, {
|
|
256
|
+
seq: group.seq,
|
|
257
|
+
tags: [tags[tags.length - 1]]
|
|
258
|
+
});
|
|
259
|
+
} else {
|
|
260
|
+
winners.set(identity, {
|
|
261
|
+
seq: group.seq,
|
|
262
|
+
tags
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return winners;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function parseCookieHeader(header) {
|
|
271
|
+
const cookies = {};
|
|
272
|
+
if (!header) return cookies;
|
|
273
|
+
for (const part of header.split(";")) {
|
|
274
|
+
const eq = part.indexOf("=");
|
|
275
|
+
if (eq < 0) continue;
|
|
276
|
+
const name = decodeSafe(part.slice(0, eq).trim());
|
|
277
|
+
let value = part.slice(eq + 1).trim();
|
|
278
|
+
if (value.length > 1 && value[0] === '"' && value[value.length - 1] === '"') {
|
|
279
|
+
value = value.slice(1, -1);
|
|
280
|
+
}
|
|
281
|
+
cookies[name] = decodeSafe(value);
|
|
282
|
+
}
|
|
283
|
+
return cookies;
|
|
284
|
+
}
|
|
285
|
+
function decodeSafe(text) {
|
|
286
|
+
try {
|
|
287
|
+
return decodeURIComponent(text);
|
|
288
|
+
} catch {
|
|
289
|
+
return text;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function serializeCookie(name, value, options = {}) {
|
|
293
|
+
let cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
|
|
294
|
+
cookie += `; Path=${options.path === undefined ? "/" : options.path}`;
|
|
295
|
+
if (options.domain) cookie += `; Domain=${options.domain}`;
|
|
296
|
+
if (options.maxAge !== undefined) cookie += `; Max-Age=${Math.trunc(options.maxAge)}`;
|
|
297
|
+
if (options.expires) cookie += `; Expires=${options.expires.toUTCString()}`;
|
|
298
|
+
if (options.httpOnly) cookie += "; HttpOnly";
|
|
299
|
+
if (options.secure) cookie += "; Secure";
|
|
300
|
+
if (options.sameSite) {
|
|
301
|
+
const sameSite = options.sameSite.toLowerCase();
|
|
302
|
+
cookie += `; SameSite=${sameSite === "none" ? "None" : sameSite === "strict" ? "Strict" : "Lax"}`;
|
|
303
|
+
}
|
|
304
|
+
return cookie;
|
|
305
|
+
}
|
|
306
|
+
const FLASH_COOKIE = "flash";
|
|
307
|
+
const FLASH_MATCHER = new RegExp(`(?:^|;\\s*)${FLASH_COOKIE}=([^;]+)`);
|
|
308
|
+
function hasFlashCookie(cookieHeader) {
|
|
309
|
+
return !!cookieHeader && FLASH_MATCHER.test(cookieHeader);
|
|
310
|
+
}
|
|
311
|
+
function clearFlashCookie() {
|
|
312
|
+
return `${FLASH_COOKIE}=; Max-Age=0; Path=/`;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const SERVER_FUNCTION_METADATA = Symbol.for("solid.ServerFunctionMetadata");
|
|
316
|
+
function getServerFunctionMetadata(fn) {
|
|
317
|
+
if (typeof fn !== "function") return undefined;
|
|
318
|
+
return fn[SERVER_FUNCTION_METADATA] || undefined;
|
|
319
|
+
}
|
|
320
|
+
function isServerFunction(fn) {
|
|
321
|
+
return typeof fn === "function" && !!fn[SERVER_FUNCTION_METADATA];
|
|
322
|
+
}
|
|
323
|
+
const SERVER_FUNCTION_RPC = Symbol.for("solid.ServerFunctionRPC");
|
|
324
|
+
function getServerFunctionRPC() {
|
|
325
|
+
return globalThis[SERVER_FUNCTION_RPC];
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const $$EVENT_OWNER = "_$DX_EVENT_OWNER";
|
|
329
|
+
const INNER_OWNED = {};
|
|
330
|
+
const delegatedEvents = new Set();
|
|
331
|
+
const delegatedContainers = new Map();
|
|
332
|
+
function render$1(code, element, init, options = {}) {
|
|
83
333
|
if (!element) {
|
|
84
334
|
throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
|
|
85
335
|
}
|
|
86
336
|
let disposer;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
337
|
+
registerDelegatedRoot(element);
|
|
338
|
+
try {
|
|
339
|
+
solidJs.createRoot(dispose => {
|
|
340
|
+
disposer = dispose;
|
|
341
|
+
if (element === document) {
|
|
342
|
+
const tree = code();
|
|
343
|
+
effect(() => solidJs.flatten(tree), () => {});
|
|
344
|
+
} else {
|
|
345
|
+
const tree = code();
|
|
346
|
+
insert(element, () => tree, element.firstChild ? null : undefined, init, options.insertOptions);
|
|
347
|
+
}
|
|
348
|
+
}, {
|
|
349
|
+
id: options.renderId
|
|
350
|
+
});
|
|
351
|
+
} catch (err) {
|
|
352
|
+
if (disposer) disposer();
|
|
353
|
+
unregisterDelegatedRoot(element);
|
|
354
|
+
throw err;
|
|
355
|
+
}
|
|
93
356
|
return () => {
|
|
94
357
|
disposer();
|
|
358
|
+
unregisterDelegatedRoot(element);
|
|
95
359
|
element.textContent = "";
|
|
96
360
|
};
|
|
97
361
|
}
|
|
98
|
-
function
|
|
362
|
+
function create(html, bypassGuard, flag) {
|
|
363
|
+
if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
|
|
364
|
+
const t = document.createElement("template");
|
|
365
|
+
t.innerHTML = html;
|
|
366
|
+
return flag === 2 ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
367
|
+
}
|
|
368
|
+
function template(html, flag) {
|
|
99
369
|
let node;
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
t.innerHTML = html;
|
|
104
|
-
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
105
|
-
};
|
|
106
|
-
return isImportNode ? () => solidJs.untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
370
|
+
const fn = flag === 1 ? bypassGuard => document.importNode(node || (node = create(html, bypassGuard, flag)), true) : bypassGuard => (node || (node = create(html, bypassGuard, flag))).cloneNode(true);
|
|
371
|
+
fn._html = flag === 2 ? html.replace(/^<[^>]+>/, "") : html;
|
|
372
|
+
return fn;
|
|
107
373
|
}
|
|
108
|
-
function delegateEvents(eventNames
|
|
109
|
-
const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());
|
|
374
|
+
function delegateEvents(eventNames) {
|
|
110
375
|
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
111
376
|
const name = eventNames[i];
|
|
112
|
-
if (!
|
|
113
|
-
|
|
114
|
-
|
|
377
|
+
if (!delegatedEvents.has(name)) {
|
|
378
|
+
delegatedEvents.add(name);
|
|
379
|
+
delegatedContainers.forEach((state, container) => attachDelegatedEvent(name, container, state));
|
|
115
380
|
}
|
|
116
381
|
}
|
|
117
382
|
}
|
|
118
|
-
function
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
383
|
+
function registerDelegatedRoot(root) {
|
|
384
|
+
const state = registerDelegatedContainer(root, root);
|
|
385
|
+
if (state) state.roots = (state.roots || 0) + 1;
|
|
386
|
+
}
|
|
387
|
+
function unregisterDelegatedRoot(root) {
|
|
388
|
+
const state = delegatedContainers.get(root);
|
|
389
|
+
if (state) state.roots > 1 ? state.roots-- : delete state.roots;
|
|
390
|
+
unregisterDelegatedContainer(root, root);
|
|
391
|
+
}
|
|
392
|
+
function registerDelegatedContainer(container, owner = container) {
|
|
393
|
+
if (!container || !owner) return;
|
|
394
|
+
let state = delegatedContainers.get(container);
|
|
395
|
+
if (!state) delegatedContainers.set(container, state = {
|
|
396
|
+
owners: new Map(),
|
|
397
|
+
handlers: new Map()
|
|
398
|
+
});
|
|
399
|
+
state.owners.set(owner, (state.owners.get(owner) || 0) + 1);
|
|
400
|
+
delegatedEvents.forEach(name => attachDelegatedEvent(name, container, state));
|
|
401
|
+
return state;
|
|
402
|
+
}
|
|
403
|
+
function unregisterDelegatedContainer(container, owner = container) {
|
|
404
|
+
const state = delegatedContainers.get(container);
|
|
405
|
+
if (!state) return;
|
|
406
|
+
const count = state.owners.get(owner);
|
|
407
|
+
if (count > 1) state.owners.set(owner, count - 1);else state.owners.delete(owner);
|
|
408
|
+
if (state.owners.size) return;
|
|
409
|
+
state.handlers.forEach((handler, name) => container.removeEventListener(name, handler));
|
|
410
|
+
delegatedContainers.delete(container);
|
|
411
|
+
}
|
|
412
|
+
function attachDelegatedEvent(name, container, state) {
|
|
413
|
+
if (state.handlers.has(name)) return;
|
|
414
|
+
const handler = e => eventHandler(e, container, state);
|
|
415
|
+
state.handlers.set(name, handler);
|
|
416
|
+
container.addEventListener(name, handler);
|
|
417
|
+
}
|
|
418
|
+
function getDelegatedRoot(node) {
|
|
419
|
+
while (node) {
|
|
420
|
+
if (delegatedContainers.get(node)?.roots) return node;
|
|
421
|
+
node = node._$host || node.parentNode || node.host;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
function findOwner(target, state) {
|
|
425
|
+
let node = target;
|
|
426
|
+
let distance = 0;
|
|
427
|
+
while (node) {
|
|
428
|
+
if (state.owners.has(node)) return {
|
|
429
|
+
owner: node,
|
|
430
|
+
distance
|
|
431
|
+
};
|
|
432
|
+
distance++;
|
|
433
|
+
node = node._$host || node.parentNode || node.host;
|
|
122
434
|
}
|
|
123
435
|
}
|
|
124
436
|
function setProperty(node, name, value) {
|
|
125
437
|
if (isHydrating(node)) return;
|
|
126
438
|
node[name] = value;
|
|
127
439
|
}
|
|
440
|
+
let claimHandlers = null;
|
|
441
|
+
const CLAIM_SEAM = Symbol.for("dom-expressions.element-claims");
|
|
442
|
+
function registerElementClaim(handler) {
|
|
443
|
+
(claimHandlers || (claimHandlers = globalThis[CLAIM_SEAM] = [])).push(handler);
|
|
444
|
+
return () => {
|
|
445
|
+
const index = claimHandlers.indexOf(handler);
|
|
446
|
+
index > -1 && claimHandlers.splice(index, 1);
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
const CLAIMED_ELEMENTS = "a[href], form[action]";
|
|
450
|
+
function claimElementTree(root) {
|
|
451
|
+
const handlers = globalThis[CLAIM_SEAM];
|
|
452
|
+
if (handlers === undefined || handlers.length === 0) return root;
|
|
453
|
+
const isElement = root.nodeType === 1;
|
|
454
|
+
if (!isElement && root.nodeType !== 11) return root;
|
|
455
|
+
if (isElement && root.matches(CLAIMED_ELEMENTS)) {
|
|
456
|
+
for (let i = 0; i < handlers.length; i++) handlers[i](root);
|
|
457
|
+
}
|
|
458
|
+
const found = root.querySelectorAll(CLAIMED_ELEMENTS);
|
|
459
|
+
for (let i = 0; i < found.length; i++) {
|
|
460
|
+
for (let j = 0; j < handlers.length; j++) handlers[j](found[i]);
|
|
461
|
+
}
|
|
462
|
+
return root;
|
|
463
|
+
}
|
|
464
|
+
function claimElement(node) {
|
|
465
|
+
if (claimHandlers !== null) {
|
|
466
|
+
for (let i = 0; i < claimHandlers.length; i++) claimHandlers[i](node);
|
|
467
|
+
}
|
|
468
|
+
return node;
|
|
469
|
+
}
|
|
128
470
|
function setAttribute(node, name, value) {
|
|
129
471
|
if (isHydrating(node)) return;
|
|
130
472
|
if (value == null || value === false) node.removeAttribute(name);else node.setAttribute(name, value === true ? "" : value);
|
|
473
|
+
if (claimHandlers !== null && (name === "href" || name === "action")) claimElement(node);
|
|
131
474
|
}
|
|
132
475
|
function setAttributeNS(node, namespace, name, value) {
|
|
133
476
|
if (isHydrating(node)) return;
|
|
134
|
-
if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
|
|
477
|
+
if (value == null || value === false) node.removeAttributeNS(namespace, name.indexOf(":") > -1 ? name.split(":").pop() : name);else node.setAttributeNS(namespace, name, value === true ? "" : value);
|
|
135
478
|
}
|
|
136
|
-
function className(node, value,
|
|
479
|
+
function className(node, value, prev) {
|
|
137
480
|
if (isHydrating(node)) return;
|
|
138
481
|
if (value == null || value === false) {
|
|
139
482
|
prev && node.removeAttribute("class");
|
|
140
483
|
return;
|
|
141
484
|
}
|
|
142
485
|
if (typeof value === "string") {
|
|
143
|
-
value !== prev &&
|
|
486
|
+
value !== prev && node.setAttribute("class", value);
|
|
144
487
|
return;
|
|
145
488
|
}
|
|
146
489
|
if (typeof prev === "string") {
|
|
@@ -154,16 +497,16 @@ function className(node, value, isSVG, prev) {
|
|
|
154
497
|
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
155
498
|
const key = prevKeys[i];
|
|
156
499
|
if (!key || key === "undefined" || value[key]) continue;
|
|
157
|
-
|
|
500
|
+
node.classList.remove(key);
|
|
158
501
|
}
|
|
159
502
|
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
160
503
|
const key = classKeys[i],
|
|
161
504
|
classValue = !!value[key];
|
|
162
505
|
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
163
|
-
|
|
506
|
+
node.classList.add(key);
|
|
164
507
|
}
|
|
165
508
|
}
|
|
166
|
-
function
|
|
509
|
+
function addEvent(node, name, handler, delegate) {
|
|
167
510
|
if (delegate) {
|
|
168
511
|
if (Array.isArray(handler)) {
|
|
169
512
|
node[`$$${name}`] = handler[0];
|
|
@@ -176,42 +519,60 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
176
519
|
}
|
|
177
520
|
function style(node, value, prev) {
|
|
178
521
|
if (!value) {
|
|
179
|
-
prev
|
|
522
|
+
if (prev || node._$styles) {
|
|
523
|
+
setAttribute(node, "style");
|
|
524
|
+
node._$styles = undefined;
|
|
525
|
+
}
|
|
180
526
|
return;
|
|
181
527
|
}
|
|
182
528
|
const nodeStyle = node.style;
|
|
183
|
-
if (typeof value === "string")
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
529
|
+
if (typeof value === "string") {
|
|
530
|
+
node._$styles = undefined;
|
|
531
|
+
return nodeStyle.cssText = value;
|
|
532
|
+
}
|
|
533
|
+
if (typeof prev === "string") {
|
|
534
|
+
nodeStyle.cssText = "";
|
|
535
|
+
prev = undefined;
|
|
536
|
+
}
|
|
537
|
+
let applied = node._$styles;
|
|
538
|
+
if (!applied) {
|
|
539
|
+
applied = node._$styles = prev ? {
|
|
540
|
+
...prev
|
|
541
|
+
} : {};
|
|
542
|
+
}
|
|
187
543
|
let v, s;
|
|
544
|
+
for (s in applied) {
|
|
545
|
+
if (value[s] == null) {
|
|
546
|
+
nodeStyle.removeProperty(s);
|
|
547
|
+
delete applied[s];
|
|
548
|
+
}
|
|
549
|
+
}
|
|
188
550
|
for (s in value) {
|
|
189
551
|
v = value[s];
|
|
190
|
-
if (v !==
|
|
191
|
-
|
|
552
|
+
if (v != null && v !== applied[s]) {
|
|
553
|
+
nodeStyle.setProperty(s, v);
|
|
554
|
+
applied[s] = v;
|
|
555
|
+
}
|
|
192
556
|
}
|
|
193
|
-
for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
|
|
194
557
|
}
|
|
195
558
|
function setStyleProperty(node, name, value) {
|
|
196
559
|
value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
|
|
197
560
|
}
|
|
198
|
-
function spread(node, props = {},
|
|
561
|
+
function spread(node, props = {}, skipChildren) {
|
|
199
562
|
const prevProps = {};
|
|
200
|
-
if (!skipChildren)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
solidJs.createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node), () => {});
|
|
207
|
-
solidJs.createRenderEffect(() => {
|
|
563
|
+
if (!skipChildren) insert(node, () => props.children);
|
|
564
|
+
effect(() => {
|
|
565
|
+
const r = props.ref;
|
|
566
|
+
(typeof r === "function" || Array.isArray(r)) && ref(() => r, node);
|
|
567
|
+
}, () => {});
|
|
568
|
+
effect(() => {
|
|
208
569
|
const newProps = {};
|
|
209
570
|
for (const prop in props) {
|
|
210
571
|
if (prop === "children" || prop === "ref") continue;
|
|
211
572
|
newProps[prop] = props[prop];
|
|
212
573
|
}
|
|
213
574
|
return newProps;
|
|
214
|
-
}, props => assign(node, props,
|
|
575
|
+
}, props => assign(node, props, true, prevProps, true));
|
|
215
576
|
return prevProps;
|
|
216
577
|
}
|
|
217
578
|
function dynamicProperty(props, key) {
|
|
@@ -224,48 +585,628 @@ function dynamicProperty(props, key) {
|
|
|
224
585
|
});
|
|
225
586
|
return props;
|
|
226
587
|
}
|
|
227
|
-
function
|
|
228
|
-
|
|
588
|
+
function applyRef(r, element) {
|
|
589
|
+
Array.isArray(r) ? r.flat(Infinity).forEach(f => f && f(element)) : r(element);
|
|
229
590
|
}
|
|
230
|
-
function
|
|
591
|
+
function ref(fn, element) {
|
|
592
|
+
const resolved = solidJs.untrack(fn);
|
|
593
|
+
solidJs.runWithOwner(null, () => applyRef(resolved, element));
|
|
594
|
+
}
|
|
595
|
+
function scope(fn) {
|
|
596
|
+
fn.$s = true;
|
|
597
|
+
return fn;
|
|
598
|
+
}
|
|
599
|
+
const SCOPE_OPTIONS = {
|
|
600
|
+
scope: true
|
|
601
|
+
};
|
|
602
|
+
let hydrationRt = null;
|
|
603
|
+
function installHydrationRuntime() {
|
|
604
|
+
hydrationRt = {
|
|
605
|
+
claimInitial(parent, multi, initial) {
|
|
606
|
+
if (isHydrating(parent)) {
|
|
607
|
+
if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
|
|
608
|
+
if (Array.isArray(initial)) stripTextSeparators(initial);
|
|
609
|
+
}
|
|
610
|
+
return initial;
|
|
611
|
+
},
|
|
612
|
+
reclaimRegion(current, parent, marker) {
|
|
613
|
+
if (!solidJs.sharedConfig.hydrating || !current || !parent.isConnected) return current;
|
|
614
|
+
const first = Array.isArray(current) ? current[0] : current;
|
|
615
|
+
if (!first || !first.nodeType || first.isConnected) return current;
|
|
616
|
+
let nodes;
|
|
617
|
+
if (marker) {
|
|
618
|
+
nodes = [];
|
|
619
|
+
let node = marker.previousSibling,
|
|
620
|
+
depth = 0;
|
|
621
|
+
while (node) {
|
|
622
|
+
if (node.nodeType === 8) {
|
|
623
|
+
const v = node.nodeValue;
|
|
624
|
+
if (v === "/") depth++;else if (v === "$") {
|
|
625
|
+
if (depth === 0) break;
|
|
626
|
+
depth--;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
nodes.unshift(node);
|
|
630
|
+
node = node.previousSibling;
|
|
631
|
+
}
|
|
632
|
+
} else nodes = [...parent.childNodes];
|
|
633
|
+
return stripTextSeparators(nodes);
|
|
634
|
+
},
|
|
635
|
+
dedupEvent(e) {
|
|
636
|
+
return !!(solidJs.sharedConfig.registry && solidJs.sharedConfig.events && solidJs.sharedConfig.events.find(([el, ev]) => ev === e));
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
function stripTextSeparators(nodes) {
|
|
641
|
+
let j = 0;
|
|
642
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
643
|
+
const node = nodes[i],
|
|
644
|
+
t = node.nodeType;
|
|
645
|
+
if (t === 8) {
|
|
646
|
+
const v = node.nodeValue;
|
|
647
|
+
if (v === "!$") {
|
|
648
|
+
node.remove();
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
if (v.startsWith("pl-")) continue;
|
|
652
|
+
} else if (t === 1 && node.localName === "template" && node.id.startsWith("pl-")) continue;
|
|
653
|
+
nodes[j++] = node;
|
|
654
|
+
}
|
|
655
|
+
nodes.length = j;
|
|
656
|
+
return nodes;
|
|
657
|
+
}
|
|
658
|
+
function insert(parent, accessor, marker, initial, options) {
|
|
231
659
|
const multi = marker !== undefined;
|
|
660
|
+
const host = options && options.host;
|
|
232
661
|
if (multi && !initial) initial = [];
|
|
662
|
+
if (hydrationRt !== null) initial = hydrationRt.claimInitial(parent, multi, initial);
|
|
233
663
|
if (typeof accessor !== "function") {
|
|
234
664
|
accessor = normalize(accessor, initial, multi, true);
|
|
235
|
-
if (typeof accessor !== "function")
|
|
665
|
+
if (typeof accessor !== "function") {
|
|
666
|
+
insertExpression(parent, accessor, initial, marker);
|
|
667
|
+
host && tagHost(accessor, host);
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
if (multi && initial.length === 0) {
|
|
672
|
+
const placeholder = document.createTextNode("");
|
|
673
|
+
parent.insertBefore(placeholder, marker);
|
|
674
|
+
initial = [placeholder];
|
|
236
675
|
}
|
|
237
|
-
|
|
676
|
+
let current = initial;
|
|
677
|
+
effect(prev => {
|
|
678
|
+
if (hydrationRt !== null) current = hydrationRt.reclaimRegion(current, parent, marker);
|
|
679
|
+
const value = normalize(accessor(), current, multi, true);
|
|
680
|
+
if (typeof value !== "function") return value;
|
|
681
|
+
effect(() => (hydrationRt !== null && (current = hydrationRt.reclaimRegion(current, parent, marker)), normalize(value, current, multi)), inner => {
|
|
682
|
+
current = insertExpression(parent, inner, current, marker);
|
|
683
|
+
host && tagHost(current, host);
|
|
684
|
+
}, prev !== undefined && !(options && options.schedule) ? {
|
|
685
|
+
...options,
|
|
686
|
+
schedule: true
|
|
687
|
+
} : options);
|
|
688
|
+
return INNER_OWNED;
|
|
689
|
+
}, value => {
|
|
690
|
+
if (value === INNER_OWNED) return;
|
|
691
|
+
current = insertExpression(parent, value, current, marker);
|
|
692
|
+
host && tagHost(current, host);
|
|
693
|
+
},
|
|
694
|
+
accessor.$s ? options ? {
|
|
695
|
+
...options,
|
|
696
|
+
scope: true
|
|
697
|
+
} : SCOPE_OPTIONS : options);
|
|
238
698
|
}
|
|
239
|
-
function assign(node, props,
|
|
699
|
+
function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
|
|
700
|
+
const nodeName = node.nodeName;
|
|
240
701
|
props || (props = {});
|
|
241
702
|
for (const prop in prevProps) {
|
|
242
703
|
if (!(prop in props)) {
|
|
243
704
|
if (prop === "children") continue;
|
|
244
|
-
prevProps[prop] = assignProp(node, prop, null, prevProps[prop],
|
|
705
|
+
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], skipRef, nodeName);
|
|
245
706
|
}
|
|
246
707
|
}
|
|
247
708
|
for (const prop in props) {
|
|
248
709
|
if (prop === "children") {
|
|
249
|
-
if (!skipChildren) insertExpression(node, props.children);
|
|
710
|
+
if (!skipChildren) insertExpression(node, normalize(props.children, undefined, false));
|
|
250
711
|
continue;
|
|
251
712
|
}
|
|
252
|
-
|
|
253
|
-
|
|
713
|
+
prevProps[prop] = assignProp(node, prop, props[prop], prevProps[prop], skipRef, nodeName);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
const ASSET_REMOVAL_GRACE = 100;
|
|
717
|
+
const assetRegistry = new Map();
|
|
718
|
+
function assetEntryKey(descriptor) {
|
|
719
|
+
if (descriptor.policy === "exclusive") return "x|" + descriptor.key;
|
|
720
|
+
return descriptor.type === "inline-style" ? "i|" + descriptor.id : descriptor.type + "|" + descriptor.href;
|
|
721
|
+
}
|
|
722
|
+
function findAssetElement(selector, attr, value) {
|
|
723
|
+
const nodes = document.querySelectorAll(selector);
|
|
724
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
725
|
+
if (nodes[i].getAttribute(attr) === value) return nodes[i];
|
|
726
|
+
}
|
|
727
|
+
return null;
|
|
728
|
+
}
|
|
729
|
+
function setAssetAttrs(el, attrs) {
|
|
730
|
+
for (const name in attrs) el.setAttribute(name, attrs[name]);
|
|
731
|
+
}
|
|
732
|
+
function mountAssetElement(descriptor) {
|
|
733
|
+
let el;
|
|
734
|
+
if (descriptor.type === "inline-style") {
|
|
735
|
+
el = findAssetElement("style[data-asset]", "data-asset", descriptor.id);
|
|
736
|
+
if (!el) {
|
|
737
|
+
el = document.createElement("style");
|
|
738
|
+
el.setAttribute("data-asset", descriptor.id);
|
|
739
|
+
el.textContent = descriptor.content || "";
|
|
740
|
+
}
|
|
741
|
+
} else {
|
|
742
|
+
const rel = descriptor.type === "module" ? "modulepreload" : "stylesheet";
|
|
743
|
+
el = findAssetElement(`link[rel="${rel}"]`, "href", descriptor.href);
|
|
744
|
+
if (!el) {
|
|
745
|
+
el = document.createElement("link");
|
|
746
|
+
el.rel = rel;
|
|
747
|
+
el.href = descriptor.href;
|
|
748
|
+
}
|
|
254
749
|
}
|
|
750
|
+
if (descriptor.attrs) setAssetAttrs(el, descriptor.attrs);
|
|
751
|
+
if (!el.isConnected) document.head.appendChild(el);
|
|
752
|
+
return el;
|
|
753
|
+
}
|
|
754
|
+
const assetLoadSettled = /*#__PURE__*/Promise.resolve();
|
|
755
|
+
function trackAssetLoad(entry, adopted) {
|
|
756
|
+
if (entry.loadPromise) return;
|
|
757
|
+
const el = entry.element;
|
|
758
|
+
let settled = el.sheet != null;
|
|
759
|
+
if (!settled && adopted && typeof performance !== "undefined" && performance.getEntriesByName) {
|
|
760
|
+
settled = performance.getEntriesByName(el.href).length > 0;
|
|
761
|
+
}
|
|
762
|
+
if (settled) {
|
|
763
|
+
entry.loadState = "loaded";
|
|
764
|
+
entry.loadPromise = assetLoadSettled;
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
entry.loadState = "pending";
|
|
768
|
+
entry.loadPromise = new Promise(resolve => {
|
|
769
|
+
const settle = state => {
|
|
770
|
+
entry.loadState = state;
|
|
771
|
+
resolve();
|
|
772
|
+
};
|
|
773
|
+
el.addEventListener("load", () => settle("loaded"), {
|
|
774
|
+
once: true
|
|
775
|
+
});
|
|
776
|
+
el.addEventListener("error", () => settle("errored"), {
|
|
777
|
+
once: true
|
|
778
|
+
});
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
function warmAsset(descriptor) {
|
|
782
|
+
if (descriptor.policy === "exclusive" || descriptor.type === "inline-style") return;
|
|
783
|
+
const key = assetEntryKey(descriptor);
|
|
784
|
+
let entry = assetRegistry.get(key);
|
|
785
|
+
if (!entry) {
|
|
786
|
+
entry = {
|
|
787
|
+
count: 0,
|
|
788
|
+
element: null,
|
|
789
|
+
timer: null
|
|
790
|
+
};
|
|
791
|
+
assetRegistry.set(key, entry);
|
|
792
|
+
}
|
|
793
|
+
let adopted = true;
|
|
794
|
+
if (!entry.element || !entry.element.isConnected) {
|
|
795
|
+
const rel = descriptor.type === "module" ? "modulepreload" : "stylesheet";
|
|
796
|
+
let el = findAssetElement(`link[rel="${rel}"]`, "href", descriptor.href);
|
|
797
|
+
if (!el && descriptor.type === "style") {
|
|
798
|
+
el = findAssetElement('link[rel="preload"][as="style"]', "href", descriptor.href);
|
|
799
|
+
}
|
|
800
|
+
if (!el) {
|
|
801
|
+
adopted = false;
|
|
802
|
+
el = document.createElement("link");
|
|
803
|
+
if (descriptor.type === "style") {
|
|
804
|
+
el.setAttribute("rel", "preload");
|
|
805
|
+
el.setAttribute("as", "style");
|
|
806
|
+
} else {
|
|
807
|
+
el.setAttribute("rel", "modulepreload");
|
|
808
|
+
}
|
|
809
|
+
el.setAttribute("href", descriptor.href);
|
|
810
|
+
if (!document.body) el.setAttribute("blocking", "render");
|
|
811
|
+
}
|
|
812
|
+
if (descriptor.attrs) setAssetAttrs(el, descriptor.attrs);
|
|
813
|
+
if (!el.isConnected) document.head.appendChild(el);
|
|
814
|
+
entry.element = el;
|
|
815
|
+
entry.loadState = undefined;
|
|
816
|
+
entry.loadPromise = undefined;
|
|
817
|
+
}
|
|
818
|
+
if (descriptor.type === "style") trackAssetLoad(entry, adopted);
|
|
819
|
+
return entry;
|
|
820
|
+
}
|
|
821
|
+
function acquireAsset(descriptor) {
|
|
822
|
+
const key = assetEntryKey(descriptor);
|
|
823
|
+
let entry = assetRegistry.get(key);
|
|
824
|
+
if (descriptor.policy === "exclusive") {
|
|
825
|
+
if (!entry) {
|
|
826
|
+
entry = {
|
|
827
|
+
original: descriptor.get(),
|
|
828
|
+
set: descriptor.set,
|
|
829
|
+
writers: []
|
|
830
|
+
};
|
|
831
|
+
assetRegistry.set(key, entry);
|
|
832
|
+
}
|
|
833
|
+
const writer = {
|
|
834
|
+
value: descriptor.value
|
|
835
|
+
};
|
|
836
|
+
entry.writers.push(writer);
|
|
837
|
+
entry.set(writer.value);
|
|
838
|
+
let released = false;
|
|
839
|
+
return () => {
|
|
840
|
+
if (released) return;
|
|
841
|
+
released = true;
|
|
842
|
+
const index = entry.writers.indexOf(writer);
|
|
843
|
+
const wasTop = index === entry.writers.length - 1;
|
|
844
|
+
entry.writers.splice(index, 1);
|
|
845
|
+
if (!wasTop) return;
|
|
846
|
+
if (entry.writers.length) {
|
|
847
|
+
entry.set(entry.writers[entry.writers.length - 1].value);
|
|
848
|
+
} else {
|
|
849
|
+
entry.set(entry.original);
|
|
850
|
+
assetRegistry.delete(key);
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
if (!entry) {
|
|
855
|
+
entry = {
|
|
856
|
+
count: 0,
|
|
857
|
+
element: null,
|
|
858
|
+
timer: null
|
|
859
|
+
};
|
|
860
|
+
assetRegistry.set(key, entry);
|
|
861
|
+
}
|
|
862
|
+
if (entry.timer) {
|
|
863
|
+
clearTimeout(entry.timer);
|
|
864
|
+
entry.timer = null;
|
|
865
|
+
}
|
|
866
|
+
entry.count++;
|
|
867
|
+
if (!entry.element || !entry.element.isConnected) {
|
|
868
|
+
entry.element = mountAssetElement(descriptor);
|
|
869
|
+
} else if (descriptor.type === "style" && entry.element.getAttribute("rel") === "preload") {
|
|
870
|
+
entry.element.removeAttribute("as");
|
|
871
|
+
entry.element.setAttribute("rel", "stylesheet");
|
|
872
|
+
}
|
|
873
|
+
let released = false;
|
|
874
|
+
return () => {
|
|
875
|
+
if (released) return;
|
|
876
|
+
released = true;
|
|
877
|
+
if (--entry.count > 0) return;
|
|
878
|
+
entry.timer = setTimeout(() => {
|
|
879
|
+
assetRegistry.delete(key);
|
|
880
|
+
entry.element && entry.element.remove();
|
|
881
|
+
}, ASSET_REMOVAL_GRACE);
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
let headRegistrations = null;
|
|
885
|
+
let headSeq = 0;
|
|
886
|
+
let headUid = 0;
|
|
887
|
+
let headOwned = null;
|
|
888
|
+
let headApplied = null;
|
|
889
|
+
let headFallbackTitle = null;
|
|
890
|
+
let headScheduled = false;
|
|
891
|
+
const headMountedResources = new Set();
|
|
892
|
+
function initHeadRegistry() {
|
|
893
|
+
if (headRegistrations) return;
|
|
894
|
+
headRegistrations = [];
|
|
895
|
+
headOwned = new Map();
|
|
896
|
+
headApplied = new Map();
|
|
897
|
+
const t = document.querySelector("title");
|
|
898
|
+
headFallbackTitle = t && !t.hasAttribute("data-dh") ? t.textContent : null;
|
|
899
|
+
if (globalThis._$HY) globalThis._$HY.h = applyServerHeadOps;
|
|
900
|
+
}
|
|
901
|
+
function applyServerHeadOps(ops) {
|
|
902
|
+
for (let i = 0; i < ops.length; i++) {
|
|
903
|
+
const op = ops[i];
|
|
904
|
+
const identity = op[0] === "t" ? "title" : op[1];
|
|
905
|
+
if (headOwned.has(identity)) continue;
|
|
906
|
+
if (op[0] === "t") setHeadTitle(op[1]);else if (op[0] === "r") {
|
|
907
|
+
const els = headMarkedElements(identity);
|
|
908
|
+
for (let j = 0; j < els.length; j++) els[j].remove();
|
|
909
|
+
} else {
|
|
910
|
+
const el = document.createElement(op[2]);
|
|
911
|
+
for (const name in op[3]) el.setAttribute(name, op[3][name]);
|
|
912
|
+
if (op[4] != null) el.textContent = op[4];
|
|
913
|
+
el.setAttribute("data-dh", identity);
|
|
914
|
+
document.head.appendChild(el);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
function headMarkedElements(identity) {
|
|
919
|
+
const nodes = document.head.querySelectorAll("[data-dh]");
|
|
920
|
+
const out = [];
|
|
921
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
922
|
+
if (nodes[i].getAttribute("data-dh") === identity) out.push(nodes[i]);
|
|
923
|
+
}
|
|
924
|
+
return out;
|
|
925
|
+
}
|
|
926
|
+
function setHeadTitle(text) {
|
|
927
|
+
let el = document.querySelector("title");
|
|
928
|
+
if (!el) {
|
|
929
|
+
el = document.createElement("title");
|
|
930
|
+
document.head.appendChild(el);
|
|
931
|
+
}
|
|
932
|
+
el.textContent = text;
|
|
933
|
+
el.setAttribute("data-dh", "title");
|
|
934
|
+
return el;
|
|
935
|
+
}
|
|
936
|
+
function scheduleHeadApply() {
|
|
937
|
+
if (headScheduled) return;
|
|
938
|
+
headScheduled = true;
|
|
939
|
+
queueMicrotask(flushHeadRegistry);
|
|
940
|
+
}
|
|
941
|
+
function flushHeadRegistry() {
|
|
942
|
+
if (solidJs.sharedConfig.hydrating) {
|
|
943
|
+
setTimeout(flushHeadRegistry, 0);
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
headScheduled = false;
|
|
947
|
+
const winners = resolveHead(headRegistrations);
|
|
948
|
+
for (const [identity, els] of headOwned) {
|
|
949
|
+
if (winners.has(identity)) continue;
|
|
950
|
+
headOwned.delete(identity);
|
|
951
|
+
headApplied.delete(identity);
|
|
952
|
+
if (identity === "title") {
|
|
953
|
+
if (headFallbackTitle != null) setHeadTitle(headFallbackTitle).removeAttribute("data-dh");
|
|
954
|
+
} else {
|
|
955
|
+
for (let i = 0; i < els.length; i++) els[i].remove();
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
for (const [identity, winner] of winners) {
|
|
959
|
+
let sig = "";
|
|
960
|
+
for (let i = 0; i < winner.tags.length; i++) sig += winner.tags[i].tag + JSON.stringify(winner.tags[i].props) + "|";
|
|
961
|
+
if (headApplied.get(identity) === sig) continue;
|
|
962
|
+
headApplied.set(identity, sig);
|
|
963
|
+
if (identity === "base" || identity === "charset") {
|
|
964
|
+
console.warn(`useHead: <${winner.tags[0].tag}> (${identity}) is shell-only and ignored on the client`);
|
|
965
|
+
continue;
|
|
966
|
+
}
|
|
967
|
+
if (identity === "title") {
|
|
968
|
+
const children = winner.tags[0].props.children;
|
|
969
|
+
setHeadTitle(children == null ? "" : String(children));
|
|
970
|
+
headOwned.set(identity, []);
|
|
971
|
+
continue;
|
|
972
|
+
}
|
|
973
|
+
const existing = headMarkedElements(identity);
|
|
974
|
+
const els = [];
|
|
975
|
+
for (let i = 0; i < winner.tags.length; i++) {
|
|
976
|
+
els.push(renderHeadElement(winner.tags[i], identity, existing));
|
|
977
|
+
}
|
|
978
|
+
for (let i = 0; i < existing.length; i++) {
|
|
979
|
+
if (els.indexOf(existing[i]) === -1) existing[i].remove();
|
|
980
|
+
}
|
|
981
|
+
headOwned.set(identity, els);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
function createHeadElement(tag, props) {
|
|
985
|
+
const el = document.createElement(tag);
|
|
986
|
+
for (const name in props) {
|
|
987
|
+
if (name === "children" || name === "ref" || name.slice(0, 2) === "on") continue;
|
|
988
|
+
if (!HEAD_ATTR_NAME.test(name)) {
|
|
989
|
+
console.warn(`useHead: ignoring invalid attribute name "${name}"`);
|
|
990
|
+
continue;
|
|
991
|
+
}
|
|
992
|
+
const v = props[name];
|
|
993
|
+
if (v == null || v === false) continue;
|
|
994
|
+
el.setAttribute(name, v === true ? "" : String(v));
|
|
995
|
+
}
|
|
996
|
+
if (props.children != null) el.textContent = String(props.children);
|
|
997
|
+
return el;
|
|
998
|
+
}
|
|
999
|
+
function renderHeadElement(t, identity, existing) {
|
|
1000
|
+
for (let i = 0; i < existing.length; i++) {
|
|
1001
|
+
if (headElementMatches(existing[i], t)) return existing.splice(i, 1)[0];
|
|
1002
|
+
}
|
|
1003
|
+
const el = createHeadElement(t.tag, t.props);
|
|
1004
|
+
el.setAttribute("data-dh", identity);
|
|
1005
|
+
document.head.appendChild(el);
|
|
1006
|
+
return el;
|
|
1007
|
+
}
|
|
1008
|
+
function headElementMatches(el, t) {
|
|
1009
|
+
if (el.tagName.toLowerCase() !== t.tag) return false;
|
|
1010
|
+
for (const name in t.props) {
|
|
1011
|
+
if (name === "children" || name === "ref" || name.slice(0, 2) === "on") continue;
|
|
1012
|
+
if (!HEAD_ATTR_NAME.test(name)) continue;
|
|
1013
|
+
const v = t.props[name];
|
|
1014
|
+
if (v == null || v === false) {
|
|
1015
|
+
if (el.hasAttribute(name)) return false;
|
|
1016
|
+
} else if (el.getAttribute(name) !== (v === true ? "" : String(v))) return false;
|
|
1017
|
+
}
|
|
1018
|
+
const children = t.props.children;
|
|
1019
|
+
return (children == null ? "" : String(children)) === el.textContent;
|
|
1020
|
+
}
|
|
1021
|
+
function mountHeadResource(tag, props) {
|
|
1022
|
+
const identity = resourceIdentity(tag, props);
|
|
1023
|
+
if (headMountedResources.has(identity)) return;
|
|
1024
|
+
headMountedResources.add(identity);
|
|
1025
|
+
const url = props.href || props.src;
|
|
1026
|
+
let el = null;
|
|
1027
|
+
if (url != null) {
|
|
1028
|
+
if (tag === "link") el = findAssetElement(`link[rel="${props.rel}"]`, "href", url);else if (tag === "script") el = findAssetElement("script[src]", "src", url);else el = findAssetElement("style[href]", "href", url);
|
|
1029
|
+
}
|
|
1030
|
+
if (!el) document.head.appendChild(createHeadElement(tag, props));
|
|
1031
|
+
}
|
|
1032
|
+
function gateHeadResource(props) {
|
|
1033
|
+
const descriptor = {
|
|
1034
|
+
type: props.rel === "stylesheet" ? "style" : "module",
|
|
1035
|
+
href: props.href
|
|
1036
|
+
};
|
|
1037
|
+
let gateable = props.rel === "stylesheet" && props.href != null;
|
|
1038
|
+
let attrs = null;
|
|
1039
|
+
for (const name in props) {
|
|
1040
|
+
if (name === "rel" || name === "href") continue;
|
|
1041
|
+
if (!STYLESHEET_FETCH_META.has(name)) gateable = false;
|
|
1042
|
+
if (!HEAD_ATTR_NAME.test(name)) continue;
|
|
1043
|
+
const v = props[name];
|
|
1044
|
+
if (v == null || v === false) continue;
|
|
1045
|
+
(attrs || (attrs = {}))[name] = v === true ? "" : String(v);
|
|
1046
|
+
}
|
|
1047
|
+
if (attrs) descriptor.attrs = attrs;
|
|
1048
|
+
effect(() => {
|
|
1049
|
+
const entry = warmAsset(descriptor);
|
|
1050
|
+
if (gateable && entry.loadState === "pending" && typeof waitAsset === "function") waitAsset(entry.loadPromise);
|
|
1051
|
+
}, () => acquireAsset(descriptor));
|
|
1052
|
+
}
|
|
1053
|
+
function useHead(tags) {
|
|
1054
|
+
initHeadRegistry();
|
|
1055
|
+
const reg = {
|
|
1056
|
+
seq: -1,
|
|
1057
|
+
tags: null
|
|
1058
|
+
};
|
|
1059
|
+
const uid = ++headUid;
|
|
1060
|
+
effect(() => {
|
|
1061
|
+
let list = typeof tags === "function" ? tags() : tags;
|
|
1062
|
+
if (!Array.isArray(list)) list = [list];
|
|
1063
|
+
const replaceable = [];
|
|
1064
|
+
const resources = [];
|
|
1065
|
+
for (let i = 0; i < list.length; i++) {
|
|
1066
|
+
const desc = list[i];
|
|
1067
|
+
if (!desc || !HEAD_ELIGIBLE_TAGS.has(desc.tag)) {
|
|
1068
|
+
console.warn(`useHead: ignoring non-head tag`, desc);
|
|
1069
|
+
continue;
|
|
1070
|
+
}
|
|
1071
|
+
const cls = classifyHeadTag(desc);
|
|
1072
|
+
const props = evalHeadProps(desc.props || {}, cls.rel !== undefined ? {
|
|
1073
|
+
rel: cls.rel
|
|
1074
|
+
} : undefined);
|
|
1075
|
+
if (cls.resource) {
|
|
1076
|
+
if (desc.tag === "link" && (props.rel === "stylesheet" || props.rel === "modulepreload")) {
|
|
1077
|
+
gateHeadResource(props);
|
|
1078
|
+
} else if (desc.tag === "link") {
|
|
1079
|
+
mountHeadResource(desc.tag, props);
|
|
1080
|
+
} else {
|
|
1081
|
+
resources.push({
|
|
1082
|
+
tag: desc.tag,
|
|
1083
|
+
props
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
} else {
|
|
1087
|
+
const key = evalHeadValue(desc.key);
|
|
1088
|
+
replaceable.push({
|
|
1089
|
+
tag: desc.tag,
|
|
1090
|
+
props,
|
|
1091
|
+
identity: replaceableIdentity(desc.tag, props, key, "u:c" + uid + ":" + i)
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
return {
|
|
1096
|
+
replaceable,
|
|
1097
|
+
resources
|
|
1098
|
+
};
|
|
1099
|
+
}, evaluated => {
|
|
1100
|
+
for (let i = 0; i < evaluated.resources.length; i++) {
|
|
1101
|
+
mountHeadResource(evaluated.resources[i].tag, evaluated.resources[i].props);
|
|
1102
|
+
}
|
|
1103
|
+
reg.tags = evaluated.replaceable;
|
|
1104
|
+
if (reg.seq < 0) reg.seq = ++headSeq;
|
|
1105
|
+
if (headRegistrations.indexOf(reg) === -1) headRegistrations.push(reg);
|
|
1106
|
+
scheduleHeadApply();
|
|
1107
|
+
return () => {
|
|
1108
|
+
const idx = headRegistrations.indexOf(reg);
|
|
1109
|
+
if (idx > -1) headRegistrations.splice(idx, 1);
|
|
1110
|
+
scheduleHeadApply();
|
|
1111
|
+
};
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
function loadModuleAssets(mapping) {
|
|
1115
|
+
const hy = globalThis._$HY;
|
|
1116
|
+
if (!hy) return;
|
|
1117
|
+
const pending = [];
|
|
1118
|
+
for (const key in mapping) {
|
|
1119
|
+
if (hy.modules[key]) continue;
|
|
1120
|
+
const entryUrl = mapping[key];
|
|
1121
|
+
if (!hy.loading[key]) {
|
|
1122
|
+
hy.loading[key] = import(entryUrl).then(mod => {
|
|
1123
|
+
hy.modules[key] = mod;
|
|
1124
|
+
}, err => {
|
|
1125
|
+
delete hy.loading[key];
|
|
1126
|
+
throw err;
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
pending.push(hy.loading[key]);
|
|
1130
|
+
}
|
|
1131
|
+
return pending.length ? Promise.all(pending).then(() => {}) : undefined;
|
|
255
1132
|
}
|
|
256
1133
|
function hydrate$1(code, element, options = {}) {
|
|
257
|
-
|
|
1134
|
+
installHydrationRuntime();
|
|
1135
|
+
if (globalThis._$HY.done) return render$1(code, element, [...element.childNodes], options);
|
|
258
1136
|
options.renderId ||= "";
|
|
1137
|
+
if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
|
|
1138
|
+
if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
|
|
259
1139
|
solidJs.sharedConfig.completed = globalThis._$HY.completed;
|
|
260
1140
|
solidJs.sharedConfig.events = globalThis._$HY.events;
|
|
261
1141
|
solidJs.sharedConfig.load = id => globalThis._$HY.r[id];
|
|
262
1142
|
solidJs.sharedConfig.has = id => id in globalThis._$HY.r;
|
|
263
1143
|
solidJs.sharedConfig.gather = root => gatherHydratable(element, root);
|
|
1144
|
+
solidJs.sharedConfig.loadModuleAssets = loadModuleAssets;
|
|
1145
|
+
solidJs.sharedConfig.cleanupFragment = id => {
|
|
1146
|
+
const tpl = document.getElementById("pl-" + id);
|
|
1147
|
+
if (tpl) {
|
|
1148
|
+
let node = tpl.nextSibling;
|
|
1149
|
+
while (node) {
|
|
1150
|
+
const next = node.nextSibling;
|
|
1151
|
+
if (node.nodeType === 8 && node.nodeValue === "pl-" + id) {
|
|
1152
|
+
node.remove();
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
node.remove();
|
|
1156
|
+
node = next;
|
|
1157
|
+
}
|
|
1158
|
+
tpl.remove();
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
264
1161
|
solidJs.sharedConfig.registry = new Map();
|
|
1162
|
+
if (!solidJs.sharedConfig.boundaryScopes) solidJs.sharedConfig.boundaryScopes = new Map();
|
|
1163
|
+
solidJs.sharedConfig.captureBoundaryScope = id => {
|
|
1164
|
+
if (solidJs.sharedConfig.registry) solidJs.sharedConfig.boundaryScopes.set(id, {
|
|
1165
|
+
registry: solidJs.sharedConfig.registry,
|
|
1166
|
+
gather: solidJs.sharedConfig.gather
|
|
1167
|
+
});
|
|
1168
|
+
};
|
|
265
1169
|
solidJs.sharedConfig.hydrating = true;
|
|
1170
|
+
{
|
|
1171
|
+
solidJs.sharedConfig.verifyHydration = () => {
|
|
1172
|
+
if (solidJs.sharedConfig.registry && solidJs.sharedConfig.registry.size) {
|
|
1173
|
+
const orphaned = [...solidJs.sharedConfig.registry.values()].filter(node => node.isConnected);
|
|
1174
|
+
solidJs.sharedConfig.registry.clear();
|
|
1175
|
+
if (!orphaned.length) return;
|
|
1176
|
+
console.warn(`Hydration completed with ${orphaned.length} unclaimed server-rendered node(s):\n` + orphaned.map(node => ` ${node.outerHTML.slice(0, 100)}`).join("\n"));
|
|
1177
|
+
}
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
const hyr = globalThis._$HY.r;
|
|
1181
|
+
const rootMapping = hyr && (hyr[options.renderId + "_assets"] || hyr["_assets"]);
|
|
1182
|
+
if (rootMapping && typeof rootMapping === "object") {
|
|
1183
|
+
const p = loadModuleAssets(rootMapping);
|
|
1184
|
+
if (p) {
|
|
1185
|
+
gatherHydratable(element, options.renderId);
|
|
1186
|
+
const registry = solidJs.sharedConfig.registry;
|
|
1187
|
+
const gather = solidJs.sharedConfig.gather;
|
|
1188
|
+
let disposer;
|
|
1189
|
+
p.then(() => {
|
|
1190
|
+
solidJs.sharedConfig.registry = registry;
|
|
1191
|
+
solidJs.sharedConfig.gather = gather;
|
|
1192
|
+
solidJs.sharedConfig.hydrating = true;
|
|
1193
|
+
try {
|
|
1194
|
+
disposer = render$1(code, element, [...element.childNodes], options);
|
|
1195
|
+
} finally {
|
|
1196
|
+
solidJs.sharedConfig.hydrating = false;
|
|
1197
|
+
}
|
|
1198
|
+
}, err => {
|
|
1199
|
+
console.error("Hydration module preload failed, falling back to client render:", err);
|
|
1200
|
+
solidJs.sharedConfig.hydrating = false;
|
|
1201
|
+
solidJs.sharedConfig.registry = undefined;
|
|
1202
|
+
disposer = render$1(code, element, [...element.childNodes], options);
|
|
1203
|
+
});
|
|
1204
|
+
return () => disposer && disposer();
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
266
1207
|
try {
|
|
267
1208
|
gatherHydratable(element, options.renderId);
|
|
268
|
-
return render(code, element, [...element.childNodes], options);
|
|
1209
|
+
return render$1(code, element, [...element.childNodes], options);
|
|
269
1210
|
} finally {
|
|
270
1211
|
solidJs.sharedConfig.hydrating = false;
|
|
271
1212
|
}
|
|
@@ -275,11 +1216,16 @@ function getNextElement(template) {
|
|
|
275
1216
|
key,
|
|
276
1217
|
hydrating = isHydrating();
|
|
277
1218
|
if (!hydrating || !(node = solidJs.sharedConfig.registry.get(key = getHydrationKey()))) {
|
|
278
|
-
if (
|
|
279
|
-
|
|
280
|
-
|
|
1219
|
+
if (!template) {
|
|
1220
|
+
throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}`);
|
|
1221
|
+
}
|
|
1222
|
+
return template(true);
|
|
1223
|
+
}
|
|
1224
|
+
if (template && template._html) {
|
|
1225
|
+
const expected = template._html.match(/^<(\w+)/)?.[1];
|
|
1226
|
+
if (expected && node.localName !== expected) {
|
|
1227
|
+
console.warn(`Hydration tag mismatch for key "${key}": expected <${expected}> but found`, node);
|
|
281
1228
|
}
|
|
282
|
-
return template();
|
|
283
1229
|
}
|
|
284
1230
|
if (solidJs.sharedConfig.completed) solidJs.sharedConfig.completed.add(node);
|
|
285
1231
|
solidJs.sharedConfig.registry.delete(key);
|
|
@@ -308,6 +1254,50 @@ function getNextMarker(start) {
|
|
|
308
1254
|
}
|
|
309
1255
|
return [end, current];
|
|
310
1256
|
}
|
|
1257
|
+
function getFirstChild(node, expectedTag) {
|
|
1258
|
+
const child = node.firstChild;
|
|
1259
|
+
if (isHydrating() && expectedTag && child?.localName !== expectedTag) {
|
|
1260
|
+
const isMissing = !child || child.nodeType !== 1;
|
|
1261
|
+
console.warn("Hydration structure mismatch: expected <" + expectedTag + "> as first child of", node, "\n " + describeSiblings(node, child, expectedTag, isMissing));
|
|
1262
|
+
}
|
|
1263
|
+
return child;
|
|
1264
|
+
}
|
|
1265
|
+
function getNextSibling(node, expectedTag) {
|
|
1266
|
+
const sibling = node.nextSibling;
|
|
1267
|
+
if (isHydrating() && expectedTag && sibling?.localName !== expectedTag) {
|
|
1268
|
+
const parent = node.parentNode;
|
|
1269
|
+
const isMissing = !sibling || sibling.nodeType !== 1;
|
|
1270
|
+
console.warn("Hydration structure mismatch: expected <" + expectedTag + "> after", node, "in", parent, "\n " + describeSiblings(parent, sibling, expectedTag, isMissing));
|
|
1271
|
+
}
|
|
1272
|
+
return sibling;
|
|
1273
|
+
}
|
|
1274
|
+
function describeSiblings(parent, mismatchChild, expectedTag, isMissing) {
|
|
1275
|
+
if (!parent) return `<${expectedTag} \u2190 parent unavailable>`;
|
|
1276
|
+
const children = [];
|
|
1277
|
+
let child = parent.firstChild;
|
|
1278
|
+
while (child) {
|
|
1279
|
+
if (child.nodeType === 1) children.push(child);
|
|
1280
|
+
child = child.nextSibling;
|
|
1281
|
+
}
|
|
1282
|
+
const pTag = parent.localName || "#fragment";
|
|
1283
|
+
if (isMissing) {
|
|
1284
|
+
const tags = children.map(c => `<${c.localName}>`).join("");
|
|
1285
|
+
return `<${pTag}>${tags}<${expectedTag} \u2190 missing></${pTag}>`;
|
|
1286
|
+
}
|
|
1287
|
+
const idx = children.indexOf(mismatchChild);
|
|
1288
|
+
let start = 0,
|
|
1289
|
+
end = children.length;
|
|
1290
|
+
let prefix = "",
|
|
1291
|
+
suffix = "";
|
|
1292
|
+
if (children.length > 6) {
|
|
1293
|
+
start = Math.max(0, idx - 2);
|
|
1294
|
+
end = Math.min(children.length, idx + 3);
|
|
1295
|
+
if (start > 0) prefix = "...";
|
|
1296
|
+
if (end < children.length) suffix = "...";
|
|
1297
|
+
}
|
|
1298
|
+
const tags = children.slice(start, end).map(c => c === mismatchChild ? `<${c.localName} \u2190 expected ${expectedTag}>` : `<${c.localName}>`).join("");
|
|
1299
|
+
return `<${pTag}>${prefix}${tags}${suffix}</${pTag}>`;
|
|
1300
|
+
}
|
|
311
1301
|
function runHydrationEvents() {
|
|
312
1302
|
if (solidJs.sharedConfig.events && !solidJs.sharedConfig.events.queued) {
|
|
313
1303
|
queueMicrotask(() => {
|
|
@@ -321,7 +1311,32 @@ function runHydrationEvents() {
|
|
|
321
1311
|
const [el, e] = events[0];
|
|
322
1312
|
if (!completed.has(el)) return;
|
|
323
1313
|
events.shift();
|
|
324
|
-
|
|
1314
|
+
let matchContainer, matchState, matchDistance, matches;
|
|
1315
|
+
for (const [container, state] of delegatedContainers) {
|
|
1316
|
+
if (!state.handlers.has(e.type)) continue;
|
|
1317
|
+
const entry = findOwner(e.target, state);
|
|
1318
|
+
if (!entry) continue;
|
|
1319
|
+
if (matchContainer) {
|
|
1320
|
+
if (!matches) matches = [{
|
|
1321
|
+
container: matchContainer,
|
|
1322
|
+
state: matchState,
|
|
1323
|
+
distance: matchDistance
|
|
1324
|
+
}];
|
|
1325
|
+
matches.push({
|
|
1326
|
+
container,
|
|
1327
|
+
state,
|
|
1328
|
+
distance: entry.distance
|
|
1329
|
+
});
|
|
1330
|
+
} else {
|
|
1331
|
+
matchContainer = container;
|
|
1332
|
+
matchState = state;
|
|
1333
|
+
matchDistance = entry.distance;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
if (matches) {
|
|
1337
|
+
matches.sort((a, b) => a.distance - b.distance);
|
|
1338
|
+
for (let i = 0; i < matches.length; i++) eventHandler(e, matches[i].container, matches[i].state);
|
|
1339
|
+
} else if (matchContainer) eventHandler(e, matchContainer, matchState);
|
|
325
1340
|
}
|
|
326
1341
|
if (solidJs.sharedConfig.done) {
|
|
327
1342
|
solidJs.sharedConfig.events = _$HY.events = null;
|
|
@@ -332,16 +1347,31 @@ function runHydrationEvents() {
|
|
|
332
1347
|
}
|
|
333
1348
|
}
|
|
334
1349
|
function isHydrating(node) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
1350
|
+
if (!solidJs.sharedConfig.hydrating) return false;
|
|
1351
|
+
if (!node || node.isConnected) return true;
|
|
1352
|
+
const roots = solidJs.sharedConfig.claimRoots;
|
|
1353
|
+
if (roots) {
|
|
1354
|
+
for (let i = 0; i < roots.length; i++) {
|
|
1355
|
+
if (roots[i].contains(node)) return true;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
return false;
|
|
340
1359
|
}
|
|
341
1360
|
function classListToObject(classList) {
|
|
342
1361
|
if (Array.isArray(classList)) {
|
|
343
1362
|
const result = {};
|
|
344
1363
|
flattenClassList(classList, result);
|
|
1364
|
+
classList = result;
|
|
1365
|
+
}
|
|
1366
|
+
if (classList && typeof classList === "object") {
|
|
1367
|
+
const result = {},
|
|
1368
|
+
keys = Object.keys(classList);
|
|
1369
|
+
for (let i = 0, len = keys.length; i < len; i++) {
|
|
1370
|
+
const key = keys[i];
|
|
1371
|
+
if (!classList[key]) continue;
|
|
1372
|
+
const classNames = key.trim().split(/\s+/);
|
|
1373
|
+
for (let j = 0, nameLen = classNames.length; j < nameLen; j++) classNames[j] && (result[classNames[j]] = true);
|
|
1374
|
+
}
|
|
345
1375
|
return result;
|
|
346
1376
|
}
|
|
347
1377
|
return classList;
|
|
@@ -352,18 +1382,16 @@ function flattenClassList(list, result) {
|
|
|
352
1382
|
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;
|
|
353
1383
|
}
|
|
354
1384
|
}
|
|
355
|
-
function assignProp(node, prop, value, prev,
|
|
356
|
-
let forceProp;
|
|
1385
|
+
function assignProp(node, prop, value, prev, skipRef, nodeName) {
|
|
357
1386
|
if (prop === "style") return style(node, value, prev), value;
|
|
358
|
-
if (prop === "class") return className(node, value,
|
|
359
|
-
if (value === prev) return prev;
|
|
1387
|
+
if (prop === "class") return className(node, value, prev), value;
|
|
1388
|
+
if (value === prev && DOMWithState[nodeName]?.[prop] !== 1) return prev;
|
|
360
1389
|
if (prop === "ref") {
|
|
361
|
-
if (!skipRef) value
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
} else if (prop.slice(0, 2) === "on") {
|
|
1390
|
+
if (!skipRef && value) ref(() => value, node);
|
|
1391
|
+
return value;
|
|
1392
|
+
}
|
|
1393
|
+
const hasNamespace = prop.indexOf(":") > -1;
|
|
1394
|
+
if (!hasNamespace && prop.slice(0, 2) === "on") {
|
|
367
1395
|
const name = prop.slice(2).toLowerCase();
|
|
368
1396
|
const delegate = DelegatedEvents.has(name);
|
|
369
1397
|
if (!delegate && prev) {
|
|
@@ -371,26 +1399,34 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
371
1399
|
node.removeEventListener(name, h);
|
|
372
1400
|
}
|
|
373
1401
|
if (delegate || value) {
|
|
374
|
-
|
|
1402
|
+
addEvent(node, name, value, delegate);
|
|
375
1403
|
delegate && delegateEvents([name]);
|
|
376
1404
|
}
|
|
377
|
-
} else if (
|
|
378
|
-
if (
|
|
379
|
-
if (prop === "value" &&
|
|
1405
|
+
} else if (hasNamespace && prop.slice(0, 5) === "prop:" || ChildProperties.has(prop) || DOMWithState[nodeName]?.[prop]) {
|
|
1406
|
+
if (hasNamespace) prop = prop.slice(5);else if (isHydrating(node)) return value;
|
|
1407
|
+
if (prop === "value" && nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else if ((prop === "value" || prop === "defaultValue") && (nodeName === "INPUT" || nodeName === "TEXTAREA"))
|
|
1408
|
+
node[prop] = value ?? "";else node[prop] = value;
|
|
380
1409
|
} else {
|
|
381
|
-
const ns =
|
|
1410
|
+
const ns = hasNamespace && Namespaces[prop.split(":")[0]];
|
|
382
1411
|
if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, prop, value);
|
|
383
1412
|
}
|
|
384
1413
|
return value;
|
|
385
1414
|
}
|
|
386
|
-
function eventHandler(e) {
|
|
387
|
-
if (
|
|
388
|
-
|
|
1415
|
+
function eventHandler(e, container, state) {
|
|
1416
|
+
if (hydrationRt !== null && hydrationRt.dedupEvent(e)) return;
|
|
1417
|
+
const prev = e[$$EVENT_OWNER];
|
|
1418
|
+
let resumeNode;
|
|
1419
|
+
if (prev) {
|
|
1420
|
+
if (prev === true || prev === container || !container.contains(prev)) return;
|
|
1421
|
+
resumeNode = prev;
|
|
389
1422
|
}
|
|
390
|
-
|
|
1423
|
+
const owner = state && (state.owners.size === 1 && state.owners.has(container) ? container : findOwner(e.target, state)?.owner);
|
|
1424
|
+
if (state && !owner) return;
|
|
1425
|
+
e[$$EVENT_OWNER] = owner || true;
|
|
1426
|
+
let node = resumeNode || e.target;
|
|
391
1427
|
const key = `$$${e.type}`;
|
|
392
1428
|
const oriTarget = e.target;
|
|
393
|
-
const
|
|
1429
|
+
const boundary = owner || container || e.currentTarget;
|
|
394
1430
|
const retarget = value => Object.defineProperty(e, "target", {
|
|
395
1431
|
configurable: true,
|
|
396
1432
|
value
|
|
@@ -406,52 +1442,72 @@ function eventHandler(e) {
|
|
|
406
1442
|
return true;
|
|
407
1443
|
};
|
|
408
1444
|
const walkUpTree = () => {
|
|
409
|
-
while (handleNode()
|
|
1445
|
+
while (handleNode()) {
|
|
1446
|
+
if (node === boundary || node.parentNode === boundary) break;
|
|
1447
|
+
node = node._$host || node.parentNode || node.host;
|
|
1448
|
+
}
|
|
410
1449
|
};
|
|
411
1450
|
Object.defineProperty(e, "currentTarget", {
|
|
412
1451
|
configurable: true,
|
|
413
1452
|
get() {
|
|
414
|
-
return node || document;
|
|
1453
|
+
return node || boundary || document;
|
|
415
1454
|
}
|
|
416
1455
|
});
|
|
417
|
-
if (
|
|
418
|
-
|
|
1456
|
+
if (resumeNode) {
|
|
1457
|
+
if (resumeNode === e.target) node = resumeNode._$host || resumeNode.parentNode || resumeNode.host;
|
|
1458
|
+
if (node && node !== boundary) walkUpTree();
|
|
1459
|
+
} else if (e.composedPath) {
|
|
419
1460
|
const path = e.composedPath();
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
1461
|
+
if (path.length) {
|
|
1462
|
+
retarget(path[0]);
|
|
1463
|
+
for (let i = 0; i < path.length; i++) {
|
|
1464
|
+
node = path[i];
|
|
1465
|
+
if (!handleNode()) break;
|
|
1466
|
+
if (node._$host) {
|
|
1467
|
+
node = node._$host;
|
|
1468
|
+
walkUpTree();
|
|
1469
|
+
break;
|
|
1470
|
+
}
|
|
1471
|
+
if (node === boundary || node.parentNode === boundary) {
|
|
1472
|
+
break;
|
|
1473
|
+
}
|
|
431
1474
|
}
|
|
432
|
-
}
|
|
1475
|
+
} else walkUpTree();
|
|
433
1476
|
}
|
|
434
1477
|
else walkUpTree();
|
|
435
1478
|
retarget(oriTarget);
|
|
436
1479
|
}
|
|
437
1480
|
function insertExpression(parent, value, current, marker) {
|
|
438
|
-
if (isHydrating(parent))
|
|
439
|
-
|
|
1481
|
+
if (hydrationRt !== null && isHydrating(parent)) {
|
|
1482
|
+
if (value && value !== current) for (const n of Array.isArray(value) ? value : [value]) if (n && n.nodeType && !isHydrating(n)) return current;
|
|
1483
|
+
return value;
|
|
1484
|
+
}
|
|
1485
|
+
if (value === current) return value;
|
|
440
1486
|
const t = typeof value,
|
|
441
1487
|
multi = marker !== undefined;
|
|
442
1488
|
if (t === "string" || t === "number") {
|
|
443
1489
|
const tc = typeof current;
|
|
444
1490
|
if (tc === "string" || tc === "number") {
|
|
445
1491
|
parent.firstChild.data = value;
|
|
446
|
-
} else
|
|
1492
|
+
} else {
|
|
1493
|
+
if (ownsAllChildren(parent, current)) parent.textContent = value;else {
|
|
1494
|
+
removeOwnedChildren(parent, current);
|
|
1495
|
+
parent.insertBefore(document.createTextNode(value), parent.firstChild);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
447
1498
|
} else if (value === undefined) {
|
|
448
1499
|
cleanChildren(parent, current, marker);
|
|
449
1500
|
} else if (value.nodeType) {
|
|
450
1501
|
if (Array.isArray(current)) {
|
|
451
1502
|
cleanChildren(parent, current, multi ? marker : null, value);
|
|
452
|
-
} else if (current
|
|
1503
|
+
} else if (current && current.nodeType) {
|
|
1504
|
+
current.parentNode === parent ? parent.replaceChild(value, current) : parent.appendChild(value);
|
|
1505
|
+
} else if (current && parent.firstChild) {
|
|
1506
|
+
parent.replaceChild(value, parent.firstChild);
|
|
1507
|
+
} else {
|
|
453
1508
|
parent.appendChild(value);
|
|
454
|
-
}
|
|
1509
|
+
}
|
|
1510
|
+
if (marker) value[$$SLOT] = marker;
|
|
455
1511
|
} else if (Array.isArray(value)) {
|
|
456
1512
|
const currentArray = current && Array.isArray(current);
|
|
457
1513
|
if (value.length === 0) {
|
|
@@ -459,12 +1515,13 @@ function insertExpression(parent, value, current, marker) {
|
|
|
459
1515
|
} else if (currentArray) {
|
|
460
1516
|
if (current.length === 0) {
|
|
461
1517
|
appendNodes(parent, value, marker);
|
|
462
|
-
} else reconcileArrays(parent, current, value);
|
|
1518
|
+
} else reconcileArrays(parent, current, value, marker);
|
|
463
1519
|
} else {
|
|
464
|
-
current && cleanChildren(parent);
|
|
1520
|
+
current && cleanChildren(parent, current);
|
|
465
1521
|
appendNodes(parent, value);
|
|
466
1522
|
}
|
|
467
1523
|
} else console.warn(`Unrecognized value. Skipped inserting`, value);
|
|
1524
|
+
return value;
|
|
468
1525
|
}
|
|
469
1526
|
function normalize(value, current, multi, doNotUnwrap) {
|
|
470
1527
|
value = solidJs.flatten(value, {
|
|
@@ -478,44 +1535,87 @@ function normalize(value, current, multi, doNotUnwrap) {
|
|
|
478
1535
|
const item = value[i],
|
|
479
1536
|
prev = current && current[i],
|
|
480
1537
|
t = typeof item;
|
|
481
|
-
if (t === "string" || t === "number") value[i] = prev && prev.nodeType === 3 && prev.data === item ? prev : document.createTextNode(item);
|
|
1538
|
+
if (t === "string" || t === "number") value[i] = prev && prev.nodeType === 3 && (solidJs.sharedConfig.hydrating || prev.data === "" + item) ? prev : document.createTextNode(item);
|
|
482
1539
|
}
|
|
483
1540
|
}
|
|
484
1541
|
return value;
|
|
485
1542
|
}
|
|
1543
|
+
function tagHost(value, host) {
|
|
1544
|
+
if (Array.isArray(value)) {
|
|
1545
|
+
for (let i = 0, len = value.length; i < len; i++) tagHost(value[i], host);
|
|
1546
|
+
} else if (value && value.nodeType && value[$$HOST] !== host) {
|
|
1547
|
+
value[$$HOST] = host;
|
|
1548
|
+
Object.defineProperty(value, "_$host", {
|
|
1549
|
+
get: host,
|
|
1550
|
+
configurable: true
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
486
1554
|
function appendNodes(parent, array, marker = null) {
|
|
487
|
-
for (let i = 0, len = array.length; i < len; i++)
|
|
1555
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
1556
|
+
const n = array[i];
|
|
1557
|
+
parent.insertBefore(n, marker);
|
|
1558
|
+
if (marker) n[$$SLOT] = marker;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
function ownsAllChildren(parent, current) {
|
|
1562
|
+
if (current == null) return true;
|
|
1563
|
+
if (Array.isArray(current)) {
|
|
1564
|
+
return current.length ? parent.firstChild === current[0] && parent.lastChild === current[current.length - 1] : parent.firstChild === null;
|
|
1565
|
+
}
|
|
1566
|
+
if (current === "") return parent.firstChild === null;
|
|
1567
|
+
if (current.nodeType) return parent.firstChild === current && parent.lastChild === current;
|
|
1568
|
+
const first = parent.firstChild;
|
|
1569
|
+
return first !== null && first.nodeType === 3 && parent.lastChild === first;
|
|
1570
|
+
}
|
|
1571
|
+
function removeOwnedChildren(parent, current) {
|
|
1572
|
+
if (Array.isArray(current)) {
|
|
1573
|
+
for (let i = 0; i < current.length; i++) {
|
|
1574
|
+
const el = current[i];
|
|
1575
|
+
if (el.parentNode === parent) el.remove();
|
|
1576
|
+
}
|
|
1577
|
+
} else if (current.nodeType) {
|
|
1578
|
+
if (current.parentNode === parent) current.remove();
|
|
1579
|
+
} else {
|
|
1580
|
+
const first = parent.firstChild;
|
|
1581
|
+
if (first && first.nodeType === 3) first.remove();
|
|
1582
|
+
}
|
|
488
1583
|
}
|
|
489
1584
|
function cleanChildren(parent, current, marker, replacement) {
|
|
490
|
-
if (marker === undefined)
|
|
1585
|
+
if (marker === undefined) {
|
|
1586
|
+
if (ownsAllChildren(parent, current)) return parent.textContent = "";
|
|
1587
|
+
return removeOwnedChildren(parent, current);
|
|
1588
|
+
}
|
|
491
1589
|
if (current.length) {
|
|
492
1590
|
let inserted = false;
|
|
493
1591
|
for (let i = current.length - 1; i >= 0; i--) {
|
|
494
1592
|
const el = current[i];
|
|
495
1593
|
if (replacement !== el) {
|
|
496
|
-
const
|
|
497
|
-
|
|
1594
|
+
const tag = el[$$SLOT];
|
|
1595
|
+
const owns = el.parentNode === parent && (!tag || tag === marker);
|
|
1596
|
+
if (replacement && !inserted && !i) owns ? parent.replaceChild(replacement, el) : parent.insertBefore(replacement, marker);else if (owns) el.remove();
|
|
498
1597
|
} else inserted = true;
|
|
499
1598
|
}
|
|
500
1599
|
} else if (replacement) parent.insertBefore(replacement, marker);
|
|
1600
|
+
if (replacement && marker) replacement[$$SLOT] = marker;
|
|
501
1601
|
}
|
|
502
1602
|
function gatherHydratable(element, root) {
|
|
503
1603
|
const templates = element.querySelectorAll(`*[_hk]`);
|
|
504
1604
|
for (let i = 0; i < templates.length; i++) {
|
|
505
1605
|
const node = templates[i];
|
|
506
1606
|
const key = node.getAttribute("_hk");
|
|
507
|
-
if (
|
|
1607
|
+
if (root) {
|
|
1608
|
+
if (!key.startsWith(root)) continue;
|
|
1609
|
+
} else {
|
|
1610
|
+
const frame = node.closest("[data-fid]");
|
|
1611
|
+
if (frame && frame !== element && element.contains(frame)) continue;
|
|
1612
|
+
}
|
|
1613
|
+
if (!solidJs.sharedConfig.registry.has(key)) solidJs.sharedConfig.registry.set(key, node);
|
|
508
1614
|
}
|
|
509
1615
|
}
|
|
510
1616
|
function getHydrationKey() {
|
|
511
1617
|
return solidJs.sharedConfig.getNextContextId();
|
|
512
1618
|
}
|
|
513
|
-
function NoHydration(props) {
|
|
514
|
-
return solidJs.sharedConfig.hydrating ? undefined : props.children;
|
|
515
|
-
}
|
|
516
|
-
function Hydration(props) {
|
|
517
|
-
return props.children;
|
|
518
|
-
}
|
|
519
1619
|
const voidFn = () => undefined;
|
|
520
1620
|
const RequestContext = Symbol();
|
|
521
1621
|
|
|
@@ -526,112 +1626,337 @@ function throwInBrowser(func) {
|
|
|
526
1626
|
function renderToString(fn, options) {
|
|
527
1627
|
throwInBrowser(renderToString);
|
|
528
1628
|
}
|
|
529
|
-
function renderToStringAsync(fn, options) {
|
|
530
|
-
throwInBrowser(renderToStringAsync);
|
|
531
|
-
}
|
|
532
1629
|
function renderToStream(fn, options) {
|
|
533
1630
|
throwInBrowser(renderToStream);
|
|
534
1631
|
}
|
|
1632
|
+
function createResponseStub() {
|
|
1633
|
+
throwInBrowser(createResponseStub);
|
|
1634
|
+
}
|
|
1635
|
+
function createRequestEvent(request, init) {
|
|
1636
|
+
throwInBrowser(createRequestEvent);
|
|
1637
|
+
}
|
|
1638
|
+
function getExpectedRedirectStatus(response) {
|
|
1639
|
+
throwInBrowser(getExpectedRedirectStatus);
|
|
1640
|
+
}
|
|
1641
|
+
function createSSRResponse() {
|
|
1642
|
+
throwInBrowser(createSSRResponse);
|
|
1643
|
+
}
|
|
1644
|
+
function commitEventResponse(response, event) {
|
|
1645
|
+
throwInBrowser(commitEventResponse);
|
|
1646
|
+
}
|
|
1647
|
+
function composeMiddleware(middlewares) {
|
|
1648
|
+
throwInBrowser(composeMiddleware);
|
|
1649
|
+
}
|
|
535
1650
|
function ssr(template, ...nodes) {}
|
|
536
1651
|
function ssrElement(name, props, children, needsId) {}
|
|
537
|
-
function
|
|
1652
|
+
function ssrClassName(value) {}
|
|
538
1653
|
function ssrStyle(value) {}
|
|
1654
|
+
function ssrStyleProperty(name, value) {}
|
|
539
1655
|
function ssrAttribute(key, value) {}
|
|
1656
|
+
function ssrGroup(fn, n) {}
|
|
540
1657
|
function ssrHydrationKey() {}
|
|
541
|
-
function resolveSSRNode(node) {}
|
|
542
|
-
function escape(
|
|
1658
|
+
function resolveSSRNode(node, result, top) {}
|
|
1659
|
+
function escape(s, attr) {}
|
|
543
1660
|
|
|
1661
|
+
const ENVELOPE = Symbol.for("solid.ResponseEnvelope");
|
|
1662
|
+
// PURE-annotated factory (same convention as solid's MockPromise): the brand
|
|
1663
|
+
const ResponseEnvelope = /* @__PURE__ */(() => {
|
|
1664
|
+
class ResponseEnvelope {
|
|
1665
|
+
constructor(response, value) {
|
|
1666
|
+
this.response = response;
|
|
1667
|
+
this.value = value;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
ResponseEnvelope.prototype[ENVELOPE] = true;
|
|
1671
|
+
return ResponseEnvelope;
|
|
1672
|
+
})();
|
|
1673
|
+
function isResponseEnvelope(value) {
|
|
1674
|
+
return !!(value && typeof value === "object" && value[ENVELOPE]);
|
|
1675
|
+
}
|
|
1676
|
+
const HREF = Symbol.for("solid.Href");
|
|
1677
|
+
function isHref(value) {
|
|
1678
|
+
return !!(value && (typeof value === "object" || typeof value === "function") && value[HREF]);
|
|
1679
|
+
}
|
|
1680
|
+
const SAFE_ERROR = Symbol.for("solid.SafeError");
|
|
1681
|
+
function markSafeError(error) {
|
|
1682
|
+
if (error && (typeof error === "object" || typeof error === "function")) {
|
|
1683
|
+
Object.defineProperty(error, SAFE_ERROR, {
|
|
1684
|
+
value: true,
|
|
1685
|
+
enumerable: false,
|
|
1686
|
+
configurable: true
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
return error;
|
|
1690
|
+
}
|
|
1691
|
+
function isSafeError(value) {
|
|
1692
|
+
return !!(value && (typeof value === "object" || typeof value === "function") && value[SAFE_ERROR]);
|
|
1693
|
+
}
|
|
1694
|
+
const REVALIDATE_HEADER = "X-Revalidate";
|
|
1695
|
+
function initWithRevalidate(init) {
|
|
1696
|
+
const {
|
|
1697
|
+
revalidate,
|
|
1698
|
+
...responseInit
|
|
1699
|
+
} = init;
|
|
1700
|
+
let headers;
|
|
1701
|
+
if (responseInit.headers && responseInit.headers.getSetCookie) {
|
|
1702
|
+
headers = new Headers();
|
|
1703
|
+
responseInit.headers.forEach((value, key) => {
|
|
1704
|
+
if (key !== "set-cookie") headers.append(key, value);
|
|
1705
|
+
});
|
|
1706
|
+
for (const cookie of responseInit.headers.getSetCookie()) {
|
|
1707
|
+
headers.append("Set-Cookie", cookie);
|
|
1708
|
+
}
|
|
1709
|
+
} else {
|
|
1710
|
+
headers = new Headers(responseInit.headers);
|
|
1711
|
+
}
|
|
1712
|
+
revalidate !== undefined && headers.set(REVALIDATE_HEADER, revalidate.toString());
|
|
1713
|
+
return {
|
|
1714
|
+
responseInit,
|
|
1715
|
+
headers
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
function redirect(url, init = 302) {
|
|
1719
|
+
if (typeof url !== "string" && !isHref(url)) {
|
|
1720
|
+
throw new TypeError("redirect() expects a string URL or an Href-branded value (Symbol.for('solid.Href')).");
|
|
1721
|
+
}
|
|
1722
|
+
const {
|
|
1723
|
+
responseInit,
|
|
1724
|
+
headers
|
|
1725
|
+
} = initWithRevalidate(typeof init === "number" ? {
|
|
1726
|
+
status: init
|
|
1727
|
+
} : init);
|
|
1728
|
+
if (responseInit.status === undefined) {
|
|
1729
|
+
responseInit.status = 302;
|
|
1730
|
+
}
|
|
1731
|
+
headers.set("Location", String(url));
|
|
1732
|
+
return new Response(null, {
|
|
1733
|
+
...responseInit,
|
|
1734
|
+
headers
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
function reload(init = {}) {
|
|
1738
|
+
const {
|
|
1739
|
+
responseInit,
|
|
1740
|
+
headers
|
|
1741
|
+
} = initWithRevalidate(init);
|
|
1742
|
+
return new Response(null, {
|
|
1743
|
+
...responseInit,
|
|
1744
|
+
headers
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
function respond(value, init = {}) {
|
|
1748
|
+
const {
|
|
1749
|
+
responseInit,
|
|
1750
|
+
headers
|
|
1751
|
+
} = initWithRevalidate(init);
|
|
1752
|
+
headers.set("Content-Type", "application/json");
|
|
1753
|
+
return new ResponseEnvelope(new Response(JSON.stringify(value), {
|
|
1754
|
+
...responseInit,
|
|
1755
|
+
headers
|
|
1756
|
+
}), value);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
const mergeProps = solidJs.merge;
|
|
544
1760
|
const isServer = false;
|
|
545
1761
|
const isDev = true;
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
1762
|
+
function render(code, element, init, options = {}) {
|
|
1763
|
+
solidJs.enforceLoadingBoundary(true);
|
|
1764
|
+
try {
|
|
1765
|
+
const dispose = render$1(code, element, init, {
|
|
1766
|
+
...options,
|
|
1767
|
+
insertOptions: {
|
|
1768
|
+
schedule: true
|
|
1769
|
+
}
|
|
1770
|
+
});
|
|
1771
|
+
solidJs.flush();
|
|
1772
|
+
return dispose;
|
|
1773
|
+
} finally {
|
|
1774
|
+
solidJs.enforceLoadingBoundary(false);
|
|
1775
|
+
}
|
|
551
1776
|
}
|
|
552
1777
|
const hydrate = (...args) => {
|
|
553
1778
|
solidJs.enableHydration();
|
|
554
1779
|
return hydrate$1(...args);
|
|
555
1780
|
};
|
|
556
1781
|
function Portal(props) {
|
|
1782
|
+
return solidJs.runWithOwner(solidJs.createOwner(), () => portalImpl(props));
|
|
1783
|
+
}
|
|
1784
|
+
function portalImpl(props) {
|
|
557
1785
|
const treeMarker = document.createTextNode(""),
|
|
558
1786
|
startMarker = document.createTextNode(""),
|
|
559
1787
|
endMarker = document.createTextNode(""),
|
|
560
|
-
mount = () =>
|
|
561
|
-
|
|
562
|
-
|
|
1788
|
+
mount = () => props.mount || document.body,
|
|
1789
|
+
content = solidJs.createMemo(() => [startMarker, props.children], {
|
|
1790
|
+
ssrSource: "client",
|
|
1791
|
+
loadingValue: undefined
|
|
1792
|
+
});
|
|
1793
|
+
solidJs.createRenderEffect(
|
|
1794
|
+
() => [mount(), content(), solidJs.getOwner()], ([, c, owner]) => {
|
|
1795
|
+
const m = solidJs.untrack(mount);
|
|
563
1796
|
m.appendChild(endMarker);
|
|
564
|
-
|
|
1797
|
+
const dispose = solidJs.runWithOwner(owner, () => solidJs.createRoot(d => {
|
|
1798
|
+
insert(m, c, endMarker, undefined, {
|
|
1799
|
+
host: () => treeMarker.parentNode
|
|
1800
|
+
});
|
|
1801
|
+
return d;
|
|
1802
|
+
}));
|
|
565
1803
|
return () => {
|
|
1804
|
+
dispose();
|
|
566
1805
|
let c = startMarker;
|
|
567
|
-
while (c
|
|
1806
|
+
while (c) {
|
|
568
1807
|
const n = c.nextSibling;
|
|
569
1808
|
m.removeChild(c);
|
|
1809
|
+
if (c === endMarker) break;
|
|
570
1810
|
c = n;
|
|
571
1811
|
}
|
|
572
1812
|
};
|
|
1813
|
+
},
|
|
1814
|
+
{
|
|
1815
|
+
schedule: true,
|
|
1816
|
+
ssrSource: "client"
|
|
1817
|
+
});
|
|
1818
|
+
solidJs.createEffect(mount, () => {
|
|
1819
|
+
const m = solidJs.untrack(mount);
|
|
1820
|
+
const ownerRoot = getDelegatedRoot(treeMarker);
|
|
1821
|
+
if (!ownerRoot || ownerRoot.contains(m)) return;
|
|
1822
|
+
registerDelegatedContainer(m, ownerRoot);
|
|
1823
|
+
return () => unregisterDelegatedContainer(m, ownerRoot);
|
|
1824
|
+
}, {
|
|
1825
|
+
ssrSource: "client"
|
|
1826
|
+
});
|
|
1827
|
+
if (solidJs.sharedConfig.hydrating) return solidJs.createMemo(() => treeMarker, {
|
|
1828
|
+
ssrSource: "client",
|
|
1829
|
+
loadingValue: undefined
|
|
573
1830
|
});
|
|
574
1831
|
return treeMarker;
|
|
575
1832
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
if (prop === "appendChild" || prop === "insertBefore") {
|
|
580
|
-
return (...args) => {
|
|
581
|
-
Object.defineProperty(args[0], "_$host", {
|
|
582
|
-
get: () => marker.parentNode,
|
|
583
|
-
configurable: true
|
|
584
|
-
});
|
|
585
|
-
target[prop](...args);
|
|
586
|
-
};
|
|
587
|
-
}
|
|
588
|
-
const value = Reflect.get(target, prop);
|
|
589
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
590
|
-
}
|
|
591
|
-
});
|
|
1833
|
+
const COMPONENT_BINDING = Symbol.for("dom-expressions.component-binding");
|
|
1834
|
+
function bindingOf(value) {
|
|
1835
|
+
return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
|
|
592
1836
|
}
|
|
593
|
-
function
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, isSvg, solidJs.untrack(() => props.is));
|
|
606
|
-
spread(el, props, isSvg);
|
|
607
|
-
return el;
|
|
1837
|
+
function dynamic(source) {
|
|
1838
|
+
let latest = 0;
|
|
1839
|
+
const sites = new Set();
|
|
1840
|
+
let deliveredAddress;
|
|
1841
|
+
const resolveBinding = (next, prev) => {
|
|
1842
|
+
const binding = bindingOf(next);
|
|
1843
|
+
if (!binding) return next;
|
|
1844
|
+
deliveredAddress = binding.address;
|
|
1845
|
+
const prevBinding = bindingOf(prev);
|
|
1846
|
+
if (prevBinding && prevBinding.component === binding.component) {
|
|
1847
|
+
for (const deliver of sites) deliver(binding.address);
|
|
1848
|
+
return prev;
|
|
608
1849
|
}
|
|
1850
|
+
return next;
|
|
1851
|
+
};
|
|
1852
|
+
const cached = solidJs.createMemo(prev => {
|
|
1853
|
+
const next = source();
|
|
1854
|
+
if (!next || typeof next.then !== "function") return resolveBinding(next, prev);
|
|
1855
|
+
const token = ++latest;
|
|
1856
|
+
return {
|
|
1857
|
+
then: (onFulfilled, onRejected) => next.then(resolved => onFulfilled(token === latest ? resolveBinding(resolved, prev) : resolved), onRejected)
|
|
1858
|
+
};
|
|
1859
|
+
}, {
|
|
1860
|
+
lazy: true
|
|
609
1861
|
});
|
|
1862
|
+
return props => {
|
|
1863
|
+
return solidJs.createMemo(() => {
|
|
1864
|
+
const component = cached();
|
|
1865
|
+
switch (typeof component) {
|
|
1866
|
+
case "function":
|
|
1867
|
+
{
|
|
1868
|
+
Object.assign(component, {
|
|
1869
|
+
[solidJs.$DEVCOMP]: true
|
|
1870
|
+
});
|
|
1871
|
+
const binding = bindingOf(component);
|
|
1872
|
+
if (binding) {
|
|
1873
|
+
const [address, setAddress] = solidJs.createSignal(deliveredAddress ?? binding.address);
|
|
1874
|
+
sites.add(setAddress);
|
|
1875
|
+
solidJs.onCleanup(() => sites.delete(setAddress));
|
|
1876
|
+
return solidJs.untrack(() => binding.component(props, address));
|
|
1877
|
+
}
|
|
1878
|
+
return solidJs.untrack(() => component(props));
|
|
1879
|
+
}
|
|
1880
|
+
case "string":
|
|
1881
|
+
const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, solidJs.untrack(() => props.is));
|
|
1882
|
+
spread(el, props);
|
|
1883
|
+
return el;
|
|
1884
|
+
}
|
|
1885
|
+
});
|
|
1886
|
+
};
|
|
610
1887
|
}
|
|
611
1888
|
function Dynamic(props) {
|
|
612
|
-
const
|
|
613
|
-
return
|
|
1889
|
+
const Comp = dynamic(() => props.component);
|
|
1890
|
+
return solidJs.createComponent(Comp, solidJs.omit(props, "component"));
|
|
1891
|
+
}
|
|
1892
|
+
function createElement(tagName, is = undefined) {
|
|
1893
|
+
return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
|
|
1894
|
+
is
|
|
1895
|
+
});
|
|
614
1896
|
}
|
|
1897
|
+
function loadClientOnly(fn, setComp) {
|
|
1898
|
+
fn().then(m => setComp(() => m.default));
|
|
1899
|
+
}
|
|
1900
|
+
function clientOnly(fn, options = {},
|
|
1901
|
+
_moduleUrl) {
|
|
1902
|
+
const [comp, setComp] = solidJs.createSignal();
|
|
1903
|
+
let started = !options.lazy;
|
|
1904
|
+
started && loadClientOnly(fn, setComp);
|
|
1905
|
+
return props => {
|
|
1906
|
+
let Comp;
|
|
1907
|
+
let m;
|
|
1908
|
+
const rest = solidJs.omit(props, "fallback");
|
|
1909
|
+
if (!started) {
|
|
1910
|
+
started = true;
|
|
1911
|
+
loadClientOnly(fn, setComp);
|
|
1912
|
+
}
|
|
1913
|
+
if ((Comp = solidJs.untrack(comp)) && !solidJs.sharedConfig.hydrating) return Comp(rest);
|
|
1914
|
+
const [mounted, setMounted] = solidJs.createSignal(!solidJs.sharedConfig.hydrating);
|
|
1915
|
+
const gate = solidJs.createMemo(() => (Comp = comp(), m = mounted(), solidJs.untrack(() => Comp && m ? Comp(rest) : props.fallback)));
|
|
1916
|
+
const onHydrationEnd = solidJs.sharedConfig.onHydrationEnd;
|
|
1917
|
+
const release = () => setMounted(true);
|
|
1918
|
+
onHydrationEnd ? onHydrationEnd(release) : queueMicrotask(release);
|
|
1919
|
+
return gate;
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
function httpStatus(_code, _text) {}
|
|
1923
|
+
function httpHeader(_name, _value, _options) {}
|
|
615
1924
|
|
|
616
|
-
Object.defineProperty(exports, "
|
|
1925
|
+
Object.defineProperty(exports, "Errored", {
|
|
617
1926
|
enumerable: true,
|
|
618
|
-
get: function () { return solidJs.
|
|
1927
|
+
get: function () { return solidJs.Errored; }
|
|
619
1928
|
});
|
|
620
1929
|
Object.defineProperty(exports, "For", {
|
|
621
1930
|
enumerable: true,
|
|
622
1931
|
get: function () { return solidJs.For; }
|
|
623
1932
|
});
|
|
1933
|
+
Object.defineProperty(exports, "Hydration", {
|
|
1934
|
+
enumerable: true,
|
|
1935
|
+
get: function () { return solidJs.Hydration; }
|
|
1936
|
+
});
|
|
1937
|
+
Object.defineProperty(exports, "Loading", {
|
|
1938
|
+
enumerable: true,
|
|
1939
|
+
get: function () { return solidJs.Loading; }
|
|
1940
|
+
});
|
|
624
1941
|
Object.defineProperty(exports, "Match", {
|
|
625
1942
|
enumerable: true,
|
|
626
1943
|
get: function () { return solidJs.Match; }
|
|
627
1944
|
});
|
|
628
|
-
Object.defineProperty(exports, "
|
|
1945
|
+
Object.defineProperty(exports, "NoHydration", {
|
|
629
1946
|
enumerable: true,
|
|
630
|
-
get: function () { return solidJs.
|
|
1947
|
+
get: function () { return solidJs.NoHydration; }
|
|
631
1948
|
});
|
|
632
|
-
Object.defineProperty(exports, "
|
|
1949
|
+
Object.defineProperty(exports, "Repeat", {
|
|
633
1950
|
enumerable: true,
|
|
634
|
-
get: function () { return solidJs.
|
|
1951
|
+
get: function () { return solidJs.Repeat; }
|
|
1952
|
+
});
|
|
1953
|
+
Object.defineProperty(exports, "Reveal", {
|
|
1954
|
+
enumerable: true,
|
|
1955
|
+
get: function () { return solidJs.Reveal; }
|
|
1956
|
+
});
|
|
1957
|
+
Object.defineProperty(exports, "Show", {
|
|
1958
|
+
enumerable: true,
|
|
1959
|
+
get: function () { return solidJs.Show; }
|
|
635
1960
|
});
|
|
636
1961
|
Object.defineProperty(exports, "Switch", {
|
|
637
1962
|
enumerable: true,
|
|
@@ -641,61 +1966,92 @@ Object.defineProperty(exports, "createComponent", {
|
|
|
641
1966
|
enumerable: true,
|
|
642
1967
|
get: function () { return solidJs.createComponent; }
|
|
643
1968
|
});
|
|
644
|
-
Object.defineProperty(exports, "effect", {
|
|
645
|
-
enumerable: true,
|
|
646
|
-
get: function () { return solidJs.createRenderEffect; }
|
|
647
|
-
});
|
|
648
1969
|
Object.defineProperty(exports, "getOwner", {
|
|
649
1970
|
enumerable: true,
|
|
650
1971
|
get: function () { return solidJs.getOwner; }
|
|
651
1972
|
});
|
|
652
|
-
Object.defineProperty(exports, "mergeProps", {
|
|
653
|
-
enumerable: true,
|
|
654
|
-
get: function () { return solidJs.merge; }
|
|
655
|
-
});
|
|
656
1973
|
Object.defineProperty(exports, "untrack", {
|
|
657
1974
|
enumerable: true,
|
|
658
1975
|
get: function () { return solidJs.untrack; }
|
|
659
1976
|
});
|
|
660
|
-
exports.Assets = voidFn;
|
|
661
1977
|
exports.ChildProperties = ChildProperties;
|
|
662
1978
|
exports.DOMElements = DOMElements;
|
|
1979
|
+
exports.DOMWithState = DOMWithState;
|
|
663
1980
|
exports.DelegatedEvents = DelegatedEvents;
|
|
664
1981
|
exports.Dynamic = Dynamic;
|
|
665
|
-
exports.
|
|
1982
|
+
exports.HREF = HREF;
|
|
666
1983
|
exports.HydrationScript = voidFn;
|
|
667
|
-
exports.
|
|
1984
|
+
exports.MathMLElements = MathMLElements;
|
|
1985
|
+
exports.Namespaces = Namespaces;
|
|
668
1986
|
exports.Portal = Portal;
|
|
669
|
-
exports.
|
|
1987
|
+
exports.REVALIDATE_HEADER = REVALIDATE_HEADER;
|
|
1988
|
+
exports.RawTextElements = RawTextElements;
|
|
670
1989
|
exports.RequestContext = RequestContext;
|
|
1990
|
+
exports.ResponseEnvelope = ResponseEnvelope;
|
|
1991
|
+
exports.SAFE_ERROR = SAFE_ERROR;
|
|
671
1992
|
exports.SVGElements = SVGElements;
|
|
672
|
-
exports.
|
|
673
|
-
exports.
|
|
1993
|
+
exports.VoidElements = VoidElements;
|
|
1994
|
+
exports.acquireAsset = acquireAsset;
|
|
1995
|
+
exports.addEvent = addEvent;
|
|
1996
|
+
exports.applyRef = applyRef;
|
|
674
1997
|
exports.assign = assign;
|
|
1998
|
+
exports.claimElement = claimElement;
|
|
1999
|
+
exports.claimElementTree = claimElementTree;
|
|
675
2000
|
exports.className = className;
|
|
676
|
-
exports.
|
|
677
|
-
exports.
|
|
2001
|
+
exports.clearFlashCookie = clearFlashCookie;
|
|
2002
|
+
exports.clientOnly = clientOnly;
|
|
2003
|
+
exports.commitEventResponse = commitEventResponse;
|
|
2004
|
+
exports.composeMiddleware = composeMiddleware;
|
|
2005
|
+
exports.createRequestEvent = createRequestEvent;
|
|
2006
|
+
exports.createResponseStub = createResponseStub;
|
|
2007
|
+
exports.createSSRResponse = createSSRResponse;
|
|
678
2008
|
exports.delegateEvents = delegateEvents;
|
|
2009
|
+
exports.dynamic = dynamic;
|
|
679
2010
|
exports.dynamicProperty = dynamicProperty;
|
|
2011
|
+
exports.effect = effect;
|
|
680
2012
|
exports.escape = escape;
|
|
681
2013
|
exports.generateHydrationScript = voidFn;
|
|
682
|
-
exports.
|
|
2014
|
+
exports.getDelegatedRoot = getDelegatedRoot;
|
|
2015
|
+
exports.getExpectedRedirectStatus = getExpectedRedirectStatus;
|
|
2016
|
+
exports.getFirstChild = getFirstChild;
|
|
683
2017
|
exports.getHydrationKey = getHydrationKey;
|
|
684
2018
|
exports.getNextElement = getNextElement;
|
|
685
2019
|
exports.getNextMarker = getNextMarker;
|
|
686
2020
|
exports.getNextMatch = getNextMatch;
|
|
2021
|
+
exports.getNextSibling = getNextSibling;
|
|
687
2022
|
exports.getRequestEvent = voidFn;
|
|
2023
|
+
exports.getServerFunctionMetadata = getServerFunctionMetadata;
|
|
2024
|
+
exports.getServerFunctionRPC = getServerFunctionRPC;
|
|
2025
|
+
exports.hasFlashCookie = hasFlashCookie;
|
|
2026
|
+
exports.httpHeader = httpHeader;
|
|
2027
|
+
exports.httpStatus = httpStatus;
|
|
688
2028
|
exports.hydrate = hydrate;
|
|
689
2029
|
exports.insert = insert;
|
|
2030
|
+
exports.installHydrationRuntime = installHydrationRuntime;
|
|
690
2031
|
exports.isDev = isDev;
|
|
2032
|
+
exports.isHref = isHref;
|
|
2033
|
+
exports.isResponseEnvelope = isResponseEnvelope;
|
|
2034
|
+
exports.isSafeError = isSafeError;
|
|
691
2035
|
exports.isServer = isServer;
|
|
2036
|
+
exports.isServerFunction = isServerFunction;
|
|
2037
|
+
exports.markSafeError = markSafeError;
|
|
692
2038
|
exports.memo = memo;
|
|
2039
|
+
exports.mergeProps = mergeProps;
|
|
2040
|
+
exports.parseCookieHeader = parseCookieHeader;
|
|
2041
|
+
exports.redirect = redirect;
|
|
2042
|
+
exports.ref = ref;
|
|
2043
|
+
exports.registerDelegatedContainer = registerDelegatedContainer;
|
|
2044
|
+
exports.registerDelegatedRoot = registerDelegatedRoot;
|
|
2045
|
+
exports.registerElementClaim = registerElementClaim;
|
|
2046
|
+
exports.reload = reload;
|
|
693
2047
|
exports.render = render;
|
|
694
2048
|
exports.renderToStream = renderToStream;
|
|
695
2049
|
exports.renderToString = renderToString;
|
|
696
|
-
exports.renderToStringAsync = renderToStringAsync;
|
|
697
2050
|
exports.resolveSSRNode = resolveSSRNode;
|
|
2051
|
+
exports.respond = respond;
|
|
698
2052
|
exports.runHydrationEvents = runHydrationEvents;
|
|
2053
|
+
exports.scope = scope;
|
|
2054
|
+
exports.serializeCookie = serializeCookie;
|
|
699
2055
|
exports.setAttribute = setAttribute;
|
|
700
2056
|
exports.setAttributeNS = setAttributeNS;
|
|
701
2057
|
exports.setProperty = setProperty;
|
|
@@ -703,11 +2059,15 @@ exports.setStyleProperty = setStyleProperty;
|
|
|
703
2059
|
exports.spread = spread;
|
|
704
2060
|
exports.ssr = ssr;
|
|
705
2061
|
exports.ssrAttribute = ssrAttribute;
|
|
706
|
-
exports.
|
|
2062
|
+
exports.ssrClassName = ssrClassName;
|
|
707
2063
|
exports.ssrElement = ssrElement;
|
|
2064
|
+
exports.ssrGroup = ssrGroup;
|
|
708
2065
|
exports.ssrHydrationKey = ssrHydrationKey;
|
|
709
2066
|
exports.ssrStyle = ssrStyle;
|
|
2067
|
+
exports.ssrStyleProperty = ssrStyleProperty;
|
|
710
2068
|
exports.style = style;
|
|
711
2069
|
exports.template = template;
|
|
712
|
-
exports.
|
|
713
|
-
exports.
|
|
2070
|
+
exports.unregisterDelegatedContainer = unregisterDelegatedContainer;
|
|
2071
|
+
exports.unregisterDelegatedRoot = unregisterDelegatedRoot;
|
|
2072
|
+
exports.useHead = useHead;
|
|
2073
|
+
exports.warmAsset = warmAsset;
|