solid-js 1.9.5 → 1.9.7

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.
Files changed (51) hide show
  1. package/dist/dev.cjs +21 -10
  2. package/dist/dev.js +327 -557
  3. package/dist/server.js +81 -178
  4. package/dist/solid.cjs +21 -10
  5. package/dist/solid.js +283 -486
  6. package/h/dist/h.js +9 -40
  7. package/h/jsx-runtime/dist/jsx.js +1 -1
  8. package/h/jsx-runtime/types/index.d.ts +8 -11
  9. package/h/jsx-runtime/types/jsx.d.ts +2947 -1021
  10. package/h/types/hyperscript.d.ts +11 -11
  11. package/html/dist/html.cjs +2 -2
  12. package/html/dist/html.js +96 -221
  13. package/html/types/lit.d.ts +33 -52
  14. package/package.json +3 -3
  15. package/store/dist/dev.js +43 -123
  16. package/store/dist/server.js +8 -20
  17. package/store/dist/store.js +40 -114
  18. package/store/types/index.d.ts +7 -21
  19. package/store/types/modifiers.d.ts +3 -6
  20. package/store/types/mutable.d.ts +2 -5
  21. package/store/types/server.d.ts +5 -25
  22. package/store/types/store.d.ts +61 -218
  23. package/types/index.d.ts +11 -78
  24. package/types/jsx.d.ts +2091 -278
  25. package/types/reactive/array.d.ts +4 -12
  26. package/types/reactive/observable.d.ts +16 -22
  27. package/types/reactive/scheduler.d.ts +6 -9
  28. package/types/reactive/signal.d.ts +145 -236
  29. package/types/render/Suspense.d.ts +5 -5
  30. package/types/render/component.d.ts +37 -73
  31. package/types/render/flow.d.ts +31 -43
  32. package/types/render/hydration.d.ts +15 -15
  33. package/types/server/index.d.ts +2 -57
  34. package/types/server/reactive.d.ts +45 -76
  35. package/types/server/rendering.d.ts +98 -169
  36. package/universal/dist/dev.cjs +3 -1
  37. package/universal/dist/dev.js +15 -29
  38. package/universal/dist/universal.cjs +3 -1
  39. package/universal/dist/universal.js +15 -29
  40. package/universal/types/index.d.ts +1 -3
  41. package/universal/types/universal.d.ts +1 -0
  42. package/web/dist/dev.cjs +8 -5
  43. package/web/dist/dev.js +96 -643
  44. package/web/dist/server.cjs +9 -6
  45. package/web/dist/server.js +116 -646
  46. package/web/dist/web.cjs +8 -5
  47. package/web/dist/web.js +94 -631
  48. package/web/storage/dist/storage.js +3 -3
  49. package/web/types/core.d.ts +2 -10
  50. package/web/types/index.d.ts +11 -31
  51. package/web/types/server-mock.d.ts +32 -47
package/web/dist/web.js CHANGED
@@ -1,83 +1,19 @@
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";
1
+ import { createMemo, createRoot, createRenderEffect, untrack, sharedConfig, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps } from 'solid-js';
2
+ export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';
31
3
 
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), {
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(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
6
+ const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
7
+ const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
76
8
  className: "class",
77
9
  htmlFor: "for"
78
10
  });
79
- const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
11
+ const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
80
12
  class: "className",
13
+ novalidate: {
14
+ $: "noValidate",
15
+ FORM: 1
16
+ },
81
17
  formnovalidate: {
82
18
  $: "formNoValidate",
83
19
  BUTTON: 1,
@@ -103,396 +39,21 @@ const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
103
39
  });
104
40
  function getPropAlias(prop, tagName) {
105
41
  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
- ]);
42
+ return typeof a === "object" ? a[tagName] ? a["$"] : undefined : a;
43
+ }
44
+ 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"]);
45
+ const SVGElements = /*#__PURE__*/new Set([
46
+ "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",
47
+ "set", "stop",
48
+ "svg", "switch", "symbol", "text", "textPath",
49
+ "tref", "tspan", "use", "view", "vkern"]);
211
50
  const SVGNamespace = {
212
51
  xlink: "http://www.w3.org/1999/xlink",
213
52
  xml: "http://www.w3.org/XML/1998/namespace"
214
53
  };
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
- ]);
54
+ 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"]);
55
+
56
+ const memo = fn => createMemo(() => fn());
496
57
 
497
58
  function reconcileArrays(parentNode, a, b) {
498
59
  let bLength = b.length,
@@ -513,7 +74,7 @@ function reconcileArrays(parentNode, a, b) {
513
74
  bEnd--;
514
75
  }
515
76
  if (aEnd === aStart) {
516
- const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;
77
+ const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
517
78
  while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
518
79
  } else if (bEnd === bStart) {
519
80
  while (aStart < aEnd) {
@@ -556,9 +117,7 @@ function render(code, element, init, options = {}) {
556
117
  let disposer;
557
118
  createRoot(dispose => {
558
119
  disposer = dispose;
559
- element === document
560
- ? code()
561
- : insert(element, code(), element.firstChild ? null : undefined, init);
120
+ element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
562
121
  }, options.owner);
563
122
  return () => {
564
123
  disposer();
@@ -568,15 +127,11 @@ function render(code, element, init, options = {}) {
568
127
  function template(html, isImportNode, isSVG, isMathML) {
569
128
  let node;
570
129
  const create = () => {
571
- const t = isMathML
572
- ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template")
573
- : document.createElement("template");
130
+ const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
574
131
  t.innerHTML = html;
575
132
  return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
576
133
  };
577
- const fn = isImportNode
578
- ? () => untrack(() => document.importNode(node || (node = create()), true))
579
- : () => (node || (node = create())).cloneNode(true);
134
+ const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
580
135
  fn.cloneNode = fn;
581
136
  return fn;
582
137
  }
@@ -602,13 +157,11 @@ function setProperty(node, name, value) {
602
157
  }
603
158
  function setAttribute(node, name, value) {
604
159
  if (isHydrating(node)) return;
605
- if (value == null) node.removeAttribute(name);
606
- else node.setAttribute(name, value);
160
+ if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
607
161
  }
608
162
  function setAttributeNS(node, namespace, name, value) {
609
163
  if (isHydrating(node)) return;
610
- if (value == null) node.removeAttributeNS(namespace, name);
611
- else node.setAttributeNS(namespace, name, value);
164
+ if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
612
165
  }
613
166
  function setBoolAttribute(node, name, value) {
614
167
  if (isHydrating(node)) return;
@@ -616,8 +169,7 @@ function setBoolAttribute(node, name, value) {
616
169
  }
617
170
  function className(node, value) {
618
171
  if (isHydrating(node)) return;
619
- if (value == null) node.removeAttribute("class");
620
- else node.className = value;
172
+ if (value == null) node.removeAttribute("class");else node.className = value;
621
173
  }
622
174
  function addEventListener(node, name, handler, delegate) {
623
175
  if (delegate) {
@@ -627,7 +179,7 @@ function addEventListener(node, name, handler, delegate) {
627
179
  } else node[`$$${name}`] = handler;
628
180
  } else if (Array.isArray(handler)) {
629
181
  const handlerFn = handler[0];
630
- node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));
182
+ node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
631
183
  } else node.addEventListener(name, handler, typeof handler !== "function" && handler);
632
184
  }
633
185
  function classList(node, value, prev = {}) {
@@ -652,7 +204,7 @@ function classList(node, value, prev = {}) {
652
204
  function style(node, value, prev) {
653
205
  if (!value) return prev ? setAttribute(node, "style") : value;
654
206
  const nodeStyle = node.style;
655
- if (typeof value === "string") return (nodeStyle.cssText = value);
207
+ if (typeof value === "string") return nodeStyle.cssText = value;
656
208
  typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
657
209
  prev || (prev = {});
658
210
  value || (value = {});
@@ -673,9 +225,7 @@ function style(node, value, prev) {
673
225
  function spread(node, props = {}, isSVG, skipChildren) {
674
226
  const prevProps = {};
675
227
  if (!skipChildren) {
676
- createRenderEffect(
677
- () => (prevProps.children = insertExpression(node, props.children, prevProps.children))
678
- );
228
+ createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
679
229
  }
680
230
  createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
681
231
  createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
@@ -739,7 +289,7 @@ function getNextElement(template) {
739
289
  let node,
740
290
  key,
741
291
  hydrating = isHydrating();
742
- if (!hydrating || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {
292
+ if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
743
293
  return template();
744
294
  }
745
295
  if (sharedConfig.completed) sharedConfig.completed.add(node);
@@ -758,8 +308,7 @@ function getNextMarker(start) {
758
308
  while (end) {
759
309
  if (end.nodeType === 8) {
760
310
  const v = end.nodeValue;
761
- if (v === "$") count++;
762
- else if (v === "/") {
311
+ if (v === "$") count++;else if (v === "/") {
763
312
  if (count === 0) return [end, current];
764
313
  count--;
765
314
  }
@@ -773,7 +322,10 @@ function getNextMarker(start) {
773
322
  function runHydrationEvents() {
774
323
  if (sharedConfig.events && !sharedConfig.events.queued) {
775
324
  queueMicrotask(() => {
776
- const { completed, events } = sharedConfig;
325
+ const {
326
+ completed,
327
+ events
328
+ } = sharedConfig;
777
329
  if (!events) return;
778
330
  events.queued = false;
779
331
  while (events.length) {
@@ -798,8 +350,7 @@ function toPropertyName(name) {
798
350
  }
799
351
  function toggleClassKey(node, key, value) {
800
352
  const classNames = key.trim().split(/\s+/);
801
- for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
802
- node.classList.toggle(classNames[i], value);
353
+ for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
803
354
  }
804
355
  function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
805
356
  let isCE, isProp, isChildProp, propAlias, forceProp;
@@ -831,24 +382,15 @@ function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
831
382
  setAttribute(node, prop.slice(5), value);
832
383
  } else if (prop.slice(0, 5) === "bool:") {
833
384
  setBoolAttribute(node, prop.slice(5), value);
834
- } else if (
835
- (forceProp = prop.slice(0, 5) === "prop:") ||
836
- (isChildProp = ChildProperties.has(prop)) ||
837
- (!isSVG &&
838
- ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||
839
- (isCE = node.nodeName.includes("-") || "is" in props)
840
- ) {
385
+ } else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) {
841
386
  if (forceProp) {
842
387
  prop = prop.slice(5);
843
388
  isProp = true;
844
389
  } else if (isHydrating(node)) return value;
845
- if (prop === "class" || prop === "className") className(node, value);
846
- else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
847
- else node[propAlias || prop] = value;
390
+ if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[propAlias || prop] = value;
848
391
  } else {
849
392
  const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
850
- if (ns) setAttributeNS(node, ns, prop, value);
851
- else setAttribute(node, Aliases[prop] || prop, value);
393
+ if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, Aliases[prop] || prop, value);
852
394
  }
853
395
  return value;
854
396
  }
@@ -860,11 +402,10 @@ function eventHandler(e) {
860
402
  const key = `$$${e.type}`;
861
403
  const oriTarget = e.target;
862
404
  const oriCurrentTarget = e.currentTarget;
863
- const retarget = value =>
864
- Object.defineProperty(e, "target", {
865
- configurable: true,
866
- value
867
- });
405
+ const retarget = value => Object.defineProperty(e, "target", {
406
+ configurable: true,
407
+ value
408
+ });
868
409
  const handleNode = () => {
869
410
  const handler = node[key];
870
411
  if (handler && !node.disabled) {
@@ -872,11 +413,7 @@ function eventHandler(e) {
872
413
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
873
414
  if (e.cancelBubble) return;
874
415
  }
875
- node.host &&
876
- typeof node.host !== "string" &&
877
- !node.host._$host &&
878
- node.contains(e.target) &&
879
- retarget(node.host);
416
+ node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
880
417
  return true;
881
418
  };
882
419
  const walkUpTree = () => {
@@ -904,7 +441,8 @@ function eventHandler(e) {
904
441
  break;
905
442
  }
906
443
  }
907
- } else walkUpTree();
444
+ }
445
+ else walkUpTree();
908
446
  retarget(oriTarget);
909
447
  }
910
448
  function insertExpression(parent, value, current, marker, unwrapArray) {
@@ -914,8 +452,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
914
452
  let cleaned = [];
915
453
  for (let i = 0; i < current.length; i++) {
916
454
  const node = current[i];
917
- if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
918
- else cleaned.push(node);
455
+ if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();else cleaned.push(node);
919
456
  }
920
457
  current = cleaned;
921
458
  }
@@ -923,7 +460,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
923
460
  if (value === current) return current;
924
461
  const t = typeof value,
925
462
  multi = marker !== undefined;
926
- parent = (multi && current[0] && current[0].parentNode) || parent;
463
+ parent = multi && current[0] && current[0].parentNode || parent;
927
464
  if (t === "string" || t === "number") {
928
465
  if (hydrating) return current;
929
466
  if (t === "number") {
@@ -955,17 +492,17 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
955
492
  const array = [];
956
493
  const currentArray = current && Array.isArray(current);
957
494
  if (normalizeIncomingArray(array, value, current, unwrapArray)) {
958
- createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));
495
+ createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
959
496
  return () => current;
960
497
  }
961
498
  if (hydrating) {
962
499
  if (!array.length) return current;
963
- if (marker === undefined) return (current = [...parent.childNodes]);
500
+ if (marker === undefined) return current = [...parent.childNodes];
964
501
  let node = array[0];
965
502
  if (node.parentNode !== parent) return current;
966
503
  const nodes = [node];
967
504
  while ((node = node.nextSibling) !== marker) nodes.push(node);
968
- return (current = nodes);
505
+ return current = nodes;
969
506
  }
970
507
  if (array.length === 0) {
971
508
  current = cleanChildren(parent, current, marker);
@@ -980,15 +517,15 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
980
517
  }
981
518
  current = array;
982
519
  } else if (value.nodeType) {
983
- if (hydrating && value.parentNode) return (current = multi ? [value] : value);
520
+ if (hydrating && value.parentNode) return current = multi ? [value] : value;
984
521
  if (Array.isArray(current)) {
985
- if (multi) return (current = cleanChildren(parent, current, marker, value));
522
+ if (multi) return current = cleanChildren(parent, current, marker, value);
986
523
  cleanChildren(parent, current, null, value);
987
524
  } else if (current == null || current === "" || !parent.firstChild) {
988
525
  parent.appendChild(value);
989
526
  } else parent.replaceChild(value, parent.firstChild);
990
527
  current = value;
991
- } else;
528
+ } else ;
992
529
  return current;
993
530
  }
994
531
  function normalizeIncomingArray(normalized, array, current, unwrap) {
@@ -997,28 +534,21 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
997
534
  let item = array[i],
998
535
  prev = current && current[normalized.length],
999
536
  t;
1000
- if (item == null || item === true || item === false);
1001
- else if ((t = typeof item) === "object" && item.nodeType) {
537
+ if (item == null || item === true || item === false) ; else if ((t = typeof item) === "object" && item.nodeType) {
1002
538
  normalized.push(item);
1003
539
  } else if (Array.isArray(item)) {
1004
540
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
1005
541
  } else if (t === "function") {
1006
542
  if (unwrap) {
1007
543
  while (typeof item === "function") item = item();
1008
- dynamic =
1009
- normalizeIncomingArray(
1010
- normalized,
1011
- Array.isArray(item) ? item : [item],
1012
- Array.isArray(prev) ? prev : [prev]
1013
- ) || dynamic;
544
+ dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
1014
545
  } else {
1015
546
  normalized.push(item);
1016
547
  dynamic = true;
1017
548
  }
1018
549
  } else {
1019
550
  const value = String(item);
1020
- if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
1021
- else normalized.push(document.createTextNode(value));
551
+ if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value));
1022
552
  }
1023
553
  }
1024
554
  return dynamic;
@@ -1027,7 +557,7 @@ function appendNodes(parent, array, marker = null) {
1027
557
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
1028
558
  }
1029
559
  function cleanChildren(parent, current, marker, replacement) {
1030
- if (marker === undefined) return (parent.textContent = "");
560
+ if (marker === undefined) return parent.textContent = "";
1031
561
  const node = replacement || document.createTextNode("");
1032
562
  if (current.length) {
1033
563
  let inserted = false;
@@ -1035,9 +565,7 @@ function cleanChildren(parent, current, marker, replacement) {
1035
565
  const el = current[i];
1036
566
  if (node !== el) {
1037
567
  const isParent = el.parentNode === parent;
1038
- if (!inserted && !i)
1039
- isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
1040
- else isParent && el.remove();
568
+ if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
1041
569
  } else inserted = true;
1042
570
  }
1043
571
  } else parent.insertBefore(node, marker);
@@ -1048,8 +576,7 @@ function gatherHydratable(element, root) {
1048
576
  for (let i = 0; i < templates.length; i++) {
1049
577
  const node = templates[i];
1050
578
  const key = node.getAttribute("data-hk");
1051
- if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))
1052
- sharedConfig.registry.set(key, node);
579
+ if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key)) sharedConfig.registry.set(key, node);
1053
580
  }
1054
581
  }
1055
582
  function getHydrationKey() {
@@ -1101,47 +628,42 @@ const hydrate = (...args) => {
1101
628
  return hydrate$1(...args);
1102
629
  };
1103
630
  function Portal(props) {
1104
- const { useShadow } = props,
631
+ const {
632
+ useShadow
633
+ } = props,
1105
634
  marker = document.createTextNode(""),
1106
635
  mount = () => props.mount || document.body,
1107
636
  owner = getOwner();
1108
637
  let content;
1109
638
  let hydrating = !!sharedConfig.context;
1110
- createEffect(
1111
- () => {
1112
- if (hydrating) getOwner().user = hydrating = false;
1113
- content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
1114
- const el = mount();
1115
- if (el instanceof HTMLHeadElement) {
1116
- const [clean, setClean] = createSignal(false);
1117
- const cleanup = () => setClean(true);
1118
- createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));
1119
- onCleanup(cleanup);
1120
- } else {
1121
- const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
1122
- renderRoot =
1123
- useShadow && container.attachShadow
1124
- ? container.attachShadow({
1125
- mode: "open"
1126
- })
1127
- : container;
1128
- Object.defineProperty(container, "_$host", {
1129
- get() {
1130
- return marker.parentNode;
1131
- },
1132
- configurable: true
1133
- });
1134
- insert(renderRoot, content);
1135
- el.appendChild(container);
1136
- props.ref && props.ref(container);
1137
- onCleanup(() => el.removeChild(container));
1138
- }
1139
- },
1140
- undefined,
1141
- {
1142
- render: !hydrating
639
+ createEffect(() => {
640
+ if (hydrating) getOwner().user = hydrating = false;
641
+ content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
642
+ const el = mount();
643
+ if (el instanceof HTMLHeadElement) {
644
+ const [clean, setClean] = createSignal(false);
645
+ const cleanup = () => setClean(true);
646
+ createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null));
647
+ onCleanup(cleanup);
648
+ } else {
649
+ const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
650
+ renderRoot = useShadow && container.attachShadow ? container.attachShadow({
651
+ mode: "open"
652
+ }) : container;
653
+ Object.defineProperty(container, "_$host", {
654
+ get() {
655
+ return marker.parentNode;
656
+ },
657
+ configurable: true
658
+ });
659
+ insert(renderRoot, content);
660
+ el.appendChild(container);
661
+ props.ref && props.ref(container);
662
+ onCleanup(() => el.removeChild(container));
1143
663
  }
1144
- );
664
+ }, undefined, {
665
+ render: !hydrating
666
+ });
1145
667
  return marker;
1146
668
  }
1147
669
  function createDynamic(component, props) {
@@ -1164,63 +686,4 @@ function Dynamic(props) {
1164
686
  return createDynamic(() => props.component, others);
1165
687
  }
1166
688
 
1167
- export {
1168
- Aliases,
1169
- voidFn as Assets,
1170
- ChildProperties,
1171
- DOMElements,
1172
- DelegatedEvents,
1173
- Dynamic,
1174
- Hydration,
1175
- voidFn as HydrationScript,
1176
- NoHydration,
1177
- Portal,
1178
- Properties,
1179
- RequestContext,
1180
- SVGElements,
1181
- SVGNamespace,
1182
- addEventListener,
1183
- assign,
1184
- classList,
1185
- className,
1186
- clearDelegatedEvents,
1187
- createDynamic,
1188
- delegateEvents,
1189
- dynamicProperty,
1190
- escape,
1191
- voidFn as generateHydrationScript,
1192
- voidFn as getAssets,
1193
- getHydrationKey,
1194
- getNextElement,
1195
- getNextMarker,
1196
- getNextMatch,
1197
- getPropAlias,
1198
- voidFn as getRequestEvent,
1199
- hydrate,
1200
- innerHTML,
1201
- insert,
1202
- isDev,
1203
- isServer,
1204
- render,
1205
- renderToStream,
1206
- renderToString,
1207
- renderToStringAsync,
1208
- resolveSSRNode,
1209
- runHydrationEvents,
1210
- setAttribute,
1211
- setAttributeNS,
1212
- setBoolAttribute,
1213
- setProperty,
1214
- spread,
1215
- ssr,
1216
- ssrAttribute,
1217
- ssrClassList,
1218
- ssrElement,
1219
- ssrHydrationKey,
1220
- ssrSpread,
1221
- ssrStyle,
1222
- style,
1223
- template,
1224
- use,
1225
- voidFn as useAssets
1226
- };
689
+ export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, createDynamic, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getPropAlias, voidFn as getRequestEvent, hydrate, innerHTML, insert, isDev, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setBoolAttribute, setProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets };