@dcl/react-ecs 7.5.7-10236687718.commit-e3a6b5c → 7.5.7-10267169352.commit-af4dbfa
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/dist/components/Label/index.js +1 -3
- package/dist/components/Label/types.d.ts +0 -4
- package/dist/components/uiTransform/index.d.ts +1 -1
- package/dist/components/uiTransform/index.js +4 -7
- package/dist/components/uiTransform/types.d.ts +0 -14
- package/dist/components/uiTransform/utils.js +0 -37
- package/dist/reconciler/index.js +0 -3
- package/package.json +3 -3
|
@@ -29,9 +29,7 @@ export function Label(props) {
|
|
|
29
29
|
...getFont(font),
|
|
30
30
|
...getTextAlign(textAlign),
|
|
31
31
|
...getFontSize(fontSize),
|
|
32
|
-
...getTextWrap(textWrap)
|
|
33
|
-
outlineWidth: props.outlineWidth,
|
|
34
|
-
outlineColor: props.outlineColor
|
|
32
|
+
...getTextWrap(textWrap)
|
|
35
33
|
};
|
|
36
34
|
return ReactEcs.createElement("entity", { ...commonProps, uiText: uiText });
|
|
37
35
|
}
|
|
@@ -15,10 +15,6 @@ export interface UiLabelProps {
|
|
|
15
15
|
textAlign?: TextAlignType | undefined;
|
|
16
16
|
/** Label font type. @defaultValue 'sans-serif' */
|
|
17
17
|
font?: UiFontType | undefined;
|
|
18
|
-
/** Outline width of the text. @defaultValue 0 */
|
|
19
|
-
outlineWidth?: number | undefined;
|
|
20
|
-
/** Outline color of the text. @defaultValue `{ r: 0, g: 0, b: 0, a: 1 }` */
|
|
21
|
-
outlineColor?: Color4 | undefined;
|
|
22
18
|
/** Behaviour when text reached. @defaultValue 'wrap' */
|
|
23
19
|
textWrap?: UiTextWrapType | undefined;
|
|
24
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAlign, getDisplay, getFlexDirection, getFlexWrap, getJustify, getOverflow, getPointerFilter, getPositionType,
|
|
1
|
+
import { getAlign, getDisplay, getFlexDirection, getFlexWrap, getJustify, getOverflow, getPointerFilter, getPositionType, parsePosition, parseSize } from './utils';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
@@ -51,15 +51,14 @@ const defaultUiTransform = {
|
|
|
51
51
|
flexBasisUnit: 0 /* YGUnit.YGU_UNDEFINED */,
|
|
52
52
|
widthUnit: 3 /* YGUnit.YGU_AUTO */,
|
|
53
53
|
heightUnit: 0 /* YGUnit.YGU_UNDEFINED */,
|
|
54
|
-
pointerFilter: 0 /* PointerFilterMode.PFM_NONE
|
|
55
|
-
opacity: 1
|
|
54
|
+
pointerFilter: 0 /* PointerFilterMode.PFM_NONE */
|
|
56
55
|
};
|
|
57
56
|
/**
|
|
58
57
|
* @public
|
|
59
58
|
*/
|
|
60
59
|
/* @__PURE__ */
|
|
61
60
|
export function parseUiTransform(props = {}) {
|
|
62
|
-
const {
|
|
61
|
+
const { height, minHeight, maxHeight, width, minWidth, maxWidth, alignItems, alignContent, flexWrap, ...otherProps } = props;
|
|
63
62
|
return {
|
|
64
63
|
...defaultUiTransform,
|
|
65
64
|
...otherProps,
|
|
@@ -82,8 +81,6 @@ export function parseUiTransform(props = {}) {
|
|
|
82
81
|
// Optional values
|
|
83
82
|
...(alignContent && getAlign('alignContent', alignContent)),
|
|
84
83
|
...(alignItems && getAlign('alignItems', alignItems)),
|
|
85
|
-
...(flexWrap && getFlexWrap(flexWrap))
|
|
86
|
-
...(scrollPosition && getScrollPosition(scrollPosition)),
|
|
87
|
-
...(scrollVisible && getScrollVisible(scrollVisible))
|
|
84
|
+
...(flexWrap && getFlexWrap(flexWrap))
|
|
88
85
|
};
|
|
89
86
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Vector2 } from '@dcl/ecs/dist/components/generated/pb/decentraland/common/vectors.gen';
|
|
2
1
|
import { ScaleUnit } from '../types';
|
|
3
2
|
/**
|
|
4
3
|
* unit value specified. i.e. 1 || '100%' || '1px' || '10vw'
|
|
@@ -63,11 +62,6 @@ export type PositionType = 'absolute' | 'relative';
|
|
|
63
62
|
* The pointer filter property determines if the ui element blocks the pointer or not (elements with pointer events always block the pointer regardless of this property)
|
|
64
63
|
*/
|
|
65
64
|
export type PointerFilterType = 'none' | 'block';
|
|
66
|
-
/**
|
|
67
|
-
* @public
|
|
68
|
-
* The scroll-visible determines if the scrollbars are shown when the scroll overflow is enabled
|
|
69
|
-
*/
|
|
70
|
-
export type ScrollVisibleType = 'horizontal' | 'vertical' | 'both' | 'hidden';
|
|
71
65
|
/**
|
|
72
66
|
* Layout props to position things in the canvas
|
|
73
67
|
* @public
|
|
@@ -119,12 +113,4 @@ export interface UiTransformProps {
|
|
|
119
113
|
overflow?: OverflowType;
|
|
120
114
|
/** The pointer filter property determines if the ui element blocks the pointer or not (elements with pointer events always block the pointer regardless of this property) **/
|
|
121
115
|
pointerFilter?: PointerFilterType;
|
|
122
|
-
/** The opacity property sets the opacity level for an element, it's accumulated across children @defaultValue 1 */
|
|
123
|
-
opacity?: number;
|
|
124
|
-
/** A reference value to identify the element, default empty */
|
|
125
|
-
elementId?: string;
|
|
126
|
-
/** default position=(0,0) if it aplies, a vector or a reference-id */
|
|
127
|
-
scrollPosition?: Vector2 | string;
|
|
128
|
-
/** default ShowScrollBar.SSB_BOTH */
|
|
129
|
-
scrollVisible?: ScrollVisibleType;
|
|
130
116
|
}
|
|
@@ -184,40 +184,3 @@ const parsePointerFilter = {
|
|
|
184
184
|
none: 0 /* PointerFilterMode.PFM_NONE */,
|
|
185
185
|
block: 1 /* PointerFilterMode.PFM_BLOCK */
|
|
186
186
|
};
|
|
187
|
-
/**
|
|
188
|
-
* @internal
|
|
189
|
-
*/
|
|
190
|
-
export function getScrollPosition(scrollPosition) {
|
|
191
|
-
if (typeof scrollPosition === 'string') {
|
|
192
|
-
return {
|
|
193
|
-
scrollPosition: {
|
|
194
|
-
value: {
|
|
195
|
-
$case: 'reference',
|
|
196
|
-
reference: scrollPosition
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
return {
|
|
203
|
-
scrollPosition: {
|
|
204
|
-
value: {
|
|
205
|
-
$case: 'position',
|
|
206
|
-
position: scrollPosition
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
const parseScrollVisible = {
|
|
213
|
-
both: 0 /* ShowScrollBar.SSB_BOTH */,
|
|
214
|
-
hidden: 3 /* ShowScrollBar.SSB_HIDDEN */,
|
|
215
|
-
horizontal: 2 /* ShowScrollBar.SSB_ONLY_HORIZONTAL */,
|
|
216
|
-
vertical: 1 /* ShowScrollBar.SSB_ONLY_VERTICAL */
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* @internal
|
|
220
|
-
*/
|
|
221
|
-
export function getScrollVisible(scrollVisible) {
|
|
222
|
-
return { scrollVisible: parseScrollVisible[scrollVisible] };
|
|
223
|
-
}
|
package/dist/reconciler/index.js
CHANGED
|
@@ -24,7 +24,6 @@ export function createReconciler(engine, pointerEvents) {
|
|
|
24
24
|
const UiInputResult = components.UiInputResult(engine);
|
|
25
25
|
const UiDropdown = components.UiDropdown(engine);
|
|
26
26
|
const UiDropdownResult = components.UiDropdownResult(engine);
|
|
27
|
-
const UiScrollResult = components.UiScrollResult(engine);
|
|
28
27
|
// Component ID Helper
|
|
29
28
|
const getComponentId = {
|
|
30
29
|
uiTransform: UiTransform.componentId,
|
|
@@ -258,8 +257,6 @@ export function createReconciler(engine, pointerEvents) {
|
|
|
258
257
|
if (changeEvents.size) {
|
|
259
258
|
handleOnChange(UiInput.componentId, UiInputResult);
|
|
260
259
|
handleOnChange(UiDropdown.componentId, UiDropdownResult);
|
|
261
|
-
// TODO: maybe as componentId could be a virtual id since the scroll input doesn't exist
|
|
262
|
-
handleOnChange(UiTransform.componentId, UiScrollResult);
|
|
263
260
|
}
|
|
264
261
|
return reconciler.updateContainer(component, root, null);
|
|
265
262
|
},
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/react-ecs",
|
|
3
3
|
"description": "Decentraland ECS",
|
|
4
|
-
"version": "7.5.7-
|
|
4
|
+
"version": "7.5.7-10267169352.commit-af4dbfa",
|
|
5
5
|
"author": "DCL",
|
|
6
6
|
"bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@dcl/ecs": "7.5.7-
|
|
8
|
+
"@dcl/ecs": "7.5.7-10267169352.commit-af4dbfa",
|
|
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": "
|
|
43
|
+
"commit": "af4dbfa01fd10db6aaf7e84e454756fc601e330a"
|
|
44
44
|
}
|