@dcl/react-ecs 7.25.1-30447792919.commit-c06a494 → 7.25.1-30570000030.commit-eaa1fa5

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 { PBUiInputBinding } from '@dcl/ecs';
1
2
  import { ReactEcs } from '../react-ecs';
2
3
  import { Listeners } from './listeners/types';
3
4
  import { UiBackgroundProps } from './uiBackground/types';
@@ -11,6 +12,8 @@ export interface EntityPropTypes extends Listeners {
11
12
  uiTransform?: UiTransformProps;
12
13
  /** To define a background color or image */
13
14
  uiBackground?: UiBackgroundProps;
15
+ /** Bind input actions to this element, held down while it's pressed (touch or pointer) */
16
+ uiInputBinding?: PBUiInputBinding;
14
17
  /** Uinique key to identiy elments when iterating arrays */
15
18
  key?: Key;
16
19
  }
@@ -1,4 +1,4 @@
1
- import { PBUiBackground, PBUiText, PBUiTransform, PBUiInput, PBUiDropdown } from '@dcl/ecs';
1
+ import { PBUiBackground, PBUiText, PBUiTransform, PBUiInput, PBUiDropdown, PBUiInputBinding } from '@dcl/ecs';
2
2
  import { Callback, Key } from './components';
3
3
  /**
4
4
  * @public
@@ -18,6 +18,7 @@ export type EntityComponents = {
18
18
  uiBackground: PBUiBackground;
19
19
  uiInput: PBUiInput;
20
20
  uiDropdown: PBUiDropdown;
21
+ uiInputBinding: PBUiInputBinding;
21
22
  onMouseDown: Callback;
22
23
  onMouseUp: Callback;
23
24
  onMouseEnter: Callback;
@@ -29,13 +29,15 @@ export function createReconciler(engine, pointerEvents) {
29
29
  const UiInputResult = components.UiInputResult(engine);
30
30
  const UiDropdown = components.UiDropdown(engine);
31
31
  const UiDropdownResult = components.UiDropdownResult(engine);
32
+ const UiInputBinding = components.UiInputBinding(engine);
32
33
  // Component ID Helper
33
34
  const getComponentId = {
34
35
  uiTransform: UiTransform.componentId,
35
36
  uiText: UiText.componentId,
36
37
  uiBackground: UiBackground.componentId,
37
38
  uiInput: UiInput.componentId,
38
- uiDropdown: UiDropdown.componentId
39
+ uiDropdown: UiDropdown.componentId,
40
+ uiInputBinding: UiInputBinding.componentId
39
41
  };
40
42
  function pointerEventCallback(entity, pointerEvent) {
41
43
  const callback = clickEvents.get(entity)?.get(pointerEvent);
@@ -50,7 +50,8 @@ const entityComponent = {
50
50
  onMouseEnter: undefined,
51
51
  onMouseLeave: undefined,
52
52
  uiInput: undefined,
53
- uiDropdown: undefined
53
+ uiDropdown: undefined,
54
+ uiInputBinding: undefined
54
55
  };
55
56
  export const componentKeys = Object.keys(entityComponent);
56
57
  export function isEqual(val1, val2) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dcl/react-ecs",
3
3
  "description": "Decentraland ECS",
4
- "version": "7.25.1-30447792919.commit-c06a494",
4
+ "version": "7.25.1-30570000030.commit-eaa1fa5",
5
5
  "author": "DCL",
6
6
  "bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
7
7
  "dependencies": {
8
- "@dcl/ecs": "7.25.1-30447792919.commit-c06a494",
8
+ "@dcl/ecs": "7.25.1-30570000030.commit-eaa1fa5",
9
9
  "react": "^18.2.0",
10
10
  "react-reconciler": "^0.29.0"
11
11
  },
@@ -40,5 +40,5 @@
40
40
  "tsconfig": "./tsconfig.json"
41
41
  },
42
42
  "types": "./dist/index.d.ts",
43
- "commit": "c06a4949a4e3dd50ed906d35304aefa6baebfc0d"
43
+ "commit": "eaa1fa58d4deeb7a4102151ad91bd857be38023b"
44
44
  }