solid-js 1.9.3 → 2.0.0-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.cjs +213 -1603
- package/dist/dev.js +159 -1749
- package/dist/server.cjs +88 -11
- package/dist/server.js +91 -11
- package/dist/solid.cjs +196 -1558
- package/dist/solid.js +139 -1682
- package/package.json +8 -154
- package/types/{render → client}/component.d.ts +0 -61
- package/types/client/core.d.ts +75 -0
- package/types/client/flow.d.ts +114 -0
- package/types/{render → client}/hydration.d.ts +0 -2
- package/types/{reactive → client}/observable.d.ts +1 -1
- package/types/index.d.ts +44 -55
- package/types/jsx.d.ts +1944 -174
- package/types/server/index.d.ts +1 -1
- package/types/server/reactive.d.ts +6 -1
- package/types/server/store.d.ts +6 -0
- package/h/dist/h.cjs +0 -115
- package/h/dist/h.js +0 -144
- package/h/jsx-dev-runtime/package.json +0 -8
- package/h/jsx-runtime/dist/jsx.cjs +0 -15
- package/h/jsx-runtime/dist/jsx.js +0 -10
- package/h/jsx-runtime/package.json +0 -8
- package/h/jsx-runtime/types/index.d.ts +0 -14
- package/h/jsx-runtime/types/jsx.d.ts +0 -2276
- package/h/package.json +0 -8
- package/h/types/hyperscript.d.ts +0 -20
- package/h/types/index.d.ts +0 -3
- package/html/dist/html.cjs +0 -583
- package/html/dist/html.js +0 -706
- package/html/package.json +0 -8
- package/html/types/index.d.ts +0 -3
- package/html/types/lit.d.ts +0 -60
- package/store/dist/dev.cjs +0 -454
- package/store/dist/dev.js +0 -525
- package/store/dist/server.cjs +0 -126
- package/store/dist/server.js +0 -126
- package/store/dist/store.cjs +0 -434
- package/store/dist/store.js +0 -499
- package/store/package.json +0 -46
- package/store/types/index.d.ts +0 -26
- package/store/types/modifiers.d.ts +0 -9
- package/store/types/mutable.d.ts +0 -8
- package/store/types/server.d.ts +0 -37
- package/store/types/store.d.ts +0 -263
- package/types/reactive/array.d.ts +0 -52
- package/types/reactive/scheduler.d.ts +0 -13
- package/types/reactive/signal.d.ts +0 -664
- package/types/render/Suspense.d.ts +0 -26
- package/types/render/flow.d.ts +0 -130
- package/types/render/index.d.ts +0 -4
- package/universal/dist/dev.cjs +0 -243
- package/universal/dist/dev.js +0 -257
- package/universal/dist/universal.cjs +0 -243
- package/universal/dist/universal.js +0 -257
- package/universal/package.json +0 -20
- package/universal/types/index.d.ts +0 -4
- package/universal/types/universal.d.ts +0 -29
- package/web/dist/dev.cjs +0 -804
- package/web/dist/dev.js +0 -1241
- package/web/dist/server.cjs +0 -793
- package/web/dist/server.js +0 -1214
- package/web/dist/web.cjs +0 -793
- package/web/dist/web.js +0 -1220
- package/web/package.json +0 -46
- package/web/storage/dist/storage.cjs +0 -12
- package/web/storage/dist/storage.js +0 -10
- package/web/storage/package.json +0 -15
- package/web/storage/types/index.d.ts +0 -2
- package/web/storage/types/index.js +0 -13
- package/web/types/client.d.ts +0 -79
- package/web/types/core.d.ts +0 -10
- package/web/types/index.d.ts +0 -54
- package/web/types/jsx.d.ts +0 -1
- package/web/types/server-mock.d.ts +0 -80
- package/web/types/server.d.ts +0 -177
package/web/dist/web.js
DELETED
|
@@ -1,1220 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createRoot,
|
|
3
|
-
createRenderEffect,
|
|
4
|
-
untrack,
|
|
5
|
-
sharedConfig,
|
|
6
|
-
enableHydration,
|
|
7
|
-
getOwner,
|
|
8
|
-
createEffect,
|
|
9
|
-
runWithOwner,
|
|
10
|
-
createMemo,
|
|
11
|
-
createSignal,
|
|
12
|
-
onCleanup,
|
|
13
|
-
splitProps
|
|
14
|
-
} from "solid-js";
|
|
15
|
-
export {
|
|
16
|
-
ErrorBoundary,
|
|
17
|
-
For,
|
|
18
|
-
Index,
|
|
19
|
-
Match,
|
|
20
|
-
Show,
|
|
21
|
-
Suspense,
|
|
22
|
-
SuspenseList,
|
|
23
|
-
Switch,
|
|
24
|
-
createComponent,
|
|
25
|
-
createRenderEffect as effect,
|
|
26
|
-
getOwner,
|
|
27
|
-
createMemo as memo,
|
|
28
|
-
mergeProps,
|
|
29
|
-
untrack
|
|
30
|
-
} from "solid-js";
|
|
31
|
-
|
|
32
|
-
const booleans = [
|
|
33
|
-
"allowfullscreen",
|
|
34
|
-
"async",
|
|
35
|
-
"autofocus",
|
|
36
|
-
"autoplay",
|
|
37
|
-
"checked",
|
|
38
|
-
"controls",
|
|
39
|
-
"default",
|
|
40
|
-
"disabled",
|
|
41
|
-
"formnovalidate",
|
|
42
|
-
"hidden",
|
|
43
|
-
"indeterminate",
|
|
44
|
-
"inert",
|
|
45
|
-
"ismap",
|
|
46
|
-
"loop",
|
|
47
|
-
"multiple",
|
|
48
|
-
"muted",
|
|
49
|
-
"nomodule",
|
|
50
|
-
"novalidate",
|
|
51
|
-
"open",
|
|
52
|
-
"playsinline",
|
|
53
|
-
"readonly",
|
|
54
|
-
"required",
|
|
55
|
-
"reversed",
|
|
56
|
-
"seamless",
|
|
57
|
-
"selected"
|
|
58
|
-
];
|
|
59
|
-
const Properties = /*#__PURE__*/ new Set([
|
|
60
|
-
"className",
|
|
61
|
-
"value",
|
|
62
|
-
"readOnly",
|
|
63
|
-
"formNoValidate",
|
|
64
|
-
"isMap",
|
|
65
|
-
"noModule",
|
|
66
|
-
"playsInline",
|
|
67
|
-
...booleans
|
|
68
|
-
]);
|
|
69
|
-
const ChildProperties = /*#__PURE__*/ new Set([
|
|
70
|
-
"innerHTML",
|
|
71
|
-
"textContent",
|
|
72
|
-
"innerText",
|
|
73
|
-
"children"
|
|
74
|
-
]);
|
|
75
|
-
const Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
76
|
-
className: "class",
|
|
77
|
-
htmlFor: "for"
|
|
78
|
-
});
|
|
79
|
-
const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
80
|
-
class: "className",
|
|
81
|
-
formnovalidate: {
|
|
82
|
-
$: "formNoValidate",
|
|
83
|
-
BUTTON: 1,
|
|
84
|
-
INPUT: 1
|
|
85
|
-
},
|
|
86
|
-
ismap: {
|
|
87
|
-
$: "isMap",
|
|
88
|
-
IMG: 1
|
|
89
|
-
},
|
|
90
|
-
nomodule: {
|
|
91
|
-
$: "noModule",
|
|
92
|
-
SCRIPT: 1
|
|
93
|
-
},
|
|
94
|
-
playsinline: {
|
|
95
|
-
$: "playsInline",
|
|
96
|
-
VIDEO: 1
|
|
97
|
-
},
|
|
98
|
-
readonly: {
|
|
99
|
-
$: "readOnly",
|
|
100
|
-
INPUT: 1,
|
|
101
|
-
TEXTAREA: 1
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
function getPropAlias(prop, tagName) {
|
|
105
|
-
const a = PropAliases[prop];
|
|
106
|
-
return typeof a === "object" ? (a[tagName] ? a["$"] : undefined) : a;
|
|
107
|
-
}
|
|
108
|
-
const DelegatedEvents = /*#__PURE__*/ new Set([
|
|
109
|
-
"beforeinput",
|
|
110
|
-
"click",
|
|
111
|
-
"dblclick",
|
|
112
|
-
"contextmenu",
|
|
113
|
-
"focusin",
|
|
114
|
-
"focusout",
|
|
115
|
-
"input",
|
|
116
|
-
"keydown",
|
|
117
|
-
"keyup",
|
|
118
|
-
"mousedown",
|
|
119
|
-
"mousemove",
|
|
120
|
-
"mouseout",
|
|
121
|
-
"mouseover",
|
|
122
|
-
"mouseup",
|
|
123
|
-
"pointerdown",
|
|
124
|
-
"pointermove",
|
|
125
|
-
"pointerout",
|
|
126
|
-
"pointerover",
|
|
127
|
-
"pointerup",
|
|
128
|
-
"touchend",
|
|
129
|
-
"touchmove",
|
|
130
|
-
"touchstart"
|
|
131
|
-
]);
|
|
132
|
-
const SVGElements = /*#__PURE__*/ new Set([
|
|
133
|
-
"altGlyph",
|
|
134
|
-
"altGlyphDef",
|
|
135
|
-
"altGlyphItem",
|
|
136
|
-
"animate",
|
|
137
|
-
"animateColor",
|
|
138
|
-
"animateMotion",
|
|
139
|
-
"animateTransform",
|
|
140
|
-
"circle",
|
|
141
|
-
"clipPath",
|
|
142
|
-
"color-profile",
|
|
143
|
-
"cursor",
|
|
144
|
-
"defs",
|
|
145
|
-
"desc",
|
|
146
|
-
"ellipse",
|
|
147
|
-
"feBlend",
|
|
148
|
-
"feColorMatrix",
|
|
149
|
-
"feComponentTransfer",
|
|
150
|
-
"feComposite",
|
|
151
|
-
"feConvolveMatrix",
|
|
152
|
-
"feDiffuseLighting",
|
|
153
|
-
"feDisplacementMap",
|
|
154
|
-
"feDistantLight",
|
|
155
|
-
"feDropShadow",
|
|
156
|
-
"feFlood",
|
|
157
|
-
"feFuncA",
|
|
158
|
-
"feFuncB",
|
|
159
|
-
"feFuncG",
|
|
160
|
-
"feFuncR",
|
|
161
|
-
"feGaussianBlur",
|
|
162
|
-
"feImage",
|
|
163
|
-
"feMerge",
|
|
164
|
-
"feMergeNode",
|
|
165
|
-
"feMorphology",
|
|
166
|
-
"feOffset",
|
|
167
|
-
"fePointLight",
|
|
168
|
-
"feSpecularLighting",
|
|
169
|
-
"feSpotLight",
|
|
170
|
-
"feTile",
|
|
171
|
-
"feTurbulence",
|
|
172
|
-
"filter",
|
|
173
|
-
"font",
|
|
174
|
-
"font-face",
|
|
175
|
-
"font-face-format",
|
|
176
|
-
"font-face-name",
|
|
177
|
-
"font-face-src",
|
|
178
|
-
"font-face-uri",
|
|
179
|
-
"foreignObject",
|
|
180
|
-
"g",
|
|
181
|
-
"glyph",
|
|
182
|
-
"glyphRef",
|
|
183
|
-
"hkern",
|
|
184
|
-
"image",
|
|
185
|
-
"line",
|
|
186
|
-
"linearGradient",
|
|
187
|
-
"marker",
|
|
188
|
-
"mask",
|
|
189
|
-
"metadata",
|
|
190
|
-
"missing-glyph",
|
|
191
|
-
"mpath",
|
|
192
|
-
"path",
|
|
193
|
-
"pattern",
|
|
194
|
-
"polygon",
|
|
195
|
-
"polyline",
|
|
196
|
-
"radialGradient",
|
|
197
|
-
"rect",
|
|
198
|
-
"set",
|
|
199
|
-
"stop",
|
|
200
|
-
"svg",
|
|
201
|
-
"switch",
|
|
202
|
-
"symbol",
|
|
203
|
-
"text",
|
|
204
|
-
"textPath",
|
|
205
|
-
"tref",
|
|
206
|
-
"tspan",
|
|
207
|
-
"use",
|
|
208
|
-
"view",
|
|
209
|
-
"vkern"
|
|
210
|
-
]);
|
|
211
|
-
const SVGNamespace = {
|
|
212
|
-
xlink: "http://www.w3.org/1999/xlink",
|
|
213
|
-
xml: "http://www.w3.org/XML/1998/namespace"
|
|
214
|
-
};
|
|
215
|
-
const DOMElements = /*#__PURE__*/ new Set([
|
|
216
|
-
"html",
|
|
217
|
-
"base",
|
|
218
|
-
"head",
|
|
219
|
-
"link",
|
|
220
|
-
"meta",
|
|
221
|
-
"style",
|
|
222
|
-
"title",
|
|
223
|
-
"body",
|
|
224
|
-
"address",
|
|
225
|
-
"article",
|
|
226
|
-
"aside",
|
|
227
|
-
"footer",
|
|
228
|
-
"header",
|
|
229
|
-
"main",
|
|
230
|
-
"nav",
|
|
231
|
-
"section",
|
|
232
|
-
"body",
|
|
233
|
-
"blockquote",
|
|
234
|
-
"dd",
|
|
235
|
-
"div",
|
|
236
|
-
"dl",
|
|
237
|
-
"dt",
|
|
238
|
-
"figcaption",
|
|
239
|
-
"figure",
|
|
240
|
-
"hr",
|
|
241
|
-
"li",
|
|
242
|
-
"ol",
|
|
243
|
-
"p",
|
|
244
|
-
"pre",
|
|
245
|
-
"ul",
|
|
246
|
-
"a",
|
|
247
|
-
"abbr",
|
|
248
|
-
"b",
|
|
249
|
-
"bdi",
|
|
250
|
-
"bdo",
|
|
251
|
-
"br",
|
|
252
|
-
"cite",
|
|
253
|
-
"code",
|
|
254
|
-
"data",
|
|
255
|
-
"dfn",
|
|
256
|
-
"em",
|
|
257
|
-
"i",
|
|
258
|
-
"kbd",
|
|
259
|
-
"mark",
|
|
260
|
-
"q",
|
|
261
|
-
"rp",
|
|
262
|
-
"rt",
|
|
263
|
-
"ruby",
|
|
264
|
-
"s",
|
|
265
|
-
"samp",
|
|
266
|
-
"small",
|
|
267
|
-
"span",
|
|
268
|
-
"strong",
|
|
269
|
-
"sub",
|
|
270
|
-
"sup",
|
|
271
|
-
"time",
|
|
272
|
-
"u",
|
|
273
|
-
"var",
|
|
274
|
-
"wbr",
|
|
275
|
-
"area",
|
|
276
|
-
"audio",
|
|
277
|
-
"img",
|
|
278
|
-
"map",
|
|
279
|
-
"track",
|
|
280
|
-
"video",
|
|
281
|
-
"embed",
|
|
282
|
-
"iframe",
|
|
283
|
-
"object",
|
|
284
|
-
"param",
|
|
285
|
-
"picture",
|
|
286
|
-
"portal",
|
|
287
|
-
"source",
|
|
288
|
-
"svg",
|
|
289
|
-
"math",
|
|
290
|
-
"canvas",
|
|
291
|
-
"noscript",
|
|
292
|
-
"script",
|
|
293
|
-
"del",
|
|
294
|
-
"ins",
|
|
295
|
-
"caption",
|
|
296
|
-
"col",
|
|
297
|
-
"colgroup",
|
|
298
|
-
"table",
|
|
299
|
-
"tbody",
|
|
300
|
-
"td",
|
|
301
|
-
"tfoot",
|
|
302
|
-
"th",
|
|
303
|
-
"thead",
|
|
304
|
-
"tr",
|
|
305
|
-
"button",
|
|
306
|
-
"datalist",
|
|
307
|
-
"fieldset",
|
|
308
|
-
"form",
|
|
309
|
-
"input",
|
|
310
|
-
"label",
|
|
311
|
-
"legend",
|
|
312
|
-
"meter",
|
|
313
|
-
"optgroup",
|
|
314
|
-
"option",
|
|
315
|
-
"output",
|
|
316
|
-
"progress",
|
|
317
|
-
"select",
|
|
318
|
-
"textarea",
|
|
319
|
-
"details",
|
|
320
|
-
"dialog",
|
|
321
|
-
"menu",
|
|
322
|
-
"summary",
|
|
323
|
-
"details",
|
|
324
|
-
"slot",
|
|
325
|
-
"template",
|
|
326
|
-
"acronym",
|
|
327
|
-
"applet",
|
|
328
|
-
"basefont",
|
|
329
|
-
"bgsound",
|
|
330
|
-
"big",
|
|
331
|
-
"blink",
|
|
332
|
-
"center",
|
|
333
|
-
"content",
|
|
334
|
-
"dir",
|
|
335
|
-
"font",
|
|
336
|
-
"frame",
|
|
337
|
-
"frameset",
|
|
338
|
-
"hgroup",
|
|
339
|
-
"image",
|
|
340
|
-
"keygen",
|
|
341
|
-
"marquee",
|
|
342
|
-
"menuitem",
|
|
343
|
-
"nobr",
|
|
344
|
-
"noembed",
|
|
345
|
-
"noframes",
|
|
346
|
-
"plaintext",
|
|
347
|
-
"rb",
|
|
348
|
-
"rtc",
|
|
349
|
-
"shadow",
|
|
350
|
-
"spacer",
|
|
351
|
-
"strike",
|
|
352
|
-
"tt",
|
|
353
|
-
"xmp",
|
|
354
|
-
"a",
|
|
355
|
-
"abbr",
|
|
356
|
-
"acronym",
|
|
357
|
-
"address",
|
|
358
|
-
"applet",
|
|
359
|
-
"area",
|
|
360
|
-
"article",
|
|
361
|
-
"aside",
|
|
362
|
-
"audio",
|
|
363
|
-
"b",
|
|
364
|
-
"base",
|
|
365
|
-
"basefont",
|
|
366
|
-
"bdi",
|
|
367
|
-
"bdo",
|
|
368
|
-
"bgsound",
|
|
369
|
-
"big",
|
|
370
|
-
"blink",
|
|
371
|
-
"blockquote",
|
|
372
|
-
"body",
|
|
373
|
-
"br",
|
|
374
|
-
"button",
|
|
375
|
-
"canvas",
|
|
376
|
-
"caption",
|
|
377
|
-
"center",
|
|
378
|
-
"cite",
|
|
379
|
-
"code",
|
|
380
|
-
"col",
|
|
381
|
-
"colgroup",
|
|
382
|
-
"content",
|
|
383
|
-
"data",
|
|
384
|
-
"datalist",
|
|
385
|
-
"dd",
|
|
386
|
-
"del",
|
|
387
|
-
"details",
|
|
388
|
-
"dfn",
|
|
389
|
-
"dialog",
|
|
390
|
-
"dir",
|
|
391
|
-
"div",
|
|
392
|
-
"dl",
|
|
393
|
-
"dt",
|
|
394
|
-
"em",
|
|
395
|
-
"embed",
|
|
396
|
-
"fieldset",
|
|
397
|
-
"figcaption",
|
|
398
|
-
"figure",
|
|
399
|
-
"font",
|
|
400
|
-
"footer",
|
|
401
|
-
"form",
|
|
402
|
-
"frame",
|
|
403
|
-
"frameset",
|
|
404
|
-
"head",
|
|
405
|
-
"header",
|
|
406
|
-
"hgroup",
|
|
407
|
-
"hr",
|
|
408
|
-
"html",
|
|
409
|
-
"i",
|
|
410
|
-
"iframe",
|
|
411
|
-
"image",
|
|
412
|
-
"img",
|
|
413
|
-
"input",
|
|
414
|
-
"ins",
|
|
415
|
-
"kbd",
|
|
416
|
-
"keygen",
|
|
417
|
-
"label",
|
|
418
|
-
"legend",
|
|
419
|
-
"li",
|
|
420
|
-
"link",
|
|
421
|
-
"main",
|
|
422
|
-
"map",
|
|
423
|
-
"mark",
|
|
424
|
-
"marquee",
|
|
425
|
-
"menu",
|
|
426
|
-
"menuitem",
|
|
427
|
-
"meta",
|
|
428
|
-
"meter",
|
|
429
|
-
"nav",
|
|
430
|
-
"nobr",
|
|
431
|
-
"noembed",
|
|
432
|
-
"noframes",
|
|
433
|
-
"noscript",
|
|
434
|
-
"object",
|
|
435
|
-
"ol",
|
|
436
|
-
"optgroup",
|
|
437
|
-
"option",
|
|
438
|
-
"output",
|
|
439
|
-
"p",
|
|
440
|
-
"param",
|
|
441
|
-
"picture",
|
|
442
|
-
"plaintext",
|
|
443
|
-
"portal",
|
|
444
|
-
"pre",
|
|
445
|
-
"progress",
|
|
446
|
-
"q",
|
|
447
|
-
"rb",
|
|
448
|
-
"rp",
|
|
449
|
-
"rt",
|
|
450
|
-
"rtc",
|
|
451
|
-
"ruby",
|
|
452
|
-
"s",
|
|
453
|
-
"samp",
|
|
454
|
-
"script",
|
|
455
|
-
"section",
|
|
456
|
-
"select",
|
|
457
|
-
"shadow",
|
|
458
|
-
"slot",
|
|
459
|
-
"small",
|
|
460
|
-
"source",
|
|
461
|
-
"spacer",
|
|
462
|
-
"span",
|
|
463
|
-
"strike",
|
|
464
|
-
"strong",
|
|
465
|
-
"style",
|
|
466
|
-
"sub",
|
|
467
|
-
"summary",
|
|
468
|
-
"sup",
|
|
469
|
-
"table",
|
|
470
|
-
"tbody",
|
|
471
|
-
"td",
|
|
472
|
-
"template",
|
|
473
|
-
"textarea",
|
|
474
|
-
"tfoot",
|
|
475
|
-
"th",
|
|
476
|
-
"thead",
|
|
477
|
-
"time",
|
|
478
|
-
"title",
|
|
479
|
-
"tr",
|
|
480
|
-
"track",
|
|
481
|
-
"tt",
|
|
482
|
-
"u",
|
|
483
|
-
"ul",
|
|
484
|
-
"var",
|
|
485
|
-
"video",
|
|
486
|
-
"wbr",
|
|
487
|
-
"xmp",
|
|
488
|
-
"input",
|
|
489
|
-
"h1",
|
|
490
|
-
"h2",
|
|
491
|
-
"h3",
|
|
492
|
-
"h4",
|
|
493
|
-
"h5",
|
|
494
|
-
"h6"
|
|
495
|
-
]);
|
|
496
|
-
|
|
497
|
-
function reconcileArrays(parentNode, a, b) {
|
|
498
|
-
let bLength = b.length,
|
|
499
|
-
aEnd = a.length,
|
|
500
|
-
bEnd = bLength,
|
|
501
|
-
aStart = 0,
|
|
502
|
-
bStart = 0,
|
|
503
|
-
after = a[aEnd - 1].nextSibling,
|
|
504
|
-
map = null;
|
|
505
|
-
while (aStart < aEnd || bStart < bEnd) {
|
|
506
|
-
if (a[aStart] === b[bStart]) {
|
|
507
|
-
aStart++;
|
|
508
|
-
bStart++;
|
|
509
|
-
continue;
|
|
510
|
-
}
|
|
511
|
-
while (a[aEnd - 1] === b[bEnd - 1]) {
|
|
512
|
-
aEnd--;
|
|
513
|
-
bEnd--;
|
|
514
|
-
}
|
|
515
|
-
if (aEnd === aStart) {
|
|
516
|
-
const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;
|
|
517
|
-
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
518
|
-
} else if (bEnd === bStart) {
|
|
519
|
-
while (aStart < aEnd) {
|
|
520
|
-
if (!map || !map.has(a[aStart])) a[aStart].remove();
|
|
521
|
-
aStart++;
|
|
522
|
-
}
|
|
523
|
-
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
524
|
-
const node = a[--aEnd].nextSibling;
|
|
525
|
-
parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
|
|
526
|
-
parentNode.insertBefore(b[--bEnd], node);
|
|
527
|
-
a[aEnd] = b[bEnd];
|
|
528
|
-
} else {
|
|
529
|
-
if (!map) {
|
|
530
|
-
map = new Map();
|
|
531
|
-
let i = bStart;
|
|
532
|
-
while (i < bEnd) map.set(b[i], i++);
|
|
533
|
-
}
|
|
534
|
-
const index = map.get(a[aStart]);
|
|
535
|
-
if (index != null) {
|
|
536
|
-
if (bStart < index && index < bEnd) {
|
|
537
|
-
let i = aStart,
|
|
538
|
-
sequence = 1,
|
|
539
|
-
t;
|
|
540
|
-
while (++i < aEnd && i < bEnd) {
|
|
541
|
-
if ((t = map.get(a[i])) == null || t !== index + sequence) break;
|
|
542
|
-
sequence++;
|
|
543
|
-
}
|
|
544
|
-
if (sequence > index - bStart) {
|
|
545
|
-
const node = a[aStart];
|
|
546
|
-
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
547
|
-
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
548
|
-
} else aStart++;
|
|
549
|
-
} else a[aStart++].remove();
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
const $$EVENTS = "_$DX_DELEGATE";
|
|
555
|
-
function render(code, element, init, options = {}) {
|
|
556
|
-
let disposer;
|
|
557
|
-
createRoot(dispose => {
|
|
558
|
-
disposer = dispose;
|
|
559
|
-
element === document
|
|
560
|
-
? code()
|
|
561
|
-
: insert(element, code(), element.firstChild ? null : undefined, init);
|
|
562
|
-
}, options.owner);
|
|
563
|
-
return () => {
|
|
564
|
-
disposer();
|
|
565
|
-
element.textContent = "";
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
function template(html, isImportNode, isSVG) {
|
|
569
|
-
let node;
|
|
570
|
-
const create = () => {
|
|
571
|
-
const t = document.createElement("template");
|
|
572
|
-
t.innerHTML = html;
|
|
573
|
-
return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
574
|
-
};
|
|
575
|
-
const fn = isImportNode
|
|
576
|
-
? () => untrack(() => document.importNode(node || (node = create()), true))
|
|
577
|
-
: () => (node || (node = create())).cloneNode(true);
|
|
578
|
-
fn.cloneNode = fn;
|
|
579
|
-
return fn;
|
|
580
|
-
}
|
|
581
|
-
function delegateEvents(eventNames, document = window.document) {
|
|
582
|
-
const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());
|
|
583
|
-
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
584
|
-
const name = eventNames[i];
|
|
585
|
-
if (!e.has(name)) {
|
|
586
|
-
e.add(name);
|
|
587
|
-
document.addEventListener(name, eventHandler);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
function clearDelegatedEvents(document = window.document) {
|
|
592
|
-
if (document[$$EVENTS]) {
|
|
593
|
-
for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);
|
|
594
|
-
delete document[$$EVENTS];
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
function setProperty(node, name, value) {
|
|
598
|
-
if (isHydrating(node)) return;
|
|
599
|
-
node[name] = value;
|
|
600
|
-
}
|
|
601
|
-
function setAttribute(node, name, value) {
|
|
602
|
-
if (isHydrating(node)) return;
|
|
603
|
-
if (value == null) node.removeAttribute(name);
|
|
604
|
-
else node.setAttribute(name, value);
|
|
605
|
-
}
|
|
606
|
-
function setAttributeNS(node, namespace, name, value) {
|
|
607
|
-
if (isHydrating(node)) return;
|
|
608
|
-
if (value == null) node.removeAttributeNS(namespace, name);
|
|
609
|
-
else node.setAttributeNS(namespace, name, value);
|
|
610
|
-
}
|
|
611
|
-
function setBoolAttribute(node, name, value) {
|
|
612
|
-
if (isHydrating(node)) return;
|
|
613
|
-
value ? node.setAttribute(name, "") : node.removeAttribute(name);
|
|
614
|
-
}
|
|
615
|
-
function className(node, value) {
|
|
616
|
-
if (isHydrating(node)) return;
|
|
617
|
-
if (value == null) node.removeAttribute("class");
|
|
618
|
-
else node.className = value;
|
|
619
|
-
}
|
|
620
|
-
function addEventListener(node, name, handler, delegate) {
|
|
621
|
-
if (delegate) {
|
|
622
|
-
if (Array.isArray(handler)) {
|
|
623
|
-
node[`$$${name}`] = handler[0];
|
|
624
|
-
node[`$$${name}Data`] = handler[1];
|
|
625
|
-
} else node[`$$${name}`] = handler;
|
|
626
|
-
} else if (Array.isArray(handler)) {
|
|
627
|
-
const handlerFn = handler[0];
|
|
628
|
-
node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));
|
|
629
|
-
} else node.addEventListener(name, handler, typeof handler !== "function" && handler);
|
|
630
|
-
}
|
|
631
|
-
function classList(node, value, prev = {}) {
|
|
632
|
-
const classKeys = Object.keys(value || {}),
|
|
633
|
-
prevKeys = Object.keys(prev);
|
|
634
|
-
let i, len;
|
|
635
|
-
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
636
|
-
const key = prevKeys[i];
|
|
637
|
-
if (!key || key === "undefined" || value[key]) continue;
|
|
638
|
-
toggleClassKey(node, key, false);
|
|
639
|
-
delete prev[key];
|
|
640
|
-
}
|
|
641
|
-
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
642
|
-
const key = classKeys[i],
|
|
643
|
-
classValue = !!value[key];
|
|
644
|
-
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
645
|
-
toggleClassKey(node, key, true);
|
|
646
|
-
prev[key] = classValue;
|
|
647
|
-
}
|
|
648
|
-
return prev;
|
|
649
|
-
}
|
|
650
|
-
function style(node, value, prev) {
|
|
651
|
-
if (!value) return prev ? setAttribute(node, "style") : value;
|
|
652
|
-
const nodeStyle = node.style;
|
|
653
|
-
if (typeof value === "string") return (nodeStyle.cssText = value);
|
|
654
|
-
typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
|
|
655
|
-
prev || (prev = {});
|
|
656
|
-
value || (value = {});
|
|
657
|
-
let v, s;
|
|
658
|
-
for (s in prev) {
|
|
659
|
-
value[s] == null && nodeStyle.removeProperty(s);
|
|
660
|
-
delete prev[s];
|
|
661
|
-
}
|
|
662
|
-
for (s in value) {
|
|
663
|
-
v = value[s];
|
|
664
|
-
if (v !== prev[s]) {
|
|
665
|
-
nodeStyle.setProperty(s, v);
|
|
666
|
-
prev[s] = v;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
return prev;
|
|
670
|
-
}
|
|
671
|
-
function spread(node, props = {}, isSVG, skipChildren) {
|
|
672
|
-
const prevProps = {};
|
|
673
|
-
if (!skipChildren) {
|
|
674
|
-
createRenderEffect(
|
|
675
|
-
() => (prevProps.children = insertExpression(node, props.children, prevProps.children))
|
|
676
|
-
);
|
|
677
|
-
}
|
|
678
|
-
createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
|
|
679
|
-
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
680
|
-
return prevProps;
|
|
681
|
-
}
|
|
682
|
-
function dynamicProperty(props, key) {
|
|
683
|
-
const src = props[key];
|
|
684
|
-
Object.defineProperty(props, key, {
|
|
685
|
-
get() {
|
|
686
|
-
return src();
|
|
687
|
-
},
|
|
688
|
-
enumerable: true
|
|
689
|
-
});
|
|
690
|
-
return props;
|
|
691
|
-
}
|
|
692
|
-
function use(fn, element, arg) {
|
|
693
|
-
return untrack(() => fn(element, arg));
|
|
694
|
-
}
|
|
695
|
-
function insert(parent, accessor, marker, initial) {
|
|
696
|
-
if (marker !== undefined && !initial) initial = [];
|
|
697
|
-
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
698
|
-
createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);
|
|
699
|
-
}
|
|
700
|
-
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
701
|
-
props || (props = {});
|
|
702
|
-
for (const prop in prevProps) {
|
|
703
|
-
if (!(prop in props)) {
|
|
704
|
-
if (prop === "children") continue;
|
|
705
|
-
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
for (const prop in props) {
|
|
709
|
-
if (prop === "children") {
|
|
710
|
-
if (!skipChildren) insertExpression(node, props.children);
|
|
711
|
-
continue;
|
|
712
|
-
}
|
|
713
|
-
const value = props[prop];
|
|
714
|
-
prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
function hydrate$1(code, element, options = {}) {
|
|
718
|
-
if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options);
|
|
719
|
-
sharedConfig.completed = globalThis._$HY.completed;
|
|
720
|
-
sharedConfig.events = globalThis._$HY.events;
|
|
721
|
-
sharedConfig.load = id => globalThis._$HY.r[id];
|
|
722
|
-
sharedConfig.has = id => id in globalThis._$HY.r;
|
|
723
|
-
sharedConfig.gather = root => gatherHydratable(element, root);
|
|
724
|
-
sharedConfig.registry = new Map();
|
|
725
|
-
sharedConfig.context = {
|
|
726
|
-
id: options.renderId || "",
|
|
727
|
-
count: 0
|
|
728
|
-
};
|
|
729
|
-
try {
|
|
730
|
-
gatherHydratable(element, options.renderId);
|
|
731
|
-
return render(code, element, [...element.childNodes], options);
|
|
732
|
-
} finally {
|
|
733
|
-
sharedConfig.context = null;
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
function getNextElement(template) {
|
|
737
|
-
let node,
|
|
738
|
-
key,
|
|
739
|
-
hydrating = isHydrating();
|
|
740
|
-
if (!hydrating || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {
|
|
741
|
-
return template();
|
|
742
|
-
}
|
|
743
|
-
if (sharedConfig.completed) sharedConfig.completed.add(node);
|
|
744
|
-
sharedConfig.registry.delete(key);
|
|
745
|
-
return node;
|
|
746
|
-
}
|
|
747
|
-
function getNextMatch(el, nodeName) {
|
|
748
|
-
while (el && el.localName !== nodeName) el = el.nextSibling;
|
|
749
|
-
return el;
|
|
750
|
-
}
|
|
751
|
-
function getNextMarker(start) {
|
|
752
|
-
let end = start,
|
|
753
|
-
count = 0,
|
|
754
|
-
current = [];
|
|
755
|
-
if (isHydrating(start)) {
|
|
756
|
-
while (end) {
|
|
757
|
-
if (end.nodeType === 8) {
|
|
758
|
-
const v = end.nodeValue;
|
|
759
|
-
if (v === "$") count++;
|
|
760
|
-
else if (v === "/") {
|
|
761
|
-
if (count === 0) return [end, current];
|
|
762
|
-
count--;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
current.push(end);
|
|
766
|
-
end = end.nextSibling;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
return [end, current];
|
|
770
|
-
}
|
|
771
|
-
function runHydrationEvents() {
|
|
772
|
-
if (sharedConfig.events && !sharedConfig.events.queued) {
|
|
773
|
-
queueMicrotask(() => {
|
|
774
|
-
const { completed, events } = sharedConfig;
|
|
775
|
-
if (!events) return;
|
|
776
|
-
events.queued = false;
|
|
777
|
-
while (events.length) {
|
|
778
|
-
const [el, e] = events[0];
|
|
779
|
-
if (!completed.has(el)) return;
|
|
780
|
-
events.shift();
|
|
781
|
-
eventHandler(e);
|
|
782
|
-
}
|
|
783
|
-
if (sharedConfig.done) {
|
|
784
|
-
sharedConfig.events = _$HY.events = null;
|
|
785
|
-
sharedConfig.completed = _$HY.completed = null;
|
|
786
|
-
}
|
|
787
|
-
});
|
|
788
|
-
sharedConfig.events.queued = true;
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
function isHydrating(node) {
|
|
792
|
-
return !!sharedConfig.context && !sharedConfig.done && (!node || node.isConnected);
|
|
793
|
-
}
|
|
794
|
-
function toPropertyName(name) {
|
|
795
|
-
return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
|
|
796
|
-
}
|
|
797
|
-
function toggleClassKey(node, key, value) {
|
|
798
|
-
const classNames = key.trim().split(/\s+/);
|
|
799
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
|
|
800
|
-
node.classList.toggle(classNames[i], value);
|
|
801
|
-
}
|
|
802
|
-
function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
|
|
803
|
-
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
804
|
-
if (prop === "style") return style(node, value, prev);
|
|
805
|
-
if (prop === "classList") return classList(node, value, prev);
|
|
806
|
-
if (value === prev) return prev;
|
|
807
|
-
if (prop === "ref") {
|
|
808
|
-
if (!skipRef) value(node);
|
|
809
|
-
} else if (prop.slice(0, 3) === "on:") {
|
|
810
|
-
const e = prop.slice(3);
|
|
811
|
-
prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
|
|
812
|
-
value && node.addEventListener(e, value, typeof value !== "function" && value);
|
|
813
|
-
} else if (prop.slice(0, 10) === "oncapture:") {
|
|
814
|
-
const e = prop.slice(10);
|
|
815
|
-
prev && node.removeEventListener(e, prev, true);
|
|
816
|
-
value && node.addEventListener(e, value, true);
|
|
817
|
-
} else if (prop.slice(0, 2) === "on") {
|
|
818
|
-
const name = prop.slice(2).toLowerCase();
|
|
819
|
-
const delegate = DelegatedEvents.has(name);
|
|
820
|
-
if (!delegate && prev) {
|
|
821
|
-
const h = Array.isArray(prev) ? prev[0] : prev;
|
|
822
|
-
node.removeEventListener(name, h);
|
|
823
|
-
}
|
|
824
|
-
if (delegate || value) {
|
|
825
|
-
addEventListener(node, name, value, delegate);
|
|
826
|
-
delegate && delegateEvents([name]);
|
|
827
|
-
}
|
|
828
|
-
} else if (prop.slice(0, 5) === "attr:") {
|
|
829
|
-
setAttribute(node, prop.slice(5), value);
|
|
830
|
-
} else if (prop.slice(0, 5) === "bool:") {
|
|
831
|
-
setBoolAttribute(node, prop.slice(5), value);
|
|
832
|
-
} else if (
|
|
833
|
-
(forceProp = prop.slice(0, 5) === "prop:") ||
|
|
834
|
-
(isChildProp = ChildProperties.has(prop)) ||
|
|
835
|
-
(!isSVG &&
|
|
836
|
-
((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||
|
|
837
|
-
(isCE = node.nodeName.includes("-") || "is" in props)
|
|
838
|
-
) {
|
|
839
|
-
if (forceProp) {
|
|
840
|
-
prop = prop.slice(5);
|
|
841
|
-
isProp = true;
|
|
842
|
-
} else if (isHydrating(node)) return value;
|
|
843
|
-
if (prop === "class" || prop === "className") className(node, value);
|
|
844
|
-
else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
|
|
845
|
-
else node[propAlias || prop] = value;
|
|
846
|
-
} else {
|
|
847
|
-
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
848
|
-
if (ns) setAttributeNS(node, ns, prop, value);
|
|
849
|
-
else setAttribute(node, Aliases[prop] || prop, value);
|
|
850
|
-
}
|
|
851
|
-
return value;
|
|
852
|
-
}
|
|
853
|
-
function eventHandler(e) {
|
|
854
|
-
if (sharedConfig.registry && sharedConfig.events) {
|
|
855
|
-
if (sharedConfig.events.find(([el, ev]) => ev === e)) return;
|
|
856
|
-
}
|
|
857
|
-
let node = e.target;
|
|
858
|
-
const key = `$$${e.type}`;
|
|
859
|
-
const oriTarget = e.target;
|
|
860
|
-
const oriCurrentTarget = e.currentTarget;
|
|
861
|
-
const retarget = value =>
|
|
862
|
-
Object.defineProperty(e, "target", {
|
|
863
|
-
configurable: true,
|
|
864
|
-
value
|
|
865
|
-
});
|
|
866
|
-
const handleNode = () => {
|
|
867
|
-
const handler = node[key];
|
|
868
|
-
if (handler && !node.disabled) {
|
|
869
|
-
const data = node[`${key}Data`];
|
|
870
|
-
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
871
|
-
if (e.cancelBubble) return;
|
|
872
|
-
}
|
|
873
|
-
node.host &&
|
|
874
|
-
typeof node.host !== "string" &&
|
|
875
|
-
!node.host._$host &&
|
|
876
|
-
node.contains(e.target) &&
|
|
877
|
-
retarget(node.host);
|
|
878
|
-
return true;
|
|
879
|
-
};
|
|
880
|
-
const walkUpTree = () => {
|
|
881
|
-
while (handleNode() && (node = node._$host || node.parentNode || node.host));
|
|
882
|
-
};
|
|
883
|
-
Object.defineProperty(e, "currentTarget", {
|
|
884
|
-
configurable: true,
|
|
885
|
-
get() {
|
|
886
|
-
return node || document;
|
|
887
|
-
}
|
|
888
|
-
});
|
|
889
|
-
if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;
|
|
890
|
-
if (e.composedPath) {
|
|
891
|
-
const path = e.composedPath();
|
|
892
|
-
retarget(path[0]);
|
|
893
|
-
for (let i = 0; i < path.length - 2; i++) {
|
|
894
|
-
node = path[i];
|
|
895
|
-
if (!handleNode()) break;
|
|
896
|
-
if (node._$host) {
|
|
897
|
-
node = node._$host;
|
|
898
|
-
walkUpTree();
|
|
899
|
-
break;
|
|
900
|
-
}
|
|
901
|
-
if (node.parentNode === oriCurrentTarget) {
|
|
902
|
-
break;
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
} else walkUpTree();
|
|
906
|
-
retarget(oriTarget);
|
|
907
|
-
}
|
|
908
|
-
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
909
|
-
const hydrating = isHydrating(parent);
|
|
910
|
-
if (hydrating) {
|
|
911
|
-
!current && (current = [...parent.childNodes]);
|
|
912
|
-
let cleaned = [];
|
|
913
|
-
for (let i = 0; i < current.length; i++) {
|
|
914
|
-
const node = current[i];
|
|
915
|
-
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
|
|
916
|
-
else cleaned.push(node);
|
|
917
|
-
}
|
|
918
|
-
current = cleaned;
|
|
919
|
-
}
|
|
920
|
-
while (typeof current === "function") current = current();
|
|
921
|
-
if (value === current) return current;
|
|
922
|
-
const t = typeof value,
|
|
923
|
-
multi = marker !== undefined;
|
|
924
|
-
parent = (multi && current[0] && current[0].parentNode) || parent;
|
|
925
|
-
if (t === "string" || t === "number") {
|
|
926
|
-
if (hydrating) return current;
|
|
927
|
-
if (t === "number") {
|
|
928
|
-
value = value.toString();
|
|
929
|
-
if (value === current) return current;
|
|
930
|
-
}
|
|
931
|
-
if (multi) {
|
|
932
|
-
let node = current[0];
|
|
933
|
-
if (node && node.nodeType === 3) {
|
|
934
|
-
node.data !== value && (node.data = value);
|
|
935
|
-
} else node = document.createTextNode(value);
|
|
936
|
-
current = cleanChildren(parent, current, marker, node);
|
|
937
|
-
} else {
|
|
938
|
-
if (current !== "" && typeof current === "string") {
|
|
939
|
-
current = parent.firstChild.data = value;
|
|
940
|
-
} else current = parent.textContent = value;
|
|
941
|
-
}
|
|
942
|
-
} else if (value == null || t === "boolean") {
|
|
943
|
-
if (hydrating) return current;
|
|
944
|
-
current = cleanChildren(parent, current, marker);
|
|
945
|
-
} else if (t === "function") {
|
|
946
|
-
createRenderEffect(() => {
|
|
947
|
-
let v = value();
|
|
948
|
-
while (typeof v === "function") v = v();
|
|
949
|
-
current = insertExpression(parent, v, current, marker);
|
|
950
|
-
});
|
|
951
|
-
return () => current;
|
|
952
|
-
} else if (Array.isArray(value)) {
|
|
953
|
-
const array = [];
|
|
954
|
-
const currentArray = current && Array.isArray(current);
|
|
955
|
-
if (normalizeIncomingArray(array, value, current, unwrapArray)) {
|
|
956
|
-
createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));
|
|
957
|
-
return () => current;
|
|
958
|
-
}
|
|
959
|
-
if (hydrating) {
|
|
960
|
-
if (!array.length) return current;
|
|
961
|
-
if (marker === undefined) return (current = [...parent.childNodes]);
|
|
962
|
-
let node = array[0];
|
|
963
|
-
if (node.parentNode !== parent) return current;
|
|
964
|
-
const nodes = [node];
|
|
965
|
-
while ((node = node.nextSibling) !== marker) nodes.push(node);
|
|
966
|
-
return (current = nodes);
|
|
967
|
-
}
|
|
968
|
-
if (array.length === 0) {
|
|
969
|
-
current = cleanChildren(parent, current, marker);
|
|
970
|
-
if (multi) return current;
|
|
971
|
-
} else if (currentArray) {
|
|
972
|
-
if (current.length === 0) {
|
|
973
|
-
appendNodes(parent, array, marker);
|
|
974
|
-
} else reconcileArrays(parent, current, array);
|
|
975
|
-
} else {
|
|
976
|
-
current && cleanChildren(parent);
|
|
977
|
-
appendNodes(parent, array);
|
|
978
|
-
}
|
|
979
|
-
current = array;
|
|
980
|
-
} else if (value.nodeType) {
|
|
981
|
-
if (hydrating && value.parentNode) return (current = multi ? [value] : value);
|
|
982
|
-
if (Array.isArray(current)) {
|
|
983
|
-
if (multi) return (current = cleanChildren(parent, current, marker, value));
|
|
984
|
-
cleanChildren(parent, current, null, value);
|
|
985
|
-
} else if (current == null || current === "" || !parent.firstChild) {
|
|
986
|
-
parent.appendChild(value);
|
|
987
|
-
} else parent.replaceChild(value, parent.firstChild);
|
|
988
|
-
current = value;
|
|
989
|
-
} else;
|
|
990
|
-
return current;
|
|
991
|
-
}
|
|
992
|
-
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
993
|
-
let dynamic = false;
|
|
994
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
995
|
-
let item = array[i],
|
|
996
|
-
prev = current && current[normalized.length],
|
|
997
|
-
t;
|
|
998
|
-
if (item == null || item === true || item === false);
|
|
999
|
-
else if ((t = typeof item) === "object" && item.nodeType) {
|
|
1000
|
-
normalized.push(item);
|
|
1001
|
-
} else if (Array.isArray(item)) {
|
|
1002
|
-
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
1003
|
-
} else if (t === "function") {
|
|
1004
|
-
if (unwrap) {
|
|
1005
|
-
while (typeof item === "function") item = item();
|
|
1006
|
-
dynamic =
|
|
1007
|
-
normalizeIncomingArray(
|
|
1008
|
-
normalized,
|
|
1009
|
-
Array.isArray(item) ? item : [item],
|
|
1010
|
-
Array.isArray(prev) ? prev : [prev]
|
|
1011
|
-
) || dynamic;
|
|
1012
|
-
} else {
|
|
1013
|
-
normalized.push(item);
|
|
1014
|
-
dynamic = true;
|
|
1015
|
-
}
|
|
1016
|
-
} else {
|
|
1017
|
-
const value = String(item);
|
|
1018
|
-
if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
|
|
1019
|
-
else normalized.push(document.createTextNode(value));
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
return dynamic;
|
|
1023
|
-
}
|
|
1024
|
-
function appendNodes(parent, array, marker = null) {
|
|
1025
|
-
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
1026
|
-
}
|
|
1027
|
-
function cleanChildren(parent, current, marker, replacement) {
|
|
1028
|
-
if (marker === undefined) return (parent.textContent = "");
|
|
1029
|
-
const node = replacement || document.createTextNode("");
|
|
1030
|
-
if (current.length) {
|
|
1031
|
-
let inserted = false;
|
|
1032
|
-
for (let i = current.length - 1; i >= 0; i--) {
|
|
1033
|
-
const el = current[i];
|
|
1034
|
-
if (node !== el) {
|
|
1035
|
-
const isParent = el.parentNode === parent;
|
|
1036
|
-
if (!inserted && !i)
|
|
1037
|
-
isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
1038
|
-
else isParent && el.remove();
|
|
1039
|
-
} else inserted = true;
|
|
1040
|
-
}
|
|
1041
|
-
} else parent.insertBefore(node, marker);
|
|
1042
|
-
return [node];
|
|
1043
|
-
}
|
|
1044
|
-
function gatherHydratable(element, root) {
|
|
1045
|
-
const templates = element.querySelectorAll(`*[data-hk]`);
|
|
1046
|
-
for (let i = 0; i < templates.length; i++) {
|
|
1047
|
-
const node = templates[i];
|
|
1048
|
-
const key = node.getAttribute("data-hk");
|
|
1049
|
-
if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))
|
|
1050
|
-
sharedConfig.registry.set(key, node);
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
function getHydrationKey() {
|
|
1054
|
-
return sharedConfig.getNextContextId();
|
|
1055
|
-
}
|
|
1056
|
-
function NoHydration(props) {
|
|
1057
|
-
return sharedConfig.context ? undefined : props.children;
|
|
1058
|
-
}
|
|
1059
|
-
function Hydration(props) {
|
|
1060
|
-
return props.children;
|
|
1061
|
-
}
|
|
1062
|
-
const voidFn = () => undefined;
|
|
1063
|
-
const RequestContext = Symbol();
|
|
1064
|
-
function innerHTML(parent, content) {
|
|
1065
|
-
!sharedConfig.context && (parent.innerHTML = content);
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
function throwInBrowser(func) {
|
|
1069
|
-
const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
|
|
1070
|
-
console.error(err);
|
|
1071
|
-
}
|
|
1072
|
-
function renderToString(fn, options) {
|
|
1073
|
-
throwInBrowser(renderToString);
|
|
1074
|
-
}
|
|
1075
|
-
function renderToStringAsync(fn, options) {
|
|
1076
|
-
throwInBrowser(renderToStringAsync);
|
|
1077
|
-
}
|
|
1078
|
-
function renderToStream(fn, options) {
|
|
1079
|
-
throwInBrowser(renderToStream);
|
|
1080
|
-
}
|
|
1081
|
-
function ssr(template, ...nodes) {}
|
|
1082
|
-
function ssrElement(name, props, children, needsId) {}
|
|
1083
|
-
function ssrClassList(value) {}
|
|
1084
|
-
function ssrStyle(value) {}
|
|
1085
|
-
function ssrAttribute(key, value) {}
|
|
1086
|
-
function ssrHydrationKey() {}
|
|
1087
|
-
function resolveSSRNode(node) {}
|
|
1088
|
-
function escape(html) {}
|
|
1089
|
-
function ssrSpread(props, isSVG, skipChildren) {}
|
|
1090
|
-
|
|
1091
|
-
const isServer = false;
|
|
1092
|
-
const isDev = false;
|
|
1093
|
-
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
1094
|
-
function createElement(tagName, isSVG = false) {
|
|
1095
|
-
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);
|
|
1096
|
-
}
|
|
1097
|
-
const hydrate = (...args) => {
|
|
1098
|
-
enableHydration();
|
|
1099
|
-
return hydrate$1(...args);
|
|
1100
|
-
};
|
|
1101
|
-
function Portal(props) {
|
|
1102
|
-
const { useShadow } = props,
|
|
1103
|
-
marker = document.createTextNode(""),
|
|
1104
|
-
mount = () => props.mount || document.body,
|
|
1105
|
-
owner = getOwner();
|
|
1106
|
-
let content;
|
|
1107
|
-
let hydrating = !!sharedConfig.context;
|
|
1108
|
-
createEffect(
|
|
1109
|
-
() => {
|
|
1110
|
-
if (hydrating) getOwner().user = hydrating = false;
|
|
1111
|
-
content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
|
|
1112
|
-
const el = mount();
|
|
1113
|
-
if (el instanceof HTMLHeadElement) {
|
|
1114
|
-
const [clean, setClean] = createSignal(false);
|
|
1115
|
-
const cleanup = () => setClean(true);
|
|
1116
|
-
createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));
|
|
1117
|
-
onCleanup(cleanup);
|
|
1118
|
-
} else {
|
|
1119
|
-
const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
|
|
1120
|
-
renderRoot =
|
|
1121
|
-
useShadow && container.attachShadow
|
|
1122
|
-
? container.attachShadow({
|
|
1123
|
-
mode: "open"
|
|
1124
|
-
})
|
|
1125
|
-
: container;
|
|
1126
|
-
Object.defineProperty(container, "_$host", {
|
|
1127
|
-
get() {
|
|
1128
|
-
return marker.parentNode;
|
|
1129
|
-
},
|
|
1130
|
-
configurable: true
|
|
1131
|
-
});
|
|
1132
|
-
insert(renderRoot, content);
|
|
1133
|
-
el.appendChild(container);
|
|
1134
|
-
props.ref && props.ref(container);
|
|
1135
|
-
onCleanup(() => el.removeChild(container));
|
|
1136
|
-
}
|
|
1137
|
-
},
|
|
1138
|
-
undefined,
|
|
1139
|
-
{
|
|
1140
|
-
render: !hydrating
|
|
1141
|
-
}
|
|
1142
|
-
);
|
|
1143
|
-
return marker;
|
|
1144
|
-
}
|
|
1145
|
-
function Dynamic(props) {
|
|
1146
|
-
const [p, others] = splitProps(props, ["component"]);
|
|
1147
|
-
const cached = createMemo(() => p.component);
|
|
1148
|
-
return createMemo(() => {
|
|
1149
|
-
const component = cached();
|
|
1150
|
-
switch (typeof component) {
|
|
1151
|
-
case "function":
|
|
1152
|
-
return untrack(() => component(others));
|
|
1153
|
-
case "string":
|
|
1154
|
-
const isSvg = SVGElements.has(component);
|
|
1155
|
-
const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);
|
|
1156
|
-
spread(el, others, isSvg);
|
|
1157
|
-
return el;
|
|
1158
|
-
}
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
export {
|
|
1163
|
-
Aliases,
|
|
1164
|
-
voidFn as Assets,
|
|
1165
|
-
ChildProperties,
|
|
1166
|
-
DOMElements,
|
|
1167
|
-
DelegatedEvents,
|
|
1168
|
-
Dynamic,
|
|
1169
|
-
Hydration,
|
|
1170
|
-
voidFn as HydrationScript,
|
|
1171
|
-
NoHydration,
|
|
1172
|
-
Portal,
|
|
1173
|
-
Properties,
|
|
1174
|
-
RequestContext,
|
|
1175
|
-
SVGElements,
|
|
1176
|
-
SVGNamespace,
|
|
1177
|
-
addEventListener,
|
|
1178
|
-
assign,
|
|
1179
|
-
classList,
|
|
1180
|
-
className,
|
|
1181
|
-
clearDelegatedEvents,
|
|
1182
|
-
delegateEvents,
|
|
1183
|
-
dynamicProperty,
|
|
1184
|
-
escape,
|
|
1185
|
-
voidFn as generateHydrationScript,
|
|
1186
|
-
voidFn as getAssets,
|
|
1187
|
-
getHydrationKey,
|
|
1188
|
-
getNextElement,
|
|
1189
|
-
getNextMarker,
|
|
1190
|
-
getNextMatch,
|
|
1191
|
-
getPropAlias,
|
|
1192
|
-
voidFn as getRequestEvent,
|
|
1193
|
-
hydrate,
|
|
1194
|
-
innerHTML,
|
|
1195
|
-
insert,
|
|
1196
|
-
isDev,
|
|
1197
|
-
isServer,
|
|
1198
|
-
render,
|
|
1199
|
-
renderToStream,
|
|
1200
|
-
renderToString,
|
|
1201
|
-
renderToStringAsync,
|
|
1202
|
-
resolveSSRNode,
|
|
1203
|
-
runHydrationEvents,
|
|
1204
|
-
setAttribute,
|
|
1205
|
-
setAttributeNS,
|
|
1206
|
-
setBoolAttribute,
|
|
1207
|
-
setProperty,
|
|
1208
|
-
spread,
|
|
1209
|
-
ssr,
|
|
1210
|
-
ssrAttribute,
|
|
1211
|
-
ssrClassList,
|
|
1212
|
-
ssrElement,
|
|
1213
|
-
ssrHydrationKey,
|
|
1214
|
-
ssrSpread,
|
|
1215
|
-
ssrStyle,
|
|
1216
|
-
style,
|
|
1217
|
-
template,
|
|
1218
|
-
use,
|
|
1219
|
-
voidFn as useAssets
|
|
1220
|
-
};
|