@dcl/playground-assets 7.0.6-3803395793.commit-999a6b9 → 7.0.6-3808564125.commit-7a2650b
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/alpha.d.ts +269 -70
- package/dist/beta.d.ts +269 -70
- package/dist/index.bundled.d.ts +269 -70
- package/dist/index.js +950 -276
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/playground/sdk/dcl-sdk.package.json +2 -2
- package/dist/playground/snippets/info.json +1 -1
- package/dist/playground/snippets/pointer-events.ts +6 -4
- package/dist/playground/snippets/ui-backgrounds.tsx +192 -0
- package/dist/playground/snippets/ui-dropdown.tsx +32 -0
- package/dist/playground/snippets/ui.tsx +17 -14
- package/dist/playground-assets.d.ts +270 -71
- package/etc/playground-assets.api.json +2891 -884
- package/etc/playground-assets.api.md +253 -82
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -10576,6 +10576,150 @@
|
|
|
10576
10576
|
}
|
|
10577
10577
|
};
|
|
10578
10578
|
|
|
10579
|
+
exports.PointerEventType = void 0;
|
|
10580
|
+
(function (PointerEventType) {
|
|
10581
|
+
PointerEventType[PointerEventType["PET_UP"] = 0] = "PET_UP";
|
|
10582
|
+
PointerEventType[PointerEventType["PET_DOWN"] = 1] = "PET_DOWN";
|
|
10583
|
+
PointerEventType[PointerEventType["PET_HOVER_ENTER"] = 2] = "PET_HOVER_ENTER";
|
|
10584
|
+
PointerEventType[PointerEventType["PET_HOVER_LEAVE"] = 3] = "PET_HOVER_LEAVE";
|
|
10585
|
+
})(exports.PointerEventType || (exports.PointerEventType = {}));
|
|
10586
|
+
function createBasePBPointerEvents() {
|
|
10587
|
+
return { pointerEvents: [] };
|
|
10588
|
+
}
|
|
10589
|
+
/**
|
|
10590
|
+
* Internal
|
|
10591
|
+
*/
|
|
10592
|
+
const PBPointerEvents = {
|
|
10593
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
10594
|
+
for (const v of message.pointerEvents) {
|
|
10595
|
+
PBPointerEvents_Entry.encode(v, writer.uint32(10).fork()).ldelim();
|
|
10596
|
+
}
|
|
10597
|
+
return writer;
|
|
10598
|
+
},
|
|
10599
|
+
decode(input, length) {
|
|
10600
|
+
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
10601
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
10602
|
+
const message = createBasePBPointerEvents();
|
|
10603
|
+
while (reader.pos < end) {
|
|
10604
|
+
const tag = reader.uint32();
|
|
10605
|
+
switch (tag >>> 3) {
|
|
10606
|
+
case 1:
|
|
10607
|
+
message.pointerEvents.push(PBPointerEvents_Entry.decode(reader, reader.uint32()));
|
|
10608
|
+
break;
|
|
10609
|
+
default:
|
|
10610
|
+
reader.skipType(tag & 7);
|
|
10611
|
+
break;
|
|
10612
|
+
}
|
|
10613
|
+
}
|
|
10614
|
+
return message;
|
|
10615
|
+
}
|
|
10616
|
+
};
|
|
10617
|
+
function createBasePBPointerEvents_Info() {
|
|
10618
|
+
return { button: undefined, hoverText: undefined, maxDistance: undefined, showFeedback: undefined };
|
|
10619
|
+
}
|
|
10620
|
+
/**
|
|
10621
|
+
* Internal
|
|
10622
|
+
*/
|
|
10623
|
+
const PBPointerEvents_Info = {
|
|
10624
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
10625
|
+
if (message.button !== undefined) {
|
|
10626
|
+
writer.uint32(8).int32(message.button);
|
|
10627
|
+
}
|
|
10628
|
+
if (message.hoverText !== undefined) {
|
|
10629
|
+
writer.uint32(18).string(message.hoverText);
|
|
10630
|
+
}
|
|
10631
|
+
if (message.maxDistance !== undefined) {
|
|
10632
|
+
writer.uint32(29).float(message.maxDistance);
|
|
10633
|
+
}
|
|
10634
|
+
if (message.showFeedback !== undefined) {
|
|
10635
|
+
writer.uint32(32).bool(message.showFeedback);
|
|
10636
|
+
}
|
|
10637
|
+
return writer;
|
|
10638
|
+
},
|
|
10639
|
+
decode(input, length) {
|
|
10640
|
+
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
10641
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
10642
|
+
const message = createBasePBPointerEvents_Info();
|
|
10643
|
+
while (reader.pos < end) {
|
|
10644
|
+
const tag = reader.uint32();
|
|
10645
|
+
switch (tag >>> 3) {
|
|
10646
|
+
case 1:
|
|
10647
|
+
message.button = reader.int32();
|
|
10648
|
+
break;
|
|
10649
|
+
case 2:
|
|
10650
|
+
message.hoverText = reader.string();
|
|
10651
|
+
break;
|
|
10652
|
+
case 3:
|
|
10653
|
+
message.maxDistance = reader.float();
|
|
10654
|
+
break;
|
|
10655
|
+
case 4:
|
|
10656
|
+
message.showFeedback = reader.bool();
|
|
10657
|
+
break;
|
|
10658
|
+
default:
|
|
10659
|
+
reader.skipType(tag & 7);
|
|
10660
|
+
break;
|
|
10661
|
+
}
|
|
10662
|
+
}
|
|
10663
|
+
return message;
|
|
10664
|
+
}
|
|
10665
|
+
};
|
|
10666
|
+
function createBasePBPointerEvents_Entry() {
|
|
10667
|
+
return { eventType: 0, eventInfo: undefined };
|
|
10668
|
+
}
|
|
10669
|
+
/**
|
|
10670
|
+
* Internal
|
|
10671
|
+
*/
|
|
10672
|
+
const PBPointerEvents_Entry = {
|
|
10673
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
10674
|
+
if (message.eventType !== 0) {
|
|
10675
|
+
writer.uint32(8).int32(message.eventType);
|
|
10676
|
+
}
|
|
10677
|
+
if (message.eventInfo !== undefined) {
|
|
10678
|
+
PBPointerEvents_Info.encode(message.eventInfo, writer.uint32(18).fork()).ldelim();
|
|
10679
|
+
}
|
|
10680
|
+
return writer;
|
|
10681
|
+
},
|
|
10682
|
+
decode(input, length) {
|
|
10683
|
+
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
10684
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
10685
|
+
const message = createBasePBPointerEvents_Entry();
|
|
10686
|
+
while (reader.pos < end) {
|
|
10687
|
+
const tag = reader.uint32();
|
|
10688
|
+
switch (tag >>> 3) {
|
|
10689
|
+
case 1:
|
|
10690
|
+
message.eventType = reader.int32();
|
|
10691
|
+
break;
|
|
10692
|
+
case 2:
|
|
10693
|
+
message.eventInfo = PBPointerEvents_Info.decode(reader, reader.uint32());
|
|
10694
|
+
break;
|
|
10695
|
+
default:
|
|
10696
|
+
reader.skipType(tag & 7);
|
|
10697
|
+
break;
|
|
10698
|
+
}
|
|
10699
|
+
}
|
|
10700
|
+
return message;
|
|
10701
|
+
}
|
|
10702
|
+
};
|
|
10703
|
+
|
|
10704
|
+
/**
|
|
10705
|
+
*
|
|
10706
|
+
*/
|
|
10707
|
+
const PointerEventsSchema = {
|
|
10708
|
+
COMPONENT_ID: 1062,
|
|
10709
|
+
serialize(value, builder) {
|
|
10710
|
+
const writer = PBPointerEvents.encode(value);
|
|
10711
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
10712
|
+
builder.writeBuffer(buffer, false);
|
|
10713
|
+
},
|
|
10714
|
+
deserialize(reader) {
|
|
10715
|
+
return PBPointerEvents.decode(reader.buffer(), reader.remainingBytes());
|
|
10716
|
+
},
|
|
10717
|
+
create() {
|
|
10718
|
+
// TODO: this is a hack.
|
|
10719
|
+
return PBPointerEvents.decode(new Uint8Array());
|
|
10720
|
+
}
|
|
10721
|
+
};
|
|
10722
|
+
|
|
10579
10723
|
/* eslint-disable */
|
|
10580
10724
|
function createBasePBRaycastResult() {
|
|
10581
10725
|
return { timestamp: 0, origin: undefined, direction: undefined, hits: [] };
|
|
@@ -10829,150 +10973,6 @@
|
|
|
10829
10973
|
}
|
|
10830
10974
|
};
|
|
10831
10975
|
|
|
10832
|
-
exports.PointerEventType = void 0;
|
|
10833
|
-
(function (PointerEventType) {
|
|
10834
|
-
PointerEventType[PointerEventType["PET_UP"] = 0] = "PET_UP";
|
|
10835
|
-
PointerEventType[PointerEventType["PET_DOWN"] = 1] = "PET_DOWN";
|
|
10836
|
-
PointerEventType[PointerEventType["PET_HOVER_ENTER"] = 2] = "PET_HOVER_ENTER";
|
|
10837
|
-
PointerEventType[PointerEventType["PET_HOVER_LEAVE"] = 3] = "PET_HOVER_LEAVE";
|
|
10838
|
-
})(exports.PointerEventType || (exports.PointerEventType = {}));
|
|
10839
|
-
function createBasePBPointerHoverFeedback() {
|
|
10840
|
-
return { pointerEvents: [] };
|
|
10841
|
-
}
|
|
10842
|
-
/**
|
|
10843
|
-
* Internal
|
|
10844
|
-
*/
|
|
10845
|
-
const PBPointerHoverFeedback = {
|
|
10846
|
-
encode(message, writer = minimalExports.Writer.create()) {
|
|
10847
|
-
for (const v of message.pointerEvents) {
|
|
10848
|
-
PBPointerHoverFeedback_Entry.encode(v, writer.uint32(10).fork()).ldelim();
|
|
10849
|
-
}
|
|
10850
|
-
return writer;
|
|
10851
|
-
},
|
|
10852
|
-
decode(input, length) {
|
|
10853
|
-
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
10854
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
10855
|
-
const message = createBasePBPointerHoverFeedback();
|
|
10856
|
-
while (reader.pos < end) {
|
|
10857
|
-
const tag = reader.uint32();
|
|
10858
|
-
switch (tag >>> 3) {
|
|
10859
|
-
case 1:
|
|
10860
|
-
message.pointerEvents.push(PBPointerHoverFeedback_Entry.decode(reader, reader.uint32()));
|
|
10861
|
-
break;
|
|
10862
|
-
default:
|
|
10863
|
-
reader.skipType(tag & 7);
|
|
10864
|
-
break;
|
|
10865
|
-
}
|
|
10866
|
-
}
|
|
10867
|
-
return message;
|
|
10868
|
-
}
|
|
10869
|
-
};
|
|
10870
|
-
function createBasePBPointerHoverFeedback_Info() {
|
|
10871
|
-
return { button: undefined, hoverText: undefined, maxDistance: undefined, showFeedback: undefined };
|
|
10872
|
-
}
|
|
10873
|
-
/**
|
|
10874
|
-
* Internal
|
|
10875
|
-
*/
|
|
10876
|
-
const PBPointerHoverFeedback_Info = {
|
|
10877
|
-
encode(message, writer = minimalExports.Writer.create()) {
|
|
10878
|
-
if (message.button !== undefined) {
|
|
10879
|
-
writer.uint32(8).int32(message.button);
|
|
10880
|
-
}
|
|
10881
|
-
if (message.hoverText !== undefined) {
|
|
10882
|
-
writer.uint32(18).string(message.hoverText);
|
|
10883
|
-
}
|
|
10884
|
-
if (message.maxDistance !== undefined) {
|
|
10885
|
-
writer.uint32(29).float(message.maxDistance);
|
|
10886
|
-
}
|
|
10887
|
-
if (message.showFeedback !== undefined) {
|
|
10888
|
-
writer.uint32(32).bool(message.showFeedback);
|
|
10889
|
-
}
|
|
10890
|
-
return writer;
|
|
10891
|
-
},
|
|
10892
|
-
decode(input, length) {
|
|
10893
|
-
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
10894
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
10895
|
-
const message = createBasePBPointerHoverFeedback_Info();
|
|
10896
|
-
while (reader.pos < end) {
|
|
10897
|
-
const tag = reader.uint32();
|
|
10898
|
-
switch (tag >>> 3) {
|
|
10899
|
-
case 1:
|
|
10900
|
-
message.button = reader.int32();
|
|
10901
|
-
break;
|
|
10902
|
-
case 2:
|
|
10903
|
-
message.hoverText = reader.string();
|
|
10904
|
-
break;
|
|
10905
|
-
case 3:
|
|
10906
|
-
message.maxDistance = reader.float();
|
|
10907
|
-
break;
|
|
10908
|
-
case 4:
|
|
10909
|
-
message.showFeedback = reader.bool();
|
|
10910
|
-
break;
|
|
10911
|
-
default:
|
|
10912
|
-
reader.skipType(tag & 7);
|
|
10913
|
-
break;
|
|
10914
|
-
}
|
|
10915
|
-
}
|
|
10916
|
-
return message;
|
|
10917
|
-
}
|
|
10918
|
-
};
|
|
10919
|
-
function createBasePBPointerHoverFeedback_Entry() {
|
|
10920
|
-
return { eventType: 0, eventInfo: undefined };
|
|
10921
|
-
}
|
|
10922
|
-
/**
|
|
10923
|
-
* Internal
|
|
10924
|
-
*/
|
|
10925
|
-
const PBPointerHoverFeedback_Entry = {
|
|
10926
|
-
encode(message, writer = minimalExports.Writer.create()) {
|
|
10927
|
-
if (message.eventType !== 0) {
|
|
10928
|
-
writer.uint32(8).int32(message.eventType);
|
|
10929
|
-
}
|
|
10930
|
-
if (message.eventInfo !== undefined) {
|
|
10931
|
-
PBPointerHoverFeedback_Info.encode(message.eventInfo, writer.uint32(18).fork()).ldelim();
|
|
10932
|
-
}
|
|
10933
|
-
return writer;
|
|
10934
|
-
},
|
|
10935
|
-
decode(input, length) {
|
|
10936
|
-
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
10937
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
10938
|
-
const message = createBasePBPointerHoverFeedback_Entry();
|
|
10939
|
-
while (reader.pos < end) {
|
|
10940
|
-
const tag = reader.uint32();
|
|
10941
|
-
switch (tag >>> 3) {
|
|
10942
|
-
case 1:
|
|
10943
|
-
message.eventType = reader.int32();
|
|
10944
|
-
break;
|
|
10945
|
-
case 2:
|
|
10946
|
-
message.eventInfo = PBPointerHoverFeedback_Info.decode(reader, reader.uint32());
|
|
10947
|
-
break;
|
|
10948
|
-
default:
|
|
10949
|
-
reader.skipType(tag & 7);
|
|
10950
|
-
break;
|
|
10951
|
-
}
|
|
10952
|
-
}
|
|
10953
|
-
return message;
|
|
10954
|
-
}
|
|
10955
|
-
};
|
|
10956
|
-
|
|
10957
|
-
/**
|
|
10958
|
-
*
|
|
10959
|
-
*/
|
|
10960
|
-
const PointerHoverFeedbackSchema = {
|
|
10961
|
-
COMPONENT_ID: 1062,
|
|
10962
|
-
serialize(value, builder) {
|
|
10963
|
-
const writer = PBPointerHoverFeedback.encode(value);
|
|
10964
|
-
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
10965
|
-
builder.writeBuffer(buffer, false);
|
|
10966
|
-
},
|
|
10967
|
-
deserialize(reader) {
|
|
10968
|
-
return PBPointerHoverFeedback.decode(reader.buffer(), reader.remainingBytes());
|
|
10969
|
-
},
|
|
10970
|
-
create() {
|
|
10971
|
-
// TODO: this is a hack.
|
|
10972
|
-
return PBPointerHoverFeedback.decode(new Uint8Array());
|
|
10973
|
-
}
|
|
10974
|
-
};
|
|
10975
|
-
|
|
10976
10976
|
/* eslint-disable */
|
|
10977
10977
|
function createBasePBPointerLock() {
|
|
10978
10978
|
return { isPointerLocked: false };
|
|
@@ -11313,28 +11313,444 @@
|
|
|
11313
11313
|
};
|
|
11314
11314
|
|
|
11315
11315
|
/* eslint-disable */
|
|
11316
|
-
function
|
|
11317
|
-
return {
|
|
11316
|
+
function createBaseBorderRect() {
|
|
11317
|
+
return { top: 0, left: 0, right: 0, bottom: 0 };
|
|
11318
11318
|
}
|
|
11319
11319
|
/**
|
|
11320
11320
|
* Internal
|
|
11321
11321
|
*/
|
|
11322
|
-
const
|
|
11322
|
+
const BorderRect = {
|
|
11323
11323
|
encode(message, writer = minimalExports.Writer.create()) {
|
|
11324
|
-
if (message.
|
|
11325
|
-
|
|
11324
|
+
if (message.top !== 0) {
|
|
11325
|
+
writer.uint32(13).float(message.top);
|
|
11326
|
+
}
|
|
11327
|
+
if (message.left !== 0) {
|
|
11328
|
+
writer.uint32(21).float(message.left);
|
|
11329
|
+
}
|
|
11330
|
+
if (message.right !== 0) {
|
|
11331
|
+
writer.uint32(29).float(message.right);
|
|
11332
|
+
}
|
|
11333
|
+
if (message.bottom !== 0) {
|
|
11334
|
+
writer.uint32(37).float(message.bottom);
|
|
11335
|
+
}
|
|
11336
|
+
return writer;
|
|
11337
|
+
},
|
|
11338
|
+
decode(input, length) {
|
|
11339
|
+
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
11340
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
11341
|
+
const message = createBaseBorderRect();
|
|
11342
|
+
while (reader.pos < end) {
|
|
11343
|
+
const tag = reader.uint32();
|
|
11344
|
+
switch (tag >>> 3) {
|
|
11345
|
+
case 1:
|
|
11346
|
+
message.top = reader.float();
|
|
11347
|
+
break;
|
|
11348
|
+
case 2:
|
|
11349
|
+
message.left = reader.float();
|
|
11350
|
+
break;
|
|
11351
|
+
case 3:
|
|
11352
|
+
message.right = reader.float();
|
|
11353
|
+
break;
|
|
11354
|
+
case 4:
|
|
11355
|
+
message.bottom = reader.float();
|
|
11356
|
+
break;
|
|
11357
|
+
default:
|
|
11358
|
+
reader.skipType(tag & 7);
|
|
11359
|
+
break;
|
|
11360
|
+
}
|
|
11361
|
+
}
|
|
11362
|
+
return message;
|
|
11363
|
+
}
|
|
11364
|
+
};
|
|
11365
|
+
|
|
11366
|
+
/* eslint-disable */
|
|
11367
|
+
exports.BackgroundTextureMode = void 0;
|
|
11368
|
+
(function (BackgroundTextureMode) {
|
|
11369
|
+
/**
|
|
11370
|
+
* NINE_SLICES - https://docs.unity3d.com/Manual/UIE-USS-SupportedProperties.html (Slicing section)
|
|
11371
|
+
* https://forum.unity.com/threads/how-does-slicing-in-ui-tookkit-works.1235863/
|
|
11372
|
+
* https://docs.unity3d.com/Manual/9SliceSprites.html
|
|
11373
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-slice
|
|
11374
|
+
*/
|
|
11375
|
+
BackgroundTextureMode[BackgroundTextureMode["NINE_SLICES"] = 0] = "NINE_SLICES";
|
|
11376
|
+
/**
|
|
11377
|
+
* CENTER - CENTER enables the texture to be rendered centered in relation to the
|
|
11378
|
+
* element. If the element is smaller than the texture then the background
|
|
11379
|
+
* should use the element as stencil to cut off the out-of-bounds area
|
|
11380
|
+
*/
|
|
11381
|
+
BackgroundTextureMode[BackgroundTextureMode["CENTER"] = 1] = "CENTER";
|
|
11382
|
+
/**
|
|
11383
|
+
* STRETCH - STRETCH enables the texture to cover all the area of the container,
|
|
11384
|
+
* adopting its aspect ratio.
|
|
11385
|
+
*/
|
|
11386
|
+
BackgroundTextureMode[BackgroundTextureMode["STRETCH"] = 2] = "STRETCH";
|
|
11387
|
+
})(exports.BackgroundTextureMode || (exports.BackgroundTextureMode = {}));
|
|
11388
|
+
function createBasePBUiBackground() {
|
|
11389
|
+
return { color: undefined, texture: undefined, textureMode: 0, textureSlices: undefined, uvs: [] };
|
|
11390
|
+
}
|
|
11391
|
+
/**
|
|
11392
|
+
* Internal
|
|
11393
|
+
*/
|
|
11394
|
+
const PBUiBackground = {
|
|
11395
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
11396
|
+
if (message.color !== undefined) {
|
|
11397
|
+
Color4.encode(message.color, writer.uint32(10).fork()).ldelim();
|
|
11398
|
+
}
|
|
11399
|
+
if (message.texture !== undefined) {
|
|
11400
|
+
TextureUnion.encode(message.texture, writer.uint32(18).fork()).ldelim();
|
|
11401
|
+
}
|
|
11402
|
+
if (message.textureMode !== 0) {
|
|
11403
|
+
writer.uint32(24).int32(message.textureMode);
|
|
11404
|
+
}
|
|
11405
|
+
if (message.textureSlices !== undefined) {
|
|
11406
|
+
BorderRect.encode(message.textureSlices, writer.uint32(34).fork()).ldelim();
|
|
11407
|
+
}
|
|
11408
|
+
writer.uint32(42).fork();
|
|
11409
|
+
for (const v of message.uvs) {
|
|
11410
|
+
writer.float(v);
|
|
11411
|
+
}
|
|
11412
|
+
writer.ldelim();
|
|
11413
|
+
return writer;
|
|
11414
|
+
},
|
|
11415
|
+
decode(input, length) {
|
|
11416
|
+
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
11417
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
11418
|
+
const message = createBasePBUiBackground();
|
|
11419
|
+
while (reader.pos < end) {
|
|
11420
|
+
const tag = reader.uint32();
|
|
11421
|
+
switch (tag >>> 3) {
|
|
11422
|
+
case 1:
|
|
11423
|
+
message.color = Color4.decode(reader, reader.uint32());
|
|
11424
|
+
break;
|
|
11425
|
+
case 2:
|
|
11426
|
+
message.texture = TextureUnion.decode(reader, reader.uint32());
|
|
11427
|
+
break;
|
|
11428
|
+
case 3:
|
|
11429
|
+
message.textureMode = reader.int32();
|
|
11430
|
+
break;
|
|
11431
|
+
case 4:
|
|
11432
|
+
message.textureSlices = BorderRect.decode(reader, reader.uint32());
|
|
11433
|
+
break;
|
|
11434
|
+
case 5:
|
|
11435
|
+
if ((tag & 7) === 2) {
|
|
11436
|
+
const end2 = reader.uint32() + reader.pos;
|
|
11437
|
+
while (reader.pos < end2) {
|
|
11438
|
+
message.uvs.push(reader.float());
|
|
11439
|
+
}
|
|
11440
|
+
}
|
|
11441
|
+
else {
|
|
11442
|
+
message.uvs.push(reader.float());
|
|
11443
|
+
}
|
|
11444
|
+
break;
|
|
11445
|
+
default:
|
|
11446
|
+
reader.skipType(tag & 7);
|
|
11447
|
+
break;
|
|
11448
|
+
}
|
|
11449
|
+
}
|
|
11450
|
+
return message;
|
|
11451
|
+
}
|
|
11452
|
+
};
|
|
11453
|
+
|
|
11454
|
+
/**
|
|
11455
|
+
*
|
|
11456
|
+
*/
|
|
11457
|
+
const UiBackgroundSchema = {
|
|
11458
|
+
COMPONENT_ID: 1053,
|
|
11459
|
+
serialize(value, builder) {
|
|
11460
|
+
const writer = PBUiBackground.encode(value);
|
|
11461
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
11462
|
+
builder.writeBuffer(buffer, false);
|
|
11463
|
+
},
|
|
11464
|
+
deserialize(reader) {
|
|
11465
|
+
return PBUiBackground.decode(reader.buffer(), reader.remainingBytes());
|
|
11466
|
+
},
|
|
11467
|
+
create() {
|
|
11468
|
+
// TODO: this is a hack.
|
|
11469
|
+
return PBUiBackground.decode(new Uint8Array());
|
|
11470
|
+
}
|
|
11471
|
+
};
|
|
11472
|
+
|
|
11473
|
+
/* eslint-disable */
|
|
11474
|
+
function createBasePBUiDropdown() {
|
|
11475
|
+
return {
|
|
11476
|
+
acceptEmpty: false,
|
|
11477
|
+
emptyLabel: undefined,
|
|
11478
|
+
options: [],
|
|
11479
|
+
selectedIndex: undefined,
|
|
11480
|
+
disabled: false,
|
|
11481
|
+
color: undefined,
|
|
11482
|
+
textAlign: undefined,
|
|
11483
|
+
font: undefined,
|
|
11484
|
+
fontSize: undefined
|
|
11485
|
+
};
|
|
11486
|
+
}
|
|
11487
|
+
/**
|
|
11488
|
+
* Internal
|
|
11489
|
+
*/
|
|
11490
|
+
const PBUiDropdown = {
|
|
11491
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
11492
|
+
if (message.acceptEmpty === true) {
|
|
11493
|
+
writer.uint32(8).bool(message.acceptEmpty);
|
|
11494
|
+
}
|
|
11495
|
+
if (message.emptyLabel !== undefined) {
|
|
11496
|
+
writer.uint32(18).string(message.emptyLabel);
|
|
11497
|
+
}
|
|
11498
|
+
for (const v of message.options) {
|
|
11499
|
+
writer.uint32(26).string(v);
|
|
11500
|
+
}
|
|
11501
|
+
if (message.selectedIndex !== undefined) {
|
|
11502
|
+
writer.uint32(32).int32(message.selectedIndex);
|
|
11503
|
+
}
|
|
11504
|
+
if (message.disabled === true) {
|
|
11505
|
+
writer.uint32(40).bool(message.disabled);
|
|
11506
|
+
}
|
|
11507
|
+
if (message.color !== undefined) {
|
|
11508
|
+
Color4.encode(message.color, writer.uint32(50).fork()).ldelim();
|
|
11509
|
+
}
|
|
11510
|
+
if (message.textAlign !== undefined) {
|
|
11511
|
+
writer.uint32(80).int32(message.textAlign);
|
|
11512
|
+
}
|
|
11513
|
+
if (message.font !== undefined) {
|
|
11514
|
+
writer.uint32(88).int32(message.font);
|
|
11515
|
+
}
|
|
11516
|
+
if (message.fontSize !== undefined) {
|
|
11517
|
+
writer.uint32(96).int32(message.fontSize);
|
|
11518
|
+
}
|
|
11519
|
+
return writer;
|
|
11520
|
+
},
|
|
11521
|
+
decode(input, length) {
|
|
11522
|
+
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
11523
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
11524
|
+
const message = createBasePBUiDropdown();
|
|
11525
|
+
while (reader.pos < end) {
|
|
11526
|
+
const tag = reader.uint32();
|
|
11527
|
+
switch (tag >>> 3) {
|
|
11528
|
+
case 1:
|
|
11529
|
+
message.acceptEmpty = reader.bool();
|
|
11530
|
+
break;
|
|
11531
|
+
case 2:
|
|
11532
|
+
message.emptyLabel = reader.string();
|
|
11533
|
+
break;
|
|
11534
|
+
case 3:
|
|
11535
|
+
message.options.push(reader.string());
|
|
11536
|
+
break;
|
|
11537
|
+
case 4:
|
|
11538
|
+
message.selectedIndex = reader.int32();
|
|
11539
|
+
break;
|
|
11540
|
+
case 5:
|
|
11541
|
+
message.disabled = reader.bool();
|
|
11542
|
+
break;
|
|
11543
|
+
case 6:
|
|
11544
|
+
message.color = Color4.decode(reader, reader.uint32());
|
|
11545
|
+
break;
|
|
11546
|
+
case 10:
|
|
11547
|
+
message.textAlign = reader.int32();
|
|
11548
|
+
break;
|
|
11549
|
+
case 11:
|
|
11550
|
+
message.font = reader.int32();
|
|
11551
|
+
break;
|
|
11552
|
+
case 12:
|
|
11553
|
+
message.fontSize = reader.int32();
|
|
11554
|
+
break;
|
|
11555
|
+
default:
|
|
11556
|
+
reader.skipType(tag & 7);
|
|
11557
|
+
break;
|
|
11558
|
+
}
|
|
11559
|
+
}
|
|
11560
|
+
return message;
|
|
11561
|
+
}
|
|
11562
|
+
};
|
|
11563
|
+
|
|
11564
|
+
/**
|
|
11565
|
+
*
|
|
11566
|
+
*/
|
|
11567
|
+
const UiDropdownSchema = {
|
|
11568
|
+
COMPONENT_ID: 1094,
|
|
11569
|
+
serialize(value, builder) {
|
|
11570
|
+
const writer = PBUiDropdown.encode(value);
|
|
11571
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
11572
|
+
builder.writeBuffer(buffer, false);
|
|
11573
|
+
},
|
|
11574
|
+
deserialize(reader) {
|
|
11575
|
+
return PBUiDropdown.decode(reader.buffer(), reader.remainingBytes());
|
|
11576
|
+
},
|
|
11577
|
+
create() {
|
|
11578
|
+
// TODO: this is a hack.
|
|
11579
|
+
return PBUiDropdown.decode(new Uint8Array());
|
|
11580
|
+
}
|
|
11581
|
+
};
|
|
11582
|
+
|
|
11583
|
+
/* eslint-disable */
|
|
11584
|
+
function createBasePBUiDropdownResult() {
|
|
11585
|
+
return { value: 0 };
|
|
11586
|
+
}
|
|
11587
|
+
/**
|
|
11588
|
+
* Internal
|
|
11589
|
+
*/
|
|
11590
|
+
const PBUiDropdownResult = {
|
|
11591
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
11592
|
+
if (message.value !== 0) {
|
|
11593
|
+
writer.uint32(8).int32(message.value);
|
|
11594
|
+
}
|
|
11595
|
+
return writer;
|
|
11596
|
+
},
|
|
11597
|
+
decode(input, length) {
|
|
11598
|
+
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
11599
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
11600
|
+
const message = createBasePBUiDropdownResult();
|
|
11601
|
+
while (reader.pos < end) {
|
|
11602
|
+
const tag = reader.uint32();
|
|
11603
|
+
switch (tag >>> 3) {
|
|
11604
|
+
case 1:
|
|
11605
|
+
message.value = reader.int32();
|
|
11606
|
+
break;
|
|
11607
|
+
default:
|
|
11608
|
+
reader.skipType(tag & 7);
|
|
11609
|
+
break;
|
|
11610
|
+
}
|
|
11611
|
+
}
|
|
11612
|
+
return message;
|
|
11613
|
+
}
|
|
11614
|
+
};
|
|
11615
|
+
|
|
11616
|
+
/**
|
|
11617
|
+
*
|
|
11618
|
+
*/
|
|
11619
|
+
const UiDropdownResultSchema = {
|
|
11620
|
+
COMPONENT_ID: 1096,
|
|
11621
|
+
serialize(value, builder) {
|
|
11622
|
+
const writer = PBUiDropdownResult.encode(value);
|
|
11623
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
11624
|
+
builder.writeBuffer(buffer, false);
|
|
11625
|
+
},
|
|
11626
|
+
deserialize(reader) {
|
|
11627
|
+
return PBUiDropdownResult.decode(reader.buffer(), reader.remainingBytes());
|
|
11628
|
+
},
|
|
11629
|
+
create() {
|
|
11630
|
+
// TODO: this is a hack.
|
|
11631
|
+
return PBUiDropdownResult.decode(new Uint8Array());
|
|
11632
|
+
}
|
|
11633
|
+
};
|
|
11634
|
+
|
|
11635
|
+
/* eslint-disable */
|
|
11636
|
+
function createBasePBUiInput() {
|
|
11637
|
+
return {
|
|
11638
|
+
placeholder: '',
|
|
11639
|
+
color: undefined,
|
|
11640
|
+
placeholderColor: undefined,
|
|
11641
|
+
disabled: false,
|
|
11642
|
+
textAlign: undefined,
|
|
11643
|
+
font: undefined,
|
|
11644
|
+
fontSize: undefined
|
|
11645
|
+
};
|
|
11646
|
+
}
|
|
11647
|
+
/**
|
|
11648
|
+
* Internal
|
|
11649
|
+
*/
|
|
11650
|
+
const PBUiInput = {
|
|
11651
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
11652
|
+
if (message.placeholder !== '') {
|
|
11653
|
+
writer.uint32(10).string(message.placeholder);
|
|
11654
|
+
}
|
|
11655
|
+
if (message.color !== undefined) {
|
|
11656
|
+
Color4.encode(message.color, writer.uint32(18).fork()).ldelim();
|
|
11657
|
+
}
|
|
11658
|
+
if (message.placeholderColor !== undefined) {
|
|
11659
|
+
Color4.encode(message.placeholderColor, writer.uint32(26).fork()).ldelim();
|
|
11660
|
+
}
|
|
11661
|
+
if (message.disabled === true) {
|
|
11662
|
+
writer.uint32(32).bool(message.disabled);
|
|
11663
|
+
}
|
|
11664
|
+
if (message.textAlign !== undefined) {
|
|
11665
|
+
writer.uint32(80).int32(message.textAlign);
|
|
11666
|
+
}
|
|
11667
|
+
if (message.font !== undefined) {
|
|
11668
|
+
writer.uint32(88).int32(message.font);
|
|
11669
|
+
}
|
|
11670
|
+
if (message.fontSize !== undefined) {
|
|
11671
|
+
writer.uint32(96).int32(message.fontSize);
|
|
11672
|
+
}
|
|
11673
|
+
return writer;
|
|
11674
|
+
},
|
|
11675
|
+
decode(input, length) {
|
|
11676
|
+
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
11677
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
11678
|
+
const message = createBasePBUiInput();
|
|
11679
|
+
while (reader.pos < end) {
|
|
11680
|
+
const tag = reader.uint32();
|
|
11681
|
+
switch (tag >>> 3) {
|
|
11682
|
+
case 1:
|
|
11683
|
+
message.placeholder = reader.string();
|
|
11684
|
+
break;
|
|
11685
|
+
case 2:
|
|
11686
|
+
message.color = Color4.decode(reader, reader.uint32());
|
|
11687
|
+
break;
|
|
11688
|
+
case 3:
|
|
11689
|
+
message.placeholderColor = Color4.decode(reader, reader.uint32());
|
|
11690
|
+
break;
|
|
11691
|
+
case 4:
|
|
11692
|
+
message.disabled = reader.bool();
|
|
11693
|
+
break;
|
|
11694
|
+
case 10:
|
|
11695
|
+
message.textAlign = reader.int32();
|
|
11696
|
+
break;
|
|
11697
|
+
case 11:
|
|
11698
|
+
message.font = reader.int32();
|
|
11699
|
+
break;
|
|
11700
|
+
case 12:
|
|
11701
|
+
message.fontSize = reader.int32();
|
|
11702
|
+
break;
|
|
11703
|
+
default:
|
|
11704
|
+
reader.skipType(tag & 7);
|
|
11705
|
+
break;
|
|
11706
|
+
}
|
|
11707
|
+
}
|
|
11708
|
+
return message;
|
|
11709
|
+
}
|
|
11710
|
+
};
|
|
11711
|
+
|
|
11712
|
+
/**
|
|
11713
|
+
*
|
|
11714
|
+
*/
|
|
11715
|
+
const UiInputSchema = {
|
|
11716
|
+
COMPONENT_ID: 1093,
|
|
11717
|
+
serialize(value, builder) {
|
|
11718
|
+
const writer = PBUiInput.encode(value);
|
|
11719
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
11720
|
+
builder.writeBuffer(buffer, false);
|
|
11721
|
+
},
|
|
11722
|
+
deserialize(reader) {
|
|
11723
|
+
return PBUiInput.decode(reader.buffer(), reader.remainingBytes());
|
|
11724
|
+
},
|
|
11725
|
+
create() {
|
|
11726
|
+
// TODO: this is a hack.
|
|
11727
|
+
return PBUiInput.decode(new Uint8Array());
|
|
11728
|
+
}
|
|
11729
|
+
};
|
|
11730
|
+
|
|
11731
|
+
/* eslint-disable */
|
|
11732
|
+
function createBasePBUiInputResult() {
|
|
11733
|
+
return { value: '' };
|
|
11734
|
+
}
|
|
11735
|
+
/**
|
|
11736
|
+
* Internal
|
|
11737
|
+
*/
|
|
11738
|
+
const PBUiInputResult = {
|
|
11739
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
11740
|
+
if (message.value !== '') {
|
|
11741
|
+
writer.uint32(10).string(message.value);
|
|
11326
11742
|
}
|
|
11327
11743
|
return writer;
|
|
11328
11744
|
},
|
|
11329
11745
|
decode(input, length) {
|
|
11330
11746
|
const reader = input instanceof minimalExports.Reader ? input : new minimalExports.Reader(input);
|
|
11331
11747
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
11332
|
-
const message =
|
|
11748
|
+
const message = createBasePBUiInputResult();
|
|
11333
11749
|
while (reader.pos < end) {
|
|
11334
11750
|
const tag = reader.uint32();
|
|
11335
11751
|
switch (tag >>> 3) {
|
|
11336
11752
|
case 1:
|
|
11337
|
-
message.
|
|
11753
|
+
message.value = reader.string();
|
|
11338
11754
|
break;
|
|
11339
11755
|
default:
|
|
11340
11756
|
reader.skipType(tag & 7);
|
|
@@ -11348,19 +11764,19 @@
|
|
|
11348
11764
|
/**
|
|
11349
11765
|
*
|
|
11350
11766
|
*/
|
|
11351
|
-
const
|
|
11352
|
-
COMPONENT_ID:
|
|
11767
|
+
const UiInputResultSchema = {
|
|
11768
|
+
COMPONENT_ID: 1095,
|
|
11353
11769
|
serialize(value, builder) {
|
|
11354
|
-
const writer =
|
|
11770
|
+
const writer = PBUiInputResult.encode(value);
|
|
11355
11771
|
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
11356
11772
|
builder.writeBuffer(buffer, false);
|
|
11357
11773
|
},
|
|
11358
11774
|
deserialize(reader) {
|
|
11359
|
-
return
|
|
11775
|
+
return PBUiInputResult.decode(reader.buffer(), reader.remainingBytes());
|
|
11360
11776
|
},
|
|
11361
11777
|
create() {
|
|
11362
11778
|
// TODO: this is a hack.
|
|
11363
|
-
return
|
|
11779
|
+
return PBUiInputResult.decode(new Uint8Array());
|
|
11364
11780
|
}
|
|
11365
11781
|
};
|
|
11366
11782
|
|
|
@@ -11978,13 +12394,17 @@
|
|
|
11978
12394
|
/** @public */ const MeshCollider$2 = engine => engine.defineComponentFromSchema(MeshColliderSchema, MeshColliderSchema.COMPONENT_ID);
|
|
11979
12395
|
/** @public */ const MeshRenderer$2 = engine => engine.defineComponentFromSchema(MeshRendererSchema, MeshRendererSchema.COMPONENT_ID);
|
|
11980
12396
|
/** @public */ const NftShape$1 = engine => engine.defineComponentFromSchema(NftShapeSchema, NftShapeSchema.COMPONENT_ID);
|
|
12397
|
+
/** @public */ const PointerEvents$1 = engine => engine.defineComponentFromSchema(PointerEventsSchema, PointerEventsSchema.COMPONENT_ID);
|
|
11981
12398
|
/** @public */ const PointerEventsResult$1 = engine => engine.defineComponentFromSchema(PointerEventsResultSchema, PointerEventsResultSchema.COMPONENT_ID);
|
|
11982
|
-
/** @public */ const PointerHoverFeedback$1 = engine => engine.defineComponentFromSchema(PointerHoverFeedbackSchema, PointerHoverFeedbackSchema.COMPONENT_ID);
|
|
11983
12399
|
/** @public */ const PointerLock$1 = engine => engine.defineComponentFromSchema(PointerLockSchema, PointerLockSchema.COMPONENT_ID);
|
|
11984
12400
|
/** @public */ const Raycast$1 = engine => engine.defineComponentFromSchema(RaycastSchema, RaycastSchema.COMPONENT_ID);
|
|
11985
12401
|
/** @public */ const RaycastResult$1 = engine => engine.defineComponentFromSchema(RaycastResultSchema, RaycastResultSchema.COMPONENT_ID);
|
|
11986
12402
|
/** @public */ const TextShape$1 = engine => engine.defineComponentFromSchema(TextShapeSchema, TextShapeSchema.COMPONENT_ID);
|
|
11987
12403
|
/** @public */ const UiBackground$1 = engine => engine.defineComponentFromSchema(UiBackgroundSchema, UiBackgroundSchema.COMPONENT_ID);
|
|
12404
|
+
/** @public */ const UiDropdown$1 = engine => engine.defineComponentFromSchema(UiDropdownSchema, UiDropdownSchema.COMPONENT_ID);
|
|
12405
|
+
/** @public */ const UiDropdownResult$1 = engine => engine.defineComponentFromSchema(UiDropdownResultSchema, UiDropdownResultSchema.COMPONENT_ID);
|
|
12406
|
+
/** @public */ const UiInput$1 = engine => engine.defineComponentFromSchema(UiInputSchema, UiInputSchema.COMPONENT_ID);
|
|
12407
|
+
/** @public */ const UiInputResult$1 = engine => engine.defineComponentFromSchema(UiInputResultSchema, UiInputResultSchema.COMPONENT_ID);
|
|
11988
12408
|
/** @public */ const UiText$1 = engine => engine.defineComponentFromSchema(UiTextSchema, UiTextSchema.COMPONENT_ID);
|
|
11989
12409
|
/** @public */ const UiTransform$1 = engine => engine.defineComponentFromSchema(UiTransformSchema, UiTransformSchema.COMPONENT_ID);
|
|
11990
12410
|
/** @public */ const VisibilityComponent$1 = engine => engine.defineComponentFromSchema(VisibilityComponentSchema, VisibilityComponentSchema.COMPONENT_ID);
|
|
@@ -12278,19 +12698,24 @@
|
|
|
12278
12698
|
PBMeshRenderer_SphereMesh: PBMeshRenderer_SphereMesh,
|
|
12279
12699
|
get NftFrameType () { return exports.NftFrameType; },
|
|
12280
12700
|
PBNftShape: PBNftShape,
|
|
12701
|
+
get PointerEventType () { return exports.PointerEventType; },
|
|
12702
|
+
PBPointerEvents: PBPointerEvents,
|
|
12703
|
+
PBPointerEvents_Info: PBPointerEvents_Info,
|
|
12704
|
+
PBPointerEvents_Entry: PBPointerEvents_Entry,
|
|
12281
12705
|
PBPointerEventsResult: PBPointerEventsResult,
|
|
12282
12706
|
PBPointerEventsResult_PointerCommand: PBPointerEventsResult_PointerCommand,
|
|
12283
|
-
get PointerEventType () { return exports.PointerEventType; },
|
|
12284
|
-
PBPointerHoverFeedback: PBPointerHoverFeedback,
|
|
12285
|
-
PBPointerHoverFeedback_Info: PBPointerHoverFeedback_Info,
|
|
12286
|
-
PBPointerHoverFeedback_Entry: PBPointerHoverFeedback_Entry,
|
|
12287
12707
|
PBPointerLock: PBPointerLock,
|
|
12288
12708
|
get RaycastQueryType () { return exports.RaycastQueryType; },
|
|
12289
12709
|
PBRaycast: PBRaycast,
|
|
12290
12710
|
PBRaycastResult: PBRaycastResult,
|
|
12291
12711
|
RaycastHit: RaycastHit,
|
|
12292
12712
|
PBTextShape: PBTextShape,
|
|
12713
|
+
get BackgroundTextureMode () { return exports.BackgroundTextureMode; },
|
|
12293
12714
|
PBUiBackground: PBUiBackground,
|
|
12715
|
+
PBUiDropdown: PBUiDropdown,
|
|
12716
|
+
PBUiDropdownResult: PBUiDropdownResult,
|
|
12717
|
+
PBUiInput: PBUiInput,
|
|
12718
|
+
PBUiInputResult: PBUiInputResult,
|
|
12294
12719
|
PBUiText: PBUiText,
|
|
12295
12720
|
get YGPositionType () { return exports.YGPositionType; },
|
|
12296
12721
|
get YGAlign () { return exports.YGAlign; },
|
|
@@ -12313,13 +12738,17 @@
|
|
|
12313
12738
|
CameraModeArea: CameraModeArea$1,
|
|
12314
12739
|
GltfContainer: GltfContainer$1,
|
|
12315
12740
|
NftShape: NftShape$1,
|
|
12741
|
+
PointerEvents: PointerEvents$1,
|
|
12316
12742
|
PointerEventsResult: PointerEventsResult$1,
|
|
12317
|
-
PointerHoverFeedback: PointerHoverFeedback$1,
|
|
12318
12743
|
PointerLock: PointerLock$1,
|
|
12319
12744
|
Raycast: Raycast$1,
|
|
12320
12745
|
RaycastResult: RaycastResult$1,
|
|
12321
12746
|
TextShape: TextShape$1,
|
|
12322
12747
|
UiBackground: UiBackground$1,
|
|
12748
|
+
UiDropdown: UiDropdown$1,
|
|
12749
|
+
UiDropdownResult: UiDropdownResult$1,
|
|
12750
|
+
UiInput: UiInput$1,
|
|
12751
|
+
UiInputResult: UiInputResult$1,
|
|
12323
12752
|
UiText: UiText$1,
|
|
12324
12753
|
UiTransform: UiTransform$1,
|
|
12325
12754
|
VisibilityComponent: VisibilityComponent$1
|
|
@@ -12484,10 +12913,10 @@
|
|
|
12484
12913
|
*/
|
|
12485
12914
|
const FlatString = {
|
|
12486
12915
|
serialize(value, builder) {
|
|
12487
|
-
builder.
|
|
12916
|
+
builder.writeUtf8String(value);
|
|
12488
12917
|
},
|
|
12489
12918
|
deserialize(reader) {
|
|
12490
|
-
return
|
|
12919
|
+
return reader.readUtf8String();
|
|
12491
12920
|
},
|
|
12492
12921
|
create() {
|
|
12493
12922
|
return '';
|
|
@@ -12882,6 +13311,8 @@
|
|
|
12882
13311
|
|
|
12883
13312
|
var distExports = requireDist();
|
|
12884
13313
|
|
|
13314
|
+
var utf8Exports = requireUtf8();
|
|
13315
|
+
|
|
12885
13316
|
/**
|
|
12886
13317
|
* Take the max between currentSize and intendedSize and then plus 1024. Then,
|
|
12887
13318
|
* find the next nearer multiple of 1024.
|
|
@@ -13004,6 +13435,10 @@
|
|
|
13004
13435
|
const length = view.getUint32(roAdd(4));
|
|
13005
13436
|
return buffer.subarray(roAdd(length), roAdd(0));
|
|
13006
13437
|
},
|
|
13438
|
+
readUtf8String() {
|
|
13439
|
+
const length = view.getUint32(roAdd(4));
|
|
13440
|
+
return utf8Exports.read(buffer, roAdd(length), roAdd(0));
|
|
13441
|
+
},
|
|
13007
13442
|
incrementWriteOffset(amount) {
|
|
13008
13443
|
return woAdd(amount);
|
|
13009
13444
|
},
|
|
@@ -13023,6 +13458,14 @@
|
|
|
13023
13458
|
const o = woAdd(value.byteLength);
|
|
13024
13459
|
buffer.set(value, o);
|
|
13025
13460
|
},
|
|
13461
|
+
writeUtf8String(value, writeLength = true) {
|
|
13462
|
+
const byteLength = utf8Exports.length(value);
|
|
13463
|
+
if (writeLength) {
|
|
13464
|
+
this.writeUint32(byteLength);
|
|
13465
|
+
}
|
|
13466
|
+
const o = woAdd(byteLength);
|
|
13467
|
+
utf8Exports.write(value, buffer, o);
|
|
13468
|
+
},
|
|
13026
13469
|
writeFloat32(value) {
|
|
13027
13470
|
const o = woAdd(4);
|
|
13028
13471
|
view.setFloat32(o, value);
|
|
@@ -14103,7 +14546,7 @@
|
|
|
14103
14546
|
}
|
|
14104
14547
|
|
|
14105
14548
|
function createPointerEventSystem(engine, inputSystem) {
|
|
14106
|
-
const
|
|
14549
|
+
const PointerEvents = PointerEvents$1(engine);
|
|
14107
14550
|
let EventType;
|
|
14108
14551
|
(function (EventType) {
|
|
14109
14552
|
EventType[EventType["Click"] = 0] = "Click";
|
|
@@ -14112,31 +14555,28 @@
|
|
|
14112
14555
|
})(EventType || (EventType = {}));
|
|
14113
14556
|
const getDefaultOpts = (opts = {}) => ({
|
|
14114
14557
|
button: 3 /* InputAction.IA_ANY */,
|
|
14115
|
-
hoverText: 'Interact',
|
|
14116
|
-
maxDistance: 100,
|
|
14117
14558
|
...opts
|
|
14118
14559
|
});
|
|
14119
14560
|
const eventsMap = new Map();
|
|
14120
14561
|
function getEvent(entity) {
|
|
14121
14562
|
return (eventsMap.get(entity) || eventsMap.set(entity, new Map()).get(entity));
|
|
14122
14563
|
}
|
|
14123
|
-
function
|
|
14124
|
-
if (opts.hoverText) {
|
|
14125
|
-
const pointerEvent =
|
|
14126
|
-
PointerHoverFeedback.create(entity);
|
|
14564
|
+
function setPointerEvent(entity, type, opts) {
|
|
14565
|
+
if (opts.hoverText || opts.showFeedback) {
|
|
14566
|
+
const pointerEvent = PointerEvents.getMutableOrNull(entity) || PointerEvents.create(entity);
|
|
14127
14567
|
pointerEvent.pointerEvents.push({
|
|
14128
14568
|
eventType: type,
|
|
14129
14569
|
eventInfo: {
|
|
14130
14570
|
button: opts.button,
|
|
14131
|
-
showFeedback:
|
|
14571
|
+
showFeedback: opts.showFeedback,
|
|
14132
14572
|
hoverText: opts.hoverText,
|
|
14133
14573
|
maxDistance: opts.maxDistance
|
|
14134
14574
|
}
|
|
14135
14575
|
});
|
|
14136
14576
|
}
|
|
14137
14577
|
}
|
|
14138
|
-
function
|
|
14139
|
-
const pointerEvent =
|
|
14578
|
+
function removePointerEvent(entity, type, button) {
|
|
14579
|
+
const pointerEvent = PointerEvents.getMutableOrNull(entity);
|
|
14140
14580
|
if (!pointerEvent)
|
|
14141
14581
|
return;
|
|
14142
14582
|
pointerEvent.pointerEvents = pointerEvent.pointerEvents.filter((pointer) => !(pointer.eventInfo?.button === button && pointer.eventType === type));
|
|
@@ -14151,7 +14591,7 @@
|
|
|
14151
14591
|
const event = getEvent(entity);
|
|
14152
14592
|
const pointerEvent = event.get(type);
|
|
14153
14593
|
if (pointerEvent?.opts.hoverText) {
|
|
14154
|
-
|
|
14594
|
+
removePointerEvent(entity, getPointerEvent(type), pointerEvent.opts.button);
|
|
14155
14595
|
}
|
|
14156
14596
|
event.delete(type);
|
|
14157
14597
|
}
|
|
@@ -14215,7 +14655,7 @@
|
|
|
14215
14655
|
removeEvent(entity, EventType.Click);
|
|
14216
14656
|
// Set new event
|
|
14217
14657
|
getEvent(entity).set(EventType.Click, { cb, opts: options });
|
|
14218
|
-
|
|
14658
|
+
setPointerEvent(entity, 1 /* PointerEventType.PET_DOWN */, options);
|
|
14219
14659
|
},
|
|
14220
14660
|
/**
|
|
14221
14661
|
* @public
|
|
@@ -14228,7 +14668,7 @@
|
|
|
14228
14668
|
const options = getDefaultOpts(opts);
|
|
14229
14669
|
removeEvent(entity, EventType.Down);
|
|
14230
14670
|
getEvent(entity).set(EventType.Down, { cb, opts: options });
|
|
14231
|
-
|
|
14671
|
+
setPointerEvent(entity, 1 /* PointerEventType.PET_DOWN */, options);
|
|
14232
14672
|
},
|
|
14233
14673
|
/**
|
|
14234
14674
|
* @public
|
|
@@ -14241,7 +14681,7 @@
|
|
|
14241
14681
|
const options = getDefaultOpts(opts);
|
|
14242
14682
|
removeEvent(entity, EventType.Up);
|
|
14243
14683
|
getEvent(entity).set(EventType.Up, { cb, opts: options });
|
|
14244
|
-
|
|
14684
|
+
setPointerEvent(entity, 0 /* PointerEventType.PET_UP */, options);
|
|
14245
14685
|
}
|
|
14246
14686
|
};
|
|
14247
14687
|
}
|
|
@@ -14263,33 +14703,6 @@
|
|
|
14263
14703
|
|
|
14264
14704
|
const executeTask = createTaskSystem(engine).executeTask;
|
|
14265
14705
|
|
|
14266
|
-
/* eslint-disable */
|
|
14267
|
-
exports.CameraType = void 0;
|
|
14268
|
-
(function (CameraType) {
|
|
14269
|
-
CameraType[CameraType["CT_FIRST_PERSON"] = 0] = "CT_FIRST_PERSON";
|
|
14270
|
-
CameraType[CameraType["CT_THIRD_PERSON"] = 1] = "CT_THIRD_PERSON";
|
|
14271
|
-
})(exports.CameraType || (exports.CameraType = {}));
|
|
14272
|
-
|
|
14273
|
-
/* eslint-disable */
|
|
14274
|
-
exports.TextAlignMode = void 0;
|
|
14275
|
-
(function (TextAlignMode) {
|
|
14276
|
-
TextAlignMode[TextAlignMode["TAM_TOP_LEFT"] = 0] = "TAM_TOP_LEFT";
|
|
14277
|
-
TextAlignMode[TextAlignMode["TAM_TOP_CENTER"] = 1] = "TAM_TOP_CENTER";
|
|
14278
|
-
TextAlignMode[TextAlignMode["TAM_TOP_RIGHT"] = 2] = "TAM_TOP_RIGHT";
|
|
14279
|
-
TextAlignMode[TextAlignMode["TAM_MIDDLE_LEFT"] = 3] = "TAM_MIDDLE_LEFT";
|
|
14280
|
-
TextAlignMode[TextAlignMode["TAM_MIDDLE_CENTER"] = 4] = "TAM_MIDDLE_CENTER";
|
|
14281
|
-
TextAlignMode[TextAlignMode["TAM_MIDDLE_RIGHT"] = 5] = "TAM_MIDDLE_RIGHT";
|
|
14282
|
-
TextAlignMode[TextAlignMode["TAM_BOTTOM_LEFT"] = 6] = "TAM_BOTTOM_LEFT";
|
|
14283
|
-
TextAlignMode[TextAlignMode["TAM_BOTTOM_CENTER"] = 7] = "TAM_BOTTOM_CENTER";
|
|
14284
|
-
TextAlignMode[TextAlignMode["TAM_BOTTOM_RIGHT"] = 8] = "TAM_BOTTOM_RIGHT";
|
|
14285
|
-
})(exports.TextAlignMode || (exports.TextAlignMode = {}));
|
|
14286
|
-
exports.Font = void 0;
|
|
14287
|
-
(function (Font) {
|
|
14288
|
-
Font[Font["F_SANS_SERIF"] = 0] = "F_SANS_SERIF";
|
|
14289
|
-
Font[Font["F_SERIF"] = 1] = "F_SERIF";
|
|
14290
|
-
Font[Font["F_MONOSPACE"] = 2] = "F_MONOSPACE";
|
|
14291
|
-
})(exports.Font || (exports.Font = {}));
|
|
14292
|
-
|
|
14293
14706
|
/**
|
|
14294
14707
|
* Transform parenting: cyclic dependency checker
|
|
14295
14708
|
* It checks only in modified Transforms
|
|
@@ -14333,17 +14746,28 @@
|
|
|
14333
14746
|
/** @public */ const CameraModeArea = CameraModeArea$1(engine);
|
|
14334
14747
|
/** @public */ const GltfContainer = GltfContainer$1(engine);
|
|
14335
14748
|
/** @public */ const NftShape = NftShape$1(engine);
|
|
14749
|
+
/** @public */ const PointerEvents = PointerEvents$1(engine);
|
|
14336
14750
|
/** @public */ const PointerEventsResult = PointerEventsResult$1(engine);
|
|
14337
|
-
/** @public */ const PointerHoverFeedback = PointerHoverFeedback$1(engine);
|
|
14338
14751
|
/** @public */ const PointerLock = PointerLock$1(engine);
|
|
14339
14752
|
/** @public */ const Raycast = Raycast$1(engine);
|
|
14340
14753
|
/** @public */ const RaycastResult = RaycastResult$1(engine);
|
|
14341
14754
|
/** @public */ const TextShape = TextShape$1(engine);
|
|
14342
14755
|
/** @public */ const UiBackground = UiBackground$1(engine);
|
|
14756
|
+
/** @public */ const UiDropdown = UiDropdown$1(engine);
|
|
14757
|
+
/** @public */ const UiDropdownResult = UiDropdownResult$1(engine);
|
|
14758
|
+
/** @public */ const UiInput = UiInput$1(engine);
|
|
14759
|
+
/** @public */ const UiInputResult = UiInputResult$1(engine);
|
|
14343
14760
|
/** @public */ const UiText = UiText$1(engine);
|
|
14344
14761
|
/** @public */ const UiTransform = UiTransform$1(engine);
|
|
14345
14762
|
/** @public */ const VisibilityComponent = VisibilityComponent$1(engine);
|
|
14346
14763
|
|
|
14764
|
+
/* eslint-disable */
|
|
14765
|
+
exports.CameraType = void 0;
|
|
14766
|
+
(function (CameraType) {
|
|
14767
|
+
CameraType[CameraType["CT_FIRST_PERSON"] = 0] = "CT_FIRST_PERSON";
|
|
14768
|
+
CameraType[CameraType["CT_THIRD_PERSON"] = 1] = "CT_THIRD_PERSON";
|
|
14769
|
+
})(exports.CameraType || (exports.CameraType = {}));
|
|
14770
|
+
|
|
14347
14771
|
/* eslint-disable */
|
|
14348
14772
|
exports.InputAction = void 0;
|
|
14349
14773
|
(function (InputAction) {
|
|
@@ -14363,6 +14787,26 @@
|
|
|
14363
14787
|
InputAction[InputAction["IA_ACTION_6"] = 13] = "IA_ACTION_6";
|
|
14364
14788
|
})(exports.InputAction || (exports.InputAction = {}));
|
|
14365
14789
|
|
|
14790
|
+
/* eslint-disable */
|
|
14791
|
+
exports.TextAlignMode = void 0;
|
|
14792
|
+
(function (TextAlignMode) {
|
|
14793
|
+
TextAlignMode[TextAlignMode["TAM_TOP_LEFT"] = 0] = "TAM_TOP_LEFT";
|
|
14794
|
+
TextAlignMode[TextAlignMode["TAM_TOP_CENTER"] = 1] = "TAM_TOP_CENTER";
|
|
14795
|
+
TextAlignMode[TextAlignMode["TAM_TOP_RIGHT"] = 2] = "TAM_TOP_RIGHT";
|
|
14796
|
+
TextAlignMode[TextAlignMode["TAM_MIDDLE_LEFT"] = 3] = "TAM_MIDDLE_LEFT";
|
|
14797
|
+
TextAlignMode[TextAlignMode["TAM_MIDDLE_CENTER"] = 4] = "TAM_MIDDLE_CENTER";
|
|
14798
|
+
TextAlignMode[TextAlignMode["TAM_MIDDLE_RIGHT"] = 5] = "TAM_MIDDLE_RIGHT";
|
|
14799
|
+
TextAlignMode[TextAlignMode["TAM_BOTTOM_LEFT"] = 6] = "TAM_BOTTOM_LEFT";
|
|
14800
|
+
TextAlignMode[TextAlignMode["TAM_BOTTOM_CENTER"] = 7] = "TAM_BOTTOM_CENTER";
|
|
14801
|
+
TextAlignMode[TextAlignMode["TAM_BOTTOM_RIGHT"] = 8] = "TAM_BOTTOM_RIGHT";
|
|
14802
|
+
})(exports.TextAlignMode || (exports.TextAlignMode = {}));
|
|
14803
|
+
exports.Font = void 0;
|
|
14804
|
+
(function (Font) {
|
|
14805
|
+
Font[Font["F_SANS_SERIF"] = 0] = "F_SANS_SERIF";
|
|
14806
|
+
Font[Font["F_SERIF"] = 1] = "F_SERIF";
|
|
14807
|
+
Font[Font["F_MONOSPACE"] = 2] = "F_MONOSPACE";
|
|
14808
|
+
})(exports.Font || (exports.Font = {}));
|
|
14809
|
+
|
|
14366
14810
|
// The order of the following imports matters. Please do not auto-sort
|
|
14367
14811
|
// export components for global engine
|
|
14368
14812
|
const Transform = Transform$1(engine);
|
|
@@ -39664,25 +40108,6 @@
|
|
|
39664
40108
|
}
|
|
39665
40109
|
|
|
39666
40110
|
const CANVAS_ROOT_ENTITY = 0;
|
|
39667
|
-
/**
|
|
39668
|
-
* @public
|
|
39669
|
-
*/
|
|
39670
|
-
function parseUiTransform(props = {}) {
|
|
39671
|
-
const { position, padding, margin, height, minHeight, maxHeight, width, maxWidth, minWidth, ...otherProps } = props;
|
|
39672
|
-
return {
|
|
39673
|
-
...defaultUiTransform,
|
|
39674
|
-
...otherProps,
|
|
39675
|
-
...parsePosition(position, 'position'),
|
|
39676
|
-
...parsePosition(margin, 'margin'),
|
|
39677
|
-
...parsePosition(padding, 'padding'),
|
|
39678
|
-
...parseSize(height, 'height'),
|
|
39679
|
-
...parseSize(minHeight, 'minHeight'),
|
|
39680
|
-
...parseSize(maxHeight, 'maxHeight'),
|
|
39681
|
-
...parseSize(width, 'width'),
|
|
39682
|
-
...parseSize(minWidth, 'minWidth'),
|
|
39683
|
-
...parseSize(maxWidth, 'maxWidth')
|
|
39684
|
-
};
|
|
39685
|
-
}
|
|
39686
40111
|
const defaultUiTransform = {
|
|
39687
40112
|
parent: CANVAS_ROOT_ENTITY,
|
|
39688
40113
|
rightOf: 0,
|
|
@@ -39732,31 +40157,235 @@
|
|
|
39732
40157
|
widthUnit: 0 /* YGUnit.YGU_UNDEFINED */,
|
|
39733
40158
|
heightUnit: 0 /* YGUnit.YGU_UNDEFINED */
|
|
39734
40159
|
};
|
|
40160
|
+
/**
|
|
40161
|
+
* @public
|
|
40162
|
+
*/
|
|
40163
|
+
|
|
40164
|
+
function parseUiTransform(props = {}) {
|
|
40165
|
+
const { position, padding, margin, height, minHeight, maxHeight, width, maxWidth, minWidth, ...otherProps } = props;
|
|
40166
|
+
return {
|
|
40167
|
+
...defaultUiTransform,
|
|
40168
|
+
...otherProps,
|
|
40169
|
+
...parsePosition(position, 'position'),
|
|
40170
|
+
...parsePosition(margin, 'margin'),
|
|
40171
|
+
...parsePosition(padding, 'padding'),
|
|
40172
|
+
...parseSize(height, 'height'),
|
|
40173
|
+
...parseSize(minHeight, 'minHeight'),
|
|
40174
|
+
...parseSize(maxHeight, 'maxHeight'),
|
|
40175
|
+
...parseSize(width, 'width'),
|
|
40176
|
+
...parseSize(minWidth, 'minWidth'),
|
|
40177
|
+
...parseSize(maxWidth, 'maxWidth')
|
|
40178
|
+
};
|
|
40179
|
+
}
|
|
40180
|
+
|
|
40181
|
+
function isAvatarTexture(props) {
|
|
40182
|
+
return !!props.avatarTexture;
|
|
40183
|
+
}
|
|
40184
|
+
function isTexture(props) {
|
|
40185
|
+
return !!props.texture;
|
|
40186
|
+
}
|
|
40187
|
+
function getTexture(props) {
|
|
40188
|
+
if (isTexture(props) && props.texture) {
|
|
40189
|
+
return {
|
|
40190
|
+
tex: {
|
|
40191
|
+
$case: 'texture',
|
|
40192
|
+
texture: props.texture
|
|
40193
|
+
}
|
|
40194
|
+
};
|
|
40195
|
+
}
|
|
40196
|
+
if (isAvatarTexture(props) && props.avatarTexture) {
|
|
40197
|
+
return {
|
|
40198
|
+
tex: {
|
|
40199
|
+
$case: 'avatarTexture',
|
|
40200
|
+
avatarTexture: props.avatarTexture
|
|
40201
|
+
}
|
|
40202
|
+
};
|
|
40203
|
+
}
|
|
40204
|
+
return undefined;
|
|
40205
|
+
}
|
|
40206
|
+
/**
|
|
40207
|
+
* @public
|
|
40208
|
+
*/
|
|
40209
|
+
|
|
40210
|
+
function parseUiBackground(props) {
|
|
40211
|
+
if (!props || !Object.keys(props).length)
|
|
40212
|
+
return undefined;
|
|
40213
|
+
const texture = getTexture(props);
|
|
40214
|
+
return {
|
|
40215
|
+
...props,
|
|
40216
|
+
uvs: props.uvs ?? [],
|
|
40217
|
+
texture,
|
|
40218
|
+
textureMode: props.textureMode ?? 1 /* BackgroundTextureMode.CENTER */
|
|
40219
|
+
};
|
|
40220
|
+
}
|
|
40221
|
+
|
|
40222
|
+
/**
|
|
40223
|
+
* @internal
|
|
40224
|
+
*/
|
|
40225
|
+
function parseProps(props) {
|
|
40226
|
+
const { uiTransform, uiBackground, ...otherProps } = props;
|
|
40227
|
+
const uiTransformProps = parseUiTransform(uiTransform);
|
|
40228
|
+
const uiBackgroundProps = uiBackground
|
|
40229
|
+
? { uiBackground: parseUiBackground(uiBackground) }
|
|
40230
|
+
: undefined;
|
|
40231
|
+
return {
|
|
40232
|
+
...otherProps,
|
|
40233
|
+
uiTransform: uiTransformProps,
|
|
40234
|
+
...uiBackgroundProps
|
|
40235
|
+
};
|
|
40236
|
+
}
|
|
39735
40237
|
|
|
39736
40238
|
const listeners = {
|
|
39737
|
-
|
|
40239
|
+
onMouseDown: undefined,
|
|
40240
|
+
onMouseUp: undefined
|
|
39738
40241
|
};
|
|
39739
40242
|
const listenersKey = Object.keys(listeners);
|
|
39740
40243
|
const isListener = (key) => listenersKey.includes(key);
|
|
39741
40244
|
|
|
40245
|
+
function parseUiDropdown(props) {
|
|
40246
|
+
return {
|
|
40247
|
+
acceptEmpty: false,
|
|
40248
|
+
options: [],
|
|
40249
|
+
selectedIndex: props.acceptEmpty ? -1 : 0,
|
|
40250
|
+
disabled: false,
|
|
40251
|
+
...props
|
|
40252
|
+
};
|
|
40253
|
+
}
|
|
39742
40254
|
/**
|
|
39743
40255
|
* @public
|
|
39744
40256
|
*/
|
|
39745
|
-
|
|
39746
|
-
|
|
39747
|
-
const
|
|
39748
|
-
|
|
40257
|
+
|
|
40258
|
+
function Dropdown(props) {
|
|
40259
|
+
const { uiTransform, uiBackground, onMouseDown, onMouseUp, ...otherProps } = props;
|
|
40260
|
+
const dropdownProps = parseUiDropdown(otherProps);
|
|
40261
|
+
const commonProps = parseProps({
|
|
40262
|
+
uiTransform,
|
|
40263
|
+
uiBackground,
|
|
40264
|
+
onMouseDown,
|
|
40265
|
+
onMouseUp
|
|
40266
|
+
});
|
|
40267
|
+
return ReactEcs$1.createElement("entity", { ...commonProps, uiDropdown: dropdownProps });
|
|
40268
|
+
}
|
|
40269
|
+
|
|
40270
|
+
function parseUiInput(props) {
|
|
40271
|
+
return {
|
|
40272
|
+
disabled: false,
|
|
40273
|
+
placeholder: '',
|
|
40274
|
+
...props
|
|
40275
|
+
};
|
|
40276
|
+
}
|
|
40277
|
+
/**
|
|
40278
|
+
* @public
|
|
40279
|
+
*/
|
|
40280
|
+
|
|
40281
|
+
function Input(props) {
|
|
40282
|
+
const { uiTransform, uiBackground, onMouseDown, onMouseUp, ...otherProps } = props;
|
|
40283
|
+
const inputProps = parseUiInput(otherProps);
|
|
40284
|
+
const commonProps = parseProps({
|
|
40285
|
+
uiTransform,
|
|
40286
|
+
uiBackground,
|
|
40287
|
+
onMouseDown,
|
|
40288
|
+
onMouseUp
|
|
40289
|
+
});
|
|
40290
|
+
return ReactEcs$1.createElement("entity", { ...commonProps, uiInput: inputProps });
|
|
40291
|
+
}
|
|
40292
|
+
|
|
40293
|
+
/**
|
|
40294
|
+
* @public
|
|
40295
|
+
*/
|
|
40296
|
+
|
|
40297
|
+
function Label(props) {
|
|
40298
|
+
const { uiTransform, uiBackground, onMouseDown, onMouseUp, ...uiTextProps } = props;
|
|
40299
|
+
const commonProps = parseProps({
|
|
40300
|
+
uiTransform,
|
|
40301
|
+
uiBackground,
|
|
40302
|
+
onMouseDown,
|
|
40303
|
+
onMouseUp
|
|
40304
|
+
});
|
|
40305
|
+
return ReactEcs$1.createElement("entity", { ...commonProps, uiText: uiTextProps });
|
|
40306
|
+
}
|
|
40307
|
+
|
|
40308
|
+
function getButtonProps(props) {
|
|
40309
|
+
if (props.type === 'primary') {
|
|
40310
|
+
return {
|
|
40311
|
+
uiBackground: { color: { r: 0.98, g: 0.17, b: 0.33, a: 1 } },
|
|
40312
|
+
uiText: { color: { r: 1, g: 1, b: 1, a: 1 } }
|
|
40313
|
+
};
|
|
40314
|
+
}
|
|
40315
|
+
if (props.type === 'secondary') {
|
|
40316
|
+
return {
|
|
40317
|
+
uiBackground: { color: { r: 1, g: 1, b: 1, a: 1 } },
|
|
40318
|
+
uiText: { color: { r: 0.98, g: 0.17, b: 0.33, a: 1 } }
|
|
40319
|
+
};
|
|
40320
|
+
}
|
|
40321
|
+
return {};
|
|
40322
|
+
}
|
|
40323
|
+
/**
|
|
40324
|
+
* @public
|
|
40325
|
+
*/
|
|
40326
|
+
|
|
40327
|
+
function Button(props) {
|
|
40328
|
+
const { uiTransform, uiBackground, onMouseDown, onMouseUp, ...uiTextProps } = props;
|
|
40329
|
+
const buttonProps = getButtonProps(props);
|
|
40330
|
+
const uiBackgroundProps = parseUiBackground({
|
|
40331
|
+
...buttonProps.uiBackground,
|
|
40332
|
+
...uiBackground
|
|
40333
|
+
});
|
|
40334
|
+
const textProps = {
|
|
40335
|
+
...buttonProps.uiText,
|
|
40336
|
+
...uiTextProps
|
|
40337
|
+
};
|
|
40338
|
+
const uiTransformProps = parseUiTransform({
|
|
40339
|
+
height: 36,
|
|
40340
|
+
...uiTransform
|
|
40341
|
+
});
|
|
40342
|
+
return (ReactEcs$1.createElement("entity", { onMouseDown: onMouseDown, onMouseUp: onMouseUp, uiTransform: uiTransformProps, uiText: textProps, uiBackground: uiBackgroundProps }));
|
|
39749
40343
|
}
|
|
39750
|
-
|
|
39751
|
-
|
|
40344
|
+
|
|
40345
|
+
/**
|
|
40346
|
+
* @public
|
|
40347
|
+
*/
|
|
40348
|
+
|
|
40349
|
+
function UiEntity(props) {
|
|
40350
|
+
return ReactEcs$1.createElement("entity", { ...parseProps(props) });
|
|
39752
40351
|
}
|
|
39753
40352
|
|
|
40353
|
+
function propsChanged(component, prevProps, nextProps) {
|
|
40354
|
+
if (prevProps && !nextProps) {
|
|
40355
|
+
return { type: 'delete', component };
|
|
40356
|
+
}
|
|
40357
|
+
if (!nextProps) {
|
|
40358
|
+
return;
|
|
40359
|
+
}
|
|
40360
|
+
if (!prevProps && nextProps) {
|
|
40361
|
+
return { type: 'add', props: nextProps, component };
|
|
40362
|
+
}
|
|
40363
|
+
if (isListener(component)) {
|
|
40364
|
+
if (!isEqual(prevProps, nextProps)) {
|
|
40365
|
+
return { type: 'put', component, props: nextProps };
|
|
40366
|
+
}
|
|
40367
|
+
}
|
|
40368
|
+
const changes = {};
|
|
40369
|
+
for (const k in prevProps) {
|
|
40370
|
+
const propKey = k;
|
|
40371
|
+
if (!isEqual(prevProps[propKey], nextProps[propKey])) {
|
|
40372
|
+
changes[propKey] = nextProps[propKey];
|
|
40373
|
+
}
|
|
40374
|
+
}
|
|
40375
|
+
if (!Object.keys(changes).length) {
|
|
40376
|
+
return;
|
|
40377
|
+
}
|
|
40378
|
+
return { type: 'put', props: changes, component };
|
|
40379
|
+
}
|
|
39754
40380
|
// as any HACK so every time we add a new component, we must add also the component here.
|
|
39755
40381
|
const entityComponent = {
|
|
39756
40382
|
uiText: undefined,
|
|
39757
40383
|
uiBackground: undefined,
|
|
39758
40384
|
uiTransform: undefined,
|
|
39759
|
-
|
|
40385
|
+
onMouseDown: undefined,
|
|
40386
|
+
onMouseUp: undefined,
|
|
40387
|
+
uiInput: undefined,
|
|
40388
|
+
uiDropdown: undefined
|
|
39760
40389
|
};
|
|
39761
40390
|
const componentKeys = Object.keys(entityComponent);
|
|
39762
40391
|
function isEqual(val1, val2) {
|
|
@@ -39838,8 +40467,6 @@
|
|
|
39838
40467
|
return null;
|
|
39839
40468
|
},
|
|
39840
40469
|
/* istanbul ignore next */
|
|
39841
|
-
removeChildFromContainer() { },
|
|
39842
|
-
/* istanbul ignore next */
|
|
39843
40470
|
commitMount(_instance, _type, _props, _internalInstanceHandle) { },
|
|
39844
40471
|
/* istanbul ignore next */
|
|
39845
40472
|
resetTextContent(_instance) { },
|
|
@@ -39880,61 +40507,55 @@
|
|
|
39880
40507
|
}
|
|
39881
40508
|
};
|
|
39882
40509
|
|
|
39883
|
-
function propsChanged(component, prevProps, nextProps) {
|
|
39884
|
-
if (prevProps && !nextProps) {
|
|
39885
|
-
return { type: 'delete', component };
|
|
39886
|
-
}
|
|
39887
|
-
if (!nextProps) {
|
|
39888
|
-
return;
|
|
39889
|
-
}
|
|
39890
|
-
if (!prevProps && nextProps) {
|
|
39891
|
-
return { type: 'add', props: nextProps, component };
|
|
39892
|
-
}
|
|
39893
|
-
if (isListener(component)) {
|
|
39894
|
-
if (!isEqual(prevProps, nextProps)) {
|
|
39895
|
-
return { type: 'put', component, props: nextProps };
|
|
39896
|
-
}
|
|
39897
|
-
}
|
|
39898
|
-
const changes = {};
|
|
39899
|
-
for (const k in prevProps) {
|
|
39900
|
-
const propKey = k;
|
|
39901
|
-
if (!isEqual(prevProps[propKey], nextProps[propKey])) {
|
|
39902
|
-
changes[propKey] = nextProps[propKey];
|
|
39903
|
-
}
|
|
39904
|
-
}
|
|
39905
|
-
if (!Object.keys(changes).length) {
|
|
39906
|
-
return;
|
|
39907
|
-
}
|
|
39908
|
-
return { type: 'put', props: changes, component };
|
|
39909
|
-
}
|
|
39910
40510
|
function createReconciler(engine, pointerEvents) {
|
|
40511
|
+
// Store all the entities so when we destroy the UI we can also destroy them
|
|
39911
40512
|
const entities = new Set();
|
|
40513
|
+
// Store the onChange callbacks to be runned every time a Result has changed
|
|
40514
|
+
const changeEvents = new Map();
|
|
40515
|
+
// Initialize components
|
|
39912
40516
|
const UiTransform = UiTransform$1(engine);
|
|
39913
40517
|
const UiText = UiText$1(engine);
|
|
39914
40518
|
const UiBackground = UiBackground$1(engine);
|
|
40519
|
+
const UiInput = UiInput$1(engine);
|
|
40520
|
+
const UiInputResult = UiInputResult$1(engine);
|
|
40521
|
+
const UiDropdown = UiDropdown$1(engine);
|
|
40522
|
+
const UiDropdownResult = UiDropdownResult$1(engine);
|
|
40523
|
+
// Component ID Helper
|
|
39915
40524
|
const getComponentId = {
|
|
39916
40525
|
uiTransform: UiTransform._id,
|
|
39917
40526
|
uiText: UiText._id,
|
|
39918
|
-
uiBackground: UiBackground._id
|
|
40527
|
+
uiBackground: UiBackground._id,
|
|
40528
|
+
uiInput: UiInput._id,
|
|
40529
|
+
uiDropdown: UiDropdown._id
|
|
39919
40530
|
};
|
|
39920
40531
|
function updateTree(instance, props) {
|
|
39921
40532
|
upsertComponent(instance, props, 'uiTransform');
|
|
39922
40533
|
}
|
|
39923
40534
|
function upsertListener(instance, update) {
|
|
39924
|
-
// TODO: This handles only onClick listener for the moment
|
|
39925
40535
|
if (update.type === 'delete' || !update.props) {
|
|
39926
|
-
|
|
40536
|
+
if (update.component === 'onMouseDown') {
|
|
40537
|
+
pointerEvents.removeOnPointerDown(instance.entity);
|
|
40538
|
+
}
|
|
40539
|
+
else if (update.component === 'onMouseUp') {
|
|
40540
|
+
pointerEvents.removeOnPointerUp(instance.entity);
|
|
40541
|
+
}
|
|
39927
40542
|
return;
|
|
39928
40543
|
}
|
|
39929
40544
|
if (update.props) {
|
|
39930
|
-
|
|
40545
|
+
const pointerEvent = update.component === 'onMouseDown'
|
|
40546
|
+
? pointerEvents.onPointerDown
|
|
40547
|
+
: pointerEvents.onPointerUp;
|
|
40548
|
+
pointerEvent(instance.entity, update.props, {
|
|
39931
40549
|
button: 0 /* InputAction.IA_POINTER */,
|
|
39932
|
-
|
|
40550
|
+
// We add this showFeedBack so the pointerEventSystem creates a PointerEvent component with our entity
|
|
40551
|
+
// This is needed for the renderer to know which entities are clickeables
|
|
40552
|
+
showFeedback: true
|
|
39933
40553
|
});
|
|
39934
40554
|
}
|
|
39935
40555
|
}
|
|
39936
40556
|
function removeComponent(instance, component) {
|
|
39937
|
-
const
|
|
40557
|
+
const componentId = getComponentId[component];
|
|
40558
|
+
const Component = engine.getComponent(componentId);
|
|
39938
40559
|
Component.deleteFrom(instance.entity);
|
|
39939
40560
|
}
|
|
39940
40561
|
function upsertComponent(instance, props, componentName) {
|
|
@@ -39944,10 +40565,17 @@
|
|
|
39944
40565
|
Component.create(instance.entity);
|
|
39945
40566
|
for (const key in props) {
|
|
39946
40567
|
const keyProp = key;
|
|
39947
|
-
|
|
40568
|
+
if (key === 'onChange') {
|
|
40569
|
+
const onChange = props[keyProp];
|
|
40570
|
+
updateOnChange(instance.entity, componentId, { fn: onChange });
|
|
40571
|
+
}
|
|
40572
|
+
else {
|
|
40573
|
+
component[keyProp] = props[keyProp];
|
|
40574
|
+
}
|
|
39948
40575
|
}
|
|
39949
40576
|
}
|
|
39950
40577
|
function removeChildEntity(instance) {
|
|
40578
|
+
changeEvents.delete(instance.entity);
|
|
39951
40579
|
engine.removeEntity(instance.entity);
|
|
39952
40580
|
for (const child of instance._child) {
|
|
39953
40581
|
removeChildEntity(child);
|
|
@@ -39993,6 +40621,14 @@
|
|
|
39993
40621
|
parentInstance._child.splice(childIndex, 1);
|
|
39994
40622
|
removeChildEntity(child);
|
|
39995
40623
|
}
|
|
40624
|
+
function updateOnChange(entity, componentId, state) {
|
|
40625
|
+
const event = changeEvents.get(entity) ||
|
|
40626
|
+
changeEvents.set(entity, new Map()).get(entity);
|
|
40627
|
+
const oldState = event.get(componentId);
|
|
40628
|
+
const fn = state?.fn;
|
|
40629
|
+
const value = state?.value ?? oldState?.value;
|
|
40630
|
+
event.set(componentId, { fn, value });
|
|
40631
|
+
}
|
|
39996
40632
|
const hostConfig = {
|
|
39997
40633
|
...noopConfig,
|
|
39998
40634
|
createInstance(type, props) {
|
|
@@ -40031,7 +40667,7 @@
|
|
|
40031
40667
|
.map((component) => propsChanged(component, oldProps[component], newProps[component]))
|
|
40032
40668
|
.filter(isNotUndefined);
|
|
40033
40669
|
},
|
|
40034
|
-
commitUpdate(instance, updatePayload, _type,
|
|
40670
|
+
commitUpdate(instance, updatePayload, _type, _prevProps, _nextProps, _internalHandle) {
|
|
40035
40671
|
for (const update of updatePayload) {
|
|
40036
40672
|
if (isListener(update.component)) {
|
|
40037
40673
|
upsertListener(instance, update);
|
|
@@ -40057,14 +40693,36 @@
|
|
|
40057
40693
|
child.parent = parentInstance.entity;
|
|
40058
40694
|
updateTree(child, { rightOf: child.rightOf, parent: child.parent });
|
|
40059
40695
|
updateTree(beforeChild, { rightOf: beforeChild.rightOf });
|
|
40696
|
+
},
|
|
40697
|
+
removeChildFromContainer(parenInstance, child) {
|
|
40698
|
+
removeChildEntity(child);
|
|
40060
40699
|
}
|
|
40061
40700
|
};
|
|
40062
40701
|
const reconciler = reactReconcilerExports(hostConfig);
|
|
40063
40702
|
const root = reconciler.createContainer({}, 0, null, false, null, '',
|
|
40064
40703
|
/* istanbul ignore next */
|
|
40065
40704
|
function () { }, null);
|
|
40705
|
+
// Maybe this could be something similar to Input system, but since we
|
|
40706
|
+
// are going to use this only here, i prefer to scope it here.
|
|
40707
|
+
function handleOnChange(componentId, resultComponent) {
|
|
40708
|
+
for (const [entity, Result] of engine.getEntitiesWith(resultComponent)) {
|
|
40709
|
+
const entityState = changeEvents.get(entity)?.get(componentId);
|
|
40710
|
+
if (entityState?.fn && Result.value !== entityState.value) {
|
|
40711
|
+
// Call onChange callback and update internal timestamp
|
|
40712
|
+
entityState.fn(Result.value);
|
|
40713
|
+
updateOnChange(entity, componentId, {
|
|
40714
|
+
fn: entityState.fn,
|
|
40715
|
+
value: Result.value
|
|
40716
|
+
});
|
|
40717
|
+
}
|
|
40718
|
+
}
|
|
40719
|
+
}
|
|
40066
40720
|
return {
|
|
40067
40721
|
update: function (component) {
|
|
40722
|
+
if (changeEvents.size) {
|
|
40723
|
+
handleOnChange(UiInput._id, UiInputResult);
|
|
40724
|
+
handleOnChange(UiDropdown._id, UiDropdownResult);
|
|
40725
|
+
}
|
|
40068
40726
|
return reconciler.updateContainer(component, root, null);
|
|
40069
40727
|
},
|
|
40070
40728
|
getEntities: () => Array.from(entities)
|
|
@@ -40450,13 +41108,17 @@
|
|
|
40450
41108
|
ECSComponentIDs[ECSComponentIDs["MeshCollider"] = 1019] = "MeshCollider";
|
|
40451
41109
|
ECSComponentIDs[ECSComponentIDs["MeshRenderer"] = 1018] = "MeshRenderer";
|
|
40452
41110
|
ECSComponentIDs[ECSComponentIDs["NftShape"] = 1040] = "NftShape";
|
|
41111
|
+
ECSComponentIDs[ECSComponentIDs["PointerEvents"] = 1062] = "PointerEvents";
|
|
40453
41112
|
ECSComponentIDs[ECSComponentIDs["PointerEventsResult"] = 1063] = "PointerEventsResult";
|
|
40454
|
-
ECSComponentIDs[ECSComponentIDs["PointerHoverFeedback"] = 1062] = "PointerHoverFeedback";
|
|
40455
41113
|
ECSComponentIDs[ECSComponentIDs["PointerLock"] = 1074] = "PointerLock";
|
|
40456
41114
|
ECSComponentIDs[ECSComponentIDs["Raycast"] = 1067] = "Raycast";
|
|
40457
41115
|
ECSComponentIDs[ECSComponentIDs["RaycastResult"] = 1068] = "RaycastResult";
|
|
40458
41116
|
ECSComponentIDs[ECSComponentIDs["TextShape"] = 1030] = "TextShape";
|
|
40459
41117
|
ECSComponentIDs[ECSComponentIDs["UiBackground"] = 1053] = "UiBackground";
|
|
41118
|
+
ECSComponentIDs[ECSComponentIDs["UiDropdown"] = 1094] = "UiDropdown";
|
|
41119
|
+
ECSComponentIDs[ECSComponentIDs["UiDropdownResult"] = 1096] = "UiDropdownResult";
|
|
41120
|
+
ECSComponentIDs[ECSComponentIDs["UiInput"] = 1093] = "UiInput";
|
|
41121
|
+
ECSComponentIDs[ECSComponentIDs["UiInputResult"] = 1095] = "UiInputResult";
|
|
40460
41122
|
ECSComponentIDs[ECSComponentIDs["UiText"] = 1052] = "UiText";
|
|
40461
41123
|
ECSComponentIDs[ECSComponentIDs["UiTransform"] = 1050] = "UiTransform";
|
|
40462
41124
|
ECSComponentIDs[ECSComponentIDs["VisibilityComponent"] = 1081] = "VisibilityComponent";
|
|
@@ -40513,15 +41175,19 @@
|
|
|
40513
41175
|
exports.AvatarShape = AvatarShape;
|
|
40514
41176
|
exports.AvatarTexture = AvatarTexture;
|
|
40515
41177
|
exports.Billboard = Billboard;
|
|
41178
|
+
exports.BorderRect = BorderRect;
|
|
41179
|
+
exports.Button = Button;
|
|
40516
41180
|
exports.CANVAS_ROOT_ENTITY = CANVAS_ROOT_ENTITY;
|
|
40517
41181
|
exports.CameraMode = CameraMode;
|
|
40518
41182
|
exports.CameraModeArea = CameraModeArea;
|
|
40519
|
-
exports.Container = Container;
|
|
40520
41183
|
exports.DEG2RAD = DEG2RAD;
|
|
41184
|
+
exports.Dropdown = Dropdown;
|
|
40521
41185
|
exports.Engine = Engine;
|
|
40522
41186
|
exports.EntityContainer = EntityContainer;
|
|
40523
41187
|
exports.Epsilon = Epsilon;
|
|
40524
41188
|
exports.GltfContainer = GltfContainer;
|
|
41189
|
+
exports.Input = Input;
|
|
41190
|
+
exports.Label = Label;
|
|
40525
41191
|
exports.Material = Material;
|
|
40526
41192
|
exports.MeshCollider = MeshCollider;
|
|
40527
41193
|
exports.MeshRenderer = MeshRenderer;
|
|
@@ -40555,21 +41221,25 @@
|
|
|
40555
41221
|
exports.PBMeshRenderer_PlaneMesh = PBMeshRenderer_PlaneMesh;
|
|
40556
41222
|
exports.PBMeshRenderer_SphereMesh = PBMeshRenderer_SphereMesh;
|
|
40557
41223
|
exports.PBNftShape = PBNftShape;
|
|
41224
|
+
exports.PBPointerEvents = PBPointerEvents;
|
|
40558
41225
|
exports.PBPointerEventsResult = PBPointerEventsResult;
|
|
40559
41226
|
exports.PBPointerEventsResult_PointerCommand = PBPointerEventsResult_PointerCommand;
|
|
40560
|
-
exports.
|
|
40561
|
-
exports.
|
|
40562
|
-
exports.PBPointerHoverFeedback_Info = PBPointerHoverFeedback_Info;
|
|
41227
|
+
exports.PBPointerEvents_Entry = PBPointerEvents_Entry;
|
|
41228
|
+
exports.PBPointerEvents_Info = PBPointerEvents_Info;
|
|
40563
41229
|
exports.PBPointerLock = PBPointerLock;
|
|
40564
41230
|
exports.PBRaycast = PBRaycast;
|
|
40565
41231
|
exports.PBRaycastResult = PBRaycastResult;
|
|
40566
41232
|
exports.PBTextShape = PBTextShape;
|
|
40567
41233
|
exports.PBUiBackground = PBUiBackground;
|
|
41234
|
+
exports.PBUiDropdown = PBUiDropdown;
|
|
41235
|
+
exports.PBUiDropdownResult = PBUiDropdownResult;
|
|
41236
|
+
exports.PBUiInput = PBUiInput;
|
|
41237
|
+
exports.PBUiInputResult = PBUiInputResult;
|
|
40568
41238
|
exports.PBUiText = PBUiText;
|
|
40569
41239
|
exports.PBUiTransform = PBUiTransform;
|
|
40570
41240
|
exports.PBVisibilityComponent = PBVisibilityComponent;
|
|
41241
|
+
exports.PointerEvents = PointerEvents;
|
|
40571
41242
|
exports.PointerEventsResult = PointerEventsResult;
|
|
40572
|
-
exports.PointerHoverFeedback = PointerHoverFeedback;
|
|
40573
41243
|
exports.PointerLock = PointerLock;
|
|
40574
41244
|
exports.RAD2DEG = RAD2DEG;
|
|
40575
41245
|
exports.Raycast = Raycast;
|
|
@@ -40584,7 +41254,11 @@
|
|
|
40584
41254
|
exports.ToLinearSpace = ToLinearSpace;
|
|
40585
41255
|
exports.Transform = Transform;
|
|
40586
41256
|
exports.UiBackground = UiBackground;
|
|
41257
|
+
exports.UiDropdown = UiDropdown;
|
|
41258
|
+
exports.UiDropdownResult = UiDropdownResult;
|
|
40587
41259
|
exports.UiEntity = UiEntity;
|
|
41260
|
+
exports.UiInput = UiInput;
|
|
41261
|
+
exports.UiInputResult = UiInputResult;
|
|
40588
41262
|
exports.UiText = UiText;
|
|
40589
41263
|
exports.UiTransform = UiTransform;
|
|
40590
41264
|
exports.VisibilityComponent = VisibilityComponent;
|