solid-js 1.9.6 → 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 (44) hide show
  1. package/dist/dev.cjs +18 -8
  2. package/dist/dev.js +326 -557
  3. package/dist/server.js +81 -178
  4. package/dist/solid.cjs +18 -8
  5. package/dist/solid.js +282 -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/types/hyperscript.d.ts +11 -11
  10. package/html/dist/html.js +94 -219
  11. package/html/types/lit.d.ts +33 -52
  12. package/package.json +3 -3
  13. package/store/dist/dev.js +43 -123
  14. package/store/dist/server.js +8 -20
  15. package/store/dist/store.js +40 -114
  16. package/store/types/index.d.ts +7 -21
  17. package/store/types/modifiers.d.ts +3 -6
  18. package/store/types/mutable.d.ts +2 -5
  19. package/store/types/server.d.ts +5 -25
  20. package/store/types/store.d.ts +61 -218
  21. package/types/index.d.ts +11 -78
  22. package/types/reactive/array.d.ts +4 -12
  23. package/types/reactive/observable.d.ts +16 -22
  24. package/types/reactive/scheduler.d.ts +6 -9
  25. package/types/reactive/signal.d.ts +145 -236
  26. package/types/render/Suspense.d.ts +5 -5
  27. package/types/render/component.d.ts +37 -73
  28. package/types/render/flow.d.ts +31 -43
  29. package/types/render/hydration.d.ts +15 -15
  30. package/types/server/index.d.ts +2 -57
  31. package/types/server/reactive.d.ts +45 -76
  32. package/types/server/rendering.d.ts +98 -169
  33. package/universal/dist/dev.js +12 -28
  34. package/universal/dist/universal.js +12 -28
  35. package/universal/types/index.d.ts +1 -3
  36. package/universal/types/universal.d.ts +1 -0
  37. package/web/dist/dev.js +90 -644
  38. package/web/dist/server.cjs +1 -1
  39. package/web/dist/server.js +110 -647
  40. package/web/dist/web.js +88 -632
  41. package/web/storage/dist/storage.js +3 -3
  42. package/web/types/core.d.ts +1 -9
  43. package/web/types/index.d.ts +11 -31
  44. package/web/types/server-mock.d.ts +32 -47
package/web/dist/dev.js CHANGED
@@ -1,83 +1,14 @@
1
- import {
2
- createMemo,
3
- createRoot,
4
- createRenderEffect,
5
- untrack,
6
- sharedConfig,
7
- enableHydration,
8
- getOwner,
9
- createEffect,
10
- runWithOwner,
11
- createSignal,
12
- onCleanup,
13
- $DEVCOMP,
14
- splitProps
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
- mergeProps,
29
- untrack
30
- } from "solid-js";
1
+ import { createMemo, createRoot, createRenderEffect, untrack, sharedConfig, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, $DEVCOMP, 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
- "noValidate",
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", "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), {
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
  novalidate: {
83
14
  $: "noValidate",
@@ -108,396 +39,19 @@ const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
108
39
  });
109
40
  function getPropAlias(prop, tagName) {
110
41
  const a = PropAliases[prop];
111
- return typeof a === "object" ? (a[tagName] ? a["$"] : undefined) : a;
112
- }
113
- const DelegatedEvents = /*#__PURE__*/ new Set([
114
- "beforeinput",
115
- "click",
116
- "dblclick",
117
- "contextmenu",
118
- "focusin",
119
- "focusout",
120
- "input",
121
- "keydown",
122
- "keyup",
123
- "mousedown",
124
- "mousemove",
125
- "mouseout",
126
- "mouseover",
127
- "mouseup",
128
- "pointerdown",
129
- "pointermove",
130
- "pointerout",
131
- "pointerover",
132
- "pointerup",
133
- "touchend",
134
- "touchmove",
135
- "touchstart"
136
- ]);
137
- const SVGElements = /*#__PURE__*/ new Set([
138
- "altGlyph",
139
- "altGlyphDef",
140
- "altGlyphItem",
141
- "animate",
142
- "animateColor",
143
- "animateMotion",
144
- "animateTransform",
145
- "circle",
146
- "clipPath",
147
- "color-profile",
148
- "cursor",
149
- "defs",
150
- "desc",
151
- "ellipse",
152
- "feBlend",
153
- "feColorMatrix",
154
- "feComponentTransfer",
155
- "feComposite",
156
- "feConvolveMatrix",
157
- "feDiffuseLighting",
158
- "feDisplacementMap",
159
- "feDistantLight",
160
- "feDropShadow",
161
- "feFlood",
162
- "feFuncA",
163
- "feFuncB",
164
- "feFuncG",
165
- "feFuncR",
166
- "feGaussianBlur",
167
- "feImage",
168
- "feMerge",
169
- "feMergeNode",
170
- "feMorphology",
171
- "feOffset",
172
- "fePointLight",
173
- "feSpecularLighting",
174
- "feSpotLight",
175
- "feTile",
176
- "feTurbulence",
177
- "filter",
178
- "font",
179
- "font-face",
180
- "font-face-format",
181
- "font-face-name",
182
- "font-face-src",
183
- "font-face-uri",
184
- "foreignObject",
185
- "g",
186
- "glyph",
187
- "glyphRef",
188
- "hkern",
189
- "image",
190
- "line",
191
- "linearGradient",
192
- "marker",
193
- "mask",
194
- "metadata",
195
- "missing-glyph",
196
- "mpath",
197
- "path",
198
- "pattern",
199
- "polygon",
200
- "polyline",
201
- "radialGradient",
202
- "rect",
203
- "set",
204
- "stop",
205
- "svg",
206
- "switch",
207
- "symbol",
208
- "text",
209
- "textPath",
210
- "tref",
211
- "tspan",
212
- "use",
213
- "view",
214
- "vkern"
215
- ]);
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"]);
216
50
  const SVGNamespace = {
217
51
  xlink: "http://www.w3.org/1999/xlink",
218
52
  xml: "http://www.w3.org/XML/1998/namespace"
219
53
  };
220
- const DOMElements = /*#__PURE__*/ new Set([
221
- "html",
222
- "base",
223
- "head",
224
- "link",
225
- "meta",
226
- "style",
227
- "title",
228
- "body",
229
- "address",
230
- "article",
231
- "aside",
232
- "footer",
233
- "header",
234
- "main",
235
- "nav",
236
- "section",
237
- "body",
238
- "blockquote",
239
- "dd",
240
- "div",
241
- "dl",
242
- "dt",
243
- "figcaption",
244
- "figure",
245
- "hr",
246
- "li",
247
- "ol",
248
- "p",
249
- "pre",
250
- "ul",
251
- "a",
252
- "abbr",
253
- "b",
254
- "bdi",
255
- "bdo",
256
- "br",
257
- "cite",
258
- "code",
259
- "data",
260
- "dfn",
261
- "em",
262
- "i",
263
- "kbd",
264
- "mark",
265
- "q",
266
- "rp",
267
- "rt",
268
- "ruby",
269
- "s",
270
- "samp",
271
- "small",
272
- "span",
273
- "strong",
274
- "sub",
275
- "sup",
276
- "time",
277
- "u",
278
- "var",
279
- "wbr",
280
- "area",
281
- "audio",
282
- "img",
283
- "map",
284
- "track",
285
- "video",
286
- "embed",
287
- "iframe",
288
- "object",
289
- "param",
290
- "picture",
291
- "portal",
292
- "source",
293
- "svg",
294
- "math",
295
- "canvas",
296
- "noscript",
297
- "script",
298
- "del",
299
- "ins",
300
- "caption",
301
- "col",
302
- "colgroup",
303
- "table",
304
- "tbody",
305
- "td",
306
- "tfoot",
307
- "th",
308
- "thead",
309
- "tr",
310
- "button",
311
- "datalist",
312
- "fieldset",
313
- "form",
314
- "input",
315
- "label",
316
- "legend",
317
- "meter",
318
- "optgroup",
319
- "option",
320
- "output",
321
- "progress",
322
- "select",
323
- "textarea",
324
- "details",
325
- "dialog",
326
- "menu",
327
- "summary",
328
- "details",
329
- "slot",
330
- "template",
331
- "acronym",
332
- "applet",
333
- "basefont",
334
- "bgsound",
335
- "big",
336
- "blink",
337
- "center",
338
- "content",
339
- "dir",
340
- "font",
341
- "frame",
342
- "frameset",
343
- "hgroup",
344
- "image",
345
- "keygen",
346
- "marquee",
347
- "menuitem",
348
- "nobr",
349
- "noembed",
350
- "noframes",
351
- "plaintext",
352
- "rb",
353
- "rtc",
354
- "shadow",
355
- "spacer",
356
- "strike",
357
- "tt",
358
- "xmp",
359
- "a",
360
- "abbr",
361
- "acronym",
362
- "address",
363
- "applet",
364
- "area",
365
- "article",
366
- "aside",
367
- "audio",
368
- "b",
369
- "base",
370
- "basefont",
371
- "bdi",
372
- "bdo",
373
- "bgsound",
374
- "big",
375
- "blink",
376
- "blockquote",
377
- "body",
378
- "br",
379
- "button",
380
- "canvas",
381
- "caption",
382
- "center",
383
- "cite",
384
- "code",
385
- "col",
386
- "colgroup",
387
- "content",
388
- "data",
389
- "datalist",
390
- "dd",
391
- "del",
392
- "details",
393
- "dfn",
394
- "dialog",
395
- "dir",
396
- "div",
397
- "dl",
398
- "dt",
399
- "em",
400
- "embed",
401
- "fieldset",
402
- "figcaption",
403
- "figure",
404
- "font",
405
- "footer",
406
- "form",
407
- "frame",
408
- "frameset",
409
- "head",
410
- "header",
411
- "hgroup",
412
- "hr",
413
- "html",
414
- "i",
415
- "iframe",
416
- "image",
417
- "img",
418
- "input",
419
- "ins",
420
- "kbd",
421
- "keygen",
422
- "label",
423
- "legend",
424
- "li",
425
- "link",
426
- "main",
427
- "map",
428
- "mark",
429
- "marquee",
430
- "menu",
431
- "menuitem",
432
- "meta",
433
- "meter",
434
- "nav",
435
- "nobr",
436
- "noembed",
437
- "noframes",
438
- "noscript",
439
- "object",
440
- "ol",
441
- "optgroup",
442
- "option",
443
- "output",
444
- "p",
445
- "param",
446
- "picture",
447
- "plaintext",
448
- "portal",
449
- "pre",
450
- "progress",
451
- "q",
452
- "rb",
453
- "rp",
454
- "rt",
455
- "rtc",
456
- "ruby",
457
- "s",
458
- "samp",
459
- "script",
460
- "section",
461
- "select",
462
- "shadow",
463
- "slot",
464
- "small",
465
- "source",
466
- "spacer",
467
- "span",
468
- "strike",
469
- "strong",
470
- "style",
471
- "sub",
472
- "summary",
473
- "sup",
474
- "table",
475
- "tbody",
476
- "td",
477
- "template",
478
- "textarea",
479
- "tfoot",
480
- "th",
481
- "thead",
482
- "time",
483
- "title",
484
- "tr",
485
- "track",
486
- "tt",
487
- "u",
488
- "ul",
489
- "var",
490
- "video",
491
- "wbr",
492
- "xmp",
493
- "input",
494
- "h1",
495
- "h2",
496
- "h3",
497
- "h4",
498
- "h5",
499
- "h6"
500
- ]);
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"]);
501
55
 
502
56
  const memo = fn => createMemo(() => fn());
503
57
 
@@ -520,7 +74,7 @@ function reconcileArrays(parentNode, a, b) {
520
74
  bEnd--;
521
75
  }
522
76
  if (aEnd === aStart) {
523
- 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;
524
78
  while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
525
79
  } else if (bEnd === bStart) {
526
80
  while (aStart < aEnd) {
@@ -561,16 +115,12 @@ function reconcileArrays(parentNode, a, b) {
561
115
  const $$EVENTS = "_$DX_DELEGATE";
562
116
  function render(code, element, init, options = {}) {
563
117
  if (!element) {
564
- throw new Error(
565
- "The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document."
566
- );
118
+ throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
567
119
  }
568
120
  let disposer;
569
121
  createRoot(dispose => {
570
122
  disposer = dispose;
571
- element === document
572
- ? code()
573
- : insert(element, code(), element.firstChild ? null : undefined, init);
123
+ element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
574
124
  }, options.owner);
575
125
  return () => {
576
126
  disposer();
@@ -580,19 +130,12 @@ function render(code, element, init, options = {}) {
580
130
  function template(html, isImportNode, isSVG, isMathML) {
581
131
  let node;
582
132
  const create = () => {
583
- if (isHydrating())
584
- throw new Error(
585
- "Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration."
586
- );
587
- const t = isMathML
588
- ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template")
589
- : document.createElement("template");
133
+ if (isHydrating()) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
134
+ const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
590
135
  t.innerHTML = html;
591
136
  return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
592
137
  };
593
- const fn = isImportNode
594
- ? () => untrack(() => document.importNode(node || (node = create()), true))
595
- : () => (node || (node = create())).cloneNode(true);
138
+ const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
596
139
  fn.cloneNode = fn;
597
140
  return fn;
598
141
  }
@@ -618,13 +161,11 @@ function setProperty(node, name, value) {
618
161
  }
619
162
  function setAttribute(node, name, value) {
620
163
  if (isHydrating(node)) return;
621
- if (value == null) node.removeAttribute(name);
622
- else node.setAttribute(name, value);
164
+ if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
623
165
  }
624
166
  function setAttributeNS(node, namespace, name, value) {
625
167
  if (isHydrating(node)) return;
626
- if (value == null) node.removeAttributeNS(namespace, name);
627
- else node.setAttributeNS(namespace, name, value);
168
+ if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
628
169
  }
629
170
  function setBoolAttribute(node, name, value) {
630
171
  if (isHydrating(node)) return;
@@ -632,8 +173,7 @@ function setBoolAttribute(node, name, value) {
632
173
  }
633
174
  function className(node, value) {
634
175
  if (isHydrating(node)) return;
635
- if (value == null) node.removeAttribute("class");
636
- else node.className = value;
176
+ if (value == null) node.removeAttribute("class");else node.className = value;
637
177
  }
638
178
  function addEventListener(node, name, handler, delegate) {
639
179
  if (delegate) {
@@ -643,7 +183,7 @@ function addEventListener(node, name, handler, delegate) {
643
183
  } else node[`$$${name}`] = handler;
644
184
  } else if (Array.isArray(handler)) {
645
185
  const handlerFn = handler[0];
646
- node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));
186
+ node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
647
187
  } else node.addEventListener(name, handler, typeof handler !== "function" && handler);
648
188
  }
649
189
  function classList(node, value, prev = {}) {
@@ -668,7 +208,7 @@ function classList(node, value, prev = {}) {
668
208
  function style(node, value, prev) {
669
209
  if (!value) return prev ? setAttribute(node, "style") : value;
670
210
  const nodeStyle = node.style;
671
- if (typeof value === "string") return (nodeStyle.cssText = value);
211
+ if (typeof value === "string") return nodeStyle.cssText = value;
672
212
  typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
673
213
  prev || (prev = {});
674
214
  value || (value = {});
@@ -689,9 +229,7 @@ function style(node, value, prev) {
689
229
  function spread(node, props = {}, isSVG, skipChildren) {
690
230
  const prevProps = {};
691
231
  if (!skipChildren) {
692
- createRenderEffect(
693
- () => (prevProps.children = insertExpression(node, props.children, prevProps.children))
694
- );
232
+ createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
695
233
  }
696
234
  createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
697
235
  createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
@@ -755,14 +293,10 @@ function getNextElement(template) {
755
293
  let node,
756
294
  key,
757
295
  hydrating = isHydrating();
758
- if (!hydrating || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {
296
+ if (!hydrating || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
759
297
  if (hydrating) {
760
298
  sharedConfig.done = true;
761
- throw new Error(
762
- `Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}\n${
763
- template ? template().outerHTML : ""
764
- }`
765
- );
299
+ throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}\n${template ? template().outerHTML : ""}`);
766
300
  }
767
301
  return template();
768
302
  }
@@ -782,8 +316,7 @@ function getNextMarker(start) {
782
316
  while (end) {
783
317
  if (end.nodeType === 8) {
784
318
  const v = end.nodeValue;
785
- if (v === "$") count++;
786
- else if (v === "/") {
319
+ if (v === "$") count++;else if (v === "/") {
787
320
  if (count === 0) return [end, current];
788
321
  count--;
789
322
  }
@@ -797,7 +330,10 @@ function getNextMarker(start) {
797
330
  function runHydrationEvents() {
798
331
  if (sharedConfig.events && !sharedConfig.events.queued) {
799
332
  queueMicrotask(() => {
800
- const { completed, events } = sharedConfig;
333
+ const {
334
+ completed,
335
+ events
336
+ } = sharedConfig;
801
337
  if (!events) return;
802
338
  events.queued = false;
803
339
  while (events.length) {
@@ -822,8 +358,7 @@ function toPropertyName(name) {
822
358
  }
823
359
  function toggleClassKey(node, key, value) {
824
360
  const classNames = key.trim().split(/\s+/);
825
- for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
826
- node.classList.toggle(classNames[i], value);
361
+ for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
827
362
  }
828
363
  function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
829
364
  let isCE, isProp, isChildProp, propAlias, forceProp;
@@ -855,24 +390,15 @@ function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
855
390
  setAttribute(node, prop.slice(5), value);
856
391
  } else if (prop.slice(0, 5) === "bool:") {
857
392
  setBoolAttribute(node, prop.slice(5), value);
858
- } else if (
859
- (forceProp = prop.slice(0, 5) === "prop:") ||
860
- (isChildProp = ChildProperties.has(prop)) ||
861
- (!isSVG &&
862
- ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||
863
- (isCE = node.nodeName.includes("-") || "is" in props)
864
- ) {
393
+ } 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)) {
865
394
  if (forceProp) {
866
395
  prop = prop.slice(5);
867
396
  isProp = true;
868
397
  } else if (isHydrating(node)) return value;
869
- if (prop === "class" || prop === "className") className(node, value);
870
- else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
871
- else node[propAlias || prop] = value;
398
+ if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[propAlias || prop] = value;
872
399
  } else {
873
400
  const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
874
- if (ns) setAttributeNS(node, ns, prop, value);
875
- else setAttribute(node, Aliases[prop] || prop, value);
401
+ if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, Aliases[prop] || prop, value);
876
402
  }
877
403
  return value;
878
404
  }
@@ -884,11 +410,10 @@ function eventHandler(e) {
884
410
  const key = `$$${e.type}`;
885
411
  const oriTarget = e.target;
886
412
  const oriCurrentTarget = e.currentTarget;
887
- const retarget = value =>
888
- Object.defineProperty(e, "target", {
889
- configurable: true,
890
- value
891
- });
413
+ const retarget = value => Object.defineProperty(e, "target", {
414
+ configurable: true,
415
+ value
416
+ });
892
417
  const handleNode = () => {
893
418
  const handler = node[key];
894
419
  if (handler && !node.disabled) {
@@ -896,11 +421,7 @@ function eventHandler(e) {
896
421
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
897
422
  if (e.cancelBubble) return;
898
423
  }
899
- node.host &&
900
- typeof node.host !== "string" &&
901
- !node.host._$host &&
902
- node.contains(e.target) &&
903
- retarget(node.host);
424
+ node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
904
425
  return true;
905
426
  };
906
427
  const walkUpTree = () => {
@@ -928,7 +449,8 @@ function eventHandler(e) {
928
449
  break;
929
450
  }
930
451
  }
931
- } else walkUpTree();
452
+ }
453
+ else walkUpTree();
932
454
  retarget(oriTarget);
933
455
  }
934
456
  function insertExpression(parent, value, current, marker, unwrapArray) {
@@ -938,8 +460,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
938
460
  let cleaned = [];
939
461
  for (let i = 0; i < current.length; i++) {
940
462
  const node = current[i];
941
- if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
942
- else cleaned.push(node);
463
+ if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();else cleaned.push(node);
943
464
  }
944
465
  current = cleaned;
945
466
  }
@@ -947,7 +468,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
947
468
  if (value === current) return current;
948
469
  const t = typeof value,
949
470
  multi = marker !== undefined;
950
- parent = (multi && current[0] && current[0].parentNode) || parent;
471
+ parent = multi && current[0] && current[0].parentNode || parent;
951
472
  if (t === "string" || t === "number") {
952
473
  if (hydrating) return current;
953
474
  if (t === "number") {
@@ -979,17 +500,17 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
979
500
  const array = [];
980
501
  const currentArray = current && Array.isArray(current);
981
502
  if (normalizeIncomingArray(array, value, current, unwrapArray)) {
982
- createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));
503
+ createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
983
504
  return () => current;
984
505
  }
985
506
  if (hydrating) {
986
507
  if (!array.length) return current;
987
- if (marker === undefined) return (current = [...parent.childNodes]);
508
+ if (marker === undefined) return current = [...parent.childNodes];
988
509
  let node = array[0];
989
510
  if (node.parentNode !== parent) return current;
990
511
  const nodes = [node];
991
512
  while ((node = node.nextSibling) !== marker) nodes.push(node);
992
- return (current = nodes);
513
+ return current = nodes;
993
514
  }
994
515
  if (array.length === 0) {
995
516
  current = cleanChildren(parent, current, marker);
@@ -1004,9 +525,9 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
1004
525
  }
1005
526
  current = array;
1006
527
  } else if (value.nodeType) {
1007
- if (hydrating && value.parentNode) return (current = multi ? [value] : value);
528
+ if (hydrating && value.parentNode) return current = multi ? [value] : value;
1008
529
  if (Array.isArray(current)) {
1009
- if (multi) return (current = cleanChildren(parent, current, marker, value));
530
+ if (multi) return current = cleanChildren(parent, current, marker, value);
1010
531
  cleanChildren(parent, current, null, value);
1011
532
  } else if (current == null || current === "" || !parent.firstChild) {
1012
533
  parent.appendChild(value);
@@ -1021,28 +542,21 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
1021
542
  let item = array[i],
1022
543
  prev = current && current[normalized.length],
1023
544
  t;
1024
- if (item == null || item === true || item === false);
1025
- else if ((t = typeof item) === "object" && item.nodeType) {
545
+ if (item == null || item === true || item === false) ; else if ((t = typeof item) === "object" && item.nodeType) {
1026
546
  normalized.push(item);
1027
547
  } else if (Array.isArray(item)) {
1028
548
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
1029
549
  } else if (t === "function") {
1030
550
  if (unwrap) {
1031
551
  while (typeof item === "function") item = item();
1032
- dynamic =
1033
- normalizeIncomingArray(
1034
- normalized,
1035
- Array.isArray(item) ? item : [item],
1036
- Array.isArray(prev) ? prev : [prev]
1037
- ) || dynamic;
552
+ dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
1038
553
  } else {
1039
554
  normalized.push(item);
1040
555
  dynamic = true;
1041
556
  }
1042
557
  } else {
1043
558
  const value = String(item);
1044
- if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
1045
- else normalized.push(document.createTextNode(value));
559
+ if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value));
1046
560
  }
1047
561
  }
1048
562
  return dynamic;
@@ -1051,7 +565,7 @@ function appendNodes(parent, array, marker = null) {
1051
565
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
1052
566
  }
1053
567
  function cleanChildren(parent, current, marker, replacement) {
1054
- if (marker === undefined) return (parent.textContent = "");
568
+ if (marker === undefined) return parent.textContent = "";
1055
569
  const node = replacement || document.createTextNode("");
1056
570
  if (current.length) {
1057
571
  let inserted = false;
@@ -1059,9 +573,7 @@ function cleanChildren(parent, current, marker, replacement) {
1059
573
  const el = current[i];
1060
574
  if (node !== el) {
1061
575
  const isParent = el.parentNode === parent;
1062
- if (!inserted && !i)
1063
- isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
1064
- else isParent && el.remove();
576
+ if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
1065
577
  } else inserted = true;
1066
578
  }
1067
579
  } else parent.insertBefore(node, marker);
@@ -1072,8 +584,7 @@ function gatherHydratable(element, root) {
1072
584
  for (let i = 0; i < templates.length; i++) {
1073
585
  const node = templates[i];
1074
586
  const key = node.getAttribute("data-hk");
1075
- if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))
1076
- sharedConfig.registry.set(key, node);
587
+ if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key)) sharedConfig.registry.set(key, node);
1077
588
  }
1078
589
  }
1079
590
  function getHydrationKey() {
@@ -1125,47 +636,42 @@ const hydrate = (...args) => {
1125
636
  return hydrate$1(...args);
1126
637
  };
1127
638
  function Portal(props) {
1128
- const { useShadow } = props,
639
+ const {
640
+ useShadow
641
+ } = props,
1129
642
  marker = document.createTextNode(""),
1130
643
  mount = () => props.mount || document.body,
1131
644
  owner = getOwner();
1132
645
  let content;
1133
646
  let hydrating = !!sharedConfig.context;
1134
- createEffect(
1135
- () => {
1136
- if (hydrating) getOwner().user = hydrating = false;
1137
- content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
1138
- const el = mount();
1139
- if (el instanceof HTMLHeadElement) {
1140
- const [clean, setClean] = createSignal(false);
1141
- const cleanup = () => setClean(true);
1142
- createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));
1143
- onCleanup(cleanup);
1144
- } else {
1145
- const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
1146
- renderRoot =
1147
- useShadow && container.attachShadow
1148
- ? container.attachShadow({
1149
- mode: "open"
1150
- })
1151
- : container;
1152
- Object.defineProperty(container, "_$host", {
1153
- get() {
1154
- return marker.parentNode;
1155
- },
1156
- configurable: true
1157
- });
1158
- insert(renderRoot, content);
1159
- el.appendChild(container);
1160
- props.ref && props.ref(container);
1161
- onCleanup(() => el.removeChild(container));
1162
- }
1163
- },
1164
- undefined,
1165
- {
1166
- render: !hydrating
647
+ createEffect(() => {
648
+ if (hydrating) getOwner().user = hydrating = false;
649
+ content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
650
+ const el = mount();
651
+ if (el instanceof HTMLHeadElement) {
652
+ const [clean, setClean] = createSignal(false);
653
+ const cleanup = () => setClean(true);
654
+ createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null));
655
+ onCleanup(cleanup);
656
+ } else {
657
+ const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
658
+ renderRoot = useShadow && container.attachShadow ? container.attachShadow({
659
+ mode: "open"
660
+ }) : container;
661
+ Object.defineProperty(container, "_$host", {
662
+ get() {
663
+ return marker.parentNode;
664
+ },
665
+ configurable: true
666
+ });
667
+ insert(renderRoot, content);
668
+ el.appendChild(container);
669
+ props.ref && props.ref(container);
670
+ onCleanup(() => el.removeChild(container));
1167
671
  }
1168
- );
672
+ }, undefined, {
673
+ render: !hydrating
674
+ });
1169
675
  return marker;
1170
676
  }
1171
677
  function createDynamic(component, props) {
@@ -1191,64 +697,4 @@ function Dynamic(props) {
1191
697
  return createDynamic(() => props.component, others);
1192
698
  }
1193
699
 
1194
- export {
1195
- Aliases,
1196
- voidFn as Assets,
1197
- ChildProperties,
1198
- DOMElements,
1199
- DelegatedEvents,
1200
- Dynamic,
1201
- Hydration,
1202
- voidFn as HydrationScript,
1203
- NoHydration,
1204
- Portal,
1205
- Properties,
1206
- RequestContext,
1207
- SVGElements,
1208
- SVGNamespace,
1209
- addEventListener,
1210
- assign,
1211
- classList,
1212
- className,
1213
- clearDelegatedEvents,
1214
- createDynamic,
1215
- delegateEvents,
1216
- dynamicProperty,
1217
- escape,
1218
- voidFn as generateHydrationScript,
1219
- voidFn as getAssets,
1220
- getHydrationKey,
1221
- getNextElement,
1222
- getNextMarker,
1223
- getNextMatch,
1224
- getPropAlias,
1225
- voidFn as getRequestEvent,
1226
- hydrate,
1227
- innerHTML,
1228
- insert,
1229
- isDev,
1230
- isServer,
1231
- memo,
1232
- render,
1233
- renderToStream,
1234
- renderToString,
1235
- renderToStringAsync,
1236
- resolveSSRNode,
1237
- runHydrationEvents,
1238
- setAttribute,
1239
- setAttributeNS,
1240
- setBoolAttribute,
1241
- setProperty,
1242
- spread,
1243
- ssr,
1244
- ssrAttribute,
1245
- ssrClassList,
1246
- ssrElement,
1247
- ssrHydrationKey,
1248
- ssrSpread,
1249
- ssrStyle,
1250
- style,
1251
- template,
1252
- use,
1253
- voidFn as useAssets
1254
- };
700
+ 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 };