solid-js 1.8.0-beta.0 → 1.8.0-beta.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 (46) hide show
  1. package/dist/dev.js +297 -532
  2. package/dist/server.js +74 -168
  3. package/dist/solid.js +255 -459
  4. package/h/dist/h.js +8 -34
  5. package/h/jsx-runtime/dist/jsx.js +1 -1
  6. package/h/jsx-runtime/types/index.d.ts +8 -11
  7. package/h/jsx-runtime/types/jsx.d.ts +19 -5
  8. package/h/types/hyperscript.d.ts +11 -11
  9. package/html/dist/html.js +94 -216
  10. package/html/types/lit.d.ts +31 -45
  11. package/package.json +1 -1
  12. package/store/dist/dev.js +42 -114
  13. package/store/dist/server.js +8 -19
  14. package/store/dist/store.js +39 -105
  15. package/store/types/index.d.ts +7 -21
  16. package/store/types/modifiers.d.ts +3 -6
  17. package/store/types/mutable.d.ts +2 -5
  18. package/store/types/server.d.ts +4 -12
  19. package/store/types/store.d.ts +61 -218
  20. package/types/index.d.ts +9 -72
  21. package/types/jsx.d.ts +19 -5
  22. package/types/reactive/array.d.ts +4 -12
  23. package/types/reactive/observable.d.ts +17 -25
  24. package/types/reactive/scheduler.d.ts +6 -9
  25. package/types/reactive/signal.d.ts +140 -228
  26. package/types/render/Suspense.d.ts +5 -5
  27. package/types/render/component.d.ts +31 -62
  28. package/types/render/flow.d.ts +31 -43
  29. package/types/render/hydration.d.ts +13 -12
  30. package/types/server/index.d.ts +2 -56
  31. package/types/server/reactive.d.ts +40 -67
  32. package/types/server/rendering.d.ts +95 -166
  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.cjs +11 -4
  38. package/web/dist/dev.js +89 -614
  39. package/web/dist/server.cjs +5 -6
  40. package/web/dist/server.js +97 -181
  41. package/web/dist/web.cjs +11 -4
  42. package/web/dist/web.js +89 -614
  43. package/web/types/client.d.ts +3 -3
  44. package/web/types/core.d.ts +1 -10
  45. package/web/types/index.d.ts +10 -27
  46. package/web/types/server-mock.d.ts +32 -47
package/h/dist/h.js CHANGED
@@ -1,11 +1,4 @@
1
- import {
2
- spread,
3
- assign,
4
- insert,
5
- createComponent,
6
- dynamicProperty,
7
- SVGElements
8
- } from "solid-js/web";
1
+ import { spread, assign, insert, createComponent, dynamicProperty, SVGElements } from 'solid-js/web';
9
2
 
10
3
  const $ELEMENT = Symbol("hyper-element");
11
4
  function createHyperScript(r) {
@@ -24,16 +17,9 @@ function createHyperScript(r) {
24
17
  return ret;
25
18
  function item(l) {
26
19
  const type = typeof l;
27
- if (l == null);
28
- else if ("string" === type) {
29
- if (!e) parseClass(l);
30
- else e.appendChild(document.createTextNode(l));
31
- } else if (
32
- "number" === type ||
33
- "boolean" === type ||
34
- l instanceof Date ||
35
- l instanceof RegExp
36
- ) {
20
+ if (l == null) ;else if ("string" === type) {
21
+ if (!e) parseClass(l);else e.appendChild(document.createTextNode(l));
22
+ } else if ("number" === type || "boolean" === type || l instanceof Date || l instanceof RegExp) {
37
23
  e.appendChild(document.createTextNode(l.toString()));
38
24
  } else if (Array.isArray(l)) {
39
25
  for (let i = 0; i < l.length; i++) item(l[i]);
@@ -48,18 +34,12 @@ function createHyperScript(r) {
48
34
  dynamic = true;
49
35
  } else if (d[k].get) dynamic = true;
50
36
  }
51
- dynamic
52
- ? r.spread(e, l, e instanceof SVGElement, !!args.length)
53
- : r.assign(e, l, e instanceof SVGElement, !!args.length);
37
+ dynamic ? r.spread(e, l, e instanceof SVGElement, !!args.length) : r.assign(e, l, e instanceof SVGElement, !!args.length);
54
38
  } else if ("function" === type) {
55
39
  if (!e) {
56
40
  let props,
57
41
  next = args[0];
58
- if (
59
- next == null ||
60
- (typeof next === "object" && !Array.isArray(next) && !(next instanceof Element))
61
- )
62
- props = args.shift();
42
+ if (next == null || typeof next === "object" && !Array.isArray(next) && !(next instanceof Element)) props = args.shift();
63
43
  props || (props = {});
64
44
  if (args.length) {
65
45
  props.children = args.length > 1 ? args : args[0];
@@ -75,8 +55,7 @@ function createHyperScript(r) {
75
55
  return list;
76
56
  };
77
57
  r.dynamicProperty(props, k);
78
- } else if (typeof d[k].value === "function" && !d[k].value.length)
79
- r.dynamicProperty(props, k);
58
+ } else if (typeof d[k].value === "function" && !d[k].value.length) r.dynamicProperty(props, k);
80
59
  }
81
60
  e = r.createComponent(l, props);
82
61
  args = [];
@@ -93,12 +72,7 @@ function createHyperScript(r) {
93
72
  const v = m[i],
94
73
  s = v.substring(1, v.length);
95
74
  if (!v) continue;
96
- if (!e)
97
- e = r.SVGElements.has(v)
98
- ? document.createElementNS("http://www.w3.org/2000/svg", v)
99
- : document.createElement(v);
100
- else if (v[0] === ".") e.classList.add(s);
101
- else if (v[0] === "#") e.setAttribute("id", s);
75
+ if (!e) e = r.SVGElements.has(v) ? document.createElementNS("http://www.w3.org/2000/svg", v) : document.createElement(v);else if (v[0] === ".") e.classList.add(s);else if (v[0] === "#") e.setAttribute("id", s);
102
76
  }
103
77
  }
104
78
  function detectMultiExpression(list) {
@@ -1,4 +1,4 @@
1
- import h from "solid-js/h";
1
+ import h from 'solid-js/h';
2
2
 
3
3
  function Fragment(props) {
4
4
  return props.children;
@@ -1,14 +1,11 @@
1
1
  export type { JSX } from "./jsx";
2
2
  import type { JSX } from "./jsx";
3
- declare function Fragment(props: { children: JSX.Element }): JSX.Element;
4
- declare function jsx(
5
- type: any,
6
- props: any
7
- ): () =>
8
- | (Node & {
9
- [key: string]: any;
10
- })
11
- | (Node & {
12
- [key: string]: any;
13
- })[];
3
+ declare function Fragment(props: {
4
+ children: JSX.Element;
5
+ }): JSX.Element;
6
+ declare function jsx(type: any, props: any): () => (Node & {
7
+ [key: string]: any;
8
+ }) | (Node & {
9
+ [key: string]: any;
10
+ })[];
14
11
  export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };
@@ -634,7 +634,7 @@ export namespace JSX {
634
634
  interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
635
635
  accessKey?: FunctionMaybe<string>;
636
636
  class?: FunctionMaybe<string> | undefined;
637
- contenteditable?: FunctionMaybe<boolean | "inherit">;
637
+ contenteditable?: FunctionMaybe<boolean | "plaintext-only" | "inherit">;
638
638
  contextmenu?: FunctionMaybe<string>;
639
639
  dir?: FunctionMaybe<HTMLDir>;
640
640
  draggable?: FunctionMaybe<boolean>;
@@ -667,7 +667,7 @@ export namespace JSX {
667
667
  inputmode?: FunctionMaybe<
668
668
  "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"
669
669
  >;
670
- contentEditable?: FunctionMaybe<boolean | "inherit">;
670
+ contentEditable?: FunctionMaybe<boolean | "plaintext-only" | "inherit">;
671
671
  contextMenu?: FunctionMaybe<string>;
672
672
  tabIndex?: FunctionMaybe<number | string>;
673
673
  autoCapitalize?: FunctionMaybe<HTMLAutocapitalize>;
@@ -1528,6 +1528,15 @@ export namespace JSX {
1528
1528
  azimuth?: FunctionMaybe<number | string>;
1529
1529
  elevation?: FunctionMaybe<number | string>;
1530
1530
  }
1531
+ interface FeDropShadowSVGAttributes<T>
1532
+ extends CoreSVGAttributes<T>,
1533
+ FilterPrimitiveElementSVGAttributes<T>,
1534
+ StylableSVGAttributes,
1535
+ Pick<PresentationSVGAttributes, "color" | "flood-color" | "flood-opacity"> {
1536
+ dx?: FunctionMaybe<number | string>;
1537
+ dy?: FunctionMaybe<number | string>;
1538
+ stdDeviation?: FunctionMaybe<number | string>;
1539
+ }
1531
1540
  interface FeFloodSVGAttributes<T>
1532
1541
  extends FilterPrimitiveElementSVGAttributes<T>,
1533
1542
  StylableSVGAttributes,
@@ -1702,6 +1711,7 @@ export namespace JSX {
1702
1711
  height?: FunctionMaybe<number | string>;
1703
1712
  }
1704
1713
  interface MetadataSVGAttributes<T> extends CoreSVGAttributes<T> {}
1714
+ interface MPathSVGAttributes<T> extends CoreSVGAttributes<T> {}
1705
1715
  interface PathSVGAttributes<T>
1706
1716
  extends GraphicsElementSVGAttributes<T>,
1707
1717
  ShapeElementSVGAttributes<T>,
@@ -1770,6 +1780,10 @@ export namespace JSX {
1770
1780
  rx?: FunctionMaybe<number | string>;
1771
1781
  ry?: FunctionMaybe<number | string>;
1772
1782
  }
1783
+ interface SetSVGAttributes<T>
1784
+ extends CoreSVGAttributes<T>,
1785
+ StylableSVGAttributes,
1786
+ AnimationTimingSVGAttributes {}
1773
1787
  interface StopSVGAttributes<T>
1774
1788
  extends CoreSVGAttributes<T>,
1775
1789
  StylableSVGAttributes,
@@ -2020,7 +2034,7 @@ export namespace JSX {
2020
2034
  feDiffuseLighting: FeDiffuseLightingSVGAttributes<SVGFEDiffuseLightingElement>;
2021
2035
  feDisplacementMap: FeDisplacementMapSVGAttributes<SVGFEDisplacementMapElement>;
2022
2036
  feDistantLight: FeDistantLightSVGAttributes<SVGFEDistantLightElement>;
2023
- feDropShadow: Partial<SVGFEDropShadowElement>;
2037
+ feDropShadow: FeDropShadowSVGAttributes<SVGFEDropShadowElement>;
2024
2038
  feFlood: FeFloodSVGAttributes<SVGFEFloodElement>;
2025
2039
  feFuncA: FeFuncSVGAttributes<SVGFEFuncAElement>;
2026
2040
  feFuncB: FeFuncSVGAttributes<SVGFEFuncBElement>;
@@ -2046,14 +2060,14 @@ export namespace JSX {
2046
2060
  marker: MarkerSVGAttributes<SVGMarkerElement>;
2047
2061
  mask: MaskSVGAttributes<SVGMaskElement>;
2048
2062
  metadata: MetadataSVGAttributes<SVGMetadataElement>;
2049
- mpath: Partial<SVGMPathElement>;
2063
+ mpath: MPathSVGAttributes<SVGMPathElement>;
2050
2064
  path: PathSVGAttributes<SVGPathElement>;
2051
2065
  pattern: PatternSVGAttributes<SVGPatternElement>;
2052
2066
  polygon: PolygonSVGAttributes<SVGPolygonElement>;
2053
2067
  polyline: PolylineSVGAttributes<SVGPolylineElement>;
2054
2068
  radialGradient: RadialGradientSVGAttributes<SVGRadialGradientElement>;
2055
2069
  rect: RectSVGAttributes<SVGRectElement>;
2056
- set: Partial<SVGSetElement>;
2070
+ set: SetSVGAttributes<SVGSetElement>;
2057
2071
  stop: StopSVGAttributes<SVGStopElement>;
2058
2072
  svg: SvgSVGAttributes<SVGSVGElement>;
2059
2073
  switch: SwitchSVGAttributes<SVGSwitchElement>;
@@ -1,20 +1,20 @@
1
1
  type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
2
2
  interface Runtime {
3
- insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
4
- spread(node: Element, accessor: any, isSVG?: Boolean, skipChildren?: Boolean): void;
5
- assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
6
- createComponent(Comp: (props: any) => any, props: any): any;
7
- dynamicProperty(props: any, key: string): any;
8
- SVGElements: Set<string>;
3
+ insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
4
+ spread(node: Element, accessor: any, isSVG?: Boolean, skipChildren?: Boolean): void;
5
+ assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
6
+ createComponent(Comp: (props: any) => any, props: any): any;
7
+ dynamicProperty(props: any, key: string): any;
8
+ SVGElements: Set<string>;
9
9
  }
10
10
  type ExpandableNode = Node & {
11
- [key: string]: any;
11
+ [key: string]: any;
12
12
  };
13
13
  export type HyperScript = {
14
- (...args: any[]): () => ExpandableNode | ExpandableNode[];
15
- Fragment: (props: {
16
- children: (() => ExpandableNode) | (() => ExpandableNode)[];
17
- }) => ExpandableNode[];
14
+ (...args: any[]): () => ExpandableNode | ExpandableNode[];
15
+ Fragment: (props: {
16
+ children: (() => ExpandableNode) | (() => ExpandableNode)[];
17
+ }) => ExpandableNode[];
18
18
  };
19
19
  export declare function createHyperScript(r: Runtime): HyperScript;
20
20
  export {};