@dcl/playground-assets 7.0.6-4180146485.commit-9a7dde9 → 7.0.6-4193722527.commit-97eac4a

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/index.js CHANGED
@@ -7580,6 +7580,12 @@
7580
7580
  create() {
7581
7581
  // TODO: this is a hack.
7582
7582
  return PBAnimator.decode(new Uint8Array());
7583
+ },
7584
+ jsonSchema: {
7585
+ type: "object",
7586
+ properties: {},
7587
+ serializationType: "protocol-buffer",
7588
+ protocolBuffer: "PBAnimator"
7583
7589
  }
7584
7590
  };
7585
7591
 
@@ -7659,6 +7665,12 @@
7659
7665
  create() {
7660
7666
  // TODO: this is a hack.
7661
7667
  return PBAudioSource.decode(new Uint8Array());
7668
+ },
7669
+ jsonSchema: {
7670
+ type: "object",
7671
+ properties: {},
7672
+ serializationType: "protocol-buffer",
7673
+ protocolBuffer: "PBAudioSource"
7662
7674
  }
7663
7675
  };
7664
7676
 
@@ -7726,6 +7738,12 @@
7726
7738
  create() {
7727
7739
  // TODO: this is a hack.
7728
7740
  return PBAudioStream.decode(new Uint8Array());
7741
+ },
7742
+ jsonSchema: {
7743
+ type: "object",
7744
+ properties: {},
7745
+ serializationType: "protocol-buffer",
7746
+ protocolBuffer: "PBAudioStream"
7729
7747
  }
7730
7748
  };
7731
7749
 
@@ -7797,6 +7815,12 @@
7797
7815
  create() {
7798
7816
  // TODO: this is a hack.
7799
7817
  return PBAvatarAttach.decode(new Uint8Array());
7818
+ },
7819
+ jsonSchema: {
7820
+ type: "object",
7821
+ properties: {},
7822
+ serializationType: "protocol-buffer",
7823
+ protocolBuffer: "PBAvatarAttach"
7800
7824
  }
7801
7825
  };
7802
7826
 
@@ -7930,6 +7954,12 @@
7930
7954
  create() {
7931
7955
  // TODO: this is a hack.
7932
7956
  return PBAvatarModifierArea.decode(new Uint8Array());
7957
+ },
7958
+ jsonSchema: {
7959
+ type: "object",
7960
+ properties: {},
7961
+ serializationType: "protocol-buffer",
7962
+ protocolBuffer: "PBAvatarModifierArea"
7933
7963
  }
7934
7964
  };
7935
7965
 
@@ -9517,6 +9547,12 @@
9517
9547
  create() {
9518
9548
  // TODO: this is a hack.
9519
9549
  return PBAvatarShape.decode(new Uint8Array());
9550
+ },
9551
+ jsonSchema: {
9552
+ type: "object",
9553
+ properties: {},
9554
+ serializationType: "protocol-buffer",
9555
+ protocolBuffer: "PBAvatarShape"
9520
9556
  }
9521
9557
  };
9522
9558
 
@@ -9583,6 +9619,12 @@
9583
9619
  create() {
9584
9620
  // TODO: this is a hack.
9585
9621
  return PBBillboard.decode(new Uint8Array());
9622
+ },
9623
+ jsonSchema: {
9624
+ type: "object",
9625
+ properties: {},
9626
+ serializationType: "protocol-buffer",
9627
+ protocolBuffer: "PBBillboard"
9586
9628
  }
9587
9629
  };
9588
9630
 
@@ -9638,6 +9680,12 @@
9638
9680
  create() {
9639
9681
  // TODO: this is a hack.
9640
9682
  return PBCameraMode.decode(new Uint8Array());
9683
+ },
9684
+ jsonSchema: {
9685
+ type: "object",
9686
+ properties: {},
9687
+ serializationType: "protocol-buffer",
9688
+ protocolBuffer: "PBCameraMode"
9641
9689
  }
9642
9690
  };
9643
9691
 
@@ -9699,6 +9747,12 @@
9699
9747
  create() {
9700
9748
  // TODO: this is a hack.
9701
9749
  return PBCameraModeArea.decode(new Uint8Array());
9750
+ },
9751
+ jsonSchema: {
9752
+ type: "object",
9753
+ properties: {},
9754
+ serializationType: "protocol-buffer",
9755
+ protocolBuffer: "PBCameraModeArea"
9702
9756
  }
9703
9757
  };
9704
9758
 
@@ -9754,6 +9808,12 @@
9754
9808
  create() {
9755
9809
  // TODO: this is a hack.
9756
9810
  return PBGltfContainer.decode(new Uint8Array());
9811
+ },
9812
+ jsonSchema: {
9813
+ type: "object",
9814
+ properties: {},
9815
+ serializationType: "protocol-buffer",
9816
+ protocolBuffer: "PBGltfContainer"
9757
9817
  }
9758
9818
  };
9759
9819
 
@@ -10224,6 +10284,12 @@
10224
10284
  create() {
10225
10285
  // TODO: this is a hack.
10226
10286
  return PBMaterial.decode(new Uint8Array());
10287
+ },
10288
+ jsonSchema: {
10289
+ type: "object",
10290
+ properties: {},
10291
+ serializationType: "protocol-buffer",
10292
+ protocolBuffer: "PBMaterial"
10227
10293
  }
10228
10294
  };
10229
10295
 
@@ -10436,6 +10502,12 @@
10436
10502
  create() {
10437
10503
  // TODO: this is a hack.
10438
10504
  return PBMeshCollider.decode(new Uint8Array());
10505
+ },
10506
+ jsonSchema: {
10507
+ type: "object",
10508
+ properties: {},
10509
+ serializationType: "protocol-buffer",
10510
+ protocolBuffer: "PBMeshCollider"
10439
10511
  }
10440
10512
  };
10441
10513
 
@@ -10665,6 +10737,12 @@
10665
10737
  create() {
10666
10738
  // TODO: this is a hack.
10667
10739
  return PBMeshRenderer.decode(new Uint8Array());
10740
+ },
10741
+ jsonSchema: {
10742
+ type: "object",
10743
+ properties: {},
10744
+ serializationType: "protocol-buffer",
10745
+ protocolBuffer: "PBMeshRenderer"
10668
10746
  }
10669
10747
  };
10670
10748
 
@@ -10761,6 +10839,12 @@
10761
10839
  create() {
10762
10840
  // TODO: this is a hack.
10763
10841
  return PBNftShape.decode(new Uint8Array());
10842
+ },
10843
+ jsonSchema: {
10844
+ type: "object",
10845
+ properties: {},
10846
+ serializationType: "protocol-buffer",
10847
+ protocolBuffer: "PBNftShape"
10764
10848
  }
10765
10849
  };
10766
10850
 
@@ -10918,6 +11002,12 @@
10918
11002
  create() {
10919
11003
  // TODO: this is a hack.
10920
11004
  return PBPointerEvents.decode(new Uint8Array());
11005
+ },
11006
+ jsonSchema: {
11007
+ type: "object",
11008
+ properties: {},
11009
+ serializationType: "protocol-buffer",
11010
+ protocolBuffer: "PBPointerEvents"
10921
11011
  }
10922
11012
  };
10923
11013
 
@@ -11154,6 +11244,12 @@
11154
11244
  create() {
11155
11245
  // TODO: this is a hack.
11156
11246
  return PBPointerEventsResult.decode(new Uint8Array());
11247
+ },
11248
+ jsonSchema: {
11249
+ type: "object",
11250
+ properties: {},
11251
+ serializationType: "protocol-buffer",
11252
+ protocolBuffer: "PBPointerEventsResult"
11157
11253
  }
11158
11254
  };
11159
11255
 
@@ -11209,6 +11305,12 @@
11209
11305
  create() {
11210
11306
  // TODO: this is a hack.
11211
11307
  return PBPointerLock.decode(new Uint8Array());
11308
+ },
11309
+ jsonSchema: {
11310
+ type: "object",
11311
+ properties: {},
11312
+ serializationType: "protocol-buffer",
11313
+ protocolBuffer: "PBPointerLock"
11212
11314
  }
11213
11315
  };
11214
11316
 
@@ -11290,6 +11392,12 @@
11290
11392
  create() {
11291
11393
  // TODO: this is a hack.
11292
11394
  return PBRaycast.decode(new Uint8Array());
11395
+ },
11396
+ jsonSchema: {
11397
+ type: "object",
11398
+ properties: {},
11399
+ serializationType: "protocol-buffer",
11400
+ protocolBuffer: "PBRaycast"
11293
11401
  }
11294
11402
  };
11295
11403
 
@@ -11309,6 +11417,12 @@
11309
11417
  create() {
11310
11418
  // TODO: this is a hack.
11311
11419
  return PBRaycastResult.decode(new Uint8Array());
11420
+ },
11421
+ jsonSchema: {
11422
+ type: "object",
11423
+ properties: {},
11424
+ serializationType: "protocol-buffer",
11425
+ protocolBuffer: "PBRaycastResult"
11312
11426
  }
11313
11427
  };
11314
11428
 
@@ -11506,6 +11620,12 @@
11506
11620
  create() {
11507
11621
  // TODO: this is a hack.
11508
11622
  return PBTextShape.decode(new Uint8Array());
11623
+ },
11624
+ jsonSchema: {
11625
+ type: "object",
11626
+ properties: {},
11627
+ serializationType: "protocol-buffer",
11628
+ protocolBuffer: "PBTextShape"
11509
11629
  }
11510
11630
  };
11511
11631
 
@@ -11673,6 +11793,12 @@
11673
11793
  create() {
11674
11794
  // TODO: this is a hack.
11675
11795
  return PBUiBackground.decode(new Uint8Array());
11796
+ },
11797
+ jsonSchema: {
11798
+ type: "object",
11799
+ properties: {},
11800
+ serializationType: "protocol-buffer",
11801
+ protocolBuffer: "PBUiBackground"
11676
11802
  }
11677
11803
  };
11678
11804
 
@@ -11786,6 +11912,12 @@
11786
11912
  create() {
11787
11913
  // TODO: this is a hack.
11788
11914
  return PBUiDropdown.decode(new Uint8Array());
11915
+ },
11916
+ jsonSchema: {
11917
+ type: "object",
11918
+ properties: {},
11919
+ serializationType: "protocol-buffer",
11920
+ protocolBuffer: "PBUiDropdown"
11789
11921
  }
11790
11922
  };
11791
11923
 
@@ -11841,6 +11973,12 @@
11841
11973
  create() {
11842
11974
  // TODO: this is a hack.
11843
11975
  return PBUiDropdownResult.decode(new Uint8Array());
11976
+ },
11977
+ jsonSchema: {
11978
+ type: "object",
11979
+ properties: {},
11980
+ serializationType: "protocol-buffer",
11981
+ protocolBuffer: "PBUiDropdownResult"
11844
11982
  }
11845
11983
  };
11846
11984
 
@@ -11940,6 +12078,12 @@
11940
12078
  create() {
11941
12079
  // TODO: this is a hack.
11942
12080
  return PBUiInput.decode(new Uint8Array());
12081
+ },
12082
+ jsonSchema: {
12083
+ type: "object",
12084
+ properties: {},
12085
+ serializationType: "protocol-buffer",
12086
+ protocolBuffer: "PBUiInput"
11943
12087
  }
11944
12088
  };
11945
12089
 
@@ -11995,6 +12139,12 @@
11995
12139
  create() {
11996
12140
  // TODO: this is a hack.
11997
12141
  return PBUiInputResult.decode(new Uint8Array());
12142
+ },
12143
+ jsonSchema: {
12144
+ type: "object",
12145
+ properties: {},
12146
+ serializationType: "protocol-buffer",
12147
+ protocolBuffer: "PBUiInputResult"
11998
12148
  }
11999
12149
  };
12000
12150
 
@@ -12074,6 +12224,12 @@
12074
12224
  create() {
12075
12225
  // TODO: this is a hack.
12076
12226
  return PBUiText.decode(new Uint8Array());
12227
+ },
12228
+ jsonSchema: {
12229
+ type: "object",
12230
+ properties: {},
12231
+ serializationType: "protocol-buffer",
12232
+ protocolBuffer: "PBUiText"
12077
12233
  }
12078
12234
  };
12079
12235
 
@@ -12576,6 +12732,12 @@
12576
12732
  create() {
12577
12733
  // TODO: this is a hack.
12578
12734
  return PBUiTransform.decode(new Uint8Array());
12735
+ },
12736
+ jsonSchema: {
12737
+ type: "object",
12738
+ properties: {},
12739
+ serializationType: "protocol-buffer",
12740
+ protocolBuffer: "PBUiTransform"
12579
12741
  }
12580
12742
  };
12581
12743
 
@@ -12668,6 +12830,12 @@
12668
12830
  create() {
12669
12831
  // TODO: this is a hack.
12670
12832
  return PBVideoPlayer.decode(new Uint8Array());
12833
+ },
12834
+ jsonSchema: {
12835
+ type: "object",
12836
+ properties: {},
12837
+ serializationType: "protocol-buffer",
12838
+ protocolBuffer: "PBVideoPlayer"
12671
12839
  }
12672
12840
  };
12673
12841
 
@@ -12723,6 +12891,12 @@
12723
12891
  create() {
12724
12892
  // TODO: this is a hack.
12725
12893
  return PBVisibilityComponent.decode(new Uint8Array());
12894
+ },
12895
+ jsonSchema: {
12896
+ type: "object",
12897
+ properties: {},
12898
+ serializationType: "protocol-buffer",
12899
+ protocolBuffer: "PBVisibilityComponent"
12726
12900
  }
12727
12901
  };
12728
12902
 
@@ -12992,6 +13166,38 @@
12992
13166
  parent: 0,
12993
13167
  ...value
12994
13168
  };
13169
+ },
13170
+ jsonSchema: {
13171
+ type: 'object',
13172
+ properties: {
13173
+ position: {
13174
+ type: 'object',
13175
+ properties: {
13176
+ x: { type: 'number' },
13177
+ y: { type: 'number' },
13178
+ z: { type: 'number' }
13179
+ }
13180
+ },
13181
+ scale: {
13182
+ type: 'object',
13183
+ properties: {
13184
+ x: { type: 'number' },
13185
+ y: { type: 'number' },
13186
+ z: { type: 'number' }
13187
+ }
13188
+ },
13189
+ rotation: {
13190
+ type: 'object',
13191
+ properties: {
13192
+ x: { type: 'number' },
13193
+ y: { type: 'number' },
13194
+ z: { type: 'number' },
13195
+ w: { type: 'number' }
13196
+ }
13197
+ },
13198
+ parent: { type: 'integer' }
13199
+ },
13200
+ serializationType: 'transform'
12995
13201
  }
12996
13202
  };
12997
13203
  function defineTransformComponent(engine) {
@@ -13242,6 +13448,11 @@
13242
13448
  },
13243
13449
  create() {
13244
13450
  return [];
13451
+ },
13452
+ jsonSchema: {
13453
+ type: 'array',
13454
+ items: type.jsonSchema,
13455
+ serializationType: 'array'
13245
13456
  }
13246
13457
  };
13247
13458
  };
@@ -13258,6 +13469,10 @@
13258
13469
  },
13259
13470
  create() {
13260
13471
  return false;
13472
+ },
13473
+ jsonSchema: {
13474
+ type: 'boolean',
13475
+ serializationType: 'boolean'
13261
13476
  }
13262
13477
  };
13263
13478
 
@@ -13273,6 +13488,10 @@
13273
13488
  },
13274
13489
  create() {
13275
13490
  return 0;
13491
+ },
13492
+ jsonSchema: {
13493
+ type: 'integer',
13494
+ serializationType: 'int64'
13276
13495
  }
13277
13496
  };
13278
13497
  /**
@@ -13287,6 +13506,10 @@
13287
13506
  },
13288
13507
  create() {
13289
13508
  return 0;
13509
+ },
13510
+ jsonSchema: {
13511
+ type: 'integer',
13512
+ serializationType: 'int32'
13290
13513
  }
13291
13514
  };
13292
13515
  /**
@@ -13301,6 +13524,10 @@
13301
13524
  },
13302
13525
  create() {
13303
13526
  return 0;
13527
+ },
13528
+ jsonSchema: {
13529
+ type: 'integer',
13530
+ serializationType: 'int16'
13304
13531
  }
13305
13532
  };
13306
13533
  /**
@@ -13315,6 +13542,10 @@
13315
13542
  },
13316
13543
  create() {
13317
13544
  return 0;
13545
+ },
13546
+ jsonSchema: {
13547
+ type: 'integer',
13548
+ serializationType: 'int8'
13318
13549
  }
13319
13550
  };
13320
13551
 
@@ -13330,6 +13561,10 @@
13330
13561
  },
13331
13562
  create() {
13332
13563
  return '';
13564
+ },
13565
+ jsonSchema: {
13566
+ type: 'string',
13567
+ serializationType: 'utf8-string'
13333
13568
  }
13334
13569
  };
13335
13570
  /**
@@ -13370,6 +13605,10 @@
13370
13605
  }
13371
13606
  }
13372
13607
  }
13608
+ /**
13609
+ * @internal
13610
+ */
13611
+ const IntEnumReflectionType = 'enum-int';
13373
13612
  /**
13374
13613
  * @internal
13375
13614
  */
@@ -13384,14 +13623,28 @@
13384
13623
  },
13385
13624
  create() {
13386
13625
  return defaultValue;
13626
+ },
13627
+ jsonSchema: {
13628
+ // JSON-schema
13629
+ type: 'integer',
13630
+ enum: Object.values(enumObject).filter((item) => Number.isInteger(item)),
13631
+ default: defaultValue,
13632
+ // @dcl/ecs Schema Spec
13633
+ serializationType: IntEnumReflectionType,
13634
+ enumObject
13387
13635
  }
13388
13636
  };
13389
13637
  };
13638
+ /**
13639
+ * @internal
13640
+ */
13641
+ const StringEnumReflectionType = 'enum-string';
13390
13642
  /**
13391
13643
  * @internal
13392
13644
  */
13393
13645
  const StringEnum = (enumObject, defaultValue) => {
13394
13646
  validateMemberValuesAreStrings(enumObject);
13647
+ // String enum has the exact mapping from key (our reference in code) to values
13395
13648
  return {
13396
13649
  serialize(value, builder) {
13397
13650
  FlatString.serialize(value, builder);
@@ -13401,6 +13654,15 @@
13401
13654
  },
13402
13655
  create() {
13403
13656
  return defaultValue;
13657
+ },
13658
+ jsonSchema: {
13659
+ // JSON-schema
13660
+ type: 'string',
13661
+ enum: Object.values(enumObject),
13662
+ default: defaultValue,
13663
+ // @dcl/ecs Schema Spec
13664
+ serializationType: StringEnumReflectionType,
13665
+ enumObject
13404
13666
  }
13405
13667
  };
13406
13668
  };
@@ -13417,6 +13679,10 @@
13417
13679
  },
13418
13680
  create() {
13419
13681
  return 0.0;
13682
+ },
13683
+ jsonSchema: {
13684
+ type: 'number',
13685
+ serializationType: 'float32'
13420
13686
  }
13421
13687
  };
13422
13688
  /**
@@ -13431,6 +13697,10 @@
13431
13697
  },
13432
13698
  create() {
13433
13699
  return 0.0;
13700
+ },
13701
+ jsonSchema: {
13702
+ type: 'number',
13703
+ serializationType: 'float64'
13434
13704
  }
13435
13705
  };
13436
13706
 
@@ -13452,6 +13722,15 @@
13452
13722
  },
13453
13723
  create() {
13454
13724
  return { r: 0, g: 0, b: 0 };
13725
+ },
13726
+ jsonSchema: {
13727
+ type: 'object',
13728
+ properties: {
13729
+ r: { type: 'number' },
13730
+ g: { type: 'number' },
13731
+ b: { type: 'number' }
13732
+ },
13733
+ serializationType: 'color3'
13455
13734
  }
13456
13735
  };
13457
13736
 
@@ -13475,6 +13754,16 @@
13475
13754
  },
13476
13755
  create() {
13477
13756
  return { r: 0, g: 0, b: 0, a: 0 };
13757
+ },
13758
+ jsonSchema: {
13759
+ type: 'object',
13760
+ properties: {
13761
+ r: { type: 'number' },
13762
+ g: { type: 'number' },
13763
+ b: { type: 'number' },
13764
+ a: { type: 'number' }
13765
+ },
13766
+ serializationType: 'color4'
13478
13767
  }
13479
13768
  };
13480
13769
 
@@ -13490,6 +13779,10 @@
13490
13779
  },
13491
13780
  create() {
13492
13781
  return 0;
13782
+ },
13783
+ jsonSchema: {
13784
+ type: 'integer',
13785
+ serializationType: 'entity'
13493
13786
  }
13494
13787
  };
13495
13788
 
@@ -13513,6 +13806,16 @@
13513
13806
  },
13514
13807
  create() {
13515
13808
  return { x: 0, y: 0, z: 0, w: 0 };
13809
+ },
13810
+ jsonSchema: {
13811
+ type: 'object',
13812
+ properties: {
13813
+ x: { type: 'number' },
13814
+ y: { type: 'number' },
13815
+ z: { type: 'number' },
13816
+ w: { type: 'number' }
13817
+ },
13818
+ serializationType: 'quaternion'
13516
13819
  }
13517
13820
  };
13518
13821
 
@@ -13534,6 +13837,16 @@
13534
13837
  },
13535
13838
  create() {
13536
13839
  return { x: 0, y: 0, z: 0 };
13840
+ },
13841
+ jsonSchema: {
13842
+ type: 'object',
13843
+ properties: {
13844
+ x: { type: 'number' },
13845
+ y: { type: 'number' },
13846
+ z: { type: 'number' },
13847
+ w: { type: 'number' }
13848
+ },
13849
+ serializationType: 'vector3'
13537
13850
  }
13538
13851
  };
13539
13852
 
@@ -13541,6 +13854,10 @@
13541
13854
  * @internal
13542
13855
  */
13543
13856
  const IMap = (spec, defaultValue) => {
13857
+ const specReflection = Object.keys(spec).reduce((specReflection, currentKey) => {
13858
+ specReflection[currentKey] = spec[currentKey].jsonSchema;
13859
+ return specReflection;
13860
+ }, {});
13544
13861
  return {
13545
13862
  serialize(value, builder) {
13546
13863
  for (const key in spec) {
@@ -13567,6 +13884,11 @@
13567
13884
  newValue[key] = spec[key].create();
13568
13885
  }
13569
13886
  return { ...newValue, ...defaultValue, ...base };
13887
+ },
13888
+ jsonSchema: {
13889
+ type: 'object',
13890
+ properties: specReflection,
13891
+ serializationType: 'map'
13570
13892
  }
13571
13893
  };
13572
13894
  };
@@ -13593,6 +13915,11 @@
13593
13915
  },
13594
13916
  create() {
13595
13917
  return undefined;
13918
+ },
13919
+ jsonSchema: {
13920
+ type: spec.jsonSchema.type,
13921
+ serializationType: 'optional',
13922
+ optionalJsonSchema: spec.jsonSchema
13596
13923
  }
13597
13924
  };
13598
13925
  };