@lv-x-software-house/x_view 1.2.5-dev.15 → 1.2.5-dev.16

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
@@ -646,8 +646,10 @@ function XViewSidebar({
646
646
  const typesSet = /* @__PURE__ */ new Set();
647
647
  (dbNodes || []).forEach((node) => {
648
648
  if (Array.isArray(node.type)) {
649
- node.type.forEach((t) => typesSet.add(t));
650
- } else if (node.type) {
649
+ node.type.forEach((t) => {
650
+ if (t && typeof t === "string" && t.trim() !== "") typesSet.add(t);
651
+ });
652
+ } else if (node.type && typeof node.type === "string" && node.type.trim() !== "") {
651
653
  typesSet.add(node.type);
652
654
  }
653
655
  });
@@ -7755,11 +7757,12 @@ function InSceneCreationForm({
7755
7757
  }, [hasImages, useImageAsTexture, onImageChange]);
7756
7758
  (0, import_react14.useEffect)(() => {
7757
7759
  let result = [];
7760
+ const validExistingTypes = existingTypes.filter((t) => t && typeof t === "string" && t.trim() !== "");
7758
7761
  if (typeInput.trim() === "") {
7759
- result = existingTypes.filter((t) => !types.includes(t));
7762
+ result = validExistingTypes.filter((t) => !types.includes(t));
7760
7763
  } else {
7761
7764
  const lowercasedInput = typeInput.toLowerCase();
7762
- result = existingTypes.filter(
7765
+ result = validExistingTypes.filter(
7763
7766
  (t) => t.toLowerCase().includes(lowercasedInput) && !types.includes(t)
7764
7767
  );
7765
7768
  }
@@ -8607,12 +8610,13 @@ function NodeDetailsPanel({
8607
8610
  }
8608
8611
  }, [hasImages, useImageAsTexture]);
8609
8612
  (0, import_react17.useEffect)(() => {
8613
+ const validExistingTypes = existingTypes.filter((t) => t && typeof t === "string" && t.trim() !== "");
8610
8614
  if (typeInput.trim() === "") {
8611
- setFilteredTypes(existingTypes.filter((t) => !types.includes(t)));
8615
+ setFilteredTypes(validExistingTypes.filter((t) => !types.includes(t)));
8612
8616
  } else {
8613
8617
  const lowercasedInput = typeInput.toLowerCase();
8614
8618
  setFilteredTypes(
8615
- existingTypes.filter(
8619
+ validExistingTypes.filter(
8616
8620
  (t) => t.toLowerCase().includes(lowercasedInput) && !types.includes(t)
8617
8621
  )
8618
8622
  );
@@ -9108,12 +9112,13 @@ function QuestDetailsPanel({
9108
9112
  }
9109
9113
  }, [node]);
9110
9114
  (0, import_react18.useEffect)(() => {
9115
+ const validExistingTypes = existingTypes.filter((t) => t && typeof t === "string" && t.trim() !== "");
9111
9116
  if (typeInput.trim() === "") {
9112
- setFilteredTypes(existingTypes.filter((t) => !types.includes(t)));
9117
+ setFilteredTypes(validExistingTypes.filter((t) => !types.includes(t)));
9113
9118
  } else {
9114
9119
  const lowercasedInput = typeInput.toLowerCase();
9115
9120
  setFilteredTypes(
9116
- existingTypes.filter(
9121
+ validExistingTypes.filter(
9117
9122
  (t) => t.toLowerCase().includes(lowercasedInput) && !types.includes(t)
9118
9123
  )
9119
9124
  );
package/dist/index.mjs CHANGED
@@ -607,8 +607,10 @@ function XViewSidebar({
607
607
  const typesSet = /* @__PURE__ */ new Set();
608
608
  (dbNodes || []).forEach((node) => {
609
609
  if (Array.isArray(node.type)) {
610
- node.type.forEach((t) => typesSet.add(t));
611
- } else if (node.type) {
610
+ node.type.forEach((t) => {
611
+ if (t && typeof t === "string" && t.trim() !== "") typesSet.add(t);
612
+ });
613
+ } else if (node.type && typeof node.type === "string" && node.type.trim() !== "") {
612
614
  typesSet.add(node.type);
613
615
  }
614
616
  });
@@ -7747,11 +7749,12 @@ function InSceneCreationForm({
7747
7749
  }, [hasImages, useImageAsTexture, onImageChange]);
7748
7750
  useEffect13(() => {
7749
7751
  let result = [];
7752
+ const validExistingTypes = existingTypes.filter((t) => t && typeof t === "string" && t.trim() !== "");
7750
7753
  if (typeInput.trim() === "") {
7751
- result = existingTypes.filter((t) => !types.includes(t));
7754
+ result = validExistingTypes.filter((t) => !types.includes(t));
7752
7755
  } else {
7753
7756
  const lowercasedInput = typeInput.toLowerCase();
7754
- result = existingTypes.filter(
7757
+ result = validExistingTypes.filter(
7755
7758
  (t) => t.toLowerCase().includes(lowercasedInput) && !types.includes(t)
7756
7759
  );
7757
7760
  }
@@ -8599,12 +8602,13 @@ function NodeDetailsPanel({
8599
8602
  }
8600
8603
  }, [hasImages, useImageAsTexture]);
8601
8604
  useEffect15(() => {
8605
+ const validExistingTypes = existingTypes.filter((t) => t && typeof t === "string" && t.trim() !== "");
8602
8606
  if (typeInput.trim() === "") {
8603
- setFilteredTypes(existingTypes.filter((t) => !types.includes(t)));
8607
+ setFilteredTypes(validExistingTypes.filter((t) => !types.includes(t)));
8604
8608
  } else {
8605
8609
  const lowercasedInput = typeInput.toLowerCase();
8606
8610
  setFilteredTypes(
8607
- existingTypes.filter(
8611
+ validExistingTypes.filter(
8608
8612
  (t) => t.toLowerCase().includes(lowercasedInput) && !types.includes(t)
8609
8613
  )
8610
8614
  );
@@ -9100,12 +9104,13 @@ function QuestDetailsPanel({
9100
9104
  }
9101
9105
  }, [node]);
9102
9106
  useEffect16(() => {
9107
+ const validExistingTypes = existingTypes.filter((t) => t && typeof t === "string" && t.trim() !== "");
9103
9108
  if (typeInput.trim() === "") {
9104
- setFilteredTypes(existingTypes.filter((t) => !types.includes(t)));
9109
+ setFilteredTypes(validExistingTypes.filter((t) => !types.includes(t)));
9105
9110
  } else {
9106
9111
  const lowercasedInput = typeInput.toLowerCase();
9107
9112
  setFilteredTypes(
9108
- existingTypes.filter(
9113
+ validExistingTypes.filter(
9109
9114
  (t) => t.toLowerCase().includes(lowercasedInput) && !types.includes(t)
9110
9115
  )
9111
9116
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.5-dev.15",
3
+ "version": "1.2.5-dev.16",
4
4
  "description": "Pacote privado contendo os componentes e lógica de renderização 3D do X View.",
5
5
  "author": "iv.x - Engenharia de Software - ivxsoftwarehouse@gmail.com",
6
6
  "license": "UNLICENSED",