solid-js 1.9.0 → 1.9.1

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solid-js",
3
3
  "description": "A declarative JavaScript library for building user interfaces.",
4
- "version": "1.9.0",
4
+ "version": "1.9.1",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -4,13 +4,13 @@ export declare function enableHydration(): void;
4
4
  * A general `Component` has no implicit `children` prop. If desired, you can
5
5
  * specify one as in `Component<{name: String, children: JSX.Element}>`.
6
6
  */
7
- export type Component<P = {}> = (props: P) => JSX.Element;
7
+ export type Component<P extends Record<string, any> = {}> = (props: P) => JSX.Element;
8
8
  /**
9
9
  * Extend props to forbid the `children` prop.
10
10
  * Use this to prevent accidentally passing `children` to components that
11
11
  * would silently throw them away.
12
12
  */
13
- export type VoidProps<P = {}> = P & {
13
+ export type VoidProps<P extends Record<string, any> = {}> = P & {
14
14
  children?: never;
15
15
  };
16
16
  /**
@@ -18,13 +18,13 @@ export type VoidProps<P = {}> = P & {
18
18
  * Use this to prevent accidentally passing `children` to components that
19
19
  * would silently throw them away.
20
20
  */
21
- export type VoidComponent<P = {}> = Component<VoidProps<P>>;
21
+ export type VoidComponent<P extends Record<string, any> = {}> = Component<VoidProps<P>>;
22
22
  /**
23
23
  * Extend props to allow an optional `children` prop with the usual
24
24
  * type in JSX, `JSX.Element` (which allows elements, arrays, functions, etc.).
25
25
  * Use this for components that you want to accept children.
26
26
  */
27
- export type ParentProps<P = {}> = P & {
27
+ export type ParentProps<P extends Record<string, any> = {}> = P & {
28
28
  children?: JSX.Element;
29
29
  };
30
30
  /**
@@ -32,14 +32,14 @@ export type ParentProps<P = {}> = P & {
32
32
  * type in JSX, `JSX.Element` (which allows elements, arrays, functions, etc.).
33
33
  * Use this for components that you want to accept children.
34
34
  */
35
- export type ParentComponent<P = {}> = Component<ParentProps<P>>;
35
+ export type ParentComponent<P extends Record<string, any> = {}> = Component<ParentProps<P>>;
36
36
  /**
37
37
  * Extend props to require a `children` prop with the specified type.
38
38
  * Use this for components where you need a specific child type,
39
39
  * typically a function that receives specific argument types.
40
40
  * Note that all JSX <Elements> are of the type `JSX.Element`.
41
41
  */
42
- export type FlowProps<P = {}, C = JSX.Element> = P & {
42
+ export type FlowProps<P extends Record<string, any> = {}, C = JSX.Element> = P & {
43
43
  children: C;
44
44
  };
45
45
  /**
@@ -48,9 +48,11 @@ export type FlowProps<P = {}, C = JSX.Element> = P & {
48
48
  * typically a function that receives specific argument types.
49
49
  * Note that all JSX <Elements> are of the type `JSX.Element`.
50
50
  */
51
- export type FlowComponent<P = {}, C = JSX.Element> = Component<FlowProps<P, C>>;
51
+ export type FlowComponent<P extends Record<string, any> = {}, C = JSX.Element> = Component<
52
+ FlowProps<P, C>
53
+ >;
52
54
  /** @deprecated: use `ParentProps` instead */
53
- export type PropsWithChildren<P = {}> = ParentProps<P>;
55
+ export type PropsWithChildren<P extends Record<string, any> = {}> = ParentProps<P>;
54
56
  export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {});
55
57
  /**
56
58
  * Takes the props of the passed component and returns its type
@@ -70,7 +72,10 @@ export type ComponentProps<T extends ValidComponent> = T extends Component<infer
70
72
  * @example Component<{ref: Ref<Element>}>
71
73
  */
72
74
  export type Ref<T> = T | ((val: T) => void);
73
- export declare function createComponent<T>(Comp: Component<T>, props: T): JSX.Element;
75
+ export declare function createComponent<T extends Record<string, any>>(
76
+ Comp: Component<T>,
77
+ props: T
78
+ ): JSX.Element;
74
79
  type DistributeOverride<T, F> = T extends undefined ? F : T;
75
80
  type Override<T, U> = T extends any
76
81
  ? U extends any
package/web/dist/dev.cjs CHANGED
@@ -416,7 +416,7 @@ function eventHandler(e) {
416
416
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
417
417
  if (e.cancelBubble) return;
418
418
  }
419
- node.host && node.contains(e.target) && !node.host._$host && retarget(node.host);
419
+ node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
420
420
  return true;
421
421
  };
422
422
  const walkUpTree = () => {
package/web/dist/dev.js CHANGED
@@ -888,7 +888,11 @@ function eventHandler(e) {
888
888
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
889
889
  if (e.cancelBubble) return;
890
890
  }
891
- node.host && node.contains(e.target) && !node.host._$host && retarget(node.host);
891
+ node.host &&
892
+ typeof node.host !== "string" &&
893
+ !node.host._$host &&
894
+ node.contains(e.target) &&
895
+ retarget(node.host);
892
896
  return true;
893
897
  };
894
898
  const walkUpTree = () => {
package/web/dist/web.cjs CHANGED
@@ -408,7 +408,7 @@ function eventHandler(e) {
408
408
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
409
409
  if (e.cancelBubble) return;
410
410
  }
411
- node.host && node.contains(e.target) && !node.host._$host && retarget(node.host);
411
+ node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
412
412
  return true;
413
413
  };
414
414
  const walkUpTree = () => {
package/web/dist/web.js CHANGED
@@ -870,7 +870,11 @@ function eventHandler(e) {
870
870
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
871
871
  if (e.cancelBubble) return;
872
872
  }
873
- node.host && node.contains(e.target) && !node.host._$host && retarget(node.host);
873
+ node.host &&
874
+ typeof node.host !== "string" &&
875
+ !node.host._$host &&
876
+ node.contains(e.target) &&
877
+ retarget(node.host);
874
878
  return true;
875
879
  };
876
880
  const walkUpTree = () => {