@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,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;
@@ -1235,6 +1240,11 @@ export declare type DeleteEntityMessageBody = {
1235
1240
  entityId: Entity;
1236
1241
  };
1237
1242
 
1243
+ /**
1244
+ * @public
1245
+ */
1246
+ export declare type DisplayType = 'flex' | 'none';
1247
+
1238
1248
  /**
1239
1249
  * @public
1240
1250
  */
@@ -1357,6 +1367,16 @@ export declare type ExcludeUndefined<T> = {
1357
1367
  */
1358
1368
  export declare const executeTask: (task: Task<unknown>) => void;
1359
1369
 
1370
+ /**
1371
+ * @public
1372
+ */
1373
+ export declare type FlexDirectionType = 'row' | 'column' | 'column-reverse' | 'row-reverse';
1374
+
1375
+ /**
1376
+ * @public
1377
+ */
1378
+ export declare type FlexWrapType = 'wrap' | 'nowrap' | 'wrap-reverse';
1379
+
1360
1380
  /** @public */
1361
1381
  export declare type FloatArray = number[];
1362
1382
 
@@ -1798,12 +1818,17 @@ export declare namespace JSX {
1798
1818
  }
1799
1819
  }
1800
1820
 
1821
+ /**
1822
+ * @public
1823
+ */
1824
+ export declare type JustifyType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
1825
+
1801
1826
  export declare type Key = number | string;
1802
1827
 
1803
1828
  /**
1804
1829
  * @public
1805
1830
  */
1806
- export declare function Label(props: EntityPropTypes & UiTextProps): ReactEcs.JSX.Element;
1831
+ export declare function Label(props: EntityPropTypes & UiLabelProps): ReactEcs.JSX.Element;
1807
1832
 
1808
1833
  export declare type Listeners = {
1809
1834
  onMouseDown?: Callback;
@@ -2853,6 +2878,11 @@ export declare const onVideoEvent: Observable<{
2853
2878
  totalVideoLength: number;
2854
2879
  }>;
2855
2880
 
2881
+ /**
2882
+ * @public
2883
+ */
2884
+ export declare type OverflowType = 'hidden' | 'scroll' | 'visible';
2885
+
2856
2886
  export declare interface PBAnimationState {
2857
2887
  name: string;
2858
2888
  clip: string;
@@ -3881,6 +3911,11 @@ export declare type Position = {
3881
3911
  left: PositionUnit;
3882
3912
  };
3883
3913
 
3914
+ /**
3915
+ * @public
3916
+ */
3917
+ export declare type PositionType = 'absolute' | 'relative';
3918
+
3884
3919
  export declare type PositionUnit = `${number}px` | `${number}%` | number;
3885
3920
 
3886
3921
  export declare type PutComponentMessage = CrdtMessageHeader & PutComponentMessageBody;
@@ -4505,6 +4540,11 @@ export declare const enum TextAlignMode {
4505
4540
  TAM_BOTTOM_RIGHT = 8
4506
4541
  }
4507
4542
 
4543
+ /**
4544
+ * @public
4545
+ */
4546
+ export declare type TextAlignType = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
4547
+
4508
4548
  /** @public */
4509
4549
  export declare const TextShape: ComponentDefinition<PBTextShape>;
4510
4550
 
@@ -4530,6 +4570,11 @@ export declare const enum TextureFilterMode {
4530
4570
  TFM_TRILINEAR = 2
4531
4571
  }
4532
4572
 
4573
+ /**
4574
+ * @public
4575
+ */
4576
+ export declare type TextureFilterType = 'point' | 'bi-linear' | 'tri-linear';
4577
+
4533
4578
  /**
4534
4579
  * @public
4535
4580
  */
@@ -4544,6 +4589,22 @@ export declare type TextureHelper = {
4544
4589
  Avatar: (avatarTexture: AvatarTexture) => TextureUnion;
4545
4590
  };
4546
4591
 
4592
+ /**
4593
+ * @public
4594
+ * NINE_SLICES - https://docs.unity3d.com/Manual/UIE-USS-SupportedProperties.html (Slicing section)
4595
+ * https://forum.unity.com/threads/how-does-slicing-in-ui-tookkit-works.1235863/
4596
+ * https://docs.unity3d.com/Manual/9SliceSprites.html
4597
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-slice
4598
+
4599
+ * CENTER - CENTER enables the texture to be rendered centered in relation to the
4600
+ * element. If the element is smaller than the texture then the background
4601
+ * should use the element as stencil to cut off the out-of-bounds area
4602
+
4603
+ * STRETCH - STRETCH enables the texture to cover all the area of the container,
4604
+ * adopting its aspect ratio.
4605
+ */
4606
+ export declare type TextureMode = 'nine-slices' | 'center' | 'stretch';
4607
+
4547
4608
  export declare interface TextureUnion {
4548
4609
  tex?: {
4549
4610
  $case: "texture";
@@ -4569,6 +4630,11 @@ export declare const enum TextureWrapMode {
4569
4630
  TWM_MIRROR_ONCE = 3
4570
4631
  }
4571
4632
 
4633
+ /**
4634
+ * @public
4635
+ */
4636
+ export declare type TextureWrapType = 'repeat' | 'clamp' | 'mirror' | 'mirror-once';
4637
+
4572
4638
  /**
4573
4639
  * Constant used to convert a value to gamma space
4574
4640
  * @public
@@ -4638,7 +4704,11 @@ export declare type TransportMessage = Omit<ReceiveMessage, 'data'>;
4638
4704
  * @public
4639
4705
  */
4640
4706
  export declare type UiAvatarTexture = {
4641
- avatarTexture?: AvatarTexture;
4707
+ avatarTexture?: {
4708
+ userId: string;
4709
+ wrapMode?: TextureWrapType;
4710
+ filterMode?: TextureFilterType;
4711
+ };
4642
4712
  };
4643
4713
 
4644
4714
  /** @public */
@@ -4647,12 +4717,17 @@ export declare const UiBackground: ComponentDefinition<PBUiBackground>;
4647
4717
  /**
4648
4718
  * @public
4649
4719
  */
4650
- export declare type UiBackgroundProps = Partial<Omit<PBUiBackground, 'texture'>> & UiTextureUnion;
4720
+ export declare type UiBackgroundProps = {
4721
+ color?: PBColor4 | undefined;
4722
+ textureMode?: TextureMode;
4723
+ textureSlices?: BorderRect | undefined;
4724
+ uvs?: number[];
4725
+ } & UiTextureUnion;
4651
4726
 
4652
4727
  /**
4653
4728
  * @public
4654
4729
  */
4655
- export declare type UiButtonProps = PBUiText & {
4730
+ export declare type UiButtonProps = UiLabelProps & {
4656
4731
  type?: 'primary' | 'secondary';
4657
4732
  };
4658
4733
 
@@ -4664,8 +4739,10 @@ export declare const UiDropdown: ComponentDefinition<PBUiDropdown>;
4664
4739
  /**
4665
4740
  * @public
4666
4741
  */
4667
- export declare type UiDropdownProps = Partial<PBUiDropdown> & {
4742
+ export declare type UiDropdownProps = Partial<Omit<PBUiDropdown, 'textAlign' | 'font'>> & {
4668
4743
  onChange?(value: number): void;
4744
+ font?: UiFontType;
4745
+ textAlign?: TextAlignType;
4669
4746
  };
4670
4747
 
4671
4748
  /** @public */
@@ -4676,19 +4753,36 @@ export declare const UiDropdownResult: ComponentDefinition<PBUiDropdownResult>;
4676
4753
  */
4677
4754
  export declare function UiEntity(props: EntityPropTypes & Partial<CommonProps>): ReactEcs.JSX.Element;
4678
4755
 
4756
+ /**
4757
+ * @public
4758
+ */
4759
+ export declare type UiFontType = 'sans-serif' | 'serif' | 'monospace';
4760
+
4679
4761
  /** @public */
4680
4762
  export declare const UiInput: ComponentDefinition<PBUiInput>;
4681
4763
 
4682
4764
  /**
4683
4765
  * @public
4684
4766
  */
4685
- export declare type UiInputProps = PBUiInput & {
4767
+ export declare type UiInputProps = Omit<PBUiInput, 'font' | 'textAlign'> & {
4686
4768
  onChange?(value: string): void;
4769
+ font?: UiFontType;
4770
+ textAlign?: TextAlignType;
4687
4771
  };
4688
4772
 
4689
4773
  /** @public */
4690
4774
  export declare const UiInputResult: ComponentDefinition<PBUiInputResult>;
4691
4775
 
4776
+ /**
4777
+ * @public
4778
+ */
4779
+ export declare type UiLabelProps = Omit<PBUiText, 'textAlign' | 'font'> & {
4780
+ /** default='middle-center' */
4781
+ textAlign?: TextAlignType | undefined;
4782
+ /** default='sans-serif' */
4783
+ font?: UiFontType | undefined;
4784
+ };
4785
+
4692
4786
  export declare type Uint32 = number;
4693
4787
 
4694
4788
  /**
@@ -4699,16 +4793,15 @@ export declare type uint32 = number;
4699
4793
  /** @public */
4700
4794
  export declare const UiText: ComponentDefinition<PBUiText>;
4701
4795
 
4702
- /**
4703
- * @public
4704
- */
4705
- export declare type UiTextProps = PBUiText;
4706
-
4707
4796
  /**
4708
4797
  * @public
4709
4798
  */
4710
4799
  export declare type UiTexture = {
4711
- texture?: Texture;
4800
+ texture?: {
4801
+ src: string;
4802
+ wrapMode?: TextureWrapType;
4803
+ filterMode?: TextureFilterType;
4804
+ };
4712
4805
  };
4713
4806
 
4714
4807
  /**
@@ -4723,14 +4816,14 @@ export declare const UiTransform: ComponentDefinition<PBUiTransform>;
4723
4816
  * @public
4724
4817
  */
4725
4818
  export declare interface UiTransformProps {
4726
- display?: YGDisplay;
4819
+ display?: DisplayType;
4727
4820
  flex?: number;
4728
- justifyContent?: YGJustify;
4729
- positionType?: YGPositionType;
4730
- alignItems?: YGAlign;
4731
- alignSelf?: YGAlign;
4732
- alignContent?: YGAlign;
4733
- flexDirection?: YGFlexDirection;
4821
+ justifyContent?: JustifyType;
4822
+ positionType?: PositionType;
4823
+ alignItems?: AlignType;
4824
+ alignSelf?: AlignType;
4825
+ alignContent?: AlignType;
4826
+ flexDirection?: FlexDirectionType;
4734
4827
  position?: Partial<Position>;
4735
4828
  padding?: Partial<Position>;
4736
4829
  margin?: Partial<Position>;
@@ -4740,11 +4833,11 @@ export declare interface UiTransformProps {
4740
4833
  maxWidth?: PositionUnit;
4741
4834
  minHeight?: PositionUnit;
4742
4835
  maxHeight?: PositionUnit;
4743
- flexWrap?: YGWrap;
4836
+ flexWrap?: FlexWrapType;
4744
4837
  flexBasis?: number;
4745
4838
  flexGrow?: number;
4746
4839
  flexShrink?: number;
4747
- overflow?: YGOverflow;
4840
+ overflow?: OverflowType;
4748
4841
  }
4749
4842
 
4750
4843
  /**
package/dist/index.js CHANGED
@@ -40696,12 +40696,110 @@
40696
40696
  [unitKey]: unit
40697
40697
  };
40698
40698
  }
40699
+ /**
40700
+ * @internal
40701
+ */
40702
+ function getDisplay(display) {
40703
+ const value = display ? parseDisplay[display] : 0 /* YGDisplay.YGD_FLEX */;
40704
+ return { display: value };
40705
+ }
40706
+ const parseDisplay = {
40707
+ flex: 0 /* YGDisplay.YGD_FLEX */,
40708
+ none: 1 /* YGDisplay.YGD_NONE */
40709
+ };
40710
+ /**
40711
+ * @internal
40712
+ */
40713
+ function getJustify(justify) {
40714
+ const value = justify
40715
+ ? parseJustify[justify]
40716
+ : 0 /* YGJustify.YGJ_FLEX_START */;
40717
+ return { justifyContent: value };
40718
+ }
40719
+ const parseJustify = {
40720
+ center: 1 /* YGJustify.YGJ_CENTER */,
40721
+ 'flex-end': 2 /* YGJustify.YGJ_FLEX_END */,
40722
+ 'flex-start': 0 /* YGJustify.YGJ_FLEX_START */,
40723
+ 'space-around': 4 /* YGJustify.YGJ_SPACE_AROUND */,
40724
+ 'space-between': 3 /* YGJustify.YGJ_SPACE_BETWEEN */,
40725
+ 'space-evenly': 5 /* YGJustify.YGJ_SPACE_EVENLY */
40726
+ };
40727
+ /**
40728
+ * @internal
40729
+ */
40730
+ function getAlign(prop, align, defaultValue) {
40731
+ const value = align ? parseAligns[align] : defaultValue;
40732
+ return { [prop]: value };
40733
+ }
40734
+ const parseAligns = {
40735
+ auto: 0 /* YGAlign.YGA_AUTO */,
40736
+ baseline: 5 /* YGAlign.YGA_BASELINE */,
40737
+ center: 2 /* YGAlign.YGA_CENTER */,
40738
+ 'flex-end': 3 /* YGAlign.YGA_FLEX_END */,
40739
+ 'flex-start': 1 /* YGAlign.YGA_FLEX_START */,
40740
+ stretch: 4 /* YGAlign.YGA_STRETCH */,
40741
+ 'space-between': 6 /* YGAlign.YGA_SPACE_BETWEEN */,
40742
+ 'space-around': 7 /* YGAlign.YGA_SPACE_AROUND */
40743
+ };
40744
+ /**
40745
+ * @internal
40746
+ */
40747
+ function getFlexDirection(flexDirection) {
40748
+ const value = flexDirection
40749
+ ? parseFlexDirection[flexDirection]
40750
+ : 0 /* YGFlexDirection.YGFD_ROW */;
40751
+ return { flexDirection: value };
40752
+ }
40753
+ const parseFlexDirection = {
40754
+ row: 0 /* YGFlexDirection.YGFD_ROW */,
40755
+ column: 1 /* YGFlexDirection.YGFD_COLUMN */,
40756
+ 'row-reverse': 3 /* YGFlexDirection.YGFD_ROW_REVERSE */,
40757
+ 'column-reverse': 2 /* YGFlexDirection.YGFD_COLUMN_REVERSE */
40758
+ };
40759
+ /**
40760
+ * @internal
40761
+ */
40762
+ function getFlexWrap(flexWrap) {
40763
+ const value = flexWrap ? parseFlexWrap[flexWrap] : 1 /* YGWrap.YGW_WRAP */;
40764
+ return { flexWrap: value };
40765
+ }
40766
+ const parseFlexWrap = {
40767
+ wrap: 1 /* YGWrap.YGW_WRAP */,
40768
+ nowrap: 0 /* YGWrap.YGW_NO_WRAP */,
40769
+ 'wrap-reverse': 2 /* YGWrap.YGW_WRAP_REVERSE */
40770
+ };
40771
+ /**
40772
+ * @internal
40773
+ */
40774
+ function getOverflow(overflow) {
40775
+ const value = overflow
40776
+ ? parseOverflow[overflow]
40777
+ : 0 /* YGOverflow.YGO_VISIBLE */;
40778
+ return { overflow: value };
40779
+ }
40780
+ const parseOverflow = {
40781
+ visible: 0 /* YGOverflow.YGO_VISIBLE */,
40782
+ scroll: 2 /* YGOverflow.YGO_SCROLL */,
40783
+ hidden: 1 /* YGOverflow.YGO_HIDDEN */
40784
+ };
40785
+ /**
40786
+ * @internal
40787
+ */
40788
+ function getPoistionType(position) {
40789
+ const value = position
40790
+ ? parsePositionType[position]
40791
+ : 0 /* YGPositionType.YGPT_RELATIVE */;
40792
+ return { positionType: value };
40793
+ }
40794
+ const parsePositionType = {
40795
+ relative: 0 /* YGPositionType.YGPT_RELATIVE */,
40796
+ absolute: 1 /* YGPositionType.YGPT_ABSOLUTE */
40797
+ };
40699
40798
 
40700
40799
  const CANVAS_ROOT_ENTITY = 0;
40701
40800
  const defaultUiTransform = {
40702
40801
  parent: CANVAS_ROOT_ENTITY,
40703
40802
  rightOf: 0,
40704
- display: 0 /* YGDisplay.YGD_FLEX */,
40705
40803
  flexBasis: 0,
40706
40804
  width: 0,
40707
40805
  height: 0,
@@ -40709,10 +40807,6 @@
40709
40807
  minHeight: 0,
40710
40808
  maxWidth: 0,
40711
40809
  maxHeight: 0,
40712
- justifyContent: 0 /* YGJustify.YGJ_FLEX_START */,
40713
- alignSelf: 0 /* YGAlign.YGA_AUTO */,
40714
- flexDirection: 0 /* YGFlexDirection.YGFD_ROW */,
40715
- positionType: 0 /* YGPositionType.YGPT_RELATIVE */,
40716
40810
  flexGrow: 0,
40717
40811
  marginBottom: 0,
40718
40812
  marginBottomUnit: 0 /* YGUnit.YGU_UNDEFINED */,
@@ -40726,9 +40820,8 @@
40726
40820
  maxWidthUnit: 0 /* YGUnit.YGU_UNDEFINED */,
40727
40821
  minHeightUnit: 0 /* YGUnit.YGU_UNDEFINED */,
40728
40822
  minWidthUnit: 0 /* YGUnit.YGU_UNDEFINED */,
40729
- overflow: 0 /* YGOverflow.YGO_VISIBLE */,
40730
40823
  paddingBottom: 0,
40731
- paddingBottomUnit: 2 /* YGUnit.YGU_PERCENT */,
40824
+ paddingBottomUnit: 0 /* YGUnit.YGU_UNDEFINED */,
40732
40825
  paddingLeft: 0,
40733
40826
  paddingLeftUnit: 0 /* YGUnit.YGU_UNDEFINED */,
40734
40827
  paddingTopUnit: 0 /* YGUnit.YGU_UNDEFINED */,
@@ -40752,34 +40845,60 @@
40752
40845
  */
40753
40846
 
40754
40847
  function parseUiTransform(props = {}) {
40755
- const { position, padding, margin, height, minHeight, maxHeight, width, maxWidth, minWidth, ...otherProps } = props;
40848
+ const { height, minHeight, maxHeight, width, minWidth, maxWidth, ...otherProps } = props;
40756
40849
  return {
40757
40850
  ...defaultUiTransform,
40758
40851
  ...otherProps,
40759
- ...parsePosition(position, 'position'),
40760
- ...parsePosition(margin, 'margin'),
40761
- ...parsePosition(padding, 'padding'),
40762
- ...parseSize(height, 'height'),
40763
- ...parseSize(minHeight, 'minHeight'),
40764
- ...parseSize(maxHeight, 'maxHeight'),
40765
- ...parseSize(width, 'width'),
40766
- ...parseSize(minWidth, 'minWidth'),
40767
- ...parseSize(maxWidth, 'maxWidth')
40852
+ ...parsePosition(props.position, 'position'),
40853
+ ...parsePosition(props.margin, 'margin'),
40854
+ ...parsePosition(props.padding, 'padding'),
40855
+ ...parseSize(props.height, 'height'),
40856
+ ...parseSize(props.minHeight, 'minHeight'),
40857
+ ...parseSize(props.maxHeight, 'maxHeight'),
40858
+ ...parseSize(props.width, 'width'),
40859
+ ...parseSize(props.minWidth, 'minWidth'),
40860
+ ...parseSize(props.maxWidth, 'maxWidth'),
40861
+ ...getDisplay(props.display),
40862
+ ...getAlign('alignContent', props.alignContent, 1 /* YGAlign.YGA_FLEX_START */),
40863
+ ...getAlign('alignSelf', props.alignSelf, 1 /* YGAlign.YGA_FLEX_START */),
40864
+ ...getAlign('alignItems', props.alignItems, 1 /* YGAlign.YGA_FLEX_START */),
40865
+ ...getJustify(props.justifyContent),
40866
+ ...getFlexDirection(props.flexDirection),
40867
+ ...getFlexWrap(props.flexWrap),
40868
+ ...getOverflow(props.overflow),
40869
+ ...getPoistionType(props.positionType)
40768
40870
  };
40769
40871
  }
40770
40872
 
40873
+ const parseTextureMode = {
40874
+ 'nine-slices': 0 /* BackgroundTextureMode.NINE_SLICES */,
40875
+ center: 1 /* BackgroundTextureMode.CENTER */,
40876
+ stretch: 2 /* BackgroundTextureMode.STRETCH */
40877
+ };
40878
+ /**
40879
+ * @internal
40880
+ */
40881
+ function getTextureMode(mode) {
40882
+ const value = mode
40883
+ ? parseTextureMode[mode]
40884
+ : 1 /* BackgroundTextureMode.CENTER */;
40885
+ return { textureMode: value };
40886
+ }
40771
40887
  function isAvatarTexture(props) {
40772
40888
  return !!props.avatarTexture;
40773
40889
  }
40774
40890
  function isTexture(props) {
40775
40891
  return !!props.texture;
40776
40892
  }
40893
+ /**
40894
+ * @internal
40895
+ */
40777
40896
  function getTexture(props) {
40778
40897
  if (isTexture(props) && props.texture) {
40779
40898
  return {
40780
40899
  tex: {
40781
40900
  $case: 'texture',
40782
- texture: props.texture
40901
+ texture: parseTexture(props.texture)
40783
40902
  }
40784
40903
  };
40785
40904
  }
@@ -40787,12 +40906,31 @@
40787
40906
  return {
40788
40907
  tex: {
40789
40908
  $case: 'avatarTexture',
40790
- avatarTexture: props.avatarTexture
40909
+ avatarTexture: parseTexture(props.avatarTexture)
40791
40910
  }
40792
40911
  };
40793
40912
  }
40794
40913
  return undefined;
40795
40914
  }
40915
+ function parseTexture(texture) {
40916
+ return {
40917
+ ...texture,
40918
+ wrapMode: texture.wrapMode ? parseWrap[texture.wrapMode] : undefined,
40919
+ filterMode: texture.filterMode ? parseFilter[texture.filterMode] : undefined
40920
+ };
40921
+ }
40922
+ const parseWrap = {
40923
+ repeat: 0 /* TextureWrapMode.TWM_REPEAT */,
40924
+ clamp: 1 /* TextureWrapMode.TWM_CLAMP */,
40925
+ mirror: 2 /* TextureWrapMode.TWM_MIRROR */,
40926
+ 'mirror-once': 3 /* TextureWrapMode.TWM_MIRROR_ONCE */
40927
+ };
40928
+ const parseFilter = {
40929
+ point: 0 /* TextureFilterMode.TFM_POINT */,
40930
+ 'bi-linear': 1 /* TextureFilterMode.TFM_BILINEAR */,
40931
+ 'tri-linear': 2 /* TextureFilterMode.TFM_TRILINEAR */
40932
+ };
40933
+
40796
40934
  /**
40797
40935
  * @public
40798
40936
  */
@@ -40803,9 +40941,9 @@
40803
40941
  const texture = getTexture(props);
40804
40942
  return {
40805
40943
  ...props,
40944
+ ...getTextureMode(props.textureMode),
40806
40945
  uvs: props.uvs ?? [],
40807
- texture,
40808
- textureMode: props.textureMode ?? 1 /* BackgroundTextureMode.CENTER */
40946
+ texture
40809
40947
  };
40810
40948
  }
40811
40949
 
@@ -40832,13 +40970,49 @@
40832
40970
  const listenersKey = Object.keys(listeners);
40833
40971
  const isListener = (key) => listenersKey.includes(key);
40834
40972
 
40973
+ const parseFont = {
40974
+ 'sans-serif': 0 /* Font.F_SANS_SERIF */,
40975
+ serif: 1 /* Font.F_SERIF */,
40976
+ monospace: 2 /* Font.F_MONOSPACE */
40977
+ };
40978
+ /**
40979
+ * @internal
40980
+ */
40981
+ function getFont(font) {
40982
+ if (!font)
40983
+ return undefined;
40984
+ return { font: parseFont[font] };
40985
+ }
40986
+ const parseTextAlign = {
40987
+ 'top-left': 0 /* TextAlignMode.TAM_TOP_LEFT */,
40988
+ 'top-center': 1 /* TextAlignMode.TAM_TOP_CENTER */,
40989
+ 'top-right': 2 /* TextAlignMode.TAM_TOP_RIGHT */,
40990
+ 'middle-left': 3 /* TextAlignMode.TAM_MIDDLE_LEFT */,
40991
+ 'middle-center': 4 /* TextAlignMode.TAM_MIDDLE_CENTER */,
40992
+ 'middle-right': 5 /* TextAlignMode.TAM_MIDDLE_RIGHT */,
40993
+ 'bottom-left': 6 /* TextAlignMode.TAM_BOTTOM_LEFT */,
40994
+ 'bottom-center': 7 /* TextAlignMode.TAM_BOTTOM_CENTER */,
40995
+ 'bottom-right': 8 /* TextAlignMode.TAM_BOTTOM_RIGHT */
40996
+ };
40997
+ /**
40998
+ * @internal
40999
+ */
41000
+ function getTextAlign(textAlign) {
41001
+ if (!textAlign)
41002
+ return undefined;
41003
+ return { textAlign: parseTextAlign[textAlign] };
41004
+ }
41005
+
40835
41006
  function parseUiDropdown(props) {
41007
+ const { textAlign, font, ...otherProps } = props;
40836
41008
  return {
40837
41009
  acceptEmpty: false,
40838
41010
  options: [],
40839
41011
  selectedIndex: props.acceptEmpty ? -1 : 0,
40840
41012
  disabled: false,
40841
- ...props
41013
+ ...otherProps,
41014
+ ...getTextAlign(textAlign),
41015
+ ...getFont(font)
40842
41016
  };
40843
41017
  }
40844
41018
  /**
@@ -40858,10 +41032,13 @@
40858
41032
  }
40859
41033
 
40860
41034
  function parseUiInput(props) {
41035
+ const { textAlign, font, ...otherProps } = props;
40861
41036
  return {
40862
41037
  disabled: false,
40863
41038
  placeholder: '',
40864
- ...props
41039
+ ...otherProps,
41040
+ ...getTextAlign(textAlign),
41041
+ ...getFont(font)
40865
41042
  };
40866
41043
  }
40867
41044
  /**
@@ -40892,7 +41069,13 @@
40892
41069
  onMouseDown,
40893
41070
  onMouseUp
40894
41071
  });
40895
- return ReactEcs$1.createElement("entity", { ...commonProps, uiText: uiTextProps });
41072
+ const { font, textAlign, ...textProps } = uiTextProps;
41073
+ const uiText = {
41074
+ ...textProps,
41075
+ ...getFont(font),
41076
+ ...getTextAlign(textAlign)
41077
+ };
41078
+ return ReactEcs$1.createElement("entity", { ...commonProps, uiText: uiText });
40896
41079
  }
40897
41080
 
40898
41081
  function getButtonProps(props) {
@@ -40915,15 +41098,18 @@
40915
41098
  */
40916
41099
 
40917
41100
  function Button(props) {
40918
- const { uiTransform, uiBackground, onMouseDown, onMouseUp, ...uiTextProps } = props;
41101
+ const { uiTransform, uiBackground, onMouseDown, onMouseUp, ...otherProps } = props;
40919
41102
  const buttonProps = getButtonProps(props);
40920
41103
  const uiBackgroundProps = parseUiBackground({
40921
41104
  ...buttonProps.uiBackground,
40922
41105
  ...uiBackground
40923
41106
  });
41107
+ const { font, textAlign, ...uiTexProps } = otherProps;
40924
41108
  const textProps = {
40925
41109
  ...buttonProps.uiText,
40926
- ...uiTextProps
41110
+ ...uiTexProps,
41111
+ ...getFont(font),
41112
+ ...getTextAlign(textAlign)
40927
41113
  };
40928
41114
  const uiTransformProps = parseUiTransform({
40929
41115
  height: 36,