@dcl/playground-assets 7.0.6-3807227301.commit-1045452 → 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 +267 -70
- package/dist/beta.d.ts +267 -70
- package/dist/index.bundled.d.ts +267 -70
- package/dist/index.js +936 -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 +268 -71
- package/etc/playground-assets.api.json +2889 -882
- package/etc/playground-assets.api.md +251 -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 };
|
|
@@ -11304,37 +11304,453 @@
|
|
|
11304
11304
|
builder.writeBuffer(buffer, false);
|
|
11305
11305
|
},
|
|
11306
11306
|
deserialize(reader) {
|
|
11307
|
-
return PBTextShape.decode(reader.buffer(), reader.remainingBytes());
|
|
11307
|
+
return PBTextShape.decode(reader.buffer(), reader.remainingBytes());
|
|
11308
|
+
},
|
|
11309
|
+
create() {
|
|
11310
|
+
// TODO: this is a hack.
|
|
11311
|
+
return PBTextShape.decode(new Uint8Array());
|
|
11312
|
+
}
|
|
11313
|
+
};
|
|
11314
|
+
|
|
11315
|
+
/* eslint-disable */
|
|
11316
|
+
function createBaseBorderRect() {
|
|
11317
|
+
return { top: 0, left: 0, right: 0, bottom: 0 };
|
|
11318
|
+
}
|
|
11319
|
+
/**
|
|
11320
|
+
* Internal
|
|
11321
|
+
*/
|
|
11322
|
+
const BorderRect = {
|
|
11323
|
+
encode(message, writer = minimalExports.Writer.create()) {
|
|
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());
|
|
11308
11724
|
},
|
|
11309
11725
|
create() {
|
|
11310
11726
|
// TODO: this is a hack.
|
|
11311
|
-
return
|
|
11727
|
+
return PBUiInput.decode(new Uint8Array());
|
|
11312
11728
|
}
|
|
11313
11729
|
};
|
|
11314
11730
|
|
|
11315
11731
|
/* eslint-disable */
|
|
11316
|
-
function
|
|
11317
|
-
return {
|
|
11732
|
+
function createBasePBUiInputResult() {
|
|
11733
|
+
return { value: '' };
|
|
11318
11734
|
}
|
|
11319
11735
|
/**
|
|
11320
11736
|
* Internal
|
|
11321
11737
|
*/
|
|
11322
|
-
const
|
|
11738
|
+
const PBUiInputResult = {
|
|
11323
11739
|
encode(message, writer = minimalExports.Writer.create()) {
|
|
11324
|
-
if (message.
|
|
11325
|
-
|
|
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
|
|
@@ -14117,7 +14546,7 @@
|
|
|
14117
14546
|
}
|
|
14118
14547
|
|
|
14119
14548
|
function createPointerEventSystem(engine, inputSystem) {
|
|
14120
|
-
const
|
|
14549
|
+
const PointerEvents = PointerEvents$1(engine);
|
|
14121
14550
|
let EventType;
|
|
14122
14551
|
(function (EventType) {
|
|
14123
14552
|
EventType[EventType["Click"] = 0] = "Click";
|
|
@@ -14126,31 +14555,28 @@
|
|
|
14126
14555
|
})(EventType || (EventType = {}));
|
|
14127
14556
|
const getDefaultOpts = (opts = {}) => ({
|
|
14128
14557
|
button: 3 /* InputAction.IA_ANY */,
|
|
14129
|
-
hoverText: 'Interact',
|
|
14130
|
-
maxDistance: 100,
|
|
14131
14558
|
...opts
|
|
14132
14559
|
});
|
|
14133
14560
|
const eventsMap = new Map();
|
|
14134
14561
|
function getEvent(entity) {
|
|
14135
14562
|
return (eventsMap.get(entity) || eventsMap.set(entity, new Map()).get(entity));
|
|
14136
14563
|
}
|
|
14137
|
-
function
|
|
14138
|
-
if (opts.hoverText) {
|
|
14139
|
-
const pointerEvent =
|
|
14140
|
-
PointerHoverFeedback.create(entity);
|
|
14564
|
+
function setPointerEvent(entity, type, opts) {
|
|
14565
|
+
if (opts.hoverText || opts.showFeedback) {
|
|
14566
|
+
const pointerEvent = PointerEvents.getMutableOrNull(entity) || PointerEvents.create(entity);
|
|
14141
14567
|
pointerEvent.pointerEvents.push({
|
|
14142
14568
|
eventType: type,
|
|
14143
14569
|
eventInfo: {
|
|
14144
14570
|
button: opts.button,
|
|
14145
|
-
showFeedback:
|
|
14571
|
+
showFeedback: opts.showFeedback,
|
|
14146
14572
|
hoverText: opts.hoverText,
|
|
14147
14573
|
maxDistance: opts.maxDistance
|
|
14148
14574
|
}
|
|
14149
14575
|
});
|
|
14150
14576
|
}
|
|
14151
14577
|
}
|
|
14152
|
-
function
|
|
14153
|
-
const pointerEvent =
|
|
14578
|
+
function removePointerEvent(entity, type, button) {
|
|
14579
|
+
const pointerEvent = PointerEvents.getMutableOrNull(entity);
|
|
14154
14580
|
if (!pointerEvent)
|
|
14155
14581
|
return;
|
|
14156
14582
|
pointerEvent.pointerEvents = pointerEvent.pointerEvents.filter((pointer) => !(pointer.eventInfo?.button === button && pointer.eventType === type));
|
|
@@ -14165,7 +14591,7 @@
|
|
|
14165
14591
|
const event = getEvent(entity);
|
|
14166
14592
|
const pointerEvent = event.get(type);
|
|
14167
14593
|
if (pointerEvent?.opts.hoverText) {
|
|
14168
|
-
|
|
14594
|
+
removePointerEvent(entity, getPointerEvent(type), pointerEvent.opts.button);
|
|
14169
14595
|
}
|
|
14170
14596
|
event.delete(type);
|
|
14171
14597
|
}
|
|
@@ -14229,7 +14655,7 @@
|
|
|
14229
14655
|
removeEvent(entity, EventType.Click);
|
|
14230
14656
|
// Set new event
|
|
14231
14657
|
getEvent(entity).set(EventType.Click, { cb, opts: options });
|
|
14232
|
-
|
|
14658
|
+
setPointerEvent(entity, 1 /* PointerEventType.PET_DOWN */, options);
|
|
14233
14659
|
},
|
|
14234
14660
|
/**
|
|
14235
14661
|
* @public
|
|
@@ -14242,7 +14668,7 @@
|
|
|
14242
14668
|
const options = getDefaultOpts(opts);
|
|
14243
14669
|
removeEvent(entity, EventType.Down);
|
|
14244
14670
|
getEvent(entity).set(EventType.Down, { cb, opts: options });
|
|
14245
|
-
|
|
14671
|
+
setPointerEvent(entity, 1 /* PointerEventType.PET_DOWN */, options);
|
|
14246
14672
|
},
|
|
14247
14673
|
/**
|
|
14248
14674
|
* @public
|
|
@@ -14255,7 +14681,7 @@
|
|
|
14255
14681
|
const options = getDefaultOpts(opts);
|
|
14256
14682
|
removeEvent(entity, EventType.Up);
|
|
14257
14683
|
getEvent(entity).set(EventType.Up, { cb, opts: options });
|
|
14258
|
-
|
|
14684
|
+
setPointerEvent(entity, 0 /* PointerEventType.PET_UP */, options);
|
|
14259
14685
|
}
|
|
14260
14686
|
};
|
|
14261
14687
|
}
|
|
@@ -14277,33 +14703,6 @@
|
|
|
14277
14703
|
|
|
14278
14704
|
const executeTask = createTaskSystem(engine).executeTask;
|
|
14279
14705
|
|
|
14280
|
-
/* eslint-disable */
|
|
14281
|
-
exports.CameraType = void 0;
|
|
14282
|
-
(function (CameraType) {
|
|
14283
|
-
CameraType[CameraType["CT_FIRST_PERSON"] = 0] = "CT_FIRST_PERSON";
|
|
14284
|
-
CameraType[CameraType["CT_THIRD_PERSON"] = 1] = "CT_THIRD_PERSON";
|
|
14285
|
-
})(exports.CameraType || (exports.CameraType = {}));
|
|
14286
|
-
|
|
14287
|
-
/* eslint-disable */
|
|
14288
|
-
exports.TextAlignMode = void 0;
|
|
14289
|
-
(function (TextAlignMode) {
|
|
14290
|
-
TextAlignMode[TextAlignMode["TAM_TOP_LEFT"] = 0] = "TAM_TOP_LEFT";
|
|
14291
|
-
TextAlignMode[TextAlignMode["TAM_TOP_CENTER"] = 1] = "TAM_TOP_CENTER";
|
|
14292
|
-
TextAlignMode[TextAlignMode["TAM_TOP_RIGHT"] = 2] = "TAM_TOP_RIGHT";
|
|
14293
|
-
TextAlignMode[TextAlignMode["TAM_MIDDLE_LEFT"] = 3] = "TAM_MIDDLE_LEFT";
|
|
14294
|
-
TextAlignMode[TextAlignMode["TAM_MIDDLE_CENTER"] = 4] = "TAM_MIDDLE_CENTER";
|
|
14295
|
-
TextAlignMode[TextAlignMode["TAM_MIDDLE_RIGHT"] = 5] = "TAM_MIDDLE_RIGHT";
|
|
14296
|
-
TextAlignMode[TextAlignMode["TAM_BOTTOM_LEFT"] = 6] = "TAM_BOTTOM_LEFT";
|
|
14297
|
-
TextAlignMode[TextAlignMode["TAM_BOTTOM_CENTER"] = 7] = "TAM_BOTTOM_CENTER";
|
|
14298
|
-
TextAlignMode[TextAlignMode["TAM_BOTTOM_RIGHT"] = 8] = "TAM_BOTTOM_RIGHT";
|
|
14299
|
-
})(exports.TextAlignMode || (exports.TextAlignMode = {}));
|
|
14300
|
-
exports.Font = void 0;
|
|
14301
|
-
(function (Font) {
|
|
14302
|
-
Font[Font["F_SANS_SERIF"] = 0] = "F_SANS_SERIF";
|
|
14303
|
-
Font[Font["F_SERIF"] = 1] = "F_SERIF";
|
|
14304
|
-
Font[Font["F_MONOSPACE"] = 2] = "F_MONOSPACE";
|
|
14305
|
-
})(exports.Font || (exports.Font = {}));
|
|
14306
|
-
|
|
14307
14706
|
/**
|
|
14308
14707
|
* Transform parenting: cyclic dependency checker
|
|
14309
14708
|
* It checks only in modified Transforms
|
|
@@ -14347,17 +14746,28 @@
|
|
|
14347
14746
|
/** @public */ const CameraModeArea = CameraModeArea$1(engine);
|
|
14348
14747
|
/** @public */ const GltfContainer = GltfContainer$1(engine);
|
|
14349
14748
|
/** @public */ const NftShape = NftShape$1(engine);
|
|
14749
|
+
/** @public */ const PointerEvents = PointerEvents$1(engine);
|
|
14350
14750
|
/** @public */ const PointerEventsResult = PointerEventsResult$1(engine);
|
|
14351
|
-
/** @public */ const PointerHoverFeedback = PointerHoverFeedback$1(engine);
|
|
14352
14751
|
/** @public */ const PointerLock = PointerLock$1(engine);
|
|
14353
14752
|
/** @public */ const Raycast = Raycast$1(engine);
|
|
14354
14753
|
/** @public */ const RaycastResult = RaycastResult$1(engine);
|
|
14355
14754
|
/** @public */ const TextShape = TextShape$1(engine);
|
|
14356
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);
|
|
14357
14760
|
/** @public */ const UiText = UiText$1(engine);
|
|
14358
14761
|
/** @public */ const UiTransform = UiTransform$1(engine);
|
|
14359
14762
|
/** @public */ const VisibilityComponent = VisibilityComponent$1(engine);
|
|
14360
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
|
+
|
|
14361
14771
|
/* eslint-disable */
|
|
14362
14772
|
exports.InputAction = void 0;
|
|
14363
14773
|
(function (InputAction) {
|
|
@@ -14377,6 +14787,26 @@
|
|
|
14377
14787
|
InputAction[InputAction["IA_ACTION_6"] = 13] = "IA_ACTION_6";
|
|
14378
14788
|
})(exports.InputAction || (exports.InputAction = {}));
|
|
14379
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
|
+
|
|
14380
14810
|
// The order of the following imports matters. Please do not auto-sort
|
|
14381
14811
|
// export components for global engine
|
|
14382
14812
|
const Transform = Transform$1(engine);
|
|
@@ -39678,25 +40108,6 @@
|
|
|
39678
40108
|
}
|
|
39679
40109
|
|
|
39680
40110
|
const CANVAS_ROOT_ENTITY = 0;
|
|
39681
|
-
/**
|
|
39682
|
-
* @public
|
|
39683
|
-
*/
|
|
39684
|
-
function parseUiTransform(props = {}) {
|
|
39685
|
-
const { position, padding, margin, height, minHeight, maxHeight, width, maxWidth, minWidth, ...otherProps } = props;
|
|
39686
|
-
return {
|
|
39687
|
-
...defaultUiTransform,
|
|
39688
|
-
...otherProps,
|
|
39689
|
-
...parsePosition(position, 'position'),
|
|
39690
|
-
...parsePosition(margin, 'margin'),
|
|
39691
|
-
...parsePosition(padding, 'padding'),
|
|
39692
|
-
...parseSize(height, 'height'),
|
|
39693
|
-
...parseSize(minHeight, 'minHeight'),
|
|
39694
|
-
...parseSize(maxHeight, 'maxHeight'),
|
|
39695
|
-
...parseSize(width, 'width'),
|
|
39696
|
-
...parseSize(minWidth, 'minWidth'),
|
|
39697
|
-
...parseSize(maxWidth, 'maxWidth')
|
|
39698
|
-
};
|
|
39699
|
-
}
|
|
39700
40111
|
const defaultUiTransform = {
|
|
39701
40112
|
parent: CANVAS_ROOT_ENTITY,
|
|
39702
40113
|
rightOf: 0,
|
|
@@ -39746,31 +40157,235 @@
|
|
|
39746
40157
|
widthUnit: 0 /* YGUnit.YGU_UNDEFINED */,
|
|
39747
40158
|
heightUnit: 0 /* YGUnit.YGU_UNDEFINED */
|
|
39748
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
|
+
}
|
|
39749
40237
|
|
|
39750
40238
|
const listeners = {
|
|
39751
|
-
|
|
40239
|
+
onMouseDown: undefined,
|
|
40240
|
+
onMouseUp: undefined
|
|
39752
40241
|
};
|
|
39753
40242
|
const listenersKey = Object.keys(listeners);
|
|
39754
40243
|
const isListener = (key) => listenersKey.includes(key);
|
|
39755
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
|
+
}
|
|
39756
40254
|
/**
|
|
39757
40255
|
* @public
|
|
39758
40256
|
*/
|
|
39759
|
-
|
|
39760
|
-
|
|
39761
|
-
const
|
|
39762
|
-
|
|
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 }));
|
|
39763
40343
|
}
|
|
39764
|
-
|
|
39765
|
-
|
|
40344
|
+
|
|
40345
|
+
/**
|
|
40346
|
+
* @public
|
|
40347
|
+
*/
|
|
40348
|
+
|
|
40349
|
+
function UiEntity(props) {
|
|
40350
|
+
return ReactEcs$1.createElement("entity", { ...parseProps(props) });
|
|
39766
40351
|
}
|
|
39767
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
|
+
}
|
|
39768
40380
|
// as any HACK so every time we add a new component, we must add also the component here.
|
|
39769
40381
|
const entityComponent = {
|
|
39770
40382
|
uiText: undefined,
|
|
39771
40383
|
uiBackground: undefined,
|
|
39772
40384
|
uiTransform: undefined,
|
|
39773
|
-
|
|
40385
|
+
onMouseDown: undefined,
|
|
40386
|
+
onMouseUp: undefined,
|
|
40387
|
+
uiInput: undefined,
|
|
40388
|
+
uiDropdown: undefined
|
|
39774
40389
|
};
|
|
39775
40390
|
const componentKeys = Object.keys(entityComponent);
|
|
39776
40391
|
function isEqual(val1, val2) {
|
|
@@ -39852,8 +40467,6 @@
|
|
|
39852
40467
|
return null;
|
|
39853
40468
|
},
|
|
39854
40469
|
/* istanbul ignore next */
|
|
39855
|
-
removeChildFromContainer() { },
|
|
39856
|
-
/* istanbul ignore next */
|
|
39857
40470
|
commitMount(_instance, _type, _props, _internalInstanceHandle) { },
|
|
39858
40471
|
/* istanbul ignore next */
|
|
39859
40472
|
resetTextContent(_instance) { },
|
|
@@ -39894,61 +40507,55 @@
|
|
|
39894
40507
|
}
|
|
39895
40508
|
};
|
|
39896
40509
|
|
|
39897
|
-
function propsChanged(component, prevProps, nextProps) {
|
|
39898
|
-
if (prevProps && !nextProps) {
|
|
39899
|
-
return { type: 'delete', component };
|
|
39900
|
-
}
|
|
39901
|
-
if (!nextProps) {
|
|
39902
|
-
return;
|
|
39903
|
-
}
|
|
39904
|
-
if (!prevProps && nextProps) {
|
|
39905
|
-
return { type: 'add', props: nextProps, component };
|
|
39906
|
-
}
|
|
39907
|
-
if (isListener(component)) {
|
|
39908
|
-
if (!isEqual(prevProps, nextProps)) {
|
|
39909
|
-
return { type: 'put', component, props: nextProps };
|
|
39910
|
-
}
|
|
39911
|
-
}
|
|
39912
|
-
const changes = {};
|
|
39913
|
-
for (const k in prevProps) {
|
|
39914
|
-
const propKey = k;
|
|
39915
|
-
if (!isEqual(prevProps[propKey], nextProps[propKey])) {
|
|
39916
|
-
changes[propKey] = nextProps[propKey];
|
|
39917
|
-
}
|
|
39918
|
-
}
|
|
39919
|
-
if (!Object.keys(changes).length) {
|
|
39920
|
-
return;
|
|
39921
|
-
}
|
|
39922
|
-
return { type: 'put', props: changes, component };
|
|
39923
|
-
}
|
|
39924
40510
|
function createReconciler(engine, pointerEvents) {
|
|
40511
|
+
// Store all the entities so when we destroy the UI we can also destroy them
|
|
39925
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
|
|
39926
40516
|
const UiTransform = UiTransform$1(engine);
|
|
39927
40517
|
const UiText = UiText$1(engine);
|
|
39928
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
|
|
39929
40524
|
const getComponentId = {
|
|
39930
40525
|
uiTransform: UiTransform._id,
|
|
39931
40526
|
uiText: UiText._id,
|
|
39932
|
-
uiBackground: UiBackground._id
|
|
40527
|
+
uiBackground: UiBackground._id,
|
|
40528
|
+
uiInput: UiInput._id,
|
|
40529
|
+
uiDropdown: UiDropdown._id
|
|
39933
40530
|
};
|
|
39934
40531
|
function updateTree(instance, props) {
|
|
39935
40532
|
upsertComponent(instance, props, 'uiTransform');
|
|
39936
40533
|
}
|
|
39937
40534
|
function upsertListener(instance, update) {
|
|
39938
|
-
// TODO: This handles only onClick listener for the moment
|
|
39939
40535
|
if (update.type === 'delete' || !update.props) {
|
|
39940
|
-
|
|
40536
|
+
if (update.component === 'onMouseDown') {
|
|
40537
|
+
pointerEvents.removeOnPointerDown(instance.entity);
|
|
40538
|
+
}
|
|
40539
|
+
else if (update.component === 'onMouseUp') {
|
|
40540
|
+
pointerEvents.removeOnPointerUp(instance.entity);
|
|
40541
|
+
}
|
|
39941
40542
|
return;
|
|
39942
40543
|
}
|
|
39943
40544
|
if (update.props) {
|
|
39944
|
-
|
|
40545
|
+
const pointerEvent = update.component === 'onMouseDown'
|
|
40546
|
+
? pointerEvents.onPointerDown
|
|
40547
|
+
: pointerEvents.onPointerUp;
|
|
40548
|
+
pointerEvent(instance.entity, update.props, {
|
|
39945
40549
|
button: 0 /* InputAction.IA_POINTER */,
|
|
39946
|
-
|
|
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
|
|
39947
40553
|
});
|
|
39948
40554
|
}
|
|
39949
40555
|
}
|
|
39950
40556
|
function removeComponent(instance, component) {
|
|
39951
|
-
const
|
|
40557
|
+
const componentId = getComponentId[component];
|
|
40558
|
+
const Component = engine.getComponent(componentId);
|
|
39952
40559
|
Component.deleteFrom(instance.entity);
|
|
39953
40560
|
}
|
|
39954
40561
|
function upsertComponent(instance, props, componentName) {
|
|
@@ -39958,10 +40565,17 @@
|
|
|
39958
40565
|
Component.create(instance.entity);
|
|
39959
40566
|
for (const key in props) {
|
|
39960
40567
|
const keyProp = key;
|
|
39961
|
-
|
|
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
|
+
}
|
|
39962
40575
|
}
|
|
39963
40576
|
}
|
|
39964
40577
|
function removeChildEntity(instance) {
|
|
40578
|
+
changeEvents.delete(instance.entity);
|
|
39965
40579
|
engine.removeEntity(instance.entity);
|
|
39966
40580
|
for (const child of instance._child) {
|
|
39967
40581
|
removeChildEntity(child);
|
|
@@ -40007,6 +40621,14 @@
|
|
|
40007
40621
|
parentInstance._child.splice(childIndex, 1);
|
|
40008
40622
|
removeChildEntity(child);
|
|
40009
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
|
+
}
|
|
40010
40632
|
const hostConfig = {
|
|
40011
40633
|
...noopConfig,
|
|
40012
40634
|
createInstance(type, props) {
|
|
@@ -40045,7 +40667,7 @@
|
|
|
40045
40667
|
.map((component) => propsChanged(component, oldProps[component], newProps[component]))
|
|
40046
40668
|
.filter(isNotUndefined);
|
|
40047
40669
|
},
|
|
40048
|
-
commitUpdate(instance, updatePayload, _type,
|
|
40670
|
+
commitUpdate(instance, updatePayload, _type, _prevProps, _nextProps, _internalHandle) {
|
|
40049
40671
|
for (const update of updatePayload) {
|
|
40050
40672
|
if (isListener(update.component)) {
|
|
40051
40673
|
upsertListener(instance, update);
|
|
@@ -40071,14 +40693,36 @@
|
|
|
40071
40693
|
child.parent = parentInstance.entity;
|
|
40072
40694
|
updateTree(child, { rightOf: child.rightOf, parent: child.parent });
|
|
40073
40695
|
updateTree(beforeChild, { rightOf: beforeChild.rightOf });
|
|
40696
|
+
},
|
|
40697
|
+
removeChildFromContainer(parenInstance, child) {
|
|
40698
|
+
removeChildEntity(child);
|
|
40074
40699
|
}
|
|
40075
40700
|
};
|
|
40076
40701
|
const reconciler = reactReconcilerExports(hostConfig);
|
|
40077
40702
|
const root = reconciler.createContainer({}, 0, null, false, null, '',
|
|
40078
40703
|
/* istanbul ignore next */
|
|
40079
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
|
+
}
|
|
40080
40720
|
return {
|
|
40081
40721
|
update: function (component) {
|
|
40722
|
+
if (changeEvents.size) {
|
|
40723
|
+
handleOnChange(UiInput._id, UiInputResult);
|
|
40724
|
+
handleOnChange(UiDropdown._id, UiDropdownResult);
|
|
40725
|
+
}
|
|
40082
40726
|
return reconciler.updateContainer(component, root, null);
|
|
40083
40727
|
},
|
|
40084
40728
|
getEntities: () => Array.from(entities)
|
|
@@ -40464,13 +41108,17 @@
|
|
|
40464
41108
|
ECSComponentIDs[ECSComponentIDs["MeshCollider"] = 1019] = "MeshCollider";
|
|
40465
41109
|
ECSComponentIDs[ECSComponentIDs["MeshRenderer"] = 1018] = "MeshRenderer";
|
|
40466
41110
|
ECSComponentIDs[ECSComponentIDs["NftShape"] = 1040] = "NftShape";
|
|
41111
|
+
ECSComponentIDs[ECSComponentIDs["PointerEvents"] = 1062] = "PointerEvents";
|
|
40467
41112
|
ECSComponentIDs[ECSComponentIDs["PointerEventsResult"] = 1063] = "PointerEventsResult";
|
|
40468
|
-
ECSComponentIDs[ECSComponentIDs["PointerHoverFeedback"] = 1062] = "PointerHoverFeedback";
|
|
40469
41113
|
ECSComponentIDs[ECSComponentIDs["PointerLock"] = 1074] = "PointerLock";
|
|
40470
41114
|
ECSComponentIDs[ECSComponentIDs["Raycast"] = 1067] = "Raycast";
|
|
40471
41115
|
ECSComponentIDs[ECSComponentIDs["RaycastResult"] = 1068] = "RaycastResult";
|
|
40472
41116
|
ECSComponentIDs[ECSComponentIDs["TextShape"] = 1030] = "TextShape";
|
|
40473
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";
|
|
40474
41122
|
ECSComponentIDs[ECSComponentIDs["UiText"] = 1052] = "UiText";
|
|
40475
41123
|
ECSComponentIDs[ECSComponentIDs["UiTransform"] = 1050] = "UiTransform";
|
|
40476
41124
|
ECSComponentIDs[ECSComponentIDs["VisibilityComponent"] = 1081] = "VisibilityComponent";
|
|
@@ -40527,15 +41175,19 @@
|
|
|
40527
41175
|
exports.AvatarShape = AvatarShape;
|
|
40528
41176
|
exports.AvatarTexture = AvatarTexture;
|
|
40529
41177
|
exports.Billboard = Billboard;
|
|
41178
|
+
exports.BorderRect = BorderRect;
|
|
41179
|
+
exports.Button = Button;
|
|
40530
41180
|
exports.CANVAS_ROOT_ENTITY = CANVAS_ROOT_ENTITY;
|
|
40531
41181
|
exports.CameraMode = CameraMode;
|
|
40532
41182
|
exports.CameraModeArea = CameraModeArea;
|
|
40533
|
-
exports.Container = Container;
|
|
40534
41183
|
exports.DEG2RAD = DEG2RAD;
|
|
41184
|
+
exports.Dropdown = Dropdown;
|
|
40535
41185
|
exports.Engine = Engine;
|
|
40536
41186
|
exports.EntityContainer = EntityContainer;
|
|
40537
41187
|
exports.Epsilon = Epsilon;
|
|
40538
41188
|
exports.GltfContainer = GltfContainer;
|
|
41189
|
+
exports.Input = Input;
|
|
41190
|
+
exports.Label = Label;
|
|
40539
41191
|
exports.Material = Material;
|
|
40540
41192
|
exports.MeshCollider = MeshCollider;
|
|
40541
41193
|
exports.MeshRenderer = MeshRenderer;
|
|
@@ -40569,21 +41221,25 @@
|
|
|
40569
41221
|
exports.PBMeshRenderer_PlaneMesh = PBMeshRenderer_PlaneMesh;
|
|
40570
41222
|
exports.PBMeshRenderer_SphereMesh = PBMeshRenderer_SphereMesh;
|
|
40571
41223
|
exports.PBNftShape = PBNftShape;
|
|
41224
|
+
exports.PBPointerEvents = PBPointerEvents;
|
|
40572
41225
|
exports.PBPointerEventsResult = PBPointerEventsResult;
|
|
40573
41226
|
exports.PBPointerEventsResult_PointerCommand = PBPointerEventsResult_PointerCommand;
|
|
40574
|
-
exports.
|
|
40575
|
-
exports.
|
|
40576
|
-
exports.PBPointerHoverFeedback_Info = PBPointerHoverFeedback_Info;
|
|
41227
|
+
exports.PBPointerEvents_Entry = PBPointerEvents_Entry;
|
|
41228
|
+
exports.PBPointerEvents_Info = PBPointerEvents_Info;
|
|
40577
41229
|
exports.PBPointerLock = PBPointerLock;
|
|
40578
41230
|
exports.PBRaycast = PBRaycast;
|
|
40579
41231
|
exports.PBRaycastResult = PBRaycastResult;
|
|
40580
41232
|
exports.PBTextShape = PBTextShape;
|
|
40581
41233
|
exports.PBUiBackground = PBUiBackground;
|
|
41234
|
+
exports.PBUiDropdown = PBUiDropdown;
|
|
41235
|
+
exports.PBUiDropdownResult = PBUiDropdownResult;
|
|
41236
|
+
exports.PBUiInput = PBUiInput;
|
|
41237
|
+
exports.PBUiInputResult = PBUiInputResult;
|
|
40582
41238
|
exports.PBUiText = PBUiText;
|
|
40583
41239
|
exports.PBUiTransform = PBUiTransform;
|
|
40584
41240
|
exports.PBVisibilityComponent = PBVisibilityComponent;
|
|
41241
|
+
exports.PointerEvents = PointerEvents;
|
|
40585
41242
|
exports.PointerEventsResult = PointerEventsResult;
|
|
40586
|
-
exports.PointerHoverFeedback = PointerHoverFeedback;
|
|
40587
41243
|
exports.PointerLock = PointerLock;
|
|
40588
41244
|
exports.RAD2DEG = RAD2DEG;
|
|
40589
41245
|
exports.Raycast = Raycast;
|
|
@@ -40598,7 +41254,11 @@
|
|
|
40598
41254
|
exports.ToLinearSpace = ToLinearSpace;
|
|
40599
41255
|
exports.Transform = Transform;
|
|
40600
41256
|
exports.UiBackground = UiBackground;
|
|
41257
|
+
exports.UiDropdown = UiDropdown;
|
|
41258
|
+
exports.UiDropdownResult = UiDropdownResult;
|
|
40601
41259
|
exports.UiEntity = UiEntity;
|
|
41260
|
+
exports.UiInput = UiInput;
|
|
41261
|
+
exports.UiInputResult = UiInputResult;
|
|
40602
41262
|
exports.UiText = UiText;
|
|
40603
41263
|
exports.UiTransform = UiTransform;
|
|
40604
41264
|
exports.VisibilityComponent = VisibilityComponent;
|