@lv-x-software-house/x_view 1.2.4-dev.27 → 1.2.4-dev.28

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
@@ -1011,7 +1011,8 @@ var createNodeMesh = (nodeData, position, glowTexture) => {
1011
1011
  const size = nodeData.size || "medium";
1012
1012
  const scale = NODE_SCALE_FACTORS[size] || 1;
1013
1013
  mesh.scale.set(scale, scale, scale);
1014
- const label = createTextSprite(nodeData.name);
1014
+ const labelText = nodeData.is_quest && nodeData.raw_title ? nodeData.raw_title : nodeData.name;
1015
+ const label = createTextSprite(labelText);
1015
1016
  label.name = "label";
1016
1017
  mesh.userData.labelObject = label;
1017
1018
  mesh.userData.labelOffset = new THREE.Vector3(0, 3.8, 0);
@@ -1116,13 +1117,15 @@ var updateExistingNodeVisuals = (state, updatedNode) => {
1116
1117
  const size = updatedNode.size || "medium";
1117
1118
  const scale = NODE_SCALE_FACTORS[size] || 1;
1118
1119
  existingMesh.scale.set(scale, scale, scale);
1119
- if (existingMesh.userData.name !== updatedNode.name) {
1120
+ const oldText = existingMesh.userData.is_quest && existingMesh.userData.raw_title ? existingMesh.userData.raw_title : existingMesh.userData.name;
1121
+ const newText = updatedNode.is_quest && updatedNode.raw_title ? updatedNode.raw_title : updatedNode.name;
1122
+ if (oldText !== newText) {
1120
1123
  const oldLabelToDispose = existingMesh.userData.labelObject;
1121
1124
  if (oldLabelToDispose && state.graphGroup) {
1122
1125
  state.graphGroup.remove(oldLabelToDispose);
1123
1126
  if (oldLabelToDispose.material) oldLabelToDispose.material.dispose();
1124
1127
  }
1125
- const newLabel = createTextSprite(updatedNode.name || "");
1128
+ const newLabel = createTextSprite(newText || "");
1126
1129
  newLabel.name = "label";
1127
1130
  existingMesh.userData.labelObject = newLabel;
1128
1131
  if (state.graphGroup) {
@@ -8099,7 +8102,7 @@ function InSceneQuestForm({
8099
8102
  onChange: (e) => {
8100
8103
  const val = e.target.value;
8101
8104
  setName(val);
8102
- onNameChange == null ? void 0 : onNameChange(`${viewName} - ${questCounter} - \xBB ${val || "Nova Quest"}`);
8105
+ onNameChange == null ? void 0 : onNameChange(val || "Nova Quest");
8103
8106
  },
8104
8107
  className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60"
8105
8108
  }
@@ -11852,7 +11855,9 @@ function XViewScene({
11852
11855
  if (oldLabel.material.map) oldLabel.material.map.dispose();
11853
11856
  oldLabel.material.dispose();
11854
11857
  }
11855
- const newLabel = createTextSprite(newName || "");
11858
+ const isQuest = mesh.userData.is_quest;
11859
+ const displayText = isQuest && newRawTitle !== void 0 ? newRawTitle : newName;
11860
+ const newLabel = createTextSprite(displayText || "");
11856
11861
  graphGroup.add(newLabel);
11857
11862
  mesh.userData.labelObject = newLabel;
11858
11863
  mesh.userData.name = newName;
@@ -12033,15 +12038,14 @@ function XViewScene({
12033
12038
  graphDataRef.current[sceneConfigId2] = { nodes: [], links: [] };
12034
12039
  }
12035
12040
  graphDataRef.current[sceneConfigId2].nodes.push(newNode);
12036
- sceneDataRef2.current.nodes.push(newNode);
12037
12041
  const sceneFileData = {
12038
12042
  parent_dbs: sceneDataRef2.current.parent_dbs,
12039
12043
  nodes: sceneDataRef2.current.nodes,
12044
+ // Permanece intacto, como estava no último save de cena inicial
12040
12045
  links: sceneDataRef2.current.links,
12041
12046
  quest_nodes: graphDataRef.current[sceneConfigId2].nodes,
12042
12047
  quest_links: graphDataRef.current[sceneConfigId2].links,
12043
12048
  quest_counter: currentCounter + 1
12044
- // NOVO: Incrementa o contador nos metadados
12045
12049
  };
12046
12050
  try {
12047
12051
  await actions.save_view_data(sceneSaveUrl2, sceneFileData);
package/dist/index.mjs CHANGED
@@ -967,7 +967,8 @@ var createNodeMesh = (nodeData, position, glowTexture) => {
967
967
  const size = nodeData.size || "medium";
968
968
  const scale = NODE_SCALE_FACTORS[size] || 1;
969
969
  mesh.scale.set(scale, scale, scale);
970
- const label = createTextSprite(nodeData.name);
970
+ const labelText = nodeData.is_quest && nodeData.raw_title ? nodeData.raw_title : nodeData.name;
971
+ const label = createTextSprite(labelText);
971
972
  label.name = "label";
972
973
  mesh.userData.labelObject = label;
973
974
  mesh.userData.labelOffset = new THREE.Vector3(0, 3.8, 0);
@@ -1072,13 +1073,15 @@ var updateExistingNodeVisuals = (state, updatedNode) => {
1072
1073
  const size = updatedNode.size || "medium";
1073
1074
  const scale = NODE_SCALE_FACTORS[size] || 1;
1074
1075
  existingMesh.scale.set(scale, scale, scale);
1075
- if (existingMesh.userData.name !== updatedNode.name) {
1076
+ const oldText = existingMesh.userData.is_quest && existingMesh.userData.raw_title ? existingMesh.userData.raw_title : existingMesh.userData.name;
1077
+ const newText = updatedNode.is_quest && updatedNode.raw_title ? updatedNode.raw_title : updatedNode.name;
1078
+ if (oldText !== newText) {
1076
1079
  const oldLabelToDispose = existingMesh.userData.labelObject;
1077
1080
  if (oldLabelToDispose && state.graphGroup) {
1078
1081
  state.graphGroup.remove(oldLabelToDispose);
1079
1082
  if (oldLabelToDispose.material) oldLabelToDispose.material.dispose();
1080
1083
  }
1081
- const newLabel = createTextSprite(updatedNode.name || "");
1084
+ const newLabel = createTextSprite(newText || "");
1082
1085
  newLabel.name = "label";
1083
1086
  existingMesh.userData.labelObject = newLabel;
1084
1087
  if (state.graphGroup) {
@@ -8086,7 +8089,7 @@ function InSceneQuestForm({
8086
8089
  onChange: (e) => {
8087
8090
  const val = e.target.value;
8088
8091
  setName(val);
8089
- onNameChange == null ? void 0 : onNameChange(`${viewName} - ${questCounter} - \xBB ${val || "Nova Quest"}`);
8092
+ onNameChange == null ? void 0 : onNameChange(val || "Nova Quest");
8090
8093
  },
8091
8094
  className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60"
8092
8095
  }
@@ -11852,7 +11855,9 @@ function XViewScene({
11852
11855
  if (oldLabel.material.map) oldLabel.material.map.dispose();
11853
11856
  oldLabel.material.dispose();
11854
11857
  }
11855
- const newLabel = createTextSprite(newName || "");
11858
+ const isQuest = mesh.userData.is_quest;
11859
+ const displayText = isQuest && newRawTitle !== void 0 ? newRawTitle : newName;
11860
+ const newLabel = createTextSprite(displayText || "");
11856
11861
  graphGroup.add(newLabel);
11857
11862
  mesh.userData.labelObject = newLabel;
11858
11863
  mesh.userData.name = newName;
@@ -12033,15 +12038,14 @@ function XViewScene({
12033
12038
  graphDataRef.current[sceneConfigId2] = { nodes: [], links: [] };
12034
12039
  }
12035
12040
  graphDataRef.current[sceneConfigId2].nodes.push(newNode);
12036
- sceneDataRef2.current.nodes.push(newNode);
12037
12041
  const sceneFileData = {
12038
12042
  parent_dbs: sceneDataRef2.current.parent_dbs,
12039
12043
  nodes: sceneDataRef2.current.nodes,
12044
+ // Permanece intacto, como estava no último save de cena inicial
12040
12045
  links: sceneDataRef2.current.links,
12041
12046
  quest_nodes: graphDataRef.current[sceneConfigId2].nodes,
12042
12047
  quest_links: graphDataRef.current[sceneConfigId2].links,
12043
12048
  quest_counter: currentCounter + 1
12044
- // NOVO: Incrementa o contador nos metadados
12045
12049
  };
12046
12050
  try {
12047
12051
  await actions.save_view_data(sceneSaveUrl2, sceneFileData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.4-dev.27",
3
+ "version": "1.2.4-dev.28",
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",