@solidjs/web 2.0.0-experimental.0 → 2.0.0-experimental.1
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.js +76 -620
- package/dist/server.js +98 -617
- package/dist/web.js +74 -608
- package/package.json +3 -3
- package/storage/dist/storage.js +3 -3
- package/types/client.d.ts +2 -11
- package/types/core.d.ts +1 -11
- package/types/index.d.ts +4 -4
- package/types/server-mock.d.ts +26 -33
package/dist/dev.js
CHANGED
|
@@ -1,72 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
untrack,
|
|
4
|
-
createRenderEffect,
|
|
5
|
-
sharedConfig,
|
|
6
|
-
flatten,
|
|
7
|
-
enableHydration,
|
|
8
|
-
createMemo,
|
|
9
|
-
omit,
|
|
10
|
-
$DEVCOMP
|
|
11
|
-
} from "solid-js";
|
|
12
|
-
export {
|
|
13
|
-
ErrorBoundary,
|
|
14
|
-
For,
|
|
15
|
-
Match,
|
|
16
|
-
Show,
|
|
17
|
-
Suspense,
|
|
18
|
-
Switch,
|
|
19
|
-
createComponent,
|
|
20
|
-
createRenderEffect as effect,
|
|
21
|
-
getOwner,
|
|
22
|
-
createMemo as memo,
|
|
23
|
-
merge as mergeProps,
|
|
24
|
-
untrack
|
|
25
|
-
} from "solid-js";
|
|
1
|
+
import { createRoot, untrack, createRenderEffect, sharedConfig, flatten, enableHydration, createMemo, omit, $DEVCOMP } from 'solid-js';
|
|
2
|
+
export { ErrorBoundary, For, Match, Show, Suspense, Switch, createComponent, createRenderEffect as effect, getOwner, createMemo as memo, merge as mergeProps, untrack } from 'solid-js';
|
|
26
3
|
|
|
27
|
-
const booleans = [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"autoplay",
|
|
32
|
-
"checked",
|
|
33
|
-
"controls",
|
|
34
|
-
"default",
|
|
35
|
-
"disabled",
|
|
36
|
-
"formnovalidate",
|
|
37
|
-
"hidden",
|
|
38
|
-
"indeterminate",
|
|
39
|
-
"inert",
|
|
40
|
-
"ismap",
|
|
41
|
-
"loop",
|
|
42
|
-
"multiple",
|
|
43
|
-
"muted",
|
|
44
|
-
"nomodule",
|
|
45
|
-
"novalidate",
|
|
46
|
-
"open",
|
|
47
|
-
"playsinline",
|
|
48
|
-
"readonly",
|
|
49
|
-
"required",
|
|
50
|
-
"reversed",
|
|
51
|
-
"seamless",
|
|
52
|
-
"selected"
|
|
53
|
-
];
|
|
54
|
-
const Properties = /*#__PURE__*/ new Set([
|
|
55
|
-
"value",
|
|
56
|
-
"readOnly",
|
|
57
|
-
"formNoValidate",
|
|
58
|
-
"isMap",
|
|
59
|
-
"noModule",
|
|
60
|
-
"playsInline",
|
|
61
|
-
...booleans
|
|
62
|
-
]);
|
|
63
|
-
const ChildProperties = /*#__PURE__*/ new Set([
|
|
64
|
-
"innerHTML",
|
|
65
|
-
"textContent",
|
|
66
|
-
"innerText",
|
|
67
|
-
"children"
|
|
68
|
-
]);
|
|
69
|
-
const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
4
|
+
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
5
|
+
const Properties = /*#__PURE__*/new Set(["value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
6
|
+
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
7
|
+
const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
70
8
|
class: "className",
|
|
71
9
|
formnovalidate: {
|
|
72
10
|
$: "formNoValidate",
|
|
@@ -93,396 +31,19 @@ const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
|
93
31
|
});
|
|
94
32
|
function getPropAlias(prop, tagName) {
|
|
95
33
|
const a = PropAliases[prop];
|
|
96
|
-
return typeof a === "object" ?
|
|
97
|
-
}
|
|
98
|
-
const DelegatedEvents = /*#__PURE__*/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"focusout",
|
|
105
|
-
"input",
|
|
106
|
-
"keydown",
|
|
107
|
-
"keyup",
|
|
108
|
-
"mousedown",
|
|
109
|
-
"mousemove",
|
|
110
|
-
"mouseout",
|
|
111
|
-
"mouseover",
|
|
112
|
-
"mouseup",
|
|
113
|
-
"pointerdown",
|
|
114
|
-
"pointermove",
|
|
115
|
-
"pointerout",
|
|
116
|
-
"pointerover",
|
|
117
|
-
"pointerup",
|
|
118
|
-
"touchend",
|
|
119
|
-
"touchmove",
|
|
120
|
-
"touchstart"
|
|
121
|
-
]);
|
|
122
|
-
const SVGElements = /*#__PURE__*/ new Set([
|
|
123
|
-
"altGlyph",
|
|
124
|
-
"altGlyphDef",
|
|
125
|
-
"altGlyphItem",
|
|
126
|
-
"animate",
|
|
127
|
-
"animateColor",
|
|
128
|
-
"animateMotion",
|
|
129
|
-
"animateTransform",
|
|
130
|
-
"circle",
|
|
131
|
-
"clipPath",
|
|
132
|
-
"color-profile",
|
|
133
|
-
"cursor",
|
|
134
|
-
"defs",
|
|
135
|
-
"desc",
|
|
136
|
-
"ellipse",
|
|
137
|
-
"feBlend",
|
|
138
|
-
"feColorMatrix",
|
|
139
|
-
"feComponentTransfer",
|
|
140
|
-
"feComposite",
|
|
141
|
-
"feConvolveMatrix",
|
|
142
|
-
"feDiffuseLighting",
|
|
143
|
-
"feDisplacementMap",
|
|
144
|
-
"feDistantLight",
|
|
145
|
-
"feDropShadow",
|
|
146
|
-
"feFlood",
|
|
147
|
-
"feFuncA",
|
|
148
|
-
"feFuncB",
|
|
149
|
-
"feFuncG",
|
|
150
|
-
"feFuncR",
|
|
151
|
-
"feGaussianBlur",
|
|
152
|
-
"feImage",
|
|
153
|
-
"feMerge",
|
|
154
|
-
"feMergeNode",
|
|
155
|
-
"feMorphology",
|
|
156
|
-
"feOffset",
|
|
157
|
-
"fePointLight",
|
|
158
|
-
"feSpecularLighting",
|
|
159
|
-
"feSpotLight",
|
|
160
|
-
"feTile",
|
|
161
|
-
"feTurbulence",
|
|
162
|
-
"filter",
|
|
163
|
-
"font",
|
|
164
|
-
"font-face",
|
|
165
|
-
"font-face-format",
|
|
166
|
-
"font-face-name",
|
|
167
|
-
"font-face-src",
|
|
168
|
-
"font-face-uri",
|
|
169
|
-
"foreignObject",
|
|
170
|
-
"g",
|
|
171
|
-
"glyph",
|
|
172
|
-
"glyphRef",
|
|
173
|
-
"hkern",
|
|
174
|
-
"image",
|
|
175
|
-
"line",
|
|
176
|
-
"linearGradient",
|
|
177
|
-
"marker",
|
|
178
|
-
"mask",
|
|
179
|
-
"metadata",
|
|
180
|
-
"missing-glyph",
|
|
181
|
-
"mpath",
|
|
182
|
-
"path",
|
|
183
|
-
"pattern",
|
|
184
|
-
"polygon",
|
|
185
|
-
"polyline",
|
|
186
|
-
"radialGradient",
|
|
187
|
-
"rect",
|
|
188
|
-
"set",
|
|
189
|
-
"stop",
|
|
190
|
-
"svg",
|
|
191
|
-
"switch",
|
|
192
|
-
"symbol",
|
|
193
|
-
"text",
|
|
194
|
-
"textPath",
|
|
195
|
-
"tref",
|
|
196
|
-
"tspan",
|
|
197
|
-
"use",
|
|
198
|
-
"view",
|
|
199
|
-
"vkern"
|
|
200
|
-
]);
|
|
34
|
+
return typeof a === "object" ? a[tagName] ? a["$"] : undefined : a;
|
|
35
|
+
}
|
|
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"]);
|
|
37
|
+
const SVGElements = /*#__PURE__*/new Set([
|
|
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",
|
|
39
|
+
"set", "stop",
|
|
40
|
+
"svg", "switch", "symbol", "text", "textPath",
|
|
41
|
+
"tref", "tspan", "use", "view", "vkern"]);
|
|
201
42
|
const SVGNamespace = {
|
|
202
43
|
xlink: "http://www.w3.org/1999/xlink",
|
|
203
44
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
204
45
|
};
|
|
205
|
-
const DOMElements = /*#__PURE__*/
|
|
206
|
-
"html",
|
|
207
|
-
"base",
|
|
208
|
-
"head",
|
|
209
|
-
"link",
|
|
210
|
-
"meta",
|
|
211
|
-
"style",
|
|
212
|
-
"title",
|
|
213
|
-
"body",
|
|
214
|
-
"address",
|
|
215
|
-
"article",
|
|
216
|
-
"aside",
|
|
217
|
-
"footer",
|
|
218
|
-
"header",
|
|
219
|
-
"main",
|
|
220
|
-
"nav",
|
|
221
|
-
"section",
|
|
222
|
-
"body",
|
|
223
|
-
"blockquote",
|
|
224
|
-
"dd",
|
|
225
|
-
"div",
|
|
226
|
-
"dl",
|
|
227
|
-
"dt",
|
|
228
|
-
"figcaption",
|
|
229
|
-
"figure",
|
|
230
|
-
"hr",
|
|
231
|
-
"li",
|
|
232
|
-
"ol",
|
|
233
|
-
"p",
|
|
234
|
-
"pre",
|
|
235
|
-
"ul",
|
|
236
|
-
"a",
|
|
237
|
-
"abbr",
|
|
238
|
-
"b",
|
|
239
|
-
"bdi",
|
|
240
|
-
"bdo",
|
|
241
|
-
"br",
|
|
242
|
-
"cite",
|
|
243
|
-
"code",
|
|
244
|
-
"data",
|
|
245
|
-
"dfn",
|
|
246
|
-
"em",
|
|
247
|
-
"i",
|
|
248
|
-
"kbd",
|
|
249
|
-
"mark",
|
|
250
|
-
"q",
|
|
251
|
-
"rp",
|
|
252
|
-
"rt",
|
|
253
|
-
"ruby",
|
|
254
|
-
"s",
|
|
255
|
-
"samp",
|
|
256
|
-
"small",
|
|
257
|
-
"span",
|
|
258
|
-
"strong",
|
|
259
|
-
"sub",
|
|
260
|
-
"sup",
|
|
261
|
-
"time",
|
|
262
|
-
"u",
|
|
263
|
-
"var",
|
|
264
|
-
"wbr",
|
|
265
|
-
"area",
|
|
266
|
-
"audio",
|
|
267
|
-
"img",
|
|
268
|
-
"map",
|
|
269
|
-
"track",
|
|
270
|
-
"video",
|
|
271
|
-
"embed",
|
|
272
|
-
"iframe",
|
|
273
|
-
"object",
|
|
274
|
-
"param",
|
|
275
|
-
"picture",
|
|
276
|
-
"portal",
|
|
277
|
-
"source",
|
|
278
|
-
"svg",
|
|
279
|
-
"math",
|
|
280
|
-
"canvas",
|
|
281
|
-
"noscript",
|
|
282
|
-
"script",
|
|
283
|
-
"del",
|
|
284
|
-
"ins",
|
|
285
|
-
"caption",
|
|
286
|
-
"col",
|
|
287
|
-
"colgroup",
|
|
288
|
-
"table",
|
|
289
|
-
"tbody",
|
|
290
|
-
"td",
|
|
291
|
-
"tfoot",
|
|
292
|
-
"th",
|
|
293
|
-
"thead",
|
|
294
|
-
"tr",
|
|
295
|
-
"button",
|
|
296
|
-
"datalist",
|
|
297
|
-
"fieldset",
|
|
298
|
-
"form",
|
|
299
|
-
"input",
|
|
300
|
-
"label",
|
|
301
|
-
"legend",
|
|
302
|
-
"meter",
|
|
303
|
-
"optgroup",
|
|
304
|
-
"option",
|
|
305
|
-
"output",
|
|
306
|
-
"progress",
|
|
307
|
-
"select",
|
|
308
|
-
"textarea",
|
|
309
|
-
"details",
|
|
310
|
-
"dialog",
|
|
311
|
-
"menu",
|
|
312
|
-
"summary",
|
|
313
|
-
"details",
|
|
314
|
-
"slot",
|
|
315
|
-
"template",
|
|
316
|
-
"acronym",
|
|
317
|
-
"applet",
|
|
318
|
-
"basefont",
|
|
319
|
-
"bgsound",
|
|
320
|
-
"big",
|
|
321
|
-
"blink",
|
|
322
|
-
"center",
|
|
323
|
-
"content",
|
|
324
|
-
"dir",
|
|
325
|
-
"font",
|
|
326
|
-
"frame",
|
|
327
|
-
"frameset",
|
|
328
|
-
"hgroup",
|
|
329
|
-
"image",
|
|
330
|
-
"keygen",
|
|
331
|
-
"marquee",
|
|
332
|
-
"menuitem",
|
|
333
|
-
"nobr",
|
|
334
|
-
"noembed",
|
|
335
|
-
"noframes",
|
|
336
|
-
"plaintext",
|
|
337
|
-
"rb",
|
|
338
|
-
"rtc",
|
|
339
|
-
"shadow",
|
|
340
|
-
"spacer",
|
|
341
|
-
"strike",
|
|
342
|
-
"tt",
|
|
343
|
-
"xmp",
|
|
344
|
-
"a",
|
|
345
|
-
"abbr",
|
|
346
|
-
"acronym",
|
|
347
|
-
"address",
|
|
348
|
-
"applet",
|
|
349
|
-
"area",
|
|
350
|
-
"article",
|
|
351
|
-
"aside",
|
|
352
|
-
"audio",
|
|
353
|
-
"b",
|
|
354
|
-
"base",
|
|
355
|
-
"basefont",
|
|
356
|
-
"bdi",
|
|
357
|
-
"bdo",
|
|
358
|
-
"bgsound",
|
|
359
|
-
"big",
|
|
360
|
-
"blink",
|
|
361
|
-
"blockquote",
|
|
362
|
-
"body",
|
|
363
|
-
"br",
|
|
364
|
-
"button",
|
|
365
|
-
"canvas",
|
|
366
|
-
"caption",
|
|
367
|
-
"center",
|
|
368
|
-
"cite",
|
|
369
|
-
"code",
|
|
370
|
-
"col",
|
|
371
|
-
"colgroup",
|
|
372
|
-
"content",
|
|
373
|
-
"data",
|
|
374
|
-
"datalist",
|
|
375
|
-
"dd",
|
|
376
|
-
"del",
|
|
377
|
-
"details",
|
|
378
|
-
"dfn",
|
|
379
|
-
"dialog",
|
|
380
|
-
"dir",
|
|
381
|
-
"div",
|
|
382
|
-
"dl",
|
|
383
|
-
"dt",
|
|
384
|
-
"em",
|
|
385
|
-
"embed",
|
|
386
|
-
"fieldset",
|
|
387
|
-
"figcaption",
|
|
388
|
-
"figure",
|
|
389
|
-
"font",
|
|
390
|
-
"footer",
|
|
391
|
-
"form",
|
|
392
|
-
"frame",
|
|
393
|
-
"frameset",
|
|
394
|
-
"head",
|
|
395
|
-
"header",
|
|
396
|
-
"hgroup",
|
|
397
|
-
"hr",
|
|
398
|
-
"html",
|
|
399
|
-
"i",
|
|
400
|
-
"iframe",
|
|
401
|
-
"image",
|
|
402
|
-
"img",
|
|
403
|
-
"input",
|
|
404
|
-
"ins",
|
|
405
|
-
"kbd",
|
|
406
|
-
"keygen",
|
|
407
|
-
"label",
|
|
408
|
-
"legend",
|
|
409
|
-
"li",
|
|
410
|
-
"link",
|
|
411
|
-
"main",
|
|
412
|
-
"map",
|
|
413
|
-
"mark",
|
|
414
|
-
"marquee",
|
|
415
|
-
"menu",
|
|
416
|
-
"menuitem",
|
|
417
|
-
"meta",
|
|
418
|
-
"meter",
|
|
419
|
-
"nav",
|
|
420
|
-
"nobr",
|
|
421
|
-
"noembed",
|
|
422
|
-
"noframes",
|
|
423
|
-
"noscript",
|
|
424
|
-
"object",
|
|
425
|
-
"ol",
|
|
426
|
-
"optgroup",
|
|
427
|
-
"option",
|
|
428
|
-
"output",
|
|
429
|
-
"p",
|
|
430
|
-
"param",
|
|
431
|
-
"picture",
|
|
432
|
-
"plaintext",
|
|
433
|
-
"portal",
|
|
434
|
-
"pre",
|
|
435
|
-
"progress",
|
|
436
|
-
"q",
|
|
437
|
-
"rb",
|
|
438
|
-
"rp",
|
|
439
|
-
"rt",
|
|
440
|
-
"rtc",
|
|
441
|
-
"ruby",
|
|
442
|
-
"s",
|
|
443
|
-
"samp",
|
|
444
|
-
"script",
|
|
445
|
-
"section",
|
|
446
|
-
"select",
|
|
447
|
-
"shadow",
|
|
448
|
-
"slot",
|
|
449
|
-
"small",
|
|
450
|
-
"source",
|
|
451
|
-
"spacer",
|
|
452
|
-
"span",
|
|
453
|
-
"strike",
|
|
454
|
-
"strong",
|
|
455
|
-
"style",
|
|
456
|
-
"sub",
|
|
457
|
-
"summary",
|
|
458
|
-
"sup",
|
|
459
|
-
"table",
|
|
460
|
-
"tbody",
|
|
461
|
-
"td",
|
|
462
|
-
"template",
|
|
463
|
-
"textarea",
|
|
464
|
-
"tfoot",
|
|
465
|
-
"th",
|
|
466
|
-
"thead",
|
|
467
|
-
"time",
|
|
468
|
-
"title",
|
|
469
|
-
"tr",
|
|
470
|
-
"track",
|
|
471
|
-
"tt",
|
|
472
|
-
"u",
|
|
473
|
-
"ul",
|
|
474
|
-
"var",
|
|
475
|
-
"video",
|
|
476
|
-
"wbr",
|
|
477
|
-
"xmp",
|
|
478
|
-
"input",
|
|
479
|
-
"h1",
|
|
480
|
-
"h2",
|
|
481
|
-
"h3",
|
|
482
|
-
"h4",
|
|
483
|
-
"h5",
|
|
484
|
-
"h6"
|
|
485
|
-
]);
|
|
46
|
+
const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input", "h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
486
47
|
|
|
487
48
|
function reconcileArrays(parentNode, a, b) {
|
|
488
49
|
let bLength = b.length,
|
|
@@ -503,7 +64,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
503
64
|
bEnd--;
|
|
504
65
|
}
|
|
505
66
|
if (aEnd === aStart) {
|
|
506
|
-
const node = bEnd < bLength ?
|
|
67
|
+
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
507
68
|
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
508
69
|
} else if (bEnd === bStart) {
|
|
509
70
|
while (aStart < aEnd) {
|
|
@@ -544,16 +105,12 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
544
105
|
const $$EVENTS = "_$DX_DELEGATE";
|
|
545
106
|
function render(code, element, init, options = {}) {
|
|
546
107
|
if (!element) {
|
|
547
|
-
throw new Error(
|
|
548
|
-
"The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document."
|
|
549
|
-
);
|
|
108
|
+
throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
|
|
550
109
|
}
|
|
551
110
|
let disposer;
|
|
552
111
|
createRoot(dispose => {
|
|
553
112
|
disposer = dispose;
|
|
554
|
-
element === document
|
|
555
|
-
? code()
|
|
556
|
-
: insert(element, code(), element.firstChild ? null : undefined, init);
|
|
113
|
+
element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
|
|
557
114
|
}, options.owner);
|
|
558
115
|
return () => {
|
|
559
116
|
disposer();
|
|
@@ -563,19 +120,12 @@ function render(code, element, init, options = {}) {
|
|
|
563
120
|
function template(html, isImportNode, isSVG, isMathML) {
|
|
564
121
|
let node;
|
|
565
122
|
const create = () => {
|
|
566
|
-
if (isHydrating())
|
|
567
|
-
|
|
568
|
-
"Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration."
|
|
569
|
-
);
|
|
570
|
-
const t = isMathML
|
|
571
|
-
? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template")
|
|
572
|
-
: document.createElement("template");
|
|
123
|
+
if (isHydrating()) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
|
|
124
|
+
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
573
125
|
t.innerHTML = html;
|
|
574
126
|
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
575
127
|
};
|
|
576
|
-
return isImportNode
|
|
577
|
-
? () => untrack(() => document.importNode(node || (node = create()), true))
|
|
578
|
-
: () => (node || (node = create())).cloneNode(true);
|
|
128
|
+
return isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
579
129
|
}
|
|
580
130
|
function delegateEvents(eventNames, document = window.document) {
|
|
581
131
|
const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());
|
|
@@ -597,12 +147,10 @@ function setProperty(node, name, value) {
|
|
|
597
147
|
node[name] = value;
|
|
598
148
|
}
|
|
599
149
|
function setAttribute(node, name, value) {
|
|
600
|
-
if (value == null) node.removeAttribute(name);
|
|
601
|
-
else node.setAttribute(name, value);
|
|
150
|
+
if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
|
|
602
151
|
}
|
|
603
152
|
function setAttributeNS(node, namespace, name, value) {
|
|
604
|
-
if (value == null) node.removeAttributeNS(namespace, name);
|
|
605
|
-
else node.setAttributeNS(namespace, name, value);
|
|
153
|
+
if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
|
|
606
154
|
}
|
|
607
155
|
function setBoolAttribute(node, name, value) {
|
|
608
156
|
if (isHydrating(node)) return;
|
|
@@ -614,7 +162,7 @@ function className(node, value, isSVG, prev) {
|
|
|
614
162
|
return;
|
|
615
163
|
}
|
|
616
164
|
if (typeof value === "string") {
|
|
617
|
-
value !== prev && (isSVG ? node.setAttribute("class", value) :
|
|
165
|
+
value !== prev && (isSVG ? node.setAttribute("class", value) : node.className = value);
|
|
618
166
|
return;
|
|
619
167
|
}
|
|
620
168
|
if (typeof prev === "string") {
|
|
@@ -645,7 +193,7 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
645
193
|
} else node[`$$${name}`] = handler;
|
|
646
194
|
} else if (Array.isArray(handler)) {
|
|
647
195
|
const handlerFn = handler[0];
|
|
648
|
-
node.addEventListener(name,
|
|
196
|
+
node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
|
|
649
197
|
} else node.addEventListener(name, handler, typeof handler !== "function" && handler);
|
|
650
198
|
}
|
|
651
199
|
function style(node, value, prev) {
|
|
@@ -654,7 +202,7 @@ function style(node, value, prev) {
|
|
|
654
202
|
return;
|
|
655
203
|
}
|
|
656
204
|
const nodeStyle = node.style;
|
|
657
|
-
if (typeof value === "string") return
|
|
205
|
+
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
658
206
|
typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
|
|
659
207
|
prev || (prev = {});
|
|
660
208
|
value || (value = {});
|
|
@@ -669,29 +217,20 @@ function style(node, value, prev) {
|
|
|
669
217
|
function spread(node, props = {}, isSVG, skipChildren) {
|
|
670
218
|
const prevProps = {};
|
|
671
219
|
if (!skipChildren) {
|
|
672
|
-
createRenderEffect(
|
|
673
|
-
(
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
prevProps.children = value;
|
|
677
|
-
}
|
|
678
|
-
);
|
|
220
|
+
createRenderEffect(() => normalize(props.children, prevProps.children), value => {
|
|
221
|
+
insertExpression(node, value, prevProps.children);
|
|
222
|
+
prevProps.children = value;
|
|
223
|
+
});
|
|
679
224
|
}
|
|
680
|
-
createRenderEffect(
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
newProps[prop] = props[prop];
|
|
690
|
-
}
|
|
691
|
-
return newProps;
|
|
692
|
-
},
|
|
693
|
-
props => assign(node, props, isSVG, true, prevProps, true)
|
|
694
|
-
);
|
|
225
|
+
createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node), () => {});
|
|
226
|
+
createRenderEffect(() => {
|
|
227
|
+
const newProps = {};
|
|
228
|
+
for (const prop in props) {
|
|
229
|
+
if (prop === "children" || prop === "ref") continue;
|
|
230
|
+
newProps[prop] = props[prop];
|
|
231
|
+
}
|
|
232
|
+
return newProps;
|
|
233
|
+
}, props => assign(node, props, isSVG, true, prevProps, true));
|
|
695
234
|
return prevProps;
|
|
696
235
|
}
|
|
697
236
|
function dynamicProperty(props, key) {
|
|
@@ -714,11 +253,7 @@ function insert(parent, accessor, marker, initial) {
|
|
|
714
253
|
accessor = normalize(accessor, initial, multi, true);
|
|
715
254
|
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
716
255
|
}
|
|
717
|
-
createRenderEffect(
|
|
718
|
-
prev => normalize(accessor, prev, multi),
|
|
719
|
-
(value, current) => insertExpression(parent, value, current, marker),
|
|
720
|
-
initial
|
|
721
|
-
);
|
|
256
|
+
createRenderEffect(prev => normalize(accessor, prev, multi), (value, current) => insertExpression(parent, value, current, marker), initial);
|
|
722
257
|
}
|
|
723
258
|
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
724
259
|
props || (props = {});
|
|
@@ -760,14 +295,10 @@ function getNextElement(template) {
|
|
|
760
295
|
let node,
|
|
761
296
|
key,
|
|
762
297
|
hydrating = isHydrating();
|
|
763
|
-
if (!hydrating || !(node = sharedConfig.registry.get(
|
|
298
|
+
if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
|
|
764
299
|
if (hydrating) {
|
|
765
300
|
sharedConfig.done = true;
|
|
766
|
-
throw new Error(
|
|
767
|
-
`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}\n${
|
|
768
|
-
template ? template().outerHTML : ""
|
|
769
|
-
}`
|
|
770
|
-
);
|
|
301
|
+
throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}\n${template ? template().outerHTML : ""}`);
|
|
771
302
|
}
|
|
772
303
|
return template();
|
|
773
304
|
}
|
|
@@ -787,8 +318,7 @@ function getNextMarker(start) {
|
|
|
787
318
|
while (end) {
|
|
788
319
|
if (end.nodeType === 8) {
|
|
789
320
|
const v = end.nodeValue;
|
|
790
|
-
if (v === "$") count++;
|
|
791
|
-
else if (v === "/") {
|
|
321
|
+
if (v === "$") count++;else if (v === "/") {
|
|
792
322
|
if (count === 0) return [end, current];
|
|
793
323
|
count--;
|
|
794
324
|
}
|
|
@@ -802,7 +332,10 @@ function getNextMarker(start) {
|
|
|
802
332
|
function runHydrationEvents() {
|
|
803
333
|
if (sharedConfig.events && !sharedConfig.events.queued) {
|
|
804
334
|
queueMicrotask(() => {
|
|
805
|
-
const {
|
|
335
|
+
const {
|
|
336
|
+
completed,
|
|
337
|
+
events
|
|
338
|
+
} = sharedConfig;
|
|
806
339
|
if (!events) return;
|
|
807
340
|
events.queued = false;
|
|
808
341
|
while (events.length) {
|
|
@@ -824,16 +357,14 @@ function isHydrating(node) {
|
|
|
824
357
|
}
|
|
825
358
|
function toggleClassKey(node, key, value) {
|
|
826
359
|
const classNames = key.trim().split(/\s+/);
|
|
827
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
|
|
828
|
-
node.classList.toggle(classNames[i], value);
|
|
360
|
+
for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
|
|
829
361
|
}
|
|
830
362
|
function classListToObject(classList) {
|
|
831
363
|
if (Array.isArray(classList)) {
|
|
832
364
|
const result = {};
|
|
833
365
|
for (let i = 0, len = classList.length; i < len; i++) {
|
|
834
366
|
const key = classList[i];
|
|
835
|
-
if (typeof key === "object" && key != null) Object.assign(result, key);
|
|
836
|
-
else if (key || key === 0) result[key] = true;
|
|
367
|
+
if (typeof key === "object" && key != null) Object.assign(result, key);else if (key || key === 0) result[key] = true;
|
|
837
368
|
}
|
|
838
369
|
return result;
|
|
839
370
|
}
|
|
@@ -865,18 +396,11 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
865
396
|
setAttribute(node, prop.slice(5), value);
|
|
866
397
|
} else if (prop.slice(0, 5) === "bool:") {
|
|
867
398
|
setBoolAttribute(node, prop.slice(5), value);
|
|
868
|
-
} else if (
|
|
869
|
-
(forceProp = prop.slice(
|
|
870
|
-
ChildProperties.has(prop) ||
|
|
871
|
-
(!isSVG && (propAlias = getPropAlias(prop, node.tagName))) ||
|
|
872
|
-
Properties.has(prop)
|
|
873
|
-
) {
|
|
874
|
-
if (forceProp) prop = prop.slice(5);
|
|
875
|
-
else node[propAlias || prop] = value;
|
|
399
|
+
} else if ((forceProp = prop.slice(0, 5) === "prop:") || ChildProperties.has(prop) || !isSVG && (propAlias = getPropAlias(prop, node.tagName)) || Properties.has(prop)) {
|
|
400
|
+
if (forceProp) prop = prop.slice(5);else node[propAlias || prop] = value;
|
|
876
401
|
} else {
|
|
877
402
|
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
878
|
-
if (ns) setAttributeNS(node, ns, prop, value);
|
|
879
|
-
else setAttribute(node, prop, value);
|
|
403
|
+
if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, prop, value);
|
|
880
404
|
}
|
|
881
405
|
return value;
|
|
882
406
|
}
|
|
@@ -888,11 +412,10 @@ function eventHandler(e) {
|
|
|
888
412
|
const key = `$$${e.type}`;
|
|
889
413
|
const oriTarget = e.target;
|
|
890
414
|
const oriCurrentTarget = e.currentTarget;
|
|
891
|
-
const retarget = value =>
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
});
|
|
415
|
+
const retarget = value => Object.defineProperty(e, "target", {
|
|
416
|
+
configurable: true,
|
|
417
|
+
value
|
|
418
|
+
});
|
|
896
419
|
const handleNode = () => {
|
|
897
420
|
const handler = node[key];
|
|
898
421
|
if (handler && !node.disabled) {
|
|
@@ -900,11 +423,7 @@ function eventHandler(e) {
|
|
|
900
423
|
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
901
424
|
if (e.cancelBubble) return;
|
|
902
425
|
}
|
|
903
|
-
node.host &&
|
|
904
|
-
typeof node.host !== "string" &&
|
|
905
|
-
!node.host._$host &&
|
|
906
|
-
node.contains(e.target) &&
|
|
907
|
-
retarget(node.host);
|
|
426
|
+
node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
|
|
908
427
|
return true;
|
|
909
428
|
};
|
|
910
429
|
const walkUpTree = () => {
|
|
@@ -932,7 +451,8 @@ function eventHandler(e) {
|
|
|
932
451
|
break;
|
|
933
452
|
}
|
|
934
453
|
}
|
|
935
|
-
}
|
|
454
|
+
}
|
|
455
|
+
else walkUpTree();
|
|
936
456
|
retarget(oriTarget);
|
|
937
457
|
}
|
|
938
458
|
function insertExpression(parent, value, current, marker) {
|
|
@@ -978,9 +498,7 @@ function normalize(value, current, multi, doNotUnwrap) {
|
|
|
978
498
|
const item = value[i],
|
|
979
499
|
prev = current && current[i],
|
|
980
500
|
t = typeof item;
|
|
981
|
-
if (t === "string" || t === "number")
|
|
982
|
-
value[i] =
|
|
983
|
-
prev && prev.nodeType === 3 && prev.data === item ? prev : document.createTextNode(item);
|
|
501
|
+
if (t === "string" || t === "number") value[i] = prev && prev.nodeType === 3 && prev.data === item ? prev : document.createTextNode(item);
|
|
984
502
|
}
|
|
985
503
|
}
|
|
986
504
|
return value;
|
|
@@ -989,18 +507,14 @@ function appendNodes(parent, array, marker = null) {
|
|
|
989
507
|
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
990
508
|
}
|
|
991
509
|
function cleanChildren(parent, current, marker, replacement) {
|
|
992
|
-
if (marker === undefined) return
|
|
510
|
+
if (marker === undefined) return parent.textContent = "";
|
|
993
511
|
if (current.length) {
|
|
994
512
|
let inserted = false;
|
|
995
513
|
for (let i = current.length - 1; i >= 0; i--) {
|
|
996
514
|
const el = current[i];
|
|
997
515
|
if (replacement !== el) {
|
|
998
516
|
const isParent = el.parentNode === parent;
|
|
999
|
-
if (replacement && !inserted && !i)
|
|
1000
|
-
isParent
|
|
1001
|
-
? parent.replaceChild(replacement, el)
|
|
1002
|
-
: parent.insertBefore(replacement, marker);
|
|
1003
|
-
else isParent && el.remove();
|
|
517
|
+
if (replacement && !inserted && !i) isParent ? parent.replaceChild(replacement, el) : parent.insertBefore(replacement, marker);else isParent && el.remove();
|
|
1004
518
|
} else inserted = true;
|
|
1005
519
|
}
|
|
1006
520
|
} else if (replacement) parent.insertBefore(replacement, marker);
|
|
@@ -1010,8 +524,7 @@ function gatherHydratable(element, root) {
|
|
|
1010
524
|
for (let i = 0; i < templates.length; i++) {
|
|
1011
525
|
const node = templates[i];
|
|
1012
526
|
const key = node.getAttribute("data-hk");
|
|
1013
|
-
if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))
|
|
1014
|
-
sharedConfig.registry.set(key, node);
|
|
527
|
+
if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key)) sharedConfig.registry.set(key, node);
|
|
1015
528
|
}
|
|
1016
529
|
}
|
|
1017
530
|
function getHydrationKey() {
|
|
@@ -1064,21 +577,18 @@ function Portal(props) {
|
|
|
1064
577
|
endMarker = document.createTextNode(""),
|
|
1065
578
|
mount = () => createElementProxy(props.mount || document.body, treeMarker);
|
|
1066
579
|
let content = createMemo(() => [startMarker, props.children]);
|
|
1067
|
-
createRenderEffect(
|
|
1068
|
-
()
|
|
1069
|
-
(
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
};
|
|
1080
|
-
}
|
|
1081
|
-
);
|
|
580
|
+
createRenderEffect(() => [mount(), content()], ([m, c]) => {
|
|
581
|
+
m.appendChild(endMarker);
|
|
582
|
+
insert(m, c, endMarker);
|
|
583
|
+
return () => {
|
|
584
|
+
let c = startMarker;
|
|
585
|
+
while (c && c !== endMarker) {
|
|
586
|
+
const n = c.nextSibling;
|
|
587
|
+
m.removeChild(c);
|
|
588
|
+
c = n;
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
});
|
|
1082
592
|
return treeMarker;
|
|
1083
593
|
}
|
|
1084
594
|
function createElementProxy(el, marker) {
|
|
@@ -1118,58 +628,4 @@ function Dynamic(props) {
|
|
|
1118
628
|
});
|
|
1119
629
|
}
|
|
1120
630
|
|
|
1121
|
-
export {
|
|
1122
|
-
voidFn as Assets,
|
|
1123
|
-
ChildProperties,
|
|
1124
|
-
DOMElements,
|
|
1125
|
-
DelegatedEvents,
|
|
1126
|
-
Dynamic,
|
|
1127
|
-
Hydration,
|
|
1128
|
-
voidFn as HydrationScript,
|
|
1129
|
-
NoHydration,
|
|
1130
|
-
Portal,
|
|
1131
|
-
Properties,
|
|
1132
|
-
RequestContext,
|
|
1133
|
-
SVGElements,
|
|
1134
|
-
SVGNamespace,
|
|
1135
|
-
addEventListener,
|
|
1136
|
-
assign,
|
|
1137
|
-
className,
|
|
1138
|
-
clearDelegatedEvents,
|
|
1139
|
-
delegateEvents,
|
|
1140
|
-
dynamicProperty,
|
|
1141
|
-
escape,
|
|
1142
|
-
voidFn as generateHydrationScript,
|
|
1143
|
-
voidFn as getAssets,
|
|
1144
|
-
getHydrationKey,
|
|
1145
|
-
getNextElement,
|
|
1146
|
-
getNextMarker,
|
|
1147
|
-
getNextMatch,
|
|
1148
|
-
getPropAlias,
|
|
1149
|
-
voidFn as getRequestEvent,
|
|
1150
|
-
hydrate,
|
|
1151
|
-
insert,
|
|
1152
|
-
isDev,
|
|
1153
|
-
isServer,
|
|
1154
|
-
render,
|
|
1155
|
-
renderToStream,
|
|
1156
|
-
renderToString,
|
|
1157
|
-
renderToStringAsync,
|
|
1158
|
-
resolveSSRNode,
|
|
1159
|
-
runHydrationEvents,
|
|
1160
|
-
setAttribute,
|
|
1161
|
-
setAttributeNS,
|
|
1162
|
-
setBoolAttribute,
|
|
1163
|
-
setProperty,
|
|
1164
|
-
spread,
|
|
1165
|
-
ssr,
|
|
1166
|
-
ssrAttribute,
|
|
1167
|
-
ssrClassList,
|
|
1168
|
-
ssrElement,
|
|
1169
|
-
ssrHydrationKey,
|
|
1170
|
-
ssrStyle,
|
|
1171
|
-
style,
|
|
1172
|
-
template,
|
|
1173
|
-
use,
|
|
1174
|
-
voidFn as useAssets
|
|
1175
|
-
};
|
|
631
|
+
export { voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, assign, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getPropAlias, voidFn as getRequestEvent, hydrate, insert, isDev, isServer, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setBoolAttribute, setProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrStyle, style, template, use, voidFn as useAssets };
|