@dcl/playground-assets 7.0.6-3942933325.commit-70f967f → 7.0.6-3987590195.commit-4fc1536

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/sdk",
3
- "version": "7.0.6-3942933325.commit-70f967f",
3
+ "version": "7.0.6-3987590195.commit-4fc1536",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -37,5 +37,5 @@
37
37
  "displayName": "SDK",
38
38
  "tsconfig": "./tsconfig.json"
39
39
  },
40
- "commit": "70f967f506b6e27be0877901c693a1d5089b1bf4"
40
+ "commit": "4fc1536e9bdd2501b3d9918ec7345084f7a49aca"
41
41
  }
@@ -1,4 +1,4 @@
1
- import { engine, YGFlexDirection, BackgroundTextureMode } from '@dcl/sdk/ecs'
1
+ import { engine } from '@dcl/sdk/ecs'
2
2
  import { Color4 } from '@dcl/sdk/math'
3
3
  import ReactEcs, {
4
4
  UiEntity,
@@ -34,7 +34,7 @@ const options = [
34
34
  }}
35
35
  uiBackground={{
36
36
  color: tint2,
37
- textureMode: BackgroundTextureMode.STRETCH,
37
+ textureMode: 'stretch',
38
38
  texture: {
39
39
  src
40
40
  }
@@ -58,7 +58,7 @@ const options = [
58
58
  }}
59
59
  uiBackground={{
60
60
  color: tint,
61
- textureMode: BackgroundTextureMode.NINE_SLICES,
61
+ textureMode: 'nine-slices',
62
62
  texture: {
63
63
  src
64
64
  }
@@ -87,7 +87,7 @@ const options = [
87
87
  }}
88
88
  uiBackground={{
89
89
  color: tint,
90
- textureMode: BackgroundTextureMode.NINE_SLICES,
90
+ textureMode: 'nine-slices',
91
91
  texture: {
92
92
  src: centeredImage
93
93
  }
@@ -107,7 +107,7 @@ const options = [
107
107
  height: 256
108
108
  }}
109
109
  uiBackground={{
110
- textureMode: BackgroundTextureMode.NINE_SLICES,
110
+ textureMode: 'nine-slices',
111
111
  texture: {
112
112
  src: centeredImage
113
113
  },
@@ -135,7 +135,7 @@ const options = [
135
135
  height: 128 + Math.sin(dt * 0.2) * 64
136
136
  }}
137
137
  uiBackground={{
138
- textureMode: BackgroundTextureMode.CENTER,
138
+ textureMode: 'center',
139
139
  texture: {
140
140
  src: centeredImage
141
141
  }
@@ -153,7 +153,7 @@ const options = [
153
153
  height: 128 + Math.sin(dt * 0.2) * 64
154
154
  }}
155
155
  uiBackground={{
156
- textureMode: BackgroundTextureMode.CENTER,
156
+ textureMode: 'center',
157
157
  avatarTexture: {
158
158
  userId: userId ?? ''
159
159
  }
@@ -177,7 +177,7 @@ export const ui = () => {
177
177
  uiTransform={{
178
178
  width: '100%',
179
179
  height: '50%',
180
- flexDirection: YGFlexDirection.YGFD_COLUMN,
180
+ flexDirection: 'column',
181
181
  margin: { left: 300 }
182
182
  }}
183
183
  uiBackground={{ color: Color4.Black() }}
@@ -1,10 +1,24 @@
1
- import {
2
- YGFlexDirection,
3
- } from '@dcl/sdk/ecs'
4
1
  import { Color4 } from '@dcl/sdk/math'
5
- import ReactEcs, { UiEntity, Label, ReactEcsRenderer, Dropdown } from '@dcl/sdk/react-ecs'
2
+ import ReactEcs, {
3
+ UiEntity,
4
+ Label,
5
+ ReactEcsRenderer,
6
+ Dropdown
7
+ } from '@dcl/sdk/react-ecs'
6
8
 
7
- const colorList = ['Red', 'Green', 'Blue', 'Black', 'White', 'Purple', 'Magenta', 'Yellow', 'Gray', 'Teal', 'Clear']
9
+ const colorList = [
10
+ 'Red',
11
+ 'Green',
12
+ 'Blue',
13
+ 'Black',
14
+ 'White',
15
+ 'Purple',
16
+ 'Magenta',
17
+ 'Yellow',
18
+ 'Gray',
19
+ 'Teal',
20
+ 'Clear'
21
+ ]
8
22
 
9
23
  let selectedColorIndex = 0
10
24
 
@@ -16,17 +30,16 @@ export const ui = () => {
16
30
  return (
17
31
  <UiEntity
18
32
  uiTransform={{
19
- width: "100%",
20
- height: "3000px",
21
- flexDirection: YGFlexDirection.YGFD_COLUMN
33
+ width: '100%',
34
+ height: '3000px',
35
+ flexDirection: 'column'
22
36
  }}
23
37
  uiBackground={{ color: (Color4 as any)[colorList[selectedColorIndex]]() }}
24
38
  >
25
- <Label value="Select a color" fontSize={29} />
39
+ <Label value="Select a color" fontSize={29} />
26
40
  <Dropdown options={colorList} onChange={selectOption} />
27
41
  </UiEntity>
28
42
  )
29
43
  }
30
44
 
31
-
32
45
  ReactEcsRenderer.setUiRenderer(ui)
@@ -7,9 +7,6 @@ import {
7
7
  InputAction,
8
8
  inputSystem,
9
9
  PointerEvents,
10
- YGAlign,
11
- YGDisplay,
12
- YGJustify,
13
10
  PointerEventType
14
11
  } from '@dcl/sdk/ecs'
15
12
  import { Vector3, Color4, Quaternion } from '@dcl/sdk/math'
@@ -30,9 +27,9 @@ export const uiComponent = () => (
30
27
  uiTransform={{
31
28
  width: '100%',
32
29
  height: '20%',
33
- justifyContent: YGJustify.YGJ_CENTER,
34
- alignItems: YGAlign.YGA_CENTER,
35
- display: YGDisplay.YGD_FLEX
30
+ justifyContent: 'center',
31
+ alignItems: 'center',
32
+ display: 'flex'
36
33
  }}
37
34
  >
38
35
  <Label
@@ -45,9 +42,9 @@ export const uiComponent = () => (
45
42
  uiTransform={{
46
43
  width: '100%',
47
44
  height: '20%',
48
- justifyContent: YGJustify.YGJ_CENTER,
49
- alignItems: YGAlign.YGA_CENTER,
50
- display: YGDisplay.YGD_FLEX
45
+ justifyContent: 'center',
46
+ alignItems: 'center',
47
+ display: 'flex'
51
48
  }}
52
49
  >
53
50
  <Label
@@ -60,9 +57,9 @@ export const uiComponent = () => (
60
57
  uiTransform={{
61
58
  width: '100%',
62
59
  height: '100px',
63
- justifyContent: YGJustify.YGJ_CENTER,
64
- alignItems: YGAlign.YGA_CENTER,
65
- display: YGDisplay.YGD_FLEX
60
+ justifyContent: 'center',
61
+ alignItems: 'center',
62
+ display: 'flex'
66
63
  }}
67
64
  >
68
65
  <Label
@@ -1,5 +1,10 @@
1
1
  import _m0 from 'protobufjs/minimal';
2
2
 
3
+ /**
4
+ * @public
5
+ */
6
+ export declare type AlignType = 'auto' | 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline' | 'space-between' | 'space-around';
7
+
3
8
  export declare const AMOUNT_VERSION_AVAILABLE: number;
4
9
 
5
10
  export declare const Animator: AnimatorComponentDefinitionExtended;
@@ -1247,6 +1252,11 @@ export declare type DeleteEntityMessageBody = {
1247
1252
  entityId: Entity;
1248
1253
  };
1249
1254
 
1255
+ /**
1256
+ * @public
1257
+ */
1258
+ export declare type DisplayType = 'flex' | 'none';
1259
+
1250
1260
  /**
1251
1261
  * @public
1252
1262
  */
@@ -1369,6 +1379,16 @@ export declare type ExcludeUndefined<T> = {
1369
1379
  */
1370
1380
  export declare const executeTask: (task: Task<unknown>) => void;
1371
1381
 
1382
+ /**
1383
+ * @public
1384
+ */
1385
+ export declare type FlexDirectionType = 'row' | 'column' | 'column-reverse' | 'row-reverse';
1386
+
1387
+ /**
1388
+ * @public
1389
+ */
1390
+ export declare type FlexWrapType = 'wrap' | 'nowrap' | 'wrap-reverse';
1391
+
1372
1392
  /** @public */
1373
1393
  export declare type FloatArray = number[];
1374
1394
 
@@ -1810,12 +1830,17 @@ export declare namespace JSX {
1810
1830
  }
1811
1831
  }
1812
1832
 
1833
+ /**
1834
+ * @public
1835
+ */
1836
+ export declare type JustifyType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
1837
+
1813
1838
  export declare type Key = number | string;
1814
1839
 
1815
1840
  /**
1816
1841
  * @public
1817
1842
  */
1818
- export declare function Label(props: EntityPropTypes & UiTextProps): ReactEcs.JSX.Element;
1843
+ export declare function Label(props: EntityPropTypes & UiLabelProps): ReactEcs.JSX.Element;
1819
1844
 
1820
1845
  export declare type Listeners = {
1821
1846
  onMouseDown?: Callback;
@@ -2865,6 +2890,11 @@ export declare const onVideoEvent: Observable<{
2865
2890
  totalVideoLength: number;
2866
2891
  }>;
2867
2892
 
2893
+ /**
2894
+ * @public
2895
+ */
2896
+ export declare type OverflowType = 'hidden' | 'scroll' | 'visible';
2897
+
2868
2898
  export declare interface PBAnimationState {
2869
2899
  name: string;
2870
2900
  clip: string;
@@ -3893,6 +3923,11 @@ export declare type Position = {
3893
3923
  left: PositionUnit;
3894
3924
  };
3895
3925
 
3926
+ /**
3927
+ * @public
3928
+ */
3929
+ export declare type PositionType = 'absolute' | 'relative';
3930
+
3896
3931
  export declare type PositionUnit = `${number}px` | `${number}%` | number;
3897
3932
 
3898
3933
  export declare type PutComponentMessage = CrdtMessageHeader & PutComponentMessageBody;
@@ -4517,6 +4552,11 @@ export declare const enum TextAlignMode {
4517
4552
  TAM_BOTTOM_RIGHT = 8
4518
4553
  }
4519
4554
 
4555
+ /**
4556
+ * @public
4557
+ */
4558
+ export declare type TextAlignType = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
4559
+
4520
4560
  /** @public */
4521
4561
  export declare const TextShape: ComponentDefinition<PBTextShape>;
4522
4562
 
@@ -4542,6 +4582,11 @@ export declare const enum TextureFilterMode {
4542
4582
  TFM_TRILINEAR = 2
4543
4583
  }
4544
4584
 
4585
+ /**
4586
+ * @public
4587
+ */
4588
+ export declare type TextureFilterType = 'point' | 'bi-linear' | 'tri-linear';
4589
+
4545
4590
  /**
4546
4591
  * @public
4547
4592
  */
@@ -4556,6 +4601,22 @@ export declare type TextureHelper = {
4556
4601
  Avatar: (avatarTexture: AvatarTexture) => TextureUnion;
4557
4602
  };
4558
4603
 
4604
+ /**
4605
+ * @public
4606
+ * NINE_SLICES - https://docs.unity3d.com/Manual/UIE-USS-SupportedProperties.html (Slicing section)
4607
+ * https://forum.unity.com/threads/how-does-slicing-in-ui-tookkit-works.1235863/
4608
+ * https://docs.unity3d.com/Manual/9SliceSprites.html
4609
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-slice
4610
+
4611
+ * CENTER - CENTER enables the texture to be rendered centered in relation to the
4612
+ * element. If the element is smaller than the texture then the background
4613
+ * should use the element as stencil to cut off the out-of-bounds area
4614
+
4615
+ * STRETCH - STRETCH enables the texture to cover all the area of the container,
4616
+ * adopting its aspect ratio.
4617
+ */
4618
+ export declare type TextureMode = 'nine-slices' | 'center' | 'stretch';
4619
+
4559
4620
  export declare interface TextureUnion {
4560
4621
  tex?: {
4561
4622
  $case: "texture";
@@ -4581,6 +4642,11 @@ export declare const enum TextureWrapMode {
4581
4642
  TWM_MIRROR_ONCE = 3
4582
4643
  }
4583
4644
 
4645
+ /**
4646
+ * @public
4647
+ */
4648
+ export declare type TextureWrapType = 'repeat' | 'clamp' | 'mirror' | 'mirror-once';
4649
+
4584
4650
  /**
4585
4651
  * Constant used to convert a value to gamma space
4586
4652
  * @public
@@ -4650,7 +4716,11 @@ export declare type TransportMessage = Omit<ReceiveMessage, 'data'>;
4650
4716
  * @public
4651
4717
  */
4652
4718
  export declare type UiAvatarTexture = {
4653
- avatarTexture?: AvatarTexture;
4719
+ avatarTexture?: {
4720
+ userId: string;
4721
+ wrapMode?: TextureWrapType;
4722
+ filterMode?: TextureFilterType;
4723
+ };
4654
4724
  };
4655
4725
 
4656
4726
  /** @public */
@@ -4659,12 +4729,17 @@ export declare const UiBackground: ComponentDefinition<PBUiBackground>;
4659
4729
  /**
4660
4730
  * @public
4661
4731
  */
4662
- export declare type UiBackgroundProps = Partial<Omit<PBUiBackground, 'texture'>> & UiTextureUnion;
4732
+ export declare type UiBackgroundProps = {
4733
+ color?: PBColor4 | undefined;
4734
+ textureMode?: TextureMode;
4735
+ textureSlices?: BorderRect | undefined;
4736
+ uvs?: number[];
4737
+ } & UiTextureUnion;
4663
4738
 
4664
4739
  /**
4665
4740
  * @public
4666
4741
  */
4667
- export declare type UiButtonProps = PBUiText & {
4742
+ export declare type UiButtonProps = UiLabelProps & {
4668
4743
  type?: 'primary' | 'secondary';
4669
4744
  };
4670
4745
 
@@ -4676,8 +4751,10 @@ export declare const UiDropdown: ComponentDefinition<PBUiDropdown>;
4676
4751
  /**
4677
4752
  * @public
4678
4753
  */
4679
- export declare type UiDropdownProps = Partial<PBUiDropdown> & {
4754
+ export declare type UiDropdownProps = Partial<Omit<PBUiDropdown, 'textAlign' | 'font'>> & {
4680
4755
  onChange?(value: number): void;
4756
+ font?: UiFontType;
4757
+ textAlign?: TextAlignType;
4681
4758
  };
4682
4759
 
4683
4760
  /** @public */
@@ -4688,19 +4765,36 @@ export declare const UiDropdownResult: ComponentDefinition<PBUiDropdownResult>;
4688
4765
  */
4689
4766
  export declare function UiEntity(props: EntityPropTypes & Partial<CommonProps>): ReactEcs.JSX.Element;
4690
4767
 
4768
+ /**
4769
+ * @public
4770
+ */
4771
+ export declare type UiFontType = 'sans-serif' | 'serif' | 'monospace';
4772
+
4691
4773
  /** @public */
4692
4774
  export declare const UiInput: ComponentDefinition<PBUiInput>;
4693
4775
 
4694
4776
  /**
4695
4777
  * @public
4696
4778
  */
4697
- export declare type UiInputProps = PBUiInput & {
4779
+ export declare type UiInputProps = Omit<PBUiInput, 'font' | 'textAlign'> & {
4698
4780
  onChange?(value: string): void;
4781
+ font?: UiFontType;
4782
+ textAlign?: TextAlignType;
4699
4783
  };
4700
4784
 
4701
4785
  /** @public */
4702
4786
  export declare const UiInputResult: ComponentDefinition<PBUiInputResult>;
4703
4787
 
4788
+ /**
4789
+ * @public
4790
+ */
4791
+ export declare type UiLabelProps = Omit<PBUiText, 'textAlign' | 'font'> & {
4792
+ /** default='middle-center' */
4793
+ textAlign?: TextAlignType | undefined;
4794
+ /** default='sans-serif' */
4795
+ font?: UiFontType | undefined;
4796
+ };
4797
+
4704
4798
  export declare type Uint32 = number;
4705
4799
 
4706
4800
  /**
@@ -4711,16 +4805,15 @@ export declare type uint32 = number;
4711
4805
  /** @public */
4712
4806
  export declare const UiText: ComponentDefinition<PBUiText>;
4713
4807
 
4714
- /**
4715
- * @public
4716
- */
4717
- export declare type UiTextProps = PBUiText;
4718
-
4719
4808
  /**
4720
4809
  * @public
4721
4810
  */
4722
4811
  export declare type UiTexture = {
4723
- texture?: Texture;
4812
+ texture?: {
4813
+ src: string;
4814
+ wrapMode?: TextureWrapType;
4815
+ filterMode?: TextureFilterType;
4816
+ };
4724
4817
  };
4725
4818
 
4726
4819
  /**
@@ -4735,14 +4828,14 @@ export declare const UiTransform: ComponentDefinition<PBUiTransform>;
4735
4828
  * @public
4736
4829
  */
4737
4830
  export declare interface UiTransformProps {
4738
- display?: YGDisplay;
4831
+ display?: DisplayType;
4739
4832
  flex?: number;
4740
- justifyContent?: YGJustify;
4741
- positionType?: YGPositionType;
4742
- alignItems?: YGAlign;
4743
- alignSelf?: YGAlign;
4744
- alignContent?: YGAlign;
4745
- flexDirection?: YGFlexDirection;
4833
+ justifyContent?: JustifyType;
4834
+ positionType?: PositionType;
4835
+ alignItems?: AlignType;
4836
+ alignSelf?: AlignType;
4837
+ alignContent?: AlignType;
4838
+ flexDirection?: FlexDirectionType;
4746
4839
  position?: Partial<Position>;
4747
4840
  padding?: Partial<Position>;
4748
4841
  margin?: Partial<Position>;
@@ -4752,11 +4845,11 @@ export declare interface UiTransformProps {
4752
4845
  maxWidth?: PositionUnit;
4753
4846
  minHeight?: PositionUnit;
4754
4847
  maxHeight?: PositionUnit;
4755
- flexWrap?: YGWrap;
4848
+ flexWrap?: FlexWrapType;
4756
4849
  flexBasis?: number;
4757
4850
  flexGrow?: number;
4758
4851
  flexShrink?: number;
4759
- overflow?: YGOverflow;
4852
+ overflow?: OverflowType;
4760
4853
  }
4761
4854
 
4762
4855
  /**