@solidjs/web 2.0.0-experimental.4 → 2.0.0-experimental.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.cjs +39 -66
- package/dist/dev.js +102 -672
- package/dist/server.cjs +137 -136
- package/dist/server.js +211 -733
- package/dist/web.cjs +39 -66
- package/dist/web.js +100 -660
- package/package.json +3 -3
- package/storage/dist/storage.js +3 -3
- package/types/client.d.ts +2 -13
- package/types/core.d.ts +2 -11
- package/types/index.d.ts +5 -8
- package/types/server-mock.d.ts +26 -33
- package/types/server.d.ts +0 -1
package/dist/server.js
CHANGED
|
@@ -1,510 +1,41 @@
|
|
|
1
|
-
import { sharedConfig, createRoot, omit } from
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Match,
|
|
6
|
-
Repeat,
|
|
7
|
-
Show,
|
|
8
|
-
Suspense,
|
|
9
|
-
Switch,
|
|
10
|
-
createComponent,
|
|
11
|
-
createRenderEffect as effect,
|
|
12
|
-
getOwner,
|
|
13
|
-
createMemo as memo,
|
|
14
|
-
untrack
|
|
15
|
-
} from "solid-js";
|
|
16
|
-
import { Feature, Serializer, getCrossReferenceHeader } from "seroval";
|
|
17
|
-
import {
|
|
18
|
-
CustomEventPlugin,
|
|
19
|
-
DOMExceptionPlugin,
|
|
20
|
-
EventPlugin,
|
|
21
|
-
FormDataPlugin,
|
|
22
|
-
HeadersPlugin,
|
|
23
|
-
ReadableStreamPlugin,
|
|
24
|
-
RequestPlugin,
|
|
25
|
-
ResponsePlugin,
|
|
26
|
-
URLSearchParamsPlugin,
|
|
27
|
-
URLPlugin
|
|
28
|
-
} from "seroval-plugins/web";
|
|
1
|
+
import { createMemo, sharedConfig, createRoot, ssrHandleError, omit } from 'solid-js';
|
|
2
|
+
export { ErrorBoundary, For, Match, Repeat, Show, Suspense, Switch, createComponent, createRenderEffect as effect, getOwner, ssrRunInScope, untrack } from 'solid-js';
|
|
3
|
+
import { Feature, Serializer, getCrossReferenceHeader } from 'seroval';
|
|
4
|
+
import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
|
|
29
5
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"formnovalidate",
|
|
40
|
-
"hidden",
|
|
41
|
-
"indeterminate",
|
|
42
|
-
"inert",
|
|
43
|
-
"ismap",
|
|
44
|
-
"loop",
|
|
45
|
-
"multiple",
|
|
46
|
-
"muted",
|
|
47
|
-
"nomodule",
|
|
48
|
-
"novalidate",
|
|
49
|
-
"open",
|
|
50
|
-
"playsinline",
|
|
51
|
-
"readonly",
|
|
52
|
-
"required",
|
|
53
|
-
"reversed",
|
|
54
|
-
"seamless",
|
|
55
|
-
"selected"
|
|
56
|
-
];
|
|
57
|
-
const BooleanAttributes = /*#__PURE__*/ new Set(booleans);
|
|
58
|
-
const Properties = /*#__PURE__*/ new Set([
|
|
59
|
-
"value",
|
|
60
|
-
"readOnly",
|
|
61
|
-
"formNoValidate",
|
|
62
|
-
"isMap",
|
|
63
|
-
"noModule",
|
|
64
|
-
"playsInline",
|
|
65
|
-
...booleans
|
|
66
|
-
]);
|
|
67
|
-
const ChildProperties = /*#__PURE__*/ new Set([
|
|
68
|
-
"innerHTML",
|
|
69
|
-
"textContent",
|
|
70
|
-
"innerText",
|
|
71
|
-
"children"
|
|
72
|
-
]);
|
|
73
|
-
const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
74
|
-
class: "className",
|
|
75
|
-
formnovalidate: {
|
|
76
|
-
$: "formNoValidate",
|
|
77
|
-
BUTTON: 1,
|
|
78
|
-
INPUT: 1
|
|
79
|
-
},
|
|
80
|
-
ismap: {
|
|
81
|
-
$: "isMap",
|
|
82
|
-
IMG: 1
|
|
83
|
-
},
|
|
84
|
-
nomodule: {
|
|
85
|
-
$: "noModule",
|
|
86
|
-
SCRIPT: 1
|
|
87
|
-
},
|
|
88
|
-
playsinline: {
|
|
89
|
-
$: "playsInline",
|
|
90
|
-
VIDEO: 1
|
|
91
|
-
},
|
|
92
|
-
readonly: {
|
|
93
|
-
$: "readOnly",
|
|
94
|
-
INPUT: 1,
|
|
95
|
-
TEXTAREA: 1
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
function getPropAlias(prop, tagName) {
|
|
99
|
-
const a = PropAliases[prop];
|
|
100
|
-
return typeof a === "object" ? (a[tagName] ? a["$"] : undefined) : a;
|
|
101
|
-
}
|
|
102
|
-
const DelegatedEvents = /*#__PURE__*/ new Set([
|
|
103
|
-
"beforeinput",
|
|
104
|
-
"click",
|
|
105
|
-
"dblclick",
|
|
106
|
-
"contextmenu",
|
|
107
|
-
"focusin",
|
|
108
|
-
"focusout",
|
|
109
|
-
"input",
|
|
110
|
-
"keydown",
|
|
111
|
-
"keyup",
|
|
112
|
-
"mousedown",
|
|
113
|
-
"mousemove",
|
|
114
|
-
"mouseout",
|
|
115
|
-
"mouseover",
|
|
116
|
-
"mouseup",
|
|
117
|
-
"pointerdown",
|
|
118
|
-
"pointermove",
|
|
119
|
-
"pointerout",
|
|
120
|
-
"pointerover",
|
|
121
|
-
"pointerup",
|
|
122
|
-
"touchend",
|
|
123
|
-
"touchmove",
|
|
124
|
-
"touchstart"
|
|
125
|
-
]);
|
|
126
|
-
const SVGElements = /*#__PURE__*/ new Set([
|
|
127
|
-
"altGlyph",
|
|
128
|
-
"altGlyphDef",
|
|
129
|
-
"altGlyphItem",
|
|
130
|
-
"animate",
|
|
131
|
-
"animateColor",
|
|
132
|
-
"animateMotion",
|
|
133
|
-
"animateTransform",
|
|
134
|
-
"circle",
|
|
135
|
-
"clipPath",
|
|
136
|
-
"color-profile",
|
|
137
|
-
"cursor",
|
|
138
|
-
"defs",
|
|
139
|
-
"desc",
|
|
140
|
-
"ellipse",
|
|
141
|
-
"feBlend",
|
|
142
|
-
"feColorMatrix",
|
|
143
|
-
"feComponentTransfer",
|
|
144
|
-
"feComposite",
|
|
145
|
-
"feConvolveMatrix",
|
|
146
|
-
"feDiffuseLighting",
|
|
147
|
-
"feDisplacementMap",
|
|
148
|
-
"feDistantLight",
|
|
149
|
-
"feDropShadow",
|
|
150
|
-
"feFlood",
|
|
151
|
-
"feFuncA",
|
|
152
|
-
"feFuncB",
|
|
153
|
-
"feFuncG",
|
|
154
|
-
"feFuncR",
|
|
155
|
-
"feGaussianBlur",
|
|
156
|
-
"feImage",
|
|
157
|
-
"feMerge",
|
|
158
|
-
"feMergeNode",
|
|
159
|
-
"feMorphology",
|
|
160
|
-
"feOffset",
|
|
161
|
-
"fePointLight",
|
|
162
|
-
"feSpecularLighting",
|
|
163
|
-
"feSpotLight",
|
|
164
|
-
"feTile",
|
|
165
|
-
"feTurbulence",
|
|
166
|
-
"filter",
|
|
167
|
-
"font",
|
|
168
|
-
"font-face",
|
|
169
|
-
"font-face-format",
|
|
170
|
-
"font-face-name",
|
|
171
|
-
"font-face-src",
|
|
172
|
-
"font-face-uri",
|
|
173
|
-
"foreignObject",
|
|
174
|
-
"g",
|
|
175
|
-
"glyph",
|
|
176
|
-
"glyphRef",
|
|
177
|
-
"hkern",
|
|
178
|
-
"image",
|
|
179
|
-
"line",
|
|
180
|
-
"linearGradient",
|
|
181
|
-
"marker",
|
|
182
|
-
"mask",
|
|
183
|
-
"metadata",
|
|
184
|
-
"missing-glyph",
|
|
185
|
-
"mpath",
|
|
186
|
-
"path",
|
|
187
|
-
"pattern",
|
|
188
|
-
"polygon",
|
|
189
|
-
"polyline",
|
|
190
|
-
"radialGradient",
|
|
191
|
-
"rect",
|
|
192
|
-
"set",
|
|
193
|
-
"stop",
|
|
194
|
-
"svg",
|
|
195
|
-
"switch",
|
|
196
|
-
"symbol",
|
|
197
|
-
"text",
|
|
198
|
-
"textPath",
|
|
199
|
-
"tref",
|
|
200
|
-
"tspan",
|
|
201
|
-
"use",
|
|
202
|
-
"view",
|
|
203
|
-
"vkern"
|
|
204
|
-
]);
|
|
6
|
+
const Properties = /*#__PURE__*/new Set([
|
|
7
|
+
"value", "checked", "selected", "muted"]);
|
|
8
|
+
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
9
|
+
const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
10
|
+
const SVGElements = /*#__PURE__*/new Set([
|
|
11
|
+
"altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
|
|
12
|
+
"set", "stop",
|
|
13
|
+
"svg", "switch", "symbol", "text", "textPath",
|
|
14
|
+
"tref", "tspan", "use", "view", "vkern"]);
|
|
205
15
|
const SVGNamespace = {
|
|
206
16
|
xlink: "http://www.w3.org/1999/xlink",
|
|
207
17
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
208
18
|
};
|
|
209
|
-
const DOMElements = /*#__PURE__*/
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
"head",
|
|
213
|
-
"link",
|
|
214
|
-
"meta",
|
|
215
|
-
"style",
|
|
216
|
-
"title",
|
|
217
|
-
"body",
|
|
218
|
-
"address",
|
|
219
|
-
"article",
|
|
220
|
-
"aside",
|
|
221
|
-
"footer",
|
|
222
|
-
"header",
|
|
223
|
-
"main",
|
|
224
|
-
"nav",
|
|
225
|
-
"section",
|
|
226
|
-
"body",
|
|
227
|
-
"blockquote",
|
|
228
|
-
"dd",
|
|
229
|
-
"div",
|
|
230
|
-
"dl",
|
|
231
|
-
"dt",
|
|
232
|
-
"figcaption",
|
|
233
|
-
"figure",
|
|
234
|
-
"hr",
|
|
235
|
-
"li",
|
|
236
|
-
"ol",
|
|
237
|
-
"p",
|
|
238
|
-
"pre",
|
|
239
|
-
"ul",
|
|
240
|
-
"a",
|
|
241
|
-
"abbr",
|
|
242
|
-
"b",
|
|
243
|
-
"bdi",
|
|
244
|
-
"bdo",
|
|
245
|
-
"br",
|
|
246
|
-
"cite",
|
|
247
|
-
"code",
|
|
248
|
-
"data",
|
|
249
|
-
"dfn",
|
|
250
|
-
"em",
|
|
251
|
-
"i",
|
|
252
|
-
"kbd",
|
|
253
|
-
"mark",
|
|
254
|
-
"q",
|
|
255
|
-
"rp",
|
|
256
|
-
"rt",
|
|
257
|
-
"ruby",
|
|
258
|
-
"s",
|
|
259
|
-
"samp",
|
|
260
|
-
"small",
|
|
261
|
-
"span",
|
|
262
|
-
"strong",
|
|
263
|
-
"sub",
|
|
264
|
-
"sup",
|
|
265
|
-
"time",
|
|
266
|
-
"u",
|
|
267
|
-
"var",
|
|
268
|
-
"wbr",
|
|
269
|
-
"area",
|
|
270
|
-
"audio",
|
|
271
|
-
"img",
|
|
272
|
-
"map",
|
|
273
|
-
"track",
|
|
274
|
-
"video",
|
|
275
|
-
"embed",
|
|
276
|
-
"iframe",
|
|
277
|
-
"object",
|
|
278
|
-
"param",
|
|
279
|
-
"picture",
|
|
280
|
-
"portal",
|
|
281
|
-
"source",
|
|
282
|
-
"svg",
|
|
283
|
-
"math",
|
|
284
|
-
"canvas",
|
|
285
|
-
"noscript",
|
|
286
|
-
"script",
|
|
287
|
-
"del",
|
|
288
|
-
"ins",
|
|
289
|
-
"caption",
|
|
290
|
-
"col",
|
|
291
|
-
"colgroup",
|
|
292
|
-
"table",
|
|
293
|
-
"tbody",
|
|
294
|
-
"td",
|
|
295
|
-
"tfoot",
|
|
296
|
-
"th",
|
|
297
|
-
"thead",
|
|
298
|
-
"tr",
|
|
299
|
-
"button",
|
|
300
|
-
"datalist",
|
|
301
|
-
"fieldset",
|
|
302
|
-
"form",
|
|
303
|
-
"input",
|
|
304
|
-
"label",
|
|
305
|
-
"legend",
|
|
306
|
-
"meter",
|
|
307
|
-
"optgroup",
|
|
308
|
-
"option",
|
|
309
|
-
"output",
|
|
310
|
-
"progress",
|
|
311
|
-
"select",
|
|
312
|
-
"textarea",
|
|
313
|
-
"details",
|
|
314
|
-
"dialog",
|
|
315
|
-
"menu",
|
|
316
|
-
"summary",
|
|
317
|
-
"details",
|
|
318
|
-
"slot",
|
|
319
|
-
"template",
|
|
320
|
-
"acronym",
|
|
321
|
-
"applet",
|
|
322
|
-
"basefont",
|
|
323
|
-
"bgsound",
|
|
324
|
-
"big",
|
|
325
|
-
"blink",
|
|
326
|
-
"center",
|
|
327
|
-
"content",
|
|
328
|
-
"dir",
|
|
329
|
-
"font",
|
|
330
|
-
"frame",
|
|
331
|
-
"frameset",
|
|
332
|
-
"hgroup",
|
|
333
|
-
"image",
|
|
334
|
-
"keygen",
|
|
335
|
-
"marquee",
|
|
336
|
-
"menuitem",
|
|
337
|
-
"nobr",
|
|
338
|
-
"noembed",
|
|
339
|
-
"noframes",
|
|
340
|
-
"plaintext",
|
|
341
|
-
"rb",
|
|
342
|
-
"rtc",
|
|
343
|
-
"shadow",
|
|
344
|
-
"spacer",
|
|
345
|
-
"strike",
|
|
346
|
-
"tt",
|
|
347
|
-
"xmp",
|
|
348
|
-
"a",
|
|
349
|
-
"abbr",
|
|
350
|
-
"acronym",
|
|
351
|
-
"address",
|
|
352
|
-
"applet",
|
|
353
|
-
"area",
|
|
354
|
-
"article",
|
|
355
|
-
"aside",
|
|
356
|
-
"audio",
|
|
357
|
-
"b",
|
|
358
|
-
"base",
|
|
359
|
-
"basefont",
|
|
360
|
-
"bdi",
|
|
361
|
-
"bdo",
|
|
362
|
-
"bgsound",
|
|
363
|
-
"big",
|
|
364
|
-
"blink",
|
|
365
|
-
"blockquote",
|
|
366
|
-
"body",
|
|
367
|
-
"br",
|
|
368
|
-
"button",
|
|
369
|
-
"canvas",
|
|
370
|
-
"caption",
|
|
371
|
-
"center",
|
|
372
|
-
"cite",
|
|
373
|
-
"code",
|
|
374
|
-
"col",
|
|
375
|
-
"colgroup",
|
|
376
|
-
"content",
|
|
377
|
-
"data",
|
|
378
|
-
"datalist",
|
|
379
|
-
"dd",
|
|
380
|
-
"del",
|
|
381
|
-
"details",
|
|
382
|
-
"dfn",
|
|
383
|
-
"dialog",
|
|
384
|
-
"dir",
|
|
385
|
-
"div",
|
|
386
|
-
"dl",
|
|
387
|
-
"dt",
|
|
388
|
-
"em",
|
|
389
|
-
"embed",
|
|
390
|
-
"fieldset",
|
|
391
|
-
"figcaption",
|
|
392
|
-
"figure",
|
|
393
|
-
"font",
|
|
394
|
-
"footer",
|
|
395
|
-
"form",
|
|
396
|
-
"frame",
|
|
397
|
-
"frameset",
|
|
398
|
-
"head",
|
|
399
|
-
"header",
|
|
400
|
-
"hgroup",
|
|
401
|
-
"hr",
|
|
402
|
-
"html",
|
|
403
|
-
"i",
|
|
404
|
-
"iframe",
|
|
405
|
-
"image",
|
|
406
|
-
"img",
|
|
407
|
-
"input",
|
|
408
|
-
"ins",
|
|
409
|
-
"kbd",
|
|
410
|
-
"keygen",
|
|
411
|
-
"label",
|
|
412
|
-
"legend",
|
|
413
|
-
"li",
|
|
414
|
-
"link",
|
|
415
|
-
"main",
|
|
416
|
-
"map",
|
|
417
|
-
"mark",
|
|
418
|
-
"marquee",
|
|
419
|
-
"menu",
|
|
420
|
-
"menuitem",
|
|
421
|
-
"meta",
|
|
422
|
-
"meter",
|
|
423
|
-
"nav",
|
|
424
|
-
"nobr",
|
|
425
|
-
"noembed",
|
|
426
|
-
"noframes",
|
|
427
|
-
"noscript",
|
|
428
|
-
"object",
|
|
429
|
-
"ol",
|
|
430
|
-
"optgroup",
|
|
431
|
-
"option",
|
|
432
|
-
"output",
|
|
433
|
-
"p",
|
|
434
|
-
"param",
|
|
435
|
-
"picture",
|
|
436
|
-
"plaintext",
|
|
437
|
-
"portal",
|
|
438
|
-
"pre",
|
|
439
|
-
"progress",
|
|
440
|
-
"q",
|
|
441
|
-
"rb",
|
|
442
|
-
"rp",
|
|
443
|
-
"rt",
|
|
444
|
-
"rtc",
|
|
445
|
-
"ruby",
|
|
446
|
-
"s",
|
|
447
|
-
"samp",
|
|
448
|
-
"script",
|
|
449
|
-
"section",
|
|
450
|
-
"select",
|
|
451
|
-
"shadow",
|
|
452
|
-
"slot",
|
|
453
|
-
"small",
|
|
454
|
-
"source",
|
|
455
|
-
"spacer",
|
|
456
|
-
"span",
|
|
457
|
-
"strike",
|
|
458
|
-
"strong",
|
|
459
|
-
"style",
|
|
460
|
-
"sub",
|
|
461
|
-
"summary",
|
|
462
|
-
"sup",
|
|
463
|
-
"table",
|
|
464
|
-
"tbody",
|
|
465
|
-
"td",
|
|
466
|
-
"template",
|
|
467
|
-
"textarea",
|
|
468
|
-
"tfoot",
|
|
469
|
-
"th",
|
|
470
|
-
"thead",
|
|
471
|
-
"time",
|
|
472
|
-
"title",
|
|
473
|
-
"tr",
|
|
474
|
-
"track",
|
|
475
|
-
"tt",
|
|
476
|
-
"u",
|
|
477
|
-
"ul",
|
|
478
|
-
"var",
|
|
479
|
-
"video",
|
|
480
|
-
"wbr",
|
|
481
|
-
"xmp",
|
|
482
|
-
"input",
|
|
483
|
-
"h1",
|
|
484
|
-
"h2",
|
|
485
|
-
"h3",
|
|
486
|
-
"h4",
|
|
487
|
-
"h5",
|
|
488
|
-
"h6"
|
|
489
|
-
]);
|
|
19
|
+
const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input", "h1", "h2", "h3", "h4", "h5", "h6",
|
|
20
|
+
"webview",
|
|
21
|
+
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
490
22
|
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
|
|
23
|
+
const memo = fn => createMemo(() => fn());
|
|
24
|
+
|
|
25
|
+
const ES2017FLAG = Feature.AggregateError
|
|
26
|
+
| Feature.BigIntTypedArray;
|
|
27
|
+
const GLOBAL_IDENTIFIER = '_$HY.r';
|
|
28
|
+
function createSerializer({
|
|
29
|
+
onData,
|
|
30
|
+
onDone,
|
|
31
|
+
scopeId,
|
|
32
|
+
onError
|
|
33
|
+
}) {
|
|
494
34
|
return new Serializer({
|
|
495
35
|
scopeId,
|
|
496
|
-
plugins: [
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
EventPlugin,
|
|
500
|
-
FormDataPlugin,
|
|
501
|
-
HeadersPlugin,
|
|
502
|
-
ReadableStreamPlugin,
|
|
503
|
-
RequestPlugin,
|
|
504
|
-
ResponsePlugin,
|
|
505
|
-
URLSearchParamsPlugin,
|
|
506
|
-
URLPlugin
|
|
507
|
-
],
|
|
36
|
+
plugins: [AbortSignalPlugin,
|
|
37
|
+
CustomEventPlugin, DOMExceptionPlugin, EventPlugin,
|
|
38
|
+
FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin],
|
|
508
39
|
globalIdentifier: GLOBAL_IDENTIFIER,
|
|
509
40
|
disabledFeatures: ES2017FLAG,
|
|
510
41
|
onData,
|
|
@@ -513,18 +44,22 @@ function createSerializer({ onData, onDone, scopeId, onError }) {
|
|
|
513
44
|
});
|
|
514
45
|
}
|
|
515
46
|
function getLocalHeaderScript(id) {
|
|
516
|
-
return getCrossReferenceHeader(id) +
|
|
47
|
+
return getCrossReferenceHeader(id) + ';';
|
|
517
48
|
}
|
|
518
49
|
|
|
519
|
-
const VOID_ELEMENTS =
|
|
520
|
-
/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
50
|
+
const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
521
51
|
const REPLACE_SCRIPT = `function $df(e,n,o,t){if(n=document.getElementById(e),o=document.getElementById("pl-"+e)){for(;o&&8!==o.nodeType&&o.nodeValue!=="pl-"+e;)t=o.nextSibling,o.remove(),o=t;_$HY.done?o.remove():o.replaceWith(n.content)}n.remove(),_$HY.fe(e)}`;
|
|
522
52
|
function renderToString(code, options = {}) {
|
|
523
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
renderId = "",
|
|
55
|
+
nonce,
|
|
56
|
+
noScripts
|
|
57
|
+
} = options;
|
|
524
58
|
let scripts = "";
|
|
525
59
|
const serializer = createSerializer({
|
|
526
60
|
scopeId: renderId,
|
|
527
61
|
onData(script) {
|
|
62
|
+
if (noScripts) return;
|
|
528
63
|
if (!scripts) {
|
|
529
64
|
scripts = getLocalHeaderScript(renderId);
|
|
530
65
|
}
|
|
@@ -533,23 +68,20 @@ function renderToString(code, options = {}) {
|
|
|
533
68
|
onError: options.onError
|
|
534
69
|
});
|
|
535
70
|
sharedConfig.context = {
|
|
536
|
-
id: renderId || "",
|
|
537
|
-
count: 0,
|
|
538
|
-
suspense: {},
|
|
539
|
-
lazy: {},
|
|
540
71
|
assets: [],
|
|
541
|
-
nonce
|
|
72
|
+
nonce,
|
|
73
|
+
escape: escape,
|
|
74
|
+
resolve: resolveSSRNode,
|
|
75
|
+
ssr: ssr,
|
|
542
76
|
serialize(id, p) {
|
|
543
77
|
!sharedConfig.context.noHydrate && serializer.write(id, p);
|
|
544
|
-
},
|
|
545
|
-
roots: 0,
|
|
546
|
-
nextRoot() {
|
|
547
|
-
return this.renderId + "i-" + this.roots++;
|
|
548
78
|
}
|
|
549
79
|
};
|
|
550
80
|
let html = createRoot(d => {
|
|
551
81
|
setTimeout(d);
|
|
552
|
-
return
|
|
82
|
+
return resolveSSRSync(escape(code()));
|
|
83
|
+
}, {
|
|
84
|
+
id: renderId
|
|
553
85
|
});
|
|
554
86
|
sharedConfig.context.noHydrate = true;
|
|
555
87
|
serializer.close();
|
|
@@ -557,19 +89,14 @@ function renderToString(code, options = {}) {
|
|
|
557
89
|
if (scripts.length) html = injectScripts(html, scripts, options.nonce);
|
|
558
90
|
return html;
|
|
559
91
|
}
|
|
560
|
-
function renderToStringAsync(code, options = {}) {
|
|
561
|
-
const { timeoutMs = 30000 } = options;
|
|
562
|
-
let timeoutHandle;
|
|
563
|
-
const timeout = new Promise((_, reject) => {
|
|
564
|
-
timeoutHandle = setTimeout(() => reject("renderToString timed out"), timeoutMs);
|
|
565
|
-
});
|
|
566
|
-
return Promise.race([renderToStream(code, options), timeout]).then(html => {
|
|
567
|
-
clearTimeout(timeoutHandle);
|
|
568
|
-
return html;
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
92
|
function renderToStream(code, options = {}) {
|
|
572
|
-
let {
|
|
93
|
+
let {
|
|
94
|
+
nonce,
|
|
95
|
+
onCompleteShell,
|
|
96
|
+
onCompleteAll,
|
|
97
|
+
renderId = "",
|
|
98
|
+
noScripts
|
|
99
|
+
} = options;
|
|
573
100
|
let dispose;
|
|
574
101
|
const blockingPromises = [];
|
|
575
102
|
const pushTask = task => {
|
|
@@ -585,12 +112,11 @@ function renderToStream(code, options = {}) {
|
|
|
585
112
|
const onDone = () => {
|
|
586
113
|
writeTasks();
|
|
587
114
|
doShell();
|
|
588
|
-
onCompleteAll &&
|
|
589
|
-
|
|
590
|
-
write(v)
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
});
|
|
115
|
+
onCompleteAll && onCompleteAll({
|
|
116
|
+
write(v) {
|
|
117
|
+
!completed && buffer.write(v);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
594
120
|
writable && writable.end();
|
|
595
121
|
completed = true;
|
|
596
122
|
if (firstFlushed) dispose();
|
|
@@ -630,12 +156,7 @@ function renderToStream(code, options = {}) {
|
|
|
630
156
|
}
|
|
631
157
|
};
|
|
632
158
|
sharedConfig.context = context = {
|
|
633
|
-
id: renderId || "",
|
|
634
|
-
count: 0,
|
|
635
159
|
async: true,
|
|
636
|
-
resources: {},
|
|
637
|
-
lazy: {},
|
|
638
|
-
suspense: {},
|
|
639
160
|
assets: [],
|
|
640
161
|
nonce,
|
|
641
162
|
block(p) {
|
|
@@ -647,59 +168,59 @@ function renderToStream(code, options = {}) {
|
|
|
647
168
|
const first = html.indexOf(placeholder);
|
|
648
169
|
if (first === -1) return;
|
|
649
170
|
const last = html.indexOf(`<!--!$/${id}-->`, first + placeholder.length);
|
|
650
|
-
html =
|
|
651
|
-
html.slice(0, first) +
|
|
652
|
-
resolveSSRNode(escape(payloadFn())) +
|
|
653
|
-
html.slice(last + placeholder.length + 1);
|
|
171
|
+
html = html.slice(0, first) + resolveSSRSync(escape(payloadFn())) + html.slice(last + placeholder.length + 1);
|
|
654
172
|
},
|
|
655
173
|
serialize(id, p, wait) {
|
|
656
174
|
const serverOnly = sharedConfig.context.noHydrate;
|
|
657
175
|
if (!firstFlushed && wait && typeof p === "object" && "then" in p) {
|
|
658
176
|
blockingPromises.push(p);
|
|
659
|
-
!serverOnly &&
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
.catch(e => {
|
|
665
|
-
serializer.write(id, e);
|
|
666
|
-
});
|
|
177
|
+
!serverOnly && p.then(d => {
|
|
178
|
+
serializer.write(id, d);
|
|
179
|
+
}).catch(e => {
|
|
180
|
+
serializer.write(id, e);
|
|
181
|
+
});
|
|
667
182
|
} else if (!serverOnly) serializer.write(id, p);
|
|
668
183
|
},
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
},
|
|
184
|
+
escape: escape,
|
|
185
|
+
resolve: resolveSSRNode,
|
|
186
|
+
ssr: ssr,
|
|
673
187
|
registerFragment(key) {
|
|
674
188
|
if (!registry.has(key)) {
|
|
675
189
|
let resolve, reject;
|
|
676
|
-
const p = new Promise((r, rej) => (
|
|
677
|
-
registry.set(key,
|
|
678
|
-
queue(() =>
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
)
|
|
684
|
-
);
|
|
190
|
+
const p = new Promise((r, rej) => (resolve = r, reject = rej));
|
|
191
|
+
registry.set(key, {
|
|
192
|
+
resolve: err => queue(() => queue(() => {
|
|
193
|
+
err ? reject(err) : resolve(true);
|
|
194
|
+
queue(flushEnd);
|
|
195
|
+
}))
|
|
196
|
+
});
|
|
685
197
|
serializer.write(key, p);
|
|
686
198
|
}
|
|
687
199
|
return (value, error) => {
|
|
688
200
|
if (registry.has(key)) {
|
|
689
|
-
const
|
|
201
|
+
const item = registry.get(key);
|
|
690
202
|
registry.delete(key);
|
|
691
|
-
if (
|
|
692
|
-
|
|
203
|
+
if (item.children) {
|
|
204
|
+
for (const k in item.children) {
|
|
205
|
+
value = replacePlaceholder(value, k, item.children[k]);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const parentKey = waitForFragments(registry, key);
|
|
209
|
+
if (parentKey) {
|
|
210
|
+
const parent = registry.get(parentKey);
|
|
211
|
+
parent.children ||= {};
|
|
212
|
+
parent.children[key] = value !== undefined ? value : "";
|
|
213
|
+
item.resolve();
|
|
693
214
|
return;
|
|
694
215
|
}
|
|
695
216
|
if (!completed) {
|
|
696
217
|
if (!firstFlushed) {
|
|
697
|
-
queue(() =>
|
|
698
|
-
resolve(error);
|
|
218
|
+
queue(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
|
|
219
|
+
item.resolve(error);
|
|
699
220
|
} else {
|
|
700
221
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
701
222
|
pushTask(`$df("${key}")${!scriptFlushed ? ";" + REPLACE_SCRIPT : ""}`);
|
|
702
|
-
resolve(error);
|
|
223
|
+
item.resolve(error);
|
|
703
224
|
scriptFlushed = true;
|
|
704
225
|
}
|
|
705
226
|
}
|
|
@@ -710,22 +231,22 @@ function renderToStream(code, options = {}) {
|
|
|
710
231
|
};
|
|
711
232
|
let html = createRoot(d => {
|
|
712
233
|
dispose = d;
|
|
713
|
-
return
|
|
234
|
+
return resolveSSRSync(escape(code()));
|
|
235
|
+
}, {
|
|
236
|
+
id: renderId
|
|
714
237
|
});
|
|
715
238
|
function doShell() {
|
|
716
239
|
if (shellCompleted) return;
|
|
717
240
|
sharedConfig.context = context;
|
|
718
|
-
context.noHydrate = true;
|
|
719
241
|
html = injectAssets(context.assets, html);
|
|
720
242
|
if (tasks.length) html = injectScripts(html, tasks, nonce);
|
|
721
243
|
buffer.write(html);
|
|
722
244
|
tasks = "";
|
|
723
|
-
onCompleteShell &&
|
|
724
|
-
|
|
725
|
-
write(v)
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
});
|
|
245
|
+
onCompleteShell && onCompleteShell({
|
|
246
|
+
write(v) {
|
|
247
|
+
!completed && buffer.write(v);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
729
250
|
shellCompleted = true;
|
|
730
251
|
}
|
|
731
252
|
return {
|
|
@@ -760,7 +281,7 @@ function renderToStream(code, options = {}) {
|
|
|
760
281
|
pipeTo(w) {
|
|
761
282
|
return allSettled(blockingPromises).then(() => {
|
|
762
283
|
let resolve;
|
|
763
|
-
const p = new Promise(r =>
|
|
284
|
+
const p = new Promise(r => resolve = r);
|
|
764
285
|
setTimeout(() => {
|
|
765
286
|
doShell();
|
|
766
287
|
const encoder = new TextEncoder();
|
|
@@ -790,24 +311,16 @@ function renderToStream(code, options = {}) {
|
|
|
790
311
|
};
|
|
791
312
|
}
|
|
792
313
|
function HydrationScript(props) {
|
|
793
|
-
const {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
);
|
|
314
|
+
const {
|
|
315
|
+
nonce
|
|
316
|
+
} = sharedConfig.context;
|
|
317
|
+
return ssr(generateHydrationScript({
|
|
318
|
+
nonce,
|
|
319
|
+
...props
|
|
320
|
+
}));
|
|
800
321
|
}
|
|
801
322
|
function ssr(t, ...nodes) {
|
|
802
|
-
if (nodes.length)
|
|
803
|
-
let result = "";
|
|
804
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
805
|
-
result += t[i];
|
|
806
|
-
const node = nodes[i];
|
|
807
|
-
if (node !== undefined) result += resolveSSRNode(node);
|
|
808
|
-
}
|
|
809
|
-
t = result + t[nodes.length];
|
|
810
|
-
}
|
|
323
|
+
if (nodes.length) return resolveSSR(t, nodes);
|
|
811
324
|
return {
|
|
812
325
|
t
|
|
813
326
|
};
|
|
@@ -837,25 +350,26 @@ function ssrStyle(value) {
|
|
|
837
350
|
const v = value[s];
|
|
838
351
|
if (v != undefined) {
|
|
839
352
|
if (i) result += ";";
|
|
840
|
-
|
|
353
|
+
const r = escape(v, true);
|
|
354
|
+
if (r != undefined && r !== "undefined") {
|
|
355
|
+
result += `${s}:${r}`;
|
|
356
|
+
}
|
|
841
357
|
}
|
|
842
358
|
}
|
|
843
359
|
return result;
|
|
844
360
|
}
|
|
361
|
+
function ssrStyleProperty(name, value) {
|
|
362
|
+
return value != null ? name + value : "";
|
|
363
|
+
}
|
|
845
364
|
function ssrElement(tag, props, children, needsId) {
|
|
846
|
-
if (props == null) props = {};
|
|
847
|
-
else if (typeof props === "function") props = props();
|
|
365
|
+
if (props == null) props = {};else if (typeof props === "function") props = props();
|
|
848
366
|
const skipChildren = VOID_ELEMENTS.test(tag);
|
|
849
367
|
const keys = Object.keys(props);
|
|
850
368
|
let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `;
|
|
851
369
|
for (let i = 0; i < keys.length; i++) {
|
|
852
370
|
const prop = keys[i];
|
|
853
371
|
if (ChildProperties.has(prop)) {
|
|
854
|
-
if (children === undefined && !skipChildren)
|
|
855
|
-
children =
|
|
856
|
-
tag === "script" || tag === "style" || prop === "innerHTML"
|
|
857
|
-
? props[prop]
|
|
858
|
-
: escape(props[prop]);
|
|
372
|
+
if (children === undefined && !skipChildren) children = tag === "script" || tag === "style" || prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
859
373
|
continue;
|
|
860
374
|
}
|
|
861
375
|
const value = props[prop];
|
|
@@ -863,51 +377,38 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
863
377
|
result += `style="${ssrStyle(value)}"`;
|
|
864
378
|
} else if (prop === "class") {
|
|
865
379
|
result += `class="${ssrClassName(value)}"`;
|
|
866
|
-
} else if (
|
|
867
|
-
if (value) result += prop;
|
|
868
|
-
else continue;
|
|
869
|
-
} else if (
|
|
870
|
-
value == undefined ||
|
|
871
|
-
prop === "ref" ||
|
|
872
|
-
prop.slice(0, 2) === "on" ||
|
|
873
|
-
prop.slice(0, 5) === "prop:"
|
|
874
|
-
) {
|
|
380
|
+
} else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on" || prop.slice(0, 5) === "prop:") {
|
|
875
381
|
continue;
|
|
876
|
-
} else if (
|
|
382
|
+
} else if (typeof value === "boolean") {
|
|
877
383
|
if (!value) continue;
|
|
878
|
-
result += escape(prop
|
|
879
|
-
} else if (prop.slice(0, 5) === "attr:") {
|
|
880
|
-
result += `${escape(prop.slice(5))}="${escape(value, true)}"`;
|
|
384
|
+
result += escape(prop);
|
|
881
385
|
} else {
|
|
882
|
-
result += `${escape(prop)}="${escape(value, true)}"`;
|
|
386
|
+
result += value === "" ? escape(prop) : `${escape(prop)}="${escape(value, true)}"`;
|
|
883
387
|
}
|
|
884
388
|
if (i !== keys.length - 1) result += " ";
|
|
885
389
|
}
|
|
886
|
-
if (skipChildren)
|
|
887
|
-
|
|
888
|
-
t: result + "/>"
|
|
889
|
-
};
|
|
890
|
-
if (typeof children === "function") children = children();
|
|
891
|
-
return {
|
|
892
|
-
t: result + `>${resolveSSRNode(children, true)}</${tag}>`
|
|
390
|
+
if (skipChildren) return {
|
|
391
|
+
t: result + "/>"
|
|
893
392
|
};
|
|
393
|
+
if (typeof children === "function") children = children();
|
|
394
|
+
return ssr([result + ">", `</${tag}>`], resolveSSRNode(children, undefined, true));
|
|
894
395
|
}
|
|
895
|
-
function ssrAttribute(key, value
|
|
896
|
-
return
|
|
396
|
+
function ssrAttribute(key, value) {
|
|
397
|
+
return value == null || value === false ? "" : value === true ? ` ${key}` : ` ${key}="${value}"`;
|
|
897
398
|
}
|
|
898
399
|
function ssrHydrationKey() {
|
|
899
400
|
const hk = getHydrationKey();
|
|
900
|
-
return hk ? `
|
|
401
|
+
return hk ? ` _hk=${hk}` : "";
|
|
901
402
|
}
|
|
902
403
|
function escape(s, attr) {
|
|
903
404
|
const t = typeof s;
|
|
904
405
|
if (t !== "string") {
|
|
905
|
-
if (!attr && t === "function") return escape(s());
|
|
906
406
|
if (!attr && Array.isArray(s)) {
|
|
407
|
+
s = s.slice();
|
|
907
408
|
for (let i = 0; i < s.length; i++) s[i] = escape(s[i]);
|
|
908
409
|
return s;
|
|
909
410
|
}
|
|
910
|
-
if (attr && t === "boolean") return
|
|
411
|
+
if (attr && t === "boolean") return s;
|
|
911
412
|
return s;
|
|
912
413
|
}
|
|
913
414
|
const delim = attr ? '"' : "<";
|
|
@@ -937,31 +438,13 @@ function escape(s, attr) {
|
|
|
937
438
|
left = iDelim + 1;
|
|
938
439
|
iDelim = s.indexOf(delim, left);
|
|
939
440
|
} while (iDelim >= 0);
|
|
940
|
-
} else
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
iAmp = s.indexOf("&", left);
|
|
946
|
-
}
|
|
947
|
-
return left < s.length ? out + s.substring(left) : out;
|
|
948
|
-
}
|
|
949
|
-
function resolveSSRNode(node, top) {
|
|
950
|
-
const t = typeof node;
|
|
951
|
-
if (t === "string") return node;
|
|
952
|
-
if (node == null || t === "boolean") return "";
|
|
953
|
-
if (Array.isArray(node)) {
|
|
954
|
-
let prev = {};
|
|
955
|
-
let mapped = "";
|
|
956
|
-
for (let i = 0, len = node.length; i < len; i++) {
|
|
957
|
-
if (!top && typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!$-->`;
|
|
958
|
-
mapped += resolveSSRNode((prev = node[i]));
|
|
959
|
-
}
|
|
960
|
-
return mapped;
|
|
441
|
+
} else while (iAmp >= 0) {
|
|
442
|
+
if (left < iAmp) out += s.substring(left, iAmp);
|
|
443
|
+
out += "&";
|
|
444
|
+
left = iAmp + 1;
|
|
445
|
+
iAmp = s.indexOf("&", left);
|
|
961
446
|
}
|
|
962
|
-
|
|
963
|
-
if (t === "function") return resolveSSRNode(node());
|
|
964
|
-
return String(node);
|
|
447
|
+
return left < s.length ? out + s.substring(left) : out;
|
|
965
448
|
}
|
|
966
449
|
function mergeProps(...sources) {
|
|
967
450
|
const target = {};
|
|
@@ -991,7 +474,7 @@ function getHydrationKey() {
|
|
|
991
474
|
return hydrate && !hydrate.noHydrate && sharedConfig.getNextContextId();
|
|
992
475
|
}
|
|
993
476
|
function useAssets(fn) {
|
|
994
|
-
sharedConfig.context.assets.push(() =>
|
|
477
|
+
sharedConfig.context.assets.push(() => resolveSSRSync(escape(fn())));
|
|
995
478
|
}
|
|
996
479
|
function getAssets() {
|
|
997
480
|
const assets = sharedConfig.context.assets;
|
|
@@ -999,20 +482,17 @@ function getAssets() {
|
|
|
999
482
|
for (let i = 0, len = assets.length; i < len; i++) out += assets[i]();
|
|
1000
483
|
return out;
|
|
1001
484
|
}
|
|
1002
|
-
function generateHydrationScript({
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
)}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
|
|
485
|
+
function generateHydrationScript({
|
|
486
|
+
eventNames = ["click", "input"],
|
|
487
|
+
nonce
|
|
488
|
+
} = {}) {
|
|
489
|
+
return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("_hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
|
|
1008
490
|
}
|
|
1009
491
|
function Hydration(props) {
|
|
1010
492
|
if (!sharedConfig.context.noHydrate) return props.children;
|
|
1011
493
|
const context = sharedConfig.context;
|
|
1012
494
|
sharedConfig.context = {
|
|
1013
495
|
...context,
|
|
1014
|
-
count: 0,
|
|
1015
|
-
id: sharedConfig.getNextContextId(),
|
|
1016
496
|
noHydrate: false
|
|
1017
497
|
};
|
|
1018
498
|
const res = props.children;
|
|
@@ -1020,8 +500,14 @@ function Hydration(props) {
|
|
|
1020
500
|
return res;
|
|
1021
501
|
}
|
|
1022
502
|
function NoHydration(props) {
|
|
1023
|
-
|
|
1024
|
-
|
|
503
|
+
let context = sharedConfig.context;
|
|
504
|
+
if (context) sharedConfig.context = {
|
|
505
|
+
...context,
|
|
506
|
+
noHydrate: true
|
|
507
|
+
};
|
|
508
|
+
const res = props.children;
|
|
509
|
+
if (context) sharedConfig.context = context;
|
|
510
|
+
return res;
|
|
1025
511
|
}
|
|
1026
512
|
function queue(fn) {
|
|
1027
513
|
return Promise.resolve().then(fn);
|
|
@@ -1051,7 +537,7 @@ function injectScripts(html, scripts, nonce) {
|
|
|
1051
537
|
}
|
|
1052
538
|
function waitForFragments(registry, key) {
|
|
1053
539
|
for (const k of [...registry.keys()].reverse()) {
|
|
1054
|
-
if (key.startsWith(k)) return
|
|
540
|
+
if (key.startsWith(k)) return k;
|
|
1055
541
|
}
|
|
1056
542
|
return false;
|
|
1057
543
|
}
|
|
@@ -1074,28 +560,74 @@ function classListToObject(classList) {
|
|
|
1074
560
|
function flattenClassList(list, result) {
|
|
1075
561
|
for (let i = 0, len = list.length; i < len; i++) {
|
|
1076
562
|
const item = list[i];
|
|
1077
|
-
if (Array.isArray(item)) flattenClassList(item, result);
|
|
1078
|
-
else if (typeof item === "object" && item != null) Object.assign(result, item);
|
|
1079
|
-
else if (item || item === 0) result[item] = true;
|
|
563
|
+
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;
|
|
1080
564
|
}
|
|
1081
565
|
}
|
|
566
|
+
function resolveSSR(template, holes, result = {
|
|
567
|
+
t: [""],
|
|
568
|
+
h: [],
|
|
569
|
+
p: []
|
|
570
|
+
}) {
|
|
571
|
+
for (let i = 0; i < holes.length; i++) {
|
|
572
|
+
const hole = holes[i];
|
|
573
|
+
result.t[result.t.length - 1] += template[i];
|
|
574
|
+
if (hole == null || hole === true || hole === false) continue;
|
|
575
|
+
resolveSSRNode(hole, result);
|
|
576
|
+
}
|
|
577
|
+
result.t[result.t.length - 1] += template[template.length - 1];
|
|
578
|
+
return result;
|
|
579
|
+
}
|
|
580
|
+
function resolveSSRNode(node, result = {
|
|
581
|
+
t: [""],
|
|
582
|
+
h: [],
|
|
583
|
+
p: []
|
|
584
|
+
}, top) {
|
|
585
|
+
const t = typeof node;
|
|
586
|
+
if (t === "string" || t === "number") {
|
|
587
|
+
result.t[result.t.length - 1] += node;
|
|
588
|
+
} else if (node == null || t === "boolean") ; else if (Array.isArray(node)) {
|
|
589
|
+
let prev = {};
|
|
590
|
+
for (let i = 0, len = node.length; i < len; i++) {
|
|
591
|
+
if (!top && typeof prev !== "object" && typeof node[i] !== "object") result.t[result.t.length - 1] += `<!--!$-->`;
|
|
592
|
+
resolveSSRNode(prev = node[i], result);
|
|
593
|
+
}
|
|
594
|
+
} else if (t === "object") {
|
|
595
|
+
if (node.h) {
|
|
596
|
+
result.t[result.t.length - 1] += node.t[0];
|
|
597
|
+
if (node.t.length > 1) {
|
|
598
|
+
result.t.push(...node.t.slice(1));
|
|
599
|
+
result.h.push(...node.h);
|
|
600
|
+
result.p.push(...node.p);
|
|
601
|
+
}
|
|
602
|
+
} else result.t[result.t.length - 1] += node.t;
|
|
603
|
+
} else if (t === "function") {
|
|
604
|
+
try {
|
|
605
|
+
resolveSSRNode(node(), result);
|
|
606
|
+
} catch (err) {
|
|
607
|
+
const p = ssrHandleError(err);
|
|
608
|
+
if (p) {
|
|
609
|
+
result.h.push(node);
|
|
610
|
+
result.p.push(p);
|
|
611
|
+
result.t.push("");
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return result;
|
|
616
|
+
}
|
|
617
|
+
function resolveSSRSync(node) {
|
|
618
|
+
const res = resolveSSRNode(node);
|
|
619
|
+
if (!res.h.length) return res.t[0];
|
|
620
|
+
throw new Error("This value cannot be rendered synchronously. Are you missing a Suspsense boundary?");
|
|
621
|
+
}
|
|
1082
622
|
const RequestContext = Symbol();
|
|
1083
623
|
function getRequestEvent() {
|
|
1084
|
-
return globalThis[RequestContext]
|
|
1085
|
-
? globalThis[RequestContext].getStore() ||
|
|
1086
|
-
(sharedConfig.context && sharedConfig.context.event) ||
|
|
1087
|
-
console.log(
|
|
1088
|
-
"RequestEvent is missing. This is most likely due to accessing `getRequestEvent` non-managed async scope in a partially polyfilled environment. Try moving it above all `await` calls."
|
|
1089
|
-
)
|
|
1090
|
-
: undefined;
|
|
624
|
+
return globalThis[RequestContext] ? globalThis[RequestContext].getStore() || sharedConfig.context && sharedConfig.context.event || console.log("RequestEvent is missing. This is most likely due to accessing `getRequestEvent` non-managed async scope in a partially polyfilled environment. Try moving it above all `await` calls.") : undefined;
|
|
1091
625
|
}
|
|
1092
|
-
function
|
|
1093
|
-
|
|
626
|
+
function renderToStringAsync(code, options = {}) {
|
|
627
|
+
return renderToStream(code, options).then(html => html);
|
|
1094
628
|
}
|
|
1095
629
|
function notSup() {
|
|
1096
|
-
throw new Error(
|
|
1097
|
-
"Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>."
|
|
1098
|
-
);
|
|
630
|
+
throw new Error("Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.");
|
|
1099
631
|
}
|
|
1100
632
|
|
|
1101
633
|
const isServer = true;
|
|
@@ -1104,8 +636,7 @@ function createDynamic(component, props) {
|
|
|
1104
636
|
const comp = component(),
|
|
1105
637
|
t = typeof comp;
|
|
1106
638
|
if (comp) {
|
|
1107
|
-
if (t === "function") return comp(props);
|
|
1108
|
-
else if (t === "string") {
|
|
639
|
+
if (t === "function") return comp(props);else if (t === "string") {
|
|
1109
640
|
return ssrElement(comp, props, undefined, true);
|
|
1110
641
|
}
|
|
1111
642
|
}
|
|
@@ -1118,57 +649,4 @@ function Portal(props) {
|
|
|
1118
649
|
throw new Error("Portal is not supported on the server");
|
|
1119
650
|
}
|
|
1120
651
|
|
|
1121
|
-
export {
|
|
1122
|
-
Assets,
|
|
1123
|
-
ChildProperties,
|
|
1124
|
-
DOMElements,
|
|
1125
|
-
DelegatedEvents,
|
|
1126
|
-
Dynamic,
|
|
1127
|
-
Hydration,
|
|
1128
|
-
HydrationScript,
|
|
1129
|
-
NoHydration,
|
|
1130
|
-
Portal,
|
|
1131
|
-
Properties,
|
|
1132
|
-
RequestContext,
|
|
1133
|
-
SVGElements,
|
|
1134
|
-
SVGNamespace,
|
|
1135
|
-
notSup as addEventListener,
|
|
1136
|
-
notSup as assign,
|
|
1137
|
-
notSup as className,
|
|
1138
|
-
createDynamic,
|
|
1139
|
-
notSup as delegateEvents,
|
|
1140
|
-
notSup as dynamicProperty,
|
|
1141
|
-
escape,
|
|
1142
|
-
generateHydrationScript,
|
|
1143
|
-
getAssets,
|
|
1144
|
-
getHydrationKey,
|
|
1145
|
-
notSup as getNextElement,
|
|
1146
|
-
notSup as getNextMarker,
|
|
1147
|
-
notSup as getNextMatch,
|
|
1148
|
-
getPropAlias,
|
|
1149
|
-
getRequestEvent,
|
|
1150
|
-
notSup as hydrate,
|
|
1151
|
-
notSup as insert,
|
|
1152
|
-
isDev,
|
|
1153
|
-
isServer,
|
|
1154
|
-
mergeProps,
|
|
1155
|
-
notSup as render,
|
|
1156
|
-
renderToStream,
|
|
1157
|
-
renderToString,
|
|
1158
|
-
renderToStringAsync,
|
|
1159
|
-
resolveSSRNode,
|
|
1160
|
-
notSup as runHydrationEvents,
|
|
1161
|
-
notSup as setAttribute,
|
|
1162
|
-
notSup as setAttributeNS,
|
|
1163
|
-
notSup as setProperty,
|
|
1164
|
-
notSup as spread,
|
|
1165
|
-
ssr,
|
|
1166
|
-
ssrAttribute,
|
|
1167
|
-
ssrClassName,
|
|
1168
|
-
ssrElement,
|
|
1169
|
-
ssrHydrationKey,
|
|
1170
|
-
ssrStyle,
|
|
1171
|
-
notSup as style,
|
|
1172
|
-
notSup as template,
|
|
1173
|
-
useAssets
|
|
1174
|
-
};
|
|
652
|
+
export { ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, notSup as addEventListener, notSup as assign, notSup as className, createDynamic, notSup as delegateEvents, notSup as dynamicProperty, escape, generateHydrationScript, getAssets, getHydrationKey, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, notSup as hydrate, notSup as insert, isDev, isServer, memo, mergeProps, notSup as render, renderToStream, renderToString, renderToStringAsync, notSup as runHydrationEvents, notSup as setAttribute, notSup as setAttributeNS, notSup as setProperty, notSup as spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrHydrationKey, ssrStyle, ssrStyleProperty, notSup as style, notSup as template, useAssets };
|