solid-js 1.9.0 → 1.9.2

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 (50) hide show
  1. package/README.md +1 -1
  2. package/dist/dev.cjs +1 -1
  3. package/dist/dev.js +318 -559
  4. package/dist/server.js +74 -168
  5. package/dist/solid.cjs +1 -1
  6. package/dist/solid.js +276 -486
  7. package/h/dist/h.js +9 -40
  8. package/h/jsx-runtime/dist/jsx.js +1 -1
  9. package/h/jsx-runtime/types/index.d.ts +8 -11
  10. package/h/jsx-runtime/types/jsx.d.ts +196 -59
  11. package/h/types/hyperscript.d.ts +11 -11
  12. package/html/dist/html.cjs +1 -1
  13. package/html/dist/html.js +94 -219
  14. package/html/types/lit.d.ts +33 -52
  15. package/package.json +1 -1
  16. package/store/dist/dev.js +43 -123
  17. package/store/dist/server.js +8 -20
  18. package/store/dist/store.js +40 -114
  19. package/store/types/index.d.ts +7 -21
  20. package/store/types/modifiers.d.ts +3 -6
  21. package/store/types/mutable.d.ts +2 -5
  22. package/store/types/server.d.ts +5 -25
  23. package/store/types/store.d.ts +61 -218
  24. package/types/index.d.ts +10 -75
  25. package/types/jsx.d.ts +195 -47
  26. package/types/reactive/array.d.ts +4 -12
  27. package/types/reactive/observable.d.ts +17 -25
  28. package/types/reactive/scheduler.d.ts +6 -9
  29. package/types/reactive/signal.d.ts +142 -233
  30. package/types/render/Suspense.d.ts +5 -5
  31. package/types/render/component.d.ts +42 -73
  32. package/types/render/flow.d.ts +31 -43
  33. package/types/render/hydration.d.ts +15 -15
  34. package/types/server/index.d.ts +2 -57
  35. package/types/server/reactive.d.ts +42 -73
  36. package/types/server/rendering.d.ts +98 -169
  37. package/universal/dist/dev.js +12 -28
  38. package/universal/dist/universal.js +12 -28
  39. package/universal/types/index.d.ts +1 -3
  40. package/universal/types/universal.d.ts +1 -0
  41. package/web/dist/dev.cjs +15 -15
  42. package/web/dist/dev.js +89 -635
  43. package/web/dist/server.cjs +14 -14
  44. package/web/dist/server.js +108 -635
  45. package/web/dist/web.cjs +15 -15
  46. package/web/dist/web.js +87 -623
  47. package/web/storage/dist/storage.js +3 -3
  48. package/web/types/core.d.ts +1 -10
  49. package/web/types/index.d.ts +10 -27
  50. package/web/types/server-mock.d.ts +32 -47
package/web/dist/dev.js CHANGED
@@ -1,83 +1,14 @@
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
- $DEVCOMP
15
- } from "solid-js";
16
- export {
17
- ErrorBoundary,
18
- For,
19
- Index,
20
- Match,
21
- Show,
22
- Suspense,
23
- SuspenseList,
24
- Switch,
25
- createComponent,
26
- createRenderEffect as effect,
27
- getOwner,
28
- createMemo as memo,
29
- mergeProps,
30
- untrack
31
- } from "solid-js";
1
+ import { createRoot, createRenderEffect, untrack, sharedConfig, enableHydration, getOwner, createEffect, runWithOwner, createMemo, createSignal, onCleanup, splitProps, $DEVCOMP } from 'solid-js';
2
+ export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, createMemo as memo, mergeProps, untrack } from 'solid-js';
32
3
 
33
- const booleans = [
34
- "allowfullscreen",
35
- "async",
36
- "autofocus",
37
- "autoplay",
38
- "checked",
39
- "controls",
40
- "default",
41
- "disabled",
42
- "formnovalidate",
43
- "hidden",
44
- "indeterminate",
45
- "inert",
46
- "ismap",
47
- "loop",
48
- "multiple",
49
- "muted",
50
- "nomodule",
51
- "novalidate",
52
- "open",
53
- "playsinline",
54
- "readonly",
55
- "required",
56
- "reversed",
57
- "seamless",
58
- "selected"
59
- ];
60
- const Properties = /*#__PURE__*/ new Set([
61
- "className",
62
- "value",
63
- "readOnly",
64
- "formNoValidate",
65
- "isMap",
66
- "noModule",
67
- "playsInline",
68
- ...booleans
69
- ]);
70
- const ChildProperties = /*#__PURE__*/ new Set([
71
- "innerHTML",
72
- "textContent",
73
- "innerText",
74
- "children"
75
- ]);
76
- 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", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
6
+ const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
7
+ const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
77
8
  className: "class",
78
9
  htmlFor: "for"
79
10
  });
80
- const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
11
+ const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
81
12
  class: "className",
82
13
  formnovalidate: {
83
14
  $: "formNoValidate",
@@ -104,396 +35,19 @@ const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
104
35
  });
105
36
  function getPropAlias(prop, tagName) {
106
37
  const a = PropAliases[prop];
107
- return typeof a === "object" ? (a[tagName] ? a["$"] : undefined) : a;
108
- }
109
- const DelegatedEvents = /*#__PURE__*/ new Set([
110
- "beforeinput",
111
- "click",
112
- "dblclick",
113
- "contextmenu",
114
- "focusin",
115
- "focusout",
116
- "input",
117
- "keydown",
118
- "keyup",
119
- "mousedown",
120
- "mousemove",
121
- "mouseout",
122
- "mouseover",
123
- "mouseup",
124
- "pointerdown",
125
- "pointermove",
126
- "pointerout",
127
- "pointerover",
128
- "pointerup",
129
- "touchend",
130
- "touchmove",
131
- "touchstart"
132
- ]);
133
- const SVGElements = /*#__PURE__*/ new Set([
134
- "altGlyph",
135
- "altGlyphDef",
136
- "altGlyphItem",
137
- "animate",
138
- "animateColor",
139
- "animateMotion",
140
- "animateTransform",
141
- "circle",
142
- "clipPath",
143
- "color-profile",
144
- "cursor",
145
- "defs",
146
- "desc",
147
- "ellipse",
148
- "feBlend",
149
- "feColorMatrix",
150
- "feComponentTransfer",
151
- "feComposite",
152
- "feConvolveMatrix",
153
- "feDiffuseLighting",
154
- "feDisplacementMap",
155
- "feDistantLight",
156
- "feDropShadow",
157
- "feFlood",
158
- "feFuncA",
159
- "feFuncB",
160
- "feFuncG",
161
- "feFuncR",
162
- "feGaussianBlur",
163
- "feImage",
164
- "feMerge",
165
- "feMergeNode",
166
- "feMorphology",
167
- "feOffset",
168
- "fePointLight",
169
- "feSpecularLighting",
170
- "feSpotLight",
171
- "feTile",
172
- "feTurbulence",
173
- "filter",
174
- "font",
175
- "font-face",
176
- "font-face-format",
177
- "font-face-name",
178
- "font-face-src",
179
- "font-face-uri",
180
- "foreignObject",
181
- "g",
182
- "glyph",
183
- "glyphRef",
184
- "hkern",
185
- "image",
186
- "line",
187
- "linearGradient",
188
- "marker",
189
- "mask",
190
- "metadata",
191
- "missing-glyph",
192
- "mpath",
193
- "path",
194
- "pattern",
195
- "polygon",
196
- "polyline",
197
- "radialGradient",
198
- "rect",
199
- "set",
200
- "stop",
201
- "svg",
202
- "switch",
203
- "symbol",
204
- "text",
205
- "textPath",
206
- "tref",
207
- "tspan",
208
- "use",
209
- "view",
210
- "vkern"
211
- ]);
38
+ return typeof a === "object" ? a[tagName] ? a["$"] : undefined : a;
39
+ }
40
+ 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"]);
41
+ const SVGElements = /*#__PURE__*/new Set([
42
+ "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",
43
+ "set", "stop",
44
+ "svg", "switch", "symbol", "text", "textPath",
45
+ "tref", "tspan", "use", "view", "vkern"]);
212
46
  const SVGNamespace = {
213
47
  xlink: "http://www.w3.org/1999/xlink",
214
48
  xml: "http://www.w3.org/XML/1998/namespace"
215
49
  };
216
- const DOMElements = /*#__PURE__*/ new Set([
217
- "html",
218
- "base",
219
- "head",
220
- "link",
221
- "meta",
222
- "style",
223
- "title",
224
- "body",
225
- "address",
226
- "article",
227
- "aside",
228
- "footer",
229
- "header",
230
- "main",
231
- "nav",
232
- "section",
233
- "body",
234
- "blockquote",
235
- "dd",
236
- "div",
237
- "dl",
238
- "dt",
239
- "figcaption",
240
- "figure",
241
- "hr",
242
- "li",
243
- "ol",
244
- "p",
245
- "pre",
246
- "ul",
247
- "a",
248
- "abbr",
249
- "b",
250
- "bdi",
251
- "bdo",
252
- "br",
253
- "cite",
254
- "code",
255
- "data",
256
- "dfn",
257
- "em",
258
- "i",
259
- "kbd",
260
- "mark",
261
- "q",
262
- "rp",
263
- "rt",
264
- "ruby",
265
- "s",
266
- "samp",
267
- "small",
268
- "span",
269
- "strong",
270
- "sub",
271
- "sup",
272
- "time",
273
- "u",
274
- "var",
275
- "wbr",
276
- "area",
277
- "audio",
278
- "img",
279
- "map",
280
- "track",
281
- "video",
282
- "embed",
283
- "iframe",
284
- "object",
285
- "param",
286
- "picture",
287
- "portal",
288
- "source",
289
- "svg",
290
- "math",
291
- "canvas",
292
- "noscript",
293
- "script",
294
- "del",
295
- "ins",
296
- "caption",
297
- "col",
298
- "colgroup",
299
- "table",
300
- "tbody",
301
- "td",
302
- "tfoot",
303
- "th",
304
- "thead",
305
- "tr",
306
- "button",
307
- "datalist",
308
- "fieldset",
309
- "form",
310
- "input",
311
- "label",
312
- "legend",
313
- "meter",
314
- "optgroup",
315
- "option",
316
- "output",
317
- "progress",
318
- "select",
319
- "textarea",
320
- "details",
321
- "dialog",
322
- "menu",
323
- "summary",
324
- "details",
325
- "slot",
326
- "template",
327
- "acronym",
328
- "applet",
329
- "basefont",
330
- "bgsound",
331
- "big",
332
- "blink",
333
- "center",
334
- "content",
335
- "dir",
336
- "font",
337
- "frame",
338
- "frameset",
339
- "hgroup",
340
- "image",
341
- "keygen",
342
- "marquee",
343
- "menuitem",
344
- "nobr",
345
- "noembed",
346
- "noframes",
347
- "plaintext",
348
- "rb",
349
- "rtc",
350
- "shadow",
351
- "spacer",
352
- "strike",
353
- "tt",
354
- "xmp",
355
- "a",
356
- "abbr",
357
- "acronym",
358
- "address",
359
- "applet",
360
- "area",
361
- "article",
362
- "aside",
363
- "audio",
364
- "b",
365
- "base",
366
- "basefont",
367
- "bdi",
368
- "bdo",
369
- "bgsound",
370
- "big",
371
- "blink",
372
- "blockquote",
373
- "body",
374
- "br",
375
- "button",
376
- "canvas",
377
- "caption",
378
- "center",
379
- "cite",
380
- "code",
381
- "col",
382
- "colgroup",
383
- "content",
384
- "data",
385
- "datalist",
386
- "dd",
387
- "del",
388
- "details",
389
- "dfn",
390
- "dialog",
391
- "dir",
392
- "div",
393
- "dl",
394
- "dt",
395
- "em",
396
- "embed",
397
- "fieldset",
398
- "figcaption",
399
- "figure",
400
- "font",
401
- "footer",
402
- "form",
403
- "frame",
404
- "frameset",
405
- "head",
406
- "header",
407
- "hgroup",
408
- "hr",
409
- "html",
410
- "i",
411
- "iframe",
412
- "image",
413
- "img",
414
- "input",
415
- "ins",
416
- "kbd",
417
- "keygen",
418
- "label",
419
- "legend",
420
- "li",
421
- "link",
422
- "main",
423
- "map",
424
- "mark",
425
- "marquee",
426
- "menu",
427
- "menuitem",
428
- "meta",
429
- "meter",
430
- "nav",
431
- "nobr",
432
- "noembed",
433
- "noframes",
434
- "noscript",
435
- "object",
436
- "ol",
437
- "optgroup",
438
- "option",
439
- "output",
440
- "p",
441
- "param",
442
- "picture",
443
- "plaintext",
444
- "portal",
445
- "pre",
446
- "progress",
447
- "q",
448
- "rb",
449
- "rp",
450
- "rt",
451
- "rtc",
452
- "ruby",
453
- "s",
454
- "samp",
455
- "script",
456
- "section",
457
- "select",
458
- "shadow",
459
- "slot",
460
- "small",
461
- "source",
462
- "spacer",
463
- "span",
464
- "strike",
465
- "strong",
466
- "style",
467
- "sub",
468
- "summary",
469
- "sup",
470
- "table",
471
- "tbody",
472
- "td",
473
- "template",
474
- "textarea",
475
- "tfoot",
476
- "th",
477
- "thead",
478
- "time",
479
- "title",
480
- "tr",
481
- "track",
482
- "tt",
483
- "u",
484
- "ul",
485
- "var",
486
- "video",
487
- "wbr",
488
- "xmp",
489
- "input",
490
- "h1",
491
- "h2",
492
- "h3",
493
- "h4",
494
- "h5",
495
- "h6"
496
- ]);
50
+ 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"]);
497
51
 
498
52
  function reconcileArrays(parentNode, a, b) {
499
53
  let bLength = b.length,
@@ -514,7 +68,7 @@ function reconcileArrays(parentNode, a, b) {
514
68
  bEnd--;
515
69
  }
516
70
  if (aEnd === aStart) {
517
- const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;
71
+ const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
518
72
  while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
519
73
  } else if (bEnd === bStart) {
520
74
  while (aStart < aEnd) {
@@ -555,16 +109,12 @@ function reconcileArrays(parentNode, a, b) {
555
109
  const $$EVENTS = "_$DX_DELEGATE";
556
110
  function render(code, element, init, options = {}) {
557
111
  if (!element) {
558
- throw new Error(
559
- "The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document."
560
- );
112
+ throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
561
113
  }
562
114
  let disposer;
563
115
  createRoot(dispose => {
564
116
  disposer = dispose;
565
- element === document
566
- ? code()
567
- : insert(element, code(), element.firstChild ? null : undefined, init);
117
+ element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
568
118
  }, options.owner);
569
119
  return () => {
570
120
  disposer();
@@ -574,17 +124,12 @@ function render(code, element, init, options = {}) {
574
124
  function template(html, isImportNode, isSVG) {
575
125
  let node;
576
126
  const create = () => {
577
- if (isHydrating())
578
- throw new Error(
579
- "Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration."
580
- );
127
+ if (isHydrating()) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
581
128
  const t = document.createElement("template");
582
129
  t.innerHTML = html;
583
130
  return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
584
131
  };
585
- const fn = isImportNode
586
- ? () => untrack(() => document.importNode(node || (node = create()), true))
587
- : () => (node || (node = create())).cloneNode(true);
132
+ const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
588
133
  fn.cloneNode = fn;
589
134
  return fn;
590
135
  }
@@ -610,13 +155,11 @@ function setProperty(node, name, value) {
610
155
  }
611
156
  function setAttribute(node, name, value) {
612
157
  if (isHydrating(node)) return;
613
- if (value == null) node.removeAttribute(name);
614
- else node.setAttribute(name, value);
158
+ if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
615
159
  }
616
160
  function setAttributeNS(node, namespace, name, value) {
617
161
  if (isHydrating(node)) return;
618
- if (value == null) node.removeAttributeNS(namespace, name);
619
- else node.setAttributeNS(namespace, name, value);
162
+ if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
620
163
  }
621
164
  function setBoolAttribute(node, name, value) {
622
165
  if (isHydrating(node)) return;
@@ -624,8 +167,7 @@ function setBoolAttribute(node, name, value) {
624
167
  }
625
168
  function className(node, value) {
626
169
  if (isHydrating(node)) return;
627
- if (value == null) node.removeAttribute("class");
628
- else node.className = value;
170
+ if (value == null) node.removeAttribute("class");else node.className = value;
629
171
  }
630
172
  function addEventListener(node, name, handler, delegate) {
631
173
  if (delegate) {
@@ -635,7 +177,7 @@ function addEventListener(node, name, handler, delegate) {
635
177
  } else node[`$$${name}`] = handler;
636
178
  } else if (Array.isArray(handler)) {
637
179
  const handlerFn = handler[0];
638
- node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));
180
+ node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
639
181
  } else node.addEventListener(name, handler, typeof handler !== "function" && handler);
640
182
  }
641
183
  function classList(node, value, prev = {}) {
@@ -660,7 +202,7 @@ function classList(node, value, prev = {}) {
660
202
  function style(node, value, prev) {
661
203
  if (!value) return prev ? setAttribute(node, "style") : value;
662
204
  const nodeStyle = node.style;
663
- if (typeof value === "string") return (nodeStyle.cssText = value);
205
+ if (typeof value === "string") return nodeStyle.cssText = value;
664
206
  typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
665
207
  prev || (prev = {});
666
208
  value || (value = {});
@@ -681,9 +223,7 @@ function style(node, value, prev) {
681
223
  function spread(node, props = {}, isSVG, skipChildren) {
682
224
  const prevProps = {};
683
225
  if (!skipChildren) {
684
- createRenderEffect(
685
- () => (prevProps.children = insertExpression(node, props.children, prevProps.children))
686
- );
226
+ createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
687
227
  }
688
228
  createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
689
229
  createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
@@ -747,14 +287,10 @@ function getNextElement(template) {
747
287
  let node,
748
288
  key,
749
289
  hydrating = isHydrating();
750
- if (!hydrating || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {
290
+ if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
751
291
  if (hydrating) {
752
292
  sharedConfig.done = true;
753
- throw new Error(
754
- `Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}\n${
755
- template ? template().outerHTML : ""
756
- }`
757
- );
293
+ throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}\n${template ? template().outerHTML : ""}`);
758
294
  }
759
295
  return template();
760
296
  }
@@ -774,8 +310,7 @@ function getNextMarker(start) {
774
310
  while (end) {
775
311
  if (end.nodeType === 8) {
776
312
  const v = end.nodeValue;
777
- if (v === "$") count++;
778
- else if (v === "/") {
313
+ if (v === "$") count++;else if (v === "/") {
779
314
  if (count === 0) return [end, current];
780
315
  count--;
781
316
  }
@@ -789,7 +324,10 @@ function getNextMarker(start) {
789
324
  function runHydrationEvents() {
790
325
  if (sharedConfig.events && !sharedConfig.events.queued) {
791
326
  queueMicrotask(() => {
792
- const { completed, events } = sharedConfig;
327
+ const {
328
+ completed,
329
+ events
330
+ } = sharedConfig;
793
331
  if (!events) return;
794
332
  events.queued = false;
795
333
  while (events.length) {
@@ -814,8 +352,7 @@ function toPropertyName(name) {
814
352
  }
815
353
  function toggleClassKey(node, key, value) {
816
354
  const classNames = key.trim().split(/\s+/);
817
- for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
818
- node.classList.toggle(classNames[i], value);
355
+ for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
819
356
  }
820
357
  function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
821
358
  let isCE, isProp, isChildProp, propAlias, forceProp;
@@ -847,24 +384,15 @@ function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
847
384
  setAttribute(node, prop.slice(5), value);
848
385
  } else if (prop.slice(0, 5) === "bool:") {
849
386
  setBoolAttribute(node, prop.slice(5), value);
850
- } else if (
851
- (forceProp = prop.slice(0, 5) === "prop:") ||
852
- (isChildProp = ChildProperties.has(prop)) ||
853
- (!isSVG &&
854
- ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||
855
- (isCE = node.nodeName.includes("-") || "is" in props)
856
- ) {
387
+ } 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)) {
857
388
  if (forceProp) {
858
389
  prop = prop.slice(5);
859
390
  isProp = true;
860
391
  } else if (isHydrating(node)) return value;
861
- if (prop === "class" || prop === "className") className(node, value);
862
- else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
863
- else node[propAlias || prop] = value;
392
+ if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[propAlias || prop] = value;
864
393
  } else {
865
394
  const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
866
- if (ns) setAttributeNS(node, ns, prop, value);
867
- else setAttribute(node, Aliases[prop] || prop, value);
395
+ if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, Aliases[prop] || prop, value);
868
396
  }
869
397
  return value;
870
398
  }
@@ -876,11 +404,10 @@ function eventHandler(e) {
876
404
  const key = `$$${e.type}`;
877
405
  const oriTarget = e.target;
878
406
  const oriCurrentTarget = e.currentTarget;
879
- const retarget = value =>
880
- Object.defineProperty(e, "target", {
881
- configurable: true,
882
- value
883
- });
407
+ const retarget = value => Object.defineProperty(e, "target", {
408
+ configurable: true,
409
+ value
410
+ });
884
411
  const handleNode = () => {
885
412
  const handler = node[key];
886
413
  if (handler && !node.disabled) {
@@ -888,7 +415,7 @@ function eventHandler(e) {
888
415
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
889
416
  if (e.cancelBubble) return;
890
417
  }
891
- node.host && node.contains(e.target) && !node.host._$host && retarget(node.host);
418
+ node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
892
419
  return true;
893
420
  };
894
421
  const walkUpTree = () => {
@@ -916,7 +443,8 @@ function eventHandler(e) {
916
443
  break;
917
444
  }
918
445
  }
919
- } else walkUpTree();
446
+ }
447
+ else walkUpTree();
920
448
  retarget(oriTarget);
921
449
  }
922
450
  function insertExpression(parent, value, current, marker, unwrapArray) {
@@ -926,8 +454,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
926
454
  let cleaned = [];
927
455
  for (let i = 0; i < current.length; i++) {
928
456
  const node = current[i];
929
- if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
930
- else cleaned.push(node);
457
+ if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();else cleaned.push(node);
931
458
  }
932
459
  current = cleaned;
933
460
  }
@@ -935,7 +462,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
935
462
  if (value === current) return current;
936
463
  const t = typeof value,
937
464
  multi = marker !== undefined;
938
- parent = (multi && current[0] && current[0].parentNode) || parent;
465
+ parent = multi && current[0] && current[0].parentNode || parent;
939
466
  if (t === "string" || t === "number") {
940
467
  if (hydrating) return current;
941
468
  if (t === "number") {
@@ -967,17 +494,17 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
967
494
  const array = [];
968
495
  const currentArray = current && Array.isArray(current);
969
496
  if (normalizeIncomingArray(array, value, current, unwrapArray)) {
970
- createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));
497
+ createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
971
498
  return () => current;
972
499
  }
973
500
  if (hydrating) {
974
501
  if (!array.length) return current;
975
- if (marker === undefined) return (current = [...parent.childNodes]);
502
+ if (marker === undefined) return current = [...parent.childNodes];
976
503
  let node = array[0];
977
504
  if (node.parentNode !== parent) return current;
978
505
  const nodes = [node];
979
506
  while ((node = node.nextSibling) !== marker) nodes.push(node);
980
- return (current = nodes);
507
+ return current = nodes;
981
508
  }
982
509
  if (array.length === 0) {
983
510
  current = cleanChildren(parent, current, marker);
@@ -992,9 +519,9 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
992
519
  }
993
520
  current = array;
994
521
  } else if (value.nodeType) {
995
- if (hydrating && value.parentNode) return (current = multi ? [value] : value);
522
+ if (hydrating && value.parentNode) return current = multi ? [value] : value;
996
523
  if (Array.isArray(current)) {
997
- if (multi) return (current = cleanChildren(parent, current, marker, value));
524
+ if (multi) return current = cleanChildren(parent, current, marker, value);
998
525
  cleanChildren(parent, current, null, value);
999
526
  } else if (current == null || current === "" || !parent.firstChild) {
1000
527
  parent.appendChild(value);
@@ -1009,28 +536,21 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
1009
536
  let item = array[i],
1010
537
  prev = current && current[normalized.length],
1011
538
  t;
1012
- if (item == null || item === true || item === false);
1013
- else if ((t = typeof item) === "object" && item.nodeType) {
539
+ if (item == null || item === true || item === false) ; else if ((t = typeof item) === "object" && item.nodeType) {
1014
540
  normalized.push(item);
1015
541
  } else if (Array.isArray(item)) {
1016
542
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
1017
543
  } else if (t === "function") {
1018
544
  if (unwrap) {
1019
545
  while (typeof item === "function") item = item();
1020
- dynamic =
1021
- normalizeIncomingArray(
1022
- normalized,
1023
- Array.isArray(item) ? item : [item],
1024
- Array.isArray(prev) ? prev : [prev]
1025
- ) || dynamic;
546
+ dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
1026
547
  } else {
1027
548
  normalized.push(item);
1028
549
  dynamic = true;
1029
550
  }
1030
551
  } else {
1031
552
  const value = String(item);
1032
- if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
1033
- else normalized.push(document.createTextNode(value));
553
+ if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value));
1034
554
  }
1035
555
  }
1036
556
  return dynamic;
@@ -1039,7 +559,7 @@ function appendNodes(parent, array, marker = null) {
1039
559
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
1040
560
  }
1041
561
  function cleanChildren(parent, current, marker, replacement) {
1042
- if (marker === undefined) return (parent.textContent = "");
562
+ if (marker === undefined) return parent.textContent = "";
1043
563
  const node = replacement || document.createTextNode("");
1044
564
  if (current.length) {
1045
565
  let inserted = false;
@@ -1047,9 +567,7 @@ function cleanChildren(parent, current, marker, replacement) {
1047
567
  const el = current[i];
1048
568
  if (node !== el) {
1049
569
  const isParent = el.parentNode === parent;
1050
- if (!inserted && !i)
1051
- isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
1052
- else isParent && el.remove();
570
+ if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
1053
571
  } else inserted = true;
1054
572
  }
1055
573
  } else parent.insertBefore(node, marker);
@@ -1060,8 +578,7 @@ function gatherHydratable(element, root) {
1060
578
  for (let i = 0; i < templates.length; i++) {
1061
579
  const node = templates[i];
1062
580
  const key = node.getAttribute("data-hk");
1063
- if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))
1064
- sharedConfig.registry.set(key, node);
581
+ if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key)) sharedConfig.registry.set(key, node);
1065
582
  }
1066
583
  }
1067
584
  function getHydrationKey() {
@@ -1113,47 +630,42 @@ const hydrate = (...args) => {
1113
630
  return hydrate$1(...args);
1114
631
  };
1115
632
  function Portal(props) {
1116
- const { useShadow } = props,
633
+ const {
634
+ useShadow
635
+ } = props,
1117
636
  marker = document.createTextNode(""),
1118
637
  mount = () => props.mount || document.body,
1119
638
  owner = getOwner();
1120
639
  let content;
1121
640
  let hydrating = !!sharedConfig.context;
1122
- createEffect(
1123
- () => {
1124
- if (hydrating) getOwner().user = hydrating = false;
1125
- content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
1126
- const el = mount();
1127
- if (el instanceof HTMLHeadElement) {
1128
- const [clean, setClean] = createSignal(false);
1129
- const cleanup = () => setClean(true);
1130
- createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));
1131
- onCleanup(cleanup);
1132
- } else {
1133
- const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
1134
- renderRoot =
1135
- useShadow && container.attachShadow
1136
- ? container.attachShadow({
1137
- mode: "open"
1138
- })
1139
- : container;
1140
- Object.defineProperty(container, "_$host", {
1141
- get() {
1142
- return marker.parentNode;
1143
- },
1144
- configurable: true
1145
- });
1146
- insert(renderRoot, content);
1147
- el.appendChild(container);
1148
- props.ref && props.ref(container);
1149
- onCleanup(() => el.removeChild(container));
1150
- }
1151
- },
1152
- undefined,
1153
- {
1154
- render: !hydrating
641
+ createEffect(() => {
642
+ if (hydrating) getOwner().user = hydrating = false;
643
+ content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
644
+ const el = mount();
645
+ if (el instanceof HTMLHeadElement) {
646
+ const [clean, setClean] = createSignal(false);
647
+ const cleanup = () => setClean(true);
648
+ createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null));
649
+ onCleanup(cleanup);
650
+ } else {
651
+ const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
652
+ renderRoot = useShadow && container.attachShadow ? container.attachShadow({
653
+ mode: "open"
654
+ }) : container;
655
+ Object.defineProperty(container, "_$host", {
656
+ get() {
657
+ return marker.parentNode;
658
+ },
659
+ configurable: true
660
+ });
661
+ insert(renderRoot, content);
662
+ el.appendChild(container);
663
+ props.ref && props.ref(container);
664
+ onCleanup(() => el.removeChild(container));
1155
665
  }
1156
- );
666
+ }, undefined, {
667
+ render: !hydrating
668
+ });
1157
669
  return marker;
1158
670
  }
1159
671
  function Dynamic(props) {
@@ -1176,62 +688,4 @@ function Dynamic(props) {
1176
688
  });
1177
689
  }
1178
690
 
1179
- export {
1180
- Aliases,
1181
- voidFn as Assets,
1182
- ChildProperties,
1183
- DOMElements,
1184
- DelegatedEvents,
1185
- Dynamic,
1186
- Hydration,
1187
- voidFn as HydrationScript,
1188
- NoHydration,
1189
- Portal,
1190
- Properties,
1191
- RequestContext,
1192
- SVGElements,
1193
- SVGNamespace,
1194
- addEventListener,
1195
- assign,
1196
- classList,
1197
- className,
1198
- clearDelegatedEvents,
1199
- delegateEvents,
1200
- dynamicProperty,
1201
- escape,
1202
- voidFn as generateHydrationScript,
1203
- voidFn as getAssets,
1204
- getHydrationKey,
1205
- getNextElement,
1206
- getNextMarker,
1207
- getNextMatch,
1208
- getPropAlias,
1209
- voidFn as getRequestEvent,
1210
- hydrate,
1211
- innerHTML,
1212
- insert,
1213
- isDev,
1214
- isServer,
1215
- render,
1216
- renderToStream,
1217
- renderToString,
1218
- renderToStringAsync,
1219
- resolveSSRNode,
1220
- runHydrationEvents,
1221
- setAttribute,
1222
- setAttributeNS,
1223
- setBoolAttribute,
1224
- setProperty,
1225
- spread,
1226
- ssr,
1227
- ssrAttribute,
1228
- ssrClassList,
1229
- ssrElement,
1230
- ssrHydrationKey,
1231
- ssrSpread,
1232
- ssrStyle,
1233
- style,
1234
- template,
1235
- use,
1236
- voidFn as useAssets
1237
- };
691
+ export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getPropAlias, voidFn as getRequestEvent, hydrate, innerHTML, insert, isDev, isServer, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setBoolAttribute, setProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets };