@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/web.js
CHANGED
|
@@ -1,71 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
untrack,
|
|
4
|
-
createRenderEffect,
|
|
5
|
-
sharedConfig,
|
|
6
|
-
flatten,
|
|
7
|
-
enableHydration,
|
|
8
|
-
createMemo,
|
|
9
|
-
omit
|
|
10
|
-
} from "solid-js";
|
|
11
|
-
export {
|
|
12
|
-
ErrorBoundary,
|
|
13
|
-
For,
|
|
14
|
-
Match,
|
|
15
|
-
Show,
|
|
16
|
-
Suspense,
|
|
17
|
-
Switch,
|
|
18
|
-
createComponent,
|
|
19
|
-
createRenderEffect as effect,
|
|
20
|
-
getOwner,
|
|
21
|
-
createMemo as memo,
|
|
22
|
-
merge as mergeProps,
|
|
23
|
-
untrack
|
|
24
|
-
} from "solid-js";
|
|
1
|
+
import { createRoot, untrack, createRenderEffect, sharedConfig, flatten, enableHydration, createMemo, omit } 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';
|
|
25
3
|
|
|
26
|
-
const booleans = [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"autoplay",
|
|
31
|
-
"checked",
|
|
32
|
-
"controls",
|
|
33
|
-
"default",
|
|
34
|
-
"disabled",
|
|
35
|
-
"formnovalidate",
|
|
36
|
-
"hidden",
|
|
37
|
-
"indeterminate",
|
|
38
|
-
"inert",
|
|
39
|
-
"ismap",
|
|
40
|
-
"loop",
|
|
41
|
-
"multiple",
|
|
42
|
-
"muted",
|
|
43
|
-
"nomodule",
|
|
44
|
-
"novalidate",
|
|
45
|
-
"open",
|
|
46
|
-
"playsinline",
|
|
47
|
-
"readonly",
|
|
48
|
-
"required",
|
|
49
|
-
"reversed",
|
|
50
|
-
"seamless",
|
|
51
|
-
"selected"
|
|
52
|
-
];
|
|
53
|
-
const Properties = /*#__PURE__*/ new Set([
|
|
54
|
-
"value",
|
|
55
|
-
"readOnly",
|
|
56
|
-
"formNoValidate",
|
|
57
|
-
"isMap",
|
|
58
|
-
"noModule",
|
|
59
|
-
"playsInline",
|
|
60
|
-
...booleans
|
|
61
|
-
]);
|
|
62
|
-
const ChildProperties = /*#__PURE__*/ new Set([
|
|
63
|
-
"innerHTML",
|
|
64
|
-
"textContent",
|
|
65
|
-
"innerText",
|
|
66
|
-
"children"
|
|
67
|
-
]);
|
|
68
|
-
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), {
|
|
69
8
|
class: "className",
|
|
70
9
|
formnovalidate: {
|
|
71
10
|
$: "formNoValidate",
|
|
@@ -92,396 +31,19 @@ const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
|
92
31
|
});
|
|
93
32
|
function getPropAlias(prop, tagName) {
|
|
94
33
|
const a = PropAliases[prop];
|
|
95
|
-
return typeof a === "object" ?
|
|
96
|
-
}
|
|
97
|
-
const DelegatedEvents = /*#__PURE__*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"focusout",
|
|
104
|
-
"input",
|
|
105
|
-
"keydown",
|
|
106
|
-
"keyup",
|
|
107
|
-
"mousedown",
|
|
108
|
-
"mousemove",
|
|
109
|
-
"mouseout",
|
|
110
|
-
"mouseover",
|
|
111
|
-
"mouseup",
|
|
112
|
-
"pointerdown",
|
|
113
|
-
"pointermove",
|
|
114
|
-
"pointerout",
|
|
115
|
-
"pointerover",
|
|
116
|
-
"pointerup",
|
|
117
|
-
"touchend",
|
|
118
|
-
"touchmove",
|
|
119
|
-
"touchstart"
|
|
120
|
-
]);
|
|
121
|
-
const SVGElements = /*#__PURE__*/ new Set([
|
|
122
|
-
"altGlyph",
|
|
123
|
-
"altGlyphDef",
|
|
124
|
-
"altGlyphItem",
|
|
125
|
-
"animate",
|
|
126
|
-
"animateColor",
|
|
127
|
-
"animateMotion",
|
|
128
|
-
"animateTransform",
|
|
129
|
-
"circle",
|
|
130
|
-
"clipPath",
|
|
131
|
-
"color-profile",
|
|
132
|
-
"cursor",
|
|
133
|
-
"defs",
|
|
134
|
-
"desc",
|
|
135
|
-
"ellipse",
|
|
136
|
-
"feBlend",
|
|
137
|
-
"feColorMatrix",
|
|
138
|
-
"feComponentTransfer",
|
|
139
|
-
"feComposite",
|
|
140
|
-
"feConvolveMatrix",
|
|
141
|
-
"feDiffuseLighting",
|
|
142
|
-
"feDisplacementMap",
|
|
143
|
-
"feDistantLight",
|
|
144
|
-
"feDropShadow",
|
|
145
|
-
"feFlood",
|
|
146
|
-
"feFuncA",
|
|
147
|
-
"feFuncB",
|
|
148
|
-
"feFuncG",
|
|
149
|
-
"feFuncR",
|
|
150
|
-
"feGaussianBlur",
|
|
151
|
-
"feImage",
|
|
152
|
-
"feMerge",
|
|
153
|
-
"feMergeNode",
|
|
154
|
-
"feMorphology",
|
|
155
|
-
"feOffset",
|
|
156
|
-
"fePointLight",
|
|
157
|
-
"feSpecularLighting",
|
|
158
|
-
"feSpotLight",
|
|
159
|
-
"feTile",
|
|
160
|
-
"feTurbulence",
|
|
161
|
-
"filter",
|
|
162
|
-
"font",
|
|
163
|
-
"font-face",
|
|
164
|
-
"font-face-format",
|
|
165
|
-
"font-face-name",
|
|
166
|
-
"font-face-src",
|
|
167
|
-
"font-face-uri",
|
|
168
|
-
"foreignObject",
|
|
169
|
-
"g",
|
|
170
|
-
"glyph",
|
|
171
|
-
"glyphRef",
|
|
172
|
-
"hkern",
|
|
173
|
-
"image",
|
|
174
|
-
"line",
|
|
175
|
-
"linearGradient",
|
|
176
|
-
"marker",
|
|
177
|
-
"mask",
|
|
178
|
-
"metadata",
|
|
179
|
-
"missing-glyph",
|
|
180
|
-
"mpath",
|
|
181
|
-
"path",
|
|
182
|
-
"pattern",
|
|
183
|
-
"polygon",
|
|
184
|
-
"polyline",
|
|
185
|
-
"radialGradient",
|
|
186
|
-
"rect",
|
|
187
|
-
"set",
|
|
188
|
-
"stop",
|
|
189
|
-
"svg",
|
|
190
|
-
"switch",
|
|
191
|
-
"symbol",
|
|
192
|
-
"text",
|
|
193
|
-
"textPath",
|
|
194
|
-
"tref",
|
|
195
|
-
"tspan",
|
|
196
|
-
"use",
|
|
197
|
-
"view",
|
|
198
|
-
"vkern"
|
|
199
|
-
]);
|
|
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"]);
|
|
200
42
|
const SVGNamespace = {
|
|
201
43
|
xlink: "http://www.w3.org/1999/xlink",
|
|
202
44
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
203
45
|
};
|
|
204
|
-
const DOMElements = /*#__PURE__*/
|
|
205
|
-
"html",
|
|
206
|
-
"base",
|
|
207
|
-
"head",
|
|
208
|
-
"link",
|
|
209
|
-
"meta",
|
|
210
|
-
"style",
|
|
211
|
-
"title",
|
|
212
|
-
"body",
|
|
213
|
-
"address",
|
|
214
|
-
"article",
|
|
215
|
-
"aside",
|
|
216
|
-
"footer",
|
|
217
|
-
"header",
|
|
218
|
-
"main",
|
|
219
|
-
"nav",
|
|
220
|
-
"section",
|
|
221
|
-
"body",
|
|
222
|
-
"blockquote",
|
|
223
|
-
"dd",
|
|
224
|
-
"div",
|
|
225
|
-
"dl",
|
|
226
|
-
"dt",
|
|
227
|
-
"figcaption",
|
|
228
|
-
"figure",
|
|
229
|
-
"hr",
|
|
230
|
-
"li",
|
|
231
|
-
"ol",
|
|
232
|
-
"p",
|
|
233
|
-
"pre",
|
|
234
|
-
"ul",
|
|
235
|
-
"a",
|
|
236
|
-
"abbr",
|
|
237
|
-
"b",
|
|
238
|
-
"bdi",
|
|
239
|
-
"bdo",
|
|
240
|
-
"br",
|
|
241
|
-
"cite",
|
|
242
|
-
"code",
|
|
243
|
-
"data",
|
|
244
|
-
"dfn",
|
|
245
|
-
"em",
|
|
246
|
-
"i",
|
|
247
|
-
"kbd",
|
|
248
|
-
"mark",
|
|
249
|
-
"q",
|
|
250
|
-
"rp",
|
|
251
|
-
"rt",
|
|
252
|
-
"ruby",
|
|
253
|
-
"s",
|
|
254
|
-
"samp",
|
|
255
|
-
"small",
|
|
256
|
-
"span",
|
|
257
|
-
"strong",
|
|
258
|
-
"sub",
|
|
259
|
-
"sup",
|
|
260
|
-
"time",
|
|
261
|
-
"u",
|
|
262
|
-
"var",
|
|
263
|
-
"wbr",
|
|
264
|
-
"area",
|
|
265
|
-
"audio",
|
|
266
|
-
"img",
|
|
267
|
-
"map",
|
|
268
|
-
"track",
|
|
269
|
-
"video",
|
|
270
|
-
"embed",
|
|
271
|
-
"iframe",
|
|
272
|
-
"object",
|
|
273
|
-
"param",
|
|
274
|
-
"picture",
|
|
275
|
-
"portal",
|
|
276
|
-
"source",
|
|
277
|
-
"svg",
|
|
278
|
-
"math",
|
|
279
|
-
"canvas",
|
|
280
|
-
"noscript",
|
|
281
|
-
"script",
|
|
282
|
-
"del",
|
|
283
|
-
"ins",
|
|
284
|
-
"caption",
|
|
285
|
-
"col",
|
|
286
|
-
"colgroup",
|
|
287
|
-
"table",
|
|
288
|
-
"tbody",
|
|
289
|
-
"td",
|
|
290
|
-
"tfoot",
|
|
291
|
-
"th",
|
|
292
|
-
"thead",
|
|
293
|
-
"tr",
|
|
294
|
-
"button",
|
|
295
|
-
"datalist",
|
|
296
|
-
"fieldset",
|
|
297
|
-
"form",
|
|
298
|
-
"input",
|
|
299
|
-
"label",
|
|
300
|
-
"legend",
|
|
301
|
-
"meter",
|
|
302
|
-
"optgroup",
|
|
303
|
-
"option",
|
|
304
|
-
"output",
|
|
305
|
-
"progress",
|
|
306
|
-
"select",
|
|
307
|
-
"textarea",
|
|
308
|
-
"details",
|
|
309
|
-
"dialog",
|
|
310
|
-
"menu",
|
|
311
|
-
"summary",
|
|
312
|
-
"details",
|
|
313
|
-
"slot",
|
|
314
|
-
"template",
|
|
315
|
-
"acronym",
|
|
316
|
-
"applet",
|
|
317
|
-
"basefont",
|
|
318
|
-
"bgsound",
|
|
319
|
-
"big",
|
|
320
|
-
"blink",
|
|
321
|
-
"center",
|
|
322
|
-
"content",
|
|
323
|
-
"dir",
|
|
324
|
-
"font",
|
|
325
|
-
"frame",
|
|
326
|
-
"frameset",
|
|
327
|
-
"hgroup",
|
|
328
|
-
"image",
|
|
329
|
-
"keygen",
|
|
330
|
-
"marquee",
|
|
331
|
-
"menuitem",
|
|
332
|
-
"nobr",
|
|
333
|
-
"noembed",
|
|
334
|
-
"noframes",
|
|
335
|
-
"plaintext",
|
|
336
|
-
"rb",
|
|
337
|
-
"rtc",
|
|
338
|
-
"shadow",
|
|
339
|
-
"spacer",
|
|
340
|
-
"strike",
|
|
341
|
-
"tt",
|
|
342
|
-
"xmp",
|
|
343
|
-
"a",
|
|
344
|
-
"abbr",
|
|
345
|
-
"acronym",
|
|
346
|
-
"address",
|
|
347
|
-
"applet",
|
|
348
|
-
"area",
|
|
349
|
-
"article",
|
|
350
|
-
"aside",
|
|
351
|
-
"audio",
|
|
352
|
-
"b",
|
|
353
|
-
"base",
|
|
354
|
-
"basefont",
|
|
355
|
-
"bdi",
|
|
356
|
-
"bdo",
|
|
357
|
-
"bgsound",
|
|
358
|
-
"big",
|
|
359
|
-
"blink",
|
|
360
|
-
"blockquote",
|
|
361
|
-
"body",
|
|
362
|
-
"br",
|
|
363
|
-
"button",
|
|
364
|
-
"canvas",
|
|
365
|
-
"caption",
|
|
366
|
-
"center",
|
|
367
|
-
"cite",
|
|
368
|
-
"code",
|
|
369
|
-
"col",
|
|
370
|
-
"colgroup",
|
|
371
|
-
"content",
|
|
372
|
-
"data",
|
|
373
|
-
"datalist",
|
|
374
|
-
"dd",
|
|
375
|
-
"del",
|
|
376
|
-
"details",
|
|
377
|
-
"dfn",
|
|
378
|
-
"dialog",
|
|
379
|
-
"dir",
|
|
380
|
-
"div",
|
|
381
|
-
"dl",
|
|
382
|
-
"dt",
|
|
383
|
-
"em",
|
|
384
|
-
"embed",
|
|
385
|
-
"fieldset",
|
|
386
|
-
"figcaption",
|
|
387
|
-
"figure",
|
|
388
|
-
"font",
|
|
389
|
-
"footer",
|
|
390
|
-
"form",
|
|
391
|
-
"frame",
|
|
392
|
-
"frameset",
|
|
393
|
-
"head",
|
|
394
|
-
"header",
|
|
395
|
-
"hgroup",
|
|
396
|
-
"hr",
|
|
397
|
-
"html",
|
|
398
|
-
"i",
|
|
399
|
-
"iframe",
|
|
400
|
-
"image",
|
|
401
|
-
"img",
|
|
402
|
-
"input",
|
|
403
|
-
"ins",
|
|
404
|
-
"kbd",
|
|
405
|
-
"keygen",
|
|
406
|
-
"label",
|
|
407
|
-
"legend",
|
|
408
|
-
"li",
|
|
409
|
-
"link",
|
|
410
|
-
"main",
|
|
411
|
-
"map",
|
|
412
|
-
"mark",
|
|
413
|
-
"marquee",
|
|
414
|
-
"menu",
|
|
415
|
-
"menuitem",
|
|
416
|
-
"meta",
|
|
417
|
-
"meter",
|
|
418
|
-
"nav",
|
|
419
|
-
"nobr",
|
|
420
|
-
"noembed",
|
|
421
|
-
"noframes",
|
|
422
|
-
"noscript",
|
|
423
|
-
"object",
|
|
424
|
-
"ol",
|
|
425
|
-
"optgroup",
|
|
426
|
-
"option",
|
|
427
|
-
"output",
|
|
428
|
-
"p",
|
|
429
|
-
"param",
|
|
430
|
-
"picture",
|
|
431
|
-
"plaintext",
|
|
432
|
-
"portal",
|
|
433
|
-
"pre",
|
|
434
|
-
"progress",
|
|
435
|
-
"q",
|
|
436
|
-
"rb",
|
|
437
|
-
"rp",
|
|
438
|
-
"rt",
|
|
439
|
-
"rtc",
|
|
440
|
-
"ruby",
|
|
441
|
-
"s",
|
|
442
|
-
"samp",
|
|
443
|
-
"script",
|
|
444
|
-
"section",
|
|
445
|
-
"select",
|
|
446
|
-
"shadow",
|
|
447
|
-
"slot",
|
|
448
|
-
"small",
|
|
449
|
-
"source",
|
|
450
|
-
"spacer",
|
|
451
|
-
"span",
|
|
452
|
-
"strike",
|
|
453
|
-
"strong",
|
|
454
|
-
"style",
|
|
455
|
-
"sub",
|
|
456
|
-
"summary",
|
|
457
|
-
"sup",
|
|
458
|
-
"table",
|
|
459
|
-
"tbody",
|
|
460
|
-
"td",
|
|
461
|
-
"template",
|
|
462
|
-
"textarea",
|
|
463
|
-
"tfoot",
|
|
464
|
-
"th",
|
|
465
|
-
"thead",
|
|
466
|
-
"time",
|
|
467
|
-
"title",
|
|
468
|
-
"tr",
|
|
469
|
-
"track",
|
|
470
|
-
"tt",
|
|
471
|
-
"u",
|
|
472
|
-
"ul",
|
|
473
|
-
"var",
|
|
474
|
-
"video",
|
|
475
|
-
"wbr",
|
|
476
|
-
"xmp",
|
|
477
|
-
"input",
|
|
478
|
-
"h1",
|
|
479
|
-
"h2",
|
|
480
|
-
"h3",
|
|
481
|
-
"h4",
|
|
482
|
-
"h5",
|
|
483
|
-
"h6"
|
|
484
|
-
]);
|
|
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"]);
|
|
485
47
|
|
|
486
48
|
function reconcileArrays(parentNode, a, b) {
|
|
487
49
|
let bLength = b.length,
|
|
@@ -502,7 +64,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
502
64
|
bEnd--;
|
|
503
65
|
}
|
|
504
66
|
if (aEnd === aStart) {
|
|
505
|
-
const node = bEnd < bLength ?
|
|
67
|
+
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
506
68
|
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
507
69
|
} else if (bEnd === bStart) {
|
|
508
70
|
while (aStart < aEnd) {
|
|
@@ -545,9 +107,7 @@ function render(code, element, init, options = {}) {
|
|
|
545
107
|
let disposer;
|
|
546
108
|
createRoot(dispose => {
|
|
547
109
|
disposer = dispose;
|
|
548
|
-
element === document
|
|
549
|
-
? code()
|
|
550
|
-
: insert(element, code(), element.firstChild ? null : undefined, init);
|
|
110
|
+
element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
|
|
551
111
|
}, options.owner);
|
|
552
112
|
return () => {
|
|
553
113
|
disposer();
|
|
@@ -557,15 +117,11 @@ function render(code, element, init, options = {}) {
|
|
|
557
117
|
function template(html, isImportNode, isSVG, isMathML) {
|
|
558
118
|
let node;
|
|
559
119
|
const create = () => {
|
|
560
|
-
const t = isMathML
|
|
561
|
-
? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template")
|
|
562
|
-
: document.createElement("template");
|
|
120
|
+
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
563
121
|
t.innerHTML = html;
|
|
564
122
|
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
565
123
|
};
|
|
566
|
-
return isImportNode
|
|
567
|
-
? () => untrack(() => document.importNode(node || (node = create()), true))
|
|
568
|
-
: () => (node || (node = create())).cloneNode(true);
|
|
124
|
+
return isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
569
125
|
}
|
|
570
126
|
function delegateEvents(eventNames, document = window.document) {
|
|
571
127
|
const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());
|
|
@@ -587,12 +143,10 @@ function setProperty(node, name, value) {
|
|
|
587
143
|
node[name] = value;
|
|
588
144
|
}
|
|
589
145
|
function setAttribute(node, name, value) {
|
|
590
|
-
if (value == null) node.removeAttribute(name);
|
|
591
|
-
else node.setAttribute(name, value);
|
|
146
|
+
if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
|
|
592
147
|
}
|
|
593
148
|
function setAttributeNS(node, namespace, name, value) {
|
|
594
|
-
if (value == null) node.removeAttributeNS(namespace, name);
|
|
595
|
-
else node.setAttributeNS(namespace, name, value);
|
|
149
|
+
if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
|
|
596
150
|
}
|
|
597
151
|
function setBoolAttribute(node, name, value) {
|
|
598
152
|
if (isHydrating(node)) return;
|
|
@@ -604,7 +158,7 @@ function className(node, value, isSVG, prev) {
|
|
|
604
158
|
return;
|
|
605
159
|
}
|
|
606
160
|
if (typeof value === "string") {
|
|
607
|
-
value !== prev && (isSVG ? node.setAttribute("class", value) :
|
|
161
|
+
value !== prev && (isSVG ? node.setAttribute("class", value) : node.className = value);
|
|
608
162
|
return;
|
|
609
163
|
}
|
|
610
164
|
if (typeof prev === "string") {
|
|
@@ -635,7 +189,7 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
635
189
|
} else node[`$$${name}`] = handler;
|
|
636
190
|
} else if (Array.isArray(handler)) {
|
|
637
191
|
const handlerFn = handler[0];
|
|
638
|
-
node.addEventListener(name,
|
|
192
|
+
node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
|
|
639
193
|
} else node.addEventListener(name, handler, typeof handler !== "function" && handler);
|
|
640
194
|
}
|
|
641
195
|
function style(node, value, prev) {
|
|
@@ -644,7 +198,7 @@ function style(node, value, prev) {
|
|
|
644
198
|
return;
|
|
645
199
|
}
|
|
646
200
|
const nodeStyle = node.style;
|
|
647
|
-
if (typeof value === "string") return
|
|
201
|
+
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
648
202
|
typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
|
|
649
203
|
prev || (prev = {});
|
|
650
204
|
value || (value = {});
|
|
@@ -659,29 +213,20 @@ function style(node, value, prev) {
|
|
|
659
213
|
function spread(node, props = {}, isSVG, skipChildren) {
|
|
660
214
|
const prevProps = {};
|
|
661
215
|
if (!skipChildren) {
|
|
662
|
-
createRenderEffect(
|
|
663
|
-
(
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
prevProps.children = value;
|
|
667
|
-
}
|
|
668
|
-
);
|
|
216
|
+
createRenderEffect(() => normalize(props.children, prevProps.children), value => {
|
|
217
|
+
insertExpression(node, value, prevProps.children);
|
|
218
|
+
prevProps.children = value;
|
|
219
|
+
});
|
|
669
220
|
}
|
|
670
|
-
createRenderEffect(
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
newProps[prop] = props[prop];
|
|
680
|
-
}
|
|
681
|
-
return newProps;
|
|
682
|
-
},
|
|
683
|
-
props => assign(node, props, isSVG, true, prevProps, true)
|
|
684
|
-
);
|
|
221
|
+
createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node), () => {});
|
|
222
|
+
createRenderEffect(() => {
|
|
223
|
+
const newProps = {};
|
|
224
|
+
for (const prop in props) {
|
|
225
|
+
if (prop === "children" || prop === "ref") continue;
|
|
226
|
+
newProps[prop] = props[prop];
|
|
227
|
+
}
|
|
228
|
+
return newProps;
|
|
229
|
+
}, props => assign(node, props, isSVG, true, prevProps, true));
|
|
685
230
|
return prevProps;
|
|
686
231
|
}
|
|
687
232
|
function dynamicProperty(props, key) {
|
|
@@ -704,11 +249,7 @@ function insert(parent, accessor, marker, initial) {
|
|
|
704
249
|
accessor = normalize(accessor, initial, multi, true);
|
|
705
250
|
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
706
251
|
}
|
|
707
|
-
createRenderEffect(
|
|
708
|
-
prev => normalize(accessor, prev, multi),
|
|
709
|
-
(value, current) => insertExpression(parent, value, current, marker),
|
|
710
|
-
initial
|
|
711
|
-
);
|
|
252
|
+
createRenderEffect(prev => normalize(accessor, prev, multi), (value, current) => insertExpression(parent, value, current, marker), initial);
|
|
712
253
|
}
|
|
713
254
|
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
714
255
|
props || (props = {});
|
|
@@ -750,7 +291,7 @@ function getNextElement(template) {
|
|
|
750
291
|
let node,
|
|
751
292
|
key,
|
|
752
293
|
hydrating = isHydrating();
|
|
753
|
-
if (!hydrating || !(node = sharedConfig.registry.get(
|
|
294
|
+
if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
|
|
754
295
|
return template();
|
|
755
296
|
}
|
|
756
297
|
if (sharedConfig.completed) sharedConfig.completed.add(node);
|
|
@@ -769,8 +310,7 @@ function getNextMarker(start) {
|
|
|
769
310
|
while (end) {
|
|
770
311
|
if (end.nodeType === 8) {
|
|
771
312
|
const v = end.nodeValue;
|
|
772
|
-
if (v === "$") count++;
|
|
773
|
-
else if (v === "/") {
|
|
313
|
+
if (v === "$") count++;else if (v === "/") {
|
|
774
314
|
if (count === 0) return [end, current];
|
|
775
315
|
count--;
|
|
776
316
|
}
|
|
@@ -784,7 +324,10 @@ function getNextMarker(start) {
|
|
|
784
324
|
function runHydrationEvents() {
|
|
785
325
|
if (sharedConfig.events && !sharedConfig.events.queued) {
|
|
786
326
|
queueMicrotask(() => {
|
|
787
|
-
const {
|
|
327
|
+
const {
|
|
328
|
+
completed,
|
|
329
|
+
events
|
|
330
|
+
} = sharedConfig;
|
|
788
331
|
if (!events) return;
|
|
789
332
|
events.queued = false;
|
|
790
333
|
while (events.length) {
|
|
@@ -806,16 +349,14 @@ function isHydrating(node) {
|
|
|
806
349
|
}
|
|
807
350
|
function toggleClassKey(node, key, value) {
|
|
808
351
|
const classNames = key.trim().split(/\s+/);
|
|
809
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
|
|
810
|
-
node.classList.toggle(classNames[i], value);
|
|
352
|
+
for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
|
|
811
353
|
}
|
|
812
354
|
function classListToObject(classList) {
|
|
813
355
|
if (Array.isArray(classList)) {
|
|
814
356
|
const result = {};
|
|
815
357
|
for (let i = 0, len = classList.length; i < len; i++) {
|
|
816
358
|
const key = classList[i];
|
|
817
|
-
if (typeof key === "object" && key != null) Object.assign(result, key);
|
|
818
|
-
else if (key || key === 0) result[key] = true;
|
|
359
|
+
if (typeof key === "object" && key != null) Object.assign(result, key);else if (key || key === 0) result[key] = true;
|
|
819
360
|
}
|
|
820
361
|
return result;
|
|
821
362
|
}
|
|
@@ -847,18 +388,11 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
847
388
|
setAttribute(node, prop.slice(5), value);
|
|
848
389
|
} else if (prop.slice(0, 5) === "bool:") {
|
|
849
390
|
setBoolAttribute(node, prop.slice(5), value);
|
|
850
|
-
} else if (
|
|
851
|
-
(forceProp = prop.slice(
|
|
852
|
-
ChildProperties.has(prop) ||
|
|
853
|
-
(!isSVG && (propAlias = getPropAlias(prop, node.tagName))) ||
|
|
854
|
-
Properties.has(prop)
|
|
855
|
-
) {
|
|
856
|
-
if (forceProp) prop = prop.slice(5);
|
|
857
|
-
else node[propAlias || prop] = value;
|
|
391
|
+
} else if ((forceProp = prop.slice(0, 5) === "prop:") || ChildProperties.has(prop) || !isSVG && (propAlias = getPropAlias(prop, node.tagName)) || Properties.has(prop)) {
|
|
392
|
+
if (forceProp) prop = prop.slice(5);else node[propAlias || prop] = value;
|
|
858
393
|
} else {
|
|
859
394
|
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
860
|
-
if (ns) setAttributeNS(node, ns, prop, value);
|
|
861
|
-
else setAttribute(node, prop, value);
|
|
395
|
+
if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, prop, value);
|
|
862
396
|
}
|
|
863
397
|
return value;
|
|
864
398
|
}
|
|
@@ -870,11 +404,10 @@ function eventHandler(e) {
|
|
|
870
404
|
const key = `$$${e.type}`;
|
|
871
405
|
const oriTarget = e.target;
|
|
872
406
|
const oriCurrentTarget = e.currentTarget;
|
|
873
|
-
const retarget = value =>
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
});
|
|
407
|
+
const retarget = value => Object.defineProperty(e, "target", {
|
|
408
|
+
configurable: true,
|
|
409
|
+
value
|
|
410
|
+
});
|
|
878
411
|
const handleNode = () => {
|
|
879
412
|
const handler = node[key];
|
|
880
413
|
if (handler && !node.disabled) {
|
|
@@ -882,11 +415,7 @@ function eventHandler(e) {
|
|
|
882
415
|
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
883
416
|
if (e.cancelBubble) return;
|
|
884
417
|
}
|
|
885
|
-
node.host &&
|
|
886
|
-
typeof node.host !== "string" &&
|
|
887
|
-
!node.host._$host &&
|
|
888
|
-
node.contains(e.target) &&
|
|
889
|
-
retarget(node.host);
|
|
418
|
+
node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
|
|
890
419
|
return true;
|
|
891
420
|
};
|
|
892
421
|
const walkUpTree = () => {
|
|
@@ -914,7 +443,8 @@ function eventHandler(e) {
|
|
|
914
443
|
break;
|
|
915
444
|
}
|
|
916
445
|
}
|
|
917
|
-
}
|
|
446
|
+
}
|
|
447
|
+
else walkUpTree();
|
|
918
448
|
retarget(oriTarget);
|
|
919
449
|
}
|
|
920
450
|
function insertExpression(parent, value, current, marker) {
|
|
@@ -946,7 +476,7 @@ function insertExpression(parent, value, current, marker) {
|
|
|
946
476
|
current && cleanChildren(parent);
|
|
947
477
|
appendNodes(parent, value);
|
|
948
478
|
}
|
|
949
|
-
} else;
|
|
479
|
+
} else ;
|
|
950
480
|
}
|
|
951
481
|
function normalize(value, current, multi, doNotUnwrap) {
|
|
952
482
|
value = flatten(value, {
|
|
@@ -960,9 +490,7 @@ function normalize(value, current, multi, doNotUnwrap) {
|
|
|
960
490
|
const item = value[i],
|
|
961
491
|
prev = current && current[i],
|
|
962
492
|
t = typeof item;
|
|
963
|
-
if (t === "string" || t === "number")
|
|
964
|
-
value[i] =
|
|
965
|
-
prev && prev.nodeType === 3 && prev.data === item ? prev : document.createTextNode(item);
|
|
493
|
+
if (t === "string" || t === "number") value[i] = prev && prev.nodeType === 3 && prev.data === item ? prev : document.createTextNode(item);
|
|
966
494
|
}
|
|
967
495
|
}
|
|
968
496
|
return value;
|
|
@@ -971,18 +499,14 @@ function appendNodes(parent, array, marker = null) {
|
|
|
971
499
|
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
972
500
|
}
|
|
973
501
|
function cleanChildren(parent, current, marker, replacement) {
|
|
974
|
-
if (marker === undefined) return
|
|
502
|
+
if (marker === undefined) return parent.textContent = "";
|
|
975
503
|
if (current.length) {
|
|
976
504
|
let inserted = false;
|
|
977
505
|
for (let i = current.length - 1; i >= 0; i--) {
|
|
978
506
|
const el = current[i];
|
|
979
507
|
if (replacement !== el) {
|
|
980
508
|
const isParent = el.parentNode === parent;
|
|
981
|
-
if (replacement && !inserted && !i)
|
|
982
|
-
isParent
|
|
983
|
-
? parent.replaceChild(replacement, el)
|
|
984
|
-
: parent.insertBefore(replacement, marker);
|
|
985
|
-
else isParent && el.remove();
|
|
509
|
+
if (replacement && !inserted && !i) isParent ? parent.replaceChild(replacement, el) : parent.insertBefore(replacement, marker);else isParent && el.remove();
|
|
986
510
|
} else inserted = true;
|
|
987
511
|
}
|
|
988
512
|
} else if (replacement) parent.insertBefore(replacement, marker);
|
|
@@ -992,8 +516,7 @@ function gatherHydratable(element, root) {
|
|
|
992
516
|
for (let i = 0; i < templates.length; i++) {
|
|
993
517
|
const node = templates[i];
|
|
994
518
|
const key = node.getAttribute("data-hk");
|
|
995
|
-
if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))
|
|
996
|
-
sharedConfig.registry.set(key, node);
|
|
519
|
+
if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key)) sharedConfig.registry.set(key, node);
|
|
997
520
|
}
|
|
998
521
|
}
|
|
999
522
|
function getHydrationKey() {
|
|
@@ -1046,21 +569,18 @@ function Portal(props) {
|
|
|
1046
569
|
endMarker = document.createTextNode(""),
|
|
1047
570
|
mount = () => createElementProxy(props.mount || document.body, treeMarker);
|
|
1048
571
|
let content = createMemo(() => [startMarker, props.children]);
|
|
1049
|
-
createRenderEffect(
|
|
1050
|
-
()
|
|
1051
|
-
(
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
};
|
|
1062
|
-
}
|
|
1063
|
-
);
|
|
572
|
+
createRenderEffect(() => [mount(), content()], ([m, c]) => {
|
|
573
|
+
m.appendChild(endMarker);
|
|
574
|
+
insert(m, c, endMarker);
|
|
575
|
+
return () => {
|
|
576
|
+
let c = startMarker;
|
|
577
|
+
while (c && c !== endMarker) {
|
|
578
|
+
const n = c.nextSibling;
|
|
579
|
+
m.removeChild(c);
|
|
580
|
+
c = n;
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
});
|
|
1064
584
|
return treeMarker;
|
|
1065
585
|
}
|
|
1066
586
|
function createElementProxy(el, marker) {
|
|
@@ -1097,58 +617,4 @@ function Dynamic(props) {
|
|
|
1097
617
|
});
|
|
1098
618
|
}
|
|
1099
619
|
|
|
1100
|
-
export {
|
|
1101
|
-
voidFn as Assets,
|
|
1102
|
-
ChildProperties,
|
|
1103
|
-
DOMElements,
|
|
1104
|
-
DelegatedEvents,
|
|
1105
|
-
Dynamic,
|
|
1106
|
-
Hydration,
|
|
1107
|
-
voidFn as HydrationScript,
|
|
1108
|
-
NoHydration,
|
|
1109
|
-
Portal,
|
|
1110
|
-
Properties,
|
|
1111
|
-
RequestContext,
|
|
1112
|
-
SVGElements,
|
|
1113
|
-
SVGNamespace,
|
|
1114
|
-
addEventListener,
|
|
1115
|
-
assign,
|
|
1116
|
-
className,
|
|
1117
|
-
clearDelegatedEvents,
|
|
1118
|
-
delegateEvents,
|
|
1119
|
-
dynamicProperty,
|
|
1120
|
-
escape,
|
|
1121
|
-
voidFn as generateHydrationScript,
|
|
1122
|
-
voidFn as getAssets,
|
|
1123
|
-
getHydrationKey,
|
|
1124
|
-
getNextElement,
|
|
1125
|
-
getNextMarker,
|
|
1126
|
-
getNextMatch,
|
|
1127
|
-
getPropAlias,
|
|
1128
|
-
voidFn as getRequestEvent,
|
|
1129
|
-
hydrate,
|
|
1130
|
-
insert,
|
|
1131
|
-
isDev,
|
|
1132
|
-
isServer,
|
|
1133
|
-
render,
|
|
1134
|
-
renderToStream,
|
|
1135
|
-
renderToString,
|
|
1136
|
-
renderToStringAsync,
|
|
1137
|
-
resolveSSRNode,
|
|
1138
|
-
runHydrationEvents,
|
|
1139
|
-
setAttribute,
|
|
1140
|
-
setAttributeNS,
|
|
1141
|
-
setBoolAttribute,
|
|
1142
|
-
setProperty,
|
|
1143
|
-
spread,
|
|
1144
|
-
ssr,
|
|
1145
|
-
ssrAttribute,
|
|
1146
|
-
ssrClassList,
|
|
1147
|
-
ssrElement,
|
|
1148
|
-
ssrHydrationKey,
|
|
1149
|
-
ssrStyle,
|
|
1150
|
-
style,
|
|
1151
|
-
template,
|
|
1152
|
-
use,
|
|
1153
|
-
voidFn as useAssets
|
|
1154
|
-
};
|
|
620
|
+
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 };
|