@dcl/react-ecs 7.4.22-9129040248.commit-e3dda7a → 7.4.22-9160893926.commit-529e3f0

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.
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from '../react-ecs';
1
2
  import { Listeners } from './listeners/types';
2
3
  import { UiBackgroundProps } from './uiBackground/types';
3
4
  import { UiTransformProps } from './uiTransform/types';
@@ -19,7 +20,7 @@ export interface EntityPropTypes extends Listeners {
19
20
  * @public
20
21
  */
21
22
  export type Key = number | string;
22
- export type Children = unknown;
23
+ export type Children = ReactNode;
23
24
  /**
24
25
  * unit value type. i.e. 'vw' || 'vh'
25
26
  * @public
@@ -49,7 +49,7 @@ const defaultUiTransform = {
49
49
  positionTop: 0,
50
50
  positionTopUnit: 0 /* YGUnit.YGU_UNDEFINED */,
51
51
  flexBasisUnit: 0 /* YGUnit.YGU_UNDEFINED */,
52
- widthUnit: 0 /* YGUnit.YGU_UNDEFINED */,
52
+ widthUnit: 3 /* YGUnit.YGU_AUTO */,
53
53
  heightUnit: 0 /* YGUnit.YGU_UNDEFINED */,
54
54
  pointerFilter: 0 /* PointerFilterMode.PFM_NONE */
55
55
  };
@@ -1,11 +1,11 @@
1
1
  import { PBUiBackground, PBUiText, PBUiTransform, PBUiInput, PBUiDropdown } from '@dcl/ecs';
2
- import { Callback, Children, Key } from './components';
2
+ import { Callback, Key } from './components';
3
3
  /**
4
4
  * @public
5
5
  */
6
6
  export interface EcsElements {
7
7
  entity: Partial<EntityComponents> & {
8
- children?: Children;
8
+ children?: ReactNode;
9
9
  key?: Key;
10
10
  };
11
11
  }
@@ -25,11 +25,29 @@ export type EntityComponents = {
25
25
  * @hidden
26
26
  */
27
27
  export declare namespace JSX {
28
- type Element = {} | null;
29
- type IntrinsicElements = EcsElements;
28
+ interface Element extends ReactElement<any, any> {
29
+ }
30
+ interface IntrinsicElements extends EcsElements {
31
+ }
30
32
  interface Component {
31
33
  }
32
34
  }
35
+ /**
36
+ * @public
37
+ */
38
+ export type JSXElementConstructor<P> = (props: P) => ReactElement<any, any> | null;
39
+ /**
40
+ * @public
41
+ */
42
+ export interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {
43
+ type: T;
44
+ props: P;
45
+ key: Key | null;
46
+ }
47
+ /**
48
+ * @public
49
+ */
50
+ export type ReactNode = ReactElement | string | number | boolean | null | undefined;
33
51
  /**
34
52
  * @public
35
53
  */
@@ -38,12 +56,18 @@ export declare namespace ReactEcs {
38
56
  /**
39
57
  * @public
40
58
  */
41
- type Element = {} | null;
59
+ type ReactNode = ReactElement | string | number | boolean | null | undefined;
60
+ /**
61
+ * @public
62
+ */
63
+ interface Element extends ReactElement<any, any> {
64
+ }
42
65
  /**
43
66
  * @public
44
67
  * HTML tag elements
45
68
  */
46
- type IntrinsicElements = EcsElements;
69
+ interface IntrinsicElements extends EcsElements {
70
+ }
47
71
  /**
48
72
  * @public
49
73
  * Component empty interface
@@ -1,6 +1,6 @@
1
1
  import { Entity, IEngine, PointerEventsSystem } from '@dcl/ecs';
2
2
  import { ReactEcs } from '../react-ecs';
3
3
  export declare function createReconciler(engine: Pick<IEngine, 'getComponent' | 'addEntity' | 'removeEntity' | 'defineComponentFromSchema' | 'getEntitiesWith'>, pointerEvents: PointerEventsSystem): {
4
- update: (component: ReactEcs.JSX.Element) => number;
4
+ update: (component: ReactEcs.JSX.ReactNode) => number;
5
5
  getEntities: () => Entity[];
6
6
  };
package/dist/system.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { ReactEcs } from './react-ecs';
2
2
  /**
3
3
  * @public
4
4
  */
5
- export type UiComponent = () => ReactEcs.JSX.Element;
5
+ export type UiComponent = () => ReactEcs.JSX.ReactNode;
6
6
  /**
7
7
  * @public
8
8
  */
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dcl/react-ecs",
3
3
  "description": "Decentraland ECS",
4
- "version": "7.4.22-9129040248.commit-e3dda7a",
4
+ "version": "7.4.22-9160893926.commit-529e3f0",
5
5
  "author": "DCL",
6
6
  "bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
7
7
  "dependencies": {
8
- "@dcl/ecs": "7.4.22-9129040248.commit-e3dda7a",
8
+ "@dcl/ecs": "7.4.22-9160893926.commit-529e3f0",
9
9
  "react": "^18.2.0",
10
10
  "react-reconciler": "^0.29.0"
11
11
  },
@@ -30,7 +30,8 @@
30
30
  "directory": "packages/@dcl/react-ecs"
31
31
  },
32
32
  "scripts": {
33
- "build": "tsc -p tsconfig.json"
33
+ "build": "tsc -p tsconfig.json",
34
+ "start": "tsc -p tsconfig.json --watch"
34
35
  },
35
36
  "typedoc": {
36
37
  "entryPoint": "./src/index.ts",
@@ -39,5 +40,5 @@
39
40
  "tsconfig": "./tsconfig.json"
40
41
  },
41
42
  "types": "./dist/index.d.ts",
42
- "commit": "e3dda7a1f36ae94c353ebe89012353b9e0d7c87b"
43
+ "commit": "529e3f0ff5259e0ce2c9dd13d308194cf44d1507"
43
44
  }