solid-js 1.8.0 → 1.8.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 (47) hide show
  1. package/dist/dev.cjs +5 -1
  2. package/dist/dev.js +301 -532
  3. package/dist/server.cjs +18 -4
  4. package/dist/server.js +89 -170
  5. package/dist/solid.cjs +5 -1
  6. package/dist/solid.js +259 -459
  7. package/h/dist/h.js +8 -34
  8. package/h/jsx-runtime/dist/jsx.js +1 -1
  9. package/h/jsx-runtime/types/index.d.ts +8 -11
  10. package/h/types/hyperscript.d.ts +11 -11
  11. package/html/dist/html.js +94 -216
  12. package/html/types/lit.d.ts +31 -45
  13. package/package.json +2 -2
  14. package/store/dist/dev.js +42 -114
  15. package/store/dist/server.js +8 -19
  16. package/store/dist/store.js +39 -105
  17. package/store/types/index.d.ts +7 -21
  18. package/store/types/modifiers.d.ts +3 -6
  19. package/store/types/mutable.d.ts +2 -5
  20. package/store/types/server.d.ts +4 -12
  21. package/store/types/store.d.ts +61 -218
  22. package/types/index.d.ts +9 -72
  23. package/types/reactive/array.d.ts +4 -12
  24. package/types/reactive/observable.d.ts +17 -25
  25. package/types/reactive/scheduler.d.ts +6 -9
  26. package/types/reactive/signal.d.ts +140 -228
  27. package/types/render/Suspense.d.ts +5 -5
  28. package/types/render/component.d.ts +31 -62
  29. package/types/render/flow.d.ts +31 -43
  30. package/types/render/hydration.d.ts +14 -14
  31. package/types/server/index.d.ts +2 -56
  32. package/types/server/reactive.d.ts +44 -68
  33. package/types/server/rendering.d.ts +95 -166
  34. package/universal/dist/dev.js +12 -28
  35. package/universal/dist/universal.js +12 -28
  36. package/universal/types/index.d.ts +1 -3
  37. package/universal/types/universal.d.ts +1 -0
  38. package/web/dist/dev.cjs +2 -2
  39. package/web/dist/dev.js +81 -613
  40. package/web/dist/server.cjs +1 -1
  41. package/web/dist/server.js +93 -176
  42. package/web/dist/web.cjs +1 -6
  43. package/web/dist/web.js +80 -617
  44. package/web/types/client.d.ts +2 -2
  45. package/web/types/core.d.ts +1 -10
  46. package/web/types/index.d.ts +10 -27
  47. package/web/types/server-mock.d.ts +32 -47
package/web/dist/web.js CHANGED
@@ -1,82 +1,14 @@
1
- import {
2
- createRoot,
3
- sharedConfig,
4
- createRenderEffect,
5
- untrack,
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, sharedConfig, createRenderEffect, untrack, enableHydration, getOwner, createEffect, runWithOwner, createMemo, createSignal, onCleanup, splitProps } 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
- "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", "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), {
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",
81
13
  formnovalidate: {
82
14
  $: "formNoValidate",
@@ -103,395 +35,19 @@ const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
103
35
  });
104
36
  function getPropAlias(prop, tagName) {
105
37
  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
- "feFlood",
156
- "feFuncA",
157
- "feFuncB",
158
- "feFuncG",
159
- "feFuncR",
160
- "feGaussianBlur",
161
- "feImage",
162
- "feMerge",
163
- "feMergeNode",
164
- "feMorphology",
165
- "feOffset",
166
- "fePointLight",
167
- "feSpecularLighting",
168
- "feSpotLight",
169
- "feTile",
170
- "feTurbulence",
171
- "filter",
172
- "font",
173
- "font-face",
174
- "font-face-format",
175
- "font-face-name",
176
- "font-face-src",
177
- "font-face-uri",
178
- "foreignObject",
179
- "g",
180
- "glyph",
181
- "glyphRef",
182
- "hkern",
183
- "image",
184
- "line",
185
- "linearGradient",
186
- "marker",
187
- "mask",
188
- "metadata",
189
- "missing-glyph",
190
- "mpath",
191
- "path",
192
- "pattern",
193
- "polygon",
194
- "polyline",
195
- "radialGradient",
196
- "rect",
197
- "set",
198
- "stop",
199
- "svg",
200
- "switch",
201
- "symbol",
202
- "text",
203
- "textPath",
204
- "tref",
205
- "tspan",
206
- "use",
207
- "view",
208
- "vkern"
209
- ]);
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", "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"]);
210
46
  const SVGNamespace = {
211
47
  xlink: "http://www.w3.org/1999/xlink",
212
48
  xml: "http://www.w3.org/XML/1998/namespace"
213
49
  };
214
- const DOMElements = /*#__PURE__*/ new Set([
215
- "html",
216
- "base",
217
- "head",
218
- "link",
219
- "meta",
220
- "style",
221
- "title",
222
- "body",
223
- "address",
224
- "article",
225
- "aside",
226
- "footer",
227
- "header",
228
- "main",
229
- "nav",
230
- "section",
231
- "body",
232
- "blockquote",
233
- "dd",
234
- "div",
235
- "dl",
236
- "dt",
237
- "figcaption",
238
- "figure",
239
- "hr",
240
- "li",
241
- "ol",
242
- "p",
243
- "pre",
244
- "ul",
245
- "a",
246
- "abbr",
247
- "b",
248
- "bdi",
249
- "bdo",
250
- "br",
251
- "cite",
252
- "code",
253
- "data",
254
- "dfn",
255
- "em",
256
- "i",
257
- "kbd",
258
- "mark",
259
- "q",
260
- "rp",
261
- "rt",
262
- "ruby",
263
- "s",
264
- "samp",
265
- "small",
266
- "span",
267
- "strong",
268
- "sub",
269
- "sup",
270
- "time",
271
- "u",
272
- "var",
273
- "wbr",
274
- "area",
275
- "audio",
276
- "img",
277
- "map",
278
- "track",
279
- "video",
280
- "embed",
281
- "iframe",
282
- "object",
283
- "param",
284
- "picture",
285
- "portal",
286
- "source",
287
- "svg",
288
- "math",
289
- "canvas",
290
- "noscript",
291
- "script",
292
- "del",
293
- "ins",
294
- "caption",
295
- "col",
296
- "colgroup",
297
- "table",
298
- "tbody",
299
- "td",
300
- "tfoot",
301
- "th",
302
- "thead",
303
- "tr",
304
- "button",
305
- "datalist",
306
- "fieldset",
307
- "form",
308
- "input",
309
- "label",
310
- "legend",
311
- "meter",
312
- "optgroup",
313
- "option",
314
- "output",
315
- "progress",
316
- "select",
317
- "textarea",
318
- "details",
319
- "dialog",
320
- "menu",
321
- "summary",
322
- "details",
323
- "slot",
324
- "template",
325
- "acronym",
326
- "applet",
327
- "basefont",
328
- "bgsound",
329
- "big",
330
- "blink",
331
- "center",
332
- "content",
333
- "dir",
334
- "font",
335
- "frame",
336
- "frameset",
337
- "hgroup",
338
- "image",
339
- "keygen",
340
- "marquee",
341
- "menuitem",
342
- "nobr",
343
- "noembed",
344
- "noframes",
345
- "plaintext",
346
- "rb",
347
- "rtc",
348
- "shadow",
349
- "spacer",
350
- "strike",
351
- "tt",
352
- "xmp",
353
- "a",
354
- "abbr",
355
- "acronym",
356
- "address",
357
- "applet",
358
- "area",
359
- "article",
360
- "aside",
361
- "audio",
362
- "b",
363
- "base",
364
- "basefont",
365
- "bdi",
366
- "bdo",
367
- "bgsound",
368
- "big",
369
- "blink",
370
- "blockquote",
371
- "body",
372
- "br",
373
- "button",
374
- "canvas",
375
- "caption",
376
- "center",
377
- "cite",
378
- "code",
379
- "col",
380
- "colgroup",
381
- "content",
382
- "data",
383
- "datalist",
384
- "dd",
385
- "del",
386
- "details",
387
- "dfn",
388
- "dialog",
389
- "dir",
390
- "div",
391
- "dl",
392
- "dt",
393
- "em",
394
- "embed",
395
- "fieldset",
396
- "figcaption",
397
- "figure",
398
- "font",
399
- "footer",
400
- "form",
401
- "frame",
402
- "frameset",
403
- "head",
404
- "header",
405
- "hgroup",
406
- "hr",
407
- "html",
408
- "i",
409
- "iframe",
410
- "image",
411
- "img",
412
- "input",
413
- "ins",
414
- "kbd",
415
- "keygen",
416
- "label",
417
- "legend",
418
- "li",
419
- "link",
420
- "main",
421
- "map",
422
- "mark",
423
- "marquee",
424
- "menu",
425
- "menuitem",
426
- "meta",
427
- "meter",
428
- "nav",
429
- "nobr",
430
- "noembed",
431
- "noframes",
432
- "noscript",
433
- "object",
434
- "ol",
435
- "optgroup",
436
- "option",
437
- "output",
438
- "p",
439
- "param",
440
- "picture",
441
- "plaintext",
442
- "portal",
443
- "pre",
444
- "progress",
445
- "q",
446
- "rb",
447
- "rp",
448
- "rt",
449
- "rtc",
450
- "ruby",
451
- "s",
452
- "samp",
453
- "script",
454
- "section",
455
- "select",
456
- "shadow",
457
- "slot",
458
- "small",
459
- "source",
460
- "spacer",
461
- "span",
462
- "strike",
463
- "strong",
464
- "style",
465
- "sub",
466
- "summary",
467
- "sup",
468
- "table",
469
- "tbody",
470
- "td",
471
- "template",
472
- "textarea",
473
- "tfoot",
474
- "th",
475
- "thead",
476
- "time",
477
- "title",
478
- "tr",
479
- "track",
480
- "tt",
481
- "u",
482
- "ul",
483
- "var",
484
- "video",
485
- "wbr",
486
- "xmp",
487
- "input",
488
- "h1",
489
- "h2",
490
- "h3",
491
- "h4",
492
- "h5",
493
- "h6"
494
- ]);
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"]);
495
51
 
496
52
  function reconcileArrays(parentNode, a, b) {
497
53
  let bLength = b.length,
@@ -512,7 +68,7 @@ function reconcileArrays(parentNode, a, b) {
512
68
  bEnd--;
513
69
  }
514
70
  if (aEnd === aStart) {
515
- 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;
516
72
  while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
517
73
  } else if (bEnd === bStart) {
518
74
  while (aStart < aEnd) {
@@ -555,9 +111,7 @@ function render(code, element, init, options = {}) {
555
111
  let disposer;
556
112
  createRoot(dispose => {
557
113
  disposer = dispose;
558
- element === document
559
- ? code()
560
- : insert(element, code(), element.firstChild ? null : undefined, init);
114
+ element === document ? code() : insert(element, code(), element.firstChild ? null : undefined, init);
561
115
  }, options.owner);
562
116
  return () => {
563
117
  disposer();
@@ -571,9 +125,7 @@ function template(html, isCE, isSVG) {
571
125
  t.innerHTML = html;
572
126
  return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
573
127
  };
574
- const fn = isCE
575
- ? () => untrack(() => document.importNode(node || (node = create()), true))
576
- : () => (node || (node = create())).cloneNode(true);
128
+ const fn = isCE ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
577
129
  fn.cloneNode = fn;
578
130
  return fn;
579
131
  }
@@ -598,18 +150,15 @@ function setProperty(node, name, value) {
598
150
  }
599
151
  function setAttribute(node, name, value) {
600
152
  if (sharedConfig.context) return;
601
- if (value == null) node.removeAttribute(name);
602
- else node.setAttribute(name, value);
153
+ if (value == null) node.removeAttribute(name);else node.setAttribute(name, value);
603
154
  }
604
155
  function setAttributeNS(node, namespace, name, value) {
605
156
  if (sharedConfig.context) return;
606
- if (value == null) node.removeAttributeNS(namespace, name);
607
- else node.setAttributeNS(namespace, name, value);
157
+ if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
608
158
  }
609
159
  function className(node, value) {
610
160
  if (sharedConfig.context) return;
611
- if (value == null) node.removeAttribute("class");
612
- else node.className = value;
161
+ if (value == null) node.removeAttribute("class");else node.className = value;
613
162
  }
614
163
  function addEventListener(node, name, handler, delegate) {
615
164
  if (delegate) {
@@ -619,7 +168,7 @@ function addEventListener(node, name, handler, delegate) {
619
168
  } else node[`$$${name}`] = handler;
620
169
  } else if (Array.isArray(handler)) {
621
170
  const handlerFn = handler[0];
622
- node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));
171
+ node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
623
172
  } else node.addEventListener(name, handler);
624
173
  }
625
174
  function classList(node, value, prev = {}) {
@@ -644,7 +193,7 @@ function classList(node, value, prev = {}) {
644
193
  function style(node, value, prev) {
645
194
  if (!value) return prev ? setAttribute(node, "style") : value;
646
195
  const nodeStyle = node.style;
647
- if (typeof value === "string") return (nodeStyle.cssText = value);
196
+ if (typeof value === "string") return nodeStyle.cssText = value;
648
197
  typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
649
198
  prev || (prev = {});
650
199
  value || (value = {});
@@ -665,9 +214,7 @@ function style(node, value, prev) {
665
214
  function spread(node, props = {}, isSVG, skipChildren) {
666
215
  const prevProps = {};
667
216
  if (!skipChildren) {
668
- createRenderEffect(
669
- () => (prevProps.children = insertExpression(node, props.children, prevProps.children))
670
- );
217
+ createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
671
218
  }
672
219
  createRenderEffect(() => props.ref && props.ref(node));
673
220
  createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
@@ -726,9 +273,7 @@ function hydrate$1(code, element, options = {}) {
726
273
  }
727
274
  function getNextElement(template) {
728
275
  let node, key;
729
- if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {
730
- if (sharedConfig.context) console.warn("Unable to find DOM nodes for hydration key:", key);
731
- if (!template) throw new Error("Unrecoverable Hydration Mismatch. No template for key: " + key);
276
+ if (!sharedConfig.context || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
732
277
  return template();
733
278
  }
734
279
  if (sharedConfig.completed) sharedConfig.completed.add(node);
@@ -747,8 +292,7 @@ function getNextMarker(start) {
747
292
  while (end) {
748
293
  if (end.nodeType === 8) {
749
294
  const v = end.nodeValue;
750
- if (v === "$") count++;
751
- else if (v === "/") {
295
+ if (v === "$") count++;else if (v === "/") {
752
296
  if (count === 0) return [end, current];
753
297
  count--;
754
298
  }
@@ -762,7 +306,10 @@ function getNextMarker(start) {
762
306
  function runHydrationEvents() {
763
307
  if (sharedConfig.events && !sharedConfig.events.queued) {
764
308
  queueMicrotask(() => {
765
- const { completed, events } = sharedConfig;
309
+ const {
310
+ completed,
311
+ events
312
+ } = sharedConfig;
766
313
  events.queued = false;
767
314
  while (events.length) {
768
315
  const [el, e] = events[0];
@@ -779,8 +326,7 @@ function toPropertyName(name) {
779
326
  }
780
327
  function toggleClassKey(node, key, value) {
781
328
  const classNames = key.trim().split(/\s+/);
782
- for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
783
- node.classList.toggle(classNames[i], value);
329
+ for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
784
330
  }
785
331
  function assignProp(node, prop, value, prev, isSVG, skipRef) {
786
332
  let isCE, isProp, isChildProp, propAlias, forceProp;
@@ -810,30 +356,21 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
810
356
  }
811
357
  } else if (prop.slice(0, 5) === "attr:") {
812
358
  setAttribute(node, prop.slice(5), value);
813
- } else if (
814
- (forceProp = prop.slice(0, 5) === "prop:") ||
815
- (isChildProp = ChildProperties.has(prop)) ||
816
- (!isSVG &&
817
- ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||
818
- (isCE = node.nodeName.includes("-"))
819
- ) {
359
+ } 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("-"))) {
820
360
  if (forceProp) {
821
361
  prop = prop.slice(5);
822
362
  isProp = true;
823
363
  } else if (sharedConfig.context) return value;
824
- if (prop === "class" || prop === "className") className(node, value);
825
- else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
826
- else node[propAlias || prop] = value;
364
+ if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[propAlias || prop] = value;
827
365
  } else {
828
366
  const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
829
- if (ns) setAttributeNS(node, ns, prop, value);
830
- else setAttribute(node, Aliases[prop] || prop, value);
367
+ if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, Aliases[prop] || prop, value);
831
368
  }
832
369
  return value;
833
370
  }
834
371
  function eventHandler(e) {
835
372
  const key = `$$${e.type}`;
836
- let node = (e.composedPath && e.composedPath()[0]) || e.target;
373
+ let node = e.composedPath && e.composedPath()[0] || e.target;
837
374
  if (e.target !== node) {
838
375
  Object.defineProperty(e, "target", {
839
376
  configurable: true,
@@ -863,8 +400,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
863
400
  let cleaned = [];
864
401
  for (let i = 0; i < current.length; i++) {
865
402
  const node = current[i];
866
- if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
867
- else cleaned.push(node);
403
+ if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();else cleaned.push(node);
868
404
  }
869
405
  current = cleaned;
870
406
  }
@@ -872,7 +408,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
872
408
  if (value === current) return current;
873
409
  const t = typeof value,
874
410
  multi = marker !== undefined;
875
- parent = (multi && current[0] && current[0].parentNode) || parent;
411
+ parent = multi && current[0] && current[0].parentNode || parent;
876
412
  if (t === "string" || t === "number") {
877
413
  if (sharedConfig.context) return current;
878
414
  if (t === "number") value = value.toString();
@@ -901,7 +437,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
901
437
  const array = [];
902
438
  const currentArray = current && Array.isArray(current);
903
439
  if (normalizeIncomingArray(array, value, current, unwrapArray)) {
904
- createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));
440
+ createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
905
441
  return () => current;
906
442
  }
907
443
  if (sharedConfig.context) {
@@ -910,7 +446,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
910
446
  let node = array[0];
911
447
  let nodes = [node];
912
448
  while ((node = node.nextSibling) !== marker) nodes.push(node);
913
- return (current = nodes);
449
+ return current = nodes;
914
450
  }
915
451
  if (array.length === 0) {
916
452
  current = cleanChildren(parent, current, marker);
@@ -925,15 +461,15 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
925
461
  }
926
462
  current = array;
927
463
  } else if (value.nodeType) {
928
- if (sharedConfig.context && value.parentNode) return (current = multi ? [value] : value);
464
+ if (sharedConfig.context && value.parentNode) return current = multi ? [value] : value;
929
465
  if (Array.isArray(current)) {
930
- if (multi) return (current = cleanChildren(parent, current, marker, value));
466
+ if (multi) return current = cleanChildren(parent, current, marker, value);
931
467
  cleanChildren(parent, current, null, value);
932
468
  } else if (current == null || current === "" || !parent.firstChild) {
933
469
  parent.appendChild(value);
934
470
  } else parent.replaceChild(value, parent.firstChild);
935
471
  current = value;
936
- } else console.warn(`Unrecognized value. Skipped inserting`, value);
472
+ } else ;
937
473
  return current;
938
474
  }
939
475
  function normalizeIncomingArray(normalized, array, current, unwrap) {
@@ -942,28 +478,21 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
942
478
  let item = array[i],
943
479
  prev = current && current[i],
944
480
  t;
945
- if (item == null || item === true || item === false);
946
- else if ((t = typeof item) === "object" && item.nodeType) {
481
+ if (item == null || item === true || item === false) ; else if ((t = typeof item) === "object" && item.nodeType) {
947
482
  normalized.push(item);
948
483
  } else if (Array.isArray(item)) {
949
484
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
950
485
  } else if (t === "function") {
951
486
  if (unwrap) {
952
487
  while (typeof item === "function") item = item();
953
- dynamic =
954
- normalizeIncomingArray(
955
- normalized,
956
- Array.isArray(item) ? item : [item],
957
- Array.isArray(prev) ? prev : [prev]
958
- ) || dynamic;
488
+ dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
959
489
  } else {
960
490
  normalized.push(item);
961
491
  dynamic = true;
962
492
  }
963
493
  } else {
964
494
  const value = String(item);
965
- if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
966
- else normalized.push(document.createTextNode(value));
495
+ if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value));
967
496
  }
968
497
  }
969
498
  return dynamic;
@@ -972,7 +501,7 @@ function appendNodes(parent, array, marker = null) {
972
501
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
973
502
  }
974
503
  function cleanChildren(parent, current, marker, replacement) {
975
- if (marker === undefined) return (parent.textContent = "");
504
+ if (marker === undefined) return parent.textContent = "";
976
505
  const node = replacement || document.createTextNode("");
977
506
  if (current.length) {
978
507
  let inserted = false;
@@ -980,9 +509,7 @@ function cleanChildren(parent, current, marker, replacement) {
980
509
  const el = current[i];
981
510
  if (node !== el) {
982
511
  const isParent = el.parentNode === parent;
983
- if (!inserted && !i)
984
- isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
985
- else isParent && el.remove();
512
+ if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
986
513
  } else inserted = true;
987
514
  }
988
515
  } else parent.insertBefore(node, marker);
@@ -993,8 +520,7 @@ function gatherHydratable(element, root) {
993
520
  for (let i = 0; i < templates.length; i++) {
994
521
  const node = templates[i];
995
522
  const key = node.getAttribute("data-hk");
996
- if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))
997
- sharedConfig.registry.set(key, node);
523
+ if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key)) sharedConfig.registry.set(key, node);
998
524
  }
999
525
  }
1000
526
  function getHydrationKey() {
@@ -1046,47 +572,42 @@ const hydrate = (...args) => {
1046
572
  return hydrate$1(...args);
1047
573
  };
1048
574
  function Portal(props) {
1049
- const { useShadow } = props,
575
+ const {
576
+ useShadow
577
+ } = props,
1050
578
  marker = document.createTextNode(""),
1051
579
  mount = () => props.mount || document.body,
1052
580
  owner = getOwner();
1053
581
  let content;
1054
582
  let hydrating = !!sharedConfig.context;
1055
- createEffect(
1056
- () => {
1057
- if (hydrating) getOwner().user = hydrating = false;
1058
- content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
1059
- const el = mount();
1060
- if (el instanceof HTMLHeadElement) {
1061
- const [clean, setClean] = createSignal(false);
1062
- const cleanup = () => setClean(true);
1063
- createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));
1064
- onCleanup(cleanup);
1065
- } else {
1066
- const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
1067
- renderRoot =
1068
- useShadow && container.attachShadow
1069
- ? container.attachShadow({
1070
- mode: "open"
1071
- })
1072
- : container;
1073
- Object.defineProperty(container, "_$host", {
1074
- get() {
1075
- return marker.parentNode;
1076
- },
1077
- configurable: true
1078
- });
1079
- insert(renderRoot, content);
1080
- el.appendChild(container);
1081
- props.ref && props.ref(container);
1082
- onCleanup(() => el.removeChild(container));
1083
- }
1084
- },
1085
- undefined,
1086
- {
1087
- render: !hydrating
583
+ createEffect(() => {
584
+ if (hydrating) getOwner().user = hydrating = false;
585
+ content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
586
+ const el = mount();
587
+ if (el instanceof HTMLHeadElement) {
588
+ const [clean, setClean] = createSignal(false);
589
+ const cleanup = () => setClean(true);
590
+ createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null));
591
+ onCleanup(cleanup);
592
+ } else {
593
+ const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
594
+ renderRoot = useShadow && container.attachShadow ? container.attachShadow({
595
+ mode: "open"
596
+ }) : container;
597
+ Object.defineProperty(container, "_$host", {
598
+ get() {
599
+ return marker.parentNode;
600
+ },
601
+ configurable: true
602
+ });
603
+ insert(renderRoot, content);
604
+ el.appendChild(container);
605
+ props.ref && props.ref(container);
606
+ onCleanup(() => el.removeChild(container));
1088
607
  }
1089
- );
608
+ }, undefined, {
609
+ render: !hydrating
610
+ });
1090
611
  return marker;
1091
612
  }
1092
613
  function Dynamic(props) {
@@ -1096,9 +617,6 @@ function Dynamic(props) {
1096
617
  const component = cached();
1097
618
  switch (typeof component) {
1098
619
  case "function":
1099
- Object.assign(component, {
1100
- [$DEVCOMP]: true
1101
- });
1102
620
  return untrack(() => component(others));
1103
621
  case "string":
1104
622
  const isSvg = SVGElements.has(component);
@@ -1109,59 +627,4 @@ function Dynamic(props) {
1109
627
  });
1110
628
  }
1111
629
 
1112
- export {
1113
- Aliases,
1114
- voidFn as Assets,
1115
- ChildProperties,
1116
- DOMElements,
1117
- DelegatedEvents,
1118
- Dynamic,
1119
- Hydration,
1120
- voidFn as HydrationScript,
1121
- NoHydration,
1122
- Portal,
1123
- Properties,
1124
- SVGElements,
1125
- SVGNamespace,
1126
- addEventListener,
1127
- assign,
1128
- classList,
1129
- className,
1130
- clearDelegatedEvents,
1131
- delegateEvents,
1132
- dynamicProperty,
1133
- escape,
1134
- voidFn as generateHydrationScript,
1135
- voidFn as getAssets,
1136
- getHydrationKey,
1137
- getNextElement,
1138
- getNextMarker,
1139
- getNextMatch,
1140
- getPropAlias,
1141
- hydrate,
1142
- innerHTML,
1143
- insert,
1144
- isDev,
1145
- isServer,
1146
- render,
1147
- renderToStream,
1148
- renderToString,
1149
- renderToStringAsync,
1150
- resolveSSRNode,
1151
- runHydrationEvents,
1152
- setAttribute,
1153
- setAttributeNS,
1154
- setProperty,
1155
- spread,
1156
- ssr,
1157
- ssrAttribute,
1158
- ssrClassList,
1159
- ssrElement,
1160
- ssrHydrationKey,
1161
- ssrSpread,
1162
- ssrStyle,
1163
- style,
1164
- template,
1165
- use,
1166
- voidFn as useAssets
1167
- };
630
+ export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getPropAlias, hydrate, innerHTML, insert, isDev, isServer, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets };