@luminocity/lemonate-engine 26.5.1 → 26.5.2

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.
@@ -11390,7 +11390,7 @@ class Item extends EventEmitter {
11390
11390
  }
11391
11391
  }
11392
11392
 
11393
- var engine$1 = "26.5.1";
11393
+ var engine$1 = "26.5.2";
11394
11394
  var bullet = "3.26";
11395
11395
  var lua = "5.4.3";
11396
11396
  var packageVersionInfo = {
@@ -99703,10 +99703,19 @@ class RtItem extends RtBase {
99703
99703
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
99704
99704
  }
99705
99705
  function isValidEnum(value, options) {
99706
- return typeof (value) === 'string' && options.includes(value);
99706
+ return typeof (value) === 'string' && options.find((option) => {
99707
+ if (typeof (option) === 'object')
99708
+ return option.value === value;
99709
+ return option === value;
99710
+ });
99707
99711
  }
99708
99712
  function isValidMultiEnum(value, options) {
99709
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
99713
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
99714
+ }
99715
+ function getEnumOptionsString(options) {
99716
+ return options.reduce((previousValue, currentValue, currentIndex) => {
99717
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
99718
+ });
99710
99719
  }
99711
99720
  if (!field) {
99712
99721
  console.error(`Field ${name} not found!`);
@@ -99768,7 +99777,7 @@ class RtItem extends RtBase {
99768
99777
  }
99769
99778
  case "Enum": {
99770
99779
  if (!isValidEnum(value, field.options)) {
99771
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
99780
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
99772
99781
  return;
99773
99782
  }
99774
99783
  field.value = value;
@@ -99776,7 +99785,7 @@ class RtItem extends RtBase {
99776
99785
  }
99777
99786
  case "MultiEnum": {
99778
99787
  if (!isValidMultiEnum(value, field.options)) {
99779
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
99788
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
99780
99789
  return;
99781
99790
  }
99782
99791
  field.value = value;
@@ -100622,10 +100631,19 @@ class RtSceneObject extends RtBase {
100622
100631
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
100623
100632
  }
100624
100633
  function isValidEnum(value, options) {
100625
- return typeof (value) === 'string' && options.includes(value);
100634
+ return typeof (value) === 'string' && options.find((option) => {
100635
+ if (typeof (option) === 'object')
100636
+ return option.value === value;
100637
+ return option === value;
100638
+ });
100626
100639
  }
100627
100640
  function isValidMultiEnum(value, options) {
100628
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
100641
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
100642
+ }
100643
+ function getEnumOptionsString(options) {
100644
+ return options.reduce((previousValue, currentValue, currentIndex) => {
100645
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
100646
+ });
100629
100647
  }
100630
100648
  if (!field) {
100631
100649
  console.error(`Field ${name} not found!`);
@@ -100686,7 +100704,7 @@ class RtSceneObject extends RtBase {
100686
100704
  }
100687
100705
  case "Enum": {
100688
100706
  if (!isValidEnum(value, field.options)) {
100689
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
100707
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
100690
100708
  return;
100691
100709
  }
100692
100710
  field.value = value;
@@ -100694,7 +100712,7 @@ class RtSceneObject extends RtBase {
100694
100712
  }
100695
100713
  case "MultiEnum": {
100696
100714
  if (!isValidMultiEnum(value, field.options)) {
100697
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
100715
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
100698
100716
  return;
100699
100717
  }
100700
100718
  field.value = value;
package/dist/lemonate.js CHANGED
@@ -88153,7 +88153,7 @@ void main() {
88153
88153
  }
88154
88154
  }
88155
88155
 
88156
- var engine$1 = "26.5.1";
88156
+ var engine$1 = "26.5.2";
88157
88157
  var bullet = "3.26";
88158
88158
  var lua = "5.4.3";
88159
88159
  var packageVersionInfo = {
@@ -236869,10 +236869,19 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
236869
236869
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
236870
236870
  }
236871
236871
  function isValidEnum(value, options) {
236872
- return typeof (value) === 'string' && options.includes(value);
236872
+ return typeof (value) === 'string' && options.find((option) => {
236873
+ if (typeof (option) === 'object')
236874
+ return option.value === value;
236875
+ return option === value;
236876
+ });
236873
236877
  }
236874
236878
  function isValidMultiEnum(value, options) {
236875
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
236879
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
236880
+ }
236881
+ function getEnumOptionsString(options) {
236882
+ return options.reduce((previousValue, currentValue, currentIndex) => {
236883
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
236884
+ });
236876
236885
  }
236877
236886
  if (!field) {
236878
236887
  console.error(`Field ${name} not found!`);
@@ -236934,7 +236943,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
236934
236943
  }
236935
236944
  case "Enum": {
236936
236945
  if (!isValidEnum(value, field.options)) {
236937
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
236946
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
236938
236947
  return;
236939
236948
  }
236940
236949
  field.value = value;
@@ -236942,7 +236951,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
236942
236951
  }
236943
236952
  case "MultiEnum": {
236944
236953
  if (!isValidMultiEnum(value, field.options)) {
236945
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
236954
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
236946
236955
  return;
236947
236956
  }
236948
236957
  field.value = value;
@@ -237788,10 +237797,19 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
237788
237797
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
237789
237798
  }
237790
237799
  function isValidEnum(value, options) {
237791
- return typeof (value) === 'string' && options.includes(value);
237800
+ return typeof (value) === 'string' && options.find((option) => {
237801
+ if (typeof (option) === 'object')
237802
+ return option.value === value;
237803
+ return option === value;
237804
+ });
237792
237805
  }
237793
237806
  function isValidMultiEnum(value, options) {
237794
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
237807
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
237808
+ }
237809
+ function getEnumOptionsString(options) {
237810
+ return options.reduce((previousValue, currentValue, currentIndex) => {
237811
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
237812
+ });
237795
237813
  }
237796
237814
  if (!field) {
237797
237815
  console.error(`Field ${name} not found!`);
@@ -237852,7 +237870,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
237852
237870
  }
237853
237871
  case "Enum": {
237854
237872
  if (!isValidEnum(value, field.options)) {
237855
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
237873
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
237856
237874
  return;
237857
237875
  }
237858
237876
  field.value = value;
@@ -237860,7 +237878,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
237860
237878
  }
237861
237879
  case "MultiEnum": {
237862
237880
  if (!isValidMultiEnum(value, field.options)) {
237863
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
237881
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
237864
237882
  return;
237865
237883
  }
237866
237884
  field.value = value;