@lv-x-software-house/x_view 1.2.2-dev.1 → 1.2.2-dev.3

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
@@ -855,7 +855,6 @@ var x_view_config = {
855
855
  ANCESTOR_HIGHLIGHT_COLOR: "#FFD700",
856
856
  BLOOM_EFFECT: { strength: 1.35, radius: 0.6, threshold: 0.52 },
857
857
  EMISSIVE_MULTIPLIER: {
858
- // AJUSTE: Valores agora representam ADIÇÃO de intensidade, não multiplicação
859
858
  BASE: 0,
860
859
  HOVER: 2,
861
860
  SELECTED: 1.5,
@@ -907,7 +906,6 @@ var computeNodeMaterialProps = (colorHex) => {
907
906
  return {
908
907
  color: srgb,
909
908
  emissive: emissiveColor
910
- // Intensity é controlada externamente
911
909
  };
912
910
  };
913
911
  var createNodeMesh = (nodeData, position, glowTexture) => {
@@ -1198,6 +1196,7 @@ var createMultipleLinkLines = (linksArray, sourceNodeMesh, targetNodeMesh, resol
1198
1196
  resolution,
1199
1197
  isCurved,
1200
1198
  isCurved,
1199
+ isCurved,
1201
1200
  curveOffset
1202
1201
  );
1203
1202
  line.userData = {
@@ -1574,12 +1573,12 @@ var userActionHandlers = {
1574
1573
  stateRef.current.creation = { isActive: true, sourceNodeData };
1575
1574
  const ghostGeometry = new THREE.SphereGeometry(1.5, 32, 32);
1576
1575
  const sourceColor = sourceNodeData.color || "#cccccc";
1577
- const { emissiveIntensity } = computeNodeMaterialProps(sourceColor);
1578
- const ghostColor = new THREE.Color(sourceColor);
1576
+ const { color: ghostColor, emissive: ghostEmissive } = computeNodeMaterialProps(sourceColor);
1579
1577
  const ghostMaterial = new THREE.MeshStandardMaterial({
1580
1578
  color: ghostColor,
1581
- emissive: ghostColor,
1582
- emissiveIntensity,
1579
+ emissive: ghostEmissive,
1580
+ emissiveIntensity: MIN_VISIBILITY_INTENSITY,
1581
+ // <-- Forçamos o brilho mínimo
1583
1582
  roughness: 0.6,
1584
1583
  metalness: 0,
1585
1584
  transparent: true,
@@ -1708,12 +1707,12 @@ var userActionHandlers = {
1708
1707
  stateRef.current.creation = { isActive: true, sourceNodeData };
1709
1708
  const ghostGeometry = new THREE.SphereGeometry(1.5, 32, 32);
1710
1709
  const sourceColor = sourceNodeData.color || "#cccccc";
1711
- const { emissiveIntensity } = computeNodeMaterialProps(sourceColor);
1712
- const ghostColor = new THREE.Color(sourceColor);
1710
+ const { color: ghostColor, emissive: ghostEmissive } = computeNodeMaterialProps(sourceColor);
1713
1711
  const ghostMaterial = new THREE.MeshStandardMaterial({
1714
1712
  color: ghostColor,
1715
- emissive: ghostColor,
1716
- emissiveIntensity,
1713
+ emissive: ghostEmissive,
1714
+ emissiveIntensity: MIN_VISIBILITY_INTENSITY,
1715
+ // <-- Forçamos o brilho mínimo
1717
1716
  roughness: 0.6,
1718
1717
  metalness: 0,
1719
1718
  transparent: true,
@@ -10504,32 +10503,33 @@ function XViewScene({
10504
10503
  const handleGhostNodeColorChange = (newColor) => {
10505
10504
  const { node: ghostNode, aura: ghostAura } = stateRef.current.ghostElements;
10506
10505
  if (!ghostNode) return;
10507
- const { emissiveIntensity } = computeNodeMaterialProps(newColor);
10508
- const pureColor = new THREE3.Color(newColor);
10506
+ const { color, emissive } = computeNodeMaterialProps(newColor);
10507
+ const currentIntensity = ghostNode.userData.intensity !== void 0 ? Number(ghostNode.userData.intensity) : 0;
10508
+ const finalIntensity = currentIntensity + MIN_VISIBILITY_INTENSITY;
10509
10509
  const isImageNode = ghostNode.userData.useImageAsTexture === true || String(ghostNode.userData.useImageAsTexture) === "true";
10510
10510
  if (isImageNode) {
10511
10511
  const borderMesh = ghostNode.getObjectByName("borderRing");
10512
10512
  if (borderMesh && borderMesh.material) {
10513
- borderMesh.material.color.copy(pureColor);
10513
+ borderMesh.material.color.copy(color);
10514
10514
  if (borderMesh.material.emissive) {
10515
- borderMesh.material.emissive.copy(pureColor);
10516
- borderMesh.material.emissiveIntensity = emissiveIntensity;
10515
+ borderMesh.material.emissive.copy(emissive);
10516
+ borderMesh.material.emissiveIntensity = finalIntensity;
10517
10517
  }
10518
10518
  }
10519
10519
  } else {
10520
10520
  if (ghostNode.material) {
10521
- ghostNode.material.color.copy(pureColor);
10521
+ ghostNode.material.color.copy(color);
10522
10522
  if (ghostNode.material.emissive) {
10523
- ghostNode.material.emissive.copy(pureColor);
10524
- ghostNode.material.emissiveIntensity = emissiveIntensity;
10523
+ ghostNode.material.emissive.copy(emissive);
10524
+ ghostNode.material.emissiveIntensity = finalIntensity;
10525
10525
  }
10526
10526
  }
10527
10527
  }
10528
10528
  if (ghostAura && ghostAura.material) {
10529
- ghostAura.material.color.set(newColor);
10529
+ ghostAura.material.color.copy(color).lerp(new THREE3.Color("#ffffff"), 0.25);
10530
10530
  }
10531
10531
  ghostNode.userData.color = newColor;
10532
- ghostNode.userData._baseEmissiveIntensity = emissiveIntensity;
10532
+ ghostNode.userData._baseEmissiveIntensity = finalIntensity;
10533
10533
  };
10534
10534
  const handleGhostNodeSizeChange = (sizeKey) => {
10535
10535
  const { node: ghostNode } = stateRef.current.ghostElements;
@@ -10570,7 +10570,9 @@ function XViewScene({
10570
10570
  var _a2;
10571
10571
  const mesh = stateRef.current.nodeObjects[String(nodeId)];
10572
10572
  if (!mesh) return;
10573
- const { color, emissive, emissiveIntensity } = computeNodeMaterialProps(newColor);
10573
+ const { color, emissive } = computeNodeMaterialProps(newColor);
10574
+ const currentIntensity = mesh.userData.intensity !== void 0 ? Number(mesh.userData.intensity) : 0;
10575
+ const finalIntensity = currentIntensity + MIN_VISIBILITY_INTENSITY;
10574
10576
  const isImageNode = mesh.userData.useImageAsTexture === true || String(mesh.userData.useImageAsTexture) === "true";
10575
10577
  if (isImageNode) {
10576
10578
  const borderMesh = mesh.getObjectByName("borderRing");
@@ -10578,20 +10580,22 @@ function XViewScene({
10578
10580
  borderMesh.material.color.copy(color);
10579
10581
  if (borderMesh.material.emissive) {
10580
10582
  borderMesh.material.emissive.copy(emissive);
10581
- borderMesh.material.emissiveIntensity = emissiveIntensity;
10583
+ borderMesh.material.emissiveIntensity = finalIntensity;
10582
10584
  }
10583
10585
  }
10584
10586
  } else {
10585
10587
  if (mesh.material) {
10586
10588
  mesh.material.color.copy(color);
10587
10589
  mesh.material.emissive.copy(emissive);
10588
- mesh.material.emissiveIntensity = emissiveIntensity;
10590
+ mesh.material.emissiveIntensity = finalIntensity;
10589
10591
  }
10590
10592
  }
10591
10593
  const aura = mesh.getObjectByName("aura");
10592
- if ((_a2 = aura == null ? void 0 : aura.material) == null ? void 0 : _a2.color) aura.material.color.set(newColor);
10594
+ if ((_a2 = aura == null ? void 0 : aura.material) == null ? void 0 : _a2.color) {
10595
+ aura.material.color.copy(color).lerp(new THREE3.Color("#ffffff"), 0.25);
10596
+ }
10593
10597
  mesh.userData.color = newColor;
10594
- mesh.userData._baseEmissiveIntensity = emissiveIntensity;
10598
+ mesh.userData._baseEmissiveIntensity = finalIntensity;
10595
10599
  };
10596
10600
  const handleDetailNodeSizeChange = (nodeId, newSize) => {
10597
10601
  const mesh = stateRef.current.nodeObjects[String(nodeId)];
package/dist/index.mjs CHANGED
@@ -811,7 +811,6 @@ var x_view_config = {
811
811
  ANCESTOR_HIGHLIGHT_COLOR: "#FFD700",
812
812
  BLOOM_EFFECT: { strength: 1.35, radius: 0.6, threshold: 0.52 },
813
813
  EMISSIVE_MULTIPLIER: {
814
- // AJUSTE: Valores agora representam ADIÇÃO de intensidade, não multiplicação
815
814
  BASE: 0,
816
815
  HOVER: 2,
817
816
  SELECTED: 1.5,
@@ -863,7 +862,6 @@ var computeNodeMaterialProps = (colorHex) => {
863
862
  return {
864
863
  color: srgb,
865
864
  emissive: emissiveColor
866
- // Intensity é controlada externamente
867
865
  };
868
866
  };
869
867
  var createNodeMesh = (nodeData, position, glowTexture) => {
@@ -1154,6 +1152,7 @@ var createMultipleLinkLines = (linksArray, sourceNodeMesh, targetNodeMesh, resol
1154
1152
  resolution,
1155
1153
  isCurved,
1156
1154
  isCurved,
1155
+ isCurved,
1157
1156
  curveOffset
1158
1157
  );
1159
1158
  line.userData = {
@@ -1530,12 +1529,12 @@ var userActionHandlers = {
1530
1529
  stateRef.current.creation = { isActive: true, sourceNodeData };
1531
1530
  const ghostGeometry = new THREE.SphereGeometry(1.5, 32, 32);
1532
1531
  const sourceColor = sourceNodeData.color || "#cccccc";
1533
- const { emissiveIntensity } = computeNodeMaterialProps(sourceColor);
1534
- const ghostColor = new THREE.Color(sourceColor);
1532
+ const { color: ghostColor, emissive: ghostEmissive } = computeNodeMaterialProps(sourceColor);
1535
1533
  const ghostMaterial = new THREE.MeshStandardMaterial({
1536
1534
  color: ghostColor,
1537
- emissive: ghostColor,
1538
- emissiveIntensity,
1535
+ emissive: ghostEmissive,
1536
+ emissiveIntensity: MIN_VISIBILITY_INTENSITY,
1537
+ // <-- Forçamos o brilho mínimo
1539
1538
  roughness: 0.6,
1540
1539
  metalness: 0,
1541
1540
  transparent: true,
@@ -1664,12 +1663,12 @@ var userActionHandlers = {
1664
1663
  stateRef.current.creation = { isActive: true, sourceNodeData };
1665
1664
  const ghostGeometry = new THREE.SphereGeometry(1.5, 32, 32);
1666
1665
  const sourceColor = sourceNodeData.color || "#cccccc";
1667
- const { emissiveIntensity } = computeNodeMaterialProps(sourceColor);
1668
- const ghostColor = new THREE.Color(sourceColor);
1666
+ const { color: ghostColor, emissive: ghostEmissive } = computeNodeMaterialProps(sourceColor);
1669
1667
  const ghostMaterial = new THREE.MeshStandardMaterial({
1670
1668
  color: ghostColor,
1671
- emissive: ghostColor,
1672
- emissiveIntensity,
1669
+ emissive: ghostEmissive,
1670
+ emissiveIntensity: MIN_VISIBILITY_INTENSITY,
1671
+ // <-- Forçamos o brilho mínimo
1673
1672
  roughness: 0.6,
1674
1673
  metalness: 0,
1675
1674
  transparent: true,
@@ -10503,32 +10502,33 @@ function XViewScene({
10503
10502
  const handleGhostNodeColorChange = (newColor) => {
10504
10503
  const { node: ghostNode, aura: ghostAura } = stateRef.current.ghostElements;
10505
10504
  if (!ghostNode) return;
10506
- const { emissiveIntensity } = computeNodeMaterialProps(newColor);
10507
- const pureColor = new THREE3.Color(newColor);
10505
+ const { color, emissive } = computeNodeMaterialProps(newColor);
10506
+ const currentIntensity = ghostNode.userData.intensity !== void 0 ? Number(ghostNode.userData.intensity) : 0;
10507
+ const finalIntensity = currentIntensity + MIN_VISIBILITY_INTENSITY;
10508
10508
  const isImageNode = ghostNode.userData.useImageAsTexture === true || String(ghostNode.userData.useImageAsTexture) === "true";
10509
10509
  if (isImageNode) {
10510
10510
  const borderMesh = ghostNode.getObjectByName("borderRing");
10511
10511
  if (borderMesh && borderMesh.material) {
10512
- borderMesh.material.color.copy(pureColor);
10512
+ borderMesh.material.color.copy(color);
10513
10513
  if (borderMesh.material.emissive) {
10514
- borderMesh.material.emissive.copy(pureColor);
10515
- borderMesh.material.emissiveIntensity = emissiveIntensity;
10514
+ borderMesh.material.emissive.copy(emissive);
10515
+ borderMesh.material.emissiveIntensity = finalIntensity;
10516
10516
  }
10517
10517
  }
10518
10518
  } else {
10519
10519
  if (ghostNode.material) {
10520
- ghostNode.material.color.copy(pureColor);
10520
+ ghostNode.material.color.copy(color);
10521
10521
  if (ghostNode.material.emissive) {
10522
- ghostNode.material.emissive.copy(pureColor);
10523
- ghostNode.material.emissiveIntensity = emissiveIntensity;
10522
+ ghostNode.material.emissive.copy(emissive);
10523
+ ghostNode.material.emissiveIntensity = finalIntensity;
10524
10524
  }
10525
10525
  }
10526
10526
  }
10527
10527
  if (ghostAura && ghostAura.material) {
10528
- ghostAura.material.color.set(newColor);
10528
+ ghostAura.material.color.copy(color).lerp(new THREE3.Color("#ffffff"), 0.25);
10529
10529
  }
10530
10530
  ghostNode.userData.color = newColor;
10531
- ghostNode.userData._baseEmissiveIntensity = emissiveIntensity;
10531
+ ghostNode.userData._baseEmissiveIntensity = finalIntensity;
10532
10532
  };
10533
10533
  const handleGhostNodeSizeChange = (sizeKey) => {
10534
10534
  const { node: ghostNode } = stateRef.current.ghostElements;
@@ -10569,7 +10569,9 @@ function XViewScene({
10569
10569
  var _a2;
10570
10570
  const mesh = stateRef.current.nodeObjects[String(nodeId)];
10571
10571
  if (!mesh) return;
10572
- const { color, emissive, emissiveIntensity } = computeNodeMaterialProps(newColor);
10572
+ const { color, emissive } = computeNodeMaterialProps(newColor);
10573
+ const currentIntensity = mesh.userData.intensity !== void 0 ? Number(mesh.userData.intensity) : 0;
10574
+ const finalIntensity = currentIntensity + MIN_VISIBILITY_INTENSITY;
10573
10575
  const isImageNode = mesh.userData.useImageAsTexture === true || String(mesh.userData.useImageAsTexture) === "true";
10574
10576
  if (isImageNode) {
10575
10577
  const borderMesh = mesh.getObjectByName("borderRing");
@@ -10577,20 +10579,22 @@ function XViewScene({
10577
10579
  borderMesh.material.color.copy(color);
10578
10580
  if (borderMesh.material.emissive) {
10579
10581
  borderMesh.material.emissive.copy(emissive);
10580
- borderMesh.material.emissiveIntensity = emissiveIntensity;
10582
+ borderMesh.material.emissiveIntensity = finalIntensity;
10581
10583
  }
10582
10584
  }
10583
10585
  } else {
10584
10586
  if (mesh.material) {
10585
10587
  mesh.material.color.copy(color);
10586
10588
  mesh.material.emissive.copy(emissive);
10587
- mesh.material.emissiveIntensity = emissiveIntensity;
10589
+ mesh.material.emissiveIntensity = finalIntensity;
10588
10590
  }
10589
10591
  }
10590
10592
  const aura = mesh.getObjectByName("aura");
10591
- if ((_a2 = aura == null ? void 0 : aura.material) == null ? void 0 : _a2.color) aura.material.color.set(newColor);
10593
+ if ((_a2 = aura == null ? void 0 : aura.material) == null ? void 0 : _a2.color) {
10594
+ aura.material.color.copy(color).lerp(new THREE3.Color("#ffffff"), 0.25);
10595
+ }
10592
10596
  mesh.userData.color = newColor;
10593
- mesh.userData._baseEmissiveIntensity = emissiveIntensity;
10597
+ mesh.userData._baseEmissiveIntensity = finalIntensity;
10594
10598
  };
10595
10599
  const handleDetailNodeSizeChange = (nodeId, newSize) => {
10596
10600
  const mesh = stateRef.current.nodeObjects[String(nodeId)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.2-dev.1",
3
+ "version": "1.2.2-dev.3",
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",